@designcrowd/library.brand-page 6.0.6-json-prereq-7 → 6.0.6-tracker-1

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 (99) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-SPVLPi8n.js → CreatedOnBrandCrowd-de-de-DD0OBnij.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-CvtrCPHd.js → CreatedOnBrandCrowd-en-us-DysrpsmM.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BSsac7jB.js → CreatedOnBrandCrowd-es-es-B6twGr9h.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-BauENV2a.js → CreatedOnBrandCrowd-fr-ca-yxl0ih_4.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-BauENV2a.js → CreatedOnBrandCrowd-fr-fr-yxl0ih_4.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-Be0hawmr.js → CreatedOnBrandCrowd-pt-br-BtXDrIcx.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-Be0hawmr.js → CreatedOnBrandCrowd-pt-pt-BtXDrIcx.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CTjE2Tmn.js → CreatedOnDcom-de-de-ho_ROy1L.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-DnZRp5Pg.js → CreatedOnDcom-en-us-C91p9kls.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-J-9qvjy8.js → CreatedOnDcom-es-es-B3FYmObE.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BDNHqm4G.js → CreatedOnDcom-fr-ca-D40m7fPx.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-B_2-ceuO.js → CreatedOnDcom-fr-fr-Cd57oYyc.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-76lJVrAY.js → CreatedOnDcom-pt-br-Du57mWxG.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-TQp3CNcu.js → CreatedOnDcom-pt-pt-fYoPZWwr.js} +1 -1
  15. package/lib/src/brand-page/models/index.d.ts +26 -34
  16. package/lib/src/brand-page/utils/migration.util.js +0 -11
  17. package/lib/src/brand-page/utils/text.util.d.ts +1 -1
  18. package/lib/src/brand-page/utils/text.util.js +0 -32
  19. package/lib/src/brand-page/utils/vcard.util.js +4 -4
  20. package/lib/src/brand-page/utils/view-model.util.d.ts +0 -1
  21. package/lib/src/brand-page/utils/view-model.util.js +20 -68
  22. package/lib/src/brand-page/view-models.d.ts +3 -3
  23. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +99 -20
  24. package/lib/src/brand-page-maker/utils/index.d.ts +0 -2
  25. package/lib/src/brand-page-maker/utils/index.js +0 -2
  26. package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +5 -19
  27. package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +5 -35
  28. package/lib/src/brand-page-maker/validators/field.validator.js +2 -10
  29. package/lib/src/css/library.brand-page-brandCrowd.min.css +1 -1
  30. package/lib/src/css/library.brand-page-brandPage.min.css +1 -1
  31. package/lib/src/css/library.brand-page-designCom.min.css +1 -1
  32. package/lib/src/css/library.brand-page-preview.min.css +1 -1
  33. package/lib/src/index.d.ts +0 -1
  34. package/lib/src/index.mjs +137 -141
  35. package/lib/src/{lib-Bh9Y5_-x.js → lib-lMNy66QO.js} +43580 -44184
  36. package/lib/src/lib.js +0 -2
  37. package/lib/src/metadata-builder/builders/update-content-text-builder.js +15 -20
  38. package/lib/src/metadata-builder/builders/update-content-text-style-builder.js +3 -5
  39. package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +1 -1
  40. package/lib/src/metadata-builder/helpers/rte.helpers.js +3 -6
  41. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.js +1 -14
  42. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +3 -12
  43. package/lib/src/tracker.d.ts +2 -0
  44. package/lib/src/tracker.js +12 -0
  45. package/lib/src/tracker.mjs +12 -0
  46. package/lib/src/useEventTracker-DmQ6AkNn.js +356 -0
  47. package/lib/src/utils/minify-brand-page-metadata.js +1 -4
  48. package/package.json +16 -1
  49. package/src/brand-page/components/text-wrapper/TextWrapper.vue +6 -17
  50. package/src/brand-page/models/index.ts +26 -35
  51. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
  52. package/src/brand-page/utils/migration.util.ts +0 -12
  53. package/src/brand-page/utils/style.util.test.ts +0 -51
  54. package/src/brand-page/utils/text.util.ts +4 -43
  55. package/src/brand-page/utils/vcard.util.ts +4 -6
  56. package/src/brand-page/utils/view-model.util.ts +26 -94
  57. package/src/brand-page/view-models.ts +2 -3
  58. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +106 -22
  59. package/src/brand-page-maker/utils/index.ts +0 -2
  60. package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +3 -4
  61. package/src/brand-page-maker/utils/rich-text-editor.util.ts +11 -50
  62. package/src/brand-page-maker/validators/field.validator.ts +2 -10
  63. package/src/lib.ts +0 -9
  64. package/src/metadata-builder/builders/update-content-text-builder.ts +18 -32
  65. package/src/metadata-builder/builders/update-content-text-style-builder.ts +4 -6
  66. package/src/metadata-builder/helpers/rte.helpers.ts +7 -11
  67. package/src/shared/content-settings/components/GenericTextInput.mixin.ts +1 -17
  68. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +3 -16
  69. package/src/tracker.ts +28 -0
  70. package/src/utils/minify-brand-page-metadata.ts +1 -4
  71. package/lib/src/brand-page/utils/migration/migration-18.d.ts +0 -2
  72. package/lib/src/brand-page/utils/migration/migration-18.js +0 -71
  73. package/lib/src/brand-page-maker/__fixtures__/complex-rte.fixture.d.ts +0 -22
  74. package/lib/src/brand-page-maker/__fixtures__/complex-rte.fixture.js +0 -22
  75. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.d.ts +0 -14
  76. package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.js +0 -39
  77. package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
  78. package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.js +0 -66
  79. package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -33
  80. package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -50
  81. package/lib/src/brand-page-maker/utils/rte-sanitize.util.d.ts +0 -6
  82. package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +0 -158
  83. package/lib/src/brand-page-maker/utils/rte-serializer.d.ts +0 -5
  84. package/lib/src/brand-page-maker/utils/rte-serializer.js +0 -112
  85. package/src/brand-page/utils/migration/migration-18.test.ts +0 -72
  86. package/src/brand-page/utils/migration/migration-18.ts +0 -83
  87. package/src/brand-page/utils/text.util.test.ts +0 -47
  88. package/src/brand-page/utils/view-model.pageid-rte.test.ts +0 -104
  89. package/src/brand-page-maker/__fixtures__/complex-rte.fixture.ts +0 -23
  90. package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +0 -52
  91. package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.ts +0 -42
  92. package/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.ts +0 -113
  93. package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +0 -200
  94. package/src/brand-page-maker/utils/rte-render-parity.test.ts +0 -156
  95. package/src/brand-page-maker/utils/rte-render.util.ts +0 -77
  96. package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +0 -158
  97. package/src/brand-page-maker/utils/rte-sanitize.util.ts +0 -195
  98. package/src/brand-page-maker/utils/rte-serializer.ts +0 -172
  99. package/src/brand-page-maker/validators/field.validator.test.ts +0 -55
