@tai42/studio-sdk 16.0.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/code-block.js +1 -1
- package/dist/components/code-block.js.map +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-field.js +1 -1
- package/dist/components/copy-field.js.map +1 -1
- package/dist/components/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dirty-guard.d.ts.map +1 -1
- package/dist/components/dirty-guard.js +1 -1
- package/dist/components/dirty-guard.js.map +1 -1
- package/dist/components/explorer-body.d.ts +49 -0
- package/dist/components/explorer-body.d.ts.map +1 -0
- package/dist/components/explorer-body.js +67 -0
- package/dist/components/explorer-body.js.map +1 -0
- package/dist/components/explorer-page-size.d.ts +4 -0
- package/dist/components/explorer-page-size.d.ts.map +1 -0
- package/dist/components/explorer-page-size.js +36 -0
- package/dist/components/explorer-page-size.js.map +1 -0
- package/dist/components/explorer-tag-filter.d.ts +17 -0
- package/dist/components/explorer-tag-filter.d.ts.map +1 -0
- package/dist/components/explorer-tag-filter.js +29 -0
- package/dist/components/explorer-tag-filter.js.map +1 -0
- package/dist/components/explorer-tags.d.ts +22 -0
- package/dist/components/explorer-tags.d.ts.map +1 -0
- package/dist/components/explorer-tags.js +51 -0
- package/dist/components/explorer-tags.js.map +1 -0
- package/dist/components/explorer-view.d.ts +3 -17
- package/dist/components/explorer-view.d.ts.map +1 -1
- package/dist/components/explorer-view.js +53 -170
- package/dist/components/explorer-view.js.map +1 -1
- package/dist/components/extension-combo-builder.d.ts +1 -6
- package/dist/components/extension-combo-builder.d.ts.map +1 -1
- package/dist/components/extension-combo-builder.js +4 -79
- package/dist/components/extension-combo-builder.js.map +1 -1
- package/dist/components/extension-combo-parts.d.ts +44 -0
- package/dist/components/extension-combo-parts.d.ts.map +1 -0
- package/dist/components/extension-combo-parts.js +52 -0
- package/dist/components/extension-combo-parts.js.map +1 -0
- package/dist/components/field.d.ts +8 -0
- package/dist/components/field.d.ts.map +1 -1
- package/dist/components/field.js +0 -8
- package/dist/components/field.js.map +1 -1
- package/dist/components/fleet-report.d.ts +1 -1
- package/dist/components/fleet-report.d.ts.map +1 -1
- package/dist/components/fleet-report.js +51 -37
- package/dist/components/fleet-report.js.map +1 -1
- package/dist/components/folder-nav.d.ts.map +1 -1
- package/dist/components/folder-nav.js +1 -1
- package/dist/components/folder-nav.js.map +1 -1
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-dialog.js.map +1 -1
- package/dist/components/icons/chrome-marks.d.ts +50 -0
- package/dist/components/icons/chrome-marks.d.ts.map +1 -0
- package/dist/components/icons/chrome-marks.js +51 -0
- package/dist/components/icons/chrome-marks.js.map +1 -0
- package/dist/components/icons/icon-frame.d.ts +29 -0
- package/dist/components/icons/icon-frame.d.ts.map +1 -0
- package/dist/components/icons/icon-frame.js +19 -0
- package/dist/components/icons/icon-frame.js.map +1 -0
- package/dist/components/icons/index.d.ts +40 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/icons/index.js +39 -0
- package/dist/components/icons/index.js.map +1 -0
- package/dist/components/icons/nav-map.d.ts +14 -0
- package/dist/components/icons/nav-map.d.ts.map +1 -0
- package/dist/components/icons/nav-map.js +28 -0
- package/dist/components/icons/nav-map.js.map +1 -0
- package/dist/components/icons/nav-marks.d.ts +44 -0
- package/dist/components/icons/nav-marks.d.ts.map +1 -0
- package/dist/components/icons/nav-marks.js +45 -0
- package/dist/components/icons/nav-marks.js.map +1 -0
- package/dist/components/icons/status-marks.d.ts +21 -0
- package/dist/components/icons/status-marks.d.ts.map +1 -0
- package/dist/components/icons/status-marks.js +22 -0
- package/dist/components/icons/status-marks.js.map +1 -0
- package/dist/components/icons/theme-marks.d.ts +9 -0
- package/dist/components/icons/theme-marks.d.ts.map +1 -0
- package/dist/components/icons/theme-marks.js +10 -0
- package/dist/components/icons/theme-marks.js.map +1 -0
- package/dist/components/inputs.js.map +1 -1
- package/dist/components/json-diff.d.ts.map +1 -1
- package/dist/components/json-diff.js +1 -3
- package/dist/components/json-diff.js.map +1 -1
- package/dist/components/json-tree-context.d.ts +13 -0
- package/dist/components/json-tree-context.d.ts.map +1 -0
- package/dist/components/json-tree-context.js +15 -0
- package/dist/components/json-tree-context.js.map +1 -0
- package/dist/components/json-tree-model.d.ts +56 -0
- package/dist/components/json-tree-model.d.ts.map +1 -0
- package/dist/components/json-tree-model.js +125 -0
- package/dist/components/json-tree-model.js.map +1 -0
- package/dist/components/json-tree-nodes.d.ts +35 -0
- package/dist/components/json-tree-nodes.d.ts.map +1 -0
- package/dist/components/json-tree-nodes.js +113 -0
- package/dist/components/json-tree-nodes.js.map +1 -0
- package/dist/components/json-tree.d.ts +20 -0
- package/dist/components/json-tree.d.ts.map +1 -1
- package/dist/components/json-tree.js +7 -315
- package/dist/components/json-tree.js.map +1 -1
- package/dist/components/json-value-format.d.ts +20 -0
- package/dist/components/json-value-format.d.ts.map +1 -0
- package/dist/components/json-value-format.js +63 -0
- package/dist/components/json-value-format.js.map +1 -0
- package/dist/components/markdown-blocks.d.ts +38 -0
- package/dist/components/markdown-blocks.d.ts.map +1 -0
- package/dist/components/markdown-blocks.js +168 -0
- package/dist/components/markdown-blocks.js.map +1 -0
- package/dist/components/markdown-inline.d.ts +24 -0
- package/dist/components/markdown-inline.d.ts.map +1 -0
- package/dist/components/markdown-inline.js +257 -0
- package/dist/components/markdown-inline.js.map +1 -0
- package/dist/components/markdown.d.ts +3 -52
- package/dist/components/markdown.d.ts.map +1 -1
- package/dist/components/markdown.js +4 -376
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/observer-registry.d.ts +38 -0
- package/dist/components/observer-registry.d.ts.map +1 -0
- package/dist/components/observer-registry.js +131 -0
- package/dist/components/observer-registry.js.map +1 -0
- package/dist/components/overflow-measure.d.ts +38 -0
- package/dist/components/overflow-measure.d.ts.map +1 -0
- package/dist/components/overflow-measure.js +54 -0
- package/dist/components/overflow-measure.js.map +1 -0
- package/dist/components/page-fill.d.ts.map +1 -1
- package/dist/components/page-fill.js.map +1 -1
- package/dist/components/prose-regions.d.ts +81 -0
- package/dist/components/prose-regions.d.ts.map +1 -0
- package/dist/components/prose-regions.js +128 -0
- package/dist/components/prose-regions.js.map +1 -0
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/scroll-region.d.ts +24 -0
- package/dist/components/scroll-region.d.ts.map +1 -1
- package/dist/components/scroll-region.js +3 -322
- package/dist/components/scroll-region.js.map +1 -1
- package/dist/components/tab-stop-parse.d.ts +53 -0
- package/dist/components/tab-stop-parse.d.ts.map +1 -0
- package/dist/components/tab-stop-parse.js +202 -0
- package/dist/components/tab-stop-parse.js.map +1 -0
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/tags.d.ts.map +1 -1
- package/dist/components/tags.js +1 -1
- package/dist/components/tags.js.map +1 -1
- package/dist/components/templated-text-field.d.ts +1 -1
- package/dist/components/templated-text-field.d.ts.map +1 -1
- package/dist/components/templated-text-field.js +10 -174
- package/dist/components/templated-text-field.js.map +1 -1
- package/dist/components/templated-text-kwargs-editor.d.ts +24 -0
- package/dist/components/templated-text-kwargs-editor.d.ts.map +1 -0
- package/dist/components/templated-text-kwargs-editor.js +48 -0
- package/dist/components/templated-text-kwargs-editor.js.map +1 -0
- package/dist/components/templated-text-kwargs.d.ts +37 -0
- package/dist/components/templated-text-kwargs.d.ts.map +1 -0
- package/dist/components/templated-text-kwargs.js +66 -0
- package/dist/components/templated-text-kwargs.js.map +1 -0
- package/dist/components/templated-text-source.d.ts +33 -0
- package/dist/components/templated-text-source.d.ts.map +1 -0
- package/dist/components/templated-text-source.js +53 -0
- package/dist/components/templated-text-source.js.map +1 -0
- package/dist/components/tool-picker-parts.d.ts +39 -0
- package/dist/components/tool-picker-parts.d.ts.map +1 -0
- package/dist/components/tool-picker-parts.js +87 -0
- package/dist/components/tool-picker-parts.js.map +1 -0
- package/dist/components/tool-picker.d.ts +1 -2
- package/dist/components/tool-picker.d.ts.map +1 -1
- package/dist/components/tool-picker.js +4 -66
- package/dist/components/tool-picker.js.map +1 -1
- package/dist/components/version-history-panel.d.ts.map +1 -1
- package/dist/components/version-history-panel.js +7 -34
- package/dist/components/version-history-panel.js.map +1 -1
- package/dist/components/version-history-rows.d.ts +48 -0
- package/dist/components/version-history-rows.d.ts.map +1 -0
- package/dist/components/version-history-rows.js +51 -0
- package/dist/components/version-history-rows.js.map +1 -0
- package/dist/components/view-toggle.d.ts.map +1 -1
- package/dist/components/view-toggle.js.map +1 -1
- package/dist/element-slot.d.ts +11 -0
- package/dist/element-slot.d.ts.map +1 -1
- package/dist/element-slot.js +0 -11
- package/dist/element-slot.js.map +1 -1
- package/dist/guards.d.ts +6 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +8 -0
- package/dist/guards.js.map +1 -0
- package/dist/hooks/interactions-connection.d.ts +43 -0
- package/dist/hooks/interactions-connection.d.ts.map +1 -0
- package/dist/hooks/interactions-connection.js +171 -0
- package/dist/hooks/interactions-connection.js.map +1 -0
- package/dist/hooks/interactions-stream.d.ts +80 -0
- package/dist/hooks/interactions-stream.d.ts.map +1 -0
- package/dist/hooks/interactions-stream.js +233 -0
- package/dist/hooks/interactions-stream.js.map +1 -0
- package/dist/hooks/useApi.d.ts +2259 -2189
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useApi.js +0 -11
- package/dist/hooks/useApi.js.map +1 -1
- package/dist/hooks/useAuth.d.ts +6 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +0 -6
- package/dist/hooks/useAuth.js.map +1 -1
- package/dist/hooks/useCapabilities.d.ts +18 -2
- package/dist/hooks/useCapabilities.d.ts.map +1 -1
- package/dist/hooks/useCapabilities.js +1 -17
- package/dist/hooks/useCapabilities.js.map +1 -1
- package/dist/hooks/useSse.d.ts +34 -6
- package/dist/hooks/useSse.d.ts.map +1 -1
- package/dist/hooks/useSse.js +27 -471
- package/dist/hooks/useSse.js.map +1 -1
- package/dist/hooks/useSystemKinds.d.ts +1 -1
- package/dist/hooks/useSystemKinds.d.ts.map +1 -1
- package/dist/hooks/useSystemKinds.js +0 -18
- package/dist/hooks/useSystemKinds.js.map +1 -1
- package/dist/hooks/useTheme.d.ts +15 -0
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useTheme.js +0 -15
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/hooks/useToolDisplayNames.d.ts +0 -14
- package/dist/hooks/useToolDisplayNames.d.ts.map +1 -1
- package/dist/hooks/useToolDisplayNames.js +0 -14
- package/dist/hooks/useToolDisplayNames.js.map +1 -1
- package/dist/host.d.ts +3 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +2 -9
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +103 -103
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -62
- package/dist/index.js.map +1 -1
- package/dist/navigation/app-link.d.ts +25 -0
- package/dist/navigation/app-link.d.ts.map +1 -0
- package/dist/navigation/app-link.js +33 -0
- package/dist/navigation/app-link.js.map +1 -0
- package/dist/navigation/context.d.ts +3 -20
- package/dist/navigation/context.d.ts.map +1 -1
- package/dist/navigation/context.js +7 -267
- package/dist/navigation/context.js.map +1 -1
- package/dist/navigation/entry-state.d.ts +23 -0
- package/dist/navigation/entry-state.d.ts.map +1 -0
- package/dist/navigation/entry-state.js +39 -0
- package/dist/navigation/entry-state.js.map +1 -0
- package/dist/navigation/guard-registry.d.ts +30 -0
- package/dist/navigation/guard-registry.d.ts.map +1 -0
- package/dist/navigation/guard-registry.js +46 -0
- package/dist/navigation/guard-registry.js.map +1 -0
- package/dist/navigation/guarded-navigation.d.ts +24 -0
- package/dist/navigation/guarded-navigation.d.ts.map +1 -0
- package/dist/navigation/guarded-navigation.js +102 -0
- package/dist/navigation/guarded-navigation.js.map +1 -0
- package/dist/navigation/index.d.ts +5 -4
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +2 -1
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/types.d.ts +8 -11
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/navigation/use-back-forward-guard.d.ts +12 -0
- package/dist/navigation/use-back-forward-guard.d.ts.map +1 -0
- package/dist/navigation/use-back-forward-guard.js +75 -0
- package/dist/navigation/use-back-forward-guard.js.map +1 -0
- package/dist/navigation/use-search-commit.d.ts.map +1 -1
- package/dist/navigation/use-search-commit.js.map +1 -1
- package/dist/plugin/host-state.d.ts.map +1 -1
- package/dist/plugin/host-state.js.map +1 -1
- package/dist/plugin/registry.d.ts +6 -15
- package/dist/plugin/registry.d.ts.map +1 -1
- package/dist/plugin/registry.js +83 -75
- package/dist/plugin/registry.js.map +1 -1
- package/dist/schema-editor/SchemaEditor.d.ts.map +1 -1
- package/dist/schema-editor/SchemaEditor.js.map +1 -1
- package/dist/schema-editor/index.d.ts +3 -3
- package/dist/schema-editor/index.d.ts.map +1 -1
- package/dist/schema-editor/index.js +1 -6
- package/dist/schema-editor/index.js.map +1 -1
- package/dist/schema-form/SecretRefField.d.ts +18 -3
- package/dist/schema-form/SecretRefField.d.ts.map +1 -1
- package/dist/schema-form/SecretRefField.js +21 -26
- package/dist/schema-form/SecretRefField.js.map +1 -1
- package/dist/schema-form/classify.d.ts +1 -113
- package/dist/schema-form/classify.d.ts.map +1 -1
- package/dist/schema-form/classify.js +174 -246
- package/dist/schema-form/classify.js.map +1 -1
- package/dist/schema-form/context.d.ts +6 -0
- package/dist/schema-form/context.d.ts.map +1 -1
- package/dist/schema-form/context.js +0 -6
- package/dist/schema-form/context.js.map +1 -1
- package/dist/schema-form/default-value.d.ts.map +1 -1
- package/dist/schema-form/default-value.js +42 -19
- package/dist/schema-form/default-value.js.map +1 -1
- package/dist/schema-form/enum-field.d.ts +1 -1
- package/dist/schema-form/enum-field.d.ts.map +1 -1
- package/dist/schema-form/field-group.d.ts +6 -0
- package/dist/schema-form/field-group.d.ts.map +1 -1
- package/dist/schema-form/field-group.js +0 -6
- package/dist/schema-form/field-group.js.map +1 -1
- package/dist/schema-form/field-model.d.ts +121 -0
- package/dist/schema-form/field-model.d.ts.map +1 -0
- package/dist/schema-form/field-model.js +2 -0
- package/dist/schema-form/field-model.js.map +1 -0
- package/dist/schema-form/field-node.d.ts.map +1 -1
- package/dist/schema-form/field-node.js +25 -14
- package/dist/schema-form/field-node.js.map +1 -1
- package/dist/schema-form/index.d.ts +8 -8
- package/dist/schema-form/index.d.ts.map +1 -1
- package/dist/schema-form/index.js +3 -34
- package/dist/schema-form/index.js.map +1 -1
- package/dist/schema-form/json-field.d.ts +19 -0
- package/dist/schema-form/json-field.d.ts.map +1 -1
- package/dist/schema-form/json-field.js +0 -19
- package/dist/schema-form/json-field.js.map +1 -1
- package/dist/schema-form/media-field.d.ts +1 -1
- package/dist/schema-form/media-field.d.ts.map +1 -1
- package/dist/schema-form/media-field.js +49 -30
- package/dist/schema-form/media-field.js.map +1 -1
- package/dist/schema-form/record-field.d.ts +12 -0
- package/dist/schema-form/record-field.d.ts.map +1 -1
- package/dist/schema-form/record-field.js +1 -13
- package/dist/schema-form/record-field.js.map +1 -1
- package/dist/schema-form/string-annotations.d.ts +20 -0
- package/dist/schema-form/string-annotations.d.ts.map +1 -0
- package/dist/schema-form/string-annotations.js +105 -0
- package/dist/schema-form/string-annotations.js.map +1 -0
- package/dist/schema-form/string-field.d.ts +1 -1
- package/dist/schema-form/string-field.d.ts.map +1 -1
- package/dist/schema-form/string-field.js +1 -1
- package/dist/schema-form/string-field.js.map +1 -1
- package/dist/schema-form/union-field.d.ts +1 -1
- package/dist/schema-form/union-field.d.ts.map +1 -1
- package/dist/schema-form/union-field.js.map +1 -1
- package/dist/schema-form/union.d.ts +8 -1
- package/dist/schema-form/union.d.ts.map +1 -1
- package/dist/schema-form/union.js +0 -7
- package/dist/schema-form/union.js.map +1 -1
- package/dist/schema-form/validate.d.ts.map +1 -1
- package/dist/schema-form/validate.js +126 -105
- package/dist/schema-form/validate.js.map +1 -1
- package/dist/state-binding/AdapterMapping.d.ts.map +1 -1
- package/dist/state-binding/AdapterMapping.js +0 -0
- package/dist/state-binding/AdapterMapping.js.map +1 -1
- package/dist/state-binding/BindingJqField.d.ts.map +1 -1
- package/dist/state-binding/BindingJqField.js +2 -2
- package/dist/state-binding/BindingJqField.js.map +1 -1
- package/dist/state-binding/InputInjectionRow.d.ts.map +1 -1
- package/dist/state-binding/InputInjectionRow.js +3 -3
- package/dist/state-binding/InputInjectionRow.js.map +1 -1
- package/dist/state-binding/StateAttachRow.d.ts.map +1 -1
- package/dist/state-binding/StateAttachRow.js +57 -41
- package/dist/state-binding/StateAttachRow.js.map +1 -1
- package/dist/state-binding/StateBindingSection.d.ts.map +1 -1
- package/dist/state-binding/StateBindingSection.js.map +1 -1
- package/dist/state-binding/SubjectScopeFields.d.ts.map +1 -1
- package/dist/state-binding/SubjectScopeFields.js.map +1 -1
- package/dist/state-binding/UpdateRow.d.ts.map +1 -1
- package/dist/state-binding/UpdateRow.js +2 -2
- package/dist/state-binding/UpdateRow.js.map +1 -1
- package/dist/state-binding/adapter-mapping-row.d.ts +17 -0
- package/dist/state-binding/adapter-mapping-row.d.ts.map +1 -0
- package/dist/state-binding/adapter-mapping-row.js +87 -0
- package/dist/state-binding/adapter-mapping-row.js.map +1 -0
- package/dist/state-binding/index.d.ts +21 -21
- package/dist/state-binding/index.d.ts.map +1 -1
- package/dist/state-binding/index.js +9 -15
- package/dist/state-binding/index.js.map +1 -1
- package/dist/state-binding/templated-text-catalog.d.ts.map +1 -1
- package/dist/state-binding/templated-text-catalog.js.map +1 -1
- package/dist/state-binding/types.d.ts +2 -2
- package/dist/state-binding/types.d.ts.map +1 -1
- package/dist/structured-output/StructuredOutput.d.ts.map +1 -1
- package/dist/structured-output/StructuredOutput.js +1 -3
- package/dist/structured-output/StructuredOutput.js.map +1 -1
- package/package.json +2 -2
- package/src/components/code-block.tsx +1 -1
- package/src/components/confirm-dialog.tsx +1 -1
- package/src/components/copy-field.tsx +1 -1
- package/src/components/date-range-picker.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/dirty-guard.tsx +3 -3
- package/src/components/explorer-body.tsx +239 -0
- package/src/components/explorer-page-size.ts +39 -0
- package/src/components/explorer-tag-filter.tsx +80 -0
- package/src/components/explorer-tags.ts +64 -0
- package/src/components/explorer-view.tsx +115 -367
- package/src/components/extension-combo-builder.tsx +35 -153
- package/src/components/extension-combo-parts.tsx +236 -0
- package/src/components/field.tsx +1 -1
- package/src/components/fleet-report.tsx +98 -55
- package/src/components/folder-nav.tsx +2 -2
- package/src/components/form-dialog.tsx +2 -2
- package/src/components/icons/chrome-marks.tsx +195 -0
- package/src/components/icons/icon-frame.tsx +50 -0
- package/src/components/icons/index.ts +84 -0
- package/src/components/icons/nav-map.ts +55 -0
- package/src/components/icons/nav-marks.tsx +205 -0
- package/src/components/icons/status-marks.tsx +46 -0
- package/src/components/icons/theme-marks.tsx +33 -0
- package/src/components/inputs.tsx +1 -1
- package/src/components/json-diff.tsx +1 -4
- package/src/components/json-tree-context.ts +26 -0
- package/src/components/json-tree-model.ts +139 -0
- package/src/components/json-tree-nodes.tsx +224 -0
- package/src/components/json-tree.tsx +15 -434
- package/src/components/json-value-format.ts +64 -0
- package/src/components/markdown-blocks.ts +198 -0
- package/src/components/markdown-inline.tsx +365 -0
- package/src/components/markdown.tsx +6 -472
- package/src/components/observer-registry.ts +139 -0
- package/src/components/overflow-measure.ts +69 -0
- package/src/components/page-fill.tsx +1 -1
- package/src/components/prose-regions.ts +153 -0
- package/src/components/radio-group.tsx +1 -1
- package/src/components/scroll-region.tsx +22 -361
- package/src/components/tab-stop-parse.ts +217 -0
- package/src/components/table.tsx +1 -1
- package/src/components/tags.tsx +2 -2
- package/src/components/templated-text-field.tsx +39 -332
- package/src/components/templated-text-kwargs-editor.tsx +147 -0
- package/src/components/templated-text-kwargs.ts +92 -0
- package/src/components/templated-text-source.tsx +226 -0
- package/src/components/tool-picker-parts.tsx +184 -0
- package/src/components/tool-picker.tsx +22 -114
- package/src/components/version-history-panel.tsx +39 -143
- package/src/components/version-history-rows.tsx +220 -0
- package/src/components/view-toggle.tsx +1 -1
- package/src/element-slot.ts +1 -1
- package/src/guards.ts +7 -0
- package/src/hooks/interactions-connection.ts +227 -0
- package/src/hooks/interactions-stream.ts +274 -0
- package/src/hooks/useApi.ts +1 -1
- package/src/hooks/useAuth.ts +1 -1
- package/src/hooks/useCapabilities.ts +3 -3
- package/src/hooks/useSse.ts +51 -478
- package/src/hooks/useSystemKinds.tsx +2 -2
- package/src/hooks/useTheme.ts +1 -1
- package/src/hooks/useToolDisplayNames.tsx +2 -2
- package/src/host.ts +7 -7
- package/src/index.ts +292 -292
- package/src/navigation/app-link.tsx +70 -0
- package/src/navigation/context.tsx +12 -331
- package/src/navigation/entry-state.ts +42 -0
- package/src/navigation/guard-registry.ts +65 -0
- package/src/navigation/guarded-navigation.ts +147 -0
- package/src/navigation/index.ts +14 -14
- package/src/navigation/types.ts +8 -11
- package/src/navigation/use-back-forward-guard.ts +90 -0
- package/src/navigation/use-search-commit.ts +1 -1
- package/src/plugin/host-state.ts +1 -1
- package/src/plugin/registry.ts +111 -90
- package/src/schema-editor/SchemaEditor.tsx +1 -1
- package/src/schema-editor/index.ts +3 -3
- package/src/schema-form/SecretRefField.tsx +122 -72
- package/src/schema-form/classify.ts +245 -396
- package/src/schema-form/context.ts +1 -1
- package/src/schema-form/default-value.ts +48 -17
- package/src/schema-form/enum-field.tsx +1 -1
- package/src/schema-form/field-group.tsx +1 -1
- package/src/schema-form/field-model.ts +133 -0
- package/src/schema-form/field-node.tsx +95 -39
- package/src/schema-form/index.ts +10 -10
- package/src/schema-form/json-field.tsx +1 -1
- package/src/schema-form/media-field.tsx +136 -67
- package/src/schema-form/record-field.tsx +2 -2
- package/src/schema-form/string-annotations.ts +111 -0
- package/src/schema-form/string-field.tsx +2 -2
- package/src/schema-form/union-field.tsx +3 -2
- package/src/schema-form/union.ts +1 -1
- package/src/schema-form/validate.ts +185 -104
- package/src/state-binding/AdapterMapping.tsx +0 -0
- package/src/state-binding/BindingJqField.tsx +3 -3
- package/src/state-binding/InputInjectionRow.tsx +4 -4
- package/src/state-binding/StateAttachRow.tsx +229 -154
- package/src/state-binding/StateBindingSection.tsx +1 -1
- package/src/state-binding/SubjectScopeFields.tsx +1 -1
- package/src/state-binding/UpdateRow.tsx +3 -3
- package/src/state-binding/adapter-mapping-row.tsx +232 -0
- package/src/state-binding/index.ts +43 -43
- package/src/state-binding/templated-text-catalog.ts +0 -1
- package/src/state-binding/types.ts +2 -2
- package/src/structured-output/StructuredOutput.tsx +1 -4
- package/dist/components/icons.d.ts +0 -160
- package/dist/components/icons.d.ts.map +0 -1
- package/dist/components/icons.js +0 -160
- package/dist/components/icons.js.map +0 -1
- package/src/components/icons.tsx +0 -586
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The low-level parsing behind `tabStopsIn`: balanced-bracket and value scanning,
|
|
3
|
+
* a tag's attribute value, the binding/import RESOLVER (name → its home file and
|
|
4
|
+
* definition, expanded across hops), and the two per-tag predicates —
|
|
5
|
+
* `tagDeclaresTab` (is this a tab stop?) and `taiClassesOf` (which `tai-*` classes
|
|
6
|
+
* does it wear?).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The text from `start` to the character closing the bracket it opens, quotes
|
|
11
|
+
* respected so a brace inside a string neither opens nor closes anything.
|
|
12
|
+
*/
|
|
13
|
+
export function balancedFrom(source: string, start: number, open: string, close: string): string {
|
|
14
|
+
let depth = 0;
|
|
15
|
+
let quote: string | undefined;
|
|
16
|
+
for (let index = start; index < source.length; index += 1) {
|
|
17
|
+
const character = source[index];
|
|
18
|
+
if (quote !== undefined) {
|
|
19
|
+
if (character === '\\') {
|
|
20
|
+
index += 1;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (character === quote) quote = undefined;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (character === '"' || character === "'" || character === '`') {
|
|
27
|
+
quote = character;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (character === open) depth += 1;
|
|
31
|
+
else if (character === close) {
|
|
32
|
+
depth -= 1;
|
|
33
|
+
if (depth === 0) return source.slice(start, index + 1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return source.slice(start);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The RHS of a `const`/`let` assignment beginning at `start`: text up to the
|
|
41
|
+
* top-level `;`, with brackets and quotes tracked so a `;` inside either does not
|
|
42
|
+
* end it.
|
|
43
|
+
*/
|
|
44
|
+
const QUOTE_CHARS = '"\'`';
|
|
45
|
+
const OPEN_BRACKETS = '{([';
|
|
46
|
+
const CLOSE_BRACKETS = '})]';
|
|
47
|
+
|
|
48
|
+
export function readAssignmentValue(source: string, start: number): string {
|
|
49
|
+
let end = start;
|
|
50
|
+
let depth = 0;
|
|
51
|
+
let quote: string | undefined;
|
|
52
|
+
for (; end < source.length; end += 1) {
|
|
53
|
+
const character = source[end] ?? '';
|
|
54
|
+
if (quote !== undefined) {
|
|
55
|
+
if (character === '\\') end += 1;
|
|
56
|
+
else if (character === quote) quote = undefined;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (QUOTE_CHARS.includes(character)) quote = character;
|
|
60
|
+
else if (OPEN_BRACKETS.includes(character)) depth += 1;
|
|
61
|
+
else if (CLOSE_BRACKETS.includes(character)) depth -= 1;
|
|
62
|
+
else if (character === ';' && depth === 0) break;
|
|
63
|
+
}
|
|
64
|
+
return source.slice(start, end);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The index of the `>` closing an opening tag whose attribute run starts at
|
|
69
|
+
* `from`, quotes and brace depth tracked so a `>` inside a `className` expression
|
|
70
|
+
* (`{x > 0 ? a : b}`) is not mistaken for it.
|
|
71
|
+
*/
|
|
72
|
+
export function scanToTagClose(source: string, from: number): number {
|
|
73
|
+
let end = from;
|
|
74
|
+
let depth = 0;
|
|
75
|
+
let quote: string | undefined;
|
|
76
|
+
for (; end < source.length; end += 1) {
|
|
77
|
+
const character = source[end];
|
|
78
|
+
if (quote !== undefined) {
|
|
79
|
+
if (character === '\\') end += 1;
|
|
80
|
+
else if (character === quote) quote = undefined;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (character === '"' || character === "'" || character === '`') quote = character;
|
|
84
|
+
else if (character === '{') depth += 1;
|
|
85
|
+
else if (character === '}') depth -= 1;
|
|
86
|
+
else if (character === '>' && depth === 0) break;
|
|
87
|
+
}
|
|
88
|
+
return end;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** One opening JSX tag: its element name and everything between that and the `>`. */
|
|
92
|
+
export interface OpeningTag {
|
|
93
|
+
readonly name: string;
|
|
94
|
+
readonly attributes: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The value written for `attribute`, unquoted or unbraced; `undefined` when the
|
|
99
|
+
* tag does not write it at all, which is the difference between "no `tabIndex`"
|
|
100
|
+
* and "`tabIndex={-1}`".
|
|
101
|
+
*/
|
|
102
|
+
export function attributeValue(attributes: string, attribute: string): string | undefined {
|
|
103
|
+
const written = new RegExp(String.raw`(?<![\w-])${attribute}\s*=`).exec(attributes);
|
|
104
|
+
if (written === null) return undefined;
|
|
105
|
+
let index = written.index + written[0].length;
|
|
106
|
+
while (/\s/.test(attributes[index] ?? '')) index += 1;
|
|
107
|
+
const opener = attributes[index];
|
|
108
|
+
if (opener === '"' || opener === "'") {
|
|
109
|
+
const close = attributes.indexOf(opener, index + 1);
|
|
110
|
+
return attributes.slice(index + 1, close === -1 ? attributes.length : close);
|
|
111
|
+
}
|
|
112
|
+
if (opener === '{') return balancedFrom(attributes, index, '{', '}').slice(1, -1);
|
|
113
|
+
return '';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** The elements that are in the tab order with no `tabIndex` of their own. */
|
|
117
|
+
const NATIVELY_FOCUSABLE = new Set(['button', 'a', 'input', 'textarea', 'select', 'summary']);
|
|
118
|
+
|
|
119
|
+
/** A `tabIndex` that takes the element OUT of the tab order. */
|
|
120
|
+
const NEGATIVE_TAB_INDEX = /^\s*-/;
|
|
121
|
+
|
|
122
|
+
/** A props object that puts its target in the tab order. */
|
|
123
|
+
const SPREADS_TAB_INDEX = /tabIndex\s*:\s*(?!\s*-)/;
|
|
124
|
+
|
|
125
|
+
/** Resolves a referenced name to the file it is bound in and its definition text. */
|
|
126
|
+
export interface TabStopResolver {
|
|
127
|
+
/** Where a name is bound: the file itself, or the file it is imported from. */
|
|
128
|
+
homeOf(file: string, name: string): string | undefined;
|
|
129
|
+
/** The definition text of `name` bound in `home`, if any. */
|
|
130
|
+
definitionOf(home: string, name: string): string | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* `text` with the definition of every name it references appended, to `depth`
|
|
133
|
+
* hops — a class reaches its element through as many as three (the tag names a
|
|
134
|
+
* helper, the helper names a table, the table holds the literal).
|
|
135
|
+
*/
|
|
136
|
+
expand(text: string, file: string, depth: number, seen: Set<string>): string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** A resolver over pre-scanned per-file binding and import maps. */
|
|
140
|
+
export function createTabStopResolver(
|
|
141
|
+
bindings: ReadonlyMap<string, Map<string, string>>,
|
|
142
|
+
imports: ReadonlyMap<string, Map<string, string>>,
|
|
143
|
+
): TabStopResolver {
|
|
144
|
+
function homeOf(file: string, name: string): string | undefined {
|
|
145
|
+
if (bindings.get(file)?.has(name) === true) return file;
|
|
146
|
+
return imports.get(file)?.get(name);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function definitionOf(home: string, name: string): string | undefined {
|
|
150
|
+
return bindings.get(home)?.get(name);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function expand(text: string, file: string, depth: number, seen: Set<string>): string {
|
|
154
|
+
if (depth === 0) return text;
|
|
155
|
+
let out = text;
|
|
156
|
+
for (const match of text.matchAll(/(?<![\w.$])([A-Za-z_$][\w$]*)/g)) {
|
|
157
|
+
const name = match[1] ?? '';
|
|
158
|
+
const home = homeOf(file, name);
|
|
159
|
+
if (home === undefined) continue;
|
|
160
|
+
const key = `${home}#${name}`;
|
|
161
|
+
if (seen.has(key)) continue;
|
|
162
|
+
seen.add(key);
|
|
163
|
+
const definition = definitionOf(home, name);
|
|
164
|
+
if (definition !== undefined) out += `\n${expand(definition, home, depth - 1, seen)}`;
|
|
165
|
+
}
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return { homeOf, definitionOf, expand };
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Whether a spread props object on the tag declares a non-negative `tabIndex`. */
|
|
173
|
+
function spreadDeclaresTab(tag: OpeningTag, file: string, resolver: TabStopResolver): boolean {
|
|
174
|
+
for (const spread of tag.attributes.matchAll(/\{\s*\.\.\.\s*([A-Za-z_$][\w$]*)/g)) {
|
|
175
|
+
const home = resolver.homeOf(file, spread[1] ?? '');
|
|
176
|
+
if (home === undefined) continue;
|
|
177
|
+
const definition = resolver.definitionOf(home, spread[1] ?? '');
|
|
178
|
+
if (
|
|
179
|
+
definition !== undefined &&
|
|
180
|
+
SPREADS_TAB_INDEX.test(resolver.expand(definition, home, 2, new Set()))
|
|
181
|
+
) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Whether the tag is a keyboard tab stop: a natively focusable element, an element
|
|
190
|
+
* with a non-negative `tabIndex`, or one spreading a props object that declares one.
|
|
191
|
+
*/
|
|
192
|
+
export function tagDeclaresTab(tag: OpeningTag, file: string, resolver: TabStopResolver): boolean {
|
|
193
|
+
const native =
|
|
194
|
+
NATIVELY_FOCUSABLE.has(tag.name) &&
|
|
195
|
+
(tag.name !== 'a' || /(?<![\w-])href\s*=/.test(tag.attributes));
|
|
196
|
+
if (native) return true;
|
|
197
|
+
const written = attributeValue(tag.attributes, 'tabIndex');
|
|
198
|
+
if (written !== undefined && !NEGATIVE_TAB_INDEX.test(written)) return true;
|
|
199
|
+
return spreadDeclaresTab(tag, file, resolver);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** The `tai-*` classes the tag wears, expanded through its bindings to `depth` 3. */
|
|
203
|
+
export function taiClassesOf(tag: OpeningTag, file: string, resolver: TabStopResolver): string[] {
|
|
204
|
+
const className = attributeValue(tag.attributes, 'className');
|
|
205
|
+
if (className === undefined) return [];
|
|
206
|
+
return [
|
|
207
|
+
...new Set(
|
|
208
|
+
[
|
|
209
|
+
...resolver
|
|
210
|
+
.expand(className, file, 3, new Set())
|
|
211
|
+
.matchAll(/(?<![\w-])(tai-[a-z][\w-]*)(?![\w])/g),
|
|
212
|
+
]
|
|
213
|
+
.map((match) => `.${match[1] ?? ''}`)
|
|
214
|
+
.filter((name) => !name.endsWith('-')),
|
|
215
|
+
),
|
|
216
|
+
];
|
|
217
|
+
}
|
package/src/components/table.tsx
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* so a caller that has to measure or scroll a cell is not forced back to a raw
|
|
14
14
|
* `<td>` and out of the system.
|
|
15
15
|
*/
|
|
16
|
-
import type { HTMLAttributes,
|
|
16
|
+
import type { HTMLAttributes, ReactNode, Ref, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
17
17
|
|
|
18
18
|
export interface TableProps extends HTMLAttributes<HTMLTableElement> {
|
|
19
19
|
readonly children?: ReactNode;
|
package/src/components/tags.tsx
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
* version-history panel's per-version tag editor) needs the same control; a single
|
|
12
12
|
* canonical copy keeps the affordance identical everywhere.
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { type CSSProperties, type ReactNode, useState } from 'react';
|
|
15
15
|
|
|
16
16
|
import { CloseIcon } from './icons';
|
|
17
|
-
import { Button } from './primitives';
|
|
18
17
|
import { TextInput } from './inputs';
|
|
18
|
+
import { Button } from './primitives';
|
|
19
19
|
|
|
20
20
|
/** A tag and its remove control read as one unit, tighter than the row default. */
|
|
21
21
|
const tagGroupStyle: CSSProperties = { gap: 'var(--tai-space-1)' };
|
|
@@ -24,16 +24,19 @@
|
|
|
24
24
|
* its kwargs, never converted or dropped. See `storageAbsent` /
|
|
25
25
|
* `storagePresenceLoading`.
|
|
26
26
|
*/
|
|
27
|
-
import { useState, type ReactNode } from 'react';
|
|
28
|
-
|
|
29
27
|
import type { TemplatedText } from '@tai42/api-client';
|
|
28
|
+
import { type ReactNode, useState } from 'react';
|
|
30
29
|
|
|
31
|
-
import { Button, ErrorState, Skeleton } from './primitives';
|
|
32
30
|
import { Field } from './field';
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
import {
|
|
32
|
+
initialMode,
|
|
33
|
+
type KwargRow,
|
|
34
|
+
type Mode,
|
|
35
|
+
objectToRows,
|
|
36
|
+
templatedValueFrom,
|
|
37
|
+
} from './templated-text-kwargs';
|
|
38
|
+
import { KwargsEditor, ReadOnlyKwargs } from './templated-text-kwargs-editor';
|
|
39
|
+
import { TemplatedTextSource } from './templated-text-source';
|
|
37
40
|
|
|
38
41
|
/** One stored template the id picker offers. */
|
|
39
42
|
export interface TemplatedTextTemplateOption {
|
|
@@ -111,170 +114,6 @@ export function templatedTextSummary(value: TemplatedText | null): string {
|
|
|
111
114
|
return value.content ?? '';
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
type Mode = 'inline' | 'stored';
|
|
115
|
-
|
|
116
|
-
interface KwargRow {
|
|
117
|
-
readonly key: string;
|
|
118
|
-
readonly value: string;
|
|
119
|
-
/**
|
|
120
|
-
* The stored value this row was seeded from, kept so an UNTOUCHED row re-emits it
|
|
121
|
-
* BYTE-FOR-BYTE: the row form cannot tell a stored string `"7"` from the number `7`,
|
|
122
|
-
* so re-parsing an untouched row would silently coerce the stored type. `undefined`
|
|
123
|
-
* for a row the author added.
|
|
124
|
-
*/
|
|
125
|
-
readonly original?: unknown;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/** The row's canonical string form, matched against `value` to detect an untouched row. */
|
|
129
|
-
function stringifyRowValue(raw: unknown): string {
|
|
130
|
-
return typeof raw === 'string' ? raw : JSON.stringify(raw);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** Parse a cell as JSON when it can be (numbers/bools/objects), else keep the string. */
|
|
134
|
-
function parseCellValue(raw: string): unknown {
|
|
135
|
-
const trimmed = raw.trim();
|
|
136
|
-
if (trimmed.length === 0) return '';
|
|
137
|
-
try {
|
|
138
|
-
return JSON.parse(trimmed);
|
|
139
|
-
} catch {
|
|
140
|
-
return raw;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/** Collapse the kwargs rows into an object, dropping rows with a blank key. */
|
|
145
|
-
function rowsToObject(rows: readonly KwargRow[]): Record<string, unknown> {
|
|
146
|
-
const out: Record<string, unknown> = {};
|
|
147
|
-
for (const row of rows) {
|
|
148
|
-
const key = row.key.trim();
|
|
149
|
-
if (key.length === 0) continue;
|
|
150
|
-
// An untouched seeded row re-emits its stored value verbatim (no JSON-type coerce);
|
|
151
|
-
// an edited or added row is parsed from the cell text.
|
|
152
|
-
out[key] =
|
|
153
|
-
row.original !== undefined && stringifyRowValue(row.original) === row.value
|
|
154
|
-
? row.original
|
|
155
|
-
: parseCellValue(row.value);
|
|
156
|
-
}
|
|
157
|
-
return out;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/** Seed rows from a stored kwargs object (stringifying non-string values). */
|
|
161
|
-
function objectToRows(kwargs: Record<string, unknown> | undefined): KwargRow[] {
|
|
162
|
-
if (kwargs === undefined) return [];
|
|
163
|
-
return Object.entries(kwargs).map(([key, raw]) => ({
|
|
164
|
-
key,
|
|
165
|
-
value: stringifyRowValue(raw),
|
|
166
|
-
original: raw,
|
|
167
|
-
}));
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/** The add/remove kwargs editor, revealed on demand and open when kwargs already exist. */
|
|
171
|
-
function KwargsEditor({
|
|
172
|
-
label,
|
|
173
|
-
rows,
|
|
174
|
-
disabled,
|
|
175
|
-
onChange,
|
|
176
|
-
}: {
|
|
177
|
-
readonly label: string;
|
|
178
|
-
readonly rows: readonly KwargRow[];
|
|
179
|
-
readonly disabled: boolean;
|
|
180
|
-
readonly onChange: (rows: KwargRow[]) => void;
|
|
181
|
-
}): ReactNode {
|
|
182
|
-
const [open, setOpen] = useState(rows.length > 0);
|
|
183
|
-
const groupLabel = `${label} render parameters`;
|
|
184
|
-
|
|
185
|
-
if (!open) {
|
|
186
|
-
// Wrapped so the ghost button keeps its content width and stays left-aligned
|
|
187
|
-
// in the field's column, marking it as this field's own disclosure rather than
|
|
188
|
-
// a full-width control floating between two fields.
|
|
189
|
-
return (
|
|
190
|
-
<div>
|
|
191
|
-
<Button
|
|
192
|
-
type="button"
|
|
193
|
-
variant="ghost"
|
|
194
|
-
disabled={disabled}
|
|
195
|
-
onClick={() => {
|
|
196
|
-
setOpen(true);
|
|
197
|
-
onChange([...rows, { key: '', value: '' }]);
|
|
198
|
-
}}
|
|
199
|
-
>
|
|
200
|
-
Add render parameters
|
|
201
|
-
</Button>
|
|
202
|
-
</div>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return (
|
|
207
|
-
<div
|
|
208
|
-
role="group"
|
|
209
|
-
aria-label={groupLabel}
|
|
210
|
-
style={{ display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-2)' }}
|
|
211
|
-
>
|
|
212
|
-
<span style={{ fontSize: 'var(--tai-text-sm)', color: 'var(--tai-color-text-muted)' }}>
|
|
213
|
-
Render parameters
|
|
214
|
-
</span>
|
|
215
|
-
{rows.map((row, index) => (
|
|
216
|
-
<div
|
|
217
|
-
key={index}
|
|
218
|
-
style={{ display: 'flex', gap: 'var(--tai-space-2)', alignItems: 'center' }}
|
|
219
|
-
>
|
|
220
|
-
<TextInput
|
|
221
|
-
aria-label={`${groupLabel} key ${String(index + 1)}`}
|
|
222
|
-
placeholder="name"
|
|
223
|
-
value={row.key}
|
|
224
|
-
autoComplete="off"
|
|
225
|
-
disabled={disabled}
|
|
226
|
-
onChange={(event) => {
|
|
227
|
-
const next = [...rows];
|
|
228
|
-
next[index] = { ...row, key: event.target.value };
|
|
229
|
-
onChange(next);
|
|
230
|
-
}}
|
|
231
|
-
/>
|
|
232
|
-
<TextInput
|
|
233
|
-
aria-label={`${groupLabel} value ${String(index + 1)}`}
|
|
234
|
-
placeholder="value"
|
|
235
|
-
value={row.value}
|
|
236
|
-
autoComplete="off"
|
|
237
|
-
disabled={disabled}
|
|
238
|
-
onChange={(event) => {
|
|
239
|
-
const next = [...rows];
|
|
240
|
-
next[index] = { ...row, value: event.target.value };
|
|
241
|
-
onChange(next);
|
|
242
|
-
}}
|
|
243
|
-
/>
|
|
244
|
-
<Button
|
|
245
|
-
type="button"
|
|
246
|
-
variant="ghost"
|
|
247
|
-
aria-label={`Remove ${groupLabel} ${String(index + 1)}`}
|
|
248
|
-
disabled={disabled}
|
|
249
|
-
onClick={() => {
|
|
250
|
-
onChange(rows.filter((_, position) => position !== index));
|
|
251
|
-
}}
|
|
252
|
-
>
|
|
253
|
-
<CloseIcon aria-hidden="true" />
|
|
254
|
-
</Button>
|
|
255
|
-
</div>
|
|
256
|
-
))}
|
|
257
|
-
<div>
|
|
258
|
-
<Button
|
|
259
|
-
type="button"
|
|
260
|
-
variant="ghost"
|
|
261
|
-
disabled={disabled}
|
|
262
|
-
onClick={() => {
|
|
263
|
-
onChange([...rows, { key: '', value: '' }]);
|
|
264
|
-
}}
|
|
265
|
-
>
|
|
266
|
-
Add parameter
|
|
267
|
-
</Button>
|
|
268
|
-
</div>
|
|
269
|
-
</div>
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/** The initial mode: stored when the seed carries an `id`, inline otherwise. */
|
|
274
|
-
function initialMode(value: TemplatedText | null): Mode {
|
|
275
|
-
return value?.id !== undefined ? 'stored' : 'inline';
|
|
276
|
-
}
|
|
277
|
-
|
|
278
117
|
export function TemplatedTextField({
|
|
279
118
|
label,
|
|
280
119
|
value,
|
|
@@ -304,22 +143,7 @@ export function TemplatedTextField({
|
|
|
304
143
|
nextStored: string,
|
|
305
144
|
nextKwargs: readonly KwargRow[],
|
|
306
145
|
): void => {
|
|
307
|
-
|
|
308
|
-
const kw = Object.keys(kwargs).length > 0 ? { kwargs } : {};
|
|
309
|
-
if (nextMode === 'stored') {
|
|
310
|
-
const id = nextStored.trim();
|
|
311
|
-
if (id === '') {
|
|
312
|
-
onChange(required ? { id: '', ...kw } : null);
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
onChange({ id, ...kw });
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (nextInline.trim() === '') {
|
|
319
|
-
onChange(required ? { content: '', ...kw } : null);
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
onChange({ content: nextInline, ...kw });
|
|
146
|
+
onChange(templatedValueFrom(nextMode, nextInline, nextStored, nextKwargs, required));
|
|
323
147
|
};
|
|
324
148
|
|
|
325
149
|
const changeMode = (next: Mode): void => {
|
|
@@ -342,125 +166,33 @@ export function TemplatedTextField({
|
|
|
342
166
|
emit(mode, inlineDraft, storedDraft, next);
|
|
343
167
|
};
|
|
344
168
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
onChange={(event) => {
|
|
373
|
-
changeInline(event.target.value);
|
|
374
|
-
}}
|
|
375
|
-
/>
|
|
376
|
-
</Field>
|
|
377
|
-
);
|
|
378
|
-
|
|
379
|
-
// A stored `id` already authored on the value: with storage absent it is shown
|
|
380
|
-
// read-only rather than resolved, browsed, converted, or dropped.
|
|
381
|
-
const authoredStoredId = value?.id;
|
|
382
|
-
const showsReadOnlyStored = storageAbsent && authoredStoredId !== undefined;
|
|
383
|
-
|
|
384
|
-
// The source region. While presence is unknown a placeholder stands in, so the
|
|
385
|
-
// toggle is never shown and then removed. With storage absent the stored source
|
|
386
|
-
// cannot work and is not offered: an inline or empty value edits inline; a value
|
|
387
|
-
// carrying an `id` is shown read-only with an unavailability note. With storage
|
|
388
|
-
// present the full inline/stored toggle and picker render.
|
|
389
|
-
let source: ReactNode;
|
|
390
|
-
if (storagePresenceLoading) {
|
|
391
|
-
source = <Skeleton height={36} />;
|
|
392
|
-
} else if (storageAbsent) {
|
|
393
|
-
source = showsReadOnlyStored ? (
|
|
394
|
-
<>
|
|
395
|
-
{/* A labeled read-only reference, NOT an editable field: no input box, a
|
|
396
|
-
"Stored template" caption, and the id in monospace — so it reads as a stored
|
|
397
|
-
reference the way the state-template screen shows one, never as literal text a
|
|
398
|
-
reader could mistake for the condition itself. A long id wraps rather than
|
|
399
|
-
overflowing its row. */}
|
|
400
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-1)' }}>
|
|
401
|
-
<span style={{ fontSize: 'var(--tai-text-sm)', color: 'var(--tai-color-text-muted)' }}>
|
|
402
|
-
Stored template
|
|
403
|
-
</span>
|
|
404
|
-
<code style={{ fontFamily: 'var(--tai-font-mono)', wordBreak: 'break-all' }}>
|
|
405
|
-
{authoredStoredId}
|
|
406
|
-
</code>
|
|
407
|
-
</div>
|
|
408
|
-
<p
|
|
409
|
-
style={{
|
|
410
|
-
margin: 0,
|
|
411
|
-
fontSize: 'var(--tai-text-sm)',
|
|
412
|
-
color: 'var(--tai-color-text-muted)',
|
|
413
|
-
}}
|
|
414
|
-
>
|
|
415
|
-
Stored templates are unavailable — this deployment has no storage backend.
|
|
416
|
-
</p>
|
|
417
|
-
</>
|
|
418
|
-
) : (
|
|
419
|
-
inlineEditor
|
|
420
|
-
);
|
|
421
|
-
} else {
|
|
422
|
-
source = (
|
|
423
|
-
<>
|
|
424
|
-
<RadioGroup
|
|
425
|
-
aria-label={`${label} source`}
|
|
426
|
-
variant="segmented"
|
|
427
|
-
value={mode}
|
|
428
|
-
disabled={disabled}
|
|
429
|
-
options={[
|
|
430
|
-
{ value: 'inline', label: 'Inline text' },
|
|
431
|
-
{ value: 'stored', label: 'Stored template' },
|
|
432
|
-
]}
|
|
433
|
-
onValueChange={(next) => {
|
|
434
|
-
changeMode(next as Mode);
|
|
435
|
-
}}
|
|
436
|
-
/>
|
|
437
|
-
|
|
438
|
-
{mode === 'inline' ? (
|
|
439
|
-
inlineEditor
|
|
440
|
-
) : templatesError !== undefined ? (
|
|
441
|
-
<ErrorState message={templatesError} onRetry={onTemplatesRetry} />
|
|
442
|
-
) : templatesLoading ? (
|
|
443
|
-
<Skeleton height={36} />
|
|
444
|
-
) : (
|
|
445
|
-
<Field label={label} hideLabel error={error}>
|
|
446
|
-
<Select
|
|
447
|
-
placeholder={templates.length === 0 ? 'No templates available' : 'Select a template'}
|
|
448
|
-
value={storedDraft}
|
|
449
|
-
disabled={disabled || templates.length === 0}
|
|
450
|
-
options={templateOptions}
|
|
451
|
-
onValueChange={changeStored}
|
|
452
|
-
/>
|
|
453
|
-
</Field>
|
|
454
|
-
)}
|
|
455
|
-
|
|
456
|
-
{unresolvedId !== undefined ? (
|
|
457
|
-
<p role="alert" style={{ margin: 0, color: 'var(--tai-color-err-text)' }}>
|
|
458
|
-
{resolveError ?? `The stored template "${unresolvedId}" is not available.`}
|
|
459
|
-
</p>
|
|
460
|
-
) : null}
|
|
461
|
-
</>
|
|
462
|
-
);
|
|
463
|
-
}
|
|
169
|
+
// A stored `id` already authored on the value is shown read-only when storage is
|
|
170
|
+
// absent — never resolved, browsed, converted, or dropped.
|
|
171
|
+
const showsReadOnlyStored = storageAbsent && value?.id !== undefined;
|
|
172
|
+
|
|
173
|
+
const source = (
|
|
174
|
+
<TemplatedTextSource
|
|
175
|
+
label={label}
|
|
176
|
+
mode={mode}
|
|
177
|
+
inlineDraft={inlineDraft}
|
|
178
|
+
storedDraft={storedDraft}
|
|
179
|
+
error={error}
|
|
180
|
+
disabled={disabled}
|
|
181
|
+
placeholder={placeholder}
|
|
182
|
+
renderInline={renderInline}
|
|
183
|
+
templates={templates}
|
|
184
|
+
templatesLoading={templatesLoading}
|
|
185
|
+
templatesError={templatesError}
|
|
186
|
+
onTemplatesRetry={onTemplatesRetry}
|
|
187
|
+
resolveError={resolveError}
|
|
188
|
+
storageAbsent={storageAbsent}
|
|
189
|
+
storagePresenceLoading={storagePresenceLoading}
|
|
190
|
+
authoredStoredId={value?.id}
|
|
191
|
+
onModeChange={changeMode}
|
|
192
|
+
onInlineChange={changeInline}
|
|
193
|
+
onStoredChange={changeStored}
|
|
194
|
+
/>
|
|
195
|
+
);
|
|
464
196
|
|
|
465
197
|
// ONE coherent group per field: the label + description form the group header, and
|
|
466
198
|
// the source region and the render-parameters disclosure sit under it — so the
|
|
@@ -470,36 +202,11 @@ export function TemplatedTextField({
|
|
|
470
202
|
// visually-hidden `<label for>` (see `hideLabel`). The container-name redundancy
|
|
471
203
|
// `Field` accepts by design (a redundant container is audible, an unnamed group is
|
|
472
204
|
// silent).
|
|
473
|
-
//
|
|
474
|
-
// A read-only stored value shows its render parameters as read-only text — the values
|
|
475
|
-
// in normal weight, NOT the muted disabled inputs a reader could mistake for empty
|
|
476
|
-
// placeholders — matching the read-only treatment of the id above; every editable
|
|
477
|
-
// rendering keeps the full add/remove editor.
|
|
478
205
|
return (
|
|
479
206
|
<Field label={label} description={description} group>
|
|
480
207
|
{source}
|
|
481
208
|
{showsReadOnlyStored ? (
|
|
482
|
-
|
|
483
|
-
<div
|
|
484
|
-
role="group"
|
|
485
|
-
aria-label={`${label} render parameters`}
|
|
486
|
-
style={{ display: 'flex', flexDirection: 'column', gap: 'var(--tai-space-1)' }}
|
|
487
|
-
>
|
|
488
|
-
<span style={{ fontSize: 'var(--tai-text-sm)', color: 'var(--tai-color-text-muted)' }}>
|
|
489
|
-
Render parameters
|
|
490
|
-
</span>
|
|
491
|
-
{kwargsRows.map((row) => (
|
|
492
|
-
<div
|
|
493
|
-
key={row.key}
|
|
494
|
-
style={{ fontFamily: 'var(--tai-font-mono)', wordBreak: 'break-all' }}
|
|
495
|
-
>
|
|
496
|
-
<code>{row.key}</code>
|
|
497
|
-
<span style={{ color: 'var(--tai-color-text-muted)' }}>: </span>
|
|
498
|
-
<code>{row.value}</code>
|
|
499
|
-
</div>
|
|
500
|
-
))}
|
|
501
|
-
</div>
|
|
502
|
-
) : null
|
|
209
|
+
<ReadOnlyKwargs label={label} rows={kwargsRows} />
|
|
503
210
|
) : (
|
|
504
211
|
<KwargsEditor label={label} rows={kwargsRows} disabled={disabled} onChange={changeKwargs} />
|
|
505
212
|
)}
|