@designcrowd/library.brand-page 5.16.28-enable-getty-21 → 5.16.28-enable-getty-22

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 (26) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-CE5S6d8I.js → CreatedOnBrandCrowd-de-de-DnlCzna3.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BMpWHpwo.js → CreatedOnBrandCrowd-en-us-DOL1II-q.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BBmGCX0e.js → CreatedOnBrandCrowd-es-es-g-zdO3ZO.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-BbKrGU2C.js → CreatedOnBrandCrowd-fr-ca-C-nQM0wG.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-BbKrGU2C.js → CreatedOnBrandCrowd-fr-fr-C-nQM0wG.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-ByrqZQUg.js → CreatedOnBrandCrowd-pt-br-o2s8-idR.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-ByrqZQUg.js → CreatedOnBrandCrowd-pt-pt-o2s8-idR.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CJ756qMq.js → CreatedOnDcom-de-de-4EqAh1TX.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-w34kflwP.js → CreatedOnDcom-en-us-DyMJMAYg.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-B3iST2Ke.js → CreatedOnDcom-es-es-DXwqkIAW.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-hi7sAjqE.js → CreatedOnDcom-fr-ca-CyMsiBTY.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-CD08tZDw.js → CreatedOnDcom-fr-fr-BXaJU8C0.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DtlO98AF.js → CreatedOnDcom-pt-br-DgWuLwtT.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-DS-KW_Jh.js → CreatedOnDcom-pt-pt-BMtrszVp.js} +1 -1
  15. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -14
  16. package/lib/src/brand-page-maker/stores/video/video-store.d.ts +2 -10
  17. package/lib/src/brand-page-maker/stores/video/video-store.js +5 -3
  18. package/lib/src/index.mjs +1 -1
  19. package/lib/src/{lib-BDoA2XDn.js → lib-DZS681yZ.js} +40 -36
  20. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -14
  21. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.js +9 -10
  22. package/package.json +1 -1
  23. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +2 -1
  24. package/src/brand-page-maker/stores/video/video-store.ts +8 -3
  25. package/src/shared/background-settings/components/ReplaceImageSettingsForBackgroundSettings.vue +13 -12
  26. package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.ts +13 -16
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-BDoA2XDn.js";
2
+ import { _ as t } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as t } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as t } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as t } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as t } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as t } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as t } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as e } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as e } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as e } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as e } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as e } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as M } from "./lib-DZS681yZ.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-BDoA2XDn.js";
2
+ import { _ as M } from "./lib-DZS681yZ.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1192,20 +1192,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1192
1192
  videoUrl: string;
1193
1193
  previewImageUrl: string;
1194
1194
  };
1195
- isLimitForGettyVideosReached: (state: {
1196
- videoUrls: {
1197
- [x: string]: import("../../stores").VideoUrlData;
1198
- };
1199
- gettyImagesKeyPrefix: string;
1200
- shouldPlayVideos: boolean;
1201
- } & import("pinia").PiniaCustomStateProperties<import("../../stores").videoStoreState>) => () => boolean;
1202
- isPostPurchaseGettyVideoLocked: (state: {
1203
- videoUrls: {
1204
- [x: string]: import("../../stores").VideoUrlData;
1205
- };
1206
- gettyImagesKeyPrefix: string;
1207
- shouldPlayVideos: boolean;
1208
- } & import("pinia").PiniaCustomStateProperties<import("../../stores").videoStoreState>) => () => boolean;
1195
+ hasReachedLimitForVideo(): boolean;
1196
+ canAddNewVideo(): boolean;
1209
1197
  }, {
1210
1198
  setVideoUrlsWithToken(token: string, videoUrl: string, previewImageUrl: string, assetId: string): void;
1211
1199
  setGettyImageKeyPrefix(prefix: string): void;
@@ -32,16 +32,8 @@ export declare const useVideoStore: import("pinia").StoreDefinition<"video", vid
32
32
  videoUrl: string;
33
33
  previewImageUrl: string;
34
34
  };
