octane 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/cjs/dom-binding-handoff.cjs +2 -1
  2. package/dist/cjs/dom-binding-protocol.cjs +4 -3
  3. package/dist/cjs/dom-binding-styles.cjs +3 -2
  4. package/dist/cjs/dom-bindings.cjs +24 -23
  5. package/dist/cjs/error-codes.client.generated.cjs +2 -1
  6. package/dist/cjs/error-codes.server.generated.cjs +2 -1
  7. package/dist/cjs/hydration/event-capture.cjs +2 -1
  8. package/dist/cjs/independent-hydration-protocol.cjs +3 -2
  9. package/dist/cjs/runtime.cjs +169 -155
  10. package/dist/cjs/runtime.server.cjs +40 -34
  11. package/dist/cjs/signals/control-binding.cjs +7 -6
  12. package/dist/cjs/signals/derived-facade.cjs +2 -1
  13. package/dist/cjs/signals/document-owner.cjs +4 -3
  14. package/dist/cjs/signals/facade.cjs +10 -9
  15. package/dist/cjs/signals/graph.cjs +5 -4
  16. package/dist/cjs/signals/native-read-client.cjs +4 -3
  17. package/dist/cjs/signals/owner-context.cjs +4 -3
  18. package/dist/cjs/signals/query-attempt-observer.cjs +2 -1
  19. package/dist/cjs/signals/query-facade.cjs +2 -1
  20. package/dist/cjs/signals/scalar-computations.cjs +2 -1
  21. package/dist/cjs/signals/transition-action.cjs +10 -9
  22. package/dist/cjs/signals/transition-candidate.cjs +2 -1
  23. package/dist/cjs/version.cjs +1 -1
  24. package/dist/compiler/compile.js +380 -12
  25. package/dist/node/aria-diagnostics.js +92 -0
  26. package/dist/node/behavior-form-submissions.js +228 -0
  27. package/dist/node/behavior-root-types.js +0 -0
  28. package/dist/node/behavior-root.js +746 -0
  29. package/dist/node/class-names.js +25 -0
  30. package/dist/node/compatibility.js +10 -0
  31. package/dist/node/component-flags.js +23 -0
  32. package/dist/node/constants.js +113 -0
  33. package/dist/node/context-epoch.js +13 -0
  34. package/dist/node/context-identity.js +46 -0
  35. package/dist/node/css.js +80 -0
  36. package/dist/node/data-encoding.js +134 -0
  37. package/dist/node/devtools-hook.js +229 -0
  38. package/dist/node/dom-binding-claims.js +4 -0
  39. package/dist/node/dom-binding-classes.js +152 -0
  40. package/dist/node/dom-binding-controls.js +6 -0
  41. package/dist/node/dom-binding-handoff.js +77 -0
  42. package/dist/node/dom-binding-program.js +1617 -0
  43. package/dist/node/dom-binding-projections.js +204 -0
  44. package/dist/node/dom-binding-protocol.js +130 -0
  45. package/dist/node/dom-binding-signals.js +135 -0
  46. package/dist/node/dom-binding-styles.js +280 -0
  47. package/dist/node/dom-bindings.js +1087 -0
  48. package/dist/node/dom-focused-move.js +46 -0
  49. package/dist/node/dom-stage.js +878 -0
  50. package/dist/node/dom-tables.js +382 -0
  51. package/dist/node/error-codes.client.generated.js +1066 -0
  52. package/dist/node/error-codes.server.generated.js +736 -0
  53. package/dist/node/error-message.js +27 -0
  54. package/dist/node/event-names.js +15 -0
  55. package/dist/node/form-diagnostics.js +96 -0
  56. package/dist/node/form-submission.js +43 -0
  57. package/dist/node/has-own.js +4 -0
  58. package/dist/node/head-ownership.js +31 -0
  59. package/dist/node/hook-slot-cache.js +91 -0
  60. package/dist/node/host-property-diagnostics.js +189 -0
  61. package/dist/node/html-tree-validation.js +193 -0
  62. package/dist/node/hydration/condition.js +15 -0
  63. package/dist/node/hydration/control-capture.js +237 -0
  64. package/dist/node/hydration/document-lifecycle.js +89 -0
  65. package/dist/node/hydration/event-capture.js +362 -0
  66. package/dist/node/hydration/idle.js +23 -0
  67. package/dist/node/hydration/independent-island.js +317 -0
  68. package/dist/node/hydration/index.js +74 -0
  69. package/dist/node/hydration/interaction-config.js +61 -0
  70. package/dist/node/hydration/interaction.js +35 -0
  71. package/dist/node/hydration/load.js +15 -0
  72. package/dist/node/hydration/media.js +33 -0
  73. package/dist/node/hydration/native-intent.js +68 -0
  74. package/dist/node/hydration/never.js +12 -0
  75. package/dist/node/hydration/stream-delivery.js +345 -0
  76. package/dist/node/hydration/stream-receiver.js +190 -0
  77. package/dist/node/hydration/stream-result-receiver.js +276 -0
  78. package/dist/node/hydration/streamed-signals.js +186 -0
  79. package/dist/node/hydration/types.js +0 -0
  80. package/dist/node/hydration/visible.js +69 -0
  81. package/dist/node/hydration-markers.js +44 -0
  82. package/dist/node/independent-hydration-protocol.js +91 -0
  83. package/dist/node/index.js +461 -0
  84. package/dist/node/internal/client.js +7 -0
  85. package/dist/node/internal/context.js +5 -0
  86. package/dist/node/internal/server.js +5 -0
  87. package/dist/node/internal/signal-read.js +4 -0
  88. package/dist/node/method-dep.js +25 -0
  89. package/dist/node/profiling.js +432 -0
  90. package/dist/node/public-types.js +0 -0
  91. package/dist/node/react/fiber-adapter.js +57 -0
  92. package/dist/node/react/index.js +397 -0
  93. package/dist/node/react/react-compat-envelope.js +78 -0
  94. package/dist/node/react/react-compat-server.js +129 -0
  95. package/dist/node/react/react-compat-shared.js +104 -0
  96. package/dist/node/react/react-compat.js +223 -0
  97. package/dist/node/react/server.js +81 -0
  98. package/dist/node/react/shared.js +75 -0
  99. package/dist/node/renderer-bridge.js +35 -0
  100. package/dist/node/resize-observer.js +105 -0
  101. package/dist/node/resource-hint-diagnostics.js +67 -0
  102. package/dist/node/runtime-tags.js +22 -0
  103. package/dist/node/runtime.js +28881 -0
  104. package/dist/node/runtime.server.js +8016 -0
  105. package/dist/node/sanitize-url.js +34 -0
  106. package/dist/node/server/early-signals.js +54 -0
  107. package/dist/node/server/index.js +336 -0
  108. package/dist/node/server/rpc-batch.js +129 -0
  109. package/dist/node/server/rpc-stream.js +125 -0
  110. package/dist/node/server/rpc.js +48 -0
  111. package/dist/node/server/signal-query-observation.js +134 -0
  112. package/dist/node/server/streamed-region.js +31 -0
  113. package/dist/node/server/streamed-signals.js +557 -0
  114. package/dist/node/server-call.js +75 -0
  115. package/dist/node/server-rpc-batch-client.js +119 -0
  116. package/dist/node/server-rpc-client.js +108 -0
  117. package/dist/node/server-rpc-protocol.js +109 -0
  118. package/dist/node/server-rpc-stream-client.js +98 -0
  119. package/dist/node/shared-value-helpers.js +40 -0
  120. package/dist/node/signals/actions.js +463 -0
  121. package/dist/node/signals/client.js +22 -0
  122. package/dist/node/signals/computations.js +452 -0
  123. package/dist/node/signals/control-binding.js +388 -0
  124. package/dist/node/signals/control-handoff.js +12 -0
  125. package/dist/node/signals/derived-facade.js +25 -0
  126. package/dist/node/signals/document-owner.js +48 -0
  127. package/dist/node/signals/early-values.js +124 -0
  128. package/dist/node/signals/encoding.js +6 -0
  129. package/dist/node/signals/engine.js +668 -0
  130. package/dist/node/signals/errors.js +54 -0
  131. package/dist/node/signals/facade.js +441 -0
  132. package/dist/node/signals/graph.js +817 -0
  133. package/dist/node/signals/handle-protocol.js +11 -0
  134. package/dist/node/signals/index.js +87 -0
  135. package/dist/node/signals/native-read-client.js +319 -0
  136. package/dist/node/signals/native-read-collector.js +132 -0
  137. package/dist/node/signals/native-read-events.js +45 -0
  138. package/dist/node/signals/native-read-inspection.js +20 -0
  139. package/dist/node/signals/native-read-retry.js +30 -0
  140. package/dist/node/signals/native-read-seeds.js +243 -0
  141. package/dist/node/signals/native-read-server.js +99 -0
  142. package/dist/node/signals/owner-context.js +88 -0
  143. package/dist/node/signals/query-attempt-observer.js +42 -0
  144. package/dist/node/signals/query-facade.js +41 -0
  145. package/dist/node/signals/read-protocol.js +125 -0
  146. package/dist/node/signals/requests.js +716 -0
  147. package/dist/node/signals/scalar-computations.js +57 -0
  148. package/dist/node/signals/scope-streams.js +147 -0
  149. package/dist/node/signals/server.js +22 -0
  150. package/dist/node/signals/transition-action.js +555 -0
  151. package/dist/node/signals/transition-candidate.js +101 -0
  152. package/dist/node/signals/transition-coordinator.js +255 -0
  153. package/dist/node/signals/transition-state.js +82 -0
  154. package/dist/node/signals/types.js +20 -0
  155. package/dist/node/static/index.js +10 -0
  156. package/dist/node/stream-protocol.js +114 -0
  157. package/dist/node/streamed-signals-protocol.js +130 -0
  158. package/dist/node/style-values.js +96 -0
  159. package/dist/node/sub-slot.js +35 -0
  160. package/dist/node/testing.js +14 -0
  161. package/dist/node/trusted-html.js +6 -0
  162. package/dist/node/tsrx-iterable.js +5 -0
  163. package/dist/node/tsrx-spread.js +10 -0
  164. package/dist/node/universal-core.js +10010 -0
  165. package/dist/node/universal-dom-boundary.js +237 -0
  166. package/dist/node/universal-native.js +28 -0
  167. package/dist/node/universal.js +17 -0
  168. package/dist/node/version.js +4 -0
  169. package/dist/runtime.d.ts +18 -0
  170. package/dist/runtime.js +13 -2
  171. package/dist/runtime.server.d.ts +7 -0
  172. package/dist/runtime.server.js +4 -0
  173. package/dist/version.js +1 -1
  174. package/package.json +62 -1
