@jsenv/dom 0.17.34 → 0.17.36

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 +373 -486
  2. package/package.json +1 -1
package/dist/jsenv_dom.js CHANGED
@@ -8426,26 +8426,16 @@ installImportMetaCssBuild(import.meta);/**
8426
8426
  * donc juste x/y ca seras surement mieux
8427
8427
  *
8428
8428
  */
8429
- const css$5 = /* css */`
8430
- .navi_drag_gesture_backdrop {
8431
- position: fixed;
8432
- inset: 0;
8433
- /* A finger dragging must not also pan the page under it. The backdrop is
8434
- the only element the finger can be over once the gesture is running. */
8435
- touch-action: none;
8436
- user-select: none;
8437
- }
8438
- /* Chrome matches :focus-visible on a programmatic focus, so focusing what the
8439
- gesture holds draws a ring around an object the user already has under the
8440
- pointer — a frame blinking for the length of the gesture, saying something
8441
- the finger knows. The ring stays whole where it earns its place: at the
8442
- keyboard, outside any gesture.
8443
- focus({ focusVisible: false }) would say the intent better but does not
8444
- hold — Chrome's heuristic does not always obey the option (see
8445
- isMatchingFocusVisible). */
8446
- [data-drag-focus]:focus-visible {
8447
- outline: none;
8448
- }
8429
+ const css$5 = /* css */`.navi_drag_gesture_backdrop {
8430
+ touch-action: none;
8431
+ user-select: none;
8432
+ position: fixed;
8433
+ inset: 0;
8434
+ }
8435
+
8436
+ [data-drag-focus]:focus-visible {
8437
+ outline: none;
8438
+ }
8449
8439
  `;
8450
8440
  import.meta.css = [css$5, "@jsenv/dom/src/interaction/drag/drag_gesture.js"];
8451
8441
 
@@ -9472,45 +9462,30 @@ installImportMetaCssBuild(import.meta);/**
9472
9462
  lets the page scroll and still makes the refusal effective — provided the
9473
9463
  listener that will refuse is already known too, which is markDragSource's
9474
9464
  half of the same rule. */
9475
- const css$4 = /* css */`
9476
- [data-drag-handle],
9477
- [data-drag-source] {
9478
- -webkit-touch-callout: none;
9479
- }
9480
- [data-drag-handle] {
9481
- /* A dedicated handle has nothing to share: it takes the gesture on contact. */
9482
- touch-action: none;
9483
- }
9484
- [data-drag-source] {
9485
- /* A source taken by long press must let the scroll through until the grab —
9486
- which is exactly what the long press is there to tell apart. Zoom has
9487
- nothing to do with the gesture and nobody should lose it by resting a
9488
- finger on a word.
9489
-
9490
- Vertical, because that is the way the page and the lists in it go: a
9491
- source dragged along one axis is surrounded by something scrolling along
9492
- that same axis (a row of a list runs the way the list scrolls), and a
9493
- source dragged both ways sits on the usual vertical page. */
9494
- touch-action: pan-y pinch-zoom;
9495
- }
9496
- [data-drag-source="x"] {
9497
- /* …and the sideways one, for the same reason read the other way. */
9498
- touch-action: pan-x pinch-zoom;
9499
- }
9500
- [data-drag-on-contact] [data-drag-source],
9501
- [data-drag-source][data-drag-on-contact] {
9502
- /* Nothing scrolls here, so there is no pan to leave to anyone — the finger
9503
- may travel from the first pixel. Zoom is kept: it belongs to the reader,
9504
- not to the gesture, and two fingers are never a drag. */
9505
- touch-action: pinch-zoom;
9506
- }
9507
- [data-drag-ignore],
9508
- [data-own-target],
9509
- [data-drag-source] [popover],
9510
- [data-drag-source] dialog {
9511
- -webkit-touch-callout: default;
9512
- touch-action: auto;
9513
- }
9465
+ const css$4 = /* css */`[data-drag-handle], [data-drag-source] {
9466
+ -webkit-touch-callout: none;
9467
+ }
9468
+
9469
+ [data-drag-handle] {
9470
+ touch-action: none;
9471
+ }
9472
+
9473
+ [data-drag-source] {
9474
+ touch-action: pan-y pinch-zoom;
9475
+ }
9476
+
9477
+ [data-drag-source="x"] {
9478
+ touch-action: pan-x pinch-zoom;
9479
+ }
9480
+
9481
+ [data-drag-on-contact] [data-drag-source], [data-drag-source][data-drag-on-contact] {
9482
+ touch-action: pinch-zoom;
9483
+ }
9484
+
9485
+ [data-drag-ignore], [data-self-interactions~="drag"], [data-self-interactions~="*"], [data-drag-source] [popover], [data-drag-source] dialog {
9486
+ -webkit-touch-callout: default;
9487
+ touch-action: auto;
9488
+ }
9514
9489
  `;
9515
9490
  import.meta.css = [css$4, "@jsenv/dom/src/interaction/drag/drag_after_intent.js"];
9516
9491
 
@@ -10223,20 +10198,19 @@ const getDragCoordinates = (
10223
10198
  return [leftRelativeToScrollContainer, topRelativeToScrollContainer];
10224
10199
  };
10225
10200
 
