@salesforcedevs/arch-components 1.29.0 → 1.29.2
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/arch-components",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.2",
|
|
4
4
|
"description": "Architect Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"eventsourcemock": "2.0.0",
|
|
45
45
|
"luxon": "3.4.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "1df35017c1cc93551081329c96a37f42ed0780af"
|
|
48
48
|
}
|
|
@@ -2,7 +2,11 @@ import { LightningElement, api, track } from "lwc";
|
|
|
2
2
|
import { track as trackEvent } from "arch/instrumentation";
|
|
3
3
|
import { resolveBrowserLocale } from "arch/browserLocale";
|
|
4
4
|
import { getStoredLanguage, setStoredLanguage } from "arch/localePreference";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
decodeHtmlEntities,
|
|
7
|
+
isSortOption,
|
|
8
|
+
resultHref
|
|
9
|
+
} from "docUtils/searchClient";
|
|
6
10
|
import { SearchController } from "docUtils/searchController";
|
|
7
11
|
import type { SearchViewModel, SortOption } from "docUtils/searchController";
|
|
8
12
|
import type { SearchResult, FacetBucket } from "docUtils/searchClient";
|
|
@@ -22,6 +26,8 @@ interface RenderResult extends SearchResult {
|
|
|
22
26
|
// fused results can share a canonical URL, and a duplicate LWC key throws
|
|
23
27
|
// and fails to render the WHOLE list, so we disambiguate with the index.
|
|
24
28
|
key: string;
|
|
29
|
+
// Matched-section link; falls back to the page url.
|
|
30
|
+
href: string;
|
|
25
31
|
decodedTitle: string;
|
|
26
32
|
decodedDescription: string;
|
|
27
33
|
hasDescription: boolean;
|
|
@@ -170,6 +176,7 @@ export default class SearchHybrid extends LightningElement {
|
|
|
170
176
|
...result,
|
|
171
177
|
// Index-disambiguated so duplicate URLs can't collide (see key).
|
|
172
178
|
key: `${result.url}-${index}`,
|
|
179
|
+
href: resultHref(result),
|
|
173
180
|
decodedTitle: decodeHtmlEntities(result.title),
|
|
174
181
|
decodedDescription: decodeHtmlEntities(description),
|
|
175
182
|
hasDescription:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { html, render, TemplateResult } from
|
|
2
|
-
import { querySelectorAll, querySelector } from
|
|
3
|
-
|
|
4
|
-
import { createElement, LightningElement, setFeatureFlagForTest } from 'lwc';
|
|
1
|
+
import { html, render, TemplateResult } from "lit-html";
|
|
2
|
+
import { querySelectorAll, querySelector } from "kagekiri";
|
|
3
|
+
import { createElement, LightningElement } from "lwc";
|
|
5
4
|
|
|
6
5
|
export { html, render };
|
|
7
6
|
|
|
@@ -20,7 +19,7 @@ export function $testid(value: string, element: HTMLElement) {
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
export function renderIntoBody(template: TemplateResult) {
|
|
23
|
-
const element = document.createElement(
|
|
22
|
+
const element = document.createElement("div");
|
|
24
23
|
document.body.append(element);
|
|
25
24
|
render(template, element);
|
|
26
25
|
return element.children[0] as HTMLElement;
|
|
@@ -39,7 +38,7 @@ export async function renderIntoBodyAndWait(
|
|
|
39
38
|
await new Promise((resolve) => {
|
|
40
39
|
const check = () => {
|
|
41
40
|
const isReady =
|
|
42
|
-
typeof ready ===
|
|
41
|
+
typeof ready === "string"
|
|
43
42
|
? querySelector(ready, element) !== null
|
|
44
43
|
: ready({ querySelector, querySelectorAll });
|
|
45
44
|
if (isReady) {
|
|
@@ -67,7 +66,6 @@ export const createRenderComponent = (
|
|
|
67
66
|
tag: string,
|
|
68
67
|
LWC: new () => LightningElement
|
|
69
68
|
) => {
|
|
70
|
-
setFeatureFlagForTest('ENABLE_LIGHT_DOM_COMPONENTS', true);
|
|
71
69
|
return (properties = {}) => {
|
|
72
70
|
const component = createElement(tag, {
|
|
73
71
|
is: LWC
|
|
@@ -80,17 +78,17 @@ export const createRenderComponent = (
|
|
|
80
78
|
|
|
81
79
|
export const mockSlottedElement = <T extends HTMLElement>(
|
|
82
80
|
element: any,
|
|
83
|
-
elementType =
|
|
81
|
+
elementType = "button",
|
|
84
82
|
slotName?: string
|
|
85
83
|
): { slottedElement: T; slot: HTMLSlotElement } => {
|
|
86
84
|
const slot: HTMLSlotElement = element.shadowRoot.querySelector(
|
|
87
|
-
`slot${slotName ? `[name='${slotName}']` :
|
|
85
|
+
`slot${slotName ? `[name='${slotName}']` : ""}`
|
|
88
86
|
);
|
|
89
87
|
expect(slot).not.toBeNull();
|
|
90
88
|
|
|
91
89
|
const slottedElement = document.createElement(elementType) as T;
|
|
92
90
|
slot.assignedElements = jest.fn(() => [slottedElement]);
|
|
93
|
-
slot.dispatchEvent(new Event(
|
|
91
|
+
slot.dispatchEvent(new Event("slotchange"));
|
|
94
92
|
|
|
95
93
|
return { slottedElement, slot };
|
|
96
94
|
};
|