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

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 (72) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/dist/collaboration-identity.d.ts +3 -0
  4. package/dist/commands/add-slide-identity.d.ts +2 -0
  5. package/dist/commands/convert-to-custom-geometry.d.ts +4 -0
  6. package/dist/commands/element-geometry.d.ts +6 -0
  7. package/dist/commands/element-hierarchy.d.ts +6 -0
  8. package/dist/commands/element-table-style.d.ts +5 -0
  9. package/dist/commands/frame-decomposition.d.ts +10 -0
  10. package/dist/commands/generated-creation-defaults.d.ts +4 -0
  11. package/dist/commands/geometry-types.d.ts +22 -0
  12. package/dist/commands/group-types.d.ts +24 -0
  13. package/dist/commands/group.d.ts +4 -0
  14. package/dist/commands/insertion-host.d.ts +3 -0
  15. package/dist/commands/insertion-rect.d.ts +2 -0
  16. package/dist/commands/patch-invalidation.d.ts +4 -0
  17. package/dist/commands/patch.d.ts +4 -0
  18. package/dist/commands/record-clone.d.ts +3 -0
  19. package/dist/commands/set-geometry.d.ts +4 -0
  20. package/dist/commands/set-table-style.d.ts +3 -0
  21. package/dist/commands/spid.d.ts +1 -0
  22. package/dist/commands/table-style-types.d.ts +28 -0
  23. package/dist/commands/text-target.d.ts +1 -0
  24. package/dist/commands/types.d.ts +29 -4
  25. package/dist/commands/ungroup.d.ts +4 -0
  26. package/dist/custom-geometry-path.d.ts +3 -0
  27. package/dist/custom-geometry.d.ts +12 -0
  28. package/dist/document-B1jjN-QB.js +274 -0
  29. package/dist/edit-core.js +3597 -2639
  30. package/dist/editor.d.ts +6 -1
  31. package/dist/generate/custom-geometry.d.ts +2 -0
  32. package/dist/generate/index.d.ts +12 -0
  33. package/dist/generate/links.d.ts +3 -0
  34. package/dist/generate/materialize.d.ts +2 -0
  35. package/dist/generate/media.d.ts +13 -0
  36. package/dist/generate/table.d.ts +4 -0
  37. package/dist/generate/template.d.ts +3 -0
  38. package/dist/generate.js +744 -0
  39. package/dist/hyperlink.d.ts +2 -0
  40. package/dist/identity-allocation.d.ts +12 -0
  41. package/dist/identity-watermark.d.ts +4 -0
  42. package/dist/image-resource-DbgJS9n-.js +24 -0
  43. package/dist/{index-D4ZTaYOa.js → index-D2JizcOQ.js} +7 -7
  44. package/dist/index.d.ts +11 -3
  45. package/dist/insertion-CGpb504L.js +6152 -0
  46. package/dist/layout-projection.d.ts +2 -0
  47. package/dist/opc/patch.d.ts +2 -0
  48. package/dist/opc.js +1 -1
  49. package/dist/paragraph-level.d.ts +11 -0
  50. package/dist/paragraph-property-schema.d.ts +1 -1
  51. package/dist/{patch-DO8497wO.js → patch-D7lZelRa.js} +111 -94
  52. package/dist/patch-change.d.ts +4 -0
  53. package/dist/patch-events.d.ts +12 -0
  54. package/dist/recovery-identity.d.ts +2 -1
  55. package/dist/run-property-schema.d.ts +1 -1
  56. package/dist/save/geometry.d.ts +5 -0
  57. package/dist/save/insertion.d.ts +3 -0
  58. package/dist/save/notes.d.ts +2 -0
  59. package/dist/save/run-overrides.d.ts +10 -0
  60. package/dist/save/shape-format.d.ts +3 -0
  61. package/dist/save/table-style-part.d.ts +11 -0
  62. package/dist/save/table.d.ts +3 -0
  63. package/dist/save/text-source-less.d.ts +6 -0
  64. package/dist/save.js +468 -1441
  65. package/dist/table-direct-markup.d.ts +7 -1
  66. package/dist/table-style-part-DBtpxmuo.js +1042 -0
  67. package/dist/table-style.d.ts +20 -0
  68. package/dist/text-model.d.ts +1 -1
  69. package/dist/types.d.ts +44 -1
  70. package/dist/xml.js +1 -1
  71. package/package.json +6 -2
  72. package/dist/insertion-DabLme_U.js +0 -5471
package/dist/editor.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Command, EditorChange, EditorOptions, EditorSubscriber, History, Selection, Transaction, TransactionOptions, TransactionResult } from './commands/types';
1
+ import type { Command, EditorChange, EditorOptions, EditorPatchSubscriber, EditorPatchSubscribeOptions, EditorSubscriber, ExternalPatchOptions, History, Patch, Selection, Transaction, TransactionOptions, TransactionResult } from './commands/types';
2
2
  import type { OpcPatchResult } from './opc/types';
