@stacksjs/stx 0.2.793 → 0.2.795

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 (239) hide show
  1. package/dist/chunk-027hdpgv.js +2 -0
  2. package/dist/chunk-054h7ktz.js +2 -0
  3. package/dist/chunk-09nyt9c5.js +2 -0
  4. package/dist/chunk-0d3ncyqh.js +2 -0
  5. package/dist/{chunk-2gqhfge6.js → chunk-12jjf2me.js} +2 -2
  6. package/dist/{chunk-jdj1358b.js → chunk-1hq3y7ss.js} +2 -2
  7. package/dist/{chunk-b4r7d6me.js → chunk-1q16p7t2.js} +5 -5
  8. package/dist/chunk-1yew6rw9.js +2 -0
  9. package/dist/chunk-211kxm18.js +2 -0
  10. package/dist/chunk-26y92p8r.js +2 -0
  11. package/dist/{chunk-a4cse2tj.js → chunk-2bvaakcv.js} +3 -3
  12. package/dist/{chunk-1z9hbzpk.js → chunk-2e5tvryz.js} +1 -1
  13. package/dist/{chunk-66r0f799.js → chunk-2xprqx2v.js} +5 -5
  14. package/dist/{chunk-dhqp3z4w.js → chunk-3em44jbm.js} +2 -2
  15. package/dist/chunk-3ep9h16p.js +2 -0
  16. package/dist/{chunk-6jzqzap6.js → chunk-3f8w1x6w.js} +10 -10
  17. package/dist/{chunk-14ft0zc7.js → chunk-3vpgr6nk.js} +6 -6
  18. package/dist/{chunk-8nb8b0nf.js → chunk-427mhgje.js} +1 -1
  19. package/dist/chunk-49tn6yst.js +2 -0
  20. package/dist/chunk-4b7dwwn6.js +2 -0
  21. package/dist/chunk-4ncbq4bx.js +2 -0
  22. package/dist/{chunk-985afhhy.js → chunk-4p5g7v9g.js} +2 -2
  23. package/dist/{chunk-7pk3t82j.js → chunk-4s0ye933.js} +2 -2
  24. package/dist/chunk-4srnxp3b.js +2 -0
  25. package/dist/chunk-538d185r.js +3 -0
  26. package/dist/{chunk-605b93pe.js → chunk-53v4cby3.js} +4 -4
  27. package/dist/{chunk-94gyfwpz.js → chunk-624xpap6.js} +12 -12
  28. package/dist/{chunk-kr8qdg0r.js → chunk-6s9bk98p.js} +2 -2
  29. package/dist/{chunk-q14d714d.js → chunk-6wpwpk3c.js} +4 -4
  30. package/dist/chunk-6z4bza9z.js +2 -0
  31. package/dist/chunk-75y9heas.js +2 -0
  32. package/dist/chunk-7ckdvsmj.js +3 -0
  33. package/dist/{chunk-rrb9m2q2.js → chunk-7k6hd10j.js} +5 -5
  34. package/dist/{chunk-1y9ez7nz.js → chunk-7s1kerhs.js} +2 -2
  35. package/dist/{chunk-k4bdf0dw.js → chunk-7xs45trj.js} +2 -2
  36. package/dist/{chunk-kce6pzmj.js → chunk-7y29q1ng.js} +3 -3
  37. package/dist/{chunk-vj59es75.js → chunk-7y73txmp.js} +1 -1
  38. package/dist/{chunk-gg71gm25.js → chunk-88acqv2r.js} +4 -4
  39. package/dist/{chunk-4de6rhaj.js → chunk-8t8e75xm.js} +4 -4
  40. package/dist/chunk-8w1wxr96.js +2 -0
  41. package/dist/{chunk-7gdwvnwc.js → chunk-8zf87cc5.js} +2 -2
  42. package/dist/{chunk-gv3bfkdm.js → chunk-90zswh9v.js} +5 -5
  43. package/dist/chunk-98kjk52z.js +2 -0
  44. package/dist/{chunk-c2qwbej3.js → chunk-9b9tvhmh.js} +5 -5
  45. package/dist/{chunk-bb2zfgwf.js → chunk-9jcqbgq9.js} +5 -5
  46. package/dist/chunk-9sea317f.js +2 -0
  47. package/dist/chunk-9tpv4cg7.js +2 -0
  48. package/dist/{chunk-qzb0v08n.js → chunk-ak10vygz.js} +1 -1
  49. package/dist/{chunk-m997knnz.js → chunk-aksrh8je.js} +3 -3
  50. package/dist/{chunk-6v4b0xc1.js → chunk-ata5wp2m.js} +4 -4
  51. package/dist/{chunk-a1ynjj47.js → chunk-axjfaere.js} +1226 -449
  52. package/dist/chunk-axq3c7cb.js +2 -0
  53. package/dist/{chunk-2hwwmn7c.js → chunk-ayd635jf.js} +5 -5
  54. package/dist/{chunk-qv85c3qy.js → chunk-azqf0ps0.js} +2 -2
  55. package/dist/{chunk-gb65t4n1.js → chunk-b58n1kfe.js} +2 -2
  56. package/dist/{chunk-c0ejyxfj.js → chunk-baj6w8ja.js} +2 -2
  57. package/dist/{chunk-es006emk.js → chunk-bwf8b4e4.js} +3 -3
  58. package/dist/{chunk-h0jnatd4.js → chunk-bzhzp4f4.js} +2 -2
  59. package/dist/chunk-c5trhqpg.js +2 -0
  60. package/dist/{chunk-bmfk3b29.js → chunk-c5vzr1va.js} +2 -2
  61. package/dist/chunk-c692kj5v.js +2 -0
  62. package/dist/{chunk-55j4jxwe.js → chunk-cepctq7e.js} +108 -108
  63. package/dist/{chunk-0r61tkfe.js → chunk-cfbpvm5e.js} +2 -2
  64. package/dist/chunk-cfr7cd88.js +2 -0
  65. package/dist/{chunk-bwcj9z19.js → chunk-d50vw81s.js} +4 -4
  66. package/dist/chunk-dsh5q9bg.js +2 -0
  67. package/dist/{chunk-e3wmnjz8.js → chunk-dstzvtvk.js} +3 -3
  68. package/dist/{chunk-2p4yad7w.js → chunk-dxe94pwy.js} +4 -4
  69. package/dist/{chunk-0ykteae5.js → chunk-ectx5ar9.js} +3 -3
  70. package/dist/chunk-emnphnz7.js +2 -0
  71. package/dist/chunk-ennzzth4.js +177 -0
  72. package/dist/chunk-epcdgn78.js +2 -0
  73. package/dist/chunk-etegf4zj.js +2 -0
  74. package/dist/chunk-ewzdsksb.js +2 -0
  75. package/dist/chunk-ey8bgg6x.js +2 -0
  76. package/dist/chunk-f03sg8b0.js +2 -0
  77. package/dist/{chunk-w5hhqjwr.js → chunk-f4j7nsj1.js} +1 -1
  78. package/dist/{chunk-fpn4dren.js → chunk-fcqxa38q.js} +1 -1
  79. package/dist/{chunk-j4s5k8sp.js → chunk-g4n0bjfb.js} +52 -52
  80. package/dist/chunk-gf04pgaa.js +2 -0
  81. package/dist/chunk-ghn8vhet.js +2 -0
  82. package/dist/chunk-gywp6kd8.js +2 -0
  83. package/dist/{chunk-tnn0br4w.js → chunk-h656zg6k.js} +3 -3
  84. package/dist/{chunk-syheccfj.js → chunk-hnbx1t3t.js} +2 -2
  85. package/dist/{chunk-g89fx9rq.js → chunk-hp10khyy.js} +41 -41
  86. package/dist/{chunk-d18xd9x5.js → chunk-hwcfgs3e.js} +3 -3
  87. package/dist/{chunk-5a92srn2.js → chunk-jmbh26gv.js} +1 -1
  88. package/dist/chunk-k6sjqb7g.js +2 -0
  89. package/dist/{chunk-vrbcdds3.js → chunk-ka8sk5qa.js} +1 -1
  90. package/dist/{chunk-r2nvxbjc.js → chunk-m081078c.js} +2 -2
  91. package/dist/{chunk-spt5kmb2.js → chunk-mcj5qtpp.js} +1 -1
  92. package/dist/chunk-me71d5w5.js +2 -0
  93. package/dist/{chunk-6h7yhyb8.js → chunk-njk5db1q.js} +4 -4
  94. package/dist/chunk-nvytej81.js +2 -0
  95. package/dist/{chunk-xc0vws7m.js → chunk-nyer6v3y.js} +5 -5
  96. package/dist/chunk-p1txw41y.js +2 -0
  97. package/dist/{chunk-agtvdtx4.js → chunk-p3ej3954.js} +2 -2
  98. package/dist/chunk-p8gekf4b.js +2 -0
  99. package/dist/{chunk-6jx0trea.js → chunk-pm8a4kdf.js} +6 -6
  100. package/dist/{chunk-56yhvhjq.js → chunk-pnddmgjf.js} +7 -7
  101. package/dist/chunk-px0qsd38.js +2 -0
  102. package/dist/{chunk-27rzdq3n.js → chunk-qnxctfdf.js} +2 -2
  103. package/dist/chunk-qr23snrp.js +2 -0
  104. package/dist/{chunk-v8rfeev5.js → chunk-r1vkk7qp.js} +2 -2
  105. package/dist/{chunk-qp3xd98j.js → chunk-r3a15pax.js} +2 -2
  106. package/dist/{chunk-pa9zfbh6.js → chunk-rdymnn2t.js} +2 -2
  107. package/dist/{chunk-g3z2g6hm.js → chunk-reb7rddz.js} +1 -1
  108. package/dist/chunk-s151a2dj.js +2 -0
  109. package/dist/{chunk-v1z6n7wz.js → chunk-sphc7xzx.js} +4 -4
  110. package/dist/chunk-sqettc34.js +2 -0
  111. package/dist/chunk-srgbv05n.js +2 -0
  112. package/dist/chunk-t0d4rsfx.js +2 -0
  113. package/dist/chunk-t0k0yk24.js +2 -0
  114. package/dist/chunk-tdcgskyy.js +2 -0
  115. package/dist/chunk-te3hr6d7.js +2 -0
  116. package/dist/chunk-tes8fdv6.js +2 -0
  117. package/dist/{chunk-9tqa8xvf.js → chunk-thpwk6ya.js} +2 -2
  118. package/dist/{chunk-w9nwb8r3.js → chunk-tmfrq4nq.js} +7 -7
  119. package/dist/{chunk-tnkxww7b.js → chunk-tqvw1673.js} +5 -5
  120. package/dist/chunk-v6j5vkce.js +2 -0
  121. package/dist/chunk-vmp876q6.js +2 -0
  122. package/dist/{chunk-4s5q1aea.js → chunk-vpzdqbw7.js} +4 -4
  123. package/dist/{chunk-tktkj2dc.js → chunk-vwp5fchy.js} +1 -1
  124. package/dist/{chunk-hs9fzxn0.js → chunk-w6e30qkz.js} +13 -13
  125. package/dist/{chunk-3gn1t0pa.js → chunk-w76cve9j.js} +9 -9
  126. package/dist/{chunk-7yb8943c.js → chunk-wa7fzgw7.js} +4 -4
  127. package/dist/chunk-wes5fdpe.js +2 -0
  128. package/dist/chunk-wfnfb4fr.js +2 -0
  129. package/dist/{chunk-cdsv4yrv.js → chunk-wfrqwtar.js} +1 -1
  130. package/dist/chunk-wzwfbehm.js +20 -0
  131. package/dist/{chunk-xadd911n.js → chunk-x8ghjw9b.js} +2 -2
  132. package/dist/{chunk-74rf78w8.js → chunk-x8h81amr.js} +2 -2
  133. package/dist/chunk-xbhb8102.js +2 -0
  134. package/dist/{chunk-5j619xgb.js → chunk-xqjat573.js} +2 -2
  135. package/dist/chunk-xv4paxmt.js +2 -0
  136. package/dist/{chunk-628jcm1d.js → chunk-y2jqx5k4.js} +1 -1
  137. package/dist/{chunk-g7anxh36.js → chunk-y64f5t74.js} +5 -5
  138. package/dist/chunk-yeaqebnd.js +2 -0
  139. package/dist/chunk-yj20tq3s.js +2 -0
  140. package/dist/chunk-yjm7c78z.js +2 -0
  141. package/dist/{chunk-h0c6jtrj.js → chunk-yjnaqahd.js} +4 -4
  142. package/dist/{chunk-4cffjp4f.js → chunk-zmr0pvcd.js} +113 -105
  143. package/dist/{chunk-44ep7dkr.js → chunk-zv3zpmv1.js} +1 -1
  144. package/dist/{chunk-bxxgr5c5.js → chunk-zva4a7xq.js} +2 -2
  145. package/dist/cli.js +19 -19
  146. package/dist/client/signals-authoring-runtime.js +2 -2
  147. package/dist/client/signals-binding-utils-runtime.js +14 -8
  148. package/dist/client/signals-component-props-runtime.js +8 -2
  149. package/dist/client/signals-expression-compiler-runtime.js +1 -1
  150. package/dist/client/signals-for-runtime.js +34 -0
  151. package/dist/client/signals-handler-runtime.js +43 -20
  152. package/dist/client/signals-helpers-runtime.js +39 -0
  153. package/dist/client/signals-native-row-runtime.d.ts +26 -0
  154. package/dist/client/signals-native-row-runtime.js +626 -0
  155. package/dist/client/signals-process-element-runtime.js +305 -287
  156. package/dist/client/signals-proxy-runtime.js +56 -31
  157. package/dist/craft-entry.js +2 -2
  158. package/dist/craft.js +2 -2
  159. package/dist/native/accessibility.js +8 -0
  160. package/dist/native/compiler/bundle.js +1 -1
  161. package/dist/native/compiler/inline-style.js +38 -1
  162. package/dist/native/compiler/style-variables.js +9 -1
  163. package/dist/native/event-names.js +1 -0
  164. package/dist/native/prop-names.js +9 -1
  165. package/dist/native/runtime/binding-tree.d.ts +2 -0
  166. package/dist/native/runtime/binding-tree.js +12 -1
  167. package/dist/native/runtime/craft-bridge.js +66 -0
  168. package/dist/native/runtime/craft.d.ts +78 -2
  169. package/dist/native/runtime/native-host.d.ts +2 -0
  170. package/dist/native/runtime/native-host.js +219 -94
  171. package/dist/pwa.js +3 -3
  172. package/dist/signals.d.ts +13 -10
  173. package/dist/signals.js +5 -3
  174. package/dist/ssg.js +15 -15
  175. package/dist/stx-virtual-ts.d.ts +25 -1
  176. package/dist/stx-virtual-ts.js +109 -6
  177. package/dist/typecheck.d.ts +3 -1
  178. package/dist/typecheck.js +28 -11
  179. package/package.json +5 -5
  180. package/dist/chunk-0a9ceqa8.js +0 -2
  181. package/dist/chunk-0cm94ksp.js +0 -2
  182. package/dist/chunk-0ppx28f6.js +0 -2
  183. package/dist/chunk-1aent61q.js +0 -2
  184. package/dist/chunk-1brkqd5f.js +0 -2
  185. package/dist/chunk-1pbyr47e.js +0 -2
  186. package/dist/chunk-1tvb2stj.js +0 -2
  187. package/dist/chunk-22z2cwhv.js +0 -2
  188. package/dist/chunk-276e3d0g.js +0 -3
  189. package/dist/chunk-27vn4674.js +0 -2
  190. package/dist/chunk-2vxh8b8g.js +0 -2
  191. package/dist/chunk-33na85q2.js +0 -2
  192. package/dist/chunk-3t4t655h.js +0 -2
  193. package/dist/chunk-43ynckvh.js +0 -2
  194. package/dist/chunk-44tq4d62.js +0 -2
  195. package/dist/chunk-499v1ade.js +0 -2
  196. package/dist/chunk-4gx5ze56.js +0 -2
  197. package/dist/chunk-4v22nj67.js +0 -2
  198. package/dist/chunk-55wsqxfk.js +0 -2
  199. package/dist/chunk-5pe7wcvh.js +0 -2
  200. package/dist/chunk-5y5k6x3r.js +0 -2
  201. package/dist/chunk-699t603m.js +0 -2
  202. package/dist/chunk-6f6xqzhb.js +0 -2
  203. package/dist/chunk-7fx8p9w5.js +0 -2
  204. package/dist/chunk-8698v9gf.js +0 -2
  205. package/dist/chunk-8pphy0p1.js +0 -2
  206. package/dist/chunk-98308vtv.js +0 -20
  207. package/dist/chunk-ad2fk303.js +0 -2
  208. package/dist/chunk-ajj56vrw.js +0 -2
  209. package/dist/chunk-brqcepmv.js +0 -2
  210. package/dist/chunk-d5e47gr4.js +0 -2
  211. package/dist/chunk-d910ytt2.js +0 -2
  212. package/dist/chunk-d9p7xaj7.js +0 -2
  213. package/dist/chunk-ddbkw53b.js +0 -2
  214. package/dist/chunk-dtnyrjcj.js +0 -2
  215. package/dist/chunk-dyp0kgmr.js +0 -177
  216. package/dist/chunk-fc384a2h.js +0 -2
  217. package/dist/chunk-fkkdt6sj.js +0 -2
  218. package/dist/chunk-fxy0cq7h.js +0 -2
  219. package/dist/chunk-g6smtcc0.js +0 -2
  220. package/dist/chunk-gnydrw29.js +0 -2
  221. package/dist/chunk-jkm34gec.js +0 -2
  222. package/dist/chunk-js5zve3p.js +0 -2
  223. package/dist/chunk-k3mcb700.js +0 -3
  224. package/dist/chunk-kn38mjpp.js +0 -2
  225. package/dist/chunk-kvmpc0sg.js +0 -2
  226. package/dist/chunk-ncxed9r1.js +0 -2
  227. package/dist/chunk-nf2bzqaw.js +0 -2
  228. package/dist/chunk-nptp3x62.js +0 -2
  229. package/dist/chunk-qd9f47ds.js +0 -2
  230. package/dist/chunk-s1wdzttg.js +0 -2
  231. package/dist/chunk-t8vtf522.js +0 -2
  232. package/dist/chunk-t9744tty.js +0 -2
  233. package/dist/chunk-th5afzmv.js +0 -2
  234. package/dist/chunk-vaqqch06.js +0 -2
  235. package/dist/chunk-vgzfsh1z.js +0 -2
  236. package/dist/chunk-wr3adhd8.js +0 -2
  237. package/dist/chunk-zdwnzq78.js +0 -2
  238. package/dist/chunk-zsjw2jgy.js +0 -2
  239. package/dist/chunk-zyf6737j.js +0 -2
