@designcrowd/library.brand-page 5.12.4 → 5.12.5-ast-booking

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.
Files changed (110) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BXfAb_Ly.js → CreatedOnBrandCrowd-de-de-B5KouJJt.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BvCOvRuk.js → CreatedOnBrandCrowd-en-us-CDBIOkYS.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-eAe6KBvm.js → CreatedOnBrandCrowd-es-es-B2uv6JJc.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DVSPg9Qi.js → CreatedOnBrandCrowd-fr-fr-DwFtmsuM.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-pt-pt-W42s3fa-.js → CreatedOnBrandCrowd-pt-pt-Umqbw3cI.js} +1 -1
  6. package/lib/src/{CreatedOnDcom-de-de-B_S0e0e_.js → CreatedOnDcom-de-de-CzZVKMix.js} +1 -1
  7. package/lib/src/{CreatedOnDcom-en-us-Bi-x7Vfr.js → CreatedOnDcom-en-us-DewdA5AU.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-es-es-BlLjTmrS.js → CreatedOnDcom-es-es-CZve73aI.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-fr-fr-D2UQl6bI.js → CreatedOnDcom-fr-fr-BQlgLAmh.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-pt-pt-D-x98ymB.js → CreatedOnDcom-pt-pt-BkShsjOl.js} +1 -1
  11. package/lib/src/brand-page/components/icon/Icon.mixin.d.ts +7 -0
  12. package/lib/src/brand-page/components/icon/Icon.mixin.js +14 -0
  13. package/lib/src/brand-page/models/content.model.d.ts +1 -0
  14. package/lib/src/brand-page/models/content.model.js +1 -0
  15. package/lib/src/brand-page/models/index.d.ts +16 -0
  16. package/lib/src/brand-page/utils/content-callback-util.d.ts +2 -1
  17. package/lib/src/brand-page/utils/content-callback-util.js +3 -0
  18. package/lib/src/brand-page/utils/style.util.js +1 -1
  19. package/lib/src/brand-page/utils/view-model.util.d.ts +3 -2
  20. package/lib/src/brand-page/utils/view-model.util.js +14 -0
  21. package/lib/src/brand-page/view-models.d.ts +6 -2
  22. package/lib/src/brand-page-maker/assessors/banner-section-description-visibility.assessor.d.ts +4 -4
  23. package/lib/src/brand-page-maker/assessors/banner-section-field.assessor.d.ts +4 -4
  24. package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +2 -2
  25. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +18 -18
  26. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +20 -20
  27. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.d.ts +3 -2
  28. package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +29 -2
  29. package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +4 -0
  30. package/lib/src/brand-page-maker/composables/useEventTracker.js +4 -0
  31. package/lib/src/brand-page-maker/constants/config-settings-constant.d.ts +2 -1
  32. package/lib/src/brand-page-maker/constants/config-settings-constant.js +101 -1
  33. package/lib/src/brand-page-maker/models/content-settings.d.ts +2 -1
  34. package/lib/src/brand-page-maker/models/content-settings.js +28 -0
  35. package/lib/src/brand-page-maker/validators/section-button.validator.d.ts +3 -3
  36. package/lib/src/{bundled-translations-C4LWPXSH.js → bundled-translations-BZJKPEb9.js} +42 -40
  37. package/lib/src/{bundled-translations-yNXD14vd.js → bundled-translations-CD8h4dNr.js} +15 -13
  38. package/lib/src/{bundled-translations.de-DE-JcuQ3w62.js → bundled-translations.de-DE-djs407Ih.js} +5 -3
  39. package/lib/src/{bundled-translations.es-ES-CxAmhY4A.js → bundled-translations.es-ES-JjQoQaM7.js} +9 -7
  40. package/lib/src/{bundled-translations.fr-FR-ClTzpDVd.js → bundled-translations.fr-FR-rUuRWfsM.js} +5 -3
  41. package/lib/src/{bundled-translations.pt-PT-CaCaJJ12.js → bundled-translations.pt-PT-BiSQEFmA.js} +5 -3
  42. package/lib/src/bundles/bundled-translations.json +8 -1
  43. package/lib/src/composables/useTranslate.d.ts +2 -1
  44. package/lib/src/composables/useTranslate.js +2 -1
  45. package/lib/src/constants/brand-page-maker.js +7 -0
  46. package/lib/src/css/library.brand-page-brandCrowd.min.css +44 -39
  47. package/lib/src/css/library.brand-page-brandPage.min.css +44 -39
  48. package/lib/src/css/library.brand-page-designCom.min.css +44 -39
  49. package/lib/src/css/library.brand-page-preview.min.css +44 -39
  50. package/lib/src/index.mjs +176 -175
  51. package/lib/src/{lib-CmlX0vVm.js → lib-BTapaSjP.js} +26355 -25856
  52. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +20 -20
  53. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +21 -21
  54. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +20 -20
  55. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +18 -18
  56. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +1 -1
  57. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +18 -18
  58. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.d.ts +11 -0
  59. package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +5 -0
  60. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +39 -2
  61. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.js +32 -0
  62. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +18 -18
  63. package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.d.ts +3 -2
  64. package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.js +17 -10
  65. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +22 -22
  66. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +20 -20
  67. package/package.json +2 -2
  68. package/src/brand-page/components/booking-section/BookingSection.vue +240 -0
  69. package/src/brand-page/components/icon/Icon.mixin.ts +14 -0
  70. package/src/brand-page/components/icon/Icon.vue +7 -0
  71. package/src/brand-page/components/icon/icons/AppleMusic.vue +12 -0
  72. package/src/brand-page/components/icon/icons/Discord.vue +1 -1
  73. package/src/brand-page/components/icon/icons/Messenger.vue +14 -0
  74. package/src/brand-page/components/icon/icons/Patreon.vue +12 -0
  75. package/src/brand-page/components/icon/icons/Reddit.vue +5 -0
  76. package/src/brand-page/components/icon/icons/Substack.vue +12 -0
  77. package/src/brand-page/components/icon/icons/Telegram.vue +5 -0
  78. package/src/brand-page/components/icon/icons/Threads.vue +5 -0
  79. package/src/brand-page/components/icon/icons/Twitter.vue +1 -1
  80. package/src/brand-page/components/page/PageComponent.vue +2 -0
  81. package/src/brand-page/models/content.model.ts +1 -0
  82. package/src/brand-page/models/index.ts +17 -0
  83. package/src/brand-page/utils/content-callback-util.ts +7 -0
  84. package/src/brand-page/utils/style.util.ts +1 -1
  85. package/src/brand-page/utils/view-model.util.ts +27 -0
  86. package/src/brand-page/view-models.ts +10 -1
  87. package/src/brand-page-maker/assessors/banner-section-description-visibility.assessor.ts +7 -4
  88. package/src/brand-page-maker/assessors/banner-section-field.assessor.ts +7 -4
  89. package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +3 -1
  90. package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +37 -2
  91. package/src/brand-page-maker/composables/useEventTracker.ts +4 -0
  92. package/src/brand-page-maker/constants/config-settings-constant.ts +107 -0
  93. package/src/brand-page-maker/models/content-settings.ts +32 -0
  94. package/src/brand-page-maker/validators/section-button.validator.ts +7 -6
  95. package/src/bundles/bundled-translations.json +8 -1
  96. package/src/composables/useTranslate.ts +2 -0
  97. package/src/constants/brand-page-maker.ts +7 -0
  98. package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +5 -1
  99. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +1 -1
  100. package/src/shared/content-settings/components/text-field/TextField.vue +1 -0
  101. package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +5 -0
  102. package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +1 -0
  103. package/src/shared/content-settings/components/textarea-field/TextareaField.vue +1 -0
  104. package/src/shared/content-settings/components/url-field/UrlField.mixin.ts +38 -0
  105. package/src/shared/content-settings/components/url-field/UrlField.vue +12 -0
  106. package/src/shared/content-settings/components/url-field/i18n/url-field.json +5 -0
  107. package/src/shared/font-family-selector/FontFamilySelector.mixin.ts +22 -14
  108. package/src/brand-page/components/logo/test.json +0 -866
  109. package/src/brand-page/components/logo/test2.json +0 -765
  110. package/src/brand-page/components/logo/test3.json +0 -749
