@designcrowd/library.brand-page 6.1.0 → 6.1.1-ast-preview-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-CW5bD06L.js → CreatedOnBrandCrowd-de-de-DbkDeR-_.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CofG4e3V.js → CreatedOnBrandCrowd-en-us-CN0o9YUM.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-XpL0-LWx.js → CreatedOnBrandCrowd-es-es-DX5GXuxd.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-dlVN3zaX.js → CreatedOnBrandCrowd-fr-ca-CA5o_w74.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-dlVN3zaX.js → CreatedOnBrandCrowd-fr-fr-CA5o_w74.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-98gqdDVF.js → CreatedOnBrandCrowd-pt-br-_1uO5jxn.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-98gqdDVF.js → CreatedOnBrandCrowd-pt-pt-_1uO5jxn.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-Dbmlc0i1.js → CreatedOnDcom-de-de-DAPvckVD.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Dy9z7h1o.js → CreatedOnDcom-en-us-DT1NE0ly.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-B3ksvNj9.js → CreatedOnDcom-es-es-C_HyK7sW.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-CC9ieRzX.js → CreatedOnDcom-fr-ca-C6YuMchy.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BtnGJjF2.js → CreatedOnDcom-fr-fr-roY7f_KU.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DT4doFYO.js → CreatedOnDcom-pt-br-CTL6XIe5.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-CloXyOe6.js → CreatedOnDcom-pt-pt-Dv8Rlt1U.js} +1 -1
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +5 -3
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +6 -4
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.d.ts +1 -0
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.js +4 -1
- package/lib/src/brand-page/components/payment/Payment.mixin.js +4 -3
- package/lib/src/brand-page/components/payment/__fixtures__/request-payment.d.ts +1 -0
- package/lib/src/brand-page/components/payment/__fixtures__/support-me.d.ts +1 -0
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.d.ts +1 -0
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.js +4 -1
- package/lib/src/brand-page/composables/consent.composable.d.ts +2 -0
- package/lib/src/brand-page/composables/consent.composable.js +9 -3
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +9 -0
- package/lib/src/brand-page/models/brand-page-context.model.js +12 -0
- package/lib/src/brand-page/utils/context.util.d.ts +8 -0
- package/lib/src/brand-page/utils/context.util.js +8 -0
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +2 -0
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.js +14 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +135 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +50 -0
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +130 -0
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.d.ts +1 -0
- package/lib/src/brand-page-maker/components/navigation/Navigation.mixin.js +3 -0
- package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +14 -0
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +130 -0
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +130 -0
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +130 -0
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +130 -0
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +130 -0
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +51 -18
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +130 -0
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/useEventTracker.js +1 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +132 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +30 -6
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +9 -3
- package/lib/src/brand-page-maker/stores/ui/ui-store.d.ts +1 -1
- package/lib/src/bundled-translations-D42tE0D2.js +179 -0
- package/lib/src/bundled-translations.de-DE-D9aWGgFt.js +179 -0
- package/lib/src/bundled-translations.es-ES-lk4B0xQ7.js +179 -0
- package/lib/src/bundled-translations.fr-CA-DhOBNt6q.js +179 -0
- package/lib/src/bundled-translations.fr-FR-CnpafQeG.js +179 -0
- package/lib/src/bundled-translations.pt-BR-C4PnKrd9.js +179 -0
- package/lib/src/bundled-translations.pt-PT-CfKDVQC-.js +179 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +5 -0
- package/lib/src/bundles/bundled-translations.es-ES.json +5 -0
- package/lib/src/bundles/bundled-translations.fr-CA.json +5 -0
- package/lib/src/bundles/bundled-translations.fr-FR.json +5 -0
- package/lib/src/bundles/bundled-translations.json +5 -0
- package/lib/src/bundles/bundled-translations.pt-BR.json +5 -0
- package/lib/src/bundles/bundled-translations.pt-PT.json +5 -0
- package/lib/src/clients/brand-page-client.d.ts +1 -0
- package/lib/src/clients/models.d.ts +2 -0
- package/lib/src/composables/useTranslate.d.ts +2 -1
- package/lib/src/composables/useTranslate.js +2 -1
- package/lib/src/constants/brand-page-maker.d.ts +2 -0
- package/lib/src/constants/brand-page-maker.js +5 -0
- package/lib/src/constants/live-preview.constants.d.ts +9 -0
- package/lib/src/constants/live-preview.constants.js +8 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +339 -206
- package/lib/src/css/library.brand-page-brandPage.min.css +343 -206
- package/lib/src/css/library.brand-page-designCom.min.css +339 -206
- package/lib/src/css/library.brand-page-preview.min.css +339 -206
- package/lib/src/index.d.ts +3 -1
- package/lib/src/index.mjs +222 -217
- package/lib/src/{lib-D7ubPlpu.js → lib-BgSRyyCN.js} +23834 -23426
- package/lib/src/lib.js +3 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +130 -0
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +130 -0
- package/lib/src/shared/logo-versions/LogoVersions.mixin.d.ts +1 -1
- package/lib/src/shared/my-designs/MyDesigns.mixin.d.ts +1 -1
- package/lib/src/shared/my-uploads/MyMedia.mixin.d.ts +1 -1
- package/lib/src/shared/my-uploads/MyUploads.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +131 -1
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +131 -1
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +144 -0
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +130 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +131 -1
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +1 -1
- package/lib/src/shared/template-settings/store/template-settings-store.d.ts +2 -0
- package/lib/src/shared/template-settings/store/template-settings-store.js +72 -24
- package/lib/src/shared/unsplash-library/UnsplashLibrary.mixin.d.ts +1 -1
- package/lib/src/tracker.mjs +1 -1
- package/lib/src/{useEventTracker-DmQ6AkNn.js → useEventTracker-Dmc2jFdN.js} +5 -4
- package/package.json +1 -1
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +7 -2
- package/src/brand-page/components/cookie-consent/CookieConsent.vue +1 -0
- package/src/brand-page/components/image-gallery/masonry/MasonryGallery.vue +1 -0
- package/src/brand-page/components/images-section/ImagesSection.vue +10 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +8 -3
- package/src/brand-page/components/media/Video.vue +4 -0
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +5 -1
- package/src/brand-page/components/page-footer/PageFooter.mixin.ts +4 -1
- package/src/brand-page/components/page-footer/PageFooter.vue +1 -1
- package/src/brand-page/components/payment/Payment.mixin.ts +4 -3
- package/src/brand-page/components/payment/Payment.vue +3 -0
- package/src/brand-page/components/payment/request-payment/RequestPayment.mixin.ts +8 -1
- package/src/brand-page/components/payment/request-payment/RequestPayment.vue +2 -1
- package/src/brand-page/components/payment/support-me/SupportMe.vue +3 -0
- package/src/brand-page/components/save-contact/SaveContactWidget.vue +2 -1
- package/src/brand-page/components/shop/Shop.vue +11 -3
- package/src/brand-page/components/social-links/SocialLinks.vue +5 -2
- package/src/brand-page/components/testimonial-section/TestimonialSection.vue +460 -460
- package/src/brand-page/components/video/Video.vue +3 -0
- package/src/brand-page/composables/consent.composable.ts +18 -4
- package/src/brand-page/models/brand-page-context.model.ts +30 -0
- package/src/brand-page/utils/context.util.test.ts +43 -0
- package/src/brand-page/utils/context.util.ts +10 -0
- package/src/brand-page-maker/components/action-bar/ActionBar.mixin.ts +15 -0
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.test.ts +72 -0
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.vue +19 -4
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +57 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.preview-gate.test.ts +48 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +26 -1
- package/src/brand-page-maker/components/navigation/Navigation.mixin.ts +3 -0
- package/src/brand-page-maker/components/navigation/Navigation.vue +1 -0
- package/src/brand-page-maker/components/preview-modal/PreviewModal.test.ts +123 -0
- package/src/brand-page-maker/components/preview-modal/PreviewModal.vue +307 -0
- package/src/brand-page-maker/components/preview-modal/PreviewModalWithState.test.ts +226 -0
- package/src/brand-page-maker/components/preview-modal/PreviewModalWithState.vue +149 -0
- package/src/brand-page-maker/components/preview-modal/i18n/preview-modal.de-DE.json +6 -0
- package/src/brand-page-maker/components/preview-modal/i18n/preview-modal.es-ES.json +6 -0
- package/src/brand-page-maker/components/preview-modal/i18n/preview-modal.fr-CA.json +6 -0
- package/src/brand-page-maker/components/preview-modal/i18n/preview-modal.fr-FR.json +6 -0
- package/src/brand-page-maker/components/preview-modal/i18n/preview-modal.json +6 -0
- package/src/brand-page-maker/components/preview-modal/i18n/preview-modal.pt-BR.json +6 -0
- package/src/brand-page-maker/components/preview-modal/i18n/preview-modal.pt-PT.json +6 -0
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +29 -17
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.test.ts +135 -0
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +62 -21
- package/src/brand-page-maker/composables/useEventTracker.ts +1 -0
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.save.test.ts +106 -0
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +49 -8
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +11 -3
- package/src/brand-page-maker/stores/ui/ui-store.ts +1 -1
- package/src/bundles/bundled-translations.de-DE.json +5 -0
- package/src/bundles/bundled-translations.es-ES.json +5 -0
- package/src/bundles/bundled-translations.fr-CA.json +5 -0
- package/src/bundles/bundled-translations.fr-FR.json +5 -0
- package/src/bundles/bundled-translations.json +5 -0
- package/src/bundles/bundled-translations.pt-BR.json +5 -0
- package/src/bundles/bundled-translations.pt-PT.json +5 -0
- package/src/clients/brand-page-client.ts +2 -0
- package/src/clients/models.ts +3 -0
- package/src/composables/useTranslate.ts +2 -0
- package/src/constants/brand-page-maker.ts +5 -0
- package/src/constants/live-preview.constants.ts +11 -0
- package/src/lib.ts +9 -1
- package/src/shared/common/i18n/common.de-DE.json +1 -0
- package/src/shared/common/i18n/common.es-ES.json +1 -0
- package/src/shared/common/i18n/common.fr-CA.json +1 -0
- package/src/shared/common/i18n/common.fr-FR.json +1 -0
- package/src/shared/common/i18n/common.json +1 -0
- package/src/shared/common/i18n/common.pt-BR.json +1 -0
- package/src/shared/common/i18n/common.pt-PT.json +1 -0
- package/src/shared/template-settings/store/template-settings-store.ts +93 -27
- package/lib/src/bundled-translations-2HkRBbBD.js +0 -177
- package/lib/src/bundled-translations.de-DE-CL9ZEhU2.js +0 -177
- package/lib/src/bundled-translations.es-ES-uj7Sliu0.js +0 -177
- package/lib/src/bundled-translations.fr-CA-BMnBtr_w.js +0 -177
- package/lib/src/bundled-translations.fr-FR-9PEZedzq.js +0 -177
- package/lib/src/bundled-translations.pt-BR-B3oNDkoe.js +0 -177
- package/lib/src/bundled-translations.pt-PT-DM7Vsf-h.js +0 -177
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import { FORM_FIELD_TYPES } from '@brand-page/models';
|
|
3
|
-
import { getEmailValidationError, getMessageValidationError, getNameValidationError, getPhoneValidationError, } from '@brand-page/utils';
|
|
3
|
+
import { getEmailValidationError, getMessageValidationError, getNameValidationError, getPhoneValidationError, isPreviewMode, } from '@brand-page/utils';
|
|
4
4
|
import { isDecorativeButtonStyle } from '../../utils/button.util';
|
|
5
5
|
import brandPageClient from '../../clients/brand-page.client';
|
|
6
6
|
import { isEmail } from '../../../utils/validator.util';
|
|
@@ -193,7 +193,9 @@ export default defineComponent({
|
|
|
193
193
|
}));
|
|
194
194
|
},
|
|
195
195
|
mounted() {
|
|
196
|
-
if (this.context?.recaptchaSiteKey &&
|
|
196
|
+
if (this.context?.recaptchaSiteKey &&
|
|
197
|
+
!isPreviewMode(this.context) &&
|
|
198
|
+
this.recaptcha) {
|
|
197
199
|
this.recaptcha.initialise({ siteKey: this.context.recaptchaSiteKey });
|
|
198
200
|
}
|
|
199
201
|
},
|
|
@@ -203,7 +205,7 @@ export default defineComponent({
|
|
|
203
205
|
if (this.hasFormError) {
|
|
204
206
|
return;
|
|
205
207
|
}
|
|
206
|
-
if (this.
|
|
208
|
+
if (isPreviewMode(this.context) || !this.context.brandPageToken) {
|
|
207
209
|
if (process.env.NODE_ENV !== 'production' &&
|
|
208
210
|
!this.context.brandPageSlug) {
|
|
209
211
|
console.error('brandPageToken is not defined');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import brandPageClient from '../../clients/brand-page.client';
|
|
3
|
-
import { getEmailValidationError, contentPaddingStyle as toContentPaddingStyle, mutedTextForBackground, backgroundColorFromStyle, } from '@brand-page/utils';
|
|
3
|
+
import { getEmailValidationError, contentPaddingStyle as toContentPaddingStyle, isPreviewMode, mutedTextForBackground, backgroundColorFromStyle, } from '@brand-page/utils';
|
|
4
4
|
import { contentSettingsTr, mailingListTr, } from '@src/composables/useTranslate';
|
|
5
5
|
import { useReCaptcha } from '../../composables/recaptcha.composable';
|
|
6
6
|
import { RECAPTCHA_ACTION_MAILING_LIST } from '../../constants';
|
|
@@ -46,7 +46,9 @@ export default defineComponent({
|
|
|
46
46
|
},
|
|
47
47
|
mounted() {
|
|
48
48
|
this.show = true;
|
|
49
|
-
if (this.context?.recaptchaSiteKey &&
|
|
49
|
+
if (this.context?.recaptchaSiteKey &&
|
|
50
|
+
!isPreviewMode(this.context) &&
|
|
51
|
+
this.recaptcha) {
|
|
50
52
|
this.recaptcha.initialise({ siteKey: this.context.recaptchaSiteKey });
|
|
51
53
|
}
|
|
52
54
|
},
|
|
@@ -103,7 +105,7 @@ export default defineComponent({
|
|
|
103
105
|
},
|
|
104
106
|
isFormDisabled() {
|
|
105
107
|
return (this.hasFormError ||
|
|
106
|
-
this.
|
|
108
|
+
isPreviewMode(this.context) ||
|
|
107
109
|
!this.brandPageToken ||
|
|
108
110
|
this.isSubmitting);
|
|
109
111
|
},
|
|
@@ -125,7 +127,7 @@ export default defineComponent({
|
|
|
125
127
|
if (this.hasFormError) {
|
|
126
128
|
return;
|
|
127
129
|
}
|
|
128
|
-
if (this.
|
|
130
|
+
if (isPreviewMode(this.context) || !this.brandPageToken) {
|
|
129
131
|
return;
|
|
130
132
|
}
|
|
131
133
|
this.isSubmitting = true;
|
|
@@ -20,6 +20,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
22
|
}>, {}, {}, {
|
|
23
|
+
isInPreviewMode(): boolean;
|
|
23
24
|
containerStyle(): BrandPageCssStyle;
|
|
24
25
|
socialLinksIconStyle(): BrandPageCssStyle;
|
|
25
26
|
isDisplayStyleCentered(): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
|
-
import { getRenderText } from '@brand-page/utils';
|
|
2
|
+
import { getRenderText, isPreviewMode } from '@brand-page/utils';
|
|
3
3
|
import { FOOTER_DISPLAY } from '../../constants';
|
|
4
4
|
export default defineComponent({
|
|
5
5
|
props: {
|
|
@@ -23,6 +23,9 @@ export default defineComponent({
|
|
|
23
23
|
},
|
|
24
24
|
emits: ['on-logo-click', 'footer-container-click'],
|
|
25
25
|
computed: {
|
|
26
|
+
isInPreviewMode() {
|
|
27
|
+
return isPreviewMode(this.context);
|
|
28
|
+
},
|
|
26
29
|
containerStyle() {
|
|
27
30
|
return this.viewModel.backgroundStyle;
|
|
28
31
|
},
|
|
@@ -2,6 +2,7 @@ import { defineComponent } from 'vue';
|
|
|
2
2
|
import brandPageClient from '../../clients/brand-page.client';
|
|
3
3
|
import { DISPLAY_STYLE_COLLAPSED, DISPLAY_STYLE_PREVIEW, paymentProviders, } from '../../constants';
|
|
4
4
|
import raygunUtil from '@brand-page/utils/raygun.util';
|
|
5
|
+
import { isPreviewMode } from '@brand-page/utils';
|
|
5
6
|
import { paymentTr } from '@src/composables/useTranslate';
|
|
6
7
|
const DEFAULT_PAYMENT_SUCCESS_MESSAGE = paymentTr(`defaultPaymentSuccessMessage`);
|
|
7
8
|
const PAYMENT_CONFIG_ACTIVE = 'Active';
|
|
@@ -60,10 +61,10 @@ export default defineComponent({
|
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
canMakePayment() {
|
|
63
|
-
return !this.context
|
|
64
|
+
return !isPreviewMode(this.context) && this.isPaymentConfigActive;
|
|
64
65
|
},
|
|
65
66
|
showPaymentBlock() {
|
|
66
|
-
return this.context
|
|
67
|
+
return isPreviewMode(this.context) || this.isPaymentConfigActive;
|
|
67
68
|
},
|
|
68
69
|
paymentOptions() {
|
|
69
70
|
return this.paymentConfig.paymentOptions;
|
|
@@ -147,7 +148,7 @@ export default defineComponent({
|
|
|
147
148
|
this.state = paymentConfigId
|
|
148
149
|
? paymentState.PaymentOptionSelection
|
|
149
150
|
: paymentState.IncompleteConfig;
|
|
150
|
-
if (this.context
|
|
151
|
+
if (isPreviewMode(this.context) || !paymentConfigId) {
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
153
154
|
try {
|
|
@@ -2,7 +2,7 @@ import { defineComponent } from 'vue';
|
|
|
2
2
|
import { PAYMENT_OPTION_DISPLAY_TYPES, PAYMENT_OPTION_IMAGE_TYPES, } from '../../../models';
|
|
3
3
|
import { DEFAULT_CURRENCY_SYMBOL } from '../../../constants';
|
|
4
4
|
import { addOpacityToHex } from '../../../utils/color.util';
|
|
5
|
-
import { contentPaddingStyle as toContentPaddingStyle } from '../../../utils';
|
|
5
|
+
import { contentPaddingStyle as toContentPaddingStyle, isPreviewMode, } from '../../../utils';
|
|
6
6
|
import { RGBAtoHex } from '@utils/helpers';
|
|
7
7
|
const MAX_CUSTOM_REQUEST_CHARS = 500;
|
|
8
8
|
export default defineComponent({
|
|
@@ -29,6 +29,9 @@ export default defineComponent({
|
|
|
29
29
|
};
|
|
30
30
|
},
|
|
31
31
|
computed: {
|
|
32
|
+
isInPreviewMode() {
|
|
33
|
+
return isPreviewMode(this.context);
|
|
34
|
+
},
|
|
32
35
|
contentPaddingStyle() {
|
|
33
36
|
return toContentPaddingStyle(this.viewModel);
|
|
34
37
|
},
|
|
@@ -4,8 +4,10 @@ export declare const useConsent: () => {
|
|
|
4
4
|
updateConsent: import("vue").Ref<(c: ConsentType) => void, (c: ConsentType) => void>;
|
|
5
5
|
featureEnabled: import("vue").Ref<boolean, boolean>;
|
|
6
6
|
showConsentModal: import("vue").Ref<boolean, boolean>;
|
|
7
|
+
persist: import("vue").Ref<boolean, boolean>;
|
|
7
8
|
initialise: (options: {
|
|
8
9
|
featureEnabled: boolean;
|
|
10
|
+
persist?: boolean;
|
|
9
11
|
}) => ConsentType;
|
|
10
12
|
grant: (cb?: () => unknown) => void;
|
|
11
13
|
deny: (cb?: () => unknown) => void;
|
|
@@ -28,6 +28,7 @@ const store = reactive({
|
|
|
28
28
|
consent: undefined,
|
|
29
29
|
featureEnabled: false,
|
|
30
30
|
showConsentModal: false,
|
|
31
|
+
persist: true,
|
|
31
32
|
updateConsent(c) {
|
|
32
33
|
this.consent = c;
|
|
33
34
|
},
|
|
@@ -38,7 +39,8 @@ export const useConsent = () => {
|
|
|
38
39
|
return undefined;
|
|
39
40
|
}
|
|
40
41
|
store.featureEnabled = options.featureEnabled;
|
|
41
|
-
store.
|
|
42
|
+
store.persist = options.persist ?? true;
|
|
43
|
+
store.consent = store.persist ? getStoredConsent() : undefined;
|
|
42
44
|
store.showConsentModal =
|
|
43
45
|
options.featureEnabled && !accepted.value && !declined.value;
|
|
44
46
|
return store.consent;
|
|
@@ -46,13 +48,17 @@ export const useConsent = () => {
|
|
|
46
48
|
const accepted = computed(() => Boolean(store.consent && store.consent === 'granted'));
|
|
47
49
|
const declined = computed(() => Boolean(store.consent && store.consent === 'denied'));
|
|
48
50
|
const grant = (cb) => {
|
|
49
|
-
|
|
51
|
+
if (store.persist) {
|
|
52
|
+
storeConsent('granted');
|
|
53
|
+
}
|
|
50
54
|
store.updateConsent('granted');
|
|
51
55
|
store.showConsentModal = store.featureEnabled && !accepted.value;
|
|
52
56
|
cb && cb();
|
|
53
57
|
};
|
|
54
58
|
const deny = (cb) => {
|
|
55
|
-
|
|
59
|
+
if (store.persist) {
|
|
60
|
+
storeConsent('denied');
|
|
61
|
+
}
|
|
56
62
|
store.updateConsent('denied');
|
|
57
63
|
store.showConsentModal = false;
|
|
58
64
|
cb && cb();
|
|
@@ -37,6 +37,8 @@ export interface AbTestResult {
|
|
|
37
37
|
export interface AbTest {
|
|
38
38
|
bp_3926_freemium_watermark?: AbTestResult;
|
|
39
39
|
bp_5245_ai_website_assistant?: AbTestResult;
|
|
40
|
+
bp_5873_live_preview_prepurchase?: AbTestResult;
|
|
41
|
+
bp_5873_live_preview_postpurchase?: AbTestResult;
|
|
40
42
|
}
|
|
41
43
|
export declare const MEDIA_SIZES: {
|
|
42
44
|
readonly size1x: "size1x";
|
|
@@ -47,6 +49,13 @@ export type MediaSizes = keyof typeof MEDIA_SIZES;
|
|
|
47
49
|
export interface BrandPageContext {
|
|
48
50
|
isTemplate: boolean;
|
|
49
51
|
isPreview: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Rendered as a customer-facing live preview (safe/inert actions, no
|
|
54
|
+
* watermark, ephemeral consent). Distinct from the editor `isPreview`, which
|
|
55
|
+
* also drives editor/thumbnail-only behaviour. Use `isPreviewMode()` to gate
|
|
56
|
+
* inert-action behaviour that applies to both.
|
|
57
|
+
*/
|
|
58
|
+
isLivePreview?: boolean;
|
|
50
59
|
/** @deprecated should be used on maker only */
|
|
51
60
|
isMobile?: boolean;
|
|
52
61
|
isDesignCom: boolean;
|
|
@@ -25,6 +25,11 @@ 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_5245_AI_WEBSITE_ASSISTANT: 'bc-bp-5245-ai-website-assistant-postpurchase',
|
|
28
|
+
// Two separate live-preview experiments — bc-net sends only the one for the
|
|
29
|
+
// current purchase state, and a user's value on each side is independent
|
|
30
|
+
// (BP-5873). Keys must match `CampaignNames.LivePreview*Test` in bc-net.
|
|
31
|
+
BP_5873_LIVE_PREVIEW_PREPURCHASE: 'bc-bp-5873-live-preview-prepurchase',
|
|
32
|
+
BP_5873_LIVE_PREVIEW_POSTPURCHASE: 'bc-bp-5873-live-preview-postpurchase',
|
|
28
33
|
};
|
|
29
34
|
export const MEDIA_SIZES = {
|
|
30
35
|
size1x: 'size1x',
|
|
@@ -50,5 +55,12 @@ export const getAbTestResults = (abtestKeyValues) => {
|
|
|
50
55
|
if (abtestKeyValues[AB_TEST_KEYS.BP_5245_AI_WEBSITE_ASSISTANT]) {
|
|
51
56
|
abTests.bp_5245_ai_website_assistant = getValueType(AB_TEST_KEYS.BP_5245_AI_WEBSITE_ASSISTANT, abtestKeyValues[AB_TEST_KEYS.BP_5245_AI_WEBSITE_ASSISTANT]);
|
|
52
57
|
}
|
|
58
|
+
// AB Test for BP-5873 - Live preview (pre- and post-purchase run separately)
|
|
59
|
+
if (abtestKeyValues[AB_TEST_KEYS.BP_5873_LIVE_PREVIEW_PREPURCHASE]) {
|
|
60
|
+
abTests.bp_5873_live_preview_prepurchase = getValueType(AB_TEST_KEYS.BP_5873_LIVE_PREVIEW_PREPURCHASE, abtestKeyValues[AB_TEST_KEYS.BP_5873_LIVE_PREVIEW_PREPURCHASE]);
|
|
61
|
+
}
|
|
62
|
+
if (abtestKeyValues[AB_TEST_KEYS.BP_5873_LIVE_PREVIEW_POSTPURCHASE]) {
|
|
63
|
+
abTests.bp_5873_live_preview_postpurchase = getValueType(AB_TEST_KEYS.BP_5873_LIVE_PREVIEW_POSTPURCHASE, abtestKeyValues[AB_TEST_KEYS.BP_5873_LIVE_PREVIEW_POSTPURCHASE]);
|
|
64
|
+
}
|
|
53
65
|
return abTests;
|
|
54
66
|
};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import type { BrandPageContext } from '../models';
|
|
2
2
|
export declare const getSlugFromContext: (context: BrandPageContext) => string;
|
|
3
|
+
/**
|
|
4
|
+
* True when interactive actions must be inert and payment/shop blocks always
|
|
5
|
+
* shown — i.e. the render is a preview, not a live site. Covers both the
|
|
6
|
+
* editor preview (`isPreview`) and the customer live-preview
|
|
7
|
+
* (`isLivePreview`). Editor-only artifacts (cursor, nav interception,
|
|
8
|
+
* placeholders) must keep reading `context.isPreview` directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isPreviewMode: (context: BrandPageContext) => boolean;
|
|
@@ -4,3 +4,11 @@ export const getSlugFromContext = (context) => {
|
|
|
4
4
|
}
|
|
5
5
|
return context.brandPageSlug;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* True when interactive actions must be inert and payment/shop blocks always
|
|
9
|
+
* shown — i.e. the render is a preview, not a live site. Covers both the
|
|
10
|
+
* editor preview (`isPreview`) and the customer live-preview
|
|
11
|
+
* (`isLivePreview`). Editor-only artifacts (cursor, nav interception,
|
|
12
|
+
* placeholders) must keep reading `context.isPreview` directly.
|
|
13
|
+
*/
|
|
14
|
+
export const isPreviewMode = (context) => !!(context.isPreview || context.isLivePreview);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
2
|
isAdmin: import("vue").ComputedRef<boolean>;
|
|
3
|
+
isLivePreviewEnabled: import("vue").ComputedRef<boolean>;
|
|
3
4
|
isSaving: import("vue").ComputedRef<boolean>;
|
|
4
5
|
isPublished: import("vue").ComputedRef<boolean>;
|
|
5
6
|
isPublishButtonEnabled: import("vue").ComputedRef<boolean>;
|
|
@@ -159,6 +160,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
159
160
|
}>;
|
|
160
161
|
}, {}, {}, {
|
|
161
162
|
saveBrandPage(): void;
|
|
163
|
+
previewBrandPage(): void;
|
|
162
164
|
saveAndPublishBrandPage(isActionBar: boolean): void;
|
|
163
165
|
createTeamCards(isTopNav: boolean): void;
|
|
164
166
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "create-team-cards"[], "create-team-cards", import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EVENTS } from '../../../constants/brand-page-maker';
|
|
2
|
-
import { useBrandPageMakerUserStore, useBrandPageMakerStore, } from '@brand-page-maker/stores';
|
|
2
|
+
import { useBrandPageMakerUserStore, useBrandPageMakerStore, useBrandPageContainerStore, } from '@brand-page-maker/stores';
|
|
3
3
|
import { computed, defineComponent } from 'vue';
|
|
4
4
|
import { UPGRADE_CTA_LOCATIONS } from './../../composables/useEventTracker';
|
|
5
5
|
import { BRAND_PAGE_TYPES } from '@brand-page/models';
|
|
@@ -8,8 +8,18 @@ export default defineComponent({
|
|
|
8
8
|
setup() {
|
|
9
9
|
const userStore = useBrandPageMakerUserStore();
|
|
10
10
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
11
|
+
const containerStore = useBrandPageContainerStore();
|
|
11
12
|
return {
|
|
12
13
|
isAdmin: computed(() => userStore.isAdmin),
|
|
14
|
+
// BP-5873: the Preview button is behind an AB test, and pre/post purchase are
|
|
15
|
+
// two separate experiments. Pick the one for the current purchase state — a
|
|
16
|
+
// user's value on the other side is independent and must not leak across.
|
|
17
|
+
isLivePreviewEnabled: computed(() => {
|
|
18
|
+
const experiment = containerStore.isPrePurchase
|
|
19
|
+
? containerStore.abTests.bp_5873_live_preview_prepurchase
|
|
20
|
+
: containerStore.abTests.bp_5873_live_preview_postpurchase;
|
|
21
|
+
return !!experiment?.isVariation;
|
|
22
|
+
}),
|
|
13
23
|
isSaving: computed(() => brandPageMakerStore.isSaving),
|
|
14
24
|
isPublished: computed(() => brandPageMakerStore.isPublished),
|
|
15
25
|
isPublishButtonEnabled: computed(() => brandPageMakerStore.isPublishButtonEnabled),
|
|
@@ -22,6 +32,9 @@ export default defineComponent({
|
|
|
22
32
|
saveBrandPage() {
|
|
23
33
|
this.$emit(EVENTS.Save);
|
|
24
34
|
},
|
|
35
|
+
previewBrandPage() {
|
|
36
|
+
this.$emit(EVENTS.Preview);
|
|
37
|
+
},
|
|
25
38
|
saveAndPublishBrandPage(isActionBar) {
|
|
26
39
|
if (!this.isPublishButtonEnabled) {
|
|
27
40
|
return;
|