@designcrowd/library.brand-page 5.16.34 → 5.16.36

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 (119) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-D91N-tbm.js → CreatedOnBrandCrowd-de-de-DVJiCllu.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BmcF4WYm.js → CreatedOnBrandCrowd-en-us-C0ySCxIL.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CRAWWkm0.js → CreatedOnBrandCrowd-es-es-Lx2TeOFQ.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-Crg5ty-A.js → CreatedOnBrandCrowd-fr-ca-hnZGTPjT.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-Crg5ty-A.js → CreatedOnBrandCrowd-fr-fr-hnZGTPjT.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-IPV8Z-Ww.js → CreatedOnBrandCrowd-pt-br-DS1LjpsM.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-IPV8Z-Ww.js → CreatedOnBrandCrowd-pt-pt-DS1LjpsM.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CmljZBtX.js → CreatedOnDcom-de-de-CEb2I9b_.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-B-VY4Bpb.js → CreatedOnDcom-en-us-BV3oETu_.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BH3XI3P0.js → CreatedOnDcom-es-es-D4Y8_uzV.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BX8FjPKR.js → CreatedOnDcom-fr-ca-D0zmS934.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-BM-qEmPv.js → CreatedOnDcom-fr-fr-nPvCDeF3.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DX_aD3XN.js → CreatedOnDcom-pt-br-LnkzeH5-.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-oFipORQP.js → CreatedOnDcom-pt-pt-BlRxxeSh.js} +1 -1
  15. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +8 -10
  16. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +13 -10
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +0 -2
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +48 -35
  19. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
  20. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.d.ts +2 -0
  21. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +17 -18
  22. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +4 -1
  23. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +8 -10
  24. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -1
  25. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
  26. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
  27. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +8 -10
  28. package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +4 -0
  29. package/lib/src/brand-page-maker/composables/useEventTracker.js +19 -0
  30. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +1 -0
  31. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +5 -0
  32. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +1 -4
  33. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +2 -4
  34. package/lib/src/brand-page-maker/stores/event-manager/event-manager-store.js +3 -3
  35. package/lib/src/brand-page-maker/stores/user/user-store.d.ts +8 -10
  36. package/lib/src/brand-page-maker/stores/user/user-store.js +9 -18
  37. package/lib/src/brand-page-maker/stores/video/video-store.d.ts +3 -0
  38. package/lib/src/brand-page-maker/stores/video/video-store.js +22 -0
  39. package/lib/src/{bundled-translations-CMyG8Azk.js → bundled-translations-EqxiRIwA.js} +13 -13
  40. package/lib/src/{bundled-translations.de-DE-BJPw07Ba.js → bundled-translations.de-DE-BKqVO-q2.js} +9 -9
  41. package/lib/src/{bundled-translations.es-ES-DqQ7zLxJ.js → bundled-translations.es-ES-DwKrkWcX.js} +12 -12
  42. package/lib/src/{bundled-translations.fr-CA-2dy4OokC.js → bundled-translations.fr-CA-BZtZzL79.js} +17 -17
  43. package/lib/src/{bundled-translations.fr-FR-Bjh3iNSg.js → bundled-translations.fr-FR-NgI1lWQl.js} +29 -29
  44. package/lib/src/{bundled-translations.pt-BR-BRC_B0LW.js → bundled-translations.pt-BR-DuqcSme7.js} +1 -1
  45. package/lib/src/{bundled-translations.pt-PT-Ka3E8T1F.js → bundled-translations.pt-PT-DDsgh_7r.js} +17 -17
  46. package/lib/src/bundles/bundled-translations.de-DE.json +14 -1
  47. package/lib/src/bundles/bundled-translations.es-ES.json +14 -1
  48. package/lib/src/bundles/bundled-translations.fr-CA.json +14 -1
  49. package/lib/src/bundles/bundled-translations.fr-FR.json +14 -1
  50. package/lib/src/bundles/bundled-translations.json +14 -1
  51. package/lib/src/bundles/bundled-translations.pt-BR.json +14 -1
  52. package/lib/src/bundles/bundled-translations.pt-PT.json +14 -1
  53. package/lib/src/composables/useTranslate.d.ts +1 -1
  54. package/lib/src/composables/useTranslate.js +1 -1
  55. package/lib/src/css/library.brand-page-brandCrowd.min.css +23 -20
  56. package/lib/src/css/library.brand-page-brandPage.min.css +24 -20
  57. package/lib/src/css/library.brand-page-designCom.min.css +23 -20
  58. package/lib/src/css/library.brand-page-preview.min.css +23 -20
  59. package/lib/src/index.mjs +1 -1
  60. package/lib/src/{lib-R9y_fcgW.js → lib-DAR6PgGS.js} +18252 -18193
  61. package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +7 -9
  62. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +4 -1
  63. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +78 -11
  64. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.js +30 -3
  65. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +3 -0
  66. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +8 -10
  67. package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +3 -0
  68. package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.d.ts +7 -9
  69. package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +3 -0
  70. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
  71. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +11 -10
  72. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -1
  73. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +4 -1
  74. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +7 -9
  75. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +3 -0
  76. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +11 -10
  77. package/lib/src/shared/style-settings/components/StyleSettings.stories.js +8 -5
  78. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +7 -0
  79. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.js +10 -3
  80. package/lib/src/shared/template-settings/store/template-settings-store.d.ts +4 -0
  81. package/lib/src/shared/template-settings/store/template-settings-store.js +4 -0
  82. package/package.json +2 -2
  83. package/src/brand-page/components/page/Page.vue +1 -1
  84. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +0 -2
  85. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +53 -35
  86. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +19 -18
  87. package/src/brand-page-maker/composables/useEventTracker.ts +20 -0
  88. package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +7 -0
  89. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +11 -6
  90. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +1 -9
  91. package/src/brand-page-maker/stores/event-manager/event-manager-store.ts +3 -3
  92. package/src/brand-page-maker/stores/user/user-store.test.ts +2 -2
  93. package/src/brand-page-maker/stores/user/user-store.ts +17 -19
  94. package/src/brand-page-maker/stores/video/video-store.ts +30 -0
  95. package/src/bundles/bundled-translations.de-DE.json +14 -1
  96. package/src/bundles/bundled-translations.es-ES.json +14 -1
  97. package/src/bundles/bundled-translations.fr-CA.json +14 -1
  98. package/src/bundles/bundled-translations.fr-FR.json +14 -1
  99. package/src/bundles/bundled-translations.json +14 -1
  100. package/src/bundles/bundled-translations.pt-BR.json +14 -1
  101. package/src/bundles/bundled-translations.pt-PT.json +14 -1
  102. package/src/composables/useTranslate.ts +2 -1
  103. package/src/shared/background-settings/components/BackgroundSettings.vue +7 -5
  104. package/src/shared/background-settings/components/ReplaceImageSettingsForBackgroundSettings.vue +41 -1
  105. package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.ts +43 -2
  106. package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +4 -0
  107. package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.vue +6 -5
  108. package/src/shared/page-settings/store/page-settings-store.test.ts +16 -2
  109. package/src/shared/style-settings/components/StyleSettings.stories.ts +12 -5
  110. package/src/shared/template-settings/components/TemplatesSettings.mixin.ts +11 -3
  111. package/src/shared/template-settings/store/template-settings-store.ts +5 -0
  112. package/src/shared/video-library/VideoLibrary.vue +6 -13
  113. package/src/shared/video-library/i18n/video-library.de-DE.json +14 -1
  114. package/src/shared/video-library/i18n/video-library.es-ES.json +14 -1
  115. package/src/shared/video-library/i18n/video-library.fr-CA.json +14 -1
  116. package/src/shared/video-library/i18n/video-library.fr-FR.json +14 -1
  117. package/src/shared/video-library/i18n/video-library.json +14 -1
  118. package/src/shared/video-library/i18n/video-library.pt-BR.json +14 -1
  119. package/src/shared/video-library/i18n/video-library.pt-PT.json +14 -1