@@ -1,4 +1,7 @@
1
- import type { BannerSectionContent } from '../../brand-page';
1
+ import type {
2
+ BannerSectionContent,
3
+ BookingSectionContent,
4
+ } from '../../brand-page';
2
5
  import type {
3
6
  FieldTypeAssessor,
4
7
  ItemFieldType,
@@ -6,7 +9,7 @@ import type {
6
9
  } from '../models';
7
10
 
8
11
  export const bannerSectionFieldTypeAssessor: FieldTypeAssessor<
9
- BannerSectionContent | undefined
12
+ BannerSectionContent | BookingSectionContent | undefined
10
13
  > = (content): ItemFieldType => {
11
14
  switch (content?.buttonLinkType) {
12
15
  case 'url':
@@ -21,7 +24,7 @@ export const bannerSectionFieldTypeAssessor: FieldTypeAssessor<
21
24
  };
22
25
 
23
26
  export const bannerSectionRoleTypeAssessor: FieldTypeAssessor<
24
- BannerSectionContent | undefined
27
+ BannerSectionContent | BookingSectionContent | undefined
25
28
  > = (content): ItemFieldType => {
26
29
  switch (content?.buttonLinkType) {
27
30
  case 'url':
@@ -36,7 +39,7 @@ export const bannerSectionRoleTypeAssessor: FieldTypeAssessor<
36
39
  };
37
40
 
38
41
  export const bannerPlaceholderFieldTypeAssessor: PlaceholderTypeAssessor<
39
- BannerSectionContent | undefined
42
+ BannerSectionContent | BookingSectionContent | undefined
40
43
  > = (content): string => {
41
44
  switch (content?.buttonLinkType) {
42
45
  case 'url':
@@ -148,7 +148,7 @@
148
148
  <div class="style-editor-button">
149
149
  <ColorField
150
150
  id="text-color-picker"
151
- class="tw-max-h-9 tw-max-w-9 tw-justify-center"
151
+ class="tw-max-h-9 tw-max-w-8 tw-justify-center"
152
152
  :class="{
153
153
  'tw-opacity-50 tw-pointer-events-none': isTextColorPickerDisabled,
154
154
  }"
@@ -524,6 +524,7 @@ const props = withDefaults(
524
524
  rawId: string;
525
525
  textItemIndex: number;
526
526
  item: TextItem;
527
+ contentType: string;
527
528
  }>(),
528
529
  {
529
530
  id: '',
@@ -954,6 +955,7 @@ const {
954
955
  textStyleTypeOptions,
955
956
  markedText,
956
957
  isHyperlinkPopupOpen,
958
+ selectedLinkType,
957
959
  );
958
960
 
959
961
  const isExternalLink = computed(() => {
@@ -34,8 +34,12 @@ import {
34
34
  sanitiseClientSideRTE,
35
35
  skipStyleDetection,
36
36
  } from '../../../brand-page-maker/utils';
37
- import type { TextStyles } from '../../../brand-page';
38
- import { type TextItem, type TextStyleDeclaration } from '../../../brand-page';
37
+ import type { HyperlinkType, TextStyles } from '../../../brand-page';
38
+ import {
39
+ HYPERLINK_TYPE,
40
+ type TextItem,
41
+ type TextStyleDeclaration,
42
+ } from '../../../brand-page';
39
43
  import type { ButtonGroupOption } from '../../../brand-page-maker/models/button-group.model';
40
44
  import {
41
45
  letterSpacingValueConvertor,
@@ -53,6 +57,7 @@ import {
53
57
  isLogoColor,
54
58
  getRTEColor,
55
59
  } from '../../utils/rich-text-editor.util';
60
+ import { useEventTracker, EVENTS } from '../useEventTracker';
56
61
 
57
62
  interface UseRichTextEditorReturn {
58
63
  editor: Editor;
@@ -178,6 +183,7 @@ export const useRichTextEditor = (
178
183
  placeholder: string;
179
184
  textItemIndex: number;
180
185
  item: TextItem;
186
+ contentType: string;
181
187
  },
182
188
  emit: (event: 'focus' | 'blur' | 'update:modelValue', ...args: any[]) => void,
183
189
  fontSettings: {
@@ -198,6 +204,7 @@ export const useRichTextEditor = (
198
204
  textStyleTypeOptions: ButtonGroupOption[],
199
205
  markedText: Ref<string>,
200
206
  isHyperlinkPopupOpen: Ref<boolean>,
207
+ selectedLinkTypeValue: Ref<HyperlinkType>,
201
208
  ): UseRichTextEditorReturn => {
202
209
  const editor = new Editor({
203
210
  content: model.value ?? '',
@@ -370,6 +377,7 @@ export const useRichTextEditor = (
370
377
  });
371
378
 
372
379
  const contentSettingStore = useUiContentSettingsStore();
380
+ const eventTracker = useEventTracker();
373
381
 
374
382
  const {
375
383
  toggleBold,
@@ -778,8 +786,20 @@ export const useRichTextEditor = (
778
786
  action: 'toggle' | 'apply' | 'remove',
779
787
  data?: { href?: string; text?: string },
780
788
  ) => {
789
+ const linkType =
790
+ selectedLinkTypeValue.value === HYPERLINK_TYPE.page
791
+ ? 'internal_link'
792
+ : 'external_link';
793
+
781
794
  switch (action) {
782
795
  case 'toggle':
796
+ eventTracker.sendWebsiteEvent({
797
+ eventName: EVENTS.WEBSITE_MAKER_HYPERLINK_CLICK,
798
+ eventProps: {
799
+ link_type: linkType,
800
+ content_type: props.contentType,
801
+ },
802
+ });
783
803
  isHyperlinkPopupOpen.value = !isHyperlinkPopupOpen.value;
784
804
 
785
805
  if (isHyperlinkPopupOpen.value) {
@@ -819,6 +839,14 @@ export const useRichTextEditor = (
819
839
  break;
820
840
 
821
841
  case 'apply':
842
+ // Track Mixpanel event for hyperlink attachment
843
+ eventTracker.sendWebsiteEvent({
844
+ eventName: EVENTS.WEBSITE_MAKER_HYPERLINK_ADD,
845
+ eventProps: {
846
+ link_type: linkType,
847
+ content_type: props.contentType,
848
+ },
849
+ });
822
850
  const url = hyperlinkValue.value.value;
823
851
 
824
852
  const text = markedText.value;
@@ -839,6 +867,13 @@ export const useRichTextEditor = (
839
867
  break;
840
868
 
841
869
  case 'remove':
870
+ eventTracker.sendWebsiteEvent({
871
+ eventName: EVENTS.WEBSITE_MAKER_HYPERLINK_REMOVE,
872
+ eventProps: {
873
+ link_type: linkType,
874
+ content_type: props.contentType,
875
+ },
876
+ });
842
877
  removeHyperlinkFromComposable();
843
878
  isHyperlinkPopupOpen.value = false;
844
879
  break;
@@ -43,6 +43,10 @@ export const EVENTS = {
43
43
  WEBSITE_MAKER_TEMPLATE_CATEGORY_SELECT:
44
44
  'website_maker_template_category_select',
45
45
  WEBSITE_SIDEBAR_TAB_CLICKED: 'website_sidebar_tab_clicked',
46
+ WEBSITE_MAKER_HYPERLINK_ADD: 'website_maker_hyperlink_add',
47
+ WEBSITE_MAKER_HYPERLINK_REMOVE: 'website_maker_hyperlink_remove',
48
+ WEBSITE_MAKER_HYPERLINK_CLICK: 'website_maker_hyperlink_click',
49
+ WEBSITE_MAKER_HYPERLINK_EDIT: 'website_maker_hyperlink_edit',
46
50
  };
47
51
 
48
52
  export const SELECT_LOCATIONS = {
@@ -34,6 +34,7 @@ import type {
34
34
  ShapesSectionContent,
35
35
  Content,
36
36
  ShopContent,
37
+ BookingSectionContent,
37
38
  } from '../../brand-page';
38
39
  import {
39
40
  SOCIAL_LINKS_ICON_DISPLAY_STYLES,
@@ -81,6 +82,7 @@ import {
81
82
  createInitialShapesSectionContent,
82
83
  VARIANT_DISPLAY_MODES,
83
84
  createInitialShopContent,
85
+ createInitialBookingSectionContent,
84
86
  } from '../models';
85
87
  import type {
86
88
  ContentReplaceImageSettings,
@@ -3016,6 +3018,110 @@ export const SHOP_SECTION_SETTINGS_CONFIG = (): ContentSettingsConfig<
3016
3018
  type: 'shop-section',
3017
3019
  });
3018
3020
 
3021
+ export const BOOKING_SECTION_SETTINGS_CONFIG =
3022
+ (): ContentSettingsConfig<BookingSectionContent> => ({
3023
+ type: 'booking-section',
3024
+ category: 'sections',
3025
+ createInitialContent: createInitialBookingSectionContent,
3026
+ displayMode: CONTENT_SETTINGS_DISPLAY_MODES.focused,
3027
+ defaultIconName: 'calendar',
3028
+ displayName: contentSettingsTr(`bookingSectionDisplayName`),
3029
+ fieldGroups: [
3030
+ {
3031
+ id: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3032
+ displayName: contentSettingsTr(`settingsDisplayName`),
3033
+ isCollapsed: false,
3034
+ },
3035
+ {
3036
+ id: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
3037
+ displayName: contentSettingsTr(`styleDisplayName`),
3038
+ isCollapsed: true,
3039
+ },
3040
+ ],
3041
+ fields: {
3042
+ titleStyle: DEFAULT_TITLE_STYLE_SETTINGS_FILED_WITH_TITLE(),
3043
+ descriptionStyle: DEFAULT_DESCRIPTION_STYLE_FILED(),
3044
+ buttonTextStyle: DEFAULT_BUTTON_TEXT_STYLE_FIELD(),
3045
+ title: {
3046
+ type: 'text',
3047
+ placeholder: contentSettingsTr(`titlePlaceholder`),
3048
+ title: contentSettingsTr(`titleTitle`),
3049
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3050
+ maxLength: 200,
3051
+ },
3052
+ titleOverride: {
3053
+ type: 'personalisation-override',
3054
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3055
+ visibilityAssessor: (c, b) =>
3056
+ personalisationOverrideVisibility(c, b, 'title'),
3057
+ },
3058
+ description: {
3059
+ type: 'textarea',
3060
+ placeholder: contentSettingsTr(`descriptionPlaceholder`),
3061
+ title: contentSettingsTr(`descriptionTitle`),
3062
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3063
+ maxLength: 1000,
3064
+ },
3065
+ descriptionOverride: {
3066
+ type: 'personalisation-override',
3067
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3068
+ visibilityAssessor: (c, b) =>
3069
+ personalisationOverrideVisibility(c, b, 'description'),
3070
+ },
3071
+ buttonText: {
3072
+ type: 'text',
3073
+ placeholder: contentSettingsTr(`getStartedPlaceholder`),
3074
+ title: contentSettingsTr(`buttonTitle`),
3075
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3076
+ maxLength: 60,
3077
+ },
3078
+ buttonTextOverride: {
3079
+ type: 'personalisation-override',
3080
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3081
+ visibilityAssessor: (c, b) =>
3082
+ personalisationOverrideVisibility(c, b, 'buttonText'),
3083
+ },
3084
+ backgroundStyle: {
3085
+ type: 'color',
3086
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
3087
+ defaultValue: {},
3088
+ isInline: true,
3089
+ showToggle: false,
3090
+ title: contentSettingsTr(`backgroundColorTitle`),
3091
+ valueConvertor: backgroundColorConvertor,
3092
+ },
3093
+ buttonLinkType: {
3094
+ type: 'radio',
3095
+ role: 'multi',
3096
+ defaultValue: BUTTON_LINK_TYPE.url,
3097
+ title: contentSettingsTr(`buttonLinkTitle`),
3098
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3099
+ optionsConvertor: buttonLinkStyleConvertor,
3100
+ visibilityAssessor: bannerLinkTypeVisibilityAssessor,
3101
+ },
3102
+ pageSlug: {
3103
+ type: 'page-dropdown',
3104
+ placeholder: contentSettingsTr(`selectAPagePlaceholder`),
3105
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3106
+ visibilityAssessor: bannerSectionPageVisibilityAssessor,
3107
+ validator: pageValidator,
3108
+ defaultValue: '',
3109
+ },
3110
+ url: {
3111
+ type: 'url',
3112
+ groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
3113
+ fieldTypeAssessor: bannerSectionFieldTypeAssessor,
3114
+ roleAssessor: bannerSectionRoleTypeAssessor,
3115
+ placeholderAssessor: bannerPlaceholderFieldTypeAssessor,
3116
+ visibilityAssessor: bannerSectionUrlVisibilityAssessor,
3117
+ validator: urlValidator,
3118
+ defaultValue: '',
3119
+ },
3120
+ },
3121
+ isEnabled: true,
3122
+ isLocked: false,
3123
+ });
3124
+
3019
3125
  export const CONTENT_SETTINGS_CONFIGS = (): Record<
3020
3126
  ContentType,
3021
3127
  ContentSettingsConfig<any>
@@ -3051,4 +3157,5 @@ export const CONTENT_SETTINGS_CONFIGS = (): Record<
3051
3157
  'divider-section': DIVIDER_SECTION_SETTINGS_CONFIG(),
3052
3158
  'shapes-section': SHAPES_SECTION_SETTINGS_CONFIG(),
3053
3159
  'shop-section': SHOP_SECTION_SETTINGS_CONFIG(),
3160
+ 'booking-section': BOOKING_SECTION_SETTINGS_CONFIG(),
3054
3161
  });
@@ -51,6 +51,7 @@ import type {
51
51
  BrandPageType,
52
52
  SupportMeContent,
53
53
  ShopContent,
54
+ BookingSectionContent,
54
55
  } from '../../brand-page';
55
56
  import * as uuid from 'uuid';
56
57
  import type { CreateInitialContentFunction } from './content-settings-configs';
@@ -517,6 +518,37 @@ export const createInitialBannerSectionContent: CreateInitialContentFunction<
517
518
  };
518
519
  };
519
520
 
521
+ export const createInitialBookingSectionContent: CreateInitialContentFunction<
522
+ BookingSectionContent
523
+ > = (options?: CreateInitialContentOptions) => {
524
+ return {
525
+ id: uuid.v4(),
526
+ title: contentSettingsTr(`defaultBookingTitle`),
527
+ description: contentSettingsTr(`defaultBookingDescription`),
528
+ buttonText: contentSettingsTr(`bookNowLabel`),
529
+ url: '',
530
+ type: 'booking-section',
531
+ descriptionStyle: {
532
+ applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
533
+ textStyleType: TEXT_STYLE_TYPES.paragraphs,
534
+ textAlign: 'center',
535
+ },
536
+ titleStyle: {
537
+ applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
538
+ textStyleType: TEXT_STYLE_TYPES.titles,
539
+ textAlign: 'center',
540
+ },
541
+ backgroundStyle: {},
542
+ pageSlug: '',
543
+ buttonLinkType: BUTTON_LINK_TYPE.url,
544
+ buttonTextStyle: {
545
+ applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
546
+ textStyleType: TEXT_STYLE_TYPES.buttons,
547
+ textAlign: 'center',
548
+ },
549
+ };
550
+ };
551
+
520
552
  export const createInitialImagesSectionContent: CreateInitialContentFunction<
521
553
  ImagesSectionContent
522
554
  > = (options?: CreateInitialContentOptions) => {
@@ -2,6 +2,7 @@ import { isEmail, isTel, isURL } from '../../utils/validator.util';
2
2
  import {
3
3
  BUTTON_LINK_TYPE,
4
4
  type BannerSectionContent,
5
+ type BookingSectionContent,
5
6
  } from '../../brand-page/models';
6
7
  import type { ContentValidator, ValidateResult } from '../models';
7
8
  import { validatorTr } from '../../composables/useTranslate';
@@ -33,9 +34,9 @@ export const textValidator: ContentValidator<BannerSectionContent> = (
33
34
  };
34
35
  };
35
36
 
36
- export const urlValidator: ContentValidator<BannerSectionContent> = (
37
- section,
38
- ): ValidateResult => {
37
+ export const urlValidator: ContentValidator<
38
+ BannerSectionContent | BookingSectionContent
39
+ > = (section): ValidateResult => {
39
40
  if (
40
41
  section.buttonLinkType === BUTTON_LINK_TYPE.url &&
41
42
  !isURL(section.url) &&
@@ -79,9 +80,9 @@ export const urlValidator: ContentValidator<BannerSectionContent> = (
79
80
  };
80
81
  };
81
82
 
82
- export const pageValidator: ContentValidator<BannerSectionContent> = (
83
- section,
84
- ): ValidateResult => {
83
+ export const pageValidator: ContentValidator<
84
+ BannerSectionContent | BookingSectionContent
85
+ > = (section): ValidateResult => {
85
86
  if (section.buttonLinkType === BUTTON_LINK_TYPE.page && !section.pageSlug) {
86
87
  return {
87
88
  message: MISSING_PAGE_SLUG_MESSAGE(),
@@ -418,6 +418,7 @@
418
418
  "dividerSectionDisplayName": "Divider",
419
419
  "shapesSectionDisplayName": "Shapes",
420
420
  "shopSectionDisplayName": "Store",
421
+ "bookingSectionDisplayName": "Booking",
421
422
  "settingsDisplayName": "Settings",
422
423
  "styleDisplayName": "Style",
423
424
  "titleStyleLabel": "Title style",
@@ -495,6 +496,8 @@
495
496
  "followUsOnTitle": "Follow us on",
496
497
  "shapesTitle": "Shapes",
497
498
  "defaultTextValue": "This is a sample text",
499
+ "defaultBookingTitle": "Book an appointment",
500
+ "defaultBookingDescription": "Schedule your appointment today",
498
501
  "titlePlaceholder": "Title",
499
502
  "successMessagePlaceholder": "Success message",
500
503
  "successThanksPlaceholder": "Thank you for your request!",
@@ -551,7 +554,8 @@
551
554
  "linkToLabel": "Link to",
552
555
  "addLinkButtonText": "Add Link",
553
556
  "enterValidUrlError": "Please enter a valid URL",
554
- "enterTextHerePlaceholder": "Enter text here..."
557
+ "enterTextHerePlaceholder": "Enter text here...",
558
+ "bookNowLabel": "Book Now"
555
559
  },
556
560
  "formFields": {
557
561
  "field": "Field",
@@ -659,6 +663,9 @@
659
663
  "textAreaField": {
660
664
  "maxLimitReached": "You have reached your maximum limit of characters allowed"
661
665
  },
666
+ "urlField": {
667
+ "bookingLabel": "Add your booking link (e.g., <a href=\"https://calendly.com/\" class=\"maker-anchor\">Calendly</a>)"
668
+ },
662
669
  "dropzoneUploader": {
663
670
  "loadingMessage": "Loading...",
664
671
  "dropToUpload": "Drop your files here or click to upload.",
@@ -124,6 +124,7 @@ const textImageFieldTr = (key) => tr(`textImageField.${key}`);
124
124
  const textItemsFieldTr = (key) => tr(`textItemsField.${key}`);
125
125
  const textStyleFieldTr = (key) => tr(`textStyleField.${key}`);
126
126
  const textAreaFieldTr = (key) => tr(`textAreaField.${key}`);
127
+ const urlFieldTr = (key) => tr(`urlField.${key}`);
127
128
  const productConfigOptionTr = (key) => tr(`productConfigOption.${key}`);
128
129
  const editLogoSettingsTr = (key) => tr(`editLogoSettings.${key}`);
129
130
  const myUploadSettingsTr = (key, valuesToInterpolate = {}) =>
@@ -281,5 +282,6 @@ export {
281
282
  requestPaymentStripeTr,
282
283
  productDetailModalTr,
283
284
  videoTr,
285
+ urlFieldTr,
284
286
  confirmModalTr,
285
287
  };
@@ -71,4 +71,11 @@ export const BRAND_PAGE_ICONS = [
71
71
  'shopping-card',
72
72
  'shipping-bag',
73
73
  'shipping',
74
+ 'threads',
75
+ 'reddit',
76
+ 'substack',
77
+ 'patreon',
78
+ 'messenger',
79
+ 'apple-music',
80
+ 'telegram',
74
81
  ];
@@ -38,6 +38,7 @@
38
38
  "dividerSectionDisplayName": "Divider",
39
39
  "shapesSectionDisplayName": "Shapes",
40
40
  "shopSectionDisplayName": "Store",
41
+ "bookingSectionDisplayName": "Booking",
41
42
 
42
43
  "settingsDisplayName": "Settings",
43
44
  "styleDisplayName": "Style",
@@ -123,6 +124,8 @@
123
124
  "followUsOnTitle": "Follow us on",
124
125
  "shapesTitle": "Shapes",
125
126
  "defaultTextValue": "This is a sample text",
127
+ "defaultBookingTitle": "Book an appointment",
128
+ "defaultBookingDescription": "Schedule your appointment today",
126
129
 
127
130
  "titlePlaceholder": "Title",
128
131
  "successMessagePlaceholder": "Success message",
@@ -188,6 +191,7 @@
188
191
  "linkToLabel": "Link to",
189
192
  "addLinkButtonText": "Add Link",
190
193
  "enterValidUrlError": "Please enter a valid URL",
191
- "enterTextHerePlaceholder": "Enter text here..."
194
+ "enterTextHerePlaceholder": "Enter text here...",
195
+ "bookNowLabel": "Book Now"
192
196
  }
193
197
  }
@@ -22,7 +22,7 @@ import {
22
22
  import { useUiPageSettingsStore } from '../../../page-settings/store';
23
23
  import { PAGE_SECTIONS } from '../../../page-settings/models';
24
24
 
25
- const RTE_ALLOWED_SECTION_TYPES = ['banner-section', 'text'];
25
+ const RTE_ALLOWED_SECTION_TYPES = ['banner-section', 'text', 'booking-section'];
26
26
  const RTE_DISALLOWED_STYLE_FIELD_NAMES = [
27
27
  'descriptionStyle',
28
28
  'titleStyle',
@@ -13,6 +13,7 @@
13
13
  :name="name"
14
14
  :styles="styles"
15
15
  :raw-id="id"
16
+ :content-type="contentType"
16
17
  @focus="onFocus"
17
18
  @blur="onBlur"
18
19
  />
@@ -52,6 +52,11 @@ export default defineComponent({
52
52
  required: false,
53
53
  default: false,
54
54
  },
55
+ contentType: {
56
+ type: String,
57
+ required: false,
58
+ default: undefined,
59
+ },
55
60
  },
56
61
  emits: ['update:model-value'],
57
62
  data: () => ({
@@ -32,6 +32,7 @@
32
32
  :resize="false"
33
33
  class="tw-w-full"
34
34
  :max-length="maxTextLength"
35
+ :content-type="contentType"
35
36
  @blur="onBlurOverride($event, option.index)"
36
37
  @focus="onFocusOverride(option.index)"
37
38
  @update:model-value="onTextAreaTextChange($event, option.index)"
@@ -18,6 +18,7 @@
18
18
  :raw-id="id"
19
19
  :text-item-index="index"
20
20
  :item="item"
21
+ :content-type="contentType"
21
22
  @focus="onFocus"
22
23
  @blur="onBlur"
23
24
  />
@@ -2,11 +2,29 @@ import { defineComponent } from 'vue';
2
2
  import GenericTextInputMixin from '../GenericTextInput.mixin';
3
3
  import { URL_RE } from '../../constants';
4
4
  import debounce from 'lodash.debounce';
5
+ import {
6
+ useEventTracker,
7
+ EVENTS,
8
+ } from '../../../../brand-page-maker/composables/useEventTracker';
5
9
 
6
10
  const RESIZE_DEBOUNCE_WAIT_IN_MS = 500;
7
11
 
8
12
  export default defineComponent({
13
+ props: {
14
+ brandPageType: {
15
+ type: String,
16
+ required: false,
17
+ default: undefined,
18
+ },
19
+ },
9
20
  mixins: [GenericTextInputMixin],
21
+ setup() {
22
+ const eventTracker = useEventTracker();
23
+
24
+ return {
25
+ eventTracker,
26
+ };
27
+ },
10
28
  data(): Record<string, any> {
11
29
  return {
12
30
  innerValue: '',
@@ -35,6 +53,9 @@ export default defineComponent({
35
53
 
36
54
  return this.innerValue;
37
55
  },
56
+ isBooking(): boolean {
57
+ return this.contentType === 'booking-section';
58
+ },
38
59
  },
39
60
  watch: {
40
61
  value(newVal) {
@@ -72,5 +93,22 @@ export default defineComponent({
72
93
  this.text = this.innerValue;
73
94
  }
74
95
  },
96
+ handleBookingLabelClick(event) {
97
+ if (event.target.tagName === 'A') {
98
+ event.preventDefault();
99
+ const href = event.target.getAttribute('href');
100
+
101
+ if (href) {
102
+ this.eventTracker.sendWebsiteEvent({
103
+ eventName: EVENTS.WEBSITE_MAKER_ADD_CONTENT,
104
+ eventProps: {
105
+ continuation: 'calendly-click',
106
+ },
107
+ });
108
+
109
+ window.open(href, '_blank', 'noopener,noreferrer');
110
+ }
111
+ }
112
+ },
75
113
  },
76
114
  });
@@ -1,5 +1,11 @@
1
1
  <template>
2
2
  <div>
3
+ <div
4
+ v-if="isBooking"
5
+ class="tw-text-sm tw-mb-2"
6
+ @click="handleBookingLabelClick"
7
+ v-html="urlFieldTr('bookingLabel')"
8
+ />
3
9
  <TextInput
4
10
  :id="`${id}-${name}`"
5
11
  v-model="innerValue"
@@ -21,8 +27,14 @@
21
27
  </template>
22
28
  <script>
23
29
  import UrlFieldMixin from './UrlField.mixin.ts';
30
+ import { urlFieldTr } from '../../../../composables/useTranslate';
24
31
 
25
32
  export default {
26
33
  mixins: [UrlFieldMixin],
34
+ setup() {
35
+ return {
36
+ urlFieldTr,
37
+ };
38
+ },
27
39
  };
28
40
  </script>
@@ -0,0 +1,5 @@
1
+ {
2
+ "urlField": {
3
+ "bookingLabel": "Add your booking link (e.g., <a href=\"https://calendly.com/\" class=\"maker-anchor\">Calendly</a>)"
4
+ }
5
+ }
@@ -18,11 +18,24 @@ export default defineComponent({
18
18
  data() {
19
19
  return {
20
20
  fontFamilyCategories: Object.values(FONT_FAMILY_CATEGORIES()),
21
- activeFontFamilyCategory: FONT_FAMILY_CATEGORIES().classic
22
- .key as FontFamilyCategory,
21
+ activeFontFamilyCategory:
22
+ this.getCategoryForFont(this.value) ||
23
+ FONT_FAMILY_CATEGORIES().classic.key,
23
24
  FONT_FAMILY_CONFIGS,
24
25
  };
25
26
  },
27
+ watch: {
28
+ value: {
29
+ handler(newValue: FontFamilyName) {
30
+ const category = this.getCategoryForFont(newValue);
31
+
32
+ if (category && category !== this.activeFontFamilyCategory) {
33
+ this.activeFontFamilyCategory = category;
34
+ }
35
+ },
36
+ immediate: true,
37
+ },
38
+ },
26
39
  computed: {
27
40
  visibleFontFamilyOptions(): StyleTextFontFamilyOption[] {
28
41
  return this.fontFamilyOptions.filter((fontFamilyOption) =>
@@ -30,22 +43,17 @@ export default defineComponent({
30
43
  );
31
44
  },
32
45
  },
33
- created() {
34
- if (this.value) {
35
- const category = Object.values(FONT_FAMILY_CONFIGS).find(
36
- (x) => x.name === this.value,
37
- )?.categories[0];
38
-
39
- if (category) {
40
- this.activeFontFamilyCategory = category;
41
- }
42
- }
43
- },
44
46
  methods: {
47
+ getCategoryForFont(fontName: FontFamilyName): FontFamilyCategory | null {
48
+ const fontConfig = Object.values(FONT_FAMILY_CONFIGS).find(
49
+ (config) => config.name === fontName,
50
+ );
51
+
52
+ return fontConfig?.categories[0] || null;
53
+ },
45
54
  onFontFamilyButtonClick(fontFamilyOption: StyleTextFontFamilyOption) {
46
55
  this.$emit('on-select', fontFamilyOption);
47
56
  },
48
-
49
57
  onFontFamilyCategorySelected(category: FontFamilyCategory) {
50
58
  this.activeFontFamilyCategory = category;
51
59
  },