@kerfjs/ui 5.0.0-beta.129 → 5.0.0-beta.130

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 (170) hide show
  1. package/ai/component-catalog.json +14 -9
  2. package/ai/component-composition-rules.json +1 -1
  3. package/ai/component-composition.d.ts +17 -0
  4. package/ai/component-composition.json +4 -3
  5. package/ai/component-composition.schema.json +326 -80
  6. package/ai/component-props-overlay.json +8568 -628
  7. package/ai/component-props-overlay.schema.json +15 -1
  8. package/ai/component-props.json +6221 -2069
  9. package/ai/component-props.schema.json +7 -0
  10. package/ai/components/radio-group.md +5 -1
  11. package/ai/components/state-banner.md +1 -1
  12. package/ai/components/surface-scaffold.md +3 -2
  13. package/ai/components/tab-bar.md +1 -1
  14. package/ai/components/toolbar-control-group.md +1 -1
  15. package/ai/public-api-signatures-v1.md +205 -42
  16. package/ai/skill.md +21 -8
  17. package/ai/view-document.schema.json +140 -86
  18. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  19. package/dist/browser/column-explorer.js +5 -1
  20. package/dist/browser/radio-group.js +1 -0
  21. package/dist/catalog-resources.d.ts +2 -2
  22. package/dist/catalog.d.ts +2 -2
  23. package/dist/catalog.js +5 -5
  24. package/dist/{chunk-E2MTHHLS.js → chunk-2FA3SX57.js} +2 -2
  25. package/dist/{chunk-E2MTHHLS.js.map → chunk-2FA3SX57.js.map} +1 -1
  26. package/dist/{chunk-ZC4KSRAF.js → chunk-4CYCJ3NY.js} +6 -4
  27. package/dist/chunk-4CYCJ3NY.js.map +1 -0
  28. package/dist/{chunk-IMXLOMTF.js → chunk-76BLSFEA.js} +30 -12
  29. package/dist/chunk-76BLSFEA.js.map +1 -0
  30. package/dist/{chunk-IR32NI2O.js → chunk-ALBFHXMZ.js} +3 -3
  31. package/dist/chunk-ALBFHXMZ.js.map +1 -0
  32. package/dist/{chunk-3ZWYGGEC.js → chunk-ASU4ODOH.js} +38 -7
  33. package/dist/chunk-ASU4ODOH.js.map +1 -0
  34. package/dist/chunk-BMUYZKXW.js +155 -0
  35. package/dist/chunk-BMUYZKXW.js.map +1 -0
  36. package/dist/{chunk-GQUDCWOD.js → chunk-D2KHQNJ6.js} +49 -23
  37. package/dist/chunk-D2KHQNJ6.js.map +1 -0
  38. package/dist/{chunk-34FWYJX6.js → chunk-ECJHCPBN.js} +8 -2
  39. package/dist/chunk-ECJHCPBN.js.map +1 -0
  40. package/dist/{chunk-DBCDYBZP.js → chunk-HHEBNP6Z.js} +2 -2
  41. package/dist/{chunk-DBCDYBZP.js.map → chunk-HHEBNP6Z.js.map} +1 -1
  42. package/dist/{chunk-3ZKUXWAV.js → chunk-IPYQYLSX.js} +16 -9
  43. package/dist/chunk-IPYQYLSX.js.map +1 -0
  44. package/dist/{chunk-SJEPM5ZU.js → chunk-LETAE6SX.js} +2 -2
  45. package/dist/{chunk-SJEPM5ZU.js.map → chunk-LETAE6SX.js.map} +1 -1
  46. package/dist/chunk-MVWR5WRX.js +99 -0
  47. package/dist/chunk-MVWR5WRX.js.map +1 -0
  48. package/dist/{chunk-6T7AX365.js → chunk-OSL4LQ7T.js} +52 -23
  49. package/dist/chunk-OSL4LQ7T.js.map +1 -0
  50. package/dist/{chunk-OHT2AXER.js → chunk-QSJAIXLM.js} +19 -3
  51. package/dist/chunk-QSJAIXLM.js.map +1 -0
  52. package/dist/{chunk-UQ4FRQ6M.js → chunk-R4JK2C6D.js} +13 -3
  53. package/dist/chunk-R4JK2C6D.js.map +1 -0
  54. package/dist/{chunk-5A2DN3LR.js → chunk-SGYBIKQA.js} +3 -1
  55. package/dist/chunk-SGYBIKQA.js.map +1 -0
  56. package/dist/{chunk-K3C35KGR.js → chunk-XO5IOPM5.js} +2 -2
  57. package/dist/{chunk-K3C35KGR.js.map → chunk-XO5IOPM5.js.map} +1 -1
  58. package/dist/collapsible-panel.d.ts +2 -2
  59. package/dist/collapsible-panel.js +2 -2
  60. package/dist/column-explorer.d.ts +5 -1
  61. package/dist/column-explorer.js +5 -1
  62. package/dist/column-track.d.ts +3 -1
  63. package/dist/column-track.js +1 -1
  64. package/dist/editor.d.ts +87 -2
  65. package/dist/editor.js +2249 -1320
  66. package/dist/editor.js.map +1 -1
  67. package/dist/index.js +12 -12
  68. package/dist/list-detail-dialog.d.ts +2 -2
  69. package/dist/list-detail-dialog.js +4 -4
  70. package/dist/list-header.d.ts +47 -5
  71. package/dist/list-header.js +1 -1
  72. package/dist/message-composer.js +1 -1
  73. package/dist/{nav-stack-vQ3ieerq.d.ts → nav-stack-DKrvqFjA.d.ts} +1 -1
  74. package/dist/nav-stack.d.ts +2 -2
  75. package/dist/nav-stack.js +1 -1
  76. package/dist/{panel-toolbar-vg6Ir5Dy.d.ts → panel-toolbar-CEcHHDkn.d.ts} +8 -0
  77. package/dist/radio-group.d.ts +19 -2
  78. package/dist/radio-group.js +3 -1
  79. package/dist/split-view.d.ts +2 -2
  80. package/dist/split-view.js +1 -1
  81. package/dist/styles/column-track.css +7 -2
  82. package/dist/styles/components/actions/toolbar-control-group/toolbar-control-group.css +11 -4
  83. package/dist/styles/components/collections/list-header/list-header.css +50 -0
  84. package/dist/styles/components/collections/list-item/list-item.css +6 -1
  85. package/dist/styles/components/collections/tree-list/tree-list.css +3 -2
  86. package/dist/styles/components/forms/radio-group/radio-group.css +107 -0
  87. package/dist/styles/components/layout/column-track/column-track.css +7 -2
  88. package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +30 -1
  89. package/dist/styles/editor/editor.css +0 -23
  90. package/dist/styles/list-header.css +50 -0
  91. package/dist/styles/list-item.css +6 -1
  92. package/dist/styles/radio-group.css +107 -0
  93. package/dist/styles/surface-scaffold.css +30 -1
  94. package/dist/styles/toolbar-control-group.css +11 -4
  95. package/dist/styles/tree-list.css +3 -2
  96. package/dist/surface-scaffold-register.js +1 -1
  97. package/dist/surface-scaffold.d.ts +46 -11
  98. package/dist/surface-scaffold.js +2 -2
  99. package/dist/toolbar-control-group.d.ts +10 -1
  100. package/dist/toolbar-control-group.js +1 -1
  101. package/dist/tree-list.d.ts +7 -1
  102. package/dist/tree-list.js +1 -1
  103. package/dist/view-runtime.d.ts +9 -0
  104. package/dist/view-runtime.js +8 -0
  105. package/dist/view-runtime.js.map +1 -0
  106. package/dist/wire-catalog.d.ts +2 -2
  107. package/dist/wire-catalog.js +1 -1
  108. package/dist/wire-search-fields.js +1 -1
  109. package/dist/wire-tab-bars.d.ts +10 -0
  110. package/dist/wire-tab-bars.js +1 -1
  111. package/dist/wire-tag-fields.js +1 -1
  112. package/dist/wire-workbench.d.ts +17 -1
  113. package/dist/wire-workbench.js +1 -1
  114. package/dist/workbench-dialog.d.ts +2 -2
  115. package/dist/workbench-dialog.js +4 -4
  116. package/dist/workbench.d.ts +10 -2
  117. package/dist/workbench.js +1 -1
  118. package/docs/accessibility.md +1 -1
  119. package/docs/column-explorer.md +4 -0
  120. package/docs/component-contract.md +10 -4
  121. package/docs/component-integration.md +7 -3
  122. package/docs/component-selection.md +2 -1
  123. package/docs/design/sketch/Kerf-UI.sketch +0 -0
  124. package/docs/design/sketch/coverage.md +7 -6
  125. package/docs/design/sketch/forms/README.md +5 -4
  126. package/docs/design/sketch/unified/pages/forms.png +0 -0
  127. package/docs/design/templates/radio-group/tiles-dark.svg +1 -0
  128. package/docs/design/templates/radio-group/tiles.svg +1 -0
  129. package/docs/design/templates/radio-group-dark.svg +1 -1
  130. package/docs/design/templates/radio-group.svg +1 -1
  131. package/docs/editor-host.md +90 -5
  132. package/docs/interaction-conventions.md +2 -0
  133. package/docs/layout.md +1 -1
  134. package/docs/surface-scaffold.md +49 -2
  135. package/docs/tree-list.md +10 -0
  136. package/docs/workbench.md +16 -0
  137. package/evaluator/firefox-app-data.d.mts +4 -0
  138. package/evaluator/firefox-app-data.mjs +35 -0
  139. package/evaluator/index.mjs +19 -5
  140. package/llms.txt +20 -4
  141. package/package.json +8 -1
  142. package/props/component-props.d.mts +3 -0
  143. package/view/cli.mjs +36 -5
  144. package/view/contract.mjs +3 -0
  145. package/view/generate.mjs +8 -7
  146. package/view/index.d.mts +14 -0
  147. package/view/project-types-worker.mjs +55 -0
  148. package/view/project-types.d.mts +43 -0
  149. package/view/project-types.mjs +618 -0
  150. package/view/type-expression.d.mts +15 -0
  151. package/view/type-expression.mjs +162 -0
  152. package/view/types.mjs +4 -0
  153. package/view/validate.mjs +20 -1
  154. package/vite-editor.d.mts +31 -3
  155. package/vite-editor.mjs +168 -4
  156. package/dist/chunk-34FWYJX6.js.map +0 -1
  157. package/dist/chunk-3ZKUXWAV.js.map +0 -1
  158. package/dist/chunk-3ZWYGGEC.js.map +0 -1
  159. package/dist/chunk-5A2DN3LR.js.map +0 -1
  160. package/dist/chunk-6T7AX365.js.map +0 -1
  161. package/dist/chunk-BMOZSNDU.js +0 -133
  162. package/dist/chunk-BMOZSNDU.js.map +0 -1
  163. package/dist/chunk-GQUDCWOD.js.map +0 -1
  164. package/dist/chunk-IMXLOMTF.js.map +0 -1
  165. package/dist/chunk-IR32NI2O.js.map +0 -1
  166. package/dist/chunk-MLDO7WLA.js +0 -82
  167. package/dist/chunk-MLDO7WLA.js.map +0 -1
  168. package/dist/chunk-OHT2AXER.js.map +0 -1
  169. package/dist/chunk-UQ4FRQ6M.js.map +0 -1
  170. package/dist/chunk-ZC4KSRAF.js.map +0 -1
