gesso-core 0.6.17 → 0.6.19
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 +18 -0
- package/dist/{CanvasSurface-cRmWIUfC.js → CanvasSurface-tAao5BLh.js} +135 -30
- package/dist/CanvasSurface-tAao5BLh.js.map +1 -0
- package/dist/{index-Dc-g1Qk2.d.ts → index-8yhrkCnb.d.ts} +86 -10
- package/dist/index.d.ts +2 -2
- package/dist/index.js +42 -7
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/CanvasSurface-cRmWIUfC.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# gesso-core
|
|
2
2
|
|
|
3
|
+
## 0.6.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c047559: An empty lazy list laid out at no size, as one not shown yet is, no longer counts toward the warning that a list's viewport is the size of its content. Zero against zero said nothing about the list, but it was one of the two landings the warning waits for, so a single resize that happened to match the content later was enough to warn about a list that was bounded all along.
|
|
8
|
+
- `pointerEvents` now inherits the way CSS's `pointer-events` does. A node under `pointerEvents: 'none'` is passed over by hit testing, but its children are still tested, and one that sets `pointerEvents: 'auto'` takes presses again. Before, `'none'` cut the whole subtree out with no way back, so a popup set to `'auto'` inside an overlay set to `'none'` (to let presses through to what is under it) could never be clicked: the press went through it to whatever was beneath. Focus and the keyboard are unchanged: `'none'` on a node itself still keeps it from both. `pointerEventsOf(node)` gives a node's inherited value.
|
|
9
|
+
|
|
10
|
+
## 0.6.18
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 3ca92f7: `withContrast(theme, 'high', { surfaces })` and `highContrastColors(colors, { surfaces })` leave the names a custom palette says are grounds as they leave the stock ones. Every name a palette added was raised as a foreground against the page, so a code editor's selection or a diff's filled lines turned bright enough that what was drawn on them could not be read.
|
|
15
|
+
- 7da31d2: A text with `textOverflow: 'ellipsis'` that has no room for even the ellipsis draws nothing, as a hidden overflow clips it in CSS. Squeezed to nothing beside other text (a folder's name after a long file name, in a row that shrinks it first), it drew whole, since a zero width is measured as no limit, or as an ellipsis wider than its box, over whatever came after it. Both renderers place text through `layoutTextLines`, so both agree.
|
|
16
|
+
- 32f00f4: A hard line that fits whole is not broken. Line breaking added up its pieces' widths, which a font that kerns across a join ("grid-" and "test.ts") makes wider than the line measured whole, the width a box sized to its own text is given; such a line broke at the hyphen and drew "grid-…" with room to spare.
|
|
17
|
+
- 4a73051: `orientation` says which way a tablist, toolbar, list or separator runs when it is not the way its role assumes, and the semantics mirror sets `aria-orientation` from it. A column of tabs, as an activity bar is, was announced as horizontal, so a screen reader told its user to press Left and Right; with `orientation: 'vertical'` it says Up and Down.
|
|
18
|
+
- 95a6503: A focusable node inside a role whose children are presentational (a button inside a button) is warned of, once, in the console. ARIA hides it, so it has no record in the mirror and Tab stops on it in silence; nothing said so until a Tab walk found the silence.
|
|
19
|
+
- 1b6e6a7: Recolouring a text's runs is a repaint. A change to `spans` that keeps every run's text and font and changes only its colour, background or decoration marks paint and nothing else; before, it measured the text again and rebuilt its semantics, which is what a code editor colouring a line a frame after drawing it paid on every line, on every keystroke.
|
|
20
|
+
|
|
3
21
|
## 0.6.17
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1704,6 +1704,20 @@ function textSpansEqual(a, b) {
|
|
|
1704
1704
|
for (let i = 0; i < a.length; i++) if (!spansEqual(a[i], b[i])) return false;
|
|
1705
1705
|
return true;
|
|
1706
1706
|
}
|
|
1707
|
+
/**
|
|
1708
|
+
* Whether two lists of runs are the same text, set the same way, and
|
|
1709
|
+
* differ at most in colour, background and decoration, which are drawn
|
|
1710
|
+
* rather than measured.
|
|
1711
|
+
*/
|
|
1712
|
+
function spansDifferOnlyInPaint(a, b) {
|
|
1713
|
+
if (a === void 0 || b === void 0 || a.length !== b.length) return false;
|
|
1714
|
+
for (let i = 0; i < a.length; i++) {
|
|
1715
|
+
const x = a[i];
|
|
1716
|
+
const y = b[i];
|
|
1717
|
+
if (x.text !== y.text || x.fontFamily !== y.fontFamily || x.fontSize !== y.fontSize || x.fontWeight !== y.fontWeight || x.fontStyle !== y.fontStyle || x.fontStretch !== y.fontStretch || x.fontVariant !== y.fontVariant || x.fontKerning !== y.fontKerning || x.letterSpacing !== y.letterSpacing || x.hidden !== y.hidden || x.link !== y.link) return false;
|
|
1718
|
+
}
|
|
1719
|
+
return true;
|
|
1720
|
+
}
|
|
1707
1721
|
function spansEqual(a, b) {
|
|
1708
1722
|
return a.text === b.text && a.fontFamily === b.fontFamily && a.fontSize === b.fontSize && a.fontWeight === b.fontWeight && a.fontStyle === b.fontStyle && a.fontStretch === b.fontStretch && a.fontVariant === b.fontVariant && a.fontKerning === b.fontKerning && a.letterSpacing === b.letterSpacing && a.hidden === b.hidden && colorValueEqual(a.color, b.color) && colorValueEqual(a.backgroundColor, b.backgroundColor) && a.textDecoration === b.textDecoration && a.link === b.link;
|
|
1709
1723
|
}
|
|
@@ -2079,15 +2093,17 @@ const FOREGROUNDS = {
|
|
|
2079
2093
|
* Every extra name a custom palette added is raised too, against the
|
|
2080
2094
|
* page background, because a palette that grew a token for its own
|
|
2081
2095
|
* accent should not be the one thing that stays quiet when the setting
|
|
2082
|
-
* is turned on
|
|
2083
|
-
* the surface they are
|
|
2096
|
+
* is turned on; unless it says it is a ground (`surfaces`). The named
|
|
2097
|
+
* foregrounds above override that default with the surface they are
|
|
2098
|
+
* really drawn on.
|
|
2084
2099
|
*/
|
|
2085
|
-
function highContrastColors(colors) {
|
|
2100
|
+
function highContrastColors(colors, options = {}) {
|
|
2101
|
+
const surfaces = /* @__PURE__ */ new Set([...SURFACES, ...options.surfaces ?? []]);
|
|
2086
2102
|
const source = colors;
|
|
2087
2103
|
const raised = { ...source };
|
|
2088
2104
|
for (const name of Object.keys(source)) {
|
|
2089
2105
|
const value = source[name];
|
|
2090
|
-
if (value === void 0 ||
|
|
2106
|
+
if (value === void 0 || surfaces.has(name)) continue;
|
|
2091
2107
|
const against = source[FOREGROUNDS[name] ?? "background"];
|
|
2092
2108
|
if (against === void 0) continue;
|
|
2093
2109
|
raised[name] = raiseContrast(value, against, HIGH_CONTRAST_RATIO);
|
|
@@ -2383,13 +2399,13 @@ function withDensity(theme, density) {
|
|
|
2383
2399
|
* application does anyway, since the setting it follows is a cell and
|
|
2384
2400
|
* both themes exist for the life of the application.
|
|
2385
2401
|
*/
|
|
2386
|
-
function withContrast(theme, contrast) {
|
|
2402
|
+
function withContrast(theme, contrast, options = {}) {
|
|
2387
2403
|
if (theme.contrast === contrast) return theme;
|
|
2388
2404
|
if (contrast === "standard") throw new Error("withContrast cannot lower a raised palette; keep the standard theme and derive the high one.");
|
|
2389
2405
|
return {
|
|
2390
2406
|
...theme,
|
|
2391
2407
|
contrast,
|
|
2392
|
-
colors: highContrastColors(theme.colors)
|
|
2408
|
+
colors: highContrastColors(theme.colors, options)
|
|
2393
2409
|
};
|
|
2394
2410
|
}
|
|
2395
2411
|
//#endregion
|
|
@@ -4117,7 +4133,8 @@ const UiProperties = {
|
|
|
4117
4133
|
defaultValue: void 0,
|
|
4118
4134
|
inherited: false,
|
|
4119
4135
|
affects: 261,
|
|
4120
|
-
compare: textSpansEqual
|
|
4136
|
+
compare: textSpansEqual,
|
|
4137
|
+
narrowEffects: (previous, next, flags) => spansDifferOnlyInPaint(previous, next) ? P : flags
|
|
4121
4138
|
}),
|
|
4122
4139
|
verticalAlign: defineProperty({
|
|
4123
4140
|
name: "verticalAlign",
|
|
@@ -4420,6 +4437,16 @@ const UiProperties = {
|
|
|
4420
4437
|
affects: S
|
|
4421
4438
|
}),
|
|
4422
4439
|
/**
|
|
4440
|
+
* Which way a tablist, toolbar, list or separator runs, when not the
|
|
4441
|
+
* way its role assumes: a column of tabs. See `aria-orientation`.
|
|
4442
|
+
*/
|
|
4443
|
+
orientation: defineProperty({
|
|
4444
|
+
name: "orientation",
|
|
4445
|
+
defaultValue: void 0,
|
|
4446
|
+
inherited: false,
|
|
4447
|
+
affects: S
|
|
4448
|
+
}),
|
|
4449
|
+
/**
|
|
4423
4450
|
* How deep a treeitem sits, 1 for a root. A tree is rendered as a
|
|
4424
4451
|
* flat list of rows — it must be, to be virtualized — so the nesting
|
|
4425
4452
|
* exists nowhere else for a reader to find.
|
|
@@ -6820,18 +6847,21 @@ function layoutParagraph(request, runs) {
|
|
|
6820
6847
|
start: paragraphStart,
|
|
6821
6848
|
text: paragraph,
|
|
6822
6849
|
segments: cached.segments,
|
|
6850
|
+
whole: cached.maxContentWidth,
|
|
6823
6851
|
cached
|
|
6824
6852
|
});
|
|
6825
6853
|
maxContentWidth = Math.max(maxContentWidth, cached.maxContentWidth);
|
|
6826
6854
|
minContentWidth = Math.max(minContentWidth, cached.minContentWidth);
|
|
6827
6855
|
} else {
|
|
6828
6856
|
const segments = segmentParagraph(paragraph, wrap);
|
|
6857
|
+
const whole = measure(paragraph, paragraphStart, paragraphEnd);
|
|
6829
6858
|
paragraphs.push({
|
|
6830
6859
|
start: paragraphStart,
|
|
6831
6860
|
text: paragraph,
|
|
6832
|
-
segments
|
|
6861
|
+
segments,
|
|
6862
|
+
whole
|
|
6833
6863
|
});
|
|
6834
|
-
maxContentWidth = Math.max(maxContentWidth,
|
|
6864
|
+
maxContentWidth = Math.max(maxContentWidth, whole);
|
|
6835
6865
|
for (const segment of segments) minContentWidth = Math.max(minContentWidth, measure(paragraph.slice(segment.start, segment.end), paragraphStart + segment.start, paragraphStart + segment.end));
|
|
6836
6866
|
}
|
|
6837
6867
|
if (paragraphEnd >= text.length) break;
|
|
@@ -6841,11 +6871,12 @@ function layoutParagraph(request, runs) {
|
|
|
6841
6871
|
const unwrapped = wrap === "none" || !isFinite(available);
|
|
6842
6872
|
const lines = [];
|
|
6843
6873
|
for (const paragraph of paragraphs) {
|
|
6874
|
+
const width = paragraph.whole <= available + FIT_EPSILON ? Infinity : available;
|
|
6844
6875
|
if (paragraph.cached !== void 0) {
|
|
6845
6876
|
const key = unwrapped ? -1 : available;
|
|
6846
6877
|
let relative = paragraph.cached.lines.get(key);
|
|
6847
6878
|
if (relative === void 0) {
|
|
6848
|
-
relative = breakHardLine(paragraph.text, paragraph.segments,
|
|
6879
|
+
relative = breakHardLine(paragraph.text, paragraph.segments, width, unwrapped, measure);
|
|
6849
6880
|
if (paragraph.cached.lines.size >= WIDTHS_PER_LINE) paragraph.cached.lines.clear();
|
|
6850
6881
|
paragraph.cached.lines.set(key, relative);
|
|
6851
6882
|
}
|
|
@@ -6859,7 +6890,7 @@ function layoutParagraph(request, runs) {
|
|
|
6859
6890
|
}
|
|
6860
6891
|
const before = lines.length;
|
|
6861
6892
|
if (unwrapped) pushLine(text, paragraph.text, paragraph.start, 0, paragraph.text.length, measure, spanned, lines);
|
|
6862
|
-
else breakGreedy(text, paragraph.text, paragraph.start, paragraph.segments,
|
|
6893
|
+
else breakGreedy(text, paragraph.text, paragraph.start, paragraph.segments, width, measure, spanned, lines);
|
|
6863
6894
|
if (lines.length === before) lines.push({
|
|
6864
6895
|
start: paragraph.start,
|
|
6865
6896
|
end: paragraph.start,
|
|
@@ -7676,9 +7707,14 @@ function linkRunAtPointIn(geometry, x, y) {
|
|
|
7676
7707
|
* testing. This is the same shape as the CSS
|
|
7677
7708
|
* `inert` attribute: a disabled Button stays
|
|
7678
7709
|
* inert even when it wraps Text children.
|
|
7679
|
-
* pointerEvents — 'none' makes the node
|
|
7680
|
-
* by hit testing
|
|
7681
|
-
*
|
|
7710
|
+
* pointerEvents — inherited, as in CSS: 'none' makes the node and
|
|
7711
|
+
* its subtree skipped by hit testing, except where
|
|
7712
|
+
* a descendant sets 'auto', which takes presses
|
|
7713
|
+
* again. An overlay that lets presses through to
|
|
7714
|
+
* what is under it, with popups on it that take
|
|
7715
|
+
* them, is 'none' with 'auto' on each popup.
|
|
7716
|
+
* 'none' on the node itself also keeps it from
|
|
7717
|
+
* focus and keyboard, as before.
|
|
7682
7718
|
* hitTestable — false skips only the node itself; children are
|
|
7683
7719
|
* still tested. Use it for decorative containers
|
|
7684
7720
|
* that must not swallow clicks.
|
|
@@ -7690,13 +7726,29 @@ function linkRunAtPointIn(geometry, x, y) {
|
|
|
7690
7726
|
*/
|
|
7691
7727
|
/** The node and its whole subtree are excluded from pointer input. */
|
|
7692
7728
|
function isNodeInert(node) {
|
|
7693
|
-
if (node.properties.get("disabled") === true) return true;
|
|
7694
7729
|
if (node.properties.get("pointerEvents") === "none") return true;
|
|
7730
|
+
return isSubtreeInert(node);
|
|
7731
|
+
}
|
|
7732
|
+
/**
|
|
7733
|
+
* Disabled or hidden: the node and everything under it, with no way
|
|
7734
|
+
* back for a descendant. `pointerEvents: 'none'` is not this, since a
|
|
7735
|
+
* descendant can set 'auto'; the hit tester follows that itself.
|
|
7736
|
+
*/
|
|
7737
|
+
function isSubtreeInert(node) {
|
|
7738
|
+
if (node.properties.get("disabled") === true) return true;
|
|
7695
7739
|
if (node.properties.get("visible") === false) return true;
|
|
7696
7740
|
const opacity = node.properties.get("opacity");
|
|
7697
7741
|
if (typeof opacity === "number" && Number.isFinite(opacity) && opacity <= 0) return true;
|
|
7698
7742
|
return false;
|
|
7699
7743
|
}
|
|
7744
|
+
/** `pointerEvents` as CSS inherits it: the nearest value set from the node up, 'auto' when none is. */
|
|
7745
|
+
function pointerEventsOf(node) {
|
|
7746
|
+
for (let current = node; current !== null; current = current.parent) {
|
|
7747
|
+
const value = current.properties.get("pointerEvents");
|
|
7748
|
+
if (value === "auto" || value === "none") return value;
|
|
7749
|
+
}
|
|
7750
|
+
return "auto";
|
|
7751
|
+
}
|
|
7700
7752
|
/** The node itself cannot be the target of a hit, but children can. */
|
|
7701
7753
|
function isNodeHitTestable(node) {
|
|
7702
7754
|
return node.properties.get("hitTestable") !== false;
|
|
@@ -8435,8 +8487,12 @@ const drawStyle = {
|
|
|
8435
8487
|
function layoutTextLines(box, state, measurer) {
|
|
8436
8488
|
const text = state.text;
|
|
8437
8489
|
if (text === void 0 || text.length === 0 || state.fontSize <= 0) return [];
|
|
8438
|
-
|
|
8490
|
+
if (state.textOverflow === "ellipsis" && box.width <= 0) return [];
|
|
8491
|
+
const placements = placeLines(box, state, measurer.layout(textMeasureRequest(text, state, box)));
|
|
8492
|
+
return state.textOverflow === "ellipsis" ? placements.filter((placement) => placement.width <= box.width + FIT_TOLERANCE) : placements;
|
|
8439
8493
|
}
|
|
8494
|
+
/** How far past its box a line may measure and still be drawn: rounding, not overflow. */
|
|
8495
|
+
const FIT_TOLERANCE = .5;
|
|
8440
8496
|
/** The measure request paint makes for a node's text: the one layout made too. */
|
|
8441
8497
|
function textMeasureRequest(text, state, box) {
|
|
8442
8498
|
return {
|
|
@@ -9438,6 +9494,13 @@ var UiHitTester = class {
|
|
|
9438
9494
|
liftedScratch = [];
|
|
9439
9495
|
/** True while testing inside a lifted subtree, so it is not skipped again. */
|
|
9440
9496
|
inLifted = false;
|
|
9497
|
+
/**
|
|
9498
|
+
* `pointerEvents` as the node being tested has it, inherited: true
|
|
9499
|
+
* under a 'none' that nothing nearer has set back to 'auto'. Such a
|
|
9500
|
+
* node is passed over, but its children are still tested, since one
|
|
9501
|
+
* of them may say 'auto'.
|
|
9502
|
+
*/
|
|
9503
|
+
pointerNone = false;
|
|
9441
9504
|
constructor(layout, root) {
|
|
9442
9505
|
this.layout = layout;
|
|
9443
9506
|
this.root = root;
|
|
@@ -9472,7 +9535,9 @@ var UiHitTester = class {
|
|
|
9472
9535
|
const out = [];
|
|
9473
9536
|
this.forEachLifted(x, y, (node, px, py) => {
|
|
9474
9537
|
this.inLifted = true;
|
|
9538
|
+
this.pointerNone = pointerEventsOf(node.parent) === "none";
|
|
9475
9539
|
this.collectNode(node, px, py, out);
|
|
9540
|
+
this.pointerNone = false;
|
|
9476
9541
|
this.inLifted = false;
|
|
9477
9542
|
return false;
|
|
9478
9543
|
});
|
|
@@ -9480,7 +9545,16 @@ var UiHitTester = class {
|
|
|
9480
9545
|
return out;
|
|
9481
9546
|
}
|
|
9482
9547
|
collectNode(node, x, y, out) {
|
|
9483
|
-
if (
|
|
9548
|
+
if (isSubtreeInert(node)) return;
|
|
9549
|
+
const outer = this.pointerNone;
|
|
9550
|
+
this.pointerNone = this.inheritsNone(node, outer);
|
|
9551
|
+
try {
|
|
9552
|
+
this.collectOwn(node, x, y, out);
|
|
9553
|
+
} finally {
|
|
9554
|
+
this.pointerNone = outer;
|
|
9555
|
+
}
|
|
9556
|
+
}
|
|
9557
|
+
collectOwn(node, x, y, out) {
|
|
9484
9558
|
const rec = this.layout.recordFor(node);
|
|
9485
9559
|
if (rec === void 0 || !this.invertPoint(node, rec, x, y)) return;
|
|
9486
9560
|
if (rec.lifted && !this.inLifted) return;
|
|
@@ -9491,7 +9565,7 @@ var UiHitTester = class {
|
|
|
9491
9565
|
const shiftX = rec.clips && rec.scrollable ? rec.scrollX : 0;
|
|
9492
9566
|
const shiftY = rec.clips && rec.scrollable ? rec.scrollY : 0;
|
|
9493
9567
|
this.collectChildren(node, px + shiftX, py + shiftY, out);
|
|
9494
|
-
if (inside &&
|
|
9568
|
+
if (inside && this.targetable(node)) out.push(node);
|
|
9495
9569
|
}
|
|
9496
9570
|
collectChildren(parent, x, y, out) {
|
|
9497
9571
|
const order = this.layout.recordFor(parent)?.paintOrder;
|
|
@@ -9574,7 +9648,9 @@ var UiHitTester = class {
|
|
|
9574
9648
|
hitTestLifted(x, y) {
|
|
9575
9649
|
return this.forEachLifted(x, y, (node, px, py) => {
|
|
9576
9650
|
this.inLifted = true;
|
|
9651
|
+
this.pointerNone = pointerEventsOf(node.parent) === "none";
|
|
9577
9652
|
const hit = this.hitTestNode(node, px, py);
|
|
9653
|
+
this.pointerNone = false;
|
|
9578
9654
|
this.inLifted = false;
|
|
9579
9655
|
return hit;
|
|
9580
9656
|
});
|
|
@@ -9640,7 +9716,25 @@ var UiHitTester = class {
|
|
|
9640
9716
|
this.point.y = py;
|
|
9641
9717
|
}
|
|
9642
9718
|
hitTestNode(node, x, y) {
|
|
9643
|
-
if (
|
|
9719
|
+
if (isSubtreeInert(node)) return false;
|
|
9720
|
+
const outer = this.pointerNone;
|
|
9721
|
+
this.pointerNone = this.inheritsNone(node, outer);
|
|
9722
|
+
try {
|
|
9723
|
+
return this.hitTestOwn(node, x, y);
|
|
9724
|
+
} finally {
|
|
9725
|
+
this.pointerNone = outer;
|
|
9726
|
+
}
|
|
9727
|
+
}
|
|
9728
|
+
/** Whether a node is under a 'none': its own value, else its parent's. */
|
|
9729
|
+
inheritsNone(node, parentNone) {
|
|
9730
|
+
const own = node.properties.get("pointerEvents");
|
|
9731
|
+
return own === "none" ? true : own === "auto" ? false : parentNone;
|
|
9732
|
+
}
|
|
9733
|
+
/** Whether a press may land on the node itself. */
|
|
9734
|
+
targetable(node) {
|
|
9735
|
+
return !this.pointerNone && isNodeHitTestable(node);
|
|
9736
|
+
}
|
|
9737
|
+
hitTestOwn(node, x, y) {
|
|
9644
9738
|
const rec = this.layout.recordFor(node);
|
|
9645
9739
|
if (rec === void 0) return false;
|
|
9646
9740
|
if (rec.lifted && !this.inLifted) return false;
|
|
@@ -9649,7 +9743,7 @@ var UiHitTester = class {
|
|
|
9649
9743
|
const py = this.point.y - rec.stickyOffsetY;
|
|
9650
9744
|
if (rec.clips) {
|
|
9651
9745
|
if (px < rec.x || px >= rec.x + rec.width || py < rec.y || py >= rec.y + rec.height) return false;
|
|
9652
|
-
if ((rec.scrollable || rec.textScrollbars) && scrollLeaderOf(node) === null && this.hitScrollbar(node, rec, px, py)) return true;
|
|
9746
|
+
if (!this.pointerNone && (rec.scrollable || rec.textScrollbars) && scrollLeaderOf(node) === null && this.hitScrollbar(node, rec, px, py)) return true;
|
|
9653
9747
|
if (this.zoneOnly) {
|
|
9654
9748
|
const shiftX = rec.scrollX;
|
|
9655
9749
|
const shiftY = rec.scrollY;
|
|
@@ -9658,10 +9752,10 @@ var UiHitTester = class {
|
|
|
9658
9752
|
const shiftX = rec.scrollable ? rec.scrollX : 0;
|
|
9659
9753
|
const shiftY = rec.scrollable ? rec.scrollY : 0;
|
|
9660
9754
|
if (this.hitTestChildren(node, px + shiftX, py + shiftY)) return true;
|
|
9661
|
-
return
|
|
9755
|
+
return this.targetable(node) && this.recordHit(node, rec, px, py);
|
|
9662
9756
|
}
|
|
9663
9757
|
if (this.hitTestChildren(node, px, py)) return true;
|
|
9664
|
-
if (this.zoneOnly || !
|
|
9758
|
+
if (this.zoneOnly || !this.targetable(node)) return false;
|
|
9665
9759
|
if (px < rec.x || px >= rec.x + rec.width || py < rec.y || py >= rec.y + rec.height) return false;
|
|
9666
9760
|
return this.recordHit(node, rec, px, py);
|
|
9667
9761
|
}
|
|
@@ -12442,6 +12536,7 @@ var UiEditingController = class {
|
|
|
12442
12536
|
text: surface.text,
|
|
12443
12537
|
selectionStart: surface.selectionStart,
|
|
12444
12538
|
selectionEnd: surface.selectionEnd,
|
|
12539
|
+
...surface.selectionDirection === void 0 ? {} : { selectionDirection: surface.selectionDirection },
|
|
12445
12540
|
caret: this.drawnBox(node, surface.caret),
|
|
12446
12541
|
multiline: surface.multiline ?? true,
|
|
12447
12542
|
composing: this.surfaceComposition !== null,
|
|
@@ -13818,6 +13913,16 @@ var LayoutRecord = class {
|
|
|
13818
13913
|
*/
|
|
13819
13914
|
positioned = false;
|
|
13820
13915
|
absolute = false;
|
|
13916
|
+
/**
|
|
13917
|
+
* Absolute or sticky: where the node goes depends on more than its
|
|
13918
|
+
* parent's flow (its containing block, or the scroll), so it is never
|
|
13919
|
+
* a relayout boundary. A relative node is in flow and only drawn
|
|
13920
|
+
* offset, so one with a fixed size is: a change inside it is laid out
|
|
13921
|
+
* from it, as from any other.
|
|
13922
|
+
*/
|
|
13923
|
+
get displaced() {
|
|
13924
|
+
return this.absolute || this.sticky;
|
|
13925
|
+
}
|
|
13821
13926
|
top = void 0;
|
|
13822
13927
|
right = void 0;
|
|
13823
13928
|
bottom = void 0;
|
|
@@ -15427,7 +15532,7 @@ var LayoutEngine = class {
|
|
|
15427
15532
|
for (;;) {
|
|
15428
15533
|
if (current === this.layoutRoot || current.parent === null) break;
|
|
15429
15534
|
const cRec = this.records.get(current);
|
|
15430
|
-
if (current !== node && cRec?.relayoutBoundary && !cRec.
|
|
15535
|
+
if (current !== node && cRec?.relayoutBoundary && !cRec.displaced) break;
|
|
15431
15536
|
current = current.parent;
|
|
15432
15537
|
depth++;
|
|
15433
15538
|
}
|
|
@@ -16090,7 +16195,7 @@ var LayoutEngine = class {
|
|
|
16090
16195
|
const explicitBoth = this.lengthProp(placement.item, "width", void 0) !== void 0 && this.lengthProp(placement.item, "height", void 0) !== void 0;
|
|
16091
16196
|
cRec.contentMatters = gridRec.contentMatters || !explicitBoth;
|
|
16092
16197
|
this.measure(placement.item, new Constraints(0, Infinity, 0, Infinity));
|
|
16093
|
-
cRec.relayoutBoundary = explicitBoth && !cRec.contentMatters && cRec.aspectRatio === void 0 && !cRec.
|
|
16198
|
+
cRec.relayoutBoundary = explicitBoth && !cRec.contentMatters && cRec.aspectRatio === void 0 && !cRec.displaced;
|
|
16094
16199
|
const marginH = cRec.marginLeft + cRec.marginRight;
|
|
16095
16200
|
const contribution = {
|
|
16096
16201
|
min: this.minContentContribution(placement.item, cRec) + marginH,
|
|
@@ -16411,7 +16516,7 @@ var LayoutEngine = class {
|
|
|
16411
16516
|
} else minMain = row ? cRec.minWidth : cRec.minHeight;
|
|
16412
16517
|
const basis = this.flexBasis(child, cRec, mainBase);
|
|
16413
16518
|
const baseMain = basis ?? measuredMain;
|
|
16414
|
-
const sizeFree = (explicitMain !== void 0 || basis !== void 0 && !minFromContent) && (explicitCross || align === 3 && crossTightForStretch) && cRec.aspectRatio === void 0 && !cRec.
|
|
16519
|
+
const sizeFree = (explicitMain !== void 0 || basis !== void 0 && !minFromContent) && (explicitCross || align === 3 && crossTightForStretch) && cRec.aspectRatio === void 0 && !cRec.displaced;
|
|
16415
16520
|
const physicalStart = row ? cRec.marginLeft : cRec.marginTop;
|
|
16416
16521
|
const physicalEnd = row ? cRec.marginRight : cRec.marginBottom;
|
|
16417
16522
|
const physicalStartAuto = row ? cRec.marginLeftAuto : cRec.marginTopAuto;
|
|
@@ -16808,7 +16913,7 @@ var LayoutEngine = class {
|
|
|
16808
16913
|
const stretchY = definiteHeight !== void 0 && this.stackAlignment(child, "selfY", "height", stackY) === 3;
|
|
16809
16914
|
cRec.contentMatters = rec.contentMatters;
|
|
16810
16915
|
this.measure(child, this.stackQuestion(cRec, content, stretchX, stretchY));
|
|
16811
|
-
cRec.relayoutBoundary = (explicitWidth || stretchX) && (explicitHeight || stretchY) && cRec.aspectRatio === void 0 && !cRec.
|
|
16916
|
+
cRec.relayoutBoundary = (explicitWidth || stretchX) && (explicitHeight || stretchY) && cRec.aspectRatio === void 0 && !cRec.displaced && !cRec.contentMatters;
|
|
16812
16917
|
maxWidth = Math.max(maxWidth, cRec.outerWidth);
|
|
16813
16918
|
maxHeight = Math.max(maxHeight, cRec.outerHeight);
|
|
16814
16919
|
minContent = Math.max(minContent, this.minContentContribution(child, cRec) + cRec.marginLeft + cRec.marginRight);
|
|
@@ -16872,7 +16977,7 @@ var LayoutEngine = class {
|
|
|
16872
16977
|
const childBase = vertical ? new Constraints(crossTight ? crossLimit : 0, crossLimit, 0, Infinity) : new Constraints(0, Infinity, crossTight ? crossLimit : 0, crossLimit);
|
|
16873
16978
|
cRec.contentMatters = contentMatters;
|
|
16874
16979
|
this.measure(child, childBase);
|
|
16875
|
-
cRec.relayoutBoundary = explicitMain !== void 0 && (explicitCross || crossTight) && cRec.aspectRatio === void 0 && !cRec.
|
|
16980
|
+
cRec.relayoutBoundary = explicitMain !== void 0 && (explicitCross || crossTight) && cRec.aspectRatio === void 0 && !cRec.displaced;
|
|
16876
16981
|
const measuredMain = vertical ? cRec.measuredHeight : cRec.measuredWidth;
|
|
16877
16982
|
const measuredCross = vertical ? cRec.measuredWidth : cRec.measuredHeight;
|
|
16878
16983
|
const marginMain = vertical ? cRec.marginTop + cRec.marginBottom : cRec.marginLeft + cRec.marginRight;
|
|
@@ -17868,7 +17973,7 @@ var LayoutEngine = class {
|
|
|
17868
17973
|
if (!bounded) this.relayoutRoots.add(this.layoutRoot ?? current);
|
|
17869
17974
|
return;
|
|
17870
17975
|
}
|
|
17871
|
-
if (!bounded && rec?.relayoutBoundary && !rec.
|
|
17976
|
+
if (!bounded && rec?.relayoutBoundary && !rec.displaced && (current !== node || selfCanBound)) {
|
|
17872
17977
|
this.relayoutRoots.add(current);
|
|
17873
17978
|
/**
|
|
17874
17979
|
* The boundary is where the *relayout* starts, and the walk
|
|
@@ -21466,6 +21571,6 @@ function createCanvasSurface(host) {
|
|
|
21466
21571
|
return new CanvasSurface(host);
|
|
21467
21572
|
}
|
|
21468
21573
|
//#endregion
|
|
21469
|
-
export { isImeKey as $,
|
|
21574
|
+
export { isImeKey as $, MOUSE_POINTER as $a, spacingEqual as $i, ELLIPSIS as $n, transformsEqual as $r, registerFontStack as $t, withOverrideSource as A, colorToHex as Aa, observeViewportInsets as Ai, clearLinkHover as An, inheritedPropertyNames as Ar, adjacentField as At, FlexDirection as B, UiEnvironment as Ba, defineThemeExtension as Bi, editorFor as Bn, normalizeStates as Br, createCanvasTextStyle as Bt, SCROLLBAR_LINGER_MS as C, textContentOf as Ca, uniformBorderRadius as Ci, isNodeInert as Cn, resolveProperty as Cr, hasDrawnText as Ct, formatExplanation as D, darkColors as Da, UiInsetRegistry as Di, isSubtreeInert as Dn, findPropertyDefinition as Dr, selectionRectsIn as Dt, formatConstraints as E, colorsEqualPalette as Ea, UiEnvironmentKeys as Ei, isPressable as En, closestPropertyName as Er, paragraphGeometryFrom as Et, clampSize as F, parseColor as Fa, darkTheme as Fi, setLinkHover as Fn, UiProperties as Fr, detectEditingPlatform as Ft, CrossAxisAlignment as G, resetOverrideWarnings as Ga, withThemeExtension as Gi, nextCaretToggle as Gn, validateSubgrid as Gr, runFontString as Gt, placeGridItems as H, DirtyNodeSet as Ha, noThemeExtensions as Hi, isEditableNode as Hn, validateRole as Hr, fillTextRects as Ht, constraintsEqual as I, rgb8 as Ia, lightTheme as Ii, CARET_BLINK_MS as In, UI_ROLES as Ir, isPrintable as It, parseCrossAxisAlignment as J, UiVisualState as Ja, raiseContrast as Ji, isVideoSurface as Jn, pathValuesEqual as Jr, textRunBackgrounds as Jt, MainAxisAlignment as K, writeDeclaredProperty as Ka, contrastRatio as Ki, syncEditorValue as Kn, inputsEqual as Kr, spanOf as Kt, tightenConstraints as L, rgba as La, themesEqual as Li, CARET_WIDTH as Ln, UI_SEMANTIC_STATES as Lr, EditableLayout as Lt, contentOffset as M, colorValuesEqual as Ma, bandOf as Mi, linkHoverOf as Mn, propertyIsInherited as Mr, edgeField as Mt, LayoutRecord as N, colorsEqual as Na, containerBands as Ni, linkOf as Nn, propertyNarrowers as Nr, editingGroupOf as Nt, formatNumber as O, lightColors as Oa, insetsEqual as Oi, pointerEventsOf as On, getPropertyNames as Or, wordRangeIn as Ot, Constraints as P, normalizeColor as Pa, unknownContainerSize as Pi, linkRunAtPointIn as Pn, propertyValuesEqualByName as Pr, commandForKey as Pt, capturePointer as Q, visualStatesEqual as Qa, scaleSpacing as Qi, spannedRunsFor as Qn, transformIsIdentity as Qr, fontStackFor as Qt, MAX_MEASURES_PER_CHILD as R, createEnvironmentKey as Ra, withContrast as Ri, EDITOR_PROP as Rn, isUiRole as Rr, applyCanvasTextStyle as Rt, SCROLLBAR_FADE_MS as S, spansDifferOnlyInPaint as Sa, normalizeBorderRadius as Si, isNodeHitTestable as Sn, resolveNumber as Sr, UiInputDispatcher as St, describeOverrides as T, textStylesEqual as Ta, propertyValuesEqual as Ti, isNodeTabStop as Tn, resolveString as Tr, paragraphGeometry as Tt, sizeGridTracks as U, clearOverrideProperty as Ua, themeExtension as Ui, isMultiline as Un, validateStates as Ur, layoutTextLines as Ut, parseFlexDirection as V, UiNode as Va, hasThemeExtension as Vi, editorOf as Vn, statesEqual as Vr, drawText as Vt, AlignContent as W, overrideSources as Wa, themeExtensionsEqual as Wi, isReadOnly as Wn, UI_SUBGRID_AXES as Wr, runCanvasStyleInto as Wt, CanvasPlatformSurface as X, hasVisualState as Xa, densityFactors as Xi, CharacterCountTextMeasurer as Xn, parseTransform as Xr, bumpFontStack as Xt, parseMainAxisAlignment as Y, defaultVisualState as Ya, relativeLuminance as Yi, videoFrameSize as Yn, UiTransforms as Yr, textRunDecorations as Yt, UiPlatformAdapter as Z, visualState as Za, defaultSpacing as Zi, ParagraphTextMeasurer as Zn, transform as Zr, clearFontStacks as Zt, LABEL_PADDING_X as _, flattenTextSpans as _a, borderRadius as _i, selectableTextNodes as _n, DirtyFlags as _o, previousWordStart as _r, scrollLeaderOf as _t, PaintPictureCache as a, boxShadowArraysEqual as aa, validateGradient as ai, computeObjectFitRect as an, UiInputEvent as ao, lineLimit as ar, UiGestureRecognizer as at, snapScroll as b, spanAtOffset as ba, borderRadiusIsZero as bi, setSelectionRange as bn, DEFAULT_LINE_HEIGHT_FACTOR as br, scrollbarThumbs as bt, EMPTY_RECORDING as c, boxShadowsEqual as ca, isAutoLength as ci, normalizeTextAlign as cn, UiPinchEvent as co, offsetForVerticalMove as cr, isScrollContainer as ct, tracePathData as d, shapesEqual as da, isPercentLength as di, TEXT_MATCHES_PROP as dn, UiTextChangeEvent as do, graphemeBoundaries as dr, UiFocusManager as dt, spacingSteps as ea, MAX_GRADIENT_STOPS as ei, DEFAULT_FONT_FAMILY as en, UiBeforeInputEvent as eo, layoutParagraph as er, pointerDeviceOf as et, ScaledImageCache as f, defaultTypography as fa, minmax as fi, clearMatchRanges as fn, UiWheelDeltaMode as fo, lineEndAt as fr, UiHitTester as ft, paintsAfterChildren as g, editableSpansOf as ga, UiBorderRadiuses as gi, clearSelectionRange as gn, UiNodeType as go, previousGraphemeStart as gr, SCROLLBAR_THICKNESS as gt, hasDecorationPhase as h, defaultTextStyle as ha, resolveLength as hi, TEXT_SELECTION_PROP as hn, wheelDeltaYOf as ho, nextWordEnd as hr, SCROLLBAR_MIN_THUMB as ht, traceRoundedRect as i, boxShadow as ia, radialGradient as ii, colorToCss as in, UiGestureEvent as io, lineIndexForOffset as ir, UiTouchScroller as it, accumulatedOffsetTo as j, colorToRgba as ja, UiContainerSizeSource as ji, hasTextLinks as jn, propertyEffects as jr, comparePositions as jt, labelNode as k, UiBasicColors as ka, noInsets as ki, resolveCursor as kn, inheritedPropertyFlags as kr, textInputOf as kt, PaintRecorder as l, defaultShapes as la, isFrLength as li, normalizeVerticalAlign as ln, UiPointerEvent as lo, selectionRects as lr, UiKeyboardController as lt, decorationRect as m, typographyEqual as ma, repeat as mi, setMatchRanges as mn, noKeyModifiers as mo, nextGraphemeEnd as mr, SCROLLBAR_INSET as mt, createCanvasSurface as n, shadowsEqual as na, gradientsEqual as ni, DEFAULT_FONT_WEIGHT as nn, UiEventType as no, caretRectFor as nr, touchActionFor as nt, paintPictures as o, boxShadowRadius as oa, auto as oi, createPaintState as on, UiKeyboardEvent as oo, offsetAtPoint as or, UiPinchRecognizer as ot, decorationColor as p, isTypographyRole as pa, percent as pi, matchRangesOf as pn, UiWheelEvent as po, lineStartAt as pr, SCROLLBAR_HOVER_ZONE as pt, parseAlignContent as q, writeOverrideProperty as qa, highContrastColors as qi, resolveColorValue as qn, paintValuesEqual as qr, textMeasureRequest as qt, Canvas2DRenderer as r, BOX_SHADOW_BLUR_REACH as ra, linearGradient as ri, DEFAULT_TEXT_COLOR as rn, UiFocusEvent as ro, lineIndexAtY as rr, UiEditingController as rt, PaintTarget as s, boxShadowReach as sa, fr as si, isPaintVisible as sn, UiPasteEvent as so, offsetAtX as sr, UiWheelController as st, CanvasSurface as t, defaultShadows as ta, gradientPaint as ti, DEFAULT_FONT_SIZE as tn, UiCompositionEvent as to, proportionalFontMetrics as tr, prepareInputSurface as tt, replayPaint as u, isShapeName as ua, isMinMaxTrack as ui, resolvePaintState as un, UiSelectionChangeEvent as uo, EditableTextModel as ur, UiPointerController as ut, drawOverlayShapes as v, hiddenRangesOf as va, borderRadiusCorners as vi, selectableTextOf as vn, UiBinding as vo, wordRangeAt as vr, scrollRange as vt, describeLength as w, textSpansEqual as wa, defineProperty as wi, isNodeSelectable as wn, resolvePropertyByName as wr, offsetAtPointIn as wt, LayoutEngine as x, spannedTextOf as xa, borderRadiusValuesEqual as xi, isNodeFocusable as xn, resolveBoolean as xr, scrollbarZoneAt as xt, labelOrigin as y, resolvedSpansOf as ya, borderRadiusEqual as yi, selectionRangeOf as yn, UiGraph as yr, scrollbarThumb as yt, isLayoutProtocol as z, findEnvironmentKey as za, withDensity as zi, caretVisibleAt as zn, isUiSemanticState as zr, buildFontString as zt };
|
|
21470
21575
|
|
|
21471
|
-
//# sourceMappingURL=CanvasSurface-
|
|
21576
|
+
//# sourceMappingURL=CanvasSurface-tAao5BLh.js.map
|