@vscode/markdown-editor 0.0.2-90 → 0.0.2-91

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/dist/index.d.ts CHANGED
@@ -72,15 +72,16 @@ declare interface AstVisualizationNode {
72
72
  }
73
73
 
74
74
  /**
75
- * Strategy for hosts that never deliver native clipboard events to the editor
76
- * — most importantly VS Code webviews, whose preload calls `preventDefault()`
77
- * on the Ctrl/Cmd+C/X/V keydowns, so no `copy`/`cut`/`paste` event is ever
78
- * dispatched. Here the keystrokes are the only signal, so this strategy
79
- * listens for them directly and drives the async {@link Clipboard} API
80
- * (`navigator.clipboard`), which webviews are granted.
75
+ * Strategy for hosts that intercept native clipboard shortcuts, notably
76
+ * VS Code webviews. Their preload prevents the default Ctrl/Cmd+C/X/V handling
77
+ * and forwards the keydowns to the host. This strategy handles the keystrokes
78
+ * directly using the async {@link Clipboard} API (`navigator.clipboard`),
79
+ * which webviews are granted.
81
80
  *
82
81
  * Cut deletes synchronously once the text is captured; the clipboard write is
83
82
  * fire-and-forget. Paste must wait for the async read before inserting.
83
+ * Handled keydowns must not reach the host, which may replay native clipboard
84
+ * commands even when the browser's default has been prevented.
84
85
  */
85
86
  export declare class AsyncClipboardStrategy implements IClipboardStrategy {
86
87
  private readonly _clipboard;
package/dist/index.js CHANGED
@@ -7365,18 +7365,18 @@ class pl {
7365
7365
  const c = e.getSelectedText();
7366
7366
  if (c === void 0)
7367
7367
  return;
7368
- i.preventDefault(), this._clipboard.writeText(c);
7368
+ i.preventDefault(), i.stopPropagation(), this._clipboard.writeText(c);
7369
7369
  break;
7370
7370
  }
7371
7371
  case "x": {
7372
7372
  const c = e.getSelectedText();
7373
7373
  if (c === void 0)
7374
7374
  return;
7375
- i.preventDefault(), this._clipboard.writeText(c), e.deleteSelection();
7375
+ i.preventDefault(), i.stopPropagation(), this._clipboard.writeText(c), e.deleteSelection();
7376
7376
  break;
7377
7377
  }
7378
7378
  case "v": {
7379
- i.preventDefault(), this._clipboard.readText().then((c) => {
7379
+ i.preventDefault(), i.stopPropagation(), this._clipboard.readText().then((c) => {
7380
7380
  c && e.insertText(c);
7381
7381
  });
7382
7382
  break;
@@ -7398,18 +7398,18 @@ function ya(n, e, t) {
7398
7398
  const s = as(e);
7399
7399
  if (s === void 0)
7400
7400
  return;
7401
- n.preventDefault(), t.writeText(s);
7401
+ n.preventDefault(), n.stopPropagation(), t.writeText(s);
7402
7402
  return;
7403
7403
  }
7404
7404
  case "x": {
7405
7405
  const s = as(e);
7406
7406
  if (s === void 0)
7407
7407
  return;
7408
- n.preventDefault(), t.writeText(s), ls(e, "");
7408
+ n.preventDefault(), n.stopPropagation(), t.writeText(s), ls(e, "");
7409
7409
  return;
7410
7410
  }
7411
7411
  case "v":
7412
- n.preventDefault(), t.readText().then((s) => {
7412
+ n.preventDefault(), n.stopPropagation(), t.readText().then((s) => {
7413
7413
  s.length > 0 && ls(e, s);
7414
7414
  });
7415
7415
  }