@designcrowd/library.brand-page 5.10.6-ml-3 → 5.10.6-sanitise-hyperlink-2
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/brand-page/components/banner-section/BannerSection.mixin.js +2 -1
- package/lib/src/brand-page/models/index.d.ts +5 -0
- package/lib/src/brand-page/models/index.js +4 -0
- package/lib/src/brand-page/utils/personalisation.util.js +1 -1
- package/lib/src/brand-page/utils/text.util.d.ts +0 -2
- package/lib/src/brand-page/utils/text.util.js +0 -11
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +11 -11
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +14 -14
- package/lib/src/brand-page-maker/composables/rich-text-editor/bubbleMenu.d.ts +18 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/bubbleMenu.js +30 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/font.js +0 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/formatting.js +0 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.d.ts +19 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/hyperlink.js +60 -0
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/spacing.js +0 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/textAlign.d.ts +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/textAlign.js +0 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +19 -3
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +99 -5
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +0 -3
- package/lib/src/brand-page-maker/composables/useEventTracker.js +0 -3
- package/lib/src/brand-page-maker/models/button-group.model.d.ts +2 -0
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.d.ts +14 -0
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +259 -0
- package/lib/src/bundled-translations-CD9n0Fap.js +111 -0
- package/lib/src/bundled-translations_de-DE-Dk6BhEdB.js +111 -0
- package/lib/src/bundled-translations_es-ES-Dd5kItYp.js +111 -0
- package/lib/src/bundled-translations_fr-FR-2tJ2nfyX.js +111 -0
- package/lib/src/bundled-translations_pt-PT-D2eek2b1.js +111 -0
- package/lib/src/bundles/bundled-translations.json +0 -13
- package/lib/src/bundles/bundled-translations_de-DE.json +0 -13
- package/lib/src/bundles/bundled-translations_es-ES.json +0 -13
- package/lib/src/bundles/bundled-translations_fr-FR.json +0 -13
- package/lib/src/bundles/bundled-translations_pt-PT.json +0 -13
- package/lib/src/composables/useTranslate.d.ts +1 -2
- package/lib/src/composables/useTranslate.js +11 -12
- package/lib/src/css/library.brand-page-brandCrowd.min.css +61 -44
- package/lib/src/css/library.brand-page-brandPage.min.css +61 -44
- package/lib/src/css/library.brand-page-designCom.min.css +61 -44
- package/lib/src/css/library.brand-page-preview.min.css +61 -44
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.mjs +62531 -60652
- package/lib/src/lib.js +1 -1
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.js +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +13 -13
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +11 -11
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +9 -9
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +10 -10
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +9 -9
- package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.d.ts +12 -2
- package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.js +4 -0
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +2 -4
- package/lib/src/shared/content-settings/components/text-style-field/TextStyleField.mixin.d.ts +6 -6
- package/lib/src/shared/content-settings/utils.d.ts +2 -0
- package/lib/src/shared/content-settings/utils.js +11 -0
- package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.d.ts +1 -1
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +12 -12
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +17 -15
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +0 -4
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.js +1 -12
- package/lib/src/shared/shape-library/ShapeLibrary.mixin.js +1 -1
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +5 -5
- package/package.json +13 -15
- package/src/brand-page/components/banner-section/BannerSection.mixin.ts +2 -1
- package/src/brand-page/models/index.ts +6 -0
- package/src/brand-page/utils/personalisation.util.ts +1 -1
- package/src/brand-page/utils/text.util.ts +0 -16
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +319 -34
- package/src/brand-page-maker/components/sensitive-content/i18n/sensitive-settings-translation_de-DE.json +4 -4
- package/src/brand-page-maker/components/sensitive-content/i18n/sensitive-settings-translation_es-ES.json +4 -4
- package/src/brand-page-maker/components/sensitive-content/i18n/sensitive-settings-translation_fr-FR.json +4 -4
- package/src/brand-page-maker/components/sensitive-content/i18n/sensitive-settings-translation_pt-PT.json +4 -4
- package/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.vue +14 -26
- package/src/brand-page-maker/components/social-share/i18n/social-share-translation_de-DE.json +8 -8
- package/src/brand-page-maker/components/social-share/i18n/social-share-translation_es-ES.json +8 -8
- package/src/brand-page-maker/components/social-share/i18n/social-share-translation_fr-FR.json +8 -8
- package/src/brand-page-maker/components/social-share/i18n/social-share-translation_pt-PT.json +8 -8
- package/src/brand-page-maker/composables/rich-text-editor/bubbleMenu.ts +41 -0
- package/src/brand-page-maker/composables/rich-text-editor/extensions/MaxLength.test.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/font.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/formatting.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/hyperlink.ts +80 -0
- package/src/brand-page-maker/composables/rich-text-editor/spacing.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/textAlign.ts +1 -1
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +146 -7
- package/src/brand-page-maker/composables/useEventTracker.ts +0 -3
- package/src/brand-page-maker/models/button-group.model.ts +2 -0
- package/src/brand-page-maker/utils/rich-text-editor.util.test.ts +359 -0
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +317 -0
- package/src/bundles/bundled-translations.json +0 -13
- package/src/bundles/bundled-translations_de-DE.json +0 -13
- package/src/bundles/bundled-translations_es-ES.json +0 -13
- package/src/bundles/bundled-translations_fr-FR.json +0 -13
- package/src/bundles/bundled-translations_pt-PT.json +0 -13
- package/src/composables/useTranslate.ts +11 -14
- package/src/lib.ts +1 -1
- package/src/shared/color-picker/components/i18n/color-picker-translation_de-DE.json +5 -5
- package/src/shared/color-picker/components/i18n/color-picker-translation_es-ES.json +5 -5
- package/src/shared/color-picker/components/i18n/color-picker-translation_fr-FR.json +5 -5
- package/src/shared/color-picker/components/i18n/color-picker-translation_pt-PT.json +5 -5
- package/src/shared/common/i18n/common-translation_de-DE.json +46 -46
- package/src/shared/common/i18n/common-translation_es-ES.json +46 -46
- package/src/shared/common/i18n/common-translation_fr-FR.json +46 -46
- package/src/shared/common/i18n/common-translation_pt-PT.json +46 -46
- package/src/shared/content-settings/components/GenericTextInput.mixin.ts +1 -4
- package/src/shared/content-settings/components/content-settings/i18n/content-settings-translation_de-DE.json +166 -166
- package/src/shared/content-settings/components/content-settings/i18n/content-settings-translation_es-ES.json +166 -166
- package/src/shared/content-settings/components/content-settings/i18n/content-settings-translation_fr-FR.json +166 -166
- package/src/shared/content-settings/components/content-settings/i18n/content-settings-translation_pt-PT.json +166 -166
- package/src/shared/content-settings/components/logo-selection-field/i18n/logo-selection-translation_de-DE.json +5 -5
- package/src/shared/content-settings/components/logo-selection-field/i18n/logo-selection-translation_es-ES.json +5 -5
- package/src/shared/content-settings/components/logo-selection-field/i18n/logo-selection-translation_fr-FR.json +5 -5
- package/src/shared/content-settings/components/logo-selection-field/i18n/logo-selection-translation_pt-PT.json +5 -5
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.ts +4 -0
- package/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.vue +2 -2
- package/src/shared/content-settings/components/personalisation-role-field/PersonalisationRoleField.vue +1 -0
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +2 -4
- package/src/shared/content-settings/utils.ts +16 -0
- package/src/shared/my-uploads/i18n/my-uploads-translation_de-DE.json +7 -7
- package/src/shared/my-uploads/i18n/my-uploads-translation_es-ES.json +7 -7
- package/src/shared/my-uploads/i18n/my-uploads-translation_fr-FR.json +7 -7
- package/src/shared/my-uploads/i18n/my-uploads-translation_pt-PT.json +7 -7
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.ts +5 -24
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.vue +0 -4
- package/src/shared/shape-library/ShapeLibrary.mixin.ts +1 -1
- package/src/shared/style-settings/components/i18n/style-settings-translation_de-DE.json +19 -19
- package/src/shared/style-settings/components/i18n/style-settings-translation_es-ES.json +19 -19
- package/src/shared/style-settings/components/i18n/style-settings-translation_fr-FR.json +19 -19
- package/src/shared/style-settings/components/i18n/style-settings-translation_pt-PT.json +19 -19
- package/lib/src/brand-page/utils/content-callback-util.d.ts +0 -20
- package/lib/src/brand-page/utils/content-callback-util.js +0 -68
- package/lib/src/bundled-translations-BD0Bb2Es.js +0 -113
- package/lib/src/bundled-translations-BQxlwhX6.js +0 -7
- package/lib/src/bundled-translations.de-DE-CVeltNnL.js +0 -7
- package/lib/src/bundled-translations.es-ES-BIl9nBGQ.js +0 -7
- package/lib/src/bundled-translations.fr-FR-D9Bmvesk.js +0 -7
- package/lib/src/bundled-translations.pt-PT-CT1O7aSj.js +0 -7
- package/lib/src/bundled-translations_de-DE-DyL7QVGX.js +0 -113
- package/lib/src/bundled-translations_es-ES-Bz6hwwPA.js +0 -113
- package/lib/src/bundled-translations_fr-FR-BbfayaZA.js +0 -113
- package/lib/src/bundled-translations_pt-PT-BUThkyXf.js +0 -113
- package/src/brand-page/utils/content-callback-util.ts +0 -116
- package/src/brand-page-maker/components/seo-settings/i18n/existing-domain-modal-translation.json +0 -15
- package/src/brand-page-maker/components/seo-settings/i18n/existing-domain-modal-translation_de-DE.json +0 -15
- package/src/brand-page-maker/components/seo-settings/i18n/existing-domain-modal-translation_es-ES.json +0 -15
- package/src/brand-page-maker/components/seo-settings/i18n/existing-domain-modal-translation_fr-FR.json +0 -15
- package/src/brand-page-maker/components/seo-settings/i18n/existing-domain-modal-translation_pt-PT.json +0 -15
|
@@ -2,8 +2,9 @@ import { defineComponent } from 'vue';
|
|
|
2
2
|
import ComponentCommonMixin from '../mixins/component-common.mixin';
|
|
3
3
|
import { isURL } from '../../../utils/validator.util';
|
|
4
4
|
import { ALIGN_CENTERED, ALIGN_LEFT_ALIGNED, ALIGN_RIGHT_ALIGNED, BIG_IMAGE, ALIGN_LEFT_BIG_IMAGE, ALIGN_RIGHT_FULL_IMAGE, ALIGN_LEFT_FULL_IMAGE, ALIGN_CARD_CENTER_IMAGE, ALIGN_CARD_LEFT_IMAGE, } from '../../constants';
|
|
5
|
-
import { getRenderText
|
|
5
|
+
import { getRenderText } from '../../utils';
|
|
6
6
|
import { hasRTEContent } from '../../../brand-page-maker/utils';
|
|
7
|
+
import { escapeContentText } from '../../../shared/content-settings/utils';
|
|
7
8
|
export default defineComponent({
|
|
8
9
|
mixins: [ComponentCommonMixin],
|
|
9
10
|
props: {
|
|
@@ -207,6 +207,11 @@ export declare const BUTTON_LINK_TYPE: {
|
|
|
207
207
|
readonly tel: "tel";
|
|
208
208
|
};
|
|
209
209
|
export type ButtonLinkType = keyof typeof BUTTON_LINK_TYPE;
|
|
210
|
+
export declare const HYPERLINK_TYPE: {
|
|
211
|
+
readonly url: "url";
|
|
212
|
+
readonly page: "page";
|
|
213
|
+
};
|
|
214
|
+
export type HyperlinkType = keyof typeof HYPERLINK_TYPE;
|
|
210
215
|
export declare const URL_TYPE: {
|
|
211
216
|
readonly url: "url";
|
|
212
217
|
readonly email: "email";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { escapeContentText } from '../../
|
|
1
|
+
import { escapeContentText } from '../../shared/content-settings/utils';
|
|
2
2
|
import { DEFAULT_PERSONALISATION_MAPPING, PERSONALISATION_MAPPINGS, TEXT_MEDIA_CONTENT_TYPES, } from '../../brand-page-maker/constants/personalisation.constant';
|
|
3
3
|
import { BRAND_PAGE_TYPES, ShapeAspectRatioCategory } from '../models';
|
|
4
4
|
import { getColorReplacementsFromSvgString, getColorReplacementsFromSvgStringServer, } from './svg-color.util';
|
|
@@ -2,14 +2,3 @@ import { ESCAPED_NEWLINE_CHARACTER } from '../../constants/ui';
|
|
|
2
2
|
export const getRenderText = (text) => {
|
|
3
3
|
return text.replace(new RegExp(`(${ESCAPED_NEWLINE_CHARACTER}|\\n)`, 'g'), '<br/>');
|
|
4
4
|
};
|
|
5
|
-
export const escapeContentText = (text) => {
|
|
6
|
-
if (!text) {
|
|
7
|
-
return text;
|
|
8
|
-
}
|
|
9
|
-
return text
|
|
10
|
-
.replace(/(<([^>]+)>)/gi, '')
|
|
11
|
-
.replace(/(\r\n|\r|\n)/g, ESCAPED_NEWLINE_CHARACTER);
|
|
12
|
-
};
|
|
13
|
-
export const unescapeContentText = (text) => {
|
|
14
|
-
return text.replace(new RegExp(`${ESCAPED_NEWLINE_CHARACTER}`, 'g'), '\n');
|
|
15
|
-
};
|
|
@@ -29,7 +29,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
29
29
|
};
|
|
30
30
|
}>, {
|
|
31
31
|
currentNotificationMessage: import("vue").ComputedRef<false | {
|
|
32
|
-
type: "
|
|
32
|
+
type: "error" | "success" | "warning";
|
|
33
33
|
label: string;
|
|
34
34
|
description: string | false;
|
|
35
35
|
}>;
|
|
@@ -444,7 +444,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
444
444
|
selectedItemIndex?: number | undefined;
|
|
445
445
|
}[];
|
|
446
446
|
selectedItemId: string | null;
|
|
447
|
-
selectedItemEventSource: "
|
|
447
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
448
448
|
selectedItemFieldName: string | null;
|
|
449
449
|
selectedItemValue: string | null;
|
|
450
450
|
selectedItemIndex: number | null;
|
|
@@ -493,7 +493,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
493
493
|
selectedItemIndex?: number | undefined;
|
|
494
494
|
}[];
|
|
495
495
|
selectedItemId: string | null;
|
|
496
|
-
selectedItemEventSource: "
|
|
496
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
497
497
|
selectedItemFieldName: string | null;
|
|
498
498
|
selectedItemValue: string | null;
|
|
499
499
|
selectedItemIndex: number | null;
|
|
@@ -542,7 +542,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
542
542
|
selectedItemIndex?: number | undefined;
|
|
543
543
|
}[];
|
|
544
544
|
selectedItemId: string | null;
|
|
545
|
-
selectedItemEventSource: "
|
|
545
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
546
546
|
selectedItemFieldName: string | null;
|
|
547
547
|
selectedItemValue: string | null;
|
|
548
548
|
selectedItemIndex: number | null;
|
|
@@ -591,7 +591,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
591
591
|
selectedItemIndex?: number | undefined;
|
|
592
592
|
}[];
|
|
593
593
|
selectedItemId: string | null;
|
|
594
|
-
selectedItemEventSource: "
|
|
594
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
595
595
|
selectedItemFieldName: string | null;
|
|
596
596
|
selectedItemValue: string | null;
|
|
597
597
|
selectedItemIndex: number | null;
|
|
@@ -640,7 +640,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
640
640
|
selectedItemIndex?: number | undefined;
|
|
641
641
|
}[];
|
|
642
642
|
selectedItemId: string | null;
|
|
643
|
-
selectedItemEventSource: "
|
|
643
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
644
644
|
selectedItemFieldName: string | null;
|
|
645
645
|
selectedItemValue: string | null;
|
|
646
646
|
selectedItemIndex: number | null;
|
|
@@ -689,7 +689,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
689
689
|
selectedItemIndex?: number | undefined;
|
|
690
690
|
}[];
|
|
691
691
|
selectedItemId: string | null;
|
|
692
|
-
selectedItemEventSource: "
|
|
692
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
693
693
|
selectedItemFieldName: string | null;
|
|
694
694
|
selectedItemValue: string | null;
|
|
695
695
|
selectedItemIndex: number | null;
|
|
@@ -719,7 +719,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
719
719
|
_setItemSettingsFieldErrorState(payload: import("../../../shared/content-settings/models").SetItemSettingsFieldErrorMessagePayload): void;
|
|
720
720
|
_setSelectedItemId({ id, eventSource, }: {
|
|
721
721
|
id: string | null;
|
|
722
|
-
eventSource: "
|
|
722
|
+
eventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
723
723
|
}): void;
|
|
724
724
|
_setSelectedItemFieldName({ name: name }: {
|
|
725
725
|
name: string | null;
|
|
@@ -794,13 +794,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
794
794
|
updateIsDefaultTextColorRequired(): void;
|
|
795
795
|
setSelectedItemId(payload: {
|
|
796
796
|
id: string | null;
|
|
797
|
-
eventSource: "
|
|
797
|
+
eventSource: "contentSettings" | "pageSettings" | "preview";
|
|
798
798
|
}): void;
|
|
799
799
|
setSelectedItemAndFieldName(payload: {
|
|
800
800
|
id: string | null;
|
|
801
801
|
name: string | null;
|
|
802
802
|
index: number | null;
|
|
803
|
-
eventSource: "
|
|
803
|
+
eventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
804
804
|
}): void;
|
|
805
805
|
setSelectedItemValue(payload: {
|
|
806
806
|
value: string | null;
|
|
@@ -906,7 +906,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
906
906
|
}): void;
|
|
907
907
|
setPageSettingsSectionValue({ sectionName, propName, index, value, merge, viewport, }: {
|
|
908
908
|
sectionName: "footer" | "header" | "pages";
|
|
909
|
-
propName: "copyrightStyle" | "style" | "iconStyle" | "displayStyle" | "backgroundStyle" | "logoImage" | "logoImageStyle" | "isLogoOptional" | "viewport" | "isLogoVisible" | "logoTemplateImage" | "logoImageHeight" | "logoImageWidth" | "navigationStyles" | "
|
|
909
|
+
propName: "navigation" | "copyrightStyle" | "style" | "iconStyle" | "displayStyle" | "backgroundStyle" | "logoImage" | "logoImageStyle" | "isLogoOptional" | "viewport" | "isLogoVisible" | "logoTemplateImage" | "logoImageHeight" | "logoImageWidth" | "navigationStyles" | "logoImageUrl" | "logoDraftToken" | "logoVariation" | "logoImageBase64Url" | "backgroundColorEnabled" | "copyrightText" | "socialLinks" | "textFontFamily";
|
|
910
910
|
index?: number | undefined;
|
|
911
911
|
value: string | number | boolean | BrandPageCssStyle | import("../../../brand-page").LinksItem[] | Partial<import("../../../brand-page").ImageItem> | null | undefined;
|
|
912
912
|
merge?: boolean | undefined;
|
package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
28
28
|
};
|
|
29
29
|
}[]>;
|
|
30
30
|
selectedItemId: import("vue").ComputedRef<string | null>;
|
|
31
|
-
selectedItemEventSource: import("vue").ComputedRef<"
|
|
31
|
+
selectedItemEventSource: import("vue").ComputedRef<"contentSettings" | "pageSettings" | "preview" | null>;
|
|
32
32
|
viewport: import("vue").ComputedRef<import("../../../brand-page").ViewportsType>;
|
|
33
33
|
isMobileDevice: import("vue").ComputedRef<boolean>;
|
|
34
34
|
brandPageToken: import("vue").ComputedRef<string | undefined>;
|
|
@@ -82,7 +82,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
82
82
|
selectedItemIndex?: number | undefined;
|
|
83
83
|
}[];
|
|
84
84
|
selectedItemId: string | null;
|
|
85
|
-
selectedItemEventSource: "
|
|
85
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
86
86
|
selectedItemFieldName: string | null;
|
|
87
87
|
selectedItemValue: string | null;
|
|
88
88
|
selectedItemIndex: number | null;
|
|
@@ -131,7 +131,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
131
131
|
selectedItemIndex?: number | undefined;
|
|
132
132
|
}[];
|
|
133
133
|
selectedItemId: string | null;
|
|
134
|
-
selectedItemEventSource: "
|
|
134
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
135
135
|
selectedItemFieldName: string | null;
|
|
136
136
|
selectedItemValue: string | null;
|
|
137
137
|
selectedItemIndex: number | null;
|
|
@@ -180,7 +180,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
180
180
|
selectedItemIndex?: number | undefined;
|
|
181
181
|
}[];
|
|
182
182
|
selectedItemId: string | null;
|
|
183
|
-
selectedItemEventSource: "
|
|
183
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
184
184
|
selectedItemFieldName: string | null;
|
|
185
185
|
selectedItemValue: string | null;
|
|
186
186
|
selectedItemIndex: number | null;
|
|
@@ -229,7 +229,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
229
229
|
selectedItemIndex?: number | undefined;
|
|
230
230
|
}[];
|
|
231
231
|
selectedItemId: string | null;
|
|
232
|
-
selectedItemEventSource: "
|
|
232
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
233
233
|
selectedItemFieldName: string | null;
|
|
234
234
|
selectedItemValue: string | null;
|
|
235
235
|
selectedItemIndex: number | null;
|
|
@@ -278,7 +278,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
278
278
|
selectedItemIndex?: number | undefined;
|
|
279
279
|
}[];
|
|
280
280
|
selectedItemId: string | null;
|
|
281
|
-
selectedItemEventSource: "
|
|
281
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
282
282
|
selectedItemFieldName: string | null;
|
|
283
283
|
selectedItemValue: string | null;
|
|
284
284
|
selectedItemIndex: number | null;
|
|
@@ -327,7 +327,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
327
327
|
selectedItemIndex?: number | undefined;
|
|
328
328
|
}[];
|
|
329
329
|
selectedItemId: string | null;
|
|
330
|
-
selectedItemEventSource: "
|
|
330
|
+
selectedItemEventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
331
331
|
selectedItemFieldName: string | null;
|
|
332
332
|
selectedItemValue: string | null;
|
|
333
333
|
selectedItemIndex: number | null;
|
|
@@ -357,7 +357,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
357
357
|
_setItemSettingsFieldErrorState(payload: import("../../../shared/content-settings/models").SetItemSettingsFieldErrorMessagePayload): void;
|
|
358
358
|
_setSelectedItemId({ id, eventSource, }: {
|
|
359
359
|
id: string | null;
|
|
360
|
-
eventSource: "
|
|
360
|
+
eventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
361
361
|
}): void;
|
|
362
362
|
_setSelectedItemFieldName({ name: name }: {
|
|
363
363
|
name: string | null;
|
|
@@ -432,13 +432,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
432
432
|
updateIsDefaultTextColorRequired(): void;
|
|
433
433
|
setSelectedItemId(payload: {
|
|
434
434
|
id: string | null;
|
|
435
|
-
eventSource: "
|
|
435
|
+
eventSource: "contentSettings" | "pageSettings" | "preview";
|
|
436
436
|
}): void;
|
|
437
437
|
setSelectedItemAndFieldName(payload: {
|
|
438
438
|
id: string | null;
|
|
439
439
|
name: string | null;
|
|
440
440
|
index: number | null;
|
|
441
|
-
eventSource: "
|
|
441
|
+
eventSource: "contentSettings" | "pageSettings" | "preview" | null;
|
|
442
442
|
}): void;
|
|
443
443
|
setSelectedItemValue(payload: {
|
|
444
444
|
value: string | null;
|
|
@@ -890,7 +890,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
890
890
|
}): void;
|
|
891
891
|
setPageSettingsSectionValue({ sectionName, propName, index, value, merge, viewport, }: {
|
|
892
892
|
sectionName: "footer" | "header" | "pages";
|
|
893
|
-
propName: "copyrightStyle" | "style" | "iconStyle" | "displayStyle" | "backgroundStyle" | "logoImage" | "logoImageStyle" | "isLogoOptional" | "viewport" | "isLogoVisible" | "logoTemplateImage" | "logoImageHeight" | "logoImageWidth" | "navigationStyles" | "
|
|
893
|
+
propName: "navigation" | "copyrightStyle" | "style" | "iconStyle" | "displayStyle" | "backgroundStyle" | "logoImage" | "logoImageStyle" | "isLogoOptional" | "viewport" | "isLogoVisible" | "logoTemplateImage" | "logoImageHeight" | "logoImageWidth" | "navigationStyles" | "logoImageUrl" | "logoDraftToken" | "logoVariation" | "logoImageBase64Url" | "backgroundColorEnabled" | "copyrightText" | "socialLinks" | "textFontFamily";
|
|
894
894
|
index?: number | undefined;
|
|
895
895
|
value: string | number | boolean | BrandPageCssStyle | import("../../../brand-page").LinksItem[] | Partial<import("../../../brand-page").ImageItem> | null | undefined;
|
|
896
896
|
merge?: boolean | undefined;
|
|
@@ -963,7 +963,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
963
963
|
defaultTextColor(): string | undefined;
|
|
964
964
|
logoBackgroundColor(): string | undefined;
|
|
965
965
|
selectedButtonStyleConfig(): import("../../models").ButtonStyleConfig | undefined;
|
|
966
|
-
selectedTextFontFamily(): "lato" | "roboto" | "notoSans" | "openSans" | "arvo" | "bebasNeue" | "ptSerif" | "oswald" | "inter" | "montserrat" | "raleway" | "anton" | "antonSc" | "quicksand" | "pacifico" | "bioRhyme" | "playfairDisplay" | "mulish" | "telex" | "pridi" | "hindMadurai" | "kanit" | "libreBaskerville" | "amiko" | "neuton" | "tenorSans" | "jacquesFrancois" | "varela" | "quattrocentoSans" | "workSans" | "titilliumWeb" | "amaticSc" | "poiretOne" | "shantellSans" | "dancingScript" | "tangerine" | "cinzel" | "jost" | "exo2" | "ebGaramond" | "ubuntu" | "cabin" | "josefinSans" | "lobsterTwo" | "sacramento" | "nunito" | "aboreto" | "aleo" | "abhayaLibre" | "caladea" | "rokkitt" | "rubik" | "frankRuhlLibre" | "spectral" | "abrilFatface" | "courgette" | "kiteOne" | "amarante" | "satisfy" | "lilitaOne" | "lobster" | "titanOne" | "
|
|
966
|
+
selectedTextFontFamily(): "cookie" | "lato" | "roboto" | "notoSans" | "openSans" | "arvo" | "bebasNeue" | "ptSerif" | "oswald" | "inter" | "montserrat" | "raleway" | "anton" | "antonSc" | "quicksand" | "pacifico" | "bioRhyme" | "playfairDisplay" | "mulish" | "telex" | "pridi" | "hindMadurai" | "kanit" | "libreBaskerville" | "amiko" | "neuton" | "tenorSans" | "jacquesFrancois" | "varela" | "quattrocentoSans" | "workSans" | "titilliumWeb" | "amaticSc" | "poiretOne" | "shantellSans" | "dancingScript" | "tangerine" | "cinzel" | "jost" | "exo2" | "ebGaramond" | "ubuntu" | "cabin" | "josefinSans" | "lobsterTwo" | "sacramento" | "nunito" | "aboreto" | "aleo" | "abhayaLibre" | "caladea" | "rokkitt" | "rubik" | "frankRuhlLibre" | "spectral" | "abrilFatface" | "courgette" | "kiteOne" | "amarante" | "satisfy" | "lilitaOne" | "lobster" | "titanOne" | "bungee" | "poppins" | "staatliches" | "patuaOne" | "calistoga" | "suezOne" | "caprasimo" | "rubikMonoOne" | "silkscreen" | "alfaSlabOne" | "orelegaOne" | "audiowide" | "redRose" | "kalnia" | "imbue" | "climateCrisis" | "gluten" | "madimiOne" | "anta" | "trykker" | "moul" | "bevan" | "wendyOne" | "lexendDeca" | "vinaSans" | "chango" | "changaOne" | "protestGuerrilla" | "londrinaShadow" | "candal" | "borel" | "rockNRollOne" | "bungeeInline" | "rampartOne" | "manrope" | "yuseiMagic" | "patrickHandSC" | "farsan" | "handlee" | "lemonada" | "arsenal" | "bakbakOne" | "belleza" | "blackHanSans" | "bowlbyOne" | "brunoAceSC" | "castoroTitling" | "contrailOne" | "delaGothicOne" | "dotGothic16" | "fahkwang" | "francoisOne" | "gloock" | "graduate" | "jersey10" | "kavoon" | "kronaOne" | "notable" | "pavanam" | "phudu" | "poetsenOne" | "pollerOne" | "questrial" | "racingSansOne" | "rammettoOne" | "rubikGlitch" | "shrikhand" | "spicyRice" | "syncopate" | "urbanist" | "yesevaOne" | "zenDots";
|
|
967
967
|
doesLogoHaveBackground(): boolean;
|
|
968
968
|
activeLogoStyles(): import("../../../brand-page").LogoStyles;
|
|
969
969
|
}, {
|
|
@@ -987,7 +987,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
987
987
|
id: string;
|
|
988
988
|
}): void;
|
|
989
989
|
_setTextFontFamily(payload: {
|
|
990
|
-
fontFamily: "lato" | "roboto" | "notoSans" | "openSans" | "arvo" | "bebasNeue" | "ptSerif" | "oswald" | "inter" | "montserrat" | "raleway" | "anton" | "antonSc" | "quicksand" | "pacifico" | "bioRhyme" | "playfairDisplay" | "mulish" | "telex" | "pridi" | "hindMadurai" | "kanit" | "libreBaskerville" | "amiko" | "neuton" | "tenorSans" | "jacquesFrancois" | "varela" | "quattrocentoSans" | "workSans" | "titilliumWeb" | "amaticSc" | "poiretOne" | "shantellSans" | "dancingScript" | "tangerine" | "cinzel" | "jost" | "exo2" | "ebGaramond" | "ubuntu" | "cabin" | "josefinSans" | "lobsterTwo" | "sacramento" | "nunito" | "aboreto" | "aleo" | "abhayaLibre" | "caladea" | "rokkitt" | "rubik" | "frankRuhlLibre" | "spectral" | "abrilFatface" | "courgette" | "kiteOne" | "amarante" | "satisfy" | "lilitaOne" | "lobster" | "titanOne" | "
|
|
990
|
+
fontFamily: "cookie" | "lato" | "roboto" | "notoSans" | "openSans" | "arvo" | "bebasNeue" | "ptSerif" | "oswald" | "inter" | "montserrat" | "raleway" | "anton" | "antonSc" | "quicksand" | "pacifico" | "bioRhyme" | "playfairDisplay" | "mulish" | "telex" | "pridi" | "hindMadurai" | "kanit" | "libreBaskerville" | "amiko" | "neuton" | "tenorSans" | "jacquesFrancois" | "varela" | "quattrocentoSans" | "workSans" | "titilliumWeb" | "amaticSc" | "poiretOne" | "shantellSans" | "dancingScript" | "tangerine" | "cinzel" | "jost" | "exo2" | "ebGaramond" | "ubuntu" | "cabin" | "josefinSans" | "lobsterTwo" | "sacramento" | "nunito" | "aboreto" | "aleo" | "abhayaLibre" | "caladea" | "rokkitt" | "rubik" | "frankRuhlLibre" | "spectral" | "abrilFatface" | "courgette" | "kiteOne" | "amarante" | "satisfy" | "lilitaOne" | "lobster" | "titanOne" | "bungee" | "poppins" | "staatliches" | "patuaOne" | "calistoga" | "suezOne" | "caprasimo" | "rubikMonoOne" | "silkscreen" | "alfaSlabOne" | "orelegaOne" | "audiowide" | "redRose" | "kalnia" | "imbue" | "climateCrisis" | "gluten" | "madimiOne" | "anta" | "trykker" | "moul" | "bevan" | "wendyOne" | "lexendDeca" | "vinaSans" | "chango" | "changaOne" | "protestGuerrilla" | "londrinaShadow" | "candal" | "borel" | "rockNRollOne" | "bungeeInline" | "rampartOne" | "manrope" | "yuseiMagic" | "patrickHandSC" | "farsan" | "handlee" | "lemonada" | "arsenal" | "bakbakOne" | "belleza" | "blackHanSans" | "bowlbyOne" | "brunoAceSC" | "castoroTitling" | "contrailOne" | "delaGothicOne" | "dotGothic16" | "fahkwang" | "francoisOne" | "gloock" | "graduate" | "jersey10" | "kavoon" | "kronaOne" | "notable" | "pavanam" | "phudu" | "poetsenOne" | "pollerOne" | "questrial" | "racingSansOne" | "rammettoOne" | "rubikGlitch" | "shrikhand" | "spicyRice" | "syncopate" | "urbanist" | "yesevaOne" | "zenDots";
|
|
991
991
|
}): void;
|
|
992
992
|
_setTextStyles(payload: Partial<import("../../../brand-page").TextStyles>): void;
|
|
993
993
|
setAdminStyleOptionDefaultValues(): void;
|
|
@@ -1013,7 +1013,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
1013
1013
|
id: string;
|
|
1014
1014
|
}): void;
|
|
1015
1015
|
setTextFontFamily(payload: {
|
|
1016
|
-
fontFamily: "lato" | "roboto" | "notoSans" | "openSans" | "arvo" | "bebasNeue" | "ptSerif" | "oswald" | "inter" | "montserrat" | "raleway" | "anton" | "antonSc" | "quicksand" | "pacifico" | "bioRhyme" | "playfairDisplay" | "mulish" | "telex" | "pridi" | "hindMadurai" | "kanit" | "libreBaskerville" | "amiko" | "neuton" | "tenorSans" | "jacquesFrancois" | "varela" | "quattrocentoSans" | "workSans" | "titilliumWeb" | "amaticSc" | "poiretOne" | "shantellSans" | "dancingScript" | "tangerine" | "cinzel" | "jost" | "exo2" | "ebGaramond" | "ubuntu" | "cabin" | "josefinSans" | "lobsterTwo" | "sacramento" | "nunito" | "aboreto" | "aleo" | "abhayaLibre" | "caladea" | "rokkitt" | "rubik" | "frankRuhlLibre" | "spectral" | "abrilFatface" | "courgette" | "kiteOne" | "amarante" | "satisfy" | "lilitaOne" | "lobster" | "titanOne" | "
|
|
1016
|
+
fontFamily: "cookie" | "lato" | "roboto" | "notoSans" | "openSans" | "arvo" | "bebasNeue" | "ptSerif" | "oswald" | "inter" | "montserrat" | "raleway" | "anton" | "antonSc" | "quicksand" | "pacifico" | "bioRhyme" | "playfairDisplay" | "mulish" | "telex" | "pridi" | "hindMadurai" | "kanit" | "libreBaskerville" | "amiko" | "neuton" | "tenorSans" | "jacquesFrancois" | "varela" | "quattrocentoSans" | "workSans" | "titilliumWeb" | "amaticSc" | "poiretOne" | "shantellSans" | "dancingScript" | "tangerine" | "cinzel" | "jost" | "exo2" | "ebGaramond" | "ubuntu" | "cabin" | "josefinSans" | "lobsterTwo" | "sacramento" | "nunito" | "aboreto" | "aleo" | "abhayaLibre" | "caladea" | "rokkitt" | "rubik" | "frankRuhlLibre" | "spectral" | "abrilFatface" | "courgette" | "kiteOne" | "amarante" | "satisfy" | "lilitaOne" | "lobster" | "titanOne" | "bungee" | "poppins" | "staatliches" | "patuaOne" | "calistoga" | "suezOne" | "caprasimo" | "rubikMonoOne" | "silkscreen" | "alfaSlabOne" | "orelegaOne" | "audiowide" | "redRose" | "kalnia" | "imbue" | "climateCrisis" | "gluten" | "madimiOne" | "anta" | "trykker" | "moul" | "bevan" | "wendyOne" | "lexendDeca" | "vinaSans" | "chango" | "changaOne" | "protestGuerrilla" | "londrinaShadow" | "candal" | "borel" | "rockNRollOne" | "bungeeInline" | "rampartOne" | "manrope" | "yuseiMagic" | "patrickHandSC" | "farsan" | "handlee" | "lemonada" | "arsenal" | "bakbakOne" | "belleza" | "blackHanSans" | "bowlbyOne" | "brunoAceSC" | "castoroTitling" | "contrailOne" | "delaGothicOne" | "dotGothic16" | "fahkwang" | "francoisOne" | "gloock" | "graduate" | "jersey10" | "kavoon" | "kronaOne" | "notable" | "pavanam" | "phudu" | "poetsenOne" | "pollerOne" | "questrial" | "racingSansOne" | "rammettoOne" | "rubikGlitch" | "shrikhand" | "spicyRice" | "syncopate" | "urbanist" | "yesevaOne" | "zenDots";
|
|
1017
1017
|
}): Promise<void>;
|
|
1018
1018
|
toggleLogoBackground(): Promise<any>;
|
|
1019
1019
|
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
export declare const useBubbleMenu: (editor: Editor, isHyperlinkPopupOpen?: Ref<boolean>) => {
|
|
4
|
+
shouldShow: ({ editor, state }: {
|
|
5
|
+
editor: any;
|
|
6
|
+
state: any;
|
|
7
|
+
}) => any;
|
|
8
|
+
tippyOptions: {
|
|
9
|
+
duration: number;
|
|
10
|
+
placement: "bottom";
|
|
11
|
+
interactive: boolean;
|
|
12
|
+
appendTo: "parent";
|
|
13
|
+
hideOnClick: boolean;
|
|
14
|
+
arrow: boolean;
|
|
15
|
+
offset: [number, number];
|
|
16
|
+
trigger: "manual";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const useBubbleMenu = (editor, isHyperlinkPopupOpen) => {
|
|
2
|
+
const shouldShow = ({ editor, state }) => {
|
|
3
|
+
if (!editor || !state)
|
|
4
|
+
return false;
|
|
5
|
+
// Hide preview popup if the hyperlink popup is open
|
|
6
|
+
if (isHyperlinkPopupOpen?.value)
|
|
7
|
+
return false;
|
|
8
|
+
const { selection } = state;
|
|
9
|
+
// Only show bubble menu if there's a selection and it contains a link
|
|
10
|
+
if (!selection.empty) {
|
|
11
|
+
const linkAttrs = editor.getAttributes('link');
|
|
12
|
+
return linkAttrs.href && linkAttrs.href.trim() !== '';
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
16
|
+
const tippyOptions = {
|
|
17
|
+
duration: 100,
|
|
18
|
+
placement: 'bottom',
|
|
19
|
+
interactive: true,
|
|
20
|
+
appendTo: 'parent',
|
|
21
|
+
hideOnClick: false,
|
|
22
|
+
arrow: false,
|
|
23
|
+
offset: [0, 10],
|
|
24
|
+
trigger: 'manual',
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
shouldShow,
|
|
28
|
+
tippyOptions,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
export declare const useHyperlink: (editor: Editor) => {
|
|
3
|
+
hyperlinkValue: import("vue").WritableComputedRef<{
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}, {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}>;
|
|
12
|
+
setHyperlinkUrl: (url: string) => void;
|
|
13
|
+
setHyperlinkUrlValue: (url: string) => void;
|
|
14
|
+
removeHyperlink: (clearUrlValue?: boolean) => void;
|
|
15
|
+
applyHyperlinkToEditor: (url: string, text?: string, selection?: {
|
|
16
|
+
from: number;
|
|
17
|
+
to: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ref, computed } from 'vue';
|
|
2
|
+
export const useHyperlink = (editor) => {
|
|
3
|
+
const hyperlinkUrl = ref('');
|
|
4
|
+
const setHyperlinkUrl = (url) => {
|
|
5
|
+
const safeUrl = typeof url === 'string' ? url : '';
|
|
6
|
+
hyperlinkUrl.value = safeUrl;
|
|
7
|
+
editor
|
|
8
|
+
.chain()
|
|
9
|
+
.focus()
|
|
10
|
+
.setLink({ href: safeUrl })
|
|
11
|
+
.setUnderline()
|
|
12
|
+
.setColor('#0097d7')
|
|
13
|
+
.run();
|
|
14
|
+
};
|
|
15
|
+
const setHyperlinkUrlValue = (url) => {
|
|
16
|
+
const href = typeof url === 'string' ? url : '';
|
|
17
|
+
hyperlinkUrl.value = href;
|
|
18
|
+
};
|
|
19
|
+
const hyperlinkValue = computed({
|
|
20
|
+
get: () => ({
|
|
21
|
+
id: 'id',
|
|
22
|
+
name: 'url',
|
|
23
|
+
value: hyperlinkUrl.value,
|
|
24
|
+
}),
|
|
25
|
+
set: (v) => {
|
|
26
|
+
setHyperlinkUrl(v?.value || '');
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const applyHyperlinkToEditor = (url, text, selection) => {
|
|
30
|
+
const selectedText = editor.chain().focus();
|
|
31
|
+
// If text is provided, replace the content
|
|
32
|
+
if (text && text.trim()) {
|
|
33
|
+
selectedText.deleteSelection().insertContent(text);
|
|
34
|
+
const currentPos = selection?.from || editor.state.selection.from;
|
|
35
|
+
selectedText.setTextSelection({
|
|
36
|
+
from: currentPos,
|
|
37
|
+
to: currentPos + text.length,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
selectedText
|
|
41
|
+
.setLink({ href: url })
|
|
42
|
+
.setUnderline()
|
|
43
|
+
.setColor('#0097d7')
|
|
44
|
+
.run();
|
|
45
|
+
};
|
|
46
|
+
const removeHyperlink = (clearUrlValue = false) => {
|
|
47
|
+
editor.chain().focus().unsetLink().unsetUnderline().unsetColor().run();
|
|
48
|
+
// Clear the hyperlink URL value if requested
|
|
49
|
+
if (clearUrlValue) {
|
|
50
|
+
setHyperlinkUrlValue('');
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
hyperlinkValue,
|
|
55
|
+
setHyperlinkUrl,
|
|
56
|
+
setHyperlinkUrlValue,
|
|
57
|
+
removeHyperlink,
|
|
58
|
+
applyHyperlinkToEditor,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/vue-3';
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
2
|
export declare const useSpacing: (editor: Editor) => {
|
|
3
3
|
letterSpacingValue: import("vue").WritableComputedRef<string, string>;
|
|
4
4
|
lineHeightValue: import("vue").WritableComputedRef<string, string>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ref, computed } from 'vue';
|
|
2
|
-
import { Editor } from '@tiptap/vue-3';
|
|
3
2
|
import debounce from 'lodash/debounce';
|
|
4
3
|
import { letterSpacingValueConvertor } from '../../../brand-page-maker/convertors';
|
|
5
4
|
import { skipStyleDetection } from '../../../brand-page-maker/utils';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ModelRef, type ComputedRef, type Ref, type WritableComputedRef } from 'vue';
|
|
2
2
|
import { Editor } from '@tiptap/vue-3';
|
|
3
3
|
import type { StyleTextFontFamilyOption } from '../../../shared/style-settings/models';
|
|
4
|
-
import { TextStyles
|
|
4
|
+
import type { TextStyles } from '../../../brand-page';
|
|
5
|
+
import { type TextItem, type TextStyleDeclaration } from '../../../brand-page';
|
|
5
6
|
import type { ButtonGroupOption } from '../../../brand-page-maker/models/button-group.model';
|
|
6
7
|
interface UseRichTextEditorReturn {
|
|
7
8
|
editor: Editor;
|
|
@@ -28,12 +29,27 @@ interface UseRichTextEditorReturn {
|
|
|
28
29
|
setInitialStyleSettings: (selectedTextStyle?: BrandPageCssStyle) => void;
|
|
29
30
|
copyGlobalStyleSettings: (selectedTextStyle?: BrandPageCssStyle) => void;
|
|
30
31
|
unsetAllMarks: () => void;
|
|
32
|
+
handleHyperlink: (action: 'toggle' | 'apply' | 'remove', data?: {
|
|
33
|
+
href?: string;
|
|
34
|
+
text?: string;
|
|
35
|
+
}) => void;
|
|
36
|
+
hyperlinkValue: ComputedRef<{
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
value: string;
|
|
40
|
+
}>;
|
|
41
|
+
setHyperlinkUrlValue: (url: string) => void;
|
|
42
|
+
shouldShow: ({ editor, state }: {
|
|
43
|
+
editor: any;
|
|
44
|
+
state: any;
|
|
45
|
+
}) => boolean;
|
|
46
|
+
tippyOptions: Record<string, any>;
|
|
31
47
|
}
|
|
32
48
|
interface DropdownInstance {
|
|
33
49
|
hideMenu: () => void;
|
|
34
50
|
}
|
|
35
51
|
interface EditorOptionType {
|
|
36
|
-
type: 'fontFamily' | 'fontSize' | 'fontWeight' | 'fontStyle' | 'textDecorationLine' | 'textDecorationStrike' | 'textColor' | 'backgroundColor' | 'lineHeight' | 'letterSpacing' | 'textAlign';
|
|
52
|
+
type: 'hyperlink' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'fontStyle' | 'textDecorationLine' | 'textDecorationStrike' | 'textColor' | 'backgroundColor' | 'lineHeight' | 'letterSpacing' | 'textAlign';
|
|
37
53
|
value: string | StyleTextFontFamilyOption;
|
|
38
54
|
}
|
|
39
55
|
export declare const useExternalRichTextEditor: () => {
|
|
@@ -56,5 +72,5 @@ export declare const useRichTextEditor: (model: ModelRef<any>, props: {
|
|
|
56
72
|
selectedFontSizePx: number;
|
|
57
73
|
selectedTextColor: string;
|
|
58
74
|
selectedBackgroundColor: string;
|
|
59
|
-
}, fontStyleDropdownRef: Ref<DropdownInstance | undefined, DropdownInstance | undefined>, selectedGlobalTextStyles: WritableComputedRef<TextStyles, string>, onSelectTextStyleType: (option: ButtonGroupOption) => void, updateRichTextEditor: Ref<boolean>, textStyleTypeOptions: ButtonGroupOption[]) => UseRichTextEditorReturn;
|
|
75
|
+
}, fontStyleDropdownRef: Ref<DropdownInstance | undefined, DropdownInstance | undefined>, selectedGlobalTextStyles: WritableComputedRef<TextStyles, string>, onSelectTextStyleType: (option: ButtonGroupOption) => void, updateRichTextEditor: Ref<boolean>, textStyleTypeOptions: ButtonGroupOption[], markedText: Ref<string>, isHyperlinkPopupOpen: Ref<boolean>) => UseRichTextEditorReturn;
|
|
60
76
|
export {};
|