@duxweb/dvha-pro 1.0.24 → 1.0.25

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 (120) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/components/chart/echart.cjs +1 -1
  3. package/dist/cjs/components/crop/imageCrop.cjs +1 -1
  4. package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
  5. package/dist/cjs/components/data/selectModal.cjs +1 -1
  6. package/dist/cjs/components/form/drawerForm.cjs +1 -1
  7. package/dist/cjs/components/form/modalForm.cjs +1 -1
  8. package/dist/cjs/components/form/pageForm.cjs +1 -1
  9. package/dist/cjs/components/form/settingForm.cjs +1 -1
  10. package/dist/cjs/components/icon/icon.cjs +1 -1
  11. package/dist/cjs/components/image/components/CanvasRuler.cjs +1 -0
  12. package/dist/cjs/components/image/elements/circle.cjs +1 -0
  13. package/dist/cjs/components/image/elements/image.cjs +1 -0
  14. package/dist/cjs/components/image/elements/index.cjs +1 -0
  15. package/dist/cjs/components/image/elements/rect.cjs +1 -0
  16. package/dist/cjs/components/image/elements/text.cjs +1 -0
  17. package/dist/cjs/components/image/hooks/usePosterEditor.cjs +1 -0
  18. package/dist/cjs/components/image/pages/LeftToolbar.cjs +1 -0
  19. package/dist/cjs/components/image/pages/Panel.cjs +1 -0
  20. package/dist/cjs/components/image/pages/PanelItem.cjs +1 -0
  21. package/dist/cjs/components/image/pages/RightPanel.cjs +1 -0
  22. package/dist/cjs/components/image/posterEditor.cjs +1 -0
  23. package/dist/cjs/components/layout/list.cjs +1 -1
  24. package/dist/cjs/components/layout/table.cjs +1 -1
  25. package/dist/cjs/components/level/level.cjs +1 -1
  26. package/dist/cjs/components/table/table.cjs +1 -1
  27. package/dist/cjs/components/upload/file.cjs +1 -1
  28. package/dist/cjs/components/upload/image.cjs +1 -1
  29. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  30. package/dist/cjs/components/upload/manager.cjs +1 -1
  31. package/dist/cjs/hooks/dialog.cjs +1 -1
  32. package/dist/cjs/hooks/drawer.cjs +1 -1
  33. package/dist/cjs/hooks/modal.cjs +1 -1
  34. package/dist/cjs/hooks/table/image.cjs +1 -1
  35. package/dist/cjs/hooks/table/media.cjs +1 -1
  36. package/dist/cjs/index.cjs +1 -1
  37. package/dist/cjs/pages/authLayout.cjs +1 -1
  38. package/dist/cjs/pages/layout/page.cjs +1 -1
  39. package/dist/cjs/pages/layout.cjs +1 -1
  40. package/dist/cjs/pages/login.cjs +1 -1
  41. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  42. package/dist/cjs/pages/menu/button.cjs +1 -1
  43. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  44. package/dist/cjs/pages/menu/main.cjs +1 -1
  45. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  46. package/dist/cjs/pages/page404.cjs +1 -1
  47. package/dist/cjs/pages/pageStatus.cjs +1 -1
  48. package/dist/cjs/theme/uno.css.cjs +25 -1
  49. package/dist/esm/component.js +49 -47
  50. package/dist/esm/components/chart/echart.js +15 -13
  51. package/dist/esm/components/crop/imageCrop.js +15 -13
  52. package/dist/esm/components/data/dynamicSelect.js +15 -13
  53. package/dist/esm/components/data/selectModal.js +20 -18
  54. package/dist/esm/components/form/drawerForm.js +21 -19
  55. package/dist/esm/components/form/modalForm.js +15 -13
  56. package/dist/esm/components/form/pageForm.js +13 -11
  57. package/dist/esm/components/form/settingForm.js +12 -10
  58. package/dist/esm/components/icon/icon.js +15 -13
  59. package/dist/esm/components/image/components/CanvasRuler.js +113 -0
  60. package/dist/esm/components/image/elements/circle.js +127 -0
  61. package/dist/esm/components/image/elements/image.js +131 -0
  62. package/dist/esm/components/image/elements/index.js +46 -0
  63. package/dist/esm/components/image/elements/rect.js +171 -0
  64. package/dist/esm/components/image/elements/text.js +206 -0
  65. package/dist/esm/components/image/hooks/usePosterEditor.js +434 -0
  66. package/dist/esm/components/image/pages/LeftToolbar.js +40 -0
  67. package/dist/esm/components/image/pages/Panel.js +31 -0
  68. package/dist/esm/components/image/pages/PanelItem.js +22 -0
  69. package/dist/esm/components/image/pages/RightPanel.js +421 -0
  70. package/dist/esm/components/image/posterEditor.js +227 -0
  71. package/dist/esm/components/layout/list.js +16 -14
  72. package/dist/esm/components/layout/table.js +16 -14
  73. package/dist/esm/components/level/level.js +15 -13
  74. package/dist/esm/components/table/table.js +15 -13
  75. package/dist/esm/components/upload/file.js +98 -88
  76. package/dist/esm/components/upload/image.js +106 -94
  77. package/dist/esm/components/upload/manage/item.js +15 -13
  78. package/dist/esm/components/upload/manager.js +65 -63
  79. package/dist/esm/hooks/dialog.js +15 -13
  80. package/dist/esm/hooks/drawer.js +15 -13
  81. package/dist/esm/hooks/modal.js +15 -13
  82. package/dist/esm/hooks/table/image.js +15 -13
  83. package/dist/esm/hooks/table/media.js +15 -13
  84. package/dist/esm/index.js +213 -202
  85. package/dist/esm/pages/authLayout.js +15 -13
  86. package/dist/esm/pages/layout/page.js +15 -13
  87. package/dist/esm/pages/layout.js +7 -6
  88. package/dist/esm/pages/login.js +16 -15
  89. package/dist/esm/pages/menu/avatar.js +15 -13
  90. package/dist/esm/pages/menu/button.js +15 -13
  91. package/dist/esm/pages/menu/cmd.js +26 -24
  92. package/dist/esm/pages/menu/main.js +25 -23
  93. package/dist/esm/pages/menu/mobile.js +15 -13
  94. package/dist/esm/pages/page404.js +13 -11
  95. package/dist/esm/pages/pageStatus.js +15 -13
  96. package/dist/esm/theme/uno.css.js +25 -1
  97. package/dist/types/components/image/components/CanvasRuler.d.ts +43 -0
  98. package/dist/types/components/image/components/index.d.ts +1 -0
  99. package/dist/types/components/image/elements/circle.d.ts +3 -0
  100. package/dist/types/components/image/elements/image.d.ts +3 -0
  101. package/dist/types/components/image/elements/index.d.ts +15 -0
  102. package/dist/types/components/image/elements/rect.d.ts +3 -0
  103. package/dist/types/components/image/elements/text.d.ts +3 -0
  104. package/dist/types/components/image/elements/types.d.ts +51 -0
  105. package/dist/types/components/image/hooks/index.d.ts +1 -0
  106. package/dist/types/components/image/hooks/usePosterEditor.d.ts +48 -0
  107. package/dist/types/components/image/index.d.ts +4 -0
  108. package/dist/types/components/image/pages/LeftToolbar.d.ts +33 -0
  109. package/dist/types/components/image/pages/Panel.d.ts +11 -0
  110. package/dist/types/components/image/pages/PanelItem.d.ts +11 -0
  111. package/dist/types/components/image/pages/RightPanel.d.ts +208 -0
  112. package/dist/types/components/image/pages/index.d.ts +4 -0
  113. package/dist/types/components/image/posterEditor.d.ts +61 -0
  114. package/dist/types/components/image/types/editor.d.ts +47 -0
  115. package/dist/types/components/index.d.ts +2 -2
  116. package/dist/types/components/stats/number.d.ts +1 -1
  117. package/dist/types/components/upload/file.d.ts +5 -3
  118. package/dist/types/index.d.ts +1 -0
  119. package/dist/types/pages/layout/global.d.ts +0 -1
  120. package/package.json +6 -3
