@salesforcedevs/docs-components 0.0.0 → 0.0.1-superscript

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 (83) hide show
  1. package/lwc.config.json +12 -2
  2. package/package.json +29 -27
  3. package/src/modules/doc/{amfReference/utils.ts → amfModelParser/amfModelParser.ts} +10 -5
  4. package/src/modules/doc/amfReference/amfReference.css +11 -3
  5. package/src/modules/doc/amfReference/amfReference.html +35 -26
  6. package/src/modules/doc/amfReference/amfReference.ts +239 -95
  7. package/src/modules/doc/amfReference/types.ts +3 -11
  8. package/src/modules/doc/amfTopic/amfTopic.css +20 -0
  9. package/src/modules/doc/amfTopic/amfTopic.ts +59 -18
  10. package/src/modules/doc/amfTopic/types.ts +15 -13
  11. package/src/modules/doc/amfTopic/utils.ts +12 -6
  12. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +17 -10
  13. package/src/modules/doc/breadcrumbs/breadcrumbs.html +6 -9
  14. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +30 -34
  15. package/src/modules/doc/componentPlayground/componentPlayground.css +30 -0
  16. package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
  17. package/src/modules/doc/componentPlayground/componentPlayground.ts +97 -0
  18. package/src/modules/doc/content/content.css +70 -76
  19. package/src/modules/doc/content/content.html +1 -0
  20. package/src/modules/doc/content/content.ts +24 -46
  21. package/src/modules/doc/contentCallout/contentCallout.css +11 -7
  22. package/src/modules/doc/contentCallout/contentCallout.html +11 -4
  23. package/src/modules/doc/contentCallout/contentCallout.ts +8 -1
  24. package/src/modules/doc/contentLayout/contentLayout.css +1 -98
  25. package/src/modules/doc/contentLayout/contentLayout.html +46 -31
  26. package/src/modules/doc/contentLayout/contentLayout.ts +337 -89
  27. package/src/modules/doc/contentMedia/contentMedia.css +1 -1
  28. package/src/modules/doc/doDont/doDont.css +47 -0
  29. package/src/modules/doc/doDont/doDont.html +27 -0
  30. package/src/modules/doc/doDont/doDont.ts +17 -0
  31. package/src/modules/doc/header/header.css +65 -36
  32. package/src/modules/doc/header/header.html +44 -138
  33. package/src/modules/doc/header/header.ts +62 -74
  34. package/src/modules/doc/heading/heading.css +16 -37
  35. package/src/modules/doc/heading/heading.html +4 -4
  36. package/src/modules/doc/heading/heading.ts +12 -10
  37. package/src/modules/doc/headingAnchor/headingAnchor.css +2 -2
  38. package/src/modules/doc/headingAnchor/headingAnchor.ts +2 -2
  39. package/src/modules/doc/headingContent/headingContent.css +1 -1
  40. package/src/modules/doc/headingContent/headingContent.html +2 -2
  41. package/src/modules/doc/headingContent/headingContent.ts +2 -2
  42. package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +9 -0
  43. package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +64 -0
  44. package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +269 -0
  45. package/src/modules/doc/overview/overview.css +40 -0
  46. package/src/modules/doc/overview/overview.html +34 -0
  47. package/src/modules/doc/overview/overview.ts +12 -0
  48. package/src/modules/doc/phase/phase.css +11 -3
  49. package/src/modules/doc/phase/phase.html +12 -2
  50. package/src/modules/doc/phase/phase.ts +44 -8
  51. package/src/modules/doc/redocReference/redocReference.css +7 -0
  52. package/src/modules/doc/redocReference/redocReference.html +13 -0
  53. package/src/modules/doc/redocReference/redocReference.ts +425 -0
  54. package/src/modules/doc/specificationContent/specificationContent.css +36 -0
  55. package/src/modules/doc/specificationContent/specificationContent.html +177 -0
  56. package/src/modules/doc/specificationContent/specificationContent.ts +166 -0
  57. package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
  58. package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
  59. package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
  60. package/src/modules/doc/superscriptSubscript/superscriptSubscript.html +8 -0
  61. package/src/modules/doc/superscriptSubscript/superscriptSubscript.ts +16 -0
  62. package/src/modules/doc/toc/toc.html +1 -3
  63. package/src/modules/doc/toc/toc.ts +1 -1
  64. package/src/modules/doc/toolbar/toolbar.ts +6 -6
  65. package/src/modules/doc/versionPicker/versionPicker.css +64 -0
  66. package/src/modules/doc/versionPicker/versionPicker.html +40 -0
  67. package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
  68. package/src/modules/doc/xmlContent/types.ts +9 -3
  69. package/src/modules/doc/xmlContent/utils.ts +3 -1
  70. package/src/modules/doc/xmlContent/xmlContent.css +16 -4
  71. package/src/modules/doc/xmlContent/xmlContent.html +36 -21
  72. package/src/modules/doc/xmlContent/xmlContent.ts +295 -120
  73. package/src/modules/docHelpers/amfStyle/amfStyle.css +6 -8
  74. package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +162 -0
  75. package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
  76. package/src/modules/docHelpers/status/status.css +1 -1
  77. package/src/modules/docUtils/{SearchSyncer/SearchSyncer.ts → searchSyncer/searchSyncer.ts} +1 -0
  78. package/src/modules/docUtils/utils/__mocks__/coveo.analytics.ts +16 -0
  79. package/src/modules/docUtils/utils/coveo.analytics.d.ts +10 -0
  80. package/src/modules/docUtils/utils/utils.ts +32 -0
  81. package/LICENSE +0 -12
  82. package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
  83. package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +0 -39
