ripple 0.3.71 → 0.3.74

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 (165) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/package.json +3 -3
  3. package/src/jsx-runtime.d.ts +2 -8
  4. package/src/runtime/index-client.js +3 -13
  5. package/src/runtime/internal/client/blocks.js +3 -25
  6. package/src/runtime/internal/client/for.js +80 -5
  7. package/src/runtime/internal/client/index.js +0 -2
  8. package/src/runtime/internal/client/types.d.ts +0 -10
  9. package/tests/client/__snapshots__/computed-properties.test.tsrx.snap +8 -0
  10. package/tests/client/__snapshots__/for.test.tsrx.snap +22 -0
  11. package/tests/client/__snapshots__/html.test.tsrx.snap +4 -0
  12. package/tests/client/array/array.copy-within.test.tsrx +19 -19
  13. package/tests/client/array/array.derived.test.tsrx +97 -109
  14. package/tests/client/array/array.iteration.test.tsrx +28 -28
  15. package/tests/client/array/array.mutations.test.tsrx +68 -68
  16. package/tests/client/array/array.static.test.tsrx +82 -92
  17. package/tests/client/array/array.to-methods.test.tsrx +15 -15
  18. package/tests/client/async-suspend.test.tsrx +180 -179
  19. package/tests/client/basic/__snapshots__/basic.attributes.test.tsrx.snap +2 -0
  20. package/tests/client/basic/__snapshots__/basic.rendering.test.tsrx.snap +4 -0
  21. package/tests/client/basic/basic.attributes.test.tsrx +273 -317
  22. package/tests/client/basic/basic.collections.test.tsrx +59 -71
  23. package/tests/client/basic/basic.components.test.tsrx +196 -222
  24. package/tests/client/basic/basic.errors.test.tsrx +72 -78
  25. package/tests/client/basic/basic.events.test.tsrx +80 -85
  26. package/tests/client/basic/basic.get-set.test.tsrx +54 -64
  27. package/tests/client/basic/basic.hmr.test.tsrx +15 -19
  28. package/tests/client/basic/basic.reactivity.test.tsrx +121 -135
  29. package/tests/client/basic/basic.rendering.test.tsrx +273 -178
  30. package/tests/client/basic/basic.utilities.test.tsrx +8 -10
  31. package/tests/client/boundaries.test.tsrx +18 -18
  32. package/tests/client/compiler/compiler.assignments.test.tsrx +77 -76
  33. package/tests/client/compiler/compiler.attributes.test.tsrx +18 -14
  34. package/tests/client/compiler/compiler.basic.test.tsrx +364 -296
  35. package/tests/client/compiler/compiler.regex.test.tsrx +40 -44
  36. package/tests/client/compiler/compiler.tracked-access.test.tsrx +57 -38
  37. package/tests/client/compiler/compiler.try-in-function.test.tsrx +16 -16
  38. package/tests/client/compiler/compiler.typescript.test.tsrx +4 -3
  39. package/tests/client/composite/composite.dynamic-components.test.tsrx +41 -44
  40. package/tests/client/composite/composite.generics.test.tsrx +165 -167
  41. package/tests/client/composite/composite.props.test.tsrx +66 -74
  42. package/tests/client/composite/composite.reactivity.test.tsrx +132 -166
  43. package/tests/client/composite/composite.render.test.tsrx +92 -101
  44. package/tests/client/computed-properties.test.tsrx +14 -18
  45. package/tests/client/context.test.tsrx +14 -18
  46. package/tests/client/css/global-additional-cases.test.tsrx +491 -437
  47. package/tests/client/css/global-advanced-selectors.test.tsrx +169 -153
  48. package/tests/client/css/global-at-rules.test.tsrx +71 -66
  49. package/tests/client/css/global-basic.test.tsrx +105 -98
  50. package/tests/client/css/global-classes-ids.test.tsrx +128 -114
  51. package/tests/client/css/global-combinators.test.tsrx +83 -78
  52. package/tests/client/css/global-complex-nesting.test.tsrx +134 -120
  53. package/tests/client/css/global-edge-cases.test.tsrx +138 -120
  54. package/tests/client/css/global-keyframes.test.tsrx +108 -96
  55. package/tests/client/css/global-nested.test.tsrx +88 -78
  56. package/tests/client/css/global-pseudo.test.tsrx +104 -98
  57. package/tests/client/css/global-scoping.test.tsrx +145 -125
  58. package/tests/client/css/style-identifier.test.tsrx +62 -69
  59. package/tests/client/date.test.tsrx +83 -83
  60. package/tests/client/dynamic-elements.test.tsrx +227 -283
  61. package/tests/client/events.test.tsrx +252 -266
  62. package/tests/client/for.test.tsrx +120 -127
  63. package/tests/client/head.test.tsrx +40 -48
  64. package/tests/client/html.test.tsrx +37 -49
  65. package/tests/client/input-value.test.tsrx +1125 -1354
  66. package/tests/client/lazy-array.test.tsrx +10 -16
  67. package/tests/client/lazy-destructuring.test.tsrx +169 -221
  68. package/tests/client/map.test.tsrx +39 -41
  69. package/tests/client/media-query.test.tsrx +15 -19
  70. package/tests/client/object.test.tsrx +46 -56
  71. package/tests/client/portal.test.tsrx +31 -37
  72. package/tests/client/ref.test.tsrx +173 -193
  73. package/tests/client/return.test.tsrx +62 -37
  74. package/tests/client/set.test.tsrx +33 -33
  75. package/tests/client/svg.test.tsrx +195 -215
  76. package/tests/client/switch.test.tsrx +201 -191
  77. package/tests/client/track-async-hydration.test.tsrx +14 -18
  78. package/tests/client/tracked-index-access.test.tsrx +18 -28
  79. package/tests/client/try.test.tsrx +494 -619
  80. package/tests/client/tsx.test.tsrx +290 -371
  81. package/tests/client/typescript-generics.test.tsrx +121 -129
  82. package/tests/client/url/url.derived.test.tsrx +21 -25
  83. package/tests/client/url/url.parsing.test.tsrx +35 -35
  84. package/tests/client/url/url.partial-removal.test.tsrx +32 -32
  85. package/tests/client/url/url.reactivity.test.tsrx +68 -72
  86. package/tests/client/url/url.serialization.test.tsrx +8 -8
  87. package/tests/client/url-search-params/url-search-params.derived.test.tsrx +21 -27
  88. package/tests/client/url-search-params/url-search-params.initialization.test.tsrx +16 -16
  89. package/tests/client/url-search-params/url-search-params.iteration.test.tsrx +37 -37
  90. package/tests/client/url-search-params/url-search-params.mutation.test.tsrx +56 -60
  91. package/tests/client/url-search-params/url-search-params.retrieval.test.tsrx +32 -34
  92. package/tests/client/url-search-params/url-search-params.serialization.test.tsrx +9 -9
  93. package/tests/client/url-search-params/url-search-params.tracked-url.test.tsrx +10 -10
  94. package/tests/hydration/compiled/client/basic.js +396 -325
  95. package/tests/hydration/compiled/client/composite.js +52 -44
  96. package/tests/hydration/compiled/client/for.js +734 -604
  97. package/tests/hydration/compiled/client/head.js +183 -103
  98. package/tests/hydration/compiled/client/html.js +93 -86
  99. package/tests/hydration/compiled/client/if-children.js +95 -71
  100. package/tests/hydration/compiled/client/if.js +113 -89
  101. package/tests/hydration/compiled/client/mixed-control-flow.js +225 -209
  102. package/tests/hydration/compiled/client/nested-control-flow.js +94 -98
  103. package/tests/hydration/compiled/client/reactivity.js +26 -24
  104. package/tests/hydration/compiled/client/return.js +8 -42
  105. package/tests/hydration/compiled/client/switch.js +208 -173
  106. package/tests/hydration/compiled/client/track-async-serialization.js +176 -128
  107. package/tests/hydration/compiled/client/try.js +29 -21
  108. package/tests/hydration/compiled/server/basic.js +210 -221
  109. package/tests/hydration/compiled/server/composite.js +13 -14
  110. package/tests/hydration/compiled/server/for.js +427 -444
  111. package/tests/hydration/compiled/server/head.js +199 -189
  112. package/tests/hydration/compiled/server/html.js +33 -41
  113. package/tests/hydration/compiled/server/if-children.js +114 -117
  114. package/tests/hydration/compiled/server/if.js +77 -83
  115. package/tests/hydration/compiled/server/mixed-control-flow.js +145 -150
  116. package/tests/hydration/compiled/server/nested-control-flow.js +10 -0
  117. package/tests/hydration/compiled/server/reactivity.js +24 -22
  118. package/tests/hydration/compiled/server/return.js +6 -18
  119. package/tests/hydration/compiled/server/switch.js +179 -176
  120. package/tests/hydration/compiled/server/track-async-serialization.js +88 -70
  121. package/tests/hydration/compiled/server/try.js +31 -35
  122. package/tests/hydration/components/basic.tsrx +216 -286
  123. package/tests/hydration/components/composite.tsrx +32 -42
  124. package/tests/hydration/components/events.tsrx +81 -101
  125. package/tests/hydration/components/for.tsrx +270 -336
  126. package/tests/hydration/components/head.tsrx +43 -39
  127. package/tests/hydration/components/hmr.tsrx +16 -22
  128. package/tests/hydration/components/html-in-template.tsrx +15 -21
  129. package/tests/hydration/components/html.tsrx +442 -526
  130. package/tests/hydration/components/if-children.tsrx +107 -125
  131. package/tests/hydration/components/if.tsrx +68 -90
  132. package/tests/hydration/components/mixed-control-flow.tsrx +65 -72
  133. package/tests/hydration/components/nested-control-flow.tsrx +202 -216
  134. package/tests/hydration/components/portal.tsrx +33 -41
  135. package/tests/hydration/components/reactivity.tsrx +26 -34
  136. package/tests/hydration/components/return.tsrx +4 -6
  137. package/tests/hydration/components/switch.tsrx +73 -78
  138. package/tests/hydration/components/track-async-serialization.tsrx +83 -93
  139. package/tests/hydration/components/try.tsrx +37 -51
  140. package/tests/hydration/switch.test.js +8 -8
  141. package/tests/server/await.test.tsrx +3 -3
  142. package/tests/server/basic.attributes.test.tsrx +120 -167
  143. package/tests/server/basic.components.test.tsrx +163 -197
  144. package/tests/server/basic.test.tsrx +298 -220
  145. package/tests/server/compiler.test.tsrx +142 -72
  146. package/tests/server/composite.props.test.tsrx +54 -58
  147. package/tests/server/composite.test.tsrx +165 -167
  148. package/tests/server/context.test.tsrx +13 -17
  149. package/tests/server/dynamic-elements.test.tsrx +103 -135
  150. package/tests/server/for.test.tsrx +115 -84
  151. package/tests/server/head.test.tsrx +31 -31
  152. package/tests/server/html-nesting-validation.test.tsrx +16 -8
  153. package/tests/server/if.test.tsrx +49 -59
  154. package/tests/server/lazy-destructuring.test.tsrx +288 -366
  155. package/tests/server/return.test.tsrx +58 -36
  156. package/tests/server/streaming-ssr.test.tsrx +4 -4
  157. package/tests/server/style-identifier.test.tsrx +58 -66
  158. package/tests/server/switch.test.tsrx +89 -97
  159. package/tests/server/track-async-serialization.test.tsrx +85 -103
  160. package/tests/server/try.test.tsrx +275 -360
  161. package/tests/utils/ref-types.test.js +72 -0
  162. package/tests/utils/vite-plugin-config.test.js +41 -74
  163. package/types/index.d.ts +1 -0
  164. package/src/runtime/internal/client/compat.js +0 -40
  165. package/tests/utils/compiler-compat-config.test.js +0 -38
