gesso-core 0.6.16 → 0.6.17
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/{CanvasSurface-Dz-AXwa4.js → CanvasSurface-cRmWIUfC.js} +55 -6
- package/dist/{CanvasSurface-Dz-AXwa4.js.map → CanvasSurface-cRmWIUfC.js.map} +1 -1
- package/dist/{index-5CNL7kuO.d.ts → index-Dc-g1Qk2.d.ts} +34 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# gesso-core
|
|
2
2
|
|
|
3
|
+
## 0.6.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fcf0d04: An anchored overlay taller than the room on the side it opens on is now cut to that room, instead of running off the edge of the window. The room reaches the overlay's layout the way a `maxHeight` would, so a scroll container inside it scrolls what does not fit. An overlay placed at a point, such as a context menu, that fits on neither side of the point but fits in the window opens on the side asked for and slides back over the point until all of it is on the screen, as a native context menu does, rather than starting off the top of the window. Overlays that fit are placed exactly as before.
|
|
8
|
+
|
|
3
9
|
## 0.6.16
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -17165,7 +17165,7 @@ var LayoutEngine = class {
|
|
|
17165
17165
|
this.trackAnchor(child, null);
|
|
17166
17166
|
this.absoluteBlocks.set(child, block);
|
|
17167
17167
|
this.measure(child, new Constraints(0, Math.max(0, block.width), 0, Math.max(0, block.height)));
|
|
17168
|
-
this.placeBeside(child, cRec, block.x + point.x, block.y + point.y, 0, 0, block);
|
|
17168
|
+
this.placeBeside(child, cRec, block.x + point.x, block.y + point.y, 0, 0, block, true);
|
|
17169
17169
|
return;
|
|
17170
17170
|
} else {
|
|
17171
17171
|
this.anchoredNodes.delete(child);
|
|
@@ -17257,33 +17257,82 @@ var LayoutEngine = class {
|
|
|
17257
17257
|
* no size — flipping to the opposite side when the named one would
|
|
17258
17258
|
* overflow the block and the other has more room, and clamping along
|
|
17259
17259
|
* the side to stay inside it.
|
|
17260
|
-
|
|
17261
|
-
|
|
17262
|
-
|
|
17263
|
-
|
|
17260
|
+
*
|
|
17261
|
+
* **A node taller than the room on its side is measured again into
|
|
17262
|
+
* that room.** Flipping picks the side with more space, and that was
|
|
17263
|
+
* all it did: a thirty-command Format menu under a title 44 pixels
|
|
17264
|
+
* down ran off the bottom of an 813-pixel window, and a 424-pixel
|
|
17265
|
+
* context menu opened at y 410 flipped above the point and started
|
|
17266
|
+
* at -14, its first rows off the top of the screen. Neither could be
|
|
17267
|
+
* scrolled, because nothing ever told the menu it had less height
|
|
17268
|
+
* than it asked for.
|
|
17269
|
+
*
|
|
17270
|
+
* The room is a loose bound and not a smaller painted rect, so it
|
|
17271
|
+
* reaches the node's layout the way a `maxHeight` would: a scroller
|
|
17272
|
+
* inside it is offered the height that is left and scrolls the rest,
|
|
17273
|
+
* a scroll view is capped at it, and a plain column, which cannot
|
|
17274
|
+
* shrink, still overflows as it always did. The side was chosen on
|
|
17275
|
+
* the height asked for, before the cap, so a menu that fits on
|
|
17276
|
+
* neither side still opens on the roomier one.
|
|
17277
|
+
*
|
|
17278
|
+
* A node placed at a `point` slides instead, when it fits in the block
|
|
17279
|
+
* at all: a context menu that has room on neither side of the pointer
|
|
17280
|
+
* opens on the side asked for and moves back over the pointer until
|
|
17281
|
+
* it is inside, whole, as a native one does, rather than being
|
|
17282
|
+
* cut short and made to scroll with half the screen free. Covering a
|
|
17283
|
+
* point hides nothing; covering an anchor would hide the very title
|
|
17284
|
+
* or button the panel belongs to, so an anchored node is capped.
|
|
17285
|
+
*
|
|
17286
|
+
* An anchored node that still does not fit, because what it holds
|
|
17287
|
+
* cannot shrink, is kept from starting before the block's edge, so
|
|
17288
|
+
* its first rows are on the screen; it is not pushed back over its
|
|
17289
|
+
* anchor, and runs past the far edge as it always did. A node that
|
|
17290
|
+
* fits is placed exactly as before, against an anchor scrolled out
|
|
17291
|
+
* of view included: a tooltip follows its anchor off the screen
|
|
17292
|
+
* rather than sticking to the edge without it.
|
|
17293
|
+
*/
|
|
17294
|
+
placeBeside(child, cRec, ax, ay, aw, ah, block, point = false) {
|
|
17295
|
+
let width = cRec.measuredWidth;
|
|
17296
|
+
let height = cRec.measuredHeight;
|
|
17264
17297
|
const gap = this.numberProp(child, "anchorOffset") ?? 0;
|
|
17265
17298
|
const { side, align } = this.parsePlacement(child.properties.get("placement"));
|
|
17266
17299
|
const vertical = side === "top" || side === "bottom";
|
|
17267
17300
|
let resolvedSide = side;
|
|
17301
|
+
let room;
|
|
17268
17302
|
if (vertical) {
|
|
17269
17303
|
const roomBelow = block.y + block.height - (ay + ah + gap);
|
|
17270
17304
|
const roomAbove = ay - gap - block.y;
|
|
17271
17305
|
if (side === "bottom" && height > roomBelow && roomAbove > roomBelow) resolvedSide = "top";
|
|
17272
17306
|
else if (side === "top" && height > roomAbove && roomBelow > roomAbove) resolvedSide = "bottom";
|
|
17307
|
+
room = resolvedSide === "bottom" ? roomBelow : roomAbove;
|
|
17273
17308
|
} else {
|
|
17274
17309
|
const roomRight = block.x + block.width - (ax + aw + gap);
|
|
17275
17310
|
const roomLeft = ax - gap - block.x;
|
|
17276
17311
|
if (side === "right" && width > roomRight && roomLeft > roomRight) resolvedSide = "left";
|
|
17277
17312
|
else if (side === "left" && width > roomLeft && roomRight > roomLeft) resolvedSide = "right";
|
|
17313
|
+
room = resolvedSide === "right" ? roomRight : roomLeft;
|
|
17314
|
+
}
|
|
17315
|
+
const overflows = (vertical ? height : width) > room;
|
|
17316
|
+
const slides = overflows && point && (vertical ? height <= block.height : width <= block.width);
|
|
17317
|
+
if (slides) resolvedSide = side;
|
|
17318
|
+
else if (overflows) {
|
|
17319
|
+
const limit = Math.max(0, room);
|
|
17320
|
+
this.measure(child, vertical ? new Constraints(0, Math.max(0, block.width), 0, limit) : new Constraints(0, limit, 0, Math.max(0, block.height)));
|
|
17321
|
+
width = cRec.measuredWidth;
|
|
17322
|
+
height = cRec.measuredHeight;
|
|
17278
17323
|
}
|
|
17279
17324
|
let x;
|
|
17280
17325
|
let y;
|
|
17281
17326
|
if (vertical) {
|
|
17282
17327
|
y = resolvedSide === "bottom" ? ay + ah + gap : ay - gap - height;
|
|
17328
|
+
if (slides) y = this.clamp(y, block.y, Math.max(block.y, block.y + block.height - height));
|
|
17329
|
+
else if (overflows) y = Math.max(y, block.y);
|
|
17283
17330
|
x = align === "start" ? ax : align === "end" ? ax + aw - width : ax + (aw - width) / 2;
|
|
17284
17331
|
x = this.clamp(x, block.x, Math.max(block.x, block.x + block.width - width));
|
|
17285
17332
|
} else {
|
|
17286
17333
|
x = resolvedSide === "right" ? ax + aw + gap : ax - gap - width;
|
|
17334
|
+
if (slides) x = this.clamp(x, block.x, Math.max(block.x, block.x + block.width - width));
|
|
17335
|
+
else if (overflows) x = Math.max(x, block.x);
|
|
17287
17336
|
y = align === "start" ? ay : align === "end" ? ay + ah - height : ay + (ah - height) / 2;
|
|
17288
17337
|
y = this.clamp(y, block.y, Math.max(block.y, block.y + block.height - height));
|
|
17289
17338
|
}
|
|
@@ -21419,4 +21468,4 @@ function createCanvasSurface(host) {
|
|
|
21419
21468
|
//#endregion
|
|
21420
21469
|
export { isImeKey as $, UiEventType as $a, defaultShadows as $i, proportionalFontMetrics as $n, gradientPaint as $r, registerFontStack as $t, withOverrideSource as A, colorsEqual as Aa, bandOf as Ai, linkHoverOf as An, propertyIsInherited as Ar, adjacentField as At, FlexDirection as B, clearOverrideProperty as Ba, noThemeExtensions as Bi, isEditableNode as Bn, validateRole as Br, createCanvasTextStyle as Bt, SCROLLBAR_LINGER_MS as C, colorsEqualPalette as Ca, propertyValuesEqual as Ci, isNodeInert as Cn, resolveString as Cr, hasDrawnText as Ct, formatExplanation as D, colorToHex as Da, noInsets as Di, resolveCursor as Dn, inheritedPropertyFlags as Dr, selectionRectsIn as Dt, formatConstraints as E, UiBasicColors as Ea, insetsEqual as Ei, isPressable as En, getPropertyNames as Er, paragraphGeometryFrom as Et, clampSize as F, createEnvironmentKey as Fa, themesEqual as Fi, CARET_WIDTH as Fn, UI_SEMANTIC_STATES as Fr, detectEditingPlatform as Ft, CrossAxisAlignment as G, UiVisualState as Ga, highContrastColors as Gi, resolveColorValue as Gn, paintValuesEqual as Gr, runFontString as Gt, placeGridItems as H, resetOverrideWarnings as Ha, themeExtensionsEqual as Hi, isReadOnly as Hn, UI_SUBGRID_AXES as Hr, fillTextRects as Ht, constraintsEqual as I, findEnvironmentKey as Ia, withContrast as Ii, EDITOR_PROP as In, isUiRole as Ir, isPrintable as It, parseCrossAxisAlignment as J, visualState as Ja, densityFactors as Ji, CharacterCountTextMeasurer as Jn, parseTransform as Jr, textRunBackgrounds as Jt, MainAxisAlignment as K, defaultVisualState as Ka, raiseContrast as Ki, isVideoSurface as Kn, pathValuesEqual as Kr, spanOf as Kt, tightenConstraints as L, UiEnvironment as La, withDensity as Li, caretVisibleAt as Ln, isUiSemanticState as Lr, EditableLayout as Lt, contentOffset as M, parseColor as Ma, unknownContainerSize as Mi, linkRunAtPointIn as Mn, propertyValuesEqualByName as Mr, edgeField as Mt, LayoutRecord as N, rgb8 as Na, darkTheme as Ni, setLinkHover as Nn, UiProperties as Nr, editingGroupOf as Nt, formatNumber as O, colorToRgba as Oa, observeViewportInsets as Oi, clearLinkHover as On, inheritedPropertyNames as Or, wordRangeIn as Ot, Constraints as P, rgba as Pa, lightTheme as Pi, CARET_BLINK_MS as Pn, UI_ROLES as Pr, commandForKey as Pt, capturePointer as Q, UiCompositionEvent as Qa, spacingSteps as Qi, layoutParagraph as Qn, MAX_GRADIENT_STOPS as Qr, fontStackFor as Qt, MAX_MEASURES_PER_CHILD as R, UiNode as Ra, defineThemeExtension as Ri, editorFor as Rn, normalizeStates as Rr, applyCanvasTextStyle as Rt, SCROLLBAR_FADE_MS as S, textStylesEqual as Sa, defineProperty as Si, isNodeHitTestable as Sn, resolvePropertyByName as Sr, UiInputDispatcher as St, describeOverrides as T, lightColors as Ta, UiInsetRegistry as Ti, isNodeTabStop as Tn, findPropertyDefinition as Tr, paragraphGeometry as Tt, sizeGridTracks as U, writeDeclaredProperty as Ua, withThemeExtension as Ui, nextCaretToggle as Un, validateSubgrid as Ur, layoutTextLines as Ut, parseFlexDirection as V, overrideSources as Va, themeExtension as Vi, isMultiline as Vn, validateStates as Vr, drawText as Vt, AlignContent as W, writeOverrideProperty as Wa, contrastRatio as Wi, syncEditorValue as Wn, inputsEqual as Wr, runCanvasStyleInto as Wt, CanvasPlatformSurface as X, MOUSE_POINTER as Xa, scaleSpacing as Xi, spannedRunsFor as Xn, transformIsIdentity as Xr, bumpFontStack as Xt, parseMainAxisAlignment as Y, visualStatesEqual as Ya, defaultSpacing as Yi, ParagraphTextMeasurer as Yn, transform as Yr, textRunDecorations as Yt, UiPlatformAdapter as Z, UiBeforeInputEvent as Za, spacingEqual as Zi, ELLIPSIS as Zn, transformsEqual as Zr, clearFontStacks as Zt, LABEL_PADDING_X as _, resolvedSpansOf as _a, borderRadiusEqual as _i, selectableTextNodes as _n, UiGraph as _r, scrollLeaderOf as _t, PaintPictureCache as a, boxShadowReach as aa, fr as ai, computeObjectFitRect as an, UiPinchEvent as ao, offsetAtX as ar, UiGestureRecognizer as at, snapScroll as b, textContentOf as ba, normalizeBorderRadius as bi, setSelectionRange as bn, resolveNumber as br, scrollbarThumbs as bt, EMPTY_RECORDING as c, isShapeName as ca, isMinMaxTrack as ci, normalizeTextAlign as cn, UiTextChangeEvent as co, EditableTextModel as cr, isScrollContainer as ct, tracePathData as d, isTypographyRole as da, percent as di, TEXT_MATCHES_PROP as dn, noKeyModifiers as do, lineStartAt as dr, UiFocusManager as dt, shadowsEqual as ea, gradientsEqual as ei, DEFAULT_FONT_FAMILY as en, UiFocusEvent as eo, caretRectFor as er, pointerDeviceOf as et, ScaledImageCache as f, typographyEqual as fa, repeat as fi, clearMatchRanges as fn, wheelDeltaYOf as fo, nextGraphemeEnd as fr, UiHitTester as ft, paintsAfterChildren as g, hiddenRangesOf as ga, borderRadiusCorners as gi, clearSelectionRange as gn, wordRangeAt as gr, SCROLLBAR_THICKNESS as gt, hasDecorationPhase as h, flattenTextSpans as ha, borderRadius as hi, TEXT_SELECTION_PROP as hn, UiBinding as ho, previousWordStart as hr, SCROLLBAR_MIN_THUMB as ht, traceRoundedRect as i, boxShadowRadius as ia, auto as ii, colorToCss as in, UiPasteEvent as io, offsetAtPoint as ir, UiTouchScroller as it, accumulatedOffsetTo as j, normalizeColor as ja, containerBands as ji, linkOf as jn, propertyNarrowers as jr, comparePositions as jt, labelNode as k, colorValuesEqual as ka, UiContainerSizeSource as ki, hasTextLinks as kn, propertyEffects as kr, textInputOf as kt, PaintRecorder as l, shapesEqual as la, isPercentLength as li, normalizeVerticalAlign as ln, UiWheelDeltaMode as lo, graphemeBoundaries as lr, UiKeyboardController as lt, decorationRect as m, editableSpansOf as ma, UiBorderRadiuses as mi, setMatchRanges as mn, DirtyFlags as mo, previousGraphemeStart as mr, SCROLLBAR_INSET as mt, createCanvasSurface as n, boxShadow as na, radialGradient as ni, DEFAULT_FONT_WEIGHT as nn, UiInputEvent as no, lineIndexForOffset as nr, touchActionFor as nt, paintPictures as o, boxShadowsEqual as oa, isAutoLength as oi, createPaintState as on, UiPointerEvent as oo, offsetForVerticalMove as or, UiPinchRecognizer as ot, decorationColor as p, defaultTextStyle as pa, resolveLength as pi, matchRangesOf as pn, UiNodeType as po, nextWordEnd as pr, SCROLLBAR_HOVER_ZONE as pt, parseAlignContent as q, hasVisualState as qa, relativeLuminance as qi, videoFrameSize as qn, UiTransforms as qr, textMeasureRequest as qt, Canvas2DRenderer as r, boxShadowArraysEqual as ra, validateGradient as ri, DEFAULT_TEXT_COLOR as rn, UiKeyboardEvent as ro, lineLimit as rr, UiEditingController as rt, PaintTarget as s, defaultShapes as sa, isFrLength as si, isPaintVisible as sn, UiSelectionChangeEvent as so, selectionRects as sr, UiWheelController as st, CanvasSurface as t, BOX_SHADOW_BLUR_REACH as ta, linearGradient as ti, DEFAULT_FONT_SIZE as tn, UiGestureEvent as to, lineIndexAtY as tr, prepareInputSurface as tt, replayPaint as u, defaultTypography as ua, minmax as ui, resolvePaintState as un, UiWheelEvent as uo, lineEndAt as ur, UiPointerController as ut, drawOverlayShapes as v, spanAtOffset as va, borderRadiusIsZero as vi, selectableTextOf as vn, DEFAULT_LINE_HEIGHT_FACTOR as vr, scrollRange as vt, describeLength as w, darkColors as wa, UiEnvironmentKeys as wi, isNodeSelectable as wn, closestPropertyName as wr, offsetAtPointIn as wt, LayoutEngine as x, textSpansEqual as xa, uniformBorderRadius as xi, isNodeFocusable as xn, resolveProperty as xr, scrollbarZoneAt as xt, labelOrigin as y, spannedTextOf as ya, borderRadiusValuesEqual as yi, selectionRangeOf as yn, resolveBoolean as yr, scrollbarThumb as yt, isLayoutProtocol as z, DirtyNodeSet as za, hasThemeExtension as zi, editorOf as zn, statesEqual as zr, buildFontString as zt };
|
|
21421
21470
|
|
|
21422
|
-
//# sourceMappingURL=CanvasSurface-
|
|
21471
|
+
//# sourceMappingURL=CanvasSurface-cRmWIUfC.js.map
|