@salesforcedevs/dx-components 1.3.221 → 1.3.222-alpha
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 +1 -0
- package/package.json +2 -3
- package/src/assets/icons/salesforcebrand-sprite/svg/symbols.svg +0 -14
- package/src/modules/dx/coveoRecommendations/coveoRecommendations.css +4 -0
- package/src/modules/dx/coveoRecommendations/coveoRecommendations.html +20 -0
- package/src/modules/dx/coveoRecommendations/coveoRecommendations.ts +49 -0
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +0 -1
- package/src/modules/dxConstants/brands/brands.ts +0 -1
- package/LICENSE +0 -12
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.222-alpha",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -43,6 +43,5 @@
|
|
|
43
43
|
},
|
|
44
44
|
"volta": {
|
|
45
45
|
"node": "16.19.1"
|
|
46
|
-
}
|
|
47
|
-
"gitHead": "eca6f0494621686d4b7c408a316e8b230b09b6dc"
|
|
46
|
+
}
|
|
48
47
|
}
|
|
@@ -272,20 +272,6 @@
|
|
|
272
272
|
</g>
|
|
273
273
|
</g>
|
|
274
274
|
</symbol>
|
|
275
|
-
<symbol id="data-cloud" viewBox="0 0 56 56" xmlns="http://www.w3.org/2000/svg" style="fill:#fff">
|
|
276
|
-
<defs>
|
|
277
|
-
<style>.acls-2,.acls-4{stroke-width:0}.acls-2{fill:#8a8ed1}.acls-4{fill:#fff}</style>
|
|
278
|
-
</defs>
|
|
279
|
-
<path class="acls-2" d="M28 4C14.77 4 4 14.77 4 28c0 7.9 3.84 14.93 9.76 19.3.7-4.58 3.55-8.46 7.5-10.56-2.61-2.02-4.29-5.17-4.29-8.71C16.97 21.95 21.92 17 28 17s11.03 4.95 11.03 11.03c0 3.54-1.69 6.69-4.29 8.71 3.95 2.1 6.8 5.98 7.5 10.56 5.92-4.37 9.77-11.4 9.77-19.31 0-13.23-10.77-24-24-24Z"/>
|
|
280
|
-
<path class="acls-2" d="M11.07 18.3c.69-1.2 2.21-1.61 3.41-.92a2.5 2.5 0 0 1 .93 3.41c-.46.81-1.3 1.26-2.17 1.26-.42 0-.85-.11-1.24-.34a2.489 2.489 0 0 1-.92-3.41ZM8.49 28.06c0-1.38 1.11-2.5 2.49-2.51 1.38 0 2.51 1.11 2.51 2.5s-1.11 2.5-2.49 2.5h-.01c-1.38 0-2.5-1.11-2.5-2.49ZM14.55 38.71a2.504 2.504 0 0 1-3.42-.9c-.7-1.2-.29-2.73.9-3.42 1.19-.7 2.73-.29 3.42.9a2.51 2.51 0 0 1-.9 3.42ZM20.7 15.46c-.4.23-.83.34-1.26.34-.86 0-1.7-.44-2.16-1.24-.7-1.19-.3-2.73.9-3.42 1.19-.7 2.72-.29 3.42.9a2.51 2.51 0 0 1-.9 3.42ZM28 13.49h-.07c-1.38 0-2.5-1.11-2.5-2.49 0-1.38 1.11-2.5 2.49-2.51h.11c1.37.02 2.47 1.13 2.47 2.5s-1.12 2.5-2.5 2.5ZM38.67 14.52a2.51 2.51 0 0 1-2.17 1.24c-.43 0-.86-.1-1.25-.33a2.5 2.5 0 0 1 2.5-4.33c1.2.69 1.6 2.22.92 3.42ZM41.48 17.32a2.5 2.5 0 0 1 2.5 4.33c-.39.23-.82.33-1.25.33-.86 0-1.7-.44-2.17-1.24-.69-1.2-.28-2.73.92-3.42ZM44.91 37.73c-.46.81-1.3 1.26-2.17 1.26-.42 0-.85-.11-1.24-.34a2.493 2.493 0 0 1-.92-3.41c.69-1.2 2.22-1.61 3.42-.92a2.5 2.5 0 0 1 .91 3.41ZM45.01 30.48c-1.38 0-2.5-1.12-2.5-2.49s1.12-2.51 2.5-2.51a2.5 2.5 0 0 1 0 5Z"/>
|
|
281
|
-
<circle class="acls-4" cx="27.99" cy="28.03" r="7.03"/>
|
|
282
|
-
<path class="acls-4" d="M27.99 39.06c-5.75 0-10.42 4.67-10.42 10.42v.13C20.72 51.14 24.26 52 28 52s7.26-.86 10.41-2.38v-.14c0-5.75-4.67-10.42-10.42-10.42Z"/>
|
|
283
|
-
<circle cx="28" cy="28" r="28" style="stroke-width:0;fill:#200647"/>
|
|
284
|
-
<path class="acls-4" d="M38.41 49.62C35.26 51.14 31.73 52 28 52s-7.27-.86-10.43-2.39v-.13c0-5.75 4.67-10.42 10.42-10.42s10.42 4.67 10.42 10.42v.14Z"/>
|
|
285
|
-
<circle class="acls-4" cx="27.99" cy="28.03" r="7.03"/>
|
|
286
|
-
<path d="M42.23 47.31c-.7-4.58-3.55-8.47-7.5-10.56 2.61-2.02 4.29-5.17 4.29-8.71 0-6.08-4.95-11.03-11.03-11.03s-11.03 4.95-11.03 11.03c0 3.54 1.69 6.69 4.29 8.71-3.95 2.1-6.8 5.98-7.5 10.56-5.91-4.38-9.76-11.4-9.76-19.3C4 14.77 14.77 4 28 4s24 10.77 24 24c0 7.91-3.85 14.94-9.77 19.31Z" style="fill:#7f8ced;stroke-width:0"/>
|
|
287
|
-
<path class="acls-4" d="M37.75 11.1a2.5 2.5 0 0 0-2.5 4.33c.39.23.82.33 1.25.33.86 0 1.7-.44 2.17-1.24.68-1.2.28-2.73-.92-3.42ZM11 30.55c1.38 0 2.49-1.12 2.49-2.5s-1.13-2.5-2.51-2.5a2.5 2.5 0 0 0-2.49 2.51c0 1.38 1.12 2.49 2.5 2.49H11ZM42.73 21.98c.43 0 .86-.1 1.25-.33a2.5 2.5 0 0 0-2.5-4.33c-1.2.69-1.61 2.22-.92 3.42.47.8 1.31 1.24 2.17 1.24ZM11.99 21.71c.39.23.82.34 1.24.34a2.5 2.5 0 0 0 1.24-4.67c-1.2-.69-2.72-.28-3.41.92s-.28 2.73.92 3.41ZM44 34.32c-1.2-.69-2.73-.28-3.42.92-.69 1.19-.28 2.72.92 3.41.39.23.82.34 1.24.34.87 0 1.71-.45 2.17-1.26a2.5 2.5 0 0 0-.91-3.41ZM45.01 25.48c-1.38 0-2.5 1.12-2.5 2.51s1.12 2.49 2.5 2.49a2.5 2.5 0 0 0 0-5ZM28.03 8.49h-.11A2.5 2.5 0 0 0 25.43 11c0 1.38 1.12 2.49 2.5 2.49H28a2.5 2.5 0 0 0 .03-5ZM18.18 11.14a2.49 2.49 0 0 0-.9 3.42c.46.8 1.3 1.24 2.16 1.24.43 0 .86-.11 1.26-.34a2.51 2.51 0 0 0 .9-3.42c-.7-1.19-2.23-1.6-3.42-.9ZM12.03 34.39c-1.19.69-1.6 2.22-.9 3.42a2.504 2.504 0 0 0 3.42.9 2.51 2.51 0 0 0 .9-3.42 2.499 2.499 0 0 0-3.42-.9Z"/>
|
|
288
|
-
</symbol>
|
|
289
275
|
<symbol viewBox="0 0 56 56" version="1.1" xmlns="http://www.w3.org/2000/svg" id="integration">
|
|
290
276
|
<g id="Atoms" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
291
277
|
<g id="ICONS-symbols" transform="translate(-1005.000000, 0.000000)" fill-rule="nonzero">
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dx-section class="section-reduced-padding">
|
|
3
|
+
<dx-spinner>
|
|
4
|
+
<div class="spinner-container">
|
|
5
|
+
<dx-spinner size="large" variant="brand"></dx-spinner>
|
|
6
|
+
</div>
|
|
7
|
+
</dx-spinner>
|
|
8
|
+
<template for:each={recommendations} for:item="recommendation">
|
|
9
|
+
<dx-card-blog-post
|
|
10
|
+
authors={recommendation.yoast_head_json.author}
|
|
11
|
+
body={recommendation.yoast_head_json.description}
|
|
12
|
+
datetime={recommendation.yoast_head_json.article_published_time}
|
|
13
|
+
href={recommendation.yoast_head_json.canonical}
|
|
14
|
+
img-alt={recommendation.yoast_head_json.title}
|
|
15
|
+
img-src={recommendation.content.featured_image}
|
|
16
|
+
title={recommendation.yoast_head_json.title}
|
|
17
|
+
></dx-card-blog-post>
|
|
18
|
+
</template>
|
|
19
|
+
</dx-section>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { track } from "dxUtils/analytics";
|
|
2
|
+
import { LightningElement, api } from "lwc";
|
|
3
|
+
|
|
4
|
+
export default class CoveoRecommendations extends LightningElement {
|
|
5
|
+
@api coveoAuthToken!: string;
|
|
6
|
+
|
|
7
|
+
recommendations = [];
|
|
8
|
+
|
|
9
|
+
renderedCallback() {
|
|
10
|
+
// const actionsHistory = localStorage.getItem(
|
|
11
|
+
// "__coveo.analytics.history"
|
|
12
|
+
// );
|
|
13
|
+
const url = "https://platform.cloud.coveo.com/rest/search/v2";
|
|
14
|
+
fetch(url, {
|
|
15
|
+
headers: { Authorization: `Bearer ${this.coveoAuthToken}` },
|
|
16
|
+
body: JSON.stringify({
|
|
17
|
+
pipeline: "Recommendations_Developer_Blogs",
|
|
18
|
+
searchHub: "developerWebsiteBlogs",
|
|
19
|
+
numberOfResults: 3,
|
|
20
|
+
actionsHistory: [
|
|
21
|
+
{
|
|
22
|
+
name: "PageView",
|
|
23
|
+
value: "https://developer.salesforce.com/blogs/2024/02/the-developers-guide-to-trailblazerdx-2024",
|
|
24
|
+
time: "2024-02-20T19:47:51.910Z",
|
|
25
|
+
internalTime: 1708458471910
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
}).then(async (response) => {
|
|
30
|
+
const recommendations = (await response.json()).results;
|
|
31
|
+
console.log(recommendations);
|
|
32
|
+
this.recommendations = recommendations;
|
|
33
|
+
const blogPosts = recommendations.slice(0, 3).map(async (rec) => {
|
|
34
|
+
const slug = rec.uri.split("/").pop();
|
|
35
|
+
const blogDataUrl = `${window.location.origin}/blogs/wp-json/wp/v2/posts?slug=${slug}&state=publish&_embed=wp:featuredmedia`;
|
|
36
|
+
const blogData = (await (await fetch(blogDataUrl)).json())[0];
|
|
37
|
+
console.log(blogData);
|
|
38
|
+
return blogData;
|
|
39
|
+
});
|
|
40
|
+
this.recommendations = blogPosts;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private trackClick(e: Event) {
|
|
45
|
+
const payload = {};
|
|
46
|
+
|
|
47
|
+
track(e.currentTarget!, "custEv_blogAudioPlay", payload);
|
|
48
|
+
}
|
|
49
|
+
}
|
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.
|