35
- isLimitForGettyVideosReached: (state: {
36
- videoUrls: VideoUrls;
37
- gettyImagesKeyPrefix: string;
38
- shouldPlayVideos: boolean;
39
- } & import("pinia").PiniaCustomStateProperties<videoStoreState>) => () => boolean;
40
- isPostPurchaseGettyVideoLocked: (state: {
41
- videoUrls: VideoUrls;
42
- gettyImagesKeyPrefix: string;
43
- shouldPlayVideos: boolean;
44
- } & import("pinia").PiniaCustomStateProperties<videoStoreState>) => () => boolean;
35
+ hasReachedLimitForVideo(): boolean;
36
+ canAddNewVideo(): boolean;
45
37
  }, {
46
38
  setVideoUrlsWithToken(token: string, videoUrl: string, previewImageUrl: string, assetId: string): void;
47
39
  setGettyImageKeyPrefix(prefix: string): void;
@@ -39,19 +39,21 @@ export const useVideoStore = defineStore('video', {
39
39
  previewImageUrl: `${CDN_GETTY_S3_URL_PREFIX}/public/${state.gettyImagesKeyPrefix}/${token}/${token}_optimised_thumb`,
40
40
  };
41
41
  },
42
- isLimitForGettyVideosReached: (state) => () => {
42
+ hasReachedLimitForVideo() {
43
43
  // Looking through the bp maker store as the video-store isn't aware of removals
44
44
  const brandPageMakerStore = useBrandPageMakerStore();
45
45
  const brandPageData = cloneDeep(brandPageMakerStore.brandPageData);
46
46
  const gettyAssetIds = findValuesByKey(brandPageData, 'gettyAssetId');
47
47
  return gettyAssetIds.length >= GETTY_VIDEO_LIMIT_FOR_SITE;
48
48
  },
49
- isPostPurchaseGettyVideoLocked: (state) => () => {
49
+ canAddNewVideo() {
50
50
  const userStore = useBrandPageMakerUserStore();
51
51
  const brandPageContainerStore = useBrandPageContainerStore();
52
52
  const canUseGettyVideos = userStore.features.canUseGettyVideos;
53
53
  const isPrePurchase = brandPageContainerStore.isPrePurchase;
54
- return !canUseGettyVideos && !isPrePurchase;
54
+ const hasPremiumSubscription = userStore.hasPremiumSubscription;
55
+ return (canUseGettyVideos &&
56
+ (userStore.isAdmin || isPrePurchase || hasPremiumSubscription));
55
57
  },
56
58
  },
57
59
  });
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { bH as E, av as T, aY as s, a9 as I, an as N, am as S, aj as e, bx as A, bO as O, cf as G, ce as C, cd as D, c7 as P, b6 as t, b5 as R, bT as L, bU as M, b$ as o, bQ as r, bS as b, bR as n, bV as F, bW as i, c6 as l, c4 as B, au as g, c5 as Y, ac as U, b1 as c, b3 as d, b2 as u, e as H, f as p, B as y, a3 as K, d as V, a4 as k, j as m, ar as X, a2 as v, bw as h, bP as W, aC as x, a_ as f, aW as z, c2 as Z, c1 as w, C as Q, b9 as j, D as q, b as J, a as $, bZ as aa, b8 as _a, a$ as Ea, aX as Ta, cb as sa, cc as Ia, c0 as Na, bL as Sa, ah as ea, c3 as Aa, c8 as Oa, be as Ga, aO as Ca, bk as Da, F as Pa, ab as ta, aa as Ra, h as La, a5 as Ma, bb as oa, aZ as ra, aV as ba, a7 as na, ao as Fa, l as ia, R as la, H as Ba, ad as ga, bI as Ya, bf as Ua, bg as ca, bG as da, bm as ua, bo as Ha, ba as pa, L as ya, aN as Ka, bt as Va, aT as ka, bs as ma, aw as Xa, af as va, b_ as ha, c9 as Wa, ca as xa, b0 as fa, N as za, aF as Za, aE as wa, aG as Qa, aA as ja, aB as qa, aD as Ja, bi as $a, bp as a_, bc as __, p as E_, ap as T_, aq as s_, ak as I_, al as N_, ai as S_, a8 as e_, m as A_, bu as O_, at as G_, bM as C_, bN as D_, bY as P_, ag as t_, bK as R_, bv as L_, n as M_, S as o_, P as r_, aM as b_, bJ as n_, bj as F_, bB as i_, bA as l_, bD as B_, by as g_, bE as Y_, bF as U_, bz as c_, bC as d_, aH as u_, aI as H_, br as p_, bq as y_, aK as K_, aL as V_, aQ as k_, b4 as m_, aP as X_, aR as v_, U as h_, ae as W_, aU as x_, k as f_, o as z_, bh as Z_, as as w_, bd as Q_, bl as j_, bn as q_, b7 as J_, w as $_, W as aE, a6 as _E, g as EE, bX as TE, t as sE, v as IE, T as NE, a1 as SE, aJ as eE, aS as AE, ay as OE, q as GE, $ as CE, u as DE, A as PE, ax as tE, i as RE, az as LE, c as ME, r as oE, y as rE, x as bE, z as nE, Z as FE, V as iE, s as lE, a0 as BE, J as gE, E as YE, G as UE, Y as cE, K as dE, X as uE, M as HE, Q as pE, I as yE, O as KE } from "./lib-BDoA2XDn.js";
1
+ import { bH as E, av as T, aY as s, a9 as I, an as N, am as S, aj as e, bx as A, bO as O, cf as G, ce as C, cd as D, c7 as P, b6 as t, b5 as R, bT as L, bU as M, b$ as o, bQ as r, bS as b, bR as n, bV as F, bW as i, c6 as l, c4 as B, au as g, c5 as Y, ac as U, b1 as c, b3 as d, b2 as u, e as H, f as p, B as y, a3 as K, d as V, a4 as k, j as m, ar as X, a2 as v, bw as h, bP as W, aC as x, a_ as f, aW as z, c2 as Z, c1 as w, C as Q, b9 as j, D as q, b as J, a as $, bZ as aa, b8 as _a, a$ as Ea, aX as Ta, cb as sa, cc as Ia, c0 as Na, bL as Sa, ah as ea, c3 as Aa, c8 as Oa, be as Ga, aO as Ca, bk as Da, F as Pa, ab as ta, aa as Ra, h as La, a5 as Ma, bb as oa, aZ as ra, aV as ba, a7 as na, ao as Fa, l as ia, R as la, H as Ba, ad as ga, bI as Ya, bf as Ua, bg as ca, bG as da, bm as ua, bo as Ha, ba as pa, L as ya, aN as Ka, bt as Va, aT as ka, bs as ma, aw as Xa, af as va, b_ as ha, c9 as Wa, ca as xa, b0 as fa, N as za, aF as Za, aE as wa, aG as Qa, aA as ja, aB as qa, aD as Ja, bi as $a, bp as a_, bc as __, p as E_, ap as T_, aq as s_, ak as I_, al as N_, ai as S_, a8 as e_, m as A_, bu as O_, at as G_, bM as C_, bN as D_, bY as P_, ag as t_, bK as R_, bv as L_, n as M_, S as o_, P as r_, aM as b_, bJ as n_, bj as F_, bB as i_, bA as l_, bD as B_, by as g_, bE as Y_, bF as U_, bz as c_, bC as d_, aH as u_, aI as H_, br as p_, bq as y_, aK as K_, aL as V_, aQ as k_, b4 as m_, aP as X_, aR as v_, U as h_, ae as W_, aU as x_, k as f_, o as z_, bh as Z_, as as w_, bd as Q_, bl as j_, bn as q_, b7 as J_, w as $_, W as aE, a6 as _E, g as EE, bX as TE, t as sE, v as IE, T as NE, a1 as SE, aJ as eE, aS as AE, ay as OE, q as GE, $ as CE, u as DE, A as PE, ax as tE, i as RE, az as LE, c as ME, r as oE, y as rE, x as bE, z as nE, Z as FE, V as iE, s as lE, a0 as BE, J as gE, E as YE, G as UE, Y as cE, K as dE, X as uE, M as HE, Q as pE, I as yE, O as KE } from "./lib-DZS681yZ.js";
2
2
  import { createPinia as kE, setActivePinia as mE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,
@@ -59758,10 +59758,10 @@ const fn = /* @__PURE__ */ _5(fV1), gV1 = (e, t, n) => {
59758
59758
  ut(() => n.context.isDesignCom, async () => {
59759
59759
  const S = A4().toLowerCase(), M = n.context.isDesignCom ? "Dcom" : "BrandCrowd";
59760
59760
  try {
59761
- const { default: _ } = await yM(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-CE5S6d8I.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BMpWHpwo.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-BBmGCX0e.js"), "./watermark/CreatedOnBrandCrowd-fr-ca.vue": () => import("./CreatedOnBrandCrowd-fr-ca-BbKrGU2C.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-BbKrGU2C.js"), "./watermark/CreatedOnBrandCrowd-pt-br.vue": () => import("./CreatedOnBrandCrowd-pt-br-ByrqZQUg.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-ByrqZQUg.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-CJ756qMq.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-w34kflwP.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-B3iST2Ke.js"), "./watermark/CreatedOnDcom-fr-ca.vue": () => import("./CreatedOnDcom-fr-ca-hi7sAjqE.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-CD08tZDw.js"), "./watermark/CreatedOnDcom-pt-br.vue": () => import("./CreatedOnDcom-pt-br-DtlO98AF.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-DS-KW_Jh.js") }), `./watermark/CreatedOn${M}-${S}.vue`, 3);
59761
+ const { default: _ } = await yM(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-de-de.vue": () => import("./CreatedOnBrandCrowd-de-de-DnlCzna3.js"), "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-DOL1II-q.js"), "./watermark/CreatedOnBrandCrowd-es-es.vue": () => import("./CreatedOnBrandCrowd-es-es-g-zdO3ZO.js"), "./watermark/CreatedOnBrandCrowd-fr-ca.vue": () => import("./CreatedOnBrandCrowd-fr-ca-C-nQM0wG.js"), "./watermark/CreatedOnBrandCrowd-fr-fr.vue": () => import("./CreatedOnBrandCrowd-fr-fr-C-nQM0wG.js"), "./watermark/CreatedOnBrandCrowd-pt-br.vue": () => import("./CreatedOnBrandCrowd-pt-br-o2s8-idR.js"), "./watermark/CreatedOnBrandCrowd-pt-pt.vue": () => import("./CreatedOnBrandCrowd-pt-pt-o2s8-idR.js"), "./watermark/CreatedOnDcom-de-de.vue": () => import("./CreatedOnDcom-de-de-4EqAh1TX.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-DyMJMAYg.js"), "./watermark/CreatedOnDcom-es-es.vue": () => import("./CreatedOnDcom-es-es-DXwqkIAW.js"), "./watermark/CreatedOnDcom-fr-ca.vue": () => import("./CreatedOnDcom-fr-ca-CyMsiBTY.js"), "./watermark/CreatedOnDcom-fr-fr.vue": () => import("./CreatedOnDcom-fr-fr-BXaJU8C0.js"), "./watermark/CreatedOnDcom-pt-br.vue": () => import("./CreatedOnDcom-pt-br-DgWuLwtT.js"), "./watermark/CreatedOnDcom-pt-pt.vue": () => import("./CreatedOnDcom-pt-pt-BMtrszVp.js") }), `./watermark/CreatedOn${M}-${S}.vue`, 3);
59762
59762
  i.value = _;
59763
59763
  } catch {
59764
- const { default: V } = await yM(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-BMpWHpwo.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-w34kflwP.js") }), `./watermark/CreatedOn${M}-en-us.vue`, 3);
59764
+ const { default: V } = await yM(/* @__PURE__ */ Object.assign({ "./watermark/CreatedOnBrandCrowd-en-us.vue": () => import("./CreatedOnBrandCrowd-en-us-DOL1II-q.js"), "./watermark/CreatedOnDcom-en-us.vue": () => import("./CreatedOnDcom-en-us-DyMJMAYg.js") }), `./watermark/CreatedOn${M}-en-us.vue`, 3);
59765
59765
  i.value = V;
59766
59766
  }
59767
59767
  }, {
@@ -71082,13 +71082,13 @@ const BM = /* @__PURE__ */ _5(_U1), OM = Object.freeze({
71082
71082
  videoUrl: `${xr}/public/${e.gettyImagesKeyPrefix}/${t}/${t}_optimised`,
71083
71083
  previewImageUrl: `${xr}/public/${e.gettyImagesKeyPrefix}/${t}/${t}_optimised_thumb`
71084
71084
  }),
71085
- isLimitForGettyVideosReached: (e) => () => {
71086
- const t = oe(), n = e2(t.brandPageData);
71087
- return o0(n, "gettyAssetId").length >= Mg;
71085
+ hasReachedLimitForVideo() {
71086
+ const e = oe(), t = e2(e.brandPageData);
71087
+ return o0(t, "gettyAssetId").length >= Mg;
71088
71088
  },
71089
- isPostPurchaseGettyVideoLocked: (e) => () => {
71090
- const t = xe(), n = we(), i = t.features.canUseGettyVideos, o = n.isPrePurchase;
71091
- return !i && !o;
71089
+ canAddNewVideo() {
71090
+ const e = xe(), t = we(), n = e.features.canUseGettyVideos, i = t.isPrePurchase, o = e.hasPremiumSubscription;
71091
+ return n && (e.isAdmin || i || o);
71092
71092
  }
71093
71093
  }
71094
71094
  }), MU1 = [
@@ -83990,20 +83990,22 @@ const TY1 = {
83990
83990
  backgroundMode: C2.edit
83991
83991
  });
83992
83992
  }, M = async (_) => {
83993
- var V, H;
83994
- if (r.isLimitForGettyVideosReached() && ((V = m.value) == null ? void 0 : V.type) !== "getty-video") {
83995
- window.alert(
83996
- F8("limitMessage", {
83997
- videoLimit: Mg
83998
- })
83999
- );
84000
- return;
84001
- }
84002
- if (r.isPostPurchaseGettyVideoLocked() && ((H = m.value) == null ? void 0 : H.type) !== "getty-video") {
84003
- await a.triggerLockedContentClickedEvent({
84004
- type: "getty_video"
84005
- });
84006
- return;
83993
+ var H;
83994
+ if (!(((H = m.value) == null ? void 0 : H.type) === "getty-video")) {
83995
+ if (!r.canAddNewVideo) {
83996
+ await a.triggerLockedContentClickedEvent({
83997
+ type: "getty_video"
83998
+ });
83999
+ return;
84000
+ }
84001
+ if (r.hasReachedLimitForVideo) {
84002
+ window.alert(
84003
+ F8("limitMessage", {
84004
+ videoLimit: Mg
84005
+ })
84006
+ );
84007
+ return;
84008
+ }
84007
84009
  }
84008
84010
  s.setBackgroundMedia(_), s.setBackgroundMode({
84009
84011
  backgroundMode: C2.edit
@@ -95152,20 +95154,22 @@ const Qoe = /* @__PURE__ */ v(Goe, [["render", Joe]]), Xk = J({
95152
95154
  }), this.contentSettingsStore.popMode();
95153
95155
  },
95154
95156
  async onVideoSelected(e) {
95155
- var t, n, i, o, s, r, a, l;
95156
- if (console.log("SELECTED ITEM: ", this.selectedItem), this.videoStore.isLimitForGettyVideosReached() && ((o = (i = (n = (t = this.selectedItem) == null ? void 0 : t.settings) == null ? void 0 : n.content) == null ? void 0 : i.media) == null ? void 0 : o.type) !== "getty-video") {
95157
- window.alert(
95158
- F8("limitMessage", {
95159
- videoLimit: Mg
95160
- })
95161
- );
95162
- return;
95163
- }
95164
- if (this.videoStore.isPostPurchaseGettyVideoLocked() && ((l = (a = (r = (s = this.selectedItem) == null ? void 0 : s.settings) == null ? void 0 : r.content) == null ? void 0 : a.media) == null ? void 0 : l.type) !== "getty-video") {
95165
- await this.contentSettingsStore.triggerLockedContentClickedEvent({
95166
- type: "getty_video"
95167
- });
95168
- return;
95157
+ var n, i, o, s;
95158
+ if (console.log("SELECTED ITEM: ", this.selectedItem), !(((s = (o = (i = (n = this.selectedItem) == null ? void 0 : n.settings) == null ? void 0 : i.content) == null ? void 0 : o.media) == null ? void 0 : s.type) === "getty-video")) {
95159
+ if (!this.videoStore.canAddNewVideo) {
95160
+ await this.contentSettingsStore.triggerLockedContentClickedEvent({
95161
+ type: "getty_video"
95162
+ });
95163
+ return;
95164
+ }
95165
+ if (this.videoStore.hasReachedLimitForVideo) {
95166
+ window.alert(
95167
+ F8("limitMessage", {
95168
+ videoLimit: Mg
95169
+ })
95170
+ );
95171
+ return;
95172
+ }
95169
95173
  }
95170
95174
  this.contentSettingsStore.setSelectedItemMedia(
95171
95175
  this.selectedItemId,
@@ -714,20 +714,8 @@ declare const _default: import("vue").DefineComponent<{}, {
714
714
  videoUrl: string;
715
715
  previewImageUrl: string;
716
716
  };
717
- isLimitForGettyVideosReached: (state: {
718
- videoUrls: {
719
- [x: string]: import("../../../../brand-page-maker/stores").VideoUrlData;
720
- };
721
- gettyImagesKeyPrefix: string;
722
- shouldPlayVideos: boolean;
723
- } & import("pinia").PiniaCustomStateProperties<import("../../../../brand-page-maker/stores").videoStoreState>) => () => boolean;
724
- isPostPurchaseGettyVideoLocked: (state: {
725
- videoUrls: {
726
- [x: string]: import("../../../../brand-page-maker/stores").VideoUrlData;
727
- };
728
- gettyImagesKeyPrefix: string;
729
- shouldPlayVideos: boolean;
730
- } & import("pinia").PiniaCustomStateProperties<import("../../../../brand-page-maker/stores").videoStoreState>) => () => boolean;
717
+ hasReachedLimitForVideo(): boolean;
718
+ canAddNewVideo(): boolean;
731
719
  }, {
732
720
  setVideoUrlsWithToken(token: string, videoUrl: string, previewImageUrl: string, assetId: string): void;
733
721
  setGettyImageKeyPrefix(prefix: string): void;
@@ -190,21 +190,20 @@ export default defineComponent({
190
190
  },
191
191
  async onVideoSelected(videoPayload) {
192
192
  console.log('SELECTED ITEM: ', this.selectedItem);
193
- if (this.videoStore.isLimitForGettyVideosReached()) {
194
- if (this.selectedItem?.settings?.content?.media?.type !== 'getty-video') {
195
- window.alert(videoLibraryTr(`limitMessage`, {
196
- videoLimit: GETTY_VIDEO_LIMIT_FOR_SITE,
197
- }));
198
- return;
199
- }
200
- }
201
- if (this.videoStore.isPostPurchaseGettyVideoLocked()) {
202
- if (this.selectedItem?.settings?.content?.media?.type !== 'getty-video') {
193
+ const isCurrentlyVideoMedia = this.selectedItem?.settings?.content?.media?.type === 'getty-video';
194
+ if (!isCurrentlyVideoMedia) {
195
+ if (!this.videoStore.canAddNewVideo) {
203
196
  await this.contentSettingsStore.triggerLockedContentClickedEvent({
204
197
  type: 'getty_video',
205
198
  });
206
199
  return;
207
200
  }
201
+ if (this.videoStore.hasReachedLimitForVideo) {
202
+ window.alert(videoLibraryTr(`limitMessage`, {
203
+ videoLimit: GETTY_VIDEO_LIMIT_FOR_SITE,
204
+ }));
205
+ return;
206
+ }
208
207
  }
209
208
  this.contentSettingsStore.setSelectedItemMedia(this.selectedItemId, videoPayload);
210
209
  this.contentSettingsStore.popMode();
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.28-enable-getty-21",
4
+ "version": "5.16.28-enable-getty-22",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -3,6 +3,7 @@ import {
3
3
  BRAND_PAGE,
4
4
  INITIALISE_PAYLOAD,
5
5
  USER_FEATURES,
6
+ userFeatures,
6
7
  } from '../../components/brand-page-maker/__fixtures__';
7
8
  import {
8
9
  BrandPageModel,
@@ -116,7 +117,7 @@ describe('brand page maker store module', () => {
116
117
 
117
118
  userStore.setUserState({
118
119
  features: {
119
- ...USER_FEATURES,
120
+ ...userFeatures,
120
121
  showBrandCrowdLogo: false,
121
122
  },
122
123
  });
@@ -61,7 +61,7 @@ export const useVideoStore = defineStore('video', {
61
61
  previewImageUrl: `${CDN_GETTY_S3_URL_PREFIX}/public/${state.gettyImagesKeyPrefix}/${token}/${token}_optimised_thumb`,
62
62
  };
63
63
  },
64
- isLimitForGettyVideosReached: (state) => () => {
64
+ hasReachedLimitForVideo() {
65
65
  // Looking through the bp maker store as the video-store isn't aware of removals
66
66
  const brandPageMakerStore = useBrandPageMakerStore();
67
67
  const brandPageData = cloneDeep(brandPageMakerStore.brandPageData);
@@ -70,14 +70,19 @@ export const useVideoStore = defineStore('video', {
70
70
 
71
71
  return gettyAssetIds.length >= GETTY_VIDEO_LIMIT_FOR_SITE;
72
72
  },
73
- isPostPurchaseGettyVideoLocked: (state) => () => {
73
+ canAddNewVideo() {
74
74
  const userStore = useBrandPageMakerUserStore();
75
75
  const brandPageContainerStore = useBrandPageContainerStore();
76
76
 
77
77
  const canUseGettyVideos = userStore.features.canUseGettyVideos;
78
78
  const isPrePurchase = brandPageContainerStore.isPrePurchase;
79
79
 
80
- return !canUseGettyVideos && !isPrePurchase;
80
+ const hasPremiumSubscription = userStore.hasPremiumSubscription;
81
+
82
+ return (
83
+ canUseGettyVideos &&
84
+ (userStore.isAdmin || isPrePurchase || hasPremiumSubscription)
85
+ );
81
86
  },
82
87
  },
83
88
  });
@@ -133,8 +133,19 @@ const onDesignSelected = (image: UserMediaItemWithDimensions) => {
133
133
  };
134
134
 
135
135
  const onVideoSelected = async (videoPayload: MediaBaseSelectedPayload) => {
136
- if (videoStore.isLimitForGettyVideosReached()) {
137
- if (backgroundMedia.value?.type !== 'getty-video') {
136
+ const isCurrentlyVideoBackground =
137
+ backgroundMedia.value?.type === 'getty-video';
138
+
139
+ if (!isCurrentlyVideoBackground) {
140
+ if (!videoStore.canAddNewVideo) {
141
+ await contentSettingsStore.triggerLockedContentClickedEvent({
142
+ type: 'getty_video',
143
+ });
144
+
145
+ return;
146
+ }
147
+
148
+ if (videoStore.hasReachedLimitForVideo) {
138
149
  window.alert(
139
150
  videoLibraryTr(`limitMessage`, {
140
151
  videoLimit: GETTY_VIDEO_LIMIT_FOR_SITE,
@@ -145,16 +156,6 @@ const onVideoSelected = async (videoPayload: MediaBaseSelectedPayload) => {
145
156
  }
146
157
  }
147
158
 
148
- if (videoStore.isPostPurchaseGettyVideoLocked()) {
149
- if (backgroundMedia.value?.type !== 'getty-video') {
150
- await contentSettingsStore.triggerLockedContentClickedEvent({
151
- type: 'getty_video',
152
- });
153
-
154
- return;
155
- }
156
- }
157
-
158
159
  backgroundSettingsStore.setBackgroundMedia(videoPayload);
159
160
 
160
161
  backgroundSettingsStore.setBackgroundMode({
@@ -250,10 +250,19 @@ export default defineComponent({
250
250
  async onVideoSelected(videoPayload: MediaBaseSelectedPayload) {
251
251
  console.log('SELECTED ITEM: ', this.selectedItem);
252
252
 
253
- if (this.videoStore.isLimitForGettyVideosReached()) {
254
- if (
255
- this.selectedItem?.settings?.content?.media?.type !== 'getty-video'
256
- ) {
253
+ const isCurrentlyVideoMedia =
254
+ this.selectedItem?.settings?.content?.media?.type === 'getty-video';
255
+
256
+ if (!isCurrentlyVideoMedia) {
257
+ if (!this.videoStore.canAddNewVideo) {
258
+ await this.contentSettingsStore.triggerLockedContentClickedEvent({
259
+ type: 'getty_video',
260
+ });
261
+
262
+ return;
263
+ }
264
+
265
+ if (this.videoStore.hasReachedLimitForVideo) {
257
266
  window.alert(
258
267
  videoLibraryTr(`limitMessage`, {
259
268
  videoLimit: GETTY_VIDEO_LIMIT_FOR_SITE,
@@ -264,18 +273,6 @@ export default defineComponent({
264
273
  }
265
274
  }
266
275
 
267
- if (this.videoStore.isPostPurchaseGettyVideoLocked()) {
268
- if (
269
- this.selectedItem?.settings?.content?.media?.type !== 'getty-video'
270
- ) {
271
- await this.contentSettingsStore.triggerLockedContentClickedEvent({
272
- type: 'getty_video',
273
- });
274
-
275
- return;
276
- }
277
- }
278
-
279
276
  this.contentSettingsStore.setSelectedItemMedia(
280
277
  this.selectedItemId,
281
278
  videoPayload,