gesso-framework 0.6.27 → 0.6.29
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 +16 -0
- package/dist/{index-NIdw2_S0.d.ts → index-DZbSb8IN.d.ts} +31 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -26
- 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,21 @@
|
|
|
1
1
|
# gesso-framework
|
|
2
2
|
|
|
3
|
+
## 0.6.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0e62c11: An app opened at a deep link now starts on the screen that link names. The runtime builds its tree as it is constructed, and the window's address used to reach it afterwards, so for a moment every app was at `/`: its root route's screen was built and its effects ran before the real address moved it on. An app whose home screen does something on mount, such as opening the last document used, did it for a tab opened at `/d/new`.
|
|
8
|
+
|
|
9
|
+
`GessoRuntimeOptions.url` is new: the address to start at, resolved before the routes so the first tree is the right one and no guard on `/` runs for a window that was never there. Both hosts pass it — the worker host in its `init` message, the single-thread host from its history — and `setUrl` is for every address after. A guard that redirects the starting address is still reported to the shell as a replace, held until the shell is listening as other early requests are.
|
|
10
|
+
|
|
11
|
+
- gesso-core@0.6.29
|
|
12
|
+
|
|
13
|
+
## 0.6.28
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- gesso-core@0.6.28
|
|
18
|
+
|
|
3
19
|
## 0.6.27
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -3439,6 +3439,19 @@ interface GessoRuntimeOptions {
|
|
|
3439
3439
|
* that moment.
|
|
3440
3440
|
*/
|
|
3441
3441
|
routes?: RouterRoutes;
|
|
3442
|
+
/**
|
|
3443
|
+
* The window's address at start-up, resolved before the tree is
|
|
3444
|
+
* built.
|
|
3445
|
+
*
|
|
3446
|
+
* Without it the router starts at `/`, and the tree built in this
|
|
3447
|
+
* constructor is the root route's — its screen constructed, its
|
|
3448
|
+
* effects run — before the shell's `setUrl` moves it somewhere else.
|
|
3449
|
+
* An app opened at `/d/42` would mount its home screen first, and a
|
|
3450
|
+
* home screen that does something on mount (opens the last document,
|
|
3451
|
+
* say) does it, for a url nobody asked for. Both hosts pass the
|
|
3452
|
+
* address here; `setUrl` is for every one after.
|
|
3453
|
+
*/
|
|
3454
|
+
url?: string;
|
|
3442
3455
|
/**
|
|
3443
3456
|
* The channels this runtime's components may reach.
|
|
3444
3457
|
*
|
|
@@ -3907,6 +3920,8 @@ declare class GessoRuntime {
|
|
|
3907
3920
|
* clipboard writes and URLs to open. Without a listener they are
|
|
3908
3921
|
* dropped.
|
|
3909
3922
|
*/
|
|
3923
|
+
/** A request for the shell: sent, or held until `onShellRequest` gives it somewhere to go. */
|
|
3924
|
+
private toShell;
|
|
3910
3925
|
onShellRequest(listener: ((request: ShellRequest) => void) | null): void;
|
|
3911
3926
|
/**
|
|
3912
3927
|
* Receives what components ask of the shell's audio element through
|
|
@@ -4757,6 +4772,13 @@ type ShellToRuntimeMessage = {
|
|
|
4757
4772
|
* is the only per-frame cost the mirror has in here.
|
|
4758
4773
|
*/
|
|
4759
4774
|
accessibility?: boolean;
|
|
4775
|
+
/**
|
|
4776
|
+
* The window's address at start-up, so the first tree is built on
|
|
4777
|
+
* the screen it names. Optional for a shell that predates it,
|
|
4778
|
+
* which reports the address in a `url` message after this one
|
|
4779
|
+
* and so starts on the root route for a frame, as it always did.
|
|
4780
|
+
*/
|
|
4781
|
+
url?: string;
|
|
4760
4782
|
} | {
|
|
4761
4783
|
type: 'resize';
|
|
4762
4784
|
width: number;
|
|
@@ -6200,11 +6222,15 @@ declare class WorkerApp {
|
|
|
6200
6222
|
private readonly handleAppWorkerMessage;
|
|
6201
6223
|
private readonly handleWorkerMessage;
|
|
6202
6224
|
/**
|
|
6203
|
-
*
|
|
6225
|
+
* Keeps the worker told of the window's address, and answers the one
|
|
6226
|
+
* it starts at.
|
|
6204
6227
|
*
|
|
6205
|
-
*
|
|
6206
|
-
*
|
|
6207
|
-
*
|
|
6228
|
+
* That first one is not posted from here: `mount` puts it on `init`,
|
|
6229
|
+
* because an app opened directly at a url must start on the screen
|
|
6230
|
+
* that url names. Posted after `init`, as it used to be, it reached a
|
|
6231
|
+
* render worker that had already built its tree on the root route
|
|
6232
|
+
* and run that screen's effects — an app that opened its last
|
|
6233
|
+
* document on `/` did so for a tab opened at `/d/new`.
|
|
6208
6234
|
*/
|
|
6209
6235
|
private attachHistory;
|
|
6210
6236
|
/**
|
|
@@ -6676,7 +6702,6 @@ declare class GessoApp {
|
|
|
6676
6702
|
private readonly inputEnabled;
|
|
6677
6703
|
private readonly accessibilityEnabled;
|
|
6678
6704
|
private readonly adapter;
|
|
6679
|
-
private readonly historyOptions;
|
|
6680
6705
|
private readonly onOpenRoute;
|
|
6681
6706
|
private running;
|
|
6682
6707
|
private resizeObserver;
|
|
@@ -8838,4 +8863,4 @@ declare class RenderWorkerApp {
|
|
|
8838
8863
|
}
|
|
8839
8864
|
//#endregion
|
|
8840
8865
|
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 };
|
|
8841
|
-
//# sourceMappingURL=index-
|
|
8866
|
+
//# sourceMappingURL=index-DZbSb8IN.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-DZbSb8IN.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
|
@@ -4803,6 +4803,7 @@ var WorkerApp = class {
|
|
|
4803
4803
|
worker.addEventListener("message", this.handleWorkerMessage);
|
|
4804
4804
|
worker.addEventListener("error", this.handleWorkerFailure);
|
|
4805
4805
|
const { width, height } = measure$1(canvas, element);
|
|
4806
|
+
const url = this.attachHistory();
|
|
4806
4807
|
const transfer = [offscreen];
|
|
4807
4808
|
let appPort;
|
|
4808
4809
|
if (this.options.appLogicWorker !== void 0) {
|
|
@@ -4831,10 +4832,10 @@ var WorkerApp = class {
|
|
|
4831
4832
|
renderer: this.options.renderer,
|
|
4832
4833
|
textInput: "proxy",
|
|
4833
4834
|
accessibility: this.options.accessibility !== false,
|
|
4834
|
-
appPort
|
|
4835
|
+
appPort,
|
|
4836
|
+
url
|
|
4835
4837
|
}, transfer);
|
|
4836
4838
|
this.observeResize(element);
|
|
4837
|
-
this.attachHistory();
|
|
4838
4839
|
this.detachInput = this.attachInput(canvas);
|
|
4839
4840
|
this.audio = new AudioSink({
|
|
4840
4841
|
sample: (sample) => this.post({
|
|
@@ -5297,11 +5298,15 @@ var WorkerApp = class {
|
|
|
5297
5298
|
if (message.type === "history") this.applyHistory(message.action, message.url);
|
|
5298
5299
|
};
|
|
5299
5300
|
/**
|
|
5300
|
-
*
|
|
5301
|
+
* Keeps the worker told of the window's address, and answers the one
|
|
5302
|
+
* it starts at.
|
|
5301
5303
|
*
|
|
5302
|
-
*
|
|
5303
|
-
*
|
|
5304
|
-
*
|
|
5304
|
+
* That first one is not posted from here: `mount` puts it on `init`,
|
|
5305
|
+
* because an app opened directly at a url must start on the screen
|
|
5306
|
+
* that url names. Posted after `init`, as it used to be, it reached a
|
|
5307
|
+
* render worker that had already built its tree on the root route
|
|
5308
|
+
* and run that screen's effects — an app that opened its last
|
|
5309
|
+
* document on `/` did so for a tab opened at `/d/new`.
|
|
5305
5310
|
*/
|
|
5306
5311
|
attachHistory() {
|
|
5307
5312
|
const { history, owned } = resolveShellHistory(this.options.history);
|
|
@@ -5311,10 +5316,7 @@ var WorkerApp = class {
|
|
|
5311
5316
|
type: "url",
|
|
5312
5317
|
url
|
|
5313
5318
|
}));
|
|
5314
|
-
|
|
5315
|
-
type: "url",
|
|
5316
|
-
url: history.url
|
|
5317
|
-
});
|
|
5319
|
+
return history.url;
|
|
5318
5320
|
}
|
|
5319
5321
|
/**
|
|
5320
5322
|
* Opens a popup for the render worker and tells it what happened.
|
|
@@ -7962,10 +7964,7 @@ var GessoRuntime = class {
|
|
|
7962
7964
|
});
|
|
7963
7965
|
if (!this.services.has(OverlayService)) this.services.register(OverlayService);
|
|
7964
7966
|
if (!this.services.has(ShellService)) this.services.register(ShellService);
|
|
7965
|
-
this.services.get(ShellService).setHandler((request) =>
|
|
7966
|
-
if (this.shellListener !== null && this.shellListener !== void 0) this.shellListener(request);
|
|
7967
|
-
else if (this.heldShellRequests.length < HELD_SHELL_REQUESTS) this.heldShellRequests.push(request);
|
|
7968
|
-
});
|
|
7967
|
+
this.services.get(ShellService).setHandler((request) => this.toShell(request));
|
|
7969
7968
|
if (!this.services.has(AudioService)) this.services.register(AudioService);
|
|
7970
7969
|
this.services.get(AudioService).setHandler((request) => this.audioListener?.(request));
|
|
7971
7970
|
if (!this.services.has(FindService)) this.services.register(FindService);
|
|
@@ -7993,25 +7992,26 @@ var GessoRuntime = class {
|
|
|
7993
7992
|
if (!this.services.has(RouterService)) this.services.register(RouterService);
|
|
7994
7993
|
const router = this.services.get(RouterService);
|
|
7995
7994
|
router.setHistory({
|
|
7996
|
-
push: (url) => this.
|
|
7995
|
+
push: (url) => this.toShell({
|
|
7997
7996
|
type: "history",
|
|
7998
7997
|
action: "push",
|
|
7999
7998
|
url
|
|
8000
7999
|
}),
|
|
8001
|
-
replace: (url) => this.
|
|
8000
|
+
replace: (url) => this.toShell({
|
|
8002
8001
|
type: "history",
|
|
8003
8002
|
action: "replace",
|
|
8004
8003
|
url
|
|
8005
8004
|
}),
|
|
8006
|
-
back: () => this.
|
|
8005
|
+
back: () => this.toShell({
|
|
8007
8006
|
type: "history",
|
|
8008
8007
|
action: "back"
|
|
8009
8008
|
}),
|
|
8010
|
-
forward: () => this.
|
|
8009
|
+
forward: () => this.toShell({
|
|
8011
8010
|
type: "history",
|
|
8012
8011
|
action: "forward"
|
|
8013
8012
|
})
|
|
8014
8013
|
});
|
|
8014
|
+
if (options.url !== void 0) router.applyUrl(options.url);
|
|
8015
8015
|
if (options.routes !== void 0) router.setRoutes(options.routes);
|
|
8016
8016
|
if (options.media?.resolver !== void 0) this.services.get(MediaService).setResolver(options.media.resolver);
|
|
8017
8017
|
if (options.media?.rasterizer !== void 0) this.services.get(MediaService).setRasterizer(options.media.rasterizer);
|
|
@@ -8512,6 +8512,11 @@ var GessoRuntime = class {
|
|
|
8512
8512
|
* clipboard writes and URLs to open. Without a listener they are
|
|
8513
8513
|
* dropped.
|
|
8514
8514
|
*/
|
|
8515
|
+
/** A request for the shell: sent, or held until `onShellRequest` gives it somewhere to go. */
|
|
8516
|
+
toShell(request) {
|
|
8517
|
+
if (this.shellListener !== null && this.shellListener !== void 0) this.shellListener(request);
|
|
8518
|
+
else if (this.heldShellRequests.length < HELD_SHELL_REQUESTS) this.heldShellRequests.push(request);
|
|
8519
|
+
}
|
|
8515
8520
|
onShellRequest(listener) {
|
|
8516
8521
|
this.shellListener = listener;
|
|
8517
8522
|
if (listener !== null) {
|
|
@@ -10539,7 +10544,6 @@ var GessoApp = class {
|
|
|
10539
10544
|
inputEnabled;
|
|
10540
10545
|
accessibilityEnabled;
|
|
10541
10546
|
adapter;
|
|
10542
|
-
historyOptions;
|
|
10543
10547
|
onOpenRoute;
|
|
10544
10548
|
running = false;
|
|
10545
10549
|
resizeObserver = null;
|
|
@@ -10573,9 +10577,11 @@ var GessoApp = class {
|
|
|
10573
10577
|
this.canvas = options.canvas ?? createCanvasElement();
|
|
10574
10578
|
this.inputEnabled = options.input ?? true;
|
|
10575
10579
|
this.accessibilityEnabled = options.accessibility ?? true;
|
|
10576
|
-
this.historyOptions = options.history;
|
|
10577
10580
|
this.onOpenRoute = options.onOpenRoute;
|
|
10578
10581
|
this.colorSchemePreference = options.colorScheme ?? "auto";
|
|
10582
|
+
const { history, owned } = resolveShellHistory(options.history);
|
|
10583
|
+
this.history = history;
|
|
10584
|
+
this.ownsHistory = owned;
|
|
10579
10585
|
this.runtime = new GessoRuntime({
|
|
10580
10586
|
root: options.root,
|
|
10581
10587
|
canvas: this.canvas,
|
|
@@ -10583,6 +10589,7 @@ var GessoApp = class {
|
|
|
10583
10589
|
services: options.services,
|
|
10584
10590
|
channels: options.channels,
|
|
10585
10591
|
routes: options.routes,
|
|
10592
|
+
url: history.url,
|
|
10586
10593
|
media: options.media,
|
|
10587
10594
|
fonts: options.fonts,
|
|
10588
10595
|
clock: (callback) => {
|
|
@@ -10868,12 +10875,11 @@ var GessoApp = class {
|
|
|
10868
10875
|
* be a difference between the two hosts that nothing declared.
|
|
10869
10876
|
*/
|
|
10870
10877
|
attachHistory() {
|
|
10871
|
-
const
|
|
10872
|
-
|
|
10873
|
-
this.ownsHistory = owned;
|
|
10878
|
+
const history = this.history;
|
|
10879
|
+
if (history === null) return;
|
|
10874
10880
|
this.runtime.onShellRequest((request) => this.handleShellRequest(request, history));
|
|
10875
10881
|
history.onChange((url) => this.runtime.setUrl(url));
|
|
10876
|
-
this.runtime.setUrl(history.url);
|
|
10882
|
+
if (history.url !== this.runtime.services.get(RouterService).url.value) this.runtime.setUrl(history.url);
|
|
10877
10883
|
}
|
|
10878
10884
|
/**
|
|
10879
10885
|
* Reports the platform's safe area and soft keyboard to the runtime.
|
|
@@ -12045,7 +12051,7 @@ var RenderWorkerApp = class {
|
|
|
12045
12051
|
dispatch(message) {
|
|
12046
12052
|
if (message.type === "init") {
|
|
12047
12053
|
this.appLogicWorker = message.appPort === void 0 ? void 0 : portHandle(message.appPort);
|
|
12048
|
-
this.initialize(message.canvas, message.width, message.height, message.dpr, message.renderer, message.accessibility !== false);
|
|
12054
|
+
this.initialize(message.canvas, message.width, message.height, message.dpr, message.renderer, message.accessibility !== false, message.url);
|
|
12049
12055
|
this.runtime.setTextInputSource(message.textInput ?? "keys");
|
|
12050
12056
|
return;
|
|
12051
12057
|
}
|
|
@@ -12195,7 +12201,7 @@ var RenderWorkerApp = class {
|
|
|
12195
12201
|
worker: this.appLogicWorker
|
|
12196
12202
|
};
|
|
12197
12203
|
}
|
|
12198
|
-
initialize(canvas, width, height, dpr, renderer, accessibility) {
|
|
12204
|
+
initialize(canvas, width, height, dpr, renderer, accessibility, url) {
|
|
12199
12205
|
this.runtime?.dispose();
|
|
12200
12206
|
this.channels?.dispose();
|
|
12201
12207
|
this.channels = createChannelRegistry(this.channelRegistrations.map((registration) => registration.worker === void 0 && registration.source === void 0 ? {
|
|
@@ -12215,6 +12221,7 @@ var RenderWorkerApp = class {
|
|
|
12215
12221
|
root: this.root,
|
|
12216
12222
|
services,
|
|
12217
12223
|
routes: this.routes,
|
|
12224
|
+
url,
|
|
12218
12225
|
media: this.media,
|
|
12219
12226
|
fonts: this.fonts,
|
|
12220
12227
|
canvas,
|