@designcrowd/library.brand-page 5.16.3 → 5.16.4-ast-mp

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 (132) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BVouwZJN.js → CreatedOnBrandCrowd-de-de-Cjd2U2Uw.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-Dtx-1uWO.js → CreatedOnBrandCrowd-en-us-DSf7zRvI.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CmlnW8oC.js → CreatedOnBrandCrowd-es-es-tVy-tprQ.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-C95ioWzr.js → CreatedOnBrandCrowd-fr-ca-CTMLZtq_.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-C95ioWzr.js → CreatedOnBrandCrowd-fr-fr-CTMLZtq_.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-C_5SiaiE.js → CreatedOnBrandCrowd-pt-br-hEZJYcL5.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-C_5SiaiE.js → CreatedOnBrandCrowd-pt-pt-hEZJYcL5.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-BP4saQXn.js → CreatedOnDcom-de-de-C3hEpKmL.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-B8Taru6f.js → CreatedOnDcom-en-us-DHVV4p1R.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-Bo3JhWwd.js → CreatedOnDcom-es-es-BRKaAPji.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-CDk3ZAHU.js → CreatedOnDcom-fr-ca-CvgGaH2s.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-CD04W_hw.js → CreatedOnDcom-fr-fr-Bw0zC8_o.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-B2DGv1qj.js → CreatedOnDcom-pt-br-BrCIqA45.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-TYqvgQ08.js → CreatedOnDcom-pt-pt-CV3hPJxr.js} +1 -1
  15. package/lib/src/brand-page/models/brand-page-context.model.d.ts +1 -0
  16. package/lib/src/brand-page/models/brand-page-context.model.js +5 -0
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +13 -0
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +30 -1
  19. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -0
  20. package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +17 -0
  21. package/lib/src/brand-page-maker/composables/useEventTracker.js +21 -0
  22. package/lib/src/brand-page-maker/stores/index.d.ts +1 -0
  23. package/lib/src/brand-page-maker/stores/index.js +1 -0
  24. package/lib/src/brand-page-maker/stores/snapshot/snapshot-store.d.ts +14 -0
  25. package/lib/src/brand-page-maker/stores/snapshot/snapshot-store.js +21 -0
  26. package/lib/src/brand-page-maker/utils/mixpanel.util.d.ts +1 -0
  27. package/lib/src/brand-page-maker/utils/mixpanel.util.js +29 -0
  28. package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +2 -0
  29. package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +117 -0
  30. package/lib/src/bundled-translations-Dw3XtNmX.js +163 -0
  31. package/lib/src/bundled-translations.de-DE-B82Ik9M7.js +163 -0
  32. package/lib/src/bundled-translations.es-ES-cf3pdNuN.js +163 -0
  33. package/lib/src/bundled-translations.fr-CA-DP44EcAZ.js +163 -0
  34. package/lib/src/bundled-translations.fr-FR-V0Zt25kg.js +163 -0
  35. package/lib/src/bundled-translations.pt-BR-Brv6rCss.js +163 -0
  36. package/lib/src/bundled-translations.pt-PT-BTgscCTG.js +163 -0
  37. package/lib/src/bundles/bundled-translations.de-DE.json +15 -1
  38. package/lib/src/bundles/bundled-translations.es-ES.json +15 -1
  39. package/lib/src/bundles/bundled-translations.fr-CA.json +15 -1
  40. package/lib/src/bundles/bundled-translations.fr-FR.json +15 -1
  41. package/lib/src/bundles/bundled-translations.json +15 -1
  42. package/lib/src/bundles/bundled-translations.pt-BR.json +15 -1
  43. package/lib/src/bundles/bundled-translations.pt-PT.json +15 -1
  44. package/lib/src/clients/design-template-client.d.ts +2 -0
  45. package/lib/src/clients/design-template-client.js +33 -0
  46. package/lib/src/composables/useSnapshot.d.ts +5 -0
  47. package/lib/src/composables/useSnapshot.js +74 -0
  48. package/lib/src/composables/useTranslate.d.ts +2 -1
  49. package/lib/src/composables/useTranslate.js +2 -1
  50. package/lib/src/css/library.brand-page-brandCrowd.min.css +149 -8
  51. package/lib/src/css/library.brand-page-brandPage.min.css +136 -8
  52. package/lib/src/css/library.brand-page-designCom.min.css +149 -8
  53. package/lib/src/css/library.brand-page-preview.min.css +133 -8
  54. package/lib/src/index.mjs +1 -1
  55. package/lib/src/{lib-3sE17Ltm.js → lib-JpOB9SNs.js} +20106 -19276
  56. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -0
  57. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +3 -0
  58. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +3 -0
  59. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.js +6 -0
  60. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +9 -0
  61. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +48 -1
  62. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +1 -0
  63. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +3 -0
  64. package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +3 -1
  65. package/lib/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.mixin.d.ts +22 -3
  66. package/lib/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.mixin.js +41 -2
  67. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.d.ts +21 -2
  68. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +43 -2
  69. package/lib/src/shared/content-settings/utils.d.ts +1 -0
  70. package/lib/src/shared/content-settings/utils.js +6 -0
  71. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +1 -0
  72. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -0
  73. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -0
  74. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
  75. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -0
  76. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +1 -0
  77. package/package.json +2 -2
  78. package/src/brand-page/models/brand-page-context.model.ts +13 -0
  79. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +31 -0
  80. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +2 -1
  81. package/src/brand-page-maker/composables/useEventTracker.ts +23 -0
  82. package/src/brand-page-maker/stores/index.ts +1 -0
  83. package/src/brand-page-maker/stores/snapshot/snapshot-store.ts +31 -0
  84. package/src/brand-page-maker/utils/mixpanel.util.ts +42 -0
  85. package/src/brand-page-maker/utils/rich-text-editor.util.ts +154 -0
  86. package/src/bundles/bundled-translations.de-DE.json +15 -1
  87. package/src/bundles/bundled-translations.es-ES.json +15 -1
  88. package/src/bundles/bundled-translations.fr-CA.json +15 -1
  89. package/src/bundles/bundled-translations.fr-FR.json +15 -1
  90. package/src/bundles/bundled-translations.json +15 -1
  91. package/src/bundles/bundled-translations.pt-BR.json +15 -1
  92. package/src/bundles/bundled-translations.pt-PT.json +15 -1
  93. package/src/clients/design-template-client.ts +57 -0
  94. package/src/composables/useSnapshot.ts +97 -0
  95. package/src/composables/useTranslate.ts +3 -0
  96. package/src/shared/common/i18n/common.de-DE.json +5 -1
  97. package/src/shared/common/i18n/common.es-ES.json +5 -1
  98. package/src/shared/common/i18n/common.fr-CA.json +5 -1
  99. package/src/shared/common/i18n/common.fr-FR.json +5 -1
  100. package/src/shared/common/i18n/common.json +5 -1
  101. package/src/shared/common/i18n/common.pt-BR.json +5 -1
  102. package/src/shared/common/i18n/common.pt-PT.json +5 -1
  103. package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +3 -0
  104. package/src/shared/content-settings/components/content-settings/ContentSettings.vue +2 -0
  105. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.ts +8 -0
  106. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.vue +1 -0
  107. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +58 -0
  108. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +20 -2
  109. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +3 -1
  110. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.vue +1 -0
  111. package/src/shared/content-settings/components/generate-ai-button/GenerateAiButton.vue +105 -0
  112. package/src/shared/content-settings/components/generate-ai-modal/GenerateAiModal.vue +522 -0
  113. package/src/shared/content-settings/components/generate-ai-modal/i18n/generate-ai.de-DE.json +12 -0
  114. package/src/shared/content-settings/components/generate-ai-modal/i18n/generate-ai.es-ES.json +12 -0
  115. package/src/shared/content-settings/components/generate-ai-modal/i18n/generate-ai.fr-CA.json +12 -0
  116. package/src/shared/content-settings/components/generate-ai-modal/i18n/generate-ai.fr-FR.json +12 -0
  117. package/src/shared/content-settings/components/generate-ai-modal/i18n/generate-ai.json +12 -0
  118. package/src/shared/content-settings/components/generate-ai-modal/i18n/generate-ai.pt-BR.json +12 -0
  119. package/src/shared/content-settings/components/generate-ai-modal/i18n/generate-ai.pt-PT.json +12 -0
  120. package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +4 -1
  121. package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.mixin.ts +46 -2
  122. package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +15 -3
  123. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +54 -2
  124. package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +16 -3
  125. package/src/shared/content-settings/utils.ts +9 -0
  126. package/lib/src/bundled-translations-D9iHE5G9.js +0 -161
  127. package/lib/src/bundled-translations.de-DE-DW3iDx_G.js +0 -161
  128. package/lib/src/bundled-translations.es-ES-C9I8wDyq.js +0 -161
  129. package/lib/src/bundled-translations.fr-CA-C0NN8DsO.js +0 -161
  130. package/lib/src/bundled-translations.fr-FR-oKV5NyE1.js +0 -161
  131. package/lib/src/bundled-translations.pt-BR-CTvCfv1X.js +0 -161
  132. package/lib/src/bundled-translations.pt-PT-CbwxwRY1.js +0 -161
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-3sE17Ltm.js";
2
+ import { _ as t } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-3sE17Ltm.js";
2
+ import { _ as t } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-3sE17Ltm.js";
2
+ import { _ as t } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-3sE17Ltm.js";
2
+ import { _ as t } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-3sE17Ltm.js";
2
+ import { _ as t } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-3sE17Ltm.js";
2
+ import { _ as t } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-3sE17Ltm.js";
2
+ import { _ as t } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-3sE17Ltm.js";
2
+ import { _ as e } from "./lib-JpOB9SNs.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-3sE17Ltm.js";
2
+ import { _ as e } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-3sE17Ltm.js";
2
+ import { _ as e } from "./lib-JpOB9SNs.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-3sE17Ltm.js";
2
+ import { _ as e } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-3sE17Ltm.js";
2
+ import { _ as e } from "./lib-JpOB9SNs.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-3sE17Ltm.js";
2
+ import { _ as M } from "./lib-JpOB9SNs.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-3sE17Ltm.js";
2
+ import { _ as M } from "./lib-JpOB9SNs.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -37,6 +37,7 @@ export interface AbTestResult {
37
37
  export interface AbTest {
38
38
  bp_3926_freemium_watermark?: AbTestResult;
39
39
  bp_4092_rotating_upsells_at_publish?: AbTestResult;
40
+ bp_4572_ai_text_generation_post_purchase?: AbTestResult;
40
41
  }
