@designcrowd/library.brand-page 6.0.26-json-prereq-2 → 6.0.27-websitev2-dev-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-CKBqjDH3.js → CreatedOnBrandCrowd-de-de-BpFKOKIo.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CRXiimvT.js → CreatedOnBrandCrowd-en-us-USGAnC_n.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DCYdY6sj.js → CreatedOnBrandCrowd-es-es-CvVx3h4H.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-Dk7LOhxE.js → CreatedOnBrandCrowd-fr-ca-BCwamW5a.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-Dk7LOhxE.js → CreatedOnBrandCrowd-fr-fr-BCwamW5a.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-Cp4ufHJP.js → CreatedOnBrandCrowd-pt-br-Bt72hMrQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-Cp4ufHJP.js → CreatedOnBrandCrowd-pt-pt-Bt72hMrQ.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-ZSLkWMwM.js → CreatedOnDcom-de-de-BxUDrgG9.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BgdIGfT3.js → CreatedOnDcom-en-us-wjVp5eOs.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-D0KemkCZ.js → CreatedOnDcom-es-es-CwFL2q5h.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BuwNjNbC.js → CreatedOnDcom-fr-ca-BPZ2_PNq.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DCQcsFPf.js → CreatedOnDcom-fr-fr-D0vLOikZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DD-oLAS1.js → CreatedOnDcom-pt-br-CTwbxm9H.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-D8qLq2wW.js → CreatedOnDcom-pt-pt-Cfqf8LaM.js} +1 -1
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +2 -5
- package/lib/src/brand-page/models/index.d.ts +26 -34
- package/lib/src/brand-page/utils/migration.util.js +0 -11
- package/lib/src/brand-page/utils/text.util.d.ts +1 -1
- package/lib/src/brand-page/utils/text.util.js +0 -32
- 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/composables/ai-chat/useAiMetadataBuilder.d.ts +1 -0
- package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +7 -3
- 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/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/ai-assistant-client.d.ts +1 -0
- package/lib/src/clients/ai-assistant-client.js +1 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +39 -39
- package/lib/src/css/library.brand-page-brandPage.min.css +39 -39
- package/lib/src/css/library.brand-page-designCom.min.css +39 -39
- package/lib/src/css/library.brand-page-preview.min.css +39 -39
- package/lib/src/index.d.ts +0 -1
- package/lib/src/index.mjs +138 -143
- package/lib/src/{lib-Db6j9fQZ.js → lib-Cg4BExY4.js} +72135 -75458
- package/lib/src/lib.js +0 -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/global-font-propagation.d.ts +28 -0
- package/lib/src/metadata-builder/builders/global-font-propagation.js +125 -0
- package/lib/src/metadata-builder/builders/global-styles-builder.js +16 -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/index.d.ts +1 -0
- package/lib/src/metadata-builder/builders/section-builders/index.js +1 -0
- 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/support-me-builder.d.ts +8 -0
- package/lib/src/metadata-builder/builders/section-builders/support-me-builder.js +25 -0
- 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 +16 -17
- package/lib/src/metadata-builder/builders/section-field-maps.js +15 -0
- package/lib/src/metadata-builder/builders/section-field-utils.d.ts +6 -1
- package/lib/src/metadata-builder/builders/section-field-utils.js +48 -12
- package/lib/src/metadata-builder/builders/section-rules/support-me.rules.d.ts +2 -0
- package/lib/src/metadata-builder/builders/section-rules/support-me.rules.js +17 -0
- 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 +7 -1
- package/lib/src/metadata-builder/models.d.ts +4 -0
- package/lib/src/metadata-builder/models.js +4 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.d.ts +20 -0
- package/lib/src/metadata-builder/parsers/ai-toolcall-parser.js +8 -0
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +14 -2
- 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.js +1 -14
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +3 -12
- 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-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/utils/minify-brand-page-metadata.js +8 -4
- package/package.json +15 -17
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +2 -5
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +6 -17
- 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/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 -43
- 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/ai-website-builder/AiWebsiteBuilder.vue +1 -1
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +3 -4
- package/src/brand-page-maker/composables/ai-chat/useAiMetadataBuilder.ts +1 -0
- package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +7 -3
- 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/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/ai-assistant-client.ts +1 -0
- package/src/lib.ts +0 -9
- package/src/metadata-builder/ai-metadata-executor.ts +26 -0
- package/src/metadata-builder/builders/global-font-propagation.test.ts +269 -0
- package/src/metadata-builder/builders/global-font-propagation.ts +205 -0
- package/src/metadata-builder/builders/global-styles-builder.ts +21 -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/index.ts +1 -0
- 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/support-me-builder.test.ts +177 -0
- package/src/metadata-builder/builders/section-builders/support-me-builder.ts +43 -0
- package/src/metadata-builder/builders/section-builders/testimonial-section-builder.ts +2 -1
- package/src/metadata-builder/builders/section-builders/text-section-builder.ts +18 -21
- package/src/metadata-builder/builders/section-field-maps.ts +18 -0
- package/src/metadata-builder/builders/section-field-utils.test.ts +83 -0
- package/src/metadata-builder/builders/section-field-utils.ts +69 -18
- package/src/metadata-builder/builders/section-rules/support-me.rules.ts +39 -0
- 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 +8 -0
- package/src/metadata-builder/models.ts +5 -0
- package/src/metadata-builder/parsers/ai-toolcall-parser.ts +31 -0
- package/src/metadata-builder/parsers/section-tool-arguments.ts +14 -1
- package/src/metadata-builder/sanitizers/rte-schema-check.ts +53 -24
- package/src/shared/content-settings/components/GenericTextInput.mixin.ts +1 -17
- 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/utils/minify-brand-page-metadata.test.ts +61 -0
- package/src/utils/minify-brand-page-metadata.ts +9 -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 -90
- 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 -158
- 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 -47
- 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 -137
- 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 -351
- package/src/brand-page-maker/utils/rte-render-parity.test.ts +0 -157
- package/src/brand-page-maker/utils/rte-render.util.ts +0 -165
- package/src/brand-page-maker/utils/rte-sanitize-json.test.ts +0 -158
- package/src/brand-page-maker/utils/rte-sanitize.util.ts +0 -195
- package/src/brand-page-maker/validators/field.validator.test.ts +0 -55
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {} from '../brand-page/models';
|
|
2
2
|
export const BUILDER_TYPES = {
|
|
3
|
+
UPDATE_CONTENT_TEXT: 'update-content-text',
|
|
4
|
+
UPDATE_CONTENT_TEXT_STYLE: 'update-content-text-style',
|
|
3
5
|
// Per-section builder types (create)
|
|
4
6
|
CREATE_BANNER_SECTION: 'create-banner-section',
|
|
5
7
|
CREATE_ABOUT_SECTION: 'create-about-section',
|
|
@@ -26,6 +28,7 @@ export const BUILDER_TYPES = {
|
|
|
26
28
|
CREATE_TWITCH: 'create-twitch',
|
|
27
29
|
CREATE_TIKTOK: 'create-tiktok',
|
|
28
30
|
CREATE_BOOKING_SECTION: 'create-booking-section',
|
|
31
|
+
CREATE_SUPPORT_ME: 'create-support-me',
|
|
29
32
|
// Per-section builder types (update)
|
|
30
33
|
UPDATE_BANNER_SECTION: 'update-banner-section',
|
|
31
34
|
UPDATE_ABOUT_SECTION: 'update-about-section',
|
|
@@ -52,6 +55,7 @@ export const BUILDER_TYPES = {
|
|
|
52
55
|
UPDATE_TWITCH: 'update-twitch',
|
|
53
56
|
UPDATE_TIKTOK: 'update-tiktok',
|
|
54
57
|
UPDATE_BOOKING_SECTION: 'update-booking-section',
|
|
58
|
+
UPDATE_SUPPORT_ME: 'update-support-me',
|
|
55
59
|
// Section-level operations
|
|
56
60
|
DELETE_SECTION: 'delete-section',
|
|
57
61
|
MOVE_SECTION: 'move-section',
|
|
@@ -2,6 +2,8 @@ import type { AiAssistantToolCall } from '../../clients/ai-assistant-client';
|
|
|
2
2
|
import type { FooterDisplayStyle, HeaderDisplayStyle, NavigationDisplayType } from '../../brand-page/constants';
|
|
3
3
|
import type { SectionType, TextStyleArguments } from './section-tool-arguments';
|
|
4
4
|
export declare const AI_ASSISTANT_TOOL_NAMES: {
|
|
5
|
+
readonly UPDATE_TEXT: "updateText";
|
|
6
|
+
readonly UPDATE_STYLE: "updateStyle";
|
|
5
7
|
readonly BUILD_PROFILE_SECTION: "build_profile_section";
|
|
6
8
|
readonly BUILD_TEXT_SECTION: "build_text_section";
|
|
7
9
|
readonly BUILD_IMAGE_SECTION: "build_image_section";
|
|
@@ -28,6 +30,7 @@ export declare const AI_ASSISTANT_TOOL_NAMES: {
|
|
|
28
30
|
readonly BUILD_TESTIMONIAL_SECTION: "build_testimonial-section_section";
|
|
29
31
|
readonly BUILD_DIVIDER_SECTION: "build_divider-section_section";
|
|
30
32
|
readonly BUILD_BOOKING_SECTION: "build_booking-section_section";
|
|
33
|
+
readonly BUILD_SUPPORT_ME_SECTION: "build_support-me_section";
|
|
31
34
|
readonly DELETE_SECTION: "delete_section";
|
|
32
35
|
readonly MOVE_SECTION: "move_section";
|
|
33
36
|
readonly ADD_PAGE: "add_page";
|
|
@@ -47,6 +50,23 @@ export interface ParsedToolCall {
|
|
|
47
50
|
arguments: Record<string, unknown>;
|
|
48
51
|
usage_type?: 'free' | 'paid';
|
|
49
52
|
}
|
|
53
|
+
export interface BaseArguments {
|
|
54
|
+
message?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface UpdateTextToolArguments extends BaseArguments {
|
|
57
|
+
contentId: string;
|
|
58
|
+
fieldName: string;
|
|
59
|
+
metadata: {
|
|
60
|
+
text: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export interface UpdateStyleToolArguments extends BaseArguments {
|
|
64
|
+
contentId: string;
|
|
65
|
+
fieldName: string;
|
|
66
|
+
metadata: {
|
|
67
|
+
style: BrandPageCssStyle;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
50
70
|
export declare const SECTION_TOOL_MAP: Record<string, {
|
|
51
71
|
sectionType: SectionType;
|
|
52
72
|
}>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
// Tool names — must match the function names generated by the AI pipeline.
|
|
2
|
+
// Text element tools use camelCase names.
|
|
2
3
|
// Section tools follow the pattern: build_{sectionType}_section
|
|
3
4
|
// where sectionType matches the ContentType value (e.g. 'banner-section', 'profile').
|
|
4
5
|
// The mode ('create' | 'update') is a field in the tool arguments, not the tool name.
|
|
5
6
|
export const AI_ASSISTANT_TOOL_NAMES = {
|
|
7
|
+
// Text element agent tools
|
|
8
|
+
UPDATE_TEXT: 'updateText',
|
|
9
|
+
UPDATE_STYLE: 'updateStyle',
|
|
6
10
|
// Website builder agent tools — unified build
|
|
7
11
|
BUILD_PROFILE_SECTION: 'build_profile_section',
|
|
8
12
|
BUILD_TEXT_SECTION: 'build_text_section',
|
|
@@ -30,6 +34,7 @@ export const AI_ASSISTANT_TOOL_NAMES = {
|
|
|
30
34
|
BUILD_TESTIMONIAL_SECTION: 'build_testimonial-section_section',
|
|
31
35
|
BUILD_DIVIDER_SECTION: 'build_divider-section_section',
|
|
32
36
|
BUILD_BOOKING_SECTION: 'build_booking-section_section',
|
|
37
|
+
BUILD_SUPPORT_ME_SECTION: 'build_support-me_section',
|
|
33
38
|
// Section-level operation tools
|
|
34
39
|
DELETE_SECTION: 'delete_section',
|
|
35
40
|
MOVE_SECTION: 'move_section',
|
|
@@ -109,6 +114,9 @@ export const SECTION_TOOL_MAP = {
|
|
|
109
114
|
[AI_ASSISTANT_TOOL_NAMES.BUILD_BOOKING_SECTION]: {
|
|
110
115
|
sectionType: 'booking-section',
|
|
111
116
|
},
|
|
117
|
+
[AI_ASSISTANT_TOOL_NAMES.BUILD_SUPPORT_ME_SECTION]: {
|
|
118
|
+
sectionType: 'support-me',
|
|
119
|
+
},
|
|
112
120
|
};
|
|
113
121
|
export const parseToolCalls = (toolCalls) => {
|
|
114
122
|
if (!toolCalls || toolCalls.length === 0) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ContentType } from '../../brand-page/models';
|
|
8
8
|
/** Content types not supported by the AI builder. */
|
|
9
|
-
type UnsupportedContentType = 'logo' | 'video' | 'map' | 'request-payment' | '
|
|
9
|
+
type UnsupportedContentType = 'logo' | 'video' | 'map' | 'request-payment' | 'shop-section';
|
|
10
10
|
export type SectionType = Exclude<ContentType, UnsupportedContentType>;
|
|
11
11
|
export interface TiptapMark {
|
|
12
12
|
type: 'bold' | 'italic' | 'underline' | 'strike' | 'link' | 'textStyle' | 'highlight';
|
|
@@ -407,13 +407,25 @@ export interface BookingSectionArguments {
|
|
|
407
407
|
padding_top?: number;
|
|
408
408
|
padding_bottom?: number;
|
|
409
409
|
}
|
|
410
|
+
export interface SupportMeArguments {
|
|
411
|
+
title?: string;
|
|
412
|
+
description?: string;
|
|
413
|
+
success_message?: string;
|
|
414
|
+
/** Matches DISPLAY_STYLE_PREVIEW / DISPLAY_STYLE_COLLAPSED. */
|
|
415
|
+
display_style?: 'preview' | 'collapsed';
|
|
416
|
+
title_style?: TextStyleArguments;
|
|
417
|
+
heading_style?: TextStyleArguments;
|
|
418
|
+
description_style?: TextStyleArguments;
|
|
419
|
+
item_text_style?: TextStyleArguments;
|
|
420
|
+
button_text_style?: ButtonTextStyleArguments;
|
|
421
|
+
}
|
|
410
422
|
export interface DividerSectionArguments {
|
|
411
423
|
divider_style?: 'none' | 'thin' | 'thick';
|
|
412
424
|
divider_color?: string | null;
|
|
413
425
|
background_color?: string | null;
|
|
414
426
|
padding?: number;
|
|
415
427
|
}
|
|
416
|
-
export type SectionToolArguments = ProfileSectionArguments | TextSectionArguments | ImageSectionArguments | ImageGallerySectionArguments | GeneralLinkSectionArguments | WebsiteSectionArguments | EmailSectionArguments | PhoneSectionArguments | FacebookSectionArguments | XSectionArguments | InstagramSectionArguments | YoutubeSectionArguments | LinkedinSectionArguments | PinterestSectionArguments | TwitchSectionArguments | TiktokSectionArguments | SocialLinksSectionArguments | MailingListSectionArguments | ContactFormSectionArguments | BannerSectionArguments | AboutSectionArguments | ImagesSectionArguments | TestimonialSectionArguments | ShapesSectionArguments | BookingSectionArguments | DividerSectionArguments;
|
|
428
|
+
export type SectionToolArguments = ProfileSectionArguments | TextSectionArguments | ImageSectionArguments | ImageGallerySectionArguments | GeneralLinkSectionArguments | WebsiteSectionArguments | EmailSectionArguments | PhoneSectionArguments | FacebookSectionArguments | XSectionArguments | InstagramSectionArguments | YoutubeSectionArguments | LinkedinSectionArguments | PinterestSectionArguments | TwitchSectionArguments | TiktokSectionArguments | SocialLinksSectionArguments | MailingListSectionArguments | ContactFormSectionArguments | BannerSectionArguments | AboutSectionArguments | ImagesSectionArguments | TestimonialSectionArguments | ShapesSectionArguments | BookingSectionArguments | SupportMeArguments | DividerSectionArguments;
|
|
417
429
|
export interface SectionToolCallShape {
|
|
418
430
|
mode: 'create' | 'update';
|
|
419
431
|
type: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type SectionCheck } from './section-args-validator';
|
|
2
2
|
/**
|
|
3
|
-
* Validates a Tiptap doc against the real ProseMirror
|
|
4
|
-
* (`schema.nodeFromJSON`). Catches malformed AI input — stray
|
|
5
|
-
* in `content`, unknown node types, malformed attrs —
|
|
6
|
-
* and the renderer's silent `setContent` drops
|
|
3
|
+
* Validates a Tiptap doc against the headless editor's real ProseMirror
|
|
4
|
+
* schema (`schema.nodeFromJSON`). Catches malformed AI input — stray
|
|
5
|
+
* non-node children in `content`, unknown node types, malformed attrs —
|
|
6
|
+
* before the builder runs and the renderer's silent `setContent` drops
|
|
7
|
+
* the doc to `<p></p>` (BP-5669).
|
|
7
8
|
*
|
|
8
|
-
* Returns the field-prefixed error string so the AI's tool-call retry
|
|
9
|
-
* it via `BuilderResult.errors` → `tool_result.errorMessage`
|
|
10
|
-
* corrected payload.
|
|
9
|
+
* Returns the field-prefixed error string so the AI's tool-call retry
|
|
10
|
+
* loop reads it via `BuilderResult.errors` → `tool_result.errorMessage`
|
|
11
|
+
* and re-emits a corrected payload.
|
|
11
12
|
*/
|
|
12
13
|
export declare const rteSchemaCheck: (field: string) => SectionCheck;
|
|
13
14
|
/**
|
|
@@ -1,42 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
3
|
+
import Underline from '@tiptap/extension-underline';
|
|
4
|
+
import TextStyle from '@tiptap/extension-text-style';
|
|
5
|
+
import TextAlign from '@tiptap/extension-text-align';
|
|
6
|
+
import FontFamily from '@tiptap/extension-font-family';
|
|
7
|
+
import ColorExtension from '@tiptap/extension-color';
|
|
8
|
+
import Highlight from '@tiptap/extension-highlight';
|
|
9
|
+
import Link from '@tiptap/extension-link';
|
|
10
|
+
import { FontSize } from '../../brand-page-maker/composables/rich-text-editor/extensions/FontSize';
|
|
11
|
+
import { LetterSpacing } from '../../brand-page-maker/composables/rich-text-editor/extensions/LetterSpacing';
|
|
12
|
+
import { LineHeight } from '../../brand-page-maker/composables/rich-text-editor/extensions/LineHeight';
|
|
13
|
+
import { AutoLink } from '../../brand-page-maker/composables/rich-text-editor/extensions/AutoLink';
|
|
3
14
|
import { isTiptapDocument } from '../parsers/section-tool-arguments';
|
|
4
15
|
import { rteStyleCheck, textCheck, } from './section-args-validator';
|
|
5
16
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* We import `getRteExtensions` (a leaf module — @tiptap + prosemirror only), not
|
|
12
|
-
* the maker composable (`useExternalRichTextEditor`), which would pull in the
|
|
13
|
-
* AI executor → section-builders → section-rules graph and re-enter this file
|
|
14
|
-
* before its exports are bound.
|
|
17
|
+
* Constructs a headless Tiptap Editor with the same extension set as
|
|
18
|
+
* `useExternalRichTextEditor` in the maker. We import the Tiptap extension
|
|
19
|
+
* files directly (they are leaf modules) instead of going through the maker
|
|
20
|
+
* composable, which would pull in the AI executor → section-builders →
|
|
21
|
+
* section-rules graph and re-enter this file before its exports are bound.
|
|
15
22
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
const buildHeadlessEditor = () => new Editor({
|
|
24
|
+
editable: false,
|
|
25
|
+
extensions: [
|
|
26
|
+
StarterKit,
|
|
27
|
+
Underline,
|
|
28
|
+
TextStyle.configure({ mergeNestedSpanStyles: true }),
|
|
29
|
+
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
|
30
|
+
FontFamily.configure({ types: ['textStyle'] }),
|
|
31
|
+
FontSize,
|
|
32
|
+
LetterSpacing,
|
|
33
|
+
LineHeight,
|
|
34
|
+
ColorExtension.configure({ types: ['textStyle'] }),
|
|
35
|
+
Highlight.configure({ multicolor: true }),
|
|
36
|
+
Link.configure({
|
|
37
|
+
openOnClick: false,
|
|
38
|
+
defaultProtocol: 'https',
|
|
39
|
+
autolink: true,
|
|
40
|
+
}),
|
|
41
|
+
AutoLink,
|
|
42
|
+
],
|
|
43
|
+
});
|
|
18
44
|
/**
|
|
19
|
-
* Validates a Tiptap doc against the real ProseMirror
|
|
20
|
-
* (`schema.nodeFromJSON`). Catches malformed AI input — stray
|
|
21
|
-
* in `content`, unknown node types, malformed attrs —
|
|
22
|
-
* and the renderer's silent `setContent` drops
|
|
45
|
+
* Validates a Tiptap doc against the headless editor's real ProseMirror
|
|
46
|
+
* schema (`schema.nodeFromJSON`). Catches malformed AI input — stray
|
|
47
|
+
* non-node children in `content`, unknown node types, malformed attrs —
|
|
48
|
+
* before the builder runs and the renderer's silent `setContent` drops
|
|
49
|
+
* the doc to `<p></p>` (BP-5669).
|
|
23
50
|
*
|
|
24
|
-
* Returns the field-prefixed error string so the AI's tool-call retry
|
|
25
|
-
* it via `BuilderResult.errors` → `tool_result.errorMessage`
|
|
26
|
-
* corrected payload.
|
|
51
|
+
* Returns the field-prefixed error string so the AI's tool-call retry
|
|
52
|
+
* loop reads it via `BuilderResult.errors` → `tool_result.errorMessage`
|
|
53
|
+
* and re-emits a corrected payload.
|
|
27
54
|
*/
|
|
28
55
|
export const rteSchemaCheck = (field) => (record) => {
|
|
29
56
|
const value = record[field];
|
|
30
57
|
if (!isTiptapDocument(value))
|
|
31
58
|
return null;
|
|
59
|
+
const editor = buildHeadlessEditor();
|
|
32
60
|
try {
|
|
33
|
-
|
|
61
|
+
editor.schema.nodeFromJSON(value);
|
|
34
62
|
return null;
|
|
35
63
|
}
|
|
36
64
|
catch (err) {
|
|
37
65
|
const detail = err instanceof Error ? err.message : String(err);
|
|
38
66
|
return `"${field}" is not valid Tiptap JSON: ${detail}`;
|
|
39
67
|
}
|
|
68
|
+
finally {
|
|
69
|
+
editor.destroy();
|
|
70
|
+
}
|
|
40
71
|
};
|
|
41
72
|
/**
|
|
42
73
|
* Returns [rteSchemaCheck(field), textCheck(field, max), rteStyleCheck(field)].
|
|
@@ -158,20 +158,7 @@ export default defineComponent({
|
|
|
158
158
|
},
|
|
159
159
|
},
|
|
160
160
|
watch: {
|
|
161
|
-
value(newVal
|
|
162
|
-
// BP-5787: RTE values are Tiptap JSON objects. The parent (TextItemsField)
|
|
163
|
-
// re-clones its items array (cloneDeep) on ANY change — including a sibling
|
|
164
|
-
// field's style sync — yielding a NEW object reference with identical text
|
|
165
|
-
// content. For objects Vue fires this watcher on reference change, so that
|
|
166
|
-
// spurious re-clone would overwrite `_value` and clobber an in-flight edit
|
|
167
|
-
// (a mark applied but not yet debounced to the store), silently dropping
|
|
168
|
-
// the user's formatting. Strings never hit this (same content = same
|
|
169
|
-
// reference = no fire), so mirror that: ignore re-clones whose content is
|
|
170
|
-
// unchanged from the previous prop value.
|
|
171
|
-
if (this.showRichTextEditor &&
|
|
172
|
-
JSON.stringify(newVal) === JSON.stringify(oldVal)) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
161
|
+
value(newVal) {
|
|
175
162
|
this._value = newVal;
|
|
176
163
|
if (this.showRichTextEditor) {
|
|
177
164
|
const textValue = escapeContentText(this._value);
|
|
@@ -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,
|
|
@@ -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 || '';
|
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);
|
|
@@ -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)) {
|
|
@@ -358,11 +355,18 @@ const minifyContent = (content, editor, assets) => {
|
|
|
358
355
|
case 'logo':
|
|
359
356
|
return base;
|
|
360
357
|
case 'request-payment':
|
|
358
|
+
return {
|
|
359
|
+
...base,
|
|
360
|
+
...st('title', c.title, editor),
|
|
361
|
+
...st('description', c.description, editor),
|
|
362
|
+
};
|
|
361
363
|
case 'support-me':
|
|
362
364
|
return {
|
|
363
365
|
...base,
|
|
364
366
|
...st('title', c.title, editor),
|
|
365
367
|
...st('description', c.description, editor),
|
|
368
|
+
...st('successMessage', c.successMessage, editor),
|
|
369
|
+
...(includeString(c.displayStyle) && { displayStyle: c.displayStyle }),
|
|
366
370
|
};
|
|
367
371
|
default:
|
|
368
372
|
return base;
|
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.0.
|
|
4
|
+
"version": "6.0.27-websitev2-dev-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.7",
|
|
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",
|
|
@@ -162,7 +160,6 @@
|
|
|
162
160
|
"@types/google.maps": "3.65.1",
|
|
163
161
|
"@types/istanbul-lib-report": "3.0.3",
|
|
164
162
|
"@types/jquery": "3.5.33",
|
|
165
|
-
"@types/jsdom": "21.1.6",
|
|
166
163
|
"@types/lodash.clonedeep": "4.5.9",
|
|
167
164
|
"@types/mssql": "9.1.9",
|
|
168
165
|
"@types/multer": "1.4.11",
|
|
@@ -201,6 +198,7 @@
|
|
|
201
198
|
"imports-loader": "5.0.0",
|
|
202
199
|
"jest-image-snapshot": "6.5.1",
|
|
203
200
|
"js-base64": "3.7.8",
|
|
201
|
+
"jsdom": "27.4.0",
|
|
204
202
|
"jsdom-global": "3.0.2",
|
|
205
203
|
"lint-staged": "15.2.0",
|
|
206
204
|
"mini-css-extract-plugin": "2.10.0",
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
mutedTextForBackground,
|
|
33
33
|
backgroundColorFromStyle,
|
|
34
34
|
} from '@brand-page/utils';
|
|
35
|
-
import { hasRTEContent
|
|
35
|
+
import { hasRTEContent } from '@brand-page-maker/utils';
|
|
36
36
|
import { useReCaptcha } from '../../composables/recaptcha.composable';
|
|
37
37
|
|
|
38
38
|
export interface FieldValue {
|
|
@@ -180,10 +180,7 @@ export default defineComponent({
|
|
|
180
180
|
},
|
|
181
181
|
|
|
182
182
|
title(): string {
|
|
183
|
-
|
|
184
|
-
// throw — read the visible text via getPlainTextFromRTE to decide
|
|
185
|
-
// whether to fall back to the default.
|
|
186
|
-
return getPlainTextFromRTE(this.viewModel.title)
|
|
183
|
+
return this.viewModel.title && this.viewModel.title.trim() !== ''
|
|
187
184
|
? this.viewModel.title
|
|
188
185
|
: 'Contact Us';
|
|
189
186
|
},
|
|
@@ -21,13 +21,7 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
</template>
|
|
23
23
|
<script setup lang="ts">
|
|
24
|
-
import {
|
|
25
|
-
hasRTEContent,
|
|
26
|
-
getPlainTextFromRTE,
|
|
27
|
-
renderRteToHtml,
|
|
28
|
-
isTiptapDocument,
|
|
29
|
-
type RichTextValue,
|
|
30
|
-
} from '@brand-page-maker/utils';
|
|
24
|
+
import { hasRTEContent, getPlainTextFromRTE } from '@brand-page-maker/utils';
|
|
31
25
|
import {
|
|
32
26
|
type FluidTextData,
|
|
33
27
|
type TextStyleDeclaration,
|
|
@@ -43,8 +37,7 @@ import {
|
|
|
43
37
|
|
|
44
38
|
interface Props {
|
|
45
39
|
textStyle: TextStyleDeclaration | undefined;
|
|
46
|
-
|
|
47
|
-
text: RichTextValue;
|
|
40
|
+
text: string;
|
|
48
41
|
element?: string;
|
|
49
42
|
slug?: string;
|
|
50
43
|
}
|
|
@@ -86,20 +79,16 @@ const textStyleRTE = computed(() => {
|
|
|
86
79
|
};
|
|
87
80
|
});
|
|
88
81
|
|
|
89
|
-
// Render either form (legacy HTML string or Tiptap JSON) to final HTML.
|
|
90
|
-
// For a string this returns it unchanged, so the legacy path is unaffected.
|
|
91
|
-
const renderedHtml = computed(() => renderRteToHtml(props.text));
|
|
92
|
-
|
|
93
82
|
const isRTEContent = computed(() => {
|
|
94
|
-
return
|
|
83
|
+
return hasRTEContent(props.text);
|
|
95
84
|
});
|
|
96
85
|
|
|
97
86
|
const sanitizeText = computed(() => {
|
|
98
|
-
if (isRTEContent.value && !getPlainTextFromRTE(
|
|
87
|
+
if (isRTEContent.value && !getPlainTextFromRTE(props.text)) {
|
|
99
88
|
return '';
|
|
100
89
|
}
|
|
101
90
|
|
|
102
|
-
return
|
|
91
|
+
return props.text;
|
|
103
92
|
});
|
|
104
93
|
|
|
105
94
|
const fontSize = computed<any>(() => props.textStyle.fontSize);
|
|
@@ -171,7 +160,7 @@ const applyScale = () => {
|
|
|
171
160
|
}
|
|
172
161
|
|
|
173
162
|
const fontSizeMatchInRTEText = [
|
|
174
|
-
...
|
|
163
|
+
...props.text.matchAll(
|
|
175
164
|
/style="(?:[^"]*?)\bfont-size\s*:\s*(?<fontSize>[^;"']+)[^"]*?"/gm,
|
|
176
165
|
),
|
|
177
166
|
].map((x) => parseFloat(x.groups?.fontSize || '1em'));
|