@salesforcedevs/dx-components 1.3.258 → 1.3.260

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 CHANGED
@@ -5,6 +5,7 @@
5
5
  { "npm": "@salesforcedevs/docs-components" }
6
6
  ],
7
7
  "expose": [
8
+ "dx/agenda",
8
9
  "dx/alert",
9
10
  "dx/audio",
10
11
  "dx/banner",
@@ -14,11 +15,13 @@
14
15
  "dx/buttonToggle",
15
16
  "dx/cardBlogPost",
16
17
  "dx/cardCallout",
18
+ "dx/cardClickthrough",
17
19
  "dx/cardContent",
18
20
  "dx/cardDemo",
19
21
  "dx/cardDocs",
20
22
  "dx/cardEvent",
21
23
  "dx/cardExpanded",
24
+ "dx/cardGrid",
22
25
  "dx/cardGridDocs",
23
26
  "dx/cardMinimal",
24
27
  "dx/cardNews",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.258",
3
+ "version": "1.3.260",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -45,5 +45,5 @@
45
45
  "volta": {
46
46
  "node": "16.19.1"
47
47
  },
48
- "gitHead": "1a1c249fe121c056d038fa06f99be150f3b799fd"
48
+ "gitHead": "b839cf5e249f61097ec60de9f07257c7ddbdf0e5"
49
49
  }
