@productcloudos/editor 1.0.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.
- package/CHANGELOG.md +95 -0
- package/LICENSE +21 -0
- package/README.md +377 -0
- package/dist/pc-editor.esm.js +24820 -0
- package/dist/pc-editor.esm.js.map +1 -0
- package/dist/pc-editor.js +24877 -0
- package/dist/pc-editor.js.map +1 -0
- package/dist/pc-editor.min.js +2 -0
- package/dist/pc-editor.min.js.map +1 -0
- package/dist/types/lib/clipboard/ClipboardManager.d.ts +77 -0
- package/dist/types/lib/clipboard/ClipboardManager.d.ts.map +1 -0
- package/dist/types/lib/clipboard/HtmlConverter.d.ts +43 -0
- package/dist/types/lib/clipboard/HtmlConverter.d.ts.map +1 -0
- package/dist/types/lib/clipboard/index.d.ts +9 -0
- package/dist/types/lib/clipboard/index.d.ts.map +1 -0
- package/dist/types/lib/clipboard/types.d.ts +76 -0
- package/dist/types/lib/clipboard/types.d.ts.map +1 -0
- package/dist/types/lib/controls/BaseControl.d.ts +72 -0
- package/dist/types/lib/controls/BaseControl.d.ts.map +1 -0
- package/dist/types/lib/controls/index.d.ts +11 -0
- package/dist/types/lib/controls/index.d.ts.map +1 -0
- package/dist/types/lib/controls/rulers/HorizontalRuler.d.ts +55 -0
- package/dist/types/lib/controls/rulers/HorizontalRuler.d.ts.map +1 -0
- package/dist/types/lib/controls/rulers/RulerControl.d.ts +98 -0
- package/dist/types/lib/controls/rulers/RulerControl.d.ts.map +1 -0
- package/dist/types/lib/controls/rulers/VerticalRuler.d.ts +65 -0
- package/dist/types/lib/controls/rulers/VerticalRuler.d.ts.map +1 -0
- package/dist/types/lib/controls/rulers/index.d.ts +8 -0
- package/dist/types/lib/controls/rulers/index.d.ts.map +1 -0
- package/dist/types/lib/controls/rulers/types.d.ts +62 -0
- package/dist/types/lib/controls/rulers/types.d.ts.map +1 -0
- package/dist/types/lib/controls/types.d.ts +51 -0
- package/dist/types/lib/controls/types.d.ts.map +1 -0
- package/dist/types/lib/core/Document.d.ts +34 -0
- package/dist/types/lib/core/Document.d.ts.map +1 -0
- package/dist/types/lib/core/PCEditor.d.ts +761 -0
- package/dist/types/lib/core/PCEditor.d.ts.map +1 -0
- package/dist/types/lib/core/Page.d.ts +40 -0
- package/dist/types/lib/core/Page.d.ts.map +1 -0
- package/dist/types/lib/data/DataBinder.d.ts +11 -0
- package/dist/types/lib/data/DataBinder.d.ts.map +1 -0
- package/dist/types/lib/events/EventEmitter.d.ts +11 -0
- package/dist/types/lib/events/EventEmitter.d.ts.map +1 -0
- package/dist/types/lib/hit-test/HitTestManager.d.ts +81 -0
- package/dist/types/lib/hit-test/HitTestManager.d.ts.map +1 -0
- package/dist/types/lib/hit-test/index.d.ts +32 -0
- package/dist/types/lib/hit-test/index.d.ts.map +1 -0
- package/dist/types/lib/hit-test/types.d.ts +113 -0
- package/dist/types/lib/hit-test/types.d.ts.map +1 -0
- package/dist/types/lib/import/ContentAnalyzer.d.ts +76 -0
- package/dist/types/lib/import/ContentAnalyzer.d.ts.map +1 -0
- package/dist/types/lib/import/DocumentBuilder.d.ts +44 -0
- package/dist/types/lib/import/DocumentBuilder.d.ts.map +1 -0
- package/dist/types/lib/import/PDFImporter.d.ts +65 -0
- package/dist/types/lib/import/PDFImporter.d.ts.map +1 -0
- package/dist/types/lib/import/PDFParser.d.ts +46 -0
- package/dist/types/lib/import/PDFParser.d.ts.map +1 -0
- package/dist/types/lib/import/index.d.ts +9 -0
- package/dist/types/lib/import/index.d.ts.map +1 -0
- package/dist/types/lib/import/types.d.ts +182 -0
- package/dist/types/lib/import/types.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +16 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/layout/FlowManager.d.ts +29 -0
- package/dist/types/lib/layout/FlowManager.d.ts.map +1 -0
- package/dist/types/lib/layout/LayoutEngine.d.ts +39 -0
- package/dist/types/lib/layout/LayoutEngine.d.ts.map +1 -0
- package/dist/types/lib/objects/BaseEmbeddedObject.d.ts +133 -0
- package/dist/types/lib/objects/BaseEmbeddedObject.d.ts.map +1 -0
- package/dist/types/lib/objects/EmbeddedObjectFactory.d.ts +57 -0
- package/dist/types/lib/objects/EmbeddedObjectFactory.d.ts.map +1 -0
- package/dist/types/lib/objects/ImageObject.d.ts +60 -0
- package/dist/types/lib/objects/ImageObject.d.ts.map +1 -0
- package/dist/types/lib/objects/TextBoxObject.d.ts +208 -0
- package/dist/types/lib/objects/TextBoxObject.d.ts.map +1 -0
- package/dist/types/lib/objects/index.d.ts +9 -0
- package/dist/types/lib/objects/index.d.ts.map +1 -0
- package/dist/types/lib/objects/table/TableCell.d.ts +165 -0
- package/dist/types/lib/objects/table/TableCell.d.ts.map +1 -0
- package/dist/types/lib/objects/table/TableCellMerger.d.ts +66 -0
- package/dist/types/lib/objects/table/TableCellMerger.d.ts.map +1 -0
- package/dist/types/lib/objects/table/TableObject.d.ts +434 -0
- package/dist/types/lib/objects/table/TableObject.d.ts.map +1 -0
- package/dist/types/lib/objects/table/TableResizeHandler.d.ts +80 -0
- package/dist/types/lib/objects/table/TableResizeHandler.d.ts.map +1 -0
- package/dist/types/lib/objects/table/TableRow.d.ts +65 -0
- package/dist/types/lib/objects/table/TableRow.d.ts.map +1 -0
- package/dist/types/lib/objects/table/index.d.ts +12 -0
- package/dist/types/lib/objects/table/index.d.ts.map +1 -0
- package/dist/types/lib/objects/table/types.d.ts +239 -0
- package/dist/types/lib/objects/table/types.d.ts.map +1 -0
- package/dist/types/lib/objects/types.d.ts +135 -0
- package/dist/types/lib/objects/types.d.ts.map +1 -0
- package/dist/types/lib/rendering/CanvasManager.d.ts +282 -0
- package/dist/types/lib/rendering/CanvasManager.d.ts.map +1 -0
- package/dist/types/lib/rendering/FlowingTextRenderer.d.ts +348 -0
- package/dist/types/lib/rendering/FlowingTextRenderer.d.ts.map +1 -0
- package/dist/types/lib/rendering/PDFGenerator.d.ts +103 -0
- package/dist/types/lib/rendering/PDFGenerator.d.ts.map +1 -0
- package/dist/types/lib/rendering/pdf-utils.d.ts +54 -0
- package/dist/types/lib/rendering/pdf-utils.d.ts.map +1 -0
- package/dist/types/lib/text/EditableTextRegion.d.ts +105 -0
- package/dist/types/lib/text/EditableTextRegion.d.ts.map +1 -0
- package/dist/types/lib/text/EmbeddedObjectManager.d.ts +97 -0
- package/dist/types/lib/text/EmbeddedObjectManager.d.ts.map +1 -0
- package/dist/types/lib/text/FieldFormatter.d.ts +26 -0
- package/dist/types/lib/text/FieldFormatter.d.ts.map +1 -0
- package/dist/types/lib/text/FlowingTextContent.d.ts +571 -0
- package/dist/types/lib/text/FlowingTextContent.d.ts.map +1 -0
- package/dist/types/lib/text/HyperlinkManager.d.ts +110 -0
- package/dist/types/lib/text/HyperlinkManager.d.ts.map +1 -0
- package/dist/types/lib/text/MarkdownParser.d.ts +55 -0
- package/dist/types/lib/text/MarkdownParser.d.ts.map +1 -0
- package/dist/types/lib/text/ParagraphFormatting.d.ts +123 -0
- package/dist/types/lib/text/ParagraphFormatting.d.ts.map +1 -0
- package/dist/types/lib/text/RegionManager.d.ts +75 -0
- package/dist/types/lib/text/RegionManager.d.ts.map +1 -0
- package/dist/types/lib/text/RepeatingSectionManager.d.ts +99 -0
- package/dist/types/lib/text/RepeatingSectionManager.d.ts.map +1 -0
- package/dist/types/lib/text/SubstitutionFieldManager.d.ts +153 -0
- package/dist/types/lib/text/SubstitutionFieldManager.d.ts.map +1 -0
- package/dist/types/lib/text/TextFormatting.d.ts +85 -0
- package/dist/types/lib/text/TextFormatting.d.ts.map +1 -0
- package/dist/types/lib/text/TextLayout.d.ts +126 -0
- package/dist/types/lib/text/TextLayout.d.ts.map +1 -0
- package/dist/types/lib/text/TextMeasurer.d.ts +107 -0
- package/dist/types/lib/text/TextMeasurer.d.ts.map +1 -0
- package/dist/types/lib/text/TextPositionCalculator.d.ts +72 -0
- package/dist/types/lib/text/TextPositionCalculator.d.ts.map +1 -0
- package/dist/types/lib/text/TextState.d.ts +236 -0
- package/dist/types/lib/text/TextState.d.ts.map +1 -0
- package/dist/types/lib/text/index.d.ts +27 -0
- package/dist/types/lib/text/index.d.ts.map +1 -0
- package/dist/types/lib/text/regions/BodyTextRegion.d.ts +68 -0
- package/dist/types/lib/text/regions/BodyTextRegion.d.ts.map +1 -0
- package/dist/types/lib/text/regions/FooterTextRegion.d.ts +68 -0
- package/dist/types/lib/text/regions/FooterTextRegion.d.ts.map +1 -0
- package/dist/types/lib/text/regions/HeaderTextRegion.d.ts +68 -0
- package/dist/types/lib/text/regions/HeaderTextRegion.d.ts.map +1 -0
- package/dist/types/lib/text/regions/index.d.ts +7 -0
- package/dist/types/lib/text/regions/index.d.ts.map +1 -0
- package/dist/types/lib/text/types.d.ts +268 -0
- package/dist/types/lib/text/types.d.ts.map +1 -0
- package/dist/types/lib/types/index.d.ts +206 -0
- package/dist/types/lib/types/index.d.ts.map +1 -0
- package/dist/types/lib/undo/index.d.ts +8 -0
- package/dist/types/lib/undo/index.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/ContentDiscovery.d.ts +101 -0
- package/dist/types/lib/undo/transaction/ContentDiscovery.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/FocusTracker.d.ts +49 -0
- package/dist/types/lib/undo/transaction/FocusTracker.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/MutationUndo.d.ts +57 -0
- package/dist/types/lib/undo/transaction/MutationUndo.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/ObjectMutationObserver.d.ts +79 -0
- package/dist/types/lib/undo/transaction/ObjectMutationObserver.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/TextMutationObserver.d.ts +60 -0
- package/dist/types/lib/undo/transaction/TextMutationObserver.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/TransactionManager.d.ts +148 -0
- package/dist/types/lib/undo/transaction/TransactionManager.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/index.d.ts +17 -0
- package/dist/types/lib/undo/transaction/index.d.ts.map +1 -0
- package/dist/types/lib/undo/transaction/types.d.ts +269 -0
- package/dist/types/lib/undo/transaction/types.d.ts.map +1 -0
- package/dist/types/lib/utils/blob-utils.d.ts +2 -0
- package/dist/types/lib/utils/blob-utils.d.ts.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TransactionManager - Core transaction-based undo/redo management.
|
|
3
|
+
*
|
|
4
|
+
* Manages transactions (groups of mutations) and provides undo/redo functionality.
|
|
5
|
+
* All mutations from all content sources flow through this manager.
|
|
6
|
+
*/
|
|
7
|
+
import { EventEmitter } from '../../events/EventEmitter';
|
|
8
|
+
import { MutationRecord, ContentSourceId, ObjectSourceId, CoalesceConfig } from './types';
|
|
9
|
+
import { FocusTracker } from './FocusTracker';
|
|
10
|
+
import { FlowingTextContent } from '../../text/FlowingTextContent';
|
|
11
|
+
/**
|
|
12
|
+
* Callback to get a FlowingTextContent by source ID.
|
|
13
|
+
*/
|
|
14
|
+
export type GetContentFn = (sourceId: ContentSourceId) => FlowingTextContent | null;
|
|
15
|
+
/**
|
|
16
|
+
* Callback to get an object by source ID.
|
|
17
|
+
*/
|
|
18
|
+
export type GetObjectFn = (sourceId: ObjectSourceId) => unknown | null;
|
|
19
|
+
/**
|
|
20
|
+
* TransactionManager handles the transaction-based undo/redo system.
|
|
21
|
+
*/
|
|
22
|
+
export declare class TransactionManager extends EventEmitter {
|
|
23
|
+
private undoStack;
|
|
24
|
+
private redoStack;
|
|
25
|
+
private maxHistory;
|
|
26
|
+
private isPerformingUndoRedo;
|
|
27
|
+
private coalesceConfig;
|
|
28
|
+
private pendingTransaction;
|
|
29
|
+
private transactionStack;
|
|
30
|
+
private focusTracker;
|
|
31
|
+
private _getContent;
|
|
32
|
+
private _getObject;
|
|
33
|
+
constructor(focusTracker: FocusTracker, getContent: GetContentFn, getObject: GetObjectFn, maxHistory?: number);
|
|
34
|
+
/**
|
|
35
|
+
* Get content by source ID. Used by MutationUndo.
|
|
36
|
+
*/
|
|
37
|
+
getContent(sourceId: ContentSourceId): FlowingTextContent | null;
|
|
38
|
+
/**
|
|
39
|
+
* Get object by source ID. Used by MutationUndo.
|
|
40
|
+
*/
|
|
41
|
+
getObject(sourceId: ObjectSourceId): unknown | null;
|
|
42
|
+
/**
|
|
43
|
+
* Check if we're currently performing an undo or redo operation.
|
|
44
|
+
*/
|
|
45
|
+
get isUndoRedoInProgress(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Record a mutation.
|
|
48
|
+
* The mutation will be added to the current transaction or start a new one.
|
|
49
|
+
*/
|
|
50
|
+
recordMutation(mutation: MutationRecord): void;
|
|
51
|
+
/**
|
|
52
|
+
* Create a transaction from a single mutation.
|
|
53
|
+
*/
|
|
54
|
+
private createTransactionFromMutation;
|
|
55
|
+
/**
|
|
56
|
+
* Check if a mutation should be coalesced with the pending transaction.
|
|
57
|
+
*/
|
|
58
|
+
private shouldCoalesce;
|
|
59
|
+
/**
|
|
60
|
+
* Check if two source IDs refer to the same source.
|
|
61
|
+
*/
|
|
62
|
+
private sameSource;
|
|
63
|
+
/**
|
|
64
|
+
* Check if a mutation can start a coalesce chain.
|
|
65
|
+
*/
|
|
66
|
+
private canStartCoalesce;
|
|
67
|
+
/**
|
|
68
|
+
* Coalesce a mutation into the pending transaction.
|
|
69
|
+
*/
|
|
70
|
+
private coalesceMutation;
|
|
71
|
+
/**
|
|
72
|
+
* Flush the pending transaction to the undo stack.
|
|
73
|
+
*/
|
|
74
|
+
flushPendingTransaction(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Commit a transaction to the undo stack.
|
|
77
|
+
*/
|
|
78
|
+
private commitTransaction;
|
|
79
|
+
/**
|
|
80
|
+
* Create a boundary - flush pending transaction.
|
|
81
|
+
* Call this when navigation occurs or context changes.
|
|
82
|
+
*/
|
|
83
|
+
createBoundary(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Begin a compound operation.
|
|
86
|
+
* All mutations until endCompoundOperation are grouped into one transaction.
|
|
87
|
+
*/
|
|
88
|
+
beginCompoundOperation(description?: string): void;
|
|
89
|
+
/**
|
|
90
|
+
* End a compound operation.
|
|
91
|
+
*/
|
|
92
|
+
endCompoundOperation(description?: string): void;
|
|
93
|
+
/**
|
|
94
|
+
* Perform an undo operation.
|
|
95
|
+
* Returns true if undo was performed.
|
|
96
|
+
*/
|
|
97
|
+
undo(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Perform a redo operation.
|
|
100
|
+
* Returns true if redo was performed.
|
|
101
|
+
*/
|
|
102
|
+
redo(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Undo a single mutation.
|
|
105
|
+
*/
|
|
106
|
+
private undoMutation;
|
|
107
|
+
/**
|
|
108
|
+
* Redo a single mutation.
|
|
109
|
+
*/
|
|
110
|
+
private redoMutation;
|
|
111
|
+
/**
|
|
112
|
+
* Check if undo is available.
|
|
113
|
+
*/
|
|
114
|
+
canUndo(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Check if redo is available.
|
|
117
|
+
*/
|
|
118
|
+
canRedo(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Get description of the next undo operation.
|
|
121
|
+
*/
|
|
122
|
+
getUndoDescription(): string | null;
|
|
123
|
+
/**
|
|
124
|
+
* Get description of the next redo operation.
|
|
125
|
+
*/
|
|
126
|
+
getRedoDescription(): string | null;
|
|
127
|
+
/**
|
|
128
|
+
* Clear all history.
|
|
129
|
+
*/
|
|
130
|
+
clear(): void;
|
|
131
|
+
/**
|
|
132
|
+
* Get a description for a mutation type.
|
|
133
|
+
*/
|
|
134
|
+
private getDescriptionForMutation;
|
|
135
|
+
/**
|
|
136
|
+
* Emit state change event.
|
|
137
|
+
*/
|
|
138
|
+
private emitStateChange;
|
|
139
|
+
/**
|
|
140
|
+
* Set coalesce configuration.
|
|
141
|
+
*/
|
|
142
|
+
setCoalesceConfig(config: Partial<CoalesceConfig>): void;
|
|
143
|
+
/**
|
|
144
|
+
* Set maximum history size.
|
|
145
|
+
*/
|
|
146
|
+
setMaxHistory(max: number): void;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=TransactionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionManager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/undo/transaction/TransactionManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAEL,cAAc,EAEd,eAAe,EACf,cAAc,EACd,cAAc,EAKf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,eAAe,KAAK,kBAAkB,GAAG,IAAI,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,cAAc,KAAK,OAAO,GAAG,IAAI,CAAC;AAEvE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;IAClD,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,UAAU,CAAe;IAGjC,OAAO,CAAC,oBAAoB,CAAkB;IAC9C,OAAO,CAAC,cAAc,CAA2C;IAGjE,OAAO,CAAC,kBAAkB,CAA4B;IAGtD,OAAO,CAAC,gBAAgB,CAAqB;IAG7C,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,UAAU,CAAc;gBAG9B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,YAAY,EACxB,SAAS,EAAE,WAAW,EACtB,UAAU,GAAE,MAAY;IAS1B;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,eAAe,GAAG,kBAAkB,GAAG,IAAI;IAIhE;;OAE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|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction-Based Undo/Redo System
|
|
3
|
+
*
|
|
4
|
+
* This module provides a transaction-based undo/redo system that works
|
|
5
|
+
* across all content sources (body, header, footer, table cells, text boxes).
|
|
6
|
+
*/
|
|
7
|
+
export * from './types';
|
|
8
|
+
export { TransactionManager } from './TransactionManager';
|
|
9
|
+
export type { GetContentFn, GetObjectFn } from './TransactionManager';
|
|
10
|
+
export { FocusTracker } from './FocusTracker';
|
|
11
|
+
export type { GetActiveContentFn, RestoreFocusFn } from './FocusTracker';
|
|
12
|
+
export { TextMutationObserver } from './TextMutationObserver';
|
|
13
|
+
export { ObjectMutationObserver } from './ObjectMutationObserver';
|
|
14
|
+
export { MutationUndo } from './MutationUndo';
|
|
15
|
+
export { ContentDiscovery } from './ContentDiscovery';
|
|
16
|
+
export type { DocumentProvider, FocusEventSource } from './ContentDiscovery';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/undo/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction-Based Undo/Redo System Types
|
|
3
|
+
*
|
|
4
|
+
* This system uses method interception to capture all mutations
|
|
5
|
+
* across all content sources (body, header, footer, table cells, text boxes).
|
|
6
|
+
*/
|
|
7
|
+
import { TextFormattingStyle, SubstitutionField } from '../../text/types';
|
|
8
|
+
/**
|
|
9
|
+
* Identifies a content source for undo/redo purposes.
|
|
10
|
+
*/
|
|
11
|
+
export interface ContentSourceId {
|
|
12
|
+
/** The type of content source */
|
|
13
|
+
type: 'body' | 'header' | 'footer' | 'tablecell' | 'textbox';
|
|
14
|
+
/** Object ID for textbox or table */
|
|
15
|
+
objectId?: string;
|
|
16
|
+
/** Cell address for table cells */
|
|
17
|
+
cellAddress?: {
|
|
18
|
+
row: number;
|
|
19
|
+
col: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Identifies an object for mutation tracking.
|
|
24
|
+
*/
|
|
25
|
+
export interface ObjectSourceId {
|
|
26
|
+
/** The type of object */
|
|
27
|
+
type: 'textbox' | 'image' | 'table';
|
|
28
|
+
/** Object ID */
|
|
29
|
+
objectId: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Text mutation types.
|
|
33
|
+
*/
|
|
34
|
+
export type TextMutationType = 'insert' | 'delete' | 'format' | 'alignment' | 'field-insert' | 'field-delete' | 'field-update';
|
|
35
|
+
/**
|
|
36
|
+
* Object mutation types.
|
|
37
|
+
*/
|
|
38
|
+
export type ObjectMutationType = 'object-insert' | 'object-delete' | 'object-resize' | 'object-move' | 'object-property' | 'table-add-row' | 'table-add-column' | 'table-delete-row' | 'table-delete-column' | 'table-merge' | 'table-split';
|
|
39
|
+
/**
|
|
40
|
+
* All mutation types.
|
|
41
|
+
*/
|
|
42
|
+
export type MutationType = TextMutationType | ObjectMutationType;
|
|
43
|
+
/**
|
|
44
|
+
* State of text content before/after a mutation.
|
|
45
|
+
*/
|
|
46
|
+
export interface ContentState {
|
|
47
|
+
cursorPosition: number;
|
|
48
|
+
selection: {
|
|
49
|
+
start: number;
|
|
50
|
+
end: number;
|
|
51
|
+
} | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* State of an object before/after a mutation.
|
|
55
|
+
*/
|
|
56
|
+
export interface ObjectState {
|
|
57
|
+
/** Serialized object data for restoration */
|
|
58
|
+
data: unknown;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Data for text insert mutations.
|
|
62
|
+
*/
|
|
63
|
+
export interface InsertMutationData {
|
|
64
|
+
position: number;
|
|
65
|
+
text: string;
|
|
66
|
+
formatting?: TextFormattingStyle;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Data for text delete mutations.
|
|
70
|
+
*/
|
|
71
|
+
export interface DeleteMutationData {
|
|
72
|
+
position: number;
|
|
73
|
+
deletedText: string;
|
|
74
|
+
deletedFormatting: Map<number, TextFormattingStyle>;
|
|
75
|
+
/** Objects that were deleted (for restoration) */
|
|
76
|
+
deletedObjects?: Array<{
|
|
77
|
+
offset: number;
|
|
78
|
+
objectData: unknown;
|
|
79
|
+
}>;
|
|
80
|
+
/** Fields that were deleted (for restoration) */
|
|
81
|
+
deletedFields?: Array<{
|
|
82
|
+
offset: number;
|
|
83
|
+
field: SubstitutionField;
|
|
84
|
+
}>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Data for format mutations.
|
|
88
|
+
*/
|
|
89
|
+
export interface FormatMutationData {
|
|
90
|
+
start: number;
|
|
91
|
+
end: number;
|
|
92
|
+
newFormatting: Partial<TextFormattingStyle>;
|
|
93
|
+
previousFormatting: Map<number, TextFormattingStyle>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Data for alignment mutations.
|
|
97
|
+
*/
|
|
98
|
+
export interface AlignmentMutationData {
|
|
99
|
+
paragraphIndex: number;
|
|
100
|
+
newAlignment: 'left' | 'center' | 'right' | 'justify';
|
|
101
|
+
previousAlignment: 'left' | 'center' | 'right' | 'justify';
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Data for field insert mutations.
|
|
105
|
+
*/
|
|
106
|
+
export interface FieldInsertMutationData {
|
|
107
|
+
position: number;
|
|
108
|
+
field: SubstitutionField;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Data for field update mutations.
|
|
112
|
+
*/
|
|
113
|
+
export interface FieldUpdateMutationData {
|
|
114
|
+
textIndex: number;
|
|
115
|
+
previousData: Partial<SubstitutionField>;
|
|
116
|
+
newData: Partial<SubstitutionField>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Data for object resize mutations.
|
|
120
|
+
*/
|
|
121
|
+
export interface ResizeMutationData {
|
|
122
|
+
previousSize: {
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
};
|
|
126
|
+
newSize: {
|
|
127
|
+
width: number;
|
|
128
|
+
height: number;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Data for object move mutations.
|
|
133
|
+
*/
|
|
134
|
+
export interface MoveMutationData {
|
|
135
|
+
previousOffset: {
|
|
136
|
+
x: number;
|
|
137
|
+
y: number;
|
|
138
|
+
};
|
|
139
|
+
newOffset: {
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Data for object property mutations.
|
|
146
|
+
*/
|
|
147
|
+
export interface PropertyMutationData {
|
|
148
|
+
propertyName: string;
|
|
149
|
+
previousValue: unknown;
|
|
150
|
+
newValue: unknown;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Data for object insert/delete mutations.
|
|
154
|
+
*/
|
|
155
|
+
export interface ObjectMutationData {
|
|
156
|
+
position: number;
|
|
157
|
+
objectData: unknown;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Data for table structure mutations.
|
|
161
|
+
*/
|
|
162
|
+
export interface TableStructureMutationData {
|
|
163
|
+
/** Snapshot of table before the change */
|
|
164
|
+
beforeSnapshot: unknown;
|
|
165
|
+
/** Snapshot of table after the change */
|
|
166
|
+
afterSnapshot: unknown;
|
|
167
|
+
/** Row/column index affected */
|
|
168
|
+
index?: number;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Union of all mutation data types.
|
|
172
|
+
*/
|
|
173
|
+
export type MutationData = InsertMutationData | DeleteMutationData | FormatMutationData | AlignmentMutationData | FieldInsertMutationData | FieldUpdateMutationData | ResizeMutationData | MoveMutationData | PropertyMutationData | ObjectMutationData | TableStructureMutationData;
|
|
174
|
+
/**
|
|
175
|
+
* A single mutation record.
|
|
176
|
+
*/
|
|
177
|
+
export interface MutationRecord {
|
|
178
|
+
/** Unique ID for this mutation */
|
|
179
|
+
id: string;
|
|
180
|
+
/** Source of the mutation (content or object) */
|
|
181
|
+
sourceId: ContentSourceId | ObjectSourceId;
|
|
182
|
+
/** Type of mutation */
|
|
183
|
+
type: MutationType;
|
|
184
|
+
/** When this mutation occurred */
|
|
185
|
+
timestamp: number;
|
|
186
|
+
/** State before the mutation */
|
|
187
|
+
beforeState: ContentState | ObjectState;
|
|
188
|
+
/** State after the mutation */
|
|
189
|
+
afterState: ContentState | ObjectState;
|
|
190
|
+
/** Mutation-specific data */
|
|
191
|
+
data: MutationData;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Focus state for cursor/selection restoration.
|
|
195
|
+
*/
|
|
196
|
+
export interface FocusState {
|
|
197
|
+
/** Which section is active (body/header/footer) */
|
|
198
|
+
activeSection: 'body' | 'header' | 'footer';
|
|
199
|
+
/** ID of focused object (textbox, table) */
|
|
200
|
+
focusedObjectId: string | null;
|
|
201
|
+
/** If a table is focused, which cell */
|
|
202
|
+
tableCellAddress: {
|
|
203
|
+
row: number;
|
|
204
|
+
col: number;
|
|
205
|
+
} | null;
|
|
206
|
+
/** Cursor position within active content */
|
|
207
|
+
cursorPosition: number;
|
|
208
|
+
/** Selection range if any */
|
|
209
|
+
selection: {
|
|
210
|
+
start: number;
|
|
211
|
+
end: number;
|
|
212
|
+
} | null;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* A transaction groups related mutations into a single undoable unit.
|
|
216
|
+
*/
|
|
217
|
+
export interface Transaction {
|
|
218
|
+
/** Unique ID for this transaction */
|
|
219
|
+
id: string;
|
|
220
|
+
/** When this transaction started */
|
|
221
|
+
startTime: number;
|
|
222
|
+
/** When this transaction ended */
|
|
223
|
+
endTime: number;
|
|
224
|
+
/** All mutations in this transaction */
|
|
225
|
+
mutations: MutationRecord[];
|
|
226
|
+
/** Focus state before the transaction */
|
|
227
|
+
focusStateBefore: FocusState;
|
|
228
|
+
/** Focus state after the transaction */
|
|
229
|
+
focusStateAfter: FocusState;
|
|
230
|
+
/** Human-readable description */
|
|
231
|
+
description: string;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Configuration for coalescing mutations.
|
|
235
|
+
*/
|
|
236
|
+
export interface CoalesceConfig {
|
|
237
|
+
/** Maximum time gap between mutations to coalesce (ms) */
|
|
238
|
+
maxTimeGap: number;
|
|
239
|
+
/** Maximum characters before forcing a new transaction */
|
|
240
|
+
maxCharacters: number;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Default coalescing configuration.
|
|
244
|
+
*/
|
|
245
|
+
export declare const DEFAULT_COALESCE_CONFIG: CoalesceConfig;
|
|
246
|
+
/**
|
|
247
|
+
* Events emitted by the TransactionManager.
|
|
248
|
+
*/
|
|
249
|
+
export interface TransactionManagerEvents {
|
|
250
|
+
'state-changed': {
|
|
251
|
+
canUndo: boolean;
|
|
252
|
+
canRedo: boolean;
|
|
253
|
+
};
|
|
254
|
+
'undo-performed': {
|
|
255
|
+
transaction: Transaction;
|
|
256
|
+
};
|
|
257
|
+
'redo-performed': {
|
|
258
|
+
transaction: Transaction;
|
|
259
|
+
};
|
|
260
|
+
'transaction-committed': {
|
|
261
|
+
transaction: Transaction;
|
|
262
|
+
};
|
|
263
|
+
'history-cleared': void;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Generate a unique ID for transactions and mutations.
|
|
267
|
+
*/
|
|
268
|
+
export declare function generateId(): string;
|
|
269
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/undo/transaction/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;IAC7D,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACpC,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB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,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,yCAAyC;IACzC,gBAAgB,EAAE,UAAU,CAAC;IAC7B,wCAAwC;IACxC,eAAe,EAAE,UAAU,CAAC;IAC5B,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAGrC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IACxD,gBAAgB,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,CAAC;IAC/C,gBAAgB,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,CAAC;IAC/C,uBAAuB,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,CAAC;IACtD,iBAAiB,EAAE,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob-utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/blob-utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAajF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@productcloudos/editor",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Browser-based WYSIWYG document editor library for creating pixel-perfect documents with data binding and PDF export capabilities",
|
|
5
|
+
"author": "",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/ProductCloudOS/editor#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/ProductCloudOS/editor.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ProductCloudOS/editor/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"wysiwyg",
|
|
17
|
+
"editor",
|
|
18
|
+
"pdf",
|
|
19
|
+
"canvas",
|
|
20
|
+
"typescript",
|
|
21
|
+
"document",
|
|
22
|
+
"layout",
|
|
23
|
+
"data-binding",
|
|
24
|
+
"pdf-generation",
|
|
25
|
+
"table",
|
|
26
|
+
"rich-text"
|
|
27
|
+
],
|
|
28
|
+
"main": "dist/pc-editor.js",
|
|
29
|
+
"module": "dist/pc-editor.esm.js",
|
|
30
|
+
"types": "dist/types/lib/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/types/lib/index.d.ts",
|
|
34
|
+
"import": "./dist/pc-editor.esm.js",
|
|
35
|
+
"require": "./dist/pc-editor.js"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE",
|
|
44
|
+
"CHANGELOG.md"
|
|
45
|
+
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=18.0.0"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"dev": "vite serve src/demo",
|
|
54
|
+
"build": "npm run build:lib && npm run build:types",
|
|
55
|
+
"build:lib": "rollup -c",
|
|
56
|
+
"build:types": "tsc --project tsconfig.lib.json --declaration --emitDeclarationOnly --outDir dist/types",
|
|
57
|
+
"build:demo": "vite build src/demo --outDir ../../dev-dist",
|
|
58
|
+
"preview": "vite preview",
|
|
59
|
+
"type-check": "tsc --noEmit --project tsconfig.lib.json",
|
|
60
|
+
"lint": "eslint src",
|
|
61
|
+
"lint:fix": "eslint src --fix",
|
|
62
|
+
"test": "vitest",
|
|
63
|
+
"test:run": "vitest run",
|
|
64
|
+
"test:coverage": "vitest run --coverage",
|
|
65
|
+
"clean": "rm -rf dist dev-dist coverage",
|
|
66
|
+
"prepublishOnly": "npm run clean && npm run build && npm run test:run"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
70
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
71
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
72
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
73
|
+
"@types/node": "^20.10.0",
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^6.13.0",
|
|
75
|
+
"@typescript-eslint/parser": "^6.13.0",
|
|
76
|
+
"@vitest/coverage-v8": "^1.0.0",
|
|
77
|
+
"eslint": "^8.55.0",
|
|
78
|
+
"jsdom": "^23.2.0",
|
|
79
|
+
"rollup": "^4.6.0",
|
|
80
|
+
"typescript": "^5.3.0",
|
|
81
|
+
"vite": "^5.0.0",
|
|
82
|
+
"vitest": "^1.0.0"
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"pdf-lib": "^1.17.1",
|
|
86
|
+
"pdfjs-dist": "^3.11.174"
|
|
87
|
+
}
|
|
88
|
+
}
|