@designcrowd/library.brand-page 5.19.1 → 5.19.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-BmeMc9oz.js → CreatedOnBrandCrowd-de-de-Ekmn0O3s.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CQNdm_6P.js → CreatedOnBrandCrowd-en-us-BjeXlKTS.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BrmHWeAM.js → CreatedOnBrandCrowd-es-es-rpNINAMY.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CaIyjTXl.js → CreatedOnBrandCrowd-fr-ca-BL4nSaLj.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CaIyjTXl.js → CreatedOnBrandCrowd-fr-fr-BL4nSaLj.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-BClE0Nd9.js → CreatedOnBrandCrowd-pt-br-K0r4FyYq.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-BClE0Nd9.js → CreatedOnBrandCrowd-pt-pt-K0r4FyYq.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CkrdlPqK.js → CreatedOnDcom-de-de-0XYyEKYc.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D33J9qky.js → CreatedOnDcom-en-us-E8hvwiMd.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BsmInngw.js → CreatedOnDcom-es-es-pRuCd7xX.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DOXlsRea.js → CreatedOnDcom-fr-ca-Bu4V3jpn.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-SfFYLtyn.js → CreatedOnDcom-fr-fr-CCcrGNz2.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DcWeuZUy.js → CreatedOnDcom-pt-br-1GTvaLKd.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-DZsZZ4iX.js → CreatedOnDcom-pt-pt-CTIYW10X.js} +1 -1
- package/lib/src/brand-page/models/index.d.ts +1 -0
- package/lib/src/brand-page/models/index.js +3 -0
- package/lib/src/brand-page/utils/personalisation.util.js +72 -14
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +6 -0
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +12 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +2 -0
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +1 -0
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +2 -3
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +16 -5
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +6 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +1 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +3 -0
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +3 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +5 -1
- package/lib/src/brand-page-maker/stores/ui/ui-store.d.ts +6 -0
- package/lib/src/brand-page-maker/stores/ui/ui-store.js +8 -0
- package/lib/src/clients/design-template-client.d.ts +3 -0
- package/lib/src/clients/models.d.ts +2 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +19 -7
- package/lib/src/css/library.brand-page-brandPage.min.css +19 -7
- package/lib/src/css/library.brand-page-designCom.min.css +19 -7
- package/lib/src/css/library.brand-page-preview.min.css +19 -7
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-C5vGkjfs.js → lib-BfgUqu0B.js} +22777 -22678
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +7 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +9 -0
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/logo-versions/LogoVersions.mixin.d.ts +6 -0
- package/lib/src/shared/models.d.ts +2 -0
- package/lib/src/shared/my-designs/MyDesigns.mixin.d.ts +6 -0
- package/lib/src/shared/my-uploads/MyMedia.mixin.d.ts +6 -0
- package/lib/src/shared/my-uploads/MyUploads.mixin.d.ts +6 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +7 -1
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +7 -1
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +7 -1
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +10 -439
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.js +2 -2
- package/lib/src/shared/template-settings/models.d.ts +1 -0
- package/lib/src/shared/template-settings/store/template-settings-store.d.ts +4 -0
- package/lib/src/shared/template-settings/store/template-settings-store.js +79 -11
- package/lib/src/shared/unsplash-library/UnsplashLibrary.mixin.d.ts +6 -0
- package/package.json +1 -1
- package/src/brand-page/models/index.ts +4 -0
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -0
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +1 -0
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +2 -0
- package/src/brand-page/utils/personalisation.util.test.ts +35 -0
- package/src/brand-page/utils/personalisation.util.ts +119 -23
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +4 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +1 -0
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +22 -8
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +5 -10
- package/src/brand-page-maker/components/template-preview/TemplatePreviewAiBadge.vue +12 -0
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +5 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +10 -0
- package/src/brand-page-maker/stores/ui/ui-store.ts +16 -0
- package/src/clients/design-template-client.ts +3 -0
- package/src/clients/models.ts +2 -0
- package/src/shared/models.ts +6 -0
- package/src/shared/template-settings/components/TemplatesSettings.mixin.ts +2 -2
- package/src/shared/template-settings/models.ts +1 -0
- package/src/shared/template-settings/store/template-settings-store.ts +105 -18
|
@@ -400,6 +400,9 @@ export class PageFooterMobile extends AbstractPageFooterStyles {
|
|
|
400
400
|
export class BrandPageModel {
|
|
401
401
|
// Model version
|
|
402
402
|
v;
|
|
403
|
+
// AI personalisation key persisted with the draft so previews survive login/checkout-back/
|
|
404
|
+
// refresh - content is retrieved by this token (user-agnostic), not regenerated (bp-5742).
|
|
405
|
+
userPromptContentKey;
|
|
403
406
|
styles;
|
|
404
407
|
/** @deprecated */
|
|
405
408
|
headerStyles;
|
|
@@ -206,15 +206,59 @@ const getPersonalisationValueAsync = async (section, property) => {
|
|
|
206
206
|
}
|
|
207
207
|
return { value: propertyValue, section };
|
|
208
208
|
};
|
|
209
|
+
// The userPrompt AI content generation only populates these content-bearing sections
|
|
210
|
+
// (see GenerateAiDesignMakerContentService / GenerateWebsiteContentService - About,
|
|
211
|
+
// Information, Profile, Media). Sections like email/website/phone are never generated, so
|
|
212
|
+
// blocks whose role points at an ungenerated section fall back to this pool.
|
|
213
|
+
const PERSONALISATION_FALLBACK_ROLES = [
|
|
214
|
+
'profile',
|
|
215
|
+
'about',
|
|
216
|
+
'information',
|
|
217
|
+
'media',
|
|
218
|
+
];
|
|
219
|
+
// "Effectively empty" = no renderable content (ungenerated userPrompt sections like
|
|
220
|
+
// email/website/phone). A section that has data but lacks one property is NOT empty - it
|
|
221
|
+
// intentionally keeps its original content.
|
|
222
|
+
const isSectionEffectivelyEmpty = (section) => {
|
|
223
|
+
if (!section) {
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
return (!section.title &&
|
|
227
|
+
!section.name &&
|
|
228
|
+
!section.url &&
|
|
229
|
+
!section.description &&
|
|
230
|
+
!section.descriptionShort &&
|
|
231
|
+
!section.ctaTitle &&
|
|
232
|
+
!section.imageUrls?.length &&
|
|
233
|
+
!section.shapes?.length &&
|
|
234
|
+
!section.items?.length &&
|
|
235
|
+
!section.mainShapesCollection?.tall?.length &&
|
|
236
|
+
!section.mainShapesCollection?.square?.length &&
|
|
237
|
+
!section.mainShapesCollection?.wide?.length);
|
|
238
|
+
};
|
|
239
|
+
// Resolve a property from a specific role's section. Returns null when that section is
|
|
240
|
+
// ungenerated (effectively empty) or cannot supply the property, so the caller can try the
|
|
241
|
+
// next role.
|
|
242
|
+
const resolvePersonalisationValueForRoleAsync = async (role, property, personalisation) => {
|
|
243
|
+
const key = `${role}Section`;
|
|
244
|
+
const section = personalisation[key];
|
|
245
|
+
if (isSectionEffectivelyEmpty(section)) {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
const { value, section: updatedSection, valuesToUpdate, } = await getPersonalisationValueAsync(section, property);
|
|
249
|
+
if (value === undefined || value === null) {
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
value,
|
|
254
|
+
personalisation: { ...personalisation, [key]: updatedSection },
|
|
255
|
+
valuesToUpdate,
|
|
256
|
+
};
|
|
257
|
+
};
|
|
209
258
|
const getPersonalisationValueFromPropertyAsync = async (propertyKey, propertyValue, personalisationRole, personalisationOverride, personalisation, contentType) => {
|
|
210
259
|
if (!personalisationRole || personalisationOverride === 'none') {
|
|
211
260
|
return { value: undefined, personalisation };
|
|
212
261
|
}
|
|
213
|
-
const matchingValue = Object.entries(personalisation).find(([key]) => key === `${personalisationRole}Section`);
|
|
214
|
-
if (!matchingValue) {
|
|
215
|
-
return { value: undefined, personalisation };
|
|
216
|
-
}
|
|
217
|
-
const section = matchingValue[1];
|
|
218
262
|
const mapping = getPersonalisationMappingForContentType(contentType);
|
|
219
263
|
const matchingProperty = Object.entries(mapping).find(([, value]) => value.includes(propertyKey));
|
|
220
264
|
if (!matchingProperty) {
|
|
@@ -225,15 +269,29 @@ const getPersonalisationValueFromPropertyAsync = async (propertyKey, propertyVal
|
|
|
225
269
|
brandPageType: personalisation.type,
|
|
226
270
|
isSvgShape: typeof propertyValue === 'string' && propertyValue.endsWith('.svg'),
|
|
227
271
|
});
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
272
|
+
const primaryKey = `${personalisationRole}Section`;
|
|
273
|
+
const primarySection = personalisation[primaryKey];
|
|
274
|
+
// When the block's own section has content, use it as-is - this preserves existing
|
|
275
|
+
// behaviour, including legitimately keeping the original when that section lacks a
|
|
276
|
+
// specific property (e.g. no items, or an invalid shape).
|
|
277
|
+
if (!isSectionEffectivelyEmpty(primarySection)) {
|
|
278
|
+
const { value, section: updatedSection, valuesToUpdate, } = await getPersonalisationValueAsync(primarySection, property);
|
|
279
|
+
return {
|
|
280
|
+
value,
|
|
281
|
+
personalisation: { ...personalisation, [primaryKey]: updatedSection },
|
|
282
|
+
valuesToUpdate,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
// The block's section was never generated - fall back to the first populated section that
|
|
286
|
+
// can supply this property, so it doesn't render the "should be AI generated" placeholder.
|
|
287
|
+
// Never reached when the section exists (above) or all are populated (AI Website Builder).
|
|
288
|
+
for (const role of PERSONALISATION_FALLBACK_ROLES) {
|
|
289
|
+
const resolved = await resolvePersonalisationValueForRoleAsync(role, property, personalisation);
|
|
290
|
+
if (resolved) {
|
|
291
|
+
return resolved;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return { value: undefined, personalisation };
|
|
237
295
|
};
|
|
238
296
|
const applyPersonalisationToBrandPageContentsRecursiveAsync = async (personalisation, mappingType, content, personalisationRole) => {
|
|
239
297
|
let isApplied = false;
|
|
@@ -127,7 +127,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
127
127
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
128
128
|
}): void;
|
|
129
129
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("@brand-page/models").BrandPageModel): Promise<void>;
|
|
130
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
130
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
131
131
|
initialisePages({ pages, sections, }: {
|
|
132
132
|
pages: import("@brand-page/models").PageModel[];
|
|
133
133
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -251,6 +251,12 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
251
251
|
setUserPersonalisationData({ personalisationData, }: {
|
|
252
252
|
personalisationData: import("../../../brand-page").UserPersonalisationContent[];
|
|
253
253
|
}): void;
|
|
254
|
+
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
255
|
+
userPromptContentKey: string | undefined;
|
|
256
|
+
}): void;
|
|
257
|
+
setShowAiTemplatesTab({ showAiTemplatesTab, }: {
|
|
258
|
+
showAiTemplatesTab: boolean;
|
|
259
|
+
}): void;
|
|
254
260
|
onBackgroundChanged(): void;
|
|
255
261
|
onContentChanged(): void;
|
|
256
262
|
onStyleChanged(): void;
|
|
@@ -20,6 +20,8 @@ export interface BrandPageMakerViewModel {
|
|
|
20
20
|
initialCategories: InitialCategories;
|
|
21
21
|
personalisation?: UserPersonalisationContent[];
|
|
22
22
|
isPersonalisationEnabled?: boolean;
|
|
23
|
+
userPromptContentKey?: string;
|
|
24
|
+
showAiTemplatesTab?: boolean;
|
|
23
25
|
brandPageType?: BrandPageType;
|
|
24
26
|
businessName?: string;
|
|
25
27
|
industry?: string;
|
|
@@ -172,7 +174,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
172
174
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
173
175
|
}): void;
|
|
174
176
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("@brand-page").BrandPageModel): Promise<void>;
|
|
175
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
177
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
176
178
|
initialisePages({ pages, sections, }: {
|
|
177
179
|
pages: import("@brand-page").PageModel[];
|
|
178
180
|
sections: import("@shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -953,6 +955,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
953
955
|
setUserPersonalisationData({ personalisationData, }: {
|
|
954
956
|
personalisationData: UserPersonalisationContent[];
|
|
955
957
|
}): void;
|
|
958
|
+
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
959
|
+
userPromptContentKey: string | undefined;
|
|
960
|
+
}): void;
|
|
961
|
+
setShowAiTemplatesTab({ showAiTemplatesTab, }: {
|
|
962
|
+
showAiTemplatesTab: boolean;
|
|
963
|
+
}): void;
|
|
956
964
|
onBackgroundChanged(): void;
|
|
957
965
|
onContentChanged(): void;
|
|
958
966
|
onStyleChanged(): void;
|
|
@@ -1099,6 +1107,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1099
1107
|
initialSearchTerm: string;
|
|
1100
1108
|
onSearchTermChanged?: import("@shared/template-settings/store").OnSearchTermChangedCallback | undefined;
|
|
1101
1109
|
}): void;
|
|
1110
|
+
setAiTemplateKeywords(payload: {
|
|
1111
|
+
aiTemplateKeywords: string;
|
|
1112
|
+
}): void;
|
|
1102
1113
|
notifySearchTermChanged(searchTerm: string | undefined): void;
|
|
1103
1114
|
clearTemplates(): void;
|
|
1104
1115
|
getTemplateByTemplateId(id: string): import("@shared/template-settings/models").TemplateSettingsTemplate | undefined;
|
|
@@ -150,6 +150,8 @@ export default defineComponent({
|
|
|
150
150
|
templateCategories: this.viewModel.templateCategories,
|
|
151
151
|
personalisationData: this.viewModel.personalisation,
|
|
152
152
|
isPersonalisationEnabled: this.viewModel.isPersonalisationEnabled || false,
|
|
153
|
+
userPromptContentKey: this.viewModel.userPromptContentKey,
|
|
154
|
+
showAiTemplatesTab: this.viewModel.showAiTemplatesTab || false,
|
|
153
155
|
brandPageType: this.viewModel.brandPageType,
|
|
154
156
|
businessName: this.viewModel.businessName,
|
|
155
157
|
industry: this.viewModel.industry,
|
|
@@ -116,7 +116,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
116
116
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
117
117
|
}): void;
|
|
118
118
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("../../../lib").BrandPageModel): Promise<void>;
|
|
119
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
|
|
119
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
|
|
120
120
|
initialisePages({ pages, sections, }: {
|
|
121
121
|
pages: import("../../../lib").PageModel[];
|
|
122
122
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts
CHANGED
|
@@ -636,7 +636,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
636
636
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
637
637
|
}): void;
|
|
638
638
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("@brand-page").BrandPageModel): Promise<void>;
|
|
639
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
639
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
640
640
|
initialisePages({ pages, sections, }: {
|
|
641
641
|
pages: import("@brand-page").PageModel[];
|
|
642
642
|
sections: import("@shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -122,7 +122,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
122
122
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
123
123
|
}): void;
|
|
124
124
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("../../../brand-page").BrandPageModel): Promise<void>;
|
|
125
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
125
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
126
126
|
initialisePages({ pages, sections, }: {
|
|
127
127
|
pages: import("../../../brand-page").PageModel[];
|
|
128
128
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -400,7 +400,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
400
400
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
401
401
|
}): void;
|
|
402
402
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("../../../brand-page").BrandPageModel): Promise<void>;
|
|
403
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
403
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
404
404
|
initialisePages({ pages, sections, }: {
|
|
405
405
|
pages: import("../../../brand-page").PageModel[];
|
|
406
406
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -401,7 +401,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
401
401
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
402
402
|
}): void;
|
|
403
403
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("../../../brand-page").BrandPageModel): Promise<void>;
|
|
404
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
404
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
405
405
|
initialisePages({ pages, sections, }: {
|
|
406
406
|
pages: import("../../../brand-page").PageModel[];
|
|
407
407
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -132,7 +132,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
132
132
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
133
133
|
}): void;
|
|
134
134
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("../../../brand-page").BrandPageModel): Promise<void>;
|
|
135
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
135
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
136
136
|
initialisePages({ pages, sections, }: {
|
|
137
137
|
pages: import("../../../brand-page").PageModel[];
|
|
138
138
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="types/lodash-shims" />
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { BrandPageContext, BrandPageViewModel, LogoImageModel, LogoTemplateImageModel, LogoTheme, UserPersonalisation } from '@brand-page';
|
|
4
|
-
import {
|
|
4
|
+
import type { TemplateSettingsTemplate } from '@shared/template-settings/models';
|
|
5
5
|
import type { DebounceHandle } from 'lodash.debounce';
|
|
6
6
|
interface TemplatePreviewData {
|
|
7
7
|
containerStyle: BrandPageCssStyle;
|
|
@@ -68,7 +68,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
68
68
|
isAdmin: import("vue").ComputedRef<boolean>;
|
|
69
69
|
userToken: import("vue").ComputedRef<string | undefined>;
|
|
70
70
|
isBrandSite: import("vue").ComputedRef<boolean>;
|
|
71
|
-
selectedTab: import("vue").ComputedRef<string>;
|
|
72
71
|
renderAsImage: import("vue").ComputedRef<boolean>;
|
|
73
72
|
brandPageMakerUserStore: import("pinia").Store<"brandPageMakerUser", import("@brand-page-maker/stores").UserState, {}, {
|
|
74
73
|
setUserState(payload: {
|
|
@@ -452,7 +451,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
452
451
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
453
452
|
}): void;
|
|
454
453
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("@brand-page").BrandPageModel): Promise<void>;
|
|
455
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
454
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
456
455
|
initialisePages({ pages, sections, }: {
|
|
457
456
|
pages: import("@brand-page").PageModel[];
|
|
458
457
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -2,7 +2,6 @@ import { computed, defineComponent } from 'vue';
|
|
|
2
2
|
import { BRAND_PAGE_TYPES, MEDIA_SIZES, VIEWPORTS } from '@brand-page';
|
|
3
3
|
import { applyLogoThemeToBrandPageModel, applyUserPersonalisationToBrandPageModelAsync, getBrandPageViewModelFromBrandPageModel, } from '@brand-page/utils';
|
|
4
4
|
import { STYLE_THEME_KEYS } from '@brand-page/constants';
|
|
5
|
-
import { TEMPLATE_TABS, } from '@shared/template-settings/models';
|
|
6
5
|
import debounce from 'lodash.debounce';
|
|
7
6
|
import { MOBILE_HEIGHT, MOBILE_WIDTH } from '@brand-page-maker/constants';
|
|
8
7
|
import { useBrandPageContainerStore, useBrandPageMakerStore, useBrandPageMakerUserStore, } from '@brand-page-maker/stores';
|
|
@@ -24,7 +23,6 @@ export default defineComponent({
|
|
|
24
23
|
isAdmin: computed(() => brandPageMakerUserStore.isAdmin),
|
|
25
24
|
userToken: computed(() => brandPageMakerUserStore.userToken),
|
|
26
25
|
isBrandSite: computed(() => brandPageMakerStore.brandPageType === BRAND_PAGE_TYPES.brandSite),
|
|
27
|
-
selectedTab: computed(() => templateSettingsStore.selectedTab.key),
|
|
28
26
|
renderAsImage: computed(() => templateSettingsStore.renderAsImage),
|
|
29
27
|
brandPageMakerUserStore,
|
|
30
28
|
brandPageContainerStore,
|
|
@@ -171,11 +169,24 @@ export default defineComponent({
|
|
|
171
169
|
if (!previewImageUrl) {
|
|
172
170
|
return '';
|
|
173
171
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
const isAlreadyPersonalised = previewImageUrl.includes('contentKey=') ||
|
|
173
|
+
previewImageUrl.includes('userPromptContentKey=');
|
|
174
|
+
if (this.isPersonalisable &&
|
|
175
|
+
this.template.contentKey &&
|
|
176
|
+
!isAlreadyPersonalised) {
|
|
177
|
+
if (this.userToken && !this.template.usesUserPromptContentKey) {
|
|
178
|
+
previewImageUrl += `&contentKey=${this.template.contentKey}`;
|
|
179
|
+
// The backend already bakes userToken into brand-site preview URLs. Only add
|
|
180
|
+
// it when missing - two userToken params parse as an array and the preview
|
|
181
|
+
// renderer rejects it ("userToken must be a string type") (bp-5765).
|
|
182
|
+
if (!previewImageUrl.includes('userToken=')) {
|
|
183
|
+
previewImageUrl += `&userToken=${this.userToken}`;
|
|
184
|
+
}
|
|
177
185
|
}
|
|
178
186
|
else {
|
|
187
|
+
// userPromptContentKey resolves from the userPrompt S3 bucket (real AI images).
|
|
188
|
+
// Post-purchase designs with a userPrompt key route here too, NOT through the
|
|
189
|
+
// userToken/regular-bucket branch above which holds placeholders (bp-5454).
|
|
179
190
|
previewImageUrl += `&userPromptContentKey=${this.template.contentKey}`;
|
|
180
191
|
}
|
|
181
192
|
}
|
|
@@ -8,6 +8,7 @@ export declare const useAiCheckpointStore: import("pinia").StoreDefinition<"aiCh
|
|
|
8
8
|
userMessageId: string;
|
|
9
9
|
model: {
|
|
10
10
|
v: number;
|
|
11
|
+
userPromptContentKey?: string | undefined;
|
|
11
12
|
styles: {
|
|
12
13
|
backgroundStyles: {
|
|
13
14
|
style: {
|
|
@@ -5116,6 +5117,7 @@ export declare const useAiCheckpointStore: import("pinia").StoreDefinition<"aiCh
|
|
|
5116
5117
|
userMessageId: string;
|
|
5117
5118
|
model: {
|
|
5118
5119
|
v: number;
|
|
5120
|
+
userPromptContentKey?: string | undefined;
|
|
5119
5121
|
styles: {
|
|
5120
5122
|
backgroundStyles: {
|
|
5121
5123
|
style: {
|
|
@@ -10230,6 +10232,7 @@ export declare const useAiCheckpointStore: import("pinia").StoreDefinition<"aiCh
|
|
|
10230
10232
|
userMessageId: string;
|
|
10231
10233
|
model: {
|
|
10232
10234
|
v: number;
|
|
10235
|
+
userPromptContentKey?: string | undefined;
|
|
10233
10236
|
styles: {
|
|
10234
10237
|
backgroundStyles: {
|
|
10235
10238
|
style: {
|
|
@@ -15338,6 +15341,7 @@ export declare const useAiCheckpointStore: import("pinia").StoreDefinition<"aiCh
|
|
|
15338
15341
|
userMessageId: string;
|
|
15339
15342
|
model: {
|
|
15340
15343
|
v: number;
|
|
15344
|
+
userPromptContentKey?: string | undefined;
|
|
15341
15345
|
styles: {
|
|
15342
15346
|
backgroundStyles: {
|
|
15343
15347
|
style: {
|
|
@@ -20452,6 +20456,7 @@ export declare const useAiCheckpointStore: import("pinia").StoreDefinition<"aiCh
|
|
|
20452
20456
|
userMessageId: string;
|
|
20453
20457
|
model: {
|
|
20454
20458
|
v: number;
|
|
20459
|
+
userPromptContentKey?: string | undefined;
|
|
20455
20460
|
styles: {
|
|
20456
20461
|
backgroundStyles: {
|
|
20457
20462
|
style: {
|
|
@@ -25560,6 +25565,7 @@ export declare const useAiCheckpointStore: import("pinia").StoreDefinition<"aiCh
|
|
|
25560
25565
|
userMessageId: string;
|
|
25561
25566
|
model: {
|
|
25562
25567
|
v: number;
|
|
25568
|
+
userPromptContentKey?: string | undefined;
|
|
25563
25569
|
styles: {
|
|
25564
25570
|
backgroundStyles: {
|
|
25565
25571
|
style: {
|
|
@@ -75,6 +75,7 @@ export type InitialisePayload = Omit<BrandPageContainerState, 'customDomain' | '
|
|
|
75
75
|
logoDraftAssets: LogoDraftAsset[];
|
|
76
76
|
gettyVideos: GettyVideoEditorViewModelResponse[];
|
|
77
77
|
templateSearchTerm: string | undefined;
|
|
78
|
+
aiTemplateKeywords: string | undefined;
|
|
78
79
|
onSearchTermChanged?: OnSearchTermChangedCallback;
|
|
79
80
|
};
|
|
80
81
|
export declare const BRANDPAGE_STATUS: Readonly<{
|
|
@@ -137,6 +137,9 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
137
137
|
initialSearchTerm: payload.templateSearchTerm ?? '',
|
|
138
138
|
onSearchTermChanged: payload.onSearchTermChanged,
|
|
139
139
|
});
|
|
140
|
+
templateSettingsStore.setAiTemplateKeywords({
|
|
141
|
+
aiTemplateKeywords: payload.aiTemplateKeywords ?? '',
|
|
142
|
+
});
|
|
140
143
|
brandPageMakerStore.setSelectedTemplateId({
|
|
141
144
|
templateId: this.designTemplateToken,
|
|
142
145
|
});
|
|
@@ -20,6 +20,8 @@ export interface InitialisePayload {
|
|
|
20
20
|
templateCategories: TemplateCategory[];
|
|
21
21
|
personalisationData?: UserPersonalisationContent[];
|
|
22
22
|
isPersonalisationEnabled: boolean;
|
|
23
|
+
userPromptContentKey?: string;
|
|
24
|
+
showAiTemplatesTab?: boolean;
|
|
23
25
|
businessName: string | undefined;
|
|
24
26
|
industry: string | undefined;
|
|
25
27
|
layout?: string;
|
|
@@ -231,7 +233,7 @@ export declare const useBrandPageMakerStore: import("pinia").StoreDefinition<"br
|
|
|
231
233
|
brandPageType: BrandPageType;
|
|
232
234
|
}): void;
|
|
233
235
|
initialiseStoresByBrandPageModelAsync(brandPageModel: BrandPageModel): Promise<void>;
|
|
234
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: InitialisePayload): Promise<void>;
|
|
236
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: InitialisePayload): Promise<void>;
|
|
235
237
|
initialisePages({ pages, sections, }: {
|
|
236
238
|
pages: PageModel[];
|
|
237
239
|
sections: PageSettingsStateSections;
|
|
@@ -824,7 +824,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
824
824
|
transformToRTE(pageSettingsStore, externalEditor, undefined, undefined, TEXT_STYLE_TYPES.paragraphs, textStyles.textStyleOptions.paragraphs.style);
|
|
825
825
|
externalEditor.destroy();
|
|
826
826
|
},
|
|
827
|
-
async initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride = false, }) {
|
|
827
|
+
async initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab = false, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride = false, }) {
|
|
828
828
|
const brandPageContainerStore = useBrandPageContainerStore();
|
|
829
829
|
const userStore = useBrandPageMakerUserStore();
|
|
830
830
|
const uiStore = useUiStore();
|
|
@@ -895,6 +895,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
895
895
|
personalisationData: personalisationData,
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
|
+
uiStore.setUserPromptContentKey({ userPromptContentKey });
|
|
899
|
+
uiStore.setShowAiTemplatesTab({ showAiTemplatesTab });
|
|
898
900
|
templateSettingsStore.setTemplateCategories({
|
|
899
901
|
categories: templateCategories,
|
|
900
902
|
});
|
|
@@ -1227,6 +1229,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1227
1229
|
const navigationStyleSettingsStore = useUiNavigationStyleSettingsStore();
|
|
1228
1230
|
const shopStore = useShopConfigStore();
|
|
1229
1231
|
const pageNavigationStore = usePageNavigationStore();
|
|
1232
|
+
const uiStore = useUiStore();
|
|
1230
1233
|
const pages = pageSettingsStore.pages.map((p) => ({
|
|
1231
1234
|
...p,
|
|
1232
1235
|
contents: p.contents.map((c) => c.settings.content),
|
|
@@ -1240,6 +1243,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1240
1243
|
const pageNavStructure = pageNavigationStore.nav;
|
|
1241
1244
|
return {
|
|
1242
1245
|
v: GetLatestModelVersion(),
|
|
1246
|
+
userPromptContentKey: uiStore.userPromptContentKey,
|
|
1243
1247
|
pages,
|
|
1244
1248
|
styles: {
|
|
1245
1249
|
logoStyles,
|
|
@@ -23,6 +23,12 @@ export declare const useUiStore: import("pinia").StoreDefinition<"ui", UIRootSta
|
|
|
23
23
|
setUserPersonalisationData({ personalisationData, }: {
|
|
24
24
|
personalisationData: UserPersonalisationContent[];
|
|
25
25
|
}): void;
|
|
26
|
+
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
27
|
+
userPromptContentKey: string | undefined;
|
|
28
|
+
}): void;
|
|
29
|
+
setShowAiTemplatesTab({ showAiTemplatesTab, }: {
|
|
30
|
+
showAiTemplatesTab: boolean;
|
|
31
|
+
}): void;
|
|
26
32
|
onBackgroundChanged(): void;
|
|
27
33
|
onContentChanged(): void;
|
|
28
34
|
onStyleChanged(): void;
|
|
@@ -27,6 +27,8 @@ export const useUiStore = defineStore('ui', {
|
|
|
27
27
|
},
|
|
28
28
|
personalisationData: undefined,
|
|
29
29
|
isPersonalisationEnabled: false,
|
|
30
|
+
userPromptContentKey: undefined,
|
|
31
|
+
showAiTemplatesTab: false,
|
|
30
32
|
}),
|
|
31
33
|
actions: {
|
|
32
34
|
setLogoTheme(payload) {
|
|
@@ -47,6 +49,12 @@ export const useUiStore = defineStore('ui', {
|
|
|
47
49
|
setUserPersonalisationData({ personalisationData, }) {
|
|
48
50
|
this.personalisationData = personalisationData;
|
|
49
51
|
},
|
|
52
|
+
setUserPromptContentKey({ userPromptContentKey, }) {
|
|
53
|
+
this.userPromptContentKey = userPromptContentKey;
|
|
54
|
+
},
|
|
55
|
+
setShowAiTemplatesTab({ showAiTemplatesTab, }) {
|
|
56
|
+
this.showAiTemplatesTab = showAiTemplatesTab;
|
|
57
|
+
},
|
|
50
58
|
onBackgroundChanged() {
|
|
51
59
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
52
60
|
brandPageMakerStore.onBackgroundChanged();
|