10226
- installImportMetaCssBuild(import.meta);const css$3 = /* css */`
10227
- .navi_constraint_feedback_line {
10228
- position: fixed;
10229
- z-index: 9998;
10230
- border-top: 2px dotted rgba(59, 130, 246, 0.7);
10231
- visibility: hidden;
10232
- transform-origin: left center;
10233
- transition: opacity 0.15s ease;
10234
- pointer-events: none;
10235
- }
10201
+ installImportMetaCssBuild(import.meta);const css$3 = /* css */`.navi_constraint_feedback_line {
10202
+ z-index: 9998;
10203
+ visibility: hidden;
10204
+ transform-origin: 0;
10205
+ pointer-events: none;
10206
+ border-top: 2px dotted #3b82f6b3;
10207
+ transition: opacity .15s;
10208
+ position: fixed;
10209
+ }
10236
10210
 
10237
- .navi_constraint_feedback_line[data-visible] {
10238
- visibility: visible;
10239
- }
10211
+ .navi_constraint_feedback_line[data-visible] {
10212
+ visibility: visible;
10213
+ }
10240
10214
  `;
10241
10215
  const setupConstraintFeedbackLine = () => {
10242
10216
  import.meta.css = [css$3, "@jsenv/dom/src/interaction/drag/constraint_feedback_line.js"];
@@ -10319,191 +10293,172 @@ let currentDebugMarkers = [];
10319
10293
  let currentConstraintMarkers = [];
10320
10294
  let currentReferenceElementMarker = null;
10321
10295
  let currentElementMarker = null;
10322
- const css$2 = /* css */`
10323
- .navi_debug_markers_container {
10324
- position: fixed;
10325
- top: 0;
10326
- left: 0;
10327
- z-index: 999998;
10328
- width: 100vw;
10329
- height: 100vh;
10330
- pointer-events: none;
10331
- overflow: hidden;
10332
- --marker-size: ${MARKER_SIZE}px;
10333
- }
10334
-
10335
- .navi_debug_marker {
10336
- position: absolute;
10337
- pointer-events: none;
10338
- }
10339
-
10340
- /* Markers based on side rather than orientation */
10341
- .navi_debug_marker[data-left],
10342
- .navi_debug_marker[data-right] {
10343
- width: var(--marker-size);
10344
- height: 100vh;
10345
- }
10346
-
10347
- .navi_debug_marker[data-top],
10348
- .navi_debug_marker[data-bottom] {
10349
- width: 100vw;
10350
- height: var(--marker-size);
10351
- }
10352
-
10353
- /* Gradient directions based on side, using CSS custom properties for color */
10354
- .navi_debug_marker[data-left] {
10355
- background: linear-gradient(
10356
- to right,
10357
- rgba(from var(--marker-color) r g b / 0.9) 0%,
10358
- rgba(from var(--marker-color) r g b / 0.7) 30%,
10359
- rgba(from var(--marker-color) r g b / 0.3) 70%,
10360
- rgba(from var(--marker-color) r g b / 0) 100%
10361
- );
10362
- }
10296
+ const css$2 = /* css */`.navi_debug_markers_container {
10297
+ z-index: 999998;
10298
+ pointer-events: none;
10299
+ --marker-size: ${MARKER_SIZE}px;
10300
+ width: 100vw;
10301
+ height: 100vh;
10302
+ position: fixed;
10303
+ top: 0;
10304
+ left: 0;
10305
+ overflow: hidden;
10306
+ }
10363
10307
 
10364
- .navi_debug_marker[data-right] {
10365
- background: linear-gradient(
10366
- to left,
10367
- rgba(from var(--marker-color) r g b / 0.9) 0%,
10368
- rgba(from var(--marker-color) r g b / 0.7) 30%,
10369
- rgba(from var(--marker-color) r g b / 0.3) 70%,
10370
- rgba(from var(--marker-color) r g b / 0) 100%
10371
- );
10372
- }
10308
+ .navi_debug_marker {
10309
+ pointer-events: none;
10310
+ position: absolute;
10311
+ }
10373
10312
 
10374
- .navi_debug_marker[data-top] {
10375
- background: linear-gradient(
10376
- to bottom,
10377
- rgba(from var(--marker-color) r g b / 0.9) 0%,
10378
- rgba(from var(--marker-color) r g b / 0.7) 30%,
10379
- rgba(from var(--marker-color) r g b / 0.3) 70%,
10380
- rgba(from var(--marker-color) r g b / 0) 100%
10381
- );
10382
- }
10313
+ .navi_debug_marker[data-left], .navi_debug_marker[data-right] {
10314
+ width: var(--marker-size);
10315
+ height: 100vh;
10316
+ }
10383
10317
 
10384
- .navi_debug_marker[data-bottom] {
10385
- background: linear-gradient(
10386
- to top,
10387
- rgba(from var(--marker-color) r g b / 0.9) 0%,
10388
- rgba(from var(--marker-color) r g b / 0.7) 30%,
10389
- rgba(from var(--marker-color) r g b / 0.3) 70%,
10390
- rgba(from var(--marker-color) r g b / 0) 100%
10391
- );
10392
- }
10318
+ .navi_debug_marker[data-top], .navi_debug_marker[data-bottom] {
10319
+ width: 100vw;
10320
+ height: var(--marker-size);
10321
+ }
10393
10322
 
10394
- .navi_debug_marker_label {
10395
- position: absolute;
10396
- padding: 2px 6px;
10397
- color: rgb(from var(--marker-color) r g b / 1);
10398
- font-weight: bold;
10399
- font-size: 12px;
10400
- white-space: nowrap;
10401
- background: rgba(255, 255, 255, 0.9);
10402
- border: 1px solid;
10403
- border-color: rgb(from var(--marker-color) r g b / 1);
10404
- border-radius: 3px;
10405
- pointer-events: none;
10406
- }
10407
-
10408
- /* Label positioning based on side data attributes */
10409
-
10410
- /* Left side markers - vertical with 90° rotation */
10411
- .navi_debug_marker[data-left] .navi_debug_marker_label {
10412
- top: 20px;
10413
- left: 10px;
10414
- transform: rotate(90deg);
10415
- transform-origin: left center;
10416
- }
10417
-
10418
- /* Right side markers - vertical with -90° rotation */
10419
- .navi_debug_marker[data-right] .navi_debug_marker_label {
10420
- top: 20px;
10421
- right: 10px;
10422
- left: auto;
10423
- transform: rotate(-90deg);
10424
- transform-origin: right center;
10425
- }
10426
-
10427
- /* Top side markers - horizontal, label on the line */
10428
- .navi_debug_marker[data-top] .navi_debug_marker_label {
10429
- top: 0px;
10430
- left: 20px;
10431
- }
10432
-
10433
- /* Bottom side markers - horizontal, label on the line */
10434
- .navi_debug_marker[data-bottom] .navi_debug_marker_label {
10435
- top: auto;
10436
- bottom: 0px;
10437
- left: 20px;
10438
- }
10439
-
10440
- .navi_obstacle_marker {
10441
- position: absolute;
10442
- z-index: 9999;
10443
- background-color: orange;
10444
- opacity: 0.6;
10445
- pointer-events: none;
10446
- }
10447
-
10448
- .navi_obstacle_marker_label {
10449
- position: absolute;
10450
- top: 50%;
10451
- left: 50%;
10452
- color: white;
10453
- font-weight: bold;
10454
- font-size: 12px;
10455
- text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
10456
- transform: translate(-50%, -50%);
10457
- pointer-events: none;
10458
- }
10459
-
10460
- .navi_element_marker {
10461
- position: absolute;
10462
- z-index: 9997;
10463
- background-color: var(--element-color-alpha, rgba(255, 0, 150, 0.3));
10464
- border: 2px solid var(--element-color, rgb(255, 0, 150));
10465
- opacity: 0.9;
10466
- pointer-events: none;
10467
- }
10468
-
10469
- .navi_element_marker_label {
10470
- position: absolute;
10471
- top: -25px;
10472
- right: 0;
10473
- padding: 2px 6px;
10474
- color: var(--element-color, rgb(255, 0, 150));
10475
- font-weight: bold;
10476
- font-size: 11px;
10477
- white-space: nowrap;
10478
- background: rgba(255, 255, 255, 0.9);
10479
- border: 1px solid var(--element-color, rgb(255, 0, 150));
10480
- border-radius: 3px;
10481
- pointer-events: none;
10482
- }
10483
-
10484
- .navi_reference_element_marker {
10485
- position: absolute;
10486
- z-index: 9998;
10487
- background-color: rgba(0, 150, 255, 0.3);
10488
- border: 2px dashed rgba(0, 150, 255, 0.7);
10489
- opacity: 0.8;
10490
- pointer-events: none;
10491
- }
10492
-
10493
- .navi_reference_element_marker_label {
10494
- position: absolute;
10495
- top: -25px;
10496
- left: 0;
10497
- padding: 2px 6px;
10498
- color: rgba(0, 150, 255, 1);
10499
- font-weight: bold;
10500
- font-size: 11px;
10501
- white-space: nowrap;
10502
- background: rgba(255, 255, 255, 0.9);
10503
- border: 1px solid rgba(0, 150, 255, 0.7);
10504
- border-radius: 3px;
10505
- pointer-events: none;
10506
- }
10323
+ .navi_debug_marker[data-left] {
10324
+ background: linear-gradient(to right,
10325
+ rgba(from var(--marker-color) r g b / .9) 0%,
10326
+ rgba(from var(--marker-color) r g b / .7) 30%,
10327
+ rgba(from var(--marker-color) r g b / .3) 70%,
10328
+ rgba(from var(--marker-color) r g b / 0) 100%);
10329
+ }
10330
+
10331
+ .navi_debug_marker[data-right] {
10332
+ background: linear-gradient(to left,
10333
+ rgba(from var(--marker-color) r g b / .9) 0%,
10334
+ rgba(from var(--marker-color) r g b / .7) 30%,
10335
+ rgba(from var(--marker-color) r g b / .3) 70%,
10336
+ rgba(from var(--marker-color) r g b / 0) 100%);
10337
+ }
10338
+
10339
+ .navi_debug_marker[data-top] {
10340
+ background: linear-gradient(to bottom,
10341
+ rgba(from var(--marker-color) r g b / .9) 0%,
10342
+ rgba(from var(--marker-color) r g b / .7) 30%,
10343
+ rgba(from var(--marker-color) r g b / .3) 70%,
10344
+ rgba(from var(--marker-color) r g b / 0) 100%);
10345
+ }
10346
+
10347
+ .navi_debug_marker[data-bottom] {
10348
+ background: linear-gradient(to top,
10349
+ rgba(from var(--marker-color) r g b / .9) 0%,
10350
+ rgba(from var(--marker-color) r g b / .7) 30%,
10351
+ rgba(from var(--marker-color) r g b / .3) 70%,
10352
+ rgba(from var(--marker-color) r g b / 0) 100%);
10353
+ }
10354
+
10355
+ .navi_debug_marker_label {
10356
+ color: rgb(from var(--marker-color) r g b / 1);
10357
+ white-space: nowrap;
10358
+ border: 1px solid;
10359
+ border-color: rgb(from var(--marker-color) r g b / 1);
10360
+ pointer-events: none;
10361
+ background: #ffffffe6;
10362
+ border-radius: 3px;
10363
+ padding: 2px 6px;
10364
+ font-size: 12px;
10365
+ font-weight: bold;
10366
+ position: absolute;
10367
+ }
10368
+
10369
+ .navi_debug_marker[data-left] .navi_debug_marker_label {
10370
+ transform-origin: 0;
10371
+ top: 20px;
10372
+ left: 10px;
10373
+ transform: rotate(90deg);
10374
+ }
10375
+
10376
+ .navi_debug_marker[data-right] .navi_debug_marker_label {
10377
+ transform-origin: 100%;
10378
+ top: 20px;
10379
+ left: auto;
10380
+ right: 10px;
10381
+ transform: rotate(-90deg);
10382
+ }
10383
+
10384
+ .navi_debug_marker[data-top] .navi_debug_marker_label {
10385
+ top: 0;
10386
+ left: 20px;
10387
+ }
10388
+
10389
+ .navi_debug_marker[data-bottom] .navi_debug_marker_label {
10390
+ top: auto;
10391
+ bottom: 0;
10392
+ left: 20px;
10393
+ }
10394
+
10395
+ .navi_obstacle_marker {
10396
+ z-index: 9999;
10397
+ opacity: .6;
10398
+ pointer-events: none;
10399
+ background-color: orange;
10400
+ position: absolute;
10401
+ }
10402
+
10403
+ .navi_obstacle_marker_label {
10404
+ color: #fff;
10405
+ text-shadow: 1px 1px 1px #000c;
10406
+ pointer-events: none;
10407
+ font-size: 12px;
10408
+ font-weight: bold;
10409
+ position: absolute;
10410
+ top: 50%;
10411
+ left: 50%;
10412
+ transform: translate(-50%, -50%);
10413
+ }
10414
+
10415
+ .navi_element_marker {
10416
+ z-index: 9997;
10417
+ background-color: var(--element-color-alpha, #ff00964d);
10418
+ border: 2px solid var(--element-color, #ff0096);
10419
+ opacity: .9;
10420
+ pointer-events: none;
10421
+ position: absolute;
10422
+ }
10423
+
10424
+ .navi_element_marker_label {
10425
+ color: var(--element-color, #ff0096);
10426
+ white-space: nowrap;
10427
+ border: 1px solid var(--element-color, #ff0096);
10428
+ pointer-events: none;
10429
+ background: #ffffffe6;
10430
+ border-radius: 3px;
10431
+ padding: 2px 6px;
10432
+ font-size: 11px;
10433
+ font-weight: bold;
10434
+ position: absolute;
10435
+ top: -25px;
10436
+ right: 0;
10437
+ }
10438
+
10439
+ .navi_reference_element_marker {
10440
+ z-index: 9998;
10441
+ opacity: .8;
10442
+ pointer-events: none;
10443
+ background-color: #0096ff4d;
10444
+ border: 2px dashed #0096ffb3;
10445
+ position: absolute;
10446
+ }
10447
+
10448
+ .navi_reference_element_marker_label {
10449
+ color: #0096ff;
10450
+ white-space: nowrap;
10451
+ pointer-events: none;
10452
+ background: #ffffffe6;
10453
+ border: 1px solid #0096ffb3;
10454
+ border-radius: 3px;
10455
+ padding: 2px 6px;
10456
+ font-size: 11px;
10457
+ font-weight: bold;
10458
+ position: absolute;
10459
+ top: -25px;
10460
+ left: 0;
10461
+ }
10507
10462
  `;
