@salesforcedevs/dw-components 0.54.0 → 0.54.7-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 +10 -1
- package/package.json +9 -4
- package/src/modules/dw/blogsGrid/blogsGrid.css +80 -0
- package/src/modules/dw/blogsGrid/blogsGrid.html +57 -0
- package/src/modules/dw/blogsGrid/blogsGrid.ts +28 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.ts +2 -2
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +2 -2
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.css +171 -0
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.html +133 -0
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.ts +429 -0
- package/src/modules/dw/contentArchive/contentArchive.css +1 -1
- package/src/modules/dw/contentArchive/contentArchive.ts +2 -2
- package/src/modules/dw/deSignupForm/deSignupForm.css +70 -0
- package/src/modules/dw/deSignupForm/deSignupForm.html +99 -0
- package/src/modules/dw/deSignupForm/deSignupForm.ts +268 -0
- package/src/modules/dw/deSignupForm/submitForm.ts +90 -0
- package/src/modules/dw/docsGrid/docsGrid.css +86 -0
- package/src/modules/dw/docsGrid/docsGrid.html +84 -0
- package/src/modules/dw/docsGrid/docsGrid.ts +539 -0
- package/src/modules/dw/eventsList/eventsList.css +109 -0
- package/src/modules/dw/eventsList/eventsList.html +91 -0
- package/src/modules/dw/eventsList/eventsList.ts +180 -0
- package/src/modules/dw/instrumentation/instrumentation.ts +1 -1
- package/src/modules/dw/newsletterForm/newsletterForm.css +2 -2
- package/src/modules/dw/newsletterForm/newsletterForm.html +1 -1
- package/src/modules/dw/newsletterForm/newsletterForm.ts +3 -3
- package/src/modules/dw/podcastSubscription/podcastSubscription.css +2 -2
- package/src/modules/dw/podcastsGrid/podcastsGrid.css +5 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.html +29 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.ts +9 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.css +32 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.html +30 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.ts +3 -0
- package/src/modules/dw/rcgTable/altData.ts +78 -0
- package/src/modules/dw/rcgTable/getTableData.ts +10 -0
- package/src/modules/dw/rcgTable/rcgTable.css +39 -0
- package/src/modules/dw/rcgTable/rcgTable.html +31 -0
- package/src/modules/dw/rcgTable/rcgTable.ts +34 -0
- package/src/modules/dw/searchResults/searchResults.css +1 -1
- package/src/modules/dw/slackCta/slackCta.css +2 -2
- package/src/modules/dw/slackSuccess/slackSuccess.css +65 -0
- package/src/modules/dw/slackSuccess/slackSuccess.html +32 -0
- package/src/modules/dw/slackSuccess/slackSuccess.ts +32 -0
- package/src/modules/dwBaseElements/postsGrid/postsGrid.ts +76 -0
- package/src/modules/dwHelpers/postsGrid/postsGrid.css +9 -0
- package/LICENSE +0 -12
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import "dxHelpers/text";
|
|
2
|
+
|
|
3
|
+
.slack-success_main {
|
|
4
|
+
background-color: var(--dx-g-indigo-vibrant-30);
|
|
5
|
+
|
|
6
|
+
/* Give this thing a circular bottom that actually goes off the page, to make a rounded look */
|
|
7
|
+
border-radius: 0 0 100% 100%;
|
|
8
|
+
left: -30%;
|
|
9
|
+
margin-bottom: 100px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
position: relative;
|
|
12
|
+
width: 160%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.slack-success_container {
|
|
16
|
+
align-items: center;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
color: #fff;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
font-family: var(--dx-g-font-display);
|
|
22
|
+
justify-content: center;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
max-width: 100vw;
|
|
25
|
+
padding: 60px var(--dx-g-spacing-xl);
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.slack-success_success-message.dx-text-heading-4 {
|
|
30
|
+
color: #fff;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.slack-success_command {
|
|
34
|
+
background-color: var(--dx-g-indigo-vibrant-20);
|
|
35
|
+
border-radius: 3px;
|
|
36
|
+
display: inline-block;
|
|
37
|
+
font-family: var(--dx-g-font-mono);
|
|
38
|
+
font-size: var(--dx-g-text-sm);
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
padding: 5px 10px;
|
|
41
|
+
margin: 0 5px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.slack-success_screenshot {
|
|
45
|
+
max-height: 156px;
|
|
46
|
+
padding-top: var(--dx-g-spacing-xl);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.slack-success_open-button {
|
|
50
|
+
padding-top: var(--dx-g-spacing-xl);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.slack-success_cody {
|
|
54
|
+
padding-top: var(--dx-g-spacing-4xl);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (max-width: 768px) {
|
|
58
|
+
.slack-success_main {
|
|
59
|
+
margin-bottom: 60px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.slack-success_cody {
|
|
63
|
+
max-width: 260px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="slack-success_main">
|
|
3
|
+
<div class="slack-success_container">
|
|
4
|
+
<p class="dx-text-heading-4 slack-success_success-message">
|
|
5
|
+
Success! 🎉 You've installed the Salesforce Developers app in
|
|
6
|
+
your Slack workspace.
|
|
7
|
+
</p>
|
|
8
|
+
<p class="slack-success__instruction">
|
|
9
|
+
Type
|
|
10
|
+
<span class="slack-success_command">/recent</span>
|
|
11
|
+
in Slack and select the content you'd like to like to view.
|
|
12
|
+
</p>
|
|
13
|
+
<img
|
|
14
|
+
class="slack-success_screenshot"
|
|
15
|
+
src="/assets/images/slack-recent-shortcuts.png"
|
|
16
|
+
alt="Slack screenshot showing Recent Blog Posts and Recent Podcasts shortcuts"
|
|
17
|
+
/>
|
|
18
|
+
<dx-button
|
|
19
|
+
class="slack-success_open-button"
|
|
20
|
+
href={buttonUri}
|
|
21
|
+
size="small"
|
|
22
|
+
>
|
|
23
|
+
Open Slack
|
|
24
|
+
</dx-button>
|
|
25
|
+
<img
|
|
26
|
+
class="slack-success_cody"
|
|
27
|
+
src="/assets/images/cody-cloud-slack.svg"
|
|
28
|
+
alt="Cody the Bear on a laptop below a Slack icon"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LightningElement } from "lwc";
|
|
2
|
+
|
|
3
|
+
export default class SlackSuccess extends LightningElement {
|
|
4
|
+
private buttonUri = "slack://open";
|
|
5
|
+
|
|
6
|
+
async connectedCallback(): Promise<void> {
|
|
7
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
8
|
+
const code = searchParams.get("code");
|
|
9
|
+
|
|
10
|
+
if (!code) {
|
|
11
|
+
// TODO: failure view, design pending
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const slackApiBaseUrl =
|
|
15
|
+
process.env.DSC_SLACK_API_DOMAIN ||
|
|
16
|
+
process.env.BASE_URL ||
|
|
17
|
+
"https://developer.salesforce.com";
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const response = await fetch(`${slackApiBaseUrl}/slack/api/oauth?code=${code}`);
|
|
21
|
+
const { url } = await response.json();
|
|
22
|
+
|
|
23
|
+
if (url) {
|
|
24
|
+
this.buttonUri = url;
|
|
25
|
+
}
|
|
26
|
+
} catch (ex) {
|
|
27
|
+
// No need to do anything other than log here; the default buttonUri should still be in
|
|
28
|
+
// place/sufficient
|
|
29
|
+
console.error(ex);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { api, LightningElement } from "lwc";
|
|
2
|
+
import { toJson } from "dxUtils/normalizers";
|
|
3
|
+
import { track } from "dxUtils/analytics";
|
|
4
|
+
import { WordpressPost, NormalizedPost } from "typings/custom";
|
|
5
|
+
|
|
6
|
+
const ANALYTICS_INFO = {
|
|
7
|
+
elementType: "link",
|
|
8
|
+
destinationType: "internal",
|
|
9
|
+
ctaClick: true
|
|
10
|
+
};
|
|
11
|
+
export abstract class PostsGrid extends LightningElement {
|
|
12
|
+
@api columns = "three";
|
|
13
|
+
@api archives = false;
|
|
14
|
+
|
|
15
|
+
_posts: Array<NormalizedPost> = [];
|
|
16
|
+
_count = 6;
|
|
17
|
+
_loadMoreAmount = 6;
|
|
18
|
+
_morePostsViewed = false;
|
|
19
|
+
|
|
20
|
+
@api
|
|
21
|
+
get posts() {
|
|
22
|
+
return this._posts;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set posts(value) {
|
|
26
|
+
this._posts = (toJson(value) as Array<WordpressPost>).map(
|
|
27
|
+
this.normalizePost
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@api
|
|
32
|
+
get count() {
|
|
33
|
+
return this._count;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
set count(value) {
|
|
37
|
+
this._count = +value || this._count;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get postList(): Array<NormalizedPost> {
|
|
41
|
+
return this._posts.slice(0, this.count);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onClick(e: Event): void {
|
|
45
|
+
if (!this._morePostsViewed) {
|
|
46
|
+
this._count += this._loadMoreAmount;
|
|
47
|
+
this._morePostsViewed = true;
|
|
48
|
+
track(e.target, "custEv_ctaLinkClick", {
|
|
49
|
+
...ANALYTICS_INFO,
|
|
50
|
+
clickText: "show more",
|
|
51
|
+
itemTitle: "show more"
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
track(e.target, "custEv_ctaLinkClick", {
|
|
55
|
+
...ANALYTICS_INFO,
|
|
56
|
+
clickText: "view archives",
|
|
57
|
+
itemTitle: "view archives",
|
|
58
|
+
clickUrl: "https://developer.salesforce.com/content-archive"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get morePostsViewed(): boolean {
|
|
64
|
+
return this._morePostsViewed;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
get showArchives(): boolean {
|
|
68
|
+
return this._morePostsViewed && this.archives;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get hasMorePosts(): boolean {
|
|
72
|
+
return this.count < this._posts.length && !this._morePostsViewed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
abstract normalizePost(post: WordpressPost): NormalizedPost;
|
|
76
|
+
}
|
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.
|