@designcrowd/library.brand-page 6.1.17-ast-header-button-1 → 6.1.17-ast-header-button-3

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 (71) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-ClD0Z4Nf.js → CreatedOnBrandCrowd-de-de-DqOx33Hl.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-x35bJCuy.js → CreatedOnBrandCrowd-en-us-DbhD9tOr.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-zm1tzSt2.js → CreatedOnBrandCrowd-es-es-DU-Pejg6.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-B7XCRP8c.js → CreatedOnBrandCrowd-fr-ca-BfysrkN9.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-B7XCRP8c.js → CreatedOnBrandCrowd-fr-fr-BfysrkN9.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-7QHheNW1.js → CreatedOnBrandCrowd-pt-br-D4tN4FhI.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-7QHheNW1.js → CreatedOnBrandCrowd-pt-pt-D4tN4FhI.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-Yn0mPf9E.js → CreatedOnDcom-de-de-Dv47zJq5.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-BO8_HZ9Q.js → CreatedOnDcom-en-us-O0vjHSIs.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-cZcgEsjB.js → CreatedOnDcom-es-es-3QEESIXW.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-CA-hvR-A.js → CreatedOnDcom-fr-ca-DpuXDaEo.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-CEWt2rrU.js → CreatedOnDcom-fr-fr-CBNN8xjU.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DYnOYrQv.js → CreatedOnDcom-pt-br-Dy8K9yJc.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-C7BpvRge.js → CreatedOnDcom-pt-pt-CF4BGX0M.js} +1 -1
  15. package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +0 -11
  16. package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +4 -11
  17. package/lib/src/brand-page/components/page/Page.mixin.d.ts +2 -1
  18. package/lib/src/brand-page/components/page/Page.mixin.js +10 -1
  19. package/lib/src/brand-page/components/page-header/HeaderLayout.stories.d.ts +1 -0
  20. package/lib/src/brand-page/components/page-header/HeaderLayout.stories.js +9 -0
  21. package/lib/src/brand-page/components/page-header/PageHeader.mixin.js +1 -3
  22. package/lib/src/brand-page/constants/sections/header-display.constants.d.ts +2 -0
  23. package/lib/src/brand-page/constants/sections/header-display.constants.js +5 -0
  24. package/lib/src/brand-page/models/index.d.ts +1 -1
  25. package/lib/src/brand-page/models/index.js +4 -3
  26. package/lib/src/brand-page/utils/view-model.util.d.ts +0 -1
  27. package/lib/src/brand-page/utils/view-model.util.js +6 -10
  28. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -0
  29. package/lib/src/bundled-translations-BajBqXza.js +181 -0
  30. package/lib/src/bundles/bundled-translations.json +3 -1
  31. package/lib/src/css/library.brand-page-brandCrowd.min.css +228 -209
  32. package/lib/src/css/library.brand-page-brandPage.min.css +228 -209
  33. package/lib/src/css/library.brand-page-designCom.min.css +228 -209
  34. package/lib/src/css/library.brand-page-preview.min.css +228 -209
  35. package/lib/src/index.mjs +1 -1
  36. package/lib/src/{lib-DnnaLgX8.js → lib-uUGvJnFR.js} +11668 -11666
  37. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +2 -12
  38. package/package.json +1 -1
  39. package/src/brand-page/components/button/Button.vue +1 -4
  40. package/src/brand-page/components/button/Button.vue.test.ts +1 -2
  41. package/src/brand-page/components/navigation/hamburger/HamburgerNavigation.vue +1 -0
  42. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +4 -11
  43. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +31 -6
  44. package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +23 -17
  45. package/src/brand-page/components/page/Page.mixin.ts +16 -0
  46. package/src/brand-page/components/page/Page.vue +2 -6
  47. package/src/brand-page/components/page-header/HeaderLayout.stories.ts +10 -0
  48. package/src/brand-page/components/page-header/HeaderLayout.vue +36 -68
  49. package/src/brand-page/components/page-header/PageHeader.mixin.ts +1 -3
  50. package/src/brand-page/components/page-header/PageHeader.vue +1 -3
  51. package/src/brand-page/components/page-header/PageHeader.vue.test.ts +14 -39
  52. package/src/brand-page/components/page-header/i18n/page-header.json +5 -0
  53. package/src/brand-page/constants/sections/header-display.constants.test.ts +44 -0
  54. package/src/brand-page/constants/sections/header-display.constants.ts +13 -0
  55. package/src/brand-page/models/header-button.model.test.ts +1 -2
  56. package/src/brand-page/models/index.ts +6 -3
  57. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +0 -6
  58. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +0 -2
  59. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +0 -4
  60. package/src/brand-page/utils/view-model.util.test.ts +7 -2
  61. package/src/brand-page/utils/view-model.util.ts +7 -11
  62. package/src/bundles/bundled-translations.json +3 -1
  63. package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.button-section.test.ts +4 -10
  64. package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +39 -10
  65. package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +44 -19
  66. package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.test.ts +2 -8
  67. package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.vue +2 -7
  68. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.header-button.test.ts +2 -7
  69. package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +2 -12
  70. package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.json +0 -1
  71. package/lib/src/bundled-translations-B8fAEel0.js +0 -179
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DnnaLgX8.js";
2
+ import { _ as t } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DnnaLgX8.js";
2
+ import { _ as t } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DnnaLgX8.js";
2
+ import { _ as t } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DnnaLgX8.js";
2
+ import { _ as t } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DnnaLgX8.js";
2
+ import { _ as t } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DnnaLgX8.js";
2
+ import { _ as t } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DnnaLgX8.js";
2
+ import { _ as t } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DnnaLgX8.js";
2
+ import { _ as e } from "./lib-uUGvJnFR.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DnnaLgX8.js";
2
+ import { _ as e } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DnnaLgX8.js";
2
+ import { _ as e } from "./lib-uUGvJnFR.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DnnaLgX8.js";
2
+ import { _ as e } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-DnnaLgX8.js";
2
+ import { _ as e } from "./lib-uUGvJnFR.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-DnnaLgX8.js";
2
+ import { _ as M } from "./lib-uUGvJnFR.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { openBlock as H, createElementBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-DnnaLgX8.js";
2
+ import { _ as M } from "./lib-uUGvJnFR.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -23,11 +23,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
23
23
  required: false;
