@designcrowd/library.brand-page 5.18.5 → 5.18.6-ast-padding-1
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-ciKpCAd9.js → CreatedOnBrandCrowd-de-de-CAtPZtwo.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CZbTS1AZ.js → CreatedOnBrandCrowd-en-us-Dcx4yFkK.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-C8MExng5.js → CreatedOnBrandCrowd-es-es-DpodH0gD.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CO0L9NK2.js → CreatedOnBrandCrowd-fr-ca-DZbMRJn-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CO0L9NK2.js → CreatedOnBrandCrowd-fr-fr-DZbMRJn-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-zVDvBF2H.js → CreatedOnBrandCrowd-pt-br-C3gBveLk.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-zVDvBF2H.js → CreatedOnBrandCrowd-pt-pt-C3gBveLk.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-WrUSQdjf.js → CreatedOnDcom-de-de-DHNyyTV9.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BqC9YtkL.js → CreatedOnDcom-en-us-BjqZ0Jmw.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BzH32Oya.js → CreatedOnDcom-es-es-tiNjDJmH.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-D7TYfCW0.js → CreatedOnDcom-fr-ca-COUSI6w1.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DVlyfBtb.js → CreatedOnDcom-fr-fr-c3UCfh9A.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-CSRB91ey.js → CreatedOnDcom-pt-br-U1jbo_g5.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-9KMj5gpc.js → CreatedOnDcom-pt-pt-BOW_n3bo.js} +1 -1
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +8 -4
- package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.js +4 -0
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +4 -1
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.js +4 -0
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +4 -1
- package/lib/src/brand-page/components/video/Video.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/video/Video.mixin.js +4 -0
- package/lib/src/brand-page/constants/misc.constants.d.ts +30 -0
- package/lib/src/brand-page/constants/misc.constants.js +51 -0
- package/lib/src/brand-page/models/content.model.d.ts +2 -0
- package/lib/src/brand-page/utils/content-padding.util.d.ts +13 -0
- package/lib/src/brand-page/utils/content-padding.util.js +10 -0
- package/lib/src/brand-page/utils/index.d.ts +1 -0
- package/lib/src/brand-page/utils/index.js +1 -0
- package/lib/src/brand-page/utils/migration/migration-17.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-17.js +50 -0
- package/lib/src/brand-page/utils/migration.util.js +10 -0
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +2 -0
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +14 -7
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +0 -8
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +16 -87
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.js +0 -5
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -3
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.js +0 -11
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +2 -7
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +0 -9
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +1 -20
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +0 -20
- package/lib/src/brand-page-maker/composables/useEventTracker.js +0 -17
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +37 -0
- package/lib/src/brand-page-maker/convertors/about-display-style.convertor.js +9 -1
- package/lib/src/brand-page-maker/convertors/banner-align-display-style.convertor.js +7 -1
- package/lib/src/brand-page-maker/convertors/contact-layout-style.convertor.js +6 -1
- package/lib/src/brand-page-maker/models/content-settings.js +36 -2
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +12 -0
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +2 -41
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +5 -307
- package/lib/src/brand-page-maker/stores/logo-store/logo-store.d.ts +0 -1
- package/lib/src/brand-page-maker/stores/user/user-store.js +0 -1
- package/lib/src/bundled-translations-Chw0nsFv.js +175 -0
- package/lib/src/bundled-translations.de-DE-cqBv7atZ.js +175 -0
- package/lib/src/bundled-translations.es-ES-D9VXftl_.js +175 -0
- package/lib/src/bundled-translations.fr-CA-BYstWXcO.js +175 -0
- package/lib/src/bundled-translations.fr-FR-D1H1hJD4.js +175 -0
- package/lib/src/bundled-translations.pt-BR-DqNFuNHX.js +175 -0
- package/lib/src/bundled-translations.pt-PT-tOic0FfQ.js +175 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +3 -3
- package/lib/src/bundles/bundled-translations.es-ES.json +3 -3
- package/lib/src/bundles/bundled-translations.fr-CA.json +3 -3
- package/lib/src/bundles/bundled-translations.fr-FR.json +3 -3
- package/lib/src/bundles/bundled-translations.json +3 -3
- package/lib/src/bundles/bundled-translations.pt-BR.json +3 -3
- package/lib/src/bundles/bundled-translations.pt-PT.json +3 -3
- package/lib/src/constants/ui.d.ts +0 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +123 -136
- package/lib/src/css/library.brand-page-brandPage.min.css +124 -136
- package/lib/src/css/library.brand-page-designCom.min.css +123 -136
- package/lib/src/css/library.brand-page-preview.min.css +123 -136
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-BXbo_N88.js → lib-Bl7w5LQl.js} +28005 -28416
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +16 -87
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.js +0 -5
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +0 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +16 -23
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +12 -16
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +14 -7
- package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.d.ts +0 -3
- package/lib/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.js +2 -19
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +12 -0
- package/lib/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.js +8 -18
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +0 -64
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +0 -6
- package/lib/src/shared/content-settings/components/slider-field/SliderField.mixin.js +9 -0
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +12 -0
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +0 -19
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.js +0 -11
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +2 -10
- package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +1 -5
- package/lib/src/shared/logo-settings/store/editable-logo-store.js +0 -31
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +18 -24
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +16 -10
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +2 -23
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +0 -16
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -23
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +0 -16
- package/lib/src/utils/minify-brand-page-metadata.js +11 -1
- package/package.json +1 -1
- package/src/brand-page/components/about-section/AboutSection.vue +10 -4
- package/src/brand-page/components/banner-section/BannerSection.vue +11 -4
- package/src/brand-page/components/booking-section/BookingSection.vue +11 -3
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +12 -6
- package/src/brand-page/components/contact-form/ContactForm.vue +115 -118
- package/src/brand-page/components/image-gallery/ImageGallery.mixin.ts +5 -0
- package/src/brand-page/components/image-gallery/ImageGallery.vue +1 -1
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +8 -1
- package/src/brand-page/components/mailing-list/MailingList.vue +1 -1
- package/src/brand-page/components/map/Map.vue +5 -1
- package/src/brand-page/components/payment/request-payment/RequestPayment.mixin.ts +5 -0
- package/src/brand-page/components/payment/request-payment/RequestPayment.vue +1 -0
- package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +8 -1
- package/src/brand-page/components/payment/support-me/SupportMe.vue +1 -0
- package/src/brand-page/components/shop/Shop.vue +7 -2
- package/src/brand-page/components/social-links/SocialLinks.vue +7 -3
- package/src/brand-page/components/text/Text.vue +12 -5
- package/src/brand-page/components/text-media-section/TextMediaSection.vue +11 -3
- package/src/brand-page/components/video/Video.mixin.ts +5 -0
- package/src/brand-page/components/video/Video.vue +1 -1
- package/src/brand-page/constants/misc.constants.ts +60 -0
- package/src/brand-page/models/content.model.ts +2 -0
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +9 -3
- package/src/brand-page/utils/content-padding.util.test.ts +29 -0
- package/src/brand-page/utils/content-padding.util.ts +13 -0
- package/src/brand-page/utils/index.ts +1 -0
- package/src/brand-page/utils/migration/migration-17.ts +73 -0
- package/src/brand-page/utils/migration.util.test.ts +145 -0
- package/src/brand-page/utils/migration.util.ts +11 -0
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +0 -9
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +3 -2
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -1
- package/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.ts +0 -5
- package/src/brand-page-maker/components/cookie-collection/CookieSettings.vue +17 -18
- package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.ts +0 -13
- package/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.vue +3 -26
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.de-DE.json +4 -6
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.es-ES.json +4 -6
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.fr-CA.json +4 -6
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.fr-FR.json +4 -6
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.json +1 -3
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.pt-BR.json +4 -6
- package/src/brand-page-maker/components/quick-link-bar/i18n/quick-link-bar.pt-PT.json +4 -6
- package/src/brand-page-maker/components/save-contact/SaveContact.vue +19 -12
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +0 -10
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +1 -24
- package/src/brand-page-maker/composables/useEventTracker.ts +0 -29
- package/src/brand-page-maker/constants/config-settings-constant.ts +43 -0
- package/src/brand-page-maker/convertors/about-display-style.convertor.ts +10 -0
- package/src/brand-page-maker/convertors/banner-align-display-style.convertor.ts +8 -0
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.test.ts +50 -0
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.ts +8 -0
- package/src/brand-page-maker/models/content-settings.ts +38 -2
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +0 -334
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +4 -371
- package/src/brand-page-maker/stores/logo-store/logo-store.ts +0 -5
- package/src/brand-page-maker/stores/user/user-store.ts +0 -1
- package/src/bundles/bundled-translations.de-DE.json +3 -3
- package/src/bundles/bundled-translations.es-ES.json +3 -3
- package/src/bundles/bundled-translations.fr-CA.json +3 -3
- package/src/bundles/bundled-translations.fr-FR.json +3 -3
- package/src/bundles/bundled-translations.json +3 -3
- package/src/bundles/bundled-translations.pt-BR.json +3 -3
- package/src/bundles/bundled-translations.pt-PT.json +3 -3
- package/src/constants/ui.ts +0 -1
- package/src/shared/content-settings/components/content-settings/ContentSettings.mixin.ts +0 -5
- package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +0 -1
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +2 -0
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.vue +1 -1
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.mixin.ts +2 -19
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +1 -1
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.vue +2 -2
- package/src/shared/content-settings/components/form-fields-field/FormFieldsField.mixin.ts +10 -26
- package/src/shared/content-settings/components/logo-selection-field/LogoSelection.vue +48 -63
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +0 -4
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +0 -7
- package/src/shared/content-settings/components/slider-field/SliderField.mixin.ts +9 -0
- package/src/shared/content-settings/components/text-field/TextField.vue +0 -1
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +4 -33
- package/src/shared/logo-settings/components/EditLogoSettings.mixin.ts +0 -11
- package/src/shared/logo-settings/store/editable-logo-store.ts +1 -42
- package/src/utils/minify-brand-page-metadata.ts +11 -1
- package/lib/src/brand-page-maker/composables/useUndoRedoFlag.d.ts +0 -17
- package/lib/src/brand-page-maker/composables/useUndoRedoFlag.js +0 -25
- package/lib/src/brand-page-maker/stores/history/history-store.d.ts +0 -83
- package/lib/src/brand-page-maker/stores/history/history-store.js +0 -495
- package/lib/src/bundled-translations-D1q3rSEz.js +0 -175
- package/lib/src/bundled-translations.de-DE-BxqLLwbh.js +0 -175
- package/lib/src/bundled-translations.es-ES-uh249NlJ.js +0 -175
- package/lib/src/bundled-translations.fr-CA-BEQmv2fX.js +0 -175
- package/lib/src/bundled-translations.fr-FR-BnNuCojH.js +0 -175
- package/lib/src/bundled-translations.pt-BR-CJUOxVlq.js +0 -175
- package/lib/src/bundled-translations.pt-PT-Ds9cMEqK.js +0 -175
- package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
- package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
- package/src/brand-page-maker/components/quick-link-bar/RedoButton.vue +0 -66
- package/src/brand-page-maker/components/quick-link-bar/UndoButton.vue +0 -66
- package/src/brand-page-maker/components/quick-link-bar/undo-redo-buttons.test.ts +0 -116
- package/src/brand-page-maker/composables/useUndoRedoFlag.ts +0 -30
- package/src/brand-page-maker/stores/history/history-store.test.ts +0 -1120
- package/src/brand-page-maker/stores/history/history-store.ts +0 -660
- package/src/metadata-builder/builders/reorder-pages-builder.ts +0 -80
|
@@ -2,7 +2,6 @@ import { EMPTY_LOGO_IMAGE_MODEL, SENSITIVE_CONTENT_TYPES, TEXT_STYLE_TYPES, VIEW
|
|
|
2
2
|
import { BackgroundStyles, BRAND_PAGE_TYPES, BrandPageModel, CONTENT_TYPES, NavigationDesktop, NavigationMobile, NavModel, } from '@brand-page';
|
|
3
3
|
import { useBrandPageMakerUserStore } from '../user';
|
|
4
4
|
import { defineStore } from 'pinia';
|
|
5
|
-
import { toRaw } from 'vue';
|
|
6
5
|
import { useUiStore } from '../ui';
|
|
7
6
|
import { useUiLogoSettingsStore, useUiEditableLogoStore, } from '@shared/logo-settings/store';
|
|
8
7
|
import { useUiStyleSettingsStore } from '@shared/style-settings/store';
|
|
@@ -12,7 +11,7 @@ import { useShopConfigStore } from '@shared/ecommerce-settings/store/shop-settin
|
|
|
12
11
|
import { usePageNavigationStore } from '@shared/page-navigation/store/page-navigation-store';
|
|
13
12
|
import { applyLogoThemeToBrandPageModel, migrateBrandPageModel, applyUserPersonalisationToBrandPageModelAsync, getBrandPageViewModelFromBrandPageModel, isLogoContent, parseLogoThemeToCssStyles, logoUtil, GetLatestModelVersion, } from '@brand-page/utils';
|
|
14
13
|
import { navigateToPageByPageId } from '../../routing';
|
|
15
|
-
import { BRANDPAGE_DEFAULT_ERROR_MESSAGE_DESCRIPTION, BRANDPAGE_DEFAULT_SAVE_MESSAGE_DESCRIPTION, MAKER_MOBILE_BREAKPOINT, MESSAGE_VISIBLE_DURATION,
|
|
14
|
+
import { BRANDPAGE_DEFAULT_ERROR_MESSAGE_DESCRIPTION, BRANDPAGE_DEFAULT_SAVE_MESSAGE_DESCRIPTION, MAKER_MOBILE_BREAKPOINT, MESSAGE_VISIBLE_DURATION, } from '@brand-page-maker/constants';
|
|
16
15
|
import { useUiSideBarStore } from '@shared/side-bar/store';
|
|
17
16
|
import { delayInMS } from '../../../utils/ui-util';
|
|
18
17
|
import { useUiContentSettingsStore } from '@shared/content-settings/store';
|
|
@@ -34,7 +33,6 @@ import { useConsent } from '@brand-page/composables/consent.composable';
|
|
|
34
33
|
import { commonTr, errorTr } from '@src/composables/useTranslate';
|
|
35
34
|
import { UPGRADE_CTA_LOCATIONS } from '../../composables/useEventTracker';
|
|
36
35
|
import { useVideoStore } from '../video';
|
|
37
|
-
import { useHistoryStore } from '../history/history-store';
|
|
38
36
|
import { findValuesByKey } from '../../../helpers/ts.helper';
|
|
39
37
|
import { useLogoStore } from '../logo-store';
|
|
40
38
|
const brandPageTypeTemplateTypeMap = {
|
|
@@ -389,15 +387,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
389
387
|
description: payload.noDescription ? '' : description,
|
|
390
388
|
},
|
|
391
389
|
});
|
|
392
|
-
// Any successful save re-baselines the undo stack so a user can't
|
|
393
|
-
// undo back past the persisted state. This covers Save Progress /
|
|
394
|
-
// Publish AND settings-only saves (updateBrandPage,
|
|
395
|
-
// updateSensitiveContent, admin saveTemplate) — settings-tab
|
|
396
|
-
// actions persist the metadata, so allowing undo to roll them
|
|
397
|
-
// back would let the local stack drift from what's saved.
|
|
398
|
-
// reset() no-ops in non-undo-redo sessions (no baseline = nothing
|
|
399
|
-
// to clear).
|
|
400
|
-
useHistoryStore().reset();
|
|
401
390
|
},
|
|
402
391
|
hideChangeTemplateConfirmModal() {
|
|
403
392
|
this.setIsChangeTemplateConfirmModalVisible({
|
|
@@ -411,11 +400,10 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
411
400
|
this.setSelectedTemplateId({ templateId: false });
|
|
412
401
|
this.hideChangeTemplateConfirmModal();
|
|
413
402
|
},
|
|
414
|
-
|
|
415
|
-
|
|
403
|
+
onChangeTemplateConfirmModalConfirm() {
|
|
404
|
+
this.applySelectedTemplate();
|
|
416
405
|
this.hideChangeTemplateConfirmModal();
|
|
417
406
|
this.isModifiedAfterTemplateApplied = false;
|
|
418
|
-
this._captureTemplateSwitchIfEnabled();
|
|
419
407
|
},
|
|
420
408
|
onContentChanged() {
|
|
421
409
|
this.setIsModifiedAfterTemplateApplied();
|
|
@@ -423,7 +411,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
423
411
|
onStyleChanged() {
|
|
424
412
|
this.setIsModifiedAfterTemplateApplied();
|
|
425
413
|
},
|
|
426
|
-
|
|
414
|
+
onTemplateSelected(payload) {
|
|
427
415
|
this.setSelectedTemplateId({
|
|
428
416
|
templateId: payload.templateId,
|
|
429
417
|
});
|
|
@@ -433,8 +421,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
433
421
|
});
|
|
434
422
|
}
|
|
435
423
|
else {
|
|
436
|
-
|
|
437
|
-
this._captureTemplateSwitchIfEnabled();
|
|
424
|
+
this.applySelectedTemplate();
|
|
438
425
|
}
|
|
439
426
|
},
|
|
440
427
|
setSelectedTabName(payload) {
|
|
@@ -460,295 +447,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
460
447
|
async updateContent(payload) {
|
|
461
448
|
const uiContentSettingsStore = useUiContentSettingsStore();
|
|
462
449
|
uiContentSettingsStore.updateContent(payload);
|
|
463
|
-
// NOTE (Bolt 1, 2026-04-23): this action is not the actual edit path used
|
|
464
|
-
// by the UI — sidebar inputs call uiContentSettingsStore.updateItemValue
|
|
465
|
-
// directly. History capture is driven by a deep `watch(brandPageData, ...)`
|
|
466
|
-
// installed in history-store once the baseline is captured, so we do not
|
|
467
|
-
// need to instrument this action. Kept here as a pass-through because
|
|
468
|
-
// removing it may affect other callers.
|
|
469
|
-
},
|
|
470
|
-
/**
|
|
471
|
-
* Restore every store that the `brandPageData` getter reads from, so undo
|
|
472
|
-
* and redo bring back the EXACT document state captured at snapshot time.
|
|
473
|
-
*
|
|
474
|
-
* `initialiseStoresByBrandPageModelAsync` is too narrow for undo/redo — it
|
|
475
|
-
* only rehydrates pages, sections, and nav structure, which is enough for
|
|
476
|
-
* the AI-apply path but leaves navigation styles, backgrounds, button/text/
|
|
477
|
-
* logo/gallery styles, shop config, and several own-store fields unchanged.
|
|
478
|
-
* This action mirrors the full hydration surface of `applySelectedTemplate`
|
|
479
|
-
* (minus the template-specific logo/personalisation logic) so a restore is
|
|
480
|
-
* a complete round-trip of what `brandPageData` returns.
|
|
481
|
-
*
|
|
482
|
-
* Called ONLY by history-store during undo/redo. The history store sets
|
|
483
|
-
* `isApplyingSnapshot=true` across this call to prevent the deep-watcher
|
|
484
|
-
* on `brandPageData` from re-capturing the restored state.
|
|
485
|
-
*/
|
|
486
|
-
/**
|
|
487
|
-
* Force-commit a `template_switch` entry to the history store, if the
|
|
488
|
-
* history store has a baseline (which only happens when the undo/redo
|
|
489
|
-
* feature flag is on — see `BrandPageMaker.mixin.ts`).
|
|
490
|
-
*/
|
|
491
|
-
_captureTemplateSwitchIfEnabled() {
|
|
492
|
-
const historyStore = useHistoryStore();
|
|
493
|
-
if (!historyStore.baselineCaptured)
|
|
494
|
-
return;
|
|
495
|
-
historyStore.captureTemplateSwitch();
|
|
496
|
-
},
|
|
497
|
-
async applyHistorySnapshot(snapshot, activePageId, logoEditsStr) {
|
|
498
|
-
const styleSettingsStore = useUiStyleSettingsStore();
|
|
499
|
-
const navigationStyleSettingsStore = useUiNavigationStyleSettingsStore();
|
|
500
|
-
const backgroundSettingsStore = useUiBackgroundSettingsStore();
|
|
501
|
-
const pageNavigationStore = usePageNavigationStore();
|
|
502
|
-
const shopStore = useShopConfigStore();
|
|
503
|
-
// 1. Pages + header/footer sections (also covers content items).
|
|
504
|
-
this.initialisePagesForCurrentPage({
|
|
505
|
-
pages: snapshot.pages,
|
|
506
|
-
sections: {
|
|
507
|
-
[PAGE_SECTIONS.header]: {
|
|
508
|
-
[VIEWPORTS.desktop]: snapshot.pageHeaderDesktop,
|
|
509
|
-
[VIEWPORTS.mobile]: snapshot.pageHeaderMobile,
|
|
510
|
-
},
|
|
511
|
-
[PAGE_SECTIONS.footer]: {
|
|
512
|
-
[VIEWPORTS.desktop]: snapshot.pageFooterDesktop,
|
|
513
|
-
[VIEWPORTS.mobile]: snapshot.pageFooterMobile,
|
|
514
|
-
},
|
|
515
|
-
},
|
|
516
|
-
});
|
|
517
|
-
// 2. Page-level nav structure (routes, orders).
|
|
518
|
-
pageNavigationStore.setNav({ nav: snapshot.nav });
|
|
519
|
-
// 3. Navigation STYLES (header/footer nav colors, alignment, etc.) —
|
|
520
|
-
// this is the bit that was being dropped before.
|
|
521
|
-
// Use function-form $patch so each nested style object is replaced as a
|
|
522
|
-
// whole reference. The object-form $patch (used by setState) deep-merges
|
|
523
|
-
// and would leave keys present in the live state but absent from the
|
|
524
|
-
// snapshot in place — e.g. switching button styles then undoing would
|
|
525
|
-
// leave the new style's borderRadius/borderStyle/borderWidth applied.
|
|
526
|
-
navigationStyleSettingsStore.$patch((state) => {
|
|
527
|
-
state.navigation[PAGE_SECTIONS.header][VIEWPORTS.desktop] =
|
|
528
|
-
new NavigationDesktop(snapshot.pageHeaderDesktop?.navigation);
|
|
529
|
-
state.navigation[PAGE_SECTIONS.header][VIEWPORTS.mobile] =
|
|
530
|
-
new NavigationMobile(snapshot.pageHeaderMobile?.navigation);
|
|
531
|
-
});
|
|
532
|
-
// 4. Global styles (logo, button, text, gallery). Same whole-reference
|
|
533
|
-
// replacement reasoning as step 3.
|
|
534
|
-
styleSettingsStore.$patch((state) => {
|
|
535
|
-
state.buttonStyles = snapshot.styles.buttonStyles;
|
|
536
|
-
state.logoStyles = snapshot.styles.logoStyles;
|
|
537
|
-
state.textStyles = snapshot.styles.textStyles;
|
|
538
|
-
state.galleryStyles = snapshot.styles.galleryStyles;
|
|
539
|
-
});
|
|
540
|
-
// 5. Background styles. Same whole-reference replacement reasoning as
|
|
541
|
-
// step 3 — `setBackgroundStyles` calls per-field setters that
|
|
542
|
-
// `Object.assign` partials onto the live `style` and
|
|
543
|
-
// `backgroundShapeStyle` objects, so keys from the previous mode
|
|
544
|
-
// (e.g. background image url, shape style props) would survive an
|
|
545
|
-
// undo back to a state that doesn't have them.
|
|
546
|
-
backgroundSettingsStore.$patch((state) => {
|
|
547
|
-
state.backgroundStyles = snapshot.styles.backgroundStyles;
|
|
548
|
-
});
|
|
549
|
-
backgroundSettingsStore.onBackgroundChanged();
|
|
550
|
-
// 6. Shop products are derived from shop-content blocks inside `pages`,
|
|
551
|
-
// so they're already implicitly restored at step 1. Re-run the shop
|
|
552
|
-
// store's derivation to keep `products` in sync with the snapshot
|
|
553
|
-
// pages. paymentConfig is intentionally NOT restored — selecting it is
|
|
554
|
-
// backend-confirmed (Stripe Connect / payment-provider linkage) per
|
|
555
|
-
// project-guardrails.md, so it must persist across undo. We pass the
|
|
556
|
-
// live paymentConfig back in to preserve it.
|
|
557
|
-
shopStore.initialiseShopStore({
|
|
558
|
-
paymentConfig: shopStore.paymentConfig,
|
|
559
|
-
pages: snapshot.pages ?? [],
|
|
560
|
-
});
|
|
561
|
-
// 7. Own-store scalar fields surfaced by the brandPageData getter.
|
|
562
|
-
if (snapshot.isModifiedAfterTemplateApplied !== undefined) {
|
|
563
|
-
this.isModifiedAfterTemplateApplied =
|
|
564
|
-
snapshot.isModifiedAfterTemplateApplied;
|
|
565
|
-
}
|
|
566
|
-
if (snapshot.brandPageType) {
|
|
567
|
-
this.setBrandPageType({ brandPageType: snapshot.brandPageType });
|
|
568
|
-
}
|
|
569
|
-
this.faviconUrl = snapshot.faviconUrl;
|
|
570
|
-
this.ogImageUrl = snapshot.ogImageUrl;
|
|
571
|
-
this.measurementID = snapshot.measurementID;
|
|
572
|
-
this.adsenseID = snapshot.adsenseID;
|
|
573
|
-
this.ogTitle = snapshot.ogTitle;
|
|
574
|
-
this.ogDescription = snapshot.ogDescription;
|
|
575
|
-
this.cookieOptions = snapshot.cookieOptions;
|
|
576
|
-
this.saveContactSettings = snapshot.saveContactSettings;
|
|
577
|
-
// 8. Re-sync the logo-settings sidebar's `selectedLogoImage` from the
|
|
578
|
-
// restored header logo. The preview rehydrates via the page contents,
|
|
579
|
-
// but `uiLogoSettings` holds its own copy that drives the sidebar
|
|
580
|
-
// "current logo" state — same pattern as `initialiseStoresByBrandPageModelAsync`.
|
|
581
|
-
// Also restores the variations grid + template asset for the
|
|
582
|
-
// snapshot's draft token (both are sidecars to `brandPageData` —
|
|
583
|
-
// BYO upload mutates them out of band). When the captured entry
|
|
584
|
-
// carries a `logoEdits` sidecar (pre-purchase logo-tab edits —
|
|
585
|
-
// text, support text, logo colors, fonts), `editableLogoStore.logoEdits`
|
|
586
|
-
// is restored from that string so the sidebar form fields and the
|
|
587
|
-
// save-time fabric-render POST both pick up the pre-edit state.
|
|
588
|
-
await this._syncLogoSettingsFromSnapshot(snapshot, logoEditsStr);
|
|
589
|
-
// 9. If the sidebar is editing a content item that no longer exists in
|
|
590
|
-
// the restored page, fall back to the Content tab so the user doesn't
|
|
591
|
-
// stare at a blank settings panel.
|
|
592
|
-
this._fallbackSidebarIfSelectedContentMissing(snapshot);
|
|
593
|
-
// 10. Switch to the page the user was viewing when this entry was
|
|
594
|
-
// captured (or the closest still-existing page if the captured
|
|
595
|
-
// page was the one being undone-away). The history store does the
|
|
596
|
-
// walk-back resolution and passes us a pageId that's guaranteed to
|
|
597
|
-
// exist in the restored nav — or undefined if no entry walking
|
|
598
|
-
// back has a viable id, in which case we fall through to the
|
|
599
|
-
// first/default route. Without this, the page-tabs carousel keeps
|
|
600
|
-
// highlighting whatever page slug is in the URL (which can no
|
|
601
|
-
// longer match any nav item after a page-add undo) and the
|
|
602
|
-
// sidebar's `currentPage` getter silently falls back to page 0.
|
|
603
|
-
this._navigateToActivePage(activePageId);
|
|
604
|
-
},
|
|
605
|
-
async _syncLogoSettingsFromSnapshot(snapshot, logoEditsStr) {
|
|
606
|
-
const logoSettingsStore = useUiLogoSettingsStore();
|
|
607
|
-
const editableLogoStore = useUiEditableLogoStore();
|
|
608
|
-
const logoStore = useLogoStore();
|
|
609
|
-
const containerStore = useBrandPageContainerStore();
|
|
610
|
-
// Pre-restore logo identity, used to short-circuit the
|
|
611
|
-
// fabric-render call when only non-logo state changed.
|
|
612
|
-
const prevLogoEditsStr = JSON.stringify(toRaw(editableLogoStore.logoEdits));
|
|
613
|
-
const prevDraftToken = editableLogoStore.logoDraftToken;
|
|
614
|
-
// Wholesale-replace via $patch so prior textObjects/colors don't
|
|
615
|
-
// leak across template switches.
|
|
616
|
-
if (logoEditsStr) {
|
|
617
|
-
try {
|
|
618
|
-
const parsed = JSON.parse(logoEditsStr);
|
|
619
|
-
editableLogoStore.$patch({ logoEdits: parsed });
|
|
620
|
-
}
|
|
621
|
-
catch (error) {
|
|
622
|
-
console.error('brandpage-maker-store: failed to restore logoEdits', error);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
const logoImage = snapshot.brandPageType === BRAND_PAGE_TYPES.default
|
|
626
|
-
? snapshot.pages?.[0]?.contents?.find((c) => c.type === 'logo')?.logoImage
|
|
627
|
-
: snapshot.pageHeaderDesktop?.logoImage;
|
|
628
|
-
if (!logoImage)
|
|
629
|
-
return;
|
|
630
|
-
logoSettingsStore.setState({
|
|
631
|
-
newState: { selectedLogoImage: logoImage },
|
|
632
|
-
});
|
|
633
|
-
const draftToken = logoImage.logoDraftToken;
|
|
634
|
-
if (!draftToken)
|
|
635
|
-
return;
|
|
636
|
-
// Re-derive enableEditMode + templateAsset from the draft registry
|
|
637
|
-
// (append-only for the session) instead of stashing on every entry.
|
|
638
|
-
const draft = logoStore.getLogoDraftAssetByToken(draftToken);
|
|
639
|
-
if (draft) {
|
|
640
|
-
editableLogoStore.setEnableEditMode(!draft.isByo);
|
|
641
|
-
if (draft.templateAsset) {
|
|
642
|
-
logoStore.setLogoTemplateAsset(draft.templateAsset);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
editableLogoStore.setLogoDraftToken(draftToken);
|
|
646
|
-
// No logo change → cache is still correct; just stamp base64 back
|
|
647
|
-
// (snapshot doesn't carry logoImageBase64Url).
|
|
648
|
-
const logoUnchanged = prevDraftToken === draftToken &&
|
|
649
|
-
(logoEditsStr === undefined || logoEditsStr === prevLogoEditsStr);
|
|
650
|
-
if (logoUnchanged) {
|
|
651
|
-
editableLogoStore.stampLogoBase64IntoBrandPageData();
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
const isByo = !!draft?.isByo;
|
|
655
|
-
if (isByo) {
|
|
656
|
-
// BYO mints a fresh draftToken per upload so the per-token
|
|
657
|
-
// cache always matches; no re-render needed.
|
|
658
|
-
if (editableLogoStore.restoreVariationsForDraftToken(draftToken)) {
|
|
659
|
-
editableLogoStore.stampLogoBase64IntoBrandPageData();
|
|
660
|
-
}
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
// Designed: draft token is reused across edits, so the cache
|
|
664
|
-
// only holds the latest render. Re-issue fabric-render — same
|
|
665
|
-
// call as the live edit path. Awaited so concurrent undos
|
|
666
|
-
// serialize and the call sits inside the isApplyingSnapshot
|
|
667
|
-
// window (watcher guard suppresses the writeback).
|
|
668
|
-
if (containerStore.isPrePurchase &&
|
|
669
|
-
logoEditsStr &&
|
|
670
|
-
logoStore.logoTemplateAsset) {
|
|
671
|
-
// Stamp the cached (pre-undo) base64 onto brandPageData first
|
|
672
|
-
// so the canvas keeps showing the previous logo while the
|
|
673
|
-
// re-render is in flight. Without this the logoImageBase64Url
|
|
674
|
-
// fields are undefined (snapshot is stripped pre-purchase) and
|
|
675
|
-
// the canvas flickers blank for ~500-1500ms.
|
|
676
|
-
editableLogoStore.stampLogoBase64IntoBrandPageData();
|
|
677
|
-
try {
|
|
678
|
-
await editableLogoStore.updateEditableLogoImageUrlAsync();
|
|
679
|
-
}
|
|
680
|
-
catch (error) {
|
|
681
|
-
console.error('brandpage-maker-store: failed to re-render logo on history apply', error);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
},
|
|
685
|
-
/**
|
|
686
|
-
* Restore the active page after a history apply. The id passed in is
|
|
687
|
-
* already validated against the restored nav by the history store; if
|
|
688
|
-
* it's undefined (no entry walking back had a viable page), fall back
|
|
689
|
-
* to the first/default route so the URL, `routeStore.currentRoute.params`,
|
|
690
|
-
* `pageNavigation.activePageId`, and the page-tab highlight all line up.
|
|
691
|
-
*
|
|
692
|
-
* `setCurrentActivePage` is called explicitly in addition to
|
|
693
|
-
* `navigateToPageByPageId` because `navigateToPageByPageId` is a no-op
|
|
694
|
-
* when the router instance is undefined (e.g. SSR / unit tests), but the
|
|
695
|
-
* Pinia state must still be updated so the sidebar's `currentPage`
|
|
696
|
-
* getter returns the right page.
|
|
697
|
-
*/
|
|
698
|
-
_navigateToActivePage(activePageId) {
|
|
699
|
-
const pageNavigationStore = usePageNavigationStore();
|
|
700
|
-
let targetPageId = activePageId;
|
|
701
|
-
if (!targetPageId) {
|
|
702
|
-
const fallbackRoute = pageNavigationStore.routes.length
|
|
703
|
-
? pageNavigationStore.getFirstOrDefaultRoute()
|
|
704
|
-
: undefined;
|
|
705
|
-
targetPageId = fallbackRoute?.pageId;
|
|
706
|
-
}
|
|
707
|
-
if (!targetPageId)
|
|
708
|
-
return;
|
|
709
|
-
// Skip both the Pinia write and the router push when the target page
|
|
710
|
-
// is already active. The router push fires `router.afterEach` even
|
|
711
|
-
// for same-page navigation, and BrandPageMaker.mixin's afterEach hook
|
|
712
|
-
// resets the content-settings modeStack — which would snap the
|
|
713
|
-
// sidebar back to the default Content tab on every undo/redo,
|
|
714
|
-
// regardless of whether the user was deep-editing a content item.
|
|
715
|
-
if (pageNavigationStore.activePageId === targetPageId)
|
|
716
|
-
return;
|
|
717
|
-
pageNavigationStore.setCurrentActivePage({ pageId: targetPageId });
|
|
718
|
-
navigateToPageByPageId(targetPageId);
|
|
719
|
-
},
|
|
720
|
-
_fallbackSidebarIfSelectedContentMissing(snapshot) {
|
|
721
|
-
const contentSettingsStore = useUiContentSettingsStore();
|
|
722
|
-
const sideBarStore = useUiSideBarStore();
|
|
723
|
-
const selectedItemId = contentSettingsStore.selectedItemId;
|
|
724
|
-
if (!selectedItemId)
|
|
725
|
-
return;
|
|
726
|
-
const existingContentIds = new Set();
|
|
727
|
-
snapshot.pages?.forEach((page) => {
|
|
728
|
-
page.contents?.forEach((content) => {
|
|
729
|
-
if (content?.id)
|
|
730
|
-
existingContentIds.add(content.id);
|
|
731
|
-
});
|
|
732
|
-
});
|
|
733
|
-
if (existingContentIds.has(selectedItemId))
|
|
734
|
-
return;
|
|
735
|
-
// The previously-selected content was undone away. Restore the
|
|
736
|
-
// Content tab's natural landing state — the same shape produced
|
|
737
|
-
// when the user clicks the Content tab fresh — instead of leaving
|
|
738
|
-
// the sidebar stuck rendering `<FocusedContentItemSettings>` for
|
|
739
|
-
// a missing item, which paints a blank panel.
|
|
740
|
-
//
|
|
741
|
-
// `resetMode()` pops the modeStack back to the base `edit` entry
|
|
742
|
-
// (the default landing mode); clearing `selectedItemId` releases
|
|
743
|
-
// the pointer to the now-deleted item.
|
|
744
|
-
sideBarStore.setSelectedTabName({
|
|
745
|
-
tabName: SIDE_BAR_TAB_NAMES.CONTENT_SETTINGS,
|
|
746
|
-
});
|
|
747
|
-
contentSettingsStore.resetMode();
|
|
748
|
-
contentSettingsStore.selectedItemId = null;
|
|
749
|
-
contentSettingsStore.selectedItemFieldName = null;
|
|
750
|
-
contentSettingsStore.selectedItemIndex = null;
|
|
751
|
-
contentSettingsStore.selectedItemValue = null;
|
|
752
450
|
},
|
|
753
451
|
export() {
|
|
754
452
|
const data = this.brandPageData;
|