@niscorp/loom 0.1.0
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/DESIGN.md +253 -0
- package/LICENSE +202 -0
- package/README.md +101 -0
- package/dist/chunk-A3UOFGL4.js +29 -0
- package/dist/chunk-A3UOFGL4.js.map +1 -0
- package/dist/chunk-D743DI5J.js +17 -0
- package/dist/chunk-D743DI5J.js.map +1 -0
- package/dist/chunk-DWQWPBBV.js +63 -0
- package/dist/chunk-DWQWPBBV.js.map +1 -0
- package/dist/chunk-LWY5TG7M.js +208 -0
- package/dist/chunk-LWY5TG7M.js.map +1 -0
- package/dist/chunk-MIRMQPUE.js +132 -0
- package/dist/chunk-MIRMQPUE.js.map +1 -0
- package/dist/chunk-PTXRAWJX.js +58 -0
- package/dist/chunk-PTXRAWJX.js.map +1 -0
- package/dist/chunk-TV4U22MY.js +176 -0
- package/dist/chunk-TV4U22MY.js.map +1 -0
- package/dist/chunk-X7PCPONB.js +380 -0
- package/dist/chunk-X7PCPONB.js.map +1 -0
- package/dist/chunk-XTY7XO5C.js +61 -0
- package/dist/chunk-XTY7XO5C.js.map +1 -0
- package/dist/index.cjs +630 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/loom-editor-CQ_GI4IA.d.cts +27 -0
- package/dist/loom-editor-D5SBQ4_F.d.ts +27 -0
- package/dist/plugins/nova/index.cjs +81 -0
- package/dist/plugins/nova/index.cjs.map +1 -0
- package/dist/plugins/nova/index.d.cts +14 -0
- package/dist/plugins/nova/index.d.ts +14 -0
- package/dist/plugins/nova/index.js +5 -0
- package/dist/plugins/nova/index.js.map +1 -0
- package/dist/plugins/nova/react/index.cjs +107 -0
- package/dist/plugins/nova/react/index.cjs.map +1 -0
- package/dist/plugins/nova/react/index.d.cts +17 -0
- package/dist/plugins/nova/react/index.d.ts +17 -0
- package/dist/plugins/nova/react/index.js +36 -0
- package/dist/plugins/nova/react/index.js.map +1 -0
- package/dist/plugins/prism/index.cjs +48 -0
- package/dist/plugins/prism/index.cjs.map +1 -0
- package/dist/plugins/prism/index.d.cts +18 -0
- package/dist/plugins/prism/index.d.ts +18 -0
- package/dist/plugins/prism/index.js +4 -0
- package/dist/plugins/prism/index.js.map +1 -0
- package/dist/plugins/prism/react/index.cjs +744 -0
- package/dist/plugins/prism/react/index.cjs.map +1 -0
- package/dist/plugins/prism/react/index.d.cts +12 -0
- package/dist/plugins/prism/react/index.d.ts +12 -0
- package/dist/plugins/prism/react/index.js +419 -0
- package/dist/plugins/prism/react/index.js.map +1 -0
- package/dist/plugins/vex/index.cjs +67 -0
- package/dist/plugins/vex/index.cjs.map +1 -0
- package/dist/plugins/vex/index.d.cts +25 -0
- package/dist/plugins/vex/index.d.ts +25 -0
- package/dist/plugins/vex/index.js +4 -0
- package/dist/plugins/vex/index.js.map +1 -0
- package/dist/plugins/vex/react/index.cjs +432 -0
- package/dist/plugins/vex/react/index.cjs.map +1 -0
- package/dist/plugins/vex/react/index.d.cts +13 -0
- package/dist/plugins/vex/react/index.d.ts +13 -0
- package/dist/plugins/vex/react/index.js +296 -0
- package/dist/plugins/vex/react/index.js.map +1 -0
- package/dist/react/index.cjs +1076 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +82 -0
- package/dist/react/index.d.ts +82 -0
- package/dist/react/index.js +120 -0
- package/dist/react/index.js.map +1 -0
- package/dist/schema--OhtatTX.d.cts +10 -0
- package/dist/schema--OhtatTX.d.ts +10 -0
- package/dist/types-BonjN3CB.d.cts +144 -0
- package/dist/types-BonjN3CB.d.ts +144 -0
- package/package.json +144 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/react/editor/loom-editor.tsx","../../src/plugins/jsonviewer/jsonviewer.layout.ts","../../src/plugins/jsonviewer/jsonviewer.action.ts","../../src/plugins/jsonviewer/index.ts","../../src/plugins/jsonviewer/react/jsonviewer.tsx","../../src/plugins/jsonviewer/react/index.ts","../../src/plugins/validation/validation.layout.ts","../../src/plugins/validation/validation.action.ts","../../src/plugins/validation/index.ts","../../src/plugins/validation/react/validation.tsx","../../src/plugins/validation/react/index.ts","../../src/react/editor/defaults.ts"],"names":["jsx","panel","head","pre","jsxs"],"mappings":";;;;;;;;;;;AAwCO,IAAM,aAAkC,CAAC,EAAE,OAAA,EAAS,QAAA,EAAU,UAAS,KAAM;AAClF,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAA+B,IAAI,CAAA;AACzD,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,QAAA,CAAkC,EAAE,CAAA;AAEtE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,WAAW,kBAAA,EAAmB;AACpC,IAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,MAAA,KAAA,MAAW,CAAC,IAAA,EAAM,SAAS,CAAA,IAAK,OAAO,OAAA,CAAQ,MAAA,CAAO,UAAA,IAAc,EAAE,CAAA,EAAG,QAAA,CAAS,QAAA,CAAS,MAAM,SAAS,CAAA;AAAA,IAC5G;AAEA,IAAA,MAAM,MAAA,GAAS,gBAAA,CAAiB,EAAE,QAAA,EAAyC,CAAA;AAC3E,IAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,MAAA,MAAA,CAAO,UAAA,CAAW;AAAA,QAChB,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,WAAW,MAAA,CAAO,SAAA;AAAA,QAClB,GAAI,OAAO,OAAA,GAAU,EAAE,SAAS,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAC,CAAA,MAAO,EAAE,IAAA,EAAM,CAAA,CAAE,MAAM,KAAA,EAAO,CAAA,CAAE,OAAM,CAAE,CAAA,KAAM,EAAC;AAAA,QACnG,GAAI,OAAO,KAAA,GAAQ,EAAE,OAAO,MAAA,CAAO,KAAA,KAAU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CAAC,SAAI,KAAA,EAAOE,KAAAA,EAAO,iBAAM,CAAA,GAAS,IAAA;AAAA,kBACzDF,GAAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAOG,IAAAA,EAAM,QAAA,EAAA,IAAA,CAAK,SAAA,CAAU,KAAA,IAAS,EAAC,EAAG,IAAA,EAAM,CAAC,CAAA,EAAE;AAAA,CAAA,EACzD,CAAA;;;ACTK,IAAM,aAAa,MAAwB;AAChD,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,EAAW,KAAA,KAAU,gBAAA,EAAiB;AACpD,EAAA,OAAO,EAAE,IAAA,EAAM,SAAA,EAAW,KAAA,EAAO,UAAA,EAAY,EAAE,CAAC,UAAU,GAAG,UAAA,EAAW,EAAE;AAC5E,CAAA;;;ACDO,IAAM,iBAAiB,MAA0B,CAAC,UAAA,EAAW,EAAG,YAAY","file":"index.js","sourcesContent":["import { useEffect, useState, type FC } from 'react';\nimport type { ZodType } from 'zod';\nimport type { ComponentRegistry, LayoutNode } from '@niscorp/nova';\nimport { NovaShell, type NovaComponent } from '@niscorp/nova/adapters/react';\nimport { createLoomEditor, type LoomArtifact, type LoomEditor as LoomEditorApi } from '@editor/editor';\nimport type { FieldContext } from '@compile/types';\nimport { createLoomRegistry } from '../kit/index.js';\nimport { LoomDocumentContext } from '../hooks/document.js';\n\n// <LoomEditor> — the integrated editing surface and the package's main export.\n// It builds the editor controller (an empty Nova shell + a plugin loader) and\n// renders it. Everything visible is plugin-contributed; the component is agnostic\n// about which plugins those are — it loads exactly `plugins`, in order, so a later\n// one can override or remove an earlier one. (Apps that want the JSON / validation\n// views spread `defaultPlugins()` at the front.) The controller is framework-free;\n// this component supplies the kit and renders the shell. Give the element a new\n// `key` to open a different artifact.\n\n// A renderer plugin: the core descriptor plus the components it registers.\n// `mount` and `documents` drive the controller; `widgets` are the compiler\n// matchers (role + match) that upgrade form fields. `components` (keyed by role)\n// supply every render — the views a mount references AND the widget renders. A\n// role names a component; `components` provides it.\nexport type LoomEditorPlugin = {\n name: string;\n documents: Record<string, ZodType | ((value: unknown) => LayoutNode)>;\n components?: Record<string, NovaComponent>;\n widgets?: { role: string; match: (field: FieldContext) => boolean }[];\n mount?: (editor: LoomEditorApi) => void;\n};\n\nexport type LoomEditorProps = {\n /** The loaded plugins (capabilities). Read once on mount. */\n plugins: LoomEditorPlugin[];\n /** The artifact to open. Read once on mount; give a new `key` to switch. */\n artifact: LoomArtifact;\n /** Called with the live documents whenever they change. */\n onChange?: (documents: Record<string, unknown>) => void;\n};\n\nexport const LoomEditor: FC<LoomEditorProps> = ({ plugins, artifact, onChange }) => {\n const [api, setApi] = useState<LoomEditorApi | null>(null);\n const [documents, setDocuments] = useState<Record<string, unknown>>({});\n\n useEffect(() => {\n const registry = createLoomRegistry();\n for (const plugin of plugins) {\n for (const [role, component] of Object.entries(plugin.components ?? {})) registry.register(role, component);\n }\n\n const editor = createLoomEditor({ registry: registry as ComponentRegistry });\n for (const plugin of plugins) {\n editor.loadPlugin({\n name: plugin.name,\n documents: plugin.documents,\n ...(plugin.widgets ? { widgets: plugin.widgets.map((w) => ({ role: w.role, match: w.match })) } : {}),\n ...(plugin.mount ? { mount: plugin.mount } : {}),\n });\n }\n editor.open(artifact);\n setApi(editor);\n setDocuments(editor.documents);\n onChange?.(editor.documents);\n const off = editor.on('change', () => {\n setDocuments(editor.documents);\n onChange?.(editor.documents);\n });\n return () => {\n off();\n editor.dispose();\n setApi(null);\n };\n // Mount-only; a new `key` re-opens.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const shell = api?.shell;\n return shell === undefined || shell === null ? null : (\n <LoomDocumentContext.Provider value={documents}>\n <NovaShell shell={shell} />\n </LoomDocumentContext.Provider>\n );\n};\n","import type { LayoutNode } from '@niscorp/nova';\n\n// The view's id — one string for one view: the name its component registers\n// under, the id of its action, and the id of its canvas. The plugin owns it; the\n// editor host defines no view ids of its own.\nexport const JSONVIEWER = 'loom:jsonviewer';\n\n// A read-only JSON pane titled \"Data\", bound to the `value` the mount syncs (the\n// editor's live documents).\nexport const jsonviewerLayout: LayoutNode = {\n component: JSONVIEWER,\n props: { title: 'Data', value: '$.value' },\n};\n","import type { ActionDefinition } from '@niscorp/nova';\nimport { jsonviewerLayout, JSONVIEWER } from './jsonviewer.layout.js';\n\n// The jsonviewer canvas's action: the layout over a `value` slot the mount keeps\n// synced. Canvas id equals the action id (JSONVIEWER).\nexport const jsonviewerAction: ActionDefinition = {\n id: JSONVIEWER,\n layout: jsonviewerLayout,\n data: { value: {} },\n};\n","import { mountView } from '@editor/view';\nimport type { LoomPlugin } from '@editor/types';\nimport { jsonviewerAction } from './jsonviewer.action.js';\n\n// @niscorp/loom/plugins/jsonviewer — a default plugin (framework-free).\n//\n// A read-only JSON view of the editor's live documents. Loaded first, so a domain\n// plugin (nova, vex) loaded later can remove its canvas or re-arrange the shell.\n// Contributes no documents — it edits nothing, it mirrors what the forms hold.\n\nexport { JSONVIEWER } from './jsonviewer.layout.js';\n\nexport const jsonviewerPlugin = (): LoomPlugin => ({\n name: 'loom:jsonviewer',\n documents: {},\n mount: (editor) => mountView(editor, jsonviewerAction, (e) => ({ value: e.documents })),\n});\n","import type { CSSProperties } from 'react';\nimport type { NovaComponent } from '@niscorp/nova/adapters/react';\n\n// The jsonviewer's view component: a read-only JSON pane with a title. The plugin\n// binds `value` to the editor's live documents and registers this under JSONVIEWER.\n\nconst panel: CSSProperties = { border: '1px solid #e5e7eb', borderRadius: 8, overflow: 'hidden' };\nconst head: CSSProperties = { padding: '6px 12px', borderBottom: '1px solid #e5e7eb', background: '#f9fafb', fontSize: 12, fontWeight: 600, color: '#374151' };\nconst pre: CSSProperties = { margin: 0, padding: 12, fontSize: 12, fontFamily: 'ui-monospace, Menlo, monospace', whiteSpace: 'pre-wrap', wordBreak: 'break-word', maxHeight: 320, overflow: 'auto' };\n\nexport const JsonViewer: NovaComponent<{ title?: string; value?: unknown }> = ({ title, value }) => (\n <div style={panel}>\n {title !== undefined ? <div style={head}>{title}</div> : null}\n <pre style={pre}>{JSON.stringify(value ?? {}, null, 2)}</pre>\n </div>\n);\n","import type { LoomEditorPlugin } from '@react';\nimport { jsonviewerPlugin, JSONVIEWER } from '../index.js';\nimport { JsonViewer } from './jsonviewer.js';\n\n// @niscorp/loom/plugins/jsonviewer/react — the React surface: the plugin assembled\n// with its own view component, registered under the plugin's view id.\nexport const jsonviewer = (): LoomEditorPlugin => {\n const { name, documents, mount } = jsonviewerPlugin();\n return { name, documents, mount, components: { [JSONVIEWER]: JsonViewer } };\n};\n","import type { LayoutNode } from '@niscorp/nova';\n\n// The view's id — one string for one view: the name its component registers\n// under, the id of its action, and the id of its canvas. The plugin owns it; the\n// editor host defines no view ids of its own.\nexport const VALIDATION = 'loom:validation';\n\n// A read-only JSON pane titled \"Validations\", bound to the `value` the mount\n// syncs (the editor's per-document validation problems).\nexport const validationLayout: LayoutNode = {\n component: VALIDATION,\n props: { title: 'Validations', value: '$.value' },\n};\n","import type { ActionDefinition } from '@niscorp/nova';\nimport { validationLayout, VALIDATION } from './validation.layout.js';\n\n// The validation canvas's action: the layout over a `value` slot the mount keeps\n// synced. Canvas id equals the action id (VALIDATION).\nexport const validationAction: ActionDefinition = {\n id: VALIDATION,\n layout: validationLayout,\n data: { value: {} },\n};\n","import { mountView } from '@editor/view';\nimport type { LoomPlugin } from '@editor/types';\nimport { validationAction } from './validation.action.js';\n\n// @niscorp/loom/plugins/validation — a default plugin (framework-free).\n//\n// A read-only JSON view of the editor's validation problems (per document, keyed\n// the same as `documents`). Loaded first; overridable like any default.\n// Contributes no documents — it mirrors the forms' validation state.\n\nexport { VALIDATION } from './validation.layout.js';\n\nexport const validationPlugin = (): LoomPlugin => ({\n name: 'loom:validation',\n documents: {},\n mount: (editor) => mountView(editor, validationAction, (e) => ({ value: e.validations })),\n});\n","import type { CSSProperties } from 'react';\nimport type { NovaComponent } from '@niscorp/nova/adapters/react';\n\n// The validation plugin's view component: a read-only JSON pane with a title. The\n// plugin binds `value` to the editor's validation problems and registers this\n// under VALIDATION.\n\nconst panel: CSSProperties = { border: '1px solid #e5e7eb', borderRadius: 8, overflow: 'hidden' };\nconst head: CSSProperties = { padding: '6px 12px', borderBottom: '1px solid #e5e7eb', background: '#f9fafb', fontSize: 12, fontWeight: 600, color: '#374151' };\nconst pre: CSSProperties = { margin: 0, padding: 12, fontSize: 12, fontFamily: 'ui-monospace, Menlo, monospace', whiteSpace: 'pre-wrap', wordBreak: 'break-word', maxHeight: 320, overflow: 'auto' };\n\nexport const Validation: NovaComponent<{ title?: string; value?: unknown }> = ({ title, value }) => (\n <div style={panel}>\n {title !== undefined ? <div style={head}>{title}</div> : null}\n <pre style={pre}>{JSON.stringify(value ?? {}, null, 2)}</pre>\n </div>\n);\n","import type { LoomEditorPlugin } from '@react';\nimport { validationPlugin, VALIDATION } from '../index.js';\nimport { Validation } from './validation.js';\n\n// @niscorp/loom/plugins/validation/react — the React surface: the plugin assembled\n// with its own view component, registered under the plugin's view id.\nexport const validation = (): LoomEditorPlugin => {\n const { name, documents, mount } = validationPlugin();\n return { name, documents, mount, components: { [VALIDATION]: Validation } };\n};\n","import { jsonviewer } from '@plugins/jsonviewer/react';\nimport { validation } from '@plugins/validation/react';\nimport type { LoomEditorPlugin } from './loom-editor.js';\n\n// The default view plugins, as a preset. <LoomEditor> bakes in nothing — an app\n// that wants the live Data / Validations JSON panes spreads these at the FRONT of\n// its `plugins` list, so domain plugins (nova, vex) load after and can override or\n// remove them. Omit it for a bare editor.\nexport const defaultPlugins = (): LoomEditorPlugin[] => [jsonviewer(), validation()];\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
|
|
3
|
+
type NovaComponentShape = {
|
|
4
|
+
name: string;
|
|
5
|
+
props: ZodType;
|
|
6
|
+
container?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const layoutSchema: (manifest: readonly NovaComponentShape[]) => ZodType;
|
|
9
|
+
|
|
10
|
+
export { type NovaComponentShape as N, layoutSchema as l };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
|
|
3
|
+
type NovaComponentShape = {
|
|
4
|
+
name: string;
|
|
5
|
+
props: ZodType;
|
|
6
|
+
container?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const layoutSchema: (manifest: readonly NovaComponentShape[]) => ZodType;
|
|
9
|
+
|
|
10
|
+
export { type NovaComponentShape as N, layoutSchema as l };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { LayoutNode, Shell, ComponentRegistry } from '@niscorp/nova';
|
|
3
|
+
|
|
4
|
+
type EnumOption = {
|
|
5
|
+
value: unknown;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
type ObjectField = {
|
|
9
|
+
key: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
field: Field;
|
|
12
|
+
};
|
|
13
|
+
type Pattern = {
|
|
14
|
+
kind: 'tag';
|
|
15
|
+
key: string;
|
|
16
|
+
value: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'key';
|
|
19
|
+
key: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'type';
|
|
22
|
+
type: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'fallback';
|
|
25
|
+
};
|
|
26
|
+
type Variant = {
|
|
27
|
+
label: string;
|
|
28
|
+
field: Field;
|
|
29
|
+
pattern: Pattern;
|
|
30
|
+
};
|
|
31
|
+
type FieldMeta = {
|
|
32
|
+
title?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
default?: unknown;
|
|
35
|
+
};
|
|
36
|
+
type Of<Body> = Body & FieldMeta;
|
|
37
|
+
type Field = Of<{
|
|
38
|
+
kind: 'string';
|
|
39
|
+
format?: string;
|
|
40
|
+
}> | Of<{
|
|
41
|
+
kind: 'number';
|
|
42
|
+
integer?: boolean;
|
|
43
|
+
}> | Of<{
|
|
44
|
+
kind: 'boolean';
|
|
45
|
+
}> | Of<{
|
|
46
|
+
kind: 'enum';
|
|
47
|
+
options: EnumOption[];
|
|
48
|
+
}> | Of<{
|
|
49
|
+
kind: 'object';
|
|
50
|
+
fields: ObjectField[];
|
|
51
|
+
recursive?: boolean;
|
|
52
|
+
}> | Of<{
|
|
53
|
+
kind: 'array';
|
|
54
|
+
item: Field;
|
|
55
|
+
}> | Of<{
|
|
56
|
+
kind: 'tuple';
|
|
57
|
+
items: Field[];
|
|
58
|
+
}> | Of<{
|
|
59
|
+
kind: 'union';
|
|
60
|
+
variants: Variant[];
|
|
61
|
+
recursive?: boolean;
|
|
62
|
+
}> | Of<{
|
|
63
|
+
kind: 'self';
|
|
64
|
+
}> | Of<{
|
|
65
|
+
kind: 'unknown';
|
|
66
|
+
}>;
|
|
67
|
+
type FieldKind = Field['kind'];
|
|
68
|
+
type FieldContext = {
|
|
69
|
+
kind: FieldKind;
|
|
70
|
+
path: string;
|
|
71
|
+
title?: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
};
|
|
74
|
+
type WidgetMatcher = {
|
|
75
|
+
role: string;
|
|
76
|
+
match: (field: FieldContext) => boolean;
|
|
77
|
+
};
|
|
78
|
+
type EmptyValue = (field: Field, options: CompileOptions) => unknown;
|
|
79
|
+
type CompileOptions = {
|
|
80
|
+
/** Definition id for the emitted action. Defaults to `'loom-form'`. */
|
|
81
|
+
id?: string;
|
|
82
|
+
/** Initial document to edit. Derived from the schema when omitted. */
|
|
83
|
+
value?: Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Bind the root field under this key instead of at the bare document root. A
|
|
86
|
+
* non-object root (a union, scalar, or array) compiles to a single control,
|
|
87
|
+
* which can't bind the document root (`$` resolves to no readable/writable
|
|
88
|
+
* value); wrapping it under a key gives it a real path. The document is shaped
|
|
89
|
+
* as `{ [rootKey]: value }`; callers that want the raw value unwrap the key.
|
|
90
|
+
*/
|
|
91
|
+
rootKey?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Give optional (non-required) object properties their defaults too. When
|
|
94
|
+
* false, optional properties start absent. Defaults to true.
|
|
95
|
+
*/
|
|
96
|
+
includeOptional?: boolean;
|
|
97
|
+
/** Per-kind overrides for the empty value of a field that has no schema default. */
|
|
98
|
+
empty?: Partial<Record<FieldKind, EmptyValue>>;
|
|
99
|
+
/**
|
|
100
|
+
* Custom widgets: the first whose `match` accepts a field replaces its default
|
|
101
|
+
* editor with the component registered under `role`. Used by plugins.
|
|
102
|
+
*/
|
|
103
|
+
widgets?: WidgetMatcher[];
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type DocumentLayout = (value: unknown) => LayoutNode;
|
|
107
|
+
type Document = ZodType | DocumentLayout;
|
|
108
|
+
type LoomPlugin = {
|
|
109
|
+
name: string;
|
|
110
|
+
documents: Record<string, Document>;
|
|
111
|
+
widgets?: WidgetBinding[];
|
|
112
|
+
mount?: (editor: LoomEditor) => void;
|
|
113
|
+
};
|
|
114
|
+
type WidgetBinding = {
|
|
115
|
+
role: string;
|
|
116
|
+
match: (field: FieldContext) => boolean;
|
|
117
|
+
};
|
|
118
|
+
type LoomArtifact = {
|
|
119
|
+
type: string;
|
|
120
|
+
documents?: Record<string, unknown>;
|
|
121
|
+
};
|
|
122
|
+
type LoomEvent = 'change' | 'open';
|
|
123
|
+
type LoomEditor = {
|
|
124
|
+
/** The live Nova shell. Built empty at creation; plugins mount onto it. */
|
|
125
|
+
readonly shell: Shell;
|
|
126
|
+
/** Register a plugin (a capability). Calls its `mount` against the live shell. */
|
|
127
|
+
loadPlugin: (plugin: LoomPlugin) => void;
|
|
128
|
+
/** Open an artifact — compiles its plugin's documents into form canvases. */
|
|
129
|
+
open: (artifact: LoomArtifact) => void;
|
|
130
|
+
/** The plugin whose artifact is currently open. */
|
|
131
|
+
readonly plugin: LoomPlugin | undefined;
|
|
132
|
+
/** The live document values, keyed by document name. */
|
|
133
|
+
readonly documents: Record<string, unknown>;
|
|
134
|
+
/** Validation problems per document: `{ [document]: errorTree }`. */
|
|
135
|
+
readonly validations: Record<string, unknown>;
|
|
136
|
+
on: (event: LoomEvent, handler: () => void) => () => void;
|
|
137
|
+
dispose: () => void;
|
|
138
|
+
};
|
|
139
|
+
type LoomEditorConfig = {
|
|
140
|
+
/** The component registry (the renderer's kit). The shell renders through it. */
|
|
141
|
+
registry: ComponentRegistry;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type { CompileOptions as C, Document as D, EmptyValue as E, Field as F, LoomEditor as L, ObjectField as O, Pattern as P, Variant as V, WidgetBinding as W, LoomEditorConfig as a, DocumentLayout as b, EnumOption as c, FieldKind as d, FieldMeta as e, LoomArtifact as f, LoomEvent as g, LoomPlugin as h, FieldContext as i };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
|
+
import { LayoutNode, Shell, ComponentRegistry } from '@niscorp/nova';
|
|
3
|
+
|
|
4
|
+
type EnumOption = {
|
|
5
|
+
value: unknown;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
type ObjectField = {
|
|
9
|
+
key: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
field: Field;
|
|
12
|
+
};
|
|
13
|
+
type Pattern = {
|
|
14
|
+
kind: 'tag';
|
|
15
|
+
key: string;
|
|
16
|
+
value: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'key';
|
|
19
|
+
key: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'type';
|
|
22
|
+
type: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'fallback';
|
|
25
|
+
};
|
|
26
|
+
type Variant = {
|
|
27
|
+
label: string;
|
|
28
|
+
field: Field;
|
|
29
|
+
pattern: Pattern;
|
|
30
|
+
};
|
|
31
|
+
type FieldMeta = {
|
|
32
|
+
title?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
default?: unknown;
|
|
35
|
+
};
|
|
36
|
+
type Of<Body> = Body & FieldMeta;
|
|
37
|
+
type Field = Of<{
|
|
38
|
+
kind: 'string';
|
|
39
|
+
format?: string;
|
|
40
|
+
}> | Of<{
|
|
41
|
+
kind: 'number';
|
|
42
|
+
integer?: boolean;
|
|
43
|
+
}> | Of<{
|
|
44
|
+
kind: 'boolean';
|
|
45
|
+
}> | Of<{
|
|
46
|
+
kind: 'enum';
|
|
47
|
+
options: EnumOption[];
|
|
48
|
+
}> | Of<{
|
|
49
|
+
kind: 'object';
|
|
50
|
+
fields: ObjectField[];
|
|
51
|
+
recursive?: boolean;
|
|
52
|
+
}> | Of<{
|
|
53
|
+
kind: 'array';
|
|
54
|
+
item: Field;
|
|
55
|
+
}> | Of<{
|
|
56
|
+
kind: 'tuple';
|
|
57
|
+
items: Field[];
|
|
58
|
+
}> | Of<{
|
|
59
|
+
kind: 'union';
|
|
60
|
+
variants: Variant[];
|
|
61
|
+
recursive?: boolean;
|
|
62
|
+
}> | Of<{
|
|
63
|
+
kind: 'self';
|
|
64
|
+
}> | Of<{
|
|
65
|
+
kind: 'unknown';
|
|
66
|
+
}>;
|
|
67
|
+
type FieldKind = Field['kind'];
|
|
68
|
+
type FieldContext = {
|
|
69
|
+
kind: FieldKind;
|
|
70
|
+
path: string;
|
|
71
|
+
title?: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
};
|
|
74
|
+
type WidgetMatcher = {
|
|
75
|
+
role: string;
|
|
76
|
+
match: (field: FieldContext) => boolean;
|
|
77
|
+
};
|
|
78
|
+
type EmptyValue = (field: Field, options: CompileOptions) => unknown;
|
|
79
|
+
type CompileOptions = {
|
|
80
|
+
/** Definition id for the emitted action. Defaults to `'loom-form'`. */
|
|
81
|
+
id?: string;
|
|
82
|
+
/** Initial document to edit. Derived from the schema when omitted. */
|
|
83
|
+
value?: Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Bind the root field under this key instead of at the bare document root. A
|
|
86
|
+
* non-object root (a union, scalar, or array) compiles to a single control,
|
|
87
|
+
* which can't bind the document root (`$` resolves to no readable/writable
|
|
88
|
+
* value); wrapping it under a key gives it a real path. The document is shaped
|
|
89
|
+
* as `{ [rootKey]: value }`; callers that want the raw value unwrap the key.
|
|
90
|
+
*/
|
|
91
|
+
rootKey?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Give optional (non-required) object properties their defaults too. When
|
|
94
|
+
* false, optional properties start absent. Defaults to true.
|
|
95
|
+
*/
|
|
96
|
+
includeOptional?: boolean;
|
|
97
|
+
/** Per-kind overrides for the empty value of a field that has no schema default. */
|
|
98
|
+
empty?: Partial<Record<FieldKind, EmptyValue>>;
|
|
99
|
+
/**
|
|
100
|
+
* Custom widgets: the first whose `match` accepts a field replaces its default
|
|
101
|
+
* editor with the component registered under `role`. Used by plugins.
|
|
102
|
+
*/
|
|
103
|
+
widgets?: WidgetMatcher[];
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type DocumentLayout = (value: unknown) => LayoutNode;
|
|
107
|
+
type Document = ZodType | DocumentLayout;
|
|
108
|
+
type LoomPlugin = {
|
|
109
|
+
name: string;
|
|
110
|
+
documents: Record<string, Document>;
|
|
111
|
+
widgets?: WidgetBinding[];
|
|
112
|
+
mount?: (editor: LoomEditor) => void;
|
|
113
|
+
};
|
|
114
|
+
type WidgetBinding = {
|
|
115
|
+
role: string;
|
|
116
|
+
match: (field: FieldContext) => boolean;
|
|
117
|
+
};
|
|
118
|
+
type LoomArtifact = {
|
|
119
|
+
type: string;
|
|
120
|
+
documents?: Record<string, unknown>;
|
|
121
|
+
};
|
|
122
|
+
type LoomEvent = 'change' | 'open';
|
|
123
|
+
type LoomEditor = {
|
|
124
|
+
/** The live Nova shell. Built empty at creation; plugins mount onto it. */
|
|
125
|
+
readonly shell: Shell;
|
|
126
|
+
/** Register a plugin (a capability). Calls its `mount` against the live shell. */
|
|
127
|
+
loadPlugin: (plugin: LoomPlugin) => void;
|
|
128
|
+
/** Open an artifact — compiles its plugin's documents into form canvases. */
|
|
129
|
+
open: (artifact: LoomArtifact) => void;
|
|
130
|
+
/** The plugin whose artifact is currently open. */
|
|
131
|
+
readonly plugin: LoomPlugin | undefined;
|
|
132
|
+
/** The live document values, keyed by document name. */
|
|
133
|
+
readonly documents: Record<string, unknown>;
|
|
134
|
+
/** Validation problems per document: `{ [document]: errorTree }`. */
|
|
135
|
+
readonly validations: Record<string, unknown>;
|
|
136
|
+
on: (event: LoomEvent, handler: () => void) => () => void;
|
|
137
|
+
dispose: () => void;
|
|
138
|
+
};
|
|
139
|
+
type LoomEditorConfig = {
|
|
140
|
+
/** The component registry (the renderer's kit). The shell renders through it. */
|
|
141
|
+
registry: ComponentRegistry;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type { CompileOptions as C, Document as D, EmptyValue as E, Field as F, LoomEditor as L, ObjectField as O, Pattern as P, Variant as V, WidgetBinding as W, LoomEditorConfig as a, DocumentLayout as b, EnumOption as c, FieldKind as d, FieldMeta as e, LoomArtifact as f, LoomEvent as g, LoomPlugin as h, FieldContext as i };
|
package/package.json
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@niscorp/loom",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Schema-driven editors that run on Nova — turn any schema into an editing UI",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/moccadroid/niscorp.git",
|
|
9
|
+
"directory": "packages/loom"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/index.d.cts",
|
|
21
|
+
"default": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"./react": {
|
|
25
|
+
"import": {
|
|
26
|
+
"types": "./dist/react/index.d.ts",
|
|
27
|
+
"default": "./dist/react/index.js"
|
|
28
|
+
},
|
|
29
|
+
"require": {
|
|
30
|
+
"types": "./dist/react/index.d.cts",
|
|
31
|
+
"default": "./dist/react/index.cjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"./plugins/vex": {
|
|
35
|
+
"import": {
|
|
36
|
+
"types": "./dist/plugins/vex/index.d.ts",
|
|
37
|
+
"default": "./dist/plugins/vex/index.js"
|
|
38
|
+
},
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./dist/plugins/vex/index.d.cts",
|
|
41
|
+
"default": "./dist/plugins/vex/index.cjs"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"./plugins/vex/react": {
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/plugins/vex/react/index.d.ts",
|
|
47
|
+
"default": "./dist/plugins/vex/react/index.js"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./dist/plugins/vex/react/index.d.cts",
|
|
51
|
+
"default": "./dist/plugins/vex/react/index.cjs"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./plugins/nova": {
|
|
55
|
+
"import": {
|
|
56
|
+
"types": "./dist/plugins/nova/index.d.ts",
|
|
57
|
+
"default": "./dist/plugins/nova/index.js"
|
|
58
|
+
},
|
|
59
|
+
"require": {
|
|
60
|
+
"types": "./dist/plugins/nova/index.d.cts",
|
|
61
|
+
"default": "./dist/plugins/nova/index.cjs"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"./plugins/nova/react": {
|
|
65
|
+
"import": {
|
|
66
|
+
"types": "./dist/plugins/nova/react/index.d.ts",
|
|
67
|
+
"default": "./dist/plugins/nova/react/index.js"
|
|
68
|
+
},
|
|
69
|
+
"require": {
|
|
70
|
+
"types": "./dist/plugins/nova/react/index.d.cts",
|
|
71
|
+
"default": "./dist/plugins/nova/react/index.cjs"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"./plugins/prism": {
|
|
75
|
+
"import": {
|
|
76
|
+
"types": "./dist/plugins/prism/index.d.ts",
|
|
77
|
+
"default": "./dist/plugins/prism/index.js"
|
|
78
|
+
},
|
|
79
|
+
"require": {
|
|
80
|
+
"types": "./dist/plugins/prism/index.d.cts",
|
|
81
|
+
"default": "./dist/plugins/prism/index.cjs"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"./plugins/prism/react": {
|
|
85
|
+
"import": {
|
|
86
|
+
"types": "./dist/plugins/prism/react/index.d.ts",
|
|
87
|
+
"default": "./dist/plugins/prism/react/index.js"
|
|
88
|
+
},
|
|
89
|
+
"require": {
|
|
90
|
+
"types": "./dist/plugins/prism/react/index.d.cts",
|
|
91
|
+
"default": "./dist/plugins/prism/react/index.cjs"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"files": [
|
|
96
|
+
"dist",
|
|
97
|
+
"*.md",
|
|
98
|
+
"LICENSE"
|
|
99
|
+
],
|
|
100
|
+
"publishConfig": {
|
|
101
|
+
"access": "public"
|
|
102
|
+
},
|
|
103
|
+
"engines": {
|
|
104
|
+
"node": ">=22.12"
|
|
105
|
+
},
|
|
106
|
+
"devDependencies": {
|
|
107
|
+
"@testing-library/react": "^16.1.0",
|
|
108
|
+
"@types/react": "^19.2.14",
|
|
109
|
+
"@types/react-dom": "^19.2.0",
|
|
110
|
+
"jsdom": "^25.0.1",
|
|
111
|
+
"react": "^19.2.4",
|
|
112
|
+
"react-dom": "^19.2.4",
|
|
113
|
+
"tsup": "^8.5.1",
|
|
114
|
+
"vitest": "^4.1.2",
|
|
115
|
+
"zod": "^4.6.5",
|
|
116
|
+
"@niscorp/nova": "^0.1.0",
|
|
117
|
+
"@niscorp/vex": "^0.1.0",
|
|
118
|
+
"@niscorp/prism": "^0.1.0"
|
|
119
|
+
},
|
|
120
|
+
"peerDependencies": {
|
|
121
|
+
"react": "^19.2.4",
|
|
122
|
+
"zod": "^4.2.0",
|
|
123
|
+
"@niscorp/nova": "^0.1.0",
|
|
124
|
+
"@niscorp/vex": "^0.1.0",
|
|
125
|
+
"@niscorp/prism": "^0.1.0"
|
|
126
|
+
},
|
|
127
|
+
"peerDependenciesMeta": {
|
|
128
|
+
"@niscorp/prism": {
|
|
129
|
+
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"@niscorp/vex": {
|
|
132
|
+
"optional": true
|
|
133
|
+
},
|
|
134
|
+
"react": {
|
|
135
|
+
"optional": true
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"scripts": {
|
|
139
|
+
"build": "tsup",
|
|
140
|
+
"dev": "tsup --watch",
|
|
141
|
+
"test": "vitest run",
|
|
142
|
+
"typecheck": "tsc --noEmit -p tsconfig.test.json"
|
|
143
|
+
}
|
|
144
|
+
}
|