@designcrowd/library.brand-page 6.0.6-tracker-1 → 6.0.6-undo-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 (64) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-DD0OBnij.js → CreatedOnBrandCrowd-de-de-BSFTp6yl.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DysrpsmM.js → CreatedOnBrandCrowd-en-us-rPQrOY1L.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-B6twGr9h.js → CreatedOnBrandCrowd-es-es-awd8-QFa.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-yxl0ih_4.js → CreatedOnBrandCrowd-fr-ca-CwJ4J7Ow.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-yxl0ih_4.js → CreatedOnBrandCrowd-fr-fr-CwJ4J7Ow.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-BtXDrIcx.js → CreatedOnBrandCrowd-pt-br-BXYfTLlD.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-BtXDrIcx.js → CreatedOnBrandCrowd-pt-pt-BXYfTLlD.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-ho_ROy1L.js → CreatedOnDcom-de-de-kX6u1lNK.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-C91p9kls.js → CreatedOnDcom-en-us-Bkq5sgFs.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-B3FYmObE.js → CreatedOnDcom-es-es-zCAC9ujj.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-D40m7fPx.js → CreatedOnDcom-fr-ca-BYz6Wzg5.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-Cd57oYyc.js → CreatedOnDcom-fr-fr-CN-wAaSH.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-Du57mWxG.js → CreatedOnDcom-pt-br-BrK4Ngg-.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-fYoPZWwr.js → CreatedOnDcom-pt-pt-AfI_g7xJ.js} +1 -1
  15. package/lib/src/brand-page/utils/logo.util.d.ts +14 -0
  16. package/lib/src/brand-page/utils/logo.util.js +19 -0
  17. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -1
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -1
  19. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +1 -1
  20. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
  21. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
  22. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -1
  23. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -1
  24. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
  25. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
  26. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -1
  27. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +16 -0
  28. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +6 -7
  29. package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +7 -12
  30. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +1 -1
  31. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +12 -7
  32. package/lib/src/brand-page-maker/stores/history/history-store.d.ts +6 -0
  33. package/lib/src/brand-page-maker/stores/history/history-store.js +11 -1
  34. package/lib/src/index.mjs +83 -84
  35. package/lib/src/{lib-lMNy66QO.js → lib-BYFWAvIq.js} +22625 -22276
  36. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +13 -0
  37. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +49 -0
  38. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -1
  39. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
  40. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
  41. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +1 -0
  42. package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.js +18 -7
  43. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
  44. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -1
  45. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -1
  46. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
  47. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -1
  48. package/package.json +1 -16
  49. package/src/brand-page/utils/logo.util.test.ts +54 -1
  50. package/src/brand-page/utils/logo.util.ts +23 -0
  51. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +1 -1
  52. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +17 -0
  53. package/src/brand-page-maker/composables/useUndoRedoFlag.ts +7 -13
  54. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +53 -0
  55. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +13 -16
  56. package/src/brand-page-maker/stores/history/history-store.test.ts +51 -0
  57. package/src/brand-page-maker/stores/history/history-store.ts +19 -0
  58. package/src/metadata-builder/builders/reorder-pages-builder.ts +80 -0
  59. package/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.ts +19 -11
  60. package/lib/src/tracker.d.ts +0 -2
  61. package/lib/src/tracker.js +0 -12
  62. package/lib/src/tracker.mjs +0 -12
  63. package/lib/src/useEventTracker-DmQ6AkNn.js +0 -356
  64. package/src/tracker.ts +0 -28
@@ -26,6 +26,12 @@ export interface HistoryEntry {
26
26
  activePageId: string;
27
27
  /** JSON-stringified `editableLogoStore.logoEdits`. Undefined if logo tab never opened. */
28
28
  logoEdits?: string;
29
+ /**
30
+ * Selected template id at capture time — drives the templates sidebar
31
+ * highlight. `false` when no template is selected. Sidecar to
32
+ * `brandPageData` (not part of the persisted model), like `activePageId`.
33
+ */
34
+ selectedTemplateId?: string | false;
29
35
  }
30
36
 
31
37
  // Monotonic burst — first mutation starts the timer, subsequent mutations
