@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
@@ -1,5 +1,7 @@
1
+ import type { SlideElement } from '@web-ppt/core';
1
2
  import type { EditDoc, ElementId, ElementLinkState, LinkOverride, LinkSourceValue, LinkTarget } from './types';
2
3
  export declare const MAX_EXTERNAL_LINK_LENGTH = 2048;
4
+ export declare const supportsElementLink: (kind: SlideElement["kind"]) => boolean;
3
5
  export declare function normalizeExternalLinkTarget(href: string): LinkTarget | null;
4
6
  export declare function assertLinkOverride(value: unknown, label: string): asserts value is LinkOverride;
5
7
  export declare function normalizeLinkTarget(doc: EditDoc, value: LinkOverride, label: string): LinkOverride;
@@ -0,0 +1,12 @@
1
+ import type { EditIdentity, EditIdentityAllocation, EditIdentityRange } from './types';
2
+ /** JSON number 协议的显式上限;达到上限时必须在编辑落模前失败,不能静默停止广播。 */
3
+ export declare const MAX_COLLABORATION_VERSION = 4294967295;
4
+ export declare function assertIdentityAllocation(value: unknown, label?: string, basePrefix?: string): asserts value is EditIdentityAllocation;
5
+ export declare function configureIdentityAllocation(identity: EditIdentity, replicaId: string, slot: number, count?: number): void;
6
+ export declare function ensureIdentityRange(identity: EditIdentity, key: string, first: number, maximum?: number): EditIdentityRange | null;
7
+ export declare function allocateIdentityRange(identity: EditIdentity, key: string, first: number, maximum?: number): number | null;
8
+ export declare const logicalIdentityPrefix: (identity: EditIdentity) => string;
9
+ /** 在编辑落模前调用;版本耗尽必须先拒绝事务,不能留下未广播的本地状态。 */
10
+ export declare function assertCollaborationVersionAvailable(identity: EditIdentity): void;
11
+ /** Editor 在恢复帧取样前预留本地消息版本。 */
12
+ export declare function advanceCollaborationVersion(identity: EditIdentity): void;
@@ -0,0 +1,4 @@
1
+ import type { EditIdentity } from './types';
2
+ export declare function assertEditIdentityWatermark(value: unknown): asserts value is EditIdentity;
3
+ /** 不同副本使用不同逻辑 id 前缀;只有 OPC 的全局数值水位需要跨副本取最大值。 */
4
+ export declare function mergeEditIdentityWatermark(target: EditIdentity, source: EditIdentity): void;
@@ -0,0 +1,24 @@
1
+ import { v as i, b as f, s as a } from "./insertion-CGpb504L.js";
2
+ const b = 5 * 1024 * 1024;
3
+ function c(o, e, r) {
4
+ if (!ArrayBuffer.isView(o) || Object.prototype.toString.call(o) !== "[object Uint8Array]")
5
+ throw new Error(`${e} 必须是 Uint8Array`);
6
+ const t = o;
7
+ if (!t.byteLength) throw new Error(`${e} 不能为空`);
8
+ if (r !== void 0 && t.byteLength > r)
9
+ throw new Error(`${e} 不能超过 ${r} 字节`);
10
+ return new Uint8Array(t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength));
11
+ }
12
+ function h(o, e, r, t) {
13
+ const n = c(o, `${r}.bytes`, t), s = i(n, e, r);
14
+ return {
15
+ hash: a(n),
16
+ mime: e,
17
+ extension: s.extension,
18
+ bytes: f(n)
19
+ };
20
+ }
21
+ export {
22
+ b as M,
23
+ h as c
24
+ };
@@ -678,7 +678,7 @@ export {
678
678
  Dt as O,
679
679
  d as P,
680
680
  pt as X,
681
- rt as a,
681
+ Bt as a,
682
682
  jt as b,
683
683
  At as c,
684
684
  Ut as d,
@@ -689,14 +689,14 @@ export {
689
689
  T as i,
690
690
  q as j,
691
691
  kt as k,
692
- Gt as l,
693
- zt as m,
694
- y as n,
695
- m as o,
692
+ zt as l,
693
+ lt as m,
694
+ Gt as n,
695
+ y as o,
696
696
  qt as p,
697
- lt as q,
697
+ m as q,
698
698
  _t as r,
699
- Bt as s,
699
+ rt as s,
700
700
  mt as t,
701
701
  Rt as u,
702
702
  ot as v,
package/dist/index.d.ts CHANGED
@@ -18,6 +18,11 @@ export { querySlideNotes } from './slide-notes';
18
18
  export { queryElementStroke } from './shape-stroke';
19
19
  export { queryElementEffects } from './shape-effects';
20
20
  export { queryElementCrop } from './image-content';
21
+ export { listTableStyles, queryTableStyle } from './table-style';
22
+ export type { TableStyleCatalogItem, TableStyleState } from './table-style';
23
+ export { assertCustomGeometry, moveCustomGeometryPoint, queryElementCustomGeometry, setCustomGeometryClosed, setCustomGeometrySegmentType, } from './custom-geometry';
24
+ export { customGeometryFromSvgPath } from './custom-geometry-path';
25
+ export type { CustomGeometry } from '@web-ppt/core';
21
26
  export { MAX_EXTERNAL_LINK_LENGTH, normalizeExternalLinkTarget, queryElementLink, } from './hyperlink';
22
27
  export type { VectorFill } from './shape-fill';
23
28
  export type { StrokeCommandValue } from './shape-stroke';
@@ -28,15 +33,18 @@ export { isElementDescendantOf, outermostSelectedElementIds } from './selection'
28
33
  export { elementOrder, writableLayerSiblingIds } from './element-order';
29
34
  export { MAX_ELEMENT_NAME_LENGTH } from './element-name';
30
35
  export { querySelectionPane } from './selection-pane';
31
- export { applyPatches } from './commands/patch';
36
+ export { applyPatches, assertPatchesApplicable, stageExternalPatches } from './commands/patch';
32
37
  export { allocateElementId, allocateSlideId, createDoc, createEmptyDoc, disposeDoc, replaceDocPackage } from './document';
38
+ export { configureCollaborationIdentity } from './collaboration-identity';
39
+ export { assertIdentityAllocation, MAX_COLLABORATION_VERSION } from './identity-allocation';
33
40
  export { effectiveElement, invalidateAll, invalidateElement, invalidateElementStructure, invalidateSlide, invalidateSlideStructure, slideOfElement, toSlide, } from './projection';
34
41
  export { projectedSlideElementIds, unboundLayoutPlaceholders } from './layout-projection';
35
42
  export { assertFractionalIndex, compareFractionalIndex, fractionalIndexBetween, initialFractionalIndex, } from './fractional-index';
36
43
  export { composeSpaceMatrices, elementContentToSlideMatrix, elementFrameToParentMatrix, elementFrameToSlideMatrix, elementChildrenToSlideMatrix, elementFrameToSlidePoint, elementParentToSlideMatrix, elementParentToSlidePoint, inverseTransformSpaceVector, invertSpaceMatrix, screenToSlidePoint, slideToElementFramePoint, slideToElementParentPoint, slideToScreenPoint, spaceOrientationParity, transformSpacePoint, transformSpaceVector, } from './space';
37
- export type { CreateDocOptions, EditableKind, EditAnimationStep, EditDoc, EditDocMeta, EditIdentity, EditSaveState, ElementCropState, ElementEffectsState, ElementFillState, ElementId, ElementImageReplacement, ElementInsertionSource, ElementLinkState, ElementMeta, ElementOverrides, ElementStrokeState, ImageCrop, LinkOverride, LinkSourceValue, LinkTarget, RelativeLinkSource, UnsupportedLinkSource, SlideAnimationState, SlideBackgroundState, SlideHiddenState, SlideImageBackground, SlideLayoutState, SlideNotesState, SlideTransitionState, ElementRecord, FractionalIndex, ProjectionInvalidation, RemovedElementRecord, SlideId, SlideOverrides, FlatTextParagraph, ParagraphProperties, ParagraphPropertiesState, ParagraphPropertyOverrides, RunLinkState, RunProperties, RunPropertiesState, RunPropertyOverrides, RunPropertyState, SlideCreation, SlideNotesBinding, SlideRecord, SlideSource, TableCellAddress, TableCellKey, TableCellOverrides, TableCellRowRef, TableRowId, TableRowInsertion, TextFragment, TextFragmentMark, TextFragmentParagraph, TextMark, TextOverride, TextBodyAutoFit, TextBodyProperties, TextBodyPropertyOverrides, } from './types';
44
+ export type { CreateDocOptions, EditableKind, EditAnimationStep, EditDoc, EditDocMeta, EditIdentity, EditIdentityAllocation, EditIdentityRange, EditSaveState, ElementCropState, ElementEffectsState, ElementFillState, ElementId, ElementImageReplacement, ElementInsertionSource, ElementLinkState, ElementMeta, ElementOverrides, ElementStrokeState, ImageCrop, LinkOverride, LinkSourceValue, LinkTarget, RelativeLinkSource, UnsupportedLinkSource, SlideAnimationState, SlideBackgroundState, SlideHiddenState, SlideImageBackground, SlideLayoutState, SlideNotesState, SlideTransitionState, ElementRecord, FractionalIndex, ProjectionInvalidation, RemovedElementRecord, SlideId, SlideOverrides, FlatTextParagraph, ParagraphProperties, ParagraphPropertiesState, ParagraphPropertyOverrides, RunLinkState, RunProperties, RunPropertiesState, RunPropertyOverrides, RunPropertyState, SlideCreation, SlideNotesBinding, SlideRecord, SlideSource, TableCellAddress, TableCellKey, TableCellOverrides, TableCellRowRef, TableRowId, TableRowInsertion, TextFragment, TextFragmentMark, TextFragmentParagraph, TextMark, TextOverride, TextBodyAutoFit, TextBodyProperties, TextBodyPropertyOverrides, } from './types';
38
45
  export type { RecoveryAssetReference, RecoveryFrame, RecoveryFrameSource, RecoveryRestoreResult, RecoverySubscriber, } from './recovery-types';
39
- export type { AddImageCommand, AddShapeCommand, AddSlideCommand, AddTableCommand, AlignEdge, AlignElementsCommand, ClipboardElementRecord, ClipboardPortableLink, ClipboardRelationship, ClipboardResource, ClipboardTextLink, ClipboardXmlRoot, Command, CommandPatches, DuplicateSlideCommand, EditTextCommand, EditorChange, EditorOptions, EditorSubscriber, ElementClipboardPayload, ElementClipboardRecordMeta, ElementCropPatch, ElementEffectsPatch, ElementFillPatch, ElementImageReplacementPatch, ElementInteractionField, ElementInteractionPatch, ElementLinkPatch, ElementNamePatch, ElementOrderPatch, ElementStrokePatch, ElementTextPatch, ElementTransformPatch, ElementTreePatch, ElementTreeSnapshot, ElementXfrmPath, FitTextShapeCommand, History, HistoryEntry, InsertRowCommand, MoveSlideCommand, Patch, RemoveElementCommand, RemoveSlideCommand, SetAnimationsCommand, SetBackgroundCommand, SetBackgroundCropCommand, SetBackgroundImageCommand, SetHiddenCommand, SetTransitionCommand, SlideAnimationsPatch, SlideBackgroundImagePatch, SlideBackgroundPatch, SlideChangeSets, SlideHiddenPatch, SlideTransitionPatch, SlideOrderPatch, SlidePropertyPatch, SlideTreePatch, SlideTreeSnapshot, ApplyFormatCommand, FormatMaskField, PasteElementsCommand, Selection, ElementLayerTarget, FlipField, NumericXfrmField, SetElementHiddenCommand, SetFlipCommand, SetLockedCommand, SetNameCommand, SetParaPropsCommand, SetRunPropsCommand, SetXfrmCommand, SetZCommand, TextPosition, TextRange, Transaction, ReplaceImageCommand, SetBodyPropsCommand, SetCropCommand, SetEffectsCommand, SetFillCommand, SetLayoutCommand, SetLinkCommand, SetNotesCommand, SetStrokeCommand, SlideLayoutPatch, SlideNotesPatch, TableRowPatch, TextEditOp, TransactionOptions, TransactionResult, XfrmField, XfrmValueByField, } from './commands/types';
46
+ export type { AddImageCommand, AddShapeCommand, AddSlideCommand, AddTableCommand, AlignEdge, AlignElementsCommand, ClipboardElementRecord, ClipboardPortableLink, ClipboardRelationship, ClipboardResource, ClipboardTextLink, ClipboardXmlRoot, Command, CommandPatches, DuplicateSlideCommand, EditTextCommand, EditorChange, GroupCommand, UngroupCommand, EditorOptions, EditorPatchEvent, EditorPatchSubscriber, EditorPatchSubscribeOptions, EditorSubscriber, ExternalPatchOptions, ElementClipboardPayload, ElementClipboardRecordMeta, ElementCropPatch, ElementEffectsPatch, ElementFillPatch, ElementImageReplacementPatch, ElementInteractionField, ElementInteractionPatch, ElementLinkPatch, ElementNamePatch, ElementOrderPatch, ElementStrokePatch, ElementTextPatch, ElementTransformPatch, ElementHierarchyPatch, ElementHierarchyState, ElementTreePatch, ElementTreeSnapshot, ElementXfrmPath, FitTextShapeCommand, History, HistoryEntry, InsertRowCommand, MoveSlideCommand, Patch, RemoveElementCommand, RemoveSlideCommand, SetAnimationsCommand, SetBackgroundCommand, SetBackgroundCropCommand, SetBackgroundImageCommand, SetHiddenCommand, SetTransitionCommand, SlideAnimationsPatch, SlideBackgroundImagePatch, SlideBackgroundPatch, SlideChangeSets, SlideHiddenPatch, SlideTransitionPatch, SlideOrderPatch, SlidePropertyPatch, SlideTreePatch, SlideTreeSnapshot, ApplyFormatCommand, FormatMaskField, PasteElementsCommand, Selection, ElementLayerTarget, FlipField, NumericXfrmField, SetElementHiddenCommand, SetFlipCommand, SetLockedCommand, SetNameCommand, SetParaPropsCommand, SetRunPropsCommand, SetXfrmCommand, SetZCommand, TextPosition, TextRange, Transaction, ReplaceImageCommand, SetBodyPropsCommand, SetCropCommand, SetEffectsCommand, SetFillCommand, SetLayoutCommand, SetLinkCommand, SetNotesCommand, SetStrokeCommand, SlideLayoutPatch, SlideNotesPatch, TableRowPatch, ElementTableStylePatch, SetTableStyleCommand, TextEditOp, TransactionOptions, TransactionResult, XfrmField, XfrmValueByField, } from './commands/types';
47
+ export type { ConvertToCustomGeometryCommand, ElementGeometryPatch, SetGeometryCommand, } from './commands/geometry-types';
40
48
  export type { SlideTransitionInput } from './slide-transition';
41
49
  export type { EditableAnimationEffect, EmphasisAnimationEffect, EntranceExitAnimationEffect, } from './animation-catalog';
42
50
  export type { SelectionPaneItem } from './selection-pane';