@web-ppt/edit-core 0.5.0-beta.2 → 0.5.0

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 (337) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/README.md +164 -21
  3. package/dist/alt-text.d.ts +5 -0
  4. package/dist/appearance/index.d.ts +12 -0
  5. package/dist/appearance/materialize.d.ts +4 -0
  6. package/dist/appearance/types.d.ts +26 -0
  7. package/dist/appearance/values.d.ts +9 -0
  8. package/dist/appearance.js +301 -0
  9. package/dist/cfb/index.d.ts +5 -0
  10. package/dist/cfb/read.d.ts +16 -0
  11. package/dist/cfb/write.d.ts +3 -0
  12. package/dist/cfb.js +208 -0
  13. package/dist/change-classification.d.ts +3 -3
  14. package/dist/chart/category-binding.d.ts +4 -0
  15. package/dist/chart/category-commands.d.ts +23 -0
  16. package/dist/chart/category-levels.d.ts +14 -0
  17. package/dist/chart/category-matrix.d.ts +2 -0
  18. package/dist/chart/category-value.d.ts +2 -0
  19. package/dist/chart/category-workbook.d.ts +13 -0
  20. package/dist/chart/commands.d.ts +28 -0
  21. package/dist/chart/context.d.ts +12 -0
  22. package/dist/chart/dataset-merge.d.ts +5 -0
  23. package/dist/chart/formula.d.ts +13 -0
  24. package/dist/chart/identity-frames.d.ts +4 -0
  25. package/dist/chart/identity-scopes.d.ts +6 -0
  26. package/dist/chart/identity.d.ts +24 -0
  27. package/dist/chart/index.d.ts +8 -0
  28. package/dist/chart/limits.d.ts +6 -0
  29. package/dist/chart/locator.d.ts +4 -0
  30. package/dist/chart/materialize.d.ts +7 -0
  31. package/dist/chart/ordering.d.ts +9 -0
  32. package/dist/chart/part-graph.d.ts +5 -0
  33. package/dist/chart/patch-validation.d.ts +3 -0
  34. package/dist/chart/plot-kinds.d.ts +2 -0
  35. package/dist/chart/projection.d.ts +8 -0
  36. package/dist/chart/save.d.ts +4 -0
  37. package/dist/chart/shared-added-plan.d.ts +19 -0
  38. package/dist/chart/shared-added-records.d.ts +8 -0
  39. package/dist/chart/shared-address.d.ts +5 -0
  40. package/dist/chart/shared-allocate.d.ts +7 -0
  41. package/dist/chart/shared-cache-codec.d.ts +5 -0
  42. package/dist/chart/shared-cache-identities.d.ts +3 -0
  43. package/dist/chart/shared-cache-migration.d.ts +7 -0
  44. package/dist/chart/shared-cache-save.d.ts +3 -0
  45. package/dist/chart/shared-cache-scopes.d.ts +13 -0
  46. package/dist/chart/shared-cache.d.ts +11 -0
  47. package/dist/chart/shared-category.d.ts +4 -0
  48. package/dist/chart/shared-cell.d.ts +9 -0
  49. package/dist/chart/shared-family.d.ts +26 -0
  50. package/dist/chart/shared-fields.d.ts +18 -0
  51. package/dist/chart/shared-graph.d.ts +19 -0
  52. package/dist/chart/shared-growth-space.d.ts +5 -0
  53. package/dist/chart/shared-inserted-cells.d.ts +14 -0
  54. package/dist/chart/shared-inserted-command.d.ts +7 -0
  55. package/dist/chart/shared-inserted-layout.d.ts +16 -0
  56. package/dist/chart/shared-inserted-project.d.ts +14 -0
  57. package/dist/chart/shared-inserted-records.d.ts +16 -0
  58. package/dist/chart/shared-inserted-save.d.ts +6 -0
  59. package/dist/chart/shared-joint-command.d.ts +9 -0
  60. package/dist/chart/shared-joint-records.d.ts +9 -0
  61. package/dist/chart/shared-record-axis.d.ts +25 -0
  62. package/dist/chart/shared-record-remove.d.ts +13 -0
  63. package/dist/chart/shared-record-stage.d.ts +2 -0
  64. package/dist/chart/shared-records.d.ts +2 -0
  65. package/dist/chart/shared-rows.d.ts +17 -0
  66. package/dist/chart/shared-runtime.d.ts +19 -0
  67. package/dist/chart/shared-save-plan.d.ts +4 -0
  68. package/dist/chart/shared-save.d.ts +3 -0
  69. package/dist/chart/shared-series.d.ts +6 -0
  70. package/dist/chart/shared-source-cache.d.ts +4 -0
  71. package/dist/chart/shared-topology.d.ts +9 -0
  72. package/dist/chart/shared-unresolved.d.ts +3 -0
  73. package/dist/chart/shared-validation.d.ts +6 -0
  74. package/dist/chart/shared-workbook-source.d.ts +6 -0
  75. package/dist/chart/shared-xy-command.d.ts +7 -0
  76. package/dist/chart/shared-xy-family.d.ts +16 -0
  77. package/dist/chart/shared-xy-project.d.ts +6 -0
  78. package/dist/chart/shared-xy-records.d.ts +23 -0
  79. package/dist/chart/shared-xy-save.d.ts +5 -0
  80. package/dist/chart/shared-xy-source.d.ts +39 -0
  81. package/dist/chart/shared.d.ts +13 -0
  82. package/dist/chart/source.d.ts +11 -0
  83. package/dist/chart/types.d.ts +86 -0
  84. package/dist/chart/validation.d.ts +24 -0
  85. package/dist/chart/workbook-range.d.ts +16 -0
  86. package/dist/chart/workbook-read.d.ts +7 -0
  87. package/dist/chart/workbook-write.d.ts +9 -0
  88. package/dist/chart/workbook.d.ts +25 -0
  89. package/dist/chart/xml-data.d.ts +14 -0
  90. package/dist/chart/xml-namespaces.d.ts +16 -0
  91. package/dist/chart-design/index.d.ts +10 -0
  92. package/dist/chart-design/types.d.ts +11 -0
  93. package/dist/chart-design/xml.d.ts +2 -0
  94. package/dist/chart-design.js +361 -0
  95. package/dist/chart-ex/index.d.ts +15 -0
  96. package/dist/chart-ex/workbook.d.ts +6 -0
  97. package/dist/chart-ex/xml.d.ts +14 -0
  98. package/dist/chart-ex.js +457 -0
  99. package/dist/chart-shared/index.d.ts +12 -0
  100. package/dist/chart-shared.js +1 -0
  101. package/dist/chart.js +1 -0
  102. package/dist/clipboard-links-GuPtqr1z.js +778 -0
  103. package/dist/clipboard-package.d.ts +4 -0
  104. package/dist/clipboard-source.d.ts +6 -2
  105. package/dist/clipboard-trees.d.ts +9 -0
  106. package/dist/commands/add-slide-identity.d.ts +2 -0
  107. package/dist/commands/bullet-image-resource.d.ts +11 -0
  108. package/dist/commands/clear-format.d.ts +4 -0
  109. package/dist/commands/common-object-slide-patch.d.ts +4 -0
  110. package/dist/commands/common-object-slide-types.d.ts +68 -0
  111. package/dist/commands/direct-format-patches.d.ts +11 -5
  112. package/dist/commands/distribute-elements.d.ts +4 -0
  113. package/dist/commands/edit-table-grid.d.ts +10 -0
  114. package/dist/commands/element-alt-text.d.ts +8 -0
  115. package/dist/commands/element-arrangement.d.ts +17 -0
  116. package/dist/commands/element-effects.d.ts +1 -1
  117. package/dist/commands/element-fill.d.ts +1 -1
  118. package/dist/commands/element-geometry.d.ts +5 -2
  119. package/dist/commands/element-image-content.d.ts +2 -2
  120. package/dist/commands/element-link.d.ts +1 -1
  121. package/dist/commands/element-name.d.ts +1 -1
  122. package/dist/commands/element-stroke.d.ts +1 -1
  123. package/dist/commands/element-text.d.ts +1 -1
  124. package/dist/commands/element-transform.d.ts +2 -2
  125. package/dist/commands/geometry-types.d.ts +23 -1
  126. package/dist/commands/hierarchy-record.d.ts +5 -0
  127. package/dist/commands/image-resource.d.ts +8 -1
  128. package/dist/commands/insertion-host.d.ts +14 -1
  129. package/dist/commands/layout-property.d.ts +7 -0
  130. package/dist/commands/master-property.d.ts +5 -0
  131. package/dist/commands/master-text-style-types.d.ts +27 -0
  132. package/dist/commands/master-text-style.d.ts +7 -0
  133. package/dist/commands/paste-resources.d.ts +9 -5
  134. package/dist/commands/patch-apply.d.ts +3 -0
  135. package/dist/commands/patch-count.d.ts +1 -0
  136. package/dist/commands/patch-invalidation.d.ts +1 -1
  137. package/dist/commands/patch-stage.d.ts +4 -0
  138. package/dist/commands/record-override.d.ts +5 -0
  139. package/dist/commands/replace-image.d.ts +6 -1
  140. package/dist/commands/sections.d.ts +10 -0
  141. package/dist/commands/set-preset.d.ts +5 -0
  142. package/dist/commands/slide-property-types.d.ts +55 -5
  143. package/dist/commands/slide-size.d.ts +7 -0
  144. package/dist/commands/spid.d.ts +1 -1
  145. package/dist/commands/table-grid-patch.d.ts +12 -0
  146. package/dist/commands/text-target.d.ts +2 -2
  147. package/dist/commands/theme-types.d.ts +47 -0
  148. package/dist/commands/theme.d.ts +9 -0
  149. package/dist/commands/types.d.ts +194 -17
  150. package/dist/commands/ungroup-source.d.ts +3 -0
  151. package/dist/comments/index.d.ts +35 -0
  152. package/dist/comments/save.d.ts +3 -0
  153. package/dist/comments/state.d.ts +10 -0
  154. package/dist/comments/xml.d.ts +12 -0
  155. package/dist/comments.js +782 -0
  156. package/dist/common-object-slide-types.d.ts +34 -0
  157. package/dist/data-validation.d.ts +1 -1
  158. package/dist/describe/budget.d.ts +3 -0
  159. package/dist/describe/index.d.ts +5 -0
  160. package/dist/describe/read.d.ts +4 -0
  161. package/dist/describe/types.d.ts +103 -0
  162. package/dist/describe.js +192 -0
  163. package/dist/design-dependencies.d.ts +8 -0
  164. package/dist/design-projection-package.d.ts +10 -0
  165. package/dist/design-target.d.ts +10 -0
  166. package/dist/design.d.ts +3 -0
  167. package/dist/document-extensions.d.ts +9 -0
  168. package/dist/document.d.ts +1 -1
  169. package/dist/dynamic-projection.d.ts +6 -0
  170. package/dist/edit-core.js +5420 -4111
  171. package/dist/editor.d.ts +15 -3
  172. package/dist/element-source.d.ts +11 -0
  173. package/dist/element-spids.d.ts +4 -0
  174. package/dist/extension-address-journal.d.ts +9 -0
  175. package/dist/extension-address-remap.d.ts +14 -0
  176. package/dist/extension-addresses.d.ts +20 -0
  177. package/dist/extension-copy-history.d.ts +7 -0
  178. package/dist/extension-copy.d.ts +16 -0
  179. package/dist/extension-migration-receipt.d.ts +34 -0
  180. package/dist/extension-recovery-context.d.ts +5 -0
  181. package/dist/extension-runtime.d.ts +64 -0
  182. package/dist/generate/comments.d.ts +3 -0
  183. package/dist/generate/compatibility-parts.d.ts +14 -0
  184. package/dist/generate/compatibility-references.d.ts +3 -0
  185. package/dist/generate/compatibility.d.ts +4 -0
  186. package/dist/generate/index.d.ts +1 -0
  187. package/dist/generate/master-defaults.d.ts +4 -0
  188. package/dist/generate/materialize.d.ts +2 -2
  189. package/dist/generate/math.d.ts +3 -0
  190. package/dist/generate/portable-clipboard.d.ts +4 -0
  191. package/dist/generate/projection-tree.d.ts +8 -0
  192. package/dist/generate/template.d.ts +68 -1
  193. package/dist/generate/text-body.d.ts +2 -0
  194. package/dist/generate/text-effects.d.ts +5 -0
  195. package/dist/generate/text-override.d.ts +8 -0
  196. package/dist/generate/validation.d.ts +3 -0
  197. package/dist/generate/warp.d.ts +2 -0
  198. package/dist/generate.js +1232 -512
  199. package/dist/history.d.ts +11 -1
  200. package/dist/identities.d.ts +4 -0
  201. package/dist/image-content.d.ts +5 -2
  202. package/dist/image-resource-history.d.ts +2 -0
  203. package/dist/index-C2r7c6G6.js +714 -0
  204. package/dist/index-CYDvbiwF.js +1 -0
  205. package/dist/index.d.ts +35 -7
  206. package/dist/ink/index.d.ts +27 -0
  207. package/dist/ink/model.d.ts +4 -0
  208. package/dist/ink/save.d.ts +3 -0
  209. package/dist/ink/source.d.ts +7 -0
  210. package/dist/ink.js +324 -0
  211. package/dist/layout-assets.d.ts +3 -1
  212. package/dist/layout-projection.d.ts +17 -5
  213. package/dist/layout-state.d.ts +2 -0
  214. package/dist/layout-types.d.ts +42 -0
  215. package/dist/layout.d.ts +5 -0
  216. package/dist/lint/color.d.ts +5 -0
  217. package/dist/lint/index.d.ts +7 -0
  218. package/dist/lint/prompts.d.ts +3 -0
  219. package/dist/lint/report.d.ts +21 -0
  220. package/dist/lint/sampler-batch.d.ts +4 -0
  221. package/dist/lint/sampler-images.d.ts +2 -0
  222. package/dist/lint/sampler.d.ts +9 -0
  223. package/dist/lint/snapshot.d.ts +34 -0
  224. package/dist/lint/types.d.ts +67 -0
  225. package/dist/lint-sampler.js +187 -0
  226. package/dist/lint.js +659 -0
  227. package/dist/master-state.d.ts +3 -0
  228. package/dist/master-text-style-state.d.ts +3 -0
  229. package/dist/master-types.d.ts +55 -0
  230. package/dist/master.d.ts +5 -0
  231. package/dist/media/audio-icon.d.ts +2 -0
  232. package/dist/media/commands.d.ts +3 -0
  233. package/dist/media/index.d.ts +10 -0
  234. package/dist/media/markup.d.ts +10 -0
  235. package/dist/media/mp4-boxes.d.ts +12 -0
  236. package/dist/media/mp4-fragments.d.ts +8 -0
  237. package/dist/media/mp4-samples.d.ts +4 -0
  238. package/dist/media/mp4.d.ts +2 -0
  239. package/dist/media/poster.d.ts +2 -0
  240. package/dist/media/replace-poster.d.ts +3 -0
  241. package/dist/media/resource.d.ts +4 -0
  242. package/dist/media/source.d.ts +14 -0
  243. package/dist/media/types.d.ts +33 -0
  244. package/dist/media-properties.d.ts +4 -0
  245. package/dist/media.js +1630 -0
  246. package/dist/model-invariants-BM19JVxy.js +8980 -0
  247. package/dist/object-source.d.ts +11 -0
  248. package/dist/ole/container.d.ts +14 -0
  249. package/dist/ole/content.d.ts +94 -0
  250. package/dist/ole/index.d.ts +20 -0
  251. package/dist/ole/preview.d.ts +3 -0
  252. package/dist/ole/save.d.ts +2 -0
  253. package/dist/ole/state.d.ts +16 -0
  254. package/dist/ole.js +870 -0
  255. package/dist/opc.js +1 -1
  256. package/dist/paragraph-level.d.ts +2 -2
  257. package/dist/paragraph-property-schema.d.ts +4 -1
  258. package/dist/{patch-D7lZelRa.js → patch-BwhfBbYE.js} +10 -10
  259. package/dist/patch-events.d.ts +5 -1
  260. package/dist/ppt/appearance.d.ts +11 -0
  261. package/dist/ppt/binary.d.ts +20 -0
  262. package/dist/ppt/drawing.d.ts +18 -0
  263. package/dist/ppt/geometry.d.ts +4 -0
  264. package/dist/ppt/index.d.ts +12 -0
  265. package/dist/ppt/pictures.d.ts +11 -0
  266. package/dist/ppt/text.d.ts +9 -0
  267. package/dist/ppt.js +774 -0
  268. package/dist/preset-geometry.d.ts +6 -0
  269. package/dist/projection.d.ts +2 -0
  270. package/dist/query-BHLjWjnu.js +903 -0
  271. package/dist/recovery-identity.d.ts +1 -0
  272. package/dist/recovery-migrations.d.ts +3 -0
  273. package/dist/recovery.d.ts +3 -0
  274. package/dist/resize/index.d.ts +6 -0
  275. package/dist/resize/text.d.ts +4 -0
  276. package/dist/resize.js +5090 -0
  277. package/dist/retained-element-origins.d.ts +6 -0
  278. package/dist/run-property-fields.d.ts +12 -0
  279. package/dist/run-property-schema.d.ts +3 -1
  280. package/dist/run-style.d.ts +15 -0
  281. package/dist/save/alt-text.d.ts +4 -0
  282. package/dist/save/comments.d.ts +3 -0
  283. package/dist/save/effects.d.ts +2 -1
  284. package/dist/save/extension-availability.d.ts +3 -0
  285. package/dist/save/extension-elements.d.ts +26 -0
  286. package/dist/save/index.d.ts +6 -1
  287. package/dist/save/insertion.d.ts +6 -5
  288. package/dist/save/layout-properties.d.ts +4 -0
  289. package/dist/save/master-properties.d.ts +5 -0
  290. package/dist/save/paragraph-overrides.d.ts +3 -0
  291. package/dist/save/slide-parts.d.ts +1 -0
  292. package/dist/save/table.d.ts +2 -0
  293. package/dist/save/xfrm.d.ts +8 -2
  294. package/dist/save.js +493 -498
  295. package/dist/sections.d.ts +8 -0
  296. package/dist/session-assets.d.ts +4 -0
  297. package/dist/slide-parts-D0o_DDhi.js +1331 -0
  298. package/dist/slide-size.d.ts +6 -0
  299. package/dist/smartart/drawing.d.ts +3 -0
  300. package/dist/smartart/index.d.ts +16 -0
  301. package/dist/smartart/model.d.ts +18 -0
  302. package/dist/smartart/save.d.ts +3 -0
  303. package/dist/smartart.js +604 -0
  304. package/dist/source-retention.d.ts +7 -0
  305. package/dist/space.d.ts +37 -0
  306. package/dist/table-cell.d.ts +7 -1
  307. package/dist/table-grid-projection.d.ts +6 -0
  308. package/dist/table-grid.d.ts +45 -0
  309. package/dist/table-invariants.d.ts +4 -0
  310. package/dist/table-rows.d.ts +2 -1
  311. package/dist/table-scale.d.ts +4 -0
  312. package/dist/table-style.d.ts +5 -4
  313. package/dist/templates/index.d.ts +4 -0
  314. package/dist/templates/recipes.d.ts +5 -0
  315. package/dist/templates/types.d.ts +17 -0
  316. package/dist/templates.js +543 -0
  317. package/dist/text-flatten.d.ts +6 -0
  318. package/dist/text-fragment.d.ts +5 -0
  319. package/dist/text-model.d.ts +8 -8
  320. package/dist/text-override-validation.d.ts +6 -2
  321. package/dist/text-selection.d.ts +4 -0
  322. package/dist/theme-projection.d.ts +8 -0
  323. package/dist/theme-xml.d.ts +3 -0
  324. package/dist/theme.d.ts +14 -0
  325. package/dist/types.d.ts +174 -8
  326. package/dist/xml/index.d.ts +1 -1
  327. package/dist/xml/nodes.d.ts +2 -2
  328. package/dist/xml/shape-ids.d.ts +3 -0
  329. package/dist/xml.js +19 -16
  330. package/package.json +79 -5
  331. package/schemas/describe.schema.json +479 -0
  332. package/schemas/lint.schema.json +145 -0
  333. package/dist/document-B1jjN-QB.js +0 -274
  334. package/dist/image-resource-DbgJS9n-.js +0 -24
  335. package/dist/index-D2JizcOQ.js +0 -706
  336. package/dist/insertion-CGpb504L.js +0 -6152
  337. package/dist/table-style-part-DBtpxmuo.js +0 -1042
