@salesforcedevs/docs-components 1.34.9 → 1.35.0-node24-1
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/package.json +29 -28
- package/src/modules/doc/contentLayout/contentLayout.html +35 -16
- package/src/modules/doc/contentLayout/contentLayout.ts +27 -1
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +17 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +9 -0
- package/src/modules/doc/xmlContent/xmlContent.html +1 -0
- package/src/modules/doc/xmlContent/xmlContent.ts +0 -11
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
"name": "@salesforcedevs/docs-components",
|
|
3
|
+
"version": "1.35.0-node24-1",
|
|
4
|
+
"description": "Docs Lightning web components for DSC",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "24.x"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@api-components/amf-helper-mixin": "4.5.29",
|
|
15
|
+
"classnames": "2.5.1",
|
|
16
|
+
"dompurify": "3.2.4",
|
|
17
|
+
"kagekiri": "1.4.2",
|
|
18
|
+
"lodash.orderby": "4.6.0",
|
|
19
|
+
"lodash.uniqby": "4.7.0",
|
|
20
|
+
"query-string": "7.1.3",
|
|
21
|
+
"sentence-case": "3.0.4"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/classnames": "2.3.1",
|
|
25
|
+
"@types/lodash.orderby": "4.6.9",
|
|
26
|
+
"@types/lodash.uniqby": "4.7.9"
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad",
|
|
29
|
+
"stableVersion": "1.35.0"
|
|
30
|
+
}
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="content">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
<template lwc:if={showOpenSearchSidebar}>
|
|
4
|
+
<dx-sidebar
|
|
5
|
+
class="is-sticky left-nav-bar"
|
|
6
|
+
trees={sidebarContent}
|
|
7
|
+
value={sidebarValue}
|
|
8
|
+
header={sidebarHeader}
|
|
9
|
+
ontogglesidebar={onToggleSidebar}
|
|
10
|
+
languages={languages}
|
|
11
|
+
language={language}
|
|
12
|
+
bail-href={bailHref}
|
|
13
|
+
bail-label={bailLabel}
|
|
14
|
+
dev-center={devCenter}
|
|
15
|
+
brand={brand}
|
|
16
|
+
>
|
|
17
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
18
|
+
</dx-sidebar>
|
|
19
|
+
</template>
|
|
20
|
+
<template lwc:if={showOldSidebar}>
|
|
21
|
+
<dx-sidebar-old
|
|
22
|
+
class="is-sticky left-nav-bar"
|
|
23
|
+
trees={sidebarContent}
|
|
24
|
+
value={sidebarValue}
|
|
25
|
+
header={sidebarHeader}
|
|
26
|
+
ontogglesidebar={onToggleSidebar}
|
|
27
|
+
languages={languages}
|
|
28
|
+
language={language}
|
|
29
|
+
bail-href={bailHref}
|
|
30
|
+
bail-label={bailLabel}
|
|
31
|
+
dev-center={devCenter}
|
|
32
|
+
brand={brand}
|
|
33
|
+
empty-state-message={emptyStateMessage}
|
|
34
|
+
>
|
|
35
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
36
|
+
</dx-sidebar-old>
|
|
37
|
+
</template>
|
|
19
38
|
<div class="content-body-doc-phase-container">
|
|
20
39
|
<div class="doc-phase-wrapper">
|
|
21
40
|
<slot name="doc-phase"></slot>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @lwc/lwc/no-document-query */
|
|
2
|
+
import { isOpenSearchConfigured } from "dxUtils/openSearch";
|
|
2
3
|
import { LightningElement, api, createElement, track } from "lwc";
|
|
3
4
|
import { closest, querySelector } from "kagekiri";
|
|
4
5
|
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
@@ -78,6 +79,15 @@ export default class ContentLayout extends LightningElement {
|
|
|
78
79
|
@api brand: any;
|
|
79
80
|
@api emptyStateMessage?: string;
|
|
80
81
|
|
|
82
|
+
@api
|
|
83
|
+
get enableOpenSearch() {
|
|
84
|
+
return this._enableOpenSearch;
|
|
85
|
+
}
|
|
86
|
+
set enableOpenSearch(value) {
|
|
87
|
+
this._enableOpenSearch = normalizeBoolean(value);
|
|
88
|
+
}
|
|
89
|
+
private _enableOpenSearch = false;
|
|
90
|
+
|
|
81
91
|
// This is needed for now to prevent failing snapshot tests due to links in the footer
|
|
82
92
|
@api
|
|
83
93
|
get showFooter() {
|
|
@@ -155,6 +165,20 @@ export default class ContentLayout extends LightningElement {
|
|
|
155
165
|
);
|
|
156
166
|
}
|
|
157
167
|
|
|
168
|
+
/** Show the OpenSearch sidebar when enabled, configured, and the old sidebar isn't requested. */
|
|
169
|
+
protected get showOpenSearchSidebar(): boolean {
|
|
170
|
+
return (
|
|
171
|
+
this.enableOpenSearch &&
|
|
172
|
+
!this.useOldSidebar &&
|
|
173
|
+
isOpenSearchConfigured()
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Show the legacy (keyword) sidebar when requested, or when OpenSearch is disabled or not configured. */
|
|
178
|
+
protected get showOldSidebar(): boolean {
|
|
179
|
+
return !this.showOpenSearchSidebar;
|
|
180
|
+
}
|
|
181
|
+
|
|
158
182
|
@track
|
|
159
183
|
protected _sidebarContent: unknown;
|
|
160
184
|
|
|
@@ -366,7 +390,9 @@ export default class ContentLayout extends LightningElement {
|
|
|
366
390
|
We have to account for the global nav changing height due to animations.
|
|
367
391
|
*/
|
|
368
392
|
adjustNavPosition = () => {
|
|
369
|
-
const sidebarEl =
|
|
393
|
+
const sidebarEl =
|
|
394
|
+
this.template.querySelector("dx-sidebar") ||
|
|
395
|
+
this.template.querySelector("dx-sidebar-old");
|
|
370
396
|
const globalNavEl = document.querySelector(
|
|
371
397
|
"hgf-c360nav"
|
|
372
398
|
) as HTMLElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="content">
|
|
3
3
|
<dx-sidebar-old
|
|
4
|
+
lwc:if={showOldSidebar}
|
|
4
5
|
class="is-sticky left-nav-bar"
|
|
5
6
|
trees={sidebarContent}
|
|
6
7
|
value={sidebarValue}
|
|
@@ -15,6 +16,22 @@
|
|
|
15
16
|
>
|
|
16
17
|
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
17
18
|
</dx-sidebar-old>
|
|
19
|
+
<dx-sidebar
|
|
20
|
+
lwc:else
|
|
21
|
+
class="is-sticky left-nav-bar"
|
|
22
|
+
trees={sidebarContent}
|
|
23
|
+
value={sidebarValue}
|
|
24
|
+
header={sidebarHeader}
|
|
25
|
+
ontogglesidebar={onToggleSidebar}
|
|
26
|
+
languages={languages}
|
|
27
|
+
language={language}
|
|
28
|
+
bail-href={bailHref}
|
|
29
|
+
bail-label={bailLabel}
|
|
30
|
+
dev-center={devCenter}
|
|
31
|
+
brand={brand}
|
|
32
|
+
>
|
|
33
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
34
|
+
</dx-sidebar>
|
|
18
35
|
<div class="content-body-doc-phase-container">
|
|
19
36
|
<div class="doc-phase-wrapper">
|
|
20
37
|
<slot name="doc-phase"></slot>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { api } from "lwc";
|
|
2
2
|
import ContentLayout from "doc/contentLayout";
|
|
3
3
|
import cx from "classnames";
|
|
4
|
+
import { isOpenSearchConfigured } from "dxUtils/openSearch";
|
|
4
5
|
|
|
5
6
|
const TOC_HEADER_TAG = "doc-heading";
|
|
6
7
|
const RNB_BY_TAB = "docs-tab";
|
|
@@ -26,6 +27,14 @@ export default class LwcContentLayout extends ContentLayout {
|
|
|
26
27
|
);
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* This layout uses the OpenSearch sidebar by default (no enable flag), so it
|
|
32
|
+
* falls back to the old sidebar when requested or when search isn't configured.
|
|
33
|
+
*/
|
|
34
|
+
protected get showOldSidebar(): boolean {
|
|
35
|
+
return this.useOldSidebar || !isOpenSearchConfigured();
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
private setRNBByTab() {
|
|
30
39
|
const tabPanelListItem = this.getTabPanelList();
|
|
31
40
|
this.rnbByTab = tabPanelListItem?.id === RNB_BY_TAB;
|
|
@@ -261,17 +261,6 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
261
261
|
return this.pageReference.deliverable;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
private get useOldSidebar(): boolean {
|
|
265
|
-
// Coveo is enabled and the version is greater than 51 (within the latest 3 versions)
|
|
266
|
-
// TODO: we need a better fix for version number check
|
|
267
|
-
return !(
|
|
268
|
-
!this.version?.releaseVersion ||
|
|
269
|
-
(this.version?.releaseVersion &&
|
|
270
|
-
parseInt(this.version.releaseVersion.replace("v", ""), 10) >=
|
|
271
|
-
53)
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
264
|
private get pageHeader(): Header {
|
|
276
265
|
if (!this._pageHeader) {
|
|
277
266
|
this._pageHeader = document.querySelector("doc-header")!;
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|