@iamakulov/codemirror-view 9999.99.99-fixcmdc.0 → 9999.99.99-fixcmdc.1

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.cjs CHANGED
@@ -4992,17 +4992,14 @@ function copiedRange(state) {
4992
4992
  }
4993
4993
  let lastLinewiseCopy = null;
4994
4994
  handlers.copy = handlers.cut = (view, event) => {
4995
- // If the DOM selection begins and ends outside this editor, don't intercept.
4995
+ // If the DOM selection is outside this editor, don't intercept.
4996
4996
  // This happens when a parent editor (like ProseMirror) selects content that
4997
4997
  // spans multiple elements including this CodeMirror. The copy event may
4998
4998
  // bubble through CodeMirror (e.g. when CodeMirror is the first or the last
4999
4999
  // element in the selection), but we should let the parent handle it.
5000
5000
  let domSel = getSelection(view.root);
5001
- if (domSel && domSel.anchorNode && domSel.focusNode &&
5002
- !view.contentDOM.contains(domSel.anchorNode) &&
5003
- !view.contentDOM.contains(domSel.focusNode)) {
5001
+ if (domSel && !hasSelection(view.contentDOM, domSel))
5004
5002
  return false;
5005
- }
5006
5003
  let { text, ranges, linewise } = copiedRange(view.state);
5007
5004
  if (!text && !linewise)
5008
5005
  return false;
package/dist/index.js CHANGED
@@ -4988,17 +4988,14 @@ function copiedRange(state) {
4988
4988
  }
4989
4989
  let lastLinewiseCopy = null;
4990
4990
  handlers.copy = handlers.cut = (view, event) => {
4991
- // If the DOM selection begins and ends outside this editor, don't intercept.
4991
+ // If the DOM selection is outside this editor, don't intercept.
4992
4992
  // This happens when a parent editor (like ProseMirror) selects content that
4993
4993
  // spans multiple elements including this CodeMirror. The copy event may
4994
4994
  // bubble through CodeMirror (e.g. when CodeMirror is the first or the last
4995
4995
  // element in the selection), but we should let the parent handle it.
4996
4996
  let domSel = getSelection(view.root);
4997
- if (domSel && domSel.anchorNode && domSel.focusNode &&
4998
- !view.contentDOM.contains(domSel.anchorNode) &&
4999
- !view.contentDOM.contains(domSel.focusNode)) {
4997
+ if (domSel && !hasSelection(view.contentDOM, domSel))
5000
4998
  return false;
5001
- }
5002
4999
  let { text, ranges, linewise } = copiedRange(view.state);
5003
5000
  if (!text && !linewise)
5004
5001
  return false;
package/ivan.justfile ADDED
@@ -0,0 +1,5 @@
1
+ build:
2
+ npm run prepare
3
+
4
+ publish:
5
+ npm publish --access public --tag playground
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamakulov/codemirror-view",
3
- "version": "9999.99.99-fixcmdc.0",
3
+ "version": "9999.99.99-fixcmdc.1",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",