ripple 0.3.128 → 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 +267 -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 +173 -91
  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 +9 -0
  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 +45 -25
  14. package/src/runtime/internal/client/for.js +409 -129
  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 +4 -12
  20. package/src/runtime/internal/client/operations.js +40 -61
  21. package/src/runtime/internal/client/portal.js +163 -85
  22. package/src/runtime/internal/client/render.js +39 -39
  23. package/src/runtime/internal/client/rpc.js +3 -3
  24. package/src/runtime/internal/client/runtime.js +592 -433
  25. package/src/runtime/internal/client/selector.js +5 -2
  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 +56 -23
  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 +325 -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 +73 -38
  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 +14 -14
  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 +184 -171
  103. package/tests/hydration/compiled/client/for.js +1472 -1132
  104. package/tests/hydration/compiled/client/fragment-cursor.js +2341 -0
  105. package/tests/hydration/compiled/client/head.js +254 -201
  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 -404
  113. package/tests/hydration/compiled/client/nested-control-flow.js +1326 -1277
  114. package/tests/hydration/compiled/client/portal.js +87 -95
  115. package/tests/hydration/compiled/client/reactivity.js +135 -101
  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 +66 -18
  126. package/tests/hydration/compiled/server/for.js +117 -41
  127. package/tests/hydration/compiled/server/fragment-cursor.js +1687 -0
  128. package/tests/hydration/compiled/server/head.js +20 -20
  129. package/tests/hydration/compiled/server/hmr.js +2 -2
  130. package/tests/hydration/compiled/server/html.js +70 -238
  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 -14
  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,17 +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>' + _$_.escape(lazy_5.value) + '</span></div>';
181
+ __out += '<div><span>' + _$_.escape(count.value) + '</span></div>';
182
182
  _$_.output_push(__out);
183
183
  __out = '';
184
184
  _$_.set_output_target('head');
185
- __out += '<!--92c79d98--><title>' + _$_.escape(prefix + lazy_5.value) + '</title>';
185
+ __out += '<!--60e9fce1--><title>' + _$_.escape(prefix + count.value) + '</title>';
186
186
  _$_.output_push(__out);
187
187
  __out = '';
188
188
  _$_.set_output_target(null);