@@ -0,0 +1,421 @@
1
+ import { defineComponent as v, createVNode as e, Fragment as u, createTextVNode as c, isVNode as s } from "vue";
2
+ import { NButton as l, NTooltip as n, NInputNumber as o, NColorPicker as f } from "naive-ui";
3
+ import "@duxweb/dvha-core";
4
+ import "@vueuse/core";
5
+ import "mime";
6
+ import "vue-router";
7
+ import "@overlastic/vue";
8
+ import "clsx";
9
+ import "vue-echarts";
10
+ import "vue3-ace-editor";
11
+ import "ace-builds/src-noconflict/mode-vue";
12
+ import "ace-builds/src-noconflict/mode-javascript";
13
+ import "ace-builds/src-noconflict/mode-html";
14
+ import "ace-builds/src-noconflict/mode-json";
15
+ import "ace-builds/src-noconflict/mode-json5";
16
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
17
+ import "ace-builds/src-noconflict/theme-tomorrow";
18
+ import "ace-builds/src-noconflict/ext-searchbox";
19
+ import "ace-builds/src-noconflict/ext-language_tools";
20
+ import "ace-builds/src-noconflict/mode-snippets";
21
+ import "vue-cropper";
22
+ import "jinrishici";
23
+ import "lodash-es";
24
+ import "vue-draggable-plus";
25
+ import "aieditor";
26
+ import "vee-validate";
27
+ import "@vee-validate/i18n";
28
+ import "colorizr";
29
+ import "echarts";
30
+ import "@ant-design/colors";
31
+ import "@unocss/preset-icons/browser";
32
+ import "@unocss/preset-typography";
33
+ import "unocss/preset-wind4";
34
+ import "@vee-validate/i18n/dist/locale/en.json";
35
+ import "@vee-validate/i18n/dist/locale/zh_CN.json";
36
+ import "vue-command-palette";
37
+ import "@duxweb/dvha-naiveui";
38
+ import "../../../pages/page404.js";
39
+ import "@iconify-json/tabler/icons.json";
40
+ import "../elements/index.js";
41
+ import "fabric";
42
+ import { Panel as m } from "./Panel.js";
43
+ import { PanelItem as a } from "./PanelItem.js";
44
+ import "dayjs";
45
+ import "@tanstack/vue-query";
46
+ import "pinia";
47
+ import { DuxImageUpload as b } from "../../upload/image.js";
48
+ function C(t) {
49
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !s(t);
50
+ }
51
+ const me = /* @__PURE__ */ v({
52
+ name: "RightPanel",
53
+ props: {
54
+ hasMultipleSelection: {
55
+ type: Boolean,
56
+ required: !0
57
+ },
58
+ selectedElementsCount: {
59
+ type: Number,
60
+ required: !0
61
+ },
62
+ currentElementData: {
63
+ type: Object
64
+ },
65
+ currentElementConfig: {
66
+ type: Object
67
+ },
68
+ canMoveUp: {
69
+ type: Boolean,
70
+ required: !0
71
+ },
72
+ canMoveDown: {
73
+ type: Boolean,
74
+ required: !0
75
+ },
76
+ canMoveToFront: {
77
+ type: Boolean,
78
+ required: !0
79
+ },
80
+ canMoveToBack: {
81
+ type: Boolean,
82
+ required: !0
83
+ },
84
+ canvasWidth: {
85
+ type: Number,
86
+ required: !0
87
+ },
88
+ canvasHeight: {
89
+ type: Number,
90
+ required: !0
91
+ },
92
+ canvasBackgroundColor: {
93
+ type: String,
94
+ required: !0
95
+ },
96
+ canvasBackgroundImage: {
97
+ type: String
98
+ },
99
+ onDeleteSelectedElements: {
100
+ type: Function,
101
+ required: !0
102
+ },
103
+ onAlignElements: {
104
+ type: Function,
105
+ required: !0
106
+ },
107
+ onUpdateElementProperty: {
108
+ type: Function,
109
+ required: !0
110
+ },
111
+ onUpdateCanvasSize: {
112
+ type: Function,
113
+ required: !0
114
+ },
115
+ onUpdateCanvasBackground: {
116
+ type: Function,
117
+ required: !0
118
+ },
119
+ onUpdateCanvasBackgroundImage: {
120
+ type: Function,
121
+ required: !0
122
+ },
123
+ onSaveData: {
124
+ type: Function,
125
+ required: !0
126
+ },
127
+ onExportJson: {
128
+ type: Function,
129
+ required: !0
130
+ },
131
+ onRenderToolbarControl: {
132
+ type: Function,
133
+ required: !0
134
+ },
135
+ onClearCanvas: {
136
+ type: Function,
137
+ required: !0
138
+ },
139
+ canvasScale: {
140
+ type: Number,
141
+ required: !0
142
+ }
143
+ },
144
+ setup(t) {
145
+ const g = () => {
146
+ if (t.hasMultipleSelection)
147
+ return e(m, {
148
+ title: "多选操作"
149
+ }, {
150
+ default: () => e(u, null, [e(a, {
151
+ title: "对齐"
152
+ }, {
153
+ default: () => [e("div", {
154
+ class: "grid grid-cols-4 gap-2"
155
+ }, [e(n, null, {
156
+ trigger: () => e(l, {
157
+ onClick: () => t.onAlignElements("left"),
158
+ renderIcon: () => e("div", {
159
+ class: "i-tabler:layout-align-left"
160
+ }, null)
161
+ }, null),
162
+ default: () => "左对齐"
163
+ }), e(n, null, {
164
+ trigger: () => e(l, {
165
+ onClick: () => t.onAlignElements("right"),
166
+ renderIcon: () => e("div", {
167
+ class: "i-tabler:layout-align-right"
168
+ }, null)
169
+ }, null),
170
+ default: () => "右对齐"
171
+ }), e(n, null, {
172
+ trigger: () => e(l, {
173
+ onClick: () => t.onAlignElements("top"),
174
+ renderIcon: () => e("div", {
175
+ class: "i-tabler:layout-align-top"
176
+ }, null)
177
+ }, null),
178
+ default: () => "顶部对齐"
179
+ }), e(n, null, {
180
+ trigger: () => e(l, {
181
+ onClick: () => t.onAlignElements("bottom"),
182
+ renderIcon: () => e("div", {
183
+ class: "i-tabler:layout-align-bottom"
184
+ }, null)
185
+ }, null),
186
+ default: () => "底部对齐"
187
+ })])]
188
+ }), e(a, {
189
+ title: "居中"
190
+ }, {
191
+ default: () => [e("div", {
192
+ class: "grid grid-cols-4 gap-2"
193
+ }, [e(n, null, {
194
+ trigger: () => e(l, {
195
+ onClick: () => t.onAlignElements("center-horizontal"),
196
+ renderIcon: () => e("div", {
197
+ class: "i-tabler:layout-align-center"
198
+ }, null)
199
+ }, null),
200
+ default: () => "水平居中"
201
+ }), e(n, null, {
202
+ trigger: () => e(l, {
203
+ onClick: () => t.onAlignElements("center-vertical"),
204
+ renderIcon: () => e("div", {
205
+ class: "i-tabler:layout-align-middle"
206
+ }, null)
207
+ }, null),
208
+ default: () => "垂直居中"
209
+ }), e(n, null, {
210
+ trigger: () => e(l, {
211
+ onClick: () => t.onAlignElements("distribute-horizontal"),
212
+ renderIcon: () => e("div", {
213
+ class: "i-tabler:layout-distribute-horizontal"
214
+ }, null)
215
+ }, null),
216
+ default: () => "水平分布"
217
+ }), e(n, null, {
218
+ trigger: () => e(l, {
219
+ onClick: () => t.onAlignElements("distribute-vertical"),
220
+ renderIcon: () => e("div", {
221
+ class: "i-tabler:layout-distribute-vertical"
222
+ }, null)
223
+ }, null),
224
+ default: () => "垂直分布"
225
+ })])]
226
+ })]),
227
+ footer: () => e(u, null, [e(l, {
228
+ block: !0,
229
+ onClick: t.onDeleteSelectedElements,
230
+ type: "error"
231
+ }, {
232
+ icon: () => e("div", {
233
+ class: "i-tabler:trash"
234
+ }, null),
235
+ default: () => "删除"
236
+ })])
237
+ });
238
+ if (t.currentElementData && t.currentElementConfig) {
239
+ const r = t.currentElementConfig.getToolbarControls(t.currentElementData);
240
+ return e(m, {
241
+ title: "元素设置"
242
+ }, {
243
+ default: () => e(u, null, [r.map((i) => {
244
+ let d;
245
+ return e(a, {
246
+ key: i.key,
247
+ title: i.label
248
+ }, C(d = t.onRenderToolbarControl(i)) ? d : {
249
+ default: () => [d]
250
+ });
251
+ }), e(a, {
252
+ title: "X"
253
+ }, {
254
+ default: () => [e(o, {
255
+ value: t.currentElementData?.left,
256
+ "onUpdate:value": (i) => t.onUpdateElementProperty(t.currentElementData.id, "left", i || 0)
257
+ }, null)]
258
+ }), e(a, {
259
+ title: "Y"
260
+ }, {
261
+ default: () => [e(o, {
262
+ value: t.currentElementData?.top,
263
+ "onUpdate:value": (i) => t.onUpdateElementProperty(t.currentElementData.id, "top", i || 0)
264
+ }, null)]
265
+ }), e(a, {
266
+ title: "角度"
267
+ }, {
268
+ default: () => [e(o, {
269
+ value: t.currentElementData?.angle,
270
+ min: -180,
271
+ max: 180,
272
+ "onUpdate:value": (i) => t.onUpdateElementProperty(t.currentElementData.id, "angle", i || 0)
273
+ }, null)]
274
+ }), e(a, {
275
+ title: "对齐"
276
+ }, {
277
+ default: () => [e("div", {
278
+ class: "grid grid-cols-3 gap-2"
279
+ }, [e(n, null, {
280
+ trigger: () => e(l, {
281
+ onClick: () => t.onAlignElements("center-horizontal"),
282
+ renderIcon: () => e("div", {
283
+ class: "i-tabler:layout-align-center"
284
+ }, null)
285
+ }, null),
286
+ default: () => "水平居中"
287
+ }), e(n, null, {
288
+ trigger: () => e(l, {
289
+ onClick: () => t.onAlignElements("center-vertical"),
290
+ renderIcon: () => e("div", {
291
+ class: "i-tabler:layout-align-middle"
292
+ }, null)
293
+ }, null),
294
+ default: () => "垂直居中"
295
+ }), e(n, null, {
296
+ trigger: () => e(l, {
297
+ onClick: () => t.onAlignElements("center-both"),
298
+ renderIcon: () => e("div", {
299
+ class: "i-tabler:layout-distribute-horizontal"
300
+ }, null)
301
+ }, null),
302
+ default: () => "居中"
303
+ })])]
304
+ }), e(a, {
305
+ title: "层级"
306
+ }, {
307
+ default: () => [e("div", {
308
+ class: "grid grid-cols-4 gap-2"
309
+ }, [e(n, null, {
310
+ trigger: () => e(l, {
311
+ disabled: !t.canMoveUp,
312
+ onClick: () => t.onAlignElements("move-up"),
313
+ renderIcon: () => e("div", {
314
+ class: "i-tabler:arrow-narrow-up"
315
+ }, null)
316
+ }, null),
317
+ default: () => "上移一层"
318
+ }), e(n, null, {
319
+ trigger: () => e(l, {
320
+ disabled: !t.canMoveDown,
321
+ onClick: () => t.onAlignElements("move-down"),
322
+ renderIcon: () => e("div", {
323
+ class: "i-tabler:arrow-narrow-down"
324
+ }, null)
325
+ }, null),
326
+ default: () => "下移一层"
327
+ }), e(n, null, {
328
+ trigger: () => e(l, {
329
+ disabled: !t.canMoveToFront,
330
+ onClick: () => t.onAlignElements("move-to-front"),
331
+ renderIcon: () => e("div", {
332
+ class: "i-tabler:arrow-bar-to-up"
333
+ }, null)
334
+ }, null),
335
+ default: () => "移到最前"
336
+ }), e(n, null, {
337
+ trigger: () => e(l, {
338
+ disabled: !t.canMoveToBack,
339
+ onClick: () => t.onAlignElements("move-to-back"),
340
+ renderIcon: () => e("div", {
341
+ class: "i-tabler:arrow-bar-to-down"
342
+ }, null)
343
+ }, null),
344
+ default: () => "移到最后"
345
+ })])]
346
+ })]),
347
+ footer: () => e(u, null, [e(l, {
348
+ block: !0,
349
+ onClick: t.onDeleteSelectedElements,
350
+ type: "error"
351
+ }, {
352
+ icon: () => e("div", {
353
+ class: "i-tabler:trash"
354
+ }, null),
355
+ default: () => "删除"
356
+ })])
357
+ });
358
+ } else
359
+ return e(m, {
360
+ title: "画布设置"
361
+ }, {
362
+ default: () => e(u, null, [e(a, {
363
+ title: "宽度"
364
+ }, {
365
+ default: () => [e(o, {
366
+ value: t.canvasWidth,
367
+ min: 100,
368
+ max: 2e3,
369
+ "onUpdate:value": (r) => t.onUpdateCanvasSize(r || 800, t.canvasHeight)
370
+ }, null)]
371
+ }), e(a, {
372
+ title: "高度"
373
+ }, {
374
+ default: () => [e(o, {
375
+ value: t.canvasHeight,
376
+ min: 100,
377
+ max: 2e3,
378
+ "onUpdate:value": (r) => t.onUpdateCanvasSize(t.canvasWidth, r || 600)
379
+ }, null)]
380
+ }), e(a, {
381
+ title: "背景颜色"
382
+ }, {
383
+ default: () => [e(f, {
384
+ value: t.canvasBackgroundColor,
385
+ "onUpdate:value": (r) => t.onUpdateCanvasBackground(r)
386
+ }, null)]
387
+ }), e(a, {
388
+ title: "背景图片"
389
+ }, {
390
+ default: () => [e(b, {
391
+ value: t.canvasBackgroundImage || "",
392
+ onUpdateValue: (r) => t.onUpdateCanvasBackgroundImage(typeof r == "string" ? r : Array.isArray(r) && r[0] || "")
393
+ }, null)]
394
+ })]),
395
+ footer: () => e(u, null, [e(l, {
396
+ type: "primary",
397
+ block: !0,
398
+ onClick: t.onSaveData
399
+ }, {
400
+ default: () => [c("保存")]
401
+ }), e(l, {
402
+ block: !0,
403
+ onClick: t.onExportJson
404
+ }, {
405
+ default: () => [c("导出 JSON")]
406
+ }), e(l, {
407
+ block: !0,
408
+ onClick: t.onClearCanvas
409
+ }, {
410
+ default: () => [c("清空画布")]
411
+ })])
412
+ });
413
+ };
414
+ return () => e("div", {
415
+ class: "w-60 bg-default border-l border-default"
416
+ }, [g()]);
417
+ }
418
+ });
419
+ export {
420
+ me as RightPanel
421
+ };
@@ -0,0 +1,227 @@
1
+ import { defineComponent as T, ref as m, watch as F, onMounted as H, onUnmounted as R, createVNode as a } from "vue";
2
+ import { NSlider as V, NSwitch as W, NSelect as z, NColorPicker as A, NInputNumber as J, NInput as j } from "naive-ui";
3
+ import { DuxCard as L } from "../card/card.js";
4
+ import "clsx";
5
+ import "@duxweb/dvha-core";
6
+ import "@vueuse/core";
7
+ import "mime";
8
+ import "vue-router";
9
+ import "@overlastic/vue";
10
+ import "vue-echarts";
11
+ import "vue3-ace-editor";
12
+ import "ace-builds/src-noconflict/mode-vue";
13
+ import "ace-builds/src-noconflict/mode-javascript";
14
+ import "ace-builds/src-noconflict/mode-html";
15
+ import "ace-builds/src-noconflict/mode-json";
16
+ import "ace-builds/src-noconflict/mode-json5";
17
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
18
+ import "ace-builds/src-noconflict/theme-tomorrow";
19
+ import "ace-builds/src-noconflict/ext-searchbox";
20
+ import "ace-builds/src-noconflict/ext-language_tools";
21
+ import "ace-builds/src-noconflict/mode-snippets";
22
+ import "vue-cropper";
23
+ import "jinrishici";
24
+ import "lodash-es";
25
+ import "vue-draggable-plus";
26
+ import "aieditor";
27
+ import "vee-validate";
28
+ import "@vee-validate/i18n";
29
+ import "colorizr";
30
+ import "echarts";
31
+ import "@ant-design/colors";
32
+ import "@unocss/preset-icons/browser";
33
+ import "@unocss/preset-typography";
34
+ import "unocss/preset-wind4";
35
+ import "@vee-validate/i18n/dist/locale/en.json";
36
+ import "@vee-validate/i18n/dist/locale/zh_CN.json";
37
+ import "vue-command-palette";
38
+ import "@duxweb/dvha-naiveui";
39
+ import "../../pages/page404.js";
40
+ import "@iconify-json/tabler/icons.json";
41
+ import "./elements/index.js";
42
+ import { usePosterEditor as q } from "./hooks/usePosterEditor.js";
43
+ import { CanvasRuler as G } from "./components/CanvasRuler.js";
44
+ import { LeftToolbar as K } from "./pages/LeftToolbar.js";
45
+ import { RightPanel as O } from "./pages/RightPanel.js";
46
+ import "dayjs";
47
+ import "@tanstack/vue-query";
48
+ import "pinia";
49
+ import { DuxImageUpload as Q } from "../upload/image.js";
50
+ const qe = /* @__PURE__ */ T({
51
+ name: "DuxPosterEditor",
52
+ props: {
53
+ data: {
54
+ type: String,
55
+ default: ""
56
+ },
57
+ width: {
58
+ type: Number,
59
+ default: 750
60
+ },
61
+ height: {
62
+ type: Number,
63
+ default: 1e3
64
+ },
65
+ backgroundColor: {
66
+ type: String,
67
+ default: "#ffffff"
68
+ },
69
+ backgroundImage: {
70
+ type: String,
71
+ default: ""
72
+ },
73
+ onDataUpdate: Function,
74
+ onSave: Function
75
+ },
76
+ setup(n) {
77
+ const r = m(), l = m(), {
78
+ initCanvas: s,
79
+ destroy: v,
80
+ setCallbacks: c,
81
+ addElement: g,
82
+ deleteSelectedElements: f,
83
+ updateElementProperty: u,
84
+ alignElements: h,
85
+ canMoveUp: C,
86
+ canMoveDown: b,
87
+ canMoveToFront: k,
88
+ canMoveToBack: x,
89
+ clearCanvas: E,
90
+ loadData: p,
91
+ canvasData: o,
92
+ selectedElements: S,
93
+ canvasScale: d,
94
+ currentElementData: i,
95
+ currentElementConfig: U,
96
+ hasMultipleSelection: w,
97
+ updateCanvasSettings: y,
98
+ updateCanvasBackground: D,
99
+ updateCanvasBackgroundImage: M,
100
+ saveData: I,
101
+ exportJson: N
102
+ } = q({
103
+ width: n.width,
104
+ height: n.height,
105
+ backgroundColor: n.backgroundColor,
106
+ backgroundImage: n.backgroundImage
107
+ });
108
+ c({
109
+ onDataChange: n?.onDataUpdate
110
+ });
111
+ const B = (e) => {
112
+ const t = (P) => {
113
+ i.value && u(i.value.id, e.key, P);
114
+ };
115
+ switch (e.type) {
116
+ case "text":
117
+ return a(j, {
118
+ value: e.value,
119
+ placeholder: e.options?.placeholder,
120
+ "onUpdate:value": t
121
+ }, null);
122
+ case "number":
123
+ return a(J, {
124
+ value: e.value,
125
+ min: e.options?.min,
126
+ max: e.options?.max,
127
+ step: e.options?.step,
128
+ "onUpdate:value": t
129
+ }, null);
130
+ case "color":
131
+ return a(A, {
132
+ value: e.value,
133
+ "onUpdate:value": t
134
+ }, null);
135
+ case "select":
136
+ return a(z, {
137
+ value: e.value,
138
+ options: e.options?.choices || [],
139
+ "onUpdate:value": t
140
+ }, null);
141
+ case "switch":
142
+ return a(W, {
143
+ value: e.value,
144
+ "onUpdate:value": t
145
+ }, null);
146
+ case "slider":
147
+ return a(V, {
148
+ value: e.value,
149
+ min: e.options?.min,
150
+ max: e.options?.max,
151
+ step: e.options?.step,
152
+ "onUpdate:value": t
153
+ }, null);
154
+ case "image":
155
+ return a(Q, {
156
+ value: e.value,
157
+ onUpdateValue: t
158
+ }, null);
159
+ default:
160
+ return null;
161
+ }
162
+ };
163
+ return F(() => n.data, (e) => {
164
+ e && p(e);
165
+ }, {
166
+ immediate: !1
167
+ }), H(() => {
168
+ r.value && l.value && (s(r.value, l.value), p(n.data));
169
+ }), R(() => {
170
+ v();
171
+ }), () => a(L, {
172
+ class: "h-full",
173
+ shadow: !0
174
+ }, {
175
+ default: () => [a("div", {
176
+ class: "h-full flex"
177
+ }, [a(K, {
178
+ onAddElement: g,
179
+ canvasWidth: o.value.width,
180
+ canvasHeight: o.value.height
181
+ }, null), a("div", {
182
+ ref: l,
183
+ class: "flex-1 p-6 pl-12 pt-12 flex items-center justify-center overflow-hidden relative",
184
+ style: "background: linear-gradient(45deg, rgba(0,0,0, 0.1) 25%, transparent 25%), linear-gradient(-45deg, rgba(0,0,0, 0.1) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(0,0,0, 0.1) 75%), linear-gradient(-45deg, transparent 75%, rgba(0,0,0, 0.1) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px;"
185
+ }, [a(G, {
186
+ canvasScale: d.value,
187
+ canvasWidth: o.value.width,
188
+ canvasHeight: o.value.height
189
+ }, null), a("div", {
190
+ class: "bg-default shadow-lg",
191
+ style: "position: relative;"
192
+ }, [a("canvas", {
193
+ ref: r,
194
+ style: "display: block;"
195
+ }, null)])]), a(O, {
196
+ onClearCanvas: E,
197
+ hasMultipleSelection: w.value,
198
+ selectedElementsCount: S.value.length,
199
+ currentElementData: i.value || void 0,
200
+ currentElementConfig: U.value || void 0,
201
+ canMoveUp: C.value,
202
+ canMoveDown: b.value,
203
+ canMoveToFront: k.value,
204
+ canMoveToBack: x.value,
205
+ canvasWidth: o.value.width,
206
+ canvasHeight: o.value.height,
207
+ canvasBackgroundColor: o.value.backgroundColor,
208
+ canvasBackgroundImage: o.value.backgroundImage,
209
+ onDeleteSelectedElements: f,
210
+ onAlignElements: (e) => h(e),
211
+ onUpdateElementProperty: u,
212
+ onUpdateCanvasSize: (e, t) => y(e, t),
213
+ onUpdateCanvasBackground: D,
214
+ onUpdateCanvasBackgroundImage: M,
215
+ onSaveData: async () => {
216
+ await I(), await n?.onSave?.();
217
+ },
218
+ onExportJson: N,
219
+ onRenderToolbarControl: B,
220
+ canvasScale: d.value
221
+ }, null)])]
222
+ });
223
+ }
224
+ });
225
+ export {
226
+ qe as DuxPosterEditor
227
+ };
@@ -6,6 +6,17 @@ import { useAction as de } from "../../hooks/action.js";
6
6
  import "@overlastic/vue";
