gesso-framework 0.6.26 → 0.6.27
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 +52 -0
- package/dist/{index-XlACZQyY.d.ts → index-NIdw2_S0.d.ts} +61 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +106 -34
- package/dist/index.js.map +1 -1
- package/dist/remote/index.d.ts +1 -1
- package/dist/worker/index.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# gesso-framework
|
|
2
2
|
|
|
3
|
+
## 0.6.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ff9dd85: A grid can say where its rows and cells sit in the whole of its data, not only among the ones that are mounted. Four new semantics properties carry it: `rowCount` and `columnCount` on the `grid`, `treegrid` or `table` (use -1 when the count is not known), `rowIndex` on each `row` and `columnIndex` on each cell, all counting from 1. They are carried into the semantics record under the same names, and the accessibility mirror writes them as `aria-rowcount`, `aria-colcount`, `aria-rowindex` and `aria-colindex`. A virtualized grid used to leave a screen reader counting the cells in view, so after scrolling sideways the first visible cell was announced as column 1 whatever column it was really in.
|
|
8
|
+
- bdc4780: A key release the application claims cancels the browser's default, as a key press already did. A lone Alt opens a Windows browser's menu when it is released, so a `MenuBar` that takes focus on Alt also had the browser's own menu open over it. On the main thread the platform adapter now passes a claimed release on to the browser event; in a render worker, `interceptKey` is asked about releases as well as presses.
|
|
9
|
+
- 66690b6: A `NumberInput` with a minimum can be typed into. Every keystroke used to be clamped, so with `min: 10` the "1" of "15" became "10" under the caret and the "5" made it "105". The field now keeps what is typed, reports a number only once it is one the field could hold, and bounds the text when it is left or Enter is pressed. A field left blank or holding text that is not a number goes back to the value it had, where it used to report 0, a number nobody typed and often not in range.
|
|
10
|
+
|
|
11
|
+
A `Slider` under `textDirection: 'rtl'` agrees with what it draws. The fill already grew from the right, but a press and the arrow keys still read left to right, so a press near the right edge set nearly the maximum and Right made the fill longer. A press now counts from where the track starts, Left is more and Right is less, Up and Down are unchanged, and the thumb sits centred on the end of the fill rather than six pixels short of it.
|
|
12
|
+
|
|
13
|
+
A `RadioGroup` marked `invalid` or given an `error` rings its circles in the danger colour, as a `Checkbox` rings its box; it used to say so only in the message under it. Its `direction` is documented as read once, when the group renders. A row of options under `textDirection: 'rtl'` takes Left as the next option and Right as the previous one, so the arrows move toward the option they point at; they used to move away from it.
|
|
14
|
+
|
|
15
|
+
`SegmentedControl` takes a `ref`, as every other control does, and hands it the track.
|
|
16
|
+
|
|
17
|
+
`onSubmit` on a `TextArea`, or on a multiline `TextInput`, is called on Command-Enter or Control-Enter. It was on the props and never called, since Enter alone is a new line there.
|
|
18
|
+
|
|
19
|
+
`bind(cell, 'checked')` spreads into JSX beside other props. The handler's name defaulted to `onChange` only in principle: it was inferred from the props around the spread, so `<Switch label="Sync" {...bind(on, 'checked')} />` failed to compile with "'label' is specified more than once" and needed `'onChange'` spelled out.
|
|
20
|
+
|
|
21
|
+
- bdc4780: Overlays follow the reading direction. An overlay entry's `placement`
|
|
22
|
+
now names `start` and `end` as reading edges: along the top or the
|
|
23
|
+
bottom, `-start` lines the entry up with the anchor's start edge, which
|
|
24
|
+
is its right under `textDirection="rtl"`, and the new sides `start`,
|
|
25
|
+
`end`, `start-start`, `start-end`, `end-start` and `end-end` open beside
|
|
26
|
+
the anchor toward those edges. `left` and `right` stay physical. An
|
|
27
|
+
unanchored entry takes `start` and `end` edge offsets beside `left` and
|
|
28
|
+
`right`. The direction is read from the entry's `environment`, or its
|
|
29
|
+
anchor, the same node its theme comes from, and followed while the
|
|
30
|
+
entry is open.
|
|
31
|
+
|
|
32
|
+
So under right-to-left text a `Toast` at `bottom-start` is pinned to the
|
|
33
|
+
bottom right corner and `bottom-end` to the bottom left; a `Menu` lines
|
|
34
|
+
up with its button's right edge, opens a context menu leftward from the
|
|
35
|
+
pointer, opens submenus to the left of their items (flipping right at
|
|
36
|
+
the window edge), and swaps Left and Right for opening and closing them;
|
|
37
|
+
`Combobox`, `DatePicker`, `Select` and `MenuBar` line their lists up
|
|
38
|
+
with the trigger's right edge; and `Tooltip` takes `start` and `end`
|
|
39
|
+
sides. Code that passed `bottom-start` to mean the left edge in a
|
|
40
|
+
right-to-left tree now gets the right edge.
|
|
41
|
+
|
|
42
|
+
- bdc4780: Scrolling a `DataTable`, `LazyList` or `Tree` to a row that was never mounted lands the row in view even when the rows are taller or shorter than the estimate. The jump goes by the estimate for every row on the way, and when that was short of the real height the row it was for ended up below the bottom edge, and stayed there: nothing ran another frame to measure it. A `UiVirtualWindow` can now hold an item in view (`holdInView`) until it has been measured, the runtime runs the frame that measures it, and the window folds the correction into the scroll adjustment it already returns.
|
|
43
|
+
- 69e5d47: A scroll container that reads right to left can reach everything in it. Its content starts at the right edge and overflows to the left, but its horizontal offset was clamped to `[0, overflow]`, toward the right, so a wide right-to-left table, row or sheet showed its first columns and nothing a wheel, a swipe or a dragged thumb could do reached the rest. Such a container now follows CSS: `scrollX` runs from minus the overflow up to `0`, where `0` shows the start edge and is where an unscrolled container sits. Its content extent is measured from the right edge, the horizontal thumb starts at the right of its track, revealing a row scrolls left to it, a sticky column at `right: 0` holds there, and a `LazyRow` or `LazySheet` mounts what the offset shows. `scrollBounds` and `scrollsFromRight` answer the range and the direction for a record. Text fields are unchanged: a field scrolls its own text by the caret, from `0` up.
|
|
44
|
+
- Updated dependencies [ff9dd85]
|
|
45
|
+
- Updated dependencies [bdc4780]
|
|
46
|
+
- Updated dependencies [baf8dec]
|
|
47
|
+
- Updated dependencies [cbac578]
|
|
48
|
+
- Updated dependencies [bdc4780]
|
|
49
|
+
- Updated dependencies [ff9dd85]
|
|
50
|
+
- Updated dependencies [69e5d47]
|
|
51
|
+
- Updated dependencies [bdc4780]
|
|
52
|
+
- Updated dependencies [3daa932]
|
|
53
|
+
- gesso-core@0.6.27
|
|
54
|
+
|
|
3
55
|
## 0.6.26
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
|
@@ -839,17 +839,31 @@ declare function show(when: Observable<unknown> | unknown, children: () => UiChi
|
|
|
839
839
|
* site rather than hidden by a helper pretending the key is writable.
|
|
840
840
|
*
|
|
841
841
|
* Sugar over the controlled contract, not a replacement for it.
|
|
842
|
+
*
|
|
843
|
+
* A renamed value with the handler left as `onChange` is an overload of
|
|
844
|
+
* its own rather than a default on the event name's type parameter. A
|
|
845
|
+
* parameter with no argument to infer from is inferred from where the
|
|
846
|
+
* result goes, and a spread into JSX goes into the props around it, so
|
|
847
|
+
* the default never applied: the name became every prop beside the
|
|
848
|
+
* spread, and `<Switch label="Sync" {...bind(on, 'checked')} />` said
|
|
849
|
+
* `label` was given twice.
|
|
842
850
|
*/
|
|
843
851
|
declare function bind<T>(cell: InternalState<T>): {
|
|
844
852
|
value: InternalState<T>;
|
|
845
853
|
onChange: (next: T) => void;
|
|
846
854
|
};
|
|
847
|
-
declare function bind<T, V extends string
|
|
855
|
+
declare function bind<T, V extends string>(cell: InternalState<T>, value: V): { [K in V]: InternalState<T>; } & {
|
|
856
|
+
onChange: (next: T) => void;
|
|
857
|
+
};
|
|
858
|
+
declare function bind<T, V extends string, E extends string>(cell: InternalState<T>, value: V, onChange: E): { [K in V]: InternalState<T>; } & { [K in E]: (next: T) => void; };
|
|
848
859
|
declare function bind<T>(cell: ReadableCell<T>, write: (next: T) => void): {
|
|
849
860
|
value: ReadableCell<T>;
|
|
850
861
|
onChange: (next: T) => void;
|
|
851
862
|
};
|
|
852
|
-
declare function bind<T, V extends string
|
|
863
|
+
declare function bind<T, V extends string>(cell: ReadableCell<T>, write: (next: T) => void, value: V): { [K in V]: ReadableCell<T>; } & {
|
|
864
|
+
onChange: (next: T) => void;
|
|
865
|
+
};
|
|
866
|
+
declare function bind<T, V extends string, E extends string>(cell: ReadableCell<T>, write: (next: T) => void, value: V, onChange: E): { [K in V]: ReadableCell<T>; } & { [K in E]: (next: T) => void; };
|
|
853
867
|
//#endregion
|
|
854
868
|
//#region src/themeTokenCell.d.ts
|
|
855
869
|
/**
|
|
@@ -1151,7 +1165,28 @@ type FrameworkChild = UiChild | ComponentElement;
|
|
|
1151
1165
|
declare function createComponent<C extends ComponentType>(component: C, ...args: ComponentArgs<C>): ComponentElement<ComponentProps<C>>;
|
|
1152
1166
|
//#endregion
|
|
1153
1167
|
//#region src/overlay/OverlayService.d.ts
|
|
1154
|
-
|
|
1168
|
+
/**
|
|
1169
|
+
* The side of the anchor an entry opens on and, after a dash, the edge
|
|
1170
|
+
* of the anchor it lines up with along that side; the bare side
|
|
1171
|
+
* centres.
|
|
1172
|
+
*
|
|
1173
|
+
* **`start` and `end` are the reading edges.** Along the top or the
|
|
1174
|
+
* bottom, `-start` lines the entry up with the anchor's start edge,
|
|
1175
|
+
* which is its left in left-to-right text and its right in
|
|
1176
|
+
* right-to-left text: a list under a field begins where the field's
|
|
1177
|
+
* text does. As a side, `start` and `end` open beside the anchor
|
|
1178
|
+
* toward those edges, so a submenu given `end-start` opens past the
|
|
1179
|
+
* end of its row whichever way the row reads. Along the left or right
|
|
1180
|
+
* side the alignment is up and down, which no reading direction turns.
|
|
1181
|
+
*
|
|
1182
|
+
* `left` and `right` stay physical, for a side that is genuinely one
|
|
1183
|
+
* edge of the screen whatever the language: an arrow drawn on a
|
|
1184
|
+
* diagram, a tooltip on a panel that is always on the left.
|
|
1185
|
+
*
|
|
1186
|
+
* The direction is the entry's: the one its content reads in, which is
|
|
1187
|
+
* where its theme comes from too. See `OverlayEntry.environment`.
|
|
1188
|
+
*/
|
|
1189
|
+
type OverlayPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end' | 'start' | 'start-start' | 'start-end' | 'end' | 'end-start' | 'end-end';
|
|
1155
1190
|
/** A rectangle inside an anchor, from its border box's top left. */
|
|
1156
1191
|
interface OverlayRect {
|
|
1157
1192
|
readonly x: number;
|
|
@@ -1183,7 +1218,7 @@ interface OverlayEntry {
|
|
|
1183
1218
|
* when it wraps to the next line, without being opened again.
|
|
1184
1219
|
*/
|
|
1185
1220
|
readonly anchorRect?: Reactive<OverlayRect | undefined>;
|
|
1186
|
-
/** Default 'bottom'. */
|
|
1221
|
+
/** Default 'bottom'. `start` and `end` follow the reading direction; see `OverlayPlacement`. */
|
|
1187
1222
|
readonly placement?: OverlayPlacement;
|
|
1188
1223
|
/** Gap between content and anchor. */
|
|
1189
1224
|
readonly offset?: number;
|
|
@@ -1191,6 +1226,16 @@ interface OverlayEntry {
|
|
|
1191
1226
|
readonly right?: number;
|
|
1192
1227
|
readonly bottom?: number;
|
|
1193
1228
|
readonly left?: number;
|
|
1229
|
+
/**
|
|
1230
|
+
* The offset from the viewport's start edge: its left in
|
|
1231
|
+
* left-to-right text and its right in right-to-left text, in the
|
|
1232
|
+
* entry's direction. For something pinned to a corner a reader looks
|
|
1233
|
+
* for in a particular place, as a toast is. It wins over the physical
|
|
1234
|
+
* offset on the same edge.
|
|
1235
|
+
*/
|
|
1236
|
+
readonly start?: number;
|
|
1237
|
+
/** The offset from the viewport's end edge, as `start` is from its start. */
|
|
1238
|
+
readonly end?: number;
|
|
1194
1239
|
/**
|
|
1195
1240
|
* A point to open beside, relative to the viewport: where a context
|
|
1196
1241
|
* menu was asked for. Placed as an anchor of no size would be, with
|
|
@@ -1295,6 +1340,12 @@ declare class OverlayService {
|
|
|
1295
1340
|
*
|
|
1296
1341
|
* Entries render in store order; a later entry is on top unless it
|
|
1297
1342
|
* sets zIndex.
|
|
1343
|
+
*
|
|
1344
|
+
* `start` and `end`, in a placement or as edge offsets, are resolved to
|
|
1345
|
+
* physical edges here, in the reading direction of the node the entry
|
|
1346
|
+
* takes its environment from, and resolved again if that direction
|
|
1347
|
+
* changes while the entry is open. See `OverlayEntry.environment` for
|
|
1348
|
+
* why that node and not always the anchor.
|
|
1298
1349
|
*/
|
|
1299
1350
|
declare class OverlayLayer extends Component {
|
|
1300
1351
|
overlays: OverlayService;
|
|
@@ -5890,8 +5941,11 @@ interface WorkerAppOptions {
|
|
|
5890
5941
|
* predicate rather than a list so it can say "Ctrl or Cmd" in one
|
|
5891
5942
|
* line.
|
|
5892
5943
|
*
|
|
5893
|
-
* Called for every keydown that reaches the shell, so it
|
|
5894
|
-
* comparison and nothing more.
|
|
5944
|
+
* Called for every keydown and keyup that reaches the shell, so it
|
|
5945
|
+
* should be a comparison and nothing more. The keyup matters for a key
|
|
5946
|
+
* whose default comes on release: a lone Alt opens a Windows browser's
|
|
5947
|
+
* menu when it comes up, so a `MenuBar` that answers to Alt claims
|
|
5948
|
+
* both.
|
|
5895
5949
|
*/
|
|
5896
5950
|
interceptKey?: (event: KeyboardEvent) => boolean;
|
|
5897
5951
|
/**
|
|
@@ -8784,4 +8838,4 @@ declare class RenderWorkerApp {
|
|
|
8784
8838
|
}
|
|
8785
8839
|
//#endregion
|
|
8786
8840
|
export { StorageAdapter as $, UiNodeReport as $n, mutate as $r, UiFramePhase as $t, Presence as A, AudioService as An, ChannelRegistry as Ar, createShellHistory as At, PersistedOptions as B, ShellFileResult as Bn, themeTokenCell as Br, UiTreeNode as Bt, FocusService as C, buildPath as Cn, pick as Cr, createApp as Ct, FindService as D, AudioMetadata as Dn, createChannelRegistry as Dr, ShellHistory as Dt, TextService as E, AudioAction as En, ChannelRegistryHandle as Er, WorkerAppOptions as Et, AudioSinkOptions as F, SpringOptions as Fn, Output as Fr, ConsoleEntry as Ft, IndexedDbStorage as G, ShellStorageOp as Gn, Each as Gr, ShellToRuntimeMessage as Gt, persisted as H, ShellRecentFile as Hn, Show as Hr, treeText as Ht, AudioSinkOutput as I, UiDuration as In, ControlledOptions as Ir, DevtoolsEvent as It, OpfsFileHandle as J, ColorSchemePreference as Jn, each as Jr, GessoRuntime as Jt, IndexedDbStorageOptions as K, ShellStorageResult as Kn, EachKey as Kr, FrameMetrics as Kt, MediaSessionLike as L, UiEasingChoice as Ln, ControlledValue as Lr, DevtoolsRequest as Lt, RouterOutlet as M, AudioStatus as Mn, Define as Mr, ActionEntry as Mt, AudioElementLike as N, AnimateOptions as Nn, Inject as Nr, ChannelErrorEntry as Nt, observeMediaQuery as O, AudioRequest as On, findUnplainPath as Or, ShellHistoryMode as Ot, AudioSink as P, AnimationService as Pn, Input as Pr, CommandEntry as Pt, MemoryStorage as Q, UiEnvironmentReport as Qn, Mutation as Qr, UI_FRAME_PHASES as Qt, audioClock as R, ShellFile as Rn, controlled as Rr, FrameEntry as Rt, writeClipboard as S, RouteParams as Sn, structurallyEqual as Sr, CreateAppOptions as St, EditingService as T, parseUrl as Tn, ChannelRegistration as Tr, WorkerApp as Tt, ShellStorage as U, ShellRequest as Un, ShowProps as Ur, RuntimeErrorSource as Ut, PersistedState as V, ShellFileType as Vn, bind as Vr, UiTreeSnapshot as Vt, ShellStorageOptions as W, ShellService as Wn, show as Wr, RuntimeToShellMessage as Wt, OpfsStorageOptions as X, BoundStream as Xn, throttled as Xr, RendererChoice as Xt, OpfsStorage as Y, observeColorScheme as Yn, debounced as Yr, GessoRuntimeOptions as Yt, OpfsWritable as Z, NodePathTarget as Zn, MutateOptions as Zr, RuntimeInput as Zt, EditingMirrorTarget as _, Equality as _i, RouteGuard as _n, OverlayService as _r, GessoApp as _t, UiRole as a, SelectOptions as ai, FontService as an, describeStream as ar, storageReadValue as at, EditingProxy as b, route as bn, FrameworkChild as br, GessoAppBuilder as bt, UiSemanticsPatch as c, FanKey as ci, RouteAnswer as cn, formatNodeReport as cr, UndoableOptions as ct, markNow as d, fanOut as di, RouterRoutes as dn, ComponentHostResolver as dr, UndoStackOptions as dt, Resource as ei, FontFaceDeclaration as en, UiOwnerReport as er, StorageOutcome as et, measureSpan as f, ComputedCell as fi, RouterService as fn, ComponentHost as fr, UndoTransaction as ft, renderRoot as g, DeriveOptions as gi, RouteDefinition as gn, OverlayRect as gr, shellStorageDenied as gt, RenderWorkerApp as h, computed as hi, RouteContext as hn, OverlayPlacement as hr, performShellStorage as ht, UI_SEMANTIC_STATES as i, resource as ii, FontHost as in, UiStreamReport as ir, storageReadFailure as it, PresenceProps as j, AudioState as jn, Channel as jr, ActionCause as jt, observeReducedMotion as k, AudioSample as kn, requirePlainData as kr, ShellHistoryOptions as kt, UiSemanticsRecord$1 as l, FanOut as li, RouteMatch as ln, formatStream as lr, undoable as lt, setPerformanceMarks$1 as m, ReadSource as mi, OutletProps as mn, OverlayEntry as mr, ShellLocalStore as mt, MARK_PREFIX as n, ResourceState as ni, FontFamilyDeclaration as nn, UiPropReport as nr, classifyStorageError as nt, UiSemanticState as o, select as oi, MediaOptions as on, formatAge as or, UndoShortcutOptions as ot, performanceMarksEnabled as p, ComputedOptions as pi, RouteState as pn, OverlayLayer as pr, rememberedDirectory as pt, OpfsDirectory as q, ColorScheme as qn, EachProps as qr, FramePhaseTimings as qt, UI_ROLES as r, ResourceStatus as ri, FontFamilyStatus as rn, UiSemanticsReport as rr, storageErrorMessage as rt, UiSemanticsMap$1 as s, FanCell as si, MediaService as sn, formatNodePath as sr, registerUndoShortcuts as st, EditingState$1 as t, ResourceOptions as ti, FontFaceLike as tn, UiPropOrigin as tr, StorageRead as tt, markInstant as u, FanOutOptions as ui, RouterHistorySink as un, printPropValue as ur, UndoStack as ut, SemanticsMirror as v, derive as vi, RouteOptions as vn, createComponent as vr, GessoAppOptions as vt, ScrollService as w, formatUrl as wn, pickKeys as wr, AppLogicEndpoint as wt, EditingProxySink as x, to as xn, isComponentElement as xr, WebMcpChoice as xt, SemanticsMirrorSink as y, ServiceRegistry as yi, RouteTarget as yn, ComponentElement as yr, createSyncApp as yt, FrameService as z, ShellFileRequest as zn, ThemeTokenCell as zr, PatchEntry as zt };
|
|
8787
|
-
//# sourceMappingURL=index-
|
|
8841
|
+
//# sourceMappingURL=index-NIdw2_S0.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as channel, a as isChannelHostMessage, c as applyPatch, d as ChannelSpec, f as ChannelToken, g as ViewOf, h as CommandsOf, i as isChannelClientMessage, l as applyPatches, m as CommandMap, n as ChannelHostMessage, o as Patch, p as Command, r as ChannelPort, s as PatchPath, t as ChannelClientMessage, u as diffProjection, v as defineChannel, y as viewKeys } from "./ChannelProtocol-ByNoHujM.js";
|
|
2
2
|
import { A as portHandle, C as MessageEndpoint, D as isHubMessage, E as WorkerHandle, F as JsonSchema, I as channelSchema, L as describeChannel, M as workerHandle, N as ChannelSchema, O as isPortErrorMessage, P as CommandSchema, S as APPLICATION_WORKER, T as PortHost, _ as serve, b as ProvidedChannel, g as ServedChannel, j as servePorts, k as isPortHandshake, v as serveChannels, w as PortHandshake, x as provide, y as ChannelSource } from "./ui-CHtNccR8.js";
|
|
3
3
|
import { C as InternalState, S as output, T as Component, _ as OutputTarget, a as ComponentType, b as into, c as Inputs, d as BoundsCell, f as bounds, g as OutputCell, h as InputCell, i as ComponentProps, l as isClassComponent, m as EmitValue, o as FunctionComponent, p as EmitArgs, r as ComponentContext, s as InputValue, t as ClassComponent, u as ChannelReplica, v as ReadableCell, w as internalState, x as isOutputTarget, y as input } from "./FunctionComponent-CHtojpp7.js";
|
|
4
|
-
import { $ as StorageAdapter, $n as UiNodeReport, $r as mutate, $t as UiFramePhase, A as Presence, An as AudioService, Ar as ChannelRegistry, At as createShellHistory, B as PersistedOptions, Bn as ShellFileResult, Br as themeTokenCell, Bt as UiTreeNode, C as FocusService, Cn as buildPath, Cr as pick, Ct as createApp, D as FindService, Dn as AudioMetadata, Dr as createChannelRegistry, Dt as ShellHistory, E as TextService, En as AudioAction, Er as ChannelRegistryHandle, Et as WorkerAppOptions, F as AudioSinkOptions, Fn as SpringOptions, Fr as Output, Ft as ConsoleEntry, G as IndexedDbStorage, Gn as ShellStorageOp, Gr as Each, Gt as ShellToRuntimeMessage, H as persisted, Hn as ShellRecentFile, Hr as Show, Ht as treeText, I as AudioSinkOutput, In as UiDuration, Ir as ControlledOptions, It as DevtoolsEvent, J as OpfsFileHandle, Jn as ColorSchemePreference, Jr as each, Jt as GessoRuntime, K as IndexedDbStorageOptions, Kn as ShellStorageResult, Kr as EachKey, Kt as FrameMetrics, L as MediaSessionLike, Ln as UiEasingChoice, Lr as ControlledValue, Lt as DevtoolsRequest, M as RouterOutlet, Mn as AudioStatus, Mr as Define, Mt as ActionEntry, N as AudioElementLike, Nn as AnimateOptions, Nr as Inject, Nt as ChannelErrorEntry, O as observeMediaQuery, On as AudioRequest, Or as findUnplainPath, Ot as ShellHistoryMode, P as AudioSink, Pn as AnimationService, Pr as Input, Pt as CommandEntry, Q as MemoryStorage, Qn as UiEnvironmentReport, Qr as Mutation, Qt as UI_FRAME_PHASES, R as audioClock, Rn as ShellFile, Rr as controlled, Rt as FrameEntry, S as writeClipboard, Sn as RouteParams, Sr as structurallyEqual, St as CreateAppOptions, T as EditingService, Tn as parseUrl, Tr as ChannelRegistration, Tt as WorkerApp, U as ShellStorage, Un as ShellRequest, Ur as ShowProps, Ut as RuntimeErrorSource, V as PersistedState, Vn as ShellFileType, Vr as bind, Vt as UiTreeSnapshot, W as ShellStorageOptions, Wn as ShellService, Wr as show, Wt as RuntimeToShellMessage, X as OpfsStorageOptions, Xn as BoundStream, Xr as throttled, Xt as RendererChoice, Y as OpfsStorage, Yn as observeColorScheme, Yr as debounced, Yt as GessoRuntimeOptions, Z as OpfsWritable, Zn as NodePathTarget, Zr as MutateOptions, Zt as RuntimeInput, _ as EditingMirrorTarget, _i as Equality, _n as RouteGuard, _r as OverlayService, _t as GessoApp, a as UiRole, ai as SelectOptions, an as FontService, ar as describeStream, at as storageReadValue, b as EditingProxy, bn as route, br as FrameworkChild, bt as GessoAppBuilder, c as UiSemanticsPatch, ci as FanKey, cn as RouteAnswer, cr as formatNodeReport, ct as UndoableOptions, d as markNow, di as fanOut, dn as RouterRoutes, dr as ComponentHostResolver, dt as UndoStackOptions, ei as Resource, en as FontFaceDeclaration, er as UiOwnerReport, et as StorageOutcome, f as measureSpan, fi as ComputedCell, fn as RouterService, fr as ComponentHost, ft as UndoTransaction, g as renderRoot, gi as DeriveOptions, gn as RouteDefinition, gr as OverlayRect, gt as shellStorageDenied, h as RenderWorkerApp, hi as computed, hn as RouteContext, hr as OverlayPlacement, ht as performShellStorage, i as UI_SEMANTIC_STATES, ii as resource, in as FontHost, ir as UiStreamReport, it as storageReadFailure, j as PresenceProps, jn as AudioState, jr as Channel, jt as ActionCause, k as observeReducedMotion, kn as AudioSample, kr as requirePlainData, kt as ShellHistoryOptions, l as UiSemanticsRecord, li as FanOut, ln as RouteMatch, lr as formatStream, lt as undoable, m as setPerformanceMarks, mi as ReadSource, mn as OutletProps, mr as OverlayEntry, mt as ShellLocalStore, n as MARK_PREFIX, ni as ResourceState, nn as FontFamilyDeclaration, nr as UiPropReport, nt as classifyStorageError, o as UiSemanticState, oi as select, on as MediaOptions, or as formatAge, ot as UndoShortcutOptions, p as performanceMarksEnabled, pi as ComputedOptions, pn as RouteState, pr as OverlayLayer, pt as rememberedDirectory, q as OpfsDirectory, qn as ColorScheme, qr as EachProps, qt as FramePhaseTimings, r as UI_ROLES, ri as ResourceStatus, rn as FontFamilyStatus, rr as UiSemanticsReport, rt as storageErrorMessage, s as UiSemanticsMap, si as FanCell, sn as MediaService, sr as formatNodePath, st as registerUndoShortcuts, t as EditingState, ti as ResourceOptions, tn as FontFaceLike, tr as UiPropOrigin, tt as StorageRead, u as markInstant, ui as FanOutOptions, un as RouterHistorySink, ur as printPropValue, ut as UndoStack, v as SemanticsMirror, vi as derive, vn as RouteOptions, vr as createComponent, vt as GessoAppOptions, w as ScrollService, wn as formatUrl, wr as pickKeys, wt as AppLogicEndpoint, x as EditingProxySink, xn as to, xr as isComponentElement, xt as WebMcpChoice, y as SemanticsMirrorSink, yi as ServiceRegistry, yn as RouteTarget, yr as ComponentElement, yt as createSyncApp, z as FrameService, zn as ShellFileRequest, zr as ThemeTokenCell, zt as PatchEntry } from "./index-
|
|
4
|
+
import { $ as StorageAdapter, $n as UiNodeReport, $r as mutate, $t as UiFramePhase, A as Presence, An as AudioService, Ar as ChannelRegistry, At as createShellHistory, B as PersistedOptions, Bn as ShellFileResult, Br as themeTokenCell, Bt as UiTreeNode, C as FocusService, Cn as buildPath, Cr as pick, Ct as createApp, D as FindService, Dn as AudioMetadata, Dr as createChannelRegistry, Dt as ShellHistory, E as TextService, En as AudioAction, Er as ChannelRegistryHandle, Et as WorkerAppOptions, F as AudioSinkOptions, Fn as SpringOptions, Fr as Output, Ft as ConsoleEntry, G as IndexedDbStorage, Gn as ShellStorageOp, Gr as Each, Gt as ShellToRuntimeMessage, H as persisted, Hn as ShellRecentFile, Hr as Show, Ht as treeText, I as AudioSinkOutput, In as UiDuration, Ir as ControlledOptions, It as DevtoolsEvent, J as OpfsFileHandle, Jn as ColorSchemePreference, Jr as each, Jt as GessoRuntime, K as IndexedDbStorageOptions, Kn as ShellStorageResult, Kr as EachKey, Kt as FrameMetrics, L as MediaSessionLike, Ln as UiEasingChoice, Lr as ControlledValue, Lt as DevtoolsRequest, M as RouterOutlet, Mn as AudioStatus, Mr as Define, Mt as ActionEntry, N as AudioElementLike, Nn as AnimateOptions, Nr as Inject, Nt as ChannelErrorEntry, O as observeMediaQuery, On as AudioRequest, Or as findUnplainPath, Ot as ShellHistoryMode, P as AudioSink, Pn as AnimationService, Pr as Input, Pt as CommandEntry, Q as MemoryStorage, Qn as UiEnvironmentReport, Qr as Mutation, Qt as UI_FRAME_PHASES, R as audioClock, Rn as ShellFile, Rr as controlled, Rt as FrameEntry, S as writeClipboard, Sn as RouteParams, Sr as structurallyEqual, St as CreateAppOptions, T as EditingService, Tn as parseUrl, Tr as ChannelRegistration, Tt as WorkerApp, U as ShellStorage, Un as ShellRequest, Ur as ShowProps, Ut as RuntimeErrorSource, V as PersistedState, Vn as ShellFileType, Vr as bind, Vt as UiTreeSnapshot, W as ShellStorageOptions, Wn as ShellService, Wr as show, Wt as RuntimeToShellMessage, X as OpfsStorageOptions, Xn as BoundStream, Xr as throttled, Xt as RendererChoice, Y as OpfsStorage, Yn as observeColorScheme, Yr as debounced, Yt as GessoRuntimeOptions, Z as OpfsWritable, Zn as NodePathTarget, Zr as MutateOptions, Zt as RuntimeInput, _ as EditingMirrorTarget, _i as Equality, _n as RouteGuard, _r as OverlayService, _t as GessoApp, a as UiRole, ai as SelectOptions, an as FontService, ar as describeStream, at as storageReadValue, b as EditingProxy, bn as route, br as FrameworkChild, bt as GessoAppBuilder, c as UiSemanticsPatch, ci as FanKey, cn as RouteAnswer, cr as formatNodeReport, ct as UndoableOptions, d as markNow, di as fanOut, dn as RouterRoutes, dr as ComponentHostResolver, dt as UndoStackOptions, ei as Resource, en as FontFaceDeclaration, er as UiOwnerReport, et as StorageOutcome, f as measureSpan, fi as ComputedCell, fn as RouterService, fr as ComponentHost, ft as UndoTransaction, g as renderRoot, gi as DeriveOptions, gn as RouteDefinition, gr as OverlayRect, gt as shellStorageDenied, h as RenderWorkerApp, hi as computed, hn as RouteContext, hr as OverlayPlacement, ht as performShellStorage, i as UI_SEMANTIC_STATES, ii as resource, in as FontHost, ir as UiStreamReport, it as storageReadFailure, j as PresenceProps, jn as AudioState, jr as Channel, jt as ActionCause, k as observeReducedMotion, kn as AudioSample, kr as requirePlainData, kt as ShellHistoryOptions, l as UiSemanticsRecord, li as FanOut, ln as RouteMatch, lr as formatStream, lt as undoable, m as setPerformanceMarks, mi as ReadSource, mn as OutletProps, mr as OverlayEntry, mt as ShellLocalStore, n as MARK_PREFIX, ni as ResourceState, nn as FontFamilyDeclaration, nr as UiPropReport, nt as classifyStorageError, o as UiSemanticState, oi as select, on as MediaOptions, or as formatAge, ot as UndoShortcutOptions, p as performanceMarksEnabled, pi as ComputedOptions, pn as RouteState, pr as OverlayLayer, pt as rememberedDirectory, q as OpfsDirectory, qn as ColorScheme, qr as EachProps, qt as FramePhaseTimings, r as UI_ROLES, ri as ResourceStatus, rn as FontFamilyStatus, rr as UiSemanticsReport, rt as storageErrorMessage, s as UiSemanticsMap, si as FanCell, sn as MediaService, sr as formatNodePath, st as registerUndoShortcuts, t as EditingState, ti as ResourceOptions, tn as FontFaceLike, tr as UiPropOrigin, tt as StorageRead, u as markInstant, ui as FanOutOptions, un as RouterHistorySink, ur as printPropValue, ut as UndoStack, v as SemanticsMirror, vi as derive, vn as RouteOptions, vr as createComponent, vt as GessoAppOptions, w as ScrollService, wn as formatUrl, wr as pickKeys, wt as AppLogicEndpoint, x as EditingProxySink, xn as to, xr as isComponentElement, xt as WebMcpChoice, y as SemanticsMirrorSink, yi as ServiceRegistry, yn as RouteTarget, yr as ComponentElement, yt as createSyncApp, z as FrameService, zn as ShellFileRequest, zr as ThemeTokenCell, zt as PatchEntry } from "./index-NIdw2_S0.js";
|
|
5
5
|
export { APPLICATION_WORKER, type ActionCause, type ActionEntry, type AnimateOptions, AnimationService, type AppLogicEndpoint, type AudioAction, type AudioElementLike, type AudioMetadata, type AudioRequest, type AudioSample, AudioService, AudioSink, type AudioSinkOptions, type AudioSinkOutput, type AudioState, type AudioStatus, type BoundStream, BoundsCell, Channel, type ChannelClientMessage, type ChannelErrorEntry, type ChannelHostMessage, type ChannelPort, type ChannelRegistration, ChannelRegistry, type ChannelRegistryHandle, ChannelReplica, type ChannelSchema, type ChannelSource, type ChannelSpec, type ChannelToken, type ClassComponent, type ColorScheme, type ColorSchemePreference, type Command, type CommandEntry, type CommandMap, type CommandSchema, type CommandsOf, Component, type ComponentContext, type ComponentElement, ComponentHost, ComponentHostResolver, type ComponentProps, type ComponentType, ComputedCell, type ComputedOptions, type ConsoleEntry, type ControlledOptions, type ControlledValue, type CreateAppOptions, Define, type DeriveOptions, type DevtoolsEvent, type DevtoolsRequest, Each, type EachKey, type EachProps, type EditingMirrorTarget, EditingProxy, type EditingProxySink, EditingService, type EditingState, type EmitArgs, type EmitValue, type Equality, FanCell, type FanKey, FanOut, type FanOutOptions, FindService, FocusService, type FontFaceDeclaration, type FontFaceLike, type FontFamilyDeclaration, type FontFamilyStatus, type FontHost, FontService, type FrameEntry, type FrameMetrics, type FramePhaseTimings, FrameService, type FrameworkChild, type FunctionComponent, GessoApp, GessoAppBuilder, type GessoAppOptions, GessoRuntime, type GessoRuntimeOptions, IndexedDbStorage, type IndexedDbStorageOptions, Inject, Input, InputCell, type InputValue, type Inputs, InternalState, type JsonSchema, MARK_PREFIX, type MediaOptions, MediaService, type MediaSessionLike, MemoryStorage, type MessageEndpoint, type MutateOptions, type Mutation, type NodePathTarget, type OpfsDirectory, type OpfsFileHandle, OpfsStorage, type OpfsStorageOptions, type OpfsWritable, type OutletProps, Output, type OutputCell, type OutputTarget, type OverlayEntry, OverlayLayer, type OverlayPlacement, type OverlayRect, OverlayService, type Patch, type PatchEntry, type PatchPath, type PersistedOptions, PersistedState, type PortHandshake, type PortHost, Presence, type PresenceProps, ProvidedChannel, type ReadSource, type ReadableCell, RenderWorkerApp, type RendererChoice, Resource, type ResourceOptions, type ResourceState, type ResourceStatus, type RouteAnswer, type RouteContext, type RouteDefinition, type RouteGuard, type RouteMatch, type RouteOptions, type RouteParams, RouteState, type RouteTarget, type RouterHistorySink, RouterOutlet, type RouterRoutes, RouterService, type RuntimeErrorSource, type RuntimeInput, type RuntimeToShellMessage, ScrollService, type SelectOptions, SemanticsMirror, type SemanticsMirrorSink, type ServedChannel, ServiceRegistry, type ShellFile, type ShellFileRequest, type ShellFileResult, type ShellFileType, type ShellHistory, type ShellHistoryMode, type ShellHistoryOptions, type ShellLocalStore, type ShellRecentFile, type ShellRequest, ShellService, ShellStorage, type ShellStorageOp, type ShellStorageOptions, type ShellStorageResult, type ShellToRuntimeMessage, Show, type ShowProps, type SpringOptions, type StorageAdapter, type StorageOutcome, type StorageRead, TextService, ThemeTokenCell, UI_FRAME_PHASES, UI_ROLES, UI_SEMANTIC_STATES, type UiDuration, type UiEasingChoice, type UiEnvironmentReport, type UiFramePhase, type UiNodeReport, type UiOwnerReport, type UiPropOrigin, type UiPropReport, type UiRole, type UiSemanticState, type UiSemanticsMap, type UiSemanticsPatch, type UiSemanticsRecord, type UiSemanticsReport, type UiStreamReport, type UiTreeNode, type UiTreeSnapshot, type UndoShortcutOptions, UndoStack, type UndoStackOptions, type UndoTransaction, type UndoableOptions, type ViewOf, type WebMcpChoice, WorkerApp, type WorkerAppOptions, type WorkerHandle, applyPatch, applyPatches, audioClock, bind, bounds, buildPath, channel, channelSchema, classifyStorageError, computed, controlled, createApp, createChannelRegistry, createComponent, createShellHistory, createSyncApp, debounced, defineChannel, derive, describeChannel, describeStream, diffProjection, each, fanOut, findUnplainPath, formatAge, formatNodePath, formatNodeReport, formatStream, formatUrl, input, internalState, into, isChannelClientMessage, isChannelHostMessage, isClassComponent, isComponentElement, isHubMessage, isOutputTarget, isPortErrorMessage, isPortHandshake, markInstant, markNow, measureSpan, mutate, observeColorScheme, observeMediaQuery, observeReducedMotion, output, parseUrl, performShellStorage, performanceMarksEnabled, persisted, pick, pickKeys, portHandle, printPropValue, provide, registerUndoShortcuts, rememberedDirectory, renderRoot, requirePlainData, resource, route, select, serve, serveChannels, servePorts, setPerformanceMarks, shellStorageDenied, show, storageErrorMessage, storageReadFailure, storageReadValue, structurallyEqual, themeTokenCell, throttled, to, treeText, undoable, viewKeys, workerHandle, writeClipboard };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { a as Each, i as show, n as getComponentMetadata, o as each, r as Show,
|
|
|
4
4
|
import { c as findUnplainPath, d as describeChannel, l as requirePlainData, t as AGENT_PORT, u as channelSchema } from "./remote-BoB8zh7z.js";
|
|
5
5
|
import { n as serveApplicationAgent } from "./app-Yig59Ygf.js";
|
|
6
6
|
import { BehaviorSubject, EMPTY, Observable, Subject, Subscription, distinctUntilChanged, map } from "rxjs";
|
|
7
|
-
import { AnimationDriver, Box, Canvas2DRenderer, CanvasPlatformSurface, CanvasTextMeasurer, Constraints, DefaultImageResolver, DefaultVideoResolver, DirtyFlags, EnvironmentNotifier, FocusNotifier, IconRasterizer, LayoutEngine, LayoutInspector, LayoutNotifier, MARK_PREFIX, Stack, TEXT_RUN_ID_SEPARATOR, UI_ROLES, UI_SEMANTIC_STATES, UiAnimationFrameClock, UiEditingController, UiEnvironmentKeys, UiEventType, UiFindController, UiFocusManager, UiFrame, UiGestureRecognizer, UiGraph, UiGraphBuilder, UiHitTester, UiHostFrameClock, UiInputDispatcher, UiInsetRegistry, UiKeyboardController, UiNodeType, UiPlatformAdapter, UiPointerController, UiPointerEvent, UiScheduler, UiSelectionController, UiSharedElements, UiSpring, UiTimerFrameClock, UiTouchScroller, UiVirtualSheet, UiVirtualWindow, UiWheelController, VIRTUAL_INDEX_PROP, VIRTUAL_LEAD_PROP, VIRTUAL_SHEET_PROP, VIRTUAL_WINDOW_PROP, WebGPURenderer, buildSemanticsSubtree, buildSemanticsTree, bumpFontStack, capturePointer, createCanvasSurface, createTween, createWebGPUSurface, defaultMotion, defineModifier, describeOverrides, diffSemantics, dragSessionFor, dropIndexShifts, easings, fade, formatExplanation, insetsEqual, isComponentLikeElement, isImeKey, isObservable, isWebGPUAvailable, linear, linkOf, markInstant, markNow, measure, measureSpan, motion, noInsets, observeViewportInsets, percent, performanceMarksEnabled, pointerDeviceOf, prepareInputSurface, propertyEffects, recordsEqual, registerFontStack, resolveCursor, rewalkSemantics, scrollRange, scrollbarThumb, semanticsInertAbove, semanticsMemory, setPerformanceMarks, setPerformanceMarks as setPerformanceMarks$1, textRunOfRecordId, themeTokens, touchActionFor, wheelDeltaYOf } from "gesso-core";
|
|
7
|
+
import { AnimationDriver, Box, Canvas2DRenderer, CanvasPlatformSurface, CanvasTextMeasurer, Constraints, DefaultImageResolver, DefaultVideoResolver, DirtyFlags, EnvironmentNotifier, FocusNotifier, IconRasterizer, LayoutEngine, LayoutInspector, LayoutNotifier, MARK_PREFIX, Stack, TEXT_RUN_ID_SEPARATOR, UI_ROLES, UI_SEMANTIC_STATES, UiAnimationFrameClock, UiEditingController, UiEnvironmentKeys, UiEventType, UiFindController, UiFocusManager, UiFrame, UiGestureRecognizer, UiGraph, UiGraphBuilder, UiHitTester, UiHostFrameClock, UiInputDispatcher, UiInsetRegistry, UiKeyboardController, UiNodeType, UiPlatformAdapter, UiPointerController, UiPointerEvent, UiScheduler, UiSelectionController, UiSharedElements, UiSpring, UiTimerFrameClock, UiTouchScroller, UiVirtualSheet, UiVirtualWindow, UiWheelController, VIRTUAL_INDEX_PROP, VIRTUAL_LEAD_PROP, VIRTUAL_SHEET_PROP, VIRTUAL_WINDOW_PROP, WebGPURenderer, buildSemanticsSubtree, buildSemanticsTree, bumpFontStack, capturePointer, createCanvasSurface, createTween, createWebGPUSurface, defaultMotion, defineModifier, describeOverrides, diffSemantics, dragSessionFor, dropIndexShifts, easings, fade, formatExplanation, insetsEqual, isComponentLikeElement, isImeKey, isObservable, isWebGPUAvailable, linear, linkOf, markInstant, markNow, measure, measureSpan, motion, noInsets, observeViewportInsets, percent, performanceMarksEnabled, pointerDeviceOf, prepareInputSurface, propertyEffects, recordsEqual, registerFontStack, resolveCursor, rewalkSemantics, scrollBounds, scrollRange, scrollbarThumb, scrollsFromRight, semanticsInertAbove, semanticsMemory, setPerformanceMarks, setPerformanceMarks as setPerformanceMarks$1, textRunOfRecordId, themeTokens, touchActionFor, wheelDeltaYOf } from "gesso-core";
|
|
8
8
|
//#region src/Component.ts
|
|
9
9
|
/**
|
|
10
10
|
* Base class for all Gesso framework components.
|
|
@@ -832,6 +832,27 @@ function isClassComponent(component) {
|
|
|
832
832
|
//#endregion
|
|
833
833
|
//#region src/overlay/OverlayService.ts
|
|
834
834
|
/**
|
|
835
|
+
* A placement turned into the physical one the layout engine places by,
|
|
836
|
+
* in a reading direction.
|
|
837
|
+
*
|
|
838
|
+
* The engine knows only screen edges: `bottom-start` to it is the
|
|
839
|
+
* anchor's left edge. Resolving here, rather than teaching the engine
|
|
840
|
+
* directions, keeps the engine's `placement` the plain property it is
|
|
841
|
+
* for any absolutely positioned node, and puts the decision where the
|
|
842
|
+
* direction is known: the overlay layer reads it from the tree that
|
|
843
|
+
* declared the entry.
|
|
844
|
+
*/
|
|
845
|
+
function physicalPlacement(placement, rtl) {
|
|
846
|
+
const [side, align] = placement.split("-");
|
|
847
|
+
if (side === "top" || side === "bottom") {
|
|
848
|
+
if (align === void 0 || !rtl) return placement;
|
|
849
|
+
return `${side}-${align === "start" ? "end" : "start"}`;
|
|
850
|
+
}
|
|
851
|
+
if (side === "left" || side === "right") return placement;
|
|
852
|
+
const physical = side === "start" !== rtl ? "left" : "right";
|
|
853
|
+
return align === void 0 ? physical : `${physical}-${align}`;
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
835
856
|
* The open overlays, as a local store.
|
|
836
857
|
*
|
|
837
858
|
* Every runtime registers one. Components inject it and open or close
|
|
@@ -888,16 +909,16 @@ let OverlayLayer = class OverlayLayer extends Component {
|
|
|
888
909
|
renderEntries(entries) {
|
|
889
910
|
const elements = [];
|
|
890
911
|
for (const entry of entries) {
|
|
912
|
+
const environment = entry.environment ?? entry.anchor ?? null;
|
|
891
913
|
if (entry.dismissOnOutsidePress === true || entry.modal === true) {
|
|
892
914
|
const dismiss = entry.dismissOnOutsidePress === true;
|
|
893
|
-
const environment = entry.environment ?? entry.anchor ?? null;
|
|
894
915
|
elements.push(Box({
|
|
895
916
|
key: `${entry.id}\0backdrop`,
|
|
896
917
|
position: "absolute",
|
|
897
918
|
inset: 0,
|
|
898
919
|
zIndex: entry.zIndex,
|
|
899
920
|
...inheritedFrom(environment),
|
|
900
|
-
modifiers: followEnvironment(environment),
|
|
921
|
+
modifiers: followEnvironment(environment, null),
|
|
901
922
|
...dismiss ? {
|
|
902
923
|
onPointerDown: () => this.overlays.close(entry.id),
|
|
903
924
|
onWheel: () => this.overlays.close(entry.id)
|
|
@@ -910,16 +931,14 @@ let OverlayLayer = class OverlayLayer extends Component {
|
|
|
910
931
|
anchor: entry.anchor ?? void 0,
|
|
911
932
|
anchorPoint: entry.anchor == null ? entry.point : void 0,
|
|
912
933
|
anchorRect: entry.anchor == null ? void 0 : entry.anchorRect,
|
|
913
|
-
placement: entry.placement,
|
|
914
934
|
anchorOffset: entry.offset,
|
|
915
935
|
top: entry.top,
|
|
916
|
-
right: entry.right,
|
|
917
936
|
bottom: entry.bottom,
|
|
918
|
-
left: entry.left,
|
|
919
937
|
zIndex: entry.zIndex,
|
|
920
938
|
...centering(entry),
|
|
921
|
-
...
|
|
922
|
-
|
|
939
|
+
...physicalEdges(entry, readsRightToLeft(environment)),
|
|
940
|
+
...inheritedFrom(environment),
|
|
941
|
+
modifiers: followEnvironment(environment, entry)
|
|
923
942
|
}, entry.content));
|
|
924
943
|
}
|
|
925
944
|
return elements;
|
|
@@ -956,7 +975,8 @@ function scrim() {
|
|
|
956
975
|
* across the viewport, and a Box is a Stack — so `x`/`y` centre the
|
|
957
976
|
* content inside that span. The edges default to 0 but an entry that
|
|
958
977
|
* gave one keeps it, which is what centres a toast horizontally
|
|
959
|
-
* without lifting it off the bottom.
|
|
978
|
+
* without lifting it off the bottom. The horizontal edges are
|
|
979
|
+
* `physicalEdges`', since an entry may give them as `start` and `end`.
|
|
960
980
|
*
|
|
961
981
|
* The stretched box is `hitTestable: false`, since it is now much
|
|
962
982
|
* bigger than what it holds: a press in the space beside a centred
|
|
@@ -970,11 +990,7 @@ function centering(entry) {
|
|
|
970
990
|
const y = entry.center === "y" || entry.center === "both";
|
|
971
991
|
return {
|
|
972
992
|
hitTestable: false,
|
|
973
|
-
...x ? {
|
|
974
|
-
left: entry.left ?? 0,
|
|
975
|
-
right: entry.right ?? 0,
|
|
976
|
-
x: "center"
|
|
977
|
-
} : {},
|
|
993
|
+
...x ? { x: "center" } : {},
|
|
978
994
|
...y ? {
|
|
979
995
|
top: entry.top ?? 0,
|
|
980
996
|
bottom: entry.bottom ?? 0,
|
|
@@ -982,6 +998,31 @@ function centering(entry) {
|
|
|
982
998
|
} : {}
|
|
983
999
|
};
|
|
984
1000
|
}
|
|
1001
|
+
/** Whether the scoped text style at a node reads right to left, as the entry's content will. */
|
|
1002
|
+
function readsRightToLeft(node) {
|
|
1003
|
+
return node?.environment?.get(UiEnvironmentKeys.textStyle).textDirection === "rtl";
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* The entry's placement and horizontal edges, with `start` and `end`
|
|
1007
|
+
* turned into the physical ones the layout engine takes.
|
|
1008
|
+
*
|
|
1009
|
+
* A logical edge wins over the physical one it lands on, so an entry
|
|
1010
|
+
* that gives both says which it meant. A centred entry's edges are the
|
|
1011
|
+
* span it centres in, and default to the viewport's.
|
|
1012
|
+
*/
|
|
1013
|
+
function physicalEdges(entry, rtl) {
|
|
1014
|
+
let left = (rtl ? entry.end : entry.start) ?? entry.left;
|
|
1015
|
+
let right = (rtl ? entry.start : entry.end) ?? entry.right;
|
|
1016
|
+
if ((entry.center === "x" || entry.center === "both") && (entry.anchor ?? null) === null) {
|
|
1017
|
+
left ??= 0;
|
|
1018
|
+
right ??= 0;
|
|
1019
|
+
}
|
|
1020
|
+
return {
|
|
1021
|
+
placement: entry.placement === void 0 ? void 0 : physicalPlacement(entry.placement, rtl),
|
|
1022
|
+
left,
|
|
1023
|
+
right
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
985
1026
|
/**
|
|
986
1027
|
* The scoped values an entry's content should keep, re-provided on the
|
|
987
1028
|
* box that holds it, as they are when the entry opens.
|
|
@@ -1003,21 +1044,32 @@ function inheritedFrom(node) {
|
|
|
1003
1044
|
* Reading them once let a dialog open while the page went dark (the
|
|
1004
1045
|
* system's setting changed, or the theme a person chose arrived from
|
|
1005
1046
|
* another worker a moment after they opened it) stay light over a dark
|
|
1006
|
-
* page until it was closed.
|
|
1047
|
+
* page until it was closed. The reading direction is one of them, and
|
|
1048
|
+
* the edges it decides are placed again with it.
|
|
1007
1049
|
*/
|
|
1008
1050
|
const followEnvironmentKind = defineModifier({
|
|
1009
1051
|
name: "overlayEnvironment",
|
|
1010
|
-
attach(host, from) {
|
|
1052
|
+
attach(host, { from, entry }) {
|
|
1011
1053
|
host.onEnvironment(() => {
|
|
1012
1054
|
host.set("theme", host.environment(UiEnvironmentKeys.theme, from));
|
|
1013
|
-
|
|
1055
|
+
const textStyle = host.environment(UiEnvironmentKeys.textStyle, from);
|
|
1056
|
+
host.set("textStyle", textStyle);
|
|
1014
1057
|
host.set("color", host.environment(UiEnvironmentKeys.color, from));
|
|
1015
1058
|
host.set("contentColor", host.environment(UiEnvironmentKeys.contentColor, from));
|
|
1059
|
+
if (entry !== null) {
|
|
1060
|
+
const edges = physicalEdges(entry, textStyle.textDirection === "rtl");
|
|
1061
|
+
host.set("placement", edges.placement);
|
|
1062
|
+
host.set("left", edges.left);
|
|
1063
|
+
host.set("right", edges.right);
|
|
1064
|
+
}
|
|
1016
1065
|
}, from);
|
|
1017
1066
|
}
|
|
1018
1067
|
});
|
|
1019
|
-
function followEnvironment(node) {
|
|
1020
|
-
return node === null ? [] : [followEnvironmentKind(
|
|
1068
|
+
function followEnvironment(node, entry) {
|
|
1069
|
+
return node === null ? [] : [followEnvironmentKind({
|
|
1070
|
+
from: node,
|
|
1071
|
+
entry
|
|
1072
|
+
})];
|
|
1021
1073
|
}
|
|
1022
1074
|
//#endregion
|
|
1023
1075
|
//#region src/ComponentElement.ts
|
|
@@ -3483,6 +3535,10 @@ const RECORD_ATTRIBUTES = [
|
|
|
3483
3535
|
"aria-posinset",
|
|
3484
3536
|
"aria-setsize",
|
|
3485
3537
|
"aria-level",
|
|
3538
|
+
"aria-rowindex",
|
|
3539
|
+
"aria-colindex",
|
|
3540
|
+
"aria-rowcount",
|
|
3541
|
+
"aria-colcount",
|
|
3486
3542
|
"aria-checked",
|
|
3487
3543
|
"aria-expanded",
|
|
3488
3544
|
"aria-selected",
|
|
@@ -3709,6 +3765,10 @@ var SemanticsMirror = class {
|
|
|
3709
3765
|
setNumber(element, "aria-posinset", record.posInSet);
|
|
3710
3766
|
setNumber(element, "aria-setsize", record.setSize);
|
|
3711
3767
|
setNumber(element, "aria-level", record.level);
|
|
3768
|
+
setNumber(element, "aria-rowindex", record.rowIndex);
|
|
3769
|
+
setNumber(element, "aria-colindex", record.columnIndex);
|
|
3770
|
+
setNumber(element, "aria-rowcount", record.rowCount);
|
|
3771
|
+
setNumber(element, "aria-colcount", record.columnCount);
|
|
3712
3772
|
if (record.valueText !== void 0) element.setAttribute("aria-valuetext", record.valueText);
|
|
3713
3773
|
if (record.activeDescendant !== void 0) element.setAttribute("aria-activedescendant", this.idPrefix + record.activeDescendant);
|
|
3714
3774
|
if (record.controls !== void 0) element.setAttribute("aria-controls", this.idPrefix + record.controls);
|
|
@@ -4911,6 +4971,7 @@ var WorkerApp = class {
|
|
|
4911
4971
|
forwardKeyUp(event) {
|
|
4912
4972
|
if (isImeKey(event)) return;
|
|
4913
4973
|
this.flushPendingMove();
|
|
4974
|
+
if (this.options.interceptKey?.(event) === true) event.preventDefault();
|
|
4914
4975
|
this.post({
|
|
4915
4976
|
type: "keyUp",
|
|
4916
4977
|
key: event.key,
|
|
@@ -7394,13 +7455,13 @@ const SCROLL_SPRING = {
|
|
|
7394
7455
|
var SmoothScroller = class {
|
|
7395
7456
|
graph;
|
|
7396
7457
|
animations;
|
|
7397
|
-
|
|
7458
|
+
boundsOf;
|
|
7398
7459
|
/** One cell per (node, axis), kept for the node's life. */
|
|
7399
7460
|
cells = /* @__PURE__ */ new Map();
|
|
7400
|
-
constructor(graph, animations,
|
|
7461
|
+
constructor(graph, animations, boundsOf) {
|
|
7401
7462
|
this.graph = graph;
|
|
7402
7463
|
this.animations = animations;
|
|
7403
|
-
this.
|
|
7464
|
+
this.boundsOf = boundsOf;
|
|
7404
7465
|
}
|
|
7405
7466
|
/**
|
|
7406
7467
|
* Moves the container by a delta, animating to the sum.
|
|
@@ -7416,8 +7477,8 @@ var SmoothScroller = class {
|
|
|
7416
7477
|
scrollBy(node, axis, delta, from) {
|
|
7417
7478
|
const cell = this.cellFor(node, axis).cell;
|
|
7418
7479
|
const pending = this.destinationOf(cell);
|
|
7419
|
-
const
|
|
7420
|
-
const target = clamp((pending ?? from) + delta,
|
|
7480
|
+
const { min, max } = this.boundsOf(node, axis);
|
|
7481
|
+
const target = clamp((pending ?? from) + delta, min, max);
|
|
7421
7482
|
if (pending !== void 0 && target === pending) return;
|
|
7422
7483
|
this.animations.spring(cell, target, { spring: SCROLL_SPRING });
|
|
7423
7484
|
}
|
|
@@ -7923,8 +7984,11 @@ var GessoRuntime = class {
|
|
|
7923
7984
|
this.services.get(AudioService).setAnimations(this.services.get(AnimationService));
|
|
7924
7985
|
this.smoothScroller = new SmoothScroller(this.graph, this.services.get(AnimationService), (node, axis) => {
|
|
7925
7986
|
const record = this.engine.recordFor(node);
|
|
7926
|
-
if (record === void 0) return
|
|
7927
|
-
|
|
7987
|
+
if (record === void 0) return {
|
|
7988
|
+
min: 0,
|
|
7989
|
+
max: 0
|
|
7990
|
+
};
|
|
7991
|
+
return scrollBounds(record, axis === "scrollY" ? "y" : "x");
|
|
7928
7992
|
});
|
|
7929
7993
|
if (!this.services.has(RouterService)) this.services.register(RouterService);
|
|
7930
7994
|
const router = this.services.get(RouterService);
|
|
@@ -9750,15 +9814,17 @@ var GessoRuntime = class {
|
|
|
9750
9814
|
const going = (node, record, axis) => {
|
|
9751
9815
|
const written = node.getProperty(axis === "x" ? "scrollX" : "scrollY");
|
|
9752
9816
|
const offset = typeof written === "number" ? written : axis === "x" ? record.scrollX : record.scrollY;
|
|
9753
|
-
|
|
9817
|
+
const { min, max } = scrollBounds(record, axis);
|
|
9818
|
+
return Math.min(Math.max(offset, min), max);
|
|
9754
9819
|
};
|
|
9820
|
+
const fromLow = (node, record, axis) => going(node, record, axis) - scrollBounds(record, axis).min;
|
|
9755
9821
|
return {
|
|
9756
9822
|
containerState: (node) => {
|
|
9757
9823
|
const record = this.engine.recordFor(node);
|
|
9758
9824
|
if (record === void 0) return;
|
|
9759
9825
|
return {
|
|
9760
|
-
scrollX:
|
|
9761
|
-
scrollY:
|
|
9826
|
+
scrollX: fromLow(node, record, "x"),
|
|
9827
|
+
scrollY: fromLow(node, record, "y"),
|
|
9762
9828
|
maxScrollX: scrollRange(record, "x"),
|
|
9763
9829
|
maxScrollY: scrollRange(record, "y"),
|
|
9764
9830
|
horizontal: node.getProperty("direction") === "row" || node.type === UiNodeType.Row,
|
|
@@ -9852,7 +9918,9 @@ var GessoRuntime = class {
|
|
|
9852
9918
|
if (rec === void 0) continue;
|
|
9853
9919
|
const column = window.axis === "column";
|
|
9854
9920
|
const scrollProp = node.properties.get(column ? "scrollY" : "scrollX");
|
|
9855
|
-
const
|
|
9921
|
+
const offset = typeof scrollProp === "number" ? scrollProp : column ? rec.scrollY : rec.scrollX;
|
|
9922
|
+
const sign = !column && scrollsFromRight(rec) ? -1 : 1;
|
|
9923
|
+
const scroll = sign * offset;
|
|
9856
9924
|
const measures = [];
|
|
9857
9925
|
const lead = this.collectVirtualMeasures(node, column, measures);
|
|
9858
9926
|
const result = window.update({
|
|
@@ -9862,10 +9930,12 @@ var GessoRuntime = class {
|
|
|
9862
9930
|
}, measures);
|
|
9863
9931
|
if (result.scrollAdjust !== 0) {
|
|
9864
9932
|
const axis = column ? "scrollY" : "scrollX";
|
|
9865
|
-
|
|
9933
|
+
const adjust = sign * result.scrollAdjust;
|
|
9934
|
+
node.setProperty(axis, offset + adjust);
|
|
9866
9935
|
this.graph.markDirty(node, DirtyFlags.Transform);
|
|
9867
|
-
this.smoothScroller.adjust(node, axis,
|
|
9936
|
+
this.smoothScroller.adjust(node, axis, adjust);
|
|
9868
9937
|
}
|
|
9938
|
+
if (window.holding) this.scheduler.wake();
|
|
9869
9939
|
}
|
|
9870
9940
|
}
|
|
9871
9941
|
/**
|
|
@@ -9885,11 +9955,13 @@ var GessoRuntime = class {
|
|
|
9885
9955
|
if (rec === void 0) return;
|
|
9886
9956
|
const x = node.properties.get("scrollX");
|
|
9887
9957
|
const y = node.properties.get("scrollY");
|
|
9958
|
+
const sign = scrollsFromRight(rec) ? -1 : 1;
|
|
9888
9959
|
sheet.update({
|
|
9889
|
-
scrollX: typeof x === "number" ? x : rec.scrollX,
|
|
9960
|
+
scrollX: sign * (typeof x === "number" ? x : rec.scrollX),
|
|
9890
9961
|
scrollY: typeof y === "number" ? y : rec.scrollY,
|
|
9891
9962
|
width: rec.width,
|
|
9892
|
-
height: rec.height
|
|
9963
|
+
height: rec.height,
|
|
9964
|
+
fromRight: sign < 0
|
|
9893
9965
|
});
|
|
9894
9966
|
}
|
|
9895
9967
|
/**
|