@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.
Files changed (82) hide show
  1. package/.turbo/turbo-build.log +90 -84
  2. package/AGENTS.md +43 -25
  3. package/CHANGELOG.md +11 -0
  4. package/README.md +63 -35
  5. package/dist/EvolutionDashboard.js +9 -9
  6. package/dist/EvolutionSidebar.js +15 -15
  7. package/dist/LocalDataIndicator.js +3 -3
  8. package/dist/MarkdownView.d.ts +0 -7
  9. package/dist/MarkdownView.js +76 -172
  10. package/dist/PersonalizationInsights.js +12 -12
  11. package/dist/SaveToStudioButton.js +2 -2
  12. package/dist/SpecDrivenTemplateShell.d.ts +1 -1
  13. package/dist/SpecDrivenTemplateShell.js +10 -10
  14. package/dist/SpecEditorPanel.js +3 -3
  15. package/dist/TemplateShell.js +10 -10
  16. package/dist/browser/EvolutionDashboard.js +9 -9
  17. package/dist/browser/EvolutionSidebar.js +15 -15
  18. package/dist/browser/LocalDataIndicator.js +3 -3
  19. package/dist/browser/MarkdownView.js +76 -172
  20. package/dist/browser/PersonalizationInsights.js +12 -12
  21. package/dist/browser/SaveToStudioButton.js +2 -2
  22. package/dist/browser/SpecDrivenTemplateShell.js +10 -10
  23. package/dist/browser/SpecEditorPanel.js +3 -3
  24. package/dist/browser/TemplateShell.js +10 -10
  25. package/dist/browser/hooks/index.js +29 -29
  26. package/dist/browser/index.js +193 -286
  27. package/dist/browser/lib/component-registry.js +1 -1
  28. package/dist/browser/markdown/formatPresentationName.js +9 -0
  29. package/dist/browser/markdown/useMarkdownPresentation.js +65 -0
  30. package/dist/hooks/index.d.ts +3 -3
  31. package/dist/hooks/index.js +29 -29
  32. package/dist/index.d.ts +12 -11
  33. package/dist/index.js +193 -286
  34. package/dist/lib/component-registry.js +1 -1
  35. package/dist/markdown/formatPresentationName.d.ts +1 -0
  36. package/dist/markdown/formatPresentationName.js +10 -0
  37. package/dist/markdown/useMarkdownPresentation.d.ts +21 -0
  38. package/dist/markdown/useMarkdownPresentation.js +66 -0
  39. package/dist/node/EvolutionDashboard.js +9 -9
  40. package/dist/node/EvolutionSidebar.js +15 -15
  41. package/dist/node/LocalDataIndicator.js +3 -3
  42. package/dist/node/MarkdownView.js +76 -172
  43. package/dist/node/PersonalizationInsights.js +12 -12
  44. package/dist/node/SaveToStudioButton.js +2 -2
  45. package/dist/node/SpecDrivenTemplateShell.js +10 -10
  46. package/dist/node/SpecEditorPanel.js +3 -3
  47. package/dist/node/TemplateShell.js +10 -10
  48. package/dist/node/hooks/index.js +29 -29
  49. package/dist/node/index.js +193 -286
  50. package/dist/node/lib/component-registry.js +1 -1
  51. package/dist/node/markdown/formatPresentationName.js +9 -0
  52. package/dist/node/markdown/useMarkdownPresentation.js +65 -0
  53. package/dist/utils/index.d.ts +1 -1
  54. package/package.json +40 -13
  55. package/src/EvolutionDashboard.tsx +415 -415
  56. package/src/EvolutionSidebar.tsx +245 -245
  57. package/src/LocalDataIndicator.tsx +28 -28
  58. package/src/MarkdownView.tsx +119 -372
  59. package/src/OverlayContextProvider.tsx +272 -272
  60. package/src/PersonalizationInsights.tsx +232 -232
  61. package/src/SaveToStudioButton.tsx +51 -51
  62. package/src/SpecDrivenTemplateShell.tsx +59 -59
  63. package/src/SpecEditorPanel.tsx +138 -138
  64. package/src/TemplateShell.tsx +50 -50
  65. package/src/bundles/ExampleTemplateBundle.ts +78 -78
  66. package/src/hooks/index.ts +3 -3
  67. package/src/hooks/useBehaviorTracking.ts +252 -252
  68. package/src/hooks/useEvolution.ts +437 -437
  69. package/src/hooks/useRegistryTemplates.ts +42 -42
  70. package/src/hooks/useSpecContent.ts +214 -214
  71. package/src/hooks/useWorkflowComposer.ts +567 -567
  72. package/src/index.ts +12 -11
  73. package/src/lib/component-registry.tsx +40 -40
  74. package/src/lib/runtime-context.tsx +31 -31
  75. package/src/lib/types.ts +57 -57
  76. package/src/markdown/formatPresentationName.ts +9 -0
  77. package/src/markdown/useMarkdownPresentation.ts +107 -0
  78. package/src/overlay-types.ts +15 -15
  79. package/src/utils/fetchPresentationData.ts +13 -13
  80. package/src/utils/generateSpecFromTemplate.ts +29 -29
  81. package/src/utils/index.ts +1 -1
  82. package/tsconfig.json +8 -8
