@designcrowd/library.brand-page 5.18.6 → 5.18.7-ast-ai-tab-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-DlYq1LAT.js → CreatedOnBrandCrowd-de-de-DckAzXwS.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-BssRIQqn.js → CreatedOnBrandCrowd-en-us-DZtkkOuW.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BGF9pptH.js → CreatedOnBrandCrowd-es-es-D-cTvYkn.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-Caupqu2Z.js → CreatedOnBrandCrowd-fr-ca-Bu-gxn7L.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-Caupqu2Z.js → CreatedOnBrandCrowd-fr-fr-Bu-gxn7L.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-s9q4uJ4u.js → CreatedOnBrandCrowd-pt-br-Crq_UfGO.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-s9q4uJ4u.js → CreatedOnBrandCrowd-pt-pt-Crq_UfGO.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-UnYnZbA7.js → CreatedOnDcom-de-de-Cvqe8_oh.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-rDv6H12L.js → CreatedOnDcom-en-us-FPobbwat.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DKPLaT6o.js → CreatedOnDcom-es-es-DKsGlrMf.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DAv34bG7.js → CreatedOnDcom-fr-ca-By218_c_.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DsOHnS8q.js → CreatedOnDcom-fr-fr-BFjfB-ra.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DpjDBCLj.js → CreatedOnDcom-pt-br-B7Dibff5.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-rFG0unf1.js → CreatedOnDcom-pt-pt-AYHMrLEG.js} +1 -1
- package/lib/src/brand-page/models/index.d.ts +1 -0
- package/lib/src/brand-page/models/index.js +4 -0
- package/lib/src/brand-page/utils/personalisation.util.js +76 -14
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +8 -3
- 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 +19 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +10 -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 +8 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1 -0
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +91 -3
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +5 -0
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +8 -3
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +3 -0
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.js +11 -0
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +8 -3
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +8 -3
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +8 -3
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +9 -5
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +16 -4
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +9 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +21 -1
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +20 -0
- package/lib/src/brand-page-maker/composables/useEventTracker.js +17 -0
- package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +17 -0
- package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +25 -0
- 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 +44 -3
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +312 -6
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +86 -0
- package/lib/src/brand-page-maker/stores/history/history-store.js +501 -0
- package/lib/src/brand-page-maker/stores/logo-store/logo-store.d.ts +1 -0
- 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/brand-page-maker/stores/user/user-store.js +1 -0
- package/lib/src/bundled-translations-D1q3rSEz.js +175 -0
- package/lib/src/bundled-translations.de-DE-BxqLLwbh.js +175 -0
- package/lib/src/bundled-translations.es-ES-uh249NlJ.js +175 -0
- package/lib/src/bundled-translations.fr-CA-BEQmv2fX.js +175 -0
- package/lib/src/bundled-translations.fr-FR-BnNuCojH.js +175 -0
- package/lib/src/bundled-translations.pt-BR-CJUOxVlq.js +175 -0
- package/lib/src/bundled-translations.pt-PT-Ds9cMEqK.js +175 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +3 -1
- package/lib/src/bundles/bundled-translations.es-ES.json +3 -1
- package/lib/src/bundles/bundled-translations.fr-CA.json +3 -1
- package/lib/src/bundles/bundled-translations.fr-FR.json +3 -1
- package/lib/src/bundles/bundled-translations.json +3 -1
- package/lib/src/bundles/bundled-translations.pt-BR.json +3 -1
- package/lib/src/bundles/bundled-translations.pt-PT.json +3 -1
- package/lib/src/clients/design-template-client.d.ts +3 -0
- package/lib/src/clients/models.d.ts +2 -0
- package/lib/src/constants/ui.d.ts +1 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +39 -22
- package/lib/src/css/library.brand-page-brandPage.min.css +39 -23
- package/lib/src/css/library.brand-page-designCom.min.css +39 -22
- package/lib/src/css/library.brand-page-preview.min.css +39 -22
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-ngdDRkSL.js → lib-zYuG2y1l.js} +34863 -34159
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +91 -3
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +5 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +1 -0
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +24 -3
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +16 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +14 -3
- package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.d.ts +3 -0
- package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.js +19 -2
- package/lib/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.js +18 -8
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +67 -0
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +6 -0
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +28 -0
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +11 -0
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +11 -3
- package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +5 -1
- package/lib/src/shared/logo-settings/store/editable-logo-store.js +31 -0
- 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 +31 -3
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +17 -3
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +24 -3
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +16 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +30 -3
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +26 -439
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.js +2 -2
- 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 +84 -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 +5 -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 +123 -23
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +13 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +1 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +2 -3
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1 -0
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +5 -0
- package/src/brand-page-maker/components/cookie-collection/CookieSettings.vue +18 -17
- package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.ts +13 -0
- package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.vue +26 -3
- package/src/brand-page-maker/components/quick-link-bar/RedoButton.vue +66 -0
- package/src/brand-page-maker/components/quick-link-bar/UndoButton.vue +66 -0
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.de-DE.json +6 -4
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.es-ES.json +6 -4
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.fr-CA.json +6 -4
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.fr-FR.json +6 -4
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.json +3 -1
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.pt-BR.json +6 -4
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.pt-PT.json +6 -4
- package/src/brand-page-maker/components/quick-link-bar/undo-redo-buttons.test.ts +116 -0
- package/src/brand-page-maker/components/save-contact/SaveContact.vue +12 -19
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +22 -7
- 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/composables/ai-chat/useAiWebsiteBuilderChat.ts +10 -0
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +28 -1
- package/src/brand-page-maker/composables/useEventTracker.ts +29 -0
- package/src/brand-page-maker/composables/useUndoRedoFlag.ts +30 -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.test.ts +334 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +381 -4
- package/src/brand-page-maker/stores/history/history-store.test.ts +1120 -0
- package/src/brand-page-maker/stores/history/history-store.ts +666 -0
- package/src/brand-page-maker/stores/logo-store/logo-store.ts +5 -0
- package/src/brand-page-maker/stores/ui/ui-store.ts +16 -0
- package/src/brand-page-maker/stores/user/user-store.ts +1 -0
- package/src/bundles/bundled-translations.de-DE.json +3 -1
- package/src/bundles/bundled-translations.es-ES.json +3 -1
- package/src/bundles/bundled-translations.fr-CA.json +3 -1
- package/src/bundles/bundled-translations.fr-FR.json +3 -1
- package/src/bundles/bundled-translations.json +3 -1
- package/src/bundles/bundled-translations.pt-BR.json +3 -1
- package/src/bundles/bundled-translations.pt-PT.json +3 -1
- package/src/clients/design-template-client.ts +3 -0
- package/src/clients/models.ts +2 -0
- package/src/constants/ui.ts +1 -0
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +5 -0
- package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +1 -0
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.ts +19 -2
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -1
- package/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.ts +26 -10
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +63 -48
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +4 -0
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +7 -0
- package/src/shared/content-settings/components/text-field/TextField.vue +1 -0
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +33 -4
- package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +11 -0
- package/src/shared/logo-settings/store/editable-logo-store.ts +42 -1
- package/src/shared/models.ts +6 -0
- package/src/shared/template-settings/components/TemplatesSettings.mixin.ts +2 -2
- package/src/shared/template-settings/store/template-settings-store.ts +110 -18
- package/lib/src/bundled-translations-B5Fkt3qd.js +0 -175
- package/lib/src/bundled-translations.de-DE-DpdVePM9.js +0 -175
- package/lib/src/bundled-translations.es-ES-BsIcrzZF.js +0 -175
- package/lib/src/bundled-translations.fr-CA-G1XCp2Qh.js +0 -175
- package/lib/src/bundled-translations.fr-FR-BdwLXOnB.js +0 -175
- package/lib/src/bundled-translations.pt-BR-Bvn5ePe7.js +0 -175
- package/lib/src/bundled-translations.pt-PT-CDtkb2k1.js +0 -175
|
@@ -400,6 +400,10 @@ export class PageFooterMobile extends AbstractPageFooterStyles {
|
|
|
400
400
|
export class BrandPageModel {
|
|
401
401
|
// Model version
|
|
402
402
|
v;
|
|
403
|
+
// Pre-purchase AI personalisation content key, persisted with the draft so the
|
|
404
|
+
// personalised AI template previews survive login / checkout-back / refresh - the
|
|
405
|
+
// content is retrieved by this token (user-agnostic), not regenerated (bp-5742).
|
|
406
|
+
userPromptContentKey;
|
|
403
407
|
styles;
|
|
404
408
|
/** @deprecated */
|
|
405
409
|
headerStyles;
|
|
@@ -206,15 +206,61 @@ 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
|
+
// A section is "effectively empty" when it carries no renderable content. The userPrompt
|
|
220
|
+
// AI content leaves ungenerated sections (e.g. email/website/phone) as empty objects (null
|
|
221
|
+
// sections are normalised to `{ ...indices }` upstream), and those are what we fall back
|
|
222
|
+
// from. A section that has data but lacks one specific property (e.g. no items, or an
|
|
223
|
+
// invalid shape) is NOT empty - those intentionally keep the original content.
|
|
224
|
+
const isSectionEffectivelyEmpty = (section) => {
|
|
225
|
+
if (!section) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
return (!section.title &&
|
|
229
|
+
!section.name &&
|
|
230
|
+
!section.url &&
|
|
231
|
+
!section.description &&
|
|
232
|
+
!section.descriptionShort &&
|
|
233
|
+
!section.ctaTitle &&
|
|
234
|
+
!section.imageUrls?.length &&
|
|
235
|
+
!section.shapes?.length &&
|
|
236
|
+
!section.items?.length &&
|
|
237
|
+
!section.mainShapesCollection?.tall?.length &&
|
|
238
|
+
!section.mainShapesCollection?.square?.length &&
|
|
239
|
+
!section.mainShapesCollection?.wide?.length);
|
|
240
|
+
};
|
|
241
|
+
// Resolve a property from a specific role's section. Returns null when that section is
|
|
242
|
+
// ungenerated (effectively empty) or cannot supply the property, so the caller can try the
|
|
243
|
+
// next role.
|
|
244
|
+
const resolvePersonalisationValueForRoleAsync = async (role, property, personalisation) => {
|
|
245
|
+
const key = `${role}Section`;
|
|
246
|
+
const section = personalisation[key];
|
|
247
|
+
if (isSectionEffectivelyEmpty(section)) {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
const { value, section: updatedSection, valuesToUpdate, } = await getPersonalisationValueAsync(section, property);
|
|
251
|
+
if (value === undefined || value === null) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
value,
|
|
256
|
+
personalisation: { ...personalisation, [key]: updatedSection },
|
|
257
|
+
valuesToUpdate,
|
|
258
|
+
};
|
|
259
|
+
};
|
|
209
260
|
const getPersonalisationValueFromPropertyAsync = async (propertyKey, propertyValue, personalisationRole, personalisationOverride, personalisation, contentType) => {
|
|
210
261
|
if (!personalisationRole || personalisationOverride === 'none') {
|
|
211
262
|
return { value: undefined, personalisation };
|
|
212
263
|
}
|
|
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
264
|
const mapping = getPersonalisationMappingForContentType(contentType);
|
|
219
265
|
const matchingProperty = Object.entries(mapping).find(([, value]) => value.includes(propertyKey));
|
|
220
266
|
if (!matchingProperty) {
|
|
@@ -225,15 +271,31 @@ const getPersonalisationValueFromPropertyAsync = async (propertyKey, propertyVal
|
|
|
225
271
|
brandPageType: personalisation.type,
|
|
226
272
|
isSvgShape: typeof propertyValue === 'string' && propertyValue.endsWith('.svg'),
|
|
227
273
|
});
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
274
|
+
const primaryKey = `${personalisationRole}Section`;
|
|
275
|
+
const primarySection = personalisation[primaryKey];
|
|
276
|
+
// When the block's own section has content, use it as-is - this preserves existing
|
|
277
|
+
// behaviour, including legitimately keeping the original when that section lacks a
|
|
278
|
+
// specific property (e.g. no items, or an invalid shape).
|
|
279
|
+
if (!isSectionEffectivelyEmpty(primarySection)) {
|
|
280
|
+
const { value, section: updatedSection, valuesToUpdate, } = await getPersonalisationValueAsync(primarySection, property);
|
|
281
|
+
return {
|
|
282
|
+
value,
|
|
283
|
+
personalisation: { ...personalisation, [primaryKey]: updatedSection },
|
|
284
|
+
valuesToUpdate,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
// The block's section was never generated (e.g. email/website/phone in the userPrompt
|
|
288
|
+
// content). Fall back to the first populated content section that can supply this
|
|
289
|
+
// property, so the block doesn't render the designer's "should be AI generated"
|
|
290
|
+
// placeholder. When the section exists (handled above) or every section is populated
|
|
291
|
+
// (e.g. the AI Website Builder), this fallback is never reached.
|
|
292
|
+
for (const role of PERSONALISATION_FALLBACK_ROLES) {
|
|
293
|
+
const resolved = await resolvePersonalisationValueForRoleAsync(role, property, personalisation);
|
|
294
|
+
if (resolved) {
|
|
295
|
+
return resolved;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return { value: undefined, personalisation };
|
|
237
299
|
};
|
|
238
300
|
const applyPersonalisationToBrandPageContentsRecursiveAsync = async (personalisation, mappingType, content, personalisationRole) => {
|
|
239
301
|
let isApplied = false;
|
|
@@ -107,22 +107,27 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
107
107
|
hideChangeTemplateConfirmModal(): void;
|
|
108
108
|
onBackgroundChanged(): void;
|
|
109
109
|
onChangeTemplateConfirmModalCancel(): void;
|
|
110
|
-
onChangeTemplateConfirmModalConfirm(): void
|
|
110
|
+
onChangeTemplateConfirmModalConfirm(): Promise<void>;
|
|
111
111
|
onContentChanged(): void;
|
|
112
112
|
onStyleChanged(): void;
|
|
113
|
-
onTemplateSelected(payload: import("@brand-page-maker/stores").OnTemplateSelectedPayload): void
|
|
113
|
+
onTemplateSelected(payload: import("@brand-page-maker/stores").OnTemplateSelectedPayload): Promise<void>;
|
|
114
114
|
setSelectedTabName(payload: any): void;
|
|
115
115
|
showNextNotificationMessage(): Promise<void>;
|
|
116
116
|
updateContent<TContent extends import("@brand-page/models").Content, P extends {
|
|
117
117
|
id: string;
|
|
118
118
|
content: TContent;
|
|
119
119
|
}>(payload: P): Promise<void>;
|
|
120
|
+
_captureTemplateSwitchIfEnabled(): void;
|
|
121
|
+
applyHistorySnapshot(snapshot: import("@brand-page/models").BrandPageModel, activePageId?: string | undefined, logoEditsStr?: string | undefined): Promise<void>;
|
|
122
|
+
_syncLogoSettingsFromSnapshot(snapshot: import("@brand-page/models").BrandPageModel, logoEditsStr?: string | undefined): Promise<void>;
|
|
123
|
+
_navigateToActivePage(activePageId?: string | undefined): void;
|
|
124
|
+
_fallbackSidebarIfSelectedContentMissing(snapshot: import("@brand-page/models").BrandPageModel): void;
|
|
120
125
|
export(): import("@brand-page/models").BrandPageModel;
|
|
121
126
|
setBrandPageType({ brandPageType }: {
|
|
122
127
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
123
128
|
}): void;
|
|
124
129
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("@brand-page/models").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>;
|
|
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>;
|
|
126
131
|
initialisePages({ pages, sections, }: {
|
|
127
132
|
pages: import("@brand-page/models").PageModel[];
|
|
128
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;
|
|
@@ -152,22 +154,27 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
152
154
|
hideChangeTemplateConfirmModal(): void;
|
|
153
155
|
onBackgroundChanged(): void;
|
|
154
156
|
onChangeTemplateConfirmModalCancel(): void;
|
|
155
|
-
onChangeTemplateConfirmModalConfirm(): void
|
|
157
|
+
onChangeTemplateConfirmModalConfirm(): Promise<void>;
|
|
156
158
|
onContentChanged(): void;
|
|
157
159
|
onStyleChanged(): void;
|
|
158
|
-
onTemplateSelected(payload: import("@brand-page-maker/stores").OnTemplateSelectedPayload): void
|
|
160
|
+
onTemplateSelected(payload: import("@brand-page-maker/stores").OnTemplateSelectedPayload): Promise<void>;
|
|
159
161
|
setSelectedTabName(payload: any): void;
|
|
160
162
|
showNextNotificationMessage(): Promise<void>;
|
|
161
163
|
updateContent<TContent extends import("@brand-page").Content, P extends {
|
|
162
164
|
id: string;
|
|
163
165
|
content: TContent;
|
|
164
166
|
}>(payload: P): Promise<void>;
|
|
167
|
+
_captureTemplateSwitchIfEnabled(): void;
|
|
168
|
+
applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string | undefined, logoEditsStr?: string | undefined): Promise<void>;
|
|
169
|
+
_syncLogoSettingsFromSnapshot(snapshot: import("@brand-page").BrandPageModel, logoEditsStr?: string | undefined): Promise<void>;
|
|
170
|
+
_navigateToActivePage(activePageId?: string | undefined): void;
|
|
171
|
+
_fallbackSidebarIfSelectedContentMissing(snapshot: import("@brand-page").BrandPageModel): void;
|
|
165
172
|
export(): import("@brand-page").BrandPageModel;
|
|
166
173
|
setBrandPageType({ brandPageType }: {
|
|
167
174
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
168
175
|
}): void;
|
|
169
176
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("@brand-page").BrandPageModel): Promise<void>;
|
|
170
|
-
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>;
|
|
171
178
|
initialisePages({ pages, sections, }: {
|
|
172
179
|
pages: import("@brand-page").PageModel[];
|
|
173
180
|
sections: import("@shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -936,6 +943,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
936
943
|
setUserPersonalisationData({ personalisationData, }: {
|
|
937
944
|
personalisationData: UserPersonalisationContent[];
|
|
938
945
|
}): void;
|
|
946
|
+
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
947
|
+
userPromptContentKey: string | undefined;
|
|
948
|
+
}): void;
|
|
949
|
+
setShowAiTemplatesTab({ showAiTemplatesTab, }: {
|
|
950
|
+
showAiTemplatesTab: boolean;
|
|
951
|
+
}): void;
|
|
939
952
|
onBackgroundChanged(): void;
|
|
940
953
|
onContentChanged(): void;
|
|
941
954
|
onStyleChanged(): void;
|
|
@@ -1082,6 +1095,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1082
1095
|
initialSearchTerm: string;
|
|
1083
1096
|
onSearchTermChanged?: import("@shared/template-settings/store").OnSearchTermChangedCallback | undefined;
|
|
1084
1097
|
}): void;
|
|
1098
|
+
setAiTemplateKeywords(payload: {
|
|
1099
|
+
aiTemplateKeywords: string;
|
|
1100
|
+
}): void;
|
|
1085
1101
|
notifySearchTermChanged(searchTerm: string | undefined): void;
|
|
1086
1102
|
clearTemplates(): void;
|
|
1087
1103
|
getTemplateByTemplateId(id: string): import("@shared/template-settings/models").TemplateSettingsTemplate | undefined;
|
|
@@ -11,6 +11,8 @@ import { navigateToPageByPageId } from '../../routing';
|
|
|
11
11
|
import { useBrandPageContainerStore } from '@brand-page-maker/stores';
|
|
12
12
|
import { UI_DEVICE_MODES, UI_SCREENSIZE_MODES, } from '@shared/models';
|
|
13
13
|
import { useBrandPageMakerStore, useBrandPageMakerUserStore, useLocalisedRouteStore, useUiStore, useSnapshotStore, useVideoStore, } from '@brand-page-maker/stores';
|
|
14
|
+
import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
|
|
15
|
+
import { useUndoRedoFlag } from '@brand-page-maker/composables/useUndoRedoFlag';
|
|
14
16
|
import { useUiContentSettingsStore } from '@shared/content-settings/store';
|
|
15
17
|
import { useUiTemplateSettingsStore } from '@shared/template-settings/store';
|
|
16
18
|
import { useUiPageSettingsStore } from '@shared/page-settings/store';
|
|
@@ -148,6 +150,8 @@ export default defineComponent({
|
|
|
148
150
|
templateCategories: this.viewModel.templateCategories,
|
|
149
151
|
personalisationData: this.viewModel.personalisation,
|
|
150
152
|
isPersonalisationEnabled: this.viewModel.isPersonalisationEnabled || false,
|
|
153
|
+
userPromptContentKey: this.viewModel.userPromptContentKey,
|
|
154
|
+
showAiTemplatesTab: this.viewModel.showAiTemplatesTab || false,
|
|
151
155
|
brandPageType: this.viewModel.brandPageType,
|
|
152
156
|
businessName: this.viewModel.businessName,
|
|
153
157
|
industry: this.viewModel.industry,
|
|
@@ -189,6 +193,12 @@ export default defineComponent({
|
|
|
189
193
|
}
|
|
190
194
|
// Mark brand page as fully loaded
|
|
191
195
|
this.brandPageMakerStore.setIsBrandPageLoaded(true);
|
|
196
|
+
// Capture baseline for undo/redo when the feature is active for this
|
|
197
|
+
// session — see useUndoRedoFlag.ts for the gate (LaunchDarkly flag +
|
|
198
|
+
// brand-site + non-admin maker).
|
|
199
|
+
if (useUndoRedoFlag().value) {
|
|
200
|
+
useHistoryStore().captureBaseline();
|
|
201
|
+
}
|
|
192
202
|
this.$emit(EVENTS.Initialised);
|
|
193
203
|
},
|
|
194
204
|
mounted() {
|
|
@@ -96,22 +96,27 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
96
96
|
hideChangeTemplateConfirmModal(): void;
|
|
97
97
|
onBackgroundChanged(): void;
|
|
98
98
|
onChangeTemplateConfirmModalCancel(): void;
|
|
99
|
-
onChangeTemplateConfirmModalConfirm(): void
|
|
99
|
+
onChangeTemplateConfirmModalConfirm(): Promise<void>;
|
|
100
100
|
onContentChanged(): void;
|
|
101
101
|
onStyleChanged(): void;
|
|
102
|
-
onTemplateSelected(payload: import("../../stores").OnTemplateSelectedPayload): void
|
|
102
|
+
onTemplateSelected(payload: import("../../stores").OnTemplateSelectedPayload): Promise<void>;
|
|
103
103
|
setSelectedTabName(payload: any): void;
|
|
104
104
|
showNextNotificationMessage(): Promise<void>;
|
|
105
105
|
updateContent<TContent extends import("../../../lib").Content, P extends {
|
|
106
106
|
id: string;
|
|
107
107
|
content: TContent;
|
|
108
108
|
}>(payload: P): Promise<void>;
|
|
109
|
+
_captureTemplateSwitchIfEnabled(): void;
|
|
110
|
+
applyHistorySnapshot(snapshot: import("../../../lib").BrandPageModel, activePageId?: string | undefined, logoEditsStr?: string | undefined): Promise<void>;
|
|
111
|
+
_syncLogoSettingsFromSnapshot(snapshot: import("../../../lib").BrandPageModel, logoEditsStr?: string | undefined): Promise<void>;
|
|
112
|
+
_navigateToActivePage(activePageId?: string | undefined): void;
|
|
113
|
+
_fallbackSidebarIfSelectedContentMissing(snapshot: import("../../../lib").BrandPageModel): void;
|
|
109
114
|
export(): import("../../../lib").BrandPageModel;
|
|
110
115
|
setBrandPageType({ brandPageType }: {
|
|
111
116
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
112
117
|
}): void;
|
|
113
118
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("../../../lib").BrandPageModel): Promise<void>;
|
|
114
|
-
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>;
|
|
115
120
|
initialisePages({ pages, sections, }: {
|
|
116
121
|
pages: import("../../../lib").PageModel[];
|
|
117
122
|
sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
|
package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts
CHANGED
|
@@ -602,22 +602,27 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
602
602
|
hideChangeTemplateConfirmModal(): void;
|
|
603
603
|
onBackgroundChanged(): void;
|
|
604
604
|
onChangeTemplateConfirmModalCancel(): void;
|
|
605
|
-
onChangeTemplateConfirmModalConfirm(): void
|
|
605
|
+
onChangeTemplateConfirmModalConfirm(): Promise<void>;
|
|
606
606
|
onContentChanged(): void;
|
|
607
607
|
onStyleChanged(): void;
|
|
608
|
-
onTemplateSelected(payload: import("@brand-page-maker/stores").OnTemplateSelectedPayload): void
|
|
608
|
+
onTemplateSelected(payload: import("@brand-page-maker/stores").OnTemplateSelectedPayload): Promise<void>;
|
|
609
609
|
setSelectedTabName(payload: any): void;
|
|
610
610
|
showNextNotificationMessage(): Promise<void>;
|
|
611
611
|
updateContent<TContent extends Content, P extends {
|
|
612
612
|
id: string;
|
|
613
613
|
content: TContent;
|
|
614
614
|
}>(payload: P): Promise<void>;
|
|
615
|
+
_captureTemplateSwitchIfEnabled(): void;
|
|
616
|
+
applyHistorySnapshot(snapshot: import("@brand-page").BrandPageModel, activePageId?: string | undefined, logoEditsStr?: string | undefined): Promise<void>;
|
|
617
|
+
_syncLogoSettingsFromSnapshot(snapshot: import("@brand-page").BrandPageModel, logoEditsStr?: string | undefined): Promise<void>;
|
|
618
|
+
_navigateToActivePage(activePageId?: string | undefined): void;
|
|
619
|
+
_fallbackSidebarIfSelectedContentMissing(snapshot: import("@brand-page").BrandPageModel): void;
|
|
615
620
|
export(): import("@brand-page").BrandPageModel;
|
|
616
621
|
setBrandPageType({ brandPageType }: {
|
|
617
622
|
brandPageType: "default" | "brandSite" | "brandContact";
|
|
618
623
|
}): void;
|
|
619
624
|
initialiseStoresByBrandPageModelAsync(brandPageModel: import("@brand-page").BrandPageModel): Promise<void>;
|
|
620
|
-
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
625
|
+
initialise({ brandPage, brandPageType, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, userPromptContentKey, showAiTemplatesTab, businessName, industry, layout, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("@brand-page-maker/stores").InitialisePayload): Promise<void>;
|
|
621
626
|
initialisePages({ pages, sections, }: {
|
|
622
627
|
pages: import("@brand-page").PageModel[];
|
|
623
628
|
sections: import("@shared/page-settings/store").PageSettingsStateSections;
|
|
@@ -1046,6 +1051,22 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
1046
1051
|
}>;
|
|
1047
1052
|
eventTracker: {
|
|
1048
1053
|
sendShippingToggleEvent: (isEnabled: boolean) => void;
|
|
1054
|
+
sendUndoEvent: (props: {
|
|
1055
|
+
entries_count: number;
|
|
1056
|
+
actor: string | undefined;
|
|
1057
|
+
}) => void;
|
|
1058
|
+
sendRedoEvent: (props: {
|
|
1059
|
+
entries_count: number;
|
|
1060
|
+
actor: string | undefined;
|
|
1061
|
+
}) => void;
|
|
1062
|
+
sendHistoryCappedEvent: (props: {
|
|
1063
|
+
entries_count: number;
|
|
1064
|
+
size_bytes: number;
|
|
1065
|
+
}) => void;
|
|
1066
|
+
sendHistoryOversizedEvent: (props: {
|
|
1067
|
+
attempted_bytes: number;
|
|
1068
|
+
source: string;
|
|
1069
|
+
}) => void;
|
|
1049
1070
|
sendSaveContactEvent: () => void;
|
|
1050
1071
|
sendStartForFreeEvent: () => void;
|
|
1051
1072
|
sendFooterLinkClickEvent: (linkType: "watermark_logo" | "create_your_website") => void;
|
|
@@ -1150,6 +1171,73 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
1150
1171
|
}): Promise<void>;
|
|
1151
1172
|
toggleLogoBackground(): Promise<any>;
|
|
1152
1173
|
}>;
|
|
1174
|
+
historyStore: import("pinia").Store<"history", Pick<{
|
|
1175
|
+
entries: import("vue").ShallowRef<import("@brand-page-maker/stores/history/history-store").HistoryEntry[], import("@brand-page-maker/stores/history/history-store").HistoryEntry[]>;
|
|
1176
|
+
currentIndex: import("vue").Ref<number, number>;
|
|
1177
|
+
isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
|
|
1178
|
+
snapshotAppliedToken: import("vue").Ref<number, number>;
|
|
1179
|
+
baselineCaptured: import("vue").Ref<boolean, boolean>;
|
|
1180
|
+
canUndo: import("vue").ComputedRef<boolean>;
|
|
1181
|
+
canRedo: import("vue").ComputedRef<boolean>;
|
|
1182
|
+
captureBaseline: () => void;
|
|
1183
|
+
capture: (args: {
|
|
1184
|
+
source: "manual_edit" | "template_switch" | "ai_changeset" | "rich_text";
|
|
1185
|
+
actor: "user" | "ai_builder";
|
|
1186
|
+
label?: string | undefined;
|
|
1187
|
+
}) => "committed" | "oversized" | "noop" | "skipped";
|
|
1188
|
+
captureTemplateSwitch: (label?: string | undefined) => "committed" | "oversized" | "noop" | "skipped";
|
|
1189
|
+
captureAiChangeset: (label?: string | undefined) => "committed" | "oversized" | "noop" | "skipped";
|
|
1190
|
+
mergeNextMutation: () => void;
|
|
1191
|
+
undo: () => Promise<void>;
|
|
1192
|
+
redo: () => Promise<void>;
|
|
1193
|
+
reset: () => void;
|
|
1194
|
+
getCurrentSizeBytes: () => number;
|
|
1195
|
+
getCurrentEntryCount: () => number;
|
|
1196
|
+
}, "entries" | "currentIndex" | "isApplyingSnapshot" | "snapshotAppliedToken" | "baselineCaptured">, Pick<{
|
|
1197
|
+
entries: import("vue").ShallowRef<import("@brand-page-maker/stores/history/history-store").HistoryEntry[], import("@brand-page-maker/stores/history/history-store").HistoryEntry[]>;
|
|
1198
|
+
currentIndex: import("vue").Ref<number, number>;
|
|
1199
|
+
isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
|
|
1200
|
+
snapshotAppliedToken: import("vue").Ref<number, number>;
|
|
1201
|
+
baselineCaptured: import("vue").Ref<boolean, boolean>;
|
|
1202
|
+
canUndo: import("vue").ComputedRef<boolean>;
|
|
1203
|
+
canRedo: import("vue").ComputedRef<boolean>;
|
|
1204
|
+
captureBaseline: () => void;
|
|
1205
|
+
capture: (args: {
|
|
1206
|
+
source: "manual_edit" | "template_switch" | "ai_changeset" | "rich_text";
|
|
1207
|
+
actor: "user" | "ai_builder";
|
|
1208
|
+
label?: string | undefined;
|
|
1209
|
+
}) => "committed" | "oversized" | "noop" | "skipped";
|
|
1210
|
+
captureTemplateSwitch: (label?: string | undefined) => "committed" | "oversized" | "noop" | "skipped";
|
|
1211
|
+
captureAiChangeset: (label?: string | undefined) => "committed" | "oversized" | "noop" | "skipped";
|
|
1212
|
+
mergeNextMutation: () => void;
|
|
1213
|
+
undo: () => Promise<void>;
|
|
1214
|
+
redo: () => Promise<void>;
|
|
1215
|
+
reset: () => void;
|
|
1216
|
+
getCurrentSizeBytes: () => number;
|
|
1217
|
+
getCurrentEntryCount: () => number;
|
|
1218
|
+
}, "canUndo" | "canRedo">, Pick<{
|
|
1219
|
+
entries: import("vue").ShallowRef<import("@brand-page-maker/stores/history/history-store").HistoryEntry[], import("@brand-page-maker/stores/history/history-store").HistoryEntry[]>;
|
|
1220
|
+
currentIndex: import("vue").Ref<number, number>;
|
|
1221
|
+
isApplyingSnapshot: import("vue").Ref<boolean, boolean>;
|
|
1222
|
+
snapshotAppliedToken: import("vue").Ref<number, number>;
|
|
1223
|
+
baselineCaptured: import("vue").Ref<boolean, boolean>;
|
|
1224
|
+
canUndo: import("vue").ComputedRef<boolean>;
|
|
1225
|
+
canRedo: import("vue").ComputedRef<boolean>;
|
|
1226
|
+
captureBaseline: () => void;
|
|
1227
|
+
capture: (args: {
|
|
1228
|
+
source: "manual_edit" | "template_switch" | "ai_changeset" | "rich_text";
|
|
1229
|
+
actor: "user" | "ai_builder";
|
|
1230
|
+
label?: string | undefined;
|
|
1231
|
+
}) => "committed" | "oversized" | "noop" | "skipped";
|
|
1232
|
+
captureTemplateSwitch: (label?: string | undefined) => "committed" | "oversized" | "noop" | "skipped";
|
|
1233
|
+
captureAiChangeset: (label?: string | undefined) => "committed" | "oversized" | "noop" | "skipped";
|
|
1234
|
+
mergeNextMutation: () => void;
|
|
1235
|
+
undo: () => Promise<void>;
|
|
1236
|
+
redo: () => Promise<void>;
|
|
1237
|
+
reset: () => void;
|
|
1238
|
+
getCurrentSizeBytes: () => number;
|
|
1239
|
+
getCurrentEntryCount: () => number;
|
|
1240
|
+
}, "reset" | "undo" | "redo" | "captureBaseline" | "capture" | "captureTemplateSwitch" | "captureAiChangeset" | "mergeNextMutation" | "getCurrentSizeBytes" | "getCurrentEntryCount">>;
|
|
1153
1241
|
}, {
|
|
1154
1242
|
isDraggingContent: boolean;
|
|
1155
1243
|
isContentSelected: boolean;
|
package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js
CHANGED
|
@@ -15,6 +15,7 @@ import { transformToRTE, RTE_ALLOWED_SECTION_TYPES, } from '@brand-page-maker/ut
|
|
|
15
15
|
import { useExternalRichTextEditor } from '@brand-page-maker/composables/rich-text-editor/useRichTextEditor';
|
|
16
16
|
import { useUiStyleSettingsStore } from '@shared/style-settings/store';
|
|
17
17
|
import { STYLE_THEME_KEYS } from '@brand-page/constants';
|
|
18
|
+
import { useHistoryStore } from '@brand-page-maker/stores/history/history-store';
|
|
18
19
|
export default defineComponent({
|
|
19
20
|
mixins: [PageMixin],
|
|
20
21
|
setup() {
|
|
@@ -29,6 +30,7 @@ export default defineComponent({
|
|
|
29
30
|
const eventTracker = useEventTracker();
|
|
30
31
|
const { externalEditor } = useExternalRichTextEditor();
|
|
31
32
|
const styleSettingsStore = useUiStyleSettingsStore();
|
|
33
|
+
const historyStore = useHistoryStore();
|
|
32
34
|
return {
|
|
33
35
|
items: computed(() => contentSettingsStore.items),
|
|
34
36
|
selectedItemId: computed(() => contentSettingsStore.selectedItemId),
|
|
@@ -51,6 +53,7 @@ export default defineComponent({
|
|
|
51
53
|
eventTracker,
|
|
52
54
|
externalEditor,
|
|
53
55
|
styleSettingsStore,
|
|
56
|
+
historyStore,
|
|
54
57
|
};
|
|
55
58
|
},
|
|
56
59
|
data() {
|
|
@@ -214,6 +217,8 @@ export default defineComponent({
|
|
|
214
217
|
selectedItem = currentItem.settings.content;
|
|
215
218
|
}
|
|
216
219
|
}
|
|
220
|
+
// RTE rewrap on section selection — fold into current head.
|
|
221
|
+
this.historyStore.mergeNextMutation();
|
|
217
222
|
transformToRTE(this.pageSettingsStore, this.externalEditor, this.styleSettingsStore, selectedItem);
|
|
218
223
|
}
|
|
219
224
|
if (this.selectEventDebounceHandler) {
|