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
@@ -12,6 +12,8 @@ import {
12
12
  inferElementTextType,
13
13
  normalizeTextType
14
14
  } from '../utils/textTypes'
15
+ import { applyGroupGeometryFlip } from '../utils/groupFlip'
16
+ import { getFontVariants, getFontVariantStyle } from '../configs/fonts'
15
17
  import type { CustomUploadHandler, UploadResourceContext, UploadResourceType } from '../types'
16
18
 
17
19
  export type { SlideTextType }
@@ -64,6 +66,8 @@ export interface SlideElement {
64
66
  link?: string
65
67
  locked?: boolean
66
68
  isMaster?: boolean
69
+ isPlaceholder?: boolean
70
+ placeholder?: any
67
71
  hasCustomZIndex?: boolean
68
72
  groupId?: string
69
73
  elements?: SlideElement[]
@@ -265,6 +269,10 @@ export interface Slide {
265
269
  notes?: string
266
270
  animations?: PPTAnimation[]
267
271
  transition?: string
272
+ transitionDuration?: number
273
+ autoAdvance?: boolean
274
+ autoAdvanceDelay?: number
275
+ clickAdvance?: boolean
268
276
  schema?: any
269
277
  }
270
278
 
@@ -340,15 +348,15 @@ function setAiConfig(config?: { apiUrl?: string; headers?: Record<string, string
340
348
  }
341
349
  }
342
350
 
343
- // 素材库配置状态(支持获取分类树/首页、分页查询、获取单独类型、素材保存 API)
344
- export const DEFAULT_MATERIAL_API_URL = '/jvs-dam/api/dam/material/tree'
345
- export const DEFAULT_MATERIAL_PAGE_API_URL = '/jvs-dam/api/dam/material/page'
351
+ // 素材库配置状态(公网免版权素材检索 stock/search、单页模板、素材保存 API)
352
+ export const DEFAULT_MATERIAL_API_URL = '/jvs-dam/stock/search'
353
+ export const DEFAULT_MATERIAL_PAGE_API_URL = '/jvs-dam/stock/search'
346
354
 
347
355
  const defaultEnvMaterialUrl = (typeof import.meta !== 'undefined' && (import.meta as any).env)
348
- ? String((import.meta as any).env?.VITE_MATERIAL_TREE_API_URL || (import.meta as any).env?.VITE_MATERIAL_API_URL || (import.meta as any).env?.VITE_MATERIAL_LIST_API_URL || DEFAULT_MATERIAL_API_URL)
356
+ ? String((import.meta as any).env?.VITE_MATERIAL_STOCK_API_URL || (import.meta as any).env?.VITE_MATERIAL_API_URL || (import.meta as any).env?.VITE_MATERIAL_LIST_API_URL || (import.meta as any).env?.VITE_MATERIAL_TREE_API_URL || DEFAULT_MATERIAL_API_URL)
349
357
  : DEFAULT_MATERIAL_API_URL
350
358
  const defaultEnvMaterialPageUrl = (typeof import.meta !== 'undefined' && (import.meta as any).env)
351
- ? String((import.meta as any).env?.VITE_MATERIAL_PAGE_API_URL || DEFAULT_MATERIAL_PAGE_API_URL)
359
+ ? String((import.meta as any).env?.VITE_MATERIAL_PAGE_API_URL || (import.meta as any).env?.VITE_MATERIAL_STOCK_API_URL || DEFAULT_MATERIAL_PAGE_API_URL)
352
360
  : DEFAULT_MATERIAL_PAGE_API_URL
353
361
  const defaultEnvMaterialTypeUrl = (typeof import.meta !== 'undefined' && (import.meta as any).env?.VITE_MATERIAL_TYPE_API_URL)
354
362
  ? String((import.meta as any).env.VITE_MATERIAL_TYPE_API_URL)
@@ -357,11 +365,11 @@ const defaultEnvMaterialSaveUrl = (typeof import.meta !== 'undefined' && (import
357
365
  ? String((import.meta as any).env.VITE_MATERIAL_SAVE_API_URL)
358
366
  : ''
359
367
 
360
- /** 素材库获取所有内容/首页分类树的 API 地址 */
368
+ /** 素材库检索公网素材/所有内容的 API 地址 */
361
369
  const materialApiUrl = ref<string>(defaultEnvMaterialUrl)
362
- /** 素材库首页分类树 API 地址 */
370
+ /** 素材库首页/分类检索 API 地址 */
363
371
  const materialTreeApiUrl = ref<string>(defaultEnvMaterialUrl)
364
- /** 素材库分页查询 API 地址 */
372
+ /** 素材库分页/关键词检索 API 地址 */
365
373
  const materialPageApiUrl = ref<string>(defaultEnvMaterialPageUrl)
366
374
  /** 素材库按类型获取单独分类素材的 API 地址 */
367
375
  const materialTypeApiUrl = ref<string>(defaultEnvMaterialTypeUrl)
@@ -821,18 +829,17 @@ export function createDefaultSlideMasters(W: number = 1280, H: number = 720): Sl
821
829
  type: 'shape',
822
830
  name: '图片占位符',
823
831
  content: 'rect',
824
- text: '<div>图片占位符</div>',
832
+ text: '',
833
+ isPlaceholder: true,
834
+ placeholder: { type: 'image', prompt: '图片占位符' },
825
835
  style: {
826
836
  left: `${marginX}px`,
827
837
  top: '80px',
828
838
  width: `${colW}px`,
829
839
  height: `${Math.max(200, H - 80 - 55)}px`,
830
- fill: '#f8fafc',
831
- borderColor: '#cbd5e1',
832
- borderWidth: '1px',
833
- borderStyle: 'dashed',
834
- borderRadius: '4px',
835
- textColor: '#94a3b8',
840
+ fill: '#d9dde3',
841
+ borderRadius: '12px',
842
+ textColor: '#475569',
836
843
  fontSize: '16px',
837
844
  textAlign: 'center'
838
845
  }
@@ -1023,20 +1030,33 @@ function applyBackgroundToAll() {
1023
1030
  if (!activeSlide.value) return
1024
1031
  const bg = activeSlide.value.background
1025
1032
  const type = activeSlide.value.bgType || 'color'
1033
+ const imgMode = (activeSlide.value as any).bgImageMode
1034
+ const isPattern = (activeSlide.value as any).isPattern
1035
+ const lastImgUrl = (activeSlide.value as any)._lastBgImageUrl
1026
1036
  slides.value.forEach(slide => {
1027
1037
  slide.background = bg
1028
1038
  slide.bgType = type
1039
+ if (imgMode !== undefined) (slide as any).bgImageMode = imgMode
1040
+ if (isPattern !== undefined) (slide as any).isPattern = isPattern
1041
+ if (lastImgUrl !== undefined) (slide as any)._lastBgImageUrl = lastImgUrl
1029
1042
  })
1030
1043
  if (isMasterEditingView.value || slideMasters.value.length > 0) {
1031
1044
  slideMasters.value.forEach(m => {
1032
1045
  m.background = bg
1033
1046
  m.bgType = type
1047
+ if (imgMode !== undefined) (m as any).bgImageMode = imgMode
1048
+ if (isPattern !== undefined) (m as any).isPattern = isPattern
1049
+ if (lastImgUrl !== undefined) (m as any)._lastBgImageUrl = lastImgUrl
1034
1050
  m.layouts?.forEach(l => {
1035
1051
  l.background = bg
1036
1052
  l.bgType = type
1053
+ if (imgMode !== undefined) (l as any).bgImageMode = imgMode
1054
+ if (isPattern !== undefined) (l as any).isPattern = isPattern
1055
+ if (lastImgUrl !== undefined) (l as any)._lastBgImageUrl = lastImgUrl
1037
1056
  })
1038
1057
  })
1039
1058
  }
1059
+ addHistorySnapshot()
1040
1060
  notify('已应用背景到全部幻灯片')
1041
1061
  }
1042
1062
 
@@ -1098,13 +1118,139 @@ function applyThemeToAll() {
1098
1118
  }
1099
1119
 
1100
1120
  function applyFontToAll() {
1101
- slides.value.forEach(slide => {
1102
- slide.elements.forEach(el => {
1103
- if (el.type === 'text') {
1104
- el.style.fontFamily = globalFontFamily.value
1121
+ const rawFont = globalFontFamily.value
1122
+ const hasExplicitFont = Boolean(rawFont && rawFont !== '默认字体')
1123
+ const targetColor = globalFontColor.value
1124
+
1125
+ const updateHtmlFontAndColor = (htmlStr: string, effectiveFont: string) => {
1126
+ if (!htmlStr || typeof htmlStr !== 'string') return htmlStr
1127
+ let res = htmlStr
1128
+ if (/font-family\s*:/i.test(res)) {
1129
+ res = res.replace(/font-family\s*:\s*[^;'"\}]+;?/gi, `font-family: ${effectiveFont};`)
1130
+ }
1131
+ if (/<font\b[^>]*\bface=/i.test(res)) {
1132
+ res = res.replace(/(<font\b[^>]*?\bface\s*=\s*['"])([^'"]+)(['"])/gi, `$1${effectiveFont}$3`)
1133
+ }
1134
+ if (targetColor) {
1135
+ if (/(?:^|[;"'\s\{])color\s*:/i.test(res)) {
1136
+ res = res.replace(/(^|[;"'\s\{])(color\s*:\s*)([^;'"\}]+)/gi, `$1$2${targetColor}`)
1137
+ }
1138
+ if (/<font\b[^>]*\bcolor=/i.test(res)) {
1139
+ res = res.replace(/(<font\b[^>]*?\bcolor\s*=\s*['"])([^'"]+)(['"])/gi, `$1${targetColor}$3`)
1140
+ }
1141
+ }
1142
+ return res
1143
+ }
1144
+
1145
+ const applyToElementList = (elements: any[], slideRecipe: any) => {
1146
+ if (!Array.isArray(elements)) return
1147
+ elements.forEach((el: any) => {
1148
+ if (!el || typeof el !== 'object') return
1149
+ if (el.type === 'group' && Array.isArray(el.elements)) {
1150
+ applyToElementList(el.elements, slideRecipe)
1151
+ return
1152
+ }
1153
+ if (el.type === 'text' || el.type === 'shape') {
1154
+ if (!el.style) el.style = {}
1155
+ const isHeading = el.textType === 'title' || el.textType === 'headline' || (el.id && String(el.id).startsWith('title'))
1156
+ const fallbackFont = isHeading
1157
+ ? (slideRecipe?.styleFonts?.titleFont || 'SourceHanSansCN')
1158
+ : (slideRecipe?.styleFonts?.bodyFont || 'SourceHanSansCN')
1159
+ const effectiveFont = hasExplicitFont ? rawFont : fallbackFont
1160
+
1161
+ el.style.fontFamily = hasExplicitFont ? rawFont : effectiveFont
1162
+ el.fontFamily = hasExplicitFont ? rawFont : effectiveFont
1163
+
1164
+ const variants = getFontVariants(effectiveFont)
1165
+ const firstVariant = variants[0]?.value || 'Regular'
1166
+ el.style.fontFamilyStyle = firstVariant
1167
+ const vStyle = getFontVariantStyle(effectiveFont, firstVariant)
1168
+ if (vStyle) {
1169
+ el.style.fontWeight = vStyle.fontWeight
1170
+ el.style.fontStyle = vStyle.fontStyle
1171
+ if (vStyle.faceName) {
1172
+ ;(el.style as any).fontVariantFace = vStyle.faceName
1173
+ } else {
1174
+ delete (el.style as any).fontVariantFace
1175
+ }
1176
+ }
1177
+
1178
+ if (targetColor) {
1179
+ el.style.color = targetColor
1180
+ el.style.textColor = targetColor
1181
+ el.color = targetColor
1182
+ el.textColor = targetColor
1183
+ if (el.text && typeof el.text === 'object') {
1184
+ el.text.defaultColor = targetColor
1185
+ }
1186
+ }
1187
+
1188
+ if (el.content && typeof el.content === 'string') {
1189
+ el.content = updateHtmlFontAndColor(el.content, effectiveFont)
1190
+ }
1191
+ if (el.text) {
1192
+ if (typeof el.text === 'string') {
1193
+ el.text = updateHtmlFontAndColor(el.text, effectiveFont)
1194
+ } else if (typeof el.text.content === 'string') {
1195
+ el.text.content = updateHtmlFontAndColor(el.text.content, effectiveFont)
1196
+ }
1197
+ }
1198
+
1199
+ if (typeof document !== 'undefined') {
1200
+ const container = document.getElementById(`editable-${el.id}`)
1201
+ if (container) {
1202
+ container.style.fontFamily = effectiveFont
1203
+ if (targetColor) {
1204
+ container.style.color = targetColor
1205
+ }
1206
+ container.querySelectorAll('*').forEach((child: any) => {
1207
+ if (child.style) {
1208
+ if (child.style.fontFamily) {
1209
+ child.style.fontFamily = effectiveFont
1210
+ }
1211
+ if (targetColor && child.style.color) {
1212
+ child.style.color = targetColor
1213
+ }
1214
+ }
1215
+ if (child.tagName === 'FONT') {
1216
+ child.setAttribute('face', effectiveFont)
1217
+ child.style.fontFamily = effectiveFont
1218
+ if (targetColor) {
1219
+ child.setAttribute('color', targetColor)
1220
+ child.style.color = targetColor
1221
+ }
1222
+ }
1223
+ })
1224
+ if (!el.content || !el.content.includes('<table')) {
1225
+ if (el.type === 'shape') {
1226
+ if (typeof el.text === 'string') {
1227
+ el.text = container.innerHTML
1228
+ } else if (el.text && typeof el.text === 'object') {
1229
+ el.text.content = container.innerHTML
1230
+ }
1231
+ } else {
1232
+ el.content = container.innerHTML
1233
+ }
1234
+ }
1235
+ }
1236
+ }
1105
1237
  }
1106
1238
  })
1239
+ }
1240
+
1241
+ slides.value.forEach(slide => {
1242
+ const slideRecipe = getActiveSlideThemeRecipe(slide)
1243
+ applyToElementList(slide.elements, slideRecipe)
1107
1244
  })
1245
+
1246
+ if (isMasterEditingView.value && activeSlide.value?.elements) {
1247
+ const masterRecipe = getActiveSlideThemeRecipe(activeSlide.value)
1248
+ applyToElementList(activeSlide.value.elements, masterRecipe)
1249
+ }
1250
+
1251
+ markAllPagesDirty()
1252
+ addHistorySnapshot()
1253
+ activeSlideVersion.value++
1108
1254
  notify('已统一全局字体')
1109
1255
  }
1110
1256
 
@@ -1645,6 +1791,24 @@ function resolveSlideMasterAndLayout(slide?: any): { masterId: string, layoutId:
1645
1791
  }
1646
1792
  }
1647
1793
 
1794
+ function formatBareUrlWithMode(bg: any, mode?: string, isPattern?: boolean): any {
1795
+ if (typeof bg !== 'string') return bg
1796
+ const trimmed = bg.trim()
1797
+ if (!trimmed.startsWith('url(')) return bg
1798
+ const closeParenIdx = trimmed.lastIndexOf(')')
1799
+ if (closeParenIdx === -1) return bg
1800
+ const afterUrl = trimmed.slice(closeParenIdx + 1).trim()
1801
+ if (afterUrl) return bg
1802
+ const urlPart = trimmed.slice(0, closeParenIdx + 1)
1803
+ if (trimmed.includes('data:image/svg+xml') || isPattern) {
1804
+ return `${urlPart} left top / auto repeat`
1805
+ }
1806
+ if (mode === 'contain') return `${urlPart} center center / contain no-repeat`
1807
+ if (mode === 'cover') return `${urlPart} center center / 60% auto no-repeat`
1808
+ if (mode === 'tile') return `${urlPart} left top / 25% auto repeat`
1809
+ return `${urlPart} center center / 100% 100% no-repeat`
1810
+ }
1811
+
1648
1812
  export function getEffectiveSlideBackground(slide?: any): any {
1649
1813
  if (!slide) return '#ffffff'
1650
1814
 
@@ -1652,16 +1816,30 @@ export function getEffectiveSlideBackground(slide?: any): any {
1652
1816
  if (isMasterEditingView.value) {
1653
1817
  const master = slideMasters.value.find(m => m.id === activeMasterId.value) || slideMasters.value[0]
1654
1818
  const layout = activeLayoutId.value ? master?.layouts?.find(l => l.id === activeLayoutId.value) : null
1655
- return layout?.background || master?.background || '#ffffff'
1819
+ if (layout?.background && layout.background !== '#ffffff' && layout.background !== 'none') {
1820
+ return formatBareUrlWithMode(layout.background, (layout as any).bgImageMode, (layout as any).isPattern)
1821
+ }
1822
+ if (master?.background) {
1823
+ return formatBareUrlWithMode(master.background, (master as any).bgImageMode, (master as any).isPattern)
1824
+ }
1825
+ return '#ffffff'
1656
1826
  }
1657
1827
 
1658
1828
  // 2. 如果当前幻灯片自身设置了明确的独立自定义背景(包含 url、gradient 或非白色自定义色)
1659
- const directBg = slide.schema?.bgColor || slide.background || slide.fill
1829
+ const hasSlideBgSpecial = typeof slide.background === 'string' && (
1830
+ slide.background.includes('url(') ||
1831
+ slide.background.includes('gradient(') ||
1832
+ slide.bgType === 'image' ||
1833
+ slide.bgType === 'gradient'
1834
+ )
1835
+ const directBg = hasSlideBgSpecial
1836
+ ? (slide.background || slide.fill || slide.schema?.bgColor)
1837
+ : (slide.schema?.bgColor || slide.background || slide.fill)
1660
1838
  if (directBg) {
1661
1839
  if (typeof directBg === 'string') {
1662
1840
  const trimmed = directBg.trim().toLowerCase()
1663
1841
  if (trimmed.includes('url(') || trimmed.includes('gradient(') || (!['#ffffff', '#fff', 'white', 'transparent', 'none', ''].includes(trimmed))) {
1664
- return directBg
1842
+ return formatBareUrlWithMode(directBg, slide.bgImageMode, slide.isPattern)
1665
1843
  }
1666
1844
  } else if (typeof directBg === 'object' && (directBg.image || directBg.gradient || (directBg.color && !['#ffffff', '#fff', 'white'].includes(String(directBg.color).toLowerCase())))) {
1667
1845
  return directBg
@@ -1674,13 +1852,13 @@ export function getEffectiveSlideBackground(slide?: any): any {
1674
1852
  const layout = layoutId && master ? master.layouts?.find(l => l && l.id === layoutId) : null
1675
1853
 
1676
1854
  if (layout?.background && layout.background !== '#ffffff' && layout.background !== 'none') {
1677
- return layout.background
1855
+ return formatBareUrlWithMode(layout.background, (layout as any).bgImageMode, (layout as any).isPattern)
1678
1856
  }
1679
1857
  if (master?.background && master.background !== '#ffffff' && master.background !== 'none') {
1680
- return master.background
1858
+ return formatBareUrlWithMode(master.background, (master as any).bgImageMode, (master as any).isPattern)
1681
1859
  }
1682
1860
 
1683
- return directBg || '#ffffff'
1861
+ return directBg ? formatBareUrlWithMode(directBg, slide.bgImageMode, slide.isPattern) : '#ffffff'
1684
1862
  }
1685
1863
 
1686
1864
  function applyStyleRecipeToMaster(
@@ -2032,8 +2210,8 @@ function getThemeUsageSlides(themeId: string): number[] {
2032
2210
  const pages: number[] = []
2033
2211
  const hasAnyExplicitTheme = slides.value.some(s => !!s.themeId)
2034
2212
  slides.value.forEach((slide, idx) => {
2035
- const effId = slide.themeId || (hasAnyExplicitTheme ? 'default-recipe' : 'default-recipe')
2036
- if (effId === themeId) {
2213
+ const effId = slide.themeId || (hasAnyExplicitTheme ? 'tech-blue' : 'tech-blue')
2214
+ if (effId === themeId || (themeId === 'tech-blue' && (effId === 'default-recipe' || !effId))) {
2037
2215
  pages.push(idx + 1)
2038
2216
  }
2039
2217
  })
@@ -2061,8 +2239,8 @@ function getActiveSlideThemeRecipe(targetSlide?: any): StyleRecipe {
2061
2239
  } else if (activeSlide.value) {
2062
2240
  effSlide = activeSlide.value
2063
2241
  }
2064
- const themeId = effSlide?.themeId || (isMasterEditingView.value ? ((slideMasters.value.find(m => m.id === activeMasterId.value) as any)?.themeId || 'default-recipe') : 'default-recipe')
2065
- const recipe = builtinStyleRecipes.find(r => r.id === themeId) || defaultStyleRecipe
2242
+ const themeId = effSlide?.themeId || (isMasterEditingView.value ? ((slideMasters.value.find(m => m.id === activeMasterId.value) as any)?.themeId || 'tech-blue') : 'tech-blue')
2243
+ const recipe = builtinStyleRecipes.find(r => r.id === themeId || (themeId === 'default-recipe' && r.id === 'tech-blue')) || defaultStyleRecipe
2066
2244
  return recipe
2067
2245
  }
2068
2246
 
@@ -2158,13 +2336,22 @@ const activeSlide = computed<Slide>({
2158
2336
  if (prop === 'id') return target.id
2159
2337
  if (prop === 'title') return target.name || '母版编辑'
2160
2338
  if (prop === 'subtitle') return ''
2161
- if (prop === 'background') return target.background || master?.background || '#ffffff'
2339
+ if (prop === 'background') return target.background !== undefined ? target.background : (master?.background || '#ffffff')
2162
2340
  if (prop === 'bgType') {
2163
2341
  if (target.bgType) return target.bgType
2164
2342
  if (master?.bgType) return master.bgType
2165
2343
  const effBg = target.background || master?.background
2166
2344
  return normalizeSlideBackground(effBg).bgType || 'color'
2167
2345
  }
2346
+ if (prop === 'bgImageMode') {
2347
+ return (target as any).bgImageMode || (master as any)?.bgImageMode || 'stretch'
2348
+ }
2349
+ if (prop === 'isPattern') {
2350
+ return (target as any).isPattern ?? (master as any)?.isPattern ?? false
2351
+ }
2352
+ if (prop === '_lastBgImageUrl') {
2353
+ return (target as any)._lastBgImageUrl !== undefined ? (target as any)._lastBgImageUrl : ((master as any)?._lastBgImageUrl || '')
2354
+ }
2168
2355
  if (prop === 'themeId') return target.themeId || (master as any)?.themeId || 'default-recipe'
2169
2356
  if (prop === 'themeName') return target.themeName || (master as any)?.themeName || ''
2170
2357
  if (prop === 'themeColors') return (master as any)?.themeColors || globalThemeColor.value
@@ -2172,10 +2359,16 @@ const activeSlide = computed<Slide>({
2172
2359
  if (!target.elements) target.elements = []
2173
2360
  // 确保版式或母版中的占位符存在于 target.elements 中,使用户在母版视图下可以直接点击选中、拖拽调整与编辑
2174
2361
  if (target.placeholders && Array.isArray(target.placeholders)) {
2175
- for (const ph of target.placeholders) {
2176
- if (!target.elements.some((el: any) => el.id === ph.id || (Math.abs((el.left || 0) - (ph.left || 0)) < 5 && Math.abs((el.top || 0) - (ph.top || 0)) < 5))) {
2177
- target.elements.push(ph)
2362
+ if (target.type === 'custom' && target.elements.length > 0) {
2363
+ target.placeholders = target.elements.filter((x: any) => x && (x.isPlaceholder || x.placeholder))
2364
+ target._placeholdersMerged = true
2365
+ } else if (!target._placeholdersMerged) {
2366
+ for (const ph of target.placeholders) {
2367
+ if (!target.elements.some((el: any) => el.id === ph.id || (Math.abs((el.left || 0) - (ph.left || 0)) < 5 && Math.abs((el.top || 0) - (ph.top || 0)) < 5))) {
2368
+ target.elements.push(ph)
2369
+ }
2178
2370
  }
2371
+ target._placeholdersMerged = true
2179
2372
  }
2180
2373
  }
2181
2374
  // 🌟 兜底保障:若当前选中的是顶级母版(target === master),且母版本身 elements 为空且无 placeholders(如自定义极简母版):
@@ -2219,27 +2412,39 @@ const activeSlide = computed<Slide>({
2219
2412
  if (prop === 'elements') {
2220
2413
  target.elements = value
2221
2414
  if (Array.isArray(value)) {
2222
- const phs = value.filter((x: any) => x && (x.isPlaceholder || x.placeholder))
2223
- if (phs.length > 0) {
2224
- target.placeholders = phs
2225
- }
2415
+ target.placeholders = value.filter((x: any) => x && (x.isPlaceholder || x.placeholder))
2226
2416
  }
2227
2417
  return true
2228
2418
  }
2229
2419
  if (prop === 'background') {
2420
+ const prevBg = target.background
2230
2421
  target.background = value
2231
2422
  if (target === master && master.layouts) {
2232
2423
  master.layouts.forEach((l: any) => {
2233
- if (!l.background || l.background === '#ffffff') l.background = value
2424
+ if (!l.background || l.background === '#ffffff' || l.background === prevBg) {
2425
+ l.background = value
2426
+ }
2234
2427
  })
2235
2428
  }
2236
2429
  return true
2237
2430
  }
2238
2431
  if (prop === 'bgType') {
2432
+ const prevType = target.bgType
2239
2433
  target.bgType = value
2240
2434
  if (target === master && master.layouts) {
2241
2435
  master.layouts.forEach((l: any) => {
2242
- if (!l.bgType || l.bgType === 'color') l.bgType = value
2436
+ if (!l.bgType || l.bgType === 'color' || l.bgType === prevType) {
2437
+ l.bgType = value
2438
+ }
2439
+ })
2440
+ }
2441
+ return true
2442
+ }
2443
+ if (prop === 'bgImageMode' || prop === 'isPattern' || prop === '_lastBgImageUrl') {
2444
+ target[prop] = value
2445
+ if (target === master && master.layouts) {
2446
+ master.layouts.forEach((l: any) => {
2447
+ l[prop] = value
2243
2448
  })
2244
2449
  }
2245
2450
  return true
@@ -2361,11 +2566,23 @@ const formatedAnimations = computed(() => {
2361
2566
  return formatted
2362
2567
  })
2363
2568
 
2569
+ function findElementInSlideElements(id: string, elements: any[] = activeSlide.value?.elements || []): any {
2570
+ if (!id || !elements || !elements.length) return null
2571
+ for (const el of elements) {
2572
+ if (el.id === id) return el
2573
+ if (el.type === 'group' && Array.isArray(el.elements)) {
2574
+ const found = findElementInSlideElements(id, el.elements)
2575
+ if (found) return found
2576
+ }
2577
+ }
2578
+ return null
2579
+ }
2580
+
2364
2581
  function addAnimation(type: 'in' | 'out' | 'attention', effect: string) {
2365
2582
  if (!activeSlide.value || !selectedElementId.value) return
2366
2583
  if (!activeSlide.value.animations) activeSlide.value.animations = []
2367
2584
 
2368
- const targetEl = activeSlide.value.elements.find(e => e.id === selectedElementId.value)
2585
+ const targetEl = findElementInSlideElements(selectedElementId.value, activeSlide.value.elements)
2369
2586
  if (!targetEl) return
2370
2587
 
2371
2588
  const groupId = targetEl.groupId
@@ -2399,7 +2616,7 @@ function deleteAnimation(id: string) {
2399
2616
  const targetAnim = activeSlide.value.animations.find(a => a.id === id)
2400
2617
  if (!targetAnim) return
2401
2618
 
2402
- const targetEl = activeSlide.value.elements.find(e => e.id === targetAnim.elId)
2619
+ const targetEl = findElementInSlideElements(targetAnim.elId, activeSlide.value.elements)
2403
2620
  const groupId = targetEl?.groupId
2404
2621
 
2405
2622
  if (groupId) {
@@ -2418,7 +2635,7 @@ function updateAnimationDuration(id: string, duration: number) {
2418
2635
  const targetAnim = activeSlide.value.animations.find(a => a.id === id)
2419
2636
  if (!targetAnim) return
2420
2637
 
2421
- const targetEl = activeSlide.value.elements.find(e => e.id === targetAnim.elId)
2638
+ const targetEl = findElementInSlideElements(targetAnim.elId, activeSlide.value.elements)
2422
2639
  const groupId = targetEl?.groupId
2423
2640
 
2424
2641
  if (groupId) {
@@ -2446,7 +2663,7 @@ function updateAnimationEffect(id: string, type: 'in' | 'out' | 'attention', eff
2446
2663
  const targetAnim = activeSlide.value.animations.find(a => a.id === id)
2447
2664
  if (!targetAnim) return
2448
2665
 
2449
- const targetEl = activeSlide.value.elements.find(e => e.id === targetAnim.elId)
2666
+ const targetEl = findElementInSlideElements(targetAnim.elId, activeSlide.value.elements)
2450
2667
  const groupId = targetEl?.groupId
2451
2668
 
2452
2669
  if (groupId) {
@@ -2462,6 +2679,15 @@ function updateAnimationEffect(id: string, type: 'in' | 'out' | 'attention', eff
2462
2679
  }
2463
2680
  }
2464
2681
 
2682
+ function updateAnimationTargetElement(id: string, newElId: string) {
2683
+ if (!activeSlide.value || !activeSlide.value.animations || !newElId) return
2684
+ const targetAnim = activeSlide.value.animations.find(a => a.id === id)
2685
+ if (!targetAnim) return
2686
+ targetAnim.elId = newElId
2687
+ addHistorySnapshot()
2688
+ notify('已将动画修改到对应元素')
2689
+ }
2690
+
2465
2691
  function updateAnimationOrder(oldIndex: number, newIndex: number) {
2466
2692
  if (!activeSlide.value || !activeSlide.value.animations) return
2467
2693
  if (oldIndex === undefined || newIndex === undefined || oldIndex === newIndex) return
@@ -4029,8 +4255,10 @@ function addElement(
4029
4255
  const typeConf = TEXT_TYPE_CONFIGS[textType] || TEXT_TYPE_CONFIGS.normalText
4030
4256
  const textCfg = recipe.textStyles?.[textType] || defaultStyleRecipe.textStyles[textType] || defaultStyleRecipe.textStyles.normalText
4031
4257
  const isHeading = textType === 'title' || textType === 'headline'
4032
- const textFont = textCfg.fontFamily || (isHeading ? (recipe.styleFonts?.titleFont || 'SourceHanSansCN') : (recipe.styleFonts?.bodyFont || 'SourceHanSansCN'))
4033
- const textColor = textCfg.color || (textType === 'smallText' ? '#64748b' : (isHeading ? (recipe.textStyles?.title?.color || '#0f172a') : (recipe.textStyles?.normalText?.color || '#334155')))
4258
+ const textFont = (globalFontFamily.value && globalFontFamily.value !== '默认字体')
4259
+ ? globalFontFamily.value
4260
+ : (textCfg.fontFamily || (isHeading ? (recipe.styleFonts?.titleFont || 'SourceHanSansCN') : (recipe.styleFonts?.bodyFont || 'SourceHanSansCN')))
4261
+ const textColor = globalFontColor.value || textCfg.color || (textType === 'smallText' ? '#64748b' : (isHeading ? (recipe.textStyles?.title?.color || '#0f172a') : (recipe.textStyles?.normalText?.color || '#334155')))
4034
4262
  const fontSize = `${textCfg.fontSize || typeConf.defaultFontSize}px`
4035
4263
  const fontWeight = textCfg.fontWeight || typeConf.defaultFontWeight
4036
4264
  const lineHeight = textCfg.lineHeight || typeConf.defaultLineHeight
@@ -4061,9 +4289,11 @@ function addElement(
4061
4289
  const shapeFill = recipe.shape?.fillColor || (recipe.styleColors && recipe.styleColors[0]) || '#2563eb'
4062
4290
  const shapeBorder = recipe.shape?.borderColor || (recipe.styleColors && recipe.styleColors[1]) || '#1d4ed8'
4063
4291
  const shapeTextCol = recipe.shape?.textColor || '#ffffff'
4064
- const shapeFont = (recipe.styleFonts?.bodyFont && recipe.styleFonts.bodyFont !== '默认字体')
4065
- ? recipe.styleFonts.bodyFont
4066
- : 'SourceHanSansCN'
4292
+ const shapeFont = (globalFontFamily.value && globalFontFamily.value !== '默认字体')
4293
+ ? globalFontFamily.value
4294
+ : ((recipe.styleFonts?.bodyFont && recipe.styleFonts.bodyFont !== '默认字体')
4295
+ ? recipe.styleFonts.bodyFont
4296
+ : 'SourceHanSansCN')
4067
4297
 
4068
4298
  style = {
4069
4299
  top: '40%',
@@ -4273,10 +4503,10 @@ function addElementAt(
4273
4503
  let style: any = {}
4274
4504
 
4275
4505
  if (type === 'text') {
4276
- const textColor = recipe.textStyles?.title?.color || recipe.styleColors?.[0] || globalFontColor.value || recipe.textStyles?.normalText?.color || '#0f172a'
4277
- const textFont = (recipe.styleFonts?.bodyFont && recipe.styleFonts.bodyFont !== '默认字体')
4278
- ? recipe.styleFonts.bodyFont
4279
- : (globalFontFamily.value && globalFontFamily.value !== '默认字体' ? globalFontFamily.value : 'SourceHanSansCN')
4506
+ const textColor = globalFontColor.value || recipe.textStyles?.title?.color || recipe.styleColors?.[0] || recipe.textStyles?.normalText?.color || '#0f172a'
4507
+ const textFont = (globalFontFamily.value && globalFontFamily.value !== '默认字体')
4508
+ ? globalFontFamily.value
4509
+ : ((recipe.styleFonts?.bodyFont && recipe.styleFonts.bodyFont !== '默认字体') ? recipe.styleFonts.bodyFont : 'SourceHanSansCN')
4280
4510
  content = `<div style="color:${textColor}; font-family:${textFont};"><br></div>`
4281
4511
  style = {
4282
4512
  top: `${topPct.toFixed(2)}%`,
@@ -4305,9 +4535,11 @@ function addElementAt(
4305
4535
  const shapeFill = recipe.shape?.fillColor || (recipe.styleColors && recipe.styleColors[0]) || '#2563eb'
4306
4536
  const shapeBorder = recipe.shape?.borderColor || (recipe.styleColors && recipe.styleColors[1]) || '#1d4ed8'
4307
4537
  const shapeTextCol = recipe.shape?.textColor || '#ffffff'
4308
- const shapeFont = (recipe.styleFonts?.bodyFont && recipe.styleFonts.bodyFont !== '默认字体')
4309
- ? recipe.styleFonts.bodyFont
4310
- : 'SourceHanSansCN'
4538
+ const shapeFont = (globalFontFamily.value && globalFontFamily.value !== '默认字体')
4539
+ ? globalFontFamily.value
4540
+ : ((recipe.styleFonts?.bodyFont && recipe.styleFonts.bodyFont !== '默认字体')
4541
+ ? recipe.styleFonts.bodyFont
4542
+ : 'SourceHanSansCN')
4311
4543
 
4312
4544
  style = {
4313
4545
  top: `${topPct.toFixed(2)}%`,
@@ -4353,7 +4585,9 @@ function addElementAt(
4353
4585
  content = ''
4354
4586
  const chartPalette = (recipe.chart?.palette && recipe.chart.palette.length > 0) ? [...recipe.chart.palette] : (recipe.styleColors || ['#2563eb', '#3b82f6', '#60a5fa'])
4355
4587
  const chartTextCol = recipe.chart?.textColor || recipe.chart?.labelColor || '#1e293b'
4356
- const chartFont = recipe.chart?.fontFamily || recipe.styleFonts?.bodyFont || 'SourceHanSansCN'
4588
+ const chartFont = (globalFontFamily.value && globalFontFamily.value !== '默认字体')
4589
+ ? globalFontFamily.value
4590
+ : (recipe.chart?.fontFamily || recipe.styleFonts?.bodyFont || 'SourceHanSansCN')
4357
4591
 
4358
4592
  style = {
4359
4593
  top: `${topPct.toFixed(2)}%`,
@@ -4378,6 +4612,9 @@ function addElementAt(
4378
4612
 
4379
4613
  if (type === 'text') {
4380
4614
  newElement.verticalAlign = 'middle'
4615
+ newElement.color = style.color
4616
+ newElement.textColor = style.color
4617
+ newElement.fontFamily = style.fontFamily
4381
4618
  }
4382
4619
 
4383
4620
  if (type === 'shape') {
@@ -6590,7 +6827,7 @@ function convertPPTistToLocalIfNeed(newSlides: any): Slide[] {
6590
6827
  const grpFlipH = !!(el.flipH || el.isFlipH || el.style?.flipH)
6591
6828
  const grpFlipV = !!(el.flipV || el.isFlipV || el.style?.flipV)
6592
6829
 
6593
- return {
6830
+ const groupObj: any = {
6594
6831
  id: el.id || 'group_' + Date.now().toString(36) + Math.random().toString(36).substring(2, 7),
6595
6832
  type: 'group',
6596
6833
  name: el.name || '组合',
@@ -6609,6 +6846,12 @@ function convertPPTistToLocalIfNeed(newSlides: any): Slide[] {
6609
6846
  isFlipV: grpFlipV,
6610
6847
  elements: el.elements.map((child: any) => convertChildRecursive(child, topW, topH))
6611
6848
  }
6849
+
6850
+ if (grpFlipH || grpFlipV) {
6851
+ applyGroupGeometryFlip(groupObj, grpFlipH, grpFlipV)
6852
+ }
6853
+
6854
+ return groupObj
6612
6855
  }
6613
6856
 
6614
6857
  const elemPattern = extractPatternFromFill(el)
@@ -7291,6 +7534,9 @@ function preprocessImportedSlides(slides: any[]) {
7291
7534
  }
7292
7535
  processEl(child, grpW, grpH)
7293
7536
  })
7537
+ if (el.flipH || el.isFlipH || el.style?.flipH || el.flipV || el.isFlipV || el.style?.flipV) {
7538
+ applyGroupGeometryFlip(el)
7539
+ }
7294
7540
  }
7295
7541
  }
7296
7542
  for (const el of slide.elements) {
@@ -8837,16 +9083,18 @@ export function useSlides() {
8837
9083
  function addMaster(name = '自定义母版') {
8838
9084
  const newMasterId = 'master-' + Date.now().toString()
8839
9085
  const newLayoutId = 'layout-' + Date.now().toString()
8840
- const dateStr = getCurrentFormattedDate()
8841
9086
  const W = logicalWidth.value || 1280
8842
9087
  const H = logicalHeight.value || 720
8843
9088
 
8844
- const masterElements: SlideElement[] = [
9089
+ const createPlaceholders = (scope: 'master' | 'layout') => [
8845
9090
  {
8846
- id: 'ph-title-' + Date.now().toString(),
8847
- type: 'text',
9091
+ id: `ph-title-${scope}-${Date.now().toString(36)}`,
9092
+ type: 'text' as const,
8848
9093
  name: '母版标题占位符',
8849
9094
  content: '<div>单击此处编辑母版标题样式</div>',
9095
+ isMaster: true,
9096
+ isPlaceholder: true,
9097
+ placeholder: { type: 'title', prompt: '单击此处编辑母版标题样式' },
8850
9098
  style: {
8851
9099
  left: '50px',
8852
9100
  top: '40px',
@@ -8858,10 +9106,13 @@ export function useSlides() {
8858
9106
  }
8859
9107
  },
8860
9108
  {
8861
- id: 'ph-body-' + Date.now().toString(),
8862
- type: 'text',
9109
+ id: `ph-body-${scope}-${Date.now().toString(36)}`,
9110
+ type: 'text' as const,
8863
9111
  name: '母版文本占位符',
8864
9112
  content: '<div>• 单击此处编辑母版文本样式</div><div style="padding-left: 24px;">• 第二级</div><div style="padding-left: 48px;">• 第三级</div><div style="padding-left: 72px;">• 第四级</div><div style="padding-left: 96px;">• 第五级</div>',
9113
+ isMaster: true,
9114
+ isPlaceholder: true,
9115
+ placeholder: { type: 'body', prompt: '单击此处编辑母版文本样式' },
8865
9116
  style: {
8866
9117
  left: '50px',
8867
9118
  top: '130px',
@@ -8871,51 +9122,6 @@ export function useSlides() {
8871
9122
  color: '#475569',
8872
9123
  lineHeight: '1.6'
8873
9124
  }
8874
- },
8875
- {
8876
- id: 'ph-date-' + Date.now().toString(),
8877
- type: 'text',
8878
- name: '日期占位符',
8879
- content: `<div>${dateStr}</div>`,
8880
- style: {
8881
- left: '50px',
8882
- top: `${H - 48}px`,
8883
- width: '220px',
8884
- height: '30px',
8885
- fontSize: '12px',
8886
- color: '#94a3b8',
8887
- textAlign: 'left'
8888
- }
8889
- },
8890
- {
8891
- id: 'ph-footer-' + Date.now().toString(),
8892
- type: 'text',
8893
- name: '页脚占位符',
8894
- content: '<div>页脚区</div>',
8895
- style: {
8896
- left: `${Math.round(W / 2 - 110)}px`,
8897
- top: `${H - 48}px`,
8898
- width: '220px',
8899
- height: '30px',
8900
- fontSize: '12px',
8901
- color: '#94a3b8',
8902
- textAlign: 'center'
8903
- }
8904
- },
8905
- {
8906
- id: 'ph-num-' + Date.now().toString(),
8907
- type: 'text',
8908
- name: '页码占位符',
8909
- content: '<div>&lt;#&gt;</div>',
8910
- style: {
8911
- left: `${W - 270}px`,
8912
- top: `${H - 48}px`,
8913
- width: '220px',
8914
- height: '30px',
8915
- fontSize: '12px',
8916
- color: '#94a3b8',
8917
- textAlign: 'right'
8918
- }
8919
9125
  }
8920
9126
  ]
8921
9127
 
@@ -8925,13 +9131,14 @@ export function useSlides() {
8925
9131
  background: '#ffffff',
8926
9132
  themeColors: ['#3b82f6', '#f59e0b', '#ef4444', '#10b981', '#8b5cf6'],
8927
9133
  fontFamily: 'SourceHanSansCN',
8928
- elements: masterElements,
9134
+ elements: [],
9135
+ placeholders: createPlaceholders('master'),
8929
9136
  layouts: [
8930
9137
  {
8931
9138
  id: newLayoutId,
8932
9139
  name: '默认版式',
8933
9140
  type: 'title-body',
8934
- elements: masterElements,
9141
+ elements: createPlaceholders('layout'),
8935
9142
  placeholders: []
8936
9143
  }
8937
9144
  ]
@@ -8946,16 +9153,17 @@ export function useSlides() {
8946
9153
  const targetMaster = slideMasters.value.find(m => m.id === masterId)
8947
9154
  if (!targetMaster) return
8948
9155
  const newLayoutId = 'layout-' + Date.now().toString() + Math.random().toString(36).substring(2, 6)
8949
- const dateStr = getCurrentFormattedDate()
8950
9156
  const W = logicalWidth.value || 1280
8951
- const H = logicalHeight.value || 720
8952
9157
 
8953
9158
  const layoutElements: SlideElement[] = [
8954
9159
  {
8955
- id: 'ph-title-' + Date.now().toString(),
9160
+ id: 'ph-title-' + Date.now().toString(36) + Math.random().toString(36).substring(2, 6),
8956
9161
  type: 'text',
8957
9162
  name: '母版标题占位符',
8958
9163
  content: '<div>单击此处编辑母版标题样式</div>',
9164
+ isMaster: true,
9165
+ isPlaceholder: true,
9166
+ placeholder: { type: 'title', prompt: '单击此处编辑母版标题样式' },
8959
9167
  style: {
8960
9168
  left: '50px',
8961
9169
  top: '40px',
@@ -8965,51 +9173,6 @@ export function useSlides() {
8965
9173
  fontWeight: 'bold',
8966
9174
  color: '#1e293b'
8967
9175
  }
8968
- },
8969
- {
8970
- id: 'ph-date-' + Date.now().toString(),
8971
- type: 'text',
8972
- name: '日期占位符',
8973
- content: `<div>${dateStr}</div>`,
8974
- style: {
8975
- left: '50px',
8976
- top: `${H - 48}px`,
8977
- width: '220px',
8978
- height: '30px',
8979
- fontSize: '12px',
8980
- color: '#94a3b8',
8981
- textAlign: 'left'
8982
- }
8983
- },
8984
- {
8985
- id: 'ph-footer-' + Date.now().toString(),
8986
- type: 'text',
8987
- name: '页脚占位符',
8988
- content: '<div>页脚区</div>',
8989
- style: {
8990
- left: `${Math.round(W / 2 - 110)}px`,
8991
- top: `${H - 48}px`,
8992
- width: '220px',
8993
- height: '30px',
8994
- fontSize: '12px',
8995
- color: '#94a3b8',
8996
- textAlign: 'center'
8997
- }
8998
- },
8999
- {
9000
- id: 'ph-num-' + Date.now().toString(),
9001
- type: 'text',
9002
- name: '页码占位符',
9003
- content: '<div>&lt;#&gt;</div>',
9004
- style: {
9005
- left: `${W - 270}px`,
9006
- top: `${H - 48}px`,
9007
- width: '220px',
9008
- height: '30px',
9009
- fontSize: '12px',
9010
- color: '#94a3b8',
9011
- textAlign: 'right'
9012
- }
9013
9176
  }
9014
9177
  ]
9015
9178
 
@@ -9157,14 +9320,17 @@ export function useSlides() {
9157
9320
  type: 'shape',
9158
9321
  name: '图片占位符',
9159
9322
  content: 'rect',
9160
- text: '<div>图片占位符</div>',
9323
+ text: '',
9324
+ isPlaceholder: true,
9325
+ placeholder: { type: 'image', prompt: '图片占位符' },
9161
9326
  style: {
9162
9327
  left: '50px',
9163
9328
  top: '140px',
9164
9329
  width: `${W - 100}px`,
9165
9330
  height: `${Math.max(200, H - 210)}px`,
9166
- fill: '#f1f5f9',
9167
- textColor: '#6366f1',
9331
+ fill: '#d9dde3',
9332
+ borderRadius: '12px',
9333
+ textColor: '#475569',
9168
9334
  fontSize: '16px',
9169
9335
  textAlign: 'center'
9170
9336
  }
@@ -9176,6 +9342,8 @@ export function useSlides() {
9176
9342
  textType: 'smallText',
9177
9343
  name: '页码占位符',
9178
9344
  content: '<div>&lt;#&gt;</div>',
9345
+ isPlaceholder: true,
9346
+ placeholder: { type: 'slide-number', prompt: '<#>' },
9179
9347
  style: {
9180
9348
  left: `${W - 270}px`,
9181
9349
  top: `${H - 48}px`,
@@ -9194,6 +9362,8 @@ export function useSlides() {
9194
9362
  textType: 'smallText',
9195
9363
  name: '日期占位符',
9196
9364
  content: `<div>${dateStr}</div>`,
9365
+ isPlaceholder: true,
9366
+ placeholder: { type: 'date', prompt: dateStr },
9197
9367
  style: {
9198
9368
  left: '50px',
9199
9369
  top: `${H - 48}px`,
@@ -9210,6 +9380,8 @@ export function useSlides() {
9210
9380
  type: 'text',
9211
9381
  name: '页脚占位符',
9212
9382
  content: '<div>页脚文本描述</div>',
9383
+ isPlaceholder: true,
9384
+ placeholder: { type: 'footer', prompt: '页脚文本描述' },
9213
9385
  style: {
9214
9386
  left: `${Math.round(W / 2 - 110)}px`,
9215
9387
  top: `${H - 48}px`,
@@ -9223,7 +9395,10 @@ export function useSlides() {
9223
9395
  }
9224
9396
 
9225
9397
  if (!targetObj.elements) targetObj.elements = []
9226
- if (newEl) newEl.isMaster = true
9398
+ if (newEl) {
9399
+ newEl.isMaster = true
9400
+ newEl.isPlaceholder = true
9401
+ }
9227
9402
  targetObj.elements.push(newEl)
9228
9403
  selectedElementId.value = newId
9229
9404
  selectedElementIds.value = [newId]
@@ -9344,6 +9519,7 @@ export function useSlides() {
9344
9519
  updateAnimationDuration,
9345
9520
  updateAnimationTrigger,
9346
9521
  updateAnimationEffect,
9522
+ updateAnimationTargetElement,
9347
9523
  updateAnimationOrder,
9348
9524
  currentAnimationIndex,
9349
9525
  execNext,