@salesforcedevs/arch-components 1.27.12 → 1.27.17
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 +2 -2
- package/src/modules/arch/card/card.css +8 -0
- package/src/modules/arch/card/card.html +1 -3
- package/src/modules/arch/card/card.ts +8 -0
- package/src/modules/arch/gallery/gallery.css +0 -8
- package/src/modules/arch/gallery/gallery.html +0 -5
- package/src/modules/arch/searchList/searchList.ts +17 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/arch-components",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.17",
|
|
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": "e8a07ec5b69da0c6e7f65c2da19e6d6a64573047"
|
|
48
48
|
}
|
|
@@ -31,6 +31,10 @@ a:hover {
|
|
|
31
31
|
box-shadow: var(--arch-shadow-md);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
.card[data-href]:hover {
|
|
35
|
+
background-color: var(--arch-color-fog, rgb(0 0 0 / 3%));
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
.content {
|
|
35
39
|
display: flex;
|
|
36
40
|
flex: 1;
|
|
@@ -75,6 +79,10 @@ img.image {
|
|
|
75
79
|
max-height: 100px;
|
|
76
80
|
}
|
|
77
81
|
|
|
82
|
+
.card[data-href] {
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
78
86
|
.card[data-href] .image {
|
|
79
87
|
cursor: pointer;
|
|
80
88
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
role="article"
|
|
7
7
|
aria-labelledby={cardTitleId}
|
|
8
8
|
tabindex="0"
|
|
9
|
+
onclick={handleCardClick}
|
|
9
10
|
onkeydown={handleCardKeydown}
|
|
10
11
|
>
|
|
11
12
|
<div class="content">
|
|
@@ -46,7 +47,6 @@
|
|
|
46
47
|
id={imageDivId}
|
|
47
48
|
class="image"
|
|
48
49
|
if:false={imgTag}
|
|
49
|
-
onclick={onImageClick}
|
|
50
50
|
style={imgStyle}
|
|
51
51
|
data-href={ctaHref}
|
|
52
52
|
></div>
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
id={imageImgId}
|
|
61
61
|
class="image"
|
|
62
62
|
if:true={imgTag}
|
|
63
|
-
onclick={onImageClick}
|
|
64
63
|
style={imgStyle}
|
|
65
64
|
src={imgSrc}
|
|
66
65
|
alt={imageAltText}
|
|
@@ -73,7 +72,6 @@
|
|
|
73
72
|
id={imageSvgId}
|
|
74
73
|
class="image"
|
|
75
74
|
if:true={imgTagSvg}
|
|
76
|
-
onclick={onImageClick}
|
|
77
75
|
style={imgStyle}
|
|
78
76
|
src={imgSrc}
|
|
79
77
|
alt={description}
|
|
@@ -179,6 +179,14 @@ export default class extends LightningElement {
|
|
|
179
179
|
mediaQuerySnapToTop.removeListener(this.onMediaQuerySnapToTop);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
private handleCardClick(e: MouseEvent) {
|
|
183
|
+
// Let link clicks (CTA, pretitle, etc.) use their default behavior
|
|
184
|
+
if ((e.target as HTMLElement).closest("a")) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
this.onImageClick(e);
|
|
188
|
+
}
|
|
189
|
+
|
|
182
190
|
private onImageClick(e: MouseEvent) {
|
|
183
191
|
const element = e.target as HTMLElement;
|
|
184
192
|
sendInteractionEvent(
|
|
@@ -43,11 +43,6 @@
|
|
|
43
43
|
<div class="search-input">
|
|
44
44
|
<label class="search-input-label" for="search">Search</label>
|
|
45
45
|
<div class="search-input-wrapper">
|
|
46
|
-
<arch-icon
|
|
47
|
-
class="search-input-icon"
|
|
48
|
-
size="small"
|
|
49
|
-
symbol="search"
|
|
50
|
-
></arch-icon>
|
|
51
46
|
<input
|
|
52
47
|
id="search"
|
|
53
48
|
class="search-input-input"
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { LightningElement, api, track } from "lwc";
|
|
2
2
|
import { track as trackEvent } from "arch/instrumentation";
|
|
3
3
|
|
|
4
|
+
function decodeHtmlEntities(value: unknown): string {
|
|
5
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
// Only do work if it looks like it contains entities.
|
|
9
|
+
if (!value.includes("&") || !value.includes(";")) {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
// Decode entities (e.g. ' -> ') without using innerHTML.
|
|
13
|
+
const doc = new DOMParser().parseFromString(value, "text/html");
|
|
14
|
+
return doc.documentElement.textContent ?? "";
|
|
15
|
+
}
|
|
16
|
+
|
|
4
17
|
export default class SearchList extends LightningElement {
|
|
5
18
|
queryString?: string = "";
|
|
6
19
|
titleSearchResults: string = "";
|
|
@@ -37,7 +50,10 @@ export default class SearchList extends LightningElement {
|
|
|
37
50
|
this.titleSearchResults = `Search results for "${decodeURIComponent(
|
|
38
51
|
keywords
|
|
39
52
|
)}"`;
|
|
40
|
-
this.results = json.hits
|
|
53
|
+
this.results = json.hits.map((hit: any) => ({
|
|
54
|
+
...hit,
|
|
55
|
+
description: decodeHtmlEntities(hit.description)
|
|
56
|
+
}));
|
|
41
57
|
this.showSearchSuggestions = false;
|
|
42
58
|
} else {
|
|
43
59
|
this.titleSearchResults = `No results for "${decodeURIComponent(
|