ripple 0.3.68 → 0.3.70

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 (182) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/package.json +3 -3
  3. package/src/jsx-runtime.d.ts +2 -2
  4. package/src/runtime/element.js +1 -1
  5. package/src/runtime/index-client.js +11 -11
  6. package/src/runtime/index-server.js +7 -4
  7. package/src/runtime/internal/client/bindings.js +1 -1
  8. package/src/runtime/internal/client/blocks.js +13 -4
  9. package/src/runtime/internal/client/component.js +55 -0
  10. package/src/runtime/internal/client/composite.js +4 -2
  11. package/src/runtime/internal/client/expression.js +65 -7
  12. package/src/runtime/internal/client/hmr.js +54 -43
  13. package/src/runtime/internal/client/index.js +5 -1
  14. package/src/runtime/internal/client/portal.js +70 -69
  15. package/src/runtime/internal/client/render.js +3 -0
  16. package/src/runtime/internal/server/index.js +92 -8
  17. package/tests/client/__snapshots__/html.test.tsrx.snap +3 -3
  18. package/tests/client/array/array.copy-within.test.tsrx +33 -31
  19. package/tests/client/array/array.derived.test.tsrx +186 -169
  20. package/tests/client/array/array.iteration.test.tsrx +40 -37
  21. package/tests/client/array/array.mutations.test.tsrx +113 -101
  22. package/tests/client/array/array.static.test.tsrx +119 -101
  23. package/tests/client/array/array.to-methods.test.tsrx +24 -21
  24. package/tests/client/async-suspend.test.tsrx +247 -246
  25. package/tests/client/basic/__snapshots__/basic.rendering.test.tsrx.snap +0 -1
  26. package/tests/client/basic/basic.attributes.test.tsrx +428 -423
  27. package/tests/client/basic/basic.collections.test.tsrx +109 -102
  28. package/tests/client/basic/basic.components.test.tsrx +323 -205
  29. package/tests/client/basic/basic.errors.test.tsrx +91 -91
  30. package/tests/client/basic/basic.events.test.tsrx +114 -115
  31. package/tests/client/basic/basic.get-set.test.tsrx +97 -87
  32. package/tests/client/basic/basic.hmr.test.tsrx +19 -16
  33. package/tests/client/basic/basic.reactivity.test.tsrx +199 -191
  34. package/tests/client/basic/basic.rendering.test.tsrx +272 -182
  35. package/tests/client/basic/basic.styling.test.tsrx +23 -22
  36. package/tests/client/basic/basic.utilities.test.tsrx +10 -8
  37. package/tests/client/boundaries.test.tsrx +26 -26
  38. package/tests/client/compiler/__snapshots__/compiler.assignments.test.rsrx.snap +5 -5
  39. package/tests/client/compiler/__snapshots__/compiler.assignments.test.tsrx.snap +5 -5
  40. package/tests/client/compiler/compiler.assignments.test.tsrx +77 -81
  41. package/tests/client/compiler/compiler.attributes.test.tsrx +15 -15
  42. package/tests/client/compiler/compiler.basic.test.tsrx +322 -314
  43. package/tests/client/compiler/compiler.regex.test.tsrx +44 -47
  44. package/tests/client/compiler/compiler.tracked-access.test.tsrx +38 -38
  45. package/tests/client/compiler/compiler.try-in-function.test.tsrx +16 -16
  46. package/tests/client/compiler/compiler.typescript.test.tsrx +2 -2
  47. package/tests/client/composite/composite.dynamic-components.test.tsrx +47 -48
  48. package/tests/client/composite/composite.generics.test.tsrx +168 -192
  49. package/tests/client/composite/composite.props.test.tsrx +97 -81
  50. package/tests/client/composite/composite.reactivity.test.tsrx +177 -147
  51. package/tests/client/composite/composite.render.test.tsrx +122 -105
  52. package/tests/client/computed-properties.test.tsrx +28 -28
  53. package/tests/client/context.test.tsrx +21 -21
  54. package/tests/client/css/global-additional-cases.test.tsrx +58 -58
  55. package/tests/client/css/global-advanced-selectors.test.tsrx +16 -16
  56. package/tests/client/css/global-at-rules.test.tsrx +10 -10
  57. package/tests/client/css/global-basic.test.tsrx +14 -14
  58. package/tests/client/css/global-classes-ids.test.tsrx +14 -14
  59. package/tests/client/css/global-combinators.test.tsrx +10 -10
  60. package/tests/client/css/global-complex-nesting.test.tsrx +14 -14
  61. package/tests/client/css/global-edge-cases.test.tsrx +18 -18
  62. package/tests/client/css/global-keyframes.test.tsrx +12 -12
  63. package/tests/client/css/global-nested.test.tsrx +10 -10
  64. package/tests/client/css/global-pseudo.test.tsrx +12 -12
  65. package/tests/client/css/global-scoping.test.tsrx +20 -20
  66. package/tests/client/css/style-identifier.test.tsrx +126 -259
  67. package/tests/client/date.test.tsrx +146 -133
  68. package/tests/client/dynamic-elements.test.tsrx +398 -365
  69. package/tests/client/events.test.tsrx +292 -290
  70. package/tests/client/for.test.tsrx +156 -153
  71. package/tests/client/head.test.tsrx +105 -96
  72. package/tests/client/html.test.tsrx +122 -26
  73. package/tests/client/input-value.test.tsrx +1361 -1314
  74. package/tests/client/lazy-array.test.tsrx +16 -13
  75. package/tests/client/lazy-destructuring.test.tsrx +257 -213
  76. package/tests/client/map.test.tsrx +65 -60
  77. package/tests/client/media-query.test.tsrx +22 -20
  78. package/tests/client/object.test.tsrx +87 -81
  79. package/tests/client/portal.test.tsrx +57 -51
  80. package/tests/client/ref.test.tsrx +233 -202
  81. package/tests/client/return.test.tsrx +71 -2560
  82. package/tests/client/set.test.tsrx +54 -45
  83. package/tests/client/svg.test.tsrx +216 -186
  84. package/tests/client/switch.test.tsrx +194 -193
  85. package/tests/client/track-async-hydration.test.tsrx +18 -14
  86. package/tests/client/tracked-index-access.test.tsrx +28 -18
  87. package/tests/client/try.test.tsrx +675 -548
  88. package/tests/client/tsx.test.tsrx +373 -311
  89. package/tests/client/typescript-generics.test.tsrx +145 -145
  90. package/tests/client/url/url.derived.test.tsrx +33 -28
  91. package/tests/client/url/url.parsing.test.tsrx +61 -51
  92. package/tests/client/url/url.partial-removal.test.tsrx +56 -48
  93. package/tests/client/url/url.reactivity.test.tsrx +142 -125
  94. package/tests/client/url/url.serialization.test.tsrx +13 -11
  95. package/tests/client/url-search-params/url-search-params.derived.test.tsrx +34 -29
  96. package/tests/client/url-search-params/url-search-params.initialization.test.tsrx +25 -21
  97. package/tests/client/url-search-params/url-search-params.iteration.test.tsrx +50 -45
  98. package/tests/client/url-search-params/url-search-params.mutation.test.tsrx +111 -99
  99. package/tests/client/url-search-params/url-search-params.retrieval.test.tsrx +49 -43
  100. package/tests/client/url-search-params/url-search-params.serialization.test.tsrx +14 -12
  101. package/tests/client/url-search-params/url-search-params.tracked-url.test.tsrx +16 -14
  102. package/tests/hydration/basic.test.js +3 -3
  103. package/tests/hydration/compiled/client/basic.js +586 -651
  104. package/tests/hydration/compiled/client/composite.js +79 -104
  105. package/tests/hydration/compiled/client/events.js +140 -148
  106. package/tests/hydration/compiled/client/for.js +1005 -1018
  107. package/tests/hydration/compiled/client/head.js +124 -134
  108. package/tests/hydration/compiled/client/hmr.js +41 -48
  109. package/tests/hydration/compiled/client/html-in-template.js +38 -41
  110. package/tests/hydration/compiled/client/html.js +970 -1314
  111. package/tests/hydration/compiled/client/if-children.js +234 -249
  112. package/tests/hydration/compiled/client/if.js +182 -189
  113. package/tests/hydration/compiled/client/mixed-control-flow.js +347 -303
  114. package/tests/hydration/compiled/client/nested-control-flow.js +1084 -832
  115. package/tests/hydration/compiled/client/portal.js +65 -85
  116. package/tests/hydration/compiled/client/reactivity.js +84 -90
  117. package/tests/hydration/compiled/client/return.js +38 -1939
  118. package/tests/hydration/compiled/client/switch.js +218 -224
  119. package/tests/hydration/compiled/client/track-async-serialization.js +250 -259
  120. package/tests/hydration/compiled/client/try.js +123 -132
  121. package/tests/hydration/compiled/server/basic.js +773 -831
  122. package/tests/hydration/compiled/server/composite.js +166 -191
  123. package/tests/hydration/compiled/server/events.js +170 -184
  124. package/tests/hydration/compiled/server/for.js +851 -909
  125. package/tests/hydration/compiled/server/head.js +206 -216
  126. package/tests/hydration/compiled/server/hmr.js +64 -72
  127. package/tests/hydration/compiled/server/html-in-template.js +42 -76
  128. package/tests/hydration/compiled/server/html.js +1362 -1667
  129. package/tests/hydration/compiled/server/if-children.js +419 -445
  130. package/tests/hydration/compiled/server/if.js +194 -208
  131. package/tests/hydration/compiled/server/mixed-control-flow.js +249 -257
  132. package/tests/hydration/compiled/server/nested-control-flow.js +491 -515
  133. package/tests/hydration/compiled/server/portal.js +152 -160
  134. package/tests/hydration/compiled/server/reactivity.js +94 -106
  135. package/tests/hydration/compiled/server/return.js +28 -2172
  136. package/tests/hydration/compiled/server/switch.js +274 -286
  137. package/tests/hydration/compiled/server/track-async-serialization.js +340 -358
  138. package/tests/hydration/compiled/server/try.js +167 -185
  139. package/tests/hydration/components/basic.tsrx +320 -272
  140. package/tests/hydration/components/composite.tsrx +44 -32
  141. package/tests/hydration/components/events.tsrx +101 -91
  142. package/tests/hydration/components/for.tsrx +510 -452
  143. package/tests/hydration/components/head.tsrx +87 -80
  144. package/tests/hydration/components/hmr.tsrx +22 -17
  145. package/tests/hydration/components/html-in-template.tsrx +22 -17
  146. package/tests/hydration/components/html.tsrx +525 -443
  147. package/tests/hydration/components/if-children.tsrx +158 -148
  148. package/tests/hydration/components/if.tsrx +109 -95
  149. package/tests/hydration/components/mixed-control-flow.tsrx +100 -96
  150. package/tests/hydration/components/nested-control-flow.tsrx +215 -203
  151. package/tests/hydration/components/portal.tsrx +41 -34
  152. package/tests/hydration/components/reactivity.tsrx +37 -27
  153. package/tests/hydration/components/return.tsrx +12 -556
  154. package/tests/hydration/components/switch.tsrx +120 -114
  155. package/tests/hydration/components/track-async-serialization.tsrx +107 -91
  156. package/tests/hydration/components/try.tsrx +55 -40
  157. package/tests/hydration/html.test.js +4 -4
  158. package/tests/hydration/return.test.js +13 -532
  159. package/tests/server/await.test.tsrx +3 -3
  160. package/tests/server/basic.attributes.test.tsrx +264 -195
  161. package/tests/server/basic.components.test.tsrx +296 -169
  162. package/tests/server/basic.test.tsrx +300 -198
  163. package/tests/server/compiler.test.tsrx +62 -60
  164. package/tests/server/composite.props.test.tsrx +77 -63
  165. package/tests/server/composite.test.tsrx +168 -192
  166. package/tests/server/context.test.tsrx +18 -12
  167. package/tests/server/dynamic-elements.test.tsrx +197 -180
  168. package/tests/server/for.test.tsrx +85 -78
  169. package/tests/server/head.test.tsrx +50 -43
  170. package/tests/server/html-nesting-validation.test.tsrx +8 -8
  171. package/tests/server/if.test.tsrx +57 -51
  172. package/tests/server/lazy-destructuring.test.tsrx +366 -294
  173. package/tests/server/return.test.tsrx +76 -1355
  174. package/tests/server/streaming-ssr.test.tsrx +4 -75
  175. package/tests/server/style-identifier.test.tsrx +169 -131
  176. package/tests/server/switch.test.tsrx +91 -85
  177. package/tests/server/track-async-serialization.test.tsrx +105 -85
  178. package/tests/server/try.test.tsrx +374 -280
  179. package/tests/utils/compiler-compat-config.test.js +2 -2
  180. package/tests/utils/runtime-imports.test.js +10 -0
  181. package/types/index.d.ts +8 -0
  182. package/tests/client/__snapshots__/html.test.rsrx.snap +0 -40