@@ -12,15 +12,18 @@ var root_8 = _$_.template(`<div class="items"><!></div>`, 0);
12
12
  var root_7 = _$_.template(`<section class="group"><div role="button" class="item"><div class="indicator"></div><h2 class="text">Title</h2><div class="caret"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"></path></svg></div></div><!></section>`, 0);
13
13
  var root_10 = _$_.template(`<!><!>`, 1, 2);
14
14
  var root_9 = _$_.template(`<!>`, 1, 1);
15
- var root_12 = _$_.template(`<div class="conditional">Conditional content</div>`, 0);
16
- var root_11 = _$_.template(`<div class="wrapper"><div class="nested-parent"><div class="nested-child"><span class="deep">Deep content</span></div></div><!></div><button class="toggle">Toggle</button>`, 1, 2);
17
- var root_14 = _$_.template(`<footer class="footer">Footer</footer>`, 0);
18
- var root_13 = _$_.template(`<section class="outer"><article class="middle"><div class="inner"><p class="leaf"><strong>Bold</strong><em>Italic</em></p></div></article><!></section><button class="btn">Toggle</button>`, 1, 2);
19
- var root_16 = _$_.template(`<pre class="code">const x = 1;</pre>`, 0);
20
- var root_17 = _$_.template(`<div class="preview">Preview content</div>`, 0);
21
- var root_15 = _$_.template(`<div class="tabs"><div class="tab-list"><button class="tab">Code</button><button class="tab">Preview</button></div><div class="panel"><!></div></div>`, 0);
22
- var root_18 = _$_.template(`<div class="container"><ul class="list"><li class="item"> </li><li class="item">Another item</li></ul><h2 class="heading">Static Heading</h2><p class="para">Static paragraph</p></div><button class="inc">Increment</button>`, 1, 2);
23
- var root_19 = _$_.template(`<div class="wrapper"><ul class="features"><li><strong>Feature One</strong>: Description of feature one with <code>code</code> reference</li><li><strong>Feature Two</strong>: Another feature description</li><li><strong>Feature Three</strong>: Third feature</li></ul><h2 class="section-heading">Section Heading</h2><p class="section-content">Static paragraph with <a href="/link">a link</a> and more text.</p></div>`, 0);
15
+ var root_13 = _$_.template(`<div class="conditional">Conditional content</div>`, 0);
16
+ var root_12 = _$_.template(`<div class="wrapper"><div class="nested-parent"><div class="nested-child"><span class="deep">Deep content</span></div></div><!></div><button class="toggle">Toggle</button>`, 1, 2);
17
+ var root_11 = _$_.template(`<!>`, 1, 1);
18
+ var root_16 = _$_.template(`<footer class="footer">Footer</footer>`, 0);
19
+ var root_15 = _$_.template(`<section class="outer"><article class="middle"><div class="inner"><p class="leaf"><strong>Bold</strong><em>Italic</em></p></div></article><!></section><button class="btn">Toggle</button>`, 1, 2);
20
+ var root_14 = _$_.template(`<!>`, 1, 1);
21
+ var root_18 = _$_.template(`<pre class="code">const x = 1;</pre>`, 0);
22
+ var root_19 = _$_.template(`<div class="preview">Preview content</div>`, 0);
23
+ var root_17 = _$_.template(`<div class="tabs"><div class="tab-list"><button class="tab">Code</button><button class="tab">Preview</button></div><div class="panel"><!></div></div>`, 0);
24
+ var root_21 = _$_.template(`<div class="container"><ul class="list"><li class="item"> </li><li class="item">Another item</li></ul><h2 class="heading">Static Heading</h2><p class="para">Static paragraph</p></div><button class="inc">Increment</button>`, 1, 2);
25
+ var root_20 = _$_.template(`<!>`, 1, 1);
26
+ var root_22 = _$_.template(`<div class="wrapper"><ul class="features"><li><strong>Feature One</strong>: Description of feature one with <code>code</code> reference</li><li><strong>Feature Two</strong>: Another feature description</li><li><strong>Feature Three</strong>: Third feature</li></ul><h2 class="section-heading">Section Heading</h2><p class="section-content">Static paragraph with <a href="/link">a link</a> and more text.</p></div>`, 0);
24
27
 
