@salesforcedevs/docs-components 1.34.5-fix-non-en-version-1 → 1.34.5
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/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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.
|
package/package.json
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
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
|
-
|
|
30
|
-
}
|
|
2
|
+
"name": "@salesforcedevs/docs-components",
|
|
3
|
+
"version": "1.34.5",
|
|
4
|
+
"description": "Docs Lightning web components for DSC",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "22.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": "1df35017c1cc93551081329c96a37f42ed0780af"
|
|
29
|
+
}
|
|
@@ -130,16 +130,9 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
130
130
|
private get oldVersionInfo(): DocPhaseInfo | null {
|
|
131
131
|
let info = null;
|
|
132
132
|
if (!this.disableVersion) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
* does include the version id. In that case, the first version in the
|
|
137
|
-
* list is the latest one.
|
|
138
|
-
**/
|
|
139
|
-
const currentGAVersion =
|
|
140
|
-
this.versionOptions.find(
|
|
141
|
-
(version) => !version.url.includes(version.id)
|
|
142
|
-
) ?? this.versionOptions[0];
|
|
133
|
+
const currentGAVersion = this.versionOptions.find(
|
|
134
|
+
(version) => !version.url.includes(version.id)
|
|
135
|
+
);
|
|
143
136
|
if (currentGAVersion?.link?.href && this.version?.id) {
|
|
144
137
|
const versionNo = currentGAVersion.id;
|
|
145
138
|
/**
|
|
@@ -23,6 +23,9 @@ export interface SearchResult {
|
|
|
23
23
|
// and existing fixtures still satisfy the type.
|
|
24
24
|
snippet?: string | null;
|
|
25
25
|
snippetSource?: SnippetSource;
|
|
26
|
+
// `url` plus `#anchor` of the page section that matched, or null/absent
|
|
27
|
+
// when the matched chunk has no anchor. Link to it via resultHref().
|
|
28
|
+
sectionUrl?: string | null;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
export interface FacetBucket {
|
|
@@ -208,6 +211,19 @@ export function sanitizeSnippetHtml(value: unknown): string {
|
|
|
208
211
|
* text path. So for anything but a headline we return `null` and let the
|
|
209
212
|
* caller keep today's text rendering.
|
|
210
213
|
*/
|
|
214
|
+
/**
|
|
215
|
+
* Where a result's title should link: the matched section when the backend
|
|
216
|
+
* returned one, else the page. The section link is only trusted when it is the
|
|
217
|
+
* page URL plus a fragment, so a malformed value can never send the user
|
|
218
|
+
* somewhere else.
|
|
219
|
+
*/
|
|
220
|
+
export function resultHref(result: SearchResult): string {
|
|
221
|
+
const { url, sectionUrl } = result;
|
|
222
|
+
return typeof sectionUrl === "string" && sectionUrl.startsWith(`${url}#`)
|
|
223
|
+
? sectionUrl
|
|
224
|
+
: url;
|
|
225
|
+
}
|
|
226
|
+
|
|
211
227
|
export function highlightedSnippetHtml(result: SearchResult): string | null {
|
|
212
228
|
if (result.snippetSource !== "headline") {
|
|
213
229
|
return null;
|