@@ -0,0 +1,97 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+
4
+ ul {
5
+ list-style: none;
6
+ }
7
+
8
+ .container {
9
+ max-width: 840px;
10
+ margin: 0 auto;
11
+ }
12
+
13
+ .detail-list-title {
14
+ text-align: center;
15
+ margin-bottom: 60px;
16
+ }
17
+
18
+ .detail-list-content-container {
19
+ position: relative;
20
+ }
21
+
22
+ .detail-list-content {
23
+ background-color: white;
24
+ border-color: var(--dx-g-gray-90);
25
+ border-style: solid;
26
+ border-width: 1px;
27
+ border-radius: 16px;
28
+ padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-2xl);
29
+ }
30
+
31
+ .detail-list-item {
32
+ align-items: center;
33
+ display: flex;
34
+ gap: var(--dx-g-spacing-xl);
35
+ padding: var(--dx-g-spacing-xl) 0;
36
+ }
37
+
38
+ .detail-list-item:not(:last-child) {
39
+ border-bottom: 1px solid var(--dx-g-gray-95);
40
+ }
41
+
42
+ .detail-list-item-title {
43
+ flex: 1;
44
+ }
45
+
46
+ .detail-list-item .detail-list-item-detail {
47
+ color: var(--dx-g-blue-vibrant-20);
48
+ display: inline-block;
49
+ font-weight: 700;
50
+ width: 25%;
51
+ }
52
+
53
+ .detail-list-item-detail-right {
54
+ text-align: right;
55
+ }
56
+
57
+ .flourish-container {
58
+ position: absolute;
59
+ bottom: 10px;
60
+ right: 0;
61
+ width: var(--dx-c-flourish-width, unset);
62
+ }
63
+
64
+ @media (max-width: 915px) {
65
+ .flourish-container {
66
+ display: none;
67
+ }
68
+ }
69
+
70
+ @media (max-width: 600px) {
71
+ .detail-list-content {
72
+ padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-mlg);
73
+ }
74
+
75
+ .detail-list-item {
76
+ gap: var(--dx-g-spacing-md);
77
+ }
78
+
79
+ .detail-list-item-detail {
80
+ width: 30%;
81
+ }
82
+
83
+ .detail-list-item-title {
84
+ font-size: var(--dx-g-text-base);
85
+ line-height: 20px;
86
+ }
87
+ }
88
+
89
+ @media (max-width: 430px) {
90
+ .detail-list-item-detail {
91
+ font-size: var(--dx-g-text-xs);
92
+ }
93
+
94
+ .detail-list-item-title {
95
+ font-size: var(--dx-g-text-sm);
96
+ }
97
+ }
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div class="container">
3
+ <h2 class="detail-list-title dx-text-display-4">{title}</h2>
4
+ <div class="detail-list-content-container">
5
+ <ul class="detail-list-content" part="content">
6
+ <template for:each={items} for:item="item">
7
+ <li class="detail-list-item" key={item.title}>
8
+ <span
9
+ lwc:if={item.leftDetail}
10
+ class="detail-list-item-detail detail-list-item-detail-left dx-text-body-3"
11
+ >
12
+ {item.leftDetail}
13
+ </span>
14
+ <span class="detail-list-item-title dx-text-display-7">
15
+ {item.title}
16
+ </span>
17
+ <span
18
+ lwc:if={item.rightDetail}
19
+ class="detail-list-item-detail detail-list-item-detail-right dx-text-body-3"
20
+ >
21
+ {item.rightDetail}
22
+ </span>
23
+ </li>
24
+ </template>
25
+ </ul>
26
+ <div lwc:if={flourish} class="flourish-container">
27
+ <img src={flourish} alt={flourishAlt} />
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </template>
@@ -0,0 +1,26 @@
1
+ import { toJson } from "dxUtils/normalizers";
2
+ import { api, LightningElement } from "lwc";
3
+
4
+ export interface AgendaItem {
5
+ body?: string;
6
+ isInitiallyOpen?: boolean;
7
+ leftDetail?: string;
8
+ rightDetail?: string;
9
+ title: string;
10
+ }
11
+
12
+ export default class Agenda extends LightningElement {
13
+ @api title: string = "Agenda";
14
+ @api flourish?: string;
15
+ @api flourishAlt?: string;
16
+
17
+ @api
18
+ get items() {
19
+ return this._items;
20
+ }
21
+ set items(value: any) {
22
+ this._items = toJson(value);
23
+ }
24
+
25
+ private _items: AgendaItem[] = [];
26
+ }
@@ -0,0 +1,69 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+ @import "dxHelpers/card";
4
+
5
+ :host {
6
+ --dx-c-heading-max-lines: 4;
7
+ --dx-c-card-grid-max-width: 60px;
8
+ }
9
+
10
+ .card {
11
+ display: flex;
12
+ flex-direction: column;
13
+ }
14
+
15
+ .not-clickable {
16
+ cursor: default;
17
+ }
18
+
19
+ .image {
20
+ width: 100%;
21
+ height: 160px;
22
+ }
23
+
24
+ .control {
25
+ border-radius: 50%;
26
+ background-color: var(--dx-g-cloud-blue-vibrant-95);
27
+ color: var(--dx-g-blue-vibrant-40);
28
+ width: 48px;
29
+ height: 48px;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ position: absolute;
34
+ bottom: 32px;
35
+ right: 20px;
36
+ }
37
+
38
+ /* text section */
39
+
40
+ .card_section-text {
41
+ grid-area: text;
42
+ flex-grow: 1;
43
+ position: relative;
44
+ }
45
+
46
+ .dx-text-display-8 dx-button {
47
+ margin-left: var(--dx-g-spacing-xs);
48
+ }
49
+
50
+ .dx-text-display-6 {
51
+ position: relative;
52
+ -webkit-line-clamp: var(--dx-c-heading-max-lines);
53
+ -webkit-box-orient: vertical;
54
+ display: box;
55
+ overflow: hidden;
56
+ }
57
+
58
+ .dx-text-display-6 dx-icon {
59
+ display: inline-block;
60
+ transform: translateY(-3px);
61
+ }
62
+
63
+ /* mobile responsiveness */
64
+
65
+ @media screen and (max-width: 1024px) {
66
+ .has-image:not(.show-mobile-image) .image {
67
+ display: none;
68
+ }
69
+ }
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <a href={href} class={className} target={target} onclick={handleCardClick}>
3
+ <img
4
+ if:true={imgSrc}
5
+ alt={imgAlt}
6
+ src={imgSrc}
7
+ class="image dx-card-base_image"
8
+ />
9
+ <div
10
+ class="dx-card-base_section-vertical dx-card-base_column card_section-text"
11
+ >
12
+ <span class="dx-text-label-3" part="label">{label}</span>
13
+ <dx-card-title title={title} target={target} onclick={handleLinkClick}></dx-card-title>
14
+ <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
15
+ <span lwc:if={href} class="control"><dx-icon size="medium" symbol="forward"></dx-icon></span>
16
+ </div>
17
+ </a>
18
+ </template>
@@ -0,0 +1,60 @@
1
+ import { LightningElement, api } from "lwc";
2
+ import cx from "classnames";
3
+ import { track } from "dxUtils/analytics";
4
+
5
+ export default class CardClickthrough extends LightningElement {
6
+ @api body!: string;
7
+ @api href?: string;
8
+ @api imgAlt?: string = "";
9
+ @api imgSrc?: string | null = null;
10
+ @api label!: string;
11
+ @api title!: string;
12
+ @api target?: string | null = null;
13
+ @api showMobileImg?: boolean = false;
14
+
15
+ private get className(): string {
16
+ return cx(
17
+ "card",
18
+ "dx-card-base",
19
+ this.imgSrc && "has-image",
20
+ this.showMobileImg && "show-mobile-image",
21
+ !this.href && "not-clickable" // for "coming soon" cards
22
+ );
23
+ }
24
+
25
+ handleCardClick(evt: Event) {
26
+ if (!this.href) {
27
+ evt.preventDefault();
28
+ }
29
+ }
30
+
31
+ private handleLinkClick(event: PointerEvent) {
32
+ if (!this.href) {
33
+ return;
34
+ }
35
+ const payloadCardInfo = {
36
+ click_text: this.title,
37
+ element_title: this.title,
38
+ click_url: this.href,
39
+ element_type: "link",
40
+ content_category: "cta"
41
+ };
42
+ track(event.currentTarget!, "custEv_cardClick", payloadCardInfo);
43
+ track(event.currentTarget!, "custEv_linkClick", payloadCardInfo);
44
+ }
45
+
46
+ private handleTextClick(event: PointerEvent) {
47
+ if (!this.href) {
48
+ return;
49
+ }
50
+ const payloadCardTextInfo = {
51
+ click_text: this.body,
52
+ element_title: this.title,
53
+ click_url: `${window.location.origin}${this.href}`,
54
+ element_type: "tile",
55
+ content_category: "cta"
56
+ };
57
+ track(event.currentTarget!, "custEv_ctaTile", payloadCardTextInfo);
58
+ track(event.currentTarget!, "custEv_linkClick", payloadCardTextInfo);
59
+ }
60
+ }
@@ -9,13 +9,13 @@
9
9
  <div
