@web-ppt/edit-core 0.5.0-beta.1 → 0.5.0-beta.7

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 (367) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/README.md +165 -22
  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/collaboration-identity.d.ts +3 -0
  107. package/dist/commands/add-slide-identity.d.ts +4 -0
  108. package/dist/commands/bullet-image-resource.d.ts +11 -0
  109. package/dist/commands/clear-format.d.ts +4 -0
  110. package/dist/commands/common-object-slide-patch.d.ts +4 -0
  111. package/dist/commands/common-object-slide-types.d.ts +68 -0
  112. package/dist/commands/convert-to-custom-geometry.d.ts +4 -0
  113. package/dist/commands/direct-format-patches.d.ts +11 -5
  114. package/dist/commands/distribute-elements.d.ts +4 -0
  115. package/dist/commands/edit-table-grid.d.ts +10 -0
  116. package/dist/commands/element-alt-text.d.ts +8 -0
  117. package/dist/commands/element-arrangement.d.ts +17 -0
  118. package/dist/commands/element-effects.d.ts +1 -1
  119. package/dist/commands/element-fill.d.ts +1 -1
  120. package/dist/commands/element-geometry.d.ts +9 -0
  121. package/dist/commands/element-hierarchy.d.ts +6 -0
  122. package/dist/commands/element-image-content.d.ts +2 -2
  123. package/dist/commands/element-link.d.ts +1 -1
  124. package/dist/commands/element-name.d.ts +1 -1
  125. package/dist/commands/element-stroke.d.ts +1 -1
  126. package/dist/commands/element-table-style.d.ts +5 -0
  127. package/dist/commands/element-text.d.ts +1 -1
  128. package/dist/commands/element-transform.d.ts +2 -2
  129. package/dist/commands/frame-decomposition.d.ts +10 -0
  130. package/dist/commands/generated-creation-defaults.d.ts +4 -0
  131. package/dist/commands/geometry-types.d.ts +44 -0
  132. package/dist/commands/group-types.d.ts +24 -0
  133. package/dist/commands/group.d.ts +4 -0
  134. package/dist/commands/hierarchy-record.d.ts +5 -0
  135. package/dist/commands/image-resource.d.ts +8 -1
  136. package/dist/commands/insertion-host.d.ts +16 -0
  137. package/dist/commands/insertion-rect.d.ts +2 -0
  138. package/dist/commands/layout-property.d.ts +7 -0
  139. package/dist/commands/master-property.d.ts +5 -0
  140. package/dist/commands/master-text-style-types.d.ts +27 -0
  141. package/dist/commands/master-text-style.d.ts +7 -0
  142. package/dist/commands/paste-resources.d.ts +9 -5
  143. package/dist/commands/patch-apply.d.ts +3 -0
  144. package/dist/commands/patch-count.d.ts +1 -0
  145. package/dist/commands/patch-invalidation.d.ts +4 -0
  146. package/dist/commands/patch-stage.d.ts +4 -0
  147. package/dist/commands/patch.d.ts +4 -0
  148. package/dist/commands/record-clone.d.ts +3 -0
  149. package/dist/commands/record-override.d.ts +5 -0
  150. package/dist/commands/replace-image.d.ts +6 -1
  151. package/dist/commands/sections.d.ts +10 -0
  152. package/dist/commands/set-geometry.d.ts +4 -0
  153. package/dist/commands/set-preset.d.ts +5 -0
  154. package/dist/commands/set-table-style.d.ts +3 -0
  155. package/dist/commands/slide-property-types.d.ts +55 -5
  156. package/dist/commands/slide-size.d.ts +7 -0
  157. package/dist/commands/spid.d.ts +2 -1
  158. package/dist/commands/table-grid-patch.d.ts +12 -0
  159. package/dist/commands/table-style-types.d.ts +28 -0
  160. package/dist/commands/text-target.d.ts +3 -2
  161. package/dist/commands/theme-types.d.ts +47 -0
  162. package/dist/commands/theme.d.ts +9 -0
  163. package/dist/commands/types.d.ts +219 -17
  164. package/dist/commands/ungroup-source.d.ts +3 -0
  165. package/dist/commands/ungroup.d.ts +4 -0
  166. package/dist/comments/index.d.ts +35 -0
  167. package/dist/comments/save.d.ts +3 -0
  168. package/dist/comments/state.d.ts +10 -0
  169. package/dist/comments/xml.d.ts +12 -0
  170. package/dist/comments.js +782 -0
  171. package/dist/common-object-slide-types.d.ts +34 -0
  172. package/dist/custom-geometry-path.d.ts +3 -0
  173. package/dist/custom-geometry.d.ts +12 -0
  174. package/dist/data-validation.d.ts +1 -1
  175. package/dist/describe/budget.d.ts +3 -0
  176. package/dist/describe/index.d.ts +5 -0
  177. package/dist/describe/read.d.ts +4 -0
  178. package/dist/describe/types.d.ts +103 -0
  179. package/dist/describe.js +192 -0
  180. package/dist/design-dependencies.d.ts +8 -0
  181. package/dist/design-projection-package.d.ts +10 -0
  182. package/dist/design-target.d.ts +10 -0
  183. package/dist/design.d.ts +3 -0
  184. package/dist/document-extensions.d.ts +9 -0
  185. package/dist/document.d.ts +1 -1
  186. package/dist/dynamic-projection.d.ts +6 -0
  187. package/dist/edit-core.js +5680 -3413
  188. package/dist/editor.d.ts +19 -2
  189. package/dist/element-source.d.ts +11 -0
  190. package/dist/element-spids.d.ts +4 -0
  191. package/dist/extension-address-journal.d.ts +9 -0
  192. package/dist/extension-address-remap.d.ts +14 -0
  193. package/dist/extension-addresses.d.ts +20 -0
  194. package/dist/extension-copy-history.d.ts +7 -0
  195. package/dist/extension-copy.d.ts +16 -0
  196. package/dist/extension-migration-receipt.d.ts +34 -0
  197. package/dist/extension-recovery-context.d.ts +5 -0
  198. package/dist/extension-runtime.d.ts +64 -0
  199. package/dist/generate/comments.d.ts +3 -0
  200. package/dist/generate/compatibility-parts.d.ts +14 -0
  201. package/dist/generate/compatibility-references.d.ts +3 -0
  202. package/dist/generate/compatibility.d.ts +4 -0
  203. package/dist/generate/custom-geometry.d.ts +2 -0
  204. package/dist/generate/index.d.ts +13 -0
  205. package/dist/generate/links.d.ts +3 -0
  206. package/dist/generate/master-defaults.d.ts +4 -0
  207. package/dist/generate/materialize.d.ts +2 -0
  208. package/dist/generate/math.d.ts +3 -0
  209. package/dist/generate/media.d.ts +13 -0
  210. package/dist/generate/portable-clipboard.d.ts +4 -0
  211. package/dist/generate/projection-tree.d.ts +8 -0
  212. package/dist/generate/table.d.ts +4 -0
  213. package/dist/generate/template.d.ts +70 -0
  214. package/dist/generate/text-body.d.ts +2 -0
  215. package/dist/generate/text-effects.d.ts +5 -0
  216. package/dist/generate/text-override.d.ts +8 -0
  217. package/dist/generate/validation.d.ts +3 -0
  218. package/dist/generate/warp.d.ts +2 -0
  219. package/dist/generate.js +1464 -0
  220. package/dist/history.d.ts +11 -1
  221. package/dist/hyperlink.d.ts +2 -0
  222. package/dist/identities.d.ts +4 -0
  223. package/dist/identity-allocation.d.ts +12 -0
  224. package/dist/identity-watermark.d.ts +4 -0
  225. package/dist/image-content.d.ts +5 -2
  226. package/dist/image-resource-history.d.ts +2 -0
  227. package/dist/index-C2r7c6G6.js +714 -0
  228. package/dist/index-CYDvbiwF.js +1 -0
  229. package/dist/index.d.ts +43 -7
  230. package/dist/ink/index.d.ts +27 -0
  231. package/dist/ink/model.d.ts +4 -0
  232. package/dist/ink/save.d.ts +3 -0
  233. package/dist/ink/source.d.ts +7 -0
  234. package/dist/ink.js +324 -0
  235. package/dist/layout-assets.d.ts +3 -1
  236. package/dist/layout-projection.d.ts +19 -5
  237. package/dist/layout-state.d.ts +2 -0
  238. package/dist/layout-types.d.ts +42 -0
  239. package/dist/layout.d.ts +5 -0
  240. package/dist/lint/color.d.ts +5 -0
  241. package/dist/lint/index.d.ts +7 -0
  242. package/dist/lint/prompts.d.ts +3 -0
  243. package/dist/lint/report.d.ts +21 -0
  244. package/dist/lint/sampler-batch.d.ts +4 -0
  245. package/dist/lint/sampler-images.d.ts +2 -0
  246. package/dist/lint/sampler.d.ts +9 -0
  247. package/dist/lint/snapshot.d.ts +34 -0
  248. package/dist/lint/types.d.ts +67 -0
  249. package/dist/lint-sampler.js +187 -0
  250. package/dist/lint.js +659 -0
  251. package/dist/master-state.d.ts +3 -0
  252. package/dist/master-text-style-state.d.ts +3 -0
  253. package/dist/master-types.d.ts +55 -0
  254. package/dist/master.d.ts +5 -0
  255. package/dist/media/audio-icon.d.ts +2 -0
  256. package/dist/media/commands.d.ts +3 -0
  257. package/dist/media/index.d.ts +10 -0
  258. package/dist/media/markup.d.ts +10 -0
  259. package/dist/media/mp4-boxes.d.ts +12 -0
  260. package/dist/media/mp4-fragments.d.ts +8 -0
  261. package/dist/media/mp4-samples.d.ts +4 -0
  262. package/dist/media/mp4.d.ts +2 -0
  263. package/dist/media/poster.d.ts +2 -0
  264. package/dist/media/replace-poster.d.ts +3 -0
  265. package/dist/media/resource.d.ts +4 -0
  266. package/dist/media/source.d.ts +14 -0
  267. package/dist/media/types.d.ts +33 -0
  268. package/dist/media-properties.d.ts +4 -0
  269. package/dist/media.js +1630 -0
  270. package/dist/model-invariants-BM19JVxy.js +8980 -0
  271. package/dist/object-source.d.ts +11 -0
  272. package/dist/ole/container.d.ts +14 -0
  273. package/dist/ole/content.d.ts +94 -0
  274. package/dist/ole/index.d.ts +20 -0
  275. package/dist/ole/preview.d.ts +3 -0
  276. package/dist/ole/save.d.ts +2 -0
  277. package/dist/ole/state.d.ts +16 -0
  278. package/dist/ole.js +870 -0
  279. package/dist/opc/patch.d.ts +2 -0
  280. package/dist/opc.js +1 -1
  281. package/dist/paragraph-level.d.ts +11 -0
  282. package/dist/paragraph-property-schema.d.ts +5 -2
  283. package/dist/{patch-DO8497wO.js → patch-BwhfBbYE.js} +112 -95
  284. package/dist/patch-change.d.ts +4 -0
  285. package/dist/patch-events.d.ts +16 -0
  286. package/dist/ppt/appearance.d.ts +11 -0
  287. package/dist/ppt/binary.d.ts +20 -0
  288. package/dist/ppt/drawing.d.ts +18 -0
  289. package/dist/ppt/geometry.d.ts +4 -0
  290. package/dist/ppt/index.d.ts +12 -0
  291. package/dist/ppt/pictures.d.ts +11 -0
  292. package/dist/ppt/text.d.ts +9 -0
  293. package/dist/ppt.js +774 -0
  294. package/dist/preset-geometry.d.ts +6 -0
  295. package/dist/projection.d.ts +2 -0
  296. package/dist/query-BHLjWjnu.js +903 -0
  297. package/dist/recovery-identity.d.ts +3 -1
  298. package/dist/recovery-migrations.d.ts +3 -0
  299. package/dist/recovery.d.ts +3 -0
  300. package/dist/resize/index.d.ts +6 -0
  301. package/dist/resize/text.d.ts +4 -0
  302. package/dist/resize.js +5090 -0
  303. package/dist/retained-element-origins.d.ts +6 -0
  304. package/dist/run-property-fields.d.ts +12 -0
  305. package/dist/run-property-schema.d.ts +3 -1
  306. package/dist/run-style.d.ts +15 -0
  307. package/dist/save/alt-text.d.ts +4 -0
  308. package/dist/save/comments.d.ts +3 -0
  309. package/dist/save/effects.d.ts +2 -1
  310. package/dist/save/extension-availability.d.ts +3 -0
  311. package/dist/save/extension-elements.d.ts +26 -0
  312. package/dist/save/geometry.d.ts +5 -0
  313. package/dist/save/index.d.ts +6 -1
  314. package/dist/save/insertion.d.ts +7 -3
  315. package/dist/save/layout-properties.d.ts +4 -0
  316. package/dist/save/master-properties.d.ts +5 -0
  317. package/dist/save/notes.d.ts +2 -0
  318. package/dist/save/paragraph-overrides.d.ts +3 -0
  319. package/dist/save/run-overrides.d.ts +10 -0
  320. package/dist/save/shape-format.d.ts +3 -0
  321. package/dist/save/slide-parts.d.ts +1 -0
  322. package/dist/save/table-style-part.d.ts +11 -0
  323. package/dist/save/table.d.ts +5 -0
  324. package/dist/save/text-source-less.d.ts +6 -0
  325. package/dist/save/xfrm.d.ts +8 -2
  326. package/dist/save.js +502 -1480
  327. package/dist/sections.d.ts +8 -0
  328. package/dist/session-assets.d.ts +4 -0
  329. package/dist/slide-parts-D0o_DDhi.js +1331 -0
  330. package/dist/slide-size.d.ts +6 -0
  331. package/dist/smartart/drawing.d.ts +3 -0
  332. package/dist/smartart/index.d.ts +16 -0
  333. package/dist/smartart/model.d.ts +18 -0
  334. package/dist/smartart/save.d.ts +3 -0
  335. package/dist/smartart.js +604 -0
  336. package/dist/source-retention.d.ts +7 -0
  337. package/dist/space.d.ts +37 -0
  338. package/dist/table-cell.d.ts +7 -1
  339. package/dist/table-direct-markup.d.ts +7 -1
  340. package/dist/table-grid-projection.d.ts +6 -0
  341. package/dist/table-grid.d.ts +45 -0
  342. package/dist/table-invariants.d.ts +4 -0
  343. package/dist/table-rows.d.ts +2 -1
  344. package/dist/table-scale.d.ts +4 -0
  345. package/dist/table-style.d.ts +21 -0
  346. package/dist/templates/index.d.ts +4 -0
  347. package/dist/templates/recipes.d.ts +5 -0
  348. package/dist/templates/types.d.ts +17 -0
  349. package/dist/templates.js +543 -0
  350. package/dist/text-flatten.d.ts +6 -0
  351. package/dist/text-fragment.d.ts +5 -0
  352. package/dist/text-model.d.ts +8 -8
  353. package/dist/text-override-validation.d.ts +6 -2
  354. package/dist/text-selection.d.ts +4 -0
  355. package/dist/theme-projection.d.ts +8 -0
  356. package/dist/theme-xml.d.ts +3 -0
  357. package/dist/theme.d.ts +14 -0
  358. package/dist/types.d.ts +217 -8
  359. package/dist/xml/index.d.ts +1 -1
  360. package/dist/xml/nodes.d.ts +2 -2
  361. package/dist/xml/shape-ids.d.ts +3 -0
  362. package/dist/xml.js +19 -16
  363. package/package.json +77 -5
  364. package/schemas/describe.schema.json +479 -0
  365. package/schemas/lint.schema.json +145 -0
  366. package/dist/index-D4ZTaYOa.js +0 -706
  367. package/dist/insertion-DabLme_U.js +0 -5471
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ import type { EditDoc } from './types';
2
+ /** provider 分配唯一 slot 后,在任何消息收发前固化本副本的逻辑与 OOXML 身份区间。 */
3
+ export declare function configureCollaborationIdentity(doc: EditDoc, replicaId: string, slot: number, count?: number): void;
@@ -5,4 +5,8 @@ export declare function allocateSlideOpcIdentity(doc: EditDoc): {
5
5
  presentationRelationshipId: string;
6
6
  };