25
28
  import { track } from 'ripple';
26
29
 
@@ -197,78 +200,92 @@ export function ElementWithChildrenThenIf() {
197
200
  return _$_.tsrx_element((__anchor, __block) => {
198
201
  let lazy_3 = _$_.track(true, __block, '7cd4817b');
199
202
  var fragment_4 = root_11();
200
- var div_11 = _$_.first_child_frag(fragment_4);
203
+ var node_10 = _$_.first_child_frag(fragment_4);
201
204
 
202
- {
203
- var div_10 = _$_.child(div_11);
205
+ _$_.expression(node_10, () => _$_.tsrx_element((__anchor, __block) => {
206
+ var fragment_5 = root_12();
207
+ var div_11 = _$_.first_child_frag(fragment_5);
204
208
 
205
- _$_.pop(div_10);
209
+ {
210
+ var div_10 = _$_.child(div_11);
206
211
 
207
- var node_9 = _$_.sibling(div_10);
212
+ _$_.pop(div_10);
208
213
 
209
- {
210
- var consequent_3 = (__anchor) => {
211
- var div_12 = root_12();
214
+ var node_9 = _$_.sibling(div_10);
212
215
 
213
- _$_.append(__anchor, div_12);
214
- };
216
+ {
217
+ var consequent_3 = (__anchor) => {
218
+ var div_12 = root_13();
215
219
 
216
- _$_.if(node_9, (__render) => {
217
- if (lazy_3.value) __render(consequent_3);
218
- });
220
+ _$_.append(__anchor, div_12);
221
+ };
222
+
223
+ _$_.if(node_9, (__render) => {
224
+ if (lazy_3.value) __render(consequent_3);
225
+ });
226
+ }
227
+
228
+ _$_.pop(div_11);
219
229
  }
220
230
 
221
- _$_.pop(div_11);
222
- }
231
+ var button_1 = _$_.sibling(div_11);
223
232
 
224
- var button_1 = _$_.sibling(div_11);
233
+ button_1.__click = () => _$_.set(lazy_3, !lazy_3.value);
234
+ _$_.next();
235
+ _$_.append(__anchor, fragment_5, true);
236
+ }));
225
237
 
226
- button_1.__click = () => _$_.set(lazy_3, !lazy_3.value);
227
- _$_.next();
228
- _$_.append(__anchor, fragment_4, true);
238
+ _$_.append(__anchor, fragment_4);
229
239
  });
230
240
  }
231
241
 
232
242
  export function DeepNestingThenIf() {
233
243
  return _$_.tsrx_element((__anchor, __block) => {
234
244
  let lazy_4 = _$_.track(true, __block, '923116be');
235
- var fragment_5 = root_13();
236
- var section_2 = _$_.first_child_frag(fragment_5);
245
+ var fragment_6 = root_14();
246
+ var node_12 = _$_.first_child_frag(fragment_6);
237
247
 
238
- {
239
- var article_1 = _$_.child(section_2);
248
+ _$_.expression(node_12, () => _$_.tsrx_element((__anchor, __block) => {
249
+ var fragment_7 = root_15();
250
+ var section_2 = _$_.first_child_frag(fragment_7);
240
251
 
241
- _$_.pop(article_1);
252
+ {
253
+ var article_1 = _$_.child(section_2);
242
254
 
243
- var node_10 = _$_.sibling(article_1);
255
+ _$_.pop(article_1);
244
256
 
245
- {
246
- var consequent_4 = (__anchor) => {
247
- var footer_1 = root_14();
257
+ var node_11 = _$_.sibling(article_1);
248
258
 
249
- _$_.append(__anchor, footer_1);
250
- };
259
+ {
260
+ var consequent_4 = (__anchor) => {
261
+ var footer_1 = root_16();
251
262
 
252
- _$_.if(node_10, (__render) => {
253
- if (lazy_4.value) __render(consequent_4);
254
- });
263
+ _$_.append(__anchor, footer_1);
264
+ };
265
+
266
+ _$_.if(node_11, (__render) => {
267
+ if (lazy_4.value) __render(consequent_4);
268
+ });
269
+ }
270
+
271
+ _$_.pop(section_2);
255
272
  }
256
273
 
257
- _$_.pop(section_2);
258
- }
274
+ var button_2 = _$_.sibling(section_2);
259
275
 
260
- var button_2 = _$_.sibling(section_2);
276
+ button_2.__click = () => _$_.set(lazy_4, !lazy_4.value);
277
+ _$_.next();
278
+ _$_.append(__anchor, fragment_7, true);
279
+ }));
261
280
 
262
- button_2.__click = () => _$_.set(lazy_4, !lazy_4.value);
263
- _$_.next();
264
- _$_.append(__anchor, fragment_5, true);
281
+ _$_.append(__anchor, fragment_6);
265
282
  });
266
283
  }
267
284
 
268
285
  export function DomElementChildrenThenSibling() {
269
286
  return _$_.tsrx_element((__anchor, __block) => {
270
287
  let lazy_5 = _$_.track('code', __block, '33a1e97f');
271
- var div_13 = root_15();
288
+ var div_13 = root_17();
272
289
 
273
290
  {
274
291
  var div_14 = _$_.child(div_13);
@@ -288,22 +305,22 @@ export function DomElementChildrenThenSibling() {
288
305
  var div_15 = _$_.sibling(div_14);
289
306
 
290
307
  {
291
- var node_11 = _$_.child(div_15);
308
+ var node_13 = _$_.child(div_15);
292
309
 
293
310
  {
294
311
  var consequent_5 = (__anchor) => {
295
- var pre_1 = root_16();
312
+ var pre_1 = root_18();
296
313
 
297
314
  _$_.append(__anchor, pre_1);
298
315
  };
299
316
 
300
317
  var alternate = (__anchor) => {
301
- var div_16 = root_17();
318
+ var div_16 = root_19();
302
319
 
303
320
  _$_.append(__anchor, div_16);
304
321
  };
305
322
 
306
- _$_.if(node_11, (__render) => {
323
+ _$_.if(node_13, (__render) => {
307
324
  if (lazy_5.value === 'code') __render(consequent_5); else __render(alternate, false);
308
325
  });
309
326
  }
@@ -336,43 +353,50 @@ export function DomElementChildrenThenSibling() {
336
353
  export function DomChildrenThenStaticSiblings() {
337
354
  return _$_.tsrx_element((__anchor, __block) => {
338
355
  let lazy_6 = _$_.track(0, __block, '0ea64305');
339
- var fragment_6 = root_18();
340
- var div_17 = _$_.first_child_frag(fragment_6);
356
+ var fragment_8 = root_20();
357
+ var node_14 = _$_.first_child_frag(fragment_8);
341
358
 
342
- {
343
- var ul_1 = _$_.child(div_17);
359
+ _$_.expression(node_14, () => _$_.tsrx_element((__anchor, __block) => {
360
+ var fragment_9 = root_21();
361
+ var div_17 = _$_.first_child_frag(fragment_9);
344
362
 
345
363
  {
346
- var li_1 = _$_.child(ul_1);
364
+ var ul_1 = _$_.child(div_17);
347
365
 
348
366
  {
349
- var expression_3 = _$_.child(li_1, true);
367
+ var li_1 = _$_.child(ul_1);
368
+
369
+ {
370
+ var expression_3 = _$_.child(li_1, true);
350
371
 
351
- _$_.pop(li_1);
372
+ _$_.pop(li_1);
373
+ }
352
374
  }
375
+
376
+ _$_.pop(ul_1);
353
377
  }
354
378
 
355
- _$_.pop(ul_1);
356
- }
379
+ _$_.pop(div_17);
357
380
 
358
- _$_.pop(div_17);
381
+ var button_5 = _$_.sibling(div_17);
359
382
 
360
- var button_5 = _$_.sibling(div_17);
383
+ button_5.__click = () => _$_.update(lazy_6);
384
+ _$_.next();
361
385
 
362
- button_5.__click = () => _$_.update(lazy_6);
363
- _$_.next();
386
+ _$_.render(() => {
387
+ _$_.set_text(expression_3, 'Item count: ' + _$_.with_scope(__block, () => String(lazy_6.value)));
388
+ });
364
389
 
365
- _$_.render(() => {
366
- _$_.set_text(expression_3, 'Item count: ' + _$_.with_scope(__block, () => String(lazy_6.value)));
367
- });
390
+ _$_.append(__anchor, fragment_9, true);
391
+ }));
368
392
 
369
- _$_.append(__anchor, fragment_6, true);
393
+ _$_.append(__anchor, fragment_8);
370
394
  });
371
395
  }
372
396
 
373
397
  export function StaticListThenStaticSiblings() {
374
398
  return _$_.tsrx_element((__anchor, __block) => {
375
- var div_18 = root_19();
399
+ var div_18 = root_22();
376
400
 
377
401
  {
378
402
  var ul_2 = _$_.child(div_18);
@@ -8,19 +8,22 @@ var root_2 = _$_.template(`<!>`, 1, 1);
8
8
  var root_5 = _$_.template(`<div class="logged-in">Welcome back!</div>`, 0);
9
9
  var root_6 = _$_.template(`<div class="logged-out">Please log in</div>`, 0);
10
10
  var root_4 = _$_.template(`<!>`, 1, 1);
11
- var root_8 = _$_.template(`<div class="content">Content visible</div>`, 0);
12
- var root_7 = _$_.template(`<button class="toggle">Toggle</button><!>`, 1, 2);
13
- var root_10 = _$_.template(`<div class="on">ON</div>`, 0);
14
- var root_11 = _$_.template(`<div class="off">OFF</div>`, 0);
15
- var root_9 = _$_.template(`<button class="toggle">Toggle</button><!>`, 1, 2);
16
- var root_14 = _$_.template(`<span class="inner-content">Inner</span>`, 0);
17
- var root_13 = _$_.template(`<div class="outer-content">Outer<!></div>`, 0);
18
- var root_12 = _$_.template(`<button class="outer-toggle">Outer</button><button class="inner-toggle">Inner</button><!>`, 1, 3);
19
- var root_16 = _$_.template(`<div class="state">Loading...</div>`, 0);
20
- var root_18 = _$_.template(`<div class="state">Success!</div>`, 0);
21
- var root_19 = _$_.template(`<div class="state">Error occurred</div>`, 0);
22
- var root_17 = _$_.template(`<!>`, 1, 1);
23
- var root_15 = _$_.template(`<div><button class="success">Success</button><button class="error">Error</button><button class="loading">Loading</button><!></div>`, 0);
11
+ var root_9 = _$_.template(`<div class="content">Content visible</div>`, 0);
12
+ var root_8 = _$_.template(`<button class="toggle">Toggle</button><!>`, 1, 2);
13
+ var root_7 = _$_.template(`<!>`, 1, 1);
14
+ var root_12 = _$_.template(`<div class="on">ON</div>`, 0);
15
+ var root_13 = _$_.template(`<div class="off">OFF</div>`, 0);
16
+ var root_11 = _$_.template(`<button class="toggle">Toggle</button><!>`, 1, 2);
17
+ var root_10 = _$_.template(`<!>`, 1, 1);
18
+ var root_17 = _$_.template(`<span class="inner-content">Inner</span>`, 0);
19
+ var root_16 = _$_.template(`<div class="outer-content">Outer<!></div>`, 0);
20
+ var root_15 = _$_.template(`<button class="outer-toggle">Outer</button><button class="inner-toggle">Inner</button><!>`, 1, 3);
21
+ var root_14 = _$_.template(`<!>`, 1, 1);
22
+ var root_19 = _$_.template(`<div class="state">Loading...</div>`, 0);
23
+ var root_21 = _$_.template(`<div class="state">Success!</div>`, 0);
24
+ var root_22 = _$_.template(`<div class="state">Error occurred</div>`, 0);
25
+ var root_20 = _$_.template(`<!>`, 1, 1);
26
+ var root_18 = _$_.template(`<div><button class="success">Success</button><button class="error">Error</button><button class="loading">Loading</button><!></div>`, 0);
24
27
 
25
28
  import { track } from 'ripple';
26
29
 
@@ -100,25 +103,32 @@ export function ReactiveIf() {
100
103
  return _$_.tsrx_element((__anchor, __block) => {
101
104
  let lazy = _$_.track(true, __block, '19a16ff0');
102
105
  var fragment_3 = root_7();
103
- var button_1 = _$_.first_child_frag(fragment_3);
106
+ var node_4 = _$_.first_child_frag(fragment_3);
104
107
 
105
- button_1.__click = () => {
106
- _$_.set(lazy, !lazy.value);
107
- };
108
+ _$_.expression(node_4, () => _$_.tsrx_element((__anchor, __block) => {
109
+ var fragment_4 = root_8();
110
+ var button_1 = _$_.first_child_frag(fragment_4);
108
111
 
109
- var node_3 = _$_.sibling(button_1);
112
+ button_1.__click = () => {
113
+ _$_.set(lazy, !lazy.value);
114
+ };
110
115
 
111
- {
112
- var consequent_3 = (__anchor) => {
113
- var div_5 = root_8();
116
+ var node_3 = _$_.sibling(button_1);
114
117
 
115
- _$_.append(__anchor, div_5);
116
- };
118
+ {
119
+ var consequent_3 = (__anchor) => {
120
+ var div_5 = root_9();
117
121
 
118
- _$_.if(node_3, (__render) => {
119
- if (lazy.value) __render(consequent_3);
120
- });
121
- }
122
+ _$_.append(__anchor, div_5);
123
+ };
124
+
125
+ _$_.if(node_3, (__render) => {
126
+ if (lazy.value) __render(consequent_3);
127
+ });
128
+ }
129
+
130
+ _$_.append(__anchor, fragment_4);
131
+ }));
122
132
 
123
133
  _$_.append(__anchor, fragment_3);
124
134
  });
@@ -127,34 +137,41 @@ export function ReactiveIf() {
127
137
  export function ReactiveIfElse() {
128
138
  return _$_.tsrx_element((__anchor, __block) => {
129
139
  let lazy_1 = _$_.track(false, __block, '41177f39');
130
- var fragment_4 = root_9();
131
- var button_2 = _$_.first_child_frag(fragment_4);
140
+ var fragment_5 = root_10();
141
+ var node_6 = _$_.first_child_frag(fragment_5);
132
142
 
133
- button_2.__click = () => {
134
- _$_.set(lazy_1, !lazy_1.value);
135
- };
143
+ _$_.expression(node_6, () => _$_.tsrx_element((__anchor, __block) => {
144
+ var fragment_6 = root_11();
145
+ var button_2 = _$_.first_child_frag(fragment_6);
136
146
 
137
- var node_4 = _$_.sibling(button_2);
147
+ button_2.__click = () => {
148
+ _$_.set(lazy_1, !lazy_1.value);
149
+ };
138
150
 
139
- {
140
- var consequent_4 = (__anchor) => {
141
- var div_6 = root_10();
151
+ var node_5 = _$_.sibling(button_2);
142
152
 
143
- _$_.append(__anchor, div_6);
144
- };
153
+ {
154
+ var consequent_4 = (__anchor) => {
155
+ var div_6 = root_12();
156
+
157
+ _$_.append(__anchor, div_6);
158
+ };
145
159
 
146
- var alternate_1 = (__anchor) => {
147
- var div_7 = root_11();
160
+ var alternate_1 = (__anchor) => {
161
+ var div_7 = root_13();
148
162
 
149
- _$_.append(__anchor, div_7);
150
- };
163
+ _$_.append(__anchor, div_7);
164
+ };
151
165
 
152
- _$_.if(node_4, (__render) => {
153
- if (lazy_1.value) __render(consequent_4); else __render(alternate_1, false);
154
- });
155
- }
166
+ _$_.if(node_5, (__render) => {
167
+ if (lazy_1.value) __render(consequent_4); else __render(alternate_1, false);
168
+ });
169
+ }
170
+
171
+ _$_.append(__anchor, fragment_6);
172
+ }));
156
173
 
157
- _$_.append(__anchor, fragment_4);
174
+ _$_.append(__anchor, fragment_5);
158
175
  });
159
176
  }
160
177
 
@@ -162,60 +179,67 @@ export function NestedIf() {
162
179
  return _$_.tsrx_element((__anchor, __block) => {
163
180
  let lazy_2 = _$_.track(true, __block, '7894e1df');
164
181
  let lazy_3 = _$_.track(true, __block, 'f21b8c26');
165
- var fragment_5 = root_12();
166
- var button_3 = _$_.first_child_frag(fragment_5);
182
+ var fragment_7 = root_14();
183
+ var node_9 = _$_.first_child_frag(fragment_7);
167
184
 
168
- button_3.__click = () => {
169
- _$_.set(lazy_2, !lazy_2.value);
170
- };
185
+ _$_.expression(node_9, () => _$_.tsrx_element((__anchor, __block) => {
186
+ var fragment_8 = root_15();
187
+ var button_3 = _$_.first_child_frag(fragment_8);
171
188
 
172
- var button_4 = _$_.sibling(button_3);
189
+ button_3.__click = () => {
190
+ _$_.set(lazy_2, !lazy_2.value);
191
+ };
173
192
 
174
- button_4.__click = () => {
175
- _$_.set(lazy_3, !lazy_3.value);
176
- };
193
+ var button_4 = _$_.sibling(button_3);
177
194
 
178
- var node_5 = _$_.sibling(button_4);
195
+ button_4.__click = () => {
196
+ _$_.set(lazy_3, !lazy_3.value);
197
+ };
179
198
 
180
- {
181
- var consequent_6 = (__anchor) => {
182
- var div_8 = root_13();
199
+ var node_7 = _$_.sibling(button_4);
183
200
 
184
- {
185
- var expression = _$_.child(div_8);
186
- var node_6 = _$_.sibling(expression);
201
+ {
202
+ var consequent_6 = (__anchor) => {
203
+ var div_8 = root_16();
187
204
 
188
205
  {
189
- var consequent_5 = (__anchor) => {
190
- var span_1 = root_14();
206
+ var expression = _$_.child(div_8);
207
+ var node_8 = _$_.sibling(expression);
191
208
 
192
- _$_.append(__anchor, span_1);
193
- };
209
+ {
210
+ var consequent_5 = (__anchor) => {
211
+ var span_1 = root_17();
194
212
 
195
- _$_.if(node_6, (__render) => {
196
- if (lazy_3.value) __render(consequent_5);
197
- });
213
+ _$_.append(__anchor, span_1);
214
+ };
215
+
216
+ _$_.if(node_8, (__render) => {
217
+ if (lazy_3.value) __render(consequent_5);
218
+ });
219
+ }
220
+
221
+ _$_.pop(div_8);
198
222
  }
199
223
 
200
- _$_.pop(div_8);
201
- }
224
+ _$_.append(__anchor, div_8);
225
+ };
202
226
 
203
- _$_.append(__anchor, div_8);
204
- };
227
+ _$_.if(node_7, (__render) => {
228
+ if (lazy_2.value) __render(consequent_6);
229
+ });
230
+ }
205
231
 
206
- _$_.if(node_5, (__render) => {
207
- if (lazy_2.value) __render(consequent_6);
208
- });
209
- }
232
+ _$_.append(__anchor, fragment_8);
233
+ }));
210
234
 
211
- _$_.append(__anchor, fragment_5);
235
+ _$_.append(__anchor, fragment_7);
212
236
  });
213
237
  }
214
238
 
215
239
  export function IfElseIfChain() {
216
240
  return _$_.tsrx_element((__anchor, __block) => {
217
241
  let lazy_4 = _$_.track('loading', __block, '4c69c94a');
218
- var div_9 = root_15();
242
+ var div_9 = root_18();
219
243
 
220
244
  {
221
245
  var button_5 = _$_.child(div_9);
@@ -236,41 +260,41 @@ export function IfElseIfChain() {
236
260
  _$_.set(lazy_4, 'loading');
237
261
  };
238
262
 
239
- var node_7 = _$_.sibling(button_7);
263
+ var node_10 = _$_.sibling(button_7);
240
264
 
241
265
  {
242
266
  var consequent_7 = (__anchor) => {
243
- var div_10 = root_16();
267
+ var div_10 = root_19();
244
268
 
245
269
  _$_.append(__anchor, div_10);
246
270
  };
247
271
 
248
272
  var alternate_3 = (__anchor) => {
249
- var fragment_6 = root_17();
250
- var node_8 = _$_.first_child_frag(fragment_6);
273
+ var fragment_9 = root_20();
274
+ var node_11 = _$_.first_child_frag(fragment_9);
251
275
 
252
276
  {
253
277
  var consequent_8 = (__anchor) => {
254
- var div_11 = root_18();
278
+ var div_11 = root_21();
255
279
 
256
280
  _$_.append(__anchor, div_11);
257
281
  };
258
282
 
259
283
  var alternate_2 = (__anchor) => {
260
- var div_12 = root_19();
284
+ var div_12 = root_22();
261
285
 
262
286
  _$_.append(__anchor, div_12);
263
287
  };
264
288
 
265
- _$_.if(node_8, (__render) => {
289
+ _$_.if(node_11, (__render) => {
266
290
  if (lazy_4.value === 'success') __render(consequent_8); else __render(alternate_2, false);
267
291
  });
268
292
  }
269
293
 
270
- _$_.append(__anchor, fragment_6);
294
+ _$_.append(__anchor, fragment_9);
271
295
  };
272
296
 
273
- _$_.if(node_7, (__render) => {
297
+ _$_.if(node_10, (__render) => {
274
298
  if (lazy_4.value === 'loading') __render(consequent_7); else __render(alternate_3, false);
275
299
  });
276
300
  }