10
10
  class="dx-card-base_section-vertical dx-card-base_column card_section-text"
11
11
  >
12
- <span class="dx-text-label-3">{label}</span>
12
+ <span class="dx-text-label-3" part="label">{label}</span>
13
13
  <dx-card-title
14
14
  title={title}
15
15
  target={target}
16
16
  onclick={handleLinkClick}
17
17
  ></dx-card-title>
18
- <span class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
18
+ <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
19
19
  </div>
20
20
  <div class="dx-card-base_section-vertical dx-card-base_ctas">
21
21
  <slot onslotchange={onSlotChange}></slot>
@@ -0,0 +1,5 @@
1
+ @media screen and (max-width: 1024px) {
2
+ dx-card-docs {
3
+ --dx-c-body-max-lines: 3;
4
+ }
5
+ }
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <dx-grid columns={numColumns}>
3
+ <template for:each={cards} for:item="card">
4
+ <dx-card-clickthrough
5
+ key={card.title}
6
+ body={card.body}
7
+ href={card.href}
8
+ img-alt={card.imgAlt}
9
+ img-src={card.imgSrc}
10
+ label={card.label}
11
+ title={card.title}
12
+ target={card.target}
13
+ show-mobile-img={card.showMobileImg}
14
+ >
15
+ </dx-card-clickthrough>
16
+ </template>
17
+ </dx-grid>
18
+ </template>
@@ -0,0 +1,19 @@
1
+ import { api, LightningElement } from "lwc";
2
+ import Grid from "dx/grid";
3
+ import { DocsCard } from "typings/custom";
4
+ import { toJson } from "dxUtils/normalizers";
5
+
6
+ export default class CardGrid extends LightningElement {
7
+ // DocsCard[] with _optional_ href
8
+ private _cards: ({ href?: string } & Omit<DocsCard, "href">)[] = [];
9
+
10
+ @api
11
+ get cards() {
12
+ return this._cards;
13
+ }
14
+ set cards(value: any) {
15
+ this._cards = toJson(value);
16
+ }
17
+
18
+ @api numColumns: Grid["columns"] = "three";
19
+ }
@@ -13,7 +13,7 @@ a {
13
13
  }
