@onlyworlds/sdk 4.117.1 → 4.117.2
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/CHANGELOG.md +6 -0
- package/dist/waymark.css +54 -0
- package/dist/waymark.d.ts +4 -3
- package/dist/waymark.js +16 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.117.2] - 2026-10-30
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **The Waymark opens as the sheet when neither side fits.** Wider than 480 px, a fan-out whose start would cross the right edge of the box that clips it and whose end would cross its left edge (a mark in the middle of a narrow window, or of a narrow pane) took the side that crossed less and still left the box: in a 481 px window, a mark at 196 to 235 px opened its 300 px pop from 187 to 487, 6 px past the edge. The same holds for below and above. Now the open puts `ow-waymark--sheet` on the wrapper and the stylesheet draws the sheet from the bottom, the layout it already draws at 480 px and below (rows at least 44 px, the page behind dimmed), and no side class is set. A side is taken only where it fits, so `--end` and `--up` mean the pop lies inside the box. "Link copied", shown after the fan-out closes, keeps the sheet's place until it hides. The sheet's rules under the class are the media block's, declaration for declaration, held by a test. No node carries a style attribute.
|
|
13
|
+
|
|
8
14
|
## [4.117.1] - 2026-10-30
|
|
9
15
|
|
|
10
16
|
### Changed
|
package/dist/waymark.css
CHANGED
|
@@ -328,6 +328,60 @@
|
|
|
328
328
|
outline-offset: 1px;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
+
/* Wider than 480 px, when neither side of an axis fits the box that clips the fan-out (a mark
|
|
332
|
+
mid-window in a narrow window, or in a narrow pane): the same sheet as below, by the class the open
|
|
333
|
+
puts on the wrapper. Each rule here is the media block's, declaration for declaration. */
|
|
334
|
+
.ow-waymark--sheet .ow-waymark__scrim {
|
|
335
|
+
display: block;
|
|
336
|
+
position: fixed;
|
|
337
|
+
inset: 0;
|
|
338
|
+
z-index: 999;
|
|
339
|
+
background: var(--ow-waymark-page);
|
|
340
|
+
opacity: 0.6;
|
|
341
|
+
}
|
|
342
|
+
.ow-waymark--sheet .ow-waymark__pop {
|
|
343
|
+
position: fixed;
|
|
344
|
+
top: auto;
|
|
345
|
+
right: 0;
|
|
346
|
+
bottom: 0;
|
|
347
|
+
left: 0;
|
|
348
|
+
width: auto;
|
|
349
|
+
max-width: none;
|
|
350
|
+
max-height: 85vh;
|
|
351
|
+
overflow-y: auto;
|
|
352
|
+
padding: 8px 14px 18px;
|
|
353
|
+
border-width: 1px 0 0;
|
|
354
|
+
border-radius: 18px 18px 0 0;
|
|
355
|
+
box-shadow: none;
|
|
356
|
+
}
|
|
357
|
+
.ow-waymark--sheet .ow-waymark__grab {
|
|
358
|
+
display: block;
|
|
359
|
+
width: 40px;
|
|
360
|
+
height: 4px;
|
|
361
|
+
margin: 0 auto 8px;
|
|
362
|
+
border-radius: 2px;
|
|
363
|
+
background: var(--ow-waymark-line);
|
|
364
|
+
}
|
|
365
|
+
.ow-waymark--sheet .ow-waymark__row {
|
|
366
|
+
min-height: 44px;
|
|
367
|
+
padding: 12px 6px;
|
|
368
|
+
font-size: 15px;
|
|
369
|
+
}
|
|
370
|
+
.ow-waymark--sheet .ow-waymark__row--lens {
|
|
371
|
+
padding-left: 30px;
|
|
372
|
+
}
|
|
373
|
+
.ow-waymark--sheet .ow-waymark__toast {
|
|
374
|
+
position: fixed;
|
|
375
|
+
top: auto;
|
|
376
|
+
bottom: 24px;
|
|
377
|
+
left: 50%;
|
|
378
|
+
transform: translateX(-50%);
|
|
379
|
+
}
|
|
380
|
+
.ow-waymark--sheet .ow-waymark__pop:not([hidden]) ~ .ow-waymark__toast {
|
|
381
|
+
top: 16px;
|
|
382
|
+
bottom: auto;
|
|
383
|
+
}
|
|
384
|
+
|
|
331
385
|
/* 480 px wide and below: a sheet from the bottom, the page behind dimmed, rows tall enough to touch.
|
|
332
386
|
Portrait phones run to about 430 px, so every one gets the sheet with room to spare, and so does a
|
|
333
387
|
desktop window as narrow: by width alone, whatever the pointer. */
|
package/dist/waymark.d.ts
CHANGED
|
@@ -98,9 +98,10 @@ interface OwWaymark {
|
|
|
98
98
|
* Placement: below the name at its start, unless it would cross the box that clips it (the nearest
|
|
99
99
|
* ancestor of `target` whose overflow on that axis is not visible, within the window, else the window):
|
|
100
100
|
* measured at each open, it then opens at the name's end (class `ow-waymark__pop--end`) or above the
|
|
101
|
-
* name (`ow-waymark__pop--up`), where that side
|
|
102
|
-
*
|
|
103
|
-
*
|
|
101
|
+
* name (`ow-waymark__pop--up`), where that side fits; the toast takes the same side. When neither side
|
|
102
|
+
* of an axis fits (a mark mid-window in a narrow window, or in a narrow pane), it opens as the sheet
|
|
103
|
+
* from the bottom (class `ow-waymark--sheet` on the wrapper). At 480 px wide and below (every portrait
|
|
104
|
+
* phone, and a desktop window as narrow) the stylesheet draws it as that sheet, and no side is chosen. The page must load `@onlyworlds/sdk/waymark.css`; no
|
|
104
105
|
* node carries a style attribute.
|
|
105
106
|
*
|
|
106
107
|
* Refuses, before anything is drawn, an unknown option key by name and a value of the wrong kind (a
|
package/dist/waymark.js
CHANGED
|
@@ -50,6 +50,7 @@ var POP_END = "ow-waymark__pop--end";
|
|
|
50
50
|
var POP_UP = "ow-waymark__pop--up";
|
|
51
51
|
var TOAST_END = "ow-waymark__toast--end";
|
|
52
52
|
var TOAST_UP = "ow-waymark__toast--up";
|
|
53
|
+
var SHEET = "ow-waymark--sheet";
|
|
53
54
|
var COPIED = "Link copied";
|
|
54
55
|
var NOT_COPIED = "Could not copy the link.";
|
|
55
56
|
var HERE = "You are here";
|
|
@@ -320,20 +321,28 @@ function mountWaymark(target, options) {
|
|
|
320
321
|
}
|
|
321
322
|
return [0, edge];
|
|
322
323
|
};
|
|
324
|
+
let sheetAtOpen = false;
|
|
323
325
|
const placePop = () => {
|
|
324
326
|
pop.classList.remove(POP_END, POP_UP);
|
|
327
|
+
root.classList.remove(SHEET);
|
|
325
328
|
let end = false;
|
|
326
329
|
let up = false;
|
|
330
|
+
let sheet = false;
|
|
327
331
|
if (win !== null && win.getComputedStyle(pop).position !== "fixed") {
|
|
328
332
|
const at = pop.getBoundingClientRect();
|
|
329
333
|
const anchor = root.getBoundingClientRect();
|
|
330
334
|
const [left, right] = clipBox(win, "x");
|
|
331
335
|
const [top, bottom] = clipBox(win, "y");
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
+
const startCrosses = at.right > right;
|
|
337
|
+
const endCrosses = anchor.right - at.width < left;
|
|
338
|
+
const belowCrosses = at.bottom > bottom;
|
|
339
|
+
const aboveCrosses = anchor.top - GAP - at.height < top;
|
|
340
|
+
sheet = startCrosses && endCrosses || belowCrosses && aboveCrosses;
|
|
341
|
+
end = !sheet && startCrosses;
|
|
342
|
+
up = !sheet && belowCrosses;
|
|
336
343
|
}
|
|
344
|
+
sheetAtOpen = sheet;
|
|
345
|
+
root.classList.toggle(SHEET, sheet);
|
|
337
346
|
pop.classList.toggle(POP_END, end);
|
|
338
347
|
pop.classList.toggle(POP_UP, up);
|
|
339
348
|
toast.classList.toggle(TOAST_END, end);
|
|
@@ -355,6 +364,7 @@ function mountWaymark(target, options) {
|
|
|
355
364
|
const hideToast = () => {
|
|
356
365
|
toast.hidden = true;
|
|
357
366
|
toast.classList.remove(TOAST_END, TOAST_UP);
|
|
367
|
+
if (pop.hidden) root.classList.remove(SHEET);
|
|
358
368
|
};
|
|
359
369
|
const close = (refocus) => {
|
|
360
370
|
if (!isOpen()) return;
|
|
@@ -368,10 +378,12 @@ function mountWaymark(target, options) {
|
|
|
368
378
|
addressLine.hidden = true;
|
|
369
379
|
toast.classList.remove("ow-waymark__toast--failed");
|
|
370
380
|
}
|
|
381
|
+
if (toast.hidden) root.classList.remove(SHEET);
|
|
371
382
|
if (refocus) focusBack().focus();
|
|
372
383
|
};
|
|
373
384
|
const copied = () => {
|
|
374
385
|
toastWords.textContent = COPIED;
|
|
386
|
+
root.classList.toggle(SHEET, sheetAtOpen);
|
|
375
387
|
toast.hidden = false;
|
|
376
388
|
if (toastTimer !== null) timers.clearTimeout(toastTimer);
|
|
377
389
|
toastTimer = timers.setTimeout(() => {
|