@salesforcedevs/dx-components 0.53.8 → 0.53.11-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.
Files changed (47) hide show
  1. package/lwc.config.json +15 -17
  2. package/package.json +3 -6
  3. package/src/modules/base-elements/headerBase/headerBase.ts +1 -1
  4. package/src/modules/dx/cardCallout/cardCallout.ts +4 -4
  5. package/src/modules/dx/cardNews/cardNews.ts +1 -1
  6. package/src/modules/dx/codeBlock/codeBlock.ts +1 -1
  7. package/src/modules/dx/dropdownOption/dropdownOption.ts +1 -1
  8. package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +36 -25
  9. package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +0 -12
  10. package/src/modules/dx/footer/footer.ts +1 -1
  11. package/src/modules/dx/footerOption/footerOption.ts +1 -1
  12. package/src/modules/dx/groupText/groupText.ts +1 -1
  13. package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +1 -1
  14. package/src/modules/dx/pagination/pagination.ts +1 -1
  15. package/src/modules/dx/sidebar/sidebar.ts +1 -1
  16. package/src/modules/dx/sidebarOld/sidebarOld.ts +1 -1
  17. package/src/modules/dx/tab/tab.ts +1 -1
  18. package/src/modules/dx/treeItem/treeItem.ts +1 -1
  19. package/src/modules/utils/analytics/analytics.ts +24 -0
  20. package/LICENSE +0 -12
  21. package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.css +0 -3
  22. package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.html +0 -16
  23. package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +0 -29
  24. package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +0 -3
  25. package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +0 -12
  26. package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +0 -29
  27. package/src/modules/dx/contentArchive/contentArchive.css +0 -246
  28. package/src/modules/dx/contentArchive/contentArchive.html +0 -337
  29. package/src/modules/dx/contentArchive/contentArchive.ts +0 -461
  30. package/src/modules/dx/contentArchive/contentArchive.types.ts +0 -6
  31. package/src/modules/dx/instrumentation/instrumentation.html +0 -1
  32. package/src/modules/dx/instrumentation/instrumentation.ts +0 -116
  33. package/src/modules/dx/newsletterForm/newsletterForm.css +0 -73
  34. package/src/modules/dx/newsletterForm/newsletterForm.html +0 -73
  35. package/src/modules/dx/newsletterForm/newsletterForm.ts +0 -238
  36. package/src/modules/dx/podcastSubscription/podcastSubscription.css +0 -91
  37. package/src/modules/dx/podcastSubscription/podcastSubscription.html +0 -24
  38. package/src/modules/dx/podcastSubscription/podcastSubscription.ts +0 -52
  39. package/src/modules/dx/searchResults/coveo.css +0 -18989
  40. package/src/modules/dx/searchResults/searchResults.css +0 -387
  41. package/src/modules/dx/searchResults/searchResults.html +0 -104
  42. package/src/modules/dx/searchResults/searchResults.ts +0 -186
  43. package/src/modules/dx/slackCta/slackCta.css +0 -47
  44. package/src/modules/dx/slackCta/slackCta.html +0 -17
  45. package/src/modules/dx/slackCta/slackCta.ts +0 -12
  46. package/src/modules/utils/contentArchive/altData.js +0 -3
  47. package/src/modules/utils/contentArchive/contentArchive.ts +0 -163
