@salesforcedevs/docs-components 0.7.0 → 0.7.59-sppage-alpha1
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/lwc.config.json +17 -3
- package/package.json +16 -6
- package/src/modules/README.md +41 -0
- package/src/modules/doc/amfModelParser/amfModelParser.ts +674 -0
- package/src/modules/doc/amfReference/amfReference.css +25 -0
- package/src/modules/doc/amfReference/amfReference.html +60 -0
- package/src/modules/doc/amfReference/amfReference.ts +1494 -0
- package/src/modules/doc/amfReference/constants.ts +76 -0
- package/src/modules/doc/amfReference/types.ts +125 -0
- package/src/modules/doc/amfTopic/amfTopic.css +21 -0
- package/src/modules/doc/amfTopic/amfTopic.html +3 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +111 -0
- package/src/modules/doc/amfTopic/types.ts +56 -0
- package/src/modules/doc/amfTopic/utils.ts +136 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +71 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +58 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +192 -0
- package/src/modules/doc/content/content.css +94 -70
- package/src/modules/doc/content/content.ts +233 -169
- package/src/modules/doc/contentCallout/contentCallout.css +17 -23
- package/src/modules/doc/contentCallout/contentCallout.html +13 -4
- package/src/modules/doc/contentCallout/contentCallout.ts +16 -3
- package/src/modules/doc/contentLayout/contentLayout.css +131 -0
- package/src/modules/doc/contentLayout/contentLayout.html +64 -0
- package/src/modules/doc/contentLayout/contentLayout.ts +610 -0
- package/src/modules/doc/doDont/doDont.css +47 -0
- package/src/modules/doc/doDont/doDont.html +27 -0
- package/src/modules/doc/doDont/doDont.ts +17 -0
- package/src/modules/doc/header/header.css +70 -37
- package/src/modules/doc/header/header.html +40 -135
- package/src/modules/doc/header/header.ts +29 -78
- package/src/modules/doc/heading/heading.css +33 -0
- package/src/modules/doc/heading/heading.html +14 -0
- package/src/modules/doc/heading/heading.ts +67 -0
- package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
- package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
- package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
- package/src/modules/doc/headingContent/headingContent.css +53 -0
- package/src/modules/doc/headingContent/headingContent.html +13 -0
- package/src/modules/doc/headingContent/headingContent.ts +30 -0
- package/src/modules/doc/overview/overview.css +40 -0
- package/src/modules/doc/overview/overview.html +34 -0
- package/src/modules/doc/overview/overview.ts +12 -0
- package/src/modules/doc/phase/phase.css +70 -0
- package/src/modules/doc/phase/phase.html +38 -0
- package/src/modules/doc/phase/phase.ts +93 -0
- package/src/modules/doc/specificationContent/specificationContent.css +3 -0
- package/src/modules/doc/specificationContent/specificationContent.html +99 -0
- package/src/modules/doc/specificationContent/specificationContent.ts +56 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
- package/src/modules/doc/toc/toc.ts +1 -1
- package/src/modules/doc/versionPicker/versionPicker.css +64 -0
- package/src/modules/doc/versionPicker/versionPicker.html +38 -0
- package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
- package/src/modules/doc/xmlContent/types.ts +120 -0
- package/src/modules/doc/xmlContent/utils.ts +163 -0
- package/src/modules/doc/xmlContent/xmlContent.css +54 -0
- package/src/modules/doc/xmlContent/xmlContent.html +52 -0
- package/src/modules/doc/xmlContent/xmlContent.ts +780 -0
- package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
- package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
- package/src/modules/docHelpers/status/status.css +22 -0
- package/src/modules/docUtils/searchSyncer/searchSyncer.ts +86 -0
- package/src/modules/docUtils/utils/utils.ts +32 -0
- package/LICENSE +0 -12
- package/src/modules/doc/content/__tests__/content.test.ts +0 -120
- package/src/modules/doc/content/__tests__/mockDocContent.ts +0 -292
- package/src/modules/doc/content/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/content/content.stories.ts +0 -108
- package/src/modules/doc/contentCallout/__tests__/contentCallout.test.ts +0 -80
- package/src/modules/doc/contentCallout/__tests__/mockProps.ts +0 -14
- package/src/modules/doc/contentCallout/contentCallout.stories.ts +0 -29
- package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +0 -97
- package/src/modules/doc/contentMedia/contentMedia.stories.ts +0 -113
- package/src/modules/doc/header/__tests__/coveoConfig.ts +0 -12
- package/src/modules/doc/header/__tests__/header.test.ts +0 -434
- package/src/modules/doc/header/__tests__/mockNavDevelopers.ts +0 -427
- package/src/modules/doc/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/doc/header/__tests__/mockProps.ts +0 -149
- package/src/modules/doc/header/header.stories.ts +0 -160
- package/src/modules/doc/nav/__tests__/mockAvailableLanguages.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockAvailableVersions.ts +0 -122
- package/src/modules/doc/nav/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockPdfUrl.ts +0 -1
- package/src/modules/doc/nav/__tests__/mockSelectedLanguage.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockSelectedVersion.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockToc.ts +0 -146
- package/src/modules/doc/nav/__tests__/nav.test.ts +0 -58
- package/src/modules/doc/toc/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/toc/__tests__/mockToc.ts +0 -146
- package/src/modules/doc/toc/__tests__/toc.test.ts +0 -29
- package/src/modules/doc/toolbar/__tests__/mockAvailableLanguages.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/mockAvailableVersions.ts +0 -122
- package/src/modules/doc/toolbar/__tests__/mockPdfUrl.ts +0 -1
- package/src/modules/doc/toolbar/__tests__/mockSelectedLanguage.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/mockSelectedVersion.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/toolbar.test.ts +0 -44
|
@@ -1,12 +1,40 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "dxHelpers/commonHeader";
|
|
2
2
|
|
|
3
3
|
dx-logo {
|
|
4
4
|
min-width: fit-content;
|
|
5
|
-
|
|
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,84 +44,89 @@ 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:
|
|
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
|
-
|
|
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
|
-
.
|
|
36
|
-
--dx-
|
|
37
|
-
|
|
38
|
-
|
|
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);
|
|
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;
|
|
44
74
|
}
|
|
45
75
|
|
|
46
|
-
.
|
|
47
|
-
|
|
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);
|
|
53
|
-
}
|
|
54
|
-
|
|
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:
|
|
80
|
+
@media (max-width: 768px) {
|
|
60
81
|
.header_l2 {
|
|
61
82
|
padding: 0;
|
|
62
83
|
flex-wrap: wrap;
|
|
84
|
+
height: 100%;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.has-nav-items .header_l2 {
|
|
88
|
+
height: initial;
|
|
63
89
|
}
|
|
64
90
|
|
|
65
91
|
.header_l2_group {
|
|
66
92
|
width: 100%;
|
|
67
93
|
}
|
|
68
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
|
+
|
|
69
102
|
.header_l2_group-nav {
|
|
70
103
|
height: var(--dx-g-spacing-3xl);
|
|
71
104
|
padding: 0;
|
|
72
|
-
|
|
105
|
+
margin-top: calc(var(--dx-g-spacing-2xs) + 1px);
|
|
73
106
|
}
|
|
74
107
|
|
|
75
108
|
.header_l2_group-nav_overflow {
|
|
109
|
+
height: var(--dx-g-spacing-3xl);
|
|
76
110
|
margin-right: var(--dx-g-spacing-sm);
|
|
77
111
|
}
|
|
78
112
|
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
113
|
+
.subtitle {
|
|
114
|
+
font-weight: var(--dx-g-font-demi);
|
|
115
|
+
letter-spacing: -0.08px;
|
|
82
116
|
}
|
|
83
117
|
|
|
84
|
-
.
|
|
85
|
-
margin-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
.header_lang-dropdown > dx-button {
|
|
89
|
-
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);
|
|
90
122
|
}
|
|
91
123
|
|
|
92
124
|
.has-scoped-nav-items > .header_l2 {
|
|
93
125
|
height: unset;
|
|
94
126
|
}
|
|
95
127
|
|
|
96
|
-
.has-
|
|
97
|
-
|
|
128
|
+
header:not(.has-brand) > .header_l2 {
|
|
129
|
+
padding-bottom: 0;
|
|
130
|
+
border: 0;
|
|
98
131
|
}
|
|
99
132
|
}
|
|
@@ -1,149 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
icon
|
|
12
|
-
variant="tertiary"
|
|
13
|
-
onclick={toggleMobileNavMenu}
|
|
14
|
-
></dx-button>
|
|
15
|
-
</div>
|
|
16
|
-
<dx-logo label={title}></dx-logo>
|
|
17
|
-
<dx-header-nav
|
|
18
|
-
if:true={showDesktopNavItems}
|
|
19
|
-
aria-label="Global Navigation Bar"
|
|
20
|
-
nav-items={navItems}
|
|
21
|
-
onrequestopennavmenu={onRequestOpenNavMenu}
|
|
22
|
-
pathname={pathname}
|
|
23
|
-
variant="small"
|
|
24
|
-
></dx-header-nav>
|
|
25
|
-
<div class="header-cta-container">
|
|
26
|
-
<dx-header-search
|
|
27
|
-
if:true={hasSearch}
|
|
28
|
-
coveo-organization-id={coveoOrganizationId}
|
|
29
|
-
coveo-public-access-token={coveoPublicAccessToken}
|
|
30
|
-
coveo-search-pipeline={coveoSearchPipeline}
|
|
31
|
-
coveo-search-hub={coveoSearchHub}
|
|
32
|
-
mobile={tablet}
|
|
33
|
-
onstatechange={handleStateChange}
|
|
34
|
-
></dx-header-search>
|
|
35
|
-
</div>
|
|
36
|
-
<div if:true={showSignup} class="header-login-signup">
|
|
37
|
-
<dx-button
|
|
38
|
-
aria-label="Sign Up For Salesforce Developer Edition"
|
|
39
|
-
size="small"
|
|
40
|
-
href={signupLink}
|
|
41
|
-
onclick={handleSignUpClick}
|
|
42
|
-
>
|
|
43
|
-
Sign Up
|
|
44
|
-
</dx-button>
|
|
45
|
-
</div>
|
|
46
|
-
<dx-header-mobile-nav-menu
|
|
47
|
-
if:true={hasNavItems}
|
|
48
|
-
nav-items={navItems}
|
|
49
|
-
open={showMobileNavMenu}
|
|
50
|
-
pathname={pathname}
|
|
51
|
-
value={mobileNavMenuValue}
|
|
52
|
-
onchange={onMobileNavMenuChange}
|
|
53
|
-
onrequestclose={closeMobileNavMenu}
|
|
54
|
-
>
|
|
55
|
-
<dx-button
|
|
56
|
-
aria-label={bailLabel}
|
|
57
|
-
if:true={hasBailLink}
|
|
58
|
-
href={bailHref}
|
|
59
|
-
variant="tertiary"
|
|
60
|
-
icon-symbol="new_window"
|
|
61
|
-
>
|
|
62
|
-
{bailLabel}
|
|
63
|
-
</dx-button>
|
|
64
|
-
</dx-header-mobile-nav-menu>
|
|
65
|
-
</div>
|
|
66
|
-
<div class="header_l2">
|
|
67
|
-
<div class="header_l2_group header_l2_group-title">
|
|
68
|
-
<a href={headerHref} class="home-link">
|
|
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
|
+
<div lwc:if={devCenter} class="dev-center-link">
|
|
10
|
+
<a href={devCenter.link} class="dev-center-content">
|
|
11
|
+
<dx-icon symbol="back"></dx-icon>
|
|
69
12
|
<dx-icon
|
|
70
13
|
class="brand-icon"
|
|
71
|
-
if
|
|
14
|
+
lwc:if={devCenter.icon}
|
|
72
15
|
sprite="salesforcebrand"
|
|
73
16
|
symbol={brand}
|
|
74
|
-
size="
|
|
17
|
+
size="large"
|
|
75
18
|
></dx-icon>
|
|
76
|
-
<span class="subtitle dx-text-
|
|
77
|
-
{
|
|
19
|
+
<span class="subtitle dx-text-body-4">
|
|
20
|
+
{devCenter.title}
|
|
78
21
|
</span>
|
|
79
22
|
</a>
|
|
80
|
-
<dx-dropdown
|
|
81
|
-
if:true={showMobileLanguages}
|
|
82
|
-
class="header_lang-dropdown"
|
|
83
|
-
options={languages}
|
|
84
|
-
small
|
|
85
|
-
value={language}
|
|
86
|
-
value-path={langValuePath}
|
|
87
|
-
onchange={onLangChange}
|
|
88
|
-
>
|
|
89
|
-
<dx-button
|
|
90
|
-
aria-label="Select Language"
|
|
91
|
-
variant="inline"
|
|
92
|
-
icon-size="large"
|
|
93
|
-
icon-symbol="world"
|
|
94
|
-
></dx-button>
|
|
95
|
-
</dx-dropdown>
|
|
96
23
|
</div>
|
|
97
|
-
<div
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
>
|
|
105
|
-
<dx-header-nav
|
|
106
|
-
aria-label="Scoped Navigation Bar"
|
|
107
|
-
nav-items={scopedNavItems}
|
|
108
|
-
pathname={pathname}
|
|
109
|
-
></dx-header-nav>
|
|
24
|
+
<div class="header_l2">
|
|
25
|
+
<div class="header_l2_group header_l2_group-title">
|
|
26
|
+
<a href={headerHref} class="home-link">
|
|
27
|
+
<span class="subtitle dx-text-display-7">
|
|
28
|
+
{subtitle}
|
|
29
|
+
</span>
|
|
30
|
+
</a>
|
|
110
31
|
</div>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class="header_l2_group header_l2_group-right-ctas"
|
|
115
|
-
>
|
|
116
|
-
<dx-dropdown
|
|
117
|
-
if:true={hasLanguages}
|
|
118
|
-
class="header_lang-dropdown"
|
|
119
|
-
options={languages}
|
|
120
|
-
small
|
|
121
|
-
value-path={langValuePath}
|
|
122
|
-
value={language}
|
|
123
|
-
onchange={onLangChange}
|
|
32
|
+
<div
|
|
33
|
+
lwc:if={hasScopedNavItems}
|
|
34
|
+
class="header_l2_group header_l2_group-nav"
|
|
124
35
|
>
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
icon-size="small"
|
|
129
|
-
icon-symbol="world"
|
|
36
|
+
<div
|
|
37
|
+
class="header_l2_group-nav_overflow"
|
|
38
|
+
onscroll={onNavScroll}
|
|
130
39
|
>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
href={bailHref}
|
|
139
|
-
variant="tertiary"
|
|
140
|
-
icon-symbol="new_window"
|
|
141
|
-
target="_blank"
|
|
142
|
-
>
|
|
143
|
-
{bailLabel}
|
|
144
|
-
</dx-button>
|
|
40
|
+
<dx-header-nav
|
|
41
|
+
aria-label="Scoped Navigation Bar"
|
|
42
|
+
nav-items={scopedNavItems}
|
|
43
|
+
pathname={pathname}
|
|
44
|
+
></dx-header-nav>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
145
47
|
</div>
|
|
146
|
-
</
|
|
147
|
-
</
|
|
148
|
-
</
|
|
48
|
+
</header>
|
|
49
|
+
</dx-brand-theme-provider>
|
|
50
|
+
</template>
|
|
51
|
+
<template lwc:if={showDocDivider}>
|
|
52
|
+
<div class="no-header-content"></div>
|
|
53
|
+
</template>
|
|
149
54
|
</template>
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import type {
|
|
4
|
-
import { HeaderBase } from "
|
|
5
|
-
import { toJson } from "
|
|
6
|
-
import get from "lodash.get";
|
|
3
|
+
import type { OptionWithNested } from "typings/custom";
|
|
4
|
+
import { HeaderBase } from "dxBaseElements/headerBase";
|
|
5
|
+
import { toJson } from "dxUtils/normalizers";
|
|
7
6
|
|
|
8
7
|
const TABLET_MATCH = "980px";
|
|
9
|
-
const MOBILE_MATCH = "
|
|
10
|
-
const SMALL_MOBILE_MATCH = "740px";
|
|
8
|
+
const MOBILE_MATCH = "768px";
|
|
11
9
|
|
|
12
10
|
export default class Header extends HeaderBase {
|
|
13
11
|
@api langValuePath: string = "id"; // allows to override how language property is interpreted, follows valuePath dropdown api.
|
|
@@ -23,32 +21,20 @@ export default class Header extends HeaderBase {
|
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
@api
|
|
26
|
-
get
|
|
27
|
-
return this.
|
|
24
|
+
get devCenter() {
|
|
25
|
+
return this._devCenter;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
set
|
|
31
|
-
this.
|
|
28
|
+
set devCenter(value) {
|
|
29
|
+
this._devCenter = toJson(value);
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
get language() {
|
|
36
|
-
return this._language;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
set language(value) {
|
|
40
|
-
if (this._language !== value) {
|
|
41
|
-
this._language = value;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
private _language: string | null = null;
|
|
46
|
-
private _languages!: Option[];
|
|
47
|
-
private _scopedNavItems!: Option[];
|
|
48
|
-
private smallMobile = false;
|
|
49
|
-
private smallMobileMatchMedia!: MediaQueryList;
|
|
32
|
+
private _scopedNavItems!: OptionWithNested[];
|
|
50
33
|
private tablet = false;
|
|
51
34
|
private tabletMatchMedia!: MediaQueryList;
|
|
35
|
+
private shouldRender: boolean = false;
|
|
36
|
+
private showDocDivider: boolean = false;
|
|
37
|
+
private _devCenter: any;
|
|
52
38
|
|
|
53
39
|
protected mobileBreakpoint(): string {
|
|
54
40
|
return MOBILE_MATCH;
|
|
@@ -58,36 +44,6 @@ export default class Header extends HeaderBase {
|
|
|
58
44
|
return this.scopedNavItems && this.scopedNavItems.length > 0;
|
|
59
45
|
}
|
|
60
46
|
|
|
61
|
-
private get showDesktopNavItems(): boolean {
|
|
62
|
-
return !this.mobile && this.hasNavItems;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
private get showSignup(): boolean {
|
|
66
|
-
return (this.tablet && !this.isSearchOpen) || !this.tablet;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
private get hasLanguages(): boolean {
|
|
70
|
-
return !!(this.languages && this.languages.length);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
private get showMobileLanguages(): boolean {
|
|
74
|
-
return this.smallMobile && this.hasLanguages;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
private get languageLabel(): string {
|
|
78
|
-
return (
|
|
79
|
-
(this.language &&
|
|
80
|
-
this.languages.find(
|
|
81
|
-
(lang) => get(lang, this.langValuePath) === this.language
|
|
82
|
-
)?.label) ||
|
|
83
|
-
this.languages[0].label
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
private get showMenuButton(): boolean {
|
|
88
|
-
return this.mobile && this.hasNavItems;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
47
|
connectedCallback(): void {
|
|
92
48
|
super.connectedCallback();
|
|
93
49
|
this.tabletMatchMedia = window.matchMedia(
|
|
@@ -96,14 +52,23 @@ export default class Header extends HeaderBase {
|
|
|
96
52
|
this.onTabletChange(this.tabletMatchMedia);
|
|
97
53
|
this.tabletMatchMedia.addEventListener("change", this.onTabletChange);
|
|
98
54
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
)
|
|
55
|
+
if (
|
|
56
|
+
(window.location.pathname.includes("/docs/") &&
|
|
57
|
+
window.location.pathname !== "/docs/apis") ||
|
|
58
|
+
window.location.pathname ===
|
|
59
|
+
"/tableau/embedding-playground/overview" ||
|
|
60
|
+
window.location.host === "localhost:6006" ||
|
|
61
|
+
window.location.host === "dsc-components.herokuapp.com"
|
|
62
|
+
) {
|
|
63
|
+
this.shouldRender = true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (this.shouldRender && window.location.pathname.includes("/docs/")) {
|
|
67
|
+
if (!this.brand && !this.mobile) {
|
|
68
|
+
this.shouldRender = false;
|
|
69
|
+
this.showDocDivider = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
107
72
|
}
|
|
108
73
|
|
|
109
74
|
disconnectedCallback(): void {
|
|
@@ -112,29 +77,15 @@ export default class Header extends HeaderBase {
|
|
|
112
77
|
"change",
|
|
113
78
|
this.onTabletChange
|
|
114
79
|
);
|
|
115
|
-
|
|
116
|
-
this.smallMobileMatchMedia.removeEventListener(
|
|
117
|
-
"change",
|
|
118
|
-
this.onSmallMobileChange
|
|
119
|
-
);
|
|
120
80
|
}
|
|
121
81
|
|
|
122
82
|
private onTabletChange = (e: MediaQueryListEvent | MediaQueryList) =>
|
|
123
83
|
(this.tablet = e.matches);
|
|
124
84
|
|
|
125
|
-
private onSmallMobileChange = (e: MediaQueryListEvent | MediaQueryList) =>
|
|
126
|
-
(this.smallMobile = e.matches);
|
|
127
|
-
|
|
128
85
|
protected additionalClasses(): string {
|
|
129
86
|
return cx(
|
|
130
87
|
this.brand && "has-brand",
|
|
131
88
|
this.hasScopedNavItems && "has-scoped-nav-items"
|
|
132
89
|
);
|
|
133
90
|
}
|
|
134
|
-
|
|
135
|
-
private onLangChange(event: CustomEvent<string>): void {
|
|
136
|
-
const { detail } = event;
|
|
137
|
-
this._language = detail;
|
|
138
|
-
this.dispatchEvent(new CustomEvent("langchange", { detail }));
|
|
139
|
-
}
|
|
140
91
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "dxHelpers/text";
|
|
2
|
+
|
|
3
|
+
h1 {
|
|
4
|
+
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
h1 doc-heading-content {
|
|
8
|
+
--doc-c-heading-anchor-button-bottom: 9.5px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
h2 {
|
|
12
|
+
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
h2 doc-heading-content {
|
|
16
|
+
--doc-c-heading-anchor-button-bottom: 3px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
h3 {
|
|
20
|
+
margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h3 doc-heading-content {
|
|
24
|
+
--doc-c-heading-anchor-button-bottom: -0.5px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h4 {
|
|
28
|
+
margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-sm) 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
h4 doc-heading-content {
|
|
32
|
+
--doc-c-heading-anchor-button-bottom: -6px;
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h1 class={className} if:true={isAriaLevelOne}>
|
|
3
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
4
|
+
</h1>
|
|
5
|
+
<h2 class={className} if:true={isAriaLevelTwo}>
|
|
6
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
7
|
+
</h2>
|
|
8
|
+
<h3 class={className} if:true={isAriaLevelThree}>
|
|
9
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
10
|
+
</h3>
|
|
11
|
+
<h4 class={className} if:true={isAriaLevelFour}>
|
|
12
|
+
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
13
|
+
</h4>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
export const ariaDisplayLevels: { [key: string]: string } = {
|
|
4
|
+
"1": "4",
|
|
5
|
+
"2": "5",
|
|
6
|
+
"3": "6",
|
|
7
|
+
"4": "8"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const ariaLevels = Object.keys(ariaDisplayLevels);
|
|
11
|
+
|
|
12
|
+
export const displayLevels = Object.values(ariaDisplayLevels);
|
|
13
|
+
|
|
14
|
+
// @ts-ignore: Really Dark Magic (TM) to do with ariaLevel needing explicit getter/setters
|
|
15
|
+
export default class Heading extends LightningElement {
|
|
16
|
+
@api header: string = "";
|
|
17
|
+
@api hash: string | null = null;
|
|
18
|
+
|
|
19
|
+
@api
|
|
20
|
+
private get ariaLevel(): string {
|
|
21
|
+
// Really Dark Magic (TM)
|
|
22
|
+
return this._ariaLevel || "2";
|
|
23
|
+
}
|
|
24
|
+
private set ariaLevel(value: string | null) {
|
|
25
|
+
if (value && !ariaLevels.includes(value)) {
|
|
26
|
+
console.error(`Invalid aria-level: "${value}"`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (value) {
|
|
30
|
+
this._ariaLevel = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@api
|
|
35
|
+
private get displayLevel(): string {
|
|
36
|
+
return this._displayLevel || ariaDisplayLevels[this.ariaLevel];
|
|
37
|
+
}
|
|
38
|
+
private set displayLevel(value: string | null) {
|
|
39
|
+
if (value && !displayLevels.includes(value)) {
|
|
40
|
+
console.error(`Invalid display-level: "${value}"`);
|
|
41
|
+
value = null;
|
|
42
|
+
}
|
|
43
|
+
if (value) {
|
|
44
|
+
this._displayLevel = value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private _ariaLevel: string | null = null;
|
|
49
|
+
private _displayLevel: string | null = null;
|
|
50
|
+
|
|
51
|
+
private get isAriaLevelOne(): boolean {
|
|
52
|
+
return this.ariaLevel === "1";
|
|
53
|
+
}
|
|
54
|
+
private get isAriaLevelTwo(): boolean {
|
|
55
|
+
return this.ariaLevel === "2";
|
|
56
|
+
}
|
|
57
|
+
private get isAriaLevelThree(): boolean {
|
|
58
|
+
return this.ariaLevel === "3";
|
|
59
|
+
}
|
|
60
|
+
private get isAriaLevelFour(): boolean {
|
|
61
|
+
return this.ariaLevel === "4";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private get className(): string {
|
|
65
|
+
return `dx-text-display-${this.displayLevel}`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
|
|
3
|
+
button {
|
|
4
|
+
opacity: 0;
|
|
5
|
+
color: rgb(11 92 171);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
button:hover {
|
|
9
|
+
opacity: 1;
|
|
10
|
+
outline: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
button:focus {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
button:focus-visible {
|
|
19
|
+
border-radius: 4px;
|
|
20
|
+
border: 2px solid rgb(11 92 171);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.icon-wrapper {
|
|
24
|
+
height: 32px;
|
|
25
|
+
width: 32px;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.icon-container {
|
|
32
|
+
--dx-c-icon-size: 18px;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dx-tooltip placement="top" label={label}>
|
|
3
|
+
<button
|
|
4
|
+
onclick={onIconClick}
|
|
5
|
+
aria-label={ariaLabel}
|
|
6
|
+
onkeydown={onKeyDown}
|
|
7
|
+
part="headingAnchorIcon"
|
|
8
|
+
>
|
|
9
|
+
<div class="icon-wrapper">
|
|
10
|
+
<dx-icon
|
|
11
|
+
sprite={iconSprite}
|
|
12
|
+
size={iconSize}
|
|
13
|
+
symbol={iconSymbol}
|
|
14
|
+
class="icon-container"
|
|
15
|
+
></dx-icon>
|
|
16
|
+
</div>
|
|
17
|
+
</button>
|
|
18
|
+
</dx-tooltip>
|
|
19
|
+
</template>
|