@@ -51,6 +51,7 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
51
51
  cachedTemplates: {},
52
52
  logoChangeWatcherInitialized: false,
53
53
  renderAsImage,
54
+ initialSearchTerm: undefined,
54
55
  };
55
56
  },
56
57
  actions: {
@@ -329,6 +330,9 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
329
330
  });
330
331
  }
331
332
  },
333
+ setInitialSearchTerm(payload) {
334
+ this.initialSearchTerm = payload.initialSearchTerm;
335
+ },
332
336
  clearTemplates() {
333
337
  this.templates.splice(0);
334
338
  this.pageNo = 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "5.16.34",
4
+ "version": "5.16.36",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@ckpack/vue-color": "1.4.1",
58
- "@designcrowd/fe-shared-lib": "1.5.12",
58
+ "@designcrowd/fe-shared-lib": "1.5.14",
59
59
  "@pinia/nuxt": "0.11.0",
60
60
  "@storybook/react": "9.0.4",
61
61
  "@tiptap/extension-bubble-menu": "^2.14.0",
@@ -9,7 +9,7 @@
9
9
  :media="viewModel.styles.backgroundStylesViewModel.mediaViewModel"
10
10
  :context="context"
11
11
  :img-classes="{
12
- 'tw-absolute tw-left-0 tw-top-0 tw-z-0 tw-w-full tw-h-full tw-object-cover': true,
12
+ 'tw-absolute tw-left-0 tw-top-0 tw-z-0 tw-w-full tw-h-full tw-object-cover md:tw-fixed': true,
13
13
  }"