package/lwc.config.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "modules": [{ "dir": "src/modules" }],
3
3
  "expose": [
4
+ "base-elements/headerBase",
5
+ "base-elements/matchMediaElement",
6
+ "dx/banner",
4
7
  "dx/brandThemeProvider",
5
8
  "dx/breadcrumbs",
6
9
  "dx/button",
7
10
  "dx/cardBlogPost",
8
- "dx/cardBlogPostProvider",
9
11
  "dx/cardCallout",
10
12
  "dx/cardContent",
11
13
  "dx/cardDemo",
@@ -15,25 +17,21 @@
15
17
  "dx/cardMinimal",
16
18
  "dx/cardNews",
17
19
  "dx/cardPodcastEpisode",
18
- "dx/cardPodcastEpisodeProvider",
19
20
  "dx/cardSmall",
20
21
  "dx/cardTrailheadModule",
21
22
  "dx/cardTrial",
22
23
  "dx/cardVideoPreview",
23
24
  "dx/checkbox",
24
- "dx/checkboxNative",
25
25
  "dx/checkboxGroup",
26
+ "dx/checkboxNative",
26
27
  "dx/codeBlock",
27
- "dx/contentArchive",
28
28
  "dx/dropdown",
29
29
  "dx/emptyState",
30
30
  "dx/feature",
31
31
  "dx/featuredContentHeader",
32
32
  "dx/featuresList",
33
33
  "dx/filterMenu",
34
- "dx/banner",
35
34
  "dx/footer",
36
- "dx/newsletterForm",
37
35
  "dx/formattedDateTime",
38
36
  "dx/grid",
39
37
  "dx/groupText",
@@ -47,17 +45,14 @@
47
45
  "dx/iconBadge",
48
46
  "dx/imageAndLabel",
49
47
  "dx/input",
50
- "dx/instrumentation",
51
48
  "dx/logo",
52
49
  "dx/modalDrawer",
53
50
  "dx/pagination",
54
51
  "dx/podcastHost",
55
52
  "dx/podcastPlayer",
56
- "dx/podcastSubscription",
57
53
  "dx/popover",
58
54
  "dx/radioGroup",
59
55
  "dx/relativeDateTime",
60
- "dx/searchResults",
61
56
  "dx/section",
62
57
  "dx/sectionSignup",
63
58
  "dx/sectionSmall",
@@ -65,28 +60,31 @@
65
60
  "dx/sidebar",
66
61
  "dx/sidebarOld",
67
62
  "dx/skipNavLink",
68
- "dx/slackCta",
69
63
  "dx/socials",
64
+ "dx/spinner",
65
+ "dx/toc",
70
66
  "dx/toc",
71
- "dx/tree",
72
67
  "dx/tooltip",
68
+ "dx/tree",
73
69
  "dx/typeBadge",
74
70
  "dx/typeBadgeGroup",
75
- "dx/toc",
76
71
  "dx/vimeoPlayer",
77
72
  "helpers/animations",
73
+ "helpers/button",
78
74
  "helpers/card",
79
75
  "helpers/code",
80
76
  "helpers/commonHeader",
81
77
  "helpers/reset",
82
78
  "helpers/table",
83
79
  "helpers/text",
84
- "base-elements/headerBase",
85
- "base-elements/matchMediaElement",
80
+ "utils/analytics",
86
81
  "utils/constants",
87
- "utils/normalizers",
82
+ "utils/coveo",
83
+ "utils/dates",
88
84
  "utils/highlight",
89
- "utils/contentArchive",
90
- "utils/dates"
85
+ "utils/normalizers",
86
+ "utils/queryCoordinator",
87
+ "utils/recentSearches",
88
+ "utils/wordpress"
91
89
  ]
92
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.53.8",
3
+ "version": "0.53.11-alpha",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -15,18 +15,15 @@
15
15
  "@sfdocs-internal/wires": "^0.6.3",
16
16
  "@vimeo/player": "^2.16.4",
17
17
  "classnames": "^2.2.6",
18
- "coveo-search-ui": "^2.10082.5",
19
18
  "debounce": "^1.2.0",
20
19
  "lightning-base-components": "1.12.3-alpha",
21
20
  "lodash.get": "^4.4.2",
22
- "microtip": "0.2.2",
23
- "query-string": "^7.1.1"
21
+ "microtip": "0.2.2"
24
22
  },
25
23
  "devDependencies": {
26
24
  "@types/classnames": "^2.2.10",
27
25
  "@types/debounce": "^1.2.0",
28
26
  "@types/lodash.get": "^4.4.6",
29
27
  "@types/vimeo__player": "^2.16.2"
30
- },
31
- "gitHead": "d35b6323942b0428d630c6cb9544a0e169510f5a"
28
+ }
32
29
  }
@@ -2,7 +2,7 @@ import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
3
  import { Brand, Option } from "typings/custom";
