@salesforce/webapp-experimental 1.103.4 → 1.103.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.
@@ -1,4 +1,4 @@
1
- const version = "1.103.4";
1
+ const version = "1.103.5";
2
2
  export {
3
3
  version
4
4
  };
@@ -220,7 +220,11 @@
220
220
  console.error("[webapps-proxy] Failed to send iframeAlive message:", e);
221
221
  }
222
222
  }
223
- if (!document.getElementById("vscode-text-selection-style")) {
223
+ if (
224
+ window.parent &&
225
+ window.parent !== window &&
226
+ !document.getElementById("vscode-text-selection-style")
227
+ ) {
224
228
  const style = document.createElement("style");
225
229
  style.id = "vscode-text-selection-style";
226
230
  style.textContent =
@@ -291,41 +295,37 @@
291
295
  }
292
296
  }
293
297
 
294
- // Listen for keyboard shortcuts (Cmd+C / Ctrl+C) - user-initiated, always send
295
- document.addEventListener(
296
- "keydown",
297
- function (e) {
298
- // Cmd+C (Mac) or Ctrl+C (Windows/Linux)
299
- if ((e.metaKey || e.ctrlKey) && (e.key === "c" || e.key === "C" || e.keyCode === 67)) {
300
- // Small delay to ensure selection is captured after VS Code processes the event
298
+ if (window.parent && window.parent !== window) {
299
+ document.addEventListener(
300
+ "keydown",
301
+ function (e) {
302
+ if ((e.metaKey || e.ctrlKey) && (e.key === "c" || e.key === "C" || e.keyCode === 67)) {
303
+ setTimeout(function () {
304
+ sendCopyMessage(true);
305
+ }, 0);
306
+ }
307
+ },
308
+ true,
309
+ );
310
+
311
+ document.addEventListener(
312
+ "copy",
313
+ function (e) {
301
314
  setTimeout(function () {
302
- sendCopyMessage(true); // forceCopy = true for user-initiated actions
315
+ sendCopyMessage(true);
303
316
  }, 0);
304
- }
305
- },
306
- true,
307
- ); // Use capture phase - highest priority
308
-
309
- // Listen for copy events as backup
310
- document.addEventListener(
311
- "copy",
312
- function (e) {
313
- // Also force send on copy event (user-initiated)
314
- setTimeout(function () {
315
- sendCopyMessage(true);
316
- }, 0);
317
- },
318
- true,
319
- ); // Use capture phase to catch before VS Code intercepts
317
+ },
318
+ true,
319
+ );
320
+ }
320
321
 
321
- document.addEventListener(
322
- "contextmenu",
323
- function (e) {
324
- // Prevent default browser context menu so our custom one shows
325
- e.preventDefault();
326
- const selection = window.getSelection();
327
- const selectedText = selection && selection.toString().trim() ? selection.toString() : "";
328
- if (window.parent && window.parent !== window) {
322
+ if (window.parent && window.parent !== window) {
323
+ document.addEventListener(
324
+ "contextmenu",
325
+ function (e) {
326
+ e.preventDefault();
327
+ const selection = window.getSelection();
328
+ const selectedText = selection && selection.toString().trim() ? selection.toString() : "";
329
329
  try {
330
330
  window.parent.postMessage(
331
331
  {
@@ -339,10 +339,10 @@
339
339
  } catch (err) {
340
340
  console.error("[webapps-proxy] Right-click: Error sending postMessage:", err);
341
341
  }
342
- }
343
- },
344
- true,
345
- );
342
+ },
343
+ true,
344
+ );
345
+ }
346
346
 
347
347
  window.addEventListener("message", function (e) {
348
348
  if (e.data && e.data.command === "getSelection") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-experimental",
3
3
  "description": "[experimental] Core package for Salesforce Web Applications",
4
- "version": "1.103.4",
4
+ "version": "1.103.5",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@salesforce/core": "^8.23.4",
47
- "@salesforce/sdk-data": "^1.103.4",
47
+ "@salesforce/sdk-data": "^1.103.5",
48
48
  "axios": "^1.7.7",
49
49
  "micromatch": "^4.0.8",
50
50
  "path-to-regexp": "^8.3.0"