@@ -0,0 +1,25 @@
1
+ function normalizeClass(value) {
2
+ if (typeof value === "string") return value;
3
+ if (typeof value !== "object") {
4
+ return typeof value === "number" && value ? "" + value : "";
5
+ }
6
+ if (value === null) return "";
7
+ let str = "";
8
+ if (Array.isArray(value)) {
9
+ for (let i = 0; i < value.length; i++) {
10
+ const item = value[i];
11
+ if (item) {
12
+ const inner = normalizeClass(item);
13
+ if (inner) str = str ? str + " " + inner : inner;
14
+ }
15
+ }
16
+ } else {
17
+ for (const k in value) {
18
+ if (value[k]) str = str ? str + " " + k : k;
19
+ }
20
+ }
21
+ return str;
22
+ }
23
+ export {
24
+ normalizeClass
25
+ };
@@ -0,0 +1,10 @@
1
+ function StrictMode(props) {
2
+ return props.children;
3
+ }
4
+ function unstable_batchedUpdates(callback, ...args) {
5
+ return callback(...args);
6
+ }
7
+ export {
8
+ StrictMode,
9
+ unstable_batchedUpdates
10
+ };
@@ -0,0 +1,23 @@
1
+ import { hasOwnProp } from "./has-own.js";
2
+ const OCTANE_COMPONENT_FLAGS = /* @__PURE__ */ Symbol.for("octane.flags.component");
3
+ const COMPONENT_FLAG_BOUNDARY = 1 << 0;
4
+ function markComponentFlags(component, flags, name, kind) {
5
+ Object.defineProperty(component, OCTANE_COMPONENT_FLAGS, { value: flags });
6
+ Object.defineProperty(component, "name", { value: name, configurable: true });
7
+ if (kind !== void 0) {
8
+ Object.defineProperty(component, kind, {
9
+ get() {
10
+ return this === component;
11
+ }
12
+ });
13
+ }
14
+ return component;
15
+ }
16
+ function hasComponentFlags(component, flags) {
17
+ return typeof component === "function" && hasOwnProp.call(component, OCTANE_COMPONENT_FLAGS) && (component[OCTANE_COMPONENT_FLAGS] & flags) === flags;
18
+ }
19
+ export {
20
+ COMPONENT_FLAG_BOUNDARY,
21
+ hasComponentFlags,
22
+ markComponentFlags
23
+ };
@@ -0,0 +1,113 @@
1
+ import {
2
+ HYDRATION_START,
3
+ HYDRATION_END,
4
+ HYDRATION_FOR_EMPTY,
5
+ HYDRATION_FOR_ITEMS
6
+ } from "./hydration-markers.js";
7
+ const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
8
+ const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
9
+ const FOR_BLOCK_OPEN_EMPTY = `<!--${HYDRATION_FOR_EMPTY}-->`;
10
+ const FOR_BLOCK_OPEN_ITEMS = `<!--${HYDRATION_FOR_ITEMS}-->`;
11
+ const EMPTY_COMMENT = "<!---->";
12
+ const HYDRATION_TEXT_SEP = " ";
13
+ import { SUSPENSE_SCRIPT_ATTR } from "./stream-protocol.js";
14
+ const SUSPENSE_RESOLVED_COMMENT = "oct-suspense:";
15
+ const SUSPENSE_RESOLVED_SEED_ATTR = "data-octane-suspense-seeds";
16
+ const SUSPENSE_RESOLVED_NATIVE_ATTR = "data-octane-suspense-signals";
17
+ const UNDEFINED_SENTINEL_KEY = "__octane_new_undefined__";
18
+ const SUSPENSE_SEED_WIRE_PREFIX = "\0octane:ssr-seed:";
19
+ const REJECTION_SENTINEL_KEY = "__octane_new_rejection__";
20
+ const EXTERNAL_HYDRATION_PROMISE = /* @__PURE__ */ Symbol.for(
21
+ "octane.external-hydration-promise"
22
+ );
23
+ const HYDRATION_RANGE_BOUNDARY = /* @__PURE__ */ Symbol.for(
24
+ "octane.hydration-range-boundary"
25
+ );
26
+ const HYDRATE_STATIC_ID_COUNT_PREFIX = "octane-static-hydrate:";
27
+ const HYDRATE_STATIC_END = "/octane-static-hydrate";
28
+ import { HYDRATE_STREAM_TOKEN_ATTR } from "./stream-protocol.js";
29
+ import {
30
+ INDEPENDENT_HYDRATE_MANIFEST_ATTR,
31
+ HYDRATE_INDEPENDENT_ATTR,
32
+ HYDRATE_INPUT_ATTR,
33
+ SIGNAL_CONTROL_ATTR,
34
+ HYDRATE_ID_ATTR,
35
+ HYDRATE_WHEN_ATTR,
36
+ HYDRATE_ID_COUNT_ATTR,
37
+ HYDRATE_SEED_ATTR
38
+ } from "./hydration-markers.js";
39
+ import { STREAM_BOUNDARY_ATTR } from "./stream-protocol.js";
40
+ const STREAM_SEGMENT_ATTR = "data-oct-s";
41
+ const STREAM_SEED_ATTR = "data-oct-seed";
42
+ import { STREAM_SCRIPT_ATTR } from "./stream-protocol.js";
43
+ const STREAM_RESOURCE_ATTR = "data-oct-fr";
44
+ const STREAM_SEED_COMMENT = "oct-seed:";
45
+ import {
46
+ VOID_ELEMENTS as _VOID_ELEMENTS,
47
+ BOOLEAN_ATTR_PROPS as _BOOLEAN_ATTR_PROPS,
48
+ MUST_USE_PROPERTY_PROPS as _MUST_USE_PROPERTY_PROPS,
49
+ POSITIVE_NUMERIC_ATTR_PROPS as _POSITIVE_NUMERIC_ATTR_PROPS,
50
+ SVG_ONLY_TAGS as _SVG_ONLY_TAGS,
51
+ ATTRIBUTE_ALIASES as _ATTRIBUTE_ALIASES,
52
+ isEnumeratedBooleanAttr as _isEnumeratedBooleanAttr,
53
+ isUnitlessStyleProp as _isUnitlessStyleProp,
54
+ cssStyleValue as _cssStyleValue
55
+ } from "./dom-tables.js";
56
+ const VOID_ELEMENTS = _VOID_ELEMENTS;
57
+ const BOOLEAN_ATTR_PROPS = _BOOLEAN_ATTR_PROPS;
58
+ const MUST_USE_PROPERTY_PROPS = _MUST_USE_PROPERTY_PROPS;
59
+ const POSITIVE_NUMERIC_ATTR_PROPS = _POSITIVE_NUMERIC_ATTR_PROPS;
60
+ const VALID_ATTR_NAME = /^[^\s"'>\/=\u0000-\u001F]+$/;
61
+ const SVG_ONLY_TAGS = _SVG_ONLY_TAGS;
62
+ const ATTRIBUTE_ALIASES = _ATTRIBUTE_ALIASES;
63
+ const isEnumeratedBooleanAttr = _isEnumeratedBooleanAttr;
64
+ const isUnitlessStyleProp = _isUnitlessStyleProp;
65
+ const cssStyleValue = _cssStyleValue;
66
+ export {
67
+ ATTRIBUTE_ALIASES,
68
+ BLOCK_CLOSE,
69
+ BLOCK_OPEN,
70
+ BOOLEAN_ATTR_PROPS,
71
+ EMPTY_COMMENT,
72
+ EXTERNAL_HYDRATION_PROMISE,
73
+ FOR_BLOCK_OPEN_EMPTY,
74
+ FOR_BLOCK_OPEN_ITEMS,
75
+ HYDRATE_ID_ATTR,
76
+ HYDRATE_ID_COUNT_ATTR,
77
+ HYDRATE_INDEPENDENT_ATTR,
78
+ HYDRATE_INPUT_ATTR,
79
+ HYDRATE_SEED_ATTR,
80
+ HYDRATE_STATIC_END,
81
+ HYDRATE_STATIC_ID_COUNT_PREFIX,
82
+ HYDRATE_STREAM_TOKEN_ATTR,
83
+ HYDRATE_WHEN_ATTR,
84
+ HYDRATION_END,
85
+ HYDRATION_FOR_EMPTY,
86
+ HYDRATION_FOR_ITEMS,
87
+ HYDRATION_RANGE_BOUNDARY,
88
+ HYDRATION_START,
89
+ HYDRATION_TEXT_SEP,
90
+ INDEPENDENT_HYDRATE_MANIFEST_ATTR,
91
+ MUST_USE_PROPERTY_PROPS,
92
+ POSITIVE_NUMERIC_ATTR_PROPS,
93
+ REJECTION_SENTINEL_KEY,
94
+ SIGNAL_CONTROL_ATTR,
95
+ STREAM_BOUNDARY_ATTR,
96
+ STREAM_RESOURCE_ATTR,
97
+ STREAM_SCRIPT_ATTR,
98
+ STREAM_SEED_ATTR,
99
+ STREAM_SEED_COMMENT,
100
+ STREAM_SEGMENT_ATTR,
101
+ SUSPENSE_RESOLVED_COMMENT,
102
+ SUSPENSE_RESOLVED_NATIVE_ATTR,
103
+ SUSPENSE_RESOLVED_SEED_ATTR,
104
+ SUSPENSE_SCRIPT_ATTR,
105
+ SUSPENSE_SEED_WIRE_PREFIX,
106
+ SVG_ONLY_TAGS,
107
+ UNDEFINED_SENTINEL_KEY,
108
+ VALID_ATTR_NAME,
109
+ VOID_ELEMENTS,
110
+ cssStyleValue,
111
+ isEnumeratedBooleanAttr,
112
+ isUnitlessStyleProp
113
+ };
@@ -0,0 +1,13 @@
1
+ const EPOCH_CELL = globalThis[/* @__PURE__ */ Symbol.for("octane.contextEpoch")] ??= {
2
+ value: 0
3
+ };
4
+ function contextEpochNow() {
5
+ return EPOCH_CELL.value;
6
+ }
7
+ function bumpContextEpoch() {
8
+ EPOCH_CELL.value++;
9
+ }
10
+ export {
11
+ bumpContextEpoch,
12
+ contextEpochNow
13
+ };
@@ -0,0 +1,46 @@
1
+ const CONTEXT_IDENTITIES = /* @__PURE__ */ Symbol.for("octane.contextIdentities");
2
+ function registerContext(context) {
3
+ let identities = globalThis[CONTEXT_IDENTITIES];
4
+ if (identities == null) {
5
+ identities = /* @__PURE__ */ new WeakSet();
6
+ globalThis[CONTEXT_IDENTITIES] = identities;
7
+ }
8
+ identities.add(context);
9
+ }
10
+ function isContext(value) {
11
+ if (typeof value !== "function") return false;
12
+ const identities = globalThis[CONTEXT_IDENTITIES];
13
+ return identities != null && identities.has(value) === true;
14
+ }
15
+ function defineRemovedContextMembers(context) {
16
+ let consumerWarned = false;
17
+ Object.defineProperties(context, {
18
+ Consumer: {
19
+ configurable: true,
20
+ get() {
21
+ if (!consumerWarned) {
22
+ consumerWarned = true;
23
+ console.error(
24
+ "Octane has no Context.Consumer. Read the context directly with use(Context) or useContext(Context) in the child component \u2014 Octane hooks are call-site keyed, so the read is legal behind any condition the render-prop form was working around."
25
+ );
26
+ }
27
+ return void 0;
28
+ }
29
+ },
30
+ Provider: {
31
+ configurable: true,
32
+ get() {
33
+ const error = new Error(
34
+ "[OCTANE_CONTEXT_PROVIDER] Context.Provider was removed. Render the context itself as the provider: <Context value={...}>...</Context>."
35
+ );
36
+ error.code = "OCTANE_CONTEXT_PROVIDER";
37
+ throw error;
38
+ }
39
+ }
40
+ });
41
+ }
42
+ export {
43
+ defineRemovedContextMembers,
44
+ isContext,
45
+ registerContext
46
+ };
@@ -0,0 +1,80 @@
1
+ import { normalizeClass } from "./class-names.js";
2
+ function mergeClass(left, right) {
3
+ const a = normalizeClass(left);
4
+ const b = normalizeClass(right);
5
+ if (!a) return b;
6
+ if (!b) return a;
7
+ return a + " " + b;
8
+ }
9
+ import { hyphenateStyleName } from "./style-values.js";
10
+ const styleNameCache = /* @__PURE__ */ new Map();
11
+ function styleName(name) {
12
+ const cached = styleNameCache.get(name);
13
+ if (cached !== void 0) return cached;
14
+ const result = hyphenateStyleName(name);
15
+ styleNameCache.set(name, result);
16
+ return result;
17
+ }
18
+ let warnedStyleNames = null;
19
+ let warnedStyleValues = null;
20
+ let warnedStyleNaN = 0;
21
+ let warnedStyleInfinity = 0;
22
+ function devWarnStyleProperty(name, value, server) {
23
+ const type = typeof value;
24
+ if (name.charCodeAt(0) === 45 && name.charCodeAt(1) === 45) return;
25
+ let prefixLength = 0;
26
+ if (name.startsWith("webkit")) prefixLength = 6;
27
+ else if (name.startsWith("moz")) prefixLength = 3;
28
+ else if (name.charCodeAt(0) === 111) prefixLength = 1;
29
+ const following = name.charCodeAt(prefixLength);
30
+ if (prefixLength !== 0 && following >= 65 && following <= 90) {
31
+ const key = (server ? "s:" : "c:") + name;
32
+ const warned = warnedStyleNames ??= /* @__PURE__ */ new Set();
33
+ if (!warned.has(key)) {
34
+ warned.add(key);
35
+ console.error(
36
+ `Unsupported vendor-prefixed style property ${name}. Did you mean ${name.charAt(0).toUpperCase()}${name.slice(1)}?`
37
+ );
38
+ }
39
+ } else if (type === "string") {
40
+ const text = value;
41
+ if (text.trimEnd().endsWith(";")) {
42
+ const key = (server ? "s:" : "c:") + text;
43
+ const warned = warnedStyleValues ??= /* @__PURE__ */ new Set();
44
+ if (!warned.has(key)) {
45
+ warned.add(key);
46
+ console.error(
47
+ `Style property values shouldn't contain a semicolon. Try "${name}: ${text.slice(0, text.lastIndexOf(";"))}" instead.`
48
+ );
49
+ }
50
+ }
51
+ }
52
+ if (type !== "number") return;
53
+ const surface = server ? 2 : 1;
54
+ if (Number.isNaN(value)) {
55
+ if ((warnedStyleNaN & surface) !== 0) return;
56
+ warnedStyleNaN |= surface;
57
+ console.error(`\`NaN\` is an invalid value for the \`${name}\` css style property.`);
58
+ } else if (!Number.isFinite(value)) {
59
+ if ((warnedStyleInfinity & surface) !== 0) return;
60
+ warnedStyleInfinity |= surface;
61
+ console.error(`\`Infinity\` is an invalid value for the \`${name}\` css style property.`);
62
+ }
63
+ }
64
+ function devWarnStyleCoercion(name, value) {
65
+ const valueType = typeof value === "symbol" ? "Symbol" : value.constructor?.name || "Object";
66
+ console.error(
67
+ `The provided \`${name}\` CSS property is an unsupported type ${valueType}. This value must be coerced to a string before using it here.`
68
+ );
69
+ }
70
+ const VIEW_TRANSITION_SCOPE_STYLE_ID = "octane-view-transition-scope";
71
+ const VIEW_TRANSITION_SCOPE_CSS = '[vt-scope="element"]{view-transition-scope:all!important}';
72
+ export {
73
+ VIEW_TRANSITION_SCOPE_CSS,
74
+ VIEW_TRANSITION_SCOPE_STYLE_ID,
75
+ devWarnStyleCoercion,
76
+ devWarnStyleProperty,
77
+ mergeClass,
78
+ normalizeClass,
79
+ styleName
80
+ };
@@ -0,0 +1,134 @@
1
+ import { SignalSerializationError } from "./signals/errors.js";
2
+ function unsupported() {
3
+ throw new SignalSerializationError(
4
+ "Signal request arguments and seeds require acyclic plain data: undefined, null, booleans, finite numbers, strings, dense arrays, and plain objects with enumerable string data properties."
5
+ );
6
+ }
7
+ function encodeSignalValue(value, ancestors = /* @__PURE__ */ new Set()) {
8
+ if (value === void 0) return ["undefined"];
9
+ if (value === null) return ["null"];
10
+ if (typeof value === "boolean") return ["boolean", value];
11
+ if (typeof value === "string") return ["string", value];
12
+ if (typeof value === "number") {
13
+ if (!Number.isFinite(value)) return unsupported();
14
+ return ["number", Object.is(value, -0) ? "-0" : value];
15
+ }
16
+ if (typeof value !== "object" || ancestors.has(value)) return unsupported();
17
+ const prototype = Object.getPrototypeOf(value);
18
+ if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) {
19
+ return unsupported();
20
+ }
21
+ ancestors.add(value);
22
+ try {
23
+ if (Array.isArray(value)) {
24
+ const keys2 = Reflect.ownKeys(value);
25
+ if (keys2.length !== value.length + 1) return unsupported();
26
+ const items = [];
27
+ for (let i = 0; i < value.length; i++) {
28
+ const descriptor = Object.getOwnPropertyDescriptor(value, String(i));
29
+ if (!descriptor || !descriptor.enumerable || !("value" in descriptor)) return unsupported();
30
+ items.push(encodeSignalValue(descriptor.value, ancestors));
31
+ }
32
+ return ["array", items];
33
+ }
34
+ const keys = Reflect.ownKeys(value);
35
+ if (keys.some((key) => typeof key !== "string")) return unsupported();
36
+ const entries = [];
37
+ for (const key of keys.sort()) {
38
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
39
+ if (!descriptor.enumerable || !("value" in descriptor)) return unsupported();
40
+ entries.push([key, encodeSignalValue(descriptor.value, ancestors)]);
41
+ }
42
+ return ["object", entries];
43
+ } finally {
44
+ ancestors.delete(value);
45
+ }
46
+ }
47
+ function snapshotSignalValue(value, ancestors = /* @__PURE__ */ new Set()) {
48
+ if (value === void 0 || value === null || typeof value === "boolean" || typeof value === "string")
49
+ return value;
50
+ if (typeof value === "number") return Number.isFinite(value) ? value : unsupported();
51
+ if (typeof value !== "object" || ancestors.has(value)) return unsupported();
52
+ const prototype = Object.getPrototypeOf(value);
53
+ if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) {
54
+ return unsupported();
55
+ }
56
+ ancestors.add(value);
57
+ try {
58
+ const keys = Reflect.ownKeys(value);
59
+ if (Array.isArray(value)) {
60
+ if (keys.length !== value.length + 1) return unsupported();
61
+ const items = [];
62
+ for (let i = 0; i < value.length; i++) {
63
+ const descriptor = Object.getOwnPropertyDescriptor(value, String(i));
64
+ if (!descriptor || !descriptor.enumerable || !("value" in descriptor)) return unsupported();
65
+ items.push(snapshotSignalValue(descriptor.value, ancestors));
66
+ }
67
+ return Object.freeze(items);
68
+ }
69
+ if (keys.some((key) => typeof key !== "string")) return unsupported();
70
+ const object = {};
71
+ for (const key of keys.sort()) {
72
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
73
+ if (!descriptor.enumerable || !("value" in descriptor)) return unsupported();
74
+ Object.defineProperty(object, key, {
75
+ value: snapshotSignalValue(descriptor.value, ancestors),
76
+ enumerable: true
77
+ });
78
+ }
79
+ return Object.freeze(object);
80
+ } finally {
81
+ ancestors.delete(value);
82
+ }
83
+ }
84
+ function decodeSignalValue(encoded) {
85
+ if (!Array.isArray(encoded)) return unsupported();
86
+ const [tag, value] = encoded;
87
+ switch (tag) {
88
+ case "undefined":
89
+ if (encoded.length !== 1) return unsupported();
90
+ return void 0;
91
+ case "null":
92
+ if (encoded.length !== 1) return unsupported();
93
+ return null;
94
+ case "boolean":
95
+ if (encoded.length !== 2 || typeof value !== "boolean") return unsupported();
96
+ return value;
97
+ case "number":
98
+ if (encoded.length !== 2) return unsupported();
99
+ if (value === "-0") return -0;
100
+ if (typeof value !== "number" || !Number.isFinite(value) || Object.is(value, -0)) {
101
+ return unsupported();
102
+ }
103
+ return value;
104
+ case "string":
105
+ if (encoded.length !== 2 || typeof value !== "string") return unsupported();
106
+ return value;
107
+ case "array":
108
+ if (encoded.length !== 2 || !Array.isArray(value)) return unsupported();
109
+ return Object.freeze(value.map((item) => decodeSignalValue(item)));
110
+ case "object": {
111
+ if (encoded.length !== 2 || !Array.isArray(value)) return unsupported();
112
+ const object = {};
113
+ let previous;
114
+ for (const entry of value) {
115
+ if (!Array.isArray(entry) || entry.length !== 2 || typeof entry[0] !== "string" || previous !== void 0 && entry[0] <= previous) {
116
+ return unsupported();
117
+ }
118
+ previous = entry[0];
119
+ Object.defineProperty(object, entry[0], {
120
+ value: decodeSignalValue(entry[1]),
121
+ enumerable: true
122
+ });
123
+ }
124
+ return Object.freeze(object);
125
+ }
126
+ default:
127
+ return unsupported();
128
+ }
129
+ }
130
+ export {
131
+ decodeSignalValue,
132
+ encodeSignalValue,
133
+ snapshotSignalValue
134
+ };
@@ -0,0 +1,229 @@
1
+ const DEVTOOLS_HOOK_VERSION = 3;
2
+ const roots = /* @__PURE__ */ new Set();
3
+ const subscribers = /* @__PURE__ */ new Set();
4
+ const ids = /* @__PURE__ */ new WeakMap();
5
+ let nextId = 1;
6
+ let idIndex = /* @__PURE__ */ new Map();
7
+ let nameResolver = (b) => b && b.body && (b.body.displayName || b.body.name) || "Unknown";
8
+ let childWalker = null;
9
+ let nativeReadInspector = null;
10
+ let transitionPendingCount = 0;
11
+ const boundaries = /* @__PURE__ */ new Map();
12
+ function branchToState(branch) {
13
+ if (branch === 0) return "catch";
14
+ if (branch === 1) return "resolved";
15
+ if (branch === 2) return "pending";
16
+ return "init";
17
+ }
18
+ function idOf(scope) {
19
+ let id = ids.get(scope);
20
+ if (id === void 0) {
21
+ id = nextId++;
22
+ ids.set(scope, id);
23
+ }
24
+ return id;
25
+ }
26
+ function safePreview(value, depth = 0) {
27
+ if (value === null || value === void 0) return value;
28
+ const t = typeof value;
29
+ if (t === "string" || t === "boolean") return value;
30
+ if (t === "number") return Number.isFinite(value) ? value : String(value);
31
+ if (t === "bigint") return `${value}n`;
32
+ if (t === "function") return "[Function]";
33
+ if (t === "symbol") return String(value);
34
+ try {
35
+ if (depth >= 2) return Array.isArray(value) ? "[Array]" : "[Object]";
36
+ if (typeof Node !== "undefined" && value instanceof Node) return "[Node]";
37
+ const fields = Object.getOwnPropertyDescriptors(value);
38
+ if (Array.isArray(value)) {
39
+ const length = Math.min(Number(fields.length?.value) || 0, 20);
40
+ return Array.from({ length }, (_, index) => previewField(fields[index], depth));
41
+ }
42
+ const out = {};
43
+ let n = 0;
44
+ for (const key of Object.keys(fields)) {
45
+ const field = fields[key];
46
+ if (!field.enumerable) continue;
47
+ if (n++ >= 20) break;
48
+ Object.defineProperty(out, key, {
49
+ value: previewField(field, depth),
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true
53
+ });
54
+ }
55
+ return out;
56
+ } catch {
57
+ return "[Unavailable]";
58
+ }
59
+ }
60
+ function previewField(field, depth) {
61
+ if (field === void 0) return void 0;
62
+ return "value" in field ? safePreview(field.value, depth + 1) : "[Getter]";
63
+ }
64
+ function classifyCell(cell) {
65
+ if (cell === null || typeof cell !== "object") return null;
66
+ let fields;
67
+ try {
68
+ fields = Object.getOwnPropertyDescriptors(cell);
69
+ } catch {
70
+ return { kind: "other", value: "[Unavailable]" };
71
+ }
72
+ if (fields.effect?.value === true) return null;
73
+ if ("setter" in fields) return { kind: "state", value: previewField(fields.value, -1) };
74
+ if ("dispatch" in fields && "reducer" in fields)
75
+ return { kind: "reducer", value: previewField(fields.value, -1) };
76
+ if ("current" in fields && !("deps" in fields))
77
+ return { kind: "ref", value: previewField(fields.current, -1) };
78
+ if ("deps" in fields && "value" in fields)
79
+ return { kind: "memo-or-callback", value: previewField(fields.value, -1) };
80
+ return { kind: "other", value: safePreview(cell) };
81
+ }
82
+ function nameOf(scope, key) {
83
+ if (scope.body != null || scope.kind != null) return nameResolver(scope);
84
+ const component = nameResolver(scope);
85
+ if (component !== "Unknown") return component;
86
+ return key === void 0 ? "scope" : String(key);
87
+ }
88
+ function buildNode(scope, key, seen) {
89
+ if (scope.disposed || seen.has(scope)) return null;
90
+ seen.add(scope);
91
+ const id = idOf(scope);
92
+ idIndex.set(id, scope);
93
+ const children = [];
94
+ if (scope.children !== null) {
95
+ for (const child of scope.children) {
96
+ const node = buildNode(child.scope, child.key, seen);
97
+ if (node !== null) children.push(node);
98
+ }
99
+ }
100
+ childWalker?.(scope, (child) => {
101
+ const node = buildNode(child, void 0, seen);
102
+ if (node !== null) children.push(node);
103
+ });
104
+ return {
105
+ id,
106
+ name: nameOf(scope, key),
107
+ kind: scope.kind ?? "component",
108
+ children
109
+ };
110
+ }
111
+ const hook = {
112
+ version: DEVTOOLS_HOOK_VERSION,
113
+ getTree() {
114
+ idIndex = /* @__PURE__ */ new Map();
115
+ const seen = /* @__PURE__ */ new Set();
116
+ const nodes = [];
117
+ for (const root of roots) {
118
+ const node = buildNode(root, void 0, seen);
119
+ if (node !== null) nodes.push(node);
120
+ }
121
+ return nodes;
122
+ },
123
+ inspect(id) {
124
+ const scope = idIndex.get(id);
125
+ if (scope === void 0 || scope.disposed) return null;
126
+ const hooks = [];
127
+ if (scope.hooks) {
128
+ for (const cell of scope.hooks.values()) {
129
+ const classified = classifyCell(cell);
130
+ if (classified) hooks.push(classified);
131
+ }
132
+ }
133
+ const context = [];
134
+ if (scope.$$ctxValues) {
135
+ for (const [ctx, value] of scope.$$ctxValues) {
136
+ context.push({
137
+ name: ctx && (ctx.displayName || ctx.name) || "Context",
138
+ value: safePreview(value)
139
+ });
140
+ }
141
+ }
142
+ const detail = {
143
+ id,
144
+ name: nameOf(scope, void 0),
145
+ hooks,
146
+ context,
147
+ effectCount: scope.effectSlots ? scope.effectSlots.length : 0
148
+ };
149
+ const native = nativeReadInspector?.(scope);
150
+ if (native !== void 0 && native !== null) {
151
+ detail.nativeReads = {
152
+ ownerId: idOf(native.block),
153
+ committed: native.committed,
154
+ pending: native.pending,
155
+ retry: native.retry
156
+ };
157
+ }
158
+ return detail;
159
+ },
160
+ subscribe(listener) {
161
+ subscribers.add(listener);
162
+ return () => {
163
+ subscribers.delete(listener);
164
+ };
165
+ },
166
+ getTransitionState() {
167
+ return {
168
+ pendingCount: transitionPendingCount,
169
+ boundaries: [...boundaries.values()]
170
+ };
171
+ }
172
+ };
173
+ function installDevtoolsGlobal() {
174
+ const target = globalThis;
175
+ try {
176
+ if (target.__OCTANE_DEVTOOLS__ !== hook) target.__OCTANE_DEVTOOLS__ = hook;
177
+ } catch {
178
+ }
179
+ }
180
+ function __devtoolsSetNameResolver(fn) {
181
+ nameResolver = fn;
182
+ }
183
+ function __devtoolsSetChildWalker(walk) {
184
+ childWalker = walk;
185
+ }
186
+ function __devtoolsSetNativeReadInspector(inspect) {
187
+ nativeReadInspector = inspect;
188
+ }
189
+ function __devtoolsRegisterRoot(root) {
190
+ roots.add(root);
191
+ installDevtoolsGlobal();
192
+ }
193
+ function __devtoolsUnregisterRoot(root) {
194
+ roots.delete(root);
195
+ hook.getTree();
196
+ }
197
+ function __devtoolsNotifyFlush() {
198
+ if (subscribers.size === 0) return;
199
+ for (const listener of subscribers) {
200
+ try {
201
+ listener();
202
+ } catch (err) {
203
+ console.error(err);
204
+ }
205
+ }
206
+ }
207
+ function __devtoolsSetTransitionCount(count) {
208
+ transitionPendingCount = count < 0 ? 0 : count;
209
+ }
210
+ function __devtoolsSetBoundaryState(slot, branch, hasResolved, label) {
211
+ const id = idOf(slot);
212
+ boundaries.set(id, { id, branch, state: branchToState(branch), hasResolved, label });
213
+ }
214
+ function __devtoolsClearBoundary(slot) {
215
+ boundaries.delete(idOf(slot));
216
+ }
217
+ export {
218
+ DEVTOOLS_HOOK_VERSION,
219
+ __devtoolsClearBoundary,
220
+ __devtoolsNotifyFlush,
221
+ __devtoolsRegisterRoot,
222
+ __devtoolsSetBoundaryState,
223
+ __devtoolsSetChildWalker,
224
+ __devtoolsSetNameResolver,
225
+ __devtoolsSetNativeReadInspector,
226
+ __devtoolsSetTransitionCount,
227
+ __devtoolsUnregisterRoot,
228
+ installDevtoolsGlobal
229
+ };
@@ -0,0 +1,4 @@
1
+ const domBindingClaims = /* @__PURE__ */ new WeakMap();
2
+ export {
3
+ domBindingClaims
4
+ };