ripple 0.3.127 → 0.4.0

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 (192) hide show
  1. package/CHANGELOG.md +293 -0
  2. package/package.json +10 -4
  3. package/src/runtime/element.js +23 -6
  4. package/src/runtime/index-client.js +81 -41
  5. package/src/runtime/index-server.js +1 -0
  6. package/src/runtime/internal/client/blocks.js +192 -114
  7. package/src/runtime/internal/client/component.js +4 -30
  8. package/src/runtime/internal/client/composite.js +12 -13
  9. package/src/runtime/internal/client/constants.js +14 -5
  10. package/src/runtime/internal/client/context.js +12 -19
  11. package/src/runtime/internal/client/css.js +7 -9
  12. package/src/runtime/internal/client/events.js +178 -90
  13. package/src/runtime/internal/client/expression.js +185 -124
  14. package/src/runtime/internal/client/for.js +616 -264
  15. package/src/runtime/internal/client/head.js +10 -5
  16. package/src/runtime/internal/client/html.js +1 -0
  17. package/src/runtime/internal/client/hydration.js +152 -10
  18. package/src/runtime/internal/client/if.js +239 -50
  19. package/src/runtime/internal/client/index.js +9 -13
  20. package/src/runtime/internal/client/operations.js +44 -51
  21. package/src/runtime/internal/client/portal.js +163 -85
  22. package/src/runtime/internal/client/render.js +44 -25
  23. package/src/runtime/internal/client/rpc.js +3 -3
  24. package/src/runtime/internal/client/runtime.js +799 -576
  25. package/src/runtime/internal/client/selector.js +77 -0
  26. package/src/runtime/internal/client/template.js +133 -158
  27. package/src/runtime/internal/client/transport.js +38 -0
  28. package/src/runtime/internal/client/try.js +465 -426
  29. package/src/runtime/internal/client/types.d.ts +65 -21
  30. package/src/runtime/internal/client/utils.js +1 -3
  31. package/src/runtime/internal/server/dynamic.js +20 -21
  32. package/src/runtime/internal/server/index.js +327 -275
  33. package/src/runtime/internal/server/rpc.js +3 -2
  34. package/src/runtime/internal/server/transport.js +16 -0
  35. package/src/runtime/transport.js +21 -0
  36. package/tests/client/__snapshots__/for.test.tsrx.snap +0 -5
  37. package/tests/client/array/array.copy-within.test.tsrx +12 -12
  38. package/tests/client/array/array.derived.test.tsrx +46 -46
  39. package/tests/client/array/array.iteration.test.tsrx +10 -10
  40. package/tests/client/array/array.mutations.test.tsrx +20 -20
  41. package/tests/client/array/array.static.test.tsrx +11 -11
  42. package/tests/client/array/array.to-methods.test.tsrx +6 -6
  43. package/tests/client/async-suspend.test.tsrx +74 -75
  44. package/tests/client/basic/basic.attributes.test.tsrx +86 -83
  45. package/tests/client/basic/basic.collections.test.tsrx +12 -12
  46. package/tests/client/basic/basic.components.test.tsrx +99 -25
  47. package/tests/client/basic/basic.errors.test.tsrx +18 -18
  48. package/tests/client/basic/basic.events.test.tsrx +42 -42
  49. package/tests/client/basic/basic.get-set.test.tsrx +8 -8
  50. package/tests/client/basic/basic.reactivity.test.tsrx +97 -29
  51. package/tests/client/basic/basic.rendering.test.tsrx +25 -25
  52. package/tests/client/basic/basic.utilities.test.tsrx +3 -3
  53. package/tests/client/boundaries.test.tsrx +8 -8
  54. package/tests/client/boxed-locals.test.tsrx +452 -0
  55. package/tests/client/compiler/__snapshots__/compiler.assignments.test.tsrx.snap +6 -6
  56. package/tests/client/compiler/compiler.assignments.test.tsrx +9 -73
  57. package/tests/client/compiler/compiler.attributes.test.tsrx +23 -23
  58. package/tests/client/compiler/compiler.basic.test.tsrx +15 -60
  59. package/tests/client/compiler/compiler.tracked-access.test.tsrx +18 -43
  60. package/tests/client/compiler/compiler.try-in-function.test.tsrx +2 -2
  61. package/tests/client/composite/__snapshots__/composite.render.test.tsrx.snap +0 -1
  62. package/tests/client/composite/composite.dynamic-components.test.tsrx +77 -6
  63. package/tests/client/composite/composite.props.test.tsrx +149 -12
  64. package/tests/client/composite/composite.reactivity.test.tsrx +51 -52
  65. package/tests/client/composite/composite.render.test.tsrx +26 -9
  66. package/tests/client/css/scoped-styles.test.tsrx +8 -8
  67. package/tests/client/date.test.tsrx +42 -42
  68. package/tests/client/derived-release.test.tsrx +370 -0
  69. package/tests/client/dynamic-elements.test.tsrx +45 -45
  70. package/tests/client/events.test.tsrx +97 -71
  71. package/tests/client/for-selector.test.tsrx +221 -0
  72. package/tests/client/for-single-root-items.test.tsrx +118 -3
  73. package/tests/client/for.test.tsrx +332 -31
  74. package/tests/client/head.test.tsrx +19 -19
  75. package/tests/client/html.test.tsrx +11 -9
  76. package/tests/client/if-block.test.tsrx +80 -0
  77. package/tests/client/map.test.tsrx +16 -16
  78. package/tests/client/media-query.test.tsrx +7 -7
  79. package/tests/client/portal.test.tsrx +224 -26
  80. package/tests/client/primitive-text.test.tsrx +50 -0
  81. package/tests/client/prop-kind-switch.test.tsrx +141 -0
  82. package/tests/client/ref.test.tsrx +17 -17
  83. package/tests/client/return.test.tsrx +26 -3
  84. package/tests/client/root-boundary.test.tsrx +42 -0
  85. package/tests/client/scoped-flush.test.tsrx +8 -8
  86. package/tests/client/set.test.tsrx +6 -6
  87. package/tests/client/svg.test.tsrx +11 -11
  88. package/tests/client/switch.test.tsrx +44 -44
  89. package/tests/client/track-async-hydration.test.tsrx +4 -4
  90. package/tests/client/try.test.tsrx +151 -83
  91. package/tests/client/tsx.test.tsrx +43 -40
  92. package/tests/client/url/url.derived.test.tsrx +6 -6
  93. package/tests/client/url-search-params/url-search-params.derived.test.tsrx +8 -8
  94. package/tests/client/url-search-params/url-search-params.iteration.test.tsrx +10 -10
  95. package/tests/client/url-search-params/url-search-params.mutation.test.tsrx +10 -10
  96. package/tests/client/url-search-params/url-search-params.retrieval.test.tsrx +18 -18
  97. package/tests/client/url-search-params/url-search-params.serialization.test.tsrx +2 -2
  98. package/tests/hydration/basic.test.js +74 -1
  99. package/tests/hydration/build-components.js +22 -1
  100. package/tests/hydration/compiled/client/basic.js +1142 -713
  101. package/tests/hydration/compiled/client/composite.js +151 -100
  102. package/tests/hydration/compiled/client/events.js +190 -150
  103. package/tests/hydration/compiled/client/for.js +1472 -1126
  104. package/tests/hydration/compiled/client/fragment-cursor.js +2341 -0
  105. package/tests/hydration/compiled/client/head.js +255 -199
  106. package/tests/hydration/compiled/client/hmr.js +54 -41
  107. package/tests/hydration/compiled/client/html-in-template.js +54 -39
  108. package/tests/hydration/compiled/client/html.js +1633 -1263
  109. package/tests/hydration/compiled/client/if-children.js +420 -270
  110. package/tests/hydration/compiled/client/if-fragment-controlflow.js +363 -317
  111. package/tests/hydration/compiled/client/if.js +229 -219
  112. package/tests/hydration/compiled/client/mixed-control-flow.js +420 -400
  113. package/tests/hydration/compiled/client/nested-control-flow.js +1326 -1255
  114. package/tests/hydration/compiled/client/portal.js +87 -95
  115. package/tests/hydration/compiled/client/reactivity.js +140 -83
  116. package/tests/hydration/compiled/client/return.js +28 -19
  117. package/tests/hydration/compiled/client/streaming.js +390 -306
  118. package/tests/hydration/compiled/client/switch.js +258 -266
  119. package/tests/hydration/compiled/client/track-async-serialization.js +448 -280
  120. package/tests/hydration/compiled/client/try.js +173 -129
  121. package/tests/hydration/compiled/client/typed-text.js +71 -0
  122. package/tests/hydration/compiled/fixtures/money.js +10 -0
  123. package/tests/hydration/compiled/server/basic.js +123 -6
  124. package/tests/hydration/compiled/server/composite.js +16 -30
  125. package/tests/hydration/compiled/server/events.js +19 -19
  126. package/tests/hydration/compiled/server/for.js +109 -49
  127. package/tests/hydration/compiled/server/fragment-cursor.js +1687 -0
  128. package/tests/hydration/compiled/server/head.js +20 -28
  129. package/tests/hydration/compiled/server/hmr.js +2 -2
  130. package/tests/hydration/compiled/server/html.js +71 -247
  131. package/tests/hydration/compiled/server/if-children.js +107 -15
  132. package/tests/hydration/compiled/server/if.js +11 -15
  133. package/tests/hydration/compiled/server/mixed-control-flow.js +8 -8
  134. package/tests/hydration/compiled/server/portal.js +14 -22
  135. package/tests/hydration/compiled/server/reactivity.js +14 -46
  136. package/tests/hydration/compiled/server/streaming.js +19 -19
  137. package/tests/hydration/compiled/server/switch.js +8 -8
  138. package/tests/hydration/compiled/server/track-async-serialization.js +150 -23
  139. package/tests/hydration/compiled/server/try.js +8 -8
  140. package/tests/hydration/compiled/server/typed-text.js +17 -0
  141. package/tests/hydration/components/basic.tsrx +44 -8
  142. package/tests/hydration/components/composite.tsrx +2 -2
  143. package/tests/hydration/components/events.tsrx +25 -25
  144. package/tests/hydration/components/for.tsrx +115 -67
  145. package/tests/hydration/components/fragment-cursor.tsrx +650 -0
  146. package/tests/hydration/components/head.tsrx +16 -16
  147. package/tests/hydration/components/hmr.tsrx +2 -2
  148. package/tests/hydration/components/html.tsrx +7 -7
  149. package/tests/hydration/components/if-children.tsrx +72 -25
  150. package/tests/hydration/components/if.tsrx +18 -18
  151. package/tests/hydration/components/mixed-control-flow.tsrx +11 -11
  152. package/tests/hydration/components/portal.tsrx +3 -3
  153. package/tests/hydration/components/reactivity.tsrx +16 -16
  154. package/tests/hydration/components/streaming.tsrx +20 -20
  155. package/tests/hydration/components/switch.tsrx +20 -20
  156. package/tests/hydration/components/text-types.ts +4 -0
  157. package/tests/hydration/components/track-async-serialization.tsrx +80 -26
  158. package/tests/hydration/components/try.tsrx +8 -8
  159. package/tests/hydration/components/typed-text.tsrx +22 -0
  160. package/tests/hydration/fixtures/money.js +10 -0
  161. package/tests/hydration/for.test.js +36 -0
  162. package/tests/hydration/fragment-cursor.test.js +111 -0
  163. package/tests/hydration/if-children.test.js +24 -0
  164. package/tests/hydration/streaming.test.js +19 -0
  165. package/tests/hydration/track-async-serialization.test.js +87 -2
  166. package/tests/hydration/tsconfig.text-types.json +10 -0
  167. package/tests/hydration/typed-text.test.js +34 -0
  168. package/tests/server/await.test.tsrx +3 -3
  169. package/tests/server/basic.attributes.test.tsrx +42 -42
  170. package/tests/server/basic.components.test.tsrx +64 -8
  171. package/tests/server/basic.test.tsrx +34 -32
  172. package/tests/server/compiler.test.tsrx +1 -70
  173. package/tests/server/composite.props.test.tsrx +6 -6
  174. package/tests/server/dynamic-elements.test.tsrx +31 -8
  175. package/tests/server/for.test.tsrx +94 -0
  176. package/tests/server/head.test.tsrx +11 -11
  177. package/tests/server/scoped-styles.test.tsrx +2 -2
  178. package/tests/server/streaming-ssr.test.tsrx +48 -43
  179. package/tests/server/track-async-serialization.test.tsrx +204 -21
  180. package/tests/server/try.test.tsrx +48 -48
  181. package/tests/types/transport.ts +40 -0
  182. package/tests/utils/vite-plugin-config.test.js +23 -0
  183. package/types/index.d.ts +48 -7
  184. package/types/server.d.ts +3 -0
  185. package/types/transport.d.ts +15 -0
  186. package/src/runtime/internal/client/switch.js +0 -113
  187. package/src/utils/errors.js +0 -13
  188. package/tests/client/lazy-array.test.tsrx +0 -31
  189. package/tests/client/lazy-destructuring.test.tsrx +0 -438
  190. package/tests/client/tracked-index-access.test.tsrx +0 -113
  191. package/tests/server/lazy-destructuring.test.tsrx +0 -595
  192. package/tests/server/tracked-index-access.test.tsrx +0 -76
