@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
package/dist/index.js
CHANGED
|
@@ -38,98 +38,85 @@
|
|
|
38
38
|
import './components/tokens.css';
|
|
39
39
|
import './components/fonts.css';
|
|
40
40
|
import './components/components.css';
|
|
41
|
-
export {
|
|
42
|
-
// -- Hooks -------------------------------------------------------------------
|
|
41
|
+
export { checkPluginApiVersion, STUDIO_PLUGIN_API_VERSION } from './plugin/version';
|
|
43
42
|
export { ApiProvider, useApi } from './hooks/useApi';
|
|
44
|
-
export { UnauthorizedProvider, useOnUnauthorized } from './hooks/useUnauthorized';
|
|
45
43
|
export { AuthProvider, useAuth } from './hooks/useAuth';
|
|
46
|
-
export { CapabilityProvider, useCapabilities, useCanWrite, isFullProjection, coversAnyRoute, coversRoute, coversWrite, } from './hooks/useCapabilities';
|
|
47
|
-
export { SystemKindsProvider, useSystemKinds, useFeatureOff, useFeatureOffMessage, } from './hooks/useSystemKinds';
|
|
48
|
-
export { ToolDisplayNamesProvider, useToolDisplayNames, useReloadToolDisplayNames, toolDisplayLabel, } from './hooks/useToolDisplayNames';
|
|
49
|
-
export { ThemeProvider, useTheme } from './hooks/useTheme';
|
|
50
44
|
export { useBreakpoint } from './hooks/useBreakpoint';
|
|
45
|
+
export { CapabilityProvider, coversAnyRoute, coversRoute, coversWrite, isFullProjection, useCanWrite, useCapabilities, } from './hooks/useCapabilities';
|
|
51
46
|
export { useInteractionsStream } from './hooks/useSse';
|
|
52
|
-
|
|
53
|
-
export {
|
|
47
|
+
export { SystemKindsProvider, useFeatureOff, useFeatureOffMessage, useSystemKinds, } from './hooks/useSystemKinds';
|
|
48
|
+
export { ThemeProvider, useTheme } from './hooks/useTheme';
|
|
49
|
+
export { toolDisplayLabel, ToolDisplayNamesProvider, useReloadToolDisplayNames, useToolDisplayNames, } from './hooks/useToolDisplayNames';
|
|
50
|
+
export { UnauthorizedProvider, useOnUnauthorized } from './hooks/useUnauthorized';
|
|
51
|
+
export { AppLink, NavigationProvider, useAppNavigate, useNavigationGate, useNavigationGuard, usePluginEntryNavigation, usePluginNavigation, useResolvePath, useSearchCommit, } from './navigation';
|
|
54
52
|
// -- Utilities ---------------------------------------------------------------
|
|
55
|
-
export { errorMessage } from './errors';
|
|
56
53
|
export { downloadBlob } from './download';
|
|
57
|
-
|
|
58
|
-
export {
|
|
54
|
+
export { errorMessage } from './errors';
|
|
55
|
+
export { FeatureDisabled, featureDisabledMessage, isFeatureDisabled } from './feature-disabled';
|
|
59
56
|
// -- Cross-feature query keys ------------------------------------------------
|
|
60
|
-
export {
|
|
57
|
+
export { extensionsQueryKey, statesListKey, stateTemplatesKey, subMcpKey, tokensPayloadKey, toolsListKey, } from './query-keys';
|
|
61
58
|
// -- Extension-combo editing helpers -----------------------------------------
|
|
62
59
|
export { comboElementNames, extensionElementName } from './extension-combos';
|
|
63
60
|
// -- Tool-visibility tri-state -----------------------------------------------
|
|
64
61
|
export { effectiveHidden, hiddenToolNames } from './tool-visibility';
|
|
65
62
|
// -- Tool declared-badge merge (native ∪ overlay) ----------------------------
|
|
66
63
|
export { mergeToolBadges, toolBadgesByName } from './tool-badges';
|
|
67
|
-
// -- Design system -----------------------------------------------------------
|
|
68
|
-
export { Button, Card, Skeleton, EmptyState, ErrorState, Spinner } from './components/primitives';
|
|
69
|
-
export { PageHeader, Page, Stack } from './components/page-header';
|
|
70
|
-
export { PageFillProvider, useFillViewport, usePageFillActive } from './components/page-fill';
|
|
71
|
-
export { ErrorBoundary } from './components/error-boundary';
|
|
72
|
-
export { Field, useFieldControl } from './components/field';
|
|
73
|
-
export { TextInput, Textarea, NumberInput } from './components/inputs';
|
|
74
|
-
export { Select } from './components/select';
|
|
75
|
-
export { Checkbox } from './components/checkbox';
|
|
76
|
-
export { RadioGroup } from './components/radio-group';
|
|
77
|
-
export { TemplatedTextField, templatedTextSummary } from './components/templated-text-field';
|
|
78
64
|
export { Badge } from './components/badge';
|
|
79
|
-
export {
|
|
80
|
-
export { Dialog } from './components/dialog';
|
|
65
|
+
export { Checkbox } from './components/checkbox';
|
|
81
66
|
export { ConfirmDialog } from './components/confirm-dialog';
|
|
82
|
-
export {
|
|
83
|
-
export {
|
|
67
|
+
export { Dialog } from './components/dialog';
|
|
68
|
+
export { DirtyGuardBoundary, GuardedTabs, useRegisterDirty } from './components/dirty-guard';
|
|
84
69
|
export { Drawer } from './components/drawer';
|
|
85
|
-
export {
|
|
86
|
-
export {
|
|
87
|
-
export {
|
|
70
|
+
export { EntityCardGrid } from './components/entity-card-grid';
|
|
71
|
+
export { ErrorBoundary } from './components/error-boundary';
|
|
72
|
+
export { buildTagVocabulary, ExplorerView, matchesSelectedTags, UNTAGGED_TOKEN, } from './components/explorer-view';
|
|
73
|
+
export { Field, useFieldControl } from './components/field';
|
|
74
|
+
export { FormDialog } from './components/form-dialog';
|
|
75
|
+
export { NumberInput, Textarea, TextInput } from './components/inputs';
|
|
76
|
+
export { diffJson, JsonDiff } from './components/json-diff';
|
|
88
77
|
export { JsonTree } from './components/json-tree';
|
|
89
|
-
export { JsonDiff, diffJson } from './components/json-diff';
|
|
90
|
-
export { TagChips, TagsInput } from './components/tags';
|
|
91
78
|
export { OverlayDetailsFields, overlayDetailsPatch } from './components/overlay-details-fields';
|
|
92
|
-
export {
|
|
93
|
-
export {
|
|
94
|
-
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
export {
|
|
98
|
-
export {
|
|
79
|
+
export { PageFillProvider, useFillViewport, usePageFillActive } from './components/page-fill';
|
|
80
|
+
export { Page, PageHeader, Stack } from './components/page-header';
|
|
81
|
+
export { Button, Card, EmptyState, ErrorState, Skeleton, Spinner } from './components/primitives';
|
|
82
|
+
export { RadioGroup } from './components/radio-group';
|
|
83
|
+
export { ScrollRegion, useOverflowRegion, useProseScrollRegions } from './components/scroll-region';
|
|
84
|
+
export { Select } from './components/select';
|
|
85
|
+
export { Table, TBody, TD, TH, THead, TR } from './components/table';
|
|
86
|
+
export { Tabs } from './components/tabs';
|
|
87
|
+
export { TagChips, TagsInput } from './components/tags';
|
|
88
|
+
export { TemplatedTextField, templatedTextSummary } from './components/templated-text-field';
|
|
89
|
+
export { Tooltip } from './components/tooltip';
|
|
90
|
+
export { useViewMode, ViewToggle } from './components/view-toggle';
|
|
99
91
|
export { CodeBlock } from './components/code-block';
|
|
100
|
-
export {
|
|
101
|
-
export { DateRangePicker, formatRangeLabel, normalizeCustomRange, DEFAULT_DATE_RANGE_PRESETS, } from './components/date-range-picker';
|
|
102
|
-
export { FleetReport } from './components/fleet-report';
|
|
92
|
+
export { DateRangePicker, DEFAULT_DATE_RANGE_PRESETS, formatRangeLabel, normalizeCustomRange, } from './components/date-range-picker';
|
|
103
93
|
export { ExternalLinkButton, isSafeHttpUrl } from './components/external-link';
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
export {
|
|
107
|
-
export {
|
|
108
|
-
export {
|
|
94
|
+
export { FleetReport } from './components/fleet-report';
|
|
95
|
+
export { childFolders, FolderBreadcrumb, folderPathTo, FolderPicker, FolderRow, } from './components/folder-nav';
|
|
96
|
+
export { Markdown, parseMarkdown } from './components/markdown';
|
|
97
|
+
export { openTargetProps } from './components/open-target';
|
|
98
|
+
export { CopyField } from './components/copy-field';
|
|
109
99
|
export { ExtensionComboBuilder } from './components/extension-combo-builder';
|
|
110
|
-
export { baseNameOf,
|
|
111
|
-
export {
|
|
100
|
+
export { baseNameOf, groupByKind, groupIntoFamilies, kindVariant, NON_STACKABLE_KIND, } from './components/extension-grouping';
|
|
101
|
+
export { ExtensionPicker } from './components/extension-picker';
|
|
102
|
+
export { safeHttpUrl } from './components/primitives';
|
|
112
103
|
export { RevealInput } from './components/reveal-input';
|
|
113
|
-
export { CopyField } from './components/copy-field';
|
|
114
104
|
export { TOKEN_NAMES } from './components/tokens';
|
|
115
|
-
|
|
116
|
-
export {
|
|
117
|
-
|
|
118
|
-
export {
|
|
105
|
+
export { BADGES_NOTE, ToolPicker } from './components/tool-picker';
|
|
106
|
+
export { VersionHistoryPanel } from './components/version-history-panel';
|
|
107
|
+
export { AgentsIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowUpIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, ConnectorsIcon, ConversationsIcon, CopyIcon, DashboardIcon, DatabaseIcon, EditIcon, ExtensionsIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FilterIcon, FolderIcon, GridIcon, HooksIcon, InteractionsIcon, ManifestIcon, MarketplaceIcon, MenuIcon, MinusIcon, MonitorIcon, MoonIcon, NAV_ICONS, NotificationsIcon, PendingIcon, PluginIcon, PlusIcon, PresetsIcon, SchedulingIcon, SearchIcon, ServedEndpointsIcon, SettingsIcon, SignOutIcon, SortAscIcon, SortDescIcon, StorageIcon, SunIcon, SystemIcon, TemplatesIcon, ToolsIcon, UnplugIcon, XCircleIcon, } from './components/icons';
|
|
108
|
+
export { defaultValueForSchema,
|
|
119
109
|
// The expression-door injection point: a host that wants `x-tai42-expression`
|
|
120
110
|
// fields to author through the visual editor imports `JqField` from
|
|
121
111
|
// `@tai42/jq-studio` and hands it to a form (the `expressionField` prop) or
|
|
122
112
|
// mounts this context above its tree. A form with no door renders those fields
|
|
123
113
|
// as plain string inputs and stays free of the jq subgraph — the editor, its
|
|
124
114
|
// worker, and its wasm — entirely.
|
|
125
|
-
ExpressionFieldContext,
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
// -- State-binding editor (the one binding shape every door + flow node authors) --
|
|
129
|
-
export { StateBindingEditor, StateBindingSection, StateAttachRow, InjectionList, UpdateList, AdapterMapping, SubjectScopeFields, BindingJqField, BindingTemplatedJqField, appendTjq, resolveTemplateJq, findByRef, resolveCallName, templatesCatalogFromList, statesCatalogFromList, fieldPathsFromSchema, compileAdapter, rowValueJq, fieldPathToJq, jqKey, defaultRowsForInput, parseAdapter, parseFieldPath, generateTemplateCall, parseTemplateCall, encodeTemplateSegment, templatedTextCatalog, } from './state-binding';
|
|
130
|
-
// -- MCP context widgets (elicitation / progress / completions / output) -----
|
|
131
|
-
export { ProgressBar } from './components/progress-bar';
|
|
115
|
+
ExpressionFieldContext, RecordEntryRendererContext, resolveRef, SchemaForm, SecretRefField, validateAgainstSchema, } from './schema-form';
|
|
116
|
+
export { lintSchemaText, SchemaEditor } from './schema-editor';
|
|
117
|
+
export { AdapterMapping, appendTjq, BindingJqField, BindingTemplatedJqField, compileAdapter, defaultRowsForInput, encodeTemplateSegment, fieldPathsFromSchema, fieldPathToJq, findByRef, generateTemplateCall, InjectionList, jqKey, parseAdapter, parseFieldPath, parseTemplateCall, resolveCallName, resolveTemplateJq, rowValueJq, StateAttachRow, StateBindingEditor, StateBindingSection, statesCatalogFromList, SubjectScopeFields, templatedTextCatalog, templatesCatalogFromList, UpdateList, } from './state-binding';
|
|
132
118
|
export { CompletionInput } from './components/completion-input';
|
|
119
|
+
export { ProgressBar } from './components/progress-bar';
|
|
133
120
|
export { ElicitationForm } from './elicitation/ElicitationForm';
|
|
134
121
|
export { StructuredOutput } from './structured-output/StructuredOutput';
|
|
135
122
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,kFAAkF;AAClF,+EAA+E;AAC/E,4EAA4E;AAC5E,iFAAiF;AACjF,iFAAiF;AACjF,+EAA+E;AAC/E,qEAAqE;AACrE,OAAO,yBAAyB,CAAC;AACjC,OAAO,wBAAwB,CAAC;AAChC,OAAO,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,kFAAkF;AAClF,+EAA+E;AAC/E,4EAA4E;AAC5E,iFAAiF;AACjF,iFAAiF;AACjF,+EAA+E;AAC/E,qEAAqE;AACrE,OAAO,yBAAyB,CAAC;AACjC,OAAO,wBAAwB,CAAC;AAChC,OAAO,6BAA6B,CAAC;AAsBrC,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAIpF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,cA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,EACd,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,UAAU,GACX,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `AppLink` — the SDK's route-token anchor: a real `<a>` whose plain left-click is
|
|
3
|
+
* intercepted for a client-side transition.
|
|
4
|
+
*/
|
|
5
|
+
import { type AriaAttributes, type CSSProperties, type ReactNode } from 'react';
|
|
6
|
+
import type { RouteSearch, RouteToken } from './types';
|
|
7
|
+
export interface AppLinkProps<T extends RouteToken> {
|
|
8
|
+
to: T;
|
|
9
|
+
search?: RouteSearch<T>;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
'aria-current'?: AriaAttributes['aria-current'];
|
|
14
|
+
/** Native tooltip text (also a sensible non-AT hover hint). */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Inline styles for the anchor. */
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A real anchor (so middle-click / open-in-new-tab keep working) that drives a
|
|
21
|
+
* client-side transition on plain left-click. Modified clicks (new tab/window,
|
|
22
|
+
* download) fall through to the browser's default handling.
|
|
23
|
+
*/
|
|
24
|
+
export declare function AppLink<T extends RouteToken>({ to, search, children, className, 'aria-label': ariaLabel, 'aria-current': ariaCurrent, title, style, }: AppLinkProps<T>): ReactNode;
|
|
25
|
+
//# sourceMappingURL=app-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-link.d.ts","sourceRoot":"","sources":["../../src/navigation/app-link.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,aAAa,EAElB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,UAAU;IAChD,EAAE,EAAE,CAAC,CAAC;IACN,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAChD,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,EAC5C,EAAE,EACF,MAAM,EACN,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,cAAc,EAAE,WAAW,EAC3B,KAAK,EACL,KAAK,GACN,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CA0B7B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `AppLink` — the SDK's route-token anchor: a real `<a>` whose plain left-click is
|
|
3
|
+
* intercepted for a client-side transition.
|
|
4
|
+
*/
|
|
5
|
+
import { createElement, useCallback, } from 'react';
|
|
6
|
+
import { useNavigation } from './context';
|
|
7
|
+
/**
|
|
8
|
+
* A real anchor (so middle-click / open-in-new-tab keep working) that drives a
|
|
9
|
+
* client-side transition on plain left-click. Modified clicks (new tab/window,
|
|
10
|
+
* download) fall through to the browser's default handling.
|
|
11
|
+
*/
|
|
12
|
+
export function AppLink({ to, search, children, className, 'aria-label': ariaLabel, 'aria-current': ariaCurrent, title, style, }) {
|
|
13
|
+
const { navigate, resolvePath } = useNavigation();
|
|
14
|
+
const href = resolvePath(to, search);
|
|
15
|
+
const onClick = useCallback((event) => {
|
|
16
|
+
if (event.defaultPrevented)
|
|
17
|
+
return;
|
|
18
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
19
|
+
return;
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
navigate(to, search);
|
|
22
|
+
}, [navigate, to, search]);
|
|
23
|
+
return createElement('a', {
|
|
24
|
+
href,
|
|
25
|
+
className,
|
|
26
|
+
'aria-label': ariaLabel,
|
|
27
|
+
'aria-current': ariaCurrent,
|
|
28
|
+
title,
|
|
29
|
+
style,
|
|
30
|
+
onClick,
|
|
31
|
+
}, children);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=app-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-link.js","sourceRoot":"","sources":["../../src/navigation/app-link.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAEL,aAAa,EAIb,WAAW,GACZ,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAgB1C;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAuB,EAC5C,EAAE,EACF,MAAM,EACN,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,cAAc,EAAE,WAAW,EAC3B,KAAK,EACL,KAAK,GACW;IAChB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,aAAa,EAAE,CAAC;IAClD,MAAM,IAAI,GAAG,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,KAAoC,EAAE,EAAE;QACvC,IAAI,KAAK,CAAC,gBAAgB;YAAE,OAAO;QACnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM;YACxF,OAAO;QACT,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC,EACD,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,CACvB,CAAC;IACF,OAAO,aAAa,CAClB,GAAG,EACH;QACE,IAAI;QACJ,SAAS;QACT,YAAY,EAAE,SAAS;QACvB,cAAc,EAAE,WAAW;QAC3B,KAAK;QACL,KAAK;QACL,OAAO;KACR,EACD,QAAQ,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { NavigationContextValue, NavigationGuardHandler
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NavigationContextValue, NavigationGuardHandler } from './types';
|
|
3
3
|
export declare function NavigationProvider({ value, children, }: {
|
|
4
4
|
value: NavigationContextValue;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}): ReactNode;
|
|
7
|
+
export declare function useNavigation(): NavigationContextValue;
|
|
7
8
|
/** Imperative navigation to a shell route token with its typed search params. */
|
|
8
9
|
export declare function useAppNavigate(): NavigationContextValue['navigate'];
|
|
9
10
|
/** Resolve a token + search to the href the shell would route to. */
|
|
@@ -50,22 +51,4 @@ export declare function usePluginEntryNavigation(): {
|
|
|
50
51
|
navigatePluginWithOptions: NonNullable<NavigationContextValue['navigatePluginWithOptions']>;
|
|
51
52
|
updatePluginEntryState: NonNullable<NavigationContextValue['updatePluginEntryState']>;
|
|
52
53
|
};
|
|
53
|
-
export interface AppLinkProps<T extends RouteToken> {
|
|
54
|
-
to: T;
|
|
55
|
-
search?: RouteSearch<T>;
|
|
56
|
-
children: ReactNode;
|
|
57
|
-
className?: string;
|
|
58
|
-
'aria-label'?: string;
|
|
59
|
-
'aria-current'?: AriaAttributes['aria-current'];
|
|
60
|
-
/** Native tooltip text (also a sensible non-AT hover hint). */
|
|
61
|
-
title?: string;
|
|
62
|
-
/** Inline styles for the anchor. */
|
|
63
|
-
style?: CSSProperties;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* A real anchor (so middle-click / open-in-new-tab keep working) that drives a
|
|
67
|
-
* client-side transition on plain left-click. Modified clicks (new tab/window,
|
|
68
|
-
* download) fall through to the browser's default handling.
|
|
69
|
-
*/
|
|
70
|
-
export declare function AppLink<T extends RouteToken>({ to, search, children, className, 'aria-label': ariaLabel, 'aria-current': ariaCurrent, title, style, }: AppLinkProps<T>): ReactNode;
|
|
71
54
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/navigation/context.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/navigation/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AA2B9E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,SAAS,CAgCZ;AAED,wBAAgB,aAAa,IAAI,sBAAsB,CAQtD;AAED,iFAAiF;AACjF,wBAAgB,cAAc,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAEnE;AAED,qEAAqE;AACrE,wBAAgB,cAAc,IAAI,sBAAsB,CAAC,aAAa,CAAC,CAEtE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAWvF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAWtE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CACzC,sBAAsB,EACtB,gBAAgB,GAAG,mBAAmB,CACvC,CAGA;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C,yBAAyB,EAAE,WAAW,CAAC,sBAAsB,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAC5F,sBAAsB,EAAE,WAAW,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,CAAC,CAAC;CACvF,CAWA"}
|
|
@@ -1,57 +1,9 @@
|
|
|
1
|
-
import { createContext, createElement, useCallback, useContext, useEffect, useMemo, useRef,
|
|
1
|
+
import { createContext, createElement, useCallback, useContext, useEffect, useMemo, useRef, } from 'react';
|
|
2
|
+
import { NavigationGuardRegistry } from './guard-registry';
|
|
3
|
+
import { buildGuardedNavigation } from './guarded-navigation';
|
|
4
|
+
import { useBackForwardGuard } from './use-back-forward-guard';
|
|
2
5
|
/** Shell-provided navigation; no default, so use outside {@link NavigationProvider} throws. */
|
|
3
6
|
const NavigationContext = createContext(null);
|
|
4
|
-
/**
|
|
5
|
-
* The guards active under one {@link NavigationProvider} — the single registry
|
|
6
|
-
* every SDK-controlled navigation consults, so feature and plugin-page guards
|
|
7
|
-
* compose against the same set. `run` stops at the first veto (at most one confirm
|
|
8
|
-
* dialog); `subscribe` re-evaluates browser-level listeners when the armed set changes.
|
|
9
|
-
*/
|
|
10
|
-
class NavigationGuardRegistry {
|
|
11
|
-
guards = new Set();
|
|
12
|
-
listeners = new Set();
|
|
13
|
-
/** Register a guard; returns the unregister function. */
|
|
14
|
-
add(entry) {
|
|
15
|
-
this.guards.add(entry);
|
|
16
|
-
this.emit();
|
|
17
|
-
return () => {
|
|
18
|
-
this.guards.delete(entry);
|
|
19
|
-
this.emit();
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/** Notify subscribers that a guard's `when` may have changed. */
|
|
23
|
-
touch() {
|
|
24
|
-
this.emit();
|
|
25
|
-
}
|
|
26
|
-
subscribe(listener) {
|
|
27
|
-
this.listeners.add(listener);
|
|
28
|
-
return () => {
|
|
29
|
-
this.listeners.delete(listener);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
hasArmedGuards() {
|
|
33
|
-
for (const entry of this.guards) {
|
|
34
|
-
if (entry.when)
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
/** Resolve `true` only if every armed guard allows the navigation. */
|
|
40
|
-
async run() {
|
|
41
|
-
for (const entry of this.guards) {
|
|
42
|
-
if (!entry.when)
|
|
43
|
-
continue;
|
|
44
|
-
const allowed = await entry.handler();
|
|
45
|
-
if (!allowed)
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
emit() {
|
|
51
|
-
for (const listener of this.listeners)
|
|
52
|
-
listener();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
7
|
/**
|
|
56
8
|
* Carries the provider's guard registry to {@link useNavigationGuard}. Separate from
|
|
57
9
|
* {@link NavigationContext} so the shell-supplied value stays exactly the shell's
|
|
@@ -68,38 +20,6 @@ function useGuardRegistry() {
|
|
|
68
20
|
}
|
|
69
21
|
return registry;
|
|
70
22
|
}
|
|
71
|
-
/**
|
|
72
|
-
* The `history.state` namespace under which the host stores per-history-entry plugin
|
|
73
|
-
* state, keyed by pluginId. Shared, by literal contract, with the shell's
|
|
74
|
-
* `createNavigation` (which WRITES the slot) and the plugin catch-all page (which
|
|
75
|
-
* READS it) — this SDK layer only reconstructs it for the committed-entry mirror.
|
|
76
|
-
*/
|
|
77
|
-
const ENTRY_STATE_KEY = 'studioPluginEntryState';
|
|
78
|
-
/**
|
|
79
|
-
* Reconstruct the `history.state` bag a guard-approved plugin navigation LANDS on, so
|
|
80
|
-
* a subsequently vetoed Back restores the entry with the state it just wrote intact
|
|
81
|
-
* rather than clobbering it with null. Mirrors the host's
|
|
82
|
-
* `{ studioPluginEntryState: { [pluginId]: state } }` namespace. TanStack's own
|
|
83
|
-
* `key`/`__TSR_*` keys are unobservable at this layer, so this is a best-effort bag —
|
|
84
|
-
* no worse than the `null` it replaces for those keys, and correct for the plugin slot.
|
|
85
|
-
*/
|
|
86
|
-
function reconstructEntryState(pluginId, state) {
|
|
87
|
-
return { [ENTRY_STATE_KEY]: { [pluginId]: state } };
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Merge one plugin's state slot into a prior `history.state` bag, preserving BOTH the
|
|
91
|
-
* router's own keys and every other plugin's slot. Used to refresh the committed entry
|
|
92
|
-
* after {@link NavigationContextValue.updatePluginEntryState}, so a later vetoed Back
|
|
93
|
-
* restores the UPDATED slot instead of the pre-update one.
|
|
94
|
-
*/
|
|
95
|
-
function mergeEntryState(prev, pluginId, state) {
|
|
96
|
-
const base = prev !== null && typeof prev === 'object' ? prev : {};
|
|
97
|
-
const priorSlot = base[ENTRY_STATE_KEY];
|
|
98
|
-
const priorBag = priorSlot !== null && typeof priorSlot === 'object'
|
|
99
|
-
? priorSlot
|
|
100
|
-
: {};
|
|
101
|
-
return { ...base, [ENTRY_STATE_KEY]: { ...priorBag, [pluginId]: state } };
|
|
102
|
-
}
|
|
103
23
|
export function NavigationProvider({ value, children, }) {
|
|
104
24
|
const registryRef = useRef(null);
|
|
105
25
|
registryRef.current ??= new NavigationGuardRegistry();
|
|
@@ -108,171 +28,17 @@ export function NavigationProvider({ value, children, }) {
|
|
|
108
28
|
// canceled back/forward restores to. URL changes made outside the SDK's navigate
|
|
109
29
|
// entry points are unobservable by design at this layer.
|
|
110
30
|
const committedRef = useRef(null);
|
|
111
|
-
|
|
112
|
-
// while at least one guard is armed.
|
|
113
|
-
const [armed, setArmed] = useState(false);
|
|
114
|
-
useEffect(() => {
|
|
115
|
-
setArmed(registry.hasArmedGuards());
|
|
116
|
-
return registry.subscribe(() => {
|
|
117
|
-
setArmed(registry.hasArmedGuards());
|
|
118
|
-
});
|
|
119
|
-
}, [registry]);
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
if (!armed)
|
|
122
|
-
return;
|
|
123
|
-
// The protected entry (URL + state); a back/forward landing elsewhere is first
|
|
124
|
-
// canceled back to here while the guard is consulted.
|
|
125
|
-
committedRef.current = { href: window.location.href, state: window.history.state };
|
|
126
|
-
// Set while replaying a guard-approved back/forward, so its `popstate` passes
|
|
127
|
-
// through instead of being re-intercepted.
|
|
128
|
-
let bypass = false;
|
|
129
|
-
// Latched while a decision is pending, so a second Back mid-decision keeps canceling
|
|
130
|
-
// without starting a concurrent `registry.run()` — one gesture, one dialog.
|
|
131
|
-
let pending = false;
|
|
132
|
-
// Restore pushes stacked for the pending decision, so an approved replay unwinds
|
|
133
|
-
// exactly that far in one `go(-depth)`. Reset per decision.
|
|
134
|
-
let restores = 0;
|
|
135
|
-
const onPopState = () => {
|
|
136
|
-
if (bypass) {
|
|
137
|
-
bypass = false;
|
|
138
|
-
committedRef.current = { href: window.location.href, state: window.history.state };
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (!registry.hasArmedGuards()) {
|
|
142
|
-
committedRef.current = { href: window.location.href, state: window.history.state };
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const committed = committedRef.current;
|
|
146
|
-
if (committed === null)
|
|
147
|
-
return;
|
|
148
|
-
// Cancel the browser's move by pushing the committed entry on top of wherever it
|
|
149
|
-
// landed. popstate exposes no direction/distance and the router owns
|
|
150
|
-
// `history.state`, so restore can only push, not delete. A vetoed forward thus
|
|
151
|
-
// strands a stub entry — an accepted limit the next pushState truncates.
|
|
152
|
-
window.history.pushState(committed.state, '', committed.href);
|
|
153
|
-
restores += 1;
|
|
154
|
-
if (pending)
|
|
155
|
-
return;
|
|
156
|
-
pending = true;
|
|
157
|
-
void registry.run().then((allowed) => {
|
|
158
|
-
pending = false;
|
|
159
|
-
const depth = restores;
|
|
160
|
-
restores = 0;
|
|
161
|
-
if (!allowed)
|
|
162
|
-
return;
|
|
163
|
-
bypass = true;
|
|
164
|
-
window.history.go(-depth);
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
const onBeforeUnload = (event) => {
|
|
168
|
-
event.preventDefault();
|
|
169
|
-
// Browsers below the floor (Chrome 108) gate the prompt on a set `returnValue`,
|
|
170
|
-
// not `preventDefault` alone; the string is ignored. Typed deprecated, still required.
|
|
171
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated -- required beforeunload trigger for the supported browser range.
|
|
172
|
-
event.returnValue = '';
|
|
173
|
-
};
|
|
174
|
-
window.addEventListener('popstate', onPopState);
|
|
175
|
-
window.addEventListener('beforeunload', onBeforeUnload);
|
|
176
|
-
return () => {
|
|
177
|
-
committedRef.current = null;
|
|
178
|
-
window.removeEventListener('popstate', onPopState);
|
|
179
|
-
window.removeEventListener('beforeunload', onBeforeUnload);
|
|
180
|
-
};
|
|
181
|
-
}, [armed, registry]);
|
|
31
|
+
useBackForwardGuard(registry, committedRef);
|
|
182
32
|
// Wrap the shell's transitions so an armed guard is consulted before they commit.
|
|
183
33
|
// With no guard armed the call stays synchronous — identical to the raw shell value.
|
|
184
|
-
const guarded = useMemo(() =>
|
|
185
|
-
// Forwarded as a REST tuple, so the shell's `navigate` is called with exactly
|
|
186
|
-
// the arguments the caller passed — a caller that wants the default history
|
|
187
|
-
// behaviour never turns into one that passed an explicit `undefined` for it.
|
|
188
|
-
const navigate = (...args) => {
|
|
189
|
-
const [token, search] = args;
|
|
190
|
-
if (!registry.hasArmedGuards()) {
|
|
191
|
-
value.navigate(...args);
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
void registry.run().then((allowed) => {
|
|
195
|
-
if (!allowed)
|
|
196
|
-
return;
|
|
197
|
-
value.navigate(...args);
|
|
198
|
-
// Advance the committed entry to the resolved destination (the router may commit
|
|
199
|
-
// async, so `window.location` would be stale). Its router state is unobservable
|
|
200
|
-
// here, hence `state: null`.
|
|
201
|
-
if (committedRef.current !== null) {
|
|
202
|
-
committedRef.current = { href: value.resolvePath(token, search), state: null };
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
const navigatePlugin = (pluginId, pagePath, params, search) => {
|
|
207
|
-
if (!registry.hasArmedGuards()) {
|
|
208
|
-
value.navigatePlugin(pluginId, pagePath, params, search);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
void registry.run().then((allowed) => {
|
|
212
|
-
if (!allowed)
|
|
213
|
-
return;
|
|
214
|
-
value.navigatePlugin(pluginId, pagePath, params, search);
|
|
215
|
-
if (committedRef.current !== null) {
|
|
216
|
-
committedRef.current = {
|
|
217
|
-
href: value.resolvePluginPath(pluginId, pagePath, params, search),
|
|
218
|
-
state: null,
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
};
|
|
223
|
-
const result = { ...value, navigate, navigatePlugin };
|
|
224
|
-
// navigatePluginWithOptions: guard-gated exactly like navigatePlugin (a veto never
|
|
225
|
-
// reaches the host member — no entry, no state). On approval, refresh the committed
|
|
226
|
-
// entry with the reconstructed state bag so a subsequent vetoed Back restores the
|
|
227
|
-
// slot this navigation just wrote, not null. Only wrapped when the host provides it;
|
|
228
|
-
// an older host leaves it undefined and the plugin-facing hook throws loudly.
|
|
229
|
-
const hostNavigateWithOptions = value.navigatePluginWithOptions;
|
|
230
|
-
if (hostNavigateWithOptions !== undefined) {
|
|
231
|
-
result.navigatePluginWithOptions = (pluginId, pagePath, params, search, options) => {
|
|
232
|
-
if (!registry.hasArmedGuards()) {
|
|
233
|
-
hostNavigateWithOptions(pluginId, pagePath, params, search, options);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
void registry.run().then((allowed) => {
|
|
237
|
-
if (!allowed)
|
|
238
|
-
return;
|
|
239
|
-
hostNavigateWithOptions(pluginId, pagePath, params, search, options);
|
|
240
|
-
if (committedRef.current !== null) {
|
|
241
|
-
committedRef.current = {
|
|
242
|
-
href: value.resolvePluginPath(pluginId, pagePath, params, search),
|
|
243
|
-
state: options?.state !== undefined
|
|
244
|
-
? reconstructEntryState(pluginId, options.state)
|
|
245
|
-
: null,
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
// updatePluginEntryState: guard-FREE — rewriting the current entry's state is not a
|
|
252
|
-
// navigation away, so no guard is consulted. But the SDK MUST wrap it to refresh the
|
|
253
|
-
// committed entry with the merged slot, so a later vetoed Back restores the UPDATED
|
|
254
|
-
// state rather than the pre-update one. URL is unchanged, so href is preserved.
|
|
255
|
-
const hostUpdateEntryState = value.updatePluginEntryState;
|
|
256
|
-
if (hostUpdateEntryState !== undefined) {
|
|
257
|
-
result.updatePluginEntryState = (pluginId, state) => {
|
|
258
|
-
hostUpdateEntryState(pluginId, state);
|
|
259
|
-
if (committedRef.current !== null) {
|
|
260
|
-
committedRef.current = {
|
|
261
|
-
href: committedRef.current.href,
|
|
262
|
-
state: mergeEntryState(committedRef.current.state, pluginId, state),
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
return result;
|
|
268
|
-
}, [value, registry]);
|
|
34
|
+
const guarded = useMemo(() => buildGuardedNavigation(value, registry, committedRef), [value, registry]);
|
|
269
35
|
const commitHref = useCallback((href) => {
|
|
270
36
|
if (committedRef.current !== null)
|
|
271
37
|
committedRef.current = { href, state: null };
|
|
272
38
|
}, []);
|
|
273
39
|
return createElement(GuardRegistryContext.Provider, { value: registry }, createElement(CommitHrefContext.Provider, { value: commitHref }, createElement(NavigationContext.Provider, { value: guarded }, children)));
|
|
274
40
|
}
|
|
275
|
-
function useNavigation() {
|
|
41
|
+
export function useNavigation() {
|
|
276
42
|
const ctx = useContext(NavigationContext);
|
|
277
43
|
if (ctx === null) {
|
|
278
44
|
throw new Error('useNavigation must be used within a <NavigationProvider> (the shell provides it).');
|
|
@@ -357,30 +123,4 @@ export function usePluginEntryNavigation() {
|
|
|
357
123
|
}
|
|
358
124
|
return { navigatePluginWithOptions, updatePluginEntryState };
|
|
359
125
|
}
|
|
360
|
-
/**
|
|
361
|
-
* A real anchor (so middle-click / open-in-new-tab keep working) that drives a
|
|
362
|
-
* client-side transition on plain left-click. Modified clicks (new tab/window,
|
|
363
|
-
* download) fall through to the browser's default handling.
|
|
364
|
-
*/
|
|
365
|
-
export function AppLink({ to, search, children, className, 'aria-label': ariaLabel, 'aria-current': ariaCurrent, title, style, }) {
|
|
366
|
-
const { navigate, resolvePath } = useNavigation();
|
|
367
|
-
const href = resolvePath(to, search);
|
|
368
|
-
const onClick = useCallback((event) => {
|
|
369
|
-
if (event.defaultPrevented)
|
|
370
|
-
return;
|
|
371
|
-
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
372
|
-
return;
|
|
373
|
-
event.preventDefault();
|
|
374
|
-
navigate(to, search);
|
|
375
|
-
}, [navigate, to, search]);
|
|
376
|
-
return createElement('a', {
|
|
377
|
-
href,
|
|
378
|
-
className,
|
|
379
|
-
'aria-label': ariaLabel,
|
|
380
|
-
'aria-current': ariaCurrent,
|
|
381
|
-
title,
|
|
382
|
-
style,
|
|
383
|
-
onClick,
|
|
384
|
-
}, children);
|
|
385
|
-
}
|
|
386
126
|
//# sourceMappingURL=context.js.map
|