@salesforcedevs/dx-components 1.3.196 → 1.3.197

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.3.196",
3
+ "version": "1.3.197",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -41,5 +41,5 @@
41
41
  "eventsourcemock": "^2.0.0",
42
42
  "luxon": "^3.1.0"
43
43
  },
44
- "gitHead": "3ca1796a050dd87c8083f73e41d8cb0cfb15328d"
44
+ "gitHead": "d43e7494e5566a25cc3301910b10337c69763c51"
45
45
  }
@@ -26,6 +26,9 @@ prism.languages.gtl = prism.languages.extend(
26
26
  prism.languages.handlebars
27
27
  );
28
28
 
29
+ // LWC
30
+ prism.languages.lwc = prism.languages.extend("jsx");
31
+
29
32
  // Used for remove enclosing <pre> tag's (if occurs)
30
33
  const preTagRegexp: RegExp = /^<pre.*?>(.*)<\/pre>$/is;
31
34
 
@@ -80,7 +83,8 @@ export default class CodeBlock extends LightningElement {
80
83
  { label: "DataWeave", id: "dataweave" },
81
84
  { label: "AMPScript", id: "ampscript" },
82
85
  { label: "SSJS", id: "ssjs" },
83
- { label: "GTL", id: "gtl" }
86
+ { label: "GTL", id: "gtl" },
87
+ { label: "LWC", id: "lwc" }
84
88
  ];
85
89
 
86
90
  connectedCallback() {
@@ -94,9 +98,10 @@ export default class CodeBlock extends LightningElement {
94
98
  set codeBlock(value: string) {
95
99
  this._codeBlockRendered = false;
96
100
  let match;
97
- this._codeBlock = ((match = preTagRegexp.exec(value.trim())) === null
98
- ? value.trim()
99
- : match[1]
101
+ this._codeBlock = (
102
+ (match = preTagRegexp.exec(value.trim())) === null
103
+ ? value.trim()
104
+ : match[1]
100
105
  ).trim();
101
106
  }
102
107
 
@@ -243,9 +248,8 @@ export default class CodeBlock extends LightningElement {
243
248
  });
244
249
 
245
250
  try {
246
- const snippetContainer: HTMLElement | null = this.template.querySelector(
247
- ".code-block-content"
248
- );
251
+ const snippetContainer: HTMLElement | null =
252
+ this.template.querySelector(".code-block-content");
249
253
  if (snippetContainer && snippetContainer.textContent) {
250
254
  await navigator.clipboard.writeText(
251
255
  snippetContainer.textContent