14
14
  :media-type="viewModel.styles.backgroundStylesViewModel.mediaViewModel.type"
15
15
  content-index="0"
@@ -212,8 +212,6 @@ export default defineComponent({
212
212
 
213
213
  await this.brandPageMakerStore.initialise({
214
214
  brandPage,
215
- emailAddress: this.viewModel.emailAddress,
216
- features: this.viewModel.features,
217
215
  logoDraftDesignAttributes: this.viewModel.logoDraftDesignAttributes,
218
216
  unsplashApplicationName: this.viewModel.unsplashApplicationName,
219
217
  templateCategories: this.viewModel.templateCategories,
@@ -268,11 +268,14 @@ const InitialiseMakerStores = (options: {
268
268
  contextualUpgradeType: undefined,
269
269
  isContextualUpgradeModalVisible: false,
270
270
  gettyVideos: [],
271
+ templateSearchTerm: undefined,
271
272
  });
272
273
 
273
- userStore.setIsAdmin({ isAdmin: options.isAdmin || false });
274
- userStore.setHasBrandPagePremiumSubscription(false);
275
- userStore.setBrandPageCommissionPercentage(0.1);
274
+ userStore.setUserState({
275
+ isAdmin: options.isAdmin,
276
+ hasPremiumSubscription: false,
277
+ brandPageCommissionPercentage: 0.1,
278
+ });
276
279
  };
277
280
 
278
281
  const FABRIC_RENDER_BASE_URL = 'https://localhost:6006/';
@@ -342,6 +345,7 @@ export const SampleDesktopManagePages = (): any => {
342
345
 
343
346
  const contentSettingsStore = useUiContentSettingsStore();
344
347
  const brandPageMakerStore = useBrandPageMakerStore();
348
+ const userStore = useBrandPageMakerUserStore();
345
349
 
346
350
  contentSettingsStore.pushMode({
347
351
  mode: CONTENT_SETTINGS_MODES.pages,
@@ -351,6 +355,12 @@ export const SampleDesktopManagePages = (): any => {
351
355
  viewport: VIEWPORTS.desktop,
352
356
  });
353
357
 
358
+ userStore.setUserState({
359
+ features: {
360
+ ...userFeatures,
361
+ },
362
+ });
363
+
354
364
  return defineComponent({
355
365
  components: {
356
366
  BrandPageMaker,
@@ -398,10 +408,6 @@ export const SampleDesktopManagePages = (): any => {
398
408
  isSaving: false,
399
409
  logoDraftDesignAttributes: simpleLogoDesignAttributes,
400
410
  logoVariationImageUrls,
401
- features: {
402
- ...userFeatures,
403
- canAddMoreThanThreePages: true,
404
- },
405
411
  templateCategories: TEMPLATE_CATEGORIES,
406
412
  },
407
413
  };
@@ -423,6 +429,7 @@ export const SampleBanner = (): any => {
423
429
 
424
430
  InitialiseMakerStores({});
425
431
  const brandPageMakerStore = useBrandPageMakerStore();
432
+ const userStore = useBrandPageMakerUserStore();
426
433
 
427
434
  const bannerContent = createInitialBannerSectionContent();
428
435
  bannerContent.description = 'Lorem ipsum dolor sit amet';
@@ -431,6 +438,12 @@ export const SampleBanner = (): any => {
431
438
  viewport: VIEWPORTS.desktop,
432
439
  });
433
440
 
441
+ userStore.setUserState({
442
+ features: {
443
+ ...userFeatures,
444
+ },
445
+ });
446
+
434
447
  return defineComponent({
435
448
  components: {
436
449
  BrandPageMaker,
@@ -452,10 +465,6 @@ export const SampleBanner = (): any => {
452
465
  isSaving: false,
453
466
  logoDraftDesignAttributes: simpleLogoDesignAttributes,
454
467
  logoVariationImageUrls,
455
- features: {
456
- ...userFeatures,
457
- canAddMoreThanThreePages: true,
458
- },
459
468
  templateCategories: TEMPLATE_CATEGORIES,
460
469
  },
461
470
  };
@@ -1009,6 +1018,7 @@ export const SamplePremiumUser = (): any => {
1009
1018
  },
1010
1019
  setup() {
1011
1020
  const containerStore = useBrandPageContainerStore();
1021
+ const userStore = useBrandPageMakerUserStore();
1012
1022
 
1013
1023
  const logoStore = useLogoStore();
1014
1024
 
@@ -1024,6 +1034,18 @@ export const SamplePremiumUser = (): any => {
1024
1034
  containerStore.$patch({
1025
1035
  baseFabricRenderUrl: FABRIC_RENDER_BASE_URL,
1026
1036
  });
1037
+
1038
+ userStore.setUserState({
1039
+ features: {
1040
+ ...userFeatures,
1041
+ showBrandCrowdLogo: false,
1042
+ canAddVideoContents: true,
1043
+ canUploadBackgroundImages: true,
1044
+ canAddMapContents: true,
1045
+ canAddContactFormContents: true,
1046
+ canAddLibraryBackgroundImages: true,
1047
+ },
1048
+ });
1027
1049
  },
1028
1050
  data() {
1029
1051
  return {
@@ -1032,16 +1054,6 @@ export const SamplePremiumUser = (): any => {
1032
1054
  isSaving: false,
1033
1055
  logoVariationImageUrls,
1034
1056
  logoDraftDesignAttributes: gradientLogoDesignAttributes,
1035
- features: {
1036
- ...userFeatures,
1037
- showBrandCrowdLogo: false,
1038
- canAddVideoContents: true,
1039
- canUploadBackgroundImages: true,
1040
- canAddMapContents: true,
1041
- canAddContactFormContents: true,
1042
- canAddLibraryBackgroundImages: true,
1043
- canAddMoreThanThreePages: true,
1044
- },
1045
1057
  initialCategories: {},
1046
1058
  },
1047
1059
  };
@@ -1072,6 +1084,7 @@ export const SamplePremiumBContactUser = (): any => {
1072
1084
  },
1073
1085
  setup() {
1074
1086
  const containerStore = useBrandPageContainerStore();
1087
+ const userStore = useBrandPageMakerUserStore();
1075
1088
 
1076
1089
  const logoStore = useLogoStore();
1077
1090
 
@@ -1087,6 +1100,18 @@ export const SamplePremiumBContactUser = (): any => {
1087
1100
  containerStore.$patch({
1088
1101
  baseFabricRenderUrl: FABRIC_RENDER_BASE_URL,
1089
1102
  });
1103
+
1104
+ userStore.setUserState({
1105
+ features: {
1106
+ ...userFeatures,
1107
+ showBrandCrowdLogo: false,
1108
+ canAddVideoContents: true,
1109
+ canUploadBackgroundImages: true,
1110
+ canAddMapContents: true,
1111
+ canAddContactFormContents: true,
1112
+ canAddLibraryBackgroundImages: true,
1113
+ },
1114
+ });
1090
1115
  },
1091
1116
  data() {
1092
1117
  return {
@@ -1095,16 +1120,6 @@ export const SamplePremiumBContactUser = (): any => {
1095
1120
  isSaving: false,
1096
1121
  logoVariationImageUrls,
1097
1122
  logoDraftDesignAttributes: gradientLogoDesignAttributes,
1098
- features: {
1099
- ...userFeatures,
1100
- showBrandCrowdLogo: false,
1101
- canAddVideoContents: true,
1102
- canUploadBackgroundImages: true,
1103
- canAddMapContents: true,
1104
- canAddContactFormContents: true,
1105
- canAddLibraryBackgroundImages: true,
1106
- canAddMoreThanThreePages: true,
1107
- },
1108
1123
  initialCategories: {},
1109
1124
  },
1110
1125
  };
@@ -1734,6 +1749,7 @@ export const TextStyleOptions = (): any => {
1734
1749
  const imageUrl = 'https://source.unsplash.com/random/400x225?1';
1735
1750
 
1736
1751
  const brandPageMakerStore = useBrandPageMakerStore();
1752
+ const userStore = useBrandPageMakerUserStore();
1737
1753
 
1738
1754
  brandPageMakerStore.setSelectedTabName({
1739
1755
  tabName: SIDE_BAR_TAB_NAMES.STYLE_SETTINGS,
@@ -1836,6 +1852,12 @@ export const TextStyleOptions = (): any => {
1836
1852
  viewport: VIEWPORTS.desktop,
1837
1853
  });
1838
1854
 
1855
+ userStore.setUserState({
1856
+ features: {
1857
+ ...userFeatures,
1858
+ },
1859
+ });
1860
+
1839
1861
  return defineComponent({
1840
1862
  components: {
1841
1863
  BrandPageMaker,
@@ -1857,10 +1879,6 @@ export const TextStyleOptions = (): any => {
1857
1879
  isSaving: false,
1858
1880
  logoDraftDesignAttributes: simpleLogoDesignAttributes,
1859
1881
  logoVariationImageUrls,
1860
- features: {
1861
- ...userFeatures,
1862
- canAddMoreThanThreePages: true,
1863
- },
1864
1882
  templateCategories: TEMPLATE_CATEGORIES,
1865
1883
  },
1866
1884
  };
@@ -37,6 +37,7 @@ import type { UserFeatures } from '../../../stores';
37
37
  import type { AdminPreviewLogoTemplateModel } from '../../../stores/admin-logo-settings';
38
38
  import { v4 as uuid } from 'uuid';
39
39
  import { CONTENT_SETTINGS_CONFIGS } from '../../../constants';
40
+ import type { UIUserFeatures } from 'src/constants/ui';
40
41
 
41
42
  export const storyEmailAddress = 'test@test.com';
42
43
 
@@ -2108,26 +2109,26 @@ export const brandPageCustom: BrandPageData = {
2108
2109
  },
2109
2110
  };
2110
2111
 
2112
+ export const USER_FEATURES: UIUserFeatures = Object.freeze({
2113
+ showBrandCrowdLogo: true,
2114
+ canAddImageContents: true,
2115
+ canAddVideoContents: false,
2116
+ canAddMapContents: false,
2117
+ canAddLibraryBackgroundImages: true,
2118
+ canAddRequestPaymentContents: true,
2119
+ canAddShopContents: true,
2120
+ canUploadBackgroundImages: false,
2121
+ canAddContactFormContents: true,
2122
+ canUseRichTextEditor: false,
2123
+ canUsePremiumFontFamily: true,
2124
+ maxNumOfPages: UNLIMITED_MAX_NUM_OF_PAGES,
2125
+ canUseGettyVideos: true,
2126
+ canUseGoogleAdsense: false,
2127
+ googleAdsenseEnabled: true,
2128
+ } as UIUserFeatures);
2129
+
2111
2130
  export const INITIALISE_PAYLOAD: InitialisePayload = Object.freeze({
2112
2131
  brandPage: BRAND_PAGE,
2113
- emailAddress: storyEmailAddress,
2114
- features: {
2115
- showBrandCrowdLogo: true,
2116
- canAddImageContents: true,
2117
- canAddVideoContents: false,
2118
- canAddMapContents: false,
2119
- canAddLibraryBackgroundImages: true,
2120
- canAddRequestPaymentContents: true,
2121
- canAddShopContents: true,
2122
- canUploadBackgroundImages: false,
2123
- canAddContactFormContents: true,
2124
- canUseRichTextEditor: false,
2125
- canUsePremiumFontFamily: true,
2126
- maxNumOfPages: UNLIMITED_MAX_NUM_OF_PAGES,
2127
- canUseGettyVideos: true,
2128
- canUseGoogleAdsense: false,
2129
- googleAdsenseEnabled: true,
2130
- },
2131
2132
  logoDraftDesignAttributes: simpleLogoDesignAttributes,
2132
2133
  backUrl: '',
2133
2134
  logoVariationImageUrls: [],
@@ -63,6 +63,7 @@ export const EVENTS = {
63
63
  WEBSITE_MAKER_AI_CLICK_SUGGESTED_PROMPT:
64
64
  'website_maker_ai_click_suggested_prompt',
65
65
  WEBSITE_MAKER_DOMAIN_UPSELL_MODAL: 'website_domain_upsell_modal',
66
+ WEBSITE_MAKER_GETTY_VIDEO: 'website_maker_getty_video',
66
67
  };
67
68
 
68
69
  export const SELECT_LOCATIONS = {
@@ -160,6 +161,24 @@ const _publishEvent = (
160
161
  };
161
162
 
162
163
  const useEventTracker = () => {
164
+ const gettyVideoEvents = {
165
+ sendGettyVideoAddEvent: () => {
166
+ _publishEvent(EVENTS.WEBSITE_MAKER_GETTY_VIDEO, {
167
+ action: 'add',
168
+ });
169
+ },
170
+ sendGettyVideoReplaceEvent: () => {
171
+ _publishEvent(EVENTS.WEBSITE_MAKER_GETTY_VIDEO, {
172
+ action: 'replace',
173
+ });
174
+ },
175
+ sendGettyVideoRemoveEvent: () => {
176
+ _publishEvent(EVENTS.WEBSITE_MAKER_GETTY_VIDEO, {
177
+ action: 'remove',
178
+ });
179
+ },
180
+ };
181
+
163
182
  return {
164
183
  sendExperimentStartedEvent: (abTestKey: string, abTestValue: string) => {
165
184
  _publishEvent(
@@ -324,6 +343,7 @@ const useEventTracker = () => {
324
343
  continuation,
325
344
  });
326
345
  },
346
+ ...gettyVideoEvents,
327
347
  };
328
348
  };
329
349
 
@@ -37,6 +37,7 @@ import type { WebsiteSlugCheckResponse } from '../../../brand-page-maker/models/
37
37
  import { errorTr, constantsTr } from '../../../composables/useTranslate';
38
38
  import { findValuesByKey } from '../../../helpers/ts.helper';
39
39
  import { WEBSITE_UPGRADE_CONTEXT_TYPES } from '@designcrowd/fe-shared-lib';
40
+ import { useUiTemplateSettingsStore } from '../../../shared/template-settings/store';
40
41
 
41
42
  export type WebsiteContextUpgradeType =
42
43
  keyof typeof WEBSITE_UPGRADE_CONTEXT_TYPES;
@@ -112,6 +113,7 @@ export type InitialisePayload = Omit<
112
113
  logoTemplateAsset: LogoTemplateAsset | undefined;
113
114
  logoDraftAssets: LogoDraftAsset[];
114
115
  gettyVideos: GettyVideoEditorViewModelResponse[];
116
+ templateSearchTerm: string | undefined;
115
117
  };
116
118
 
117
119
  export const BRANDPAGE_STATUS = Object.freeze({
@@ -200,6 +202,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
200
202
  }
201
203
 
202
204
  const brandPageMakerStore = useBrandPageMakerStore();
205
+ const templateSettingsStore = useUiTemplateSettingsStore();
203
206
 
204
207
  this.brandPageBaseUrl = payload.brandPageBaseUrl;
205
208
  this.baseFabricRenderUrl = localisedRouteStore.baseFabricRenderDomain;
@@ -242,6 +245,10 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
242
245
  logoDraftAssets: payload.logoDraftAssets || [],
243
246
  });
244
247
 
248
+ templateSettingsStore.setInitialSearchTerm({
249
+ initialSearchTerm: payload.templateSearchTerm ?? '',
250
+ });
251
+
245
252
  brandPageMakerStore.setSelectedTemplateId({
246
253
  templateId: this.designTemplateToken,
247
254
  });
@@ -2,6 +2,7 @@ import { vi } from 'vitest';
2
2
  import {
3
3
  BRAND_PAGE,
4
4
  INITIALISE_PAYLOAD,
5
+ USER_FEATURES,
5
6
  userFeatures,
6
7
  } from '../../components/brand-page-maker/__fixtures__';
7
8
  import {
@@ -79,7 +80,7 @@ describe('brand page maker store module', () => {
79
80
  const store = useBrandPageMakerStore();
80
81
  const userStore = useBrandPageMakerUserStore();
81
82
 
82
- userStore.setIsAdmin({ isAdmin: true });
83
+ userStore.setUserState({ isAdmin: true });
83
84
 
84
85
  await store.initialise(INITIALISE_PAYLOAD);
85
86
 
@@ -95,7 +96,7 @@ describe('brand page maker store module', () => {
95
96
  const store = useBrandPageMakerStore();
96
97
  const userStore = useBrandPageMakerUserStore();
97
98
 
98
- userStore.setIsAdmin({ isAdmin: true });
99
+ userStore.setUserState({ isAdmin: true });
99
100
 
100
101
  await store.initialise(INITIALISE_PAYLOAD);
101
102
 
@@ -113,14 +114,18 @@ describe('brand page maker store module', () => {
113
114
  const userStore = useBrandPageMakerUserStore();
114
115
 
115
116
  // Act
116
- await store.initialise({
117
- ...INITIALISE_PAYLOAD,
117
+
118
+ userStore.setUserState({
118
119
  features: {
119
120
  ...userFeatures,
120
121
  showBrandCrowdLogo: false,
121
122
  },
122
123
  });
123
124
 
125
+ await store.initialise({
126
+ ...INITIALISE_PAYLOAD,
127
+ });
128
+
124
129
  // Assert
125
130
  expect(userStore.features.showBrandCrowdLogo).toBe(false);
126
131
  });
@@ -170,7 +175,7 @@ describe('brand page maker store module', () => {
170
175
  const store = useBrandPageMakerStore();
171
176
  const userStore = useBrandPageMakerUserStore();
172
177
 
173
- userStore.setIsAdmin({ isAdmin: true });
178
+ userStore.setUserState({ isAdmin: true });
174
179
 
175
180
  const contactFormContent: ContactFormContent = {
176
181
  id: faker.datatype.uuid(),
@@ -497,7 +502,7 @@ describe('brand page maker store module', () => {
497
502
  // Arrange
498
503
  const userStore = useBrandPageMakerUserStore();
499
504
 
500
- userStore.setIsAdmin({ isAdmin: true });
505
+ userStore.setUserState({ isAdmin: true });
501
506
 
502
507
  const templateId = faker.string.uuid();
503
508
 
@@ -114,8 +114,6 @@ export type SelectedCategoryPayload = InitialCategories;
114
114
  export interface InitialisePayload {
115
115
  brandPage: string | BrandPageData;
116
116
  brandPageType?: BrandPageType;
117
- emailAddress: string;
118
- features: UserFeatures;
119
117
  logoDraftDesignAttributes: LogoDesignAttributesModel;
120
118
  unsplashApplicationName: string;
121
119
  templateCategories: TemplateCategory[];
@@ -729,8 +727,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
729
727
  async initialise({
730
728
  brandPage,
731
729
  brandPageType,
732
- emailAddress,
733
- features,
734
730
  logoDraftDesignAttributes,
735
731
  unsplashApplicationName,
736
732
  templateCategories,
@@ -844,10 +840,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
844
840
  templateType: brandPageTypeTemplateTypeMap[_brandPageType],
845
841
  });
846
842
 
847
- userStore.setEmailAddress(emailAddress);
848
-
849
- userStore.setFeatures(features);
850
-
851
843
  uiStore.setLogoTheme({
852
844
  logoTheme: parseLogoThemeToCssStyles(
853
845
  logoDraftDesignAttributes.logoTheme,
@@ -887,7 +879,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
887
879
  pages: brandPageModel.pages,
888
880
  });
889
881
 
890
- setContentSettingsAddContentOptions(features);
882
+ setContentSettingsAddContentOptions(userStore.features);
891
883
 
892
884
  if (logoImage) {
893
885
  const logoSettingsState: LogoSettingsState = {
@@ -82,12 +82,12 @@ const getBrandPageEventCategory = () => {
82
82
 
83
83
  if (
84
84
  process.env.NODE_ENV !== 'production' &&
85
- typeof userStore.hasBrandPagePremiumSubscription !== 'boolean'
85
+ typeof userStore.hasPremiumSubscription !== 'boolean'
86
86
  ) {
87
- console.error('hasBrandPagePremiumSubscription should be a boolean');
87
+ console.error('hasPremiumSubscription should be a boolean');
88
88
  }
89
89
 
90
- return userStore.hasBrandPagePremiumSubscription
90
+ return userStore.hasPremiumSubscription
91
91
  ? BRAND_PAGE_ACTIVE
92
92
  : BRAND_PAGE_INACTIVE;
93
93
  };
@@ -12,7 +12,7 @@ describe('brand page user store module', () => {
12
12
  // Arrange
13
13
  const store = useBrandPageMakerUserStore();
14
14
 
15
- store.setIsAdmin({ isAdmin: true });
15
+ store.setUserState({ isAdmin: true });
16
16
 
17
17
  // Act
18
18
 
@@ -24,7 +24,7 @@ describe('brand page user store module', () => {
24
24
  // Arrange
25
25
  const store = useBrandPageMakerUserStore();
26
26
 
27
- store.setIsAdmin({ isAdmin: false });
27
+ store.setUserState({ isAdmin: false });
28
28
  // Act
29
29
 
30
30
  // Assert
@@ -7,7 +7,7 @@ export type UserFeatures = UIUserFeatures;
7
7
  export interface UserState extends UIUserState {
8
8
  features: UserFeatures;
9
9
  emailAddress: string;
10
- hasBrandPagePremiumSubscription: boolean;
10
+ hasPremiumSubscription: boolean;
11
11
  brandPageCommissionPercentage: number | undefined;
12
12
  userToken?: string;
13
13
  }
@@ -35,29 +35,27 @@ export const useBrandPageMakerUserStore = defineStore('brandPageMakerUser', {
35
35
  googleAdsenseEnabled: false,
36
36
  },
37
37
  emailAddress: '',
38
- hasBrandPagePremiumSubscription: false,
38
+ hasPremiumSubscription: false,
39
39
  brandPageCommissionPercentage: undefined,
40
40
  isAdmin: false, // this is currently used as way to identify admin maker mode
41
41
  userToken: undefined,
42
42
  }),
43
43
  actions: {
44
- setEmailAddress(payload: string): void {
45
- this.emailAddress = payload;
46
- },
47
- setFeatures(payload: Partial<UserFeatures>): void {
48
- this.features = Object.assign({}, this.features, payload);
49
- },
50
- setHasBrandPagePremiumSubscription(payload: boolean): void {
51
- this.hasBrandPagePremiumSubscription = payload;
52
- },
53
- setIsAdmin(payload: { isAdmin: boolean }): void {
54
- this.isAdmin = payload.isAdmin;
55
- },
56
- setBrandPageCommissionPercentage(payload: number): void {
57
- this.brandPageCommissionPercentage = payload;
58
- },
59
- setUserToken(payload: { userToken: string }): void {
60
- this.userToken = payload.userToken;
44
+ setUserState(payload: {
45
+ emailAddress?: string;
46
+ userToken?: string;
47
+ isAdmin?: boolean;
48
+ hasPremiumSubscription?: boolean;
49
+ brandPageCommissionPercentage?: number;
50
+ features?: Partial<UserFeatures>;
51
+ }): void {
52
+ this.emailAddress = payload.emailAddress || '';
53
+ this.userToken = payload.userToken || '';
54
+ this.hasPremiumSubscription = payload.hasPremiumSubscription || false;
55
+ this.brandPageCommissionPercentage =
56
+ payload.brandPageCommissionPercentage || undefined;
57
+ this.isAdmin = payload.isAdmin || false;
58
+ this.features = Object.assign({}, this.features, payload.features);
61
59
  },
62
60
  },
63
61
  });
@@ -1,7 +1,14 @@
1
1
  import { defineStore } from 'pinia';
2
+ import { useBrandPageMakerStore } from '../brandpage-maker';
3
+ import cloneDeep from 'lodash.clonedeep';
4
+ import { findValuesByKey } from '../../../helpers/ts.helper';
5
+ import { useBrandPageMakerUserStore } from '../user';
6
+ import { useBrandPageContainerStore } from '../brandpage-container';
2
7
 
3
8
  const CDN_GETTY_S3_URL_PREFIX = 'https://bc-getty-media.brandcrowd.com';
4
9
 
10
+ export const GETTY_VIDEO_LIMIT_FOR_SITE = 5;
11
+
5
12
  export type VideoUrlData = {
6
13
  videoUrl: string;
7
14
  previewImageUrl: string;
@@ -54,5 +61,28 @@ export const useVideoStore = defineStore('video', {
54
61
  previewImageUrl: `${CDN_GETTY_S3_URL_PREFIX}/public/${state.gettyImagesKeyPrefix}/${token}/${token}_optimised_thumb`,
55
62
  };
56
63
  },
64
+ hasReachedLimitForVideo() {
65
+ // Looking through the bp maker store as the video-store isn't aware of removals
66
+ const brandPageMakerStore = useBrandPageMakerStore();
67
+ const brandPageData = cloneDeep(brandPageMakerStore.brandPageData);
68
+
69
+ const gettyAssetIds = findValuesByKey(brandPageData, 'gettyAssetId');
70
+
71
+ return gettyAssetIds.length >= GETTY_VIDEO_LIMIT_FOR_SITE;
72
+ },
73
+ canAddNewVideo() {
74
+ const userStore = useBrandPageMakerUserStore();
75
+ const brandPageContainerStore = useBrandPageContainerStore();
76
+
77
+ const canUseGettyVideos = userStore.features.canUseGettyVideos;
78
+ const isPrePurchase = brandPageContainerStore.isPrePurchase;
79
+
80
+ const hasPremiumSubscription = userStore.hasPremiumSubscription;
81
+
82
+ return (
83
+ canUseGettyVideos &&
84
+ (userStore.isAdmin || isPrePurchase || hasPremiumSubscription)
85
+ );
86
+ },
57
87
  },
58
88
  });
@@ -920,9 +920,22 @@
920
920
  "continueLabel": "Weiter"
921
921
  },
922
922
  "videoLibrary": {
923
+ "categories": {
924
+ "aerial": "Luftaufnahme",
925
+ "beach": "Strand",
926
+ "business": "Unternehmen",
927
+ "cities": "Städte",
928
+ "landscape": "Landschaft",
929
+ "nature": "Natur",
930
+ "people": "Menschen",
931
+ "plants": "Pflanzen",
932
+ "sky": "Himmel",
933
+ "sunrise": "Sonnenaufgang"
934
+ },
923
935
  "poweredBy": "Powered by",
924
936
  "emptyState": "Ihr Browser unterstützt keine eingebetteten Videos.",
925
937
  "loadMoreVideos": "Weitere Videos laden",
926
- "supported": "Ihr Browser unterstützt keine eingebetteten Videos."
938
+ "supported": "Ihr Browser unterstützt keine eingebetteten Videos.",
939
+ "limitMessage": "Sie haben das Videolimit erreicht. Jede Seite unterstützt bis zu {{ videoLimit }} Videos. Entfernen Sie eines, um ein weiteres hinzuzufügen."
927
940
  }
928
941
  }
@@ -920,9 +920,22 @@
920
920
  "continueLabel": "Continuar"
921
921
  },
922
922
  "videoLibrary": {
923
+ "categories": {
924
+ "aerial": "Aéreo",
925
+ "beach": "Playa",
926
+ "business": "Negocio",
927
+ "cities": "Ciudades",
928
+ "landscape": "Paisaje",
929
+ "nature": "Naturaleza",
930
+ "people": "Personas",
931
+ "plants": "Plantas",
932
+ "sky": "Cielo",
933
+ "sunrise": "Amanecer"
934
+ },
923
935
  "poweredBy": "Desarrollado por",
924
936
  "emptyState": "Lo sentimos, tu navegador no admite vídeos incrustados.",
925
937
  "loadMoreVideos": "Carga más vídeos",
926
- "supported": "Lo sentimos, tu navegador no admite vídeos incrustados."
938
+ "supported": "Lo sentimos, tu navegador no admite vídeos incrustados.",
939
+ "limitMessage": "Has alcanzado el límite de vídeos. Cada sitio admite hasta {{ videoLimit }} vídeos; elimina uno para añadir otro."
927
940
  }
928
941
  }