@salesforcedevs/dx-components 1.39.0-alpha1 → 1.40.0-docs-feedback

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.39.0-alpha1",
3
+ "version": "1.40.0-docs-feedback",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,5 +44,5 @@
44
44
  "luxon": "3.4.4",
45
45
  "msw": "^2.12.4"
46
46
  },
47
- "stableVersion": "1.39.0"
47
+ "stableVersion": "1.40.0"
48
48
  }
@@ -103,9 +103,7 @@ class Footer extends LightningElement {
103
103
  // This encapsulates the old non-MFE footer functionality that should be removed once the footer MFE supports rendering in non-full-width contexts.
104
104
  // It's encapsulated like this solely for ease of deletion later.
105
105
  function augmentWithNonMFEFooterFunctionality(FooterClass: typeof Footer) {
106
- // Prefix with the deploy asset base path (e.g. "/PR-123"); empty in local dev.
107
- const assetBasePath = (globalThis as any)?.LWR?.env?.assetBasePath || "";
108
- const baseSocialIconUrl = `${assetBasePath}/assets/icons/brand-sprite/svg/symbols.svg`;
106
+ const baseSocialIconUrl = `/assets/icons/brand-sprite/svg/symbols.svg`;
109
107
 
110
108
  return class NonMFEFooter extends FooterClass {
111
109
  private didRequestFooterConfig = false;
@@ -40,10 +40,7 @@ export default class Icon extends LightningElement {
40
40
  }
41
41
 
42
42
  private get assetUrl() {
43
- // Prefix with the deploy asset base path (e.g. "/PR-123") so icons resolve
44
- // when the site is served under a sub-path. Empty in local dev, so no-op there.
45
- const assetBasePath = (globalThis as any)?.LWR?.env?.assetBasePath || "";
46
- return `${assetBasePath}/assets/icons/${this.sprite}-sprite/svg/symbols.svg`;
43
+ return `/assets/icons/${this.sprite}-sprite/svg/symbols.svg`;
47
44
  }
48
45
 
49
46
  private get href() {
@@ -5,9 +5,6 @@
5
5
  */
6
6
  const html = String.raw;
7
7
 
8
- // Prefix hardcoded asset URLs with the deploy asset base path (e.g. "/PR-123"); empty in local dev.
9
- const assetBasePath = (globalThis && globalThis.LWR && globalThis.LWR.env && globalThis.LWR.env.assetBasePath) || "";
10
-
11
8
  export default html`
12
9
  <div class="coveo-show-if-no-results">
13
10
  <div class="no-results">
@@ -73,7 +70,7 @@ export default html`
73
70
  >
74
71
  <%- title %>
75
72
  <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
76
- <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="${assetBasePath}/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
73
+ <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>
77
74
  <% } %>
78
75
  </a>
79
76
  <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
@@ -124,7 +121,7 @@ export default html`
124
121
  <%- uri %>
125
122
  <% } %>
126
123
  <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
127
- <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="${assetBasePath}/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
124
+ <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>
128
125
  <% } %>
129
126
  </a>
130
127
  <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
@@ -54,8 +54,6 @@ const buildTemplateHelperBadge = (value: keyof typeof CONTENT_TYPE_LABELS) => {
54
54
  const style = getContentTypeColorVariables(value);
55
55
  const label = CONTENT_TYPE_LABELS[value];
56
56
  const { iconSprite, iconSymbol } = CONTENT_TYPE_ICONS[value];
57
- // Prefix with the deploy asset base path (e.g. "/PR-123"); empty in local dev.
58
- const assetBasePath = (globalThis as any)?.LWR?.env?.assetBasePath || "";
59
57
  return `
60
58
  <div style="${style}" class="dx-badge">
61
59
  <svg
@@ -30,7 +30,6 @@
30
30
  <div class="header-wrapper">
31
31
  <div lwc:if={devCenter} class="link-row">
32
32
  <a href={devCenter.link}>
33
- <dx-icon symbol="back"></dx-icon>
34
33
  <dx-icon
35
34
  class="brand-icon"
36
35
  lwc:if={devCenter.icon}
@@ -317,12 +317,9 @@ export default class SidebarSearch extends LightningElement {
317
317
 
318
318
  // discussion about this normalization here: https://salesforce-internal.slack.com/archives/C020S6784JX/p1639506238376600
319
319
 
320
- // Deploy base path (e.g. "/PR-123"); empty in local dev. window.location.pathname
321
- // is served under this prefix, so route hrefs and comparisons must include it.
322
- const basePath = (globalThis as any)?.LWR?.env?.basePath || "";
323
320
  let pathname, queryParam;
324
321
  if (sfhtml_url__c) {
325
- pathname = `${basePath}/docs/${sfhtml_url__c}`;
322
+ pathname = `/docs/${sfhtml_url__c}`;
326
323
  } else {
327
324
  const isNestedGuide = clickUri.includes("/guide/");
328
325
  const url = new URL(clickUri);
@@ -49,6 +49,16 @@ export default class TreeItem extends LightningElement {
49
49
  return this.hasChildren || this.isChildrenLoading;
50
50
  }
51
51
 
52
+ private get isContentlessParent(): boolean {
53
+ const href = this._treeNode?.link?.href;
54
+ return (
55
+ this.isParent &&
56
+ !!href &&
57
+ !this.isExternalLink &&
58
+ href !== this._treeNode.name
59
+ );
60
+ }
61
+
52
62
  private get showChildren(): boolean {
53
63
  return this.isExpanded && this.hasChildren;
54
64
  }
@@ -140,6 +150,15 @@ export default class TreeItem extends LightningElement {
140
150
  private onLinkClick(event: Event): void {
141
151
  this.preventDefaultLinkBehavior(event);
142
152
 
153
+ /**
154
+ * For Docs content-type only redirect, content-less parents to their first content child.
155
+ * Let navigation handle selection and ancestor expansion to avoid flicker.
156
+ */
157
+ if (this.isContentlessParent) {
158
+ this.sendGtm(event);
159
+ return;
160
+ }
161
+
143
162
  if (this.isParent) {
144
163
  const isSelectAction = true;
145
164
  this.doExpand(isSelectAction);