@tai42/studio-sdk 0.2.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/LICENSE +202 -0
- package/NOTICE +15 -0
- package/README.md +318 -0
- package/SECURITY.md +51 -0
- package/dist/components/badge.d.ts +13 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +14 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/checkbox.d.ts +24 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +31 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code-block.d.ts +7 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +23 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/completion-input.d.ts +31 -0
- package/dist/components/completion-input.d.ts.map +1 -0
- package/dist/components/completion-input.js +61 -0
- package/dist/components/completion-input.js.map +1 -0
- package/dist/components/components.css +2212 -0
- package/dist/components/confirm-dialog.d.ts +40 -0
- package/dist/components/confirm-dialog.d.ts.map +1 -0
- package/dist/components/confirm-dialog.js +11 -0
- package/dist/components/confirm-dialog.js.map +1 -0
- package/dist/components/control-styles.d.ts +12 -0
- package/dist/components/control-styles.d.ts.map +1 -0
- package/dist/components/control-styles.js +14 -0
- package/dist/components/control-styles.js.map +1 -0
- package/dist/components/copy-field.d.ts +8 -0
- package/dist/components/copy-field.d.ts.map +1 -0
- package/dist/components/copy-field.js +106 -0
- package/dist/components/copy-field.js.map +1 -0
- package/dist/components/dialog.d.ts +21 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +25 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +22 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +32 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/error-boundary.d.ts +33 -0
- package/dist/components/error-boundary.d.ts.map +1 -0
- package/dist/components/error-boundary.js +36 -0
- package/dist/components/error-boundary.js.map +1 -0
- package/dist/components/extension-combo-builder.d.ts +70 -0
- package/dist/components/extension-combo-builder.d.ts.map +1 -0
- package/dist/components/extension-combo-builder.js +154 -0
- package/dist/components/extension-combo-builder.js.map +1 -0
- package/dist/components/extension-grouping.d.ts +65 -0
- package/dist/components/extension-grouping.d.ts.map +1 -0
- package/dist/components/extension-grouping.js +78 -0
- package/dist/components/extension-grouping.js.map +1 -0
- package/dist/components/extension-picker.d.ts +35 -0
- package/dist/components/extension-picker.d.ts.map +1 -0
- package/dist/components/extension-picker.js +31 -0
- package/dist/components/extension-picker.js.map +1 -0
- package/dist/components/external-link.d.ts +19 -0
- package/dist/components/external-link.d.ts.map +1 -0
- package/dist/components/external-link.js +12 -0
- package/dist/components/external-link.js.map +1 -0
- package/dist/components/field.d.ts +64 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +56 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/fleet-report.d.ts +39 -0
- package/dist/components/fleet-report.d.ts.map +1 -0
- package/dist/components/fleet-report.js +50 -0
- package/dist/components/fleet-report.js.map +1 -0
- package/dist/components/fonts.css +22 -0
- package/dist/components/icons.d.ts +142 -0
- package/dist/components/icons.d.ts.map +1 -0
- package/dist/components/icons.js +139 -0
- package/dist/components/icons.js.map +1 -0
- package/dist/components/inputs.d.ts +52 -0
- package/dist/components/inputs.d.ts.map +1 -0
- package/dist/components/inputs.js +35 -0
- package/dist/components/inputs.js.map +1 -0
- package/dist/components/json-diff.d.ts +40 -0
- package/dist/components/json-diff.d.ts.map +1 -0
- package/dist/components/json-diff.js +119 -0
- package/dist/components/json-diff.js.map +1 -0
- package/dist/components/json-tree.d.ts +8 -0
- package/dist/components/json-tree.d.ts.map +1 -0
- package/dist/components/json-tree.js +70 -0
- package/dist/components/json-tree.js.map +1 -0
- package/dist/components/modal-focus.d.ts +15 -0
- package/dist/components/modal-focus.d.ts.map +1 -0
- package/dist/components/modal-focus.js +136 -0
- package/dist/components/modal-focus.js.map +1 -0
- package/dist/components/page-header.d.ts +56 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +24 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/primitives.d.ts +186 -0
- package/dist/components/primitives.d.ts.map +1 -0
- package/dist/components/primitives.js +204 -0
- package/dist/components/primitives.js.map +1 -0
- package/dist/components/progress-bar.d.ts +29 -0
- package/dist/components/progress-bar.d.ts.map +1 -0
- package/dist/components/progress-bar.js +48 -0
- package/dist/components/progress-bar.js.map +1 -0
- package/dist/components/radio-group.d.ts +37 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +56 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/reveal-input.d.ts +13 -0
- package/dist/components/reveal-input.d.ts.map +1 -0
- package/dist/components/reveal-input.js +31 -0
- package/dist/components/reveal-input.js.map +1 -0
- package/dist/components/scroll-region.d.ts +85 -0
- package/dist/components/scroll-region.d.ts.map +1 -0
- package/dist/components/scroll-region.js +574 -0
- package/dist/components/scroll-region.js.map +1 -0
- package/dist/components/select.d.ts +53 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +33 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/table.d.ts +59 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +20 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +15 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +13 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tags.d.ts +46 -0
- package/dist/components/tags.d.ts.map +1 -0
- package/dist/components/tags.js +68 -0
- package/dist/components/tags.js.map +1 -0
- package/dist/components/tokens.css +392 -0
- package/dist/components/tokens.d.ts +15 -0
- package/dist/components/tokens.d.ts.map +1 -0
- package/dist/components/tokens.js +101 -0
- package/dist/components/tokens.js.map +1 -0
- package/dist/components/tool-picker.d.ts +24 -0
- package/dist/components/tool-picker.d.ts.map +1 -0
- package/dist/components/tool-picker.js +97 -0
- package/dist/components/tool-picker.js.map +1 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +18 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/version-history-panel.d.ts +71 -0
- package/dist/components/version-history-panel.d.ts.map +1 -0
- package/dist/components/version-history-panel.js +148 -0
- package/dist/components/version-history-panel.js.map +1 -0
- package/dist/download.d.ts +7 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +18 -0
- package/dist/download.js.map +1 -0
- package/dist/element-slot.d.ts +4 -0
- package/dist/element-slot.d.ts.map +1 -0
- package/dist/element-slot.js +20 -0
- package/dist/element-slot.js.map +1 -0
- package/dist/elicitation/ElicitationForm.d.ts +34 -0
- package/dist/elicitation/ElicitationForm.d.ts.map +1 -0
- package/dist/elicitation/ElicitationForm.js +24 -0
- package/dist/elicitation/ElicitationForm.js.map +1 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -0
- package/dist/extension-combos.d.ts +13 -0
- package/dist/extension-combos.d.ts.map +1 -0
- package/dist/extension-combos.js +9 -0
- package/dist/extension-combos.js.map +1 -0
- package/dist/hooks/useApi.d.ts +1222 -0
- package/dist/hooks/useApi.d.ts.map +1 -0
- package/dist/hooks/useApi.js +22 -0
- package/dist/hooks/useApi.js.map +1 -0
- package/dist/hooks/useAuth.d.ts +13 -0
- package/dist/hooks/useAuth.d.ts.map +1 -0
- package/dist/hooks/useAuth.js +53 -0
- package/dist/hooks/useAuth.js.map +1 -0
- package/dist/hooks/useBreakpoint.d.ts +10 -0
- package/dist/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/hooks/useBreakpoint.js +66 -0
- package/dist/hooks/useBreakpoint.js.map +1 -0
- package/dist/hooks/useCapabilities.d.ts +88 -0
- package/dist/hooks/useCapabilities.d.ts.map +1 -0
- package/dist/hooks/useCapabilities.js +203 -0
- package/dist/hooks/useCapabilities.js.map +1 -0
- package/dist/hooks/useSse.d.ts +13 -0
- package/dist/hooks/useSse.d.ts.map +1 -0
- package/dist/hooks/useSse.js +298 -0
- package/dist/hooks/useSse.js.map +1 -0
- package/dist/hooks/useTheme.d.ts +20 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +97 -0
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/hooks/useUnauthorized.d.ts +3 -0
- package/dist/hooks/useUnauthorized.d.ts.map +1 -0
- package/dist/hooks/useUnauthorized.js +18 -0
- package/dist/hooks/useUnauthorized.js.map +1 -0
- package/dist/host.d.ts +11 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +10 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +118 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation/context.d.ts +25 -0
- package/dist/navigation/context.d.ts.map +1 -0
- package/dist/navigation/context.js +45 -0
- package/dist/navigation/context.js.map +1 -0
- package/dist/navigation/index.d.ts +4 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/types.d.ts +97 -0
- package/dist/navigation/types.d.ts.map +1 -0
- package/dist/navigation/types.js +16 -0
- package/dist/navigation/types.js.map +1 -0
- package/dist/plugin/host-state.d.ts +45 -0
- package/dist/plugin/host-state.d.ts.map +1 -0
- package/dist/plugin/host-state.js +62 -0
- package/dist/plugin/host-state.js.map +1 -0
- package/dist/plugin/registry.d.ts +35 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/registry.js +129 -0
- package/dist/plugin/registry.js.map +1 -0
- package/dist/plugin/types.d.ts +165 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/plugin/types.js +2 -0
- package/dist/plugin/types.js.map +1 -0
- package/dist/plugin/version.d.ts +34 -0
- package/dist/plugin/version.d.ts.map +1 -0
- package/dist/plugin/version.js +37 -0
- package/dist/plugin/version.js.map +1 -0
- package/dist/query-keys.d.ts +31 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +31 -0
- package/dist/query-keys.js.map +1 -0
- package/dist/schema-editor/SchemaEditor.d.ts +43 -0
- package/dist/schema-editor/SchemaEditor.d.ts.map +1 -0
- package/dist/schema-editor/SchemaEditor.js +106 -0
- package/dist/schema-editor/SchemaEditor.js.map +1 -0
- package/dist/schema-editor/index.d.ts +10 -0
- package/dist/schema-editor/index.d.ts.map +1 -0
- package/dist/schema-editor/index.js +8 -0
- package/dist/schema-editor/index.js.map +1 -0
- package/dist/schema-editor/lint.d.ts +37 -0
- package/dist/schema-editor/lint.d.ts.map +1 -0
- package/dist/schema-editor/lint.js +49 -0
- package/dist/schema-editor/lint.js.map +1 -0
- package/dist/schema-form/SchemaForm.d.ts +70 -0
- package/dist/schema-form/SchemaForm.d.ts.map +1 -0
- package/dist/schema-form/SchemaForm.js +13 -0
- package/dist/schema-form/SchemaForm.js.map +1 -0
- package/dist/schema-form/array-field.d.ts +20 -0
- package/dist/schema-form/array-field.d.ts.map +1 -0
- package/dist/schema-form/array-field.js +39 -0
- package/dist/schema-form/array-field.js.map +1 -0
- package/dist/schema-form/classify.d.ts +87 -0
- package/dist/schema-form/classify.d.ts.map +1 -0
- package/dist/schema-form/classify.js +199 -0
- package/dist/schema-form/classify.js.map +1 -0
- package/dist/schema-form/context.d.ts +4 -0
- package/dist/schema-form/context.d.ts.map +1 -0
- package/dist/schema-form/context.js +14 -0
- package/dist/schema-form/context.js.map +1 -0
- package/dist/schema-form/default-value.d.ts +8 -0
- package/dist/schema-form/default-value.d.ts.map +1 -0
- package/dist/schema-form/default-value.js +64 -0
- package/dist/schema-form/default-value.js.map +1 -0
- package/dist/schema-form/enum-field.d.ts +19 -0
- package/dist/schema-form/enum-field.d.ts.map +1 -0
- package/dist/schema-form/enum-field.js +26 -0
- package/dist/schema-form/enum-field.js.map +1 -0
- package/dist/schema-form/field-group.d.ts +9 -0
- package/dist/schema-form/field-group.d.ts.map +1 -0
- package/dist/schema-form/field-group.js +32 -0
- package/dist/schema-form/field-group.js.map +1 -0
- package/dist/schema-form/field-node.d.ts +24 -0
- package/dist/schema-form/field-node.d.ts.map +1 -0
- package/dist/schema-form/field-node.js +51 -0
- package/dist/schema-form/field-node.js.map +1 -0
- package/dist/schema-form/index.d.ts +13 -0
- package/dist/schema-form/index.d.ts.map +1 -0
- package/dist/schema-form/index.js +11 -0
- package/dist/schema-form/index.js.map +1 -0
- package/dist/schema-form/media-field.d.ts +24 -0
- package/dist/schema-form/media-field.d.ts.map +1 -0
- package/dist/schema-form/media-field.js +169 -0
- package/dist/schema-form/media-field.js.map +1 -0
- package/dist/schema-form/media.d.ts +40 -0
- package/dist/schema-form/media.d.ts.map +1 -0
- package/dist/schema-form/media.js +65 -0
- package/dist/schema-form/media.js.map +1 -0
- package/dist/schema-form/object-fields.d.ts +20 -0
- package/dist/schema-form/object-fields.d.ts.map +1 -0
- package/dist/schema-form/object-fields.js +24 -0
- package/dist/schema-form/object-fields.js.map +1 -0
- package/dist/schema-form/resolve.d.ts +41 -0
- package/dist/schema-form/resolve.d.ts.map +1 -0
- package/dist/schema-form/resolve.js +102 -0
- package/dist/schema-form/resolve.js.map +1 -0
- package/dist/schema-form/string-field.d.ts +20 -0
- package/dist/schema-form/string-field.d.ts.map +1 -0
- package/dist/schema-form/string-field.js +68 -0
- package/dist/schema-form/string-field.js.map +1 -0
- package/dist/schema-form/styles.d.ts +18 -0
- package/dist/schema-form/styles.d.ts.map +1 -0
- package/dist/schema-form/styles.js +18 -0
- package/dist/schema-form/styles.js.map +1 -0
- package/dist/schema-form/types.d.ts +67 -0
- package/dist/schema-form/types.d.ts.map +1 -0
- package/dist/schema-form/types.js +10 -0
- package/dist/schema-form/types.js.map +1 -0
- package/dist/schema-form/union-field.d.ts +24 -0
- package/dist/schema-form/union-field.d.ts.map +1 -0
- package/dist/schema-form/union-field.js +55 -0
- package/dist/schema-form/union-field.js.map +1 -0
- package/dist/schema-form/union.d.ts +4 -0
- package/dist/schema-form/union.d.ts.map +1 -0
- package/dist/schema-form/union.js +68 -0
- package/dist/schema-form/union.js.map +1 -0
- package/dist/schema-form/unsupported-notice.d.ts +18 -0
- package/dist/schema-form/unsupported-notice.d.ts.map +1 -0
- package/dist/schema-form/unsupported-notice.js +8 -0
- package/dist/schema-form/unsupported-notice.js.map +1 -0
- package/dist/schema-form/validate.d.ts +18 -0
- package/dist/schema-form/validate.d.ts.map +1 -0
- package/dist/schema-form/validate.js +162 -0
- package/dist/schema-form/validate.js.map +1 -0
- package/dist/structured-output/StructuredOutput.d.ts +27 -0
- package/dist/structured-output/StructuredOutput.d.ts.map +1 -0
- package/dist/structured-output/StructuredOutput.js +41 -0
- package/dist/structured-output/StructuredOutput.js.map +1 -0
- package/dist/testing.d.ts +80 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +207 -0
- package/dist/testing.js.map +1 -0
- package/package.json +101 -0
- package/src/components/badge.tsx +31 -0
- package/src/components/checkbox.tsx +93 -0
- package/src/components/code-block.tsx +37 -0
- package/src/components/completion-input.tsx +137 -0
- package/src/components/components.css +2212 -0
- package/src/components/confirm-dialog.tsx +77 -0
- package/src/components/control-styles.ts +14 -0
- package/src/components/copy-field.tsx +178 -0
- package/src/components/dialog.tsx +76 -0
- package/src/components/drawer.tsx +83 -0
- package/src/components/error-boundary.tsx +56 -0
- package/src/components/extension-combo-builder.tsx +305 -0
- package/src/components/extension-grouping.ts +116 -0
- package/src/components/extension-picker.tsx +97 -0
- package/src/components/external-link.tsx +40 -0
- package/src/components/field.tsx +169 -0
- package/src/components/fleet-report.tsx +136 -0
- package/src/components/fonts.css +22 -0
- package/src/components/icons.tsx +504 -0
- package/src/components/inputs.tsx +125 -0
- package/src/components/json-diff.tsx +192 -0
- package/src/components/json-tree.tsx +129 -0
- package/src/components/modal-focus.ts +150 -0
- package/src/components/page-header.tsx +107 -0
- package/src/components/primitives.tsx +489 -0
- package/src/components/progress-bar.tsx +100 -0
- package/src/components/radio-group.tsx +160 -0
- package/src/components/reveal-input.tsx +87 -0
- package/src/components/scroll-region.tsx +703 -0
- package/src/components/select.tsx +149 -0
- package/src/components/table.tsx +94 -0
- package/src/components/tabs.tsx +51 -0
- package/src/components/tags.tsx +137 -0
- package/src/components/tokens.css +392 -0
- package/src/components/tokens.ts +102 -0
- package/src/components/tool-picker.tsx +175 -0
- package/src/components/tooltip.tsx +46 -0
- package/src/components/version-history-panel.tsx +407 -0
- package/src/css.d.ts +2 -0
- package/src/download.ts +17 -0
- package/src/element-slot.ts +22 -0
- package/src/elicitation/ElicitationForm.tsx +87 -0
- package/src/errors.ts +12 -0
- package/src/extension-combos.ts +18 -0
- package/src/hooks/useApi.ts +27 -0
- package/src/hooks/useAuth.ts +67 -0
- package/src/hooks/useBreakpoint.ts +78 -0
- package/src/hooks/useCapabilities.ts +242 -0
- package/src/hooks/useSse.ts +314 -0
- package/src/hooks/useTheme.ts +133 -0
- package/src/hooks/useUnauthorized.ts +20 -0
- package/src/host.ts +15 -0
- package/src/index.ts +267 -0
- package/src/navigation/context.tsx +90 -0
- package/src/navigation/index.ts +9 -0
- package/src/navigation/types.ts +90 -0
- package/src/plugin/host-state.ts +93 -0
- package/src/plugin/registry.ts +174 -0
- package/src/plugin/types.ts +178 -0
- package/src/plugin/version.ts +44 -0
- package/src/query-keys.ts +34 -0
- package/src/schema-editor/SchemaEditor.tsx +186 -0
- package/src/schema-editor/index.ts +9 -0
- package/src/schema-editor/lint.ts +70 -0
- package/src/schema-form/SchemaForm.tsx +107 -0
- package/src/schema-form/array-field.tsx +110 -0
- package/src/schema-form/classify.ts +302 -0
- package/src/schema-form/context.ts +17 -0
- package/src/schema-form/default-value.ts +65 -0
- package/src/schema-form/enum-field.tsx +65 -0
- package/src/schema-form/field-group.tsx +71 -0
- package/src/schema-form/field-node.tsx +161 -0
- package/src/schema-form/index.ts +12 -0
- package/src/schema-form/media-field.tsx +281 -0
- package/src/schema-form/media.ts +69 -0
- package/src/schema-form/object-fields.tsx +74 -0
- package/src/schema-form/resolve.ts +114 -0
- package/src/schema-form/string-field.tsx +161 -0
- package/src/schema-form/styles.ts +20 -0
- package/src/schema-form/types.ts +71 -0
- package/src/schema-form/union-field.tsx +122 -0
- package/src/schema-form/union.ts +78 -0
- package/src/schema-form/unsupported-notice.tsx +39 -0
- package/src/schema-form/validate.ts +183 -0
- package/src/structured-output/StructuredOutput.tsx +81 -0
- package/src/testing.ts +235 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
readonly content: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* The element the bubble describes and hangs off.
|
|
6
|
+
*
|
|
7
|
+
* It is a single ELEMENT, not any node: Radix clones its props onto it, so a
|
|
8
|
+
* string throws. The type admits a FRAGMENT — `<></>` is a `ReactElement` —
|
|
9
|
+
* which would render children carrying none of the hover/focus wiring nor the
|
|
10
|
+
* `aria-describedby` back to the bubble, so {@link assertSlotElement} rejects
|
|
11
|
+
* that one at runtime.
|
|
12
|
+
*/
|
|
13
|
+
readonly children: ReactElement;
|
|
14
|
+
readonly delayDuration?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function Tooltip({ content, children, delayDuration }: TooltipProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAmB,EAAE,EAAE,YAAY,+BAe/E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* `Tooltip` — a design-system wrapper over Radix Tooltip (content gets role
|
|
4
|
+
* `tooltip`, shown on hover/focus, wired to the trigger by Radix). Each instance
|
|
5
|
+
* carries its own Provider so a single tooltip works without the caller mounting
|
|
6
|
+
* one, and `delayDuration` tunes that Provider's open delay.
|
|
7
|
+
*
|
|
8
|
+
* The bubble is the `tai-tooltip` surface; the arrow is the one paint the class
|
|
9
|
+
* layer cannot reach (Radix renders it as an inline SVG), so it takes the same
|
|
10
|
+
* raised-surface token the bubble's background resolves from.
|
|
11
|
+
*/
|
|
12
|
+
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
13
|
+
import { assertSlotElement } from '../element-slot';
|
|
14
|
+
export function Tooltip({ content, children, delayDuration = 200 }) {
|
|
15
|
+
assertSlotElement(children, 'Tooltip `children`');
|
|
16
|
+
return (_jsx(RadixTooltip.Provider, { delayDuration: delayDuration, children: _jsxs(RadixTooltip.Root, { children: [_jsx(RadixTooltip.Trigger, { asChild: true, children: children }), _jsx(RadixTooltip.Portal, { children: _jsxs(RadixTooltip.Content, { sideOffset: 4, className: "tai-tooltip", children: [content, _jsx(RadixTooltip.Arrow, { style: { fill: 'var(--tai-color-surface-raised)' } })] }) })] }) }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAiBpD,MAAM,UAAU,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,GAAG,GAAG,EAAgB;IAC9E,iBAAiB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IAClD,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,aAAa,EAAE,aAAa,YACjD,MAAC,YAAY,CAAC,IAAI,eAChB,KAAC,YAAY,CAAC,OAAO,IAAC,OAAO,kBAAE,QAAQ,GAAwB,EAC/D,KAAC,YAAY,CAAC,MAAM,cAClB,MAAC,YAAY,CAAC,OAAO,IAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAC,aAAa,aACzD,OAAO,EACR,KAAC,YAAY,CAAC,KAAK,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,iCAAiC,EAAE,GAAI,IACrD,GACH,IACJ,GACE,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `VersionHistoryPanel` — a GENERIC, kind-agnostic viewer for a versioned
|
|
3
|
+
* document's history. It knows nothing about presets, AC policies, or authored
|
|
4
|
+
* agents: it takes a plain versions list (`{version, body, is_current,
|
|
5
|
+
* created_at}`, optionally `tags`) plus a `onRollback` callback, renders the list
|
|
6
|
+
* (a "Current" status mark driven by `is_current`), a `JsonTree` view of the selected
|
|
7
|
+
* version's opaque body, a per-row Rollback action behind a confirm dialog, and a
|
|
8
|
+
* per-row Compare action that opens a structural `JsonDiff` of two versions' bodies.
|
|
9
|
+
* Each consumer (e.g. presets, AC policies) wires it to its own routes.
|
|
10
|
+
*
|
|
11
|
+
* Two optional affordances, inert unless supplied:
|
|
12
|
+
* - a Tags column appears when any entry carries `tags` OR `onEditTags` is given
|
|
13
|
+
* (so tag-less consumers see no empty column);
|
|
14
|
+
* - when `onEditTags` is provided, a per-row "Edit tags" action opens a small
|
|
15
|
+
* dialog seeded from the row's tags; SAVE calls the callback with the NEW list
|
|
16
|
+
* and the panel awaits it with INTERNAL pending/error state, rendering a
|
|
17
|
+
* rejection's message verbatim.
|
|
18
|
+
*
|
|
19
|
+
* SAFETY: `body` and tags are arbitrary server JSON, rendered through `JsonTree` /
|
|
20
|
+
* `Badge` (React escapes every value) — never an HTML sink.
|
|
21
|
+
*
|
|
22
|
+
* Geometry and ink come from the design-system classes. Two rules shape the table:
|
|
23
|
+
* a row's state is a MARK plus a label (`tai-status` + `CheckCircleIcon` /
|
|
24
|
+
* `PendingIcon`), never color alone, and the version number and timestamp are the
|
|
25
|
+
* machine voice (`tai-table-id` / `tai-mono`). The table itself sits in a
|
|
26
|
+
* `ScrollRegion` so a narrow viewport scrolls it instead of the page.
|
|
27
|
+
*/
|
|
28
|
+
import { type ReactNode } from 'react';
|
|
29
|
+
/** One version row — the kind-agnostic shape every consumer projects into. */
|
|
30
|
+
export interface VersionHistoryEntry {
|
|
31
|
+
readonly version: number;
|
|
32
|
+
readonly body: unknown;
|
|
33
|
+
readonly is_current: boolean;
|
|
34
|
+
readonly created_at: string;
|
|
35
|
+
/** The version's generic label list, surfaced as a Tags column when present. */
|
|
36
|
+
readonly tags?: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
export interface VersionHistoryPanelProps {
|
|
39
|
+
readonly versions: readonly VersionHistoryEntry[];
|
|
40
|
+
/** Roll the active pointer to `version`. The consumer owns the mutation. */
|
|
41
|
+
readonly onRollback: (version: number) => void;
|
|
42
|
+
/** Fired when a version is selected for viewing (optional). */
|
|
43
|
+
readonly onView?: (version: number) => void;
|
|
44
|
+
/** The consumer's rollback mutation is in flight. */
|
|
45
|
+
readonly rollbackPending?: boolean;
|
|
46
|
+
/** A loud rollback failure message to surface in the confirm dialog. */
|
|
47
|
+
readonly rollbackError?: string;
|
|
48
|
+
/**
|
|
49
|
+
* A read-only history view: the version list and each version's body stay
|
|
50
|
+
* visible (history is a read surface), but EVERY mutating action is hidden —
|
|
51
|
+
* the per-row Rollback and, where `onEditTags` is supplied, Edit tags.
|
|
52
|
+
* Defaults to interactive.
|
|
53
|
+
*/
|
|
54
|
+
readonly readOnly?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Extra consequence copy appended to the rollback confirm dialog's description
|
|
57
|
+
* (announced to assistive tech via the dialog's `aria-describedby`). Consumers
|
|
58
|
+
* whose rollback has an immediate live effect (e.g. re-pointing access-control
|
|
59
|
+
* enforcement) pass a sentence stating so; omitted when there is nothing extra.
|
|
60
|
+
*/
|
|
61
|
+
readonly rollbackConfirmDescription?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Replace one version's tag annotation. When provided, a per-row "Edit tags"
|
|
64
|
+
* action opens a dialog seeded from the row's tags and SAVE calls this with the
|
|
65
|
+
* NEW list; the panel awaits the returned promise with internal pending/error
|
|
66
|
+
* state. Omitted ⇒ no edit affordance (tags stay read-only).
|
|
67
|
+
*/
|
|
68
|
+
readonly onEditTags?: (version: number, tags: string[]) => Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
export declare function VersionHistoryPanel({ versions, onRollback, onView, rollbackPending, rollbackError, readOnly, rollbackConfirmDescription, onEditTags, }: VersionHistoryPanelProps): ReactNode;
|
|
71
|
+
//# sourceMappingURL=version-history-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-history-panel.d.ts","sourceRoot":"","sources":["../../src/components/version-history-panel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAapE,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,qDAAqD;IACrD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,wEAAwE;IACxE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E;AA6ED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,UAAU,EACV,MAAM,EACN,eAAe,EACf,aAAa,EACb,QAAgB,EAChB,0BAA0B,EAC1B,UAAU,GACX,EAAE,wBAAwB,GAAG,SAAS,CA+OtC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* `VersionHistoryPanel` — a GENERIC, kind-agnostic viewer for a versioned
|
|
4
|
+
* document's history. It knows nothing about presets, AC policies, or authored
|
|
5
|
+
* agents: it takes a plain versions list (`{version, body, is_current,
|
|
6
|
+
* created_at}`, optionally `tags`) plus a `onRollback` callback, renders the list
|
|
7
|
+
* (a "Current" status mark driven by `is_current`), a `JsonTree` view of the selected
|
|
8
|
+
* version's opaque body, a per-row Rollback action behind a confirm dialog, and a
|
|
9
|
+
* per-row Compare action that opens a structural `JsonDiff` of two versions' bodies.
|
|
10
|
+
* Each consumer (e.g. presets, AC policies) wires it to its own routes.
|
|
11
|
+
*
|
|
12
|
+
* Two optional affordances, inert unless supplied:
|
|
13
|
+
* - a Tags column appears when any entry carries `tags` OR `onEditTags` is given
|
|
14
|
+
* (so tag-less consumers see no empty column);
|
|
15
|
+
* - when `onEditTags` is provided, a per-row "Edit tags" action opens a small
|
|
16
|
+
* dialog seeded from the row's tags; SAVE calls the callback with the NEW list
|
|
17
|
+
* and the panel awaits it with INTERNAL pending/error state, rendering a
|
|
18
|
+
* rejection's message verbatim.
|
|
19
|
+
*
|
|
20
|
+
* SAFETY: `body` and tags are arbitrary server JSON, rendered through `JsonTree` /
|
|
21
|
+
* `Badge` (React escapes every value) — never an HTML sink.
|
|
22
|
+
*
|
|
23
|
+
* Geometry and ink come from the design-system classes. Two rules shape the table:
|
|
24
|
+
* a row's state is a MARK plus a label (`tai-status` + `CheckCircleIcon` /
|
|
25
|
+
* `PendingIcon`), never color alone, and the version number and timestamp are the
|
|
26
|
+
* machine voice (`tai-table-id` / `tai-mono`). The table itself sits in a
|
|
27
|
+
* `ScrollRegion` so a narrow viewport scrolls it instead of the page.
|
|
28
|
+
*/
|
|
29
|
+
import { useEffect, useRef, useState } from 'react';
|
|
30
|
+
import { errorMessage } from '../errors';
|
|
31
|
+
import { Dialog } from './dialog';
|
|
32
|
+
import { Field } from './field';
|
|
33
|
+
import { CheckCircleIcon, PendingIcon } from './icons';
|
|
34
|
+
import { JsonDiff } from './json-diff';
|
|
35
|
+
import { JsonTree } from './json-tree';
|
|
36
|
+
import { Button, Card, ErrorState, Spinner } from './primitives';
|
|
37
|
+
import { ScrollRegion } from './scroll-region';
|
|
38
|
+
import { Table, TBody, TD, TH, THead, TR } from './table';
|
|
39
|
+
import { TagChips, TagsInput } from './tags';
|
|
40
|
+
/** The initially-selected version: the current one, else the first listed. */
|
|
41
|
+
function initialSelection(versions) {
|
|
42
|
+
const current = versions.find((entry) => entry.is_current);
|
|
43
|
+
return current?.version ?? versions[0]?.version ?? null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The per-version tag editor dialog. Seeds a draft from the row's tags and calls
|
|
47
|
+
* `onSave` on submit, awaiting it with LOCAL pending/error state: a rejection's
|
|
48
|
+
* message renders verbatim and the dialog stays open; success closes it.
|
|
49
|
+
*/
|
|
50
|
+
function EditTagsDialog({ version, initialTags, onSave, onClose, }) {
|
|
51
|
+
const [tags, setTags] = useState([...initialTags]);
|
|
52
|
+
const [pending, setPending] = useState(false);
|
|
53
|
+
const [error, setError] = useState(undefined);
|
|
54
|
+
const submit = () => {
|
|
55
|
+
setPending(true);
|
|
56
|
+
setError(undefined);
|
|
57
|
+
onSave(version, tags).then(() => {
|
|
58
|
+
onClose();
|
|
59
|
+
}, (reason) => {
|
|
60
|
+
setError(errorMessage(reason));
|
|
61
|
+
setPending(false);
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
return (_jsxs(Dialog, { title: `Edit tags — version ${String(version)}`, description: "Version tags are labels on an immutable body; editing them rebinds nothing.", open: true, onOpenChange: (next) => {
|
|
65
|
+
if (!next && !pending)
|
|
66
|
+
onClose();
|
|
67
|
+
}, children: [_jsxs("div", { className: "tai-stack", children: [_jsx(Field, { label: "Tags", description: "Labels on this version's immutable body.", children: _jsx(TagsInput, { value: tags, onChange: setTags, disabled: pending }) }), error !== undefined ? _jsx(ErrorState, { message: error }) : null] }), _jsxs("div", { className: "tai-dialog-actions", children: [_jsx(Button, { onClick: () => {
|
|
68
|
+
onClose();
|
|
69
|
+
}, disabled: pending, children: "Cancel" }), _jsxs(Button, { variant: "primary", onClick: submit, disabled: pending, children: [pending ? _jsx(Spinner, { label: "Saving tags" }) : null, "Save tags"] })] })] }));
|
|
70
|
+
}
|
|
71
|
+
export function VersionHistoryPanel({ versions, onRollback, onView, rollbackPending, rollbackError, readOnly = false, rollbackConfirmDescription, onEditTags, }) {
|
|
72
|
+
const [selected, setSelected] = useState(() => initialSelection(versions));
|
|
73
|
+
const [confirming, setConfirming] = useState(null);
|
|
74
|
+
// The armed Compare source (first click), and the open compare pair (second click).
|
|
75
|
+
const [compareFrom, setCompareFrom] = useState(null);
|
|
76
|
+
const [comparePair, setComparePair] = useState(null);
|
|
77
|
+
const [editingTags, setEditingTags] = useState(null);
|
|
78
|
+
// Close the confirm dialog on a SUCCESSFUL rollback: the consumer's mutation
|
|
79
|
+
// drives `rollbackPending` true→false, and success is that transition WITHOUT a
|
|
80
|
+
// `rollbackError`. We compare the prior `rollbackPending` to the current one via a
|
|
81
|
+
// ref so this fires exactly once on the true→false edge — never on mount (the ref
|
|
82
|
+
// seeds from the initial value, so no edge exists) and never on a failure (a set
|
|
83
|
+
// `rollbackError` keeps the dialog open showing the error).
|
|
84
|
+
const wasRollbackPending = useRef(rollbackPending);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const settledFromPending = wasRollbackPending.current === true && rollbackPending !== true;
|
|
87
|
+
wasRollbackPending.current = rollbackPending;
|
|
88
|
+
if (settledFromPending && rollbackError === undefined) {
|
|
89
|
+
setConfirming(null);
|
|
90
|
+
}
|
|
91
|
+
}, [rollbackPending, rollbackError]);
|
|
92
|
+
const selectedEntry = versions.find((entry) => entry.version === selected);
|
|
93
|
+
const showTags = onEditTags !== undefined || versions.some((entry) => (entry.tags ?? []).length > 0);
|
|
94
|
+
const canCompare = versions.length >= 2;
|
|
95
|
+
const view = (version) => {
|
|
96
|
+
setSelected(version);
|
|
97
|
+
onView?.(version);
|
|
98
|
+
};
|
|
99
|
+
const compare = (version) => {
|
|
100
|
+
if (compareFrom === null) {
|
|
101
|
+
setCompareFrom(version);
|
|
102
|
+
}
|
|
103
|
+
else if (compareFrom === version) {
|
|
104
|
+
setCompareFrom(null);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
setComparePair({ from: compareFrom, to: version });
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const closeCompare = () => {
|
|
111
|
+
setComparePair(null);
|
|
112
|
+
setCompareFrom(null);
|
|
113
|
+
};
|
|
114
|
+
const editingEntry = versions.find((entry) => entry.version === editingTags);
|
|
115
|
+
const fromBody = versions.find((entry) => entry.version === comparePair?.from)?.body;
|
|
116
|
+
const toBody = versions.find((entry) => entry.version === comparePair?.to)?.body;
|
|
117
|
+
return (_jsxs("div", { className: "tai-stack", children: [_jsx(Card, { children: _jsx(ScrollRegion, { label: "Version history", children: _jsxs(Table, { children: [_jsx(THead, { children: _jsxs(TR, { children: [_jsx(TH, { numeric: true, children: "Version" }), _jsx(TH, { children: "Created" }), _jsx(TH, { children: "Status" }), showTags ? _jsx(TH, { children: "Tags" }) : null, _jsx(TH, { children: "Actions" })] }) }), _jsx(TBody, { children: versions.map((entry) => (_jsxs(TR, { "data-testid": `version-row-${String(entry.version)}`, children: [_jsx(TD, { className: "tai-table-id", numeric: true, children: entry.version }), _jsx(TD, { className: "tai-mono", children: entry.created_at }), _jsx(TD, { children: entry.is_current ? (_jsxs("span", { className: "tai-status tai-status-ok", children: [_jsx(CheckCircleIcon, {}), "Current"] })) : (_jsxs("span", { className: "tai-status tai-status-pending", children: [_jsx(PendingIcon, {}), "Historical"] })) }), showTags ? (_jsx(TD, { children: (entry.tags ?? []).length > 0 ? (_jsx(TagChips, { tags: entry.tags ?? [] })) : (_jsx("span", { className: "tai-muted", children: "\u2014" })) })) : null, _jsx(TD, { children: _jsxs("div", { className: "tai-row", children: [_jsx(Button, { "aria-label": `View version ${String(entry.version)}`, onClick: () => {
|
|
118
|
+
view(entry.version);
|
|
119
|
+
}, children: "View" }), canCompare ? (_jsx(Button
|
|
120
|
+
// The name starts with the word the button is SHOWING,
|
|
121
|
+
// which is what WCAG 2.5.3 (Label in Name) asks: a constant
|
|
122
|
+
// "Compare …" would leave a button reading "Comparing…"
|
|
123
|
+
// named "Compare", and a voice-control user naming a control
|
|
124
|
+
// they cannot see. The button stays ENABLED while armed —
|
|
125
|
+
// unlike an Edit action, a second click on the armed row is
|
|
126
|
+
// the disarm, so there is nothing to take away.
|
|
127
|
+
, { "aria-label": `${compareFrom === entry.version ? 'Comparing' : 'Compare'} version ${String(entry.version)}`, onClick: () => {
|
|
128
|
+
compare(entry.version);
|
|
129
|
+
}, children: compareFrom === entry.version ? 'Comparing…' : 'Compare' })) : null, onEditTags !== undefined && !readOnly ? (_jsx(Button, { "aria-label": `Edit tags for version ${String(entry.version)}`, onClick: () => {
|
|
130
|
+
setEditingTags(entry.version);
|
|
131
|
+
}, children: "Edit tags" })) : null, readOnly ? null : (_jsx(Button, { variant: "secondary", "aria-label": `Roll back to version ${String(entry.version)}`, disabled: entry.is_current, onClick: () => {
|
|
132
|
+
setConfirming(entry.version);
|
|
133
|
+
}, children: "Roll back" }))] }) })] }, entry.version))) })] }) }) }), compareFrom !== null && comparePair === null ? (_jsxs("p", { role: "status", className: "tai-muted", children: ["Comparing from version ", compareFrom, " \u2014 pick another version, or Compare again to cancel."] })) : null, selectedEntry !== undefined ? (_jsxs("section", { className: "tai-stack tai-stack-2", children: [_jsxs("h3", { className: "tai-section-title", children: ["Version ", selectedEntry.version, " body"] }), _jsx(Card, { children: _jsx(JsonTree, { data: selectedEntry.body, label: `Version ${String(selectedEntry.version)} body` }) })] })) : null, comparePair !== null ? (_jsxs(Dialog, { title: `v${String(comparePair.from)} compared with v${String(comparePair.to)}`, description: "A structural diff of the two version bodies. Arrays compare whole.", open: true, onOpenChange: (next) => {
|
|
134
|
+
if (!next)
|
|
135
|
+
closeCompare();
|
|
136
|
+
}, children: [_jsx(ScrollRegion, { label: "Version diff", children: _jsx(JsonDiff, { before: fromBody, after: toBody }) }), _jsx("div", { className: "tai-dialog-actions", children: _jsx(Button, { onClick: closeCompare, children: "Close" }) })] })) : null, editingEntry !== undefined && onEditTags !== undefined ? (_jsx(EditTagsDialog, { version: editingEntry.version, initialTags: editingEntry.tags ?? [], onSave: onEditTags, onClose: () => {
|
|
137
|
+
setEditingTags(null);
|
|
138
|
+
} })) : null, confirming !== null ? (_jsxs(Dialog, { title: "Roll back version", description: `Make version ${String(confirming)} the active version? The version history is preserved.` +
|
|
139
|
+
(rollbackConfirmDescription !== undefined ? ` ${rollbackConfirmDescription}` : ''), open: true, onOpenChange: (next) => {
|
|
140
|
+
if (!next)
|
|
141
|
+
setConfirming(null);
|
|
142
|
+
}, children: [rollbackError !== undefined ? _jsx(ErrorState, { message: rollbackError }) : null, _jsxs("div", { className: "tai-dialog-actions", children: [_jsx(Button, { onClick: () => {
|
|
143
|
+
setConfirming(null);
|
|
144
|
+
}, children: "Cancel" }), _jsxs(Button, { variant: "primary", disabled: rollbackPending, onClick: () => {
|
|
145
|
+
onRollback(confirming);
|
|
146
|
+
}, children: [rollbackPending ? _jsx(Spinner, { label: "Rolling back" }) : null, "Roll back"] })] })] })) : null] }));
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=version-history-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-history-panel.js","sourceRoot":"","sources":["../../src/components/version-history-panel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;A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,CACH,CAAC,CAAC,CAAC,IAAI,EAEP,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CACrB,MAAC,MAAM,IACL,KAAK,EAAC,mBAAmB,EACzB,WAAW,EACT,gBAAgB,MAAM,CAAC,UAAU,CAAC,wDAAwD;oBAC1F,CAAC,0BAA0B,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,0BAA0B,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAEpF,IAAI,QACJ,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;oBACrB,IAAI,CAAC,IAAI;wBAAE,aAAa,CAAC,IAAI,CAAC,CAAC;gBACjC,CAAC,aAEA,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,OAAO,EAAE,aAAa,GAAI,CAAC,CAAC,CAAC,IAAI,EAC5E,eAAK,SAAS,EAAC,oBAAoB,aACjC,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;oCACZ,aAAa,CAAC,IAAI,CAAC,CAAC;gCACtB,CAAC,uBAGM,EACT,MAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,GAAG,EAAE;oCACZ,UAAU,CAAC,UAAU,CAAC,CAAC;gCACzB,CAAC,aAEA,eAAe,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,KAAK,EAAC,cAAc,GAAG,CAAC,CAAC,CAAC,IAAI,iBAEnD,IACL,IACC,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stream a `Blob` (an export- or content-route response) to the user as a file
|
|
3
|
+
* download via a transient object URL. The object URL is revoked on the next tick —
|
|
4
|
+
* revoking it synchronously can cancel the download before the browser commits it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function downloadBlob(blob: Blob, filename: string): void;
|
|
7
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAW/D"}
|
package/dist/download.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stream a `Blob` (an export- or content-route response) to the user as a file
|
|
3
|
+
* download via a transient object URL. The object URL is revoked on the next tick —
|
|
4
|
+
* revoking it synchronously can cancel the download before the browser commits it.
|
|
5
|
+
*/
|
|
6
|
+
export function downloadBlob(blob, filename) {
|
|
7
|
+
const url = URL.createObjectURL(blob);
|
|
8
|
+
const anchor = document.createElement('a');
|
|
9
|
+
anchor.href = url;
|
|
10
|
+
anchor.download = filename;
|
|
11
|
+
document.body.appendChild(anchor);
|
|
12
|
+
anchor.click();
|
|
13
|
+
anchor.remove();
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
URL.revokeObjectURL(url);
|
|
16
|
+
}, 0);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.js","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,QAAgB;IACvD,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,MAAM,CAAC,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,GAAG,EAAE;QACd,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-slot.d.ts","sourceRoot":"","sources":["../src/element-slot.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAM3E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runtime half of the `asChild` slot contract.
|
|
3
|
+
*
|
|
4
|
+
* Radix clones its own props onto the node an `asChild` slot is given, so the
|
|
5
|
+
* slot takes exactly one ELEMENT. `ReactElement` states half of that: it rejects
|
|
6
|
+
* a string, which would throw inside Radix anyway. It does NOT reject a
|
|
7
|
+
* FRAGMENT — `<></>` is a `ReactElement` whose `type` is the fragment symbol —
|
|
8
|
+
* and a fragment is the worse of the two, because React drops every prop cloned
|
|
9
|
+
* onto it: the opener renders, carries no `aria-haspopup`/`aria-expanded`/
|
|
10
|
+
* `aria-controls` and no handler, and fails nothing.
|
|
11
|
+
*/
|
|
12
|
+
import { Fragment } from 'react';
|
|
13
|
+
/** Raises when an `asChild` slot is handed a fragment. `slot` names the prop. */
|
|
14
|
+
export function assertSlotElement(element, slot) {
|
|
15
|
+
if (element.type !== Fragment)
|
|
16
|
+
return;
|
|
17
|
+
throw new Error(`${slot} takes a single element, not a fragment: React drops the props the ` +
|
|
18
|
+
'slot clones onto it, so the wiring and the handler would be lost.');
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=element-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-slot.js","sourceRoot":"","sources":["../src/element-slot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,iFAAiF;AACjF,MAAM,UAAU,iBAAiB,CAAC,OAAqB,EAAE,IAAY;IACnE,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO;IACtC,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,qEAAqE;QAC1E,mEAAmE,CACtE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ElicitationForm` — the Studio-as-elicit-client widget. It renders a
|
|
3
|
+
* FastMCP elicitation request (its `message` + `requestedSchema`) as a
|
|
4
|
+
* `SchemaForm`, validates the answer against the schema, and hands the typed
|
|
5
|
+
* answer back on submit. The schema is carried through intact, so the caller
|
|
6
|
+
* gets exactly the shape it asked for.
|
|
7
|
+
*
|
|
8
|
+
* Accept-or-submit only: this widget's job is to collect and return a valid
|
|
9
|
+
* answer. A decline/cancel is not modeled here (the platform bridge is
|
|
10
|
+
* accept-or-raise); the optional `onCancel` is a UI affordance, not an MCP
|
|
11
|
+
* decline round-trip. Reusable by any feature that must answer an elicit.
|
|
12
|
+
*/
|
|
13
|
+
import type { ReactNode } from 'react';
|
|
14
|
+
import type { JsonSchema } from '../schema-form/types';
|
|
15
|
+
export interface ElicitationFormProps {
|
|
16
|
+
/** The elicit request's human-readable message. */
|
|
17
|
+
readonly message: string;
|
|
18
|
+
/** The elicit `requestedSchema` — the answer's form schema. */
|
|
19
|
+
readonly schema: JsonSchema;
|
|
20
|
+
/** Called with the validated answer when the human submits. */
|
|
21
|
+
readonly onSubmit: (answer: unknown) => void;
|
|
22
|
+
/** Optional cancel affordance (UI only; not an MCP decline). */
|
|
23
|
+
readonly onCancel?: () => void;
|
|
24
|
+
/** Disables submission while an answer is in flight. */
|
|
25
|
+
readonly busy?: boolean;
|
|
26
|
+
readonly submitLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Render the elicit message + a schema-driven answer form. On submit the answer
|
|
30
|
+
* is validated against the schema; on success `onSubmit` receives the typed
|
|
31
|
+
* value, otherwise the per-field errors surface and nothing is emitted.
|
|
32
|
+
*/
|
|
33
|
+
export declare function ElicitationForm({ message, schema, onSubmit, onCancel, busy, submitLabel, }: ElicitationFormProps): ReactNode;
|
|
34
|
+
//# sourceMappingURL=ElicitationForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElicitationForm.d.ts","sourceRoot":"","sources":["../../src/elicitation/ElicitationForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,sBAAsB,CAAC;AAGzE,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,IAAY,EACZ,WAAsB,GACvB,EAAE,oBAAoB,GAAG,SAAS,CAuClC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Button } from '../components/primitives';
|
|
4
|
+
import { defaultValueForSchema } from '../schema-form/default-value';
|
|
5
|
+
import { SchemaForm } from '../schema-form/SchemaForm';
|
|
6
|
+
import { validateAgainstSchema } from '../schema-form/validate';
|
|
7
|
+
/**
|
|
8
|
+
* Render the elicit message + a schema-driven answer form. On submit the answer
|
|
9
|
+
* is validated against the schema; on success `onSubmit` receives the typed
|
|
10
|
+
* value, otherwise the per-field errors surface and nothing is emitted.
|
|
11
|
+
*/
|
|
12
|
+
export function ElicitationForm({ message, schema, onSubmit, onCancel, busy = false, submitLabel = 'Submit', }) {
|
|
13
|
+
const [value, setValue] = useState(() => defaultValueForSchema(schema));
|
|
14
|
+
const [errors, setErrors] = useState({});
|
|
15
|
+
const submit = () => {
|
|
16
|
+
const found = validateAgainstSchema(schema, value);
|
|
17
|
+
setErrors(found);
|
|
18
|
+
if (Object.keys(found).length === 0) {
|
|
19
|
+
onSubmit(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs("div", { className: "tai-stack", "data-testid": "elicitation-form", children: [_jsx("div", { className: "tai-prose", children: _jsx("p", { children: message }) }), _jsx(SchemaForm, { schema: schema, value: value, onChange: setValue, errors: errors, idPrefix: "elicit-form" }), _jsxs("div", { className: "tai-row", children: [_jsx(Button, { variant: "primary", onClick: submit, disabled: busy, children: submitLabel }), onCancel && (_jsx(Button, { variant: "secondary", onClick: onCancel, disabled: busy, children: "Cancel" }))] })] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ElicitationForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElicitationForm.js","sourceRoot":"","sources":["../../src/elicitation/ElicitationForm.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B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Q,EAAE,QAAQ,EAAE,IAAI,uBAEpD,CACV,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize an unknown thrown/rejected value (a TanStack Query `error`, a
|
|
3
|
+
* rejected mutation, a zod/`ApiError`) into a human-readable string for the loud
|
|
4
|
+
* `ErrorState` / `Field` surfaces. This only turns a caught value into
|
|
5
|
+
* displayable text — it never swallows the failure; the caller decides where to
|
|
6
|
+
* show it, and the message is always shown, never blank.
|
|
7
|
+
*/
|
|
8
|
+
export declare function errorMessage(error: unknown): string;
|
|
9
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAInD"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize an unknown thrown/rejected value (a TanStack Query `error`, a
|
|
3
|
+
* rejected mutation, a zod/`ApiError`) into a human-readable string for the loud
|
|
4
|
+
* `ErrorState` / `Field` surfaces. This only turns a caught value into
|
|
5
|
+
* displayable text — it never swallows the failure; the caller decides where to
|
|
6
|
+
* show it, and the message is always shown, never blank.
|
|
7
|
+
*/
|
|
8
|
+
export function errorMessage(error) {
|
|
9
|
+
if (error instanceof Error)
|
|
10
|
+
return error.message;
|
|
11
|
+
if (typeof error === 'string')
|
|
12
|
+
return error;
|
|
13
|
+
return 'An unexpected error occurred.';
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,+BAA+B,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for a preset/tool's list of extension combos, whose elements may carry
|
|
3
|
+
* author `config` (`{ name, config }`) alongside bare-name elements. The editors
|
|
4
|
+
* hold the full config-bearing elements as their value, so config rides through an
|
|
5
|
+
* edit directly; these helpers project a combo to its bare extension names where a
|
|
6
|
+
* name-only view is needed (a picker's selection, a branch-tool name, a badge row).
|
|
7
|
+
*/
|
|
8
|
+
import type { PresetExtensionElement } from '@tai42/api-client';
|
|
9
|
+
/** The bare extension name of one combo element (drops any `config`). */
|
|
10
|
+
export declare function extensionElementName(element: PresetExtensionElement): string;
|
|
11
|
+
/** Project a combo's elements to their bare extension names (drops any `config`). */
|
|
12
|
+
export declare function comboElementNames(combo: readonly PresetExtensionElement[]): string[];
|
|
13
|
+
//# sourceMappingURL=extension-combos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-combos.d.ts","sourceRoot":"","sources":["../src/extension-combos.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAE5E;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,sBAAsB,EAAE,GAAG,MAAM,EAAE,CAEpF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The bare extension name of one combo element (drops any `config`). */
|
|
2
|
+
export function extensionElementName(element) {
|
|
3
|
+
return typeof element === 'string' ? element : element.name;
|
|
4
|
+
}
|
|
5
|
+
/** Project a combo's elements to their bare extension names (drops any `config`). */
|
|
6
|
+
export function comboElementNames(combo) {
|
|
7
|
+
return combo.map(extensionElementName);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=extension-combos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-combos.js","sourceRoot":"","sources":["../src/extension-combos.ts"],"names":[],"mappings":"AASA,yEAAyE;AACzE,MAAM,UAAU,oBAAoB,CAAC,OAA+B;IAClE,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;AAC9D,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,iBAAiB,CAAC,KAAwC;IACxE,OAAO,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AACzC,CAAC"}
|