dishui 0.0.65 → 0.0.66
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/_virtual/_rolldown/runtime.js +10 -11
- package/dist/chart.js +12 -46
- package/dist/code-editor.js +16 -43
- package/dist/components/Badge/index.js +10 -15
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Button/index.js +62 -89
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/index.d.ts +76 -0
- package/dist/components/Card/index.js +178 -69
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Chart/Chart.js +25 -25
- package/dist/components/Chart/Chart.js.map +1 -1
- package/dist/components/Checkbox/index.js +57 -65
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/ChoicePicker/index.d.ts +44 -0
- package/dist/components/ChoicePicker/index.js +81 -0
- package/dist/components/ChoicePicker/index.js.map +1 -0
- package/dist/components/Column/index.d.ts +28 -0
- package/dist/components/Column/index.js +30 -0
- package/dist/components/Column/index.js.map +1 -0
- package/dist/components/DateTimeInput/index.d.ts +44 -0
- package/dist/components/DateTimeInput/index.js +48 -0
- package/dist/components/DateTimeInput/index.js.map +1 -0
- package/dist/components/Demo/index.js +107 -107
- package/dist/components/Demo/index.js.map +1 -1
- package/dist/components/Divider/index.d.ts +20 -0
- package/dist/components/Divider/index.js +30 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/EmptyState/index.js +24 -24
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/FileUploader/DropZone.js +134 -136
- package/dist/components/FileUploader/DropZone.js.map +1 -1
- package/dist/components/FileUploader/FileItem.js +159 -163
- package/dist/components/FileUploader/FileItem.js.map +1 -1
- package/dist/components/FileUploader/FileUploader.js +126 -127
- package/dist/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/components/FileUploader/UploadQueue.js +62 -62
- package/dist/components/FileUploader/UploadQueue.js.map +1 -1
- package/dist/components/FloatWindow/index.d.ts +28 -0
- package/dist/components/GridLayout/index.d.ts +42 -0
- package/dist/components/Icon/index.d.ts +24 -0
- package/dist/components/Icon/index.js +26 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/Image/index.d.ts +33 -0
- package/dist/components/Image/index.js +44 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Input/index.js +196 -197
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/index.js +62 -74
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/index.js +134 -139
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/List/index.js +45 -58
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Markdown/Markdown.js +106 -107
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/codeThemes.js +24 -33
- package/dist/components/Markdown/codeThemes.js.map +1 -1
- package/dist/components/Markdown/markdownComponents.js +203 -208
- package/dist/components/Markdown/markdownComponents.js.map +1 -1
- package/dist/components/Markdown/parseCodeBlockMeta.js +22 -22
- package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
- package/dist/components/Markdown/useMarkdownSource.js +46 -46
- package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
- package/dist/components/Markdown/useMarkmapRenderer.js +35 -36
- package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
- package/dist/components/Markdown/useMermaidRenderer.js +41 -42
- package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
- package/dist/components/Modal/index.js +82 -82
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultipleChoice/index.d.ts +44 -0
- package/dist/components/MultipleChoice/index.js +52 -0
- package/dist/components/MultipleChoice/index.js.map +1 -0
- package/dist/components/Notification/index.d.ts +17 -0
- package/dist/components/Page/index.js +40 -71
- package/dist/components/Page/index.js.map +1 -1
- package/dist/components/PageHeader/index.js +28 -28
- package/dist/components/PageHeader/index.js.map +1 -1
- package/dist/components/ProtectedRoute/index.js +8 -9
- package/dist/components/ProtectedRoute/index.js.map +1 -1
- package/dist/components/Row/index.d.ts +28 -0
- package/dist/components/Row/index.js +30 -0
- package/dist/components/Row/index.js.map +1 -0
- package/dist/components/Select/index.js +251 -254
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.js +56 -59
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Slider/index.d.ts +39 -0
- package/dist/components/Slider/index.js +52 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/StatCard/index.d.ts +29 -1
- package/dist/components/StatCard/index.js +189 -86
- package/dist/components/StatCard/index.js.map +1 -1
- package/dist/components/Switch/index.d.ts +34 -0
- package/dist/components/Switch/index.js +55 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tab/index.d.ts +40 -0
- package/dist/components/Table/index.js +109 -121
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/index.js +28 -38
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +43 -0
- package/dist/components/Text/index.js +55 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +23 -0
- package/dist/components/Tooltip/index.js +34 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/Tree/Tree.js +205 -205
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/pro/ArticleContextMenu/index.js +86 -87
- package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
- package/dist/components/pro/ArticleControl/ArticleControl2.js +250 -250
- package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
- package/dist/components/pro/ArticleControl/buildHeadingTree.js +31 -32
- package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
- package/dist/components/pro/ArticleControl/useArticleToc.js +100 -102
- package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
- package/dist/components/pro/Calendar/Calendar.d.ts +10 -0
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.d.ts +47 -0
- package/dist/components/pro/Calendar/hooks/useCalendarState.d.ts +56 -0
- package/dist/components/pro/Calendar/index.d.ts +7 -0
- package/dist/components/pro/Calendar/types.d.ts +151 -0
- package/dist/components/pro/Calendar/utils.d.ts +94 -0
- package/dist/components/pro/Chat/Chat.d.ts +6 -0
- package/dist/components/pro/Chat/index.d.ts +2 -0
- package/dist/components/pro/Chat/types.d.ts +84 -0
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js +287 -327
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +167 -224
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js +594 -613
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js +54 -55
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/index.js +152 -160
- package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/index.js +7 -15
- package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/javascript.js +11 -48
- package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/python.js +4 -40
- package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/snippets.js +118 -147
- package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js +153 -153
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +180 -190
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js +130 -137
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js +228 -242
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js +208 -248
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js +513 -483
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/types.d.ts +1 -1
- package/dist/components/pro/CodeEditor/utils.js +171 -175
- package/dist/components/pro/CodeEditor/utils.js.map +1 -1
- package/dist/components/pro/DataTable/DataTable.js +305 -306
- package/dist/components/pro/DataTable/DataTable.js.map +1 -1
- package/dist/components/pro/DataTable/Filters.js +299 -314
- package/dist/components/pro/DataTable/Filters.js.map +1 -1
- package/dist/components/pro/DataTable/PivotPanel.js +203 -204
- package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
- package/dist/components/pro/DataTable/PivotView.js +142 -144
- package/dist/components/pro/DataTable/PivotView.js.map +1 -1
- package/dist/components/pro/DataTable/components/BulkActions.js +42 -42
- package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
- package/dist/components/pro/DataTable/components/ColumnSelector.js +84 -84
- package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
- package/dist/components/pro/DataTable/components/FilterBar.js +58 -58
- package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableBody.js +93 -94
- package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableHeader.js +78 -78
- package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
- package/dist/components/pro/DataTable/components/TablePagination.js +77 -77
- package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableToolbar.js +40 -40
- package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
- package/dist/components/pro/DataTable/extension.js +5 -5
- package/dist/components/pro/DataTable/extension.js.map +1 -1
- package/dist/components/pro/DataTable/pivotEngine.js +84 -92
- package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
- package/dist/components/pro/DataTable/pivotExtension.js +93 -93
- package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
- package/dist/components/pro/DataTable/rowDetailExtension.js +30 -30
- package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
- package/dist/components/pro/DataTable/tanstack-table.js +45 -62
- package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
- package/dist/components/pro/DataTable/treeDataUtils.js +37 -48
- package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
- package/dist/components/pro/DataTable/useColumnDragReorder.js +68 -68
- package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
- package/dist/components/pro/DataTable/utils.js +156 -168
- package/dist/components/pro/DataTable/utils.js.map +1 -1
- package/dist/components/pro/FileExplorer/Breadcrumb.js +180 -180
- package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
- package/dist/components/pro/FileExplorer/CreateDialog.js +78 -78
- package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileExplorer.js +202 -205
- package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileIcon.js +189 -189
- package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
- package/dist/components/pro/FileExplorer/GridView.js +100 -100
- package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
- package/dist/components/pro/FileExplorer/ListView.js +209 -209
- package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
- package/dist/components/pro/FileExplorer/Toolbar.js +199 -199
- package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +920 -948
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1626 -1662
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/archify/build.js +85 -94
- package/dist/components/pro/Flow/archify/build.js.map +1 -1
- package/dist/components/pro/Flow/archify/convert.js +512 -519
- package/dist/components/pro/Flow/archify/convert.js.map +1 -1
- package/dist/components/pro/Flow/archify/palette.js +87 -104
- package/dist/components/pro/Flow/archify/palette.js.map +1 -1
- package/dist/components/pro/Flow/archify/presets.js +34 -37
- package/dist/components/pro/Flow/archify/presets.js.map +1 -1
- package/dist/components/pro/Flow/archify/spec.js +7 -7
- package/dist/components/pro/Flow/archify/spec.js.map +1 -1
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js +25 -25
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.js +54 -55
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +54 -58
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.js +105 -102
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js +38 -38
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.js +117 -117
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/constants.js +266 -278
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.js +27 -28
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowContext.js +60 -61
- package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js +115 -117
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +135 -138
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgeMarkers.js +11 -14
- package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js +351 -367
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js +49 -52
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useClipboard.js +154 -154
- package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.js +17 -17
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js +40 -40
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js +51 -51
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js +157 -157
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js +190 -201
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +32 -38
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.js +172 -180
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLineMutations.js +57 -57
- package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +229 -238
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useNodeMutations.js +102 -102
- package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePdfExport.js +55 -56
- package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +55 -57
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useResizablePanel.js +31 -31
- package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useSelection.js +69 -69
- package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useUndoRedo.js +27 -27
- package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useViewport.js +28 -28
- package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
- package/dist/components/pro/Flow/lines/FreehandTool.js +63 -63
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js +80 -80
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +88 -88
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/lines/lineSmoothing.js +32 -34
- package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
- package/dist/components/pro/Flow/nodes/DataNodeView.js +236 -242
- package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js +236 -246
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js +63 -63
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/Model3DView.js +111 -113
- package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeHandles.js +74 -80
- package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +303 -314
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeText.js +25 -29
- package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.js +124 -137
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/animAnchors.js +42 -49
- package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
- package/dist/components/pro/Flow/nodes/dataUtils.js +246 -267
- package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/nodeUtils.js +23 -28
- package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/shapes.js +556 -589
- package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIconTexture.js +37 -39
- package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIcons.js +684 -689
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.js +464 -491
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/Breadcrumb.js +41 -41
- package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
- package/dist/components/pro/Flow/panels/ContextMenu.js +37 -37
- package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
- package/dist/components/pro/Flow/panels/DataInspectorSection.js +428 -432
- package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js +61 -62
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +114 -114
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +347 -391
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +1792 -1798
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +242 -248
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/PresentationMode.js +137 -140
- package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
- package/dist/components/pro/Flow/panels/ProjectTitle.js +46 -46
- package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js +557 -572
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +0 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.js +508 -557
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.js +26 -26
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/dashedLine.js +113 -117
- package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
- package/dist/components/pro/Flow/utils/gradient.js +55 -55
- package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
- package/dist/components/pro/Flow/utils/pdfExport.js +50 -89
- package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
- package/dist/components/pro/Flow/utils/themeColor.js +185 -195
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
- package/dist/components/pro/Gantt/Gantt.d.ts +7 -0
- package/dist/components/pro/Gantt/hooks/useGanttDrag.d.ts +31 -0
- package/dist/components/pro/Gantt/hooks/useGanttState.d.ts +58 -0
- package/dist/components/pro/Gantt/index.d.ts +6 -0
- package/dist/components/pro/Gantt/types.d.ts +478 -0
- package/dist/components/pro/Gantt/utils.d.ts +124 -0
- package/dist/components/pro/Resizable/Resizable.d.ts +30 -0
- package/dist/components/pro/Resizable/index.d.ts +2 -0
- package/dist/components/pro/RichTextEditor/AIRewrite.js +323 -334
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js +314 -316
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +97 -97
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentDialog.js +88 -88
- package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js +240 -240
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js +234 -234
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/ContextMenu.js +251 -252
- package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +267 -271
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SlashMenu.js +214 -214
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -75
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +261 -261
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +172 -526
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +112 -114
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +194 -194
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +970 -973
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +11 -12
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +310 -344
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +38 -39
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +620 -625
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js +25 -25
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +167 -176
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/types.js +75 -75
- package/dist/components/pro/RichTextEditor/types.js.map +1 -1
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/contexts/AppContext.js +216 -221
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/data-table.js +15 -41
- package/dist/data-table.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/flow.js +27 -83
- package/dist/hooks/useClickOutside.js +18 -18
- package/dist/hooks/useClickOutside.js.map +1 -1
- package/dist/hooks/useContainerElement.js +9 -9
- package/dist/hooks/useContainerElement.js.map +1 -1
- package/dist/hooks/useControllableState.js +33 -35
- package/dist/hooks/useControllableState.js.map +1 -1
- package/dist/hooks/useCopyToClipboard.js +16 -16
- package/dist/hooks/useCopyToClipboard.js.map +1 -1
- package/dist/hooks/useDebounce.js +14 -14
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/hooks/useDraggable.js +50 -50
- package/dist/hooks/useDraggable.js.map +1 -1
- package/dist/hooks/useTableColumns.js +39 -41
- package/dist/hooks/useTableColumns.js.map +1 -1
- package/dist/hooks/useTableData.js +67 -68
- package/dist/hooks/useTableData.js.map +1 -1
- package/dist/index-nostyled.d.ts +8 -0
- package/dist/index.d.ts +27 -1
- package/dist/index.js +105 -241
- package/dist/layouts/MainLayout.js +56 -56
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Navbar.js +214 -214
- package/dist/layouts/Navbar.js.map +1 -1
- package/dist/layouts/Sidebar.js +184 -186
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.js +25 -25
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/layouts/headbar/HeadbarLangSwitcher.js +39 -39
- package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarSearch.js +120 -120
- package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js +27 -27
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarTitle.js +26 -26
- package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
- package/dist/lite.js +9 -24
- package/dist/markdown.js +4 -9
- package/dist/pages/components/Calendar/index.d.ts +3 -0
- package/dist/pages/components/Calendar/index.en.d.ts +3 -0
- package/dist/pages/components/Calendar/index.zh.d.ts +3 -0
- package/dist/pages/components/Chat/index.d.ts +3 -0
- package/dist/pages/components/Chat/index.en.d.ts +3 -0
- package/dist/pages/components/Chat/index.zh.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.en.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.zh.d.ts +3 -0
- package/dist/pages/components/Gantt/index.d.ts +3 -0
- package/dist/pages/components/Gantt/index.en.d.ts +3 -0
- package/dist/pages/components/Gantt/index.zh.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.en.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.zh.d.ts +3 -0
- package/dist/pages/components/Notification/index.d.ts +3 -0
- package/dist/pages/components/Notification/index.en.d.ts +3 -0
- package/dist/pages/components/Notification/index.zh.d.ts +3 -0
- package/dist/pages/components/Resizable/index.d.ts +3 -0
- package/dist/pages/components/Resizable/index.en.d.ts +3 -0
- package/dist/pages/components/Resizable/index.zh.d.ts +3 -0
- package/dist/pages/components/Tab/index.d.ts +3 -0
- package/dist/pages/components/Tab/index.en.d.ts +3 -0
- package/dist/pages/components/Tab/index.zh.d.ts +3 -0
- package/dist/styles/themeStyles.js +87 -86
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/cn.d.ts +13 -0
- package/dist/utils/cn.js +16 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/i18n.js +690 -602
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +94 -94
- package/dist/utils/menu.js.map +1 -1
- package/dist/utils/rehype-code-meta.js +14 -14
- package/dist/utils/rehype-code-meta.js.map +1 -1
- package/dist/utils/remark-code-meta.js +9 -9
- package/dist/utils/remark-code-meta.js.map +1 -1
- package/dist/utils/routerBuilder.js +59 -60
- package/dist/utils/routerBuilder.js.map +1 -1
- package/dist/utils/selection.js +28 -29
- package/dist/utils/selection.js.map +1 -1
- package/dist/utils/themes.js +275 -255
- package/dist/utils/themes.js.map +1 -1
- package/package.json +19 -6
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Graphics as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
l as AlignmentGuidesRenderer
|
|
1
|
+
import { Graphics as e } from "pixi.js";
|
|
2
|
+
//#region src/components/pro/Flow/canvas/AlignmentGuides.ts
|
|
3
|
+
var t = class {
|
|
4
|
+
gfx;
|
|
5
|
+
constructor(t) {
|
|
6
|
+
this.gfx = new e(), this.gfx.label = "alignment-guides", t.addChild(this.gfx);
|
|
7
|
+
}
|
|
8
|
+
update(e, t, n, r) {
|
|
9
|
+
if (this.gfx.clear(), e.length !== 0) {
|
|
10
|
+
for (let t of e) t.type === "vertical" ? this.gfx.moveTo(t.position, -1e4).lineTo(t.position, 1e4) : this.gfx.moveTo(-1e4, t.position).lineTo(1e4, t.position);
|
|
11
|
+
this.gfx.stroke({
|
|
12
|
+
color: 16347926,
|
|
13
|
+
width: 1,
|
|
14
|
+
alpha: .6
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
clear() {
|
|
19
|
+
this.gfx.clear();
|
|
20
|
+
}
|
|
21
|
+
destroy() {
|
|
22
|
+
this.gfx.destroy();
|
|
23
|
+
}
|
|
26
24
|
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as AlignmentGuidesRenderer };
|
|
27
27
|
|
|
28
28
|
//# sourceMappingURL=AlignmentGuides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlignmentGuides.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/AlignmentGuides.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { AlignGuide } from '../hooks/useAlignmentGuides';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders alignment guide lines (dashed) on the canvas.\n */\nexport class AlignmentGuidesRenderer {\n private gfx: Graphics;\n\n constructor(parent: Container) {\n this.gfx = new Graphics();\n this.gfx.label = 'alignment-guides';\n parent.addChild(this.gfx);\n }\n\n update(guides: AlignGuide[], screenW: number, screenH: number, viewport: ViewportState): void {\n this.gfx.clear();\n if (guides.length === 0) return;\n\n for (const guide of guides) {\n if (guide.type === 'vertical') {\n this.gfx.moveTo(guide.position, -10000).lineTo(guide.position, 10000);\n } else {\n this.gfx.moveTo(-10000, guide.position).lineTo(10000, guide.position);\n }\n }\n this.gfx.stroke({ color: 0xf97316, width: 1, alpha: 0.6 });\n }\n\n clear(): void {\n this.gfx.clear();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlignmentGuides.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/AlignmentGuides.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { AlignGuide } from '../hooks/useAlignmentGuides';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders alignment guide lines (dashed) on the canvas.\n */\nexport class AlignmentGuidesRenderer {\n private gfx: Graphics;\n\n constructor(parent: Container) {\n this.gfx = new Graphics();\n this.gfx.label = 'alignment-guides';\n parent.addChild(this.gfx);\n }\n\n update(guides: AlignGuide[], screenW: number, screenH: number, viewport: ViewportState): void {\n this.gfx.clear();\n if (guides.length === 0) return;\n\n for (const guide of guides) {\n if (guide.type === 'vertical') {\n this.gfx.moveTo(guide.position, -10000).lineTo(guide.position, 10000);\n } else {\n this.gfx.moveTo(-10000, guide.position).lineTo(10000, guide.position);\n }\n }\n this.gfx.stroke({ color: 0xf97316, width: 1, alpha: 0.6 });\n }\n\n clear(): void {\n this.gfx.clear();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":";;AAOA,IAAa,IAAb,MAAqC;CACnC;CAEA,YAAY,GAAmB;EAG7B,AAFA,KAAK,MAAM,IAAI,EAAS,GACxB,KAAK,IAAI,QAAQ,oBACjB,EAAO,SAAS,KAAK,GAAG;CAC1B;CAEA,OAAO,GAAsB,GAAiB,GAAiB,GAA+B;EAC5F,SAAK,IAAI,MAAM,GACX,EAAO,WAAW,GAEtB;QAAK,IAAM,KAAS,GAClB,AAAI,EAAM,SAAS,aACjB,KAAK,IAAI,OAAO,EAAM,UAAU,IAAM,CAAC,CAAC,OAAO,EAAM,UAAU,GAAK,IAEpE,KAAK,IAAI,OAAO,MAAQ,EAAM,QAAQ,CAAC,CAAC,OAAO,KAAO,EAAM,QAAQ;GAGxE,KAAK,IAAI,OAAO;IAAE,OAAO;IAAU,OAAO;IAAG,OAAO;GAAI,CAAC;EAHe;CAI1E;CAEA,QAAc;EACZ,KAAK,IAAI,MAAM;CACjB;CAEA,UAAgB;EACd,KAAK,IAAI,QAAQ;CACnB;AACF"}
|
|
@@ -1,58 +1,57 @@
|
|
|
1
|
-
import { Graphics as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
export {
|
|
55
|
-
b as GridRenderer
|
|
1
|
+
import { Graphics as e } from "pixi.js";
|
|
2
|
+
//#region src/components/pro/Flow/canvas/GridRenderer.ts
|
|
3
|
+
var t = class {
|
|
4
|
+
gfx;
|
|
5
|
+
_gridSize;
|
|
6
|
+
_visible;
|
|
7
|
+
_dotColor = 13751771;
|
|
8
|
+
_last = null;
|
|
9
|
+
constructor(t, n = 20, r = !0) {
|
|
10
|
+
this._gridSize = n, this._visible = r, this.gfx = new e(), this.gfx.label = "grid", t.addChildAt(this.gfx, 0);
|
|
11
|
+
}
|
|
12
|
+
set visible(e) {
|
|
13
|
+
this._visible = e, this.gfx.visible = e;
|
|
14
|
+
}
|
|
15
|
+
set gridSize(e) {
|
|
16
|
+
this._gridSize = Math.max(5, e);
|
|
17
|
+
}
|
|
18
|
+
set dotColor(e) {
|
|
19
|
+
this._dotColor = e;
|
|
20
|
+
}
|
|
21
|
+
update(e, t, n) {
|
|
22
|
+
if (!this._visible) return;
|
|
23
|
+
let { x: r, y: i, zoom: a } = e, o = this._last;
|
|
24
|
+
if (o && o.ox === r && o.oy === i && o.zoom === a && o.w === t && o.h === n && o.grid === this._gridSize && o.vis === this._visible && o.color === this._dotColor) return;
|
|
25
|
+
this._last = {
|
|
26
|
+
ox: r,
|
|
27
|
+
oy: i,
|
|
28
|
+
zoom: a,
|
|
29
|
+
w: t,
|
|
30
|
+
h: n,
|
|
31
|
+
grid: this._gridSize,
|
|
32
|
+
vis: this._visible,
|
|
33
|
+
color: this._dotColor
|
|
34
|
+
};
|
|
35
|
+
let s = this.gfx;
|
|
36
|
+
s.clear();
|
|
37
|
+
let c = this._gridSize * a;
|
|
38
|
+
if (c <= 0) return;
|
|
39
|
+
let l = 1;
|
|
40
|
+
for (; c * l < 12;) l *= 2;
|
|
41
|
+
if (c *= l, (Math.ceil(t / c) + 1) * (Math.ceil(n / c) + 1) > 6e3) return;
|
|
42
|
+
let u = Math.max(.8, Math.min(1.6, a * .8)), d = this._dotColor, f = Math.min(.6, Math.max(.2, a * .4)), p = r % c, m = i % c;
|
|
43
|
+
s.setFillStyle({
|
|
44
|
+
color: d,
|
|
45
|
+
alpha: f
|
|
46
|
+
});
|
|
47
|
+
for (let e = p; e < t; e += c) for (let t = m; t < n; t += c) s.circle(e, t, u);
|
|
48
|
+
s.fill();
|
|
49
|
+
}
|
|
50
|
+
destroy() {
|
|
51
|
+
this.gfx.destroy();
|
|
52
|
+
}
|
|
56
53
|
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { t as GridRenderer };
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=GridRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridRenderer.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/GridRenderer.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders a dot grid on the canvas that adjusts to viewport pan/zoom.\n */\nexport class GridRenderer {\n private gfx: Graphics;\n private _gridSize: number;\n private _visible: boolean;\n private _dotColor = 0xd1d5db;\n // Cache of the last render inputs so we can skip redrawing when nothing\n // changed. Redrawing thousands of dots every frame (60fps) is the main\n // source of low-zoom jitter/stutter.\n private _last: { ox: number; oy: number; zoom: number; w: number; h: number; grid: number; vis: boolean; color: number } | null = null;\n\n constructor(parent: Container, gridSize = 20, visible = true) {\n this._gridSize = gridSize;\n this._visible = visible;\n this.gfx = new Graphics();\n this.gfx.label = 'grid';\n parent.addChildAt(this.gfx, 0);\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.gfx.visible = v;\n }\n\n set gridSize(s: number) {\n this._gridSize = Math.max(5, s);\n }\n\n /** Grid dot color, derived from the active theme's foreground. */\n set dotColor(c: number) {\n this._dotColor = c;\n }\n\n update(viewport: ViewportState, screenW: number, screenH: number): void {\n if (!this._visible) return;\n\n const { x: ox, y: oy, zoom } = viewport;\n\n // Skip the redraw entirely if nothing that affects the grid changed.\n const last = this._last;\n if (\n last &&\n last.ox === ox && last.oy === oy && last.zoom === zoom &&\n last.w === screenW && last.h === screenH &&\n last.grid === this._gridSize && last.vis === this._visible &&\n last.color === this._dotColor\n ) {\n return;\n }\n this._last = { ox, oy, zoom, w: screenW, h: screenH, grid: this._gridSize, vis: this._visible, color: this._dotColor };\n\n const g = this.gfx;\n g.clear();\n\n // Adaptive spacing: multiply the base grid step by a power of two until the\n // on-screen spacing is comfortably large. Without this, low zoom levels\n // (e.g. 25%–45%) produce tens of thousands of dots per frame.\n const MIN_SCREEN_STEP = 12;\n let step = this._gridSize * zoom;\n if (step <= 0) return;\n let mul = 1;\n while (step * mul < MIN_SCREEN_STEP) {\n mul *= 2;\n }\n step *= mul;\n\n // Hard cap on total dot count as a final safety net.\n const MAX_DOTS = 6000;\n const cols = Math.ceil(screenW / step) + 1;\n const rows = Math.ceil(screenH / step) + 1;\n if (cols * rows > MAX_DOTS) return;\n\n const dotRadius = Math.max(0.8, Math.min(1.6, zoom * 0.8));\n const dotColor = this._dotColor;\n const dotAlpha = Math.min(0.6, Math.max(0.2, zoom * 0.4));\n\n const startX = ox % step;\n const startY = oy % step;\n\n g.setFillStyle({ color: dotColor, alpha: dotAlpha });\n for (let x = startX; x < screenW; x += step) {\n for (let y = startY; y < screenH; y += step) {\n g.circle(x, y, dotRadius);\n }\n }\n g.fill();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridRenderer.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/GridRenderer.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders a dot grid on the canvas that adjusts to viewport pan/zoom.\n */\nexport class GridRenderer {\n private gfx: Graphics;\n private _gridSize: number;\n private _visible: boolean;\n private _dotColor = 0xd1d5db;\n // Cache of the last render inputs so we can skip redrawing when nothing\n // changed. Redrawing thousands of dots every frame (60fps) is the main\n // source of low-zoom jitter/stutter.\n private _last: { ox: number; oy: number; zoom: number; w: number; h: number; grid: number; vis: boolean; color: number } | null = null;\n\n constructor(parent: Container, gridSize = 20, visible = true) {\n this._gridSize = gridSize;\n this._visible = visible;\n this.gfx = new Graphics();\n this.gfx.label = 'grid';\n parent.addChildAt(this.gfx, 0);\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.gfx.visible = v;\n }\n\n set gridSize(s: number) {\n this._gridSize = Math.max(5, s);\n }\n\n /** Grid dot color, derived from the active theme's foreground. */\n set dotColor(c: number) {\n this._dotColor = c;\n }\n\n update(viewport: ViewportState, screenW: number, screenH: number): void {\n if (!this._visible) return;\n\n const { x: ox, y: oy, zoom } = viewport;\n\n // Skip the redraw entirely if nothing that affects the grid changed.\n const last = this._last;\n if (\n last &&\n last.ox === ox && last.oy === oy && last.zoom === zoom &&\n last.w === screenW && last.h === screenH &&\n last.grid === this._gridSize && last.vis === this._visible &&\n last.color === this._dotColor\n ) {\n return;\n }\n this._last = { ox, oy, zoom, w: screenW, h: screenH, grid: this._gridSize, vis: this._visible, color: this._dotColor };\n\n const g = this.gfx;\n g.clear();\n\n // Adaptive spacing: multiply the base grid step by a power of two until the\n // on-screen spacing is comfortably large. Without this, low zoom levels\n // (e.g. 25%–45%) produce tens of thousands of dots per frame.\n const MIN_SCREEN_STEP = 12;\n let step = this._gridSize * zoom;\n if (step <= 0) return;\n let mul = 1;\n while (step * mul < MIN_SCREEN_STEP) {\n mul *= 2;\n }\n step *= mul;\n\n // Hard cap on total dot count as a final safety net.\n const MAX_DOTS = 6000;\n const cols = Math.ceil(screenW / step) + 1;\n const rows = Math.ceil(screenH / step) + 1;\n if (cols * rows > MAX_DOTS) return;\n\n const dotRadius = Math.max(0.8, Math.min(1.6, zoom * 0.8));\n const dotColor = this._dotColor;\n const dotAlpha = Math.min(0.6, Math.max(0.2, zoom * 0.4));\n\n const startX = ox % step;\n const startY = oy % step;\n\n g.setFillStyle({ color: dotColor, alpha: dotAlpha });\n for (let x = startX; x < screenW; x += step) {\n for (let y = startY; y < screenH; y += step) {\n g.circle(x, y, dotRadius);\n }\n }\n g.fill();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":";;AAMA,IAAa,IAAb,MAA0B;CACxB;CACA;CACA;CACA,YAAoB;CAIpB,QAAkI;CAElI,YAAY,GAAmB,IAAW,IAAI,IAAU,IAAM;EAK5D,AAJA,KAAK,YAAY,GACjB,KAAK,WAAW,GAChB,KAAK,MAAM,IAAI,EAAS,GACxB,KAAK,IAAI,QAAQ,QACjB,EAAO,WAAW,KAAK,KAAK,CAAC;CAC/B;CAEA,IAAI,QAAQ,GAAY;EAEtB,AADA,KAAK,WAAW,GAChB,KAAK,IAAI,UAAU;CACrB;CAEA,IAAI,SAAS,GAAW;EACtB,KAAK,YAAY,KAAK,IAAI,GAAG,CAAC;CAChC;CAGA,IAAI,SAAS,GAAW;EACtB,KAAK,YAAY;CACnB;CAEA,OAAO,GAAyB,GAAiB,GAAuB;EACtE,IAAI,CAAC,KAAK,UAAU;EAEpB,IAAM,EAAE,GAAG,GAAI,GAAG,GAAI,YAAS,GAGzB,IAAO,KAAK;EAClB,IACE,KACA,EAAK,OAAO,KAAM,EAAK,OAAO,KAAM,EAAK,SAAS,KAClD,EAAK,MAAM,KAAW,EAAK,MAAM,KACjC,EAAK,SAAS,KAAK,aAAa,EAAK,QAAQ,KAAK,YAClD,EAAK,UAAU,KAAK,WAEpB;EAEF,KAAK,QAAQ;GAAE;GAAI;GAAI;GAAM,GAAG;GAAS,GAAG;GAAS,MAAM,KAAK;GAAW,KAAK,KAAK;GAAU,OAAO,KAAK;EAAU;EAErH,IAAM,IAAI,KAAK;EACf,EAAE,MAAM;EAKR,IACI,IAAO,KAAK,YAAY;EAC5B,IAAI,KAAQ,GAAG;EACf,IAAI,IAAM;EACV,OAAO,IAAO,IAAM,KAClB,KAAO;EAQT,IANA,KAAQ,IAIK,KAAK,KAAK,IAAU,CAAI,IAAI,MAC5B,KAAK,KAAK,IAAU,CAAI,IAAI,KACvB,KAAU;EAE5B,IAAM,IAAY,KAAK,IAAI,IAAK,KAAK,IAAI,KAAK,IAAO,EAAG,CAAC,GACnD,IAAW,KAAK,WAChB,IAAW,KAAK,IAAI,IAAK,KAAK,IAAI,IAAK,IAAO,EAAG,CAAC,GAElD,IAAS,IAAK,GACd,IAAS,IAAK;EAEpB,EAAE,aAAa;GAAE,OAAO;GAAU,OAAO;EAAS,CAAC;EACnD,KAAK,IAAI,IAAI,GAAQ,IAAI,GAAS,KAAK,GACrC,KAAK,IAAI,IAAI,GAAQ,IAAI,GAAS,KAAK,GACrC,EAAE,OAAO,GAAG,GAAG,CAAS;EAG5B,EAAE,KAAK;CACT;CAEA,UAAgB;EACd,KAAK,IAAI,QAAQ;CACnB;AACF"}
|
|
@@ -1,61 +1,57 @@
|
|
|
1
|
-
import { resolveThemeColor as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
destroy() {
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
S as MiniMapRenderer
|
|
1
|
+
import { resolveThemeColor as e } from "../utils/themeColor.js";
|
|
2
|
+
//#region src/components/pro/Flow/canvas/MiniMapRenderer.ts
|
|
3
|
+
var t = class {
|
|
4
|
+
canvas;
|
|
5
|
+
ctx;
|
|
6
|
+
_visible = !0;
|
|
7
|
+
_transform = null;
|
|
8
|
+
constructor(e) {
|
|
9
|
+
this.canvas = e, this.ctx = e.getContext("2d");
|
|
10
|
+
}
|
|
11
|
+
set visible(e) {
|
|
12
|
+
this._visible = e, this.canvas.style.display = e ? "block" : "none";
|
|
13
|
+
}
|
|
14
|
+
minimapToWorld(e, t) {
|
|
15
|
+
let n = this._transform;
|
|
16
|
+
return n ? {
|
|
17
|
+
x: (e - n.ox) / n.scale + n.wMinX,
|
|
18
|
+
y: (t - n.oy) / n.scale + n.wMinY
|
|
19
|
+
} : null;
|
|
20
|
+
}
|
|
21
|
+
get size() {
|
|
22
|
+
return {
|
|
23
|
+
width: this.canvas.width,
|
|
24
|
+
height: this.canvas.height
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
update(t, n, r, i) {
|
|
28
|
+
if (!this._visible || t.length === 0) {
|
|
29
|
+
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
let a = this.canvas.width, o = this.canvas.height;
|
|
33
|
+
this.ctx.clearRect(0, 0, a, o);
|
|
34
|
+
let s = -n.x / n.zoom, c = -n.y / n.zoom, l = r / n.zoom, u = i / n.zoom, d = Infinity, f = Infinity, p = -Infinity, m = -Infinity;
|
|
35
|
+
for (let e of t) d = Math.min(d, e.position.x), f = Math.min(f, e.position.y), p = Math.max(p, e.position.x + e.width), m = Math.max(m, e.position.y + e.height);
|
|
36
|
+
d -= 50, f -= 50, p += 50, m += 50, d = Math.min(d, s), f = Math.min(f, c), p = Math.max(p, s + l), m = Math.max(m, c + u);
|
|
37
|
+
let h = p - d, g = m - f, _ = Math.min(a / h, o / g), v = (a - h * _) / 2, y = (o - g * _) / 2;
|
|
38
|
+
this._transform = {
|
|
39
|
+
scale: _,
|
|
40
|
+
ox: v,
|
|
41
|
+
oy: y,
|
|
42
|
+
wMinX: d,
|
|
43
|
+
wMinY: f
|
|
44
|
+
};
|
|
45
|
+
for (let n of t) {
|
|
46
|
+
let t = v + (n.position.x - d) * _, r = y + (n.position.y - f) * _, i = n.width * _, a = n.height * _;
|
|
47
|
+
this.ctx.fillStyle = n.data.fill === "transparent" ? "#e5e7eb" : e(n.data.fill, "#e5e7eb"), this.ctx.fillRect(t, r, Math.max(i, 2), Math.max(a, 2)), this.ctx.strokeStyle = n.data.stroke === "transparent" ? "#9ca3af" : e(n.data.stroke, "#9ca3af"), this.ctx.lineWidth = .5, this.ctx.strokeRect(t, r, Math.max(i, 2), Math.max(a, 2));
|
|
48
|
+
}
|
|
49
|
+
let b = v + (s - d) * _, x = y + (c - f) * _, S = l * _, C = u * _;
|
|
50
|
+
this.ctx.fillStyle = "rgba(59, 130, 246, 0.12)", this.ctx.fillRect(b, x, S, C), this.ctx.strokeStyle = "#3b82f6", this.ctx.lineWidth = 1.5, this.ctx.strokeRect(b, x, S, C);
|
|
51
|
+
}
|
|
52
|
+
destroy() {}
|
|
59
53
|
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { t as MiniMapRenderer };
|
|
60
56
|
|
|
61
57
|
//# sourceMappingURL=MiniMapRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiniMapRenderer.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/MiniMapRenderer.ts"],"sourcesContent":["import { Graphics, Container, Application } from 'pixi.js';\nimport type { FlowNode, FlowEdge, ViewportState } from '../types';\nimport { resolveThemeColor } from '../utils/themeColor';\n\n/**\n * Renders a small minimap in a separate canvas element.\n * Shows node positions as colored rectangles and a viewport rectangle.\n */\nexport class MiniMapRenderer {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private _visible = true;\n\n // Last-computed world→minimap transform, used to invert minimap clicks\n // back into world coordinates for click-to-navigate.\n private _transform: { scale: number; ox: number; oy: number; wMinX: number; wMinY: number } | null = null;\n\n constructor(canvas: HTMLCanvasElement) {\n this.canvas = canvas;\n this.ctx = canvas.getContext('2d')!;\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.canvas.style.display = v ? 'block' : 'none';\n }\n\n /**\n * Convert a point in minimap *canvas pixel* space (0..canvas.width /\n * 0..canvas.height) into world coordinates. Returns null if the minimap has\n * not been rendered yet (no transform available).\n */\n minimapToWorld(px: number, py: number): { x: number; y: number } | null {\n const t = this._transform;\n if (!t) return null;\n return {\n x: (px - t.ox) / t.scale + t.wMinX,\n y: (py - t.oy) / t.scale + t.wMinY,\n };\n }\n\n /** Canvas backing size, so callers can map CSS pixels → canvas pixels. */\n get size(): { width: number; height: number } {\n return { width: this.canvas.width, height: this.canvas.height };\n }\n\n update(\n nodes: FlowNode[],\n viewport: ViewportState,\n screenW: number,\n screenH: number,\n ): void {\n if (!this._visible || nodes.length === 0) {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n return;\n }\n\n const cw = this.canvas.width;\n const ch = this.canvas.height;\n this.ctx.clearRect(0, 0, cw, ch);\n\n // Current viewport rect in world coords.\n const viewX = -viewport.x / viewport.zoom;\n const viewY = -viewport.y / viewport.zoom;\n const viewW = screenW / viewport.zoom;\n const viewH = screenH / viewport.zoom;\n\n // Compute world bounds of the content.\n let wMinX = Infinity, wMinY = Infinity, wMaxX = -Infinity, wMaxY = -Infinity;\n for (const n of nodes) {\n wMinX = Math.min(wMinX, n.position.x);\n wMinY = Math.min(wMinY, n.position.y);\n wMaxX = Math.max(wMaxX, n.position.x + n.width);\n wMaxY = Math.max(wMaxY, n.position.y + n.height);\n }\n\n const padding = 50;\n wMinX -= padding;\n wMinY -= padding;\n wMaxX += padding;\n wMaxY += padding;\n\n // Include the viewport rect in the fitted bounds so the blue box always\n // stays visible and proportional (instead of overflowing when zoomed out).\n wMinX = Math.min(wMinX, viewX);\n wMinY = Math.min(wMinY, viewY);\n wMaxX = Math.max(wMaxX, viewX + viewW);\n wMaxY = Math.max(wMaxY, viewY + viewH);\n\n const ww = wMaxX - wMinX;\n const wh = wMaxY - wMinY;\n const scale = Math.min(cw / ww, ch / wh);\n const ox = (cw - ww * scale) / 2;\n const oy = (ch - wh * scale) / 2;\n\n // Remember the transform so minimap clicks can be inverted to world space.\n this._transform = { scale, ox, oy, wMinX, wMinY };\n\n // Draw nodes\n for (const n of nodes) {\n const x = ox + (n.position.x - wMinX) * scale;\n const y = oy + (n.position.y - wMinY) * scale;\n const w = n.width * scale;\n const h = n.height * scale;\n\n this.ctx.fillStyle = n.data.fill === 'transparent' ? '#e5e7eb' : resolveThemeColor(n.data.fill, '#e5e7eb');\n this.ctx.fillRect(x, y, Math.max(w, 2), Math.max(h, 2));\n this.ctx.strokeStyle = n.data.stroke === 'transparent' ? '#9ca3af' : resolveThemeColor(n.data.stroke, '#9ca3af');\n this.ctx.lineWidth = 0.5;\n this.ctx.strokeRect(x, y, Math.max(w, 2), Math.max(h, 2));\n }\n\n // Draw viewport rectangle\n const vpX = ox + (viewX - wMinX) * scale;\n const vpY = oy + (viewY - wMinY) * scale;\n const vpW = viewW * scale;\n const vpH = viewH * scale;\n\n this.ctx.fillStyle = 'rgba(59, 130, 246, 0.12)';\n this.ctx.fillRect(vpX, vpY, vpW, vpH);\n this.ctx.strokeStyle = '#3b82f6';\n this.ctx.lineWidth = 1.5;\n this.ctx.strokeRect(vpX, vpY, vpW, vpH);\n }\n\n destroy(): void {\n // Canvas element lifecycle managed by React\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MiniMapRenderer.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/MiniMapRenderer.ts"],"sourcesContent":["import { Graphics, Container, Application } from 'pixi.js';\nimport type { FlowNode, FlowEdge, ViewportState } from '../types';\nimport { resolveThemeColor } from '../utils/themeColor';\n\n/**\n * Renders a small minimap in a separate canvas element.\n * Shows node positions as colored rectangles and a viewport rectangle.\n */\nexport class MiniMapRenderer {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private _visible = true;\n\n // Last-computed world→minimap transform, used to invert minimap clicks\n // back into world coordinates for click-to-navigate.\n private _transform: { scale: number; ox: number; oy: number; wMinX: number; wMinY: number } | null = null;\n\n constructor(canvas: HTMLCanvasElement) {\n this.canvas = canvas;\n this.ctx = canvas.getContext('2d')!;\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.canvas.style.display = v ? 'block' : 'none';\n }\n\n /**\n * Convert a point in minimap *canvas pixel* space (0..canvas.width /\n * 0..canvas.height) into world coordinates. Returns null if the minimap has\n * not been rendered yet (no transform available).\n */\n minimapToWorld(px: number, py: number): { x: number; y: number } | null {\n const t = this._transform;\n if (!t) return null;\n return {\n x: (px - t.ox) / t.scale + t.wMinX,\n y: (py - t.oy) / t.scale + t.wMinY,\n };\n }\n\n /** Canvas backing size, so callers can map CSS pixels → canvas pixels. */\n get size(): { width: number; height: number } {\n return { width: this.canvas.width, height: this.canvas.height };\n }\n\n update(\n nodes: FlowNode[],\n viewport: ViewportState,\n screenW: number,\n screenH: number,\n ): void {\n if (!this._visible || nodes.length === 0) {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n return;\n }\n\n const cw = this.canvas.width;\n const ch = this.canvas.height;\n this.ctx.clearRect(0, 0, cw, ch);\n\n // Current viewport rect in world coords.\n const viewX = -viewport.x / viewport.zoom;\n const viewY = -viewport.y / viewport.zoom;\n const viewW = screenW / viewport.zoom;\n const viewH = screenH / viewport.zoom;\n\n // Compute world bounds of the content.\n let wMinX = Infinity, wMinY = Infinity, wMaxX = -Infinity, wMaxY = -Infinity;\n for (const n of nodes) {\n wMinX = Math.min(wMinX, n.position.x);\n wMinY = Math.min(wMinY, n.position.y);\n wMaxX = Math.max(wMaxX, n.position.x + n.width);\n wMaxY = Math.max(wMaxY, n.position.y + n.height);\n }\n\n const padding = 50;\n wMinX -= padding;\n wMinY -= padding;\n wMaxX += padding;\n wMaxY += padding;\n\n // Include the viewport rect in the fitted bounds so the blue box always\n // stays visible and proportional (instead of overflowing when zoomed out).\n wMinX = Math.min(wMinX, viewX);\n wMinY = Math.min(wMinY, viewY);\n wMaxX = Math.max(wMaxX, viewX + viewW);\n wMaxY = Math.max(wMaxY, viewY + viewH);\n\n const ww = wMaxX - wMinX;\n const wh = wMaxY - wMinY;\n const scale = Math.min(cw / ww, ch / wh);\n const ox = (cw - ww * scale) / 2;\n const oy = (ch - wh * scale) / 2;\n\n // Remember the transform so minimap clicks can be inverted to world space.\n this._transform = { scale, ox, oy, wMinX, wMinY };\n\n // Draw nodes\n for (const n of nodes) {\n const x = ox + (n.position.x - wMinX) * scale;\n const y = oy + (n.position.y - wMinY) * scale;\n const w = n.width * scale;\n const h = n.height * scale;\n\n this.ctx.fillStyle = n.data.fill === 'transparent' ? '#e5e7eb' : resolveThemeColor(n.data.fill, '#e5e7eb');\n this.ctx.fillRect(x, y, Math.max(w, 2), Math.max(h, 2));\n this.ctx.strokeStyle = n.data.stroke === 'transparent' ? '#9ca3af' : resolveThemeColor(n.data.stroke, '#9ca3af');\n this.ctx.lineWidth = 0.5;\n this.ctx.strokeRect(x, y, Math.max(w, 2), Math.max(h, 2));\n }\n\n // Draw viewport rectangle\n const vpX = ox + (viewX - wMinX) * scale;\n const vpY = oy + (viewY - wMinY) * scale;\n const vpW = viewW * scale;\n const vpH = viewH * scale;\n\n this.ctx.fillStyle = 'rgba(59, 130, 246, 0.12)';\n this.ctx.fillRect(vpX, vpY, vpW, vpH);\n this.ctx.strokeStyle = '#3b82f6';\n this.ctx.lineWidth = 1.5;\n this.ctx.strokeRect(vpX, vpY, vpW, vpH);\n }\n\n destroy(): void {\n // Canvas element lifecycle managed by React\n }\n}\n"],"mappings":";;AAQA,IAAa,IAAb,MAA6B;CAC3B;CACA;CACA,WAAmB;CAInB,aAAqG;CAErG,YAAY,GAA2B;EAErC,AADA,KAAK,SAAS,GACd,KAAK,MAAM,EAAO,WAAW,IAAI;CACnC;CAEA,IAAI,QAAQ,GAAY;EAEtB,AADA,KAAK,WAAW,GAChB,KAAK,OAAO,MAAM,UAAU,IAAI,UAAU;CAC5C;CAOA,eAAe,GAAY,GAA6C;EACtE,IAAM,IAAI,KAAK;EAEf,OADK,IACE;GACL,IAAI,IAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;GAC7B,IAAI,IAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;EAC/B,IAJe;CAKjB;CAGA,IAAI,OAA0C;EAC5C,OAAO;GAAE,OAAO,KAAK,OAAO;GAAO,QAAQ,KAAK,OAAO;EAAO;CAChE;CAEA,OACE,GACA,GACA,GACA,GACM;EACN,IAAI,CAAC,KAAK,YAAY,EAAM,WAAW,GAAG;GACxC,KAAK,IAAI,UAAU,GAAG,GAAG,KAAK,OAAO,OAAO,KAAK,OAAO,MAAM;GAC9D;EACF;EAEA,IAAM,IAAK,KAAK,OAAO,OACjB,IAAK,KAAK,OAAO;EACvB,KAAK,IAAI,UAAU,GAAG,GAAG,GAAI,CAAE;EAG/B,IAAM,IAAQ,CAAC,EAAS,IAAI,EAAS,MAC/B,IAAQ,CAAC,EAAS,IAAI,EAAS,MAC/B,IAAQ,IAAU,EAAS,MAC3B,IAAQ,IAAU,EAAS,MAG7B,IAAQ,UAAU,IAAQ,UAAU,IAAQ,WAAW,IAAQ;EACnE,KAAK,IAAM,KAAK,GAId,AAHA,IAAQ,KAAK,IAAI,GAAO,EAAE,SAAS,CAAC,GACpC,IAAQ,KAAK,IAAI,GAAO,EAAE,SAAS,CAAC,GACpC,IAAQ,KAAK,IAAI,GAAO,EAAE,SAAS,IAAI,EAAE,KAAK,GAC9C,IAAQ,KAAK,IAAI,GAAO,EAAE,SAAS,IAAI,EAAE,MAAM;EAcjD,AAVA,KAAS,IACT,KAAS,IACT,KAAS,IACT,KAAS,IAIT,IAAQ,KAAK,IAAI,GAAO,CAAK,GAC7B,IAAQ,KAAK,IAAI,GAAO,CAAK,GAC7B,IAAQ,KAAK,IAAI,GAAO,IAAQ,CAAK,GACrC,IAAQ,KAAK,IAAI,GAAO,IAAQ,CAAK;EAErC,IAAM,IAAK,IAAQ,GACb,IAAK,IAAQ,GACb,IAAQ,KAAK,IAAI,IAAK,GAAI,IAAK,CAAE,GACjC,KAAM,IAAK,IAAK,KAAS,GACzB,KAAM,IAAK,IAAK,KAAS;EAG/B,KAAK,aAAa;GAAE;GAAO;GAAI;GAAI;GAAO;EAAM;EAGhD,KAAK,IAAM,KAAK,GAAO;GACrB,IAAM,IAAI,KAAM,EAAE,SAAS,IAAI,KAAS,GAClC,IAAI,KAAM,EAAE,SAAS,IAAI,KAAS,GAClC,IAAI,EAAE,QAAQ,GACd,IAAI,EAAE,SAAS;GAMrB,AAJA,KAAK,IAAI,YAAY,EAAE,KAAK,SAAS,gBAAgB,YAAY,EAAkB,EAAE,KAAK,MAAM,SAAS,GACzG,KAAK,IAAI,SAAS,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC,GACtD,KAAK,IAAI,cAAc,EAAE,KAAK,WAAW,gBAAgB,YAAY,EAAkB,EAAE,KAAK,QAAQ,SAAS,GAC/G,KAAK,IAAI,YAAY,IACrB,KAAK,IAAI,WAAW,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;EAC1D;EAGA,IAAM,IAAM,KAAM,IAAQ,KAAS,GAC7B,IAAM,KAAM,IAAQ,KAAS,GAC7B,IAAM,IAAQ,GACd,IAAM,IAAQ;EAMpB,AAJA,KAAK,IAAI,YAAY,4BACrB,KAAK,IAAI,SAAS,GAAK,GAAK,GAAK,CAAG,GACpC,KAAK,IAAI,cAAc,WACvB,KAAK,IAAI,YAAY,KACrB,KAAK,IAAI,WAAW,GAAK,GAAK,GAAK,CAAG;CACxC;CAEA,UAAgB,CAEhB;AACF"}
|
|
@@ -1,105 +1,108 @@
|
|
|
1
|
-
import { Application as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
1
|
+
import { Application as e, Container as t } from "pixi.js";
|
|
2
|
+
//#region src/components/pro/Flow/canvas/PixiApp.ts
|
|
3
|
+
var n = class {
|
|
4
|
+
app;
|
|
5
|
+
world;
|
|
6
|
+
_destroyed = !1;
|
|
7
|
+
_initialized = !1;
|
|
8
|
+
constructor() {
|
|
9
|
+
this.app = new e(), this.world = new t({ label: "world" });
|
|
10
|
+
}
|
|
11
|
+
async init(e) {
|
|
12
|
+
this._destroyed || (await this.app.init({
|
|
13
|
+
canvas: e.canvas,
|
|
14
|
+
background: e.backgroundColor ?? 16316922,
|
|
15
|
+
antialias: e.antialias ?? !0,
|
|
16
|
+
resolution: e.resolution ?? (window.devicePixelRatio || 1),
|
|
17
|
+
autoDensity: e.autoDensity ?? !0,
|
|
18
|
+
width: e.width,
|
|
19
|
+
height: e.height
|
|
20
|
+
}), !this._destroyed && (this._initialized = !0, this.app.stage.addChild(this.world), this.app.stage.eventMode = "static", this.app.stage.hitArea = this.app.screen));
|
|
21
|
+
}
|
|
22
|
+
resize(e, t) {
|
|
23
|
+
!this._destroyed && this._initialized && (this.app.renderer.resize(e, t), this.app.stage.hitArea = this.app.screen);
|
|
24
|
+
}
|
|
25
|
+
setBackgroundColor(e) {
|
|
26
|
+
!this._destroyed && this._initialized && (this.app.renderer.background.color = e);
|
|
27
|
+
}
|
|
28
|
+
async exportPNG(e) {
|
|
29
|
+
if (this._destroyed || !this._initialized) return null;
|
|
30
|
+
let t = this.app.renderer;
|
|
31
|
+
if (!t || !t.extract) return null;
|
|
32
|
+
this.app.render();
|
|
33
|
+
let n;
|
|
34
|
+
try {
|
|
35
|
+
n = t.extract.canvas(this.app.stage);
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
let r = n.width, i = n.height;
|
|
40
|
+
if (!r || !i) return null;
|
|
41
|
+
let a = document.createElement("canvas");
|
|
42
|
+
a.width = r, a.height = i;
|
|
43
|
+
let o = a.getContext("2d");
|
|
44
|
+
return o ? (o.fillStyle = e === void 0 ? "#ffffff" : `#${e.toString(16).padStart(6, "0")}`, o.fillRect(0, 0, r, i), o.drawImage(n, 0, 0), a.toDataURL("image/png")) : typeof n.toDataURL == "function" ? n.toDataURL("image/png") : null;
|
|
45
|
+
}
|
|
46
|
+
async exportRegionPNG(e, t) {
|
|
47
|
+
if (this._destroyed || !this._initialized) return null;
|
|
48
|
+
let { Rectangle: n } = await import("pixi.js"), r = this.app.renderer;
|
|
49
|
+
if (!r || !r.extract) return null;
|
|
50
|
+
let i = Math.max(.1, t?.scale ?? 2), a = {
|
|
51
|
+
x: this.world.position.x,
|
|
52
|
+
y: this.world.position.y,
|
|
53
|
+
sx: this.world.scale.x,
|
|
54
|
+
sy: this.world.scale.y
|
|
55
|
+
};
|
|
56
|
+
this.world.position.set(0, 0), this.world.scale.set(1, 1);
|
|
57
|
+
let o;
|
|
58
|
+
try {
|
|
59
|
+
this.app.render(), o = r.extract.canvas({
|
|
60
|
+
target: this.world,
|
|
61
|
+
frame: new n(e.x, e.y, e.w, e.h),
|
|
62
|
+
resolution: i,
|
|
63
|
+
antialias: !0
|
|
64
|
+
});
|
|
65
|
+
} catch {
|
|
66
|
+
return this.world.position.set(a.x, a.y), this.world.scale.set(a.sx, a.sy), this.app.render(), null;
|
|
67
|
+
}
|
|
68
|
+
this.world.position.set(a.x, a.y), this.world.scale.set(a.sx, a.sy), this.app.render();
|
|
69
|
+
let s = o.width, c = o.height;
|
|
70
|
+
if (!s || !c) return null;
|
|
71
|
+
let l = document.createElement("canvas");
|
|
72
|
+
l.width = s, l.height = c;
|
|
73
|
+
let u = l.getContext("2d");
|
|
74
|
+
if (!u) {
|
|
75
|
+
let e = typeof o.toDataURL == "function" ? o.toDataURL("image/png") : null;
|
|
76
|
+
return e ? {
|
|
77
|
+
dataUrl: e,
|
|
78
|
+
width: s,
|
|
79
|
+
height: c
|
|
80
|
+
} : null;
|
|
81
|
+
}
|
|
82
|
+
return u.fillStyle = t?.backgroundColor === void 0 ? "#ffffff" : `#${t.backgroundColor.toString(16).padStart(6, "0")}`, u.fillRect(0, 0, s, c), u.drawImage(o, 0, 0), {
|
|
83
|
+
dataUrl: l.toDataURL("image/png"),
|
|
84
|
+
width: s,
|
|
85
|
+
height: c
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
destroy() {
|
|
89
|
+
if (!this._destroyed && (this._destroyed = !0, this._initialized)) {
|
|
90
|
+
try {
|
|
91
|
+
this.app.stage.destroy({
|
|
92
|
+
children: !0,
|
|
93
|
+
texture: !0
|
|
94
|
+
});
|
|
95
|
+
} catch {}
|
|
96
|
+
try {
|
|
97
|
+
this.app.destroy(!1);
|
|
98
|
+
} catch {}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
get destroyed() {
|
|
102
|
+
return this._destroyed;
|
|
103
|
+
}
|
|
103
104
|
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { n as PixiApp };
|
|
104
107
|
|
|
105
108
|
//# sourceMappingURL=PixiApp.js.map
|