dishui 0.0.106 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.release-verified.json +3 -2
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/ButtonMenu/index.js.map +1 -1
- package/dist/components/Card/Metric2.js.map +1 -1
- package/dist/components/Card/Ticket2.js.map +1 -1
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Chart/Chart.js.map +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/ChoicePicker/index.js.map +1 -1
- package/dist/components/Column/index.js.map +1 -1
- package/dist/components/ConfirmDialog/index.js.map +1 -1
- package/dist/components/DateTimeInput/index.js.map +1 -1
- package/dist/components/Demo/index.js.map +1 -1
- package/dist/components/Demo/source.js.map +1 -1
- package/dist/components/Divider/index.js.map +1 -1
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/Field/index.js.map +1 -1
- package/dist/components/FileUploader/DropZone.js.map +1 -1
- package/dist/components/FileUploader/FileItem.js.map +1 -1
- package/dist/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/components/FileUploader/UploadQueue.js.map +1 -1
- package/dist/components/GroupButton/index.js.map +1 -1
- package/dist/components/GroupedTable/index.js.map +1 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/LayoutSuite/DashboardSuite.js.map +1 -1
- package/dist/components/LayoutSuite/index.js.map +1 -1
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/codeThemes.js.map +1 -1
- package/dist/components/Markdown/markdownComponents.js.map +1 -1
- package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
- package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
- package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
- package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
- package/dist/components/Modal/focusScope.js.map +1 -1
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultipleChoice/index.js.map +1 -1
- package/dist/components/NavigationList/index.js.map +1 -1
- package/dist/components/Page/Float2.js.map +1 -1
- package/dist/components/Page/index.js.map +1 -1
- package/dist/components/Page/resize2.js.map +1 -1
- package/dist/components/PageHeader/index.js.map +1 -1
- package/dist/components/PagePanel/index.js.map +1 -1
- package/dist/components/ProtectedRoute/index.js.map +1 -1
- package/dist/components/Resizable/ResizeGrip.js.map +1 -1
- package/dist/components/Resizable/index.js.map +1 -1
- package/dist/components/Resizable/useResize.js.map +1 -1
- package/dist/components/Row/index.js.map +1 -1
- package/dist/components/Section/index.js.map +1 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Tab/index.js.map +1 -1
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tabNavigation.js.map +1 -1
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/ai/AgentChat/index.js.map +1 -1
- package/dist/components/ai/AgentRunCard/index.js.map +1 -1
- package/dist/components/ai/AgentScreen/index.js.map +1 -1
- package/dist/components/ai/ApprovalCard/index.js.map +1 -1
- package/dist/components/ai/CodeView/index.js.map +1 -1
- package/dist/components/ai/CommandSearch/index.js.map +1 -1
- package/dist/components/ai/ContextCards/index.js.map +1 -1
- package/dist/components/ai/DiffTable/index.js.map +1 -1
- package/dist/components/ai/FilterTable/index.js.map +1 -1
- package/dist/components/ai/FineTuneCard/index.js.map +1 -1
- package/dist/components/ai/InsightCards/index.js.map +1 -1
- package/dist/components/ai/IssueCard/index.js.map +1 -1
- package/dist/components/ai/LoadingState/index.js.map +1 -1
- package/dist/components/ai/PromptBar/index.js.map +1 -1
- package/dist/components/ai/RecommendationCard/index.js.map +1 -1
- package/dist/components/ai/RecordsTable/index.js.map +1 -1
- package/dist/components/ai/SelectionActions/index.js.map +1 -1
- package/dist/components/ai/StateFlow/index.js.map +1 -1
- package/dist/components/ai/StreamingText/index.js.map +1 -1
- package/dist/components/ai/TaskRows/index.js.map +1 -1
- package/dist/components/ai/Thinking/index.js.map +1 -1
- package/dist/components/ai/ToolChips/index.js.map +1 -1
- package/dist/components/ai/shared.js.map +1 -1
- package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
- package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
- package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
- package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
- package/dist/components/pro/Calendar/Calendar.js +165 -160
- package/dist/components/pro/Calendar/Calendar.js.map +1 -1
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.js.map +1 -1
- package/dist/components/pro/Calendar/hooks/useCalendarState.js +31 -31
- package/dist/components/pro/Calendar/hooks/useCalendarState.js.map +1 -1
- package/dist/components/pro/Calendar/utils.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +65 -59
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/utils.js.map +1 -1
- package/dist/components/pro/DataTable/DataTable.js.map +1 -1
- package/dist/components/pro/DataTable/Filters.js.map +1 -1
- package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
- package/dist/components/pro/DataTable/PivotView.js.map +1 -1
- package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
- package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
- package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
- package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
- package/dist/components/pro/DataTable/extension.js.map +1 -1
- package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
- package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
- package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
- package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
- package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
- package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
- package/dist/components/pro/DataTable/useDataTableModel.js +119 -104
- package/dist/components/pro/DataTable/useDataTableModel.js.map +1 -1
- package/dist/components/pro/DataTable/utils.js.map +1 -1
- package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
- package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
- package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
- package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
- package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/archify/build.js.map +1 -1
- package/dist/components/pro/Flow/archify/convert.js.map +1 -1
- package/dist/components/pro/Flow/archify/palette.js.map +1 -1
- package/dist/components/pro/Flow/archify/presets.js.map +1 -1
- package/dist/components/pro/Flow/archify/spec.js.map +1 -1
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
- package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
- package/dist/components/pro/Flow/nodes/chartGeometryBudget.js.map +1 -1
- package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/demandRender.js.map +1 -1
- package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
- package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
- package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
- package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
- package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
- package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
- package/dist/components/pro/Gantt/Gantt.js.map +1 -1
- package/dist/components/pro/Gantt/hooks/useGanttDrag.js.map +1 -1
- package/dist/components/pro/Gantt/hooks/useGanttState.js +79 -71
- package/dist/components/pro/Gantt/hooks/useGanttState.js.map +1 -1
- package/dist/components/pro/Gantt/utils.js.map +1 -1
- package/dist/components/pro/Kanban/Kanban.js.map +1 -1
- package/dist/components/pro/Kanban/Swimlanes.js.map +1 -1
- package/dist/components/pro/Kanban/useKanbanDrag.js.map +1 -1
- package/dist/components/pro/Kanban/utils.js.map +1 -1
- package/dist/components/pro/RichTextEditor/AIRewrite.d.ts +1 -0
- package/dist/components/pro/RichTextEditor/AIRewrite.js +109 -88
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +133 -132
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/ResizableImage.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/legacyMermaid.js.map +1 -1
- package/dist/components/pro/RichTextEditor/types.d.ts +2 -0
- package/dist/components/pro/RichTextEditor/types.js.map +1 -1
- package/dist/components/pro/Sprite/Molly/animations.d.ts +6 -0
- package/dist/components/pro/Sprite/Molly/animations.js +52 -0
- package/dist/components/pro/Sprite/Molly/animations.js.map +1 -0
- package/dist/components/pro/Sprite/Molly/events.d.ts +2 -0
- package/dist/components/pro/Sprite/Molly/events.js +46 -0
- package/dist/components/pro/Sprite/Molly/events.js.map +1 -0
- package/dist/components/pro/Sprite/Molly/index.d.ts +1 -0
- package/dist/components/pro/Sprite/Molly/index.js +12 -0
- package/dist/components/pro/Sprite/Molly/index.js.map +1 -0
- package/dist/components/pro/Sprite/Molly/legFlexion.d.ts +3 -0
- package/dist/components/pro/Sprite/Molly/legFlexion.js +48 -0
- package/dist/components/pro/Sprite/Molly/legFlexion.js.map +1 -0
- package/dist/components/pro/Sprite/Molly/locomotion.d.ts +4 -0
- package/dist/components/pro/Sprite/Molly/locomotion.js +51 -0
- package/dist/components/pro/Sprite/Molly/locomotion.js.map +1 -0
- package/dist/components/pro/Sprite/Molly/model.d.ts +23 -0
- package/dist/components/pro/Sprite/Molly/model.js +614 -0
- package/dist/components/pro/Sprite/Molly/model.js.map +1 -0
- package/dist/components/pro/Sprite/Molly/rig.d.ts +25 -0
- package/dist/components/pro/Sprite/Molly/rig.js +102 -0
- package/dist/components/pro/Sprite/Molly/rig.js.map +1 -0
- package/dist/components/pro/Sprite/Ruby/animations.d.ts +6 -0
- package/dist/components/pro/Sprite/Ruby/animations.js +58 -0
- package/dist/components/pro/Sprite/Ruby/animations.js.map +1 -0
- package/dist/components/pro/Sprite/Ruby/events.d.ts +2 -0
- package/dist/components/pro/Sprite/Ruby/events.js +46 -0
- package/dist/components/pro/Sprite/Ruby/events.js.map +1 -0
- package/dist/components/pro/Sprite/Ruby/index.d.ts +1 -0
- package/dist/components/pro/Sprite/Ruby/index.js +12 -0
- package/dist/components/pro/Sprite/Ruby/index.js.map +1 -0
- package/dist/components/pro/Sprite/Ruby/locomotion.d.ts +4 -0
- package/dist/components/pro/Sprite/Ruby/locomotion.js +41 -0
- package/dist/components/pro/Sprite/Ruby/locomotion.js.map +1 -0
- package/dist/components/pro/Sprite/Ruby/model.d.ts +23 -0
- package/dist/components/pro/Sprite/Ruby/model.js +605 -0
- package/dist/components/pro/Sprite/Ruby/model.js.map +1 -0
- package/dist/components/pro/Sprite/Ruby/rig.d.ts +26 -0
- package/dist/components/pro/Sprite/Ruby/rig.js +112 -0
- package/dist/components/pro/Sprite/Ruby/rig.js.map +1 -0
- package/dist/components/pro/Sprite/Sprite.d.ts +23 -0
- package/dist/components/pro/Sprite/Sprite2.js +224 -0
- package/dist/components/pro/Sprite/Sprite2.js.map +1 -0
- package/dist/components/pro/Sprite/actions.d.ts +3 -0
- package/dist/components/pro/Sprite/actions.js +16 -0
- package/dist/components/pro/Sprite/actions.js.map +1 -0
- package/dist/components/pro/Sprite/createSpriteScene.d.ts +4 -0
- package/dist/components/pro/Sprite/createSpriteScene.js +14 -0
- package/dist/components/pro/Sprite/createSpriteScene.js.map +1 -0
- package/dist/components/pro/Sprite/index.d.ts +4 -0
- package/dist/components/pro/Sprite/shared/animation.d.ts +33 -0
- package/dist/components/pro/Sprite/shared/animation.js +39 -0
- package/dist/components/pro/Sprite/shared/animation.js.map +1 -0
- package/dist/components/pro/Sprite/shared/createSpriteStage.d.ts +14 -0
- package/dist/components/pro/Sprite/shared/createSpriteStage.js +127 -0
- package/dist/components/pro/Sprite/shared/createSpriteStage.js.map +1 -0
- package/dist/components/pro/Sprite/shared/events.d.ts +5 -0
- package/dist/components/pro/Sprite/shared/events.js +21 -0
- package/dist/components/pro/Sprite/shared/events.js.map +1 -0
- package/dist/components/pro/Sprite/shared/face.d.ts +15 -0
- package/dist/components/pro/Sprite/shared/face.js +33 -0
- package/dist/components/pro/Sprite/shared/face.js.map +1 -0
- package/dist/components/pro/Sprite/shared/faceSurface.d.ts +6 -0
- package/dist/components/pro/Sprite/shared/faceSurface.js +66 -0
- package/dist/components/pro/Sprite/shared/faceSurface.js.map +1 -0
- package/dist/components/pro/Sprite/shared/gait.d.ts +5 -0
- package/dist/components/pro/Sprite/shared/gait.js +19 -0
- package/dist/components/pro/Sprite/shared/gait.js.map +1 -0
- package/dist/components/pro/Sprite/shared/geometry.d.ts +8 -0
- package/dist/components/pro/Sprite/shared/geometry.js +59 -0
- package/dist/components/pro/Sprite/shared/geometry.js.map +1 -0
- package/dist/components/pro/Sprite/shared/magicEffect.d.ts +27 -0
- package/dist/components/pro/Sprite/shared/magicEffect.js +61 -0
- package/dist/components/pro/Sprite/shared/magicEffect.js.map +1 -0
- package/dist/components/pro/Sprite/shared/playback.d.ts +8 -0
- package/dist/components/pro/Sprite/shared/playback.js +74 -0
- package/dist/components/pro/Sprite/shared/playback.js.map +1 -0
- package/dist/components/pro/Sprite/shared/rig.d.ts +6 -0
- package/dist/components/pro/Sprite/shared/rig.js +48 -0
- package/dist/components/pro/Sprite/shared/rig.js.map +1 -0
- package/dist/components/pro/Sprite/shared/scene.d.ts +9 -0
- package/dist/components/pro/Sprite/shared/scene.js +21 -0
- package/dist/components/pro/Sprite/shared/scene.js.map +1 -0
- package/dist/components/pro/Sprite/shared/sculptor.d.ts +14 -0
- package/dist/components/pro/Sprite/shared/sculptor.js +78 -0
- package/dist/components/pro/Sprite/shared/sculptor.js.map +1 -0
- package/dist/components/pro/Sprite/shared/speechBubble.d.ts +15 -0
- package/dist/components/pro/Sprite/shared/speechBubble.js +129 -0
- package/dist/components/pro/Sprite/shared/speechBubble.js.map +1 -0
- package/dist/components/pro/Sprite/types.d.ts +40 -0
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/contexts/authentication.js.map +1 -1
- package/dist/data-table.js +3 -3
- package/dist/data-table.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/hooks/useClickOutside.js.map +1 -1
- package/dist/hooks/useContainerElement.js.map +1 -1
- package/dist/hooks/useControllableState.js.map +1 -1
- package/dist/hooks/useCopyToClipboard.js.map +1 -1
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/hooks/useDraggable.js.map +1 -1
- package/dist/hooks/useTableColumns.js.map +1 -1
- package/dist/hooks/useTableData.js.map +1 -1
- package/dist/index-nostyled.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +116 -115
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Navbar.js.map +1 -1
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
- package/dist/sprite.js +2 -0
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/flexLayout.js.map +1 -1
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js.map +1 -1
- package/dist/utils/rehype-code-meta.js.map +1 -1
- package/dist/utils/remark-code-meta.js.map +1 -1
- package/dist/utils/routerBuilder.js.map +1 -1
- package/dist/utils/safeStorage.js.map +1 -1
- package/dist/utils/selection.js +29 -20
- package/dist/utils/selection.js.map +1 -1
- package/dist/utils/themes.js.map +1 -1
- package/package.json +15 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingDialogMenu.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport { flushSync } from 'react-dom';\nimport type { RichTextEditorLabels } from '../types';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\ninterface FloatingDialogMenuProps {\n labels: RichTextEditorLabels;\n onInsert: (layout: 'block' | 'wrap-left' | 'wrap-right' | 'float', focusEditor?: boolean) => void;\n}\n\nconst DIALOG_LAYOUT_OPTIONS: { key: 'block' | 'wrap-left' | 'wrap-right' | 'float'; labelKey: keyof RichTextEditorLabels; icon: React.ReactNode }[] = [\n {\n key: 'block', labelKey: 'layoutBlock',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" /><line x1=\"3\" y1=\"3\" x2=\"21\" y2=\"3\" /><line x1=\"3\" y1=\"21\" x2=\"21\" y2=\"21\" /></svg>,\n },\n {\n key: 'wrap-left', labelKey: 'layoutWrapLeft',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"2\" y=\"4\" width=\"10\" height=\"8\" rx=\"1\" /><line x1=\"15\" y1=\"5\" x2=\"22\" y2=\"5\" /><line x1=\"15\" y1=\"8\" x2=\"22\" y2=\"8\" /><line x1=\"15\" y1=\"11\" x2=\"22\" y2=\"11\" /><line x1=\"2\" y1=\"15\" x2=\"22\" y2=\"15\" /><line x1=\"2\" y1=\"18\" x2=\"22\" y2=\"18\" /></svg>,\n },\n {\n key: 'wrap-right', labelKey: 'layoutWrapRight',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"12\" y=\"4\" width=\"10\" height=\"8\" rx=\"1\" /><line x1=\"2\" y1=\"5\" x2=\"9\" y2=\"5\" /><line x1=\"2\" y1=\"8\" x2=\"9\" y2=\"8\" /><line x1=\"2\" y1=\"11\" x2=\"9\" y2=\"11\" /><line x1=\"2\" y1=\"15\" x2=\"22\" y2=\"15\" /><line x1=\"2\" y1=\"18\" x2=\"22\" y2=\"18\" /></svg>,\n },\n {\n key: 'float', labelKey: 'layoutFloat',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" /><path d=\"M2 2h4M18 2h4M2 22h4M18 22h4\" strokeDasharray=\"2 2\" /><line x1=\"2\" y1=\"12\" x2=\"6\" y2=\"12\" strokeDasharray=\"2 2\" /><line x1=\"18\" y1=\"12\" x2=\"22\" y2=\"12\" strokeDasharray=\"2 2\" /></svg>,\n },\n];\n\nexport const FloatingDialogMenu: React.FC<FloatingDialogMenuProps> = ({ labels, onInsert }) => {\n const [isOpen, setIsOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, dropdownRef);\n const pointerType = useRef('');\n\n useEffect(() => {\n const handler = (e: PointerEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setIsOpen(false);\n };\n document.addEventListener('pointerdown', handler);\n return () => document.removeEventListener('pointerdown', handler);\n }, []);\n\n return (\n <div ref={ref} className=\"rte-toolbar__template-menu\" onPointerDown={(event) => { pointerType.current = event.pointerType; }}>\n <button\n type=\"button\"\n ref={triggerRef}\n className={`rte-toolbar__btn ${isOpen ? 'rte-toolbar__btn--active' : ''}`}\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n title={labels.floatingDialog || 'Floating Dialog'}\n style={{ width: 'auto', padding: '0 6px', gap: '2px', display: 'inline-flex', alignItems: 'center' }}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"2\" y=\"4\" width=\"13\" height=\"10\" rx=\"2\" />\n <path d=\"M9 10h11a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2v-2\" />\n <line x1=\"7\" y1=\"14\" x2=\"13\" y2=\"14\" />\n </svg>\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n {isOpen && (\n <div ref={dropdownRef} className=\"rte-toolbar__template-dropdown\" style={{ ...dropdownStyle, minWidth: 140 }}>\n {DIALOG_LAYOUT_OPTIONS.map((opt) => (\n <button\n key={opt.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => {\n const focusEditor = event.detail === 0 || pointerType.current !== 'touch';\n flushSync(() => setIsOpen(false));\n onInsert(opt.key, focusEditor);\n }}\n >\n <span className=\"rte-toolbar__template-icon\" style={{ display: 'flex', alignItems: 'center' }}>{opt.icon}</span>\n <span>{labels[opt.labelKey] || opt.labelKey}</span>\n </button>\n ))}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;AAUA,
|
|
1
|
+
{"version":3,"file":"FloatingDialogMenu.js","names":["DIALOG_LAYOUT_OPTIONS","FloatingDialogMenu","isOpen","setIsOpen","useState","ref","useRef","triggerRef","dropdownRef","dropdownStyle","useAnchoredDropdown","pointerType","useEffect","handler","event","labels","focusEditor","flushSync","onInsert","opt"],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport { flushSync } from 'react-dom';\nimport type { RichTextEditorLabels } from '../types';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\ninterface FloatingDialogMenuProps {\n labels: RichTextEditorLabels;\n onInsert: (layout: 'block' | 'wrap-left' | 'wrap-right' | 'float', focusEditor?: boolean) => void;\n}\n\nconst DIALOG_LAYOUT_OPTIONS: { key: 'block' | 'wrap-left' | 'wrap-right' | 'float'; labelKey: keyof RichTextEditorLabels; icon: React.ReactNode }[] = [\n {\n key: 'block', labelKey: 'layoutBlock',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" /><line x1=\"3\" y1=\"3\" x2=\"21\" y2=\"3\" /><line x1=\"3\" y1=\"21\" x2=\"21\" y2=\"21\" /></svg>,\n },\n {\n key: 'wrap-left', labelKey: 'layoutWrapLeft',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"2\" y=\"4\" width=\"10\" height=\"8\" rx=\"1\" /><line x1=\"15\" y1=\"5\" x2=\"22\" y2=\"5\" /><line x1=\"15\" y1=\"8\" x2=\"22\" y2=\"8\" /><line x1=\"15\" y1=\"11\" x2=\"22\" y2=\"11\" /><line x1=\"2\" y1=\"15\" x2=\"22\" y2=\"15\" /><line x1=\"2\" y1=\"18\" x2=\"22\" y2=\"18\" /></svg>,\n },\n {\n key: 'wrap-right', labelKey: 'layoutWrapRight',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"12\" y=\"4\" width=\"10\" height=\"8\" rx=\"1\" /><line x1=\"2\" y1=\"5\" x2=\"9\" y2=\"5\" /><line x1=\"2\" y1=\"8\" x2=\"9\" y2=\"8\" /><line x1=\"2\" y1=\"11\" x2=\"9\" y2=\"11\" /><line x1=\"2\" y1=\"15\" x2=\"22\" y2=\"15\" /><line x1=\"2\" y1=\"18\" x2=\"22\" y2=\"18\" /></svg>,\n },\n {\n key: 'float', labelKey: 'layoutFloat',\n icon: <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"><rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" /><path d=\"M2 2h4M18 2h4M2 22h4M18 22h4\" strokeDasharray=\"2 2\" /><line x1=\"2\" y1=\"12\" x2=\"6\" y2=\"12\" strokeDasharray=\"2 2\" /><line x1=\"18\" y1=\"12\" x2=\"22\" y2=\"12\" strokeDasharray=\"2 2\" /></svg>,\n },\n];\n\nexport const FloatingDialogMenu: React.FC<FloatingDialogMenuProps> = ({ labels, onInsert }) => {\n const [isOpen, setIsOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, dropdownRef);\n const pointerType = useRef('');\n\n useEffect(() => {\n const handler = (e: PointerEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setIsOpen(false);\n };\n document.addEventListener('pointerdown', handler);\n return () => document.removeEventListener('pointerdown', handler);\n }, []);\n\n return (\n <div ref={ref} className=\"rte-toolbar__template-menu\" onPointerDown={(event) => { pointerType.current = event.pointerType; }}>\n <button\n type=\"button\"\n ref={triggerRef}\n className={`rte-toolbar__btn ${isOpen ? 'rte-toolbar__btn--active' : ''}`}\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n title={labels.floatingDialog || 'Floating Dialog'}\n style={{ width: 'auto', padding: '0 6px', gap: '2px', display: 'inline-flex', alignItems: 'center' }}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"2\" y=\"4\" width=\"13\" height=\"10\" rx=\"2\" />\n <path d=\"M9 10h11a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2v-2\" />\n <line x1=\"7\" y1=\"14\" x2=\"13\" y2=\"14\" />\n </svg>\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n {isOpen && (\n <div ref={dropdownRef} className=\"rte-toolbar__template-dropdown\" style={{ ...dropdownStyle, minWidth: 140 }}>\n {DIALOG_LAYOUT_OPTIONS.map((opt) => (\n <button\n key={opt.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => {\n const focusEditor = event.detail === 0 || pointerType.current !== 'touch';\n flushSync(() => setIsOpen(false));\n onInsert(opt.key, focusEditor);\n }}\n >\n <span className=\"rte-toolbar__template-icon\" style={{ display: 'flex', alignItems: 'center' }}>{opt.icon}</span>\n <span>{labels[opt.labelKey] || opt.labelKey}</span>\n </button>\n ))}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;AAUA,IAAMA,IAAgJ;CACpJ;EACE,KAAK;EAAS,UAAU;EACxB,MAAM,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,QAAO;GAAe,aAAY;GAA9F,UAAA;IAAkG,kBAAC,QAAD;KAAM,GAAE;KAAI,GAAE;KAAI,OAAM;KAAK,QAAO;KAAK,IAAG;IAAK,CAAA;IAAC,kBAAC,QAAD;KAAM,IAAG;KAAI,IAAG;KAAI,IAAG;KAAK,IAAG;IAAK,CAAA;IAAC,kBAAC,QAAD;KAAM,IAAG;KAAI,IAAG;KAAK,IAAG;KAAK,IAAG;IAAM,CAAA;GAAM;;CAC7O;CACA;EACE,KAAK;EAAa,UAAU;EAC5B,MAAM,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,QAAO;GAAe,aAAY;GAA9F,UAAA;IAAkG,kBAAC,QAAD;KAAM,GAAE;KAAI,GAAE;KAAI,OAAM;KAAK,QAAO;KAAI,IAAG;IAAK,CAAA;IAAC,kBAAC,QAAD;KAAM,IAAG;KAAK,IAAG;KAAI,IAAG;KAAK,IAAG;IAAK,CAAA;IAAC,kBAAC,QAAD;KAAM,IAAG;KAAK,IAAG;KAAI,IAAG;KAAK,IAAG;IAAK,CAAA;IAAC,kBAAC,QAAD;KAA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AAD;MAAM,IAAG;MAAI,IAAG;MAAK,IAAG;MAAK,IAAG;KAAM,CAAA;IACnC;GACL,CAAA,GAAA,kBAAC,OAAD;IAAK,OAAM;IAAK,QAAO;IAAK,SAAQ;IAAY,MAAK;IAAO,QAAO;IAAe,aAAY;IAC5F,UAAA,kBAAC,YAAD,EAAU,QAAO,iBAAkB,CAAA;GAChC,CAAA,CACC;EACP,CAAA,GAAAb,KACC,kBAAC,OAAD;GAAK,KAAKM;GAAa,WAAU;GAAiC,OAAO;IAAE,GAAGC;IAAe,UAAU;GAAI;GACxG,UAAAT,EAAsB,KAAK,MAC1B,kBAAC,UAAD;IAEE,MAAK;IACL,WAAU;IACV,UAAU,MAAU;KAClB,IAAMgB,IAAcF,EAAM,WAAW,KAAKH,EAAY,YAAY;KAElE,AADAM,QAAgBd,EAAU,EAAK,CAAC,GAChCe,EAASC,EAAI,KAAKH,CAAW;IAC/B;IARF,UAAA,CAUE,kBAAC,QAAD;KAAM,WAAU;KAA6B,OAAO;MAAE,SAAS;MAAQ,YAAY;KAAS;KAAI,UAAAG,EAAI;IAAW,CAAA,GAC/G,kBAAC,QAAD,EAAA,UAAOJ,EAAOI,EAAI,aAAaA,EAAI,SAAe,CAAA,CAC5C;GAXD,GAAAA,EAAI,GAWH,CACT;EACE,CAAA,CAEJ;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownTemplates.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport { flushSync } from 'react-dom';\nimport type { RichTextEditorLabels } from '../types';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\nexport const MD_TEMPLATES: { key: string; labelKey: keyof RichTextEditorLabels; icon: string; content: string }[] = [\n {\n key: 'flowchart', labelKey: 'mdTplFlowchart', icon: '🔀',\n content: `## Flowchart\n\n\\`\\`\\`mermaid\ngraph TD\n A[Start] --> B{Is it valid?}\n B -->|Yes| C[Process Data]\n B -->|No| D[Show Error]\n C --> E[Save to DB]\n E --> F[Send Response]\n D --> G[Log Warning]\n G --> A\n F --> H[End]\n\\`\\`\\`\n`,\n },\n {\n key: 'sequence', labelKey: 'mdTplSequence', icon: '🔄',\n content: `## Sequence Diagram\n\n\\`\\`\\`mermaid\nsequenceDiagram\n participant Browser\n participant Server\n participant Database\n participant Cache\n\n Browser->>Server: POST /api/login\n Server->>Database: Query user\n Database-->>Server: User record\n Server->>Cache: Store session\n Cache-->>Server: OK\n Server-->>Browser: 200 JWT Token\n Browser->>Server: GET /api/data (Bearer token)\n Server->>Cache: Validate session\n Cache-->>Server: Valid\n Server->>Database: Fetch data\n Database-->>Server: Result set\n Server-->>Browser: 200 JSON data\n\\`\\`\\`\n`,\n },\n {\n key: 'pie', labelKey: 'mdTplPieChart', icon: '🥧',\n content: `## Pie Chart\n\n\\`\\`\\`mermaid\npie title Tech Stack Usage 2025\n \"TypeScript\" : 35\n \"Python\" : 25\n \"Rust\" : 15\n \"Go\" : 12\n \"Java\" : 8\n \"Others\" : 5\n\\`\\`\\`\n`,\n },\n {\n key: 'gantt', labelKey: 'mdTplGantt', icon: '📊',\n content: `## Gantt Chart\n\n\\`\\`\\`mermaid\ngantt\n title Project Development Timeline\n dateFormat YYYY-MM-DD\n section Design\n UI/UX Design :a1, 2025-01-01, 20d\n API Design :a2, after a1, 10d\n section Frontend\n Component Library :b1, after a2, 25d\n Page Integration :b2, after b1, 15d\n Testing & Bug Fix :b3, after b2, 10d\n section Backend\n Core API Development :c1, after a2, 30d\n Database Optimization :c2, after c1, 10d\n section Deployment\n Staging Deploy :d1, after b3, 5d\n Production Release :milestone, after d1, 0d\n\\`\\`\\`\n`,\n },\n {\n key: 'xychart', labelKey: 'mdTplBarChart', icon: '📈',\n content: `## Bar Chart (xychart)\n\n\\`\\`\\`mermaid\nxychart-beta\n title \"Monthly Revenue (in thousands)\"\n x-axis [Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]\n y-axis \"Revenue (USD)\" 0 --> 120\n bar [52, 48, 61, 55, 72, 68, 85, 90, 78, 95, 102, 110]\n line [52, 48, 61, 55, 72, 68, 85, 90, 78, 95, 102, 110]\n\\`\\`\\`\n`,\n },\n {\n key: 'python', labelKey: 'mdTplPython', icon: '🐍',\n content: `## Python Example\n\n\\`\\`\\`python\nimport asyncio\nfrom dataclasses import dataclass, field\nfrom typing import AsyncIterator\n\n\n@dataclass\nclass DataPipeline:\n \"\"\"Async data processing pipeline.\"\"\"\n name: str\n buffer_size: int = 100\n _queue: asyncio.Queue = field(init=False)\n\n def __post_init__(self):\n self._queue = asyncio.Queue(maxsize=self.buffer_size)\n\n async def produce(self, items: list[int]) -> None:\n for item in items:\n transformed = item ** 2 + 2 * item + 1\n await self._queue.put(transformed)\n await self._queue.put(None) # sentinel\n\n async def consume(self) -> AsyncIterator[int]:\n while True:\n item = await self._queue.get()\n if item is None:\n break\n yield item\n\n async def run(self, data: list[int]) -> list[int]:\n results: list[int] = []\n producer = asyncio.create_task(self.produce(data))\n async for value in self.consume():\n results.append(value)\n await producer\n return results\n\n\nasync def main():\n pipeline = DataPipeline(name=\"squares\", buffer_size=50)\n data = list(range(1, 21))\n results = await pipeline.run(data)\n print(f\"Processed {len(results)} items: {results[:5]}...\")\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n\\`\\`\\`\n`,\n },\n {\n key: 'typescript', labelKey: 'mdTplTypeScript', icon: '🟦',\n content: `## TypeScript Example\n\n\\`\\`\\`typescript\ninterface APIResponse<T> {\n data: T;\n status: number;\n message: string;\n timestamp: Date;\n}\n\ntype HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';\n\nclass TypedFetcher {\n private baseUrl: string;\n private headers: Record<string, string>;\n\n constructor(baseUrl: string, token?: string) {\n this.baseUrl = baseUrl;\n this.headers = {\n 'Content-Type': 'application/json',\n ...(token ? { Authorization: \\\\\\`Bearer \\\\\\${token}\\\\\\` } : {}),\n };\n }\n\n async request<T>(\n method: HttpMethod,\n path: string,\n body?: unknown,\n ): Promise<APIResponse<T>> {\n const response = await fetch(\\\\\\`\\\\\\${this.baseUrl}\\\\\\${path}\\\\\\`, {\n method,\n headers: this.headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n throw new Error(\\\\\\`HTTP \\\\\\${response.status}: \\\\\\${response.statusText}\\\\\\`);\n }\n\n return response.json() as Promise<APIResponse<T>>;\n }\n\n get<T>(path: string) { return this.request<T>('GET', path); }\n post<T>(path: string, body: unknown) { return this.request<T>('POST', path, body); }\n put<T>(path: string, body: unknown) { return this.request<T>('PUT', path, body); }\n delete<T>(path: string) { return this.request<T>('DELETE', path); }\n}\n\n// Usage\ninterface User {\n id: number;\n name: string;\n email: string;\n}\n\nconst api = new TypedFetcher('https://api.example.com', 'my-token');\nconst users = await api.get<User[]>('/users');\nconsole.log(users.data);\n\\`\\`\\`\n`,\n },\n {\n key: 'rust', labelKey: 'mdTplRust', icon: '🦀',\n content: `## Rust Example\n\n\\`\\`\\`rust\nuse std::collections::HashMap;\nuse std::sync::Arc;\nuse tokio::sync::RwLock;\n\n#[derive(Debug, Clone)]\nstruct CacheEntry<V: Clone> {\n value: V,\n expires_at: std::time::Instant,\n}\n\n#[derive(Clone)]\nstruct AsyncCache<V: Clone + Send + Sync + 'static> {\n store: Arc<RwLock<HashMap<String, CacheEntry<V>>>>,\n ttl: std::time::Duration,\n}\n\nimpl<V: Clone + Send + Sync + 'static> AsyncCache<V> {\n fn new(ttl_secs: u64) -> Self {\n Self {\n store: Arc::new(RwLock::new(HashMap::new())),\n ttl: std::time::Duration::from_secs(ttl_secs),\n }\n }\n\n async fn get(&self, key: &str) -> Option<V> {\n let store = self.store.read().await;\n store.get(key).and_then(|entry| {\n if entry.expires_at > std::time::Instant::now() {\n Some(entry.value.clone())\n } else {\n None\n }\n })\n }\n\n async fn set(&self, key: String, value: V) {\n let mut store = self.store.write().await;\n store.insert(key, CacheEntry {\n value,\n expires_at: std::time::Instant::now() + self.ttl,\n });\n }\n\n async fn cleanup(&self) -> usize {\n let mut store = self.store.write().await;\n let now = std::time::Instant::now();\n let before = store.len();\n store.retain(|_, entry| entry.expires_at > now);\n before - store.len()\n }\n}\n\n#[tokio::main]\nasync fn main() {\n let cache = AsyncCache::<String>::new(60);\n cache.set(\"hello\".into(), \"world\".into()).await;\n\n if let Some(val) = cache.get(\"hello\").await {\n println!(\"Got: {val}\");\n }\n}\n\\`\\`\\`\n`,\n },\n {\n key: 'math', labelKey: 'mdTplMath', icon: '🔢',\n content: `## Math Formulas (TeX)\n\n### Euler's Identity\n\n$$\ne^{i\\\\pi} + 1 = 0\n$$\n\n### Quadratic Formula\n\n$$\nx = \\\\frac{-b \\\\pm \\\\sqrt{b^2 - 4ac}}{2a}\n$$\n\n### Gaussian Integral\n\n$$\n\\\\int_{-\\\\infty}^{\\\\infty} e^{-x^2} \\\\, dx = \\\\sqrt{\\\\pi}\n$$\n\n### Maxwell's Equations\n\n$$\n\\\\nabla \\\\cdot \\\\mathbf{E} = \\\\frac{\\\\rho}{\\\\epsilon_0}\n$$\n\n$$\n\\\\nabla \\\\cdot \\\\mathbf{B} = 0\n$$\n\n$$\n\\\\nabla \\\\times \\\\mathbf{E} = -\\\\frac{\\\\partial \\\\mathbf{B}}{\\\\partial t}\n$$\n\n$$\n\\\\nabla \\\\times \\\\mathbf{B} = \\\\mu_0 \\\\mathbf{J} + \\\\mu_0 \\\\epsilon_0 \\\\frac{\\\\partial \\\\mathbf{E}}{\\\\partial t}\n$$\n\n### Taylor Series Expansion\n\n$$\nf(x) = \\\\sum_{n=0}^{\\\\infty} \\\\frac{f^{(n)}(a)}{n!}(x-a)^n\n$$\n\n### Matrix Notation\n\n$$\n\\\\mathbf{A} = \\\\begin{pmatrix} a_{11} & a_{12} & \\\\cdots & a_{1n} \\\\\\\\ a_{21} & a_{22} & \\\\cdots & a_{2n} \\\\\\\\ \\\\vdots & \\\\vdots & \\\\ddots & \\\\vdots \\\\\\\\ a_{m1} & a_{m2} & \\\\cdots & a_{mn} \\\\end{pmatrix}\n$$\n\n### Inline math: The identity $e^{i\\\\theta} = \\\\cos\\\\theta + i\\\\sin\\\\theta$ is known as Euler's formula.\n`,\n },\n {\n key: 'mixed', labelKey: 'mdTplMixed', icon: '🎨',\n content: `## Mixed Content Example\n\n### Architecture Overview\n\n\\`\\`\\`mermaid\ngraph LR\n Client[Client App] --> Gateway[API Gateway]\n Gateway --> Auth[Auth Service]\n Gateway --> Core[Core Service]\n Core --> DB[(PostgreSQL)]\n Core --> Cache[(Redis)]\n Auth --> DB\n\\`\\`\\`\n\n### Performance Formula\n\nThe response time $T$ is calculated as:\n\n$$\nT = T_{network} + T_{processing} + T_{db}\n$$\n\nwhere $T_{db} = O(\\\\log n)$ with proper indexing.\n\n### Implementation\n\n\\`\\`\\`python\nfrom fastapi import FastAPI, Depends\nfrom functools import lru_cache\n\napp = FastAPI()\n\n@lru_cache(maxsize=256)\ndef compute_heavy(n: int) -> float:\n \"\"\"Cached computation: O(log n) amortized.\"\"\"\n return sum(1.0 / i for i in range(1, n + 1))\n\n@app.get(\"/api/harmonic/{n}\")\nasync def harmonic(n: int):\n result = compute_heavy(n)\n return {\"n\": n, \"H_n\": round(result, 6)}\n\\`\\`\\`\n\n### Project Status\n\n\\`\\`\\`mermaid\npie title Sprint Progress\n \"Completed\" : 65\n \"In Progress\" : 20\n \"Blocked\" : 10\n \"Not Started\" : 5\n\\`\\`\\`\n`,\n },\n];\n\ninterface MarkdownTemplateMenuProps {\n labels: RichTextEditorLabels;\n onSelect: (content: string, focusEditor?: boolean) => void;\n}\n\nexport const MarkdownTemplateMenu: React.FC<MarkdownTemplateMenuProps> = ({ labels, onSelect }) => {\n const [isOpen, setIsOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, dropdownRef);\n const pointerType = useRef('');\n const select = (event: React.MouseEvent, content: string) => {\n // Touch insertion must not enter Android's native editing/IME focus path.\n const focusEditor = event.detail === 0 || pointerType.current !== 'touch';\n flushSync(() => setIsOpen(false));\n onSelect(content, focusEditor);\n };\n\n useEffect(() => {\n const handler = (e: PointerEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener('pointerdown', handler);\n return () => document.removeEventListener('pointerdown', handler);\n }, []);\n\n return (\n <div ref={ref} className=\"rte-toolbar__template-menu\" onPointerDown={(event) => { pointerType.current = event.pointerType; }}>\n <button\n type=\"button\"\n ref={triggerRef}\n className={`rte-toolbar__btn ${isOpen ? 'rte-toolbar__btn--active' : ''}`}\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n title={labels.mdTemplates || 'Markdown Templates'}\n style={{ width: 'auto', padding: '0 6px', gap: '2px', display: 'inline-flex', alignItems: 'center' }}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"8\" height=\"8\" rx=\"1.5\" />\n <rect x=\"13\" y=\"3\" width=\"8\" height=\"8\" rx=\"1.5\" />\n <rect x=\"3\" y=\"13\" width=\"8\" height=\"8\" rx=\"1.5\" />\n <path d=\"M17 14v6M14 17h6\" />\n </svg>\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n {isOpen && (\n <div ref={dropdownRef} className=\"rte-toolbar__template-dropdown\" style={dropdownStyle}>\n <div className=\"rte-toolbar__template-group-label\">Mermaid</div>\n {MD_TEMPLATES.filter(t => ['flowchart', 'sequence', 'pie', 'gantt', 'xychart'].includes(t.key)).map(t => (\n <button\n key={t.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => select(event, t.content)}\n >\n <span className=\"rte-toolbar__template-icon\">{t.icon}</span>\n <span>{labels[t.labelKey] || t.labelKey}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Code</div>\n {MD_TEMPLATES.filter(t => ['python', 'typescript', 'rust'].includes(t.key)).map(t => (\n <button\n key={t.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => select(event, t.content)}\n >\n <span className=\"rte-toolbar__template-icon\">{t.icon}</span>\n <span>{labels[t.labelKey] || t.labelKey}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Math / Mixed</div>\n {MD_TEMPLATES.filter(t => ['math', 'mixed'].includes(t.key)).map(t => (\n <button\n key={t.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => select(event, t.content)}\n >\n <span className=\"rte-toolbar__template-icon\">{t.icon}</span>\n <span>{labels[t.labelKey] || t.labelKey}</span>\n </button>\n ))}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;AAKA,IAAa,IAAuG;CAClH;EACE,KAAK;EAAa,UAAU;EAAkB,MAAM;EACpD,SAAS;CAcX;CACA;EACE,KAAK;EAAY,UAAU;EAAiB,MAAM;EAClD,SAAS;CAuBX;CACA;EACE,KAAK;EAAO,UAAU;EAAiB,MAAM;EAC7C,SAAS;CAYX;CACA;EACE,KAAK;EAAS,UAAU;EAAc,MAAM;EAC5C,SAAS;CAqBX;CACA;EACE,KAAK;EAAW,UAAU;EAAiB,MAAM;EACjD,SAAS;CAWX;CACA;EACE,KAAK;EAAU,UAAU;EAAe,MAAM;EAC9C,SAAS;CAmDX;CACA;EACE,KAAK;EAAc,UAAU;EAAmB,MAAM;EACtD,SAAS;CA4DX;CACA;EACE,KAAK;EAAQ,UAAU;EAAa,MAAM;EAC1C,SAAS;CAkEX;CACA;EACE,KAAK;EAAQ,UAAU;EAAa,MAAM;EAC1C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A,GAC3D,kBAAC,QAAD,EAAA,UAAO,EAAO,EAAE,aAAa,EAAE,SAAe,CAAA,CACxC;IAPD,GAAA,EAAE,GAOD,CACT;IACD,kBAAC,OAAD;KAAK,WAAU;KAAoC,UAAA;IAAiB,CAAA;IACnE,EAAa,QAAO,MAAK,CAAC,QAAQ,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,KAAI,MAC/D,kBAAC,UAAD;KAEE,MAAK;KACL,WAAU;KACV,UAAU,MAAU,EAAO,GAAO,EAAE,OAAO;KAJ7C,UAAA,CAME,kBAAC,QAAD;MAAM,WAAU;MAA8B,UAAA,EAAE;KAAW,CAAA,GAC3D,kBAAC,QAAD,EAAA,UAAO,EAAO,EAAE,aAAa,EAAE,SAAe,CAAA,CACxC;IAPD,GAAA,EAAE,GAOD,CACT;GACE;EAEJ,CAAA,CAAA;;AAET"}
|
|
1
|
+
{"version":3,"file":"MarkdownTemplates.js","names":["MD_TEMPLATES","MarkdownTemplateMenu","isOpen","setIsOpen","useState","ref","useRef","triggerRef","dropdownRef","dropdownStyle","useAnchoredDropdown","pointerType","select","focusEditor","event","flushSync","onSelect","content","useEffect","handler","labels","t"],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport { flushSync } from 'react-dom';\nimport type { RichTextEditorLabels } from '../types';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\nexport const MD_TEMPLATES: { key: string; labelKey: keyof RichTextEditorLabels; icon: string; content: string }[] = [\n {\n key: 'flowchart', labelKey: 'mdTplFlowchart', icon: '🔀',\n content: `## Flowchart\n\n\\`\\`\\`mermaid\ngraph TD\n A[Start] --> B{Is it valid?}\n B -->|Yes| C[Process Data]\n B -->|No| D[Show Error]\n C --> E[Save to DB]\n E --> F[Send Response]\n D --> G[Log Warning]\n G --> A\n F --> H[End]\n\\`\\`\\`\n`,\n },\n {\n key: 'sequence', labelKey: 'mdTplSequence', icon: '🔄',\n content: `## Sequence Diagram\n\n\\`\\`\\`mermaid\nsequenceDiagram\n participant Browser\n participant Server\n participant Database\n participant Cache\n\n Browser->>Server: POST /api/login\n Server->>Database: Query user\n Database-->>Server: User record\n Server->>Cache: Store session\n Cache-->>Server: OK\n Server-->>Browser: 200 JWT Token\n Browser->>Server: GET /api/data (Bearer token)\n Server->>Cache: Validate session\n Cache-->>Server: Valid\n Server->>Database: Fetch data\n Database-->>Server: Result set\n Server-->>Browser: 200 JSON data\n\\`\\`\\`\n`,\n },\n {\n key: 'pie', labelKey: 'mdTplPieChart', icon: '🥧',\n content: `## Pie Chart\n\n\\`\\`\\`mermaid\npie title Tech Stack Usage 2025\n \"TypeScript\" : 35\n \"Python\" : 25\n \"Rust\" : 15\n \"Go\" : 12\n \"Java\" : 8\n \"Others\" : 5\n\\`\\`\\`\n`,\n },\n {\n key: 'gantt', labelKey: 'mdTplGantt', icon: '📊',\n content: `## Gantt Chart\n\n\\`\\`\\`mermaid\ngantt\n title Project Development Timeline\n dateFormat YYYY-MM-DD\n section Design\n UI/UX Design :a1, 2025-01-01, 20d\n API Design :a2, after a1, 10d\n section Frontend\n Component Library :b1, after a2, 25d\n Page Integration :b2, after b1, 15d\n Testing & Bug Fix :b3, after b2, 10d\n section Backend\n Core API Development :c1, after a2, 30d\n Database Optimization :c2, after c1, 10d\n section Deployment\n Staging Deploy :d1, after b3, 5d\n Production Release :milestone, after d1, 0d\n\\`\\`\\`\n`,\n },\n {\n key: 'xychart', labelKey: 'mdTplBarChart', icon: '📈',\n content: `## Bar Chart (xychart)\n\n\\`\\`\\`mermaid\nxychart-beta\n title \"Monthly Revenue (in thousands)\"\n x-axis [Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]\n y-axis \"Revenue (USD)\" 0 --> 120\n bar [52, 48, 61, 55, 72, 68, 85, 90, 78, 95, 102, 110]\n line [52, 48, 61, 55, 72, 68, 85, 90, 78, 95, 102, 110]\n\\`\\`\\`\n`,\n },\n {\n key: 'python', labelKey: 'mdTplPython', icon: '🐍',\n content: `## Python Example\n\n\\`\\`\\`python\nimport asyncio\nfrom dataclasses import dataclass, field\nfrom typing import AsyncIterator\n\n\n@dataclass\nclass DataPipeline:\n \"\"\"Async data processing pipeline.\"\"\"\n name: str\n buffer_size: int = 100\n _queue: asyncio.Queue = field(init=False)\n\n def __post_init__(self):\n self._queue = asyncio.Queue(maxsize=self.buffer_size)\n\n async def produce(self, items: list[int]) -> None:\n for item in items:\n transformed = item ** 2 + 2 * item + 1\n await self._queue.put(transformed)\n await self._queue.put(None) # sentinel\n\n async def consume(self) -> AsyncIterator[int]:\n while True:\n item = await self._queue.get()\n if item is None:\n break\n yield item\n\n async def run(self, data: list[int]) -> list[int]:\n results: list[int] = []\n producer = asyncio.create_task(self.produce(data))\n async for value in self.consume():\n results.append(value)\n await producer\n return results\n\n\nasync def main():\n pipeline = DataPipeline(name=\"squares\", buffer_size=50)\n data = list(range(1, 21))\n results = await pipeline.run(data)\n print(f\"Processed {len(results)} items: {results[:5]}...\")\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n\\`\\`\\`\n`,\n },\n {\n key: 'typescript', labelKey: 'mdTplTypeScript', icon: '🟦',\n content: `## TypeScript Example\n\n\\`\\`\\`typescript\ninterface APIResponse<T> {\n data: T;\n status: number;\n message: string;\n timestamp: Date;\n}\n\ntype HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';\n\nclass TypedFetcher {\n private baseUrl: string;\n private headers: Record<string, string>;\n\n constructor(baseUrl: string, token?: string) {\n this.baseUrl = baseUrl;\n this.headers = {\n 'Content-Type': 'application/json',\n ...(token ? { Authorization: \\\\\\`Bearer \\\\\\${token}\\\\\\` } : {}),\n };\n }\n\n async request<T>(\n method: HttpMethod,\n path: string,\n body?: unknown,\n ): Promise<APIResponse<T>> {\n const response = await fetch(\\\\\\`\\\\\\${this.baseUrl}\\\\\\${path}\\\\\\`, {\n method,\n headers: this.headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n throw new Error(\\\\\\`HTTP \\\\\\${response.status}: \\\\\\${response.statusText}\\\\\\`);\n }\n\n return response.json() as Promise<APIResponse<T>>;\n }\n\n get<T>(path: string) { return this.request<T>('GET', path); }\n post<T>(path: string, body: unknown) { return this.request<T>('POST', path, body); }\n put<T>(path: string, body: unknown) { return this.request<T>('PUT', path, body); }\n delete<T>(path: string) { return this.request<T>('DELETE', path); }\n}\n\n// Usage\ninterface User {\n id: number;\n name: string;\n email: string;\n}\n\nconst api = new TypedFetcher('https://api.example.com', 'my-token');\nconst users = await api.get<User[]>('/users');\nconsole.log(users.data);\n\\`\\`\\`\n`,\n },\n {\n key: 'rust', labelKey: 'mdTplRust', icon: '🦀',\n content: `## Rust Example\n\n\\`\\`\\`rust\nuse std::collections::HashMap;\nuse std::sync::Arc;\nuse tokio::sync::RwLock;\n\n#[derive(Debug, Clone)]\nstruct CacheEntry<V: Clone> {\n value: V,\n expires_at: std::time::Instant,\n}\n\n#[derive(Clone)]\nstruct AsyncCache<V: Clone + Send + Sync + 'static> {\n store: Arc<RwLock<HashMap<String, CacheEntry<V>>>>,\n ttl: std::time::Duration,\n}\n\nimpl<V: Clone + Send + Sync + 'static> AsyncCache<V> {\n fn new(ttl_secs: u64) -> Self {\n Self {\n store: Arc::new(RwLock::new(HashMap::new())),\n ttl: std::time::Duration::from_secs(ttl_secs),\n }\n }\n\n async fn get(&self, key: &str) -> Option<V> {\n let store = self.store.read().await;\n store.get(key).and_then(|entry| {\n if entry.expires_at > std::time::Instant::now() {\n Some(entry.value.clone())\n } else {\n None\n }\n })\n }\n\n async fn set(&self, key: String, value: V) {\n let mut store = self.store.write().await;\n store.insert(key, CacheEntry {\n value,\n expires_at: std::time::Instant::now() + self.ttl,\n });\n }\n\n async fn cleanup(&self) -> usize {\n let mut store = self.store.write().await;\n let now = std::time::Instant::now();\n let before = store.len();\n store.retain(|_, entry| entry.expires_at > now);\n before - store.len()\n }\n}\n\n#[tokio::main]\nasync fn main() {\n let cache = AsyncCache::<String>::new(60);\n cache.set(\"hello\".into(), \"world\".into()).await;\n\n if let Some(val) = cache.get(\"hello\").await {\n println!(\"Got: {val}\");\n }\n}\n\\`\\`\\`\n`,\n },\n {\n key: 'math', labelKey: 'mdTplMath', icon: '🔢',\n content: `## Math Formulas (TeX)\n\n### Euler's Identity\n\n$$\ne^{i\\\\pi} + 1 = 0\n$$\n\n### Quadratic Formula\n\n$$\nx = \\\\frac{-b \\\\pm \\\\sqrt{b^2 - 4ac}}{2a}\n$$\n\n### Gaussian Integral\n\n$$\n\\\\int_{-\\\\infty}^{\\\\infty} e^{-x^2} \\\\, dx = \\\\sqrt{\\\\pi}\n$$\n\n### Maxwell's Equations\n\n$$\n\\\\nabla \\\\cdot \\\\mathbf{E} = \\\\frac{\\\\rho}{\\\\epsilon_0}\n$$\n\n$$\n\\\\nabla \\\\cdot \\\\mathbf{B} = 0\n$$\n\n$$\n\\\\nabla \\\\times \\\\mathbf{E} = -\\\\frac{\\\\partial \\\\mathbf{B}}{\\\\partial t}\n$$\n\n$$\n\\\\nabla \\\\times \\\\mathbf{B} = \\\\mu_0 \\\\mathbf{J} + \\\\mu_0 \\\\epsilon_0 \\\\frac{\\\\partial \\\\mathbf{E}}{\\\\partial t}\n$$\n\n### Taylor Series Expansion\n\n$$\nf(x) = \\\\sum_{n=0}^{\\\\infty} \\\\frac{f^{(n)}(a)}{n!}(x-a)^n\n$$\n\n### Matrix Notation\n\n$$\n\\\\mathbf{A} = \\\\begin{pmatrix} a_{11} & a_{12} & \\\\cdots & a_{1n} \\\\\\\\ a_{21} & a_{22} & \\\\cdots & a_{2n} \\\\\\\\ \\\\vdots & \\\\vdots & \\\\ddots & \\\\vdots \\\\\\\\ a_{m1} & a_{m2} & \\\\cdots & a_{mn} \\\\end{pmatrix}\n$$\n\n### Inline math: The identity $e^{i\\\\theta} = \\\\cos\\\\theta + i\\\\sin\\\\theta$ is known as Euler's formula.\n`,\n },\n {\n key: 'mixed', labelKey: 'mdTplMixed', icon: '🎨',\n content: `## Mixed Content Example\n\n### Architecture Overview\n\n\\`\\`\\`mermaid\ngraph LR\n Client[Client App] --> Gateway[API Gateway]\n Gateway --> Auth[Auth Service]\n Gateway --> Core[Core Service]\n Core --> DB[(PostgreSQL)]\n Core --> Cache[(Redis)]\n Auth --> DB\n\\`\\`\\`\n\n### Performance Formula\n\nThe response time $T$ is calculated as:\n\n$$\nT = T_{network} + T_{processing} + T_{db}\n$$\n\nwhere $T_{db} = O(\\\\log n)$ with proper indexing.\n\n### Implementation\n\n\\`\\`\\`python\nfrom fastapi import FastAPI, Depends\nfrom functools import lru_cache\n\napp = FastAPI()\n\n@lru_cache(maxsize=256)\ndef compute_heavy(n: int) -> float:\n \"\"\"Cached computation: O(log n) amortized.\"\"\"\n return sum(1.0 / i for i in range(1, n + 1))\n\n@app.get(\"/api/harmonic/{n}\")\nasync def harmonic(n: int):\n result = compute_heavy(n)\n return {\"n\": n, \"H_n\": round(result, 6)}\n\\`\\`\\`\n\n### Project Status\n\n\\`\\`\\`mermaid\npie title Sprint Progress\n \"Completed\" : 65\n \"In Progress\" : 20\n \"Blocked\" : 10\n \"Not Started\" : 5\n\\`\\`\\`\n`,\n },\n];\n\ninterface MarkdownTemplateMenuProps {\n labels: RichTextEditorLabels;\n onSelect: (content: string, focusEditor?: boolean) => void;\n}\n\nexport const MarkdownTemplateMenu: React.FC<MarkdownTemplateMenuProps> = ({ labels, onSelect }) => {\n const [isOpen, setIsOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, dropdownRef);\n const pointerType = useRef('');\n const select = (event: React.MouseEvent, content: string) => {\n // Touch insertion must not enter Android's native editing/IME focus path.\n const focusEditor = event.detail === 0 || pointerType.current !== 'touch';\n flushSync(() => setIsOpen(false));\n onSelect(content, focusEditor);\n };\n\n useEffect(() => {\n const handler = (e: PointerEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener('pointerdown', handler);\n return () => document.removeEventListener('pointerdown', handler);\n }, []);\n\n return (\n <div ref={ref} className=\"rte-toolbar__template-menu\" onPointerDown={(event) => { pointerType.current = event.pointerType; }}>\n <button\n type=\"button\"\n ref={triggerRef}\n className={`rte-toolbar__btn ${isOpen ? 'rte-toolbar__btn--active' : ''}`}\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n title={labels.mdTemplates || 'Markdown Templates'}\n style={{ width: 'auto', padding: '0 6px', gap: '2px', display: 'inline-flex', alignItems: 'center' }}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"8\" height=\"8\" rx=\"1.5\" />\n <rect x=\"13\" y=\"3\" width=\"8\" height=\"8\" rx=\"1.5\" />\n <rect x=\"3\" y=\"13\" width=\"8\" height=\"8\" rx=\"1.5\" />\n <path d=\"M17 14v6M14 17h6\" />\n </svg>\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n {isOpen && (\n <div ref={dropdownRef} className=\"rte-toolbar__template-dropdown\" style={dropdownStyle}>\n <div className=\"rte-toolbar__template-group-label\">Mermaid</div>\n {MD_TEMPLATES.filter(t => ['flowchart', 'sequence', 'pie', 'gantt', 'xychart'].includes(t.key)).map(t => (\n <button\n key={t.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => select(event, t.content)}\n >\n <span className=\"rte-toolbar__template-icon\">{t.icon}</span>\n <span>{labels[t.labelKey] || t.labelKey}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Code</div>\n {MD_TEMPLATES.filter(t => ['python', 'typescript', 'rust'].includes(t.key)).map(t => (\n <button\n key={t.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => select(event, t.content)}\n >\n <span className=\"rte-toolbar__template-icon\">{t.icon}</span>\n <span>{labels[t.labelKey] || t.labelKey}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Math / Mixed</div>\n {MD_TEMPLATES.filter(t => ['math', 'mixed'].includes(t.key)).map(t => (\n <button\n key={t.key}\n type=\"button\"\n className=\"rte-toolbar__template-item\"\n onClick={(event) => select(event, t.content)}\n >\n <span className=\"rte-toolbar__template-icon\">{t.icon}</span>\n <span>{labels[t.labelKey] || t.labelKey}</span>\n </button>\n ))}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;AAKA,IAAaA,IAAuG;CAClH;EACE,KAAK;EAAa,UAAU;EAAkB,MAAM;EACpD,SAAS;CAcX;CACA;EACE,KAAK;EAAY,UAAU;EAAiB,MAAM;EAClD,SAAS;CAuBX;CACA;EACE,KAAK;EAAO,UAAU;EAAiB,MAAM;EAC7C,SAAS;CAYX;CACA;EACE,KAAK;EAAS,UAAU;EAAc,MAAM;EAC5C,SAAS;CAqBX;CACA;EACE,KAAK;EAAW,UAAU;EAAiB,MAAM;EACjD,SAAS;CAWX;CACA;EACE,KAAK;EAAU,UAAU;EAAe,MAAM;EAC9C,SAAS;CAmDX;CACA;EACE,KAAK;EAAc,UAAU;EAAmB,MAAM;EACtD,SAAS;CA4DX;CACA;EACE,KAAK;EAAQ,UAAU;EAAa,MAAM;EAC1C,SAAS;CAkEX;CACA;EACE,KAAK;EAAQ,UAAU;EAAa,MAAM;EAC1C,SAAS;CAoDX;CACA;EACE,KAAK;EAAS,UAAU;EAAc,MAAM;EAC5C,SAAS;CAqDX;AACF,GAOaC,KAA6D,EAAE,WAAQ,kBAAe;CACjG,IAAM,CAACC,GAAQC,KAAaC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C;IAPD,GAAAA,EAAE,GAOD,CACT;IACD,kBAAC,OAAD;KAAK,WAAU;KAAoC,UAAA;IAAiB,CAAA;IACnErB,EAAa,QAAO,MAAK,CAAC,QAAQ,OAAO,CAAC,CAAC,SAASqB,EAAE,GAAG,CAAC,CAAC,CAAC,KAAI,MAC/D,kBAAC,UAAD;KAEE,MAAK;KACL,WAAU;KACV,UAAU,MAAUT,EAAOE,GAAOO,EAAE,OAAO;KAJ7C,UAAA,CAME,kBAAC,QAAD;MAAM,WAAU;MAA8B,UAAAA,EAAE;KAAW,CAAA,GAC3D,kBAAC,QAAD,EAAA,UAAOD,EAAOC,EAAE,aAAaA,EAAE,SAAe,CAAA,CACxC;IAPD,GAAAA,EAAE,GAOD,CACT;GACE;EAEJ,CAAA,CAAA;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDropdown.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/SelectDropdown.tsx"],"sourcesContent":["import React from 'react';\nimport Select from '../../../Select';\n\nexport const FONT_FAMILIES = [\n { label: 'Default', value: '' },\n { label: 'Arial', value: 'Arial, sans-serif' },\n { label: 'Helvetica', value: 'Helvetica, sans-serif' },\n { label: 'Georgia', value: 'Georgia, serif' },\n { label: 'Times New Roman', value: 'Times New Roman, serif' },\n { label: 'Courier New', value: 'Courier New, monospace' },\n { label: 'Verdana', value: 'Verdana, sans-serif' },\n { label: 'Trebuchet MS', value: 'Trebuchet MS, sans-serif' },\n { label: 'Impact', value: 'Impact, sans-serif' },\n { label: 'Comic Sans MS', value: 'Comic Sans MS, cursive' },\n];\n\nexport const FONT_SIZES = [\n { label: 'Default', value: '' },\n { label: '10px', value: '10px' },\n { label: '12px', value: '12px' },\n { label: '14px', value: '14px' },\n { label: '16px', value: '16px' },\n { label: '18px', value: '18px' },\n { label: '20px', value: '20px' },\n { label: '24px', value: '24px' },\n { label: '28px', value: '28px' },\n { label: '32px', value: '32px' },\n { label: '36px', value: '36px' },\n { label: '48px', value: '48px' },\n { label: '64px', value: '64px' },\n { label: '72px', value: '72px' },\n];\n\ninterface SelectDropdownProps {\n value: string;\n options: { label: string; value: string }[];\n onChange: (value: string) => void;\n title?: string;\n width?: number;\n className?: string;\n}\n\nexport const SelectDropdown: React.FC<SelectDropdownProps> = ({ value, options, onChange, title, width = 110, className = 'rte-toolbar__select' }) => (\n <Select\n className={className}\n style={{ width }}\n options={options}\n value={value}\n onChange={(next) => onChange(String(next))}\n aria-label={title ?? 'Formatting option'}\n />\n);\n"],"mappings":";;;;AAGA,
|
|
1
|
+
{"version":3,"file":"SelectDropdown.js","names":["Select","FONT_FAMILIES","FONT_SIZES","SelectDropdown","onChange","next","title"],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/SelectDropdown.tsx"],"sourcesContent":["import React from 'react';\nimport Select from '../../../Select';\n\nexport const FONT_FAMILIES = [\n { label: 'Default', value: '' },\n { label: 'Arial', value: 'Arial, sans-serif' },\n { label: 'Helvetica', value: 'Helvetica, sans-serif' },\n { label: 'Georgia', value: 'Georgia, serif' },\n { label: 'Times New Roman', value: 'Times New Roman, serif' },\n { label: 'Courier New', value: 'Courier New, monospace' },\n { label: 'Verdana', value: 'Verdana, sans-serif' },\n { label: 'Trebuchet MS', value: 'Trebuchet MS, sans-serif' },\n { label: 'Impact', value: 'Impact, sans-serif' },\n { label: 'Comic Sans MS', value: 'Comic Sans MS, cursive' },\n];\n\nexport const FONT_SIZES = [\n { label: 'Default', value: '' },\n { label: '10px', value: '10px' },\n { label: '12px', value: '12px' },\n { label: '14px', value: '14px' },\n { label: '16px', value: '16px' },\n { label: '18px', value: '18px' },\n { label: '20px', value: '20px' },\n { label: '24px', value: '24px' },\n { label: '28px', value: '28px' },\n { label: '32px', value: '32px' },\n { label: '36px', value: '36px' },\n { label: '48px', value: '48px' },\n { label: '64px', value: '64px' },\n { label: '72px', value: '72px' },\n];\n\ninterface SelectDropdownProps {\n value: string;\n options: { label: string; value: string }[];\n onChange: (value: string) => void;\n title?: string;\n width?: number;\n className?: string;\n}\n\nexport const SelectDropdown: React.FC<SelectDropdownProps> = ({ value, options, onChange, title, width = 110, className = 'rte-toolbar__select' }) => (\n <Select\n className={className}\n style={{ width }}\n options={options}\n value={value}\n onChange={(next) => onChange(String(next))}\n aria-label={title ?? 'Formatting option'}\n />\n);\n"],"mappings":";;;;AAGA,IAAaC,IAAgB;CAC3B;EAAE,OAAO;EAAW,OAAO;CAAG;CAC9B;EAAE,OAAO;EAAS,OAAO;CAAoB;CAC7C;EAAE,OAAO;EAAa,OAAO;CAAwB;CACrD;EAAE,OAAO;EAAW,OAAO;CAAiB;CAC5C;EAAE,OAAO;EAAmB,OAAO;CAAyB;CAC5D;EAAE,OAAO;EAAe,OAAO;CAAyB;CACxD;EAAE,OAAO;EAAW,OAAO;CAAsB;CACjD;EAAE,OAAO;EAAgB,OAAO;CAA2B;CAC3D;EAAE,OAAO;EAAU,OAAO;CAAqB;CAC/C;EAAE,OAAO;EAAiB,OAAO;CAAyB;AAC5D,GAEaC,IAAa;CACxB;EAAE,OAAO;EAAW,OAAO;CAAG;CAC9B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAQ,OAAO;CAAO;AACjC,GAWaC,KAAiD,EAAE,UAAO,YAAS,aAAU,UAAO,WAAQ,KAAK,eAAY,4BACxH,kBAACH,GAAD;CACa;CACX,OAAO,EAAE,SAAM;CACN;CACF;CACP,WAAW,MAASI,EAAS,OAAOC,CAAI,CAAC;CACzC,cAAYC,KAAS;AACtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableOpsMenu.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/TableOpsMenu.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport type { Editor } from '@tiptap/react';\nimport type { RichTextEditorLabels } from '../types';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\ninterface TableOpsMenuProps {\n editor: Editor;\n labels: RichTextEditorLabels;\n}\n\nexport const TableOpsMenu: React.FC<TableOpsMenuProps> = ({ editor, labels }) => {\n const [isOpen, setIsOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, dropdownRef);\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener('mousedown', handler);\n return () => document.removeEventListener('mousedown', handler);\n }, []);\n\n const isInTable = editor.isActive('table');\n\n const actions: { label: string; action: () => void; icon: string }[] = [\n { label: labels.tableAddColumnBefore || 'Add Column Before', action: () => editor.chain().focus().addColumnBefore().run(), icon: '⇤+' },\n { label: labels.tableAddColumnAfter || 'Add Column After', action: () => editor.chain().focus().addColumnAfter().run(), icon: '+⇥' },\n { label: labels.tableDeleteColumn || 'Delete Column', action: () => editor.chain().focus().deleteColumn().run(), icon: '−⫼' },\n { label: labels.tableAddRowBefore || 'Add Row Before', action: () => editor.chain().focus().addRowBefore().run(), icon: '↑+' },\n { label: labels.tableAddRowAfter || 'Add Row After', action: () => editor.chain().focus().addRowAfter().run(), icon: '+↓' },\n { label: labels.tableDeleteRow || 'Delete Row', action: () => editor.chain().focus().deleteRow().run(), icon: '−═' },\n { label: labels.tableMergeCells || 'Merge Cells', action: () => editor.chain().focus().mergeCells().run(), icon: '⊞' },\n { label: labels.tableSplitCell || 'Split Cell', action: () => editor.chain().focus().splitCell().run(), icon: '⊟' },\n { label: labels.tableDelete || 'Delete Table', action: () => editor.chain().focus().deleteTable().run(), icon: '🗑' },\n ];\n\n return (\n <div ref={ref} className=\"rte-toolbar__template-menu\">\n <button\n type=\"button\"\n ref={triggerRef}\n className={`rte-toolbar__btn ${isOpen ? 'rte-toolbar__btn--active' : ''}`}\n onClick={() => setIsOpen(!isOpen)}\n disabled={!isInTable}\n title={labels.tableOps || 'Table Operations'}\n style={{ width: 'auto', padding: '0 6px', gap: '2px', display: 'inline-flex', alignItems: 'center', opacity: isInTable ? 1 : 0.4 }}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\" /><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\" />\n <line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\" /><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\" />\n </svg>\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n {isOpen && isInTable && (\n <div ref={dropdownRef} className=\"rte-toolbar__template-dropdown\" style={dropdownStyle}>\n <div className=\"rte-toolbar__template-group-label\">Columns</div>\n {actions.slice(0, 3).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.label}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Rows</div>\n {actions.slice(3, 6).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.label}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Merge / Split</div>\n {actions.slice(6, 8).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.label}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Table</div>\n {actions.slice(8).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item rte-toolbar__template-item--danger\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.label}</span>\n </button>\n ))}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;AAUA,
|
|
1
|
+
{"version":3,"file":"TableOpsMenu.js","names":["TableOpsMenu","isOpen","setIsOpen","useState","ref","useRef","triggerRef","dropdownRef","dropdownStyle","useAnchoredDropdown","handler","isInTable","editor","actions","labels","a","i"],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/TableOpsMenu.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport type { Editor } from '@tiptap/react';\nimport type { RichTextEditorLabels } from '../types';\nimport { useAnchoredDropdown } from './useAnchoredDropdown';\n\ninterface TableOpsMenuProps {\n editor: Editor;\n labels: RichTextEditorLabels;\n}\n\nexport const TableOpsMenu: React.FC<TableOpsMenuProps> = ({ editor, labels }) => {\n const [isOpen, setIsOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const dropdownRef = useRef<HTMLDivElement>(null);\n const dropdownStyle = useAnchoredDropdown(isOpen, triggerRef, dropdownRef);\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener('mousedown', handler);\n return () => document.removeEventListener('mousedown', handler);\n }, []);\n\n const isInTable = editor.isActive('table');\n\n const actions: { label: string; action: () => void; icon: string }[] = [\n { label: labels.tableAddColumnBefore || 'Add Column Before', action: () => editor.chain().focus().addColumnBefore().run(), icon: '⇤+' },\n { label: labels.tableAddColumnAfter || 'Add Column After', action: () => editor.chain().focus().addColumnAfter().run(), icon: '+⇥' },\n { label: labels.tableDeleteColumn || 'Delete Column', action: () => editor.chain().focus().deleteColumn().run(), icon: '−⫼' },\n { label: labels.tableAddRowBefore || 'Add Row Before', action: () => editor.chain().focus().addRowBefore().run(), icon: '↑+' },\n { label: labels.tableAddRowAfter || 'Add Row After', action: () => editor.chain().focus().addRowAfter().run(), icon: '+↓' },\n { label: labels.tableDeleteRow || 'Delete Row', action: () => editor.chain().focus().deleteRow().run(), icon: '−═' },\n { label: labels.tableMergeCells || 'Merge Cells', action: () => editor.chain().focus().mergeCells().run(), icon: '⊞' },\n { label: labels.tableSplitCell || 'Split Cell', action: () => editor.chain().focus().splitCell().run(), icon: '⊟' },\n { label: labels.tableDelete || 'Delete Table', action: () => editor.chain().focus().deleteTable().run(), icon: '🗑' },\n ];\n\n return (\n <div ref={ref} className=\"rte-toolbar__template-menu\">\n <button\n type=\"button\"\n ref={triggerRef}\n className={`rte-toolbar__btn ${isOpen ? 'rte-toolbar__btn--active' : ''}`}\n onClick={() => setIsOpen(!isOpen)}\n disabled={!isInTable}\n title={labels.tableOps || 'Table Operations'}\n style={{ width: 'auto', padding: '0 6px', gap: '2px', display: 'inline-flex', alignItems: 'center', opacity: isInTable ? 1 : 0.4 }}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\" /><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\" />\n <line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\" /><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\" />\n </svg>\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n {isOpen && isInTable && (\n <div ref={dropdownRef} className=\"rte-toolbar__template-dropdown\" style={dropdownStyle}>\n <div className=\"rte-toolbar__template-group-label\">Columns</div>\n {actions.slice(0, 3).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.label}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Rows</div>\n {actions.slice(3, 6).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.label}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Merge / Split</div>\n {actions.slice(6, 8).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.label}</span>\n </button>\n ))}\n <div className=\"rte-toolbar__template-group-label\">Table</div>\n {actions.slice(8).map((a, i) => (\n <button key={i} type=\"button\" className=\"rte-toolbar__template-item rte-toolbar__template-item--danger\" onClick={() => { a.action(); setIsOpen(false); }}>\n <span className=\"rte-toolbar__template-icon\">{a.icon}</span>\n <span>{a.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CAAA;IACpEH,EAAQ,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,MAC3B,kBAAC,UAAD;KAAgB,MAAK;KAAS,WAAU;KAA6B,eAAe;MAAc,AAAZE,EAAE,OAAO,GAAGb,EAAU,EAAK;KAAG;KAApH,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAA8B,UAAAa,EAAE;KAAW,CAAA,GAC3D,kBAAC,QAAD,EAAA,UAAOA,EAAE,MAAY,CAAA,CACf;IAHK,GAAAC,CAGL,CACT;IACD,kBAAC,OAAD;KAAK,WAAU;KAAoC,UAAA;IAAU,CAAA;IAC5DH,EAAQ,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,MACxB,kBAAC,UAAD;KAAgB,MAAK;KAAS,WAAU;KAAgE,eAAe;MAAc,AAAZE,EAAE,OAAO,GAAGb,EAAU,EAAK;KAAG;KAAvJ,UAAA,CACE,kBAAC,QAAD;MAAM,WAAU;MAA8B,UAAAa,EAAE;KAAW,CAAA,GAC3D,kBAAC,QAAD,EAAA,UAAOA,EAAE,MAAY,CAAA,CACf;IAHK,GAAAC,CAGL,CACT;GACE;EAEJ,CAAA,CAAA;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/Toolbar.tsx"],"sourcesContent":["import React, { useCallback, useState, useEffect, useRef } from 'react';\nimport { useEditorState, type Editor } from '@tiptap/react';\nimport type { Mark } from '@tiptap/pm/model';\nimport type { ToolbarButtonConfig, ToolbarSection, RichTextEditorLabels } from '../types';\nimport { defaultLabels } from '../types';\nimport { getNextFloatZIndex } from '../extensions/FloatingDialog';\nimport { ToolbarButton, ToolbarDivider } from './ToolbarButton';\nimport { ColorPicker } from './ColorPicker';\nimport { SelectDropdown, FONT_FAMILIES, FONT_SIZES } from './SelectDropdown';\nimport { MarkdownTemplateMenu } from './MarkdownTemplates';\nimport { FloatingDialogMenu } from './FloatingDialogMenu';\nimport { TableOpsMenu } from './TableOpsMenu';\n\n// Only visual formatting belongs to the painter, never links or comment IDs.\nconst PAINT_MARKS = new Set(['bold', 'italic', 'underline', 'strike', 'code', 'subscript', 'superscript', 'textStyle', 'highlight']);\n\ninterface ToolbarProps {\n editor: Editor;\n config?: ToolbarSection;\n labels?: RichTextEditorLabels;\n hasAI?: boolean;\n onAIClick?: () => void;\n onRequestAIConfig?: () => void;\n onFormatPainterChange?: (active: boolean) => void;\n children?: React.ReactNode;\n}\n\nconst Toolbar: React.FC<ToolbarProps> = ({\n editor,\n config,\n labels: propsLabels,\n hasAI,\n onAIClick,\n onRequestAIConfig,\n onFormatPainterChange,\n children,\n}) => {\n const labels = { ...defaultLabels, ...propsLabels };\n useEditorState({ editor, selector: ({ transactionNumber }) => transactionNumber });\n const [formatPainterMarks, setFormatPainterMarks] = useState<readonly Mark[] | null>(null);\n const painterChange = useRef(onFormatPainterChange);\n useEffect(() => {\n painterChange.current = onFormatPainterChange;\n }, [onFormatPainterChange]);\n\n const cfg = {\n textFormat: config?.textFormat ?? true,\n heading: config?.heading ?? true,\n alignment: config?.alignment ?? true,\n list: config?.list ?? true,\n insert: config?.insert ?? true,\n color: config?.color ?? true,\n history: config?.history ?? true,\n ai: config?.ai ?? true,\n tableOps: config?.tableOps ?? true,\n fontStyle: config?.fontStyle ?? true,\n formatPainter: config?.formatPainter ?? true,\n };\n const buttons: ToolbarButtonConfig = config?.buttons ?? {};\n const show = (button: keyof ToolbarButtonConfig, section = true) => buttons[button] ?? section;\n\n const setLink = useCallback(() => {\n const previousUrl = editor.getAttributes('link').href;\n const url = window.prompt(labels.insertLinkUrl, previousUrl);\n if (url === null) return;\n if (editor.isDestroyed || !editor.isEditable) return;\n if (url.trim() === '') {\n editor.chain().focus().extendMarkRange('link').unsetLink().run();\n return;\n }\n editor.chain().focus().extendMarkRange('link').setLink({ href: url.trim() }).run();\n }, [editor, labels.insertLinkUrl]);\n\n const addImage = useCallback(() => {\n const url = window.prompt(labels.insertImageUrl);\n if (url) {\n editor.chain().focus().setImage({ src: url }).run();\n }\n }, [editor, labels.insertImageUrl]);\n\n const insertTable = useCallback(() => {\n editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run();\n }, [editor]);\n\n const insertMarkdownBlock = useCallback(() => {\n editor.chain().focus().insertContent({\n type: 'codeBlock',\n attrs: { language: 'r-markdown' },\n content: [{ type: 'text', text: '# Markdown\\n\\nWrite your **markdown** here.' }],\n }).run();\n }, [editor]);\n\n const insertMarkdownTemplate = useCallback((content: string, focusEditor = true) => {\n if (editor.isDestroyed || !editor.isEditable) return;\n const chain = editor.chain();\n if (focusEditor) chain.focus();\n chain.insertContent({\n type: 'codeBlock',\n attrs: { language: 'r-markdown' },\n content: [{ type: 'text', text: content }],\n }).run();\n }, [editor]);\n\n const insertFloatingDialog = useCallback((layout: 'block' | 'wrap-left' | 'wrap-right' | 'float' = 'block', focusEditor = true) => {\n if (editor.isDestroyed || !editor.isEditable) return;\n const extraAttrs = layout === 'float'\n ? { x: 40, y: 40, zIndex: getNextFloatZIndex(editor) }\n : layout === 'block'\n ? {}\n : { width: 240 };\n const chain = editor.chain();\n if (focusEditor) chain.focus();\n chain.insertContent({\n type: 'floatingDialog',\n attrs: { title: 'Note', layout, ...extraAttrs },\n content: [{ type: 'paragraph' }],\n }).run();\n }, [editor]);\n\n const handleFormatPainter = useCallback(() => {\n if (formatPainterMarks) {\n setFormatPainterMarks(null);\n return;\n }\n if (editor.isDestroyed || !editor.isEditable) return;\n const { from, to } = editor.state.selection;\n if (from === to) return;\n\n let marks: readonly Mark[] | undefined;\n editor.state.doc.nodesBetween(from, to, (node) => {\n if (!node.isText) return;\n const formatting = node.marks.filter((mark) => PAINT_MARKS.has(mark.type.name));\n marks = marks === undefined ? formatting : marks.filter((mark) => formatting.some((other) => mark.eq(other)));\n });\n if (marks === undefined) return;\n setFormatPainterMarks(marks);\n }, [editor, formatPainterMarks]);\n\n useEffect(() => {\n if (!formatPainterMarks) return;\n if (editor.isDestroyed || !editor.isEditable || !cfg.formatPainter || !cfg.textFormat) {\n setFormatPainterMarks(null);\n return;\n }\n\n painterChange.current?.(true);\n const editorEl = editor.view.dom;\n let frame: number | null = null;\n let cancelled = false;\n const cancel = () => {\n cancelled = true;\n if (frame !== null) cancelAnimationFrame(frame);\n frame = null;\n setFormatPainterMarks(null);\n };\n const onTransaction = () => {\n if (!editor.isEditable) cancel();\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') cancel();\n };\n\n const applyMarks = () => {\n frame = null;\n if (cancelled || editor.isDestroyed || !editor.isEditable) return;\n const { from, to } = editor.state.selection;\n if (from === to) return;\n\n const { tr } = editor.state;\n for (const name of PAINT_MARKS) {\n const type = editor.schema.marks[name];\n if (type) tr.removeMark(from, to, type);\n }\n editor.state.doc.nodesBetween(from, to, (node, pos) => {\n if (!node.isText) return;\n const semantic = node.marks.filter((mark) => !PAINT_MARKS.has(mark.type.name));\n for (const mark of formatPainterMarks) {\n // Code and custom exclusions must not implicitly remove semantic marks.\n if (semantic.some((other) => mark.type.excludes(other.type) || other.type.excludes(mark.type))) continue;\n tr.addMark(Math.max(from, pos), Math.min(to, pos + node.nodeSize), mark);\n }\n });\n cancelled = true;\n editor.view.dispatch(tr);\n setFormatPainterMarks(null);\n };\n\n const onMouseUp = () => {\n if (cancelled) return;\n if (frame !== null) cancelAnimationFrame(frame);\n frame = requestAnimationFrame(applyMarks);\n };\n\n editorEl.addEventListener('mouseup', onMouseUp);\n editorEl.ownerDocument.addEventListener('keydown', onKeyDown);\n editor.on('transaction', onTransaction);\n editor.on('destroy', cancel);\n return () => {\n cancelled = true;\n if (frame !== null) cancelAnimationFrame(frame);\n editorEl.removeEventListener('mouseup', onMouseUp);\n editorEl.ownerDocument.removeEventListener('keydown', onKeyDown);\n editor.off('transaction', onTransaction);\n editor.off('destroy', cancel);\n painterChange.current?.(false);\n };\n }, [editor, formatPainterMarks, cfg.formatPainter, cfg.textFormat]);\n\n const currentFontFamily = editor.getAttributes('textStyle').fontFamily || '';\n const currentFontSize = editor.getAttributes('textStyle').fontSize || '';\n\n return (\n <div className=\"rte-toolbar\" role=\"group\" aria-label=\"Text formatting\">\n {(show('undo', cfg.history) || show('redo', cfg.history)) && (\n <>\n {show('undo', cfg.history) && <ToolbarButton\n onClick={() => editor.chain().focus().undo().run()}\n disabled={!editor.can().undo()}\n title={labels.undo}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"1 4 1 10 7 10\" />\n <path d=\"M3.51 15a9 9 0 102.13-9.36L1 10\" />\n </svg>\n </ToolbarButton>}\n {show('redo', cfg.history) && <ToolbarButton\n onClick={() => editor.chain().focus().redo().run()}\n disabled={!editor.can().redo()}\n title={labels.redo}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"23 4 23 10 17 10\" />\n <path d=\"M20.49 15a9 9 0 11-2.13-9.36L23 10\" />\n </svg>\n </ToolbarButton>}\n <ToolbarDivider />\n </>\n )}\n\n {(show('fontFamily', cfg.fontStyle) || show('fontSize', cfg.fontStyle)) && (\n <>\n {show('fontFamily', cfg.fontStyle) && <SelectDropdown\n value={currentFontFamily}\n options={FONT_FAMILIES}\n onChange={(val) => {\n if (val) {\n editor.chain().focus().setFontFamily(val).run();\n } else {\n editor.chain().focus().unsetFontFamily().run();\n }\n }}\n title={labels.fontFamily}\n width={120}\n />}\n {show('fontSize', cfg.fontStyle) && <SelectDropdown\n value={currentFontSize}\n options={FONT_SIZES}\n onChange={(val) => {\n if (val) {\n (editor.chain().focus() as any).setFontSize(val).run();\n } else {\n (editor.chain().focus() as any).unsetFontSize().run();\n }\n }}\n title={labels.fontSize}\n width={80}\n />}\n <ToolbarDivider />\n </>\n )}\n\n {(['bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript', 'formatPainter'] as const).some((button) => show(button, button === 'formatPainter' ? cfg.formatPainter : cfg.textFormat)) && (\n <>\n {show('bold', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleBold().run()}\n isActive={editor.isActive('bold')}\n title={labels.bold}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z\" />\n <path d=\"M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z\" />\n </svg>\n </ToolbarButton>}\n {show('italic', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleItalic().run()}\n isActive={editor.isActive('italic')}\n title={labels.italic}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"19\" y1=\"4\" x2=\"10\" y2=\"4\" />\n <line x1=\"14\" y1=\"20\" x2=\"5\" y2=\"20\" />\n <line x1=\"15\" y1=\"4\" x2=\"9\" y2=\"20\" />\n </svg>\n </ToolbarButton>}\n {show('underline', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n isActive={editor.isActive('underline')}\n title={labels.underline}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M6 3v7a6 6 0 006 6 6 6 0 006-6V3\" />\n <line x1=\"4\" y1=\"21\" x2=\"20\" y2=\"21\" />\n </svg>\n </ToolbarButton>}\n {show('strikethrough', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleStrike().run()}\n isActive={editor.isActive('strike')}\n title={labels.strikethrough}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 7.2 3.3\" />\n <path d=\"M13 15.1c0 2.8-2.6 3.6-5.3 3.6-1.8-.1-3.9-.5-6.2-.9\" />\n <line x1=\"4\" y1=\"12\" x2=\"20\" y2=\"12\" />\n </svg>\n </ToolbarButton>}\n {show('subscript', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleSubscript().run()}\n isActive={editor.isActive('subscript')}\n title={labels.subscript}\n >\n <span style={{ fontSize: '13px', fontWeight: 600 }}>X<sub style={{ fontSize: '9px' }}>2</sub></span>\n </ToolbarButton>}\n {show('superscript', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleSuperscript().run()}\n isActive={editor.isActive('superscript')}\n title={labels.superscript}\n >\n <span style={{ fontSize: '13px', fontWeight: 600 }}>X<sup style={{ fontSize: '9px' }}>2</sup></span>\n </ToolbarButton>}\n {show('formatPainter', cfg.formatPainter) && (\n <ToolbarButton\n onClick={handleFormatPainter}\n disabled={!editor.isEditable || (!formatPainterMarks && editor.state.selection.empty)}\n isActive={!!formatPainterMarks}\n title={formatPainterMarks ? labels.formatPainterActive : labels.formatPainter}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M19 3H5a2 2 0 00-2 2v2a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z\" />\n <path d=\"M10 7v4a2 2 0 01-2 2H7\" />\n <path d=\"M7 13l-3 8\" />\n <path d=\"M4 21h6\" />\n </svg>\n </ToolbarButton>\n )}\n <ToolbarDivider />\n </>\n )}\n\n {([1, 2, 3, 4, 5, 6] as const).some((level) => show(`heading${level}` as keyof ToolbarButtonConfig, cfg.heading)) && (\n <>\n {([1, 2, 3, 4, 5, 6] as const).filter((level) => show(`heading${level}` as keyof ToolbarButtonConfig, cfg.heading)).map((level) => (\n <ToolbarButton\n key={level}\n onClick={() => editor.chain().focus().toggleHeading({ level }).run()}\n isActive={editor.isActive('heading', { level })}\n title={`${labels.heading} ${level}`}\n >\n <span style={{ fontSize: '12px', fontWeight: 700 }}>H{level}</span>\n </ToolbarButton>\n ))}\n <ToolbarDivider />\n </>\n )}\n\n {(['alignLeft', 'alignCenter', 'alignRight', 'alignJustify'] as const).some((button) => show(button, cfg.alignment)) && (\n <>\n {show('alignLeft', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('left').run()}\n isActive={editor.isActive({ textAlign: 'left' })}\n title={labels.alignLeft}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"17\" y1=\"10\" x2=\"3\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"17\" y1=\"18\" x2=\"3\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n {show('alignCenter', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('center').run()}\n isActive={editor.isActive({ textAlign: 'center' })}\n title={labels.alignCenter}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"18\" y1=\"10\" x2=\"6\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"18\" y1=\"18\" x2=\"6\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n {show('alignRight', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('right').run()}\n isActive={editor.isActive({ textAlign: 'right' })}\n title={labels.alignRight}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"21\" y1=\"10\" x2=\"7\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"21\" y1=\"18\" x2=\"7\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n {show('alignJustify', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('justify').run()}\n isActive={editor.isActive({ textAlign: 'justify' })}\n title={labels.alignJustify}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"21\" y1=\"10\" x2=\"3\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"21\" y1=\"18\" x2=\"3\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n <ToolbarDivider />\n </>\n )}\n\n {(['bulletList', 'orderedList', 'taskList'] as const).some((button) => show(button, cfg.list)) && (\n <>\n {show('bulletList', cfg.list) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n isActive={editor.isActive('bulletList')}\n title={labels.bulletList}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"8\" y1=\"6\" x2=\"21\" y2=\"6\" /><line x1=\"8\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"8\" y1=\"18\" x2=\"21\" y2=\"18\" />\n <circle cx=\"4\" cy=\"6\" r=\"1\" fill=\"currentColor\" /><circle cx=\"4\" cy=\"12\" r=\"1\" fill=\"currentColor\" />\n <circle cx=\"4\" cy=\"18\" r=\"1\" fill=\"currentColor\" />\n </svg>\n </ToolbarButton>}\n {show('orderedList', cfg.list) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n isActive={editor.isActive('orderedList')}\n title={labels.orderedList}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"10\" y1=\"6\" x2=\"21\" y2=\"6\" /><line x1=\"10\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"10\" y1=\"18\" x2=\"21\" y2=\"18\" />\n <text x=\"2\" y=\"8\" fontSize=\"8\" fill=\"currentColor\" stroke=\"none\" fontWeight=\"bold\">1</text>\n <text x=\"2\" y=\"14\" fontSize=\"8\" fill=\"currentColor\" stroke=\"none\" fontWeight=\"bold\">2</text>\n <text x=\"2\" y=\"20\" fontSize=\"8\" fill=\"currentColor\" stroke=\"none\" fontWeight=\"bold\">3</text>\n </svg>\n </ToolbarButton>}\n {show('taskList', cfg.list) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleTaskList().run()}\n isActive={editor.isActive('taskList')}\n title={labels.taskList}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"5\" width=\"6\" height=\"6\" rx=\"1\" /><path d=\"M5 8l1.5 1.5L9 6.5\" />\n <line x1=\"12\" y1=\"8\" x2=\"21\" y2=\"8\" />\n <rect x=\"3\" y=\"14\" width=\"6\" height=\"6\" rx=\"1\" />\n <line x1=\"12\" y1=\"17\" x2=\"21\" y2=\"17\" />\n </svg>\n </ToolbarButton>}\n <ToolbarDivider />\n </>\n )}\n\n {(['blockquote', 'codeBlock', 'mermaidBlock', 'link', 'image', 'table', 'tableOps', 'horizontalRule', 'markdownBlock', 'markdownTemplates', 'floatingDialog'] as const).some((button) => show(button, button === 'tableOps' ? cfg.tableOps : cfg.insert)) && (\n <>\n {show('blockquote', cfg.insert) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleBlockquote().run()}\n isActive={editor.isActive('blockquote')}\n title={labels.blockquote}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z\" />\n <path d=\"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z\" />\n </svg>\n </ToolbarButton>}\n {show('codeBlock', cfg.insert) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleNode('codeBlock', 'paragraph').run()}\n isActive={editor.isActive('codeBlock')}\n title={labels.codeBlock}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"16 18 22 12 16 6\" /><polyline points=\"8 6 2 12 8 18\" />\n </svg>\n </ToolbarButton>}\n {show('mermaidBlock', cfg.insert) && <ToolbarButton\n onClick={() => {\n editor.chain().focus().insertContent({\n type: 'codeBlock',\n attrs: { language: 'r-mermaid' },\n content: [{ type: 'text', text: 'graph TD\\n A[Start] --> B[End]' }],\n }).run();\n }}\n title={labels.mermaidBlock}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <circle cx=\"6\" cy=\"6\" r=\"3\" /><circle cx=\"18\" cy=\"6\" r=\"3\" />\n <circle cx=\"12\" cy=\"18\" r=\"3\" />\n <line x1=\"6\" y1=\"9\" x2=\"12\" y2=\"15\" /><line x1=\"18\" y1=\"9\" x2=\"12\" y2=\"15\" />\n </svg>\n </ToolbarButton>}\n {show('link', cfg.insert) && <ToolbarButton onClick={setLink} isActive={editor.isActive('link')} title={labels.link}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71\" />\n </svg>\n </ToolbarButton>}\n {show('image', cfg.insert) && <ToolbarButton onClick={addImage} title={labels.image}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\" />\n <circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\" /><polyline points=\"21 15 16 10 5 21\" />\n </svg>\n </ToolbarButton>}\n {show('table', cfg.insert) && <ToolbarButton onClick={insertTable} title={labels.table}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\" /><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\" />\n <line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\" /><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\" />\n </svg>\n </ToolbarButton>}\n {show('tableOps', cfg.tableOps) && <TableOpsMenu editor={editor} labels={labels} />}\n {show('horizontalRule', cfg.insert) && <ToolbarButton\n onClick={() => editor.chain().focus().setHorizontalRule().run()}\n title={labels.horizontalRule}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\">\n <line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" />\n </svg>\n </ToolbarButton>}\n {show('markdownBlock', cfg.insert) && <ToolbarButton onClick={insertMarkdownBlock} title={labels.markdownBlock}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M2 3h20v18H2z\" />\n <path d=\"M5 15V9l3 3.5L11 9v6\" />\n <path d=\"M17 9l-2.5 3H17v3\" />\n </svg>\n </ToolbarButton>}\n {show('markdownTemplates', cfg.insert) && <MarkdownTemplateMenu labels={labels} onSelect={insertMarkdownTemplate} />}\n {show('floatingDialog', cfg.insert) && <FloatingDialogMenu labels={labels} onInsert={insertFloatingDialog} />}\n <ToolbarDivider />\n </>\n )}\n\n {(['textColor', 'highlight'] as const).some((button) => show(button, cfg.color)) && (\n <>\n {show('textColor', cfg.color) && <ColorPicker\n value={editor.getAttributes('textStyle').color || ''}\n onChange={(color) => {\n if (color) {\n editor.chain().focus().setColor(color).run();\n } else {\n editor.chain().focus().unsetColor().run();\n }\n }}\n title={labels.color}\n kind=\"text\"\n />}\n {show('highlight', cfg.color) && <ColorPicker\n value={editor.getAttributes('highlight').color || ''}\n onChange={(color) => {\n if (color) {\n editor.chain().focus().toggleHighlight({ color }).run();\n } else {\n editor.chain().focus().unsetHighlight().run();\n }\n }}\n title={labels.highlight}\n kind=\"highlight\"\n />}\n <ToolbarDivider />\n </>\n )}\n\n {show('ai', cfg.ai) && onAIClick && (\n <ToolbarButton\n onClick={hasAI ? onAIClick : (onRequestAIConfig || (() => {}))}\n disabled={!hasAI && !onRequestAIConfig}\n title={hasAI ? labels.ai : (onRequestAIConfig ? labels.aiConfigure : labels.aiNotConfigured)}\n className={`rte-toolbar__ai-btn ${!hasAI ? 'rte-toolbar__ai-btn--unconfigured' : ''}`}\n >\n <svg className=\"rte-toolbar__ai-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M12 2.75l1.14 4.11a5.5 5.5 0 003.82 3.82L21.25 12l-4.29 1.32a5.5 5.5 0 00-3.82 3.82L12 21.25l-1.14-4.11a5.5 5.5 0 00-3.82-3.82L2.75 12l4.29-1.32a5.5 5.5 0 003.82-3.82L12 2.75z\" fill=\"currentColor\" />\n <path d=\"M19 2.75l.42 1.52a2 2 0 001.31 1.31l1.52.42-1.52.42a2 2 0 00-1.31 1.31L19 9.25l-.42-1.52a2 2 0 00-1.31-1.31L15.75 6l1.52-.42a2 2 0 001.31-1.31L19 2.75z\" fill=\"currentColor\" opacity=\".68\" />\n </svg>\n <span className=\"rte-toolbar__ai-label\">AI</span>\n {!hasAI && onRequestAIConfig && <span className=\"rte-toolbar__ai-configure\">{labels.aiConfigure}</span>}\n </ToolbarButton>\n )}\n\n {children}\n </div>\n );\n};\n\nexport default Toolbar;\n"],"mappings":";;;;;;;;;;;;AAcA,IAAM,oBAAc,IAAI,IAAI;CAAC;CAAQ;CAAU;CAAa;CAAU;CAAQ;CAAa;CAAe;CAAa;AAAW,CAAC,GAa7H,KAAmC,EACvC,WACA,WACA,QAAQ,GACR,UACA,cACA,s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file":"Toolbar.js","names":["_Fragment","PAINT_MARKS","Toolbar","propsLabels","labels","defaultLabels","transactionNumber","formatPainterMarks","setFormatPainterMarks","useState","painterChange","useRef","onFormatPainterChange","cfg","config","buttons","show","button","section","setLink","useCallback","previousUrl","editor","url","addImage","insertTable","insertMarkdownBlock","insertMarkdownTemplate","chain","focusEditor","content","insertFloatingDialog","extraAttrs","layout","getNextFloatZIndex","handleFormatPainter","from","to","marks","node","formatting","mark","other","editorEl","frame","cancelled","cancel","onTransaction","onKeyDown","event","applyMarks","name","type","tr","semantic","pos","onMouseUp","currentFontFamily","currentFontSize","Fragment","ToolbarButton","ToolbarDivider","SelectDropdown","FONT_FAMILIES","val","FONT_SIZES","level","TableOpsMenu","MarkdownTemplateMenu","FloatingDialogMenu","ColorPicker","color","onAIClick","hasAI","onRequestAIConfig","children"],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/Toolbar.tsx"],"sourcesContent":["import React, { useCallback, useState, useEffect, useRef } from 'react';\nimport { useEditorState, type Editor } from '@tiptap/react';\nimport type { Mark } from '@tiptap/pm/model';\nimport type { ToolbarButtonConfig, ToolbarSection, RichTextEditorLabels } from '../types';\nimport { defaultLabels } from '../types';\nimport { getNextFloatZIndex } from '../extensions/FloatingDialog';\nimport { ToolbarButton, ToolbarDivider } from './ToolbarButton';\nimport { ColorPicker } from './ColorPicker';\nimport { SelectDropdown, FONT_FAMILIES, FONT_SIZES } from './SelectDropdown';\nimport { MarkdownTemplateMenu } from './MarkdownTemplates';\nimport { FloatingDialogMenu } from './FloatingDialogMenu';\nimport { TableOpsMenu } from './TableOpsMenu';\n\n// Only visual formatting belongs to the painter, never links or comment IDs.\nconst PAINT_MARKS = new Set(['bold', 'italic', 'underline', 'strike', 'code', 'subscript', 'superscript', 'textStyle', 'highlight']);\n\ninterface ToolbarProps {\n editor: Editor;\n config?: ToolbarSection;\n labels?: RichTextEditorLabels;\n hasAI?: boolean;\n onAIClick?: () => void;\n onRequestAIConfig?: () => void;\n onFormatPainterChange?: (active: boolean) => void;\n children?: React.ReactNode;\n}\n\nconst Toolbar: React.FC<ToolbarProps> = ({\n editor,\n config,\n labels: propsLabels,\n hasAI,\n onAIClick,\n onRequestAIConfig,\n onFormatPainterChange,\n children,\n}) => {\n const labels = { ...defaultLabels, ...propsLabels };\n useEditorState({ editor, selector: ({ transactionNumber }) => transactionNumber });\n const [formatPainterMarks, setFormatPainterMarks] = useState<readonly Mark[] | null>(null);\n const painterChange = useRef(onFormatPainterChange);\n useEffect(() => {\n painterChange.current = onFormatPainterChange;\n }, [onFormatPainterChange]);\n\n const cfg = {\n textFormat: config?.textFormat ?? true,\n heading: config?.heading ?? true,\n alignment: config?.alignment ?? true,\n list: config?.list ?? true,\n insert: config?.insert ?? true,\n color: config?.color ?? true,\n history: config?.history ?? true,\n ai: config?.ai ?? true,\n tableOps: config?.tableOps ?? true,\n fontStyle: config?.fontStyle ?? true,\n formatPainter: config?.formatPainter ?? true,\n };\n const buttons: ToolbarButtonConfig = config?.buttons ?? {};\n const show = (button: keyof ToolbarButtonConfig, section = true) => buttons[button] ?? section;\n\n const setLink = useCallback(() => {\n const previousUrl = editor.getAttributes('link').href;\n const url = window.prompt(labels.insertLinkUrl, previousUrl);\n if (url === null) return;\n if (editor.isDestroyed || !editor.isEditable) return;\n if (url.trim() === '') {\n editor.chain().focus().extendMarkRange('link').unsetLink().run();\n return;\n }\n editor.chain().focus().extendMarkRange('link').setLink({ href: url.trim() }).run();\n }, [editor, labels.insertLinkUrl]);\n\n const addImage = useCallback(() => {\n const url = window.prompt(labels.insertImageUrl);\n if (url) {\n editor.chain().focus().setImage({ src: url }).run();\n }\n }, [editor, labels.insertImageUrl]);\n\n const insertTable = useCallback(() => {\n editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run();\n }, [editor]);\n\n const insertMarkdownBlock = useCallback(() => {\n editor.chain().focus().insertContent({\n type: 'codeBlock',\n attrs: { language: 'r-markdown' },\n content: [{ type: 'text', text: '# Markdown\\n\\nWrite your **markdown** here.' }],\n }).run();\n }, [editor]);\n\n const insertMarkdownTemplate = useCallback((content: string, focusEditor = true) => {\n if (editor.isDestroyed || !editor.isEditable) return;\n const chain = editor.chain();\n if (focusEditor) chain.focus();\n chain.insertContent({\n type: 'codeBlock',\n attrs: { language: 'r-markdown' },\n content: [{ type: 'text', text: content }],\n }).run();\n }, [editor]);\n\n const insertFloatingDialog = useCallback((layout: 'block' | 'wrap-left' | 'wrap-right' | 'float' = 'block', focusEditor = true) => {\n if (editor.isDestroyed || !editor.isEditable) return;\n const extraAttrs = layout === 'float'\n ? { x: 40, y: 40, zIndex: getNextFloatZIndex(editor) }\n : layout === 'block'\n ? {}\n : { width: 240 };\n const chain = editor.chain();\n if (focusEditor) chain.focus();\n chain.insertContent({\n type: 'floatingDialog',\n attrs: { title: 'Note', layout, ...extraAttrs },\n content: [{ type: 'paragraph' }],\n }).run();\n }, [editor]);\n\n const handleFormatPainter = useCallback(() => {\n if (formatPainterMarks) {\n setFormatPainterMarks(null);\n return;\n }\n if (editor.isDestroyed || !editor.isEditable) return;\n const { from, to } = editor.state.selection;\n if (from === to) return;\n\n let marks: readonly Mark[] | undefined;\n editor.state.doc.nodesBetween(from, to, (node) => {\n if (!node.isText) return;\n const formatting = node.marks.filter((mark) => PAINT_MARKS.has(mark.type.name));\n marks = marks === undefined ? formatting : marks.filter((mark) => formatting.some((other) => mark.eq(other)));\n });\n if (marks === undefined) return;\n setFormatPainterMarks(marks);\n }, [editor, formatPainterMarks]);\n\n useEffect(() => {\n if (!formatPainterMarks) return;\n if (editor.isDestroyed || !editor.isEditable || !cfg.formatPainter || !cfg.textFormat) {\n setFormatPainterMarks(null);\n return;\n }\n\n painterChange.current?.(true);\n const editorEl = editor.view.dom;\n let frame: number | null = null;\n let cancelled = false;\n const cancel = () => {\n cancelled = true;\n if (frame !== null) cancelAnimationFrame(frame);\n frame = null;\n setFormatPainterMarks(null);\n };\n const onTransaction = () => {\n if (!editor.isEditable) cancel();\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') cancel();\n };\n\n const applyMarks = () => {\n frame = null;\n if (cancelled || editor.isDestroyed || !editor.isEditable) return;\n const { from, to } = editor.state.selection;\n if (from === to) return;\n\n const { tr } = editor.state;\n for (const name of PAINT_MARKS) {\n const type = editor.schema.marks[name];\n if (type) tr.removeMark(from, to, type);\n }\n editor.state.doc.nodesBetween(from, to, (node, pos) => {\n if (!node.isText) return;\n const semantic = node.marks.filter((mark) => !PAINT_MARKS.has(mark.type.name));\n for (const mark of formatPainterMarks) {\n // Code and custom exclusions must not implicitly remove semantic marks.\n if (semantic.some((other) => mark.type.excludes(other.type) || other.type.excludes(mark.type))) continue;\n tr.addMark(Math.max(from, pos), Math.min(to, pos + node.nodeSize), mark);\n }\n });\n cancelled = true;\n editor.view.dispatch(tr);\n setFormatPainterMarks(null);\n };\n\n const onMouseUp = () => {\n if (cancelled) return;\n if (frame !== null) cancelAnimationFrame(frame);\n frame = requestAnimationFrame(applyMarks);\n };\n\n editorEl.addEventListener('mouseup', onMouseUp);\n editorEl.ownerDocument.addEventListener('keydown', onKeyDown);\n editor.on('transaction', onTransaction);\n editor.on('destroy', cancel);\n return () => {\n cancelled = true;\n if (frame !== null) cancelAnimationFrame(frame);\n editorEl.removeEventListener('mouseup', onMouseUp);\n editorEl.ownerDocument.removeEventListener('keydown', onKeyDown);\n editor.off('transaction', onTransaction);\n editor.off('destroy', cancel);\n painterChange.current?.(false);\n };\n }, [editor, formatPainterMarks, cfg.formatPainter, cfg.textFormat]);\n\n const currentFontFamily = editor.getAttributes('textStyle').fontFamily || '';\n const currentFontSize = editor.getAttributes('textStyle').fontSize || '';\n\n return (\n <div className=\"rte-toolbar\" role=\"group\" aria-label=\"Text formatting\">\n {(show('undo', cfg.history) || show('redo', cfg.history)) && (\n <>\n {show('undo', cfg.history) && <ToolbarButton\n onClick={() => editor.chain().focus().undo().run()}\n disabled={!editor.can().undo()}\n title={labels.undo}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"1 4 1 10 7 10\" />\n <path d=\"M3.51 15a9 9 0 102.13-9.36L1 10\" />\n </svg>\n </ToolbarButton>}\n {show('redo', cfg.history) && <ToolbarButton\n onClick={() => editor.chain().focus().redo().run()}\n disabled={!editor.can().redo()}\n title={labels.redo}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"23 4 23 10 17 10\" />\n <path d=\"M20.49 15a9 9 0 11-2.13-9.36L23 10\" />\n </svg>\n </ToolbarButton>}\n <ToolbarDivider />\n </>\n )}\n\n {(show('fontFamily', cfg.fontStyle) || show('fontSize', cfg.fontStyle)) && (\n <>\n {show('fontFamily', cfg.fontStyle) && <SelectDropdown\n value={currentFontFamily}\n options={FONT_FAMILIES}\n onChange={(val) => {\n if (val) {\n editor.chain().focus().setFontFamily(val).run();\n } else {\n editor.chain().focus().unsetFontFamily().run();\n }\n }}\n title={labels.fontFamily}\n width={120}\n />}\n {show('fontSize', cfg.fontStyle) && <SelectDropdown\n value={currentFontSize}\n options={FONT_SIZES}\n onChange={(val) => {\n if (val) {\n (editor.chain().focus() as any).setFontSize(val).run();\n } else {\n (editor.chain().focus() as any).unsetFontSize().run();\n }\n }}\n title={labels.fontSize}\n width={80}\n />}\n <ToolbarDivider />\n </>\n )}\n\n {(['bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript', 'formatPainter'] as const).some((button) => show(button, button === 'formatPainter' ? cfg.formatPainter : cfg.textFormat)) && (\n <>\n {show('bold', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleBold().run()}\n isActive={editor.isActive('bold')}\n title={labels.bold}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z\" />\n <path d=\"M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z\" />\n </svg>\n </ToolbarButton>}\n {show('italic', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleItalic().run()}\n isActive={editor.isActive('italic')}\n title={labels.italic}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"19\" y1=\"4\" x2=\"10\" y2=\"4\" />\n <line x1=\"14\" y1=\"20\" x2=\"5\" y2=\"20\" />\n <line x1=\"15\" y1=\"4\" x2=\"9\" y2=\"20\" />\n </svg>\n </ToolbarButton>}\n {show('underline', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n isActive={editor.isActive('underline')}\n title={labels.underline}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M6 3v7a6 6 0 006 6 6 6 0 006-6V3\" />\n <line x1=\"4\" y1=\"21\" x2=\"20\" y2=\"21\" />\n </svg>\n </ToolbarButton>}\n {show('strikethrough', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleStrike().run()}\n isActive={editor.isActive('strike')}\n title={labels.strikethrough}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 7.2 3.3\" />\n <path d=\"M13 15.1c0 2.8-2.6 3.6-5.3 3.6-1.8-.1-3.9-.5-6.2-.9\" />\n <line x1=\"4\" y1=\"12\" x2=\"20\" y2=\"12\" />\n </svg>\n </ToolbarButton>}\n {show('subscript', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleSubscript().run()}\n isActive={editor.isActive('subscript')}\n title={labels.subscript}\n >\n <span style={{ fontSize: '13px', fontWeight: 600 }}>X<sub style={{ fontSize: '9px' }}>2</sub></span>\n </ToolbarButton>}\n {show('superscript', cfg.textFormat) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleSuperscript().run()}\n isActive={editor.isActive('superscript')}\n title={labels.superscript}\n >\n <span style={{ fontSize: '13px', fontWeight: 600 }}>X<sup style={{ fontSize: '9px' }}>2</sup></span>\n </ToolbarButton>}\n {show('formatPainter', cfg.formatPainter) && (\n <ToolbarButton\n onClick={handleFormatPainter}\n disabled={!editor.isEditable || (!formatPainterMarks && editor.state.selection.empty)}\n isActive={!!formatPainterMarks}\n title={formatPainterMarks ? labels.formatPainterActive : labels.formatPainter}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M19 3H5a2 2 0 00-2 2v2a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z\" />\n <path d=\"M10 7v4a2 2 0 01-2 2H7\" />\n <path d=\"M7 13l-3 8\" />\n <path d=\"M4 21h6\" />\n </svg>\n </ToolbarButton>\n )}\n <ToolbarDivider />\n </>\n )}\n\n {([1, 2, 3, 4, 5, 6] as const).some((level) => show(`heading${level}` as keyof ToolbarButtonConfig, cfg.heading)) && (\n <>\n {([1, 2, 3, 4, 5, 6] as const).filter((level) => show(`heading${level}` as keyof ToolbarButtonConfig, cfg.heading)).map((level) => (\n <ToolbarButton\n key={level}\n onClick={() => editor.chain().focus().toggleHeading({ level }).run()}\n isActive={editor.isActive('heading', { level })}\n title={`${labels.heading} ${level}`}\n >\n <span style={{ fontSize: '12px', fontWeight: 700 }}>H{level}</span>\n </ToolbarButton>\n ))}\n <ToolbarDivider />\n </>\n )}\n\n {(['alignLeft', 'alignCenter', 'alignRight', 'alignJustify'] as const).some((button) => show(button, cfg.alignment)) && (\n <>\n {show('alignLeft', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('left').run()}\n isActive={editor.isActive({ textAlign: 'left' })}\n title={labels.alignLeft}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"17\" y1=\"10\" x2=\"3\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"17\" y1=\"18\" x2=\"3\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n {show('alignCenter', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('center').run()}\n isActive={editor.isActive({ textAlign: 'center' })}\n title={labels.alignCenter}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"18\" y1=\"10\" x2=\"6\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"18\" y1=\"18\" x2=\"6\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n {show('alignRight', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('right').run()}\n isActive={editor.isActive({ textAlign: 'right' })}\n title={labels.alignRight}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"21\" y1=\"10\" x2=\"7\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"21\" y1=\"18\" x2=\"7\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n {show('alignJustify', cfg.alignment) && <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign('justify').run()}\n isActive={editor.isActive({ textAlign: 'justify' })}\n title={labels.alignJustify}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"21\" y1=\"10\" x2=\"3\" y2=\"10\" /><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\" />\n <line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\" /><line x1=\"21\" y1=\"18\" x2=\"3\" y2=\"18\" />\n </svg>\n </ToolbarButton>}\n <ToolbarDivider />\n </>\n )}\n\n {(['bulletList', 'orderedList', 'taskList'] as const).some((button) => show(button, cfg.list)) && (\n <>\n {show('bulletList', cfg.list) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n isActive={editor.isActive('bulletList')}\n title={labels.bulletList}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"8\" y1=\"6\" x2=\"21\" y2=\"6\" /><line x1=\"8\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"8\" y1=\"18\" x2=\"21\" y2=\"18\" />\n <circle cx=\"4\" cy=\"6\" r=\"1\" fill=\"currentColor\" /><circle cx=\"4\" cy=\"12\" r=\"1\" fill=\"currentColor\" />\n <circle cx=\"4\" cy=\"18\" r=\"1\" fill=\"currentColor\" />\n </svg>\n </ToolbarButton>}\n {show('orderedList', cfg.list) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n isActive={editor.isActive('orderedList')}\n title={labels.orderedList}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <line x1=\"10\" y1=\"6\" x2=\"21\" y2=\"6\" /><line x1=\"10\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"10\" y1=\"18\" x2=\"21\" y2=\"18\" />\n <text x=\"2\" y=\"8\" fontSize=\"8\" fill=\"currentColor\" stroke=\"none\" fontWeight=\"bold\">1</text>\n <text x=\"2\" y=\"14\" fontSize=\"8\" fill=\"currentColor\" stroke=\"none\" fontWeight=\"bold\">2</text>\n <text x=\"2\" y=\"20\" fontSize=\"8\" fill=\"currentColor\" stroke=\"none\" fontWeight=\"bold\">3</text>\n </svg>\n </ToolbarButton>}\n {show('taskList', cfg.list) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleTaskList().run()}\n isActive={editor.isActive('taskList')}\n title={labels.taskList}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"5\" width=\"6\" height=\"6\" rx=\"1\" /><path d=\"M5 8l1.5 1.5L9 6.5\" />\n <line x1=\"12\" y1=\"8\" x2=\"21\" y2=\"8\" />\n <rect x=\"3\" y=\"14\" width=\"6\" height=\"6\" rx=\"1\" />\n <line x1=\"12\" y1=\"17\" x2=\"21\" y2=\"17\" />\n </svg>\n </ToolbarButton>}\n <ToolbarDivider />\n </>\n )}\n\n {(['blockquote', 'codeBlock', 'mermaidBlock', 'link', 'image', 'table', 'tableOps', 'horizontalRule', 'markdownBlock', 'markdownTemplates', 'floatingDialog'] as const).some((button) => show(button, button === 'tableOps' ? cfg.tableOps : cfg.insert)) && (\n <>\n {show('blockquote', cfg.insert) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleBlockquote().run()}\n isActive={editor.isActive('blockquote')}\n title={labels.blockquote}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z\" />\n <path d=\"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z\" />\n </svg>\n </ToolbarButton>}\n {show('codeBlock', cfg.insert) && <ToolbarButton\n onClick={() => editor.chain().focus().toggleNode('codeBlock', 'paragraph').run()}\n isActive={editor.isActive('codeBlock')}\n title={labels.codeBlock}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"16 18 22 12 16 6\" /><polyline points=\"8 6 2 12 8 18\" />\n </svg>\n </ToolbarButton>}\n {show('mermaidBlock', cfg.insert) && <ToolbarButton\n onClick={() => {\n editor.chain().focus().insertContent({\n type: 'codeBlock',\n attrs: { language: 'r-mermaid' },\n content: [{ type: 'text', text: 'graph TD\\n A[Start] --> B[End]' }],\n }).run();\n }}\n title={labels.mermaidBlock}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <circle cx=\"6\" cy=\"6\" r=\"3\" /><circle cx=\"18\" cy=\"6\" r=\"3\" />\n <circle cx=\"12\" cy=\"18\" r=\"3\" />\n <line x1=\"6\" y1=\"9\" x2=\"12\" y2=\"15\" /><line x1=\"18\" y1=\"9\" x2=\"12\" y2=\"15\" />\n </svg>\n </ToolbarButton>}\n {show('link', cfg.insert) && <ToolbarButton onClick={setLink} isActive={editor.isActive('link')} title={labels.link}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71\" />\n </svg>\n </ToolbarButton>}\n {show('image', cfg.insert) && <ToolbarButton onClick={addImage} title={labels.image}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\" />\n <circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\" /><polyline points=\"21 15 16 10 5 21\" />\n </svg>\n </ToolbarButton>}\n {show('table', cfg.insert) && <ToolbarButton onClick={insertTable} title={labels.table}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\" /><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\" />\n <line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\" /><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\" />\n </svg>\n </ToolbarButton>}\n {show('tableOps', cfg.tableOps) && <TableOpsMenu editor={editor} labels={labels} />}\n {show('horizontalRule', cfg.insert) && <ToolbarButton\n onClick={() => editor.chain().focus().setHorizontalRule().run()}\n title={labels.horizontalRule}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\">\n <line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" />\n </svg>\n </ToolbarButton>}\n {show('markdownBlock', cfg.insert) && <ToolbarButton onClick={insertMarkdownBlock} title={labels.markdownBlock}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M2 3h20v18H2z\" />\n <path d=\"M5 15V9l3 3.5L11 9v6\" />\n <path d=\"M17 9l-2.5 3H17v3\" />\n </svg>\n </ToolbarButton>}\n {show('markdownTemplates', cfg.insert) && <MarkdownTemplateMenu labels={labels} onSelect={insertMarkdownTemplate} />}\n {show('floatingDialog', cfg.insert) && <FloatingDialogMenu labels={labels} onInsert={insertFloatingDialog} />}\n <ToolbarDivider />\n </>\n )}\n\n {(['textColor', 'highlight'] as const).some((button) => show(button, cfg.color)) && (\n <>\n {show('textColor', cfg.color) && <ColorPicker\n value={editor.getAttributes('textStyle').color || ''}\n onChange={(color) => {\n if (color) {\n editor.chain().focus().setColor(color).run();\n } else {\n editor.chain().focus().unsetColor().run();\n }\n }}\n title={labels.color}\n kind=\"text\"\n />}\n {show('highlight', cfg.color) && <ColorPicker\n value={editor.getAttributes('highlight').color || ''}\n onChange={(color) => {\n if (color) {\n editor.chain().focus().toggleHighlight({ color }).run();\n } else {\n editor.chain().focus().unsetHighlight().run();\n }\n }}\n title={labels.highlight}\n kind=\"highlight\"\n />}\n <ToolbarDivider />\n </>\n )}\n\n {show('ai', cfg.ai) && onAIClick && (\n <ToolbarButton\n onClick={hasAI ? onAIClick : (onRequestAIConfig || (() => {}))}\n disabled={!hasAI && !onRequestAIConfig}\n title={hasAI ? labels.ai : (onRequestAIConfig ? labels.aiConfigure : labels.aiNotConfigured)}\n className={`rte-toolbar__ai-btn ${!hasAI ? 'rte-toolbar__ai-btn--unconfigured' : ''}`}\n >\n <svg className=\"rte-toolbar__ai-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M12 2.75l1.14 4.11a5.5 5.5 0 003.82 3.82L21.25 12l-4.29 1.32a5.5 5.5 0 00-3.82 3.82L12 21.25l-1.14-4.11a5.5 5.5 0 00-3.82-3.82L2.75 12l4.29-1.32a5.5 5.5 0 003.82-3.82L12 2.75z\" fill=\"currentColor\" />\n <path d=\"M19 2.75l.42 1.52a2 2 0 001.31 1.31l1.52.42-1.52.42a2 2 0 00-1.31 1.31L19 9.25l-.42-1.52a2 2 0 00-1.31-1.31L15.75 6l1.52-.42a2 2 0 001.31-1.31L19 2.75z\" fill=\"currentColor\" opacity=\".68\" />\n </svg>\n <span className=\"rte-toolbar__ai-label\">AI</span>\n {!hasAI && onRequestAIConfig && <span className=\"rte-toolbar__ai-configure\">{labels.aiConfigure}</span>}\n </ToolbarButton>\n )}\n\n {children}\n </div>\n );\n};\n\nexport default Toolbar;\n"],"mappings":";;;;;;;;;;;;AAcA,IAAMC,oBAAc,IAAI,IAAI;CAAC;CAAQ;CAAU;CAAa;CAAU;CAAQ;CAAa;CAAe;CAAa;AAAW,CAAC,GAa7HC,KAAmC,EACvC,WACA,WACA,QAAQC,GACR,UACA,cACA,sBACA,0BACA,kBACI;CACJ,IAAMC,IAAS;EAAE,GAAGC;EAAe,GAAGF;CAAY;CAClD,EAAe;EAAE;EAAQ,WAAW,EAAE,2BAAwBG;CAAkB,CAAC;CACjF,IAAM,CAACC,GAAoBC,KAAyBC,EAAiC,IAAI,GACnFC,IAAgBC,EAAOC,CAAqB;CAClD,QAAgB;EACd,EAAc,UAAUA;CAC1B,GAAG,CAACA,CAAqB,CAAC;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AAD;MAAK,WAAU;MAAuB,OAAM;MAAK,QAAO;MAAK,SAAQ;MAAY,MAAK;MAAO,eAAY;MAAzG,UAAA,CACE,kBAAC,QAAD;OAAM,GAAE;OAAkL,MAAK;MAAgB,CAAA,GAC/M,kBAAC,QAAD;OAAM,GAAE;OAA0J,MAAK;OAAe,SAAQ;MAAO,CAAA,CAClM;;KACL,kBAAC,QAAD;MAAM,WAAU;MAAwB,UAAA;KAAQ,CAAA;KAC/C,CAACA,KAASC,KAAqB,kBAAC,QAAD;MAAM,WAAU;MAA6B,UAAAtE,EAAO;KAAkB,CAAA;IACzF;;GAGhBuE;EACE;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarButton.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/ToolbarButton.tsx"],"sourcesContent":["import React from 'react';\n\nexport const ToolbarDivider: React.FC = () => <div className=\"rte-toolbar__divider\" />;\n\ninterface ToolbarButtonProps {\n onClick: () => void;\n isActive?: boolean;\n disabled?: boolean;\n title?: string;\n className?: string;\n children: React.ReactNode;\n}\n\nexport const ToolbarButton: React.FC<ToolbarButtonProps> = ({\n onClick,\n isActive,\n disabled,\n title,\n className,\n children,\n}) => (\n <button\n type=\"button\"\n className={`rte-toolbar__btn ${isActive ? 'rte-toolbar__btn--active' : ''} ${className || ''}`}\n onClick={onClick}\n disabled={disabled}\n title={title}\n >\n {children}\n </button>\n);\n"],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"ToolbarButton.js","names":["ToolbarDivider","ToolbarButton","isActive","className"],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/ToolbarButton.tsx"],"sourcesContent":["import React from 'react';\n\nexport const ToolbarDivider: React.FC = () => <div className=\"rte-toolbar__divider\" />;\n\ninterface ToolbarButtonProps {\n onClick: () => void;\n isActive?: boolean;\n disabled?: boolean;\n title?: string;\n className?: string;\n children: React.ReactNode;\n}\n\nexport const ToolbarButton: React.FC<ToolbarButtonProps> = ({\n onClick,\n isActive,\n disabled,\n title,\n className,\n children,\n}) => (\n <button\n type=\"button\"\n className={`rte-toolbar__btn ${isActive ? 'rte-toolbar__btn--active' : ''} ${className || ''}`}\n onClick={onClick}\n disabled={disabled}\n title={title}\n >\n {children}\n </button>\n);\n"],"mappings":";;;AAEA,IAAaA,UAAiC,kBAAC,OAAD,EAAK,WAAU,uBAAwB,CAAA,GAWxEC,KAA+C,EAC1D,YACA,aACA,aACA,UACA,cACA,kBAEA,kBAAC,UAAD;CACE,MAAK;CACL,WAAW,oBAAoBC,IAAW,6BAA6B,GAAG,GAAGC,KAAa;CACjF;CACC;CACH;CAEN;AACK,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnchoredDropdown.js","names":[],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.ts"],"sourcesContent":["import { useCallback, useLayoutEffect, useState, type CSSProperties, type RefObject } from 'react';\n\nconst VIEWPORT_GAP = 8;\nconst DROPDOWN_GAP = 6;\n\n/** Positions a toolbar dropdown inside the viewport and flips it above when needed. */\nexport function useAnchoredDropdown(\n open: boolean,\n anchorRef: RefObject<HTMLElement | null>,\n dropdownRef: RefObject<HTMLElement | null>,\n): CSSProperties {\n const [style, setStyle] = useState<CSSProperties>({});\n\n const place = useCallback(() => {\n const anchor = anchorRef.current;\n const dropdown = dropdownRef.current;\n if (!open || !anchor || !dropdown) return;\n\n const anchorRect = anchor.getBoundingClientRect();\n const naturalWidth = dropdown.scrollWidth || dropdown.offsetWidth;\n const width = Math.min(naturalWidth, window.innerWidth - VIEWPORT_GAP * 2);\n const height = Math.min(dropdown.scrollHeight, window.innerHeight - VIEWPORT_GAP * 2);\n const left = Math.max(\n VIEWPORT_GAP,\n Math.min(anchorRect.left, window.innerWidth - width - VIEWPORT_GAP),\n );\n const roomBelow = window.innerHeight - anchorRect.bottom - VIEWPORT_GAP;\n const roomAbove = anchorRect.top - VIEWPORT_GAP;\n const placeAbove = roomBelow < Math.min(height, 240) && roomAbove > roomBelow;\n const availableHeight = Math.max(80, placeAbove ? roomAbove : roomBelow);\n const top = placeAbove\n ? Math.max(VIEWPORT_GAP, anchorRect.top - Math.min(height, availableHeight) - DROPDOWN_GAP)\n : anchorRect.bottom + DROPDOWN_GAP;\n\n setStyle({\n position: 'fixed',\n left,\n top,\n width,\n maxWidth: `calc(100vw - ${VIEWPORT_GAP * 2}px)`,\n maxHeight: Math.min(height, availableHeight),\n });\n }, [open, anchorRef, dropdownRef]);\n\n useLayoutEffect(() => {\n if (!open) return;\n place();\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n }, [open, place]);\n\n return style;\n}\n"],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"useAnchoredDropdown.js","names":["VIEWPORT_GAP","DROPDOWN_GAP","useAnchoredDropdown","style","setStyle","useState","place","useCallback","anchor","anchorRef","dropdown","dropdownRef","open","anchorRect","naturalWidth","width","height","left","roomBelow","roomAbove","placeAbove","availableHeight","top","useLayoutEffect"],"sources":["../../../../../src/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.ts"],"sourcesContent":["import { useCallback, useLayoutEffect, useState, type CSSProperties, type RefObject } from 'react';\n\nconst VIEWPORT_GAP = 8;\nconst DROPDOWN_GAP = 6;\n\n/** Positions a toolbar dropdown inside the viewport and flips it above when needed. */\nexport function useAnchoredDropdown(\n open: boolean,\n anchorRef: RefObject<HTMLElement | null>,\n dropdownRef: RefObject<HTMLElement | null>,\n): CSSProperties {\n const [style, setStyle] = useState<CSSProperties>({});\n\n const place = useCallback(() => {\n const anchor = anchorRef.current;\n const dropdown = dropdownRef.current;\n if (!open || !anchor || !dropdown) return;\n\n const anchorRect = anchor.getBoundingClientRect();\n const naturalWidth = dropdown.scrollWidth || dropdown.offsetWidth;\n const width = Math.min(naturalWidth, window.innerWidth - VIEWPORT_GAP * 2);\n const height = Math.min(dropdown.scrollHeight, window.innerHeight - VIEWPORT_GAP * 2);\n const left = Math.max(\n VIEWPORT_GAP,\n Math.min(anchorRect.left, window.innerWidth - width - VIEWPORT_GAP),\n );\n const roomBelow = window.innerHeight - anchorRect.bottom - VIEWPORT_GAP;\n const roomAbove = anchorRect.top - VIEWPORT_GAP;\n const placeAbove = roomBelow < Math.min(height, 240) && roomAbove > roomBelow;\n const availableHeight = Math.max(80, placeAbove ? roomAbove : roomBelow);\n const top = placeAbove\n ? Math.max(VIEWPORT_GAP, anchorRect.top - Math.min(height, availableHeight) - DROPDOWN_GAP)\n : anchorRect.bottom + DROPDOWN_GAP;\n\n setStyle({\n position: 'fixed',\n left,\n top,\n width,\n maxWidth: `calc(100vw - ${VIEWPORT_GAP * 2}px)`,\n maxHeight: Math.min(height, availableHeight),\n });\n }, [open, anchorRef, dropdownRef]);\n\n useLayoutEffect(() => {\n if (!open) return;\n place();\n window.addEventListener('resize', place);\n window.addEventListener('scroll', place, true);\n return () => {\n window.removeEventListener('resize', place);\n window.removeEventListener('scroll', place, true);\n };\n }, [open, place]);\n\n return style;\n}\n"],"mappings":";;AAEA,IAAMA,IAAe,GACfC,IAAe;AAGrB,SAAgBC,EACd,GACA,GACA,GACe;CACf,IAAM,CAACC,GAAOC,KAAYC,EAAwB,CAAC,CAAC,GAE9CC,IAAQC,QAAkB;EAC9B,IAAMC,IAASC,EAAU,SACnBC,IAAWC,EAAY;EAC7B,IAAI,CAACC,KAAQ,CAACJ,KAAU,CAACE,GAAU;EAEnC,IAAMG,IAAaL,EAAO,sBAAsB,GAC1CM,IAAeJ,EAAS,eAAeA,EAAS,aAChDK,IAAQ,KAAK,IAAID,GAAc,OAAO,aAAa,EAAgB,GACnEE,IAAS,KAAK,IAAIN,EAAS,cAAc,OAAO,cAAc,EAAgB,GAC9EO,IAAO,KAAK,IAChBjB,GACA,KAAK,IAAIa,EAAW,MAAM,OAAO,aAAaE,IAAQf,CAAY,CACpE,GACMkB,IAAY,O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