@@ -0,0 +1,17 @@
1
+ import { LightningElement, api } from "lwc";
2
+ import { normalizeBoolean } from "dxUtils/normalizers";
3
+
4
+ export default class DoDont extends LightningElement {
5
+ @api caption: string = "";
6
+ @api imgSrc!: string;
7
+ _isDo: boolean = false;
8
+
9
+ @api
10
+ get isDo(): boolean {
11
+ return this._isDo;
12
+ }
13
+
14
+ set isDo(value) {
15
+ this._isDo = normalizeBoolean(value);
16
+ }
17
+ }
@@ -2,11 +2,39 @@
2
2
 
3
3
  dx-logo {
4
4
  min-width: fit-content;
5
- min-width: -moz-fit-content;
5
+ }
6
+
7
+ .dev-center-link {
8
+ display: inline-block;
9
+ padding: var(--dx-g-spacing-smd) var(--dx-g-spacing-lg) 0
10
+ var(--dx-g-global-header-padding-horizontal);
11
+ height: var(--dx-g-spacing-xl);
12
+ }
13
+
14
+ .dev-center-content {
15
+ display: flex;
16
+ align-items: center;
17
+ text-decoration: none;
18
+ color: inherit;
19
+ font-weight: var(--dx-g-font-bold);
20
+ }
21
+
22
+ dx-icon {
23
+ --dx-c-icon-size: var(--dx-g-icon-size-xs);
24
+ --dx-c-icon-color: var(--dx-g-blue-vibrant-20);
25
+ }
26
+
27
+ .dev-center-content > * + * {
28
+ margin-left: 8px; /* Adjust this value to your desired spacing */
6
29
  }
7
30
 
8
31
  .header_l2 {
9
32
  justify-content: space-between;
33
+ height: var(--dx-g-doc-header-main-nav-height);
34
+ }
35
+
36
+ .has-brand .header_l2 {
37
+ height: var(--dx-g-spacing-3xl);
10
38
  }
11
39
 
12
40
  .nav_menu-button {
@@ -16,50 +44,44 @@ dx-logo {
16
44
  );
17
45
  }
18
46
 
47
+ .has-brand.has-scoped-nav-items {
48
+ border-bottom: 1px solid var(--dx-g-gray-90);
49
+ border-top: 1px solid var(--dx-g-gray-90);
50
+ }
51
+
19
52
  .nav_menu-ctas {
20
53
  margin-right: var(--dx-g-spacing-sm);
21
54
  }
22
55
 
23
56
  header:not(.has-brand) > .header_l1 {
24
- background: var(--dx-g-brand-current-color-background);
57
+ background: white;
58
+ border-bottom: 1px solid var(--dx-g-gray-90);
25
59
  }
26
60
 
27
61
  header:not(.has-brand) > .header_l2 {
28
- background: var(--dx-g-brand-current-color-background-2);
62
+ border-bottom: 1px solid var(--dx-g-gray-90);
63
+ border-top: 1px solid var(--dx-g-gray-90);
29
64
  }
30
65
 
31
66
  .header_l2_group.header_l2_group-right-ctas {
32
67
  align-items: baseline;
33
68
  }
