@contractspec/lib.example-shared-ui 6.0.17 → 6.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +81 -81
- package/CHANGELOG.md +17 -0
- package/dist/EvolutionDashboard.js +1 -803
- package/dist/EvolutionSidebar.js +1 -531
- package/dist/LocalDataIndicator.js +1 -68
- package/dist/MarkdownView.js +1 -213
- package/dist/OverlayContextProvider.js +1 -202
- package/dist/PersonalizationInsights.js +1 -455
- package/dist/SaveToStudioButton.js +1 -79
- package/dist/SpecDrivenTemplateShell.js +1 -203
- package/dist/SpecEditorPanel.js +17 -364
- package/dist/TemplateShell.js +1 -195
- package/dist/browser/EvolutionDashboard.js +1 -803
- package/dist/browser/EvolutionSidebar.js +1 -531
- package/dist/browser/LocalDataIndicator.js +1 -68
- package/dist/browser/MarkdownView.js +1 -213
- package/dist/browser/OverlayContextProvider.js +1 -202
- package/dist/browser/PersonalizationInsights.js +1 -455
- package/dist/browser/SaveToStudioButton.js +1 -79
- package/dist/browser/SpecDrivenTemplateShell.js +1 -203
- package/dist/browser/SpecEditorPanel.js +17 -364
- package/dist/browser/TemplateShell.js +1 -195
- package/dist/browser/bundles/ExampleTemplateBundle.js +1 -85
- package/dist/browser/bundles/index.js +1 -85
- package/dist/browser/hooks/index.js +40 -1151
- package/dist/browser/hooks/useBehaviorTracking.js +1 -157
- package/dist/browser/hooks/useEvolution.js +1 -260
- package/dist/browser/hooks/useRegistryTemplates.js +1 -31
- package/dist/browser/hooks/useSpecContent.js +17 -224
- package/dist/browser/hooks/useWorkflowComposer.js +24 -483
- package/dist/browser/index.js +40 -3122
- package/dist/browser/lib/component-registry.js +1 -48
- package/dist/browser/lib/runtime-context.js +1 -21
- package/dist/browser/markdown/formatPresentationName.js +1 -9
- package/dist/browser/markdown/useMarkdownPresentation.js +1 -65
- package/dist/browser/utils/fetchPresentationData.js +1 -15
- package/dist/browser/utils/generateSpecFromTemplate.js +16 -62
- package/dist/browser/utils/index.js +16 -76
- package/dist/bundles/ExampleTemplateBundle.js +1 -85
- package/dist/bundles/index.js +1 -85
- package/dist/hooks/index.js +40 -1151
- package/dist/hooks/useBehaviorTracking.js +1 -157
- package/dist/hooks/useEvolution.js +1 -260
- package/dist/hooks/useRegistryTemplates.js +1 -31
- package/dist/hooks/useSpecContent.js +17 -224
- package/dist/hooks/useWorkflowComposer.js +24 -483
- package/dist/index.js +40 -3122
- package/dist/lib/component-registry.js +1 -48
- package/dist/lib/runtime-context.js +1 -21
- package/dist/markdown/formatPresentationName.js +1 -9
- package/dist/markdown/useMarkdownPresentation.js +1 -65
- package/dist/node/EvolutionDashboard.js +1 -803
- package/dist/node/EvolutionSidebar.js +1 -531
- package/dist/node/LocalDataIndicator.js +1 -68
- package/dist/node/MarkdownView.js +1 -213
- package/dist/node/OverlayContextProvider.js +1 -202
- package/dist/node/PersonalizationInsights.js +1 -455
- package/dist/node/SaveToStudioButton.js +1 -79
- package/dist/node/SpecDrivenTemplateShell.js +1 -203
- package/dist/node/SpecEditorPanel.js +17 -364
- package/dist/node/TemplateShell.js +1 -195
- package/dist/node/bundles/ExampleTemplateBundle.js +1 -85
- package/dist/node/bundles/index.js +1 -85
- package/dist/node/hooks/index.js +40 -1151
- package/dist/node/hooks/useBehaviorTracking.js +1 -157
- package/dist/node/hooks/useEvolution.js +1 -260
- package/dist/node/hooks/useRegistryTemplates.js +1 -31
- package/dist/node/hooks/useSpecContent.js +17 -224
- package/dist/node/hooks/useWorkflowComposer.js +24 -483
- package/dist/node/index.js +40 -3122
- package/dist/node/lib/component-registry.js +1 -48
- package/dist/node/lib/runtime-context.js +1 -21
- package/dist/node/markdown/formatPresentationName.js +1 -9
- package/dist/node/markdown/useMarkdownPresentation.js +1 -65
- package/dist/node/utils/fetchPresentationData.js +1 -15
- package/dist/node/utils/generateSpecFromTemplate.js +16 -62
- package/dist/node/utils/index.js +16 -76
- package/dist/utils/fetchPresentationData.js +1 -15
- package/dist/utils/generateSpecFromTemplate.js +16 -62
- package/dist/utils/index.js +16 -76
- package/package.json +13 -13
- package/src/lib/component-registry.tsx +2 -1
- package/src/lib/runtime-context.tsx +1 -1
- package/src/lib/singletons.test.ts +19 -22
|
@@ -1,195 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
3
|
-
"use client";
|
|
4
|
-
var TEMPLATE_RUNTIME_CONTEXT_KEY = Symbol.for("@contractspec/lib.example-shared-ui/template-runtime-context");
|
|
5
|
-
function getTemplateRuntimeContextSingleton() {
|
|
6
|
-
const store = globalThis;
|
|
7
|
-
store[TEMPLATE_RUNTIME_CONTEXT_KEY] ??= createContext(null);
|
|
8
|
-
return store[TEMPLATE_RUNTIME_CONTEXT_KEY];
|
|
9
|
-
}
|
|
10
|
-
var TemplateRuntimeContext = getTemplateRuntimeContextSingleton();
|
|
11
|
-
function useTemplateRuntime() {
|
|
12
|
-
const context = useContext(TemplateRuntimeContext);
|
|
13
|
-
if (!context) {
|
|
14
|
-
throw new Error("useTemplateRuntime must be used within a TemplateRuntimeProvider");
|
|
15
|
-
}
|
|
16
|
-
return context;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// src/LocalDataIndicator.tsx
|
|
20
|
-
import { RefreshCw, Shield } from "lucide-react";
|
|
21
|
-
import { useState } from "react";
|
|
22
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
23
|
-
"use client";
|
|
24
|
-
function LocalDataIndicator() {
|
|
25
|
-
const { projectId, templateId, template, installer } = useTemplateRuntime();
|
|
26
|
-
const [isResetting, setIsResetting] = useState(false);
|
|
27
|
-
const handleReset = async () => {
|
|
28
|
-
setIsResetting(true);
|
|
29
|
-
try {
|
|
30
|
-
await installer.install(templateId, { projectId });
|
|
31
|
-
} finally {
|
|
32
|
-
setIsResetting(false);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
36
|
-
className: "inline-flex items-center gap-2 rounded-full border border-border bg-muted/40 px-3 py-1 text-muted-foreground text-xs",
|
|
37
|
-
children: [
|
|
38
|
-
/* @__PURE__ */ jsxDEV(Shield, {
|
|
39
|
-
className: "h-3.5 w-3.5 text-violet-400"
|
|
40
|
-
}, undefined, false, undefined, this),
|
|
41
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
42
|
-
children: [
|
|
43
|
-
"Local runtime ·",
|
|
44
|
-
" ",
|
|
45
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
46
|
-
className: "font-semibold text-foreground",
|
|
47
|
-
children: template.name
|
|
48
|
-
}, undefined, false, undefined, this)
|
|
49
|
-
]
|
|
50
|
-
}, undefined, true, undefined, this),
|
|
51
|
-
/* @__PURE__ */ jsxDEV("button", {
|
|
52
|
-
type: "button",
|
|
53
|
-
className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 font-semibold text-[11px] text-muted-foreground hover:text-foreground",
|
|
54
|
-
onClick: handleReset,
|
|
55
|
-
disabled: isResetting,
|
|
56
|
-
children: [
|
|
57
|
-
/* @__PURE__ */ jsxDEV(RefreshCw, {
|
|
58
|
-
className: "h-3 w-3"
|
|
59
|
-
}, undefined, false, undefined, this),
|
|
60
|
-
isResetting ? "Resetting…" : "Reset data"
|
|
61
|
-
]
|
|
62
|
-
}, undefined, true, undefined, this)
|
|
63
|
-
]
|
|
64
|
-
}, undefined, true, undefined, this);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// src/SaveToStudioButton.tsx
|
|
68
|
-
import { Sparkles } from "lucide-react";
|
|
69
|
-
import { useState as useState2 } from "react";
|
|
70
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
71
|
-
"use client";
|
|
72
|
-
function SaveToStudioButton({
|
|
73
|
-
organizationId = "demo-org",
|
|
74
|
-
projectName,
|
|
75
|
-
endpoint,
|
|
76
|
-
token
|
|
77
|
-
}) {
|
|
78
|
-
const { installer, templateId, template } = useTemplateRuntime();
|
|
79
|
-
const [status, setStatus] = useState2("idle");
|
|
80
|
-
const [error, setError] = useState2(null);
|
|
81
|
-
const handleSave = async () => {
|
|
82
|
-
setStatus("saving");
|
|
83
|
-
setError(null);
|
|
84
|
-
try {
|
|
85
|
-
await installer.saveToStudio({
|
|
86
|
-
templateId,
|
|
87
|
-
projectName: projectName ?? `${template.name} demo`,
|
|
88
|
-
organizationId,
|
|
89
|
-
endpoint,
|
|
90
|
-
token
|
|
91
|
-
});
|
|
92
|
-
setStatus("saved");
|
|
93
|
-
setTimeout(() => setStatus("idle"), 3000);
|
|
94
|
-
} catch (err) {
|
|
95
|
-
setStatus("error");
|
|
96
|
-
setError(err instanceof Error ? err.message : "Unknown error");
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
100
|
-
className: "flex flex-col items-end gap-1",
|
|
101
|
-
children: [
|
|
102
|
-
/* @__PURE__ */ jsxDEV2("button", {
|
|
103
|
-
type: "button",
|
|
104
|
-
className: "btn-primary inline-flex items-center gap-2 text-sm",
|
|
105
|
-
onClick: handleSave,
|
|
106
|
-
disabled: status === "saving",
|
|
107
|
-
children: [
|
|
108
|
-
/* @__PURE__ */ jsxDEV2(Sparkles, {
|
|
109
|
-
className: "h-4 w-4"
|
|
110
|
-
}, undefined, false, undefined, this),
|
|
111
|
-
status === "saving" ? "Publishing…" : "Save to Studio"
|
|
112
|
-
]
|
|
113
|
-
}, undefined, true, undefined, this),
|
|
114
|
-
status === "error" && error ? /* @__PURE__ */ jsxDEV2("p", {
|
|
115
|
-
className: "text-destructive text-xs",
|
|
116
|
-
children: error
|
|
117
|
-
}, undefined, false, undefined, this) : null,
|
|
118
|
-
status === "saved" ? /* @__PURE__ */ jsxDEV2("p", {
|
|
119
|
-
className: "text-emerald-400 text-xs",
|
|
120
|
-
children: "Template sent to Studio."
|
|
121
|
-
}, undefined, false, undefined, this) : null
|
|
122
|
-
]
|
|
123
|
-
}, undefined, true, undefined, this);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// src/TemplateShell.tsx
|
|
127
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
128
|
-
var TemplateShell = ({
|
|
129
|
-
title,
|
|
130
|
-
description,
|
|
131
|
-
sidebar,
|
|
132
|
-
actions,
|
|
133
|
-
showSaveAction = true,
|
|
134
|
-
saveProps,
|
|
135
|
-
children
|
|
136
|
-
}) => /* @__PURE__ */ jsxDEV3("div", {
|
|
137
|
-
className: "space-y-6",
|
|
138
|
-
children: [
|
|
139
|
-
/* @__PURE__ */ jsxDEV3("header", {
|
|
140
|
-
className: "rounded-2xl border border-border bg-card p-6 shadow-sm",
|
|
141
|
-
children: [
|
|
142
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
143
|
-
className: "flex flex-wrap items-center justify-between gap-4",
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
148
|
-
className: "font-semibold text-muted-foreground text-sm uppercase tracking-wide",
|
|
149
|
-
children: "ContractSpec Templates"
|
|
150
|
-
}, undefined, false, undefined, this),
|
|
151
|
-
/* @__PURE__ */ jsxDEV3("h1", {
|
|
152
|
-
className: "font-bold text-3xl",
|
|
153
|
-
children: title
|
|
154
|
-
}, undefined, false, undefined, this),
|
|
155
|
-
description ? /* @__PURE__ */ jsxDEV3("p", {
|
|
156
|
-
className: "mt-2 max-w-2xl text-muted-foreground text-sm",
|
|
157
|
-
children: description
|
|
158
|
-
}, undefined, false, undefined, this) : null
|
|
159
|
-
]
|
|
160
|
-
}, undefined, true, undefined, this),
|
|
161
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
162
|
-
className: "flex flex-col items-end gap-2",
|
|
163
|
-
children: [
|
|
164
|
-
/* @__PURE__ */ jsxDEV3(LocalDataIndicator, {}, undefined, false, undefined, this),
|
|
165
|
-
showSaveAction ? /* @__PURE__ */ jsxDEV3(SaveToStudioButton, {
|
|
166
|
-
...saveProps
|
|
167
|
-
}, undefined, false, undefined, this) : null
|
|
168
|
-
]
|
|
169
|
-
}, undefined, true, undefined, this)
|
|
170
|
-
]
|
|
171
|
-
}, undefined, true, undefined, this),
|
|
172
|
-
actions ? /* @__PURE__ */ jsxDEV3("div", {
|
|
173
|
-
className: "mt-4",
|
|
174
|
-
children: actions
|
|
175
|
-
}, undefined, false, undefined, this) : null
|
|
176
|
-
]
|
|
177
|
-
}, undefined, true, undefined, this),
|
|
178
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
179
|
-
className: sidebar ? "grid gap-6 lg:grid-cols-[minmax(0,1fr)_320px]" : "w-full",
|
|
180
|
-
children: [
|
|
181
|
-
/* @__PURE__ */ jsxDEV3("main", {
|
|
182
|
-
className: "space-y-4 p-2",
|
|
183
|
-
children
|
|
184
|
-
}, undefined, false, undefined, this),
|
|
185
|
-
sidebar ? /* @__PURE__ */ jsxDEV3("aside", {
|
|
186
|
-
className: "rounded-2xl border border-border bg-card p-4",
|
|
187
|
-
children: sidebar
|
|
188
|
-
}, undefined, false, undefined, this) : null
|
|
189
|
-
]
|
|
190
|
-
}, undefined, true, undefined, this)
|
|
191
|
-
]
|
|
192
|
-
}, undefined, true, undefined, this);
|
|
193
|
-
export {
|
|
194
|
-
TemplateShell
|
|
195
|
-
};
|
|
1
|
+
import{createContext as x,useContext as R}from"react";var S=Symbol.for("@contractspec/lib.example-shared-ui/template-runtime-context");function k(){let e=globalThis;return e[S]??=x(null),e[S]}var B=k();function p(){let e=R(B);if(!e)throw Error("useTemplateRuntime must be used within a TemplateRuntimeProvider");return e}import{RefreshCw as P,Shield as I}from"lucide-react";import{useState as T}from"react";import{jsx as c,jsxs as u}from"react/jsx-runtime";function N(){let{projectId:e,templateId:o,template:a,installer:r}=p(),[l,n]=T(!1),d=async()=>{n(!0);try{await r.install(o,{projectId:e})}finally{n(!1)}};return u("div",{className:"inline-flex items-center gap-2 rounded-full border border-border bg-muted/40 px-3 py-1 text-muted-foreground text-xs",children:[c(I,{className:"h-3.5 w-3.5 text-violet-400"}),u("span",{children:["Local runtime ·"," ",c("span",{className:"font-semibold text-foreground",children:a.name})]}),u("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 font-semibold text-[11px] text-muted-foreground hover:text-foreground",onClick:d,disabled:l,children:[c(P,{className:"h-3 w-3"}),l?"Resetting…":"Reset data"]})]})}import{Sparkles as D}from"lucide-react";import{useState as h}from"react";import{jsx as f,jsxs as y}from"react/jsx-runtime";function w({organizationId:e="demo-org",projectName:o,endpoint:a,token:r}){let{installer:l,templateId:n,template:d}=p(),[s,m]=h("idle"),[v,g]=h(null);return y("div",{className:"flex flex-col items-end gap-1",children:[y("button",{type:"button",className:"btn-primary inline-flex items-center gap-2 text-sm",onClick:async()=>{m("saving"),g(null);try{await l.saveToStudio({templateId:n,projectName:o??`${d.name} demo`,organizationId:e,endpoint:a,token:r}),m("saved"),setTimeout(()=>m("idle"),3000)}catch(b){m("error"),g(b instanceof Error?b.message:"Unknown error")}},disabled:s==="saving",children:[f(D,{className:"h-4 w-4"}),s==="saving"?"Publishing…":"Save to Studio"]}),s==="error"&&v?f("p",{className:"text-destructive text-xs",children:v}):null,s==="saved"?f("p",{className:"text-emerald-400 text-xs",children:"Template sent to Studio."}):null]})}import{jsx as t,jsxs as i}from"react/jsx-runtime";var K=({title:e,description:o,sidebar:a,actions:r,showSaveAction:l=!0,saveProps:n,children:d})=>i("div",{className:"space-y-6",children:[i("header",{className:"rounded-2xl border border-border bg-card p-6 shadow-sm",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[i("div",{children:[t("p",{className:"font-semibold text-muted-foreground text-sm uppercase tracking-wide",children:"ContractSpec Templates"}),t("h1",{className:"font-bold text-3xl",children:e}),o?t("p",{className:"mt-2 max-w-2xl text-muted-foreground text-sm",children:o}):null]}),i("div",{className:"flex flex-col items-end gap-2",children:[t(N,{}),l?t(w,{...n}):null]})]}),r?t("div",{className:"mt-4",children:r}):null]}),i("div",{className:a?"grid gap-6 lg:grid-cols-[minmax(0,1fr)_320px]":"w-full",children:[t("main",{className:"space-y-4 p-2",children:d}),a?t("aside",{className:"rounded-2xl border border-border bg-card p-4",children:a}):null]})]});export{K as TemplateShell};
|
|
@@ -1,85 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec";
|
|
3
|
-
var ExampleTemplateBundle = defineModuleBundle({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "example.template",
|
|
6
|
-
version: "0.1.0",
|
|
7
|
-
title: "Example Template",
|
|
8
|
-
description: "Adaptive template shell for ContractSpec examples",
|
|
9
|
-
owners: ["team-platform"],
|
|
10
|
-
tags: ["example", "template"],
|
|
11
|
-
stability: "experimental"
|
|
12
|
-
},
|
|
13
|
-
routes: [
|
|
14
|
-
{
|
|
15
|
-
routeId: "template",
|
|
16
|
-
path: "/sandbox",
|
|
17
|
-
defaultSurface: "template-shell"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
surfaces: {
|
|
21
|
-
"template-shell": {
|
|
22
|
-
surfaceId: "template-shell",
|
|
23
|
-
kind: "workbench",
|
|
24
|
-
title: "Template Shell",
|
|
25
|
-
slots: [
|
|
26
|
-
{
|
|
27
|
-
slotId: "header",
|
|
28
|
-
role: "header",
|
|
29
|
-
accepts: ["action-bar"],
|
|
30
|
-
cardinality: "many"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
slotId: "primary",
|
|
34
|
-
role: "primary",
|
|
35
|
-
accepts: ["entity-section", "rich-doc", "form", "custom-widget"],
|
|
36
|
-
cardinality: "many"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
slotId: "sidebar",
|
|
40
|
-
role: "secondary",
|
|
41
|
-
accepts: ["entity-section", "custom-widget"],
|
|
42
|
-
cardinality: "one"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
layouts: [
|
|
46
|
-
{
|
|
47
|
-
layoutId: "main-with-sidebar",
|
|
48
|
-
title: "Main with sidebar",
|
|
49
|
-
root: {
|
|
50
|
-
type: "panel-group",
|
|
51
|
-
direction: "horizontal",
|
|
52
|
-
persistKey: "example.template.main-sidebar",
|
|
53
|
-
children: [
|
|
54
|
-
{
|
|
55
|
-
type: "panel-group",
|
|
56
|
-
direction: "vertical",
|
|
57
|
-
persistKey: "example.template.content",
|
|
58
|
-
children: [
|
|
59
|
-
{ type: "slot", slotId: "header" },
|
|
60
|
-
{ type: "slot", slotId: "primary" }
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
{ type: "slot", slotId: "sidebar" }
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
data: [],
|
|
69
|
-
verification: {
|
|
70
|
-
dimensions: {
|
|
71
|
-
guidance: "Can reveal hints and walkthrough notes.",
|
|
72
|
-
density: "Can select compact or balanced layouts.",
|
|
73
|
-
dataDepth: "Controls content depth and expansion.",
|
|
74
|
-
control: "Shows advanced options when allowed.",
|
|
75
|
-
media: "Supports text-first and hybrid modes.",
|
|
76
|
-
pace: "Maps to motion tokens and transitions.",
|
|
77
|
-
narrative: "Can order summary before or after detail."
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
export {
|
|
84
|
-
ExampleTemplateBundle
|
|
85
|
-
};
|
|
1
|
+
import{defineModuleBundle as g}from"@contractspec/lib.surface-runtime/spec";var j=g({meta:{key:"example.template",version:"0.1.0",title:"Example Template",description:"Adaptive template shell for ContractSpec examples",owners:["team-platform"],tags:["example","template"],stability:"experimental"},routes:[{routeId:"template",path:"/sandbox",defaultSurface:"template-shell"}],surfaces:{"template-shell":{surfaceId:"template-shell",kind:"workbench",title:"Template Shell",slots:[{slotId:"header",role:"header",accepts:["action-bar"],cardinality:"many"},{slotId:"primary",role:"primary",accepts:["entity-section","rich-doc","form","custom-widget"],cardinality:"many"},{slotId:"sidebar",role:"secondary",accepts:["entity-section","custom-widget"],cardinality:"one"}],layouts:[{layoutId:"main-with-sidebar",title:"Main with sidebar",root:{type:"panel-group",direction:"horizontal",persistKey:"example.template.main-sidebar",children:[{type:"panel-group",direction:"vertical",persistKey:"example.template.content",children:[{type:"slot",slotId:"header"},{type:"slot",slotId:"primary"}]},{type:"slot",slotId:"sidebar"}]}}],data:[],verification:{dimensions:{guidance:"Can reveal hints and walkthrough notes.",density:"Can select compact or balanced layouts.",dataDepth:"Controls content depth and expansion.",control:"Shows advanced options when allowed.",media:"Supports text-first and hybrid modes.",pace:"Maps to motion tokens and transitions.",narrative:"Can order summary before or after detail."}}}}});export{j as ExampleTemplateBundle};
|
|
@@ -1,85 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec";
|
|
3
|
-
var ExampleTemplateBundle = defineModuleBundle({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "example.template",
|
|
6
|
-
version: "0.1.0",
|
|
7
|
-
title: "Example Template",
|
|
8
|
-
description: "Adaptive template shell for ContractSpec examples",
|
|
9
|
-
owners: ["team-platform"],
|
|
10
|
-
tags: ["example", "template"],
|
|
11
|
-
stability: "experimental"
|
|
12
|
-
},
|
|
13
|
-
routes: [
|
|
14
|
-
{
|
|
15
|
-
routeId: "template",
|
|
16
|
-
path: "/sandbox",
|
|
17
|
-
defaultSurface: "template-shell"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
surfaces: {
|
|
21
|
-
"template-shell": {
|
|
22
|
-
surfaceId: "template-shell",
|
|
23
|
-
kind: "workbench",
|
|
24
|
-
title: "Template Shell",
|
|
25
|
-
slots: [
|
|
26
|
-
{
|
|
27
|
-
slotId: "header",
|
|
28
|
-
role: "header",
|
|
29
|
-
accepts: ["action-bar"],
|
|
30
|
-
cardinality: "many"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
slotId: "primary",
|
|
34
|
-
role: "primary",
|
|
35
|
-
accepts: ["entity-section", "rich-doc", "form", "custom-widget"],
|
|
36
|
-
cardinality: "many"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
slotId: "sidebar",
|
|
40
|
-
role: "secondary",
|
|
41
|
-
accepts: ["entity-section", "custom-widget"],
|
|
42
|
-
cardinality: "one"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
layouts: [
|
|
46
|
-
{
|
|
47
|
-
layoutId: "main-with-sidebar",
|
|
48
|
-
title: "Main with sidebar",
|
|
49
|
-
root: {
|
|
50
|
-
type: "panel-group",
|
|
51
|
-
direction: "horizontal",
|
|
52
|
-
persistKey: "example.template.main-sidebar",
|
|
53
|
-
children: [
|
|
54
|
-
{
|
|
55
|
-
type: "panel-group",
|
|
56
|
-
direction: "vertical",
|
|
57
|
-
persistKey: "example.template.content",
|
|
58
|
-
children: [
|
|
59
|
-
{ type: "slot", slotId: "header" },
|
|
60
|
-
{ type: "slot", slotId: "primary" }
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
{ type: "slot", slotId: "sidebar" }
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
data: [],
|
|
69
|
-
verification: {
|
|
70
|
-
dimensions: {
|
|
71
|
-
guidance: "Can reveal hints and walkthrough notes.",
|
|
72
|
-
density: "Can select compact or balanced layouts.",
|
|
73
|
-
dataDepth: "Controls content depth and expansion.",
|
|
74
|
-
control: "Shows advanced options when allowed.",
|
|
75
|
-
media: "Supports text-first and hybrid modes.",
|
|
76
|
-
pace: "Maps to motion tokens and transitions.",
|
|
77
|
-
narrative: "Can order summary before or after detail."
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
export {
|
|
84
|
-
ExampleTemplateBundle
|
|
85
|
-
};
|
|
1
|
+
import{defineModuleBundle as m}from"@contractspec/lib.surface-runtime/spec";var x=m({meta:{key:"example.template",version:"0.1.0",title:"Example Template",description:"Adaptive template shell for ContractSpec examples",owners:["team-platform"],tags:["example","template"],stability:"experimental"},routes:[{routeId:"template",path:"/sandbox",defaultSurface:"template-shell"}],surfaces:{"template-shell":{surfaceId:"template-shell",kind:"workbench",title:"Template Shell",slots:[{slotId:"header",role:"header",accepts:["action-bar"],cardinality:"many"},{slotId:"primary",role:"primary",accepts:["entity-section","rich-doc","form","custom-widget"],cardinality:"many"},{slotId:"sidebar",role:"secondary",accepts:["entity-section","custom-widget"],cardinality:"one"}],layouts:[{layoutId:"main-with-sidebar",title:"Main with sidebar",root:{type:"panel-group",direction:"horizontal",persistKey:"example.template.main-sidebar",children:[{type:"panel-group",direction:"vertical",persistKey:"example.template.content",children:[{type:"slot",slotId:"header"},{type:"slot",slotId:"primary"}]},{type:"slot",slotId:"sidebar"}]}}],data:[],verification:{dimensions:{guidance:"Can reveal hints and walkthrough notes.",density:"Can select compact or balanced layouts.",dataDepth:"Controls content depth and expansion.",control:"Shows advanced options when allowed.",media:"Supports text-first and hybrid modes.",pace:"Maps to motion tokens and transitions.",narrative:"Can order summary before or after detail."}}}}});export{x as ExampleTemplateBundle};
|