@salesforcedevs/docs-components 0.56.2-comp-flex-ref-1 → 0.56.2-example
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 +10 -2
- package/package.json +18 -12
- package/src/modules/doc/{amfReference/utils.ts → amfModelParser/amfModelParser.ts} +10 -5
- package/src/modules/doc/amfReference/amfReference.css +23 -3
- package/src/modules/doc/amfReference/amfReference.html +34 -21
- package/src/modules/doc/amfReference/amfReference.ts +386 -102
- package/src/modules/doc/amfReference/types.ts +5 -12
- package/src/modules/doc/amfTopic/amfTopic.css +20 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +35 -18
- package/src/modules/doc/amfTopic/types.ts +15 -13
- package/src/modules/doc/amfTopic/utils.ts +12 -6
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +2 -1
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +1 -1
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +22 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +9 -1
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +44 -34
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +62 -23
- package/src/modules/doc/componentPlayground/componentPlayground.css +22 -0
- package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
- package/src/modules/doc/componentPlayground/componentPlayground.ts +42 -0
- package/src/modules/doc/content/content.css +70 -76
- package/src/modules/doc/content/content.html +1 -0
- package/src/modules/doc/content/content.ts +26 -47
- package/src/modules/doc/contentCallout/contentCallout.css +15 -7
- package/src/modules/doc/contentCallout/contentCallout.html +13 -4
- package/src/modules/doc/contentCallout/contentCallout.ts +14 -2
- package/src/modules/doc/contentLayout/contentLayout.css +1 -100
- package/src/modules/doc/contentLayout/contentLayout.html +30 -17
- package/src/modules/doc/contentLayout/contentLayout.ts +315 -70
- 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 +65 -36
- package/src/modules/doc/header/header.html +41 -139
- package/src/modules/doc/header/header.ts +54 -76
- package/src/modules/doc/heading/heading.css +16 -37
- package/src/modules/doc/heading/heading.html +4 -4
- package/src/modules/doc/heading/heading.ts +12 -10
- package/src/modules/doc/headingAnchor/headingAnchor.css +2 -2
- package/src/modules/doc/headingAnchor/headingAnchor.ts +2 -2
- package/src/modules/doc/headingContent/headingContent.css +6 -8
- package/src/modules/doc/headingContent/headingContent.html +9 -15
- package/src/modules/doc/headingContent/headingContent.ts +2 -14
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +1 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +68 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +256 -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 +18 -3
- package/src/modules/doc/phase/phase.html +15 -3
- package/src/modules/doc/phase/phase.ts +44 -8
- package/src/modules/doc/specificationContent/specificationContent.css +36 -0
- package/src/modules/doc/specificationContent/specificationContent.html +167 -0
- package/src/modules/doc/specificationContent/specificationContent.ts +127 -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 +12 -3
- package/src/modules/doc/xmlContent/utils.ts +17 -12
- package/src/modules/doc/xmlContent/xmlContent.css +32 -3
- package/src/modules/doc/xmlContent/xmlContent.html +41 -15
- package/src/modules/doc/xmlContent/xmlContent.ts +310 -96
- package/src/modules/docHelpers/amfStyle/amfStyle.css +10 -45
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +131 -0
- package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
- package/src/modules/docHelpers/status/status.css +1 -1
- package/src/modules/docUtils/{SearchSyncer/SearchSyncer.ts → searchSyncer/searchSyncer.ts} +1 -0
- package/src/modules/docUtils/utils/__mocks__/coveo.analytics.ts +16 -0
- package/src/modules/docUtils/utils/coveo.analytics.d.ts +10 -0
- package/src/modules/docUtils/utils/utils.ts +32 -0
- package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
- package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +0 -39
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
export default class ComponentPlayground extends LightningElement {
|
|
4
|
+
@api model!: string;
|
|
5
|
+
@api namespace!: string;
|
|
6
|
+
@api component!: string;
|
|
7
|
+
@api playgroundAppUrl!: string;
|
|
8
|
+
|
|
9
|
+
isLoading = true;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Returns a formatted title for the component playground
|
|
13
|
+
* Maps 'aura' model to 'Aura' and 'lwc' model to 'Lightning'
|
|
14
|
+
* Capitalizes the first letter of the component name
|
|
15
|
+
* @returns {string} Formatted playground title
|
|
16
|
+
*/
|
|
17
|
+
get playgroundTitle() {
|
|
18
|
+
const modelName = this.model === "aura" ? "Aura" : "Lightning";
|
|
19
|
+
const componentName =
|
|
20
|
+
this.component.charAt(0).toUpperCase() + this.component.slice(1);
|
|
21
|
+
return `Example previews and code for ${modelName} ${componentName} component`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get playgroundAvailable() {
|
|
25
|
+
return (
|
|
26
|
+
this.playgroundAppUrl &&
|
|
27
|
+
this.model &&
|
|
28
|
+
this.namespace &&
|
|
29
|
+
this.component
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get playgroundSrc(): string {
|
|
34
|
+
return `${this.playgroundAppUrl}/playground/${this.model}/${
|
|
35
|
+
this.namespace
|
|
36
|
+
}/${this.component.toLowerCase()}.html`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
handleIframeLoad() {
|
|
40
|
+
this.isLoading = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
@import "dxHelpers/text";
|
|
8
8
|
@import "dxHelpers/reset";
|
|
9
|
-
@import "dxHelpers/card";
|
|
10
9
|
@import "dxHelpers/table";
|
|
10
|
+
@import "docHelpers/imgStyle";
|
|
11
11
|
|
|
12
12
|
.doc-content {
|
|
13
13
|
width: 100%;
|
|
@@ -31,11 +31,6 @@
|
|
|
31
31
|
margin-bottom: var(--dx-g-spacing-md);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.helpHead2 {
|
|
35
|
-
margin-top: 36px;
|
|
36
|
-
margin-bottom: var(--dx-g-spacing-md);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
34
|
.relinfo {
|
|
40
35
|
padding-top: var(--dx-g-spacing-sm);
|
|
41
36
|
padding-bottom: var(--dx-g-spacing-sm);
|
|
@@ -46,17 +41,10 @@
|
|
|
46
41
|
padding-bottom: var(--dx-g-spacing-sm);
|
|
47
42
|
}
|
|
48
43
|
|
|
49
|
-
img.content-image {
|
|
50
|
-
height: auto;
|
|
51
|
-
display: unset;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
44
|
.image-block .content-image {
|
|
55
45
|
margin-top: var(--dx-g-spacing-lg);
|
|
56
46
|
margin-bottom: var(--dx-g-spacing-sm);
|
|
57
47
|
display: block;
|
|
58
|
-
margin-left: auto;
|
|
59
|
-
margin-right: auto;
|
|
60
48
|
}
|
|
61
49
|
|
|
62
50
|
td > img.content-image:first-child:last-child[alt="Yes"],
|
|
@@ -64,61 +52,61 @@ td > img.content-image:first-child:last-child[alt="No"] {
|
|
|
64
52
|
width: var(--dx-g-spacing-md);
|
|
65
53
|
}
|
|
66
54
|
|
|
67
|
-
h1
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
55
|
+
h1,
|
|
56
|
+
h2,
|
|
57
|
+
h3,
|
|
58
|
+
h4,
|
|
59
|
+
h5,
|
|
60
|
+
h6 {
|
|
72
61
|
color: var(--dx-g-blue-vibrant-20);
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
font-family: var(--dx-g-font-display);
|
|
63
|
+
font-weight: var(--dx-g-font-demi);
|
|
75
64
|
}
|
|
76
65
|
|
|
77
|
-
|
|
78
|
-
font-family: var(--dx-g-font-display);
|
|
66
|
+
h1 {
|
|
79
67
|
font-size: var(--dx-g-text-3xl);
|
|
80
|
-
|
|
81
|
-
letter-spacing: -0.1px;
|
|
68
|
+
letter-spacing: -0.8px;
|
|
82
69
|
line-height: var(--dx-g-spacing-3xl);
|
|
70
|
+
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
83
71
|
}
|
|
84
72
|
|
|
85
|
-
|
|
86
|
-
font-
|
|
87
|
-
|
|
88
|
-
color: var(--dx-g-blue-vibrant-20);
|
|
89
|
-
letter-spacing: -0.1px;
|
|
73
|
+
h2 {
|
|
74
|
+
font-size: var(--dx-g-text-2xl);
|
|
75
|
+
letter-spacing: -0.4px;
|
|
90
76
|
line-height: var(--dx-g-spacing-2xl);
|
|
77
|
+
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
91
78
|
}
|
|
92
79
|
|
|
93
|
-
|
|
94
|
-
font-family: var(--dx-g-font-display);
|
|
80
|
+
h3 {
|
|
95
81
|
font-size: var(--dx-g-text-xl);
|
|
96
|
-
|
|
97
|
-
letter-spacing: 0;
|
|
82
|
+
letter-spacing: -0.4px;
|
|
98
83
|
line-height: var(--dx-g-spacing-xl);
|
|
84
|
+
margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
h4 {
|
|
88
|
+
font-size: var(--dx-g-text-base);
|
|
89
|
+
letter-spacing: -0.5px;
|
|
90
|
+
line-height: var(--dx-g-spacing-lg);
|
|
91
|
+
margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-sm) 0;
|
|
99
92
|
}
|
|
100
93
|
|
|
101
94
|
h5 {
|
|
102
|
-
font-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
line-height: 28px;
|
|
95
|
+
font-size: var(--dx-g-text-sm);
|
|
96
|
+
letter-spacing: -0.3px;
|
|
97
|
+
line-height: var(--dx-g-spacing-mlg);
|
|
98
|
+
margin: var(--dx-g-spacing-md) 0 var(--dx-g-spacing-sm) 0;
|
|
107
99
|
}
|
|
108
100
|
|
|
109
101
|
h6 {
|
|
110
|
-
font-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
line-height: var(--dx-g-spacing-mlg);
|
|
102
|
+
font-size: var(--dx-g-text-xs);
|
|
103
|
+
letter-spacing: -0.3px;
|
|
104
|
+
line-height: var(--dx-g-spacing-md);
|
|
105
|
+
margin: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-sm) 0;
|
|
115
106
|
}
|
|
116
107
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
font-family: var(--dx-g-font-sans);
|
|
120
|
-
font-size: var(--slds-text-lg);
|
|
121
|
-
line-height: 25px;
|
|
108
|
+
img {
|
|
109
|
+
image-rendering: optimize-contrast;
|
|
122
110
|
}
|
|
123
111
|
|
|
124
112
|
p,
|
|
@@ -165,10 +153,6 @@ a,
|
|
|
165
153
|
color: var(--dx-g-blue-vibrant-50);
|
|
166
154
|
}
|
|
167
155
|
|
|
168
|
-
.helpHead1 {
|
|
169
|
-
margin-bottom: var(--dx-g-spacing-lg);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
156
|
.shortdesc {
|
|
173
157
|
font-family: var(--dx-g-font-sans);
|
|
174
158
|
font-size: var(--dx-g-text-base);
|
|
@@ -270,6 +254,10 @@ li {
|
|
|
270
254
|
var(--dx-g-spacing-lg);
|
|
271
255
|
}
|
|
272
256
|
|
|
257
|
+
li table {
|
|
258
|
+
margin-bottom: var(--dx-g-spacing-lg);
|
|
259
|
+
}
|
|
260
|
+
|
|
273
261
|
li > li {
|
|
274
262
|
margin-left: var(--dx-g-spacing-2xl);
|
|
275
263
|
}
|
|
@@ -283,27 +271,6 @@ a:hover,
|
|
|
283
271
|
text-decoration: underline;
|
|
284
272
|
}
|
|
285
273
|
|
|
286
|
-
@media (max-width: 640px) {
|
|
287
|
-
/* Mobile */
|
|
288
|
-
img.content-image {
|
|
289
|
-
max-width: 95vw;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
@media (min-width: 641px) {
|
|
294
|
-
/* Tablet (medium) */
|
|
295
|
-
img.content-image {
|
|
296
|
-
max-width: 80vw;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
@media (min-width: 769px) {
|
|
301
|
-
/* Desktop */
|
|
302
|
-
img.content-image {
|
|
303
|
-
max-width: min(60vw, 650px);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
274
|
ul,
|
|
308
275
|
ol {
|
|
309
276
|
margin-left: var(--dx-g-spacing-lg);
|
|
@@ -376,13 +343,30 @@ ul ul ul ul ul ul {
|
|
|
376
343
|
margin: var(--dx-g-spacing-lg) 0;
|
|
377
344
|
}
|
|
378
345
|
|
|
379
|
-
figure
|
|
346
|
+
figure,
|
|
347
|
+
.fig {
|
|
380
348
|
margin: var(--dx-g-spacing-lg) 0;
|
|
349
|
+
text-align: left;
|
|
350
|
+
display: flex;
|
|
351
|
+
flex-direction: column;
|
|
352
|
+
align-items: left;
|
|
353
|
+
justify-content: left;
|
|
381
354
|
}
|
|
382
355
|
|
|
383
|
-
figcaption
|
|
356
|
+
figcaption,
|
|
357
|
+
.figcap {
|
|
358
|
+
display: block;
|
|
384
359
|
font-size: var(--dx-g-text-xs);
|
|
385
|
-
margin
|
|
360
|
+
margin: var(--dx-g-spacing-sm) 0;
|
|
361
|
+
order: 2;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.figcap .image {
|
|
365
|
+
order: 1;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.fig.fig-centered {
|
|
369
|
+
text-align: center;
|
|
386
370
|
}
|
|
387
371
|
|
|
388
372
|
code,
|
|
@@ -397,3 +381,13 @@ samp,
|
|
|
397
381
|
mark {
|
|
398
382
|
background-color: var(--dx-g-yellow-vibrant-90);
|
|
399
383
|
}
|
|
384
|
+
|
|
385
|
+
/* offset page jump link due to fixed header */
|
|
386
|
+
[id] {
|
|
387
|
+
--dx-c-content-scroll-margin-top: calc(
|
|
388
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
|
|
389
|
+
var(--dx-g-spacing-2xl)
|
|
390
|
+
);
|
|
391
|
+
|
|
392
|
+
scroll-margin-top: var(--dx-c-content-scroll-margin-top);
|
|
393
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @lwc/lwc/no-inner-html */
|
|
2
2
|
import { createElement, LightningElement, api, track } from "lwc";
|
|
3
3
|
import { DocContent, PageReference } from "typings/custom";
|
|
4
|
-
import ContentCallout from "doc/contentCallout";
|
|
5
4
|
import CodeBlock from "dx/codeBlock";
|
|
6
|
-
import ContentMedia from "doc/contentMedia";
|
|
7
5
|
import Button from "dx/button";
|
|
8
6
|
import { highlightTerms } from "dxUtils/highlight";
|
|
7
|
+
import ContentCallout from "doc/contentCallout";
|
|
8
|
+
import ContentMedia from "doc/contentMedia";
|
|
9
9
|
|
|
10
10
|
const HIGHLIGHTABLE_SELECTOR = [
|
|
11
11
|
"p",
|
|
@@ -43,26 +43,10 @@ export default class Content extends LightningElement {
|
|
|
43
43
|
return this.docContent;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
@api
|
|
47
|
-
set codeBlockTheme(value) {
|
|
48
|
-
this._codeBlockTheme = value;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
get codeBlockTheme() {
|
|
52
|
-
return this._codeBlockTheme;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
46
|
@track docContent: DocContent = "";
|
|
56
|
-
_codeBlockTheme: string = "dark";
|
|
57
47
|
_docRendered: boolean = false;
|
|
58
|
-
originalCodeBlockThemeValue: String = "";
|
|
59
48
|
|
|
60
49
|
connectedCallback() {
|
|
61
|
-
this.template.addEventListener(
|
|
62
|
-
"themechange",
|
|
63
|
-
this.updateTheme.bind(this) // eslint-disableline no-use-before-define
|
|
64
|
-
);
|
|
65
|
-
|
|
66
50
|
window.addEventListener(
|
|
67
51
|
"highlightedtermchange",
|
|
68
52
|
this.updateHighlighted
|
|
@@ -76,17 +60,8 @@ export default class Content extends LightningElement {
|
|
|
76
60
|
);
|
|
77
61
|
}
|
|
78
62
|
|
|
79
|
-
updateTheme() {
|
|
80
|
-
this._codeBlockTheme =
|
|
81
|
-
this._codeBlockTheme === "dark" ? "light" : "dark";
|
|
82
|
-
const codeBlockEls = this.template.querySelectorAll("dx-code-block");
|
|
83
|
-
codeBlockEls.forEach((codeBlockEl) => {
|
|
84
|
-
codeBlockEl.setAttribute("theme", this._codeBlockTheme);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
63
|
renderPaginationButton(anchorEl: HTMLElement) {
|
|
89
|
-
const isNext = anchorEl.textContent
|
|
64
|
+
const isNext = anchorEl.textContent!.includes("Next →");
|
|
90
65
|
anchorEl.innerHTML = "";
|
|
91
66
|
const buttonEl = createElement("dx-button", { is: Button });
|
|
92
67
|
const params = isNext
|
|
@@ -116,11 +91,11 @@ export default class Content extends LightningElement {
|
|
|
116
91
|
const codeBlockEls = divEl.querySelectorAll(".codeSection");
|
|
117
92
|
codeBlockEls.forEach((codeBlockEl) => {
|
|
118
93
|
codeBlockEl.setAttribute("lwc:dom", "manual");
|
|
119
|
-
const classList = codeBlockEl.
|
|
94
|
+
const classList = codeBlockEl.firstElementChild?.classList;
|
|
120
95
|
let language = "";
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const className = classList[
|
|
96
|
+
if (classList) {
|
|
97
|
+
for (let i = 0; i < classList.length; i++) {
|
|
98
|
+
const className = classList[i];
|
|
124
99
|
if (className.startsWith("brush:")) {
|
|
125
100
|
language = className.split(":")[1];
|
|
126
101
|
}
|
|
@@ -133,8 +108,7 @@ export default class Content extends LightningElement {
|
|
|
133
108
|
codeBlock: codeBlockEl.innerHTML,
|
|
134
109
|
// ! Hot fix for incoming html tags from couchdb for xml blocks, fix me soon please
|
|
135
110
|
language: LANGUAGE_MAP[language] || language,
|
|
136
|
-
|
|
137
|
-
title: "", // Default no title.
|
|
111
|
+
header: "", // Default no title.
|
|
138
112
|
variant: this.codeBlockType,
|
|
139
113
|
isEncoded: true
|
|
140
114
|
});
|
|
@@ -150,7 +124,7 @@ export default class Content extends LightningElement {
|
|
|
150
124
|
is: ContentCallout
|
|
151
125
|
});
|
|
152
126
|
const detailEls = calloutEl.querySelectorAll(
|
|
153
|
-
"p, div.data, ol, ul, p+.codeSection, .mediaBd > span.ph"
|
|
127
|
+
"p, .p, div.data, ol, ul, p+.codeSection, p~.codeSection, div >.codeSection, .mediaBd > span.ph"
|
|
154
128
|
);
|
|
155
129
|
detailEls.forEach((detailEl) => {
|
|
156
130
|
if (detailEl.innerHTML.trim() !== "") {
|
|
@@ -158,9 +132,10 @@ export default class Content extends LightningElement {
|
|
|
158
132
|
}
|
|
159
133
|
});
|
|
160
134
|
|
|
135
|
+
// Set a flag to 1 (true) if and only if all detailEls have no content.
|
|
161
136
|
let flag = 1;
|
|
162
|
-
for (let i = 0; i < detailEls.length; i++) {
|
|
163
|
-
flag &= detailEls[i].innerHTML.trim() === "";
|
|
137
|
+
for (let i: number = 0; i < detailEls.length; i++) {
|
|
138
|
+
flag &= (detailEls[i].innerHTML.trim() === "") as any; // Dark Magic TM
|
|
164
139
|
}
|
|
165
140
|
|
|
166
141
|
if (flag) {
|
|
@@ -170,10 +145,10 @@ export default class Content extends LightningElement {
|
|
|
170
145
|
});
|
|
171
146
|
}
|
|
172
147
|
|
|
173
|
-
const type = calloutEl.querySelector("h4")
|
|
148
|
+
const type = calloutEl.querySelector("h4")!.textContent!;
|
|
174
149
|
const typeLower = type.toLowerCase();
|
|
175
150
|
Object.assign(calloutCompEl, {
|
|
176
|
-
|
|
151
|
+
header: type,
|
|
177
152
|
variant: typeLower
|
|
178
153
|
});
|
|
179
154
|
// eslint-disable-next-line no-use-before-define
|
|
@@ -184,10 +159,10 @@ export default class Content extends LightningElement {
|
|
|
184
159
|
// Modify links to work with any domain, links that start with "#" are excluded
|
|
185
160
|
const anchorEls = divEl.querySelectorAll("a:not([href^='#'])");
|
|
186
161
|
|
|
187
|
-
anchorEls.forEach((anchorEl) => {
|
|
162
|
+
anchorEls.forEach((anchorEl: any) => {
|
|
188
163
|
if (
|
|
189
|
-
anchorEl.textContent
|
|
190
|
-
anchorEl.textContent
|
|
164
|
+
anchorEl.textContent!.includes("Next →") ||
|
|
165
|
+
anchorEl.textContent!.includes("← Previous")
|
|
191
166
|
) {
|
|
192
167
|
if (this.showPaginationButtons) {
|
|
193
168
|
this.renderPaginationButton(anchorEl);
|
|
@@ -253,6 +228,7 @@ export default class Content extends LightningElement {
|
|
|
253
228
|
const label = mediaEl.getAttribute("label");
|
|
254
229
|
const width = mediaEl.getAttribute("width");
|
|
255
230
|
const height = mediaEl.getAttribute("height");
|
|
231
|
+
const className = mediaEl.getAttribute("class");
|
|
256
232
|
|
|
257
233
|
if (isImage) {
|
|
258
234
|
src = src.startsWith("/")
|
|
@@ -264,6 +240,7 @@ export default class Content extends LightningElement {
|
|
|
264
240
|
|
|
265
241
|
const img: HTMLImageElement = document.createElement("img");
|
|
266
242
|
img.src = src;
|
|
243
|
+
img.alt = "";
|
|
267
244
|
if (alt) {
|
|
268
245
|
img.alt = alt;
|
|
269
246
|
}
|
|
@@ -276,8 +253,11 @@ export default class Content extends LightningElement {
|
|
|
276
253
|
if (width) {
|
|
277
254
|
img.width = parseFloat(width);
|
|
278
255
|
}
|
|
256
|
+
if (className) {
|
|
257
|
+
img.className = className;
|
|
258
|
+
}
|
|
279
259
|
|
|
280
|
-
img.className =
|
|
260
|
+
img.className = `content-image ${img.className}`;
|
|
281
261
|
mediaEl.parentNode!.insertBefore(img, mediaEl);
|
|
282
262
|
} else {
|
|
283
263
|
const contentMediaEl = createElement("doc-content-media", {
|
|
@@ -321,8 +301,7 @@ export default class Content extends LightningElement {
|
|
|
321
301
|
|
|
322
302
|
handleNavClick(event: InputEvent) {
|
|
323
303
|
event.preventDefault();
|
|
324
|
-
|
|
325
|
-
const target = event.currentTarget.dataset.id;
|
|
304
|
+
const target = (event.currentTarget! as any).dataset.id;
|
|
326
305
|
const [page, docId, deliverable, tempContentDocumentId] =
|
|
327
306
|
target.split("/");
|
|
328
307
|
const [contentDocumentId, hash] = tempContentDocumentId.split("#");
|
|
@@ -355,7 +334,7 @@ export default class Content extends LightningElement {
|
|
|
355
334
|
);
|
|
356
335
|
|
|
357
336
|
@api
|
|
358
|
-
public navigateToHash(hash: String) {
|
|
337
|
+
public navigateToHash = (hash: String) => {
|
|
359
338
|
const splitHash = hash.split("#");
|
|
360
339
|
if (splitHash.length === 2) {
|
|
361
340
|
hash = splitHash[1];
|
|
@@ -366,7 +345,7 @@ export default class Content extends LightningElement {
|
|
|
366
345
|
} else {
|
|
367
346
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
368
347
|
}
|
|
369
|
-
}
|
|
348
|
+
};
|
|
370
349
|
|
|
371
350
|
renderedCallback() {
|
|
372
351
|
if (this._docRendered) {
|
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
border-radius: 4px;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.dx-callout-base
|
|
9
|
+
.dx-callout-base,
|
|
10
|
+
.dx-callout-plain {
|
|
10
11
|
background-color: var(--dx-g-gray-95);
|
|
11
12
|
border-color: var(--dx-g-gray-50);
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
.dx-callout-plain {
|
|
16
|
+
border: none;
|
|
17
|
+
margin-bottom: var(--dx-g-text-2xl);
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
.dx-callout-note {
|
|
15
21
|
background-color: var(--dx-g-blue-vibrant-95);
|
|
16
22
|
border-color: var(--dx-g-blue-vibrant-50);
|
|
@@ -26,6 +32,11 @@
|
|
|
26
32
|
border-color: var(--dx-g-red-vibrant-50);
|
|
27
33
|
}
|
|
28
34
|
|
|
35
|
+
.dx-callout-warning {
|
|
36
|
+
background-color: var(--dx-g-red-natural-95);
|
|
37
|
+
border-color: var(--dx-g-red-vibrant-50);
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
.dx-callout-base_section {
|
|
30
41
|
width: 100%;
|
|
31
42
|
}
|
|
@@ -42,10 +53,7 @@
|
|
|
42
53
|
flex-direction: row;
|
|
43
54
|
}
|
|
44
55
|
|
|
45
|
-
.dx-callout-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.dx-callout-base_column > dx-type-badge-group {
|
|
50
|
-
margin-bottom: var(--dx-g-spacing-sm);
|
|
56
|
+
.dx-callout-content {
|
|
57
|
+
flex: 1;
|
|
58
|
+
overflow: auto;
|
|
51
59
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class={className}>
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
3
|
+
<template if:false={hideIcon}>
|
|
4
|
+
<div class="doc-status-icon dx-callout-icon">
|
|
5
|
+
<dx-icon
|
|
6
|
+
symbol={iconName}
|
|
7
|
+
size="large"
|
|
8
|
+
color={iconColor}
|
|
9
|
+
></dx-icon>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
6
13
|
<div class="dx-callout-content">
|
|
7
|
-
<p class="doc-status-title dx-callout-title dx-text-body-3">
|
|
14
|
+
<p class="doc-status-title dx-callout-title dx-text-body-3">
|
|
15
|
+
{header}
|
|
16
|
+
</p>
|
|
8
17
|
<span class="dx-callout-body dx-text-body-3">
|
|
9
18
|
<slot onslotchange={onSlotChange}></slot>
|
|
10
19
|
</span>
|
|
@@ -3,7 +3,7 @@ import cx from "classnames";
|
|
|
3
3
|
import { CalloutVariant, LightningSlotElement } from "typings/custom";
|
|
4
4
|
|
|
5
5
|
export default class ContentCallout extends LightningElement {
|
|
6
|
-
@api
|
|
6
|
+
@api header!: string;
|
|
7
7
|
@api variant!: CalloutVariant;
|
|
8
8
|
cardVariant?: string;
|
|
9
9
|
iconName?: string;
|
|
@@ -11,6 +11,9 @@ export default class ContentCallout extends LightningElement {
|
|
|
11
11
|
|
|
12
12
|
connectedCallback() {
|
|
13
13
|
switch (this.variant) {
|
|
14
|
+
case "plain":
|
|
15
|
+
this.cardVariant = "dx-callout-plain";
|
|
16
|
+
break;
|
|
14
17
|
case "tip":
|
|
15
18
|
this.cardVariant = "dx-callout-tip";
|
|
16
19
|
this.iconColor = "green-vibrant-60";
|
|
@@ -18,7 +21,7 @@ export default class ContentCallout extends LightningElement {
|
|
|
18
21
|
break;
|
|
19
22
|
case "warning":
|
|
20
23
|
this.cardVariant = "doc-status-container dx-callout-warning";
|
|
21
|
-
this.iconColor = "
|
|
24
|
+
this.iconColor = "red-vibrant-50";
|
|
22
25
|
this.iconName = "warning";
|
|
23
26
|
break;
|
|
24
27
|
case "caution":
|
|
@@ -26,6 +29,11 @@ export default class ContentCallout extends LightningElement {
|
|
|
26
29
|
this.iconColor = "red-vibrant-50";
|
|
27
30
|
this.iconName = "alert";
|
|
28
31
|
break;
|
|
32
|
+
case "important":
|
|
33
|
+
this.cardVariant = "doc-status-container dx-callout-important";
|
|
34
|
+
this.iconColor = "gray-10";
|
|
35
|
+
this.iconName = "announcement";
|
|
36
|
+
break;
|
|
29
37
|
case "note":
|
|
30
38
|
default:
|
|
31
39
|
this.cardVariant = "dx-callout-note";
|
|
@@ -44,6 +52,10 @@ export default class ContentCallout extends LightningElement {
|
|
|
44
52
|
);
|
|
45
53
|
}
|
|
46
54
|
|
|
55
|
+
get hideIcon() {
|
|
56
|
+
return this.variant === "plain";
|
|
57
|
+
}
|
|
58
|
+
|
|
47
59
|
private isSlotEmpty: boolean = true;
|
|
48
60
|
private onSlotChange(e: LightningSlotElement) {
|
|
49
61
|
// @ts-ignore
|
|
@@ -1,100 +1 @@
|
|
|
1
|
-
|
|
2
|
-
--dx-c-content-vertical-spacing: var(--dx-g-spacing-lg);
|
|
3
|
-
|
|
4
|
-
display: block;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
dx-sidebar,
|
|
8
|
-
dx-sidebar-old {
|
|
9
|
-
--dx-c-sidebar-height: 100%;
|
|
10
|
-
--dx-c-sidebar-vertical-padding: var(--dx-c-content-vertical-spacing);
|
|
11
|
-
|
|
12
|
-
z-index: 5;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
dx-toc {
|
|
16
|
-
--dx-c-toc-width: unset;
|
|
17
|
-
|
|
18
|
-
height: calc(100% - var(--dx-c-content-vertical-spacing) * 2);
|
|
19
|
-
margin: var(--dx-c-content-vertical-spacing) 0;
|
|
20
|
-
overflow-y: auto;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
dx-sidebar,
|
|
24
|
-
dx-toc {
|
|
25
|
-
display: block;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.content {
|
|
29
|
-
display: flex;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.content-body-doc-phase-container {
|
|
33
|
-
flex: 1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.content-body-container {
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
padding-right: var(--dx-g-page-padding-horizontal);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.content-body {
|
|
43
|
-
margin: var(--dx-g-spacing-sm) var(--dx-c-content-vertical-spacing)
|
|
44
|
-
var(--dx-g-spacing-xl);
|
|
45
|
-
flex: 1;
|
|
46
|
-
width: 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.is-sticky {
|
|
50
|
-
height: 100vh;
|
|
51
|
-
position: sticky;
|
|
52
|
-
top: 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.right-nav-bar {
|
|
56
|
-
max-width: 275px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
dx-breadcrumbs {
|
|
60
|
-
display: block;
|
|
61
|
-
margin-bottom: var(--dx-g-spacing-2xl);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@media screen and (max-width: 1024px) {
|
|
65
|
-
.right-nav-bar {
|
|
66
|
-
display: none;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@media screen and (max-width: 800px) {
|
|
71
|
-
dx-breadcrumbs {
|
|
72
|
-
display: none;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.content-body {
|
|
76
|
-
margin-top: var(--dx-c-content-vertical-spacing);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@media screen and (max-width: 768px) {
|
|
81
|
-
.content {
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.content-body-container {
|
|
86
|
-
padding-right: 0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.left-nav-bar {
|
|
90
|
-
--dx-c-sidebar-height: 80vh;
|
|
91
|
-
|
|
92
|
-
height: unset;
|
|
93
|
-
z-index: 10;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.content-body {
|
|
97
|
-
margin-left: var(--dx-g-spacing-mlg, 20px);
|
|
98
|
-
margin-right: var(--dx-g-spacing-mlg, 20px);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
1
|
+
@import "docHelpers/contentLayoutStyle";
|