7
7
  export declare function allocateNotesPart(doc: EditDoc): string;
8
+ /** 协同绑定期固化全部全局 OPC 数值区间,后续远端补丁不会改变本副本的分配边界。 */
9
+ export declare function prepareSlideOpcNamespaces(doc: EditDoc): void;
10
+ /** presentation 关系与列表只解析一次;调用方可按 part 批量取得稳定数值身份。 */
11
+ export declare function presentationSlideIdsByPart(doc: EditDoc): ReadonlyMap<string, number>;
8
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
+ };
@@ -0,0 +1,4 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { CommandPatches } from './types';
3
+ import type { ConvertToCustomGeometryCommand } from './geometry-types';
4
+ export declare function convertToCustomGeometryPatches(doc: EditDoc, command: ConvertToCustomGeometryCommand, origin: string): CommandPatches;
@@ -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';
@@ -0,0 +1,9 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { Patch } from './types';
3
+ import type { ElementGeometryPatch, ElementPresetGeometryPatch } from './geometry-types';
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';
8
+ export declare function validateElementGeometryPatch(doc: EditDoc, patch: ElementGeometryPatch, index: number): void;
9
+ export { applyRecordOverridePatch as applyElementGeometryPatch } from './record-override';
@@ -0,0 +1,6 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { ElementHierarchyPatch, ElementHierarchyState, Patch } from './types';
3
+ export declare function isElementHierarchyPatch(patch: Patch): patch is ElementHierarchyPatch;
4
+ export declare function validateElementHierarchyPatch(doc: EditDoc, patch: ElementHierarchyPatch, index: number): void;
5
+ export declare function applyElementHierarchyPatch(doc: EditDoc, patch: ElementHierarchyPatch): void;
6
+ export declare function elementHierarchySlide(doc: EditDoc, state: ElementHierarchyState): string;
@@ -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';
@@ -0,0 +1,5 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { ElementTableStylePatch, Patch } from './types';
3
+ export declare function isElementTableStylePatch(patch: Patch): patch is ElementTableStylePatch;
4
+ export declare function validateElementTableStylePatch(doc: EditDoc, patch: ElementTableStylePatch, index: number): void;
5
+ export declare function applyElementTableStylePatch(doc: EditDoc, patch: ElementTableStylePatch): void;
@@ -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';
@@ -0,0 +1,10 @@
1
+ import type { AffineMatrix } from '../space';
2
+ /** PPTX frame 只能表达旋转、缩放与镜像;仿射矩阵含斜切时必须由调用者拒绝。 */
3
+ export declare function decomposeFrameMatrix(matrix: AffineMatrix, width: number, height: number, shearError: string): {
4
+ x: number;
5
+ y: number;
6
+ w: number;
7
+ h: number;
8
+ rot: number;
9
+ reflectH: boolean;
10
+ };
@@ -0,0 +1,4 @@
1
+ import type { ShapeCreationDefaults, TableCreationDefaults } from '@web-ppt/core';
2
+ /** `.ppt` 没有 OOXML 主题创建默认值;生成包因此用与固定骨架配套的显式中性值。 */
3
+ export declare const GENERATED_SHAPE_DEFAULTS: ShapeCreationDefaults;
4
+ export declare const GENERATED_TABLE_DEFAULTS: TableCreationDefaults;
@@ -0,0 +1,44 @@
1
+ import type { CustomGeometry, GeomSpec } from '@web-ppt/core';
2
+ import type { ElementId } from '../types';
3
+ export interface SetGeometryCommand {
4
+ readonly type: 'SetGeometry';
5
+ readonly id: ElementId;
6
+ /** null 恢复来源几何;预设形状必须先走显式自由形状转换命令。 */
7
+ readonly geometry: CustomGeometry | null;
8
+ }
9
+ export interface ConvertToCustomGeometryCommand {
10
+ readonly type: 'ConvertToCustomGeometry';
11
+ readonly id: ElementId;
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
+ }
25
+ export type ElementGeometryPatch = {
26
+ readonly op: 'set';
27
+ readonly path: readonly ['elements', ElementId, 'ovr', 'geometry'];
28
+ readonly value: CustomGeometry;
29
+ readonly origin: string;
30
+ } | {
31
+ readonly op: 'del';
32
+ readonly path: readonly ['elements', ElementId, 'ovr', 'geometry'];
33
+ readonly origin: string;
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,24 @@
1
+ import type { ElementId, ElementRecord, RemovedElementRecord, SlideId } from '../types';
2
+ export interface GroupCommand {
3
+ readonly type: 'Group';
4
+ readonly ids: readonly ElementId[];
5
+ }
6
+ export interface UngroupCommand {
7
+ readonly type: 'Ungroup';
8
+ readonly id: ElementId;
9
+ }
10
+ export interface ElementHierarchyState {
11
+ /** 结构变化发生前后都存在的外部父级,用于精确失效所属页或祖先。 */
12
+ readonly parent: SlideId | ElementId;
13
+ readonly affected: readonly ElementId[];
14
+ readonly records: Readonly<Record<ElementId, ElementRecord | null>>;
15
+ readonly children: Readonly<Record<SlideId | ElementId, readonly ElementId[]>>;
16
+ readonly removed: Readonly<Record<ElementId, RemovedElementRecord | null>>;
17
+ }
18
+ /** 组合/解组同时改变多个父链,必须作为一个不可见中间态的结构原子落模。 */
19
+ export type ElementHierarchyPatch = {
20
+ readonly op: 'set';
21
+ readonly path: readonly ['elements', ElementId, 'hierarchy'];
22
+ readonly value: ElementHierarchyState;
23
+ readonly origin: string;
24
+ };
@@ -0,0 +1,4 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { CommandPatches, GroupCommand } from './types';
3
+ /** 新组是空 OOXML 容器;孩子保留原身份与变换,只改变直属父链。 */
4
+ export declare function groupPatches(doc: EditDoc, command: GroupCommand, origin: string): CommandPatches;
@@ -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;
@@ -0,0 +1,16 @@
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
+ }
8
+ /** 有可补丁原包时返回 OOXML 宿主;否则让命令只改统一模型,保存时由生成器物化宿主。 */
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;
@@ -7,3 +7,5 @@ export interface InsertionRect {
7
7
  export declare const EMU_PER_PX = 9525;
8
8
  export declare const pxToEmu: (value: number) => number;
9
9
  export declare function assertInsertionRect(value: unknown, label: string): asserts value is InsertionRect;
10
+ /** OOXML 允许线条的单轴尺寸为零;已有元素 frame 的约束不同于新增实体的正尺寸。 */
11
+ export declare function assertFrameRect(value: unknown, label: string): asserts value is InsertionRect;
@@ -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;
@@ -0,0 +1,4 @@
1
+ import type { EditDoc } from '../types';
2
+ import type { Patch } from './types';
3
+ export declare function collectPatchInvalidation(doc: EditDoc, patch: Patch, dirtyElements: Set<string>, dirtySlides: Set<string>, addressTargets: Set<string>): void;
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;
@@ -1,5 +1,9 @@
1
1
  import type { EditDoc, ProjectionInvalidation } from '../types';
2
2
  import type { Patch } from './types';
3
+ /** 协同等调用方可在不触碰真实模型的前提下验真一批外部 Patch。 */
4
+ export declare function assertPatchesApplicable(doc: EditDoc, patches: readonly Patch[]): void;
5
+ /** 返回写时复制的外部 Patch 预演模型;调用方只能读取,真实文档始终不变。 */
6
+ export declare function stageExternalPatches(doc: EditDoc, patches: readonly Patch[]): EditDoc;
3
7
  /** JSON/协同 seam:结构快照必须先在写时复制的完整模型上验真。 */
4
8
  export declare function applyPatches(doc: EditDoc, patches: readonly Patch[]): ProjectionInvalidation;
5
9
  /** 仅供同一事务内刚生成的命令 Patch;事务末尾由 Editor 统一校验完整模型。 */
@@ -0,0 +1,3 @@
1
+ import type { ElementRecord } from '../types';
2
+ /** 九级文字样式是解析期只读目录;单记录快照复用它,批量历史再统一深拷贝。 */
3
+ export declare function cloneElementRecord(record: ElementRecord): ElementRecord;
@@ -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;