3
3
  import type { RecoverySubscriber } from './recovery-types';
4
4
  import type { EditDoc, ElementId, SlideId } from './types';
@@ -8,6 +8,7 @@ export declare class Editor {
8
8
  private readonly historyStore;
9
9
  private readonly origin;
10
10
  private readonly subscribers;
11
+ private readonly patchJournal;
11
12
  private readonly recoveryJournal;
12
13
  private currentSelection;
13
14
  private currentState;
@@ -23,14 +24,18 @@ export declare class Editor {
23
24
  select(selection: Selection): void;
24
25
  subscribe(subscriber: EditorSubscriber): () => void;
25
26
  subscribeRecovery(subscriber: RecoverySubscriber): () => void;
27
+ subscribePatches(subscriber: EditorPatchSubscriber, options?: EditorPatchSubscribeOptions): () => void;
26
28
  exec(...commands: Command[]): TransactionResult;
27
29
  transaction(callback: (transaction: Transaction) => void, label: string, options?: TransactionOptions): TransactionResult;
28
30
  undo(): EditorChange | null;
29
31
  redo(): EditorChange | null;
32
+ applyExternalPatches(patches: readonly Patch[], options?: ExternalPatchOptions): EditorChange | null;
30
33
  toSlide(id: SlideId): import("@web-ppt/core").Slide;
31
34
  effectiveElement(id: ElementId): import("@web-ppt/core").SlideElement;
32
35
  private commit;
33
36
  private emitRecovery;
37
+ private queuePatches;
38
+ private flushPatches;
34
39
  private emit;
35
40
  private refreshActiveImageResources;
36
41
  private historyImageResourceBytes;
@@ -0,0 +1,2 @@
1
+ /** core 的无损路径是绝对 M/L/C/Q/A/Z;这里反向写成等比例 DrawingML custGeom。 */
2
+ export declare function customGeometryMarkup(path: string, width: number, height: number, open: boolean): string;
@@ -0,0 +1,12 @@
1
+ import type { OpcPatchResult } from '../opc/types';
2
+ import type { EditDoc } from '../types';
3
+ export interface CreateBlankPptxOptions {
4
+ /** 页面单位与统一 Schema 一致,使用 CSS px;默认值等价于 12192000×6858000 EMU。 */
5
+ readonly width?: number;
6
+ readonly height?: number;
7
+ }
8
+ /** 创建带一张空白页、最小主题/母版及常用版式目录的确定性 PPTX。 */
9
+ export declare function createBlankPptx(options?: CreateBlankPptxOptions): Uint8Array;
10
+ /** 没有可补丁原包时从统一编辑模型构造新 PPTX;本函数不改变 EditDoc。 */
11
+ export declare function generateEditDoc(doc: EditDoc): OpcPatchResult;
12
+ export type { OpcPatchResult } from '../opc/types';
@@ -0,0 +1,3 @@
1
+ import type { EditDoc, LinkOverride, SlideId } from '../types';
2
+ /** 相对跳转在生成包里固定到当前最终页序,避免依赖已经不存在的来源关系。 */
3
+ export declare function generatedLink(doc: EditDoc, slideId: SlideId, value: string | undefined, label: string): LinkOverride | undefined;
@@ -0,0 +1,2 @@
1
+ import type { EditDoc } from '../types';
2
+ export declare function materializeGeneratedParts(doc: EditDoc): Record<string, Uint8Array>;
@@ -0,0 +1,13 @@
1
+ import type { EditDoc, ElementInsertionRelationship, ElementInsertionResource, ElementInsertionSource, ElementRecord } from '../types';
2
+ type ImageSource = {
3
+ readonly src: string;
4
+ readonly name?: string;
5
+ readonly id?: number;
6
+ };
7
+ export interface GeneratedImageClosure {
8
+ readonly relationship: ElementInsertionRelationship;
9
+ readonly resource: ElementInsertionResource | null;
10
+ }
11
+ export declare function imageClosure(doc: EditDoc, source: ImageSource, relationshipId: string, part: string): GeneratedImageClosure;
12
+ export declare function imageInsertion(doc: EditDoc, record: ElementRecord, spid: number, part: string): ElementInsertionSource;
13
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { TableStyleDefinition } from '@web-ppt/core';
2
+ import type { EditDoc, ElementInsertionSource, ElementRecord } from '../types';
3
+ export declare function tableInsertion(record: ElementRecord, spid: number): ElementInsertionSource;
4
+ export declare function generatedTableStyleDefinitions(doc: EditDoc): readonly TableStyleDefinition[];
@@ -0,0 +1,3 @@
1
+ /** 生成保存的固定骨架只承载包级默认值;页面内容始终从 EditDoc 物化。 */
2
+ export declare function generatedTemplateParts(width: number, height: number, slideCount?: number, notesSlides?: readonly boolean[]): Record<string, Uint8Array>;
3
+ export declare function generatedEmptySlideXml(): string;