@contractspec/lib.example-shared-ui 6.0.6 → 6.0.10
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 +24 -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/.turbo/turbo-build.log
CHANGED
|
@@ -2,94 +2,100 @@ $ contractspec-bun-build prebuild
|
|
|
2
2
|
$ bun run prebuild && bun run build:bundle && bun run build:types
|
|
3
3
|
$ contractspec-bun-build prebuild
|
|
4
4
|
$ contractspec-bun-build transpile
|
|
5
|
-
[contractspec-bun-build] transpile target=bun root=src entries=
|
|
6
|
-
Bundled
|
|
5
|
+
[contractspec-bun-build] transpile target=bun root=src entries=28 noBundle=false
|
|
6
|
+
Bundled 28 modules in 47ms
|
|
7
7
|
|
|
8
|
-
./EvolutionDashboard.js
|
|
9
|
-
./index.js
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
./SpecEditorPanel.js
|
|
16
|
-
./TemplateShell.js
|
|
17
|
-
bundles/index.js
|
|
18
|
-
bundles/ExampleTemplateBundle.js
|
|
19
|
-
hooks/index.js
|
|
20
|
-
hooks/useWorkflowComposer.js
|
|
21
|
-
hooks/useSpecContent.js
|
|
22
|
-
utils/generateSpecFromTemplate.js
|
|
23
|
-
hooks/useRegistryTemplates.js
|
|
24
|
-
./EvolutionSidebar.js
|
|
25
|
-
hooks/useEvolution.js
|
|
26
|
-
./MarkdownView.js
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
./
|
|
31
|
-
|
|
32
|
-
./
|
|
33
|
-
|
|
8
|
+
./EvolutionDashboard.js 31.40 KB (entry point)
|
|
9
|
+
./index.js 119.50 KB (entry point)
|
|
10
|
+
./overlay-types.js 8 bytes (entry point)
|
|
11
|
+
utils/index.js 10.1 KB (entry point)
|
|
12
|
+
utils/fetchPresentationData.js 461 bytes (entry point)
|
|
13
|
+
lib/component-registry.js 1.23 KB (entry point)
|
|
14
|
+
lib/types.js 8 bytes (entry point)
|
|
15
|
+
./SpecEditorPanel.js 19.64 KB (entry point)
|
|
16
|
+
./TemplateShell.js 6.84 KB (entry point)
|
|
17
|
+
bundles/index.js 2.44 KB (entry point)
|
|
18
|
+
bundles/ExampleTemplateBundle.js 2.44 KB (entry point)
|
|
19
|
+
hooks/index.js 44.1 KB (entry point)
|
|
20
|
+
hooks/useWorkflowComposer.js 13.67 KB (entry point)
|
|
21
|
+
hooks/useSpecContent.js 14.30 KB (entry point)
|
|
22
|
+
utils/generateSpecFromTemplate.js 9.65 KB (entry point)
|
|
23
|
+
hooks/useRegistryTemplates.js 0.94 KB (entry point)
|
|
24
|
+
./EvolutionSidebar.js 21.24 KB (entry point)
|
|
25
|
+
hooks/useEvolution.js 9.50 KB (entry point)
|
|
26
|
+
./MarkdownView.js 7.0 KB (entry point)
|
|
27
|
+
markdown/formatPresentationName.js 314 bytes (entry point)
|
|
28
|
+
markdown/useMarkdownPresentation.js 2.1 KB (entry point)
|
|
29
|
+
./OverlayContextProvider.js 5.89 KB (entry point)
|
|
30
|
+
./PersonalizationInsights.js 17.74 KB (entry point)
|
|
31
|
+
hooks/useBehaviorTracking.js 5.53 KB (entry point)
|
|
32
|
+
./SpecDrivenTemplateShell.js 6.90 KB (entry point)
|
|
33
|
+
./LocalDataIndicator.js 2.20 KB (entry point)
|
|
34
|
+
./SaveToStudioButton.js 2.33 KB (entry point)
|
|
35
|
+
lib/runtime-context.js 430 bytes (entry point)
|
|
34
36
|
|
|
35
|
-
[contractspec-bun-build] transpile target=node root=src entries=
|
|
36
|
-
Bundled
|
|
37
|
+
[contractspec-bun-build] transpile target=node root=src entries=28 noBundle=false
|
|
38
|
+
Bundled 28 modules in 27ms
|
|
37
39
|
|
|
38
|
-
./EvolutionDashboard.js
|
|
39
|
-
./index.js
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
./SpecEditorPanel.js
|
|
46
|
-
./TemplateShell.js
|
|
47
|
-
bundles/index.js
|
|
48
|
-
bundles/ExampleTemplateBundle.js
|
|
49
|
-
hooks/index.js
|
|
50
|
-
hooks/useWorkflowComposer.js
|
|
51
|
-
hooks/useSpecContent.js
|
|
52
|
-
utils/generateSpecFromTemplate.js
|
|
53
|
-
hooks/useRegistryTemplates.js
|
|
54
|
-
./EvolutionSidebar.js
|
|
55
|
-
hooks/useEvolution.js
|
|
56
|
-
./MarkdownView.js
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
./
|
|
61
|
-
|
|
62
|
-
./
|
|
63
|
-
|
|
40
|
+
./EvolutionDashboard.js 31.38 KB (entry point)
|
|
41
|
+
./index.js 119.44 KB (entry point)
|
|
42
|
+
./overlay-types.js 0 KB (entry point)
|
|
43
|
+
utils/index.js 10.1 KB (entry point)
|
|
44
|
+
utils/fetchPresentationData.js 453 bytes (entry point)
|
|
45
|
+
lib/component-registry.js 1.22 KB (entry point)
|
|
46
|
+
lib/types.js 0 KB (entry point)
|
|
47
|
+
./SpecEditorPanel.js 19.63 KB (entry point)
|
|
48
|
+
./TemplateShell.js 6.83 KB (entry point)
|
|
49
|
+
bundles/index.js 2.43 KB (entry point)
|
|
50
|
+
bundles/ExampleTemplateBundle.js 2.43 KB (entry point)
|
|
51
|
+
hooks/index.js 44.1 KB (entry point)
|
|
52
|
+
hooks/useWorkflowComposer.js 13.67 KB (entry point)
|
|
53
|
+
hooks/useSpecContent.js 14.29 KB (entry point)
|
|
54
|
+
utils/generateSpecFromTemplate.js 9.64 KB (entry point)
|
|
55
|
+
hooks/useRegistryTemplates.js 0.93 KB (entry point)
|
|
56
|
+
./EvolutionSidebar.js 21.23 KB (entry point)
|
|
57
|
+
hooks/useEvolution.js 9.50 KB (entry point)
|
|
58
|
+
./MarkdownView.js 7.0 KB (entry point)
|
|
59
|
+
markdown/formatPresentationName.js 306 bytes (entry point)
|
|
60
|
+
markdown/useMarkdownPresentation.js 2.0 KB (entry point)
|
|
61
|
+
./OverlayContextProvider.js 5.88 KB (entry point)
|
|
62
|
+
./PersonalizationInsights.js 17.71 KB (entry point)
|
|
63
|
+
hooks/useBehaviorTracking.js 5.52 KB (entry point)
|
|
64
|
+
./SpecDrivenTemplateShell.js 6.88 KB (entry point)
|
|
65
|
+
./LocalDataIndicator.js 2.19 KB (entry point)
|
|
66
|
+
./SaveToStudioButton.js 2.32 KB (entry point)
|
|
67
|
+
lib/runtime-context.js 422 bytes (entry point)
|
|
64
68
|
|
|
65
|
-
[contractspec-bun-build] transpile target=browser root=src entries=
|
|
66
|
-
Bundled
|
|
69
|
+
[contractspec-bun-build] transpile target=browser root=src entries=28 noBundle=false
|
|
70
|
+
Bundled 28 modules in 33ms
|
|
67
71
|
|
|
68
|
-
./EvolutionDashboard.js
|
|
69
|
-
./index.js
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
./SpecEditorPanel.js
|
|
76
|
-
./TemplateShell.js
|
|
77
|
-
bundles/index.js
|
|
78
|
-
bundles/ExampleTemplateBundle.js
|
|
79
|
-
hooks/index.js
|
|
80
|
-
hooks/useWorkflowComposer.js
|
|
81
|
-
hooks/useSpecContent.js
|
|
82
|
-
utils/generateSpecFromTemplate.js
|
|
83
|
-
hooks/useRegistryTemplates.js
|
|
84
|
-
./EvolutionSidebar.js
|
|
85
|
-
hooks/useEvolution.js
|
|
86
|
-
./MarkdownView.js
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
./
|
|
91
|
-
|
|
92
|
-
./
|
|
93
|
-
|
|
72
|
+
./EvolutionDashboard.js 31.38 KB (entry point)
|
|
73
|
+
./index.js 119.44 KB (entry point)
|
|
74
|
+
./overlay-types.js 0 KB (entry point)
|
|
75
|
+
utils/index.js 10.1 KB (entry point)
|
|
76
|
+
utils/fetchPresentationData.js 453 bytes (entry point)
|
|
77
|
+
lib/component-registry.js 1.22 KB (entry point)
|
|
78
|
+
lib/types.js 0 KB (entry point)
|
|
79
|
+
./SpecEditorPanel.js 19.63 KB (entry point)
|
|
80
|
+
./TemplateShell.js 6.83 KB (entry point)
|
|
81
|
+
bundles/index.js 2.43 KB (entry point)
|
|
82
|
+
bundles/ExampleTemplateBundle.js 2.43 KB (entry point)
|
|
83
|
+
hooks/index.js 44.1 KB (entry point)
|
|
84
|
+
hooks/useWorkflowComposer.js 13.67 KB (entry point)
|
|
85
|
+
hooks/useSpecContent.js 14.29 KB (entry point)
|
|
86
|
+
utils/generateSpecFromTemplate.js 9.64 KB (entry point)
|
|
87
|
+
hooks/useRegistryTemplates.js 0.93 KB (entry point)
|
|
88
|
+
./EvolutionSidebar.js 21.23 KB (entry point)
|
|
89
|
+
hooks/useEvolution.js 9.50 KB (entry point)
|
|
90
|
+
./MarkdownView.js 7.0 KB (entry point)
|
|
91
|
+
markdown/formatPresentationName.js 306 bytes (entry point)
|
|
92
|
+
markdown/useMarkdownPresentation.js 2.0 KB (entry point)
|
|
93
|
+
./OverlayContextProvider.js 5.88 KB (entry point)
|
|
94
|
+
./PersonalizationInsights.js 17.71 KB (entry point)
|
|
95
|
+
hooks/useBehaviorTracking.js 5.52 KB (entry point)
|
|
96
|
+
./SpecDrivenTemplateShell.js 6.88 KB (entry point)
|
|
97
|
+
./LocalDataIndicator.js 2.19 KB (entry point)
|
|
98
|
+
./SaveToStudioButton.js 2.32 KB (entry point)
|
|
99
|
+
lib/runtime-context.js 422 bytes (entry point)
|
|
94
100
|
|
|
95
101
|
$ contractspec-bun-build types
|
package/AGENTS.md
CHANGED
|
@@ -6,36 +6,54 @@ Shared React components and hooks for ContractSpec example apps. Provides the co
|
|
|
6
6
|
|
|
7
7
|
## Quick Context
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
- Layer: `lib`.
|
|
10
|
+
- Package visibility: published package.
|
|
11
|
+
- Primary consumers are other libs, modules, bundles, and apps in the monorepo.
|
|
12
|
+
- Related packages: `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.surface-runtime`, `@contractspec/lib.ui-kit-web`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
13
|
+
|
|
14
|
+
## Architecture
|
|
15
|
+
|
|
16
|
+
- `src/bundles/` contains bundle definitions and composition entrypoints.
|
|
17
|
+
- `src/EvolutionDashboard.tsx` is part of the package's public or composition surface.
|
|
18
|
+
- `src/EvolutionSidebar.tsx` is part of the package's public or composition surface.
|
|
19
|
+
- `src/hooks/` contains custom hooks for host applications.
|
|
20
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
21
|
+
- `src/lib/` contains package-local helper utilities and adapters.
|
|
22
|
+
- `src/LocalDataIndicator.tsx` is part of the package's public or composition surface.
|
|
23
|
+
|
|
24
|
+
## Public Surface
|
|
25
|
+
|
|
26
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
27
|
+
- Export `./bundles` resolves through `./src/bundles/index.ts`.
|
|
28
|
+
- Export `./bundles/ExampleTemplateBundle` resolves through `./src/bundles/ExampleTemplateBundle.ts`.
|
|
29
|
+
- Export `./EvolutionDashboard` resolves through `./src/EvolutionDashboard.tsx`.
|
|
30
|
+
- Export `./EvolutionSidebar` resolves through `./src/EvolutionSidebar.tsx`.
|
|
31
|
+
- Export `./hooks` resolves through `./src/hooks/index.ts`.
|
|
32
|
+
- Export `./hooks/useBehaviorTracking` resolves through `./src/hooks/useBehaviorTracking.ts`.
|
|
33
|
+
- Export `./hooks/useEvolution` resolves through `./src/hooks/useEvolution.ts`.
|
|
34
|
+
- Export `./hooks/useRegistryTemplates` resolves through `./src/hooks/useRegistryTemplates.ts`.
|
|
35
|
+
- Export `./hooks/useSpecContent` resolves through `./src/hooks/useSpecContent.ts`.
|
|
36
|
+
- The package publishes 26 total export subpaths; keep docs aligned with `package.json`.
|
|
30
37
|
|
|
31
38
|
## Guardrails
|
|
32
39
|
|
|
33
40
|
- Low blast radius — only example apps depend on this package.
|
|
34
41
|
- `TemplateShell` is the shared layout for all examples; structural changes affect every example app.
|
|
42
|
+
- Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.surface-runtime`, `@contractspec/lib.ui-kit-web`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
43
|
+
- Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.surface-runtime`, `@contractspec/lib.ui-kit-web`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
35
44
|
|
|
36
45
|
## Local Commands
|
|
37
46
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
47
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
48
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
49
|
+
- `bun run test` — bun test --pass-with-no-tests
|
|
50
|
+
- `bun run lint` — bun lint:fix
|
|
51
|
+
- `bun run lint:check` — biome check .
|
|
52
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
53
|
+
- `bun run typecheck` — tsc --noEmit
|
|
54
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
55
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
56
|
+
- `bun run clean` — rimraf dist .turbo
|
|
57
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
58
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
59
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @contractspec/lib.example-shared-ui
|
|
2
2
|
|
|
3
|
+
## 6.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1a44cb6: feat: improve examples to increase coverage of Contracts type
|
|
8
|
+
- Updated dependencies [1a44cb6]
|
|
9
|
+
- @contractspec/lib.surface-runtime@0.5.10
|
|
10
|
+
- @contractspec/lib.contracts-spec@4.1.2
|
|
11
|
+
- @contractspec/lib.design-system@3.8.3
|
|
12
|
+
- @contractspec/lib.ui-kit-web@3.9.2
|
|
13
|
+
|
|
14
|
+
## 6.0.9
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- fix: release
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @contractspec/lib.surface-runtime@0.5.9
|
|
21
|
+
- @contractspec/lib.contracts-spec@4.1.1
|
|
22
|
+
- @contractspec/lib.design-system@3.8.2
|
|
23
|
+
- @contractspec/lib.ui-kit-web@3.9.1
|
|
24
|
+
|
|
3
25
|
## 6.0.6
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -164,6 +186,7 @@
|
|
|
164
186
|
### Patch Changes
|
|
165
187
|
|
|
166
188
|
- 66c51da: feat(example-shared-ui): add SpecDrivenTemplateShell, ExampleTemplateBundle, bundles export
|
|
189
|
+
|
|
167
190
|
- Add SpecDrivenTemplateShell component
|
|
168
191
|
- Add ExampleTemplateBundle and bundles/index
|
|
169
192
|
- Add optional peer @contractspec/lib.surface-runtime
|
|
@@ -442,6 +465,7 @@
|
|
|
442
465
|
- 7f3203a: fix: make workspace test runs resilient when packages have no tests
|
|
443
466
|
|
|
444
467
|
Updates package test scripts to pass cleanly when no matching test files exist:
|
|
468
|
+
|
|
445
469
|
- Uses `bun test --pass-with-no-tests` in Bun-based packages that currently ship without test files.
|
|
446
470
|
- Uses `jest --passWithNoTests` for the UI kit web package.
|
|
447
471
|
- Adds `.vscode-test.mjs` for `vscode-contractspec` so VS Code extension test runs have an explicit config and stop failing on missing default configuration.
|
package/README.md
CHANGED
|
@@ -1,45 +1,73 @@
|
|
|
1
1
|
# @contractspec/lib.example-shared-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Shared React components and hooks for ContractSpec example apps. Provides the common layout, editors, and overlays used across all examples.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## What It Provides
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **Layer**: lib.
|
|
8
|
+
- **Consumers**: example apps.
|
|
9
|
+
- Related ContractSpec packages include `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.surface-runtime`, `@contractspec/lib.ui-kit-web`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
10
|
+
- Related ContractSpec packages include `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.surface-runtime`, `@contractspec/lib.ui-kit-web`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
8
11
|
|
|
9
12
|
## Installation
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- `.` -- All components, hooks, and utilities
|
|
18
|
-
- `./TemplateShell` -- App shell layout with navigation and slots
|
|
19
|
-
- `./EvolutionDashboard` -- Dashboard for spec evolution visualization
|
|
20
|
-
- `./EvolutionSidebar` -- Sidebar companion for the evolution dashboard
|
|
21
|
-
- `./SpecEditorPanel` -- Inline spec editor component
|
|
22
|
-
- `./MarkdownView` -- Markdown renderer
|
|
23
|
-
- `./LocalDataIndicator` -- Indicator for local/offline data state
|
|
24
|
-
- `./SaveToStudioButton` -- One-click save to ContractSpec Studio
|
|
25
|
-
- `./OverlayContextProvider` -- Context provider for overlay state
|
|
26
|
-
- `./PersonalizationInsights` -- Personalization insights panel
|
|
27
|
-
- `./hooks/*` -- Shared React hooks
|
|
28
|
-
- `./lib/*` -- Runtime context, component registry, and shared types
|
|
29
|
-
- `./utils/*` -- Shared utility functions
|
|
30
|
-
- `./overlay-types` -- Overlay type definitions
|
|
14
|
+
`npm install @contractspec/lib.example-shared-ui`
|
|
15
|
+
|
|
16
|
+
or
|
|
17
|
+
|
|
18
|
+
`bun add @contractspec/lib.example-shared-ui`
|
|
31
19
|
|
|
32
20
|
## Usage
|
|
33
21
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
22
|
+
Import the root entrypoint from `@contractspec/lib.example-shared-ui`, or choose a documented subpath when you only need one part of the package surface.
|
|
23
|
+
|
|
24
|
+
## Architecture
|
|
25
|
+
|
|
26
|
+
- `src/bundles/` contains bundle definitions and composition entrypoints.
|
|
27
|
+
- `src/EvolutionDashboard.tsx` is part of the package's public or composition surface.
|
|
28
|
+
- `src/EvolutionSidebar.tsx` is part of the package's public or composition surface.
|
|
29
|
+
- `src/hooks/` contains custom hooks for host applications.
|
|
30
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
31
|
+
- `src/lib/` contains package-local helper utilities and adapters.
|
|
32
|
+
- `src/LocalDataIndicator.tsx` is part of the package's public or composition surface.
|
|
33
|
+
|
|
34
|
+
## Public Entry Points
|
|
35
|
+
|
|
36
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
37
|
+
- Export `./bundles` resolves through `./src/bundles/index.ts`.
|
|
38
|
+
- Export `./bundles/ExampleTemplateBundle` resolves through `./src/bundles/ExampleTemplateBundle.ts`.
|
|
39
|
+
- Export `./EvolutionDashboard` resolves through `./src/EvolutionDashboard.tsx`.
|
|
40
|
+
- Export `./EvolutionSidebar` resolves through `./src/EvolutionSidebar.tsx`.
|
|
41
|
+
- Export `./hooks` resolves through `./src/hooks/index.ts`.
|
|
42
|
+
- Export `./hooks/useBehaviorTracking` resolves through `./src/hooks/useBehaviorTracking.ts`.
|
|
43
|
+
- Export `./hooks/useEvolution` resolves through `./src/hooks/useEvolution.ts`.
|
|
44
|
+
- Export `./hooks/useRegistryTemplates` resolves through `./src/hooks/useRegistryTemplates.ts`.
|
|
45
|
+
- Export `./hooks/useSpecContent` resolves through `./src/hooks/useSpecContent.ts`.
|
|
46
|
+
- The package publishes 26 total export subpaths; keep docs aligned with `package.json`.
|
|
47
|
+
|
|
48
|
+
## Local Commands
|
|
49
|
+
|
|
50
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
51
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
52
|
+
- `bun run test` — bun test --pass-with-no-tests
|
|
53
|
+
- `bun run lint` — bun lint:fix
|
|
54
|
+
- `bun run lint:check` — biome check .
|
|
55
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
56
|
+
- `bun run typecheck` — tsc --noEmit
|
|
57
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
58
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
59
|
+
- `bun run clean` — rimraf dist .turbo
|
|
60
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
61
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
62
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
63
|
+
|
|
64
|
+
## Recent Updates
|
|
65
|
+
|
|
66
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
67
|
+
- Add changesets and apply pending fixes.
|
|
68
|
+
- Contracts context, bundle exports, surface-runtime docs.
|
|
69
|
+
|
|
70
|
+
## Notes
|
|
71
|
+
|
|
72
|
+
- Low blast radius — only example apps depend on this package.
|
|
73
|
+
- `TemplateShell` is the shared layout for all examples; structural changes affect every example app.
|
|
@@ -258,10 +258,10 @@ function generateRecommendedActions(anomaly) {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
// src/EvolutionDashboard.tsx
|
|
261
|
-
import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
262
261
|
import { Button, LoaderBlock } from "@contractspec/lib.design-system";
|
|
263
|
-
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
264
262
|
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
263
|
+
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
264
|
+
import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
265
265
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
266
266
|
"use client";
|
|
267
267
|
function EvolutionDashboard({
|
|
@@ -340,7 +340,7 @@ function EvolutionDashboard({
|
|
|
340
340
|
/* @__PURE__ */ jsxDEV("div", {
|
|
341
341
|
children: [
|
|
342
342
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
343
|
-
className: "text-xl
|
|
343
|
+
className: "font-semibold text-xl",
|
|
344
344
|
children: "AI Evolution Engine"
|
|
345
345
|
}, undefined, false, undefined, this),
|
|
346
346
|
/* @__PURE__ */ jsxDEV("p", {
|
|
@@ -398,7 +398,7 @@ function EvolutionDashboard({
|
|
|
398
398
|
]
|
|
399
399
|
}, undefined, true, undefined, this),
|
|
400
400
|
/* @__PURE__ */ jsxDEV("p", {
|
|
401
|
-
className: "text-muted-foreground
|
|
401
|
+
className: "mt-2 text-muted-foreground text-xs",
|
|
402
402
|
children: "Simulate sandbox operations, analyze patterns, and generate AI improvement suggestions."
|
|
403
403
|
}, undefined, false, undefined, this)
|
|
404
404
|
]
|
|
@@ -515,7 +515,7 @@ function UsageStatCard({ stat }) {
|
|
|
515
515
|
className: "mb-2 flex items-center justify-between",
|
|
516
516
|
children: [
|
|
517
517
|
/* @__PURE__ */ jsxDEV("span", {
|
|
518
|
-
className: "font-mono text-sm
|
|
518
|
+
className: "font-medium font-mono text-sm",
|
|
519
519
|
children: stat.operation.name
|
|
520
520
|
}, undefined, false, undefined, this),
|
|
521
521
|
/* @__PURE__ */ jsxDEV(Badge, {
|
|
@@ -617,7 +617,7 @@ function AnomalyCard({ anomaly }) {
|
|
|
617
617
|
/* @__PURE__ */ jsxDEV("div", {
|
|
618
618
|
children: [
|
|
619
619
|
/* @__PURE__ */ jsxDEV("p", {
|
|
620
|
-
className: "text-sm
|
|
620
|
+
className: "font-medium text-sm",
|
|
621
621
|
children: anomaly.description
|
|
622
622
|
}, undefined, false, undefined, this),
|
|
623
623
|
/* @__PURE__ */ jsxDEV("p", {
|
|
@@ -687,7 +687,7 @@ function SuggestionCard({
|
|
|
687
687
|
]
|
|
688
688
|
}, undefined, true, undefined, this),
|
|
689
689
|
/* @__PURE__ */ jsxDEV("p", {
|
|
690
|
-
className: "text-muted-foreground
|
|
690
|
+
className: "mt-1 text-muted-foreground text-sm",
|
|
691
691
|
children: suggestion.proposal.rationale
|
|
692
692
|
}, undefined, false, undefined, this)
|
|
693
693
|
]
|
|
@@ -703,7 +703,7 @@ function SuggestionCard({
|
|
|
703
703
|
className: "mt-3",
|
|
704
704
|
children: [
|
|
705
705
|
/* @__PURE__ */ jsxDEV("p", {
|
|
706
|
-
className: "mb-1
|
|
706
|
+
className: "mb-1 font-semibold text-violet-400 text-xs uppercase",
|
|
707
707
|
children: "Recommended Actions"
|
|
708
708
|
}, undefined, false, undefined, this),
|
|
709
709
|
/* @__PURE__ */ jsxDEV("ul", {
|
|
@@ -784,7 +784,7 @@ function HintCard({ hint }) {
|
|
|
784
784
|
children: hint.summary
|
|
785
785
|
}, undefined, false, undefined, this),
|
|
786
786
|
/* @__PURE__ */ jsxDEV("p", {
|
|
787
|
-
className: "text-muted-foreground
|
|
787
|
+
className: "mt-1 text-muted-foreground text-xs",
|
|
788
788
|
children: hint.justification
|
|
789
789
|
}, undefined, false, undefined, this),
|
|
790
790
|
hint.recommendedActions.length > 0 && /* @__PURE__ */ jsxDEV("ul", {
|
package/dist/EvolutionSidebar.js
CHANGED
|
@@ -258,10 +258,10 @@ function generateRecommendedActions(anomaly) {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
// src/EvolutionSidebar.tsx
|
|
261
|
-
import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
262
261
|
import { Button } from "@contractspec/lib.design-system";
|
|
263
|
-
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
264
262
|
import { Badge } from "@contractspec/lib.ui-kit-web/ui/badge";
|
|
263
|
+
import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
264
|
+
import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
265
265
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
266
266
|
"use client";
|
|
267
267
|
function EvolutionSidebar({
|
|
@@ -320,7 +320,7 @@ function EvolutionSidebar({
|
|
|
320
320
|
className: "w-80 overflow-hidden",
|
|
321
321
|
children: [
|
|
322
322
|
/* @__PURE__ */ jsxDEV("div", {
|
|
323
|
-
className: "flex items-center justify-between border-
|
|
323
|
+
className: "flex items-center justify-between border-violet-500/20 border-b bg-violet-500/5 px-3 py-2",
|
|
324
324
|
children: [
|
|
325
325
|
/* @__PURE__ */ jsxDEV("div", {
|
|
326
326
|
className: "flex items-center gap-2",
|
|
@@ -329,7 +329,7 @@ function EvolutionSidebar({
|
|
|
329
329
|
children: "\uD83E\uDD16"
|
|
330
330
|
}, undefined, false, undefined, this),
|
|
331
331
|
/* @__PURE__ */ jsxDEV("span", {
|
|
332
|
-
className: "text-sm
|
|
332
|
+
className: "font-semibold text-sm",
|
|
333
333
|
children: "Evolution"
|
|
334
334
|
}, undefined, false, undefined, this)
|
|
335
335
|
]
|
|
@@ -345,7 +345,7 @@ function EvolutionSidebar({
|
|
|
345
345
|
}, undefined, false, undefined, this),
|
|
346
346
|
/* @__PURE__ */ jsxDEV("button", {
|
|
347
347
|
onClick: onToggle,
|
|
348
|
-
className: "text-muted-foreground hover:text-foreground
|
|
348
|
+
className: "p-1 text-muted-foreground hover:text-foreground",
|
|
349
349
|
type: "button",
|
|
350
350
|
title: "Collapse",
|
|
351
351
|
children: "\u2715"
|
|
@@ -390,14 +390,14 @@ function EvolutionSidebar({
|
|
|
390
390
|
]
|
|
391
391
|
}, undefined, true, undefined, this),
|
|
392
392
|
loading && /* @__PURE__ */ jsxDEV("div", {
|
|
393
|
-
className: "
|
|
393
|
+
className: "py-4 text-center text-muted-foreground text-sm",
|
|
394
394
|
children: "Generating suggestions..."
|
|
395
395
|
}, undefined, false, undefined, this),
|
|
396
396
|
topAnomalies.length > 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
397
397
|
className: "mb-4",
|
|
398
398
|
children: [
|
|
399
399
|
/* @__PURE__ */ jsxDEV("p", {
|
|
400
|
-
className: "mb-2
|
|
400
|
+
className: "mb-2 font-semibold text-violet-400 text-xs uppercase",
|
|
401
401
|
children: "Top Issues"
|
|
402
402
|
}, undefined, false, undefined, this),
|
|
403
403
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -418,7 +418,7 @@ function EvolutionSidebar({
|
|
|
418
418
|
]
|
|
419
419
|
}, undefined, true, undefined, this),
|
|
420
420
|
/* @__PURE__ */ jsxDEV("p", {
|
|
421
|
-
className: "text-muted-foreground
|
|
421
|
+
className: "mt-1 truncate text-muted-foreground",
|
|
422
422
|
children: anomaly.description
|
|
423
423
|
}, undefined, false, undefined, this)
|
|
424
424
|
]
|
|
@@ -429,7 +429,7 @@ function EvolutionSidebar({
|
|
|
429
429
|
pendingSuggestions.length > 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
430
430
|
children: [
|
|
431
431
|
/* @__PURE__ */ jsxDEV("p", {
|
|
432
|
-
className: "mb-2
|
|
432
|
+
className: "mb-2 font-semibold text-violet-400 text-xs uppercase",
|
|
433
433
|
children: "Pending Suggestions"
|
|
434
434
|
}, undefined, false, undefined, this),
|
|
435
435
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -441,7 +441,7 @@ function EvolutionSidebar({
|
|
|
441
441
|
onReject: handleReject
|
|
442
442
|
}, suggestion.id, false, undefined, this)),
|
|
443
443
|
pendingSuggestions.length > 3 && /* @__PURE__ */ jsxDEV("p", {
|
|
444
|
-
className: "text-muted-foreground text-
|
|
444
|
+
className: "text-center text-muted-foreground text-xs",
|
|
445
445
|
children: [
|
|
446
446
|
"+",
|
|
447
447
|
pendingSuggestions.length - 3,
|
|
@@ -453,13 +453,13 @@ function EvolutionSidebar({
|
|
|
453
453
|
]
|
|
454
454
|
}, undefined, true, undefined, this),
|
|
455
455
|
anomalies.length === 0 && pendingSuggestions.length === 0 && !loading && /* @__PURE__ */ jsxDEV("div", {
|
|
456
|
-
className: "
|
|
456
|
+
className: "py-4 text-center text-muted-foreground text-xs",
|
|
457
457
|
children: "No issues detected. Keep coding!"
|
|
458
458
|
}, undefined, false, undefined, this)
|
|
459
459
|
]
|
|
460
460
|
}, undefined, true, undefined, this),
|
|
461
461
|
onOpenEvolution && /* @__PURE__ */ jsxDEV("div", {
|
|
462
|
-
className: "border-
|
|
462
|
+
className: "border-violet-500/20 border-t p-2",
|
|
463
463
|
children: /* @__PURE__ */ jsxDEV(Button, {
|
|
464
464
|
variant: "ghost",
|
|
465
465
|
size: "sm",
|
|
@@ -485,7 +485,7 @@ function CompactSuggestionCard({
|
|
|
485
485
|
className: "min-w-0 flex-1",
|
|
486
486
|
children: [
|
|
487
487
|
/* @__PURE__ */ jsxDEV("p", {
|
|
488
|
-
className: "truncate text-xs
|
|
488
|
+
className: "truncate font-medium text-xs",
|
|
489
489
|
children: suggestion.proposal.summary
|
|
490
490
|
}, undefined, false, undefined, this),
|
|
491
491
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -512,13 +512,13 @@ function CompactSuggestionCard({
|
|
|
512
512
|
children: [
|
|
513
513
|
/* @__PURE__ */ jsxDEV("button", {
|
|
514
514
|
onClick: () => onReject(suggestion.id),
|
|
515
|
-
className: "rounded px-2 py-0.5 text-
|
|
515
|
+
className: "rounded px-2 py-0.5 text-red-400 text-xs hover:bg-red-400/10",
|
|
516
516
|
type: "button",
|
|
517
517
|
children: "Reject"
|
|
518
518
|
}, undefined, false, undefined, this),
|
|
519
519
|
/* @__PURE__ */ jsxDEV("button", {
|
|
520
520
|
onClick: () => onApprove(suggestion.id),
|
|
521
|
-
className: "rounded bg-violet-500/20 px-2 py-0.5 text-
|
|
521
|
+
className: "rounded bg-violet-500/20 px-2 py-0.5 text-violet-400 text-xs hover:bg-violet-500/30",
|
|
522
522
|
type: "button",
|
|
523
523
|
children: "Approve"
|
|
524
524
|
}, undefined, false, undefined, this)
|