@@ -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=26 noBundle=false
6
- Bundled 26 modules in 68ms
5
+ [contractspec-bun-build] transpile target=bun root=src entries=28 noBundle=false
6
+ Bundled 28 modules in 63ms
7
7
 
8
- ./EvolutionDashboard.js 31.40 KB (entry point)
9
- ./index.js 123.75 KB (entry point)
10
- utils/index.js 10.1 KB (entry point)
11
- lib/component-registry.js 1.23 KB (entry point)
12
- lib/types.js 8 bytes (entry point)
13
- ./overlay-types.js 8 bytes (entry point)
14
- utils/fetchPresentationData.js 461 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 11.40 KB (entry point)
27
- ./OverlayContextProvider.js 5.89 KB (entry point)
28
- ./PersonalizationInsights.js 17.74 KB (entry point)
29
- hooks/useBehaviorTracking.js 5.53 KB (entry point)
30
- ./SpecDrivenTemplateShell.js 6.90 KB (entry point)
31
- ./LocalDataIndicator.js 2.20 KB (entry point)
32
- ./SaveToStudioButton.js 2.33 KB (entry point)
33
- lib/runtime-context.js 430 bytes (entry point)
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=26 noBundle=false
36
- Bundled 26 modules in 60ms
37
+ [contractspec-bun-build] transpile target=node root=src entries=28 noBundle=false
38
+ Bundled 28 modules in 54ms
37
39
 
38
- ./EvolutionDashboard.js 31.38 KB (entry point)
39
- ./index.js 123.69 KB (entry point)
40
- utils/index.js 10.1 KB (entry point)
41
- lib/component-registry.js 1.22 KB (entry point)
42
- lib/types.js 0 KB (entry point)
43
- ./overlay-types.js 0 KB (entry point)
44
- utils/fetchPresentationData.js 453 bytes (entry point)
45
- ./SpecEditorPanel.js 19.63 KB (entry point)
46
- ./TemplateShell.js 6.83 KB (entry point)
47
- bundles/index.js 2.43 KB (entry point)
48
- bundles/ExampleTemplateBundle.js 2.43 KB (entry point)
49
- hooks/index.js 44.1 KB (entry point)
50
- hooks/useWorkflowComposer.js 13.67 KB (entry point)
51
- hooks/useSpecContent.js 14.29 KB (entry point)
52
- utils/generateSpecFromTemplate.js 9.64 KB (entry point)
53
- hooks/useRegistryTemplates.js 0.93 KB (entry point)
54
- ./EvolutionSidebar.js 21.23 KB (entry point)
55
- hooks/useEvolution.js 9.50 KB (entry point)
56
- ./MarkdownView.js 11.40 KB (entry point)
57
- ./OverlayContextProvider.js 5.88 KB (entry point)
58
- ./PersonalizationInsights.js 17.71 KB (entry point)
59
- hooks/useBehaviorTracking.js 5.52 KB (entry point)
60
- ./SpecDrivenTemplateShell.js 6.88 KB (entry point)
61
- ./LocalDataIndicator.js 2.19 KB (entry point)
62
- ./SaveToStudioButton.js 2.32 KB (entry point)
63
- lib/runtime-context.js 422 bytes (entry point)
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=26 noBundle=false
66
- Bundled 26 modules in 71ms
69
+ [contractspec-bun-build] transpile target=browser root=src entries=28 noBundle=false
70
+ Bundled 28 modules in 49ms
67
71
 