@@ -1,4 +1,8 @@
1
- export { ColumnExplorer, explorerChosen, explorerColumns } from './chunk-BMOZSNDU.js';
1
+ export { ColumnExplorer, explorerChosen, explorerColumns } from './chunk-BMUYZKXW.js';
2
+
3
+
4
+
5
+
2
6
 
3
7
 
4
8
 
@@ -19,6 +19,8 @@ interface ColumnTrackProps {
19
19
  * in, and scrolling snaps to column starts.
20
20
  */
21
21
  layout?: ColumnTrackLayout;
22
+ /** Inline edge clearance: default uses the layout margin; none clips columns at the track edges. */
23
+ inset?: 'default' | 'none';
22
24
  /** Narrowest a `scroll` column gets before the track scrolls; default 250px. */
23
25
  minColumnWidth?: CssLength;
24
26
  /** How much of the next column a `paged` track shows; default 24px. */
@@ -45,6 +47,6 @@ interface ColumnTrackProps {
45
47
  * insets and vertical scrolling. Kerf owns the overflow, the paged snapping,
46
48
  * and reduced motion.
47
49
  */
48
- declare function ColumnTrack({ children, layout, minColumnWidth, peek, ariaLabel, id, className, rootAttributes, slot, }: ColumnTrackProps): kerfjs.SafeHtml;
50
+ declare function ColumnTrack({ children, layout, inset, minColumnWidth, peek, ariaLabel, id, className, rootAttributes, slot, }: ColumnTrackProps): kerfjs.SafeHtml;
49
51
 
50
52
  export { ColumnTrack, type ColumnTrackLayout, type ColumnTrackProps };
@@ -1,4 +1,4 @@
1
- export { ColumnTrack } from './chunk-34FWYJX6.js';
1
+ export { ColumnTrack } from './chunk-ECJHCPBN.js';
2
2
 
3
3
 
4
4
  //# sourceMappingURL=column-track.js.map
package/dist/editor.d.ts CHANGED
@@ -1,9 +1,48 @@
1
1
  import * as kerfjs from 'kerfjs';
2
2
  import { SafeHtml } from 'kerfjs';
3
- import { ViewCatalog, ViewValue, ViewType, ViewDocument } from '@kerfjs/ui/view';
3
+ import { ViewType, ViewDocument, ViewCatalog, ViewValue } from '@kerfjs/ui/view';
4
+ import { IconNode } from 'lucide';
5
+
6
+ interface TypeSuggestion {
7
+ readonly name: string;
8
+ readonly source?: string;
9
+ readonly text: string;
10
+ readonly cursor: number;
11
+ }
12
+ interface TypeExpressionResult {
13
+ readonly type?: ViewType;
14
+ readonly suggestions?: readonly TypeSuggestion[];
15
+ readonly diagnostics: readonly {
16
+ readonly message: string;
17
+ readonly start?: number;
18
+ readonly length?: number;
19
+ }[];
20
+ }
21
+ type ProjectTypeRequest = {
22
+ readonly action: 'analyze';
23
+ readonly source: string;
24
+ readonly text: string;
25
+ readonly cursor?: number;
26
+ /** False skips completion suggestions, the costliest analysis step. */
27
+ readonly suggest?: boolean;
28
+ readonly declared?: ViewType;
29
+ } | {
30
+ readonly action: 'validate';
31
+ readonly source: string;
32
+ readonly document: ViewDocument;
33
+ };
34
+ interface ProjectTypeResult extends TypeExpressionResult {
35
+ readonly document?: ViewDocument;
36
+ }
37
+ /** A host-provided project compiler, normally the editor dev-server endpoint. */
38
+ type ProjectTypeService = (request: ProjectTypeRequest) => Promise<ProjectTypeResult>;
39
+ /** The default dev-server transport; custom editor hosts can supply their own. */
40
+ declare function devServerTypeService(api?: string): ProjectTypeService;
4
41
 
5
42
  /** Reads and writes documents by project-relative path. */
6
43
  interface EditorStorage {
44
+ /** Optional project TypeScript compiler for parameter expressions. */
45
+ readonly types?: ProjectTypeService;
7
46
  /** The document's text, or undefined when there is none at `path`. */
8
47
  read(path: string): Promise<string | undefined>;
9
48
  write(path: string, text: string): Promise<void>;
@@ -21,8 +60,44 @@ declare const EDITOR_LIST_API = "/__kerf-ui-editor/api/files";
21
60
  /** Storage over the dev server that hosts the editor. */
22
61
  declare function devServerStorage(api?: string, listApi?: string): EditorStorage;
23
62
 
63
+ /** Literal Library sample data; view bindings and expressions are not evaluated. */
64
+ type CatalogLibraryPreviewJson =
65
+ | null
66
+ | string
67
+ | number
68
+ | boolean
69
+ | readonly CatalogLibraryPreviewJson[]
70
+ | { readonly [key: string]: CatalogLibraryPreviewJson };
71
+ interface CatalogLibraryPreview {
72
+ readonly props?: Readonly<Record<string, CatalogLibraryPreviewJson>>;
73
+ }
74
+
75
+ type ComponentFunctions = Readonly<Record<string, (props: never) => SafeHtml>>;
76
+ interface LibraryPreviewContext<Props> {
77
+ readonly key: string;
78
+ readonly name: string;
79
+ readonly props: Readonly<Props>;
80
+ }
81
+ interface LibraryPreview<Props = unknown> {
82
+ sampleProps?(): Partial<Props>;
83
+ render?(context: LibraryPreviewContext<Props>): SafeHtml | undefined;
84
+ readonly icon?: IconNode;
85
+ readonly fit?: 'contain' | 'fill';
86
+ }
87
+ type LibraryPreviews = Readonly<Record<string, LibraryPreview>>;
88
+ type LibraryPreviewsFor<C extends ComponentFunctions> = {
89
+ readonly [K in keyof C]?: LibraryPreview<Parameters<C[K]>[0]>;
90
+ };
91
+ declare function defineLibraryPreviews<const C extends ComponentFunctions>(components: C, previews: LibraryPreviewsFor<NoInfer<C>>): LibraryPreviewsFor<C>;
92
+ /** Literal JSON samples; no document bindings or executable values are evaluated. */
93
+ type LibraryPreviewJson = CatalogLibraryPreviewJson;
94
+ type SerializableLibraryPreview = CatalogLibraryPreview;
95
+ type SerializableLibraryPreviews = Readonly<Record<string, SerializableLibraryPreview>>;
96
+
24
97
  interface InspectorProp {
25
98
  readonly name: string;
99
+ /** The task-facing name the Inspector shows (KF-HP1J4Z: Button text). */
100
+ readonly label?: string;
26
101
  readonly type: {
27
102
  readonly kind: string;
28
103
  readonly text?: string;
@@ -30,6 +105,8 @@ interface InspectorProp {
30
105
  readonly required: boolean;
31
106
  readonly default?: string | number | boolean;
32
107
  readonly group?: string;
108
+ /** A component-specific task inside its group (KF-4BPSTB: Link, Popup). */
109
+ readonly subgroup?: string;
33
110
  readonly order?: number;
34
111
  readonly control?: string;
35
112
  readonly zone?: string;
@@ -101,6 +178,8 @@ interface EditorCatalog {
101
178
  * (KF-H3CB2P): Kerf UI's, then the host's.
102
179
  */
103
180
  readonly placeholders: Placeholders;
181
+ /** Library-only previews; no effect on component insertion or the canvas. */
182
+ readonly libraryPreviews?: LibraryPreviews;
104
183
  }
105
184
  interface EditorCatalogInputs {
106
185
  /** `component-props.json` catalogs: Kerf UI's and any package's. */
@@ -116,6 +195,8 @@ interface EditorCatalogInputs {
116
195
  * fresh value. They add to and replace Kerf UI's own.
117
196
  */
118
197
  readonly placeholders?: Placeholders;
198
+ /** Later whole entries replace catalog samples and first-party previews. */
199
+ readonly libraryPreviews?: LibraryPreviews;
119
200
  }
120
201
  declare function createEditorCatalog(inputs: EditorCatalogInputs): EditorCatalog;
121
202
  /**
@@ -321,11 +402,15 @@ interface EditorOptions {
321
402
  * the last document; `devServerStorage()` uses the host's dev server.
322
403
  */
323
404
  readonly storage?: EditorStorage;
405
+ /** Owning-project TypeScript service; devServerStorage provides the default. */
406
+ readonly typeService?: ProjectTypeService;
324
407
  /**
325
408
  * The components the editor can place and preview: Kerf UI's catalogs and
326
409
  * functions, plus an application's (`createEditorCatalog`).
327
410
  */
328
411
  readonly catalog: EditorCatalog;
412
+ /** Library-only previews; complete entries override the catalog registrations. */
413
+ readonly libraryPreviews?: LibraryPreviews;
329
414
  /**
330
415
  * Editors for named types (KF-EXA2WH: field editor API), such as a
331
416
  * catalog's `'ListConfig'` or an application's `'InvoiceFilter'`: each
@@ -359,4 +444,4 @@ declare function createEditor(options: EditorOptions): {
359
444
  loadError: kerfjs.Signal<string | null>;
360
445
  };
361
446
 
362
- export { type ActionLogEntry, type ActionOutcome, type CatalogEntry, type ComponentFunction, type DeviceFrame, type DeviceInsets, type DeviceKind, type DevicePreset, type DevicePresetsOption, EDITOR_FILE_API, EDITOR_LIST_API, type EditorCatalog, type EditorCatalogInputs, type EditorOptions, type EditorStorage, type FieldEditor, type FieldEditorAttributes, type FieldEditorContext, type FieldEditorControlKind, type FieldEditors, type PaletteGroup, type PlayActionContext, type PlayHandler, type PlayHandlers, type PlayNavStack, type PlayView, type PropsComponent, SHIPPED_DEVICE_PRESETS, type Selection, WORKBENCH_ID, componentMap, createEditor, createEditorCatalog, devServerStorage, emptyDocument };
447
+ export { type ActionLogEntry, type ActionOutcome, type CatalogEntry, type ComponentFunction, type DeviceFrame, type DeviceInsets, type DeviceKind, type DevicePreset, type DevicePresetsOption, EDITOR_FILE_API, EDITOR_LIST_API, type EditorCatalog, type EditorCatalogInputs, type EditorOptions, type EditorStorage, type FieldEditor, type FieldEditorAttributes, type FieldEditorContext, type FieldEditorControlKind, type FieldEditors, type LibraryPreview, type LibraryPreviewContext, type LibraryPreviewJson, type LibraryPreviews, type LibraryPreviewsFor, type PaletteGroup, type PlayActionContext, type PlayHandler, type PlayHandlers, type PlayNavStack, type PlayView, type ProjectTypeRequest, type ProjectTypeResult, type ProjectTypeService, type PropsComponent, SHIPPED_DEVICE_PRESETS, type Selection, type SerializableLibraryPreview, type SerializableLibraryPreviews, type TypeSuggestion, WORKBENCH_ID, componentMap, createEditor, createEditorCatalog, defineLibraryPreviews, devServerStorage, devServerTypeService, emptyDocument };