@flanksource/clicky-ui 0.3.40 → 0.3.41
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/README.md +24 -0
- package/dist/ai.cjs +10 -0
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.js +10 -0
- package/dist/ai.js.map +1 -1
- package/dist/components/AccordionList.cjs +5 -1
- package/dist/components/AccordionList.cjs.map +1 -1
- package/dist/components/AccordionList.d.ts +3 -1
- package/dist/components/AccordionList.d.ts.map +1 -1
- package/dist/components/AccordionList.js +5 -1
- package/dist/components/AccordionList.js.map +1 -1
- package/dist/components/JsonSchemaForm.cjs +9 -4
- package/dist/components/JsonSchemaForm.cjs.map +1 -1
- package/dist/components/JsonSchemaForm.d.ts +1 -1
- package/dist/components/JsonSchemaForm.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm.js +8 -3
- package/dist/components/JsonSchemaForm.js.map +1 -1
- package/dist/components/json-schema-form-accordion-array.cjs +3 -1
- package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
- package/dist/components/json-schema-form-accordion-array.d.ts +4 -1
- package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-accordion-array.js +3 -1
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-array-view.cjs +63 -0
- package/dist/components/json-schema-form-array-view.cjs.map +1 -0
- package/dist/components/json-schema-form-array-view.d.ts +21 -0
- package/dist/components/json-schema-form-array-view.d.ts.map +1 -0
- package/dist/components/json-schema-form-array-view.js +63 -0
- package/dist/components/json-schema-form-array-view.js.map +1 -0
- package/dist/components/json-schema-form-array.cjs +3 -7
- package/dist/components/json-schema-form-array.cjs.map +1 -1
- package/dist/components/json-schema-form-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-array.js +3 -7
- package/dist/components/json-schema-form-array.js.map +1 -1
- package/dist/components/json-schema-form-conditionals.cjs +67 -0
- package/dist/components/json-schema-form-conditionals.cjs.map +1 -0
- package/dist/components/json-schema-form-conditionals.d.ts +9 -0
- package/dist/components/json-schema-form-conditionals.d.ts.map +1 -0
- package/dist/components/json-schema-form-conditionals.js +67 -0
- package/dist/components/json-schema-form-conditionals.js.map +1 -0
- package/dist/components/json-schema-form-defaults.cjs +68 -0
- package/dist/components/json-schema-form-defaults.cjs.map +1 -0
- package/dist/components/json-schema-form-defaults.d.ts +4 -0
- package/dist/components/json-schema-form-defaults.d.ts.map +1 -0
- package/dist/components/json-schema-form-defaults.js +68 -0
- package/dist/components/json-schema-form-defaults.js.map +1 -0
- package/dist/components/json-schema-form-errors.cjs +49 -31
- package/dist/components/json-schema-form-errors.cjs.map +1 -1
- package/dist/components/json-schema-form-errors.d.ts +4 -2
- package/dist/components/json-schema-form-errors.d.ts.map +1 -1
- package/dist/components/json-schema-form-errors.js +51 -33
- package/dist/components/json-schema-form-errors.js.map +1 -1
- package/dist/components/json-schema-form-filter.cjs +2 -1
- package/dist/components/json-schema-form-filter.cjs.map +1 -1
- package/dist/components/json-schema-form-filter.js +2 -1
- package/dist/components/json-schema-form-filter.js.map +1 -1
- package/dist/components/json-schema-form-item-summary.cjs +6 -2
- package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
- package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
- package/dist/components/json-schema-form-item-summary.js +6 -2
- package/dist/components/json-schema-form-item-summary.js.map +1 -1
- package/dist/components/json-schema-form-layout.cjs +28 -19
- package/dist/components/json-schema-form-layout.cjs.map +1 -1
- package/dist/components/json-schema-form-layout.d.ts +8 -6
- package/dist/components/json-schema-form-layout.d.ts.map +1 -1
- package/dist/components/json-schema-form-layout.js +29 -20
- package/dist/components/json-schema-form-layout.js.map +1 -1
- package/dist/components/json-schema-form-listener-paths.cjs +52 -0
- package/dist/components/json-schema-form-listener-paths.cjs.map +1 -0
- package/dist/components/json-schema-form-listener-paths.d.ts +10 -0
- package/dist/components/json-schema-form-listener-paths.d.ts.map +1 -0
- package/dist/components/json-schema-form-listener-paths.js +52 -0
- package/dist/components/json-schema-form-listener-paths.js.map +1 -0
- package/dist/components/json-schema-form-listener-types.d.ts +22 -0
- package/dist/components/json-schema-form-listener-types.d.ts.map +1 -0
- package/dist/components/json-schema-form-listeners.cjs +250 -0
- package/dist/components/json-schema-form-listeners.cjs.map +1 -0
- package/dist/components/json-schema-form-listeners.d.ts +13 -0
- package/dist/components/json-schema-form-listeners.d.ts.map +1 -0
- package/dist/components/json-schema-form-listeners.js +250 -0
- package/dist/components/json-schema-form-listeners.js.map +1 -0
- package/dist/components/json-schema-form-object-array-view.cjs +62 -0
- package/dist/components/json-schema-form-object-array-view.cjs.map +1 -0
- package/dist/components/json-schema-form-object-array-view.d.ts +14 -0
- package/dist/components/json-schema-form-object-array-view.d.ts.map +1 -0
- package/dist/components/json-schema-form-object-array-view.js +62 -0
- package/dist/components/json-schema-form-object-array-view.js.map +1 -0
- package/dist/components/json-schema-form-object.cjs +3 -0
- package/dist/components/json-schema-form-object.cjs.map +1 -1
- package/dist/components/json-schema-form-object.d.ts.map +1 -1
- package/dist/components/json-schema-form-object.js +3 -0
- package/dist/components/json-schema-form-object.js.map +1 -1
- package/dist/components/json-schema-form-render.cjs +17 -9
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +19 -11
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +6 -99
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts +1 -8
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +5 -98
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-runtime-types.d.ts +15 -0
- package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +67 -16
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts +4 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +70 -19
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-types.d.ts +16 -0
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.cjs +7 -1
- package/dist/components/json-schema-form-utils.cjs.map +1 -1
- package/dist/components/json-schema-form-utils.d.ts +2 -1
- package/dist/components/json-schema-form-utils.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.js +7 -1
- package/dist/components/json-schema-form-utils.js.map +1 -1
- package/dist/components.cjs +3 -2
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +3 -2
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +2 -1
- package/dist/components.js.map +1 -1
- package/dist/data/DataTable.cjs +9 -3
- package/dist/data/DataTable.cjs.map +1 -1
- package/dist/data/DataTable.d.ts +6 -0
- package/dist/data/DataTable.d.ts.map +1 -1
- package/dist/data/DataTable.js +9 -3
- package/dist/data/DataTable.js.map +1 -1
- package/dist/data/FixtureEditor/FixtureEditor.cjs +43 -24
- package/dist/data/FixtureEditor/FixtureEditor.cjs.map +1 -1
- package/dist/data/FixtureEditor/FixtureEditor.d.ts.map +1 -1
- package/dist/data/FixtureEditor/FixtureEditor.js +43 -24
- package/dist/data/FixtureEditor/FixtureEditor.js.map +1 -1
- package/dist/data/Tree.cjs +10 -2
- package/dist/data/Tree.cjs.map +1 -1
- package/dist/data/Tree.d.ts +6 -1
- package/dist/data/Tree.d.ts.map +1 -1
- package/dist/data/Tree.js +10 -2
- package/dist/data/Tree.js.map +1 -1
- package/dist/data/ai/SessionInspector.cjs +143 -167
- package/dist/data/ai/SessionInspector.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.collection-types.d.ts +5 -0
- package/dist/data/ai/SessionInspector.collection-types.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.collection.cjs +18 -5
- package/dist/data/ai/SessionInspector.collection.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.collection.d.ts +2 -0
- package/dist/data/ai/SessionInspector.collection.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.collection.fixtures.d.ts +6 -0
- package/dist/data/ai/SessionInspector.collection.fixtures.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.collection.js +18 -5
- package/dist/data/ai/SessionInspector.collection.js.map +1 -1
- package/dist/data/ai/SessionInspector.d.ts +24 -2
- package/dist/data/ai/SessionInspector.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy-state.cjs +105 -7
- package/dist/data/ai/SessionInspector.hierarchy-state.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy-state.d.ts +12 -1
- package/dist/data/ai/SessionInspector.hierarchy-state.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy-state.js +107 -9
- package/dist/data/ai/SessionInspector.hierarchy-state.js.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy.cjs +1 -1
- package/dist/data/ai/SessionInspector.hierarchy.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy.js +1 -1
- package/dist/data/ai/SessionInspector.hierarchy.js.map +1 -1
- package/dist/data/ai/SessionInspector.js +144 -168
- package/dist/data/ai/SessionInspector.js.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.cjs +116 -0
- package/dist/data/ai/SessionInspector.legacy.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.legacy.d.ts +19 -0
- package/dist/data/ai/SessionInspector.legacy.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.legacy.js +116 -0
- package/dist/data/ai/SessionInspector.legacy.js.map +1 -0
- package/dist/data/ai/SessionInspector.panels.cjs +3 -0
- package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.panels.js +3 -0
- package/dist/data/ai/SessionInspector.panels.js.map +1 -1
- package/dist/data/ai/SessionInspector.plan.cjs +29 -12
- package/dist/data/ai/SessionInspector.plan.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.plan.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.plan.js +30 -13
- package/dist/data/ai/SessionInspector.plan.js.map +1 -1
- package/dist/data/ai/SessionInspector.remote-view.cjs +44 -0
- package/dist/data/ai/SessionInspector.remote-view.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.remote-view.d.ts +11 -0
- package/dist/data/ai/SessionInspector.remote-view.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.remote-view.js +44 -0
- package/dist/data/ai/SessionInspector.remote-view.js.map +1 -0
- package/dist/data/ai/SessionInspector.remote.cjs +275 -0
- package/dist/data/ai/SessionInspector.remote.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.remote.d.ts +57 -0
- package/dist/data/ai/SessionInspector.remote.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.remote.js +275 -0
- package/dist/data/ai/SessionInspector.remote.js.map +1 -0
- package/dist/data/ai/SessionInspector.summary.cjs +0 -156
- package/dist/data/ai/SessionInspector.summary.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.summary.d.ts +0 -3
- package/dist/data/ai/SessionInspector.summary.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.summary.js +2 -158
- package/dist/data/ai/SessionInspector.summary.js.map +1 -1
- package/dist/data/ai/SessionInspector.tab-state.cjs +15 -0
- package/dist/data/ai/SessionInspector.tab-state.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.tab-state.d.ts +3 -0
- package/dist/data/ai/SessionInspector.tab-state.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.tab-state.js +15 -0
- package/dist/data/ai/SessionInspector.tab-state.js.map +1 -0
- package/dist/data/ai/SessionInspector.tabs.model.cjs +31 -18
- package/dist/data/ai/SessionInspector.tabs.model.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.tabs.model.d.ts +3 -1
- package/dist/data/ai/SessionInspector.tabs.model.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.tabs.model.js +32 -19
- package/dist/data/ai/SessionInspector.tabs.model.js.map +1 -1
- package/dist/data/ai/SessionInspector.verification.cjs +53 -0
- package/dist/data/ai/SessionInspector.verification.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.verification.d.ts +7 -0
- package/dist/data/ai/SessionInspector.verification.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.verification.js +53 -0
- package/dist/data/ai/SessionInspector.verification.js.map +1 -0
- package/dist/data/ai/SessionViewer.model.cjs +7 -1
- package/dist/data/ai/SessionViewer.model.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.model.d.ts +21 -3
- package/dist/data/ai/SessionViewer.model.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.model.js +7 -1
- package/dist/data/ai/SessionViewer.model.js.map +1 -1
- package/dist/data/ai/SessionViewer.unified.d.ts +13 -0
- package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
- package/dist/data/ai/index.d.ts +3 -1
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/devtools/useDebugStream.cjs +5 -1
- package/dist/devtools/useDebugStream.cjs.map +1 -1
- package/dist/devtools/useDebugStream.d.ts.map +1 -1
- package/dist/devtools/useDebugStream.js +6 -2
- package/dist/devtools/useDebugStream.js.map +1 -1
- package/dist/hooks/event-source-provider.cjs +9 -0
- package/dist/hooks/event-source-provider.cjs.map +1 -0
- package/dist/hooks/event-source-provider.d.ts +15 -0
- package/dist/hooks/event-source-provider.d.ts.map +1 -0
- package/dist/hooks/event-source-provider.js +9 -0
- package/dist/hooks/event-source-provider.js.map +1 -0
- package/dist/hooks/event-source.cjs +11 -0
- package/dist/hooks/event-source.cjs.map +1 -0
- package/dist/hooks/event-source.d.ts +22 -0
- package/dist/hooks/event-source.d.ts.map +1 -0
- package/dist/hooks/event-source.js +11 -0
- package/dist/hooks/event-source.js.map +1 -0
- package/dist/hooks/use-log-tail.cjs +5 -1
- package/dist/hooks/use-log-tail.cjs.map +1 -1
- package/dist/hooks/use-log-tail.d.ts.map +1 -1
- package/dist/hooks/use-log-tail.js +5 -1
- package/dist/hooks/use-log-tail.js.map +1 -1
- package/dist/hooks/use-prompts.cjs +5 -1
- package/dist/hooks/use-prompts.cjs.map +1 -1
- package/dist/hooks/use-prompts.d.ts.map +1 -1
- package/dist/hooks/use-prompts.js +6 -2
- package/dist/hooks/use-prompts.js.map +1 -1
- package/dist/hooks/use-task-run.cjs +9 -2
- package/dist/hooks/use-task-run.cjs.map +1 -1
- package/dist/hooks/use-task-run.d.ts.map +1 -1
- package/dist/hooks/use-task-run.js +10 -3
- package/dist/hooks/use-task-run.js.map +1 -1
- package/dist/hooks.cjs +4 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +4 -0
- package/dist/hooks.js.map +1 -1
- package/dist/icons/programmingCatalog.cjs +34 -34
- package/dist/icons/programmingCatalog.cjs.map +1 -1
- package/dist/icons/programmingCatalog.js +34 -34
- package/dist/icons/programmingCatalog.js.map +1 -1
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/monaco/MonacoEditor.cjs +4 -1
- package/dist/monaco/MonacoEditor.cjs.map +1 -1
- package/dist/monaco/MonacoEditor.d.ts +1 -1
- package/dist/monaco/MonacoEditor.d.ts.map +1 -1
- package/dist/monaco/MonacoEditor.js +4 -1
- package/dist/monaco/MonacoEditor.js.map +1 -1
- package/dist/monaco/types.d.ts +2 -1
- package/dist/monaco/types.d.ts.map +1 -1
- package/dist/overlay/CommandPalette.cjs +14 -4
- package/dist/overlay/CommandPalette.cjs.map +1 -1
- package/dist/overlay/CommandPalette.d.ts +5 -1
- package/dist/overlay/CommandPalette.d.ts.map +1 -1
- package/dist/overlay/CommandPalette.js +14 -4
- package/dist/overlay/CommandPalette.js.map +1 -1
- package/dist/overlay/CommandPaletteList.cjs +5 -0
- package/dist/overlay/CommandPaletteList.cjs.map +1 -1
- package/dist/overlay/CommandPaletteList.d.ts +4 -2
- package/dist/overlay/CommandPaletteList.d.ts.map +1 -1
- package/dist/overlay/CommandPaletteList.js +5 -0
- package/dist/overlay/CommandPaletteList.js.map +1 -1
- package/dist/overlay/DropdownMenu.cjs +1 -0
- package/dist/overlay/DropdownMenu.cjs.map +1 -1
- package/dist/overlay/DropdownMenu.js +1 -0
- package/dist/overlay/DropdownMenu.js.map +1 -1
- package/dist/rpc/OperationCatalog.cjs +29 -26
- package/dist/rpc/OperationCatalog.cjs.map +1 -1
- package/dist/rpc/OperationCatalog.d.ts +9 -1
- package/dist/rpc/OperationCatalog.d.ts.map +1 -1
- package/dist/rpc/OperationCatalog.js +29 -26
- package/dist/rpc/OperationCatalog.js.map +1 -1
- package/dist/rpc/OperationEntityContextPicker.cjs +62 -256
- package/dist/rpc/OperationEntityContextPicker.cjs.map +1 -1
- package/dist/rpc/OperationEntityContextPicker.d.ts.map +1 -1
- package/dist/rpc/OperationEntityContextPicker.js +64 -258
- package/dist/rpc/OperationEntityContextPicker.js.map +1 -1
- package/dist/rpc/OperationEntityPicker.cjs +185 -0
- package/dist/rpc/OperationEntityPicker.cjs.map +1 -0
- package/dist/rpc/OperationEntityPicker.d.ts +51 -0
- package/dist/rpc/OperationEntityPicker.d.ts.map +1 -0
- package/dist/rpc/OperationEntityPicker.js +185 -0
- package/dist/rpc/OperationEntityPicker.js.map +1 -0
- package/dist/rpc/OperationEntityPicker.model.cjs +39 -0
- package/dist/rpc/OperationEntityPicker.model.cjs.map +1 -0
- package/dist/rpc/OperationEntityPicker.model.d.ts +27 -0
- package/dist/rpc/OperationEntityPicker.model.d.ts.map +1 -0
- package/dist/rpc/OperationEntityPicker.model.js +39 -0
- package/dist/rpc/OperationEntityPicker.model.js.map +1 -0
- package/dist/rpc/operationCatalogRowSelection.cjs +85 -0
- package/dist/rpc/operationCatalogRowSelection.cjs.map +1 -0
- package/dist/rpc/operationCatalogRowSelection.d.ts +57 -0
- package/dist/rpc/operationCatalogRowSelection.d.ts.map +1 -0
- package/dist/rpc/operationCatalogRowSelection.js +85 -0
- package/dist/rpc/operationCatalogRowSelection.js.map +1 -0
- package/dist/rpc/operationEntityPicker.fixtures.d.ts +13 -0
- package/dist/rpc/operationEntityPicker.fixtures.d.ts.map +1 -0
- package/dist/rpc.cjs +2 -0
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.ts +2 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +2 -0
- package/dist/rpc.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -1
- package/schemas/json-schema-form.schema.json +566 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const collections = require("../lib/collections.cjs");
|
|
4
|
+
const jsonSchemaFormConditionals = require("./json-schema-form-conditionals.cjs");
|
|
5
|
+
const SEPARATOR = "/";
|
|
6
|
+
function isPathTarget(target) {
|
|
7
|
+
return target.includes(SEPARATOR);
|
|
8
|
+
}
|
|
9
|
+
function targetSegments(label, target) {
|
|
10
|
+
const segments = target.split(SEPARATOR);
|
|
11
|
+
if (segments.some((segment) => segment === "")) {
|
|
12
|
+
throw new Error(`${label}: target "${target}" has an empty path segment`);
|
|
13
|
+
}
|
|
14
|
+
return segments;
|
|
15
|
+
}
|
|
16
|
+
function patchTarget({
|
|
17
|
+
properties,
|
|
18
|
+
value,
|
|
19
|
+
target,
|
|
20
|
+
apply
|
|
21
|
+
}) {
|
|
22
|
+
const [first = "", ...rest] = target.split(SEPARATOR);
|
|
23
|
+
const prop = properties[first];
|
|
24
|
+
if (!prop) return;
|
|
25
|
+
const patched = patchNode(prop, value[first], rest, apply);
|
|
26
|
+
if (patched) properties[first] = patched;
|
|
27
|
+
}
|
|
28
|
+
function patchNode(node, nodeValue, segments, apply) {
|
|
29
|
+
const [segment, ...rest] = segments;
|
|
30
|
+
if (segment === void 0) return apply(node);
|
|
31
|
+
if (isArraySchema(node)) {
|
|
32
|
+
if (!node.items) return void 0;
|
|
33
|
+
const items = patchNode(node.items, {}, segments, apply);
|
|
34
|
+
return items && { ...node, items };
|
|
35
|
+
}
|
|
36
|
+
const objectValue = collections.isPlainObject(nodeValue) ? nodeValue : {};
|
|
37
|
+
const child = jsonSchemaFormConditionals.effectiveProperties(node, objectValue).properties[segment];
|
|
38
|
+
if (!child) return void 0;
|
|
39
|
+
const patchedChild = patchNode(child, objectValue[segment], rest, apply);
|
|
40
|
+
return patchedChild && {
|
|
41
|
+
...node,
|
|
42
|
+
allOf: [...node.allOf ?? [], { properties: { [segment]: patchedChild } }]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function isArraySchema(node) {
|
|
46
|
+
if (node.items !== void 0) return true;
|
|
47
|
+
return Array.isArray(node.type) ? node.type.includes("array") : node.type === "array";
|
|
48
|
+
}
|
|
49
|
+
exports.isPathTarget = isPathTarget;
|
|
50
|
+
exports.patchTarget = patchTarget;
|
|
51
|
+
exports.targetSegments = targetSegments;
|
|
52
|
+
//# sourceMappingURL=json-schema-form-listener-paths.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-listener-paths.cjs","sources":["../../src/components/json-schema-form-listener-paths.ts"],"sourcesContent":["import { isPlainObject } from \"../lib/collections\";\nimport { effectiveProperties } from \"./json-schema-form-conditionals\";\nimport type { JsonSchemaObject, JsonSchemaProperty } from \"./json-schema-form-types\";\n\n// Listener path targets: `mf/Group/Cell` names a property inside a sibling's\n// subtree. The first segment is a sibling key; each later segment names a\n// property of the object reached so far, and an array is crossed into its\n// `items` without spending a segment.\n\nconst SEPARATOR = \"/\";\n\nexport function isPathTarget(target: string): boolean {\n return target.includes(SEPARATOR);\n}\n\n// targetSegments splits a target into its segments, throwing on an empty one\n// (`a//b`, a leading or a trailing `/`), which can only be a typo.\nexport function targetSegments(label: string, target: string): string[] {\n const segments = target.split(SEPARATOR);\n if (segments.some((segment) => segment === \"\")) {\n throw new Error(`${label}: target \"${target}\" has an empty path segment`);\n }\n return segments;\n}\n\n// patchTarget rewrites the property a target names, in place on `properties`\n// (the effective properties of the object being rendered, whose `value` is\n// given). A plain key is replaced by `apply(prop)`. A path clones the sibling\n// along the way: at each object node the patched child goes into a trailing\n// unconditional `allOf` member, which wins the effectiveProperties merge\n// without touching the node's own properties or conditional branches, so two\n// paths under one sibling both survive. A segment the current shape does not\n// declare leaves the sibling untouched.\nexport function patchTarget({\n properties,\n value,\n target,\n apply,\n}: {\n properties: Record<string, JsonSchemaProperty>;\n value: Record<string, unknown>;\n target: string;\n apply: (leaf: JsonSchemaProperty) => JsonSchemaProperty;\n}): void {\n const [first = \"\", ...rest] = target.split(SEPARATOR);\n const prop = properties[first];\n if (!prop) return;\n const patched = patchNode(prop, value[first], rest, apply);\n if (patched) properties[first] = patched;\n}\n\nfunction patchNode(\n node: JsonSchemaProperty,\n nodeValue: unknown,\n segments: string[],\n apply: (leaf: JsonSchemaProperty) => JsonSchemaProperty,\n): JsonSchemaProperty | undefined {\n const [segment, ...rest] = segments;\n if (segment === undefined) return apply(node);\n if (isArraySchema(node)) {\n // Column-level by design: one `items` schema serves every row, so a path\n // into an array patches the column. Row-scoped state comes from the item\n // schema's own x-on-load/x-on-change, evaluated per row by the renderers.\n if (!node.items) return undefined;\n const items = patchNode(node.items, {}, segments, apply);\n return items && { ...node, items };\n }\n const objectValue = isPlainObject(nodeValue) ? nodeValue : {};\n const child = effectiveProperties(node as JsonSchemaObject, objectValue).properties[segment];\n if (!child) return undefined;\n const patchedChild = patchNode(child, objectValue[segment], rest, apply);\n return (\n patchedChild && {\n ...node,\n allOf: [...(node.allOf ?? []), { properties: { [segment]: patchedChild } }],\n }\n );\n}\n\nfunction isArraySchema(node: JsonSchemaProperty): boolean {\n if (node.items !== undefined) return true;\n return Array.isArray(node.type) ? node.type.includes(\"array\") : node.type === \"array\";\n}\n"],"names":["isPlainObject","effectiveProperties"],"mappings":";;;;AASA,MAAM,YAAY;AAEX,SAAS,aAAa,QAAyB;AACpD,SAAO,OAAO,SAAS,SAAS;AAClC;AAIO,SAAS,eAAe,OAAe,QAA0B;AACtE,QAAM,WAAW,OAAO,MAAM,SAAS;AACvC,MAAI,SAAS,KAAK,CAAC,YAAY,YAAY,EAAE,GAAG;AAC9C,UAAM,IAAI,MAAM,GAAG,KAAK,aAAa,MAAM,6BAA6B;AAAA,EAC1E;AACA,SAAO;AACT;AAUO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKS;AACP,QAAM,CAAC,QAAQ,IAAI,GAAG,IAAI,IAAI,OAAO,MAAM,SAAS;AACpD,QAAM,OAAO,WAAW,KAAK;AAC7B,MAAI,CAAC,KAAM;AACX,QAAM,UAAU,UAAU,MAAM,MAAM,KAAK,GAAG,MAAM,KAAK;AACzD,MAAI,QAAS,YAAW,KAAK,IAAI;AACnC;AAEA,SAAS,UACP,MACA,WACA,UACA,OACgC;AAChC,QAAM,CAAC,SAAS,GAAG,IAAI,IAAI;AAC3B,MAAI,YAAY,OAAW,QAAO,MAAM,IAAI;AAC5C,MAAI,cAAc,IAAI,GAAG;AAIvB,QAAI,CAAC,KAAK,MAAO,QAAO;AACxB,UAAM,QAAQ,UAAU,KAAK,OAAO,CAAA,GAAI,UAAU,KAAK;AACvD,WAAO,SAAS,EAAE,GAAG,MAAM,MAAA;AAAA,EAC7B;AACA,QAAM,cAAcA,YAAAA,cAAc,SAAS,IAAI,YAAY,CAAA;AAC3D,QAAM,QAAQC,2BAAAA,oBAAoB,MAA0B,WAAW,EAAE,WAAW,OAAO;AAC3F,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,eAAe,UAAU,OAAO,YAAY,OAAO,GAAG,MAAM,KAAK;AACvE,SACE,gBAAgB;AAAA,IACd,GAAG;AAAA,IACH,OAAO,CAAC,GAAI,KAAK,SAAS,CAAA,GAAK,EAAE,YAAY,EAAE,CAAC,OAAO,GAAG,gBAAgB;AAAA,EAAA;AAGhF;AAEA,SAAS,cAAc,MAAmC;AACxD,MAAI,KAAK,UAAU,OAAW,QAAO;AACrC,SAAO,MAAM,QAAQ,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,OAAO,IAAI,KAAK,SAAS;AAChF;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JsonSchemaProperty } from './json-schema-form-types.js';
|
|
2
|
+
export declare function isPathTarget(target: string): boolean;
|
|
3
|
+
export declare function targetSegments(label: string, target: string): string[];
|
|
4
|
+
export declare function patchTarget({ properties, value, target, apply, }: {
|
|
5
|
+
properties: Record<string, JsonSchemaProperty>;
|
|
6
|
+
value: Record<string, unknown>;
|
|
7
|
+
target: string;
|
|
8
|
+
apply: (leaf: JsonSchemaProperty) => JsonSchemaProperty;
|
|
9
|
+
}): void;
|
|
10
|
+
//# sourceMappingURL=json-schema-form-listener-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-listener-paths.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-listener-paths.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AASrF,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpD;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAMtE;AAUD,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,KAAK,EACL,MAAM,EACN,KAAK,GACN,EAAE;IACD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,kBAAkB,CAAC;CACzD,GAAG,IAAI,CAMP"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isPlainObject } from "../lib/collections.js";
|
|
2
|
+
import { effectiveProperties } from "./json-schema-form-conditionals.js";
|
|
3
|
+
const SEPARATOR = "/";
|
|
4
|
+
function isPathTarget(target) {
|
|
5
|
+
return target.includes(SEPARATOR);
|
|
6
|
+
}
|
|
7
|
+
function targetSegments(label, target) {
|
|
8
|
+
const segments = target.split(SEPARATOR);
|
|
9
|
+
if (segments.some((segment) => segment === "")) {
|
|
10
|
+
throw new Error(`${label}: target "${target}" has an empty path segment`);
|
|
11
|
+
}
|
|
12
|
+
return segments;
|
|
13
|
+
}
|
|
14
|
+
function patchTarget({
|
|
15
|
+
properties,
|
|
16
|
+
value,
|
|
17
|
+
target,
|
|
18
|
+
apply
|
|
19
|
+
}) {
|
|
20
|
+
const [first = "", ...rest] = target.split(SEPARATOR);
|
|
21
|
+
const prop = properties[first];
|
|
22
|
+
if (!prop) return;
|
|
23
|
+
const patched = patchNode(prop, value[first], rest, apply);
|
|
24
|
+
if (patched) properties[first] = patched;
|
|
25
|
+
}
|
|
26
|
+
function patchNode(node, nodeValue, segments, apply) {
|
|
27
|
+
const [segment, ...rest] = segments;
|
|
28
|
+
if (segment === void 0) return apply(node);
|
|
29
|
+
if (isArraySchema(node)) {
|
|
30
|
+
if (!node.items) return void 0;
|
|
31
|
+
const items = patchNode(node.items, {}, segments, apply);
|
|
32
|
+
return items && { ...node, items };
|
|
33
|
+
}
|
|
34
|
+
const objectValue = isPlainObject(nodeValue) ? nodeValue : {};
|
|
35
|
+
const child = effectiveProperties(node, objectValue).properties[segment];
|
|
36
|
+
if (!child) return void 0;
|
|
37
|
+
const patchedChild = patchNode(child, objectValue[segment], rest, apply);
|
|
38
|
+
return patchedChild && {
|
|
39
|
+
...node,
|
|
40
|
+
allOf: [...node.allOf ?? [], { properties: { [segment]: patchedChild } }]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function isArraySchema(node) {
|
|
44
|
+
if (node.items !== void 0) return true;
|
|
45
|
+
return Array.isArray(node.type) ? node.type.includes("array") : node.type === "array";
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
isPathTarget,
|
|
49
|
+
patchTarget,
|
|
50
|
+
targetSegments
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=json-schema-form-listener-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-listener-paths.js","sources":["../../src/components/json-schema-form-listener-paths.ts"],"sourcesContent":["import { isPlainObject } from \"../lib/collections\";\nimport { effectiveProperties } from \"./json-schema-form-conditionals\";\nimport type { JsonSchemaObject, JsonSchemaProperty } from \"./json-schema-form-types\";\n\n// Listener path targets: `mf/Group/Cell` names a property inside a sibling's\n// subtree. The first segment is a sibling key; each later segment names a\n// property of the object reached so far, and an array is crossed into its\n// `items` without spending a segment.\n\nconst SEPARATOR = \"/\";\n\nexport function isPathTarget(target: string): boolean {\n return target.includes(SEPARATOR);\n}\n\n// targetSegments splits a target into its segments, throwing on an empty one\n// (`a//b`, a leading or a trailing `/`), which can only be a typo.\nexport function targetSegments(label: string, target: string): string[] {\n const segments = target.split(SEPARATOR);\n if (segments.some((segment) => segment === \"\")) {\n throw new Error(`${label}: target \"${target}\" has an empty path segment`);\n }\n return segments;\n}\n\n// patchTarget rewrites the property a target names, in place on `properties`\n// (the effective properties of the object being rendered, whose `value` is\n// given). A plain key is replaced by `apply(prop)`. A path clones the sibling\n// along the way: at each object node the patched child goes into a trailing\n// unconditional `allOf` member, which wins the effectiveProperties merge\n// without touching the node's own properties or conditional branches, so two\n// paths under one sibling both survive. A segment the current shape does not\n// declare leaves the sibling untouched.\nexport function patchTarget({\n properties,\n value,\n target,\n apply,\n}: {\n properties: Record<string, JsonSchemaProperty>;\n value: Record<string, unknown>;\n target: string;\n apply: (leaf: JsonSchemaProperty) => JsonSchemaProperty;\n}): void {\n const [first = \"\", ...rest] = target.split(SEPARATOR);\n const prop = properties[first];\n if (!prop) return;\n const patched = patchNode(prop, value[first], rest, apply);\n if (patched) properties[first] = patched;\n}\n\nfunction patchNode(\n node: JsonSchemaProperty,\n nodeValue: unknown,\n segments: string[],\n apply: (leaf: JsonSchemaProperty) => JsonSchemaProperty,\n): JsonSchemaProperty | undefined {\n const [segment, ...rest] = segments;\n if (segment === undefined) return apply(node);\n if (isArraySchema(node)) {\n // Column-level by design: one `items` schema serves every row, so a path\n // into an array patches the column. Row-scoped state comes from the item\n // schema's own x-on-load/x-on-change, evaluated per row by the renderers.\n if (!node.items) return undefined;\n const items = patchNode(node.items, {}, segments, apply);\n return items && { ...node, items };\n }\n const objectValue = isPlainObject(nodeValue) ? nodeValue : {};\n const child = effectiveProperties(node as JsonSchemaObject, objectValue).properties[segment];\n if (!child) return undefined;\n const patchedChild = patchNode(child, objectValue[segment], rest, apply);\n return (\n patchedChild && {\n ...node,\n allOf: [...(node.allOf ?? []), { properties: { [segment]: patchedChild } }],\n }\n );\n}\n\nfunction isArraySchema(node: JsonSchemaProperty): boolean {\n if (node.items !== undefined) return true;\n return Array.isArray(node.type) ? node.type.includes(\"array\") : node.type === \"array\";\n}\n"],"names":[],"mappings":";;AASA,MAAM,YAAY;AAEX,SAAS,aAAa,QAAyB;AACpD,SAAO,OAAO,SAAS,SAAS;AAClC;AAIO,SAAS,eAAe,OAAe,QAA0B;AACtE,QAAM,WAAW,OAAO,MAAM,SAAS;AACvC,MAAI,SAAS,KAAK,CAAC,YAAY,YAAY,EAAE,GAAG;AAC9C,UAAM,IAAI,MAAM,GAAG,KAAK,aAAa,MAAM,6BAA6B;AAAA,EAC1E;AACA,SAAO;AACT;AAUO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKS;AACP,QAAM,CAAC,QAAQ,IAAI,GAAG,IAAI,IAAI,OAAO,MAAM,SAAS;AACpD,QAAM,OAAO,WAAW,KAAK;AAC7B,MAAI,CAAC,KAAM;AACX,QAAM,UAAU,UAAU,MAAM,MAAM,KAAK,GAAG,MAAM,KAAK;AACzD,MAAI,QAAS,YAAW,KAAK,IAAI;AACnC;AAEA,SAAS,UACP,MACA,WACA,UACA,OACgC;AAChC,QAAM,CAAC,SAAS,GAAG,IAAI,IAAI;AAC3B,MAAI,YAAY,OAAW,QAAO,MAAM,IAAI;AAC5C,MAAI,cAAc,IAAI,GAAG;AAIvB,QAAI,CAAC,KAAK,MAAO,QAAO;AACxB,UAAM,QAAQ,UAAU,KAAK,OAAO,CAAA,GAAI,UAAU,KAAK;AACvD,WAAO,SAAS,EAAE,GAAG,MAAM,MAAA;AAAA,EAC7B;AACA,QAAM,cAAc,cAAc,SAAS,IAAI,YAAY,CAAA;AAC3D,QAAM,QAAQ,oBAAoB,MAA0B,WAAW,EAAE,WAAW,OAAO;AAC3F,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,eAAe,UAAU,OAAO,YAAY,OAAO,GAAG,MAAM,KAAK;AACvE,SACE,gBAAgB;AAAA,IACd,GAAG;AAAA,IACH,OAAO,CAAC,GAAI,KAAK,SAAS,CAAA,GAAK,EAAE,YAAY,EAAE,CAAC,OAAO,GAAG,gBAAgB;AAAA,EAAA;AAGhF;AAEA,SAAS,cAAc,MAAmC;AACxD,MAAI,KAAK,UAAU,OAAW,QAAO;AACrC,SAAO,MAAM,QAAQ,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,OAAO,IAAI,KAAK,SAAS;AAChF;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JsonSchemaProperty } from './json-schema-form-types.js';
|
|
2
|
+
export interface ChangeActions {
|
|
3
|
+
hide?: string[];
|
|
4
|
+
show?: string[];
|
|
5
|
+
enable?: string[];
|
|
6
|
+
disable?: string[];
|
|
7
|
+
require?: string[];
|
|
8
|
+
optional?: string[];
|
|
9
|
+
reset?: string[];
|
|
10
|
+
set?: Record<string, unknown>;
|
|
11
|
+
patch?: Record<string, ChangePatch>;
|
|
12
|
+
}
|
|
13
|
+
export type ChangePatchDeniedKeyword = "type" | "properties" | "items" | "additionalProperties" | "patternProperties" | "allOf" | "anyOf" | "oneOf" | "if" | "then" | "else" | "not" | "required" | "default" | "const" | "x-on-change" | "x-on-load";
|
|
14
|
+
export type ChangePatch = Omit<Partial<JsonSchemaProperty>, ChangePatchDeniedKeyword>;
|
|
15
|
+
export interface ChangeCondition extends JsonSchemaProperty {
|
|
16
|
+
expr?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ChangeListener extends ChangeActions {
|
|
19
|
+
when?: ChangeCondition;
|
|
20
|
+
else?: ChangeActions;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=json-schema-form-listener-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-listener-types.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-listener-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAmBnE,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAO9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACrC;AAGD,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,YAAY,GACZ,OAAO,GACP,sBAAsB,GACtB,mBAAmB,GACnB,OAAO,GACP,OAAO,GACP,OAAO,GACP,IAAI,GACJ,MAAM,GACN,MAAM,GACN,KAAK,GACL,UAAU,GACV,SAAS,GACT,OAAO,GACP,aAAa,GACb,WAAW,CAAC;AAEhB,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,wBAAwB,CAAC,CAAC;AAMtF,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAKD,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const collections = require("../lib/collections.cjs");
|
|
4
|
+
const jsonSchemaFormConditionals = require("./json-schema-form-conditionals.cjs");
|
|
5
|
+
const jsonSchemaFormDefaults = require("./json-schema-form-defaults.cjs");
|
|
6
|
+
const jsonSchemaFormListenerPaths = require("./json-schema-form-listener-paths.cjs");
|
|
7
|
+
const LOCAL_ACTIONS = ["require", "optional", "reset", "set"];
|
|
8
|
+
const STATE_FLAGS = [
|
|
9
|
+
["hide", "x-hidden", true],
|
|
10
|
+
["show", "x-hidden", false],
|
|
11
|
+
["disable", "x-disabled", true],
|
|
12
|
+
["enable", "x-disabled", false]
|
|
13
|
+
];
|
|
14
|
+
const CONTRADICTIONS = [
|
|
15
|
+
["hide", "show"],
|
|
16
|
+
["enable", "disable"],
|
|
17
|
+
["require", "optional"]
|
|
18
|
+
];
|
|
19
|
+
const LIST_NAMES = ["hide", "show", "enable", "disable", "require", "optional", "reset"];
|
|
20
|
+
const PATCH_DENIED = {
|
|
21
|
+
...Object.fromEntries(
|
|
22
|
+
["type", "properties", "items", "additionalProperties", "patternProperties", "allOf", "anyOf", "oneOf", "if", "then", "else", "not", "$ref", "$defs"].map(
|
|
23
|
+
(keyword) => [keyword, "it changes the field's shape; use an allOf branch"]
|
|
24
|
+
)
|
|
25
|
+
),
|
|
26
|
+
required: "use require/optional",
|
|
27
|
+
default: "a patch changes presentation, not values; use set/reset",
|
|
28
|
+
const: "a patch changes presentation, not values; use set/reset",
|
|
29
|
+
"x-on-change": "listeners cannot be patched in",
|
|
30
|
+
"x-on-load": "listeners cannot be patched in"
|
|
31
|
+
};
|
|
32
|
+
function applyListenerState(schema, value, options) {
|
|
33
|
+
const { properties, required } = jsonSchemaFormConditionals.effectiveProperties(schema, value);
|
|
34
|
+
const requiredSet = new Set(required);
|
|
35
|
+
const known = declaredKeys(schema);
|
|
36
|
+
const bound = [
|
|
37
|
+
...loadListenersOf(schema, value),
|
|
38
|
+
...Object.entries(properties).flatMap(
|
|
39
|
+
([key, prop]) => listenersOf(key, prop).map((listener) => ({ listener, source: changeSource(key) }))
|
|
40
|
+
)
|
|
41
|
+
];
|
|
42
|
+
for (const { listener, source } of bound) {
|
|
43
|
+
const actions = selectActions({ listener, source, self: value, known, options });
|
|
44
|
+
for (const [name, keyword, flag] of STATE_FLAGS) {
|
|
45
|
+
for (const target of list(actions, name)) {
|
|
46
|
+
jsonSchemaFormListenerPaths.patchTarget({ properties, value, target, apply: (leaf) => ({ ...leaf, [keyword]: flag }) });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
for (const target of list(actions, "require")) {
|
|
50
|
+
if (properties[target]) requiredSet.add(target);
|
|
51
|
+
}
|
|
52
|
+
for (const target of list(actions, "optional")) requiredSet.delete(target);
|
|
53
|
+
for (const [target, keywords] of Object.entries(actions.patch ?? {})) {
|
|
54
|
+
jsonSchemaFormListenerPaths.patchTarget({ properties, value, target, apply: (leaf) => ({ ...leaf, ...keywords }) });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { properties, required: [...requiredSet] };
|
|
58
|
+
}
|
|
59
|
+
function loadListenersOf(schema, value) {
|
|
60
|
+
var _a;
|
|
61
|
+
const bound = loadListenersAt(schema["x-on-load"], "#/x-on-load");
|
|
62
|
+
for (const [index, clause] of (schema.allOf ?? []).entries()) {
|
|
63
|
+
if (clause.if === void 0 && clause.then === void 0) {
|
|
64
|
+
bound.push(...loadListenersAt(clause["x-on-load"], `#/allOf/${index}/x-on-load`));
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const branch = jsonSchemaFormConditionals.matchesIf(clause.if, value) ? "then" : "else";
|
|
68
|
+
bound.push(...loadListenersAt((_a = clause[branch]) == null ? void 0 : _a["x-on-load"], `#/allOf/${index}/${branch}/x-on-load`));
|
|
69
|
+
}
|
|
70
|
+
return bound;
|
|
71
|
+
}
|
|
72
|
+
function loadListenersAt(listeners, pointer) {
|
|
73
|
+
if (listeners === void 0) return [];
|
|
74
|
+
if (!Array.isArray(listeners)) {
|
|
75
|
+
throw new Error(`x-on-load at ${pointer} must be an array of listeners, got ${typeof listeners}`);
|
|
76
|
+
}
|
|
77
|
+
return listeners.map((listener, index) => ({
|
|
78
|
+
listener,
|
|
79
|
+
source: { label: `x-on-load at ${pointer}/${index}`, key: "", load: true }
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
function changeSource(key) {
|
|
83
|
+
return { label: `x-on-change on "${key}"`, key, load: false };
|
|
84
|
+
}
|
|
85
|
+
function applyChangeEffects(schema, edit) {
|
|
86
|
+
let current = { ...edit.value, [edit.key]: edit.next };
|
|
87
|
+
const known = declaredKeys(schema);
|
|
88
|
+
const fired = /* @__PURE__ */ new Set();
|
|
89
|
+
const queue = [edit.key];
|
|
90
|
+
for (let source = queue.shift(); source !== void 0; source = queue.shift()) {
|
|
91
|
+
if (fired.has(source)) continue;
|
|
92
|
+
fired.add(source);
|
|
93
|
+
const { properties } = jsonSchemaFormConditionals.effectiveProperties(schema, current);
|
|
94
|
+
const options = {
|
|
95
|
+
root: edit.root === edit.value ? current : edit.root,
|
|
96
|
+
...edit.evaluate ? { evaluate: edit.evaluate } : {}
|
|
97
|
+
};
|
|
98
|
+
for (const listener of listenersOf(source, properties[source])) {
|
|
99
|
+
const actions = selectActions({ listener, source: changeSource(source), self: current, known, options });
|
|
100
|
+
for (const [target, nextValue] of valueChanges(actions, properties)) {
|
|
101
|
+
if (Object.is(current[target], nextValue)) continue;
|
|
102
|
+
current = { ...current };
|
|
103
|
+
if (nextValue === void 0) delete current[target];
|
|
104
|
+
else current[target] = nextValue;
|
|
105
|
+
queue.push(target);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return current;
|
|
110
|
+
}
|
|
111
|
+
function valueChanges(actions, properties) {
|
|
112
|
+
return [
|
|
113
|
+
...list(actions, "reset").map((target) => {
|
|
114
|
+
var _a;
|
|
115
|
+
const fallback = (_a = properties[target]) == null ? void 0 : _a.default;
|
|
116
|
+
return [target, fallback === void 0 ? void 0 : jsonSchemaFormDefaults.cloneSchemaDefault(fallback)];
|
|
117
|
+
}),
|
|
118
|
+
...Object.entries(actions.set ?? {}).map(([target, v]) => [target, jsonSchemaFormDefaults.cloneSchemaDefault(v)])
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
function listenersOf(key, prop) {
|
|
122
|
+
const listeners = prop == null ? void 0 : prop["x-on-change"];
|
|
123
|
+
if (listeners === void 0) return [];
|
|
124
|
+
if (!Array.isArray(listeners)) {
|
|
125
|
+
throw new Error(`"${key}": x-on-change must be an array of listeners, got ${typeof listeners}`);
|
|
126
|
+
}
|
|
127
|
+
return listeners;
|
|
128
|
+
}
|
|
129
|
+
function selectActions({
|
|
130
|
+
listener,
|
|
131
|
+
source,
|
|
132
|
+
self,
|
|
133
|
+
known,
|
|
134
|
+
options
|
|
135
|
+
}) {
|
|
136
|
+
validateActions(source, listener, known);
|
|
137
|
+
if (listener.else) validateActions(source, listener.else, known);
|
|
138
|
+
return listenerHolds(listener, source, self, options) ? listener : listener.else ?? {};
|
|
139
|
+
}
|
|
140
|
+
function listenerHolds(listener, { label, key, load }, self, options) {
|
|
141
|
+
if (listener.when === void 0) return true;
|
|
142
|
+
const { expr, ...predicate } = listener.when;
|
|
143
|
+
const hasPredicate = Object.keys(predicate).length > 0;
|
|
144
|
+
const subject = load ? self : self[key];
|
|
145
|
+
if (!hasPredicate && expr === void 0) {
|
|
146
|
+
throw new Error(`${label}: when states nothing it can evaluate`);
|
|
147
|
+
}
|
|
148
|
+
if (expr !== void 0 && typeof expr !== "string") {
|
|
149
|
+
throw new Error(`${label}: when.expr must be a string, got ${typeof expr}`);
|
|
150
|
+
}
|
|
151
|
+
if (expr !== void 0 && !options.evaluate) {
|
|
152
|
+
throw new Error(`${label}: when.expr "${expr}" needs the form's expressionEvaluator`);
|
|
153
|
+
}
|
|
154
|
+
if (hasPredicate) {
|
|
155
|
+
const holds = jsonSchemaFormConditionals.evaluatePredicate(predicate, subject);
|
|
156
|
+
if (holds === void 0) {
|
|
157
|
+
throw new Error(`${label}: when states nothing it can evaluate (${JSON.stringify(predicate)})`);
|
|
158
|
+
}
|
|
159
|
+
if (!holds) return false;
|
|
160
|
+
}
|
|
161
|
+
if (expr === void 0 || !options.evaluate) return true;
|
|
162
|
+
const result = options.evaluate({ expr, key, value: subject, self, root: options.root });
|
|
163
|
+
if (typeof result !== "boolean") {
|
|
164
|
+
throw new Error(`${label}: expressionEvaluator returned ${typeof result} for "${expr}", expected boolean`);
|
|
165
|
+
}
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
function validateActions(source, actions, known) {
|
|
169
|
+
const { label } = source;
|
|
170
|
+
if (actions.set !== void 0 && !collections.isPlainObject(actions.set)) {
|
|
171
|
+
throw new Error(`${label}: set must be an object of target → value`);
|
|
172
|
+
}
|
|
173
|
+
if (source.load) {
|
|
174
|
+
const local = LOCAL_ACTIONS.find((name) => actions[name] !== void 0);
|
|
175
|
+
if (local) {
|
|
176
|
+
throw new Error(`${label}: ${local} is not allowed in x-on-load, which only derives state (hide/show/enable/disable/patch)`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const setKeys = Object.keys(actions.set ?? {});
|
|
180
|
+
for (const name of LOCAL_ACTIONS) {
|
|
181
|
+
const targets = name === "set" ? setKeys : list(actions, name);
|
|
182
|
+
const path = targets.find(jsonSchemaFormListenerPaths.isPathTarget);
|
|
183
|
+
if (path !== void 0) {
|
|
184
|
+
throw new Error(`${label}: ${name} "${path}" cannot take a path; value and required actions act on sibling keys only`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
for (const target of [...LIST_NAMES.flatMap((name) => list(actions, name)), ...setKeys]) {
|
|
188
|
+
validateTarget(label, target, known);
|
|
189
|
+
}
|
|
190
|
+
const pairs = [
|
|
191
|
+
...CONTRADICTIONS.map(([a, b]) => [a, list(actions, a), b, list(actions, b)]),
|
|
192
|
+
["reset", list(actions, "reset"), "set", setKeys]
|
|
193
|
+
];
|
|
194
|
+
for (const [a, left, b, right] of pairs) {
|
|
195
|
+
const clash = left.find((target) => right.includes(target));
|
|
196
|
+
if (clash !== void 0) {
|
|
197
|
+
throw new Error(`${label}: both ${a} and ${b} "${clash}"`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
validatePatch(label, actions, known);
|
|
201
|
+
}
|
|
202
|
+
function validateTarget(label, target, known) {
|
|
203
|
+
if (jsonSchemaFormListenerPaths.isPathTarget(target) && known.has(target)) {
|
|
204
|
+
throw new Error(`${label}: target "${target}" is both a declared key and a path`);
|
|
205
|
+
}
|
|
206
|
+
const [first = ""] = jsonSchemaFormListenerPaths.targetSegments(label, target);
|
|
207
|
+
if (!known.has(first)) throw new Error(`${label}: unknown target "${target}"`);
|
|
208
|
+
}
|
|
209
|
+
function validatePatch(label, actions, known) {
|
|
210
|
+
const patch = actions.patch;
|
|
211
|
+
if (patch === void 0) return;
|
|
212
|
+
if (!collections.isPlainObject(patch)) {
|
|
213
|
+
throw new Error(`${label}: patch must be an object of target → keywords`);
|
|
214
|
+
}
|
|
215
|
+
for (const [target, keywords] of Object.entries(patch)) {
|
|
216
|
+
validateTarget(label, target, known);
|
|
217
|
+
if (!collections.isPlainObject(keywords)) {
|
|
218
|
+
throw new Error(`${label}: patch "${target}" must be an object of keywords`);
|
|
219
|
+
}
|
|
220
|
+
for (const keyword of Object.keys(keywords)) {
|
|
221
|
+
const denied = PATCH_DENIED[keyword];
|
|
222
|
+
if (denied) throw new Error(`${label}: patch "${target}" may not set ${keyword} (${denied})`);
|
|
223
|
+
}
|
|
224
|
+
for (const [verb, keyword] of STATE_FLAGS) {
|
|
225
|
+
if (keyword in keywords && list(actions, verb).includes(target)) {
|
|
226
|
+
throw new Error(`${label}: both ${verb} and patch ${keyword} on "${target}"`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function list(actions, name) {
|
|
232
|
+
const targets = actions[name];
|
|
233
|
+
if (targets === void 0) return [];
|
|
234
|
+
if (!Array.isArray(targets)) {
|
|
235
|
+
throw new Error(`x-on-change: ${name} must be an array of property keys, got ${typeof targets}`);
|
|
236
|
+
}
|
|
237
|
+
return targets;
|
|
238
|
+
}
|
|
239
|
+
function declaredKeys(schema) {
|
|
240
|
+
const keys = new Set(Object.keys(schema.properties ?? {}));
|
|
241
|
+
for (const clause of schema.allOf ?? []) {
|
|
242
|
+
for (const branch of [clause, clause.then, clause.else]) {
|
|
243
|
+
for (const key of Object.keys((branch == null ? void 0 : branch.properties) ?? {})) keys.add(key);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return keys;
|
|
247
|
+
}
|
|
248
|
+
exports.applyChangeEffects = applyChangeEffects;
|
|
249
|
+
exports.applyListenerState = applyListenerState;
|
|
250
|
+
//# sourceMappingURL=json-schema-form-listeners.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-listeners.cjs","sources":["../../src/components/json-schema-form-listeners.ts"],"sourcesContent":["import { isPlainObject } from \"../lib/collections\";\nimport {\n effectiveProperties,\n evaluatePredicate,\n matchesIf,\n type EffectiveProperties,\n} from \"./json-schema-form-conditionals\";\nimport { cloneSchemaDefault } from \"./json-schema-form-defaults\";\nimport { isPathTarget, patchTarget, targetSegments } from \"./json-schema-form-listener-paths\";\nimport type {\n ChangeActions,\n ChangeListener,\n ExpressionEvaluator,\n JsonSchemaObject,\n JsonSchemaProperty,\n} from \"./json-schema-form-types\";\n\n// `x-on-change` listeners: a property names what happens to its siblings when\n// its value is, or becomes, something. `x-on-load` listeners: an object names\n// the state its properties start in. See ChangeActions for the split between\n// derived state actions and transitional value actions.\n\nexport interface ListenerOptions {\n root: Record<string, unknown>;\n evaluate?: ExpressionEvaluator;\n}\n\n// ListenerSource says where a listener came from. `label` prefixes every error\n// it raises; `key` is the property whose value `when` reads (and the\n// evaluator's `key`) — for x-on-load, \"\" and the object itself.\ninterface ListenerSource {\n label: string;\n key: string;\n load: boolean;\n}\n\ninterface BoundListener {\n listener: ChangeListener;\n source: ListenerSource;\n}\n\ntype ListName = \"hide\" | \"show\" | \"enable\" | \"disable\" | \"require\" | \"optional\" | \"reset\";\n\n// Actions that write values or required-ness: they act on sibling keys only\n// (never a path), and have no place in x-on-load, which only derives state.\nconst LOCAL_ACTIONS: (\"require\" | \"optional\" | \"reset\" | \"set\")[] = [\"require\", \"optional\", \"reset\", \"set\"];\n\nconst STATE_FLAGS: [ListName, \"x-hidden\" | \"x-disabled\", boolean][] = [\n [\"hide\", \"x-hidden\", true],\n [\"show\", \"x-hidden\", false],\n [\"disable\", \"x-disabled\", true],\n [\"enable\", \"x-disabled\", false],\n];\n\nconst CONTRADICTIONS: [ListName, ListName][] = [\n [\"hide\", \"show\"],\n [\"enable\", \"disable\"],\n [\"require\", \"optional\"],\n];\n\nconst LIST_NAMES: ListName[] = [\"hide\", \"show\", \"enable\", \"disable\", \"require\", \"optional\", \"reset\"];\n\n// Keywords a `patch` may not set, with the tool that does the job instead.\nconst PATCH_DENIED: Record<string, string> = {\n ...Object.fromEntries(\n [\"type\", \"properties\", \"items\", \"additionalProperties\", \"patternProperties\", \"allOf\", \"anyOf\", \"oneOf\", \"if\", \"then\", \"else\", \"not\", \"$ref\", \"$defs\"].map(\n (keyword) => [keyword, \"it changes the field's shape; use an allOf branch\"],\n ),\n ),\n required: \"use require/optional\",\n default: \"a patch changes presentation, not values; use set/reset\",\n const: \"a patch changes presentation, not values; use set/reset\",\n \"x-on-change\": \"listeners cannot be patched in\",\n \"x-on-load\": \"listeners cannot be patched in\",\n};\n\n// applyListenerState is effectiveProperties plus the state actions of every\n// listener, evaluated against the current value: first the object's\n// `x-on-load` listeners, then each property's `x-on-change` listeners — load,\n// then change, the order the events happen in. A listener is applied after\n// `allOf`, so it wins over a branch; later listeners win over earlier ones. A\n// target the current shape does not declare stays absent. Property schemas are\n// cloned, never mutated.\nexport function applyListenerState(\n schema: JsonSchemaObject,\n value: Record<string, unknown>,\n options: ListenerOptions,\n): EffectiveProperties {\n const { properties, required } = effectiveProperties(schema, value);\n const requiredSet = new Set(required);\n const known = declaredKeys(schema);\n const bound: BoundListener[] = [\n ...loadListenersOf(schema, value),\n ...Object.entries(properties).flatMap(([key, prop]) =>\n listenersOf(key, prop).map((listener) => ({ listener, source: changeSource(key) })),\n ),\n ];\n for (const { listener, source } of bound) {\n const actions = selectActions({ listener, source, self: value, known, options });\n for (const [name, keyword, flag] of STATE_FLAGS) {\n for (const target of list(actions, name)) {\n patchTarget({ properties, value, target, apply: (leaf) => ({ ...leaf, [keyword]: flag }) });\n }\n }\n for (const target of list(actions, \"require\")) {\n if (properties[target]) requiredSet.add(target);\n }\n for (const target of list(actions, \"optional\")) requiredSet.delete(target);\n for (const [target, keywords] of Object.entries(actions.patch ?? {})) {\n patchTarget({ properties, value, target, apply: (leaf) => ({ ...leaf, ...keywords }) });\n }\n }\n return { properties, required: [...requiredSet] };\n}\n\n// loadListenersOf collects an object's `x-on-load` listeners in order: the\n// schema's own, then each `allOf` member's — an unconditional member's own, or\n// those of the `then`/`else` branch that applies, selected exactly as\n// effectiveProperties selects the branch it merges.\nfunction loadListenersOf(schema: JsonSchemaObject, value: Record<string, unknown>): BoundListener[] {\n const bound = loadListenersAt(schema[\"x-on-load\"], \"#/x-on-load\");\n for (const [index, clause] of (schema.allOf ?? []).entries()) {\n if (clause.if === undefined && clause.then === undefined) {\n bound.push(...loadListenersAt(clause[\"x-on-load\"], `#/allOf/${index}/x-on-load`));\n continue;\n }\n const branch = matchesIf(clause.if, value) ? \"then\" : \"else\";\n bound.push(...loadListenersAt(clause[branch]?.[\"x-on-load\"], `#/allOf/${index}/${branch}/x-on-load`));\n }\n return bound;\n}\n\nfunction loadListenersAt(listeners: unknown, pointer: string): BoundListener[] {\n if (listeners === undefined) return [];\n if (!Array.isArray(listeners)) {\n throw new Error(`x-on-load at ${pointer} must be an array of listeners, got ${typeof listeners}`);\n }\n return listeners.map((listener: ChangeListener, index) => ({\n listener,\n source: { label: `x-on-load at ${pointer}/${index}`, key: \"\", load: true },\n }));\n}\n\nfunction changeSource(key: string): ListenerSource {\n return { label: `x-on-change on \"${key}\"`, key, load: false };\n}\n\n// applyChangeEffects commits `next` at `key` and runs the value actions\n// (reset/set) of that key's listeners against the post-edit object. A target\n// whose value actually changes fires its own listeners in turn; each key fires\n// at most once per commit, so a cycle ends. When `root` is the edited object\n// itself (the top level), expressions see the post-edit value as root too.\nexport function applyChangeEffects(\n schema: JsonSchemaObject,\n edit: ListenerOptions & { value: Record<string, unknown>; key: string; next: unknown },\n): Record<string, unknown> {\n let current: Record<string, unknown> = { ...edit.value, [edit.key]: edit.next };\n const known = declaredKeys(schema);\n const fired = new Set<string>();\n const queue = [edit.key];\n for (let source = queue.shift(); source !== undefined; source = queue.shift()) {\n if (fired.has(source)) continue;\n fired.add(source);\n const { properties } = effectiveProperties(schema, current);\n const options: ListenerOptions = {\n root: edit.root === edit.value ? current : edit.root,\n ...(edit.evaluate ? { evaluate: edit.evaluate } : {}),\n };\n for (const listener of listenersOf(source, properties[source])) {\n const actions = selectActions({ listener, source: changeSource(source), self: current, known, options });\n for (const [target, nextValue] of valueChanges(actions, properties)) {\n if (Object.is(current[target], nextValue)) continue;\n current = { ...current };\n if (nextValue === undefined) delete current[target];\n else current[target] = nextValue;\n queue.push(target);\n }\n }\n }\n return current;\n}\n\nfunction valueChanges(\n actions: ChangeActions,\n properties: Record<string, JsonSchemaProperty>,\n): [string, unknown][] {\n return [\n ...list(actions, \"reset\").map((target): [string, unknown] => {\n const fallback = properties[target]?.default;\n return [target, fallback === undefined ? undefined : cloneSchemaDefault(fallback)];\n }),\n ...Object.entries(actions.set ?? {}).map(([target, v]): [string, unknown] => [target, cloneSchemaDefault(v)]),\n ];\n}\n\nfunction listenersOf(key: string, prop: JsonSchemaProperty | undefined): ChangeListener[] {\n const listeners = prop?.[\"x-on-change\"];\n if (listeners === undefined) return [];\n if (!Array.isArray(listeners)) {\n throw new Error(`\"${key}\": x-on-change must be an array of listeners, got ${typeof listeners}`);\n }\n return listeners;\n}\n\n// selectActions validates both branches of a listener (so a schema error\n// surfaces whichever branch is live) and returns the one that applies now.\nfunction selectActions({\n listener,\n source,\n self,\n known,\n options,\n}: {\n listener: ChangeListener;\n source: ListenerSource;\n self: Record<string, unknown>;\n known: Set<string>;\n options: ListenerOptions;\n}): ChangeActions {\n validateActions(source, listener, known);\n if (listener.else) validateActions(source, listener.else, known);\n return listenerHolds(listener, source, self, options) ? listener : (listener.else ?? {});\n}\n\n// listenerHolds evaluates `when` against the source's subject: the property's\n// value for x-on-change, the object itself for x-on-load.\nfunction listenerHolds(\n listener: ChangeListener,\n { label, key, load }: ListenerSource,\n self: Record<string, unknown>,\n options: ListenerOptions,\n): boolean {\n if (listener.when === undefined) return true;\n const { expr, ...predicate } = listener.when;\n const hasPredicate = Object.keys(predicate).length > 0;\n const subject = load ? self : self[key];\n if (!hasPredicate && expr === undefined) {\n throw new Error(`${label}: when states nothing it can evaluate`);\n }\n if (expr !== undefined && typeof expr !== \"string\") {\n throw new Error(`${label}: when.expr must be a string, got ${typeof expr}`);\n }\n if (expr !== undefined && !options.evaluate) {\n throw new Error(`${label}: when.expr \"${expr}\" needs the form's expressionEvaluator`);\n }\n if (hasPredicate) {\n const holds = evaluatePredicate(predicate, subject);\n if (holds === undefined) {\n throw new Error(`${label}: when states nothing it can evaluate (${JSON.stringify(predicate)})`);\n }\n if (!holds) return false;\n }\n if (expr === undefined || !options.evaluate) return true;\n const result: unknown = options.evaluate({ expr, key, value: subject, self, root: options.root });\n if (typeof result !== \"boolean\") {\n throw new Error(`${label}: expressionEvaluator returned ${typeof result} for \"${expr}\", expected boolean`);\n }\n return result;\n}\n\nfunction validateActions(source: ListenerSource, actions: ChangeActions, known: Set<string>): void {\n const { label } = source;\n if (actions.set !== undefined && !isPlainObject(actions.set)) {\n throw new Error(`${label}: set must be an object of target → value`);\n }\n if (source.load) {\n const local = LOCAL_ACTIONS.find((name) => actions[name] !== undefined);\n if (local) {\n throw new Error(`${label}: ${local} is not allowed in x-on-load, which only derives state (hide/show/enable/disable/patch)`);\n }\n }\n const setKeys = Object.keys(actions.set ?? {});\n for (const name of LOCAL_ACTIONS) {\n const targets = name === \"set\" ? setKeys : list(actions, name);\n const path = targets.find(isPathTarget);\n if (path !== undefined) {\n throw new Error(`${label}: ${name} \"${path}\" cannot take a path; value and required actions act on sibling keys only`);\n }\n }\n for (const target of [...LIST_NAMES.flatMap((name) => list(actions, name)), ...setKeys]) {\n validateTarget(label, target, known);\n }\n const pairs: [string, string[], string, string[]][] = [\n ...CONTRADICTIONS.map(([a, b]): [string, string[], string, string[]] => [a, list(actions, a), b, list(actions, b)]),\n [\"reset\", list(actions, \"reset\"), \"set\", setKeys],\n ];\n for (const [a, left, b, right] of pairs) {\n const clash = left.find((target) => right.includes(target));\n if (clash !== undefined) {\n throw new Error(`${label}: both ${a} and ${b} \"${clash}\"`);\n }\n }\n validatePatch(label, actions, known);\n}\n\n// validateTarget checks a target's grammar and that its first segment is a key\n// the schema declares in some branch.\nfunction validateTarget(label: string, target: string, known: Set<string>): void {\n if (isPathTarget(target) && known.has(target)) {\n throw new Error(`${label}: target \"${target}\" is both a declared key and a path`);\n }\n const [first = \"\"] = targetSegments(label, target);\n if (!known.has(first)) throw new Error(`${label}: unknown target \"${target}\"`);\n}\n\n// validatePatch checks a `patch`: an object of keyword objects on known\n// targets, no denied keyword, and no keyword a verb in the same actions sets.\nfunction validatePatch(label: string, actions: ChangeActions, known: Set<string>): void {\n const patch: unknown = actions.patch;\n if (patch === undefined) return;\n if (!isPlainObject(patch)) {\n throw new Error(`${label}: patch must be an object of target → keywords`);\n }\n for (const [target, keywords] of Object.entries(patch)) {\n validateTarget(label, target, known);\n if (!isPlainObject(keywords)) {\n throw new Error(`${label}: patch \"${target}\" must be an object of keywords`);\n }\n for (const keyword of Object.keys(keywords)) {\n const denied = PATCH_DENIED[keyword];\n if (denied) throw new Error(`${label}: patch \"${target}\" may not set ${keyword} (${denied})`);\n }\n for (const [verb, keyword] of STATE_FLAGS) {\n if (keyword in keywords && list(actions, verb).includes(target)) {\n throw new Error(`${label}: both ${verb} and patch ${keyword} on \"${target}\"`);\n }\n }\n }\n}\n\nfunction list(actions: ChangeActions, name: ListName): string[] {\n const targets = actions[name];\n if (targets === undefined) return [];\n if (!Array.isArray(targets)) {\n throw new Error(`x-on-change: ${name} must be an array of property keys, got ${typeof targets}`);\n }\n return targets;\n}\n\n// Every key the schema can declare in any branch — a listener may target a\n// field that only exists while some `allOf` branch is live.\nfunction declaredKeys(schema: JsonSchemaObject): Set<string> {\n const keys = new Set(Object.keys(schema.properties ?? {}));\n for (const clause of schema.allOf ?? []) {\n for (const branch of [clause, clause.then, clause.else]) {\n for (const key of Object.keys(branch?.properties ?? {})) keys.add(key);\n }\n }\n return keys;\n}\n"],"names":["effectiveProperties","patchTarget","matchesIf","cloneSchemaDefault","evaluatePredicate","isPlainObject","isPathTarget","targetSegments"],"mappings":";;;;;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AU,OAAO,SAAS,CAAA,GAAI;AACvC,eAAW,UAAU,CAAC,QAAQ,OAAO,MAAM,OAAO,IAAI,GAAG;AACvD,iBAAW,OAAO,OAAO,MAAK,iCAAQ,eAAc,CAAA,CAAE,EAAG,MAAK,IAAI,GAAG;AAAA,IACvE;AAAA,EACF;AACA,SAAO;AACT;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EffectiveProperties } from './json-schema-form-conditionals.js';
|
|
2
|
+
import { ExpressionEvaluator, JsonSchemaObject } from './json-schema-form-types.js';
|
|
3
|
+
export interface ListenerOptions {
|
|
4
|
+
root: Record<string, unknown>;
|
|
5
|
+
evaluate?: ExpressionEvaluator;
|
|
6
|
+
}
|
|
7
|
+
export declare function applyListenerState(schema: JsonSchemaObject, value: Record<string, unknown>, options: ListenerOptions): EffectiveProperties;
|
|
8
|
+
export declare function applyChangeEffects(schema: JsonSchemaObject, edit: ListenerOptions & {
|
|
9
|
+
value: Record<string, unknown>;
|
|
10
|
+
key: string;
|
|
11
|
+
next: unknown;
|
|
12
|
+
}): Record<string, unknown>;
|
|
13
|
+
//# sourceMappingURL=json-schema-form-listeners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-listeners.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-listeners.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAGV,mBAAmB,EACnB,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAOlC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AA0DD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,eAAe,GACvB,mBAAmB,CA0BrB;AAuCD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GACrF,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyBzB"}
|