@designcrowd/library.brand-page 6.1.1-json-prereq-3 → 6.1.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-hj_ievMc.js → CreatedOnBrandCrowd-de-de-B5B5ThJ6.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-jAOSpfCw.js → CreatedOnBrandCrowd-en-us-a48CaORy.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DZMVc-y3.js → CreatedOnBrandCrowd-es-es-xpuZ317-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DvB54H38.js → CreatedOnBrandCrowd-fr-ca-V-iUMArW.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DvB54H38.js → CreatedOnBrandCrowd-fr-fr-V-iUMArW.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-bf-x1xhi.js → CreatedOnBrandCrowd-pt-br-DZ0NKSAy.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-bf-x1xhi.js → CreatedOnBrandCrowd-pt-pt-DZ0NKSAy.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-B-NY1B44.js → CreatedOnDcom-de-de-_950cgGp.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Cd4C6KQf.js → CreatedOnDcom-en-us-DogKzH-g.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DONlsQsm.js → CreatedOnDcom-es-es-CmGM3IPX.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Dsv3FRpZ.js → CreatedOnDcom-fr-ca-BonEDkWZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DOgyvY5C.js → CreatedOnDcom-fr-fr-DQHtKrd_.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DX66MhJS.js → CreatedOnDcom-pt-br-CtYJSBjs.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-COe2G0bU.js → CreatedOnDcom-pt-pt-DoO9r4lA.js} +1 -1
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +7 -8
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +6 -4
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.d.ts +1 -0
- package/lib/src/brand-page/components/page-footer/PageFooter.mixin.js +4 -1
- package/lib/src/brand-page/components/payment/Payment.mixin.js +4 -3
- package/lib/src/brand-page/components/payment/__fixtures__/request-payment.d.ts +1 -0
- package/lib/src/brand-page/components/payment/__fixtures__/support-me.d.ts +1 -0
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.d.ts +1 -0
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.js +4 -1
- package/lib/src/brand-page/composables/consent.composable.d.ts +2 -0
- package/lib/src/brand-page/composables/consent.composable.js +9 -3
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +7 -0
- package/lib/src/brand-page/models/index.d.ts +26 -34
- package/lib/src/brand-page/utils/context.util.d.ts +8 -0
- package/lib/src/brand-page/utils/context.util.js +8 -0
- package/lib/src/brand-page/utils/migration.util.js +0 -11
- package/lib/src/brand-page/utils/text.util.d.ts +1 -13
- package/lib/src/brand-page/utils/text.util.js +0 -64
- package/lib/src/brand-page/utils/vcard.util.js +4 -4
- package/lib/src/brand-page/utils/view-model.util.d.ts +0 -1
- package/lib/src/brand-page/utils/view-model.util.js +20 -68
- package/lib/src/brand-page/view-models.d.ts +3 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +51 -18
- package/lib/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/bubbleMenu.d.ts +9 -2
- package/lib/src/brand-page-maker/composables/rich-text-editor/bubbleMenu.js +10 -6
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/FontSize.d.ts +20 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/FontSize.js +44 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/LineHeight.d.ts +27 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/LineHeight.js +44 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +103 -24
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +8 -0
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +9 -3
- package/lib/src/brand-page-maker/stores/ui/ui-store.d.ts +1 -1
- package/lib/src/brand-page-maker/utils/index.d.ts +0 -2
- package/lib/src/brand-page-maker/utils/index.js +0 -2
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +5 -28
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +5 -48
- package/lib/src/brand-page-maker/validators/field.validator.js +2 -10
- package/lib/src/clients/models.d.ts +2 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +99 -102
- package/lib/src/css/library.brand-page-brandPage.min.css +99 -102
- package/lib/src/css/library.brand-page-designCom.min.css +99 -102
- package/lib/src/css/library.brand-page-preview.min.css +99 -102
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.mjs +219 -221
- package/lib/src/{lib-scDtk-Pi.js → lib-DtalJKI3.js} +72445 -75920
- package/lib/src/lib.js +1 -2
- package/lib/src/metadata-builder/ai-metadata-executor.d.ts +1 -0
- package/lib/src/metadata-builder/ai-metadata-executor.js +19 -0
- package/lib/src/metadata-builder/builders/section-builders/about-section-builder.js +3 -2
- package/lib/src/metadata-builder/builders/section-builders/banner-section-builder.js +3 -2
- package/lib/src/metadata-builder/builders/section-builders/booking-section-builder.js +3 -2
- package/lib/src/metadata-builder/builders/section-builders/contact-form-builder.js +4 -3
- package/lib/src/metadata-builder/builders/section-builders/images-section-builder.js +3 -2
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-builder.js +2 -1
- package/lib/src/metadata-builder/builders/section-builders/mailing-list-section-builder.js +2 -1
- package/lib/src/metadata-builder/builders/section-builders/profile-section-builder.js +4 -3
- package/lib/src/metadata-builder/builders/section-builders/shapes-section-builder.js +3 -2
- package/lib/src/metadata-builder/builders/section-builders/testimonial-section-builder.js +2 -1
- package/lib/src/metadata-builder/builders/section-builders/text-section-builder.js +11 -15
- package/lib/src/metadata-builder/builders/update-content-text-builder.d.ts +17 -0
- package/lib/src/metadata-builder/builders/update-content-text-builder.js +103 -0
- package/lib/src/metadata-builder/builders/update-content-text-style-builder.d.ts +16 -0
- package/lib/src/metadata-builder/builders/update-content-text-style-builder.js +216 -0
- package/lib/src/metadata-builder/helpers/rte.helpers.d.ts +13 -11
- package/lib/src/metadata-builder/helpers/rte.helpers.js +73 -14
- package/lib/src/metadata-builder/metadata-executor.js +4 -0
- package/lib/src/metadata-builder/models.d.ts +2 -0
- package/lib/src/metadata-builder/models.js +2 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +19 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.js +4 -0
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.d.ts +8 -7
- package/lib/src/metadata-builder/sanitizers/rte-schema-check.js +52 -21
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.js +10 -35
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +3 -12
- package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.mixin.d.ts +2 -3
- package/lib/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.mixin.js +3 -10
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.d.ts +1 -2
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +1 -4
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/logo-versions/LogoVersions.mixin.d.ts +1 -1
- package/lib/src/shared/my-designs/MyDesigns.mixin.d.ts +1 -1
- package/lib/src/shared/my-uploads/MyMedia.mixin.d.ts +1 -1
- package/lib/src/shared/my-uploads/MyUploads.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -1
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -1
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +1 -1
- package/lib/src/shared/template-settings/store/template-settings-store.d.ts +2 -0
- package/lib/src/shared/template-settings/store/template-settings-store.js +72 -24
- package/lib/src/shared/unsplash-library/UnsplashLibrary.mixin.d.ts +1 -1
- package/lib/src/utils/minify-brand-page-metadata.js +1 -4
- package/package.json +15 -17
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +9 -7
- package/src/brand-page/components/cookie-consent/CookieConsent.vue +1 -0
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +8 -3
- package/src/brand-page/components/navigation/navigation-carousel/NavigationCarousel.vue +5 -1
- package/src/brand-page/components/page-footer/PageFooter.mixin.ts +4 -1
- package/src/brand-page/components/page-footer/PageFooter.vue +1 -1
- package/src/brand-page/components/payment/Payment.mixin.ts +4 -3
- package/src/brand-page/components/payment/request-payment/RequestPayment.mixin.ts +8 -1
- package/src/brand-page/components/payment/request-payment/RequestPayment.vue +1 -1
- package/src/brand-page/components/save-contact/SaveContactWidget.vue +2 -1
- package/src/brand-page/components/shop/Shop.vue +6 -3
- package/src/brand-page/components/social-links/SocialLinks.vue +5 -2
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +6 -17
- package/src/brand-page/composables/consent.composable.ts +18 -4
- package/src/brand-page/models/brand-page-context.model.ts +7 -0
- package/src/brand-page/models/index.ts +26 -35
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
- package/src/brand-page/utils/context.util.test.ts +43 -0
- package/src/brand-page/utils/context.util.ts +10 -0
- package/src/brand-page/utils/migration.util.ts +0 -12
- package/src/brand-page/utils/style.util.test.ts +0 -51
- package/src/brand-page/utils/text.util.ts +4 -83
- package/src/brand-page/utils/vcard.util.ts +4 -6
- package/src/brand-page/utils/view-model.util.ts +26 -94
- package/src/brand-page/view-models.ts +2 -3
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +4 -5
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.test.ts +135 -0
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +62 -21
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +1 -0
- package/src/brand-page-maker/composables/rich-text-editor/bubbleMenu.ts +10 -6
- package/src/brand-page-maker/composables/rich-text-editor/extensions/FontSize.ts +73 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/LineHeight.ts +85 -0
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +111 -27
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +9 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +11 -3
- package/src/brand-page-maker/stores/ui/ui-store.ts +1 -1
- package/src/brand-page-maker/utils/index.ts +0 -2
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +3 -37
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +11 -66
- package/src/brand-page-maker/validators/field.validator.ts +2 -10
- package/src/clients/models.ts +3 -0
- package/src/lib.ts +1 -9
- package/src/metadata-builder/ai-metadata-executor.ts +26 -0
- package/src/metadata-builder/builders/section-builders/about-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/banner-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/booking-section-builder.ts +5 -2
- package/src/metadata-builder/builders/section-builders/contact-form-builder.ts +4 -3
- package/src/metadata-builder/builders/section-builders/images-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/mailing-list-builder.ts +2 -1
- package/src/metadata-builder/builders/section-builders/mailing-list-section-builder.ts +2 -1
- package/src/metadata-builder/builders/section-builders/profile-section-builder.ts +6 -3
- package/src/metadata-builder/builders/section-builders/shapes-section-builder.ts +3 -2
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +2 -1
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +13 -19
- package/src/metadata-builder/builders/update-content-text-builder.ts +148 -0
- package/src/metadata-builder/builders/update-content-text-style-builder.ts +352 -0
- package/src/metadata-builder/helpers/rte.helpers.ts +101 -15
- package/src/metadata-builder/metadata-executor.ts +5 -0
- package/src/metadata-builder/models.ts +3 -0
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +27 -0
- package/src/metadata-builder/sanitizers/rte-schema-check.ts +53 -24
- package/src/shared/content-settings/components/GenericTextInput.mixin.ts +11 -42
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +3 -16
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.mixin.ts +4 -13
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +4 -6
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +3 -6
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +1 -6
- package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +1 -1
- package/src/shared/template-settings/store/template-settings-store.ts +93 -27
- package/src/utils/minify-brand-page-metadata.ts +1 -4
- package/lib/src/brand-page/utils/migration/migration-20.d.ts +0 -2
- package/lib/src/brand-page/utils/migration/migration-20.js +0 -66
- package/lib/src/brand-page-maker/__fixtures__/complex-rte.fixture.d.ts +0 -22
- package/lib/src/brand-page-maker/__fixtures__/complex-rte.fixture.js +0 -22
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.d.ts +0 -14
- package/lib/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.js +0 -39
- package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.d.ts +0 -28
- package/lib/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.js +0 -117
- package/lib/src/brand-page-maker/utils/rte-render.util.d.ts +0 -63
- package/lib/src/brand-page-maker/utils/rte-render.util.js +0 -95
- package/lib/src/brand-page-maker/utils/rte-sanitize.util.d.ts +0 -6
- package/lib/src/brand-page-maker/utils/rte-sanitize.util.js +0 -156
- package/src/brand-page/utils/migration/migration-20.server.test.ts +0 -125
- package/src/brand-page/utils/migration/migration-20.test.ts +0 -72
- package/src/brand-page/utils/migration/migration-20.ts +0 -87
- package/src/brand-page/utils/text.util.test.ts +0 -106
- package/src/brand-page/utils/view-model.pageid-rte.test.ts +0 -104
- package/src/brand-page-maker/__fixtures__/complex-rte.fixture.ts +0 -23
- package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.test.ts +0 -52
- package/src/brand-page-maker/composables/rich-text-editor/extensions/FontFamily.ts +0 -42
- package/src/brand-page-maker/composables/rich-text-editor/getRteExtensions.ts +0 -162
- package/src/brand-page-maker/utils/__snapshots__/rte-render-parity.test.ts.snap +0 -202
- package/src/brand-page-maker/utils/rte-features.test.ts +0 -378
- package/src/brand-page-maker/utils/rte-render-parity.test.ts +0 -164
- package/src/brand-page-maker/utils/rte-render.util.ts +0 -165
- package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +0 -172
- package/src/brand-page-maker/utils/rte-sanitize.util.ts +0 -192
- package/src/brand-page-maker/validators/field.validator.test.ts +0 -55
|
@@ -8,7 +8,7 @@ import { SIDE_BAR_TAB_NAMES } from '@brand-page-maker/constants';
|
|
|
8
8
|
import { ITEM_FIELD_TYPES } from '@brand-page-maker/models';
|
|
9
9
|
import { useUiPageSettingsStore } from '../../../page-settings/store';
|
|
10
10
|
import { PAGE_SECTIONS } from '../../../page-settings/models';
|
|
11
|
-
import { getPlainTextFromRTE, replaceTextInRTE, RTE_ALLOWED_SECTION_TYPES, isRTEManagedStyleField,
|
|
11
|
+
import { getPlainTextFromRTE, replaceTextInRTE, RTE_ALLOWED_SECTION_TYPES, isRTEManagedStyleField, } from '@brand-page-maker/utils';
|
|
12
12
|
import { isDefaultContentText } from '@shared/content-settings/utils';
|
|
13
13
|
import { useUiLogoSettingsStore } from '../../../logo-settings/store';
|
|
14
14
|
const RTE_DISALLOWED_FIELD_NAMES = ['buttonText'];
|
|
@@ -267,17 +267,8 @@ export default defineComponent({
|
|
|
267
267
|
},
|
|
268
268
|
onUseGeneratedText(generatedText) {
|
|
269
269
|
let formattedText = generatedText;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
// (cold AI path, shared editor); string fields use it directly.
|
|
273
|
-
if (this.showRichTextEditor) {
|
|
274
|
-
if (isTiptapDocument(this.value)) {
|
|
275
|
-
formattedText =
|
|
276
|
-
toRteJson(replaceTextInRTE(renderRteToHtml(this.value), generatedText)) ?? generatedText;
|
|
277
|
-
}
|
|
278
|
-
else if (typeof this.value === 'string') {
|
|
279
|
-
formattedText = replaceTextInRTE(this.value, generatedText);
|
|
280
|
-
}
|
|
270
|
+
if (this.showRichTextEditor && typeof this.value === 'string') {
|
|
271
|
+
formattedText = replaceTextInRTE(this.value, generatedText);
|
|
281
272
|
}
|
|
282
273
|
this.contentSettingsStore.updateItemValue({
|
|
283
274
|
id: this.id,
|
|
@@ -80,13 +80,13 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
80
80
|
_oldValue: string;
|
|
81
81
|
isDirty: boolean;
|
|
82
82
|
emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
|
|
83
|
+
lengthError: boolean;
|
|
83
84
|
burstIsHydration: boolean | undefined;
|
|
84
85
|
pendingWriteIsHydration: boolean;
|
|
85
86
|
}, {
|
|
86
87
|
errorMessage(): string | undefined;
|
|
87
88
|
isErrorVisible(): boolean;
|
|
88
89
|
isValid(): boolean | undefined;
|
|
89
|
-
lengthError(): boolean;
|
|
90
90
|
label(): string;
|
|
91
91
|
text: {
|
|
92
92
|
get(): string | false;
|
|
@@ -80,13 +80,13 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
80
80
|
_oldValue: string;
|
|
81
81
|
isDirty: boolean;
|
|
82
82
|
emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
|
|
83
|
+
lengthError: boolean;
|
|
83
84
|
burstIsHydration: boolean | undefined;
|
|
84
85
|
pendingWriteIsHydration: boolean;
|
|
85
86
|
}, {
|
|
86
87
|
errorMessage(): string | undefined;
|
|
87
88
|
isErrorVisible(): boolean;
|
|
88
89
|
isValid(): boolean | undefined;
|
|
89
|
-
lengthError(): boolean;
|
|
90
90
|
label(): string;
|
|
91
91
|
text: {
|
|
92
92
|
get(): string | false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { ColorReplacement, Content, LogoTheme,
|
|
2
|
+
import type { ColorReplacement, Content, LogoTheme, TestimonialItems } from '@brand-page';
|
|
3
3
|
import type { DebounceHandle } from 'lodash.debounce';
|
|
4
4
|
import type { UpdateItemValuePayload } from '../../models';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -64,8 +64,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
64
64
|
name: string;
|
|
65
65
|
value: string;
|
|
66
66
|
}, index: number): void;
|
|
67
|
-
getItemTextPreview(text:
|
|
68
|
-
rteTextLength(value: RichTextValue): number;
|
|
67
|
+
getItemTextPreview(text: string): string;
|
|
69
68
|
getPlainTextValue(index: number): string;
|
|
70
69
|
onCaptureSnapshot(): void;
|
|
71
70
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "capture-preview-snapshot" | "on-intent-image-replace")[], "update:modelValue" | "capture-preview-snapshot" | "on-intent-image-replace", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -3,7 +3,7 @@ import { EMPTY_TESTIMONIAL, MAX_DESCRIPTION_LENGTH, MAX_LENGTH_ERROR_MESSAGE, MA
|
|
|
3
3
|
import debounce from 'lodash.debounce';
|
|
4
4
|
import cloneDeep from 'lodash.clonedeep';
|
|
5
5
|
import { useSnapshotStore } from '@brand-page-maker/stores';
|
|
6
|
-
import { getPlainTextFromRTE
|
|
6
|
+
import { getPlainTextFromRTE } from '@brand-page-maker/utils';
|
|
7
7
|
import { isDefaultContentText } from '../../utils';
|
|
8
8
|
import { decodeHtmlEntities } from '@brand-page/utils';
|
|
9
9
|
import { ESCAPED_NEWLINE_CHARACTER } from '../../../../constants/ui';
|
|
@@ -73,9 +73,7 @@ export default defineComponent({
|
|
|
73
73
|
},
|
|
74
74
|
created() {
|
|
75
75
|
this.options = cloneDeep(this.value);
|
|
76
|
-
|
|
77
|
-
// read visible text via getPlainTextFromRTE rather than `.trim()` on a doc.
|
|
78
|
-
this.isEmpty = this.options.map((option) => getPlainTextFromRTE(option.testimonials).length === 0);
|
|
76
|
+
this.isEmpty = this.options.map((option) => option.testimonials.trim().length === 0);
|
|
79
77
|
if (!this.changeDebounce) {
|
|
80
78
|
this.changeDebounce = debounce(this.emitChange, DEBOUNCE_IN_MS);
|
|
81
79
|
}
|
|
@@ -162,12 +160,7 @@ export default defineComponent({
|
|
|
162
160
|
this.emitChange();
|
|
163
161
|
},
|
|
164
162
|
getItemTextPreview(text) {
|
|
165
|
-
|
|
166
|
-
const value = typeof text === 'string' ? text : getPlainTextFromRTE(text);
|
|
167
|
-
return decodeHtmlEntities(value.replace(new RegExp(ESCAPED_NEWLINE_CHARACTER, 'g'), ' '));
|
|
168
|
-
},
|
|
169
|
-
rteTextLength(value) {
|
|
170
|
-
return getRteTextLength(value);
|
|
163
|
+
return decodeHtmlEntities(text.replace(new RegExp(ESCAPED_NEWLINE_CHARACTER, 'g'), ' '));
|
|
171
164
|
},
|
|
172
165
|
getPlainTextValue(index) {
|
|
173
166
|
const text = this.options[index]?.testimonials || '';
|
|
@@ -80,13 +80,13 @@ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
80
80
|
_oldValue: string;
|
|
81
81
|
isDirty: boolean;
|
|
82
82
|
emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
|
|
83
|
+
lengthError: boolean;
|
|
83
84
|
burstIsHydration: boolean | undefined;
|
|
84
85
|
pendingWriteIsHydration: boolean;
|
|
85
86
|
}, {
|
|
86
87
|
errorMessage(): string | undefined;
|
|
87
88
|
isErrorVisible(): boolean;
|
|
88
89
|
isValid(): boolean | undefined;
|
|
89
|
-
lengthError(): boolean;
|
|
90
90
|
label(): string;
|
|
91
91
|
text: {
|
|
92
92
|
get(): string | false;
|
package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
import type { Content, LogoTheme,
|
|
2
|
+
import type { Content, LogoTheme, TextItem, TextStyleDeclaration } from '@brand-page/models';
|
|
3
3
|
import type { DebounceHandle } from 'lodash.debounce';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
5
|
id: {
|
|
@@ -79,7 +79,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
79
79
|
name: string;
|
|
80
80
|
value: string;
|
|
81
81
|
}, index: number): void;
|
|
82
|
-
rteTextLength(value: RichTextValue): number;
|
|
83
82
|
getPlainTextValue(index: number): string;
|
|
84
83
|
onCaptureSnapshot(): void;
|
|
85
84
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("capture-preview-snapshot" | "update:model-value")[], "capture-preview-snapshot" | "update:model-value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -4,7 +4,7 @@ import debounce from 'lodash.debounce';
|
|
|
4
4
|
import cloneDeep from 'lodash.clonedeep';
|
|
5
5
|
import { decodeHtmlEntities, escapeContentText } from '@brand-page/utils';
|
|
6
6
|
import { useSnapshotStore } from '@brand-page-maker/stores';
|
|
7
|
-
import { getPlainTextFromRTE
|
|
7
|
+
import { getPlainTextFromRTE } from '@brand-page-maker/utils';
|
|
8
8
|
import { isDefaultContentText } from '../../utils';
|
|
9
9
|
const DEBOUNCE_IN_MS = 250;
|
|
10
10
|
export default defineComponent({
|
|
@@ -172,9 +172,6 @@ export default defineComponent({
|
|
|
172
172
|
this.options[index][payload.name] = payload.value;
|
|
173
173
|
this.emitChange();
|
|
174
174
|
},
|
|
175
|
-
rteTextLength(value) {
|
|
176
|
-
return getRteTextLength(value);
|
|
177
|
-
},
|
|
178
175
|
getPlainTextValue(index) {
|
|
179
176
|
const text = this.options[index]?.text || '';
|
|
180
177
|
const plainText = getPlainTextFromRTE(text);
|
|
@@ -94,13 +94,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
94
94
|
_oldValue: string;
|
|
95
95
|
isDirty: boolean;
|
|
96
96
|
emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
|
|
97
|
+
lengthError: boolean;
|
|
97
98
|
burstIsHydration: boolean | undefined;
|
|
98
99
|
pendingWriteIsHydration: boolean;
|
|
99
100
|
}, {
|
|
100
101
|
errorMessage(): string | undefined;
|
|
101
102
|
isErrorVisible(): boolean;
|
|
102
103
|
isValid(): boolean | undefined;
|
|
103
|
-
lengthError(): boolean;
|
|
104
104
|
label(): string;
|
|
105
105
|
text: {
|
|
106
106
|
get(): string | false;
|
|
@@ -87,13 +87,13 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
|
|
|
87
87
|
_oldValue: string;
|
|
88
88
|
isDirty: boolean;
|
|
89
89
|
emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
|
|
90
|
+
lengthError: boolean;
|
|
90
91
|
burstIsHydration: boolean | undefined;
|
|
91
92
|
pendingWriteIsHydration: boolean;
|
|
92
93
|
}, {
|
|
93
94
|
errorMessage(): string | undefined;
|
|
94
95
|
isErrorVisible(): boolean;
|
|
95
96
|
isValid(): boolean | undefined;
|
|
96
|
-
lengthError(): boolean;
|
|
97
97
|
label(): string;
|
|
98
98
|
text: {
|
|
99
99
|
get(): string | false;
|
package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts
CHANGED
|
@@ -83,13 +83,13 @@ declare const _default: import("vue").DefineComponent<{}, {}, Record<string, any
|
|
|
83
83
|
_oldValue: string;
|
|
84
84
|
isDirty: boolean;
|
|
85
85
|
emitChangeDebounce: import("lodash.debounce").DebounceHandle | undefined;
|
|
86
|
+
lengthError: boolean;
|
|
86
87
|
burstIsHydration: boolean | undefined;
|
|
87
88
|
pendingWriteIsHydration: boolean;
|
|
88
89
|
}, {
|
|
89
90
|
errorMessage(): string | undefined;
|
|
90
91
|
isErrorVisible(): boolean;
|
|
91
92
|
isValid(): boolean | undefined;
|
|
92
|
-
lengthError(): boolean;
|
|
93
93
|
label(): string;
|
|
94
94
|
text: {
|
|
95
95
|
get(): string | false;
|
|
@@ -168,7 +168,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
168
168
|
mode: import("../../models").UiScreenSizeMode;
|
|
169
169
|
}): void;
|
|
170
170
|
setUserPersonalisationData({ personalisationData, }: {
|
|
171
|
-
personalisationData: import("../../../brand-page").UserPersonalisationContent[];
|
|
171
|
+
personalisationData: import("../../../brand-page").UserPersonalisationContent[] | undefined;
|
|
172
172
|
}): void;
|
|
173
173
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
174
174
|
userPromptContentKey: string | undefined;
|
|
@@ -25,7 +25,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
25
25
|
mode: import("../models").UiScreenSizeMode;
|
|
26
26
|
}): void;
|
|
27
27
|
setUserPersonalisationData({ personalisationData, }: {
|
|
28
|
-
personalisationData: import("../../brand-page").UserPersonalisationContent[];
|
|
28
|
+
personalisationData: import("../../brand-page").UserPersonalisationContent[] | undefined;
|
|
29
29
|
}): void;
|
|
30
30
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
31
31
|
userPromptContentKey: string | undefined;
|
|
@@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
20
20
|
mode: import("../models").UiScreenSizeMode;
|
|
21
21
|
}): void;
|
|
22
22
|
setUserPersonalisationData({ personalisationData, }: {
|
|
23
|
-
personalisationData: import("../../brand-page").UserPersonalisationContent[];
|
|
23
|
+
personalisationData: import("../../brand-page").UserPersonalisationContent[] | undefined;
|
|
24
24
|
}): void;
|
|
25
25
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
26
26
|
userPromptContentKey: string | undefined;
|
|
@@ -37,7 +37,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
37
37
|
mode: import("../models").UiScreenSizeMode;
|
|
38
38
|
}): void;
|
|
39
39
|
setUserPersonalisationData({ personalisationData, }: {
|
|
40
|
-
personalisationData: import("../../brand-page").UserPersonalisationContent[];
|
|
40
|
+
personalisationData: import("../../brand-page").UserPersonalisationContent[] | undefined;
|
|
41
41
|
}): void;
|
|
42
42
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
43
43
|
userPromptContentKey: string | undefined;
|
|
@@ -60,7 +60,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
60
60
|
mode: import("../models").UiScreenSizeMode;
|
|
61
61
|
}): void;
|
|
62
62
|
setUserPersonalisationData({ personalisationData, }: {
|
|
63
|
-
personalisationData: import("../../brand-page").UserPersonalisationContent[];
|
|
63
|
+
personalisationData: import("../../brand-page").UserPersonalisationContent[] | undefined;
|
|
64
64
|
}): void;
|
|
65
65
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
66
66
|
userPromptContentKey: string | undefined;
|
|
@@ -3916,7 +3916,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
3916
3916
|
mode: import("../../../models").UiScreenSizeMode;
|
|
3917
3917
|
}): void;
|
|
3918
3918
|
setUserPersonalisationData({ personalisationData, }: {
|
|
3919
|
-
personalisationData: import("@brand-page").UserPersonalisationContent[];
|
|
3919
|
+
personalisationData: import("@brand-page").UserPersonalisationContent[] | undefined;
|
|
3920
3920
|
}): void;
|
|
3921
3921
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
3922
3922
|
userPromptContentKey: string | undefined;
|
|
@@ -3897,7 +3897,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
3897
3897
|
mode: import("../../../models").UiScreenSizeMode;
|
|
3898
3898
|
}): void;
|
|
3899
3899
|
setUserPersonalisationData({ personalisationData, }: {
|
|
3900
|
-
personalisationData: import("@brand-page").UserPersonalisationContent[];
|
|
3900
|
+
personalisationData: import("@brand-page").UserPersonalisationContent[] | undefined;
|
|
3901
3901
|
}): void;
|
|
3902
3902
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
3903
3903
|
userPromptContentKey: string | undefined;
|
|
@@ -379,7 +379,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
379
379
|
mode: import("../../models").UiScreenSizeMode;
|
|
380
380
|
}): void;
|
|
381
381
|
setUserPersonalisationData({ personalisationData, }: {
|
|
382
|
-
personalisationData: import("@brand-page").UserPersonalisationContent[];
|
|
382
|
+
personalisationData: import("@brand-page").UserPersonalisationContent[] | undefined;
|
|
383
383
|
}): void;
|
|
384
384
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
385
385
|
userPromptContentKey: string | undefined;
|
|
@@ -107,7 +107,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
107
107
|
mode: import("../../models").UiScreenSizeMode;
|
|
108
108
|
}): void;
|
|
109
109
|
setUserPersonalisationData({ personalisationData, }: {
|
|
110
|
-
personalisationData: import("../../../brand-page").UserPersonalisationContent[];
|
|
110
|
+
personalisationData: import("../../../brand-page").UserPersonalisationContent[] | undefined;
|
|
111
111
|
}): void;
|
|
112
112
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
113
113
|
userPromptContentKey: string | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TemplateSettingsTemplate, DesignTemplateType, OnTemplateSelectedPayload, TemplateTab, OnSearchPayload, OnTabSelectedPayload, TemplateCategory, OnCategorySelectedPayload, SetTemplateCategoriesPayload } from '../models';
|
|
2
2
|
import { type DesignTemplate } from '../../../clients/models';
|
|
3
|
+
import { type UserPersonalisationContent } from '@brand-page/models';
|
|
3
4
|
export declare const DEFAULT_PAGE_SIZE = 6;
|
|
4
5
|
type SelectedTabType = {
|
|
5
6
|
key: string;
|
|
@@ -19,6 +20,7 @@ export interface TemplatesSettingState {
|
|
|
19
20
|
selectedTab: SelectedTabType;
|
|
20
21
|
selectedCategory: string | undefined;
|
|
21
22
|
searchTerm: string | undefined;
|
|
23
|
+
searchPersonalisationData: UserPersonalisationContent[] | undefined;
|
|
22
24
|
tabsWithTranslations: SelectedTabType[];
|
|
23
25
|
logoChangeWatcherInitialized: boolean;
|
|
24
26
|
initialSearchTerm: string | undefined;
|
|
@@ -5,7 +5,7 @@ import { BP_DEFAULT_TEMPLATE_TYPE_NAME, BP_BRAND_SITE_TEMPLATE_TYPE_NAME, SIDE_B
|
|
|
5
5
|
import { defineStore, storeToRefs } from 'pinia';
|
|
6
6
|
import { useBrandPageContainerStore, useBrandPageMakerStore, useBrandPageMakerUserStore, useLogoStore, useUiStore, } from '@brand-page-maker/stores';
|
|
7
7
|
import { useUiSideBarStore } from '../../side-bar/store';
|
|
8
|
-
import { BrandPageModel } from '@brand-page/models';
|
|
8
|
+
import { BrandPageModel, } from '@brand-page/models';
|
|
9
9
|
import { migrateBrandPageModel } from '@brand-page/utils';
|
|
10
10
|
import { getAiContentIndexByTemplateTokenAndNumberOfVariations } from '@brand-page-maker/utils/ai-content-selection.util';
|
|
11
11
|
import { useUiEditableLogoStore, useUiLogoSettingsStore, } from '../../logo-settings/store';
|
|
@@ -20,6 +20,7 @@ const POST_PURCHASE_PAGE_SECTION_BY_TAB = {
|
|
|
20
20
|
};
|
|
21
21
|
const PRE_PURCHASE_PAGE_SECTION_BY_TAB = {
|
|
22
22
|
[TEMPLATE_TABS.all]: 'MakerPrePurchaseSidebarTemplatesAllTab',
|
|
23
|
+
[TEMPLATE_TABS.AI]: 'MakerPrePurchaseSidebarTemplatesAiTab',
|
|
23
24
|
[TEMPLATE_TABS.categories]: 'MakerPrePurchaseSidebarTemplatesCategoryTab',
|
|
24
25
|
};
|
|
25
26
|
const LOAD_PAGE_RETRY_DELAY = 250;
|
|
@@ -38,6 +39,7 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
38
39
|
displayName: templateSettingsTr(`headerAll`),
|
|
39
40
|
},
|
|
40
41
|
searchTerm: undefined,
|
|
42
|
+
searchPersonalisationData: undefined,
|
|
41
43
|
selectedCategory: undefined,
|
|
42
44
|
templateCategories: [],
|
|
43
45
|
tabsWithTranslations: [
|
|
@@ -200,15 +202,21 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
200
202
|
const editableLogoVariation = editableLogoStore.editableLogoVariations[logoVariation];
|
|
201
203
|
const isPrePurchase = brandPageContainerStore.isPrePurchase;
|
|
202
204
|
const isBrandSite = this.templateType === BP_BRAND_SITE_TEMPLATE_TYPE_NAME;
|
|
203
|
-
//
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
|
|
205
|
+
// With no user search, the All tab must still show industry-relevant templates rather than
|
|
206
|
+
// generic ones (searchIndustries alone doesn't rank the non-AI half). Seed searchTerm as an
|
|
207
|
+
// invisible default: pre-purchase has no logo to read an industry from, so it uses the seeded
|
|
208
|
+
// keyword from the URL/cookie (bp-5454); post-purchase falls back to the logo draft's industry
|
|
209
|
+
// (bp-5789). Once the user searches, this.searchTerm takes over. this.searchTerm stays unset
|
|
210
|
+
// here, so AI content-key resolution below is unaffected.
|
|
211
|
+
const useSeededSearchTerm = !this.searchTerm &&
|
|
207
212
|
!this.selectedCategory &&
|
|
208
|
-
isPrePurchase &&
|
|
209
213
|
isBrandSite &&
|
|
210
|
-
this.selectedTab.key === TEMPLATE_TABS.all
|
|
214
|
+
this.selectedTab.key === TEMPLATE_TABS.all;
|
|
215
|
+
const seededSearchTerm = isPrePurchase
|
|
211
216
|
? this.initialSearchTerm
|
|
217
|
+
: brandPageMakerStore.industry;
|
|
218
|
+
const effectiveSearchTerm = useSeededSearchTerm
|
|
219
|
+
? seededSearchTerm
|
|
212
220
|
: this.searchTerm;
|
|
213
221
|
const pageSection = isBrandSite
|
|
214
222
|
? (isPrePurchase
|
|
@@ -254,6 +262,22 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
254
262
|
eventTracker.sendExperimentStartedEvent(experimentName, experimentValue);
|
|
255
263
|
}
|
|
256
264
|
}
|
|
265
|
+
// searchPersonalisation is a per-search payload established on page 1; only set it there
|
|
266
|
+
// (like abTestValuesToBePushed above) so paginating to page 2+ can't reset it to undefined.
|
|
267
|
+
// Every context change (search/clear/category/logo swap) reloads from page 1, so this still
|
|
268
|
+
// clears stale search content on a new search.
|
|
269
|
+
//
|
|
270
|
+
// Set BEFORE the mapping loop so tiles and the apply path read the same value — reading the
|
|
271
|
+
// per-page `result.searchPersonalisation` here made page-2 tiles fall back to page-load
|
|
272
|
+
// content while applying used page-1 search content.
|
|
273
|
+
//
|
|
274
|
+
// Empty [] is stored as undefined: it wins `??` but fails `?.length`, so it would strand
|
|
275
|
+
// the downstream fallback to uiStore.personalisationData and silently skip the apply.
|
|
276
|
+
if (pageNo === 1) {
|
|
277
|
+
this.searchPersonalisationData = result.searchPersonalisation?.length
|
|
278
|
+
? result.searchPersonalisation
|
|
279
|
+
: undefined;
|
|
280
|
+
}
|
|
257
281
|
const templates = await Promise.all(result.paginatedItems.map(async (item) => {
|
|
258
282
|
try {
|
|
259
283
|
if (brandPageMakerUserStore.isAdmin) {
|
|
@@ -263,14 +287,15 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
263
287
|
else {
|
|
264
288
|
let personalisationContentIndex;
|
|
265
289
|
let contentKey;
|
|
266
|
-
|
|
290
|
+
const activePersonalisation = this.searchPersonalisationData ?? uiStore.personalisationData;
|
|
291
|
+
if (activePersonalisation?.length) {
|
|
267
292
|
personalisationContentIndex =
|
|
268
|
-
await getAiContentIndexByTemplateTokenAndNumberOfVariations(item.designTemplateToken,
|
|
293
|
+
await getAiContentIndexByTemplateTokenAndNumberOfVariations(item.designTemplateToken, activePersonalisation.length);
|
|
269
294
|
contentKey =
|
|
270
|
-
|
|
295
|
+
activePersonalisation[personalisationContentIndex]
|
|
271
296
|
.contentKey;
|
|
272
297
|
}
|
|
273
|
-
else if (item.isPersonalisable) {
|
|
298
|
+
else if (item.isPersonalisable && !this.searchTerm) {
|
|
274
299
|
// Pre-purchase has no personalisationData; personalise AI
|
|
275
300
|
// template previews with the prompt content key (bp-5742).
|
|
276
301
|
contentKey = uiStore.userPromptContentKey;
|
|
@@ -279,10 +304,9 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
279
304
|
id: item.designTemplateToken,
|
|
280
305
|
isPersonalisable: item.isPersonalisable,
|
|
281
306
|
contentKey,
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
// holds placeholders post-purchase (bp-5454).
|
|
307
|
+
// userPromptContentKey signals the content lives in the userPrompt S3
|
|
308
|
+
// bucket (post- or pre-purchase); the preview must resolve via
|
|
309
|
+
// userPromptContentKey, not the regular bucket (bp-5454).
|
|
286
310
|
usesUserPromptContentKey: !!uiStore.userPromptContentKey,
|
|
287
311
|
previewImageUrl: item.previewImageUrl,
|
|
288
312
|
};
|
|
@@ -294,12 +318,21 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
294
318
|
}));
|
|
295
319
|
// Filter out null templates before adding
|
|
296
320
|
const validTemplates = templates.filter((t) => t !== null);
|
|
297
|
-
|
|
298
|
-
//
|
|
299
|
-
//
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
321
|
+
let displayTemplates = validTemplates;
|
|
322
|
+
// The All tab shows backend-interleaved AI templates (gated server-side on the AB
|
|
323
|
+
// variation) even when the dedicated AI tab is hidden — e.g. regular templates
|
|
324
|
+
// pre-purchase (bp-5789). So only strip AI when the AI tab is hidden AND we're not on
|
|
325
|
+
// the All tab; the backend is the interleave gate, control buckets return no AI here.
|
|
326
|
+
if (!uiStore.showAiTemplatesTab &&
|
|
327
|
+
this.selectedTab.key !== TEMPLATE_TABS.all) {
|
|
328
|
+
displayTemplates = displayTemplates.filter((t) => !t.isPersonalisable);
|
|
329
|
+
}
|
|
330
|
+
else if (this.selectedTab.key === TEMPLATE_TABS.categories) {
|
|
331
|
+
displayTemplates = displayTemplates.map((t) => ({
|
|
332
|
+
...t,
|
|
333
|
+
isPersonalisable: false,
|
|
334
|
+
}));
|
|
335
|
+
}
|
|
303
336
|
this._addTemplates({ templates: displayTemplates });
|
|
304
337
|
this._setPageNoLoaded({ pageNoLoaded: pageNo });
|
|
305
338
|
}
|
|
@@ -364,6 +397,10 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
364
397
|
await this._setSearchTerm({
|
|
365
398
|
searchTerm: payload.searchTerm,
|
|
366
399
|
});
|
|
400
|
+
// Drive AI industry selection from the typed term; fall back to the
|
|
401
|
+
// seeded keyword on clear so the AI tab doesn't go generic (bp-5789).
|
|
402
|
+
this.aiTemplateKeywords =
|
|
403
|
+
payload.searchTerm || this.initialSearchTerm || '';
|
|
367
404
|
this.onSearchTermChanged?.(payload.searchTerm);
|
|
368
405
|
await this._setPageNo({ pageNo: 1 });
|
|
369
406
|
await this.loadPageNo({ pageNo: 1 });
|
|
@@ -434,14 +471,25 @@ export const useUiTemplateSettingsStore = defineStore('uiTemplateSettings', {
|
|
|
434
471
|
if (!oldLogoImage) {
|
|
435
472
|
return;
|
|
436
473
|
}
|
|
437
|
-
//
|
|
474
|
+
// Refetch previews on any logo change (pre- and post-purchase) so the new logo
|
|
475
|
+
// shows in the thumbnails.
|
|
438
476
|
const hasLogoChanged = newLogoImage.logoDraftToken !== oldLogoImage.logoDraftToken ||
|
|
439
477
|
newLogoImage.logoVariation !== oldLogoImage.logoVariation;
|
|
440
478
|
if (!brandPageMakerUserStore.isAdmin &&
|
|
441
479
|
newLogoImage.logoDraftToken &&
|
|
442
480
|
hasLogoChanged) {
|
|
443
|
-
|
|
444
|
-
|
|
481
|
+
const uiStore = useUiStore();
|
|
482
|
+
const isPrePurchase = useBrandPageContainerStore().isPrePurchase;
|
|
483
|
+
uiStore.setUserPersonalisationData({
|
|
484
|
+
personalisationData: undefined,
|
|
485
|
+
});
|
|
486
|
+
if (!isPrePurchase &&
|
|
487
|
+
newLogoImage.logoDraftToken !== oldLogoImage.logoDraftToken) {
|
|
488
|
+
uiStore.setUserPromptContentKey({
|
|
489
|
+
userPromptContentKey: undefined,
|
|
490
|
+
});
|
|
491
|
+
uiStore.setShowAiTemplatesTab({ showAiTemplatesTab: false });
|
|
492
|
+
}
|
|
445
493
|
await this._setTemplates({ templates: [] });
|
|
446
494
|
await this._setPageNoLoaded({ pageNoLoaded: 0 });
|
|
447
495
|
await this._setPageNo({ pageNo: 1 });
|
|
@@ -35,7 +35,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
35
35
|
mode: import("../models").UiScreenSizeMode;
|
|
36
36
|
}): void;
|
|
37
37
|
setUserPersonalisationData({ personalisationData, }: {
|
|
38
|
-
personalisationData: import("../../brand-page").UserPersonalisationContent[];
|
|
38
|
+
personalisationData: import("../../brand-page").UserPersonalisationContent[] | undefined;
|
|
39
39
|
}): void;
|
|
40
40
|
setUserPromptContentKey({ userPromptContentKey, }: {
|
|
41
41
|
userPromptContentKey: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BRAND_PAGE_TYPES, } from '../brand-page/models';
|
|
2
|
-
import { hasRTEContent
|
|
2
|
+
import { hasRTEContent } from '../brand-page-maker/utils';
|
|
3
3
|
import { useExternalRichTextEditor } from '../brand-page-maker/composables/rich-text-editor/useRichTextEditor';
|
|
4
4
|
import { findAssetKey, resolveLogoData, } from './build-asset-manifest';
|
|
5
5
|
const BUTTON_TYPES = [
|
|
@@ -17,9 +17,6 @@ const BUTTON_TYPES = [
|
|
|
17
17
|
'tiktok',
|
|
18
18
|
];
|
|
19
19
|
const convertText = (value, editor) => {
|
|
20
|
-
// Already Tiptap JSON (BP-5787 storage) — keep as-is.
|
|
21
|
-
if (isTiptapDocument(value))
|
|
22
|
-
return value;
|
|
23
20
|
if (typeof value !== 'string' || !value)
|
|
24
21
|
return undefined;
|
|
25
22
|
if (hasRTEContent(value)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designcrowd/library.brand-page",
|
|
3
3
|
"description": "A collection of Maker/Designer applications",
|
|
4
|
-
"version": "6.1.1
|
|
4
|
+
"version": "6.1.1",
|
|
5
5
|
"author": "Design.com Eng",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -74,20 +74,19 @@
|
|
|
74
74
|
"@designcrowd/fe-shared-lib": "2.0.9",
|
|
75
75
|
"@pinia/nuxt": "0.11.3",
|
|
76
76
|
"@storybook/react": "9.0.4",
|
|
77
|
-
"@tiptap/extension-bubble-menu": "
|
|
78
|
-
"@tiptap/extension-character-count": "
|
|
79
|
-
"@tiptap/extension-color": "
|
|
80
|
-
"@tiptap/extension-font-family": "
|
|
81
|
-
"@tiptap/extension-hard-break": "
|
|
82
|
-
"@tiptap/extension-highlight": "
|
|
83
|
-
"@tiptap/extension-link": "
|
|
84
|
-
"@tiptap/extension-placeholder": "
|
|
85
|
-
"@tiptap/extension-text-align": "
|
|
86
|
-
"@tiptap/extension-text-style": "
|
|
87
|
-
"@tiptap/extension-underline": "
|
|
88
|
-
"@tiptap/starter-kit": "
|
|
89
|
-
"@tiptap/
|
|
90
|
-
"@tiptap/vue-3": "3.28.0",
|
|
77
|
+
"@tiptap/extension-bubble-menu": "^2.14.0",
|
|
78
|
+
"@tiptap/extension-character-count": "2.11.7",
|
|
79
|
+
"@tiptap/extension-color": "2.11.5",
|
|
80
|
+
"@tiptap/extension-font-family": "2.11.5",
|
|
81
|
+
"@tiptap/extension-hard-break": "2.12.0",
|
|
82
|
+
"@tiptap/extension-highlight": "2.11.5",
|
|
83
|
+
"@tiptap/extension-link": "2.11.5",
|
|
84
|
+
"@tiptap/extension-placeholder": "2.11.5",
|
|
85
|
+
"@tiptap/extension-text-align": "2.11.5",
|
|
86
|
+
"@tiptap/extension-text-style": "2.11.5",
|
|
87
|
+
"@tiptap/extension-underline": "2.11.5",
|
|
88
|
+
"@tiptap/starter-kit": "2.11.5",
|
|
89
|
+
"@tiptap/vue-3": "2.11.5",
|
|
91
90
|
"axios": "1.13.5",
|
|
92
91
|
"chroma-js": "2.4.2",
|
|
93
92
|
"click-outside-vue3": "4.0.1",
|
|
@@ -105,7 +104,6 @@
|
|
|
105
104
|
"http-proxy-middleware": "2.0.6",
|
|
106
105
|
"i18next": "25.8.5",
|
|
107
106
|
"jquery": "3.7.1",
|
|
108
|
-
"jsdom": "27.4.0",
|
|
109
107
|
"lodash.clonedeep": "4.5.0",
|
|
110
108
|
"lodash.debounce": "4.0.8",
|
|
111
109
|
"lodash.throttle": "4.1.1",
|
|
@@ -168,7 +166,6 @@
|
|
|
168
166
|
"@types/google.maps": "3.65.1",
|
|
169
167
|
"@types/istanbul-lib-report": "3.0.3",
|
|
170
168
|
"@types/jquery": "3.5.33",
|
|
171
|
-
"@types/jsdom": "21.1.6",
|
|
172
169
|
"@types/lodash.clonedeep": "4.5.9",
|
|
173
170
|
"@types/mssql": "9.1.9",
|
|
174
171
|
"@types/multer": "1.4.11",
|
|
@@ -207,6 +204,7 @@
|
|
|
207
204
|
"imports-loader": "5.0.0",
|
|
208
205
|
"jest-image-snapshot": "6.5.1",
|
|
209
206
|
"js-base64": "3.7.8",
|
|
207
|
+
"jsdom": "27.4.0",
|
|
210
208
|
"jsdom-global": "3.0.2",
|
|
211
209
|
"lint-staged": "15.2.0",
|
|
212
210
|
"mini-css-extract-plugin": "2.10.0",
|