68
- ./EvolutionDashboard.js 31.38 KB (entry point)
69
- ./index.js 123.69 KB (entry point)
70
- utils/index.js 10.1 KB (entry point)
71
- lib/component-registry.js 1.22 KB (entry point)
72
- lib/types.js 0 KB (entry point)
73
- ./overlay-types.js 0 KB (entry point)
74
- utils/fetchPresentationData.js 453 bytes (entry point)
75
- ./SpecEditorPanel.js 19.63 KB (entry point)
76
- ./TemplateShell.js 6.83 KB (entry point)
77
- bundles/index.js 2.43 KB (entry point)
78
- bundles/ExampleTemplateBundle.js 2.43 KB (entry point)
79
- hooks/index.js 44.1 KB (entry point)
80
- hooks/useWorkflowComposer.js 13.67 KB (entry point)
81
- hooks/useSpecContent.js 14.29 KB (entry point)
82
- utils/generateSpecFromTemplate.js 9.64 KB (entry point)
83
- hooks/useRegistryTemplates.js 0.93 KB (entry point)
84
- ./EvolutionSidebar.js 21.23 KB (entry point)
85
- hooks/useEvolution.js 9.50 KB (entry point)
86
- ./MarkdownView.js 11.40 KB (entry point)
87
- ./OverlayContextProvider.js 5.88 KB (entry point)
88
- ./PersonalizationInsights.js 17.71 KB (entry point)
89
- hooks/useBehaviorTracking.js 5.52 KB (entry point)
90
- ./SpecDrivenTemplateShell.js 6.88 KB (entry point)
91
- ./LocalDataIndicator.js 2.19 KB (entry point)
92
- ./SaveToStudioButton.js 2.32 KB (entry point)
93
- lib/runtime-context.js 422 bytes (entry point)
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
- - **Layer**: lib
10
- - **Consumers**: example apps
11
-
12
- ## Public Exports
13
-
14
- | Subpath | Description |
15
- | ---------------------------- | ------------------------------ |
16
- | `.` | Main entry |
17
- | `./EvolutionDashboard` | Evolution dashboard component |
18
- | `./EvolutionSidebar` | Evolution sidebar component |
19
- | `./hooks/*` | Shared React hooks |
20
- | `./lib/*` | Shared utilities |
21
- | `./LocalDataIndicator` | Local data status indicator |
22
- | `./MarkdownView` | Markdown renderer |
23
- | `./OverlayContextProvider` | Overlay context provider |
24
- | `./PersonalizationInsights` | Personalization panel |
25
- | `./SaveToStudioButton` | Studio save button |
26
- | `./SpecEditorPanel` | Spec editor panel |
27
- | `./TemplateShell` | Shared layout for all examples |
28
- | `./utils/*` | Utility functions |
29
- | `./overlay-types` | Overlay type definitions |
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
- - Build: `bun run build`
39
- - Test: `bun test`
40
- - Lint: `bun run lint`
41
- - Dev: `bun run dev`
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,16 @@
1
1
  # @contractspec/lib.example-shared-ui
2
2
 
3
+ ## 6.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: release manifest
8
+ - Updated dependencies
9
+ - @contractspec/lib.surface-runtime@0.5.6
10
+ - @contractspec/lib.contracts-spec@3.7.6
11
+ - @contractspec/lib.design-system@3.7.6
12
+ - @contractspec/lib.ui-kit-web@3.7.6
13
+
3
14
  ## 6.0.5
4
15
 
5
16
  ### Patch Changes
package/README.md CHANGED
@@ -1,45 +1,73 @@
1
1
  # @contractspec/lib.example-shared-ui
2
2
 
3
- Website: https://contractspec.io/
3
+ **Shared React components and hooks for ContractSpec example apps. Provides the common layout, editors, and overlays used across all examples.**
4
4
 
5
- **Shared React components and hooks for ContractSpec example apps.**
5
+ ## What It Provides
6
6
 
7
- Provides reusable UI shells, editors, dashboards, and context utilities used across ContractSpec example applications. Built on the ContractSpec design system.
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
- ```bash
12
- bun add @contractspec/lib.example-shared-ui
13
- ```
14
-
15
- ## Exports
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
- ```tsx
35
- import { TemplateShell } from "@contractspec/lib.example-shared-ui/TemplateShell";
36
- import { SpecEditorPanel } from "@contractspec/lib.example-shared-ui/SpecEditorPanel";
37
-
38
- export function App() {
39
- return (
40
- <TemplateShell title="My Example">
41
- <SpecEditorPanel specId="user-registration" />
42
- </TemplateShell>
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 font-semibold",
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 mt-2 text-xs",
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 font-medium",
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 font-medium",
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 mt-1 text-sm",
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 text-xs font-semibold text-violet-400 uppercase",
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 mt-1 text-xs",
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", {
@@ -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-b border-violet-500/20 bg-violet-500/5 px-3 py-2",
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 font-semibold",
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 p-1",
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: "text-muted-foreground py-4 text-center text-sm",
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 text-xs font-semibold text-violet-400 uppercase",
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 mt-1 truncate",
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 text-xs font-semibold text-violet-400 uppercase",
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-center text-xs",
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: "text-muted-foreground py-4 text-center text-xs",
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-t border-violet-500/20 p-2",
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 font-medium",
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-xs text-red-400 hover:bg-red-400/10",
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-xs text-violet-400 hover:bg-violet-500/30",
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)
@@ -28,7 +28,7 @@ function LocalDataIndicator() {
28
28
  }
29
29
  };
30
30
  return /* @__PURE__ */ jsxDEV("div", {
31
- className: "border-border bg-muted/40 text-muted-foreground inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs",
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 font-semibold",
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: "border-border text-muted-foreground hover:text-foreground inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-semibold",
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: [
@@ -10,10 +10,3 @@ export interface MarkdownViewProps {
10
10
  * It allows switching between available presentations for the template.
11
11
  */
12
12
  export declare function MarkdownView({ templateId: propTemplateId, presentationId, className, }: MarkdownViewProps): import("react/jsx-runtime").JSX.Element;
13
- /**
14
- * Simple markdown renderer using pre-formatted display
15
- * For production, consider using react-markdown or similar
16
- */
17
- export declare function MarkdownRenderer({ content }: {
18
- content: string;
19
- }): import("react/jsx-runtime").JSX.Element;