@designcrowd/library.brand-page 5.12.4-ast-booking → 5.12.4
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-BQeJ_n6B.js → CreatedOnBrandCrowd-de-de-BXfAb_Ly.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-Cj3iYC5T.js → CreatedOnBrandCrowd-en-us-BvCOvRuk.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-Cl7JjVJm.js → CreatedOnBrandCrowd-es-es-eAe6KBvm.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DRomv4BA.js → CreatedOnBrandCrowd-fr-fr-DVSPg9Qi.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DZFEw5Xl.js → CreatedOnBrandCrowd-pt-pt-W42s3fa-.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DZhX2bER.js → CreatedOnDcom-de-de-B_S0e0e_.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Bh9DHJW3.js → CreatedOnDcom-en-us-Bi-x7Vfr.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CUkCHVmG.js → CreatedOnDcom-es-es-BlLjTmrS.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-CF_tcHWx.js → CreatedOnDcom-fr-fr-D2UQl6bI.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-gyRIp-Wi.js → CreatedOnDcom-pt-pt-D-x98ymB.js} +1 -1
- package/lib/src/brand-page/models/content.model.d.ts +0 -1
- package/lib/src/brand-page/models/content.model.js +0 -1
- package/lib/src/brand-page/models/index.d.ts +0 -16
- package/lib/src/brand-page/utils/style.util.js +1 -1
- package/lib/src/brand-page/utils/view-model.util.d.ts +2 -3
- package/lib/src/brand-page/utils/view-model.util.js +0 -14
- package/lib/src/brand-page/view-models.d.ts +2 -6
- package/lib/src/brand-page-maker/assessors/banner-section-description-visibility.assessor.d.ts +4 -4
- package/lib/src/brand-page-maker/assessors/banner-section-field.assessor.d.ts +4 -4
- package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +2 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +18 -18
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +20 -20
- package/lib/src/brand-page-maker/constants/config-settings-constant.d.ts +1 -2
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -101
- package/lib/src/brand-page-maker/models/content-settings.d.ts +1 -2
- package/lib/src/brand-page-maker/models/content-settings.js +0 -28
- package/lib/src/brand-page-maker/validators/section-button.validator.d.ts +3 -3
- package/lib/src/{bundled-translations-BZJKPEb9.js → bundled-translations-C4LWPXSH.js} +40 -42
- package/lib/src/bundles/bundled-translations.json +1 -8
- package/lib/src/composables/useTranslate.d.ts +1 -2
- package/lib/src/composables/useTranslate.js +1 -2
- package/lib/src/css/library.brand-page-brandCrowd.min.css +0 -5
- package/lib/src/css/library.brand-page-brandPage.min.css +0 -5
- package/lib/src/css/library.brand-page-designCom.min.css +0 -5
- package/lib/src/css/library.brand-page-preview.min.css +0 -5
- package/lib/src/index.mjs +175 -176
- package/lib/src/{lib-Dsso3HKV.js → lib-CmlX0vVm.js} +21754 -22076
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +20 -20
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +21 -21
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +20 -20
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +18 -18
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +1 -1
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +18 -18
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +2 -39
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.js +0 -32
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +18 -18
- package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.d.ts +2 -3
- package/lib/src/shared/font-family-selector/FontFamilySelector.mixin.js +9 -16
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +22 -22
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +20 -20
- package/package.json +1 -1
- package/src/brand-page/components/logo/test.json +866 -0
- package/src/brand-page/components/logo/test2.json +765 -0
- package/src/brand-page/components/logo/test3.json +749 -0
- package/src/brand-page/components/page/PageComponent.vue +0 -2
- package/src/brand-page/models/content.model.ts +0 -1
- package/src/brand-page/models/index.ts +0 -17
- package/src/brand-page/utils/style.util.ts +1 -1
- package/src/brand-page/utils/view-model.util.ts +0 -27
- package/src/brand-page/view-models.ts +1 -10
- package/src/brand-page-maker/assessors/banner-section-description-visibility.assessor.ts +4 -7
- package/src/brand-page-maker/assessors/banner-section-field.assessor.ts +4 -7
- package/src/brand-page-maker/constants/config-settings-constant.ts +0 -107
- package/src/brand-page-maker/models/content-settings.ts +0 -32
- package/src/brand-page-maker/validators/section-button.validator.ts +6 -7
- package/src/bundles/bundled-translations.json +1 -8
- package/src/composables/useTranslate.ts +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +1 -5
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +1 -1
- package/src/shared/content-settings/components/url-field/UrlField.mixin.ts +0 -38
- package/src/shared/content-settings/components/url-field/UrlField.vue +0 -12
- package/src/shared/font-family-selector/FontFamilySelector.mixin.ts +11 -21
- package/src/brand-page/components/booking-section/BookingSection.vue +0 -240
- package/src/shared/content-settings/components/url-field/i18n/url-field.json +0 -5
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section>
|
|
3
|
-
<div
|
|
4
|
-
class="tw-relative tw-px-6 tw-py-8"
|
|
5
|
-
:style="viewModel.backgroundStyle"
|
|
6
|
-
style="container-type: inline-size"
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
class="tw-flex tw-gap-8 tw-w-full tw-h-full tw-items-center c_banner-container tw-flex-col tw-gap-5"
|
|
10
|
-
>
|
|
11
|
-
<TextWrapper
|
|
12
|
-
v-if="viewModel.title"
|
|
13
|
-
:text-style="viewModel.titleStyle"
|
|
14
|
-
:text="viewModel.title"
|
|
15
|
-
:slug="context.brandPageSlug"
|
|
16
|
-
element="h1"
|
|
17
|
-
/>
|
|
18
|
-
<TextWrapper
|
|
19
|
-
v-if="hasDescriptionText"
|
|
20
|
-
:text-style="viewModel.descriptionStyle"
|
|
21
|
-
:text="renderText"
|
|
22
|
-
:slug="context.brandPageSlug"
|
|
23
|
-
element="div"
|
|
24
|
-
/>
|
|
25
|
-
<div
|
|
26
|
-
v-if="shouldShowButton"
|
|
27
|
-
class="tw-w-full tw-flex tw-justify-center"
|
|
28
|
-
>
|
|
29
|
-
<button
|
|
30
|
-
class="tw-block tw-py-4 tw-px-5 tw-text-base tw-text-center tw-w-fit tw-border-0 hover:tw-cursor-pointer"
|
|
31
|
-
:style="buttonStyle"
|
|
32
|
-
@click="onClickUrl"
|
|
33
|
-
>
|
|
34
|
-
<TextWrapper
|
|
35
|
-
:text-style="props.viewModel.buttonTextStyle"
|
|
36
|
-
:text="props.viewModel.buttonText"
|
|
37
|
-
class="tw-text-center tw-text-base"
|
|
38
|
-
/>
|
|
39
|
-
</button>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</section>
|
|
44
|
-
</template>
|
|
45
|
-
<script setup lang="ts">
|
|
46
|
-
import type { PropType, StyleValue } from 'vue';
|
|
47
|
-
import { computed } from 'vue';
|
|
48
|
-
import { useRouter } from 'vue-router';
|
|
49
|
-
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
50
|
-
import type { BookingSectionViewModel } from '../../view-models';
|
|
51
|
-
import type { BrandPageContext } from '../../models';
|
|
52
|
-
import { getRenderText, escapeContentText } from '../../utils';
|
|
53
|
-
import { hasRTEContent } from '../../../brand-page-maker/utils';
|
|
54
|
-
import { isURL, isEmail, isTel } from '../../../utils/validator.util';
|
|
55
|
-
import { getRouteParamsByPage } from '../../utils/route.util';
|
|
56
|
-
import { BP_PAGE_SLUG_ROUTE_NAME, BP_SLUG_ROUTE_NAME } from '../../constants';
|
|
57
|
-
|
|
58
|
-
const props = defineProps({
|
|
59
|
-
viewModel: {
|
|
60
|
-
type: Object as PropType<BookingSectionViewModel>,
|
|
61
|
-
required: true,
|
|
62
|
-
},
|
|
63
|
-
context: {
|
|
64
|
-
type: Object as PropType<BrandPageContext>,
|
|
65
|
-
required: true,
|
|
66
|
-
},
|
|
67
|
-
containerClientWidth: {
|
|
68
|
-
type: Number as PropType<number | undefined>,
|
|
69
|
-
required: false,
|
|
70
|
-
default: undefined,
|
|
71
|
-
},
|
|
72
|
-
containerClientHeight: {
|
|
73
|
-
type: Number as PropType<number | undefined>,
|
|
74
|
-
required: false,
|
|
75
|
-
default: undefined,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const router = useRouter();
|
|
80
|
-
|
|
81
|
-
const handleUrlClick = (url: string) => {
|
|
82
|
-
if (url && isURL(url)) {
|
|
83
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const handlePageNavigation = (pageSlug: string) => {
|
|
88
|
-
if (!pageSlug) return;
|
|
89
|
-
|
|
90
|
-
const routeParams = getRouteParamsByPage(
|
|
91
|
-
!!props.context.customDomain,
|
|
92
|
-
props.context.brandPageSlug,
|
|
93
|
-
pageSlug,
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const routeName = !!props.context.customDomain
|
|
97
|
-
? BP_SLUG_ROUTE_NAME
|
|
98
|
-
: BP_PAGE_SLUG_ROUTE_NAME;
|
|
99
|
-
|
|
100
|
-
router.push({
|
|
101
|
-
name: routeName,
|
|
102
|
-
params: routeParams,
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const handleEmailClick = (email?: string, fallbackUrl?: string) => {
|
|
107
|
-
if (email && isEmail(email)) {
|
|
108
|
-
window.location.href = `mailto:${email}`;
|
|
109
|
-
} else if (fallbackUrl && isEmail(fallbackUrl)) {
|
|
110
|
-
window.location.href = `mailto:${fallbackUrl}`;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const handlePhoneClick = (tel?: string, fallbackUrl?: string) => {
|
|
115
|
-
if (tel && isTel(tel)) {
|
|
116
|
-
window.location.href = `tel:${tel}`;
|
|
117
|
-
} else if (fallbackUrl && isTel(fallbackUrl)) {
|
|
118
|
-
window.location.href = `tel:${fallbackUrl}`;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const handleFallbackClick = (url?: string) => {
|
|
123
|
-
if (!url) return;
|
|
124
|
-
|
|
125
|
-
if (isEmail(url)) {
|
|
126
|
-
window.location.href = `mailto:${url}`;
|
|
127
|
-
} else if (isTel(url)) {
|
|
128
|
-
window.location.href = `tel:${url}`;
|
|
129
|
-
} else if (isURL(url)) {
|
|
130
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const onClickUrl = () => {
|
|
135
|
-
const { buttonLinkType, url, pageSlug, email, tel } = props.viewModel;
|
|
136
|
-
|
|
137
|
-
switch (buttonLinkType) {
|
|
138
|
-
case 'url':
|
|
139
|
-
handleUrlClick(url);
|
|
140
|
-
break;
|
|
141
|
-
|
|
142
|
-
case 'page':
|
|
143
|
-
handlePageNavigation(pageSlug);
|
|
144
|
-
break;
|
|
145
|
-
|
|
146
|
-
case 'mailTo':
|
|
147
|
-
handleEmailClick(email, url);
|
|
148
|
-
break;
|
|
149
|
-
|
|
150
|
-
case 'tel':
|
|
151
|
-
handlePhoneClick(tel, url);
|
|
152
|
-
break;
|
|
153
|
-
|
|
154
|
-
default:
|
|
155
|
-
handleFallbackClick(url);
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
const renderText = computed((): string => {
|
|
161
|
-
if (!props.viewModel.description) {
|
|
162
|
-
return '';
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (hasRTEContent(props.viewModel.description)) {
|
|
166
|
-
return props.viewModel.description;
|
|
167
|
-
} else {
|
|
168
|
-
return getRenderText(props.viewModel.description);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
const hasDescriptionText = computed((): boolean => {
|
|
173
|
-
if (hasRTEContent(props.viewModel.description)) {
|
|
174
|
-
return escapeContentText(props.viewModel.description) !== '';
|
|
175
|
-
} else {
|
|
176
|
-
return props.viewModel?.description?.length > 0;
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
const buttonStyle = computed((): StyleValue => {
|
|
181
|
-
const buttonStyle = {
|
|
182
|
-
color: props.viewModel.buttonStyles?.style.color,
|
|
183
|
-
...props.viewModel.buttonStyles?.style,
|
|
184
|
-
};
|
|
185
|
-
const buttonTextStyle = {
|
|
186
|
-
...buttonStyle,
|
|
187
|
-
color: props.viewModel.buttonTextStyle.color,
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
return buttonTextStyle as StyleValue;
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
const isValidUrl = (url?: string): boolean => !!(url && isURL(url));
|
|
194
|
-
const isValidEmail = (email?: string): boolean => !!(email && isEmail(email));
|
|
195
|
-
const isValidPhone = (tel?: string): boolean => !!(tel && isTel(tel));
|
|
196
|
-
const isValidPage = (pageSlug?: string): boolean => !!pageSlug;
|
|
197
|
-
|
|
198
|
-
const hasValidTarget = (
|
|
199
|
-
buttonLinkType: string,
|
|
200
|
-
url?: string,
|
|
201
|
-
pageSlug?: string,
|
|
202
|
-
email?: string,
|
|
203
|
-
tel?: string,
|
|
204
|
-
): boolean => {
|
|
205
|
-
switch (buttonLinkType) {
|
|
206
|
-
case 'url':
|
|
207
|
-
return isValidUrl(url);
|
|
208
|
-
|
|
209
|
-
case 'page':
|
|
210
|
-
return isValidPage(pageSlug);
|
|
211
|
-
|
|
212
|
-
case 'mailTo':
|
|
213
|
-
return isValidEmail(email) || isValidEmail(url);
|
|
214
|
-
|
|
215
|
-
case 'tel':
|
|
216
|
-
return isValidPhone(tel) || isValidPhone(url);
|
|
217
|
-
|
|
218
|
-
default:
|
|
219
|
-
return isValidUrl(url) || isValidEmail(url) || isValidPhone(url);
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const shouldShowButton = computed((): boolean => {
|
|
224
|
-
const hasButtonText = !!props.viewModel.buttonText?.length;
|
|
225
|
-
|
|
226
|
-
if (!hasButtonText) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const { buttonLinkType, url, pageSlug, email, tel } = props.viewModel;
|
|
231
|
-
return hasValidTarget(buttonLinkType, url, pageSlug, email, tel);
|
|
232
|
-
});
|
|
233
|
-
</script>
|
|
234
|
-
|
|
235
|
-
<style scoped>
|
|
236
|
-
.c_banner-container {
|
|
237
|
-
max-width: var(--brandsite-max-width);
|
|
238
|
-
margin: 0 auto;
|
|
239
|
-
}
|
|
240
|
-
</style>
|