gesso-framework 0.6.3 → 0.6.4
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 +7 -0
- package/dist/{index-DWQA6g_M.d.ts → index-BvaYnj-Q.d.ts} +47 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +60 -4
- package/dist/index.js.map +1 -1
- package/dist/worker/index.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# gesso-framework
|
|
2
2
|
|
|
3
|
+
## 0.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2f6a858: The `history` option now also takes a ready-made `ShellHistory`, for an app embedded in a page whose address bar belongs to its host. An app in an iframe inside another product, such as an Atlassian Forge Custom UI app in Jira, can reach the host's address only through a history object the host hands out. Adapt that object to `ShellHistory` and pass it to `createApp`, `createSyncApp(...).useHistory` or `GessoApp` in place of `{ mode }`, and the router reads its starting url from it, pushes and replaces through it, and follows the changes it reports. A history passed in stays the caller's: disposing the app stops listening to it but does not dispose it, so it survives a remount. Options work exactly as before.
|
|
8
|
+
- gesso-core@0.6.4
|
|
9
|
+
|
|
3
10
|
## 0.6.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -5326,6 +5326,18 @@ interface ShellHistoryOptions {
|
|
|
5326
5326
|
/** `memory` mode only: where the app starts. Defaults to `/`. */
|
|
5327
5327
|
readonly initialUrl?: string;
|
|
5328
5328
|
}
|
|
5329
|
+
/**
|
|
5330
|
+
* A url kept somewhere, which the shell reads, writes and listens to.
|
|
5331
|
+
*
|
|
5332
|
+
* `createShellHistory` makes one from `ShellHistoryOptions`, and that
|
|
5333
|
+
* covers every window the app owns the address of. An app embedded in
|
|
5334
|
+
* a page whose address belongs to something else does not own it: an
|
|
5335
|
+
* Atlassian Forge Custom UI app runs in an iframe inside Jira, and the
|
|
5336
|
+
* only way to Jira's address bar is the history object Forge's bridge
|
|
5337
|
+
* hands out. Such a host implements this interface over whatever it
|
|
5338
|
+
* has, and passes the object as the app's `history` option in place of
|
|
5339
|
+
* options, so the router and the host's address bar stay one url.
|
|
5340
|
+
*/
|
|
5329
5341
|
interface ShellHistory {
|
|
5330
5342
|
/** The url the window is at now. */
|
|
5331
5343
|
readonly url: string;
|
|
@@ -5333,7 +5345,14 @@ interface ShellHistory {
|
|
|
5333
5345
|
replace(url: string): void;
|
|
5334
5346
|
back(): void;
|
|
5335
5347
|
forward(): void;
|
|
5336
|
-
/**
|
|
5348
|
+
/**
|
|
5349
|
+
* Reports urls the person produced: back, forward, or a typed address.
|
|
5350
|
+
*
|
|
5351
|
+
* There is one listener, and a second call replaces the first. An
|
|
5352
|
+
* app that was handed its history and is being taken down relies on
|
|
5353
|
+
* that to stop listening, since disposing a history it did not make
|
|
5354
|
+
* is not its decision.
|
|
5355
|
+
*/
|
|
5337
5356
|
onChange(listener: (url: string) => void): void;
|
|
5338
5357
|
dispose(): void;
|
|
5339
5358
|
}
|
|
@@ -5570,8 +5589,18 @@ interface WorkerAppOptions {
|
|
|
5570
5589
|
* routes, resolves nothing, and could not — a route names a
|
|
5571
5590
|
* component class, which never leaves the worker. It reports the url
|
|
5572
5591
|
* the window is at and performs the pushes the worker asks for.
|
|
5592
|
+
*
|
|
5593
|
+
* Or a `ShellHistory` made elsewhere, for a page whose address the
|
|
5594
|
+
* app does not own. An app embedded in another product — an
|
|
5595
|
+
* Atlassian Forge Custom UI app is an iframe inside Jira — reaches
|
|
5596
|
+
* the address bar only through the history object its host hands
|
|
5597
|
+
* out, so it adapts that object to `ShellHistory` and passes it here,
|
|
5598
|
+
* and the router and the host's address stay one url. A history
|
|
5599
|
+
* passed this way is used as it is and survives the app: unmount
|
|
5600
|
+
* stops listening to it but does not dispose it, by the rule
|
|
5601
|
+
* `appLogicWorker` follows, and a remount picks the same one up.
|
|
5573
5602
|
*/
|
|
5574
|
-
history?: ShellHistoryOptions;
|
|
5603
|
+
history?: ShellHistoryOptions | ShellHistory;
|
|
5575
5604
|
}
|
|
5576
5605
|
declare class WorkerApp {
|
|
5577
5606
|
private readonly options;
|
|
@@ -5604,6 +5633,8 @@ declare class WorkerApp {
|
|
|
5604
5633
|
*/
|
|
5605
5634
|
private scrollability;
|
|
5606
5635
|
private history;
|
|
5636
|
+
/** True only when the history was made here from options; see `resolveShellHistory`. */
|
|
5637
|
+
private ownsHistory;
|
|
5607
5638
|
/** True once the render worker has answered `ready` at least once. */
|
|
5608
5639
|
private ready;
|
|
5609
5640
|
/** The running `requestAnimationFrame` handle, when ticks are wanted. */
|
|
@@ -6026,8 +6057,11 @@ declare class GessoAppBuilder {
|
|
|
6026
6057
|
/**
|
|
6027
6058
|
* How the app's url is kept: `path` (pushState, the default in a
|
|
6028
6059
|
* browser), `hash`, or `memory`. See `shellHistory`.
|
|
6060
|
+
*
|
|
6061
|
+
* Or a `ShellHistory` made elsewhere, for an app embedded in a page
|
|
6062
|
+
* whose address belongs to its host; see `GessoAppOptions.history`.
|
|
6029
6063
|
*/
|
|
6030
|
-
useHistory(history: ShellHistoryOptions): this;
|
|
6064
|
+
useHistory(history: ShellHistoryOptions | ShellHistory): this;
|
|
6031
6065
|
/**
|
|
6032
6066
|
* Pins the rendering backend. Without this the app is on `auto`:
|
|
6033
6067
|
* WebGPU where the browser has it, Canvas2D elsewhere.
|
|
@@ -6152,8 +6186,14 @@ interface GessoAppOptions {
|
|
|
6152
6186
|
/**
|
|
6153
6187
|
* How the app's url is kept: `path` (pushState, the default in a
|
|
6154
6188
|
* browser), `hash`, or `memory`. See `shellHistory`.
|
|
6189
|
+
*
|
|
6190
|
+
* Or a `ShellHistory` made elsewhere, for a page whose address the
|
|
6191
|
+
* app does not own: an iframe inside another product, where the
|
|
6192
|
+
* host's own history object is the only way to its address bar. It
|
|
6193
|
+
* is used as it is, and left undisposed when the app is disposed,
|
|
6194
|
+
* because it belongs to whoever passed it.
|
|
6155
6195
|
*/
|
|
6156
|
-
history?: ShellHistoryOptions;
|
|
6196
|
+
history?: ShellHistoryOptions | ShellHistory;
|
|
6157
6197
|
canvas?: CanvasHost;
|
|
6158
6198
|
/** The rendering backend; see RendererChoice. Defaults to `auto`. */
|
|
6159
6199
|
renderer?: RendererChoice;
|
|
@@ -6230,6 +6270,8 @@ declare class GessoApp {
|
|
|
6230
6270
|
private audio;
|
|
6231
6271
|
private mirror;
|
|
6232
6272
|
private history;
|
|
6273
|
+
/** True only when the history was made here from options; see `resolveShellHistory`. */
|
|
6274
|
+
private ownsHistory;
|
|
6233
6275
|
private detachVisibility;
|
|
6234
6276
|
private detachFileDrop;
|
|
6235
6277
|
/** Pickers and remembered handles, made on the first file request. */
|
|
@@ -8319,4 +8361,4 @@ declare class RenderWorkerApp {
|
|
|
8319
8361
|
}
|
|
8320
8362
|
//#endregion
|
|
8321
8363
|
export { StorageAdapter as $, UiOwnerReport as $n, Resource as $r, FontFaceDeclaration as $t, Presence as A, AudioState as An, Channel as Ar, ActionCause as At, PersistedOptions as B, ShellFileType as Bn, bind as Br, UiTreeSnapshot as Bt, FocusService as C, formatUrl as Cn, pickKeys as Cr, AppLogicEndpoint as Ct, FindService as D, AudioRequest as Dn, findUnplainPath as Dr, ShellHistoryMode as Dt, TextService as E, AudioMetadata as En, createChannelRegistry as Er, ShellHistory as Et, AudioSinkOptions as F, UiDuration as Fn, ControlledOptions as Fr, DevtoolsEvent as Ft, IndexedDbStorage as G, ShellStorageResult as Gn, EachKey as Gr, FrameMetrics as Gt, persisted as H, ShellRequest as Hn, ShowProps as Hr, RuntimeErrorSource as Ht, AudioSinkOutput as I, UiEasingChoice as In, ControlledValue as Ir, DevtoolsRequest as It, OpfsFileHandle as J, observeColorScheme as Jn, debounced as Jr, GessoRuntimeOptions as Jt, IndexedDbStorageOptions as K, ColorScheme as Kn, EachProps as Kr, FramePhaseTimings as Kt, MediaSessionLike as L, ShellFile as Ln, controlled as Lr, FrameEntry as Lt, RouterOutlet as M, AnimateOptions as Mn, Inject as Mr, ChannelErrorEntry as Mt, AudioElementLike as N, AnimationService as Nn, Input as Nr, CommandEntry as Nt, observeMediaQuery as O, AudioSample as On, requirePlainData as Or, ShellHistoryOptions as Ot, AudioSink as P, SpringOptions as Pn, Output as Pr, ConsoleEntry as Pt, MemoryStorage as Q, UiNodeReport as Qn, mutate as Qr, UiFramePhase as Qt, audioClock as R, ShellFileRequest as Rn, ThemeTokenCell as Rr, PatchEntry as Rt, writeClipboard as S, buildPath as Sn, pick as Sr, createApp as St, EditingService as T, AudioAction as Tn, ChannelRegistryHandle as Tr, WorkerAppOptions as Tt, ShellStorage as U, ShellService as Un, show as Ur, RuntimeToShellMessage as Ut, PersistedState as V, ShellRecentFile as Vn, Show as Vr, treeText as Vt, ShellStorageOptions as W, ShellStorageOp as Wn, Each as Wr, ShellToRuntimeMessage as Wt, OpfsStorageOptions as X, NodePathTarget as Xn, MutateOptions as Xr, RuntimeInput as Xt, OpfsStorage as Y, BoundStream as Yn, throttled as Yr, RendererChoice as Yt, OpfsWritable as Z, UiEnvironmentReport as Zn, Mutation as Zr, UI_FRAME_PHASES as Zt, EditingMirrorTarget as _, derive as _i, RouteOptions as _n, createComponent as _r, GessoAppOptions as _t, UiRole as a, select as ai, MediaOptions as an, formatAge as ar, storageReadValue as at, EditingProxy as b, to as bn, isComponentElement as br, WebMcpChoice as bt, UiSemanticsPatch as c, FanOut as ci, RouteMatch as cn, formatStream as cr, UndoableOptions as ct, markNow as d, ComputedCell as di, RouterService as dn, ComponentHost as dr, UndoStackOptions as dt, ResourceOptions as ei, FontFaceLike as en, UiPropOrigin as er, StorageOutcome as et, measureSpan as f, ComputedOptions as fi, RouteState as fn, OverlayLayer as fr, UndoTransaction as ft, renderRoot as g, Equality as gi, RouteGuard as gn, OverlayService as gr, GessoApp as gt, RenderWorkerApp as h, DeriveOptions as hi, RouteDefinition as hn, OverlayRect as hr, shellStorageDenied as ht, UI_SEMANTIC_STATES as i, SelectOptions as ii, FontService as in, describeStream as ir, storageReadFailure as it, PresenceProps as j, AudioStatus as jn, Define as jr, ActionEntry as jt, observeReducedMotion as k, AudioService as kn, ChannelRegistry as kr, createShellHistory as kt, UiSemanticsRecord$1 as l, FanOutOptions as li, RouterHistorySink as ln, printPropValue as lr, undoable as lt, setPerformanceMarks$1 as m, computed as mi, RouteContext as mn, OverlayPlacement as mr, performShellStorage as mt, MARK_PREFIX as n, ResourceStatus as ni, FontFamilyStatus as nn, UiSemanticsReport as nr, classifyStorageError as nt, UiSemanticState as o, FanCell as oi, MediaService as on, formatNodePath as or, UndoShortcutOptions as ot, performanceMarksEnabled as p, ReadSource as pi, OutletProps as pn, OverlayEntry as pr, ShellLocalStore as pt, OpfsDirectory as q, ColorSchemePreference as qn, each as qr, GessoRuntime as qt, UI_ROLES as r, resource as ri, FontHost as rn, UiStreamReport as rr, storageErrorMessage as rt, UiSemanticsMap$1 as s, FanKey as si, RouteAnswer as sn, formatNodeReport as sr, registerUndoShortcuts as st, EditingState$1 as t, ResourceState as ti, FontFamilyDeclaration as tn, UiPropReport as tr, StorageRead as tt, markInstant as u, fanOut as ui, RouterRoutes as un, ComponentHostResolver as ur, UndoStack as ut, SemanticsMirror as v, ServiceRegistry as vi, RouteTarget as vn, ComponentElement as vr, createSyncApp as vt, ScrollService as w, parseUrl as wn, ChannelRegistration as wr, WorkerApp as wt, EditingProxySink as x, RouteParams as xn, structurallyEqual as xr, CreateAppOptions as xt, SemanticsMirrorSink as y, route as yn, FrameworkChild as yr, GessoAppBuilder as yt, FrameService as z, ShellFileResult as zn, themeTokenCell as zr, UiTreeNode as zt };
|
|
8322
|
-
//# sourceMappingURL=index-
|
|
8364
|
+
//# sourceMappingURL=index-BvaYnj-Q.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-U39HjNFA.js";
|
|
3
3
|
import { C as internalState, S as InternalState, _ as ReadableCell, a as ComponentType, b as isOutputTarget, c as isClassComponent, d as bounds, f as EmitArgs, g as OutputTarget, h as OutputCell, i as ComponentProps, l as ChannelReplica, m as InputCell, o as FunctionComponent, p as EmitValue, r as ComponentContext, s as Inputs, t as ClassComponent, u as BoundsCell, v as input, w as Component, x as output, y as into } from "./FunctionComponent-fYMdePtH.js";
|
|
4
|
-
import { $ as StorageAdapter, $n as UiOwnerReport, $r as Resource, $t as FontFaceDeclaration, A as Presence, An as AudioState, Ar as Channel, At as ActionCause, B as PersistedOptions, Bn as ShellFileType, Br as bind, Bt as UiTreeSnapshot, C as FocusService, Cn as formatUrl, Cr as pickKeys, Ct as AppLogicEndpoint, D as FindService, Dn as AudioRequest, Dr as findUnplainPath, Dt as ShellHistoryMode, E as TextService, En as AudioMetadata, Er as createChannelRegistry, Et as ShellHistory, F as AudioSinkOptions, Fn as UiDuration, Fr as ControlledOptions, Ft as DevtoolsEvent, G as IndexedDbStorage, Gn as ShellStorageResult, Gr as EachKey, Gt as FrameMetrics, H as persisted, Hn as ShellRequest, Hr as ShowProps, Ht as RuntimeErrorSource, I as AudioSinkOutput, In as UiEasingChoice, Ir as ControlledValue, It as DevtoolsRequest, J as OpfsFileHandle, Jn as observeColorScheme, Jr as debounced, Jt as GessoRuntimeOptions, K as IndexedDbStorageOptions, Kn as ColorScheme, Kr as EachProps, Kt as FramePhaseTimings, L as MediaSessionLike, Ln as ShellFile, Lr as controlled, Lt as FrameEntry, M as RouterOutlet, Mn as AnimateOptions, Mr as Inject, Mt as ChannelErrorEntry, N as AudioElementLike, Nn as AnimationService, Nr as Input, Nt as CommandEntry, O as observeMediaQuery, On as AudioSample, Or as requirePlainData, Ot as ShellHistoryOptions, P as AudioSink, Pn as SpringOptions, Pr as Output, Pt as ConsoleEntry, Q as MemoryStorage, Qn as UiNodeReport, Qr as mutate, Qt as UiFramePhase, R as audioClock, Rn as ShellFileRequest, Rr as ThemeTokenCell, Rt as PatchEntry, S as writeClipboard, Sn as buildPath, Sr as pick, St as createApp, T as EditingService, Tn as AudioAction, Tr as ChannelRegistryHandle, Tt as WorkerAppOptions, U as ShellStorage, Un as ShellService, Ur as show, Ut as RuntimeToShellMessage, V as PersistedState, Vn as ShellRecentFile, Vr as Show, Vt as treeText, W as ShellStorageOptions, Wn as ShellStorageOp, Wr as Each, Wt as ShellToRuntimeMessage, X as OpfsStorageOptions, Xn as NodePathTarget, Xr as MutateOptions, Xt as RuntimeInput, Y as OpfsStorage, Yn as BoundStream, Yr as throttled, Yt as RendererChoice, Z as OpfsWritable, Zn as UiEnvironmentReport, Zr as Mutation, Zt as UI_FRAME_PHASES, _ as EditingMirrorTarget, _i as derive, _n as RouteOptions, _r as createComponent, _t as GessoAppOptions, a as UiRole, ai as select, an as MediaOptions, ar as formatAge, at as storageReadValue, b as EditingProxy, bn as to, br as isComponentElement, bt as WebMcpChoice, c as UiSemanticsPatch, ci as FanOut, cn as RouteMatch, cr as formatStream, ct as UndoableOptions, d as markNow, di as ComputedCell, dn as RouterService, dr as ComponentHost, dt as UndoStackOptions, ei as ResourceOptions, en as FontFaceLike, er as UiPropOrigin, et as StorageOutcome, f as measureSpan, fi as ComputedOptions, fn as RouteState, fr as OverlayLayer, ft as UndoTransaction, g as renderRoot, gi as Equality, gn as RouteGuard, gr as OverlayService, gt as GessoApp, h as RenderWorkerApp, hi as DeriveOptions, hn as RouteDefinition, hr as OverlayRect, ht as shellStorageDenied, i as UI_SEMANTIC_STATES, ii as SelectOptions, in as FontService, ir as describeStream, it as storageReadFailure, j as PresenceProps, jn as AudioStatus, jr as Define, jt as ActionEntry, k as observeReducedMotion, kn as AudioService, kr as ChannelRegistry, kt as createShellHistory, l as UiSemanticsRecord, li as FanOutOptions, ln as RouterHistorySink, lr as printPropValue, lt as undoable, m as setPerformanceMarks, mi as computed, mn as RouteContext, mr as OverlayPlacement, mt as performShellStorage, n as MARK_PREFIX, ni as ResourceStatus, nn as FontFamilyStatus, nr as UiSemanticsReport, nt as classifyStorageError, o as UiSemanticState, oi as FanCell, on as MediaService, or as formatNodePath, ot as UndoShortcutOptions, p as performanceMarksEnabled, pi as ReadSource, pn as OutletProps, pr as OverlayEntry, pt as ShellLocalStore, q as OpfsDirectory, qn as ColorSchemePreference, qr as each, qt as GessoRuntime, r as UI_ROLES, ri as resource, rn as FontHost, rr as UiStreamReport, rt as storageErrorMessage, s as UiSemanticsMap, si as FanKey, sn as RouteAnswer, sr as formatNodeReport, st as registerUndoShortcuts, t as EditingState, ti as ResourceState, tn as FontFamilyDeclaration, tr as UiPropReport, tt as StorageRead, u as markInstant, ui as fanOut, un as RouterRoutes, ur as ComponentHostResolver, ut as UndoStack, v as SemanticsMirror, vi as ServiceRegistry, vn as RouteTarget, vr as ComponentElement, vt as createSyncApp, w as ScrollService, wn as parseUrl, wr as ChannelRegistration, wt as WorkerApp, x as EditingProxySink, xn as RouteParams, xr as structurallyEqual, xt as CreateAppOptions, y as SemanticsMirrorSink, yn as route, yr as FrameworkChild, yt as GessoAppBuilder, z as FrameService, zn as ShellFileResult, zr as themeTokenCell, zt as UiTreeNode } from "./index-
|
|
4
|
+
import { $ as StorageAdapter, $n as UiOwnerReport, $r as Resource, $t as FontFaceDeclaration, A as Presence, An as AudioState, Ar as Channel, At as ActionCause, B as PersistedOptions, Bn as ShellFileType, Br as bind, Bt as UiTreeSnapshot, C as FocusService, Cn as formatUrl, Cr as pickKeys, Ct as AppLogicEndpoint, D as FindService, Dn as AudioRequest, Dr as findUnplainPath, Dt as ShellHistoryMode, E as TextService, En as AudioMetadata, Er as createChannelRegistry, Et as ShellHistory, F as AudioSinkOptions, Fn as UiDuration, Fr as ControlledOptions, Ft as DevtoolsEvent, G as IndexedDbStorage, Gn as ShellStorageResult, Gr as EachKey, Gt as FrameMetrics, H as persisted, Hn as ShellRequest, Hr as ShowProps, Ht as RuntimeErrorSource, I as AudioSinkOutput, In as UiEasingChoice, Ir as ControlledValue, It as DevtoolsRequest, J as OpfsFileHandle, Jn as observeColorScheme, Jr as debounced, Jt as GessoRuntimeOptions, K as IndexedDbStorageOptions, Kn as ColorScheme, Kr as EachProps, Kt as FramePhaseTimings, L as MediaSessionLike, Ln as ShellFile, Lr as controlled, Lt as FrameEntry, M as RouterOutlet, Mn as AnimateOptions, Mr as Inject, Mt as ChannelErrorEntry, N as AudioElementLike, Nn as AnimationService, Nr as Input, Nt as CommandEntry, O as observeMediaQuery, On as AudioSample, Or as requirePlainData, Ot as ShellHistoryOptions, P as AudioSink, Pn as SpringOptions, Pr as Output, Pt as ConsoleEntry, Q as MemoryStorage, Qn as UiNodeReport, Qr as mutate, Qt as UiFramePhase, R as audioClock, Rn as ShellFileRequest, Rr as ThemeTokenCell, Rt as PatchEntry, S as writeClipboard, Sn as buildPath, Sr as pick, St as createApp, T as EditingService, Tn as AudioAction, Tr as ChannelRegistryHandle, Tt as WorkerAppOptions, U as ShellStorage, Un as ShellService, Ur as show, Ut as RuntimeToShellMessage, V as PersistedState, Vn as ShellRecentFile, Vr as Show, Vt as treeText, W as ShellStorageOptions, Wn as ShellStorageOp, Wr as Each, Wt as ShellToRuntimeMessage, X as OpfsStorageOptions, Xn as NodePathTarget, Xr as MutateOptions, Xt as RuntimeInput, Y as OpfsStorage, Yn as BoundStream, Yr as throttled, Yt as RendererChoice, Z as OpfsWritable, Zn as UiEnvironmentReport, Zr as Mutation, Zt as UI_FRAME_PHASES, _ as EditingMirrorTarget, _i as derive, _n as RouteOptions, _r as createComponent, _t as GessoAppOptions, a as UiRole, ai as select, an as MediaOptions, ar as formatAge, at as storageReadValue, b as EditingProxy, bn as to, br as isComponentElement, bt as WebMcpChoice, c as UiSemanticsPatch, ci as FanOut, cn as RouteMatch, cr as formatStream, ct as UndoableOptions, d as markNow, di as ComputedCell, dn as RouterService, dr as ComponentHost, dt as UndoStackOptions, ei as ResourceOptions, en as FontFaceLike, er as UiPropOrigin, et as StorageOutcome, f as measureSpan, fi as ComputedOptions, fn as RouteState, fr as OverlayLayer, ft as UndoTransaction, g as renderRoot, gi as Equality, gn as RouteGuard, gr as OverlayService, gt as GessoApp, h as RenderWorkerApp, hi as DeriveOptions, hn as RouteDefinition, hr as OverlayRect, ht as shellStorageDenied, i as UI_SEMANTIC_STATES, ii as SelectOptions, in as FontService, ir as describeStream, it as storageReadFailure, j as PresenceProps, jn as AudioStatus, jr as Define, jt as ActionEntry, k as observeReducedMotion, kn as AudioService, kr as ChannelRegistry, kt as createShellHistory, l as UiSemanticsRecord, li as FanOutOptions, ln as RouterHistorySink, lr as printPropValue, lt as undoable, m as setPerformanceMarks, mi as computed, mn as RouteContext, mr as OverlayPlacement, mt as performShellStorage, n as MARK_PREFIX, ni as ResourceStatus, nn as FontFamilyStatus, nr as UiSemanticsReport, nt as classifyStorageError, o as UiSemanticState, oi as FanCell, on as MediaService, or as formatNodePath, ot as UndoShortcutOptions, p as performanceMarksEnabled, pi as ReadSource, pn as OutletProps, pr as OverlayEntry, pt as ShellLocalStore, q as OpfsDirectory, qn as ColorSchemePreference, qr as each, qt as GessoRuntime, r as UI_ROLES, ri as resource, rn as FontHost, rr as UiStreamReport, rt as storageErrorMessage, s as UiSemanticsMap, si as FanKey, sn as RouteAnswer, sr as formatNodeReport, st as registerUndoShortcuts, t as EditingState, ti as ResourceState, tn as FontFamilyDeclaration, tr as UiPropReport, tt as StorageRead, u as markInstant, ui as fanOut, un as RouterRoutes, ur as ComponentHostResolver, ut as UndoStack, v as SemanticsMirror, vi as ServiceRegistry, vn as RouteTarget, vr as ComponentElement, vt as createSyncApp, w as ScrollService, wn as parseUrl, wr as ChannelRegistration, wt as WorkerApp, x as EditingProxySink, xn as RouteParams, xr as structurallyEqual, xt as CreateAppOptions, y as SemanticsMirrorSink, yn as route, yr as FrameworkChild, yt as GessoAppBuilder, z as FrameService, zn as ShellFileResult, zr as themeTokenCell, zt as UiTreeNode } from "./index-BvaYnj-Q.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 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, 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
|
@@ -3761,6 +3761,51 @@ function createShellHistory(options = {}, host = typeof window === "undefined" ?
|
|
|
3761
3761
|
if (mode === "memory" || host === void 0) return new MemoryHistory(options.initialUrl ?? "/");
|
|
3762
3762
|
return new BrowserHistory(host, mode, options.base ?? "");
|
|
3763
3763
|
}
|
|
3764
|
+
/**
|
|
3765
|
+
* The history an app runs against, and whether the app may dispose it.
|
|
3766
|
+
*
|
|
3767
|
+
* Options are turned into a history here, and that history is the
|
|
3768
|
+
* app's to dispose with everything else it made. A history passed in
|
|
3769
|
+
* ready-made is used as it is and left alone at the end, by the rule
|
|
3770
|
+
* `appLogicWorker` already follows: what the app made, it disposes;
|
|
3771
|
+
* what it was handed, it leaves to whoever handed it. That is also
|
|
3772
|
+
* what keeps a host's history alive across a remount, which disposes
|
|
3773
|
+
* the app and builds it again around the same object.
|
|
3774
|
+
*/
|
|
3775
|
+
function resolveShellHistory(source) {
|
|
3776
|
+
if (isShellHistory(source)) return {
|
|
3777
|
+
history: source,
|
|
3778
|
+
owned: false
|
|
3779
|
+
};
|
|
3780
|
+
return {
|
|
3781
|
+
history: createShellHistory(source),
|
|
3782
|
+
owned: true
|
|
3783
|
+
};
|
|
3784
|
+
}
|
|
3785
|
+
/**
|
|
3786
|
+
* Tells a ready-made history from options by its methods.
|
|
3787
|
+
*
|
|
3788
|
+
* Options are plain data and never carry a function, so the presence of
|
|
3789
|
+
* `push` and `onChange` as functions is unambiguous. It is checked by
|
|
3790
|
+
* behaviour rather than by `instanceof` because the histories worth
|
|
3791
|
+
* passing are adapters an embedder wrote, not classes from here.
|
|
3792
|
+
*/
|
|
3793
|
+
function isShellHistory(value) {
|
|
3794
|
+
return value !== void 0 && typeof value.push === "function" && typeof value.onChange === "function";
|
|
3795
|
+
}
|
|
3796
|
+
/**
|
|
3797
|
+
* Stops an app hearing about a history it is done with.
|
|
3798
|
+
*
|
|
3799
|
+
* A history the app made is disposed, which drops its listeners and
|
|
3800
|
+
* its window events with it. One it was handed is not the app's to
|
|
3801
|
+
* dispose, so the listener is replaced with one that does nothing:
|
|
3802
|
+
* the host's history goes on working, and a back button pressed after
|
|
3803
|
+
* the app is gone no longer reaches it.
|
|
3804
|
+
*/
|
|
3805
|
+
function releaseShellHistory(history, owned) {
|
|
3806
|
+
if (owned) history.dispose();
|
|
3807
|
+
else history.onChange(() => {});
|
|
3808
|
+
}
|
|
3764
3809
|
var MemoryHistory = class {
|
|
3765
3810
|
entries;
|
|
3766
3811
|
index = 0;
|
|
@@ -4078,6 +4123,8 @@ var WorkerApp = class {
|
|
|
4078
4123
|
right: false
|
|
4079
4124
|
};
|
|
4080
4125
|
history = null;
|
|
4126
|
+
/** True only when the history was made here from options; see `resolveShellHistory`. */
|
|
4127
|
+
ownsHistory = false;
|
|
4081
4128
|
/** True once the render worker has answered `ready` at least once. */
|
|
4082
4129
|
ready = false;
|
|
4083
4130
|
/** The running `requestAnimationFrame` handle, when ticks are wanted. */
|
|
@@ -4439,8 +4486,9 @@ var WorkerApp = class {
|
|
|
4439
4486
|
this.proxy = null;
|
|
4440
4487
|
this.mirror?.dispose();
|
|
4441
4488
|
this.mirror = null;
|
|
4442
|
-
this.history
|
|
4489
|
+
if (this.history !== null) releaseShellHistory(this.history, this.ownsHistory);
|
|
4443
4490
|
this.history = null;
|
|
4491
|
+
this.ownsHistory = false;
|
|
4444
4492
|
this.detachInput?.();
|
|
4445
4493
|
this.detachInput = null;
|
|
4446
4494
|
this.audio?.dispose();
|
|
@@ -4595,8 +4643,9 @@ var WorkerApp = class {
|
|
|
4595
4643
|
* the screen that url names, not on its root.
|
|
4596
4644
|
*/
|
|
4597
4645
|
attachHistory() {
|
|
4598
|
-
const history =
|
|
4646
|
+
const { history, owned } = resolveShellHistory(this.options.history);
|
|
4599
4647
|
this.history = history;
|
|
4648
|
+
this.ownsHistory = owned;
|
|
4600
4649
|
history.onChange((url) => this.post({
|
|
4601
4650
|
type: "url",
|
|
4602
4651
|
url
|
|
@@ -9708,6 +9757,8 @@ var GessoApp = class {
|
|
|
9708
9757
|
audio = null;
|
|
9709
9758
|
mirror = null;
|
|
9710
9759
|
history = null;
|
|
9760
|
+
/** True only when the history was made here from options; see `resolveShellHistory`. */
|
|
9761
|
+
ownsHistory = false;
|
|
9711
9762
|
detachVisibility = null;
|
|
9712
9763
|
detachFileDrop = null;
|
|
9713
9764
|
/** Pickers and remembered handles, made on the first file request. */
|
|
@@ -9931,8 +9982,9 @@ var GessoApp = class {
|
|
|
9931
9982
|
this.detachColorScheme = null;
|
|
9932
9983
|
this.detachViewportInsets?.();
|
|
9933
9984
|
this.detachViewportInsets = null;
|
|
9934
|
-
this.history
|
|
9985
|
+
if (this.history !== null) releaseShellHistory(this.history, this.ownsHistory);
|
|
9935
9986
|
this.history = null;
|
|
9987
|
+
this.ownsHistory = false;
|
|
9936
9988
|
this.adapter.detach();
|
|
9937
9989
|
this.resizeObserver?.disconnect();
|
|
9938
9990
|
this.resizeObserver = null;
|
|
@@ -10014,8 +10066,9 @@ var GessoApp = class {
|
|
|
10014
10066
|
* be a difference between the two hosts that nothing declared.
|
|
10015
10067
|
*/
|
|
10016
10068
|
attachHistory() {
|
|
10017
|
-
const history =
|
|
10069
|
+
const { history, owned } = resolveShellHistory(this.historyOptions);
|
|
10018
10070
|
this.history = history;
|
|
10071
|
+
this.ownsHistory = owned;
|
|
10019
10072
|
this.runtime.onShellRequest((request) => this.handleShellRequest(request, history));
|
|
10020
10073
|
history.onChange((url) => this.runtime.setUrl(url));
|
|
10021
10074
|
this.runtime.setUrl(history.url);
|
|
@@ -10204,6 +10257,9 @@ var GessoAppBuilder = class {
|
|
|
10204
10257
|
/**
|
|
10205
10258
|
* How the app's url is kept: `path` (pushState, the default in a
|
|
10206
10259
|
* browser), `hash`, or `memory`. See `shellHistory`.
|
|
10260
|
+
*
|
|
10261
|
+
* Or a `ShellHistory` made elsewhere, for an app embedded in a page
|
|
10262
|
+
* whose address belongs to its host; see `GessoAppOptions.history`.
|
|
10207
10263
|
*/
|
|
10208
10264
|
useHistory(history) {
|
|
10209
10265
|
this.historyOptions = history;
|