package/lib/src/lib.js CHANGED
@@ -30,8 +30,6 @@ export { minifyBrandPageMetadata, } from './utils/minify-brand-page-metadata';
30
30
  export * as brandPageUtils from './brand-page/utils';
31
31
  export { getOptimalLogoSize, calculateOptimizedLogoDimensions, applyLogoImageBase64UrlToBrandPageTemplateModel, recalculateLogoContentDimensions, recalculateHeaderLogoSizes, } from './brand-page/utils/logo.util';
32
32
  export { sanitizeRTEHtml } from './brand-page-maker/utils';
33
- // BP-5787: RTE JSON storage boundary helpers (render/normalise/sanitise/extract).
34
- export { renderRteToHtml, toRteJson, isTiptapDocument, sanitizeRteJson, getRteJsonPlainText, } from './brand-page-maker/utils';
35
33
  export { getPageSlugFromPageTitle } from './brand-page-maker/utils/slug.util';
36
34
  // AI-pipeline preview (longclaw per-turn snapshots): web-renderer's
37
35
  // /preview/ai-pipeline render page + manifest server route apply the agent's
@@ -1,23 +1,6 @@
1
1
  import {} from '../../brand-page/models';
2
2
  import { BaseMetadataBuilder, BUILDER_TYPES, } from '../models';
