@pstdio/ui 0.0.1
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/.storybook/main.ts +28 -0
- package/.storybook/preview.tsx +28 -0
- package/.storybook/vitest.setup.ts +6 -0
- package/README.md +72 -0
- package/package.json +91 -0
- package/src/components/alert.tsx +27 -0
- package/src/components/breadcrumb.stories.tsx +40 -0
- package/src/components/breadcrumb.tsx +67 -0
- package/src/components/button.stories.tsx +151 -0
- package/src/components/chat-ui/agent-types.ts +231 -0
- package/src/components/chat-ui/components/ai-conversation.stories.tsx +49 -0
- package/src/components/chat-ui/components/ai-conversation.tsx +68 -0
- package/src/components/chat-ui/components/ai-message.stories.tsx +60 -0
- package/src/components/chat-ui/components/ai-message.tsx +103 -0
- package/src/components/chat-ui/components/ai-response.stories.tsx +48 -0
- package/src/components/chat-ui/components/ai-response.tsx +19 -0
- package/src/components/chat-ui/components/approval-prompt.tsx +51 -0
- package/src/components/chat-ui/components/attachment-list.stories.tsx +24 -0
- package/src/components/chat-ui/components/attachment-list.tsx +76 -0
- package/src/components/chat-ui/components/auto-scroll.tsx +42 -0
- package/src/components/chat-ui/components/chat-input.stories.tsx +114 -0
- package/src/components/chat-ui/components/chat-input.tsx +142 -0
- package/src/components/chat-ui/components/chat-panel.stories.tsx +396 -0
- package/src/components/chat-ui/components/chat-panel.tsx +97 -0
- package/src/components/chat-ui/components/message-parts-renderer.stories.tsx +59 -0
- package/src/components/chat-ui/components/message-parts-renderer.tsx +133 -0
- package/src/components/chat-ui/components/message-types.ts +40 -0
- package/src/components/chat-ui/components/model-swap-separator.stories.tsx +27 -0
- package/src/components/chat-ui/components/model-swap-separator.tsx +20 -0
- package/src/components/chat-ui/components/send-button.tsx +56 -0
- package/src/components/chat-ui/components/timeline.tsx +414 -0
- package/src/components/chat-ui/components/tool-invocation-timeline.stories.tsx +32 -0
- package/src/components/chat-ui/components/tool-invocation-timeline.tsx +16 -0
- package/src/components/chat-ui/mocks/full-conversation-normalized.json +3557 -0
- package/src/components/chat-ui/tool-rendering/build-timeline.ts +127 -0
- package/src/components/chat-ui/tool-rendering/default-renderers.ts +420 -0
- package/src/components/chat-ui/tool-rendering/index.ts +3 -0
- package/src/components/chat-ui/tool-rendering/types.ts +19 -0
- package/src/components/chat-ui/utils/diff.ts +228 -0
- package/src/components/chat-ui/utils/editor-state.ts +5 -0
- package/src/components/chat-ui/utils/get-icon.ts +81 -0
- package/src/components/code-editor.tsx +147 -0
- package/src/components/column-file-browser.stories.tsx +217 -0
- package/src/components/column-file-browser.tsx +380 -0
- package/src/components/content-placeholder.tsx +21 -0
- package/src/components/data-table/build-columns.tsx +78 -0
- package/src/components/data-table/data-table.css +51 -0
- package/src/components/data-table/data-table.stories.tsx +209 -0
- package/src/components/data-table/data-table.tsx +232 -0
- package/src/components/data-table/helpers.tsx +69 -0
- package/src/components/data-table/index.ts +3 -0
- package/src/components/data-table/pagination-footer.tsx +58 -0
- package/src/components/data-table/selection-toolbar.tsx +26 -0
- package/src/components/data-table/types.ts +21 -0
- package/src/components/delete-confirmation-modal.stories.tsx +46 -0
- package/src/components/delete-confirmation-modal.tsx +56 -0
- package/src/components/diff-bubble.stories.tsx +70 -0
- package/src/components/diff-bubble.tsx +70 -0
- package/src/components/diff-card.tsx +139 -0
- package/src/components/diff-drawer.stories.tsx +106 -0
- package/src/components/diff-drawer.tsx +59 -0
- package/src/components/diff-editor.tsx +55 -0
- package/src/components/drawer-inline.stories.tsx +124 -0
- package/src/components/drawer-inline.tsx +90 -0
- package/src/components/empty-state.stories.tsx +65 -0
- package/src/components/empty-state.tsx +28 -0
- package/src/components/error-boundary.tsx +80 -0
- package/src/components/file-selector.stories.tsx +166 -0
- package/src/components/file-selector.tsx +192 -0
- package/src/components/file-tree-helpers.ts +28 -0
- package/src/components/horizontal-menu-stack.tsx +15 -0
- package/src/components/info-card.stories.tsx +120 -0
- package/src/components/info-card.tsx +60 -0
- package/src/components/item-section.stories.tsx +57 -0
- package/src/components/item-section.tsx +57 -0
- package/src/components/layout.stories.tsx +341 -0
- package/src/components/layout.tsx +67 -0
- package/src/components/menu-item.stories.tsx +162 -0
- package/src/components/menu-item.tsx +207 -0
- package/src/components/number-input.tsx +21 -0
- package/src/components/open-source-notices-screen.stories.tsx +69 -0
- package/src/components/open-source-notices-screen.tsx +154 -0
- package/src/components/panel-menu.stories.tsx +44 -0
- package/src/components/panel-menu.tsx +27 -0
- package/src/components/param-editor-color-input.tsx +98 -0
- package/src/components/param-editor-date-input.tsx +106 -0
- package/src/components/param-editor-horizontal-text-input.tsx +130 -0
- package/src/components/param-editor-horizontal.stories.tsx +545 -0
- package/src/components/param-editor-horizontal.tsx +137 -0
- package/src/components/param-editor-input-group.tsx +145 -0
- package/src/components/param-editor-number-input.tsx +145 -0
- package/src/components/param-editor-selection-input.tsx +181 -0
- package/src/components/param-editor-text-input.tsx +113 -0
- package/src/components/param-editor.stories.tsx +986 -0
- package/src/components/param-editor.tsx +142 -0
- package/src/components/param-editor.types.ts +95 -0
- package/src/components/properties.stories.tsx +108 -0
- package/src/components/properties.tsx +73 -0
- package/src/components/pstdio-logo.tsx +26 -0
- package/src/components/resource-badge.stories.tsx +26 -0
- package/src/components/resource-badge.tsx +173 -0
- package/src/components/rich-text/collaborative-markdown-editor/awareness-cursors.tsx +45 -0
- package/src/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.stories.tsx +230 -0
- package/src/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.tsx +131 -0
- package/src/components/rich-text/index.ts +14 -0
- package/src/components/rich-text/markdown-editor/markdown-editor.stories.tsx +147 -0
- package/src/components/rich-text/markdown-editor/markdown-editor.tsx +112 -0
- package/src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkNode.tsx +100 -0
- package/src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.ts +32 -0
- package/src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/index.ts +2 -0
- package/src/components/rich-text/prompt-input/commands.ts +44 -0
- package/src/components/rich-text/prompt-input/events.ts +21 -0
- package/src/components/rich-text/prompt-input/plugins/CommentPlugin/CommentPlugin.tsx +8 -0
- package/src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentCommands.ts +49 -0
- package/src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentSchema.ts +30 -0
- package/src/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.tsx +127 -0
- package/src/components/rich-text/prompt-input/plugins/ImperativeAPIPlugin.tsx +32 -0
- package/src/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.tsx +30 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuOption.ts +15 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.tsx +88 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenu.tsx +90 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenuItem.tsx +50 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/constants.ts +3 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.tsx +50 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/checkForTriggers.ts +45 -0
- package/src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/getSortedMenuOptions.ts +20 -0
- package/src/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.tsx +50 -0
- package/src/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.tsx +107 -0
- package/src/components/rich-text/prompt-input/plugins/keyboard-shortcuts.ts +13 -0
- package/src/components/rich-text/prompt-input/prompt-input.stories.tsx +87 -0
- package/src/components/rich-text/prompt-input/prompt-input.tsx +106 -0
- package/src/components/rich-text/prompt-input/theme/prompt-input-theme.css +3 -0
- package/src/components/rich-text/prompt-input/theme/prompt-input-theme.ts +11 -0
- package/src/components/rich-text/prompt-input/utils.ts +158 -0
- package/src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkNode.tsx +100 -0
- package/src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.ts +32 -0
- package/src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/index.ts +2 -0
- package/src/components/rich-text/rich-message/rich-message.stories.tsx +146 -0
- package/src/components/rich-text/rich-message/rich-message.tsx +118 -0
- package/src/components/rich-text/shared/components/content-editable.tsx +28 -0
- package/src/components/rich-text/shared/components/default-rich-text-components.tsx +99 -0
- package/src/components/rich-text/shared/editor-config.ts +38 -0
- package/src/components/rich-text/shared/nodes/DataTableNode.stories.tsx +52 -0
- package/src/components/rich-text/shared/nodes/DataTableNode.tsx +73 -0
- package/src/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.tsx +22 -0
- package/src/components/rich-text/shared/plugins/CodePlugin/CodeNode.tsx +57 -0
- package/src/components/rich-text/shared/plugins/EquationPlugin/EquationComponent.tsx +46 -0
- package/src/components/rich-text/shared/plugins/EquationPlugin/EquationNode.tsx +161 -0
- package/src/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.css +16 -0
- package/src/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.tsx +45 -0
- package/src/components/rich-text/shared/plugins/EquationPlugin/KatexRenderer.tsx +40 -0
- package/src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatToolbarPlugin.css +26 -0
- package/src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatToolbarPlugin.tsx +414 -0
- package/src/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/index.ts +1 -0
- package/src/components/rich-text/shared/plugins/HorizontalRulePlugin/HorizontalRuleNode.ts +52 -0
- package/src/components/rich-text/shared/plugins/HorizontalRulePlugin/horizontalRule.ts +16 -0
- package/src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkEditorPlugin.css +163 -0
- package/src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkEditorPlugin.tsx +355 -0
- package/src/components/rich-text/shared/plugins/LinkEditorPlugin/LinkPlugin.tsx +6 -0
- package/src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/getSelectedNode.ts +17 -0
- package/src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.ts +39 -0
- package/src/components/rich-text/shared/plugins/LinkEditorPlugin/utils/url.ts +23 -0
- package/src/components/rich-text/shared/plugins/StateUpdatePlugin.tsx +21 -0
- package/src/components/rich-text/shared/plugins/TableActionMenuPlugin/TableActionMenuPlugin.tsx +224 -0
- package/src/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.css +3 -0
- package/src/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.tsx +315 -0
- package/src/components/rich-text/shared/plugins/ToggleEditablePlugin.tsx +12 -0
- package/src/components/rich-text/shared/plugins/TreeViewPlugin/TreeViewPlugin.tsx +20 -0
- package/src/components/rich-text/shared/transformers/markdown-transformers.ts +123 -0
- package/src/components/rich-text/shared/types/rich-text-components.ts +17 -0
- package/src/components/rich-text/theme/report-theme.tsx +81 -0
- package/src/components/rich-text/theme/rich-text-theme.css +773 -0
- package/src/components/rich-text/theme/rich-text-theme.tsx +81 -0
- package/src/components/rich-text/types.ts +9 -0
- package/src/components/rich-text/utils/inferResourceType.ts +17 -0
- package/src/components/rich-text/utils/markdown.ts +12 -0
- package/src/components/rich-text/utils/mediaType.ts +31 -0
- package/src/components/session-indicator.stories.tsx +46 -0
- package/src/components/session-indicator.tsx +40 -0
- package/src/components/slider.stories.tsx +38 -0
- package/src/components/slider.tsx +20 -0
- package/src/components/style-guide-data.ts +374 -0
- package/src/components/style-guide.stories.tsx +212 -0
- package/src/components/style-guide.tsx +305 -0
- package/src/components/ticket-board.stories.tsx +109 -0
- package/src/components/ticket-board.tsx +167 -0
- package/src/components/ticket-card.stories.tsx +133 -0
- package/src/components/ticket-card.tsx +126 -0
- package/src/components/toaster.stories.tsx +79 -0
- package/src/components/toaster.tsx +26 -0
- package/src/components/tooltip.tsx +43 -0
- package/src/index.ts +16 -0
- package/src/theme/global.ts +49 -0
- package/src/theme/index.ts +10 -0
- package/src/theme/primitives/colors.ts +209 -0
- package/src/theme/primitives/fonts.ts +33 -0
- package/src/theme/primitives/sizes.ts +49 -0
- package/src/theme/recipes/alert.ts +12 -0
- package/src/theme/recipes/button.ts +124 -0
- package/src/theme/recipes/dialog.ts +11 -0
- package/src/theme/recipes/divider.ts +7 -0
- package/src/theme/recipes/drawer.ts +16 -0
- package/src/theme/recipes/editable.ts +42 -0
- package/src/theme/recipes/form.ts +11 -0
- package/src/theme/recipes/input.ts +25 -0
- package/src/theme/recipes/menu.ts +40 -0
- package/src/theme/recipes/popover.ts +46 -0
- package/src/theme/recipes/progress-circle.ts +22 -0
- package/src/theme/recipes/skeleton.ts +8 -0
- package/src/theme/recipes/textarea.ts +29 -0
- package/src/theme/recipes/tooltip.ts +15 -0
- package/src/theme/theme.ts +70 -0
- package/src/theme/tokens/borders.ts +38 -0
- package/src/theme/tokens/colors.ts +488 -0
- package/src/theme/tokens/layer-styles.ts +15 -0
- package/src/theme/tokens/shadows.ts +47 -0
- package/src/theme/tokens/text.ts +236 -0
- package/src/utils/apply-theme-preference.ts +17 -0
- package/src/utils/formats.ts +27 -0
- package/src/utils/get-file-type-icon.ts +52 -0
- package/src/utils/theme-preference.tsx +60 -0
- package/src/vite-env.d.ts +6 -0
- package/storybook-static/assets/CodeBlockPlugin-C3OWpvP8.js +281 -0
- package/storybook-static/assets/CodeBlockPlugin-e2vWgtYm.css +1 -0
- package/storybook-static/assets/DataTableNode.stories-DLgTftOI.js +33 -0
- package/storybook-static/assets/EquationComponent-CUFxwyNf.js +1 -0
- package/storybook-static/assets/EquationComponent-DWZwfaVI.css +1 -0
- package/storybook-static/assets/FloatingTextFormatToolbarPlugin-B6jc8xvg.js +1 -0
- package/storybook-static/assets/FloatingTextFormatToolbarPlugin-D2l3--Te.css +1 -0
- package/storybook-static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/storybook-static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/storybook-static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/storybook-static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/storybook-static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/storybook-static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/storybook-static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/storybook-static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/storybook-static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/storybook-static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/storybook-static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/storybook-static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/storybook-static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/storybook-static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/storybook-static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/storybook-static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/storybook-static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/storybook-static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/storybook-static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/storybook-static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/storybook-static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/storybook-static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/storybook-static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/storybook-static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/storybook-static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/storybook-static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/storybook-static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/storybook-static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/storybook-static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/storybook-static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/storybook-static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/storybook-static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/storybook-static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/storybook-static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/storybook-static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/storybook-static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/storybook-static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/storybook-static/assets/LexicalHistoryPlugin.prod-BQAibkDj.js +1 -0
- package/storybook-static/assets/TreeViewPlugin-CyVKCrKJ.js +24 -0
- package/storybook-static/assets/ai-conversation-DcjS--ee.js +1 -0
- package/storybook-static/assets/ai-conversation.stories-COjWuS8V.js +3 -0
- package/storybook-static/assets/ai-message-DLdAGhWH.js +1 -0
- package/storybook-static/assets/ai-message.stories-CRTyreKL.js +3 -0
- package/storybook-static/assets/ai-response-ySM6s0iN.js +1 -0
- package/storybook-static/assets/ai-response.stories-DVBYlrGf.js +11 -0
- package/storybook-static/assets/attachment-list-1p1601I5.js +1 -0
- package/storybook-static/assets/attachment-list.stories-Cydlsnio.js +7 -0
- package/storybook-static/assets/badge-CtgJasjB.js +1 -0
- package/storybook-static/assets/breadcrumb.stories-SAjB-iqH.js +5 -0
- package/storybook-static/assets/button-C7it2n8t.js +1 -0
- package/storybook-static/assets/button.stories-BMVbbb4y.js +72 -0
- package/storybook-static/assets/chat-input-B-915nCM.js +1 -0
- package/storybook-static/assets/chat-input.stories-DrxvpT9p.js +32 -0
- package/storybook-static/assets/chat-panel.stories-D0L6eIte.js +96 -0
- package/storybook-static/assets/chevron-down-BYCAGyCV.js +1 -0
- package/storybook-static/assets/chevron-right-owK1wZnx.js +1 -0
- package/storybook-static/assets/collaborative-markdown-editor-Bj0GvTvv.js +41 -0
- package/storybook-static/assets/collaborative-markdown-editor.stories-B_MUIC5s.js +11 -0
- package/storybook-static/assets/collapsible-DBDG7h1r.js +1 -0
- package/storybook-static/assets/collapsible-content-B1Uq3jUM.js +1 -0
- package/storybook-static/assets/column-file-browser.stories-DPMQnHCw.js +54 -0
- package/storybook-static/assets/compiler-runtime-BXE7OOXE.js +1 -0
- package/storybook-static/assets/computed-style-C0hzrq9-.js +1 -0
- package/storybook-static/assets/create-recipe-context-BU56IzEo.js +1 -0
- package/storybook-static/assets/create-slot-recipe-context-DAhDE6G_.js +1 -0
- package/storybook-static/assets/create-split-props-u5h9OPvL.js +1 -0
- package/storybook-static/assets/createLucideIcon-CcBBUKX8.js +1 -0
- package/storybook-static/assets/data-table-vuIeWXui.css +1 -0
- package/storybook-static/assets/data-table.stories-Cs-q7dpj.js +19 -0
- package/storybook-static/assets/delete-confirmation-modal.stories-C8vDKFRD.js +14 -0
- package/storybook-static/assets/diff-bubble-_zZypMRt.js +1 -0
- package/storybook-static/assets/diff-bubble.stories-DfonanIk.js +39 -0
- package/storybook-static/assets/diff-drawer.stories-CGDWiKD8.js +38 -0
- package/storybook-static/assets/diff-editor-DV9BXqbn.js +11 -0
- package/storybook-static/assets/dismissable-layer-Cc5dFRd8.js +1 -0
- package/storybook-static/assets/drawer-inline.stories-B3Tp7vjL.js +88 -0
- package/storybook-static/assets/empty-state-BXkyq69k.js +1 -0
- package/storybook-static/assets/empty-state.stories-6eYYBOWR.js +29 -0
- package/storybook-static/assets/factory-BR3bc_RM.js +1 -0
- package/storybook-static/assets/factory-DAJZwK4o.js +1 -0
- package/storybook-static/assets/file-selector.stories-PKIGBUd5.js +31 -0
- package/storybook-static/assets/file-text-D5m8MJlG.js +1 -0
- package/storybook-static/assets/flex-DAJL4AFZ.js +1 -0
- package/storybook-static/assets/folder-C5dba_Co.js +1 -0
- package/storybook-static/assets/form-D_Xln9tK.js +1 -0
- package/storybook-static/assets/full-conversation-normalized-LUbl1coD.js +1 -0
- package/storybook-static/assets/grid-7OIKBlfh.js +1 -0
- package/storybook-static/assets/h-stack-DWHd8f97.js +1 -0
- package/storybook-static/assets/horizontal-menu-stack-Cph6x7ui.js +1 -0
- package/storybook-static/assets/icon-C8FN9JqD.js +1 -0
- package/storybook-static/assets/icon-button-DHiUe7rR.js +1 -0
- package/storybook-static/assets/icons-WRA1cA-W.js +1 -0
- package/storybook-static/assets/iframe-2XPD_vrQ.css +1 -0
- package/storybook-static/assets/iframe-B8FSoBNY.js +1075 -0
- package/storybook-static/assets/index-B0y2_lLF.js +1 -0
- package/storybook-static/assets/index-CXwl6T4k.js +1 -0
- package/storybook-static/assets/index-DaXC_qY_.js +1 -0
- package/storybook-static/assets/index-DpB4ozcR.js +1 -0
- package/storybook-static/assets/index-cFwdnc0b.js +1 -0
- package/storybook-static/assets/info-DlgY5-DW.js +1 -0
- package/storybook-static/assets/info-card.stories-Cry0Qfrn.js +55 -0
- package/storybook-static/assets/input-ZSs5cSFQ.js +1 -0
- package/storybook-static/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- package/storybook-static/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- package/storybook-static/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- package/storybook-static/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- package/storybook-static/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- package/storybook-static/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- package/storybook-static/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- package/storybook-static/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- package/storybook-static/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- package/storybook-static/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- package/storybook-static/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- package/storybook-static/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- package/storybook-static/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- package/storybook-static/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- package/storybook-static/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- package/storybook-static/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- package/storybook-static/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/storybook-static/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/storybook-static/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/storybook-static/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/storybook-static/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- package/storybook-static/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- package/storybook-static/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- package/storybook-static/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- package/storybook-static/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- package/storybook-static/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- package/storybook-static/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- package/storybook-static/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- package/storybook-static/assets/item-section-AoQrVPNJ.js +1 -0
- package/storybook-static/assets/item-section.stories-kYTPHRsx.js +24 -0
- package/storybook-static/assets/layout.stories-DhSjwzU1.js +3 -0
- package/storybook-static/assets/link-DE5grRtm.js +1 -0
- package/storybook-static/assets/markdown-BLUemkxK.js +1 -0
- package/storybook-static/assets/markdown-editor-Y4eMsgVb.js +1 -0
- package/storybook-static/assets/markdown-editor.stories-DIWw-hRP.js +115 -0
- package/storybook-static/assets/menu-item-CrqDaj9K.js +1 -0
- package/storybook-static/assets/menu-item.stories-D9Isjjrf.js +68 -0
- package/storybook-static/assets/message-parts-renderer.stories-CewRvbm7.js +5 -0
- package/storybook-static/assets/message-types-CEyA7Qm7.js +60 -0
- package/storybook-static/assets/model-swap-separator.stories-DrQW2NWQ.js +9 -0
- package/storybook-static/assets/mutation-observer-CAfGweIM.js +1 -0
- package/storybook-static/assets/normalize-props-D7NI5JRu.js +1 -0
- package/storybook-static/assets/number-C92MPsRM.js +1 -0
- package/storybook-static/assets/number-input-D1aC-9ls.js +7 -0
- package/storybook-static/assets/onest-cyrillic-400-normal-BxvCLB5P.woff +0 -0
- package/storybook-static/assets/onest-cyrillic-400-normal-DH8vlB-A.woff2 +0 -0
- package/storybook-static/assets/onest-cyrillic-500-normal-CyY1vN0Q.woff +0 -0
- package/storybook-static/assets/onest-cyrillic-500-normal-DHyr8B2c.woff2 +0 -0
- package/storybook-static/assets/onest-cyrillic-700-normal-CwpXuTGk.woff2 +0 -0
- package/storybook-static/assets/onest-cyrillic-700-normal-DOtXtm0s.woff +0 -0
- package/storybook-static/assets/onest-latin-400-normal-BAzPRZHg.woff +0 -0
- package/storybook-static/assets/onest-latin-400-normal-bladozIj.woff2 +0 -0
- package/storybook-static/assets/onest-latin-500-normal-oFTiz6Nq.woff +0 -0
- package/storybook-static/assets/onest-latin-500-normal-qHiQtL66.woff2 +0 -0
- package/storybook-static/assets/onest-latin-700-normal-Bd6qVL4Q.woff2 +0 -0
- package/storybook-static/assets/onest-latin-700-normal-XTvQgpoh.woff +0 -0
- package/storybook-static/assets/onest-latin-ext-400-normal--mQR5RlC.woff2 +0 -0
- package/storybook-static/assets/onest-latin-ext-400-normal-BbXTNVXw.woff +0 -0
- package/storybook-static/assets/onest-latin-ext-500-normal-BlXa29q8.woff2 +0 -0
- package/storybook-static/assets/onest-latin-ext-500-normal-CoujUMv_.woff +0 -0
- package/storybook-static/assets/onest-latin-ext-700-normal-C-Tcltod.woff2 +0 -0
- package/storybook-static/assets/onest-latin-ext-700-normal-CSGWRWNE.woff +0 -0
- package/storybook-static/assets/open-source-notices-screen.stories-BpdJxDZC.js +21 -0
- package/storybook-static/assets/overflow-CkG1DOya.js +1 -0
- package/storybook-static/assets/panel-menu-CqLSrdTB.js +1 -0
- package/storybook-static/assets/panel-menu.stories-CxdWaWjq.js +14 -0
- package/storybook-static/assets/param-editor-horizontal.stories-C1o-VOjG.js +561 -0
- package/storybook-static/assets/param-editor-selection-input-2pJE1_W1.js +1 -0
- package/storybook-static/assets/param-editor.stories-0ae3y4Vu.js +921 -0
- package/storybook-static/assets/playfair-display-cyrillic-400-normal-CjW2EstV.woff2 +0 -0
- package/storybook-static/assets/playfair-display-cyrillic-400-normal-ZiRag6zj.woff +0 -0
- package/storybook-static/assets/playfair-display-cyrillic-600-normal-DbWAkkgN.woff +0 -0
- package/storybook-static/assets/playfair-display-cyrillic-600-normal-oLY6jnZ7.woff2 +0 -0
- package/storybook-static/assets/playfair-display-cyrillic-700-normal-Dk1mTcxf.woff +0 -0
- package/storybook-static/assets/playfair-display-cyrillic-700-normal-Dw3uKy19.woff2 +0 -0
- package/storybook-static/assets/playfair-display-latin-400-normal-CFtfchNt.woff2 +0 -0
- package/storybook-static/assets/playfair-display-latin-400-normal-DHYHbkg3.woff +0 -0
- package/storybook-static/assets/playfair-display-latin-600-normal-CZLGqjJe.woff2 +0 -0
- package/storybook-static/assets/playfair-display-latin-600-normal-CxxueQ0Z.woff +0 -0
- package/storybook-static/assets/playfair-display-latin-700-normal-Bc_1Q1cG.woff +0 -0
- package/storybook-static/assets/playfair-display-latin-700-normal-CuDiGg7c.woff2 +0 -0
- package/storybook-static/assets/playfair-display-latin-ext-400-normal-BxlSGspa.woff2 +0 -0
- package/storybook-static/assets/playfair-display-latin-ext-400-normal-qdZwdvNS.woff +0 -0
- package/storybook-static/assets/playfair-display-latin-ext-600-normal-BumBfC1v.woff +0 -0
- package/storybook-static/assets/playfair-display-latin-ext-600-normal-CEjQclLc.woff2 +0 -0
- package/storybook-static/assets/playfair-display-latin-ext-700-normal-C58ejOkc.woff2 +0 -0
- package/storybook-static/assets/playfair-display-latin-ext-700-normal-D5HUU8GT.woff +0 -0
- package/storybook-static/assets/playfair-display-vietnamese-400-normal-BV2APVTb.woff2 +0 -0
- package/storybook-static/assets/playfair-display-vietnamese-400-normal-BbvUAu4N.woff +0 -0
- package/storybook-static/assets/playfair-display-vietnamese-600-normal-BPJkAZPN.woff +0 -0
- package/storybook-static/assets/playfair-display-vietnamese-600-normal-ICsRR-qJ.woff2 +0 -0
- package/storybook-static/assets/playfair-display-vietnamese-700-normal-CaKJSIny.woff2 +0 -0
- package/storybook-static/assets/playfair-display-vietnamese-700-normal-Cr1rw0mr.woff +0 -0
- package/storybook-static/assets/portal-CZHfPTRw.js +1 -0
- package/storybook-static/assets/preload-helper-PPVm8Dsz.js +1 -0
- package/storybook-static/assets/prompt-input-BLCttowi.js +14 -0
- package/storybook-static/assets/prompt-input-BVbz9joI.css +1 -0
- package/storybook-static/assets/prompt-input.stories-J8-AMVXy.js +9 -0
- package/storybook-static/assets/properties.stories-Bs7ivKgb.js +59 -0
- package/storybook-static/assets/react-18-KY0R7ltw.js +9 -0
- package/storybook-static/assets/render-strategy-BebqUNCa.js +1 -0
- package/storybook-static/assets/resource-badge-Bw5UoU4J.js +1 -0
- package/storybook-static/assets/resource-badge.stories-DtSh-RX9.js +9 -0
- package/storybook-static/assets/rich-message-BIkzo1SM.js +1 -0
- package/storybook-static/assets/rich-message.stories-C9Wc4d3O.js +115 -0
- package/storybook-static/assets/rich-text-theme-Bkhh9rAZ.js +14 -0
- package/storybook-static/assets/rich-text-theme-K2MBoCbx.css +1 -0
- package/storybook-static/assets/separator-CQkMOHNm.js +1 -0
- package/storybook-static/assets/settings-DUgg22A7.js +1 -0
- package/storybook-static/assets/simple-grid-DIKjhnVI.js +1 -0
- package/storybook-static/assets/spinner-ZYH_gvW-.js +1 -0
- package/storybook-static/assets/stack-CN4X31TA.js +1 -0
- package/storybook-static/assets/star-CvcHIXRa.js +1 -0
- package/storybook-static/assets/style-guide.stories-BUvEhZov.js +6 -0
- package/storybook-static/assets/tabbable-DHAf8oAu.js +1 -0
- package/storybook-static/assets/table-BKNSzs2r.js +1 -0
- package/storybook-static/assets/textarea-rqmaWSc5.js +1 -0
- package/storybook-static/assets/toaster-d9nN0H7K.js +1 -0
- package/storybook-static/assets/toaster.stories-BRVCYyaM.js +52 -0
- package/storybook-static/assets/tool-invocation-timeline-B-cS0W6M.js +59 -0
- package/storybook-static/assets/tool-invocation-timeline.stories-DXO59O73.js +5 -0
- package/storybook-static/assets/tooltip-C_a-XGZ8.js +1 -0
- package/storybook-static/assets/tooltip-DZxUoouw.js +1 -0
- package/storybook-static/assets/trash-2-BO05slEk.js +1 -0
- package/storybook-static/assets/typeahead-CuY9WxfQ.js +1 -0
- package/storybook-static/assets/use-field-context-DoxKQlMm.js +1 -0
- package/storybook-static/assets/use-presence-context-DK2PGZth.js +1 -0
- package/storybook-static/assets/v-stack-Btoq6OB_.js +1 -0
- package/storybook-static/assets/x-D42ziktz.js +1 -0
- package/storybook-static/components/alert.d.ts +9 -0
- package/storybook-static/components/breadcrumb.d.ts +18 -0
- package/storybook-static/components/breadcrumb.stories.d.ts +25 -0
- package/storybook-static/components/chat-ui/agent-types.d.ts +205 -0
- package/storybook-static/components/chat-ui/components/ai-conversation.stories.d.ts +6 -0
- package/storybook-static/components/chat-ui/components/ai-message.d.ts +94 -0
- package/storybook-static/components/chat-ui/components/ai-message.stories.d.ts +6 -0
- package/storybook-static/components/chat-ui/components/ai-response.d.ts +6 -0
- package/storybook-static/components/chat-ui/components/ai-response.stories.d.ts +7 -0
- package/storybook-static/components/chat-ui/components/approval-prompt.d.ts +8 -0
- package/storybook-static/components/chat-ui/components/attachment-list.d.ts +23 -0
- package/storybook-static/components/chat-ui/components/attachment-list.stories.d.ts +6 -0
- package/storybook-static/components/chat-ui/components/auto-scroll.d.ts +10 -0
- package/storybook-static/components/chat-ui/components/chat-input.d.ts +16 -0
- package/storybook-static/components/chat-ui/components/chat-input.stories.d.ts +7 -0
- package/storybook-static/components/chat-ui/components/chat-panel.d.ts +18 -0
- package/storybook-static/components/chat-ui/components/chat-panel.stories.d.ts +8 -0
- package/storybook-static/components/chat-ui/components/message-parts-renderer.d.ts +12 -0
- package/storybook-static/components/chat-ui/components/message-parts-renderer.stories.d.ts +7 -0
- package/storybook-static/components/chat-ui/components/message-types.d.ts +6 -0
- package/storybook-static/components/chat-ui/components/model-swap-separator.d.ts +5 -0
- package/storybook-static/components/chat-ui/components/model-swap-separator.stories.d.ts +6 -0
- package/storybook-static/components/chat-ui/components/send-button.d.ts +7 -0
- package/storybook-static/components/chat-ui/components/timeline.d.ts +86 -0
- package/storybook-static/components/chat-ui/components/tool-invocation-timeline.d.ts +7 -0
- package/storybook-static/components/chat-ui/components/tool-invocation-timeline.stories.d.ts +6 -0
- package/storybook-static/components/chat-ui/mocks/full-conversation-normalized.json.d.ts +3560 -0
- package/storybook-static/components/chat-ui/tool-rendering/build-timeline.d.ts +23 -0
- package/storybook-static/components/chat-ui/tool-rendering/default-renderers.d.ts +9 -0
- package/storybook-static/components/chat-ui/tool-rendering/index.d.ts +3 -0
- package/storybook-static/components/chat-ui/tool-rendering/types.d.ts +13 -0
- package/storybook-static/components/chat-ui/utils/diff.d.ts +21 -0
- package/storybook-static/components/chat-ui/utils/editor-state.d.ts +1 -0
- package/storybook-static/components/code-editor.d.ts +33 -0
- package/storybook-static/components/column-file-browser.d.ts +21 -0
- package/storybook-static/components/content-placeholder.d.ts +5 -0
- package/storybook-static/components/data-table.d.ts +18 -0
- package/storybook-static/components/data-table.stories.d.ts +33 -0
- package/storybook-static/components/delete-confirmation-modal.d.ts +10 -0
- package/storybook-static/components/delete-confirmation-modal.stories.d.ts +11 -0
- package/storybook-static/components/diff-bubble.d.ts +14 -0
- package/storybook-static/components/diff-bubble.stories.d.ts +13 -0
- package/storybook-static/components/diff-card.d.ts +14 -0
- package/storybook-static/components/diff-drawer.d.ts +6 -0
- package/storybook-static/components/diff-drawer.stories.d.ts +8 -0
- package/storybook-static/components/diff-editor.d.ts +9 -0
- package/storybook-static/components/drawer-inline.d.ts +24 -0
- package/storybook-static/components/drawer-inline.stories.d.ts +8 -0
- package/storybook-static/components/empty-state.d.ts +8 -0
- package/storybook-static/components/empty-state.stories.d.ts +34 -0
- package/storybook-static/components/error-boundary.d.ts +26 -0
- package/storybook-static/components/file-selector.d.ts +13 -0
- package/storybook-static/components/file-tree-helpers.d.ts +8 -0
- package/storybook-static/components/horizontal-menu-stack.d.ts +6 -0
- package/storybook-static/components/info-card.d.ts +13 -0
- package/storybook-static/components/item-section.d.ts +11 -0
- package/storybook-static/components/item-section.stories.d.ts +17 -0
- package/storybook-static/components/layout.d.ts +14 -0
- package/storybook-static/components/layout.stories.d.ts +11 -0
- package/storybook-static/components/menu-item.d.ts +40 -0
- package/storybook-static/components/open-source-notices-screen.d.ts +20 -0
- package/storybook-static/components/open-source-notices-screen.stories.d.ts +12 -0
- package/storybook-static/components/panel-menu.d.ts +7 -0
- package/storybook-static/components/panel-menu.stories.d.ts +7 -0
- package/storybook-static/components/param-editor-color-input.d.ts +13 -0
- package/storybook-static/components/param-editor-date-input.d.ts +15 -0
- package/storybook-static/components/param-editor-horizontal-text-input.d.ts +12 -0
- package/storybook-static/components/param-editor-horizontal.d.ts +10 -0
- package/storybook-static/components/param-editor-horizontal.stories.d.ts +19 -0
- package/storybook-static/components/param-editor-input-group.d.ts +10 -0
- package/storybook-static/components/param-editor-number-input.d.ts +17 -0
- package/storybook-static/components/param-editor-selection-input.d.ts +21 -0
- package/storybook-static/components/param-editor-text-input.d.ts +13 -0
- package/storybook-static/components/param-editor.d.ts +10 -0
- package/storybook-static/components/param-editor.stories.d.ts +23 -0
- package/storybook-static/components/param-editor.types.d.ts +71 -0
- package/storybook-static/components/properties.d.ts +18 -0
- package/storybook-static/components/properties.stories.d.ts +17 -0
- package/storybook-static/components/resource-badge.d.ts +62 -0
- package/storybook-static/components/resource-badge.stories.d.ts +7 -0
- package/storybook-static/components/rich-text/collaborative-markdown-editor/awareness-cursors.d.ts +5 -0
- package/storybook-static/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.d.ts +8 -0
- package/storybook-static/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.stories.d.ts +9 -0
- package/storybook-static/components/rich-text/index.d.ts +14 -0
- package/storybook-static/components/rich-text/markdown-editor/markdown-editor.d.ts +8 -0
- package/storybook-static/components/rich-text/markdown-editor/markdown-editor.stories.d.ts +6 -0
- package/storybook-static/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkNode.d.ts +21 -0
- package/storybook-static/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.d.ts +2 -0
- package/storybook-static/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/index.d.ts +2 -0
- package/storybook-static/components/rich-text/prompt-input/commands.d.ts +19 -0
- package/storybook-static/components/rich-text/prompt-input/events.d.ts +15 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/CommentPlugin/CommentPlugin.d.ts +1 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentCommands.d.ts +3 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentSchema.d.ts +1 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.d.ts +17 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ImperativeAPIPlugin.d.ts +7 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.d.ts +4 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuOption.d.ts +12 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.d.ts +10 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenu.d.ts +9 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenuItem.d.ts +12 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/constants.d.ts +2 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.d.ts +13 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/checkForTriggers.d.ts +9 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/getSortedMenuOptions.d.ts +2 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.d.ts +6 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.d.ts +25 -0
- package/storybook-static/components/rich-text/prompt-input/plugins/keyboard-shortcuts.d.ts +9 -0
- package/storybook-static/components/rich-text/prompt-input/prompt-input.d.ts +24 -0
- package/storybook-static/components/rich-text/prompt-input/prompt-input.stories.d.ts +8 -0
- package/storybook-static/components/rich-text/prompt-input/theme/prompt-input-theme.d.ts +3 -0
- package/storybook-static/components/rich-text/prompt-input/utils.d.ts +23 -0
- package/storybook-static/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkNode.d.ts +21 -0
- package/storybook-static/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.d.ts +2 -0
- package/storybook-static/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/index.d.ts +2 -0
- package/storybook-static/components/rich-text/rich-message/rich-message.d.ts +7 -0
- package/storybook-static/components/rich-text/rich-message/rich-message.stories.d.ts +6 -0
- package/storybook-static/components/rich-text/shared/components/content-editable.d.ts +7 -0
- package/storybook-static/components/rich-text/shared/components/default-rich-text-components.d.ts +3 -0
- package/storybook-static/components/rich-text/shared/editor-config.d.ts +4 -0
- package/storybook-static/components/rich-text/shared/nodes/DataTableNode.d.ts +22 -0
- package/storybook-static/components/rich-text/shared/nodes/DataTableNode.stories.d.ts +7 -0
- package/storybook-static/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.d.ts +1 -0
- package/storybook-static/components/rich-text/shared/plugins/CodePlugin/CodeNode.d.ts +19 -0
- package/storybook-static/components/rich-text/shared/plugins/EquationPlugin/EquationComponent.d.ts +6 -0
- package/storybook-static/components/rich-text/shared/plugins/EquationPlugin/EquationNode.d.ts +26 -0
- package/storybook-static/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.d.ts +4 -0
- package/storybook-static/components/rich-text/shared/plugins/EquationPlugin/KatexRenderer.d.ts +4 -0
- package/storybook-static/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatToolbarPlugin.d.ts +4 -0
- package/storybook-static/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +1 -0
- package/storybook-static/components/rich-text/shared/plugins/HorizontalRulePlugin/HorizontalRuleNode.d.ts +13 -0
- package/storybook-static/components/rich-text/shared/plugins/HorizontalRulePlugin/horizontalRule.d.ts +2 -0
- package/storybook-static/components/rich-text/shared/plugins/LinkEditorPlugin/LinkEditorPlugin.d.ts +4 -0
- package/storybook-static/components/rich-text/shared/plugins/LinkEditorPlugin/LinkPlugin.d.ts +1 -0
- package/storybook-static/components/rich-text/shared/plugins/LinkEditorPlugin/utils/getSelectedNode.d.ts +2 -0
- package/storybook-static/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.d.ts +1 -0
- package/storybook-static/components/rich-text/shared/plugins/LinkEditorPlugin/utils/url.d.ts +2 -0
- package/storybook-static/components/rich-text/shared/plugins/StateUpdatePlugin.d.ts +6 -0
- package/storybook-static/components/rich-text/shared/plugins/TableActionMenuPlugin/TableActionMenuPlugin.d.ts +5 -0
- package/storybook-static/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.d.ts +2 -0
- package/storybook-static/components/rich-text/shared/plugins/ToggleEditablePlugin.d.ts +3 -0
- package/storybook-static/components/rich-text/shared/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +1 -0
- package/storybook-static/components/rich-text/shared/transformers/markdown-transformers.d.ts +15 -0
- package/storybook-static/components/rich-text/shared/types/rich-text-components.d.ts +15 -0
- package/storybook-static/components/rich-text/theme/report-theme.d.ts +3 -0
- package/storybook-static/components/rich-text/theme/rich-text-theme.d.ts +3 -0
- package/storybook-static/components/rich-text/types.d.ts +8 -0
- package/storybook-static/components/rich-text/utils/inferResourceType.d.ts +1 -0
- package/storybook-static/components/rich-text/utils/markdown.d.ts +4 -0
- package/storybook-static/components/rich-text/utils/mediaType.d.ts +1 -0
- package/storybook-static/components/schub-logo.d.ts +2 -0
- package/storybook-static/components/slider.d.ts +5 -0
- package/storybook-static/components/style-guide-data.d.ts +46 -0
- package/storybook-static/components/style-guide.d.ts +1 -0
- package/storybook-static/components/style-guide.stories.d.ts +14 -0
- package/storybook-static/components/toaster.stories.d.ts +11 -0
- package/storybook-static/components/tooltip.d.ts +12 -0
- package/storybook-static/favicon-wrapper.svg +46 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +705 -0
- package/storybook-static/index.d.ts +14 -0
- package/storybook-static/index.html +150 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +628 -0
- package/storybook-static/sb-addons/themes-1/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/vitest-2/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon-wrapper.svg +46 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-runtime.js +77956 -0
- package/storybook-static/sb-manager/globals.js +24 -0
- package/storybook-static/sb-manager/manager-stores.js +23 -0
- package/storybook-static/sb-manager/runtime.js +20422 -0
- package/storybook-static/theme/applyThemePreference.d.ts +2 -0
- package/storybook-static/theme/global.d.ts +46 -0
- package/storybook-static/theme/index.d.ts +1 -0
- package/storybook-static/theme/primitives/colors.d.ts +958 -0
- package/storybook-static/theme/primitives/fonts.d.ts +81 -0
- package/storybook-static/theme/primitives/sizes.d.ts +89 -0
- package/storybook-static/theme/recipes/alert.d.ts +1 -0
- package/storybook-static/theme/recipes/button.d.ts +129 -0
- package/storybook-static/theme/recipes/dialog.d.ts +1 -0
- package/storybook-static/theme/recipes/divider.d.ts +1 -0
- package/storybook-static/theme/recipes/drawer.d.ts +1 -0
- package/storybook-static/theme/recipes/editable.d.ts +1 -0
- package/storybook-static/theme/recipes/form.d.ts +1 -0
- package/storybook-static/theme/recipes/input.d.ts +7 -0
- package/storybook-static/theme/recipes/menu.d.ts +1 -0
- package/storybook-static/theme/recipes/popover.d.ts +16 -0
- package/storybook-static/theme/recipes/progress-circle.d.ts +28 -0
- package/storybook-static/theme/recipes/skeleton.d.ts +1 -0
- package/storybook-static/theme/recipes/textarea.d.ts +1 -0
- package/storybook-static/theme/recipes/tooltip.d.ts +1 -0
- package/storybook-static/theme/theme-preference.d.ts +15 -0
- package/storybook-static/theme/theme.d.ts +2 -0
- package/storybook-static/theme/tokens/borders.d.ts +38 -0
- package/storybook-static/theme/tokens/colors.d.ts +898 -0
- package/storybook-static/theme/tokens/layer-styles.d.ts +1 -0
- package/storybook-static/theme/tokens/shadows.d.ts +64 -0
- package/storybook-static/theme/tokens/text.d.ts +1 -0
- package/storybook-static/theme/types.d.ts +1 -0
- package/storybook-static/utils/formats.d.ts +7 -0
- package/storybook-static/utils/get-file-type-icon.d.ts +2 -0
- package/storybook-static/vite-inject-mocker-entry.js +2 -0
- package/tsconfig.json +29 -0
- package/vite.config.ts +82 -0
- package/vitest.shims.d.ts +1 -0
package/src/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.tsx
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import "./TableCellResizerPlugin.css";
|
|
2
|
+
|
|
3
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
4
|
+
import { useLexicalEditable } from "@lexical/react/useLexicalEditable";
|
|
5
|
+
import type { TableDOMCell } from "@lexical/table";
|
|
6
|
+
import {
|
|
7
|
+
$getTableColumnIndexFromTableCellNode,
|
|
8
|
+
$getTableNodeFromLexicalNodeOrThrow,
|
|
9
|
+
$getTableRowIndexFromTableCellNode,
|
|
10
|
+
$isTableCellNode,
|
|
11
|
+
$isTableRowNode,
|
|
12
|
+
$isTableSelection,
|
|
13
|
+
getDOMCellFromTarget,
|
|
14
|
+
type TableCellNode,
|
|
15
|
+
} from "@lexical/table";
|
|
16
|
+
import type { LexicalEditor } from "lexical";
|
|
17
|
+
import { $getNearestNodeFromDOMNode, $getSelection, COMMAND_PRIORITY_HIGH, SELECTION_CHANGE_COMMAND } from "lexical";
|
|
18
|
+
import { type MouseEventHandler, type ReactNode, type ReactPortal, useEffect, useRef, useState } from "react";
|
|
19
|
+
import { createPortal } from "react-dom";
|
|
20
|
+
|
|
21
|
+
type MousePosition = {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type MouseDraggingDirection = "right" | "bottom";
|
|
27
|
+
|
|
28
|
+
const MIN_ROW_HEIGHT = 33;
|
|
29
|
+
const MIN_COLUMN_WIDTH = 50;
|
|
30
|
+
|
|
31
|
+
const isHeightChanging = (direction: MouseDraggingDirection) => direction === "bottom";
|
|
32
|
+
|
|
33
|
+
function applyRowHeight(editor: LexicalEditor, activeCell: TableDOMCell, newHeight: number) {
|
|
34
|
+
editor.update(() => {
|
|
35
|
+
const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
36
|
+
if (!$isTableCellNode(tableCellNode)) {
|
|
37
|
+
throw new Error("TableCellResizer: Table cell node not found.");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
41
|
+
const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
|
|
42
|
+
const tableRows = tableNode.getChildren();
|
|
43
|
+
|
|
44
|
+
if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
|
|
45
|
+
throw new Error("Expected table cell to be inside of table row.");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const tableRow = tableRows[tableRowIndex];
|
|
49
|
+
if (!$isTableRowNode(tableRow)) {
|
|
50
|
+
throw new Error("Expected table row");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
tableRow.setHeight(newHeight);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function applyColumnWidth(editor: LexicalEditor, activeCell: TableDOMCell, newWidth: number) {
|
|
58
|
+
editor.update(() => {
|
|
59
|
+
const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
60
|
+
if (!$isTableCellNode(tableCellNode)) {
|
|
61
|
+
throw new Error("TableCellResizer: Table cell node not found.");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
65
|
+
const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
|
|
66
|
+
const tableRows = tableNode.getChildren();
|
|
67
|
+
|
|
68
|
+
for (let r = 0; r < tableRows.length; r++) {
|
|
69
|
+
const tableRow = tableRows[r];
|
|
70
|
+
if (!$isTableRowNode(tableRow)) {
|
|
71
|
+
throw new Error("Expected table row");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const rowCells = tableRow.getChildren<TableCellNode>();
|
|
75
|
+
const rowCellsSpan = rowCells.map((cell) => cell.getColSpan());
|
|
76
|
+
|
|
77
|
+
const aggregatedRowSpans = rowCellsSpan.reduce((rowSpans: number[], cellSpan) => {
|
|
78
|
+
const previousCell = rowSpans[rowSpans.length - 1] ?? 0;
|
|
79
|
+
rowSpans.push(previousCell + cellSpan);
|
|
80
|
+
return rowSpans;
|
|
81
|
+
}, []);
|
|
82
|
+
const rowColumnIndexWithSpan = aggregatedRowSpans.findIndex((cellSpan: number) => cellSpan > tableColumnIndex);
|
|
83
|
+
|
|
84
|
+
if (rowColumnIndexWithSpan >= rowCells.length || rowColumnIndexWithSpan < 0) {
|
|
85
|
+
throw new Error("Expected table cell to be inside of table row.");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const tableCell = rowCells[rowColumnIndexWithSpan];
|
|
89
|
+
if (!$isTableCellNode(tableCell)) {
|
|
90
|
+
throw new Error("Expected table cell");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
tableCell.setWidth(newWidth);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const getNextRowHeight = (activeCell: TableDOMCell, startY: number, clientY: number) => {
|
|
99
|
+
const height = activeCell.elem.getBoundingClientRect().height;
|
|
100
|
+
const heightChange = Math.abs(clientY - startY);
|
|
101
|
+
const isShrinking = startY > clientY;
|
|
102
|
+
return Math.max(isShrinking ? height - heightChange : height + heightChange, MIN_ROW_HEIGHT);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const getNextColumnWidth = (activeCell: TableDOMCell, startX: number, clientX: number) => {
|
|
106
|
+
const computedStyle = getComputedStyle(activeCell.elem);
|
|
107
|
+
let width = activeCell.elem.clientWidth;
|
|
108
|
+
width -= parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight);
|
|
109
|
+
const widthChange = Math.abs(clientX - startX);
|
|
110
|
+
const isShrinking = startX > clientX;
|
|
111
|
+
return Math.max(isShrinking ? width - widthChange : width + widthChange, MIN_COLUMN_WIDTH);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
function TableCellResizer({ editor }: { editor: LexicalEditor }): ReactNode {
|
|
115
|
+
const targetRef = useRef<HTMLElement | null>(null);
|
|
116
|
+
const resizerRef = useRef<HTMLDivElement | null>(null);
|
|
117
|
+
const tableRectRef = useRef<ClientRect | null>(null);
|
|
118
|
+
|
|
119
|
+
const mouseStartPosRef = useRef<MousePosition | null>(null);
|
|
120
|
+
const [mouseCurrentPos, updateMouseCurrentPos] = useState<MousePosition | null>(null);
|
|
121
|
+
|
|
122
|
+
const [activeCell, updateActiveCell] = useState<TableDOMCell | null>(null);
|
|
123
|
+
const [isSelectingGrid, updateIsSelectingGrid] = useState<boolean>(false);
|
|
124
|
+
const [draggingDirection, updateDraggingDirection] = useState<MouseDraggingDirection | null>(null);
|
|
125
|
+
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
return editor.registerCommand(
|
|
128
|
+
SELECTION_CHANGE_COMMAND,
|
|
129
|
+
() => {
|
|
130
|
+
const selection = $getSelection();
|
|
131
|
+
const isTableSelection = $isTableSelection(selection);
|
|
132
|
+
|
|
133
|
+
if (isSelectingGrid !== isTableSelection) {
|
|
134
|
+
updateIsSelectingGrid(isTableSelection);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return false;
|
|
138
|
+
},
|
|
139
|
+
COMMAND_PRIORITY_HIGH,
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const clearResizeState = () => {
|
|
144
|
+
updateActiveCell(null);
|
|
145
|
+
targetRef.current = null;
|
|
146
|
+
updateDraggingDirection(null);
|
|
147
|
+
mouseStartPosRef.current = null;
|
|
148
|
+
tableRectRef.current = null;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// Store in ref so the effect closure always calls the latest version
|
|
152
|
+
const clearResizeStateRef = useRef(clearResizeState);
|
|
153
|
+
clearResizeStateRef.current = clearResizeState;
|
|
154
|
+
|
|
155
|
+
const syncActiveCellFromTargetRef = useRef<(target: EventTarget | null) => void>(() => {});
|
|
156
|
+
syncActiveCellFromTargetRef.current = (target: EventTarget | null) => {
|
|
157
|
+
if (targetRef.current === target) return;
|
|
158
|
+
|
|
159
|
+
targetRef.current = target as HTMLElement;
|
|
160
|
+
const cell = getDOMCellFromTarget(target as HTMLElement);
|
|
161
|
+
if (!cell) {
|
|
162
|
+
clearResizeStateRef.current();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (activeCell === cell) return;
|
|
167
|
+
|
|
168
|
+
editor.update(() => {
|
|
169
|
+
const tableCellNode = $getNearestNodeFromDOMNode(cell.elem);
|
|
170
|
+
if (!tableCellNode) throw new Error("TableCellResizer: Table cell node not found.");
|
|
171
|
+
|
|
172
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
173
|
+
const tableElement = editor.getElementByKey(tableNode.getKey());
|
|
174
|
+
if (!tableElement) throw new Error("TableCellResizer: Table element not found.");
|
|
175
|
+
|
|
176
|
+
targetRef.current = target as HTMLElement;
|
|
177
|
+
tableRectRef.current = tableElement.getBoundingClientRect();
|
|
178
|
+
updateActiveCell(cell);
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
const onMouseMove = (event: MouseEvent) => {
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
if (draggingDirection) {
|
|
186
|
+
updateMouseCurrentPos({ x: event.clientX, y: event.clientY });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const target = event.target;
|
|
191
|
+
if (resizerRef.current?.contains(target as Node)) return;
|
|
192
|
+
syncActiveCellFromTargetRef.current(target);
|
|
193
|
+
}, 0);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
197
|
+
return () => document.removeEventListener("mousemove", onMouseMove);
|
|
198
|
+
}, [draggingDirection]);
|
|
199
|
+
|
|
200
|
+
const mouseUpHandler = (direction: MouseDraggingDirection) => {
|
|
201
|
+
const handler = (event: MouseEvent) => {
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
event.stopPropagation();
|
|
204
|
+
|
|
205
|
+
if (!activeCell) throw new Error("TableCellResizer: Expected active cell.");
|
|
206
|
+
|
|
207
|
+
if (mouseStartPosRef.current) {
|
|
208
|
+
const { x, y } = mouseStartPosRef.current;
|
|
209
|
+
|
|
210
|
+
if (isHeightChanging(direction)) {
|
|
211
|
+
applyRowHeight(editor, activeCell, getNextRowHeight(activeCell, y, event.clientY));
|
|
212
|
+
} else {
|
|
213
|
+
applyColumnWidth(editor, activeCell, getNextColumnWidth(activeCell, x, event.clientX));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
clearResizeState();
|
|
217
|
+
document.removeEventListener("mouseup", handler);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
return handler;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const toggleResize =
|
|
224
|
+
(direction: MouseDraggingDirection): MouseEventHandler<HTMLButtonElement> =>
|
|
225
|
+
(event) => {
|
|
226
|
+
event.preventDefault();
|
|
227
|
+
event.stopPropagation();
|
|
228
|
+
|
|
229
|
+
if (!activeCell) throw new Error("TableCellResizer: Expected active cell.");
|
|
230
|
+
|
|
231
|
+
mouseStartPosRef.current = { x: event.clientX, y: event.clientY };
|
|
232
|
+
updateMouseCurrentPos(mouseStartPosRef.current);
|
|
233
|
+
updateDraggingDirection(direction);
|
|
234
|
+
document.addEventListener("mouseup", mouseUpHandler(direction));
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const resizerStyles = getResizerStyles(activeCell, draggingDirection, mouseCurrentPos, tableRectRef.current);
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<div ref={resizerRef}>
|
|
241
|
+
{activeCell != null && !isSelectingGrid && (
|
|
242
|
+
<>
|
|
243
|
+
<button
|
|
244
|
+
type="button"
|
|
245
|
+
className="TableCellResizer__resizer TableCellResizer__ui"
|
|
246
|
+
style={resizerStyles.right || undefined}
|
|
247
|
+
onMouseDown={toggleResize("right")}
|
|
248
|
+
aria-label="Resize column"
|
|
249
|
+
/>
|
|
250
|
+
<button
|
|
251
|
+
type="button"
|
|
252
|
+
className="TableCellResizer__resizer TableCellResizer__ui"
|
|
253
|
+
style={resizerStyles.bottom || undefined}
|
|
254
|
+
onMouseDown={toggleResize("bottom")}
|
|
255
|
+
aria-label="Resize row"
|
|
256
|
+
/>
|
|
257
|
+
</>
|
|
258
|
+
)}
|
|
259
|
+
</div>
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function getResizerStyles(
|
|
264
|
+
activeCell: TableDOMCell | null,
|
|
265
|
+
draggingDirection: MouseDraggingDirection | null,
|
|
266
|
+
mouseCurrentPos: MousePosition | null,
|
|
267
|
+
tableRect: ClientRect | null,
|
|
268
|
+
) {
|
|
269
|
+
if (!activeCell) return { bottom: null, left: null, right: null, top: null };
|
|
270
|
+
|
|
271
|
+
const { height, width, top, left } = activeCell.elem.getBoundingClientRect();
|
|
272
|
+
|
|
273
|
+
const styles = {
|
|
274
|
+
bottom: {
|
|
275
|
+
backgroundColor: "none",
|
|
276
|
+
cursor: "row-resize",
|
|
277
|
+
height: "10px",
|
|
278
|
+
left: `${window.pageXOffset + left}px`,
|
|
279
|
+
top: `${window.pageYOffset + top + height}px`,
|
|
280
|
+
width: `${width}px`,
|
|
281
|
+
},
|
|
282
|
+
right: {
|
|
283
|
+
backgroundColor: "none",
|
|
284
|
+
cursor: "col-resize",
|
|
285
|
+
height: `${height}px`,
|
|
286
|
+
left: `${window.pageXOffset + left + width}px`,
|
|
287
|
+
top: `${window.pageYOffset + top}px`,
|
|
288
|
+
width: "10px",
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
if (draggingDirection && mouseCurrentPos && tableRect) {
|
|
293
|
+
if (isHeightChanging(draggingDirection)) {
|
|
294
|
+
styles[draggingDirection].left = `${window.pageXOffset + tableRect.left}px`;
|
|
295
|
+
styles[draggingDirection].top = `${window.pageYOffset + mouseCurrentPos.y}px`;
|
|
296
|
+
styles[draggingDirection].height = "3px";
|
|
297
|
+
styles[draggingDirection].width = `${tableRect.width}px`;
|
|
298
|
+
} else {
|
|
299
|
+
styles[draggingDirection].top = `${window.pageYOffset + tableRect.top}px`;
|
|
300
|
+
styles[draggingDirection].left = `${window.pageXOffset + mouseCurrentPos.x}px`;
|
|
301
|
+
styles[draggingDirection].width = "3px";
|
|
302
|
+
styles[draggingDirection].height = `${tableRect.height}px`;
|
|
303
|
+
}
|
|
304
|
+
styles[draggingDirection].backgroundColor = "#adf";
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return styles;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export default function TableCellResizerPlugin(): null | ReactPortal {
|
|
311
|
+
const [editor] = useLexicalComposerContext();
|
|
312
|
+
const isEditable = useLexicalEditable();
|
|
313
|
+
|
|
314
|
+
return isEditable ? createPortal(<TableCellResizer editor={editor} />, document.body) : null;
|
|
315
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
export default function ToggleEditablePlugin({ isEditable }: { isEditable: boolean }) {
|
|
5
|
+
const [editor] = useLexicalComposerContext();
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
editor.setEditable(isEditable);
|
|
9
|
+
}, [isEditable, editor]);
|
|
10
|
+
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Box } from "@chakra-ui/react";
|
|
2
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
3
|
+
import { TreeView } from "@lexical/react/LexicalTreeView";
|
|
4
|
+
|
|
5
|
+
export function TreeViewPlugin() {
|
|
6
|
+
const [editor] = useLexicalComposerContext();
|
|
7
|
+
return (
|
|
8
|
+
<Box fontSize="xs" color="fg.muted" padding="4">
|
|
9
|
+
<TreeView
|
|
10
|
+
treeTypeButtonClassName="debug-treetype-button"
|
|
11
|
+
timeTravelButtonClassName="debug-timetravel-button"
|
|
12
|
+
timeTravelPanelButtonClassName="debug-timetravel-button"
|
|
13
|
+
timeTravelPanelClassName="debug-timetravel-panel"
|
|
14
|
+
timeTravelPanelSliderClassName="debug-timetravel-slider"
|
|
15
|
+
viewClassName="tree-view-output"
|
|
16
|
+
editor={editor}
|
|
17
|
+
/>
|
|
18
|
+
</Box>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { ElementTransformer, TextMatchTransformer } from "@lexical/markdown";
|
|
2
|
+
import { $createTextNode, TextNode } from "lexical";
|
|
3
|
+
import { $createDataTableNode, $isDataTableNode, type RowData } from "../nodes/DataTableNode";
|
|
4
|
+
import { HR } from "../plugins/HorizontalRulePlugin/horizontalRule";
|
|
5
|
+
|
|
6
|
+
export const TABLE: ElementTransformer = {
|
|
7
|
+
dependencies: [],
|
|
8
|
+
export: (node, _traverseChildren) => {
|
|
9
|
+
if ($isDataTableNode(node)) {
|
|
10
|
+
const data = node.getData();
|
|
11
|
+
|
|
12
|
+
if (!data.length) return "";
|
|
13
|
+
|
|
14
|
+
const headers = Object.keys(data[0]);
|
|
15
|
+
const headerRow = headers.join(" | ");
|
|
16
|
+
const separator = headers.map(() => "---").join(" | ");
|
|
17
|
+
const dataRows = data.map((row) => headers.map((header) => String(row[header] || "")).join(" | "));
|
|
18
|
+
|
|
19
|
+
return [`| ${headerRow} |`, `| ${separator} |`, ...dataRows.map((row) => `| ${row} |`)].join("\n");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return null;
|
|
23
|
+
},
|
|
24
|
+
regExp: /^\s*(\|.+\|)\s*$/,
|
|
25
|
+
replace: (parentNode, _children, match, _isImport) => {
|
|
26
|
+
const previousNode = parentNode.getPreviousSibling();
|
|
27
|
+
const isTableDelimiter = /^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/gm.test(match[0]);
|
|
28
|
+
|
|
29
|
+
// if it is a delimiter, remove it
|
|
30
|
+
if (isTableDelimiter) {
|
|
31
|
+
parentNode.remove();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Parse current row
|
|
36
|
+
const cells = match[0]
|
|
37
|
+
.split("|")
|
|
38
|
+
.slice(1, -1)
|
|
39
|
+
.map((cell) => cell.trim());
|
|
40
|
+
|
|
41
|
+
if (previousNode?.getType() === "data_table" && $isDataTableNode(previousNode)) {
|
|
42
|
+
// Add row to existing table
|
|
43
|
+
const existingData = previousNode.getData();
|
|
44
|
+
const newRow: RowData = {};
|
|
45
|
+
|
|
46
|
+
// Check if we have a placeholder row with empty values (created from headers)
|
|
47
|
+
const isPlaceholderRow =
|
|
48
|
+
existingData.length === 1 && Object.values(existingData[0]).every((value) => value === "");
|
|
49
|
+
|
|
50
|
+
// Get headers from existing data structure
|
|
51
|
+
const headers = existingData.length > 0 ? Object.keys(existingData[0]) : cells.map((_, index) => `col_${index}`);
|
|
52
|
+
|
|
53
|
+
cells.forEach((cell, index) => {
|
|
54
|
+
const header = headers[index] || `col_${index}`;
|
|
55
|
+
newRow[header] = cell;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// If we had a placeholder row, replace it; otherwise append
|
|
59
|
+
const newTableData = isPlaceholderRow ? [newRow] : [...existingData, newRow];
|
|
60
|
+
const newTableNode = $createDataTableNode(newTableData);
|
|
61
|
+
previousNode.replace(newTableNode);
|
|
62
|
+
parentNode.remove();
|
|
63
|
+
} else {
|
|
64
|
+
// Create new table - treat first row as headers
|
|
65
|
+
// Create a temporary empty row with these headers, which will be replaced when actual data comes
|
|
66
|
+
const newRow: RowData = {};
|
|
67
|
+
cells.forEach((cell, index) => {
|
|
68
|
+
newRow[cell || `col_${index}`] = "";
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const tableNode = $createDataTableNode([newRow]);
|
|
72
|
+
parentNode.replace(tableNode);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
type: "element",
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const UNDERLINE_INS_TAG: TextMatchTransformer = {
|
|
79
|
+
dependencies: [TextNode],
|
|
80
|
+
export: (node, _children) => {
|
|
81
|
+
if (node instanceof TextNode) {
|
|
82
|
+
let markdownText = node.getTextContent();
|
|
83
|
+
|
|
84
|
+
if (node.hasFormat("bold")) {
|
|
85
|
+
markdownText = `**${markdownText}**`;
|
|
86
|
+
} else if (node.hasFormat("italic")) {
|
|
87
|
+
markdownText = `*${markdownText}*`;
|
|
88
|
+
} else if (node.hasFormat("underline")) {
|
|
89
|
+
markdownText = `<ins>${markdownText}</ins>`;
|
|
90
|
+
} else {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return markdownText;
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
},
|
|
98
|
+
regExp: /<ins>(.*)<\/ins>/,
|
|
99
|
+
importRegExp: /<ins>(.*)<\/ins>/,
|
|
100
|
+
replace: (node, match) => {
|
|
101
|
+
const textNode = $createTextNode(match[1]);
|
|
102
|
+
textNode.toggleFormat("underline");
|
|
103
|
+
node.replace(textNode);
|
|
104
|
+
},
|
|
105
|
+
type: "text-match",
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const UNDERLINE_U_TAG: TextMatchTransformer = {
|
|
109
|
+
dependencies: [TextNode],
|
|
110
|
+
export: (_node, _children) => {
|
|
111
|
+
return null;
|
|
112
|
+
},
|
|
113
|
+
regExp: /<u>(.*)<\/u>/,
|
|
114
|
+
importRegExp: /<u>(.*)<\/u>/,
|
|
115
|
+
replace: (node, match) => {
|
|
116
|
+
const textNode = $createTextNode(match[1]);
|
|
117
|
+
textNode.toggleFormat("underline");
|
|
118
|
+
node.replace(textNode);
|
|
119
|
+
},
|
|
120
|
+
type: "text-match",
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const TRANSFORMERS_EXTENDED = [TABLE, HR, UNDERLINE_INS_TAG, UNDERLINE_U_TAG];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type RowData = Record<string, unknown>;
|
|
2
|
+
|
|
3
|
+
export interface DataTableProps {
|
|
4
|
+
data: RowData[];
|
|
5
|
+
isReadOnly?: boolean;
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
noBorder?: boolean;
|
|
8
|
+
hiddenColumns?: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface CodeEditorProps {
|
|
12
|
+
language?: string;
|
|
13
|
+
defaultCode?: string;
|
|
14
|
+
isEditable?: boolean;
|
|
15
|
+
showLineNumbers?: boolean;
|
|
16
|
+
disableScroll?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { EditorThemeClasses } from "lexical";
|
|
2
|
+
|
|
3
|
+
import "./rich-text-theme.css";
|
|
4
|
+
|
|
5
|
+
const theme: EditorThemeClasses = {
|
|
6
|
+
code: "rich-text__code",
|
|
7
|
+
codeHighlight: {
|
|
8
|
+
atrule: "rich-text__tokenAttr",
|
|
9
|
+
attr: "rich-text__tokenAttr",
|
|
10
|
+
boolean: "rich-text__tokenProperty",
|
|
11
|
+
builtin: "rich-text__tokenSelector",
|
|
12
|
+
cdata: "rich-text__tokenComment",
|
|
13
|
+
char: "rich-text__tokenSelector",
|
|
14
|
+
class: "rich-text__tokenFunction",
|
|
15
|
+
"class-name": "rich-text__tokenFunction",
|
|
16
|
+
comment: "rich-text__tokenComment",
|
|
17
|
+
constant: "rich-text__tokenProperty",
|
|
18
|
+
deleted: "rich-text__tokenProperty",
|
|
19
|
+
doctype: "rich-text__tokenComment",
|
|
20
|
+
entity: "rich-text__tokenOperator",
|
|
21
|
+
function: "rich-text__tokenFunction",
|
|
22
|
+
important: "rich-text__tokenVariable",
|
|
23
|
+
inserted: "rich-text__tokenSelector",
|
|
24
|
+
keyword: "rich-text__tokenAttr",
|
|
25
|
+
namespace: "rich-text__tokenVariable",
|
|
26
|
+
number: "rich-text__tokenProperty",
|
|
27
|
+
operator: "rich-text__tokenOperator",
|
|
28
|
+
prolog: "rich-text__tokenComment",
|
|
29
|
+
property: "rich-text__tokenProperty",
|
|
30
|
+
punctuation: "rich-text__tokenPunctuation",
|
|
31
|
+
regex: "rich-text__tokenVariable",
|
|
32
|
+
selector: "rich-text__tokenSelector",
|
|
33
|
+
string: "rich-text__tokenSelector",
|
|
34
|
+
symbol: "rich-text__tokenProperty",
|
|
35
|
+
tag: "rich-text__tokenProperty",
|
|
36
|
+
url: "rich-text__tokenOperator",
|
|
37
|
+
variable: "rich-text__tokenVariable",
|
|
38
|
+
},
|
|
39
|
+
embedBlock: {
|
|
40
|
+
base: "rich-text__embedBlock",
|
|
41
|
+
focus: "rich-text__embedBlockFocus",
|
|
42
|
+
},
|
|
43
|
+
list: {
|
|
44
|
+
checklist: "rich-text__checklist",
|
|
45
|
+
listitem: "rich-text__listItem",
|
|
46
|
+
listitemChecked: "rich-text__listItemChecked",
|
|
47
|
+
listitemUnchecked: "rich-text__listItemUnchecked",
|
|
48
|
+
nested: {
|
|
49
|
+
listitem: "rich-text__nestedListItem",
|
|
50
|
+
},
|
|
51
|
+
olDepth: ["rich-text__ol1", "rich-text__ol2", "rich-text__ol3", "rich-text__ol4", "rich-text__ol5"],
|
|
52
|
+
ol: "rich-text__ol",
|
|
53
|
+
ul: "rich-text__ul",
|
|
54
|
+
},
|
|
55
|
+
heading: {
|
|
56
|
+
h1: "rich-text__h1_2",
|
|
57
|
+
h2: "rich-text__h2_2",
|
|
58
|
+
h3: "rich-text__h3_2",
|
|
59
|
+
},
|
|
60
|
+
paragraph: "rich-text__p2",
|
|
61
|
+
text: {
|
|
62
|
+
underline: "rich-text__textUnderline",
|
|
63
|
+
italic: "rich-text__textItalic",
|
|
64
|
+
code: "rich-text__textCode",
|
|
65
|
+
},
|
|
66
|
+
link: "rich-text__link",
|
|
67
|
+
quote: "rich-text__quote",
|
|
68
|
+
reference: "rich-text__reference",
|
|
69
|
+
table: "rich-text__table",
|
|
70
|
+
tableCell: "rich-text__tableCell",
|
|
71
|
+
tableRow: "rich-text__tableRow",
|
|
72
|
+
tableCellHeader: "rich-text__tableCellHeader",
|
|
73
|
+
layoutContainer: "rich-text__layoutContainer",
|
|
74
|
+
layoutItem: "rich-text__layoutItem",
|
|
75
|
+
draggableBlockDemo: {
|
|
76
|
+
row: "rich-text__row",
|
|
77
|
+
content: "rich-text__content",
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default theme;
|