jvs-ppt-ui 0.0.12 → 0.0.15

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 (66) hide show
  1. package/dist/lib/check_imgs.html +18 -0
  2. package/dist/lib/jvs-ppt-ui/iconfont/iconfont.css +187 -27
  3. package/dist/lib/jvs-ppt-ui/iconfont/iconfont.js +1 -1
  4. package/dist/lib/jvs-ppt-ui/iconfont/iconfont.json +345 -65
  5. package/dist/lib/jvs-ppt-ui/iconfont/iconfont.ttf +0 -0
  6. package/dist/lib/jvs-ppt-ui/iconfont/iconfont.woff +0 -0
  7. package/dist/lib/jvs-ppt-ui/iconfont/iconfont.woff2 +0 -0
  8. package/dist/lib/jvs-ppt-ui/img/al.png +0 -0
  9. package/dist/lib/jvs-ppt-ui/img/d.png +0 -0
  10. package/dist/lib/jvs-ppt-ui/img/dl.png +0 -0
  11. package/dist/lib/jvs-ppt-ui/img/l.png +0 -0
  12. package/dist/lib/jvs-ppt-ui.es.js +38582 -37350
  13. package/dist/lib/jvs-ppt-ui.umd.js +98 -98
  14. package/dist/lib/style.css +1 -1
  15. package/package.json +1 -1
  16. package/scripts/check-icons.mjs +22 -0
  17. package/scripts/patch-anim-icons.mjs +45 -0
  18. package/src/App.vue +3 -3
  19. package/src/assets/iconfont/iconfont.css +187 -27
  20. package/src/assets/iconfont/iconfont.js +1 -1
  21. package/src/assets/iconfont/iconfont.json +345 -65
  22. package/src/assets/iconfont/iconfont.ttf +0 -0
  23. package/src/assets/iconfont/iconfont.woff +0 -0
  24. package/src/assets/iconfont/iconfont.woff2 +0 -0
  25. package/src/components/CanvasArea.vue +210 -83
  26. package/src/components/ChartTypeSelector.vue +505 -148
  27. package/src/components/Header.vue +292 -39
  28. package/src/components/PresentationMode.vue +2 -1
  29. package/src/components/QuickBorderPopover.vue +51 -11
  30. package/src/components/QuickColorPopover.vue +65 -21
  31. package/src/components/SidebarLeft.vue +194 -92
  32. package/src/components/SidebarRight.vue +39 -35
  33. package/src/components/TemplateGallery.vue +1153 -1182
  34. package/src/components/ToastNotification.vue +2 -2
  35. package/src/components/Toolbar.vue +825 -733
  36. package/src/components/canvas/CanvasQuickToolbar.vue +17 -30
  37. package/src/components/canvas/elements/CanvasGroupElement.vue +6 -0
  38. package/src/components/canvas/elements/CanvasShapeElement.vue +113 -10
  39. package/src/components/canvas/elements/CanvasTextElement.vue +4 -3
  40. package/src/components/sidebar/common/SidebarAlignGroup.vue +104 -50
  41. package/src/components/sidebar/common/SidebarBorderAccordion.vue +373 -146
  42. package/src/components/sidebar/common/SidebarPositionGroup.vue +358 -149
  43. package/src/components/sidebar/common/SidebarReflectionAccordion.vue +429 -203
  44. package/src/components/sidebar/common/SidebarShadowAccordion.vue +844 -416
  45. package/src/components/sidebar/panels/GradientEditor.vue +671 -316
  46. package/src/components/sidebar/panels/LayoutThumbSvg.vue +33 -16
  47. package/src/components/sidebar/panels/SidebarAnimationPanel.vue +701 -138
  48. package/src/components/sidebar/panels/SidebarDesignPanel.vue +1596 -419
  49. package/src/components/sidebar/panels/SidebarMediaFormatPanel.vue +12 -0
  50. package/src/components/sidebar/panels/SidebarShapeFormatPanel.vue +652 -173
  51. package/src/components/sidebar/panels/SidebarTextFormatPanel.vue +1938 -1427
  52. package/src/components/sidebar/panels/SidebarTransitionPanel.vue +780 -210
  53. package/src/composables/canvas/useCanvasShortcuts.ts +20 -6
  54. package/src/composables/canvas/useCanvasText.ts +1 -1
  55. package/src/composables/canvas/useCanvasTransform.ts +20 -0
  56. package/src/composables/presetThemes.ts +43 -44
  57. package/src/composables/sidebar/useSidebarAnimation.ts +101 -25
  58. package/src/composables/sidebar/useSidebarDesign.ts +30 -11
  59. package/src/composables/sidebar/useSidebarElementTransform.ts +27 -5
  60. package/src/composables/sidebar/useSidebarImage.ts +10 -2
  61. package/src/composables/sidebar/useSidebarShapeFormat.ts +323 -99
  62. package/src/composables/useSlides.ts +338 -162
  63. package/src/main.ts +2 -0
  64. package/src/style.css +924 -359
  65. package/src/utils/canvas/elementStyles.ts +20 -1
  66. package/src/utils/groupFlip.ts +108 -0
@@ -1,6 +1,7 @@
1
1
  import { computed, type Ref, type ComputedRef } from 'vue'
2
2
  import { shapeFormulas } from '../../utils/pptxShapesLazy'
3
3
  import { useSlides } from '../useSlides'
4
+ import { applyGroupGeometryFlip } from '../../utils/groupFlip'
4
5
 