@@ -0,0 +1,626 @@
1
+ export const SIGNALS_NATIVE_ROW_RUNTIME = ` // ==========================================================================
2
+ // Native row plans
3
+ // ==========================================================================
4
+
5
+ var __STX_ROW_GENERIC_ATTRS = { 'stx-hydrate': 1, 'data-stx-memo': 1, 'data-stx-suspense': 1, 'x-data': 1, 'data-stx-xdata': 1, ref: 1, 'data-stx-ref': 1, 'data-stx-lazy': 1, 'data-stx-slot-scope': 1 };
6
+ var __STX_ROW_SKIPPED_EVENTS = { if: 1, for: 1, show: 1, model: 1, class: 1, style: 1, text: 1, html: 1, ref: 1 };
7
+ var __STX_ROW_CONTROL_ATTRS = { value: 1, checked: 1, selected: 1, indeterminate: 1 };
8
+ var __STX_IDENT = /^[A-Za-z_$][\\w$]*$/;
9
+ var __STX_QUOTED = /'(?:[^'\\\\]|\\\\.)*'|"(?:[^"\\\\]|\\\\.)*"/g;
10
+ var __STX_KEYWORDS = { return: 1, true: 1, false: 1, null: 1, typeof: 1, instanceof: 1, new: 1, this: 1, void: 1, in: 1, of: 1, delete: 1, function: 1, var: 1, let: 1, const: 1, if: 1, else: 1 };
11
+
12
+ function __stxAlwaysVisible() { return true; }
13
+
14
+ // A plan for rows cloned from \`template\`, or null where the generic path
15
+ // has to make them.
16
+ function planNativeRow(template) {
17
+ if (!template || template.nodeType !== 1 || !template.attributes) return null;
18
+ // Two scopes a row reads from: its own (bindings inside the row) and, for
19
+ // a component, its caller's (the props the caller passes). Each keeps the
20
+ // names its expressions mention and the functions compiled per shape.
21
+ var plan = { sites: [], eval: rowGroup(), prop: rowGroup(), props: null, component: false, scopeId: null, setup: null, root: null };
22
+ if (template.hasAttribute('data-stx-scope')) {
23
+ plan.component = true;
24
+ plan.scopeId = template.getAttribute('data-stx-template-scope') || template.getAttribute('data-stx-scope');
25
+ var setups = window.__stx_componentSetups;
26
+ plan.setup = setups && setups[plan.scopeId];
27
+ if (typeof plan.setup !== 'function') return null;
28
+ }
29
+ try {
30
+ plan.root = planRowNode(plan, template, true, false);
31
+ }
32
+ catch (e) {
33
+ return null;
34
+ }
35
+ return plan.root ? plan : null;
36
+ }
37
+
38
+ function rowGroup() {
39
+ return { names: [], nameIndex: {}, shapes: new Map() };
40
+ }
41
+
42
+ function planRowSite(plan, raw, kind) {
43
+ var expr = raw.indexOf('&') === -1 ? raw : raw.replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&#x27;/g, "'");
44
+ // The same body text each path compiles, so the functions are the ones
45
+ // the generic path would have made.
46
+ var body = kind === 'attr' || kind === 'text' || kind === 'prop' ? 'return (' + expr + ')'
47
+ : kind === 'if' ? 'return ' + expr + ''
48
+ : 'return ' + raw;
49
+ var source = kind === 'attr' || kind === 'text' || kind === 'if' ? expr : raw;
50
+ var group = kind === 'prop' ? plan.prop : plan.eval;
51
+ if (parsePipeExpression(source, {}) !== null) throw new Error('pipe');
52
+ if (plan.component && raw.indexOf(plan.scopeId) !== -1) throw new Error('scope id in an expression');
53
+ // The names the expression can read: not the words of its quoted strings
54
+ // (a class list in a ternary) nor keywords, which every row would
55
+ // otherwise look up in its scope for nothing.
56
+ var names = __stxNamesIn(source.replace(__STX_QUOTED, ' ')).filter(function(k) {
57
+ return !__STX_KEYWORDS[k] && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k);
58
+ });
59
+ for (var i = 0; i < names.length; i++) {
60
+ if (group.nameIndex[names[i]] === undefined) {
61
+ group.nameIndex[names[i]] = group.names.length;
62
+ group.names.push(names[i]);
63
+ }
64
+ }
65
+ var site = { index: plan.sites.length, kind: kind, group: group, expr: source, body: body, names: names, placeholder: /^__[A-Z_]+__$/.test(source.trim()), ident: __STX_IDENT.test(source.trim()), handler: null };
66
+ plan.sites.push(site);
67
+ return site;
68
+ }
69
+
70
+ // One element of the template: its bindings, the attributes a row's copy
71
+ // keeps, and its children. Throws where the template needs the generic path;
72
+ // returns { generic: true } for an :if branch whose content does.
73
+ function planRowNode(plan, tmpl, isRoot, inBranch) {
74
+ var node = { tmpl: tmpl, attrs: [], ops: [], children: [], ifSite: null, generic: false, inert: false, remap: [] };
75
+ var attrs = getElementAttributes(tmpl);
76
+ var parentEvents = __stxWords(tmpl.getAttribute('data-stx-parent-events') || '');
77
+ var parentBindings = isRoot && plan.component ? __stxWords(tmpl.getAttribute('data-stx-parent-bindings') || '') : [];
78
+ // A component's props, as bindParentComponentProps reads them: each
79
+ // parent binding from its :name attribute, else from the bindings an
80
+ // enclosing loop deferred (data-stx-deferred-parent-bindings). What the
81
+ // row leaves deferred is the same for every row.
82
+ var deferredProps = null;
83
+ if (isRoot && plan.component) {
84
+ plan.props = [];
85
+ deferredProps = readDeferredParentComponentProps(tmpl);
86
+ for (var b = 0; b < parentBindings.length; b++) {
87
+ var propName = parentBindings[b];
88
+ var propExpression = tmpl.hasAttribute(':' + propName) ? tmpl.getAttribute(':' + propName) : deferredProps[propName];
89
+ if (typeof propExpression !== 'string') continue;
90
+ plan.props.push({ name: propName, site: planRowSite(plan, propExpression, 'prop') });
91
+ delete deferredProps[propName];
92
+ }
93
+ }
94
+ var generic = false;
95
+ for (var i = 0; i < attrs.length; i++) {
96
+ var name = attrs[i].name;
97
+ var value = attrs[i].value;
98
+ if (!name) continue;
99
+ if (name === ':if' || name === '@if') {
100
+ if (isRoot) throw new Error('root if');
101
+ if (getElseAttrInfo(tmpl.nextElementSibling)) throw new Error('if chain');
102
+ node.ifSite = planRowSite(plan, value, 'if');
103
+ continue;
104
+ }
105
+ if (name === 'x-if' || getElseAttrInfo(tmpl)) throw new Error('chain');
106
+ if ((name === ':for' || name === '@for' || name === 'x-for') && isForDirectiveExpression(value)) throw new Error('nested for');
107
+ if (name === 'x-cloak') continue;
108
+ if (name === 'data-stx-scope' || name === 'data-stx-template-scope') {
109
+ if (!isRoot) throw new Error('nested component');
110
+ continue;
111
+ }
112
+ if (__STX_ROW_GENERIC_ATTRS[name] || name.startsWith('::') || name.startsWith('x-') || name.startsWith('@bind:')) { generic = true; continue; }
113
+ if (name.charCodeAt(0) === 58) {
114
+ var bound = name.slice(1);
115
+ var base = bound.split('.')[0];
116
+ if (base === 'class' || base === 'style' || base === 'text') {
117
+ if (name !== ':' + base) { generic = true; continue; }
118
+ node.ops.push({ kind: base, site: planRowSite(plan, value, base) });
119
+ if (base === 'text') node.inert = true;
120
+ continue;
121
+ }
122
+ if (DIRECTIVE_NAMES[base] || EVENT_RE.test(bound)) { generic = true; continue; }
123
+ if (isRoot && plan.component && parentBindings.indexOf(bound) !== -1) continue;
124
+ if ((__STX_ROW_CONTROL_ATTRS[bound] && bound in tmpl) || (bound === 'src' && tmpl.tagName === 'IFRAME')) { generic = true; continue; }
125
+ node.ops.push({ kind: 'attr', attrName: bound, site: planRowSite(plan, value, 'attr') });
126
+ continue;
127
+ }
128
+ if (name.charCodeAt(0) === 64) {
129
+ if (name === '@class' || name === '@style' || name === '@text') {
130
+ var directive = name.slice(1);
131
+ node.ops.push({ kind: directive, site: planRowSite(plan, value, directive) });
132
+ if (directive === 'text') node.inert = true;
133
+ continue;
134
+ }
135
+ var parts = name.slice(1).split('.');
136
+ var eventName = parentEvents.find(function(event) { return event.toLowerCase() === parts[0].toLowerCase(); }) || parts[0];
137
+ if (__STX_ROW_SKIPPED_EVENTS[eventName]) { generic = true; continue; }
138
+ if (plan.component && value.indexOf(plan.scopeId) !== -1) throw new Error('scope id in a handler');
139
+ node.ops.push({
140
+ kind: 'event',
141
+ eventName: eventName,
142
+ modifiers: parts.slice(1),
143
+ value: value,
144
+ key: '__stx_evt_' + eventName + '_' + value.substring(0, 20),
145
+ forwarded: isRoot && plan.component && parentEvents.indexOf(eventName) !== -1,
146
+ });
147
+ continue;
148
+ }
149
+ if (deferredProps && name === 'data-stx-deferred-parent-bindings' && plan.props.length) {
150
+ if (Object.keys(deferredProps).length) node.attrs.push({ name: name, value: JSON.stringify(deferredProps) });
151
+ continue;
152
+ }
153
+ if (plan.component && typeof value === 'string' && value.indexOf(plan.scopeId) !== -1) node.remap.push(node.attrs.length);
154
+ node.attrs.push(attrs[i]);
155
+ }
156
+ if (generic) {
157
+ if (!inBranch || !node.ifSite) throw new Error('generic content');
158
+ return { tmpl: tmpl, generic: true, ifSite: node.ifSite };
159
+ }
160
+ var kids = tmpl.childNodes || [];
161
+ for (var k = 0; k < kids.length; k++) {
162
+ var child = kids[k];
163
+ if (child.nodeType !== 1 || child.tagName === 'SCRIPT' || child.tagName === 'TEMPLATE' || child.__stx_scope) throw new Error('child kind');
164
+ var hasIf = child.hasAttribute(':if') || child.hasAttribute('@if');
165
+ node.children.push(planRowNode(plan, child, false, hasIf));
166
+ }
167
+ return node;
168
+ }
169
+
170
+ // Which of the plan's names this row's scope holds, and the functions
171
+ // compiled for that answer. Rows of one loop nearly always share one.
172
+ function rowShape(group, own, layers) {
173
+ var names = group.names;
174
+ var signature = '';
175
+ for (var i = 0; i < names.length; i++) {
176
+ var layer = __stxLayerOf(own, names[i]);
177
+ layers[i] = layer;
178
+ signature += layer === null ? '0' : '1';
179
+ }
180
+ var shape = group.shapes.get(signature);
181
+ if (!shape) {
182
+ shape = { signature: signature, compiled: [] };
183
+ group.shapes.set(signature, shape);
184
+ }
185
+ return shape;
186
+ }
187
+
188
+ // How the expression uses a name its scope holds, worked out when a row
189
+ // first evaluates it: a prop's scope keeps a signal its expression calls or
190
+ // uses as a signal (createAutoUnwrapProxy's rule), everything else follows
191
+ // the expression (StxAutoUnwrapHandler's).
192
+ function rowSignalUse(site, name) {
193
+ return site.kind === 'prop'
194
+ ? (expressionCallsSignal(site.expr, name) || expressionUsesSignalApi(site.expr, name) ? 1 : 0)
195
+ : expressionSignalUse(site.expr, name);
196
+ }
197
+
198
+ function compileRowSite(site, shape) {
199
+ var nameIndex = site.group.nameIndex;
200
+ var keys = [];
201
+ var uses = [];
202
+ for (var i = 0; i < site.names.length; i++) {
203
+ if (shape.signature.charCodeAt(nameIndex[site.names[i]]) === 49) {
204
+ keys.push(site.names[i]);
205
+ uses.push(rowSignalUse(site, site.names[i]));
206
+ }
207
+ }
208
+ var slots = keys.map(function(key) { return nameIndex[key]; });
209
+ var compiled = { keys: keys, slots: slots, uses: uses, fn: null, error: null };
210
+ try { compiled.fn = __stxCompile(keys, site.body); }
211
+ catch (e) { compiled.error = e; }
212
+ shape.compiled[site.index] = compiled;
213
+ return compiled;
214
+ }
215
+
216
+ function readRowScope(own, key) {
217
+ var layer = __stxLayerOf(own, key);
218
+ return layer === null ? own[key] : layer[key];
219
+ }
220
+
221
+ // What the expression's auto-unwrap proxy would hand the function for one
222
+ // name (StxAutoUnwrapHandler.get with the expression).
223
+ function unwrapRowValue(site, value, use) {
224
+ if (value && typeof value === 'function' && (value._isSignal || value._isDerived)) {
225
+ if (value._isStxLoopItem) return value();
226
+ if (use === 1) return value;
227
+ if (use === 0) return value();
228
+ var keep;
229
+ try {
230
+ var current = value();
231
+ keep = !(current && typeof current === 'object' && Object.prototype.hasOwnProperty.call(current, 'value'));
232
+ }
233
+ catch (e) { keep = true; }
234
+ return keep ? value : value();
235
+ }
236
+ if (value && typeof value === 'object' && value._isStxStore) {
237
+ if (!site.handler) {
238
+ var expr = site.expr;
239
+ site.handler = site.kind === 'prop'
240
+ ? new StxAutoUnwrapHandler(function(prop) { return typeof prop === 'string' && (expressionCallsSignal(expr, prop) || expressionUsesSignalApi(expr, prop)); }, null)
241
+ : new StxAutoUnwrapHandler(null, expr);
242
+ }
243
+ return new Proxy(value, site.handler);
244
+ }
245
+ return value;
246
+ }
247
+
248
+ // An expression evaluated as its generic path does: through the unwrapping
249
+ // scope first, then the raw scope, then reported and replaced by \`fallback\`.
250
+ // \`at\`: the scope the site reads, as the row found it (row.local or row.caller).
251
+ function evaluateRowSite(at, site, el, fallback, subscribe) {
252
+ if (site.placeholder) return site.expr;
253
+ var compiled = at.shape.compiled[site.index] || compileRowSite(site, at.shape);
254
+ var keys = compiled.keys;
255
+ var layers = at.layers;
256
+ var raw = new Array(keys.length);
257
+ var args = new Array(keys.length);
258
+ for (var i = 0; i < keys.length; i++) {
259
+ // The layer holding each name was found once for the row (rowShape):
260
+ // the layers are the row's own objects and the scopes it was given.
261
+ var value = layers[compiled.slots[i]][keys[i]];
262
+ raw[i] = value;
263
+ if (subscribe && value && typeof value === 'function' && (value._isSignal || value._isDerived)) value();
264
+ args[i] = unwrapRowValue(site, value, compiled.uses[i]);
265
+ }
266
+ if (compiled.fn) {
267
+ try {
268
+ var result = compiled.fn.apply(null, args);
269
+ if (site.kind === 'attr' || site.kind === 'text') {
270
+ if (result && typeof result === 'function' && (result._isSignal || result._isDerived)) result = result();
271
+ noteExprSuccess(site.expr);
272
+ }
273
+ return result;
274
+ }
275
+ catch (e1) {
276
+ try {
277
+ var retried = compiled.fn.apply(null, raw);
278
+ if (site.kind === 'attr' || site.kind === 'text') {
279
+ if (retried && typeof retried === 'function' && (retried._isSignal || retried._isDerived)) retried = retried();
280
+ noteExprSuccess(site.expr);
281
+ }
282
+ return retried;
283
+ }
284
+ catch (e2) {
285
+ return failRowSite(at, site, el, e2, fallback);
286
+ }
287
+ }
288
+ }
289
+ return failRowSite(at, site, el, compiled.error, fallback);
290
+ }
291
+
292
+ function failRowSite(at, site, el, error, fallback) {
293
+ reportUnknownBinding(error, site.expr, at.scope, el);
294
+ if (site.kind === 'prop') {
295
+ if (!(error instanceof ReferenceError) && !(error instanceof TypeError)) console.warn('[STX] Parent component prop error:', site.expr, error);
296
+ return fallback;
297
+ }
298
+ var label = site.kind === 'attr' || site.kind === 'text' ? '[STX] Attribute expression error:'
299
+ : site.kind === 'style' ? '[STX] Style expression error:'
300
+ : site.kind === 'class' ? '[STX] Class expression error:' : '[STX] Expression error:';
301
+ if (!(error instanceof ReferenceError) && !(error instanceof TypeError)) console.warn(label, site.expr, error);
302
+ else if (site.kind === 'attr' || site.kind === 'text') noteExprFailure(site.expr, error);
303
+ return fallback;
304
+ }
305
+
306
+ // The visibility gates an element's attribute bindings wait on: every :if
307
+ // around it, the row's own and those around the loop.
308
+ function rowVisibility(el, row) {
309
+ var gates = [];
310
+ for (var node = el; node; node = node.parentNode) {
311
+ if (node.__stx_if_visible) gates.push(node.__stx_if_visible);
312
+ if (node === row.root && !node.parentNode) {
313
+ for (var i = 0; i < row.outer.length; i++) gates.push(row.outer[i]);
314
+ break;
315
+ }
316
+ }
317
+ if (!gates.length) return __stxAlwaysVisible;
318
+ if (gates.length === 1) { var gate = gates[0]; return function() { return gate(); }; }
319
+ return function() {
320
+ for (var g = 0; g < gates.length; g++) if (!gates[g]()) return false;
321
+ return true;
322
+ };
323
+ }
324
+
325
+ // The nodes of one planned element, children placed and :if children
326
+ // given their anchors, nothing bound yet.
327
+ function buildRowNode(pnode, row) {
328
+ var el = stxHost.cloneElement(pnode.tmpl, pnode.attrs);
329
+ for (var r = 0; r < pnode.remap.length; r++) {
330
+ var attribute = pnode.attrs[pnode.remap[r]];
331
+ el.setAttribute(attribute.name, attribute.value.split(row.plan.scopeId).join(row.scopeId));
332
+ }
333
+ var kids = new Array(pnode.children.length);
334
+ for (var i = 0; i < pnode.children.length; i++) {
335
+ var child = pnode.children[i];
336
+ var made;
337
+ if (child.ifSite) {
338
+ made = { pnode: child, el: null, anchor: stxHost.anchor('stx-if') };
339
+ stxHost.append(el, made.anchor);
340
+ }
341
+ else {
342
+ made = buildRowNode(child, row);
343
+ stxHost.append(el, made.el);
344
+ }
345
+ kids[i] = made;
346
+ }
347
+ return { pnode: pnode, el: el, kids: kids, anchor: null };
348
+ }
349
+
350
+ function bindRowNode(made, row) {
351
+ var pnode = made.pnode;
352
+ var el = made.el;
353
+ var ops = pnode.ops;
354
+ var visible = null;
355
+ var urlWarning = null;
356
+ for (var i = 0; i < ops.length; i++) {
357
+ var op = ops[i];
358
+ if (op.kind === 'attr') {
359
+ if (!visible) visible = rowVisibility(el, row);
360
+ if (!urlWarning) urlWarning = { warned: false };
361
+ bindRowAttribute(el, op, row, visible, urlWarning);
362
+ }
363
+ else if (op.kind === 'class') {
364
+ if (!visible) visible = rowVisibility(el, row);
365
+ bindRowClass(el, op.site, row, visible);
366
+ }
367
+ else if (op.kind === 'style') {
368
+ if (!visible) visible = rowVisibility(el, row);
369
+ bindRowStyle(el, op.site, row, visible);
370
+ }
371
+ else if (op.kind === 'text') {
372
+ el.__stx_inert_content = true;
373
+ bindRowText(el, op.site, row);
374
+ }
375
+ else if (op.kind === 'event') {
376
+ if (el[op.key]) continue;
377
+ el[op.key] = true;
378
+ var forwarded = op.forwarded && !!el.__stx_parent_scope;
379
+ listenTemplateEvent(el, op.eventName, op.modifiers, op.value,
380
+ forwarded ? layerTemplateScopes(globalHelpers, el.__stx_parent_scope) : row.evalScope, forwarded);
381
+ }
382
+ }
383
+ if (pnode.inert) return;
384
+ for (var k = 0; k < made.kids.length; k++) {
385
+ var kid = made.kids[k];
386
+ if (kid.anchor) bindRowIf(kid, made.el, row);
387
+ else bindRowNode(kid, row);
388
+ }
389
+ }
390
+
391
+ function bindRowAttribute(el, op, row, visible, urlWarning) {
392
+ effect(function() {
393
+ if (!visible()) return;
394
+ applyBoundAttribute(el, op.attrName, evaluateRowSite(row.local, op.site, el, ''), visible, urlWarning);
395
+ });
396
+ }
397
+
398
+ function bindRowText(el, site, row) {
399
+ effect(function() { stxHost.setText(el, evaluateRowSite(row.local, site, el, '')); });
400
+ }
401
+
402
+ function bindRowStyle(el, site, row, visible) {
403
+ effect(function() {
404
+ if (!visible()) return;
405
+ stxHost.setStyle(el, evaluateRowSite(row.local, site, el, {}), true);
406
+ });
407
+ }
408
+
409
+ // bindClass, reading its names through the row's scope.
410
+ function bindRowClass(el, site, row, visible) {
411
+ var originalClasses = el.className;
412
+ effect(function() {
413
+ if (!visible()) return;
414
+ var value = evaluateRowSite(row.local, site, el, '', true);
415
+ if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
416
+ Object.keys(value).forEach(function(cls) {
417
+ var tokens = cls.split(/\\s+/).filter(Boolean);
418
+ if (value[cls]) tokens.forEach(function(t) { el.classList.add(t); });
419
+ else tokens.forEach(function(t) { el.classList.remove(t); });
420
+ });
421
+ }
422
+ else if (Array.isArray(value)) {
423
+ el.className = [originalClasses, value.filter(Boolean).join(' ')].filter(Boolean).join(' ');
424
+ }
425
+ else {
426
+ el.className = [originalClasses, value || ''].filter(Boolean).join(' ');
427
+ }
428
+ });
429
+ }
430
+
431
+ // bindIf for an element of a planned row. Its element is made the first
432
+ // time it shows, rather than cloned with the row and removed again.
433
+ function bindRowIf(made, parentEl, row) {
434
+ var pnode = made.pnode;
435
+ var site = pnode.ifSite;
436
+ var placeholder = made.anchor;
437
+ var parent = parentEl;
438
+ var el = null;
439
+ var isInserted = false;
440
+ var childrenProcessed = false;
441
+ var firstRun = true;
442
+ var direct = site.ident ? readRowScope(row.local.own, site.expr.trim()) : null;
443
+ var directSignal = direct && (direct._isSignal || direct._isDerived) ? direct : null;
444
+ effect(function() {
445
+ parent = followPlaceholder(placeholder, parent, el ? [el] : []);
446
+ var value = directSignal ? directSignal() : evaluateRowSite(row.local, site, null, '');
447
+ var initial = firstRun;
448
+ firstRun = false;
449
+ if (!el) {
450
+ if (!value) return;
451
+ el = makeRowBranch(pnode, row);
452
+ made.el = el;
453
+ if (initial) {
454
+ // Shown from the start: placed as the generic path's clone was.
455
+ stxHost.insert(parent, el, placeholder.nextSibling);
456
+ isInserted = true;
457
+ }
458
+ }
459
+ stxHost.setVisible(el, !!value);
460
+ if (value && !isInserted) {
461
+ stxHost.insert(parent, el, placeholder.nextSibling);
462
+ if (parent && parent.__stx_detached_if) parent.__stx_detached_if.delete(el);
463
+ el.__stx_if_visible.set(true);
464
+ el.__stx_shown_at = performance.now();
465
+ isInserted = true;
466
+ peek(resumeDetachedBranches);
467
+ if (childrenProcessed) {
468
+ queueMicrotask(function() {
469
+ if (isInserted) peek(function() { resumeSubtreeScopes([el]); });
470
+ });
471
+ }
472
+ }
473
+ else if (!value && isInserted) {
474
+ el.__stx_if_visible.set(false);
475
+ suspendSubtreeScopes([el]);
476
+ stxHost.remove(el);
477
+ if (parent) {
478
+ if (!parent.__stx_detached_if) parent.__stx_detached_if = new Set();
479
+ parent.__stx_detached_if.add(el);
480
+ }
481
+ isInserted = false;
482
+ }
483
+ if (value && isInserted && !childrenProcessed) {
484
+ childrenProcessed = true;
485
+ peek(function() { hydrateRowBranch(made, row); });
486
+ }
487
+ });
488
+ }
489
+
490
+ function makeRowBranch(pnode, row) {
491
+ var el;
492
+ if (pnode.generic) {
493
+ el = stxHost.clone(pnode.tmpl);
494
+ el.removeAttribute(':if');
495
+ el.removeAttribute('@if');
496
+ if (row.plan.component) remapRowSubtree(el, row);
497
+ }
498
+ else {
499
+ var made = buildRowNode(pnode, row);
500
+ el = made.el;
501
+ el.__stx_row_made = made;
502
+ }
503
+ el.__stx_if_bound = true;
504
+ el.__stx_if_visible = state(true);
505
+ return el;
506
+ }
507
+
508
+ function remapRowSubtree(el, row) {
509
+ var oldId = row.plan.scopeId;
510
+ [el].concat(stxHost.descendants(el)).forEach(function(node) {
511
+ if (!node.attributes) return;
512
+ getElementAttributes(node).forEach(function(attribute) {
513
+ if (typeof attribute.value === 'string' && attribute.value.indexOf(oldId) !== -1)
514
+ node.setAttribute(attribute.name, attribute.value.split(oldId).join(row.scopeId));
515
+ });
516
+ });
517
+ }
518
+
519
+ function hydrateRowBranch(made, row) {
520
+ var el = made.el;
521
+ var built = el.__stx_row_made;
522
+ if (built) {
523
+ el.__stx_row_made = null;
524
+ el.__stx_if_disposers = trackEffects(function() { bindRowNode(built, row); });
525
+ resumeDetachedBranches();
526
+ return;
527
+ }
528
+ // Generic content, processed as bindIf's shown branch is: once its row
529
+ // is on the screen, since the generic walk reads the tree around it.
530
+ var run = function() {
531
+ if (!el.isConnected) {
532
+ if (!row.inserted) { row.after.push(run); return; }
533
+ var resume = function() { peek(run); };
534
+ resume.el = el;
535
+ detachedBranches.add(resume);
536
+ return;
537
+ }
538
+ var wasTracked = !!el.__stx_disposers;
539
+ if (wasTracked || !el.__stx_disposers)
540
+ el.__stx_if_disposers = trackEffects(function() { processElement(el, row.evalScope); });
541
+ resumeDetachedBranches();
542
+ };
543
+ run();
544
+ }
545
+
546
+ // The scope a row's expressions read, with the layer each name lives in
547
+ // found once (rowShape): the layers are the row's own objects and the
548
+ // scopes it was given, so a read goes straight to the layer.
549
+ function rowScopeAt(group, scope) {
550
+ var own = __stxOwnOf.get(scope);
551
+ var layers = new Array(group.names.length);
552
+ return { scope: scope, own: own, layers: layers, shape: rowShape(group, own, layers) };
553
+ }
554
+
555
+ // bindParentComponentProps for a planned row: the caller's props, each
556
+ // evaluated with the function compiled for it, written as the generic
557
+ // path writes them.
558
+ function bindRowProps(root, row, callerScope) {
559
+ root.__stx_parent_props_bound = true;
560
+ var props = row.plan.props;
561
+ var caller = row.caller = rowScopeAt(row.plan.prop, layerTemplateScopes(globalHelpers, callerScope));
562
+ for (var i = 0; i < props.length; i++) bindRowProp(root, props[i], caller);
563
+ }
564
+
565
+ function bindRowProp(root, prop, caller) {
566
+ var name = prop.name;
567
+ effect(function() {
568
+ var value = evaluateRowSite(caller, prop.site, root, undefined);
569
+ if (value && typeof value === 'function' && (value._isSignal || value._isDerived)) value = value();
570
+ if (name.startsWith('aria-') && typeof value === 'boolean') stxHost.setAttribute(root, name, String(value));
571
+ else if (value === null || value === undefined) stxHost.removeAttribute(root, name);
572
+ else stxHost.setAttribute(root, name, value);
573
+ syncComponentPropSignal(root, name, value);
574
+ });
575
+ }
576
+
577
+ // A row of \`plan\`, bound before it is inserted. \`parent\` is where it will
578
+ // go; the caller inserts it and then calls finishNativeRow.
579
+ function createNativeRow(plan, itemScope, parent) {
580
+ var row = { plan: plan, root: null, scope: null, evalScope: null, local: null, caller: null, outer: [], after: [], inserted: false, scopeVars: null, scopeId: null };
581
+ for (var node = parent; node; node = node.parentNode) if (node.__stx_if_visible) row.outer.push(node.__stx_if_visible);
582
+ if (plan.component) row.scopeId = plan.scopeId + '_for_' + (++__forComponentScopeCounter);
583
+ var made = buildRowNode(plan.root, row);
584
+ var root = made.el;
585
+ row.root = root;
586
+ if (plan.component) {
587
+ if (!root.hasAttribute('data-stx-template-scope')) root.setAttribute('data-stx-template-scope', plan.scopeId);
588
+ root.setAttribute('data-stx-scope', row.scopeId);
589
+ if (!(window.stx._scopes && window.stx._scopes[row.scopeId])) runClonedComponentSetup(plan.setup, root);
590
+ var callerScope = componentCallerScopeFrom(parent, itemScope);
591
+ root.__stx_parent_scope = callerScope;
592
+ if (plan.props.length) bindRowProps(root, row, callerScope);
593
+ var scopeVars = window.stx._scopes && window.stx._scopes[row.scopeId];
594
+ if (!scopeVars) return { root: root, row: row };
595
+ scopeVars.__el = root;
596
+ row.scopeVars = scopeVars;
597
+ row.scope = layerTemplateScopes(callerScope, scopeVars);
598
+ // processElement layers the helpers and the component's variables over
599
+ // this scope for each element; it already starts with the helpers (the
600
+ // item scope's first layer) and ends with the variables, so the same
601
+ // names resolve to the same layers through it as it is.
602
+ row.evalScope = row.scope;
603
+ }
604
+ else {
605
+ row.scope = itemScope;
606
+ row.evalScope = layerTemplateScopes(globalHelpers, itemScope, findElementScope(parent) || {});
607
+ }
608
+ row.local = rowScopeAt(plan.eval, row.evalScope);
609
+ var dispose = trackEffects(function() { bindRowNode(made, row); });
610
+ if (plan.component) root.__stx_disposers = dispose;
611
+ else root.__stx_effect_disposers = dispose;
612
+ return { root: root, row: row };
613
+ }
614
+
615
+ function finishNativeRow(created) {
616
+ var row = created.row;
617
+ row.inserted = true;
618
+ var scopeVars = row.scopeVars;
619
+ if (scopeVars && scopeVars.__mountCallbacks && !scopeVars.__mounted) {
620
+ scopeVars.__mounted = true;
621
+ runMountCallbacks(scopeVars.__mountCallbacks, scopeDestroySink(scopeVars));
622
+ }
623
+ var after = row.after.splice(0, row.after.length);
624
+ for (var i = 0; i < after.length; i++) after[i]();
625
+ }
626
+ `;