@contractspec/lib.example-shared-ui 6.0.5 → 6.0.7
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 +90 -84
- package/AGENTS.md +43 -25
- package/CHANGELOG.md +11 -0
- package/README.md +63 -35
- package/dist/EvolutionDashboard.js +9 -9
- package/dist/EvolutionSidebar.js +15 -15
- package/dist/LocalDataIndicator.js +3 -3
- package/dist/MarkdownView.d.ts +0 -7
- package/dist/MarkdownView.js +76 -172
- package/dist/PersonalizationInsights.js +12 -12
- package/dist/SaveToStudioButton.js +2 -2
- package/dist/SpecDrivenTemplateShell.d.ts +1 -1
- package/dist/SpecDrivenTemplateShell.js +10 -10
- package/dist/SpecEditorPanel.js +3 -3
- package/dist/TemplateShell.js +10 -10
- package/dist/browser/EvolutionDashboard.js +9 -9
- package/dist/browser/EvolutionSidebar.js +15 -15
- package/dist/browser/LocalDataIndicator.js +3 -3
- package/dist/browser/MarkdownView.js +76 -172
- package/dist/browser/PersonalizationInsights.js +12 -12
- package/dist/browser/SaveToStudioButton.js +2 -2
- package/dist/browser/SpecDrivenTemplateShell.js +10 -10
- package/dist/browser/SpecEditorPanel.js +3 -3
- package/dist/browser/TemplateShell.js +10 -10
- package/dist/browser/hooks/index.js +29 -29
- package/dist/browser/index.js +193 -286
- package/dist/browser/lib/component-registry.js +1 -1
- package/dist/browser/markdown/formatPresentationName.js +9 -0
- package/dist/browser/markdown/useMarkdownPresentation.js +65 -0
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +29 -29
- package/dist/index.d.ts +12 -11
- package/dist/index.js +193 -286
- package/dist/lib/component-registry.js +1 -1
- package/dist/markdown/formatPresentationName.d.ts +1 -0
- package/dist/markdown/formatPresentationName.js +10 -0
- package/dist/markdown/useMarkdownPresentation.d.ts +21 -0
- package/dist/markdown/useMarkdownPresentation.js +66 -0
- package/dist/node/EvolutionDashboard.js +9 -9
- package/dist/node/EvolutionSidebar.js +15 -15
- package/dist/node/LocalDataIndicator.js +3 -3
- package/dist/node/MarkdownView.js +76 -172
- package/dist/node/PersonalizationInsights.js +12 -12
- package/dist/node/SaveToStudioButton.js +2 -2
- package/dist/node/SpecDrivenTemplateShell.js +10 -10
- package/dist/node/SpecEditorPanel.js +3 -3
- package/dist/node/TemplateShell.js +10 -10
- package/dist/node/hooks/index.js +29 -29
- package/dist/node/index.js +193 -286
- package/dist/node/lib/component-registry.js +1 -1
- package/dist/node/markdown/formatPresentationName.js +9 -0
- package/dist/node/markdown/useMarkdownPresentation.js +65 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +40 -13
- package/src/EvolutionDashboard.tsx +415 -415
- package/src/EvolutionSidebar.tsx +245 -245
- package/src/LocalDataIndicator.tsx +28 -28
- package/src/MarkdownView.tsx +119 -372
- package/src/OverlayContextProvider.tsx +272 -272
- package/src/PersonalizationInsights.tsx +232 -232
- package/src/SaveToStudioButton.tsx +51 -51
- package/src/SpecDrivenTemplateShell.tsx +59 -59
- package/src/SpecEditorPanel.tsx +138 -138
- package/src/TemplateShell.tsx +50 -50
- package/src/bundles/ExampleTemplateBundle.ts +78 -78
- package/src/hooks/index.ts +3 -3
- package/src/hooks/useBehaviorTracking.ts +252 -252
- package/src/hooks/useEvolution.ts +437 -437
- package/src/hooks/useRegistryTemplates.ts +42 -42
- package/src/hooks/useSpecContent.ts +214 -214
- package/src/hooks/useWorkflowComposer.ts +567 -567
- package/src/index.ts +12 -11
- package/src/lib/component-registry.tsx +40 -40
- package/src/lib/runtime-context.tsx +31 -31
- package/src/lib/types.ts +57 -57
- package/src/markdown/formatPresentationName.ts +9 -0
- package/src/markdown/useMarkdownPresentation.ts +107 -0
- package/src/overlay-types.ts +15 -15
- package/src/utils/fetchPresentationData.ts +13 -13
- package/src/utils/generateSpecFromTemplate.ts +29 -29
- package/src/utils/index.ts +1 -1
- package/tsconfig.json +8 -8
package/dist/MarkdownView.js
CHANGED
|
@@ -11,31 +11,24 @@ function useTemplateRuntime() {
|
|
|
11
11
|
return context;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
// src/
|
|
14
|
+
// src/markdown/formatPresentationName.ts
|
|
15
|
+
function formatPresentationName(name) {
|
|
16
|
+
const parts = name.split(".");
|
|
17
|
+
const lastPart = parts[parts.length - 1] ?? name;
|
|
18
|
+
return lastPart.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/markdown/useMarkdownPresentation.ts
|
|
15
22
|
import { useCallback, useEffect, useState } from "react";
|
|
16
|
-
import {
|
|
17
|
-
Button,
|
|
18
|
-
ErrorState,
|
|
19
|
-
LoaderBlock
|
|
20
|
-
} from "@contractspec/lib.design-system";
|
|
21
|
-
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
22
|
-
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
23
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
24
23
|
"use client";
|
|
25
|
-
function
|
|
26
|
-
|
|
24
|
+
function useMarkdownPresentation({
|
|
25
|
+
engine,
|
|
26
|
+
fetchData,
|
|
27
27
|
presentationId,
|
|
28
|
-
|
|
28
|
+
presentations,
|
|
29
|
+
resolvePresentation,
|
|
30
|
+
templateId
|
|
29
31
|
}) {
|
|
30
|
-
const {
|
|
31
|
-
engine,
|
|
32
|
-
template,
|
|
33
|
-
templateId: contextTemplateId,
|
|
34
|
-
resolvePresentation,
|
|
35
|
-
fetchData
|
|
36
|
-
} = useTemplateRuntime();
|
|
37
|
-
const templateId = propTemplateId ?? contextTemplateId;
|
|
38
|
-
const presentations = template?.presentations ?? [];
|
|
39
32
|
const [selectedPresentation, setSelectedPresentation] = useState("");
|
|
40
33
|
const [markdownContent, setMarkdownContent] = useState("");
|
|
41
34
|
const [loading, setLoading] = useState(false);
|
|
@@ -43,10 +36,16 @@ function MarkdownView({
|
|
|
43
36
|
useEffect(() => {
|
|
44
37
|
if (presentationId && presentations.includes(presentationId)) {
|
|
45
38
|
setSelectedPresentation(presentationId);
|
|
46
|
-
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (presentations.length === 0) {
|
|
42
|
+
setSelectedPresentation("");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!presentations.includes(selectedPresentation)) {
|
|
47
46
|
setSelectedPresentation(presentations[0] ?? "");
|
|
48
47
|
}
|
|
49
|
-
}, [presentationId, presentations, selectedPresentation]);
|
|
48
|
+
}, [presentationId, presentations, selectedPresentation, templateId]);
|
|
50
49
|
const renderMarkdown = useCallback(async () => {
|
|
51
50
|
if (!selectedPresentation || !engine)
|
|
52
51
|
return;
|
|
@@ -68,16 +67,61 @@ function MarkdownView({
|
|
|
68
67
|
} finally {
|
|
69
68
|
setLoading(false);
|
|
70
69
|
}
|
|
71
|
-
}, [
|
|
70
|
+
}, [engine, fetchData, resolvePresentation, selectedPresentation]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
renderMarkdown();
|
|
73
|
+
}, [renderMarkdown]);
|
|
74
|
+
return {
|
|
75
|
+
error,
|
|
76
|
+
loading,
|
|
77
|
+
markdownContent,
|
|
78
|
+
renderMarkdown,
|
|
72
79
|
selectedPresentation,
|
|
73
|
-
|
|
80
|
+
setSelectedPresentation
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/MarkdownView.tsx
|
|
85
|
+
import {
|
|
86
|
+
Button,
|
|
87
|
+
ErrorState,
|
|
88
|
+
LoaderBlock,
|
|
89
|
+
MarkdownRenderer
|
|
90
|
+
} from "@contractspec/lib.design-system";
|
|
91
|
+
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
92
|
+
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
93
|
+
import { useCallback as useCallback2 } from "react";
|
|
94
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
95
|
+
"use client";
|
|
96
|
+
function MarkdownView({
|
|
97
|
+
templateId: propTemplateId,
|
|
98
|
+
presentationId,
|
|
99
|
+
className
|
|
100
|
+
}) {
|
|
101
|
+
const {
|
|
74
102
|
engine,
|
|
103
|
+
template,
|
|
104
|
+
templateId: contextTemplateId,
|
|
75
105
|
resolvePresentation,
|
|
76
106
|
fetchData
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
107
|
+
} = useTemplateRuntime();
|
|
108
|
+
const templateId = propTemplateId ?? contextTemplateId;
|
|
109
|
+
const presentations = template?.presentations ?? [];
|
|
110
|
+
const {
|
|
111
|
+
error,
|
|
112
|
+
loading,
|
|
113
|
+
markdownContent,
|
|
114
|
+
renderMarkdown,
|
|
115
|
+
selectedPresentation,
|
|
116
|
+
setSelectedPresentation
|
|
117
|
+
} = useMarkdownPresentation({
|
|
118
|
+
engine,
|
|
119
|
+
fetchData,
|
|
120
|
+
presentationId,
|
|
121
|
+
presentations,
|
|
122
|
+
resolvePresentation,
|
|
123
|
+
templateId
|
|
124
|
+
});
|
|
81
125
|
if (!presentations.length) {
|
|
82
126
|
return /* @__PURE__ */ jsxDEV(Card, {
|
|
83
127
|
className,
|
|
@@ -90,7 +134,7 @@ function MarkdownView({
|
|
|
90
134
|
}, undefined, false, undefined, this)
|
|
91
135
|
}, undefined, false, undefined, this);
|
|
92
136
|
}
|
|
93
|
-
const handleCopy =
|
|
137
|
+
const handleCopy = useCallback2(() => {
|
|
94
138
|
if (markdownContent) {
|
|
95
139
|
navigator.clipboard.writeText(markdownContent);
|
|
96
140
|
}
|
|
@@ -102,7 +146,7 @@ function MarkdownView({
|
|
|
102
146
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
103
147
|
children: [
|
|
104
148
|
/* @__PURE__ */ jsxDEV("span", {
|
|
105
|
-
className: "text-muted-foreground text-sm
|
|
149
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
106
150
|
children: "Presentation:"
|
|
107
151
|
}, undefined, false, undefined, this),
|
|
108
152
|
presentations.map((name) => /* @__PURE__ */ jsxDEV(Button, {
|
|
@@ -159,146 +203,6 @@ function MarkdownView({
|
|
|
159
203
|
]
|
|
160
204
|
}, undefined, true, undefined, this);
|
|
161
205
|
}
|
|
162
|
-
function MarkdownRenderer({ content }) {
|
|
163
|
-
const lines = content.split(`
|
|
164
|
-
`);
|
|
165
|
-
const rendered = [];
|
|
166
|
-
let i = 0;
|
|
167
|
-
while (i < lines.length) {
|
|
168
|
-
const line = lines[i] ?? "";
|
|
169
|
-
if (line.startsWith("|") && lines[i + 1]?.match(/^\|[\s-|]+\|$/)) {
|
|
170
|
-
const tableLines = [line];
|
|
171
|
-
i++;
|
|
172
|
-
while (i < lines.length && (lines[i]?.startsWith("|") ?? false)) {
|
|
173
|
-
tableLines.push(lines[i] ?? "");
|
|
174
|
-
i++;
|
|
175
|
-
}
|
|
176
|
-
rendered.push(renderTable(tableLines, rendered.length));
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
if (line.startsWith("# ")) {
|
|
180
|
-
rendered.push(/* @__PURE__ */ jsxDEV("h1", {
|
|
181
|
-
className: "mb-4 text-2xl font-bold",
|
|
182
|
-
children: line.slice(2)
|
|
183
|
-
}, i, false, undefined, this));
|
|
184
|
-
} else if (line.startsWith("## ")) {
|
|
185
|
-
rendered.push(/* @__PURE__ */ jsxDEV("h2", {
|
|
186
|
-
className: "mt-6 mb-3 text-xl font-semibold",
|
|
187
|
-
children: line.slice(3)
|
|
188
|
-
}, i, false, undefined, this));
|
|
189
|
-
} else if (line.startsWith("### ")) {
|
|
190
|
-
rendered.push(/* @__PURE__ */ jsxDEV("h3", {
|
|
191
|
-
className: "mt-4 mb-2 text-lg font-medium",
|
|
192
|
-
children: line.slice(4)
|
|
193
|
-
}, i, false, undefined, this));
|
|
194
|
-
} else if (line.startsWith("> ")) {
|
|
195
|
-
rendered.push(/* @__PURE__ */ jsxDEV("blockquote", {
|
|
196
|
-
className: "text-muted-foreground my-2 border-l-4 border-violet-500/50 pl-4 italic",
|
|
197
|
-
children: line.slice(2)
|
|
198
|
-
}, i, false, undefined, this));
|
|
199
|
-
} else if (line.startsWith("- ")) {
|
|
200
|
-
rendered.push(/* @__PURE__ */ jsxDEV("li", {
|
|
201
|
-
className: "ml-4 list-disc",
|
|
202
|
-
children: formatInlineMarkdown(line.slice(2))
|
|
203
|
-
}, i, false, undefined, this));
|
|
204
|
-
} else if (line.startsWith("**") && line.includes(":**")) {
|
|
205
|
-
const [label, ...rest] = line.split(":**");
|
|
206
|
-
rendered.push(/* @__PURE__ */ jsxDEV("p", {
|
|
207
|
-
className: "my-1",
|
|
208
|
-
children: [
|
|
209
|
-
/* @__PURE__ */ jsxDEV("strong", {
|
|
210
|
-
children: [
|
|
211
|
-
label?.slice(2),
|
|
212
|
-
":"
|
|
213
|
-
]
|
|
214
|
-
}, undefined, true, undefined, this),
|
|
215
|
-
rest.join(":**")
|
|
216
|
-
]
|
|
217
|
-
}, i, true, undefined, this));
|
|
218
|
-
} else if (line.startsWith("_") && line.endsWith("_")) {
|
|
219
|
-
rendered.push(/* @__PURE__ */ jsxDEV("p", {
|
|
220
|
-
className: "text-muted-foreground my-1 italic",
|
|
221
|
-
children: line.slice(1, -1)
|
|
222
|
-
}, i, false, undefined, this));
|
|
223
|
-
} else if (!line.trim()) {
|
|
224
|
-
rendered.push(/* @__PURE__ */ jsxDEV("div", {
|
|
225
|
-
className: "h-2"
|
|
226
|
-
}, i, false, undefined, this));
|
|
227
|
-
} else {
|
|
228
|
-
rendered.push(/* @__PURE__ */ jsxDEV("p", {
|
|
229
|
-
className: "my-1",
|
|
230
|
-
children: formatInlineMarkdown(line)
|
|
231
|
-
}, i, false, undefined, this));
|
|
232
|
-
}
|
|
233
|
-
i++;
|
|
234
|
-
}
|
|
235
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
236
|
-
className: "prose prose-sm dark:prose-invert max-w-none",
|
|
237
|
-
children: rendered
|
|
238
|
-
}, undefined, false, undefined, this);
|
|
239
|
-
}
|
|
240
|
-
function renderTable(lines, keyPrefix) {
|
|
241
|
-
if (lines.length < 2)
|
|
242
|
-
return null;
|
|
243
|
-
const parseRow = (row) => row.split("|").slice(1, -1).map((cell) => cell.trim());
|
|
244
|
-
const headers = parseRow(lines[0] ?? "");
|
|
245
|
-
const dataRows = lines.slice(2).map(parseRow);
|
|
246
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
247
|
-
className: "my-4 overflow-x-auto",
|
|
248
|
-
children: /* @__PURE__ */ jsxDEV("table", {
|
|
249
|
-
className: "border-border min-w-full border-collapse border text-sm",
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ jsxDEV("thead", {
|
|
252
|
-
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
253
|
-
className: "bg-muted/50",
|
|
254
|
-
children: headers.map((header, idx) => /* @__PURE__ */ jsxDEV("th", {
|
|
255
|
-
className: "border-border border px-3 py-2 text-left font-semibold",
|
|
256
|
-
children: header
|
|
257
|
-
}, idx, false, undefined, this))
|
|
258
|
-
}, undefined, false, undefined, this)
|
|
259
|
-
}, undefined, false, undefined, this),
|
|
260
|
-
/* @__PURE__ */ jsxDEV("tbody", {
|
|
261
|
-
children: dataRows.map((row, rowIdx) => /* @__PURE__ */ jsxDEV("tr", {
|
|
262
|
-
className: "hover:bg-muted/30",
|
|
263
|
-
children: row.map((cell, cellIdx) => /* @__PURE__ */ jsxDEV("td", {
|
|
264
|
-
className: "border-border border px-3 py-2",
|
|
265
|
-
children: formatInlineMarkdown(cell)
|
|
266
|
-
}, cellIdx, false, undefined, this))
|
|
267
|
-
}, rowIdx, false, undefined, this))
|
|
268
|
-
}, undefined, false, undefined, this)
|
|
269
|
-
]
|
|
270
|
-
}, undefined, true, undefined, this)
|
|
271
|
-
}, `table-${keyPrefix}`, false, undefined, this);
|
|
272
|
-
}
|
|
273
|
-
function formatInlineMarkdown(text) {
|
|
274
|
-
const parts = text.split(/(\*\*[^*]+\*\*)/g);
|
|
275
|
-
return parts.map((part, i) => {
|
|
276
|
-
if (part.startsWith("**") && part.endsWith("**")) {
|
|
277
|
-
return /* @__PURE__ */ jsxDEV("strong", {
|
|
278
|
-
children: part.slice(2, -2)
|
|
279
|
-
}, i, false, undefined, this);
|
|
280
|
-
}
|
|
281
|
-
if (part.includes("`")) {
|
|
282
|
-
const codeParts = part.split(/(`[^`]+`)/g);
|
|
283
|
-
return codeParts.map((cp, j) => {
|
|
284
|
-
if (cp.startsWith("`") && cp.endsWith("`")) {
|
|
285
|
-
return /* @__PURE__ */ jsxDEV("code", {
|
|
286
|
-
className: "rounded bg-violet-500/10 px-1.5 py-0.5 font-mono text-sm",
|
|
287
|
-
children: cp.slice(1, -1)
|
|
288
|
-
}, `${i}-${j}`, false, undefined, this);
|
|
289
|
-
}
|
|
290
|
-
return cp;
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
return part;
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
function formatPresentationName(name) {
|
|
297
|
-
const parts = name.split(".");
|
|
298
|
-
const lastPart = parts[parts.length - 1] ?? name;
|
|
299
|
-
return lastPart.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
300
|
-
}
|
|
301
206
|
export {
|
|
302
|
-
MarkdownView
|
|
303
|
-
MarkdownRenderer
|
|
207
|
+
MarkdownView
|
|
304
208
|
};
|
|
@@ -155,10 +155,10 @@ function generateRecommendations(featuresUsed, unusedFeatures, mostUsedModes, to
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
// src/PersonalizationInsights.tsx
|
|
158
|
-
import { useCallback as useCallback2, useMemo as useMemo2, useState as useState2 } from "react";
|
|
159
158
|
import { Button } from "@contractspec/lib.design-system";
|
|
160
|
-
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
161
159
|
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
160
|
+
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
161
|
+
import { useCallback as useCallback2, useMemo as useMemo2, useState as useState2 } from "react";
|
|
162
162
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
163
163
|
"use client";
|
|
164
164
|
function PersonalizationInsights({
|
|
@@ -207,7 +207,7 @@ function PersonalizationInsights({
|
|
|
207
207
|
className: "overflow-hidden",
|
|
208
208
|
children: [
|
|
209
209
|
/* @__PURE__ */ jsxDEV("div", {
|
|
210
|
-
className: "flex items-center justify-between border-
|
|
210
|
+
className: "flex items-center justify-between border-blue-500/20 border-b bg-blue-500/5 px-4 py-3",
|
|
211
211
|
children: [
|
|
212
212
|
/* @__PURE__ */ jsxDEV("div", {
|
|
213
213
|
className: "flex items-center gap-2",
|
|
@@ -232,7 +232,7 @@ function PersonalizationInsights({
|
|
|
232
232
|
}, undefined, false, undefined, this),
|
|
233
233
|
onToggle && /* @__PURE__ */ jsxDEV("button", {
|
|
234
234
|
onClick: onToggle,
|
|
235
|
-
className: "text-muted-foreground hover:text-foreground
|
|
235
|
+
className: "p-1 text-muted-foreground hover:text-foreground",
|
|
236
236
|
type: "button",
|
|
237
237
|
title: "Collapse",
|
|
238
238
|
children: "\u2715"
|
|
@@ -274,7 +274,7 @@ function PersonalizationInsights({
|
|
|
274
274
|
className: "mb-4",
|
|
275
275
|
children: [
|
|
276
276
|
/* @__PURE__ */ jsxDEV("h4", {
|
|
277
|
-
className: "mb-2
|
|
277
|
+
className: "mb-2 font-semibold text-blue-400 text-xs uppercase",
|
|
278
278
|
children: "Recommendations"
|
|
279
279
|
}, undefined, false, undefined, this),
|
|
280
280
|
/* @__PURE__ */ jsxDEV("ul", {
|
|
@@ -298,7 +298,7 @@ function PersonalizationInsights({
|
|
|
298
298
|
className: "mb-4",
|
|
299
299
|
children: [
|
|
300
300
|
/* @__PURE__ */ jsxDEV("h4", {
|
|
301
|
-
className: "mb-2
|
|
301
|
+
className: "mb-2 font-semibold text-blue-400 text-xs uppercase",
|
|
302
302
|
children: "Try These Features"
|
|
303
303
|
}, undefined, false, undefined, this),
|
|
304
304
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -315,7 +315,7 @@ function PersonalizationInsights({
|
|
|
315
315
|
sessionStart
|
|
316
316
|
}, undefined, false, undefined, this),
|
|
317
317
|
/* @__PURE__ */ jsxDEV("div", {
|
|
318
|
-
className: "mt-4 flex justify-end border-
|
|
318
|
+
className: "mt-4 flex justify-end border-blue-500/10 border-t pt-4",
|
|
319
319
|
children: /* @__PURE__ */ jsxDEV(Button, {
|
|
320
320
|
variant: "ghost",
|
|
321
321
|
size: "sm",
|
|
@@ -347,7 +347,7 @@ function StatCard({
|
|
|
347
347
|
children: icon
|
|
348
348
|
}, undefined, false, undefined, this),
|
|
349
349
|
/* @__PURE__ */ jsxDEV("div", {
|
|
350
|
-
className: "text-lg
|
|
350
|
+
className: "font-bold text-lg",
|
|
351
351
|
children: value
|
|
352
352
|
}, undefined, false, undefined, this),
|
|
353
353
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -362,12 +362,12 @@ function DetailedInsights({
|
|
|
362
362
|
sessionStart
|
|
363
363
|
}) {
|
|
364
364
|
return /* @__PURE__ */ jsxDEV("div", {
|
|
365
|
-
className: "mt-4 space-y-4 border-
|
|
365
|
+
className: "mt-4 space-y-4 border-blue-500/10 border-t pt-4",
|
|
366
366
|
children: [
|
|
367
367
|
summary.mostUsedTemplates.length > 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
368
368
|
children: [
|
|
369
369
|
/* @__PURE__ */ jsxDEV("h4", {
|
|
370
|
-
className: "mb-2
|
|
370
|
+
className: "mb-2 font-semibold text-blue-400 text-xs uppercase",
|
|
371
371
|
children: "Most Used Templates"
|
|
372
372
|
}, undefined, false, undefined, this),
|
|
373
373
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -393,7 +393,7 @@ function DetailedInsights({
|
|
|
393
393
|
summary.mostUsedModes.length > 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ jsxDEV("h4", {
|
|
396
|
-
className: "mb-2
|
|
396
|
+
className: "mb-2 font-semibold text-blue-400 text-xs uppercase",
|
|
397
397
|
children: "Mode Usage"
|
|
398
398
|
}, undefined, false, undefined, this),
|
|
399
399
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -419,7 +419,7 @@ function DetailedInsights({
|
|
|
419
419
|
/* @__PURE__ */ jsxDEV("div", {
|
|
420
420
|
children: [
|
|
421
421
|
/* @__PURE__ */ jsxDEV("h4", {
|
|
422
|
-
className: "mb-2
|
|
422
|
+
className: "mb-2 font-semibold text-blue-400 text-xs uppercase",
|
|
423
423
|
children: "Features Used"
|
|
424
424
|
}, undefined, false, undefined, this),
|
|
425
425
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -12,8 +12,8 @@ function useTemplateRuntime() {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// src/SaveToStudioButton.tsx
|
|
15
|
-
import { useState } from "react";
|
|
16
15
|
import { Sparkles } from "lucide-react";
|
|
16
|
+
import { useState } from "react";
|
|
17
17
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
18
18
|
"use client";
|
|
19
19
|
function SaveToStudioButton({
|
|
@@ -63,7 +63,7 @@ function SaveToStudioButton({
|
|
|
63
63
|
children: error
|
|
64
64
|
}, undefined, false, undefined, this) : null,
|
|
65
65
|
status === "saved" ? /* @__PURE__ */ jsxDEV("p", {
|
|
66
|
-
className: "text-
|
|
66
|
+
className: "text-emerald-400 text-xs",
|
|
67
67
|
children: "Template sent to Studio."
|
|
68
68
|
}, undefined, false, undefined, this) : null
|
|
69
69
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
1
|
import type { ResolvedSurfacePlan } from '@contractspec/lib.surface-runtime/runtime/resolve-bundle';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
3
|
import { type SaveToStudioButtonProps } from './SaveToStudioButton';
|
|
4
4
|
export interface SpecDrivenTemplateShellProps {
|
|
5
5
|
plan: ResolvedSurfacePlan;
|
|
@@ -28,7 +28,7 @@ function LocalDataIndicator() {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
return /* @__PURE__ */ jsxDEV("div", {
|
|
31
|
-
className: "
|
|
31
|
+
className: "inline-flex items-center gap-2 rounded-full border border-border bg-muted/40 px-3 py-1 text-muted-foreground text-xs",
|
|
32
32
|
children: [
|
|
33
33
|
/* @__PURE__ */ jsxDEV(Shield, {
|
|
34
34
|
className: "h-3.5 w-3.5 text-violet-400"
|
|
@@ -38,14 +38,14 @@ function LocalDataIndicator() {
|
|
|
38
38
|
"Local runtime \xB7",
|
|
39
39
|
" ",
|
|
40
40
|
/* @__PURE__ */ jsxDEV("span", {
|
|
41
|
-
className: "text-foreground
|
|
41
|
+
className: "font-semibold text-foreground",
|
|
42
42
|
children: template.name
|
|
43
43
|
}, undefined, false, undefined, this)
|
|
44
44
|
]
|
|
45
45
|
}, undefined, true, undefined, this),
|
|
46
46
|
/* @__PURE__ */ jsxDEV("button", {
|
|
47
47
|
type: "button",
|
|
48
|
-
className: "
|
|
48
|
+
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",
|
|
49
49
|
onClick: handleReset,
|
|
50
50
|
disabled: isResetting,
|
|
51
51
|
children: [
|
|
@@ -60,8 +60,8 @@ function LocalDataIndicator() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// src/SaveToStudioButton.tsx
|
|
63
|
-
import { useState as useState2 } from "react";
|
|
64
63
|
import { Sparkles } from "lucide-react";
|
|
64
|
+
import { useState as useState2 } from "react";
|
|
65
65
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
66
66
|
"use client";
|
|
67
67
|
function SaveToStudioButton({
|
|
@@ -111,7 +111,7 @@ function SaveToStudioButton({
|
|
|
111
111
|
children: error
|
|
112
112
|
}, undefined, false, undefined, this) : null,
|
|
113
113
|
status === "saved" ? /* @__PURE__ */ jsxDEV2("p", {
|
|
114
|
-
className: "text-
|
|
114
|
+
className: "text-emerald-400 text-xs",
|
|
115
115
|
children: "Template sent to Studio."
|
|
116
116
|
}, undefined, false, undefined, this) : null
|
|
117
117
|
]
|
|
@@ -135,7 +135,7 @@ function SpecDrivenTemplateShell({
|
|
|
135
135
|
children
|
|
136
136
|
}) {
|
|
137
137
|
const headerContent = /* @__PURE__ */ jsxDEV3("header", {
|
|
138
|
-
className: "border-border bg-card
|
|
138
|
+
className: "rounded-2xl border border-border bg-card p-6 shadow-sm",
|
|
139
139
|
children: [
|
|
140
140
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
141
141
|
className: "flex flex-wrap items-center justify-between gap-4",
|
|
@@ -143,15 +143,15 @@ function SpecDrivenTemplateShell({
|
|
|
143
143
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
144
144
|
children: [
|
|
145
145
|
/* @__PURE__ */ jsxDEV3("p", {
|
|
146
|
-
className: "text-muted-foreground text-sm
|
|
146
|
+
className: "font-semibold text-muted-foreground text-sm uppercase tracking-wide",
|
|
147
147
|
children: "ContractSpec Templates"
|
|
148
148
|
}, undefined, false, undefined, this),
|
|
149
149
|
/* @__PURE__ */ jsxDEV3("h1", {
|
|
150
|
-
className: "text-3xl
|
|
150
|
+
className: "font-bold text-3xl",
|
|
151
151
|
children: title
|
|
152
152
|
}, undefined, false, undefined, this),
|
|
153
153
|
description ? /* @__PURE__ */ jsxDEV3("p", {
|
|
154
|
-
className: "
|
|
154
|
+
className: "mt-2 max-w-2xl text-muted-foreground text-sm",
|
|
155
155
|
children: description
|
|
156
156
|
}, undefined, false, undefined, this) : null
|
|
157
157
|
]
|
|
@@ -182,7 +182,7 @@ function SpecDrivenTemplateShell({
|
|
|
182
182
|
};
|
|
183
183
|
if (sidebar != null) {
|
|
184
184
|
slotContent.sidebar = /* @__PURE__ */ jsxDEV3("aside", {
|
|
185
|
-
className: "border-border bg-card
|
|
185
|
+
className: "rounded-2xl border border-border bg-card p-4",
|
|
186
186
|
children: sidebar
|
|
187
187
|
}, undefined, false, undefined, this);
|
|
188
188
|
}
|
package/dist/SpecEditorPanel.js
CHANGED
|
@@ -577,9 +577,9 @@ function useSpecContent(templateId) {
|
|
|
577
577
|
}
|
|
578
578
|
|
|
579
579
|
// src/SpecEditorPanel.tsx
|
|
580
|
-
import { useCallback as useCallback2, useEffect as useEffect2 } from "react";
|
|
581
580
|
import { Button, LoaderBlock } from "@contractspec/lib.design-system";
|
|
582
581
|
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
582
|
+
import { useCallback as useCallback2, useEffect as useEffect2 } from "react";
|
|
583
583
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
584
584
|
"use client";
|
|
585
585
|
function SpecEditorPanel({
|
|
@@ -683,7 +683,7 @@ function SpecEditorPanel({
|
|
|
683
683
|
className: "rounded-lg border border-amber-500/50 bg-amber-500/10 p-3",
|
|
684
684
|
children: [
|
|
685
685
|
/* @__PURE__ */ jsxDEV("p", {
|
|
686
|
-
className: "mb-2
|
|
686
|
+
className: "mb-2 font-semibold text-amber-400 text-xs uppercase",
|
|
687
687
|
children: "Validation Issues"
|
|
688
688
|
}, undefined, false, undefined, this),
|
|
689
689
|
/* @__PURE__ */ jsxDEV("ul", {
|
|
@@ -701,7 +701,7 @@ function SpecEditorPanel({
|
|
|
701
701
|
]
|
|
702
702
|
}, undefined, true, undefined, this),
|
|
703
703
|
/* @__PURE__ */ jsxDEV("div", {
|
|
704
|
-
className: "border-border bg-card
|
|
704
|
+
className: "rounded-2xl border border-border bg-card p-4",
|
|
705
705
|
children: /* @__PURE__ */ jsxDEV(SpecEditor, {
|
|
706
706
|
projectId: "sandbox",
|
|
707
707
|
type: "CAPABILITY",
|
package/dist/TemplateShell.js
CHANGED
|
@@ -28,7 +28,7 @@ function LocalDataIndicator() {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
return /* @__PURE__ */ jsxDEV("div", {
|
|
31
|
-
className: "
|
|
31
|
+
className: "inline-flex items-center gap-2 rounded-full border border-border bg-muted/40 px-3 py-1 text-muted-foreground text-xs",
|
|
32
32
|
children: [
|
|
33
33
|
/* @__PURE__ */ jsxDEV(Shield, {
|
|
34
34
|
className: "h-3.5 w-3.5 text-violet-400"
|
|
@@ -38,14 +38,14 @@ function LocalDataIndicator() {
|
|
|
38
38
|
"Local runtime \xB7",
|
|
39
39
|
" ",
|
|
40
40
|
/* @__PURE__ */ jsxDEV("span", {
|
|
41
|
-
className: "text-foreground
|
|
41
|
+
className: "font-semibold text-foreground",
|
|
42
42
|
children: template.name
|
|
43
43
|
}, undefined, false, undefined, this)
|
|
44
44
|
]
|
|
45
45
|
}, undefined, true, undefined, this),
|
|
46
46
|
/* @__PURE__ */ jsxDEV("button", {
|
|
47
47
|
type: "button",
|
|
48
|
-
className: "
|
|
48
|
+
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",
|
|
49
49
|
onClick: handleReset,
|
|
50
50
|
disabled: isResetting,
|
|
51
51
|
children: [
|
|
@@ -60,8 +60,8 @@ function LocalDataIndicator() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// src/SaveToStudioButton.tsx
|
|
63
|
-
import { useState as useState2 } from "react";
|
|
64
63
|
import { Sparkles } from "lucide-react";
|
|
64
|
+
import { useState as useState2 } from "react";
|
|
65
65
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
66
66
|
"use client";
|
|
67
67
|
function SaveToStudioButton({
|
|
@@ -111,7 +111,7 @@ function SaveToStudioButton({
|
|
|
111
111
|
children: error
|
|
112
112
|
}, undefined, false, undefined, this) : null,
|
|
113
113
|
status === "saved" ? /* @__PURE__ */ jsxDEV2("p", {
|
|
114
|
-
className: "text-
|
|
114
|
+
className: "text-emerald-400 text-xs",
|
|
115
115
|
children: "Template sent to Studio."
|
|
116
116
|
}, undefined, false, undefined, this) : null
|
|
117
117
|
]
|
|
@@ -132,7 +132,7 @@ var TemplateShell = ({
|
|
|
132
132
|
className: "space-y-6",
|
|
133
133
|
children: [
|
|
134
134
|
/* @__PURE__ */ jsxDEV3("header", {
|
|
135
|
-
className: "border-border bg-card
|
|
135
|
+
className: "rounded-2xl border border-border bg-card p-6 shadow-sm",
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
138
138
|
className: "flex flex-wrap items-center justify-between gap-4",
|
|
@@ -140,15 +140,15 @@ var TemplateShell = ({
|
|
|
140
140
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
141
141
|
children: [
|
|
142
142
|
/* @__PURE__ */ jsxDEV3("p", {
|
|
143
|
-
className: "text-muted-foreground text-sm
|
|
143
|
+
className: "font-semibold text-muted-foreground text-sm uppercase tracking-wide",
|
|
144
144
|
children: "ContractSpec Templates"
|
|
145
145
|
}, undefined, false, undefined, this),
|
|
146
146
|
/* @__PURE__ */ jsxDEV3("h1", {
|
|
147
|
-
className: "text-3xl
|
|
147
|
+
className: "font-bold text-3xl",
|
|
148
148
|
children: title
|
|
149
149
|
}, undefined, false, undefined, this),
|
|
150
150
|
description ? /* @__PURE__ */ jsxDEV3("p", {
|
|
151
|
-
className: "
|
|
151
|
+
className: "mt-2 max-w-2xl text-muted-foreground text-sm",
|
|
152
152
|
children: description
|
|
153
153
|
}, undefined, false, undefined, this) : null
|
|
154
154
|
]
|
|
@@ -178,7 +178,7 @@ var TemplateShell = ({
|
|
|
178
178
|
children
|
|
179
179
|
}, undefined, false, undefined, this),
|
|
180
180
|
sidebar ? /* @__PURE__ */ jsxDEV3("aside", {
|
|
181
|
-
className: "border-border bg-card
|
|
181
|
+
className: "rounded-2xl border border-border bg-card p-4",
|
|
182
182
|
children: sidebar
|
|
183
183
|
}, undefined, false, undefined, this) : null
|
|
184
184
|
]
|