@designcrowd/library.brand-page 6.2.0 → 6.2.2-live-preview-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-VQCQvlMg.js → CreatedOnBrandCrowd-de-de-Cn0M-eZ1.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DSf3BjCG.js → CreatedOnBrandCrowd-en-us-DRLMSDZr.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DGcdM9Ec.js → CreatedOnBrandCrowd-es-es-BglTu73U.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-C9g1fc39.js → CreatedOnBrandCrowd-fr-ca-Bj6YZ_el.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-C9g1fc39.js → CreatedOnBrandCrowd-fr-fr-Bj6YZ_el.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DSXr7Bxl.js → CreatedOnBrandCrowd-pt-br-DEoOmQ1F.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DSXr7Bxl.js → CreatedOnBrandCrowd-pt-pt-DEoOmQ1F.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BPdCL6wS.js → CreatedOnDcom-de-de-BZ7gTt4Z.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CLkSTQRu.js → CreatedOnDcom-en-us-CD6Km5sH.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CRknMAGv.js → CreatedOnDcom-es-es-CNpZHvEl.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-ClAY_dHI.js → CreatedOnDcom-fr-ca-URS-ydJ1.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DQtv9rR-.js → CreatedOnDcom-fr-fr-D2AVeA3H.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BbIxvmxv.js → CreatedOnDcom-pt-br-C32frnFs.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BOfOesBj.js → CreatedOnDcom-pt-pt-TDYGjRXS.js} +1 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +16 -2
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +17 -0
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +2 -1
- package/lib/src/brand-page/components/page/Page.mixin.js +12 -7
- package/lib/src/brand-page/components/page-header/HeaderLayout.stories.d.ts +1 -0
- package/lib/src/brand-page/components/page-header/HeaderLayout.stories.js +9 -0
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.d.ts +3 -1
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.js +10 -4
- package/lib/src/brand-page/constants/sections/header-display.constants.d.ts +3 -0
- package/lib/src/brand-page/constants/sections/header-display.constants.js +15 -0
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +0 -2
- package/lib/src/brand-page/models/brand-page-context.model.js +0 -12
- package/lib/src/brand-page/models/index.d.ts +12 -0
- package/lib/src/brand-page/models/index.js +4 -0
- package/lib/src/brand-page/utils/context.util.d.ts +1 -0
- package/lib/src/brand-page/utils/context.util.js +9 -0
- package/lib/src/brand-page/utils/route.util.d.ts +1 -0
- package/lib/src/brand-page/utils/route.util.js +9 -0
- package/lib/src/brand-page/utils/view-model.util.js +53 -1
- package/lib/src/brand-page/view-models.d.ts +3 -1
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.js +0 -9
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +9 -44
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +8 -43
- package/lib/src/brand-page-maker/components/preview/Preview.mixin.d.ts +0 -14
- package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +0 -42
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +3 -0
- package/lib/src/brand-page-maker/composables/useEventTracker.js +10 -0
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1626 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +0 -42
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +2 -4
- package/lib/src/brand-page-maker/validators/section-button.validator.d.ts +5 -2
- package/lib/src/brand-page-maker/validators/section-button.validator.js +11 -15
- package/lib/src/{bundled-translations-B2q5GWTQ.js → bundled-translations-BYUfWBT3.js} +17 -17
- package/lib/src/{bundled-translations.de-DE-FhH2H_rd.js → bundled-translations.de-DE-MmzUu1tt.js} +21 -21
- package/lib/src/{bundled-translations.es-ES-_ZExxMi7.js → bundled-translations.es-ES-D-tG33XL.js} +5 -5
- package/lib/src/{bundled-translations.fr-CA-Tg-ODIiC.js → bundled-translations.fr-CA-CNc1H1h3.js} +1 -1
- package/lib/src/{bundled-translations.fr-FR-C0sU51Mz.js → bundled-translations.fr-FR-DX0-yepT.js} +9 -9
- package/lib/src/{bundled-translations.pt-BR-MYFIhA4u.js → bundled-translations.pt-BR-ih1-LRgy.js} +9 -9
- package/lib/src/{bundled-translations.pt-PT-DeUBSzCB.js → bundled-translations.pt-PT-Dq2CmD1p.js} +22 -22
- package/lib/src/bundles/bundled-translations.de-DE.json +9 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +9 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +9 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +9 -2
- package/lib/src/bundles/bundled-translations.json +9 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +9 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +9 -2
- package/lib/src/composables/useTranslate.d.ts +1 -1
- package/lib/src/composables/useTranslate.js +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +577 -139
- package/lib/src/css/library.brand-page-brandPage.min.css +577 -139
- package/lib/src/css/library.brand-page-designCom.min.css +577 -139
- package/lib/src/css/library.brand-page-preview.min.css +577 -139
- package/lib/src/index.mjs +2 -2
- package/lib/src/{lib-BMVF4uNy.js → lib-Dm9AuOJL.js} +22487 -21900
- package/lib/src/metadata-builder/builders/item-id-utils.d.ts +2 -0
- package/lib/src/metadata-builder/builders/item-id-utils.js +8 -2
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +10 -2
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +7 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +6 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +6 -43
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +14 -2
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.js +14 -0
- package/lib/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.d.ts +9 -1
- package/lib/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.js +31 -9
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +1 -0
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +6 -43
- package/lib/src/shared/page-navigation/store/page-navigation-store.d.ts +3 -1
- package/lib/src/shared/page-navigation/store/page-navigation-store.js +34 -9
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +9 -2
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +200 -44
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.js +12 -35
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +190 -44
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +34 -2
- package/lib/src/shared/page-settings/duplicate-page.util.d.ts +4 -0
- package/lib/src/shared/page-settings/duplicate-page.util.js +82 -0
- package/lib/src/shared/page-settings/models.d.ts +1 -0
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +7 -2
- package/lib/src/shared/page-settings/store/page-settings-store.js +90 -7
- package/lib/src/shared/page-settings/utils.d.ts +3 -0
- package/lib/src/shared/page-settings/utils.js +6 -0
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -56
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +0 -42
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +4 -42
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +1 -0
- package/lib/src/tracker.mjs +1 -1
- package/lib/src/{useEventTracker-C5Ql5p7u.js → useEventTracker-DwPTmzpa.js} +13 -3
- package/package.json +2 -2
- package/src/brand-page/components/navigation/hamburger/HamburgerNavigation.vue +1 -0
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +18 -1
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +73 -3
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +181 -0
- package/src/brand-page/components/page/Page.mixin.ts +21 -11
- package/src/brand-page/components/page/Page.vue +2 -0
- package/src/brand-page/components/page-header/HeaderLayout.stories.ts +10 -0
- package/src/brand-page/components/page-header/HeaderLayout.vue +415 -71
- package/src/brand-page/components/page-header/PageHeader.mixin.ts +14 -10
- package/src/brand-page/components/page-header/PageHeader.vue +16 -1
- package/src/brand-page/components/page-header/PageHeader.vue.test.ts +339 -0
- package/src/brand-page/constants/sections/header-display.constants.test.ts +44 -0
- package/src/brand-page/constants/sections/header-display.constants.ts +35 -0
- package/src/brand-page/models/brand-page-context.model.ts +0 -23
- package/src/brand-page/models/header-button.model.test.ts +85 -0
- package/src/brand-page/models/index.ts +19 -0
- package/src/brand-page/utils/context.util.ts +15 -0
- package/src/brand-page/utils/route.util.ts +13 -0
- package/src/brand-page/utils/view-model.util.test.ts +151 -1
- package/src/brand-page/utils/view-model.util.ts +73 -1
- package/src/brand-page/view-models.ts +3 -0
- package/src/brand-page-maker/components/action-bar/ActionBar.mixin.ts +0 -10
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.test.ts +8 -49
- package/src/brand-page-maker/components/action-bar/ActionBarNavigation.vue +1 -1
- package/src/brand-page-maker/composables/useEventTracker.ts +13 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +2 -4
- package/src/brand-page-maker/validators/section-button.validator.ts +23 -19
- package/src/bundles/bundled-translations.de-DE.json +9 -2
- package/src/bundles/bundled-translations.es-ES.json +9 -2
- package/src/bundles/bundled-translations.fr-CA.json +9 -2
- package/src/bundles/bundled-translations.fr-FR.json +9 -2
- package/src/bundles/bundled-translations.json +9 -2
- package/src/bundles/bundled-translations.pt-BR.json +9 -2
- package/src/bundles/bundled-translations.pt-PT.json +9 -2
- package/src/composables/useTranslate.ts +2 -1
- package/src/metadata-builder/builders/item-id-utils.ts +9 -2
- package/src/shared/content-settings/components/text-field/TextField.mixin.ts +15 -0
- package/src/shared/content-settings/components/url-field/UrlField.vue +1 -0
- package/src/shared/ecommerce-settings/components/product-config-field/ProductConfigOption.vue +0 -2
- package/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.ts +32 -10
- package/src/shared/page-navigation/store/page-navigation-store.ts +57 -13
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.button-section.test.ts +131 -0
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +65 -10
- package/src/shared/page-settings/components/page-settings/NestedDraggable.vue +3 -0
- package/src/shared/page-settings/components/page-settings/PageElement.vue +2 -0
- package/src/shared/page-settings/components/page-settings/PageSettingMenu.test.ts +105 -0
- package/src/shared/page-settings/components/page-settings/PageSettingMenu.vue +16 -0
- package/src/shared/page-settings/components/page-settings/PageSettings.duplicate.test.ts +108 -0
- package/src/shared/page-settings/components/page-settings/PageSettings.mixin.ts +22 -50
- package/src/shared/page-settings/components/page-settings/PageSettings.vue +1 -0
- package/src/shared/page-settings/components/page-settings/i18n/page-settings.de-DE.json +3 -1
- package/src/shared/page-settings/components/page-settings/i18n/page-settings.es-ES.json +3 -1
- package/src/shared/page-settings/components/page-settings/i18n/page-settings.fr-CA.json +3 -1
- package/src/shared/page-settings/components/page-settings/i18n/page-settings.fr-FR.json +3 -1
- package/src/shared/page-settings/components/page-settings/i18n/page-settings.json +3 -1
- package/src/shared/page-settings/components/page-settings/i18n/page-settings.pt-BR.json +3 -1
- package/src/shared/page-settings/components/page-settings/i18n/page-settings.pt-PT.json +3 -1
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +305 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +265 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.test.ts +354 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.vue +48 -9
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.header-button.test.ts +114 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +38 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.de-DE.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.es-ES.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.fr-CA.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.fr-FR.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.pt-BR.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.pt-PT.json +6 -1
- package/src/shared/page-settings/duplicate-page.util.test.ts +382 -0
- package/src/shared/page-settings/duplicate-page.util.ts +124 -0
- package/src/shared/page-settings/models.ts +1 -0
- package/src/shared/page-settings/store/page-settings-store.test.ts +441 -1
- package/src/shared/page-settings/store/page-settings-store.ts +147 -11
- package/src/shared/page-settings/utils.ts +10 -0
|
@@ -6,6 +6,8 @@ import type { BrandPageModel } from '../../brand-page/models';
|
|
|
6
6
|
export declare const END_ITEM_ANCHOR = "__end__";
|
|
7
7
|
/** Generate a stable item id. Mirrors section-level `uuid.v4()` id generation. */
|
|
8
8
|
export declare const generateItemId: () => string;
|
|
9
|
+
/** Every array field the minifier surfaces to the AI as a list of items. */
|
|
10
|
+
export declare const ITEM_ID_BEARING_FIELDS: readonly ["images", "items", "textItems", "links"];
|
|
9
11
|
/**
|
|
10
12
|
* Walk an entire BrandPageModel and backfill a stable uuid `id` onto every
|
|
11
13
|
* nested array item that lacks one (gallery images, images/shapes/testimonial
|
|
@@ -6,6 +6,13 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
6
6
|
export const END_ITEM_ANCHOR = '__end__';
|
|
7
7
|
/** Generate a stable item id. Mirrors section-level `uuid.v4()` id generation. */
|
|
8
8
|
export const generateItemId = () => uuidv4();
|
|
9
|
+
/** Every array field the minifier surfaces to the AI as a list of items. */
|
|
10
|
+
export const ITEM_ID_BEARING_FIELDS = [
|
|
11
|
+
'images',
|
|
12
|
+
'items',
|
|
13
|
+
'textItems',
|
|
14
|
+
'links',
|
|
15
|
+
];
|
|
9
16
|
/**
|
|
10
17
|
* Walk an entire BrandPageModel and backfill a stable uuid `id` onto every
|
|
11
18
|
* nested array item that lacks one (gallery images, images/shapes/testimonial
|
|
@@ -19,8 +26,7 @@ export const generateItemId = () => uuidv4();
|
|
|
19
26
|
*/
|
|
20
27
|
export const ensureBrandPageItemIds = (model) => {
|
|
21
28
|
const ensureContentItemIds = (content) => {
|
|
22
|
-
|
|
23
|
-
for (const field of ['images', 'items', 'textItems', 'links']) {
|
|
29
|
+
for (const field of ITEM_ID_BEARING_FIELDS) {
|
|
24
30
|
const arr = content[field];
|
|
25
31
|
if (Array.isArray(arr))
|
|
26
32
|
ensureItemIds(arr);
|
package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts
CHANGED
|
@@ -468,8 +468,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
468
468
|
}>;
|
|
469
469
|
pageNavigationStore: import("pinia").Store<"pageNavigation", import("../../../../shared/page-navigation/store/page-navigation-store").PageNavigationState, {
|
|
470
470
|
nav(): import("@brand-page").NavModel;
|
|
471
|
+
hasVisibleNavigation(): boolean;
|
|
471
472
|
}, {
|
|
472
473
|
getPageSlugsForDepth(parentRouteId?: string): string[];
|
|
474
|
+
getDisplayNamesForDepth(parentRouteId?: string): string[];
|
|
473
475
|
getParentRouteIdForPage(pageId: string): string | undefined;
|
|
474
476
|
getParentRouteIdForRoute(routeId: string): string | undefined;
|
|
475
477
|
getFirstOrDefaultRoute(): import("@brand-page").NavRoute;
|
|
@@ -482,7 +484,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
482
484
|
setNav({ nav }: {
|
|
483
485
|
nav: import("@brand-page").NavModel;
|
|
484
486
|
}): void;
|
|
485
|
-
addNavRoute(newRoute: import("@brand-page").NavRoute, parentRouteId?: string): void;
|
|
487
|
+
addNavRoute(newRoute: import("@brand-page").NavRoute, parentRouteId?: string, insertAfterRouteId?: string): void;
|
|
486
488
|
removeNavRoute(routeId: string): void;
|
|
487
489
|
onDisplayNameChange(routeId: string, newDisplayName: string): void;
|
|
488
490
|
setRouteTitleAndSlugByPageId(pageId: string, displayName: string, slug: string): void;
|
|
@@ -507,6 +509,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
507
509
|
setPages({ pages }: {
|
|
508
510
|
pages: import("../../../page-settings/models").ContentPage[];
|
|
509
511
|
}): void;
|
|
512
|
+
syncPagesWithOrders(): void;
|
|
513
|
+
showPageLimitUpgradeModalAsync(ctaLocation: string): Promise<void>;
|
|
510
514
|
setNewPageModalVisibilityAsync({ isNewPageModalVisible, parentPageId, }: {
|
|
511
515
|
isNewPageModalVisible: boolean;
|
|
512
516
|
parentPageId?: string;
|
|
@@ -527,7 +531,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
527
531
|
sectionName: import("../../../page-settings/store").PageSettingsSection;
|
|
528
532
|
propName: keyof import("../../../page-settings/store").PageSettingsStateSectionStyles;
|
|
529
533
|
index?: number;
|
|
530
|
-
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | number | null | undefined;
|
|
534
|
+
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | import("@brand-page").HeaderButton | number | null | undefined;
|
|
531
535
|
merge?: boolean;
|
|
532
536
|
viewport: import("@brand-page").ViewportsType;
|
|
533
537
|
}): void;
|
|
@@ -556,6 +560,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
556
560
|
title: string;
|
|
557
561
|
newPageParentId?: string;
|
|
558
562
|
}): import("../../../page-settings/models").ContentPage;
|
|
563
|
+
duplicatePage({ pageId, }: {
|
|
564
|
+
pageId: string;
|
|
565
|
+
}): Promise<import("../../../page-settings/models").ContentPage | undefined>;
|
|
559
566
|
setSelectedSectionName({ sectionName, }: {
|
|
560
567
|
sectionName?: import("../../../page-settings/store").PageSettingsSection;
|
|
561
568
|
}): void;
|
|
@@ -680,6 +687,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
680
687
|
sendWebsiteManageAddPageEvent: (pageName: string, isSubPageMode?: boolean) => void;
|
|
681
688
|
sendWebsiteManageRemovePageEvent: (pageName: string, isRouteNested?: boolean) => void;
|
|
682
689
|
sendWebsiteManageReorderPageEvent: (pageName: string) => void;
|
|
690
|
+
sendWebsiteManageDuplicatePageEvent: (sourcePageName: string, isSubPage?: boolean) => void;
|
|
683
691
|
sendPublishOptionsForFreeEvent: () => void;
|
|
684
692
|
sendPublishOptionsForPremiumEvent: () => void;
|
|
685
693
|
sendPublishOptionsForExitEvent: () => void;
|
|
@@ -516,6 +516,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
516
516
|
setPages({ pages }: {
|
|
517
517
|
pages: import("../../../page-settings/models").ContentPage[];
|
|
518
518
|
}): void;
|
|
519
|
+
syncPagesWithOrders(): void;
|
|
520
|
+
showPageLimitUpgradeModalAsync(ctaLocation: string): Promise<void>;
|
|
519
521
|
setNewPageModalVisibilityAsync({ isNewPageModalVisible, parentPageId, }: {
|
|
520
522
|
isNewPageModalVisible: boolean;
|
|
521
523
|
parentPageId?: string;
|
|
@@ -536,7 +538,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
536
538
|
sectionName: import("../../../page-settings/store").PageSettingsSection;
|
|
537
539
|
propName: keyof PageSettingsStateSectionStyles;
|
|
538
540
|
index?: number;
|
|
539
|
-
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | number | null | undefined;
|
|
541
|
+
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | import("@brand-page").HeaderButton | number | null | undefined;
|
|
540
542
|
merge?: boolean;
|
|
541
543
|
viewport: import("@brand-page").ViewportsType;
|
|
542
544
|
}): void;
|
|
@@ -565,6 +567,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
565
567
|
title: string;
|
|
566
568
|
newPageParentId?: string;
|
|
567
569
|
}): import("../../../page-settings/models").ContentPage;
|
|
570
|
+
duplicatePage({ pageId, }: {
|
|
571
|
+
pageId: string;
|
|
572
|
+
}): Promise<import("../../../page-settings/models").ContentPage | undefined>;
|
|
568
573
|
setSelectedSectionName({ sectionName, }: {
|
|
569
574
|
sectionName?: import("../../../page-settings/store").PageSettingsSection;
|
|
570
575
|
}): void;
|
|
@@ -800,6 +805,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
800
805
|
sendWebsiteManageAddPageEvent: (pageName: string, isSubPageMode?: boolean) => void;
|
|
801
806
|
sendWebsiteManageRemovePageEvent: (pageName: string, isRouteNested?: boolean) => void;
|
|
802
807
|
sendWebsiteManageReorderPageEvent: (pageName: string) => void;
|
|
808
|
+
sendWebsiteManageDuplicatePageEvent: (sourcePageName: string, isSubPage?: boolean) => void;
|
|
803
809
|
sendPublishOptionsForFreeEvent: () => void;
|
|
804
810
|
sendPublishOptionsForPremiumEvent: () => void;
|
|
805
811
|
sendPublishOptionsForExitEvent: () => void;
|
|
@@ -532,6 +532,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
532
532
|
sendWebsiteManageAddPageEvent: (pageName: string, isSubPageMode?: boolean) => void;
|
|
533
533
|
sendWebsiteManageRemovePageEvent: (pageName: string, isRouteNested?: boolean) => void;
|
|
534
534
|
sendWebsiteManageReorderPageEvent: (pageName: string) => void;
|
|
535
|
+
sendWebsiteManageDuplicatePageEvent: (sourcePageName: string, isSubPage?: boolean) => void;
|
|
535
536
|
sendPublishOptionsForFreeEvent: () => void;
|
|
536
537
|
sendPublishOptionsForPremiumEvent: () => void;
|
|
537
538
|
sendPublishOptionsForExitEvent: () => void;
|
|
@@ -738,6 +738,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
738
738
|
setPages({ pages }: {
|
|
739
739
|
pages: import("../../../page-settings/models").ContentPage[];
|
|
740
740
|
}): void;
|
|
741
|
+
syncPagesWithOrders(): void;
|
|
742
|
+
showPageLimitUpgradeModalAsync(ctaLocation: string): Promise<void>;
|
|
741
743
|
setNewPageModalVisibilityAsync({ isNewPageModalVisible, parentPageId, }: {
|
|
742
744
|
isNewPageModalVisible: boolean;
|
|
743
745
|
parentPageId?: string;
|
|
@@ -758,7 +760,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
758
760
|
sectionName: import("../../../page-settings/store").PageSettingsSection;
|
|
759
761
|
propName: keyof import("../../../page-settings/store").PageSettingsStateSectionStyles;
|
|
760
762
|
index?: number;
|
|
761
|
-
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | number | null | undefined;
|
|
763
|
+
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | import("@brand-page").HeaderButton | number | null | undefined;
|
|
762
764
|
merge?: boolean;
|
|
763
765
|
viewport: import("@brand-page").ViewportsType;
|
|
764
766
|
}): void;
|
|
@@ -787,6 +789,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
787
789
|
title: string;
|
|
788
790
|
newPageParentId?: string;
|
|
789
791
|
}): import("../../../page-settings/models").ContentPage;
|
|
792
|
+
duplicatePage({ pageId, }: {
|
|
793
|
+
pageId: string;
|
|
794
|
+
}): Promise<import("../../../page-settings/models").ContentPage | undefined>;
|
|
790
795
|
setSelectedSectionName({ sectionName, }: {
|
|
791
796
|
sectionName?: import("../../../page-settings/store").PageSettingsSection;
|
|
792
797
|
}): void;
|
|
@@ -91,20 +91,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
91
91
|
isVariation: boolean;
|
|
92
92
|
isExcluded: boolean;
|
|
93
93
|
} | undefined;
|
|
94
|
-
bp_5873_live_preview_prepurchase?: {
|
|
95
|
-
key: string;
|
|
96
|
-
value: string;
|
|
97
|
-
isControl: boolean;
|
|
98
|
-
isVariation: boolean;
|
|
99
|
-
isExcluded: boolean;
|
|
100
|
-
} | undefined;
|
|
101
|
-
bp_5873_live_preview_postpurchase?: {
|
|
102
|
-
key: string;
|
|
103
|
-
value: string;
|
|
104
|
-
isControl: boolean;
|
|
105
|
-
isVariation: boolean;
|
|
106
|
-
isExcluded: boolean;
|
|
107
|
-
} | undefined;
|
|
108
94
|
};
|
|
109
95
|
isSubsequentPublish: boolean;
|
|
110
96
|
isContextualUpgradeModalVisible: boolean;
|
|
@@ -180,20 +166,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
180
166
|
isVariation: boolean;
|
|
181
167
|
isExcluded: boolean;
|
|
182
168
|
} | undefined;
|
|
183
|
-
bp_5873_live_preview_prepurchase?: {
|
|
184
|
-
key: string;
|
|
185
|
-
value: string;
|
|
186
|
-
isControl: boolean;
|
|
187
|
-
isVariation: boolean;
|
|
188
|
-
isExcluded: boolean;
|
|
189
|
-
} | undefined;
|
|
190
|
-
bp_5873_live_preview_postpurchase?: {
|
|
191
|
-
key: string;
|
|
192
|
-
value: string;
|
|
193
|
-
isControl: boolean;
|
|
194
|
-
isVariation: boolean;
|
|
195
|
-
isExcluded: boolean;
|
|
196
|
-
} | undefined;
|
|
197
169
|
};
|
|
198
170
|
isSubsequentPublish: boolean;
|
|
199
171
|
isContextualUpgradeModalVisible: boolean;
|
|
@@ -269,20 +241,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
269
241
|
isVariation: boolean;
|
|
270
242
|
isExcluded: boolean;
|
|
271
243
|
} | undefined;
|
|
272
|
-
bp_5873_live_preview_prepurchase?: {
|
|
273
|
-
key: string;
|
|
274
|
-
value: string;
|
|
275
|
-
isControl: boolean;
|
|
276
|
-
isVariation: boolean;
|
|
277
|
-
isExcluded: boolean;
|
|
278
|
-
} | undefined;
|
|
279
|
-
bp_5873_live_preview_postpurchase?: {
|
|
280
|
-
key: string;
|
|
281
|
-
value: string;
|
|
282
|
-
isControl: boolean;
|
|
283
|
-
isVariation: boolean;
|
|
284
|
-
isExcluded: boolean;
|
|
285
|
-
} | undefined;
|
|
286
244
|
};
|
|
287
245
|
isSubsequentPublish: boolean;
|
|
288
246
|
isContextualUpgradeModalVisible: boolean;
|
|
@@ -540,6 +498,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
540
498
|
setPages({ pages }: {
|
|
541
499
|
pages: import("../../../page-settings/models").ContentPage[];
|
|
542
500
|
}): void;
|
|
501
|
+
syncPagesWithOrders(): void;
|
|
502
|
+
showPageLimitUpgradeModalAsync(ctaLocation: string): Promise<void>;
|
|
543
503
|
setNewPageModalVisibilityAsync({ isNewPageModalVisible, parentPageId, }: {
|
|
544
504
|
isNewPageModalVisible: boolean;
|
|
545
505
|
parentPageId?: string;
|
|
@@ -560,7 +520,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
560
520
|
sectionName: import("@shared/page-settings/store").PageSettingsSection;
|
|
561
521
|
propName: keyof import("@shared/page-settings/store").PageSettingsStateSectionStyles;
|
|
562
522
|
index?: number;
|
|
563
|
-
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | number | null | undefined;
|
|
523
|
+
value: string | boolean | import("@brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("@brand-page").ImageGalleryItem> | import("@brand-page").HeaderButton | number | null | undefined;
|
|
564
524
|
merge?: boolean;
|
|
565
525
|
viewport: import("@brand-page").ViewportsType;
|
|
566
526
|
}): void;
|
|
@@ -589,6 +549,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
589
549
|
title: string;
|
|
590
550
|
newPageParentId?: string;
|
|
591
551
|
}): import("../../../page-settings/models").ContentPage;
|
|
552
|
+
duplicatePage({ pageId, }: {
|
|
553
|
+
pageId: string;
|
|
554
|
+
}): Promise<import("../../../page-settings/models").ContentPage | undefined>;
|
|
592
555
|
setSelectedSectionName({ sectionName, }: {
|
|
593
556
|
sectionName?: import("@shared/page-settings/store").PageSettingsSection;
|
|
594
557
|
}): void;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
showErrorWhenEmpty: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
7
|
attrs: {
|
|
3
8
|
type: ObjectConstructor;
|
|
4
9
|
required: false;
|
|
@@ -197,5 +202,12 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
197
202
|
}, {}, {
|
|
198
203
|
TextInput: any;
|
|
199
204
|
Textarea: any;
|
|
200
|
-
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<
|
|
205
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
206
|
+
showErrorWhenEmpty: {
|
|
207
|
+
type: BooleanConstructor;
|
|
208
|
+
default: boolean;
|
|
209
|
+
};
|
|
210
|
+
}>> & Readonly<{}>, {
|
|
211
|
+
showErrorWhenEmpty: boolean;
|
|
212
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
201
213
|
export default _default;
|
|
@@ -2,4 +2,18 @@ import { defineComponent } from 'vue';
|
|
|
2
2
|
import GenericTextInputMixin from '../GenericTextInput.mixin';
|
|
3
3
|
export default defineComponent({
|
|
4
4
|
mixins: [GenericTextInputMixin],
|
|
5
|
+
props: {
|
|
6
|
+
// Opt-in: clearing the field shows its error at once, not only after blur.
|
|
7
|
+
showErrorWhenEmpty: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: false,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
watch: {
|
|
13
|
+
value(value) {
|
|
14
|
+
if (this.showErrorWhenEmpty && !(value || '').trim()) {
|
|
15
|
+
this.isDirty = false;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
},
|
|
5
19
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BrandPageModel } from '@brand-page/models';
|
|
1
|
+
import type { BrandPageModel, Content } from '@brand-page/models';
|
|
2
2
|
/**
|
|
3
3
|
* Refresh a (migrated, current-version) BrandPageModel so it is safe to persist as a *duplicate*.
|
|
4
4
|
* Two things travel with a verbatim copy that must not: client-minted identifiers that the
|
|
@@ -9,3 +9,11 @@ import type { BrandPageModel } from '@brand-page/models';
|
|
|
9
9
|
* See `shop-duplication.md`.
|
|
10
10
|
*/
|
|
11
11
|
export declare function refreshDuplicatedMetadata(model: BrandPageModel): BrandPageModel;
|
|
12
|
+
/**
|
|
13
|
+
* Rotate the client-minted ids the brand-page-api keys a **global** row on — shop product / sku_key
|
|
14
|
+
* and payment-option ids. A verbatim copy collides with its source on those tables.
|
|
15
|
+
*
|
|
16
|
+
* Shared with page duplication, which wants only this half: that copy keeps the same owner, so it
|
|
17
|
+
* keeps its payment connection.
|
|
18
|
+
*/
|
|
19
|
+
export declare function rotateMonetizationIds(content: Content): void;
|
|
@@ -16,10 +16,8 @@ export function refreshDuplicatedMetadata(model) {
|
|
|
16
16
|
// content-level connections below are cleared. Disconnect it too; the new owner reconnects.
|
|
17
17
|
model.paymentConfig = undefined;
|
|
18
18
|
model.pages.forEach((page) => page.contents.forEach((content) => {
|
|
19
|
+
rotateMonetizationIds(content);
|
|
19
20
|
if (isShopContent(content)) {
|
|
20
|
-
// Shop products collide on the global product / sku_key tables. The shop's payment-config
|
|
21
|
-
// link is written with throwaway ids (not the content id), so only the product ids rotate.
|
|
22
|
-
content.products.forEach(rotateProductIds);
|
|
23
21
|
disconnectPayment(content.shopPaymentConfig);
|
|
24
22
|
}
|
|
25
23
|
else if (isPayment(content)) {
|
|
@@ -31,6 +29,26 @@ export function refreshDuplicatedMetadata(model) {
|
|
|
31
29
|
}));
|
|
32
30
|
return model;
|
|
33
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Rotate the client-minted ids the brand-page-api keys a **global** row on — shop product / sku_key
|
|
34
|
+
* and payment-option ids. A verbatim copy collides with its source on those tables.
|
|
35
|
+
*
|
|
36
|
+
* Shared with page duplication, which wants only this half: that copy keeps the same owner, so it
|
|
37
|
+
* keeps its payment connection.
|
|
38
|
+
*/
|
|
39
|
+
export function rotateMonetizationIds(content) {
|
|
40
|
+
if (isShopContent(content)) {
|
|
41
|
+
// The shop's payment-config link is written with throwaway ids (not the content id), so only
|
|
42
|
+
// the product ids rotate here.
|
|
43
|
+
content.products.forEach(rotateProductIds);
|
|
44
|
+
}
|
|
45
|
+
else if (isPayment(content)) {
|
|
46
|
+
rotatePaymentOptionIds(content.requestPaymentConfig);
|
|
47
|
+
}
|
|
48
|
+
else if (isSupportMe(content)) {
|
|
49
|
+
rotatePaymentOptionIds(content.supportMeConfig);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
34
52
|
function rotateProductIds(product) {
|
|
35
53
|
product.id = uuid();
|
|
36
54
|
// The option id is the only value cross-referenced inside a product — SKUs point at product
|
|
@@ -56,17 +74,21 @@ function rotateProductIds(product) {
|
|
|
56
74
|
sku.skuKey = generateSku(product.name, sku.variant[0]?.option);
|
|
57
75
|
});
|
|
58
76
|
}
|
|
77
|
+
// `brand_page_product` is keyed on the payment-option id, so a verbatim copy would adopt the
|
|
78
|
+
// source's product rows on its next payment upsert.
|
|
79
|
+
function rotatePaymentOptionIds(config) {
|
|
80
|
+
config.paymentOptions.forEach((option) => {
|
|
81
|
+
option.id = uuid();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
59
84
|
/**
|
|
60
85
|
* request-payment / support-me content. The api keys `content_block_payment_config` on the content
|
|
61
|
-
* id (PK)
|
|
62
|
-
*
|
|
63
|
-
*
|
|
86
|
+
* id (PK), so a verbatim copy would repoint the source's config link on its next payment upsert -
|
|
87
|
+
* re-mint it, then drop the connection. (The option ids are rotated upstream, for both kinds of
|
|
88
|
+
* duplication.)
|
|
64
89
|
*/
|
|
65
90
|
function resetPaymentBlock(content, config) {
|
|
66
91
|
content.id = uuid();
|
|
67
|
-
config.paymentOptions.forEach((option) => {
|
|
68
|
-
option.id = uuid();
|
|
69
|
-
});
|
|
70
92
|
disconnectPayment(config);
|
|
71
93
|
}
|
|
72
94
|
/**
|
|
@@ -299,6 +299,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
299
299
|
sendWebsiteManageAddPageEvent: (pageName: string, isSubPageMode?: boolean) => void;
|
|
300
300
|
sendWebsiteManageRemovePageEvent: (pageName: string, isRouteNested?: boolean) => void;
|
|
301
301
|
sendWebsiteManageReorderPageEvent: (pageName: string) => void;
|
|
302
|
+
sendWebsiteManageDuplicatePageEvent: (sourcePageName: string, isSubPage?: boolean) => void;
|
|
302
303
|
sendPublishOptionsForFreeEvent: () => void;
|
|
303
304
|
sendPublishOptionsForPremiumEvent: () => void;
|
|
304
305
|
sendPublishOptionsForExitEvent: () => void;
|
|
@@ -387,20 +387,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
387
387
|
isVariation: boolean;
|
|
388
388
|
isExcluded: boolean;
|
|
389
389
|
} | undefined;
|
|
390
|
-
bp_5873_live_preview_prepurchase?: {
|
|
391
|
-
key: string;
|
|
392
|
-
value: string;
|
|
393
|
-
isControl: boolean;
|
|
394
|
-
isVariation: boolean;
|
|
395
|
-
isExcluded: boolean;
|
|
396
|
-
} | undefined;
|
|
397
|
-
bp_5873_live_preview_postpurchase?: {
|
|
398
|
-
key: string;
|
|
399
|
-
value: string;
|
|
400
|
-
isControl: boolean;
|
|
401
|
-
isVariation: boolean;
|
|
402
|
-
isExcluded: boolean;
|
|
403
|
-
} | undefined;
|
|
404
390
|
};
|
|
405
391
|
isSubsequentPublish: boolean;
|
|
406
392
|
isContextualUpgradeModalVisible: boolean;
|
|
@@ -476,20 +462,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
476
462
|
isVariation: boolean;
|
|
477
463
|
isExcluded: boolean;
|
|
478
464
|
} | undefined;
|
|
479
|
-
bp_5873_live_preview_prepurchase?: {
|
|
480
|
-
key: string;
|
|
481
|
-
value: string;
|
|
482
|
-
isControl: boolean;
|
|
483
|
-
isVariation: boolean;
|
|
484
|
-
isExcluded: boolean;
|
|
485
|
-
} | undefined;
|
|
486
|
-
bp_5873_live_preview_postpurchase?: {
|
|
487
|
-
key: string;
|
|
488
|
-
value: string;
|
|
489
|
-
isControl: boolean;
|
|
490
|
-
isVariation: boolean;
|
|
491
|
-
isExcluded: boolean;
|
|
492
|
-
} | undefined;
|
|
493
465
|
};
|
|
494
466
|
isSubsequentPublish: boolean;
|
|
495
467
|
isContextualUpgradeModalVisible: boolean;
|
|
@@ -565,20 +537,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
565
537
|
isVariation: boolean;
|
|
566
538
|
isExcluded: boolean;
|
|
567
539
|
} | undefined;
|
|
568
|
-
bp_5873_live_preview_prepurchase?: {
|
|
569
|
-
key: string;
|
|
570
|
-
value: string;
|
|
571
|
-
isControl: boolean;
|
|
572
|
-
isVariation: boolean;
|
|
573
|
-
isExcluded: boolean;
|
|
574
|
-
} | undefined;
|
|
575
|
-
bp_5873_live_preview_postpurchase?: {
|
|
576
|
-
key: string;
|
|
577
|
-
value: string;
|
|
578
|
-
isControl: boolean;
|
|
579
|
-
isVariation: boolean;
|
|
580
|
-
isExcluded: boolean;
|
|
581
|
-
} | undefined;
|
|
582
540
|
};
|
|
583
541
|
isSubsequentPublish: boolean;
|
|
584
542
|
isContextualUpgradeModalVisible: boolean;
|
|
@@ -707,6 +665,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
707
665
|
setPages({ pages }: {
|
|
708
666
|
pages: import("../../page-settings/models").ContentPage[];
|
|
709
667
|
}): void;
|
|
668
|
+
syncPagesWithOrders(): void;
|
|
669
|
+
showPageLimitUpgradeModalAsync(ctaLocation: string): Promise<void>;
|
|
710
670
|
setNewPageModalVisibilityAsync({ isNewPageModalVisible, parentPageId, }: {
|
|
711
671
|
isNewPageModalVisible: boolean;
|
|
712
672
|
parentPageId?: string;
|
|
@@ -727,7 +687,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
727
687
|
sectionName: import("@shared/page-settings/store").PageSettingsSection;
|
|
728
688
|
propName: keyof import("@shared/page-settings/store").PageSettingsStateSectionStyles;
|
|
729
689
|
index?: number;
|
|
730
|
-
value: string | boolean | import("../../../brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("../../../brand-page").ImageGalleryItem> | number | null | undefined;
|
|
690
|
+
value: string | boolean | import("../../../brand-page").LinksItem[] | BrandPageCssStyle | Partial<import("../../../brand-page").ImageGalleryItem> | import("../../../brand-page").HeaderButton | number | null | undefined;
|
|
731
691
|
merge?: boolean;
|
|
732
692
|
viewport: import("../../../brand-page").ViewportsType;
|
|
733
693
|
}): void;
|
|
@@ -756,6 +716,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
756
716
|
title: string;
|
|
757
717
|
newPageParentId?: string;
|
|
758
718
|
}): import("../../page-settings/models").ContentPage;
|
|
719
|
+
duplicatePage({ pageId, }: {
|
|
720
|
+
pageId: string;
|
|
721
|
+
}): Promise<import("../../page-settings/models").ContentPage | undefined>;
|
|
759
722
|
setSelectedSectionName({ sectionName, }: {
|
|
760
723
|
sectionName?: import("@shared/page-settings/store").PageSettingsSection;
|
|
761
724
|
}): void;
|
|
@@ -6,8 +6,10 @@ export interface PageNavigationState {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const usePageNavigationStore: import("pinia").StoreDefinition<"pageNavigation", PageNavigationState, {
|
|
8
8
|
nav(): NavModel;
|
|
9
|
+
hasVisibleNavigation(): boolean;
|
|
9
10
|
}, {
|
|
10
11
|
getPageSlugsForDepth(parentRouteId?: string): string[];
|
|
12
|
+
getDisplayNamesForDepth(parentRouteId?: string): string[];
|
|
11
13
|
getParentRouteIdForPage(pageId: string): string | undefined;
|
|
12
14
|
getParentRouteIdForRoute(routeId: string): string | undefined;
|
|
13
15
|
getFirstOrDefaultRoute(): NavRoute;
|
|
@@ -20,7 +22,7 @@ export declare const usePageNavigationStore: import("pinia").StoreDefinition<"pa
|
|
|
20
22
|
setNav({ nav }: {
|
|
21
23
|
nav: NavModel;
|
|
22
24
|
}): void;
|
|
23
|
-
addNavRoute(newRoute: NavRoute, parentRouteId?: string): void;
|
|
25
|
+
addNavRoute(newRoute: NavRoute, parentRouteId?: string, insertAfterRouteId?: string): void;
|
|
24
26
|
removeNavRoute(routeId: string): void;
|
|
25
27
|
onDisplayNameChange(routeId: string, newDisplayName: string): void;
|
|
26
28
|
setRouteTitleAndSlugByPageId(pageId: string, displayName: string, slug: string): void;
|
|
@@ -16,9 +16,9 @@ const findParentRouteIdForRouteId = (orders, targetRouteId, parentRouteId) => {
|
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
const
|
|
19
|
+
// Routes at one depth. Slugs and titles only need to be unique among siblings,
|
|
20
|
+
// so /home/home-1 and /my-home/home-1 can coexist.
|
|
21
|
+
const getRoutesForCurrentDepth = (navModel, parentRouteId, excludeRouteId) => {
|
|
22
22
|
let ordersAtDepth;
|
|
23
23
|
if (!parentRouteId) {
|
|
24
24
|
ordersAtDepth = navModel.orders;
|
|
@@ -28,10 +28,9 @@ const getPageSlugsForCurrentDepth = (navModel, parentRouteId, excludeRouteId) =>
|
|
|
28
28
|
ordersAtDepth = parentOrder?.subRoutes || [];
|
|
29
29
|
}
|
|
30
30
|
const routeIdsAtDepth = ordersAtDepth.map((order) => order.routeId);
|
|
31
|
-
return navModel.routes
|
|
32
|
-
.filter((route) => routeIdsAtDepth.includes(route.id) && route.id !== excludeRouteId)
|
|
33
|
-
.map((route) => route.pageSlug);
|
|
31
|
+
return navModel.routes.filter((route) => routeIdsAtDepth.includes(route.id) && route.id !== excludeRouteId);
|
|
34
32
|
};
|
|
33
|
+
const getPageSlugsForCurrentDepth = (navModel, parentRouteId, excludeRouteId) => getRoutesForCurrentDepth(navModel, parentRouteId, excludeRouteId).map((route) => route.pageSlug);
|
|
35
34
|
export const usePageNavigationStore = defineStore('pageNavigation', {
|
|
36
35
|
state: () => ({
|
|
37
36
|
routes: [],
|
|
@@ -45,11 +44,26 @@ export const usePageNavigationStore = defineStore('pageNavigation', {
|
|
|
45
44
|
orders: this.orders,
|
|
46
45
|
});
|
|
47
46
|
},
|
|
47
|
+
// Mirrors the renderer's hasVisibleNavigation (route.util.ts) on the maker's nav state:
|
|
48
|
+
// the header shows a nav for >1 visible top-level page, or 1 with a visible subpage.
|
|
49
|
+
hasVisibleNavigation() {
|
|
50
|
+
const isVisible = (order) => {
|
|
51
|
+
const route = this.routes.find((r) => r.id === order.routeId);
|
|
52
|
+
return route !== undefined && !route.isHidden;
|
|
53
|
+
};
|
|
54
|
+
const visibleOrders = this.orders.filter(isVisible);
|
|
55
|
+
return (visibleOrders.length > 1 ||
|
|
56
|
+
(visibleOrders.length === 1 &&
|
|
57
|
+
visibleOrders[0].subRoutes.some(isVisible)));
|
|
58
|
+
},
|
|
48
59
|
},
|
|
49
60
|
actions: {
|
|
50
61
|
getPageSlugsForDepth(parentRouteId) {
|
|
51
62
|
return getPageSlugsForCurrentDepth(this.nav, parentRouteId);
|
|
52
63
|
},
|
|
64
|
+
getDisplayNamesForDepth(parentRouteId) {
|
|
65
|
+
return getRoutesForCurrentDepth(this.nav, parentRouteId).map((route) => route.displayName);
|
|
66
|
+
},
|
|
53
67
|
getParentRouteIdForPage(pageId) {
|
|
54
68
|
const route = this.routes.find((r) => r.pageId === pageId);
|
|
55
69
|
if (!route) {
|
|
@@ -81,16 +95,27 @@ export const usePageNavigationStore = defineStore('pageNavigation', {
|
|
|
81
95
|
this.routes = nav.routes;
|
|
82
96
|
this.orders = nav.orders;
|
|
83
97
|
},
|
|
84
|
-
addNavRoute(newRoute, parentRouteId) {
|
|
98
|
+
addNavRoute(newRoute, parentRouteId, insertAfterRouteId) {
|
|
85
99
|
const newOrder = {
|
|
86
100
|
routeId: newRoute.id,
|
|
87
101
|
subRoutes: [],
|
|
88
102
|
};
|
|
103
|
+
const addToSiblings = (siblings) => {
|
|
104
|
+
const afterIndex = insertAfterRouteId
|
|
105
|
+
? siblings.findIndex((order) => order.routeId === insertAfterRouteId)
|
|
106
|
+
: -1;
|
|
107
|
+
if (afterIndex === -1) {
|
|
108
|
+
siblings.push(newOrder);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
siblings.splice(afterIndex + 1, 0, newOrder);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
89
114
|
if (parentRouteId) {
|
|
90
115
|
// Find where to insert the new route into order
|
|
91
116
|
const parentOrder = findParentOrderByRouteId(this.orders, parentRouteId);
|
|
92
117
|
if (parentOrder) {
|
|
93
|
-
parentOrder.subRoutes
|
|
118
|
+
addToSiblings(parentOrder.subRoutes);
|
|
94
119
|
}
|
|
95
120
|
else {
|
|
96
121
|
console.error(`Parent route with id ${parentRouteId} not found in nav orders.`);
|
|
@@ -98,7 +123,7 @@ export const usePageNavigationStore = defineStore('pageNavigation', {
|
|
|
98
123
|
}
|
|
99
124
|
else {
|
|
100
125
|
// Push to root of orders object as this is not a nested route
|
|
101
|
-
this.orders
|
|
126
|
+
addToSiblings(this.orders);
|
|
102
127
|
}
|
|
103
128
|
this.routes.push(newRoute);
|
|
104
129
|
this.reorderVisibleAndHiddenRoutes();
|
package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
35
35
|
onCancel?: ((...args: any[]) => any) | undefined;
|
|
36
36
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
37
37
|
}>, {
|
|
38
|
+
isVisible: boolean;
|
|
38
39
|
pageId: string;
|
|
39
40
|
pageTitle: string;
|
|
40
|
-
isVisible: boolean;
|
|
41
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
42
42
|
export default _default;
|