octane 0.7.1 → 0.8.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/dist/cjs/constants.cjs +13 -13
- package/dist/cjs/dom-binding-protocol.cjs +9 -0
- package/dist/cjs/dom-binding-styles.cjs +11 -2
- package/dist/cjs/dom-bindings.cjs +21 -10
- package/dist/cjs/dom-tables.cjs +11 -0
- package/dist/cjs/error-codes.client.generated.cjs +5 -0
- package/dist/cjs/hydration/event-capture.cjs +37 -0
- package/dist/cjs/hydration/interaction-config.cjs +12 -2
- package/dist/cjs/hydration/replay-event.cjs +94 -0
- package/dist/cjs/hydration-markers.cjs +12 -0
- package/dist/cjs/runtime.cjs +2655 -728
- package/dist/cjs/runtime.server.cjs +250 -68
- package/dist/cjs/signals/actions.cjs +4 -0
- package/dist/cjs/signals/computations.cjs +110 -4
- package/dist/cjs/signals/control-binding.cjs +8 -2
- package/dist/cjs/signals/declaration-path.cjs +59 -0
- package/dist/cjs/signals/derived-facade.cjs +5 -3
- package/dist/cjs/signals/engine.cjs +37 -15
- package/dist/cjs/signals/facade.cjs +76 -9
- package/dist/cjs/signals/graph.cjs +186 -0
- package/dist/cjs/signals/index.cjs +3 -0
- package/dist/cjs/signals/native-read-client.cjs +21 -1
- package/dist/cjs/signals/native-read-seeds.cjs +2 -2
- package/dist/cjs/signals/native-read-server.cjs +6 -2
- package/dist/cjs/signals/owner-context.cjs +12 -5
- package/dist/cjs/signals/query-attempt-observer.cjs +8 -2
- package/dist/cjs/signals/query-facade.cjs +4 -3
- package/dist/cjs/signals/read-protocol.cjs +26 -2
- package/dist/cjs/signals/redeclaration.cjs +105 -0
- package/dist/cjs/signals/requests.cjs +116 -5
- package/dist/cjs/signals/scalar-computations.cjs +68 -4
- package/dist/cjs/signals/types.cjs +5 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/bundler.js +108 -16
- package/dist/compiler/compile-universal.js +9 -3
- package/dist/compiler/compile.js +778 -362
- package/dist/compiler/descriptor-lowering.js +317 -0
- package/dist/compiler/dom-binding-program.js +118 -2
- package/dist/compiler/dom-binding-request.js +46 -0
- package/dist/compiler/dom-bindings.js +298 -47
- package/dist/compiler/for-headers.js +51 -0
- package/dist/compiler/hook-deps.js +434 -41
- package/dist/compiler/hook-methods.js +6 -2
- package/dist/compiler/hydrate-boundaries.js +125 -6
- package/dist/compiler/index.d.ts +4 -0
- package/dist/compiler/inline-hook-memo.js +36 -17
- package/dist/compiler/islands-shell.js +431 -0
- package/dist/compiler/plain-hook-memo.js +188 -48
- package/dist/compiler/private-context.js +40 -6
- package/dist/compiler/signal-declarations.js +265 -36
- package/dist/compiler/slot-hooks.js +86 -17
- package/dist/compiler/strong-dom.js +839 -0
- package/dist/compiler/strong-effects.js +1419 -0
- package/dist/compiler/strong-external-store.js +234 -0
- package/dist/compiler/strong-mode.js +1584 -290
- package/dist/compiler/strong-render-policy.js +338 -0
- package/dist/compiler/strong-state.js +474 -0
- package/dist/compiler/strong-write-only-state.js +211 -0
- package/dist/compiler/vite.js +95 -42
- package/dist/compiler/volar.js +60 -45
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/dom-binding-island.d.ts +4 -0
- package/dist/dom-binding-island.js +88 -0
- package/dist/dom-binding-program.d.ts +82 -1
- package/dist/dom-binding-program.js +222 -9
- package/dist/dom-binding-projections.d.ts +2 -0
- package/dist/dom-binding-projections.js +2 -1
- package/dist/dom-binding-protocol.d.ts +10 -1
- package/dist/dom-binding-protocol.js +8 -0
- package/dist/dom-binding-signals.d.ts +34 -0
- package/dist/dom-binding-signals.js +138 -2
- package/dist/dom-binding-styles.d.ts +2 -0
- package/dist/dom-binding-styles.js +9 -1
- package/dist/dom-bindings.d.ts +22 -5
- package/dist/dom-bindings.js +20 -10
- package/dist/dom-tables.d.ts +1 -0
- package/dist/dom-tables.js +10 -0
- package/dist/error-codes.client.generated.d.ts +1 -0
- package/dist/error-codes.client.generated.js +5 -0
- package/dist/hydration/document-lifecycle.js +8 -5
- package/dist/hydration/event-capture.d.ts +14 -3
- package/dist/hydration/event-capture.js +36 -1
- package/dist/hydration/independent-island.js +12 -4
- package/dist/hydration/interaction-config.d.ts +9 -0
- package/dist/hydration/interaction-config.js +9 -1
- package/dist/hydration/interaction.js +5 -2
- package/dist/hydration/replay-event.d.ts +6 -0
- package/dist/hydration/replay-event.js +70 -0
- package/dist/hydration/types.d.ts +1 -1
- package/dist/hydration-markers.d.ts +14 -0
- package/dist/hydration-markers.js +8 -0
- package/dist/node/constants.js +2 -2
- package/dist/node/dom-binding-island.js +89 -0
- package/dist/node/dom-binding-program.js +222 -9
- package/dist/node/dom-binding-projections.js +2 -1
- package/dist/node/dom-binding-protocol.js +8 -0
- package/dist/node/dom-binding-signals.js +138 -2
- package/dist/node/dom-binding-styles.js +9 -1
- package/dist/node/dom-bindings.js +20 -10
- package/dist/node/dom-tables.js +10 -0
- package/dist/node/error-codes.client.generated.js +5 -0
- package/dist/node/hydration/document-lifecycle.js +8 -5
- package/dist/node/hydration/event-capture.js +36 -1
- package/dist/node/hydration/independent-island.js +12 -4
- package/dist/node/hydration/interaction-config.js +9 -1
- package/dist/node/hydration/interaction.js +5 -2
- package/dist/node/hydration/replay-event.js +70 -0
- package/dist/node/hydration-markers.js +8 -0
- package/dist/node/runtime.js +2661 -729
- package/dist/node/runtime.server.js +258 -70
- package/dist/node/signals/actions.js +10 -1
- package/dist/node/signals/computations.js +117 -4
- package/dist/node/signals/control-binding.js +8 -2
- package/dist/node/signals/declaration-path.js +34 -0
- package/dist/node/signals/derived-facade.js +6 -4
- package/dist/node/signals/engine.js +37 -15
- package/dist/node/signals/facade.js +78 -13
- package/dist/node/signals/graph.js +177 -1
- package/dist/node/signals/index.js +2 -0
- package/dist/node/signals/native-read-client.js +22 -2
- package/dist/node/signals/native-read-seeds.js +1 -1
- package/dist/node/signals/native-read-server.js +6 -2
- package/dist/node/signals/owner-context.js +10 -4
- package/dist/node/signals/query-attempt-observer.js +8 -2
- package/dist/node/signals/query-facade.js +6 -5
- package/dist/node/signals/read-protocol.js +21 -1
- package/dist/node/signals/redeclaration.js +84 -0
- package/dist/node/signals/requests.js +122 -5
- package/dist/node/signals/scalar-computations.js +69 -5
- package/dist/node/signals/types.js +4 -0
- package/dist/node/universal-core.js +670 -631
- package/dist/node/version.js +1 -1
- package/dist/runtime.d.ts +786 -15
- package/dist/runtime.js +2661 -729
- package/dist/runtime.server.d.ts +50 -6
- package/dist/runtime.server.js +258 -70
- package/dist/server/index.d.ts +1 -1
- package/dist/signals/actions.js +10 -1
- package/dist/signals/computations.d.ts +25 -2
- package/dist/signals/computations.js +117 -4
- package/dist/signals/control-binding.d.ts +2 -0
- package/dist/signals/control-binding.js +8 -2
- package/dist/signals/declaration-path.d.ts +8 -0
- package/dist/signals/declaration-path.js +34 -0
- package/dist/signals/derived-facade.d.ts +1 -1
- package/dist/signals/derived-facade.js +6 -4
- package/dist/signals/engine.d.ts +19 -5
- package/dist/signals/engine.js +37 -15
- package/dist/signals/facade.d.ts +20 -2
- package/dist/signals/facade.js +78 -13
- package/dist/signals/graph.d.ts +34 -1
- package/dist/signals/graph.js +177 -1
- package/dist/signals/index.d.ts +1 -0
- package/dist/signals/index.js +2 -0
- package/dist/signals/native-read-client.d.ts +8 -0
- package/dist/signals/native-read-client.js +22 -2
- package/dist/signals/native-read-seeds.d.ts +1 -2
- package/dist/signals/native-read-seeds.js +1 -1
- package/dist/signals/native-read-server.d.ts +2 -0
- package/dist/signals/native-read-server.js +6 -2
- package/dist/signals/owner-context.d.ts +10 -1
- package/dist/signals/owner-context.js +10 -4
- package/dist/signals/query-attempt-observer.js +8 -2
- package/dist/signals/query-facade.d.ts +1 -1
- package/dist/signals/query-facade.js +6 -5
- package/dist/signals/read-protocol.d.ts +18 -0
- package/dist/signals/read-protocol.js +21 -1
- package/dist/signals/redeclaration.d.ts +52 -0
- package/dist/signals/redeclaration.js +84 -0
- package/dist/signals/requests.d.ts +19 -2
- package/dist/signals/requests.js +122 -5
- package/dist/signals/scalar-computations.d.ts +1 -1
- package/dist/signals/scalar-computations.js +69 -5
- package/dist/signals/types.d.ts +5 -0
- package/dist/signals/types.js +4 -0
- package/dist/universal-core.d.ts +16 -0
- package/dist/universal-core.js +670 -631
- package/dist/version.js +1 -1
- package/package.json +6 -1
package/dist/cjs/constants.cjs
CHANGED
|
@@ -26,33 +26,33 @@ __export(constants_exports, {
|
|
|
26
26
|
EXTERNAL_HYDRATION_PROMISE: () => EXTERNAL_HYDRATION_PROMISE,
|
|
27
27
|
FOR_BLOCK_OPEN_EMPTY: () => FOR_BLOCK_OPEN_EMPTY,
|
|
28
28
|
FOR_BLOCK_OPEN_ITEMS: () => FOR_BLOCK_OPEN_ITEMS,
|
|
29
|
-
HYDRATE_ID_ATTR: () =>
|
|
30
|
-
HYDRATE_ID_COUNT_ATTR: () =>
|
|
31
|
-
HYDRATE_INDEPENDENT_ATTR: () =>
|
|
32
|
-
HYDRATE_INPUT_ATTR: () =>
|
|
33
|
-
HYDRATE_SEED_ATTR: () =>
|
|
29
|
+
HYDRATE_ID_ATTR: () => import_hydration_markers3.HYDRATE_ID_ATTR,
|
|
30
|
+
HYDRATE_ID_COUNT_ATTR: () => import_hydration_markers3.HYDRATE_ID_COUNT_ATTR,
|
|
31
|
+
HYDRATE_INDEPENDENT_ATTR: () => import_hydration_markers3.HYDRATE_INDEPENDENT_ATTR,
|
|
32
|
+
HYDRATE_INPUT_ATTR: () => import_hydration_markers3.HYDRATE_INPUT_ATTR,
|
|
33
|
+
HYDRATE_SEED_ATTR: () => import_hydration_markers3.HYDRATE_SEED_ATTR,
|
|
34
34
|
HYDRATE_STATIC_END: () => HYDRATE_STATIC_END,
|
|
35
35
|
HYDRATE_STATIC_ID_COUNT_PREFIX: () => HYDRATE_STATIC_ID_COUNT_PREFIX,
|
|
36
36
|
HYDRATE_STREAM_TOKEN_ATTR: () => import_stream_protocol2.HYDRATE_STREAM_TOKEN_ATTR,
|
|
37
|
-
HYDRATE_WHEN_ATTR: () =>
|
|
37
|
+
HYDRATE_WHEN_ATTR: () => import_hydration_markers3.HYDRATE_WHEN_ATTR,
|
|
38
38
|
HYDRATION_END: () => import_hydration_markers.HYDRATION_END,
|
|
39
39
|
HYDRATION_FOR_EMPTY: () => import_hydration_markers.HYDRATION_FOR_EMPTY,
|
|
40
40
|
HYDRATION_FOR_ITEMS: () => import_hydration_markers.HYDRATION_FOR_ITEMS,
|
|
41
41
|
HYDRATION_RANGE_BOUNDARY: () => HYDRATION_RANGE_BOUNDARY,
|
|
42
42
|
HYDRATION_START: () => import_hydration_markers.HYDRATION_START,
|
|
43
43
|
HYDRATION_TEXT_SEP: () => HYDRATION_TEXT_SEP,
|
|
44
|
-
INDEPENDENT_HYDRATE_MANIFEST_ATTR: () =>
|
|
44
|
+
INDEPENDENT_HYDRATE_MANIFEST_ATTR: () => import_hydration_markers3.INDEPENDENT_HYDRATE_MANIFEST_ATTR,
|
|
45
45
|
MUST_USE_PROPERTY_PROPS: () => MUST_USE_PROPERTY_PROPS,
|
|
46
46
|
POSITIVE_NUMERIC_ATTR_PROPS: () => POSITIVE_NUMERIC_ATTR_PROPS,
|
|
47
47
|
REJECTION_SENTINEL_KEY: () => REJECTION_SENTINEL_KEY,
|
|
48
|
-
SIGNAL_CONTROL_ATTR: () =>
|
|
48
|
+
SIGNAL_CONTROL_ATTR: () => import_hydration_markers3.SIGNAL_CONTROL_ATTR,
|
|
49
49
|
STREAM_BOUNDARY_ATTR: () => import_stream_protocol3.STREAM_BOUNDARY_ATTR,
|
|
50
50
|
STREAM_RESOURCE_ATTR: () => STREAM_RESOURCE_ATTR,
|
|
51
51
|
STREAM_SCRIPT_ATTR: () => import_stream_protocol4.STREAM_SCRIPT_ATTR,
|
|
52
52
|
STREAM_SEED_ATTR: () => STREAM_SEED_ATTR,
|
|
53
|
-
STREAM_SEED_COMMENT: () => STREAM_SEED_COMMENT,
|
|
53
|
+
STREAM_SEED_COMMENT: () => import_hydration_markers4.STREAM_SEED_COMMENT,
|
|
54
54
|
STREAM_SEGMENT_ATTR: () => STREAM_SEGMENT_ATTR,
|
|
55
|
-
SUSPENSE_RESOLVED_COMMENT: () => SUSPENSE_RESOLVED_COMMENT,
|
|
55
|
+
SUSPENSE_RESOLVED_COMMENT: () => import_hydration_markers2.SUSPENSE_RESOLVED_COMMENT,
|
|
56
56
|
SUSPENSE_RESOLVED_NATIVE_ATTR: () => SUSPENSE_RESOLVED_NATIVE_ATTR,
|
|
57
57
|
SUSPENSE_RESOLVED_SEED_ATTR: () => SUSPENSE_RESOLVED_SEED_ATTR,
|
|
58
58
|
SUSPENSE_SCRIPT_ATTR: () => import_stream_protocol.SUSPENSE_SCRIPT_ATTR,
|
|
@@ -69,10 +69,12 @@ __export(constants_exports, {
|
|
|
69
69
|
module.exports = __toCommonJS(constants_exports);
|
|
70
70
|
var import_hydration_markers = require("./hydration-markers.cjs");
|
|
71
71
|
var import_stream_protocol = require("./stream-protocol.cjs");
|
|
72
|
-
var import_stream_protocol2 = require("./stream-protocol.cjs");
|
|
73
72
|
var import_hydration_markers2 = require("./hydration-markers.cjs");
|
|
73
|
+
var import_stream_protocol2 = require("./stream-protocol.cjs");
|
|
74
|
+
var import_hydration_markers3 = require("./hydration-markers.cjs");
|
|
74
75
|
var import_stream_protocol3 = require("./stream-protocol.cjs");
|
|
75
76
|
var import_stream_protocol4 = require("./stream-protocol.cjs");
|
|
77
|
+
var import_hydration_markers4 = require("./hydration-markers.cjs");
|
|
76
78
|
var import_dom_tables = require("./dom-tables.cjs");
|
|
77
79
|
const BLOCK_OPEN = `<!--${import_hydration_markers.HYDRATION_START}-->`;
|
|
78
80
|
const BLOCK_CLOSE = `<!--${import_hydration_markers.HYDRATION_END}-->`;
|
|
@@ -81,7 +83,6 @@ const FOR_BLOCK_OPEN_ITEMS = `<!--${import_hydration_markers.HYDRATION_FOR_ITEMS
|
|
|
81
83
|
const EMPTY_COMMENT = "<!---->";
|
|
82
84
|
const HYDRATION_TEXT_SEP = " ";
|
|
83
85
|
const TEXT_SEPARATOR = `<!--${HYDRATION_TEXT_SEP}-->`;
|
|
84
|
-
const SUSPENSE_RESOLVED_COMMENT = "oct-suspense:";
|
|
85
86
|
const SUSPENSE_RESOLVED_SEED_ATTR = "data-octane-suspense-seeds";
|
|
86
87
|
const SUSPENSE_RESOLVED_NATIVE_ATTR = "data-octane-suspense-signals";
|
|
87
88
|
const UNDEFINED_SENTINEL_KEY = "__octane_new_undefined__";
|
|
@@ -98,7 +99,6 @@ const HYDRATE_STATIC_END = "/octane-static-hydrate";
|
|
|
98
99
|
const STREAM_SEGMENT_ATTR = "data-oct-s";
|
|
99
100
|
const STREAM_SEED_ATTR = "data-oct-seed";
|
|
100
101
|
const STREAM_RESOURCE_ATTR = "data-oct-fr";
|
|
101
|
-
const STREAM_SEED_COMMENT = "oct-seed:";
|
|
102
102
|
const VOID_ELEMENTS = import_dom_tables.VOID_ELEMENTS;
|
|
103
103
|
const BOOLEAN_ATTR_PROPS = import_dom_tables.BOOLEAN_ATTR_PROPS;
|
|
104
104
|
const MUST_USE_PROPERTY_PROPS = import_dom_tables.MUST_USE_PROPERTY_PROPS;
|
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var dom_binding_protocol_exports = {};
|
|
20
20
|
__export(dom_binding_protocol_exports, {
|
|
21
21
|
BINDING_OPEN_PREFIX: () => BINDING_OPEN_PREFIX,
|
|
22
|
+
BINDING_OPEN_TAIL_SOURCE: () => BINDING_OPEN_TAIL_SOURCE,
|
|
22
23
|
bindingRootMarker: () => bindingRootMarker,
|
|
23
24
|
decodeBindingKey: () => decodeBindingKey,
|
|
24
25
|
encodeBindingKey: () => encodeBindingKey,
|
|
@@ -96,6 +97,10 @@ function parseBindingMarker(data) {
|
|
|
96
97
|
return { id, site, kind: "slot" };
|
|
97
98
|
if (kind === "o")
|
|
98
99
|
return { id, site, kind: "opaque" };
|
|
100
|
+
if (kind === "y")
|
|
101
|
+
return { id, site, kind: "try", arm: -1 };
|
|
102
|
+
if (kind.length === 2 && kind[0] === "y" && kind[1] >= "0" && kind[1] <= "2")
|
|
103
|
+
return { id, site, kind: "try", arm: kind.charCodeAt(1) - 48 };
|
|
99
104
|
if (kind.startsWith("k;")) {
|
|
100
105
|
const key = kind.slice(2);
|
|
101
106
|
try {
|
|
@@ -112,6 +117,7 @@ function parseBindingMarker(data) {
|
|
|
112
117
|
}
|
|
113
118
|
return null;
|
|
114
119
|
}
|
|
120
|
+
const BINDING_OPEN_TAIL_SOURCE = "f[01];b;[^;]+;[^;]+|b;[^;]+;(root|[^;]+;([tvso\\d]|-1|[1-9]\\d+|y[012]?|k;[sn]:[^]+))";
|
|
115
121
|
function isBindingOpenComment(data) {
|
|
116
122
|
const list = data.startsWith(BINDING_FOR_EMPTY_PREFIX) || data.startsWith(BINDING_FOR_ITEMS_PREFIX);
|
|
117
123
|
if (!list && !data.startsWith(BINDING_OPEN_PREFIX))
|
|
@@ -128,6 +134,8 @@ function isBindingOpenComment(data) {
|
|
|
128
134
|
if (siteEnd <= idEnd + 1 || siteEnd === data.length - 1)
|
|
129
135
|
return false;
|
|
130
136
|
const tail = siteEnd + 1;
|
|
137
|
+
if (data[tail] === "y")
|
|
138
|
+
return /^y[012]?$/.test(data.slice(tail));
|
|
131
139
|
if (data.length === tail + 1) {
|
|
132
140
|
const code = data.charCodeAt(tail);
|
|
133
141
|
return code === 116 || code === 118 || code === 115 || code === 111 || code >= 48 && code <= 57;
|
|
@@ -151,6 +159,7 @@ function isForBindingOpenComment(data) {
|
|
|
151
159
|
// Annotate the CommonJS export names for ESM import in node:
|
|
152
160
|
0 && (module.exports = {
|
|
153
161
|
BINDING_OPEN_PREFIX,
|
|
162
|
+
BINDING_OPEN_TAIL_SOURCE,
|
|
154
163
|
bindingRootMarker,
|
|
155
164
|
decodeBindingKey,
|
|
156
165
|
encodeBindingKey,
|
|
@@ -20,7 +20,8 @@ var dom_binding_styles_exports = {};
|
|
|
20
20
|
__export(dom_binding_styles_exports, {
|
|
21
21
|
__createBindingStyles: () => __createBindingStyles,
|
|
22
22
|
__normalizeBindingStyle: () => __normalizeBindingStyle,
|
|
23
|
-
__prepareBindingSources: () => __prepareBindingSources
|
|
23
|
+
__prepareBindingSources: () => __prepareBindingSources,
|
|
24
|
+
__retiredBindingSource: () => __retiredBindingSource
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(dom_binding_styles_exports);
|
|
26
27
|
var import_style_values = require("./style-values.cjs");
|
|
@@ -84,6 +85,12 @@ function __prepareBindingSources(reads, subscriptions, notify, active, run) {
|
|
|
84
85
|
}
|
|
85
86
|
};
|
|
86
87
|
}
|
|
88
|
+
function __retiredBindingSource(subscriptions) {
|
|
89
|
+
for (const source of subscriptions.keys())
|
|
90
|
+
if (source.inspect?.().retired)
|
|
91
|
+
return true;
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
87
94
|
function __normalizeBindingStyle(value) {
|
|
88
95
|
if (value == null || value === false || value === "")
|
|
89
96
|
return null;
|
|
@@ -208,6 +215,7 @@ function __createBindingStyles() {
|
|
|
208
215
|
};
|
|
209
216
|
return {
|
|
210
217
|
get,
|
|
218
|
+
retired: () => __retiredBindingSource(subscriptions),
|
|
211
219
|
preview(value) {
|
|
212
220
|
const reads = /* @__PURE__ */ new Map();
|
|
213
221
|
const previousObserver = (0, import_read_protocol.setNativeReadObserver)((source, version) => {
|
|
@@ -302,5 +310,6 @@ function __createBindingStyles() {
|
|
|
302
310
|
0 && (module.exports = {
|
|
303
311
|
__createBindingStyles,
|
|
304
312
|
__normalizeBindingStyle,
|
|
305
|
-
__prepareBindingSources
|
|
313
|
+
__prepareBindingSources,
|
|
314
|
+
__retiredBindingSource
|
|
306
315
|
});
|
|
@@ -20,6 +20,7 @@ var dom_bindings_exports = {};
|
|
|
20
20
|
__export(dom_bindings_exports, {
|
|
21
21
|
__adoptBindings: () => __adoptBindings,
|
|
22
22
|
__adoptScalarBindings: () => __adoptScalarBindings,
|
|
23
|
+
__bindingURL: () => __bindingURL,
|
|
23
24
|
__claimBinding: () => __claimBinding,
|
|
24
25
|
__createBindingStyleRestoration: () => __createBindingStyleRestoration,
|
|
25
26
|
__mountBindings: () => __mountBindings,
|
|
@@ -221,6 +222,7 @@ function writeFixedScalar(node, binding, value) {
|
|
|
221
222
|
} else if (node.getAttribute(name) !== value) {
|
|
222
223
|
node.setAttribute(name, value);
|
|
223
224
|
}
|
|
225
|
+
return value;
|
|
224
226
|
}
|
|
225
227
|
function normalize(binding, value) {
|
|
226
228
|
const type = typeof value;
|
|
@@ -265,6 +267,7 @@ function write(node, binding, value) {
|
|
|
265
267
|
node.removeAttribute(name);
|
|
266
268
|
} else if (node.getAttribute(name) !== value)
|
|
267
269
|
node.setAttribute(name, value);
|
|
270
|
+
return value;
|
|
268
271
|
} else if (binding[1] === "styleProperty") {
|
|
269
272
|
const style = node.style;
|
|
270
273
|
if (value === null) {
|
|
@@ -278,8 +281,13 @@ function write(node, binding, value) {
|
|
|
278
281
|
style.setProperty(name, text, priority);
|
|
279
282
|
}
|
|
280
283
|
} else
|
|
281
|
-
writeFixedScalar(node, binding, value);
|
|
284
|
+
return writeFixedScalar(node, binding, value);
|
|
282
285
|
}
|
|
286
|
+
const __bindingURL = [
|
|
287
|
+
(binding) => binding[1] === "url" || isFixedScalarChannel(binding),
|
|
288
|
+
normalize,
|
|
289
|
+
write
|
|
290
|
+
];
|
|
283
291
|
function __createBindingStyleRestoration(node, binding) {
|
|
284
292
|
if (binding[1] === "styleAttribute") {
|
|
285
293
|
let baseline2;
|
|
@@ -466,6 +474,7 @@ function __adoptBindings(root, descriptor, source, options) {
|
|
|
466
474
|
const binding = bindings[i];
|
|
467
475
|
if (binding[1] === "classToken")
|
|
468
476
|
previous[i] = next[i];
|
|
477
|
+
let written = void 0;
|
|
469
478
|
if (binding[1] === "styleObject") {
|
|
470
479
|
const projection = projections?.get(i);
|
|
471
480
|
if (projection)
|
|
@@ -481,12 +490,12 @@ function __adoptBindings(root, descriptor, source, options) {
|
|
|
481
490
|
styles.set(i, style = __createBindingStyleRestoration(nodes[binding[0]], binding));
|
|
482
491
|
style.write(next[i]);
|
|
483
492
|
} else
|
|
484
|
-
write(nodes[binding[0]], binding, next[i]);
|
|
493
|
+
written = write(nodes[binding[0]], binding, next[i]);
|
|
485
494
|
if (!disposed) {
|
|
486
495
|
previous[i] = next[i];
|
|
487
|
-
if (binding[1] === "attr" || binding[1] === "boolean" || binding[1] === "aria" || binding[1] === "class" || binding[1] === "styleProperty" || binding[1] === "text") {
|
|
496
|
+
if (binding[1] === "attr" || binding[1] === "boolean" || binding[1] === "aria" || binding[1] === "class" || binding[1] === "url" || binding[1] === "styleProperty" || binding[1] === "text") {
|
|
488
497
|
const [node, name] = owned[i];
|
|
489
|
-
let published2 =
|
|
498
|
+
let published2 = written;
|
|
490
499
|
if (binding[1] === "styleProperty") {
|
|
491
500
|
const style = node.style;
|
|
492
501
|
const value = style.getPropertyValue(binding[2]);
|
|
@@ -862,7 +871,8 @@ function __adoptBindings(root, descriptor, source, options) {
|
|
|
862
871
|
}
|
|
863
872
|
}
|
|
864
873
|
function __adoptScalarBindings(root, descriptor, source, options) {
|
|
865
|
-
|
|
874
|
+
const [accepts = isFixedScalarChannel, normalizeChannel = normalizeFixedScalar, writeChannel = writeFixedScalar] = descriptor.url ?? [];
|
|
875
|
+
if (descriptor.addressed || descriptor.handoff || descriptor.connectProjection || !descriptor.bindings.every(accepts))
|
|
866
876
|
throw new TypeError(__octaneDev ? "This DOM binding view requires the general adopter." : __octaneNoArgError(330));
|
|
867
877
|
if (!source || typeof source.getSnapshot !== "function" || typeof source.subscribe !== "function")
|
|
868
878
|
throw new TypeError(__octaneDev ? "DOM bindings require synchronous getSnapshot() and subscribe() methods." : __octaneNoArgError(325));
|
|
@@ -918,14 +928,14 @@ function __adoptScalarBindings(root, descriptor, source, options) {
|
|
|
918
928
|
if (next[i] === previous[i])
|
|
919
929
|
continue;
|
|
920
930
|
const binding = bindings[i];
|
|
921
|
-
|
|
931
|
+
const published = writeChannel(nodes[binding[0]], binding, next[i]);
|
|
922
932
|
if (!disposed) {
|
|
923
933
|
previous[i] = next[i];
|
|
924
934
|
const node = owned[i][0];
|
|
925
935
|
let claims2 = import_dom_binding_claims.domBindingClaims.get(node);
|
|
926
936
|
if (claims2 === void 0)
|
|
927
937
|
import_dom_binding_claims.domBindingClaims.set(node, claims2 = /* @__PURE__ */ new Map());
|
|
928
|
-
claims2.set(owned[i][1],
|
|
938
|
+
claims2.set(owned[i][1], published);
|
|
929
939
|
}
|
|
930
940
|
}
|
|
931
941
|
};
|
|
@@ -1001,19 +1011,19 @@ function __adoptScalarBindings(root, descriptor, source, options) {
|
|
|
1001
1011
|
}
|
|
1002
1012
|
}
|
|
1003
1013
|
}
|
|
1004
|
-
next = resolved.map((value, index) =>
|
|
1014
|
+
next = resolved.map((value, index) => normalizeChannel(bindings[index], value));
|
|
1005
1015
|
} else {
|
|
1006
1016
|
indices = [...signalUpdates];
|
|
1007
1017
|
signalUpdates.clear();
|
|
1008
1018
|
next = [];
|
|
1009
1019
|
for (const index of indices)
|
|
1010
|
-
next[index] =
|
|
1020
|
+
next[index] = normalizeChannel(bindings[index], signalConnections.get(index).get());
|
|
1011
1021
|
}
|
|
1012
1022
|
while (!preview && signalUpdates?.size && !dirty && !disposed) {
|
|
1013
1023
|
const pending = [...signalUpdates];
|
|
1014
1024
|
signalUpdates.clear();
|
|
1015
1025
|
for (const index of pending) {
|
|
1016
|
-
next[index] =
|
|
1026
|
+
next[index] = normalizeChannel(bindings[index], signalConnections.get(index).get());
|
|
1017
1027
|
if (indices && !indices.includes(index))
|
|
1018
1028
|
indices.push(index);
|
|
1019
1029
|
}
|
|
@@ -1109,6 +1119,7 @@ function __adoptScalarBindings(root, descriptor, source, options) {
|
|
|
1109
1119
|
0 && (module.exports = {
|
|
1110
1120
|
__adoptBindings,
|
|
1111
1121
|
__adoptScalarBindings,
|
|
1122
|
+
__bindingURL,
|
|
1112
1123
|
__claimBinding,
|
|
1113
1124
|
__createBindingStyleRestoration,
|
|
1114
1125
|
__mountBindings,
|
package/dist/cjs/dom-tables.cjs
CHANGED
|
@@ -24,6 +24,7 @@ __export(dom_tables_exports, {
|
|
|
24
24
|
MATHML_ONLY_TAGS: () => MATHML_ONLY_TAGS,
|
|
25
25
|
MUST_USE_PROPERTY_PROPS: () => MUST_USE_PROPERTY_PROPS,
|
|
26
26
|
POSITIVE_NUMERIC_ATTR_PROPS: () => POSITIVE_NUMERIC_ATTR_PROPS,
|
|
27
|
+
READ_ONLY_VALUE_INPUT_TYPES: () => READ_ONLY_VALUE_INPUT_TYPES,
|
|
27
28
|
SVG_ONLY_TAGS: () => SVG_ONLY_TAGS,
|
|
28
29
|
VOID_ELEMENTS: () => VOID_ELEMENTS,
|
|
29
30
|
cssStyleValue: () => import_style_values.cssStyleValue,
|
|
@@ -49,6 +50,15 @@ const VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
|
49
50
|
"track",
|
|
50
51
|
"wbr"
|
|
51
52
|
]);
|
|
53
|
+
const READ_ONLY_VALUE_INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
54
|
+
"button",
|
|
55
|
+
"checkbox",
|
|
56
|
+
"image",
|
|
57
|
+
"hidden",
|
|
58
|
+
"radio",
|
|
59
|
+
"reset",
|
|
60
|
+
"submit"
|
|
61
|
+
]);
|
|
52
62
|
const BOOLEAN_ATTR_PROPS = /* @__PURE__ */ new Set([
|
|
53
63
|
"allowfullscreen",
|
|
54
64
|
"async",
|
|
@@ -408,6 +418,7 @@ function isEnumeratedBooleanAttr(name) {
|
|
|
408
418
|
MATHML_ONLY_TAGS,
|
|
409
419
|
MUST_USE_PROPERTY_PROPS,
|
|
410
420
|
POSITIVE_NUMERIC_ATTR_PROPS,
|
|
421
|
+
READ_ONLY_VALUE_INPUT_TYPES,
|
|
411
422
|
SVG_ONLY_TAGS,
|
|
412
423
|
VOID_ELEMENTS,
|
|
413
424
|
cssStyleValue,
|
|
@@ -1079,6 +1079,11 @@ function formatClientError(code, ...args) {
|
|
|
1079
1079
|
"`<textarea>` children must be text: strings, numbers, or arrays of them. One child was %s. A textarea's content is its default value, so it cannot contain elements; render them outside the textarea or pass a string.",
|
|
1080
1080
|
args
|
|
1081
1081
|
);
|
|
1082
|
+
case 337:
|
|
1083
|
+
return (0, import_error_message.formatDevErrorMessage)(
|
|
1084
|
+
"Structural hydration leases do not support @try regions.",
|
|
1085
|
+
args
|
|
1086
|
+
);
|
|
1082
1087
|
default:
|
|
1083
1088
|
return (0, import_error_message.formatUnknownDevErrorMessage)(code);
|
|
1084
1089
|
}
|
|
@@ -24,6 +24,8 @@ __export(event_capture_exports, {
|
|
|
24
24
|
captureHydrationControlCandidate: () => import_control_capture2.captureHydrationControlCandidate,
|
|
25
25
|
captureNativeHydrationIntent: () => captureNativeHydrationIntent,
|
|
26
26
|
consumeHydrationControl: () => import_control_capture2.consumeHydrationControl,
|
|
27
|
+
heldHydrationReplays: () => heldHydrationReplays,
|
|
28
|
+
holdHydrationReplays: () => holdHydrationReplays,
|
|
27
29
|
hydrationEventPathWithin: () => hydrationEventPathWithin,
|
|
28
30
|
hydrationMarkerInteractionStatus: () => hydrationMarkerInteractionStatus,
|
|
29
31
|
initializeHydrationEventCapture: () => initializeHydrationEventCapture,
|
|
@@ -102,6 +104,18 @@ const HYDRATE_DELEGATED_DYNAMIC_MARKERS = /* @__PURE__ */ new WeakSet();
|
|
|
102
104
|
const HYDRATE_HANDLED_INTENT_EVENTS = /* @__PURE__ */ new WeakSet();
|
|
103
105
|
const HYDRATE_INTENT_DOCUMENTS = /* @__PURE__ */ new WeakSet();
|
|
104
106
|
let independentHydrationDocuments;
|
|
107
|
+
let hydrationReplayHolds;
|
|
108
|
+
let lifecycleHydrationMarkers;
|
|
109
|
+
function selectsHydrationLifecycleEvent(markers) {
|
|
110
|
+
for (let i = 0; i < markers.length; i++) {
|
|
111
|
+
for (let j = 0; j < import_interaction_config.HYDRATE_LIFECYCLE_INTERACTION_EVENTS.length; j++) {
|
|
112
|
+
if (markerStatus(markers[i], import_interaction_config.HYDRATE_LIFECYCLE_INTERACTION_EVENTS[j]) === "handles") {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
105
119
|
function hydrationEventPathWithin(root, target) {
|
|
106
120
|
if (!isHydrationNode(target))
|
|
107
121
|
return null;
|
|
@@ -204,6 +218,9 @@ function handleEarlyHydrationIntent(event, capturedSelection) {
|
|
|
204
218
|
}
|
|
205
219
|
if (candidate === null)
|
|
206
220
|
return;
|
|
221
|
+
const lifecycle = (0, import_interaction_config.isHydrationLifecycleEvent)(event.type);
|
|
222
|
+
if (lifecycle && !lifecycleHydrationMarkers?.has(candidate))
|
|
223
|
+
return;
|
|
207
224
|
for (let i = 0; i < markers.length; i++) {
|
|
208
225
|
const current = markers[i];
|
|
209
226
|
if (current !== candidate && candidate.contains(current) && current.getAttribute(import_hydration_markers2.HYDRATE_WHEN_ATTR) === "dynamic" && !HYDRATE_BOUNDARIES.has(current)) {
|
|
@@ -213,6 +230,12 @@ function handleEarlyHydrationIntent(event, capturedSelection) {
|
|
|
213
230
|
const path = hydrationEventPathWithin(candidate, event.target);
|
|
214
231
|
if (path === null)
|
|
215
232
|
return;
|
|
233
|
+
if (!lifecycle && !lifecycleHydrationMarkers?.has(candidate) && selectsHydrationLifecycleEvent(markers)) {
|
|
234
|
+
(lifecycleHydrationMarkers ??= /* @__PURE__ */ new WeakSet()).add(candidate);
|
|
235
|
+
for (let i = 0; i < import_interaction_config.HYDRATE_LIFECYCLE_INTERACTION_EVENTS.length; i++) {
|
|
236
|
+
target.ownerDocument.addEventListener(import_interaction_config.HYDRATE_LIFECYCLE_INTERACTION_EVENTS[i], handleEarlyHydrationIntent, true);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
216
239
|
const sequence = independent !== null && capturedSelection === void 0 ? advanceIndependentIntentSequence(target.ownerDocument) : 0;
|
|
217
240
|
const selection = candidate === independent ? capturedSelection === void 0 ? captureHydrationSelectionIntent(event, target, candidate, sequence) : capturedSelection : void 0;
|
|
218
241
|
const intent = selection ? { event, path, selection } : { event, path };
|
|
@@ -357,6 +380,18 @@ function unregisterHydrationIntentBoundary(marker, boundary) {
|
|
|
357
380
|
if (HYDRATE_BOUNDARIES.get(marker) === boundary)
|
|
358
381
|
HYDRATE_BOUNDARIES.delete(marker);
|
|
359
382
|
}
|
|
383
|
+
function holdHydrationReplays(marker, hold) {
|
|
384
|
+
(hydrationReplayHolds ??= /* @__PURE__ */ new WeakMap()).set(marker, hold);
|
|
385
|
+
}
|
|
386
|
+
function heldHydrationReplays(marker) {
|
|
387
|
+
const hold = hydrationReplayHolds?.get(marker);
|
|
388
|
+
if (hold === void 0)
|
|
389
|
+
return null;
|
|
390
|
+
const queue = hold();
|
|
391
|
+
if (queue === null)
|
|
392
|
+
hydrationReplayHolds.delete(marker);
|
|
393
|
+
return queue;
|
|
394
|
+
}
|
|
360
395
|
function takePendingHydrationIntents(marker) {
|
|
361
396
|
const intents = HYDRATE_PENDING_INTENTS.get(marker);
|
|
362
397
|
HYDRATE_PENDING_INTENTS.delete(marker);
|
|
@@ -388,6 +423,8 @@ function markDelegatedDynamicHydrationIntent(marker) {
|
|
|
388
423
|
captureHydrationControlCandidate,
|
|
389
424
|
captureNativeHydrationIntent,
|
|
390
425
|
consumeHydrationControl,
|
|
426
|
+
heldHydrationReplays,
|
|
427
|
+
holdHydrationReplays,
|
|
391
428
|
hydrationEventPathWithin,
|
|
392
429
|
hydrationMarkerInteractionStatus,
|
|
393
430
|
initializeHydrationEventCapture,
|
|
@@ -22,9 +22,11 @@ __export(interaction_config_exports, {
|
|
|
22
22
|
EARLY_HYDRATION_INTENTS_LIMIT: () => EARLY_HYDRATION_INTENTS_LIMIT,
|
|
23
23
|
HYDRATE_DEFAULT_INTERACTION_EVENTS: () => HYDRATE_DEFAULT_INTERACTION_EVENTS,
|
|
24
24
|
HYDRATE_INTERACTION_EVENTS_ATTR: () => HYDRATE_INTERACTION_EVENTS_ATTR,
|
|
25
|
+
HYDRATE_LIFECYCLE_INTERACTION_EVENTS: () => HYDRATE_LIFECYCLE_INTERACTION_EVENTS,
|
|
25
26
|
HYDRATE_NATIVE_DEFAULT_INTERACTION_EVENTS: () => HYDRATE_NATIVE_DEFAULT_INTERACTION_EVENTS,
|
|
26
27
|
HYDRATE_SELECTION_ATTR: () => HYDRATE_SELECTION_ATTR,
|
|
27
|
-
HYDRATE_SUPPORTED_INTERACTION_EVENTS: () => HYDRATE_SUPPORTED_INTERACTION_EVENTS
|
|
28
|
+
HYDRATE_SUPPORTED_INTERACTION_EVENTS: () => HYDRATE_SUPPORTED_INTERACTION_EVENTS,
|
|
29
|
+
isHydrationLifecycleEvent: () => isHydrationLifecycleEvent
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(interaction_config_exports);
|
|
30
32
|
const HYDRATE_INTERACTION_EVENTS_ATTR = "data-octane-hydrate-interaction-events";
|
|
@@ -55,6 +57,10 @@ const HYDRATE_SUPPORTED_INTERACTION_EVENTS = [
|
|
|
55
57
|
"touchend",
|
|
56
58
|
"touchstart"
|
|
57
59
|
];
|
|
60
|
+
const HYDRATE_LIFECYCLE_INTERACTION_EVENTS = ["pointercancel", "pointermove"];
|
|
61
|
+
function isHydrationLifecycleEvent(type) {
|
|
62
|
+
return HYDRATE_LIFECYCLE_INTERACTION_EVENTS.includes(type);
|
|
63
|
+
}
|
|
58
64
|
const HYDRATE_NATIVE_DEFAULT_INTERACTION_EVENTS = [
|
|
59
65
|
"beforeinput",
|
|
60
66
|
"compositionend",
|
|
@@ -63,6 +69,8 @@ const HYDRATE_NATIVE_DEFAULT_INTERACTION_EVENTS = [
|
|
|
63
69
|
"input",
|
|
64
70
|
"mousedown",
|
|
65
71
|
"pointerdown",
|
|
72
|
+
"pointermove",
|
|
73
|
+
"pointerup",
|
|
66
74
|
"touchend",
|
|
67
75
|
"touchstart"
|
|
68
76
|
];
|
|
@@ -85,7 +93,9 @@ const HYDRATE_DEFAULT_INTERACTION_EVENTS = [
|
|
|
85
93
|
EARLY_HYDRATION_INTENTS_LIMIT,
|
|
86
94
|
HYDRATE_DEFAULT_INTERACTION_EVENTS,
|
|
87
95
|
HYDRATE_INTERACTION_EVENTS_ATTR,
|
|
96
|
+
HYDRATE_LIFECYCLE_INTERACTION_EVENTS,
|
|
88
97
|
HYDRATE_NATIVE_DEFAULT_INTERACTION_EVENTS,
|
|
89
98
|
HYDRATE_SELECTION_ATTR,
|
|
90
|
-
HYDRATE_SUPPORTED_INTERACTION_EVENTS
|
|
99
|
+
HYDRATE_SUPPORTED_INTERACTION_EVENTS,
|
|
100
|
+
isHydrationLifecycleEvent
|
|
91
101
|
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var replay_event_exports = {};
|
|
20
|
+
__export(replay_event_exports, {
|
|
21
|
+
cloneHydrationReplayEvent: () => cloneHydrationReplayEvent
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(replay_event_exports);
|
|
24
|
+
function cloneHydrationReplayEvent(event, target) {
|
|
25
|
+
const clone = constructHydrationReplayEvent(event, target);
|
|
26
|
+
Object.defineProperty(clone, "timeStamp", { value: event.timeStamp, configurable: true });
|
|
27
|
+
return clone;
|
|
28
|
+
}
|
|
29
|
+
function constructHydrationReplayEvent(event, target) {
|
|
30
|
+
const realm = target.ownerDocument.defaultView ?? globalThis;
|
|
31
|
+
if (realm.PointerEvent !== void 0 && event instanceof realm.PointerEvent) {
|
|
32
|
+
return new realm.PointerEvent(event.type, event);
|
|
33
|
+
}
|
|
34
|
+
if (realm.KeyboardEvent !== void 0 && event instanceof realm.KeyboardEvent) {
|
|
35
|
+
return new realm.KeyboardEvent(event.type, event);
|
|
36
|
+
}
|
|
37
|
+
if (realm.MouseEvent !== void 0 && event instanceof realm.MouseEvent) {
|
|
38
|
+
return new realm.MouseEvent(event.type, event);
|
|
39
|
+
}
|
|
40
|
+
if (realm.FocusEvent !== void 0 && event instanceof realm.FocusEvent) {
|
|
41
|
+
return new realm.FocusEvent(event.type, event);
|
|
42
|
+
}
|
|
43
|
+
if (realm.InputEvent !== void 0 && event instanceof realm.InputEvent) {
|
|
44
|
+
return new realm.InputEvent(event.type, event);
|
|
45
|
+
}
|
|
46
|
+
if (realm.CompositionEvent !== void 0 && event instanceof realm.CompositionEvent) {
|
|
47
|
+
return new realm.CompositionEvent(event.type, event);
|
|
48
|
+
}
|
|
49
|
+
if (realm.TouchEvent !== void 0 && event instanceof realm.TouchEvent) {
|
|
50
|
+
return cloneHydrationTouchEvent(event, realm.TouchEvent);
|
|
51
|
+
}
|
|
52
|
+
const brand = Object.prototype.toString.call(event);
|
|
53
|
+
if (realm.PointerEvent !== void 0 && brand === "[object PointerEvent]") {
|
|
54
|
+
return new realm.PointerEvent(event.type, event);
|
|
55
|
+
}
|
|
56
|
+
if (realm.KeyboardEvent !== void 0 && brand === "[object KeyboardEvent]") {
|
|
57
|
+
return new realm.KeyboardEvent(event.type, event);
|
|
58
|
+
}
|
|
59
|
+
if (realm.MouseEvent !== void 0 && brand === "[object MouseEvent]") {
|
|
60
|
+
return new realm.MouseEvent(event.type, event);
|
|
61
|
+
}
|
|
62
|
+
if (realm.FocusEvent !== void 0 && brand === "[object FocusEvent]") {
|
|
63
|
+
return new realm.FocusEvent(event.type, event);
|
|
64
|
+
}
|
|
65
|
+
if (realm.InputEvent !== void 0 && brand === "[object InputEvent]") {
|
|
66
|
+
return new realm.InputEvent(event.type, event);
|
|
67
|
+
}
|
|
68
|
+
if (realm.CompositionEvent !== void 0 && brand === "[object CompositionEvent]") {
|
|
69
|
+
return new realm.CompositionEvent(event.type, event);
|
|
70
|
+
}
|
|
71
|
+
if (realm.TouchEvent !== void 0 && brand === "[object TouchEvent]") {
|
|
72
|
+
return cloneHydrationTouchEvent(event, realm.TouchEvent);
|
|
73
|
+
}
|
|
74
|
+
return new realm.Event(event.type, event);
|
|
75
|
+
}
|
|
76
|
+
function cloneHydrationTouchEvent(event, TouchEventImpl) {
|
|
77
|
+
return new TouchEventImpl(event.type, {
|
|
78
|
+
bubbles: event.bubbles,
|
|
79
|
+
cancelable: event.cancelable,
|
|
80
|
+
composed: event.composed,
|
|
81
|
+
detail: event.detail,
|
|
82
|
+
ctrlKey: event.ctrlKey,
|
|
83
|
+
shiftKey: event.shiftKey,
|
|
84
|
+
altKey: event.altKey,
|
|
85
|
+
metaKey: event.metaKey,
|
|
86
|
+
touches: Array.from(event.touches),
|
|
87
|
+
targetTouches: Array.from(event.targetTouches),
|
|
88
|
+
changedTouches: Array.from(event.changedTouches)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
92
|
+
0 && (module.exports = {
|
|
93
|
+
cloneHydrationReplayEvent
|
|
94
|
+
});
|
|
@@ -36,7 +36,11 @@ __export(hydration_markers_exports, {
|
|
|
36
36
|
HYDRATION_FOR_PREFIX: () => HYDRATION_FOR_PREFIX,
|
|
37
37
|
HYDRATION_START: () => HYDRATION_START,
|
|
38
38
|
INDEPENDENT_HYDRATE_MANIFEST_ATTR: () => INDEPENDENT_HYDRATE_MANIFEST_ATTR,
|
|
39
|
+
NATIVE_SIGNAL_FRESH_COMMENT: () => NATIVE_SIGNAL_FRESH_COMMENT,
|
|
39
40
|
SIGNAL_CONTROL_ATTR: () => SIGNAL_CONTROL_ATTR,
|
|
41
|
+
STREAM_SEED_COMMENT: () => STREAM_SEED_COMMENT,
|
|
42
|
+
SUSPENSE_RESOLVED_COMMENT: () => SUSPENSE_RESOLVED_COMMENT,
|
|
43
|
+
TRY_CATCH_COMMENT: () => TRY_CATCH_COMMENT,
|
|
40
44
|
formatUseId: () => formatUseId
|
|
41
45
|
});
|
|
42
46
|
module.exports = __toCommonJS(hydration_markers_exports);
|
|
@@ -59,6 +63,10 @@ const HYDRATION_FOR_PREFIX = "[f";
|
|
|
59
63
|
const HYDRATION_FOR_EMPTY = "[f0";
|
|
60
64
|
const HYDRATION_FOR_ITEMS = "[f1";
|
|
61
65
|
const HYDRATION_FOR_ARM_INDEX = HYDRATION_FOR_PREFIX.length;
|
|
66
|
+
const TRY_CATCH_COMMENT = "oct-catch:";
|
|
67
|
+
const SUSPENSE_RESOLVED_COMMENT = "oct-suspense:";
|
|
68
|
+
const STREAM_SEED_COMMENT = "oct-seed:";
|
|
69
|
+
const NATIVE_SIGNAL_FRESH_COMMENT = "oct-native-fresh:";
|
|
62
70
|
function formatUseId(prefix, ordinal) {
|
|
63
71
|
return ":" + prefix + "in-" + ordinal.toString(36) + ":";
|
|
64
72
|
}
|
|
@@ -82,6 +90,10 @@ function formatUseId(prefix, ordinal) {
|
|
|
82
90
|
HYDRATION_FOR_PREFIX,
|
|
83
91
|
HYDRATION_START,
|
|
84
92
|
INDEPENDENT_HYDRATE_MANIFEST_ATTR,
|
|
93
|
+
NATIVE_SIGNAL_FRESH_COMMENT,
|
|
85
94
|
SIGNAL_CONTROL_ATTR,
|
|
95
|
+
STREAM_SEED_COMMENT,
|
|
96
|
+
SUSPENSE_RESOLVED_COMMENT,
|
|
97
|
+
TRY_CATCH_COMMENT,
|
|
86
98
|
formatUseId
|
|
87
99
|
});
|