@bgub/fig 0.1.0-alpha.1 → 0.1.0-alpha.3
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 +44 -0
- package/dist/{element-BZ7r9ncY.d.ts → element-BVg1bKOz.d.ts} +4 -1
- package/dist/{hooks-QDRabULx.d.ts → hooks-B7BTQWiu.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +6 -3
- package/dist/internal.js +2 -1
- package/dist/internal.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/payload-format-KTNaSI4h.js.map +1 -1
- package/dist/payload.d.ts +1 -1
- package/dist/payload.js +1 -1
- package/dist/{resource-kXeIR52S.js → resource-DskjKeuM.js} +28 -17
- package/dist/resource-DskjKeuM.js.map +1 -0
- package/dist-development/element-B7mCQIMi.js +314 -0
- package/dist-development/element-B7mCQIMi.js.map +1 -0
- package/dist-development/index.js +4 -0
- package/dist-development/internal.js +172 -0
- package/dist-development/internal.js.map +1 -0
- package/dist-development/jsx-runtime.js +23 -0
- package/dist-development/jsx-runtime.js.map +1 -0
- package/dist-development/payload-format-KTNaSI4h.js +366 -0
- package/dist-development/payload-format-KTNaSI4h.js.map +1 -0
- package/dist-development/payload.js +429 -0
- package/dist-development/payload.js.map +1 -0
- package/dist-development/resource-CP2OynG0.js +336 -0
- package/dist-development/resource-CP2OynG0.js.map +1 -0
- package/dist-development/transition-B4XiOWAj.js +750 -0
- package/dist-development/transition-B4XiOWAj.js.map +1 -0
- package/package.json +7 -1
- package/dist/resource-kXeIR52S.js.map +0 -1
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { g as createElement, n as Assets } from "./element-B7mCQIMi.js";
|
|
2
|
+
//#region src/thenables.ts
|
|
3
|
+
const thenableRecords = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function recordFor(thenable) {
|
|
5
|
+
const key = thenable;
|
|
6
|
+
let record = thenableRecords.get(key);
|
|
7
|
+
if (record === void 0) {
|
|
8
|
+
record = { status: "pending" };
|
|
9
|
+
thenableRecords.set(key, record);
|
|
10
|
+
thenable.then((value) => {
|
|
11
|
+
record = {
|
|
12
|
+
status: "fulfilled",
|
|
13
|
+
value
|
|
14
|
+
};
|
|
15
|
+
thenableRecords.set(key, record);
|
|
16
|
+
}, (reason) => {
|
|
17
|
+
record = {
|
|
18
|
+
reason,
|
|
19
|
+
status: "rejected"
|
|
20
|
+
};
|
|
21
|
+
thenableRecords.set(key, record);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return record;
|
|
25
|
+
}
|
|
26
|
+
function trackThenable(thenable) {
|
|
27
|
+
recordFor(thenable);
|
|
28
|
+
}
|
|
29
|
+
function readThenable(thenable) {
|
|
30
|
+
const record = recordFor(thenable);
|
|
31
|
+
if (record.status === "fulfilled") return record.value;
|
|
32
|
+
if (record.status === "rejected") throw record.reason;
|
|
33
|
+
throw thenable;
|
|
34
|
+
}
|
|
35
|
+
function isThenable(value) {
|
|
36
|
+
if (typeof value !== "object" && typeof value !== "function" || value === null) return false;
|
|
37
|
+
return "then" in value && typeof value.then === "function";
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/resource.ts
|
|
41
|
+
const PreventAssetResourceHoistSymbol = Symbol.for("fig.prevent-asset-resource-hoist");
|
|
42
|
+
function assets(value, children) {
|
|
43
|
+
return createElement(Assets, { assets: value }, children);
|
|
44
|
+
}
|
|
45
|
+
function stylesheet(href, options = {}) {
|
|
46
|
+
return {
|
|
47
|
+
...options,
|
|
48
|
+
href,
|
|
49
|
+
kind: "stylesheet"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function preload(href, as, options = {}) {
|
|
53
|
+
return {
|
|
54
|
+
...options,
|
|
55
|
+
as,
|
|
56
|
+
href,
|
|
57
|
+
imagesrcset: as === "image" ? options.imagesrcset || void 0 : void 0,
|
|
58
|
+
kind: "preload"
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function modulepreload(href, options = {}) {
|
|
62
|
+
return {
|
|
63
|
+
...options,
|
|
64
|
+
href,
|
|
65
|
+
kind: "modulepreload"
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function script(src, options = {}) {
|
|
69
|
+
return {
|
|
70
|
+
...options,
|
|
71
|
+
kind: "script",
|
|
72
|
+
src
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function font(href, type, options = {}) {
|
|
76
|
+
return {
|
|
77
|
+
...options,
|
|
78
|
+
href,
|
|
79
|
+
kind: "font",
|
|
80
|
+
type
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function preconnect(href, options = {}) {
|
|
84
|
+
return {
|
|
85
|
+
...options,
|
|
86
|
+
href,
|
|
87
|
+
kind: "preconnect"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function title(value) {
|
|
91
|
+
return {
|
|
92
|
+
kind: "title",
|
|
93
|
+
value
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function meta(options) {
|
|
97
|
+
return {
|
|
98
|
+
...options,
|
|
99
|
+
kind: "meta"
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function isFigAssetResource(value) {
|
|
103
|
+
if (typeof value !== "object" || value === null || !("kind" in value)) return false;
|
|
104
|
+
switch (value.kind) {
|
|
105
|
+
case "stylesheet":
|
|
106
|
+
case "preload":
|
|
107
|
+
case "modulepreload":
|
|
108
|
+
case "script":
|
|
109
|
+
case "font":
|
|
110
|
+
case "preconnect":
|
|
111
|
+
case "title":
|
|
112
|
+
case "meta": return true;
|
|
113
|
+
default: return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function clientReferenceAssets(reference) {
|
|
117
|
+
const value = reference.assets;
|
|
118
|
+
if (value === void 0) return [];
|
|
119
|
+
const list = typeof value === "function" ? value() : value;
|
|
120
|
+
if (isFigAssetResource(list)) return [list];
|
|
121
|
+
return Array.isArray(list) ? list : [];
|
|
122
|
+
}
|
|
123
|
+
function assetResourceKey(resource) {
|
|
124
|
+
if (resource.kind === "title") return "title";
|
|
125
|
+
if (resource.kind === "font" && resource.key !== void 0) return `preload:${resource.key}`;
|
|
126
|
+
if (resource.key !== void 0) return `${resource.kind}:${resource.key}`;
|
|
127
|
+
switch (resource.kind) {
|
|
128
|
+
case "stylesheet": return `stylesheet:${resource.href}`;
|
|
129
|
+
case "preload": {
|
|
130
|
+
const imagesrcset = resource.imagesrcset || void 0;
|
|
131
|
+
return `preload:${resource.as}:${imagesrcset === void 0 ? resource.href ?? "" : `${imagesrcset}\n${resource.imagesizes ?? ""}`}`;
|
|
132
|
+
}
|
|
133
|
+
case "modulepreload": return `modulepreload:${resource.href}`;
|
|
134
|
+
case "script": return `script:${resource.src}`;
|
|
135
|
+
case "font": return `preload:font:${resource.href}`;
|
|
136
|
+
case "preconnect": return `preconnect:${resource.href}`;
|
|
137
|
+
case "meta": return metaResourceKey(resource);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function assetResourceDestination(resource) {
|
|
141
|
+
return resource.kind === "title" || resource.kind === "meta" ? "head" : "stream";
|
|
142
|
+
}
|
|
143
|
+
function assetResourceFromHostProps(type, props) {
|
|
144
|
+
if (props[PreventAssetResourceHoistSymbol] === true) return null;
|
|
145
|
+
return resourceFromHost(type, (name) => props[name], props.children, true);
|
|
146
|
+
}
|
|
147
|
+
function preventAssetResourceHoist(props) {
|
|
148
|
+
Object.defineProperty(props, PreventAssetResourceHoistSymbol, {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
value: true
|
|
151
|
+
});
|
|
152
|
+
return props;
|
|
153
|
+
}
|
|
154
|
+
function assetResourceFromHostAttributes(type, getAttribute) {
|
|
155
|
+
return resourceFromHost(type, getAttribute, void 0, false);
|
|
156
|
+
}
|
|
157
|
+
function assetResourceHostAttributes(resource) {
|
|
158
|
+
const pairs = [];
|
|
159
|
+
switch (resource.kind) {
|
|
160
|
+
case "stylesheet":
|
|
161
|
+
pairs.push(["rel", "stylesheet"], ["href", resource.href], ["data-fig-resource-key", resource.key], ["data-precedence", resource.precedence], ["media", resource.media], ["crossorigin", resource.crossorigin]);
|
|
162
|
+
break;
|
|
163
|
+
case "preload": {
|
|
164
|
+
const imagesrcset = resource.imagesrcset || void 0;
|
|
165
|
+
pairs.push(["rel", "preload"], ["href", imagesrcset === void 0 ? resource.href : void 0], ["as", resource.as], ["data-fig-resource-key", resource.key], ["type", resource.type], ["crossorigin", resource.crossorigin], ["fetchpriority", resource.fetchpriority], ["imagesrcset", imagesrcset], ["imagesizes", resource.imagesizes], ["referrerpolicy", resource.referrerpolicy]);
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case "modulepreload":
|
|
169
|
+
pairs.push(["rel", "modulepreload"], ["href", resource.href], ["data-fig-resource-key", resource.key], ["crossorigin", resource.crossorigin], ["fetchpriority", resource.fetchpriority]);
|
|
170
|
+
break;
|
|
171
|
+
case "font":
|
|
172
|
+
pairs.push(["rel", "preload"], ["href", resource.href], ["as", "font"], ["data-fig-resource-key", resource.key], ["type", resource.type], ["crossorigin", resource.crossorigin ?? "anonymous"], ["fetchpriority", resource.fetchpriority]);
|
|
173
|
+
break;
|
|
174
|
+
case "preconnect":
|
|
175
|
+
pairs.push(["rel", "preconnect"], ["href", resource.href], ["data-fig-resource-key", resource.key], ["crossorigin", resource.crossorigin]);
|
|
176
|
+
break;
|
|
177
|
+
case "script":
|
|
178
|
+
pairs.push(["src", resource.src], ["type", resource.module === true ? "module" : void 0], ["data-fig-resource-key", resource.key], ["async", resource.async ?? resource.defer !== true ? true : void 0], ["defer", resource.defer === true ? true : void 0], ["crossorigin", resource.crossorigin]);
|
|
179
|
+
break;
|
|
180
|
+
case "title":
|
|
181
|
+
case "meta": break;
|
|
182
|
+
}
|
|
183
|
+
return pairs.filter((pair) => pair[1] !== void 0);
|
|
184
|
+
}
|
|
185
|
+
function resourceFromHost(type, prop, children, requireAsyncScript = false) {
|
|
186
|
+
const withKey = (resource) => {
|
|
187
|
+
if (resource === null) return null;
|
|
188
|
+
const key = readProp(prop, "data-fig-resource-key");
|
|
189
|
+
return key === void 0 ? resource : {
|
|
190
|
+
...resource,
|
|
191
|
+
key
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
switch (type.toLowerCase()) {
|
|
195
|
+
case "title":
|
|
196
|
+
if (readProp(prop, "itemprop") !== void 0) return null;
|
|
197
|
+
return withKey({
|
|
198
|
+
kind: "title",
|
|
199
|
+
value: textResourceValue(children)
|
|
200
|
+
});
|
|
201
|
+
case "meta":
|
|
202
|
+
if (readProp(prop, "itemprop") !== void 0) return null;
|
|
203
|
+
return withKey(metaResourceFromHost(prop));
|
|
204
|
+
case "link": return withKey(linkResourceFromHost(prop));
|
|
205
|
+
case "script": {
|
|
206
|
+
const src = readProp(prop, "src");
|
|
207
|
+
const async = hasBooleanAttribute(prop("async"));
|
|
208
|
+
if (src === void 0 || requireAsyncScript && !async) return null;
|
|
209
|
+
return withKey({
|
|
210
|
+
async,
|
|
211
|
+
crossorigin: readCrossorigin(prop),
|
|
212
|
+
defer: hasBooleanAttribute(prop("defer")),
|
|
213
|
+
kind: "script",
|
|
214
|
+
module: prop("type") === "module",
|
|
215
|
+
src
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
default: return null;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function metaResourceFromHost(prop) {
|
|
222
|
+
const charset = readProp(prop, "charset");
|
|
223
|
+
const httpEquiv = readProp(prop, "http-equiv");
|
|
224
|
+
const name = readProp(prop, "name");
|
|
225
|
+
const property = readProp(prop, "property");
|
|
226
|
+
if ([
|
|
227
|
+
charset,
|
|
228
|
+
httpEquiv,
|
|
229
|
+
name,
|
|
230
|
+
property
|
|
231
|
+
].filter((value) => value !== void 0).length !== 1) return null;
|
|
232
|
+
if (charset !== void 0) return {
|
|
233
|
+
charset,
|
|
234
|
+
kind: "meta"
|
|
235
|
+
};
|
|
236
|
+
const content = readProp(prop, "content");
|
|
237
|
+
if (content === void 0) return null;
|
|
238
|
+
if (httpEquiv !== void 0) return {
|
|
239
|
+
content,
|
|
240
|
+
"http-equiv": httpEquiv,
|
|
241
|
+
kind: "meta"
|
|
242
|
+
};
|
|
243
|
+
if (name !== void 0) return {
|
|
244
|
+
content,
|
|
245
|
+
kind: "meta",
|
|
246
|
+
name
|
|
247
|
+
};
|
|
248
|
+
if (property !== void 0) return {
|
|
249
|
+
content,
|
|
250
|
+
kind: "meta",
|
|
251
|
+
property
|
|
252
|
+
};
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
function hasBooleanAttribute(value) {
|
|
256
|
+
return value !== void 0 && value !== null && value !== false;
|
|
257
|
+
}
|
|
258
|
+
function linkResourceFromHost(prop) {
|
|
259
|
+
const rel = readProp(prop, "rel")?.toLowerCase();
|
|
260
|
+
const href = readProp(prop, "href");
|
|
261
|
+
if (rel === void 0 || readProp(prop, "itemprop") !== void 0) return null;
|
|
262
|
+
if (rel === "preload") {
|
|
263
|
+
const as = readProp(prop, "as");
|
|
264
|
+
const imagesrcset = as === "image" ? readProp(prop, "imagesrcset") || void 0 : void 0;
|
|
265
|
+
if (as === void 0 || href === void 0 && imagesrcset === void 0) return null;
|
|
266
|
+
return {
|
|
267
|
+
as,
|
|
268
|
+
crossorigin: readCrossorigin(prop),
|
|
269
|
+
fetchpriority: fetchpriorityProp(readProp(prop, "fetchpriority")),
|
|
270
|
+
href,
|
|
271
|
+
imagesizes: imagesrcset === void 0 ? void 0 : readProp(prop, "imagesizes"),
|
|
272
|
+
imagesrcset,
|
|
273
|
+
kind: "preload",
|
|
274
|
+
referrerpolicy: readProp(prop, "referrerpolicy"),
|
|
275
|
+
type: readProp(prop, "type")
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
if (href === void 0) return null;
|
|
279
|
+
if (rel === "stylesheet") return {
|
|
280
|
+
blocking: prop("blocking") === "none" ? "none" : void 0,
|
|
281
|
+
crossorigin: readCrossorigin(prop),
|
|
282
|
+
href,
|
|
283
|
+
kind: "stylesheet",
|
|
284
|
+
media: readProp(prop, "media"),
|
|
285
|
+
precedence: readProp(prop, "precedence", "data-precedence")
|
|
286
|
+
};
|
|
287
|
+
if (rel === "modulepreload") return {
|
|
288
|
+
crossorigin: readCrossorigin(prop),
|
|
289
|
+
fetchpriority: fetchpriorityProp(readProp(prop, "fetchpriority")),
|
|
290
|
+
href,
|
|
291
|
+
kind: "modulepreload"
|
|
292
|
+
};
|
|
293
|
+
if (rel === "preconnect") return {
|
|
294
|
+
crossorigin: readCrossorigin(prop),
|
|
295
|
+
href,
|
|
296
|
+
kind: "preconnect"
|
|
297
|
+
};
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
function readProp(prop, ...names) {
|
|
301
|
+
for (const name of names) {
|
|
302
|
+
const value = stringProp(prop(name));
|
|
303
|
+
if (value !== void 0) return value;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function stringProp(value) {
|
|
307
|
+
if (value === void 0 || value === null || value === false) return void 0;
|
|
308
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || value === true) return String(value);
|
|
309
|
+
throw new Error("Resource host props must be serializable during server render.");
|
|
310
|
+
}
|
|
311
|
+
function readCrossorigin(prop) {
|
|
312
|
+
return crossoriginProp(readProp(prop, "crossorigin"));
|
|
313
|
+
}
|
|
314
|
+
function crossoriginProp(value) {
|
|
315
|
+
return value === "anonymous" || value === "use-credentials" || value === "" ? value : void 0;
|
|
316
|
+
}
|
|
317
|
+
function fetchpriorityProp(value) {
|
|
318
|
+
return value === "high" || value === "low" || value === "auto" ? value : void 0;
|
|
319
|
+
}
|
|
320
|
+
function textResourceValue(node) {
|
|
321
|
+
if (node === null || node === void 0 || typeof node === "boolean") return "";
|
|
322
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
323
|
+
if (Array.isArray(node)) return node.map(textResourceValue).join("");
|
|
324
|
+
if (isThenable(node)) return textResourceValue(readThenable(node));
|
|
325
|
+
throw new Error("<title> can only contain text during server render.");
|
|
326
|
+
}
|
|
327
|
+
function metaResourceKey(resource) {
|
|
328
|
+
if (resource.charset !== void 0) return `meta:charset:${resource.charset}`;
|
|
329
|
+
if (resource.name !== void 0) return `meta:name:${resource.name}`;
|
|
330
|
+
if (resource.property !== void 0) return `meta:property:${resource.property}`;
|
|
331
|
+
return `meta:http-equiv:${resource["http-equiv"]}`;
|
|
332
|
+
}
|
|
333
|
+
//#endregion
|
|
334
|
+
export { title as _, assetResourceKey as a, trackThenable as b, font as c, modulepreload as d, preconnect as f, stylesheet as g, script as h, assetResourceHostAttributes as i, isFigAssetResource as l, preventAssetResourceHoist as m, assetResourceFromHostAttributes as n, assets as o, preload as p, assetResourceFromHostProps as r, clientReferenceAssets as s, assetResourceDestination as t, meta as u, isThenable as v, readThenable as y };
|
|
335
|
+
|
|
336
|
+
//# sourceMappingURL=resource-CP2OynG0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-CP2OynG0.js","names":[],"sources":["../src/thenables.ts","../src/resource.ts"],"sourcesContent":["export type Thenable<T = unknown> = PromiseLike<T> & object;\n\ntype ThenableRecord<T> =\n | { status: \"pending\" }\n | { status: \"fulfilled\"; value: T }\n | { status: \"rejected\"; reason: unknown };\n\n// One process-wide registry keyed by thenable identity: the reconciler's\n// readPromise, the server renderers' dispatchers, and preloaders all share\n// it, so suspend/settle semantics cannot drift between client and server.\nconst thenableRecords = new WeakMap<object, ThenableRecord<unknown>>();\n\nfunction recordFor<T>(thenable: PromiseLike<T>): ThenableRecord<T> {\n const key = thenable as Thenable<T>;\n let record = thenableRecords.get(key) as ThenableRecord<T> | undefined;\n\n if (record === undefined) {\n record = { status: \"pending\" };\n thenableRecords.set(key, record);\n thenable.then(\n (value) => {\n record = { status: \"fulfilled\", value };\n thenableRecords.set(key, record);\n },\n (reason: unknown) => {\n record = { reason, status: \"rejected\" };\n thenableRecords.set(key, record);\n },\n );\n }\n\n return record;\n}\n\n// Starts tracking without reading. Preloaders call this when they begin a\n// load so that a thenable settled before its first render read resolves\n// synchronously instead of suspending for one retry beat.\nexport function trackThenable<T>(thenable: PromiseLike<T>): void {\n recordFor(thenable);\n}\n\nexport function readThenable<T>(thenable: PromiseLike<T>): T {\n const record = recordFor(thenable);\n if (record.status === \"fulfilled\") return record.value;\n if (record.status === \"rejected\") throw record.reason;\n throw thenable;\n}\n\nexport function isThenable(value: unknown): value is Thenable {\n if (\n (typeof value !== \"object\" && typeof value !== \"function\") ||\n value === null\n ) {\n return false;\n }\n\n return \"then\" in value && typeof value.then === \"function\";\n}\n","import {\n Assets,\n createElement,\n type FigClientReference,\n type FigElement,\n type FigNode,\n type Props,\n} from \"./element.ts\";\nimport { isThenable, readThenable } from \"./thenables.ts\";\n\nconst PreventAssetResourceHoistSymbol = Symbol.for(\n \"fig.prevent-asset-resource-hoist\",\n);\ntype AssetResourceHostProps = Props & {\n [PreventAssetResourceHoistSymbol]?: true;\n};\n\nexport type AssetResourceBlocking = \"reveal\" | \"none\";\nexport type CrossOrigin = \"anonymous\" | \"use-credentials\" | \"\";\nexport type FetchPriority = \"high\" | \"low\" | \"auto\";\nexport type AssetResourceDestination = \"head\" | \"stream\";\n\nexport type FigAssetResource =\n | StylesheetResource\n | PreloadResource\n | ModulePreloadResource\n | ScriptResource\n | FontResource\n | PreconnectResource\n | TitleResource\n | MetaResource;\n\ninterface ResourceBase {\n key?: string;\n}\n\nexport interface StylesheetResource extends ResourceBase {\n blocking?: AssetResourceBlocking;\n crossorigin?: CrossOrigin;\n href: string;\n kind: \"stylesheet\";\n media?: string;\n precedence?: string;\n}\n\nexport interface PreloadResource extends ResourceBase {\n as: string;\n crossorigin?: CrossOrigin;\n fetchpriority?: FetchPriority;\n href?: string;\n imagesizes?: string;\n imagesrcset?: string;\n kind: \"preload\";\n referrerpolicy?: string;\n type?: string;\n}\n\nexport interface ModulePreloadResource extends ResourceBase {\n crossorigin?: CrossOrigin;\n fetchpriority?: FetchPriority;\n href: string;\n kind: \"modulepreload\";\n}\n\nexport interface ScriptResource extends ResourceBase {\n async?: boolean;\n crossorigin?: CrossOrigin;\n defer?: boolean;\n kind: \"script\";\n module?: boolean;\n src: string;\n}\n\nexport interface FontResource extends ResourceBase {\n crossorigin?: CrossOrigin;\n fetchpriority?: FetchPriority;\n href: string;\n kind: \"font\";\n type: string;\n}\n\nexport interface PreconnectResource extends ResourceBase {\n crossorigin?: CrossOrigin;\n href: string;\n kind: \"preconnect\";\n}\n\nexport interface TitleResource extends ResourceBase {\n kind: \"title\";\n value: string;\n}\n\ninterface MetaResourceBase extends ResourceBase {\n kind: \"meta\";\n}\n\ntype DistributiveOmit<Value, Key extends PropertyKey> = Value extends unknown\n ? Omit<Value, Key>\n : never;\n\nexport type MetaResource =\n | (MetaResourceBase & {\n charset: string;\n content?: never;\n \"http-equiv\"?: never;\n name?: never;\n property?: never;\n })\n | (MetaResourceBase & {\n charset?: never;\n content: string;\n \"http-equiv\"?: never;\n name: string;\n property?: never;\n })\n | (MetaResourceBase & {\n charset?: never;\n content: string;\n \"http-equiv\"?: never;\n name?: never;\n property: string;\n })\n | (MetaResourceBase & {\n charset?: never;\n content: string;\n \"http-equiv\": string;\n name?: never;\n property?: never;\n });\n\nexport type MetaResourceOptions = DistributiveOmit<MetaResource, \"kind\">;\n\nexport type FigAssetResourceList =\n | FigAssetResource\n | readonly FigAssetResource[];\n\n// Asset resources a client reference contributes when it renders. Eager for\n// hand-written lists; a thunk for bundler-manifest resolution that may not be\n// available until serialization time, or that maps paths differently per build.\nexport type ClientReferenceAssets =\n | FigAssetResourceList\n | (() => FigAssetResourceList);\n\nexport interface AssetsProps {\n assets: FigAssetResourceList;\n children?: FigNode;\n}\n\nexport function assets(\n value: FigAssetResourceList,\n children?: FigNode,\n): FigElement<AssetsProps> {\n return createElement(Assets, { assets: value }, children);\n}\n\nexport function stylesheet(\n href: string,\n options: Omit<StylesheetResource, \"href\" | \"kind\"> = {},\n): StylesheetResource {\n return { ...options, href, kind: \"stylesheet\" };\n}\n\nexport function preload(\n href: string,\n as: string,\n options: Omit<PreloadResource, \"as\" | \"href\" | \"kind\"> = {},\n): PreloadResource {\n return {\n ...options,\n as,\n href,\n imagesrcset: as === \"image\" ? options.imagesrcset || undefined : undefined,\n kind: \"preload\",\n };\n}\n\nexport function modulepreload(\n href: string,\n options: Omit<ModulePreloadResource, \"href\" | \"kind\"> = {},\n): ModulePreloadResource {\n return { ...options, href, kind: \"modulepreload\" };\n}\n\nexport function script(\n src: string,\n options: Omit<ScriptResource, \"kind\" | \"src\"> = {},\n): ScriptResource {\n return { ...options, kind: \"script\", src };\n}\n\nexport function font(\n href: string,\n type: string,\n options: Omit<FontResource, \"href\" | \"kind\" | \"type\"> = {},\n): FontResource {\n return { ...options, href, kind: \"font\", type };\n}\n\nexport function preconnect(\n href: string,\n options: Omit<PreconnectResource, \"href\" | \"kind\"> = {},\n): PreconnectResource {\n return { ...options, href, kind: \"preconnect\" };\n}\n\nexport function title(value: string): TitleResource {\n return { kind: \"title\", value };\n}\n\nexport function meta(options: MetaResourceOptions): MetaResource {\n return { ...options, kind: \"meta\" };\n}\n\nexport function isFigAssetResource(value: unknown): value is FigAssetResource {\n if (typeof value !== \"object\" || value === null || !(\"kind\" in value)) {\n return false;\n }\n\n switch (value.kind) {\n case \"stylesheet\":\n case \"preload\":\n case \"modulepreload\":\n case \"script\":\n case \"font\":\n case \"preconnect\":\n case \"title\":\n case \"meta\":\n return true;\n default:\n return false;\n }\n}\n\nexport function clientReferenceAssets(\n reference: FigClientReference,\n): readonly FigAssetResource[] {\n const value = reference.assets;\n if (value === undefined) return [];\n\n // Resolved on each call rather than memoized: a lazy resolver may read a\n // manifest that is not loaded until serialization, and a consumer that wants\n // to cache can do so against the stable reference identity.\n const list = typeof value === \"function\" ? value() : value;\n if (isFigAssetResource(list)) return [list];\n // A thunk that yields nothing (e.g. a missing manifest entry) normalizes to an\n // empty list rather than leaking a non-array through the readonly contract.\n return Array.isArray(list) ? list : [];\n}\n\nexport function assetResourceKey(resource: FigAssetResource): string {\n // A document carries a single <title>; collapse every title to one key even\n // when an author supplies an explicit key, so the singleton invariant cannot\n // be bypassed into emitting multiple <title> elements (invalid HTML).\n if (resource.kind === \"title\") return \"title\";\n\n // A font is serialized and inserted as <link rel=\"preload\" as=\"font\">, so an\n // explicit key must also live in the preload key space.\n if (resource.kind === \"font\" && resource.key !== undefined)\n return `preload:${resource.key}`;\n\n if (resource.key !== undefined) return `${resource.kind}:${resource.key}`;\n\n switch (resource.kind) {\n case \"stylesheet\":\n return `stylesheet:${resource.href}`;\n case \"preload\": {\n const imagesrcset = resource.imagesrcset || undefined;\n return `preload:${resource.as}:${\n imagesrcset === undefined\n ? (resource.href ?? \"\")\n : `${imagesrcset}\\n${resource.imagesizes ?? \"\"}`\n }`;\n }\n case \"modulepreload\":\n return `modulepreload:${resource.href}`;\n case \"script\":\n return `script:${resource.src}`;\n case \"font\":\n // A font is loaded as <link rel=\"preload\" as=\"font\">, so it must share the\n // preload-font key space across every package (SSR registry, payload record,\n // client insert) — otherwise a font() and an equivalent preload(href,\n // \"font\") would key separately and fail to dedupe.\n return `preload:font:${resource.href}`;\n case \"preconnect\":\n return `preconnect:${resource.href}`;\n case \"meta\":\n return metaResourceKey(resource);\n }\n}\n\nexport function assetResourceDestination(\n resource: FigAssetResource,\n): AssetResourceDestination {\n return resource.kind === \"title\" || resource.kind === \"meta\"\n ? \"head\"\n : \"stream\";\n}\n\nexport function assetResourceFromHostProps(\n type: string,\n props: Props,\n): FigAssetResource | null {\n if (\n (props as AssetResourceHostProps)[PreventAssetResourceHoistSymbol] === true\n ) {\n return null;\n }\n return resourceFromHost(type, (name) => props[name], props.children, true);\n}\n\nexport function preventAssetResourceHoist<P extends Props>(props: P): P {\n Object.defineProperty(props, PreventAssetResourceHoistSymbol, {\n enumerable: true,\n value: true,\n });\n return props;\n}\n\nexport function assetResourceFromHostAttributes(\n type: string,\n getAttribute: (name: string) => unknown,\n): FigAssetResource | null {\n return resourceFromHost(type, getAttribute, undefined, false);\n}\n\nexport type AssetResourceHostAttribute = readonly [\n name: string,\n value: string | true,\n];\n\n// Canonical attribute serialization for hoisted asset-resource elements,\n// shared by the server's registry writer and the client's head insertion so\n// the two renders cannot drift. `true` marks a boolean attribute (bare on\n// the server, empty-string in the DOM). Server-only attributes (id, nonce)\n// stay with the server writer; title/meta are written by their own paths.\nexport function assetResourceHostAttributes(\n resource: FigAssetResource,\n): AssetResourceHostAttribute[] {\n const pairs: Array<readonly [string, string | true | undefined]> = [];\n\n switch (resource.kind) {\n case \"stylesheet\":\n pairs.push(\n [\"rel\", \"stylesheet\"],\n [\"href\", resource.href],\n [\"data-fig-resource-key\", resource.key],\n [\"data-precedence\", resource.precedence],\n [\"media\", resource.media],\n [\"crossorigin\", resource.crossorigin],\n );\n break;\n case \"preload\": {\n const imagesrcset = resource.imagesrcset || undefined;\n pairs.push(\n [\"rel\", \"preload\"],\n [\"href\", imagesrcset === undefined ? resource.href : undefined],\n [\"as\", resource.as],\n [\"data-fig-resource-key\", resource.key],\n [\"type\", resource.type],\n [\"crossorigin\", resource.crossorigin],\n [\"fetchpriority\", resource.fetchpriority],\n [\"imagesrcset\", imagesrcset],\n [\"imagesizes\", resource.imagesizes],\n [\"referrerpolicy\", resource.referrerpolicy],\n );\n break;\n }\n case \"modulepreload\":\n pairs.push(\n [\"rel\", \"modulepreload\"],\n [\"href\", resource.href],\n [\"data-fig-resource-key\", resource.key],\n [\"crossorigin\", resource.crossorigin],\n [\"fetchpriority\", resource.fetchpriority],\n );\n break;\n case \"font\":\n pairs.push(\n [\"rel\", \"preload\"],\n [\"href\", resource.href],\n [\"as\", \"font\"],\n [\"data-fig-resource-key\", resource.key],\n [\"type\", resource.type],\n [\"crossorigin\", resource.crossorigin ?? \"anonymous\"],\n [\"fetchpriority\", resource.fetchpriority],\n );\n break;\n case \"preconnect\":\n pairs.push(\n [\"rel\", \"preconnect\"],\n [\"href\", resource.href],\n [\"data-fig-resource-key\", resource.key],\n [\"crossorigin\", resource.crossorigin],\n );\n break;\n case \"script\":\n pairs.push(\n [\"src\", resource.src],\n [\"type\", resource.module === true ? \"module\" : undefined],\n [\"data-fig-resource-key\", resource.key],\n // Hoisted scripts default to async, but an explicit defer opts into\n // ordered execution and must not be overridden (async wins over\n // defer in browsers).\n [\n \"async\",\n (resource.async ?? resource.defer !== true) ? true : undefined,\n ],\n [\"defer\", resource.defer === true ? true : undefined],\n [\"crossorigin\", resource.crossorigin],\n );\n break;\n case \"title\":\n case \"meta\":\n break;\n }\n\n return pairs.filter(\n (pair): pair is readonly [string, string | true] => pair[1] !== undefined,\n );\n}\n\nfunction resourceFromHost(\n type: string,\n prop: (name: string) => unknown,\n children?: FigNode,\n requireAsyncScript = false,\n): FigAssetResource | null {\n const withKey = (\n resource: FigAssetResource | null,\n ): FigAssetResource | null => {\n if (resource === null) return null;\n const key = readProp(prop, \"data-fig-resource-key\");\n return key === undefined ? resource : { ...resource, key };\n };\n\n switch (type.toLowerCase()) {\n case \"title\":\n if (readProp(prop, \"itemprop\") !== undefined) return null;\n return withKey({ kind: \"title\", value: textResourceValue(children) });\n case \"meta\":\n if (readProp(prop, \"itemprop\") !== undefined) return null;\n return withKey(metaResourceFromHost(prop));\n case \"link\":\n return withKey(linkResourceFromHost(prop));\n case \"script\": {\n const src = readProp(prop, \"src\");\n // A raw script keeps native placement and execution semantics unless the\n // author explicitly marks it async. Explicit script() descriptors remain\n // the opt-in path for hoisted defer, module, or synchronous scripts.\n const async = hasBooleanAttribute(prop(\"async\"));\n if (src === undefined || (requireAsyncScript && !async)) return null;\n return withKey({\n async,\n crossorigin: readCrossorigin(prop),\n defer: hasBooleanAttribute(prop(\"defer\")),\n kind: \"script\",\n module: prop(\"type\") === \"module\",\n src,\n });\n }\n default:\n return null;\n }\n}\n\nfunction metaResourceFromHost(\n prop: (name: string) => unknown,\n): MetaResource | null {\n const charset = readProp(prop, \"charset\");\n const httpEquiv = readProp(prop, \"http-equiv\");\n const name = readProp(prop, \"name\");\n const property = readProp(prop, \"property\");\n const identities = [charset, httpEquiv, name, property].filter(\n (value) => value !== undefined,\n );\n\n if (identities.length !== 1) return null;\n if (charset !== undefined) return { charset, kind: \"meta\" };\n\n const content = readProp(prop, \"content\");\n if (content === undefined) return null;\n if (httpEquiv !== undefined) {\n return { content, \"http-equiv\": httpEquiv, kind: \"meta\" };\n }\n if (name !== undefined) return { content, kind: \"meta\", name };\n if (property !== undefined) return { content, kind: \"meta\", property };\n return null;\n}\n\nfunction hasBooleanAttribute(value: unknown): boolean {\n return value !== undefined && value !== null && value !== false;\n}\n\nfunction linkResourceFromHost(\n prop: (name: string) => unknown,\n): FigAssetResource | null {\n const rel = readProp(prop, \"rel\")?.toLowerCase();\n const href = readProp(prop, \"href\");\n if (rel === undefined || readProp(prop, \"itemprop\") !== undefined) {\n return null;\n }\n\n if (rel === \"preload\") {\n const as = readProp(prop, \"as\");\n const imagesrcset =\n as === \"image\" ? readProp(prop, \"imagesrcset\") || undefined : undefined;\n if (as === undefined || (href === undefined && imagesrcset === undefined)) {\n return null;\n }\n return {\n as,\n crossorigin: readCrossorigin(prop),\n fetchpriority: fetchpriorityProp(readProp(prop, \"fetchpriority\")),\n href,\n imagesizes:\n imagesrcset === undefined ? undefined : readProp(prop, \"imagesizes\"),\n imagesrcset,\n kind: \"preload\",\n referrerpolicy: readProp(prop, \"referrerpolicy\"),\n type: readProp(prop, \"type\"),\n };\n }\n\n if (href === undefined) return null;\n\n if (rel === \"stylesheet\") {\n return {\n blocking: prop(\"blocking\") === \"none\" ? \"none\" : undefined,\n crossorigin: readCrossorigin(prop),\n href,\n kind: \"stylesheet\",\n media: readProp(prop, \"media\"),\n // Hoisted elements serialize the canonical data-precedence attribute;\n // host-rendered <link precedence> keeps the author-facing prop name.\n precedence: readProp(prop, \"precedence\", \"data-precedence\"),\n };\n }\n\n if (rel === \"modulepreload\") {\n return {\n crossorigin: readCrossorigin(prop),\n fetchpriority: fetchpriorityProp(readProp(prop, \"fetchpriority\")),\n href,\n kind: \"modulepreload\",\n };\n }\n\n if (rel === \"preconnect\") {\n return {\n crossorigin: readCrossorigin(prop),\n href,\n kind: \"preconnect\",\n };\n }\n\n return null;\n}\n\nfunction readProp(\n prop: (name: string) => unknown,\n ...names: string[]\n): string | undefined {\n for (const name of names) {\n const value = stringProp(prop(name));\n if (value !== undefined) return value;\n }\n\n return undefined;\n}\n\nfunction stringProp(value: unknown): string | undefined {\n if (value === undefined || value === null || value === false)\n return undefined;\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"bigint\" ||\n value === true\n ) {\n return String(value);\n }\n\n throw new Error(\n \"Resource host props must be serializable during server render.\",\n );\n}\n\nfunction readCrossorigin(\n prop: (name: string) => unknown,\n): CrossOrigin | undefined {\n return crossoriginProp(readProp(prop, \"crossorigin\"));\n}\n\nfunction crossoriginProp(value: unknown): CrossOrigin | undefined {\n return value === \"anonymous\" || value === \"use-credentials\" || value === \"\"\n ? value\n : undefined;\n}\n\nfunction fetchpriorityProp(value: unknown): FetchPriority | undefined {\n return value === \"high\" || value === \"low\" || value === \"auto\"\n ? value\n : undefined;\n}\n\nfunction textResourceValue(node: FigNode): string {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return \"\";\n }\n if (typeof node === \"string\" || typeof node === \"number\") return String(node);\n if (Array.isArray(node)) return node.map(textResourceValue).join(\"\");\n if (isThenable(node)) return textResourceValue(readThenable(node));\n\n throw new Error(\"<title> can only contain text during server render.\");\n}\n\nfunction metaResourceKey(resource: MetaResource): string {\n if (resource.charset !== undefined) return `meta:charset:${resource.charset}`;\n if (resource.name !== undefined) return `meta:name:${resource.name}`;\n if (resource.property !== undefined)\n return `meta:property:${resource.property}`;\n return `meta:http-equiv:${resource[\"http-equiv\"]}`;\n}\n"],"mappings":";;AAUA,MAAM,kCAAkB,IAAI,QAAyC;AAErE,SAAS,UAAa,UAA6C;CACjE,MAAM,MAAM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