@designcrowd/library.brand-page 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-VQCQvlMg.js → CreatedOnBrandCrowd-de-de-CtvPtYF6.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DSf3BjCG.js → CreatedOnBrandCrowd-en-us-eGF-EjAX.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DGcdM9Ec.js → CreatedOnBrandCrowd-es-es-CSemsOtT.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-C9g1fc39.js → CreatedOnBrandCrowd-fr-ca-DzylX-AT.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-C9g1fc39.js → CreatedOnBrandCrowd-fr-fr-DzylX-AT.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DSXr7Bxl.js → CreatedOnBrandCrowd-pt-br-QMUxXQsE.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DSXr7Bxl.js → CreatedOnBrandCrowd-pt-pt-QMUxXQsE.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BPdCL6wS.js → CreatedOnDcom-de-de-M7OoJt-1.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CLkSTQRu.js → CreatedOnDcom-en-us-D7hMM0AI.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CRknMAGv.js → CreatedOnDcom-es-es-CLw-BLp2.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-ClAY_dHI.js → CreatedOnDcom-fr-ca-BRu_kmeu.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DQtv9rR-.js → CreatedOnDcom-fr-fr-IMnEv_yM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BbIxvmxv.js → CreatedOnDcom-pt-br-Bt6v1p27.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BOfOesBj.js → CreatedOnDcom-pt-pt-BVsFJIJg.js} +1 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +16 -2
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +17 -0
- package/lib/src/brand-page/components/page/Page.mixin.d.ts +2 -1
- package/lib/src/brand-page/components/page/Page.mixin.js +12 -7
- package/lib/src/brand-page/components/page-header/HeaderLayout.stories.d.ts +1 -0
- package/lib/src/brand-page/components/page-header/HeaderLayout.stories.js +9 -0
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.d.ts +3 -1
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.js +10 -4
- package/lib/src/brand-page/constants/sections/header-display.constants.d.ts +3 -0
- package/lib/src/brand-page/constants/sections/header-display.constants.js +15 -0
- package/lib/src/brand-page/models/index.d.ts +12 -0
- package/lib/src/brand-page/models/index.js +4 -0
- package/lib/src/brand-page/utils/context.util.d.ts +1 -0
- package/lib/src/brand-page/utils/context.util.js +9 -0
- package/lib/src/brand-page/utils/route.util.d.ts +1 -0
- package/lib/src/brand-page/utils/route.util.js +9 -0
- package/lib/src/brand-page/utils/view-model.util.js +53 -1
- package/lib/src/brand-page/view-models.d.ts +3 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +2 -1
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1626 -0
- package/lib/src/brand-page-maker/validators/section-button.validator.d.ts +5 -2
- package/lib/src/brand-page-maker/validators/section-button.validator.js +11 -15
- package/lib/src/{bundled-translations-B2q5GWTQ.js → bundled-translations-KY0aSmMp.js} +9 -9
- package/lib/src/{bundled-translations.de-DE-FhH2H_rd.js → bundled-translations.de-DE-BIFi4bYj.js} +9 -9
- package/lib/src/{bundled-translations.es-ES-_ZExxMi7.js → bundled-translations.es-ES-CHlKuPLO.js} +5 -5
- package/lib/src/{bundled-translations.fr-CA-Tg-ODIiC.js → bundled-translations.fr-CA-DR1fvm8e.js} +1 -1
- package/lib/src/{bundled-translations.fr-FR-C0sU51Mz.js → bundled-translations.fr-FR-DnpWVIQg.js} +9 -9
- package/lib/src/{bundled-translations.pt-BR-MYFIhA4u.js → bundled-translations.pt-BR-p8szTOiT.js} +17 -17
- package/lib/src/{bundled-translations.pt-PT-DeUBSzCB.js → bundled-translations.pt-PT-DEk39NhW.js} +22 -22
- package/lib/src/bundles/bundled-translations.de-DE.json +6 -1
- package/lib/src/bundles/bundled-translations.es-ES.json +6 -1
- package/lib/src/bundles/bundled-translations.fr-CA.json +6 -1
- package/lib/src/bundles/bundled-translations.fr-FR.json +6 -1
- package/lib/src/bundles/bundled-translations.json +6 -1
- package/lib/src/bundles/bundled-translations.pt-BR.json +6 -1
- package/lib/src/bundles/bundled-translations.pt-PT.json +6 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +573 -135
- package/lib/src/css/library.brand-page-brandPage.min.css +573 -135
- package/lib/src/css/library.brand-page-designCom.min.css +573 -135
- package/lib/src/css/library.brand-page-preview.min.css +573 -135
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-BMVF4uNy.js → lib-B38VVCSw.js} +20304 -19843
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +14 -2
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.js +14 -0
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/page-navigation/store/page-navigation-store.d.ts +1 -0
- package/lib/src/shared/page-navigation/store/page-navigation-store.js +12 -0
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +2 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +190 -1
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +184 -2
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +34 -2
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -2
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +3 -0
- package/package.json +2 -2
- package/src/brand-page/components/navigation/hamburger/HamburgerNavigation.vue +1 -0
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +18 -1
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +73 -3
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +181 -0
- package/src/brand-page/components/page/Page.mixin.ts +21 -11
- package/src/brand-page/components/page/Page.vue +2 -0
- package/src/brand-page/components/page-header/HeaderLayout.stories.ts +10 -0
- package/src/brand-page/components/page-header/HeaderLayout.vue +415 -71
- package/src/brand-page/components/page-header/PageHeader.mixin.ts +14 -10
- package/src/brand-page/components/page-header/PageHeader.vue +16 -1
- package/src/brand-page/components/page-header/PageHeader.vue.test.ts +339 -0
- package/src/brand-page/constants/sections/header-display.constants.test.ts +44 -0
- package/src/brand-page/constants/sections/header-display.constants.ts +35 -0
- package/src/brand-page/models/header-button.model.test.ts +85 -0
- package/src/brand-page/models/index.ts +19 -0
- package/src/brand-page/utils/context.util.ts +15 -0
- package/src/brand-page/utils/route.util.ts +13 -0
- package/src/brand-page/utils/view-model.util.test.ts +151 -1
- package/src/brand-page/utils/view-model.util.ts +73 -1
- package/src/brand-page/view-models.ts +3 -0
- package/src/brand-page-maker/validators/section-button.validator.ts +23 -19
- package/src/bundles/bundled-translations.de-DE.json +6 -1
- package/src/bundles/bundled-translations.es-ES.json +6 -1
- package/src/bundles/bundled-translations.fr-CA.json +6 -1
- package/src/bundles/bundled-translations.fr-FR.json +6 -1
- package/src/bundles/bundled-translations.json +6 -1
- package/src/bundles/bundled-translations.pt-BR.json +6 -1
- package/src/bundles/bundled-translations.pt-PT.json +6 -1
- package/src/shared/content-settings/components/text-field/TextField.mixin.ts +15 -0
- package/src/shared/content-settings/components/url-field/UrlField.vue +1 -0
- package/src/shared/page-navigation/store/page-navigation-store.ts +16 -0
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.button-section.test.ts +131 -0
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +65 -10
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +305 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +265 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.test.ts +354 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.vue +48 -9
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.header-button.test.ts +114 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +38 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.de-DE.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.es-ES.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.fr-CA.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.fr-FR.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.pt-BR.json +6 -1
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.pt-PT.json +6 -1
- package/src/shared/page-settings/store/page-settings-store.ts +2 -0
package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div v-if="
|
|
2
|
+
<div v-if="isPickerVisible" class="tw-mb-2">
|
|
3
3
|
<p
|
|
4
4
|
class="tw-font-sans tw-font-bold tw-text-secondary-800 tw-text-sm tw-mb-2"
|
|
5
5
|
>
|
|
@@ -23,10 +23,12 @@ import { HEADER_DISPLAY_STYLE_CONFIGS } from '@brand-page';
|
|
|
23
23
|
import {
|
|
24
24
|
HEADER_DISPLAY,
|
|
25
25
|
NAVIGATION_DISPLAY,
|
|
26
|
+
VIEWPORTS,
|
|
26
27
|
type ViewportsType,
|
|
27
28
|
} from '@brand-page';
|
|
28
29
|
import type { ButtonGroupOption } from '@brand-page-maker/models/button-group.model';
|
|
29
30
|
import { useBrandPageMakerStore } from '@brand-page-maker/stores';
|
|
31
|
+
import { usePageNavigationStore } from '../../../page-navigation/store/page-navigation-store';
|
|
30
32
|
import { useUiPageSettingsStore } from '../../store';
|
|
31
33
|
import { tr } from '@src/composables/useTranslate';
|
|
32
34
|
|
|
@@ -36,12 +38,36 @@ interface Props {
|
|
|
36
38
|
navigationDisplayType: string;
|
|
37
39
|
isLogoVisible: boolean;
|
|
38
40
|
viewport: ViewportsType;
|
|
41
|
+
showHeaderButton?: boolean;
|
|
39
42
|
}
|
|
40
|
-
const props = defineProps<Props>()
|
|
43
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
44
|
+
showHeaderButton: false,
|
|
45
|
+
});
|
|
41
46
|
|
|
42
47
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
43
48
|
const pageSettingsStore = useUiPageSettingsStore();
|
|
44
49
|
|
|
50
|
+
const pageNavigationStore = usePageNavigationStore();
|
|
51
|
+
|
|
52
|
+
// Desktop no-logo with the button on: nothing left to choose when the variants only
|
|
53
|
+
// differ by where they'd put things that aren't there. Hamburger — icon + button are
|
|
54
|
+
// pinned to the right regardless. Bar nav — only once the nav itself is hidden (no
|
|
55
|
+
// visible pages), where the button holds the right edge in every variant.
|
|
56
|
+
const isHidden = computed((): boolean => {
|
|
57
|
+
if (
|
|
58
|
+
!props.showHeaderButton ||
|
|
59
|
+
props.viewport !== VIEWPORTS.desktop ||
|
|
60
|
+
props.isLogoVisible
|
|
61
|
+
) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
props.navigationDisplayType.includes('hamburger') ||
|
|
67
|
+
!pageNavigationStore.hasVisibleNavigation
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
45
71
|
const options = computed(() => {
|
|
46
72
|
let filteredConfigs = HEADER_DISPLAY_STYLE_CONFIGS.filter((config) => {
|
|
47
73
|
return (
|
|
@@ -72,13 +98,16 @@ const options = computed(() => {
|
|
|
72
98
|
}
|
|
73
99
|
}
|
|
74
100
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
101
|
+
// Copy before setting isSelected — the config object is shared app-wide.
|
|
102
|
+
const filteredOptions: ButtonGroupOption[] = filteredConfigs.map(
|
|
103
|
+
(config) => ({
|
|
104
|
+
...config.option,
|
|
105
|
+
isSelected: props.displayStyle === config.option.value,
|
|
106
|
+
...(props.showHeaderButton && config.withButtonIconName
|
|
107
|
+
? { iconName: config.withButtonIconName }
|
|
108
|
+
: {}),
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
82
111
|
|
|
83
112
|
const selectedOption = filteredOptions.find((x) => x.isSelected);
|
|
84
113
|
|
|
@@ -176,6 +205,16 @@ const options = computed(() => {
|
|
|
176
205
|
return filteredOptions;
|
|
177
206
|
});
|
|
178
207
|
|
|
208
|
+
const isPickerVisible = computed((): boolean => {
|
|
209
|
+
// Read `options` FIRST and unconditionally: building it also migrates a stored display
|
|
210
|
+
// style that no longer fits (e.g. the logo was switched off) to its supported equivalent.
|
|
211
|
+
// Short-circuiting past it leaves the header rendering an unsupported style — a with-logo
|
|
212
|
+
// style with no logo collapses the band and its pinned button hangs out of the header.
|
|
213
|
+
const hasStylesToChooseFrom = options.value.length > 1;
|
|
214
|
+
|
|
215
|
+
return hasStylesToChooseFrom && !isHidden.value;
|
|
216
|
+
});
|
|
217
|
+
|
|
179
218
|
const numOfColumns = computed(() => {
|
|
180
219
|
if (options.value.length === 3) {
|
|
181
220
|
return 3;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { setLocaleAsync } from '@src/composables/useTranslate';
|
|
2
|
+
import { describe, test, expect, beforeEach } from 'vitest';
|
|
3
|
+
import { createPinia, setActivePinia } from 'pinia';
|
|
4
|
+
import { VIEWPORTS } from '@brand-page';
|
|
5
|
+
import type { HeaderButton } from '@brand-page';
|
|
6
|
+
import mixin from './PageSettingsSectionStyles.mixin';
|
|
7
|
+
import { useUiPageSettingsStore } from '@shared/page-settings/store';
|
|
8
|
+
|
|
9
|
+
// The button is configured once but must land on BOTH viewports; tested against a hand-built context wired to the real store.
|
|
10
|
+
const { onHeaderButtonChange } = (
|
|
11
|
+
mixin as unknown as {
|
|
12
|
+
methods: {
|
|
13
|
+
onHeaderButtonChange(this: unknown, patch: Partial<HeaderButton>): void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
).methods;
|
|
17
|
+
|
|
18
|
+
describe('PageSettingsSectionStyles.mixin onHeaderButtonChange', () => {
|
|
19
|
+
// the seed's "Contact Us" text resolves through i18n
|
|
20
|
+
beforeAll(async () => {
|
|
21
|
+
await setLocaleAsync('en-US');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
let pageSettingsStore: ReturnType<typeof useUiPageSettingsStore>;
|
|
25
|
+
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
setActivePinia(createPinia());
|
|
28
|
+
pageSettingsStore = useUiPageSettingsStore();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const headers = () => pageSettingsStore.sections.header;
|
|
32
|
+
|
|
33
|
+
// The panel reads/patches the current viewport (desktop here).
|
|
34
|
+
const context = () => ({
|
|
35
|
+
pageSettingsStore,
|
|
36
|
+
headerButton: headers()[VIEWPORTS.desktop].headerButton,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const change = (patch: Partial<HeaderButton>) =>
|
|
40
|
+
onHeaderButtonChange.call(context(), patch);
|
|
41
|
+
|
|
42
|
+
test('the first write seeds a full button on both viewports', () => {
|
|
43
|
+
change({ isVisible: true });
|
|
44
|
+
|
|
45
|
+
expect(headers()[VIEWPORTS.desktop].headerButton).toEqual({
|
|
46
|
+
isVisible: true,
|
|
47
|
+
text: 'Contact Us',
|
|
48
|
+
buttonLinkType: 'url',
|
|
49
|
+
});
|
|
50
|
+
expect(headers()[VIEWPORTS.mobile].headerButton).toEqual(
|
|
51
|
+
headers()[VIEWPORTS.desktop].headerButton,
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('off by default — nothing is seeded until something is written', () => {
|
|
56
|
+
expect(headers()[VIEWPORTS.desktop].headerButton).toBeUndefined();
|
|
57
|
+
expect(headers()[VIEWPORTS.mobile].headerButton).toBeUndefined();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('later writes patch one key and still land on both viewports', () => {
|
|
61
|
+
change({ isVisible: true });
|
|
62
|
+
change({ text: 'Book now' });
|
|
63
|
+
change({ buttonLinkType: 'tel', url: '12345-6789' });
|
|
64
|
+
|
|
65
|
+
const expected: HeaderButton = {
|
|
66
|
+
isVisible: true,
|
|
67
|
+
text: 'Book now',
|
|
68
|
+
buttonLinkType: 'tel',
|
|
69
|
+
url: '12345-6789',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
expect(headers()[VIEWPORTS.desktop].headerButton).toEqual(expected);
|
|
73
|
+
expect(headers()[VIEWPORTS.mobile].headerButton).toEqual(expected);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('each viewport holds its own object, not a shared reference', () => {
|
|
77
|
+
change({ isVisible: true });
|
|
78
|
+
|
|
79
|
+
expect(headers()[VIEWPORTS.mobile].headerButton).not.toBe(
|
|
80
|
+
headers()[VIEWPORTS.desktop].headerButton,
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test('a viewport that somehow diverged is reconciled by the next write', () => {
|
|
85
|
+
change({ isVisible: true, text: 'Contact' });
|
|
86
|
+
|
|
87
|
+
headers()[VIEWPORTS.mobile].headerButton = {
|
|
88
|
+
isVisible: false,
|
|
89
|
+
text: 'stale',
|
|
90
|
+
buttonLinkType: 'url',
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
change({ text: 'Contact us' });
|
|
94
|
+
|
|
95
|
+
expect(headers()[VIEWPORTS.mobile].headerButton).toEqual(
|
|
96
|
+
headers()[VIEWPORTS.desktop].headerButton,
|
|
97
|
+
);
|
|
98
|
+
expect(headers()[VIEWPORTS.mobile].headerButton?.text).toBe('Contact us');
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('toggling off keeps the config, only flipping isVisible', () => {
|
|
102
|
+
change({ isVisible: true, text: 'Contact us' });
|
|
103
|
+
change({ isVisible: false });
|
|
104
|
+
|
|
105
|
+
expect(headers()[VIEWPORTS.desktop].headerButton).toEqual({
|
|
106
|
+
isVisible: false,
|
|
107
|
+
text: 'Contact us',
|
|
108
|
+
buttonLinkType: 'url',
|
|
109
|
+
});
|
|
110
|
+
expect(headers()[VIEWPORTS.mobile].headerButton).toEqual(
|
|
111
|
+
headers()[VIEWPORTS.desktop].headerButton,
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
PageSettingsFontSettingsOption,
|
|
10
10
|
} from '../../models';
|
|
11
11
|
import type {
|
|
12
|
+
HeaderButton,
|
|
12
13
|
LogoTheme,
|
|
13
14
|
NavigationDisplayType,
|
|
14
15
|
NavigationType,
|
|
@@ -27,6 +28,7 @@ import type {
|
|
|
27
28
|
BackgroundColorStyle,
|
|
28
29
|
} from '@brand-page';
|
|
29
30
|
import {
|
|
31
|
+
BUTTON_LINK_TYPE,
|
|
30
32
|
LOGO_SLIDER_DESKTOP_MAX,
|
|
31
33
|
LOGO_SLIDER_DESKTOP_MIN,
|
|
32
34
|
LOGO_SLIDER_MOBILE_MAX,
|
|
@@ -60,7 +62,14 @@ import {
|
|
|
60
62
|
} from '@shared/logo-settings/store';
|
|
61
63
|
import { FabricRenderClient } from '../../../../clients/fabric-render-client';
|
|
62
64
|
import { parseLogoThemeToCssStyles } from '@brand-page/utils';
|
|
63
|
-
import { commonTr } from '@src/composables/useTranslate';
|
|
65
|
+
import { commonTr, pageSettingsSectionTr } from '@src/composables/useTranslate';
|
|
66
|
+
|
|
67
|
+
// Starting values for a brand-new button; real "Contact Us" text so the label is never empty.
|
|
68
|
+
const newHeaderButton = (): HeaderButton => ({
|
|
69
|
+
isVisible: false,
|
|
70
|
+
text: pageSettingsSectionTr('buttonLabelPlaceholder'),
|
|
71
|
+
buttonLinkType: BUTTON_LINK_TYPE.url,
|
|
72
|
+
});
|
|
64
73
|
|
|
65
74
|
const viewportsWithTr = () => [
|
|
66
75
|
{
|
|
@@ -162,6 +171,12 @@ export default defineComponent({
|
|
|
162
171
|
header(): PageHeaderDesktop | PageHeaderMobile {
|
|
163
172
|
return this.sections[PAGE_SECTIONS.header][this.viewport];
|
|
164
173
|
},
|
|
174
|
+
headerButton(): HeaderButton | undefined {
|
|
175
|
+
return this.header.headerButton;
|
|
176
|
+
},
|
|
177
|
+
isHeaderButtonVisible(): boolean {
|
|
178
|
+
return this.headerButton?.isVisible === true;
|
|
179
|
+
},
|
|
165
180
|
navigationType(): NavigationType {
|
|
166
181
|
return getNavigationType(this.navigation.displayType);
|
|
167
182
|
},
|
|
@@ -451,6 +466,28 @@ export default defineComponent({
|
|
|
451
466
|
});
|
|
452
467
|
},
|
|
453
468
|
|
|
469
|
+
onHeaderButtonChange(patch: Partial<HeaderButton>) {
|
|
470
|
+
const value: HeaderButton = {
|
|
471
|
+
...newHeaderButton(),
|
|
472
|
+
...this.headerButton,
|
|
473
|
+
...patch,
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
// Write the whole button to BOTH viewports (own copy each) so they always match.
|
|
477
|
+
this.pageSettingsStore.setPageSettingsSectionValue({
|
|
478
|
+
sectionName: PAGE_SECTIONS.header,
|
|
479
|
+
propName: 'headerButton',
|
|
480
|
+
value: { ...value },
|
|
481
|
+
viewport: VIEWPORTS.mobile,
|
|
482
|
+
});
|
|
483
|
+
this.pageSettingsStore.setPageSettingsSectionValue({
|
|
484
|
+
sectionName: PAGE_SECTIONS.header,
|
|
485
|
+
propName: 'headerButton',
|
|
486
|
+
value: { ...value },
|
|
487
|
+
viewport: VIEWPORTS.desktop,
|
|
488
|
+
});
|
|
489
|
+
},
|
|
490
|
+
|
|
454
491
|
onItemListIntentImageReplace(
|
|
455
492
|
name: PageSectionStyleOption,
|
|
456
493
|
{ index }: { index: number },
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"iconStyle": "Symbol-Stil",
|
|
9
9
|
"logoSize": "Logogröße",
|
|
10
10
|
"socialLinks": "Social-Media-Links",
|
|
11
|
-
"copyright": "Copyright"
|
|
11
|
+
"copyright": "Copyright",
|
|
12
|
+
"buttonLabel": "Etikett",
|
|
13
|
+
"buttonLabelPlaceholder": "Kontakt",
|
|
14
|
+
"buttonLink": "Link",
|
|
15
|
+
"buttonFillColor": "Füllfarbe",
|
|
16
|
+
"buttonBorderColor": "Randfarbe"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"iconStyle": "Estilo de icono",
|
|
9
9
|
"logoSize": "Tamaño del logo",
|
|
10
10
|
"socialLinks": "Enlaces a redes sociales",
|
|
11
|
-
"copyright": "Derechos de autor"
|
|
11
|
+
"copyright": "Derechos de autor",
|
|
12
|
+
"buttonLabel": "Etiqueta",
|
|
13
|
+
"buttonLabelPlaceholder": "Contacto",
|
|
14
|
+
"buttonLink": "Enlace",
|
|
15
|
+
"buttonFillColor": "Color de relleno",
|
|
16
|
+
"buttonBorderColor": "Color del borde"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"iconStyle": "Style d'icône",
|
|
9
9
|
"logoSize": "Taille du logo",
|
|
10
10
|
"socialLinks": "Liens vers les réseaux sociaux",
|
|
11
|
-
"copyright": "Droits d’auteur"
|
|
11
|
+
"copyright": "Droits d’auteur",
|
|
12
|
+
"buttonLabel": "Étiquette",
|
|
13
|
+
"buttonLabelPlaceholder": "Nous joindre",
|
|
14
|
+
"buttonLink": "Lien",
|
|
15
|
+
"buttonFillColor": "Couleur de remplissage",
|
|
16
|
+
"buttonBorderColor": "Couleur de bordure"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"iconStyle": "Style d'icône",
|
|
9
9
|
"logoSize": "Taille du logo",
|
|
10
10
|
"socialLinks": "Liens vers les réseaux sociaux",
|
|
11
|
-
"copyright": "Droits d’auteur"
|
|
11
|
+
"copyright": "Droits d’auteur",
|
|
12
|
+
"buttonLabel": "Étiquette",
|
|
13
|
+
"buttonLabelPlaceholder": "Contactez-nous",
|
|
14
|
+
"buttonLink": "Lien",
|
|
15
|
+
"buttonFillColor": "Couleur de remplissage",
|
|
16
|
+
"buttonBorderColor": "Couleur de bordure"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"iconStyle": "Icon style",
|
|
9
9
|
"logoSize": "Logo Size",
|
|
10
10
|
"socialLinks": "Social Links",
|
|
11
|
-
"copyright": "Copyright"
|
|
11
|
+
"copyright": "Copyright",
|
|
12
|
+
"buttonLabel": "Label",
|
|
13
|
+
"buttonLabelPlaceholder": "Contact Us",
|
|
14
|
+
"buttonLink": "Link",
|
|
15
|
+
"buttonFillColor": "Fill color",
|
|
16
|
+
"buttonBorderColor": "Border color"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"iconStyle": "Estilo de ícone",
|
|
9
9
|
"logoSize": "Tamanho do logotipo",
|
|
10
10
|
"socialLinks": "Links de redes sociais",
|
|
11
|
-
"copyright": "Direitos autorais"
|
|
11
|
+
"copyright": "Direitos autorais",
|
|
12
|
+
"buttonLabel": "Rótulo",
|
|
13
|
+
"buttonLabelPlaceholder": "Entre em contato",
|
|
14
|
+
"buttonLink": "Link",
|
|
15
|
+
"buttonFillColor": "Cor de preenchimento",
|
|
16
|
+
"buttonBorderColor": "Cor da borda"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"iconStyle": "Estilo de Ícone",
|
|
9
9
|
"logoSize": "Tamanho do logótipo",
|
|
10
10
|
"socialLinks": "Links de redes sociais",
|
|
11
|
-
"copyright": "Direitos de autor"
|
|
11
|
+
"copyright": "Direitos de autor",
|
|
12
|
+
"buttonLabel": "Etiqueta",
|
|
13
|
+
"buttonLabelPlaceholder": "Contacte-nos",
|
|
14
|
+
"buttonLink": "Link",
|
|
15
|
+
"buttonFillColor": "Cor de preenchimento",
|
|
16
|
+
"buttonBorderColor": "Cor da borda"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import type { NavigationType } from '@brand-page';
|
|
13
13
|
import type {
|
|
14
14
|
Content,
|
|
15
|
+
HeaderButton,
|
|
15
16
|
ImageGalleryItem,
|
|
16
17
|
LinksItem,
|
|
17
18
|
LogoImageModel,
|
|
@@ -242,6 +243,7 @@ export const useUiPageSettingsStore = defineStore('uiPageSettings', {
|
|
|
242
243
|
| LinksItem[]
|
|
243
244
|
| BrandPageCssStyle
|
|
244
245
|
| Partial<ImageGalleryItem>
|
|
246
|
+
| HeaderButton
|
|
245
247
|
| number
|
|
246
248
|
| null
|
|
247
249
|
| undefined;
|