@designcrowd/library.brand-page 5.14.11 → 5.14.12
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-BJ3Foxao.js → CreatedOnBrandCrowd-de-de-C5tl1NwD.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-BjI_fxWY.js → CreatedOnBrandCrowd-en-us-C7J2vGwU.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-Dt8190BK.js → CreatedOnBrandCrowd-es-es-IREekVx2.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-Ck6zCiIn.js → CreatedOnBrandCrowd-fr-fr-EJkAJ0iH.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CaNvmzQJ.js → CreatedOnBrandCrowd-pt-pt-mKBH6Ary.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DMEecXw8.js → CreatedOnDcom-de-de-CWWw2LBb.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BZIPLMxJ.js → CreatedOnDcom-en-us-Db6zzKtc.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-D6ey1TnI.js → CreatedOnDcom-es-es-CsMu_iBW.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-NaeiDsv-.js → CreatedOnDcom-fr-fr-oJRc8eop.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BwEUUii2.js → CreatedOnDcom-pt-pt-CQ_otC6l.js} +1 -1
- package/lib/src/brand-page/components/button/Button.mixin.js +4 -2
- package/lib/src/brand-page/models/index.d.ts +9 -2
- package/lib/src/brand-page/utils/migration/migration-06.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-06.js +48 -0
- package/lib/src/brand-page/utils/migration.util.js +6 -0
- package/lib/src/brand-page/utils/view-model.util.js +49 -11
- package/lib/src/brand-page/view-models.d.ts +10 -3
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +8 -1
- package/lib/src/brand-page-maker/models/content-settings.js +7 -1
- package/lib/src/{bundled-translations-B54196Rf.js → bundled-translations-fWikWTfa.js} +15 -15
- package/lib/src/{bundled-translations.de-DE-CNESUsYJ.js → bundled-translations.de-DE-CwtsRCCr.js} +33 -33
- package/lib/src/{bundled-translations.es-ES-FWge029M.js → bundled-translations.es-ES-DELCLCbF.js} +9 -9
- package/lib/src/{bundled-translations.fr-CA-DlWfm29N.js → bundled-translations.fr-CA-PDBhYlx8.js} +17 -17
- package/lib/src/{bundled-translations.fr-FR-DRCMzVfh.js → bundled-translations.fr-FR-OuZj3i-r.js} +24 -24
- package/lib/src/{bundled-translations.pt-BR-llUnBWoL.js → bundled-translations.pt-BR-RPfprZOm.js} +36 -36
- package/lib/src/{bundled-translations.pt-PT-K74Dt682.js → bundled-translations.pt-PT-DF_GCXSl.js} +5 -5
- package/lib/src/bundles/bundled-translations.de-DE.json +18 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +18 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +18 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +18 -2
- package/lib/src/bundles/bundled-translations.json +18 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +18 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +18 -2
- package/lib/src/css/library.brand-page-brandCrowd.min.css +31 -28
- package/lib/src/css/library.brand-page-brandPage.min.css +31 -28
- package/lib/src/css/library.brand-page-designCom.min.css +31 -28
- package/lib/src/css/library.brand-page-preview.min.css +31 -28
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-C0mkZ8UD.js → lib-CwoD7AhY.js} +26687 -26581
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.js +3 -3
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -2
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -2
- package/package.json +1 -1
- package/src/brand-page/components/button/Button.mixin.ts +4 -2
- package/src/brand-page/components/fallback-image/FallbackImage.vue +1 -1
- package/src/brand-page/components/image/Image.vue +1 -1
- package/src/brand-page/components/images-section/ImagesSection.test.ts +230 -0
- package/src/brand-page/components/images-section/ImagesSection.vue +185 -18
- package/src/brand-page/components/shapes-section/ShapesSection.vue +19 -9
- package/src/brand-page/components/text-media-section/TextMediaSection.vue +166 -7
- package/src/brand-page/models/index.ts +10 -2
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
- package/src/brand-page/utils/migration/migration-06.ts +64 -0
- package/src/brand-page/utils/migration.util.ts +6 -0
- package/src/brand-page/utils/view-model.util.ts +62 -13
- package/src/brand-page/view-models.ts +8 -2
- package/src/brand-page-maker/constants/config-settings-constant.ts +7 -1
- package/src/brand-page-maker/models/content-settings.ts +7 -1
- package/src/bundles/bundled-translations.de-DE.json +18 -2
- package/src/bundles/bundled-translations.es-ES.json +18 -2
- package/src/bundles/bundled-translations.fr-CA.json +18 -2
- package/src/bundles/bundled-translations.fr-FR.json +18 -2
- package/src/bundles/bundled-translations.json +18 -2
- package/src/bundles/bundled-translations.pt-BR.json +18 -2
- package/src/bundles/bundled-translations.pt-PT.json +18 -2
- package/src/shared/content-settings/components/button-configuration-field/ButtonConfigurationField.vue +283 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +1 -0
- package/src/shared/content-settings/components/items-field/ItemsField.mixin.ts +3 -3
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +428 -92
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.de-DE.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.es-ES.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.fr-CA.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.fr-FR.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.json +18 -2
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.pt-BR.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.pt-PT.json +18 -3
- package/lib/src/brand-page/components/images-section/ImagesSection.mixin.d.ts +0 -86
- package/lib/src/brand-page/components/images-section/ImagesSection.mixin.js +0 -149
- package/lib/src/brand-page/components/shapes-section/ShapesSection.mixin.d.ts +0 -62
- package/lib/src/brand-page/components/shapes-section/ShapesSection.mixin.js +0 -25
- package/lib/src/brand-page/components/text-media-section/TextMediaSection.mixin.d.ts +0 -66
- package/lib/src/brand-page/components/text-media-section/TextMediaSection.mixin.js +0 -90
- package/lib/src/shared/content-settings/components/text-image-field/TextImageField.mixin.d.ts +0 -126
- package/lib/src/shared/content-settings/components/text-image-field/TextImageField.mixin.js +0 -192
- package/src/brand-page/components/images-section/ImagesSection.mixin.ts +0 -183
- package/src/brand-page/components/shapes-section/ShapesSection.mixin.ts +0 -29
- package/src/brand-page/components/text-media-section/TextMediaSection.mixin.ts +0 -124
- package/src/shared/content-settings/components/text-image-field/TextImageField.mixin.ts +0 -252
|
@@ -528,6 +528,7 @@
|
|
|
528
528
|
"sendPlaceholder": "Envoyer",
|
|
529
529
|
"formSuccessMessage": "Merci ! Nous vous contacterons dès que possible.",
|
|
530
530
|
"fullWidthLabel": "Pleine largeur",
|
|
531
|
+
"enablePopupLabel": "Ouvrir des images dans un pop-up",
|
|
531
532
|
"autoplayLabel": "Lecture automatique",
|
|
532
533
|
"muteLabel": "Muet",
|
|
533
534
|
"headingStyleLabel": "Style de titre",
|
|
@@ -643,14 +644,29 @@
|
|
|
643
644
|
"shapeColor": "Couleur de forme",
|
|
644
645
|
"imageCaptionPlaceholder": "Ajouter une légende d'image",
|
|
645
646
|
"imageLink": "Lien d'image",
|
|
646
|
-
"imageCaption": "Légende
|
|
647
|
+
"imageCaption": "Légende du pop-up des images",
|
|
648
|
+
"imageCaptionSub": "Cette légende n'apparaît que dans le pop-up des images",
|
|
647
649
|
"addTitlePlaceholder": "Ajouter un titre",
|
|
648
650
|
"title": "Titre",
|
|
649
651
|
"addParagraphPlaceholder": "Ajouter un paragraphe",
|
|
650
652
|
"paragraph": "Paragraphe",
|
|
651
653
|
"addItemLabel": "Ajouter un élément",
|
|
652
654
|
"image": "Image",
|
|
653
|
-
"shape": "Forme"
|
|
655
|
+
"shape": "Forme",
|
|
656
|
+
"none": "Aucune",
|
|
657
|
+
"popup": "Pop-up",
|
|
658
|
+
"openLink": "Ouvrir le lien",
|
|
659
|
+
"imageBehaviour": "Comportement de l’image",
|
|
660
|
+
"button": "Bouton",
|
|
661
|
+
"buttonText": "Texte du bouton",
|
|
662
|
+
"getStarted": "Commencez",
|
|
663
|
+
"buttonLink": "Lien de bouton",
|
|
664
|
+
"url": "Url",
|
|
665
|
+
"email": "Adresse e-mail",
|
|
666
|
+
"telephone": "Numéro de téléphone",
|
|
667
|
+
"buttonTextStyleLabel": "Style de texte des boutons",
|
|
668
|
+
"selectPage": "Sélectionnez une page",
|
|
669
|
+
"page": "Page"
|
|
654
670
|
},
|
|
655
671
|
"textItemsField": {
|
|
656
672
|
"fontSettings": "Paramètres de police",
|
|
@@ -528,6 +528,7 @@
|
|
|
528
528
|
"sendPlaceholder": "Send",
|
|
529
529
|
"formSuccessMessage": "Thank you! We'll get in touch with you as soon as possible.",
|
|
530
530
|
"fullWidthLabel": "Full width",
|
|
531
|
+
"enablePopupLabel": "Open images in a pop-up",
|
|
531
532
|
"autoplayLabel": "Autoplay",
|
|
532
533
|
"muteLabel": "Mute",
|
|
533
534
|
"headingStyleLabel": "Heading style",
|
|
@@ -643,14 +644,29 @@
|
|
|
643
644
|
"shapeColor": "Shape Color",
|
|
644
645
|
"imageCaptionPlaceholder": "Add image caption",
|
|
645
646
|
"imageLink": "Image link",
|
|
646
|
-
"imageCaption": "Image caption",
|
|
647
|
+
"imageCaption": "Image pop-up caption",
|
|
648
|
+
"imageCaptionSub": "This caption only appears in the image pop-up",
|
|
647
649
|
"addTitlePlaceholder": "Add title",
|
|
648
650
|
"title": "Title",
|
|
649
651
|
"addParagraphPlaceholder": "Add paragraph",
|
|
650
652
|
"paragraph": "Paragraph",
|
|
651
653
|
"addItemLabel": "Add Item",
|
|
652
654
|
"image": "Image",
|
|
653
|
-
"shape": "Shape"
|
|
655
|
+
"shape": "Shape",
|
|
656
|
+
"none": "None",
|
|
657
|
+
"popup": "Pop-up",
|
|
658
|
+
"openLink": "Open Link",
|
|
659
|
+
"imageBehaviour": "Image behaviour",
|
|
660
|
+
"button": "Button",
|
|
661
|
+
"buttonText": "Button text",
|
|
662
|
+
"getStarted": "Get Started",
|
|
663
|
+
"buttonLink": "Button Link",
|
|
664
|
+
"url": "Url",
|
|
665
|
+
"email": "Email Address",
|
|
666
|
+
"telephone": "Phone Number",
|
|
667
|
+
"buttonTextStyleLabel": "Button text Style",
|
|
668
|
+
"selectPage": "Select a page",
|
|
669
|
+
"page": "Page"
|
|
654
670
|
},
|
|
655
671
|
"textItemsField": {
|
|
656
672
|
"fontSettings": "Font Settings",
|
|
@@ -528,6 +528,7 @@
|
|
|
528
528
|
"sendPlaceholder": "Enviar",
|
|
529
529
|
"formSuccessMessage": "Obrigado! Entraremos em contato consigo assim que possível.",
|
|
530
530
|
"fullWidthLabel": "Largura total",
|
|
531
|
+
"enablePopupLabel": "Abrir imagens em um pop-up",
|
|
531
532
|
"autoplayLabel": "Reprodução automática",
|
|
532
533
|
"muteLabel": "Silenciar",
|
|
533
534
|
"headingStyleLabel": "Estilo de cabeçalho",
|
|
@@ -643,14 +644,29 @@
|
|
|
643
644
|
"shapeColor": "Cor da forma",
|
|
644
645
|
"imageCaptionPlaceholder": "Adicionar legenda à imagem",
|
|
645
646
|
"imageLink": "Link da imagem",
|
|
646
|
-
"imageCaption": "Legenda da imagem",
|
|
647
|
+
"imageCaption": "Legenda da imagem pop-up",
|
|
648
|
+
"imageCaptionSub": "Esta legenda só aparece no pop-up da imagem",
|
|
647
649
|
"addTitlePlaceholder": "Adicionar título",
|
|
648
650
|
"title": "Título",
|
|
649
651
|
"addParagraphPlaceholder": "Adicionar parágrafo",
|
|
650
652
|
"paragraph": "Parágrafo",
|
|
651
653
|
"addItemLabel": "Adicionar item",
|
|
652
654
|
"image": "Imagem",
|
|
653
|
-
"shape": "Forma"
|
|
655
|
+
"shape": "Forma",
|
|
656
|
+
"none": "Nenhum",
|
|
657
|
+
"popup": "Pop-up",
|
|
658
|
+
"openLink": "Abrir link",
|
|
659
|
+
"imageBehaviour": "Comportamento da imagem",
|
|
660
|
+
"button": "Botão",
|
|
661
|
+
"buttonText": "Texto do botão",
|
|
662
|
+
"getStarted": "Começar",
|
|
663
|
+
"buttonLink": "Link do botão",
|
|
664
|
+
"url": "URL",
|
|
665
|
+
"email": "Endereço de e-mail",
|
|
666
|
+
"telephone": "Número de telefone",
|
|
667
|
+
"buttonTextStyleLabel": "Estilo do texto do botão",
|
|
668
|
+
"selectPage": "Selecione uma página",
|
|
669
|
+
"page": "Página"
|
|
654
670
|
},
|
|
655
671
|
"textItemsField": {
|
|
656
672
|
"fontSettings": "Definições de fontes",
|
|
@@ -528,6 +528,7 @@
|
|
|
528
528
|
"sendPlaceholder": "Enviar",
|
|
529
529
|
"formSuccessMessage": "Obrigado! Entraremos em contacto consigo assim que possível.",
|
|
530
530
|
"fullWidthLabel": "Largura total",
|
|
531
|
+
"enablePopupLabel": "Abrir imagens num pop-up",
|
|
531
532
|
"autoplayLabel": "Reprodução automática",
|
|
532
533
|
"muteLabel": "Silenciar",
|
|
533
534
|
"headingStyleLabel": "Estilo de cabeçalho",
|
|
@@ -643,14 +644,29 @@
|
|
|
643
644
|
"shapeColor": "Cor da Forma",
|
|
644
645
|
"imageCaptionPlaceholder": "Incluir legenda da imagem",
|
|
645
646
|
"imageLink": "Link da imagem",
|
|
646
|
-
"imageCaption": "Legenda da imagem",
|
|
647
|
+
"imageCaption": "Legenda pop-up da imagem",
|
|
648
|
+
"imageCaptionSub": "Esta legenda só aparece no pop-up da imagem",
|
|
647
649
|
"addTitlePlaceholder": "Adicionar título",
|
|
648
650
|
"title": "Título",
|
|
649
651
|
"addParagraphPlaceholder": "Adicionar parágrafo",
|
|
650
652
|
"paragraph": "Parágrafo",
|
|
651
653
|
"addItemLabel": "Adicionar Item",
|
|
652
654
|
"image": "Imagem",
|
|
653
|
-
"shape": "Forma"
|
|
655
|
+
"shape": "Forma",
|
|
656
|
+
"none": "Nenhum",
|
|
657
|
+
"popup": "Pop-up",
|
|
658
|
+
"openLink": "Abrir link",
|
|
659
|
+
"imageBehaviour": "Comportamento da imagem",
|
|
660
|
+
"button": "Botão",
|
|
661
|
+
"buttonText": "Texto do botão",
|
|
662
|
+
"getStarted": "Comece",
|
|
663
|
+
"buttonLink": "Link de botão",
|
|
664
|
+
"url": "URL",
|
|
665
|
+
"email": "Endereço de email",
|
|
666
|
+
"telephone": "Número de telefone",
|
|
667
|
+
"buttonTextStyleLabel": "Estilo do texto do botão",
|
|
668
|
+
"selectPage": "Selecione uma página",
|
|
669
|
+
"page": "Página"
|
|
654
670
|
},
|
|
655
671
|
"textItemsField": {
|
|
656
672
|
"fontSettings": "Definições de tipo de letra",
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="tw-flex tw-items-center tw-justify-between tw-mb-4">
|
|
4
|
+
<h4 class="tw-text-sm tw-font-bold">
|
|
5
|
+
{{ buttonConfigurationFieldTr(`button`) }}
|
|
6
|
+
</h4>
|
|
7
|
+
<Toggle
|
|
8
|
+
:id="`button-toggle-${id}-${index}`"
|
|
9
|
+
:model-value="buttonConfig.buttonText !== false"
|
|
10
|
+
:attrs="{
|
|
11
|
+
'data-test-tag': `button-toggle-${id}-${index}`,
|
|
12
|
+
}"
|
|
13
|
+
color="primary"
|
|
14
|
+
@update:model-value="onButtonToggleChange"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div v-if="buttonConfig.buttonText !== false" class="tw-space-y-4">
|
|
19
|
+
<div>
|
|
20
|
+
<TextInput
|
|
21
|
+
:model-value="buttonTextAsString"
|
|
22
|
+
size="sm"
|
|
23
|
+
:maxlength="titleLength"
|
|
24
|
+
:placeholder="buttonConfigurationFieldTr(`getStarted`)"
|
|
25
|
+
:attrs="{
|
|
26
|
+
'data-test-tag': `button-text-input-${id}-${index}`,
|
|
27
|
+
}"
|
|
28
|
+
:error="buttonTextAsString.length >= titleLength"
|
|
29
|
+
@input="onButtonTextChange"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div v-if="buttonConfig.buttonText">
|
|
34
|
+
<h4 class="tw-text-sm tw-font-bold tw-mb-2">
|
|
35
|
+
{{ buttonConfigurationFieldTr(`buttonLink`) }}
|
|
36
|
+
</h4>
|
|
37
|
+
<ButtonGroup
|
|
38
|
+
:model-value="currentLinkType"
|
|
39
|
+
:options="linkTypeOptions"
|
|
40
|
+
:columns="2"
|
|
41
|
+
:attrs="{
|
|
42
|
+
'data-test-tag': `button-group-input-${id}-${index}`,
|
|
43
|
+
}"
|
|
44
|
+
@on-select="onLinkTypeChange"
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<div v-if="!isPageLinkType && isUrlLinkType" class="tw-mt-2">
|
|
48
|
+
<UrlField
|
|
49
|
+
:id="`url-field-${id}-${index}`"
|
|
50
|
+
:name="`url-${id}-${index}`"
|
|
51
|
+
:value="buttonConfig.url || ''"
|
|
52
|
+
:placeholder="getUrlPlaceholder()"
|
|
53
|
+
role="url"
|
|
54
|
+
:attrs="{
|
|
55
|
+
'data-test-tag': `button-url-input-${id}-${index}`,
|
|
56
|
+
}"
|
|
57
|
+
@update:model-value="onButtonUrlChange"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div v-if="!isPageLinkType && isEmailOrTelLinkType" class="tw-mt-2">
|
|
62
|
+
<TextInput
|
|
63
|
+
:model-value="buttonConfig.url || ''"
|
|
64
|
+
size="sm"
|
|
65
|
+
:maxlength="descriptionLength"
|
|
66
|
+
:placeholder="getUrlPlaceholder()"
|
|
67
|
+
:error="
|
|
68
|
+
(buttonConfig.url || '').length >= descriptionLength ||
|
|
69
|
+
!isValidButtonUrl
|
|
70
|
+
"
|
|
71
|
+
:attrs="{
|
|
72
|
+
'data-test-tag': `button-${currentLinkType}-input-${id}-${index}`,
|
|
73
|
+
}"
|
|
74
|
+
@input="onButtonUrlChange"
|
|
75
|
+
/>
|
|
76
|
+
<p
|
|
77
|
+
v-if="!isValidButtonUrl"
|
|
78
|
+
class="tw-text-error-500 tw-text-sm tw-mt-2"
|
|
79
|
+
>
|
|
80
|
+
{{ invalidUrlError }}
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div v-if="isPageLinkType" class="tw-mt-2">
|
|
85
|
+
<PageDropdownField
|
|
86
|
+
:id="`page-dropdown-${id}-${index}`"
|
|
87
|
+
:name="`pageSlug-${id}-${index}`"
|
|
88
|
+
:value="buttonConfig.pageSlug || ''"
|
|
89
|
+
:placeholder="buttonConfigurationFieldTr('selectPage')"
|
|
90
|
+
:attrs="{ 'data-test-tag': `pageSlug-${id}-${index}` }"
|
|
91
|
+
@update:model-value="onPageSlugChange"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<script setup lang="ts">
|
|
100
|
+
import { computed, ref } from 'vue';
|
|
101
|
+
import { TextInput, ButtonGroup, Toggle } from '@designcrowd/fe-shared-lib';
|
|
102
|
+
import PageDropdownField from '../page-dropdown-field/PageDropdownField.vue';
|
|
103
|
+
import UrlField from '../url-field/UrlField.vue';
|
|
104
|
+
import {
|
|
105
|
+
textImageFieldTr as buttonConfigurationFieldTr,
|
|
106
|
+
validatorTr,
|
|
107
|
+
contentSettingsTr,
|
|
108
|
+
} from '../../../../composables/useTranslate';
|
|
109
|
+
import type { ButtonLinkType } from '../../../../brand-page';
|
|
110
|
+
import {
|
|
111
|
+
MAX_DESCRIPTION_LENGTH,
|
|
112
|
+
MAX_TITLE_LENGTH,
|
|
113
|
+
BUTTON_LINK_TYPE,
|
|
114
|
+
} from '../../../../brand-page';
|
|
115
|
+
import { isURL, isEmail, isTel } from '../../../../utils/validator.util';
|
|
116
|
+
import { useUiPageSettingsStore } from '../../../page-settings/store';
|
|
117
|
+
|
|
118
|
+
// Props
|
|
119
|
+
interface ButtonConfig {
|
|
120
|
+
buttonText: string | boolean;
|
|
121
|
+
buttonLinkType: ButtonLinkType;
|
|
122
|
+
url: string;
|
|
123
|
+
pageSlug: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface Props {
|
|
127
|
+
id: string;
|
|
128
|
+
index: number;
|
|
129
|
+
buttonConfig: ButtonConfig;
|
|
130
|
+
pages?: Array<{ slug: string; title: string }>;
|
|
131
|
+
titleLength?: number;
|
|
132
|
+
descriptionLength?: number;
|
|
133
|
+
isAdmin?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
137
|
+
titleLength: MAX_TITLE_LENGTH,
|
|
138
|
+
descriptionLength: MAX_DESCRIPTION_LENGTH,
|
|
139
|
+
isAdmin: false,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const pageSettingsStore = useUiPageSettingsStore();
|
|
143
|
+
|
|
144
|
+
// Preserve button text when toggling
|
|
145
|
+
const preservedButtonText = ref<string>('');
|
|
146
|
+
|
|
147
|
+
// Emits
|
|
148
|
+
const emit = defineEmits<{
|
|
149
|
+
'update:buttonConfig': [buttonConfig: ButtonConfig];
|
|
150
|
+
}>();
|
|
151
|
+
|
|
152
|
+
// Computed
|
|
153
|
+
const currentLinkType = computed(
|
|
154
|
+
() => props.buttonConfig.buttonLinkType || BUTTON_LINK_TYPE.url,
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
const isUrlLinkType = computed(
|
|
158
|
+
() => currentLinkType.value === BUTTON_LINK_TYPE.url,
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
const isPageLinkType = computed(
|
|
162
|
+
() => currentLinkType.value === BUTTON_LINK_TYPE.page,
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const isEmailOrTelLinkType = computed(
|
|
166
|
+
() =>
|
|
167
|
+
currentLinkType.value === BUTTON_LINK_TYPE.mailTo ||
|
|
168
|
+
currentLinkType.value === BUTTON_LINK_TYPE.tel,
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const buttonTextAsString = computed(
|
|
172
|
+
() => (props.buttonConfig.buttonText as string) || '',
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
const linkTypeOptions = computed(() => {
|
|
176
|
+
const allLinkTypes = [
|
|
177
|
+
{ value: BUTTON_LINK_TYPE.url, labelKey: 'url', alwaysShow: true },
|
|
178
|
+
{
|
|
179
|
+
value: BUTTON_LINK_TYPE.page,
|
|
180
|
+
labelKey: 'page',
|
|
181
|
+
alwaysShow: false,
|
|
182
|
+
condition: () =>
|
|
183
|
+
pageSettingsStore.pages && pageSettingsStore.pages.length > 1,
|
|
184
|
+
},
|
|
185
|
+
{ value: BUTTON_LINK_TYPE.mailTo, labelKey: 'email', alwaysShow: true },
|
|
186
|
+
{ value: BUTTON_LINK_TYPE.tel, labelKey: 'telephone', alwaysShow: true },
|
|
187
|
+
];
|
|
188
|
+
|
|
189
|
+
return allLinkTypes
|
|
190
|
+
.filter(
|
|
191
|
+
(linkType) =>
|
|
192
|
+
linkType.alwaysShow || (linkType.condition && linkType.condition()),
|
|
193
|
+
)
|
|
194
|
+
.map((linkType) => ({
|
|
195
|
+
value: linkType.value,
|
|
196
|
+
label: buttonConfigurationFieldTr(linkType.labelKey),
|
|
197
|
+
isSelected: currentLinkType.value === linkType.value,
|
|
198
|
+
}));
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const isValidButtonUrl = computed((): boolean => {
|
|
202
|
+
if (!props.buttonConfig.url) return true;
|
|
203
|
+
|
|
204
|
+
switch (currentLinkType.value) {
|
|
205
|
+
case BUTTON_LINK_TYPE.mailTo:
|
|
206
|
+
return isEmail(props.buttonConfig.url);
|
|
207
|
+
case BUTTON_LINK_TYPE.tel:
|
|
208
|
+
return isTel(props.buttonConfig.url);
|
|
209
|
+
default:
|
|
210
|
+
return isURL(props.buttonConfig.url);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
const invalidUrlError = computed((): string => {
|
|
215
|
+
switch (currentLinkType.value) {
|
|
216
|
+
case BUTTON_LINK_TYPE.mailTo:
|
|
217
|
+
return validatorTr('invalidEmailMessage');
|
|
218
|
+
case BUTTON_LINK_TYPE.tel:
|
|
219
|
+
return validatorTr('invalidTelMessage');
|
|
220
|
+
default:
|
|
221
|
+
return validatorTr('invalidUrlMessage');
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// Methods
|
|
226
|
+
const emitUpdate = (updates: Partial<ButtonConfig>) => {
|
|
227
|
+
emit('update:buttonConfig', { ...props.buttonConfig, ...updates });
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const onButtonToggleChange = (enabled: boolean): void => {
|
|
231
|
+
if (enabled) {
|
|
232
|
+
const textToRestore =
|
|
233
|
+
preservedButtonText.value ||
|
|
234
|
+
(props.buttonConfig.buttonText === false ||
|
|
235
|
+
props.buttonConfig.buttonText === ''
|
|
236
|
+
? contentSettingsTr('getStartedButtonText')
|
|
237
|
+
: props.buttonConfig.buttonText);
|
|
238
|
+
emitUpdate({ buttonText: textToRestore });
|
|
239
|
+
} else {
|
|
240
|
+
if (
|
|
241
|
+
typeof props.buttonConfig.buttonText === 'string' &&
|
|
242
|
+
props.buttonConfig.buttonText !== ''
|
|
243
|
+
) {
|
|
244
|
+
preservedButtonText.value = props.buttonConfig.buttonText;
|
|
245
|
+
}
|
|
246
|
+
emitUpdate({ buttonText: false });
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const onButtonTextChange = (value: string): void => {
|
|
251
|
+
emitUpdate({ buttonText: value });
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
const onLinkTypeChange = (option: any): void => {
|
|
255
|
+
const linkType = typeof option === 'string' ? option : option.value;
|
|
256
|
+
emitUpdate({ buttonLinkType: linkType as ButtonLinkType, url: '' });
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const onPageSlugChange = (
|
|
260
|
+
payload: string | { id: string; name: string; value: string },
|
|
261
|
+
): void => {
|
|
262
|
+
const pageSlug = typeof payload === 'string' ? payload : payload.value;
|
|
263
|
+
emitUpdate({ pageSlug });
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const onButtonUrlChange = (
|
|
267
|
+
value: string | { id: string; name: string; value: string },
|
|
268
|
+
): void => {
|
|
269
|
+
const urlValue = typeof value === 'string' ? value : value.value;
|
|
270
|
+
emitUpdate({ url: urlValue });
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const getUrlPlaceholder = (): string => {
|
|
274
|
+
switch (currentLinkType.value) {
|
|
275
|
+
case BUTTON_LINK_TYPE.mailTo:
|
|
276
|
+
return 'me@website.com';
|
|
277
|
+
case BUTTON_LINK_TYPE.tel:
|
|
278
|
+
return '12345-6789';
|
|
279
|
+
default:
|
|
280
|
+
return 'https://example.com';
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
</script>
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"sendPlaceholder" : "Senden",
|
|
143
143
|
"formSuccessMessage" : "Vielen Dank! Wir werden uns so schnell wie möglich mit Ihnen in Verbindung setzen.",
|
|
144
144
|
"fullWidthLabel" : "Volle Breite",
|
|
145
|
+
"enablePopupLabel" : "Bilder in einem Pop-up öffnen",
|
|
145
146
|
"autoplayLabel" : "Autoplay",
|
|
146
147
|
"muteLabel" : "Stumm",
|
|
147
148
|
"headingStyleLabel" : "Überschriftstil",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"sendPlaceholder" : "Enviar",
|
|
143
143
|
"formSuccessMessage" : "¡Gracias! Nos pondremos en contacto contigo lo antes posible.",
|
|
144
144
|
"fullWidthLabel" : "Ancho total",
|
|
145
|
+
"enablePopupLabel" : "Abre imágenes en una ventana emergente",
|
|
145
146
|
"autoplayLabel" : "Reproducción automática",
|
|
146
147
|
"muteLabel" : "Silenciar",
|
|
147
148
|
"headingStyleLabel" : "Estilo de encabezado",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"sendPlaceholder" : "Envoyer",
|
|
143
143
|
"formSuccessMessage" : "Merci ! Nous vous contacterons dès que possible.",
|
|
144
144
|
"fullWidthLabel" : "Pleine largeur",
|
|
145
|
+
"enablePopupLabel" : "Ouvrir des images dans une fenêtre contextuelle",
|
|
145
146
|
"autoplayLabel" : "Lecture automatique",
|
|
146
147
|
"muteLabel" : "Muet",
|
|
147
148
|
"headingStyleLabel" : "Style de titre",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"sendPlaceholder" : "Envoyer",
|
|
143
143
|
"formSuccessMessage" : "Merci ! Nous vous contacterons dès que possible.",
|
|
144
144
|
"fullWidthLabel" : "Pleine largeur",
|
|
145
|
+
"enablePopupLabel" : "Ouvrir des images dans un pop-up",
|
|
145
146
|
"autoplayLabel" : "Lecture automatique",
|
|
146
147
|
"muteLabel" : "Muet",
|
|
147
148
|
"headingStyleLabel" : "Style de titre",
|
|
@@ -153,6 +153,7 @@
|
|
|
153
153
|
"formSuccessMessage": "Thank you! We'll get in touch with you as soon as possible.",
|
|
154
154
|
|
|
155
155
|
"fullWidthLabel": "Full width",
|
|
156
|
+
"enablePopupLabel": "Open images in a pop-up",
|
|
156
157
|
"autoplayLabel": "Autoplay",
|
|
157
158
|
"muteLabel": "Mute",
|
|
158
159
|
"headingStyleLabel": "Heading style",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"sendPlaceholder" : "Enviar",
|
|
143
143
|
"formSuccessMessage" : "Obrigado! Entraremos em contato consigo assim que possível.",
|
|
144
144
|
"fullWidthLabel" : "Largura total",
|
|
145
|
+
"enablePopupLabel" : "Abrir imagens em um pop-up",
|
|
145
146
|
"autoplayLabel" : "Reprodução automática",
|
|
146
147
|
"muteLabel" : "Silenciar",
|
|
147
148
|
"headingStyleLabel" : "Estilo de cabeçalho",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"sendPlaceholder" : "Enviar",
|
|
143
143
|
"formSuccessMessage" : "Obrigado! Entraremos em contacto consigo assim que possível.",
|
|
144
144
|
"fullWidthLabel" : "Largura total",
|
|
145
|
+
"enablePopupLabel" : "Abrir imagens num pop-up",
|
|
145
146
|
"autoplayLabel" : "Reprodução automática",
|
|
146
147
|
"muteLabel" : "Silenciar",
|
|
147
148
|
"headingStyleLabel" : "Estilo de cabeçalho",
|
|
@@ -30,7 +30,7 @@ export default defineComponent({
|
|
|
30
30
|
default: false,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
-
emits: ['
|
|
33
|
+
emits: ['items-change', 'items-delete'],
|
|
34
34
|
data: () => ({
|
|
35
35
|
itemStates: {} as Record<number, ItemFieldState>,
|
|
36
36
|
}),
|
|
@@ -68,7 +68,7 @@ export default defineComponent({
|
|
|
68
68
|
|
|
69
69
|
const items: ItemFieldItem[] = fields.map((f) => f.item);
|
|
70
70
|
|
|
71
|
-
this.$emit('
|
|
71
|
+
this.$emit('items-change', items);
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
},
|
|
@@ -77,7 +77,7 @@ export default defineComponent({
|
|
|
77
77
|
this.itemStates[index].isCollapsed = !this.itemStates[index].isCollapsed;
|
|
78
78
|
},
|
|
79
79
|
onDelete(index: number): void {
|
|
80
|
-
this.$emit('
|
|
80
|
+
this.$emit('items-delete', index);
|
|
81
81
|
},
|
|
82
82
|
onEdit(index: number): void {
|
|
83
83
|
this.$emit('itemsEdit', index);
|