@devframes/hub 0.9.7 → 0.9.9
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/dist/client/index.d.mts +72 -51
- package/dist/client/index.mjs +119 -44
- package/dist/{constants-DrF61GFx.mjs → constants-BUd6oMci.mjs} +9 -8
- package/dist/{constants-C5t0DeZ0.d.mts → constants-Coo1p3ja.d.mts} +12 -9
- package/dist/constants.d.mts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/{context-C3hUUCC1.mjs → context-D4L966cN.mjs} +233 -135
- package/dist/{context-D5JSW_X5.d.mts → context-Di-fhMKP.d.mts} +40 -18
- package/dist/{index-DhxIxS-Q.d.mts → index-faD2d5iX.d.mts} +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/node/index.d.mts +28 -19
- package/dist/node/index.mjs +2 -2
- package/dist/node/initiate.d.mts +35 -30
- package/dist/node/initiate.mjs +80 -53
- package/dist/{remote-url-Bgc7gtsP.mjs → remote-url-UClKLQ5_.mjs} +34 -39
- package/dist/{settings-D7whfcx2.d.mts → settings-CWHPzCWS.d.mts} +65 -39
- package/dist/types/index.d.mts +4 -4
- package/package.json +6 -6
package/dist/client/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../index-
|
|
1
|
+
import { C as DevframeMessageEntryInput, O as DevframeMessagesClient } from "../context-Di-fhMKP.mjs";
|
|
2
|
+
import { A as DevframeViewIframe, C as DevframeDockUserEntry, F as RemoteConnectionInfo, P as NavTarget, S as DevframeDockPanelState, _ as DevframeDockEntry, a as DevframeCommandEntry, b as DevframeDockEntryIcon, g as DevframeDockEntriesGrouped, n as DevframeClientCommand, p as ClientScriptEntry, s as DevframeCommandKeybinding, t as DevframeDocksUserSettings } from "../settings-CWHPzCWS.mjs";
|
|
3
|
+
import "../index-faD2d5iX.mjs";
|
|
4
4
|
import { DevframeClientRpcHost, DevframeConnection, DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientOptions, DevframeRpcContext, RpcClientEvents, RpcClientEvents as RpcClientEvents$1 } from "devframe/client";
|
|
5
5
|
import { EventEmitter } from "devframe/types";
|
|
6
6
|
import { SharedState } from "devframe/utils/shared-state";
|
|
@@ -12,10 +12,10 @@ export * from "devframe/client";
|
|
|
12
12
|
* specifiers pass through untouched; a **bare** specifier resolves through
|
|
13
13
|
* the explicit `resolveClientModule` callback (a viewer's own policy), then
|
|
14
14
|
* the host-advertised `template` (`ConnectionMeta.configs.dock.clientModuleResolution`,
|
|
15
|
-
* its `{specifier}` token replaced
|
|
15
|
+
* its `{specifier}` token replaced, e.g. Vite's `'/@id/{specifier}'`),
|
|
16
16
|
* resolved against `metaBaseUrl` so it targets the host's origin from any
|
|
17
|
-
* viewer. With neither, it stays unchanged
|
|
18
|
-
* cover it.
|
|
17
|
+
* viewer. With neither, it stays unchanged, since a page import map may
|
|
18
|
+
* still cover it.
|
|
19
19
|
*/
|
|
20
20
|
declare function resolveClientModuleSpecifier(specifier: string, options?: {
|
|
21
21
|
resolveClientModule?: (specifier: string) => string | undefined;
|
|
@@ -55,21 +55,21 @@ interface DockRendererInstance {
|
|
|
55
55
|
dispose?: () => void;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* A renderer for a dock `type`. The headless hub is renderer-agnostic
|
|
58
|
+
* A renderer for a dock `type`. The headless hub is renderer-agnostic: a
|
|
59
59
|
* host registers renderers at boot (e.g. injecting `@devframes/json-render-ui`
|
|
60
60
|
* for the `'json-render'` type) or serves them as prebuilt modules through the
|
|
61
61
|
* hub's renderer manifest (`initHub({ renderers })`). The renderer owns its
|
|
62
62
|
* framework (Vue, React, …); the hub only routes a dock type to it and
|
|
63
63
|
* disposes it on deactivation.
|
|
64
64
|
*
|
|
65
|
-
* Integration packages narrow `Entry` to export a precisely-typed contract
|
|
65
|
+
* Integration packages narrow `Entry` to export a precisely-typed contract,
|
|
66
66
|
* e.g. `@devframes/json-render/hub` exports
|
|
67
67
|
* `JsonRenderDockRenderer = DockRenderer<DevframeJsonRenderDockEntry>`.
|
|
68
68
|
*/
|
|
69
69
|
type DockRenderer<Entry extends DevframeDockEntry = DevframeDockEntry> = (options: DockRendererMountOptions<Entry>) => DockRendererInstance | Promise<DockRendererInstance>;
|
|
70
70
|
/**
|
|
71
71
|
* The outcome of {@link DockRenderersContext.mount}. A missing renderer is an
|
|
72
|
-
* expected, non-exceptional state
|
|
72
|
+
* expected, non-exceptional state: a viewer renders its "no renderer for this
|
|
73
73
|
* dock type" fallback from `missing-renderer`, and its error variant (with a
|
|
74
74
|
* retry affordance) from `load-error`.
|
|
75
75
|
*/
|
|
@@ -85,8 +85,8 @@ type DockRendererMountResult = {
|
|
|
85
85
|
/**
|
|
86
86
|
* The dock-renderer registry surfaced on the client host context. A viewer
|
|
87
87
|
* calls {@link DockRenderersContext.mount} to render a dock whose `type` has a
|
|
88
|
-
* renderer
|
|
89
|
-
* hub's renderer manifest
|
|
88
|
+
* renderer (registered locally at boot, or served as a prebuilt module by the
|
|
89
|
+
* hub's renderer manifest) into a container it owns; the host tracks the
|
|
90
90
|
* instance and disposes it when the entry deactivates.
|
|
91
91
|
*/
|
|
92
92
|
interface DockRenderersContext {
|
|
@@ -94,13 +94,13 @@ interface DockRenderersContext {
|
|
|
94
94
|
* Register a renderer for a dock `type`. Returns an unregister function.
|
|
95
95
|
* Accepts a renderer narrowed to any specific entry variant (e.g. a
|
|
96
96
|
* {@link DockRenderer}<DevframeJsonRenderDockEntry> from an integration
|
|
97
|
-
* package)
|
|
97
|
+
* package); the type routes only its own entries to it.
|
|
98
98
|
*/
|
|
99
99
|
register: (type: string, renderer: DockRenderer<any>) => () => void;
|
|
100
100
|
/** Look up the locally-registered renderer for a dock `type`, if any. */
|
|
101
101
|
get: (type: string) => DockRenderer | undefined;
|
|
102
102
|
/**
|
|
103
|
-
* Whether a renderer is available for a dock `type
|
|
103
|
+
* Whether a renderer is available for a dock `type`, registered locally
|
|
104
104
|
* **or** provided by the hub's renderer manifest. A viewer checks this
|
|
105
105
|
* before mounting to render its missing-renderer fallback declaratively.
|
|
106
106
|
*/
|
|
@@ -112,14 +112,14 @@ interface DockRenderersContext {
|
|
|
112
112
|
* registered. The mounted instance is also disposed automatically when the
|
|
113
113
|
* entry deactivates. Resolves `missing-renderer` (with a `console.warn`)
|
|
114
114
|
* when neither source has the type, and `load-error` when the module import
|
|
115
|
-
* or the renderer itself fails
|
|
115
|
+
* or the renderer itself fails. A failed import is not cached, so a retry
|
|
116
116
|
* re-imports.
|
|
117
117
|
*/
|
|
118
118
|
mount: (entry: DevframeDockEntry, container: HTMLElement) => Promise<DockRendererMountResult>;
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* The renderer manifest published by the hub at the
|
|
122
|
-
* `devframe:dock-renderers` shared-state slot
|
|
122
|
+
* `devframe:dock-renderers` shared-state slot: one {@link ClientScriptEntry}
|
|
123
123
|
* per dock `type`, whose `importFrom` is a URL path the hub serves
|
|
124
124
|
* (`<base>__renderers/<type>.mjs`). Mirrors the dock client-script
|
|
125
125
|
* convention: the module's `importName` export (default `'default'`) is a
|
|
@@ -130,20 +130,20 @@ type DockRendererManifest = Record<string, ClientScriptEntry>;
|
|
|
130
130
|
interface CreateDockRenderersContextOptions {
|
|
131
131
|
/** The assembled client context handed to renderers at mount. */
|
|
132
132
|
context: () => DevframeClientContext;
|
|
133
|
-
/** Renderers registered locally at boot
|
|
133
|
+
/** Renderers registered locally at boot; these win over manifest modules. */
|
|
134
134
|
local?: Record<string, DockRenderer<any>>;
|
|
135
135
|
/** The current {@link DockRendererManifest} (live getter). */
|
|
136
136
|
manifest?: () => DockRendererManifest;
|
|
137
137
|
/**
|
|
138
138
|
* Called with each successful mount's disposer so the caller can tie
|
|
139
139
|
* disposal to its own lifecycle (entry deactivation, host teardown). An
|
|
140
|
-
* optional returned cleanup runs exactly once when the mount is disposed
|
|
140
|
+
* optional returned cleanup runs exactly once when the mount is disposed,
|
|
141
141
|
* whichever side (caller or viewer) triggers it first.
|
|
142
142
|
*/
|
|
143
143
|
onMounted?: (dispose: () => void, entry: DevframeDockEntry) => (() => void) | void;
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
146
|
-
* Build the {@link DockRenderersContext} shared by every hub-aware client
|
|
146
|
+
* Build the {@link DockRenderersContext} shared by every hub-aware client.
|
|
147
147
|
* `createDevframeClientRuntime` and hub UI providers that assemble their own context
|
|
148
148
|
* (`@devframes/hub-ui`) both delegate here so local-first resolution, lazy
|
|
149
149
|
* manifest imports, and the typed mount result behave identically everywhere.
|
|
@@ -164,7 +164,7 @@ interface DockPanelStorage {
|
|
|
164
164
|
* Per-tab UI state of the dock panel, distinct from the browser-shared geometry
|
|
165
165
|
* in {@link DockPanelStorage}. A hub UI provider persists this to `sessionStorage` so a
|
|
166
166
|
* reload (or the RPC auth handshake that follows one) restores the panel to
|
|
167
|
-
* exactly where the developer left it
|
|
167
|
+
* exactly where the developer left it: which dock was open, and the
|
|
168
168
|
* address-bar route of that dock's iframe. Kept `sessionStorage`-scoped (not
|
|
169
169
|
* `localStorage`) because it is per-tab navigation state: two tabs open against
|
|
170
170
|
* the same dev server each keep their own selection rather than fighting over a
|
|
@@ -183,7 +183,7 @@ interface DockSessionStorage {
|
|
|
183
183
|
selectedDockRoute: string | null;
|
|
184
184
|
/**
|
|
185
185
|
* The dock entry most recently selected from beyond the float bar's inline
|
|
186
|
-
* capacity
|
|
186
|
+
* capacity, whether from the overflow popover or from inside a dock group. A hub UI
|
|
187
187
|
* provider raises this entry into a dedicated slot between the bar's visible
|
|
188
188
|
* items and the overflow button, so deselecting it (or selecting a visible
|
|
189
189
|
* neighbour) keeps it one click away instead of folding it straight back
|
|
@@ -247,7 +247,7 @@ interface DocksConnectionContext {
|
|
|
247
247
|
/** The most recent connection-level error, or `null` when healthy. */
|
|
248
248
|
readonly error: Error | null;
|
|
249
249
|
/**
|
|
250
|
-
* The client's event emitter
|
|
250
|
+
* The client's event emitter. Subscribe to `connection:status`,
|
|
251
251
|
* `connection:error`, and `rpc:error` to react to changes.
|
|
252
252
|
*/
|
|
253
253
|
readonly events: EventEmitter<RpcClientEvents$1>;
|
|
@@ -260,10 +260,17 @@ interface WhenClauseContext {
|
|
|
260
260
|
readonly context: WhenContext;
|
|
261
261
|
}
|
|
262
262
|
type DevframeClientContext = DocksContext;
|
|
263
|
+
interface DocksPanelEvents {
|
|
264
|
+
'panel:state:changed': (panelState: DevframeDockPanelState) => void;
|
|
265
|
+
}
|
|
263
266
|
interface DocksPanelContext {
|
|
267
|
+
/** The current panel state snapshot. */
|
|
268
|
+
readonly state: DevframeDockPanelState;
|
|
269
|
+
/** Subscribe to panel state changes after the current snapshot. */
|
|
270
|
+
readonly events: EventEmitter<DocksPanelEvents>;
|
|
264
271
|
store: DockPanelStorage;
|
|
265
272
|
/**
|
|
266
|
-
* Per-tab session UI state
|
|
273
|
+
* Per-tab session UI state: whether the panel is open, which dock is
|
|
267
274
|
* selected, and that dock's iframe route. Restored across reloads (and the
|
|
268
275
|
* auth handshake that follows one) by a hub UI provider that persists it to
|
|
269
276
|
* `sessionStorage`.
|
|
@@ -275,7 +282,7 @@ interface DocksPanelContext {
|
|
|
275
282
|
/**
|
|
276
283
|
* Claim the persisted {@link DockSessionStorage.selectedDockRoute boot route} for a dock
|
|
277
284
|
* id, once. Returns the saved address-bar URL only for the dock that was
|
|
278
|
-
* selected before the last reload
|
|
285
|
+
* selected before the last reload (and only on the first call for it), so a
|
|
279
286
|
* restored iframe boots deep-linked while a later switch to a different dock
|
|
280
287
|
* (whose live route isn't reflected in {@link DockSessionStorage.selectedDockRoute} yet)
|
|
281
288
|
* doesn't reuse the stale value. Returns `null` otherwise.
|
|
@@ -290,11 +297,11 @@ interface DocksEntriesContext {
|
|
|
290
297
|
entryToStateMap: Map<string, DockEntryState>;
|
|
291
298
|
groupedEntries: DevframeDockEntriesGrouped;
|
|
292
299
|
/**
|
|
293
|
-
* The resolved top-level category ordering
|
|
300
|
+
* The resolved top-level category ordering: `DEFAULT_CATEGORIES_ORDER`,
|
|
294
301
|
* overridden by every installed devframe's own `dock.categoryOrder`
|
|
295
302
|
* (`ConnectionMeta.configs.dock.categoryOrder`), overridden again by the
|
|
296
303
|
* host page's own `createDevframeClientRuntime({ categoryOrder })`. Fixed
|
|
297
|
-
* for the life of the session
|
|
304
|
+
* for the life of the session, resolved once at boot.
|
|
298
305
|
*/
|
|
299
306
|
readonly categoryOrder: Record<string, number>;
|
|
300
307
|
settings: SharedState<DevframeDocksUserSettings>;
|
|
@@ -320,7 +327,7 @@ interface DocksEntriesContext {
|
|
|
320
327
|
* {@link entries}. Unlike a dock registered on the node
|
|
321
328
|
* {@link import('../types/docks').DevframeDocksHost}, it never flows into
|
|
322
329
|
* shared state, so it stays local to this client instead of syncing to the
|
|
323
|
-
* hub or other hub UI providers
|
|
330
|
+
* hub or other hub UI providers, suiting a view the client runtime synthesizes itself.
|
|
324
331
|
*
|
|
325
332
|
* Throws when `id` already names a client dock, unless `force` is set. A
|
|
326
333
|
* client dock sharing an id with a server dock overrides it in the local
|
|
@@ -336,7 +343,7 @@ interface DocksEntriesContext {
|
|
|
336
343
|
}
|
|
337
344
|
interface DockRegistration<T extends DevframeDockEntry = DevframeDockEntry> {
|
|
338
345
|
/**
|
|
339
|
-
* Patch the registered client dock in place. The `id` is immutable
|
|
346
|
+
* Patch the registered client dock in place. The `id` is immutable, so passing
|
|
340
347
|
* a differing `id` throws.
|
|
341
348
|
*/
|
|
342
349
|
update: (patch: Partial<T>) => void;
|
|
@@ -388,6 +395,20 @@ interface CommandsContext {
|
|
|
388
395
|
* Whether the command palette is open
|
|
389
396
|
*/
|
|
390
397
|
paletteOpen: boolean;
|
|
398
|
+
/**
|
|
399
|
+
* The command whose children the palette should open drilled into, or `null`
|
|
400
|
+
* for the root list. Set by {@link CommandsContext.openPalette}; the palette
|
|
401
|
+
* reads it when it opens and clears it when it closes.
|
|
402
|
+
*/
|
|
403
|
+
paletteScopeId: string | null;
|
|
404
|
+
/**
|
|
405
|
+
* Open the command palette, optionally scoped to one command's children:
|
|
406
|
+
* e.g. a dock group with no `defaultChildId` opens the palette listing just
|
|
407
|
+
* that group's members instead of guessing one for the user.
|
|
408
|
+
*
|
|
409
|
+
* Passing no id opens the root list, the same as setting `paletteOpen` true.
|
|
410
|
+
*/
|
|
411
|
+
openPalette: (atCommandId?: string) => void;
|
|
391
412
|
}
|
|
392
413
|
//#endregion
|
|
393
414
|
//#region src/client/client-script.d.ts
|
|
@@ -400,7 +421,7 @@ interface DockClientScriptContext extends DocksContext {
|
|
|
400
421
|
*/
|
|
401
422
|
current: DockEntryState;
|
|
402
423
|
/**
|
|
403
|
-
* Messages client scoped to this dock entry
|
|
424
|
+
* Messages client scoped to this dock entry. Messages it adds default
|
|
404
425
|
* their `category` to the entry id, so the feed can attribute them.
|
|
405
426
|
*/
|
|
406
427
|
messages: DevframeMessagesClient;
|
|
@@ -433,8 +454,8 @@ declare function resolveDockIcon(icon: DevframeDockEntryIcon, connection: Devfra
|
|
|
433
454
|
/**
|
|
434
455
|
* Live location tracking for an iframe dock.
|
|
435
456
|
*
|
|
436
|
-
* An iframe dock's address bar
|
|
437
|
-
* `DockSessionStorage.selectedDockRoute`
|
|
457
|
+
* An iframe dock's address bar (and the route persisted from it into
|
|
458
|
+
* `DockSessionStorage.selectedDockRoute`) has to follow wherever the embedded
|
|
438
459
|
* app actually goes. The `load` event only covers whole-document navigations, so
|
|
439
460
|
* an SPA router moving between routes with `history.pushState()` leaves both
|
|
440
461
|
* showing the URL the frame booted with.
|
|
@@ -442,21 +463,21 @@ declare function resolveDockIcon(icon: DevframeDockEntryIcon, connection: Devfra
|
|
|
442
463
|
* {@link watchFrameLocation} closes that gap for a same-origin frame, reporting
|
|
443
464
|
* `location.href` on every navigation it can observe:
|
|
444
465
|
*
|
|
445
|
-
* - `popstate` / `hashchange
|
|
466
|
+
* - `popstate` / `hashchange`: back/forward and hash routing;
|
|
446
467
|
* - `history.pushState`/`replaceState`, wrapped in place (and restored on
|
|
447
468
|
* dispose) because those two fire no event of their own;
|
|
448
469
|
* - the [Navigation API](https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API)'s
|
|
449
470
|
* `currententrychange` where it exists, which reports post-commit and so also
|
|
450
|
-
* catches what a wrapper structurally cannot
|
|
471
|
+
* catches what a wrapper structurally cannot: a router holding a reference to
|
|
451
472
|
* `pushState` captured before this watch attached;
|
|
452
473
|
* - `load`, which also re-subscribes: a document navigation swaps the frame's
|
|
453
474
|
* `history`/`navigation` objects, so the previous subscription dies with them.
|
|
454
475
|
*
|
|
455
476
|
* These sources overlap deliberately rather than being chosen between, since a
|
|
456
|
-
* report is deduped against the last href
|
|
477
|
+
* report is deduped against the last href, so the cost of hearing the same
|
|
457
478
|
* navigation twice is nothing, and the cost of missing one is a stale route.
|
|
458
479
|
*
|
|
459
|
-
* A cross-origin frame reports nothing
|
|
480
|
+
* A cross-origin frame reports nothing, because its location is unreadable by design,
|
|
460
481
|
* so the caller keeps the last URL it knew.
|
|
461
482
|
*/
|
|
462
483
|
/** The minimal `history` surface the watcher wraps. Injectable for tests. */
|
|
@@ -504,7 +525,7 @@ declare function watchFrameLocation(options: WatchFrameLocationOptions): () => v
|
|
|
504
525
|
//#endregion
|
|
505
526
|
//#region src/client/frame-nav.d.ts
|
|
506
527
|
/**
|
|
507
|
-
* Shared-iframe soft navigation
|
|
528
|
+
* Shared-iframe soft navigation: the hub-UI-provider-side half of a host-page↔iframe
|
|
508
529
|
* `postMessage` protocol.
|
|
509
530
|
*
|
|
510
531
|
* An {@link DevframeViewIframe.subTabs anchor} iframe dock owns one live iframe
|
|
@@ -520,7 +541,7 @@ declare function watchFrameLocation(options: WatchFrameLocationOptions): () => v
|
|
|
520
541
|
* highlight to match.
|
|
521
542
|
*
|
|
522
543
|
* The protocol is server-free (works cross-origin and in static builds) and
|
|
523
|
-
* decoupled
|
|
544
|
+
* decoupled, so the embedded app takes no hub/RPC dependency, only the shim.
|
|
524
545
|
*/
|
|
525
546
|
/** `postMessage` channel tag shared by both halves of the protocol. */
|
|
526
547
|
declare const FRAME_NAV_CHANNEL: string;
|
|
@@ -593,11 +614,11 @@ interface FrameNavListenTarget {
|
|
|
593
614
|
interface FrameNavClientOptions {
|
|
594
615
|
/** The shared frame id (defaults to the anchor's, else the anchor id). */
|
|
595
616
|
frameId: string;
|
|
596
|
-
/** The anchor iframe dock entry
|
|
617
|
+
/** The anchor iframe dock entry, supplying url/icon/groupId defaults. */
|
|
597
618
|
anchor: DevframeViewIframe;
|
|
598
619
|
/** The live iframe element hosting the embedded app. */
|
|
599
620
|
iframe: Pick<HTMLIFrameElement, 'contentWindow' | 'src'>;
|
|
600
|
-
/** Client docks context
|
|
621
|
+
/** Client docks context, used to register members and drive selection. */
|
|
601
622
|
docks: Pick<DocksEntriesContext, 'register' | 'switchEntry' | 'getStateById'>;
|
|
602
623
|
/**
|
|
603
624
|
* Window to receive the frame's `message` events on (the host page window).
|
|
@@ -627,7 +648,7 @@ declare function attachFrameNavClient(options: FrameNavClientOptions): FrameNavC
|
|
|
627
648
|
interface DevframeClientRuntimeOptions {
|
|
628
649
|
/**
|
|
629
650
|
* An already-connected RPC client. When omitted, one is created via
|
|
630
|
-
* `connectDevframe(connect)
|
|
651
|
+
* `connectDevframe(connect)`, so pass `connect.baseURL` to point at the hub's
|
|
631
652
|
* connection-meta mount (e.g. `/__hub/`).
|
|
632
653
|
*/
|
|
633
654
|
rpc?: DevframeRpcClient;
|
|
@@ -635,8 +656,8 @@ interface DevframeClientRuntimeOptions {
|
|
|
635
656
|
connect?: DevframeRpcClientOptions;
|
|
636
657
|
/**
|
|
637
658
|
* Environment the host runs in.
|
|
638
|
-
* - `'standalone'` (default)
|
|
639
|
-
* - `'embedded'
|
|
659
|
+
* - `'standalone'` (default): the runtime owns the whole page (a hub UI).
|
|
660
|
+
* - `'embedded'`: the runtime lives inside a user app alongside a panel.
|
|
640
661
|
*/
|
|
641
662
|
clientType?: DockClientType;
|
|
642
663
|
/**
|
|
@@ -646,7 +667,7 @@ interface DevframeClientRuntimeOptions {
|
|
|
646
667
|
loadClientScripts?: boolean;
|
|
647
668
|
/**
|
|
648
669
|
* Resolve a **bare-specifier** client script (`importFrom` naming an npm
|
|
649
|
-
* module) to a URL this page can import
|
|
670
|
+
* module) to a URL this page can import, a hub UI provider's own policy that wins
|
|
650
671
|
* over the host-advertised `ConnectionMeta.configs.dock.clientModuleResolution`
|
|
651
672
|
* template (return `undefined` to fall through to it). URL specifiers never
|
|
652
673
|
* reach this hook. E.g. on a Vite-served page:
|
|
@@ -660,11 +681,11 @@ interface DevframeClientRuntimeOptions {
|
|
|
660
681
|
* `@devframes/json-render-ui`). The hub ships none by default.
|
|
661
682
|
*
|
|
662
683
|
* Local registrations take precedence over the hub's renderer manifest
|
|
663
|
-
* (`initHub({ renderers })`)
|
|
684
|
+
* (`initHub({ renderers })`), since explicit local code beats wire config.
|
|
664
685
|
*/
|
|
665
686
|
renderers?: Record<string, DockRenderer<any>>;
|
|
666
687
|
/**
|
|
667
|
-
* Hub-wide override of the top-level dock-bar category ordering
|
|
688
|
+
* Hub-wide override of the top-level dock-bar category ordering: a map of
|
|
668
689
|
* category id → ordering weight (lower sorts earlier), mirroring the shape
|
|
669
690
|
* of {@link import('../constants').DEFAULT_CATEGORIES_ORDER}.
|
|
670
691
|
*
|
|
@@ -696,24 +717,24 @@ interface DevframeClientRuntime {
|
|
|
696
717
|
* Boot the client runtime: connect RPC, assemble the full
|
|
697
718
|
* {@link DevframeClientContext} (panel, docks, commands, when) from the hub's
|
|
698
719
|
* shared state, publish it at `__DEVFRAME_HUB_CLIENT_CONTEXT__`, and load every
|
|
699
|
-
* dock entry's client script into this page
|
|
720
|
+
* dock entry's client script into this page, the devframe equivalent of the
|
|
700
721
|
* runtime `@vitejs/devtools-kit` injects into a host app.
|
|
701
722
|
*
|
|
702
723
|
* A hub UI provider keeps rendering its own dock UI (reading the same shared state); this
|
|
703
724
|
* runtime is what gives plugin client scripts a live host context to run in.
|
|
704
725
|
*/
|
|
705
726
|
declare function createDevframeClientRuntime(options?: DevframeClientRuntimeOptions): Promise<DevframeClientRuntime>;
|
|
706
|
-
/** @deprecated Renamed
|
|
727
|
+
/** @deprecated Renamed; use {@link DevframeClientRuntimeOptions}. */
|
|
707
728
|
type DevframeClientHostOptions = DevframeClientRuntimeOptions;
|
|
708
|
-
/** @deprecated Renamed
|
|
729
|
+
/** @deprecated Renamed; use {@link DevframeClientRuntime}. */
|
|
709
730
|
type DevframeClientHost = DevframeClientRuntime;
|
|
710
|
-
/** @deprecated Renamed
|
|
731
|
+
/** @deprecated Renamed; use {@link createDevframeClientRuntime}. */
|
|
711
732
|
declare const createDevframeClientHost: typeof createDevframeClientRuntime;
|
|
712
733
|
//#endregion
|
|
713
734
|
//#region src/client/messages.d.ts
|
|
714
735
|
interface MessagesClientOptions {
|
|
715
736
|
/**
|
|
716
|
-
* Default fields merged beneath every `add()` input
|
|
737
|
+
* Default fields merged beneath every `add()` input. The client host passes
|
|
717
738
|
* `{ category: entry.id }` to scope a dock client script's messages to its
|
|
718
739
|
* entry. Fields set on the input itself win.
|
|
719
740
|
*/
|
|
@@ -752,10 +773,10 @@ declare function parseRemoteConnection(input?: string): RemoteConnectionInfo | n
|
|
|
752
773
|
* the current URL and returns a connected {@link DevframeRpcClient}.
|
|
753
774
|
*
|
|
754
775
|
* Pairs with `remote: true` on a `DevframeViewIframe` registered on the node
|
|
755
|
-
* side
|
|
776
|
+
* side, where the hub injects the descriptor into the iframe URL.
|
|
756
777
|
*
|
|
757
778
|
* @throws if no descriptor is present in the URL.
|
|
758
779
|
*/
|
|
759
780
|
declare function connectRemoteDevframe(options?: ConnectRemoteDevframeOptions): Promise<DevframeRpcClient>;
|
|
760
781
|
//#endregion
|
|
761
|
-
export { CLIENT_CONTEXT_KEY, CommandsContext, ConnectRemoteDevframeOptions, CreateDockRenderersContextOptions, DevframeClientContext, DevframeClientHost, DevframeClientHostOptions, type DevframeClientRpcHost, DevframeClientRuntime, DevframeClientRuntimeOptions, DockClientScriptContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DockRegistration, DockRenderer, DockRendererInstance, DockRendererManifest, DockRendererMountOptions, DockRendererMountResult, DockRenderersContext, DockSessionStorage, DocksConnectionContext, DocksContext, DocksEntriesContext, DocksPanelContext, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, FrameLocationHistory, FrameLocationTarget, FrameLocationWindow, FrameNavClient, FrameNavClientOptions, FrameNavEnvelope, FrameNavFrameMessage, FrameNavHostMessage, FrameNavHostPayload, FrameNavListenTarget, FrameTab, MessagesClientOptions, type RpcClientEvents, WatchFrameLocationOptions, WhenClauseContext, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientHost, createDevframeClientRuntime, createDockRenderersContext, createMessagesClient, getDevframeClientContext, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
|
|
782
|
+
export { CLIENT_CONTEXT_KEY, CommandsContext, ConnectRemoteDevframeOptions, CreateDockRenderersContextOptions, DevframeClientContext, DevframeClientHost, DevframeClientHostOptions, type DevframeClientRpcHost, DevframeClientRuntime, DevframeClientRuntimeOptions, DockClientScriptContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DockRegistration, DockRenderer, DockRendererInstance, DockRendererManifest, DockRendererMountOptions, DockRendererMountResult, DockRenderersContext, DockSessionStorage, DocksConnectionContext, DocksContext, DocksEntriesContext, DocksPanelContext, DocksPanelEvents, FRAME_NAV_CHANNEL, FRAME_NAV_VERSION, FrameLocationHistory, FrameLocationTarget, FrameLocationWindow, FrameNavClient, FrameNavClientOptions, FrameNavEnvelope, FrameNavFrameMessage, FrameNavHostMessage, FrameNavHostPayload, FrameNavListenTarget, FrameTab, MessagesClientOptions, type RpcClientEvents, WatchFrameLocationOptions, WhenClauseContext, attachFrameNavClient, buildRemoteDevframeUrl, clientScriptFailureHint, connectRemoteDevframe, createDevframeClientHost, createDevframeClientRuntime, createDockRenderersContext, createMessagesClient, getDevframeClientContext, parseRemoteConnection, resolveClientModuleSpecifier, resolveDockIcon, resolveDockUrl, setDevframeClientContext, stripRemoteConnectionFromUrl, watchFrameLocation };
|