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.
Files changed (115) hide show
  1. package/dist/chart.js +35 -33
  2. package/dist/components/Chart/index.d.ts +1 -1
  3. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +1 -2
  4. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
  5. package/dist/components/pro/CodeEditor/themes.js +0 -25
  6. package/dist/components/pro/CodeEditor/themes.js.map +1 -1
  7. package/dist/components/pro/CodeEditor/types.d.ts +1 -1
  8. package/dist/components/pro/DataTable/pivotExtension.d.ts +6 -0
  9. package/dist/components/pro/DataTable/pivotExtension.js +31 -30
  10. package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
  11. package/dist/components/pro/Flow/Flow.js +500 -459
  12. package/dist/components/pro/Flow/Flow.js.map +1 -1
  13. package/dist/components/pro/Flow/FlowCanvas.js +526 -524
  14. package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
  15. package/dist/components/pro/Flow/canvas/GridRenderer.d.ts +3 -0
  16. package/dist/components/pro/Flow/canvas/GridRenderer.js +28 -23
  17. package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
  18. package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +18 -17
  19. package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
  20. package/dist/components/pro/Flow/canvas/PixiApp.d.ts +24 -0
  21. package/dist/components/pro/Flow/canvas/PixiApp.js +60 -15
  22. package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
  23. package/dist/components/pro/Flow/constants.js +7 -7
  24. package/dist/components/pro/Flow/constants.js.map +1 -1
  25. package/dist/components/pro/Flow/context/FlowAIContext.d.ts +15 -0
  26. package/dist/components/pro/Flow/context/FlowAIContext.js +32 -0
  27. package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -0
  28. package/dist/components/pro/Flow/context/FlowUIContext.d.ts +4 -1
  29. package/dist/components/pro/Flow/context/FlowUIContext.js +58 -55
  30. package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
  31. package/dist/components/pro/Flow/edges/EdgeRenderer.js +22 -21
  32. package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
  33. package/dist/components/pro/Flow/hooks/useFlowImportExport.d.ts +6 -0
  34. package/dist/components/pro/Flow/hooks/useFlowImportExport.js +146 -89
  35. package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
  36. package/dist/components/pro/Flow/hooks/useLayoutActions.d.ts +2 -0
  37. package/dist/components/pro/Flow/hooks/useLayoutActions.js +94 -65
  38. package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
  39. package/dist/components/pro/Flow/hooks/usePdfExport.d.ts +10 -0
  40. package/dist/components/pro/Flow/hooks/usePdfExport.js +60 -0
  41. package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -0
  42. package/dist/components/pro/Flow/hooks/usePixiApp.d.ts +6 -1
  43. package/dist/components/pro/Flow/hooks/usePixiApp.js +49 -30
  44. package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
  45. package/dist/components/pro/Flow/index.d.ts +5 -2
  46. package/dist/components/pro/Flow/lines/FreehandTool.js +21 -20
  47. package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
  48. package/dist/components/pro/Flow/lines/GeometricLineTool.js +22 -18
  49. package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
  50. package/dist/components/pro/Flow/lines/LineRenderer.js +19 -18
  51. package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
  52. package/dist/components/pro/Flow/nodes/DataNodeView.d.ts +7 -0
  53. package/dist/components/pro/Flow/nodes/DataNodeView.js +217 -0
  54. package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -0
  55. package/dist/components/pro/Flow/nodes/MediaContent.js +149 -120
  56. package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
  57. package/dist/components/pro/Flow/nodes/MediaOverlay.js +22 -17
  58. package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
  59. package/dist/components/pro/Flow/nodes/NodeRenderer.js +77 -76
  60. package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
  61. package/dist/components/pro/Flow/nodes/aiClient.d.ts +22 -0
  62. package/dist/components/pro/Flow/nodes/aiClient.js +107 -54
  63. package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
  64. package/dist/components/pro/Flow/nodes/dataUtils.d.ts +52 -0
  65. package/dist/components/pro/Flow/nodes/dataUtils.js +270 -0
  66. package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -0
  67. package/dist/components/pro/Flow/nodes/svgIcons.js +59 -27
  68. package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
  69. package/dist/components/pro/Flow/panels/AIPanel.d.ts +2 -0
  70. package/dist/components/pro/Flow/panels/AIPanel.js +498 -0
  71. package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -0
  72. package/dist/components/pro/Flow/panels/DataInspectorSection.d.ts +11 -0
  73. package/dist/components/pro/Flow/panels/DataInspectorSection.js +436 -0
  74. package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -0
  75. package/dist/components/pro/Flow/panels/ExpandableTextarea.d.ts +16 -0
  76. package/dist/components/pro/Flow/panels/ExpandableTextarea.js +65 -0
  77. package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -0
  78. package/dist/components/pro/Flow/panels/FlowPanelGroup.js +51 -39
  79. package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
  80. package/dist/components/pro/Flow/panels/FlowToolbar.d.ts +5 -1
  81. package/dist/components/pro/Flow/panels/FlowToolbar.js +310 -233
  82. package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
  83. package/dist/components/pro/Flow/panels/InspectorPanel.js +358 -363
  84. package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
  85. package/dist/components/pro/Flow/panels/OutlinePanel.js +63 -62
  86. package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
  87. package/dist/components/pro/Flow/panels/ProjectTitle.d.ts +8 -0
  88. package/dist/components/pro/Flow/panels/ProjectTitle.js +49 -0
  89. package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -0
  90. package/dist/components/pro/Flow/panels/ShapePalette.js +128 -115
  91. package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
  92. package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +13 -0
  93. package/dist/components/pro/Flow/panels/toolbarIcons.js +241 -87
  94. package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
  95. package/dist/components/pro/Flow/types.d.ts +77 -1
  96. package/dist/components/pro/Flow/types.js.map +1 -1
  97. package/dist/components/pro/Flow/utils/pdfExport.d.ts +20 -0
  98. package/dist/components/pro/Flow/utils/pdfExport.js +95 -0
  99. package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -0
  100. package/dist/components/pro/Flow/utils/themeColor.d.ts +86 -0
  101. package/dist/components/pro/Flow/utils/themeColor.js +190 -0
  102. package/dist/components/pro/Flow/utils/themeColor.js.map +1 -0
  103. package/dist/contexts/AppContext.d.ts +1 -1
  104. package/dist/contexts/AppContext.js +28 -29
  105. package/dist/contexts/AppContext.js.map +1 -1
  106. package/dist/dishui.css +1 -1
  107. package/dist/favicon.svg +10 -0
  108. package/dist/flow.js +59 -51
  109. package/dist/index-nostyled.d.ts +1 -1
  110. package/dist/index.d.ts +1 -1
  111. package/dist/styles/themeStyles.js +6 -11
  112. package/dist/styles/themeStyles.js.map +1 -1
  113. package/dist/utils/themes.js +3 -23
  114. package/dist/utils/themes.js.map +1 -1
  115. package/package.json +17 -18