34
69
 
35
- .header_bail-link {
36
- --dx-c-button-horizontal-spacing: var(--dx-g-spacing-sm);
37
-
38
- margin-left: var(--dx-g-spacing-sm);
39
- }
40
-
41
- .header_lang-dropdown {
42
- --button-primary-color: var(--dx-g-blue-vibrant-50);
43
- --button-primary-color-hover: var(--dx-g-blue-vibrant-40);
44
- }
45
-
46
- .header_lang-dropdown > dx-button {
47
- --dx-c-button-primary-color: var(--button-primary-color);
48
- --dx-c-button-primary-color-hover: var(--button-primary-color-hover);
49
- --dx-c-slot-empty-width: min-content;
50
- --border-color: var(--button-primary-color);
51
-
52
- border-bottom: 1px dashed var(--border-color);
70
+ .has-brand .header_l2_group-title {
71
+ padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-xl)
72
+ calc(var(--dx-g-spacing-smd) - 1px) 0;
73
+ min-width: 320px;
53
74
  }
54
75
 
55
- .header_lang-dropdown > dx-button:hover {
56
- --border-color: var(--button-primary-color-hover);
76
+ .no-header-content {
77
+ border-top: 1px solid var(--dx-g-gray-90);
57
78
  }
58
79
 
59
- @media (max-width: 740px) {
80
+ @media (max-width: 768px) {
60
81
  .header_l2 {
61
82
  padding: 0;
62
83
  flex-wrap: wrap;
84
+ height: 100%;
63
85
  }
64
86
 
65
87
  .has-nav-items .header_l2 {
@@ -70,34 +92,41 @@ header:not(.has-brand) > .header_l2 {
70
92
  width: 100%;
71
93
  }
72
94
 
95
+ .header_l2_group-title {
96
+ margin-right: 0;
97
+ padding: var(--dx-g-spacing-sm) 0 2px
98
+ var(--dx-g-global-header-padding-horizontal);
99
+ min-height: var(--dx-g-doc-header-main-nav-height);
100
+ }
101
+
73
102
  .header_l2_group-nav {
74
103
  height: var(--dx-g-spacing-3xl);
75
104
  padding: 0;
76
- padding-left: var(--dx-g-spacing-sm);
105
+ margin-top: calc(var(--dx-g-spacing-2xs) + 1px);
77
106
  }
78
107
 
79
108
  .header_l2_group-nav_overflow {
109
+ height: var(--dx-g-spacing-3xl);
80
110
  margin-right: var(--dx-g-spacing-sm);
81
111
  }
82
112
 
83
- .header_l2_group-title {
84
- margin-right: 0;
85
- padding: var(--dx-g-spacing-smd) var(--dx-g-page-padding-horizontal);
113
+ .subtitle {
114
+ font-weight: var(--dx-g-font-demi);
115
+ letter-spacing: -0.08px;
86
116
  }
87
117
 
88
- .header_l2_group-title .header_lang-dropdown {
89
- margin-left: auto;
90
- }
91
-
92
- .header_lang-dropdown > dx-button {
93
- padding: var(--dx-g-spacing-2xs) 0;
118
+ .has-brand .header_l2_group-title {
119
+ margin-right: 0;
120
+ padding: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-2xs)
121
+ var(--dx-g-global-header-padding-horizontal);
94
122
  }
95
123
 
96
124
  .has-scoped-nav-items > .header_l2 {
97
125
  height: unset;
98
126
  }
99
127
 
100
- .has-scoped-nav-items .header_l2_group-title {
101
- border-bottom: 1px solid var(--dx-g-brand-current-color-border-2);
128
+ header:not(.has-brand) > .header_l2 {
129
+ padding-bottom: 0;
130
+ border: 0;
102
131
  }
103
132
  }
@@ -1,153 +1,59 @@
1
1
  <template>
2
- <dx-brand-theme-provider brand={brand}>
3
- <header class={className}>
4
- <dx-skip-nav-link></dx-skip-nav-link>
5
- <dx-banner
6
- if:true={bannerMarkup}
7
- banner-markup={bannerMarkup}
8
- ></dx-banner>
9
- <div class="header_l1">
10
- <div if:true={showMenuButton} class="nav_menu-ctas">
11
- <dx-button
12
- aria-label="Menu Button"
13
- class="nav_menu-button"
14
- icon-size="large"
15
- icon-symbol={mobileMenuIconSymbol}
16
- variant="tertiary"
17
- onclick={toggleMobileNavMenu}
18
- ></dx-button>
19
- </div>
20
- <dx-logo label={title}></dx-logo>
21
- <dx-header-nav
22
- if:true={showDesktopNavItems}
23
- aria-label="Global Navigation Bar"
24
- nav-items={navItems}
25
- onrequestopennavmenu={onRequestOpenNavMenu}
26
- pathname={pathname}
27
- variant="small"
28
- ></dx-header-nav>
29
- <div class="header-cta-container">
30
- <dx-header-search
31
- if:true={hasSearch}
32
- coveo-organization-id={coveoOrganizationId}
33
- coveo-public-access-token={coveoPublicAccessToken}
34
- coveo-search-pipeline={coveoSearchPipeline}
35
- coveo-search-hub={coveoSearchHub}
36
- mobile={tablet}
37
- onstatechange={handleStateChange}
38
- ></dx-header-search>
39
- </div>
40
- <div if:true={showSignup} class="header-login-signup">
41
- <dx-button
42
- aria-label="Sign Up For Salesforce Developer Edition"
43
- size="small"
44
- href={signupLink}
45
- onclick={handleSignUpClick}
46
- >
47
- Sign Up
48
- </dx-button>
49
- </div>
50
- <dx-header-mobile-nav-menu
51
- if:true={hasNavItems}
52
- nav-items={navItems}
53
- open={showMobileNavMenu}
54
- pathname={pathname}
55
- value={mobileNavMenuValue}
56
- onchange={onMobileNavMenuChange}
57
- onrequestclose={closeMobileNavMenu}
58
- >
59
- <dx-button
60
- aria-label={bailLabel}
61
- if:true={hasBailLink}
62
- href={bailHref}
63
- variant="tertiary"
64
- icon-symbol="new_window"
2
+ <template lwc:if={shouldRender}>
3
+ <dx-brand-theme-provider brand={brand}>
4
+ <header class={className}>
5
+ <dx-banner
6
+ lwc:if={showBanner}
7
+ banner-markup={bannerMarkup}
8
+ ></dx-banner>
9
+ <!-- To-Do: Move the devCenter as a new component and use it here, as devCenter is also used in Sidebar now -->
10
+ <div lwc:if={devCenter} class="dev-center-link">
11
+ <a
12
+ href={devCenter.link}
13
+ onclick={onLinkClick}
14
+ class="dev-center-content"
65
15
  >
66
- {bailLabel}
67
- </dx-button>
68
- </dx-header-mobile-nav-menu>
69
- </div>
70
- <div class="header_l2">
71
- <div class="header_l2_group header_l2_group-title">
72
- <a href={headerHref} class="home-link">
16
+ <dx-icon symbol="back"></dx-icon>
73
17
  <dx-icon
74
18
  class="brand-icon"
75
- if:true={isValidBrand}
19
+ lwc:if={devCenter.icon}
76
20
  sprite="salesforcebrand"
77
21
  symbol={brand}
78
- size="xlarge"
22
+ size="large"
79
23
  ></dx-icon>
80
- <span class="subtitle dx-text-heading-4">
81
- {subtitle}
24
+ <span class="subtitle dx-text-body-4">
25
+ {devCenter.title}
82
26
  </span>
83
27
  </a>
84
- <dx-dropdown
85
- if:true={showMobileLanguages}
86
- class="header_lang-dropdown"
87
- options={languages}
88
- small
89
- value={language}
90
- value-path={langValuePath}
91
- onchange={onLangChange}
92
- >
93
- <dx-button
94
- aria-label="Select Language"
95
- variant="inline"
96
- icon-size="large"
97
- icon-symbol="world"
98
- ></dx-button>
99
- </dx-dropdown>
100
28
  </div>
101
- <div
102
- if:true={hasScopedNavItems}
103
- class="header_l2_group header_l2_group-nav"
104
- >
105
- <div
106
- class="header_l2_group-nav_overflow"
107
- onscroll={onNavScroll}
108
- >
109
- <dx-header-nav
110
- aria-label="Scoped Navigation Bar"
111
- nav-items={scopedNavItems}
112
- pathname={pathname}
113
- ></dx-header-nav>
29
+ <div class="header_l2">
30
+ <div class="header_l2_group header_l2_group-title">
31
+ <a href={headerHref} class="home-link">
32
+ <span class="subtitle dx-text-display-7">
33
+ {subtitle}
34
+ </span>
35
+ </a>
114
36
  </div>
115
- </div>
116
- <div
117
- if:false={smallMobile}
118
- class="header_l2_group header_l2_group-right-ctas"
119
- >
120
- <dx-dropdown
121
- if:true={hasLanguages}
122
- class="header_lang-dropdown"
123
- options={languages}
124
- small
125
- value-path={langValuePath}
126
- value={language}
127
- onchange={onLangChange}
37
+ <div
38
+ lwc:if={showScopedNavItems}
39
+ class="header_l2_group header_l2_group-nav"
128
40
  >
129
- <dx-button
130
- aria-label="Select Language"
131
- variant="inline"
132
- icon-size="small"
133
- icon-symbol="world"
41
+ <div
42
+ class="header_l2_group-nav_overflow"
43
+ onscroll={onNavScroll}
134
44
  >
135
- {languageLabel}
136
- </dx-button>
137
- </dx-dropdown>
138
- <dx-button
139
- if:true={hasBailLink}
140
- aria-label={bailLabel}
141
- class="header_bail-link"
142
- href={bailHref}
143
- variant="tertiary"
144
- icon-symbol="new_window"
145
- target="_blank"
146
- >
147
- {bailLabel}
148
- </dx-button>
45
+ <dx-header-nav
46
+ aria-label="Scoped Navigation Bar"
47
+ nav-items={scopedNavItems}
48
+ pathname={pathname}
49
+ ></dx-header-nav>
50
+ </div>
51
+ </div>
149
52
  </div>
150
- </div>
151
- </header>
152
- </dx-brand-theme-provider>
53
+ </header>
54
+ </dx-brand-theme-provider>
55
+ </template>
56
+ <template lwc:if={shouldHideHeader}>
57
+ <div class="no-header-content"></div>
58
+ </template>
153
59
  </template>
@@ -1,93 +1,77 @@
1
1
  import { api } from "lwc";
2
2
  import cx from "classnames";
3
- import type { OptionWithNested, OptionWithLink } from "typings/custom";
3
+ import type { OptionWithNested, DevCenterConfig } from "typings/custom";
4
4
  import { HeaderBase } from "dxBaseElements/headerBase";
5
- import { toJson } from "dxUtils/normalizers";
6
- import get from "lodash.get";
5
+ import { toJson, normalizeBoolean } from "dxUtils/normalizers";
6
+ import { track } from "dxUtils/analytics";
7
7
 
8
8
  const TABLET_MATCH = "980px";
9
- const MOBILE_MATCH = "880px";
10
- const SMALL_MOBILE_MATCH = "740px";
9
+ const MOBILE_MATCH = "768px";
10
+
11
+ const isStorybook = () => {
12
+ const { host } = window.location;
13
+ return (
14
+ host === "localhost:6006" || /^dsc-comp.*\.herokuapp\.com$/.test(host)
15
+ );
16
+ };
11
17
 
12
18
  export default class Header extends HeaderBase {
13
19
  @api langValuePath: string = "id"; // allows to override how language property is interpreted, follows valuePath dropdown api.
14
20
  @api headerHref: string = "/";
15
21
 
16
22
  @api
17
- get scopedNavItems() {
18
- return this._scopedNavItems;
23
+ get hideDocHeader() {
24
+ return this._hideDocHeader;
19
25
  }
20
26
 
21
- set scopedNavItems(value) {
22
- this._scopedNavItems = toJson(value);
27
+ set hideDocHeader(value) {
28
+ this._hideDocHeader = normalizeBoolean(value);
23
29
  }
24
30
 
25
31
  @api
26
- get languages() {
27
- return this._languages;
32
+ get scopedNavItems() {
33
+ return this._scopedNavItems;
28
34
  }
29
35
 
30
- set languages(value) {
31
- this._languages = toJson(value);
36
+ set scopedNavItems(value) {
37
+ this._scopedNavItems = toJson(value);
32
38
  }
33
39
 
34
40
  @api
35
- get language() {
36
- return this._language;
41
+ get devCenter(): DevCenterConfig {
42
+ return this._devCenter;
37
43
  }
38
44
 
39
- set language(value) {
40
- if (this._language !== value) {
41
- this._language = value;
42
- }
45
+ set devCenter(value) {
46
+ this._devCenter = toJson(value);
43
47
  }
44
48
 
45
- private _language: string | null = null;
46
- private _languages!: OptionWithLink[];
47
49
  private _scopedNavItems!: OptionWithNested[];
48
- private smallMobile = false;
49
- private smallMobileMatchMedia!: MediaQueryList;
50
50
  private tablet = false;
51
51
  private tabletMatchMedia!: MediaQueryList;
52
+ private shouldRender: boolean = false;
53
+ private showDocDivider: boolean = false;
54
+ private _devCenter!: DevCenterConfig;
55
+ private _hideDocHeader: boolean = false;
52
56
 
53
57
  protected mobileBreakpoint(): string {
54
58
  return MOBILE_MATCH;
55
59
  }
56
60
 
57
- private get hasScopedNavItems(): boolean {
58
- return this.scopedNavItems && this.scopedNavItems.length > 0;
59
- }
60
-
61
- private get showDesktopNavItems(): boolean {
62
- return !this.mobile && this.hasNavItems;
63
- }
64
-
65
- private get showSignup(): boolean {
66
- return this.signupLink
67
- ? (this.tablet && !this.isSearchOpen) || !this.tablet
68
- : false;
69
- }
70
-
71
- private get hasLanguages(): boolean {
72
- return !!(this.languages && this.languages.length);
73
- }
74
-
75
- private get showMobileLanguages(): boolean {
76
- return this.smallMobile && this.hasLanguages;
77
- }
78
-
79
- private get languageLabel(): string {
61
+ private get showScopedNavItems(): boolean {
80
62
  return (
81
- (this.language &&
82
- this.languages.find(
83
- (lang) => get(lang, this.langValuePath) === this.language
84
- )?.label) ||
85
- this.languages[0].label
63
+ this.scopedNavItems &&
64
+ this.scopedNavItems.length > 0 &&
65
+ !this.hideDocHeader
86
66
  );
87
67
  }
88
68
 
89
- private get showMenuButton(): boolean {
90
- return this.mobile && this.hasNavItems;
69
+ /**
70
+ * This function returns true if the hideDocHeader is true and the view is not mobile.
71
+ * Also we need to show the header border in case the doc is hidden or if the brand information doesn't exists.
72
+ */
73
+ private get shouldHideHeader(): boolean {
74
+ return (this.hideDocHeader && !this.mobile) || this.showDocDivider;
91
75
  }
92
76
 
93
77
  connectedCallback(): void {
@@ -98,14 +82,23 @@ export default class Header extends HeaderBase {
98
82
  this.onTabletChange(this.tabletMatchMedia);
99
83
  this.tabletMatchMedia.addEventListener("change", this.onTabletChange);
100
84
 
101
- this.smallMobileMatchMedia = window.matchMedia(
102
- `(max-width: ${SMALL_MOBILE_MATCH})`
103
- );
104
- this.onSmallMobileChange(this.smallMobileMatchMedia);
105
- this.smallMobileMatchMedia.addEventListener(
106
- "change",
107
- this.onSmallMobileChange
108
- );
85
+ if (
86
+ (!this.shouldHideHeader &&
87
+ window.location.pathname.includes("/docs/") &&
88
+ window.location.pathname !== "/docs/apis") ||
89
+ window.location.pathname ===
90
+ "/tableau/embedding-playground/overview" ||
91
+ isStorybook()
92
+ ) {
93
+ this.shouldRender = true;
94
+ }
95
+
96
+ if (this.shouldRender && window.location.pathname.includes("/docs/")) {
97
+ if (!this.brand && !this.mobile) {
98
+ this.shouldRender = false;
99
+ this.showDocDivider = true;
100
+ }
101
+ }
109
102
  }
110
103
 
111
104
  disconnectedCallback(): void {
@@ -114,29 +107,24 @@ export default class Header extends HeaderBase {
114
107
  "change",
115
108
  this.onTabletChange
116
109
  );
117
-
118
- this.smallMobileMatchMedia.removeEventListener(
119
- "change",
120
- this.onSmallMobileChange
121
- );
122
110
  }
123
111
 
124
112
  private onTabletChange = (e: MediaQueryListEvent | MediaQueryList) =>
125
113
  (this.tablet = e.matches);
126
114
 
127
- private onSmallMobileChange = (e: MediaQueryListEvent | MediaQueryList) =>
128
- (this.smallMobile = e.matches);
129
-
130
115
  protected additionalClasses(): string {
131
116
  return cx(
132
117
  this.brand && "has-brand",
133
- this.hasScopedNavItems && "has-scoped-nav-items"
118
+ this.showScopedNavItems && "has-scoped-nav-items"
134
119
  );
135
120
  }
136
121
 
137
- private onLangChange(event: CustomEvent<string>): void {
138
- const { detail } = event;
139
- this._language = detail;
140
- this.dispatchEvent(new CustomEvent("langchange", { detail }));
122
+ private onLinkClick(event: Event): void {
123
+ track(event.target!, "custEv_linkClick", {
124
+ click_text: this.devCenter.title,
125
+ click_url: this.devCenter.link,
126
+ element_type: "link",
127
+ content_category: "dev-center"
128
+ });
141
129
  }
142
130
  }
@@ -1,54 +1,33 @@
1
- h1,
2
- h2,
3
- h3,
4
- h4,
5
- h5,
6
- h6 {
7
- color: var(--dx-g-blue-vibrant-20);
8
- font-family: var(--dx-g-font-display);
9
- font-weight: var(--dx-g-font-demi);
10
- }
1
+ @import "dxHelpers/text";
11
2
 
12
- .display-3 {
13
- margin: 0 0 24px 0;
14
- font-size: var(--dx-g-text-3xl);
15
- letter-spacing: -0.85px;
16
- line-height: var(--dx-g-text-4xl);
3
+ h1 {
4
+ margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
17
5
  }
18
6
 
19
- .display-3 doc-heading-content {
20
- --doc-c-heading-anchor-button-bottom: 8px;
7
+ h1 doc-heading-content {
8
+ --doc-c-heading-anchor-button-bottom: 9.5px;
21
9
  }
22
10
 
23
- .display-4 {
24
- margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
25
- font-size: var(--dx-g-text-xl);
26
- letter-spacing: -0.1px;
27
- line-height: var(--dx-g-spacing-lg);
11
+ h2 {
12
+ margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
28
13
  }
29
14
 
30
- .display-4 doc-heading-content {
31
- --doc-c-heading-anchor-button-bottom: -3px;
15
+ h2 doc-heading-content {
16
+ --doc-c-heading-anchor-button-bottom: 3px;
32
17
  }
33
18
 
34
- .display-5 {
35
- margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-md) 0;
36
- font-size: var(--dx-g-text-lg);
37
- letter-spacing: -0.1px;
38
- line-height: var(--dx-g-spacing-lg);
19
+ h3 {
20
+ margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
39
21
  }
40
22
 
41
- .display-5 doc-heading-content {
42
- --doc-c-heading-anchor-button-bottom: -4px;
23
+ h3 doc-heading-content {
24
+ --doc-c-heading-anchor-button-bottom: -0.5px;
43
25
  }
44
26
 
45
- .display-6 {
46
- margin: var(--dx-g-spacing-md) 0 var(--dx-g-spacing-sm) 0;
47
- font-size: var(--dx-g-text-base);
48
- letter-spacing: 0;
49
- line-height: var(--dx-g-spacing-mlg);
27
+ h4 {
28
+ margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-sm) 0;
50
29
  }
51
30
 
52
- .display-6 doc-heading-content {
31
+ h4 doc-heading-content {
53
32
  --doc-c-heading-anchor-button-bottom: -6px;
54
33
  }
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <h1 class={className} if:true={isAriaLevelOne}>
3
- <doc-heading-content title={title} hash={hash}></doc-heading-content>
3
+ <doc-heading-content header={header} hash={hash}></doc-heading-content>
4
4
  </h1>
5
5
  <h2 class={className} if:true={isAriaLevelTwo}>
6
- <doc-heading-content title={title} hash={hash}></doc-heading-content>
6
+ <doc-heading-content header={header} hash={hash}></doc-heading-content>
7
7
  </h2>
8
8
  <h3 class={className} if:true={isAriaLevelThree}>
9
- <doc-heading-content title={title} hash={hash}></doc-heading-content>
9
+ <doc-heading-content header={header} hash={hash}></doc-heading-content>
10
10
  </h3>
11
11
  <h4 class={className} if:true={isAriaLevelFour}>
12
- <doc-heading-content title={title} hash={hash}></doc-heading-content>
12
+ <doc-heading-content header={header} hash={hash}></doc-heading-content>
13
13
  </h4>
14
14
  </template>