10508
10463
  const setupDragDebugMarkers = (dragGesture, {
10509
10464
  referenceElement
@@ -11839,222 +11794,151 @@ const dragStyleController = createStyleController("drag_to_move");
11839
11794
  const TOSS_DURATION_MS = 320;
11840
11795
  // Far enough to be off any screen, in the direction the hand was going.
11841
11796
  const TOSS_DISTANCE = 900;
11842
- const css$1 = /* css */`
11843
- /* IT COSTS THE LIST NOTHING: the hint lands on the edge of a row, which for
11844
- the last one is the very bottom of the scroll area — a line taking up room
11845
- there would push the scrollable area a few pixels further and make a
11846
- scrollbar appear (or hide the hint under it) exactly when one is trying to
11847
- drop at the end. Being fixed is what avoids it: a fixed box has the
11848
- viewport as containing block, so it is left out of the scrollable overflow
11849
- of every ancestor and can overhang the list freely. Same for the clone it
11850
- accompanies. */
11851
- .navi_drop_hint {
11852
- /* A popover, so it lands in the top layer: no z-index to bid against the
11853
- page, and nothing it can be hidden behind. Shown BEFORE the clone, which
11854
- is what puts the clone above it — the top layer stacks in the order
11855
- things are shown, and the item being carried should pass over the line
11856
- rather than under it. The UA styles for [popover] have to be undone:
11857
- inset:0, margin:auto, a border and a background of its own. */
11858
- position: fixed;
11859
- inset: auto;
11860
- top: var(--drop-hint-y);
11861
- left: calc(var(--drop-target-left) + var(--drop-hint-margin-x, 0px));
11862
- display: none;
11863
- box-sizing: border-box;
11864
- width: calc(var(--drop-target-width) - 2 * var(--drop-hint-margin-x, 0px));
11865
- height: var(--drop-hint-size, 3px);
11866
- margin: 0;
11867
- padding: 0;
11868
- color: inherit;
11869
- background: var(--drop-hint-background-color, #4476ff);
11870
- border: none;
11871
- border-radius: var(--drop-hint-border-radius, 2px);
11872
- transform: translateY(-50%);
11873
- pointer-events: none;
11874
- overflow: visible;
11875
- }
11876
- .navi_drop_hint[data-drop-edge]:popover-open {
11877
- display: block;
11878
- }
11879
- .navi_drop_hint[data-drop-edge="top"] {
11880
- --drop-hint-y: calc(
11881
- var(--drop-target-top) - var(--drop-hint-margin-y, 0px)
11882
- );
11883
- }
11884
- .navi_drop_hint[data-drop-edge="bottom"] {
11885
- --drop-hint-y: calc(
11886
- var(--drop-target-bottom) + var(--drop-hint-margin-y, 0px)
11887
- );
11888
- }
11889
- /* A chevron at each end, pointing in: the line alone is easy to lose against
11890
- a list of borders and separators, two arrows read as "here" at a glance
11891
- (same idea as the table's column drop preview). They overhang the line,
11892
- which costs nothing to a box left out of the scrollable area — and the more
11893
- they stick out, the easier they are to spot. */
11894
- .navi_drop_hint_cap {
11895
- position: absolute;
11896
- top: 50%;
11897
- display: flex;
11898
- color: var(--drop-hint-background-color, #4476ff);
11899
- translate: 0 -50%;
11900
- }
11901
- .navi_drop_hint_cap svg {
11902
- width: var(--drop-hint-arrow-size, 11px);
11903
- height: var(--drop-hint-arrow-size, 11px);
11904
- }
11905
- .navi_drop_hint_cap[data-side="start"] {
11906
- left: calc(-1 * var(--drop-hint-arrow-size, 11px));
11907
- rotate: -90deg;
11908
- }
11909
- .navi_drop_hint_cap[data-side="end"] {
11910
- right: calc(-1 * var(--drop-hint-arrow-size, 11px));
11911
- rotate: 90deg;
11912
- }
11913
-
11914
- /* WHERE IT LANDS, when landing is ON a thing rather than between two: the
11915
- place itself is lit up, because there is no gap to draw a line in. Fixed
11916
- and in the top layer for the same reasons as the line above. */
11917
- .navi_drop_surface {
11918
- position: fixed;
11919
- inset: auto;
11920
- top: var(--drop-target-top);
11921
- left: var(--drop-target-left);
11922
- display: none;
11923
- box-sizing: border-box;
11924
- width: var(--drop-target-width);
11925
- height: var(--drop-target-height);
11926
- margin: 0;
11927
- padding: 0;
11928
- color: inherit;
11929
- background: var(--drop-surface-background-color, rgba(68, 118, 255, 0.16));
11930
- border: var(--drop-surface-border-width, 2px) solid
11797
+ const css$1 = /* css */`.navi_drop_hint {
11798
+ inset: auto;
11799
+ top: var(--drop-hint-y);
11800
+ left: calc(var(--drop-target-left) + var(--drop-hint-margin-x, 0px));
11801
+ box-sizing: border-box;
11802
+ width: calc(var(--drop-target-width) - 2 * var(--drop-hint-margin-x, 0px));
11803
+ height: var(--drop-hint-size, 3px);
11804
+ color: inherit;
11805
+ background: var(--drop-hint-background-color, #4476ff);
11806
+ border-radius: var(--drop-hint-border-radius, 2px);
11807
+ pointer-events: none;
11808
+ border: none;
11809
+ margin: 0;
11810
+ padding: 0;
11811
+ display: none;
11812
+ position: fixed;
11813
+ overflow: visible;
11814
+ transform: translateY(-50%);
11815
+ }
11816
+
11817
+ .navi_drop_hint[data-drop-edge]:popover-open {
11818
+ display: block;
11819
+ }
11820
+
11821
+ .navi_drop_hint[data-drop-edge="top"] {
11822
+ --drop-hint-y: calc(var(--drop-target-top) - var(--drop-hint-margin-y, 0px));
11823
+ }
11824
+
11825
+ .navi_drop_hint[data-drop-edge="bottom"] {
11826
+ --drop-hint-y: calc(var(--drop-target-bottom) + var(--drop-hint-margin-y, 0px));
11827
+ }
11828
+
11829
+ .navi_drop_hint_cap {
11830
+ color: var(--drop-hint-background-color, #4476ff);
11831
+ display: flex;
11832
+ position: absolute;
11833
+ top: 50%;
11834
+ translate: 0 -50%;
11835
+ }
11836
+
11837
+ .navi_drop_hint_cap svg {
11838
+ width: var(--drop-hint-arrow-size, 11px);
11839
+ height: var(--drop-hint-arrow-size, 11px);
11840
+ }
11841
+
11842
+ .navi_drop_hint_cap[data-side="start"] {
11843
+ left: calc(-1 * var(--drop-hint-arrow-size, 11px));
11844
+ rotate: -90deg;
11845
+ }
11846
+
11847
+ .navi_drop_hint_cap[data-side="end"] {
11848
+ right: calc(-1 * var(--drop-hint-arrow-size, 11px));
11849
+ rotate: 90deg;
11850
+ }
11851
+
11852
+ .navi_drop_surface {
11853
+ inset: auto;
11854
+ top: var(--drop-target-top);
11855
+ left: var(--drop-target-left);
11856
+ box-sizing: border-box;
11857
+ width: var(--drop-target-width);
11858
+ height: var(--drop-target-height);
11859
+ color: inherit;
11860
+ background: var(--drop-surface-background-color, #4476ff29);
11861
+ border: var(--drop-surface-border-width, 2px) solid
11931
11862
  var(--drop-surface-border-color, #4476ff);
11932
- border-radius: var(--drop-surface-border-radius, 6px);
11933
- pointer-events: none;
11934
- overflow: visible;
11935
- }
11936
- .navi_drop_surface[data-drop-over]:popover-open {
11937
- display: block;
11938
- }
11939
-
11940
- /* WHO CAN START A DRAG, said in the cursor.
11941
- A handle exists only to drag, so it shows the hand. A source does not, and
11942
- the gesture must not claim its cursor: it drags only once the intent shows
11943
- (a few pixels of travel, or a long press), a plain click on it stays a
11944
- click, and it is usually something else FIRST — a link, a card one opens.
11945
- The cursor says what the element is, and a hand insisting on the one thing
11946
- it can also be would talk over that. So it is left alone — default, and not
11947
- an I-beam, because dragging across the text does not select it (the gesture
11948
- takes the pointer; see the selectstart refused in drag_gesture.js) — and
11949
- whoever puts the drag there asks for the hand when a grab really is the
11950
- first thing the element offers.
11951
- An opted-out area keeps both its cursor and its selection, and never starts
11952
- a drag (see the check in startDragTo); a popover or a dialog anchored in a
11953
- source is one without having to say so.
11954
- Controls inside a source keep their own cursor: cursor is inherited, and
11955
- anything setting its own (a button's pointer) wins on itself.
11956
- Only the resting cursor is set here: what it becomes once a drag is under
11957
- way belongs to the gesture (see the backdrop in drag_gesture.js), the only
11958
- thing that knows a drag actually started. */
11959
- [data-drag-handle] {
11960
- cursor: grab;
11961
- }
11962
- [data-drag-source] {
11963
- cursor: default;
11964
- }
11965
- [data-drag-ignore],
11966
- [data-own-target],
11967
- [data-drag-source] [popover],
11968
- [data-drag-source] dialog {
11969
- cursor: auto;
11970
- }
11971
-
11972
- [navi-drag-clone-source] {
11973
- visibility: hidden;
11974
- }
11975
-
11976
- [navi-drag-clone-wrapper] {
11977
- /* Also a popover (see .navi_drop_hint): in the top layer it is over the
11978
- page whatever the page's own stacking is, and the coordinates it is
11979
- given are viewport ones — which is what the pointer carrying it works
11980
- in. Same UA-style reset as the hint. */
11981
- position: fixed;
11982
- inset: auto;
11983
- top: var(--clone-top);
11984
- left: var(--clone-left);
11985
- box-sizing: border-box;
11986
- width: var(--clone-width);
11987
- height: var(--clone-height);
11988
- margin: 0;
11989
- padding: 0;
11990
- color: inherit;
11991
- background: transparent;
11992
- border: none;
11993
- /* Carries the chain down to the copy, for an item whose own radius is an
11994
- "inherit" from the list around it. */
11995
- border-radius: inherit;
11996
- opacity: 0.95;
11997
- pointer-events: none;
11998
- /* Nothing in a copy being carried by a pointer is text to select: the
11999
- selection belongs to the original, which is still in the page. This is the
12000
- one place the rule is unconditional — an element that can be dragged is
12001
- usually selectable too (a link is both), and forcing it there would take
12002
- away a selection made from outside the element. */
12003
- user-select: none;
12004
- overflow: visible;
12005
- }
12006
-
12007
- /* On its way home and still the object: the hand can reach for it there, so
12008
- there it takes the pointer — which it must not do at any other moment of the
12009
- gesture, or it would hide what it is being dropped on. */
12010
- [navi-drag-clone-wrapper][data-catchable] {
12011
- pointer-events: auto;
12012
- }
12013
-
12014
- /* …and a FINGER reaching for it does not land on it: the pictures of the
12015
- transition cover the page, so as far as the browser is concerned the touch
12016
- began on the document root. What a touch may do is decided there and at that
12017
- moment, so the root says it for as long as the copy can be caught — the pan
12018
- is ours (nothing should scroll while something is landing), zoom stays the
12019
- reader's. Half of a pair: without the non-passive listener put down at the
12020
- same moment (see letCopyBeCaught) every touchmove arrives already
12021
- non-cancelable and refusing it does nothing. */
12022
- [data-drag-catchable] {
12023
- touch-action: pinch-zoom;
12024
- }
12025
-
12026
- /* Ce qui a été lancé: il continue dans la direction du geste jusqu'à sortir de
12027
- l'écran, et revient par le même chemin si la réponse refuse. */
12028
- [navi-drag-clone-wrapper][data-tossed] {
12029
- transition:
12030
- translate ${TOSS_DURATION_MS}ms ease-out,
11863
+ border-radius: var(--drop-surface-border-radius, 6px);
11864
+ pointer-events: none;
11865
+ margin: 0;
11866
+ padding: 0;
11867
+ display: none;
11868
+ position: fixed;
11869
+ overflow: visible;
11870
+ }
11871
+
11872
+ .navi_drop_surface[data-drop-over]:popover-open {
11873
+ display: block;
11874
+ }
11875
+
11876
+ [data-drag-handle] {
11877
+ cursor: grab;
11878
+ }
11879
+
11880
+ [data-drag-source] {
11881
+ cursor: default;
11882
+ }
11883
+
11884
+ [data-drag-ignore], [data-self-interactions~="drag"], [data-self-interactions~="*"], [data-drag-source] [popover], [data-drag-source] dialog {
11885
+ cursor: auto;
11886
+ }
11887
+
11888
+ [navi-drag-clone-source] {
11889
+ visibility: hidden;
11890
+ }
11891
+
11892
+ [navi-drag-clone-wrapper] {
11893
+ inset: auto;
11894
+ top: var(--clone-top);
11895
+ left: var(--clone-left);
11896
+ box-sizing: border-box;
11897
+ width: var(--clone-width);
11898
+ height: var(--clone-height);
11899
+ color: inherit;
11900
+ border-radius: inherit;
11901
+ opacity: .95;
11902
+ pointer-events: none;
11903
+ user-select: none;
11904
+ background: none;
11905
+ border: none;
11906
+ margin: 0;
11907
+ padding: 0;
11908
+ position: fixed;
11909
+ overflow: visible;
11910
+ }
11911
+
11912
+ [navi-drag-clone-wrapper][data-catchable] {
11913
+ pointer-events: auto;
11914
+ }
11915
+
11916
+ [data-drag-catchable] {
11917
+ touch-action: pinch-zoom;
11918
+ }
11919
+
11920
+ [navi-drag-clone-wrapper][data-tossed] {
11921
+ transition: translate ${TOSS_DURATION_MS}ms ease-out,
12031
11922
  opacity ${TOSS_DURATION_MS}ms ease-out;
12032
- }
12033
- [navi-drag-clone-wrapper][data-tossed="away"] {
12034
- opacity: 0;
12035
- }
11923
+ }
11924
+
11925
+ [navi-drag-clone-wrapper][data-tossed="away"] {
11926
+ opacity: 0;
11927
+ }
12036
11928
 
11929
+ [navi-drag-clone] {
11930
+ box-shadow: var(--drag-clone-shadow, 0 12px 28px #00000038);
11931
+ transform: scale(var(--drag-clone-scale, 1.03));
11932
+ transform-origin: var(--drag-origin);
11933
+ transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .15s;
11934
+ }
11935
+
11936
+ @starting-style {
12037
11937
  [navi-drag-clone] {
12038
- /* Cast by the copy itself rather than by the box around it, so it takes the
12039
- shape of the thing — a rounded row throws a rounded shadow. Its value is a
12040
- var read on the copy, which IS the dragged element: what being carried
12041
- looks like belongs to whoever owns the thing — a row lifted off a list
12042
- wants this shadow, a sheet of paper leaving a board wants none, and its
12043
- shade is a theme's business either way. */
12044
- box-shadow: var(--drag-clone-shadow, 0 12px 28px rgba(0, 0, 0, 0.22));
12045
- transform: scale(var(--drag-clone-scale, 1.03));
12046
- transform-origin: var(--drag-origin);
12047
- transition:
12048
- transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
12049
- box-shadow 0.15s ease;
12050
- }
12051
-
12052
- @starting-style {
12053
- [navi-drag-clone] {
12054
- box-shadow: none;
12055
- transform: scale(1);
12056
- }
11938
+ box-shadow: none;
11939
+ transform: scale(1);
12057
11940
  }
11941
+ }
12058
11942
  `;
12059
11943
  // At module scope, not inside startDragTo: the cursor rules above say who
12060
11944
  // can start a drag, and they have to be true BEFORE anyone drags anything.
@@ -12062,15 +11946,19 @@ import.meta.css = [css$1, "@jsenv/dom/src/interaction/drag/drag_to.js"];
12062
11946
 
12063
11947
  // What a press must not be read from at all. `data-drag-ignore` is said by
12064
11948
  // something whose press is its own business — a text one wants to select, a
12065
- // control that reads the pointer itself. `data-own-target` is the same fact said
12066
- // once for every gesture there is: an element declaring that a press landing on
12067
- // it is aimed AT it, whatever it happens to sit inside (see also
12068
- // DRAG_EXCLUDED_SELECTOR in drag_to_travel.js). A popover or a dialog says it
12069
- // without being asked: it is a layer OVER the surface, so a press in it is aimed
12070
- // at the layer — yet it stays a descendant of whatever it is anchored in (a
12071
- // callout next to a button, in the card that carries both), and the press
12072
- // bubbles through the surface as if it had landed on it.
12073
- const DRAG_IGNORED_SELECTOR = "[data-drag-ignore],[data-own-target],[popover],dialog";
11949
+ // control that reads the pointer itself — and it means every gesture at once.
11950
+ // `data-self-interactions` says a narrower thing, and says which: an element
11951
+ // declaring the interactions that are ITS own, whatever it happens to sit
11952
+ // inside, the rest being left to what it sits in. Only the ones naming `drag`
11953
+ // take the grab away from the surface (see also DRAG_EXCLUDED_SELECTOR in
11954
+ // drag_to_travel.js) — an affordance that took the click alone is one a finger
11955
+ // may still pick the object up by, which is what it is for when it covers a real
11956
+ // part of that object. A popover or a dialog says it without being asked: it is
11957
+ // a layer OVER the surface, so a press in it is aimed at the layer — yet it
11958
+ // stays a descendant of whatever it is anchored in (a callout next to a button,
11959
+ // in the card that carries both), and the press bubbles through the surface as
11960
+ // if it had landed on it.
11961
+ const DRAG_IGNORED_SELECTOR = '[data-drag-ignore],[data-self-interactions~="drag"],[data-self-interactions~="*"],[popover],dialog';
12074
11962
 
12075
11963
  /**
12076
11964
  * Starts a drag-to-reorder interaction on a list item.
@@ -13519,12 +13407,12 @@ const DRAG_RESISTANCE = 0.3;
13519
13407
  // out. A drag SOURCE is not either: it says which way it goes and only takes
13520
13408
  // that (see DRAG_SOURCE_AXES_ATTRIBUTE) — but a dedicated handle is, being a
13521
13409
  // place whose only purpose is to be taken hold of, from the first pixel. And so
13522
- // is an OWN TARGET: an element saying a press landing on it is aimed at IT,
13523
- // which is the same sentence said to every gesture at once rather than to this
13524
- // one (see DRAG_IGNORED_SELECTOR in drag_to.js). And so is a popover or a
13525
- // dialog: a layer OVER the box, whose press only bubbles through the box because
13526
- // the layer is anchored in it.
13527
- const DRAG_EXCLUDED_SELECTOR = ["input", "textarea", "select", '[contenteditable=""]', '[contenteditable="true"]', "[data-drag-handle]", "[data-no-drag-travel]", "[data-own-target]", "[popover]", "dialog"].join(",");
13410
+ // is an element naming `drag` among its own interactions: it said the grab is
13411
+ // ITS, here, rather than the box's — and one that named only the click said
13412
+ // nothing to this gesture and is passed through (see DRAG_IGNORED_SELECTOR in
13413
+ // drag_to.js). And so is a popover or a dialog: a layer OVER the box, whose
13414
+ // press only bubbles through the box because the layer is anchored in it.
13415
+ const DRAG_EXCLUDED_SELECTOR = ["input", "textarea", "select", '[contenteditable=""]', '[contenteditable="true"]', "[data-drag-handle]", "[data-no-drag-travel]", '[data-self-interactions~="drag"]', '[data-self-interactions~="*"]', "[popover]", "dialog"].join(",");
13528
13416
 
13529
13417
  // Which axes a box travels on, one attribute per gesture, said in the DOM by
13530
13418
  // whoever owns the box: it is what a box ABOVE another reads to know the
@@ -14540,13 +14428,12 @@ installImportMetaCssBuild(import.meta);/**
14540
14428
  *
14541
14429
  * The element should have a CSS "top" value specified (e.g., top: 10px).
14542
14430
  */
14543
- const css = /* css */`
14544
- [data-position-sticky-placeholder] {
14545
- position: static !important;
14546
- width: auto !important;
14547
- height: auto !important;
14548
- opacity: 0 !important;
14549
- }
14431
+ const css = /* css */`[data-position-sticky-placeholder] {
14432
+ opacity: 0 !important;
14433
+ width: auto !important;
14434
+ height: auto !important;
14435
+ position: static !important;
14436
+ }
14550
14437
  `;
14551
14438
  const initPositionSticky = element => {
14552
14439
  import.meta.css = [css, "@jsenv/dom/src/position/position_sticky.js"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/dom",
3
- "version": "0.17.34",
3
+ "version": "0.17.36",
4
4
  "type": "module",
5
5
  "description": "DOM utilities for writing frontend code",
6
6
  "repository": {