@@ -0,0 +1,4 @@
1
+ import type { OpcPackage } from '@web-ppt/core';
2
+ import type { EditDoc } from './types';
3
+ /** 资源身份描述复制时的有效内容;临时部件不提交到源包或保存基线。 */
4
+ export declare function clipboardPackage(doc: EditDoc): OpcPackage;
@@ -1,7 +1,8 @@
1
1
  import type { OpcPackage } from '@web-ppt/core';
2
2
  import type { ClipboardRelationship, ClipboardResource } from './commands/types';
3
- import type { ElementInsertionSource } from './types';
3
+ import type { EditDoc, ElementRecord, ElementInsertionSource } from './types';
4
4
  import type { XmlElement } from './xml/types';
5
+ export declare function insertionOwner(doc: EditDoc, id: string): ElementRecord | null;
5
6
  export declare function relationshipPartFor(part: string): string;
6
7
  export declare function relativeTarget(fromPart: string, targetPart: string): string;
7
8
  export declare function resolveRelationshipTarget(fromPart: string, target: string): string;
@@ -11,13 +12,16 @@ export interface PackageTargetIdentity {
11
12
  }
12
13
  /** 用内容与关系图描述复杂对象;OPC 路径只参与读取,绝不进入剪贴板协议。 */
13
14
  export declare function packageTargetIdentity(pkg: OpcPackage, targetPart: string): PackageTargetIdentity;
