@designcrowd/library.brand-page 5.18.1-undo-27 → 5.18.1-undo-28
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/lib/src/{CreatedOnBrandCrowd-de-de-COk1RbBS.js → CreatedOnBrandCrowd-de-de-CmaFdOwA.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CB3iIEMt.js → CreatedOnBrandCrowd-en-us-DYcx1zJ5.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CRU0kUB6.js → CreatedOnBrandCrowd-es-es-BW-OyQM7.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-C5DdVGnT.js → CreatedOnBrandCrowd-fr-ca-DDBKibOe.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-C5DdVGnT.js → CreatedOnBrandCrowd-fr-fr-DDBKibOe.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-2L9tw0-m.js → CreatedOnBrandCrowd-pt-br-6OSkxFgf.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-2L9tw0-m.js → CreatedOnBrandCrowd-pt-pt-6OSkxFgf.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BDHBukLE.js → CreatedOnDcom-de-de-Ds3pSY3b.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D0vKhTnI.js → CreatedOnDcom-en-us-nu_xhm3W.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CCYUHgfO.js → CreatedOnDcom-es-es-DeWd8xLJ.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DnPc5h-w.js → CreatedOnDcom-fr-ca-C30UWAc7.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-CvWbnzbp.js → CreatedOnDcom-fr-fr-ZFAi67Ii.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DdMZYZog.js → CreatedOnDcom-pt-br-Bvtz3TFZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BPvriH9Y.js → CreatedOnDcom-pt-pt-Dr__mA4b.js} +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +13 -1
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +4 -1
- package/lib/src/brand-page-maker/stores/history/history-store.js +103 -443
- package/lib/src/brand-page-maker/stores/user/user-store.js +1 -1
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-CcYKXNUY.js → lib-BBItimSg.js} +20947 -21083
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +64 -0
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +12 -0
- package/package.json +1 -1
- package/src/brand-page-maker/components/quick-link-bar/undo-redo-buttons.test.ts +116 -0
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +15 -2
- package/src/brand-page-maker/stores/history/history-store.test.ts +184 -894
- package/src/brand-page-maker/stores/history/history-store.ts +108 -521
- package/src/brand-page-maker/stores/user/user-store.ts +1 -1
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +7 -0
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +13 -0
- package/src/brand-page-maker/components/quick-link-bar/RedoButton.test.ts +0 -166
- package/src/brand-page-maker/components/quick-link-bar/UndoButton.test.ts +0 -166
|
@@ -73,6 +73,19 @@ export const useExternalRichTextEditor = () => {
|
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
export const useRichTextEditor = (model, props, emit, fontSettings, fontStyleDropdownRef, selectedGlobalTextStyles, onSelectTextStyleType, updateRichTextEditor, textStyleTypeOptions, markedText, isHyperlinkPopupOpen, selectedLinkTypeValue) => {
|
|
76
|
+
const historyStore = useHistoryStore();
|
|
77
|
+
// TipTap rehydrates `model.value` on first mount and writes the
|
|
78
|
+
// canonical HTML back via `editor.on('update', ...)` — even when the
|
|
79
|
+
// user-visible text is unchanged (it normalises whitespace, wraps plain
|
|
80
|
+
// text in `<p>`, expands `%0A` to `<br>`, mirrors the resolved textStyle
|
|
81
|
+
// as inline `<strong>`/`<span style="...">`/`<mark>` tags, etc). Each of
|
|
82
|
+
// those rehydration writes mutates `brandPageData` and would otherwise
|
|
83
|
+
// surface as a phantom undo entry the first time the user opens a
|
|
84
|
+
// sidebar or clicks into a section. Arming the merge flag folds the
|
|
85
|
+
// resulting watcher flush into the current head instead of pushing.
|
|
86
|
+
// Idempotent — every editor on the page mounting at once collapses
|
|
87
|
+
// into the same merge.
|
|
88
|
+
historyStore.mergeNextMutation();
|
|
76
89
|
const editor = new Editor({
|
|
77
90
|
content: model.value ?? '',
|
|
78
91
|
editable: !props.readOnly,
|
|
@@ -263,7 +276,6 @@ export const useRichTextEditor = (model, props, emit, fontSettings, fontStyleDro
|
|
|
263
276
|
const sanitizedData = sanitiseClientSideRTE(editor.getHTML());
|
|
264
277
|
emit('update:modelValue', sanitizedData.sanitizedHtml);
|
|
265
278
|
});
|
|
266
|
-
const historyStore = useHistoryStore();
|
|
267
279
|
editor.on('selectionUpdate', () => {
|
|
268
280
|
// Skip while a history snapshot is being applied — `setContent` fires
|
|
269
281
|
// selectionUpdate before the editor has fully rehydrated, which causes
|
|
@@ -72,6 +72,7 @@ export declare const useHistoryStore: import("pinia").StoreDefinition<"history",
|
|
|
72
72
|
}) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
73
73
|
captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
74
74
|
captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
75
|
+
mergeNextMutation: () => void;
|
|
75
76
|
undo: () => Promise<void>;
|
|
76
77
|
redo: () => Promise<void>;
|
|
77
78
|
reset: () => void;
|
|
@@ -92,6 +93,7 @@ export declare const useHistoryStore: import("pinia").StoreDefinition<"history",
|
|
|
92
93
|
}) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
93
94
|
captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
94
95
|
captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
96
|
+
mergeNextMutation: () => void;
|
|
95
97
|
undo: () => Promise<void>;
|
|
96
98
|
redo: () => Promise<void>;
|
|
97
99
|
reset: () => void;
|
|
@@ -112,9 +114,10 @@ export declare const useHistoryStore: import("pinia").StoreDefinition<"history",
|
|
|
112
114
|
}) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
113
115
|
captureTemplateSwitch: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
114
116
|
captureAiChangeset: (label?: string) => 'committed' | 'oversized' | 'noop' | 'skipped';
|
|
117
|
+
mergeNextMutation: () => void;
|
|
115
118
|
undo: () => Promise<void>;
|
|
116
119
|
redo: () => Promise<void>;
|
|
117
120
|
reset: () => void;
|
|
118
121
|
getCurrentSizeBytes: () => number;
|
|
119
122
|
getCurrentEntryCount: () => number;
|
|
120
|
-
}, "reset" | "undo" | "redo" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;
|
|
123
|
+
}, "reset" | "undo" | "redo" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "mergeNextMutation" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;
|