7
7
  import "clsx";
8
8
  import "vue-echarts";
9
+ import "vue3-ace-editor";
10
+ import "ace-builds/src-noconflict/mode-vue";
11
+ import "ace-builds/src-noconflict/mode-javascript";
12
+ import "ace-builds/src-noconflict/mode-html";
13
+ import "ace-builds/src-noconflict/mode-json";
14
+ import "ace-builds/src-noconflict/mode-json5";
15
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
16
+ import "ace-builds/src-noconflict/theme-tomorrow";
17
+ import "ace-builds/src-noconflict/ext-searchbox";
18
+ import "ace-builds/src-noconflict/ext-language_tools";
19
+ import "ace-builds/src-noconflict/mode-snippets";
9
20
  import "vue-cropper";
10
21
  import pe from "../modal/modalPage.js";
11
22
  import "jinrishici";
@@ -30,28 +41,19 @@ import { DuxPage as me } from "../../pages/page.js";
30
41
  import "../../pages/page404.js";
31
42
  import { DuxPageEmpty as fe } from "../../pages/pageEmpty.js";
32
43
  import "@iconify-json/tabler/icons.json";
44
+ import "../image/elements/index.js";
45
+ import "fabric";
46
+ import "mime";
33
47
  import { DuxTableFilter as ge } from "./filter.js";
