octane 0.2.11 → 0.2.13
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/README.md +5 -0
- package/dist/behavior-root.d.ts +13 -3
- package/dist/behavior-root.js +28 -5
- package/dist/cjs/behavior-root.cjs +32 -6
- package/dist/cjs/class-names.cjs +49 -0
- package/dist/cjs/constants.cjs +9 -0
- package/dist/cjs/context-epoch.cjs +38 -0
- package/dist/cjs/css.cjs +6 -27
- package/dist/cjs/data-encoding.cjs +160 -0
- package/dist/cjs/dom-binding-handoff.cjs +93 -0
- package/dist/cjs/dom-binding-protocol.cjs +115 -0
- package/dist/cjs/dom-binding-styles.cjs +292 -0
- package/dist/cjs/dom-bindings.cjs +700 -0
- package/dist/cjs/dom-focused-move.cjs +66 -0
- package/dist/cjs/dom-stage.cjs +896 -0
- package/dist/cjs/dom-tables.cjs +4 -94
- package/dist/cjs/error-codes.client.generated.cjs +33 -0
- package/dist/cjs/error-codes.server.generated.cjs +24 -0
- package/dist/cjs/hydration/control-capture.cjs +244 -0
- package/dist/cjs/hydration/event-capture.cjs +125 -43
- package/dist/cjs/hydration/interaction-config.cjs +50 -2
- package/dist/cjs/hydration-markers.cjs +37 -0
- package/dist/cjs/independent-hydration-protocol.cjs +106 -0
- package/dist/cjs/index.cjs +9 -0
- package/dist/cjs/runtime.cjs +6397 -1683
- package/dist/cjs/runtime.server.cjs +1465 -213
- package/dist/cjs/server/early-signals.cjs +45 -0
- package/dist/cjs/server/index.cjs +47 -0
- package/dist/cjs/server/rpc-batch.cjs +149 -0
- package/dist/cjs/server/rpc-stream.cjs +146 -0
- package/dist/cjs/server/rpc.cjs +34 -15
- package/dist/cjs/server/signal-query-observation.cjs +158 -0
- package/dist/cjs/server/streamed-region.cjs +52 -0
- package/dist/cjs/server/streamed-signals.cjs +512 -0
- package/dist/cjs/server-call.cjs +103 -0
- package/dist/cjs/server-rpc-batch-client.cjs +141 -0
- package/dist/cjs/server-rpc-client.cjs +94 -27
- package/dist/cjs/server-rpc-protocol.cjs +141 -0
- package/dist/cjs/server-rpc-stream-client.cjs +118 -0
- package/dist/cjs/signals/actions.cjs +474 -0
- package/dist/cjs/signals/client.cjs +4 -1
- package/dist/cjs/signals/computations.cjs +460 -0
- package/dist/cjs/signals/control-binding.cjs +368 -0
- package/dist/cjs/signals/derived-facade.cjs +50 -0
- package/dist/cjs/signals/document-owner.cjs +71 -0
- package/dist/cjs/signals/early-values.cjs +155 -0
- package/dist/cjs/signals/encoding.cjs +6 -95
- package/dist/cjs/signals/engine.cjs +276 -12
- package/dist/cjs/signals/errors.cjs +18 -0
- package/dist/cjs/signals/facade.cjs +477 -0
- package/dist/cjs/signals/graph.cjs +166 -20
- package/dist/cjs/signals/handle-protocol.cjs +36 -0
- package/dist/cjs/signals/index.cjs +81 -2
- package/dist/cjs/signals/native-read-client.cjs +10 -0
- package/dist/cjs/signals/owner-context.cjs +112 -0
- package/dist/cjs/signals/query-attempt-observer.cjs +68 -0
- package/dist/cjs/signals/query-facade.cjs +72 -0
- package/dist/cjs/signals/read-protocol.cjs +54 -0
- package/dist/cjs/signals/requests.cjs +287 -14
- package/dist/cjs/signals/scalar-computations.cjs +76 -0
- package/dist/cjs/signals/server.cjs +4 -1
- package/dist/cjs/signals/transition-candidate.cjs +567 -0
- package/dist/cjs/signals/transition-state.cjs +106 -0
- package/dist/cjs/signals/types.cjs +50 -0
- package/dist/cjs/stream-protocol.cjs +3 -0
- package/dist/cjs/streamed-signals-protocol.cjs +159 -0
- package/dist/cjs/style-values.cjs +122 -0
- package/dist/cjs/trusted-html.cjs +30 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/class-names.d.ts +5 -0
- package/dist/class-names.js +25 -0
- package/dist/compiler/bundler.js +51 -22
- package/dist/compiler/compile.js +2534 -581
- package/dist/compiler/dom-binding-program.js +935 -0
- package/dist/compiler/dom-binding-request.js +57 -0
- package/dist/compiler/dom-bindings.js +2245 -0
- package/dist/compiler/hook-deps.js +759 -10
- package/dist/compiler/hydrate-boundaries.js +358 -15
- package/dist/compiler/index.d.ts +39 -2
- package/dist/compiler/index.js +1 -0
- package/dist/compiler/native-attribute-reads.js +127 -0
- package/dist/compiler/native-change-diagnostics.js +32 -38
- package/dist/compiler/native-read-diagnostics.js +69 -8
- package/dist/compiler/native-read-types.js +80 -34
- package/dist/compiler/parser.node.js +1 -1
- package/dist/compiler/renderer-boundaries.js +40 -0
- package/dist/compiler/server-context.js +118 -0
- package/dist/compiler/signal-attempt-reads.js +479 -0
- package/dist/compiler/signal-declarations.js +557 -0
- package/dist/compiler/signal-start-reads.js +413 -0
- package/dist/compiler/slot-hooks.d.ts +3 -1
- package/dist/compiler/slot-hooks.js +168 -34
- package/dist/compiler/strong-auto-memo.js +90 -0
- package/dist/compiler/strong-html.js +143 -0
- package/dist/compiler/strong-mode.js +764 -66
- package/dist/compiler/strong-template-policy.js +307 -0
- package/dist/compiler/template-ir.js +200 -0
- package/dist/compiler/typescript.d.ts +2 -0
- package/dist/compiler/typescript.js +2 -0
- package/dist/compiler/vite.d.ts +3 -1
- package/dist/compiler/vite.js +122 -4
- package/dist/compiler/volar.LICENSES.txt +1 -1
- package/dist/compiler/volar.d.ts +6 -1
- package/dist/compiler/volar.js +750 -1433
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +10 -0
- package/dist/context-epoch.d.ts +2 -0
- package/dist/context-epoch.js +13 -0
- package/dist/css.d.ts +2 -5
- package/dist/css.js +2 -23
- package/dist/data-encoding.d.ts +9 -0
- package/dist/data-encoding.js +134 -0
- package/dist/dom-binding-classes.d.ts +15 -0
- package/dist/dom-binding-classes.js +129 -0
- package/dist/dom-binding-controls.d.ts +2 -0
- package/dist/dom-binding-controls.js +6 -0
- package/dist/dom-binding-handoff.d.ts +55 -0
- package/dist/dom-binding-handoff.js +62 -0
- package/dist/dom-binding-program.d.ts +300 -0
- package/dist/dom-binding-program.js +1625 -0
- package/dist/dom-binding-projections.d.ts +15 -0
- package/dist/dom-binding-projections.js +187 -0
- package/dist/dom-binding-protocol.d.ts +13 -0
- package/dist/dom-binding-protocol.js +88 -0
- package/dist/dom-binding-signals.d.ts +21 -0
- package/dist/dom-binding-signals.js +109 -0
- package/dist/dom-binding-styles.d.ts +17 -0
- package/dist/dom-binding-styles.js +272 -0
- package/dist/dom-bindings.d.ts +89 -0
- package/dist/dom-bindings.js +670 -0
- package/dist/dom-focused-move.d.ts +6 -0
- package/dist/dom-focused-move.js +42 -0
- package/dist/dom-stage.d.ts +52 -0
- package/dist/dom-stage.js +872 -0
- package/dist/dom-tables.d.ts +1 -3
- package/dist/dom-tables.js +1 -91
- package/dist/error-codes.client.generated.d.ts +9 -0
- package/dist/error-codes.client.generated.js +33 -0
- package/dist/error-codes.server.generated.d.ts +6 -0
- package/dist/error-codes.server.generated.js +24 -0
- package/dist/hydration/control-capture.d.ts +62 -0
- package/dist/hydration/control-capture.js +223 -0
- package/dist/hydration/document-lifecycle.d.ts +23 -0
- package/dist/hydration/document-lifecycle.js +80 -0
- package/dist/hydration/event-capture.d.ts +20 -1
- package/dist/hydration/event-capture.js +128 -42
- package/dist/hydration/independent-island.d.ts +45 -0
- package/dist/hydration/independent-island.js +233 -0
- package/dist/hydration/index.d.ts +8 -1
- package/dist/hydration/index.js +55 -1
- package/dist/hydration/interaction-config.d.ts +5 -0
- package/dist/hydration/interaction-config.js +44 -1
- package/dist/hydration/stream-delivery.d.ts +32 -0
- package/dist/hydration/stream-delivery.js +333 -0
- package/dist/hydration/stream-receiver.d.ts +26 -0
- package/dist/hydration/stream-receiver.js +204 -0
- package/dist/hydration/stream-result-receiver.d.ts +70 -0
- package/dist/hydration/stream-result-receiver.js +246 -0
- package/dist/hydration/streamed-signals.d.ts +44 -0
- package/dist/hydration/streamed-signals.js +186 -0
- package/dist/hydration/types.d.ts +6 -0
- package/dist/hydration-markers.d.ts +7 -0
- package/dist/hydration-markers.js +10 -0
- package/dist/independent-hydration-protocol.d.ts +31 -0
- package/dist/independent-hydration-protocol.js +80 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/internal/signal-read.d.ts +1 -0
- package/dist/internal/signal-read.js +4 -0
- package/dist/jsx-runtime-strong.d.ts +33 -0
- package/dist/jsx-runtime.d.ts +58 -2
- package/dist/public-types.d.ts +15 -1
- package/dist/runtime.d.ts +297 -23
- package/dist/runtime.js +6405 -1679
- package/dist/runtime.server.d.ts +110 -27
- package/dist/runtime.server.js +1458 -213
- package/dist/server/early-signals.d.ts +14 -0
- package/dist/server/early-signals.js +34 -0
- package/dist/server/index.d.ts +11 -2
- package/dist/server/index.js +50 -1
- package/dist/server/rpc-batch.d.ts +17 -0
- package/dist/server/rpc-batch.js +129 -0
- package/dist/server/rpc-stream.d.ts +9 -0
- package/dist/server/rpc-stream.js +125 -0
- package/dist/server/rpc.d.ts +5 -1
- package/dist/server/rpc.js +37 -13
- package/dist/server/signal-query-observation.d.ts +3 -0
- package/dist/server/signal-query-observation.js +134 -0
- package/dist/server/streamed-region.d.ts +15 -0
- package/dist/server/streamed-region.js +30 -0
- package/dist/server/streamed-signals.d.ts +45 -0
- package/dist/server/streamed-signals.js +488 -0
- package/dist/server-call.d.ts +41 -0
- package/dist/server-call.js +75 -0
- package/dist/server-rpc-batch-client.d.ts +7 -0
- package/dist/server-rpc-batch-client.js +119 -0
- package/dist/server-rpc-client.d.ts +3 -1
- package/dist/server-rpc-client.js +99 -27
- package/dist/server-rpc-protocol.d.ts +47 -0
- package/dist/server-rpc-protocol.js +109 -0
- package/dist/server-rpc-stream-client.d.ts +5 -0
- package/dist/server-rpc-stream-client.js +98 -0
- package/dist/signals/actions.d.ts +12 -0
- package/dist/signals/actions.js +466 -0
- package/dist/signals/client.d.ts +2 -0
- package/dist/signals/client.js +1 -0
- package/dist/signals/computations.d.ts +37 -0
- package/dist/signals/computations.js +455 -0
- package/dist/signals/control-binding.d.ts +31 -0
- package/dist/signals/control-binding.js +353 -0
- package/dist/signals/derived-facade.d.ts +3 -0
- package/dist/signals/derived-facade.js +25 -0
- package/dist/signals/document-owner.d.ts +10 -0
- package/dist/signals/document-owner.js +43 -0
- package/dist/signals/early-values.d.ts +24 -0
- package/dist/signals/early-values.js +124 -0
- package/dist/signals/encoding.d.ts +1 -3
- package/dist/signals/encoding.js +3 -93
- package/dist/signals/engine.d.ts +53 -4
- package/dist/signals/engine.js +275 -16
- package/dist/signals/errors.d.ts +7 -0
- package/dist/signals/errors.js +16 -0
- package/dist/signals/facade.d.ts +74 -0
- package/dist/signals/facade.js +452 -0
- package/dist/signals/graph.d.ts +52 -6
- package/dist/signals/graph.js +174 -19
- package/dist/signals/handle-protocol.d.ts +4 -0
- package/dist/signals/handle-protocol.js +11 -0
- package/dist/signals/index.d.ts +12 -3
- package/dist/signals/index.js +71 -2
- package/dist/signals/native-read-client.d.ts +3 -0
- package/dist/signals/native-read-client.js +10 -0
- package/dist/signals/owner-context.d.ts +22 -0
- package/dist/signals/owner-context.js +77 -0
- package/dist/signals/query-attempt-observer.d.ts +49 -0
- package/dist/signals/query-attempt-observer.js +41 -0
- package/dist/signals/query-facade.d.ts +3 -0
- package/dist/signals/query-facade.js +49 -0
- package/dist/signals/read-protocol.d.ts +37 -2
- package/dist/signals/read-protocol.js +44 -0
- package/dist/signals/requests.d.ts +38 -5
- package/dist/signals/requests.js +298 -15
- package/dist/signals/scalar-computations.d.ts +2 -0
- package/dist/signals/scalar-computations.js +60 -0
- package/dist/signals/server.d.ts +2 -0
- package/dist/signals/server.js +1 -0
- package/dist/signals/transition-candidate.d.ts +71 -0
- package/dist/signals/transition-candidate.js +557 -0
- package/dist/signals/transition-state.d.ts +51 -0
- package/dist/signals/transition-state.js +70 -0
- package/dist/signals/types.d.ts +95 -5
- package/dist/signals/types.js +20 -0
- package/dist/stream-protocol.d.ts +0 -5
- package/dist/stream-protocol.js +3 -0
- package/dist/streamed-signals-protocol.d.ts +60 -0
- package/dist/streamed-signals-protocol.js +130 -0
- package/dist/style-values.d.ts +3 -0
- package/dist/style-values.js +96 -0
- package/dist/trusted-html.d.ts +17 -0
- package/dist/trusted-html.js +6 -0
- package/dist/universal-core.d.ts +6 -0
- package/dist/universal-core.js +214 -202
- package/dist/version.js +1 -1
- package/package.json +48 -5
package/dist/dom-tables.d.ts
CHANGED
|
@@ -11,6 +11,4 @@ export const HTML_ONLY_TAGS: Set<string>;
|
|
|
11
11
|
export const MATHML_ONLY_TAGS: Set<string>;
|
|
12
12
|
export const ATTRIBUTE_ALIASES: Map<string, string>;
|
|
13
13
|
export function isEnumeratedBooleanAttr(name: string): boolean;
|
|
14
|
-
export
|
|
15
|
-
export function cssStyleValue(name: string, value: unknown): string;
|
|
16
|
-
export function hyphenateStyleName(name: string): string;
|
|
14
|
+
export { isUnitlessStyleProp, cssStyleValue, hyphenateStyleName } from './style-values.js';
|
package/dist/dom-tables.js
CHANGED
|
@@ -365,97 +365,7 @@ function isEnumeratedBooleanAttr(name) {
|
|
|
365
365
|
}
|
|
366
366
|
return false;
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
for (const base of [
|
|
370
|
-
"animationIterationCount",
|
|
371
|
-
"aspectRatio",
|
|
372
|
-
"borderImageOutset",
|
|
373
|
-
"borderImageSlice",
|
|
374
|
-
"borderImageWidth",
|
|
375
|
-
"boxFlex",
|
|
376
|
-
"boxFlexGroup",
|
|
377
|
-
"boxOrdinalGroup",
|
|
378
|
-
"columnCount",
|
|
379
|
-
"columns",
|
|
380
|
-
"flex",
|
|
381
|
-
"flexGrow",
|
|
382
|
-
"flexPositive",
|
|
383
|
-
"flexShrink",
|
|
384
|
-
"flexNegative",
|
|
385
|
-
"flexOrder",
|
|
386
|
-
"gridArea",
|
|
387
|
-
"gridRow",
|
|
388
|
-
"gridRowEnd",
|
|
389
|
-
"gridRowSpan",
|
|
390
|
-
"gridRowStart",
|
|
391
|
-
"gridColumn",
|
|
392
|
-
"gridColumnEnd",
|
|
393
|
-
"gridColumnSpan",
|
|
394
|
-
"gridColumnStart",
|
|
395
|
-
"fontWeight",
|
|
396
|
-
"lineClamp",
|
|
397
|
-
"lineHeight",
|
|
398
|
-
"opacity",
|
|
399
|
-
"order",
|
|
400
|
-
"orphans",
|
|
401
|
-
"scale",
|
|
402
|
-
"tabSize",
|
|
403
|
-
"widows",
|
|
404
|
-
"zIndex",
|
|
405
|
-
"zoom",
|
|
406
|
-
"fillOpacity",
|
|
407
|
-
"floodOpacity",
|
|
408
|
-
"stopOpacity",
|
|
409
|
-
"strokeDasharray",
|
|
410
|
-
"strokeDashoffset",
|
|
411
|
-
"strokeMiterlimit",
|
|
412
|
-
"strokeOpacity",
|
|
413
|
-
"strokeWidth"
|
|
414
|
-
]) {
|
|
415
|
-
const c = base.toLowerCase();
|
|
416
|
-
UNITLESS_STYLE_PROPS.add(c);
|
|
417
|
-
UNITLESS_STYLE_PROPS.add("webkit" + c);
|
|
418
|
-
UNITLESS_STYLE_PROPS.add("ms" + c);
|
|
419
|
-
UNITLESS_STYLE_PROPS.add("moz" + c);
|
|
420
|
-
UNITLESS_STYLE_PROPS.add("o" + c);
|
|
421
|
-
}
|
|
422
|
-
const unitlessStylePropCache = /* @__PURE__ */ new Map();
|
|
423
|
-
function isUnitlessStyleProp(name) {
|
|
424
|
-
const cached = unitlessStylePropCache.get(name);
|
|
425
|
-
if (cached !== void 0) return cached;
|
|
426
|
-
const result = UNITLESS_STYLE_PROPS.has(name.replaceAll("-", "").toLowerCase());
|
|
427
|
-
unitlessStylePropCache.set(name, result);
|
|
428
|
-
return result;
|
|
429
|
-
}
|
|
430
|
-
function cssStyleValue(name, value) {
|
|
431
|
-
if (typeof value === "number" && value !== 0 && name.charCodeAt(0) !== 45 && !isUnitlessStyleProp(name)) {
|
|
432
|
-
return value + "px";
|
|
433
|
-
}
|
|
434
|
-
return typeof value === "string" ? value.trim() : "" + value;
|
|
435
|
-
}
|
|
436
|
-
function hyphenateStyleName(name) {
|
|
437
|
-
if (name === "cssFloat") return "float";
|
|
438
|
-
if (name.charCodeAt(0) === 45) return name;
|
|
439
|
-
let hasUpper = false;
|
|
440
|
-
for (let i = 0; i < name.length; i++) {
|
|
441
|
-
const c = name.charCodeAt(i);
|
|
442
|
-
if (c >= 65 && c <= 90) {
|
|
443
|
-
hasUpper = true;
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
if (!hasUpper) return name;
|
|
448
|
-
let out = "";
|
|
449
|
-
for (let i = 0; i < name.length; i++) {
|
|
450
|
-
const c = name.charCodeAt(i);
|
|
451
|
-
if (c >= 65 && c <= 90) out += "-" + String.fromCharCode(c + 32);
|
|
452
|
-
else out += name[i];
|
|
453
|
-
}
|
|
454
|
-
if (out.charCodeAt(0) === 109 && out.charCodeAt(1) === 115 && out.charCodeAt(2) === 45) {
|
|
455
|
-
out = "-" + out;
|
|
456
|
-
}
|
|
457
|
-
return out;
|
|
458
|
-
}
|
|
368
|
+
import { isUnitlessStyleProp, cssStyleValue, hyphenateStyleName } from "./style-values.js";
|
|
459
369
|
export {
|
|
460
370
|
ATTRIBUTE_ALIASES,
|
|
461
371
|
BOOLEAN_ATTR_PROPS,
|
|
@@ -41,6 +41,15 @@ type ClientErrorArguments = {
|
|
|
41
41
|
62: [];
|
|
42
42
|
63: [];
|
|
43
43
|
64: [];
|
|
44
|
+
66: [];
|
|
45
|
+
67: [unknown];
|
|
46
|
+
72: [];
|
|
47
|
+
74: [];
|
|
48
|
+
75: [];
|
|
49
|
+
76: [];
|
|
50
|
+
77: [];
|
|
51
|
+
78: [];
|
|
52
|
+
79: [];
|
|
44
53
|
};
|
|
45
54
|
export declare function formatClientError<Code extends keyof ClientErrorArguments>(code: Code, ...args: ClientErrorArguments[Code]): string;
|
|
46
55
|
export {};
|
|
@@ -192,6 +192,39 @@ function formatClientError(code, ...args) {
|
|
|
192
192
|
);
|
|
193
193
|
case 64:
|
|
194
194
|
return formatDevErrorMessage("Multiple errors were thrown during act.", args);
|
|
195
|
+
case 66:
|
|
196
|
+
return formatDevErrorMessage(
|
|
197
|
+
"An independent Hydrate boundary cannot change ownership after mount.",
|
|
198
|
+
args
|
|
199
|
+
);
|
|
200
|
+
case 67:
|
|
201
|
+
return formatDevErrorMessage('Signal control identity mismatch for "%s".', args);
|
|
202
|
+
case 72:
|
|
203
|
+
return formatDevErrorMessage(
|
|
204
|
+
"Octane DOM binding text range does not match its template.",
|
|
205
|
+
args
|
|
206
|
+
);
|
|
207
|
+
case 74:
|
|
208
|
+
return formatDevErrorMessage("Unsupported Octane signal binding ABI.", args);
|
|
209
|
+
case 75:
|
|
210
|
+
return formatDevErrorMessage(
|
|
211
|
+
"Hydration binding leases require a supported fixed native view without structural regions or unsupported writers.",
|
|
212
|
+
args
|
|
213
|
+
);
|
|
214
|
+
case 76:
|
|
215
|
+
return formatDevErrorMessage(
|
|
216
|
+
"DOM binding hydration leases are supported only by hydrateRoot().",
|
|
217
|
+
args
|
|
218
|
+
);
|
|
219
|
+
case 77:
|
|
220
|
+
return formatDevErrorMessage(
|
|
221
|
+
"Hydration binding leases require active fixed native views owned by this container.",
|
|
222
|
+
args
|
|
223
|
+
);
|
|
224
|
+
case 78:
|
|
225
|
+
return formatDevErrorMessage("A hydration binding lease can be claimed only once.", args);
|
|
226
|
+
case 79:
|
|
227
|
+
return formatDevErrorMessage("Unsupported native signal transition.", args);
|
|
195
228
|
default:
|
|
196
229
|
return formatUnknownDevErrorMessage(code);
|
|
197
230
|
}
|
|
@@ -31,6 +31,12 @@ type ServerErrorArguments = {
|
|
|
31
31
|
58: [];
|
|
32
32
|
59: [unknown];
|
|
33
33
|
60: [];
|
|
34
|
+
65: [];
|
|
35
|
+
68: [];
|
|
36
|
+
69: [];
|
|
37
|
+
70: [];
|
|
38
|
+
71: [];
|
|
39
|
+
73: [];
|
|
34
40
|
};
|
|
35
41
|
export declare function formatServerError<Code extends keyof ServerErrorArguments>(code: Code, ...args: ServerErrorArguments[Code]): string;
|
|
36
42
|
export {};
|
|
@@ -130,6 +130,30 @@ function formatServerError(code, ...args) {
|
|
|
130
130
|
"A component suspended without a Suspense boundary during synchronous server rendering. Use prerender() or a streaming renderer to await it.",
|
|
131
131
|
args
|
|
132
132
|
);
|
|
133
|
+
case 65:
|
|
134
|
+
return formatDevErrorMessage(
|
|
135
|
+
"Internal SSR invariant violated: ASYNC_SCOPE is not an extension of the active frame's async scope. Please file an Octane issue.",
|
|
136
|
+
args
|
|
137
|
+
);
|
|
138
|
+
case 68:
|
|
139
|
+
return formatDevErrorMessage(
|
|
140
|
+
"A signal control cannot join values from different document owners.",
|
|
141
|
+
args
|
|
142
|
+
);
|
|
143
|
+
case 69:
|
|
144
|
+
return formatDevErrorMessage(
|
|
145
|
+
"Independent Hydrate requires a build manifest in RenderOptions.",
|
|
146
|
+
args
|
|
147
|
+
);
|
|
148
|
+
case 70:
|
|
149
|
+
return formatDevErrorMessage(
|
|
150
|
+
"Independent Hydrate activation chunk is missing from the build manifest.",
|
|
151
|
+
args
|
|
152
|
+
);
|
|
153
|
+
case 71:
|
|
154
|
+
return formatDevErrorMessage("Unsupported Octane server signal binding ABI.", args);
|
|
155
|
+
case 73:
|
|
156
|
+
return formatDevErrorMessage("Octane DOM bindings require unique list keys.", args);
|
|
133
157
|
default:
|
|
134
158
|
return formatUnknownDevErrorMessage(code);
|
|
135
159
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** @internal Shared inline mailbox record; its activation queue has one owner. */
|
|
2
|
+
export type EarlyHydrationIntent = readonly [
|
|
3
|
+
Event,
|
|
4
|
+
Element,
|
|
5
|
+
Element,
|
|
6
|
+
string,
|
|
7
|
+
string | null,
|
|
8
|
+
string | null,
|
|
9
|
+
Element?,
|
|
10
|
+
string?
|
|
11
|
+
];
|
|
12
|
+
/** @internal Captured control state and activation require the same DOM authority. */
|
|
13
|
+
export declare function isEarlyHydrationIntentCurrent([event, target, boundary, id, when, events]: EarlyHydrationIntent, ownerDocument: Document): boolean;
|
|
14
|
+
export interface HydrationControlSnapshot {
|
|
15
|
+
/** Advances for every captured input, including a clear-to-empty-string edit. */
|
|
16
|
+
readonly editRevision: number;
|
|
17
|
+
/** Advances independently when the platform reports a selection change. */
|
|
18
|
+
readonly selectionRevision: number;
|
|
19
|
+
/** Advances for edits, selection, focus, and composition changes. */
|
|
20
|
+
readonly revision: number;
|
|
21
|
+
readonly value: string;
|
|
22
|
+
readonly checked?: boolean;
|
|
23
|
+
readonly selectedValues?: readonly string[];
|
|
24
|
+
readonly selectionStart: number | null;
|
|
25
|
+
readonly selectionEnd: number | null;
|
|
26
|
+
readonly selectionDirection: 'forward' | 'backward' | 'none' | null;
|
|
27
|
+
readonly focused: boolean;
|
|
28
|
+
readonly composing: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Opaque revision token captured before an asynchronous local restoration read. */
|
|
31
|
+
export interface HydrationControlCandidate {
|
|
32
|
+
readonly control: Element;
|
|
33
|
+
readonly bindingId: string | null;
|
|
34
|
+
readonly boundaryId: string | null;
|
|
35
|
+
readonly snapshot: HydrationControlSnapshot;
|
|
36
|
+
}
|
|
37
|
+
export interface HydrationControlCandidateValue {
|
|
38
|
+
readonly value?: string;
|
|
39
|
+
readonly checked?: boolean;
|
|
40
|
+
readonly selectedValues?: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @internal Snapshot the live platform state used by an island's atomic input
|
|
44
|
+
* handoff. The current DOM is authoritative; the counters only decide whether
|
|
45
|
+
* the state changed while ownership was being transferred.
|
|
46
|
+
*/
|
|
47
|
+
export declare function snapshotHydrationControl(control: Element): HydrationControlSnapshot | null;
|
|
48
|
+
/**
|
|
49
|
+
* Capture the exact DOM/edit authority an async storage read is allowed to replace.
|
|
50
|
+
* A focus, selection, composition, input (including clear), node replacement, or
|
|
51
|
+
* boundary rebinding before apply makes the candidate stale.
|
|
52
|
+
*/
|
|
53
|
+
export declare function captureHydrationControlCandidate(control: Element): HydrationControlCandidate | null;
|
|
54
|
+
/** Apply one local candidate only while the captured DOM revision still owns the value. */
|
|
55
|
+
export declare function applyHydrationControlCandidate(candidate: HydrationControlCandidate, value: HydrationControlCandidateValue): boolean;
|
|
56
|
+
/** @internal Retire only the exact early state an activating owner adopted. */
|
|
57
|
+
export declare function consumeHydrationControl(control: Element, revision: number): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @internal Own only native control state. Island activation remains optional:
|
|
60
|
+
* leave its mailbox intact so a later full bootstrap can claim every intent.
|
|
61
|
+
*/
|
|
62
|
+
export declare function initializeHydrationControlCapture(ownerDocument?: Document): void;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { HYDRATE_INDEPENDENT_ATTR, HYDRATE_INPUT_ATTR } from "../hydration-markers.js";
|
|
2
|
+
import {
|
|
3
|
+
EARLY_HYDRATION_INTENTS_KEY,
|
|
4
|
+
HYDRATE_INTERACTION_EVENTS_ATTR
|
|
5
|
+
} from "./interaction-config.js";
|
|
6
|
+
import {
|
|
7
|
+
claimEarlyHydrationControlCapture,
|
|
8
|
+
clearEarlyHydrationControlRevision,
|
|
9
|
+
publishHydrationControlSignalValues,
|
|
10
|
+
readEarlyHydrationControlRevision
|
|
11
|
+
} from "../signals/early-values.js";
|
|
12
|
+
const HYDRATE_MARKER_SELECTOR = "[data-octane-hydrate-id]";
|
|
13
|
+
const HYDRATE_CONTROL_DOCUMENTS = /* @__PURE__ */ new WeakSet();
|
|
14
|
+
function isEarlyHydrationIntentCurrent([event, target, boundary, id, when, events], ownerDocument) {
|
|
15
|
+
return event.target === target && target.isConnected && boundary.isConnected && target.ownerDocument === ownerDocument && boundary.ownerDocument === ownerDocument && target.closest(`[${HYDRATE_INDEPENDENT_ATTR}]`) === boundary && boundary.getAttribute("data-octane-hydrate-id") === id && boundary.getAttribute("data-octane-hydrate-when") === when && boundary.getAttribute(HYDRATE_INTERACTION_EVENTS_ATTR) === events;
|
|
16
|
+
}
|
|
17
|
+
function isHydrationElement(target) {
|
|
18
|
+
return target !== null && target.nodeType === 1;
|
|
19
|
+
}
|
|
20
|
+
const HYDRATE_CONTROL_RECORDS = /* @__PURE__ */ new WeakMap();
|
|
21
|
+
function hydrationControl(target) {
|
|
22
|
+
if (!isHydrationElement(target)) return null;
|
|
23
|
+
const tag = target.localName;
|
|
24
|
+
return tag === "input" || tag === "textarea" || tag === "select" || target.isContentEditable ? target : null;
|
|
25
|
+
}
|
|
26
|
+
function hydrationControlRecord(control) {
|
|
27
|
+
let record = HYDRATE_CONTROL_RECORDS.get(control);
|
|
28
|
+
if (record === void 0) {
|
|
29
|
+
const revision = readEarlyHydrationControlRevision(control);
|
|
30
|
+
record = { editRevision: revision, selectionRevision: 0, revision, composing: false };
|
|
31
|
+
HYDRATE_CONTROL_RECORDS.set(control, record);
|
|
32
|
+
}
|
|
33
|
+
return record;
|
|
34
|
+
}
|
|
35
|
+
function recordHydrationControlEvent(event) {
|
|
36
|
+
const control = hydrationControl(event.target);
|
|
37
|
+
if (control === null) return;
|
|
38
|
+
const record = hydrationControlRecord(control);
|
|
39
|
+
switch (event.type) {
|
|
40
|
+
case "input":
|
|
41
|
+
record.editRevision++;
|
|
42
|
+
record.revision++;
|
|
43
|
+
publishHydrationControlSignalValues(control, record.revision);
|
|
44
|
+
break;
|
|
45
|
+
case "compositionstart":
|
|
46
|
+
record.composing = true;
|
|
47
|
+
record.revision++;
|
|
48
|
+
break;
|
|
49
|
+
case "compositionupdate":
|
|
50
|
+
record.revision++;
|
|
51
|
+
break;
|
|
52
|
+
case "compositionend":
|
|
53
|
+
record.composing = false;
|
|
54
|
+
record.revision++;
|
|
55
|
+
break;
|
|
56
|
+
case "focusin":
|
|
57
|
+
case "focusout":
|
|
58
|
+
record.revision++;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function recordHydrationSelection(event) {
|
|
62
|
+
const ownerDocument = event.currentTarget;
|
|
63
|
+
const control = hydrationControl(ownerDocument.activeElement);
|
|
64
|
+
if (control === null) return;
|
|
65
|
+
const record = hydrationControlRecord(control);
|
|
66
|
+
record.selectionRevision++;
|
|
67
|
+
record.revision++;
|
|
68
|
+
}
|
|
69
|
+
function snapshotHydrationControl(control) {
|
|
70
|
+
if (hydrationControl(control) === null) return null;
|
|
71
|
+
const record = HYDRATE_CONTROL_RECORDS.get(control);
|
|
72
|
+
const earlyRevision = record === void 0 ? readEarlyHydrationControlRevision(control) : 0;
|
|
73
|
+
const input = control;
|
|
74
|
+
let value;
|
|
75
|
+
let checked;
|
|
76
|
+
let selectedValues;
|
|
77
|
+
let selectionStart = null;
|
|
78
|
+
let selectionEnd = null;
|
|
79
|
+
let selectionDirection = null;
|
|
80
|
+
if (control.localName === "select") {
|
|
81
|
+
const select = input;
|
|
82
|
+
value = select.value;
|
|
83
|
+
if (select.multiple)
|
|
84
|
+
selectedValues = Array.from(select.selectedOptions, (option) => option.value);
|
|
85
|
+
} else if (control.isContentEditable) {
|
|
86
|
+
value = control.textContent ?? "";
|
|
87
|
+
} else {
|
|
88
|
+
value = input.value;
|
|
89
|
+
if (control.localName === "input") checked = input.checked;
|
|
90
|
+
try {
|
|
91
|
+
selectionStart = input.selectionStart;
|
|
92
|
+
selectionEnd = input.selectionEnd;
|
|
93
|
+
selectionDirection = input.selectionDirection;
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
editRevision: record?.editRevision ?? earlyRevision,
|
|
99
|
+
selectionRevision: record?.selectionRevision ?? 0,
|
|
100
|
+
revision: record?.revision ?? earlyRevision,
|
|
101
|
+
value,
|
|
102
|
+
...checked === void 0 ? {} : { checked },
|
|
103
|
+
...selectedValues === void 0 ? {} : { selectedValues },
|
|
104
|
+
selectionStart,
|
|
105
|
+
selectionEnd,
|
|
106
|
+
selectionDirection,
|
|
107
|
+
focused: control.ownerDocument.activeElement === control,
|
|
108
|
+
composing: record?.composing ?? false
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function captureHydrationControlCandidate(control) {
|
|
112
|
+
const snapshot = snapshotHydrationControl(control);
|
|
113
|
+
if (snapshot === null) return null;
|
|
114
|
+
initializeHydrationControlCapture(control.ownerDocument);
|
|
115
|
+
return {
|
|
116
|
+
control,
|
|
117
|
+
bindingId: control.getAttribute(HYDRATE_INPUT_ATTR),
|
|
118
|
+
boundaryId: control.closest(HYDRATE_MARKER_SELECTOR)?.getAttribute("data-octane-hydrate-id") ?? null,
|
|
119
|
+
snapshot
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function sameHydrationControlValue(left, right) {
|
|
123
|
+
if (left.value !== right.value || left.checked !== right.checked) return false;
|
|
124
|
+
const a = left.selectedValues;
|
|
125
|
+
const b = right.selectedValues;
|
|
126
|
+
if (a === void 0 || b === void 0) return a === b;
|
|
127
|
+
if (a.length !== b.length) return false;
|
|
128
|
+
for (let index = 0; index < a.length; index++) if (a[index] !== b[index]) return false;
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
function applyHydrationControlCandidate(candidate, value) {
|
|
132
|
+
const control = candidate.control;
|
|
133
|
+
if (!control.isConnected || control.getAttribute(HYDRATE_INPUT_ATTR) !== candidate.bindingId || (control.closest(HYDRATE_MARKER_SELECTOR)?.getAttribute("data-octane-hydrate-id") ?? null) !== candidate.boundaryId) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
const current = snapshotHydrationControl(control);
|
|
137
|
+
if (current === null || current.revision !== candidate.snapshot.revision || current.editRevision !== candidate.snapshot.editRevision || current.composing || !sameHydrationControlValue(current, candidate.snapshot)) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (control.localName === "select") {
|
|
141
|
+
const select = control;
|
|
142
|
+
if (select.multiple && value.selectedValues !== void 0) {
|
|
143
|
+
const selected = new Set(value.selectedValues);
|
|
144
|
+
for (const option of select.options) option.selected = selected.has(option.value);
|
|
145
|
+
} else if (value.value !== void 0) {
|
|
146
|
+
select.value = value.value;
|
|
147
|
+
} else {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
} else if (control.isContentEditable) {
|
|
151
|
+
if (value.value === void 0) return false;
|
|
152
|
+
control.textContent = value.value;
|
|
153
|
+
} else {
|
|
154
|
+
const input = control;
|
|
155
|
+
if (value.value !== void 0) input.value = value.value;
|
|
156
|
+
else if (control.localName !== "input" || value.checked === void 0) return false;
|
|
157
|
+
if (control.localName === "input" && value.checked !== void 0) {
|
|
158
|
+
input.checked = value.checked;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (current.focused && current.selectionStart !== null && current.selectionEnd !== null && control.localName !== "select" && !control.isContentEditable) {
|
|
162
|
+
try {
|
|
163
|
+
control.setSelectionRange(
|
|
164
|
+
current.selectionStart,
|
|
165
|
+
current.selectionEnd,
|
|
166
|
+
current.selectionDirection ?? void 0
|
|
167
|
+
);
|
|
168
|
+
} catch {
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const record = hydrationControlRecord(control);
|
|
172
|
+
record.editRevision++;
|
|
173
|
+
record.revision++;
|
|
174
|
+
publishHydrationControlSignalValues(control, record.revision);
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
function consumeHydrationControl(control, revision) {
|
|
178
|
+
initializeHydrationControlCapture(control.ownerDocument);
|
|
179
|
+
const record = hydrationControlRecord(control);
|
|
180
|
+
if (record.revision !== revision) return false;
|
|
181
|
+
record.editRevision = 0;
|
|
182
|
+
record.selectionRevision = 0;
|
|
183
|
+
clearEarlyHydrationControlRevision(control);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
function initializeHydrationControlCapture(ownerDocument) {
|
|
187
|
+
const targetDocument = ownerDocument ?? (typeof document === "undefined" ? void 0 : document);
|
|
188
|
+
if (targetDocument === void 0 || HYDRATE_CONTROL_DOCUMENTS.has(targetDocument)) return;
|
|
189
|
+
HYDRATE_CONTROL_DOCUMENTS.add(targetDocument);
|
|
190
|
+
const mailbox = targetDocument[EARLY_HYDRATION_INTENTS_KEY];
|
|
191
|
+
const target = typeof mailbox?.stop === "function" ? targetDocument.defaultView ?? targetDocument : targetDocument;
|
|
192
|
+
const record = target === targetDocument ? recordHydrationControlEvent : (event) => {
|
|
193
|
+
if (event.target?.ownerDocument === targetDocument)
|
|
194
|
+
recordHydrationControlEvent(event);
|
|
195
|
+
};
|
|
196
|
+
for (const event of [
|
|
197
|
+
"input",
|
|
198
|
+
"compositionstart",
|
|
199
|
+
"compositionupdate",
|
|
200
|
+
"compositionend",
|
|
201
|
+
"focusin",
|
|
202
|
+
"focusout"
|
|
203
|
+
]) {
|
|
204
|
+
target.addEventListener(event, record, true);
|
|
205
|
+
}
|
|
206
|
+
targetDocument.addEventListener("selectionchange", recordHydrationSelection, true);
|
|
207
|
+
claimEarlyHydrationControlCapture(targetDocument);
|
|
208
|
+
for (const intent of mailbox?.q ?? []) {
|
|
209
|
+
const [event] = intent;
|
|
210
|
+
const control = hydrationControl(event.target);
|
|
211
|
+
if (control === null || !isEarlyHydrationIntentCurrent(intent, targetDocument)) continue;
|
|
212
|
+
if (event.type === "input" && readEarlyHydrationControlRevision(control) > 0) continue;
|
|
213
|
+
recordHydrationControlEvent(event);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
export {
|
|
217
|
+
applyHydrationControlCandidate,
|
|
218
|
+
captureHydrationControlCandidate,
|
|
219
|
+
consumeHydrationControl,
|
|
220
|
+
initializeHydrationControlCapture,
|
|
221
|
+
isEarlyHydrationIntentCurrent,
|
|
222
|
+
snapshotHydrationControl
|
|
223
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SignalOwner } from '../signals/types.js';
|
|
2
|
+
import type { IndependentHydrateLifecycle } from './independent-island.js';
|
|
3
|
+
import type { StreamedSignalResults } from './streamed-signals.js';
|
|
4
|
+
export interface SignalDocumentLifecycleOptions {
|
|
5
|
+
readonly document: Document;
|
|
6
|
+
readonly buildId: string;
|
|
7
|
+
readonly documentId: string;
|
|
8
|
+
readonly signalOwner?: SignalOwner;
|
|
9
|
+
readonly streamedHydration?: Pick<StreamedSignalResults, 'suspend'>;
|
|
10
|
+
readonly independentHydration?: IndependentHydrateLifecycle;
|
|
11
|
+
/** Host-owned identity carrier. Null, mismatch, or failure retires persisted state. */
|
|
12
|
+
readonly readIdentity?: () => {
|
|
13
|
+
readonly buildId: string;
|
|
14
|
+
readonly documentId: string;
|
|
15
|
+
} | null;
|
|
16
|
+
readonly onMismatch?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/** Optional feature-local lifetime for one executing document, never an account manager. */
|
|
19
|
+
export declare function installSignalDocumentLifecycle(options: SignalDocumentLifecycleOptions): {
|
|
20
|
+
signalOwner: SignalOwner;
|
|
21
|
+
whenActive(): Promise<boolean>;
|
|
22
|
+
dispose: () => void;
|
|
23
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { documentSignalOwner } from "../signals/document-owner.js";
|
|
2
|
+
import { createSignalOwnerLifecycle } from "../signals/facade.js";
|
|
3
|
+
function installSignalDocumentLifecycle(options) {
|
|
4
|
+
const document = options.document;
|
|
5
|
+
const view = document.defaultView;
|
|
6
|
+
if (!view || !options.buildId || !options.documentId) {
|
|
7
|
+
throw new TypeError("A signal document lifecycle requires a live document and build identity.");
|
|
8
|
+
}
|
|
9
|
+
const signalOwner = options.signalOwner ?? documentSignalOwner(document);
|
|
10
|
+
const owner = createSignalOwnerLifecycle(signalOwner);
|
|
11
|
+
let frozen = false;
|
|
12
|
+
let disposed = false;
|
|
13
|
+
let waiting;
|
|
14
|
+
let wake;
|
|
15
|
+
const compatible = () => {
|
|
16
|
+
if (owner.retired || view.document !== document) return false;
|
|
17
|
+
try {
|
|
18
|
+
if (options.readIdentity !== void 0) {
|
|
19
|
+
const identity = options.readIdentity();
|
|
20
|
+
return identity?.buildId === options.buildId && identity.documentId === options.documentId;
|
|
21
|
+
}
|
|
22
|
+
const data = JSON.parse(document.getElementById("__octane_data")?.textContent || "null");
|
|
23
|
+
return data?.clientBuild?.version === 1 && data.clientBuild.buildId === options.buildId && data.streamedSignals?.buildId === options.buildId && data.streamedSignals.documentId === options.documentId;
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const dispose = () => {
|
|
29
|
+
if (disposed) return;
|
|
30
|
+
disposed = true;
|
|
31
|
+
view.removeEventListener("pagehide", hide);
|
|
32
|
+
view.removeEventListener("pageshow", show);
|
|
33
|
+
owner.retire();
|
|
34
|
+
options.streamedHydration?.suspend();
|
|
35
|
+
options.independentHydration?.();
|
|
36
|
+
wake?.(false);
|
|
37
|
+
wake = void 0;
|
|
38
|
+
};
|
|
39
|
+
const hide = (event) => {
|
|
40
|
+
if (!event.persisted) {
|
|
41
|
+
dispose();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (disposed || frozen) return;
|
|
45
|
+
frozen = true;
|
|
46
|
+
waiting = new Promise((resolve) => {
|
|
47
|
+
wake = resolve;
|
|
48
|
+
});
|
|
49
|
+
owner.freeze();
|
|
50
|
+
options.streamedHydration?.suspend();
|
|
51
|
+
options.independentHydration?.pause();
|
|
52
|
+
};
|
|
53
|
+
const show = (event) => {
|
|
54
|
+
if (!event.persisted || disposed || !frozen) return;
|
|
55
|
+
if (!compatible()) {
|
|
56
|
+
dispose();
|
|
57
|
+
(options.onMismatch ?? (() => view.location.reload()))();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
frozen = false;
|
|
61
|
+
owner.resume();
|
|
62
|
+
if (disposed || frozen) return;
|
|
63
|
+
options.independentHydration?.resume();
|
|
64
|
+
wake?.(true);
|
|
65
|
+
wake = void 0;
|
|
66
|
+
waiting = void 0;
|
|
67
|
+
};
|
|
68
|
+
view.addEventListener("pagehide", hide);
|
|
69
|
+
view.addEventListener("pageshow", show);
|
|
70
|
+
return {
|
|
71
|
+
signalOwner,
|
|
72
|
+
whenActive() {
|
|
73
|
+
return disposed ? Promise.resolve(false) : waiting ?? Promise.resolve(true);
|
|
74
|
+
},
|
|
75
|
+
dispose
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
installSignalDocumentLifecycle
|
|
80
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { applyHydrationControlCandidate, captureHydrationControlCandidate, consumeHydrationControl, snapshotHydrationControl, type HydrationControlCandidate, type HydrationControlCandidateValue, type HydrationControlSnapshot, } from './control-capture.js';
|
|
2
|
+
export { HYDRATE_SUPPORTED_INTERACTION_EVENTS } from './interaction-config.js';
|
|
2
3
|
/**
|
|
3
4
|
* @internal Keep trusted focusing, touch activation, editing, and IME work on
|
|
4
5
|
* the original event. Replaying an untrusted clone cannot restore those native
|
|
@@ -8,7 +9,21 @@ export declare function shouldPreventHydrationInteractionDefault(event: Event):
|
|
|
8
9
|
export interface HydrationReplayIntent {
|
|
9
10
|
event: Event;
|
|
10
11
|
path: number[];
|
|
12
|
+
/** An explicitly leased native listener receives the original event, never a replay. */
|
|
13
|
+
earlyBinding?: true;
|
|
14
|
+
/** Captured author opt-in; never inferred again from a later DOM version. */
|
|
15
|
+
selection?: HydrationSelectionIntent;
|
|
11
16
|
}
|
|
17
|
+
interface HydrationSelectionIntent {
|
|
18
|
+
control: Element;
|
|
19
|
+
boundary: Element;
|
|
20
|
+
group: string;
|
|
21
|
+
sequence: number;
|
|
22
|
+
}
|
|
23
|
+
/** @internal A changed selection control cannot authorize an old click. */
|
|
24
|
+
export declare function isHydrationSelectionIntentCurrent(intent: HydrationReplayIntent): boolean;
|
|
25
|
+
/** @internal Replace only the immediately preceding captured selection. */
|
|
26
|
+
export declare function appendHydrationReplayIntent(queue: HydrationReplayIntent[], intent: HydrationReplayIntent): void;
|
|
12
27
|
export type HydrationIntentBoundaryStatus = 'hydrated' | 'never' | 'dormant' | 'handles';
|
|
13
28
|
export type HydrationIntentBoundary = (eventType: string, intent?: HydrationReplayIntent) => HydrationIntentBoundaryStatus;
|
|
14
29
|
/**
|
|
@@ -16,6 +31,8 @@ export type HydrationIntentBoundary = (eventType: string, intent?: HydrationRepl
|
|
|
16
31
|
* Renderer stream sentinels are omitted so the address survives their reveal.
|
|
17
32
|
*/
|
|
18
33
|
export declare function hydrationEventPathWithin(root: Element, target: EventTarget | null): number[] | null;
|
|
34
|
+
/** @internal Interpret the SSR strategy without invoking a registered boundary. */
|
|
35
|
+
export declare function hydrationMarkerInteractionStatus(marker: Element, eventType: string): HydrationIntentBoundaryStatus;
|
|
19
36
|
/**
|
|
20
37
|
* Install document-level capture for deferred-hydration interaction intent.
|
|
21
38
|
* Calling this function more than once for the same document is a no-op.
|
|
@@ -25,6 +42,8 @@ export declare function hydrationEventPathWithin(root: Element, target: EventTar
|
|
|
25
42
|
* boundary also invokes it as a synchronous fallback.
|
|
26
43
|
*/
|
|
27
44
|
export declare function initializeHydrationEventCapture(ownerDocument?: Document): void;
|
|
45
|
+
/** @internal Enable independent ownership without adding hit tests to ordinary hydration. */
|
|
46
|
+
export declare function initializeIndependentHydrationEventCapture(ownerDocument: Document): void;
|
|
28
47
|
/** @internal Runtime bridge for a mounted deferred-hydration boundary. */
|
|
29
48
|
export declare function registerHydrationIntentBoundary(marker: Element, boundary: HydrationIntentBoundary): void;
|
|
30
49
|
/** @internal Runtime bridge for a removed deferred-hydration boundary. */
|