@salesforcedevs/dx-components 1.28.3 → 1.28.5

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
@@ -56,6 +56,7 @@
56
56
  "dx/featuresListHeader",
57
57
  "dx/filterMenu",
58
58
  "dx/footer",
59
+ "dx/footerMfe",
59
60
  "dx/formattedDateTime",
60
61
  "dx/formattedRichText",
61
62
  "dx/grid",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.28.3",
3
+ "version": "1.28.5",
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
- "gitHead": "e202d2d5d5a11fda07cfe595ccdc53a27bc2624e"
47
+ "gitHead": "2fa9927fc99914ec55e4f8322cec0b8b95d31a68"
48
48
  }
@@ -34,6 +34,7 @@ export default class CodeBlock extends LightningElement {
34
34
  private _codeBlockRendered: boolean = false;
35
35
  private _showLoadingIndicator: boolean = false;
36
36
  private _isCbHeightCalculated: boolean = false;
37
+ private _plainCodeForCopy: string = "";
37
38
  private markupLangs = ["visualforce", "html", "xml"];
38
39
  private componentLoaded: boolean = false;
39
40
  private showLanguageDropdown: boolean = false;
@@ -290,6 +291,9 @@ export default class CodeBlock extends LightningElement {
290
291
  );
291
292
  }
292
293
  }
294
+ // Get the plain code for copy functionality
295
+ const codeElement = this.template.querySelector("code");
296
+ this._plainCodeForCopy = codeElement?.textContent?.trim() ?? "";
293
297
  // Add line numbers to each line
294
298
  this.addLineNumbers();
295
299
  }
@@ -328,12 +332,8 @@ export default class CodeBlock extends LightningElement {
328
332
  });
329
333
 
330
334
  try {
331
- const snippetContainer: HTMLElement | null =
332
- this.template.querySelector(".code-block-content");
333
- if (snippetContainer && snippetContainer.textContent) {
334
- await navigator.clipboard.writeText(
335
- snippetContainer.textContent
336
- );
335
+ if (this._plainCodeForCopy) {
336
+ await navigator.clipboard.writeText(this._plainCodeForCopy);
337
337
  this.copyBtnText = "Copied!";
338
338
  setTimeout(() => {
339
339
  this.copyBtnText = "Click to copy";
@@ -45,6 +45,7 @@
45
45
  <dx-footer-mfe
46
46
  legal-only={showLegalOnly}
47
47
  origin={mfeConfigOrigin}
48
+ home-href={mfeHomeHref}
48
49
  ></dx-footer-mfe>
49
50
  </footer>
50
51
  </template>
@@ -10,6 +10,9 @@ export default class Footer extends LightningElement {
10
10
  private signupUrl =
11
11
  "https://www.salesforce.com/form/other/role-based-newsletter/?Developer=true";
12
12
 
13
+ @api
14
+ mfeHomeHref: string = `/${window.location.host}`; // ugly hack: ideally this wouldn't be necessary, but the only way to remove the "See all ways to contact us" link from the footer MFE is to set this to a non-empty value other than "us"; and given the way that the footer works, the non-empty value needs to be something that can be appended to `/` and work correctly
15
+
13
16
  @api
14
17
  mfeConfigOrigin: string = `${window.location.origin}/developer/en-us/wp-json`;
15
18
 
@@ -4,6 +4,7 @@ export default class FooterMfe extends LightningElement {
4
4
  private footerElement: HTMLElement | null = null;
5
5
 
6
6
  @api legalOnly = false;
7
+ @api homeHref: string = `/${window.location.host}`; // ugly hack by default: ideally this wouldn't be necessary, but the only way to remove the "See all ways to contact us" link from the footer MFE is to set this to a non-empty value other than "us"; and given the way that the footer works, the non-empty value needs to be something that can be appended to `/` and work correctly
7
8
  @api origin: string = `${window.location.origin}/developer/en-us/wp-json`;
8
9
 
9
10
  renderedCallback() {