@stacksjs/stx 0.2.794 → 0.2.798

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 (247) hide show
  1. package/dist/{chunk-d6arvs57.js → chunk-0beyn8ak.js} +5 -5
  2. package/dist/{chunk-5a92srn2.js → chunk-0gsq8gps.js} +1 -1
  3. package/dist/chunk-0xnvjw7s.js +2 -0
  4. package/dist/chunk-1wyccmsr.js +2 -0
  5. package/dist/{chunk-7pk3t82j.js → chunk-20yz8bjp.js} +2 -2
  6. package/dist/{chunk-h0jnatd4.js → chunk-2ws2qe1k.js} +2 -2
  7. package/dist/{chunk-ssh2gycr.js → chunk-2z2bq2at.js} +3 -3
  8. package/dist/chunk-31qjy9xr.js +2 -0
  9. package/dist/chunk-33devn0s.js +2 -0
  10. package/dist/{chunk-c0ejyxfj.js → chunk-33vr7x2t.js} +3 -3
  11. package/dist/chunk-33wpv2n1.js +2 -0
  12. package/dist/{chunk-wk6xsyv3.js → chunk-3mby4nes.js} +3 -3
  13. package/dist/chunk-3p5gxc6t.js +2 -0
  14. package/dist/{chunk-j6255z7f.js → chunk-3x598qjt.js} +4 -4
  15. package/dist/chunk-4hgz9dkv.js +2 -0
  16. package/dist/{chunk-rrb9m2q2.js → chunk-4sesw88b.js} +5 -5
  17. package/dist/{chunk-94gyfwpz.js → chunk-4v50nafp.js} +14 -14
  18. package/dist/chunk-5kc9kjaa.js +2 -0
  19. package/dist/{chunk-vav9ktgm.js → chunk-5wwcgze3.js} +2 -2
  20. package/dist/chunk-5xd53dwe.js +2 -0
  21. package/dist/chunk-5y6518h8.js +2 -0
  22. package/dist/chunk-5y77pe7b.js +2 -0
  23. package/dist/chunk-6a97a9wk.js +2 -0
  24. package/dist/{chunk-5j619xgb.js → chunk-6b5zhtb3.js} +2 -2
  25. package/dist/chunk-6hre8cg4.js +2 -0
  26. package/dist/{chunk-4s5q1aea.js → chunk-6m4y5dh5.js} +6 -6
  27. package/dist/chunk-6pyweb05.js +2 -0
  28. package/dist/chunk-6tp7ys77.js +2 -0
  29. package/dist/chunk-6zxzr20d.js +2 -0
  30. package/dist/chunk-75ctpxr3.js +2 -0
  31. package/dist/{chunk-w9nwb8r3.js → chunk-7bxnjr3b.js} +7 -7
  32. package/dist/chunk-7gw96jpj.js +2 -0
  33. package/dist/chunk-7m4eesp0.js +2 -0
  34. package/dist/chunk-7na8bets.js +2 -0
  35. package/dist/{chunk-kr8qdg0r.js → chunk-7yb82rm6.js} +2 -2
  36. package/dist/{chunk-e3wmnjz8.js → chunk-810r5dk3.js} +3 -3
  37. package/dist/{chunk-e0wxcst7.js → chunk-89jn2jmf.js} +4 -4
  38. package/dist/{chunk-488kx8j5.js → chunk-8bzq2z0m.js} +5 -5
  39. package/dist/chunk-8k2n6abg.js +2 -0
  40. package/dist/chunk-8vqs94f3.js +2 -0
  41. package/dist/{chunk-dhqp3z4w.js → chunk-91htcq62.js} +2 -2
  42. package/dist/chunk-9736003n.js +2 -0
  43. package/dist/{chunk-agtvdtx4.js → chunk-9b6896tb.js} +2 -2
  44. package/dist/{chunk-y0pqpch2.js → chunk-9k6tza24.js} +7 -7
  45. package/dist/chunk-9w33k6f7.js +2 -0
  46. package/dist/{chunk-enep9r03.js → chunk-9x62j5f0.js} +52 -52
  47. package/dist/{chunk-b4r7d6me.js → chunk-a1ba9d2r.js} +5 -5
  48. package/dist/{chunk-efrc97by.js → chunk-a20wq8wf.js} +4 -4
  49. package/dist/{chunk-t3ptzpfc.js → chunk-a3xqfyb6.js} +2 -2
  50. package/dist/chunk-ag8j9ec2.js +2 -0
  51. package/dist/chunk-ak15dt1a.js +2 -0
  52. package/dist/{chunk-27rzdq3n.js → chunk-akcyaxwv.js} +2 -2
  53. package/dist/{chunk-w5hhqjwr.js → chunk-aw6369cx.js} +1 -1
  54. package/dist/chunk-b5ck6epd.js +177 -0
  55. package/dist/chunk-b98743ja.js +2 -0
  56. package/dist/{chunk-14ft0zc7.js → chunk-b9d70mgr.js} +6 -6
  57. package/dist/chunk-bskxswmn.js +2 -0
  58. package/dist/chunk-bv5h4etd.js +2 -0
  59. package/dist/chunk-c7x3bmvs.js +2 -0
  60. package/dist/{chunk-2gqhfge6.js → chunk-c84pxd2k.js} +2 -2
  61. package/dist/chunk-camm2hcx.js +2 -0
  62. package/dist/chunk-cd2wda5c.js +2 -0
  63. package/dist/chunk-cv6pqg85.js +2 -0
  64. package/dist/chunk-cy0mab8y.js +2 -0
  65. package/dist/chunk-d554f2fj.js +2 -0
  66. package/dist/chunk-dd1vqndp.js +2 -0
  67. package/dist/{chunk-0r61tkfe.js → chunk-ddhkhhc7.js} +2 -2
  68. package/dist/{chunk-9tqa8xvf.js → chunk-dsnggn3g.js} +2 -2
  69. package/dist/chunk-e14v1q9c.js +2 -0
  70. package/dist/{chunk-2m5h2mtr.js → chunk-e37g6ezw.js} +41 -41
  71. package/dist/chunk-e3xw2bzh.js +2 -0
  72. package/dist/{chunk-nps2whkz.js → chunk-eegb7f3t.js} +6 -6
  73. package/dist/chunk-eeztqt6f.js +2 -0
  74. package/dist/{chunk-1y9ez7nz.js → chunk-ef3w5thv.js} +2 -2
  75. package/dist/chunk-eh528njb.js +2 -0
  76. package/dist/chunk-en0wry1c.js +20 -0
  77. package/dist/chunk-eszpqrxy.js +2 -0
  78. package/dist/{chunk-2p4yad7w.js → chunk-fp0ew9n4.js} +4 -4
  79. package/dist/chunk-fyxkzs9c.js +2 -0
  80. package/dist/{chunk-d18xd9x5.js → chunk-gjf8cjdt.js} +3 -3
  81. package/dist/{chunk-7gdwvnwc.js → chunk-gvnfb6s2.js} +2 -2
  82. package/dist/{chunk-fpn4dren.js → chunk-gzfvj15b.js} +1 -1
  83. package/dist/chunk-hb4jkdfr.js +2 -0
  84. package/dist/{chunk-qp3xd98j.js → chunk-hg9mwgnr.js} +2 -2
  85. package/dist/{chunk-8q63njnd.js → chunk-hmt0vqhb.js} +1 -1
  86. package/dist/{chunk-v8rfeev5.js → chunk-hp9e8nz6.js} +2 -2
  87. package/dist/chunk-hzps1xya.js +2 -0
  88. package/dist/{chunk-985afhhy.js → chunk-j3st59hv.js} +2 -2
  89. package/dist/{chunk-7sartb04.js → chunk-jde0shn4.js} +2 -2
  90. package/dist/{chunk-15ckxpq7.js → chunk-jeprxn45.js} +6 -6
  91. package/dist/{chunk-bwcj9z19.js → chunk-jt0yn7ab.js} +4 -4
  92. package/dist/chunk-k8gpvg0w.js +2 -0
  93. package/dist/chunk-kgn911k7.js +2 -0
  94. package/dist/{chunk-jdj1358b.js → chunk-kj8dvzpc.js} +2 -2
  95. package/dist/chunk-km8c0j9g.js +2 -0
  96. package/dist/{chunk-w6taxq7d.js → chunk-mj3hzy1e.js} +5 -5
  97. package/dist/{chunk-66b56g2z.js → chunk-nw0v655w.js} +6 -6
  98. package/dist/{chunk-6v4b0xc1.js → chunk-p1mghe1h.js} +6 -6
  99. package/dist/{chunk-pa9zfbh6.js → chunk-p2a6dwj6.js} +6 -6
  100. package/dist/chunk-pw89m3re.js +2 -0
  101. package/dist/chunk-q38vjqv2.js +2 -0
  102. package/dist/{chunk-yyr7vb7k.js → chunk-q3ma4khe.js} +5 -5
  103. package/dist/{chunk-ne69yaak.js → chunk-q7q9e0gj.js} +10 -10
  104. package/dist/{chunk-kce6pzmj.js → chunk-qef2vv0m.js} +3 -3
  105. package/dist/{chunk-q14d714d.js → chunk-qjbpa1n4.js} +4 -4
  106. package/dist/{chunk-5gppagt3.js → chunk-qm2wmqre.js} +1 -1
  107. package/dist/{chunk-605b93pe.js → chunk-qpvwxppw.js} +4 -4
  108. package/dist/{chunk-8nb8b0nf.js → chunk-qxt6hdat.js} +1 -1
  109. package/dist/{chunk-1hajf3wc.js → chunk-r6d6jphq.js} +21 -21
  110. package/dist/chunk-rbv6fxtx.js +3 -0
  111. package/dist/chunk-rrketemm.js +2 -0
  112. package/dist/chunk-rwys552r.js +3 -0
  113. package/dist/chunk-s0bx4gjh.js +2 -0
  114. package/dist/{chunk-gv3bfkdm.js → chunk-s14jcqdf.js} +5 -5
  115. package/dist/{chunk-es006emk.js → chunk-s3fmmm98.js} +3 -3
  116. package/dist/chunk-s8s7b7rv.js +2 -0
  117. package/dist/{chunk-vkn133cs.js → chunk-s9b6abkb.js} +2 -2
  118. package/dist/{chunk-3gn1t0pa.js → chunk-sprgkk9j.js} +31 -31
  119. package/dist/chunk-sywqa4da.js +2 -0
  120. package/dist/{chunk-gb65t4n1.js → chunk-t65tn8ee.js} +2 -2
  121. package/dist/{chunk-vrbcdds3.js → chunk-trjhz9d9.js} +1 -1
  122. package/dist/chunk-txrbz95y.js +2 -0
  123. package/dist/{chunk-h0c6jtrj.js → chunk-v9hm1xv6.js} +5 -5
  124. package/dist/{chunk-bmfk3b29.js → chunk-w0zayhmg.js} +2 -2
  125. package/dist/{chunk-tnn0br4w.js → chunk-w58bnt44.js} +3 -3
  126. package/dist/chunk-w7681v48.js +2 -0
  127. package/dist/chunk-w7wz670a.js +2 -0
  128. package/dist/{chunk-epcy3r18.js → chunk-wp6bdac7.js} +113 -105
  129. package/dist/{chunk-8ztgy5y4.js → chunk-x8ckxemg.js} +107 -107
  130. package/dist/{chunk-74rf78w8.js → chunk-x8h81amr.js} +2 -2
  131. package/dist/{chunk-hh9t97hr.js → chunk-xa36escd.js} +3 -3
  132. package/dist/{chunk-7fr038wx.js → chunk-xskswvef.js} +4 -4
  133. package/dist/chunk-xzgtdcbg.js +2 -0
  134. package/dist/{chunk-k4bdf0dw.js → chunk-y9bj3566.js} +2 -2
  135. package/dist/chunk-yfdb3x3p.js +2 -0
  136. package/dist/{chunk-qv85c3qy.js → chunk-yv4dwdhc.js} +2 -2
  137. package/dist/{chunk-1stvxcjv.js → chunk-z1aq59qj.js} +3 -3
  138. package/dist/{chunk-nwbq8qvb.js → chunk-z1fb5k3h.js} +1305 -449
  139. package/dist/{chunk-tnkxww7b.js → chunk-z8wfvqbk.js} +5 -5
  140. package/dist/chunk-z9a80qqg.js +2 -0
  141. package/dist/chunk-za5kx15m.js +2 -0
  142. package/dist/{chunk-8e23zh2y.js → chunk-zbv8e4rq.js} +2 -2
  143. package/dist/{chunk-v1z6n7wz.js → chunk-znx5m1jv.js} +4 -4
  144. package/dist/{chunk-6pt4158p.js → chunk-zqsacq3r.js} +1 -1
  145. package/dist/{chunk-rgz797k3.js → chunk-zsy145ac.js} +3 -3
  146. package/dist/{chunk-j56mg28d.js → chunk-zx8tnhfr.js} +3 -3
  147. package/dist/cli.js +19 -19
  148. package/dist/client/signals-authoring-runtime.js +6 -3
  149. package/dist/client/signals-binding-utils-runtime.js +2 -4
  150. package/dist/client/signals-component-props-runtime.js +8 -2
  151. package/dist/client/signals-expression-compiler-runtime.js +1 -1
  152. package/dist/client/signals-for-runtime.js +34 -0
  153. package/dist/client/signals-handler-runtime.js +68 -24
  154. package/dist/client/signals-helpers-runtime.js +51 -0
  155. package/dist/client/signals-native-row-runtime.d.ts +26 -0
  156. package/dist/client/signals-native-row-runtime.js +661 -0
  157. package/dist/client/signals-pipe-runtime.js +16 -0
  158. package/dist/client/signals-process-element-runtime.js +305 -287
  159. package/dist/client/signals-proxy-runtime.js +56 -31
  160. package/dist/craft-entry.js +2 -2
  161. package/dist/craft.js +2 -2
  162. package/dist/native/accessibility.js +8 -0
  163. package/dist/native/compiler/bundle.js +1 -1
  164. package/dist/native/compiler/inline-style.js +93 -4
  165. package/dist/native/compiler/style-variables.js +9 -1
  166. package/dist/native/event-names.js +1 -0
  167. package/dist/native/prop-names.js +9 -1
  168. package/dist/native/runtime/binding-tree.d.ts +2 -0
  169. package/dist/native/runtime/binding-tree.js +12 -1
  170. package/dist/native/runtime/craft-bridge.js +66 -0
  171. package/dist/native/runtime/craft.d.ts +78 -2
  172. package/dist/native/runtime/native-host.d.ts +2 -0
  173. package/dist/native/runtime/native-host.js +315 -91
  174. package/dist/native-build.js +2 -23
  175. package/dist/pwa.js +3 -3
  176. package/dist/signals.d.ts +13 -10
  177. package/dist/signals.js +5 -3
  178. package/dist/ssg.js +15 -15
  179. package/dist/stx-virtual-ts.d.ts +25 -1
  180. package/dist/stx-virtual-ts.js +109 -6
  181. package/dist/typecheck.d.ts +3 -1
  182. package/dist/typecheck.js +28 -11
  183. package/package.json +6 -6
  184. package/dist/chunk-0675z8hj.js +0 -177
  185. package/dist/chunk-1brkqd5f.js +0 -2
  186. package/dist/chunk-1ds97d9m.js +0 -2
  187. package/dist/chunk-1tvb2stj.js +0 -2
  188. package/dist/chunk-2vxh8b8g.js +0 -2
  189. package/dist/chunk-33na85q2.js +0 -2
  190. package/dist/chunk-3t4t655h.js +0 -2
  191. package/dist/chunk-43ynckvh.js +0 -2
  192. package/dist/chunk-4v22nj67.js +0 -2
  193. package/dist/chunk-5v5w0cd2.js +0 -2
  194. package/dist/chunk-699t603m.js +0 -2
  195. package/dist/chunk-6f6xqzhb.js +0 -2
  196. package/dist/chunk-7mrr4ke5.js +0 -2
  197. package/dist/chunk-7tzzzvdg.js +0 -2
  198. package/dist/chunk-8a5txj4f.js +0 -2
  199. package/dist/chunk-8pphy0p1.js +0 -2
  200. package/dist/chunk-8rmb79zw.js +0 -2
  201. package/dist/chunk-8rwnzmvb.js +0 -2
  202. package/dist/chunk-90pxjq62.js +0 -2
  203. package/dist/chunk-9s4ggstz.js +0 -2
  204. package/dist/chunk-9wmjmas8.js +0 -2
  205. package/dist/chunk-9xdz8r73.js +0 -2
  206. package/dist/chunk-agvykxs8.js +0 -2
  207. package/dist/chunk-ajj56vrw.js +0 -2
  208. package/dist/chunk-ay4ep67v.js +0 -2
  209. package/dist/chunk-bwfncfe1.js +0 -3
  210. package/dist/chunk-cdsv4yrv.js +0 -2
  211. package/dist/chunk-d5e47gr4.js +0 -2
  212. package/dist/chunk-d910ytt2.js +0 -2
  213. package/dist/chunk-d9p7xaj7.js +0 -2
  214. package/dist/chunk-dsrn2vgp.js +0 -2
  215. package/dist/chunk-fkkdt6sj.js +0 -2
  216. package/dist/chunk-fpw03bhv.js +0 -2
  217. package/dist/chunk-fxy0cq7h.js +0 -2
  218. package/dist/chunk-g6smtcc0.js +0 -2
  219. package/dist/chunk-g747k4gg.js +0 -3
  220. package/dist/chunk-gryrg1c0.js +0 -2
  221. package/dist/chunk-gvj862m1.js +0 -2
  222. package/dist/chunk-h5nrnen8.js +0 -2
  223. package/dist/chunk-hagk74x6.js +0 -2
  224. package/dist/chunk-hv0whj8t.js +0 -2
  225. package/dist/chunk-k2brrhf8.js +0 -2
  226. package/dist/chunk-k6ncb5qm.js +0 -2
  227. package/dist/chunk-kn38mjpp.js +0 -2
  228. package/dist/chunk-kvmpc0sg.js +0 -2
  229. package/dist/chunk-nbjgytem.js +0 -2
  230. package/dist/chunk-nf2bzqaw.js +0 -2
  231. package/dist/chunk-nt7wqqax.js +0 -2
  232. package/dist/chunk-pq1qs7bp.js +0 -2
  233. package/dist/chunk-pvw58x2j.js +0 -20
  234. package/dist/chunk-qk9v0emh.js +0 -2
  235. package/dist/chunk-qnj444zc.js +0 -2
  236. package/dist/chunk-qzb0v08n.js +0 -2
  237. package/dist/chunk-s1wdzttg.js +0 -2
  238. package/dist/chunk-sq0qc9sk.js +0 -2
  239. package/dist/chunk-th5afzmv.js +0 -2
  240. package/dist/chunk-tktkj2dc.js +0 -2
  241. package/dist/chunk-vgzfsh1z.js +0 -2
  242. package/dist/chunk-wmh4yxcs.js +0 -2
  243. package/dist/chunk-wr3adhd8.js +0 -2
  244. package/dist/chunk-xmae29mn.js +0 -2
  245. package/dist/chunk-zdwnzq78.js +0 -2
  246. package/dist/chunk-zssf9fdg.js +0 -2
  247. package/dist/chunk-zyf6737j.js +0 -2
