@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.
- package/CHANGELOG.md +17 -0
- package/README.md +1 -1
- package/dist/collaboration-identity.d.ts +3 -0
- package/dist/commands/add-slide-identity.d.ts +2 -0
- package/dist/commands/convert-to-custom-geometry.d.ts +4 -0
- package/dist/commands/element-geometry.d.ts +6 -0
- package/dist/commands/element-hierarchy.d.ts +6 -0
- package/dist/commands/element-table-style.d.ts +5 -0
- package/dist/commands/frame-decomposition.d.ts +10 -0
- package/dist/commands/generated-creation-defaults.d.ts +4 -0
- package/dist/commands/geometry-types.d.ts +22 -0
- package/dist/commands/group-types.d.ts +24 -0
- package/dist/commands/group.d.ts +4 -0
- package/dist/commands/insertion-host.d.ts +3 -0
- package/dist/commands/insertion-rect.d.ts +2 -0
- package/dist/commands/patch-invalidation.d.ts +4 -0
- package/dist/commands/patch.d.ts +4 -0
- package/dist/commands/record-clone.d.ts +3 -0
- package/dist/commands/set-geometry.d.ts +4 -0
- package/dist/commands/set-table-style.d.ts +3 -0
- package/dist/commands/spid.d.ts +1 -0
- package/dist/commands/table-style-types.d.ts +28 -0
- package/dist/commands/text-target.d.ts +1 -0
- package/dist/commands/types.d.ts +29 -4
- package/dist/commands/ungroup.d.ts +4 -0
- package/dist/custom-geometry-path.d.ts +3 -0
- package/dist/custom-geometry.d.ts +12 -0
- package/dist/document-B1jjN-QB.js +274 -0
- package/dist/edit-core.js +3597 -2639
- package/dist/editor.d.ts +6 -1
- package/dist/generate/custom-geometry.d.ts +2 -0
- package/dist/generate/index.d.ts +12 -0
- package/dist/generate/links.d.ts +3 -0
- package/dist/generate/materialize.d.ts +2 -0
- package/dist/generate/media.d.ts +13 -0
- package/dist/generate/table.d.ts +4 -0
- package/dist/generate/template.d.ts +3 -0
- package/dist/generate.js +744 -0
- package/dist/hyperlink.d.ts +2 -0
- package/dist/identity-allocation.d.ts +12 -0
- package/dist/identity-watermark.d.ts +4 -0
- package/dist/image-resource-DbgJS9n-.js +24 -0
- package/dist/{index-D4ZTaYOa.js → index-D2JizcOQ.js} +7 -7
- package/dist/index.d.ts +11 -3
- package/dist/insertion-CGpb504L.js +6152 -0
- package/dist/layout-projection.d.ts +2 -0
- package/dist/opc/patch.d.ts +2 -0
- package/dist/opc.js +1 -1
- package/dist/paragraph-level.d.ts +11 -0
- package/dist/paragraph-property-schema.d.ts +1 -1
- package/dist/{patch-DO8497wO.js → patch-D7lZelRa.js} +111 -94
- package/dist/patch-change.d.ts +4 -0
- package/dist/patch-events.d.ts +12 -0
- package/dist/recovery-identity.d.ts +2 -1
- package/dist/run-property-schema.d.ts +1 -1
- package/dist/save/geometry.d.ts +5 -0
- package/dist/save/insertion.d.ts +3 -0
- package/dist/save/notes.d.ts +2 -0
- package/dist/save/run-overrides.d.ts +10 -0
- package/dist/save/shape-format.d.ts +3 -0
- package/dist/save/table-style-part.d.ts +11 -0
- package/dist/save/table.d.ts +3 -0
- package/dist/save/text-source-less.d.ts +6 -0
- package/dist/save.js +468 -1441
- package/dist/table-direct-markup.d.ts +7 -1
- package/dist/table-style-part-DBtpxmuo.js +1042 -0
- package/dist/table-style.d.ts +20 -0
- package/dist/text-model.d.ts +1 -1
- package/dist/types.d.ts +44 -1
- package/dist/xml.js +1 -1
- package/package.json +6 -2
- 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,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,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[];
|