@ai-matrx/rich-content 0.2.4 → 0.2.6
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/CHANGELOG.md +18 -0
- package/dist/code-block/CodeBlock.d.ts +44 -0
- package/dist/code-block/CodeBlock.js +449 -0
- package/dist/code-block/CodeBlockHeader.d.ts +63 -0
- package/dist/code-block/CodeBlockHeader.js +472 -0
- package/dist/code-block/CodeEditorLoading.d.ts +3 -0
- package/dist/code-block/CodeEditorLoading.js +34 -0
- package/dist/code-block/LanguageDisplay.d.ts +28 -0
- package/dist/code-block/LanguageDisplay.js +279 -0
- package/dist/code-block/SmallCodeEditor.d.ts +30 -0
- package/dist/code-block/SmallCodeEditor.js +22 -0
- package/dist/code-block/StickyButtons.d.ts +35 -0
- package/dist/code-block/StickyButtons.js +88 -0
- package/dist/code-block/highlight/ShikiCodeView.d.ts +26 -0
- package/dist/code-block/highlight/ShikiCodeView.js +134 -0
- package/dist/code-block/highlight/shiki-highlighter.d.ts +14 -0
- package/dist/code-block/highlight/shiki-highlighter.js +126 -0
- package/dist/code-block/highlight/useHighlightedLines.d.ts +18 -0
- package/dist/code-block/highlight/useHighlightedLines.js +142 -0
- package/dist/code-block/sticky-inset.d.ts +6 -0
- package/dist/code-block/sticky-inset.js +10 -0
- package/dist/display/block-interaction.d.ts +33 -0
- package/dist/display/block-interaction.js +13 -0
- package/dist/display/blocks/ChatCollapsibleWrapper.d.ts +13 -0
- package/dist/display/blocks/ChatCollapsibleWrapper.js +56 -0
- package/dist/display/blocks/buildMediaSource.d.ts +25 -0
- package/dist/display/blocks/buildMediaSource.js +43 -0
- package/dist/display/blocks/canvas-adaptive.d.ts +118 -0
- package/dist/display/blocks/canvas-adaptive.js +127 -0
- package/dist/display/blocks/canvas-fit.d.ts +24 -0
- package/dist/display/blocks/canvas-fit.js +19 -0
- package/dist/display/blocks/chart/ChartBlock.d.ts +8 -0
- package/dist/display/blocks/chart/ChartBlock.js +125 -0
- package/dist/display/blocks/chart/ChartCanvas.d.ts +18 -0
- package/dist/display/blocks/chart/ChartCanvas.js +159 -0
- package/dist/display/blocks/chart/TableChart.d.ts +25 -0
- package/dist/display/blocks/chart/TableChart.js +97 -0
- package/dist/display/blocks/chart/chart-spec.d.ts +39 -0
- package/dist/display/blocks/chart/chart-spec.js +128 -0
- package/dist/display/blocks/chart/labels.d.ts +20 -0
- package/dist/display/blocks/chart/labels.js +7 -0
- package/dist/display/blocks/chart/table-chart.d.ts +37 -0
- package/dist/display/blocks/chart/table-chart.js +231 -0
- package/dist/display/blocks/common/BlockHeaderWrapper.d.ts +56 -0
- package/dist/display/blocks/common/BlockHeaderWrapper.js +310 -0
- package/dist/display/blocks/common/ContentBlockWrapper.d.ts +40 -0
- package/dist/display/blocks/common/ContentBlockWrapper.js +214 -0
- package/dist/display/blocks/common/SandboxedHtml.d.ts +27 -0
- package/dist/display/blocks/common/SandboxedHtml.js +26 -0
- package/dist/display/blocks/diagram/DiagramLoadingVisualization.d.ts +6 -0
- package/dist/display/blocks/diagram/DiagramLoadingVisualization.js +190 -0
- package/dist/display/blocks/diagram/InteractiveDiagramBlock.d.ts +51 -0
- package/dist/display/blocks/diagram/InteractiveDiagramBlock.js +2415 -0
- package/dist/display/blocks/diagram/diagram-printer.d.ts +16 -0
- package/dist/display/blocks/diagram/diagram-printer.js +294 -0
- package/dist/display/blocks/diagram/diagram-visual-defaults.d.ts +116 -0
- package/dist/display/blocks/diagram/diagram-visual-defaults.js +400 -0
- package/dist/display/blocks/diagram/layout-utils.d.ts +90 -0
- package/dist/display/blocks/diagram/layout-utils.js +347 -0
- package/dist/display/blocks/diagram/parseDiagramJSON.d.ts +105 -0
- package/dist/display/blocks/diagram/parseDiagramJSON.js +296 -0
- package/dist/display/blocks/diagram/presentation-direction.d.ts +29 -0
- package/dist/display/blocks/diagram/presentation-direction.js +19 -0
- package/dist/display/blocks/diagram/ui-utils.d.ts +1 -0
- package/dist/display/blocks/diagram/ui-utils.js +18 -0
- package/dist/display/blocks/diff/DiffBlock.d.ts +10 -0
- package/dist/display/blocks/diff/DiffBlock.js +119 -0
- package/dist/display/blocks/diff/DiffCanvas.d.ts +15 -0
- package/dist/display/blocks/diff/DiffCanvas.js +20 -0
- package/dist/display/blocks/generic/GenericStructuredBlock.d.ts +24 -0
- package/dist/display/blocks/generic/GenericStructuredBlock.js +53 -0
- package/dist/display/blocks/generic/StructuredValueTabs.d.ts +21 -0
- package/dist/display/blocks/generic/StructuredValueTabs.js +124 -0
- package/dist/display/blocks/generic/tile-actions-slot.d.ts +39 -0
- package/dist/display/blocks/generic/tile-actions-slot.js +33 -0
- package/dist/display/blocks/images/ImageBlock.d.ts +8 -0
- package/dist/display/blocks/images/ImageBlock.js +265 -0
- package/dist/display/blocks/json/JsonBlock.d.ts +34 -0
- package/dist/display/blocks/json/JsonBlock.js +562 -0
- package/dist/display/blocks/json/JsonTableView.d.ts +10 -0
- package/dist/display/blocks/json/JsonTableView.js +173 -0
- package/dist/display/blocks/json/json-compact-stringify.d.ts +25 -0
- package/dist/display/blocks/json/json-compact-stringify.js +52 -0
- package/dist/display/blocks/json/json-tabular-utils.d.ts +65 -0
- package/dist/display/blocks/json/json-tabular-utils.js +121 -0
- package/dist/display/blocks/links/LinkComponent.d.ts +6 -0
- package/dist/display/blocks/links/LinkComponent.js +373 -0
- package/dist/display/blocks/links/LinkComponentWithFetch.d.ts +1 -0
- package/dist/display/blocks/links/LinkComponentWithFetch.js +0 -0
- package/dist/display/blocks/markdown/MarkdownKindBlock.d.ts +48 -0
- package/dist/display/blocks/markdown/MarkdownKindBlock.js +52 -0
- package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.d.ts +17 -0
- package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.js +70 -0
- package/dist/display/blocks/mermaid/MermaidBlock.d.ts +19 -0
- package/dist/display/blocks/mermaid/MermaidBlock.js +386 -0
- package/dist/display/blocks/search-replace/SearchReplaceBlock.d.ts +50 -0
- package/dist/display/blocks/search-replace/SearchReplaceBlock.js +71 -0
- package/dist/display/blocks/svg/SvgBlock.d.ts +8 -0
- package/dist/display/blocks/svg/SvgBlock.js +126 -0
- package/dist/display/blocks/table/StreamingTableRenderer.d.ts +53 -0
- package/dist/display/blocks/table/StreamingTableRenderer.js +907 -0
- package/dist/display/blocks/table/TableRenderPathDiagnostic.d.ts +21 -0
- package/dist/display/blocks/table/TableRenderPathDiagnostic.js +79 -0
- package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.d.ts +14 -0
- package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.js +15 -0
- package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.d.ts +13 -0
- package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.js +19 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTrace.d.ts +30 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTrace.js +75 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.d.ts +13 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.js +48 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.d.ts +12 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.js +19 -0
- package/dist/display/blocks/toml/TomlBlock.d.ts +7 -0
- package/dist/display/blocks/toml/TomlBlock.js +167 -0
- package/dist/display/blocks/tree/TreeBlock.d.ts +7 -0
- package/dist/display/blocks/tree/TreeBlock.js +163 -0
- package/dist/display/blocks/xml/XmlBlock.d.ts +23 -0
- package/dist/display/blocks/xml/XmlBlock.js +197 -0
- package/dist/display/blocks/xml/readXmlTag.d.ts +1 -0
- package/dist/display/blocks/xml/readXmlTag.js +1 -0
- package/dist/display/blocks/xml/xml-tokenize.d.ts +13 -0
- package/dist/display/blocks/xml/xml-tokenize.js +169 -0
- package/dist/display/blocks/yaml/YamlBlock.d.ts +7 -0
- package/dist/display/blocks/yaml/YamlBlock.js +191 -0
- package/dist/display/chat-markdown/BasicMarkdownContent.d.ts +29 -0
- package/dist/display/chat-markdown/BasicMarkdownContent.js +122 -0
- package/dist/display/chat-markdown/BlockRenderingContext.d.ts +23 -0
- package/dist/display/chat-markdown/BlockRenderingContext.js +17 -0
- package/dist/display/chat-markdown/ConfigurableMarkdownContent.d.ts +172 -0
- package/dist/display/chat-markdown/ConfigurableMarkdownContent.js +649 -0
- package/dist/display/chat-markdown/InlineCodeSnippet.d.ts +19 -0
- package/dist/display/chat-markdown/InlineCodeSnippet.js +146 -0
- package/dist/display/chat-markdown/InlineCodeSnippetKindGate.d.ts +11 -0
- package/dist/display/chat-markdown/InlineCodeSnippetKindGate.js +9 -0
- package/dist/display/chat-markdown/KindTextGate.d.ts +31 -0
- package/dist/display/chat-markdown/KindTextGate.js +60 -0
- package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.d.ts +6 -0
- package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.js +92 -0
- package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.d.ts +72 -0
- package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.js +94 -0
- package/dist/display/chat-markdown/block-registry/BlockRenderer.d.ts +126 -0
- package/dist/display/chat-markdown/block-registry/BlockRenderer.js +473 -0
- package/dist/display/chat-markdown/block-registry/block-dispatch.d.ts +410 -0
- package/dist/display/chat-markdown/block-registry/block-dispatch.js +495 -0
- package/dist/display/chat-markdown/block-registry/json-parse-utils.d.ts +13 -0
- package/dist/display/chat-markdown/block-registry/json-parse-utils.js +236 -0
- package/dist/display/chat-markdown/constants.d.ts +14 -0
- package/dist/display/chat-markdown/constants.js +317 -0
- package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.d.ts +31 -0
- package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.js +62 -0
- package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.d.ts +12 -0
- package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.js +18 -0
- package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.d.ts +22 -0
- package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.js +130 -0
- package/dist/display/chat-markdown/diff-blocks/diff-style-registry.d.ts +21 -0
- package/dist/display/chat-markdown/diff-blocks/diff-style-registry.js +91 -0
- package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.d.ts +26 -0
- package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.js +186 -0
- package/dist/display/chat-markdown/diff-blocks/types.d.ts +56 -0
- package/dist/display/chat-markdown/diff-blocks/types.js +0 -0
- package/dist/display/chat-markdown/internal-handlers/BlockFallback.d.ts +20 -0
- package/dist/display/chat-markdown/internal-handlers/BlockFallback.js +83 -0
- package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.d.ts +4 -0
- package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.js +16 -0
- package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.d.ts +17 -0
- package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.js +40 -0
- package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.d.ts +8 -0
- package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.js +91 -0
- package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.d.ts +20 -0
- package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.js +72 -0
- package/dist/display/chat-markdown/kind-source-view.d.ts +14 -0
- package/dist/display/chat-markdown/kind-source-view.js +14 -0
- package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.d.ts +28 -0
- package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.js +65 -0
- package/dist/display/chat-markdown/progressive-mount.d.ts +18 -0
- package/dist/display/chat-markdown/progressive-mount.js +90 -0
- package/dist/display/chat-markdown/render-block-to-content-block.d.ts +31 -0
- package/dist/display/chat-markdown/render-block-to-content-block.js +32 -0
- package/dist/display/chat-markdown/settle-stream-blocks.d.ts +50 -0
- package/dist/display/chat-markdown/settle-stream-blocks.js +26 -0
- package/dist/display/chat-markdown/stable-blocks.d.ts +15 -0
- package/dist/display/chat-markdown/stable-blocks.js +54 -0
- package/dist/display/chat-markdown/types.d.ts +11 -0
- package/dist/display/chat-markdown/types.js +26 -0
- package/dist/display/specimen/SpecimenContext.d.ts +26 -0
- package/dist/display/specimen/SpecimenContext.js +64 -0
- package/dist/display/tables/MarkdownTable.d.ts +23 -0
- package/dist/display/tables/MarkdownTable.js +769 -0
- package/dist/display/tables/MarkdownTableScrollArea.d.ts +12 -0
- package/dist/display/tables/MarkdownTableScrollArea.js +92 -0
- package/dist/display/tables/SendToGoogleSheetButton.d.ts +19 -0
- package/dist/display/tables/SendToGoogleSheetButton.js +93 -0
- package/dist/display/tables/SendToWorkbookButton.d.ts +24 -0
- package/dist/display/tables/SendToWorkbookButton.js +93 -0
- package/dist/display/tables/TableSaveToMenu.d.ts +16 -0
- package/dist/display/tables/TableSaveToMenu.js +98 -0
- package/dist/display/tables/TableWithSeparatedControls.d.ts +22 -0
- package/dist/display/tables/TableWithSeparatedControls.js +574 -0
- package/dist/display/tables/ViewTableModal.d.ts +14 -0
- package/dist/display/tables/ViewTableModal.js +67 -0
- package/dist/display/tables/editing/ColumnActionsMenu.d.ts +16 -0
- package/dist/display/tables/editing/ColumnActionsMenu.js +80 -0
- package/dist/display/tables/editing/RowActionsMenu.d.ts +16 -0
- package/dist/display/tables/editing/RowActionsMenu.js +80 -0
- package/dist/display/tables/editing/TableEditToolbar.d.ts +15 -0
- package/dist/display/tables/editing/TableEditToolbar.js +63 -0
- package/dist/display/tables/editing/tableMutations.d.ts +50 -0
- package/dist/display/tables/editing/tableMutations.js +148 -0
- package/dist/display/tables/editing/useDoubleClickEdit.d.ts +43 -0
- package/dist/display/tables/editing/useDoubleClickEdit.js +51 -0
- package/dist/display/tables/editing/useTableUndo.d.ts +25 -0
- package/dist/display/tables/editing/useTableUndo.js +17 -0
- package/dist/display/tables/table-action-row.d.ts +8 -0
- package/dist/display/tables/table-action-row.js +31 -0
- package/dist/display/tables/table-viewer.d.ts +13 -0
- package/dist/display/tables/table-viewer.js +18 -0
- package/dist/host/ErrorActions.d.ts +1 -1
- package/dist/host/ErrorNotice.d.ts +10 -0
- package/dist/host/ErrorNotice.js +19 -0
- package/dist/host/app-bindings.d.ts +155 -0
- package/dist/host/app-bindings.js +160 -0
- package/dist/host/diagnostics.d.ts +2 -2
- package/dist/host/diagnostics.js +2 -1
- package/dist/host/tables.d.ts +1 -6
- package/dist/host/types.d.ts +14 -7
- package/dist/levels/RichContent.d.ts +3 -0
- package/dist/levels/RichContent.js +102 -0
- package/dist/levels/RichContentInline.d.ts +28 -0
- package/dist/levels/RichContentInline.js +61 -0
- package/dist/levels/RichContentPreview.d.ts +12 -0
- package/dist/levels/RichContentPreview.js +39 -0
- package/dist/levels/RichContentStandardImpl.d.ts +12 -0
- package/dist/levels/RichContentStandardImpl.js +27 -0
- package/dist/levels/RichContentStaticProse.d.ts +46 -0
- package/dist/levels/RichContentStaticProse.js +100 -0
- package/dist/levels/depth.d.ts +18 -0
- package/dist/levels/depth.js +32 -0
- package/dist/levels/prose/inline-level-elements.d.ts +19 -0
- package/dist/levels/prose/inline-level-elements.js +103 -0
- package/dist/levels/prose/prose-block-elements.d.ts +25 -0
- package/dist/levels/prose/prose-block-elements.js +313 -0
- package/dist/levels/prose/prose-inline-elements.d.ts +13 -0
- package/dist/levels/prose/prose-inline-elements.js +143 -0
- package/dist/levels/prose/prose-prepare.d.ts +50 -0
- package/dist/levels/prose/prose-prepare.js +246 -0
- package/dist/levels/prose/remote-image-policy.d.ts +34 -0
- package/dist/levels/prose/remote-image-policy.js +153 -0
- package/dist/levels/prose/variant-root.d.ts +9 -0
- package/dist/levels/prose/variant-root.js +34 -0
- package/dist/levels/rich-content-types.d.ts +93 -0
- package/dist/levels/rich-content-types.js +4 -0
- package/dist/levels/server/DelimiterViolationReport.d.ts +7 -0
- package/dist/levels/server/DelimiterViolationReport.js +24 -0
- package/dist/levels/server/RichContentServer.d.ts +27 -0
- package/dist/levels/server/RichContentServer.js +97 -0
- package/dist/levels/standard/NestedRichContent.d.ts +7 -0
- package/dist/levels/standard/NestedRichContent.js +70 -0
- package/dist/levels/standard/StandardBlocks.d.ts +13 -0
- package/dist/levels/standard/StandardBlocks.js +239 -0
- package/dist/levels/standard/StandardKindRegion.d.ts +14 -0
- package/dist/levels/standard/StandardKindRegion.js +69 -0
- package/dist/levels/standard/standard-kind-region.d.ts +19 -0
- package/dist/levels/standard/standard-kind-region.js +21 -0
- package/dist/levels/standard/static-standard.d.ts +23 -0
- package/dist/levels/standard/static-standard.js +187 -0
- package/dist/levels/standard/stream-holdback.d.ts +2 -0
- package/dist/levels/standard/stream-holdback.js +77 -0
- package/dist/mermaid/MermaidFullscreen.d.ts +17 -0
- package/dist/mermaid/MermaidFullscreen.js +71 -0
- package/dist/mermaid/MermaidRenderer.d.ts +20 -0
- package/dist/mermaid/MermaidRenderer.js +267 -0
- package/dist/mermaid/MermaidView.d.ts +27 -0
- package/dist/mermaid/MermaidView.js +68 -0
- package/dist/mermaid/MermaidViewport.d.ts +75 -0
- package/dist/mermaid/MermaidViewport.js +286 -0
- package/dist/mermaid/adapters/er.d.ts +10 -0
- package/dist/mermaid/adapters/er.js +205 -0
- package/dist/mermaid/adapters/flowchart.d.ts +17 -0
- package/dist/mermaid/adapters/flowchart.js +634 -0
- package/dist/mermaid/adapters/journey.d.ts +9 -0
- package/dist/mermaid/adapters/journey.js +207 -0
- package/dist/mermaid/adapters/mindmap.d.ts +12 -0
- package/dist/mermaid/adapters/mindmap.js +252 -0
- package/dist/mermaid/adapters/pie.d.ts +7 -0
- package/dist/mermaid/adapters/pie.js +172 -0
- package/dist/mermaid/adapters/quadrant.d.ts +8 -0
- package/dist/mermaid/adapters/quadrant.js +231 -0
- package/dist/mermaid/adapters/register.d.ts +7 -0
- package/dist/mermaid/adapters/register.js +19 -0
- package/dist/mermaid/adapters/sequence.d.ts +8 -0
- package/dist/mermaid/adapters/sequence.js +251 -0
- package/dist/mermaid/adapters/state.d.ts +12 -0
- package/dist/mermaid/adapters/state.js +245 -0
- package/dist/mermaid/adapters/timeline.d.ts +8 -0
- package/dist/mermaid/adapters/timeline.js +245 -0
- package/dist/mermaid/catalog.d.ts +33 -0
- package/dist/mermaid/catalog.js +202 -0
- package/dist/mermaid/diagram-type.d.ts +39 -0
- package/dist/mermaid/diagram-type.js +89 -0
- package/dist/mermaid/export.d.ts +21 -0
- package/dist/mermaid/export.js +112 -0
- package/dist/mermaid/extract-fence.d.ts +15 -0
- package/dist/mermaid/extract-fence.js +22 -0
- package/dist/mermaid/lazy-draw.d.ts +40 -0
- package/dist/mermaid/lazy-draw.js +168 -0
- package/dist/mermaid/model/adapter.d.ts +28 -0
- package/dist/mermaid/model/adapter.js +16 -0
- package/dist/mermaid/model/ops.d.ts +282 -0
- package/dist/mermaid/model/ops.js +9 -0
- package/dist/mermaid/model/round-trip.d.ts +22 -0
- package/dist/mermaid/model/round-trip.js +45 -0
- package/dist/mermaid/model/types.d.ts +271 -0
- package/dist/mermaid/model/types.js +0 -0
- package/dist/mermaid/print-render.d.ts +9 -0
- package/dist/mermaid/print-render.js +39 -0
- package/dist/mermaid/runtime.d.ts +25 -0
- package/dist/mermaid/runtime.js +183 -0
- package/dist/mermaid/sanitize.d.ts +46 -0
- package/dist/mermaid/sanitize.js +234 -0
- package/dist/mermaid/types.d.ts +43 -0
- package/dist/mermaid/types.js +21 -0
- package/dist/mermaid/view/ViewModePane.d.ts +24 -0
- package/dist/mermaid/view/ViewModePane.js +9 -0
- package/dist/utils/client-lazy.d.ts +1 -1
- package/dist/utils/client-lazy.js +4 -1
- package/dist/utils/lifted/DiffView.d.ts +10 -0
- package/dist/utils/lifted/DiffView.js +26 -0
- package/dist/utils/lifted/IconButton.d.ts +24 -0
- package/dist/utils/lifted/IconButton.js +43 -0
- package/dist/utils/lifted/MatrxMiniLoader.d.ts +1 -0
- package/dist/utils/lifted/MatrxMiniLoader.js +8 -0
- package/dist/utils/lifted/ShimmerText.d.ts +5 -0
- package/dist/utils/lifted/ShimmerText.js +21 -0
- package/dist/utils/lifted/SuspenseLoader.d.ts +16 -0
- package/dist/utils/lifted/SuspenseLoader.js +42 -0
- package/dist/utils/lifted/Tooltip.d.ts +20 -0
- package/dist/utils/lifted/Tooltip.js +52 -0
- package/dist/utils/lifted/artifactId.d.ts +34 -0
- package/dist/utils/lifted/artifactId.js +15 -0
- package/dist/utils/lifted/canvasContent.d.ts +63 -0
- package/dist/utils/lifted/canvasContent.js +98 -0
- package/dist/utils/lifted/captureReactError.d.ts +24 -0
- package/dist/utils/lifted/captureReactError.js +28 -0
- package/dist/utils/lifted/chunk-load-recovery.d.ts +25 -0
- package/dist/utils/lifted/chunk-load-recovery.js +36 -0
- package/dist/utils/lifted/code-editor-agent-types.d.ts +6 -0
- package/dist/utils/lifted/code-editor-agent-types.js +0 -0
- package/dist/utils/lifted/code-editor-agents.d.ts +39 -0
- package/dist/utils/lifted/code-editor-agents.js +52 -0
- package/dist/utils/lifted/code-language-extension.d.ts +1 -0
- package/dist/utils/lifted/code-language-extension.js +60 -0
- package/dist/utils/lifted/custom-icons.d.ts +16 -0
- package/dist/utils/lifted/custom-icons.js +47 -0
- package/dist/utils/lifted/durability.d.ts +16 -0
- package/dist/utils/lifted/durability.js +45 -0
- package/dist/utils/lifted/errors.d.ts +30 -0
- package/dist/utils/lifted/errors.js +29 -0
- package/dist/utils/lifted/html-document.d.ts +1 -0
- package/dist/utils/lifted/html-document.js +12 -0
- package/dist/utils/lifted/languageOptions.d.ts +9 -0
- package/dist/utils/lifted/languageOptions.js +52 -0
- package/dist/utils/lifted/languages.d.ts +34 -0
- package/dist/utils/lifted/languages.js +175 -0
- package/dist/utils/lifted/loading-spinner.d.ts +18 -0
- package/dist/utils/lifted/loading-spinner.js +200 -0
- package/dist/utils/lifted/media-refs.d.ts +13 -0
- package/dist/utils/lifted/media-refs.js +27 -0
- package/dist/utils/lifted/scroll-root.d.ts +1 -0
- package/dist/utils/lifted/scroll-root.js +25 -0
- package/dist/utils/lifted/syntax-themes.d.ts +32 -0
- package/dist/utils/lifted/syntax-themes.js +100 -0
- package/dist/utils/lifted/url-utm.d.ts +24 -0
- package/dist/utils/lifted/url-utm.js +66 -0
- package/dist/utils/lifted/use-is-mounted.d.ts +24 -0
- package/dist/utils/lifted/use-is-mounted.js +21 -0
- package/dist/utils/lifted/useToastManager.d.ts +1 -0
- package/dist/utils/lifted/useToastManager.js +7 -0
- package/dist/utils/report-kind-at-raw-renderer.d.ts +19 -0
- package/dist/utils/report-kind-at-raw-renderer.js +32 -0
- package/package.json +32 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface MarkdownTableScrollAreaProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The one horizontal viewport for Markdown tables. Native touch/trackpad
|
|
8
|
+
* scrolling remains available; the buttons make wide tables discoverable and
|
|
9
|
+
* operable for mouse and keyboard users without creating a vertical scroller.
|
|
10
|
+
*/
|
|
11
|
+
export declare function MarkdownTableScrollArea({ children, className, }: MarkdownTableScrollAreaProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
ChevronLeftTapButton,
|
|
6
|
+
ChevronRightTapButton
|
|
7
|
+
} from "@ai-matrx/tap-target/buttons";
|
|
8
|
+
import { cn } from "@ai-matrx/design-system";
|
|
9
|
+
const EDGE_TOLERANCE_PX = 2;
|
|
10
|
+
function MarkdownTableScrollArea({
|
|
11
|
+
children,
|
|
12
|
+
className
|
|
13
|
+
}) {
|
|
14
|
+
const viewportRef = useRef(null);
|
|
15
|
+
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
16
|
+
const [canScrollRight, setCanScrollRight] = useState(false);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const viewport = viewportRef.current;
|
|
19
|
+
if (!viewport) return;
|
|
20
|
+
const updateEdges = () => {
|
|
21
|
+
const maxScrollLeft = Math.max(
|
|
22
|
+
0,
|
|
23
|
+
viewport.scrollWidth - viewport.clientWidth
|
|
24
|
+
);
|
|
25
|
+
setCanScrollLeft(viewport.scrollLeft > EDGE_TOLERANCE_PX);
|
|
26
|
+
setCanScrollRight(
|
|
27
|
+
viewport.scrollLeft < maxScrollLeft - EDGE_TOLERANCE_PX
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
viewport.addEventListener("scroll", updateEdges, { passive: true });
|
|
31
|
+
const resizeObserver = new ResizeObserver(updateEdges);
|
|
32
|
+
resizeObserver.observe(viewport);
|
|
33
|
+
if (viewport.firstElementChild) {
|
|
34
|
+
resizeObserver.observe(viewport.firstElementChild);
|
|
35
|
+
}
|
|
36
|
+
return () => {
|
|
37
|
+
viewport.removeEventListener("scroll", updateEdges);
|
|
38
|
+
resizeObserver.disconnect();
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
41
|
+
const scroll = (direction) => {
|
|
42
|
+
const viewport = viewportRef.current;
|
|
43
|
+
if (!viewport) return;
|
|
44
|
+
viewport.scrollBy({
|
|
45
|
+
left: direction * Math.max(240, viewport.clientWidth * 0.75),
|
|
46
|
+
behavior: "smooth"
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const hasOverflow = canScrollLeft || canScrollRight;
|
|
50
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative min-w-0", "data-markdown-table-scroll-area": true, children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref: viewportRef,
|
|
55
|
+
className: cn("overflow-x-auto overscroll-x-contain", className),
|
|
56
|
+
tabIndex: hasOverflow ? 0 : void 0,
|
|
57
|
+
"aria-label": hasOverflow ? "Scrollable table" : void 0,
|
|
58
|
+
children
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
hasOverflow ? /* @__PURE__ */ jsxs(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: "flex justify-end",
|
|
65
|
+
"aria-label": "Table horizontal scroll controls",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
ChevronLeftTapButton,
|
|
69
|
+
{
|
|
70
|
+
variant: "transparent",
|
|
71
|
+
ariaLabel: "Scroll table left",
|
|
72
|
+
disabled: !canScrollLeft,
|
|
73
|
+
onClick: () => scroll(-1)
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
ChevronRightTapButton,
|
|
78
|
+
{
|
|
79
|
+
variant: "transparent",
|
|
80
|
+
ariaLabel: "Scroll table right",
|
|
81
|
+
disabled: !canScrollRight,
|
|
82
|
+
onClick: () => scroll(1)
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
) : null
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
MarkdownTableScrollArea
|
|
92
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface SendToGoogleSheetButtonProps {
|
|
2
|
+
headers: string[];
|
|
3
|
+
rows: string[][];
|
|
4
|
+
/** Display name for the sheet. Falls back to the first header / "Table". */
|
|
5
|
+
name?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/** The Google Sheet push as a hook, shared by the button and `TableSaveToMenu`. */
|
|
9
|
+
export declare function useSendToGoogleSheet({ headers, rows, name, }: {
|
|
10
|
+
headers: string[];
|
|
11
|
+
rows: string[][];
|
|
12
|
+
name?: string;
|
|
13
|
+
}): {
|
|
14
|
+
available: boolean;
|
|
15
|
+
pushing: boolean;
|
|
16
|
+
send: () => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export declare function SendToGoogleSheetButton({ headers, rows, name, className, }: SendToGoogleSheetButtonProps): import("react").JSX.Element | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Loader2, Sheet } from "lucide-react";
|
|
5
|
+
import { toast } from "../../host/toast.js";
|
|
6
|
+
import {
|
|
7
|
+
announceProposedGoogleWrite,
|
|
8
|
+
loadSendToGoogle,
|
|
9
|
+
isProposedGoogleWrite
|
|
10
|
+
} from "../../host/app-bindings.js";
|
|
11
|
+
import { Button } from "@ai-matrx/design-system";
|
|
12
|
+
function useSendToGoogleSheet({
|
|
13
|
+
headers,
|
|
14
|
+
rows,
|
|
15
|
+
name
|
|
16
|
+
}) {
|
|
17
|
+
const [pushing, setPushing] = useState(false);
|
|
18
|
+
const sheetName = name?.trim() || (headers[0] ? `Table: ${headers[0]}`.slice(0, 60) : "Table");
|
|
19
|
+
const send = async () => {
|
|
20
|
+
if (pushing || !headers.length) return;
|
|
21
|
+
setPushing(true);
|
|
22
|
+
try {
|
|
23
|
+
const { sendRowsToGoogleSheet } = await loadSendToGoogle();
|
|
24
|
+
const seen = /* @__PURE__ */ new Map();
|
|
25
|
+
const columnNames = headers.map((header, i) => {
|
|
26
|
+
const base = header || `Column ${i + 1}`;
|
|
27
|
+
const count = (seen.get(base) ?? 0) + 1;
|
|
28
|
+
seen.set(base, count);
|
|
29
|
+
return count === 1 ? base : `${base} (${count})`;
|
|
30
|
+
});
|
|
31
|
+
const records = rows.map(
|
|
32
|
+
(row) => Object.fromEntries(columnNames.map((col, i) => [col, row[i] ?? ""]))
|
|
33
|
+
);
|
|
34
|
+
const result = await sendRowsToGoogleSheet(records, sheetName);
|
|
35
|
+
if (!result.ok && result.reason === "failed") {
|
|
36
|
+
toast.error("Could not create the Google Sheet", {
|
|
37
|
+
description: result.message
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (isProposedGoogleWrite(result)) {
|
|
42
|
+
announceProposedGoogleWrite(result);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!result.ok) {
|
|
46
|
+
toast.info("Connect Google to send this to a Sheet", {
|
|
47
|
+
description: "Takes about ten seconds, and only for files you choose or that we create.",
|
|
48
|
+
action: {
|
|
49
|
+
label: "Connect",
|
|
50
|
+
onClick: () => window.open(String(result.settingsHref ?? ""), "_blank", "noopener")
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
toast.success(`Created "${result.name}" in your Google Drive`, {
|
|
56
|
+
action: result.openUrl ? {
|
|
57
|
+
label: "Open",
|
|
58
|
+
onClick: () => window.open(result.openUrl, "_blank", "noopener")
|
|
59
|
+
} : void 0
|
|
60
|
+
});
|
|
61
|
+
} finally {
|
|
62
|
+
setPushing(false);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return { available: headers.length > 0, pushing, send };
|
|
66
|
+
}
|
|
67
|
+
function SendToGoogleSheetButton({
|
|
68
|
+
headers,
|
|
69
|
+
rows,
|
|
70
|
+
name,
|
|
71
|
+
className
|
|
72
|
+
}) {
|
|
73
|
+
const sheet = useSendToGoogleSheet({ headers, rows, ...name !== void 0 ? { name } : {} });
|
|
74
|
+
if (!sheet.available) return null;
|
|
75
|
+
return /* @__PURE__ */ jsxs(
|
|
76
|
+
Button,
|
|
77
|
+
{
|
|
78
|
+
variant: "outline",
|
|
79
|
+
size: "sm",
|
|
80
|
+
onClick: () => void sheet.send(),
|
|
81
|
+
disabled: sheet.pushing,
|
|
82
|
+
className: className ?? "flex items-center gap-2",
|
|
83
|
+
children: [
|
|
84
|
+
sheet.pushing ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Sheet, { className: "h-4 w-4" }),
|
|
85
|
+
"Google Sheet"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
SendToGoogleSheetButton,
|
|
92
|
+
useSendToGoogleSheet
|
|
93
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface SendToWorkbookButtonProps {
|
|
2
|
+
headers: string[];
|
|
3
|
+
rows: string[][];
|
|
4
|
+
/** Display name for the workbook. Falls back to the first header / "Table". */
|
|
5
|
+
name?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The workbook push as a hook, so a menu item can run it while the success
|
|
10
|
+
* dialog lives outside the menu (a closed menu would unmount it). The button
|
|
11
|
+
* below and `TableSaveToMenu` both use it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useSendToWorkbook({ headers, rows, name, }: {
|
|
14
|
+
headers: string[];
|
|
15
|
+
rows: string[][];
|
|
16
|
+
name?: string;
|
|
17
|
+
}): {
|
|
18
|
+
available: boolean;
|
|
19
|
+
pushing: boolean;
|
|
20
|
+
send: () => Promise<void>;
|
|
21
|
+
dialog: import("react").JSX.Element;
|
|
22
|
+
};
|
|
23
|
+
export declare function SendToWorkbookButton({ headers, rows, name, className, }: SendToWorkbookButtonProps): import("react").JSX.Element | null;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { FileSpreadsheet, Loader2 } from "lucide-react";
|
|
5
|
+
import { toast } from "../../host/toast.js";
|
|
6
|
+
import {
|
|
7
|
+
ensureOrganizationContext,
|
|
8
|
+
loadExportTargets,
|
|
9
|
+
isOrganizationSelectionCancelled
|
|
10
|
+
} from "../../host/app-bindings.js";
|
|
11
|
+
import { Button } from "@ai-matrx/design-system";
|
|
12
|
+
import { OpenDestinationDialog } from "../../host/app-bindings.js";
|
|
13
|
+
function useSendToWorkbook({
|
|
14
|
+
headers,
|
|
15
|
+
rows,
|
|
16
|
+
name
|
|
17
|
+
}) {
|
|
18
|
+
const [pushing, setPushing] = useState(false);
|
|
19
|
+
const [created, setCreated] = useState(null);
|
|
20
|
+
const workbookName = name?.trim() || (headers[0] ? `Table: ${headers[0]}`.slice(0, 60) : "Table");
|
|
21
|
+
const send = async () => {
|
|
22
|
+
if (pushing || !headers.length) return;
|
|
23
|
+
setPushing(true);
|
|
24
|
+
try {
|
|
25
|
+
const organizationId = await ensureOrganizationContext();
|
|
26
|
+
const { pushTableToWorkbook } = await loadExportTargets();
|
|
27
|
+
const res = await pushTableToWorkbook(
|
|
28
|
+
{
|
|
29
|
+
name: workbookName,
|
|
30
|
+
headers,
|
|
31
|
+
rows
|
|
32
|
+
},
|
|
33
|
+
organizationId
|
|
34
|
+
);
|
|
35
|
+
if (!res.ok || !res.href) {
|
|
36
|
+
toast.error("Could not create workbook", { description: res.error });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
setCreated({ route: res.href, title: "Workbook created" });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
if (!isOrganizationSelectionCancelled(error)) {
|
|
42
|
+
toast.error("Could not create workbook", {
|
|
43
|
+
description: error instanceof Error ? error.message : String(error)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
} finally {
|
|
47
|
+
setPushing(false);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const dialog = /* @__PURE__ */ jsx(
|
|
51
|
+
OpenDestinationDialog,
|
|
52
|
+
{
|
|
53
|
+
open: created !== null,
|
|
54
|
+
onOpenChange: (o) => {
|
|
55
|
+
if (!o) setCreated(null);
|
|
56
|
+
},
|
|
57
|
+
title: created?.title ?? "",
|
|
58
|
+
resourceName: workbookName,
|
|
59
|
+
route: created?.route ?? "/"
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
return { available: headers.length > 0, pushing, send, dialog };
|
|
63
|
+
}
|
|
64
|
+
function SendToWorkbookButton({
|
|
65
|
+
headers,
|
|
66
|
+
rows,
|
|
67
|
+
name,
|
|
68
|
+
className
|
|
69
|
+
}) {
|
|
70
|
+
const workbook = useSendToWorkbook({ headers, rows, ...name !== void 0 ? { name } : {} });
|
|
71
|
+
if (!workbook.available) return null;
|
|
72
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ jsxs(
|
|
74
|
+
Button,
|
|
75
|
+
{
|
|
76
|
+
variant: "outline",
|
|
77
|
+
size: "sm",
|
|
78
|
+
onClick: () => void workbook.send(),
|
|
79
|
+
disabled: workbook.pushing,
|
|
80
|
+
className: className ?? "flex items-center gap-2 hover:bg-blue-100 dark:hover:bg-blue-800/30",
|
|
81
|
+
children: [
|
|
82
|
+
workbook.pushing ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(FileSpreadsheet, { className: "h-4 w-4" }),
|
|
83
|
+
"Workbook"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
workbook.dialog
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
SendToWorkbookButton,
|
|
92
|
+
useSendToWorkbook
|
|
93
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "A table…" is THE one "Save to a table" (lane SAVE-AS-TABLE-EVERYWHERE, 2026-09-29): the
|
|
3
|
+
* `saveToTable` overlay — a new table with its columns' types proposed, or these rows added to a
|
|
4
|
+
* table the person has, columns matched. It replaced the two writes this menu used to carry ("A
|
|
5
|
+
* live table" for a chat artifact, "A data table" for everything else), each with its own dialog.
|
|
6
|
+
*/
|
|
7
|
+
export declare function TableSaveToMenu({ headers, rows, title, resolveTitle, onSaved, }: {
|
|
8
|
+
headers: string[];
|
|
9
|
+
rows: string[][];
|
|
10
|
+
/** The name a new table is offered (the conversation, the artifact). */
|
|
11
|
+
title?: string | null;
|
|
12
|
+
/** Or a name worked out when the person asks (read before the screen opens). */
|
|
13
|
+
resolveTitle?: () => Promise<string | null>;
|
|
14
|
+
/** The rows landed in this table — a chat artifact links itself to it and becomes live. */
|
|
15
|
+
onSaved?: (tableId: string, how: "new" | "existing") => void | Promise<void>;
|
|
16
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown, Database, FileSpreadsheet, Loader2, Sheet, Table2 } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Button } from "@ai-matrx/design-system";
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenu,
|
|
8
|
+
DropdownMenuContent,
|
|
9
|
+
DropdownMenuItem,
|
|
10
|
+
DropdownMenuTrigger
|
|
11
|
+
} from "@ai-matrx/design-system";
|
|
12
|
+
import { useOpenSaveToTable } from "../../host/tables.js";
|
|
13
|
+
import { useSendToWorkbook } from "./SendToWorkbookButton.js";
|
|
14
|
+
import { useSendToGoogleSheet } from "./SendToGoogleSheetButton.js";
|
|
15
|
+
function TableSaveToMenu({
|
|
16
|
+
headers,
|
|
17
|
+
rows,
|
|
18
|
+
title,
|
|
19
|
+
resolveTitle,
|
|
20
|
+
onSaved
|
|
21
|
+
}) {
|
|
22
|
+
const workbook = useSendToWorkbook({ headers, rows });
|
|
23
|
+
const sheet = useSendToGoogleSheet({ headers, rows });
|
|
24
|
+
const openSaveToTable = useOpenSaveToTable();
|
|
25
|
+
const [naming, setNaming] = useState(false);
|
|
26
|
+
const busy = workbook.pushing || sheet.pushing || naming;
|
|
27
|
+
if (!headers.length) return null;
|
|
28
|
+
const saveAsTable = async () => {
|
|
29
|
+
let name = title ?? null;
|
|
30
|
+
if (resolveTitle) {
|
|
31
|
+
setNaming(true);
|
|
32
|
+
try {
|
|
33
|
+
name = await resolveTitle() ?? name;
|
|
34
|
+
} catch {
|
|
35
|
+
} finally {
|
|
36
|
+
setNaming(false);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
openSaveToTable?.({
|
|
40
|
+
grid: { headers, rows },
|
|
41
|
+
title: name,
|
|
42
|
+
...onSaved ? { onSaved: (event) => onSaved(event.tableId, event.how) } : {}
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
48
|
+
Button,
|
|
49
|
+
{
|
|
50
|
+
variant: "outline",
|
|
51
|
+
size: "sm",
|
|
52
|
+
"data-keep-label": "",
|
|
53
|
+
"aria-label": "Save this table to\u2026",
|
|
54
|
+
className: "h-7 gap-1 px-2 text-xs",
|
|
55
|
+
children: [
|
|
56
|
+
busy ? /* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": true }) : /* @__PURE__ */ jsx(Database, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
57
|
+
"Save to",
|
|
58
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5", "aria-hidden": true })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
) }),
|
|
62
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [
|
|
63
|
+
openSaveToTable ? /* @__PURE__ */ jsxs(DropdownMenuItem, { disabled: naming, onSelect: () => void saveAsTable(), className: "gap-2", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Table2, { className: "h-4 w-4" }),
|
|
65
|
+
" A table\u2026"
|
|
66
|
+
] }) : null,
|
|
67
|
+
/* @__PURE__ */ jsxs(
|
|
68
|
+
DropdownMenuItem,
|
|
69
|
+
{
|
|
70
|
+
disabled: workbook.pushing,
|
|
71
|
+
onSelect: () => void workbook.send(),
|
|
72
|
+
className: "gap-2",
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(FileSpreadsheet, { className: "h-4 w-4" }),
|
|
75
|
+
" A workbook"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ jsxs(
|
|
80
|
+
DropdownMenuItem,
|
|
81
|
+
{
|
|
82
|
+
disabled: sheet.pushing,
|
|
83
|
+
onSelect: () => void sheet.send(),
|
|
84
|
+
className: "gap-2",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(Sheet, { className: "h-4 w-4" }),
|
|
87
|
+
" A Google Sheet"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
] })
|
|
92
|
+
] }),
|
|
93
|
+
workbook.dialog
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
TableSaveToMenu
|
|
98
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type DisplayTheme } from "../themes.js";
|
|
3
|
+
interface MarkdownTableProps {
|
|
4
|
+
data: {
|
|
5
|
+
headers: string[];
|
|
6
|
+
rows: string[][];
|
|
7
|
+
normalizedData?: Array<{
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
className?: string;
|
|
12
|
+
fontSize?: number;
|
|
13
|
+
theme?: DisplayTheme;
|
|
14
|
+
onSave?: (tableData: {
|
|
15
|
+
headers: string[];
|
|
16
|
+
rows: string[][];
|
|
17
|
+
}) => void;
|
|
18
|
+
content?: string;
|
|
19
|
+
onContentChange?: (updatedMarkdown: string) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const MarkdownTable: React.FC<MarkdownTableProps>;
|
|
22
|
+
export default MarkdownTable;
|