@designcrowd/library.brand-page 6.2.2-live-preview-1 → 6.2.3-ast-faq
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-Cn0M-eZ1.js → CreatedOnBrandCrowd-de-de-BRisMzFY.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DRLMSDZr.js → CreatedOnBrandCrowd-en-us-CDDsL9GX.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BglTu73U.js → CreatedOnBrandCrowd-es-es-BkZrEo4j.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-Bj6YZ_el.js → CreatedOnBrandCrowd-fr-ca-sx_ury7R.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-Bj6YZ_el.js → CreatedOnBrandCrowd-fr-fr-sx_ury7R.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DEoOmQ1F.js → CreatedOnBrandCrowd-pt-br-DCWiAfkU.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DEoOmQ1F.js → CreatedOnBrandCrowd-pt-pt-DCWiAfkU.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BZ7gTt4Z.js → CreatedOnDcom-de-de-C1S7f22L.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CD6Km5sH.js → CreatedOnDcom-en-us-DgTlWaXE.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CNpZHvEl.js → CreatedOnDcom-es-es-CxSQJe_V.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-URS-ydJ1.js → CreatedOnDcom-fr-ca-Bbam2tt6.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-D2AVeA3H.js → CreatedOnDcom-fr-fr-Cb0XDRPL.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-C32frnFs.js → CreatedOnDcom-pt-br-BjdX3-E3.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-TDYGjRXS.js → CreatedOnDcom-pt-pt-BXpbfopB.js} +1 -1
- package/lib/src/brand-page/constants/misc.constants.d.ts +8 -0
- package/lib/src/brand-page/constants/misc.constants.js +7 -0
- package/lib/src/brand-page/constants/styles.constants.d.ts +2 -0
- package/lib/src/brand-page/constants/styles.constants.js +2 -0
- package/lib/src/brand-page/models/content.model.d.ts +1 -0
- package/lib/src/brand-page/models/content.model.js +1 -0
- package/lib/src/brand-page/models/index.d.ts +19 -0
- package/lib/src/brand-page/utils/content-callback-util.d.ts +2 -1
- package/lib/src/brand-page/utils/content-callback-util.js +3 -0
- package/lib/src/brand-page/utils/model.util.d.ts +2 -1
- package/lib/src/brand-page/utils/model.util.js +3 -0
- package/lib/src/brand-page/utils/view-model.util.d.ts +2 -0
- package/lib/src/brand-page/utils/view-model.util.js +24 -0
- package/lib/src/brand-page/view-models.d.ts +9 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +10 -0
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +10 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +13 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +64 -30
- package/lib/src/brand-page-maker/constants/config-settings-constant.d.ts +2 -1
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +101 -2
- package/lib/src/brand-page-maker/convertors/faq-display-style.convertor.d.ts +3 -0
- package/lib/src/brand-page-maker/convertors/faq-display-style.convertor.js +47 -0
- package/lib/src/brand-page-maker/models/content-settings-configs.d.ts +22 -1
- package/lib/src/brand-page-maker/models/content-settings-configs.js +1 -0
- package/lib/src/brand-page-maker/models/content-settings.d.ts +4 -1
- package/lib/src/brand-page-maker/models/content-settings.js +45 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +1 -0
- package/lib/src/brand-page-maker/utils/apply-color-strategy.js +47 -17
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +6 -0
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +24 -1
- package/lib/src/brand-page-maker/validators/field.validator.js +2 -0
- package/lib/src/bundled-translations-DY9YvuL-.js +179 -0
- package/lib/src/bundles/bundled-translations.json +20 -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 +143 -36
- package/lib/src/css/library.brand-page-brandPage.min.css +143 -36
- package/lib/src/css/library.brand-page-designCom.min.css +143 -36
- package/lib/src/css/library.brand-page-preview.min.css +143 -36
- package/lib/src/index.mjs +159 -158
- package/lib/src/{lib-Dm9AuOJL.js → lib-DwpSAbLZ.js} +26906 -26180
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +1 -1
- package/lib/src/shared/color-strategies/color-strategies.js +4 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.d.ts +12 -0
- package/lib/src/shared/color-strategies/rte-field-pairs.js +10 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +10 -0
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +11 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +10 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +10 -0
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +10 -0
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.d.ts +14 -1
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.js +11 -1
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +12 -0
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.js +5 -0
- package/lib/src/shared/content-settings/models.d.ts +6 -0
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +14 -1
- package/lib/src/shared/content-settings/store/content-settings-store.js +24 -2
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +10 -0
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +10 -0
- package/package.json +2 -2
- package/src/brand-page/components/faq-section/FaqSection.test.ts +292 -0
- package/src/brand-page/components/faq-section/FaqSection.vue +299 -0
- package/src/brand-page/components/page/PageComponent.vue +2 -0
- package/src/brand-page/components/section-heading/SectionHeading.vue +52 -0
- package/src/brand-page/components/text-wrapper/TextWrapper.test.ts +33 -0
- package/src/brand-page/constants/misc.constants.ts +12 -0
- package/src/brand-page/constants/styles.constants.ts +2 -0
- package/src/brand-page/models/content.model.ts +1 -0
- package/src/brand-page/models/index.ts +21 -0
- package/src/brand-page/utils/content-callback-util.ts +5 -0
- package/src/brand-page/utils/model.util.ts +7 -0
- package/src/brand-page/utils/view-model.util.test.ts +96 -0
- package/src/brand-page/utils/view-model.util.ts +49 -0
- package/src/brand-page/view-models.ts +12 -1
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.test.ts +165 -0
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +37 -49
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +87 -30
- package/src/brand-page-maker/constants/config-settings-constant.ts +108 -0
- package/src/brand-page-maker/constants/faq-section-config.test.ts +151 -0
- package/src/brand-page-maker/convertors/faq-display-style.convertor.ts +59 -0
- package/src/brand-page-maker/convertors/i18n/converter.json +4 -1
- package/src/brand-page-maker/models/content-settings-configs.ts +24 -0
- package/src/brand-page-maker/models/content-settings.ts +57 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +2 -0
- package/src/brand-page-maker/utils/__snapshots__/apply-color-strategy.golden.test.ts.snap +4063 -895
- package/src/brand-page-maker/utils/apply-color-strategy.test.ts +104 -2
- package/src/brand-page-maker/utils/apply-color-strategy.ts +77 -19
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +110 -0
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +66 -0
- package/src/brand-page-maker/validators/field.validator.ts +2 -0
- package/src/bundles/bundled-translations.json +20 -2
- package/src/composables/useTranslate.ts +2 -1
- package/src/metadata-builder/builders/item-id-utils.test.ts +24 -0
- package/src/metadata-builder/parsers/section-tool-arguments.ts +2 -1
- package/src/metadata-builder/parsers/section-tool-map.test.ts +12 -0
- package/src/shared/color-strategies/color-strategies.ts +4 -0
- package/src/shared/color-strategies/rte-field-pairs.ts +23 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +17 -1
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +3 -0
- package/src/shared/content-settings/components/items-field/ItemsField.mixin.ts +11 -1
- package/src/shared/content-settings/components/items-field/ItemsField.vue +8 -2
- package/src/shared/content-settings/components/list-items-field/ListItemsField.test.ts +429 -0
- package/src/shared/content-settings/components/list-items-field/ListItemsField.vue +262 -0
- package/src/shared/content-settings/components/textarea-field/TextareaField.mixin.ts +6 -0
- package/src/shared/content-settings/components/textarea-field/TextareaField.vue +1 -0
- package/src/shared/content-settings/models.ts +7 -0
- package/src/shared/content-settings/store/content-settings-store.test.ts +70 -0
- package/src/shared/content-settings/store/content-settings-store.ts +37 -3
- package/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.test.ts +19 -0
- package/src/utils/minify-brand-page-metadata.test.ts +35 -0
- package/lib/src/bundled-translations-BYUfWBT3.js +0 -179
|
@@ -77,6 +77,14 @@ export declare const IMAGE_RESOLUTION_PRESETS: {
|
|
|
77
77
|
readonly ULTRA_HD: "q=80&w=2160";
|
|
78
78
|
};
|
|
79
79
|
export type ImagesSectionContentDisplayStyle = (typeof IMAGES_SECTION_CONTENT_DISPLAY_STYLES)[number];
|
|
80
|
+
/** Centered and split are accordions; grid shows every answer. */
|
|
81
|
+
export declare const FAQ_DISPLAY_STYLES: Readonly<{
|
|
82
|
+
readonly centered: "faq-centered";
|
|
83
|
+
readonly split: "faq-split";
|
|
84
|
+
readonly grid: "faq-grid";
|
|
85
|
+
}>;
|
|
86
|
+
export type FaqDisplayStyle = (typeof FAQ_DISPLAY_STYLES)[keyof typeof FAQ_DISPLAY_STYLES];
|
|
87
|
+
export declare const FAQ_MAX_ITEMS = 6;
|
|
80
88
|
export declare const HEADER_CSRF_TOKEN = "csrf-token";
|
|
81
89
|
export declare const STYLE_THEME_KEYS: Readonly<{
|
|
82
90
|
LogoTextColor: "logo-text-color";
|
|
@@ -103,6 +103,13 @@ export const IMAGE_RESOLUTION_PRESETS = {
|
|
|
103
103
|
FULL_HD: 'q=80&w=1080',
|
|
104
104
|
ULTRA_HD: 'q=80&w=2160',
|
|
105
105
|
};
|
|
106
|
+
/** Centered and split are accordions; grid shows every answer. */
|
|
107
|
+
export const FAQ_DISPLAY_STYLES = Object.freeze({
|
|
108
|
+
centered: 'faq-centered',
|
|
109
|
+
split: 'faq-split',
|
|
110
|
+
grid: 'faq-grid',
|
|
111
|
+
});
|
|
112
|
+
export const FAQ_MAX_ITEMS = 6;
|
|
106
113
|
export const HEADER_CSRF_TOKEN = 'csrf-token';
|
|
107
114
|
export const STYLE_THEME_KEYS = Object.freeze({
|
|
108
115
|
LogoTextColor: 'logo-text-color',
|
|
@@ -33,5 +33,7 @@ export declare const CONTENT_TEXT_STYLE_PROPERTY_KEYS: {
|
|
|
33
33
|
readonly buttonTextStyle: "buttonTextStyle";
|
|
34
34
|
readonly copyrightStyle: "copyrightStyle";
|
|
35
35
|
readonly successMessageStyle: "successMessageStyle";
|
|
36
|
+
readonly questionStyle: "questionStyle";
|
|
37
|
+
readonly answerStyle: "answerStyle";
|
|
36
38
|
};
|
|
37
39
|
export type ContentTextStylePropertyKey = keyof typeof CONTENT_TEXT_STYLE_PROPERTY_KEYS;
|
|
@@ -31,6 +31,7 @@ export declare const CONTENT_TYPES: {
|
|
|
31
31
|
readonly 'shapes-section': "shapes-section";
|
|
32
32
|
readonly 'shop-section': "shop-section";
|
|
33
33
|
readonly 'booking-section': "booking-section";
|
|
34
|
+
readonly 'faq-section': "faq-section";
|
|
34
35
|
};
|
|
35
36
|
export type ContentType = keyof typeof CONTENT_TYPES;
|
|
36
37
|
export declare const PERSONALISATION_ROLES: {
|
|
@@ -478,6 +478,25 @@ export interface BookingSectionContent extends Content {
|
|
|
478
478
|
buttonLinkType: ButtonLinkType;
|
|
479
479
|
buttonTextStyle: TextStyleDeclaration;
|
|
480
480
|
}
|
|
481
|
+
export interface FaqItem {
|
|
482
|
+
/** Stable per-item identifier. See ImageItem.id. */
|
|
483
|
+
id: string;
|
|
484
|
+
question: RichTextValue;
|
|
485
|
+
/** Drives `question`, per item — like a section's `titleStyle` drives its title. */
|
|
486
|
+
questionStyle: TextStyleDeclaration;
|
|
487
|
+
answer: RichTextValue;
|
|
488
|
+
answerStyle: TextStyleDeclaration;
|
|
489
|
+
}
|
|
490
|
+
export interface FaqSectionContent extends Content {
|
|
491
|
+
type: 'faq-section';
|
|
492
|
+
title: RichTextValue;
|
|
493
|
+
description: RichTextValue;
|
|
494
|
+
displayStyle: string;
|
|
495
|
+
items: FaqItem[];
|
|
496
|
+
titleStyle: TextStyleDeclaration;
|
|
497
|
+
descriptionStyle: TextStyleDeclaration;
|
|
498
|
+
backgroundStyle: BrandPageCssStyle;
|
|
499
|
+
}
|
|
481
500
|
export declare class PageModel {
|
|
482
501
|
title: string;
|
|
483
502
|
contents: Content[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProfileContent, TextContent, ContactFormContent, ImageContent, BannerSectionContent, SocialLinksContent, ImageGalleryContent, TestimonialSectionContent, AboutSectionContent, ImagesSectionContent, MailingListContent, SupportMeContent, RequestPaymentContent, ShapesSectionContent, ShopContent, ButtonContent, PageModel, BookingSectionContent } from '../models';
|
|
1
|
+
import type { ProfileContent, TextContent, ContactFormContent, ImageContent, BannerSectionContent, SocialLinksContent, ImageGalleryContent, TestimonialSectionContent, AboutSectionContent, ImagesSectionContent, MailingListContent, SupportMeContent, RequestPaymentContent, ShapesSectionContent, ShopContent, ButtonContent, PageModel, BookingSectionContent, FaqSectionContent } from '../models';
|
|
2
2
|
export type ContentCallback = {
|
|
3
3
|
profileContentCallback: (content: ProfileContent) => void;
|
|
4
4
|
textContentCallback: (content: TextContent) => void;
|
|
@@ -17,5 +17,6 @@ export type ContentCallback = {
|
|
|
17
17
|
shopSectionContentCallback: (content: ShopContent) => void;
|
|
18
18
|
buttonContentCallback: (content: ButtonContent) => void;
|
|
19
19
|
bookingSectionContentCallback: (content: BookingSectionContent) => void;
|
|
20
|
+
faqSectionContentCallback: (content: FaqSectionContent) => void;
|
|
20
21
|
};
|
|
21
22
|
export declare const forEachPageCallContentCallback: (page: PageModel, callbacks: ContentCallback) => void;
|
|
@@ -49,6 +49,9 @@ export const forEachPageCallContentCallback = (page, callbacks) => {
|
|
|
49
49
|
case 'booking-section':
|
|
50
50
|
callbacks.bookingSectionContentCallback(content);
|
|
51
51
|
break;
|
|
52
|
+
case 'faq-section':
|
|
53
|
+
callbacks.faqSectionContentCallback(content);
|
|
54
|
+
break;
|
|
52
55
|
case 'general-link':
|
|
53
56
|
case 'website':
|
|
54
57
|
case 'email':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Content, type AboutSectionContent, type BannerSectionContent, type BrandPageModel, type ButtonWithModalContent, type ImagesSectionContent, type LogoContent, type MailingListContent, type ProfileContent, type ShapesSectionContent, type SocialLinksContent, type SupportMeContent, type TestimonialSectionContent, type TextContent, type RequestPaymentContent, type ContactFormContent, type LogoImageModel, type ShopContent, type ImageContent, type ImageGalleryContent, type BookingSectionContent } from '../models';
|
|
1
|
+
import { type Content, type AboutSectionContent, type BannerSectionContent, type BrandPageModel, type ButtonWithModalContent, type ImagesSectionContent, type LogoContent, type MailingListContent, type ProfileContent, type ShapesSectionContent, type SocialLinksContent, type SupportMeContent, type TestimonialSectionContent, type TextContent, type RequestPaymentContent, type ContactFormContent, type LogoImageModel, type ShopContent, type ImageContent, type ImageGalleryContent, type BookingSectionContent, type FaqSectionContent } from '../models';
|
|
2
2
|
export declare const isLogoContent: (content?: Content) => content is LogoContent;
|
|
3
3
|
export declare const applyLogoImageToBrandPageModelLogoContents: (model: BrandPageModel, logoImage: LogoImageModel) => BrandPageModel;
|
|
4
4
|
export declare const isTextContent: (content?: Content) => content is TextContent;
|
|
@@ -8,6 +8,7 @@ export declare const isSupportMeContent: (content?: Content) => content is Suppo
|
|
|
8
8
|
export declare const isButtonContent: (content?: Content) => content is ButtonWithModalContent;
|
|
9
9
|
export declare const isBannerContent: (content?: Content) => content is BannerSectionContent;
|
|
10
10
|
export declare const isBookingContent: (content?: Content) => content is BookingSectionContent;
|
|
11
|
+
export declare const isFaqContent: (content?: Content) => content is FaqSectionContent;
|
|
11
12
|
export declare const isAboutContent: (content?: Content) => content is AboutSectionContent;
|
|
12
13
|
export declare const isTestimonialContent: (content?: Content) => content is TestimonialSectionContent;
|
|
13
14
|
export declare const isShapesContent: (content?: Content) => content is ShapesSectionContent;
|
|
@@ -43,6 +43,9 @@ export const isBannerContent = (content) => {
|
|
|
43
43
|
export const isBookingContent = (content) => {
|
|
44
44
|
return content?.type === 'booking-section';
|
|
45
45
|
};
|
|
46
|
+
export const isFaqContent = (content) => {
|
|
47
|
+
return content?.type === 'faq-section';
|
|
48
|
+
};
|
|
46
49
|
export const isAboutContent = (content) => {
|
|
47
50
|
return content?.type === 'about-section';
|
|
48
51
|
};
|
|
@@ -29,6 +29,8 @@ interface ViewModelMappingOptions {
|
|
|
29
29
|
previewImageUrl: string;
|
|
30
30
|
};
|
|
31
31
|
setVideoUrlsWithToken?: (token: string, videoUrl: string, previewImageUrl: string, assetId: string) => void;
|
|
32
|
+
/** Maker-only UI state: content id → the item its settings panel has open. Never persisted. */
|
|
33
|
+
activeItemIdByContentId?: Record<string, string | undefined>;
|
|
32
34
|
}
|
|
33
35
|
export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo: boolean | undefined, options: ViewModelMappingOptions) => BrandPageViewModel;
|
|
34
36
|
export declare const resolvePageIdsInRteJson: (doc: unknown, nav: NavViewModel, options: ViewModelMappingOptions) => unknown;
|
|
@@ -611,6 +611,28 @@ const mapToTestimonialSectionViewModel = (content, styles) => {
|
|
|
611
611
|
isFullWidth: true,
|
|
612
612
|
}, styles);
|
|
613
613
|
};
|
|
614
|
+
// An item's question/answer styles are CONTENT_TEXT_STYLE_PROPERTY_KEYS, so the section
|
|
615
|
+
// resolver handles them when handed the item.
|
|
616
|
+
const mapFaqItem = (item, styles) => applyViewModelTextStyles({
|
|
617
|
+
...item,
|
|
618
|
+
questionStyle: { ...item.questionStyle },
|
|
619
|
+
answerStyle: { ...item.answerStyle },
|
|
620
|
+
}, styles);
|
|
621
|
+
const mapToFaqSectionViewModel = (content, styles, brandPageType, options) => {
|
|
622
|
+
return applyViewModelTextStyles({
|
|
623
|
+
...content,
|
|
624
|
+
role: content.type,
|
|
625
|
+
type: 'faq-section',
|
|
626
|
+
// No `color` pre-seed — these styles are CONTENT_TEXT_STYLE_PROPERTY_KEYS
|
|
627
|
+
// (see the testimonial mapper), resolved per item for the item styles.
|
|
628
|
+
titleStyle: { ...content.titleStyle },
|
|
629
|
+
descriptionStyle: { ...content.descriptionStyle },
|
|
630
|
+
items: (content.items ?? []).map((item) => mapFaqItem(item, styles)),
|
|
631
|
+
isFullWidth: true,
|
|
632
|
+
isStacked: brandPageType !== BRAND_PAGE_TYPES.brandSite,
|
|
633
|
+
activeItemId: options.activeItemIdByContentId?.[content.id],
|
|
634
|
+
}, styles);
|
|
635
|
+
};
|
|
614
636
|
const mapToSocialLinksViewModel = (content, styles, brandPageType) => {
|
|
615
637
|
return applyViewModelTextStyles({
|
|
616
638
|
...content,
|
|
@@ -872,6 +894,8 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
|
|
|
872
894
|
return mapToBannerSectionViewModel(content, styles, options);
|
|
873
895
|
case 'booking-section':
|
|
874
896
|
return mapToBookingSectionViewModel(content, styles);
|
|
897
|
+
case 'faq-section':
|
|
898
|
+
return mapToFaqSectionViewModel(content, styles, brandPageType, options);
|
|
875
899
|
case 'about-section':
|
|
876
900
|
return mapToAboutSectionViewModel(content, styles);
|
|
877
901
|
case 'images-section':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ButtonWithModalContent, ProfileContent, TextContent, VideoContent, ImageContent, ContentType, ButtonStyles, LogoStyles, MapContent, ImageGalleryContent, GalleryStyles, MailingListContent, RequestPaymentContent, ShopContent, SupportMeContent, ContactFormContent, BannerSectionContent, BrandPageType, SocialLinksContent, TestimonialSectionContent, AboutSectionContent, DividerSectionContent, ShapesSectionContent, ButtonLinkType, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, TextMediaItem, TextShapeItem, TextStyleDeclaration, AspectRatio, LogoImageModel, LogoTemplateImageModel, CookieOptions, BookingSectionContent, MediaTypes, TextStyles, BackgroundStyle, BackgroundShape, PersonalisationRole, SaveContactOptions, ColorItem, RichTextValue } from './models';
|
|
1
|
+
import type { ButtonWithModalContent, ProfileContent, TextContent, VideoContent, ImageContent, ContentType, ButtonStyles, LogoStyles, MapContent, ImageGalleryContent, GalleryStyles, MailingListContent, RequestPaymentContent, ShopContent, SupportMeContent, ContactFormContent, BannerSectionContent, BrandPageType, SocialLinksContent, TestimonialSectionContent, AboutSectionContent, DividerSectionContent, ShapesSectionContent, ButtonLinkType, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, TextMediaItem, TextShapeItem, TextStyleDeclaration, AspectRatio, LogoImageModel, LogoTemplateImageModel, CookieOptions, BookingSectionContent, FaqSectionContent, MediaTypes, TextStyles, BackgroundStyle, BackgroundShape, PersonalisationRole, SaveContactOptions, ColorItem, RichTextValue } from './models';
|
|
2
2
|
import type { ImagesSectionContentDisplayStyle } from './constants';
|
|
3
|
-
export type ViewModelType = 'button' | 'image' | 'image-gallery' | 'logo' | 'map' | 'mailing-list' | 'profile' | 'support-me' | 'request-payment' | 'text' | 'video' | 'contact-form' | 'banner-section' | 'images-section' | 'about-section' | 'divider-section' | 'testimonial-section' | 'social-links' | 'shapes-section' | 'shop-section' | 'booking-section';
|
|
3
|
+
export type ViewModelType = 'button' | 'image' | 'image-gallery' | 'logo' | 'map' | 'mailing-list' | 'profile' | 'support-me' | 'request-payment' | 'text' | 'video' | 'contact-form' | 'banner-section' | 'images-section' | 'about-section' | 'divider-section' | 'testimonial-section' | 'social-links' | 'shapes-section' | 'shop-section' | 'booking-section' | 'faq-section';
|
|
4
4
|
export interface ContentViewModel {
|
|
5
5
|
id: string;
|
|
6
6
|
type: ViewModelType;
|
|
@@ -132,6 +132,13 @@ export interface BookingSectionViewModel extends ContentViewModel, Omit<BookingS
|
|
|
132
132
|
buttonViewModel: ButtonViewModel;
|
|
133
133
|
isFullWidth: boolean;
|
|
134
134
|
}
|
|
135
|
+
export interface FaqSectionViewModel extends ContentViewModel, Omit<FaqSectionContent, 'type'> {
|
|
136
|
+
isFullWidth: boolean;
|
|
137
|
+
/** brand.page / brand.contact: split and grid always use their stacked layout. */
|
|
138
|
+
isStacked: boolean;
|
|
139
|
+
/** Maker-only: the item the settings panel has open, so the canvas shows it. */
|
|
140
|
+
activeItemId?: string;
|
|
141
|
+
}
|
|
135
142
|
export interface PageHeaderViewModel extends Omit<PageHeaderDesktop | PageHeaderMobile, 'logoImage' | 'logoImageStyle' | 'isLogoOptional' | 'viewport' | 'isLogoVisible' | 'logoTemplateImage' | 'logoImageHeight' | 'logoImageWidth' | 'headerButton' | 'backgroundStyle'> {
|
|
136
143
|
logo: LogoViewModel;
|
|
137
144
|
pages: PageViewModel[];
|
|
@@ -606,6 +606,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
606
606
|
selectedItemValue: string | null;
|
|
607
607
|
selectedItemIndex: number | null;
|
|
608
608
|
activeCategoryTab: import("@brand-page-maker/models").ItemCategory;
|
|
609
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
609
610
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string) => import("@brand-page").Content | undefined;
|
|
610
611
|
getFieldSettings(state: {
|
|
611
612
|
addContentOptions: {
|
|
@@ -657,6 +658,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
657
658
|
selectedItemValue: string | null;
|
|
658
659
|
selectedItemIndex: number | null;
|
|
659
660
|
activeCategoryTab: import("@brand-page-maker/models").ItemCategory;
|
|
661
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
660
662
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, fieldName: string) => import("../../../shared/content-settings/models").ContentItemFieldSettings | undefined;
|
|
661
663
|
getItem(state: {
|
|
662
664
|
addContentOptions: {
|
|
@@ -708,6 +710,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
708
710
|
selectedItemValue: string | null;
|
|
709
711
|
selectedItemIndex: number | null;
|
|
710
712
|
activeCategoryTab: import("@brand-page-maker/models").ItemCategory;
|
|
713
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
711
714
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string) => import("../../../shared/content-settings/models").ContentItem<any> | undefined;
|
|
712
715
|
getValue(state: {
|
|
713
716
|
addContentOptions: {
|
|
@@ -759,6 +762,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
759
762
|
selectedItemValue: string | null;
|
|
760
763
|
selectedItemIndex: number | null;
|
|
761
764
|
activeCategoryTab: import("@brand-page-maker/models").ItemCategory;
|
|
765
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
762
766
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, fieldName: string) => import("@brand-page").Content | string | undefined;
|
|
763
767
|
getItemState(state: {
|
|
764
768
|
addContentOptions: {
|
|
@@ -810,6 +814,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
810
814
|
selectedItemValue: string | null;
|
|
811
815
|
selectedItemIndex: number | null;
|
|
812
816
|
activeCategoryTab: import("@brand-page-maker/models").ItemCategory;
|
|
817
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
813
818
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string) => import("../../../shared/content-settings/models").ContentSettingsItemState;
|
|
814
819
|
getItemGroupState(state: {
|
|
815
820
|
addContentOptions: {
|
|
@@ -861,11 +866,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
861
866
|
selectedItemValue: string | null;
|
|
862
867
|
selectedItemIndex: number | null;
|
|
863
868
|
activeCategoryTab: import("@brand-page-maker/models").ItemCategory;
|
|
869
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
864
870
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, groupId: string) => import("../../../shared/content-settings/models").ContentSettingsItemGroupState;
|
|
865
871
|
mode(): import("@shared/content-settings/store").ContentSettingsMode;
|
|
866
872
|
selectedItem(): import("../../../shared/content-settings/models").ContentItem<any> | undefined;
|
|
867
873
|
selectedItemTemplate(): import("@brand-page-maker/models").ContentSettingsConfig<any> | undefined;
|
|
868
874
|
}, {
|
|
875
|
+
setActiveItem(contentId: string, itemId: string | undefined): void;
|
|
869
876
|
onContentChanged(): void;
|
|
870
877
|
_addItem({ item, index, }: {
|
|
871
878
|
item: import("../../../shared/content-settings/models").ContentItem<any>;
|
|
@@ -929,6 +936,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
929
936
|
}): void;
|
|
930
937
|
updateTextItemTextStyleType({ id, name, value, index, isHydrationWrite, }: import("../../../shared/content-settings/models").UpdateMultipleItemValuesPayload<any>): void;
|
|
931
938
|
updateTextItemTextStyleTypeWithStyles({ id, name, value, index, isHydrationWrite, }: import("../../../shared/content-settings/models").UpdateMultipleItemValuesPayload<any>): void;
|
|
939
|
+
updateListItemTextStyles({ id, name, value, target, isHydrationWrite, }: Omit<import("../../../shared/content-settings/models").UpdateMultipleItemValuesPayload<any>, "index"> & {
|
|
940
|
+
target: import("../../../shared/content-settings/models").RteItemStyleTarget;
|
|
941
|
+
}): void;
|
|
932
942
|
_setActiveCategoryTab({ activeCategoryTab, }: {
|
|
933
943
|
activeCategoryTab: import("@brand-page-maker/models").ItemCategory;
|
|
934
944
|
}): void;
|
package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
90
90
|
selectedItemValue: string | null;
|
|
91
91
|
selectedItemIndex: number | null;
|
|
92
92
|
activeCategoryTab: import("../../models").ItemCategory;
|
|
93
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
93
94
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string) => Content | undefined;
|
|
94
95
|
getFieldSettings(state: {
|
|
95
96
|
addContentOptions: {
|
|
@@ -141,6 +142,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
141
142
|
selectedItemValue: string | null;
|
|
142
143
|
selectedItemIndex: number | null;
|
|
143
144
|
activeCategoryTab: import("../../models").ItemCategory;
|
|
145
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
144
146
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, fieldName: string) => import("@shared/content-settings/models").ContentItemFieldSettings | undefined;
|
|
145
147
|
getItem(state: {
|
|
146
148
|
addContentOptions: {
|
|
@@ -192,6 +194,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
192
194
|
selectedItemValue: string | null;
|
|
193
195
|
selectedItemIndex: number | null;
|
|
194
196
|
activeCategoryTab: import("../../models").ItemCategory;
|
|
197
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
195
198
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string) => ContentItem<any> | undefined;
|
|
196
199
|
getValue(state: {
|
|
197
200
|
addContentOptions: {
|
|
@@ -243,6 +246,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
243
246
|
selectedItemValue: string | null;
|
|
244
247
|
selectedItemIndex: number | null;
|
|
245
248
|
activeCategoryTab: import("../../models").ItemCategory;
|
|
249
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
246
250
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, fieldName: string) => Content | string | undefined;
|
|
247
251
|
getItemState(state: {
|
|
248
252
|
addContentOptions: {
|
|
@@ -294,6 +298,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
294
298
|
selectedItemValue: string | null;
|
|
295
299
|
selectedItemIndex: number | null;
|
|
296
300
|
activeCategoryTab: import("../../models").ItemCategory;
|
|
301
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
297
302
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string) => import("@shared/content-settings/models").ContentSettingsItemState;
|
|
298
303
|
getItemGroupState(state: {
|
|
299
304
|
addContentOptions: {
|
|
@@ -345,11 +350,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
345
350
|
selectedItemValue: string | null;
|
|
346
351
|
selectedItemIndex: number | null;
|
|
347
352
|
activeCategoryTab: import("../../models").ItemCategory;
|
|
353
|
+
activeItemIdByContentId: Record<string, string | undefined>;
|
|
348
354
|
} & import("pinia").PiniaCustomStateProperties<import("@shared/content-settings/store").ContentSettingsState>): (id: string, groupId: string) => import("@shared/content-settings/models").ContentSettingsItemGroupState;
|
|
349
355
|
mode(): import("@shared/content-settings/store").ContentSettingsMode;
|
|
350
356
|
selectedItem(): ContentItem<any> | undefined;
|
|
351
357
|
selectedItemTemplate(): import("../../models").ContentSettingsConfig<any> | undefined;
|
|
352
358
|
}, {
|
|
359
|
+
setActiveItem(contentId: string, itemId: string | undefined): void;
|
|
353
360
|
onContentChanged(): void;
|
|
354
361
|
_addItem({ item, index, }: {
|
|
355
362
|
item: ContentItem<any>;
|
|
@@ -413,6 +420,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
413
420
|
}): void;
|
|
414
421
|
updateTextItemTextStyleType({ id, name, value, index, isHydrationWrite, }: import("@shared/content-settings/models").UpdateMultipleItemValuesPayload<any>): void;
|
|
415
422
|
updateTextItemTextStyleTypeWithStyles({ id, name, value, index, isHydrationWrite, }: import("@shared/content-settings/models").UpdateMultipleItemValuesPayload<any>): void;
|
|
423
|
+
updateListItemTextStyles({ id, name, value, target, isHydrationWrite, }: Omit<import("@shared/content-settings/models").UpdateMultipleItemValuesPayload<any>, "index"> & {
|
|
424
|
+
target: import("@shared/content-settings/models").RteItemStyleTarget;
|
|
425
|
+
}): void;
|
|
416
426
|
_setActiveCategoryTab({ activeCategoryTab, }: {
|
|
417
427
|
activeCategoryTab: import("../../models").ItemCategory;
|
|
418
428
|
}): void;
|
|
@@ -4,6 +4,8 @@ import type { StyleTextFontFamilyOption } from '@shared/style-settings/models';
|
|
|
4
4
|
import type { HyperlinkType, TextStyleOption } from '@brand-page';
|
|
5
5
|
import { type TextItem, type TextStyleDeclaration } from '@brand-page';
|
|
6
6
|
import type { ButtonGroupOption } from '@brand-page-maker/models/button-group.model';
|
|
7
|
+
import { useUiContentSettingsStore } from '@shared/content-settings/store';
|
|
8
|
+
import type { RteItemStyleTarget } from '@shared/content-settings/models';
|
|
7
9
|
interface UseRichTextEditorReturn {
|
|
8
10
|
editor: Editor;
|
|
9
11
|
onFocus: () => void;
|
|
@@ -55,6 +57,16 @@ interface EditorOptionType {
|
|
|
55
57
|
export declare const useExternalRichTextEditor: () => {
|
|
56
58
|
externalEditor: Editor;
|
|
57
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* An editor bound to a list item (`itemStyleTarget`) writes its toolbar styles to that
|
|
62
|
+
* item's own style field instead of the section-level `${name}Style`. Returns false when
|
|
63
|
+
* the editor has no item target, so the caller falls through to its section-level write.
|
|
64
|
+
*/
|
|
65
|
+
export declare const writeListItemStyles: (store: ReturnType<typeof useUiContentSettingsStore>, props: {
|
|
66
|
+
rawId: string;
|
|
67
|
+
name: string;
|
|
68
|
+
itemStyleTarget?: RteItemStyleTarget;
|
|
69
|
+
}, value: TextStyleDeclaration, isHydrationWrite?: boolean) => boolean;
|
|
58
70
|
export declare const useRichTextEditor: (model: ModelRef<any>, props: {
|
|
59
71
|
id: string;
|
|
60
72
|
name: string;
|
|
@@ -66,6 +78,7 @@ export declare const useRichTextEditor: (model: ModelRef<any>, props: {
|
|
|
66
78
|
textItemIndex: number;
|
|
67
79
|
item: TextItem;
|
|
68
80
|
contentType: string;
|
|
81
|
+
itemStyleTarget?: RteItemStyleTarget;
|
|
69
82
|
}, emit: (event: "focus" | "blur" | "update:modelValue", ...args: any[]) => void, fontSettings: {
|
|
70
83
|
selectedTextStyle: string;
|
|
71
84
|
selectedFont: string;
|