41
42
  export declare const MEDIA_SIZES: {
42
43
  readonly size1x: "size1x";
@@ -25,6 +25,7 @@ export const AB_TEST_FLAG = {
25
25
  const AB_TEST_KEYS = {
26
26
  BP_3926_FREEMIUM_WATERMARK: 'bc-bp-3926-freemium-cta-in-website-editor',
27
27
  BP_4092_ROTATING_UPSELLS_AT_PUBLISH: 'bc-bp-4092-rotating-upsells-at-website-publish',
28
+ BP_4572_AI_TEXT_GENERATION_POST_PURCHASE: 'bc-bp-4572-ai-text-generation-post-purchase',
28
29
  };
29
30
  export const MEDIA_SIZES = {
30
31
  size1x: 'size1x',
@@ -46,5 +47,9 @@ export const getAbTestResults = (abtestKeyValues) => {
46
47
  if (abtestKeyValues[AB_TEST_KEYS.BP_3926_FREEMIUM_WATERMARK]) {
47
48
  abTests.bp_3926_freemium_watermark = getValueType(AB_TEST_KEYS.BP_3926_FREEMIUM_WATERMARK, abtestKeyValues[AB_TEST_KEYS.BP_3926_FREEMIUM_WATERMARK]);
48
49
  }
50
+ // AB Test for BP-4572 - AI Text Generation Post Purchase
51
+ if (abtestKeyValues[AB_TEST_KEYS.BP_4572_AI_TEXT_GENERATION_POST_PURCHASE]) {
52
+ abTests.bp_4572_ai_text_generation_post_purchase = getValueType(AB_TEST_KEYS.BP_4572_AI_TEXT_GENERATION_POST_PURCHASE, abtestKeyValues[AB_TEST_KEYS.BP_4572_AI_TEXT_GENERATION_POST_PURCHASE]);
53
+ }
49
54
  return abTests;
50
55
  };
@@ -1146,6 +1146,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1146
1146
  getProductModel(): import("../../../brand-page/models/shop.model").ProductModel;
1147
1147
  }>;
1148
1148
  router: import("vue-router").Router;
1149
+ snapshotStore: import("pinia").Store<"snapshot", import("../../stores").SnapshotState, {
1150
+ hasSnapshot: (state: {
1151
+ snapshotBase64: string | null;
1152
+ isCapturing: boolean;
1153
+ } & import("pinia").PiniaCustomStateProperties<import("../../stores").SnapshotState>) => boolean;
1154
+ }, {
1155
+ setBase64Snapshot(base64: string | null): void;
1156
+ setIsCapturing(isCapturing: boolean): void;
1157
+ clearSnapshot(): void;
1158
+ }>;
1159
+ captureSnapshot: (element: HTMLElement | null) => Promise<string | null>;
1149
1160
  videoStore: import("pinia").Store<"video", import("../../stores").videoStoreState, {
1150
1161
  getVideoUrlsForToken: (state: {
1151
1162
  videoUrls: {
@@ -1186,8 +1197,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1186
1197
  showSaveSuccessMessage: boolean;
1187
1198
  }, {
1188
1199
  previewContainer(): any;
1200
+ previewContent(): any;
1189
1201
  }, {
1190
1202
  getBrandPageFromFallback(viewModel: any): BrandPageData;
1203
+ handleCaptureSnapshot(): Promise<void>;
1191
1204
  onResizeWithDebounce(): void;
1192
1205
  onResize(): void;
1193
1206
  setUiScreenSizeModeBasedOnDeviceWidth(): void;
@@ -10,7 +10,7 @@ import { createInitialBrandPage } from '../../models';
10
10
  import { navigateToPageBySlug } from '../../routing';
11
11
  import { useBrandPageContainerStore } from '../../stores';
12
12
  import { UI_DEVICE_MODES, UI_SCREENSIZE_MODES, } from '../../../shared/models';
13
- import { useBrandPageMakerStore, useBrandPageMakerUserStore, useLocalisedRouteStore, useUiStore, useVideoStore, } from '../../stores';
13
+ import { useBrandPageMakerStore, useBrandPageMakerUserStore, useLocalisedRouteStore, useUiStore, useSnapshotStore, useVideoStore, } from '../../stores';
14
14
  import { useUiContentSettingsStore } from '../../../shared/content-settings/store';
15
15
  import { useUiTemplateSettingsStore } from '../../../shared/template-settings/store';
16
16
  import { useUiPageSettingsStore } from '../../../shared/page-settings/store';
@@ -21,6 +21,7 @@ import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/sho
21
21
  import { useProductConfigStore } from '../../../brand-page-maker/stores/product-config/product-config-store';
22
22
  import { UPGRADE_CTA_LOCATIONS } from '../../composables/useEventTracker';
23
23
  import { commonTr } from '../../../composables/useTranslate';
24
+ import { useSnapshot } from '../../../composables/useSnapshot';
24
25
  const RESIZE_DEBOUNCE_WAIT_IN_MS = 100;
25
26
  export default defineComponent({
26
27
  props: {
@@ -42,6 +43,8 @@ export default defineComponent({
42
43
  const productSettingStore = useProductConfigStore();
43
44
  const router = useRouter();
44
45
  const localisedRouteStore = useLocalisedRouteStore();
46
+ const snapshotStore = useSnapshotStore();
47
+ const { captureSnapshot } = useSnapshot();
45
48
  const videoStore = useVideoStore();
46
49
  return {
47
50
  commonTr,
@@ -84,6 +87,8 @@ export default defineComponent({
84
87
  shopSettingStore,
85
88
  productSettingStore,
86
89
  router,
90
+ snapshotStore,
91
+ captureSnapshot,
87
92
  videoStore,
88
93
  };
89
94
  },
@@ -99,6 +104,9 @@ export default defineComponent({
99
104
  previewContainer() {
100
105
  return this.$refs.previewContainer;
101
106
  },
107
+ previewContent() {
108
+ return this.$refs.previewContent;
109
+ },
102
110
  },
103
111
  async created() {
104
112
  if (!this.viewModel?.logoDraftDesignAttributes?.logoTheme ||
@@ -213,6 +221,27 @@ export default defineComponent({
213
221
  return createInitialBrandPage(viewModel.brandPageType);
214
222
  }
215
223
  },
224
+ async handleCaptureSnapshot() {
225
+ if (!this.previewContent) {
226
+ return;
227
+ }
228
+ this.snapshotStore.setIsCapturing(true);
229
+ try {
230
+ const snapshot = await this.captureSnapshot(this.previewContent);
231
+ if (snapshot) {
232
+ this.snapshotStore.setBase64Snapshot(snapshot);
233
+ }
234
+ else {
235
+ console.warn('⚠️ Snapshot capture returned null');
236
+ }
237
+ }
238
+ catch (error) {
239
+ console.error('❌ Failed to capture snapshot:', error);
240
+ }
241
+ finally {
242
+ this.snapshotStore.setIsCapturing(false);
243
+ }
244
+ },
216
245
  onResizeWithDebounce() {
217
246
  if (this.debounceOnResize) {
218
247
  this.debounceOnResize();
@@ -1009,6 +1009,7 @@ declare const _default: import("vue").DefineComponent<{}, {
1009
1009
  sendAddContentContinuationEvent: (continuation: string) => void;
1010
1010
  sendUpsellOfferEvent: (upsellType: string) => void;
1011
1011
  sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
1012
+ sendGenerateTextContinuationEvent: (continuation: string) => void;
1012
1013
  };
1013
1014
  externalEditor: import("@tiptap/vue-3").Editor;
1014
1015
  styleSettingsStore: import("pinia").Store<"uiStyleSettings", import("../../../shared/style-settings/store").StyleSettingsState, {
@@ -42,6 +42,10 @@ export declare const EVENTS: {
42
42
  WEBSITE_MAKER_UPSELL_ACTION: string;
43
43
  WEBSITE_MAKER_SWITCH_LOGO: string;
44
44
  WEBSITE_MAKER_SWITCH_LOGO_MODAL: string;
45
+ WEBSITE_MAKER_AI_GENERATE_TEXT: string;
46
+ WEBSITE_MAKER_AI_REGENERATE_TEXT: string;
47
+ WEBSITE_MAKER_AI_SEND_PROMPT: string;
48
+ WEBSITE_MAKER_AI_COPY_RESPONSE: string;
45
49
  };
46
50
  export declare const SELECT_LOCATIONS: {
47
51
  MAKER_PREVIEW: string;
@@ -62,6 +66,14 @@ export declare const UPGRADE_CTA_LOCATIONS: {
62
66
  SLUG_CHANGE_MANAGE_PAGE: string;
63
67
  GOOGLE_ADSENSE: string;
64
68
  };
69
+ export declare const GENERATE_AI_TEXT_CTA_LOCATIONS: {
70
+ BANNER_DESCRIPTION: string;
71
+ BANNER_TITLE: string;
72
+ ABOUT_TITLE: string;
73
+ ABOUT_PARAGRAPH: string;
74
+ TEXT_ITEM: string;
75
+ TESTIMONIAL_ITEM: string;
76
+ };
65
77
  export declare const TRIGGER_TYPE: {
66
78
  AUTOMATIC: string;
67
79
  USER_TRIGGERED: string;
@@ -74,6 +86,10 @@ export declare const PUBLISH_MODAL_CONTINUATION_EVENTS: {
74
86
  COPY_LINK: string;
75
87
  VIEW_WEBSITE: string;
76
88
  };
89
+ export declare const GENERATE_TEXT_CONTINUATION_EVENTS: {
90
+ USE_TEXT: string;
91
+ EXIT: string;
92
+ };
77
93
  export declare const PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS: {
78
94
  PREMIUM: string;
79
95
  EXIT: string;
@@ -104,5 +120,6 @@ declare const useEventTracker: () => {
104
120
  sendAddContentContinuationEvent: (continuation: string) => void;
105
121
  sendUpsellOfferEvent: (upsellType: string) => void;
106
122
  sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
123
+ sendGenerateTextContinuationEvent: (continuation: string) => void;
107
124
  };
108
125
  export { useEventTracker };
@@ -25,6 +25,10 @@ export const EVENTS = {
25
25
  WEBSITE_MAKER_UPSELL_ACTION: 'website_maker_upsell_action',
26
26
  WEBSITE_MAKER_SWITCH_LOGO: 'website_maker_switch_logo',
27
27
  WEBSITE_MAKER_SWITCH_LOGO_MODAL: 'website_maker_switch_logo_modal',
28
+ WEBSITE_MAKER_AI_GENERATE_TEXT: 'website_maker_ai_generate_text',
29
+ WEBSITE_MAKER_AI_REGENERATE_TEXT: 'website_maker_ai_regenerate_text',
30
+ WEBSITE_MAKER_AI_SEND_PROMPT: 'website_maker_send_prompt',
31
+ WEBSITE_MAKER_AI_COPY_RESPONSE: 'website_maker_copy_response',
28
32
  };
29
33
  export const SELECT_LOCATIONS = {
30
34
  MAKER_PREVIEW: 'maker_preview',
@@ -45,6 +49,14 @@ export const UPGRADE_CTA_LOCATIONS = {
45
49
  SLUG_CHANGE_MANAGE_PAGE: 'slug_change_manage_page',
46
50
  GOOGLE_ADSENSE: 'google_adsense',
47
51
  };
52
+ export const GENERATE_AI_TEXT_CTA_LOCATIONS = {
53
+ BANNER_DESCRIPTION: 'banner_description',
54
+ BANNER_TITLE: 'banner_title',
55
+ ABOUT_TITLE: 'about_title',
56
+ ABOUT_PARAGRAPH: 'about_paragraph',
57
+ TEXT_ITEM: 'text_item',
58
+ TESTIMONIAL_ITEM: 'testimonial_item',
59
+ };
48
60
  export const TRIGGER_TYPE = {
49
61
  AUTOMATIC: 'automatic',
50
62
  USER_TRIGGERED: 'user_triggered',
@@ -57,6 +69,10 @@ export const PUBLISH_MODAL_CONTINUATION_EVENTS = {
57
69
  COPY_LINK: 'copy_link',
58
70
  VIEW_WEBSITE: 'view_website',
59
71
  };
72
+ export const GENERATE_TEXT_CONTINUATION_EVENTS = {
73
+ USE_TEXT: 'use_text',
74
+ EXIT: 'exit',
75
+ };
60
76
  export const PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS = {
61
77
  PREMIUM: 'premium',
62
78
  EXIT: 'exit',
@@ -212,6 +228,11 @@ const useEventTracker = () => {
212
228
  action,
213
229
  });
214
230
  },
231
+ sendGenerateTextContinuationEvent: (continuation) => {
232
+ _publishEvent(EVENTS.WEBSITE_MAKER_AI_GENERATE_TEXT, {
233
+ continuation,
234
+ });
235
+ },
215
236
  };
216
237
  };
217
238
  export { useEventTracker };
@@ -7,3 +7,4 @@ export * from './event-manager';
7
7
  export * from './route';
8
8
  export * from './logo-store';
9
9
  export * from './video';
10
+ export * from './snapshot/snapshot-store';
@@ -6,3 +6,4 @@ export * from './event-manager';
6
6
  export * from './route';
7
7
  export * from './logo-store';
8
8
  export * from './video';
9
+ export * from './snapshot/snapshot-store';
@@ -0,0 +1,14 @@
1
+ export interface SnapshotState {
2
+ snapshotBase64: string | null;
3
+ isCapturing: boolean;
4
+ }
5
+ export declare const useSnapshotStore: import("pinia").StoreDefinition<"snapshot", SnapshotState, {
6
+ hasSnapshot: (state: {
7
+ snapshotBase64: string | null;
8
+ isCapturing: boolean;
9
+ } & import("pinia").PiniaCustomStateProperties<SnapshotState>) => boolean;
10
+ }, {
11
+ setBase64Snapshot(base64: string | null): void;
12
+ setIsCapturing(isCapturing: boolean): void;
13
+ clearSnapshot(): void;
14
+ }>;
@@ -0,0 +1,21 @@
1
+ import { defineStore } from 'pinia';
2
+ export const useSnapshotStore = defineStore('snapshot', {
3
+ state: () => ({
4
+ snapshotBase64: null,
5
+ isCapturing: false,
6
+ }),
7
+ actions: {
8
+ setBase64Snapshot(base64) {
9
+ this.snapshotBase64 = base64;
10
+ },
11
+ setIsCapturing(isCapturing) {
12
+ this.isCapturing = isCapturing;
13
+ },
14
+ clearSnapshot() {
15
+ this.snapshotBase64 = null;
16
+ },
17
+ },
18
+ getters: {
19
+ hasSnapshot: (state) => !!state.snapshotBase64,
20
+ },
21
+ });
@@ -0,0 +1 @@
1
+ export declare const getCtaLocationFromFieldType: (fieldType: string, sectionType?: string) => string;
@@ -0,0 +1,29 @@
1
+ import { GENERATE_AI_TEXT_CTA_LOCATIONS } from '../composables/useEventTracker';
2
+ export const getCtaLocationFromFieldType = (fieldType, sectionType) => {
3
+ if (fieldType === 'text') {
4
+ return GENERATE_AI_TEXT_CTA_LOCATIONS.TEXT_ITEM;
5
+ }
6
+ if (fieldType === 'testimonials') {
7
+ return GENERATE_AI_TEXT_CTA_LOCATIONS.TESTIMONIAL_ITEM;
8
+ }
9
+ if (sectionType === 'banner-section') {
10
+ if (fieldType === 'description') {
11
+ return GENERATE_AI_TEXT_CTA_LOCATIONS.BANNER_DESCRIPTION;
12
+ }
13
+ if (fieldType === 'title') {
14
+ return GENERATE_AI_TEXT_CTA_LOCATIONS.BANNER_TITLE;
15
+ }
16
+ }
17
+ if (sectionType === 'about-section') {
18
+ if (fieldType === 'title') {
19
+ return GENERATE_AI_TEXT_CTA_LOCATIONS.ABOUT_TITLE;
20
+ }
21
+ if (fieldType === 'paragraph') {
22
+ return GENERATE_AI_TEXT_CTA_LOCATIONS.ABOUT_PARAGRAPH;
23
+ }
24
+ }
25
+ // Fallback: try to match directly with field type
26
+ // This handles cases where fieldType might already be in the correct format
27
+ const matchingLocation = Object.values(GENERATE_AI_TEXT_CTA_LOCATIONS).find((location) => location === fieldType);
28
+ return matchingLocation || fieldType;
29
+ };
@@ -8,6 +8,8 @@ import { type DOMPurify } from 'dompurify';
8
8
  export declare const isStyleChanged: (tr: Transaction) => boolean;
9
9
  export declare const skipStyleDetection: (chain: ChainedCommands, marks?: Mark[]) => ChainedCommands;
10
10
  export declare const hasRTEContent: (content: string) => boolean;
11
+ export declare const getPlainTextFromRTE: (content: string) => string;
12
+ export declare const replaceTextInRTE: (existingHtml: string, newText: string) => string;
11
13
  export declare const transformToRTE: (uiPageSettingStore: PageSettingsState, externalEditor: Editor, uiStyleSettingsStore?: StyleSettingsState, newContent?: Content, type?: TextStyleType, newStyle?: TextStyleDeclaration) => void;
12
14
  export declare const switchAllContentToRTE: (uiPageSettingStore: PageSettingsState, externalEditor: Editor, uiStyleSettingsStore?: StyleSettingsState) => void;
13
15
  export declare const getUpdatedHTMLFromEditor: (externalEditor: Editor, contentText: string, newContentStyle: TextStyleDeclaration) => string;
@@ -121,6 +121,123 @@ export const hasRTEContent = (content) => {
121
121
  const tagWrapRegex = /^<([A-Za-z][A-Za-z0-9-]*)\b[^>]*>[\s\S]*<\/\1>$/;
122
122
  return tagWrapRegex.test(trimmed);
123
123
  };
124
+ export const getPlainTextFromRTE = (content) => {
125
+ if (typeof content !== 'string') {
126
+ return '';
127
+ }
128
+ // Only strip HTML tags if the value contains HTML
129
+ if (hasRTEContent(content)) {
130
+ return content.replace(/<[^>]*>/g, '').trim();
131
+ }
132
+ return content.trim();
133
+ };
134
+ export const replaceTextInRTE = (existingHtml, newText) => {
135
+ if (!hasRTEContent(existingHtml)) {
136
+ return `<p>${newText}</p>`;
137
+ }
138
+ const tempDiv = document.createElement('div');
139
+ tempDiv.innerHTML = existingHtml;
140
+ const blockElement = tempDiv.querySelector('p, div, h1, h2, h3, h4, h5, h6, blockquote');
141
+ if (!blockElement) {
142
+ return `<p>${newText}</p>`;
143
+ }
144
+ // Collect all spans and their styles
145
+ const spans = blockElement.querySelectorAll('span');
146
+ const mergedStyles = {};
147
+ const hasFormatting = {
148
+ bold: false,
149
+ italic: false,
150
+ underline: false,
151
+ strikethrough: false,
152
+ mark: false,
153
+ markColor: '',
154
+ markStyle: '',
155
+ };
156
+ // Iterate through all spans to collect and merge styles
157
+ spans.forEach((span) => {
158
+ // Collect inline styles
159
+ if (span.style.cssText) {
160
+ const styleDeclarations = span.style.cssText.split(';');
161
+ styleDeclarations.forEach((declaration) => {
162
+ const [property, value] = declaration.split(':').map((s) => s.trim());
163
+ if (property && value) {
164
+ mergedStyles[property] = value; // Latest value overwrites previous
165
+ }
166
+ });
167
+ }
168
+ // Collect data attributes (like data-color for marks)
169
+ if (span.hasAttribute('data-color')) {
170
+ mergedStyles['data-color'] = span.getAttribute('data-color') || '';
171
+ }
172
+ // Check for formatting tags within this span
173
+ if (span.querySelector('strong, b'))
174
+ hasFormatting.bold = true;
175
+ if (span.querySelector('em, i'))
176
+ hasFormatting.italic = true;
177
+ if (span.querySelector('u'))
178
+ hasFormatting.underline = true;
179
+ if (span.querySelector('s, strike, del'))
180
+ hasFormatting.strikethrough = true;
181
+ // Check for mark/highlight tags
182
+ const markElement = span.querySelector('mark');
183
+ if (markElement) {
184
+ hasFormatting.mark = true;
185
+ if (markElement.hasAttribute('data-color')) {
186
+ hasFormatting.markColor = markElement.getAttribute('data-color') || '';
187
+ }
188
+ if (markElement.style.cssText) {
189
+ hasFormatting.markStyle = markElement.style.cssText;
190
+ }
191
+ }
192
+ });
193
+ // Create the new span with merged styles
194
+ const newSpan = document.createElement('span');
195
+ // Apply collected inline styles
196
+ Object.entries(mergedStyles).forEach(([property, value]) => {
197
+ if (property === 'data-color') {
198
+ newSpan.setAttribute('data-color', value);
199
+ }
200
+ else {
201
+ newSpan.style.setProperty(property, value);
202
+ }
203
+ });
204
+ // Build the formatted text with nested tags
205
+ let formattedText = newText;
206
+ // Apply mark/highlight if present
207
+ if (hasFormatting.mark) {
208
+ const markElement = document.createElement('mark');
209
+ if (hasFormatting.markColor) {
210
+ markElement.setAttribute('data-color', hasFormatting.markColor);
211
+ }
212
+ if (hasFormatting.markStyle) {
213
+ markElement.style.cssText = hasFormatting.markStyle;
214
+ }
215
+ markElement.textContent = formattedText;
216
+ formattedText = markElement.outerHTML;
217
+ }
218
+ // Apply underline
219
+ if (hasFormatting.underline) {
220
+ formattedText = `<u>${formattedText}</u>`;
221
+ }
222
+ // Apply strikethrough
223
+ if (hasFormatting.strikethrough) {
224
+ formattedText = `<s>${formattedText}</s>`;
225
+ }
226
+ // Apply italic
227
+ if (hasFormatting.italic) {
228
+ formattedText = `<em>${formattedText}</em>`;
229
+ }
230
+ // Apply bold
231
+ if (hasFormatting.bold) {
232
+ formattedText = `<strong>${formattedText}</strong>`;
233
+ }
234
+ // Set the formatted content to the span
235
+ newSpan.innerHTML = formattedText;
236
+ // Clear the block element and add the new span
237
+ blockElement.innerHTML = '';
238
+ blockElement.appendChild(newSpan);
239
+ return tempDiv.innerHTML;
240
+ };
124
241
  export const transformToRTE = (uiPageSettingStore, externalEditor, uiStyleSettingsStore, newContent, type, newStyle) => {
125
242
  for (const page of uiPageSettingStore.pages) {
126
243
  for (const contentItem of page.contents) {