24
24
  default: undefined;
25
25
  };
26
- isMobile: {
27
- type: BooleanConstructor;
28
- required: false;
29
- default: boolean;
30
- };
31
26
  }>, {}, {
32
27
  expandedItems: Record<string, boolean>;
33
28
  }, {
@@ -70,15 +65,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
70
65
  required: false;
71
66
  default: undefined;
72
67
  };
73
- isMobile: {
74
- type: BooleanConstructor;
75
- required: false;
76
- default: boolean;
77
- };
78
68
  }>> & Readonly<{
79
69
  "onClose-side-menu"?: ((...args: any[]) => any) | undefined;
80
70
  }>, {
81
- isMobile: boolean;
82
71
  headerButtonViewModel: ButtonViewModel;
83
72
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
84
73
  export default _default;
@@ -18,18 +18,13 @@ export default defineComponent({
18
18
  type: Object,
19
19
  required: true,
20
20
  },
21
+ // Provided only when the header row does not render the CTA (the caller
22
+ // decides via headerRowRendersCta) — absent means the drawer shows none.
21
23
  headerButtonViewModel: {
22
24
  type: Object,
23
25
  required: false,
24
26
  default: undefined,
25
27
  },
26
- // The desktop drawer suppresses the header CTA — the desktop header row already
27
- // renders it. Only the mobile drawer carries the button.
28
- isMobile: {
29
- type: Boolean,
30
- required: false,
31
- default: false,
32
- },
33
28
  },
34
29
  emits: ['close-side-menu'],
35
30
  data() {
@@ -63,7 +58,7 @@ export default defineComponent({
63
58
  return rest;
64
59
  },
65
60
  showHeaderButton() {
66
- return this.isMobile && Boolean(this.headerButtonViewModel);
61
+ return Boolean(this.headerButtonViewModel);
67
62
  },
68
63
  routes() {
69
64
  return this.visibleNavItems.map((navItem, _i) => {
@@ -100,9 +95,7 @@ export default defineComponent({
100
95
  closeSideMenu() {
101
96
  this.$emit('close-side-menu');
102
97
  },
103
- // In the maker preview the CTA is inert (BP-5852 decision): capture-phase so the
104
- // prevent lands before the inner anchor/router-link fires. On the published site
105
- // the click follows the link and the drawer closes behind it.
98
+ // Preview: inert (same guard as onHeaderCtaClick); published: follow link, close drawer.
106
99
  onDrawerCtaClick(event) {
107
100
  if (this.context.isPreview) {
108
101
  event.preventDefault();
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { BrandPageViewModel, ContentViewModel, PageViewModel } from '@brand-page/view-models';
2
+ import type { BrandPageViewModel, ButtonViewModel, ContentViewModel, PageViewModel } from '@brand-page/view-models';
3
3
  import type { BackgroundShape, BrandPageContext, ViewportsType } from '@brand-page/models';
4
4
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
5
  context: {
@@ -81,6 +81,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
81
81
  headerViewModelDesktop(): any;
82
82
  isNavigationEmbeddedInLogoMobile(): boolean;
83
83
  isNavigationEmbeddedInLogoDesktop(): boolean;
84
+ drawerHeaderButtonViewModel(): ButtonViewModel | undefined;
84
85
  shouldShowNavigation(): boolean;
85
86
  showNavigationAfterLogoMobile(): boolean;
86
87
  showNavigationAfterLogoDesktop(): boolean;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent } from 'vue';
2
- import { DEFAULT_FONT_FAMILY_KEY, FALLBACK_FONT_FAMILIES, FONT_FAMILY_CONFIGS, } from '../../constants';
2
+ import { DEFAULT_FONT_FAMILY_KEY, FALLBACK_FONT_FAMILIES, FONT_FAMILY_CONFIGS, headerRowRendersCta, } from '../../constants';
3
3
  import { getSlugFromContext, getPageHeadingText, buildPaletteRootCss, buildPaletteScopedCss, PAGE_SCOPE_ID_ATTRIBUTE, resolveColorReference, } from '@brand-page/utils';
4
4
  import { findNavItemByRelativePath } from '@brand-page/utils/route.util';
5
5
  import { BRAND_PAGE_TYPES } from '@brand-page/models';
@@ -276,6 +276,15 @@ export default defineComponent({
276
276
  this.contents[0]?.type === 'logo' &&
277
277
  this.viewModel.pages.length > 1);
278
278
  },
279
+ // Drawer shows the button exactly when the header row doesn't — never both.
280
+ drawerHeaderButtonViewModel() {
281
+ const header = this.viewModel.headerViewModelMobile;
282
+ if (!header.headerButtonViewModel ||
283
+ headerRowRendersCta(header.displayStyle, this.shouldShowNavigation)) {
284
+ return undefined;
285
+ }
286
+ return header.headerButtonViewModel;
287
+ },
279
288
  shouldShowNavigation() {
280
289
  // Show navigation if more than 1 non-hidden page exists, or if there's 1 page with non-hidden subpages
281
290
  const visibleNavItems = this.context.nav.navItems.filter((item) => !item.isHidden);
@@ -3,3 +3,4 @@ import HeaderLayout from './HeaderLayout.vue';
3
3
  declare const meta: Meta<typeof HeaderLayout>;
4
4
  export default meta;
5
5
  export declare const Sample: StoryFn;
6
+ export declare const WithHeaderButton: StoryFn;
@@ -36,6 +36,7 @@ const Template = (args) => ({
36
36
  nav-id="nav-1"
37
37
  :show-nav="args.showNav"
38
38
  :display-style="args.displayStyle"
39
+ :has-cta="args.hasCta"
39
40
  logo-width="100px"
40
41
  >
41
42
  <template v-slot:logo>
@@ -44,6 +45,9 @@ const Template = (args) => ({
44
45
  <template v-slot:nav>
45
46
  <div style="border: 1px solid red; display: inline-block;">Nav | Nav | Nav | Nav | Nav | Nav | Nav | Nav</div>
46
47
  </template>
48
+ <template v-slot:cta>
49
+ <div style="border: 1px solid green; display: inline-block; padding: 8px 16px;">Contact Us</div>
50
+ </template>
47
51
  </HeaderLayout>
48
52
  </div>
49
53
  `,
@@ -52,3 +56,8 @@ export const Sample = Template.bind({});
52
56
  Sample.args = {
53
57
  displayStyle: HEADER_DISPLAY.DESKTOP_TAB_5,
54
58
  };
59
+ export const WithHeaderButton = Template.bind({});
60
+ WithHeaderButton.args = {
61
+ displayStyle: HEADER_DISPLAY.DESKTOP_TAB_1,
62
+ hasCta: true,
63
+ };
@@ -48,9 +48,7 @@ export default defineComponent({
48
48
  onHeaderContainerClick() {
49
49
  this.$emit('header-container-click');
50
50
  },
51
- // In the maker preview the CTA is inert (BP-5852 decision): capture-phase so the
52
- // prevent lands before the inner anchor/router-link fires, and the stop keeps the
53
- // click from selecting the header panel. On the published site it does nothing.
51
+ // Preview only: deliberately inert — no link-follow, no Header Settings open.
54
52
  onHeaderCtaClick(event) {
55
53
  if (this.context.isPreview) {
56
54
  event.preventDefault();
@@ -44,4 +44,6 @@ interface HeaderDisplayStyleConfig {
44
44
  option: ButtonGroupOption;
45
45
  }
46
46
  export declare const HEADER_DISPLAY_STYLE_CONFIGS: HeaderDisplayStyleConfig[];
47
+ /** True when the header row shows the button; mobile hamburger styles put it in the drawer instead (unless the nav is hidden — then there is no drawer). */
48
+ export declare const headerRowRendersCta: (displayStyle: string, showNav: boolean) => boolean;
47
49
  export {};
@@ -416,3 +416,8 @@ export const HEADER_DISPLAY_STYLE_CONFIGS = [
416
416
  },
417
417
  },
418
418
  ];
419
+ /** True when the header row shows the button; mobile hamburger styles put it in the drawer instead (unless the nav is hidden — then there is no drawer). */
420
+ export const headerRowRendersCta = (displayStyle, showNav) => !showNav ||
421
+ !HEADER_DISPLAY_STYLE_CONFIGS.some((config) => config.option.value === displayStyle &&
422
+ config.viewMode === 'mobile' &&
423
+ config.navType === 'hamburger');
@@ -535,7 +535,7 @@ export declare abstract class AbstractPageHeaderStyles {
535
535
  backgroundStyle: BackgroundColorStyle;
536
536
  style: BrandPageCssStyle;
537
537
  viewport: ViewportsType;
538
- /** Absent means no header call-to-action button — never seed a default. */
538
+ /** Missing = no button. `declare` keeps it off saved data so old migrations still see the same shape. */
539
539
  headerButton?: HeaderButton;
540
540
  protected constructor(options?: AbstractPageHeaderStylesType);
541
541
  }
@@ -227,8 +227,6 @@ export class AbstractPageHeaderStyles {
227
227
  backgroundStyle;
228
228
  style;
229
229
  viewport;
230
- /** Absent means no header call-to-action button — never seed a default. */
231
- headerButton;
232
230
  constructor(options = {}) {
233
231
  if (typeof options.viewport === 'undefined') {
234
232
  throw new Error('"viewport" is required');
@@ -259,7 +257,10 @@ export class AbstractPageHeaderStyles {
259
257
  ...(options.backgroundStyle || {}),
260
258
  backgroundOpacity: options.backgroundStyle?.backgroundOpacity ?? 100,
261
259
  };
262
- this.headerButton = options.headerButton;
260
+ // Only set when given — a missing button must stay missing for old migrations.
261
+ if (options.headerButton) {
262
+ this.headerButton = options.headerButton;
263
+ }
263
264
  }
264
265
  }
265
266
  export class PageHeaderDesktop extends AbstractPageHeaderStyles {
@@ -13,7 +13,6 @@ export declare const mapToImagesSectionViewModel: (content: ImagesSectionContent
13
13
  export declare const mapToBookingSectionViewModel: (content: BookingSectionContent, styles: PageStyles) => BookingSectionViewModel;
14
14
  export declare const mapToNavViewModel: (nav: NavModel, brandPageSlug?: string, isCustomDomain?: boolean) => NavViewModel;
15
15
  export declare const mapToPageStyleViewModel: (pageStyles: PageStyles, options: ViewModelMappingOptions) => PageStylesViewModel;
16
- export declare const HEADER_BUTTON_FALLBACK_TEXT = "Contact Us";
17
16
  export declare const mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[], useOldLogoRenderSize?: boolean) => PageHeaderViewModel;
18
17
  export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles, useOldLogoRenderSize?: boolean) => PageFooterViewModel;
19
18
  export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType, options: ViewModelMappingOptions) => (content: Content) => ContentViewModel | undefined;
@@ -13,6 +13,7 @@ import { isLogoContent } from './model.util';
13
13
  import { resolveTextColor } from './text-style.util';
14
14
  import { getBoxShadowValue, sectionFrameStyle } from './button.util';
15
15
  import { findNavItemByPageId, getRouteNameByPageIndex, getRouteParamsByPage, } from './route.util';
16
+ import { tr } from '@src/composables/useTranslate';
16
17
  import { hasRTEContent, isTiptapDocument } from '../../brand-page-maker/utils';
17
18
  import { getPageIdFromHref, isHrefPageId, } from '../../brand-page-maker/composables/rich-text-editor/hyperlink';
18
19
  const BUTTON_BORDER_RADIUS = '9999px';
@@ -691,14 +692,7 @@ export const mapToPageStyleViewModel = (pageStyles, options) => {
691
692
  colors: pageStyles.colors ?? [],
692
693
  };
693
694
  };
694
- // Must stay in step with the maker's `pageSettingsSection.buttonLabelPlaceholder`
695
- // (page-settings-section.json) — the placeholder shows what an empty label publishes as.
696
- export const HEADER_BUTTON_FALLBACK_TEXT = 'Contact Us';
697
- /**
698
- * `Button.vue` reads the link kind off `role` for every non-section role, so the header
699
- * CTA's authored `buttonLinkType` is expressed as the role (+ `clickActionField` for a
700
- * page link) that component already resolves — no new branch in the button itself.
701
- */
695
+ // Maps each link kind to the role Button.vue already understands, so the button needs no new code.
702
696
  const HEADER_BUTTON_LINK_ROLES = {
703
697
  [BUTTON_LINK_TYPE.url]: 'general-link',
704
698
  [BUTTON_LINK_TYPE.page]: 'general-link',
@@ -714,11 +708,13 @@ const mapToHeaderButtonViewModel = (headerButton, styles) => {
714
708
  };
715
709
  const viewModel = mapToButtonViewModel({
716
710
  id: 'page-header-button',
717
- type: HEADER_BUTTON_LINK_ROLES[headerButton.buttonLinkType],
711
+ // Old saved data may have no link kind — treat it as a url.
712
+ type: HEADER_BUTTON_LINK_ROLES[headerButton.buttonLinkType] ??
713
+ HEADER_BUTTON_LINK_ROLES[BUTTON_LINK_TYPE.url],
718
714
  iconUrl: '',
719
715
  modalImageUrl: '',
720
716
  colorReplacements: [],
721
- title: headerButton.text?.trim() || HEADER_BUTTON_FALLBACK_TEXT,
717
+ title: headerButton.text?.trim() || tr('pageHeader.buttonFallbackLabel'),
722
718
  titleStyle,
723
719
  url: headerButton.url ?? '',
724
720
  page: headerButton.buttonPageId ?? '',
@@ -1435,6 +1435,7 @@ declare const _default: import("vue").DefineComponent<{}, {
1435
1435
  headerViewModelDesktop(): any;
1436
1436
  isNavigationEmbeddedInLogoMobile(): boolean;
1437
1437
  isNavigationEmbeddedInLogoDesktop(): boolean;
1438
+ drawerHeaderButtonViewModel(): import("@brand-page").ButtonViewModel | undefined;
1438
1439
  shouldShowNavigation(): boolean;
1439
1440
  showNavigationAfterLogoMobile(): boolean;
1440
1441
  showNavigationAfterLogoDesktop(): boolean;