3
- import { hasRTEContent, replaceTextInRTE, isTiptapDocument, renderRteToHtml, toRteJson, } from '../../brand-page-maker/utils';
4
- /**
5
- * BP-5787 — replace the text of an RTE field while preserving formatting, for
6
- * either storage form. JSON is rendered to HTML, edited via the existing
7
- * HTML-preserving replace, then converted back to JSON; plain/legacy strings
8
- * keep the original behaviour.
9
- */
10
- const updateRteFieldValue = (existing, newText) => {
11
- const wasJson = isTiptapDocument(existing);
12
- const existingHtml = wasJson ? renderRteToHtml(existing) : existing;
13
- if (existingHtml &&
14
- typeof existingHtml === 'string' &&
15
- hasRTEContent(existingHtml)) {
16
- const updatedHtml = replaceTextInRTE(existingHtml, newText);
17
- return wasJson ? toRteJson(updatedHtml) : updatedHtml;
18
- }
19
- return newText;
20
- };
3
+ import { hasRTEContent, replaceTextInRTE } from '../../brand-page-maker/utils';
21
4
  export const buildUpdateTextRequest = (id, payload) => {
22
5
  return {
23
6
  id,
@@ -33,7 +16,11 @@ const updateTextField = (target, fieldName, newText) => {
33
16
  const array = target[arrayName];
34
17
  if (Array.isArray(array) && array[+index]) {
35
18
  const existingText = array[+index][property];
36
- const updatedValue = updateRteFieldValue(existingText, newText);
19
+ const updatedValue = existingText &&
20
+ typeof existingText === 'string' &&
21
+ hasRTEContent(existingText)
22
+ ? replaceTextInRTE(existingText, newText)
23
+ : newText;
37
24
  // Create a new array with the updated item to trigger reactivity
38
25
  const newArray = [...array];
39
26
  newArray[+index] = {
@@ -45,7 +32,15 @@ const updateTextField = (target, fieldName, newText) => {
45
32
  }
46
33
  else {
47
34
  // Simple field
48
- target[fieldName] = updateRteFieldValue(target[fieldName], newText);
35
+ const existingText = target[fieldName];
36
+ if (existingText &&
37
+ typeof existingText === 'string' &&
38
+ hasRTEContent(existingText)) {
39
+ target[fieldName] = replaceTextInRTE(existingText, newText);
40
+ }
41
+ else {
42
+ target[fieldName] = newText;
43
+ }
49
44
  }
50
45
  };
51
46
  export class UpdateContentTextBuilder extends BaseMetadataBuilder {
@@ -35,16 +35,14 @@ const mergeStyles = (currentStyle, stylesToUpdate, textStyleOptions) => {
35
35
  });
36
36
  return merged;
37
37
  };
38
- // BP-5787 — apply a style to RTE text natively. applyStyleToRTEText runs Tiptap
39
- // commands on the doc (string or JSON in) and returns JSON — no HTML round-trip.
40
38
  const updateRTEText = (text, style) => {
41
- if (!hasRTEContent(text)) {
39
+ if (!text || typeof text !== 'string' || !hasRTEContent(text)) {
42
40
  return text;
43
41
  }
44
42
  const { externalEditor } = useExternalRichTextEditor();
45
- const updated = applyStyleToRTEText(externalEditor, text, style);
43
+ const updatedText = applyStyleToRTEText(externalEditor, text, style);
46
44
  externalEditor.destroy();
47
- return updated;
45
+ return updatedText;
48
46
  };
49
47
  const findStyleKey = (target, property) => {
50
48
  // Try exact match first (e.g., 'testimonialsStyle')
@@ -1,6 +1,6 @@
1
1
  import type { TextStyleDeclaration } from '../../brand-page';
2
2
  import type { Editor } from '@tiptap/vue-3';
3
- export declare const applyStyleToRTEText: (externalEditor: Editor, contentText: unknown, newContentStyle: TextStyleDeclaration) => unknown;
3
+ export declare const applyStyleToRTEText: (externalEditor: Editor, contentText: string, newContentStyle: TextStyleDeclaration) => string;
4
4
  /**
5
5
  * Converts a Tiptap JSON document (ProseMirror document model) to an HTML
6
6
  * string using a headless Tiptap Editor instance.
@@ -7,11 +7,7 @@ export const applyStyleToRTEText = (externalEditor, contentText, newContentStyle
7
7
  if (!contentText) {
8
8
  return contentText;
9
9
  }
10
- // BP-5787: operate natively on the Tiptap doc. setContent accepts a JSON
11
- // document or an HTML string; the style is applied via editor commands and
12
- // the result is returned as JSON — no HTML round-trip.
13
- const content = typeof contentText === 'string' &&
14
- contentText.includes(ESCAPED_NEWLINE_CHARACTER)
10
+ const content = contentText.includes(ESCAPED_NEWLINE_CHARACTER)
15
11
  ? getRenderText(contentText)
16
12
  : contentText;
17
13
  externalEditor.commands.setContent(content);
@@ -57,7 +53,8 @@ export const applyStyleToRTEText = (externalEditor, contentText, newContentStyle
57
53
  ? chain.setItalic()
58
54
  : chain.unsetItalic();
59
55
  chain.run();
60
- return externalEditor.getJSON();
56
+ const html = externalEditor.getHTML();
57
+ return html;
61
58
  };
62
59
  /**
63
60
  * Converts a Tiptap JSON document (ProseMirror document model) to an HTML
@@ -144,20 +144,7 @@ export default defineComponent({
144
144
  },
145
145
  },
146
146
  watch: {
147
- value(newVal, oldVal) {
148
- // BP-5787: RTE values are Tiptap JSON objects. The parent (TextItemsField)
149
- // re-clones its items array (cloneDeep) on ANY change — including a sibling
150
- // field's style sync — yielding a NEW object reference with identical text
151
- // content. For objects Vue fires this watcher on reference change, so that
152
- // spurious re-clone would overwrite `_value` and clobber an in-flight edit
153
- // (a mark applied but not yet debounced to the store), silently dropping
154
- // the user's formatting. Strings never hit this (same content = same
155
- // reference = no fire), so mirror that: ignore re-clones whose content is
156
- // unchanged from the previous prop value.
157
- if (this.showRichTextEditor &&
158
- JSON.stringify(newVal) === JSON.stringify(oldVal)) {
159
- return;
160
- }
147
+ value(newVal) {
161
148
  this._value = newVal;
162
149
  if (this.showRichTextEditor) {
163
150
  const textValue = escapeContentText(this._value);
@@ -8,7 +8,7 @@ import { SIDE_BAR_TAB_NAMES } from '@brand-page-maker/constants';
8
8
  import { ITEM_FIELD_TYPES } from '@brand-page-maker/models';
9
9
  import { useUiPageSettingsStore } from '../../../page-settings/store';
10
10
  import { PAGE_SECTIONS } from '../../../page-settings/models';
11
- import { getPlainTextFromRTE, replaceTextInRTE, RTE_ALLOWED_SECTION_TYPES, isRTEManagedStyleField, isTiptapDocument, renderRteToHtml, toRteJson, } from '@brand-page-maker/utils';
11
+ import { getPlainTextFromRTE, replaceTextInRTE, RTE_ALLOWED_SECTION_TYPES, isRTEManagedStyleField, } from '@brand-page-maker/utils';
12
12
  import { isDefaultContentText } from '@shared/content-settings/utils';
13
13
  import { useUiLogoSettingsStore } from '../../../logo-settings/store';
14
14
  const RTE_DISALLOWED_FIELD_NAMES = ['buttonText'];
@@ -262,17 +262,8 @@ export default defineComponent({
262
262
  },
263
263
  onUseGeneratedText(generatedText) {
264
264
  let formattedText = generatedText;
265
- // BP-5787: preserve the field's formatting when dropping in AI text.
266
- // replaceTextInRTE is HTML-based, so JSON is rendered/parsed around it
267
- // (cold AI path, shared editor); string fields use it directly.
268
- if (this.showRichTextEditor) {
269
- if (isTiptapDocument(this.value)) {
270
- formattedText =
271
- toRteJson(replaceTextInRTE(renderRteToHtml(this.value), generatedText)) ?? generatedText;
272
- }
273
- else if (typeof this.value === 'string') {
274
- formattedText = replaceTextInRTE(this.value, generatedText);
275
- }
265
+ if (this.showRichTextEditor && typeof this.value === 'string') {
266
+ formattedText = replaceTextInRTE(this.value, generatedText);
276
267
  }
277
268
  this.contentSettingsStore.updateItemValue({
278
269
  id: this.id,
@@ -0,0 +1,2 @@
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';
@@ -0,0 +1,12 @@
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';
@@ -0,0 +1,12 @@
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
+ };
@@ -0,0 +1,356 @@
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
+ };
@@ -1,5 +1,5 @@
1
1
  import { BRAND_PAGE_TYPES, } from '../brand-page/models';
2
- import { hasRTEContent, isTiptapDocument } from '../brand-page-maker/utils';
2
+ import { hasRTEContent } from '../brand-page-maker/utils';
3
3
  import { useExternalRichTextEditor } from '../brand-page-maker/composables/rich-text-editor/useRichTextEditor';
4
4
  import { findAssetKey, resolveLogoData, } from './build-asset-manifest';
5
5
  const BUTTON_TYPES = [
@@ -17,9 +17,6 @@ const BUTTON_TYPES = [
17
17
  'tiktok',
18
18
  ];
19
19
  const convertText = (value, editor) => {
20
- // Already Tiptap JSON (BP-5787 storage) — keep as-is.
21
- if (isTiptapDocument(value))
22
- return value;
23
20
  if (typeof value !== 'string' || !value)
24
21
  return undefined;
25
22
  if (hasRTEContent(value)) {
package/package.json CHANGED
@@ -1,12 +1,27 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "6.0.6-json-prereq-7",
4
+ "version": "6.0.6-tracker-1",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
8
8
  "types": "./lib/src/index.d.ts",
9
9
  "main": "./lib/src/index.mjs",
10
+ "sideEffects": [
11
+ "**/*.css"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./lib/src/index.d.ts",
16
+ "import": "./lib/src/index.mjs"
17
+ },
18
+ "./tracker": {
19
+ "types": "./lib/src/tracker.d.ts",
20
+ "import": "./lib/src/tracker.mjs"
21
+ },
22
+ "./lib/src/css/*": "./lib/src/css/*",
23
+ "./package.json": "./package.json"
24
+ },
10
25
  "files": [
11
26
  "lib",
12
27
  "src"
@@ -16,13 +16,7 @@
16
16
  </div>
17
17
  </template>
18
18
  <script setup lang="ts">
19
- import {
20
- hasRTEContent,
21
- getPlainTextFromRTE,
22
- renderRteToHtml,
23
- isTiptapDocument,
24
- type RichTextValue,
25
- } from '@brand-page-maker/utils';
19
+ import { hasRTEContent, getPlainTextFromRTE } from '@brand-page-maker/utils';
26
20
  import {
27
21
  type FluidTextData,
28
22
  type TextStyleDeclaration,
@@ -38,8 +32,7 @@ import {
38
32
 
39
33
  interface Props {
40
34
  textStyle: TextStyleDeclaration | undefined;
41
- // BP-5787: an RTE field is a legacy inline-HTML string or a Tiptap JSON doc.
42
- text: RichTextValue;
35
+ text: string;
43
36
  element?: string;
44
37
  slug?: string;
45
38
  }
@@ -81,20 +74,16 @@ const textStyleRTE = computed(() => {
81
74
  };
82
75
  });
83
76
 
84
- // Render either form (legacy HTML string or Tiptap JSON) to final HTML.
85
- // For a string this returns it unchanged, so the legacy path is unaffected.
86
- const renderedHtml = computed(() => renderRteToHtml(props.text));
87
-
88
77
  const isRTEContent = computed(() => {
89
- return isTiptapDocument(props.text) || hasRTEContent(renderedHtml.value);
78
+ return hasRTEContent(props.text);
90
79
  });
91
80
 
92
81
  const sanitizeText = computed(() => {
93
- if (isRTEContent.value && !getPlainTextFromRTE(renderedHtml.value)) {
82
+ if (isRTEContent.value && !getPlainTextFromRTE(props.text)) {
94
83
  return '';
95
84
  }
96
85
 
97
- return renderedHtml.value;
86
+ return props.text;
98
87
  });
99
88
 
100
89
  const fontSize = computed<any>(() => props.textStyle.fontSize);
@@ -166,7 +155,7 @@ const applyScale = () => {
166
155
  }
167
156
 
168
157
  const fontSizeMatchInRTEText = [
169
- ...renderedHtml.value.matchAll(
158
+ ...props.text.matchAll(
170
159
  /style="(?:[^"]*?)\bfont-size\s*:\s*(?<fontSize>[^;"']+)[^"]*?"/gm,
171
160
  ),
172
161
  ].map((x) => parseFloat(x.groups?.fontSize || '1em'));