@@ -4,1391 +4,1333 @@ import * as _$_ from 'ripple/internal/server';
4
4
  import { track } from 'ripple/server';
5
5
 
6
6
  export function StaticForLoop() {
7
- _$_.push_component();
7
+ return _$_.tsrx_element(() => {
8
+ const items = ['Apple', 'Banana', 'Cherry'];
8
9
 
9
- const items = ['Apple', 'Banana', 'Cherry'];
10
+ _$_.regular_block(() => {
11
+ _$_.output_push('<ul');
12
+ _$_.output_push('>');
10
13
 
11
- _$_.regular_block(() => {
12
- _$_.output_push('<ul');
13
- _$_.output_push('>');
14
+ {
15
+ _$_.output_push('<!--[-->');
14
16
 
15
- {
16
- _$_.output_push('<!--[-->');
17
+ for (const item of items) {
18
+ _$_.output_push('<li');
19
+ _$_.output_push('>');
17
20
 
18
- for (const item of items) {
19
- _$_.output_push('<li');
20
- _$_.output_push('>');
21
+ {
22
+ _$_.output_push(_$_.escape(item));
23
+ }
21
24
 
22
- {
23
- _$_.output_push(_$_.escape(item));
25
+ _$_.output_push('</li>');
24
26
  }
25
27
 
26
- _$_.output_push('</li>');
28
+ _$_.output_push('<!--]-->');
27
29
  }
28
30
 
29
- _$_.output_push('<!--]-->');
30
- }
31
-
32
- _$_.output_push('</ul>');
31
+ _$_.output_push('</ul>');
32
+ });
33
33
  });
34
-
35
- _$_.pop_component();
36
34
  }
37
35
 
38
36
  export function ForLoopWithIndex() {
39
- _$_.push_component();
37
+ return _$_.tsrx_element(() => {
38
+ const items = ['A', 'B', 'C'];
40
39
 
41
- const items = ['A', 'B', 'C'];
40
+ _$_.regular_block(() => {
41
+ _$_.output_push('<ul');
42
+ _$_.output_push('>');
42
43
 
43
- _$_.regular_block(() => {
44
- _$_.output_push('<ul');
45
- _$_.output_push('>');
44
+ {
45
+ _$_.output_push('<!--[-->');
46
46
 
47
- {
48
- _$_.output_push('<!--[-->');
47
+ var i = 0;
49
48
 
50
- var i = 0;
49
+ for (const item of items) {
50
+ _$_.output_push('<li');
51
+ _$_.output_push('>');
51
52
 
52
- for (const item of items) {
53
- _$_.output_push('<li');
54
- _$_.output_push('>');
53
+ {
54
+ _$_.output_push(_$_.escape(`${i}: ${item}`));
55
+ }
55
56
 
56
- {
57
- _$_.output_push(_$_.escape(`${i}: ${item}`));
57
+ _$_.output_push('</li>');
58
+ i++;
58
59
  }
59
60
 
60
- _$_.output_push('</li>');
61
- i++;
61
+ _$_.output_push('<!--]-->');
62
62
  }
63
63
 
64
- _$_.output_push('<!--]-->');
65
- }
66
-
67
- _$_.output_push('</ul>');
64
+ _$_.output_push('</ul>');
65
+ });
68
66
  });
69
-
70
- _$_.pop_component();
71
67
  }
72
68
 
73
69
  export function KeyedForLoop() {
74
- _$_.push_component();
70
+ return _$_.tsrx_element(() => {
71
+ const items = [
72
+ { id: 1, name: 'First' },
73
+ { id: 2, name: 'Second' },
74
+ { id: 3, name: 'Third' }
75
+ ];
75
76
 
76
- const items = [
77
- { id: 1, name: 'First' },
78
- { id: 2, name: 'Second' },
79
- { id: 3, name: 'Third' }
80
- ];
77
+ _$_.regular_block(() => {
78
+ _$_.output_push('<ul');
79
+ _$_.output_push('>');
81
80
 
82
- _$_.regular_block(() => {
83
- _$_.output_push('<ul');
84
- _$_.output_push('>');
81
+ {
82
+ _$_.output_push('<!--[-->');
85
83
 
86
- {
87
- _$_.output_push('<!--[-->');
84
+ for (const item of items) {
85
+ _$_.output_push('<li');
86
+ _$_.output_push('>');
88
87
 
89
- for (const item of items) {
90
- _$_.output_push('<li');
91
- _$_.output_push('>');
88
+ {
89
+ _$_.output_push(_$_.escape(item.name));
90
+ }
92
91
 
93
- {
94
- _$_.output_push(_$_.escape(item.name));
92
+ _$_.output_push('</li>');
95
93
  }
96
94
 
97
- _$_.output_push('</li>');
95
+ _$_.output_push('<!--]-->');
98
96
  }
99
97
 
100
- _$_.output_push('<!--]-->');
101
- }
102
-
103
- _$_.output_push('</ul>');
98
+ _$_.output_push('</ul>');
99
+ });
104
100
  });
105
-
106
- _$_.pop_component();
107
101
  }
108
102
 
109
103
  export function ReactiveForLoopAdd() {
110
- _$_.push_component();
104
+ return _$_.tsrx_element(() => {
105
+ let lazy = _$_.track(['A', 'B'], 'e145678a');
111
106
 
112
- let lazy = _$_.track(['A', 'B'], 'e145678a');
107
+ _$_.regular_block(() => {
108
+ _$_.output_push('<button');
109
+ _$_.output_push(' class="add"');
110
+ _$_.output_push('>');
113
111
 
114
- _$_.regular_block(() => {
115
- _$_.output_push('<button');
116
- _$_.output_push(' class="add"');
117
- _$_.output_push('>');
112
+ {
113
+ _$_.output_push('Add');
114
+ }
118
115
 
119
- {
120
- _$_.output_push('Add');
121
- }
116
+ _$_.output_push('</button>');
117
+ });
122
118
 
123
- _$_.output_push('</button>');
124
- });
119
+ _$_.regular_block(() => {
120
+ _$_.output_push('<ul');
121
+ _$_.output_push('>');
125
122
 
126
- _$_.regular_block(() => {
127
- _$_.output_push('<ul');
128
- _$_.output_push('>');
123
+ {
124
+ _$_.output_push('<!--[-->');
129
125
 
130
- {
131
- _$_.output_push('<!--[-->');
126
+ for (const item of lazy.value) {
127
+ _$_.output_push('<li');
128
+ _$_.output_push('>');
132
129
 
133
- for (const item of lazy.value) {
134
- _$_.output_push('<li');
135
- _$_.output_push('>');
130
+ {
131
+ _$_.output_push(_$_.escape(item));
132
+ }
136
133
 
137
- {
138
- _$_.output_push(_$_.escape(item));
134
+ _$_.output_push('</li>');
139
135
  }
140
136
 
141
- _$_.output_push('</li>');
137
+ _$_.output_push('<!--]-->');
142
138
  }
143
139
 
144
- _$_.output_push('<!--]-->');
145
- }
146
-
147
- _$_.output_push('</ul>');
140
+ _$_.output_push('</ul>');
141
+ });
148
142
  });
149
-
150
- _$_.pop_component();
151
143
  }
152
144
 
153
145
  export function ReactiveForLoopRemove() {
154
- _$_.push_component();
146
+ return _$_.tsrx_element(() => {
147
+ let lazy_1 = _$_.track(['A', 'B', 'C'], 'b4e9bd54');
155
148
 
156
- let lazy_1 = _$_.track(['A', 'B', 'C'], 'b4e9bd54');
149
+ _$_.regular_block(() => {
150
+ _$_.output_push('<button');
151
+ _$_.output_push(' class="remove"');
152
+ _$_.output_push('>');
157
153
 
158
- _$_.regular_block(() => {
159
- _$_.output_push('<button');
160
- _$_.output_push(' class="remove"');
161
- _$_.output_push('>');
154
+ {
155
+ _$_.output_push('Remove');
156
+ }
162
157
 
163
- {
164
- _$_.output_push('Remove');
165
- }
158
+ _$_.output_push('</button>');
159
+ });
166
160
 
167
- _$_.output_push('</button>');
168
- });
161
+ _$_.regular_block(() => {
162
+ _$_.output_push('<ul');
163
+ _$_.output_push('>');
169
164
 
170
- _$_.regular_block(() => {
171
- _$_.output_push('<ul');
172
- _$_.output_push('>');
165
+ {
166
+ _$_.output_push('<!--[-->');
173
167
 
174
- {
175
- _$_.output_push('<!--[-->');
168
+ for (const item of lazy_1.value) {
169
+ _$_.output_push('<li');
170
+ _$_.output_push('>');
176
171
 
177
- for (const item of lazy_1.value) {
178
- _$_.output_push('<li');
179
- _$_.output_push('>');
172
+ {
173
+ _$_.output_push(_$_.escape(item));
174
+ }
180
175
 
181
- {
182
- _$_.output_push(_$_.escape(item));
176
+ _$_.output_push('</li>');
183
177
  }
184
178
 
185
- _$_.output_push('</li>');
179
+ _$_.output_push('<!--]-->');
186
180
  }
187
181
 
188
- _$_.output_push('<!--]-->');
189
- }
190
-
191
- _$_.output_push('</ul>');
182
+ _$_.output_push('</ul>');
183
+ });
192
184
  });
193
-
194
- _$_.pop_component();
195
185
  }
196
186
 
197
187
  export function ForLoopInteractive() {
198
- _$_.push_component();
199
-
200
- let lazy_2 = _$_.track([0, 0, 0], '36f563df');
188
+ return _$_.tsrx_element(() => {
189
+ let lazy_2 = _$_.track([0, 0, 0], '36f563df');
201
190
 
202
- _$_.regular_block(() => {
203
- _$_.output_push('<div');
204
- _$_.output_push('>');
205
-
206
- {
207
- _$_.output_push('<!--[-->');
191
+ _$_.regular_block(() => {
192
+ _$_.output_push('<div');
193
+ _$_.output_push('>');
208
194
 
209
- var i = 0;
195
+ {
196
+ _$_.output_push('<!--[-->');
210
197
 
211
- for (const count of lazy_2.value) {
212
- _$_.output_push('<div');
213
- _$_.output_push(_$_.attr('class', `item-${i}`));
214
- _$_.output_push('>');
198
+ var i = 0;
215
199
 
216
- {
217
- _$_.output_push('<span');
218
- _$_.output_push(' class="value"');
200
+ for (const count of lazy_2.value) {
201
+ _$_.output_push('<div');
202
+ _$_.output_push(_$_.attr('class', `item-${i}`));
219
203
  _$_.output_push('>');
220
204
 
221
205
  {
222
- _$_.output_push(_$_.escape(count));
223
- }
206
+ _$_.output_push('<span');
207
+ _$_.output_push(' class="value"');
208
+ _$_.output_push('>');
224
209
 
225
- _$_.output_push('</span>');
226
- _$_.output_push('<button');
227
- _$_.output_push(' class="increment"');
228
- _$_.output_push('>');
210
+ {
211
+ _$_.output_push(_$_.escape(count));
212
+ }
229
213
 
230
- {
231
- _$_.output_push('+');
214
+ _$_.output_push('</span>');
215
+ _$_.output_push('<button');
216
+ _$_.output_push(' class="increment"');
217
+ _$_.output_push('>');
218
+
219
+ {
220
+ _$_.output_push('+');
221
+ }
222
+
223
+ _$_.output_push('</button>');
232
224
  }
233
225
 
234
- _$_.output_push('</button>');
226
+ _$_.output_push('</div>');
227
+ i++;
235
228
  }
236
229
 
237
- _$_.output_push('</div>');
238
- i++;
230
+ _$_.output_push('<!--]-->');
239
231
  }
240
232
 
241
- _$_.output_push('<!--]-->');
242
- }
243
-
244
- _$_.output_push('</div>');
233
+ _$_.output_push('</div>');
234
+ });
245
235
  });
246
-
247
- _$_.pop_component();
248
236
  }
249
237
 
250
238
  export function NestedForLoop() {
251
- _$_.push_component();
239
+ return _$_.tsrx_element(() => {
240
+ const grid = [[1, 2], [3, 4]];
252
241
 
253
- const grid = [[1, 2], [3, 4]];
242
+ _$_.regular_block(() => {
243
+ _$_.output_push('<div');
244
+ _$_.output_push(' class="grid"');
245
+ _$_.output_push('>');
254
246
 
255
- _$_.regular_block(() => {
256
- _$_.output_push('<div');
257
- _$_.output_push(' class="grid"');
258
- _$_.output_push('>');
247
+ {
248
+ _$_.output_push('<!--[-->');
259
249
 
260
- {
261
- _$_.output_push('<!--[-->');
250
+ var rowIndex = 0;
262
251
 
263
- var rowIndex = 0;
252
+ for (const row of grid) {
253
+ _$_.output_push('<div');
254
+ _$_.output_push(_$_.attr('class', `row-${rowIndex}`));
255
+ _$_.output_push('>');
264
256
 
265
- for (const row of grid) {
266
- _$_.output_push('<div');
267
- _$_.output_push(_$_.attr('class', `row-${rowIndex}`));
268
- _$_.output_push('>');
257
+ {
258
+ _$_.output_push('<!--[-->');
269
259
 
270
- {
271
- _$_.output_push('<!--[-->');
260
+ var colIndex = 0;
272
261
 
273
- var colIndex = 0;
262
+ for (const cell of row) {
263
+ _$_.output_push('<span');
264
+ _$_.output_push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
265
+ _$_.output_push('>');
274
266
 
275
- for (const cell of row) {
276
- _$_.output_push('<span');
277
- _$_.output_push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
278
- _$_.output_push('>');
267
+ {
268
+ _$_.output_push(_$_.escape(cell));
269
+ }
279
270
 
280
- {
281
- _$_.output_push(_$_.escape(cell));
271
+ _$_.output_push('</span>');
272
+ colIndex++;
282
273
  }
283
274
 
284
- _$_.output_push('</span>');
285
- colIndex++;
275
+ _$_.output_push('<!--]-->');
286
276
  }
287
277
 
288
- _$_.output_push('<!--]-->');
278
+ _$_.output_push('</div>');
279
+ rowIndex++;
289
280
  }
290
281
 
291
- _$_.output_push('</div>');
292
- rowIndex++;
282
+ _$_.output_push('<!--]-->');
293
283
  }
294
284
 
295
- _$_.output_push('<!--]-->');
296
- }
297
-
298
- _$_.output_push('</div>');
285
+ _$_.output_push('</div>');
286
+ });
299
287
  });
300
-
301
- _$_.pop_component();
302
288
  }
303
289
 
304
290
  export function EmptyForLoop() {
305
- _$_.push_component();
291
+ return _$_.tsrx_element(() => {
292
+ const items = [];
306
293
 
307
- const items = [];
294
+ _$_.regular_block(() => {
295
+ _$_.output_push('<div');
296
+ _$_.output_push(' class="container"');
297
+ _$_.output_push('>');
308
298
 
309
- _$_.regular_block(() => {
310
- _$_.output_push('<div');
311
- _$_.output_push(' class="container"');
312
- _$_.output_push('>');
299
+ {
300
+ _$_.output_push('<!--[-->');
313
301
 
314
- {
315
- _$_.output_push('<!--[-->');
302
+ for (const item of items) {
303
+ _$_.output_push('<span');
304
+ _$_.output_push('>');
316
305
 
317
- for (const item of items) {
318
- _$_.output_push('<span');
319
- _$_.output_push('>');
306
+ {
307
+ _$_.output_push(_$_.escape(item));
308
+ }
320
309
 
321
- {
322
- _$_.output_push(_$_.escape(item));
310
+ _$_.output_push('</span>');
323
311
  }
324
312
 
325
- _$_.output_push('</span>');
313
+ _$_.output_push('<!--]-->');
326
314
  }
327
315
 
328
- _$_.output_push('<!--]-->');
329
- }
330
-
331
- _$_.output_push('</div>');
316
+ _$_.output_push('</div>');
317
+ });
332
318
  });
333
-
334
- _$_.pop_component();
335
319
  }
336
320
 
337
321
  export function ForLoopComplexObjects() {
338
- _$_.push_component();
339
-
340
- const users = [
341
- { id: 1, name: 'Alice', role: 'Admin' },
342
- { id: 2, name: 'Bob', role: 'User' }
343
- ];
344
-
345
- _$_.regular_block(() => {
346
- _$_.output_push('<div');
347
- _$_.output_push('>');
348
-
349
- {
350
- _$_.output_push('<!--[-->');
322
+ return _$_.tsrx_element(() => {
323
+ const users = [
324
+ { id: 1, name: 'Alice', role: 'Admin' },
325
+ { id: 2, name: 'Bob', role: 'User' }
326
+ ];
327
+
328
+ _$_.regular_block(() => {
329
+ _$_.output_push('<div');
330
+ _$_.output_push('>');
351
331
 
352
- for (const user of users) {
353
- _$_.output_push('<div');
354
- _$_.output_push(_$_.attr('class', `user-${user.id}`));
355
- _$_.output_push('>');
332
+ {
333
+ _$_.output_push('<!--[-->');
356
334
 
357
- {
358
- _$_.output_push('<span');
359
- _$_.output_push(' class="name"');
335
+ for (const user of users) {
336
+ _$_.output_push('<div');
337
+ _$_.output_push(_$_.attr('class', `user-${user.id}`));
360
338
  _$_.output_push('>');
361
339
 
362
340
  {
363
- _$_.output_push(_$_.escape(user.name));
364
- }
341
+ _$_.output_push('<span');
342
+ _$_.output_push(' class="name"');
343
+ _$_.output_push('>');
365
344
 
366
- _$_.output_push('</span>');
367
- _$_.output_push('<span');
368
- _$_.output_push(' class="role"');
369
- _$_.output_push('>');
345
+ {
346
+ _$_.output_push(_$_.escape(user.name));
347
+ }
370
348
 
371
- {
372
- _$_.output_push(_$_.escape(user.role));
349
+ _$_.output_push('</span>');
350
+ _$_.output_push('<span');
351
+ _$_.output_push(' class="role"');
352
+ _$_.output_push('>');
353
+
354
+ {
355
+ _$_.output_push(_$_.escape(user.role));
356
+ }
357
+
358
+ _$_.output_push('</span>');
373
359
  }
374
360
 
375
- _$_.output_push('</span>');
361
+ _$_.output_push('</div>');
376
362
  }
377
363
 
378
- _$_.output_push('</div>');
364
+ _$_.output_push('<!--]-->');
379
365
  }
380
366
 
381
- _$_.output_push('<!--]-->');
382
- }
383
-
384
- _$_.output_push('</div>');
367
+ _$_.output_push('</div>');
368
+ });
385
369
  });
386
-
387
- _$_.pop_component();
388
370
  }
389
371
 
390
372
  export function KeyedForLoopReorder() {
391
- _$_.push_component();
392
-
393
- let lazy_3 = _$_.track(
394
- [
395
- { id: 1, name: 'First' },
396
- { id: 2, name: 'Second' },
397
- { id: 3, name: 'Third' }
398
- ],
399
- 'e7abc6a3'
400
- );
373
+ return _$_.tsrx_element(() => {
374
+ let lazy_3 = _$_.track(
375
+ [
376
+ { id: 1, name: 'First' },
377
+ { id: 2, name: 'Second' },
378
+ { id: 3, name: 'Third' }
379
+ ],
380
+ 'e7abc6a3'
381
+ );
382
+
383
+ _$_.regular_block(() => {
384
+ _$_.output_push('<button');
385
+ _$_.output_push(' class="reorder"');
386
+ _$_.output_push('>');
401
387
 
402
- _$_.regular_block(() => {
403
- _$_.output_push('<button');
404
- _$_.output_push(' class="reorder"');
405
- _$_.output_push('>');
388
+ {
389
+ _$_.output_push('Reorder');
390
+ }
406
391
 
407
- {
408
- _$_.output_push('Reorder');
409
- }
392
+ _$_.output_push('</button>');
393
+ });
410
394
 
411
- _$_.output_push('</button>');
412
- });
395
+ _$_.regular_block(() => {
396
+ _$_.output_push('<ul');
397
+ _$_.output_push('>');
413
398
 
414
- _$_.regular_block(() => {
415
- _$_.output_push('<ul');
416
- _$_.output_push('>');
399
+ {
400
+ _$_.output_push('<!--[-->');
417
401
 
418
- {
419
- _$_.output_push('<!--[-->');
402
+ for (const item of lazy_3.value) {
403
+ _$_.output_push('<li');
404
+ _$_.output_push(_$_.attr('class', `item-${item.id}`));
405
+ _$_.output_push('>');
420
406
 
421
- for (const item of lazy_3.value) {
422
- _$_.output_push('<li');
423
- _$_.output_push(_$_.attr('class', `item-${item.id}`));
424
- _$_.output_push('>');
407
+ {
408
+ _$_.output_push(_$_.escape(item.name));
409
+ }
425
410
 
426
- {
427
- _$_.output_push(_$_.escape(item.name));
411
+ _$_.output_push('</li>');
428
412
  }
429
413
 
430
- _$_.output_push('</li>');
414
+ _$_.output_push('<!--]-->');
431
415
  }
432
416
 
433
- _$_.output_push('<!--]-->');
434
- }
435
-
436
- _$_.output_push('</ul>');
417
+ _$_.output_push('</ul>');
418
+ });
437
419
  });
438
-
439
- _$_.pop_component();
440
420
  }
441
421
 
442
422
  export function KeyedForLoopUpdate() {
443
- _$_.push_component();
423
+ return _$_.tsrx_element(() => {
424
+ let lazy_4 = _$_.track([{ id: 1, name: 'Item 1' }, { id: 2, name: 'Item 2' }], '7a2c2ada');
444
425
 
445
- let lazy_4 = _$_.track([{ id: 1, name: 'Item 1' }, { id: 2, name: 'Item 2' }], '7a2c2ada');
426
+ _$_.regular_block(() => {
427
+ _$_.output_push('<button');
428
+ _$_.output_push(' class="update"');
429
+ _$_.output_push('>');
446
430
 
447
- _$_.regular_block(() => {
448
- _$_.output_push('<button');
449
- _$_.output_push(' class="update"');
450
- _$_.output_push('>');
431
+ {
432
+ _$_.output_push('Update');
433
+ }
451
434
 
452
- {
453
- _$_.output_push('Update');
454
- }
435
+ _$_.output_push('</button>');
436
+ });
455
437
 
456
- _$_.output_push('</button>');
457
- });
438
+ _$_.regular_block(() => {
439
+ _$_.output_push('<ul');
440
+ _$_.output_push('>');
458
441
 
459
- _$_.regular_block(() => {
460
- _$_.output_push('<ul');
461
- _$_.output_push('>');
442
+ {
443
+ _$_.output_push('<!--[-->');
462
444
 
463
- {
464
- _$_.output_push('<!--[-->');
445
+ for (const item of lazy_4.value) {
446
+ _$_.output_push('<li');
447
+ _$_.output_push(_$_.attr('class', `item-${item.id}`));
448
+ _$_.output_push('>');
465
449
 
466
- for (const item of lazy_4.value) {
467
- _$_.output_push('<li');
468
- _$_.output_push(_$_.attr('class', `item-${item.id}`));
469
- _$_.output_push('>');
450
+ {
451
+ _$_.output_push(_$_.escape(item.name));
452
+ }
470
453
 
471
- {
472
- _$_.output_push(_$_.escape(item.name));
454
+ _$_.output_push('</li>');
473
455
  }
474
456
 
475
- _$_.output_push('</li>');
457
+ _$_.output_push('<!--]-->');
476
458
  }
477
459
 
478
- _$_.output_push('<!--]-->');
479
- }
480
-
481
- _$_.output_push('</ul>');
460
+ _$_.output_push('</ul>');
461
+ });
482
462
  });
483
-
484
- _$_.pop_component();
485
463
  }
486
464
 
487
465
  export function ForLoopMixedOperations() {
488
- _$_.push_component();
466
+ return _$_.tsrx_element(() => {
467
+ let lazy_5 = _$_.track(['A', 'B', 'C', 'D'], '3dd7c7b6');
489
468
 
490
- let lazy_5 = _$_.track(['A', 'B', 'C', 'D'], '3dd7c7b6');
469
+ _$_.regular_block(() => {
470
+ _$_.output_push('<button');
471
+ _$_.output_push(' class="shuffle"');
472
+ _$_.output_push('>');
491
473
 
492
- _$_.regular_block(() => {
493
- _$_.output_push('<button');
494
- _$_.output_push(' class="shuffle"');
495
- _$_.output_push('>');
474
+ {
475
+ _$_.output_push('Shuffle');
476
+ }
496
477
 
497
- {
498
- _$_.output_push('Shuffle');
499
- }
478
+ _$_.output_push('</button>');
479
+ });
500
480
 
501
- _$_.output_push('</button>');
502
- });
481
+ _$_.regular_block(() => {
482
+ _$_.output_push('<ul');
483
+ _$_.output_push('>');
503
484
 
504
- _$_.regular_block(() => {
505
- _$_.output_push('<ul');
506
- _$_.output_push('>');
485
+ {
486
+ _$_.output_push('<!--[-->');
507
487
 
508
- {
509
- _$_.output_push('<!--[-->');
488
+ for (const item of lazy_5.value) {
489
+ _$_.output_push('<li');
490
+ _$_.output_push(_$_.attr('class', `item-${item}`));
491
+ _$_.output_push('>');
510
492
 
511
- for (const item of lazy_5.value) {
512
- _$_.output_push('<li');
513
- _$_.output_push(_$_.attr('class', `item-${item}`));
514
- _$_.output_push('>');
493
+ {
494
+ _$_.output_push(_$_.escape(item));
495
+ }
515
496
 
516
- {
517
- _$_.output_push(_$_.escape(item));
497
+ _$_.output_push('</li>');
518
498
  }
519
499
 
520
- _$_.output_push('</li>');
500
+ _$_.output_push('<!--]-->');
521
501
  }
522
502
 
523
- _$_.output_push('<!--]-->');
524
- }
525
-
526
- _$_.output_push('</ul>');
503
+ _$_.output_push('</ul>');
504
+ });
527
505
  });
528
-
529
- _$_.pop_component();
530
506
  }
531
507
 
532
508
  export function ForLoopInsideIf() {
533
- _$_.push_component();
509
+ return _$_.tsrx_element(() => {
510
+ let lazy_6 = _$_.track(true, '0528df30');
511
+ let lazy_7 = _$_.track(['X', 'Y', 'Z'], 'bf375103');
534
512
 
535
- let lazy_6 = _$_.track(true, '0528df30');
536
- let lazy_7 = _$_.track(['X', 'Y', 'Z'], 'bf375103');
513
+ _$_.regular_block(() => {
514
+ _$_.output_push('<button');
515
+ _$_.output_push(' class="toggle"');
516
+ _$_.output_push('>');
537
517
 
538
- _$_.regular_block(() => {
539
- _$_.output_push('<button');
540
- _$_.output_push(' class="toggle"');
541
- _$_.output_push('>');
518
+ {
519
+ _$_.output_push('Toggle List');
520
+ }
542
521
 
543
- {
544
- _$_.output_push('Toggle List');
545
- }
522
+ _$_.output_push('</button>');
523
+ });
546
524
 
547
- _$_.output_push('</button>');
548
- });
525
+ _$_.regular_block(() => {
526
+ _$_.output_push('<button');
527
+ _$_.output_push(' class="add"');
528
+ _$_.output_push('>');
549
529
 
550
- _$_.regular_block(() => {
551
- _$_.output_push('<button');
552
- _$_.output_push(' class="add"');
553
- _$_.output_push('>');
530
+ {
531
+ _$_.output_push('Add Item');
532
+ }
554
533
 
555
- {
556
- _$_.output_push('Add Item');
557
- }
534
+ _$_.output_push('</button>');
535
+ });
558
536
 
559
- _$_.output_push('</button>');
560
- });
537
+ _$_.regular_block(() => {
538
+ _$_.output_push('<!--[-->');
561
539
 
562
- _$_.regular_block(() => {
563
- _$_.output_push('<!--[-->');
540
+ if (lazy_6.value) {
541
+ _$_.output_push('<ul');
542
+ _$_.output_push(' class="list"');
543
+ _$_.output_push('>');
564
544
 
565
- if (lazy_6.value) {
566
- _$_.output_push('<ul');
567
- _$_.output_push(' class="list"');
568
- _$_.output_push('>');
545
+ {
546
+ _$_.output_push('<!--[-->');
569
547
 
570
- {
571
- _$_.output_push('<!--[-->');
548
+ for (const item of lazy_7.value) {
549
+ _$_.output_push('<li');
550
+ _$_.output_push('>');
572
551
 
573
- for (const item of lazy_7.value) {
574
- _$_.output_push('<li');
575
- _$_.output_push('>');
552
+ {
553
+ _$_.output_push(_$_.escape(item));
554
+ }
576
555
 
577
- {
578
- _$_.output_push(_$_.escape(item));
556
+ _$_.output_push('</li>');
579
557
  }
580
558
 
581
- _$_.output_push('</li>');
559
+ _$_.output_push('<!--]-->');
582
560
  }
583
561
 
584
- _$_.output_push('<!--]-->');
562
+ _$_.output_push('</ul>');
585
563
  }
586
564
 
587
- _$_.output_push('</ul>');
588
- }
589
-
590
- _$_.output_push('<!--]-->');
565
+ _$_.output_push('<!--]-->');
566
+ });
591
567
  });
592
-
593
- _$_.pop_component();
594
568
  }
595
569
 
596
570
  export function ForLoopEmptyToPopulated() {
597
- _$_.push_component();
571
+ return _$_.tsrx_element(() => {
572
+ let lazy_8 = _$_.track([], '525c5dbc');
598
573
 
599
- let lazy_8 = _$_.track([], '525c5dbc');
574
+ _$_.regular_block(() => {
575
+ _$_.output_push('<button');
576
+ _$_.output_push(' class="populate"');
577
+ _$_.output_push('>');
600
578
 
601
- _$_.regular_block(() => {
602
- _$_.output_push('<button');
603
- _$_.output_push(' class="populate"');
604
- _$_.output_push('>');
579
+ {
580
+ _$_.output_push('Populate');
581
+ }
605
582
 
606
- {
607
- _$_.output_push('Populate');
608
- }
583
+ _$_.output_push('</button>');
584
+ });
609
585
 
610
- _$_.output_push('</button>');
611
- });
586
+ _$_.regular_block(() => {
587
+ _$_.output_push('<ul');
588
+ _$_.output_push(' class="list"');
589
+ _$_.output_push('>');
612
590
 
613
- _$_.regular_block(() => {
614
- _$_.output_push('<ul');
615
- _$_.output_push(' class="list"');
616
- _$_.output_push('>');
591
+ {
592
+ _$_.output_push('<!--[-->');
617
593
 
618
- {
619
- _$_.output_push('<!--[-->');
594
+ for (const item of lazy_8.value) {
595
+ _$_.output_push('<li');
596
+ _$_.output_push('>');
620
597
 
621
- for (const item of lazy_8.value) {
622
- _$_.output_push('<li');
623
- _$_.output_push('>');
598
+ {
599
+ _$_.output_push(_$_.escape(item));
600
+ }
624
601
 
625
- {
626
- _$_.output_push(_$_.escape(item));
602
+ _$_.output_push('</li>');
627
603
  }
628
604
 
629
- _$_.output_push('</li>');
605
+ _$_.output_push('<!--]-->');
630
606
  }
631
607
 
632
- _$_.output_push('<!--]-->');
633
- }
634
-
635
- _$_.output_push('</ul>');
608
+ _$_.output_push('</ul>');
609
+ });
636
610
  });
637
-
638
- _$_.pop_component();
639
611
  }
640
612
 
641
613
  export function ForLoopPopulatedToEmpty() {
642
- _$_.push_component();
614
+ return _$_.tsrx_element(() => {
615
+ let lazy_9 = _$_.track(['One', 'Two', 'Three'], 'ee47f078');
643
616
 
644
- let lazy_9 = _$_.track(['One', 'Two', 'Three'], 'ee47f078');
617
+ _$_.regular_block(() => {
618
+ _$_.output_push('<button');
619
+ _$_.output_push(' class="clear"');
620
+ _$_.output_push('>');
645
621
 
646
- _$_.regular_block(() => {
647
- _$_.output_push('<button');
648
- _$_.output_push(' class="clear"');
649
- _$_.output_push('>');
622
+ {
623
+ _$_.output_push('Clear');
624
+ }
650
625
 
651
- {
652
- _$_.output_push('Clear');
653
- }
626
+ _$_.output_push('</button>');
627
+ });
654
628
 
655
- _$_.output_push('</button>');
656
- });
629
+ _$_.regular_block(() => {
630
+ _$_.output_push('<ul');
631
+ _$_.output_push(' class="list"');
632
+ _$_.output_push('>');
657
633
 
658
- _$_.regular_block(() => {
659
- _$_.output_push('<ul');
660
- _$_.output_push(' class="list"');
661
- _$_.output_push('>');
634
+ {
635
+ _$_.output_push('<!--[-->');
662
636
 
663
- {
664
- _$_.output_push('<!--[-->');
637
+ for (const item of lazy_9.value) {
638
+ _$_.output_push('<li');
639
+ _$_.output_push('>');
665
640
 
666
- for (const item of lazy_9.value) {
667
- _$_.output_push('<li');
668
- _$_.output_push('>');
641
+ {
642
+ _$_.output_push(_$_.escape(item));
643
+ }
669
644
 
670
- {
671
- _$_.output_push(_$_.escape(item));
645
+ _$_.output_push('</li>');
672
646
  }
673
647
 
674
- _$_.output_push('</li>');
648
+ _$_.output_push('<!--]-->');
675
649
  }
676
650
 
677
- _$_.output_push('<!--]-->');
678
- }
679
-
680
- _$_.output_push('</ul>');
651
+ _$_.output_push('</ul>');
652
+ });
681
653
  });
682
-
683
- _$_.pop_component();
684
654
  }
685
655
 
686
656
  export function NestedForLoopReactive() {
687
- _$_.push_component();
657
+ return _$_.tsrx_element(() => {
658
+ let lazy_10 = _$_.track([[1, 2], [3, 4]], 'a2f41fb3');
688
659
 
689
- let lazy_10 = _$_.track([[1, 2], [3, 4]], 'a2f41fb3');
660
+ _$_.regular_block(() => {
661
+ _$_.output_push('<button');
662
+ _$_.output_push(' class="add-row"');
663
+ _$_.output_push('>');
690
664
 
691
- _$_.regular_block(() => {
692
- _$_.output_push('<button');
693
- _$_.output_push(' class="add-row"');
694
- _$_.output_push('>');
665
+ {
666
+ _$_.output_push('Add Row');
667
+ }
695
668
 
696
- {
697
- _$_.output_push('Add Row');
698
- }
669
+ _$_.output_push('</button>');
670
+ });
699
671
 
700
- _$_.output_push('</button>');
701
- });
672
+ _$_.regular_block(() => {
673
+ _$_.output_push('<button');
674
+ _$_.output_push(' class="update-cell"');
675
+ _$_.output_push('>');
702
676
 
703
- _$_.regular_block(() => {
704
- _$_.output_push('<button');
705
- _$_.output_push(' class="update-cell"');
706
- _$_.output_push('>');
677
+ {
678
+ _$_.output_push('Update Cell');
679
+ }
707
680
 
708
- {
709
- _$_.output_push('Update Cell');
710
- }
681
+ _$_.output_push('</button>');
682
+ });
711
683
 
712
- _$_.output_push('</button>');
713
- });
684
+ _$_.regular_block(() => {
685
+ _$_.output_push('<div');
686
+ _$_.output_push(' class="grid"');
687
+ _$_.output_push('>');
714
688
 
715
- _$_.regular_block(() => {
716
- _$_.output_push('<div');
717
- _$_.output_push(' class="grid"');
718
- _$_.output_push('>');
689
+ {
690
+ _$_.output_push('<!--[-->');
719
691
 
720
- {
721
- _$_.output_push('<!--[-->');
692
+ var rowIndex = 0;
722
693
 
723
- var rowIndex = 0;
694
+ for (const row of lazy_10.value) {
695
+ _$_.output_push('<div');
696
+ _$_.output_push(_$_.attr('class', `row-${rowIndex}`));
697
+ _$_.output_push('>');
724
698
 
725
- for (const row of lazy_10.value) {
726
- _$_.output_push('<div');
727
- _$_.output_push(_$_.attr('class', `row-${rowIndex}`));
728
- _$_.output_push('>');
699
+ {
700
+ _$_.output_push('<!--[-->');
729
701
 
730
- {
731
- _$_.output_push('<!--[-->');
702
+ var colIndex = 0;
732
703
 
733
- var colIndex = 0;
704
+ for (const cell of row) {
705
+ _$_.output_push('<span');
706
+ _$_.output_push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
707
+ _$_.output_push('>');
734
708
 
735
- for (const cell of row) {
736
- _$_.output_push('<span');
737
- _$_.output_push(_$_.attr('class', `cell-${rowIndex}-${colIndex}`));
738
- _$_.output_push('>');
709
+ {
710
+ _$_.output_push(_$_.escape(cell));
711
+ }
739
712
 
740
- {
741
- _$_.output_push(_$_.escape(cell));
713
+ _$_.output_push('</span>');
714
+ colIndex++;
742
715
  }
743
716
 
744
- _$_.output_push('</span>');
745
- colIndex++;
717
+ _$_.output_push('<!--]-->');
746
718
  }
747
719
 
748
- _$_.output_push('<!--]-->');
720
+ _$_.output_push('</div>');
721
+ rowIndex++;
749
722
  }
750
723
 
751
- _$_.output_push('</div>');
752
- rowIndex++;
724
+ _$_.output_push('<!--]-->');
753
725
  }
754
726
 
755
- _$_.output_push('<!--]-->');
756
- }
757
-
758
- _$_.output_push('</div>');
727
+ _$_.output_push('</div>');
728
+ });
759
729
  });
760
-
761
- _$_.pop_component();
762
730
  }
763
731
 
764
732
  export function ForLoopDeeplyNested() {
765
- _$_.push_component();
766
-
767
- const departments = [
768
- {
769
- id: 'd1',
770
- name: 'Engineering',
771
- teams: [
772
- { id: 't1', name: 'Frontend', members: ['Alice', 'Bob'] },
773
- { id: 't2', name: 'Backend', members: ['Charlie'] }
774
- ]
775
- },
776
-
777
- {
778
- id: 'd2',
779
- name: 'Design',
780
- teams: [{ id: 't3', name: 'UX', members: ['Diana', 'Eve', 'Frank'] }]
781
- }
782
- ];
783
-
784
- _$_.regular_block(() => {
785
- _$_.output_push('<div');
786
- _$_.output_push(' class="org"');
787
- _$_.output_push('>');
788
-
789
- {
790
- _$_.output_push('<!--[-->');
733
+ return _$_.tsrx_element(() => {
734
+ const departments = [
735
+ {
736
+ id: 'd1',
737
+ name: 'Engineering',
738
+ teams: [
739
+ { id: 't1', name: 'Frontend', members: ['Alice', 'Bob'] },
740
+ { id: 't2', name: 'Backend', members: ['Charlie'] }
741
+ ]
742
+ },
791
743
 
792
- for (const dept of departments) {
793
- _$_.output_push('<div');
794
- _$_.output_push(_$_.attr('class', `dept-${dept.id}`));
795
- _$_.output_push('>');
744
+ {
745
+ id: 'd2',
746
+ name: 'Design',
747
+ teams: [{ id: 't3', name: 'UX', members: ['Diana', 'Eve', 'Frank'] }]
748
+ }
749
+ ];
796
750
 
797
- {
798
- _$_.output_push('<h2');
799
- _$_.output_push(' class="dept-name"');
800
- _$_.output_push('>');
751
+ _$_.regular_block(() => {
752
+ _$_.output_push('<div');
753
+ _$_.output_push(' class="org"');
754
+ _$_.output_push('>');
801
755
 
802
- {
803
- _$_.output_push(_$_.escape(dept.name));
804
- }
756
+ {
757
+ _$_.output_push('<!--[-->');
805
758
 
806
- _$_.output_push('</h2>');
807
- _$_.output_push('<!--[-->');
759
+ for (const dept of departments) {
760
+ _$_.output_push('<div');
761
+ _$_.output_push(_$_.attr('class', `dept-${dept.id}`));
762
+ _$_.output_push('>');
808
763
 
809
- for (const team of dept.teams) {
810
- _$_.output_push('<div');
811
- _$_.output_push(_$_.attr('class', `team-${team.id}`));
764
+ {
765
+ _$_.output_push('<h2');
766
+ _$_.output_push(' class="dept-name"');
812
767
  _$_.output_push('>');
813
768
 
814
769
  {
815
- _$_.output_push('<h3');
816
- _$_.output_push(' class="team-name"');
817
- _$_.output_push('>');
770
+ _$_.output_push(_$_.escape(dept.name));
771
+ }
818
772
 
819
- {
820
- _$_.output_push(_$_.escape(team.name));
821
- }
773
+ _$_.output_push('</h2>');
774
+ _$_.output_push('<!--[-->');
822
775
 
823
- _$_.output_push('</h3>');
824
- _$_.output_push('<ul');
776
+ for (const team of dept.teams) {
777
+ _$_.output_push('<div');
778
+ _$_.output_push(_$_.attr('class', `team-${team.id}`));
825
779
  _$_.output_push('>');
826
780
 
827
781
  {
828
- _$_.output_push('<!--[-->');
782
+ _$_.output_push('<h3');
783
+ _$_.output_push(' class="team-name"');
784
+ _$_.output_push('>');
785
+
786
+ {
787
+ _$_.output_push(_$_.escape(team.name));
788
+ }
789
+
790
+ _$_.output_push('</h3>');
791
+ _$_.output_push('<ul');
792
+ _$_.output_push('>');
829
793
 
830
- for (const member of team.members) {
831
- _$_.output_push('<li');
832
- _$_.output_push(' class="member"');
833
- _$_.output_push('>');
794
+ {
795
+ _$_.output_push('<!--[-->');
834
796
 
835
- {
836
- _$_.output_push(_$_.escape(member));
797
+ for (const member of team.members) {
798
+ _$_.output_push('<li');
799
+ _$_.output_push(' class="member"');
800
+ _$_.output_push('>');
801
+
802
+ {
803
+ _$_.output_push(_$_.escape(member));
804
+ }
805
+
806
+ _$_.output_push('</li>');
837
807
  }
838
808
 
839
- _$_.output_push('</li>');
809
+ _$_.output_push('<!--]-->');
840
810
  }
841
811
 
842
- _$_.output_push('<!--]-->');
812
+ _$_.output_push('</ul>');
843
813
  }
844
814
 
845
- _$_.output_push('</ul>');
815
+ _$_.output_push('</div>');
846
816
  }
847
817
 
848
- _$_.output_push('</div>');
818
+ _$_.output_push('<!--]-->');
849
819
  }
850
820
 
851
- _$_.output_push('<!--]-->');
821
+ _$_.output_push('</div>');
852
822
  }
853
823
 
854
- _$_.output_push('</div>');
824
+ _$_.output_push('<!--]-->');
855
825
  }
856
826
 
857
- _$_.output_push('<!--]-->');
858
- }
859
-
860
- _$_.output_push('</div>');
827
+ _$_.output_push('</div>');
828
+ });
861
829
  });
862
-
863
- _$_.pop_component();
864
830
  }
865
831
 
866
832
  export function ForLoopIndexUpdate() {
867
- _$_.push_component();
833
+ return _$_.tsrx_element(() => {
834
+ let lazy_11 = _$_.track(['First', 'Second', 'Third'], 'f61e31e6');
868
835
 
869
- let lazy_11 = _$_.track(['First', 'Second', 'Third'], 'f61e31e6');
836
+ _$_.regular_block(() => {
837
+ _$_.output_push('<button');
838
+ _$_.output_push(' class="prepend"');
839
+ _$_.output_push('>');
870
840
 
871
- _$_.regular_block(() => {
872
- _$_.output_push('<button');
873
- _$_.output_push(' class="prepend"');
874
- _$_.output_push('>');
841
+ {
842
+ _$_.output_push('Prepend');
843
+ }
875
844
 
876
- {
877
- _$_.output_push('Prepend');
878
- }
845
+ _$_.output_push('</button>');
846
+ });
879
847
 
880
- _$_.output_push('</button>');
881
- });
848
+ _$_.regular_block(() => {
849
+ _$_.output_push('<ul');
850
+ _$_.output_push('>');
882
851
 
883
- _$_.regular_block(() => {
884
- _$_.output_push('<ul');
885
- _$_.output_push('>');
852
+ {
853
+ _$_.output_push('<!--[-->');
886
854
 
887
- {
888
- _$_.output_push('<!--[-->');
855
+ var i = 0;
889
856
 
890
- var i = 0;
857
+ for (const item of lazy_11.value) {
858
+ _$_.output_push('<li');
859
+ _$_.output_push(_$_.attr('class', `item-${i}`));
860
+ _$_.output_push('>');
891
861
 
892
- for (const item of lazy_11.value) {
893
- _$_.output_push('<li');
894
- _$_.output_push(_$_.attr('class', `item-${i}`));
895
- _$_.output_push('>');
862
+ {
863
+ _$_.output_push(_$_.escape(`[${i}] ${item}`));
864
+ }
896
865
 
897
- {
898
- _$_.output_push(_$_.escape(`[${i}] ${item}`));
866
+ _$_.output_push('</li>');
867
+ i++;
899
868
  }
900
869
 
901
- _$_.output_push('</li>');
902
- i++;
870
+ _$_.output_push('<!--]-->');
903
871
  }
904
872
 
905
- _$_.output_push('<!--]-->');
906
- }
907
-
908
- _$_.output_push('</ul>');
873
+ _$_.output_push('</ul>');
874
+ });
909
875
  });
910
-
911
- _$_.pop_component();
912
876
  }
913
877
 
914
878
  export function KeyedForLoopWithIndex() {
915
- _$_.push_component();
916
-
917
- let lazy_12 = _$_.track(
918
- [
919
- { id: 'a', value: 'Alpha' },
920
- { id: 'b', value: 'Beta' },
921
- { id: 'c', value: 'Gamma' }
922
- ],
923
- '3467975a'
924
- );
925
-
926
- _$_.regular_block(() => {
927
- _$_.output_push('<button');
928
- _$_.output_push(' class="reorder"');
929
- _$_.output_push('>');
930
-
931
- {
932
- _$_.output_push('Rotate');
933
- }
934
-
935
- _$_.output_push('</button>');
936
- });
879
+ return _$_.tsrx_element(() => {
880
+ let lazy_12 = _$_.track(
881
+ [
882
+ { id: 'a', value: 'Alpha' },
883
+ { id: 'b', value: 'Beta' },
884
+ { id: 'c', value: 'Gamma' }
885
+ ],
886
+ '3467975a'
887
+ );
888
+
889
+ _$_.regular_block(() => {
890
+ _$_.output_push('<button');
891
+ _$_.output_push(' class="reorder"');
892
+ _$_.output_push('>');
893
+
894
+ {
895
+ _$_.output_push('Rotate');
896
+ }
937
897
 
938
- _$_.regular_block(() => {
939
- _$_.output_push('<ul');
940
- _$_.output_push('>');
898
+ _$_.output_push('</button>');
899
+ });
941
900
 
942
- {
943
- _$_.output_push('<!--[-->');
901
+ _$_.regular_block(() => {
902
+ _$_.output_push('<ul');
903
+ _$_.output_push('>');
944
904
 
945
- var i = 0;
905
+ {
906
+ _$_.output_push('<!--[-->');
946
907
 
947
- for (const item of lazy_12.value) {
948
- _$_.output_push('<li');
949
- _$_.output_push(_$_.attr('data-index', i, false));
950
- _$_.output_push(_$_.attr('class', `item-${item.id}`));
951
- _$_.output_push('>');
908
+ var i = 0;
952
909
 
953
- {
954
- _$_.output_push(_$_.escape(`[${i}] ${item.id}: ${item.value}`));
910
+ for (const item of lazy_12.value) {
911
+ _$_.output_push('<li');
912
+ _$_.output_push(_$_.attr('data-index', i, false));
913
+ _$_.output_push(_$_.attr('class', `item-${item.id}`));
914
+ _$_.output_push('>');
915
+
916
+ {
917
+ _$_.output_push(_$_.escape(`[${i}] ${item.id}: ${item.value}`));
918
+ }
919
+
920
+ _$_.output_push('</li>');
921
+ i++;
955
922
  }
956
923
 
957
- _$_.output_push('</li>');
958
- i++;
924
+ _$_.output_push('<!--]-->');
959
925
  }
960
926
 
961
- _$_.output_push('<!--]-->');
962
- }
963
-
964
- _$_.output_push('</ul>');
927
+ _$_.output_push('</ul>');
928
+ });
965
929
  });
966
-
967
- _$_.pop_component();
968
930
  }
969
931
 
970
932
  export function ForLoopWithSiblings() {
971
- _$_.push_component();
933
+ return _$_.tsrx_element(() => {
934
+ let lazy_13 = _$_.track(['A', 'B'], '3c7e8152');
972
935
 
973
- let lazy_13 = _$_.track(['A', 'B'], '3c7e8152');
974
-
975
- _$_.regular_block(() => {
976
- _$_.output_push('<div');
977
- _$_.output_push(' class="wrapper"');
978
- _$_.output_push('>');
979
-
980
- {
981
- _$_.output_push('<header');
982
- _$_.output_push(' class="before"');
936
+ _$_.regular_block(() => {
937
+ _$_.output_push('<div');
938
+ _$_.output_push(' class="wrapper"');
983
939
  _$_.output_push('>');
984
940
 
985
941
  {
986
- _$_.output_push('Before');
987
- }
942
+ _$_.output_push('<header');
943
+ _$_.output_push(' class="before"');
944
+ _$_.output_push('>');
988
945
 
989
- _$_.output_push('</header>');
990
- _$_.output_push('<!--[-->');
946
+ {
947
+ _$_.output_push('Before');
948
+ }
949
+
950
+ _$_.output_push('</header>');
951
+ _$_.output_push('<!--[-->');
952
+
953
+ for (const item of lazy_13.value) {
954
+ _$_.output_push('<div');
955
+ _$_.output_push(_$_.attr('class', `item-${item}`));
956
+ _$_.output_push('>');
957
+
958
+ {
959
+ _$_.output_push(_$_.escape(item));
960
+ }
961
+
962
+ _$_.output_push('</div>');
963
+ }
991
964
 
992
- for (const item of lazy_13.value) {
993
- _$_.output_push('<div');
994
- _$_.output_push(_$_.attr('class', `item-${item}`));
965
+ _$_.output_push('<!--]-->');
966
+ _$_.output_push('<footer');
967
+ _$_.output_push(' class="after"');
995
968
  _$_.output_push('>');
996
969
 
997
970
  {
998
- _$_.output_push(_$_.escape(item));
971
+ _$_.output_push('After');
999
972
  }
1000
973
 
1001
- _$_.output_push('</div>');
974
+ _$_.output_push('</footer>');
1002
975
  }
1003
976
 
1004
- _$_.output_push('<!--]-->');
1005
- _$_.output_push('<footer');
1006
- _$_.output_push(' class="after"');
977
+ _$_.output_push('</div>');
978
+ });
979
+
980
+ _$_.regular_block(() => {
981
+ _$_.output_push('<button');
982
+ _$_.output_push(' class="add"');
1007
983
  _$_.output_push('>');
1008
984
 
1009
985
  {
1010
- _$_.output_push('After');
986
+ _$_.output_push('Add');
1011
987
  }
1012
988
 
1013
- _$_.output_push('</footer>');
1014
- }
1015
-
1016
- _$_.output_push('</div>');
1017
- });
1018
-
1019
- _$_.regular_block(() => {
1020
- _$_.output_push('<button');
1021
- _$_.output_push(' class="add"');
1022
- _$_.output_push('>');
1023
-
1024
- {
1025
- _$_.output_push('Add');
1026
- }
1027
-
1028
- _$_.output_push('</button>');
989
+ _$_.output_push('</button>');
990
+ });
1029
991
  });
1030
-
1031
- _$_.pop_component();
1032
992
  }
1033
993
 
1034
994
  export function ForLoopItemState() {
1035
- _$_.push_component();
1036
-
1037
- const initialItems = [
1038
- { id: 1, text: 'Todo 1' },
1039
- { id: 2, text: 'Todo 2' },
1040
- { id: 3, text: 'Todo 3' }
1041
- ];
1042
-
1043
- _$_.regular_block(() => {
1044
- _$_.output_push('<div');
1045
- _$_.output_push('>');
995
+ return _$_.tsrx_element(() => {
996
+ const initialItems = [
997
+ { id: 1, text: 'Todo 1' },
998
+ { id: 2, text: 'Todo 2' },
999
+ { id: 3, text: 'Todo 3' }
1000
+ ];
1001
+
1002
+ _$_.regular_block(() => {
1003
+ _$_.output_push('<div');
1004
+ _$_.output_push('>');
1046
1005
 
1047
- {
1048
- _$_.output_push('<!--[-->');
1006
+ {
1007
+ _$_.output_push('<!--[-->');
1049
1008
 
1050
- for (const item of initialItems) {
1051
- {
1052
- const comp = TodoItem;
1053
- const args = [{ id: item.id, text: item.text }];
1009
+ for (const item of initialItems) {
1010
+ {
1011
+ const comp = TodoItem;
1012
+ const args = [{ id: item.id, text: item.text }];
1054
1013
 
1055
- comp(...args);
1014
+ _$_.render_component(comp, ...args);
1015
+ }
1056
1016
  }
1057
- }
1058
1017
 
1059
- _$_.output_push('<!--]-->');
1060
- }
1018
+ _$_.output_push('<!--]-->');
1019
+ }
1061
1020
 
1062
- _$_.output_push('</div>');
1021
+ _$_.output_push('</div>');
1022
+ });
1063
1023
  });
1064
-
1065
- _$_.pop_component();
1066
1024
  }
1067
1025
 
1068
1026
  function TodoItem(props) {
1069
- _$_.push_component();
1070
-
1071
- let lazy_14 = _$_.track(false, '4f2402a4');
1072
-
1073
- _$_.regular_block(() => {
1074
- _$_.output_push('<div');
1075
- _$_.output_push(_$_.attr('class', `todo-${props.id}`));
1076
- _$_.output_push('>');
1077
-
1078
- {
1079
- _$_.output_push('<input');
1080
- _$_.output_push(' type="checkbox"');
1081
- _$_.output_push(_$_.attr('checked', lazy_14.value, true));
1082
- _$_.output_push(' class="checkbox"');
1083
- _$_.output_push(' />');
1084
- _$_.output_push('<span');
1085
- _$_.output_push(_$_.attr('class', lazy_14.value ? 'completed' : 'pending'));
1027
+ return _$_.tsrx_element(() => {
1028
+ let lazy_14 = _$_.track(false, '4f2402a4');
1029
+
1030
+ _$_.regular_block(() => {
1031
+ _$_.output_push('<div');
1032
+ _$_.output_push(_$_.attr('class', `todo-${props.id}`));
1086
1033
  _$_.output_push('>');
1087
1034
 
1088
1035
  {
1089
- _$_.output_push(_$_.escape(props.text));
1090
- }
1036
+ _$_.output_push('<input');
1037
+ _$_.output_push(' type="checkbox"');
1038
+ _$_.output_push(_$_.attr('checked', lazy_14.value, true));
1039
+ _$_.output_push(' class="checkbox"');
1040
+ _$_.output_push(' />');
1041
+ _$_.output_push('<span');
1042
+ _$_.output_push(_$_.attr('class', lazy_14.value ? 'completed' : 'pending'));
1043
+ _$_.output_push('>');
1091
1044
 
1092
- _$_.output_push('</span>');
1093
- }
1045
+ {
1046
+ _$_.output_push(_$_.escape(props.text));
1047
+ }
1094
1048
 
1095
- _$_.output_push('</div>');
1096
- });
1049
+ _$_.output_push('</span>');
1050
+ }
1097
1051
 
1098
- _$_.pop_component();
1052
+ _$_.output_push('</div>');
1053
+ });
1054
+ });
1099
1055
  }
1100
1056
 
1101
1057
  export function ForLoopSingleItem() {
1102
- _$_.push_component();
1058
+ return _$_.tsrx_element(() => {
1059
+ const items = ['Only'];
1103
1060
 
1104
- const items = ['Only'];
1061
+ _$_.regular_block(() => {
1062
+ _$_.output_push('<ul');
1063
+ _$_.output_push('>');
1105
1064
 
1106
- _$_.regular_block(() => {
1107
- _$_.output_push('<ul');
1108
- _$_.output_push('>');
1065
+ {
1066
+ _$_.output_push('<!--[-->');
1109
1067
 
1110
- {
1111
- _$_.output_push('<!--[-->');
1068
+ for (const item of items) {
1069
+ _$_.output_push('<li');
1070
+ _$_.output_push(' class="single"');
1071
+ _$_.output_push('>');
1112
1072
 
1113
- for (const item of items) {
1114
- _$_.output_push('<li');
1115
- _$_.output_push(' class="single"');
1116
- _$_.output_push('>');
1073
+ {
1074
+ _$_.output_push(_$_.escape(item));
1075
+ }
1117
1076
 
1118
- {
1119
- _$_.output_push(_$_.escape(item));
1077
+ _$_.output_push('</li>');
1120
1078
  }
1121
1079
 
1122
- _$_.output_push('</li>');
1080
+ _$_.output_push('<!--]-->');
1123
1081
  }
1124
1082
 
1125
- _$_.output_push('<!--]-->');
1126
- }
1127
-
1128
- _$_.output_push('</ul>');
1083
+ _$_.output_push('</ul>');
1084
+ });
1129
1085
  });
1130
-
1131
- _$_.pop_component();
1132
1086
  }
1133
1087
 
1134
1088
  export function ForLoopAddAtBeginning() {
1135
- _$_.push_component();
1089
+ return _$_.tsrx_element(() => {
1090
+ let lazy_15 = _$_.track(['B', 'C'], '1561403a');
1136
1091
 
1137
- let lazy_15 = _$_.track(['B', 'C'], '1561403a');
1092
+ _$_.regular_block(() => {
1093
+ _$_.output_push('<button');
1094
+ _$_.output_push(' class="prepend"');
1095
+ _$_.output_push('>');
1138
1096
 
1139
- _$_.regular_block(() => {
1140
- _$_.output_push('<button');
1141
- _$_.output_push(' class="prepend"');
1142
- _$_.output_push('>');
1097
+ {
1098
+ _$_.output_push('Prepend A');
1099
+ }
1143
1100
 
1144
- {
1145
- _$_.output_push('Prepend A');
1146
- }
1101
+ _$_.output_push('</button>');
1102
+ });
1147
1103
 
1148
- _$_.output_push('</button>');
1149
- });
1104
+ _$_.regular_block(() => {
1105
+ _$_.output_push('<ul');
1106
+ _$_.output_push('>');
1150
1107
 
1151
- _$_.regular_block(() => {
1152
- _$_.output_push('<ul');
1153
- _$_.output_push('>');
1108
+ {
1109
+ _$_.output_push('<!--[-->');
1154
1110
 
1155
- {
1156
- _$_.output_push('<!--[-->');
1111
+ for (const item of lazy_15.value) {
1112
+ _$_.output_push('<li');
1113
+ _$_.output_push(_$_.attr('class', `item-${item}`));
1114
+ _$_.output_push('>');
1157
1115
 
1158
- for (const item of lazy_15.value) {
1159
- _$_.output_push('<li');
1160
- _$_.output_push(_$_.attr('class', `item-${item}`));
1161
- _$_.output_push('>');
1116
+ {
1117
+ _$_.output_push(_$_.escape(item));
1118
+ }
1162
1119
 
1163
- {
1164
- _$_.output_push(_$_.escape(item));
1120
+ _$_.output_push('</li>');
1165
1121
  }
1166
1122
 
1167
- _$_.output_push('</li>');
1123
+ _$_.output_push('<!--]-->');
1168
1124
  }
1169
1125
 
1170
- _$_.output_push('<!--]-->');
1171
- }
1172
-
1173
- _$_.output_push('</ul>');
1126
+ _$_.output_push('</ul>');
1127
+ });
1174
1128
  });
1175
-
1176
- _$_.pop_component();
1177
1129
  }
1178
1130
 
1179
1131
  export function ForLoopAddInMiddle() {
1180
- _$_.push_component();
1132
+ return _$_.tsrx_element(() => {
1133
+ let lazy_16 = _$_.track(['A', 'C'], '1bc60b46');
1181
1134
 
1182
- let lazy_16 = _$_.track(['A', 'C'], '1bc60b46');
1135
+ _$_.regular_block(() => {
1136
+ _$_.output_push('<button');
1137
+ _$_.output_push(' class="insert"');
1138
+ _$_.output_push('>');
1183
1139
 
1184
- _$_.regular_block(() => {
1185
- _$_.output_push('<button');
1186
- _$_.output_push(' class="insert"');
1187
- _$_.output_push('>');
1140
+ {
1141
+ _$_.output_push('Insert B');
1142
+ }
1188
1143
 
1189
- {
1190
- _$_.output_push('Insert B');
1191
- }
1144
+ _$_.output_push('</button>');
1145
+ });
1192
1146
 
1193
- _$_.output_push('</button>');
1194
- });
1147
+ _$_.regular_block(() => {
1148
+ _$_.output_push('<ul');
1149
+ _$_.output_push('>');
1195
1150
 
1196
- _$_.regular_block(() => {
1197
- _$_.output_push('<ul');
1198
- _$_.output_push('>');
1151
+ {
1152
+ _$_.output_push('<!--[-->');
1199
1153
 
1200
- {
1201
- _$_.output_push('<!--[-->');
1154
+ for (const item of lazy_16.value) {
1155
+ _$_.output_push('<li');
1156
+ _$_.output_push(_$_.attr('class', `item-${item}`));
1157
+ _$_.output_push('>');
1202
1158
 
1203
- for (const item of lazy_16.value) {
1204
- _$_.output_push('<li');
1205
- _$_.output_push(_$_.attr('class', `item-${item}`));
1206
- _$_.output_push('>');
1159
+ {
1160
+ _$_.output_push(_$_.escape(item));
1161
+ }
1207
1162
 
1208
- {
1209
- _$_.output_push(_$_.escape(item));
1163
+ _$_.output_push('</li>');
1210
1164
  }
1211
1165
 
1212
- _$_.output_push('</li>');
1166
+ _$_.output_push('<!--]-->');
1213
1167
  }
1214
1168
 
1215
- _$_.output_push('<!--]-->');
1216
- }
1217
-
1218
- _$_.output_push('</ul>');
1169
+ _$_.output_push('</ul>');
1170
+ });
1219
1171
  });
1220
-
1221
- _$_.pop_component();
1222
1172
  }
1223
1173
 
1224
1174
  export function ForLoopRemoveFromMiddle() {
1225
- _$_.push_component();
1175
+ return _$_.tsrx_element(() => {
1176
+ let lazy_17 = _$_.track(['A', 'B', 'C'], '1c87f95f');
1226
1177
 
1227
- let lazy_17 = _$_.track(['A', 'B', 'C'], '1c87f95f');
1178
+ _$_.regular_block(() => {
1179
+ _$_.output_push('<button');
1180
+ _$_.output_push(' class="remove-middle"');
1181
+ _$_.output_push('>');
1228
1182
 
1229
- _$_.regular_block(() => {
1230
- _$_.output_push('<button');
1231
- _$_.output_push(' class="remove-middle"');
1232
- _$_.output_push('>');
1183
+ {
1184
+ _$_.output_push('Remove B');
1185
+ }
1233
1186
 
1234
- {
1235
- _$_.output_push('Remove B');
1236
- }
1187
+ _$_.output_push('</button>');
1188
+ });
1237
1189
 
1238
- _$_.output_push('</button>');
1239
- });
1190
+ _$_.regular_block(() => {
1191
+ _$_.output_push('<ul');
1192
+ _$_.output_push('>');
1240
1193
 
1241
- _$_.regular_block(() => {
1242
- _$_.output_push('<ul');
1243
- _$_.output_push('>');
1194
+ {
1195
+ _$_.output_push('<!--[-->');
1244
1196
 
1245
- {
1246
- _$_.output_push('<!--[-->');
1197
+ for (const item of lazy_17.value) {
1198
+ _$_.output_push('<li');
1199
+ _$_.output_push(_$_.attr('class', `item-${item}`));
1200
+ _$_.output_push('>');
1247
1201
 
1248
- for (const item of lazy_17.value) {
1249
- _$_.output_push('<li');
1250
- _$_.output_push(_$_.attr('class', `item-${item}`));
1251
- _$_.output_push('>');
1202
+ {
1203
+ _$_.output_push(_$_.escape(item));
1204
+ }
1252
1205
 
1253
- {
1254
- _$_.output_push(_$_.escape(item));
1206
+ _$_.output_push('</li>');
1255
1207
  }
1256
1208
 
1257
- _$_.output_push('</li>');
1209
+ _$_.output_push('<!--]-->');
1258
1210
  }
1259
1211
 
1260
- _$_.output_push('<!--]-->');
1261
- }
1262
-
1263
- _$_.output_push('</ul>');
1212
+ _$_.output_push('</ul>');
1213
+ });
1264
1214
  });
1265
-
1266
- _$_.pop_component();
1267
1215
  }
1268
1216
 
1269
1217
  export function ForLoopLargeList() {
1270
- _$_.push_component();
1218
+ return _$_.tsrx_element(() => {
1219
+ const items = Array.from({ length: 50 }, (_, i) => `Item ${i + 1}`);
1271
1220
 
1272
- const items = Array.from({ length: 50 }, (_, i) => `Item ${i + 1}`);
1221
+ _$_.regular_block(() => {
1222
+ _$_.output_push('<ul');
1223
+ _$_.output_push(' class="large-list"');
1224
+ _$_.output_push('>');
1273
1225
 
1274
- _$_.regular_block(() => {
1275
- _$_.output_push('<ul');
1276
- _$_.output_push(' class="large-list"');
1277
- _$_.output_push('>');
1226
+ {
1227
+ _$_.output_push('<!--[-->');
1278
1228
 
1279
- {
1280
- _$_.output_push('<!--[-->');
1229
+ var i = 0;
1281
1230
 
1282
- var i = 0;
1231
+ for (const item of items) {
1232
+ _$_.output_push('<li');
1233
+ _$_.output_push(_$_.attr('class', `item-${i}`));
1234
+ _$_.output_push('>');
1283
1235
 
1284
- for (const item of items) {
1285
- _$_.output_push('<li');
1286
- _$_.output_push(_$_.attr('class', `item-${i}`));
1287
- _$_.output_push('>');
1236
+ {
1237
+ _$_.output_push(_$_.escape(item));
1238
+ }
1288
1239
 
1289
- {
1290
- _$_.output_push(_$_.escape(item));
1240
+ _$_.output_push('</li>');
1241
+ i++;
1291
1242
  }
1292
1243
 
1293
- _$_.output_push('</li>');
1294
- i++;
1244
+ _$_.output_push('<!--]-->');
1295
1245
  }
1296
1246
 
1297
- _$_.output_push('<!--]-->');
1298
- }
1299
-
1300
- _$_.output_push('</ul>');
1247
+ _$_.output_push('</ul>');
1248
+ });
1301
1249
  });
1302
-
1303
- _$_.pop_component();
1304
1250
  }
1305
1251
 
1306
1252
  export function ForLoopSwap() {
1307
- _$_.push_component();
1253
+ return _$_.tsrx_element(() => {
1254
+ let lazy_18 = _$_.track(['A', 'B', 'C', 'D'], '5f8d152f');
1308
1255
 
1309
- let lazy_18 = _$_.track(['A', 'B', 'C', 'D'], '5f8d152f');
1256
+ _$_.regular_block(() => {
1257
+ _$_.output_push('<button');
1258
+ _$_.output_push(' class="swap"');
1259
+ _$_.output_push('>');
1310
1260
 
1311
- _$_.regular_block(() => {
1312
- _$_.output_push('<button');
1313
- _$_.output_push(' class="swap"');
1314
- _$_.output_push('>');
1261
+ {
1262
+ _$_.output_push('Swap First and Last');
1263
+ }
1315
1264
 
1316
- {
1317
- _$_.output_push('Swap First and Last');
1318
- }
1265
+ _$_.output_push('</button>');
1266
+ });
1319
1267
 
1320
- _$_.output_push('</button>');
1321
- });
1268
+ _$_.regular_block(() => {
1269
+ _$_.output_push('<ul');
1270
+ _$_.output_push('>');
1322
1271
 
1323
- _$_.regular_block(() => {
1324
- _$_.output_push('<ul');
1325
- _$_.output_push('>');
1272
+ {
1273
+ _$_.output_push('<!--[-->');
1326
1274
 
1327
- {
1328
- _$_.output_push('<!--[-->');
1275
+ for (const item of lazy_18.value) {
1276
+ _$_.output_push('<li');
1277
+ _$_.output_push(_$_.attr('class', `item-${item}`));
1278
+ _$_.output_push('>');
1329
1279
 
1330
- for (const item of lazy_18.value) {
1331
- _$_.output_push('<li');
1332
- _$_.output_push(_$_.attr('class', `item-${item}`));
1333
- _$_.output_push('>');
1280
+ {
1281
+ _$_.output_push(_$_.escape(item));
1282
+ }
1334
1283
 
1335
- {
1336
- _$_.output_push(_$_.escape(item));
1284
+ _$_.output_push('</li>');
1337
1285
  }
1338
1286
 
1339
- _$_.output_push('</li>');
1287
+ _$_.output_push('<!--]-->');
1340
1288
  }
1341
1289
 
1342
- _$_.output_push('<!--]-->');
1343
- }
1344
-
1345
- _$_.output_push('</ul>');
1290
+ _$_.output_push('</ul>');
1291
+ });
1346
1292
  });
1347
-
1348
- _$_.pop_component();
1349
1293
  }
1350
1294
 
1351
1295
  export function ForLoopReverse() {
1352
- _$_.push_component();
1296
+ return _$_.tsrx_element(() => {
1297
+ let lazy_19 = _$_.track(['A', 'B', 'C', 'D'], '24602e64');
1353
1298
 
1354
- let lazy_19 = _$_.track(['A', 'B', 'C', 'D'], '24602e64');
1299
+ _$_.regular_block(() => {
1300
+ _$_.output_push('<button');
1301
+ _$_.output_push(' class="reverse"');
1302
+ _$_.output_push('>');
1355
1303
 
1356
- _$_.regular_block(() => {
1357
- _$_.output_push('<button');
1358
- _$_.output_push(' class="reverse"');
1359
- _$_.output_push('>');
1304
+ {
1305
+ _$_.output_push('Reverse');
1306
+ }
1360
1307
 
1361
- {
1362
- _$_.output_push('Reverse');
1363
- }
1308
+ _$_.output_push('</button>');
1309
+ });
1364
1310
 
1365
- _$_.output_push('</button>');
1366
- });
1311
+ _$_.regular_block(() => {
1312
+ _$_.output_push('<ul');
1313
+ _$_.output_push('>');
1367
1314
 
1368
- _$_.regular_block(() => {
1369
- _$_.output_push('<ul');
1370
- _$_.output_push('>');
1315
+ {
1316
+ _$_.output_push('<!--[-->');
1371
1317
 
1372
- {
1373
- _$_.output_push('<!--[-->');
1318
+ for (const item of lazy_19.value) {
1319
+ _$_.output_push('<li');
1320
+ _$_.output_push(_$_.attr('class', `item-${item}`));
1321
+ _$_.output_push('>');
1374
1322
 
1375
- for (const item of lazy_19.value) {
1376
- _$_.output_push('<li');
1377
- _$_.output_push(_$_.attr('class', `item-${item}`));
1378
- _$_.output_push('>');
1323
+ {
1324
+ _$_.output_push(_$_.escape(item));
1325
+ }
1379
1326
 
1380
- {
1381
- _$_.output_push(_$_.escape(item));
1327
+ _$_.output_push('</li>');
1382
1328
  }
1383
1329
 
1384
- _$_.output_push('</li>');
1330
+ _$_.output_push('<!--]-->');
1385
1331
  }
1386
1332
 
1387
- _$_.output_push('<!--]-->');
1388
- }
1389
-
1390
- _$_.output_push('</ul>');
1333
+ _$_.output_push('</ul>');
1334
+ });
1391
1335
  });
1392
-
1393
- _$_.pop_component();
1394
1336
  }