@contractspec/lib.example-shared-ui 3.4.3 → 4.0.2
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 +36 -27
- package/CHANGELOG.md +43 -0
- package/dist/SpecDrivenTemplateShell.d.ts +19 -0
- package/dist/SpecDrivenTemplateShell.js +198 -0
- package/dist/browser/SpecDrivenTemplateShell.js +197 -0
- package/dist/browser/bundles/ExampleTemplateBundle.js +85 -0
- package/dist/browser/bundles/index.js +85 -0
- package/dist/browser/index.js +110 -33
- package/dist/bundles/ExampleTemplateBundle.d.ts +79 -0
- package/dist/bundles/ExampleTemplateBundle.js +86 -0
- package/dist/bundles/index.d.ts +1 -0
- package/dist/bundles/index.js +86 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +110 -33
- package/dist/node/SpecDrivenTemplateShell.js +197 -0
- package/dist/node/bundles/ExampleTemplateBundle.js +85 -0
- package/dist/node/bundles/index.js +85 -0
- package/dist/node/index.js +110 -33
- package/package.json +74 -7
- package/src/SpecDrivenTemplateShell.tsx +79 -0
- package/src/bundles/ExampleTemplateBundle.ts +91 -0
- package/src/bundles/index.ts +1 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/bundles/ExampleTemplateBundle.ts
|
|
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
|
+
};
|
package/dist/browser/index.js
CHANGED
|
@@ -2128,6 +2128,82 @@ function SaveToStudioButton({
|
|
|
2128
2128
|
}, undefined, true, undefined, this);
|
|
2129
2129
|
}
|
|
2130
2130
|
|
|
2131
|
+
// src/SpecDrivenTemplateShell.tsx
|
|
2132
|
+
import {
|
|
2133
|
+
BundleProvider,
|
|
2134
|
+
BundleRenderer
|
|
2135
|
+
} from "@contractspec/lib.surface-runtime/react";
|
|
2136
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
2137
|
+
function SpecDrivenTemplateShell({
|
|
2138
|
+
plan,
|
|
2139
|
+
title,
|
|
2140
|
+
description,
|
|
2141
|
+
sidebar,
|
|
2142
|
+
actions,
|
|
2143
|
+
showSaveAction = true,
|
|
2144
|
+
saveProps,
|
|
2145
|
+
children
|
|
2146
|
+
}) {
|
|
2147
|
+
const headerContent = /* @__PURE__ */ jsxDEV8("header", {
|
|
2148
|
+
className: "border-border bg-card rounded-2xl border p-6 shadow-sm",
|
|
2149
|
+
children: [
|
|
2150
|
+
/* @__PURE__ */ jsxDEV8("div", {
|
|
2151
|
+
className: "flex flex-wrap items-center justify-between gap-4",
|
|
2152
|
+
children: [
|
|
2153
|
+
/* @__PURE__ */ jsxDEV8("div", {
|
|
2154
|
+
children: [
|
|
2155
|
+
/* @__PURE__ */ jsxDEV8("p", {
|
|
2156
|
+
className: "text-muted-foreground text-sm font-semibold tracking-wide uppercase",
|
|
2157
|
+
children: "ContractSpec Templates"
|
|
2158
|
+
}, undefined, false, undefined, this),
|
|
2159
|
+
/* @__PURE__ */ jsxDEV8("h1", {
|
|
2160
|
+
className: "text-3xl font-bold",
|
|
2161
|
+
children: title
|
|
2162
|
+
}, undefined, false, undefined, this),
|
|
2163
|
+
description ? /* @__PURE__ */ jsxDEV8("p", {
|
|
2164
|
+
className: "text-muted-foreground mt-2 max-w-2xl text-sm",
|
|
2165
|
+
children: description
|
|
2166
|
+
}, undefined, false, undefined, this) : null
|
|
2167
|
+
]
|
|
2168
|
+
}, undefined, true, undefined, this),
|
|
2169
|
+
/* @__PURE__ */ jsxDEV8("div", {
|
|
2170
|
+
className: "flex flex-col items-end gap-2",
|
|
2171
|
+
children: [
|
|
2172
|
+
/* @__PURE__ */ jsxDEV8(LocalDataIndicator, {}, undefined, false, undefined, this),
|
|
2173
|
+
showSaveAction ? /* @__PURE__ */ jsxDEV8(SaveToStudioButton, {
|
|
2174
|
+
...saveProps
|
|
2175
|
+
}, undefined, false, undefined, this) : null
|
|
2176
|
+
]
|
|
2177
|
+
}, undefined, true, undefined, this)
|
|
2178
|
+
]
|
|
2179
|
+
}, undefined, true, undefined, this),
|
|
2180
|
+
actions ? /* @__PURE__ */ jsxDEV8("div", {
|
|
2181
|
+
className: "mt-4",
|
|
2182
|
+
children: actions
|
|
2183
|
+
}, undefined, false, undefined, this) : null
|
|
2184
|
+
]
|
|
2185
|
+
}, undefined, true, undefined, this);
|
|
2186
|
+
const slotContent = {
|
|
2187
|
+
header: headerContent,
|
|
2188
|
+
primary: /* @__PURE__ */ jsxDEV8("main", {
|
|
2189
|
+
className: "space-y-4 p-2",
|
|
2190
|
+
children
|
|
2191
|
+
}, undefined, false, undefined, this)
|
|
2192
|
+
};
|
|
2193
|
+
if (sidebar != null) {
|
|
2194
|
+
slotContent.sidebar = /* @__PURE__ */ jsxDEV8("aside", {
|
|
2195
|
+
className: "border-border bg-card rounded-2xl border p-4",
|
|
2196
|
+
children: sidebar
|
|
2197
|
+
}, undefined, false, undefined, this);
|
|
2198
|
+
}
|
|
2199
|
+
return /* @__PURE__ */ jsxDEV8(BundleProvider, {
|
|
2200
|
+
plan,
|
|
2201
|
+
children: /* @__PURE__ */ jsxDEV8(BundleRenderer, {
|
|
2202
|
+
slotContent
|
|
2203
|
+
}, undefined, false, undefined, this)
|
|
2204
|
+
}, undefined, false, undefined, this);
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2131
2207
|
// src/utils/generateSpecFromTemplate.ts
|
|
2132
2208
|
function generateSpecFromTemplate(template) {
|
|
2133
2209
|
const templateId = template?.id ?? "unknown";
|
|
@@ -2697,7 +2773,7 @@ function useSpecContent(templateId) {
|
|
|
2697
2773
|
import { useCallback as useCallback8, useEffect as useEffect5 } from "react";
|
|
2698
2774
|
import { Button as Button5, LoaderBlock as LoaderBlock3 } from "@contractspec/lib.design-system";
|
|
2699
2775
|
import { Badge as Badge5 } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
2700
|
-
import { jsxDEV as
|
|
2776
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
2701
2777
|
"use client";
|
|
2702
2778
|
function SpecEditorPanel({
|
|
2703
2779
|
templateId,
|
|
@@ -2739,54 +2815,54 @@ function SpecEditorPanel({
|
|
|
2739
2815
|
onLog?.("Spec reset to template defaults");
|
|
2740
2816
|
}, [reset, onLog]);
|
|
2741
2817
|
if (loading) {
|
|
2742
|
-
return /* @__PURE__ */
|
|
2818
|
+
return /* @__PURE__ */ jsxDEV9(LoaderBlock3, {
|
|
2743
2819
|
label: "Loading spec..."
|
|
2744
2820
|
}, undefined, false, undefined, this);
|
|
2745
2821
|
}
|
|
2746
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ jsxDEV9("div", {
|
|
2747
2823
|
className: "space-y-4",
|
|
2748
2824
|
children: [
|
|
2749
|
-
/* @__PURE__ */
|
|
2825
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
2750
2826
|
className: "flex items-center justify-between",
|
|
2751
2827
|
children: [
|
|
2752
|
-
/* @__PURE__ */
|
|
2828
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
2753
2829
|
className: "flex items-center gap-2",
|
|
2754
2830
|
children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ jsxDEV9(Button5, {
|
|
2756
2832
|
variant: "default",
|
|
2757
2833
|
size: "sm",
|
|
2758
2834
|
onClick: handleSave,
|
|
2759
2835
|
children: "Save"
|
|
2760
2836
|
}, undefined, false, undefined, this),
|
|
2761
|
-
/* @__PURE__ */
|
|
2837
|
+
/* @__PURE__ */ jsxDEV9(Button5, {
|
|
2762
2838
|
variant: "outline",
|
|
2763
2839
|
size: "sm",
|
|
2764
2840
|
onClick: handleValidate,
|
|
2765
2841
|
children: "Validate"
|
|
2766
2842
|
}, undefined, false, undefined, this),
|
|
2767
|
-
isDirty && /* @__PURE__ */
|
|
2843
|
+
isDirty && /* @__PURE__ */ jsxDEV9(Badge5, {
|
|
2768
2844
|
variant: "secondary",
|
|
2769
2845
|
className: "border-amber-500/30 bg-amber-500/20 text-amber-400",
|
|
2770
2846
|
children: "Unsaved changes"
|
|
2771
2847
|
}, undefined, false, undefined, this),
|
|
2772
|
-
validation && /* @__PURE__ */
|
|
2848
|
+
validation && /* @__PURE__ */ jsxDEV9(Badge5, {
|
|
2773
2849
|
variant: validation.valid ? "default" : "destructive",
|
|
2774
2850
|
className: validation.valid ? "border-green-500/30 bg-green-500/20 text-green-400" : "",
|
|
2775
2851
|
children: validation.valid ? "Valid" : `${validation.errors.filter((e) => e.severity === "error").length} errors`
|
|
2776
2852
|
}, undefined, false, undefined, this)
|
|
2777
2853
|
]
|
|
2778
2854
|
}, undefined, true, undefined, this),
|
|
2779
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
2780
2856
|
className: "flex items-center gap-2",
|
|
2781
2857
|
children: [
|
|
2782
|
-
lastSaved && /* @__PURE__ */
|
|
2858
|
+
lastSaved && /* @__PURE__ */ jsxDEV9("span", {
|
|
2783
2859
|
className: "text-muted-foreground text-xs",
|
|
2784
2860
|
children: [
|
|
2785
2861
|
"Last saved: ",
|
|
2786
2862
|
new Date(lastSaved).toLocaleTimeString()
|
|
2787
2863
|
]
|
|
2788
2864
|
}, undefined, true, undefined, this),
|
|
2789
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsxDEV9(Button5, {
|
|
2790
2866
|
variant: "ghost",
|
|
2791
2867
|
size: "sm",
|
|
2792
2868
|
onPress: handleReset,
|
|
@@ -2796,16 +2872,16 @@ function SpecEditorPanel({
|
|
|
2796
2872
|
}, undefined, true, undefined, this)
|
|
2797
2873
|
]
|
|
2798
2874
|
}, undefined, true, undefined, this),
|
|
2799
|
-
validation && validation.errors.length > 0 && /* @__PURE__ */
|
|
2875
|
+
validation && validation.errors.length > 0 && /* @__PURE__ */ jsxDEV9("div", {
|
|
2800
2876
|
className: "rounded-lg border border-amber-500/50 bg-amber-500/10 p-3",
|
|
2801
2877
|
children: [
|
|
2802
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsxDEV9("p", {
|
|
2803
2879
|
className: "mb-2 text-xs font-semibold text-amber-400 uppercase",
|
|
2804
2880
|
children: "Validation Issues"
|
|
2805
2881
|
}, undefined, false, undefined, this),
|
|
2806
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ jsxDEV9("ul", {
|
|
2807
2883
|
className: "space-y-1",
|
|
2808
|
-
children: validation.errors.map((error, index) => /* @__PURE__ */
|
|
2884
|
+
children: validation.errors.map((error, index) => /* @__PURE__ */ jsxDEV9("li", {
|
|
2809
2885
|
className: `text-xs ${error.severity === "error" ? "text-red-400" : "text-amber-400"}`,
|
|
2810
2886
|
children: [
|
|
2811
2887
|
"Line ",
|
|
@@ -2817,9 +2893,9 @@ function SpecEditorPanel({
|
|
|
2817
2893
|
}, undefined, false, undefined, this)
|
|
2818
2894
|
]
|
|
2819
2895
|
}, undefined, true, undefined, this),
|
|
2820
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ jsxDEV9("div", {
|
|
2821
2897
|
className: "border-border bg-card rounded-2xl border p-4",
|
|
2822
|
-
children: /* @__PURE__ */
|
|
2898
|
+
children: /* @__PURE__ */ jsxDEV9(SpecEditor, {
|
|
2823
2899
|
projectId: "sandbox",
|
|
2824
2900
|
type: "CAPABILITY",
|
|
2825
2901
|
content,
|
|
@@ -2834,7 +2910,7 @@ function SpecEditorPanel({
|
|
|
2834
2910
|
}
|
|
2835
2911
|
|
|
2836
2912
|
// src/TemplateShell.tsx
|
|
2837
|
-
import { jsxDEV as
|
|
2913
|
+
import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
|
|
2838
2914
|
var TemplateShell = ({
|
|
2839
2915
|
title,
|
|
2840
2916
|
description,
|
|
@@ -2843,56 +2919,56 @@ var TemplateShell = ({
|
|
|
2843
2919
|
showSaveAction = true,
|
|
2844
2920
|
saveProps,
|
|
2845
2921
|
children
|
|
2846
|
-
}) => /* @__PURE__ */
|
|
2922
|
+
}) => /* @__PURE__ */ jsxDEV10("div", {
|
|
2847
2923
|
className: "space-y-6",
|
|
2848
2924
|
children: [
|
|
2849
|
-
/* @__PURE__ */
|
|
2925
|
+
/* @__PURE__ */ jsxDEV10("header", {
|
|
2850
2926
|
className: "border-border bg-card rounded-2xl border p-6 shadow-sm",
|
|
2851
2927
|
children: [
|
|
2852
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
2853
2929
|
className: "flex flex-wrap items-center justify-between gap-4",
|
|
2854
2930
|
children: [
|
|
2855
|
-
/* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
2856
2932
|
children: [
|
|
2857
|
-
/* @__PURE__ */
|
|
2933
|
+
/* @__PURE__ */ jsxDEV10("p", {
|
|
2858
2934
|
className: "text-muted-foreground text-sm font-semibold tracking-wide uppercase",
|
|
2859
2935
|
children: "ContractSpec Templates"
|
|
2860
2936
|
}, undefined, false, undefined, this),
|
|
2861
|
-
/* @__PURE__ */
|
|
2937
|
+
/* @__PURE__ */ jsxDEV10("h1", {
|
|
2862
2938
|
className: "text-3xl font-bold",
|
|
2863
2939
|
children: title
|
|
2864
2940
|
}, undefined, false, undefined, this),
|
|
2865
|
-
description ? /* @__PURE__ */
|
|
2941
|
+
description ? /* @__PURE__ */ jsxDEV10("p", {
|
|
2866
2942
|
className: "text-muted-foreground mt-2 max-w-2xl text-sm",
|
|
2867
2943
|
children: description
|
|
2868
2944
|
}, undefined, false, undefined, this) : null
|
|
2869
2945
|
]
|
|
2870
2946
|
}, undefined, true, undefined, this),
|
|
2871
|
-
/* @__PURE__ */
|
|
2947
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
2872
2948
|
className: "flex flex-col items-end gap-2",
|
|
2873
2949
|
children: [
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
showSaveAction ? /* @__PURE__ */
|
|
2950
|
+
/* @__PURE__ */ jsxDEV10(LocalDataIndicator, {}, undefined, false, undefined, this),
|
|
2951
|
+
showSaveAction ? /* @__PURE__ */ jsxDEV10(SaveToStudioButton, {
|
|
2876
2952
|
...saveProps
|
|
2877
2953
|
}, undefined, false, undefined, this) : null
|
|
2878
2954
|
]
|
|
2879
2955
|
}, undefined, true, undefined, this)
|
|
2880
2956
|
]
|
|
2881
2957
|
}, undefined, true, undefined, this),
|
|
2882
|
-
actions ? /* @__PURE__ */
|
|
2958
|
+
actions ? /* @__PURE__ */ jsxDEV10("div", {
|
|
2883
2959
|
className: "mt-4",
|
|
2884
2960
|
children: actions
|
|
2885
2961
|
}, undefined, false, undefined, this) : null
|
|
2886
2962
|
]
|
|
2887
2963
|
}, undefined, true, undefined, this),
|
|
2888
|
-
/* @__PURE__ */
|
|
2964
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
2889
2965
|
className: sidebar ? "grid gap-6 lg:grid-cols-[minmax(0,1fr)_320px]" : "w-full",
|
|
2890
2966
|
children: [
|
|
2891
|
-
/* @__PURE__ */
|
|
2967
|
+
/* @__PURE__ */ jsxDEV10("main", {
|
|
2892
2968
|
className: "space-y-4 p-2",
|
|
2893
2969
|
children
|
|
2894
2970
|
}, undefined, false, undefined, this),
|
|
2895
|
-
sidebar ? /* @__PURE__ */
|
|
2971
|
+
sidebar ? /* @__PURE__ */ jsxDEV10("aside", {
|
|
2896
2972
|
className: "border-border bg-card rounded-2xl border p-4",
|
|
2897
2973
|
children: sidebar
|
|
2898
2974
|
}, undefined, false, undefined, this) : null
|
|
@@ -3486,6 +3562,7 @@ export {
|
|
|
3486
3562
|
TemplateRuntimeContext,
|
|
3487
3563
|
TemplateComponentRegistry,
|
|
3488
3564
|
SpecEditorPanel,
|
|
3565
|
+
SpecDrivenTemplateShell,
|
|
3489
3566
|
SaveToStudioButton,
|
|
3490
3567
|
PersonalizationInsights,
|
|
3491
3568
|
OverlayContextProvider,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal bundle spec for example template shells.
|
|
3
|
+
* Requires @contractspec/lib.surface-runtime when used.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ExampleTemplateBundle: {
|
|
6
|
+
readonly meta: {
|
|
7
|
+
readonly key: "example.template";
|
|
8
|
+
readonly version: "0.1.0";
|
|
9
|
+
readonly title: "Example Template";
|
|
10
|
+
readonly description: "Adaptive template shell for ContractSpec examples";
|
|
11
|
+
readonly owners: ["team-platform"];
|
|
12
|
+
readonly tags: ["example", "template"];
|
|
13
|
+
readonly stability: "experimental";
|
|
14
|
+
};
|
|
15
|
+
readonly routes: [{
|
|
16
|
+
readonly routeId: "template";
|
|
17
|
+
readonly path: "/sandbox";
|
|
18
|
+
readonly defaultSurface: "template-shell";
|
|
19
|
+
}];
|
|
20
|
+
readonly surfaces: {
|
|
21
|
+
readonly 'template-shell': {
|
|
22
|
+
readonly surfaceId: "template-shell";
|
|
23
|
+
readonly kind: "workbench";
|
|
24
|
+
readonly title: "Template Shell";
|
|
25
|
+
readonly slots: [{
|
|
26
|
+
readonly slotId: "header";
|
|
27
|
+
readonly role: "header";
|
|
28
|
+
readonly accepts: ["action-bar"];
|
|
29
|
+
readonly cardinality: "many";
|
|
30
|
+
}, {
|
|
31
|
+
readonly slotId: "primary";
|
|
32
|
+
readonly role: "primary";
|
|
33
|
+
readonly accepts: ["entity-section", "rich-doc", "form", "custom-widget"];
|
|
34
|
+
readonly cardinality: "many";
|
|
35
|
+
}, {
|
|
36
|
+
readonly slotId: "sidebar";
|
|
37
|
+
readonly role: "secondary";
|
|
38
|
+
readonly accepts: ["entity-section", "custom-widget"];
|
|
39
|
+
readonly cardinality: "one";
|
|
40
|
+
}];
|
|
41
|
+
readonly layouts: [{
|
|
42
|
+
readonly layoutId: "main-with-sidebar";
|
|
43
|
+
readonly title: "Main with sidebar";
|
|
44
|
+
readonly root: {
|
|
45
|
+
readonly type: "panel-group";
|
|
46
|
+
readonly direction: "horizontal";
|
|
47
|
+
readonly persistKey: "example.template.main-sidebar";
|
|
48
|
+
readonly children: [{
|
|
49
|
+
readonly type: "panel-group";
|
|
50
|
+
readonly direction: "vertical";
|
|
51
|
+
readonly persistKey: "example.template.content";
|
|
52
|
+
readonly children: [{
|
|
53
|
+
readonly type: "slot";
|
|
54
|
+
readonly slotId: "header";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "slot";
|
|
57
|
+
readonly slotId: "primary";
|
|
58
|
+
}];
|
|
59
|
+
}, {
|
|
60
|
+
readonly type: "slot";
|
|
61
|
+
readonly slotId: "sidebar";
|
|
62
|
+
}];
|
|
63
|
+
};
|
|
64
|
+
}];
|
|
65
|
+
readonly data: [];
|
|
66
|
+
readonly verification: {
|
|
67
|
+
readonly dimensions: {
|
|
68
|
+
readonly guidance: "Can reveal hints and walkthrough notes.";
|
|
69
|
+
readonly density: "Can select compact or balanced layouts.";
|
|
70
|
+
readonly dataDepth: "Controls content depth and expansion.";
|
|
71
|
+
readonly control: "Shows advanced options when allowed.";
|
|
72
|
+
readonly media: "Supports text-first and hybrid modes.";
|
|
73
|
+
readonly pace: "Maps to motion tokens and transitions.";
|
|
74
|
+
readonly narrative: "Can order summary before or after detail.";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/bundles/ExampleTemplateBundle.ts
|
|
3
|
+
import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec";
|
|
4
|
+
var ExampleTemplateBundle = defineModuleBundle({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "example.template",
|
|
7
|
+
version: "0.1.0",
|
|
8
|
+
title: "Example Template",
|
|
9
|
+
description: "Adaptive template shell for ContractSpec examples",
|
|
10
|
+
owners: ["team-platform"],
|
|
11
|
+
tags: ["example", "template"],
|
|
12
|
+
stability: "experimental"
|
|
13
|
+
},
|
|
14
|
+
routes: [
|
|
15
|
+
{
|
|
16
|
+
routeId: "template",
|
|
17
|
+
path: "/sandbox",
|
|
18
|
+
defaultSurface: "template-shell"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
surfaces: {
|
|
22
|
+
"template-shell": {
|
|
23
|
+
surfaceId: "template-shell",
|
|
24
|
+
kind: "workbench",
|
|
25
|
+
title: "Template Shell",
|
|
26
|
+
slots: [
|
|
27
|
+
{
|
|
28
|
+
slotId: "header",
|
|
29
|
+
role: "header",
|
|
30
|
+
accepts: ["action-bar"],
|
|
31
|
+
cardinality: "many"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
slotId: "primary",
|
|
35
|
+
role: "primary",
|
|
36
|
+
accepts: ["entity-section", "rich-doc", "form", "custom-widget"],
|
|
37
|
+
cardinality: "many"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
slotId: "sidebar",
|
|
41
|
+
role: "secondary",
|
|
42
|
+
accepts: ["entity-section", "custom-widget"],
|
|
43
|
+
cardinality: "one"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
layouts: [
|
|
47
|
+
{
|
|
48
|
+
layoutId: "main-with-sidebar",
|
|
49
|
+
title: "Main with sidebar",
|
|
50
|
+
root: {
|
|
51
|
+
type: "panel-group",
|
|
52
|
+
direction: "horizontal",
|
|
53
|
+
persistKey: "example.template.main-sidebar",
|
|
54
|
+
children: [
|
|
55
|
+
{
|
|
56
|
+
type: "panel-group",
|
|
57
|
+
direction: "vertical",
|
|
58
|
+
persistKey: "example.template.content",
|
|
59
|
+
children: [
|
|
60
|
+
{ type: "slot", slotId: "header" },
|
|
61
|
+
{ type: "slot", slotId: "primary" }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{ type: "slot", slotId: "sidebar" }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
data: [],
|
|
70
|
+
verification: {
|
|
71
|
+
dimensions: {
|
|
72
|
+
guidance: "Can reveal hints and walkthrough notes.",
|
|
73
|
+
density: "Can select compact or balanced layouts.",
|
|
74
|
+
dataDepth: "Controls content depth and expansion.",
|
|
75
|
+
control: "Shows advanced options when allowed.",
|
|
76
|
+
media: "Supports text-first and hybrid modes.",
|
|
77
|
+
pace: "Maps to motion tokens and transitions.",
|
|
78
|
+
narrative: "Can order summary before or after detail."
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
ExampleTemplateBundle
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExampleTemplateBundle } from './ExampleTemplateBundle';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/bundles/ExampleTemplateBundle.ts
|
|
3
|
+
import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec";
|
|
4
|
+
var ExampleTemplateBundle = defineModuleBundle({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "example.template",
|
|
7
|
+
version: "0.1.0",
|
|
8
|
+
title: "Example Template",
|
|
9
|
+
description: "Adaptive template shell for ContractSpec examples",
|
|
10
|
+
owners: ["team-platform"],
|
|
11
|
+
tags: ["example", "template"],
|
|
12
|
+
stability: "experimental"
|
|
13
|
+
},
|
|
14
|
+
routes: [
|
|
15
|
+
{
|
|
16
|
+
routeId: "template",
|
|
17
|
+
path: "/sandbox",
|
|
18
|
+
defaultSurface: "template-shell"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
surfaces: {
|
|
22
|
+
"template-shell": {
|
|
23
|
+
surfaceId: "template-shell",
|
|
24
|
+
kind: "workbench",
|
|
25
|
+
title: "Template Shell",
|
|
26
|
+
slots: [
|
|
27
|
+
{
|
|
28
|
+
slotId: "header",
|
|
29
|
+
role: "header",
|
|
30
|
+
accepts: ["action-bar"],
|
|
31
|
+
cardinality: "many"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
slotId: "primary",
|
|
35
|
+
role: "primary",
|
|
36
|
+
accepts: ["entity-section", "rich-doc", "form", "custom-widget"],
|
|
37
|
+
cardinality: "many"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
slotId: "sidebar",
|
|
41
|
+
role: "secondary",
|
|
42
|
+
accepts: ["entity-section", "custom-widget"],
|
|
43
|
+
cardinality: "one"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
layouts: [
|
|
47
|
+
{
|
|
48
|
+
layoutId: "main-with-sidebar",
|
|
49
|
+
title: "Main with sidebar",
|
|
50
|
+
root: {
|
|
51
|
+
type: "panel-group",
|
|
52
|
+
direction: "horizontal",
|
|
53
|
+
persistKey: "example.template.main-sidebar",
|
|
54
|
+
children: [
|
|
55
|
+
{
|
|
56
|
+
type: "panel-group",
|
|
57
|
+
direction: "vertical",
|
|
58
|
+
persistKey: "example.template.content",
|
|
59
|
+
children: [
|
|
60
|
+
{ type: "slot", slotId: "header" },
|
|
61
|
+
{ type: "slot", slotId: "primary" }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{ type: "slot", slotId: "sidebar" }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
data: [],
|
|
70
|
+
verification: {
|
|
71
|
+
dimensions: {
|
|
72
|
+
guidance: "Can reveal hints and walkthrough notes.",
|
|
73
|
+
density: "Can select compact or balanced layouts.",
|
|
74
|
+
dataDepth: "Controls content depth and expansion.",
|
|
75
|
+
control: "Shows advanced options when allowed.",
|
|
76
|
+
media: "Supports text-first and hybrid modes.",
|
|
77
|
+
pace: "Maps to motion tokens and transitions.",
|
|
78
|
+
narrative: "Can order summary before or after detail."
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
ExampleTemplateBundle
|
|
86
|
+
};
|