@designcrowd/library.brand-page 5.18.1-undo-26 → 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.
Files changed (32) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-DWzLegt3.js → CreatedOnBrandCrowd-de-de-CmaFdOwA.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-Dr6isTH_.js → CreatedOnBrandCrowd-en-us-DYcx1zJ5.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-hPCTaL-A.js → CreatedOnBrandCrowd-es-es-BW-OyQM7.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-BNDUTNc_.js → CreatedOnBrandCrowd-fr-ca-DDBKibOe.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-BNDUTNc_.js → CreatedOnBrandCrowd-fr-fr-DDBKibOe.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DKn5U0m5.js → CreatedOnBrandCrowd-pt-br-6OSkxFgf.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DKn5U0m5.js → CreatedOnBrandCrowd-pt-pt-6OSkxFgf.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-Cxe0RSmZ.js → CreatedOnDcom-de-de-Ds3pSY3b.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-D1D6h8b6.js → CreatedOnDcom-en-us-nu_xhm3W.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-4k5Jz225.js → CreatedOnDcom-es-es-DeWd8xLJ.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-CeB-CL-1.js → CreatedOnDcom-fr-ca-C30UWAc7.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-D7PCXxYg.js → CreatedOnDcom-fr-fr-ZFAi67Ii.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-D89FAdoN.js → CreatedOnDcom-pt-br-Bvtz3TFZ.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-CtJ0lm4O.js → CreatedOnDcom-pt-pt-Dr__mA4b.js} +1 -1
  15. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +13 -1
  16. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +4 -1
  17. package/lib/src/brand-page-maker/stores/history/history-store.js +90 -393
  18. package/lib/src/brand-page-maker/stores/user/user-store.js +1 -1
  19. package/lib/src/index.mjs +1 -1
  20. package/lib/src/{lib-D_xnR4VH.js → lib-BBItimSg.js} +18133 -18249
  21. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +64 -0
  22. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +12 -0
  23. package/package.json +1 -1
  24. package/src/brand-page-maker/components/quick-link-bar/undo-redo-buttons.test.ts +116 -0
  25. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +15 -2
  26. package/src/brand-page-maker/stores/history/history-store.test.ts +152 -790
  27. package/src/brand-page-maker/stores/history/history-store.ts +95 -444
  28. package/src/brand-page-maker/stores/user/user-store.ts +1 -1
  29. package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +7 -0
  30. package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +13 -0
  31. package/src/brand-page-maker/components/quick-link-bar/RedoButton.test.ts +0 -166
  32. package/src/brand-page-maker/components/quick-link-bar/UndoButton.test.ts +0 -166
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D_xnR4VH.js";
2
+ import { _ as t } from "./lib-BBItimSg.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D_xnR4VH.js";
2
+ import { _ as t } from "./lib-BBItimSg.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D_xnR4VH.js";
2
+ import { _ as t } from "./lib-BBItimSg.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D_xnR4VH.js";
2
+ import { _ as t } from "./lib-BBItimSg.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D_xnR4VH.js";
2
+ import { _ as t } from "./lib-BBItimSg.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D_xnR4VH.js";
2
+ import { _ as t } from "./lib-BBItimSg.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D_xnR4VH.js";
2
+ import { _ as t } from "./lib-BBItimSg.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-D_xnR4VH.js";
2
+ import { _ as e } from "./lib-BBItimSg.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-D_xnR4VH.js";
2
+ import { _ as e } from "./lib-BBItimSg.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-D_xnR4VH.js";
2
+ import { _ as e } from "./lib-BBItimSg.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-D_xnR4VH.js";
2
+ import { _ as e } from "./lib-BBItimSg.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-D_xnR4VH.js";
2
+ import { _ as e } from "./lib-BBItimSg.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-D_xnR4VH.js";
2
+ import { _ as M } from "./lib-BBItimSg.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-D_xnR4VH.js";
2
+ import { _ as M } from "./lib-BBItimSg.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -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">>;