@bgub/fig 0.1.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/{element-9MtOc5qb.d.ts → element-B4LrR2ZB.d.ts} +7 -4
- package/dist/{element-mHDfizuh.js → element-j7AKp0nu.js} +15 -6
- package/dist/element-j7AKp0nu.js.map +1 -0
- package/dist/{hooks-Bw3vbom7.d.ts → hooks-QSWYd3Vl.d.ts} +27 -15
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/internal.d.ts +5 -3
- package/dist/internal.js +5 -5
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/{dist-development/payload-format-BbsvTG9V.js → dist/payload-format-B9UbNtxo.js} +2 -1
- package/dist/payload-format-B9UbNtxo.js.map +1 -0
- package/dist/payload.d.ts +1 -1
- package/dist/payload.js +4 -3
- package/dist/payload.js.map +1 -1
- package/{dist-development/resource-Bhusybfq.js → dist/resource-Lwjz_b4h.js} +17 -11
- package/dist/resource-Lwjz_b4h.js.map +1 -0
- package/dist/{transition-WvgFiYNY.js → transition-DJfG2ZSm.js} +108 -65
- package/dist/transition-DJfG2ZSm.js.map +1 -0
- package/dist-development/{element-CVlfN_3_.js → element-DzmNF67v.js} +15 -6
- package/dist-development/element-DzmNF67v.js.map +1 -0
- package/dist-development/index.js +3 -3
- package/dist-development/internal.js +5 -5
- package/dist-development/jsx-runtime.js +1 -1
- package/{dist/payload-format-BbsvTG9V.js → dist-development/payload-format-B9UbNtxo.js} +2 -1
- package/dist-development/payload-format-B9UbNtxo.js.map +1 -0
- package/dist-development/payload.js +4 -3
- package/dist-development/payload.js.map +1 -1
- package/{dist/resource-BJxS62H2.js → dist-development/resource-YO25HR7G.js} +17 -11
- package/dist-development/resource-YO25HR7G.js.map +1 -0
- package/dist-development/{transition-BSxdDR9D.js → transition-CrIF0Kz_.js} +108 -65
- package/dist-development/transition-CrIF0Kz_.js.map +1 -0
- package/package.json +1 -1
- package/dist/element-mHDfizuh.js.map +0 -1
- package/dist/payload-format-BbsvTG9V.js.map +0 -1
- package/dist/resource-BJxS62H2.js.map +0 -1
- package/dist/transition-WvgFiYNY.js.map +0 -1
- package/dist-development/element-CVlfN_3_.js.map +0 -1
- package/dist-development/payload-format-BbsvTG9V.js.map +0 -1
- package/dist-development/resource-Bhusybfq.js.map +0 -1
- package/dist-development/transition-BSxdDR9D.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
+
## @bgub/fig@2.0.0
|
|
2
|
+
|
|
3
|
+
### Catch data changes before subscription commit
|
|
4
|
+
|
|
5
|
+
Recheck rendered data values after installing subscriptions so updates from deletion cleanup or reentrant subscription callbacks cannot leave a newly mounted reader permanently stale. Schedule missed visible updates synchronously after commit or deferred capture release, while preserving offscreen priority for hidden readers.
|
|
6
|
+
|
|
7
|
+
### Preserve host behavior lifetimes across configuration updates
|
|
8
|
+
|
|
9
|
+
Add `context.owns(prop)` to identify the last mixin writer of a host prop, even
|
|
10
|
+
when a later override writes the same value.
|
|
11
|
+
|
|
12
|
+
Add `hostBinding(context, owner, update)` for mixins that register committed DOM
|
|
13
|
+
configuration. Updates keep their lifetime signal; removal, owner replacement,
|
|
14
|
+
and Activity hiding abort it synchronously.
|
|
15
|
+
|
|
16
|
+
The host `bind` prop additionally accepts host-binding descriptions and nested
|
|
17
|
+
binding arrays through the new `Binding` type. Array members have independent
|
|
18
|
+
signals and development strict checks. `Bind` remains callable, and
|
|
19
|
+
`composeBind` preserves its callable result and shared lifetime semantics.
|
|
20
|
+
`BindCallback` is an alias for `Bind`.
|
|
21
|
+
|
|
22
|
+
Headless widgets adopt shared committed value, registration, and reference owners.
|
|
23
|
+
Controlled props cannot leak from suspended renders, accepted uncontrolled
|
|
24
|
+
requests compose before commit, and compound Combobox changes cancel together.
|
|
25
|
+
Host configuration updates preserve typeahead and toast work while actual
|
|
26
|
+
removal cleans up immediately. Caller-authored native disability and accessible
|
|
27
|
+
names remain authoritative.
|
|
28
|
+
|
|
29
|
+
### Own speculative work by render attempt
|
|
30
|
+
|
|
31
|
+
Render attempts own data read sets, client external-store observations, boundary retries, and the sparse commit index. Checkpoints roll these back together, and terminal commit candidates release all speculative ownership. Data stores retain committed subscriptions without retaining values from abandoned fiber generations.
|
|
32
|
+
|
|
33
|
+
Commit candidates publish once and retain their identity across deferred host callbacks. Capture release is independent of mutation and cannot finish a newer candidate.
|
|
34
|
+
|
|
35
|
+
Custom commit coordinators must migrate `runMutation()` result handling from `Result | undefined` to `ReconcilerMutationResult<Result>`: `{ kind: "committed", value }`, `{ kind: "stale" }`, or `{ kind: "failed" }`. Stale candidates skip mutation and the post-mutation callback. Failed results indicate an error during publication or the callback; deferred failures are reported through the root, while synchronous failures still throw. Release prepared capture state and call `captureFinished()` for all returned outcomes. Successful callbacks returning `undefined` remain explicitly committed.
|
|
36
|
+
|
|
37
|
+
### Simplify render and data ownership
|
|
38
|
+
|
|
39
|
+
Use controller identity to retire superseded actions and transitions, and keep each pending data load with its controller in one record. Consolidate speculative data dependencies into one read map while preserving thrown-read subscriptions and releasing value snapshots at commit. Server reads skip client dependency bookkeeping.
|
|
40
|
+
|
|
41
|
+
Process root and component queues through one operation with explicit fiber ownership. Invalidate each inconsistent component once when checking data and external-store snapshots.
|
|
42
|
+
|
|
43
|
+
### Keep data reads consistent across yielded renders
|
|
44
|
+
|
|
45
|
+
Track temporary render-time data snapshots and revalidate them before concurrent commits. Initial reads can no longer remain on an old value when hydration or refresh publishes between render chunks before subscriptions exist.
|
|
46
|
+
|
|
47
|
+
## @bgub/fig@1.0.0
|
|
48
|
+
|
|
49
|
+
### Preserve Activity boundaries through Payload
|
|
50
|
+
|
|
51
|
+
Server components can return Activity boundaries whose modes, keys, and nested children survive Payload decoding. Hidden content remains hidden during subsequent HTML and client rendering.
|
|
52
|
+
|
|
53
|
+
### Explicit async transition ownership
|
|
54
|
+
|
|
55
|
+
Transition callbacks now receive `(signal, update)`. Wrap post-await updates in `update(() => ...)` to schedule them in the original transition and restore its data store. Pending async callbacks no longer capture unrelated updates. Update handles become inert on callback settlement or cancellation. Action result scheduling remains automatic; arbitrary post-await setters have ordinary priority. Router history loading no longer opens a long-lived transition scope.
|
|
56
|
+
|
|
57
|
+
The `update` callback's type rejects promise and thenable return values to catch accidental async callbacks before runtime.
|
|
58
|
+
|
|
59
|
+
Migration: transition and action signals now abort on every settlement, including successful completion. Abort listeners perform lifetime cleanup; `signal.aborted` alone does not identify cancellation or failure. Successful action results still commit, and `isPending` may remain true after the signal retires while rendering waits to commit.
|
|
60
|
+
|
|
1
61
|
## @bgub/fig@0.1.1
|
|
2
62
|
|
|
3
63
|
### Document every JSR entrypoint and exported symbol
|
|
@@ -80,17 +80,20 @@ interface FigDataStoreOptions {
|
|
|
80
80
|
initialData?: readonly FigDataHydrationEntry[];
|
|
81
81
|
partition?: DataResourceKeyInput;
|
|
82
82
|
}
|
|
83
|
+
type FigDataReads = Map<string, {
|
|
84
|
+
value: unknown;
|
|
85
|
+
} | undefined>;
|
|
83
86
|
/** Describes Fig data store. */
|
|
84
87
|
interface FigDataStore extends FigDataStoreHandle {
|
|
85
|
-
|
|
88
|
+
areDataDependenciesConsistent(reads: FigDataReads): boolean;
|
|
89
|
+
commitDataDependencies(owner: object, previousOwner: object | null, reads?: FigDataReads): boolean;
|
|
86
90
|
deleteDataOwner(owner: object): void;
|
|
87
91
|
releaseDataOwner(owner: object): void;
|
|
88
|
-
resetDataDependencies(owner: object): void;
|
|
89
92
|
dispose(): void;
|
|
90
93
|
inspectDataDependencyCanonicalKeys(owner: object): string[];
|
|
91
94
|
inspectDataEntries(): DataStoreEntrySnapshot[];
|
|
92
95
|
snapshot(): FigDataHydrationEntry[];
|
|
93
|
-
readData<TArgs extends unknown[], TValue>(resource: DataResource<TArgs, TValue>, args: TArgs,
|
|
96
|
+
readData<TArgs extends unknown[], TValue>(resource: DataResource<TArgs, TValue>, args: TArgs, reads?: FigDataReads): TValue;
|
|
94
97
|
}
|
|
95
98
|
/** Describes Fig data store host. */
|
|
96
99
|
interface FigDataStoreHost {
|
|
@@ -456,4 +459,4 @@ declare function isViewTransition(value: unknown): value is FigViewTransition;
|
|
|
456
459
|
/** Checks whether assets. */
|
|
457
460
|
declare function isAssets(value: unknown): value is FigAssets;
|
|
458
461
|
//#endregion
|
|
459
|
-
export { isViewTransition as $,
|
|
462
|
+
export { isViewTransition as $, LoadContextAttributeError as $t, Fragment as A, modulepreload as At, ViewTransitionPhase as B, DataResourceKeyInput as Bt, FigNode as C, assetResourceHostProps as Ct, FigSuspenseSymbol as D, font as Dt, FigSuspense as E, clientReferenceAssets as Et, SuspenseProps as F, stylesheet as Ft, createPortalNode as G, FigDataHydrationEntry as Gt, ViewTransitionSurface as H, DataResourceLoader as Ht, ViewTransition as I, title as It, isClientReference as J, FigDataStoreController as Jt, isActivity as K, FigDataReads as Kt, ViewTransitionCallback as L, DataRefreshResult as Lt, LazyLoader as M, preload as Mt, Props as N, preventAssetResourceHoist as Nt, FigViewTransition as O, isFigAssetResource as Ot, Suspense as P, script as Pt, isValidElement as Q, FigDataStoreOptions as Qt, ViewTransitionClass as R, DataResource as Rt, FigErrorBoundarySymbol as S, assetResourceFromHostValues as St, FigPortalSymbol as T, assets as Tt, clientReference as U, DataStoreEntrySnapshot as Ut, ViewTransitionProps as V, DataResourceLoadContext as Vt, createElement as W, FigDataEntryStatus as Wt, isPortal as X, FigDataStoreHandle as Xt, isErrorBoundary as Y, FigDataStoreFactory as Yt, isSuspense as Z, FigDataStoreHost as Zt, FigClientReference as _, StylesheetResource as _t, AwaitedFigNode as a, markDataResourceError as an, ClientReferenceAssets as at, FigElementSymbol as b, assetResourceFromHostAttributes as bt, ComponentType as c, FigAssetResource as ct, ErrorBoundaryProps as d, MetaResource as dt, LoadContextCapabilities as en, lazy as et, ErrorInfo as f, MetaResourceOptions as ft, FigAssetsSymbol as g, ScriptResource as gt, FigAssets as h, PreloadResource as ht, Assets as i, loadContextCapabilities as in, AssetsProps as it, Key as j, preconnect as jt, FigViewTransitionSymbol as k, meta as kt, ElementType as l, FigAssetResourceList as lt, FigActivitySymbol as m, PreconnectResource as mt, ActivityMode as n, dataResourceKeysForError as nn, AssetResourceDestination as nt, ClientReferenceOptions as o, resolveCurrentDataStore as on, CrossOrigin as ot, FigActivity as p, ModulePreloadResource as pt, isAssets as q, FigDataStore as qt, ActivityProps as r, defineLoadContextCapabilities as rn, AssetResourceHostProps as rt, ComponentProps as s, setCurrentDataStore as sn, FetchPriority as st, Activity as t, LoadContextHydrate as tn, AssetResourceBlocking as tt, ErrorBoundary as u, FontResource as ut, FigClientReferenceSymbol as v, TitleResource as vt, FigPortal as w, assetResourceKey as wt, FigErrorBoundary as x, assetResourceFromHostProps as xt, FigElement as y, assetResourceDestination as yt, ViewTransitionEvent as z, DataResourceKey as zt };
|
|
@@ -14,6 +14,10 @@ function loadContextCapabilities(context) {
|
|
|
14
14
|
}
|
|
15
15
|
const objectDataErrors = /* @__PURE__ */ new WeakMap();
|
|
16
16
|
let currentDataStore = null;
|
|
17
|
+
/** Captures an optional data store for synchronous scope re-entry. */
|
|
18
|
+
function getCurrentDataStore() {
|
|
19
|
+
return currentDataStore;
|
|
20
|
+
}
|
|
17
21
|
/** Resolves current data store. */
|
|
18
22
|
function resolveCurrentDataStore(message = "Data resource APIs require a Fig data store.") {
|
|
19
23
|
if (currentDataStore === null) throw new Error(message);
|
|
@@ -59,13 +63,14 @@ function useState(initialState) {
|
|
|
59
63
|
* Tracks state returned by a client-side action. The action receives the
|
|
60
64
|
* previous committed state first, then the runner's arguments, then an
|
|
61
65
|
* `AbortSignal` Fig appends (declare the trailing signal parameter — it also
|
|
62
|
-
* drives `Args` inference).
|
|
63
|
-
* and
|
|
66
|
+
* drives `Args` inference). Fig schedules the returned value in the action’s
|
|
67
|
+
* transition lane and keeps `isPending` true until settlement and commit.
|
|
68
|
+
* Arbitrary post-await setters have ordinary priority.
|
|
64
69
|
*
|
|
65
70
|
* Runs are last-run-wins: starting a new run aborts the previous one's
|
|
66
71
|
* signal and retires it — a retired run's settlement (value or rejection)
|
|
67
72
|
* never touches state or pending. The signal also aborts on unmount and
|
|
68
|
-
* when an enclosing Activity hides.
|
|
73
|
+
* when an enclosing Activity hides or the action settles.
|
|
69
74
|
*/
|
|
70
75
|
function useActionState(action, initialState) {
|
|
71
76
|
return resolveDispatcher().useActionState(action, initialState);
|
|
@@ -165,6 +170,7 @@ function resolveHostMix(type, input) {
|
|
|
165
170
|
const mix = props.mix;
|
|
166
171
|
delete props.mix;
|
|
167
172
|
let resolvedMixins = 0;
|
|
173
|
+
let owners;
|
|
168
174
|
function resolve(value, slot) {
|
|
169
175
|
if (emptyMixinValue(value)) return;
|
|
170
176
|
if (Array.isArray(value)) {
|
|
@@ -177,7 +183,8 @@ function resolveHostMix(type, input) {
|
|
|
177
183
|
const context = {
|
|
178
184
|
[FigMixinSlotSymbol]: slot,
|
|
179
185
|
props,
|
|
180
|
-
type
|
|
186
|
+
type,
|
|
187
|
+
owns: (prop) => owners?.get(prop) === slot
|
|
181
188
|
};
|
|
182
189
|
const result = value.type(context, ...value.args);
|
|
183
190
|
if (emptyMixinValue(result)) return;
|
|
@@ -190,6 +197,8 @@ function resolveHostMix(type, input) {
|
|
|
190
197
|
if ("children" in returnedProps || "key" in returnedProps || "unsafeHTML" in returnedProps) throw new Error(`A mixin on <${type}> cannot return children, key, or unsafeHTML.`);
|
|
191
198
|
const { mix: nestedMix, ...patch } = returnedProps;
|
|
192
199
|
Object.assign(props, patch);
|
|
200
|
+
owners ??= /* @__PURE__ */ new Map();
|
|
201
|
+
for (const name of Object.keys(patch)) owners.set(name, slot);
|
|
193
202
|
resolve(nestedMix, `${slot}.mix`);
|
|
194
203
|
}
|
|
195
204
|
resolve(mix, "0");
|
|
@@ -352,6 +361,6 @@ function hasFunctionBrand(value, brand) {
|
|
|
352
361
|
return typeof value === "function" && "$$typeof" in value && value.$$typeof === brand;
|
|
353
362
|
}
|
|
354
363
|
//#endregion
|
|
355
|
-
export {
|
|
364
|
+
export { getCurrentDataStore as $, markClientOnlyHostBehavior as A, useBeforeLayout as B, isSuspense as C, FigMixinSymbol as D, lazy as E, readContext as F, useMemo as G, useCallback as H, readData as I, useState as J, useReactive as K, readPromise as L, mixinSlot as M, resolveHostMix as N, clientOnlyHostBehavior as O, preloadData as P, defineLoadContextCapabilities as Q, setCurrentDispatcher as R, isPortal as S, isViewTransition as T, useDeferredValue as U, useBeforePaint as V, useId as W, useTransition as X, useSyncExternalStore as Y, dataResourceKeysForError as Z, createPortalNode as _, FigAssetsSymbol as a, isClientReference as b, FigErrorBoundarySymbol as c, FigViewTransitionSymbol as d, isAttributableError as et, Fragment as f, createElement as g, clientReference as h, FigActivitySymbol as i, setCurrentDataStore as it, markClientOnlyHostProps as j, createMixin as k, FigPortalSymbol as l, ViewTransition as m, Assets as n, markDataResourceError as nt, FigClientReferenceSymbol as o, Suspense as p, useStableEvent as q, ErrorBoundary as r, resolveCurrentDataStore as rt, FigElementSymbol as s, Activity as t, loadContextCapabilities as tt, FigSuspenseSymbol as u, isActivity as v, isValidElement as w, isErrorBoundary as x, isAssets as y, useActionState as z };
|
|
356
365
|
|
|
357
|
-
//# sourceMappingURL=element-
|
|
366
|
+
//# sourceMappingURL=element-j7AKp0nu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-j7AKp0nu.js","names":["runtimeType"],"sources":["../src/data.ts","../src/hooks.ts","../src/mixin.ts","../src/element.ts"],"sourcesContent":["/** Describes data resource key input. */\nexport type DataResourceKeyInput =\n | string\n | number\n | boolean\n | null\n | readonly DataResourceKeyInput[]\n | { readonly [key: string]: DataResourceKeyInput };\n\n/** Describes data resource key. */\nexport type DataResourceKey = readonly [string, ...DataResourceKeyInput[]];\n\n/** Describes data resource load context. */\nexport interface DataResourceLoadContext {\n signal: AbortSignal;\n}\n\n/** Describes data resource loader. */\nexport type DataResourceLoader<TArgs extends unknown[], TValue> = (\n ...argsAndContext: [...TArgs, DataResourceLoadContext]\n) => TValue | PromiseLike<TValue>;\n\n/** Describes data resource. */\nexport interface DataResource<\n TArgs extends unknown[] = unknown[],\n TValue = unknown,\n> {\n readonly $$typeof: symbol;\n readonly debugArgs?: (...args: TArgs) => DataResourceKeyInput;\n readonly key: (...args: TArgs) => DataResourceKey;\n readonly load?: DataResourceLoader<TArgs, TValue>;\n}\n\n/** Describes data refresh result. */\nexport type DataRefreshResult<T> =\n | { status: \"fulfilled\"; value: T }\n | { status: \"rejected\"; error: unknown; staleValue?: T }\n | {\n status: \"aborted\";\n reason: \"superseded\" | \"store-disposed\" | \"evicted\";\n staleValue?: T;\n }\n | {\n status: \"unsupported\";\n reason: \"no-client-loader\";\n staleValue?: T;\n };\n\n/** Describes Fig data hydration entry. */\nexport interface FigDataHydrationEntry {\n key: DataResourceKey;\n value: unknown;\n}\n\n/** Describes Fig data entry status. */\nexport type FigDataEntryStatus =\n | \"pending\"\n | \"fulfilled\"\n | \"rejected\"\n | \"refreshing\";\n\n/** Describes data store entry snapshot. */\nexport interface DataStoreEntrySnapshot {\n canonicalKey: string;\n error?: unknown;\n hasValue: boolean;\n key: DataResourceKey;\n pending: boolean;\n refreshError?: unknown;\n stale: boolean;\n status: FigDataEntryStatus;\n subscriberCount: number;\n value?: unknown;\n}\n\n// The explicit, app-facing store surface (FigRoot.data, readDataStore()).\n// The free functions in @bgub/fig resolve the ambient store slot, which\n// is only set while Fig executes synchronously — render, event handlers, the\n// synchronous prefix of actions and transitions, and effects. After an\n// `await` the slot is gone, so async flows capture this handle first and call\n// its methods instead.\n/** Describes Fig data store handle. */\nexport interface FigDataStoreHandle {\n // The awaitable read for code outside render (route loaders, actions after\n // an await): resolve the value this key would render with — the cached\n // value when the entry has one (kicking the same background revalidation a\n // stale readData does), the in-flight load's settlement on a cache miss —\n // and reject with the error readData would throw. Does not subscribe;\n // pair with readData in the component, which claims the settled entry\n // within the preload retention window.\n ensureData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n ...args: TArgs\n ): Promise<TValue>;\n hydrate(entries: readonly FigDataHydrationEntry[]): void;\n invalidateData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n ...args: TArgs\n ): void;\n invalidateDataError(error: unknown): boolean;\n invalidateDataKey(key: DataResourceKey): void;\n invalidateDataPrefix(prefix: DataResourceKey): void;\n preloadData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n ...args: TArgs\n ): void;\n refreshData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n ...args: TArgs\n ): Promise<DataRefreshResult<TValue>>;\n run<T>(callback: () => T): T;\n}\n\n/**\n * A root-neutral data store. A renderer adopts it exactly once, preserving\n * entries loaded before rendering while attaching subscriber scheduling.\n */\nexport interface FigDataStoreController extends FigDataStoreHandle {\n dispose(): void;\n snapshot(): FigDataHydrationEntry[];\n}\n\n/** Describes Fig data store options. */\nexport interface FigDataStoreOptions {\n initialData?: readonly FigDataHydrationEntry[];\n partition?: DataResourceKeyInput;\n}\n\n// Attempt-owned observations. A missing snapshot records a read that threw;\n// wrapping successful values distinguishes a fulfilled undefined value.\nexport type FigDataReads = Map<string, { value: unknown } | undefined>;\n\n/** Describes Fig data store. */\nexport interface FigDataStore extends FigDataStoreHandle {\n areDataDependenciesConsistent(reads: FigDataReads): boolean;\n // Installs subscriptions, consumes reads, and reports whether they still match.\n commitDataDependencies(\n owner: object,\n previousOwner: object | null,\n reads?: FigDataReads,\n ): boolean;\n deleteDataOwner(owner: object): void;\n releaseDataOwner(owner: object): void;\n dispose(): void;\n inspectDataDependencyCanonicalKeys(owner: object): string[];\n inspectDataEntries(): DataStoreEntrySnapshot[];\n snapshot(): FigDataHydrationEntry[];\n // Renderer plumbing, not handle surface: args stay an array because the\n // optional attempt-owned reads trail them. Server reads omit observations.\n readData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n args: TArgs,\n reads?: FigDataReads,\n ): TValue;\n}\n\n// The host callbacks a renderer hands to the data-store factory. Structurally\n// compatible with @bgub/fig's DataStoreHost so its renderer store can\n// register directly.\n/** Describes Fig data store host. */\nexport interface FigDataStoreHost {\n getLane(): unknown;\n partition?: DataResourceKeyInput;\n schedule(owner: object, lane: unknown): void;\n}\n\n/** Describes Fig data store factory. */\nexport type FigDataStoreFactory = (host: FigDataStoreHost) => FigDataStore;\n\n// The internal, generation-guarded metadata a store attaches to each loader\n// context (symbol-keyed: DataResourceLoadContext stays { signal } publicly).\n// Adapters use the resolved key and decode Payload rows through the calling\n// store without recomputing identity or exposing these capabilities to loaders.\n/** Describes load context hydrate. */\nexport type LoadContextHydrate = (\n entries: readonly FigDataHydrationEntry[],\n) => void;\n/** Describes load context attribute error. */\nexport type LoadContextAttributeError = (error: unknown) => void;\n\n/** Describes load context capabilities. */\nexport interface LoadContextCapabilities {\n attributeError: LoadContextAttributeError;\n hydrate: LoadContextHydrate;\n // Store contexts always provide this; optional keeps synthetic decoder\n // contexts usable without pretending they belong to a cache entry.\n key?: DataResourceKey;\n}\n\nconst LoadContextCapabilitiesSymbol = Symbol.for(\"fig.data-load-context\");\ntype DataResourceLoadContextWithCapabilities = DataResourceLoadContext & {\n [LoadContextCapabilitiesSymbol]?: LoadContextCapabilities;\n};\n\n/** Define load context capabilities. */\nexport function defineLoadContextCapabilities(\n context: DataResourceLoadContext,\n capabilities: LoadContextCapabilities,\n): void {\n Object.defineProperty(context, LoadContextCapabilitiesSymbol, {\n configurable: true,\n enumerable: false,\n value: capabilities,\n });\n}\n\n/** Load context capabilities. */\nexport function loadContextCapabilities(\n context: DataResourceLoadContext,\n): LoadContextCapabilities | undefined {\n return (context as DataResourceLoadContextWithCapabilities)[\n LoadContextCapabilitiesSymbol\n ];\n}\n\nconst objectDataErrors = new WeakMap<object, DataResourceKey[]>();\n\nlet currentDataStore: FigDataStore | null = null;\n\n/** Captures an optional data store for synchronous scope re-entry. */\nexport function getCurrentDataStore(): FigDataStore | null {\n return currentDataStore;\n}\n\n/** Resolves current data store. */\nexport function resolveCurrentDataStore(\n message = \"Data resource APIs require a Fig data store.\",\n): FigDataStore {\n if (currentDataStore === null) throw new Error(message);\n return currentDataStore;\n}\n\n/** Sets current data store. */\nexport function setCurrentDataStore(\n store: FigDataStore | null,\n): FigDataStore | null {\n const previousStore = currentDataStore;\n currentDataStore = store;\n return previousStore;\n}\n\n/** Marks data resource error. */\nexport function markDataResourceError(\n error: unknown,\n key: DataResourceKey,\n): void {\n // Only object errors are attributed: the WeakMap keys them by identity, so the\n // registry is GC-safe and cannot cross-attribute. Primitive rejection values\n // would collide by value and accumulate forever in a plain Map, so a thrown\n // primitive simply carries no resource-key metadata.\n if (!isAttributableError(error)) return;\n\n let keys = objectDataErrors.get(error);\n if (keys === undefined) {\n keys = [];\n objectDataErrors.set(error, keys);\n }\n\n if (keys.some((existing) => sameDataResourceKey(existing, key))) return;\n\n keys.push(key);\n}\n\n/** Data resource keys for error. */\nexport function dataResourceKeysForError(\n error: unknown,\n): DataResourceKey[] | undefined {\n if (!isAttributableError(error)) return undefined;\n\n const keys = objectDataErrors.get(error);\n return keys === undefined || keys.length === 0 ? undefined : [...keys];\n}\n\nfunction sameDataResourceKey(a: DataResourceKey, b: DataResourceKey): boolean {\n return (\n a.length === b.length &&\n a.every((value, index) => Object.is(value, b[index]))\n );\n}\n\n// The single rule for which errors can carry attribution: identity-keyed\n// (WeakMap/WeakSet) registries require object errors. Shared with the store's\n// per-generation value-error sets so the two can never disagree.\nexport function isAttributableError(value: unknown): value is object {\n return (\n (typeof value === \"object\" || typeof value === \"function\") && value !== null\n );\n}\n","import type { FigContext } from \"./context.ts\";\nimport type { DataResource, FigDataStore } from \"./data.ts\";\nimport { resolveCurrentDataStore } from \"./data.ts\";\nimport type { TransitionCallback, TransitionOptions } from \"./transition.ts\";\n\n// The useState updater: accepts the next state, or an updater function of\n// the previous state for stale-closure safety.\n/** Describes state setter. */\nexport type StateSetter<S> = (next: S | ((previous: S) => S)) => void;\n/** Describes external store subscribe. */\nexport type ExternalStoreSubscribe = (callback: () => void) => () => void;\n// Fig appends the AbortSignal after the runner's args (the data-loader\n// shape). The signal aborts when a newer run supersedes this one, when the\n// owning component unmounts, when an enclosing Activity hides, or on settlement.\n/** Describes action state action. */\nexport type ActionStateAction<S, Args extends unknown[]> = (\n previousState: S,\n ...argsAndSignal: [...Args, AbortSignal]\n) => S | PromiseLike<S>;\n/** Describes action state runner. */\nexport type ActionStateRunner<Args extends unknown[]> = (...args: Args) => void;\n\n/**\n * Runs state updates scheduled by `callback` at transition priority. If\n * `callback` returns a thenable, `useTransition` keeps `isPending` true until\n * it settles and its scheduled updates commit. Use the supplied update callback\n * to explicitly re-enter the transition after an await.\n *\n * The callback receives an `AbortSignal` that aborts when a newer transition\n * starts from the same hook, when the owning component unmounts, and when an\n * enclosing Activity hides. It also aborts when the callback settles, closing\n * its explicit update handle. Each `useTransition` hook is one cancellation\n * domain — use separate hooks for independently cancellable workflows. An\n * cancelled run is retired: its pending slot is released immediately and its\n * settlement (including an aborted fetch's rejection) is inert.\n */\nexport type StartTransition = (\n callback: TransitionCallback,\n options?: TransitionOptions,\n) => void;\ntype Callback = (...args: never[]) => unknown;\n\n/** Describes render dispatcher. */\nexport interface RenderDispatcher {\n useState<S>(initialState: S | (() => S)): [S, StateSetter<S>];\n useActionState<S, Args extends unknown[]>(\n action: ActionStateAction<S, Args>,\n initialState: S,\n ): [S, ActionStateRunner<Args>, boolean];\n useId(): string;\n useDeferredValue<T>(\n value: T,\n initialValue: T | undefined,\n hasInitialValue: boolean,\n ): T;\n useMemo<T>(calculate: () => T, deps: DependencyList): T;\n useTransition(): [boolean, StartTransition];\n useReactive(effect: EffectCallback, deps?: DependencyList): void;\n useBeforePaint(effect: EffectCallback, deps?: DependencyList): void;\n useBeforeLayout(effect: EffectCallback, deps?: DependencyList): void;\n useSyncExternalStore<T>(\n subscribe: ExternalStoreSubscribe,\n getSnapshot: () => T,\n getServerSnapshot?: () => T,\n ): T;\n useStableEvent<Args extends unknown[], Result>(\n handler: (...args: Args) => Result,\n ): (...args: StableEventCallerArgs<Args>) => Result;\n readContext<T>(context: FigContext<T>): T;\n readData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n args: TArgs,\n ): TValue;\n preloadData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n args: TArgs,\n ): void;\n readPromise<T>(promise: PromiseLike<T>): T;\n}\n\n/** Describes effect callback. */\nexport type EffectCallback = (signal: AbortSignal) => undefined;\n/** Describes dependency list. */\nexport type DependencyList = readonly unknown[];\n\n/** Describes stable event caller args. */\nexport type StableEventCallerArgs<Args extends unknown[]> = Args extends [\n ...infer CallerArgs,\n AbortSignal,\n]\n ? CallerArgs\n : Args;\n\n// Fig appends the AbortSignal when invoking the handler; callers never pass\n// it, so a declared trailing signal is stripped from the callable signature.\nlet currentDispatcher: RenderDispatcher | null = null;\n\n/** Returns state. */\nexport function useState<S>(initialState: S | (() => S)): [S, StateSetter<S>] {\n return resolveDispatcher().useState(initialState);\n}\n\n/**\n * Tracks state returned by a client-side action. The action receives the\n * previous committed state first, then the runner's arguments, then an\n * `AbortSignal` Fig appends (declare the trailing signal parameter — it also\n * drives `Args` inference). Fig schedules the returned value in the action’s\n * transition lane and keeps `isPending` true until settlement and commit.\n * Arbitrary post-await setters have ordinary priority.\n *\n * Runs are last-run-wins: starting a new run aborts the previous one's\n * signal and retires it — a retired run's settlement (value or rejection)\n * never touches state or pending. The signal also aborts on unmount and\n * when an enclosing Activity hides or the action settles.\n */\nexport function useActionState<S, Args extends unknown[]>(\n action: ActionStateAction<S, Args>,\n initialState: S,\n): [S, ActionStateRunner<Args>, boolean] {\n return resolveDispatcher().useActionState(action, initialState);\n}\n\n/** Returns ID. */\nexport function useId(): string {\n return resolveDispatcher().useId();\n}\n\n/** Returns deferred value. */\nexport function useDeferredValue<T>(value: T, initialValue?: T): T {\n return resolveDispatcher().useDeferredValue(\n value,\n initialValue,\n arguments.length > 1,\n );\n}\n\n/** Returns memo. */\nexport function useMemo<T>(calculate: () => T, deps: DependencyList): T {\n return resolveDispatcher().useMemo(calculate, deps);\n}\n\n/** Returns transition. */\nexport function useTransition(): [boolean, StartTransition] {\n return resolveDispatcher().useTransition();\n}\n\n/** Returns callback. */\nexport function useCallback<T extends Callback>(\n callback: T,\n deps: DependencyList,\n): T {\n return resolveDispatcher().useMemo(() => callback, deps);\n}\n\n/** Returns reactive. */\nexport function useReactive(\n effect: EffectCallback,\n deps?: DependencyList,\n): void {\n resolveDispatcher().useReactive(effect, deps);\n}\n\n/** Returns before paint. */\nexport function useBeforePaint(\n effect: EffectCallback,\n deps?: DependencyList,\n): void {\n resolveDispatcher().useBeforePaint(effect, deps);\n}\n\n/** Returns before layout. */\nexport function useBeforeLayout(\n effect: EffectCallback,\n deps?: DependencyList,\n): void {\n resolveDispatcher().useBeforeLayout(effect, deps);\n}\n\n/** Returns sync external store. */\nexport function useSyncExternalStore<T>(\n subscribe: ExternalStoreSubscribe,\n getSnapshot: () => T,\n getServerSnapshot?: () => T,\n): T {\n return resolveDispatcher().useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot,\n );\n}\n\n/** Returns stable event. */\nexport function useStableEvent<Args extends unknown[], Result>(\n handler: (...args: Args) => Result,\n): (...args: StableEventCallerArgs<Args>) => Result {\n return resolveDispatcher().useStableEvent(handler);\n}\n\n/** Reads context. */\nexport function readContext<T>(context: FigContext<T>): T {\n return resolveDispatcher(\n \"readContext can only be called while rendering a component.\",\n ).readContext(context);\n}\n\n/** Reads promise. */\nexport function readPromise<T>(promise: PromiseLike<T>): T {\n return resolveDispatcher(\n \"readPromise can only be called while rendering a component.\",\n ).readPromise(promise);\n}\n\n/** Reads data. */\nexport function readData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n ...args: TArgs\n): TValue {\n return resolveDispatcher(\n \"readData can only be called while rendering a component.\",\n ).readData(resource, args);\n}\n\n/** Preloads data. */\nexport function preloadData<TArgs extends unknown[], TValue>(\n resource: DataResource<TArgs, TValue>,\n ...args: TArgs\n): void {\n if (currentDispatcher !== null) {\n currentDispatcher.preloadData(resource, args);\n return;\n }\n\n resolveDataStore().preloadData(resource, ...args);\n}\n\n/** Sets current dispatcher. */\nexport function setCurrentDispatcher(\n dispatcher: RenderDispatcher | null,\n): RenderDispatcher | null {\n const previousDispatcher = currentDispatcher;\n currentDispatcher = dispatcher;\n return previousDispatcher;\n}\n\nfunction resolveDispatcher(\n message = \"Hooks can only be called while rendering a component.\",\n): RenderDispatcher {\n if (currentDispatcher === null) {\n throw new Error(message);\n }\n\n return currentDispatcher;\n}\n\nfunction resolveDataStore(): FigDataStore {\n return resolveCurrentDataStore(\n \"No ambient Fig data store. Data APIs work synchronously during render, \" +\n \"event handlers, actions, and effects — not after an await. Capture \" +\n \"readDataStore() (or root.data) synchronously and call the handle \" +\n \"instead.\",\n );\n}\n","import type { Props } from \"./element.ts\";\nimport { type RenderDispatcher, setCurrentDispatcher } from \"./hooks.ts\";\n\ndeclare const __FIG_DEV__: boolean | undefined;\n\nconst __DEV__ = typeof __FIG_DEV__ === \"boolean\" ? __FIG_DEV__ : false;\n\n/** Describes mixin context. */\nexport interface MixinContext {\n /** The intrinsic host name receiving this mixin. */\n readonly type: string;\n /** Props composed by the host and every preceding mixin. */\n readonly props: Readonly<Props>;\n /** Whether this mixin is the last writer of a composed prop. Read at commit. */\n readonly owns: (prop: string) => boolean;\n}\n\n/** Describes empty mixin value. */\nexport type EmptyMixinValue = false | 0 | 0n | \"\" | null | undefined;\n\n/** Describes mixin input. */\nexport type MixinInput =\n | MixinDescriptor\n | EmptyMixinValue\n | ReadonlyArray<MixinInput>;\n\n/** Describes mixin result. */\nexport type MixinResult = Props | MixinInput;\n\n/** Describes mixin type. */\nexport type MixinType<TArgs extends unknown[] = unknown[]> = (\n context: MixinContext,\n ...args: TArgs\n) => MixinResult;\n\ntype MixinRuntimeType = (\n context: MixinContext,\n ...args: unknown[]\n) => MixinResult;\n\n/** Describes mixin descriptor. */\nexport interface MixinDescriptor {\n readonly $$typeof: symbol;\n readonly args: readonly unknown[];\n readonly type: MixinRuntimeType;\n}\n\n/** Describes mixin factory. */\nexport type MixinFactory<TArgs extends unknown[]> = (\n ...args: TArgs\n) => MixinDescriptor;\n\n// Registered symbols: descriptors and contexts must stay recognizable when\n// duplicate copies of this module are live (linked source next to a\n// prebundled copy).\n/** The Fig mixin symbol. */\nexport const FigMixinSymbol = Symbol.for(\"fig.mixin\");\nconst FigMixinSlotSymbol = Symbol.for(\"fig.mixin-slot\");\nconst FigClientOnlyHostBehaviorSymbol = Symbol.for(\n \"fig.client-only-host-behavior\",\n);\ntype ClientOnlyHostProps = object & {\n [FigClientOnlyHostBehaviorSymbol]?: string;\n};\n\n/** Creates a render-time host behavior for the `mix` prop. */\nexport function createMixin<TArgs extends unknown[]>(\n type: MixinType<TArgs>,\n): MixinFactory<TArgs> {\n const runtimeType = type as MixinRuntimeType;\n const descriptorType = __DEV__ ? guardMixinType(runtimeType) : runtimeType;\n return (...args) => ({\n $$typeof: FigMixinSymbol,\n args,\n type: descriptorType,\n });\n}\n\nconst maximumResolvedMixins = 1024;\n\n/** Resolves host mix. */\nexport function resolveHostMix<P extends Props>(type: string, input: P): P {\n const props: Props = input;\n const mix = props.mix;\n delete props.mix;\n let resolvedMixins = 0;\n let owners: Map<string, string> | undefined;\n\n function resolve(value: unknown, slot: string): void {\n if (emptyMixinValue(value)) return;\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index += 1) {\n resolve(value[index], `${slot}.${index}`);\n }\n return;\n }\n if (!isMixinDescriptor(value)) {\n throw new Error(\n `The mix prop on <${type}> must contain descriptors created by createMixin().`,\n );\n }\n\n resolvedMixins += 1;\n if (resolvedMixins > maximumResolvedMixins) {\n throw new Error(\n `The mix prop on <${type}> resolved more than ${maximumResolvedMixins} mixins.`,\n );\n }\n\n const context: MixinRuntimeContext = {\n [FigMixinSlotSymbol]: slot,\n props,\n type,\n owns: (prop) => owners?.get(prop) === slot,\n };\n const result = value.type(context, ...value.args);\n if (emptyMixinValue(result)) return;\n\n if (isMixinDescriptor(result) || Array.isArray(result)) {\n resolve(result, `${slot}.result`);\n return;\n }\n if (typeof result !== \"object\") {\n throw new Error(\n `A mixin on <${type}> must return host props, more mixins, or nothing.`,\n );\n }\n const returnedProps = result as Props;\n\n if (\n \"children\" in returnedProps ||\n \"key\" in returnedProps ||\n \"unsafeHTML\" in returnedProps\n ) {\n throw new Error(\n `A mixin on <${type}> cannot return children, key, or unsafeHTML.`,\n );\n }\n\n const { mix: nestedMix, ...patch } = returnedProps;\n Object.assign(props, patch);\n owners ??= new Map();\n for (const name of Object.keys(patch)) owners.set(name, slot);\n resolve(nestedMix, `${slot}.mix`);\n }\n\n resolve(mix, \"0\");\n props.mix = mix;\n return props as P;\n}\n\ninterface MixinRuntimeContext extends MixinContext {\n readonly [FigMixinSlotSymbol]: string;\n}\n\n/** Mixin slot. */\nexport function mixinSlot(context: MixinContext): string {\n return (context as MixinRuntimeContext)[FigMixinSlotSymbol];\n}\n\n/** Marks client only host behavior. */\nexport function markClientOnlyHostBehavior(\n context: MixinContext,\n behavior: string,\n): void {\n markClientOnlyHostProps(context.props, behavior);\n}\n\n/** Marks client only host props. */\nexport function markClientOnlyHostProps(value: object, behavior: string): void {\n const props = value as ClientOnlyHostProps;\n if (props[FigClientOnlyHostBehaviorSymbol] !== undefined) return;\n Object.defineProperty(props, FigClientOnlyHostBehaviorSymbol, {\n configurable: true,\n value: behavior,\n });\n}\n\n/** Client only host behavior. */\nexport function clientOnlyHostBehavior(props: object): string | undefined {\n const behavior = (props as ClientOnlyHostProps)[\n FigClientOnlyHostBehaviorSymbol\n ];\n return typeof behavior === \"string\" ? behavior : undefined;\n}\n\nfunction emptyMixinValue(value: unknown): value is EmptyMixinValue {\n return (\n value === false ||\n value === 0 ||\n value === 0n ||\n value === \"\" ||\n value === null ||\n value === undefined\n );\n}\n\nfunction isMixinDescriptor(value: unknown): value is MixinDescriptor {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n value.$$typeof === FigMixinSymbol\n );\n}\n\n// Dev-only: the wrapper lives in the createMixin module copy, so it guards the\n// dispatcher used by hooks imported alongside that factory even when another\n// linked or prebundled copy resolves the descriptor.\nfunction guardMixinType(type: MixinRuntimeType): MixinRuntimeType {\n return (context, ...args) => {\n const previousDispatcher = setCurrentDispatcher(\n mixinDispatcher(context.type, mixinSlot(context)),\n );\n try {\n return type(context, ...args);\n } finally {\n setCurrentDispatcher(previousDispatcher);\n }\n };\n}\n\nfunction mixinDispatcher(type: string, slot: string): RenderDispatcher {\n return new Proxy({} as RenderDispatcher, {\n get(_target, property) {\n throw new Error(\n `A mixin on <${type}> (slot ${slot}) called ${String(property)}. ` +\n \"Mixins are pure render-time code: hooks and read verbs belong to \" +\n \"the component; host lifetimes belong in returned on() or bind \" +\n \"behavior.\",\n );\n },\n });\n}\n","import type { DataResourceKey } from \"./data.ts\";\nimport { readPromise } from \"./hooks.ts\";\nimport type { ClientReferenceAssets } from \"./resource.ts\";\nimport { resolveHostMix } from \"./mixin.ts\";\n\n/** Describes key. */\nexport type Key = string | number;\n/** Describes props. */\nexport type Props = Record<string, any>;\n/** Describes component type. */\nexport type ComponentType<P = Props> = (\n props: P & { children?: FigNode },\n) => FigNode;\n/** Describes component props. */\nexport type ComponentProps<T extends ComponentType<any>> =\n Parameters<T> extends [infer P, ...unknown[]]\n ? P extends Props\n ? P\n : Props\n : {};\n/** Describes element type. */\nexport type ElementType<P = Props> =\n | string\n | typeof Fragment\n | FigAssets\n | FigClientReference<P>\n | FigErrorBoundary\n | FigSuspense\n | FigActivity\n | FigViewTransition\n | ComponentType<P>;\n/** Describes awaited Fig node. */\nexport type AwaitedFigNode =\n | FigElement<any>\n | FigPortal<any>\n | string\n | number\n | boolean\n | null\n | undefined\n | FigNode[];\n/** Describes Fig node. */\nexport type FigNode = AwaitedFigNode | PromiseLike<AwaitedFigNode>;\n\n/** Describes Fig element. */\nexport interface FigElement<P = Props> {\n readonly $$typeof: symbol;\n readonly type: ElementType<any>;\n readonly key: Key | null;\n readonly props: P & { children?: FigNode };\n}\n\n/** Describes Fig portal. */\nexport interface FigPortal<Target = unknown> {\n readonly $$typeof: symbol;\n readonly children: FigNode;\n readonly key: Key | null;\n readonly target: Target;\n}\n\n/** Describes client reference options. */\nexport interface ClientReferenceOptions<P extends Props = Props> {\n assets?: ClientReferenceAssets;\n id: string;\n ssr?: ComponentType<P>;\n}\n\n/** Describes Fig client reference. */\nexport interface FigClientReference<P = Props> {\n (props: P & { children?: FigNode }): FigNode;\n readonly $$typeof: symbol;\n readonly assets?: ClientReferenceAssets;\n readonly id: string;\n readonly ssr?: ComponentType<P>;\n}\n\n/** Describes lazy loader. */\nexport type LazyLoader<T extends ComponentType<any> = ComponentType<any>> =\n () => PromiseLike<T>;\n\n/** Describes suspense props. */\nexport interface SuspenseProps {\n fallback?: FigNode;\n children?: FigNode;\n}\n\n/** Describes Fig suspense. */\nexport interface FigSuspense {\n (props: SuspenseProps): FigNode;\n readonly $$typeof: symbol;\n}\n\n/** Describes activity mode. */\nexport type ActivityMode = \"visible\" | \"hidden\";\n\n/** Describes activity props. */\nexport interface ActivityProps {\n mode: ActivityMode;\n children?: FigNode;\n}\n\n/** Describes Fig activity. */\nexport interface FigActivity {\n (props: ActivityProps): FigNode;\n readonly $$typeof: symbol;\n}\n\n/** Describes view transition class. */\nexport type ViewTransitionClass = \"auto\" | \"none\" | (string & {});\n\n/** Describes view transition phase. */\nexport type ViewTransitionPhase = \"enter\" | \"exit\" | \"share\" | \"update\";\n\n// Renderer-neutral identity for one named host surface in the native\n// transition. Renderer packages can resolve it into their own imperative\n// handles without putting host types in core.\n/** Describes view transition surface. */\nexport interface ViewTransitionSurface {\n readonly name: string;\n}\n\n/** Describes view transition event. */\nexport interface ViewTransitionEvent {\n readonly phase: ViewTransitionPhase;\n readonly surfaces: readonly ViewTransitionSurface[];\n readonly types: readonly string[];\n}\n\n/** Describes view transition callback. */\nexport type ViewTransitionCallback = (\n event: ViewTransitionEvent,\n signal: AbortSignal,\n) => undefined;\n\n/** Describes view transition props. */\nexport interface ViewTransitionProps {\n name?: string;\n children?: FigNode;\n default?: ViewTransitionClass;\n enter?: ViewTransitionClass;\n exit?: ViewTransitionClass;\n share?: ViewTransitionClass;\n update?: ViewTransitionClass;\n onTransition?: ViewTransitionCallback;\n}\n\n/** Describes Fig view transition. */\nexport interface FigViewTransition {\n (props: ViewTransitionProps): FigNode;\n readonly $$typeof: symbol;\n}\n\n/** Describes error boundary props. */\nexport interface ErrorBoundaryProps {\n // A function fallback receives the caught error so error UIs can render\n // it (message, retry affordance) without smuggling state above the\n // boundary through onError. Callable thenables are nodes, so the runtime\n // distinguishes them from render fallbacks before invoking the function.\n fallback?: FigNode | ((error: unknown, info: ErrorInfo) => FigNode);\n onError?: (error: unknown, info: ErrorInfo) => void;\n children?: FigNode;\n}\n\n/** Describes error info. */\nexport interface ErrorInfo {\n componentStack: string;\n dataResourceKeys?: DataResourceKey[];\n}\n\n/** Describes Fig error boundary. */\nexport interface FigErrorBoundary {\n (props: ErrorBoundaryProps): FigNode;\n readonly $$typeof: symbol;\n}\n\n/** Describes Fig assets. */\nexport interface FigAssets {\n (props: Props & { children?: FigNode }): FigNode;\n readonly $$typeof: symbol;\n}\n\n/** The fragment. */\nexport const Fragment = Symbol.for(\"fig.fragment\");\n/** The Fig element symbol. */\nexport const FigElementSymbol = Symbol.for(\"fig.element\");\n/** The Fig client reference symbol. */\nexport const FigClientReferenceSymbol = Symbol.for(\"fig.client-reference\");\n/** The Fig activity symbol. */\nexport const FigActivitySymbol = Symbol.for(\"fig.activity\");\n/** The Fig error boundary symbol. */\nexport const FigErrorBoundarySymbol = Symbol.for(\"fig.error-boundary\");\n/** The Fig portal symbol. */\nexport const FigPortalSymbol = Symbol.for(\"fig.portal\");\n/** The Fig assets symbol. */\nexport const FigAssetsSymbol = Symbol.for(\"fig.assets\");\n/** The Fig suspense symbol. */\nexport const FigSuspenseSymbol = Symbol.for(\"fig.suspense\");\n/** The Fig view transition symbol. */\nexport const FigViewTransitionSymbol = Symbol.for(\"fig.view-transition\");\n\n/** The assets. */\nexport const Assets: FigAssets = Object.assign(\n (props: Props & { children?: FigNode }) => props.children,\n { $$typeof: FigAssetsSymbol },\n);\n\n/** The error boundary. */\nexport const ErrorBoundary: FigErrorBoundary = Object.assign(\n (props: ErrorBoundaryProps) => props.children,\n { $$typeof: FigErrorBoundarySymbol },\n);\n\n/** The suspense. */\nexport const Suspense: FigSuspense = Object.assign(\n (props: SuspenseProps) => props.children,\n { $$typeof: FigSuspenseSymbol },\n);\n\n/** The activity. */\nexport const Activity: FigActivity = Object.assign(\n (props: ActivityProps) => props.children,\n { $$typeof: FigActivitySymbol },\n);\n\n/** The view transition. */\nexport const ViewTransition: FigViewTransition = Object.assign(\n (props: ViewTransitionProps) => props.children,\n { $$typeof: FigViewTransitionSymbol },\n);\n\n/** Creates element. */\nexport function createElement<P extends Props>(\n type: ElementType<P>,\n config?: (P & { key?: Key | null }) | null,\n ...children: FigNode[]\n): FigElement<P> {\n const props = { ...config } as P & {\n children?: FigNode;\n key?: Key | null;\n };\n const key = props.key ?? null;\n delete props.key;\n\n if (children.length === 1) props.children = children[0];\n else if (children.length > 1) props.children = children;\n\n return {\n $$typeof: FigElementSymbol,\n type,\n key,\n props:\n \"mix\" in props && typeof type === \"string\"\n ? resolveHostMix(type, props)\n : props,\n };\n}\n\n/** Checks whether valid element. */\nexport function isValidElement(value: unknown): value is FigElement {\n return hasObjectBrand(value, FigElementSymbol);\n}\n\n/** Creates portal node. */\nexport function createPortalNode<Target>(\n children: FigNode,\n target: Target,\n key: Key | null = null,\n): FigPortal<Target> {\n return { $$typeof: FigPortalSymbol, children, key, target };\n}\n\n/** Checks whether portal. */\nexport function isPortal(value: unknown): value is FigPortal {\n return hasObjectBrand(value, FigPortalSymbol);\n}\n\n/** Client reference. */\nexport function clientReference<P extends Props = Props>(\n options: ClientReferenceOptions<P>,\n): FigClientReference<P> {\n return Object.assign(\n (): never => {\n throw new Error(\n `Client reference \"${options.id}\" cannot be rendered on the server directly.`,\n );\n },\n {\n $$typeof: FigClientReferenceSymbol,\n assets: options.assets,\n id: options.id,\n ssr: options.ssr,\n },\n );\n}\n\n/** Lazy. */\nexport function lazy<T extends ComponentType<any>>(\n load: LazyLoader<T>,\n): ComponentType<ComponentProps<T>> {\n let promise: PromiseLike<T> | null = null;\n let rejected = false;\n\n const Lazy: ComponentType<ComponentProps<T>> = (props) => {\n if (promise === null) {\n rejected = false;\n const next = Promise.resolve(load()).then(\n (value) => value,\n (error) => {\n if (promise === next) rejected = true;\n throw error;\n },\n );\n promise = next;\n }\n\n try {\n return createElement(readPromise(promise), props);\n } catch (error) {\n if (rejected) {\n promise = null;\n rejected = false;\n }\n throw error;\n }\n };\n\n return Lazy;\n}\n\n/** Checks whether client reference. */\nexport function isClientReference(value: unknown): value is FigClientReference {\n return hasFunctionBrand(value, FigClientReferenceSymbol);\n}\n\n/** Checks whether suspense. */\nexport function isSuspense(value: unknown): value is FigSuspense {\n return hasFunctionBrand(value, FigSuspenseSymbol);\n}\n\n/** Checks whether activity. */\nexport function isActivity(value: unknown): value is FigActivity {\n return hasFunctionBrand(value, FigActivitySymbol);\n}\n\n/** Checks whether error boundary. */\nexport function isErrorBoundary(value: unknown): value is FigErrorBoundary {\n return hasFunctionBrand(value, FigErrorBoundarySymbol);\n}\n\n/** Checks whether view transition. */\nexport function isViewTransition(value: unknown): value is FigViewTransition {\n return hasFunctionBrand(value, FigViewTransitionSymbol);\n}\n\n/** Checks whether assets. */\nexport function isAssets(value: unknown): value is FigAssets {\n return hasFunctionBrand(value, FigAssetsSymbol);\n}\n\nfunction hasObjectBrand(value: unknown, brand: symbol): boolean {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n value.$$typeof === brand\n );\n}\n\nfunction hasFunctionBrand(value: unknown, brand: symbol): boolean {\n return (\n typeof value === \"function\" &&\n \"$$typeof\" in value &&\n value.$$typeof === brand\n );\n}\n"],"mappings":";AA6LA,MAAM,gCAAgC,OAAO,IAAI,uBAAuB;;AAMxE,SAAgB,8BACd,SACA,cACM;CACN,OAAO,eAAe,SAAS,+BAA+B;EAC5D,cAAc;EACd,YAAY;EACZ,OAAO;CACT,CAAC;AACH;;AAGA,SAAgB,wBACd,SACqC;CACrC,OAAQ,QACN;AAEJ;AAEA,MAAM,mCAAmB,IAAI,QAAmC;AAEhE,IAAI,mBAAwC;;AAG5C,SAAgB,sBAA2C;CACzD,OAAO;AACT;;AAGA,SAAgB,wBACd,UAAU,gDACI;CACd,IAAI,qBAAqB,MAAM,MAAM,IAAI,MAAM,OAAO;CACtD,OAAO;AACT;;AAGA,SAAgB,oBACd,OACqB;CACrB,MAAM,gBAAgB;CACtB,mBAAmB;CACnB,OAAO;AACT;;AAGA,SAAgB,sBACd,OACA,KACM;CAKN,IAAI,CAAC,oBAAoB,KAAK,GAAG;CAEjC,IAAI,OAAO,iBAAiB,IAAI,KAAK;CACrC,IAAI,SAAS,KAAA,GAAW;EACtB,OAAO,CAAC;EACR,iBAAiB,IAAI,OAAO,IAAI;CAClC;CAEA,IAAI,KAAK,MAAM,aAAa,oBAAoB,UAAU,GAAG,CAAC,GAAG;CAEjE,KAAK,KAAK,GAAG;AACf;;AAGA,SAAgB,yBACd,OAC+B;CAC/B,IAAI,CAAC,oBAAoB,KAAK,GAAG,OAAO,KAAA;CAExC,MAAM,OAAO,iBAAiB,IAAI,KAAK;CACvC,OAAO,SAAS,KAAA,KAAa,KAAK,WAAW,IAAI,KAAA,IAAY,CAAC,GAAG,IAAI;AACvE;AAEA,SAAS,oBAAoB,GAAoB,GAA6B;CAC5E,OACE,EAAE,WAAW,EAAE,UACf,EAAE,OAAO,OAAO,UAAU,OAAO,GAAG,OAAO,EAAE,MAAM,CAAC;AAExD;AAKA,SAAgB,oBAAoB,OAAi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BAAuB;AACxD;;AAGA,SAAgB,SAAS,OAAoC;CAC3D,OAAO,iBAAiB,OAAO,eAAe;AAChD;AAEA,SAAS,eAAe,OAAgB,OAAwB;CAC9D,OACE,OAAO,UAAU,YACjB,UAAU,QACV,cAAc,SACd,MAAM,aAAa;AAEvB;AAEA,SAAS,iBAAiB,OAAgB,OAAwB;CAChE,OACE,OAAO,UAAU,cACjB,cAAc,SACd,MAAM,aAAa;AAEvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bt as DataResourceKeyInput, C as FigNode, Gt as FigDataHydrationEntry, Ht as DataResourceLoader,
|
|
1
|
+
import { Bt as DataResourceKeyInput, C as FigNode, Gt as FigDataHydrationEntry, Ht as DataResourceLoader, Jt as FigDataStoreController, Lt as DataRefreshResult, N as Props, Qt as FigDataStoreOptions, Rt as DataResource, Ut as DataStoreEntrySnapshot, Xt as FigDataStoreHandle, Zt as FigDataStoreHost, qt as FigDataStore, zt as DataResourceKey } from "./element-B4LrR2ZB.js";
|
|
2
2
|
//#region src/context.d.ts
|
|
3
3
|
/** Describes Fig context. */
|
|
4
4
|
interface FigContext<T> {
|
|
@@ -75,6 +75,8 @@ interface MixinContext {
|
|
|
75
75
|
readonly type: string;
|
|
76
76
|
/** Props composed by the host and every preceding mixin. */
|
|
77
77
|
readonly props: Readonly<Props>;
|
|
78
|
+
/** Whether this mixin is the last writer of a composed prop. Read at commit. */
|
|
79
|
+
readonly owns: (prop: string) => boolean;
|
|
78
80
|
}
|
|
79
81
|
/** Describes empty mixin value. */
|
|
80
82
|
type EmptyMixinValue = false | 0 | 0n | "" | null | undefined;
|
|
@@ -119,14 +121,22 @@ interface TransitionOptions {
|
|
|
119
121
|
*/
|
|
120
122
|
viewTransition?: "interrupt";
|
|
121
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Runs synchronous work owned by a live transition. Promise and thenable results
|
|
126
|
+
* are rejected; other return values are ignored. Calls after retirement are inert.
|
|
127
|
+
*/
|
|
128
|
+
type TransitionUpdate = <Result>(callback: (() => Result) & (Extract<Result, PromiseLike<unknown>> extends never ? unknown : never)) => void;
|
|
129
|
+
/** The signal and explicit update scope belong to this callback invocation. */
|
|
130
|
+
type TransitionCallback<T = void | PromiseLike<void>> = (signal: AbortSignal, update: TransitionUpdate) => T;
|
|
122
131
|
/** Describes transition handler. */
|
|
123
|
-
type TransitionHandler = <T>(callback:
|
|
132
|
+
type TransitionHandler = <T>(callback: TransitionCallback<T>, options?: TransitionOptions) => T;
|
|
124
133
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* transition priority scope until it settles.
|
|
134
|
+
* Synchronous updates inherit transition priority. After awaiting, use the
|
|
135
|
+
* callback's update function to schedule work in this same transition.
|
|
128
136
|
*/
|
|
129
|
-
declare function transition<T>(callback:
|
|
137
|
+
declare function transition<T>(callback: TransitionCallback<T>, options?: TransitionOptions): T;
|
|
138
|
+
/** Internal lifetime protocol shared by renderer and renderer-free scopes. */
|
|
139
|
+
declare function runTransitionScope<T>(callback: TransitionCallback<T>, enter: <Result>(run: () => Result) => Result, controller?: AbortController): T;
|
|
130
140
|
/** Sets transition handler. */
|
|
131
141
|
declare function setTransitionHandler(handler: TransitionHandler): TransitionHandler;
|
|
132
142
|
//#endregion
|
|
@@ -142,17 +152,18 @@ type ActionStateRunner<Args extends unknown[]> = (...args: Args) => void;
|
|
|
142
152
|
/**
|
|
143
153
|
* Runs state updates scheduled by `callback` at transition priority. If
|
|
144
154
|
* `callback` returns a thenable, `useTransition` keeps `isPending` true until
|
|
145
|
-
* it settles and
|
|
146
|
-
*
|
|
155
|
+
* it settles and its scheduled updates commit. Use the supplied update callback
|
|
156
|
+
* to explicitly re-enter the transition after an await.
|
|
147
157
|
*
|
|
148
158
|
* The callback receives an `AbortSignal` that aborts when a newer transition
|
|
149
159
|
* starts from the same hook, when the owning component unmounts, and when an
|
|
150
|
-
* enclosing Activity hides.
|
|
160
|
+
* enclosing Activity hides. It also aborts when the callback settles, closing
|
|
161
|
+
* its explicit update handle. Each `useTransition` hook is one cancellation
|
|
151
162
|
* domain — use separate hooks for independently cancellable workflows. An
|
|
152
|
-
*
|
|
163
|
+
* cancelled run is retired: its pending slot is released immediately and its
|
|
153
164
|
* settlement (including an aborted fetch's rejection) is inert.
|
|
154
165
|
*/
|
|
155
|
-
type StartTransition = (callback:
|
|
166
|
+
type StartTransition = (callback: TransitionCallback, options?: TransitionOptions) => void;
|
|
156
167
|
type Callback = (...args: never[]) => unknown;
|
|
157
168
|
/** Describes render dispatcher. */
|
|
158
169
|
interface RenderDispatcher {
|
|
@@ -184,13 +195,14 @@ declare function useState<S>(initialState: S | (() => S)): [S, StateSetter<S>];
|
|
|
184
195
|
* Tracks state returned by a client-side action. The action receives the
|
|
185
196
|
* previous committed state first, then the runner's arguments, then an
|
|
186
197
|
* `AbortSignal` Fig appends (declare the trailing signal parameter — it also
|
|
187
|
-
* drives `Args` inference).
|
|
188
|
-
* and
|
|
198
|
+
* drives `Args` inference). Fig schedules the returned value in the action’s
|
|
199
|
+
* transition lane and keeps `isPending` true until settlement and commit.
|
|
200
|
+
* Arbitrary post-await setters have ordinary priority.
|
|
189
201
|
*
|
|
190
202
|
* Runs are last-run-wins: starting a new run aborts the previous one's
|
|
191
203
|
* signal and retires it — a retired run's settlement (value or rejection)
|
|
192
204
|
* never touches state or pending. The signal also aborts on unmount and
|
|
193
|
-
* when an enclosing Activity hides.
|
|
205
|
+
* when an enclosing Activity hides or the action settles.
|
|
194
206
|
*/
|
|
195
207
|
declare function useActionState<S, Args extends unknown[]>(action: ActionStateAction<S, Args>, initialState: S): [S, ActionStateRunner<Args>, boolean];
|
|
196
208
|
/** Returns ID. */
|
|
@@ -224,4 +236,4 @@ declare function preloadData<TArgs extends unknown[], TValue>(resource: DataReso
|
|
|
224
236
|
/** Sets current dispatcher. */
|
|
225
237
|
declare function setCurrentDispatcher(dispatcher: RenderDispatcher | null): RenderDispatcher | null;
|
|
226
238
|
//#endregion
|
|
227
|
-
export {
|
|
239
|
+
export { createRendererDataStore as $, TransitionUpdate as A, MixinResult as B, useStableEvent as C, TransitionCallback as D, useTransition as E, FigMixinSymbol as F, markClientOnlyHostProps as G, clientOnlyHostBehavior as H, MixinContext as I, DataResourceOptions as J, mixinSlot as K, MixinDescriptor as L, setTransitionHandler as M, transition as N, TransitionHandler as O, EmptyMixinValue as P, createDataStore as Q, MixinFactory as R, useReactive as S, useSyncExternalStore as T, createMixin as U, MixinType as V, markClientOnlyHostBehavior as W, DataStoreHost as X, DataStore as Y, attachDataStore as Z, useBeforePaint as _, ExternalStoreSubscribe as a, invalidateDataKey as at, useId as b, StartTransition as c, normalizeDataResourceKey as ct, readContext as d, runWithDataStore as dt, currentDataStore as et, readData as f, FigContext as ft, useBeforeLayout as g, useActionState as h, isContext as ht, EffectCallback as i, invalidateDataError as it, runTransitionScope as j, TransitionOptions as k, StateSetter as l, readDataStore as lt, setCurrentDispatcher as m, createContext as mt, ActionStateRunner as n, ensureData as nt, RenderDispatcher as o, invalidateDataPrefix as ot, readPromise as p, FigContextSymbol as pt, resolveHostMix as q, DependencyList as r, invalidateData as rt, StableEventCallerArgs as s, isDataStoreController as st, ActionStateAction as t, dataResource as tt, preloadData as u, refreshData as ut, useCallback as v, useState as w, useMemo as x, useDeferredValue as y, MixinInput as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as Fragment, At as modulepreload, B as ViewTransitionPhase, Bt as DataResourceKeyInput, C as FigNode, Dt as font, F as SuspenseProps, Ft as stylesheet, Gt as FigDataHydrationEntry, H as ViewTransitionSurface, Ht as DataResourceLoader, I as ViewTransition, It as title, L as ViewTransitionCallback, Lt as DataRefreshResult, M as LazyLoader, Mt as preload, N as Props, O as FigViewTransition, P as Suspense, Pt as script, Q as isValidElement, R as ViewTransitionClass, Rt as DataResource, Tt as assets, U as clientReference, V as ViewTransitionProps, Vt as DataResourceLoadContext, W as createElement,
|
|
2
|
-
import {
|
|
3
|
-
export { type ActionStateAction, type ActionStateRunner, Activity, type ActivityMode, type ActivityProps, type AssetResourceBlocking, type AssetsProps, type AwaitedFigNode, type ClientReferenceAssets, type ClientReferenceOptions, type ComponentProps, type ComponentType, type CrossOrigin, type DataRefreshResult, type DataResource, type DataResourceKey, type DataResourceKeyInput, type DataResourceLoadContext, type DataResourceLoader, type DataResourceOptions, type DependencyList, type EffectCallback, type ElementType, type EmptyMixinValue, ErrorBoundary, type ErrorBoundaryProps, type ErrorInfo, type ExternalStoreSubscribe, type FetchPriority, type FigAssetResource, type FigAssetResourceList, type FigClientReference, type FigContext, type FigDataHydrationEntry, type FigDataStoreController, type FigDataStoreHandle, type FigDataStoreOptions, type FigElement, type FigNode, type FigPortal, type FigViewTransition, type FontResource, Fragment, type Key, type LazyLoader, type MetaResource, type MetaResourceOptions, type MixinContext, type MixinDescriptor, type MixinFactory, type MixinInput, type MixinResult, type MixinType, type ModulePreloadResource, type PreconnectResource, type PreloadResource, type Props, type ScriptResource, type StartTransition, type StateSetter, type StylesheetResource, Suspense, type SuspenseProps, type TitleResource, type TransitionOptions, ViewTransition, type ViewTransitionCallback, type ViewTransitionClass, type ViewTransitionEvent, type ViewTransitionPhase, type ViewTransitionProps, type ViewTransitionSurface, assets, clientReference, createContext, createDataStore, createElement, createMixin, dataResource, ensureData, font, invalidateData, invalidateDataError, invalidateDataKey, invalidateDataPrefix, isValidElement, lazy, meta, modulepreload, preconnect, preload, preloadData, readContext, readData, readDataStore, readPromise, refreshData, script, stylesheet, title, transition, useActionState, useBeforeLayout, useBeforePaint, useCallback, useDeferredValue, useId, useMemo, useReactive, useStableEvent, useState, useSyncExternalStore, useTransition };
|
|
1
|
+
import { A as Fragment, At as modulepreload, B as ViewTransitionPhase, Bt as DataResourceKeyInput, C as FigNode, Dt as font, F as SuspenseProps, Ft as stylesheet, Gt as FigDataHydrationEntry, H as ViewTransitionSurface, Ht as DataResourceLoader, I as ViewTransition, It as title, Jt as FigDataStoreController, L as ViewTransitionCallback, Lt as DataRefreshResult, M as LazyLoader, Mt as preload, N as Props, O as FigViewTransition, P as Suspense, Pt as script, Q as isValidElement, Qt as FigDataStoreOptions, R as ViewTransitionClass, Rt as DataResource, Tt as assets, U as clientReference, V as ViewTransitionProps, Vt as DataResourceLoadContext, W as createElement, Xt as FigDataStoreHandle, _ as FigClientReference, _t as StylesheetResource, a as AwaitedFigNode, at as ClientReferenceAssets, c as ComponentType, ct as FigAssetResource, d as ErrorBoundaryProps, dt as MetaResource, et as lazy, f as ErrorInfo, ft as MetaResourceOptions, gt as ScriptResource, ht as PreloadResource, it as AssetsProps, j as Key, jt as preconnect, kt as meta, l as ElementType, lt as FigAssetResourceList, mt as PreconnectResource, n as ActivityMode, o as ClientReferenceOptions, ot as CrossOrigin, pt as ModulePreloadResource, r as ActivityProps, s as ComponentProps, st as FetchPriority, t as Activity, tt as AssetResourceBlocking, u as ErrorBoundary, ut as FontResource, vt as TitleResource, w as FigPortal, y as FigElement, z as ViewTransitionEvent, zt as DataResourceKey } from "./element-B4LrR2ZB.js";
|
|
2
|
+
import { A as TransitionUpdate, B as MixinResult, C as useStableEvent, D as TransitionCallback, E as useTransition, I as MixinContext, J as DataResourceOptions, L as MixinDescriptor, N as transition, P as EmptyMixinValue, Q as createDataStore, R as MixinFactory, S as useReactive, T as useSyncExternalStore, U as createMixin, V as MixinType, _ as useBeforePaint, a as ExternalStoreSubscribe, at as invalidateDataKey, b as useId, c as StartTransition, d as readContext, f as readData, ft as FigContext, g as useBeforeLayout, h as useActionState, i as EffectCallback, it as invalidateDataError, k as TransitionOptions, l as StateSetter, lt as readDataStore, mt as createContext, n as ActionStateRunner, nt as ensureData, ot as invalidateDataPrefix, p as readPromise, r as DependencyList, rt as invalidateData, t as ActionStateAction, tt as dataResource, u as preloadData, ut as refreshData, v as useCallback, w as useState, x as useMemo, y as useDeferredValue, z as MixinInput } from "./hooks-QSWYd3Vl.js";
|
|
3
|
+
export { type ActionStateAction, type ActionStateRunner, Activity, type ActivityMode, type ActivityProps, type AssetResourceBlocking, type AssetsProps, type AwaitedFigNode, type ClientReferenceAssets, type ClientReferenceOptions, type ComponentProps, type ComponentType, type CrossOrigin, type DataRefreshResult, type DataResource, type DataResourceKey, type DataResourceKeyInput, type DataResourceLoadContext, type DataResourceLoader, type DataResourceOptions, type DependencyList, type EffectCallback, type ElementType, type EmptyMixinValue, ErrorBoundary, type ErrorBoundaryProps, type ErrorInfo, type ExternalStoreSubscribe, type FetchPriority, type FigAssetResource, type FigAssetResourceList, type FigClientReference, type FigContext, type FigDataHydrationEntry, type FigDataStoreController, type FigDataStoreHandle, type FigDataStoreOptions, type FigElement, type FigNode, type FigPortal, type FigViewTransition, type FontResource, Fragment, type Key, type LazyLoader, type MetaResource, type MetaResourceOptions, type MixinContext, type MixinDescriptor, type MixinFactory, type MixinInput, type MixinResult, type MixinType, type ModulePreloadResource, type PreconnectResource, type PreloadResource, type Props, type ScriptResource, type StartTransition, type StateSetter, type StylesheetResource, Suspense, type SuspenseProps, type TitleResource, type TransitionCallback, type TransitionOptions, type TransitionUpdate, ViewTransition, type ViewTransitionCallback, type ViewTransitionClass, type ViewTransitionEvent, type ViewTransitionPhase, type ViewTransitionProps, type ViewTransitionSurface, assets, clientReference, createContext, createDataStore, createElement, createMixin, dataResource, ensureData, font, invalidateData, invalidateDataError, invalidateDataKey, invalidateDataPrefix, isValidElement, lazy, meta, modulepreload, preconnect, preload, preloadData, readContext, readData, readDataStore, readPromise, refreshData, script, stylesheet, title, transition, useActionState, useBeforeLayout, useBeforePaint, useCallback, useDeferredValue, useId, useMemo, useReactive, useStableEvent, useState, useSyncExternalStore, useTransition };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as useBeforeLayout, E as lazy, F as readContext, G as useMemo, H as useCallback, I as readData, J as useState, K as useReactive, L as readPromise, P as preloadData, U as useDeferredValue, V as useBeforePaint, W as useId, X as useTransition, Y as useSyncExternalStore, f as Fragment, g as createElement, h as clientReference, k as createMixin, m as ViewTransition, p as Suspense, q as useStableEvent, r as ErrorBoundary, t as Activity, w as isValidElement, z as useActionState } from "./element-
|
|
3
|
-
import { _ as stylesheet, d as meta, f as modulepreload, g as script, l as font, m as preload, p as preconnect, s as assets, v as title } from "./resource-
|
|
1
|
+
import { _ as refreshData, a as createDataStore, b as createContext, c as dataResource, d as invalidateDataError, f as invalidateDataKey, g as readDataStore, l as ensureData, p as invalidateDataPrefix, r as transition, u as invalidateData } from "./transition-DJfG2ZSm.js";
|
|
2
|
+
import { B as useBeforeLayout, E as lazy, F as readContext, G as useMemo, H as useCallback, I as readData, J as useState, K as useReactive, L as readPromise, P as preloadData, U as useDeferredValue, V as useBeforePaint, W as useId, X as useTransition, Y as useSyncExternalStore, f as Fragment, g as createElement, h as clientReference, k as createMixin, m as ViewTransition, p as Suspense, q as useStableEvent, r as ErrorBoundary, t as Activity, w as isValidElement, z as useActionState } from "./element-j7AKp0nu.js";
|
|
3
|
+
import { _ as stylesheet, d as meta, f as modulepreload, g as script, l as font, m as preload, p as preconnect, s as assets, v as title } from "./resource-Lwjz_b4h.js";
|
|
4
4
|
export { Activity, ErrorBoundary, Fragment, Suspense, ViewTransition, assets, clientReference, createContext, createDataStore, createElement, createMixin, dataResource, ensureData, font, invalidateData, invalidateDataError, invalidateDataKey, invalidateDataPrefix, isValidElement, lazy, meta, modulepreload, preconnect, preload, preloadData, readContext, readData, readDataStore, readPromise, refreshData, script, stylesheet, title, transition, useActionState, useBeforeLayout, useBeforePaint, useCallback, useDeferredValue, useId, useMemo, useReactive, useStableEvent, useState, useSyncExternalStore, useTransition };
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as isViewTransition, $t as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as isViewTransition, $t as LoadContextAttributeError, B as ViewTransitionPhase, Bt as DataResourceKeyInput, C as FigNode, Ct as assetResourceHostProps, D as FigSuspenseSymbol, E as FigSuspense, Et as clientReferenceAssets, F as SuspenseProps, G as createPortalNode, Gt as FigDataHydrationEntry, H as ViewTransitionSurface, J as isClientReference, Jt as FigDataStoreController, K as isActivity, Kt as FigDataReads, L as ViewTransitionCallback, Lt as DataRefreshResult, M as LazyLoader, N as Props, Nt as preventAssetResourceHoist, O as FigViewTransition, Ot as isFigAssetResource, Qt as FigDataStoreOptions, R as ViewTransitionClass, Rt as DataResource, S as FigErrorBoundarySymbol, St as assetResourceFromHostValues, T as FigPortalSymbol, Ut as DataStoreEntrySnapshot, V as ViewTransitionProps, Vt as DataResourceLoadContext, Wt as FigDataEntryStatus, X as isPortal, Xt as FigDataStoreHandle, Y as isErrorBoundary, Yt as FigDataStoreFactory, Z as isSuspense, Zt as FigDataStoreHost, _ as FigClientReference, _t as StylesheetResource, a as AwaitedFigNode, an as markDataResourceError, at as ClientReferenceAssets, b as FigElementSymbol, bt as assetResourceFromHostAttributes, d as ErrorBoundaryProps, dt as MetaResource, en as LoadContextCapabilities, f as ErrorInfo, g as FigAssetsSymbol, gt as ScriptResource, h as FigAssets, ht as PreloadResource, i as Assets, in as loadContextCapabilities, j as Key, k as FigViewTransitionSymbol, l as ElementType, m as FigActivitySymbol, mt as PreconnectResource, nn as dataResourceKeysForError, nt as AssetResourceDestination, o as ClientReferenceOptions, on as resolveCurrentDataStore, p as FigActivity, pt as ModulePreloadResource, q as isAssets, qt as FigDataStore, r as ActivityProps, rn as defineLoadContextCapabilities, rt as AssetResourceHostProps, sn as setCurrentDataStore, tn as LoadContextHydrate, ut as FontResource, v as FigClientReferenceSymbol, vt as TitleResource, w as FigPortal, wt as assetResourceKey, x as FigErrorBoundary, xt as assetResourceFromHostProps, y as FigElement, yt as assetResourceDestination, z as ViewTransitionEvent, zt as DataResourceKey } from "./element-B4LrR2ZB.js";
|
|
2
|
+
import { $ as createRendererDataStore, A as TransitionUpdate, D as TransitionCallback, F as FigMixinSymbol, G as markClientOnlyHostProps, H as clientOnlyHostBehavior, K as mixinSlot, M as setTransitionHandler, O as TransitionHandler, Q as createDataStore, W as markClientOnlyHostBehavior, X as DataStoreHost, Y as DataStore, Z as attachDataStore, ct as normalizeDataResourceKey, dt as runWithDataStore, et as currentDataStore, ft as FigContext, ht as isContext, j as runTransitionScope, k as TransitionOptions, m as setCurrentDispatcher, o as RenderDispatcher, pt as FigContextSymbol, q as resolveHostMix, s as StableEventCallerArgs, st as isDataStoreController } from "./hooks-QSWYd3Vl.js";
|
|
3
3
|
//#region src/children.d.ts
|
|
4
4
|
/** Describes normalized child. */
|
|
5
5
|
type NormalizedChild = FigElement<any> | FigPortal<any> | PromiseLike<AwaitedFigNode> | string;
|
|
@@ -118,6 +118,8 @@ type PayloadElementModel = {
|
|
|
118
118
|
};
|
|
119
119
|
/** Describes payload special model. */
|
|
120
120
|
type PayloadSpecialModel = {
|
|
121
|
+
$fig: "activity";
|
|
122
|
+
} | {
|
|
121
123
|
$fig: "array";
|
|
122
124
|
id: number;
|
|
123
125
|
value: PayloadModel[];
|
|
@@ -284,4 +286,4 @@ declare function readThenable<T>(thenable: PromiseLike<T>): T;
|
|
|
284
286
|
/** Checks whether thenable. */
|
|
285
287
|
declare function isThenable(value: unknown): value is Thenable;
|
|
286
288
|
//#endregion
|
|
287
|
-
export { ACTIVITY_TEMPLATE_ATTRIBUTE, type ActivityProps, type AssetResourceDestination, type AssetResourceHostProps, Assets, type AwaitedFigNode, type ClientReferenceAssets, type ClientReferenceOptions, type DataRefreshResult, type DataResource, type DataResourceKey, type DataResourceKeyInput, type DataResourceLoadContext, type DataStore, type DataStoreEntrySnapshot, type DataStoreHost, EARLY_EVENT_HANDLER_PROPERTY, EARLY_EVENT_QUEUE_PROPERTY, type ElementType, type ErrorBoundaryProps, type ErrorInfo, type FigActivity, FigActivitySymbol, type FigAssets, FigAssetsSymbol, type FigClientReference, FigClientReferenceSymbol, type FigContext, FigContextSymbol, type FigDataEntryStatus, type FigDataHydrationEntry, type FigDataStore, type FigDataStoreController, type FigDataStoreFactory, type FigDataStoreHandle, type FigDataStoreHost, type FigDataStoreOptions, type FigElement, FigElementSymbol, type FigErrorBoundary, FigErrorBoundarySymbol, FigMixinSymbol, type FigNode, type FigPortal, FigPortalSymbol, type FigSuspense, FigSuspenseSymbol, type FigViewTransition, FigViewTransitionSymbol, HYDRATION_SKIP_ATTRIBUTE, type Key, type LazyLoader, type LoadContextAttributeError, type LoadContextCapabilities, type LoadContextHydrate, type NormalizedChild, type PayloadDataHydrationEntry, type PayloadElementModel, type PayloadGraphEncodeContext, type PayloadModel, type PayloadRow, type PayloadSpecialModel, type Props, REPLAYABLE_EVENT_TYPES, type RenderDispatcher, SUSPENSE_CLIENT_MARKER, SUSPENSE_COMPLETED_MARKER, SUSPENSE_END_MARKER, SUSPENSE_MARKER_PREFIX, SUSPENSE_PENDING_PREFIX, type SerializedAssetResource, type StableEventCallerArgs, type SuspenseProps, TEXT_SEPARATOR_DATA, type Thenable, type TransitionHandler, type TransitionOptions, VIEW_TRANSITION_CLASS_ATTRIBUTE, VIEW_TRANSITION_NAME_ATTRIBUTE, VIEW_TRANSITION_PENDING_PROPERTY, VIEW_TRANSITION_TIMEOUT_MS, type ViewTransitionCallback, type ViewTransitionClass, type ViewTransitionEvent, type ViewTransitionPhase, type ViewTransitionProps, type ViewTransitionSurface, assertPayloadCodecMatches, assetResourceDestination, assetResourceFromHostAttributes, assetResourceFromHostProps, assetResourceFromHostValues, assetResourceHostProps, assetResourceKey, attachDataStore, checkpointPayloadGraph, clientOnlyHostBehavior, clientReferenceAssets, collectChildren, createDataStore, createPayloadGraphEncodeContext, createPortalNode, createRendererDataStore, currentDataStore, dataResourceKeysForError, decodePayloadDataEntries, decodePayloadValue, defineLoadContextCapabilities, definePayloadGraphElement, describeInvalidChild, encodePayloadDataEntries, encodePayloadValue, encodePayloadValueWithGraph, invalidChildError, isActivity, isAssets, isClientReference, isContext, isDataStoreController, isErrorBoundary, isFigAssetResource, isPayloadSpecialModel, isPlainPayloadValue, isPortal, isSuspense, isThenable, isViewTransition, jsonPayloadCodec, loadContextCapabilities, markClientOnlyHostBehavior, markClientOnlyHostProps, markDataResourceError, mixinSlot, normalizeDataResourceKey, preventAssetResourceHoist, readThenable, resolveCurrentDataStore, resolveHostMix, rollbackPayloadGraph, runWithDataStore, serializePayloadArray, serializePayloadMap, serializePayloadPlainObject, serializePayloadSet, setCurrentDataStore, setCurrentDispatcher, setTransitionHandler, trackThenable, validateInstanceNesting, validateTextNesting };
|
|
289
|
+
export { ACTIVITY_TEMPLATE_ATTRIBUTE, type ActivityProps, type AssetResourceDestination, type AssetResourceHostProps, Assets, type AwaitedFigNode, type ClientReferenceAssets, type ClientReferenceOptions, type DataRefreshResult, type DataResource, type DataResourceKey, type DataResourceKeyInput, type DataResourceLoadContext, type DataStore, type DataStoreEntrySnapshot, type DataStoreHost, EARLY_EVENT_HANDLER_PROPERTY, EARLY_EVENT_QUEUE_PROPERTY, type ElementType, type ErrorBoundaryProps, type ErrorInfo, type FigActivity, FigActivitySymbol, type FigAssets, FigAssetsSymbol, type FigClientReference, FigClientReferenceSymbol, type FigContext, FigContextSymbol, type FigDataEntryStatus, type FigDataHydrationEntry, type FigDataReads, type FigDataStore, type FigDataStoreController, type FigDataStoreFactory, type FigDataStoreHandle, type FigDataStoreHost, type FigDataStoreOptions, type FigElement, FigElementSymbol, type FigErrorBoundary, FigErrorBoundarySymbol, FigMixinSymbol, type FigNode, type FigPortal, FigPortalSymbol, type FigSuspense, FigSuspenseSymbol, type FigViewTransition, FigViewTransitionSymbol, HYDRATION_SKIP_ATTRIBUTE, type Key, type LazyLoader, type LoadContextAttributeError, type LoadContextCapabilities, type LoadContextHydrate, type NormalizedChild, type PayloadDataHydrationEntry, type PayloadElementModel, type PayloadGraphEncodeContext, type PayloadModel, type PayloadRow, type PayloadSpecialModel, type Props, REPLAYABLE_EVENT_TYPES, type RenderDispatcher, SUSPENSE_CLIENT_MARKER, SUSPENSE_COMPLETED_MARKER, SUSPENSE_END_MARKER, SUSPENSE_MARKER_PREFIX, SUSPENSE_PENDING_PREFIX, type SerializedAssetResource, type StableEventCallerArgs, type SuspenseProps, TEXT_SEPARATOR_DATA, type Thenable, type TransitionCallback, type TransitionHandler, type TransitionOptions, type TransitionUpdate, VIEW_TRANSITION_CLASS_ATTRIBUTE, VIEW_TRANSITION_NAME_ATTRIBUTE, VIEW_TRANSITION_PENDING_PROPERTY, VIEW_TRANSITION_TIMEOUT_MS, type ViewTransitionCallback, type ViewTransitionClass, type ViewTransitionEvent, type ViewTransitionPhase, type ViewTransitionProps, type ViewTransitionSurface, assertPayloadCodecMatches, assetResourceDestination, assetResourceFromHostAttributes, assetResourceFromHostProps, assetResourceFromHostValues, assetResourceHostProps, assetResourceKey, attachDataStore, checkpointPayloadGraph, clientOnlyHostBehavior, clientReferenceAssets, collectChildren, createDataStore, createPayloadGraphEncodeContext, createPortalNode, createRendererDataStore, currentDataStore, dataResourceKeysForError, decodePayloadDataEntries, decodePayloadValue, defineLoadContextCapabilities, definePayloadGraphElement, describeInvalidChild, encodePayloadDataEntries, encodePayloadValue, encodePayloadValueWithGraph, invalidChildError, isActivity, isAssets, isClientReference, isContext, isDataStoreController, isErrorBoundary, isFigAssetResource, isPayloadSpecialModel, isPlainPayloadValue, isPortal, isSuspense, isThenable, isViewTransition, jsonPayloadCodec, loadContextCapabilities, markClientOnlyHostBehavior, markClientOnlyHostProps, markDataResourceError, mixinSlot, normalizeDataResourceKey, preventAssetResourceHoist, readThenable, resolveCurrentDataStore, resolveHostMix, rollbackPayloadGraph, runTransitionScope, runWithDataStore, serializePayloadArray, serializePayloadMap, serializePayloadPlainObject, serializePayloadSet, setCurrentDataStore, setCurrentDispatcher, setTransitionHandler, trackThenable, validateInstanceNesting, validateTextNesting };
|
package/dist/internal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as markClientOnlyHostBehavior, C as isSuspense, D as FigMixinSymbol, M as mixinSlot, N as resolveHostMix, O as clientOnlyHostBehavior, Q as defineLoadContextCapabilities, R as setCurrentDispatcher, S as isPortal, T as isViewTransition, Z as dataResourceKeysForError, _ as createPortalNode, a as FigAssetsSymbol, b as isClientReference, c as FigErrorBoundarySymbol, d as FigViewTransitionSymbol,
|
|
3
|
-
import { a as assetResourceHostProps, b as readThenable, c as clientReferenceAssets, h as preventAssetResourceHoist, i as assetResourceFromHostValues, n as assetResourceFromHostAttributes, o as assetResourceKey, r as assetResourceFromHostProps, t as assetResourceDestination, u as isFigAssetResource, x as trackThenable, y as isThenable } from "./resource-
|
|
4
|
-
import { _ as serializePayloadArray, b as serializePayloadSet, c as definePayloadGraphElement, d as encodePayloadValueWithGraph, g as rollbackPayloadGraph, h as jsonPayloadCodec, i as decodePayloadDataEntries, l as encodePayloadDataEntries, m as isPlainPayloadValue, n as checkpointPayloadGraph, o as decodePayloadValue, p as isPayloadSpecialModel, r as createPayloadGraphEncodeContext, t as assertPayloadCodecMatches, u as encodePayloadValue, v as serializePayloadMap, y as serializePayloadPlainObject } from "./payload-format-
|
|
1
|
+
import { a as createDataStore, h as normalizeDataResourceKey, i as attachDataStore, m as isDataStoreController, n as setTransitionHandler, o as createRendererDataStore, s as currentDataStore, t as runTransitionScope, v as runWithDataStore, x as isContext, y as FigContextSymbol } from "./transition-DJfG2ZSm.js";
|
|
2
|
+
import { A as markClientOnlyHostBehavior, C as isSuspense, D as FigMixinSymbol, M as mixinSlot, N as resolveHostMix, O as clientOnlyHostBehavior, Q as defineLoadContextCapabilities, R as setCurrentDispatcher, S as isPortal, T as isViewTransition, Z as dataResourceKeysForError, _ as createPortalNode, a as FigAssetsSymbol, b as isClientReference, c as FigErrorBoundarySymbol, d as FigViewTransitionSymbol, i as FigActivitySymbol, it as setCurrentDataStore, j as markClientOnlyHostProps, l as FigPortalSymbol, n as Assets, nt as markDataResourceError, o as FigClientReferenceSymbol, rt as resolveCurrentDataStore, s as FigElementSymbol, tt as loadContextCapabilities, u as FigSuspenseSymbol, v as isActivity, w as isValidElement, x as isErrorBoundary, y as isAssets } from "./element-j7AKp0nu.js";
|
|
3
|
+
import { a as assetResourceHostProps, b as readThenable, c as clientReferenceAssets, h as preventAssetResourceHoist, i as assetResourceFromHostValues, n as assetResourceFromHostAttributes, o as assetResourceKey, r as assetResourceFromHostProps, t as assetResourceDestination, u as isFigAssetResource, x as trackThenable, y as isThenable } from "./resource-Lwjz_b4h.js";
|
|
4
|
+
import { _ as serializePayloadArray, b as serializePayloadSet, c as definePayloadGraphElement, d as encodePayloadValueWithGraph, g as rollbackPayloadGraph, h as jsonPayloadCodec, i as decodePayloadDataEntries, l as encodePayloadDataEntries, m as isPlainPayloadValue, n as checkpointPayloadGraph, o as decodePayloadValue, p as isPayloadSpecialModel, r as createPayloadGraphEncodeContext, t as assertPayloadCodecMatches, u as encodePayloadValue, v as serializePayloadMap, y as serializePayloadPlainObject } from "./payload-format-B9UbNtxo.js";
|
|
5
5
|
//#region src/children.ts
|
|
6
6
|
/** Collect children. */
|
|
7
7
|
function collectChildren(node) {
|
|
@@ -210,6 +210,6 @@ const REPLAYABLE_EVENT_TYPES = [
|
|
|
210
210
|
"pointerup"
|
|
211
211
|
];
|
|
212
212
|
//#endregion
|
|
213
|
-
export { ACTIVITY_TEMPLATE_ATTRIBUTE, Assets, EARLY_EVENT_HANDLER_PROPERTY, EARLY_EVENT_QUEUE_PROPERTY, FigActivitySymbol, FigAssetsSymbol, FigClientReferenceSymbol, FigContextSymbol, FigElementSymbol, FigErrorBoundarySymbol, FigMixinSymbol, FigPortalSymbol, FigSuspenseSymbol, FigViewTransitionSymbol, HYDRATION_SKIP_ATTRIBUTE, REPLAYABLE_EVENT_TYPES, SUSPENSE_CLIENT_MARKER, SUSPENSE_COMPLETED_MARKER, SUSPENSE_END_MARKER, SUSPENSE_MARKER_PREFIX, SUSPENSE_PENDING_PREFIX, TEXT_SEPARATOR_DATA, VIEW_TRANSITION_CLASS_ATTRIBUTE, VIEW_TRANSITION_NAME_ATTRIBUTE, VIEW_TRANSITION_PENDING_PROPERTY, VIEW_TRANSITION_TIMEOUT_MS, assertPayloadCodecMatches, assetResourceDestination, assetResourceFromHostAttributes, assetResourceFromHostProps, assetResourceFromHostValues, assetResourceHostProps, assetResourceKey, attachDataStore, checkpointPayloadGraph, clientOnlyHostBehavior, clientReferenceAssets, collectChildren, createDataStore, createPayloadGraphEncodeContext, createPortalNode, createRendererDataStore, currentDataStore, dataResourceKeysForError, decodePayloadDataEntries, decodePayloadValue, defineLoadContextCapabilities, definePayloadGraphElement, describeInvalidChild, encodePayloadDataEntries, encodePayloadValue, encodePayloadValueWithGraph, invalidChildError, isActivity, isAssets, isClientReference, isContext, isDataStoreController, isErrorBoundary, isFigAssetResource, isPayloadSpecialModel, isPlainPayloadValue, isPortal, isSuspense, isThenable, isViewTransition, jsonPayloadCodec, loadContextCapabilities, markClientOnlyHostBehavior, markClientOnlyHostProps, markDataResourceError, mixinSlot, normalizeDataResourceKey, preventAssetResourceHoist, readThenable, resolveCurrentDataStore, resolveHostMix, rollbackPayloadGraph, runWithDataStore, serializePayloadArray, serializePayloadMap, serializePayloadPlainObject, serializePayloadSet, setCurrentDataStore, setCurrentDispatcher, setTransitionHandler, trackThenable, validateInstanceNesting, validateTextNesting };
|
|
213
|
+
export { ACTIVITY_TEMPLATE_ATTRIBUTE, Assets, EARLY_EVENT_HANDLER_PROPERTY, EARLY_EVENT_QUEUE_PROPERTY, FigActivitySymbol, FigAssetsSymbol, FigClientReferenceSymbol, FigContextSymbol, FigElementSymbol, FigErrorBoundarySymbol, FigMixinSymbol, FigPortalSymbol, FigSuspenseSymbol, FigViewTransitionSymbol, HYDRATION_SKIP_ATTRIBUTE, REPLAYABLE_EVENT_TYPES, SUSPENSE_CLIENT_MARKER, SUSPENSE_COMPLETED_MARKER, SUSPENSE_END_MARKER, SUSPENSE_MARKER_PREFIX, SUSPENSE_PENDING_PREFIX, TEXT_SEPARATOR_DATA, VIEW_TRANSITION_CLASS_ATTRIBUTE, VIEW_TRANSITION_NAME_ATTRIBUTE, VIEW_TRANSITION_PENDING_PROPERTY, VIEW_TRANSITION_TIMEOUT_MS, assertPayloadCodecMatches, assetResourceDestination, assetResourceFromHostAttributes, assetResourceFromHostProps, assetResourceFromHostValues, assetResourceHostProps, assetResourceKey, attachDataStore, checkpointPayloadGraph, clientOnlyHostBehavior, clientReferenceAssets, collectChildren, createDataStore, createPayloadGraphEncodeContext, createPortalNode, createRendererDataStore, currentDataStore, dataResourceKeysForError, decodePayloadDataEntries, decodePayloadValue, defineLoadContextCapabilities, definePayloadGraphElement, describeInvalidChild, encodePayloadDataEntries, encodePayloadValue, encodePayloadValueWithGraph, invalidChildError, isActivity, isAssets, isClientReference, isContext, isDataStoreController, isErrorBoundary, isFigAssetResource, isPayloadSpecialModel, isPlainPayloadValue, isPortal, isSuspense, isThenable, isViewTransition, jsonPayloadCodec, loadContextCapabilities, markClientOnlyHostBehavior, markClientOnlyHostProps, markDataResourceError, mixinSlot, normalizeDataResourceKey, preventAssetResourceHoist, readThenable, resolveCurrentDataStore, resolveHostMix, rollbackPayloadGraph, runTransitionScope, runWithDataStore, serializePayloadArray, serializePayloadMap, serializePayloadPlainObject, serializePayloadSet, setCurrentDataStore, setCurrentDispatcher, setTransitionHandler, trackThenable, validateInstanceNesting, validateTextNesting };
|
|
214
214
|
|
|
215
215
|
//# sourceMappingURL=internal.js.map
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as Fragment, C as FigNode, j as Key, l as ElementType, y as FigElement } from "./element-
|
|
1
|
+
import { A as Fragment, C as FigNode, j as Key, l as ElementType, y as FigElement } from "./element-B4LrR2ZB.js";
|
|
2
2
|
//#region src/jsx-runtime.d.ts
|
|
3
3
|
/** Describes JSX props. */
|
|
4
4
|
type JSXProps = Record<string, unknown>;
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as resolveHostMix, f as Fragment, s as FigElementSymbol } from "./element-
|
|
1
|
+
import { N as resolveHostMix, f as Fragment, s as FigElementSymbol } from "./element-j7AKp0nu.js";
|
|
2
2
|
//#region src/jsx-runtime.ts
|
|
3
3
|
/**
|
|
4
4
|
* JSX runtime functions and types used by Fig-aware compilers.
|
|
@@ -353,6 +353,7 @@ function decodePayloadDataEntries(entries) {
|
|
|
353
353
|
function isPayloadSpecialModel(model) {
|
|
354
354
|
if (!("$fig" in model)) return false;
|
|
355
355
|
switch (model.$fig) {
|
|
356
|
+
case "activity":
|
|
356
357
|
case "array":
|
|
357
358
|
case "bigint":
|
|
358
359
|
case "client":
|
|
@@ -376,4 +377,4 @@ function isPayloadSpecialModel(model) {
|
|
|
376
377
|
//#endregion
|
|
377
378
|
export { serializePayloadArray as _, decodePayloadRecord as a, serializePayloadSet as b, definePayloadGraphElement as c, encodePayloadValueWithGraph as d, errorFromPayloadValue as f, rollbackPayloadGraph as g, jsonPayloadCodec as h, decodePayloadDataEntries as i, encodePayloadDataEntries as l, isPlainPayloadValue as m, checkpointPayloadGraph as n, decodePayloadValue as o, isPayloadSpecialModel as p, createPayloadGraphEncodeContext as r, decodePayloadValueTag as s, assertPayloadCodecMatches as t, encodePayloadValue as u, serializePayloadMap as v, serializePayloadPlainObject as y };
|
|
378
379
|
|
|
379
|
-
//# sourceMappingURL=payload-format-
|
|
380
|
+
//# sourceMappingURL=payload-format-B9UbNtxo.js.map
|