octane 0.2.14 → 0.2.16

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 (42) hide show
  1. package/dist/cjs/dom-binding-claims.cjs +28 -0
  2. package/dist/cjs/dom-bindings.cjs +35 -6
  3. package/dist/cjs/method-dep.cjs +15 -1
  4. package/dist/cjs/runtime.cjs +69 -21
  5. package/dist/cjs/signals/graph.cjs +2 -0
  6. package/dist/cjs/signals/transition-action.cjs +508 -0
  7. package/dist/cjs/signals/transition-candidate.cjs +26 -482
  8. package/dist/cjs/signals/transition-state.cjs +8 -0
  9. package/dist/cjs/stream-protocol.cjs +29 -0
  10. package/dist/cjs/version.cjs +1 -1
  11. package/dist/compiler/compile-universal.js +1 -1
  12. package/dist/compiler/compile.js +229 -54
  13. package/dist/compiler/dom-binding-program.js +16 -2
  14. package/dist/compiler/dom-bindings.js +54 -8
  15. package/dist/compiler/hook-deps.js +118 -12
  16. package/dist/compiler/hydrate-boundaries.js +141 -40
  17. package/dist/compiler/plain-hook-memo.js +1 -0
  18. package/dist/compiler/slot-hooks.js +1 -1
  19. package/dist/dom-binding-claims.d.ts +1 -0
  20. package/dist/dom-binding-claims.js +4 -0
  21. package/dist/dom-binding-program.d.ts +8 -0
  22. package/dist/dom-binding-program.js +9 -3
  23. package/dist/dom-bindings.d.ts +3 -2
  24. package/dist/dom-bindings.js +35 -6
  25. package/dist/hydration/independent-island.js +4 -2
  26. package/dist/hydration/index.d.ts +1 -0
  27. package/dist/hydration/index.js +2 -0
  28. package/dist/method-dep.d.ts +1 -1
  29. package/dist/method-dep.js +15 -1
  30. package/dist/runtime.d.ts +4 -4
  31. package/dist/runtime.js +71 -22
  32. package/dist/signals/graph.js +3 -0
  33. package/dist/signals/transition-action.d.ts +98 -0
  34. package/dist/signals/transition-action.js +497 -0
  35. package/dist/signals/transition-candidate.d.ts +5 -71
  36. package/dist/signals/transition-candidate.js +27 -495
  37. package/dist/signals/transition-state.d.ts +11 -9
  38. package/dist/signals/transition-state.js +6 -0
  39. package/dist/stream-protocol.d.ts +9 -0
  40. package/dist/stream-protocol.js +28 -0
  41. package/dist/version.js +1 -1
  42. package/package.json +1 -1