34
48
  import { DuxFilterLayout as he } from "./filterLayout.js";
35
49
  import { DuxTableTools as ve } from "./tools.js";
36
- import "mime";
37
- import "vue3-ace-editor";
38
- import "ace-builds/src-noconflict/mode-vue";
39
- import "ace-builds/src-noconflict/mode-javascript";
40
- import "ace-builds/src-noconflict/mode-html";
41
- import "ace-builds/src-noconflict/mode-json";
42
- import "ace-builds/src-noconflict/mode-json5";
43
- import "ace-builds/src-noconflict/theme-tomorrow_night";
44
- import "ace-builds/src-noconflict/theme-tomorrow";
45
- import "ace-builds/src-noconflict/ext-searchbox";
46
- import "ace-builds/src-noconflict/ext-language_tools";
47
- import "ace-builds/src-noconflict/mode-snippets";
48
50
  import "dayjs";
49
51
  import "@tanstack/vue-query";
50
52
  import "pinia";
51
53
  function be(t) {
52
54
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
53
55
  }
54
- const gt = /* @__PURE__ */ Y({
56
+ const vt = /* @__PURE__ */ Y({
55
57
  name: "DuxListLayout",
56
58
  props: {
57
59
  rowKey: {
@@ -425,5 +427,5 @@ const gt = /* @__PURE__ */ Y({
425
427
  }
426
428
  });
427
429
  export {
428
- gt as DuxListLayout
430
+ vt as DuxListLayout
429
431
  };