14
14
 
15
15
  footer {
16
- padding-top: var(--dx-g-spacing-5xl);
16
+ padding-top: var(--dx-c-footer-padding-top, var(--dx-g-spacing-5xl));
17
17
  }
18
18
 
19
19
  footer.signup-variant-large-signup {
@@ -74,6 +74,10 @@ footer.signup-variant-no-signup {
74
74
  height: 504px;
75
75
  }
76
76
 
77
+ .content-container_top_large_no_signup {
78
+ height: 33vw;
79
+ }
80
+
77
81
  .subscription {
78
82
  position: relative;
79
83
  z-index: 1;
@@ -278,7 +282,7 @@ footer.signup-variant-no-signup {
278
282
  }
279
283
 
280
284
  @media screen and (min-width: 1400px) {
281
- .content-container_top_large {
285
+ .content-container_top_large:not(.content-container_top_large_no_signup) {
282
286
  /* takes into account the background assets' h:w ratio */
283
287
  height: 38vw;
284
288
  }
@@ -301,11 +305,20 @@ footer.signup-variant-no-signup {
301
305
  background-size: 122.92%;
302
306
  }
303
307
 
308
+ .content-container_top_large_no_signup .graphic-large {
309
+ background-size: 101%;
310
+ }
311
+
304
312
  .content-container_top_large {
305
313
  height: 464px;
306
314
  padding-top: var(--dx-g-spacing-2xl);
307
315
  }
308
316
 
317
+ .content-container_top_large_no_signup {
318
+ height: 38vw;
319
+ padding-top: 0;
320
+ }
321
+
309
322
  .subscription h3 {
310
323
  font-size: 24px;
311
324
  line-height: 28px;
@@ -380,6 +393,10 @@ footer.signup-variant-no-signup {
380
393
  padding-bottom: 140px;
381
394
  }
382
395
 
396
+ .content-container_top_large_no_signup {
397
+ height: 44vw;
398
+ }
399
+
383
400
  .graphic-mountains {
384
401
  display: none;
385
402
  }
@@ -34,6 +34,13 @@
34
34
  </dx-button>
35
35
  </div>
36
36
  </div>
37
+ <div
38
+ if:true={showLargeNoSignup}
39
+ class={largeNoSignupClassName}
40
+ >
41
+ <div class="graphic graphic-large" alt=""></div>
42
+ <slot name="custom-content" onslotchange={onSlotChange}></slot>
43
+ </div>
37
44
  <div
38
45
  if:true={showContainerMiddle}
39
46
  class="content-container content-container_middle"
@@ -1,6 +1,10 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
- import { FooterVariant, OptionWithLink } from "typings/custom";
3
+ import {
4
+ FooterVariant,
5
+ LightningSlotElement,
6
+ OptionWithLink
7
+ } from "typings/custom";
4
8
  import { toJson } from "dxUtils/normalizers";
5
9
  import {
6
10
  defaultGeneralLinks,
@@ -9,6 +13,7 @@ import {
9
13
  intellectualHref
10
14
  } from "./links";
11
15
  import { track } from "dxUtils/analytics";
16
+ import { isSlotEmpty } from "dxUtils/slot";
12
17
 
13
18
  export default class Footer extends LightningElement {
14
19
  @api locale: string | null = null;
@@ -34,6 +39,7 @@ export default class Footer extends LightningElement {
34
39
  private _locales: OptionWithLink[] | null = null;
35
40
  private _variant: FooterVariant = "small-signup";
36
41
  private intellectualHref = intellectualHref;
42
+ private isSlotEmpty = true;
37
43
  private socialLinks = socialLinks;
38
44
  private termsLinks = termsLinks;
39
45
  private signupUrl = "https://www.salesforce.com/form/other/role-based-newsletter/?Developer=true";
@@ -64,6 +70,10 @@ export default class Footer extends LightningElement {
64
70
  return this.variant === "small-signup";
65
71
  }
66
72
 
73
+ get showLargeNoSignup() {
74
+ return this.variant === "large-no-signup";
75
+ }
76
+
67
77
  get hasLocales() {
68
78
  return this.locale && this.locales;
69
79
  }
@@ -94,17 +104,31 @@ export default class Footer extends LightningElement {
94
104
  return cx(`signup-variant-${this.variant}`);
95
105
  }
96
106
 
107
+ get largeNoSignupClassName() {
108
+ return cx(
109
+ "content-container",
110
+ "content-container_top_large",
111
+ "content-container_top_large_no_signup",
112
+ !this.isSlotEmpty && "custom-content"
113
+ );
114
+ }
115
+
97
116
  private onLocaleChange(e: CustomEvent) {
98
117
  this.dispatchEvent(
99
118
  new CustomEvent("localechange", { detail: e.detail })
100
119
  );
101
120
  }
102
121
 
122
+ private onSlotChange(e: LightningSlotElement): void {
123
+ this.isSlotEmpty = isSlotEmpty(e);
124
+ }
125
+
103
126
  private isFooterVariant(value: string): value is FooterVariant {
104
127
  return [
105
128
  "no-signup",
106
129
  "small-signup",
107
130
  "large-signup",
131
+ "large-no-signup",
108
132
  "terms-only"
109
133
  ].includes(value);
110
134
  }
@@ -0,0 +1,157 @@
1
+ /*
2
+ The String.raw tagged template literal is basically a no-op and won't do any changes to the template string,
3
+ but if you assign it to a variable with the name html or css,
4
+ tools like Prettier and VS Code will interpret the string as HTML or CSS respectively
5
+ */
6
+ const html = String.raw;
7
+
8
+ export default html`
9
+ <div class="coveo-show-if-no-results">
10
+ <div class="no-results">
11
+ <img
12
+ src="https://a.sfdcstatic.com/developer-website/images/binary-cloud-circle-small.svg"
13
+ alt="purple cloud with floating binary numbers above"
14
+ />
15
+ <div class="no-results-info">
16
+ <span
17
+ class="CoveoQuerySummary dx-text-display-8"
18
+ data-enable-no-results-found-message="true"
19
+ data-no-results-found-message="Sorry, no results were found for your search &ldquo;\${query}&rdquo;"
20
+ ></span>
21
+ <p class="dx-text-display-8 tip">Search Tips:</p>
22
+ <ul class="tip-list">
23
+ <li>Please consider misspellings</li>
24
+ <li>Try different search keywords</li>
25
+ </ul>
26
+ <p class="dx-text-display-8 tip tbc-container">
27
+ Still not finding what you're looking for? Consider asking
28
+ in the&nbsp;
29
+ <a
30
+ class="link"
31
+ href="https://trailhead.salesforce.com/trailblazer-community/feed"
32
+ >
33
+ Trailblazer Community
34
+ </a>
35
+ !
36
+ </p>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ <div class="coveo-show-if-results">
41
+ <script
42
+ id="myDocumentResultTemplate"
43
+ class="result-template"
44
+ type="text/underscore"
45
+ data-field-publicurl=""
46
+ >
47
+ <div class="dx-result">
48
+ <div class="dx-result-info">
49
+ <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
50
+ <% if (!raw.breadcrumbs && !raw.metabreadcrumbs) { %>
51
+ <% if (raw.content_type === "community posts" && raw.sfid) { %>
52
+ <span class="CoveoFieldValue" data-field="@sfid" data-helper="communityBreadcrumbs" data-html-value="true"></span>
53
+ <% } else { %>
54
+ <span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
55
+ <% } %>
56
+ <% } else { %>
57
+ <% if (raw.uri.includes('/references/')) { %>
58
+ <span class="CoveoFieldValue" data-field="@metabreadcrumbs" data-helper="metabreadcrumbs" data-html-value="true"></span>
59
+ <% } else { %>
60
+ <span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
61
+ <% } %>
62
+ <% } %>
63
+ </div>
64
+ <% if (raw.content_type === "community posts") { %>
65
+ <a
66
+ class="dx-result-title CoveoResultLink"
67
+ data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
68
+ target="_blank"
69
+ >
70
+ <% } else { %>
71
+ <a
72
+ href="<%= raw.uri %>"
73
+ class="dx-result-title CoveoResultLink"
74
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
75
+ target="_blank"
76
+ <% } %>
77
+ >
78
+ <% } %>
79
+ <%= title %>
80
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
81
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
82
+ <% } %>
83
+ </a>
84
+ <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
85
+ <p class="dx-result-excerpt CoveoExcerpt"></p>
86
+ <% if (raw.sfcommentcount || raw.sflikecount) { %>
87
+ <div class="post-info-container">
88
+ <span class="CoveoFieldValue" data-field="@sfcommentcount" data-helper="replies" data-html-value="true"></span>
89
+ <% if (raw.sfcommentcount && raw.sflikecount) { %>
90
+ <span>&bull;</span>
91
+ <% } %>
92
+ <span class="CoveoFieldValue" data-field="@sflikecount" data-helper="likes" data-html-value="true"></span>
93
+ </div>
94
+ <% } %>
95
+ </div>
96
+ </script>
97
+ <script
98
+ id="myDefaultResultTemplate"
99
+ class="result-template"
100
+ type="text/underscore"
101
+ >
102
+ <div class="dx-result">
103
+ <div class="dx-result-info">
104
+ <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
105
+ <% if (!raw.breadcrumbs && !raw.metabreadcrumbs) { %>
106
+ <% if (raw.content_type === "community posts" && raw.sfid) { %>
107
+ <span class="CoveoFieldValue" data-field="@sfid" data-helper="communityBreadcrumbs" data-html-value="true"></span>
108
+ <% } else { %>
109
+ <span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
110
+ <% } %>
111
+ <% } else { %>
112
+ <% if (raw.uri.includes('/references/')) { %>
113
+ <span class="CoveoFieldValue" data-field="@metabreadcrumbs" data-helper="metabreadcrumbs" data-html-value="true"></span>
114
+ <% } else { %>
115
+ <span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
116
+ <% } %>
117
+ <% } %>
118
+ </div>
119
+ <% if (raw.content_type === "community posts") { %>
120
+ <a
121
+ class="dx-result-title CoveoResultLink"
122
+ data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
123
+ target="_blank"
124
+ >
125
+ <% } else { %>
126
+ <a
127
+ href="<%= raw.uri %>"
128
+ class="dx-result-title CoveoResultLink"
129
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
130
+ target="_blank"
131
+ <% } %>
132
+ >
133
+ <% } %>
134
+ <% if (title) { %>
135
+ <%= title %>
136
+ <% } else { %>
137
+ <%= uri %>
138
+ <% } %>
139
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
140
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
141
+ <% } %>
142
+ </a>
143
+ <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
144
+ <p class="dx-result-excerpt CoveoExcerpt"></p>
145
+ <% if (raw.sfcommentcount || raw.sflikecount) { %>
146
+ <div class="post-info-container">
147
+ <span class="CoveoFieldValue" data-field="@sfcommentcount" data-helper="replies" data-html-value="true"></span>
148
+ <% if (raw.sfcommentcount && raw.sflikecount) { %>
149
+ <span>&bull;</span>
150
+ <% } %>
151
+ <span class="CoveoFieldValue" data-field="@sflikecount" data-helper="likes" data-html-value="true"></span>
152
+ </div>
153
+ <% } %>
154
+ </div>
155
+ </script>
156
+ </div>
157
+ `;
@@ -8,6 +8,7 @@ import {
8
8
  } from "dxConstants/contentTypes";
9
9
  import { getContentTypeColorVariables } from "dxUtils/contentTypes";
10
10
  import { pollUntil } from "dxUtils/async";
11
+ import resultsTemplate from "./resultsTemplate";
11
12
 
12
13
  // Max height for breadcrumb without wrapping
13
14
  const MAX_BREADCRUMB_HEIGHT = 16;
@@ -41,146 +42,6 @@ function getPaginationState(event: CoveoSDK.IQuerySuccessEventArgs): {
41
42
  return { numberOfPages, currentPage };
42
43
  }
43
44
 
44
- const resultsTemplatesInnerHtml = `
45
- <div class="coveo-show-if-no-results">
46
- <div class="no-results">
47
- <img
48
- src="https://a.sfdcstatic.com/developer-website/images/binary-cloud-circle-small.svg"
49
- alt="purple cloud with floating binary numbers above"
50
- />
51
- <div class="no-results-info">
52
- <span class="CoveoQuerySummary dx-text-display-8"
53
- data-enable-no-results-found-message="true"
54
- data-no-results-found-message="Sorry, no results were found for your search &ldquo;\${query}&rdquo;">
55
- </span>
56
- <p class="dx-text-display-8 tip">Search Tips:</p>
57
- <ul class="tip-list">
58
- <li>Please consider misspellings</li>
59
- <li>Try different search keywords</li>
60
- </ul>
61
- <p class="dx-text-display-8 tip tbc-container">
62
- Still not finding what you're looking for? Consider
63
- asking in the&nbsp;
64
- <a
65
- class="link"
66
- href="https://trailhead.salesforce.com/trailblazer-community/feed"
67
- >
68
- Trailblazer Community
69
- </a>
70
- !
71
- </p>
72
- </div>
73
- </div>
74
- </div>
75
- <div class="coveo-show-if-results">
76
- <script
77
- id="myDocumentResultTemplate"
78
- class="result-template"
79
- type="text/underscore"
80
- data-field-publicurl=""
81
- >
82
- <div class="dx-result">
83
- <div class="dx-result-info">
84
- <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
85
- <% if (!raw.breadcrumbs && !raw.metabreadcrumbs) { %>
86
- <span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
87
- <% } else { %>
88
- <% if (raw.uri.includes('/references/')) { %>
89
- <span class="CoveoFieldValue" data-field="@metabreadcrumbs" data-helper="metabreadcrumbs" data-html-value="true"></span>
90
- <% } else { %>
91
- <span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
92
- <% } %>
93
- <% } %>
94
- </div>
95
- <% if (raw.content_type === "community posts") { %>
96
- <a
97
- class="dx-result-title CoveoResultLink"
98
- data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
99
- >
100
- <% } else { %>
101
- <a
102
- href="<%= raw.uri %>"
103
- class="dx-result-title CoveoResultLink"
104
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
105
- target="_blank"
106
- <% } %>
107
- >
108
- <% } %>
109
- <%= title %>
110
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
111
- <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
112
- <% } %>
113
- </a>
114
- <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
115
- <p class="dx-result-excerpt CoveoExcerpt"></p>
116
- <% if (raw.sfcommentcount || raw.sflikecount) { %>
117
- <div class="post-info-container">
118
- <span class="CoveoFieldValue" data-field="@sfcommentcount" data-helper="replies" data-html-value="true"></span>
119
- <% if (raw.sfcommentcount && raw.sflikecount) { %>
120
- <span>&bull;</span>
121
- <% } %>
122
- <span class="CoveoFieldValue" data-field="@sflikecount" data-helper="likes" data-html-value="true"></span>
123
- </div>
124
- <% } %>
125
- </div>
126
- </script>
127
- <script
128
- id="myDefaultResultTemplate"
129
- class="result-template"
130
- type="text/underscore"
131
- >
132
- <div class="dx-result">
133
- <div class="dx-result-info">
134
- <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
135
- <% if (!raw.breadcrumbs && !raw.metabreadcrumbs) { %>
136
- <span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
137
- <% } else { %>
138
- <% if (raw.uri.includes('/references/')) { %>
139
- <span class="CoveoFieldValue" data-field="@metabreadcrumbs" data-helper="metabreadcrumbs" data-html-value="true"></span>
140
- <% } else { %>
141
- <span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
142
- <% } %>
143
- <% } %>
144
- </div>
145
- <% if (raw.content_type === "community posts") { %>
146
- <a
147
- class="dx-result-title CoveoResultLink"
148
- data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
149
- >
150
- <% } else { %>
151
- <a
152
- href="<%= raw.uri %>"
153
- class="dx-result-title CoveoResultLink"
154
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
155
- target="_blank"
156
- <% } %>
157
- >
158
- <% } %>
159
- <% if (title) { %>
160
- <%= title %>
161
- <% } else { %>
162
- <%= uri %>
163
- <% } %>
164
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
165
- <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
166
- <% } %>
167
- </a>
168
- <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
169
- <p class="dx-result-excerpt CoveoExcerpt"></p>
170
- <% if (raw.sfcommentcount || raw.sflikecount) { %>
171
- <div class="post-info-container">
172
- <span class="CoveoFieldValue" data-field="@sfcommentcount" data-helper="replies" data-html-value="true"></span>
173
- <% if (raw.sfcommentcount && raw.sflikecount) { %>
174
- <span>&bull;</span>
175
- <% } %>
176
- <span class="CoveoFieldValue" data-field="@sflikecount" data-helper="likes" data-html-value="true"></span>
177
- </div>
178
- <% } %>
179
- </div>
180
- </script>
181
- </div>
182
- `;
183
-
184
45
  const isInternalDomain = (domain: string) =>
185
46
  domain === "developer.salesforce.com" ||
186
47
  domain === "developer-website-s.herokuapp.com";
@@ -284,6 +145,10 @@ const buildTemplateHelperUriBreadcrumbs = (value: string) => {
284
145
  return `<span class="breadcrumb">/ ${breadcrumbs.join(" / ")} /</span>`;
285
146
  };
286
147
 
148
+ const buildTemplateHelperCommunityBreadcrumbs = () => {
149
+ return `<span class="breadcrumb"><span class="breadcrumb-item">trailhead.salesforce.com</span> / <span class="breadcrumb-item">trailblazer-community</span> / <span class="breadcrumb-item">feed</span> / </span>`;
150
+ };
151
+
287
152
  const buildTemplateHelperBreadcrumbs = (value: string) => {
288
153
  const parts = value.split("/").filter((part) => part !== "");
289
154
 
@@ -577,7 +442,7 @@ export default class SearchResults extends LightningElement {
577
442
 
578
443
  if (resultsList) {
579
444
  // eslint-disable-next-line @lwc/lwc/no-inner-html
580
- resultsList.innerHTML = resultsTemplatesInnerHtml;
445
+ resultsList.innerHTML = resultsTemplate;
581
446
  }
582
447
 
583
448
  Coveo.SearchEndpoint.configureCloudV2Endpoint(
@@ -607,6 +472,11 @@ export default class SearchResults extends LightningElement {
607
472
  buildTemplateHelperUriBreadcrumbs
608
473
  );
609
474
 
475
+ Coveo.TemplateHelpers.registerTemplateHelper(
476
+ "communityBreadcrumbs",
477
+ buildTemplateHelperCommunityBreadcrumbs
478
+ );
479
+
610
480
  Coveo.TemplateHelpers.registerTemplateHelper(
611
481
  "postedDate",
612
482
  buildTemplateHelperPostedDate
@@ -1,6 +1,7 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import { LightningSlotElement } from "typings/custom";
3
3
  import debounce from "debounce";
4
+ import { isSlotEmpty } from "dxUtils/slot";
4
5
  const MOBILE_SIZE = 640;
5
6
  const getInputSize = () =>
6
7
  (window.innerWidth ||
@@ -30,8 +31,7 @@ export default class SectionSignup extends LightningElement {
30
31
  }
31
32
 
32
33
  private onSlotChange(e: LightningSlotElement) {
33
- // @ts-ignore
34
- this.isSlotEmpty = e.target.assignedElements().length === 0;
34
+ this.isSlotEmpty = isSlotEmpty(e);
35
35
  }
36
36
 
37
37
  private _updateSize = () => {