@@ -0,0 +1,28 @@
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 dom_binding_claims_exports = {};
20
+ __export(dom_binding_claims_exports, {
21
+ domBindingClaims: () => domBindingClaims
22
+ });
23
+ module.exports = __toCommonJS(dom_binding_claims_exports);
24
+ const domBindingClaims = /* @__PURE__ */ new WeakMap();
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ domBindingClaims
28
+ });
@@ -31,6 +31,7 @@ __export(dom_bindings_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(dom_bindings_exports);
33
33
  var import_class_names = require("./class-names.cjs");
34
+ var import_dom_binding_claims = require("./dom-binding-claims.cjs");
34
35
  var import_sanitize_url = require("./sanitize-url.cjs");
35
36
  var import_stream_protocol = require("./stream-protocol.cjs");
36
37
  var import_native_read_seeds = require("./signals/native-read-seeds.cjs");
@@ -91,6 +92,11 @@ function __releaseBinding(node, name) {
91
92
  const channels = claims.get(node);
92
93
  channels.delete(name);
93
94
  if (channels.size === 0) claims.delete(node);
95
+ const published = import_dom_binding_claims.domBindingClaims.get(node);
96
+ if (published) {
97
+ published.delete(name);
98
+ if (published.size === 0) import_dom_binding_claims.domBindingClaims.delete(node);
99
+ }
94
100
  }
95
101
  function resolveNodes(root, descriptor) {
96
102
  if (root?.nodeType !== 1 || root.getAttribute("data-octane-bindings") !== descriptor.id || descriptor.nodes.length === 0) {
@@ -100,9 +106,9 @@ function resolveNodes(root, descriptor) {
100
106
  const nodes = [];
101
107
  const childIndices = [];
102
108
  for (let i = 0; i < descriptor.nodes.length; i++) {
103
- const [parent, tag, namespace, children] = descriptor.nodes[i];
109
+ const [parent, tag, namespace, children, , text] = descriptor.nodes[i];
104
110
  const node = i === 0 ? parent === -1 ? root : void 0 : parent >= 0 && parent < i && descriptor.nodes[parent][3] !== null ? nodes[parent]?.children[childIndices[parent]++] : void 0;
105
- if (node === void 0 || descriptor.nodes[i][4] === true || node.localName !== tag || node.namespaceURI !== namespaces[namespace] || children !== null && (node.childNodes.length !== children || node.children.length !== children)) {
111
+ if (node === void 0 || descriptor.nodes[i][4] === true || node.localName !== tag || node.namespaceURI !== namespaces[namespace] || (text ? node.childNodes.length > 1 || node.firstChild !== null && node.firstChild.nodeType !== 3 : children !== null && (node.childNodes.length !== children || node.children.length !== children))) {
106
112
  throw new Error("DOM bindings cannot adopt a mismatched static element topology.");
107
113
  }
108
114
  nodes.push(node);
@@ -143,9 +149,9 @@ function resolveAddressedNodes(root, descriptor) {
143
149
  }
144
150
  const childCounts = new Array(descriptor.nodes.length).fill(0);
145
151
  for (let i = 0; i < descriptor.nodes.length; i++) {
146
- const [parent, tag, namespace, children, openChildren] = descriptor.nodes[i];
152
+ const [parent, tag, namespace, children, openChildren, text] = descriptor.nodes[i];
147
153
  const node = nodes[i];
148
- if (node === void 0 || node.localName !== tag || node.namespaceURI !== namespaces[namespace] || (i === 0 ? parent !== -1 || node !== root : parent < 0 || parent >= i || descriptor.nodes[parent][3] === null || node.parentElement !== nodes[parent] || descriptor.nodes[parent][4] !== true && nodes[parent].children[childCounts[parent]] !== node) || openChildren && children === null || children !== null && !openChildren && (node.childNodes.length !== children || node.children.length !== children)) {
154
+ if (node === void 0 || node.localName !== tag || node.namespaceURI !== namespaces[namespace] || (i === 0 ? parent !== -1 || node !== root : parent < 0 || parent >= i || descriptor.nodes[parent][3] === null || node.parentElement !== nodes[parent] || descriptor.nodes[parent][4] !== true && nodes[parent].children[childCounts[parent]] !== node) || openChildren && children === null || (text ? node.childNodes.length > 1 || node.firstChild !== null && node.firstChild.nodeType !== 3 : children !== null && !openChildren && (node.childNodes.length !== children || node.children.length !== children))) {
149
155
  throw new Error("DOM bindings cannot adopt a mismatched addressed element topology.");
150
156
  }
151
157
  if (parent !== -1) childCounts[parent]++;
@@ -160,6 +166,11 @@ function resolveAddressedNodes(root, descriptor) {
160
166
  function normalize(binding, value) {
161
167
  const type = typeof value;
162
168
  switch (binding[1]) {
169
+ case "text":
170
+ if (value == null || value === false) return "";
171
+ if (type !== "string" && type !== "number" && type !== "bigint" && type !== "boolean")
172
+ throw new TypeError("DOM binding text must be a synchronous scalar.");
173
+ return String(value);
163
174
  case "styleObject":
164
175
  return value;
165
176
  case "class":
@@ -187,7 +198,11 @@ function normalize(binding, value) {
187
198
  }
188
199
  function write(node, binding, value) {
189
200
  const name = binding[2];
190
- if (binding[1] === "classToken") {
201
+ if (binding[1] === "text") {
202
+ const text = node.firstChild;
203
+ if (text === null) node.appendChild(node.ownerDocument.createTextNode(value));
204
+ else if (text.nodeValue !== value) text.nodeValue = value;
205
+ } else if (binding[1] === "classToken") {
191
206
  node.classList.toggle(name, value !== null);
192
207
  } else if (binding[1] === "url") {
193
208
  if (value === "" && !(name === "href" && node.localName === "a")) value = null;
@@ -400,7 +415,21 @@ function __adoptBindings(root, descriptor, source, options) {
400
415
  styles.set(i, style = __createBindingStyleRestoration(nodes[binding[0]], binding));
401
416
  style.write(next[i]);
402
417
  } else write(nodes[binding[0]], binding, next[i]);
403
- if (!disposed) previous[i] = next[i];
418
+ if (!disposed) {
419
+ previous[i] = next[i];
420
+ if (binding[1] === "attr" || binding[1] === "boolean" || binding[1] === "aria" || binding[1] === "class" || binding[1] === "styleProperty" || binding[1] === "text") {
421
+ const [node, name] = owned[i];
422
+ let published2 = next[i];
423
+ if (binding[1] === "styleProperty") {
424
+ const style = node.style;
425
+ const value = style.getPropertyValue(binding[2]);
426
+ published2 = value === "" ? null : value + (style.getPropertyPriority(binding[2]) ? " !important" : "");
427
+ }
428
+ let claims2 = import_dom_binding_claims.domBindingClaims.get(node);
429
+ if (claims2 === void 0) import_dom_binding_claims.domBindingClaims.set(node, claims2 = /* @__PURE__ */ new Map());
430
+ claims2.set(name, published2);
431
+ }
432
+ }
404
433
  }
405
434
  };
406
435
  const drain = (preview = false) => {
@@ -22,10 +22,24 @@ __export(method_dep_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(method_dep_exports);
24
24
  var import_has_own = require("./has-own.cjs");
25
- function __methodDep(receiver, name) {
25
+ const guardedNullReceiver = /* @__PURE__ */ Symbol();
26
+ const guardedUndefinedReceiver = /* @__PURE__ */ Symbol();
27
+ function __methodDep(receiver, name, guarded = false) {
28
+ if (guarded && receiver == null) {
29
+ return receiver === null ? guardedNullReceiver : guardedUndefinedReceiver;
30
+ }
26
31
  if ((typeof receiver !== "object" || receiver === null) && typeof receiver !== "function") {
27
32
  return receiver;
28
33
  }
34
+ if (guarded) {
35
+ try {
36
+ const descriptor = Object.getOwnPropertyDescriptor(receiver, name);
37
+ if (descriptor) return "value" in descriptor ? descriptor.value : receiver;
38
+ return name in receiver ? receiver : void 0;
39
+ } catch {
40
+ return receiver;
41
+ }
42
+ }
29
43
  if (import_has_own.hasOwnProp.call(receiver, name)) return receiver[name];
30
44
  return name in receiver ? receiver : void 0;
31
45
  }
@@ -315,6 +315,7 @@ __export(runtime_exports, {
315
315
  });
316
316
  module.exports = __toCommonJS(runtime_exports);
317
317
  var import_hook_slot_cache = require("./hook-slot-cache.cjs");
318
+ var import_dom_binding_claims = require("./dom-binding-claims.cjs");
318
319
  var import_dom_stage = require("./dom-stage.cjs");
319
320
  var import_dom_binding_styles = require("./dom-binding-styles.cjs");
320
321
  var import_dom_binding_handoff = require("./dom-binding-handoff.cjs");
@@ -839,6 +840,7 @@ function scheduleNativeRead(target) {
839
840
  }
840
841
  function ensureNativeReadDriver() {
841
842
  if (NATIVE_READ_DRIVER !== null) return NATIVE_READ_DRIVER;
843
+ (0, import_transition_candidate.installNativeSignalActionExtension)();
842
844
  NATIVE_READ_DRIVER = (0, import_native_read_client.createNativeReadDriver)({
843
845
  capture: () => WIP_CAPTURE,
844
846
  cleanup: registerHookCleanup,
@@ -1456,7 +1458,7 @@ function nativeCandidateForAction(batch) {
1456
1458
  candidate = void 0;
1457
1459
  }
1458
1460
  }
1459
- return candidate ?? (batch.native = new import_transition_candidate.SignalCandidateFrame());
1461
+ return candidate ?? (batch.native = (0, import_transition_state.createSignalActionFrame)?.());
1460
1462
  }
1461
1463
  function ensureNativeActionResolver() {
1462
1464
  if (nativeActionResolverInstalled) return;
@@ -11583,7 +11585,7 @@ class HydrationCapability {
11583
11585
  const first = getFirstChild(el);
11584
11586
  if (first !== null && first.nodeType === 3) {
11585
11587
  const server = (STAGED_DOM?.view(first) ?? first).nodeValue;
11586
- if (server !== text && !isTextParserNormalizedMatch(server, text) && !isHydrationSuppressed(el)) {
11588
+ if (server !== text && import_dom_binding_claims.domBindingClaims.get(el)?.get("#text") !== server && !isTextParserNormalizedMatch(server, text) && !isHydrationSuppressed(el)) {
11587
11589
  this.recordTextMismatch(first, loc || el.__oct_loc, server);
11588
11590
  (STAGED_DOM?.view(first) ?? first).nodeValue = text;
11589
11591
  }
@@ -11668,6 +11670,7 @@ class HydrationCapability {
11668
11670
  name.indexOf(":") >= 0 ? name.slice(name.indexOf(":") + 1) : name
11669
11671
  ) : (STAGED_DOM?.view(el) ?? el).getAttribute(name);
11670
11672
  if (server === next) return false;
11673
+ if (import_dom_binding_claims.domBindingClaims.get(el)?.get(name) === server) return false;
11671
11674
  if (next !== null && isAttributeParserNormalizedMatch(server, next)) return false;
11672
11675
  const mode = hydrationMismatchMode(el);
11673
11676
  if (mode === 0) return true;
@@ -11678,10 +11681,11 @@ class HydrationCapability {
11678
11681
  }
11679
11682
  allowClass(el, next, absentIsEmpty = false) {
11680
11683
  const mode = hydrationMismatchMode(el);
11681
- if (mode === 0) return true;
11682
11684
  const rawServer = (STAGED_DOM?.view(el) ?? el).getAttribute("class");
11683
11685
  const server = absentIsEmpty && rawServer === null ? "" : rawServer;
11684
11686
  if (server === next) return true;
11687
+ if (import_dom_binding_claims.domBindingClaims.get(el)?.get("class") === rawServer) return false;
11688
+ if (mode === 0) return true;
11685
11689
  if (mode === 1) return false;
11686
11690
  if (process.env.NODE_ENV !== "production")
11687
11691
  warnHydrationValueMismatch(el.__oct_loc, "attribute `class`", server, next);
@@ -11723,6 +11727,18 @@ class HydrationCapability {
11723
11727
  applyStyleProperty(el, expectedStyle, entries[i], entry);
11724
11728
  }
11725
11729
  }
11730
+ const claims = import_dom_binding_claims.domBindingClaims.get(el);
11731
+ if (claims !== void 0) {
11732
+ for (const [channel, published] of claims) {
11733
+ if (!channel.startsWith("style:")) continue;
11734
+ const property = channel.slice(6);
11735
+ const value2 = style.getPropertyValue(property);
11736
+ const priority = style.getPropertyPriority(property);
11737
+ if ((value2 === "" ? null : value2 + (priority ? " !important" : "")) !== published) continue;
11738
+ if (value2 === "") expectedStyle.removeProperty(property);
11739
+ else expectedStyle.setProperty(property, value2, priority);
11740
+ }
11741
+ }
11726
11742
  const expected = expectedStyle.cssText;
11727
11743
  const expectsStyleAttribute = expected !== "";
11728
11744
  if (before === expected && hadStyleAttribute === expectsStyleAttribute) return true;
@@ -12442,7 +12458,8 @@ function presentationWrite(writer, kind, ...args) {
12442
12458
  const keys = kind === "nativeProjectionBinding" ? args[4].map((field) => field === "className" ? "class" : field) : kind === "setStyleProperties" ? args[1].filter((_, index) => index % 2 === 0).map((key2) => "style:" + key2) : [
12443
12459
  kind === "nativeStyleBinding" || kind === "setStyle" ? "style" : kind === "setStyleProperty" ? "style:" + args[1] : kind.includes("Class") ? "class" : kind === "bindSignalAttribute" ? args[3] : args[changed2 ? 3 : 1]
12444
12460
  ];
12445
- if (element2 !== frame.lease.root || keys.some((key2) => !channels.has(key2)) || kind === "bindSignalValue" || kind === "setEventHandler" || kind === "bindSignalText" || kind === "setText" || kind === "markDangerouslySetInnerHTMLChildren")
12461
+ if (element2 !== frame.lease.root || // Preserve authored names for diagnostics; receipts use native field names.
12462
+ keys.some((key2) => !channels.has(import_constants.ATTRIBUTE_ALIASES.get(key2) ?? key2)) || kind === "bindSignalValue" || kind === "setEventHandler" || kind === "bindSignalText" || kind === "setText" || kind === "markDangerouslySetInnerHTMLChildren")
12446
12463
  presentationMiss(false);
12447
12464
  }
12448
12465
  if (kind === "queueNativeChangeDiagnostic") {
@@ -12753,8 +12770,9 @@ function writeDirectSignalBinding(binding, value) {
12753
12770
  }
12754
12771
  } else if (binding.kind === "value") {
12755
12772
  const element = binding.target;
12756
- if (element.localName === "select") setSelectValue(element, value);
12757
- else setValue(element, value);
12773
+ const tag = element.localName;
12774
+ if (tag === "select") setSelectValue(element, value);
12775
+ else setValue(element, value, tag === "textarea" && isWritableSignal(binding.handle));
12758
12776
  } else {
12759
12777
  setChecked(binding.target, value);
12760
12778
  }
@@ -14499,7 +14517,7 @@ function resolveHostPropSources(el, sources, props, readStyle) {
14499
14517
  if (readStyle !== void 0 && "style" in resolved) resolved.style = readStyle(resolved.style);
14500
14518
  return resolved;
14501
14519
  }
14502
- function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false, readStyle, deferControl = false) {
14520
+ function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false, readStyle, deferControl = false, writableTextareaValue = false) {
14503
14521
  const props = /* @__PURE__ */ new Map();
14504
14522
  const resolved = resolveHostPropSources(el, sources, props, readStyle);
14505
14523
  const tag = el.localName;
@@ -14514,7 +14532,8 @@ function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false,
14514
14532
  props.get("defaultValue")?.value,
14515
14533
  props.get("checked")?.value,
14516
14534
  props.get("defaultChecked")?.value,
14517
- props.get("multiple")?.value
14535
+ props.get("multiple")?.value,
14536
+ writableTextareaValue
14518
14537
  );
14519
14538
  return resolved;
14520
14539
  }
@@ -14535,12 +14554,14 @@ function resolveSignalStyle(value, handles, read) {
14535
14554
  }
14536
14555
  return copy ?? value;
14537
14556
  }
14538
- function resolveSignalHostPropSources(sources, readStyle, read = readSignalBinding) {
14557
+ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBinding, textarea = false) {
14539
14558
  const handles = /* @__PURE__ */ new Set();
14540
14559
  let rows;
14560
+ let writableTextareaValue = false;
14541
14561
  for (let i = 0; i < sources.length; i++) {
14542
14562
  const source = sources[i];
14543
14563
  if (!source[0]) {
14564
+ if (textarea && source[1] === "value") writableTextareaValue = isWritableSignal(source[2]);
14544
14565
  const value = source[1] === "children" || source[1] === "style" && readStyle !== void 0 ? source[2] : source[1] === "style" ? resolveSignalStyle(source[2], handles, read) : isSignalHandle(source[2]) ? (handles.add(source[2]), read(source[2])) : source[2];
14545
14566
  if (value !== source[2]) {
14546
14567
  rows ??= sources.slice();
@@ -14553,6 +14574,7 @@ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBindi
14553
14574
  let copy;
14554
14575
  for (const name of Object.keys(spread)) {
14555
14576
  const current = spread[name];
14577
+ if (textarea && name === "value") writableTextareaValue = isWritableSignal(current);
14556
14578
  const value = name === "children" || name === "style" && readStyle !== void 0 ? current : name === "style" ? resolveSignalStyle(current, handles, read) : isSignalHandle(current) ? (handles.add(current), read(current)) : current;
14557
14579
  if (value !== current) {
14558
14580
  copy ??= { ...spread };
@@ -14564,7 +14586,7 @@ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBindi
14564
14586
  rows[i] = [true, copy];
14565
14587
  }
14566
14588
  }
14567
- return { sources: rows ?? sources, handles };
14589
+ return textarea ? { sources: rows ?? sources, handles, writableTextareaValue } : { sources: rows ?? sources, handles };
14568
14590
  }
14569
14591
  function winningSignalHostControl(sources, name) {
14570
14592
  let winner;
@@ -14584,14 +14606,21 @@ function updateSignalHostPropSources(binding) {
14584
14606
  if (binding.disposed || binding.pendingControl || binding.scope.block.disposed) return;
14585
14607
  try {
14586
14608
  runWithBlockSignalOwner(binding.scope, () => {
14587
- const next = resolveSignalHostPropSources(binding.sources, binding.readStyle);
14609
+ const next = resolveSignalHostPropSources(
14610
+ binding.sources,
14611
+ binding.readStyle,
14612
+ void 0,
14613
+ binding.element.localName === "textarea"
14614
+ );
14588
14615
  binding.resolved = setHostPropSources(
14589
14616
  binding.element,
14590
14617
  next.sources,
14591
14618
  binding.resolved,
14592
14619
  binding.scope,
14593
14620
  binding.hasNestedChildren,
14594
- binding.readStyle
14621
+ binding.readStyle,
14622
+ false,
14623
+ next.writableTextareaValue
14595
14624
  );
14596
14625
  if (process.env.NODE_ENV !== "production" && STAGED_DOM === null)
14597
14626
  drainDevFormDiagnostics(binding.element);
@@ -14858,7 +14887,12 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14858
14887
  validateDirectSignalControl(element, site);
14859
14888
  binding.pendingControl ||= activeHydration() !== null && controlSnapshot.editRevision > 0;
14860
14889
  }
14861
- const next = resolveSignalHostPropSources(sources, readStyle);
14890
+ const next = resolveSignalHostPropSources(
14891
+ sources,
14892
+ readStyle,
14893
+ void 0,
14894
+ element.localName === "textarea"
14895
+ );
14862
14896
  binding.resolved = setHostPropSources(
14863
14897
  element,
14864
14898
  next.sources,
@@ -14866,7 +14900,8 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14866
14900
  scope,
14867
14901
  hasNestedChildren,
14868
14902
  readStyle,
14869
- binding.pendingControl
14903
+ binding.pendingControl,
14904
+ next.writableTextareaValue
14870
14905
  );
14871
14906
  if (STAGED_COMMIT_CAPTURE !== null) {
14872
14907
  DEFERRED_LAYOUT_DRIVER.stageAction(() => {
@@ -16503,7 +16538,7 @@ function setNativeChangeDiagnosticMetadata(el, value) {
16503
16538
  if (state !== void 0) state.staticNativeChange = false;
16504
16539
  if (value === "runtime") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0, true);
16505
16540
  }
16506
- function setValue(el, value) {
16541
+ function setValue(el, value, writableTextareaEcho = false) {
16507
16542
  if (CURRENT_SCOPE?.block.idState.renderOwner?.controlLeases?.has(el)) presentationMiss(false);
16508
16543
  const input = el;
16509
16544
  const ctrl = armControlled(el);
@@ -16535,6 +16570,13 @@ function setValue(el, value) {
16535
16570
  const prev = ctrl.v;
16536
16571
  ctrl.v = value;
16537
16572
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0);
16573
+ if (writableTextareaEcho) {
16574
+ if ((STAGED_DOM?.view(input) ?? input).value === s) return;
16575
+ if (!(ctrl.composing && Object.is(prev, value))) (STAGED_DOM?.view(input) ?? input).value = s;
16576
+ if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s)
16577
+ (STAGED_DOM?.view(input) ?? input).defaultValue = s;
16578
+ return;
16579
+ }
16538
16580
  if (!(ctrl.composing && Object.is(prev, value)) && valueNeedsWrite(input, value))
16539
16581
  (STAGED_DOM?.view(input) ?? input).value = s;
16540
16582
  if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s)
@@ -16839,7 +16881,7 @@ function setFormControlSources(el, sources) {
16839
16881
  }
16840
16882
  applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple);
16841
16883
  }
16842
- function applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple) {
16884
+ function applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple, writableTextareaValue = false) {
16843
16885
  const ctrl = armControlled(el);
16844
16886
  const first = !ctrl.formSeen;
16845
16887
  const previousMultiple = ctrl.formMultiple;
@@ -16869,7 +16911,7 @@ function applyFormControlValues(el, tag, value, defaultValue, checked, defaultCh
16869
16911
  }
16870
16912
  if (tag === "textarea") {
16871
16913
  const textarea = el;
16872
- setValue(textarea, value);
16914
+ setValue(textarea, value, writableTextareaValue);
16873
16915
  if (value == null) {
16874
16916
  if (defaultValue != null) setDefaultValue(textarea, defaultValue, first);
16875
16917
  else if (!first && (STAGED_DOM?.view(textarea) ?? textarea).defaultValue !== "")
@@ -19196,19 +19238,25 @@ function flattenDeoptChildrenKeyed(outVals, outKeys, v, prefix) {
19196
19238
  for (let i = 0; i < v.length; i++) {
19197
19239
  const item = v[i];
19198
19240
  if (Array.isArray(item)) {
19199
- flattenDeoptChildrenKeyed(outVals, outKeys, item, prefix + i + ":");
19241
+ flattenDeoptChildrenKeyed(outVals, outKeys, item, prefix + ":" + i);
19200
19242
  } else if (item == null || item === false || item === true || item === "") {
19201
19243
  } else {
19202
19244
  outVals.push(item);
19203
- const k = keyForItem(item, i);
19204
- outKeys.push(prefix === "" ? k : prefix + String(k));
19245
+ const k2 = keyForItem(item, i);
19246
+ if (prefix === "") {
19247
+ outKeys.push(typeof k2 === "string" && k2[0] === ":" ? ":" + k2 : k2);
19248
+ } else {
19249
+ const explicit = item?.$$kind === ELEMENT_TAG && item.key != null;
19250
+ outKeys.push(prefix + ":" + (explicit ? "k" : "i") + String(k2));
19251
+ }
19205
19252
  }
19206
19253
  }
19207
19254
  return;
19208
19255
  }
19209
19256
  outVals.push(v);
19257
+ const k = v?.$$kind === ELEMENT_TAG && v.key != null ? v.key : 0;
19210
19258
  outKeys.push(
19211
- prefix === "" ? v?.$$kind === ELEMENT_TAG && v.key != null ? v.key : 0 : prefix + "0"
19259
+ prefix === "" ? typeof k === "string" && k[0] === ":" ? ":" + k : k : prefix + ":i0"
19212
19260
  );
19213
19261
  }
19214
19262
  function reconcileDeoptNode(prev, value, ownerBlock, ns) {
@@ -53,6 +53,7 @@ __export(graph_exports, {
53
53
  });
54
54
  module.exports = __toCommonJS(graph_exports);
55
55
  var import_transition_state = require("./transition-state.cjs");
56
+ var import_transition_action = require("./transition-action.cjs");
56
57
  var import_system = require("alien-signals/system");
57
58
  var import_errors = require("./errors.cjs");
58
59
  var import_read_protocol = require("./read-protocol.cjs");
@@ -759,6 +760,7 @@ function retireGraph(owner, nodes) {
759
760
  createNativeSource,
760
761
  attachObserver
761
762
  });
763
+ (0, import_transition_state.registerSignalActionFrameFactory)(() => new import_transition_action.SignalActionFrame());
762
764
  // Annotate the CommonJS export names for ESM import in node:
763
765
  0 && (module.exports = {
764
766
  CandidateUnsupportedError,