@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.
- package/lwc.config.json +12 -2
- package/package.json +29 -27
- package/src/modules/doc/{amfReference/utils.ts → amfModelParser/amfModelParser.ts} +10 -5
- package/src/modules/doc/amfReference/amfReference.css +11 -3
- package/src/modules/doc/amfReference/amfReference.html +35 -26
- package/src/modules/doc/amfReference/amfReference.ts +239 -95
- package/src/modules/doc/amfReference/types.ts +3 -11
- package/src/modules/doc/amfTopic/amfTopic.css +20 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +59 -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.ts +17 -10
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +6 -9
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +30 -34
- package/src/modules/doc/componentPlayground/componentPlayground.css +30 -0
- package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
- package/src/modules/doc/componentPlayground/componentPlayground.ts +97 -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 +24 -46
- package/src/modules/doc/contentCallout/contentCallout.css +11 -7
- package/src/modules/doc/contentCallout/contentCallout.html +11 -4
- package/src/modules/doc/contentCallout/contentCallout.ts +8 -1
- package/src/modules/doc/contentLayout/contentLayout.css +1 -98
- package/src/modules/doc/contentLayout/contentLayout.html +46 -31
- package/src/modules/doc/contentLayout/contentLayout.ts +337 -89
- package/src/modules/doc/contentMedia/contentMedia.css +1 -1
- 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 +44 -138
- package/src/modules/doc/header/header.ts +62 -74
- 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 +1 -1
- package/src/modules/doc/headingContent/headingContent.html +2 -2
- package/src/modules/doc/headingContent/headingContent.ts +2 -2
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +9 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +64 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +269 -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 +11 -3
- package/src/modules/doc/phase/phase.html +12 -2
- package/src/modules/doc/phase/phase.ts +44 -8
- package/src/modules/doc/redocReference/redocReference.css +7 -0
- package/src/modules/doc/redocReference/redocReference.html +13 -0
- package/src/modules/doc/redocReference/redocReference.ts +425 -0
- package/src/modules/doc/specificationContent/specificationContent.css +36 -0
- package/src/modules/doc/specificationContent/specificationContent.html +177 -0
- package/src/modules/doc/specificationContent/specificationContent.ts +166 -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/superscriptSubscript/superscriptSubscript.html +8 -0
- package/src/modules/doc/superscriptSubscript/superscriptSubscript.ts +16 -0
- package/src/modules/doc/toc/toc.html +1 -3
- package/src/modules/doc/toc/toc.ts +1 -1
- package/src/modules/doc/toolbar/toolbar.ts +6 -6
- package/src/modules/doc/versionPicker/versionPicker.css +64 -0
- package/src/modules/doc/versionPicker/versionPicker.html +40 -0
- package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
- package/src/modules/doc/xmlContent/types.ts +9 -3
- package/src/modules/doc/xmlContent/utils.ts +3 -1
- package/src/modules/doc/xmlContent/xmlContent.css +16 -4
- package/src/modules/doc/xmlContent/xmlContent.html +36 -21
- package/src/modules/doc/xmlContent/xmlContent.ts +295 -120
- package/src/modules/docHelpers/amfStyle/amfStyle.css +6 -8
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +162 -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/LICENSE +0 -12
- package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
- package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +0 -39
|
@@ -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,12 +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";
|
|
9
|
-
|
|
7
|
+
import ContentCallout from "doc/contentCallout";
|
|
8
|
+
import ContentMedia from "doc/contentMedia";
|
|
10
9
|
const HIGHLIGHTABLE_SELECTOR = [
|
|
11
10
|
"p",
|
|
12
11
|
".p",
|
|
@@ -43,26 +42,10 @@ export default class Content extends LightningElement {
|
|
|
43
42
|
return this.docContent;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
@api
|
|
47
|
-
set codeBlockTheme(value) {
|
|
48
|
-
this._codeBlockTheme = value;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
get codeBlockTheme() {
|
|
52
|
-
return this._codeBlockTheme;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
45
|
@track docContent: DocContent = "";
|
|
56
|
-
_codeBlockTheme: string = "dark";
|
|
57
46
|
_docRendered: boolean = false;
|
|
58
|
-
originalCodeBlockThemeValue: String = "";
|
|
59
47
|
|
|
60
48
|
connectedCallback() {
|
|
61
|
-
this.template.addEventListener(
|
|
62
|
-
"themechange",
|
|
63
|
-
this.updateTheme.bind(this) // eslint-disableline no-use-before-define
|
|
64
|
-
);
|
|
65
|
-
|
|
66
49
|
window.addEventListener(
|
|
67
50
|
"highlightedtermchange",
|
|
68
51
|
this.updateHighlighted
|
|
@@ -76,17 +59,8 @@ export default class Content extends LightningElement {
|
|
|
76
59
|
);
|
|
77
60
|
}
|
|
78
61
|
|
|
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
62
|
renderPaginationButton(anchorEl: HTMLElement) {
|
|
89
|
-
const isNext = anchorEl.textContent
|
|
63
|
+
const isNext = anchorEl.textContent!.includes("Next →");
|
|
90
64
|
anchorEl.innerHTML = "";
|
|
91
65
|
const buttonEl = createElement("dx-button", { is: Button });
|
|
92
66
|
const params = isNext
|
|
@@ -116,11 +90,11 @@ export default class Content extends LightningElement {
|
|
|
116
90
|
const codeBlockEls = divEl.querySelectorAll(".codeSection");
|
|
117
91
|
codeBlockEls.forEach((codeBlockEl) => {
|
|
118
92
|
codeBlockEl.setAttribute("lwc:dom", "manual");
|
|
119
|
-
const classList = codeBlockEl.
|
|
93
|
+
const classList = codeBlockEl.firstElementChild?.classList;
|
|
120
94
|
let language = "";
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const className = classList[
|
|
95
|
+
if (classList) {
|
|
96
|
+
for (let i = 0; i < classList.length; i++) {
|
|
97
|
+
const className = classList[i];
|
|
124
98
|
if (className.startsWith("brush:")) {
|
|
125
99
|
language = className.split(":")[1];
|
|
126
100
|
}
|
|
@@ -133,8 +107,7 @@ export default class Content extends LightningElement {
|
|
|
133
107
|
codeBlock: codeBlockEl.innerHTML,
|
|
134
108
|
// ! Hot fix for incoming html tags from couchdb for xml blocks, fix me soon please
|
|
135
109
|
language: LANGUAGE_MAP[language] || language,
|
|
136
|
-
|
|
137
|
-
title: "", // Default no title.
|
|
110
|
+
header: "", // Default no title.
|
|
138
111
|
variant: this.codeBlockType,
|
|
139
112
|
isEncoded: true
|
|
140
113
|
});
|
|
@@ -158,9 +131,10 @@ export default class Content extends LightningElement {
|
|
|
158
131
|
}
|
|
159
132
|
});
|
|
160
133
|
|
|
134
|
+
// Set a flag to 1 (true) if and only if all detailEls have no content.
|
|
161
135
|
let flag = 1;
|
|
162
136
|
for (let i: number = 0; i < detailEls.length; i++) {
|
|
163
|
-
flag &= detailEls[i].innerHTML.trim() === "";
|
|
137
|
+
flag &= (detailEls[i].innerHTML.trim() === "") as any; // Dark Magic TM
|
|
164
138
|
}
|
|
165
139
|
|
|
166
140
|
if (flag) {
|
|
@@ -170,10 +144,10 @@ export default class Content extends LightningElement {
|
|
|
170
144
|
});
|
|
171
145
|
}
|
|
172
146
|
|
|
173
|
-
const type = calloutEl.querySelector("h4")
|
|
147
|
+
const type = calloutEl.querySelector("h4")!.textContent!;
|
|
174
148
|
const typeLower = type.toLowerCase();
|
|
175
149
|
Object.assign(calloutCompEl, {
|
|
176
|
-
|
|
150
|
+
header: type,
|
|
177
151
|
variant: typeLower
|
|
178
152
|
});
|
|
179
153
|
// eslint-disable-next-line no-use-before-define
|
|
@@ -184,10 +158,10 @@ export default class Content extends LightningElement {
|
|
|
184
158
|
// Modify links to work with any domain, links that start with "#" are excluded
|
|
185
159
|
const anchorEls = divEl.querySelectorAll("a:not([href^='#'])");
|
|
186
160
|
|
|
187
|
-
anchorEls.forEach((anchorEl) => {
|
|
161
|
+
anchorEls.forEach((anchorEl: any) => {
|
|
188
162
|
if (
|
|
189
|
-
anchorEl.textContent
|
|
190
|
-
anchorEl.textContent
|
|
163
|
+
anchorEl.textContent!.includes("Next →") ||
|
|
164
|
+
anchorEl.textContent!.includes("← Previous")
|
|
191
165
|
) {
|
|
192
166
|
if (this.showPaginationButtons) {
|
|
193
167
|
this.renderPaginationButton(anchorEl);
|
|
@@ -253,6 +227,7 @@ export default class Content extends LightningElement {
|
|
|
253
227
|
const label = mediaEl.getAttribute("label");
|
|
254
228
|
const width = mediaEl.getAttribute("width");
|
|
255
229
|
const height = mediaEl.getAttribute("height");
|
|
230
|
+
const className = mediaEl.getAttribute("class");
|
|
256
231
|
|
|
257
232
|
if (isImage) {
|
|
258
233
|
src = src.startsWith("/")
|
|
@@ -264,6 +239,7 @@ export default class Content extends LightningElement {
|
|
|
264
239
|
|
|
265
240
|
const img: HTMLImageElement = document.createElement("img");
|
|
266
241
|
img.src = src;
|
|
242
|
+
img.alt = "";
|
|
267
243
|
if (alt) {
|
|
268
244
|
img.alt = alt;
|
|
269
245
|
}
|
|
@@ -276,8 +252,11 @@ export default class Content extends LightningElement {
|
|
|
276
252
|
if (width) {
|
|
277
253
|
img.width = parseFloat(width);
|
|
278
254
|
}
|
|
255
|
+
if (className) {
|
|
256
|
+
img.className = className;
|
|
257
|
+
}
|
|
279
258
|
|
|
280
|
-
img.className =
|
|
259
|
+
img.className = `content-image ${img.className}`;
|
|
281
260
|
mediaEl.parentNode!.insertBefore(img, mediaEl);
|
|
282
261
|
} else {
|
|
283
262
|
const contentMediaEl = createElement("doc-content-media", {
|
|
@@ -321,8 +300,7 @@ export default class Content extends LightningElement {
|
|
|
321
300
|
|
|
322
301
|
handleNavClick(event: InputEvent) {
|
|
323
302
|
event.preventDefault();
|
|
324
|
-
|
|
325
|
-
const target = event.currentTarget.dataset.id;
|
|
303
|
+
const target = (event.currentTarget! as any).dataset.id;
|
|
326
304
|
const [page, docId, deliverable, tempContentDocumentId] =
|
|
327
305
|
target.split("/");
|
|
328
306
|
const [contentDocumentId, hash] = tempContentDocumentId.split("#");
|
|
@@ -355,7 +333,7 @@ export default class Content extends LightningElement {
|
|
|
355
333
|
);
|
|
356
334
|
|
|
357
335
|
@api
|
|
358
|
-
public navigateToHash(hash: String) {
|
|
336
|
+
public navigateToHash = (hash: String) => {
|
|
359
337
|
const splitHash = hash.split("#");
|
|
360
338
|
if (splitHash.length === 2) {
|
|
361
339
|
hash = splitHash[1];
|
|
@@ -366,7 +344,7 @@ export default class Content extends LightningElement {
|
|
|
366
344
|
} else {
|
|
367
345
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
368
346
|
}
|
|
369
|
-
}
|
|
347
|
+
};
|
|
370
348
|
|
|
371
349
|
renderedCallback() {
|
|
372
350
|
if (this._docRendered) {
|
|
@@ -4,13 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
.dx-callout {
|
|
6
6
|
border-radius: 4px;
|
|
7
|
+
margin: var(--dx-g-spacing-md) 0;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
.dx-callout-base
|
|
10
|
+
.dx-callout-base,
|
|
11
|
+
.dx-callout-plain {
|
|
10
12
|
background-color: var(--dx-g-gray-95);
|
|
11
13
|
border-color: var(--dx-g-gray-50);
|
|
12
14
|
}
|
|
13
15
|
|
|
16
|
+
.dx-callout-plain {
|
|
17
|
+
border: none;
|
|
18
|
+
margin-bottom: var(--dx-g-text-2xl);
|
|
19
|
+
}
|
|
20
|
+
|
|
14
21
|
.dx-callout-note {
|
|
15
22
|
background-color: var(--dx-g-blue-vibrant-95);
|
|
16
23
|
border-color: var(--dx-g-blue-vibrant-50);
|
|
@@ -47,10 +54,7 @@
|
|
|
47
54
|
flex-direction: row;
|
|
48
55
|
}
|
|
49
56
|
|
|
50
|
-
.dx-callout-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.dx-callout-base_column > dx-type-badge-group {
|
|
55
|
-
margin-bottom: var(--dx-g-spacing-sm);
|
|
57
|
+
.dx-callout-content {
|
|
58
|
+
flex: 1;
|
|
59
|
+
overflow: auto;
|
|
56
60
|
}
|
|
@@ -1,11 +1,18 @@
|
|
|
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
14
|
<p class="doc-status-title dx-callout-title dx-text-body-3">
|
|
8
|
-
{
|
|
15
|
+
{header}
|
|
9
16
|
</p>
|
|
10
17
|
<span class="dx-callout-body dx-text-body-3">
|
|
11
18
|
<slot onslotchange={onSlotChange}></slot>
|
|
@@ -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";
|
|
@@ -49,6 +52,10 @@ export default class ContentCallout extends LightningElement {
|
|
|
49
52
|
);
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
get hideIcon() {
|
|
56
|
+
return this.variant === "plain";
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
private isSlotEmpty: boolean = true;
|
|
53
60
|
private onSlotChange(e: LightningSlotElement) {
|
|
54
61
|
// @ts-ignore
|
|
@@ -1,98 +1 @@
|
|
|
1
|
-
|
|
2
|
-
--dx-c-content-vertical-spacing: var(--dx-g-spacing-lg);
|
|
3
|
-
|
|
4
|
-
display: block;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
doc-breadcrumbs {
|
|
8
|
-
--dx-c-popover-z-index: 5;
|
|
9
|
-
|
|
10
|
-
display: block;
|
|
11
|
-
margin-bottom: var(--dx-g-spacing-2xl);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
dx-sidebar,
|
|
15
|
-
dx-sidebar-old {
|
|
16
|
-
--dx-c-sidebar-height: 100%;
|
|
17
|
-
--dx-c-sidebar-vertical-padding: var(--dx-c-content-vertical-spacing);
|
|
18
|
-
|
|
19
|
-
z-index: 6;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
dx-toc {
|
|
23
|
-
--dx-c-toc-width: unset;
|
|
24
|
-
|
|
25
|
-
height: calc(100% - var(--dx-c-content-vertical-spacing) * 2);
|
|
26
|
-
margin: var(--dx-c-content-vertical-spacing) 0;
|
|
27
|
-
overflow-y: auto;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
dx-sidebar,
|
|
31
|
-
dx-toc {
|
|
32
|
-
display: block;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.content {
|
|
36
|
-
display: flex;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.content-body-doc-phase-container {
|
|
40
|
-
flex: 1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.content-body-container {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: row;
|
|
46
|
-
padding-right: var(--dx-g-page-padding-horizontal);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.content-body {
|
|
50
|
-
margin: var(--dx-g-spacing-sm) var(--dx-c-content-vertical-spacing)
|
|
51
|
-
var(--dx-g-spacing-xl);
|
|
52
|
-
flex: 1;
|
|
53
|
-
width: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.is-sticky {
|
|
57
|
-
height: 100vh;
|
|
58
|
-
position: sticky;
|
|
59
|
-
top: 0;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.right-nav-bar {
|
|
63
|
-
max-width: 275px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@media screen and (max-width: 1024px) {
|
|
67
|
-
.right-nav-bar {
|
|
68
|
-
display: none;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@media screen and (max-width: 800px) {
|
|
73
|
-
.content-body {
|
|
74
|
-
margin-top: var(--dx-c-content-vertical-spacing);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@media screen and (max-width: 768px) {
|
|
79
|
-
.content {
|
|
80
|
-
flex-direction: column;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.content-body-container {
|
|
84
|
-
padding-right: 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.left-nav-bar {
|
|
88
|
-
--dx-c-sidebar-height: 80vh;
|
|
89
|
-
|
|
90
|
-
height: unset;
|
|
91
|
-
z-index: 10;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.content-body {
|
|
95
|
-
margin-left: var(--dx-g-spacing-mlg, 20px);
|
|
96
|
-
margin-right: var(--dx-g-spacing-mlg, 20px);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
1
|
+
@import "docHelpers/contentLayoutStyle";
|