@@ -150,6 +156,10 @@ export const useHistoryStore = defineStore('history', () => {
150
156
  return usePageNavigationStore().activePageId ?? '';
151
157
  }
152
158
 
159
+ function getCurrentSelectedTemplateId(): string | false {
160
+ return useBrandPageMakerStore().selectedTemplateId;
161
+ }
162
+
153
163
  function serializeCurrentLogoEdits(): string | undefined {
154
164
  try {
155
165
  const editableLogoStore = useUiEditableLogoStore();
@@ -187,6 +197,7 @@ export const useHistoryStore = defineStore('history', () => {
187
197
  label?: string;
188
198
  activePageId: string;
189
199
  logoEdits?: string;
200
+ selectedTemplateId?: string | false;
190
201
  }): 'committed' | 'oversized' | 'noop' {
191
202
  const current = entries.value[currentIndex.value];
192
203
 
@@ -219,6 +230,7 @@ export const useHistoryStore = defineStore('history', () => {
219
230
  sizeBytes: args.snapshot.length,
220
231
  activePageId: args.activePageId,
221
232
  logoEdits: args.logoEdits,
233
+ selectedTemplateId: args.selectedTemplateId,
222
234
  };
223
235
 
224
236
  // FR-11: truncate redo tail, then append.
@@ -293,6 +305,7 @@ export const useHistoryStore = defineStore('history', () => {
293
305
 
294
306
  const activePageId = getCurrentActivePageId();
295
307
  const logoEdits = serializeCurrentLogoEdits();
308
+ const selectedTemplateId = getCurrentSelectedTemplateId();
296
309
 
297
310
  // Settle window: fold post-init reactive cascades back into the
298
311
  // baseline so undo doesn't light up before the user has done
@@ -317,6 +330,7 @@ export const useHistoryStore = defineStore('history', () => {
317
330
  sizeBytes: snapshot.length,
318
331
  activePageId,
319
332
  logoEdits,
333
+ selectedTemplateId,
320
334
  },
321
335
  ];
322
336
 
@@ -333,6 +347,7 @@ export const useHistoryStore = defineStore('history', () => {
333
347
  sizeBytes: snapshot.length,
334
348
  activePageId,
335
349
  logoEdits,
350
+ selectedTemplateId,
336
351
  };
337
352
  entries.value = next;
338
353
 
@@ -345,6 +360,7 @@ export const useHistoryStore = defineStore('history', () => {
345
360
  actor: 'user',
346
361
  activePageId,
347
362
  logoEdits,
363
+ selectedTemplateId,
348
364
  });
349
365
  };
350
366
 
@@ -402,6 +418,7 @@ export const useHistoryStore = defineStore('history', () => {
402
418
  sizeBytes: snapshot.length,
403
419
  activePageId: getCurrentActivePageId(),
404
420
  logoEdits: serializeCurrentLogoEdits(),
421
+ selectedTemplateId: getCurrentSelectedTemplateId(),
405
422
  },
406
423
  ];
407
424
  currentIndex.value = 0;
@@ -427,6 +444,7 @@ export const useHistoryStore = defineStore('history', () => {
427
444
  snapshot,
428
445
  activePageId: getCurrentActivePageId(),
429
446
  logoEdits: serializeCurrentLogoEdits(),
447
+ selectedTemplateId: getCurrentSelectedTemplateId(),
430
448
  ...args,
431
449
  });
432
450
  }
@@ -531,6 +549,7 @@ export const useHistoryStore = defineStore('history', () => {
531
549
  snapshot,
532
550
  resolvedActivePageId,
533
551
  targetEntry?.logoEdits,
552
+ targetEntry?.selectedTemplateId,
534
553
  );
535
554
  } finally {
536
555
  isApplyingSnapshot.value = false;
@@ -0,0 +1,80 @@
1
+ import type { BrandPageModel, NavOrder } from '../../brand-page/models';
2
+ import {
3
+ BaseMetadataBuilder,
4
+ type BuilderResult,
5
+ type MetadataBuilderRequest,
6
+ } from '../models';
7
+ import type { Logger } from '../logger';
8
+
9
+ export interface ReorderPagesPayload {
10
+ pageOrder: string[];
11
+ }
12
+
13
+ export class ReorderPagesBuilder extends BaseMetadataBuilder<ReorderPagesPayload> {
14
+ constructor(
15
+ request: MetadataBuilderRequest<ReorderPagesPayload>,
16
+ logger?: Logger,
17
+ ) {
18
+ super(request, logger);
19
+ }
20
+
21
+ async validateAsync(): Promise<{ errors: string[] }> {
22
+ const errors: string[] = [];
23
+ const payload = this.request.payload;
24
+
25
+ if (!payload?.pageOrder?.length) {
26
+ errors.push('page_order is required for reorder_pages');
27
+ }
28
+
29
+ return { errors };
30
+ }
31
+
32
+ async buildAsync(model: BrandPageModel): Promise<BuilderResult> {
33
+ this.log('Build called');
34
+
35
+ const validation = await this.validateAsync();
36
+
37
+ if (validation.errors.length) {
38
+ return { request: this.request, model, errors: validation.errors };
39
+ }
40
+
41
+ const { pageOrder } = this.request.payload!;
42
+
43
+ // Build pageId → routeId lookup from nav.routes
44
+ const pageIdToRouteId = new Map<string, string>();
45
+
46
+ for (const route of model.nav.routes) {
47
+ pageIdToRouteId.set(route.pageId, route.id);
48
+ }
49
+
50
+ // Build new nav.orders from the flat page_order (array of pageIds)
51
+ const newOrders: NavOrder[] = [];
52
+ const seenRouteIds = new Set<string>();
53
+
54
+ for (const pageId of pageOrder) {
55
+ const routeId = pageIdToRouteId.get(pageId);
56
+
57
+ if (!routeId) continue;
58
+
59
+ newOrders.push({ routeId, subRoutes: [] });
60
+ seenRouteIds.add(routeId);
61
+ }
62
+
63
+ // Safety: append any routes not mentioned (don't lose pages)
64
+ for (const route of model.nav.routes) {
65
+ const routeId = pageIdToRouteId.get(route.pageId);
66
+
67
+ if (routeId && !seenRouteIds.has(routeId)) {
68
+ newOrders.push({ routeId, subRoutes: [] });
69
+ }
70
+ }
71
+
72
+ model.nav.orders = newOrders;
73
+
74
+ this.log({
75
+ message: `Reordered pages: ${pageOrder.join(', ')}`,
76
+ });
77
+
78
+ return { request: this.request, model };
79
+ }
80
+ }
@@ -176,17 +176,7 @@ export default defineComponent({
176
176
  TEXT_SIZE_CHANGE_DEBOUNCE_WAIT_IN_MS,
177
177
  );
178
178
 
179
- const value = this.value as unknown as TextStyleDeclaration;
180
-
181
- if (value.textStyleType) {
182
- const textStyleTypeOption = this.textStyleTypeOptions.find(
183
- (x) => x.value === value.textStyleType,
184
- );
185
-
186
- if (textStyleTypeOption) {
187
- textStyleTypeOption.isSelected = true;
188
- }
189
- }
179
+ this.syncTextStyleTypeSelection();
190
180
  },
191
181
  computed: {
192
182
  selectedTextStyle(): TextStyleDeclaration {
@@ -423,9 +413,27 @@ export default defineComponent({
423
413
  generateFontFamilySelectorKey() {
424
414
  return `fontFamilySelector-${this.id}-${Date.now()}`;
425
415
  },
416
+ // Re-derive the text-style-type selection from the current `value`.
417
+ // Seeded in created() and re-run whenever `value` changes (e.g. undo/redo
418
+ // restores the model) so the dropdown title and `selectedTextStyle`
419
+ // reflect the model rather than a stale local flag. (BP-5811 / BP-5817)
420
+ syncTextStyleTypeSelection() {
421
+ const value = this.value as unknown as TextStyleDeclaration;
422
+
423
+ this.textStyleTypeOptions.forEach((option) => {
424
+ // The leading Boolean(...) guard is deliberate — do NOT simplify to
425
+ // `option.value === value?.textStyleType`. The "none" option's value
426
+ // is `undefined`, so that form would SELECT it whenever no style is
427
+ // set, whereas the convention (see emitChange) is all-flags-false
428
+ // when there is no textStyleType.
429
+ option.isSelected =
430
+ Boolean(value?.textStyleType) && option.value === value.textStyleType;
431
+ });
432
+ },
426
433
  },
427
434
  watch: {
428
435
  value() {
436
+ this.syncTextStyleTypeSelection();
429
437
  this.$nextTick(() => {
430
438
  this.fontFamilySelectorKey = this.generateFontFamilySelectorKey();
431
439
  });
@@ -1,2 +0,0 @@
1
- export { useEventTracker, EVENTS, SELECT_LOCATIONS, UPGRADE_CTA_LOCATIONS, AI_CTA_LOCATIONS, TRIGGER_TYPE, PUBLISH_MODAL_CONTINUATION_EVENTS, GENERATE_TEXT_CONTINUATION_EVENTS, PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS, } from './brand-page-maker/composables/useEventTracker';
2
- export type { EventTracker, BpEventTrackerEvent, BpGlobalEventProps, BpUpsellEventProps, } from './brand-page-maker/composables/useEventTracker';
@@ -1,12 +0,0 @@
1
- // Lightweight subpath entry: `@designcrowd/library.brand-page/tracker`.
2
- // Re-exports ONLY the analytics surface (useEventTracker + event constants),
3
- // which depends solely on `vue`. This lets consumers import the tracker without
4
- // pulling the full library graph (maker, TipTap, renderer). See
5
- // docs/plans/multi-entrypoint-tree-shaking.md and the /tracker proposal.
6
- //
7
- // IMPORTANT: useEventTracker holds module-scoped pub/sub state (LISTENERS,
8
- // GLOBAL_EVENT_PROPS). It MUST resolve to a single shared instance across this
9
- // entry and the root `.` entry, or subscribers registered here won't receive
10
- // events published via the root. The multi-entry build hoists it into a shared
11
- // chunk (both `index` and `tracker` import it) — verified at build time.
12
- export { useEventTracker, EVENTS, SELECT_LOCATIONS, UPGRADE_CTA_LOCATIONS, AI_CTA_LOCATIONS, TRIGGER_TYPE, PUBLISH_MODAL_CONTINUATION_EVENTS, GENERATE_TEXT_CONTINUATION_EVENTS, PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS, } from './brand-page-maker/composables/useEventTracker';
@@ -1,12 +0,0 @@
1
- import { A as N, E as O, G as _, P as A, a as I, S as a, T as S, U as s, u as C } from "./useEventTracker-DmQ6AkNn.js";
2
- export {
3
- N as AI_CTA_LOCATIONS,
4
- O as EVENTS,
5
- _ as GENERATE_TEXT_CONTINUATION_EVENTS,
6
- A as PUBLISH_MODAL_CONTINUATION_EVENTS,
7
- I as PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS,
8
- a as SELECT_LOCATIONS,
9
- S as TRIGGER_TYPE,
10
- s as UPGRADE_CTA_LOCATIONS,
11
- C as useEventTracker
12
- };
@@ -1,356 +0,0 @@
1
- import { shallowRef as A } from "vue";
2
- const E = {
3
- EXPERIMENT_STARTED: "$experiment_started",
4
- WEBSITE_MAKER_ADD_CONTENT: "website_maker_add_content",
5
- WEBSITE_MAKER_REMOVE_CONTENT: "website_maker_remove_content",
6
- WEBSITE_MAKER_SELECT_CONTENT: "website_maker_select_content",
7
- WEBSITE_MAKER_UPSELL_MODAL: "website_maker_upsell_modal",
8
- WEBSITE_MAKER_PUBLISH_MODAL: "website_maker_publish_modal",
9
- WEBSITE_MAKER_ADD_PAGE: "website_maker_add_page",
10
- WEBSITE_MAKER_REMOVE_PAGE: "website_maker_remove_page",
11
- WEBSITE_MAKER_REORDER_PAGE: "website_maker_reorder_page",
12
- WEBSITE_MAKER_OPEN: "website_maker_open",
13
- WEBSITE_MAKER_PUBLISH_UPSELL_OPTION_MODAL: "website_maker_publish_upsell_option_modal",
14
- WEBSITE_MAKER_TEMPLATE_SEARCH: "website_maker_template_search",
15
- WEBSITE_MAKER_TEMPLATE_SELECT: "website_maker_template_select",
16
- WEBSITE_MAKER_TEMPLATE_CATEGORY_SELECT: "website_maker_template_category_select",
17
- WEBSITE_SIDEBAR_TAB_CLICKED: "website_sidebar_tab_clicked",
18
- WEBSITE_MAKER_HYPERLINK_ADD: "website_maker_hyperlink_add",
19
- WEBSITE_MAKER_HYPERLINK_REMOVE: "website_maker_hyperlink_remove",
20
- WEBSITE_MAKER_HYPERLINK_CLICK: "website_maker_hyperlink_click",
21
- WEBSITE_MAKER_HYPERLINK_EDIT: "website_maker_hyperlink_edit",
22
- WEBSITE_MAKER_CALENDLY_LINK_CLICKED: "website_maker_calendly_link_clicked",
23
- WEBSITE_MAKER_UPSELL_OFFER: "website_maker_upsell_offer",
24
- WEBSITE_MAKER_UPSELL_ACTION: "website_maker_upsell_action",
25
- WEBSITE_MAKER_SWITCH_LOGO: "website_maker_switch_logo",
26
- WEBSITE_MAKER_SWITCH_LOGO_MODAL: "website_maker_switch_logo_modal",
27
- WEBSITE_MAKER_AI_SEND_PROMPT: "website_maker_ai_send_prompt",
28
- WEBSITE_MAKER_AI_STOP_GENERATION: "website_maker_ai_stop_generation",
29
- WEBSITE_SAVE_CONTACT: "website_save_contact",
30
- WEBSITE_START_FOR_FREE: "website_start_for_free",
31
- WEBSITE_FOOTER_LINK_CLICK: "website_footer_link_click",
32
- WEBSITE_MAKER_AI_CLICK_SUGGESTED_PROMPT: "website_maker_ai_click_suggested_prompt",
33
- WEBSITE_MAKER_DOMAIN_UPSELL_MODAL: "website_domain_upsell_modal",
34
- WEBSITE_MAKER_DIGITAL_BUSINESS_CARDS_SAVE_CONTACT_TOGGLE: "website_maker_digital_business_cards_save_contact_toggle",
35
- WEBSITE_MAKER_DIGITAL_BUSINESS_CARDS_HIDE_POPUP: "website_maker_digital_business_cards_hide_popup",
36
- WEBSITE_MAKER_GETTY_VIDEO: "website_maker_getty_video",
37
- WEBSITE_MAKER_SHIPPING_TOGGLE: "website_maker_shipping_toggle",
38
- WEBSITE_MAKER_UNDO: "website_maker_undo",
39
- WEBSITE_MAKER_REDO: "website_maker_redo",
40
- WEBSITE_MAKER_HISTORY_CAPPED: "website_maker_history_capped",
41
- WEBSITE_MAKER_HISTORY_OVERSIZED: "website_maker_history_oversized"
42
- }, R = {
43
- MAKER_PREVIEW: "maker_preview",
44
- SIDEBAR: "sidebar"
45
- }, p = {
46
- MANAGE_WEBSITE: "manage_website",
47
- MANAGE_WEBSITE_PUBLISH: "manage_website_publish",
48
- MANAGE_WEBSITE_UPGRADE: "manage_website_upgrade",
49
- REMOVE_WATERMARK: "remove_watermark",
50
- REMOVE_WATERMARK_FOOTER_SETTINGS: "remove_watermark_footer_settings",
51
- PREVIEW_WATERMARK: "preview_watermark",
52
- ADD_NEW_PAGE: "add_new_page",
53
- ADD_CONTENT: "add_content",
54
- EDITOR_PUBLISH_TOP: "editor_publish_top",
55
- EDITOR_PUBLISH_BOTTOM: "editor_publish_bottom",
56
- SLUG_CHANGE_MAKER_SIDEBAR_SETTINGS: "slug_change_maker_sidebar_settings",
57
- SLUG_CHANGE_MANAGE_PAGE: "slug_change_manage_page",
58
- GOOGLE_ADSENSE: "google_adsense",
59
- QUICK_LINKS: "quick_links",
60
- SAVE_CONTACT_SETTINGS: "save_contact_settings",
61
- NAV_TOP: "nav_top",
62
- NAV_BOTTOM: "nav_bottom"
63
- }, O = {
64
- AI_BUILDER_TAB: "ai_builder_tab",
65
- AI_BUILDER_CHAT_UPSELL: "ai_builder_chat_upsell"
66
- }, S = {
67
- AUTOMATIC: "automatic",
68
- USER_TRIGGERED: "user_triggered",
69
- AI_BUILDER: "ai_builder"
70
- }, d = {
71
- PUBLISH: "publish",
72
- EXIT: "exit",
73
- BUY_A_DOMAIN: "buy_a_domain",
74
- SEARCH_A_DOMAIN: "search_a_domain",
75
- COPY_LINK: "copy_link",
76
- VIEW_WEBSITE: "view_website",
77
- USE_EXISTING_DOMAIN: "use_existing_domain"
78
- }, M = {
79
- USE_TEXT: "use_text",
80
- EXIT: "exit"
81
- }, T = {
82
- PREMIUM: "premium",
83
- EXIT: "exit",
84
- FREEMIUM: "freemium"
85
- }, i = A(), n = A({
86
- upsellOpenEventProps: {},
87
- domainUpsellOpenEventProps: {},
88
- publishOpenEventProps: {}
89
- }), l = A([]), _ = (o, I, e = !1, t = "maker_editor") => {
90
- l.value.forEach((s) => {
91
- s({
92
- scope: t,
93
- eventName: o,
94
- eventProps: {
95
- ...e ? {} : i.value,
96
- ...I
97
- }
98
- });
99
- });
100
- }, P = () => ({
101
- sendExperimentStartedEvent: (e, t) => {
102
- _(
103
- E.EXPERIMENT_STARTED,
104
- {
105
- "Experiment name": e,
106
- "Variant name": t
107
- },
108
- !0
109
- );
110
- },
111
- setGlobalEventProps: (e) => {
112
- const t = {
113
- template_category: "website",
114
- template_type: "brand-page",
115
- location: "post_purchase",
116
- domain_type: "Free"
117
- };
118
- i.value = { ...t, ...e };
119
- },
120
- setCustomGlobalEventProps: (e) => {
121
- i.value = e;
122
- },
123
- setUpsellBridgeState: (e) => {
124
- n.value.upsellOpenEventProps = e;
125
- },
126
- setDomainUpsellBridgeState: (e) => {
127
- n.value.domainUpsellOpenEventProps = e;
128
- },
129
- subscribe: (e) => {
130
- l.value.push(e);
131
- },
132
- // Publish event to subscriber
133
- sendWebsiteEvent: (e) => {
134
- _(e.eventName, e.eventProps);
135
- },
136
- // Open post or pre purchase maker
137
- sendWebsiteMakerOpenEvent: (e) => {
138
- _(E.WEBSITE_MAKER_OPEN, {
139
- location: e
140
- });
141
- },
142
- // Upsell
143
- sendUpsellOpenEvent: (e) => {
144
- _(E.WEBSITE_MAKER_UPSELL_MODAL, {
145
- ...n.value.upsellOpenEventProps,
146
- continuation: null,
147
- cta_location: e
148
- });
149
- },
150
- sendDomainUpsellOpenEvent: () => {
151
- _(E.WEBSITE_MAKER_DOMAIN_UPSELL_MODAL, {
152
- ...n.value.domainUpsellOpenEventProps,
153
- continuation: null
154
- });
155
- },
156
- sendDomainUpsellContinuationEvent: (e) => {
157
- _(E.WEBSITE_MAKER_DOMAIN_UPSELL_MODAL, {
158
- ...n.value.domainUpsellOpenEventProps,
159
- continuation: e
160
- });
161
- },
162
- sendUpsellContinuationEvent: (e) => {
163
- _(E.WEBSITE_MAKER_UPSELL_MODAL, {
164
- ...n.value.upsellOpenEventProps,
165
- continuation: e
166
- });
167
- },
168
- // Publish
169
- sendPublishOpenEvent: () => {
170
- _(E.WEBSITE_MAKER_PUBLISH_MODAL, {
171
- ...n.value.publishOpenEventProps,
172
- continuation: null
173
- });
174
- },
175
- appendPublishBridgeState: (e) => {
176
- n.value.publishOpenEventProps = {
177
- ...n.value.publishOpenEventProps,
178
- ...e
179
- };
180
- },
181
- sendPublishContinuationEvent: (e, t) => {
182
- _(E.WEBSITE_MAKER_PUBLISH_MODAL, {
183
- ...n.value.publishOpenEventProps,
184
- continuation: e,
185
- domain: t
186
- });
187
- },
188
- // Maker Page Management
189
- sendWebsiteManageAddPageEvent: (e, t) => {
190
- _(E.WEBSITE_MAKER_ADD_PAGE, {
191
- page_name: e,
192
- is_sub_page: !!t
193
- });
194
- },
195
- sendWebsiteManageRemovePageEvent: (e, t) => {
196
- _(E.WEBSITE_MAKER_REMOVE_PAGE, {
197
- page_name: e,
198
- is_sub_page: !!t
199
- });
200
- },
201
- sendWebsiteManageReorderPageEvent: (e) => {
202
- _(E.WEBSITE_MAKER_REORDER_PAGE, {
203
- page_name: e
204
- });
205
- },
206
- sendPublishOptionsForFreeEvent: () => {
207
- _(E.WEBSITE_MAKER_PUBLISH_UPSELL_OPTION_MODAL, {
208
- upsell_option_continuation: T.FREEMIUM
209
- });
210
- },
211
- sendPublishOptionsForPremiumEvent: () => {
212
- _(E.WEBSITE_MAKER_PUBLISH_UPSELL_OPTION_MODAL, {
213
- upsell_option_continuation: T.PREMIUM
214
- });
215
- },
216
- sendPublishOptionsForExitEvent: () => {
217
- _(E.WEBSITE_MAKER_PUBLISH_UPSELL_OPTION_MODAL, {
218
- upsell_option_continuation: T.EXIT
219
- });
220
- },
221
- // Template sidebar events
222
- sendTemplateSearchEvent: (e) => {
223
- _(E.WEBSITE_MAKER_TEMPLATE_SEARCH, {
224
- search_string: e
225
- });
226
- },
227
- sendTemplateSelectEvent: (e) => {
228
- _(E.WEBSITE_MAKER_TEMPLATE_SELECT, {
229
- template_id: e
230
- });
231
- },
232
- sendTemplateCategorySelectEvent: (e) => {
233
- _(E.WEBSITE_MAKER_TEMPLATE_CATEGORY_SELECT, {
234
- category: e
235
- });
236
- },
237
- sendSidebarCategoryClickedEvent: (e) => {
238
- _(E.WEBSITE_SIDEBAR_TAB_CLICKED, {
239
- sidebar_category_tab_name: e
240
- });
241
- },
242
- sendAddContentEvent: (e, t, s, a = S.USER_TRIGGERED) => {
243
- _(E.WEBSITE_MAKER_ADD_CONTENT, {
244
- content_type: e,
245
- trigger_type: a,
246
- select_location: t,
247
- content_category: s
248
- });
249
- },
250
- sendRemoveContentEvent: (e, t, s, a = S.USER_TRIGGERED) => {
251
- _(E.WEBSITE_MAKER_REMOVE_CONTENT, {
252
- content_type: e,
253
- trigger_type: a,
254
- select_location: t,
255
- content_category: s
256
- });
257
- },
258
- sendAddContentContinuationEvent: (e) => {
259
- _(E.WEBSITE_MAKER_ADD_CONTENT, {
260
- continuation: e
261
- });
262
- },
263
- sendUpsellOfferEvent: (e) => {
264
- _(E.WEBSITE_MAKER_UPSELL_OFFER, {
265
- upsellType: e
266
- });
267
- },
268
- sendUpsellOfferActionEvent: (e, t) => {
269
- _(E.WEBSITE_MAKER_UPSELL_ACTION, {
270
- upsellType: e,
271
- action: t
272
- });
273
- },
274
- sendAiSendPromptEvent: (e) => {
275
- _(E.WEBSITE_MAKER_AI_SEND_PROMPT, {
276
- cta_location: e
277
- });
278
- },
279
- sendAiStopGenerationEvent: (e) => {
280
- _(E.WEBSITE_MAKER_AI_STOP_GENERATION, {
281
- cta_location: e
282
- });
283
- },
284
- ...{
285
- sendGettyVideoAddEvent: () => {
286
- _(E.WEBSITE_MAKER_GETTY_VIDEO, {
287
- action: "add"
288
- });
289
- },
290
- sendGettyVideoReplaceEvent: () => {
291
- _(E.WEBSITE_MAKER_GETTY_VIDEO, {
292
- action: "replace"
293
- });
294
- },
295
- sendGettyVideoRemoveEvent: () => {
296
- _(E.WEBSITE_MAKER_GETTY_VIDEO, {
297
- action: "remove"
298
- });
299
- }
300
- },
301
- ...{
302
- sendSaveContactEvent: () => {
303
- _(
304
- E.WEBSITE_SAVE_CONTACT,
305
- {},
306
- !1,
307
- "published_website"
308
- );
309
- },
310
- sendStartForFreeEvent: () => {
311
- _(
312
- E.WEBSITE_START_FOR_FREE,
313
- {},
314
- !1,
315
- "published_website"
316
- );
317
- },
318
- sendFooterLinkClickEvent: (e) => {
319
- _(
320
- E.WEBSITE_FOOTER_LINK_CLICK,
321
- { link_type: e },
322
- !1,
323
- "published_website"
324
- );
325
- }
326
- },
327
- sendShippingToggleEvent: (e) => {
328
- _(E.WEBSITE_MAKER_SHIPPING_TOGGLE, {
329
- is_enabled: e
330
- });
331
- },
332
- // Undo / Redo (BP-5506)
333
- sendUndoEvent: (e) => {
334
- _(E.WEBSITE_MAKER_UNDO, e);
335
- },
336
- sendRedoEvent: (e) => {
337
- _(E.WEBSITE_MAKER_REDO, e);
338
- },
339
- sendHistoryCappedEvent: (e) => {
340
- _(E.WEBSITE_MAKER_HISTORY_CAPPED, e);
341
- },
342
- sendHistoryOversizedEvent: (e) => {
343
- _(E.WEBSITE_MAKER_HISTORY_OVERSIZED, e);
344
- }
345
- });
346
- export {
347
- O as A,
348
- E,
349
- M as G,
350
- d as P,
351
- R as S,
352
- S as T,
353
- p as U,
354
- T as a,
355
- P as u
356
- };
package/src/tracker.ts DELETED
@@ -1,28 +0,0 @@
1
- // Lightweight subpath entry: `@designcrowd/library.brand-page/tracker`.
2
- // Re-exports ONLY the analytics surface (useEventTracker + event constants),
3
- // which depends solely on `vue`. This lets consumers import the tracker without
4
- // pulling the full library graph (maker, TipTap, renderer). See
5
- // docs/plans/multi-entrypoint-tree-shaking.md and the /tracker proposal.
6
- //
7
- // IMPORTANT: useEventTracker holds module-scoped pub/sub state (LISTENERS,
8
- // GLOBAL_EVENT_PROPS). It MUST resolve to a single shared instance across this
9
- // entry and the root `.` entry, or subscribers registered here won't receive
10
- // events published via the root. The multi-entry build hoists it into a shared
11
- // chunk (both `index` and `tracker` import it) — verified at build time.
12
- export {
13
- useEventTracker,
14
- EVENTS,
15
- SELECT_LOCATIONS,
16
- UPGRADE_CTA_LOCATIONS,
17
- AI_CTA_LOCATIONS,
18
- TRIGGER_TYPE,
19
- PUBLISH_MODAL_CONTINUATION_EVENTS,
20
- GENERATE_TEXT_CONTINUATION_EVENTS,
21
- PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS,
22
- } from './brand-page-maker/composables/useEventTracker';
23
- export type {
24
- EventTracker,
25
- BpEventTrackerEvent,
26
- BpGlobalEventProps,
27
- BpUpsellEventProps,
28
- } from './brand-page-maker/composables/useEventTracker';