@jsenv/dom 0.17.26 → 0.17.27

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.
Files changed (2) hide show
  1. package/dist/jsenv_dom.js +19 -6
  2. package/package.json +1 -1
package/dist/jsenv_dom.js CHANGED
@@ -9477,7 +9477,8 @@ const css$4 = /* css */`
9477
9477
  not to the gesture, and two fingers are never a drag. */
9478
9478
  touch-action: pinch-zoom;
9479
9479
  }
9480
- [data-drag-ignore] {
9480
+ [data-drag-ignore],
9481
+ [data-own-target] {
9481
9482
  -webkit-touch-callout: default;
9482
9483
  touch-action: auto;
9483
9484
  }
@@ -11931,7 +11932,8 @@ const css$1 = /* css */`
11931
11932
  [data-drag-source] {
11932
11933
  cursor: default;
11933
11934
  }
11934
- [data-drag-ignore] {
11935
+ [data-drag-ignore],
11936
+ [data-own-target] {
11935
11937
  cursor: auto;
11936
11938
  }
11937
11939
 
@@ -12026,6 +12028,14 @@ const css$1 = /* css */`
12026
12028
  // can start a drag, and they have to be true BEFORE anyone drags anything.
12027
12029
  import.meta.css = [css$1, "@jsenv/dom/src/interaction/drag/drag_to.js"];
12028
12030
 
12031
+ // What a press must not be read from at all. `data-drag-ignore` is said by
12032
+ // something whose press is its own business — a text one wants to select, a
12033
+ // control that reads the pointer itself. `data-own-target` is the same fact said
12034
+ // once for every gesture there is: an element declaring that a press landing on
12035
+ // it is aimed AT it, whatever it happens to sit inside (see also
12036
+ // DRAG_EXCLUDED_SELECTOR in drag_to_travel.js).
12037
+ const DRAG_IGNORED_SELECTOR = "[data-drag-ignore],[data-own-target]";
12038
+
12029
12039
  /**
12030
12040
  * Starts a drag-to-reorder interaction on a list item.
12031
12041
  *
@@ -12525,7 +12535,7 @@ const startDragTo = (event, effects, {
12525
12535
  } = {}) => {
12526
12536
  // An area that opted out of dragging (a text one wants to select, a control that
12527
12537
  // owns the gesture): the press there is none of our business.
12528
- if (event.target.closest && event.target.closest("[data-drag-ignore]")) {
12538
+ if (event.target.closest && event.target.closest(DRAG_IGNORED_SELECTOR)) {
12529
12539
  return undefined;
12530
12540
  }
12531
12541
  // A secondary button (right click and friends) is a context menu, not a grab.
@@ -12707,7 +12717,7 @@ const startDragToCarryCopy = (event, {
12707
12717
  }) => {
12708
12718
  // An area that opted out of dragging (a text one wants to select, a control
12709
12719
  // that owns the gesture): the press there is none of our business.
12710
- if (event.target.closest && event.target.closest("[data-drag-ignore]")) {
12720
+ if (event.target.closest && event.target.closest(DRAG_IGNORED_SELECTOR)) {
12711
12721
  return undefined;
12712
12722
  }
12713
12723
  // A secondary button (right click and friends) is a context menu, not a grab.
@@ -13452,8 +13462,11 @@ const DRAG_RESISTANCE = 0.3;
13452
13462
  // from one travels, and the click it would have made is swallowed on the way
13453
13463
  // out. A drag SOURCE is not either: it says which way it goes and only takes
13454
13464
  // that (see DRAG_SOURCE_AXES_ATTRIBUTE) — but a dedicated handle is, being a
13455
- // place whose only purpose is to be taken hold of, from the first pixel.
13456
- const DRAG_EXCLUDED_SELECTOR = ["input", "textarea", "select", '[contenteditable=""]', '[contenteditable="true"]', "[data-drag-handle]", "[data-no-drag-travel]"].join(",");
13465
+ // place whose only purpose is to be taken hold of, from the first pixel. And so
13466
+ // is an OWN TARGET: an element saying a press landing on it is aimed at IT,
13467
+ // which is the same sentence said to every gesture at once rather than to this
13468
+ // one (see DRAG_IGNORED_SELECTOR in drag_to.js).
13469
+ const DRAG_EXCLUDED_SELECTOR = ["input", "textarea", "select", '[contenteditable=""]', '[contenteditable="true"]', "[data-drag-handle]", "[data-no-drag-travel]", "[data-own-target]"].join(",");
13457
13470
 
13458
13471
  // Which axes a box travels on, one attribute per gesture, said in the DOM by
13459
13472
  // whoever owns the box: it is what a box ABOVE another reads to know the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/dom",
3
- "version": "0.17.26",
3
+ "version": "0.17.27",
4
4
  "type": "module",
5
5
  "description": "DOM utilities for writing frontend code",
6
6
  "repository": {