@@ -77,7 +77,7 @@ export function signalsAuthoringRuntime(createModelSignalSource) {
77
77
  return v;
78
78
  };
79
79
  var root = window.__STX_CURRENT_ELEMENT__;
80
- var kebabName = name.replace(/([A-Z])/g, function(_, c) { return '-' + c.toLowerCase(); });
80
+ var kebabName = __stxKebab(name);
81
81
  var lowerName = name.toLowerCase();
82
82
  var attributeNames = [name];
83
83
  if (kebabName !== name) attributeNames.push(kebabName);
@@ -96,10 +96,13 @@ export function signalsAuthoringRuntime(createModelSignalSource) {
96
96
  var serializedProps = root.getAttribute('data-stx-props');
97
97
  if (serializedProps) {
98
98
  try {
99
- var parsedProps = JSON.parse(serializedProps);
100
- var camelName = name.replace(/-([a-z0-9])/g, function(_, c) { return c.toUpperCase(); });
99
+ var parsedProps = __stxParsedProps(serializedProps);
100
+ var camelName = __stxCamel(name);
101
101
  if (Object.prototype.hasOwnProperty.call(parsedProps, name)) staticValue = parsedProps[name];
102
102
  else if (Object.prototype.hasOwnProperty.call(parsedProps, camelName)) staticValue = parsedProps[camelName];
103
+ // A structured value is this instance's own, as a fresh parse made it.
104
+ if (staticValue && typeof staticValue === 'object' && staticValue !== defaultValue)
105
+ staticValue = JSON.parse(JSON.stringify(staticValue));
103
106
  }
104
107
  catch (e) {}
105
108
  }
@@ -60,7 +60,7 @@ export const SIGNALS_BINDING_UTILS_RUNTIME = ` // Minimal attribute-only pass f
60
60
  }
61
61
 
62
62
  function preserveDeferredParentComponentProps(el) {
63
- var names = (el.getAttribute('data-stx-parent-bindings') || '').split(/\\s+/).filter(Boolean);
63
+ var names = __stxWords(el.getAttribute('data-stx-parent-bindings') || '');
64
64
  if (!names.length) return;
65
65
  var deferred = readDeferredParentComponentProps(el);
66
66
  names.forEach(function(name) {
@@ -117,9 +117,7 @@ export const SIGNALS_BINDING_UTILS_RUNTIME = ` // Minimal attribute-only pass f
117
117
  if (!el || !el.getAttribute) return;
118
118
  var scopeId = el.getAttribute('data-stx-scope');
119
119
  var scopeVars = scopeId && window.stx._scopes && window.stx._scopes[scopeId];
120
- var camelName = name.replace(/-([a-z0-9])/g, function(_, character) {
121
- return character.toUpperCase();
122
- });
120
+ var camelName = __stxCamel(name);
123
121
  // useReactiveProp signals are often intentionally aliased inside the
124
122
  // child, for example liveClosable = useReactiveProp('closable', true).
125
123
  // The public prop name therefore cannot be inferred from the variable
@@ -1,6 +1,6 @@
1
1
  export const SIGNALS_COMPONENT_PROPS_RUNTIME = ` function bindParentComponentProps(el, callerScope) {
2
2
  if (!el || !el.getAttribute || el.__stx_parent_props_bound) return;
3
- var names = (el.getAttribute('data-stx-parent-bindings') || '').split(/\\s+/).filter(Boolean);
3
+ var names = __stxWords(el.getAttribute('data-stx-parent-bindings') || '');
4
4
  if (!names.length) return;
5
5
  if (hasPendingLoopBoundary(el)) {
6
6
  preserveDeferredParentComponentProps(el);
@@ -74,8 +74,14 @@ export const SIGNALS_COMPONENT_PROPS_RUNTIME = ` function bindParentComponentPr
74
74
  }