@@ -23,7 +23,7 @@ export function StaticTitle() {
23
23
 
24
24
  export function ReactiveTitle() {
25
25
  return _$_.tsrx_element(() => {
26
- let lazy = _$_.track('Initial Title', 'cbca63e3');
26
+ const title = _$_.track('Initial Title', 'cbca63e3');
27
27
 
28
28
  _$_.regular_block(() => {
29
29
  let __out = '';
@@ -33,14 +33,14 @@ export function ReactiveTitle() {
33
33
  {
34
34
  _$_.output_push(__out);
35
35
  __out = '';
36
- _$_.render_expression(lazy.value);
36
+ _$_.render_expression(title.value);
37
37
  }
38
38
 
39
39
  __out += '</span></div>';
40
40
  _$_.output_push(__out);
41
41
  __out = '';
42
42
  _$_.set_output_target('head');
43
- __out += '<!--91435bee--><title>' + _$_.escape(lazy.value) + '</title>';
43
+ __out += '<!--56ee4dab--><title>' + _$_.escape(title.value) + '</title>';
44
44
  _$_.output_push(__out);
45
45
  __out = '';
46
46
  _$_.set_output_target(null);
@@ -58,7 +58,7 @@ export function MultipleHeadElements() {
58
58
  _$_.output_push(__out);
59
59
  __out = '';
60
60
  _$_.set_output_target('head');
61
- __out += '<!--07a54928--><title>Page Title</title><meta name="description" content="Page description" /><link rel="stylesheet" href="/styles.css" />';
61
+ __out += '<!--a718096c--><title>Page Title</title><meta name="description" content="Page description" /><link rel="stylesheet" href="/styles.css" />';
62
62
  _$_.output_push(__out);
63
63
  __out = '';
64
64
  _$_.set_output_target(null);
@@ -69,7 +69,7 @@ export function MultipleHeadElements() {
69
69
 
70
70
  export function ReactiveMetaTags() {
71
71
  return _$_.tsrx_element(() => {
72
- let lazy_1 = _$_.track('Initial description', '38bfa3b2');
72
+ const description = _$_.track('Initial description', '38bfa3b2');
73
73
 
74
74
  _$_.regular_block(() => {
75
75
  let __out = '';
@@ -79,14 +79,14 @@ export function ReactiveMetaTags() {
79
79
  {
80
80
  _$_.output_push(__out);
81
81
  __out = '';
82
- _$_.render_expression(lazy_1.value);
82
+ _$_.render_expression(description.value);
83
83
  }
84
84
 
85
85
  __out += '</div>';
86
86
  _$_.output_push(__out);
87
87
  __out = '';
88
88
  _$_.set_output_target('head');
89
- __out += '<!--4ca6a546--><title>My Page</title><meta name="description"' + _$_.attr('content', lazy_1.value, false) + ' />';
89
+ __out += '<!--c297b350--><title>My Page</title><meta name="description"' + _$_.attr('content', description.value, false) + ' />';
90
90
  _$_.output_push(__out);
91
91
  __out = '';
92
92
  _$_.set_output_target(null);
@@ -97,7 +97,7 @@ export function ReactiveMetaTags() {
97
97
 
98
98
  export function TitleWithTemplate() {
99
99
  return _$_.tsrx_element(() => {
100
- let lazy_2 = _$_.track('World', 'f3925cd5');
100
+ const name = _$_.track('World', 'f3925cd5');
101
101
 
102
102
  _$_.regular_block(() => {
103
103
  let __out = '';
@@ -107,14 +107,14 @@ export function TitleWithTemplate() {
107
107
  {
108
108
  _$_.output_push(__out);
109
109
  __out = '';
110
- _$_.render_expression(lazy_2.value);
110
+ _$_.render_expression(name.value);
111
111
  }
112
112
 
113
113
  __out += '</div>';
114
114
  _$_.output_push(__out);
115
115
  __out = '';
116
116
  _$_.set_output_target('head');
117
- __out += '<!--10dc944d--><title>' + _$_.escape(`Hello ${lazy_2.value}!`) + '</title>';
117
+ __out += '<!--9ab2373c--><title>' + _$_.escape(`Hello ${name.value}!`) + '</title>';
118
118
  _$_.output_push(__out);
119
119
  __out = '';
120
120
  _$_.set_output_target(null);
@@ -132,7 +132,7 @@ export function EmptyTitle() {
132
132
  _$_.output_push(__out);
133
133
  __out = '';
134
134
  _$_.set_output_target('head');
135
- __out += '<!--13ba9873--><title></title>';
135
+ __out += '<!--50cc7ae2--><title></title>';
136
136
  _$_.output_push(__out);
137
137
  __out = '';
138
138
  _$_.set_output_target(null);
@@ -143,8 +143,8 @@ export function EmptyTitle() {
143
143
 
144
144
  export function ConditionalTitle() {
145
145
  return _$_.tsrx_element(() => {
146
- let lazy_3 = _$_.track(true, 'ff71bf1f');
147
- let lazy_4 = _$_.track('Main Page', '7cd7d671');
146
+ const showPrefix = _$_.track(true, 'ff71bf1f');
147
+ const title = _$_.track('Main Page', '7cd7d671');
148
148
 
149
149
  _$_.regular_block(() => {
150
150
  let __out = '';
@@ -154,14 +154,14 @@ export function ConditionalTitle() {
154
154
  {
155
155
  _$_.output_push(__out);
156
156
  __out = '';
157
- _$_.render_expression(lazy_4.value);
157
+ _$_.render_expression(title.value);
158
158
  }
159
159
 
160
160
  __out += '</div>';
161
161
  _$_.output_push(__out);
162
162
  __out = '';
163
163
  _$_.set_output_target('head');
164
- __out += '<!--4b39c36b--><title>' + _$_.escape(lazy_3.value ? 'App - ' + lazy_4.value : lazy_4.value) + '</title>';
164
+ __out += '<!--0877ba8e--><title>' + _$_.escape(showPrefix.value ? 'App - ' + title.value : title.value) + '</title>';
165
165
  _$_.output_push(__out);
166
166
  __out = '';
167
167
  _$_.set_output_target(null);
@@ -172,25 +172,17 @@ export function ConditionalTitle() {
172
172
 
173
173
  export function ComputedTitle() {
174
174
  return _$_.tsrx_element(() => {
175
- let lazy_5 = _$_.track(0, 'b6a48610');
175
+ const count = _$_.track(0, 'b6a48610');
176
176
  let prefix = 'Count: ';
177
177
 
178
178
  _$_.regular_block(() => {
179
179
  let __out = '';
180
180
 
181
- __out += '<div><span>';
182
-
183
- {
184
- _$_.output_push(__out);
185
- __out = '';
186
- _$_.render_expression(lazy_5.value);
187
- }
188
-
189
- __out += '</span></div>';
181
+ __out += '<div><span>' + _$_.escape(count.value) + '</span></div>';
190
182
  _$_.output_push(__out);
191
183
  __out = '';
192
184
  _$_.set_output_target('head');
193
- __out += '<!--92c79d98--><title>' + _$_.escape(prefix + lazy_5.value) + '</title>';
185
+ __out += '<!--60e9fce1--><title>' + _$_.escape(prefix + count.value) + '</title>';
194
186
  _$_.output_push(__out);
195
187
  __out = '';
196
188
  _$_.set_output_target(null);
@@ -208,7 +200,7 @@ export function MultipleHeadBlocks() {
208
200
  _$_.output_push(__out);
209
201
  __out = '';
210
202
  _$_.set_output_target('head');
211
- __out += '<!--e50b427b--><title>First Head</title><!--68467dce--><meta name="author" content="Test Author" />';
203
+ __out += '<!--e56fc100--><title>First Head</title><!--ba797fb2--><meta name="author" content="Test Author" />';
212
204
  _$_.output_push(__out);
213
205
  __out = '';
214
206
  _$_.set_output_target(null);
@@ -226,7 +218,7 @@ export function HeadWithStyle() {
226
218
  _$_.output_push(__out);
227
219
  __out = '';
228
220
  _$_.set_output_target('head');
229
- __out += '<!--3a8578a5--><title>Styled Page</title>';
221
+ __out += '<!--872692a0--><title>Styled Page</title>';
230
222
  _$_.output_push(__out);
231
223
  __out = '';
232
224
  _$_.set_output_target(null);
@@ -24,14 +24,14 @@ export function Layout({ children }) {
24
24
 
25
25
  export function Content() {
26
26
  return _$_.tsrx_element(() => {
27
- let lazy = _$_.track(true, '0bdb1500');
27
+ const visible = _$_.track(true, '0bdb1500');
28
28
 
29
29
  _$_.regular_block(() => {
30
30
  let __out = '';
31
31
 
32
32
  __out += '<div class="content"><!--[-->';
33
33
 
34
- if (lazy.value) {
34
+ if (visible.value) {
35
35
  __out += '<p class="text">Hello world</p>';
36
36
  }
37
37
 
@@ -269,7 +269,7 @@ function DocFooter() {
269
269
  });
270
270
  }
271
271
 
272
- export function DocLayout(__props) {
272
+ export function DocLayout({ children, editPath = '', nextLink = null, toc = [] }) {
273
273
  return _$_.tsrx_element(() => {
274
274
  _$_.regular_block(() => {
275
275
  let __out = '';
@@ -279,55 +279,27 @@ export function DocLayout(__props) {
279
279
  {
280
280
  _$_.output_push(__out);
281
281
  __out = '';
282
- _$_.render_expression(__props.children);
282
+ _$_.render_expression(children);
283
283
  }
284
284
 
285
285
  __out += '</div></article><!--[-->';
286
- _$_.output_push(__out);
287
- __out = '';
288
286
 
289
- if (_$_.fallback(__props.editPath, '')) {
290
- _$_.output_push('<div');
291
- _$_.output_push(' class="edit-link"');
292
- _$_.output_push('>');
293
-
294
- {
295
- _$_.output_push('<a');
296
- _$_.output_push(_$_.attr('href', `https://github.com/edit/${_$_.fallback(__props.editPath, '')}`, false));
297
- _$_.output_push('>');
298
-
299
- {
300
- _$_.output_push('Edit');
301
- }
302
-
303
- _$_.output_push('</a>');
304
- }
305
-
306
- _$_.output_push('</div>');
287
+ if (editPath) {
288
+ __out += '<div class="edit-link"><a' + _$_.attr('href', `https://github.com/edit/${editPath}`, false) + '>Edit</a></div>';
307
289
  }
308
290
 
309
291
  __out += '<!--]--><!--[-->';
310
- _$_.output_push(__out);
311
- __out = '';
312
292
 
313
- if (_$_.fallback(__props.nextLink, null)) {
314
- _$_.output_push('<nav');
315
- _$_.output_push(' class="prev-next"');
316
- _$_.output_push('>');
293
+ if (nextLink) {
294
+ __out += '<nav class="prev-next"><a' + _$_.attr('href', nextLink.href, false) + '>';
317
295
 
318
296
  {
319
- _$_.output_push('<a');
320
- _$_.output_push(_$_.attr('href', _$_.fallback(__props.nextLink, null).href, false));
321
- _$_.output_push('>');
322
-
323
- {
324
- _$_.render_expression(_$_.fallback(__props.nextLink, null).text);
325
- }
326
-
327
- _$_.output_push('</a>');
297
+ _$_.output_push(__out);
298
+ __out = '';
299
+ _$_.render_expression(nextLink.text);
328
300
  }
329
301
 
330
- _$_.output_push('</nav>');
302
+ __out += '</a></nav>';
331
303
  }
332
304
 
333
305
  __out += '<!--]-->';
@@ -342,47 +314,15 @@ export function DocLayout(__props) {
342
314
  }
343
315
 
344
316
  __out += '</div><aside><!--[-->';
345
- _$_.output_push(__out);
346
- __out = '';
347
-
348
- if (_$_.fallback(__props.toc, []).length > 0) {
349
- _$_.output_push('<div');
350
- _$_.output_push(' class="toc"');
351
- _$_.output_push('>');
352
317
 
353
- {
354
- _$_.output_push('<ul');
355
- _$_.output_push('>');
318
+ if (toc.length > 0) {
319
+ __out += '<div class="toc"><ul><!--[-->';
356
320
 
357
- {
358
- _$_.output_push('<!--[-->');
359
-
360
- for (const item of _$_.fallback(__props.toc, [])) {
361
- _$_.output_push('<li');
362
- _$_.output_push('>');
363
-
364
- {
365
- _$_.output_push('<a');
366
- _$_.output_push(_$_.attr('href', item.href, false));
367
- _$_.output_push('>');
368
-
369
- {
370
- _$_.render_expression(item.text);
371
- }
372
-
373
- _$_.output_push('</a>');
374
- }
375
-
376
- _$_.output_push('</li>');
377
- }
378
-
379
- _$_.output_push('<!--]-->');
380
- }
381
-
382
- _$_.output_push('</ul>');
321
+ for (const item of toc) {
322
+ __out += '<li><a' + _$_.attr('href', item.href, false) + '>' + _$_.escape(item.text) + '</a></li>';
383
323
  }
384
324
 
385
- _$_.output_push('</div>');
325
+ __out += '<!--]--></ul></div>';
386
326
  }
387
327
 
388
328
  __out += '<!--]--></aside></div>';
@@ -711,15 +651,7 @@ function ForList({ items }) {
711
651
  __out += '<!--[-->';
712
652
 
713
653
  for (const item of items) {
714
- __out += '<span class="for-item">';
715
-
716
- {
717
- _$_.output_push(__out);
718
- __out = '';
719
- _$_.render_expression(item);
720
- }
721
-
722
- __out += '</span>';
654
+ __out += '<span class="for-item">' + _$_.escape(item) + '</span>';
723
655
  }
724
656
 
725
657
  __out += '<!--]-->';
@@ -949,31 +881,18 @@ export function HtmlAfterComponentInChildren() {
949
881
  });
950
882
  }
951
883
 
952
- function NavItem(__props) {
884
+ function NavItem({ href, text: label, active = false }) {
953
885
  return _$_.tsrx_element(() => {
954
886
  _$_.regular_block(() => {
955
887
  let __out = '';
956
888
 
957
- __out += '<div' + _$_.attr('class', `nav-item${_$_.fallback(__props.active, false) ? ' active' : ''}`) + '><!--[-->';
958
- _$_.output_push(__out);
959
- __out = '';
889
+ __out += '<div' + _$_.attr('class', `nav-item${active ? ' active' : ''}`) + '><!--[-->';
960
890
 
961
- if (_$_.fallback(__props.active, false)) {
962
- _$_.output_push('<div');
963
- _$_.output_push(' class="indicator"');
964
- _$_.output_push('>');
965
- _$_.output_push('</div>');
891
+ if (active) {
892
+ __out += '<div class="indicator"></div>';
966
893
  }
967
894
 
968
- __out += '<!--]--><a' + _$_.attr('href', __props.href, false) + '><span>';
969
-
970
- {
971
- _$_.output_push(__out);
972
- __out = '';
973
- _$_.render_expression(__props.text);
974
- }
975
-
976
- __out += '</span></a></div>';
895
+ __out += '<!--]--><a' + _$_.attr('href', href, false) + '><span>' + _$_.escape(label) + '</span></a></div>';
977
896
  _$_.output_push(__out);
978
897
  });
979
898
  });
@@ -981,14 +900,14 @@ function NavItem(__props) {
981
900
 
982
901
  function SidebarSection({ title, children }) {
983
902
  return _$_.tsrx_element(() => {
984
- let lazy = _$_.track(true, '6ac6906f');
903
+ const expanded = _$_.track(true, '6ac6906f');
985
904
 
986
905
  _$_.regular_block(() => {
987
906
  let __out = '';
988
907
 
989
908
  __out += '<section class="sidebar-section"><div class="section-header"><h2>' + _$_.escape(title) + '</h2><button>Toggle</button></div><!--[-->';
990
909
 
991
- if (lazy.value) {
910
+ if (expanded.value) {
992
911
  __out += '<div class="section-items">';
993
912
 
994
913
  {
@@ -1424,7 +1343,7 @@ function FooterStub() {
1424
1343
  });
1425
1344
  }
1426
1345
 
1427
- function DocsLayoutInner(__props) {
1346
+ function DocsLayoutInner({ children, editPath = '', nextLink = null }) {
1428
1347
  return _$_.tsrx_element(() => {
1429
1348
  _$_.regular_block(() => {
1430
1349
  let __out = '';
@@ -1456,55 +1375,27 @@ function DocsLayoutInner(__props) {
1456
1375
  {
1457
1376
  _$_.output_push(__out);
1458
1377
  __out = '';
1459
- _$_.render_expression(__props.children);
1378
+ _$_.render_expression(children);
1460
1379
  }
1461
1380
 
1462
1381
  __out += '</div></article><!--[-->';
1463
- _$_.output_push(__out);
1464
- __out = '';
1465
-
1466
- if (_$_.fallback(__props.editPath, '')) {
1467
- _$_.output_push('<div');
1468
- _$_.output_push(' class="edit-link"');
1469
- _$_.output_push('>');
1470
-
1471
- {
1472
- _$_.output_push('<a');
1473
- _$_.output_push(' href="/edit"');
1474
- _$_.output_push('>');
1475
-
1476
- {
1477
- _$_.output_push('Edit on GitHub');
1478
- }
1479
-
1480
- _$_.output_push('</a>');
1481
- }
1482
1382
 
1483
- _$_.output_push('</div>');
1383
+ if (editPath) {
1384
+ __out += '<div class="edit-link"><a href="/edit">Edit on GitHub</a></div>';
1484
1385
  }
1485
1386
 
1486
1387
  __out += '<!--]--><!--[-->';
1487
- _$_.output_push(__out);
1488
- __out = '';
1489
1388
 
1490
- if (_$_.fallback(__props.nextLink, null)) {
1491
- _$_.output_push('<nav');
1492
- _$_.output_push(' class="prev-next"');
1493
- _$_.output_push('>');
1389
+ if (nextLink) {
1390
+ __out += '<nav class="prev-next"><a' + _$_.attr('href', nextLink.href, false) + '>';
1494
1391
 
1495
1392
  {
1496
- _$_.output_push('<a');
1497
- _$_.output_push(_$_.attr('href', _$_.fallback(__props.nextLink, null).href, false));
1498
- _$_.output_push('>');
1499
-
1500
- {
1501
- _$_.render_expression(_$_.fallback(__props.nextLink, null).text);
1502
- }
1503
-
1504
- _$_.output_push('</a>');
1393
+ _$_.output_push(__out);
1394
+ __out = '';
1395
+ _$_.render_expression(nextLink.text);
1505
1396
  }
1506
1397
 
1507
- _$_.output_push('</nav>');
1398
+ __out += '</a></nav>';
1508
1399
  }
1509
1400
 
1510
1401
  __out += '<!--]-->';
@@ -1580,7 +1471,15 @@ export function DocsLayoutWithoutData() {
1580
1471
  });
1581
1472
  }
1582
1473
 
1583
- function DocsLayoutExact(__props) {
1474
+ function DocsLayoutExact(
1475
+ {
1476
+ children,
1477
+ editPath = '',
1478
+ prevLink = null,
1479
+ nextLink = null,
1480
+ toc = []
1481
+ }
1482
+ ) {
1584
1483
  return _$_.tsrx_element(() => {
1585
1484
  _$_.regular_block(() => {
1586
1485
  let __out = '';
@@ -1612,98 +1511,49 @@ function DocsLayoutExact(__props) {
1612
1511
  {
1613
1512
  _$_.output_push(__out);
1614
1513
  __out = '';
1615
- _$_.render_expression(__props.children);
1514
+ _$_.render_expression(children);
1616
1515
  }
1617
1516
 
1618
1517
  __out += '</div></article><!--[-->';
1619
- _$_.output_push(__out);
1620
- __out = '';
1621
1518
 
1622
- if (_$_.fallback(__props.editPath, '')) {
1623
- _$_.output_push('<div');
1624
- _$_.output_push(' class="edit-link"');
1625
- _$_.output_push('>');
1626
-
1627
- {
1628
- _$_.output_push('<a');
1629
- _$_.output_push(_$_.attr('href', `/edit/${_$_.fallback(__props.editPath, '')}`, false));
1630
- _$_.output_push('>');
1631
-
1632
- {
1633
- _$_.output_push('Edit on GitHub');
1634
- }
1635
-
1636
- _$_.output_push('</a>');
1637
- }
1638
-
1639
- _$_.output_push('</div>');
1519
+ if (editPath) {
1520
+ __out += '<div class="edit-link"><a' + _$_.attr('href', `/edit/${editPath}`, false) + '>Edit on GitHub</a></div>';
1640
1521
  }
1641
1522
 
1642
1523
  __out += '<!--]--><!--[-->';
1643
- _$_.output_push(__out);
1644
- __out = '';
1645
-
1646
- if (_$_.fallback(__props.prevLink, null) || _$_.fallback(__props.nextLink, null)) {
1647
- _$_.output_push('<nav');
1648
- _$_.output_push(' class="prev-next"');
1649
- _$_.output_push('>');
1650
1524
 
1651
- {
1652
- _$_.output_push('<!--[-->');
1653
-
1654
- if (_$_.fallback(__props.prevLink, null)) {
1655
- _$_.output_push('<a');
1656
- _$_.output_push(_$_.attr('href', _$_.fallback(__props.prevLink, null).href, false));
1657
- _$_.output_push(' class="pager prev"');
1658
- _$_.output_push('>');
1525
+ if (prevLink || nextLink) {
1526
+ __out += '<nav class="prev-next"><!--[-->';
1659
1527
 
1660
- {
1661
- _$_.output_push('<span');
1662
- _$_.output_push(' class="title"');
1663
- _$_.output_push('>');
1528
+ if (prevLink) {
1529
+ __out += '<a' + _$_.attr('href', prevLink.href, false) + ' class="pager prev"><span class="title">';
1664
1530
 
1665
- {
1666
- _$_.render_expression(_$_.fallback(__props.prevLink, null).text);
1667
- }
1668
-
1669
- _$_.output_push('</span>');
1670
- }
1671
-
1672
- _$_.output_push('</a>');
1673
- } else {
1674
- _$_.output_push('<span');
1675
- _$_.output_push('>');
1676
- _$_.output_push('</span>');
1531
+ {
1532
+ _$_.output_push(__out);
1533
+ __out = '';
1534
+ _$_.render_expression(prevLink.text);
1677
1535
  }
1678
1536
 
1679
- _$_.output_push('<!--]-->');
1680
- _$_.output_push('<!--[-->');
1681
-
1682
- if (_$_.fallback(__props.nextLink, null)) {
1683
- _$_.output_push('<a');
1684
- _$_.output_push(_$_.attr('href', _$_.fallback(__props.nextLink, null).href, false));
1685
- _$_.output_push(' class="pager next"');
1686
- _$_.output_push('>');
1687
-
1688
- {
1689
- _$_.output_push('<span');
1690
- _$_.output_push(' class="title"');
1691
- _$_.output_push('>');
1537
+ __out += '</span></a>';
1538
+ } else {
1539
+ __out += '<span></span>';
1540
+ }
1692
1541
 
1693
- {
1694
- _$_.render_expression(_$_.fallback(__props.nextLink, null).text);
1695
- }
1542
+ __out += '<!--]--><!--[-->';
1696
1543
 
1697
- _$_.output_push('</span>');
1698
- }
1544
+ if (nextLink) {
1545
+ __out += '<a' + _$_.attr('href', nextLink.href, false) + ' class="pager next"><span class="title">';
1699
1546
 
1700
- _$_.output_push('</a>');
1547
+ {
1548
+ _$_.output_push(__out);
1549
+ __out = '';
1550
+ _$_.render_expression(nextLink.text);
1701
1551
  }
1702
1552
 
1703
- _$_.output_push('<!--]-->');
1553
+ __out += '</span></a>';
1704
1554
  }
1705
1555
 
1706
- _$_.output_push('</nav>');
1556
+ __out += '<!--]--></nav>';
1707
1557
  }
1708
1558
 
1709
1559
  __out += '<!--]-->';
@@ -1718,41 +1568,15 @@ function DocsLayoutExact(__props) {
1718
1568
  }
1719
1569
 
1720
1570
  __out += '</div></div><aside class="aside"><!--[-->';
1721
- _$_.output_push(__out);
1722
- __out = '';
1723
-
1724
- if (_$_.fallback(__props.toc, []).length > 0) {
1725
- _$_.output_push('<div');
1726
- _$_.output_push(' class="aside-content"');
1727
- _$_.output_push('>');
1728
-
1729
- {
1730
- _$_.output_push('<nav');
1731
- _$_.output_push(' class="outline"');
1732
- _$_.output_push('>');
1733
-
1734
- {
1735
- _$_.output_push('<!--[-->');
1736
-
1737
- for (const item of _$_.fallback(__props.toc, [])) {
1738
- _$_.output_push('<a');
1739
- _$_.output_push(_$_.attr('href', item.href, false));
1740
- _$_.output_push('>');
1741
-
1742
- {
1743
- _$_.render_expression(item.text);
1744
- }
1745
1571
 
1746
- _$_.output_push('</a>');
1747
- }
1748
-
1749
- _$_.output_push('<!--]-->');
1750
- }
1572
+ if (toc.length > 0) {
1573
+ __out += '<div class="aside-content"><nav class="outline"><!--[-->';
1751
1574
 
1752
- _$_.output_push('</nav>');
1575
+ for (const item of toc) {
1576
+ __out += '<a' + _$_.attr('href', item.href, false) + '>' + _$_.escape(item.text) + '</a>';
1753
1577
  }
1754
1578
 
1755
- _$_.output_push('</div>');
1579
+ __out += '<!--]--></nav></div>';
1756
1580
  }
1757
1581
 
1758
1582
  __out += '<!--]--></aside></div></main></div></div>';