octane 0.3.1 → 0.3.2
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 +18 -25
- package/dist/cjs/css.cjs +6 -0
- package/dist/cjs/dom-binding-protocol.cjs +37 -14
- package/dist/cjs/hydration/control-capture.cjs +12 -4
- package/dist/cjs/hydration/event-capture.cjs +6 -7
- package/dist/cjs/hydration-markers.cjs +40 -2
- package/dist/cjs/runtime-tags.cjs +55 -0
- package/dist/cjs/runtime.cjs +136 -113
- package/dist/cjs/runtime.server.cjs +34 -41
- package/dist/cjs/server/streamed-signals.cjs +7 -4
- package/dist/cjs/signals/control-binding.cjs +2 -1
- package/dist/cjs/stream-protocol.cjs +9 -8
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/compile.js +70 -17
- package/dist/compiler/dom-bindings.js +5 -0
- package/dist/constants.d.ts +7 -18
- package/dist/constants.js +11 -9
- package/dist/css.d.ts +7 -0
- package/dist/css.js +4 -0
- package/dist/dom-binding-program.js +12 -5
- package/dist/dom-binding-protocol.d.ts +14 -1
- package/dist/dom-binding-protocol.js +40 -14
- package/dist/hydration/control-capture.d.ts +2 -0
- package/dist/hydration/control-capture.js +18 -5
- package/dist/hydration/event-capture.js +1 -2
- package/dist/hydration/independent-island.js +5 -5
- package/dist/hydration-markers.d.ts +30 -0
- package/dist/hydration-markers.js +27 -1
- package/dist/react/index.js +1 -1
- package/dist/react/react-compat-shared.js +5 -3
- package/dist/react/shared.d.ts +1 -3
- package/dist/react/shared.js +1 -1
- package/dist/runtime-tags.d.ts +34 -0
- package/dist/runtime-tags.js +22 -0
- package/dist/runtime.d.ts +5 -14
- package/dist/runtime.js +116 -71
- package/dist/runtime.server.d.ts +2 -3
- package/dist/runtime.server.js +25 -17
- package/dist/server/streamed-signals.js +7 -4
- package/dist/signals/control-binding.js +4 -2
- package/dist/stream-protocol.js +20 -9
- package/dist/universal-core.js +8 -4
- package/dist/universal-native.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/cjs/constants.cjs
CHANGED
|
@@ -26,26 +26,26 @@ __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: () => HYDRATE_ID_ATTR,
|
|
30
|
-
HYDRATE_ID_COUNT_ATTR: () => HYDRATE_ID_COUNT_ATTR,
|
|
31
|
-
HYDRATE_INDEPENDENT_ATTR: () =>
|
|
32
|
-
HYDRATE_INPUT_ATTR: () =>
|
|
33
|
-
HYDRATE_SEED_ATTR: () => HYDRATE_SEED_ATTR,
|
|
29
|
+
HYDRATE_ID_ATTR: () => import_hydration_markers2.HYDRATE_ID_ATTR,
|
|
30
|
+
HYDRATE_ID_COUNT_ATTR: () => import_hydration_markers2.HYDRATE_ID_COUNT_ATTR,
|
|
31
|
+
HYDRATE_INDEPENDENT_ATTR: () => import_hydration_markers2.HYDRATE_INDEPENDENT_ATTR,
|
|
32
|
+
HYDRATE_INPUT_ATTR: () => import_hydration_markers2.HYDRATE_INPUT_ATTR,
|
|
33
|
+
HYDRATE_SEED_ATTR: () => import_hydration_markers2.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: () => HYDRATE_WHEN_ATTR,
|
|
38
|
-
HYDRATION_END: () => HYDRATION_END,
|
|
39
|
-
HYDRATION_FOR_EMPTY: () => HYDRATION_FOR_EMPTY,
|
|
40
|
-
HYDRATION_FOR_ITEMS: () => HYDRATION_FOR_ITEMS,
|
|
37
|
+
HYDRATE_WHEN_ATTR: () => import_hydration_markers2.HYDRATE_WHEN_ATTR,
|
|
38
|
+
HYDRATION_END: () => import_hydration_markers.HYDRATION_END,
|
|
39
|
+
HYDRATION_FOR_EMPTY: () => import_hydration_markers.HYDRATION_FOR_EMPTY,
|
|
40
|
+
HYDRATION_FOR_ITEMS: () => import_hydration_markers.HYDRATION_FOR_ITEMS,
|
|
41
41
|
HYDRATION_RANGE_BOUNDARY: () => HYDRATION_RANGE_BOUNDARY,
|
|
42
|
-
HYDRATION_START: () => HYDRATION_START,
|
|
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_markers2.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_markers2.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,
|
|
@@ -66,20 +66,17 @@ __export(constants_exports, {
|
|
|
66
66
|
isUnitlessStyleProp: () => isUnitlessStyleProp
|
|
67
67
|
});
|
|
68
68
|
module.exports = __toCommonJS(constants_exports);
|
|
69
|
+
var import_hydration_markers = require("./hydration-markers.cjs");
|
|
69
70
|
var import_stream_protocol = require("./stream-protocol.cjs");
|
|
70
71
|
var import_stream_protocol2 = require("./stream-protocol.cjs");
|
|
71
|
-
var
|
|
72
|
+
var import_hydration_markers2 = require("./hydration-markers.cjs");
|
|
72
73
|
var import_stream_protocol3 = require("./stream-protocol.cjs");
|
|
73
74
|
var import_stream_protocol4 = require("./stream-protocol.cjs");
|
|
74
75
|
var import_dom_tables = require("./dom-tables.cjs");
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
|
|
80
|
-
const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
|
|
81
|
-
const FOR_BLOCK_OPEN_EMPTY = `<!--${HYDRATION_FOR_EMPTY}-->`;
|
|
82
|
-
const FOR_BLOCK_OPEN_ITEMS = `<!--${HYDRATION_FOR_ITEMS}-->`;
|
|
76
|
+
const BLOCK_OPEN = `<!--${import_hydration_markers.HYDRATION_START}-->`;
|
|
77
|
+
const BLOCK_CLOSE = `<!--${import_hydration_markers.HYDRATION_END}-->`;
|
|
78
|
+
const FOR_BLOCK_OPEN_EMPTY = `<!--${import_hydration_markers.HYDRATION_FOR_EMPTY}-->`;
|
|
79
|
+
const FOR_BLOCK_OPEN_ITEMS = `<!--${import_hydration_markers.HYDRATION_FOR_ITEMS}-->`;
|
|
83
80
|
const EMPTY_COMMENT = "<!---->";
|
|
84
81
|
const HYDRATION_TEXT_SEP = " ";
|
|
85
82
|
const SUSPENSE_RESOLVED_COMMENT = "oct-suspense:";
|
|
@@ -96,10 +93,6 @@ const HYDRATION_RANGE_BOUNDARY = /* @__PURE__ */ Symbol.for(
|
|
|
96
93
|
);
|
|
97
94
|
const HYDRATE_STATIC_ID_COUNT_PREFIX = "octane-static-hydrate:";
|
|
98
95
|
const HYDRATE_STATIC_END = "/octane-static-hydrate";
|
|
99
|
-
const HYDRATE_ID_ATTR = "data-octane-hydrate-id";
|
|
100
|
-
const HYDRATE_WHEN_ATTR = "data-octane-hydrate-when";
|
|
101
|
-
const HYDRATE_ID_COUNT_ATTR = "data-octane-hydrate-id-count";
|
|
102
|
-
const HYDRATE_SEED_ATTR = "data-octane-hydrate-seed";
|
|
103
96
|
const STREAM_SEGMENT_ATTR = "data-oct-s";
|
|
104
97
|
const STREAM_SEED_ATTR = "data-oct-seed";
|
|
105
98
|
const STREAM_RESOURCE_ATTR = "data-oct-fr";
|
package/dist/cjs/css.cjs
CHANGED
|
@@ -18,6 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var css_exports = {};
|
|
20
20
|
__export(css_exports, {
|
|
21
|
+
VIEW_TRANSITION_SCOPE_CSS: () => VIEW_TRANSITION_SCOPE_CSS,
|
|
22
|
+
VIEW_TRANSITION_SCOPE_STYLE_ID: () => VIEW_TRANSITION_SCOPE_STYLE_ID,
|
|
21
23
|
devWarnStyleCoercion: () => devWarnStyleCoercion,
|
|
22
24
|
devWarnStyleProperty: () => devWarnStyleProperty,
|
|
23
25
|
mergeClass: () => mergeClass,
|
|
@@ -94,8 +96,12 @@ function devWarnStyleCoercion(name, value) {
|
|
|
94
96
|
`The provided \`${name}\` CSS property is an unsupported type ${valueType}. This value must be coerced to a string before using it here.`
|
|
95
97
|
);
|
|
96
98
|
}
|
|
99
|
+
const VIEW_TRANSITION_SCOPE_STYLE_ID = "octane-view-transition-scope";
|
|
100
|
+
const VIEW_TRANSITION_SCOPE_CSS = '[vt-scope="element"]{view-transition-scope:all!important}';
|
|
97
101
|
// Annotate the CommonJS export names for ESM import in node:
|
|
98
102
|
0 && (module.exports = {
|
|
103
|
+
VIEW_TRANSITION_SCOPE_CSS,
|
|
104
|
+
VIEW_TRANSITION_SCOPE_STYLE_ID,
|
|
99
105
|
devWarnStyleCoercion,
|
|
100
106
|
devWarnStyleProperty,
|
|
101
107
|
mergeClass,
|
|
@@ -18,12 +18,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var dom_binding_protocol_exports = {};
|
|
20
20
|
__export(dom_binding_protocol_exports, {
|
|
21
|
+
BINDING_OPEN_PREFIX: () => BINDING_OPEN_PREFIX,
|
|
22
|
+
bindingRootMarker: () => bindingRootMarker,
|
|
21
23
|
decodeBindingKey: () => decodeBindingKey,
|
|
22
24
|
encodeBindingKey: () => encodeBindingKey,
|
|
23
25
|
isBindingOpenComment: () => isBindingOpenComment,
|
|
26
|
+
isForBindingOpenComment: () => isForBindingOpenComment,
|
|
24
27
|
parseBindingMarker: () => parseBindingMarker
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(dom_binding_protocol_exports);
|
|
30
|
+
var import_hydration_markers = require("./hydration-markers.cjs");
|
|
31
|
+
const BINDING_OPEN_PREFIX = import_hydration_markers.HYDRATION_START + "b;";
|
|
32
|
+
const BINDING_RECEIPT = ";b;";
|
|
33
|
+
const BINDING_FOR_EMPTY_PREFIX = import_hydration_markers.HYDRATION_FOR_EMPTY + BINDING_RECEIPT;
|
|
34
|
+
const BINDING_FOR_ITEMS_PREFIX = import_hydration_markers.HYDRATION_FOR_ITEMS + BINDING_RECEIPT;
|
|
35
|
+
const BINDING_FOR_ID_START = BINDING_FOR_EMPTY_PREFIX.length;
|
|
36
|
+
const BINDING_ID_START = BINDING_OPEN_PREFIX.length;
|
|
37
|
+
const BINDING_ROOT_SITE = "root";
|
|
38
|
+
const BINDING_ROOT_SUFFIX = ";" + BINDING_ROOT_SITE;
|
|
39
|
+
function bindingRootMarker(id) {
|
|
40
|
+
return BINDING_OPEN_PREFIX + id + BINDING_ROOT_SUFFIX;
|
|
41
|
+
}
|
|
27
42
|
function encodeBindingKey(key) {
|
|
28
43
|
if (typeof key === "string")
|
|
29
44
|
return "s:" + JSON.stringify(key).replace(/-/g, "\\u002d").replace(/</g, "\\u003c");
|
|
@@ -43,21 +58,22 @@ function decodeBindingKey(encoded) {
|
|
|
43
58
|
throw new TypeError("A DOM presentation key has invalid serialized identity.");
|
|
44
59
|
}
|
|
45
60
|
function parseBindingMarker(data) {
|
|
46
|
-
if (data.startsWith(
|
|
47
|
-
const separator = data.indexOf(";",
|
|
48
|
-
if (separator <=
|
|
61
|
+
if (data.startsWith(BINDING_FOR_EMPTY_PREFIX) || data.startsWith(BINDING_FOR_ITEMS_PREFIX)) {
|
|
62
|
+
const separator = data.indexOf(";", BINDING_FOR_ID_START);
|
|
63
|
+
if (separator <= BINDING_FOR_ID_START || separator === data.length - 1) return null;
|
|
49
64
|
return {
|
|
50
|
-
id: data.slice(
|
|
65
|
+
id: data.slice(BINDING_FOR_ID_START, separator),
|
|
51
66
|
site: data.slice(separator + 1),
|
|
52
67
|
kind: "for",
|
|
53
|
-
arm: data.charCodeAt(
|
|
68
|
+
arm: data.charCodeAt(import_hydration_markers.HYDRATION_FOR_ARM_INDEX) - 48
|
|
54
69
|
};
|
|
55
70
|
}
|
|
56
|
-
if (!data.startsWith(
|
|
57
|
-
const idEnd = data.indexOf(";",
|
|
58
|
-
if (idEnd <=
|
|
59
|
-
const id = data.slice(
|
|
60
|
-
if (data.slice(idEnd + 1) ===
|
|
71
|
+
if (!data.startsWith(BINDING_OPEN_PREFIX)) return null;
|
|
72
|
+
const idEnd = data.indexOf(";", BINDING_ID_START);
|
|
73
|
+
if (idEnd <= BINDING_ID_START || idEnd === data.length - 1) return null;
|
|
74
|
+
const id = data.slice(BINDING_ID_START, idEnd);
|
|
75
|
+
if (data.slice(idEnd + 1) === BINDING_ROOT_SITE)
|
|
76
|
+
return { id, site: BINDING_ROOT_SITE, kind: "root" };
|
|
61
77
|
const siteEnd = data.indexOf(";", idEnd + 1);
|
|
62
78
|
if (siteEnd <= idEnd + 1 || siteEnd === data.length - 1) return null;
|
|
63
79
|
const site = data.slice(idEnd + 1, siteEnd);
|
|
@@ -82,13 +98,14 @@ function parseBindingMarker(data) {
|
|
|
82
98
|
return null;
|
|
83
99
|
}
|
|
84
100
|
function isBindingOpenComment(data) {
|
|
85
|
-
const list = data.startsWith(
|
|
86
|
-
if (!list && !data.startsWith(
|
|
87
|
-
const idStart = list ?
|
|
101
|
+
const list = data.startsWith(BINDING_FOR_EMPTY_PREFIX) || data.startsWith(BINDING_FOR_ITEMS_PREFIX);
|
|
102
|
+
if (!list && !data.startsWith(BINDING_OPEN_PREFIX)) return false;
|
|
103
|
+
const idStart = list ? BINDING_FOR_ID_START : BINDING_ID_START;
|
|
88
104
|
const idEnd = data.indexOf(";", idStart);
|
|
89
105
|
if (idEnd <= idStart || idEnd === data.length - 1) return false;
|
|
90
106
|
if (list) return data.indexOf(";", idEnd + 1) === -1;
|
|
91
|
-
if (data.length - idEnd ===
|
|
107
|
+
if (data.length - idEnd === BINDING_ROOT_SUFFIX.length && data.endsWith(BINDING_ROOT_SUFFIX))
|
|
108
|
+
return true;
|
|
92
109
|
const siteEnd = data.indexOf(";", idEnd + 1);
|
|
93
110
|
if (siteEnd <= idEnd + 1 || siteEnd === data.length - 1) return false;
|
|
94
111
|
const tail = siteEnd + 1;
|
|
@@ -106,10 +123,16 @@ function isBindingOpenComment(data) {
|
|
|
106
123
|
}
|
|
107
124
|
return true;
|
|
108
125
|
}
|
|
126
|
+
function isForBindingOpenComment(data) {
|
|
127
|
+
return data.startsWith(import_hydration_markers.HYDRATION_FOR_PREFIX) && isBindingOpenComment(data);
|
|
128
|
+
}
|
|
109
129
|
// Annotate the CommonJS export names for ESM import in node:
|
|
110
130
|
0 && (module.exports = {
|
|
131
|
+
BINDING_OPEN_PREFIX,
|
|
132
|
+
bindingRootMarker,
|
|
111
133
|
decodeBindingKey,
|
|
112
134
|
encodeBindingKey,
|
|
113
135
|
isBindingOpenComment,
|
|
136
|
+
isForBindingOpenComment,
|
|
114
137
|
parseBindingMarker
|
|
115
138
|
});
|
|
@@ -23,16 +23,16 @@ __export(control_capture_exports, {
|
|
|
23
23
|
consumeHydrationControl: () => consumeHydrationControl,
|
|
24
24
|
initializeHydrationControlCapture: () => initializeHydrationControlCapture,
|
|
25
25
|
isEarlyHydrationIntentCurrent: () => isEarlyHydrationIntentCurrent,
|
|
26
|
+
isRestoredHydrationTextarea: () => isRestoredHydrationTextarea,
|
|
26
27
|
snapshotHydrationControl: () => snapshotHydrationControl
|
|
27
28
|
});
|
|
28
29
|
module.exports = __toCommonJS(control_capture_exports);
|
|
29
30
|
var import_hydration_markers = require("../hydration-markers.cjs");
|
|
30
31
|
var import_interaction_config = require("./interaction-config.cjs");
|
|
31
32
|
var import_early_values = require("../signals/early-values.cjs");
|
|
32
|
-
const HYDRATE_MARKER_SELECTOR = "[data-octane-hydrate-id]";
|
|
33
33
|
const HYDRATE_CONTROL_DOCUMENTS = /* @__PURE__ */ new WeakSet();
|
|
34
34
|
function isEarlyHydrationIntentCurrent([event, target, boundary, id, when, events], ownerDocument) {
|
|
35
|
-
return event.target === target && target.isConnected && boundary.isConnected && target.ownerDocument === ownerDocument && boundary.ownerDocument === ownerDocument && target.closest(`[${import_hydration_markers.HYDRATE_INDEPENDENT_ATTR}]`) === boundary && boundary.getAttribute(
|
|
35
|
+
return event.target === target && target.isConnected && boundary.isConnected && target.ownerDocument === ownerDocument && boundary.ownerDocument === ownerDocument && target.closest(`[${import_hydration_markers.HYDRATE_INDEPENDENT_ATTR}]`) === boundary && boundary.getAttribute(import_hydration_markers.HYDRATE_ID_ATTR) === id && boundary.getAttribute(import_hydration_markers.HYDRATE_WHEN_ATTR) === when && boundary.getAttribute(import_interaction_config.HYDRATE_INTERACTION_EVENTS_ATTR) === events;
|
|
36
36
|
}
|
|
37
37
|
function isHydrationElement(target) {
|
|
38
38
|
return target !== null && target.nodeType === 1;
|
|
@@ -128,6 +128,13 @@ function snapshotHydrationControl(control) {
|
|
|
128
128
|
composing: record?.composing ?? false
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
+
function isRestoredHydrationTextarea(control, value) {
|
|
132
|
+
if (control.localName !== "textarea" || typeof value !== "string" || HYDRATE_CONTROL_RECORDS.get(control)?.composing === true)
|
|
133
|
+
return false;
|
|
134
|
+
const textarea = control;
|
|
135
|
+
const baseline = textarea.defaultValue.replace(/\r\n?/g, "\n");
|
|
136
|
+
return value.replace(/\r\n?/g, "\n") === baseline && textarea.value !== baseline;
|
|
137
|
+
}
|
|
131
138
|
function captureHydrationControlCandidate(control) {
|
|
132
139
|
const snapshot = snapshotHydrationControl(control);
|
|
133
140
|
if (snapshot === null) return null;
|
|
@@ -135,7 +142,7 @@ function captureHydrationControlCandidate(control) {
|
|
|
135
142
|
return {
|
|
136
143
|
control,
|
|
137
144
|
bindingId: control.getAttribute(import_hydration_markers.HYDRATE_INPUT_ATTR),
|
|
138
|
-
boundaryId: control.closest(HYDRATE_MARKER_SELECTOR)?.getAttribute(
|
|
145
|
+
boundaryId: control.closest(import_hydration_markers.HYDRATE_MARKER_SELECTOR)?.getAttribute(import_hydration_markers.HYDRATE_ID_ATTR) ?? null,
|
|
139
146
|
snapshot
|
|
140
147
|
};
|
|
141
148
|
}
|
|
@@ -150,7 +157,7 @@ function sameHydrationControlValue(left, right) {
|
|
|
150
157
|
}
|
|
151
158
|
function applyHydrationControlCandidate(candidate, value) {
|
|
152
159
|
const control = candidate.control;
|
|
153
|
-
if (!control.isConnected || control.getAttribute(import_hydration_markers.HYDRATE_INPUT_ATTR) !== candidate.bindingId || (control.closest(HYDRATE_MARKER_SELECTOR)?.getAttribute(
|
|
160
|
+
if (!control.isConnected || control.getAttribute(import_hydration_markers.HYDRATE_INPUT_ATTR) !== candidate.bindingId || (control.closest(import_hydration_markers.HYDRATE_MARKER_SELECTOR)?.getAttribute(import_hydration_markers.HYDRATE_ID_ATTR) ?? null) !== candidate.boundaryId) {
|
|
154
161
|
return false;
|
|
155
162
|
}
|
|
156
163
|
const current = snapshotHydrationControl(control);
|
|
@@ -240,5 +247,6 @@ function initializeHydrationControlCapture(ownerDocument) {
|
|
|
240
247
|
consumeHydrationControl,
|
|
241
248
|
initializeHydrationControlCapture,
|
|
242
249
|
isEarlyHydrationIntentCurrent,
|
|
250
|
+
isRestoredHydrationTextarea,
|
|
243
251
|
snapshotHydrationControl
|
|
244
252
|
});
|
|
@@ -44,9 +44,8 @@ var import_dom_binding_handoff = require("../dom-binding-handoff.cjs");
|
|
|
44
44
|
var import_control_capture = require("./control-capture.cjs");
|
|
45
45
|
var import_control_capture2 = require("./control-capture.cjs");
|
|
46
46
|
var import_stream_protocol = require("../stream-protocol.cjs");
|
|
47
|
+
var import_hydration_markers2 = require("../hydration-markers.cjs");
|
|
47
48
|
var import_interaction_config2 = require("./interaction-config.cjs");
|
|
48
|
-
const HYDRATE_MARKER_SELECTOR = "[data-octane-hydrate-id]";
|
|
49
|
-
const HYDRATE_WHEN_ATTR = "data-octane-hydrate-when";
|
|
50
49
|
function isHydrationNode(target) {
|
|
51
50
|
return target !== null && typeof target.nodeType === "number";
|
|
52
51
|
}
|
|
@@ -121,7 +120,7 @@ function markerStatus(marker, eventType) {
|
|
|
121
120
|
return hydrationMarkerInteractionStatus(marker, eventType);
|
|
122
121
|
}
|
|
123
122
|
function hydrationMarkerInteractionStatus(marker, eventType) {
|
|
124
|
-
const when = marker.getAttribute(HYDRATE_WHEN_ATTR);
|
|
123
|
+
const when = marker.getAttribute(import_hydration_markers2.HYDRATE_WHEN_ATTR);
|
|
125
124
|
if (when === null) return "hydrated";
|
|
126
125
|
if (when === "never") return "never";
|
|
127
126
|
if (when === "dynamic") return eventType === "click" ? "handles" : "dormant";
|
|
@@ -134,7 +133,7 @@ function handleEarlyHydrationIntent(event, capturedSelection) {
|
|
|
134
133
|
const target = event.target;
|
|
135
134
|
if (!isHydrationElement(target)) return;
|
|
136
135
|
if ((event.type === "pointerenter" || event.type === "mouseenter") && independentHydrationDocuments?.has(target.ownerDocument)) {
|
|
137
|
-
const boundary = target.closest(HYDRATE_MARKER_SELECTOR);
|
|
136
|
+
const boundary = target.closest(import_hydration_markers2.HYDRATE_MARKER_SELECTOR);
|
|
138
137
|
const pointer = event;
|
|
139
138
|
if (boundary !== null && typeof pointer.clientX === "number" && typeof pointer.clientY === "number") {
|
|
140
139
|
const hit = target.ownerDocument.elementFromPoint?.(pointer.clientX, pointer.clientY);
|
|
@@ -146,7 +145,7 @@ function handleEarlyHydrationIntent(event, capturedSelection) {
|
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
const markers = [];
|
|
149
|
-
let marker = target.closest(HYDRATE_MARKER_SELECTOR);
|
|
148
|
+
let marker = target.closest(import_hydration_markers2.HYDRATE_MARKER_SELECTOR);
|
|
150
149
|
let independent = null;
|
|
151
150
|
let matches = false;
|
|
152
151
|
while (marker !== null) {
|
|
@@ -157,7 +156,7 @@ function handleEarlyHydrationIntent(event, capturedSelection) {
|
|
|
157
156
|
HYDRATE_HANDLED_INTENT_EVENTS.add(event);
|
|
158
157
|
break;
|
|
159
158
|
}
|
|
160
|
-
marker = marker.parentElement?.closest(HYDRATE_MARKER_SELECTOR) ?? null;
|
|
159
|
+
marker = marker.parentElement?.closest(import_hydration_markers2.HYDRATE_MARKER_SELECTOR) ?? null;
|
|
161
160
|
}
|
|
162
161
|
if (independent !== null) {
|
|
163
162
|
const link = target.closest("a[href],area[href]");
|
|
@@ -179,7 +178,7 @@ function handleEarlyHydrationIntent(event, capturedSelection) {
|
|
|
179
178
|
if (candidate === null) return;
|
|
180
179
|
for (let i = 0; i < markers.length; i++) {
|
|
181
180
|
const current = markers[i];
|
|
182
|
-
if (current !== candidate && candidate.contains(current) && current.getAttribute(HYDRATE_WHEN_ATTR) === "dynamic" && !HYDRATE_BOUNDARIES.has(current)) {
|
|
181
|
+
if (current !== candidate && candidate.contains(current) && current.getAttribute(import_hydration_markers2.HYDRATE_WHEN_ATTR) === "dynamic" && !HYDRATE_BOUNDARIES.has(current)) {
|
|
183
182
|
HYDRATE_DELEGATED_DYNAMIC_MARKERS.add(current);
|
|
184
183
|
}
|
|
185
184
|
}
|
|
@@ -18,20 +18,58 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var hydration_markers_exports = {};
|
|
20
20
|
__export(hydration_markers_exports, {
|
|
21
|
+
HYDRATE_ID_ATTR: () => HYDRATE_ID_ATTR,
|
|
22
|
+
HYDRATE_ID_COUNT_ATTR: () => HYDRATE_ID_COUNT_ATTR,
|
|
21
23
|
HYDRATE_INDEPENDENT_ATTR: () => HYDRATE_INDEPENDENT_ATTR,
|
|
22
24
|
HYDRATE_INPUT_ATTR: () => HYDRATE_INPUT_ATTR,
|
|
25
|
+
HYDRATE_MARKER_SELECTOR: () => HYDRATE_MARKER_SELECTOR,
|
|
26
|
+
HYDRATE_SEED_ATTR: () => HYDRATE_SEED_ATTR,
|
|
27
|
+
HYDRATE_WHEN_ATTR: () => HYDRATE_WHEN_ATTR,
|
|
28
|
+
HYDRATION_END: () => HYDRATION_END,
|
|
29
|
+
HYDRATION_FOR_ARM_INDEX: () => HYDRATION_FOR_ARM_INDEX,
|
|
30
|
+
HYDRATION_FOR_EMPTY: () => HYDRATION_FOR_EMPTY,
|
|
31
|
+
HYDRATION_FOR_ITEMS: () => HYDRATION_FOR_ITEMS,
|
|
32
|
+
HYDRATION_FOR_PREFIX: () => HYDRATION_FOR_PREFIX,
|
|
33
|
+
HYDRATION_START: () => HYDRATION_START,
|
|
23
34
|
INDEPENDENT_HYDRATE_MANIFEST_ATTR: () => INDEPENDENT_HYDRATE_MANIFEST_ATTR,
|
|
24
|
-
SIGNAL_CONTROL_ATTR: () => SIGNAL_CONTROL_ATTR
|
|
35
|
+
SIGNAL_CONTROL_ATTR: () => SIGNAL_CONTROL_ATTR,
|
|
36
|
+
formatUseId: () => formatUseId
|
|
25
37
|
});
|
|
26
38
|
module.exports = __toCommonJS(hydration_markers_exports);
|
|
27
39
|
const INDEPENDENT_HYDRATE_MANIFEST_ATTR = "data-octane-independent";
|
|
28
40
|
const HYDRATE_INDEPENDENT_ATTR = "data-octane-hydrate-independent";
|
|
29
41
|
const HYDRATE_INPUT_ATTR = "data-octane-input";
|
|
30
42
|
const SIGNAL_CONTROL_ATTR = "data-octane-signal-control";
|
|
43
|
+
const HYDRATE_ID_ATTR = "data-octane-hydrate-id";
|
|
44
|
+
const HYDRATE_WHEN_ATTR = "data-octane-hydrate-when";
|
|
45
|
+
const HYDRATE_ID_COUNT_ATTR = "data-octane-hydrate-id-count";
|
|
46
|
+
const HYDRATE_SEED_ATTR = "data-octane-hydrate-seed";
|
|
47
|
+
const HYDRATE_MARKER_SELECTOR = "[data-octane-hydrate-id]";
|
|
48
|
+
const HYDRATION_START = "[";
|
|
49
|
+
const HYDRATION_END = "]";
|
|
50
|
+
const HYDRATION_FOR_PREFIX = "[f";
|
|
51
|
+
const HYDRATION_FOR_EMPTY = "[f0";
|
|
52
|
+
const HYDRATION_FOR_ITEMS = "[f1";
|
|
53
|
+
const HYDRATION_FOR_ARM_INDEX = HYDRATION_FOR_PREFIX.length;
|
|
54
|
+
function formatUseId(prefix, ordinal) {
|
|
55
|
+
return ":" + prefix + "in-" + ordinal.toString(36) + ":";
|
|
56
|
+
}
|
|
31
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
58
|
0 && (module.exports = {
|
|
59
|
+
HYDRATE_ID_ATTR,
|
|
60
|
+
HYDRATE_ID_COUNT_ATTR,
|
|
33
61
|
HYDRATE_INDEPENDENT_ATTR,
|
|
34
62
|
HYDRATE_INPUT_ATTR,
|
|
63
|
+
HYDRATE_MARKER_SELECTOR,
|
|
64
|
+
HYDRATE_SEED_ATTR,
|
|
65
|
+
HYDRATE_WHEN_ATTR,
|
|
66
|
+
HYDRATION_END,
|
|
67
|
+
HYDRATION_FOR_ARM_INDEX,
|
|
68
|
+
HYDRATION_FOR_EMPTY,
|
|
69
|
+
HYDRATION_FOR_ITEMS,
|
|
70
|
+
HYDRATION_FOR_PREFIX,
|
|
71
|
+
HYDRATION_START,
|
|
35
72
|
INDEPENDENT_HYDRATE_MANIFEST_ATTR,
|
|
36
|
-
SIGNAL_CONTROL_ATTR
|
|
73
|
+
SIGNAL_CONTROL_ATTR,
|
|
74
|
+
formatUseId
|
|
37
75
|
});
|
|
@@ -0,0 +1,55 @@
|
|
|
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 runtime_tags_exports = {};
|
|
20
|
+
__export(runtime_tags_exports, {
|
|
21
|
+
ACTIVITY_TAG: () => ACTIVITY_TAG,
|
|
22
|
+
CHILDREN_BLOCK_TAG: () => CHILDREN_BLOCK_TAG,
|
|
23
|
+
CONTEXT_TAG: () => CONTEXT_TAG,
|
|
24
|
+
ELEMENT_TAG: () => ELEMENT_TAG,
|
|
25
|
+
FRAGMENT_TAG: () => FRAGMENT_TAG,
|
|
26
|
+
LAZY_COMPONENT_TAG: () => LAZY_COMPONENT_TAG,
|
|
27
|
+
PORTAL_TAG: () => PORTAL_TAG,
|
|
28
|
+
REACT_CONTEXT_TAG: () => REACT_CONTEXT_TAG,
|
|
29
|
+
RENDERER_REGION_OWNER_TAG: () => RENDERER_REGION_OWNER_TAG,
|
|
30
|
+
SUSPENSE_TAG: () => SUSPENSE_TAG
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(runtime_tags_exports);
|
|
33
|
+
const ELEMENT_TAG = /* @__PURE__ */ Symbol.for("octane.element");
|
|
34
|
+
const PORTAL_TAG = /* @__PURE__ */ Symbol.for("octane.portal");
|
|
35
|
+
const FRAGMENT_TAG = /* @__PURE__ */ Symbol.for("octane.Fragment");
|
|
36
|
+
const ACTIVITY_TAG = /* @__PURE__ */ Symbol.for("octane.Activity");
|
|
37
|
+
const CONTEXT_TAG = /* @__PURE__ */ Symbol.for("octane.context");
|
|
38
|
+
const LAZY_COMPONENT_TAG = /* @__PURE__ */ Symbol.for("octane.lazy");
|
|
39
|
+
const SUSPENSE_TAG = /* @__PURE__ */ Symbol.for("octane.suspense");
|
|
40
|
+
const CHILDREN_BLOCK_TAG = /* @__PURE__ */ Symbol.for("octane.childrenBlock");
|
|
41
|
+
const RENDERER_REGION_OWNER_TAG = /* @__PURE__ */ Symbol.for("octane.renderer-region.owner");
|
|
42
|
+
const REACT_CONTEXT_TAG = /* @__PURE__ */ Symbol.for("react.context");
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
ACTIVITY_TAG,
|
|
46
|
+
CHILDREN_BLOCK_TAG,
|
|
47
|
+
CONTEXT_TAG,
|
|
48
|
+
ELEMENT_TAG,
|
|
49
|
+
FRAGMENT_TAG,
|
|
50
|
+
LAZY_COMPONENT_TAG,
|
|
51
|
+
PORTAL_TAG,
|
|
52
|
+
REACT_CONTEXT_TAG,
|
|
53
|
+
RENDERER_REGION_OWNER_TAG,
|
|
54
|
+
SUSPENSE_TAG
|
|
55
|
+
});
|