@designcrowd/library.brand-page 5.14.1 → 5.14.2-ml3
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-GGeRP-yJ.js → CreatedOnBrandCrowd-de-de-DxLeSo0D.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-D-mcoYKD.js → CreatedOnBrandCrowd-en-us-p9-PKTfD.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-UB-XVZLH.js → CreatedOnBrandCrowd-es-es-Dg1DkZwL.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BcLwD-Ww.js → CreatedOnBrandCrowd-fr-fr-r6Ers47p.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DuTtIiT7.js → CreatedOnBrandCrowd-pt-pt-CRvyq6iB.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-6nOtKdaY.js → CreatedOnDcom-de-de-DfCzyu8K.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BlzEFog2.js → CreatedOnDcom-en-us-CP6lT2IJ.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-B_v3IYem.js → CreatedOnDcom-es-es-CABw9-cD.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DmWvH9K_.js → CreatedOnDcom-fr-fr-DIN2-W0Q.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-P25mfZVx.js → CreatedOnDcom-pt-pt-BLTdvqrM.js} +1 -1
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +2 -0
- package/lib/src/brand-page/models/brand-page-context.model.js +2 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +12 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +1 -0
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +16 -3
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +12 -3
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +12 -3
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +12 -3
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +12 -3
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +12 -3
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +7 -1
- package/lib/src/brand-page-maker/composables/useEventTracker.js +29 -4
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +14 -3
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +56 -9
- package/lib/src/brand-page-maker/stores/route/localised-route-store.js +6 -0
- package/lib/src/clients/brand-page-client.d.ts +20 -3
- package/lib/src/clients/brand-page-client.js +29 -17
- package/lib/src/css/library.brand-page-brandCrowd.min.css +14 -11
- package/lib/src/css/library.brand-page-brandPage.min.css +14 -11
- package/lib/src/css/library.brand-page-designCom.min.css +14 -11
- package/lib/src/css/library.brand-page-preview.min.css +14 -11
- package/lib/src/index.mjs +35 -34
- package/lib/src/{lib-CQSKlB0S.js → lib-OVp_vdPB.js} +20480 -20315
- package/lib/src/mockServiceWorker.js +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +4 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +4 -0
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +12 -3
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +12 -3
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +16 -3
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +12 -3
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +30 -10
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.js +25 -2
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +12 -3
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +4 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +16 -3
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +4 -0
- package/package.json +2 -2
- package/src/brand-page/models/brand-page-context.model.ts +7 -1
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +1 -0
- package/src/brand-page-maker/composables/useEventTracker.ts +37 -4
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +96 -9
- package/src/brand-page-maker/stores/route/localised-route-store.ts +6 -0
- package/src/clients/brand-page-client.ts +55 -20
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.ts +31 -2
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.vue +8 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { shallowRef } from 'vue';
|
|
2
|
-
// Event names should driven with prefix `
|
|
2
|
+
// Event names should driven with prefix `website_maker_` to distinguish the event from other events around the site
|
|
3
3
|
export const EVENTS = {
|
|
4
|
-
|
|
4
|
+
EXPERIMENT_STARTED: '$experiment_started',
|
|
5
5
|
WEBSITE_MAKER_ADD_CONTENT: 'website_maker_add_content',
|
|
6
6
|
WEBSITE_MAKER_REMOVE_CONTENT: 'website_maker_remove_content',
|
|
7
7
|
WEBSITE_MAKER_SELECT_CONTENT: 'website_maker_select_content',
|
|
@@ -21,6 +21,8 @@ export const EVENTS = {
|
|
|
21
21
|
WEBSITE_MAKER_HYPERLINK_CLICK: 'website_maker_hyperlink_click',
|
|
22
22
|
WEBSITE_MAKER_HYPERLINK_EDIT: 'website_maker_hyperlink_edit',
|
|
23
23
|
WEBSITE_MAKER_CALENDLY_LINK_CLICKED: 'website_maker_calendly_link_clicked',
|
|
24
|
+
WEBSITE_MAKER_UPSELL_OFFER: 'website_maker_upsell_offer',
|
|
25
|
+
WEBSITE_MAKER_UPSELL_ACTION: 'website_maker_upsell_action',
|
|
24
26
|
};
|
|
25
27
|
export const SELECT_LOCATIONS = {
|
|
26
28
|
MAKER_PREVIEW: 'maker_preview',
|
|
@@ -66,12 +68,12 @@ const bridgeState = shallowRef({
|
|
|
66
68
|
publishOpenEventProps: {},
|
|
67
69
|
});
|
|
68
70
|
const LISTENERS = shallowRef([]);
|
|
69
|
-
const _publishEvent = (eventName, eventProps) => {
|
|
71
|
+
const _publishEvent = (eventName, eventProps, excludeGlobal = false) => {
|
|
70
72
|
LISTENERS.value.forEach((listener) => {
|
|
71
73
|
listener({
|
|
72
74
|
eventName: eventName,
|
|
73
75
|
eventProps: {
|
|
74
|
-
...GLOBAL_EVENT_PROPS.value,
|
|
76
|
+
...(excludeGlobal ? {} : GLOBAL_EVENT_PROPS.value),
|
|
75
77
|
...eventProps,
|
|
76
78
|
},
|
|
77
79
|
});
|
|
@@ -79,6 +81,12 @@ const _publishEvent = (eventName, eventProps) => {
|
|
|
79
81
|
};
|
|
80
82
|
const useEventTracker = () => {
|
|
81
83
|
return {
|
|
84
|
+
sendExperimentStartedEvent: (abTestKey, abTestValue) => {
|
|
85
|
+
_publishEvent(EVENTS.EXPERIMENT_STARTED, {
|
|
86
|
+
'Experiment name': abTestKey,
|
|
87
|
+
'Variant name': abTestValue,
|
|
88
|
+
}, true);
|
|
89
|
+
},
|
|
82
90
|
setGlobalEventProps: (props) => {
|
|
83
91
|
GLOBAL_EVENT_PROPS.value = { ...GLOBAL_EVENT_PROPS.value, ...props };
|
|
84
92
|
},
|
|
@@ -118,6 +126,12 @@ const useEventTracker = () => {
|
|
|
118
126
|
continuation: null,
|
|
119
127
|
});
|
|
120
128
|
},
|
|
129
|
+
appendPublishBridgeState: (props) => {
|
|
130
|
+
bridgeState.value.publishOpenEventProps = {
|
|
131
|
+
...bridgeState.value.publishOpenEventProps,
|
|
132
|
+
...props,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
121
135
|
sendPublishContinuationEvent: (continuation, domain) => {
|
|
122
136
|
_publishEvent(EVENTS.WEBSITE_MAKER_PUBLISH_MODAL, {
|
|
123
137
|
...bridgeState.value.publishOpenEventProps,
|
|
@@ -182,6 +196,17 @@ const useEventTracker = () => {
|
|
|
182
196
|
continuation,
|
|
183
197
|
});
|
|
184
198
|
},
|
|
199
|
+
sendUpsellOfferEvent: (upsellType) => {
|
|
200
|
+
_publishEvent(EVENTS.WEBSITE_MAKER_UPSELL_OFFER, {
|
|
201
|
+
upsellType,
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
sendUpsellOfferActionEvent: (upsellType, action) => {
|
|
205
|
+
_publishEvent(EVENTS.WEBSITE_MAKER_UPSELL_ACTION, {
|
|
206
|
+
upsellType,
|
|
207
|
+
action,
|
|
208
|
+
});
|
|
209
|
+
},
|
|
185
210
|
};
|
|
186
211
|
};
|
|
187
212
|
export { useEventTracker };
|
|
@@ -44,8 +44,10 @@ export interface BrandPageContainerState {
|
|
|
44
44
|
isPrePurchase: boolean;
|
|
45
45
|
makerFonts: any[];
|
|
46
46
|
eventButtonLocation?: string;
|
|
47
|
+
websiteUpsellModalViewModel?: any;
|
|
47
48
|
showPublishOptionModal?: boolean;
|
|
48
49
|
abTests: Record<string, string>;
|
|
50
|
+
isSubsequentPublish: boolean;
|
|
49
51
|
}
|
|
50
52
|
export type InitialisePayload = Omit<BrandPageContainerState, 'customDomain' | 'customDomainConfig'> & {
|
|
51
53
|
logoDraftToken?: string;
|
|
@@ -117,8 +119,10 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
|
|
|
117
119
|
isPrePurchase: boolean;
|
|
118
120
|
makerFonts: any[];
|
|
119
121
|
eventButtonLocation?: string | undefined;
|
|
122
|
+
websiteUpsellModalViewModel?: any;
|
|
120
123
|
showPublishOptionModal?: boolean | undefined;
|
|
121
124
|
abTests: Record<string, string>;
|
|
125
|
+
isSubsequentPublish: boolean;
|
|
122
126
|
} & import("pinia").PiniaCustomStateProperties<BrandPageContainerState>) => boolean;
|
|
123
127
|
isUserDraft: (state: {
|
|
124
128
|
availableTaxes: any[];
|
|
@@ -176,8 +180,10 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
|
|
|
176
180
|
isPrePurchase: boolean;
|
|
177
181
|
makerFonts: any[];
|
|
178
182
|
eventButtonLocation?: string | undefined;
|
|
183
|
+
websiteUpsellModalViewModel?: any;
|
|
179
184
|
showPublishOptionModal?: boolean | undefined;
|
|
180
185
|
abTests: Record<string, string>;
|
|
186
|
+
isSubsequentPublish: boolean;
|
|
181
187
|
} & import("pinia").PiniaCustomStateProperties<BrandPageContainerState>) => boolean;
|
|
182
188
|
}, {
|
|
183
189
|
clearTriggerSaveEventApiOnPublishModalClose(): void;
|
|
@@ -210,6 +216,7 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
|
|
|
210
216
|
}): void;
|
|
211
217
|
setCreateCustomDomainErrorMessage(payload: any): void;
|
|
212
218
|
setBrandPageIsCustomDomainEnabled(payload: any): void;
|
|
219
|
+
setIsSubsequentPublish(payload: any): void;
|
|
213
220
|
clearPublishErrorMessage(): void;
|
|
214
221
|
closePublishModal(payload?: {
|
|
215
222
|
skipShowNextNotificationMessage?: boolean;
|
|
@@ -219,7 +226,10 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
|
|
|
219
226
|
publishBrandPage({ shouldPublish, slug }: {
|
|
220
227
|
shouldPublish: any;
|
|
221
228
|
slug: any;
|
|
222
|
-
}): Promise<
|
|
229
|
+
}): Promise<false | {
|
|
230
|
+
success: boolean;
|
|
231
|
+
websiteUpsellModalViewModel: any;
|
|
232
|
+
}>;
|
|
223
233
|
publishBrandPageWithCustomDomainAsync({ shouldPublish, slug, domain, isPurchasedDomain, }: {
|
|
224
234
|
shouldPublish: any;
|
|
225
235
|
slug: any;
|
|
@@ -236,12 +246,13 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
|
|
|
236
246
|
eventButtonLocation?: string;
|
|
237
247
|
}): Promise<false | {
|
|
238
248
|
saved: boolean;
|
|
239
|
-
canPublish:
|
|
249
|
+
canPublish: boolean;
|
|
250
|
+
websiteUpsellModalViewModel: any;
|
|
240
251
|
}>;
|
|
241
252
|
saveAndPublishBrandPage(eventButtonLocation: string): Promise<void>;
|
|
242
253
|
saveTemplate(): Promise<void>;
|
|
243
254
|
setBrandPageStatus(status: any): Promise<void>;
|
|
244
|
-
showPublishModal(eventButtonLocation?: string): void;
|
|
255
|
+
showPublishModal(eventButtonLocation?: string, websiteUpsellModalViewModel?: any, isSubsequentPublish?: boolean): void;
|
|
245
256
|
showBrandPageSlugEditModal(): Promise<void>;
|
|
246
257
|
showUpgradeModalAndSaveAsync(): Promise<void>;
|
|
247
258
|
showStripeOnboardingModal(): void;
|
|
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
|
|
|
2
2
|
import brandPageClient from '../../../clients/brand-page-client';
|
|
3
3
|
import { useBrandPageMakerStore, useBrandPageMakerUserStore, useLocalisedRouteStore, useLogoStore, useUiStore, } from '../../stores';
|
|
4
4
|
import { SIDE_BAR_TAB_NAMES } from '../../constants';
|
|
5
|
-
import { BRAND_PAGE_TYPES, SENSITIVE_CONTENT_TYPES, getAbTestResults, } from '../../../brand-page';
|
|
5
|
+
import { BRAND_PAGE_TYPES, SENSITIVE_CONTENT_TYPES, getAbTestResults, getValueType, } from '../../../brand-page';
|
|
6
6
|
import { isLogoContent } from '../../../brand-page/utils';
|
|
7
7
|
import { useUiEditableLogoStore } from '../../../shared/logo-settings/store';
|
|
8
8
|
import uniq from 'lodash.uniq';
|
|
@@ -11,7 +11,6 @@ import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/sho
|
|
|
11
11
|
import { TRIGGER_TYPE, UPGRADE_CTA_LOCATIONS, useEventTracker, } from '../../composables/useEventTracker';
|
|
12
12
|
import { navigationTr } from '../../../composables/useTranslate';
|
|
13
13
|
import { errorTr, constantsTr } from '../../../composables/useTranslate';
|
|
14
|
-
import { useUiTemplateSettingsStore } from '../../../shared/template-settings/store';
|
|
15
14
|
export const BRANDPAGE_STATUS = Object.freeze({
|
|
16
15
|
Published: 'Published',
|
|
17
16
|
Unpublished: 'Unpublished',
|
|
@@ -61,8 +60,10 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
61
60
|
isPrePurchase: false,
|
|
62
61
|
makerFonts: [],
|
|
63
62
|
eventButtonLocation: undefined,
|
|
63
|
+
websiteUpsellModalViewModel: undefined,
|
|
64
64
|
showPublishOptionModal: false,
|
|
65
65
|
abTests: {},
|
|
66
|
+
isSubsequentPublish: false,
|
|
66
67
|
};
|
|
67
68
|
},
|
|
68
69
|
actions: {
|
|
@@ -120,6 +121,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
120
121
|
this.makerFonts = payload.makerFonts || [];
|
|
121
122
|
this.showPublishOptionModal = payload.showPublishOptionModal;
|
|
122
123
|
this.abTests = getAbTestResults(payload.abTests || {});
|
|
124
|
+
this.isSubsequentPublish = payload.isSubsequentPublish;
|
|
123
125
|
const logoStore = useLogoStore();
|
|
124
126
|
logoStore.initialise({
|
|
125
127
|
logoTemplateAsset: payload.logoTemplateAsset,
|
|
@@ -148,6 +150,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
148
150
|
setIsPublishModalVisible(payload) {
|
|
149
151
|
this.isPublishModalVisible = payload.isVisible;
|
|
150
152
|
this.eventButtonLocation = payload.eventButtonLocation;
|
|
153
|
+
this.websiteUpsellModalViewModel = payload.websiteUpsellModalViewModel;
|
|
151
154
|
},
|
|
152
155
|
setIsPublishUpgradeModal(payload) {
|
|
153
156
|
this.isPublishUpgradeModal = payload;
|
|
@@ -208,6 +211,9 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
208
211
|
setBrandPageIsCustomDomainEnabled(payload) {
|
|
209
212
|
this.isCustomDomainEnabled = payload.isCustomDomainEnabled;
|
|
210
213
|
},
|
|
214
|
+
setIsSubsequentPublish(payload) {
|
|
215
|
+
this.isSubsequentPublish = payload.isSubsequentPublish;
|
|
216
|
+
},
|
|
211
217
|
clearPublishErrorMessage() {
|
|
212
218
|
this.setPublishErrorMessage({ errorMessage: undefined });
|
|
213
219
|
},
|
|
@@ -249,6 +255,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
249
255
|
},
|
|
250
256
|
async publishBrandPage({ shouldPublish, slug }) {
|
|
251
257
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
258
|
+
const eventTracker = useEventTracker();
|
|
252
259
|
if (!this.designDraftToken) {
|
|
253
260
|
throw new Error('unable to publish brand page when designDraftToken is not set');
|
|
254
261
|
}
|
|
@@ -262,6 +269,13 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
262
269
|
shouldPublish,
|
|
263
270
|
brandPageContentTypes: this.brandPageContentTypes,
|
|
264
271
|
});
|
|
272
|
+
if (!response) {
|
|
273
|
+
throw new Error('Failed to set brand page slug');
|
|
274
|
+
}
|
|
275
|
+
if (response.websiteUpsellAbTestKey) {
|
|
276
|
+
this.abTests.bp_4092_rotating_upsells_at_publish = getValueType(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
277
|
+
eventTracker.sendExperimentStartedEvent(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
278
|
+
}
|
|
265
279
|
if (shouldPublish) {
|
|
266
280
|
this.clearTriggerSaveEventApiOnPublishModalClose();
|
|
267
281
|
}
|
|
@@ -287,7 +301,10 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
287
301
|
else {
|
|
288
302
|
await this.closePublishModal();
|
|
289
303
|
}
|
|
290
|
-
return
|
|
304
|
+
return {
|
|
305
|
+
success: true,
|
|
306
|
+
websiteUpsellModalViewModel: response.websiteUpsellModalViewModel,
|
|
307
|
+
};
|
|
291
308
|
}
|
|
292
309
|
catch (err) {
|
|
293
310
|
if (err.response?.data?.showUpgradeModal === true) {
|
|
@@ -318,12 +335,12 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
318
335
|
return false;
|
|
319
336
|
}
|
|
320
337
|
finally {
|
|
321
|
-
this.setIsPublishModalVisible({ isVisible: true });
|
|
322
338
|
this.setIsPublishing({ isPublishing: false });
|
|
323
339
|
}
|
|
324
340
|
},
|
|
325
341
|
async publishBrandPageWithCustomDomainAsync({ shouldPublish, slug, domain, isPurchasedDomain, }) {
|
|
326
342
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
343
|
+
const eventTracker = useEventTracker();
|
|
327
344
|
if (!this.designDraftToken) {
|
|
328
345
|
throw new Error('unable to publish brand page when designDraftToken is not set');
|
|
329
346
|
}
|
|
@@ -355,6 +372,13 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
355
372
|
shouldPublish,
|
|
356
373
|
brandPageContentTypes: this.brandPageContentTypes,
|
|
357
374
|
});
|
|
375
|
+
if (!response) {
|
|
376
|
+
throw new Error('Failed to set brand page slug');
|
|
377
|
+
}
|
|
378
|
+
if (response.websiteUpsellAbTestKey) {
|
|
379
|
+
this.abTests.bp_4092_rotating_upsells_at_publish = getValueType(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
380
|
+
eventTracker.sendExperimentStartedEvent(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
381
|
+
}
|
|
358
382
|
await brandPageClient.getBrandPageIsCustomDomainEnabledAsync(brandPageMakerStore.brandPageType, this.designDraftToken);
|
|
359
383
|
const updatedIsCustomDomainEnabled = await brandPageClient.updateBrandPageIsCustomDomainEnabledAsync(brandPageMakerStore.brandPageType, this.designDraftToken, true);
|
|
360
384
|
this.setBrandPageIsCustomDomainEnabled({
|
|
@@ -534,6 +558,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
534
558
|
async saveBrandPage(payload = {}) {
|
|
535
559
|
const userStore = useBrandPageMakerUserStore();
|
|
536
560
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
561
|
+
const eventTracker = useEventTracker();
|
|
537
562
|
if (userStore.isAdmin) {
|
|
538
563
|
throw new Error('save brand page is not allowed in admin mode');
|
|
539
564
|
}
|
|
@@ -550,6 +575,10 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
550
575
|
if (!response) {
|
|
551
576
|
return false;
|
|
552
577
|
}
|
|
578
|
+
if (response.websiteUpsellAbTestKey) {
|
|
579
|
+
this.abTests.bp_4092_rotating_upsells_at_publish = getValueType(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
580
|
+
eventTracker.sendExperimentStartedEvent(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
581
|
+
}
|
|
553
582
|
if (this.brandPageStatus !== response.status) {
|
|
554
583
|
await this.setBrandPageStatus(response.status);
|
|
555
584
|
}
|
|
@@ -595,7 +624,11 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
595
624
|
await this.showSaveSuccessMessage();
|
|
596
625
|
await brandPageMakerStore.showNextNotificationMessage();
|
|
597
626
|
}
|
|
598
|
-
return {
|
|
627
|
+
return {
|
|
628
|
+
saved: true,
|
|
629
|
+
canPublish: response.canPublish,
|
|
630
|
+
websiteUpsellModalViewModel: response.websiteUpsellModalViewModel,
|
|
631
|
+
};
|
|
599
632
|
}
|
|
600
633
|
catch (err) {
|
|
601
634
|
if (err.response?.data?.showUpgradeModal === true) {
|
|
@@ -640,7 +673,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
640
673
|
return;
|
|
641
674
|
}
|
|
642
675
|
else {
|
|
643
|
-
await this.showPublishModal(eventButtonLocation);
|
|
676
|
+
await this.showPublishModal(eventButtonLocation, response.websiteUpsellModalViewModel);
|
|
644
677
|
}
|
|
645
678
|
},
|
|
646
679
|
async saveTemplate() {
|
|
@@ -667,10 +700,24 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
667
700
|
async setBrandPageStatus(status) {
|
|
668
701
|
this.brandPageStatus = status;
|
|
669
702
|
},
|
|
670
|
-
showPublishModal(eventButtonLocation) {
|
|
703
|
+
showPublishModal(eventButtonLocation, websiteUpsellModalViewModel, isSubsequentPublish) {
|
|
671
704
|
const eventTracker = useEventTracker();
|
|
705
|
+
const subsequentPublishValue = isSubsequentPublish !== undefined
|
|
706
|
+
? isSubsequentPublish
|
|
707
|
+
: (this.brandPageSlug && this.brandPageSlug.trim() !== '') ||
|
|
708
|
+
this.isPublished;
|
|
709
|
+
this.setIsSubsequentPublish({
|
|
710
|
+
isSubsequentPublish: subsequentPublishValue,
|
|
711
|
+
});
|
|
712
|
+
eventTracker.appendPublishBridgeState({
|
|
713
|
+
isSubsequentPublish: this.isSubsequentPublish,
|
|
714
|
+
});
|
|
672
715
|
eventTracker.sendPublishOpenEvent();
|
|
673
|
-
this.setIsPublishModalVisible({
|
|
716
|
+
this.setIsPublishModalVisible({
|
|
717
|
+
isVisible: true,
|
|
718
|
+
eventButtonLocation,
|
|
719
|
+
websiteUpsellModalViewModel,
|
|
720
|
+
});
|
|
674
721
|
},
|
|
675
722
|
async showBrandPageSlugEditModal() {
|
|
676
723
|
await this.startBrandPageSlugEditMode();
|
|
@@ -720,7 +767,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
720
767
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
721
768
|
try {
|
|
722
769
|
const response = await brandPageClient.unpublishBrandPageAsync(brandPageMakerStore.brandPageType, this.designDraftToken);
|
|
723
|
-
await this.setBrandPageStatus(response
|
|
770
|
+
await this.setBrandPageStatus(response?.status);
|
|
724
771
|
}
|
|
725
772
|
catch (err) {
|
|
726
773
|
console.error(err);
|
|
@@ -7,20 +7,26 @@ const getLocalisedSlug = (defaultSlug, locale) => {
|
|
|
7
7
|
'/website-builder': {
|
|
8
8
|
'de-DE': '/website-erstellen',
|
|
9
9
|
'fr-FR': '/createur-site-web',
|
|
10
|
+
'fr-CA': '/createur-site-web',
|
|
10
11
|
'es-ES': '/creador-paginas-web',
|
|
11
12
|
'pt-PT': '/criador-site',
|
|
13
|
+
'pt-BR': '/criador-site',
|
|
12
14
|
},
|
|
13
15
|
'/digital-business-card': {
|
|
14
16
|
'de-DE': '/digitale-visitenkarte',
|
|
15
17
|
'fr-FR': '/carte-de-visite-numerique',
|
|
18
|
+
'fr-CA': '/carte-de-visite-numerique',
|
|
16
19
|
'es-ES': '/tarjeta-de-visita-digital',
|
|
17
20
|
'pt-PT': '/cartao-de-visita-digital',
|
|
21
|
+
'pt-BR': '/cartao-de-visita-digital',
|
|
18
22
|
},
|
|
19
23
|
'/link-in-bio': {
|
|
20
24
|
'de-DE': '/link-in-bio',
|
|
21
25
|
'fr-FR': '/lien-en-bio',
|
|
26
|
+
'fr-CA': '/lien-en-bio',
|
|
22
27
|
'es-ES': '/link-en-bio',
|
|
23
28
|
'pt-PT': '/link-na-bio',
|
|
29
|
+
'pt-BR': '/link-na-bio',
|
|
24
30
|
},
|
|
25
31
|
};
|
|
26
32
|
return translations[defaultSlug]?.[locale] || defaultSlug;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import type { WebsiteSlugCheckResponse } from '../brand-page-maker/models/api.model';
|
|
2
|
+
export interface SaveBrandPageResponse {
|
|
3
|
+
designDraftToken: string;
|
|
4
|
+
status: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
canPublish: boolean;
|
|
7
|
+
websiteUpsellAbTestKey: string;
|
|
8
|
+
websiteUpsellAbTestValue: string;
|
|
9
|
+
websiteUpsellModalViewModel: any;
|
|
10
|
+
}
|
|
11
|
+
export interface PublishBrandPageResponse {
|
|
12
|
+
designDraftToken: string;
|
|
13
|
+
status: string;
|
|
14
|
+
slug: string;
|
|
15
|
+
websiteUpsellAbTestKey: string;
|
|
16
|
+
websiteUpsellAbTestValue: string;
|
|
17
|
+
websiteUpsellModalViewModel: any;
|
|
18
|
+
}
|
|
2
19
|
declare const _default: {
|
|
3
|
-
saveBrandPageAsync: (brandPageType: "default" | "brandSite" | "brandContact", request: any, designDraftToken?: string | undefined) => Promise<
|
|
4
|
-
setBrandPageSlugAsync: (brandPageType: "default" | "brandSite" | "brandContact", designDraftToken: any, options: any) => Promise<
|
|
20
|
+
saveBrandPageAsync: (brandPageType: "default" | "brandSite" | "brandContact", request: any, designDraftToken?: string | undefined) => Promise<SaveBrandPageResponse | null>;
|
|
21
|
+
setBrandPageSlugAsync: (brandPageType: "default" | "brandSite" | "brandContact", designDraftToken: any, options: any) => Promise<PublishBrandPageResponse | null>;
|
|
5
22
|
createDefaultBrandPage: (brandPageType: "default" | "brandSite" | "brandContact", slug: any, logoDraftToken: any) => Promise<any>;
|
|
6
|
-
unpublishBrandPageAsync: (brandPageType: "default" | "brandSite" | "brandContact", designDraftToken: any) => Promise<
|
|
23
|
+
unpublishBrandPageAsync: (brandPageType: "default" | "brandSite" | "brandContact", designDraftToken: any) => Promise<PublishBrandPageResponse | null>;
|
|
7
24
|
updateBrandPageMetaAsync: (brandPageType: "default" | "brandSite" | "brandContact", designDraftToken: any, request: any) => Promise<any>;
|
|
8
25
|
updateSensitiveContentAsync: (brandPageType: "default" | "brandSite" | "brandContact", designDraftToken: any, request: any) => Promise<any>;
|
|
9
26
|
triggerBrandPageSavedEvent: (brandPageType: "default" | "brandSite" | "brandContact", designDraftToken: any, request: any) => Promise<void>;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
1
|
+
import axios, {} from 'axios';
|
|
2
2
|
import { BRAND_PAGE_TYPES } from '../brand-page';
|
|
3
|
+
import { getCurrentLocale } from '../composables/useTranslate';
|
|
4
|
+
let AXIOS_INSTANCE;
|
|
5
|
+
const getAxiosInstance = () => {
|
|
6
|
+
if (!AXIOS_INSTANCE) {
|
|
7
|
+
AXIOS_INSTANCE = axios.create({
|
|
8
|
+
headers: {
|
|
9
|
+
'Accept-Language': getCurrentLocale(),
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return AXIOS_INSTANCE;
|
|
14
|
+
};
|
|
3
15
|
const getApiUrlPrefix = (brandPageType) => {
|
|
4
16
|
switch (brandPageType) {
|
|
5
17
|
case BRAND_PAGE_TYPES.default:
|
|
@@ -14,7 +26,7 @@ const getApiUrlPrefix = (brandPageType) => {
|
|
|
14
26
|
};
|
|
15
27
|
const saveBrandPageAsync = async (brandPageType, request, designDraftToken) => {
|
|
16
28
|
const url = `${getApiUrlPrefix(brandPageType)}${designDraftToken ? `/${designDraftToken}` : ''}`;
|
|
17
|
-
const response = await
|
|
29
|
+
const response = await getAxiosInstance().post(url, request);
|
|
18
30
|
if (response.status === 200) {
|
|
19
31
|
return response.data;
|
|
20
32
|
}
|
|
@@ -23,7 +35,7 @@ const saveBrandPageAsync = async (brandPageType, request, designDraftToken) => {
|
|
|
23
35
|
const setBrandPageSlugAsync = async (brandPageType, designDraftToken, options) => {
|
|
24
36
|
const { slug, shouldPublish, brandPageContentTypes } = options;
|
|
25
37
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/publish`;
|
|
26
|
-
const response = await
|
|
38
|
+
const response = await getAxiosInstance().post(url, {
|
|
27
39
|
slug,
|
|
28
40
|
shouldPublish,
|
|
29
41
|
brandPageContentTypes: brandPageContentTypes || [],
|
|
@@ -35,7 +47,7 @@ const setBrandPageSlugAsync = async (brandPageType, designDraftToken, options) =
|
|
|
35
47
|
};
|
|
36
48
|
const createDefaultBrandPage = async (brandPageType, slug, logoDraftToken) => {
|
|
37
49
|
const url = `${getApiUrlPrefix(brandPageType)}/${slug}/default/${logoDraftToken}`;
|
|
38
|
-
const response = await
|
|
50
|
+
const response = await getAxiosInstance().get(url);
|
|
39
51
|
if (response.status !== 200) {
|
|
40
52
|
return null;
|
|
41
53
|
}
|
|
@@ -43,7 +55,7 @@ const createDefaultBrandPage = async (brandPageType, slug, logoDraftToken) => {
|
|
|
43
55
|
};
|
|
44
56
|
const unpublishBrandPageAsync = async (brandPageType, designDraftToken) => {
|
|
45
57
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/unpublish`;
|
|
46
|
-
const response = await
|
|
58
|
+
const response = await getAxiosInstance().post(url);
|
|
47
59
|
if (response.status !== 200) {
|
|
48
60
|
return null;
|
|
49
61
|
}
|
|
@@ -51,7 +63,7 @@ const unpublishBrandPageAsync = async (brandPageType, designDraftToken) => {
|
|
|
51
63
|
};
|
|
52
64
|
const updateBrandPageMetaAsync = async (brandPageType, designDraftToken, request) => {
|
|
53
65
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/meta`;
|
|
54
|
-
const response = await
|
|
66
|
+
const response = await getAxiosInstance().put(url, request);
|
|
55
67
|
if (response.status !== 200) {
|
|
56
68
|
return null;
|
|
57
69
|
}
|
|
@@ -59,7 +71,7 @@ const updateBrandPageMetaAsync = async (brandPageType, designDraftToken, request
|
|
|
59
71
|
};
|
|
60
72
|
const updateSensitiveContentAsync = async (brandPageType, designDraftToken, request) => {
|
|
61
73
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/updateSensitiveContent`;
|
|
62
|
-
const response = await
|
|
74
|
+
const response = await getAxiosInstance().put(url, request);
|
|
63
75
|
if (response.status !== 200) {
|
|
64
76
|
return null;
|
|
65
77
|
}
|
|
@@ -67,11 +79,11 @@ const updateSensitiveContentAsync = async (brandPageType, designDraftToken, requ
|
|
|
67
79
|
};
|
|
68
80
|
const triggerBrandPageSavedEvent = async (brandPageType, designDraftToken, request) => {
|
|
69
81
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/events/saved`;
|
|
70
|
-
await
|
|
82
|
+
await getAxiosInstance().post(url, request);
|
|
71
83
|
};
|
|
72
84
|
const getStripeOnboardingUrl = async (brandPageType, designDraftToken, taxId, options = {}) => {
|
|
73
85
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/payment-providers/stripe/onboarding${taxId ? `?taxId=${taxId}` : ''}`;
|
|
74
|
-
const response = await
|
|
86
|
+
const response = await getAxiosInstance().post(url, options);
|
|
75
87
|
if (response.status !== 200) {
|
|
76
88
|
return null;
|
|
77
89
|
}
|
|
@@ -79,14 +91,14 @@ const getStripeOnboardingUrl = async (brandPageType, designDraftToken, taxId, op
|
|
|
79
91
|
};
|
|
80
92
|
const getBrandPageCustomDomainStatusAsync = async (brandPageType, designDraftToken) => {
|
|
81
93
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/custom-domains/latest`;
|
|
82
|
-
const response = await
|
|
94
|
+
const response = await getAxiosInstance().get(url);
|
|
83
95
|
return response.data;
|
|
84
96
|
};
|
|
85
97
|
const createBrandPageCustomDomainAsync = async (brandPageType, designDraftToken, domainName, isPurchasedDomain) => {
|
|
86
98
|
const url = isPurchasedDomain
|
|
87
99
|
? `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/purchased-domains`
|
|
88
100
|
: `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/custom-domains`;
|
|
89
|
-
const response = await
|
|
101
|
+
const response = await getAxiosInstance().post(url, { domainName }, {
|
|
90
102
|
validateStatus: () => true,
|
|
91
103
|
});
|
|
92
104
|
return response;
|
|
@@ -94,7 +106,7 @@ const createBrandPageCustomDomainAsync = async (brandPageType, designDraftToken,
|
|
|
94
106
|
const checkWebsiteSlugAsync = async (brandPageType, designDraftToken, slug) => {
|
|
95
107
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/slug-check?slug=${encodeURIComponent(slug)}`;
|
|
96
108
|
try {
|
|
97
|
-
const response = await
|
|
109
|
+
const response = await getAxiosInstance().get(url);
|
|
98
110
|
return response.data;
|
|
99
111
|
}
|
|
100
112
|
catch (error) {
|
|
@@ -107,26 +119,26 @@ const checkWebsiteSlugAsync = async (brandPageType, designDraftToken, slug) => {
|
|
|
107
119
|
};
|
|
108
120
|
const deleteBrandPageCustomDomainByCustomDomainIdAsync = async (brandPageType, designDraftToken, customDomainId) => {
|
|
109
121
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/custom-domains/${customDomainId}`;
|
|
110
|
-
await
|
|
122
|
+
await getAxiosInstance().delete(url);
|
|
111
123
|
};
|
|
112
124
|
const getBrandPageCustomDomainConfigAsync = async (brandPageType) => {
|
|
113
125
|
const url = `${getApiUrlPrefix(brandPageType)}/custom-domains/configs/default`;
|
|
114
|
-
const response = await
|
|
126
|
+
const response = await getAxiosInstance().get(url);
|
|
115
127
|
return response.data;
|
|
116
128
|
};
|
|
117
129
|
const updateBrandPageIsCustomDomainEnabledAsync = async (brandPageType, designDraftToken, isCustomDomainEnabled) => {
|
|
118
130
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/is-custom-domain-enabled`;
|
|
119
|
-
const response = await
|
|
131
|
+
const response = await getAxiosInstance().put(url, { isCustomDomainEnabled });
|
|
120
132
|
return response.data;
|
|
121
133
|
};
|
|
122
134
|
const getBrandPageIsCustomDomainEnabledAsync = async (brandPageType, designDraftToken) => {
|
|
123
135
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/is-custom-domain-enabled`;
|
|
124
|
-
const response = await
|
|
136
|
+
const response = await getAxiosInstance().get(url);
|
|
125
137
|
return response.data;
|
|
126
138
|
};
|
|
127
139
|
const getBrandPageCustomDomainAsync = async (brandPageType, designDraftToken) => {
|
|
128
140
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/custom-domains/latest`;
|
|
129
|
-
const response = await
|
|
141
|
+
const response = await getAxiosInstance().get(url, {
|
|
130
142
|
validateStatus: (status) => status === 200 || status === 404,
|
|
131
143
|
});
|
|
132
144
|
return response.status === 200 ? response.data : null;
|
|
@@ -2437,6 +2437,9 @@ a.maker-anchor {
|
|
|
2437
2437
|
.tw-p-4 {
|
|
2438
2438
|
padding: 1rem
|
|
2439
2439
|
}
|
|
2440
|
+
.tw-p-5 {
|
|
2441
|
+
padding: 1.25rem
|
|
2442
|
+
}
|
|
2440
2443
|
.tw-p-6 {
|
|
2441
2444
|
padding: 1.5rem
|
|
2442
2445
|
}
|
|
@@ -4201,31 +4204,31 @@ a.maker-anchor {
|
|
|
4201
4204
|
}
|
|
4202
4205
|
|
|
4203
4206
|
/* Ensure modal height is not longer than screen */
|
|
4204
|
-
.modal[data-v-
|
|
4207
|
+
.modal[data-v-2696e479] {
|
|
4205
4208
|
max-height: 100vh;
|
|
4206
4209
|
}
|
|
4207
|
-
.modal.modal-bg[data-v-
|
|
4210
|
+
.modal.modal-bg[data-v-2696e479] {
|
|
4208
4211
|
background-image: url(https://bcassetcdn.com/scl-assets/images/modal-background.svg);
|
|
4209
4212
|
}
|
|
4210
4213
|
|
|
4211
4214
|
/* Hide scrollbar for Chrome, Safari and Opera */
|
|
4212
|
-
.modal .hide-scroll[data-v-
|
|
4215
|
+
.modal .hide-scroll[data-v-2696e479]::-webkit-scrollbar {
|
|
4213
4216
|
display: none;
|
|
4214
4217
|
}
|
|
4215
|
-
.modal .hide-scroll[data-v-
|
|
4218
|
+
.modal .hide-scroll[data-v-2696e479] {
|
|
4216
4219
|
-ms-overflow-style: none; /* IE and Edge */
|
|
4217
4220
|
scrollbar-width: none; /* Firefox */
|
|
4218
4221
|
}
|
|
4219
|
-
.modal .header-min-height[data-v-
|
|
4222
|
+
.modal .header-min-height[data-v-2696e479] {
|
|
4220
4223
|
min-height: 32px; /* For close button */
|
|
4221
4224
|
}
|
|
4222
|
-
.modal.modal-image .modal-content img[data-v-
|
|
4225
|
+
.modal.modal-image .modal-content img[data-v-2696e479] {
|
|
4223
4226
|
max-width: 100%;
|
|
4224
4227
|
max-height: 90vh;
|
|
4225
4228
|
}
|
|
4226
4229
|
|
|
4227
4230
|
/* Swiper keyboard event will not work if wrapper content height is larger than the screen height */
|
|
4228
|
-
.modal[data-v-
|
|
4231
|
+
.modal[data-v-2696e479] .swiper-wrapper {
|
|
4229
4232
|
max-height: 90vh;
|
|
4230
4233
|
}
|
|
4231
4234
|
|
|
@@ -4271,26 +4274,26 @@ a.maker-anchor {
|
|
|
4271
4274
|
}
|
|
4272
4275
|
|
|
4273
4276
|
@media (max-width: 640px) {
|
|
4274
|
-
.desktop-cta[data-v-
|
|
4277
|
+
.desktop-cta[data-v-ddc11969] {
|
|
4275
4278
|
display: none;
|
|
4276
4279
|
width: 100%;
|
|
4277
4280
|
}
|
|
4278
4281
|
}
|
|
4279
4282
|
@media (min-width: 640px) {
|
|
4280
|
-
.mobile-cta[data-v-
|
|
4283
|
+
.mobile-cta[data-v-ddc11969] {
|
|
4281
4284
|
display: none;
|
|
4282
4285
|
width: 100%;
|
|
4283
4286
|
}
|
|
4284
4287
|
}
|
|
4285
4288
|
|
|
4286
4289
|
@media (max-width: 640px) {
|
|
4287
|
-
[data-v-
|
|
4290
|
+
[data-v-1d823e14] .publish-bp--modal {
|
|
4288
4291
|
max-height: 90vh;
|
|
4289
4292
|
width: 90vw;
|
|
4290
4293
|
}
|
|
4291
4294
|
}
|
|
4292
4295
|
@media (min-width: 640px) {
|
|
4293
|
-
[data-v-
|
|
4296
|
+
[data-v-1d823e14] .publish-bp--modal {
|
|
4294
4297
|
max-height: 80vh;
|
|
4295
4298
|
width: 90vw;
|
|
4296
4299
|
}
|