gesso-core 0.5.0 → 0.5.1
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 +10 -0
- package/dist/{CanvasSurface-CDjWI3EH.js → CanvasSurface-Dok8FuyX.js} +63 -10
- package/dist/CanvasSurface-Dok8FuyX.js.map +1 -0
- package/dist/{index-DBnLGexp.d.ts → index-B3zydgF2.d.ts} +73 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +119 -19
- 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-CDjWI3EH.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# gesso-core
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 77195a4: Two more semantics properties, for a field that opens a list of suggestions. `controls` is a relation, like `activeDescendant`: the node this one shows or changes, such as the list a combobox's field has open, held on the record as that node's id and written by the mirror as `aria-controls` naming its element. `autocomplete` (`'list' | 'inline' | 'both'`, the new `UiAutocomplete`) says what a field offers as it's typed into, written as `aria-autocomplete`. The editing proxy writes both while a field has focus, so `EditingMirrorTarget.describe` takes the controlled element's DOM id after the active descendant's. `Combobox` uses them: its field controls the list while it's open, and its autocomplete is `list`.
|
|
8
|
+
- 6b71716: An overlay can open beside a part of its anchor: `anchorRect` on an overlay entry (and on `useOverlay`'s options), and the layout property of the same name, is a rectangle in the anchor's own coordinates that the entry is placed against, with the same flip and shift, and that it follows through scrolling and layout as it follows the anchor. It can be an Observable, so it moves without the entry opening again. `EditingService.caretRectOf(node, offset)` (and `UiEditingController.caretRectOf`) answers for a character other than the caret's, so a list opened by `@` sits under the `@` as the name is typed, and goes to the next line with it when it wraps. A point opened beside the caret stayed behind when the page scrolled.
|
|
9
|
+
- 581cf89: An open overlay now follows the theme of the place it was declared. The overlay layer read the theme, text style and content colour once, as the entry opened, so a dialog or menu open when the system turned dark, or when a theme the person chose arrived from another worker a moment after they opened it, stayed in the old theme over a page in the new one until it closed. Underneath, a modifier's `host.environment(key, of?)` and `host.onEnvironment(listener, of?)` can read and follow another node's environment, and an environment provided by a node whose own environment changed in the same frame is rebuilt in that frame.
|
|
10
|
+
- 13c096f: Two ways to show a shortcut besides `formatShortcut`, for a help sheet. `shortcutKeyCaps(steps)` gives the keys one string at a time, one array per press (`[['⇧', '⌘', 'K']]` on a Mac, `[['Ctrl', 'Shift', 'K']]` elsewhere), to draw as key caps; they are the pieces `formatShortcut` joins. `describeShortcut(steps)` says it in words a screen reader reads out (`Shift Command K`, `Down arrow`, `Question mark`, `g then d`), since a cap's symbols are read inconsistently and punctuation is skipped.
|
|
11
|
+
- db7040b: A shortcut on punctuation, a digit or a symbol now matches the character the press produced, whatever it took to type it. `keys: '?'` used to match nothing, because every layout reaches `?` with Shift (Shift+/ in the US, Shift+ß in Germany, Shift+, in France), and `'Shift+?'` worked only where the layout used Shift rather than AltGr. Now `?` and `Shift+?` are the same shortcut, and a bare symbol also matches when AltGr (Control and Alt, or Option on a Mac) typed it. Letters keep their Shift, so `Shift+L` and `l` stay apart.
|
|
12
|
+
|
|
3
13
|
## 0.5.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -3809,6 +3809,19 @@ const UiProperties = {
|
|
|
3809
3809
|
inherited: false,
|
|
3810
3810
|
affects: L
|
|
3811
3811
|
}),
|
|
3812
|
+
/**
|
|
3813
|
+
* The part of the anchor to be placed beside, in the anchor's own
|
|
3814
|
+
* coordinates (from its border box's top left): a character in a
|
|
3815
|
+
* field, the word being typed. The node is placed against that
|
|
3816
|
+
* rectangle as it would be against the whole anchor, and follows the
|
|
3817
|
+
* anchor through scrolling in the same way. Ignored without `anchor`.
|
|
3818
|
+
*/
|
|
3819
|
+
anchorRect: defineProperty({
|
|
3820
|
+
name: "anchorRect",
|
|
3821
|
+
defaultValue: void 0,
|
|
3822
|
+
inherited: false,
|
|
3823
|
+
affects: L
|
|
3824
|
+
}),
|
|
3812
3825
|
/** Gap between an anchored node and its anchor. */
|
|
3813
3826
|
anchorOffset: defineProperty({
|
|
3814
3827
|
name: "anchorOffset",
|
|
@@ -4306,6 +4319,28 @@ const UiProperties = {
|
|
|
4306
4319
|
affects: S
|
|
4307
4320
|
}),
|
|
4308
4321
|
/**
|
|
4322
|
+
* The node this one shows or changes: the list a combobox's field
|
|
4323
|
+
* opens, the panel a tab switches to. The node should be a record of
|
|
4324
|
+
* its own (a `listbox`, a `tabpanel`); see `aria-controls`.
|
|
4325
|
+
*/
|
|
4326
|
+
controls: defineProperty({
|
|
4327
|
+
name: "controls",
|
|
4328
|
+
defaultValue: void 0,
|
|
4329
|
+
inherited: false,
|
|
4330
|
+
affects: S
|
|
4331
|
+
}),
|
|
4332
|
+
/**
|
|
4333
|
+
* What a field offers as it's typed into: `list` for a combobox whose
|
|
4334
|
+
* list suggests, `inline` for a field that fills in the rest of the
|
|
4335
|
+
* word, `both`. See `aria-autocomplete`.
|
|
4336
|
+
*/
|
|
4337
|
+
autocomplete: defineProperty({
|
|
4338
|
+
name: "autocomplete",
|
|
4339
|
+
defaultValue: void 0,
|
|
4340
|
+
inherited: false,
|
|
4341
|
+
affects: S
|
|
4342
|
+
}),
|
|
4343
|
+
/**
|
|
4309
4344
|
* How deep a treeitem sits, 1 for a root. A tree is rendered as a
|
|
4310
4345
|
* flat list of rows — it must be, to be virtualized — so the nesting
|
|
4311
4346
|
* exists nowhere else for a reader to find.
|
|
@@ -4712,6 +4747,13 @@ function propertyValuesEqualByName(name, a, b) {
|
|
|
4712
4747
|
}
|
|
4713
4748
|
//#endregion
|
|
4714
4749
|
//#region src/graph/UiGraph.ts
|
|
4750
|
+
/**
|
|
4751
|
+
* How many times one frame rebuilds environments that rebuilding others
|
|
4752
|
+
* dirtied. One is the ordinary case and two is an overlay following its
|
|
4753
|
+
* declaration; more means listeners answering each other, which a frame
|
|
4754
|
+
* stops rather than hangs on.
|
|
4755
|
+
*/
|
|
4756
|
+
const MAX_ENVIRONMENT_PASSES = 8;
|
|
4715
4757
|
var UiGraph = class {
|
|
4716
4758
|
constructor() {
|
|
4717
4759
|
this.root = new UiNode("root", "root");
|
|
@@ -5251,16 +5293,17 @@ var UiGraph = class {
|
|
|
5251
5293
|
* the change to descendants and clearing the flag.
|
|
5252
5294
|
*/
|
|
5253
5295
|
processEnvironmentDirty() {
|
|
5254
|
-
this.environmentDirty = false;
|
|
5255
|
-
const nodes = this.dirtyNodes.take();
|
|
5256
5296
|
this.suppressDirtyListener = true;
|
|
5257
5297
|
try {
|
|
5258
|
-
for (
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5298
|
+
for (let pass = 0; pass === 0 || this.environmentDirty && pass < MAX_ENVIRONMENT_PASSES; pass++) {
|
|
5299
|
+
this.environmentDirty = false;
|
|
5300
|
+
for (const node of this.dirtyNodes.take()) {
|
|
5301
|
+
if ((node.dirtyFlags & 128) !== 0) {
|
|
5302
|
+
node.dirtyFlags &= -129;
|
|
5303
|
+
this.rebuildEnvironment(node, inheritedPropertyFlags);
|
|
5304
|
+
}
|
|
5305
|
+
if (node.dirtyFlags !== 0) this.dirtyNodes.mark(node);
|
|
5262
5306
|
}
|
|
5263
|
-
if (node.dirtyFlags !== 0) this.dirtyNodes.mark(node);
|
|
5264
5307
|
}
|
|
5265
5308
|
} finally {
|
|
5266
5309
|
this.suppressDirtyListener = false;
|
|
@@ -12344,11 +12387,16 @@ var UiEditingController = class {
|
|
|
12344
12387
|
* a second measurer that must never disagree with this one. Asking
|
|
12345
12388
|
* is the only version that stays right.
|
|
12346
12389
|
*
|
|
12390
|
+
* `offset` asks where a caret at another character would be: where
|
|
12391
|
+
* the word being typed began, for a list that stays under its start.
|
|
12392
|
+
* It is clamped to the text.
|
|
12393
|
+
*
|
|
12347
12394
|
* Null when the node is not an editable, or has not been laid out.
|
|
12348
12395
|
*/
|
|
12349
|
-
caretRectOf(node) {
|
|
12396
|
+
caretRectOf(node, offset) {
|
|
12350
12397
|
if (!isEditableNode(node) || this.host.recordFor(node) === void 0) return null;
|
|
12351
|
-
|
|
12398
|
+
const layout = this.layoutOf(node);
|
|
12399
|
+
return offset === void 0 ? layout.caretRect() : layout.caretRect(Math.max(0, Math.min(offset, layout.model.text.length)));
|
|
12352
12400
|
}
|
|
12353
12401
|
layoutOf(node) {
|
|
12354
12402
|
const rec = this.host.recordFor(node);
|
|
@@ -16636,6 +16684,11 @@ var LayoutEngine = class {
|
|
|
16636
16684
|
const stickyChild = this.stickyOffsetOf(child);
|
|
16637
16685
|
const ax = anchorRec.x + stickyAnchor.x - scrollAnchor.x + scrollChild.x - stickyChild.x;
|
|
16638
16686
|
const ay = anchorRec.y + stickyAnchor.y - scrollAnchor.y + scrollChild.y - stickyChild.y;
|
|
16687
|
+
const part = child.properties.get("anchorRect");
|
|
16688
|
+
if (part !== void 0 && part !== null) {
|
|
16689
|
+
this.placeBeside(child, cRec, ax + part.x, ay + part.y, part.width, part.height, block);
|
|
16690
|
+
return;
|
|
16691
|
+
}
|
|
16639
16692
|
this.placeBeside(child, cRec, ax, ay, anchorRec.width, anchorRec.height, block);
|
|
16640
16693
|
}
|
|
16641
16694
|
/**
|
|
@@ -20721,4 +20774,4 @@ function createCanvasSurface(host) {
|
|
|
20721
20774
|
//#endregion
|
|
20722
20775
|
export { pointerDeviceOf as $, UiKeyboardEvent as $a, boxShadow as $i, caretRectFor as $n, radialGradient as $r, DEFAULT_FONT_SIZE as $t, withOverrideSource as A, rgb8 as Aa, darkTheme as Ai, linkRunAtPointIn as An, UiProperties as Ar, edgeField as At, FlexDirection as B, writeDeclaredProperty as Ba, withThemeExtension as Bi, isReadOnly as Bn, validateSubgrid as Br, fillTextRects as Bt, SCROLLBAR_LINGER_MS as C, UiBasicColors as Ca, insetsEqual as Ci, isNodeTabStop as Cn, findPropertyDefinition as Cr, offsetAtPointIn as Ct, formatExplanation as D, colorsEqual as Da, bandOf as Di, hasTextLinks as Dn, propertyEffects as Dr, wordRangeIn as Dt, formatConstraints as E, colorValuesEqual as Ea, UiContainerSizeSource as Ei, clearLinkHover as En, inheritedPropertyNames as Er, selectionRectsIn as Et, clampSize as F, UiNode as Fa, defineThemeExtension as Fi, caretVisibleAt as Fn, normalizeStates as Fr, EditableLayout as Ft, CrossAxisAlignment as G, visualState as Ga, densityFactors as Gi, videoFrameSize as Gn, parseTransform as Gr, textMeasureRequest as Gt, placeGridItems as H, UiVisualState as Ha, highContrastColors as Hi, syncEditorValue as Hn, paintValuesEqual as Hr, runCanvasStyleInto as Ht, constraintsEqual as I, DirtyNodeSet as Ia, hasThemeExtension as Ii, editorFor as In, statesEqual as Ir, applyCanvasTextStyle as It, parseCrossAxisAlignment as J, UiBeforeInputEvent as Ja, spacingEqual as Ji, spannedRunsFor as Jn, transformsEqual as Jr, bumpFontStack as Jt, MainAxisAlignment as K, visualStatesEqual as Ka, defaultSpacing as Ki, CharacterCountTextMeasurer as Kn, transform as Kr, textRunBackgrounds as Kt, tightenConstraints as L, clearOverrideProperty as La, noThemeExtensions as Li, editorOf as Ln, validateRole as Lr, buildFontString as Lt, contentOffset as M, createEnvironmentKey as Ma, themesEqual as Mi, CARET_BLINK_MS as Mn, UI_SEMANTIC_STATES as Mr, commandForKey as Mt, LayoutRecord as N, findEnvironmentKey as Na, withContrast as Ni, CARET_WIDTH as Nn, isUiRole as Nr, detectEditingPlatform as Nt, formatNumber as O, normalizeColor as Oa, containerBands as Oi, linkHoverOf as On, propertyIsInherited as Or, adjacentField as Ot, Constraints as P, UiEnvironment as Pa, withDensity as Pi, EDITOR_PROP as Pn, isUiSemanticState as Pr, isPrintable as Pt, capturePointer as Q, UiInputEvent as Qa, BOX_SHADOW_BLUR_REACH as Qi, DEFAULT_LINE_HEIGHT_FACTOR as Qn, linearGradient as Qr, DEFAULT_FONT_FAMILY as Qt, MAX_MEASURES_PER_CHILD as R, overrideSources as Ra, themeExtension as Ri, isEditableNode as Rn, validateStates as Rr, createCanvasTextStyle as Rt, SCROLLBAR_FADE_MS as S, lightColors as Sa, UiInsetRegistry as Si, isNodeSelectable as Sn, closestPropertyName as Sr, hasDrawnText as St, describeOverrides as T, colorToRgba as Ta, observeViewportInsets as Ti, resolveCursor as Tn, inheritedPropertyFlags as Tr, paragraphGeometryFrom as Tt, sizeGridTracks as U, defaultVisualState as Ua, raiseContrast as Ui, resolveColorValue as Un, pathValuesEqual as Ur, runFontString as Ut, parseFlexDirection as V, writeOverrideProperty as Va, contrastRatio as Vi, nextCaretToggle as Vn, inputsEqual as Vr, layoutTextLines as Vt, AlignContent as W, hasVisualState as Wa, relativeLuminance as Wi, isVideoSurface as Wn, UiTransforms as Wr, spanOf as Wt, CanvasPlatformSurface as X, UiFocusEvent as Xa, defaultShadows as Xi, layoutParagraph as Xn, gradientPaint as Xr, fontStackFor as Xt, parseMainAxisAlignment as Y, UiEventType as Ya, spacingSteps as Yi, ELLIPSIS as Yn, MAX_GRADIENT_STOPS as Yr, clearFontStacks as Yt, UiPlatformAdapter as Z, UiGestureEvent as Za, shadowsEqual as Zi, proportionalFontMetrics as Zn, gradientsEqual as Zr, registerFontStack as Zt, LABEL_PADDING_X as _, textContentOf as _a, normalizeBorderRadius as _i, selectionRangeOf as _n, resolveNumber as _r, scrollRange as _t, PaintPictureCache as a, isShapeName as aa, isMinMaxTrack as ai, isPaintVisible as an, UiWheelDeltaMode as ao, offsetForVerticalMove as ar, UiPinchRecognizer as at, snapScroll as b, colorsEqualPalette as ba, propertyValuesEqual as bi, isNodeHitTestable as bn, resolveString as br, scrollbarZoneAt as bt, EMPTY_RECORDING as c, isTypographyRole as ca, percent as ci, resolvePaintState as cn, wheelDeltaYOf as co, graphemeBoundaries as cr, UiKeyboardController as ct, tracePathData as d, editableSpansOf as da, UiBorderRadiuses as di, matchRangesOf as dn, UiBinding as do, nextGraphemeEnd as dr, UiHitTester as dt, boxShadowArraysEqual as ea, validateGradient as ei, DEFAULT_FONT_WEIGHT as en, UiPasteEvent as eo, lineIndexAtY as er, prepareInputSurface as et, ScaledImageCache as f, flattenTextSpans as fa, borderRadius as fi, setMatchRanges as fn, nextWordEnd as fr, SCROLLBAR_HOVER_ZONE as ft, paintsAfterChildren as g, spannedTextOf as ga, borderRadiusValuesEqual as gi, selectableTextOf as gn, resolveBoolean as gr, scrollLeaderOf as gt, hasDecorationPhase as h, spanAtOffset as ha, borderRadiusIsZero as hi, selectableTextNodes as hn, wordRangeAt as hr, SCROLLBAR_THICKNESS as ht, traceRoundedRect as i, defaultShapes as ia, isFrLength as ii, createPaintState as in, UiTextChangeEvent as io, offsetAtX as ir, UiGestureRecognizer as it, accumulatedOffsetTo as j, rgba as ja, lightTheme as ji, setLinkHover as jn, UI_ROLES as jr, editingGroupOf as jt, labelNode as k, parseColor as ka, unknownContainerSize as ki, linkOf as kn, propertyValuesEqualByName as kr, comparePositions as kt, PaintRecorder as l, typographyEqual as la, repeat as li, TEXT_MATCHES_PROP as ln, UiNodeType as lo, lineEndAt as lr, UiPointerController as lt, decorationRect as m, resolvedSpansOf as ma, borderRadiusEqual as mi, clearSelectionRange as mn, previousWordStart as mr, SCROLLBAR_MIN_THUMB as mt, createCanvasSurface as n, boxShadowReach as na, fr as ni, colorToCss as nn, UiPointerEvent as no, lineLimit as nr, UiEditingController as nt, paintPictures as o, shapesEqual as oa, isPercentLength as oi, normalizeTextAlign as on, UiWheelEvent as oo, selectionRects as or, UiWheelController as ot, decorationColor as p, hiddenRangesOf as pa, borderRadiusCorners as pi, TEXT_SELECTION_PROP as pn, previousGraphemeStart as pr, SCROLLBAR_INSET as pt, parseAlignContent as q, MOUSE_POINTER as qa, scaleSpacing as qi, ParagraphTextMeasurer as qn, transformIsIdentity as qr, textRunDecorations as qt, Canvas2DRenderer as r, boxShadowsEqual as ra, isAutoLength as ri, computeObjectFitRect as rn, UiSelectionChangeEvent as ro, offsetAtPoint as rr, UiTouchScroller as rt, PaintTarget as s, defaultTypography as sa, minmax as si, normalizeVerticalAlign as sn, noKeyModifiers as so, EditableTextModel as sr, isScrollContainer as st, CanvasSurface as t, boxShadowRadius as ta, auto as ti, DEFAULT_TEXT_COLOR as tn, UiPinchEvent as to, lineIndexForOffset as tr, touchActionFor as tt, replayPaint as u, defaultTextStyle as ua, resolveLength as ui, clearMatchRanges as un, DirtyFlags as uo, lineStartAt as ur, UiFocusManager as ut, drawOverlayShapes as v, textSpansEqual as va, uniformBorderRadius as vi, setSelectionRange as vn, resolveProperty as vr, scrollbarThumb as vt, describeLength as w, colorToHex as wa, noInsets as wi, isPressable as wn, getPropertyNames as wr, paragraphGeometry as wt, LayoutEngine as x, darkColors as xa, UiEnvironmentKeys as xi, isNodeInert as xn, UiGraph as xr, UiInputDispatcher as xt, labelOrigin as y, textStylesEqual as ya, defineProperty as yi, isNodeFocusable as yn, resolvePropertyByName as yr, scrollbarThumbs as yt, isLayoutProtocol as z, resetOverrideWarnings as za, themeExtensionsEqual as zi, isMultiline as zn, UI_SUBGRID_AXES as zr, drawText as zt };
|
|
20723
20776
|
|
|
20724
|
-
//# sourceMappingURL=CanvasSurface-
|
|
20777
|
+
//# sourceMappingURL=CanvasSurface-Dok8FuyX.js.map
|