@@ -200,7 +200,7 @@ export function MultipleHeadBlocks() {
200
200
  _$_.output_push(__out);
201
201
  __out = '';
202
202
  _$_.set_output_target('head');
203
- __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" />';
204
204
  _$_.output_push(__out);
205
205
  __out = '';
206
206
  _$_.set_output_target(null);
@@ -218,7 +218,7 @@ export function HeadWithStyle() {
218
218
  _$_.output_push(__out);
219
219
  __out = '';
220
220
  _$_.set_output_target('head');
221
- __out += '<!--3a8578a5--><title>Styled Page</title>';
221
+ __out += '<!--872692a0--><title>Styled Page</title>';
222
222
  _$_.output_push(__out);
223
223
  __out = '';
224
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
-
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
286
 
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
-
353
- {
354
- _$_.output_push('<ul');
355
- _$_.output_push('>');
356
-
357
- {
358
- _$_.output_push('<!--[-->');
359
-
360
- for (const item of _$_.fallback(__props.toc, [])) {
361
- _$_.output_push('<li');
362
- _$_.output_push('>');
363
317
 
364
- {
365
- _$_.output_push('<a');
366
- _$_.output_push(_$_.attr('href', item.href, false));
367
- _$_.output_push('>');
318
+ if (toc.length > 0) {
319
+ __out += '<div class="toc"><ul><!--[-->';
368
320
 
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>';
@@ -941,31 +881,18 @@ export function HtmlAfterComponentInChildren() {
941
881
  });
942
882
  }
943
883
 
944
- function NavItem(__props) {
884
+ function NavItem({ href, text: label, active = false }) {
945
885
  return _$_.tsrx_element(() => {
946
886
  _$_.regular_block(() => {
947
887
  let __out = '';
948
888
 
949
- __out += '<div' + _$_.attr('class', `nav-item${_$_.fallback(__props.active, false) ? ' active' : ''}`) + '><!--[-->';
950
- _$_.output_push(__out);
951
- __out = '';
952
-
953
- if (_$_.fallback(__props.active, false)) {
954
- _$_.output_push('<div');
955
- _$_.output_push(' class="indicator"');
956
- _$_.output_push('>');
957
- _$_.output_push('</div>');
958
- }
959
-
960
- __out += '<!--]--><a' + _$_.attr('href', __props.href, false) + '><span>';
889
+ __out += '<div' + _$_.attr('class', `nav-item${active ? ' active' : ''}`) + '><!--[-->';
961
890
 
962
- {
963
- _$_.output_push(__out);
964
- __out = '';
965
- _$_.render_expression(__props.text);
891
+ if (active) {
892
+ __out += '<div class="indicator"></div>';
966
893
  }
967
894
 
968
- __out += '</span></a></div>';
895
+ __out += '<!--]--><a' + _$_.attr('href', href, false) + '><span>' + _$_.escape(label) + '</span></a></div>';
969
896
  _$_.output_push(__out);
970
897
  });
971
898
  });
@@ -973,14 +900,14 @@ function NavItem(__props) {
973
900
 
974
901
  function SidebarSection({ title, children }) {
975
902
  return _$_.tsrx_element(() => {
976
- let lazy = _$_.track(true, '6ac6906f');
903
+ const expanded = _$_.track(true, '6ac6906f');
977
904
 
978
905
  _$_.regular_block(() => {
979
906
  let __out = '';
980
907
 
981
908
  __out += '<section class="sidebar-section"><div class="section-header"><h2>' + _$_.escape(title) + '</h2><button>Toggle</button></div><!--[-->';
982
909
 
983
- if (lazy.value) {
910
+ if (expanded.value) {
984
911
  __out += '<div class="section-items">';
985
912
 
986
913
  {
@@ -1416,7 +1343,7 @@ function FooterStub() {
1416
1343
  });
1417
1344
  }
1418
1345
 
1419
- function DocsLayoutInner(__props) {
1346
+ function DocsLayoutInner({ children, editPath = '', nextLink = null }) {
1420
1347
  return _$_.tsrx_element(() => {
1421
1348
  _$_.regular_block(() => {
1422
1349
  let __out = '';
@@ -1448,55 +1375,27 @@ function DocsLayoutInner(__props) {
1448
1375
  {
1449
1376
  _$_.output_push(__out);
1450
1377
  __out = '';
1451
- _$_.render_expression(__props.children);
1378
+ _$_.render_expression(children);
1452
1379
  }
1453
1380
 
1454
1381
  __out += '</div></article><!--[-->';
1455
- _$_.output_push(__out);
1456
- __out = '';
1457
-
1458
- if (_$_.fallback(__props.editPath, '')) {
1459
- _$_.output_push('<div');
1460
- _$_.output_push(' class="edit-link"');
1461
- _$_.output_push('>');
1462
-
1463
- {
1464
- _$_.output_push('<a');
1465
- _$_.output_push(' href="/edit"');
1466
- _$_.output_push('>');
1467
-
1468
- {
1469
- _$_.output_push('Edit on GitHub');
1470
- }
1471
-
1472
- _$_.output_push('</a>');
1473
- }
1474
1382
 
1475
- _$_.output_push('</div>');
1383
+ if (editPath) {
1384
+ __out += '<div class="edit-link"><a href="/edit">Edit on GitHub</a></div>';
1476
1385
  }
1477
1386
 
1478
1387
  __out += '<!--]--><!--[-->';
1479
- _$_.output_push(__out);
1480
- __out = '';
1481
1388
 
1482
- if (_$_.fallback(__props.nextLink, null)) {
1483
- _$_.output_push('<nav');
1484
- _$_.output_push(' class="prev-next"');
1485
- _$_.output_push('>');
1389
+ if (nextLink) {
1390
+ __out += '<nav class="prev-next"><a' + _$_.attr('href', nextLink.href, false) + '>';
1486
1391
 
1487
1392
  {
1488
- _$_.output_push('<a');
1489
- _$_.output_push(_$_.attr('href', _$_.fallback(__props.nextLink, null).href, false));
1490
- _$_.output_push('>');
1491
-
1492
- {
1493
- _$_.render_expression(_$_.fallback(__props.nextLink, null).text);
1494
- }
1495
-
1496
- _$_.output_push('</a>');
1393
+ _$_.output_push(__out);
1394
+ __out = '';
1395
+ _$_.render_expression(nextLink.text);
1497
1396
  }
1498
1397
 
1499
- _$_.output_push('</nav>');
1398
+ __out += '</a></nav>';
1500
1399
  }
1501
1400
 
1502
1401
  __out += '<!--]-->';
@@ -1572,7 +1471,15 @@ export function DocsLayoutWithoutData() {
1572
1471
  });
1573
1472
  }
1574
1473
 
1575
- function DocsLayoutExact(__props) {
1474
+ function DocsLayoutExact(
1475
+ {
1476
+ children,
1477
+ editPath = '',
1478
+ prevLink = null,
1479
+ nextLink = null,
1480
+ toc = []
1481
+ }
1482
+ ) {
1576
1483
  return _$_.tsrx_element(() => {
1577
1484
  _$_.regular_block(() => {
1578
1485
  let __out = '';
@@ -1604,98 +1511,49 @@ function DocsLayoutExact(__props) {
1604
1511
  {
1605
1512
  _$_.output_push(__out);
1606
1513
  __out = '';
1607
- _$_.render_expression(__props.children);
1514
+ _$_.render_expression(children);
1608
1515
  }
1609
1516
 
1610
1517
  __out += '</div></article><!--[-->';
1611
- _$_.output_push(__out);
1612
- __out = '';
1613
-
1614
- if (_$_.fallback(__props.editPath, '')) {
1615
- _$_.output_push('<div');
1616
- _$_.output_push(' class="edit-link"');
1617
- _$_.output_push('>');
1618
-
1619
- {
1620
- _$_.output_push('<a');
1621
- _$_.output_push(_$_.attr('href', `/edit/${_$_.fallback(__props.editPath, '')}`, false));
1622
- _$_.output_push('>');
1623
-
1624
- {
1625
- _$_.output_push('Edit on GitHub');
1626
- }
1627
-
1628
- _$_.output_push('</a>');
1629
- }
1630
1518
 
1631
- _$_.output_push('</div>');
1519
+ if (editPath) {
1520
+ __out += '<div class="edit-link"><a' + _$_.attr('href', `/edit/${editPath}`, false) + '>Edit on GitHub</a></div>';
1632
1521
  }
1633
1522
 
1634
1523
  __out += '<!--]--><!--[-->';
1635
- _$_.output_push(__out);
1636
- __out = '';
1637
-
1638
- if (_$_.fallback(__props.prevLink, null) || _$_.fallback(__props.nextLink, null)) {
1639
- _$_.output_push('<nav');
1640
- _$_.output_push(' class="prev-next"');
1641
- _$_.output_push('>');
1642
-
1643
- {
1644
- _$_.output_push('<!--[-->');
1645
-
1646
- if (_$_.fallback(__props.prevLink, null)) {
1647
- _$_.output_push('<a');
1648
- _$_.output_push(_$_.attr('href', _$_.fallback(__props.prevLink, null).href, false));
1649
- _$_.output_push(' class="pager prev"');
1650
- _$_.output_push('>');
1651
-
1652
- {
1653
- _$_.output_push('<span');
1654
- _$_.output_push(' class="title"');
1655
- _$_.output_push('>');
1656
1524
 
1657
- {
1658
- _$_.render_expression(_$_.fallback(__props.prevLink, null).text);
1659
- }
1525
+ if (prevLink || nextLink) {
1526
+ __out += '<nav class="prev-next"><!--[-->';
1660
1527
 
1661
- _$_.output_push('</span>');
1662
- }
1528
+ if (prevLink) {
1529
+ __out += '<a' + _$_.attr('href', prevLink.href, false) + ' class="pager prev"><span class="title">';
1663
1530
 
1664
- _$_.output_push('</a>');
1665
- } else {
1666
- _$_.output_push('<span');
1667
- _$_.output_push('>');
1668
- _$_.output_push('</span>');
1531
+ {
1532
+ _$_.output_push(__out);
1533
+ __out = '';
1534
+ _$_.render_expression(prevLink.text);
1669
1535
  }
1670
1536
 
1671
- _$_.output_push('<!--]-->');
1672
- _$_.output_push('<!--[-->');
1673
-
1674
- if (_$_.fallback(__props.nextLink, null)) {
1675
- _$_.output_push('<a');
1676
- _$_.output_push(_$_.attr('href', _$_.fallback(__props.nextLink, null).href, false));
1677
- _$_.output_push(' class="pager next"');
1678
- _$_.output_push('>');
1679
-
1680
- {
1681
- _$_.output_push('<span');
1682
- _$_.output_push(' class="title"');
1683
- _$_.output_push('>');
1537
+ __out += '</span></a>';
1538
+ } else {
1539
+ __out += '<span></span>';
1540
+ }
1684
1541
 
1685
- {
1686
- _$_.render_expression(_$_.fallback(__props.nextLink, null).text);
1687
- }
1542
+ __out += '<!--]--><!--[-->';
1688
1543
 
1689
- _$_.output_push('</span>');
1690
- }
1544
+ if (nextLink) {
1545
+ __out += '<a' + _$_.attr('href', nextLink.href, false) + ' class="pager next"><span class="title">';
1691
1546
 
1692
- _$_.output_push('</a>');
1547
+ {
1548
+ _$_.output_push(__out);
1549
+ __out = '';
1550
+ _$_.render_expression(nextLink.text);
1693
1551
  }
1694
1552
 
1695
- _$_.output_push('<!--]-->');
1553
+ __out += '</span></a>';
1696
1554
  }
1697
1555
 
1698
- _$_.output_push('</nav>');
1556
+ __out += '<!--]--></nav>';
1699
1557
  }
1700
1558
 
1701
1559
  __out += '<!--]-->';
@@ -1710,41 +1568,15 @@ function DocsLayoutExact(__props) {
1710
1568
  }
1711
1569
 
1712
1570
  __out += '</div></div><aside class="aside"><!--[-->';
1713
- _$_.output_push(__out);
1714
- __out = '';
1715
-
1716
- if (_$_.fallback(__props.toc, []).length > 0) {
1717
- _$_.output_push('<div');
1718
- _$_.output_push(' class="aside-content"');
1719
- _$_.output_push('>');
1720
-
1721
- {
1722
- _$_.output_push('<nav');
1723
- _$_.output_push(' class="outline"');
1724
- _$_.output_push('>');
1725
-
1726
- {
1727
- _$_.output_push('<!--[-->');
1728
-
1729
- for (const item of _$_.fallback(__props.toc, [])) {
1730
- _$_.output_push('<a');
1731
- _$_.output_push(_$_.attr('href', item.href, false));
1732
- _$_.output_push('>');
1733
-
1734
- {
1735
- _$_.render_expression(item.text);
1736
- }
1737
1571
 
1738
- _$_.output_push('</a>');
1739
- }
1740
-
1741
- _$_.output_push('<!--]-->');
1742
- }
1572
+ if (toc.length > 0) {
1573
+ __out += '<div class="aside-content"><nav class="outline"><!--[-->';
1743
1574
 
1744
- _$_.output_push('</nav>');
1575
+ for (const item of toc) {
1576
+ __out += '<a' + _$_.attr('href', item.href, false) + '>' + _$_.escape(item.text) + '</a>';
1745
1577
  }
1746
1578
 
1747
- _$_.output_push('</div>');
1579
+ __out += '<!--]--></nav></div>';
1748
1580
  }
1749
1581
 
1750
1582
  __out += '<!--]--></aside></div></main></div></div>';