dishui 0.0.46 → 0.0.48
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/chart.js +35 -33
- package/dist/components/Chart/index.d.ts +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +1 -2
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js +0 -25
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/types.d.ts +1 -1
- package/dist/components/pro/DataTable/pivotExtension.d.ts +6 -0
- package/dist/components/pro/DataTable/pivotExtension.js +31 -30
- package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +500 -459
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +526 -524
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.d.ts +3 -0
- package/dist/components/pro/Flow/canvas/GridRenderer.js +28 -23
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +18 -17
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.d.ts +24 -0
- package/dist/components/pro/Flow/canvas/PixiApp.js +60 -15
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/constants.js +7 -7
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.d.ts +15 -0
- package/dist/components/pro/Flow/context/FlowAIContext.js +32 -0
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -0
- package/dist/components/pro/Flow/context/FlowUIContext.d.ts +4 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js +58 -55
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +22 -21
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.d.ts +6 -0
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js +146 -89
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.d.ts +2 -0
- package/dist/components/pro/Flow/hooks/useLayoutActions.js +94 -65
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePdfExport.d.ts +10 -0
- package/dist/components/pro/Flow/hooks/usePdfExport.js +60 -0
- package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -0
- package/dist/components/pro/Flow/hooks/usePixiApp.d.ts +6 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +49 -30
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/index.d.ts +5 -2
- package/dist/components/pro/Flow/lines/FreehandTool.js +21 -20
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js +22 -18
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +19 -18
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/DataNodeView.d.ts +7 -0
- package/dist/components/pro/Flow/nodes/DataNodeView.js +217 -0
- package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -0
- package/dist/components/pro/Flow/nodes/MediaContent.js +149 -120
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js +22 -17
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +77 -76
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.d.ts +22 -0
- package/dist/components/pro/Flow/nodes/aiClient.js +107 -54
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/dataUtils.d.ts +52 -0
- package/dist/components/pro/Flow/nodes/dataUtils.js +270 -0
- package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -0
- package/dist/components/pro/Flow/nodes/svgIcons.js +59 -27
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.d.ts +2 -0
- package/dist/components/pro/Flow/panels/AIPanel.js +498 -0
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -0
- package/dist/components/pro/Flow/panels/DataInspectorSection.d.ts +11 -0
- package/dist/components/pro/Flow/panels/DataInspectorSection.js +436 -0
- package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -0
- package/dist/components/pro/Flow/panels/ExpandableTextarea.d.ts +16 -0
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js +65 -0
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -0
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +51 -39
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.d.ts +5 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +310 -233
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +358 -363
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +63 -62
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/ProjectTitle.d.ts +8 -0
- package/dist/components/pro/Flow/panels/ProjectTitle.js +49 -0
- package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -0
- package/dist/components/pro/Flow/panels/ShapePalette.js +128 -115
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +13 -0
- package/dist/components/pro/Flow/panels/toolbarIcons.js +241 -87
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.d.ts +77 -1
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/pdfExport.d.ts +20 -0
- package/dist/components/pro/Flow/utils/pdfExport.js +95 -0
- package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -0
- package/dist/components/pro/Flow/utils/themeColor.d.ts +86 -0
- package/dist/components/pro/Flow/utils/themeColor.js +190 -0
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -0
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/contexts/AppContext.js +28 -29
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/favicon.svg +10 -0
- package/dist/flow.js +59 -51
- package/dist/index-nostyled.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles/themeStyles.js +6 -11
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/themes.js +3 -23
- package/dist/utils/themes.js.map +1 -1
- package/package.json +17 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarIcons.js","names":[],"sources":["../../../../../src/components/pro/Flow/panels/toolbarIcons.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * Toolbar icon set for the Flow editor.\n * Compact 20x20 stroke icons that inherit `currentColor`, so they follow the\n * button's variant (primary/ghost) automatically.\n */\n\nconst base = {\n width: 18,\n height: 18,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round' as const,\n strokeLinejoin: 'round' as const,\n};\n\nexport const IconSelect: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M4 3l7 17 2.5-6.5L20 11 4 3z\" />\n </svg>\n);\n\n\nexport const IconAutoFocus: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n <path d=\"M4 12H2M22 12h-2M12 4V2M12 22v-2\" />\n <path d=\"M17.5 5.5l1-1M5.5 17.5l-1 1\" />\n </svg>\n);\n\nexport const IconBack: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M19 12H5\" />\n <path d=\"M11 18l-6-6 6-6\" />\n </svg>\n);\n\nexport const IconUndo: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M9 14L4 9l5-5\" />\n <path d=\"M4 9h11a5 5 0 0 1 0 10h-4\" />\n </svg>\n);\n\nexport const IconRedo: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M15 14l5-5-5-5\" />\n <path d=\"M20 9H9a5 5 0 0 0 0 10h4\" />\n </svg>\n);\n\nexport const IconGroup: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"8\" height=\"8\" rx=\"1\" />\n <rect x=\"13\" y=\"13\" width=\"8\" height=\"8\" rx=\"1\" />\n <path d=\"M13 6h4a1 1 0 0 1 1 1v4\" strokeDasharray=\"2 2\" />\n </svg>\n);\n\nexport const IconGeoGroup: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" strokeDasharray=\"3 3\" />\n <rect x=\"7\" y=\"7\" width=\"4\" height=\"4\" rx=\"0.5\" />\n <rect x=\"13\" y=\"13\" width=\"4\" height=\"4\" rx=\"0.5\" />\n </svg>\n);\n\nexport const IconUngroup: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n <path d=\"M14 5h5M17 3v4\" />\n </svg>\n);\n\nexport type AlignIconKind = 'left' | 'center-h' | 'right' | 'top' | 'center-v' | 'bottom' | 'distribute-h' | 'distribute-v';\n\nexport const IconAlign: React.FC<{ kind: AlignIconKind }> = ({ kind }) => {\n const vertical = kind === 'left' || kind === 'center-h' || kind === 'right';\n if (vertical) {\n const x = kind === 'left' ? 5 : kind === 'right' ? 19 : 12;\n return (\n <svg {...base} aria-hidden=\"true\">\n <path d={`M${x} 3v18`} />\n <rect x={kind === 'left' ? 5 : kind === 'right' ? 10 : 7} y=\"5\" width=\"9\" height=\"4\" rx=\"0.5\" />\n <rect x={kind === 'left' ? 5 : kind === 'right' ? 5 : 4} y=\"14\" width=\"14\" height=\"4\" rx=\"0.5\" />\n </svg>\n );\n }\n if (kind === 'top' || kind === 'center-v' || kind === 'bottom') {\n const y = kind === 'top' ? 5 : kind === 'bottom' ? 19 : 12;\n return (\n <svg {...base} aria-hidden=\"true\">\n <path d={`M3 ${y}h18`} />\n <rect x=\"5\" y={kind === 'top' ? 5 : kind === 'bottom' ? 10 : 7} width=\"4\" height=\"9\" rx=\"0.5\" />\n <rect x=\"14\" y={kind === 'top' ? 5 : kind === 'bottom' ? 5 : 4} width=\"4\" height=\"14\" rx=\"0.5\" />\n </svg>\n );\n }\n return (\n <svg {...base} aria-hidden=\"true\">\n {kind === 'distribute-h' ? (\n <><path d=\"M3 3v18M21 3v18\" /><rect x=\"6\" y=\"7\" width=\"4\" height=\"10\" /><rect x=\"14\" y=\"7\" width=\"4\" height=\"10\" /></>\n ) : (\n <><path d=\"M3 3h18M3 21h18\" /><rect x=\"7\" y=\"6\" width=\"10\" height=\"4\" /><rect x=\"7\" y=\"14\" width=\"10\" height=\"4\" /></>\n )}\n </svg>\n );\n};\n\nexport const IconZoomOut: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"M21 21l-4.3-4.3M8 11h6\" />\n </svg>\n);\n\nexport const IconZoomIn: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"M21 21l-4.3-4.3M11 8v6M8 11h6\" />\n </svg>\n);\n\nexport const IconFitView: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4\" />\n <rect x=\"9\" y=\"9\" width=\"6\" height=\"6\" rx=\"1\" />\n </svg>\n);\n\nexport const IconShapes: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"13\" width=\"8\" height=\"8\" rx=\"1\" />\n <circle cx=\"17\" cy=\"7\" r=\"4\" />\n <path d=\"M13 21l4-7 4 7z\" />\n </svg>\n);\n\nexport const IconInspector: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n <path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z\" />\n </svg>\n);\n\nexport const IconOutline: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01\" />\n </svg>\n);\n\nexport const IconJson: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M8 4H7a2 2 0 0 0-2 2v3a2 2 0 0 1-2 2 2 2 0 0 1 2 2v3a2 2 0 0 0 2 2h1\" />\n <path d=\"M16 4h1a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2 2 2 0 0 0-2 2v3a2 2 0 0 1-2 2h-1\" />\n </svg>\n);\n\nexport const IconGrid: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <path d=\"M9 3v18M15 3v18M3 9h18M3 15h18\" />\n </svg>\n);\n\nexport const IconMiniMap: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <rect x=\"13\" y=\"12\" width=\"6\" height=\"6\" rx=\"1\" />\n </svg>\n);\n\nexport const IconImport: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M12 3v12\" />\n <path d=\"M8 11l4 4 4-4\" />\n <path d=\"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </svg>\n);\n\nexport const IconExport: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M12 15V3\" />\n <path d=\"M8 7l4-4 4 4\" />\n <path d=\"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </svg>\n);\n\nexport const IconPublish: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M22 2 11 13\" />\n <path d=\"M22 2 15 22l-4-9-9-4 20-7z\" />\n </svg>\n);\n\nexport const IconExportImage: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"1.5\" />\n <path d=\"M4 17l5-5 3 3 2-2 6 6\" />\n <path d=\"M16 3v7m-3-3 3 3 3-3\" />\n </svg>\n);\n\nexport const IconAnchorVisible: React.FC<{ visible?: boolean }> = ({ visible = true }) => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"2\" strokeDasharray=\"3 2\" />\n <circle cx=\"4\" cy=\"5\" r=\"2\" fill=\"currentColor\" stroke=\"none\" />\n {visible ? (\n <path d=\"M2 12s3.5-5 10-5 10 5 10 5-3.5 5-10 5S2 12 2 12zM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4z\" />\n ) : (\n <path d=\"M3 3l18 18\" />\n )}\n </svg>\n);\n\nexport const IconPresent: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"13\" rx=\"2\" />\n <path d=\"M10 8.5l4.5 2.5L10 13.5z\" fill=\"currentColor\" stroke=\"none\" />\n <path d=\"M12 17v3M8 20h8\" />\n </svg>\n);\n"],"mappings":";;AAQA,IAAM,IAAO;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,gBAAgB;AAClB,GASa,IAAA,MACX,gBAAA,EAAC,OAAD;AAAA,EAAK,GAAI;AAAA,EAAM,eAAY;AAAA,YAA3B;AAAA,IACE,gBAAA,EAAC,UAAD;AAAA,MAAQ,IAAG;AAAA,MAAK,IAAG;AAAA,MAAK,GAAE;AAAA,IAAK,CAAA;AAAA,IAC/B,gBAAA,EAAC,UAAD;AAAA,MAAQ,IAAG;AAAA,MAAK,IAAG;AAAA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AA,IACtE,gBAAA,EAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;AAAA,EACxB"}
|
|
1
|
+
{"version":3,"file":"toolbarIcons.js","names":[],"sources":["../../../../../src/components/pro/Flow/panels/toolbarIcons.tsx"],"sourcesContent":["import React from 'react';\n\n/**\n * Toolbar icon set for the Flow editor.\n * Compact 20x20 stroke icons that inherit `currentColor`, so they follow the\n * button's variant (primary/ghost) automatically.\n */\n\nconst base = {\n width: 18,\n height: 18,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round' as const,\n strokeLinejoin: 'round' as const,\n};\n\nexport const IconSelect: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M4 3l7 17 2.5-6.5L20 11 4 3z\" />\n </svg>\n);\n\n\nexport const IconAutoFocus: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n <path d=\"M4 12H2M22 12h-2M12 4V2M12 22v-2\" />\n <path d=\"M17.5 5.5l1-1M5.5 17.5l-1 1\" />\n </svg>\n);\n\nexport const IconBack: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M19 12H5\" />\n <path d=\"M11 18l-6-6 6-6\" />\n </svg>\n);\n\nexport const IconUndo: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M9 14L4 9l5-5\" />\n <path d=\"M4 9h11a5 5 0 0 1 0 10h-4\" />\n </svg>\n);\n\nexport const IconRedo: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M15 14l5-5-5-5\" />\n <path d=\"M20 9H9a5 5 0 0 0 0 10h4\" />\n </svg>\n);\n\nexport const IconGroup: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"8\" height=\"8\" rx=\"1\" />\n <rect x=\"13\" y=\"13\" width=\"8\" height=\"8\" rx=\"1\" />\n <path d=\"M13 6h4a1 1 0 0 1 1 1v4\" strokeDasharray=\"2 2\" />\n </svg>\n);\n\nexport const IconGeoGroup: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" strokeDasharray=\"3 3\" />\n <rect x=\"7\" y=\"7\" width=\"4\" height=\"4\" rx=\"0.5\" />\n <rect x=\"13\" y=\"13\" width=\"4\" height=\"4\" rx=\"0.5\" />\n </svg>\n);\n\nexport const IconUngroup: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\" />\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n <path d=\"M14 5h5M17 3v4\" />\n </svg>\n);\n\nexport type AlignIconKind = 'left' | 'center-h' | 'right' | 'top' | 'center-v' | 'bottom' | 'distribute-h' | 'distribute-v';\n\nexport const IconAlign: React.FC<{ kind: AlignIconKind }> = ({ kind }) => {\n const vertical = kind === 'left' || kind === 'center-h' || kind === 'right';\n if (vertical) {\n const x = kind === 'left' ? 5 : kind === 'right' ? 19 : 12;\n return (\n <svg {...base} aria-hidden=\"true\">\n <path d={`M${x} 3v18`} />\n <rect x={kind === 'left' ? 5 : kind === 'right' ? 10 : 7} y=\"5\" width=\"9\" height=\"4\" rx=\"0.5\" />\n <rect x={kind === 'left' ? 5 : kind === 'right' ? 5 : 4} y=\"14\" width=\"14\" height=\"4\" rx=\"0.5\" />\n </svg>\n );\n }\n if (kind === 'top' || kind === 'center-v' || kind === 'bottom') {\n const y = kind === 'top' ? 5 : kind === 'bottom' ? 19 : 12;\n return (\n <svg {...base} aria-hidden=\"true\">\n <path d={`M3 ${y}h18`} />\n <rect x=\"5\" y={kind === 'top' ? 5 : kind === 'bottom' ? 10 : 7} width=\"4\" height=\"9\" rx=\"0.5\" />\n <rect x=\"14\" y={kind === 'top' ? 5 : kind === 'bottom' ? 5 : 4} width=\"4\" height=\"14\" rx=\"0.5\" />\n </svg>\n );\n }\n return (\n <svg {...base} aria-hidden=\"true\">\n {kind === 'distribute-h' ? (\n <><path d=\"M3 3v18M21 3v18\" /><rect x=\"6\" y=\"7\" width=\"4\" height=\"10\" /><rect x=\"14\" y=\"7\" width=\"4\" height=\"10\" /></>\n ) : (\n <><path d=\"M3 3h18M3 21h18\" /><rect x=\"7\" y=\"6\" width=\"10\" height=\"4\" /><rect x=\"7\" y=\"14\" width=\"10\" height=\"4\" /></>\n )}\n </svg>\n );\n};\n\nexport const IconZoomOut: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"M21 21l-4.3-4.3M8 11h6\" />\n </svg>\n);\n\nexport const IconZoomIn: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"M21 21l-4.3-4.3M11 8v6M8 11h6\" />\n </svg>\n);\n\nexport const IconFitView: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4\" />\n <rect x=\"9\" y=\"9\" width=\"6\" height=\"6\" rx=\"1\" />\n </svg>\n);\n\nexport const IconShapes: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"13\" width=\"8\" height=\"8\" rx=\"1\" />\n <circle cx=\"17\" cy=\"7\" r=\"4\" />\n <path d=\"M13 21l4-7 4 7z\" />\n </svg>\n);\n\nexport const IconInspector: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n <path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z\" />\n </svg>\n);\n\nexport const IconOutline: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01\" />\n </svg>\n);\n\nexport const IconJson: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M8 4H7a2 2 0 0 0-2 2v3a2 2 0 0 1-2 2 2 2 0 0 1 2 2v3a2 2 0 0 0 2 2h1\" />\n <path d=\"M16 4h1a2 2 0 0 1 2 2v3a2 2 0 0 0 2 2 2 2 0 0 0-2 2v3a2 2 0 0 1-2 2h-1\" />\n </svg>\n);\n\nexport const IconAI: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M12 3l1.9 4.6L18.5 9.5 13.9 11.4 12 16l-1.9-4.6L5.5 9.5l4.6-1.9L12 3z\" />\n <path d=\"M18 15l.9 2.1L21 18l-2.1.9L18 21l-.9-2.1L15 18l2.1-.9L18 15z\" />\n </svg>\n);\n\nexport const IconGrid: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <path d=\"M9 3v18M15 3v18M3 9h18M3 15h18\" />\n </svg>\n);\n\nexport const IconMiniMap: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <rect x=\"13\" y=\"12\" width=\"6\" height=\"6\" rx=\"1\" />\n </svg>\n);\n\nexport const IconImport: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z\" />\n <path d=\"M14 3v5h5\" />\n <path d=\"M12 18v-6\" />\n <path d=\"M9.5 14.5 12 12l2.5 2.5\" />\n </svg>\n);\n\nexport const IconExport: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M12 15V3\" />\n <path d=\"M8 7l4-4 4 4\" />\n <path d=\"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\" />\n </svg>\n);\n\nexport const IconPublish: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M22 2 11 13\" />\n <path d=\"M22 2 15 22l-4-9-9-4 20-7z\" />\n </svg>\n);\n\nexport const IconExportImage: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"1.5\" />\n <path d=\"M4 17l5-5 3 3 2-2 6 6\" />\n <path d=\"M16 3v7m-3-3 3 3 3-3\" />\n </svg>\n);\n\n/** Export PNG: an image frame with a download arrow into a tray. */\nexport const IconExportPng: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"12\" height=\"10\" rx=\"1.5\" />\n <circle cx=\"6.5\" cy=\"6.5\" r=\"1\" />\n <path d=\"M3 11l3.5-3 3 2.5\" />\n <path d=\"M19 12v6M16.5 15.5 19 18l2.5-2.5\" />\n <path d=\"M14 21h10\" opacity=\"0.5\" />\n </svg>\n);\n\n/** Export PDF: a document marked \"PDF\" with a download arrow. */\nexport const IconExportPdf: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M13 3H7a2 2 0 0 0-2 2v6\" />\n <path d=\"M13 3l5 5v3\" />\n <path d=\"M4.5 14h1.6a1.4 1.4 0 0 1 0 2.8H4.5V14v5\" />\n <path d=\"M17 14v6M14.5 17.5 17 20l2.5-2.5\" />\n <path d=\"M10 14v5h1a1.4 1.4 0 0 0 1.4-1.4v-2.2A1.4 1.4 0 0 0 11 14z\" />\n </svg>\n);\n\nexport const IconExportMarkdown: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M6 15V9l3 3 3-3v6\" />\n <path d=\"M17 9v4m0 0 2-2m-2 2-2-2\" />\n </svg>\n);\n\n/** Export JSON: braces with a download arrow into a tray. */\nexport const IconExportJson: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M9 4c-1.5 0-2 .6-2 2s.4 2-1 2c1.4 0 1 1 1 2s.5 2 2 2\" />\n <path d=\"M15 4c1.5 0 2 .6 2 2s-.4 2 1 2c-1.4 0-1 1-1 2s-.5 2-2 2\" />\n <path d=\"M12 13v6M9 16l3 3 3-3\" />\n <path d=\"M4 20h16\" opacity=\"0.5\" />\n </svg>\n);\n\n/** Layer / z-order controls: to-front, forward, backward, to-back. */\nexport type LayerIconKind = 'front' | 'up' | 'down' | 'back';\n\nexport const IconLayer: React.FC<{ kind: LayerIconKind }> = ({ kind }) => {\n // Metaphor: a stack of layers with the *moving* layer drawn solid and an\n // arrow showing the z-order direction. Front/back push all the way; up/down\n // shift by one. Each variant is visually distinct.\n switch (kind) {\n case 'front':\n // Solid square on top of two outlined layers + up arrow.\n return (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"1.5\" fill=\"currentColor\" stroke=\"none\" />\n <path d=\"M4 15.5l3 1.7M20 15.5l-3 1.7\" opacity=\"0.5\" />\n <path d=\"M4 18.5l8 4.5 8-4.5\" opacity=\"0.5\" />\n <path d=\"M12 5V1M9.5 3 12 .8 14.5 3\" transform=\"translate(0 1)\" />\n </svg>\n );\n case 'up':\n // Solid layer with a single up arrow.\n return (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"3\" y=\"12\" width=\"11\" height=\"8\" rx=\"1.5\" fill=\"currentColor\" stroke=\"none\" opacity=\"0.4\" />\n <rect x=\"9\" y=\"8\" width=\"11\" height=\"8\" rx=\"1.5\" fill=\"currentColor\" stroke=\"none\" />\n <path d=\"M14.5 5.5V1M12 3l2.5-2.5L17 3\" />\n </svg>\n );\n case 'down':\n // Solid layer with a single down arrow.\n return (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"9\" y=\"8\" width=\"11\" height=\"8\" rx=\"1.5\" fill=\"currentColor\" stroke=\"none\" opacity=\"0.4\" />\n <rect x=\"3\" y=\"12\" width=\"11\" height=\"8\" rx=\"1.5\" fill=\"currentColor\" stroke=\"none\" />\n <path d=\"M14.5 18.5V23M12 20.5l2.5 2.5 2.5-2.5\" />\n </svg>\n );\n case 'back':\n default:\n // Outlined top layers over a solid bottom layer + down arrow.\n return (\n <svg {...base} aria-hidden=\"true\">\n <path d=\"M4 8.5l8-4.5 8 4.5\" opacity=\"0.5\" />\n <path d=\"M4 8.5l3 1.7M20 8.5l-3 1.7\" opacity=\"0.5\" />\n <rect x=\"7\" y=\"9\" width=\"10\" height=\"10\" rx=\"1.5\" fill=\"currentColor\" stroke=\"none\" />\n <path d=\"M12 21v4M9.5 23 12 25.2 14.5 23\" transform=\"translate(0 -1)\" />\n </svg>\n );\n }\n};\n\nexport const IconAnchorVisible: React.FC<{ visible?: boolean }> = ({ visible = true }) => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"2\" strokeDasharray=\"3 2\" />\n <circle cx=\"4\" cy=\"5\" r=\"2\" fill=\"currentColor\" stroke=\"none\" />\n {visible ? (\n <path d=\"M2 12s3.5-5 10-5 10 5 10 5-3.5 5-10 5S2 12 2 12zM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4z\" />\n ) : (\n <path d=\"M3 3l18 18\" />\n )}\n </svg>\n);\n\nexport const IconPresent: React.FC = () => (\n <svg {...base} aria-hidden=\"true\">\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"13\" rx=\"2\" />\n <path d=\"M10 8.5l4.5 2.5L10 13.5z\" fill=\"currentColor\" stroke=\"none\" />\n <path d=\"M12 17v3M8 20h8\" />\n </svg>\n);\n"],"mappings":";;AAQA,IAAM,IAAO;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,gBAAgB;AAClB,GASa,IAAA,MACX,gBAAA,EAAC,OAAD;AAAA,EAAK,GAAI;AAAA,EAAM,eAAY;AAAA,YAA3B;AAAA,IACE,gBAAA,EAAC,UAAD;AAAA,MAAQ,IAAG;AAAA,MAAK,IAAG;AAAA,MAAK,GAAE;AAAA,IAAK,CAAA;AAAA,IAC/B,gBAAA,EAAC,UAAD;AAAA,MAAQ,IAAG;AAAA,MAAK,IAAG;AAAA,MAAK,GAAE;AAAA,IAAK,CAAA;AAAA,IAC/B,gBAAA,EAAC,QAAD,EAAM,GAAE,mCAAoC,CAAA;AAAA,IAC5C,gBAAA,EAAC,QAAD,EAAM,GAAE,8BAA+B,CAAA;AAAA,EACpC;IAGM,IAAA,MACX,gBAAA,EAAC,OAAD;AAAA,EAAK,GAAI;AAAA,EAAM,eAAY;AAAA,YAA3B,CACE,gBAAA,EAAC,QAAD,EAAM,GAAE,WAAY,CAAA,GACpB,gBAAA,EAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA,CACxB;I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AAA,IACvE,gBAAA,EAAC,UAAD;AAAA,MAAQ,IAAG;AAAA,MAAI,IAAG;AAAA,MAAI,GAAE;AAAA,MAAI,MAAK;AAAA,MAAe,QAAO;AAAA,IAAQ,CAAA;AAAA,IAC9D,IACC,gBAAA,EAAC,QAAD,EAAM,GAAE,sFAAuF,CAAA,IAE/F,gBAAA,EAAC,QAAD,EAAM,GAAE,aAAc,CAAA;AAAA,EAErB;IAGM,IAAA,MACX,gBAAA,EAAC,OAAD;AAAA,EAAK,GAAI;AAAA,EAAM,eAAY;AAAA,YAA3B;AAAA,IACE,gBAAA,EAAC,QAAD;AAAA,MAAM,GAAE;AAAA,MAAI,GAAE;AAAA,MAAI,OAAM;AAAA,MAAK,QAAO;AAAA,MAAK,IAAG;AAAA,IAAK,CAAA;AAAA,IACjD,gBAAA,EAAC,QAAD;AAAA,MAAM,GAAE;AAAA,MAA2B,MAAK;AAAA,MAAe,QAAO;AAAA,IAAQ,CAAA;AAAA,IACtE,gBAAA,EAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;AAAA,EACxB"}
|
|
@@ -3,8 +3,67 @@ export type FlowEdgeMarkerKind = 'none' | 'arrow' | 'arrowclosed';
|
|
|
3
3
|
/** Label placement for SVG icon stamps. */
|
|
4
4
|
export type FlowIconLabelPlacement = 'top' | 'middle' | 'bottom' | 'left' | 'right';
|
|
5
5
|
/** Media stamp kinds rendered via DOM overlay. */
|
|
6
|
-
export type FlowMediaKind = 'markdown' | 'html' | 'mermaid' | 'math' | 'image' | 'model3d' | 'ai';
|
|
6
|
+
export type FlowMediaKind = 'markdown' | 'html' | 'mermaid' | 'math' | 'image' | 'model3d' | 'ai' | 'data';
|
|
7
7
|
export type FlowModelFormat = 'stl' | 'obj' | '3mf';
|
|
8
|
+
/** Logical type of a Data-node column, driving parsing/aggregation/axis scales. */
|
|
9
|
+
export type FlowDataColumnType = 'string' | 'number' | 'date' | 'boolean';
|
|
10
|
+
/** A single column definition for a Data node. */
|
|
11
|
+
export interface FlowDataColumn {
|
|
12
|
+
/** Object key used in each row record. */
|
|
13
|
+
key: string;
|
|
14
|
+
/** Display label; falls back to `key` when unset. */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Value type; numeric columns can be aggregated and used as chart measures. */
|
|
17
|
+
type: FlowDataColumnType;
|
|
18
|
+
}
|
|
19
|
+
/** Which surface the Data node renders: a (pivotable) table or a chart. */
|
|
20
|
+
export type FlowDataView = 'table' | 'chart';
|
|
21
|
+
/** Supported chart renderings for a Data node. */
|
|
22
|
+
export type FlowDataChartType = 'bar' | 'barHorizontal' | 'line' | 'area' | 'scatter' | 'pie';
|
|
23
|
+
/** Chart-view configuration for a Data node. */
|
|
24
|
+
export interface FlowDataChartConfig {
|
|
25
|
+
type: FlowDataChartType;
|
|
26
|
+
/** Category / X axis field (dimension). */
|
|
27
|
+
xField?: string;
|
|
28
|
+
/** One or more numeric measure fields drawn as series. */
|
|
29
|
+
yFields?: string[];
|
|
30
|
+
/** Per-series color overrides, keyed by measure field key (cartesian charts). */
|
|
31
|
+
seriesColors?: Record<string, string>;
|
|
32
|
+
/** Slice color palette for pie charts. Defaults to the built-in palette. */
|
|
33
|
+
palette?: string[];
|
|
34
|
+
}
|
|
35
|
+
/** Aggregation used by the pivot table view. */
|
|
36
|
+
export type FlowDataAggFn = 'sum' | 'avg' | 'count' | 'min' | 'max';
|
|
37
|
+
/** Pivot configuration panel placement. */
|
|
38
|
+
export type FlowDataPivotPanelPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
39
|
+
/** Pivot-view configuration for a Data node table. */
|
|
40
|
+
export interface FlowDataPivotConfig {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
rowFields: string[];
|
|
43
|
+
colFields: string[];
|
|
44
|
+
values: Array<{
|
|
45
|
+
field: string;
|
|
46
|
+
aggFn: FlowDataAggFn;
|
|
47
|
+
}>;
|
|
48
|
+
/** Where the pivot config panel renders. Defaults to 'top'. */
|
|
49
|
+
panelPlacement?: FlowDataPivotPanelPlacement;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Persisted state for a Data node (`mediaKind: 'data'`). Holds the parsed
|
|
53
|
+
* columns/rows plus how they should be visualized. Serialized with the document.
|
|
54
|
+
*/
|
|
55
|
+
export interface FlowDataConfig {
|
|
56
|
+
columns: FlowDataColumn[];
|
|
57
|
+
rows: Array<Record<string, unknown>>;
|
|
58
|
+
/** Active rendering surface. Defaults to 'table'. */
|
|
59
|
+
view: FlowDataView;
|
|
60
|
+
/** Chart configuration (used when `view === 'chart'`). */
|
|
61
|
+
chart?: FlowDataChartConfig;
|
|
62
|
+
/** Pivot configuration (used when `view === 'table'`). */
|
|
63
|
+
pivot?: FlowDataPivotConfig;
|
|
64
|
+
/** Original uploaded file name, when imported. */
|
|
65
|
+
sourceName?: string;
|
|
66
|
+
}
|
|
8
67
|
/** AI media node configuration (persisted subset). */
|
|
9
68
|
export interface FlowAIConfig {
|
|
10
69
|
/** API endpoint (OpenAI-compatible chat completions or Anthropic messages). */
|
|
@@ -124,6 +183,8 @@ export interface FlowNodeData {
|
|
|
124
183
|
modelFormat?: FlowModelFormat;
|
|
125
184
|
/** AI media node configuration (serializable subset; secrets are runtime-only). */
|
|
126
185
|
aiConfig?: FlowAIConfig;
|
|
186
|
+
/** Data node configuration (for type 'mediaNode' with mediaKind 'data'). */
|
|
187
|
+
dataConfig?: FlowDataConfig;
|
|
127
188
|
/**
|
|
128
189
|
* Stable creation index for `animAnchor` nodes, used to order slides. The
|
|
129
190
|
* displayed sequence badge is derived from this ordering, so deleting an
|
|
@@ -189,6 +250,8 @@ export interface FlowCanvasData {
|
|
|
189
250
|
export interface FlowDocument {
|
|
190
251
|
canvases: Record<string, FlowCanvasData>;
|
|
191
252
|
stack: string[];
|
|
253
|
+
/** Project title, shown in the editable title bar and used as export filename. */
|
|
254
|
+
title?: string;
|
|
192
255
|
}
|
|
193
256
|
/** Active tool modes */
|
|
194
257
|
export type FlowToolMode = 'select' | 'pan' | 'connect' | 'freehand' | 'line' | 'polyline' | 'arrow';
|
|
@@ -230,4 +293,17 @@ export interface FlowProps {
|
|
|
230
293
|
gridSize?: number;
|
|
231
294
|
/** CSS class for outer container */
|
|
232
295
|
className?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Show the AI assistant panel (right side) that turns a text description or
|
|
298
|
+
* an uploaded image into a flow document. Defaults to true.
|
|
299
|
+
*/
|
|
300
|
+
showAI?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Show the AI model configuration form inside the AI panel (gateway /
|
|
303
|
+
* protocol / model / api key). When false, the config is hidden and the
|
|
304
|
+
* caller is expected to supply `aiConfig`. Defaults to true.
|
|
305
|
+
*/
|
|
306
|
+
showAIConfig?: boolean;
|
|
307
|
+
/** Initial / preset AI model configuration for the AI panel. */
|
|
308
|
+
aiConfig?: FlowAIConfig;
|
|
233
309
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/pro/Flow/types.ts"],"sourcesContent":["/** Arrow marker type for edges and lines */\nexport type FlowEdgeMarkerKind = 'none' | 'arrow' | 'arrowclosed';\n\n/** Label placement for SVG icon stamps. */\nexport type FlowIconLabelPlacement = 'top' | 'middle' | 'bottom' | 'left' | 'right';\n\n/** Media stamp kinds rendered via DOM overlay. */\nexport type FlowMediaKind = 'markdown' | 'html' | 'mermaid' | 'math' | 'image' | 'model3d' | 'ai';\n\nexport type FlowModelFormat = 'stl' | 'obj' | '3mf';\n\n/** AI media node configuration (persisted subset). */\nexport interface FlowAIConfig {\n /** API endpoint (OpenAI-compatible chat completions or Anthropic messages). */\n gateway: string;\n protocol: 'openai' | 'anthropic';\n model: string;\n /** API key. Persisted in the document; treat exported JSON as sensitive. */\n apiKey?: string;\n systemPrompt?: string;\n /** Extra request headers. */\n headers?: Record<string, string>;\n}\n\n/** Line style */\nexport type FlowEdgeLineStyle = 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Dash density for dashed/dotted lines */\nexport type FlowEdgeDashDensity = 'sparse' | 'medium' | 'dense';\n\n/** Bezier control points for simplebezier edge segments (canvas coordinates) */\nexport interface FlowBezierControl {\n c1x: number;\n c1y: number;\n c2x: number;\n c2y: number;\n}\n\n/** Persisted edge styling on edge.data */\nexport interface FlowEdgeData {\n strokeColor?: string;\n strokeWidth?: number;\n lineStyle?: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n labelText?: string;\n labelFontSize?: number;\n labelFontFamily?: string;\n /** Play a source-to-target traveling gradient while in presentation mode. */\n animated?: boolean;\n /** Waypoints; absolute canvas coords unless waypointGroupId set */\n waypoints?: Array<{ x: number; y: number }>;\n waypointGroupId?: string;\n /**\n * Per-segment bezier controls for simplebezier type;\n * null entries use default computed controls.\n */\n bezierControls?: Array<FlowBezierControl | null> | null;\n}\n\n/** Edge type names */\nexport type FlowEdgeTypeName =\n | 'smoothstep'\n | 'step'\n | 'straight'\n | 'simplebezier';\n\n/** Border line style */\nexport type FlowBorderStyle = 'none' | 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Gradient direction */\nexport type GradientDirection =\n | 'to-r'\n | 'to-l'\n | 'to-b'\n | 'to-t'\n | 'to-br'\n | 'to-tl'\n | 'to-tr'\n | 'to-bl';\n\n/** Group label placement */\nexport type FlowGroupLabelPlacement = 'top' | 'bottom' | 'left' | 'right';\nexport type FlowGroupLabelAlign = 'start' | 'center' | 'end';\n\nexport const FLOW_NODE_TYPES = [\n 'shapeRect',\n 'shapeRoundRect',\n 'shapeEllipse',\n 'shapeDiamond',\n 'shapeDocument',\n 'shapeParallelogram',\n 'shapeTriangle',\n 'shapeTrapezoid',\n 'shapePentagon',\n 'shapeHexagon',\n 'shapeStar',\n 'shapeHexagram',\n 'shapeRightTriangle',\n 'shapeCorner',\n 'textLabel',\n 'flowGroup',\n 'geometryGroup',\n 'dividerNode',\n 'arrowNode',\n 'polylineNode',\n 'shapeSvg',\n 'mediaNode',\n 'animAnchor',\n] as const;\n\nexport type FlowShapeType = (typeof FLOW_NODE_TYPES)[number];\n\n/** Custom key-value attribute on a node */\nexport interface FlowNodeAttribute {\n key: string;\n value: string;\n}\n\n/** Data stored on each flow node */\nexport interface FlowNodeData {\n label: string;\n fill: string;\n stroke: string;\n strokeWidth: number;\n color: string;\n fontSize: number;\n /**\n * Label/font color. When unset, falls back to `color` (legacy behavior where\n * a single color drove both the label and the SVG icon tint).\n */\n labelColor?: string;\n borderStyle?: FlowBorderStyle;\n rotation?: number;\n flipX?: boolean;\n flipY?: boolean;\n fillGradientTo?: string;\n fillGradientDirection?: GradientDirection;\n attributes?: FlowNodeAttribute[];\n childCanvasId?: string;\n isGroup?: boolean;\n groupBorderStyle?: FlowBorderStyle;\n groupLabelPlacement?: FlowGroupLabelPlacement;\n groupLabelAlign?: FlowGroupLabelAlign;\n groupLabelFill?: string;\n groupLabelRotation?: 0 | 90 | 180 | 270;\n groupLabelBgMode?: 'text' | 'full';\n dividerOrientation?: 'horizontal' | 'vertical';\n arrowDouble?: boolean;\n arrowBent?: boolean;\n arrowBendX?: number;\n arrowBendY?: number;\n polylineWaypoints?: Array<{ x: number; y: number }>;\n /** SVG stamp icon id (for type 'shapeSvg'). */\n svgId?: string;\n /** Whether the SVG stamp draws a bordered box around the icon. */\n iconBox?: boolean;\n /** Label placement for SVG stamps. Left/right use top-to-bottom vertical text. */\n labelPlacement?: FlowIconLabelPlacement;\n /** Horizontal offset from the resolved icon label position, in canvas units. */\n labelOffsetX?: number;\n /** Vertical offset from the resolved icon label position, in canvas units. */\n labelOffsetY?: number;\n /** Media node kind (for type 'mediaNode'). */\n mediaKind?: FlowMediaKind;\n /** Source content or URL for the media node. */\n mediaContent?: string;\n /** Explicit model format for 3D media nodes. */\n modelFormat?: FlowModelFormat;\n /** AI media node configuration (serializable subset; secrets are runtime-only). */\n aiConfig?: FlowAIConfig;\n /**\n * Stable creation index for `animAnchor` nodes, used to order slides. The\n * displayed sequence badge is derived from this ordering, so deleting an\n * anchor renumbers the rest automatically.\n */\n animIndex?: number;\n /** Marks nodes managed by Mindmap mode. */\n isMindMapNode?: boolean;\n /** Logical parent used by Mindmap auto-layout (separate from visual groups). */\n mindMapParentId?: string;\n}\n\n/** A flow node */\nexport interface FlowNode {\n id: string;\n type: FlowShapeType;\n position: { x: number; y: number };\n width: number;\n height: number;\n data: FlowNodeData;\n parentId?: string;\n zIndex?: number;\n}\n\n/** A flow edge (connection between nodes) */\nexport interface FlowEdge {\n id: string;\n source: string;\n target: string;\n sourceHandle?: string;\n targetHandle?: string;\n type: FlowEdgeTypeName;\n data: FlowEdgeData;\n}\n\n/** Independent line types */\nexport type FlowLineType = 'freehand' | 'straight' | 'polyline' | 'arrow';\n\n/** An independent line not attached to nodes */\nexport interface FlowLine {\n id: string;\n type: FlowLineType;\n points: Array<{ x: number; y: number }>;\n strokeColor: string;\n strokeWidth: number;\n lineStyle: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n closed?: boolean;\n zIndex?: number;\n parentId?: string;\n}\n\n/** Single canvas layer data */\nexport interface FlowCanvasData {\n nodes: FlowNode[];\n edges: FlowEdge[];\n lines: FlowLine[];\n}\n\n/** Multi-canvas document; root canvas id is 'root' */\nexport interface FlowDocument {\n canvases: Record<string, FlowCanvasData>;\n stack: string[];\n}\n\n/** Active tool modes */\nexport type FlowToolMode =\n | 'select'\n | 'pan'\n | 'connect'\n | 'freehand'\n | 'line'\n | 'polyline'\n | 'arrow';\n\n/** Viewport transform state */\nexport interface ViewportState {\n x: number;\n y: number;\n zoom: number;\n}\n\n/** Selection state */\nexport interface SelectionState {\n nodeIds: Set<string>;\n edgeIds: Set<string>;\n lineIds: Set<string>;\n}\n\n/** Props for the Flow component */\nexport interface FlowProps {\n /** Initial document; if not provided, starts with empty doc */\n initialDocument?: FlowDocument;\n /** Callback when document changes */\n onChange?: (doc: FlowDocument) => void;\n /** Width of the component (defaults to 100%) */\n width?: number | string;\n /** Height of the component (defaults to 100%) */\n height?: number | string;\n /** Whether the flow is read-only */\n readOnly?: boolean;\n /** Leave the current document from the built-in toolbar. */\n onBack?: () => void;\n /** Export the current canvas as PNG from the built-in toolbar. */\n onExportPNG?: () => void | Promise<void>;\n /** Publish or configure sharing from the built-in toolbar. */\n onPublish?: () => void;\n /** Show minimap */\n showMiniMap?: boolean;\n /** Show grid */\n showGrid?: boolean;\n /** Grid size in pixels */\n gridSize?: number;\n /** CSS class for outer container */\n className?: string;\n}\n"],"mappings":"AAsFA,IAAa,IAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/pro/Flow/types.ts"],"sourcesContent":["/** Arrow marker type for edges and lines */\nexport type FlowEdgeMarkerKind = 'none' | 'arrow' | 'arrowclosed';\n\n/** Label placement for SVG icon stamps. */\nexport type FlowIconLabelPlacement = 'top' | 'middle' | 'bottom' | 'left' | 'right';\n\n/** Media stamp kinds rendered via DOM overlay. */\nexport type FlowMediaKind = 'markdown' | 'html' | 'mermaid' | 'math' | 'image' | 'model3d' | 'ai' | 'data';\n\nexport type FlowModelFormat = 'stl' | 'obj' | '3mf';\n\n/** Logical type of a Data-node column, driving parsing/aggregation/axis scales. */\nexport type FlowDataColumnType = 'string' | 'number' | 'date' | 'boolean';\n\n/** A single column definition for a Data node. */\nexport interface FlowDataColumn {\n /** Object key used in each row record. */\n key: string;\n /** Display label; falls back to `key` when unset. */\n label?: string;\n /** Value type; numeric columns can be aggregated and used as chart measures. */\n type: FlowDataColumnType;\n}\n\n/** Which surface the Data node renders: a (pivotable) table or a chart. */\nexport type FlowDataView = 'table' | 'chart';\n\n/** Supported chart renderings for a Data node. */\nexport type FlowDataChartType =\n | 'bar'\n | 'barHorizontal'\n | 'line'\n | 'area'\n | 'scatter'\n | 'pie';\n\n/** Chart-view configuration for a Data node. */\nexport interface FlowDataChartConfig {\n type: FlowDataChartType;\n /** Category / X axis field (dimension). */\n xField?: string;\n /** One or more numeric measure fields drawn as series. */\n yFields?: string[];\n /** Per-series color overrides, keyed by measure field key (cartesian charts). */\n seriesColors?: Record<string, string>;\n /** Slice color palette for pie charts. Defaults to the built-in palette. */\n palette?: string[];\n}\n\n/** Aggregation used by the pivot table view. */\nexport type FlowDataAggFn = 'sum' | 'avg' | 'count' | 'min' | 'max';\n\n/** Pivot configuration panel placement. */\nexport type FlowDataPivotPanelPlacement = 'top' | 'bottom' | 'left' | 'right';\n\n/** Pivot-view configuration for a Data node table. */\nexport interface FlowDataPivotConfig {\n enabled: boolean;\n rowFields: string[];\n colFields: string[];\n values: Array<{ field: string; aggFn: FlowDataAggFn }>;\n /** Where the pivot config panel renders. Defaults to 'top'. */\n panelPlacement?: FlowDataPivotPanelPlacement;\n}\n\n/**\n * Persisted state for a Data node (`mediaKind: 'data'`). Holds the parsed\n * columns/rows plus how they should be visualized. Serialized with the document.\n */\nexport interface FlowDataConfig {\n columns: FlowDataColumn[];\n rows: Array<Record<string, unknown>>;\n /** Active rendering surface. Defaults to 'table'. */\n view: FlowDataView;\n /** Chart configuration (used when `view === 'chart'`). */\n chart?: FlowDataChartConfig;\n /** Pivot configuration (used when `view === 'table'`). */\n pivot?: FlowDataPivotConfig;\n /** Original uploaded file name, when imported. */\n sourceName?: string;\n}\n\n/** AI media node configuration (persisted subset). */\nexport interface FlowAIConfig {\n /** API endpoint (OpenAI-compatible chat completions or Anthropic messages). */\n gateway: string;\n protocol: 'openai' | 'anthropic';\n model: string;\n /** API key. Persisted in the document; treat exported JSON as sensitive. */\n apiKey?: string;\n systemPrompt?: string;\n /** Extra request headers. */\n headers?: Record<string, string>;\n}\n\n/** Line style */\nexport type FlowEdgeLineStyle = 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Dash density for dashed/dotted lines */\nexport type FlowEdgeDashDensity = 'sparse' | 'medium' | 'dense';\n\n/** Bezier control points for simplebezier edge segments (canvas coordinates) */\nexport interface FlowBezierControl {\n c1x: number;\n c1y: number;\n c2x: number;\n c2y: number;\n}\n\n/** Persisted edge styling on edge.data */\nexport interface FlowEdgeData {\n strokeColor?: string;\n strokeWidth?: number;\n lineStyle?: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n labelText?: string;\n labelFontSize?: number;\n labelFontFamily?: string;\n /** Play a source-to-target traveling gradient while in presentation mode. */\n animated?: boolean;\n /** Waypoints; absolute canvas coords unless waypointGroupId set */\n waypoints?: Array<{ x: number; y: number }>;\n waypointGroupId?: string;\n /**\n * Per-segment bezier controls for simplebezier type;\n * null entries use default computed controls.\n */\n bezierControls?: Array<FlowBezierControl | null> | null;\n}\n\n/** Edge type names */\nexport type FlowEdgeTypeName =\n | 'smoothstep'\n | 'step'\n | 'straight'\n | 'simplebezier';\n\n/** Border line style */\nexport type FlowBorderStyle = 'none' | 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Gradient direction */\nexport type GradientDirection =\n | 'to-r'\n | 'to-l'\n | 'to-b'\n | 'to-t'\n | 'to-br'\n | 'to-tl'\n | 'to-tr'\n | 'to-bl';\n\n/** Group label placement */\nexport type FlowGroupLabelPlacement = 'top' | 'bottom' | 'left' | 'right';\nexport type FlowGroupLabelAlign = 'start' | 'center' | 'end';\n\nexport const FLOW_NODE_TYPES = [\n 'shapeRect',\n 'shapeRoundRect',\n 'shapeEllipse',\n 'shapeDiamond',\n 'shapeDocument',\n 'shapeParallelogram',\n 'shapeTriangle',\n 'shapeTrapezoid',\n 'shapePentagon',\n 'shapeHexagon',\n 'shapeStar',\n 'shapeHexagram',\n 'shapeRightTriangle',\n 'shapeCorner',\n 'textLabel',\n 'flowGroup',\n 'geometryGroup',\n 'dividerNode',\n 'arrowNode',\n 'polylineNode',\n 'shapeSvg',\n 'mediaNode',\n 'animAnchor',\n] as const;\n\nexport type FlowShapeType = (typeof FLOW_NODE_TYPES)[number];\n\n/** Custom key-value attribute on a node */\nexport interface FlowNodeAttribute {\n key: string;\n value: string;\n}\n\n/** Data stored on each flow node */\nexport interface FlowNodeData {\n label: string;\n fill: string;\n stroke: string;\n strokeWidth: number;\n color: string;\n fontSize: number;\n /**\n * Label/font color. When unset, falls back to `color` (legacy behavior where\n * a single color drove both the label and the SVG icon tint).\n */\n labelColor?: string;\n borderStyle?: FlowBorderStyle;\n rotation?: number;\n flipX?: boolean;\n flipY?: boolean;\n fillGradientTo?: string;\n fillGradientDirection?: GradientDirection;\n attributes?: FlowNodeAttribute[];\n childCanvasId?: string;\n isGroup?: boolean;\n groupBorderStyle?: FlowBorderStyle;\n groupLabelPlacement?: FlowGroupLabelPlacement;\n groupLabelAlign?: FlowGroupLabelAlign;\n groupLabelFill?: string;\n groupLabelRotation?: 0 | 90 | 180 | 270;\n groupLabelBgMode?: 'text' | 'full';\n dividerOrientation?: 'horizontal' | 'vertical';\n arrowDouble?: boolean;\n arrowBent?: boolean;\n arrowBendX?: number;\n arrowBendY?: number;\n polylineWaypoints?: Array<{ x: number; y: number }>;\n /** SVG stamp icon id (for type 'shapeSvg'). */\n svgId?: string;\n /** Whether the SVG stamp draws a bordered box around the icon. */\n iconBox?: boolean;\n /** Label placement for SVG stamps. Left/right use top-to-bottom vertical text. */\n labelPlacement?: FlowIconLabelPlacement;\n /** Horizontal offset from the resolved icon label position, in canvas units. */\n labelOffsetX?: number;\n /** Vertical offset from the resolved icon label position, in canvas units. */\n labelOffsetY?: number;\n /** Media node kind (for type 'mediaNode'). */\n mediaKind?: FlowMediaKind;\n /** Source content or URL for the media node. */\n mediaContent?: string;\n /** Explicit model format for 3D media nodes. */\n modelFormat?: FlowModelFormat;\n /** AI media node configuration (serializable subset; secrets are runtime-only). */\n aiConfig?: FlowAIConfig;\n /** Data node configuration (for type 'mediaNode' with mediaKind 'data'). */\n dataConfig?: FlowDataConfig;\n /**\n * Stable creation index for `animAnchor` nodes, used to order slides. The\n * displayed sequence badge is derived from this ordering, so deleting an\n * anchor renumbers the rest automatically.\n */\n animIndex?: number;\n /** Marks nodes managed by Mindmap mode. */\n isMindMapNode?: boolean;\n /** Logical parent used by Mindmap auto-layout (separate from visual groups). */\n mindMapParentId?: string;\n}\n\n/** A flow node */\nexport interface FlowNode {\n id: string;\n type: FlowShapeType;\n position: { x: number; y: number };\n width: number;\n height: number;\n data: FlowNodeData;\n parentId?: string;\n zIndex?: number;\n}\n\n/** A flow edge (connection between nodes) */\nexport interface FlowEdge {\n id: string;\n source: string;\n target: string;\n sourceHandle?: string;\n targetHandle?: string;\n type: FlowEdgeTypeName;\n data: FlowEdgeData;\n}\n\n/** Independent line types */\nexport type FlowLineType = 'freehand' | 'straight' | 'polyline' | 'arrow';\n\n/** An independent line not attached to nodes */\nexport interface FlowLine {\n id: string;\n type: FlowLineType;\n points: Array<{ x: number; y: number }>;\n strokeColor: string;\n strokeWidth: number;\n lineStyle: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n closed?: boolean;\n zIndex?: number;\n parentId?: string;\n}\n\n/** Single canvas layer data */\nexport interface FlowCanvasData {\n nodes: FlowNode[];\n edges: FlowEdge[];\n lines: FlowLine[];\n}\n\n/** Multi-canvas document; root canvas id is 'root' */\nexport interface FlowDocument {\n canvases: Record<string, FlowCanvasData>;\n stack: string[];\n /** Project title, shown in the editable title bar and used as export filename. */\n title?: string;\n}\n\n/** Active tool modes */\nexport type FlowToolMode =\n | 'select'\n | 'pan'\n | 'connect'\n | 'freehand'\n | 'line'\n | 'polyline'\n | 'arrow';\n\n/** Viewport transform state */\nexport interface ViewportState {\n x: number;\n y: number;\n zoom: number;\n}\n\n/** Selection state */\nexport interface SelectionState {\n nodeIds: Set<string>;\n edgeIds: Set<string>;\n lineIds: Set<string>;\n}\n\n/** Props for the Flow component */\nexport interface FlowProps {\n /** Initial document; if not provided, starts with empty doc */\n initialDocument?: FlowDocument;\n /** Callback when document changes */\n onChange?: (doc: FlowDocument) => void;\n /** Width of the component (defaults to 100%) */\n width?: number | string;\n /** Height of the component (defaults to 100%) */\n height?: number | string;\n /** Whether the flow is read-only */\n readOnly?: boolean;\n /** Leave the current document from the built-in toolbar. */\n onBack?: () => void;\n /** Export the current canvas as PNG from the built-in toolbar. */\n onExportPNG?: () => void | Promise<void>;\n /** Publish or configure sharing from the built-in toolbar. */\n onPublish?: () => void;\n /** Show minimap */\n showMiniMap?: boolean;\n /** Show grid */\n showGrid?: boolean;\n /** Grid size in pixels */\n gridSize?: number;\n /** CSS class for outer container */\n className?: string;\n /**\n * Show the AI assistant panel (right side) that turns a text description or\n * an uploaded image into a flow document. Defaults to true.\n */\n showAI?: boolean;\n /**\n * Show the AI model configuration form inside the AI panel (gateway /\n * protocol / model / api key). When false, the config is hidden and the\n * caller is expected to supply `aiConfig`. Defaults to true.\n */\n showAIConfig?: boolean;\n /** Initial / preset AI model configuration for the AI panel. */\n aiConfig?: FlowAIConfig;\n}\n"],"mappings":"AA6JA,IAAa,IAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface PdfPageImage {
|
|
2
|
+
/** Raw JPEG bytes. */
|
|
3
|
+
jpeg: Uint8Array;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
/** Convert a data URL (data:image/...;base64,....) to raw bytes. */
|
|
8
|
+
export declare function dataUrlToBytes(dataUrl: string): Uint8Array;
|
|
9
|
+
/**
|
|
10
|
+
* Re-encode any image data URL (typically PNG) to a JPEG data URL at the given
|
|
11
|
+
* quality, returning the JPEG bytes and pixel dimensions. JPEG keeps the PDF
|
|
12
|
+
* compact and is natively embeddable via a DCTDecode filter.
|
|
13
|
+
*/
|
|
14
|
+
export declare function pngDataUrlToJpeg(dataUrl: string, quality?: number, background?: string): Promise<PdfPageImage>;
|
|
15
|
+
/**
|
|
16
|
+
* Build a PDF (as a Blob) from a list of JPEG page images. Every page is sized
|
|
17
|
+
* to its image dimensions (in points) so slides render 1:1 with their capture.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildPdfFromJpegs(pages: PdfPageImage[]): Blob;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function y(c) {
|
|
2
|
+
const r = c.indexOf(","), s = c.slice(r + 1), t = atob(s), o = new Uint8Array(t.length);
|
|
3
|
+
for (let n = 0; n < t.length; n++) o[n] = t.charCodeAt(n);
|
|
4
|
+
return o;
|
|
5
|
+
}
|
|
6
|
+
async function x(c, r = 0.92, s = "#ffffff") {
|
|
7
|
+
const t = await R(c), o = document.createElement("canvas");
|
|
8
|
+
o.width = t.naturalWidth || t.width, o.height = t.naturalHeight || t.height;
|
|
9
|
+
const n = o.getContext("2d");
|
|
10
|
+
if (!n) throw new Error("无法创建绘图上下文");
|
|
11
|
+
return n.fillStyle = s, n.fillRect(0, 0, o.width, o.height), n.drawImage(t, 0, 0), {
|
|
12
|
+
jpeg: y(o.toDataURL("image/jpeg", r)),
|
|
13
|
+
width: o.width,
|
|
14
|
+
height: o.height
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function R(c) {
|
|
18
|
+
return new Promise((r, s) => {
|
|
19
|
+
const t = new Image();
|
|
20
|
+
t.onload = () => r(t), t.onerror = () => s(/* @__PURE__ */ new Error("图片加载失败")), t.src = c;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function O(c) {
|
|
24
|
+
const r = new TextEncoder(), s = [];
|
|
25
|
+
let t = 0;
|
|
26
|
+
const o = [], n = (e) => {
|
|
27
|
+
const i = typeof e == "string" ? r.encode(e) : e;
|
|
28
|
+
s.push(i), t += i.length;
|
|
29
|
+
}, b = 2 + c.length * 3, a = (e) => {
|
|
30
|
+
o[e] = t;
|
|
31
|
+
};
|
|
32
|
+
n(`%PDF-1.4
|
|
33
|
+
`), n(new Uint8Array([
|
|
34
|
+
37,
|
|
35
|
+
226,
|
|
36
|
+
227,
|
|
37
|
+
207,
|
|
38
|
+
211,
|
|
39
|
+
10
|
|
40
|
+
])), a(1), n(`1 0 obj
|
|
41
|
+
<< /Type /Catalog /Pages 2 0 R >>
|
|
42
|
+
endobj
|
|
43
|
+
`);
|
|
44
|
+
const u = c.map((e, i) => 3 + i * 3);
|
|
45
|
+
a(2), n(`2 0 obj
|
|
46
|
+
<< /Type /Pages /Count ${c.length} /Kids [${u.map((e) => `${e} 0 R`).join(" ")}] >>
|
|
47
|
+
endobj
|
|
48
|
+
`), c.forEach((e, i) => {
|
|
49
|
+
const h = 3 + i * 3, g = h + 1, l = h + 2, d = e.width, f = e.height;
|
|
50
|
+
a(h), n(`${h} 0 obj
|
|
51
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${d} ${f}] /Resources << /XObject << /Im0 ${g} 0 R >> >> /Contents ${l} 0 R >>
|
|
52
|
+
endobj
|
|
53
|
+
`), a(g), n(`${g} 0 obj
|
|
54
|
+
<< /Type /XObject /Subtype /Image /Width ${d} /Height ${f} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${e.jpeg.length} >>
|
|
55
|
+
stream
|
|
56
|
+
`), n(e.jpeg), n(`
|
|
57
|
+
endstream
|
|
58
|
+
endobj
|
|
59
|
+
`);
|
|
60
|
+
const w = `q
|
|
61
|
+
${d} 0 0 ${f} 0 0 cm
|
|
62
|
+
/Im0 Do
|
|
63
|
+
Q
|
|
64
|
+
`, p = r.encode(w);
|
|
65
|
+
a(l), n(`${l} 0 obj
|
|
66
|
+
<< /Length ${p.length} >>
|
|
67
|
+
stream
|
|
68
|
+
`), n(p), n(`
|
|
69
|
+
endstream
|
|
70
|
+
endobj
|
|
71
|
+
`);
|
|
72
|
+
});
|
|
73
|
+
const $ = t, m = b + 1;
|
|
74
|
+
let j = `xref
|
|
75
|
+
0 ${m}
|
|
76
|
+
0000000000 65535 f
|
|
77
|
+
`;
|
|
78
|
+
for (let e = 1; e <= b; e++) {
|
|
79
|
+
const i = o[e] ?? 0;
|
|
80
|
+
j += `${i.toString().padStart(10, "0")} 00000 n
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
return n(j), n(`trailer
|
|
84
|
+
<< /Size ${m} /Root 1 0 R >>
|
|
85
|
+
startxref
|
|
86
|
+
${$}
|
|
87
|
+
%%EOF`), new Blob(s, { type: "application/pdf" });
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
O as buildPdfFromJpegs,
|
|
91
|
+
y as dataUrlToBytes,
|
|
92
|
+
x as pngDataUrlToJpeg
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=pdfExport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdfExport.js","names":[],"sources":["../../../../../src/components/pro/Flow/utils/pdfExport.ts"],"sourcesContent":["// Minimal client-side PDF writer: assembles a set of JPEG images (one per page)\n// into a single PDF file, with no third-party dependency.\n//\n// Each page is sized to the image's pixel dimensions (interpreted as PDF points)\n// so the exported slides keep their aspect ratio. This is intentionally tiny —\n// it only supports what the anchor→PDF export needs (a sequence of full-page\n// raster images).\n\ninterface PdfPageImage {\n /** Raw JPEG bytes. */\n jpeg: Uint8Array;\n width: number;\n height: number;\n}\n\n/** Convert a data URL (data:image/...;base64,....) to raw bytes. */\nexport function dataUrlToBytes(dataUrl: string): Uint8Array {\n const comma = dataUrl.indexOf(',');\n const base64 = dataUrl.slice(comma + 1);\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n return bytes;\n}\n\n/**\n * Re-encode any image data URL (typically PNG) to a JPEG data URL at the given\n * quality, returning the JPEG bytes and pixel dimensions. JPEG keeps the PDF\n * compact and is natively embeddable via a DCTDecode filter.\n */\nexport async function pngDataUrlToJpeg(\n dataUrl: string,\n quality = 0.92,\n background = '#ffffff',\n): Promise<PdfPageImage> {\n const img = await loadImage(dataUrl);\n const canvas = document.createElement('canvas');\n canvas.width = img.naturalWidth || img.width;\n canvas.height = img.naturalHeight || img.height;\n const ctx = canvas.getContext('2d');\n if (!ctx) throw new Error('无法创建绘图上下文');\n // JPEG has no alpha; paint an opaque background first.\n ctx.fillStyle = background;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(img, 0, 0);\n const jpegUrl = canvas.toDataURL('image/jpeg', quality);\n return { jpeg: dataUrlToBytes(jpegUrl), width: canvas.width, height: canvas.height };\n}\n\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = () => reject(new Error('图片加载失败'));\n img.src = src;\n });\n}\n\n/**\n * Build a PDF (as a Blob) from a list of JPEG page images. Every page is sized\n * to its image dimensions (in points) so slides render 1:1 with their capture.\n */\nexport function buildPdfFromJpegs(pages: PdfPageImage[]): Blob {\n // We assemble the PDF as a list of byte chunks, tracking each object's byte\n // offset for the cross-reference (xref) table required by the format.\n const encoder = new TextEncoder();\n const chunks: Uint8Array[] = [];\n let length = 0;\n const offsets: number[] = [];\n\n const push = (data: Uint8Array | string) => {\n const bytes = typeof data === 'string' ? encoder.encode(data) : data;\n chunks.push(bytes);\n length += bytes.length;\n };\n\n // Object numbering:\n // 1 = Catalog, 2 = Pages, then for each page: Page, Image, Content (3 objs).\n const objCount = 2 + pages.length * 3;\n const markObj = (n: number) => { offsets[n] = length; };\n\n push('%PDF-1.4\\n');\n // Binary comment so tools treat the file as binary.\n push(new Uint8Array([0x25, 0xe2, 0xe3, 0xcf, 0xd3, 0x0a]));\n\n // 1: Catalog\n markObj(1);\n push('1 0 obj\\n<< /Type /Catalog /Pages 2 0 R >>\\nendobj\\n');\n\n // 2: Pages\n const pageObjNums = pages.map((_, i) => 3 + i * 3);\n markObj(2);\n push(\n `2 0 obj\\n<< /Type /Pages /Count ${pages.length} /Kids [${pageObjNums\n .map((n) => `${n} 0 R`)\n .join(' ')}] >>\\nendobj\\n`,\n );\n\n pages.forEach((page, i) => {\n const pageObj = 3 + i * 3;\n const imageObj = pageObj + 1;\n const contentObj = pageObj + 2;\n const w = page.width;\n const h = page.height;\n\n // Page object.\n markObj(pageObj);\n push(\n `${pageObj} 0 obj\\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${w} ${h}] ` +\n `/Resources << /XObject << /Im0 ${imageObj} 0 R >> >> ` +\n `/Contents ${contentObj} 0 R >>\\nendobj\\n`,\n );\n\n // Image XObject (JPEG via DCTDecode).\n markObj(imageObj);\n push(\n `${imageObj} 0 obj\\n<< /Type /XObject /Subtype /Image /Width ${w} /Height ${h} ` +\n `/ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${page.jpeg.length} >>\\nstream\\n`,\n );\n push(page.jpeg);\n push('\\nendstream\\nendobj\\n');\n\n // Content stream: draw the image to fill the page.\n const content = `q\\n${w} 0 0 ${h} 0 0 cm\\n/Im0 Do\\nQ\\n`;\n const contentBytes = encoder.encode(content);\n markObj(contentObj);\n push(`${contentObj} 0 obj\\n<< /Length ${contentBytes.length} >>\\nstream\\n`);\n push(contentBytes);\n push('\\nendstream\\nendobj\\n');\n });\n\n // Cross-reference table.\n const xrefOffset = length;\n const total = objCount + 1; // + free object 0\n let xref = `xref\\n0 ${total}\\n0000000000 65535 f \\n`;\n for (let n = 1; n <= objCount; n++) {\n const off = offsets[n] ?? 0;\n xref += `${off.toString().padStart(10, '0')} 00000 n \\n`;\n }\n push(xref);\n push(\n `trailer\\n<< /Size ${total} /Root 1 0 R >>\\nstartxref\\n${xrefOffset}\\n%%EOF`,\n );\n\n return new Blob(chunks as BlobPart[], { type: 'application/pdf' });\n}\n"],"mappings":"AAgBA,SAAgB,EAAe,GAA6B;AAC1D,QAAM,IAAQ,EAAQ,QAAQ,GAAG,GAC3B,IAAS,EAAQ,MAAM,IAAQ,CAAC,GAChC,IAAS,KAAK,CAAM,GACpB,IAAQ,IAAI,WAAW,EAAO,MAAM;AAC1C,WAAS,IAAI,GAAG,IAAI,EAAO,QAAQ,IAAK,CAAA,EAAM,CAAA,IAAK,EAAO,WAAW,CAAC;AACtE,SAAO;AACT;AAOA,eAAsB,EACpB,GACA,IAAU,MACV,IAAa,WACU;AACvB,QAAM,IAAM,MAAM,EAAU,CAAO,GAC7B,IAAS,SAAS,cAAc,QAAQ;AAC9C,EAAA,EAAO,QAAQ,EAAI,gBAAgB,EAAI,OACvC,EAAO,SAAS,EAAI,iBAAiB,EAAI;AACzC,QAAM,IAAM,EAAO,WAAW,IAAI;AAClC,MAAI,CAAC,EAAK,OAAM,IAAI,MAAM,WAAW;AAErC,SAAA,EAAI,YAAY,GAChB,EAAI,SAAS,GAAG,GAAG,EAAO,OAAO,EAAO,MAAM,GAC9C,EAAI,UAAU,GAAK,GAAG,CAAC,GAEhB;AAAA,IAAE,MAAM,EADC,EAAO,UAAU,cAAc,CACjB,CAAO;AAAA,IAAG,OAAO,EAAO;AAAA,IAAO,QAAQ,EAAO;AAAA,EAAO;AACrF;AAEA,SAAS,EAAU,GAAwC;AACzD,SAAO,IAAI,QAAA,CAAS,GAAS,MAAW;AACtC,UAAM,IAAM,I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AAQ,GAChB,EACE,GAAG,CAAA;AAAA,2CAA4D,CAAA,YAAa,CAAA,0EACD,EAAK,KAAK,MAAA;AAAA;AAAA,CACvF,GACA,EAAK,EAAK,IAAI,GACd,EAAK;AAAA;AAAA;AAAA,CAAuB;AAG5B,UAAM,IAAU;AAAA,EAAM,CAAA,QAAS,CAAA;AAAA;AAAA;AAAA,GACzB,IAAe,EAAQ,OAAO,CAAO;AAC3C,IAAA,EAAQ,CAAU,GAClB,EAAK,GAAG,CAAA;AAAA,aAAgC,EAAa,MAAA;AAAA;AAAA,CAAqB,GAC1E,EAAK,CAAY,GACjB,EAAK;AAAA;AAAA;AAAA,CAAuB;AAAA,EAC9B,CAAC;AAGD,QAAM,IAAa,GACb,IAAQ,IAAW;AACzB,MAAI,IAAO;AAAA,IAAW,CAAA;AAAA;AAAA;AACtB,WAAS,IAAI,GAAG,KAAK,GAAU,KAAK;AAClC,UAAM,IAAM,EAAQ,CAAA,KAAM;AAC1B,IAAA,KAAQ,GAAG,EAAI,SAAS,EAAE,SAAS,IAAI,GAAG,CAAA;AAAA;AAAA,EAC5C;AACA,SAAA,EAAK,CAAI,GACT,EACE;AAAA,WAAqB,CAAA;AAAA;AAAA,EAAoC,CAAA;AAAA,MAC3D,GAEO,IAAI,KAAK,GAAsB,EAAE,MAAM,kBAAkB,CAAC;AACnE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a CSS color value (including theme custom properties like
|
|
3
|
+
* `var(--color-base-100)` that may use `oklch(...)`) into a concrete sRGB color
|
|
4
|
+
* for the WebGL canvas.
|
|
5
|
+
*
|
|
6
|
+
* PixiJS needs a numeric/hex color and cannot read CSS variables. We resolve in
|
|
7
|
+
* two steps:
|
|
8
|
+
* 1. A hidden probe element inherits the themed scope; setting its `color` to
|
|
9
|
+
* the requested value and reading `getComputedStyle().color` resolves the
|
|
10
|
+
* CSS variable. Note modern browsers return this in the value's ORIGINAL
|
|
11
|
+
* color space (e.g. `oklch(...)`), NOT `rgb(...)`.
|
|
12
|
+
* 2. Rasterize that resolved string onto a 1x1 canvas and read the pixel back,
|
|
13
|
+
* which always yields concrete sRGB bytes regardless of the source color
|
|
14
|
+
* space. This is what keeps the Flow canvas in sync with any DishUI theme.
|
|
15
|
+
*/
|
|
16
|
+
/** Resolve a CSS color to a 0xRRGGBB number (for PixiJS). */
|
|
17
|
+
export declare function cssColorToNumber(host: HTMLElement | null, cssValue: string, fallback: number): number;
|
|
18
|
+
/** Resolve a CSS color to a `#rrggbb` string (for persisted node data). */
|
|
19
|
+
export declare function cssColorToHexString(host: HTMLElement | null, cssValue: string, fallback: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* The colors the Flow canvas derives from the active theme:
|
|
22
|
+
* - `background`: the canvas backdrop, follows the theme's muted background.
|
|
23
|
+
* - `gridDot`: grid dots, derived from the theme foreground color.
|
|
24
|
+
* - `nodeFill`: default fill for new shapes, follows the theme base background.
|
|
25
|
+
*/
|
|
26
|
+
export interface FlowThemeColors {
|
|
27
|
+
background: number;
|
|
28
|
+
gridDot: number;
|
|
29
|
+
nodeFill: string;
|
|
30
|
+
nodeText: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function resolveFlowThemeColors(host: HTMLElement | null): FlowThemeColors;
|
|
33
|
+
export declare const THEME_COLOR_PREFIX = "theme:";
|
|
34
|
+
/** A selectable theme color, shown as a swatch in the inspector. */
|
|
35
|
+
export interface ThemeColorToken {
|
|
36
|
+
/** Stored value, e.g. `theme:base-100`. */
|
|
37
|
+
token: string;
|
|
38
|
+
/** CSS custom property backing the token. */
|
|
39
|
+
cssVar: string;
|
|
40
|
+
/** Short label for the inspector tooltip. */
|
|
41
|
+
label: string;
|
|
42
|
+
}
|
|
43
|
+
/** The theme colors offered as presets/defaults for Flow color fields. */
|
|
44
|
+
export declare const THEME_COLOR_TOKENS: ThemeColorToken[];
|
|
45
|
+
/**
|
|
46
|
+
* The "follow theme" default token for each color field type. Each field syncs
|
|
47
|
+
* to a theme role so shapes stay legible against the canvas:
|
|
48
|
+
* - `fill` -> theme background (base-100)
|
|
49
|
+
* - `stroke` -> theme font color (base-content) — a visible outline
|
|
50
|
+
* - `text` -> theme font color (base-content)
|
|
51
|
+
* - `line` -> theme font color (base-content) — lines/edges
|
|
52
|
+
*/
|
|
53
|
+
export type ThemeColorFieldKind = 'fill' | 'stroke' | 'text' | 'line';
|
|
54
|
+
export declare const THEME_SYNC_TOKEN: Record<ThemeColorFieldKind, string>;
|
|
55
|
+
/** The CSS var backing a given theme token (for live-updating DOM swatches). */
|
|
56
|
+
export declare function themeTokenCssVar(token: string): string | undefined;
|
|
57
|
+
/** Human label for a theme token (for tooltips). */
|
|
58
|
+
export declare function themeTokenLabel(token: string): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Common named colors offered after the theme-sync swatch: a compact rainbow
|
|
61
|
+
* plus black/white. Order follows 黑白赤橙黄绿青蓝紫粉 (black, white, red,
|
|
62
|
+
* orange, yellow, green, cyan, blue, purple, pink).
|
|
63
|
+
*/
|
|
64
|
+
export interface NamedColor {
|
|
65
|
+
value: string;
|
|
66
|
+
/** Chinese label shown on hover. */
|
|
67
|
+
label: string;
|
|
68
|
+
}
|
|
69
|
+
export declare const COMMON_COLORS: NamedColor[];
|
|
70
|
+
/** True when `value` is a `theme:*` token. */
|
|
71
|
+
export declare function isThemeToken(value: string | undefined | null): value is string;
|
|
72
|
+
/**
|
|
73
|
+
* Re-resolve every theme token against the given host's themed scope and cache
|
|
74
|
+
* the results. Call on init and whenever the active theme changes.
|
|
75
|
+
*/
|
|
76
|
+
export declare function refreshThemePalette(host: HTMLElement | null): void;
|
|
77
|
+
/**
|
|
78
|
+
* Resolve a stored color value to a concrete `#rrggbb`/literal color. Theme
|
|
79
|
+
* tokens are looked up in the cached palette; anything else is returned as-is.
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveThemeColor(value: string | undefined | null, fallback?: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve a stored color to a value usable directly in the DOM. Theme tokens
|
|
84
|
+
* map to their CSS variable so the browser tracks theme changes natively.
|
|
85
|
+
*/
|
|
86
|
+
export declare function resolveThemeColorCss(value: string | undefined | null, fallback?: string): string;
|