@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.
- package/ai/component-catalog.json +14 -9
- package/ai/component-composition-rules.json +1 -1
- package/ai/component-composition.d.ts +17 -0
- package/ai/component-composition.json +4 -3
- package/ai/component-composition.schema.json +326 -80
- package/ai/component-props-overlay.json +8568 -628
- package/ai/component-props-overlay.schema.json +15 -1
- package/ai/component-props.json +6221 -2069
- package/ai/component-props.schema.json +7 -0
- package/ai/components/radio-group.md +5 -1
- package/ai/components/state-banner.md +1 -1
- package/ai/components/surface-scaffold.md +3 -2
- package/ai/components/tab-bar.md +1 -1
- package/ai/components/toolbar-control-group.md +1 -1
- package/ai/public-api-signatures-v1.md +205 -42
- package/ai/skill.md +21 -8
- package/ai/view-document.schema.json +140 -86
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/browser/column-explorer.js +5 -1
- package/dist/browser/radio-group.js +1 -0
- package/dist/catalog-resources.d.ts +2 -2
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.js +5 -5
- package/dist/{chunk-E2MTHHLS.js → chunk-2FA3SX57.js} +2 -2
- package/dist/{chunk-E2MTHHLS.js.map → chunk-2FA3SX57.js.map} +1 -1
- package/dist/{chunk-ZC4KSRAF.js → chunk-4CYCJ3NY.js} +6 -4
- package/dist/chunk-4CYCJ3NY.js.map +1 -0
- package/dist/{chunk-IMXLOMTF.js → chunk-76BLSFEA.js} +30 -12
- package/dist/chunk-76BLSFEA.js.map +1 -0
- package/dist/{chunk-IR32NI2O.js → chunk-ALBFHXMZ.js} +3 -3
- package/dist/chunk-ALBFHXMZ.js.map +1 -0
- package/dist/{chunk-3ZWYGGEC.js → chunk-ASU4ODOH.js} +38 -7
- package/dist/chunk-ASU4ODOH.js.map +1 -0
- package/dist/chunk-BMUYZKXW.js +155 -0
- package/dist/chunk-BMUYZKXW.js.map +1 -0
- package/dist/{chunk-GQUDCWOD.js → chunk-D2KHQNJ6.js} +49 -23
- package/dist/chunk-D2KHQNJ6.js.map +1 -0
- package/dist/{chunk-34FWYJX6.js → chunk-ECJHCPBN.js} +8 -2
- package/dist/chunk-ECJHCPBN.js.map +1 -0
- package/dist/{chunk-DBCDYBZP.js → chunk-HHEBNP6Z.js} +2 -2
- package/dist/{chunk-DBCDYBZP.js.map → chunk-HHEBNP6Z.js.map} +1 -1
- package/dist/{chunk-3ZKUXWAV.js → chunk-IPYQYLSX.js} +16 -9
- package/dist/chunk-IPYQYLSX.js.map +1 -0
- package/dist/{chunk-SJEPM5ZU.js → chunk-LETAE6SX.js} +2 -2
- package/dist/{chunk-SJEPM5ZU.js.map → chunk-LETAE6SX.js.map} +1 -1
- package/dist/chunk-MVWR5WRX.js +99 -0
- package/dist/chunk-MVWR5WRX.js.map +1 -0
- package/dist/{chunk-6T7AX365.js → chunk-OSL4LQ7T.js} +52 -23
- package/dist/chunk-OSL4LQ7T.js.map +1 -0
- package/dist/{chunk-OHT2AXER.js → chunk-QSJAIXLM.js} +19 -3
- package/dist/chunk-QSJAIXLM.js.map +1 -0
- package/dist/{chunk-UQ4FRQ6M.js → chunk-R4JK2C6D.js} +13 -3
- package/dist/chunk-R4JK2C6D.js.map +1 -0
- package/dist/{chunk-5A2DN3LR.js → chunk-SGYBIKQA.js} +3 -1
- package/dist/chunk-SGYBIKQA.js.map +1 -0
- package/dist/{chunk-K3C35KGR.js → chunk-XO5IOPM5.js} +2 -2
- package/dist/{chunk-K3C35KGR.js.map → chunk-XO5IOPM5.js.map} +1 -1
- package/dist/collapsible-panel.d.ts +2 -2
- package/dist/collapsible-panel.js +2 -2
- package/dist/column-explorer.d.ts +5 -1
- package/dist/column-explorer.js +5 -1
- package/dist/column-track.d.ts +3 -1
- package/dist/column-track.js +1 -1
- package/dist/editor.d.ts +87 -2
- package/dist/editor.js +2249 -1320
- package/dist/editor.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/list-detail-dialog.d.ts +2 -2
- package/dist/list-detail-dialog.js +4 -4
- package/dist/list-header.d.ts +47 -5
- package/dist/list-header.js +1 -1
- package/dist/message-composer.js +1 -1
- package/dist/{nav-stack-vQ3ieerq.d.ts → nav-stack-DKrvqFjA.d.ts} +1 -1
- package/dist/nav-stack.d.ts +2 -2
- package/dist/nav-stack.js +1 -1
- package/dist/{panel-toolbar-vg6Ir5Dy.d.ts → panel-toolbar-CEcHHDkn.d.ts} +8 -0
- package/dist/radio-group.d.ts +19 -2
- package/dist/radio-group.js +3 -1
- package/dist/split-view.d.ts +2 -2
- package/dist/split-view.js +1 -1
- package/dist/styles/column-track.css +7 -2
- package/dist/styles/components/actions/toolbar-control-group/toolbar-control-group.css +11 -4
- package/dist/styles/components/collections/list-header/list-header.css +50 -0
- package/dist/styles/components/collections/list-item/list-item.css +6 -1
- package/dist/styles/components/collections/tree-list/tree-list.css +3 -2
- package/dist/styles/components/forms/radio-group/radio-group.css +107 -0
- package/dist/styles/components/layout/column-track/column-track.css +7 -2
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +30 -1
- package/dist/styles/editor/editor.css +0 -23
- package/dist/styles/list-header.css +50 -0
- package/dist/styles/list-item.css +6 -1
- package/dist/styles/radio-group.css +107 -0
- package/dist/styles/surface-scaffold.css +30 -1
- package/dist/styles/toolbar-control-group.css +11 -4
- package/dist/styles/tree-list.css +3 -2
- package/dist/surface-scaffold-register.js +1 -1
- package/dist/surface-scaffold.d.ts +46 -11
- package/dist/surface-scaffold.js +2 -2
- package/dist/toolbar-control-group.d.ts +10 -1
- package/dist/toolbar-control-group.js +1 -1
- package/dist/tree-list.d.ts +7 -1
- package/dist/tree-list.js +1 -1
- package/dist/view-runtime.d.ts +9 -0
- package/dist/view-runtime.js +8 -0
- package/dist/view-runtime.js.map +1 -0
- package/dist/wire-catalog.d.ts +2 -2
- package/dist/wire-catalog.js +1 -1
- package/dist/wire-search-fields.js +1 -1
- package/dist/wire-tab-bars.d.ts +10 -0
- package/dist/wire-tab-bars.js +1 -1
- package/dist/wire-tag-fields.js +1 -1
- package/dist/wire-workbench.d.ts +17 -1
- package/dist/wire-workbench.js +1 -1
- package/dist/workbench-dialog.d.ts +2 -2
- package/dist/workbench-dialog.js +4 -4
- package/dist/workbench.d.ts +10 -2
- package/dist/workbench.js +1 -1
- package/docs/accessibility.md +1 -1
- package/docs/column-explorer.md +4 -0
- package/docs/component-contract.md +10 -4
- package/docs/component-integration.md +7 -3
- package/docs/component-selection.md +2 -1
- package/docs/design/sketch/Kerf-UI.sketch +0 -0
- package/docs/design/sketch/coverage.md +7 -6
- package/docs/design/sketch/forms/README.md +5 -4
- package/docs/design/sketch/unified/pages/forms.png +0 -0
- package/docs/design/templates/radio-group/tiles-dark.svg +1 -0
- package/docs/design/templates/radio-group/tiles.svg +1 -0
- package/docs/design/templates/radio-group-dark.svg +1 -1
- package/docs/design/templates/radio-group.svg +1 -1
- package/docs/editor-host.md +90 -5
- package/docs/interaction-conventions.md +2 -0
- package/docs/layout.md +1 -1
- package/docs/surface-scaffold.md +49 -2
- package/docs/tree-list.md +10 -0
- package/docs/workbench.md +16 -0
- package/evaluator/firefox-app-data.d.mts +4 -0
- package/evaluator/firefox-app-data.mjs +35 -0
- package/evaluator/index.mjs +19 -5
- package/llms.txt +20 -4
- package/package.json +8 -1
- package/props/component-props.d.mts +3 -0
- package/view/cli.mjs +36 -5
- package/view/contract.mjs +3 -0
- package/view/generate.mjs +8 -7
- package/view/index.d.mts +14 -0
- package/view/project-types-worker.mjs +55 -0
- package/view/project-types.d.mts +43 -0
- package/view/project-types.mjs +618 -0
- package/view/type-expression.d.mts +15 -0
- package/view/type-expression.mjs +162 -0
- package/view/types.mjs +4 -0
- package/view/validate.mjs +20 -1
- package/vite-editor.d.mts +31 -3
- package/vite-editor.mjs +168 -4
- package/dist/chunk-34FWYJX6.js.map +0 -1
- package/dist/chunk-3ZKUXWAV.js.map +0 -1
- package/dist/chunk-3ZWYGGEC.js.map +0 -1
- package/dist/chunk-5A2DN3LR.js.map +0 -1
- package/dist/chunk-6T7AX365.js.map +0 -1
- package/dist/chunk-BMOZSNDU.js +0 -133
- package/dist/chunk-BMOZSNDU.js.map +0 -1
- package/dist/chunk-GQUDCWOD.js.map +0 -1
- package/dist/chunk-IMXLOMTF.js.map +0 -1
- package/dist/chunk-IR32NI2O.js.map +0 -1
- package/dist/chunk-MLDO7WLA.js +0 -82
- package/dist/chunk-MLDO7WLA.js.map +0 -1
- package/dist/chunk-OHT2AXER.js.map +0 -1
- package/dist/chunk-UQ4FRQ6M.js.map +0 -1
- package/dist/chunk-ZC4KSRAF.js.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The worker thread `editorFileMiddleware` runs the project-type service in
|
|
3
|
+
* (KF-EQFF9K: TypeScript's synchronous work used to block the dev or preview
|
|
4
|
+
* server's event loop, so a Play page waited up to a second behind an
|
|
5
|
+
* analysis). One worker per middleware root owns one service; each message
|
|
6
|
+
* is one validated `analyze` or `validate` request.
|
|
7
|
+
*
|
|
8
|
+
* Message in: `{ id, body }`. Reply: `{ id, result }`, or `{ id, error }`
|
|
9
|
+
* with the message of a request the service rejects.
|
|
10
|
+
*/
|
|
11
|
+
import { readFileSync } from 'node:fs';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import { parentPort, workerData } from 'node:worker_threads';
|
|
14
|
+
|
|
15
|
+
import { applicationCatalogs } from '../vite-editor.mjs';
|
|
16
|
+
import { createViewCatalog } from './catalog.mjs';
|
|
17
|
+
import { createProjectTypeService } from './project-types.mjs';
|
|
18
|
+
|
|
19
|
+
const { root } = workerData;
|
|
20
|
+
const readJson = (url) => JSON.parse(readFileSync(fileURLToPath(url), 'utf8'));
|
|
21
|
+
|
|
22
|
+
let service;
|
|
23
|
+
/** Kerf UI's catalogs plus the application's, read afresh per request. */
|
|
24
|
+
const typeCatalog = () => {
|
|
25
|
+
const app = applicationCatalogs(root);
|
|
26
|
+
return createViewCatalog({
|
|
27
|
+
props: [
|
|
28
|
+
readJson(new URL('../ai/component-props.json', import.meta.url)),
|
|
29
|
+
...app.props,
|
|
30
|
+
],
|
|
31
|
+
composition: [
|
|
32
|
+
readJson(new URL('../ai/component-composition.json', import.meta.url)),
|
|
33
|
+
...app.composition,
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
parentPort.on('message', ({ id, body }) => {
|
|
39
|
+
try {
|
|
40
|
+
service ??= createProjectTypeService(root);
|
|
41
|
+
const result =
|
|
42
|
+
body.action === 'analyze'
|
|
43
|
+
? service.analyze({
|
|
44
|
+
...body,
|
|
45
|
+
...(body.declared ? { catalog: typeCatalog() } : {}),
|
|
46
|
+
})
|
|
47
|
+
: service.validateDocument(body.document, typeCatalog(), body.source);
|
|
48
|
+
parentPort.postMessage({ id, result });
|
|
49
|
+
} catch (error) {
|
|
50
|
+
parentPort.postMessage({
|
|
51
|
+
id,
|
|
52
|
+
error: error instanceof Error ? error.message : String(error),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ViewCatalog,
|
|
3
|
+
ViewDiagnostic,
|
|
4
|
+
ViewDocument,
|
|
5
|
+
ViewType,
|
|
6
|
+
} from './index.mjs';
|
|
7
|
+
|
|
8
|
+
export type CheckedProjectType = ViewType & {
|
|
9
|
+
typescript: NonNullable<ViewType['typescript']>;
|
|
10
|
+
};
|
|
11
|
+
export interface ProjectTypeAnalysis {
|
|
12
|
+
type?: CheckedProjectType;
|
|
13
|
+
diagnostics: { message: string; start?: number; length?: number }[];
|
|
14
|
+
suggestions: {
|
|
15
|
+
name: string;
|
|
16
|
+
source?: string;
|
|
17
|
+
text: string;
|
|
18
|
+
cursor: number;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export interface NodeProjectTypeService {
|
|
22
|
+
analyze(request: {
|
|
23
|
+
source: string;
|
|
24
|
+
text: string;
|
|
25
|
+
cursor?: number;
|
|
26
|
+
autoImport?: boolean;
|
|
27
|
+
/** Compute completion suggestions (default true); false skips the costliest step. */
|
|
28
|
+
suggest?: boolean;
|
|
29
|
+
declared?: ViewType;
|
|
30
|
+
catalog?: ViewCatalog;
|
|
31
|
+
}): ProjectTypeAnalysis;
|
|
32
|
+
validateDocument(
|
|
33
|
+
document: ViewDocument,
|
|
34
|
+
catalog: ViewCatalog,
|
|
35
|
+
source: string,
|
|
36
|
+
options?: { resolveView?: (src: string, path: string) => unknown },
|
|
37
|
+
): { document: ViewDocument; diagnostics: ViewDiagnostic[] };
|
|
38
|
+
dispose(): void;
|
|
39
|
+
}
|
|
40
|
+
/** Nearest tsconfig root, or the document folder when no config exists. */
|
|
41
|
+
export function projectTypeRoot(path: string): string;
|
|
42
|
+
/** Node-only service. No compiler code enters the browser entry. */
|
|
43
|
+
export function createProjectTypeService(root: string): NodeProjectTypeService;
|