@@ -1,274 +1,351 @@
1
- import eo from "../../../Button/index.js";
2
- import { useFlowContext as to } from "../context/FlowContext.js";
3
- import { useFlowUI as no } from "../context/FlowUIContext.js";
4
- import { downloadDataURL as co, useFlowImportExport as lo } from "../hooks/useFlowImportExport.js";
1
+ import no from "../../../Button/index.js";
2
+ import { useFlowContext as lo } from "../context/FlowContext.js";
3
+ import { useFlowUI as V } from "../context/FlowUIContext.js";
4
+ import co from "./ProjectTitle.js";
5
+ import { downloadDataURL as E, safeFileBaseName as T, useFlowImportExport as ro } from "../hooks/useFlowImportExport.js";
5
6
  import { useLayoutActions as so } from "../hooks/useLayoutActions.js";
6
- import { IconAlign as t, IconAnchorVisible as ro, IconAutoFocus as ao, IconBack as ho, IconExport as po, IconExportImage as mo, IconFitView as uo, IconGeoGroup as wo, IconGrid as fo, IconGroup as ko, IconImport as Io, IconInspector as vo, IconJson as Co, IconMiniMap as bo, IconOutline as No, IconPresent as So, IconPublish as zo, IconRedo as Ao, IconShapes as Oo, IconUndo as yo, IconUngroup as xo, IconZoomIn as Fo, IconZoomOut as go } from "./toolbarIcons.js";
7
- import { useCallback as b, useRef as Jo } from "react";
8
- import { Fragment as N, jsx as o, jsxs as d } from "react/jsx-runtime";
9
- function i({ tip: a, shortcut: h, onClick: u, active: f, disabled: k, children: p }) {
10
- const l = h ? `${a} (${h})` : a;
11
- return /* @__PURE__ */ d("span", {
7
+ import { IconAI as ao, IconAlign as d, IconAnchorVisible as ho, IconAutoFocus as po, IconBack as mo, IconExportJson as uo, IconExportMarkdown as ko, IconExportPdf as wo, IconExportPng as fo, IconFitView as Io, IconGeoGroup as bo, IconGrid as vo, IconGroup as Co, IconImport as No, IconInspector as go, IconJson as Ao, IconLayer as v, IconMiniMap as xo, IconOutline as Oo, IconPresent as So, IconPublish as zo, IconRedo as yo, IconShapes as Fo, IconUndo as Mo, IconUngroup as jo, IconZoomIn as Ro, IconZoomOut as Jo } from "./toolbarIcons.js";
8
+ import { useCallback as C, useRef as Lo } from "react";
9
+ import { Fragment as N, jsx as o, jsxs as e } from "react/jsx-runtime";
10
+ function Do() {
11
+ const { viewport: n, setViewport: l, autoFocus: r, setAutoFocus: u } = V(), k = Math.round(n.zoom * 100);
12
+ return /* @__PURE__ */ e("div", {
13
+ className: "flow-zoom-controls",
14
+ children: [
15
+ /* @__PURE__ */ o(i, {
16
+ tip: "缩小",
17
+ onClick: () => {
18
+ l({
19
+ ...n,
20
+ zoom: Math.max(0.1, n.zoom / 1.2)
21
+ });
22
+ },
23
+ children: /* @__PURE__ */ o(Jo, {})
24
+ }),
25
+ /* @__PURE__ */ e("span", {
26
+ className: "flow-zoom-info",
27
+ children: [k, "%"]
28
+ }),
29
+ /* @__PURE__ */ o(i, {
30
+ tip: "放大",
31
+ onClick: () => {
32
+ l({
33
+ ...n,
34
+ zoom: Math.min(4, n.zoom * 1.2)
35
+ });
36
+ },
37
+ children: /* @__PURE__ */ o(Ro, {})
38
+ }),
39
+ /* @__PURE__ */ o(i, {
40
+ tip: "适应视图",
41
+ onClick: () => {
42
+ l({
43
+ x: 0,
44
+ y: 0,
45
+ zoom: 1
46
+ });
47
+ },
48
+ children: /* @__PURE__ */ o(Io, {})
49
+ }),
50
+ /* @__PURE__ */ o(i, {
51
+ tip: r ? "关闭 Auto Focus" : "开启 Auto Focus",
52
+ active: r,
53
+ onClick: () => u(!r),
54
+ children: /* @__PURE__ */ o(po, {})
55
+ })
56
+ ]
57
+ });
58
+ }
59
+ function i({ tip: n, shortcut: l, onClick: r, active: u, disabled: k, children: p }) {
60
+ const a = l ? `${n} (${l})` : n;
61
+ return /* @__PURE__ */ e("span", {
12
62
  className: "flow-tip",
13
- children: [/* @__PURE__ */ o(eo, {
63
+ children: [/* @__PURE__ */ o(no, {
14
64
  size: "xs",
15
- variant: f ? "primary" : "ghost",
16
- onClick: u,
65
+ variant: u ? "primary" : "ghost",
66
+ onClick: r,
17
67
  disabled: k,
18
68
  square: !0,
19
69
  children: /* @__PURE__ */ o("span", {
20
- "aria-label": l,
70
+ "aria-label": a,
21
71
  style: { display: "inline-flex" },
22
72
  children: p
23
73
  })
24
74
  }), /* @__PURE__ */ o("span", {
25
75
  className: "flow-tip-label",
26
76
  role: "tooltip",
27
- children: l
77
+ children: a
28
78
  })]
29
79
  });
30
80
  }
31
- function Vo({ onBack: a, onUndo: h, onRedo: u, canUndo: f, canRedo: k, onGroup: p, onGeoGroup: l, onUngroup: I, onExportPNG: S, onPublish: z }) {
32
- const { viewport: m, setViewport: v, autoFocus: C, setAutoFocus: P, showGrid: A, setShowGrid: U, showPalette: O, setShowPalette: T, showInspector: y, setShowInspector: V, showOutline: x, setShowOutline: B, showJson: F, setShowJson: E, showMiniMap: g, setShowMiniMap: $, showAnchors: w, setShowAnchors: D, presentation: J, setPresentation: q } = no(), { doc: W, selection: n, currentCanvas: H } = to(), { exportJSON: j, importJSON: M } = lo(), { align: s, distribute: R } = so(), Z = Jo(null), G = n.nodeIds.size + n.lineIds.size, K = n.nodeIds.size > 0 && H.nodes.some((e) => n.nodeIds.has(e.id) && (e.type === "flowGroup" || e.type === "geometryGroup" || e.data.isGroup)), L = Object.values(W.canvases).some((e) => e.nodes.some((r) => r.type === "animAnchor")), Q = Math.round(m.zoom * 100), X = () => {
33
- const e = Math.min(4, m.zoom * 1.2);
34
- v({
35
- ...m,
36
- zoom: e
37
- });
38
- }, Y = () => {
39
- const e = Math.max(0.1, m.zoom / 1.2);
40
- v({
41
- ...m,
42
- zoom: e
43
- });
44
- }, _ = () => {
45
- v({
46
- x: 0,
47
- y: 0,
48
- zoom: 1
49
- });
50
- }, oo = b(() => {
51
- const e = j(), r = new Blob([e], { type: "application/json" }), c = URL.createObjectURL(r);
52
- co(c, `flowchart-${Date.now()}.json`), URL.revokeObjectURL(c);
53
- }, [j]), io = b(() => {
54
- Z.current?.click();
81
+ function Wo({ onBack: n, onUndo: l, onRedo: r, canUndo: u, canRedo: k, onGroup: p, onGeoGroup: a, onUngroup: f, onExportPNG: x, onExportPDF: O, onPublish: S }) {
82
+ const { showGrid: z, setShowGrid: $, showPalette: y, setShowPalette: q, showInspector: F, setShowInspector: D, showOutline: M, setShowOutline: W, showJson: j, setShowJson: H, showAI: R, setShowAI: K, showMiniMap: J, setShowMiniMap: Q, showAnchors: I, setShowAnchors: X, presentation: L, setPresentation: Y } = V(), { doc: w, selection: h, currentCanvas: _ } = lo(), { exportJSON: Z, importJSON: P, exportMarkdown: U } = ro(), { align: m, distribute: G, changeZIndex: b } = so(), B = Lo(null), g = h.nodeIds.size + h.lineIds.size, oo = h.nodeIds.size > 0 && _.nodes.some((t) => h.nodeIds.has(t.id) && (t.type === "flowGroup" || t.type === "geometryGroup" || t.data.isGroup)), A = Object.values(w.canvases).some((t) => t.nodes.some((s) => s.type === "animAnchor")), io = C(() => {
83
+ const t = Z(), s = new Blob([t], { type: "application/json" }), c = URL.createObjectURL(s);
84
+ E(c, `${T(w.title)}.json`), URL.revokeObjectURL(c);
85
+ }, [Z, w.title]), eo = C(() => {
86
+ const t = U(), s = new Blob([t], { type: "text/markdown" }), c = URL.createObjectURL(s);
87
+ E(c, `${T(w.title)}.md`), URL.revokeObjectURL(c);
88
+ }, [U, w.title]), to = C(() => {
89
+ B.current?.click();
55
90
  }, []);
56
- return /* @__PURE__ */ d("div", {
91
+ return /* @__PURE__ */ e("div", {
57
92
  className: "flow-toolbar",
58
93
  children: [
59
94
  /* @__PURE__ */ o("input", {
60
- ref: Z,
95
+ ref: B,
61
96
  type: "file",
62
97
  accept: ".json",
63
98
  style: { display: "none" },
64
- onChange: b((e) => {
65
- const r = e.target.files?.[0];
66
- if (!r) return;
99
+ onChange: C((t) => {
100
+ const s = t.target.files?.[0];
101
+ if (!s) return;
67
102
  const c = new FileReader();
68
103
  c.onload = () => {
69
- typeof c.result == "string" && M(c.result);
70
- }, c.readAsText(r), e.target.value = "";
71
- }, [M])
104
+ typeof c.result == "string" && P(c.result);
105
+ }, c.readAsText(s), t.target.value = "";
106
+ }, [P])
72
107
  }),
73
- a && /* @__PURE__ */ d(N, { children: [/* @__PURE__ */ o(i, {
74
- tip: "返回列表",
75
- onClick: a,
76
- children: /* @__PURE__ */ o(ho, {})
108
+ /* @__PURE__ */ o(co, {}),
109
+ n && /* @__PURE__ */ e(N, { children: [/* @__PURE__ */ o("div", {
110
+ className: "flow-toolbar-group",
111
+ children: /* @__PURE__ */ o(i, {
112
+ tip: "返回列表",
113
+ onClick: n,
114
+ children: /* @__PURE__ */ o(mo, {})
115
+ })
77
116
  }), /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" })] }),
78
- h && /* @__PURE__ */ o(i, {
79
- tip: "撤销",
80
- shortcut: "Ctrl+Z",
81
- onClick: h,
82
- disabled: !f,
83
- children: /* @__PURE__ */ o(yo, {})
84
- }),
85
- u && /* @__PURE__ */ o(i, {
86
- tip: "重做",
87
- shortcut: "Ctrl+Shift+Z",
88
- onClick: u,
89
- disabled: !k,
90
- children: /* @__PURE__ */ o(Ao, {})
91
- }),
92
- (p || l || I) && /* @__PURE__ */ d(N, { children: [
93
- /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }),
94
- p && /* @__PURE__ */ o(i, {
95
- tip: "成组",
96
- shortcut: "⌘G",
97
- onClick: p,
98
- disabled: G < 2,
99
- children: /* @__PURE__ */ o(ko, {})
100
- }),
101
- l && /* @__PURE__ */ o(i, {
102
- tip: "几何分组",
103
- shortcut: "⌘⌥G",
117
+ (l || r) && /* @__PURE__ */ e("div", {
118
+ className: "flow-toolbar-group",
119
+ children: [l && /* @__PURE__ */ o(i, {
120
+ tip: "撤销",
121
+ shortcut: "Ctrl+Z",
104
122
  onClick: l,
105
- disabled: G < 2,
106
- children: /* @__PURE__ */ o(wo, {})
107
- }),
108
- I && /* @__PURE__ */ o(i, {
109
- tip: "取消成组",
110
- shortcut: "⌘⇧G",
111
- onClick: I,
112
- disabled: !K,
113
- children: /* @__PURE__ */ o(xo, {})
114
- })
115
- ] }),
116
- n.nodeIds.size >= 2 && /* @__PURE__ */ d(N, { children: [
117
- /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }),
118
- /* @__PURE__ */ o(i, {
119
- tip: "居左",
120
- onClick: () => s("left"),
121
- children: /* @__PURE__ */ o(t, { kind: "left" })
122
- }),
123
- /* @__PURE__ */ o(i, {
124
- tip: "水平居中",
125
- onClick: () => s("center-h"),
126
- children: /* @__PURE__ */ o(t, { kind: "center-h" })
127
- }),
128
- /* @__PURE__ */ o(i, {
129
- tip: "居右",
130
- onClick: () => s("right"),
131
- children: /* @__PURE__ */ o(t, { kind: "right" })
132
- }),
133
- /* @__PURE__ */ o(i, {
134
- tip: "居上",
135
- onClick: () => s("top"),
136
- children: /* @__PURE__ */ o(t, { kind: "top" })
137
- }),
138
- /* @__PURE__ */ o(i, {
139
- tip: "垂直居中",
140
- onClick: () => s("center-v"),
141
- children: /* @__PURE__ */ o(t, { kind: "center-v" })
142
- }),
143
- /* @__PURE__ */ o(i, {
144
- tip: "居下",
145
- onClick: () => s("bottom"),
146
- children: /* @__PURE__ */ o(t, { kind: "bottom" })
147
- }),
148
- /* @__PURE__ */ o(i, {
149
- tip: "水平平分",
150
- onClick: () => R("horizontal"),
151
- disabled: n.nodeIds.size < 3,
152
- children: /* @__PURE__ */ o(t, { kind: "distribute-h" })
153
- }),
154
- /* @__PURE__ */ o(i, {
155
- tip: "垂直平分",
156
- onClick: () => R("vertical"),
157
- disabled: n.nodeIds.size < 3,
158
- children: /* @__PURE__ */ o(t, { kind: "distribute-v" })
159
- })
160
- ] }),
161
- /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }),
162
- /* @__PURE__ */ o(i, {
163
- tip: "缩小",
164
- onClick: Y,
165
- children: /* @__PURE__ */ o(go, {})
166
- }),
167
- /* @__PURE__ */ d("span", {
168
- className: "flow-zoom-info",
169
- children: [Q, "%"]
170
- }),
171
- /* @__PURE__ */ o(i, {
172
- tip: "放大",
173
- onClick: X,
174
- children: /* @__PURE__ */ o(Fo, {})
175
- }),
176
- /* @__PURE__ */ o(i, {
177
- tip: "适应视图",
178
- onClick: _,
179
- children: /* @__PURE__ */ o(uo, {})
180
- }),
181
- /* @__PURE__ */ o(i, {
182
- tip: C ? "关闭 Auto Focus" : "开启 Auto Focus",
183
- active: C,
184
- onClick: () => P(!C),
185
- children: /* @__PURE__ */ o(ao, {})
186
- }),
187
- /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }),
188
- /* @__PURE__ */ o(i, {
189
- tip: "形状面板",
190
- active: O,
191
- onClick: () => T(!O),
192
- children: /* @__PURE__ */ o(Oo, {})
193
- }),
194
- /* @__PURE__ */ o(i, {
195
- tip: "属性面板",
196
- active: y,
197
- onClick: () => V(!y),
198
- children: /* @__PURE__ */ o(vo, {})
199
- }),
200
- /* @__PURE__ */ o(i, {
201
- tip: "大纲",
202
- active: x,
203
- onClick: () => B(!x),
204
- children: /* @__PURE__ */ o(No, {})
205
- }),
206
- /* @__PURE__ */ o(i, {
207
- tip: "JSON",
208
- active: F,
209
- onClick: () => E(!F),
210
- children: /* @__PURE__ */ o(Co, {})
123
+ disabled: !u,
124
+ children: /* @__PURE__ */ o(Mo, {})
125
+ }), r && /* @__PURE__ */ o(i, {
126
+ tip: "重做",
127
+ shortcut: "Ctrl+Shift+Z",
128
+ onClick: r,
129
+ disabled: !k,
130
+ children: /* @__PURE__ */ o(yo, {})
131
+ })]
211
132
  }),
133
+ h.nodeIds.size >= 2 && /* @__PURE__ */ e(N, { children: [/* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }), /* @__PURE__ */ e("div", {
134
+ className: "flow-toolbar-group",
135
+ children: [
136
+ /* @__PURE__ */ o(i, {
137
+ tip: "居左",
138
+ onClick: () => m("left"),
139
+ children: /* @__PURE__ */ o(d, { kind: "left" })
140
+ }),
141
+ /* @__PURE__ */ o(i, {
142
+ tip: "水平居中",
143
+ onClick: () => m("center-h"),
144
+ children: /* @__PURE__ */ o(d, { kind: "center-h" })
145
+ }),
146
+ /* @__PURE__ */ o(i, {
147
+ tip: "居右",
148
+ onClick: () => m("right"),
149
+ children: /* @__PURE__ */ o(d, { kind: "right" })
150
+ }),
151
+ /* @__PURE__ */ o(i, {
152
+ tip: "居上",
153
+ onClick: () => m("top"),
154
+ children: /* @__PURE__ */ o(d, { kind: "top" })
155
+ }),
156
+ /* @__PURE__ */ o(i, {
157
+ tip: "垂直居中",
158
+ onClick: () => m("center-v"),
159
+ children: /* @__PURE__ */ o(d, { kind: "center-v" })
160
+ }),
161
+ /* @__PURE__ */ o(i, {
162
+ tip: "居下",
163
+ onClick: () => m("bottom"),
164
+ children: /* @__PURE__ */ o(d, { kind: "bottom" })
165
+ }),
166
+ /* @__PURE__ */ o(i, {
167
+ tip: "水平平分",
168
+ onClick: () => G("horizontal"),
169
+ disabled: h.nodeIds.size < 3,
170
+ children: /* @__PURE__ */ o(d, { kind: "distribute-h" })
171
+ }),
172
+ /* @__PURE__ */ o(i, {
173
+ tip: "垂直平分",
174
+ onClick: () => G("vertical"),
175
+ disabled: h.nodeIds.size < 3,
176
+ children: /* @__PURE__ */ o(d, { kind: "distribute-v" })
177
+ })
178
+ ]
179
+ })] }),
180
+ g >= 1 && /* @__PURE__ */ e(N, { children: [/* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }), /* @__PURE__ */ e("div", {
181
+ className: "flow-toolbar-group",
182
+ children: [
183
+ /* @__PURE__ */ o(i, {
184
+ tip: "置于顶层",
185
+ onClick: () => b("front"),
186
+ children: /* @__PURE__ */ o(v, { kind: "front" })
187
+ }),
188
+ /* @__PURE__ */ o(i, {
189
+ tip: "上移一层",
190
+ onClick: () => b("up"),
191
+ children: /* @__PURE__ */ o(v, { kind: "up" })
192
+ }),
193
+ /* @__PURE__ */ o(i, {
194
+ tip: "下移一层",
195
+ onClick: () => b("down"),
196
+ children: /* @__PURE__ */ o(v, { kind: "down" })
197
+ }),
198
+ /* @__PURE__ */ o(i, {
199
+ tip: "置于底层",
200
+ onClick: () => b("back"),
201
+ children: /* @__PURE__ */ o(v, { kind: "back" })
202
+ })
203
+ ]
204
+ })] }),
205
+ (p || a || f) && /* @__PURE__ */ e(N, { children: [/* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }), /* @__PURE__ */ e("div", {
206
+ className: "flow-toolbar-group",
207
+ children: [
208
+ p && /* @__PURE__ */ o(i, {
209
+ tip: "成组",
210
+ shortcut: "⌘G",
211
+ onClick: p,
212
+ disabled: g < 2,
213
+ children: /* @__PURE__ */ o(Co, {})
214
+ }),
215
+ a && /* @__PURE__ */ o(i, {
216
+ tip: "几何分组",
217
+ shortcut: "⌘⌥G",
218
+ onClick: a,
219
+ disabled: g < 2,
220
+ children: /* @__PURE__ */ o(bo, {})
221
+ }),
222
+ f && /* @__PURE__ */ o(i, {
223
+ tip: "取消成组",
224
+ shortcut: "⌘⇧G",
225
+ onClick: f,
226
+ disabled: !oo,
227
+ children: /* @__PURE__ */ o(jo, {})
228
+ })
229
+ ]
230
+ })] }),
212
231
  /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }),
213
- /* @__PURE__ */ o(i, {
214
- tip: "网格",
215
- active: A,
216
- onClick: () => U(!A),
217
- children: /* @__PURE__ */ o(fo, {})
218
- }),
219
- /* @__PURE__ */ o(i, {
220
- tip: "缩略图",
221
- active: g,
222
- onClick: () => $(!g),
223
- children: /* @__PURE__ */ o(bo, {})
224
- }),
225
- /* @__PURE__ */ o(i, {
226
- tip: w ? "隐藏所有 Anchor 对象" : "显示所有 Anchor 对象",
227
- active: w,
228
- disabled: !L,
229
- onClick: () => {
230
- L && D(!w);
231
- },
232
- children: /* @__PURE__ */ o(ro, { visible: w })
232
+ /* @__PURE__ */ e("div", {
233
+ className: "flow-toolbar-group",
234
+ children: [
235
+ /* @__PURE__ */ o(i, {
236
+ tip: "网格",
237
+ active: z,
238
+ onClick: () => $(!z),
239
+ children: /* @__PURE__ */ o(vo, {})
240
+ }),
241
+ /* @__PURE__ */ o(i, {
242
+ tip: "缩略图",
243
+ active: J,
244
+ onClick: () => Q(!J),
245
+ children: /* @__PURE__ */ o(xo, {})
246
+ }),
247
+ /* @__PURE__ */ o(i, {
248
+ tip: I ? "隐藏所有 Anchor 对象" : "显示所有 Anchor 对象",
249
+ active: I,
250
+ disabled: !A,
251
+ onClick: () => {
252
+ A && X(!I);
253
+ },
254
+ children: /* @__PURE__ */ o(ho, { visible: I })
255
+ }),
256
+ /* @__PURE__ */ o(i, {
257
+ tip: "动画预览",
258
+ active: L !== null,
259
+ onClick: () => Y(L ? null : {
260
+ current: 0,
261
+ showAnchor: !1
262
+ }),
263
+ children: /* @__PURE__ */ o(So, {})
264
+ })
265
+ ]
233
266
  }),
234
267
  /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }),
235
- /* @__PURE__ */ o(i, {
236
- tip: "动画预览",
237
- active: J !== null,
238
- onClick: () => q(J ? null : {
239
- current: 0,
240
- showAnchor: !1
241
- }),
242
- children: /* @__PURE__ */ o(So, {})
268
+ /* @__PURE__ */ e("div", {
269
+ className: "flow-toolbar-group",
270
+ children: [
271
+ /* @__PURE__ */ o(i, {
272
+ tip: "形状面板",
273
+ active: y,
274
+ onClick: () => q(!y),
275
+ children: /* @__PURE__ */ o(Fo, {})
276
+ }),
277
+ /* @__PURE__ */ o(i, {
278
+ tip: "属性面板",
279
+ active: F,
280
+ onClick: () => D(!F),
281
+ children: /* @__PURE__ */ o(go, {})
282
+ }),
283
+ /* @__PURE__ */ o(i, {
284
+ tip: "大纲",
285
+ active: M,
286
+ onClick: () => W(!M),
287
+ children: /* @__PURE__ */ o(Oo, {})
288
+ }),
289
+ /* @__PURE__ */ o(i, {
290
+ tip: "JSON",
291
+ active: j,
292
+ onClick: () => H(!j),
293
+ children: /* @__PURE__ */ o(Ao, {})
294
+ }),
295
+ /* @__PURE__ */ o(i, {
296
+ tip: "AI 助手",
297
+ active: R,
298
+ onClick: () => K(!R),
299
+ children: /* @__PURE__ */ o(ao, {})
300
+ })
301
+ ]
243
302
  }),
244
303
  /* @__PURE__ */ o("div", { className: "flow-toolbar-divider" }),
245
- /* @__PURE__ */ o(i, {
246
- tip: "导入 JSON",
247
- onClick: io,
248
- children: /* @__PURE__ */ o(Io, {})
249
- }),
250
- /* @__PURE__ */ o(i, {
251
- tip: "导出 JSON",
252
- onClick: oo,
253
- children: /* @__PURE__ */ o(po, {})
254
- }),
255
- S && /* @__PURE__ */ o(i, {
256
- tip: "导出 PNG",
257
- onClick: () => {
258
- S();
259
- },
260
- children: /* @__PURE__ */ o(mo, {})
261
- }),
262
- z && /* @__PURE__ */ o(i, {
263
- tip: "发布与共享",
264
- onClick: z,
265
- children: /* @__PURE__ */ o(zo, {})
304
+ /* @__PURE__ */ e("div", {
305
+ className: "flow-toolbar-group",
306
+ children: [
307
+ /* @__PURE__ */ o(i, {
308
+ tip: "导入 JSON",
309
+ onClick: to,
310
+ children: /* @__PURE__ */ o(No, {})
311
+ }),
312
+ /* @__PURE__ */ o(i, {
313
+ tip: "导出 JSON",
314
+ onClick: io,
315
+ children: /* @__PURE__ */ o(uo, {})
316
+ }),
317
+ /* @__PURE__ */ o(i, {
318
+ tip: "导出 Markdown",
319
+ onClick: eo,
320
+ children: /* @__PURE__ */ o(ko, {})
321
+ }),
322
+ x && /* @__PURE__ */ o(i, {
323
+ tip: "导出 PNG",
324
+ onClick: () => {
325
+ x();
326
+ },
327
+ children: /* @__PURE__ */ o(fo, {})
328
+ }),
329
+ O && A && /* @__PURE__ */ o(i, {
330
+ tip: "导出 PDF(按锦点顺序)",
331
+ onClick: () => {
332
+ O();
333
+ },
334
+ children: /* @__PURE__ */ o(wo, {})
335
+ }),
336
+ S && /* @__PURE__ */ o(i, {
337
+ tip: "发布与共享",
338
+ onClick: S,
339
+ children: /* @__PURE__ */ o(zo, {})
340
+ })
341
+ ]
266
342
  })
267
343
  ]
268
344
  });
269
345
  }
270
346
  export {
271
- Vo as default
347
+ Do as FlowZoomControls,
348
+ Wo as default
272
349
  };
273
350
 
274
351
  //# sourceMappingURL=FlowToolbar.js.map