5
6
  export function useSidebarElementTransform(
6
7
  selectedElement: ComputedRef<any>,
@@ -59,34 +60,49 @@ export function useSidebarElementTransform(
59
60
  if (el) el.order = idx + 1
60
61
  })
61
62
  addHistorySnapshot()
63
+ if (activeSlideVersion) activeSlideVersion.value++
62
64
  }
63
65
 
64
66
  function toggleFlipH() {
65
67
  if (selectedElementIds.value.length > 1 && activeSlide.value) {
66
68
  activeSlide.value.elements.forEach((el: any) => {
67
69
  if (selectedElementIds.value.includes(el.id)) {
68
- if (!el.style) el.style = {}
69
- el.style.flipH = !el.style.flipH
70
+ if (el.type === 'group') {
71
+ applyGroupGeometryFlip(el, true, false)
72
+ } else {
73
+ if (!el.style) el.style = {}
74
+ el.style.flipH = !el.style.flipH
75
+ }
70
76
  }
71
77
  })
78
+ } else if (selectedElement.value && selectedElement.value.type === 'group') {
79
+ applyGroupGeometryFlip(selectedElement.value, true, false)
72
80
  } else {
73
81
  getStyle().flipH = !getStyle().flipH
74
82
  }
75
83
  addHistorySnapshot()
84
+ if (activeSlideVersion) activeSlideVersion.value++
76
85
  }
77
86
 
78
87
  function toggleFlipV() {
79
88
  if (selectedElementIds.value.length > 1 && activeSlide.value) {
80
89
  activeSlide.value.elements.forEach((el: any) => {
81
90
  if (selectedElementIds.value.includes(el.id)) {
82
- if (!el.style) el.style = {}
83
- el.style.flipV = !el.style.flipV
91
+ if (el.type === 'group') {
92
+ applyGroupGeometryFlip(el, false, true)
93
+ } else {
94
+ if (!el.style) el.style = {}
95
+ el.style.flipV = !el.style.flipV
96
+ }
84
97
  }
85
98
  })
99
+ } else if (selectedElement.value && selectedElement.value.type === 'group') {
100
+ applyGroupGeometryFlip(selectedElement.value, false, true)
86
101
  } else {
87
102
  getStyle().flipV = !getStyle().flipV
88
103
  }
89
104
  addHistorySnapshot()
105
+ if (activeSlideVersion) activeSlideVersion.value++
90
106
  }
91
107
 
92
108
  function getParentGroup(el: any): any {
@@ -116,7 +132,7 @@ export function useSidebarElementTransform(
116
132
  return { width: logicalWidth.value, height: logicalHeight.value }
117
133
  }
118
134
 
119
- const { isCanvasDragging } = useSlides()
135
+ const { isCanvasDragging, activeSlideVersion } = useSlides()
120
136
  let cachedX = 0
121
137
  let cachedY = 0
122
138
 
@@ -163,6 +179,7 @@ export function useSidebarElementTransform(
163
179
  }
164
180
  }
165
181
  addHistorySnapshot()
182
+ if (activeSlideVersion) activeSlideVersion.value++
166
183
  }
167
184
  })
168
185
 
@@ -209,6 +226,7 @@ export function useSidebarElementTransform(
209
226
  }
210
227
  }
211
228
  addHistorySnapshot()
229
+ if (activeSlideVersion) activeSlideVersion.value++
212
230
  }
213
231
  })
214
232
 
@@ -228,6 +246,7 @@ export function useSidebarElementTransform(
228
246
  })
229
247
  }
230
248
  addHistorySnapshot()
249
+ if (activeSlideVersion) activeSlideVersion.value++
231
250
  }
232
251
  })
233
252
 
@@ -344,6 +363,7 @@ export function useSidebarElementTransform(
344
363
  }
345
364
  }
346
365
  addHistorySnapshot()
366
+ if (activeSlideVersion) activeSlideVersion.value++
347
367
  }
348
368
  })
349
369
 
@@ -475,6 +495,7 @@ export function useSidebarElementTransform(
475
495
  }
476
496
  }
477
497
  addHistorySnapshot()
498
+ if (activeSlideVersion) activeSlideVersion.value++
478
499
  }
479
500
  })
480
501
 
@@ -484,6 +505,7 @@ export function useSidebarElementTransform(
484
505
  },
485
506
  set(val: number) {
486
507
  setStyleVal('rotate', val)
508
+ if (activeSlideVersion) activeSlideVersion.value++
487
509
  }
488
510
  })
489
511
 
@@ -204,8 +204,16 @@ export function useSidebarImage(
204
204
 
205
205
  function setImageAsBackground() {
206
206
  if (selectedElement.value && activeSlide.value) {
207
- activeSlide.value.background = `url(${selectedElement.value.content}) center center / cover no-repeat`
208
- notify('已成功将图片设为幻灯片背景')
207
+ const src = selectedElement.value.content || selectedElement.value.src
208
+ if (src) {
209
+ ;(activeSlide.value as any).bgImageMode = 'stretch'
210
+ ;(activeSlide.value as any).isPattern = false
211
+ ;(activeSlide.value as any)._lastBgImageUrl = src
212
+ activeSlide.value.background = `url("${src}") center center / 100% 100% no-repeat`
213
+ activeSlide.value.bgType = 'image'
214
+ addHistorySnapshot()
215
+ notify('已成功将图片设为幻灯片背景')
216
+ }
209
217
  }
210
218
  }
211
219