75
75
 
76
76
  function resolveComponentCallerScope(el, pageScope) {
77
+ return componentCallerScopeFrom(el && (el.parentElement || el.parentNode), pageScope);
78
+ }
79
+
80
+ // The caller scope for a component placed under \`current\`: the page's
81
+ // scope, then every component scope around it, outermost first. A native
82
+ // loop row binds before it is inserted, so it asks from its future parent.
83
+ function componentCallerScopeFrom(current, pageScope) {
77
84
  var ancestors = [];
78
- var current = el && (el.parentElement || el.parentNode);
79
85
  while (current && current !== document) {
80
86
  if (current.getAttribute && current.hasAttribute('data-stx-scope'))
81
87
  ancestors.push(current.getAttribute('data-stx-scope'));
@@ -51,7 +51,7 @@ export const SIGNALS_EXPRESSION_COMPILER_RUNTIME = ` // Compiled expression fun
51
51
  const names = __stxNamesIn(body);
52
52
  // A layered view answers from its layers directly: through the proxy,
53
53
  // each name cost a trap and a fresh property descriptor.
54
- const own = __stxOwnOf.get(scope);
54
+ const own = __stxOwnOf.get(__stxUnwrapTargetOf.get(scope) || scope);
55
55
  for (let i = 0; i < names.length; i++) {
56
56
  if (own !== undefined ? __stxLayerOf(own, names[i]) !== null : Object.prototype.propertyIsEnumerable.call(scope, names[i])) keys.push(names[i]);
57
57
  }
@@ -144,6 +144,9 @@ else {
144
144
  templateContent = wrapper;
145
145
  }
146
146
 
147
+ // The native row plan: undefined until the first row asks for it, null
148
+ // where this template keeps the generic path.
149
+ let rowPlan;
147
150
  let currentElements = [];
148
151
  // One entry per list item, each holding EVERY node that item rendered.
149
152
  // currentElements stays flat for transition snapshots, but the keyed
@@ -620,6 +623,37 @@ catch (e) {
620
623
  signals.index.set(i);
621
624
  }
622
625
  } else {
626
+ // A native screen builds its rows from a plan of the template, made
627
+ // with the first row (signals-native-row-runtime). A row is bound
628
+ // before it is inserted, so it reaches the host whole.
629
+ if (rowPlan === undefined) {
630
+ // A native :for is a template holding the row; a plan covers a
631
+ // template of one element (the usual row) or a bare element.
632
+ const rowTemplate = isTemplate
633
+ ? (templateContent.childNodes.length === 1 ? templateContent.childNodes[0] : null)
634
+ : templateContent;
635
+ rowPlan = stxHost.isNative && typeof planNativeRow === 'function' && typeof stxHost.cloneElement === 'function'
636
+ && rowTemplate && !slotScopeInfo && !componentSetupTemplates.length ? planNativeRow(rowTemplate) : null;
637
+ }
638
+ if (rowPlan && !tgIsGroup) {
639
+ const plannedItem = state(list[i]);
640
+ plannedItem._isStxLoopItem = true;
641
+ const plannedIndex = state(i);
642
+ const plannedScope = layerTemplateScopes(globalHelpers, passedScope, capturedScope || {});
643
+ Object.defineProperty(plannedScope, itemName, { value: plannedItem, writable: true, enumerable: true, configurable: true });
644
+ if (indexName) Object.defineProperty(plannedScope, indexName, { value: plannedIndex, writable: true, enumerable: true, configurable: true });
645
+ const created = createNativeRow(rowPlan, plannedScope, parent);
646
+ markLoopRow(created.root, itemName, plannedItem);
647
+ const plannedRow = isTemplate
648
+ ? [stxHost.anchor('stx-for-item-start'), created.root, stxHost.anchor('stx-for-item-end')]
649
+ : [created.root];
650
+ plannedRow.__stx_signals = { item: plannedItem, index: plannedIndex };
651
+ for (let pi = 0; pi < plannedRow.length; pi++) stxHost.insert(parent, plannedRow[pi], cursor || placeholder);
652
+ finishNativeRow(created);
653
+ newElements.push(...plannedRow);
654
+ newGroups.push(plannedRow);
655
+ continue;
656
+ }
623
657
  // New item \u2014 create DOM elements with a fresh item signal
624
658
  const elements = createItemElements(list[i], i, key);
625
659
  elements.forEach(el => {
@@ -1,7 +1,24 @@
1
- export const SIGNALS_HANDLER_RUNTIME = ` function expressionUsesSignalApi(expression, name) {
2
- var escapedName = name.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');
3
- return expressionUsesSignalMethod(expression, name)
4
- || expressionUsesSignalValue(expression, name);
1
+ export const SIGNALS_HANDLER_RUNTIME = ` // Each answer depends only on the expression and the name, and each is a
2
+ // regular expression built for the pair: asked for every signal a binding
3
+ // or prop reads, so it is kept (and a name the expression does not hold
4
+ // is answered without one).
5
+ const __stxSignalPatterns = new Map();
6
+ function rememberedSignalPattern(kind, expression, name, test) {
7
+ if (expression.indexOf(name) === -1) return false;
8
+ var key = kind + '\\u0001' + name + '\\u0001' + expression;
9
+ var known = __stxSignalPatterns.get(key);
10
+ if (known === undefined) {
11
+ if (__stxSignalPatterns.size >= 5000) __stxSignalPatterns.clear();
12
+ known = test(expression, name);
13
+ __stxSignalPatterns.set(key, known);
14
+ }
15
+ return known;
16
+ }
17
+
18
+ function expressionUsesSignalApi(expression, name) {
19
+ return rememberedSignalPattern('api', expression, name, function(text, signalName) {
20
+ return expressionUsesSignalMethod(text, signalName) || expressionUsesSignalValue(text, signalName);
21
+ });
5
22
  }
6
23
 
7
24
  function expressionUsesSignalMethod(expression, name) {
@@ -15,31 +32,58 @@ export const SIGNALS_HANDLER_RUNTIME = ` function expressionUsesSignalApi(expre
15
32
  }
16
33
 
17
34
  function expressionCallsSignal(expression, name) {
35
+ return rememberedSignalPattern('call', expression, name, expressionCallsSignalNow);
36
+ }
37
+
38
+ function expressionCallsSignalNow(expression, name) {
18
39
  var escapedName = name.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');
19
40
  return new RegExp('(?:^|[^\\\\w$])' + escapedName + '\\\\s*\\\\(').test(expression);
20
41
  }
21
42
 
22
- function createExpressionAutoUnwrapProxy(scope, expression) {
23
- return createAutoUnwrapProxy(scope, function(prop, signal) {
24
- if (typeof prop !== 'string') return false;
25
- if (expressionCallsSignal(expression, prop) || expressionUsesSignalMethod(expression, prop))
26
- return true;
27
- if (!expressionUsesSignalValue(expression, prop))
28
- return false;
43
+ // What an expression does with a signal it names: calls it, calls one of
44
+ // its methods, reads its .value, or none of these. It depends only on the
45
+ // expression and the name, so it is worked out once: three regular
46
+ // expressions were built for every signal an expression read, every time
47
+ // it ran.
48
+ const __stxSignalUse = new Map();
49
+ function expressionSignalUse(expression, name) {
50
+ let uses = __stxSignalUse.get(expression);
51
+ if (uses === undefined) {
52
+ if (__stxSignalUse.size >= 5000) __stxSignalUse.clear();
53
+ uses = new Map();
54
+ __stxSignalUse.set(expression, uses);
55
+ }
56
+ let use = uses.get(name);
57
+ if (use === undefined) {
58
+ use = expression.indexOf(name) === -1 ? 0
59
+ : expressionCallsSignal(expression, name) || expressionUsesSignalMethod(expression, name) ? 1
60
+ : expressionUsesSignalValue(expression, name) ? 2 : 0;
61
+ uses.set(name, use);
62
+ }
63
+ return use;
64
+ }
29
65
 
30
- // A :for item is itself represented by a signal. If that item's value
31
- // is an object with a real value field, item.value means the field,
32
- // not the signal wrapper API. Primitive signals still support
33
- // count.value, matching the explicit ref syntax.
34
- try {
35
- var currentValue = signal();
36
- return !(currentValue && typeof currentValue === 'object'
37
- && Object.prototype.hasOwnProperty.call(currentValue, 'value'));
38
- }
39
- catch (e) {
40
- return true;
41
- }
42
- });
66
+ function expressionKeepsSignal(expression, prop, signal) {
67
+ if (typeof prop !== 'string') return false;
68
+ const use = expressionSignalUse(expression, prop);
69
+ if (use === 1) return true;
70
+ if (use === 0) return false;
71
+ // A :for item is itself represented by a signal. If that item's value
72
+ // is an object with a real value field, item.value means the field,
73
+ // not the signal wrapper API. Primitive signals still support
74
+ // count.value, matching the explicit ref syntax.
75
+ try {
76
+ var currentValue = signal();
77
+ return !(currentValue && typeof currentValue === 'object'
78
+ && Object.prototype.hasOwnProperty.call(currentValue, 'value'));
79
+ }
80
+ catch (e) {
81
+ return true;
82
+ }
83
+ }
84
+
85
+ function createExpressionAutoUnwrapProxy(scope, expression) {
86
+ return createExpressionUnwrapProxy(scope, expression);
43
87
  }
44
88
 
45
89
  function executeHandler(expr, event, el) {
@@ -1,4 +1,55 @@
1
1
  export const SIGNALS_HELPERS_RUNTIME = ` // ==========================================================================
2
+ // Name and word lists, remembered
3
+ // ==========================================================================
4
+
5
+ // The same few strings (a component's parent-binding names, a prop's name)
6
+ // are taken apart for every row of every list. A regular expression split
7
+ // or replace is among the slowest things an interpreted engine does, so
8
+ // each answer is kept. Callers must not change a returned list.
9
+ var __stxWordLists = new Map();
10
+ function __stxWords(text) {
11
+ var words = __stxWordLists.get(text);
12
+ if (words === undefined) {
13
+ words = String(text).split(/\\s+/).filter(Boolean);
14
+ if (__stxWordLists.size >= 2000) __stxWordLists.clear();
15
+ __stxWordLists.set(text, words);
16
+ }
17
+ return words;
18
+ }
19
+ var __stxCamelNames = new Map();
20
+ function __stxCamel(name) {
21
+ var camel = __stxCamelNames.get(name);
22
+ if (camel === undefined) {
23
+ camel = name.replace(/-([a-z0-9])/g, function(_, c) { return c.toUpperCase(); });
24
+ if (__stxCamelNames.size >= 2000) __stxCamelNames.clear();
25
+ __stxCamelNames.set(name, camel);
26
+ }
27
+ return camel;
28
+ }
29
+ // A component's static props, as its wrapper carries them: the same text
30
+ // for every row of a list, parsed once. Callers only read the result.
31
+ var __stxPropTexts = new Map();
32
+ function __stxParsedProps(text) {
33
+ var parsed = __stxPropTexts.get(text);
34
+ if (parsed === undefined) {
35
+ parsed = JSON.parse(text);
36
+ if (__stxPropTexts.size >= 2000) __stxPropTexts.clear();
37
+ __stxPropTexts.set(text, parsed);
38
+ }
39
+ return parsed;
40
+ }
41
+ var __stxKebabNames = new Map();
42
+ function __stxKebab(name) {
43
+ var kebab = __stxKebabNames.get(name);
44
+ if (kebab === undefined) {
45
+ kebab = name.replace(/([A-Z])/g, function(_, c) { return '-' + c.toLowerCase(); });
46
+ if (__stxKebabNames.size >= 2000) __stxKebabNames.clear();
47
+ __stxKebabNames.set(name, kebab);
48
+ }
49
+ return kebab;
50
+ }
51
+
52
+ // ==========================================================================
2
53
  // Global Helpers (Feature #5)
3
54
  // ==========================================================================
4
55
 
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Native loop rows built from a plan (native screens only).
3
+ *
4
+ * A `:for` row on a native screen used to be made the way a browser makes
5
+ * one: the whole template cloned (every hidden branch included), every scope
6
+ * id rewritten across every attribute, then processElement walking the copy,
7
+ * reading each attribute to work out again what it was, layering a scope per
8
+ * element and per binding, and compiling each expression on every
9
+ * evaluation. A sidebar row did all of that, the same way, forty times, and an
10
+ * interpreted engine paid for each step: about fifteen milliseconds a row.
11
+ *
12
+ * The plan is the part that is the same for every row, worked out once from
13
+ * the template: which attributes are bindings of which kind, which children
14
+ * sit behind an `:if`, which attributes stay. A row then clones only the
15
+ * nodes it shows, binds them through one scope, evaluates each expression
16
+ * with the function compiled for it, and is inserted once it is bound, so the
17
+ * host sends each node whole instead of as a node and a run of patches.
18
+ *
19
+ * Writing a bound value and running a handler go through the same functions
20
+ * processElement uses (applyBoundAttribute, listenTemplateEvent, setStyle,
21
+ * setText). A template with anything a plan does not cover (a nested loop or
22
+ * component, an if/else chain, x- attributes, model, show, refs) keeps the
23
+ * generic path; a branch with such content is processed generically when it
24
+ * is first shown.
25
+ */
26
+ export declare const SIGNALS_NATIVE_ROW_RUNTIME: string;