15
+ /** 内容寻址选中的路径可能不是原宿主路径;复用身份遍历结果保留确切依赖,不再扫描全包。 */
16
+ export declare function packageTargetParts(pkg: OpcPackage, part: string): readonly string[];
14
17
  export declare function resolvePackageTarget(pkg: OpcPackage, identity: PackageTargetIdentity): string | null;
15
18
  export declare function packageContentType(pkg: OpcPackage, part: string, extension: string): string;
16
19
  /** 新 part 尚未有字节,仍必须尊重包中预先存在的精确 Override。 */
17
20
  export declare function packageContentTypeOverride(pkg: OpcPackage, part: string): string | undefined;
21
+ export declare function relationshipIds(host: XmlElement, includeEmpty?: boolean): string[];
18
22
  export interface ClipboardClosure {
19
23
  relationships: ClipboardRelationship[];
20
24
  resources: ClipboardResource[];
21
25
  }
22
26
  /** 只复制宿主实际引用的关系;不把整张幻灯片的无关资源塞入系统剪贴板。 */
23
- export declare function clipboardClosure(pkg: OpcPackage, sourcePart: string, host: XmlElement, insertions?: readonly Pick<ElementInsertionSource, 'relationships' | 'resources'>[]): ClipboardClosure;
27
+ export declare function clipboardClosure(pkg: OpcPackage, sourcePart: string, host: XmlElement, insertions?: readonly Pick<ElementInsertionSource, 'relationships' | 'resources'>[], effectivePackage?: () => OpcPackage): ClipboardClosure;
@@ -0,0 +1,9 @@
1
+ import type { ClipboardResource, ClipboardXmlRoot } from './commands/types';
2
+ import type { EditDoc, ElementId } from './types';
3
+ /** 复制取得有效树;解组只移交来源,覆盖仍由原记录持有,避免追加行等操作被执行两次。 */
4
+ export declare function elementTreeSources(doc: EditDoc, roots: readonly ElementId[], sourceOnly?: boolean): {
5
+ ooxml: {
6
+ roots: Record<string, ClipboardXmlRoot>;
7
+ };
8
+ resources: ClipboardResource[];
9
+ };
@@ -7,4 +7,6 @@ export declare function allocateSlideOpcIdentity(doc: EditDoc): {
7
7
  export declare function allocateNotesPart(doc: EditDoc): string;
8
8
  /** 协同绑定期固化全部全局 OPC 数值区间,后续远端补丁不会改变本副本的分配边界。 */
9
9
  export declare function prepareSlideOpcNamespaces(doc: EditDoc): void;
10
+ /** presentation 关系与列表只解析一次;调用方可按 part 批量取得稳定数值身份。 */
11
+ export declare function presentationSlideIdsByPart(doc: EditDoc): ReadonlyMap<string, number>;
10
12
  export declare function presentationSlideIdForPart(doc: EditDoc, part: string): number | undefined;
@@ -0,0 +1,11 @@
1
+ import type { EditDoc, ElementImageReplacement, ElementInsertionResource } from '../types';
2
+ import type { ImageResourcePatch } from './types';
3
+ type CompactImageResource = Omit<ElementInsertionResource, 'targetPart' | 'created'> & {
4
+ readonly sourcePart?: string;
5
+ };
6
+ export declare function resolveBulletImageResource(doc: EditDoc, src: string, label: string): CompactImageResource;
7
+ export declare function prepareBulletImageResource(doc: EditDoc, part: string, sourceRid: string, resource: CompactImageResource, origin: string): {
8
+ readonly image: ElementImageReplacement;
9
+ readonly resourcePatch?: ImageResourcePatch;
10
+ };
11
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { ClearFormatCommand, CommandPatches } from './types';
3
+ /** 清除格式只动视觉直设;超链接、字段、公式和段落身份都由原 mark 原样保留。 */
4
+ export declare function clearFormatPatches(doc: EditDoc, command: ClearFormatCommand, origin: string): CommandPatches;
@@ -0,0 +1,4 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { Patch } from './types';
3
+ export declare function validateCommonObjectSlidePatch(doc: EditDoc, patch: Patch, index: number): boolean;
4
+ export declare function applyCommonObjectSlidePatch(doc: EditDoc, patch: Patch): boolean;
@@ -0,0 +1,68 @@
1
+ import type { ElementId, SectionId, SectionState, SlideId } from '../types';
2
+ export interface SetAltTextCommand {
3
+ readonly type: 'SetAltText';
4
+ readonly id: ElementId;
5
+ /** null 单独恢复该字段的来源属性。 */
6
+ readonly title: string | null;
7
+ readonly descr: string | null;
8
+ }
9
+ export interface DistributeElementsCommand {
10
+ readonly type: 'DistributeElements';
11
+ readonly ids: readonly ElementId[];
12
+ readonly axis: 'horizontal' | 'vertical';
13
+ }
14
+ export interface AddSectionCommand {
15
+ readonly type: 'AddSection';
16
+ readonly name: string;
17
+ readonly slideIds: readonly SlideId[];
18
+ readonly at: {
19
+ readonly after: SectionId | null;
20
+ };
21
+ }
22
+ export interface RenameSectionCommand {
23
+ readonly type: 'RenameSection';
24
+ readonly id: SectionId;
25
+ readonly name: string;
26
+ }
27
+ export interface MoveSectionCommand {
28
+ readonly type: 'MoveSection';
29
+ readonly id: SectionId;
30
+ readonly at: {
31
+ readonly after: SectionId | null;
32
+ };
33
+ }
34
+ export interface RemoveSectionCommand {
35
+ readonly type: 'RemoveSection';
36
+ readonly id: SectionId;
37
+ }
38
+ export interface SetSlideSizeCommand {
39
+ readonly type: 'SetSlideSize';
40
+ /** null 恢复对应来源尺寸。 */
41
+ readonly w: number | null;
42
+ readonly h: number | null;
43
+ /** 默认仅改画布;ensureFit 需先注册 @web-ppt/edit-core/resize 按需模块。 */
44
+ readonly fit?: 'none' | 'ensureFit';
45
+ }
46
+ export type ElementAltTextPatch = {
47
+ readonly op: 'set';
48
+ readonly path: readonly ['elements', ElementId, 'ovr', 'altText', 'title' | 'descr'];
49
+ readonly value: string;
50
+ readonly origin: string;
51
+ } | {
52
+ readonly op: 'del';
53
+ readonly path: readonly ['elements', ElementId, 'ovr', 'altText', 'title' | 'descr'];
54
+ readonly origin: string;
55
+ };
56
+ export type SectionStatePatch = {
57
+ readonly op: 'set';
58
+ /** 完整快照保证本地撤销精确;末两段让协同按节、按意图独立仲裁。 */
59
+ readonly path: readonly ['document', 'sections', SectionId, 'state' | 'name' | 'order'];
60
+ readonly value: SectionState;
61
+ readonly origin: string;
62
+ };
63
+ export type DocumentSizePatch = {
64
+ readonly op: 'set';
65
+ readonly path: readonly ['document', 'size', 'w' | 'h'];
66
+ readonly value: number;
67
+ readonly origin: string;
68
+ };
@@ -1,8 +1,14 @@
1
1
  import type { Effects, Fill, Stroke } from '@web-ppt/core';
2
2
  import type { EditDoc } from '../types';
3
3
  import type { CommandPatches } from './types';
4
- export declare function directFillPatches(doc: EditDoc, id: string, value: Exclude<Fill, {
5
- type: 'image';
6
- }>, origin: string): CommandPatches;
7
- export declare function directStrokePatches(doc: EditDoc, id: string, value: Stroke | null, origin: string): CommandPatches;
8
- export declare function directEffectsPatches(doc: EditDoc, id: string, value: Effects, origin: string): CommandPatches;
4
+ type FormatField = 'fill' | 'stroke' | 'effects';
5
+ type FormatValue = {
6
+ fill: Exclude<Fill, {
7
+ type: 'image';
8
+ }>;
9
+ stroke: Stroke | null;
10
+ effects: Effects;
11
+ };
12
+ /** 三种直设格式共用覆盖/继承语义;字段的值域仍由各命令入口校验。 */
13
+ export declare function directFormatPatches<F extends FormatField>(doc: EditDoc, id: string, field: F, value: FormatValue[F], origin: string): CommandPatches;
14
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { CommandPatches, DistributeElementsCommand } from './types';
3
+ /** 两端保持不动,中间对象按旋转后的世界 AABB 间隙等距排列。 */
4
+ export declare function distributeElementsPatches(doc: EditDoc, command: DistributeElementsCommand, origin: string): CommandPatches;
@@ -0,0 +1,10 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { CommandPatches, InsertColumnCommand, MergeCellsCommand, RemoveColumnCommand, RemoveRowCommand, SetCellPropsCommand, SetColumnWidthCommand, SetRowHeightCommand, SplitCellCommand } from './types';
3
+ export declare function insertColumnPatches(doc: EditDoc, command: InsertColumnCommand, origin: string): CommandPatches;
4
+ export declare function removeRowPatches(doc: EditDoc, command: RemoveRowCommand, origin: string): CommandPatches;
5
+ export declare function removeColumnPatches(doc: EditDoc, command: RemoveColumnCommand, origin: string): CommandPatches;
6
+ export declare function setRowHeightPatches(doc: EditDoc, command: SetRowHeightCommand, origin: string): CommandPatches;
7
+ export declare function setColumnWidthPatches(doc: EditDoc, command: SetColumnWidthCommand, origin: string): CommandPatches;
8
+ export declare function mergeCellsPatches(doc: EditDoc, command: MergeCellsCommand, origin: string): CommandPatches;
9
+ export declare function splitCellPatches(doc: EditDoc, command: SplitCellCommand, origin: string): CommandPatches;
10
+ export declare function setCellPropsPatches(doc: EditDoc, command: SetCellPropsCommand, origin: string): CommandPatches;
@@ -0,0 +1,8 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { CommandPatches, ElementAltTextPatch, SetAltTextCommand } from './types';
3
+ export declare function isElementAltTextPatch(patch: {
4
+ readonly path: readonly unknown[];
5
+ }): patch is ElementAltTextPatch;
6
+ export declare function validateElementAltTextPatch(doc: EditDoc, patch: ElementAltTextPatch, index: number): void;
7
+ export declare function applyElementAltTextPatch(doc: EditDoc, patch: ElementAltTextPatch): void;
8
+ export declare function setAltTextPatches(doc: EditDoc, command: SetAltTextCommand, origin: string): CommandPatches;
@@ -0,0 +1,17 @@
1
+ import type { SpacePoint } from '../space';
2
+ import type { EditDoc, ElementId } from '../types';
3
+ import type { CommandPatches } from './types';
4
+ export interface ElementWorldBounds {
5
+ readonly left: number;
6
+ readonly top: number;
7
+ readonly right: number;
8
+ readonly bottom: number;
9
+ }
10
+ export interface ArrangementTarget {
11
+ readonly id: ElementId;
12
+ readonly bounds: ElementWorldBounds;
13
+ }
14
+ export declare function elementWorldBounds(doc: EditDoc, id: ElementId): ElementWorldBounds;
15
+ /** 排列命令共享“同页、可移动、最外层”边界,避免对齐与分布逐渐产生两套语义。 */
16
+ export declare function arrangementTargets(doc: EditDoc, ids: readonly ElementId[], minimum: number, label: string): ArrangementTarget[];
17
+ export declare function translateElementInSlide(doc: EditDoc, id: ElementId, worldDelta: SpacePoint, origin: string, label: string): CommandPatches;
@@ -2,4 +2,4 @@ import type { EditDoc } from '../types';
2
2
  import type { ElementEffectsPatch, Patch } from './types';
3
3
  export declare function isElementEffectsPatch(patch: Patch): patch is ElementEffectsPatch;
4
4
  export declare function validateElementEffectsPatch(doc: EditDoc, patch: ElementEffectsPatch, index: number): void;
5
- export declare function applyElementEffectsPatch(doc: EditDoc, patch: ElementEffectsPatch): void;
5
+ export { applyRecordOverridePatch as applyElementEffectsPatch } from './record-override';
@@ -2,4 +2,4 @@ import type { EditDoc } from '../types';
2
2
  import type { ElementFillPatch, Patch } from './types';
3
3
  export declare function isElementFillPatch(patch: Patch): patch is ElementFillPatch;
4
4
  export declare function validateElementFillPatch(doc: EditDoc, patch: ElementFillPatch, index: number): void;
5
- export declare function applyElementFillPatch(doc: EditDoc, patch: ElementFillPatch): void;
5
+ export { applyRecordOverridePatch as applyElementFillPatch } from './record-override';
@@ -1,6 +1,9 @@
1
1
  import type { EditDoc } from '../types';
2
2
  import type { Patch } from './types';
3
- import type { ElementGeometryPatch } from './geometry-types';
3
+ import type { ElementGeometryPatch, ElementPresetGeometryPatch } from './geometry-types';
4
4
  export declare function isElementGeometryPatch(patch: Patch): patch is ElementGeometryPatch;
5
+ export declare function isElementPresetGeometryPatch(patch: Patch): patch is ElementPresetGeometryPatch;
6
+ export declare function validateElementPresetGeometryPatch(doc: EditDoc, patch: ElementPresetGeometryPatch, index: number): void;
7
+ export { applyRecordOverridePatch as applyElementPresetGeometryPatch } from './record-override';
5
8
  export declare function validateElementGeometryPatch(doc: EditDoc, patch: ElementGeometryPatch, index: number): void;
6
- export declare function applyElementGeometryPatch(doc: EditDoc, patch: ElementGeometryPatch): void;
9
+ export { applyRecordOverridePatch as applyElementGeometryPatch } from './record-override';
@@ -1,6 +1,6 @@
1
1
  import type { EditDoc, ElementImageReplacement, ElementInsertionResource } from '../types';
2
2
  import type { ElementCropPatch, ElementImageReplacementPatch, ImageResourcePatch, Patch } from './types';
3
- export declare function assertImageReplacement(value: unknown, sourcePart: string, resources: Readonly<Record<string, ElementInsertionResource>>, label: string): asserts value is ElementImageReplacement;
3
+ export declare function assertImageReplacement(value: unknown, sourcePart: string | undefined, resources: Readonly<Record<string, ElementInsertionResource>>, label: string): asserts value is ElementImageReplacement;
4
4
  export declare function assertImageResource(value: unknown, label: string, doc?: EditDoc): asserts value is ElementInsertionResource;
5
5
  /** 无来源溯源的背景只能是公开上传白名单,不能把包内扩展格式伪装成上传。 */
6
6
  export declare function assertUploadImageResource(resource: ElementInsertionResource, label: string): void;
@@ -12,6 +12,6 @@ export declare function isImageResourcePatch(patch: Patch): patch is ImageResour
12
12
  export declare function validateElementCropPatch(doc: EditDoc, patch: ElementCropPatch, index: number): void;
13
13
  export declare function validateElementImageReplacementPatch(doc: EditDoc, patch: ElementImageReplacementPatch, index: number, resources?: Readonly<Record<string, ElementInsertionResource>>): void;
14
14
  export declare function validateImageResourcePatch(doc: EditDoc, patch: ImageResourcePatch, index: number): void;
15
- export declare function applyElementCropPatch(doc: EditDoc, patch: ElementCropPatch): void;
15
+ export { applyRecordOverridePatch as applyElementCropPatch } from './record-override';
16
16
  export declare function applyElementImageReplacementPatch(doc: EditDoc, patch: ElementImageReplacementPatch): void;
17
17
  export declare function applyImageResourcePatch(doc: EditDoc, patch: ImageResourcePatch): void;
@@ -2,4 +2,4 @@ import type { EditDoc } from '../types';
2
2
  import type { ElementLinkPatch, Patch } from './types';
3
3
  export declare function isElementLinkPatch(patch: Patch): patch is ElementLinkPatch;
4
4
  export declare function validateElementLinkPatch(doc: EditDoc, patch: ElementLinkPatch, index: number): void;
5
- export declare function applyElementLinkPatch(doc: EditDoc, patch: ElementLinkPatch): void;
5
+ export { applyRecordOverridePatch as applyElementLinkPatch } from './record-override';
@@ -4,5 +4,5 @@ export declare function isElementNamePatch(patch: {
4
4
  readonly path: readonly unknown[];
5
5
  }): patch is ElementNamePatch;
6
6
  export declare function validateElementNamePatch(doc: EditDoc, patch: ElementNamePatch, index: number): void;
7
- export declare function applyElementNamePatch(doc: EditDoc, patch: ElementNamePatch): void;
7
+ export { applyRecordOverridePatch as applyElementNamePatch } from './record-override';
8
8
  export declare function setNamePatches(doc: EditDoc, command: SetNameCommand, origin: string): CommandPatches;
@@ -2,4 +2,4 @@ import type { EditDoc } from '../types';
2
2
  import type { ElementStrokePatch, Patch } from './types';
3
3
  export declare function isElementStrokePatch(patch: Patch): patch is ElementStrokePatch;
4
4
  export declare function validateElementStrokePatch(doc: EditDoc, patch: ElementStrokePatch, index: number): void;
5
- export declare function applyElementStrokePatch(doc: EditDoc, patch: ElementStrokePatch): void;
5
+ export { applyRecordOverridePatch as applyElementStrokePatch } from './record-override';
@@ -2,5 +2,5 @@ import type { EditDoc, TableRowInsertion } from '../types';
2
2
  import type { CommandPatches, ElementTextPatch, Patch } from './types';
3
3
  export declare function isElementTextPatch(patch: Patch): patch is ElementTextPatch;
4
4
  export declare function clearElementTextPatches(doc: EditDoc, id: string, origin: string): CommandPatches;
5
- export declare function validateElementTextPatch(doc: EditDoc, patch: ElementTextPatch, index: number, stagedTableRows?: Record<string, TableRowInsertion>): void;
5
+ export declare function validateElementTextPatch(doc: EditDoc, patch: ElementTextPatch, index: number, stagedTableRows?: Record<string, TableRowInsertion>, stagedImageResources?: Readonly<Record<string, import('../types').ElementInsertionResource>>): void;
6
6
  export declare function applyElementTextPatch(doc: EditDoc, patch: ElementTextPatch): void;
@@ -1,5 +1,5 @@
1
1
  import type { EditDoc } from '../types';
2
- import type { CommandPatches, ElementTransformPatch, XfrmField } from './types';
2
+ import type { CommandPatches, XfrmField } from './types';
3
3
  /** 变换命令共用权限与 patch 语义,避免位置和翻转两条路径逐渐分叉。 */
4
4
  export declare function elementTransformPatches(doc: EditDoc, id: string, values: Partial<Record<XfrmField, unknown>>, fields: readonly XfrmField[], origin: string, label: string): CommandPatches;
5
- export declare function applyElementTransformPatch(doc: EditDoc, patch: ElementTransformPatch): void;
5
+ export { applyRecordOverridePatch as applyElementTransformPatch } from './record-override';
@@ -1,4 +1,4 @@
1
- import type { CustomGeometry } from '@web-ppt/core';
1
+ import type { CustomGeometry, GeomSpec } from '@web-ppt/core';
2
2
  import type { ElementId } from '../types';
3
3
  export interface SetGeometryCommand {
4
4
  readonly type: 'SetGeometry';
@@ -10,6 +10,18 @@ export interface ConvertToCustomGeometryCommand {
10
10
  readonly type: 'ConvertToCustomGeometry';
11
11
  readonly id: ElementId;
12
12
  }
13
+ export interface SetPresetCommand {
14
+ readonly type: 'SetPreset';
15
+ readonly id: ElementId;
16
+ /** 切换预设会按规范清空旧 avLst;其它形状属性不进入该命令。 */
17
+ readonly preset: string;
18
+ }
19
+ export interface SetAdjCommand {
20
+ readonly type: 'SetAdj';
21
+ readonly id: ElementId;
22
+ readonly name: string;
23
+ readonly value: number;
24
+ }
13
25
  export type ElementGeometryPatch = {
14
26
  readonly op: 'set';
15
27
  readonly path: readonly ['elements', ElementId, 'ovr', 'geometry'];
@@ -20,3 +32,13 @@ export type ElementGeometryPatch = {
20
32
  readonly path: readonly ['elements', ElementId, 'ovr', 'geometry'];
21
33
  readonly origin: string;
22
34
  };
35
+ export type ElementPresetGeometryPatch = {
36
+ readonly op: 'set';
37
+ readonly path: readonly ['elements', ElementId, 'ovr', 'presetGeometry'];
38
+ readonly value: GeomSpec;
39
+ readonly origin: string;
40
+ } | {
41
+ readonly op: 'del';
42
+ readonly path: readonly ['elements', ElementId, 'ovr', 'presetGeometry'];
43
+ readonly origin: string;
44
+ };
@@ -0,0 +1,5 @@
1
+ import type { ElementRecord } from '../types';
2
+ /**
3
+ * 层级命令从不改解析来源;只复制可变覆盖与元数据,避免大选区为历史反复深拷贝整棵只读 src。
4
+ */
5
+ export declare function cloneHierarchyRecord(record: ElementRecord): ElementRecord;
@@ -1,4 +1,11 @@
1
- import type { ClipboardResource } from './types';
1
+ import type { ClipboardResource, ImageResourcePatch } from './types';
2
+ import type { EditDoc, ElementInsertionResource } from '../types';
2
3
  export declare const MAX_REPLACE_IMAGE_BYTES: number;
4
+ export declare function generatedImageResource(resource: ClipboardResource): ElementInsertionResource;
5
+ /** 已被文档保留的资源不能随另一个使用者撤销;新增资源与使用它的覆盖共同进退。 */
6
+ export declare function imageResourcePatches(doc: EditDoc, resources: readonly ElementInsertionResource[], origin: string): {
7
+ forward: ImageResourcePatch[];
8
+ inverse: ImageResourcePatch[];
9
+ };
3
10
  export declare function copyImageBytes(value: unknown, label: string, maxBytes?: number): Uint8Array;
4
11
  export declare function createImageResource(bytesInput: unknown, mime: unknown, label: string, maxBytes?: number): ClipboardResource;
@@ -1,3 +1,16 @@
1
- import type { EditDoc, SlideRecord } from '../types';
1
+ import type { DesignTarget, EditDoc, ElementId, LayoutRecord, MasterRecord, SlideId, SlideRecord } from '../types';
2
+ export interface InsertionCanvas {
3
+ readonly kind: 'slide' | 'layout' | 'master';
4
+ readonly id: SlideId | string;
5
+ readonly children: readonly ElementId[];
6
+ readonly part: string | null;
7
+ }
2
8
  /** 有可补丁原包时返回 OOXML 宿主;否则让命令只改统一模型,保存时由生成器物化宿主。 */
3
9
  export declare function incrementalInsertionPart(doc: EditDoc, slide: SlideRecord): string | null;
10
+ export declare function incrementalLayoutInsertionPart(doc: EditDoc, layout: LayoutRecord): string | null;
11
+ export declare function incrementalMasterInsertionPart(doc: EditDoc, master: MasterRecord): string | null;
12
+ /** 三种插入命令共享同一画布寻址,避免各自近似处理版式与页面宿主。 */
13
+ export declare function resolveInsertionCanvas(doc: EditDoc, command: {
14
+ readonly target?: DesignTarget;
15
+ readonly slideId?: SlideId;
16
+ }, label: string): InsertionCanvas;
@@ -0,0 +1,7 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { LayoutBackgroundPatch, LayoutPropertyPatch, LayoutTransitionPatch, Patch } from './types';
3
+ export declare function isLayoutBackgroundPatch(patch: Patch): patch is LayoutBackgroundPatch;
4
+ export declare function isLayoutTransitionPatch(patch: Patch): patch is LayoutTransitionPatch;
5
+ export declare function isLayoutPropertyPatch(patch: Patch): patch is LayoutPropertyPatch;
6
+ export declare function validateLayoutPropertyPatch(doc: EditDoc, patch: LayoutPropertyPatch, index: number): void;
7
+ export { applyRecordOverridePatch as applyLayoutPropertyPatch } from './record-override';
@@ -0,0 +1,5 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { MasterBackgroundPatch, Patch } from './types';
3
+ export declare function isMasterBackgroundPatch(patch: Patch): patch is MasterBackgroundPatch;
4
+ export declare function validateMasterBackgroundPatch(doc: EditDoc, patch: MasterBackgroundPatch, index: number): void;
5
+ export { applyRecordOverridePatch as applyMasterBackgroundPatch } from './record-override';
@@ -0,0 +1,27 @@
1
+ import type { MasterTextCategory } from '@web-ppt/core';
2
+ import type { MasterDesignTarget, MasterParagraphPropertyInput, MasterRunPropertyOverrides, MasterParagraphPropertyOverrides } from '../types';
3
+ export interface SetMasterTextStyleCommand {
4
+ readonly type: 'SetMasterTextStyle';
5
+ readonly target: MasterDesignTarget;
6
+ readonly category: MasterTextCategory;
7
+ readonly level: number;
8
+ /** null 字段恢复母版来源;level 由命令路径决定,不能在段落值里重复声明。 */
9
+ readonly paragraph?: MasterParagraphPropertyInput;
10
+ /** 母版默认字符样式不承载超链接。 */
11
+ readonly run?: MasterRunPropertyOverrides;
12
+ }
13
+ type SetPatch<S extends 'paragraph' | 'run', F extends string, V> = {
14
+ readonly op: 'set';
15
+ readonly path: readonly ['masters', string, 'ovr', 'textStyles', MasterTextCategory, number, S, F];
16
+ readonly value: V;
17
+ readonly origin: string;
18
+ };
19
+ type DeletePatch<S extends 'paragraph' | 'run', F extends string> = {
20
+ readonly op: 'del';
21
+ readonly path: readonly ['masters', string, 'ovr', 'textStyles', MasterTextCategory, number, S, F];
22
+ readonly origin: string;
23
+ };
24
+ export type MasterParagraphTextStylePatch = SetPatch<'paragraph', keyof MasterParagraphPropertyOverrides & string, NonNullable<MasterParagraphPropertyOverrides[keyof MasterParagraphPropertyOverrides]>> | DeletePatch<'paragraph', keyof MasterParagraphPropertyOverrides & string>;
25
+ export type MasterRunTextStylePatch = SetPatch<'run', keyof MasterRunPropertyOverrides & string, NonNullable<MasterRunPropertyOverrides[keyof MasterRunPropertyOverrides]>> | DeletePatch<'run', keyof MasterRunPropertyOverrides & string>;
26
+ export type MasterTextStylePatch = MasterParagraphTextStylePatch | MasterRunTextStylePatch;
27
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { CommandPatches, Patch } from './types';
3
+ import type { MasterTextStylePatch, SetMasterTextStyleCommand } from './master-text-style-types';
4
+ export declare function isMasterTextStylePatch(patch: Patch): patch is MasterTextStylePatch;
5
+ export declare function setMasterTextStylePatches(doc: EditDoc, command: SetMasterTextStyleCommand, origin: string): CommandPatches;
6
+ export declare function validateMasterTextStylePatch(doc: EditDoc, patch: MasterTextStylePatch, index: number): void;
7
+ export declare function applyMasterTextStylePatch(doc: EditDoc, patch: MasterTextStylePatch): void;
@@ -1,18 +1,22 @@
1
- import type { EditDoc, ElementInsertionRelationship, ElementInsertionResource } from '../types';
1
+ import type { EditDoc, ElementInsertionRelationship, ElementInsertionResource, ElementInsertionSource } from '../types';
2
2
  import type { ElementClipboardPayload } from './types';
3
3
  import type { ClipboardClosure } from '../clipboard-source';
4
4
  import type { OpcPackage } from '@web-ppt/core';
5
5
  export interface PreparedInsertionClosure {
6
- relationships: ElementInsertionRelationship[];
7
- resources: ElementInsertionResource[];
6
+ readonly relationships: readonly ElementInsertionRelationship[];
7
+ readonly resources: readonly ElementInsertionResource[];
8
8
  }
9
+ export declare function activeClosures(doc: EditDoc, part?: string): Pick<ElementInsertionSource, 'relationships' | 'resources'>[];
9
10
  /** 图片替换与剪贴板共用目标 part/关系分配,避免命令伪造一棵空剪贴板树。 */
10
- export declare function prepareMediaResourceClosure(doc: EditDoc, destinationPart: string, sourceId: string, type: string, source: Omit<ElementInsertionResource, 'targetPart' | 'created'>): PreparedInsertionClosure;
11
+ export declare function prepareMediaResourceClosure(doc: EditDoc, destinationPart: string, sourceId: string, type: string, source: Omit<ElementInsertionResource, 'targetPart' | 'created'> & {
12
+ readonly sourcePart?: string;
13
+ }): PreparedInsertionClosure;
11
14
  /** 继承背景来自当前包的已知宿主;按关系闭包逐项改写,不能为一次裁剪扫描整包媒体。 */
12
15
  export declare function prepareTrustedSourceClosure(doc: EditDoc, pkg: OpcPackage, source: ClipboardClosure, sourcePart: string, destinationPart: string): PreparedInsertionClosure;
13
16
  /** 来源与目标是同一 slide 时复用现有关系,裁剪不应制造未引用的新 rId。 */
14
17
  export declare function prepareExistingSourceClosure(pkg: OpcPackage, source: ClipboardClosure, sourcePart: string): PreparedInsertionClosure;
15
18
  /** 先验证完整闭包并分配所有目标名;调用返回前不得触碰 EditDoc。 */
16
- export declare function prepareInsertionClosures(doc: EditDoc, payload: ElementClipboardPayload, roots: readonly string[], destinationPart: string, options?: {
19
+ export declare function prepareInsertionClosures(doc: EditDoc, payload: Pick<ElementClipboardPayload, 'ooxml' | 'resources'>, roots: readonly string[], destinationPart: string, options?: {
17
20
  readonly preverifiedResourceHashes?: ReadonlySet<string>;
21
+ readonly sourceOnly?: boolean;
18
22
  }): Map<string, PreparedInsertionClosure>;
@@ -0,0 +1,3 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { Patch } from './types';
3
+ export declare function applyPatchValues(doc: EditDoc, patches: readonly Patch[]): void;
@@ -0,0 +1 @@
1
+ export declare function assertPatchCount(count: number): void;
@@ -1,4 +1,4 @@
1
1
  import type { EditDoc } from '../types';
2
2
  import type { Patch } from './types';
3
- export declare function collectPatchInvalidation(doc: EditDoc, patch: Patch, dirtyElements: Set<string>, dirtySlides: Set<string>): void;
3
+ export declare function collectPatchInvalidation(doc: EditDoc, patch: Patch, dirtyElements: Set<string>, dirtySlides: Set<string>, addressTargets: Set<string>): void;
4
4
  export declare function canInvalidateAgainst(doc: EditDoc, patch: Patch): boolean;
@@ -0,0 +1,4 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { Patch } from './types';
3
+ /** 结构补丁只复制可能被写入的记录;大文稿验证不应深克隆整份模型。 */
4
+ export declare function structuralPatchStage(doc: EditDoc, patches: readonly Patch[]): EditDoc;
@@ -0,0 +1,5 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { ElementGeometryPatch, ElementPresetGeometryPatch } from './geometry-types';
3
+ import type { LayoutPropertyPatch, MasterBackgroundPatch, SlidePropertyPatch, SlideBackgroundImagePatch, ElementTransformPatch, ElementCropPatch, ElementEffectsPatch, ElementFillPatch, ElementLinkPatch, ElementNamePatch, ElementStrokePatch } from './types';
4
+ /** 值已通过各领域校验,应用阶段共用克隆/删除语义,避免属性实现漂移。 */
5
+ export declare function applyRecordOverridePatch(doc: EditDoc, patch: LayoutPropertyPatch | MasterBackgroundPatch | Exclude<SlidePropertyPatch, SlideBackgroundImagePatch> | ElementGeometryPatch | ElementPresetGeometryPatch | ElementTransformPatch | ElementCropPatch | ElementEffectsPatch | ElementFillPatch | ElementLinkPatch | ElementNamePatch | ElementStrokePatch): void;
@@ -1,3 +1,8 @@
1
+ import type { ImageElement } from '@web-ppt/core';
1
2
  import type { EditDoc } from '../types';
2
- import type { CommandPatches, ReplaceImageCommand } from './types';
3
+ import type { ClipboardResource, CommandPatches, ReplaceImageCommand } from './types';
3
4
  export declare function replaceImagePatches(doc: EditDoc, command: ReplaceImageCommand, origin: string): CommandPatches;
5
+ /** 普通图片与媒体海报只替换同一张 blip;资源、历史和保存不能各维护一套。 */
6
+ export declare function replaceImageResourcePatches(doc: EditDoc, record: EditDoc['elements'][string] & {
7
+ src: ImageElement;
8
+ }, resource: ClipboardResource, origin: string): CommandPatches;
@@ -0,0 +1,10 @@
1
+ import type { EditDoc, SectionState } from '../types';
2
+ import type { AddSectionCommand, CommandPatches, MoveSectionCommand, Patch, RemoveSectionCommand, RenameSectionCommand, SectionStatePatch } from './types';
3
+ export declare function assertSectionState(doc: EditDoc, value: unknown, label: string): asserts value is SectionState;
4
+ export declare function isSectionStatePatch(patch: Patch): patch is SectionStatePatch;
5
+ export declare function validateSectionStatePatch(doc: EditDoc, patch: SectionStatePatch, index: number): void;
6
+ export declare function applySectionStatePatch(doc: EditDoc, patch: SectionStatePatch): void;
7
+ export declare function addSectionPatches(doc: EditDoc, command: AddSectionCommand, origin: string): CommandPatches;
8
+ export declare function renameSectionPatches(doc: EditDoc, command: RenameSectionCommand, origin: string): CommandPatches;
9
+ export declare function moveSectionPatches(doc: EditDoc, command: MoveSectionCommand, origin: string): CommandPatches;
10
+ export declare function removeSectionPatches(doc: EditDoc, command: RemoveSectionCommand, origin: string): CommandPatches;
@@ -0,0 +1,5 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { CommandPatches } from './types';
3
+ import type { SetAdjCommand, SetPresetCommand } from './geometry-types';
4
+ export declare function setPresetPatches(doc: EditDoc, command: SetPresetCommand, origin: string): CommandPatches;
5
+ export declare function setAdjPatches(doc: EditDoc, command: SetAdjCommand, origin: string): CommandPatches;
@@ -1,14 +1,23 @@
1
1
  import type { Fill, ImageTilePlacement, Transition } from '@web-ppt/core';
2
2
  import type { SlideTransitionInput } from '../slide-transition';
3
- import type { EditAnimationStep, ImageCrop, SlideId, SlideImageBackground, SlideNotesBinding } from '../types';
4
- export interface SetBackgroundCommand {
3
+ import type { DesignTarget, EditAnimationStep, ImageCrop, LayoutDesignTarget, SlideId, SlideImageBackground, SlideNotesBinding } from '../types';
4
+ export type SetBackgroundCommand = {
5
5
  readonly type: 'SetBackground';
6
6
  readonly id: SlideId;
7
+ readonly target?: never;
7
8
  /** null 恢复来源;显式无背景使用 { type: 'none' }。 */
8
9
  readonly fill: Exclude<Fill, {
9
10
  type: 'image';
10
11
  }> | null;
11
- }
12
+ } | {
13
+ readonly type: 'SetBackground';
14
+ readonly target: DesignTarget;
15
+ readonly id?: never;
16
+ /** null 恢复来源;版式背景不接受图片,避免隐式扩张 OPC 资源闭包。 */
17
+ readonly fill: Exclude<Fill, {
18
+ type: 'image';
19
+ }> | null;
20
+ };
12
21
  export interface SetBackgroundImageCommand {
13
22
  readonly type: 'SetBackgroundImage';
14
23
  readonly id: SlideId;
@@ -31,12 +40,18 @@ export interface SetHiddenCommand {
31
40
  /** null 恢复来源;false 可覆盖来源隐藏页。 */
32
41
  readonly v: boolean | null;
33
42
  }
34
- export interface SetTransitionCommand {
43
+ export type SetTransitionCommand = {
35
44
  readonly type: 'SetTransition';
36
45
  readonly id: SlideId;
46
+ readonly target?: never;
37
47
  /** null 恢复来源;type=none 明确关闭切换。 */
38
48
  readonly t: SlideTransitionInput | null;
39
- }
49
+ } | {
50
+ readonly type: 'SetTransition';
51
+ readonly target: LayoutDesignTarget;
52
+ readonly id?: never;
53
+ readonly t: SlideTransitionInput | null;
54
+ };
40
55
  export interface SetAnimationsCommand {
41
56
  readonly type: 'SetAnimations';
42
57
  readonly slideId: SlideId;
@@ -133,3 +148,38 @@ export type SlideAnimationsPatch = {
133
148
  readonly origin: string;
134
149
  };
135
150
  export type SlidePropertyPatch = SlideBackgroundPatch | SlideBackgroundImagePatch | SlideHiddenPatch | SlideTransitionPatch | SlideAnimationsPatch;
151
+ export type LayoutBackgroundPatch = {
152
+ readonly op: 'set';
153
+ readonly path: readonly ['layouts', string, 'ovr', 'background'];
154
+ readonly value: Exclude<Fill, {
155
+ type: 'image';
156
+ }>;
157
+ readonly origin: string;
158
+ } | {
159
+ readonly op: 'del';
160
+ readonly path: readonly ['layouts', string, 'ovr', 'background'];
161
+ readonly origin: string;
162
+ };
163
+ export type LayoutTransitionPatch = {
164
+ readonly op: 'set';
165
+ readonly path: readonly ['layouts', string, 'ovr', 'transition'];
166
+ readonly value: Transition;
167
+ readonly origin: string;
168
+ } | {
169
+ readonly op: 'del';
170
+ readonly path: readonly ['layouts', string, 'ovr', 'transition'];
171
+ readonly origin: string;
172
+ };
173
+ export type LayoutPropertyPatch = LayoutBackgroundPatch | LayoutTransitionPatch;
174
+ export type MasterBackgroundPatch = {
175
+ readonly op: 'set';
176
+ readonly path: readonly ['masters', string, 'ovr', 'background'];
177
+ readonly value: Exclude<Fill, {
178
+ type: 'image';
179
+ }>;
180
+ readonly origin: string;
181
+ } | {
182
+ readonly op: 'del';
183
+ readonly path: readonly ['masters', string, 'ovr', 'background'];
184
+ readonly origin: string;
185
+ };