@bgub/fig 1.0.0 → 2.1.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 +132 -0
- package/README.md +21 -22
- package/dist/{element-9MtOc5qb.d.ts → element-DT9ziqWN.d.ts} +49 -17
- package/dist/{element-CssKOG37.js → element-DpXdLgOZ.js} +11 -69
- package/dist/element-DpXdLgOZ.js.map +1 -0
- package/dist/{hooks-Blgy3bby.d.ts → hooks-GeZ4mX7W.d.ts} +15 -19
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/internal.d.ts +7 -9
- package/dist/internal.js +8 -4
- package/dist/internal.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/payload-format-B9UbNtxo.js.map +1 -1
- package/dist/payload.d.ts +1 -1
- package/dist/payload.js +2 -2
- package/{dist-development/resource-Bt8LOhv4.js → dist/resource-DEDmLSNk.js} +20 -27
- package/dist/resource-DEDmLSNk.js.map +1 -0
- package/dist/{transition-B7vpLnb1.js → transition-BFLGYE4q.js} +433 -134
- package/dist/transition-BFLGYE4q.js.map +1 -0
- package/dist-development/{element-CKdh2VTU.js → element-DbzJUf5a.js} +11 -69
- package/dist-development/element-DbzJUf5a.js.map +1 -0
- package/dist-development/index.js +4 -4
- package/dist-development/internal.js +8 -4
- package/dist-development/internal.js.map +1 -1
- package/dist-development/jsx-runtime.js +1 -1
- package/dist-development/payload-format-B9UbNtxo.js.map +1 -1
- package/dist-development/payload.js +2 -2
- package/{dist/resource-BlZob4k1.js → dist-development/resource-BZOBllE_.js} +20 -27
- package/dist-development/resource-BZOBllE_.js.map +1 -0
- package/dist-development/{transition-DEVMhyYg.js → transition-CWjp9qRO.js} +430 -133
- package/dist-development/transition-CWjp9qRO.js.map +1 -0
- package/package.json +1 -1
- package/dist/element-CssKOG37.js.map +0 -1
- package/dist/resource-BlZob4k1.js.map +0 -1
- package/dist/transition-B7vpLnb1.js.map +0 -1
- package/dist-development/element-CKdh2VTU.js.map +0 -1
- package/dist-development/resource-Bt8LOhv4.js.map +0 -1
- package/dist-development/transition-DEVMhyYg.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,135 @@
|
|
|
1
|
+
## @bgub/fig@2.1.0
|
|
2
|
+
|
|
3
|
+
### Add intentional browser-only rendering
|
|
4
|
+
|
|
5
|
+
Components can call `readBrowser(reason?)` to leave their nearest server-rendered
|
|
6
|
+
Suspense boundary in its fallback state and render normally during hydration.
|
|
7
|
+
Server renderers can observe these intentional fallbacks through
|
|
8
|
+
`onBrowserBailout` without treating them as server or recoverable errors.
|
|
9
|
+
|
|
10
|
+
### Preserve data read handoffs and settle comparison failures
|
|
11
|
+
|
|
12
|
+
Keep pending loader-backed data entries alive when a replacement Suspense boundary takes over their reads, without cancelling loads needed by suspended transitions. Handle equality-comparator exceptions as load failures so synchronous and asynchronous refreshes settle with a rejected outcome while preserving the previous value.
|
|
13
|
+
|
|
14
|
+
### Require explicit data store handles
|
|
15
|
+
|
|
16
|
+
Remove the ambient `preloadData`, `ensureData`, `refreshData`, `invalidateData`, `invalidateDataKey`, `invalidateDataPrefix`, and `invalidateDataError` exports. Capture `const data = readDataStore()` during render or another synchronous Fig callback, then call the corresponding methods on `data` before or after awaits. Outside Fig, use `root.data`, route `context.data`, or a pre-created store. `readData()` remains the render-only read API.
|
|
17
|
+
|
|
18
|
+
Remove preloading from the internal render-dispatcher protocol. Store methods preserve existing loading, retention, invalidation, and refresh behavior. After an await, use a transition's `update` callback when transition priority is required.
|
|
19
|
+
|
|
20
|
+
### Preserve asynchronous data failure state
|
|
21
|
+
|
|
22
|
+
Prevent automatic refresh loops when a data loader rejects with an undefined reason. Cache failures thrown while subscribing to a thenable, and preserve its first settlement across duplicate callbacks or subsequent throws.
|
|
23
|
+
|
|
24
|
+
### Retain data reads through speculative renders
|
|
25
|
+
|
|
26
|
+
Hold data entries for every render read, not only reads of pending loads.
|
|
27
|
+
Committing a render swaps the hold for a subscription; discarding one releases
|
|
28
|
+
it and re-arms inactive cleanup, and a suspended subtree's Suspense boundary
|
|
29
|
+
holds every key its content read until it reveals. Abandoned renders no longer
|
|
30
|
+
leave entries cached indefinitely, and parked or suspended renders keep their
|
|
31
|
+
values, including hydrate-only ones, without reloading.
|
|
32
|
+
|
|
33
|
+
### Preserve data lifetimes during reentrant cancellation
|
|
34
|
+
|
|
35
|
+
Make data load replacement and retirement safe when abort listeners synchronously start new work. Refresh, rejection, hydration, eviction, and attributed-error invalidation preserve successor values, signals, and pending results. Skip loaders superseded before invocation and stop hydration batches after store disposal. Treat throwing thenable accessors as normal loader failures.
|
|
36
|
+
|
|
37
|
+
### Remove redundant data store partitions
|
|
38
|
+
|
|
39
|
+
Remove `partition` from `createDataStore` and `dataPartition` from client and server renderer options. Each store already owns an isolated cache, so the fixed key prefix provided no additional isolation. Remove these options from callers; include tenant identity in resource keys when one store holds data for multiple tenants. SSR hydration entries remain unchanged.
|
|
40
|
+
|
|
41
|
+
### Simplify font assets and binding types
|
|
42
|
+
|
|
43
|
+
Make `font()` shorthand for a font `PreloadResource`, preserving its anonymous cross-origin default. Remove `FontResource` and the separate `font` descriptor and Payload asset kind; use `preload` with `as: "font"` instead. Update clients and servers together when using Payload.
|
|
44
|
+
|
|
45
|
+
Remove the redundant `BindCallback` type alias. Use `Bind` for callbacks and `Binding` for the full bind-prop representation.
|
|
46
|
+
|
|
47
|
+
### Stop hydration batches when their generation retires
|
|
48
|
+
|
|
49
|
+
Stop applying a loader's hydration batch if an entry's abort listener retires
|
|
50
|
+
the delivering generation. Remaining Payload data entries can no longer
|
|
51
|
+
overwrite data published by its successor.
|
|
52
|
+
|
|
53
|
+
### Stream Suspense boundary data ahead of each reveal
|
|
54
|
+
|
|
55
|
+
Server stream renders now send the data each Suspense boundary read in a `d`
|
|
56
|
+
operation right before that boundary's reveal, and `hydrateRoot` applies it to
|
|
57
|
+
the root's store. Late boundaries hydrate from server data instead of
|
|
58
|
+
reloading in the browser. Streamed rows fill only entries the client has no
|
|
59
|
+
value for. Disable with `streamData: false` or exclude entries with
|
|
60
|
+
`streamData: { filter }`.
|
|
61
|
+
|
|
62
|
+
`takeData()` on stream results returns the settled entries that have not been
|
|
63
|
+
streamed, so documents can place the shell's snapshot before the client
|
|
64
|
+
bootstrap without duplicating later rows.
|
|
65
|
+
|
|
66
|
+
The TanStack Start transport no longer waits for every boundary before the
|
|
67
|
+
router bootstrap. It uses the renderer's streamed rows, streams initial
|
|
68
|
+
Payload responses ahead of the boundaries that render them, and lets Router's
|
|
69
|
+
deferred data interleave with streamed boundaries.
|
|
70
|
+
|
|
71
|
+
### Unify data entry retention ownership
|
|
72
|
+
|
|
73
|
+
Simplify internal data retention bookkeeping by tracking pending callers, dependent generations, and speculative reads in one lazily allocated owner set, preserving existing cancellation and subscription lifetimes.
|
|
74
|
+
|
|
75
|
+
### Add watched data resources and dependent data handles
|
|
76
|
+
|
|
77
|
+
Add watched data resources. A resource's optional `watch(...args, context)` pushes values into its entry while a committed reader exists, through `publish`, `fail`, `refresh` (which now resolves with its `DataRefreshResult`), and `invalidate`. A resource with `watch` and no `load` is push-only: its first read suspends until the first publish, and the render or Suspense fallback waiting on it holds the watch open with no time limit. Watches never run on the server and start only after the hydration commit, so hydration always renders the hydrated value.
|
|
78
|
+
|
|
79
|
+
Load and watch contexts now include `data`, the store running them. `data.ensureData` keeps the ensured entry cached (and a push-only dependency's watch running) while the dependent load's value or watch is live, and a retired dependent's pending wait rejects with its signal's reason. Code that calls a resource's `load` directly, such as an HTTP endpoint or a test, must now pass `data`, for example a `createDataStore()` it disposes afterwards.
|
|
80
|
+
|
|
81
|
+
Add the `equals` resource option, defaulting to `Object.is`: a load, refresh, or publish equal to the visible value keeps that value, its identity, and its generation, re-renders nothing, and still clears staleness and refresh errors. Previously an identical value re-rendered every reader. Add the per-resource `inactiveRetentionMs` option, overriding the store's inactive retention for that resource's entries.
|
|
82
|
+
|
|
83
|
+
In the reconciler, a capturing Suspense boundary now takes over the data reads its suspended content was waiting on and subscribes to them with its fallback, and render attempts release discarded read sets to the store. Unmounting a waiting fallback therefore also stops an abandoned value-less load. Client root hosts set `watchSources`; server stores never start watches.
|
|
84
|
+
|
|
85
|
+
Dependency reads from retired loads or watches reject before creating cache entries.
|
|
86
|
+
|
|
87
|
+
## @bgub/fig@2.0.0
|
|
88
|
+
|
|
89
|
+
### Catch data changes before subscription commit
|
|
90
|
+
|
|
91
|
+
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.
|
|
92
|
+
|
|
93
|
+
### Preserve host behavior lifetimes across configuration updates
|
|
94
|
+
|
|
95
|
+
Add `context.owns(prop)` to identify the last mixin writer of a host prop, even
|
|
96
|
+
when a later override writes the same value.
|
|
97
|
+
|
|
98
|
+
Add `hostBinding(context, owner, update)` for mixins that register committed DOM
|
|
99
|
+
configuration. Updates keep their lifetime signal; removal, owner replacement,
|
|
100
|
+
and Activity hiding abort it synchronously.
|
|
101
|
+
|
|
102
|
+
The host `bind` prop additionally accepts host-binding descriptions and nested
|
|
103
|
+
binding arrays through the new `Binding` type. Array members have independent
|
|
104
|
+
signals and development strict checks. `Bind` remains callable, and
|
|
105
|
+
`composeBind` preserves its callable result and shared lifetime semantics.
|
|
106
|
+
`BindCallback` is an alias for `Bind`.
|
|
107
|
+
|
|
108
|
+
Headless widgets adopt shared committed value, registration, and reference owners.
|
|
109
|
+
Controlled props cannot leak from suspended renders, accepted uncontrolled
|
|
110
|
+
requests compose before commit, and compound Combobox changes cancel together.
|
|
111
|
+
Host configuration updates preserve typeahead and toast work while actual
|
|
112
|
+
removal cleans up immediately. Caller-authored native disability and accessible
|
|
113
|
+
names remain authoritative.
|
|
114
|
+
|
|
115
|
+
### Own speculative work by render attempt
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
Commit candidates publish once and retain their identity across deferred host callbacks. Capture release is independent of mutation and cannot finish a newer candidate.
|
|
120
|
+
|
|
121
|
+
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.
|
|
122
|
+
|
|
123
|
+
### Simplify render and data ownership
|
|
124
|
+
|
|
125
|
+
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.
|
|
126
|
+
|
|
127
|
+
Process root and component queues through one operation with explicit fiber ownership. Invalidate each inconsistent component once when checking data and external-store snapshots.
|
|
128
|
+
|
|
129
|
+
### Keep data reads consistent across yielded renders
|
|
130
|
+
|
|
131
|
+
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.
|
|
132
|
+
|
|
1
133
|
## @bgub/fig@1.0.0
|
|
2
134
|
|
|
3
135
|
### Preserve Activity boundaries through Payload
|
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ bundles that never define a resource never ship it.
|
|
|
162
162
|
```tsx
|
|
163
163
|
import { Suspense } from "@bgub/fig";
|
|
164
164
|
import { createRoot, on } from "@bgub/fig-dom";
|
|
165
|
-
import { dataResource, readData,
|
|
165
|
+
import { dataResource, readData, readDataStore } from "@bgub/fig";
|
|
166
166
|
|
|
167
167
|
const userResource = dataResource({
|
|
168
168
|
key: (id: string) => ["user", id],
|
|
@@ -173,10 +173,11 @@ const userResource = dataResource({
|
|
|
173
173
|
});
|
|
174
174
|
|
|
175
175
|
function Profile({ id }: { id: string }) {
|
|
176
|
+
const data = readDataStore();
|
|
176
177
|
const user = readData(userResource, id);
|
|
177
178
|
|
|
178
179
|
return (
|
|
179
|
-
<button mix={on("click", () => void refreshData(userResource, id))}>
|
|
180
|
+
<button mix={on("click", () => void data.refreshData(userResource, id))}>
|
|
180
181
|
{user.name}
|
|
181
182
|
</button>
|
|
182
183
|
);
|
|
@@ -213,27 +214,27 @@ DevTools.
|
|
|
213
214
|
|
|
214
215
|
### Refresh And Invalidate
|
|
215
216
|
|
|
216
|
-
`invalidateData(resource, ...args)` marks an existing entry stale. If the key is
|
|
217
|
+
`data.invalidateData(resource, ...args)` marks an existing entry stale. If the key is
|
|
217
218
|
currently observed, Fig schedules the readers; the next read keeps showing the
|
|
218
219
|
last fulfilled value and starts a background reload. If nobody is observing the
|
|
219
220
|
key, invalidation is lazy and does not fetch.
|
|
220
221
|
|
|
221
|
-
`invalidateDataKey(key)` applies the same stale/reset semantics to one exact
|
|
222
|
-
structured key. `invalidateDataError(error)` invalidates every exact key Fig
|
|
222
|
+
`data.invalidateDataKey(key)` applies the same stale/reset semantics to one exact
|
|
223
|
+
structured key. `data.invalidateDataError(error)` invalidates every exact key Fig
|
|
223
224
|
attributed to a caught data error and returns whether any data keys were found.
|
|
224
225
|
Use it from an `ErrorBoundary` fallback before remounting or resetting the
|
|
225
226
|
boundary.
|
|
226
227
|
|
|
227
|
-
`invalidateDataPrefix(prefix)` marks every existing entry whose structured key
|
|
228
|
-
starts with `prefix` stale. For example, `invalidateDataPrefix(["user"])`
|
|
228
|
+
`data.invalidateDataPrefix(prefix)` marks every existing entry whose structured key
|
|
229
|
+
starts with `prefix` stale. For example, `data.invalidateDataPrefix(["user"])`
|
|
229
230
|
targets entries like `["user", id]`. Prefix matching uses the same canonical
|
|
230
231
|
key encoder as normal reads, so delimiter-shaped strings do not collide.
|
|
231
232
|
|
|
232
|
-
`refreshData(resource, ...args)` fetches immediately and resolves with a result
|
|
233
|
+
`data.refreshData(resource, ...args)` fetches immediately and resolves with a result
|
|
233
234
|
instead of rejecting:
|
|
234
235
|
|
|
235
236
|
```ts
|
|
236
|
-
const result = await refreshData(userResource, "one");
|
|
237
|
+
const result = await data.refreshData(userResource, "one");
|
|
237
238
|
|
|
238
239
|
if (result.status === "fulfilled") {
|
|
239
240
|
console.log(result.value);
|
|
@@ -247,25 +248,23 @@ failed.
|
|
|
247
248
|
|
|
248
249
|
### Root Store Scope
|
|
249
250
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
bind the store explicitly:
|
|
251
|
+
Imperative data operations use an explicit store handle. Components capture
|
|
252
|
+
`readDataStore()` while rendering; external code uses `root.data`:
|
|
253
253
|
|
|
254
254
|
```ts
|
|
255
255
|
const root = createRoot(container);
|
|
256
256
|
|
|
257
257
|
socket.on("user:update", (id) => {
|
|
258
|
-
root.data.
|
|
258
|
+
root.data.invalidateData(userResource, id);
|
|
259
259
|
});
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
keep the handle and re-enter:
|
|
262
|
+
The same handle works after an `await`, without re-entering an ambient scope:
|
|
264
263
|
|
|
265
264
|
```ts
|
|
266
265
|
const data = root.data;
|
|
267
266
|
await save();
|
|
268
|
-
data.
|
|
267
|
+
await data.refreshData(userResource, "one");
|
|
269
268
|
```
|
|
270
269
|
|
|
271
270
|
Framework adapters can create and populate a root-neutral store before a
|
|
@@ -283,16 +282,16 @@ root.data === dataStore; // true
|
|
|
283
282
|
Adoption preserves entry identity and subscriptions. The adopting root owns
|
|
284
283
|
the store lifetime and disposes it when the root unmounts.
|
|
285
284
|
|
|
286
|
-
Client roots accept `dataStore
|
|
287
|
-
|
|
288
|
-
store's internal keyspace without changing public resource keys.
|
|
285
|
+
Client roots accept mutually exclusive `dataStore` and `initialData` options.
|
|
286
|
+
Each store owns an isolated cache keyed by resource identity.
|
|
289
287
|
Loaders receive only their resource arguments plus `{ signal }`; app services,
|
|
290
288
|
request cookies, and auth state belong in the surrounding adapter or closure,
|
|
291
289
|
not in the data store.
|
|
292
290
|
|
|
293
291
|
### Server Values And Hydration
|
|
294
292
|
|
|
295
|
-
Server renderers
|
|
293
|
+
Server renderers return the shell's data entries with `takeData()` and stream
|
|
294
|
+
data read inside Suspense boundaries ahead of each reveal. Pass the shell
|
|
296
295
|
entries to the client root as `initialData` to hydrate by key, or use
|
|
297
296
|
`createDataStore()` when an adapter needs to populate and render through the
|
|
298
297
|
same live store.
|
|
@@ -324,7 +323,7 @@ export const userServerResource = dataResource({
|
|
|
324
323
|
|
|
325
324
|
Client code imports the loader-less resource. If the server streamed a value
|
|
326
325
|
for the same key, the client can read it as a hydrate-only entry. Since the
|
|
327
|
-
resource has no client loader, `refreshData(userResource, id)` resolves with
|
|
326
|
+
resource has no client loader, `data.refreshData(userResource, id)` resolves with
|
|
328
327
|
`{ status: "unsupported", reason: "no-client-loader" }`; revalidation needs a
|
|
329
328
|
payload or framework refresh path.
|
|
330
329
|
|
|
@@ -348,7 +347,7 @@ Invalidating a hidden-only key schedules offscreen prerender work and keeps the
|
|
|
348
347
|
DOM hidden.
|
|
349
348
|
|
|
350
349
|
Initial load errors are keyed. `ErrorBoundary` reports the failed keys on
|
|
351
|
-
`info.dataResourceKeys`; reset flows can call `invalidateDataError(error)` or
|
|
350
|
+
`info.dataResourceKeys`; reset flows can call `data.invalidateDataError(error)` or
|
|
352
351
|
refresh/invalidate those keys before remounting or changing the boundary key.
|
|
353
352
|
|
|
354
353
|
Fig DevTools root snapshots include data-resource entries with their normalized
|
|
@@ -7,16 +7,49 @@ type DataResourceKeyInput = string | number | boolean | null | readonly DataReso
|
|
|
7
7
|
type DataResourceKey = readonly [string, ...DataResourceKeyInput[]];
|
|
8
8
|
/** Describes data resource load context. */
|
|
9
9
|
interface DataResourceLoadContext {
|
|
10
|
+
/**
|
|
11
|
+
* The store running this load. Entries ensured through it stay cached
|
|
12
|
+
* while this load's value is visible.
|
|
13
|
+
*/
|
|
14
|
+
data: FigDataStoreHandle;
|
|
10
15
|
signal: AbortSignal;
|
|
11
16
|
}
|
|
12
17
|
/** Describes data resource loader. */
|
|
13
18
|
type DataResourceLoader<TArgs extends unknown[], TValue> = (...argsAndContext: [...TArgs, DataResourceLoadContext]) => TValue | PromiseLike<TValue>;
|
|
19
|
+
/**
|
|
20
|
+
* Capabilities a watch receives. Every operation is bound to the watched key
|
|
21
|
+
* and becomes inert once `signal` aborts.
|
|
22
|
+
*/
|
|
23
|
+
interface DataResourceWatchContext<TValue> {
|
|
24
|
+
/**
|
|
25
|
+
* The store running this watch. Entries ensured through it stay cached
|
|
26
|
+
* while this watch runs.
|
|
27
|
+
*/
|
|
28
|
+
data: FigDataStoreHandle;
|
|
29
|
+
signal: AbortSignal;
|
|
30
|
+
/** Replaces the entry's value, as a successful server push would. */
|
|
31
|
+
publish: (value: TValue) => void;
|
|
32
|
+
/** Records a failure: a visible value stays, a missing one rejects. */
|
|
33
|
+
fail: (error: unknown) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Reruns `load` for this key and resolves with the outcome (`unsupported`
|
|
36
|
+
* for push-only resources; `aborted` once the watch has stopped).
|
|
37
|
+
*/
|
|
38
|
+
refresh: () => Promise<DataRefreshResult<TValue>>;
|
|
39
|
+
/** Marks this key stale. */
|
|
40
|
+
invalidate: () => void;
|
|
41
|
+
}
|
|
42
|
+
/** Describes data resource watcher. */
|
|
43
|
+
type DataResourceWatcher<TArgs extends unknown[], TValue> = (...argsAndContext: [...TArgs, DataResourceWatchContext<TValue>]) => void;
|
|
14
44
|
/** Describes data resource. */
|
|
15
45
|
interface DataResource<TArgs extends unknown[] = unknown[], TValue = unknown> {
|
|
16
46
|
readonly $$typeof: symbol;
|
|
17
47
|
readonly debugArgs?: (...args: TArgs) => DataResourceKeyInput;
|
|
48
|
+
readonly equals?: (previous: TValue, next: TValue) => boolean;
|
|
49
|
+
readonly inactiveRetentionMs?: number;
|
|
18
50
|
readonly key: (...args: TArgs) => DataResourceKey;
|
|
19
51
|
readonly load?: DataResourceLoader<TArgs, TValue>;
|
|
52
|
+
readonly watch?: DataResourceWatcher<TArgs, TValue>;
|
|
20
53
|
}
|
|
21
54
|
/** Describes data refresh result. */
|
|
22
55
|
type DataRefreshResult<T> = {
|
|
@@ -28,7 +61,7 @@ type DataRefreshResult<T> = {
|
|
|
28
61
|
staleValue?: T;
|
|
29
62
|
} | {
|
|
30
63
|
status: "aborted";
|
|
31
|
-
reason: "superseded" | "store-disposed" | "evicted";
|
|
64
|
+
reason: "superseded" | "store-disposed" | "evicted" | "released";
|
|
32
65
|
staleValue?: T;
|
|
33
66
|
} | {
|
|
34
67
|
status: "unsupported";
|
|
@@ -54,6 +87,8 @@ interface DataStoreEntrySnapshot {
|
|
|
54
87
|
status: FigDataEntryStatus;
|
|
55
88
|
subscriberCount: number;
|
|
56
89
|
value?: unknown;
|
|
90
|
+
/** Present and true while a watch is pushing values into this entry. */
|
|
91
|
+
watching?: boolean;
|
|
57
92
|
}
|
|
58
93
|
/** Describes Fig data store handle. */
|
|
59
94
|
interface FigDataStoreHandle {
|
|
@@ -78,25 +113,30 @@ interface FigDataStoreController extends FigDataStoreHandle {
|
|
|
78
113
|
/** Describes Fig data store options. */
|
|
79
114
|
interface FigDataStoreOptions {
|
|
80
115
|
initialData?: readonly FigDataHydrationEntry[];
|
|
81
|
-
partition?: DataResourceKeyInput;
|
|
82
116
|
}
|
|
117
|
+
type FigDataReads = Map<string, {
|
|
118
|
+
value: unknown;
|
|
119
|
+
} | undefined>;
|
|
83
120
|
/** Describes Fig data store. */
|
|
84
121
|
interface FigDataStore extends FigDataStoreHandle {
|
|
85
|
-
|
|
122
|
+
areDataDependenciesConsistent(reads: FigDataReads): boolean;
|
|
123
|
+
commitDataDependencies(owner: object, previousOwner: object | null, reads?: FigDataReads): boolean;
|
|
86
124
|
deleteDataOwner(owner: object): void;
|
|
125
|
+
holdDataRead(reads: FigDataReads, canonicalKey: string): void;
|
|
87
126
|
releaseDataOwner(owner: object): void;
|
|
88
|
-
|
|
127
|
+
releaseDataReads(reads: FigDataReads): void;
|
|
89
128
|
dispose(): void;
|
|
129
|
+
hydrateMissing(entries: readonly FigDataHydrationEntry[]): void;
|
|
90
130
|
inspectDataDependencyCanonicalKeys(owner: object): string[];
|
|
91
131
|
inspectDataEntries(): DataStoreEntrySnapshot[];
|
|
92
132
|
snapshot(): FigDataHydrationEntry[];
|
|
93
|
-
readData<TArgs extends unknown[], TValue>(resource: DataResource<TArgs, TValue>, args: TArgs,
|
|
133
|
+
readData<TArgs extends unknown[], TValue>(resource: DataResource<TArgs, TValue>, args: TArgs, reads?: FigDataReads): TValue;
|
|
94
134
|
}
|
|
95
135
|
/** Describes Fig data store host. */
|
|
96
136
|
interface FigDataStoreHost {
|
|
97
137
|
getLane(): unknown;
|
|
98
|
-
partition?: DataResourceKeyInput;
|
|
99
138
|
schedule(owner: object, lane: unknown): void;
|
|
139
|
+
readonly watchSources?: boolean;
|
|
100
140
|
}
|
|
101
141
|
/** Describes Fig data store factory. */
|
|
102
142
|
type FigDataStoreFactory = (host: FigDataStoreHost) => FigDataStore;
|
|
@@ -133,7 +173,7 @@ type FetchPriority = "high" | "low" | "auto";
|
|
|
133
173
|
/** Describes asset resource destination. */
|
|
134
174
|
type AssetResourceDestination = "head" | "stream";
|
|
135
175
|
/** Describes Fig asset resource. */
|
|
136
|
-
type FigAssetResource = StylesheetResource | PreloadResource | ModulePreloadResource | ScriptResource |
|
|
176
|
+
type FigAssetResource = StylesheetResource | PreloadResource | ModulePreloadResource | ScriptResource | PreconnectResource | TitleResource | MetaResource;
|
|
137
177
|
interface ResourceBase {
|
|
138
178
|
key?: string;
|
|
139
179
|
}
|
|
@@ -174,14 +214,6 @@ interface ScriptResource extends ResourceBase {
|
|
|
174
214
|
module?: boolean;
|
|
175
215
|
src: string;
|
|
176
216
|
}
|
|
177
|
-
/** Describes font resource. */
|
|
178
|
-
interface FontResource extends ResourceBase {
|
|
179
|
-
crossorigin?: CrossOrigin;
|
|
180
|
-
fetchpriority?: FetchPriority;
|
|
181
|
-
href: string;
|
|
182
|
-
kind: "font";
|
|
183
|
-
type: string;
|
|
184
|
-
}
|
|
185
217
|
/** Describes preconnect resource. */
|
|
186
218
|
interface PreconnectResource extends ResourceBase {
|
|
187
219
|
crossorigin?: CrossOrigin;
|
|
@@ -245,7 +277,7 @@ declare function modulepreload(href: string, options?: Omit<ModulePreloadResourc
|
|
|
245
277
|
/** Script. */
|
|
246
278
|
declare function script(src: string, options?: Omit<ScriptResource, "kind" | "src">): ScriptResource;
|
|
247
279
|
/** Font. */
|
|
248
|
-
declare function font(href: string, type: string, options?:
|
|
280
|
+
declare function font(href: string, type: string, options?: Pick<PreloadResource, "key" | "crossorigin" | "fetchpriority">): PreloadResource;
|
|
249
281
|
/** Preconnect. */
|
|
250
282
|
declare function preconnect(href: string, options?: Omit<PreconnectResource, "href" | "kind">): PreconnectResource;
|
|
251
283
|
/** Title. */
|
|
@@ -456,4 +488,4 @@ declare function isViewTransition(value: unknown): value is FigViewTransition;
|
|
|
456
488
|
/** Checks whether assets. */
|
|
457
489
|
declare function isAssets(value: unknown): value is FigAssets;
|
|
458
490
|
//#endregion
|
|
459
|
-
export { isViewTransition as $,
|
|
491
|
+
export { isViewTransition as $, FigDataStoreOptions as $t, Fragment as A, preconnect as At, ViewTransitionPhase as B, DataResourceLoadContext as Bt, FigNode as C, assetResourceKey as Ct, FigSuspenseSymbol as D, isFigAssetResource as Dt, FigSuspense as E, font as Et, SuspenseProps as F, title as Ft, createPortalNode as G, FigDataEntryStatus as Gt, ViewTransitionSurface as H, DataResourceWatchContext as Ht, ViewTransition as I, DataRefreshResult as It, isClientReference as J, FigDataStore as Jt, isActivity as K, FigDataHydrationEntry as Kt, ViewTransitionCallback as L, DataResource as Lt, LazyLoader as M, preventAssetResourceHoist as Mt, Props as N, script as Nt, FigViewTransition as O, meta as Ot, Suspense as P, stylesheet as Pt, isValidElement as Q, FigDataStoreHost as Qt, ViewTransitionClass as R, DataResourceKey as Rt, FigErrorBoundarySymbol as S, assetResourceHostProps as St, FigPortalSymbol as T, clientReferenceAssets as Tt, clientReference as U, DataResourceWatcher as Ut, ViewTransitionProps as V, DataResourceLoader as Vt, createElement as W, DataStoreEntrySnapshot as Wt, isPortal as X, FigDataStoreFactory as Xt, isErrorBoundary as Y, FigDataStoreController as Yt, isSuspense as Z, FigDataStoreHandle as Zt, FigClientReference as _, TitleResource as _t, AwaitedFigNode as a, loadContextCapabilities as an, ClientReferenceAssets as at, FigElementSymbol as b, assetResourceFromHostProps as bt, ComponentType as c, setCurrentDataStore as cn, FigAssetResource as ct, ErrorBoundaryProps as d, MetaResourceOptions as dt, LoadContextAttributeError as en, lazy as et, ErrorInfo as f, ModulePreloadResource as ft, FigAssetsSymbol as g, StylesheetResource as gt, FigAssets as h, ScriptResource as ht, Assets as i, defineLoadContextCapabilities as in, AssetsProps as it, Key as j, preload as jt, FigViewTransitionSymbol as k, modulepreload as kt, ElementType as l, FigAssetResourceList as lt, FigActivitySymbol as m, PreloadResource as mt, ActivityMode as n, LoadContextHydrate as nn, AssetResourceDestination as nt, ClientReferenceOptions as o, markDataResourceError as on, CrossOrigin as ot, FigActivity as p, PreconnectResource as pt, isAssets as q, FigDataReads as qt, ActivityProps as r, dataResourceKeysForError as rn, AssetResourceHostProps as rt, ComponentProps as s, resolveCurrentDataStore as sn, FetchPriority as st, Activity as t, LoadContextCapabilities as tn, AssetResourceBlocking as tt, ErrorBoundary as u, MetaResource as ut, FigClientReferenceSymbol as v, assetResourceDestination as vt, FigPortal as w, assets as wt, FigErrorBoundary as x, assetResourceFromHostValues as xt, FigElement as y, assetResourceFromHostAttributes as yt, ViewTransitionEvent as z, DataResourceKeyInput as zt };
|
|
@@ -1,58 +1,3 @@
|
|
|
1
|
-
//#region src/data.ts
|
|
2
|
-
const LoadContextCapabilitiesSymbol = Symbol.for("fig.data-load-context");
|
|
3
|
-
/** Define load context capabilities. */
|
|
4
|
-
function defineLoadContextCapabilities(context, capabilities) {
|
|
5
|
-
Object.defineProperty(context, LoadContextCapabilitiesSymbol, {
|
|
6
|
-
configurable: true,
|
|
7
|
-
enumerable: false,
|
|
8
|
-
value: capabilities
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
/** Load context capabilities. */
|
|
12
|
-
function loadContextCapabilities(context) {
|
|
13
|
-
return context[LoadContextCapabilitiesSymbol];
|
|
14
|
-
}
|
|
15
|
-
const objectDataErrors = /* @__PURE__ */ new WeakMap();
|
|
16
|
-
let currentDataStore = null;
|
|
17
|
-
/** Captures an optional data store for synchronous scope re-entry. */
|
|
18
|
-
function getCurrentDataStore() {
|
|
19
|
-
return currentDataStore;
|
|
20
|
-
}
|
|
21
|
-
/** Resolves current data store. */
|
|
22
|
-
function resolveCurrentDataStore(message = "Data resource APIs require a Fig data store.") {
|
|
23
|
-
if (currentDataStore === null) throw new Error(message);
|
|
24
|
-
return currentDataStore;
|
|
25
|
-
}
|
|
26
|
-
/** Sets current data store. */
|
|
27
|
-
function setCurrentDataStore(store) {
|
|
28
|
-
const previousStore = currentDataStore;
|
|
29
|
-
currentDataStore = store;
|
|
30
|
-
return previousStore;
|
|
31
|
-
}
|
|
32
|
-
/** Marks data resource error. */
|
|
33
|
-
function markDataResourceError(error, key) {
|
|
34
|
-
if (!isAttributableError(error)) return;
|
|
35
|
-
let keys = objectDataErrors.get(error);
|
|
36
|
-
if (keys === void 0) {
|
|
37
|
-
keys = [];
|
|
38
|
-
objectDataErrors.set(error, keys);
|
|
39
|
-
}
|
|
40
|
-
if (keys.some((existing) => sameDataResourceKey(existing, key))) return;
|
|
41
|
-
keys.push(key);
|
|
42
|
-
}
|
|
43
|
-
/** Data resource keys for error. */
|
|
44
|
-
function dataResourceKeysForError(error) {
|
|
45
|
-
if (!isAttributableError(error)) return void 0;
|
|
46
|
-
const keys = objectDataErrors.get(error);
|
|
47
|
-
return keys === void 0 || keys.length === 0 ? void 0 : [...keys];
|
|
48
|
-
}
|
|
49
|
-
function sameDataResourceKey(a, b) {
|
|
50
|
-
return a.length === b.length && a.every((value, index) => Object.is(value, b[index]));
|
|
51
|
-
}
|
|
52
|
-
function isAttributableError(value) {
|
|
53
|
-
return (typeof value === "object" || typeof value === "function") && value !== null;
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
1
|
//#region src/hooks.ts
|
|
57
2
|
let currentDispatcher = null;
|
|
58
3
|
/** Returns state. */
|
|
@@ -119,6 +64,10 @@ function useStableEvent(handler) {
|
|
|
119
64
|
function readContext(context) {
|
|
120
65
|
return resolveDispatcher("readContext can only be called while rendering a component.").readContext(context);
|
|
121
66
|
}
|
|
67
|
+
/** Marks the current component as requiring browser rendering. */
|
|
68
|
+
function readBrowser(reason) {
|
|
69
|
+
resolveDispatcher("readBrowser can only be called while rendering a component.").readBrowser(reason);
|
|
70
|
+
}
|
|
122
71
|
/** Reads promise. */
|
|
123
72
|
function readPromise(promise) {
|
|
124
73
|
return resolveDispatcher("readPromise can only be called while rendering a component.").readPromise(promise);
|
|
@@ -127,14 +76,6 @@ function readPromise(promise) {
|
|
|
127
76
|
function readData(resource, ...args) {
|
|
128
77
|
return resolveDispatcher("readData can only be called while rendering a component.").readData(resource, args);
|
|
129
78
|
}
|
|
130
|
-
/** Preloads data. */
|
|
131
|
-
function preloadData(resource, ...args) {
|
|
132
|
-
if (currentDispatcher !== null) {
|
|
133
|
-
currentDispatcher.preloadData(resource, args);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
resolveDataStore().preloadData(resource, ...args);
|
|
137
|
-
}
|
|
138
79
|
/** Sets current dispatcher. */
|
|
139
80
|
function setCurrentDispatcher(dispatcher) {
|
|
140
81
|
const previousDispatcher = currentDispatcher;
|
|
@@ -145,9 +86,6 @@ function resolveDispatcher(message = "Hooks can only be called while rendering a
|
|
|
145
86
|
if (currentDispatcher === null) throw new Error(message);
|
|
146
87
|
return currentDispatcher;
|
|
147
88
|
}
|
|
148
|
-
function resolveDataStore() {
|
|
149
|
-
return resolveCurrentDataStore("No ambient Fig data store. Data APIs work synchronously during render, event handlers, actions, and effects — not after an await. Capture readDataStore() (or root.data) synchronously and call the handle instead.");
|
|
150
|
-
}
|
|
151
89
|
//#endregion
|
|
152
90
|
//#region src/mixin.ts
|
|
153
91
|
/** The Fig mixin symbol. */
|
|
@@ -170,6 +108,7 @@ function resolveHostMix(type, input) {
|
|
|
170
108
|
const mix = props.mix;
|
|
171
109
|
delete props.mix;
|
|
172
110
|
let resolvedMixins = 0;
|
|
111
|
+
let owners;
|
|
173
112
|
function resolve(value, slot) {
|
|
174
113
|
if (emptyMixinValue(value)) return;
|
|
175
114
|
if (Array.isArray(value)) {
|
|
@@ -182,7 +121,8 @@ function resolveHostMix(type, input) {
|
|
|
182
121
|
const context = {
|
|
183
122
|
[FigMixinSlotSymbol]: slot,
|
|
184
123
|
props,
|
|
185
|
-
type
|
|
124
|
+
type,
|
|
125
|
+
owns: (prop) => owners?.get(prop) === slot
|
|
186
126
|
};
|
|
187
127
|
const result = value.type(context, ...value.args);
|
|
188
128
|
if (emptyMixinValue(result)) return;
|
|
@@ -195,6 +135,8 @@ function resolveHostMix(type, input) {
|
|
|
195
135
|
if ("children" in returnedProps || "key" in returnedProps || "unsafeHTML" in returnedProps) throw new Error(`A mixin on <${type}> cannot return children, key, or unsafeHTML.`);
|
|
196
136
|
const { mix: nestedMix, ...patch } = returnedProps;
|
|
197
137
|
Object.assign(props, patch);
|
|
138
|
+
owners ??= /* @__PURE__ */ new Map();
|
|
139
|
+
for (const name of Object.keys(patch)) owners.set(name, slot);
|
|
198
140
|
resolve(nestedMix, `${slot}.mix`);
|
|
199
141
|
}
|
|
200
142
|
resolve(mix, "0");
|
|
@@ -357,6 +299,6 @@ function hasFunctionBrand(value, brand) {
|
|
|
357
299
|
return typeof value === "function" && "$$typeof" in value && value.$$typeof === brand;
|
|
358
300
|
}
|
|
359
301
|
//#endregion
|
|
360
|
-
export {
|
|
302
|
+
export { 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, readBrowser as P, setCurrentDispatcher as R, isPortal as S, isViewTransition as T, useDeferredValue as U, useBeforePaint as V, useId as W, useTransition as X, useSyncExternalStore as Y, createPortalNode as _, FigAssetsSymbol as a, isClientReference as b, FigErrorBoundarySymbol as c, FigViewTransitionSymbol as d, Fragment as f, createElement as g, clientReference as h, FigActivitySymbol as i, markClientOnlyHostProps as j, createMixin as k, FigPortalSymbol as l, ViewTransition as m, Assets as n, FigClientReferenceSymbol as o, Suspense as p, useStableEvent as q, ErrorBoundary as r, FigElementSymbol as s, Activity as t, FigSuspenseSymbol as u, isActivity as v, isValidElement as w, isErrorBoundary as x, isAssets as y, useActionState as z };
|
|
361
303
|
|
|
362
|
-
//# sourceMappingURL=element-
|
|
304
|
+
//# sourceMappingURL=element-DpXdLgOZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-DpXdLgOZ.js","names":["runtimeType"],"sources":["../src/hooks.ts","../src/mixin.ts","../src/element.ts"],"sourcesContent":["import type { FigContext } from \"./context.ts\";\nimport type { DataResource } 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 why a component requires browser rendering. */\nexport type BrowserRenderReason = string | (() => 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 readBrowser(reason?: BrowserRenderReason): 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/** Marks the current component as requiring browser rendering. */\nexport function readBrowser(reason?: BrowserRenderReason): void {\n resolveDispatcher(\n \"readBrowser can only be called while rendering a component.\",\n ).readBrowser(reason);\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/** 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","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":";AA8FA,IAAI,oBAA6C;;AAGjD,SAAgB,SAAY,cAAkD;CAC5E,OAAO,kBAAkB,CAAC,CAAC,SAAS,YAAY;AAClD;;;;;;;;;;;;;;AAeA,SAAgB,eACd,QACA,cACuC;CACvC,OAAO,kBAAkB,CAAC,CAAC,eAAe,QAAQ,YAAY;AAChE;;AAGA,SAAgB,QAAgB;CAC9B,OAAO,kBAAkB,CAAC,CAAC,MAAM;AACnC;;AAGA,SAAgB,iBAAoB,OAAU,cAAqB;CACjE,OAAO,kBAAkB,CAAC,CAAC,iBACzB,OACA,cACA,UAAU,SAAS,CACrB;AACF;;AAGA,SAAgB,QAAW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