gesso-core 0.5.0 → 0.6.0
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 +33 -0
- package/dist/{CanvasSurface-CDjWI3EH.js → CanvasSurface-CKvX3pXn.js} +641 -205
- package/dist/CanvasSurface-CKvX3pXn.js.map +1 -0
- package/dist/{index-DBnLGexp.d.ts → index-B9YoiLiW.d.ts} +273 -18
- package/dist/index.d.ts +2 -2
- package/dist/index.js +193 -55
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -1
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/CanvasSurface-CDjWI3EH.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# gesso-core
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- bf21b17: A `Dialog` dims the page behind it, as a browser draws `<dialog>::backdrop`. Palettes have a new `scrim` token, a colour with alpha: the light page's ink at 40% in `lightColors`, black at 60% in `darkColors`, and left alone by high contrast. A custom palette written out in full needs one. Overlay entries take `scrim`, on by default for a `modal` entry and off for every other, so a menu or a list of suggestions never dims the page; the scrim takes its theme from the entry's `environment` and fades in at a dialog's pace, or appears at once under reduced motion. `Dialog` takes `scrim={false}` to leave the page undimmed; its backdrop still keeps the page from presses.
|
|
8
|
+
- 013e064: `color` cascades, as the property reference always said it did: text that names no colour takes the `color` of the nearest ancestor that set one, unless a nearer `textStyle` brings its own. A theme token travels as a name and is resolved where the text is painted, so `<box theme={darkTheme} color="text">` draws its plain text in the dark palette's `text`, and a card inside it that provides another theme draws in that theme's. Until now a node's own `color` reached nothing below it, and plain text under a dark root drew in the default style's near-black on the dark background. Text that already names a colour or a role is unchanged; text that names neither, under a container that sets a `color`, now takes that colour. Changing a cascaded colour repaints the subtree without laying it out again. `UiEnvironmentKeys.color` is the new key the colour travels on, and an overlay carries it from where it was declared.
|
|
9
|
+
- 684d68a: The text style properties cascade, as the property reference always said they did: `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, `letterSpacing`, `textAlign`, `textDirection`, `fontStyle`, `fontStretch`, `fontVariant`, `fontKerning` and `textDecoration` set on a container now reach the text below it. Until now they were inherited only from the nearest `textStyle`, so `<row fontSize={12}>` left every text in the row at the default 14. A container's fields are laid over the style in scope, so `<box textStyle="body" fontWeight={600}>` gives its text the body style in a heavier weight, and a text that sets a field itself keeps its own. A container that sets `fontSize` without `lineHeight` gives the text below it a normal line for that size, 1.2 times it, as it already did for itself. Text under a container that sets one of these now draws, and measures, with it. Changing a cascaded underline, alignment or direction repaints the subtree without laying it out again.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 3b20918: An absolutely positioned node is placed again when its containing block changes size, even when its parent keeps its box. A panel pinned to the window's corner from inside a column used to stay where that corner was when the window was resized, because nothing placed the column, and so the panel, again.
|
|
14
|
+
- e9f86a2: An anchored overlay (a tooltip, a menu, a popover) now opens beside where its anchor is drawn when an ancestor of the anchor has a `transform`. A card on a panned and zoomed canvas used to get its tooltip where the card would be at zoom 1 with no pan, often nowhere near it; the anchor is now carried through every ancestor's translate, scale and rotation, as well as the scroll offsets it already followed, and an overlay that lives under a transform of its own is placed in that space. The accessibility mirror puts its elements over the same drawn boxes, so a screen reader's outline and touch exploration find the card where it is. A node's own transform still takes no part, so a turning spinner neither shakes its tooltip nor moves its element. `LayoutEngine.screenBox(node)` answers the question for anything else that needs it.
|
|
15
|
+
- a81d551: A row or column without a size of its own no longer comes out wider than the space it was given because a `flex: 1` child holds long content. It wrapped around that content's whole line, past its own maximum, and nothing flexed: in a fixed-size button, which centres its content, a long label was pushed off both edges and the first words of it were clipped. The container now stops at the space there is, and the flexible child takes what is left, wrapping or truncating its text there.
|
|
16
|
+
- 820aee8: Everything that measures a node against the canvas now takes the `transform` of every ancestor into account, as painting and hit testing always have. Under a panned and zoomed parent (cards on a map inside a "camera" box) several things used to work from where the node would be drawn at zoom 1 with no pan:
|
|
17
|
+
|
|
18
|
+
- A press from the accessibility mirror or an automation tool, and Enter or Space on a focused button, now click the centre the node is drawn at rather than a point that could be off the node entirely.
|
|
19
|
+
- A modifier's `layoutBox()` and the box `onLayout` reports are the drawn box, so a slider, split pane or colour picker on a zoomed card turns a press into the right value, and `onLayout` hears when a pan above the node moves it on screen. Its size is the drawn size, so a fraction of it stays a fraction; `flowBox()` keeps the laid-out size, and the motion pivot, `breakpoint`, `sizeContainer` and `publishInset` now read that, so a zoom neither shifts a pivot nor crosses a breakpoint. The new `measureFlow` modifier is `measure` for the laid-out box; a virtual list's reveal and a `DataTable`'s sticky header use it, so they scroll by the right amount under a zoom.
|
|
20
|
+
- The caret rectangle handed to the shell, which positions the hidden text field and the IME candidate window, follows the caret where it is drawn.
|
|
21
|
+
- A press beside the fields of an editing group, a drag across them, and a text selection dragged past the end of a line find the field or line nearest the pointer on screen.
|
|
22
|
+
- The mirror's box for a focused node that is scrolled out of view, and the layout inspector's highlight and heatmap, are drawn over the node where it is.
|
|
23
|
+
|
|
24
|
+
`LayoutEngine.screenBox(node, part?)` takes an optional rectangle in the node's own coordinates and answers where that part of it is drawn. `EditingHost` and `SelectionHost` take an optional `screenBox`; a host without one behaves as before. With no transform above a node, every answer is the same as before.
|
|
25
|
+
|
|
26
|
+
## 0.5.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 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`.
|
|
31
|
+
- 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.
|
|
32
|
+
- 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.
|
|
33
|
+
- 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.
|
|
34
|
+
- 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.
|
|
35
|
+
|
|
3
36
|
## 0.5.0
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|