4
4
  import { toJson } from "utils/normalizers";
5
- import { track } from "dx/instrumentation";
5
+ import { track } from "utils/analytics";
6
6
 
7
7
  const VALID_BRANDS = [
8
8
  "analytics",
@@ -1,14 +1,14 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
3
  import { toDxColor } from "utils/css";
4
- import { track } from "dx/instrumentation";
4
+ import { track } from "utils/analytics";
5
5
 
6
6
  export default class CardCallout extends LightningElement {
7
- @api backgroundColor?: string = "indigo-vibrant-40";
8
- @api color?: string = "white";
7
+ @api backgroundColor: string = "indigo-vibrant-40";
8
+ @api color: string = "white";
9
9
  @api href!: string;
10
10
  @api label: string = "";
11
- @api target?: string | null = null;
11
+ @api target?: string;
12
12
  @api title!: string;
13
13
 
14
14
  private get style(): string {
@@ -9,7 +9,7 @@ import {
9
9
  CardNewsSize,
10
10
  CardNewsTextContainerSize
11
11
  } from "typings/custom";
12
- import { track } from "dx/instrumentation";
12
+ import { track } from "utils/analytics";
13
13
 
14
14
  export default class CardNews extends LightningElement {
15
15
  @api backgroundColor?: string = "indigo-vibrant-40";
@@ -6,7 +6,7 @@ import {
6
6
  getLocalStorageData,
7
7
  setLocalStorageData
8
8
  } from "@sfdocs-internal/wires";
9
- import { track as gtmTrack } from "dx/instrumentation";
9
+ import { track as gtmTrack } from "utils/analytics";
10
10
 
11
11
  // Used por remove enclosing <pre> tag's (if occurs)
12
12
  const preTagRegexp: RegExp = /^<pre.*?>(.*)<\/pre>$/is;
@@ -1,7 +1,7 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
3
  import { Option } from "typings/custom";
4
- import { track } from "dx/instrumentation";
4
+ import { track } from "utils/analytics";
5
5
 
6
6
  export default class DropdownOption extends LightningElement {
7
7
  @api option!: Option;
@@ -1,31 +1,42 @@
1
1
  <template>
2
2
  <div class={classname} part="container">
3
- <div
4
- if:true={label}
5
- role={labelRole}
6
- aria-level={labelAriaLevel}
7
- class="label dx-text-heading-4"
8
- >
9
- {label}
10
- </div>
3
+ <template if:true={labelAsPrimaryHeading}>
4
+ <h1 if:true={label} class="label dx-text-heading-4">{label}</h1>
5
+ </template>
6
+ <template if:false={labelAsPrimaryHeading}>
7
+ <p if:true={label} class="label dx-text-heading-4">{label}</p>
8
+ </template>
11
9
  <div class="featured-content-main-content">
12
- <div
13
- role="heading"
14
- aria-level={titleAriaLevel}
15
- class="title dx-text-heading-2"
16
- >
17
- <a
18
- class="title-link"
19
- if:true={href}
20
- href={href}
21
- target={target}
22
- onmouseenter={setLinkHovered}
23
- onmouseleave={setLinkInactive}
24
- >
25
- {title}
26
- </a>
27
- <template if:false={href}>{title}</template>
28
- </div>
10
+ <template if:false={labelAsPrimaryHeading}>
11
+ <h1 class="title dx-text-heading-2">
12
+ <a
13
+ class="title-link"
14
+ if:true={href}
15
+ href={href}
16
+ target={target}
17
+ onmouseenter={setLinkHovered}
18
+ onmouseleave={setLinkInactive}
19
+ >
20
+ {title}
21
+ </a>
22
+ <template if:false={href}>{title}</template>
23
+ </h1>
24
+ </template>
25
+ <template if:true={labelAsPrimaryHeading}>
26
+ <h2 class="title dx-text-heading-2">
27
+ <a
28
+ class="title-link"
29
+ if:true={href}
30
+ href={href}
31
+ target={target}
32
+ onmouseenter={setLinkHovered}
33
+ onmouseleave={setLinkInactive}
34
+ >
35
+ {title}
36
+ </a>
37
+ <template if:false={href}>{title}</template>
38
+ </h2>
39
+ </template>
29
40
  <div class="authors" if:true={authors}>
30
41
  <template for:each={authors} for:item="author">
31
42
  <dx-image-and-label
@@ -73,18 +73,6 @@ export default class FeaturedContentHeader extends LightningElement {
73
73
  );
74
74
  }
75
75
 
76
- private get labelRole(): string | null {
77
- return this.labelAsPrimaryHeading ? "heading" : null;
78
- }
79
-
80
- private get labelAriaLevel(): string | null {
81
- return this.labelAsPrimaryHeading ? "1" : null;
82
- }
83
-
84
- private get titleAriaLevel(): string {
85
- return this.labelAsPrimaryHeading ? "2" : "1";
86
- }
87
-
88
76
  private setLinkHovered() {
89
77
  this.isLinkHovered = true;
90
78
  }
@@ -9,7 +9,7 @@ import {
9
9
  privacyHref,
10
10
  intellectualHref
11
11
  } from "./links";
12
- import { track } from "dx/instrumentation";
12
+ import { track } from "utils/analytics";
13
13
 
14
14
  const PATH = "/newsletter";
15
15
  const createNewsletterSignupHref = (email: string): string =>
@@ -1,5 +1,5 @@
1
1
  import { LightningElement, api } from "lwc";
2
- import { track } from "dx/instrumentation";
2
+ import { track } from "utils/analytics";
3
3
 
4
4
  export default class FooterOption extends LightningElement {
5
5
  @api href: string | null = null;
@@ -3,7 +3,7 @@ import cx from "classnames";
3
3
  import { LightningSlotElement, Link } from "typings/custom";
4
4
  import { isSlotEmpty } from "utils/slot";
5
5
  import { toJson } from "utils/normalizers";
6
- import { track } from "dx/instrumentation";
6
+ import { track } from "utils/analytics";
7
7
 
8
8
  type OptionalLink = Link | null;
9
9
 
@@ -1,5 +1,5 @@
1
1
  import { LightningElement, api } from "lwc";
2
- import { track } from "dx/instrumentation";
2
+ import { track } from "utils/analytics";
3
3
 
4
4
  export default class HeaderMobileNavMenuOption extends LightningElement {
5
5
  @api href: string | null = null;
@@ -1,6 +1,6 @@
1
1
  import classNames from "classnames";
2
2
  import { LightningElement, api } from "lwc";
3
- import { track } from "dx/instrumentation";
3
+ import { track } from "utils/analytics";
4
4
 
5
5
  const ANALYTICS_INFO = {
6
6
  clickUrl: window.location.href,
@@ -1,5 +1,5 @@
1
1
  import cx from "classnames";
2
- import { track as trackAnalytics } from "dx/instrumentation";
2
+ import { track as trackAnalytics } from "utils/analytics";
3
3
  import { api, track } from "lwc";
4
4
  import {
5
5
  TreeNode,
@@ -1,5 +1,5 @@
1
1
  import cx from "classnames";
2
- import { track } from "dx/instrumentation";
2
+ import { track } from "utils/analytics";
3
3
  import { api } from "lwc";
4
4
 
5
5
  import { TreeNode, SidebarGtmAction } from "typings/custom";
@@ -1,5 +1,5 @@
1
1
  import { LightningElement, api } from "lwc";
2
- import { track } from "dx/instrumentation";
2
+ import { track } from "utils/analytics";
3
3
  import cx from "classnames";
4
4
  import { TabVariant } from "typings/custom";
5
5
  import { normalizeBoolean } from "utils/normalizers";
@@ -1,6 +1,6 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import { InternalTreeNode } from "typings/custom";
3
- import { track } from "dx/instrumentation";
3
+ import { track } from "utils/analytics";
4
4
  import { SidebarGtmAction } from "typings/custom";
5
5
  import { isInViewport } from "utils/browser";
6
6
 
@@ -0,0 +1,24 @@
1
+ export const TRACKING_EVENT_NAME = "developerwebsite_track";
2
+ export const LISTENER_QUEUE = "__DX_INSTRUMENTATION_QUEUE__";
3
+ export const LISTENER_INDICATOR = "__DX_INSTRUMENTATION_IS_INITIALIZED__";
4
+
5
+ export function track(
6
+ element: EventTarget,
7
+ event: string,
8
+ payload: Record<string, unknown>
9
+ ): void {
10
+ const detail = { event, payload };
11
+ // if window.LISTENER_INDICATOR is undefined, `dx-instrumentation` has not
12
+ // been mounted, and the listener hasn't been attached.
13
+ if ((window as any)[LISTENER_INDICATOR] === undefined) {
14
+ (window as any)[LISTENER_QUEUE] = (window as any)[LISTENER_QUEUE] || [];
15
+ (window as any)[LISTENER_QUEUE].push(detail);
16
+ } else {
17
+ const e = new CustomEvent(TRACKING_EVENT_NAME, {
18
+ bubbles: true,
19
+ composed: true,
20
+ detail
21
+ });
22
+ element.dispatchEvent(e);
23
+ }
24
+ }
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.
@@ -1,3 +0,0 @@
1
- :host {
2
- display: contents;
3
- }
@@ -1,16 +0,0 @@
1
- <template>
2
- <template for:each={posts} for:item="post">
3
- <dx-card-blog-post
4
- label="BLOG POST"
5
- author-img-src={post.authorImgSrc}
6
- author-label={post.authorName}
7
- body={post.body}
8
- datetime={post.datetime}
9
- href={post.href}
10
- img-alt={post.imgAlt}
11
- img-src={post.imgSrc}
12
- key={post.id}
13
- title={post.title}
14
- ></dx-card-blog-post>
15
- </template>
16
- </template>
@@ -1,29 +0,0 @@
1
- import { LightningElement, api, track } from "lwc";
2
- import { fetchWordpressPosts } from "utils/wordpress";
3
- import { normalizePost } from "utils/normalizers";
4
-
5
- type BlogPost = {
6
- body: string;
7
- datetime: string;
8
- href: string;
9
- id: string;
10
- title: string;
11
- };
12
-
13
- export default class CardBlogPostProvider extends LightningElement {
14
- @api count?: string;
15
-
16
- @track posts: BlogPost[] = [];
17
-
18
- private fetchPosts = async () => {
19
- this.posts = await fetchWordpressPosts(
20
- "/blogs/api",
21
- normalizePost,
22
- this.count
23
- );
24
- };
25
-
26
- connectedCallback() {
27
- this.fetchPosts();
28
- }
29
- }
@@ -1,3 +0,0 @@
1
- :host {
2
- display: contents;
3
- }
@@ -1,12 +0,0 @@
1
- <template>
2
- <template for:each={episodes} for:item="episode">
3
- <dx-card-podcast-episode
4
- body={episode.body}
5
- datetime={episode.datetime}
6
- href={episode.href}
7
- key={episode.id}
8
- length={episode.length}
9
- title={episode.title}
10
- ></dx-card-podcast-episode>
11
- </template>
12
- </template>
@@ -1,29 +0,0 @@
1
- import { LightningElement, api, track } from "lwc";
2
- import { fetchWordpressPosts } from "utils/wordpress";
3
- import { normalizeEpisode } from "utils/normalizers";
4
-
5
- type PodcastEpisode = {
6
- body: string;
7
- datetime: string;
8
- href: string;
9
- id: string;
10
- length: string;
11
- title: string;
12
- };
13
- export default class CardPodcastEpisodeProvider extends LightningElement {
14
- @api count?: string;
15
-
16
- @track episodes: PodcastEpisode[] = [];
17
-
18
- private fetchEpisodes = async () => {
19
- this.episodes = await fetchWordpressPosts(
20
- "/podcast/api",
21
- normalizeEpisode,
22
- this.count
23
- );
24
- };
25
-
26
- connectedCallback() {
27
- this.fetchEpisodes();
28
- }
29
- }