gesso-core 0.6.18 → 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 +7 -0
- package/dist/{CanvasSurface-BSvtTgJZ.js → CanvasSurface-tAao5BLh.js} +71 -12
- package/dist/CanvasSurface-tAao5BLh.js.map +1 -0
- package/dist/{index-Bi5ggOnd.d.ts → index-8yhrkCnb.d.ts} +31 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- 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-BSvtTgJZ.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
10
|
## 0.6.18
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -7707,9 +7707,14 @@ function linkRunAtPointIn(geometry, x, y) {
|
|
|
7707
7707
|
* testing. This is the same shape as the CSS
|
|
7708
7708
|
* `inert` attribute: a disabled Button stays
|
|
7709
7709
|
* inert even when it wraps Text children.
|
|
7710
|
-
* pointerEvents — 'none' makes the node
|
|
7711
|
-
* by hit testing
|
|
7712
|
-
*
|
|
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.
|
|
7713
7718
|
* hitTestable — false skips only the node itself; children are
|
|
7714
7719
|
* still tested. Use it for decorative containers
|
|
7715
7720
|
* that must not swallow clicks.
|
|
@@ -7721,13 +7726,29 @@ function linkRunAtPointIn(geometry, x, y) {
|
|
|
7721
7726
|
*/
|
|
7722
7727
|
/** The node and its whole subtree are excluded from pointer input. */
|
|
7723
7728
|
function isNodeInert(node) {
|
|
7724
|
-
if (node.properties.get("disabled") === true) return true;
|
|
7725
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;
|
|
7726
7739
|
if (node.properties.get("visible") === false) return true;
|
|
7727
7740
|
const opacity = node.properties.get("opacity");
|
|
7728
7741
|
if (typeof opacity === "number" && Number.isFinite(opacity) && opacity <= 0) return true;
|
|
7729
7742
|
return false;
|
|
7730
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
|
+
}
|
|
7731
7752
|
/** The node itself cannot be the target of a hit, but children can. */
|
|
7732
7753
|
function isNodeHitTestable(node) {
|
|
7733
7754
|
return node.properties.get("hitTestable") !== false;
|
|
@@ -9473,6 +9494,13 @@ var UiHitTester = class {
|
|
|
9473
9494
|
liftedScratch = [];
|
|
9474
9495
|
/** True while testing inside a lifted subtree, so it is not skipped again. */
|
|
9475
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;
|
|
9476
9504
|
constructor(layout, root) {
|
|
9477
9505
|
this.layout = layout;
|
|
9478
9506
|
this.root = root;
|
|
@@ -9507,7 +9535,9 @@ var UiHitTester = class {
|
|
|
9507
9535
|
const out = [];
|
|
9508
9536
|
this.forEachLifted(x, y, (node, px, py) => {
|
|
9509
9537
|
this.inLifted = true;
|
|
9538
|
+
this.pointerNone = pointerEventsOf(node.parent) === "none";
|
|
9510
9539
|
this.collectNode(node, px, py, out);
|
|
9540
|
+
this.pointerNone = false;
|
|
9511
9541
|
this.inLifted = false;
|
|
9512
9542
|
return false;
|
|
9513
9543
|
});
|
|
@@ -9515,7 +9545,16 @@ var UiHitTester = class {
|
|
|
9515
9545
|
return out;
|
|
9516
9546
|
}
|
|
9517
9547
|
collectNode(node, x, y, out) {
|
|
9518
|
-
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) {
|
|
9519
9558
|
const rec = this.layout.recordFor(node);
|
|
9520
9559
|
if (rec === void 0 || !this.invertPoint(node, rec, x, y)) return;
|
|
9521
9560
|
if (rec.lifted && !this.inLifted) return;
|
|
@@ -9526,7 +9565,7 @@ var UiHitTester = class {
|
|
|
9526
9565
|
const shiftX = rec.clips && rec.scrollable ? rec.scrollX : 0;
|
|
9527
9566
|
const shiftY = rec.clips && rec.scrollable ? rec.scrollY : 0;
|
|
9528
9567
|
this.collectChildren(node, px + shiftX, py + shiftY, out);
|
|
9529
|
-
if (inside &&
|
|
9568
|
+
if (inside && this.targetable(node)) out.push(node);
|
|
9530
9569
|
}
|
|
9531
9570
|
collectChildren(parent, x, y, out) {
|
|
9532
9571
|
const order = this.layout.recordFor(parent)?.paintOrder;
|
|
@@ -9609,7 +9648,9 @@ var UiHitTester = class {
|
|
|
9609
9648
|
hitTestLifted(x, y) {
|
|
9610
9649
|
return this.forEachLifted(x, y, (node, px, py) => {
|
|
9611
9650
|
this.inLifted = true;
|
|
9651
|
+
this.pointerNone = pointerEventsOf(node.parent) === "none";
|
|
9612
9652
|
const hit = this.hitTestNode(node, px, py);
|
|
9653
|
+
this.pointerNone = false;
|
|
9613
9654
|
this.inLifted = false;
|
|
9614
9655
|
return hit;
|
|
9615
9656
|
});
|
|
@@ -9675,7 +9716,25 @@ var UiHitTester = class {
|
|
|
9675
9716
|
this.point.y = py;
|
|
9676
9717
|
}
|
|
9677
9718
|
hitTestNode(node, x, y) {
|
|
9678
|
-
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) {
|
|
9679
9738
|
const rec = this.layout.recordFor(node);
|
|
9680
9739
|
if (rec === void 0) return false;
|
|
9681
9740
|
if (rec.lifted && !this.inLifted) return false;
|
|
@@ -9684,7 +9743,7 @@ var UiHitTester = class {
|
|
|
9684
9743
|
const py = this.point.y - rec.stickyOffsetY;
|
|
9685
9744
|
if (rec.clips) {
|
|
9686
9745
|
if (px < rec.x || px >= rec.x + rec.width || py < rec.y || py >= rec.y + rec.height) return false;
|
|
9687
|
-
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;
|
|
9688
9747
|
if (this.zoneOnly) {
|
|
9689
9748
|
const shiftX = rec.scrollX;
|
|
9690
9749
|
const shiftY = rec.scrollY;
|
|
@@ -9693,10 +9752,10 @@ var UiHitTester = class {
|
|
|
9693
9752
|
const shiftX = rec.scrollable ? rec.scrollX : 0;
|
|
9694
9753
|
const shiftY = rec.scrollable ? rec.scrollY : 0;
|
|
9695
9754
|
if (this.hitTestChildren(node, px + shiftX, py + shiftY)) return true;
|
|
9696
|
-
return
|
|
9755
|
+
return this.targetable(node) && this.recordHit(node, rec, px, py);
|
|
9697
9756
|
}
|
|
9698
9757
|
if (this.hitTestChildren(node, px, py)) return true;
|
|
9699
|
-
if (this.zoneOnly || !
|
|
9758
|
+
if (this.zoneOnly || !this.targetable(node)) return false;
|
|
9700
9759
|
if (px < rec.x || px >= rec.x + rec.width || py < rec.y || py >= rec.y + rec.height) return false;
|
|
9701
9760
|
return this.recordHit(node, rec, px, py);
|
|
9702
9761
|
}
|
|
@@ -21512,6 +21571,6 @@ function createCanvasSurface(host) {
|
|
|
21512
21571
|
return new CanvasSurface(host);
|
|
21513
21572
|
}
|
|
21514
21573
|
//#endregion
|
|
21515
|
-
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 };
|
|
21516
21575
|
|
|
21517
|
-
//# sourceMappingURL=CanvasSurface-
|
|
21576
|
+
//# sourceMappingURL=CanvasSurface-tAao5BLh.js.map
|