@flanksource/clicky-ui 0.3.21 → 0.3.23
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/NOTICE.md +14 -0
- package/README.md +8 -1
- 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/comments/MentionTextarea.cjs +1 -1
- package/dist/comments/MentionTextarea.cjs.map +1 -1
- package/dist/comments/MentionTextarea.js +1 -1
- package/dist/comments/MentionTextarea.js.map +1 -1
- package/dist/components/AccordionList.cjs +320 -0
- package/dist/components/AccordionList.cjs.map +1 -0
- package/dist/components/AccordionList.d.ts +93 -0
- package/dist/components/AccordionList.d.ts.map +1 -0
- package/dist/components/AccordionList.js +320 -0
- package/dist/components/AccordionList.js.map +1 -0
- package/dist/components/Combobox.cjs +41 -3
- package/dist/components/Combobox.cjs.map +1 -1
- package/dist/components/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox.js +42 -4
- package/dist/components/Combobox.js.map +1 -1
- package/dist/components/ComboboxControl.cjs +6 -0
- package/dist/components/ComboboxControl.cjs.map +1 -1
- package/dist/components/ComboboxControl.d.ts +7 -3
- package/dist/components/ComboboxControl.d.ts.map +1 -1
- package/dist/components/ComboboxControl.js +6 -0
- package/dist/components/ComboboxControl.js.map +1 -1
- package/dist/components/ComboboxMenu.cjs +2 -1
- package/dist/components/ComboboxMenu.cjs.map +1 -1
- package/dist/components/ComboboxMenu.d.ts +3 -1
- package/dist/components/ComboboxMenu.d.ts.map +1 -1
- package/dist/components/ComboboxMenu.js +2 -1
- package/dist/components/ComboboxMenu.js.map +1 -1
- package/dist/components/ComboboxTags.cjs +42 -11
- package/dist/components/ComboboxTags.cjs.map +1 -1
- package/dist/components/ComboboxTags.d.ts +5 -2
- package/dist/components/ComboboxTags.d.ts.map +1 -1
- package/dist/components/ComboboxTags.js +42 -11
- package/dist/components/ComboboxTags.js.map +1 -1
- package/dist/components/ConnectionLoggingPolicy.cjs +268 -0
- package/dist/components/ConnectionLoggingPolicy.cjs.map +1 -0
- package/dist/components/ConnectionLoggingPolicy.d.ts +3 -0
- package/dist/components/ConnectionLoggingPolicy.d.ts.map +1 -0
- package/dist/components/ConnectionLoggingPolicy.js +268 -0
- package/dist/components/ConnectionLoggingPolicy.js.map +1 -0
- package/dist/components/ConnectionLoggingPolicy.model.cjs +52 -0
- package/dist/components/ConnectionLoggingPolicy.model.cjs.map +1 -0
- package/dist/components/ConnectionLoggingPolicy.model.d.ts +35 -0
- package/dist/components/ConnectionLoggingPolicy.model.d.ts.map +1 -0
- package/dist/components/ConnectionLoggingPolicy.model.js +52 -0
- package/dist/components/ConnectionLoggingPolicy.model.js.map +1 -0
- package/dist/components/CountryFlag.cjs +55 -0
- package/dist/components/CountryFlag.cjs.map +1 -0
- package/dist/components/CountryFlag.d.ts +8 -0
- package/dist/components/CountryFlag.d.ts.map +1 -0
- package/dist/components/CountryFlag.js +38 -0
- package/dist/components/CountryFlag.js.map +1 -0
- package/dist/components/CountryPicker.cjs +35 -0
- package/dist/components/CountryPicker.cjs.map +1 -0
- package/dist/components/CountryPicker.d.ts +4 -0
- package/dist/components/CountryPicker.d.ts.map +1 -0
- package/dist/components/CountryPicker.js +35 -0
- package/dist/components/CountryPicker.js.map +1 -0
- package/dist/components/DaemonSetIcon.cjs +20 -0
- package/dist/components/DaemonSetIcon.cjs.map +1 -0
- package/dist/components/DaemonSetIcon.d.ts +8 -0
- package/dist/components/DaemonSetIcon.d.ts.map +1 -0
- package/dist/components/DaemonSetIcon.js +20 -0
- package/dist/components/DaemonSetIcon.js.map +1 -0
- package/dist/components/DateField.cjs.map +1 -1
- package/dist/components/DateField.d.ts +11 -3
- package/dist/components/DateField.d.ts.map +1 -1
- package/dist/components/DateField.js.map +1 -1
- package/dist/components/DatePicker.cjs +6 -1
- package/dist/components/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker.d.ts +11 -3
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +6 -1
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/EndpointSelector.cjs +29 -8
- package/dist/components/EndpointSelector.cjs.map +1 -1
- package/dist/components/EndpointSelector.d.ts +1 -1
- package/dist/components/EndpointSelector.d.ts.map +1 -1
- package/dist/components/EndpointSelector.js +29 -8
- package/dist/components/EndpointSelector.js.map +1 -1
- package/dist/components/EndpointSelector.model.cjs.map +1 -1
- package/dist/components/EndpointSelector.model.d.ts +5 -0
- package/dist/components/EndpointSelector.model.d.ts.map +1 -1
- package/dist/components/EndpointSelector.model.js.map +1 -1
- package/dist/components/FilterBar.cjs +43 -19
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +21 -1
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +41 -17
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/InputField.cjs +14 -2
- package/dist/components/InputField.cjs.map +1 -1
- package/dist/components/InputField.d.ts +6 -0
- package/dist/components/InputField.d.ts.map +1 -1
- package/dist/components/InputField.js +14 -2
- package/dist/components/InputField.js.map +1 -1
- package/dist/components/ItemActions.cjs +87 -0
- package/dist/components/ItemActions.cjs.map +1 -0
- package/dist/components/ItemActions.d.ts +33 -0
- package/dist/components/ItemActions.d.ts.map +1 -0
- package/dist/components/ItemActions.js +87 -0
- package/dist/components/ItemActions.js.map +1 -0
- package/dist/components/JsonSchemaForm.cjs +1 -1
- package/dist/components/JsonSchemaForm.cjs.map +1 -1
- package/dist/components/JsonSchemaForm.js +1 -1
- package/dist/components/JsonSchemaForm.js.map +1 -1
- package/dist/components/MdxEditorCallout.cjs +108 -0
- package/dist/components/MdxEditorCallout.cjs.map +1 -0
- package/dist/components/MdxEditorCallout.d.ts +27 -0
- package/dist/components/MdxEditorCallout.d.ts.map +1 -0
- package/dist/components/MdxEditorCallout.js +108 -0
- package/dist/components/MdxEditorCallout.js.map +1 -0
- package/dist/components/MdxEditorField.cjs.map +1 -1
- package/dist/components/MdxEditorField.d.ts +1 -1
- package/dist/components/MdxEditorField.d.ts.map +1 -1
- package/dist/components/MdxEditorField.js.map +1 -1
- package/dist/components/MdxEditorToolbar.cjs +10 -2
- package/dist/components/MdxEditorToolbar.cjs.map +1 -1
- package/dist/components/MdxEditorToolbar.d.ts.map +1 -1
- package/dist/components/MdxEditorToolbar.js +10 -2
- package/dist/components/MdxEditorToolbar.js.map +1 -1
- package/dist/components/MultiSelect.cjs +3 -1
- package/dist/components/MultiSelect.cjs.map +1 -1
- package/dist/components/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect.js +3 -1
- package/dist/components/MultiSelect.js.map +1 -1
- package/dist/components/NamespacePicker.cjs +1 -0
- package/dist/components/NamespacePicker.cjs.map +1 -1
- package/dist/components/NamespacePicker.d.ts.map +1 -1
- package/dist/components/NamespacePicker.js +1 -0
- package/dist/components/NamespacePicker.js.map +1 -1
- package/dist/components/SplitButton.cjs +3 -2
- package/dist/components/SplitButton.cjs.map +1 -1
- package/dist/components/SplitButton.d.ts +6 -1
- package/dist/components/SplitButton.d.ts.map +1 -1
- package/dist/components/SplitButton.js +3 -2
- package/dist/components/SplitButton.js.map +1 -1
- package/dist/components/WorkloadPicker.cjs +117 -31
- package/dist/components/WorkloadPicker.cjs.map +1 -1
- package/dist/components/WorkloadPicker.d.ts +29 -5
- package/dist/components/WorkloadPicker.d.ts.map +1 -1
- package/dist/components/WorkloadPicker.js +119 -33
- package/dist/components/WorkloadPicker.js.map +1 -1
- package/dist/components/button-variants.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/combobox-types.d.ts +13 -0
- package/dist/components/combobox-types.d.ts.map +1 -1
- package/dist/components/combobox-utils.cjs +16 -0
- package/dist/components/combobox-utils.cjs.map +1 -1
- package/dist/components/combobox-utils.d.ts +1 -0
- package/dist/components/combobox-utils.d.ts.map +1 -1
- package/dist/components/combobox-utils.js +16 -0
- package/dist/components/combobox-utils.js.map +1 -1
- package/dist/components/country-options.cjs +34 -0
- package/dist/components/country-options.cjs.map +1 -0
- package/dist/components/country-options.d.ts +8 -0
- package/dist/components/country-options.d.ts.map +1 -0
- package/dist/components/country-options.js +34 -0
- package/dist/components/country-options.js.map +1 -0
- package/dist/components/filter-bar-multi.cjs +1 -1
- package/dist/components/filter-bar-multi.cjs.map +1 -1
- package/dist/components/filter-bar-multi.js +1 -1
- package/dist/components/filter-bar-multi.js.map +1 -1
- package/dist/components/filter-bar-utils.cjs +14 -2
- package/dist/components/filter-bar-utils.cjs.map +1 -1
- package/dist/components/filter-bar-utils.d.ts +2 -1
- package/dist/components/filter-bar-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-utils.js +14 -2
- package/dist/components/filter-bar-utils.js.map +1 -1
- package/dist/components/jotai-bindings-core.cjs +11 -0
- package/dist/components/jotai-bindings-core.cjs.map +1 -1
- package/dist/components/jotai-bindings-core.d.ts +3 -2
- package/dist/components/jotai-bindings-core.d.ts.map +1 -1
- package/dist/components/jotai-bindings-core.js +11 -0
- package/dist/components/jotai-bindings-core.js.map +1 -1
- package/dist/components/json-schema-form-accordion-array.cjs +54 -190
- package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
- package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-accordion-array.js +59 -195
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-array.cjs +46 -146
- 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 +47 -147
- package/dist/components/json-schema-form-array.js.map +1 -1
- package/dist/components/json-schema-form-cards-array.cjs +9 -7
- package/dist/components/json-schema-form-cards-array.cjs.map +1 -1
- package/dist/components/json-schema-form-cards-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-cards-array.js +11 -9
- package/dist/components/json-schema-form-cards-array.js.map +1 -1
- package/dist/components/json-schema-form-error-display.js +1 -1
- package/dist/components/json-schema-form-errors.cjs +17 -4
- package/dist/components/json-schema-form-errors.cjs.map +1 -1
- package/dist/components/json-schema-form-errors.d.ts +1 -0
- package/dist/components/json-schema-form-errors.d.ts.map +1 -1
- package/dist/components/json-schema-form-errors.js +16 -3
- package/dist/components/json-schema-form-errors.js.map +1 -1
- package/dist/components/json-schema-form-fields.cjs +18 -2
- package/dist/components/json-schema-form-fields.cjs.map +1 -1
- package/dist/components/json-schema-form-fields.d.ts.map +1 -1
- package/dist/components/json-schema-form-fields.js +18 -2
- package/dist/components/json-schema-form-fields.js.map +1 -1
- package/dist/components/json-schema-form-item-row.cjs +17 -46
- package/dist/components/json-schema-form-item-row.cjs.map +1 -1
- package/dist/components/json-schema-form-item-row.d.ts +3 -10
- package/dist/components/json-schema-form-item-row.d.ts.map +1 -1
- package/dist/components/json-schema-form-item-row.js +18 -47
- package/dist/components/json-schema-form-item-row.js.map +1 -1
- package/dist/components/json-schema-form-item-summary.cjs +18 -4
- package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
- package/dist/components/json-schema-form-item-summary.d.ts +2 -1
- package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
- package/dist/components/json-schema-form-item-summary.js +15 -1
- package/dist/components/json-schema-form-item-summary.js.map +1 -1
- package/dist/components/json-schema-form-lookup-tree.cjs +2 -5
- package/dist/components/json-schema-form-lookup-tree.cjs.map +1 -1
- package/dist/components/json-schema-form-lookup-tree.d.ts.map +1 -1
- package/dist/components/json-schema-form-lookup-tree.js +2 -5
- package/dist/components/json-schema-form-lookup-tree.js.map +1 -1
- package/dist/components/json-schema-form-object.cjs +3 -2
- 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 +2 -1
- package/dist/components/json-schema-form-object.js.map +1 -1
- package/dist/components/json-schema-form-render.cjs +4 -1
- 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 +5 -2
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +21 -13
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts +2 -2
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +16 -8
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +4 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +2 -1
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-tags-combobox.cjs +55 -0
- package/dist/components/json-schema-form-tags-combobox.cjs.map +1 -0
- package/dist/components/json-schema-form-tags-combobox.d.ts +17 -0
- package/dist/components/json-schema-form-tags-combobox.d.ts.map +1 -0
- package/dist/components/json-schema-form-tags-combobox.js +55 -0
- package/dist/components/json-schema-form-tags-combobox.js.map +1 -0
- package/dist/components/json-schema-form-types.d.ts +8 -1
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.cjs +5 -28
- package/dist/components/json-schema-form-utils.cjs.map +1 -1
- package/dist/components/json-schema-form-utils.d.ts +1 -5
- package/dist/components/json-schema-form-utils.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.js +5 -28
- package/dist/components/json-schema-form-utils.js.map +1 -1
- package/dist/components/jsonPathTree.cjs +10 -3
- package/dist/components/jsonPathTree.cjs.map +1 -1
- package/dist/components/jsonPathTree.d.ts +17 -0
- package/dist/components/jsonPathTree.d.ts.map +1 -1
- package/dist/components/jsonPathTree.js +10 -3
- package/dist/components/jsonPathTree.js.map +1 -1
- package/dist/components/mdx-editor-callout-model.cjs +26 -0
- package/dist/components/mdx-editor-callout-model.cjs.map +1 -0
- package/dist/components/mdx-editor-callout-model.d.ts +14 -0
- package/dist/components/mdx-editor-callout-model.d.ts.map +1 -0
- package/dist/components/mdx-editor-callout-model.js +26 -0
- package/dist/components/mdx-editor-callout-model.js.map +1 -0
- package/dist/components/mdx-editor-callout.cjs +39 -0
- package/dist/components/mdx-editor-callout.cjs.map +1 -0
- package/dist/components/mdx-editor-callout.d.ts +27 -0
- package/dist/components/mdx-editor-callout.d.ts.map +1 -0
- package/dist/components/mdx-editor-callout.js +39 -0
- package/dist/components/mdx-editor-callout.js.map +1 -0
- package/dist/components/mdx-editor-field-plugins.cjs +14 -0
- package/dist/components/mdx-editor-field-plugins.cjs.map +1 -1
- package/dist/components/mdx-editor-field-plugins.d.ts.map +1 -1
- package/dist/components/mdx-editor-field-plugins.js +14 -0
- package/dist/components/mdx-editor-field-plugins.js.map +1 -1
- package/dist/components/mdx-editor-jsx-attributes.cjs +23 -0
- package/dist/components/mdx-editor-jsx-attributes.cjs.map +1 -0
- package/dist/components/mdx-editor-jsx-attributes.d.ts +29 -0
- package/dist/components/mdx-editor-jsx-attributes.d.ts.map +1 -0
- package/dist/components/mdx-editor-jsx-attributes.js +23 -0
- package/dist/components/mdx-editor-jsx-attributes.js.map +1 -0
- package/dist/components/mdx-editor-options.d.ts +79 -0
- package/dist/components/mdx-editor-options.d.ts.map +1 -1
- package/dist/components/workload-picker-utils.cjs +17 -4
- package/dist/components/workload-picker-utils.cjs.map +1 -1
- package/dist/components/workload-picker-utils.d.ts +3 -1
- package/dist/components/workload-picker-utils.d.ts.map +1 -1
- package/dist/components/workload-picker-utils.js +18 -5
- package/dist/components/workload-picker-utils.js.map +1 -1
- package/dist/components.cjs +24 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +12 -3
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +24 -0
- package/dist/components.js.map +1 -1
- package/dist/data/Callout.cjs +48 -0
- package/dist/data/Callout.cjs.map +1 -0
- package/dist/data/Callout.d.ts +58 -0
- package/dist/data/Callout.d.ts.map +1 -0
- package/dist/data/Callout.js +48 -0
- package/dist/data/Callout.js.map +1 -0
- package/dist/data/Clicky.cjs +311 -249
- package/dist/data/Clicky.cjs.map +1 -1
- package/dist/data/Clicky.d.ts +37 -2
- package/dist/data/Clicky.d.ts.map +1 -1
- package/dist/data/Clicky.js +314 -252
- package/dist/data/Clicky.js.map +1 -1
- package/dist/data/CodeDiff.cjs +3 -18
- package/dist/data/CodeDiff.cjs.map +1 -1
- package/dist/data/CodeDiff.d.ts.map +1 -1
- package/dist/data/CodeDiff.js +3 -18
- package/dist/data/CodeDiff.js.map +1 -1
- package/dist/data/DataTable.cjs +420 -172
- package/dist/data/DataTable.cjs.map +1 -1
- package/dist/data/DataTable.d.ts +57 -4
- package/dist/data/DataTable.d.ts.map +1 -1
- package/dist/data/DataTable.grouping.cjs +26 -0
- package/dist/data/DataTable.grouping.cjs.map +1 -1
- package/dist/data/DataTable.grouping.d.ts +49 -1
- package/dist/data/DataTable.grouping.d.ts.map +1 -1
- package/dist/data/DataTable.grouping.js +26 -0
- package/dist/data/DataTable.grouping.js.map +1 -1
- package/dist/data/DataTable.js +423 -175
- package/dist/data/DataTable.js.map +1 -1
- package/dist/data/DataTableGroupingControls.cjs +84 -0
- package/dist/data/DataTableGroupingControls.cjs.map +1 -0
- package/dist/data/DataTableGroupingControls.d.ts +17 -0
- package/dist/data/DataTableGroupingControls.d.ts.map +1 -0
- package/dist/data/DataTableGroupingControls.js +84 -0
- package/dist/data/DataTableGroupingControls.js.map +1 -0
- package/dist/data/HighlightedTokens.cjs +21 -0
- package/dist/data/HighlightedTokens.cjs.map +1 -0
- package/dist/data/HighlightedTokens.d.ts +6 -0
- package/dist/data/HighlightedTokens.d.ts.map +1 -0
- package/dist/data/HighlightedTokens.js +21 -0
- package/dist/data/HighlightedTokens.js.map +1 -0
- package/dist/data/Markdown.cjs +31 -2
- package/dist/data/Markdown.cjs.map +1 -1
- package/dist/data/Markdown.d.ts +10 -1
- package/dist/data/Markdown.d.ts.map +1 -1
- package/dist/data/Markdown.js +31 -2
- package/dist/data/Markdown.js.map +1 -1
- package/dist/data/MarkdownEditor.cjs +1 -1
- package/dist/data/MarkdownEditor.cjs.map +1 -1
- package/dist/data/MarkdownEditor.js +1 -1
- package/dist/data/MarkdownEditor.js.map +1 -1
- package/dist/data/ObjectGraph.cjs +108 -23
- package/dist/data/ObjectGraph.cjs.map +1 -1
- package/dist/data/ObjectGraph.d.ts +28 -22
- package/dist/data/ObjectGraph.d.ts.map +1 -1
- package/dist/data/ObjectGraph.js +109 -24
- package/dist/data/ObjectGraph.js.map +1 -1
- package/dist/data/PromptBanner.cjs +1 -1
- package/dist/data/PromptBanner.cjs.map +1 -1
- package/dist/data/PromptBanner.js +1 -1
- package/dist/data/PromptBanner.js.map +1 -1
- package/dist/data/Tree.cjs +39 -35
- package/dist/data/Tree.cjs.map +1 -1
- package/dist/data/Tree.d.ts +7 -1
- package/dist/data/Tree.d.ts.map +1 -1
- package/dist/data/Tree.js +39 -35
- package/dist/data/Tree.js.map +1 -1
- package/dist/data/ai/ChatButton.cjs +26 -0
- package/dist/data/ai/ChatButton.cjs.map +1 -0
- package/dist/data/ai/ChatButton.d.ts +5 -0
- package/dist/data/ai/ChatButton.d.ts.map +1 -0
- package/dist/data/ai/ChatButton.js +26 -0
- package/dist/data/ai/ChatButton.js.map +1 -0
- package/dist/data/ai/ChatFab.cjs +11 -6
- package/dist/data/ai/ChatFab.cjs.map +1 -1
- package/dist/data/ai/ChatFab.d.ts +5 -3
- package/dist/data/ai/ChatFab.d.ts.map +1 -1
- package/dist/data/ai/ChatFab.js +11 -6
- package/dist/data/ai/ChatFab.js.map +1 -1
- package/dist/data/ai/PromptRunEditor/index.cjs +16 -4
- package/dist/data/ai/PromptRunEditor/index.cjs.map +1 -1
- package/dist/data/ai/PromptRunEditor/index.d.ts +7 -2
- package/dist/data/ai/PromptRunEditor/index.d.ts.map +1 -1
- package/dist/data/ai/PromptRunEditor/index.js +16 -4
- package/dist/data/ai/PromptRunEditor/index.js.map +1 -1
- package/dist/data/ai/SandboxConnectionsSection.cjs +71 -0
- package/dist/data/ai/SandboxConnectionsSection.cjs.map +1 -0
- package/dist/data/ai/SandboxConnectionsSection.d.ts +8 -0
- package/dist/data/ai/SandboxConnectionsSection.d.ts.map +1 -0
- package/dist/data/ai/SandboxConnectionsSection.js +71 -0
- package/dist/data/ai/SandboxConnectionsSection.js.map +1 -0
- package/dist/data/ai/SandboxCreateWizard.cjs +288 -0
- package/dist/data/ai/SandboxCreateWizard.cjs.map +1 -0
- package/dist/data/ai/SandboxCreateWizard.d.ts +11 -0
- package/dist/data/ai/SandboxCreateWizard.d.ts.map +1 -0
- package/dist/data/ai/SandboxCreateWizard.js +288 -0
- package/dist/data/ai/SandboxCreateWizard.js.map +1 -0
- package/dist/data/ai/SandboxCreateWizard.model.cjs +77 -0
- package/dist/data/ai/SandboxCreateWizard.model.cjs.map +1 -0
- package/dist/data/ai/SandboxCreateWizard.model.d.ts +32 -0
- package/dist/data/ai/SandboxCreateWizard.model.d.ts.map +1 -0
- package/dist/data/ai/SandboxCreateWizard.model.js +77 -0
- package/dist/data/ai/SandboxCreateWizard.model.js.map +1 -0
- package/dist/data/ai/SpecRuntimeEditor/CommitSection.cjs +6 -6
- package/dist/data/ai/SpecRuntimeEditor/CommitSection.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/CommitSection.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/CommitSection.js +6 -6
- package/dist/data/ai/SpecRuntimeEditor/CommitSection.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/PermissionsSection.cjs +11 -8
- package/dist/data/ai/SpecRuntimeEditor/PermissionsSection.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/PermissionsSection.js +11 -8
- package/dist/data/ai/SpecRuntimeEditor/PermissionsSection.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/SandboxSection.cjs +247 -0
- package/dist/data/ai/SpecRuntimeEditor/SandboxSection.cjs.map +1 -0
- package/dist/data/ai/SpecRuntimeEditor/SandboxSection.d.ts +12 -0
- package/dist/data/ai/SpecRuntimeEditor/SandboxSection.d.ts.map +1 -0
- package/dist/data/ai/SpecRuntimeEditor/SandboxSection.js +247 -0
- package/dist/data/ai/SpecRuntimeEditor/SandboxSection.js.map +1 -0
- package/dist/data/ai/SpecRuntimeEditor/fields.cjs +31 -22
- package/dist/data/ai/SpecRuntimeEditor/fields.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/fields.d.ts +6 -4
- package/dist/data/ai/SpecRuntimeEditor/fields.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/fields.js +32 -23
- package/dist/data/ai/SpecRuntimeEditor/fields.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.cjs +15 -1
- package/dist/data/ai/SpecRuntimeEditor/index.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.d.ts +8 -3
- package/dist/data/ai/SpecRuntimeEditor/index.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.js +15 -1
- package/dist/data/ai/SpecRuntimeEditor/index.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/types.cjs +11 -0
- package/dist/data/ai/SpecRuntimeEditor/types.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/types.d.ts +53 -1
- package/dist/data/ai/SpecRuntimeEditor/types.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/types.js +11 -0
- package/dist/data/ai/SpecRuntimeEditor/types.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/update.cjs +23 -0
- package/dist/data/ai/SpecRuntimeEditor/update.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/update.d.ts +23 -1
- package/dist/data/ai/SpecRuntimeEditor/update.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/update.js +23 -0
- package/dist/data/ai/SpecRuntimeEditor/update.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor.model.cjs +28 -0
- package/dist/data/ai/SpecRuntimeEditor.model.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor.model.d.ts +35 -0
- package/dist/data/ai/SpecRuntimeEditor.model.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor.model.js +28 -0
- package/dist/data/ai/SpecRuntimeEditor.model.js.map +1 -1
- package/dist/data/ai/index.d.ts +6 -2
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/ai/sandbox-kind-meta.cjs +16 -0
- package/dist/data/ai/sandbox-kind-meta.cjs.map +1 -0
- package/dist/data/ai/sandbox-kind-meta.d.ts +8 -0
- package/dist/data/ai/sandbox-kind-meta.d.ts.map +1 -0
- package/dist/data/ai/sandbox-kind-meta.js +16 -0
- package/dist/data/ai/sandbox-kind-meta.js.map +1 -0
- package/dist/data/badge-variants.d.ts +1 -1
- package/dist/data/cache-browser/CacheTree.cjs +1 -1
- package/dist/data/cache-browser/CacheTree.cjs.map +1 -1
- package/dist/data/cache-browser/CacheTree.js +1 -1
- package/dist/data/cache-browser/CacheTree.js.map +1 -1
- package/dist/data/callout-tones.cjs +95 -0
- package/dist/data/callout-tones.cjs.map +1 -0
- package/dist/data/callout-tones.d.ts +32 -0
- package/dist/data/callout-tones.d.ts.map +1 -0
- package/dist/data/callout-tones.js +95 -0
- package/dist/data/callout-tones.js.map +1 -0
- package/dist/data/chat/PromptInput.cjs +1 -1
- package/dist/data/chat/PromptInput.cjs.map +1 -1
- package/dist/data/chat/PromptInput.js +1 -1
- package/dist/data/chat/PromptInput.js.map +1 -1
- package/dist/data/clicky-export/ClickyExportDialog.cjs +145 -0
- package/dist/data/clicky-export/ClickyExportDialog.cjs.map +1 -0
- package/dist/data/clicky-export/ClickyExportDialog.d.ts +43 -0
- package/dist/data/clicky-export/ClickyExportDialog.d.ts.map +1 -0
- package/dist/data/clicky-export/ClickyExportDialog.js +145 -0
- package/dist/data/clicky-export/ClickyExportDialog.js.map +1 -0
- package/dist/data/clicky-export/index.d.ts +3 -0
- package/dist/data/clicky-export/index.d.ts.map +1 -0
- package/dist/data/clicky-export/useClickyExport.cjs +44 -0
- package/dist/data/clicky-export/useClickyExport.cjs.map +1 -0
- package/dist/data/clicky-export/useClickyExport.d.ts +30 -0
- package/dist/data/clicky-export/useClickyExport.d.ts.map +1 -0
- package/dist/data/clicky-export/useClickyExport.js +44 -0
- package/dist/data/clicky-export/useClickyExport.js.map +1 -0
- package/dist/data/code-highlight.cjs +0 -6
- package/dist/data/code-highlight.cjs.map +1 -1
- package/dist/data/code-highlight.d.ts +4 -3
- package/dist/data/code-highlight.d.ts.map +1 -1
- package/dist/data/code-highlight.js +1 -7
- package/dist/data/code-highlight.js.map +1 -1
- package/dist/data/data-table-server-filters.cjs +15 -2
- package/dist/data/data-table-server-filters.cjs.map +1 -1
- package/dist/data/data-table-server-filters.d.ts +12 -1
- package/dist/data/data-table-server-filters.d.ts.map +1 -1
- package/dist/data/data-table-server-filters.js +15 -2
- package/dist/data/data-table-server-filters.js.map +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.cjs +6 -2
- package/dist/data/diagnostics/DiagnosticsDetailPanel.cjs.map +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.d.ts +8 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.d.ts.map +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.js +6 -2
- package/dist/data/diagnostics/DiagnosticsDetailPanel.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +58 -12
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts +5 -2
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +58 -12
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.cjs +54 -24
- package/dist/data/diagnostics/FrameSourceWindow.cjs.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.d.ts +2 -1
- package/dist/data/diagnostics/FrameSourceWindow.d.ts.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.js +54 -24
- package/dist/data/diagnostics/FrameSourceWindow.js.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.utils.cjs.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.utils.d.ts +3 -0
- package/dist/data/diagnostics/FrameSourceWindow.utils.d.ts.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.utils.js.map +1 -1
- package/dist/data/diagnostics/JvmStackTrace.cjs +14 -30
- package/dist/data/diagnostics/JvmStackTrace.cjs.map +1 -1
- package/dist/data/diagnostics/JvmStackTrace.d.ts +6 -9
- package/dist/data/diagnostics/JvmStackTrace.d.ts.map +1 -1
- package/dist/data/diagnostics/JvmStackTrace.js +15 -31
- package/dist/data/diagnostics/JvmStackTrace.js.map +1 -1
- package/dist/data/diagnostics/RenderedStackTrace.cjs +14 -144
- package/dist/data/diagnostics/RenderedStackTrace.cjs.map +1 -1
- package/dist/data/diagnostics/RenderedStackTrace.d.ts +6 -6
- package/dist/data/diagnostics/RenderedStackTrace.d.ts.map +1 -1
- package/dist/data/diagnostics/RenderedStackTrace.js +15 -145
- package/dist/data/diagnostics/RenderedStackTrace.js.map +1 -1
- package/dist/data/diagnostics/StackFrameRow.cjs +65 -0
- package/dist/data/diagnostics/StackFrameRow.cjs.map +1 -0
- package/dist/data/diagnostics/StackFrameRow.d.ts +13 -0
- package/dist/data/diagnostics/StackFrameRow.d.ts.map +1 -0
- package/dist/data/diagnostics/StackFrameRow.js +65 -0
- package/dist/data/diagnostics/StackFrameRow.js.map +1 -0
- package/dist/data/diagnostics/ThreadCard.cjs +9 -2
- package/dist/data/diagnostics/ThreadCard.cjs.map +1 -1
- package/dist/data/diagnostics/ThreadCard.d.ts +3 -1
- package/dist/data/diagnostics/ThreadCard.d.ts.map +1 -1
- package/dist/data/diagnostics/ThreadCard.js +9 -2
- package/dist/data/diagnostics/ThreadCard.js.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.cjs +17 -2
- package/dist/data/diagnostics/error-diagnostics.cjs.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.d.ts +5 -0
- package/dist/data/diagnostics/error-diagnostics.d.ts.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.js +17 -2
- package/dist/data/diagnostics/error-diagnostics.js.map +1 -1
- package/dist/data/diagnostics/frame-heuristics.cjs +26 -0
- package/dist/data/diagnostics/frame-heuristics.cjs.map +1 -0
- package/dist/data/diagnostics/frame-heuristics.d.ts +5 -0
- package/dist/data/diagnostics/frame-heuristics.d.ts.map +1 -0
- package/dist/data/diagnostics/frame-heuristics.js +26 -0
- package/dist/data/diagnostics/frame-heuristics.js.map +1 -0
- package/dist/data/diagnostics/jvm-stacktrace.cjs +5 -7
- package/dist/data/diagnostics/jvm-stacktrace.cjs.map +1 -1
- package/dist/data/diagnostics/jvm-stacktrace.d.ts.map +1 -1
- package/dist/data/diagnostics/jvm-stacktrace.js +5 -7
- package/dist/data/diagnostics/jvm-stacktrace.js.map +1 -1
- package/dist/data/diagnostics/stacktrace-parse.cjs +4 -9
- package/dist/data/diagnostics/stacktrace-parse.cjs.map +1 -1
- package/dist/data/diagnostics/stacktrace-parse.d.ts.map +1 -1
- package/dist/data/diagnostics/stacktrace-parse.js +4 -9
- package/dist/data/diagnostics/stacktrace-parse.js.map +1 -1
- package/dist/data/logs-normalize.cjs +18 -3
- package/dist/data/logs-normalize.cjs.map +1 -1
- package/dist/data/logs-normalize.d.ts +17 -0
- package/dist/data/logs-normalize.d.ts.map +1 -1
- package/dist/data/logs-normalize.js +18 -3
- package/dist/data/logs-normalize.js.map +1 -1
- package/dist/data/object-graph-nodes.cjs +24 -0
- package/dist/data/object-graph-nodes.cjs.map +1 -0
- package/dist/data/object-graph-nodes.d.ts +34 -0
- package/dist/data/object-graph-nodes.d.ts.map +1 -0
- package/dist/data/object-graph-nodes.js +24 -0
- package/dist/data/object-graph-nodes.js.map +1 -0
- package/dist/data/query-browser/QueryBrowser.cjs +52 -32
- package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.js +53 -33
- package/dist/data/query-browser/QueryBrowser.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.d.ts +12 -0
- package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.cjs +58 -10
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.js +58 -10
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.js.map +1 -1
- package/dist/data/query-browser/QueryBrowserResults.cjs +4 -4
- package/dist/data/query-browser/QueryBrowserResults.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowserResults.d.ts +4 -2
- package/dist/data/query-browser/QueryBrowserResults.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowserResults.js +4 -4
- package/dist/data/query-browser/QueryBrowserResults.js.map +1 -1
- package/dist/data/query-info/QueryInfoDialog.cjs +106 -0
- package/dist/data/query-info/QueryInfoDialog.cjs.map +1 -0
- package/dist/data/query-info/QueryInfoDialog.d.ts +16 -0
- package/dist/data/query-info/QueryInfoDialog.d.ts.map +1 -0
- package/dist/data/query-info/QueryInfoDialog.js +106 -0
- package/dist/data/query-info/QueryInfoDialog.js.map +1 -0
- package/dist/data/query-info/index.d.ts +4 -0
- package/dist/data/query-info/index.d.ts.map +1 -0
- package/dist/data/query-info/queryInfo.cjs +42 -0
- package/dist/data/query-info/queryInfo.cjs.map +1 -0
- package/dist/data/query-info/queryInfo.d.ts +45 -0
- package/dist/data/query-info/queryInfo.d.ts.map +1 -0
- package/dist/data/query-info/queryInfo.js +42 -0
- package/dist/data/query-info/queryInfo.js.map +1 -0
- package/dist/data/query-info/useQueryInfo.cjs +48 -0
- package/dist/data/query-info/useQueryInfo.cjs.map +1 -0
- package/dist/data/query-info/useQueryInfo.d.ts +26 -0
- package/dist/data/query-info/useQueryInfo.d.ts.map +1 -0
- package/dist/data/query-info/useQueryInfo.js +48 -0
- package/dist/data/query-info/useQueryInfo.js.map +1 -0
- package/dist/data/use-infinite-rows.cjs +20 -0
- package/dist/data/use-infinite-rows.cjs.map +1 -0
- package/dist/data/use-infinite-rows.d.ts +20 -0
- package/dist/data/use-infinite-rows.d.ts.map +1 -0
- package/dist/data/use-infinite-rows.js +20 -0
- package/dist/data/use-infinite-rows.js.map +1 -0
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +51 -1
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +11 -4
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +52 -2
- package/dist/data.js.map +1 -1
- package/dist/hooks/use-log-tail.cjs +213 -0
- package/dist/hooks/use-log-tail.cjs.map +1 -0
- package/dist/hooks/use-log-tail.d.ts +112 -0
- package/dist/hooks/use-log-tail.d.ts.map +1 -0
- package/dist/hooks/use-log-tail.js +213 -0
- package/dist/hooks/use-log-tail.js.map +1 -0
- package/dist/hooks.cjs +10 -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 +10 -0
- package/dist/hooks.js.map +1 -1
- package/dist/icons/components/UiArrowsCounterClockwise.cjs +15 -0
- package/dist/icons/components/UiArrowsCounterClockwise.cjs.map +1 -0
- package/dist/icons/components/UiArrowsCounterClockwise.d.ts +15 -0
- package/dist/icons/components/UiArrowsCounterClockwise.d.ts.map +1 -0
- package/dist/icons/components/UiArrowsCounterClockwise.js +15 -0
- package/dist/icons/components/UiArrowsCounterClockwise.js.map +1 -0
- package/dist/icons/components/UiClipboardText.cjs +15 -0
- package/dist/icons/components/UiClipboardText.cjs.map +1 -0
- package/dist/icons/components/UiClipboardText.d.ts +15 -0
- package/dist/icons/components/UiClipboardText.d.ts.map +1 -0
- package/dist/icons/components/UiClipboardText.js +15 -0
- package/dist/icons/components/UiClipboardText.js.map +1 -0
- package/dist/icons/components/UiIdentificationCard.cjs +15 -0
- package/dist/icons/components/UiIdentificationCard.cjs.map +1 -0
- package/dist/icons/components/UiIdentificationCard.d.ts +15 -0
- package/dist/icons/components/UiIdentificationCard.d.ts.map +1 -0
- package/dist/icons/components/UiIdentificationCard.js +15 -0
- package/dist/icons/components/UiIdentificationCard.js.map +1 -0
- package/dist/icons/components/UiLockKey.cjs +15 -0
- package/dist/icons/components/UiLockKey.cjs.map +1 -0
- package/dist/icons/components/UiLockKey.d.ts +15 -0
- package/dist/icons/components/UiLockKey.d.ts.map +1 -0
- package/dist/icons/components/UiLockKey.js +15 -0
- package/dist/icons/components/UiLockKey.js.map +1 -0
- package/dist/icons/components/UiSteps.cjs +15 -0
- package/dist/icons/components/UiSteps.cjs.map +1 -0
- package/dist/icons/components/UiSteps.d.ts +15 -0
- package/dist/icons/components/UiSteps.d.ts.map +1 -0
- package/dist/icons/components/UiSteps.js +15 -0
- package/dist/icons/components/UiSteps.js.map +1 -0
- package/dist/icons/components/UiUserGear.cjs +15 -0
- package/dist/icons/components/UiUserGear.cjs.map +1 -0
- package/dist/icons/components/UiUserGear.d.ts +15 -0
- package/dist/icons/components/UiUserGear.d.ts.map +1 -0
- package/dist/icons/components/UiUserGear.js +15 -0
- package/dist/icons/components/UiUserGear.js.map +1 -0
- package/dist/icons/components/UiUsersFour.cjs +15 -0
- package/dist/icons/components/UiUsersFour.cjs.map +1 -0
- package/dist/icons/components/UiUsersFour.d.ts +15 -0
- package/dist/icons/components/UiUsersFour.d.ts.map +1 -0
- package/dist/icons/components/UiUsersFour.js +15 -0
- package/dist/icons/components/UiUsersFour.js.map +1 -0
- package/dist/icons/index.d.ts +14 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/registry.cjs +15 -1
- package/dist/icons/registry.cjs.map +1 -1
- package/dist/icons/registry.d.ts.map +1 -1
- package/dist/icons/registry.js +15 -1
- package/dist/icons/registry.js.map +1 -1
- package/dist/icons.cjs +21 -0
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.js +21 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +93 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +94 -2
- package/dist/index.js.map +1 -1
- package/dist/jotai.d.ts +1 -1
- package/dist/jotai.d.ts.map +1 -1
- package/dist/lib/collections.cjs +31 -0
- package/dist/lib/collections.cjs.map +1 -0
- package/dist/lib/collections.d.ts +6 -0
- package/dist/lib/collections.d.ts.map +1 -0
- package/dist/lib/collections.js +31 -0
- package/dist/lib/collections.js.map +1 -0
- package/dist/mdx-editor.cjs +12 -0
- package/dist/mdx-editor.cjs.map +1 -1
- package/dist/mdx-editor.css +1 -1
- package/dist/mdx-editor.d.ts +4 -1
- package/dist/mdx-editor.d.ts.map +1 -1
- package/dist/mdx-editor.js +13 -1
- package/dist/mdx-editor.js.map +1 -1
- package/dist/overlay/CommandPalette.cjs +1 -1
- package/dist/overlay/CommandPalette.cjs.map +1 -1
- package/dist/overlay/CommandPalette.js +1 -1
- package/dist/overlay/CommandPalette.js.map +1 -1
- package/dist/profiles/cel/celEditor.cjs +395 -0
- package/dist/profiles/cel/celEditor.cjs.map +1 -0
- package/dist/profiles/cel/celEditor.d.ts +51 -0
- package/dist/profiles/cel/celEditor.d.ts.map +1 -0
- package/dist/profiles/cel/celEditor.js +395 -0
- package/dist/profiles/cel/celEditor.js.map +1 -0
- package/dist/profiles/cel/celEditorExtension.cjs +15 -0
- package/dist/profiles/cel/celEditorExtension.cjs.map +1 -0
- package/dist/profiles/cel/celEditorExtension.d.ts +5 -0
- package/dist/profiles/cel/celEditorExtension.d.ts.map +1 -0
- package/dist/profiles/cel/celEditorExtension.js +15 -0
- package/dist/profiles/cel/celEditorExtension.js.map +1 -0
- package/dist/profiles/cel/celExpression.cjs +174 -0
- package/dist/profiles/cel/celExpression.cjs.map +1 -0
- package/dist/profiles/cel/celExpression.d.ts +138 -0
- package/dist/profiles/cel/celExpression.d.ts.map +1 -0
- package/dist/profiles/cel/celExpression.js +174 -0
- package/dist/profiles/cel/celExpression.js.map +1 -0
- package/dist/profiles/cel/celPath.cjs +47 -0
- package/dist/profiles/cel/celPath.cjs.map +1 -0
- package/dist/profiles/cel/celPath.d.ts +31 -0
- package/dist/profiles/cel/celPath.d.ts.map +1 -0
- package/dist/profiles/cel/celPath.js +47 -0
- package/dist/profiles/cel/celPath.js.map +1 -0
- package/dist/profiles/cel/index.d.ts +5 -0
- package/dist/profiles/cel/index.d.ts.map +1 -0
- package/dist/profiles/connections/catalogTree.cjs +133 -0
- package/dist/profiles/connections/catalogTree.cjs.map +1 -0
- package/dist/profiles/connections/catalogTree.d.ts.map +1 -0
- package/dist/profiles/connections/catalogTree.js +133 -0
- package/dist/profiles/connections/catalogTree.js.map +1 -0
- package/dist/profiles/connections/connectionBrowserModel.cjs +191 -0
- package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -0
- package/dist/profiles/connections/connectionBrowserModel.d.ts +177 -0
- package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -0
- package/dist/profiles/connections/connectionBrowserModel.js +191 -0
- package/dist/profiles/connections/connectionBrowserModel.js.map +1 -0
- package/dist/profiles/connections/connectionQueryWorkspace.cjs +196 -0
- package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -0
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts +63 -0
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -0
- package/dist/profiles/connections/connectionQueryWorkspace.js +196 -0
- package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs +28 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs.map +1 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts +38 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts.map +1 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.js +28 -0
- package/dist/profiles/connections/connectionQueryWorkspaceModel.js.map +1 -0
- package/dist/profiles/connections/index.d.ts +5 -0
- package/dist/profiles/connections/index.d.ts.map +1 -0
- package/dist/profiles/editor/index.d.ts +12 -0
- package/dist/profiles/editor/index.d.ts.map +1 -0
- package/dist/profiles/editor/profileBuilder.cjs +65 -0
- package/dist/profiles/editor/profileBuilder.cjs.map +1 -0
- package/dist/profiles/editor/profileBuilder.d.ts.map +1 -0
- package/dist/profiles/editor/profileBuilder.js +65 -0
- package/dist/profiles/editor/profileBuilder.js.map +1 -0
- package/dist/profiles/editor/profileBuilderExtension.cjs.map +1 -0
- package/dist/profiles/editor/profileBuilderExtension.d.ts +5 -0
- package/dist/profiles/editor/profileBuilderExtension.d.ts.map +1 -0
- package/dist/profiles/editor/profileBuilderExtension.js.map +1 -0
- package/dist/profiles/editor/profileBuilderModel.cjs +44 -0
- package/dist/profiles/editor/profileBuilderModel.cjs.map +1 -0
- package/dist/profiles/editor/profileBuilderModel.d.ts +4 -0
- package/dist/profiles/editor/profileBuilderModel.d.ts.map +1 -0
- package/dist/profiles/editor/profileBuilderModel.js +44 -0
- package/dist/profiles/editor/profileBuilderModel.js.map +1 -0
- package/dist/profiles/editor/profileBuilderWorkspace.cjs +333 -0
- package/dist/profiles/editor/profileBuilderWorkspace.cjs.map +1 -0
- package/dist/profiles/editor/profileBuilderWorkspace.d.ts +21 -0
- package/dist/profiles/editor/profileBuilderWorkspace.d.ts.map +1 -0
- package/dist/profiles/editor/profileBuilderWorkspace.js +333 -0
- package/dist/profiles/editor/profileBuilderWorkspace.js.map +1 -0
- package/dist/profiles/editor/profileEditor.cjs +471 -0
- package/dist/profiles/editor/profileEditor.cjs.map +1 -0
- package/dist/profiles/editor/profileEditor.d.ts +20 -0
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -0
- package/dist/profiles/editor/profileEditor.js +471 -0
- package/dist/profiles/editor/profileEditor.js.map +1 -0
- package/dist/profiles/editor/profileEditorModel.cjs +206 -0
- package/dist/profiles/editor/profileEditorModel.cjs.map +1 -0
- package/dist/profiles/editor/profileEditorModel.d.ts +76 -0
- package/dist/profiles/editor/profileEditorModel.d.ts.map +1 -0
- package/dist/profiles/editor/profileEditorModel.js +206 -0
- package/dist/profiles/editor/profileEditorModel.js.map +1 -0
- package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -0
- package/dist/profiles/editor/profileEditorPreview.d.ts +12 -0
- package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -0
- package/dist/profiles/editor/profileEditorPreview.js.map +1 -0
- package/dist/profiles/editor/profileEditorRail.cjs.map +1 -0
- package/dist/profiles/editor/profileEditorRail.d.ts.map +1 -0
- package/dist/profiles/editor/profileEditorRail.js.map +1 -0
- package/dist/profiles/editor/profileEditorRaw.cjs +118 -0
- package/dist/profiles/editor/profileEditorRaw.cjs.map +1 -0
- package/dist/profiles/editor/profileEditorRaw.d.ts +7 -0
- package/dist/profiles/editor/profileEditorRaw.d.ts.map +1 -0
- package/dist/profiles/editor/profileEditorRaw.js +118 -0
- package/dist/profiles/editor/profileEditorRaw.js.map +1 -0
- package/dist/profiles/editor/profileEditorRoutes.cjs.map +1 -0
- package/dist/profiles/editor/profileEditorRoutes.d.ts.map +1 -0
- package/dist/profiles/editor/profileEditorRoutes.js.map +1 -0
- package/dist/profiles/editor/profileEditorSections.cjs +247 -0
- package/dist/profiles/editor/profileEditorSections.cjs.map +1 -0
- package/dist/profiles/editor/profileEditorSections.d.ts +26 -0
- package/dist/profiles/editor/profileEditorSections.d.ts.map +1 -0
- package/dist/profiles/editor/profileEditorSections.js +247 -0
- package/dist/profiles/editor/profileEditorSections.js.map +1 -0
- package/dist/profiles/editor/profileYaml.cjs +19 -0
- package/dist/profiles/editor/profileYaml.cjs.map +1 -0
- package/dist/profiles/editor/profileYaml.d.ts +4 -0
- package/dist/profiles/editor/profileYaml.d.ts.map +1 -0
- package/dist/profiles/editor/profileYaml.js +19 -0
- package/dist/profiles/editor/profileYaml.js.map +1 -0
- package/dist/profiles/editor/testSchema.d.ts +3 -0
- package/dist/profiles/editor/testSchema.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esFieldValues.cjs +57 -0
- package/dist/profiles/elasticsearch/esFieldValues.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esFieldValues.d.ts +45 -0
- package/dist/profiles/elasticsearch/esFieldValues.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esFieldValues.js +57 -0
- package/dist/profiles/elasticsearch/esFieldValues.js.map +1 -0
- package/dist/profiles/elasticsearch/esParamMappingModel.cjs +301 -0
- package/dist/profiles/elasticsearch/esParamMappingModel.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esParamMappingModel.d.ts +37 -0
- package/dist/profiles/elasticsearch/esParamMappingModel.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esParamMappingModel.js +301 -0
- package/dist/profiles/elasticsearch/esParamMappingModel.js.map +1 -0
- package/dist/profiles/elasticsearch/esParamMappingPill.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esParamMappingPill.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esParamMappingPill.js.map +1 -0
- package/dist/profiles/elasticsearch/esParamOperandExtension.cjs +75 -0
- package/dist/profiles/elasticsearch/esParamOperandExtension.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esParamOperandExtension.d.ts +11 -0
- package/dist/profiles/elasticsearch/esParamOperandExtension.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esParamOperandExtension.js +75 -0
- package/dist/profiles/elasticsearch/esParamOperandExtension.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilder.cjs +249 -0
- package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilder.d.ts +35 -0
- package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilder.js +249 -0
- package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderExtension.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderExtension.d.ts +5 -0
- package/dist/profiles/elasticsearch/esQueryBuilderExtension.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderExtension.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs +59 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts +25 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.js +59 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderModel.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderModel.d.ts +110 -0
- package/dist/profiles/elasticsearch/esQueryBuilderModel.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilderModel.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryClauseGroup.cjs +144 -0
- package/dist/profiles/elasticsearch/esQueryClauseGroup.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryClauseGroup.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryClauseGroup.js +144 -0
- package/dist/profiles/elasticsearch/esQueryClauseGroup.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryCompile.cjs +48 -0
- package/dist/profiles/elasticsearch/esQueryCompile.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryCompile.d.ts +40 -0
- package/dist/profiles/elasticsearch/esQueryCompile.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryCompile.js +48 -0
- package/dist/profiles/elasticsearch/esQueryCompile.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryConditionRow.cjs +168 -0
- package/dist/profiles/elasticsearch/esQueryConditionRow.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryConditionRow.d.ts +37 -0
- package/dist/profiles/elasticsearch/esQueryConditionRow.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryConditionRow.js +168 -0
- package/dist/profiles/elasticsearch/esQueryConditionRow.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryGroupModel.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryGroupModel.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryGroupModel.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOccur.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOccur.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOccur.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperandEditors.cjs +279 -0
- package/dist/profiles/elasticsearch/esQueryOperandEditors.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperandEditors.d.ts +24 -0
- package/dist/profiles/elasticsearch/esQueryOperandEditors.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperandEditors.js +279 -0
- package/dist/profiles/elasticsearch/esQueryOperandEditors.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperandModel.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperandModel.d.ts +17 -0
- package/dist/profiles/elasticsearch/esQueryOperandModel.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperandModel.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperators.cjs +166 -0
- package/dist/profiles/elasticsearch/esQueryOperators.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperators.d.ts +84 -0
- package/dist/profiles/elasticsearch/esQueryOperators.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOperators.js +166 -0
- package/dist/profiles/elasticsearch/esQueryOperators.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOutputEditor.cjs +138 -0
- package/dist/profiles/elasticsearch/esQueryOutputEditor.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOutputEditor.d.ts +7 -0
- package/dist/profiles/elasticsearch/esQueryOutputEditor.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOutputEditor.js +138 -0
- package/dist/profiles/elasticsearch/esQueryOutputEditor.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOutputModel.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOutputModel.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryOutputModel.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryPreview.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQueryPreview.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQueryPreview.js.map +1 -0
- package/dist/profiles/elasticsearch/esQuerySortEditor.cjs +143 -0
- package/dist/profiles/elasticsearch/esQuerySortEditor.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQuerySortEditor.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQuerySortEditor.js +143 -0
- package/dist/profiles/elasticsearch/esQuerySortEditor.js.map +1 -0
- package/dist/profiles/elasticsearch/esQuerySortModel.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esQuerySortModel.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esQuerySortModel.js.map +1 -0
- package/dist/profiles/elasticsearch/esValueCombobox.cjs +86 -0
- package/dist/profiles/elasticsearch/esValueCombobox.cjs.map +1 -0
- package/dist/profiles/elasticsearch/esValueCombobox.d.ts.map +1 -0
- package/dist/profiles/elasticsearch/esValueCombobox.js +86 -0
- package/dist/profiles/elasticsearch/esValueCombobox.js.map +1 -0
- package/dist/profiles/elasticsearch/index.d.ts +23 -0
- package/dist/profiles/elasticsearch/index.d.ts.map +1 -0
- package/dist/profiles/fields/index.d.ts +9 -0
- package/dist/profiles/fields/index.d.ts.map +1 -0
- package/dist/profiles/fields/profileColumnModel.cjs.map +1 -0
- package/dist/profiles/fields/profileColumnModel.d.ts +8 -0
- package/dist/profiles/fields/profileColumnModel.d.ts.map +1 -0
- package/dist/profiles/fields/profileColumnModel.js.map +1 -0
- package/dist/profiles/fields/profileColumnPicker.cjs +68 -0
- package/dist/profiles/fields/profileColumnPicker.cjs.map +1 -0
- package/dist/profiles/fields/profileColumnPicker.d.ts +11 -0
- package/dist/profiles/fields/profileColumnPicker.d.ts.map +1 -0
- package/dist/profiles/fields/profileColumnPicker.js +68 -0
- package/dist/profiles/fields/profileColumnPicker.js.map +1 -0
- package/dist/profiles/fields/profileFieldControls.cjs +50 -0
- package/dist/profiles/fields/profileFieldControls.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldControls.d.ts +37 -0
- package/dist/profiles/fields/profileFieldControls.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldControls.js +50 -0
- package/dist/profiles/fields/profileFieldControls.js.map +1 -0
- package/dist/profiles/fields/profileFieldEditor.cjs +198 -0
- package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldEditor.d.ts +34 -0
- package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldEditor.js +198 -0
- package/dist/profiles/fields/profileFieldEditor.js.map +1 -0
- package/dist/profiles/fields/profileFieldFilterEditor.cjs +122 -0
- package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldFilterEditor.d.ts +16 -0
- package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldFilterEditor.js +122 -0
- package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -0
- package/dist/profiles/fields/profileFieldIcons.cjs +102 -0
- package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldIcons.d.ts +10 -0
- package/dist/profiles/fields/profileFieldIcons.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldIcons.js +102 -0
- package/dist/profiles/fields/profileFieldIcons.js.map +1 -0
- package/dist/profiles/fields/profileFieldList.cjs +215 -0
- package/dist/profiles/fields/profileFieldList.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldList.d.ts +24 -0
- package/dist/profiles/fields/profileFieldList.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldList.js +215 -0
- package/dist/profiles/fields/profileFieldList.js.map +1 -0
- package/dist/profiles/fields/profileFieldManager.cjs +103 -0
- package/dist/profiles/fields/profileFieldManager.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldManager.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldManager.js +103 -0
- package/dist/profiles/fields/profileFieldManager.js.map +1 -0
- package/dist/profiles/fields/profileFieldState.cjs +136 -0
- package/dist/profiles/fields/profileFieldState.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldState.d.ts +41 -0
- package/dist/profiles/fields/profileFieldState.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldState.js +136 -0
- package/dist/profiles/fields/profileFieldState.js.map +1 -0
- package/dist/profiles/fields/profileFieldTypes.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldTypes.d.ts +8 -0
- package/dist/profiles/fields/profileFieldTypes.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldTypes.js.map +1 -0
- package/dist/profiles/fields/profileParamModel.cjs.map +1 -0
- package/dist/profiles/fields/profileParamModel.d.ts +3 -0
- package/dist/profiles/fields/profileParamModel.d.ts.map +1 -0
- package/dist/profiles/fields/profileParamModel.js.map +1 -0
- package/dist/profiles/processor/index.d.ts +6 -0
- package/dist/profiles/processor/index.d.ts.map +1 -0
- package/dist/profiles/processor/processorConfig.cjs +185 -0
- package/dist/profiles/processor/processorConfig.cjs.map +1 -0
- package/dist/profiles/processor/processorConfig.d.ts +34 -0
- package/dist/profiles/processor/processorConfig.d.ts.map +1 -0
- package/dist/profiles/processor/processorConfig.js +185 -0
- package/dist/profiles/processor/processorConfig.js.map +1 -0
- package/dist/profiles/processor/processorPipeline.cjs +300 -0
- package/dist/profiles/processor/processorPipeline.cjs.map +1 -0
- package/dist/profiles/processor/processorPipeline.d.ts +11 -0
- package/dist/profiles/processor/processorPipeline.d.ts.map +1 -0
- package/dist/profiles/processor/processorPipeline.js +300 -0
- package/dist/profiles/processor/processorPipeline.js.map +1 -0
- package/dist/profiles/processor/processorPipelineEditor.cjs +330 -0
- package/dist/profiles/processor/processorPipelineEditor.cjs.map +1 -0
- package/dist/profiles/processor/processorPipelineEditor.d.ts +16 -0
- package/dist/profiles/processor/processorPipelineEditor.d.ts.map +1 -0
- package/dist/profiles/processor/processorPipelineEditor.js +330 -0
- package/dist/profiles/processor/processorPipelineEditor.js.map +1 -0
- package/dist/profiles/processor/processorPipelineExtension.cjs +28 -0
- package/dist/profiles/processor/processorPipelineExtension.cjs.map +1 -0
- package/dist/profiles/processor/processorPipelineExtension.d.ts +5 -0
- package/dist/profiles/processor/processorPipelineExtension.d.ts.map +1 -0
- package/dist/profiles/processor/processorPipelineExtension.js +28 -0
- package/dist/profiles/processor/processorPipelineExtension.js.map +1 -0
- package/dist/profiles/processor/processorPreview.cjs +55 -0
- package/dist/profiles/processor/processorPreview.cjs.map +1 -0
- package/dist/profiles/processor/processorPreview.d.ts +20 -0
- package/dist/profiles/processor/processorPreview.d.ts.map +1 -0
- package/dist/profiles/processor/processorPreview.js +55 -0
- package/dist/profiles/processor/processorPreview.js.map +1 -0
- package/dist/profiles/processor/processorPreviewTable.cjs +103 -0
- package/dist/profiles/processor/processorPreviewTable.cjs.map +1 -0
- package/dist/profiles/processor/processorPreviewTable.d.ts +6 -0
- package/dist/profiles/processor/processorPreviewTable.d.ts.map +1 -0
- package/dist/profiles/processor/processorPreviewTable.js +103 -0
- package/dist/profiles/processor/processorPreviewTable.js.map +1 -0
- package/dist/profiles/processor/processorSampleParams.cjs +38 -0
- package/dist/profiles/processor/processorSampleParams.cjs.map +1 -0
- package/dist/profiles/processor/processorSampleParams.d.ts +6 -0
- package/dist/profiles/processor/processorSampleParams.d.ts.map +1 -0
- package/dist/profiles/processor/processorSampleParams.js +38 -0
- package/dist/profiles/processor/processorSampleParams.js.map +1 -0
- package/dist/profiles/profileApi.cjs +16 -0
- package/dist/profiles/profileApi.cjs.map +1 -1
- package/dist/profiles/profileApi.d.ts +36 -3
- package/dist/profiles/profileApi.d.ts.map +1 -1
- package/dist/profiles/profileApi.js +16 -0
- package/dist/profiles/profileApi.js.map +1 -1
- package/dist/profiles/query/index.d.ts +9 -0
- package/dist/profiles/query/index.d.ts.map +1 -0
- package/dist/profiles/query/jsonPathSample.cjs +75 -0
- package/dist/profiles/query/jsonPathSample.cjs.map +1 -0
- package/dist/profiles/query/jsonPathSample.d.ts +27 -0
- package/dist/profiles/query/jsonPathSample.d.ts.map +1 -0
- package/dist/profiles/query/jsonPathSample.js +75 -0
- package/dist/profiles/query/jsonPathSample.js.map +1 -0
- package/dist/profiles/query/jsonPathSampleRow.cjs.map +1 -0
- package/dist/profiles/query/jsonPathSampleRow.d.ts.map +1 -0
- package/dist/profiles/query/jsonPathSampleRow.js.map +1 -0
- package/dist/profiles/query/kubernetesWorkloadTarget.cjs +43 -0
- package/dist/profiles/query/kubernetesWorkloadTarget.cjs.map +1 -0
- package/dist/profiles/query/kubernetesWorkloadTarget.d.ts +3 -0
- package/dist/profiles/query/kubernetesWorkloadTarget.d.ts.map +1 -0
- package/dist/profiles/query/kubernetesWorkloadTarget.js +43 -0
- package/dist/profiles/query/kubernetesWorkloadTarget.js.map +1 -0
- package/dist/profiles/query/kubernetesWorkloadTargetPicker.cjs +53 -0
- package/dist/profiles/query/kubernetesWorkloadTargetPicker.cjs.map +1 -0
- package/dist/profiles/query/kubernetesWorkloadTargetPicker.d.ts +12 -0
- package/dist/profiles/query/kubernetesWorkloadTargetPicker.d.ts.map +1 -0
- package/dist/profiles/query/kubernetesWorkloadTargetPicker.js +53 -0
- package/dist/profiles/query/kubernetesWorkloadTargetPicker.js.map +1 -0
- package/dist/profiles/query/profileSamplePayload.cjs.map +1 -0
- package/dist/profiles/query/profileSamplePayload.d.ts +13 -0
- package/dist/profiles/query/profileSamplePayload.d.ts.map +1 -0
- package/dist/profiles/query/profileSamplePayload.js.map +1 -0
- package/dist/profiles/query/prometheusResults.cjs +60 -0
- package/dist/profiles/query/prometheusResults.cjs.map +1 -0
- package/dist/profiles/query/prometheusResults.d.ts +7 -0
- package/dist/profiles/query/prometheusResults.d.ts.map +1 -0
- package/dist/profiles/query/prometheusResults.js +60 -0
- package/dist/profiles/query/prometheusResults.js.map +1 -0
- package/dist/profiles/query/queryRowLimits.cjs +82 -0
- package/dist/profiles/query/queryRowLimits.cjs.map +1 -0
- package/dist/profiles/query/queryRowLimits.d.ts +9 -0
- package/dist/profiles/query/queryRowLimits.d.ts.map +1 -0
- package/dist/profiles/query/queryRowLimits.js +82 -0
- package/dist/profiles/query/queryRowLimits.js.map +1 -0
- package/dist/profiles/query/queryRowLimitsModel.cjs.map +1 -0
- package/dist/profiles/query/queryRowLimitsModel.d.ts +9 -0
- package/dist/profiles/query/queryRowLimitsModel.d.ts.map +1 -0
- package/dist/profiles/query/queryRowLimitsModel.js.map +1 -0
- package/dist/profiles/query/queryTargetPicker.cjs +42 -0
- package/dist/profiles/query/queryTargetPicker.cjs.map +1 -0
- package/dist/profiles/query/queryTargetPicker.d.ts +8 -0
- package/dist/profiles/query/queryTargetPicker.d.ts.map +1 -0
- package/dist/profiles/query/queryTargetPicker.js +42 -0
- package/dist/profiles/query/queryTargetPicker.js.map +1 -0
- package/dist/profiles/wizard/index.d.ts +6 -0
- package/dist/profiles/wizard/index.d.ts.map +1 -0
- package/dist/profiles/wizard/profileWizard.cjs +257 -0
- package/dist/profiles/wizard/profileWizard.cjs.map +1 -0
- package/dist/profiles/wizard/profileWizard.d.ts +12 -0
- package/dist/profiles/wizard/profileWizard.d.ts.map +1 -0
- package/dist/profiles/wizard/profileWizard.js +257 -0
- package/dist/profiles/wizard/profileWizard.js.map +1 -0
- package/dist/profiles/wizard/profileWizardHelp.cjs.map +1 -0
- package/dist/profiles/wizard/profileWizardHelp.d.ts.map +1 -0
- package/dist/profiles/wizard/profileWizardHelp.js.map +1 -0
- package/dist/profiles/wizard/profileWizardModel.cjs +204 -0
- package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -0
- package/dist/profiles/wizard/profileWizardModel.d.ts +266 -0
- package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -0
- package/dist/profiles/wizard/profileWizardModel.js +204 -0
- package/dist/profiles/wizard/profileWizardModel.js.map +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +215 -0
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.js +215 -0
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -0
- package/dist/profiles/wizard/profileWizardSteps.cjs +214 -0
- package/dist/profiles/wizard/profileWizardSteps.cjs.map +1 -0
- package/dist/profiles/wizard/profileWizardSteps.d.ts.map +1 -0
- package/dist/profiles/wizard/profileWizardSteps.js +214 -0
- package/dist/profiles/wizard/profileWizardSteps.js.map +1 -0
- package/dist/profiles.cjs +237 -178
- package/dist/profiles.cjs.map +1 -1
- package/dist/profiles.d.ts +8 -55
- package/dist/profiles.d.ts.map +1 -1
- package/dist/profiles.js +117 -58
- package/dist/profiles.js.map +1 -1
- package/dist/rpc/ChatLayer.cjs +27 -0
- package/dist/rpc/ChatLayer.cjs.map +1 -0
- package/dist/rpc/ChatLayer.d.ts +11 -0
- package/dist/rpc/ChatLayer.d.ts.map +1 -0
- package/dist/rpc/ChatLayer.js +27 -0
- package/dist/rpc/ChatLayer.js.map +1 -0
- package/dist/rpc/CommandForm.cjs +9 -19
- package/dist/rpc/CommandForm.cjs.map +1 -1
- package/dist/rpc/CommandForm.d.ts +8 -2
- package/dist/rpc/CommandForm.d.ts.map +1 -1
- package/dist/rpc/CommandForm.js +10 -20
- package/dist/rpc/CommandForm.js.map +1 -1
- package/dist/rpc/CommandOutput.cjs +29 -4
- package/dist/rpc/CommandOutput.cjs.map +1 -1
- package/dist/rpc/CommandOutput.d.ts +6 -2
- package/dist/rpc/CommandOutput.d.ts.map +1 -1
- package/dist/rpc/CommandOutput.js +29 -4
- package/dist/rpc/CommandOutput.js.map +1 -1
- package/dist/rpc/EndpointList.cjs +1 -1
- package/dist/rpc/EndpointList.cjs.map +1 -1
- package/dist/rpc/EndpointList.js +1 -1
- package/dist/rpc/EndpointList.js.map +1 -1
- package/dist/rpc/EntityExplorerApp.cjs +4 -1
- package/dist/rpc/EntityExplorerApp.cjs.map +1 -1
- package/dist/rpc/EntityExplorerApp.d.ts +3 -1
- package/dist/rpc/EntityExplorerApp.d.ts.map +1 -1
- package/dist/rpc/EntityExplorerApp.js +4 -1
- package/dist/rpc/EntityExplorerApp.js.map +1 -1
- package/dist/rpc/FilterForm.cjs +66 -80
- package/dist/rpc/FilterForm.cjs.map +1 -1
- package/dist/rpc/FilterForm.d.ts.map +1 -1
- package/dist/rpc/FilterForm.js +68 -82
- package/dist/rpc/FilterForm.js.map +1 -1
- package/dist/rpc/InlineError.cjs +19 -2
- package/dist/rpc/InlineError.cjs.map +1 -1
- package/dist/rpc/InlineError.d.ts +5 -1
- package/dist/rpc/InlineError.d.ts.map +1 -1
- package/dist/rpc/InlineError.js +19 -2
- package/dist/rpc/InlineError.js.map +1 -1
- package/dist/rpc/OperationActionDialog.cjs +3 -3
- package/dist/rpc/OperationActionDialog.cjs.map +1 -1
- package/dist/rpc/OperationActionDialog.js +3 -3
- package/dist/rpc/OperationActionDialog.js.map +1 -1
- package/dist/rpc/OperationCatalog.cjs +96 -100
- package/dist/rpc/OperationCatalog.cjs.map +1 -1
- package/dist/rpc/OperationCatalog.d.ts.map +1 -1
- package/dist/rpc/OperationCatalog.js +98 -102
- package/dist/rpc/OperationCatalog.js.map +1 -1
- package/dist/rpc/OperationCommandPage.cjs +26 -14
- package/dist/rpc/OperationCommandPage.cjs.map +1 -1
- package/dist/rpc/OperationCommandPage.d.ts.map +1 -1
- package/dist/rpc/OperationCommandPage.js +28 -16
- package/dist/rpc/OperationCommandPage.js.map +1 -1
- package/dist/rpc/OperationEntityContextPicker.cjs +25 -13
- package/dist/rpc/OperationEntityContextPicker.cjs.map +1 -1
- package/dist/rpc/OperationEntityContextPicker.d.ts.map +1 -1
- package/dist/rpc/OperationEntityContextPicker.js +26 -14
- package/dist/rpc/OperationEntityContextPicker.js.map +1 -1
- package/dist/rpc/OperationEntityPage.cjs +2 -8
- package/dist/rpc/OperationEntityPage.cjs.map +1 -1
- package/dist/rpc/OperationEntityPage.d.ts.map +1 -1
- package/dist/rpc/OperationEntityPage.js +2 -8
- package/dist/rpc/OperationEntityPage.js.map +1 -1
- package/dist/rpc/OperationResultView.cjs +13 -2
- package/dist/rpc/OperationResultView.cjs.map +1 -1
- package/dist/rpc/OperationResultView.d.ts +34 -2
- package/dist/rpc/OperationResultView.d.ts.map +1 -1
- package/dist/rpc/OperationResultView.js +13 -2
- package/dist/rpc/OperationResultView.js.map +1 -1
- package/dist/rpc/apiClient.cjs +28 -4
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.d.ts +19 -9
- package/dist/rpc/apiClient.d.ts.map +1 -1
- package/dist/rpc/apiClient.js +29 -5
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/rpc/cursorStale.cjs +35 -0
- package/dist/rpc/cursorStale.cjs.map +1 -0
- package/dist/rpc/cursorStale.d.ts +23 -0
- package/dist/rpc/cursorStale.d.ts.map +1 -0
- package/dist/rpc/cursorStale.js +35 -0
- package/dist/rpc/cursorStale.js.map +1 -0
- package/dist/rpc/executionPages.cjs +94 -0
- package/dist/rpc/executionPages.cjs.map +1 -0
- package/dist/rpc/executionPages.d.ts +18 -0
- package/dist/rpc/executionPages.d.ts.map +1 -0
- package/dist/rpc/executionPages.js +94 -0
- package/dist/rpc/executionPages.js.map +1 -0
- package/dist/rpc/filterShapes.cjs +17 -0
- package/dist/rpc/filterShapes.cjs.map +1 -0
- package/dist/rpc/filterShapes.d.ts +22 -0
- package/dist/rpc/filterShapes.d.ts.map +1 -0
- package/dist/rpc/filterShapes.js +17 -0
- package/dist/rpc/filterShapes.js.map +1 -0
- package/dist/rpc/formMetadata.cjs +228 -57
- package/dist/rpc/formMetadata.cjs.map +1 -1
- package/dist/rpc/formMetadata.d.ts +19 -2
- package/dist/rpc/formMetadata.d.ts.map +1 -1
- package/dist/rpc/formMetadata.js +230 -59
- package/dist/rpc/formMetadata.js.map +1 -1
- package/dist/rpc/operationErrorDiagnostics.cjs +100 -0
- package/dist/rpc/operationErrorDiagnostics.cjs.map +1 -0
- package/dist/rpc/operationErrorDiagnostics.d.ts +4 -0
- package/dist/rpc/operationErrorDiagnostics.d.ts.map +1 -0
- package/dist/rpc/operationErrorDiagnostics.js +100 -0
- package/dist/rpc/operationErrorDiagnostics.js.map +1 -0
- package/dist/rpc/operationFilterSearch.cjs +1 -1
- package/dist/rpc/operationFilterSearch.cjs.map +1 -1
- package/dist/rpc/operationFilterSearch.js +2 -2
- package/dist/rpc/operationFilterSearch.js.map +1 -1
- package/dist/rpc/rpc-story.fixtures.d.ts.map +1 -1
- package/dist/rpc/types.cjs.map +1 -1
- package/dist/rpc/types.d.ts +55 -3
- package/dist/rpc/types.d.ts.map +1 -1
- package/dist/rpc/types.js.map +1 -1
- package/dist/rpc/useOperationPages.cjs +111 -0
- package/dist/rpc/useOperationPages.cjs.map +1 -0
- package/dist/rpc/useOperationPages.d.ts +46 -0
- package/dist/rpc/useOperationPages.d.ts.map +1 -0
- package/dist/rpc/useOperationPages.js +111 -0
- package/dist/rpc/useOperationPages.js.map +1 -0
- package/dist/rpc/useOperations.cjs +7 -4
- package/dist/rpc/useOperations.cjs.map +1 -1
- package/dist/rpc/useOperations.d.ts +4 -4
- package/dist/rpc/useOperations.d.ts.map +1 -1
- package/dist/rpc/useOperations.js +7 -4
- package/dist/rpc/useOperations.js.map +1 -1
- package/dist/rpc.cjs +2 -0
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.ts +3 -2
- 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 +2 -2
- package/dist/tailwind-preset.cjs +6 -3
- package/dist/tailwind-preset.cjs.map +1 -1
- package/dist/tailwind-preset.d.ts.map +1 -1
- package/dist/tailwind-preset.js +6 -3
- package/dist/tailwind-preset.js.map +1 -1
- package/dist/utils.cjs +6 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +6 -0
- package/dist/utils.js.map +1 -1
- package/package.json +6 -5
- package/dist/profiles/catalogTree.cjs +0 -133
- package/dist/profiles/catalogTree.cjs.map +0 -1
- package/dist/profiles/catalogTree.d.ts.map +0 -1
- package/dist/profiles/catalogTree.js +0 -133
- package/dist/profiles/catalogTree.js.map +0 -1
- package/dist/profiles/connectionBrowserModel.cjs +0 -185
- package/dist/profiles/connectionBrowserModel.cjs.map +0 -1
- package/dist/profiles/connectionBrowserModel.d.ts +0 -169
- package/dist/profiles/connectionBrowserModel.d.ts.map +0 -1
- package/dist/profiles/connectionBrowserModel.js +0 -185
- package/dist/profiles/connectionBrowserModel.js.map +0 -1
- package/dist/profiles/connectionQueryWorkspace.cjs +0 -185
- package/dist/profiles/connectionQueryWorkspace.cjs.map +0 -1
- package/dist/profiles/connectionQueryWorkspace.d.ts +0 -63
- package/dist/profiles/connectionQueryWorkspace.d.ts.map +0 -1
- package/dist/profiles/connectionQueryWorkspace.js +0 -185
- package/dist/profiles/connectionQueryWorkspace.js.map +0 -1
- package/dist/profiles/connectionQueryWorkspaceModel.cjs +0 -28
- package/dist/profiles/connectionQueryWorkspaceModel.cjs.map +0 -1
- package/dist/profiles/connectionQueryWorkspaceModel.d.ts +0 -38
- package/dist/profiles/connectionQueryWorkspaceModel.d.ts.map +0 -1
- package/dist/profiles/connectionQueryWorkspaceModel.js +0 -28
- package/dist/profiles/connectionQueryWorkspaceModel.js.map +0 -1
- package/dist/profiles/esFieldValues.cjs +0 -64
- package/dist/profiles/esFieldValues.cjs.map +0 -1
- package/dist/profiles/esFieldValues.d.ts +0 -48
- package/dist/profiles/esFieldValues.d.ts.map +0 -1
- package/dist/profiles/esFieldValues.js +0 -64
- package/dist/profiles/esFieldValues.js.map +0 -1
- package/dist/profiles/esParamMappingModel.cjs +0 -301
- package/dist/profiles/esParamMappingModel.cjs.map +0 -1
- package/dist/profiles/esParamMappingModel.d.ts +0 -37
- package/dist/profiles/esParamMappingModel.d.ts.map +0 -1
- package/dist/profiles/esParamMappingModel.js +0 -301
- package/dist/profiles/esParamMappingModel.js.map +0 -1
- package/dist/profiles/esParamMappingPill.cjs.map +0 -1
- package/dist/profiles/esParamMappingPill.d.ts.map +0 -1
- package/dist/profiles/esParamMappingPill.js.map +0 -1
- package/dist/profiles/esParamOperandExtension.cjs +0 -75
- package/dist/profiles/esParamOperandExtension.cjs.map +0 -1
- package/dist/profiles/esParamOperandExtension.d.ts +0 -11
- package/dist/profiles/esParamOperandExtension.d.ts.map +0 -1
- package/dist/profiles/esParamOperandExtension.js +0 -75
- package/dist/profiles/esParamOperandExtension.js.map +0 -1
- package/dist/profiles/esQueryBuilder.cjs +0 -205
- package/dist/profiles/esQueryBuilder.cjs.map +0 -1
- package/dist/profiles/esQueryBuilder.d.ts +0 -35
- package/dist/profiles/esQueryBuilder.d.ts.map +0 -1
- package/dist/profiles/esQueryBuilder.js +0 -205
- package/dist/profiles/esQueryBuilder.js.map +0 -1
- package/dist/profiles/esQueryBuilderExtension.cjs.map +0 -1
- package/dist/profiles/esQueryBuilderExtension.d.ts +0 -5
- package/dist/profiles/esQueryBuilderExtension.d.ts.map +0 -1
- package/dist/profiles/esQueryBuilderExtension.js.map +0 -1
- package/dist/profiles/esQueryBuilderForm.cjs +0 -26
- package/dist/profiles/esQueryBuilderForm.cjs.map +0 -1
- package/dist/profiles/esQueryBuilderForm.d.ts +0 -18
- package/dist/profiles/esQueryBuilderForm.d.ts.map +0 -1
- package/dist/profiles/esQueryBuilderForm.js +0 -26
- package/dist/profiles/esQueryBuilderForm.js.map +0 -1
- package/dist/profiles/esQueryBuilderModel.cjs.map +0 -1
- package/dist/profiles/esQueryBuilderModel.d.ts +0 -108
- package/dist/profiles/esQueryBuilderModel.d.ts.map +0 -1
- package/dist/profiles/esQueryBuilderModel.js.map +0 -1
- package/dist/profiles/esQueryClauseGroup.cjs +0 -144
- package/dist/profiles/esQueryClauseGroup.cjs.map +0 -1
- package/dist/profiles/esQueryClauseGroup.d.ts.map +0 -1
- package/dist/profiles/esQueryClauseGroup.js +0 -144
- package/dist/profiles/esQueryClauseGroup.js.map +0 -1
- package/dist/profiles/esQueryCompile.cjs +0 -47
- package/dist/profiles/esQueryCompile.cjs.map +0 -1
- package/dist/profiles/esQueryCompile.d.ts +0 -39
- package/dist/profiles/esQueryCompile.d.ts.map +0 -1
- package/dist/profiles/esQueryCompile.js +0 -47
- package/dist/profiles/esQueryCompile.js.map +0 -1
- package/dist/profiles/esQueryConditionRow.cjs +0 -168
- package/dist/profiles/esQueryConditionRow.cjs.map +0 -1
- package/dist/profiles/esQueryConditionRow.d.ts +0 -37
- package/dist/profiles/esQueryConditionRow.d.ts.map +0 -1
- package/dist/profiles/esQueryConditionRow.js +0 -168
- package/dist/profiles/esQueryConditionRow.js.map +0 -1
- package/dist/profiles/esQueryGroupModel.cjs.map +0 -1
- package/dist/profiles/esQueryGroupModel.d.ts.map +0 -1
- package/dist/profiles/esQueryGroupModel.js.map +0 -1
- package/dist/profiles/esQueryOccur.cjs.map +0 -1
- package/dist/profiles/esQueryOccur.d.ts.map +0 -1
- package/dist/profiles/esQueryOccur.js.map +0 -1
- package/dist/profiles/esQueryOperandEditors.cjs +0 -279
- package/dist/profiles/esQueryOperandEditors.cjs.map +0 -1
- package/dist/profiles/esQueryOperandEditors.d.ts +0 -24
- package/dist/profiles/esQueryOperandEditors.d.ts.map +0 -1
- package/dist/profiles/esQueryOperandEditors.js +0 -279
- package/dist/profiles/esQueryOperandEditors.js.map +0 -1
- package/dist/profiles/esQueryOperandModel.cjs.map +0 -1
- package/dist/profiles/esQueryOperandModel.d.ts +0 -17
- package/dist/profiles/esQueryOperandModel.d.ts.map +0 -1
- package/dist/profiles/esQueryOperandModel.js.map +0 -1
- package/dist/profiles/esQueryOperators.cjs +0 -165
- package/dist/profiles/esQueryOperators.cjs.map +0 -1
- package/dist/profiles/esQueryOperators.d.ts +0 -83
- package/dist/profiles/esQueryOperators.d.ts.map +0 -1
- package/dist/profiles/esQueryOperators.js +0 -165
- package/dist/profiles/esQueryOperators.js.map +0 -1
- package/dist/profiles/esQueryOutputEditor.cjs +0 -138
- package/dist/profiles/esQueryOutputEditor.cjs.map +0 -1
- package/dist/profiles/esQueryOutputEditor.d.ts +0 -7
- package/dist/profiles/esQueryOutputEditor.d.ts.map +0 -1
- package/dist/profiles/esQueryOutputEditor.js +0 -138
- package/dist/profiles/esQueryOutputEditor.js.map +0 -1
- package/dist/profiles/esQueryOutputModel.cjs.map +0 -1
- package/dist/profiles/esQueryOutputModel.d.ts.map +0 -1
- package/dist/profiles/esQueryOutputModel.js.map +0 -1
- package/dist/profiles/esQueryPreview.cjs.map +0 -1
- package/dist/profiles/esQueryPreview.d.ts.map +0 -1
- package/dist/profiles/esQueryPreview.js.map +0 -1
- package/dist/profiles/esQuerySortEditor.cjs +0 -143
- package/dist/profiles/esQuerySortEditor.cjs.map +0 -1
- package/dist/profiles/esQuerySortEditor.d.ts.map +0 -1
- package/dist/profiles/esQuerySortEditor.js +0 -143
- package/dist/profiles/esQuerySortEditor.js.map +0 -1
- package/dist/profiles/esQuerySortModel.cjs.map +0 -1
- package/dist/profiles/esQuerySortModel.d.ts.map +0 -1
- package/dist/profiles/esQuerySortModel.js.map +0 -1
- package/dist/profiles/esValueCombobox.cjs +0 -86
- package/dist/profiles/esValueCombobox.cjs.map +0 -1
- package/dist/profiles/esValueCombobox.d.ts.map +0 -1
- package/dist/profiles/esValueCombobox.js +0 -86
- package/dist/profiles/esValueCombobox.js.map +0 -1
- package/dist/profiles/jsonPathSample.cjs +0 -75
- package/dist/profiles/jsonPathSample.cjs.map +0 -1
- package/dist/profiles/jsonPathSample.d.ts +0 -27
- package/dist/profiles/jsonPathSample.d.ts.map +0 -1
- package/dist/profiles/jsonPathSample.js +0 -75
- package/dist/profiles/jsonPathSample.js.map +0 -1
- package/dist/profiles/jsonPathSampleRow.cjs.map +0 -1
- package/dist/profiles/jsonPathSampleRow.d.ts.map +0 -1
- package/dist/profiles/jsonPathSampleRow.js.map +0 -1
- package/dist/profiles/profileBuilder.cjs +0 -65
- package/dist/profiles/profileBuilder.cjs.map +0 -1
- package/dist/profiles/profileBuilder.d.ts.map +0 -1
- package/dist/profiles/profileBuilder.js +0 -65
- package/dist/profiles/profileBuilder.js.map +0 -1
- package/dist/profiles/profileBuilderExtension.cjs.map +0 -1
- package/dist/profiles/profileBuilderExtension.d.ts +0 -5
- package/dist/profiles/profileBuilderExtension.d.ts.map +0 -1
- package/dist/profiles/profileBuilderExtension.js.map +0 -1
- package/dist/profiles/profileBuilderWorkspace.cjs +0 -368
- package/dist/profiles/profileBuilderWorkspace.cjs.map +0 -1
- package/dist/profiles/profileBuilderWorkspace.d.ts +0 -21
- package/dist/profiles/profileBuilderWorkspace.d.ts.map +0 -1
- package/dist/profiles/profileBuilderWorkspace.js +0 -368
- package/dist/profiles/profileBuilderWorkspace.js.map +0 -1
- package/dist/profiles/profileColumnModel.cjs.map +0 -1
- package/dist/profiles/profileColumnModel.d.ts +0 -8
- package/dist/profiles/profileColumnModel.d.ts.map +0 -1
- package/dist/profiles/profileColumnModel.js.map +0 -1
- package/dist/profiles/profileColumnPicker.cjs +0 -68
- package/dist/profiles/profileColumnPicker.cjs.map +0 -1
- package/dist/profiles/profileColumnPicker.d.ts +0 -11
- package/dist/profiles/profileColumnPicker.d.ts.map +0 -1
- package/dist/profiles/profileColumnPicker.js +0 -68
- package/dist/profiles/profileColumnPicker.js.map +0 -1
- package/dist/profiles/profileEditor.cjs +0 -386
- package/dist/profiles/profileEditor.cjs.map +0 -1
- package/dist/profiles/profileEditor.d.ts +0 -19
- package/dist/profiles/profileEditor.d.ts.map +0 -1
- package/dist/profiles/profileEditor.js +0 -386
- package/dist/profiles/profileEditor.js.map +0 -1
- package/dist/profiles/profileEditorModel.cjs +0 -181
- package/dist/profiles/profileEditorModel.cjs.map +0 -1
- package/dist/profiles/profileEditorModel.d.ts +0 -74
- package/dist/profiles/profileEditorModel.d.ts.map +0 -1
- package/dist/profiles/profileEditorModel.js +0 -181
- package/dist/profiles/profileEditorModel.js.map +0 -1
- package/dist/profiles/profileEditorPreview.cjs.map +0 -1
- package/dist/profiles/profileEditorPreview.d.ts +0 -12
- package/dist/profiles/profileEditorPreview.d.ts.map +0 -1
- package/dist/profiles/profileEditorPreview.js.map +0 -1
- package/dist/profiles/profileEditorRail.cjs.map +0 -1
- package/dist/profiles/profileEditorRail.d.ts.map +0 -1
- package/dist/profiles/profileEditorRail.js.map +0 -1
- package/dist/profiles/profileEditorRaw.cjs +0 -118
- package/dist/profiles/profileEditorRaw.cjs.map +0 -1
- package/dist/profiles/profileEditorRaw.d.ts +0 -7
- package/dist/profiles/profileEditorRaw.d.ts.map +0 -1
- package/dist/profiles/profileEditorRaw.js +0 -118
- package/dist/profiles/profileEditorRaw.js.map +0 -1
- package/dist/profiles/profileEditorRoutes.cjs.map +0 -1
- package/dist/profiles/profileEditorRoutes.d.ts.map +0 -1
- package/dist/profiles/profileEditorRoutes.js.map +0 -1
- package/dist/profiles/profileEditorSections.cjs +0 -213
- package/dist/profiles/profileEditorSections.cjs.map +0 -1
- package/dist/profiles/profileEditorSections.d.ts +0 -23
- package/dist/profiles/profileEditorSections.d.ts.map +0 -1
- package/dist/profiles/profileEditorSections.js +0 -213
- package/dist/profiles/profileEditorSections.js.map +0 -1
- package/dist/profiles/profileFieldEditor.cjs +0 -200
- package/dist/profiles/profileFieldEditor.cjs.map +0 -1
- package/dist/profiles/profileFieldEditor.d.ts +0 -34
- package/dist/profiles/profileFieldEditor.d.ts.map +0 -1
- package/dist/profiles/profileFieldEditor.js +0 -200
- package/dist/profiles/profileFieldEditor.js.map +0 -1
- package/dist/profiles/profileFieldGrid.cjs +0 -250
- package/dist/profiles/profileFieldGrid.cjs.map +0 -1
- package/dist/profiles/profileFieldGrid.d.ts +0 -20
- package/dist/profiles/profileFieldGrid.d.ts.map +0 -1
- package/dist/profiles/profileFieldGrid.js +0 -250
- package/dist/profiles/profileFieldGrid.js.map +0 -1
- package/dist/profiles/profileFieldManager.cjs +0 -103
- package/dist/profiles/profileFieldManager.cjs.map +0 -1
- package/dist/profiles/profileFieldManager.d.ts.map +0 -1
- package/dist/profiles/profileFieldManager.js +0 -103
- package/dist/profiles/profileFieldManager.js.map +0 -1
- package/dist/profiles/profileFieldState.cjs +0 -136
- package/dist/profiles/profileFieldState.cjs.map +0 -1
- package/dist/profiles/profileFieldState.d.ts +0 -41
- package/dist/profiles/profileFieldState.d.ts.map +0 -1
- package/dist/profiles/profileFieldState.js +0 -136
- package/dist/profiles/profileFieldState.js.map +0 -1
- package/dist/profiles/profileFieldTypes.cjs.map +0 -1
- package/dist/profiles/profileFieldTypes.d.ts +0 -8
- package/dist/profiles/profileFieldTypes.d.ts.map +0 -1
- package/dist/profiles/profileFieldTypes.js.map +0 -1
- package/dist/profiles/profileParamModel.cjs.map +0 -1
- package/dist/profiles/profileParamModel.d.ts +0 -3
- package/dist/profiles/profileParamModel.d.ts.map +0 -1
- package/dist/profiles/profileParamModel.js.map +0 -1
- package/dist/profiles/profileSamplePayload.cjs.map +0 -1
- package/dist/profiles/profileSamplePayload.d.ts +0 -13
- package/dist/profiles/profileSamplePayload.d.ts.map +0 -1
- package/dist/profiles/profileSamplePayload.js.map +0 -1
- package/dist/profiles/profileWizard.cjs +0 -257
- package/dist/profiles/profileWizard.cjs.map +0 -1
- package/dist/profiles/profileWizard.d.ts +0 -12
- package/dist/profiles/profileWizard.d.ts.map +0 -1
- package/dist/profiles/profileWizard.js +0 -257
- package/dist/profiles/profileWizard.js.map +0 -1
- package/dist/profiles/profileWizardHelp.cjs.map +0 -1
- package/dist/profiles/profileWizardHelp.d.ts.map +0 -1
- package/dist/profiles/profileWizardHelp.js.map +0 -1
- package/dist/profiles/profileWizardModel.cjs +0 -198
- package/dist/profiles/profileWizardModel.cjs.map +0 -1
- package/dist/profiles/profileWizardModel.d.ts +0 -255
- package/dist/profiles/profileWizardModel.d.ts.map +0 -1
- package/dist/profiles/profileWizardModel.js +0 -198
- package/dist/profiles/profileWizardModel.js.map +0 -1
- package/dist/profiles/profileWizardQueryStep.cjs +0 -215
- package/dist/profiles/profileWizardQueryStep.cjs.map +0 -1
- package/dist/profiles/profileWizardQueryStep.d.ts.map +0 -1
- package/dist/profiles/profileWizardQueryStep.js +0 -215
- package/dist/profiles/profileWizardQueryStep.js.map +0 -1
- package/dist/profiles/profileWizardSteps.cjs +0 -214
- package/dist/profiles/profileWizardSteps.cjs.map +0 -1
- package/dist/profiles/profileWizardSteps.d.ts.map +0 -1
- package/dist/profiles/profileWizardSteps.js +0 -214
- package/dist/profiles/profileWizardSteps.js.map +0 -1
- package/dist/profiles/profileYaml.cjs +0 -19
- package/dist/profiles/profileYaml.cjs.map +0 -1
- package/dist/profiles/profileYaml.d.ts +0 -4
- package/dist/profiles/profileYaml.d.ts.map +0 -1
- package/dist/profiles/profileYaml.js +0 -19
- package/dist/profiles/profileYaml.js.map +0 -1
- package/dist/profiles/prometheusResults.cjs +0 -60
- package/dist/profiles/prometheusResults.cjs.map +0 -1
- package/dist/profiles/prometheusResults.d.ts +0 -7
- package/dist/profiles/prometheusResults.d.ts.map +0 -1
- package/dist/profiles/prometheusResults.js +0 -60
- package/dist/profiles/prometheusResults.js.map +0 -1
- package/dist/profiles/queryRowLimits.cjs +0 -82
- package/dist/profiles/queryRowLimits.cjs.map +0 -1
- package/dist/profiles/queryRowLimits.d.ts +0 -9
- package/dist/profiles/queryRowLimits.d.ts.map +0 -1
- package/dist/profiles/queryRowLimits.js +0 -82
- package/dist/profiles/queryRowLimits.js.map +0 -1
- package/dist/profiles/queryRowLimitsModel.cjs.map +0 -1
- package/dist/profiles/queryRowLimitsModel.d.ts +0 -9
- package/dist/profiles/queryRowLimitsModel.d.ts.map +0 -1
- package/dist/profiles/queryRowLimitsModel.js.map +0 -1
- package/dist/profiles/queryTargetPicker.cjs +0 -42
- package/dist/profiles/queryTargetPicker.cjs.map +0 -1
- package/dist/profiles/queryTargetPicker.d.ts +0 -8
- package/dist/profiles/queryTargetPicker.d.ts.map +0 -1
- package/dist/profiles/queryTargetPicker.js +0 -42
- package/dist/profiles/queryTargetPicker.js.map +0 -1
- package/dist/profiles/testSchema.d.ts +0 -3
- package/dist/profiles/testSchema.d.ts.map +0 -1
- /package/dist/profiles/{catalogTree.d.ts → connections/catalogTree.d.ts} +0 -0
- /package/dist/profiles/{profileBuilder.d.ts → editor/profileBuilder.d.ts} +0 -0
- /package/dist/profiles/{profileBuilderExtension.cjs → editor/profileBuilderExtension.cjs} +0 -0
- /package/dist/profiles/{profileBuilderExtension.js → editor/profileBuilderExtension.js} +0 -0
- /package/dist/profiles/{profileEditorPreview.cjs → editor/profileEditorPreview.cjs} +0 -0
- /package/dist/profiles/{profileEditorPreview.js → editor/profileEditorPreview.js} +0 -0
- /package/dist/profiles/{profileEditorRail.cjs → editor/profileEditorRail.cjs} +0 -0
- /package/dist/profiles/{profileEditorRail.d.ts → editor/profileEditorRail.d.ts} +0 -0
- /package/dist/profiles/{profileEditorRail.js → editor/profileEditorRail.js} +0 -0
- /package/dist/profiles/{profileEditorRoutes.cjs → editor/profileEditorRoutes.cjs} +0 -0
- /package/dist/profiles/{profileEditorRoutes.d.ts → editor/profileEditorRoutes.d.ts} +0 -0
- /package/dist/profiles/{profileEditorRoutes.js → editor/profileEditorRoutes.js} +0 -0
- /package/dist/profiles/{esParamMappingPill.cjs → elasticsearch/esParamMappingPill.cjs} +0 -0
- /package/dist/profiles/{esParamMappingPill.d.ts → elasticsearch/esParamMappingPill.d.ts} +0 -0
- /package/dist/profiles/{esParamMappingPill.js → elasticsearch/esParamMappingPill.js} +0 -0
- /package/dist/profiles/{esQueryBuilderExtension.cjs → elasticsearch/esQueryBuilderExtension.cjs} +0 -0
- /package/dist/profiles/{esQueryBuilderExtension.js → elasticsearch/esQueryBuilderExtension.js} +0 -0
- /package/dist/profiles/{esQueryBuilderModel.cjs → elasticsearch/esQueryBuilderModel.cjs} +0 -0
- /package/dist/profiles/{esQueryBuilderModel.js → elasticsearch/esQueryBuilderModel.js} +0 -0
- /package/dist/profiles/{esQueryClauseGroup.d.ts → elasticsearch/esQueryClauseGroup.d.ts} +0 -0
- /package/dist/profiles/{esQueryGroupModel.cjs → elasticsearch/esQueryGroupModel.cjs} +0 -0
- /package/dist/profiles/{esQueryGroupModel.d.ts → elasticsearch/esQueryGroupModel.d.ts} +0 -0
- /package/dist/profiles/{esQueryGroupModel.js → elasticsearch/esQueryGroupModel.js} +0 -0
- /package/dist/profiles/{esQueryOccur.cjs → elasticsearch/esQueryOccur.cjs} +0 -0
- /package/dist/profiles/{esQueryOccur.d.ts → elasticsearch/esQueryOccur.d.ts} +0 -0
- /package/dist/profiles/{esQueryOccur.js → elasticsearch/esQueryOccur.js} +0 -0
- /package/dist/profiles/{esQueryOperandModel.cjs → elasticsearch/esQueryOperandModel.cjs} +0 -0
- /package/dist/profiles/{esQueryOperandModel.js → elasticsearch/esQueryOperandModel.js} +0 -0
- /package/dist/profiles/{esQueryOutputModel.cjs → elasticsearch/esQueryOutputModel.cjs} +0 -0
- /package/dist/profiles/{esQueryOutputModel.d.ts → elasticsearch/esQueryOutputModel.d.ts} +0 -0
- /package/dist/profiles/{esQueryOutputModel.js → elasticsearch/esQueryOutputModel.js} +0 -0
- /package/dist/profiles/{esQueryPreview.cjs → elasticsearch/esQueryPreview.cjs} +0 -0
- /package/dist/profiles/{esQueryPreview.d.ts → elasticsearch/esQueryPreview.d.ts} +0 -0
- /package/dist/profiles/{esQueryPreview.js → elasticsearch/esQueryPreview.js} +0 -0
- /package/dist/profiles/{esQuerySortEditor.d.ts → elasticsearch/esQuerySortEditor.d.ts} +0 -0
- /package/dist/profiles/{esQuerySortModel.cjs → elasticsearch/esQuerySortModel.cjs} +0 -0
- /package/dist/profiles/{esQuerySortModel.d.ts → elasticsearch/esQuerySortModel.d.ts} +0 -0
- /package/dist/profiles/{esQuerySortModel.js → elasticsearch/esQuerySortModel.js} +0 -0
- /package/dist/profiles/{esValueCombobox.d.ts → elasticsearch/esValueCombobox.d.ts} +0 -0
- /package/dist/profiles/{profileColumnModel.cjs → fields/profileColumnModel.cjs} +0 -0
- /package/dist/profiles/{profileColumnModel.js → fields/profileColumnModel.js} +0 -0
- /package/dist/profiles/{profileFieldManager.d.ts → fields/profileFieldManager.d.ts} +0 -0
- /package/dist/profiles/{profileFieldTypes.cjs → fields/profileFieldTypes.cjs} +0 -0
- /package/dist/profiles/{profileFieldTypes.js → fields/profileFieldTypes.js} +0 -0
- /package/dist/profiles/{profileParamModel.cjs → fields/profileParamModel.cjs} +0 -0
- /package/dist/profiles/{profileParamModel.js → fields/profileParamModel.js} +0 -0
- /package/dist/profiles/{jsonPathSampleRow.cjs → query/jsonPathSampleRow.cjs} +0 -0
- /package/dist/profiles/{jsonPathSampleRow.d.ts → query/jsonPathSampleRow.d.ts} +0 -0
- /package/dist/profiles/{jsonPathSampleRow.js → query/jsonPathSampleRow.js} +0 -0
- /package/dist/profiles/{profileSamplePayload.cjs → query/profileSamplePayload.cjs} +0 -0
- /package/dist/profiles/{profileSamplePayload.js → query/profileSamplePayload.js} +0 -0
- /package/dist/profiles/{queryRowLimitsModel.cjs → query/queryRowLimitsModel.cjs} +0 -0
- /package/dist/profiles/{queryRowLimitsModel.js → query/queryRowLimitsModel.js} +0 -0
- /package/dist/profiles/{profileWizardHelp.cjs → wizard/profileWizardHelp.cjs} +0 -0
- /package/dist/profiles/{profileWizardHelp.d.ts → wizard/profileWizardHelp.d.ts} +0 -0
- /package/dist/profiles/{profileWizardHelp.js → wizard/profileWizardHelp.js} +0 -0
- /package/dist/profiles/{profileWizardQueryStep.d.ts → wizard/profileWizardQueryStep.d.ts} +0 -0
- /package/dist/profiles/{profileWizardSteps.d.ts → wizard/profileWizardSteps.d.ts} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils = require("../lib/utils.cjs");
|
|
4
4
|
const jsonSchemaFormSize = require("./json-schema-form-size.cjs");
|
|
5
|
-
const INPUT_BASE = "w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-
|
|
5
|
+
const INPUT_BASE = "w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring";
|
|
6
6
|
function inputClass(size) {
|
|
7
7
|
return utils.cn(INPUT_BASE, jsonSchemaFormSize.inputSizeClass[size]);
|
|
8
8
|
}
|
|
@@ -39,8 +39,9 @@ function toText(value) {
|
|
|
39
39
|
if (typeof value === "object") return "";
|
|
40
40
|
return String(value);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
42
|
+
function toStringArray(value) {
|
|
43
|
+
if (!Array.isArray(value)) return [];
|
|
44
|
+
return value.filter((entry) => typeof entry === "string");
|
|
44
45
|
}
|
|
45
46
|
function hasObjectItemProperties(items) {
|
|
46
47
|
return !!items && !!items.properties && Object.keys(items.properties).length > 0;
|
|
@@ -61,13 +62,6 @@ const DEFAULT_COLUMN_MIN_WIDTH = "15rem";
|
|
|
61
62
|
function cssLength(value, fallback) {
|
|
62
63
|
return typeof value === "string" && value.trim() ? value.trim() : fallback;
|
|
63
64
|
}
|
|
64
|
-
function duplicateIndex(items, index) {
|
|
65
|
-
const source = items[index];
|
|
66
|
-
const copy = Array.isArray(source) ? [...source] : isPlainObject(source) ? { ...source } : source;
|
|
67
|
-
const next = [...items];
|
|
68
|
-
next.splice(index + 1, 0, copy);
|
|
69
|
-
return next;
|
|
70
|
-
}
|
|
71
65
|
function withSyntheticValue(options, value) {
|
|
72
66
|
if (!value || options.some((o) => o.value === value)) return options;
|
|
73
67
|
return [{ value, label: value }, ...options];
|
|
@@ -128,19 +122,6 @@ function softError(field) {
|
|
|
128
122
|
}
|
|
129
123
|
return void 0;
|
|
130
124
|
}
|
|
131
|
-
function setIndex(arr, i, v) {
|
|
132
|
-
return arr.map((x, idx) => idx === i ? v : x);
|
|
133
|
-
}
|
|
134
|
-
function removeIndex(arr, i) {
|
|
135
|
-
return arr.filter((_, idx) => idx !== i);
|
|
136
|
-
}
|
|
137
|
-
function moveItem(arr, from, to) {
|
|
138
|
-
if (to < 0 || to >= arr.length) return arr;
|
|
139
|
-
const next = [...arr];
|
|
140
|
-
const [moved] = next.splice(from, 1);
|
|
141
|
-
next.splice(to, 0, moved);
|
|
142
|
-
return next;
|
|
143
|
-
}
|
|
144
125
|
function seedFromSchema(schema) {
|
|
145
126
|
if (schema.default !== void 0) return schema.default;
|
|
146
127
|
const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
|
|
@@ -153,27 +134,23 @@ exports.DEFAULT_COLUMN_MIN_WIDTH = DEFAULT_COLUMN_MIN_WIDTH;
|
|
|
153
134
|
exports.comboboxAriaProps = comboboxAriaProps;
|
|
154
135
|
exports.cssLength = cssLength;
|
|
155
136
|
exports.defaultPlaceholder = defaultPlaceholder;
|
|
156
|
-
exports.duplicateIndex = duplicateIndex;
|
|
157
137
|
exports.fieldAriaProps = fieldAriaProps;
|
|
158
138
|
exports.fieldErrorId = fieldErrorId;
|
|
159
139
|
exports.fieldInputId = fieldInputId;
|
|
160
140
|
exports.hasObjectItemProperties = hasObjectItemProperties;
|
|
161
141
|
exports.inputClass = inputClass;
|
|
162
142
|
exports.isEmptyValue = isEmptyValue;
|
|
163
|
-
exports.isPlainObject = isPlainObject;
|
|
164
143
|
exports.keyPickerOptions = keyPickerOptions;
|
|
165
144
|
exports.matchesFieldFilter = matchesFieldFilter;
|
|
166
|
-
exports.moveItem = moveItem;
|
|
167
145
|
exports.normalizeColSpan = normalizeColSpan;
|
|
168
146
|
exports.normalizeColumns = normalizeColumns;
|
|
169
147
|
exports.orderByClickyOrder = orderByClickyOrder;
|
|
170
148
|
exports.orderByPriority = orderByPriority;
|
|
171
149
|
exports.orderByXOrder = orderByXOrder;
|
|
172
150
|
exports.orderRequiredFirst = orderRequiredFirst;
|
|
173
|
-
exports.removeIndex = removeIndex;
|
|
174
151
|
exports.seedFromSchema = seedFromSchema;
|
|
175
|
-
exports.setIndex = setIndex;
|
|
176
152
|
exports.softError = softError;
|
|
153
|
+
exports.toStringArray = toStringArray;
|
|
177
154
|
exports.toText = toText;
|
|
178
155
|
exports.withSyntheticValue = withSyntheticValue;
|
|
179
156
|
//# sourceMappingURL=json-schema-form-utils.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-utils.cjs","sources":["../../src/components/json-schema-form-utils.ts"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { inputSizeClass, type FormSize } from \"./json-schema-form-size\";\nimport type {\n FieldControl,\n FieldOption,\n GridColumns,\n JsonSchemaProperty,\n} from \"./json-schema-form-types\";\n\n// Non-size styling shared by every text-like input box; the size token supplies\n// height, horizontal padding, and text size (see inputSizeClass).\nconst INPUT_BASE =\n \"w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring\";\n\nexport function inputClass(size: FormSize): string {\n return cn(INPUT_BASE, inputSizeClass[size]);\n}\n\n// encodeIdPart escapes one path token (or the id prefix) injectively: every\n// character outside [A-Za-z0-9] becomes `_<hex char code>_`, and the empty token\n// — a legal JSON Schema property name — becomes a lone `_`. The escape is\n// self-delimiting (it always starts and ends with `_`, and a literal `_` escapes\n// to `_5f_`), so distinct tokens can never share an encoding and `-` stays free\n// as a segment separator. Percent-encoding was rejected because `%` in an id,\n// while legal HTML, has to be escaped again inside a `#id` CSS selector; this\n// alphabet ([A-Za-z0-9_-]) is safe as-is for `document.querySelector`.\nfunction encodeIdPart(value: string): string {\n if (value === \"\") return \"_\";\n return value.replace(/[^A-Za-z0-9]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n// fieldInputId derives a control's DOM id from its JSON-pointer instance path,\n// not from its leaf key: a schema that repeats a property name under two parents\n// (e.g. /journalLine1/asset and /journalLine2/asset) must not produce the same\n// id, or every `label[for]` binds to the first control. Each decoded pointer\n// token is escaped with encodeIdPart and joined with \"-\", so distinct paths\n// always produce distinct ids: \"/asset-class\", \"/asset_class\", \"/asset.class\"\n// and \"/asset/class\" are four different ids, and an empty token is preserved\n// (\"/a//b\" ≠ \"/a/b\"). The prefix is escaped the same way, so prefix \"a\" + \"/b-c\"\n// cannot collide with prefix \"a-b\" + \"/c\".\nexport function fieldInputId(instancePath: string, prefix?: string): string {\n const tokens = instancePath === \"\" ? [] : instancePath.replace(/^\\//, \"\").split(\"/\");\n const safe = tokens\n .map((token) => encodeIdPart(token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\")))\n .join(\"-\");\n return prefix ? `jsf-${encodeIdPart(prefix)}-${safe}` : `jsf-${safe}`;\n}\n\n// fieldErrorId names the element that holds a field's validation messages, so a\n// control can point at it with aria-describedby.\nexport function fieldErrorId(fieldId: string): string {\n return `${fieldId}-error`;\n}\n\n// fieldAriaProps is the assistive-technology half of a control: the visual `*`\n// and red message mean nothing to a screen reader on their own, so every\n// editable control spreads these onto its input element.\nexport function fieldAriaProps(\n field: FieldControl,\n fieldId: string,\n): {\n \"aria-required\"?: true;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n} {\n return {\n ...(field.required ? { \"aria-required\": true as const } : {}),\n ...(field.invalid ? { \"aria-invalid\": true as const, \"aria-describedby\": fieldErrorId(fieldId) } : {}),\n };\n}\n\n// comboboxAriaProps is the fieldAriaProps equivalent for Combobox, which takes\n// the same state as named props rather than raw aria-* attributes.\nexport function comboboxAriaProps(\n field: FieldControl,\n fieldId: string,\n): { ariaRequired?: true; invalid?: true; describedBy?: string } {\n return {\n ...(field.required ? { ariaRequired: true as const } : {}),\n ...(field.invalid ? { invalid: true as const, describedBy: fieldErrorId(fieldId) } : {}),\n };\n}\n\nexport function defaultPlaceholder(schema: JsonSchemaProperty): string {\n if (schema.default != null && typeof schema.default !== \"object\") return String(schema.default);\n return \"\";\n}\n\nexport function toText(value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"object\") return \"\";\n return String(value);\n}\n\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// hasObjectItemProperties reports whether an array's items are objects with a\n// fixed `properties` set — the precondition for both the column-per-property\n// table and the summary-row accordion, which need to know the item's shape.\nexport function hasObjectItemProperties(\n items: JsonSchemaProperty | undefined,\n): boolean {\n return (\n !!items && !!items.properties && Object.keys(items.properties).length > 0\n );\n}\n\n// Object-level `x-columns`: how many equal columns to split a stacked object\n// into. \"auto\" fits as many as the width allows. A number is clamped to [1, 12]\n// (a standard 12-track grid, so a 3-across row of span-4 fields and a 4-across\n// row of span-3 fields share one object); anything invalid is a single column.\nexport function normalizeColumns(value: unknown): GridColumns {\n if (value === \"auto\") return \"auto\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), 12);\n}\n\n// Per-field `x-col-span`: how many of the object's columns a field occupies.\n// \"full\" spans the whole row. Under `x-columns: \"auto\"` a numeric span cannot be\n// clamped against a track count that only exists at layout time, so it is capped\n// at the 12-track maximum instead. Invalid falls back to 1.\nexport function normalizeColSpan(\n value: unknown,\n columns: GridColumns,\n): number | \"full\" {\n if (value === \"full\") return \"full\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), columns === \"auto\" ? 12 : columns);\n}\n\n// The `x-columns: \"auto\"` column floor: wide enough for a labelled control to\n// stay readable, narrow enough that a 1440px pane gets three columns, not two.\nexport const DEFAULT_COLUMN_MIN_WIDTH = \"15rem\";\n\n// cssLength guards a schema-supplied CSS length before it reaches an inline\n// style. Non-strings (and the empty string) fall back rather than emitting a\n// declaration the browser will drop.\nexport function cssLength(value: unknown, fallback: string): string {\n return typeof value === \"string\" && value.trim() ? value.trim() : fallback;\n}\n\n// duplicateIndex copies the item at `index` and inserts the copy after it.\n// Plain objects and arrays are cloned one level deep so editing the copy cannot\n// write through to the original.\nexport function duplicateIndex<T>(items: T[], index: number): T[] {\n const source = items[index];\n const copy = Array.isArray(source)\n ? ([...source] as T)\n : isPlainObject(source)\n ? ({ ...source } as T)\n : source;\n const next = [...items];\n next.splice(index + 1, 0, copy as T);\n return next;\n}\n\n// withSyntheticValue prepends the current value as an option when it is not in\n// the enum, so an out-of-enum value (e.g. a template token) still displays.\nexport function withSyntheticValue(options: FieldOption[], value: string): FieldOption[] {\n if (!value || options.some((o) => o.value === value)) return options;\n return [{ value, label: value }, ...options];\n}\n\n// keyPickerOptions narrows the map-key enum to keys not already used by another\n// entry, while always keeping this row's current key so it stays selectable.\nexport function keyPickerOptions(\n options: FieldOption[],\n usedKeys: string[],\n currentKey: string,\n): FieldOption[] {\n const taken = new Set(usedKeys.filter((k) => k !== currentKey));\n return options.filter((o) => !taken.has(o.value));\n}\n\n// matchesFieldFilter reports whether a property should stay visible under the\n// display-options field filter: a case-insensitive substring match against the\n// field's key and its display label (`title` when set, otherwise the key). A\n// blank filter matches everything, so an empty box never hides fields.\nexport function matchesFieldFilter(\n key: string,\n prop: JsonSchemaProperty,\n filter: string,\n): boolean {\n const query = filter.trim().toLowerCase();\n if (!query) return true;\n const label = typeof prop.title === \"string\" && prop.title ? prop.title : key;\n return key.toLowerCase().includes(query) || label.toLowerCase().includes(query);\n}\n\n// orderByXOrder reorders property entries by the schema's `x-order` hint: keys\n// named there render first (in that order), the rest keep document order. A\n// missing/empty hint is a no-op, so document order remains the default.\nexport function orderByXOrder<T>(entries: [string, T][], order: unknown): [string, T][] {\n if (!Array.isArray(order) || order.length === 0) return entries;\n const rank = new Map(\n order.filter((k): k is string => typeof k === \"string\").map((k, i) => [k, i]),\n );\n const listed = entries\n .filter(([key]) => rank.has(key))\n .sort((a, b) => rank.get(a[0])! - rank.get(b[0])!);\n const rest = entries.filter(([key]) => !rank.has(key));\n return [...listed, ...rest];\n}\n\n// orderByClickyOrder stably sorts property entries by each property's numeric\n// `x-clicky-order` (lower first); entries without it keep their incoming order\n// after the ordered ones. An explicit index tie-break keeps it stable regardless\n// of the engine's sort stability. Unlike the object-level `x-order` array, this\n// composes across merged if/then branches because each property carries its own\n// order — the right tool when fields come from different (embedded) sources.\nexport function orderByClickyOrder(\n entries: [string, JsonSchemaProperty][],\n): [string, JsonSchemaProperty][] {\n const rank = (prop: JsonSchemaProperty): number => {\n const o = prop[\"x-clicky-order\"];\n return typeof o === \"number\" ? o : Number.POSITIVE_INFINITY;\n };\n return entries\n .map((entry, index) => ({ entry, index, rank: rank(entry[1]) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// orderRequiredFirst stably partitions property entries so the keys named in\n// `required` come first (in their original order), then the rest (in theirs).\n// A stable two-pass partition, so it never reshuffles within either group.\nexport function orderRequiredFirst<T>(\n entries: [string, T][],\n required: string[],\n): [string, T][] {\n const isRequired = new Set(required);\n const head = entries.filter(([key]) => isRequired.has(key));\n const tail = entries.filter(([key]) => !isRequired.has(key));\n return [...head, ...tail];\n}\n\n// isEmptyValue reports whether a field's value carries no data, so priority\n// sorting can sink unfilled fields. Empty = undefined/null/\"\" plus empty arrays\n// and empty plain objects; `false` and `0` count as filled (they are choices).\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null || value === \"\") return true;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n}\n\n// orderByPriority sorts property entries so the fields that matter most surface\n// first, ranking each by a score: +2 if required, +1 if its value is non-empty.\n// Required-and-filled lead, then required-and-empty, then optional-and-filled,\n// then optional-and-empty. Ties keep their incoming order (explicit index\n// tie-break, so it does not depend on the engine's sort stability).\nexport function orderByPriority<T>(\n entries: [string, T][],\n required: string[],\n values: Record<string, unknown>,\n): [string, T][] {\n const isRequired = new Set(required);\n const score = (key: string): number =>\n (isRequired.has(key) ? 2 : 0) + (isEmptyValue(values[key]) ? 0 : 1);\n return entries\n .map((entry, index) => ({ entry, index, score: score(entry[0]) }))\n .sort((a, b) => b.score - a.score || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// softError computes a display-only validation hint. It never blocks onChange.\n// Consumers suppress the unknown-enum hint by setting allowCustomValue.\nexport function softError(field: FieldControl): string | undefined {\n const v = field.value;\n const isEmpty = v === undefined || v === null || v === \"\";\n if (field.required && isEmpty) return \"Required\";\n\n if (field.kind === \"number\" && typeof field.minimum === \"number\" && typeof v === \"number\") {\n if (v < field.minimum) return `Must be ≥ ${field.minimum}`;\n }\n\n if (field.kind === \"enum\" && !field.allowCustomValue && !isEmpty) {\n const known = (field.options ?? []).some((o) => o.value === String(v));\n if (!known) return \"Unknown value (allowed)\";\n }\n return undefined;\n}\n\n// Immutable array helpers used by the array control.\nexport function setIndex<T>(arr: T[], i: number, v: T): T[] {\n return arr.map((x, idx) => (idx === i ? v : x));\n}\n\nexport function removeIndex<T>(arr: T[], i: number): T[] {\n return arr.filter((_, idx) => idx !== i);\n}\n\nexport function moveItem<T>(arr: T[], from: number, to: number): T[] {\n if (to < 0 || to >= arr.length) return arr;\n const next = [...arr];\n const [moved] = next.splice(from, 1);\n next.splice(to, 0, moved as T);\n return next;\n}\n\n// seedFromSchema produces the initial value for a freshly-added array item or\n// object field, honouring an explicit default.\nexport function seedFromSchema(schema: JsonSchemaProperty): unknown {\n if (schema.default !== undefined) return schema.default;\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n if (type === \"array\") return [];\n if (type === \"object\") return {};\n if (type === \"boolean\") return false;\n // Numbers seed as \"\" so the soft Required hint can show without coercion\n // surprises; the number control coerces on first real input.\n return \"\";\n}\n"],"names":["cn","inputSizeClass"],"mappings":";;;;AAWA,MAAM,aACJ;AAEK,SAAS,WAAW,MAAwB;AACjD,SAAOA,SAAG,YAAYC,mBAAAA,eAAe,IAAI,CAAC;AAC5C;AAUA,SAAS,aAAa,OAAuB;AAC3C,MAAI,UAAU,GAAI,QAAO;AACzB,SAAO,MAAM,QAAQ,iBAAiB,CAAC,SAAS,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG;AACxF;AAWO,SAAS,aAAa,cAAsB,QAAyB;AAC1E,QAAM,SAAS,iBAAiB,KAAK,KAAK,aAAa,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG;AACnF,QAAM,OAAO,OACV,IAAI,CAAC,UAAU,aAAa,MAAM,WAAW,MAAM,GAAG,EAAE,WAAW,MAAM,GAAG,CAAC,CAAC,EAC9E,KAAK,GAAG;AACX,SAAO,SAAS,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,KAAK,OAAO,IAAI;AACrE;AAIO,SAAS,aAAa,SAAyB;AACpD,SAAO,GAAG,OAAO;AACnB;AAKO,SAAS,eACd,OACA,SAKA;AACA,SAAO;AAAA,IACL,GAAI,MAAM,WAAW,EAAE,iBAAiB,KAAA,IAAkB,CAAA;AAAA,IAC1D,GAAI,MAAM,UAAU,EAAE,gBAAgB,MAAe,oBA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AO,IAAI,GAAG,KAAU;AAC7B,SAAO;AACT;AAIO,SAAS,eAAe,QAAqC;AAClE,MAAI,OAAO,YAAY,OAAW,QAAO,OAAO;AAChD,QAAM,OAAO,MAAM,QAAQ,OAAO,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO;AAClE,MAAI,SAAS,QAAS,QAAO,CAAA;AAC7B,MAAI,SAAS,SAAU,QAAO,CAAA;AAC9B,MAAI,SAAS,UAAW,QAAO;AAG/B,SAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"json-schema-form-utils.cjs","sources":["../../src/components/json-schema-form-utils.ts"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { inputSizeClass, type FormSize } from \"./json-schema-form-size\";\nimport type {\n FieldControl,\n FieldOption,\n GridColumns,\n JsonSchemaProperty,\n} from \"./json-schema-form-types\";\n\n// Non-size styling shared by every text-like input box; the size token supplies\n// height, horizontal padding, and text size (see inputSizeClass).\nconst INPUT_BASE =\n \"w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring\";\n\nexport function inputClass(size: FormSize): string {\n return cn(INPUT_BASE, inputSizeClass[size]);\n}\n\n// encodeIdPart escapes one path token (or the id prefix) injectively: every\n// character outside [A-Za-z0-9] becomes `_<hex char code>_`, and the empty token\n// — a legal JSON Schema property name — becomes a lone `_`. The escape is\n// self-delimiting (it always starts and ends with `_`, and a literal `_` escapes\n// to `_5f_`), so distinct tokens can never share an encoding and `-` stays free\n// as a segment separator. Percent-encoding was rejected because `%` in an id,\n// while legal HTML, has to be escaped again inside a `#id` CSS selector; this\n// alphabet ([A-Za-z0-9_-]) is safe as-is for `document.querySelector`.\nfunction encodeIdPart(value: string): string {\n if (value === \"\") return \"_\";\n return value.replace(/[^A-Za-z0-9]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n// fieldInputId derives a control's DOM id from its JSON-pointer instance path,\n// not from its leaf key: a schema that repeats a property name under two parents\n// (e.g. /journalLine1/asset and /journalLine2/asset) must not produce the same\n// id, or every `label[for]` binds to the first control. Each decoded pointer\n// token is escaped with encodeIdPart and joined with \"-\", so distinct paths\n// always produce distinct ids: \"/asset-class\", \"/asset_class\", \"/asset.class\"\n// and \"/asset/class\" are four different ids, and an empty token is preserved\n// (\"/a//b\" ≠ \"/a/b\"). The prefix is escaped the same way, so prefix \"a\" + \"/b-c\"\n// cannot collide with prefix \"a-b\" + \"/c\".\nexport function fieldInputId(instancePath: string, prefix?: string): string {\n const tokens = instancePath === \"\" ? [] : instancePath.replace(/^\\//, \"\").split(\"/\");\n const safe = tokens\n .map((token) => encodeIdPart(token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\")))\n .join(\"-\");\n return prefix ? `jsf-${encodeIdPart(prefix)}-${safe}` : `jsf-${safe}`;\n}\n\n// fieldErrorId names the element that holds a field's validation messages, so a\n// control can point at it with aria-describedby.\nexport function fieldErrorId(fieldId: string): string {\n return `${fieldId}-error`;\n}\n\n// fieldAriaProps is the assistive-technology half of a control: the visual `*`\n// and red message mean nothing to a screen reader on their own, so every\n// editable control spreads these onto its input element.\nexport function fieldAriaProps(\n field: FieldControl,\n fieldId: string,\n): {\n \"aria-required\"?: true;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n} {\n return {\n ...(field.required ? { \"aria-required\": true as const } : {}),\n ...(field.invalid ? { \"aria-invalid\": true as const, \"aria-describedby\": fieldErrorId(fieldId) } : {}),\n };\n}\n\n// comboboxAriaProps is the fieldAriaProps equivalent for Combobox, which takes\n// the same state as named props rather than raw aria-* attributes.\nexport function comboboxAriaProps(\n field: FieldControl,\n fieldId: string,\n): { ariaRequired?: true; invalid?: true; describedBy?: string } {\n return {\n ...(field.required ? { ariaRequired: true as const } : {}),\n ...(field.invalid ? { invalid: true as const, describedBy: fieldErrorId(fieldId) } : {}),\n };\n}\n\nexport function defaultPlaceholder(schema: JsonSchemaProperty): string {\n if (schema.default != null && typeof schema.default !== \"object\") return String(schema.default);\n return \"\";\n}\n\nexport function toText(value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"object\") return \"\";\n return String(value);\n}\n\n// toStringArray normalises the committed value of a multi-value control. The\n// schema types it as an array of strings, but a form mid-edit can hold anything,\n// so a non-string entry is dropped rather than rendered as a broken tag.\nexport function toStringArray(value: unknown): string[] {\n if (!Array.isArray(value)) return [];\n return value.filter((entry): entry is string => typeof entry === \"string\");\n}\n\n// hasObjectItemProperties reports whether an array's items are objects with a\n// fixed `properties` set — the precondition for both the column-per-property\n// table and the summary-row accordion, which need to know the item's shape.\nexport function hasObjectItemProperties(\n items: JsonSchemaProperty | undefined,\n): boolean {\n return (\n !!items && !!items.properties && Object.keys(items.properties).length > 0\n );\n}\n\n// Object-level `x-columns`: how many equal columns to split a stacked object\n// into. \"auto\" fits as many as the width allows. A number is clamped to [1, 12]\n// (a standard 12-track grid, so a 3-across row of span-4 fields and a 4-across\n// row of span-3 fields share one object); anything invalid is a single column.\nexport function normalizeColumns(value: unknown): GridColumns {\n if (value === \"auto\") return \"auto\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), 12);\n}\n\n// Per-field `x-col-span`: how many of the object's columns a field occupies.\n// \"full\" spans the whole row. Under `x-columns: \"auto\"` a numeric span cannot be\n// clamped against a track count that only exists at layout time, so it is capped\n// at the 12-track maximum instead. Invalid falls back to 1.\nexport function normalizeColSpan(\n value: unknown,\n columns: GridColumns,\n): number | \"full\" {\n if (value === \"full\") return \"full\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), columns === \"auto\" ? 12 : columns);\n}\n\n// The `x-columns: \"auto\"` column floor: wide enough for a labelled control to\n// stay readable, narrow enough that a 1440px pane gets three columns, not two.\nexport const DEFAULT_COLUMN_MIN_WIDTH = \"15rem\";\n\n// cssLength guards a schema-supplied CSS length before it reaches an inline\n// style. Non-strings (and the empty string) fall back rather than emitting a\n// declaration the browser will drop.\nexport function cssLength(value: unknown, fallback: string): string {\n return typeof value === \"string\" && value.trim() ? value.trim() : fallback;\n}\n\n// withSyntheticValue prepends the current value as an option when it is not in\n// the enum, so an out-of-enum value (e.g. a template token) still displays.\nexport function withSyntheticValue(options: FieldOption[], value: string): FieldOption[] {\n if (!value || options.some((o) => o.value === value)) return options;\n return [{ value, label: value }, ...options];\n}\n\n// keyPickerOptions narrows the map-key enum to keys not already used by another\n// entry, while always keeping this row's current key so it stays selectable.\nexport function keyPickerOptions(\n options: FieldOption[],\n usedKeys: string[],\n currentKey: string,\n): FieldOption[] {\n const taken = new Set(usedKeys.filter((k) => k !== currentKey));\n return options.filter((o) => !taken.has(o.value));\n}\n\n// matchesFieldFilter reports whether a property should stay visible under the\n// display-options field filter: a case-insensitive substring match against the\n// field's key and its display label (`title` when set, otherwise the key). A\n// blank filter matches everything, so an empty box never hides fields.\nexport function matchesFieldFilter(\n key: string,\n prop: JsonSchemaProperty,\n filter: string,\n): boolean {\n const query = filter.trim().toLowerCase();\n if (!query) return true;\n const label = typeof prop.title === \"string\" && prop.title ? prop.title : key;\n return key.toLowerCase().includes(query) || label.toLowerCase().includes(query);\n}\n\n// orderByXOrder reorders property entries by the schema's `x-order` hint: keys\n// named there render first (in that order), the rest keep document order. A\n// missing/empty hint is a no-op, so document order remains the default.\nexport function orderByXOrder<T>(entries: [string, T][], order: unknown): [string, T][] {\n if (!Array.isArray(order) || order.length === 0) return entries;\n const rank = new Map(\n order.filter((k): k is string => typeof k === \"string\").map((k, i) => [k, i]),\n );\n const listed = entries\n .filter(([key]) => rank.has(key))\n .sort((a, b) => rank.get(a[0])! - rank.get(b[0])!);\n const rest = entries.filter(([key]) => !rank.has(key));\n return [...listed, ...rest];\n}\n\n// orderByClickyOrder stably sorts property entries by each property's numeric\n// `x-clicky-order` (lower first); entries without it keep their incoming order\n// after the ordered ones. An explicit index tie-break keeps it stable regardless\n// of the engine's sort stability. Unlike the object-level `x-order` array, this\n// composes across merged if/then branches because each property carries its own\n// order — the right tool when fields come from different (embedded) sources.\nexport function orderByClickyOrder(\n entries: [string, JsonSchemaProperty][],\n): [string, JsonSchemaProperty][] {\n const rank = (prop: JsonSchemaProperty): number => {\n const o = prop[\"x-clicky-order\"];\n return typeof o === \"number\" ? o : Number.POSITIVE_INFINITY;\n };\n return entries\n .map((entry, index) => ({ entry, index, rank: rank(entry[1]) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// orderRequiredFirst stably partitions property entries so the keys named in\n// `required` come first (in their original order), then the rest (in theirs).\n// A stable two-pass partition, so it never reshuffles within either group.\nexport function orderRequiredFirst<T>(\n entries: [string, T][],\n required: string[],\n): [string, T][] {\n const isRequired = new Set(required);\n const head = entries.filter(([key]) => isRequired.has(key));\n const tail = entries.filter(([key]) => !isRequired.has(key));\n return [...head, ...tail];\n}\n\n// isEmptyValue reports whether a field's value carries no data, so priority\n// sorting can sink unfilled fields. Empty = undefined/null/\"\" plus empty arrays\n// and empty plain objects; `false` and `0` count as filled (they are choices).\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null || value === \"\") return true;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n}\n\n// orderByPriority sorts property entries so the fields that matter most surface\n// first, ranking each by a score: +2 if required, +1 if its value is non-empty.\n// Required-and-filled lead, then required-and-empty, then optional-and-filled,\n// then optional-and-empty. Ties keep their incoming order (explicit index\n// tie-break, so it does not depend on the engine's sort stability).\nexport function orderByPriority<T>(\n entries: [string, T][],\n required: string[],\n values: Record<string, unknown>,\n): [string, T][] {\n const isRequired = new Set(required);\n const score = (key: string): number =>\n (isRequired.has(key) ? 2 : 0) + (isEmptyValue(values[key]) ? 0 : 1);\n return entries\n .map((entry, index) => ({ entry, index, score: score(entry[0]) }))\n .sort((a, b) => b.score - a.score || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// softError computes a display-only validation hint. It never blocks onChange.\n// Consumers suppress the unknown-enum hint by setting allowCustomValue.\nexport function softError(field: FieldControl): string | undefined {\n const v = field.value;\n const isEmpty = v === undefined || v === null || v === \"\";\n if (field.required && isEmpty) return \"Required\";\n\n if (field.kind === \"number\" && typeof field.minimum === \"number\" && typeof v === \"number\") {\n if (v < field.minimum) return `Must be ≥ ${field.minimum}`;\n }\n\n if (field.kind === \"enum\" && !field.allowCustomValue && !isEmpty) {\n const known = (field.options ?? []).some((o) => o.value === String(v));\n if (!known) return \"Unknown value (allowed)\";\n }\n return undefined;\n}\n\n// seedFromSchema produces the initial value for a freshly-added array item or\n// object field, honouring an explicit default.\nexport function seedFromSchema(schema: JsonSchemaProperty): unknown {\n if (schema.default !== undefined) return schema.default;\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n if (type === \"array\") return [];\n if (type === \"object\") return {};\n if (type === \"boolean\") return false;\n // Numbers seed as \"\" so the soft Required hint can show without coercion\n // surprises; the number control coerces on first real input.\n return \"\";\n}\n"],"names":["cn","inputSizeClass"],"mappings":";;;;AAWA,MAAM,aACJ;AAEK,SAAS,WAAW,MAAwB;AACjD,SAAOA,SAAG,YAAYC,mBAAAA,eAAe,IAAI,CAAC;AAC5C;AAUA,SAAS,aAAa,OAAuB;AAC3C,MAAI,UAAU,GAAI,QAAO;AACzB,SAAO,MAAM,QAAQ,iBAAiB,CAAC,SAAS,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG;AACxF;AAWO,SAAS,aAAa,cAAsB,QAAyB;AAC1E,QAAM,SAAS,iBAAiB,KAAK,KAAK,aAAa,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG;AACnF,QAAM,OAAO,OACV,IAAI,CAAC,UAAU,aAAa,MAAM,WAAW,MAAM,GAAG,EAAE,WAA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;;;;;;;;;"}
|
|
@@ -15,13 +15,12 @@ export declare function comboboxAriaProps(field: FieldControl, fieldId: string):
|
|
|
15
15
|
};
|
|
16
16
|
export declare function defaultPlaceholder(schema: JsonSchemaProperty): string;
|
|
17
17
|
export declare function toText(value: unknown): string;
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function toStringArray(value: unknown): string[];
|
|
19
19
|
export declare function hasObjectItemProperties(items: JsonSchemaProperty | undefined): boolean;
|
|
20
20
|
export declare function normalizeColumns(value: unknown): GridColumns;
|
|
21
21
|
export declare function normalizeColSpan(value: unknown, columns: GridColumns): number | "full";
|
|
22
22
|
export declare const DEFAULT_COLUMN_MIN_WIDTH = "15rem";
|
|
23
23
|
export declare function cssLength(value: unknown, fallback: string): string;
|
|
24
|
-
export declare function duplicateIndex<T>(items: T[], index: number): T[];
|
|
25
24
|
export declare function withSyntheticValue(options: FieldOption[], value: string): FieldOption[];
|
|
26
25
|
export declare function keyPickerOptions(options: FieldOption[], usedKeys: string[], currentKey: string): FieldOption[];
|
|
27
26
|
export declare function matchesFieldFilter(key: string, prop: JsonSchemaProperty, filter: string): boolean;
|
|
@@ -31,8 +30,5 @@ export declare function orderRequiredFirst<T>(entries: [string, T][], required:
|
|
|
31
30
|
export declare function isEmptyValue(value: unknown): boolean;
|
|
32
31
|
export declare function orderByPriority<T>(entries: [string, T][], required: string[], values: Record<string, unknown>): [string, T][];
|
|
33
32
|
export declare function softError(field: FieldControl): string | undefined;
|
|
34
|
-
export declare function setIndex<T>(arr: T[], i: number, v: T): T[];
|
|
35
|
-
export declare function removeIndex<T>(arr: T[], i: number): T[];
|
|
36
|
-
export declare function moveItem<T>(arr: T[], from: number, to: number): T[];
|
|
37
33
|
export declare function seedFromSchema(schema: JsonSchemaProperty): unknown;
|
|
38
34
|
//# sourceMappingURL=json-schema-form-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-utils.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAOlC,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEjD;AAwBD,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E;AAID,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAKD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,GACd;IACD,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAKA;AAID,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,GACd;IAAE,YAAY,CAAC,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAK/D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAGrE;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAI7C;
|
|
1
|
+
{"version":3,"file":"json-schema-form-utils.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAOlC,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CA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|
|
3
|
-
const INPUT_BASE = "w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-
|
|
3
|
+
const INPUT_BASE = "w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring";
|
|
4
4
|
function inputClass(size) {
|
|
5
5
|
return cn(INPUT_BASE, inputSizeClass[size]);
|
|
6
6
|
}
|
|
@@ -37,8 +37,9 @@ function toText(value) {
|
|
|
37
37
|
if (typeof value === "object") return "";
|
|
38
38
|
return String(value);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
40
|
+
function toStringArray(value) {
|
|
41
|
+
if (!Array.isArray(value)) return [];
|
|
42
|
+
return value.filter((entry) => typeof entry === "string");
|
|
42
43
|
}
|
|
43
44
|
function hasObjectItemProperties(items) {
|
|
44
45
|
return !!items && !!items.properties && Object.keys(items.properties).length > 0;
|
|
@@ -59,13 +60,6 @@ const DEFAULT_COLUMN_MIN_WIDTH = "15rem";
|
|
|
59
60
|
function cssLength(value, fallback) {
|
|
60
61
|
return typeof value === "string" && value.trim() ? value.trim() : fallback;
|
|
61
62
|
}
|
|
62
|
-
function duplicateIndex(items, index) {
|
|
63
|
-
const source = items[index];
|
|
64
|
-
const copy = Array.isArray(source) ? [...source] : isPlainObject(source) ? { ...source } : source;
|
|
65
|
-
const next = [...items];
|
|
66
|
-
next.splice(index + 1, 0, copy);
|
|
67
|
-
return next;
|
|
68
|
-
}
|
|
69
63
|
function withSyntheticValue(options, value) {
|
|
70
64
|
if (!value || options.some((o) => o.value === value)) return options;
|
|
71
65
|
return [{ value, label: value }, ...options];
|
|
@@ -126,19 +120,6 @@ function softError(field) {
|
|
|
126
120
|
}
|
|
127
121
|
return void 0;
|
|
128
122
|
}
|
|
129
|
-
function setIndex(arr, i, v) {
|
|
130
|
-
return arr.map((x, idx) => idx === i ? v : x);
|
|
131
|
-
}
|
|
132
|
-
function removeIndex(arr, i) {
|
|
133
|
-
return arr.filter((_, idx) => idx !== i);
|
|
134
|
-
}
|
|
135
|
-
function moveItem(arr, from, to) {
|
|
136
|
-
if (to < 0 || to >= arr.length) return arr;
|
|
137
|
-
const next = [...arr];
|
|
138
|
-
const [moved] = next.splice(from, 1);
|
|
139
|
-
next.splice(to, 0, moved);
|
|
140
|
-
return next;
|
|
141
|
-
}
|
|
142
123
|
function seedFromSchema(schema) {
|
|
143
124
|
if (schema.default !== void 0) return schema.default;
|
|
144
125
|
const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
|
|
@@ -152,27 +133,23 @@ export {
|
|
|
152
133
|
comboboxAriaProps,
|
|
153
134
|
cssLength,
|
|
154
135
|
defaultPlaceholder,
|
|
155
|
-
duplicateIndex,
|
|
156
136
|
fieldAriaProps,
|
|
157
137
|
fieldErrorId,
|
|
158
138
|
fieldInputId,
|
|
159
139
|
hasObjectItemProperties,
|
|
160
140
|
inputClass,
|
|
161
141
|
isEmptyValue,
|
|
162
|
-
isPlainObject,
|
|
163
142
|
keyPickerOptions,
|
|
164
143
|
matchesFieldFilter,
|
|
165
|
-
moveItem,
|
|
166
144
|
normalizeColSpan,
|
|
167
145
|
normalizeColumns,
|
|
168
146
|
orderByClickyOrder,
|
|
169
147
|
orderByPriority,
|
|
170
148
|
orderByXOrder,
|
|
171
149
|
orderRequiredFirst,
|
|
172
|
-
removeIndex,
|
|
173
150
|
seedFromSchema,
|
|
174
|
-
setIndex,
|
|
175
151
|
softError,
|
|
152
|
+
toStringArray,
|
|
176
153
|
toText,
|
|
177
154
|
withSyntheticValue
|
|
178
155
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-utils.js","sources":["../../src/components/json-schema-form-utils.ts"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { inputSizeClass, type FormSize } from \"./json-schema-form-size\";\nimport type {\n FieldControl,\n FieldOption,\n GridColumns,\n JsonSchemaProperty,\n} from \"./json-schema-form-types\";\n\n// Non-size styling shared by every text-like input box; the size token supplies\n// height, horizontal padding, and text size (see inputSizeClass).\nconst INPUT_BASE =\n \"w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring\";\n\nexport function inputClass(size: FormSize): string {\n return cn(INPUT_BASE, inputSizeClass[size]);\n}\n\n// encodeIdPart escapes one path token (or the id prefix) injectively: every\n// character outside [A-Za-z0-9] becomes `_<hex char code>_`, and the empty token\n// — a legal JSON Schema property name — becomes a lone `_`. The escape is\n// self-delimiting (it always starts and ends with `_`, and a literal `_` escapes\n// to `_5f_`), so distinct tokens can never share an encoding and `-` stays free\n// as a segment separator. Percent-encoding was rejected because `%` in an id,\n// while legal HTML, has to be escaped again inside a `#id` CSS selector; this\n// alphabet ([A-Za-z0-9_-]) is safe as-is for `document.querySelector`.\nfunction encodeIdPart(value: string): string {\n if (value === \"\") return \"_\";\n return value.replace(/[^A-Za-z0-9]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n// fieldInputId derives a control's DOM id from its JSON-pointer instance path,\n// not from its leaf key: a schema that repeats a property name under two parents\n// (e.g. /journalLine1/asset and /journalLine2/asset) must not produce the same\n// id, or every `label[for]` binds to the first control. Each decoded pointer\n// token is escaped with encodeIdPart and joined with \"-\", so distinct paths\n// always produce distinct ids: \"/asset-class\", \"/asset_class\", \"/asset.class\"\n// and \"/asset/class\" are four different ids, and an empty token is preserved\n// (\"/a//b\" ≠ \"/a/b\"). The prefix is escaped the same way, so prefix \"a\" + \"/b-c\"\n// cannot collide with prefix \"a-b\" + \"/c\".\nexport function fieldInputId(instancePath: string, prefix?: string): string {\n const tokens = instancePath === \"\" ? [] : instancePath.replace(/^\\//, \"\").split(\"/\");\n const safe = tokens\n .map((token) => encodeIdPart(token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\")))\n .join(\"-\");\n return prefix ? `jsf-${encodeIdPart(prefix)}-${safe}` : `jsf-${safe}`;\n}\n\n// fieldErrorId names the element that holds a field's validation messages, so a\n// control can point at it with aria-describedby.\nexport function fieldErrorId(fieldId: string): string {\n return `${fieldId}-error`;\n}\n\n// fieldAriaProps is the assistive-technology half of a control: the visual `*`\n// and red message mean nothing to a screen reader on their own, so every\n// editable control spreads these onto its input element.\nexport function fieldAriaProps(\n field: FieldControl,\n fieldId: string,\n): {\n \"aria-required\"?: true;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n} {\n return {\n ...(field.required ? { \"aria-required\": true as const } : {}),\n ...(field.invalid ? { \"aria-invalid\": true as const, \"aria-describedby\": fieldErrorId(fieldId) } : {}),\n };\n}\n\n// comboboxAriaProps is the fieldAriaProps equivalent for Combobox, which takes\n// the same state as named props rather than raw aria-* attributes.\nexport function comboboxAriaProps(\n field: FieldControl,\n fieldId: string,\n): { ariaRequired?: true; invalid?: true; describedBy?: string } {\n return {\n ...(field.required ? { ariaRequired: true as const } : {}),\n ...(field.invalid ? { invalid: true as const, describedBy: fieldErrorId(fieldId) } : {}),\n };\n}\n\nexport function defaultPlaceholder(schema: JsonSchemaProperty): string {\n if (schema.default != null && typeof schema.default !== \"object\") return String(schema.default);\n return \"\";\n}\n\nexport function toText(value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"object\") return \"\";\n return String(value);\n}\n\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// hasObjectItemProperties reports whether an array's items are objects with a\n// fixed `properties` set — the precondition for both the column-per-property\n// table and the summary-row accordion, which need to know the item's shape.\nexport function hasObjectItemProperties(\n items: JsonSchemaProperty | undefined,\n): boolean {\n return (\n !!items && !!items.properties && Object.keys(items.properties).length > 0\n );\n}\n\n// Object-level `x-columns`: how many equal columns to split a stacked object\n// into. \"auto\" fits as many as the width allows. A number is clamped to [1, 12]\n// (a standard 12-track grid, so a 3-across row of span-4 fields and a 4-across\n// row of span-3 fields share one object); anything invalid is a single column.\nexport function normalizeColumns(value: unknown): GridColumns {\n if (value === \"auto\") return \"auto\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), 12);\n}\n\n// Per-field `x-col-span`: how many of the object's columns a field occupies.\n// \"full\" spans the whole row. Under `x-columns: \"auto\"` a numeric span cannot be\n// clamped against a track count that only exists at layout time, so it is capped\n// at the 12-track maximum instead. Invalid falls back to 1.\nexport function normalizeColSpan(\n value: unknown,\n columns: GridColumns,\n): number | \"full\" {\n if (value === \"full\") return \"full\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), columns === \"auto\" ? 12 : columns);\n}\n\n// The `x-columns: \"auto\"` column floor: wide enough for a labelled control to\n// stay readable, narrow enough that a 1440px pane gets three columns, not two.\nexport const DEFAULT_COLUMN_MIN_WIDTH = \"15rem\";\n\n// cssLength guards a schema-supplied CSS length before it reaches an inline\n// style. Non-strings (and the empty string) fall back rather than emitting a\n// declaration the browser will drop.\nexport function cssLength(value: unknown, fallback: string): string {\n return typeof value === \"string\" && value.trim() ? value.trim() : fallback;\n}\n\n// duplicateIndex copies the item at `index` and inserts the copy after it.\n// Plain objects and arrays are cloned one level deep so editing the copy cannot\n// write through to the original.\nexport function duplicateIndex<T>(items: T[], index: number): T[] {\n const source = items[index];\n const copy = Array.isArray(source)\n ? ([...source] as T)\n : isPlainObject(source)\n ? ({ ...source } as T)\n : source;\n const next = [...items];\n next.splice(index + 1, 0, copy as T);\n return next;\n}\n\n// withSyntheticValue prepends the current value as an option when it is not in\n// the enum, so an out-of-enum value (e.g. a template token) still displays.\nexport function withSyntheticValue(options: FieldOption[], value: string): FieldOption[] {\n if (!value || options.some((o) => o.value === value)) return options;\n return [{ value, label: value }, ...options];\n}\n\n// keyPickerOptions narrows the map-key enum to keys not already used by another\n// entry, while always keeping this row's current key so it stays selectable.\nexport function keyPickerOptions(\n options: FieldOption[],\n usedKeys: string[],\n currentKey: string,\n): FieldOption[] {\n const taken = new Set(usedKeys.filter((k) => k !== currentKey));\n return options.filter((o) => !taken.has(o.value));\n}\n\n// matchesFieldFilter reports whether a property should stay visible under the\n// display-options field filter: a case-insensitive substring match against the\n// field's key and its display label (`title` when set, otherwise the key). A\n// blank filter matches everything, so an empty box never hides fields.\nexport function matchesFieldFilter(\n key: string,\n prop: JsonSchemaProperty,\n filter: string,\n): boolean {\n const query = filter.trim().toLowerCase();\n if (!query) return true;\n const label = typeof prop.title === \"string\" && prop.title ? prop.title : key;\n return key.toLowerCase().includes(query) || label.toLowerCase().includes(query);\n}\n\n// orderByXOrder reorders property entries by the schema's `x-order` hint: keys\n// named there render first (in that order), the rest keep document order. A\n// missing/empty hint is a no-op, so document order remains the default.\nexport function orderByXOrder<T>(entries: [string, T][], order: unknown): [string, T][] {\n if (!Array.isArray(order) || order.length === 0) return entries;\n const rank = new Map(\n order.filter((k): k is string => typeof k === \"string\").map((k, i) => [k, i]),\n );\n const listed = entries\n .filter(([key]) => rank.has(key))\n .sort((a, b) => rank.get(a[0])! - rank.get(b[0])!);\n const rest = entries.filter(([key]) => !rank.has(key));\n return [...listed, ...rest];\n}\n\n// orderByClickyOrder stably sorts property entries by each property's numeric\n// `x-clicky-order` (lower first); entries without it keep their incoming order\n// after the ordered ones. An explicit index tie-break keeps it stable regardless\n// of the engine's sort stability. Unlike the object-level `x-order` array, this\n// composes across merged if/then branches because each property carries its own\n// order — the right tool when fields come from different (embedded) sources.\nexport function orderByClickyOrder(\n entries: [string, JsonSchemaProperty][],\n): [string, JsonSchemaProperty][] {\n const rank = (prop: JsonSchemaProperty): number => {\n const o = prop[\"x-clicky-order\"];\n return typeof o === \"number\" ? o : Number.POSITIVE_INFINITY;\n };\n return entries\n .map((entry, index) => ({ entry, index, rank: rank(entry[1]) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// orderRequiredFirst stably partitions property entries so the keys named in\n// `required` come first (in their original order), then the rest (in theirs).\n// A stable two-pass partition, so it never reshuffles within either group.\nexport function orderRequiredFirst<T>(\n entries: [string, T][],\n required: string[],\n): [string, T][] {\n const isRequired = new Set(required);\n const head = entries.filter(([key]) => isRequired.has(key));\n const tail = entries.filter(([key]) => !isRequired.has(key));\n return [...head, ...tail];\n}\n\n// isEmptyValue reports whether a field's value carries no data, so priority\n// sorting can sink unfilled fields. Empty = undefined/null/\"\" plus empty arrays\n// and empty plain objects; `false` and `0` count as filled (they are choices).\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null || value === \"\") return true;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n}\n\n// orderByPriority sorts property entries so the fields that matter most surface\n// first, ranking each by a score: +2 if required, +1 if its value is non-empty.\n// Required-and-filled lead, then required-and-empty, then optional-and-filled,\n// then optional-and-empty. Ties keep their incoming order (explicit index\n// tie-break, so it does not depend on the engine's sort stability).\nexport function orderByPriority<T>(\n entries: [string, T][],\n required: string[],\n values: Record<string, unknown>,\n): [string, T][] {\n const isRequired = new Set(required);\n const score = (key: string): number =>\n (isRequired.has(key) ? 2 : 0) + (isEmptyValue(values[key]) ? 0 : 1);\n return entries\n .map((entry, index) => ({ entry, index, score: score(entry[0]) }))\n .sort((a, b) => b.score - a.score || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// softError computes a display-only validation hint. It never blocks onChange.\n// Consumers suppress the unknown-enum hint by setting allowCustomValue.\nexport function softError(field: FieldControl): string | undefined {\n const v = field.value;\n const isEmpty = v === undefined || v === null || v === \"\";\n if (field.required && isEmpty) return \"Required\";\n\n if (field.kind === \"number\" && typeof field.minimum === \"number\" && typeof v === \"number\") {\n if (v < field.minimum) return `Must be ≥ ${field.minimum}`;\n }\n\n if (field.kind === \"enum\" && !field.allowCustomValue && !isEmpty) {\n const known = (field.options ?? []).some((o) => o.value === String(v));\n if (!known) return \"Unknown value (allowed)\";\n }\n return undefined;\n}\n\n// Immutable array helpers used by the array control.\nexport function setIndex<T>(arr: T[], i: number, v: T): T[] {\n return arr.map((x, idx) => (idx === i ? v : x));\n}\n\nexport function removeIndex<T>(arr: T[], i: number): T[] {\n return arr.filter((_, idx) => idx !== i);\n}\n\nexport function moveItem<T>(arr: T[], from: number, to: number): T[] {\n if (to < 0 || to >= arr.length) return arr;\n const next = [...arr];\n const [moved] = next.splice(from, 1);\n next.splice(to, 0, moved as T);\n return next;\n}\n\n// seedFromSchema produces the initial value for a freshly-added array item or\n// object field, honouring an explicit default.\nexport function seedFromSchema(schema: JsonSchemaProperty): unknown {\n if (schema.default !== undefined) return schema.default;\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n if (type === \"array\") return [];\n if (type === \"object\") return {};\n if (type === \"boolean\") return false;\n // Numbers seed as \"\" so the soft Required hint can show without coercion\n // surprises; the number control coerces on first real input.\n return \"\";\n}\n"],"names":[],"mappings":";;AAWA,MAAM,aACJ;AAEK,SAAS,WAAW,MAAwB;AACjD,SAAO,GAAG,YAAY,eAAe,IAAI,CAAC;AAC5C;AAUA,SAAS,aAAa,OAAuB;AAC3C,MAAI,UAAU,GAAI,QAAO;AACzB,SAAO,MAAM,QAAQ,iBAAiB,CAAC,SAAS,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG;AACxF;AAWO,SAAS,aAAa,cAAsB,QAAyB;AAC1E,QAAM,SAAS,iBAAiB,KAAK,KAAK,aAAa,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG;AACnF,QAAM,OAAO,OACV,IAAI,CAAC,UAAU,aAAa,MAAM,WAAW,MAAM,GAAG,EAAE,WAAW,MAAM,GAAG,CAAC,CAAC,EAC9E,KAAK,GAAG;AACX,SAAO,SAAS,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,KAAK,OAAO,IAAI;AACrE;AAIO,SAAS,aAAa,SAAyB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O,SAAS,SAAY,KAAU,MAAc,IAAiB;AACnE,MAAI,KAAK,KAAK,MAAM,IAAI,OAAQ,QAAO;AACvC,QAAM,OAAO,CAAC,GAAG,GAAG;AACpB,QAAM,CAAC,KAAK,IAAI,KAAK,OAAO,MAAM,CAAC;AACnC,OAAK,OAAO,IAAI,GAAG,KAAU;AAC7B,SAAO;AACT;AAIO,SAAS,eAAe,QAAqC;AAClE,MAAI,OAAO,YAAY,OAAW,QAAO,OAAO;AAChD,QAAM,OAAO,MAAM,QAAQ,OAAO,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO;AAClE,MAAI,SAAS,QAAS,QAAO,CAAA;AAC7B,MAAI,SAAS,SAAU,QAAO,CAAA;AAC9B,MAAI,SAAS,UAAW,QAAO;AAG/B,SAAO;AACT;"}
|
|
1
|
+
{"version":3,"file":"json-schema-form-utils.js","sources":["../../src/components/json-schema-form-utils.ts"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { inputSizeClass, type FormSize } from \"./json-schema-form-size\";\nimport type {\n FieldControl,\n FieldOption,\n GridColumns,\n JsonSchemaProperty,\n} from \"./json-schema-form-types\";\n\n// Non-size styling shared by every text-like input box; the size token supplies\n// height, horizontal padding, and text size (see inputSizeClass).\nconst INPUT_BASE =\n \"w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring\";\n\nexport function inputClass(size: FormSize): string {\n return cn(INPUT_BASE, inputSizeClass[size]);\n}\n\n// encodeIdPart escapes one path token (or the id prefix) injectively: every\n// character outside [A-Za-z0-9] becomes `_<hex char code>_`, and the empty token\n// — a legal JSON Schema property name — becomes a lone `_`. The escape is\n// self-delimiting (it always starts and ends with `_`, and a literal `_` escapes\n// to `_5f_`), so distinct tokens can never share an encoding and `-` stays free\n// as a segment separator. Percent-encoding was rejected because `%` in an id,\n// while legal HTML, has to be escaped again inside a `#id` CSS selector; this\n// alphabet ([A-Za-z0-9_-]) is safe as-is for `document.querySelector`.\nfunction encodeIdPart(value: string): string {\n if (value === \"\") return \"_\";\n return value.replace(/[^A-Za-z0-9]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n// fieldInputId derives a control's DOM id from its JSON-pointer instance path,\n// not from its leaf key: a schema that repeats a property name under two parents\n// (e.g. /journalLine1/asset and /journalLine2/asset) must not produce the same\n// id, or every `label[for]` binds to the first control. Each decoded pointer\n// token is escaped with encodeIdPart and joined with \"-\", so distinct paths\n// always produce distinct ids: \"/asset-class\", \"/asset_class\", \"/asset.class\"\n// and \"/asset/class\" are four different ids, and an empty token is preserved\n// (\"/a//b\" ≠ \"/a/b\"). The prefix is escaped the same way, so prefix \"a\" + \"/b-c\"\n// cannot collide with prefix \"a-b\" + \"/c\".\nexport function fieldInputId(instancePath: string, prefix?: string): string {\n const tokens = instancePath === \"\" ? [] : instancePath.replace(/^\\//, \"\").split(\"/\");\n const safe = tokens\n .map((token) => encodeIdPart(token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\")))\n .join(\"-\");\n return prefix ? `jsf-${encodeIdPart(prefix)}-${safe}` : `jsf-${safe}`;\n}\n\n// fieldErrorId names the element that holds a field's validation messages, so a\n// control can point at it with aria-describedby.\nexport function fieldErrorId(fieldId: string): string {\n return `${fieldId}-error`;\n}\n\n// fieldAriaProps is the assistive-technology half of a control: the visual `*`\n// and red message mean nothing to a screen reader on their own, so every\n// editable control spreads these onto its input element.\nexport function fieldAriaProps(\n field: FieldControl,\n fieldId: string,\n): {\n \"aria-required\"?: true;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n} {\n return {\n ...(field.required ? { \"aria-required\": true as const } : {}),\n ...(field.invalid ? { \"aria-invalid\": true as const, \"aria-describedby\": fieldErrorId(fieldId) } : {}),\n };\n}\n\n// comboboxAriaProps is the fieldAriaProps equivalent for Combobox, which takes\n// the same state as named props rather than raw aria-* attributes.\nexport function comboboxAriaProps(\n field: FieldControl,\n fieldId: string,\n): { ariaRequired?: true; invalid?: true; describedBy?: string } {\n return {\n ...(field.required ? { ariaRequired: true as const } : {}),\n ...(field.invalid ? { invalid: true as const, describedBy: fieldErrorId(fieldId) } : {}),\n };\n}\n\nexport function defaultPlaceholder(schema: JsonSchemaProperty): string {\n if (schema.default != null && typeof schema.default !== \"object\") return String(schema.default);\n return \"\";\n}\n\nexport function toText(value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"object\") return \"\";\n return String(value);\n}\n\n// toStringArray normalises the committed value of a multi-value control. The\n// schema types it as an array of strings, but a form mid-edit can hold anything,\n// so a non-string entry is dropped rather than rendered as a broken tag.\nexport function toStringArray(value: unknown): string[] {\n if (!Array.isArray(value)) return [];\n return value.filter((entry): entry is string => typeof entry === \"string\");\n}\n\n// hasObjectItemProperties reports whether an array's items are objects with a\n// fixed `properties` set — the precondition for both the column-per-property\n// table and the summary-row accordion, which need to know the item's shape.\nexport function hasObjectItemProperties(\n items: JsonSchemaProperty | undefined,\n): boolean {\n return (\n !!items && !!items.properties && Object.keys(items.properties).length > 0\n );\n}\n\n// Object-level `x-columns`: how many equal columns to split a stacked object\n// into. \"auto\" fits as many as the width allows. A number is clamped to [1, 12]\n// (a standard 12-track grid, so a 3-across row of span-4 fields and a 4-across\n// row of span-3 fields share one object); anything invalid is a single column.\nexport function normalizeColumns(value: unknown): GridColumns {\n if (value === \"auto\") return \"auto\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), 12);\n}\n\n// Per-field `x-col-span`: how many of the object's columns a field occupies.\n// \"full\" spans the whole row. Under `x-columns: \"auto\"` a numeric span cannot be\n// clamped against a track count that only exists at layout time, so it is capped\n// at the 12-track maximum instead. Invalid falls back to 1.\nexport function normalizeColSpan(\n value: unknown,\n columns: GridColumns,\n): number | \"full\" {\n if (value === \"full\") return \"full\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), columns === \"auto\" ? 12 : columns);\n}\n\n// The `x-columns: \"auto\"` column floor: wide enough for a labelled control to\n// stay readable, narrow enough that a 1440px pane gets three columns, not two.\nexport const DEFAULT_COLUMN_MIN_WIDTH = \"15rem\";\n\n// cssLength guards a schema-supplied CSS length before it reaches an inline\n// style. Non-strings (and the empty string) fall back rather than emitting a\n// declaration the browser will drop.\nexport function cssLength(value: unknown, fallback: string): string {\n return typeof value === \"string\" && value.trim() ? value.trim() : fallback;\n}\n\n// withSyntheticValue prepends the current value as an option when it is not in\n// the enum, so an out-of-enum value (e.g. a template token) still displays.\nexport function withSyntheticValue(options: FieldOption[], value: string): FieldOption[] {\n if (!value || options.some((o) => o.value === value)) return options;\n return [{ value, label: value }, ...options];\n}\n\n// keyPickerOptions narrows the map-key enum to keys not already used by another\n// entry, while always keeping this row's current key so it stays selectable.\nexport function keyPickerOptions(\n options: FieldOption[],\n usedKeys: string[],\n currentKey: string,\n): FieldOption[] {\n const taken = new Set(usedKeys.filter((k) => k !== currentKey));\n return options.filter((o) => !taken.has(o.value));\n}\n\n// matchesFieldFilter reports whether a property should stay visible under the\n// display-options field filter: a case-insensitive substring match against the\n// field's key and its display label (`title` when set, otherwise the key). A\n// blank filter matches everything, so an empty box never hides fields.\nexport function matchesFieldFilter(\n key: string,\n prop: JsonSchemaProperty,\n filter: string,\n): boolean {\n const query = filter.trim().toLowerCase();\n if (!query) return true;\n const label = typeof prop.title === \"string\" && prop.title ? prop.title : key;\n return key.toLowerCase().includes(query) || label.toLowerCase().includes(query);\n}\n\n// orderByXOrder reorders property entries by the schema's `x-order` hint: keys\n// named there render first (in that order), the rest keep document order. A\n// missing/empty hint is a no-op, so document order remains the default.\nexport function orderByXOrder<T>(entries: [string, T][], order: unknown): [string, T][] {\n if (!Array.isArray(order) || order.length === 0) return entries;\n const rank = new Map(\n order.filter((k): k is string => typeof k === \"string\").map((k, i) => [k, i]),\n );\n const listed = entries\n .filter(([key]) => rank.has(key))\n .sort((a, b) => rank.get(a[0])! - rank.get(b[0])!);\n const rest = entries.filter(([key]) => !rank.has(key));\n return [...listed, ...rest];\n}\n\n// orderByClickyOrder stably sorts property entries by each property's numeric\n// `x-clicky-order` (lower first); entries without it keep their incoming order\n// after the ordered ones. An explicit index tie-break keeps it stable regardless\n// of the engine's sort stability. Unlike the object-level `x-order` array, this\n// composes across merged if/then branches because each property carries its own\n// order — the right tool when fields come from different (embedded) sources.\nexport function orderByClickyOrder(\n entries: [string, JsonSchemaProperty][],\n): [string, JsonSchemaProperty][] {\n const rank = (prop: JsonSchemaProperty): number => {\n const o = prop[\"x-clicky-order\"];\n return typeof o === \"number\" ? o : Number.POSITIVE_INFINITY;\n };\n return entries\n .map((entry, index) => ({ entry, index, rank: rank(entry[1]) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// orderRequiredFirst stably partitions property entries so the keys named in\n// `required` come first (in their original order), then the rest (in theirs).\n// A stable two-pass partition, so it never reshuffles within either group.\nexport function orderRequiredFirst<T>(\n entries: [string, T][],\n required: string[],\n): [string, T][] {\n const isRequired = new Set(required);\n const head = entries.filter(([key]) => isRequired.has(key));\n const tail = entries.filter(([key]) => !isRequired.has(key));\n return [...head, ...tail];\n}\n\n// isEmptyValue reports whether a field's value carries no data, so priority\n// sorting can sink unfilled fields. Empty = undefined/null/\"\" plus empty arrays\n// and empty plain objects; `false` and `0` count as filled (they are choices).\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null || value === \"\") return true;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n}\n\n// orderByPriority sorts property entries so the fields that matter most surface\n// first, ranking each by a score: +2 if required, +1 if its value is non-empty.\n// Required-and-filled lead, then required-and-empty, then optional-and-filled,\n// then optional-and-empty. Ties keep their incoming order (explicit index\n// tie-break, so it does not depend on the engine's sort stability).\nexport function orderByPriority<T>(\n entries: [string, T][],\n required: string[],\n values: Record<string, unknown>,\n): [string, T][] {\n const isRequired = new Set(required);\n const score = (key: string): number =>\n (isRequired.has(key) ? 2 : 0) + (isEmptyValue(values[key]) ? 0 : 1);\n return entries\n .map((entry, index) => ({ entry, index, score: score(entry[0]) }))\n .sort((a, b) => b.score - a.score || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// softError computes a display-only validation hint. It never blocks onChange.\n// Consumers suppress the unknown-enum hint by setting allowCustomValue.\nexport function softError(field: FieldControl): string | undefined {\n const v = field.value;\n const isEmpty = v === undefined || v === null || v === \"\";\n if (field.required && isEmpty) return \"Required\";\n\n if (field.kind === \"number\" && typeof field.minimum === \"number\" && typeof v === \"number\") {\n if (v < field.minimum) return `Must be ≥ ${field.minimum}`;\n }\n\n if (field.kind === \"enum\" && !field.allowCustomValue && !isEmpty) {\n const known = (field.options ?? []).some((o) => o.value === String(v));\n if (!known) return \"Unknown value (allowed)\";\n }\n return undefined;\n}\n\n// seedFromSchema produces the initial value for a freshly-added array item or\n// object field, honouring an explicit default.\nexport function seedFromSchema(schema: JsonSchemaProperty): unknown {\n if (schema.default !== undefined) return schema.default;\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n if (type === \"array\") return [];\n if (type === \"object\") return {};\n if (type === \"boolean\") return false;\n // Numbers seed as \"\" so the soft Required hint can show without coercion\n // surprises; the number control coerces on first real input.\n return \"\";\n}\n"],"names":[],"mappings":";;AAWA,MAAM,aACJ;AAEK,SAAS,WAAW,MAAwB;AACjD,SAAO,GAAG,YAAY,eAAe,IAAI,CAAC;AAC5C;AAUA,SAAS,aAAa,OAAuB;AAC3C,MAAI,UAAU,GAAI,QAAO;AACzB,SAAO,MAAM,QAAQ,iBAAiB,CAAC,SAAS,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG;AACxF;AAWO,SAAS,aAAa,cAAsB,QAAyB;AAC1E,QAAM,SAAS,iBAAiB,KAAK,KAA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AAS,QAAS,QAAO,CAAA;AAC7B,MAAI,SAAS,SAAU,QAAO,CAAA;AAC9B,MAAI,SAAS,UAAW,QAAO;AAG/B,SAAO;AACT;"}
|
|
@@ -73,9 +73,15 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
73
73
|
const scope = inner === void 0 ? { value: node2.value, path: node2.path } : { value: inner, path: "$" };
|
|
74
74
|
const root = inner === void 0 ? node2.root : node2.root ?? sourceColumn(node2.path);
|
|
75
75
|
if (root !== void 0) scope.root = root;
|
|
76
|
+
const origin = inner === void 0 ? node2.origin : {
|
|
77
|
+
path: node2.path,
|
|
78
|
+
kind: jsonPathKind(inner),
|
|
79
|
+
...node2.origin ? { outer: node2.origin } : {}
|
|
80
|
+
};
|
|
81
|
+
if (origin !== void 0) scope.origin = origin;
|
|
76
82
|
return scope;
|
|
77
83
|
}
|
|
78
|
-
function node(value, path, key, root) {
|
|
84
|
+
function node(value, path, key, root, origin) {
|
|
79
85
|
const cached = nodes.get(key);
|
|
80
86
|
if (cached) return cached;
|
|
81
87
|
const created = {
|
|
@@ -87,6 +93,7 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
87
93
|
childCount: entryCount(value)
|
|
88
94
|
};
|
|
89
95
|
if (root !== void 0) created.root = root;
|
|
96
|
+
if (origin !== void 0) created.origin = origin;
|
|
90
97
|
nodes.set(key, created);
|
|
91
98
|
return created;
|
|
92
99
|
}
|
|
@@ -102,7 +109,7 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
102
109
|
const limit = Math.min(entries.length, maxChildren);
|
|
103
110
|
const children = entries.slice(0, limit).map(([key, value]) => {
|
|
104
111
|
const path = appendJSONPath(scope.path, key);
|
|
105
|
-
return node(value, path, `${parent.key}>${path}`, scope.root);
|
|
112
|
+
return node(value, path, `${parent.key}>${path}`, scope.root, scope.origin);
|
|
106
113
|
});
|
|
107
114
|
if (limit < entries.length) {
|
|
108
115
|
children.push({
|
|
@@ -123,7 +130,7 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
123
130
|
const inner = embedded(node2);
|
|
124
131
|
return inner !== void 0 && entryCount(inner) > 0;
|
|
125
132
|
}
|
|
126
|
-
const rootNode = node(json, "$", `${keyPrefix}$`, void 0);
|
|
133
|
+
const rootNode = node(json, "$", `${keyPrefix}$`, void 0, void 0);
|
|
127
134
|
return {
|
|
128
135
|
roots: json === void 0 ? [] : [rootNode],
|
|
129
136
|
getChildren: (node2) => node2.children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonPathTree.cjs","sources":["../../src/components/jsonPathTree.ts"],"sourcesContent":["// The JSON→JSONPath tree model shared by the inline picker dropdown and the\n// full playground dialog.\n//\n// The two want opposite things from the same walk. The dropdown is a *preview*\n// of a row that has to render the instant it opens, so it builds eagerly and\n// pays for that with caps: depth, property count, and one array element. The\n// playground is a *browser* of the row, so it must have no caps at all — which\n// is only affordable if the walk is lazy, materialising a level at a time as the\n// operator opens it.\n\nconst SIMPLE_PROPERTY = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\nexport const DEFAULT_MAX_DEPTH = 12;\nexport const DEFAULT_MAX_OBJECT_PROPERTIES = 100;\n/**\n * Entries the uncapped tree renders under one node before it stops and says so.\n *\n * Depth is what the playground removes the limit on; breadth still has to render\n * as DOM rows the moment a node opens, and a hundred-thousand-element array\n * would take the tab down. The remainder is reported in a visible row rather\n * than dropped quietly — an index past it is still reachable by typing it.\n */\nexport const DEFAULT_MAX_CHILDREN = 1000;\n\nexport type JSONPathNodeKind = \"array\" | \"object\" | \"scalar\" | \"more\";\n\nexport interface JSONPathNode {\n key: string;\n path: string;\n value: unknown;\n kind: JSONPathNodeKind;\n summary: string;\n children?: JSONPathNode[];\n /**\n * The top-level column this node's path is rooted at, set only inside a\n * subtree decoded out of a JSON-encoded string. Such a path cannot be read\n * from the row directly — the backend reaches it by way of the column's\n * `source`, so the two have to be committed together.\n */\n root?: string;\n /** Number of entries the node holds, before any paging. */\n childCount: number;\n}\n\nexport interface BuildJSONPathNodeOptions {\n maxDepth?: number;\n maxObjectProperties?: number;\n /** \"first\" exposes only element [0] of an array; \"all\" exposes every element. */\n arrayMode?: \"first\" | \"all\";\n}\n\nexport function jsonPathKind(value: unknown): JSONPathNodeKind {\n if (Array.isArray(value)) return \"array\";\n return value !== null && typeof value === \"object\" ? \"object\" : \"scalar\";\n}\n\nexport function appendJSONPath(path: string, key: string | number): string {\n if (typeof key === \"number\") return `${path}[${key}]`;\n return SIMPLE_PROPERTY.test(key) ? `${path}.${key}` : `${path}[${JSON.stringify(key)}]`;\n}\n\nexport function summarizeJSON(value: unknown): string {\n if (Array.isArray(value)) return `[${value.length} item${value.length === 1 ? \"\" : \"s\"}]`;\n if (value !== null && typeof value === \"object\") {\n const count = Object.keys(value).length;\n return `{${count} ${count === 1 ? \"property\" : \"properties\"}}`;\n }\n if (typeof value === \"string\") return JSON.stringify(value.length > 80 ? `${value.slice(0, 77)}…` : value);\n return String(value);\n}\n\nfunction entryCount(value: unknown): number {\n if (Array.isArray(value)) return value.length;\n if (value !== null && typeof value === \"object\") return Object.keys(value).length;\n return 0;\n}\n\n/**\n * The eager, capped walk behind the inline dropdown. Deep, wide, or long values\n * are truncated on purpose: the dropdown opens on a click and cannot afford to\n * walk an arbitrary document first.\n */\nexport function buildJSONPathNode(\n value: unknown,\n path: string,\n depth: number,\n options: BuildJSONPathNodeOptions = {},\n): JSONPathNode {\n const {\n maxDepth = DEFAULT_MAX_DEPTH,\n maxObjectProperties = DEFAULT_MAX_OBJECT_PROPERTIES,\n arrayMode = \"first\",\n } = options;\n const kind = jsonPathKind(value);\n const node: JSONPathNode = {\n key: path,\n path,\n value,\n kind,\n summary: summarizeJSON(value),\n childCount: entryCount(value),\n };\n if (kind === \"scalar\" || depth >= maxDepth) return node;\n const entries = Array.isArray(value)\n ? arrayMode === \"all\"\n ? value.map((entry, index) => [index, entry] as const)\n : value.length > 0\n ? [[0, value[0]] as const]\n : []\n : Object.entries(value as Record<string, unknown>).slice(0, maxObjectProperties);\n node.children = entries.map(([key, child]) =>\n buildJSONPathNode(child, appendJSONPath(path, key), depth + 1, options),\n );\n return node;\n}\n\nexport interface LazyJSONPathTreeOptions {\n maxChildren?: number;\n /**\n * Namespaces every node key. Two trees over different documents share their\n * paths, and Tree keys its React elements by node key — without a distinct\n * prefix, swapping the document underneath reuses the old subtree along with\n * the children it had already loaded.\n */\n keyPrefix?: string;\n /**\n * Descend into a string that parses as JSON. Providers routinely hand back a\n * document as an encoded column, and the backend already decodes one when a\n * column names it as its `source` — without this the picker shows the single\n * most interesting column in such a row as an opaque blob.\n */\n parseEmbeddedJSON?: boolean;\n}\n\nexport interface LazyJSONPathTree {\n roots: JSONPathNode[];\n /** Children already materialised, or undefined while the branch is unopened. */\n getChildren: (node: JSONPathNode) => JSONPathNode[] | undefined;\n hasMoreChildren: (node: JSONPathNode) => boolean;\n loadChildren: (node: JSONPathNode) => Promise<JSONPathNode[]>;\n /**\n * Materialise the branch a literal expression addresses and return its node,\n * so a tree can reveal the value it opened with. Returns undefined for an\n * expression that selects rather than addresses (a wildcard, a descent, a\n * filter) or for one the document does not carry.\n */\n materializePath: (expression: string) => JSONPathNode | undefined;\n}\n\n/**\n * An uncapped tree over `json`: every property, every array element, any depth.\n *\n * Nothing is walked until it is opened, so an arbitrarily deep or wide document\n * costs only what the operator actually looks at. Nodes are cached by path so\n * re-opening a branch returns the *same objects* — `TreeNode` compares the\n * selected node by identity, and a rebuilt node would silently lose the\n * highlight.\n */\nexport function createLazyJSONPathTree(\n json: unknown,\n options: LazyJSONPathTreeOptions = {},\n): LazyJSONPathTree {\n const { maxChildren = DEFAULT_MAX_CHILDREN, parseEmbeddedJSON = true, keyPrefix = \"\" } = options;\n const nodes = new Map<string, JSONPathNode>();\n\n // hasMoreChildren runs on every render of every visible row, so the decode is\n // memoised per node rather than re-parsing a long string each time.\n const decoded = new Map<string, unknown>();\n\n function embedded(node: JSONPathNode): unknown {\n if (!parseEmbeddedJSON || typeof node.value !== \"string\") return undefined;\n if (decoded.has(node.key)) return decoded.get(node.key);\n const text = node.value.trim();\n let parsed: unknown = undefined;\n if (text.startsWith(\"{\") || text.startsWith(\"[\")) {\n try {\n const candidate: unknown = JSON.parse(text);\n if (jsonPathKind(candidate) !== \"scalar\") parsed = candidate;\n } catch {\n parsed = undefined;\n }\n }\n decoded.set(node.key, parsed);\n return parsed;\n }\n\n // What a node's children are drawn from: its own value, or the document\n // decoded out of it when it holds JSON as text. An embedded document restarts\n // at `$` because that is where the backend evaluates it from once the column\n // is named as a `source`.\n function contents(node: JSONPathNode): { value: unknown; path: string; root?: string } {\n const inner = embedded(node);\n const scope: { value: unknown; path: string; root?: string } =\n inner === undefined\n ? { value: node.value, path: node.path }\n : { value: inner, path: \"$\" };\n const root = inner === undefined ? node.root : node.root ?? sourceColumn(node.path);\n if (root !== undefined) scope.root = root;\n return scope;\n }\n\n function node(\n value: unknown,\n path: string,\n key: string,\n root: string | undefined,\n ): JSONPathNode {\n const cached = nodes.get(key);\n if (cached) return cached;\n const created: JSONPathNode = {\n key,\n path,\n value,\n kind: jsonPathKind(value),\n summary: summarizeJSON(value),\n childCount: entryCount(value),\n };\n if (root !== undefined) created.root = root;\n nodes.set(key, created);\n return created;\n }\n\n function entriesOf(value: unknown): Array<readonly [string | number, unknown]> {\n if (Array.isArray(value)) return value.map((entry, index) => [index, entry] as const);\n if (value !== null && typeof value === \"object\") return Object.entries(value as Record<string, unknown>);\n return [];\n }\n\n function materializeChildren(parent: JSONPathNode): JSONPathNode[] {\n if (parent.children) return parent.children;\n const scope = contents(parent);\n const entries = entriesOf(scope.value);\n const limit = Math.min(entries.length, maxChildren);\n const children = entries.slice(0, limit).map(([key, value]) => {\n const path = appendJSONPath(scope.path, key);\n // The key namespaces on the parent so an embedded document — which\n // restarts its paths at `$` — cannot collide with the outer row.\n return node(value, path, `${parent.key}>${path}`, scope.root);\n });\n if (limit < entries.length) {\n children.push({\n key: `${parent.key}>…`,\n path: scope.path,\n value: undefined,\n kind: \"more\",\n summary: `${entries.length - limit} more not shown — address them by index`,\n childCount: entries.length - limit,\n });\n }\n parent.children = children;\n return children;\n }\n\n function expandable(node: JSONPathNode): boolean {\n if (node.kind === \"more\") return false;\n if (node.kind !== \"scalar\") return node.childCount > 0;\n const inner = embedded(node);\n return inner !== undefined && entryCount(inner) > 0;\n }\n\n const rootNode = node(json, \"$\", `${keyPrefix}$`, undefined);\n\n return {\n roots: json === undefined ? [] : [rootNode],\n getChildren: (node) => node.children,\n hasMoreChildren: (node) => node.children === undefined && expandable(node),\n loadChildren: (parent) => Promise.resolve(materializeChildren(parent)),\n materializePath: (expression) => {\n const segments = literalSegments(expression);\n if (!segments) return undefined;\n let current = rootNode;\n for (const segment of segments) {\n const target = appendJSONPath(contents(current).path, segment);\n const next = materializeChildren(current).find((child) => child.path === target);\n if (!next) return undefined;\n current = next;\n }\n return current;\n },\n };\n}\n\n/** The top-level column a row-rooted path starts at, e.g. `$.payload.x` → `payload`. */\nfunction sourceColumn(path: string): string | undefined {\n return literalSegments(path)?.slice(0, 1).map(String)[0];\n}\n\n/**\n * The literal key/index chain an expression addresses, or undefined when it\n * selects instead — a wildcard, a descent, or a filter matches a set whose shape\n * depends on the document, so there is no single branch to walk to.\n */\nexport function literalSegments(expression: string): Array<string | number> | undefined {\n let rest = expression.trim();\n if (rest === \"\") return undefined;\n if (!rest.startsWith(\"$\")) return undefined;\n rest = rest.slice(1);\n const segments: Array<string | number> = [];\n while (rest.length > 0) {\n if (rest.startsWith(\"..\")) return undefined;\n if (rest.startsWith(\".\")) {\n const match = /^\\.([A-Za-z_$][A-Za-z0-9_$]*)/.exec(rest);\n if (!match) return undefined;\n segments.push(match[1]!);\n rest = rest.slice(match[0].length);\n continue;\n }\n if (rest.startsWith(\"[\")) {\n const close = rest.indexOf(\"]\");\n if (close < 0) return undefined;\n const inner = rest.slice(1, close).trim();\n if (/^\\d+$/.test(inner)) segments.push(Number(inner));\n else if (/^\"(?:[^\"\\\\]|\\\\.)*\"$/.test(inner)) segments.push(JSON.parse(inner) as string);\n else if (/^'[^']*'$/.test(inner)) segments.push(inner.slice(1, -1));\n else return undefined;\n rest = rest.slice(close + 1);\n continue;\n }\n return undefined;\n }\n return segments;\n}\n"],"names":["node"],"mappings":";;AAUA,MAAM,kBAAkB;AAEjB,MAAM,oBAAoB;AAC1B,MAAM,gCAAgC;AAStC,MAAM,uBAAuB;AA6B7B,SAAS,aAAa,OAAkC;AAC7D,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,SAAO,UAAU,QAAQ,OAAO,UAAU,WAAW,WAAW;AAClE;AAEO,SAAS,eAAe,MAAc,KAA8B;AACzE,MAAI,OAAO,QAAQ,iBAAiB,GAAG,IAAI,IAAI,GAAG;AAClD,SAAO,gBAAgB,KAAK,GAAG,IAAI,GAAG,IAAI,IAAI,GAAG,KAAK,GAAG,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC;AACtF;AAEO,SAAS,cAAc,OAAwB;AACpD,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,IAAI,MAAM,MAAM,QAAQ,MAAM,WAAW,IAAI,KAAK,GAAG;AACtF,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC/C,UAAM,QAAQ,OAAO,KAAK,KAAK,EAAE;AACjC,WAAO,IAAI,KAAK,IAAI,UAAU,IAAI,aAAa,YAAY;AAAA,EAC7D;AACA,MAAI,OAAO,UAAU,SAAU,QAAO,KAAK,UAAU,MAAM,SAAS,KAAK,GAAG,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,KAAK;AACzG,SAAO,OAAO,KAAK;AACrB;AAEA,SAAS,WAAW,OAAwB;AAC1C,MAAI,MAAM,QAAQ,KAAK,UAAU,MAAM;AACvC,MAAI,UAAU,QAAQ,OAAO,UAAU,SAAU,QAAO,OAAO,KAAK,KAAK,EAAE;AAC3E,SAAO;AACT;AAOO,SAAS,kBACd,OACA,MACA,OACA,UAAoC,CAAA,GACtB;AACd,QAAM;AAAA,IAC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ACZ;AACA,aAAO;AAAA,IACT;AAAA,EAAA;AAEJ;AAGA,SAAS,aAAa,MAAkC;;AACtD,UAAO,qBAAgB,IAAI,MAApB,mBAAuB,MAAM,GAAG,GAAG,IAAI,QAAQ;AACxD;AAOO,SAAS,gBAAgB,YAAwD;AACtF,MAAI,OAAO,WAAW,KAAA;AACtB,MAAI,SAAS,GAAI,QAAO;AACxB,MAAI,CAAC,KAAK,WAAW,GAAG,EAAG,QAAO;AAClC,SAAO,KAAK,MAAM,CAAC;AACnB,QAAM,WAAmC,CAAA;AACzC,SAAO,KAAK,SAAS,GAAG;AACtB,QAAI,KAAK,WAAW,IAAI,EAAG,QAAO;AAClC,QAAI,KAAK,WAAW,GAAG,GAAG;AACxB,YAAM,QAAQ,gCAAgC,KAAK,IAAI;AACvD,UAAI,CAAC,MAAO,QAAO;AACnB,eAAS,KAAK,MAAM,CAAC,CAAE;AACvB,aAAO,KAAK,MAAM,MAAM,CAAC,EAAE,MAAM;AACjC;AAAA,IACF;AACA,QAAI,KAAK,WAAW,GAAG,GAAG;AACxB,YAAM,QAAQ,KAAK,QAAQ,GAAG;AAC9B,UAAI,QAAQ,EAAG,QAAO;AACtB,YAAM,QAAQ,KAAK,MAAM,GAAG,KAAK,EAAE,KAAA;AACnC,UAAI,QAAQ,KAAK,KAAK,YAAY,KAAK,OAAO,KAAK,CAAC;AAAA,eAC3C,sBAAsB,KAAK,KAAK,YAAY,KAAK,KAAK,MAAM,KAAK,CAAW;AAAA,eAC5E,YAAY,KAAK,KAAK,EAAG,UAAS,KAAK,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,UAC7D,QAAO;AACZ,aAAO,KAAK,MAAM,QAAQ,CAAC;AAC3B;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"jsonPathTree.cjs","sources":["../../src/components/jsonPathTree.ts"],"sourcesContent":["// The JSON→JSONPath tree model shared by the inline picker dropdown and the\n// full playground dialog.\n//\n// The two want opposite things from the same walk. The dropdown is a *preview*\n// of a row that has to render the instant it opens, so it builds eagerly and\n// pays for that with caps: depth, property count, and one array element. The\n// playground is a *browser* of the row, so it must have no caps at all — which\n// is only affordable if the walk is lazy, materialising a level at a time as the\n// operator opens it.\n\nconst SIMPLE_PROPERTY = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\nexport const DEFAULT_MAX_DEPTH = 12;\nexport const DEFAULT_MAX_OBJECT_PROPERTIES = 100;\n/**\n * Entries the uncapped tree renders under one node before it stops and says so.\n *\n * Depth is what the playground removes the limit on; breadth still has to render\n * as DOM rows the moment a node opens, and a hundred-thousand-element array\n * would take the tab down. The remainder is reported in a visible row rather\n * than dropped quietly — an index past it is still reachable by typing it.\n */\nexport const DEFAULT_MAX_CHILDREN = 1000;\n\nexport type JSONPathNodeKind = \"array\" | \"object\" | \"scalar\" | \"more\";\n\nexport interface JSONPathNode {\n key: string;\n path: string;\n value: unknown;\n kind: JSONPathNodeKind;\n summary: string;\n children?: JSONPathNode[];\n /**\n * The top-level column this node's path is rooted at, set only inside a\n * subtree decoded out of a JSON-encoded string. Such a path cannot be read\n * from the row directly — the backend reaches it by way of the column's\n * `source`, so the two have to be committed together.\n */\n root?: string;\n /**\n * The JSON-in-a-string boundaries crossed on the way down to this node,\n * innermost first. `root` names only the top-level column, because that is\n * what the backend's `source` takes — which loses the rest of the chain when\n * the encoded value is nested, and says nothing about what it decoded to.\n * A caller rebuilding an accessor needs both.\n */\n origin?: JSONPathOrigin;\n /** Number of entries the node holds, before any paging. */\n childCount: number;\n}\n\n/** One JSON-in-a-string boundary: where it was, and what came out of it. */\nexport interface JSONPathOrigin {\n /** Path of the string node the document was decoded out of, in its own scope. */\n path: string;\n /** Kind of the decoded document — which decoder crosses this boundary. */\n kind: \"array\" | \"object\";\n /** The boundary enclosing this one, when JSON is encoded inside JSON. */\n outer?: JSONPathOrigin;\n}\n\nexport interface BuildJSONPathNodeOptions {\n maxDepth?: number;\n maxObjectProperties?: number;\n /** \"first\" exposes only element [0] of an array; \"all\" exposes every element. */\n arrayMode?: \"first\" | \"all\";\n}\n\nexport function jsonPathKind(value: unknown): JSONPathNodeKind {\n if (Array.isArray(value)) return \"array\";\n return value !== null && typeof value === \"object\" ? \"object\" : \"scalar\";\n}\n\nexport function appendJSONPath(path: string, key: string | number): string {\n if (typeof key === \"number\") return `${path}[${key}]`;\n return SIMPLE_PROPERTY.test(key) ? `${path}.${key}` : `${path}[${JSON.stringify(key)}]`;\n}\n\nexport function summarizeJSON(value: unknown): string {\n if (Array.isArray(value)) return `[${value.length} item${value.length === 1 ? \"\" : \"s\"}]`;\n if (value !== null && typeof value === \"object\") {\n const count = Object.keys(value).length;\n return `{${count} ${count === 1 ? \"property\" : \"properties\"}}`;\n }\n if (typeof value === \"string\") return JSON.stringify(value.length > 80 ? `${value.slice(0, 77)}…` : value);\n return String(value);\n}\n\nfunction entryCount(value: unknown): number {\n if (Array.isArray(value)) return value.length;\n if (value !== null && typeof value === \"object\") return Object.keys(value).length;\n return 0;\n}\n\n/**\n * The eager, capped walk behind the inline dropdown. Deep, wide, or long values\n * are truncated on purpose: the dropdown opens on a click and cannot afford to\n * walk an arbitrary document first.\n */\nexport function buildJSONPathNode(\n value: unknown,\n path: string,\n depth: number,\n options: BuildJSONPathNodeOptions = {},\n): JSONPathNode {\n const {\n maxDepth = DEFAULT_MAX_DEPTH,\n maxObjectProperties = DEFAULT_MAX_OBJECT_PROPERTIES,\n arrayMode = \"first\",\n } = options;\n const kind = jsonPathKind(value);\n const node: JSONPathNode = {\n key: path,\n path,\n value,\n kind,\n summary: summarizeJSON(value),\n childCount: entryCount(value),\n };\n if (kind === \"scalar\" || depth >= maxDepth) return node;\n const entries = Array.isArray(value)\n ? arrayMode === \"all\"\n ? value.map((entry, index) => [index, entry] as const)\n : value.length > 0\n ? [[0, value[0]] as const]\n : []\n : Object.entries(value as Record<string, unknown>).slice(0, maxObjectProperties);\n node.children = entries.map(([key, child]) =>\n buildJSONPathNode(child, appendJSONPath(path, key), depth + 1, options),\n );\n return node;\n}\n\nexport interface LazyJSONPathTreeOptions {\n maxChildren?: number;\n /**\n * Namespaces every node key. Two trees over different documents share their\n * paths, and Tree keys its React elements by node key — without a distinct\n * prefix, swapping the document underneath reuses the old subtree along with\n * the children it had already loaded.\n */\n keyPrefix?: string;\n /**\n * Descend into a string that parses as JSON. Providers routinely hand back a\n * document as an encoded column, and the backend already decodes one when a\n * column names it as its `source` — without this the picker shows the single\n * most interesting column in such a row as an opaque blob.\n */\n parseEmbeddedJSON?: boolean;\n}\n\nexport interface LazyJSONPathTree {\n roots: JSONPathNode[];\n /** Children already materialised, or undefined while the branch is unopened. */\n getChildren: (node: JSONPathNode) => JSONPathNode[] | undefined;\n hasMoreChildren: (node: JSONPathNode) => boolean;\n loadChildren: (node: JSONPathNode) => Promise<JSONPathNode[]>;\n /**\n * Materialise the branch a literal expression addresses and return its node,\n * so a tree can reveal the value it opened with. Returns undefined for an\n * expression that selects rather than addresses (a wildcard, a descent, a\n * filter) or for one the document does not carry.\n */\n materializePath: (expression: string) => JSONPathNode | undefined;\n}\n\n/**\n * An uncapped tree over `json`: every property, every array element, any depth.\n *\n * Nothing is walked until it is opened, so an arbitrarily deep or wide document\n * costs only what the operator actually looks at. Nodes are cached by path so\n * re-opening a branch returns the *same objects* — `TreeNode` compares the\n * selected node by identity, and a rebuilt node would silently lose the\n * highlight.\n */\nexport function createLazyJSONPathTree(\n json: unknown,\n options: LazyJSONPathTreeOptions = {},\n): LazyJSONPathTree {\n const { maxChildren = DEFAULT_MAX_CHILDREN, parseEmbeddedJSON = true, keyPrefix = \"\" } = options;\n const nodes = new Map<string, JSONPathNode>();\n\n // hasMoreChildren runs on every render of every visible row, so the decode is\n // memoised per node rather than re-parsing a long string each time.\n const decoded = new Map<string, unknown>();\n\n function embedded(node: JSONPathNode): unknown {\n if (!parseEmbeddedJSON || typeof node.value !== \"string\") return undefined;\n if (decoded.has(node.key)) return decoded.get(node.key);\n const text = node.value.trim();\n let parsed: unknown = undefined;\n if (text.startsWith(\"{\") || text.startsWith(\"[\")) {\n try {\n const candidate: unknown = JSON.parse(text);\n if (jsonPathKind(candidate) !== \"scalar\") parsed = candidate;\n } catch {\n parsed = undefined;\n }\n }\n decoded.set(node.key, parsed);\n return parsed;\n }\n\n // What a node's children are drawn from: its own value, or the document\n // decoded out of it when it holds JSON as text. An embedded document restarts\n // at `$` because that is where the backend evaluates it from once the column\n // is named as a `source`.\n function contents(node: JSONPathNode): {\n value: unknown;\n path: string;\n root?: string;\n origin?: JSONPathOrigin;\n } {\n const inner = embedded(node);\n const scope: { value: unknown; path: string; root?: string; origin?: JSONPathOrigin } =\n inner === undefined\n ? { value: node.value, path: node.path }\n : { value: inner, path: \"$\" };\n const root = inner === undefined ? node.root : node.root ?? sourceColumn(node.path);\n if (root !== undefined) scope.root = root;\n // A boundary is only visible here: this is the one place that knows both\n // which node held the text and what the text decoded to. embedded() has\n // already rejected anything scalar, so the kind is array or object.\n const origin =\n inner === undefined\n ? node.origin\n : {\n path: node.path,\n kind: jsonPathKind(inner) as \"array\" | \"object\",\n ...(node.origin ? { outer: node.origin } : {}),\n };\n if (origin !== undefined) scope.origin = origin;\n return scope;\n }\n\n function node(\n value: unknown,\n path: string,\n key: string,\n root: string | undefined,\n origin: JSONPathOrigin | undefined,\n ): JSONPathNode {\n const cached = nodes.get(key);\n if (cached) return cached;\n const created: JSONPathNode = {\n key,\n path,\n value,\n kind: jsonPathKind(value),\n summary: summarizeJSON(value),\n childCount: entryCount(value),\n };\n if (root !== undefined) created.root = root;\n if (origin !== undefined) created.origin = origin;\n nodes.set(key, created);\n return created;\n }\n\n function entriesOf(value: unknown): Array<readonly [string | number, unknown]> {\n if (Array.isArray(value)) return value.map((entry, index) => [index, entry] as const);\n if (value !== null && typeof value === \"object\") return Object.entries(value as Record<string, unknown>);\n return [];\n }\n\n function materializeChildren(parent: JSONPathNode): JSONPathNode[] {\n if (parent.children) return parent.children;\n const scope = contents(parent);\n const entries = entriesOf(scope.value);\n const limit = Math.min(entries.length, maxChildren);\n const children = entries.slice(0, limit).map(([key, value]) => {\n const path = appendJSONPath(scope.path, key);\n // The key namespaces on the parent so an embedded document — which\n // restarts its paths at `$` — cannot collide with the outer row.\n return node(value, path, `${parent.key}>${path}`, scope.root, scope.origin);\n });\n if (limit < entries.length) {\n children.push({\n key: `${parent.key}>…`,\n path: scope.path,\n value: undefined,\n kind: \"more\",\n summary: `${entries.length - limit} more not shown — address them by index`,\n childCount: entries.length - limit,\n });\n }\n parent.children = children;\n return children;\n }\n\n function expandable(node: JSONPathNode): boolean {\n if (node.kind === \"more\") return false;\n if (node.kind !== \"scalar\") return node.childCount > 0;\n const inner = embedded(node);\n return inner !== undefined && entryCount(inner) > 0;\n }\n\n const rootNode = node(json, \"$\", `${keyPrefix}$`, undefined, undefined);\n\n return {\n roots: json === undefined ? [] : [rootNode],\n getChildren: (node) => node.children,\n hasMoreChildren: (node) => node.children === undefined && expandable(node),\n loadChildren: (parent) => Promise.resolve(materializeChildren(parent)),\n materializePath: (expression) => {\n const segments = literalSegments(expression);\n if (!segments) return undefined;\n let current = rootNode;\n for (const segment of segments) {\n const target = appendJSONPath(contents(current).path, segment);\n const next = materializeChildren(current).find((child) => child.path === target);\n if (!next) return undefined;\n current = next;\n }\n return current;\n },\n };\n}\n\n/** The top-level column a row-rooted path starts at, e.g. `$.payload.x` → `payload`. */\nfunction sourceColumn(path: string): string | undefined {\n return literalSegments(path)?.slice(0, 1).map(String)[0];\n}\n\n/**\n * The literal key/index chain an expression addresses, or undefined when it\n * selects instead — a wildcard, a descent, or a filter matches a set whose shape\n * depends on the document, so there is no single branch to walk to.\n */\nexport function literalSegments(expression: string): Array<string | number> | undefined {\n let rest = expression.trim();\n if (rest === \"\") return undefined;\n if (!rest.startsWith(\"$\")) return undefined;\n rest = rest.slice(1);\n const segments: Array<string | number> = [];\n while (rest.length > 0) {\n if (rest.startsWith(\"..\")) return undefined;\n if (rest.startsWith(\".\")) {\n const match = /^\\.([A-Za-z_$][A-Za-z0-9_$]*)/.exec(rest);\n if (!match) return undefined;\n segments.push(match[1]!);\n rest = rest.slice(match[0].length);\n continue;\n }\n if (rest.startsWith(\"[\")) {\n const close = rest.indexOf(\"]\");\n if (close < 0) return undefined;\n const inner = rest.slice(1, close).trim();\n if (/^\\d+$/.test(inner)) segments.push(Number(inner));\n else if (/^\"(?:[^\"\\\\]|\\\\.)*\"$/.test(inner)) segments.push(JSON.parse(inner) as string);\n else if (/^'[^']*'$/.test(inner)) segments.push(inner.slice(1, -1));\n else return undefined;\n rest = rest.slice(close + 1);\n continue;\n }\n return undefined;\n }\n return segments;\n}\n"],"names":["node"],"mappings":";;AAUA,MAAM,kBAAkB;AAEjB,MAAM,oBAAoB;AAC1B,MAAM,gCAAgC;AAStC,MAAM,uBAAuB;AA+C7B,SAAS,aAAa,OAAkC;AAC7D,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO;AACjC,SAAO,UAAU,QAAQ,OAAO,UAAU,WAAW,WAAW;AAClE;AAEO,SAAS,eAAe,MAAc,KAA8B;AACzE,MAAI,OAAO,QAAQ,iBAAiB,GAAG,IAAI,IAAI,GAAG;AAClD,SAAO,gBAAgB,KAAK,GAAG,IAAI,GAAG,IAAI,IAAI,GAAG,KAAK,GAAG,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC;AACtF;AAEO,SAAS,cAAc,OAAwB;AACpD,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,IAAI,MAAM,MAAM,QAAQ,MAAM,WAAW,IAAI,KAAK,GAAG;AACtF,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC/C,UAAM,QAAQ,OAAO,KAAK,KAAK,EAAE;AACjC,WAAO,IAAI,KAAK,IAAI,UAAU,IAAI,aAAa,YAAY;AAAA,EAC7D;AACA,MAAI,OAAO,UAAU,SAAU,QAAO,KAAK,UAAU,MAAM,SAAS,KAAK,GAAG,MAAM,MAAM,GAAG,EAAE,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K,QAAQ,GAAG;AAC9B,UAAI,QAAQ,EAAG,QAAO;AACtB,YAAM,QAAQ,KAAK,MAAM,GAAG,KAAK,EAAE,KAAA;AACnC,UAAI,QAAQ,KAAK,KAAK,YAAY,KAAK,OAAO,KAAK,CAAC;AAAA,eAC3C,sBAAsB,KAAK,KAAK,YAAY,KAAK,KAAK,MAAM,KAAK,CAAW;AAAA,eAC5E,YAAY,KAAK,KAAK,EAAG,UAAS,KAAK,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,UAC7D,QAAO;AACZ,aAAO,KAAK,MAAM,QAAQ,CAAC;AAC3B;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;;;;;;;;;;"}
|
|
@@ -24,9 +24,26 @@ export interface JSONPathNode {
|
|
|
24
24
|
* `source`, so the two have to be committed together.
|
|
25
25
|
*/
|
|
26
26
|
root?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The JSON-in-a-string boundaries crossed on the way down to this node,
|
|
29
|
+
* innermost first. `root` names only the top-level column, because that is
|
|
30
|
+
* what the backend's `source` takes — which loses the rest of the chain when
|
|
31
|
+
* the encoded value is nested, and says nothing about what it decoded to.
|
|
32
|
+
* A caller rebuilding an accessor needs both.
|
|
33
|
+
*/
|
|
34
|
+
origin?: JSONPathOrigin;
|
|
27
35
|
/** Number of entries the node holds, before any paging. */
|
|
28
36
|
childCount: number;
|
|
29
37
|
}
|
|
38
|
+
/** One JSON-in-a-string boundary: where it was, and what came out of it. */
|
|
39
|
+
export interface JSONPathOrigin {
|
|
40
|
+
/** Path of the string node the document was decoded out of, in its own scope. */
|
|
41
|
+
path: string;
|
|
42
|
+
/** Kind of the decoded document — which decoder crosses this boundary. */
|
|
43
|
+
kind: "array" | "object";
|
|
44
|
+
/** The boundary enclosing this one, when JSON is encoded inside JSON. */
|
|
45
|
+
outer?: JSONPathOrigin;
|
|
46
|
+
}
|
|
30
47
|
export interface BuildJSONPathNodeOptions {
|
|
31
48
|
maxDepth?: number;
|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C,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;IACjD,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9D;;;;;OAKG;IACH,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;CACnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CA0IlB;AAOD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,SAAS,CA6BtF"}
|
|
@@ -71,9 +71,15 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
71
71
|
const scope = inner === void 0 ? { value: node2.value, path: node2.path } : { value: inner, path: "$" };
|
|
72
72
|
const root = inner === void 0 ? node2.root : node2.root ?? sourceColumn(node2.path);
|
|
73
73
|
if (root !== void 0) scope.root = root;
|
|
74
|
+
const origin = inner === void 0 ? node2.origin : {
|
|
75
|
+
path: node2.path,
|
|
76
|
+
kind: jsonPathKind(inner),
|
|
77
|
+
...node2.origin ? { outer: node2.origin } : {}
|
|
78
|
+
};
|
|
79
|
+
if (origin !== void 0) scope.origin = origin;
|
|
74
80
|
return scope;
|
|
75
81
|
}
|
|
76
|
-
function node(value, path, key, root) {
|
|
82
|
+
function node(value, path, key, root, origin) {
|
|
77
83
|
const cached = nodes.get(key);
|
|
78
84
|
if (cached) return cached;
|
|
79
85
|
const created = {
|
|
@@ -85,6 +91,7 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
85
91
|
childCount: entryCount(value)
|
|
86
92
|
};
|
|
87
93
|
if (root !== void 0) created.root = root;
|
|
94
|
+
if (origin !== void 0) created.origin = origin;
|
|
88
95
|
nodes.set(key, created);
|
|
89
96
|
return created;
|
|
90
97
|
}
|
|
@@ -100,7 +107,7 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
100
107
|
const limit = Math.min(entries.length, maxChildren);
|
|
101
108
|
const children = entries.slice(0, limit).map(([key, value]) => {
|
|
102
109
|
const path = appendJSONPath(scope.path, key);
|
|
103
|
-
return node(value, path, `${parent.key}>${path}`, scope.root);
|
|
110
|
+
return node(value, path, `${parent.key}>${path}`, scope.root, scope.origin);
|
|
104
111
|
});
|
|
105
112
|
if (limit < entries.length) {
|
|
106
113
|
children.push({
|
|
@@ -121,7 +128,7 @@ function createLazyJSONPathTree(json, options = {}) {
|
|
|
121
128
|
const inner = embedded(node2);
|
|
122
129
|
return inner !== void 0 && entryCount(inner) > 0;
|
|
123
130
|
}
|
|
124
|
-
const rootNode = node(json, "$", `${keyPrefix}$`, void 0);
|
|
131
|
+
const rootNode = node(json, "$", `${keyPrefix}$`, void 0, void 0);
|
|
125
132
|
return {
|
|
126
133
|
roots: json === void 0 ? [] : [rootNode],
|
|
127
134
|
getChildren: (node2) => node2.children,
|