@designcrowd/library.brand-page 5.18.3-undo-37 → 5.18.3-undo-40

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 (24) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-CM2cOZlw.js → CreatedOnBrandCrowd-de-de-D_w411MF.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-rq4QquAm.js → CreatedOnBrandCrowd-en-us-DvJhv23Q.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BgbxyKPJ.js → CreatedOnBrandCrowd-es-es-BvW6EBKl.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-Dm1XphSl.js → CreatedOnBrandCrowd-fr-ca-Bc4iL236.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-Dm1XphSl.js → CreatedOnBrandCrowd-fr-fr-Bc4iL236.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-B2a5OfdX.js → CreatedOnBrandCrowd-pt-br-C74D9eIB.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-B2a5OfdX.js → CreatedOnBrandCrowd-pt-pt-C74D9eIB.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-BClRSXzU.js → CreatedOnDcom-de-de-BVL3vDSq.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-Cg4PeKOO.js → CreatedOnDcom-en-us-B9Dow5pk.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-izSiOsWK.js → CreatedOnDcom-es-es-H2Dv6N8F.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-IHiZuyNO.js → CreatedOnDcom-fr-ca-sw4LRlLw.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-DLGYRMhZ.js → CreatedOnDcom-fr-fr-DnOriI4M.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DAv_n1Hs.js → CreatedOnDcom-pt-br-BXs8zbRg.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-5DGgadD1.js → CreatedOnDcom-pt-pt-DmfOvW_0.js} +1 -1
  15. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +2 -4
  16. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +6 -5
  17. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +9 -6
  18. package/lib/src/brand-page-maker/stores/history/history-store.js +8 -1
  19. package/lib/src/index.mjs +1 -1
  20. package/lib/src/{lib-pHQ0LDnY.js → lib-Dg2Zs9nH.js} +4091 -4090
  21. package/package.json +1 -1
  22. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +2 -4
  23. package/src/brand-page-maker/composables/useUndoRedoFlag.ts +10 -6
  24. package/src/brand-page-maker/stores/history/history-store.ts +10 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "5.18.3-undo-37",
4
+ "version": "5.18.3-undo-40",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -286,10 +286,8 @@ export default defineComponent({
286
286
  this.brandPageMakerStore.setIsBrandPageLoaded(true);
287
287
 
288
288
  // Capture baseline for undo/redo when the feature is active for this
289
- // session. `useUndoRedoFlag` requires both the LaunchDarkly feature
290
- // (`userStore.features.canUseUndoRedo`) AND the maker being a brand-site
291
- // — V1 scope is brand-site only; brand-page and brand-contact don't get
292
- // undo/redo. See useUndoRedoFlag.ts for the rationale.
289
+ // session — see useUndoRedoFlag.ts for the gate (LaunchDarkly flag +
290
+ // brand-site + non-admin maker).
293
291
  if (useUndoRedoFlag().value) {
294
292
  useHistoryStore().captureBaseline();
295
293
  }
@@ -3,8 +3,8 @@ import { useBrandPageMakerUserStore } from '@brand-page-maker/stores/user';
3
3
  import { useBrandPageMakerStore } from '@brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
4
4
 
5
5
  /**
6
- * Returns whether undo/redo is active for the current maker session. Two
7
- * conditions must hold:
6
+ * Returns whether undo/redo is active for the current maker session. All
7
+ * three conditions must hold:
8
8
  *
9
9
  * 1. `userStore.features.canUseUndoRedo` is true. The flag is populated by
10
10
  * the consumer (BrandCrowd.Net / web-renderer) via the
@@ -12,15 +12,19 @@ import { useBrandPageMakerStore } from '@brand-page-maker/stores/brandpage-maker
12
12
  * same precedent as RichTextEditor / GettyVideos / AITextGenerator.
13
13
  * 2. The maker is a brand-site (Website Maker). V1 scope is brand-site
14
14
  * only; brand-page (single-page profile) and brand-contact (vCard) are
15
- * out of scope. The flag itself is global on LaunchDarkly so it can't
16
- * gate this on its own — `isBrandSite` is the per-session
17
- * discriminator.
15
+ * out of scope.
16
+ * 3. The session is NOT in admin-maker mode (`userStore.isAdmin`). The
17
+ * admin maker uses the same components but a different editing flow
18
+ * (template authoring) where undo/redo is out of scope.
18
19
  */
19
20
  export function useUndoRedoFlag(): ComputedRef<boolean> {
20
21
  const userStore = useBrandPageMakerUserStore();
21
22
  const brandPageMakerStore = useBrandPageMakerStore();
22
23
 
23
24
  return computed(
24
- () => userStore.features.canUseUndoRedo && brandPageMakerStore.isBrandSite,
25
+ () =>
26
+ userStore.features.canUseUndoRedo &&
27
+ brandPageMakerStore.isBrandSite &&
28
+ !userStore.isAdmin,
25
29
  );
26
30
  }
@@ -33,6 +33,11 @@ export interface HistoryEntry {
33
33
  const CAPTURE_DEBOUNCE_MS = 1700;
34
34
  const CAPTURE_MAX_WAIT_MS = 10000;
35
35
 
36
+ // Merge bursts flush quickly — sync hydration writes land in <50ms,
37
+ // user typing takes >150ms, so a short debounce keeps user input out
38
+ // of the merge.
39
+ const MERGE_DEBOUNCE_MS = 50;
40
+
36
41
  // FR-12 / FR-13 / FR-13c. 25 MB per-entry accommodates a high-res BYO logo
37
42
  // rendered into 4 viewport sections + per-page logo blocks. Oversize
38
43
  // entries are skipped with telemetry; 100 MB total evicts oldest
@@ -355,7 +360,11 @@ export const useHistoryStore = defineStore('history', () => {
355
360
  mergeArmed.value = false;
356
361
  }
357
362
 
358
- idleTimerId = setTimeout(flush, CAPTURE_DEBOUNCE_MS);
363
+ const idle = pendingTimerIsMerge
364
+ ? MERGE_DEBOUNCE_MS
365
+ : CAPTURE_DEBOUNCE_MS;
366
+
367
+ idleTimerId = setTimeout(flush, idle);
359
368
  maxWaitTimerId = setTimeout(flush, CAPTURE_MAX_WAIT_MS);
360
369
  };
361
370