ripple 0.4.2 → 0.4.4
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.
- package/CHANGELOG.md +164 -0
- package/package.json +10 -4
- package/src/constants.js +6 -0
- package/src/jsx-runtime.d.ts +2 -1
- package/src/runtime/array.js +15 -9
- package/src/runtime/index-client.js +25 -7
- package/src/runtime/index-server.js +1 -0
- package/src/runtime/internal/client/attributes.js +439 -0
- package/src/runtime/internal/client/blocks.js +20 -20
- package/src/runtime/internal/client/component.js +2 -5
- package/src/runtime/internal/client/composite.js +295 -95
- package/src/runtime/internal/client/constants.js +14 -6
- package/src/runtime/internal/client/context.js +3 -2
- package/src/runtime/internal/client/css.js +11 -26
- package/src/runtime/internal/client/errors.js +188 -0
- package/src/runtime/internal/client/events.js +79 -34
- package/src/runtime/internal/client/expression.js +25 -120
- package/src/runtime/internal/client/for.js +113 -262
- package/src/runtime/internal/client/head.js +4 -3
- package/src/runtime/internal/client/html.js +5 -3
- package/src/runtime/internal/client/hydrate.js +484 -0
- package/src/runtime/internal/client/hydration-enabled.js +7 -0
- package/src/runtime/internal/client/hydration.js +16 -81
- package/src/runtime/internal/client/if.js +69 -10
- package/src/runtime/internal/client/index.js +18 -10
- package/src/runtime/internal/client/operations.js +11 -7
- package/src/runtime/internal/client/portal.js +3 -2
- package/src/runtime/internal/client/render.js +42 -325
- package/src/runtime/internal/client/root-boundary-enabled.js +7 -0
- package/src/runtime/internal/client/runtime.js +157 -371
- package/src/runtime/internal/client/template-ns.js +88 -0
- package/src/runtime/internal/client/template.js +118 -139
- package/src/runtime/internal/client/track-async.js +356 -0
- package/src/runtime/internal/client/try.js +133 -319
- package/src/runtime/internal/client/types.d.ts +48 -24
- package/src/runtime/internal/server/index.js +31 -29
- package/src/runtime/internal/server/prerender.js +27 -0
- package/src/server/index.js +1 -0
- package/src/utils/class-name.js +28 -0
- package/tests/client/basic/basic.errors.test.tsrx +3 -3
- package/tests/client/compiler/__snapshots__/compiler.typescript.test.tsrx.snap +0 -2
- package/tests/client/compiler/compiler.basic.test.tsrx +2 -2
- package/tests/client/compiler/compiler.tracked-access.test.tsrx +3 -3
- package/tests/client/composite/composite.dynamic-components.test.tsrx +40 -0
- package/tests/client/composite/composite.props.test.tsrx +10 -10
- package/tests/client/css/scoped-styles.test.tsrx +3 -1
- package/tests/client/derived-release.test.tsrx +3 -3
- package/tests/client/for-item.test.tsrx +39 -0
- package/tests/client/for-selector.test.tsrx +95 -0
- package/tests/client/svg.test.tsrx +273 -1
- package/tests/hydration/compiled/client/basic.js +88 -87
- package/tests/hydration/compiled/client/composite.js +15 -6
- package/tests/hydration/compiled/client/events.js +40 -48
- package/tests/hydration/compiled/client/for.js +191 -199
- package/tests/hydration/compiled/client/fragment-cursor.js +633 -334
- package/tests/hydration/compiled/client/head.js +22 -22
- package/tests/hydration/compiled/client/hmr.js +14 -5
- package/tests/hydration/compiled/client/html-in-template.js +5 -5
- package/tests/hydration/compiled/client/html.js +195 -177
- package/tests/hydration/compiled/client/if-children.js +136 -63
- package/tests/hydration/compiled/client/if-fragment-controlflow.js +63 -43
- package/tests/hydration/compiled/client/if.js +78 -30
- package/tests/hydration/compiled/client/mixed-control-flow.js +90 -72
- package/tests/hydration/compiled/client/nested-control-flow.js +266 -307
- package/tests/hydration/compiled/client/portal.js +20 -11
- package/tests/hydration/compiled/client/reactivity.js +29 -29
- package/tests/hydration/compiled/client/return.js +2 -2
- package/tests/hydration/compiled/client/streaming.js +33 -35
- package/tests/hydration/compiled/client/switch.js +25 -25
- package/tests/hydration/compiled/client/track-async-serialization.js +41 -41
- package/tests/hydration/compiled/client/try.js +15 -15
- package/tests/hydration/compiled/client/typed-text.js +8 -7
- package/tests/hydration/compiled/server/basic.js +6 -6
- package/tests/hydration/compiled/server/events.js +8 -8
- package/tests/hydration/compiled/server/for.js +22 -22
- package/tests/hydration/compiled/server/fragment-cursor.js +188 -52
- package/tests/hydration/compiled/server/head.js +6 -6
- package/tests/hydration/compiled/server/hmr.js +1 -1
- package/tests/hydration/compiled/server/html.js +1 -1
- package/tests/hydration/compiled/server/if-children.js +9 -9
- package/tests/hydration/compiled/server/if.js +5 -5
- package/tests/hydration/compiled/server/mixed-control-flow.js +4 -4
- package/tests/hydration/compiled/server/portal.js +1 -1
- package/tests/hydration/compiled/server/reactivity.js +9 -9
- package/tests/hydration/compiled/server/streaming.js +9 -9
- package/tests/hydration/compiled/server/switch.js +4 -4
- package/tests/hydration/compiled/server/track-async-serialization.js +16 -16
- package/tests/hydration/compiled/server/try.js +4 -4
- package/tests/hydration/compiled/server/typed-text.js +1 -1
- package/tests/hydration/components/fragment-cursor.tsrx +60 -0
- package/tests/hydration/components/track-async-serialization.tsrx +2 -2
- package/tests/hydration/fragment-cursor.test.js +34 -1
- package/tests/hydration/track-async-serialization.test.js +1 -1
- package/tests/server/basic.components.test.tsrx +3 -3
- package/tests/server/track-async-serialization.test.tsrx +6 -6
- package/tests/utils/tracked-types.test.js +3 -3
- package/types/index.d.ts +8 -8
- package/types/server.d.ts +17 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import * as _$_ from 'ripple/internal/client';
|
|
3
3
|
|
|
4
|
-
var root_1 = _$_.template(`<div class=
|
|
4
|
+
var root_1 = _$_.template(`<div class=content><!>`);
|
|
5
5
|
|
|
6
|
-
function consequent(__anchor, { expanded, children }) {
|
|
6
|
+
function consequent(__anchor, { a: expanded, b: children }) {
|
|
7
7
|
var div_2 = root_1();
|
|
8
8
|
|
|
9
9
|
{
|
|
@@ -16,14 +16,22 @@ function consequent(__anchor, { expanded, children }) {
|
|
|
16
16
|
_$_.append(__anchor, div_2);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function if_1({ expanded, children }) {
|
|
19
|
+
function if_1({ a: expanded, b: children }) {
|
|
20
20
|
if (expanded.value) return consequent;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
var root = _$_.template(`<div class=
|
|
23
|
+
var root = _$_.template(`<div class=container><div role=button class=header>Toggle`);
|
|
24
|
+
|
|
25
|
+
function render(__prev) {
|
|
26
|
+
var __a = if_1({ a: __prev._a, b: __prev._b });
|
|
27
|
+
|
|
28
|
+
if (__prev.a !== __a) {
|
|
29
|
+
_$_.if_update(__prev._c, __prev.a = __a);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
24
32
|
|
|
25
33
|
function IfWithChildren_render(__anchor, __block, { children }) {
|
|
26
|
-
const expanded = _$_.track(true, __block, '
|
|
34
|
+
const expanded = _$_.track(true, __block, '1j0jg6p');
|
|
27
35
|
var div = root();
|
|
28
36
|
|
|
29
37
|
{
|
|
@@ -31,18 +39,19 @@ function IfWithChildren_render(__anchor, __block, { children }) {
|
|
|
31
39
|
|
|
32
40
|
div_1.__click = () => expanded.value = !expanded.value;
|
|
33
41
|
|
|
34
|
-
var node = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div);
|
|
42
|
+
var node = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div, true);
|
|
43
|
+
var ifs = _$_.if_static(node, if_1, 0, { a: expanded, b: children });
|
|
35
44
|
|
|
36
|
-
_$_.if(node, if_1, false, { expanded, children });
|
|
37
45
|
_$_.hydrating && _$_.pop(div);
|
|
38
46
|
}
|
|
39
47
|
|
|
48
|
+
_$_.render(render, { a: _$_.UNINITIALIZED, _a: expanded, _b: children, _c: ifs });
|
|
40
49
|
_$_.append(__anchor, div);
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
IfWithChildren[_$_.$r] = IfWithChildren_render;
|
|
44
53
|
|
|
45
|
-
var root_2 = _$_.
|
|
54
|
+
var root_2 = _$_.template_el('div', ['class', 'item']);
|
|
46
55
|
|
|
47
56
|
function ChildItem_render(__anchor, __block, { text: label }) {
|
|
48
57
|
var div_3 = root_2();
|
|
@@ -76,7 +85,7 @@ function TestIfWithChildren_render(__anchor, __block) {
|
|
|
76
85
|
|
|
77
86
|
TestIfWithChildren[_$_.$r] = TestIfWithChildren_render;
|
|
78
87
|
|
|
79
|
-
var root_5 = _$_.template(`<div class=
|
|
88
|
+
var root_5 = _$_.template(`<div class=content><span>Static child 1</span><span>Static child 2`);
|
|
80
89
|
|
|
81
90
|
function consequent_1(__anchor, expanded) {
|
|
82
91
|
var div_6 = root_5();
|
|
@@ -88,10 +97,18 @@ function if_2(expanded) {
|
|
|
88
97
|
if (expanded.value) return consequent_1;
|
|
89
98
|
}
|
|
90
99
|
|
|
91
|
-
var root_4 = _$_.template(`<div class=
|
|
100
|
+
var root_4 = _$_.template(`<div class=container><div role=button class=header>Toggle`);
|
|
101
|
+
|
|
102
|
+
function render_1(__prev) {
|
|
103
|
+
var __a = if_2(__prev._a);
|
|
104
|
+
|
|
105
|
+
if (__prev.a !== __a) {
|
|
106
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
92
109
|
|
|
93
110
|
function IfWithStaticChildren_render(__anchor, __block) {
|
|
94
|
-
const expanded = _$_.track(true, __block, '
|
|
111
|
+
const expanded = _$_.track(true, __block, 'gkm3jr');
|
|
95
112
|
var div_4 = root_4();
|
|
96
113
|
|
|
97
114
|
{
|
|
@@ -99,20 +116,21 @@ function IfWithStaticChildren_render(__anchor, __block) {
|
|
|
99
116
|
|
|
100
117
|
div_5.__click = () => expanded.value = !expanded.value;
|
|
101
118
|
|
|
102
|
-
var node_3 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_4);
|
|
119
|
+
var node_3 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_4, true);
|
|
120
|
+
var ifs_1 = _$_.if_static(node_3, if_2, 0, expanded);
|
|
103
121
|
|
|
104
|
-
_$_.if(node_3, if_2, false, expanded);
|
|
105
122
|
_$_.hydrating && _$_.pop(div_4);
|
|
106
123
|
}
|
|
107
124
|
|
|
125
|
+
_$_.render(render_1, { a: _$_.UNINITIALIZED, _a: expanded, _b: ifs_1 });
|
|
108
126
|
_$_.append(__anchor, div_4);
|
|
109
127
|
}
|
|
110
128
|
|
|
111
129
|
IfWithStaticChildren[_$_.$r] = IfWithStaticChildren_render;
|
|
112
130
|
|
|
113
|
-
var root_7 = _$_.template(`<div class=
|
|
131
|
+
var root_7 = _$_.template(`<div class=items><!>`);
|
|
114
132
|
|
|
115
|
-
function consequent_2(__anchor, { expanded, children }) {
|
|
133
|
+
function consequent_2(__anchor, { a: expanded, b: children }) {
|
|
116
134
|
var div_8 = root_7();
|
|
117
135
|
|
|
118
136
|
{
|
|
@@ -125,14 +143,22 @@ function consequent_2(__anchor, { expanded, children }) {
|
|
|
125
143
|
_$_.append(__anchor, div_8);
|
|
126
144
|
}
|
|
127
145
|
|
|
128
|
-
function if_3({ expanded, children }) {
|
|
146
|
+
function if_3({ a: expanded, b: children }) {
|
|
129
147
|
if (expanded.value) return consequent_2;
|
|
130
148
|
}
|
|
131
149
|
|
|
132
|
-
var root_6 = _$_.template(`<section class=
|
|
150
|
+
var root_6 = _$_.template(`<section class=group><div role=button class=item><div class=indicator></div><h2 class=text>Title</h2><div class=caret><svg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox="0 0 24 24"><path d="m9 18 6-6-6-6">`);
|
|
151
|
+
|
|
152
|
+
function render_2(__prev) {
|
|
153
|
+
var __a = if_3({ a: __prev._a, b: __prev._b });
|
|
154
|
+
|
|
155
|
+
if (__prev.a !== __a) {
|
|
156
|
+
_$_.if_update(__prev._c, __prev.a = __a);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
133
159
|
|
|
134
160
|
function IfWithSiblingsAndChildren_render(__anchor, __block, { children }) {
|
|
135
|
-
const expanded = _$_.track(true, __block, '
|
|
161
|
+
const expanded = _$_.track(true, __block, '18vegr0');
|
|
136
162
|
var section = root_6();
|
|
137
163
|
|
|
138
164
|
{
|
|
@@ -141,12 +167,16 @@ function IfWithSiblingsAndChildren_render(__anchor, __block, { children }) {
|
|
|
141
167
|
div_7.__click = () => expanded.value = !expanded.value;
|
|
142
168
|
_$_.hydrating && _$_.pop(div_7);
|
|
143
169
|
|
|
144
|
-
var node_4 = _$_.hydrating
|
|
170
|
+
var node_4 = _$_.hydrating
|
|
171
|
+
? _$_.hydrate_sibling()
|
|
172
|
+
: _$_.append_into(section, true);
|
|
173
|
+
|
|
174
|
+
var ifs_2 = _$_.if_static(node_4, if_3, 0, { a: expanded, b: children });
|
|
145
175
|
|
|
146
|
-
_$_.if(node_4, if_3, false, { expanded, children });
|
|
147
176
|
_$_.hydrating && _$_.pop(section);
|
|
148
177
|
}
|
|
149
178
|
|
|
179
|
+
_$_.render(render_2, { a: _$_.UNINITIALIZED, _a: expanded, _b: children, _c: ifs_2 });
|
|
150
180
|
_$_.append(__anchor, section);
|
|
151
181
|
}
|
|
152
182
|
|
|
@@ -172,7 +202,7 @@ function TestIfWithSiblingsAndChildren_render(__anchor, __block) {
|
|
|
172
202
|
|
|
173
203
|
TestIfWithSiblingsAndChildren[_$_.$r] = TestIfWithSiblingsAndChildren_render;
|
|
174
204
|
|
|
175
|
-
var root_11 = _$_.
|
|
205
|
+
var root_11 = _$_.template_el('div', ['class', 'conditional'], 'Conditional content');
|
|
176
206
|
|
|
177
207
|
function consequent_3(__anchor, show) {
|
|
178
208
|
var div_11 = root_11();
|
|
@@ -184,11 +214,20 @@ function if_4(show) {
|
|
|
184
214
|
if (show.value) return consequent_3;
|
|
185
215
|
}
|
|
186
216
|
|
|
187
|
-
var root_10 = _$_.template(`<div class=
|
|
217
|
+
var root_10 = _$_.template(`<div class=wrapper><div class=nested-parent><div class=nested-child><span class=deep>Deep content</span></div></div></div><button class=toggle>Toggle`, 1, 2);
|
|
218
|
+
|
|
219
|
+
function render_3(__prev) {
|
|
220
|
+
var __a = if_4(__prev._a);
|
|
221
|
+
|
|
222
|
+
if (__prev.a !== __a) {
|
|
223
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
188
227
|
var root_9 = _$_.template(`<!>`, 1, 1);
|
|
189
228
|
|
|
190
229
|
function ElementWithChildrenThenIf_render(__anchor, __block) {
|
|
191
|
-
const show = _$_.track(true, __block, '
|
|
230
|
+
const show = _$_.track(true, __block, 'ymw5ff');
|
|
192
231
|
var fragment_2 = root_9();
|
|
193
232
|
var node_8 = _$_.first_child_frag(fragment_2);
|
|
194
233
|
|
|
@@ -198,15 +237,16 @@ function ElementWithChildrenThenIf_render(__anchor, __block) {
|
|
|
198
237
|
|
|
199
238
|
{
|
|
200
239
|
var div_10 = _$_.hydrating ? _$_.hydrate_child() : div_9.firstChild;
|
|
201
|
-
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_9);
|
|
240
|
+
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_9, true);
|
|
241
|
+
var ifs_3 = _$_.if_static(node_7, if_4, 0, show);
|
|
202
242
|
|
|
203
|
-
_$_.if(node_7, if_4, false, show);
|
|
204
243
|
_$_.hydrating && _$_.pop(div_9);
|
|
205
244
|
}
|
|
206
245
|
|
|
207
246
|
var button = _$_.hydrating ? _$_.hydrate_sibling() : div_9.nextSibling;
|
|
208
247
|
|
|
209
248
|
button.__click = () => show.value = !show.value;
|
|
249
|
+
_$_.render(render_3, { a: _$_.UNINITIALIZED, _a: show, _b: ifs_3 });
|
|
210
250
|
_$_.append(__anchor, fragment_3);
|
|
211
251
|
}));
|
|
212
252
|
|
|
@@ -215,7 +255,7 @@ function ElementWithChildrenThenIf_render(__anchor, __block) {
|
|
|
215
255
|
|
|
216
256
|
ElementWithChildrenThenIf[_$_.$r] = ElementWithChildrenThenIf_render;
|
|
217
257
|
|
|
218
|
-
var root_14 = _$_.
|
|
258
|
+
var root_14 = _$_.template_el('footer', ['class', 'footer'], 'Footer');
|
|
219
259
|
|
|
220
260
|
function consequent_4(__anchor, visible) {
|
|
221
261
|
var footer = root_14();
|
|
@@ -227,11 +267,20 @@ function if_5(visible) {
|
|
|
227
267
|
if (visible.value) return consequent_4;
|
|
228
268
|
}
|
|
229
269
|
|
|
230
|
-
var root_13 = _$_.template(`<section class=
|
|
270
|
+
var root_13 = _$_.template(`<section class=outer><article class=middle><div class=inner><p class=leaf><strong>Bold</strong><em>Italic</em></p></div></article></section><button class=btn>Toggle`, 1, 2);
|
|
271
|
+
|
|
272
|
+
function render_4(__prev) {
|
|
273
|
+
var __a = if_5(__prev._a);
|
|
274
|
+
|
|
275
|
+
if (__prev.a !== __a) {
|
|
276
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
231
280
|
var root_12 = _$_.template(`<!>`, 1, 1);
|
|
232
281
|
|
|
233
282
|
function DeepNestingThenIf_render(__anchor, __block) {
|
|
234
|
-
const visible = _$_.track(true, __block, '
|
|
283
|
+
const visible = _$_.track(true, __block, '14k9o72');
|
|
235
284
|
var fragment_4 = root_12();
|
|
236
285
|
var node_10 = _$_.first_child_frag(fragment_4);
|
|
237
286
|
|
|
@@ -241,15 +290,20 @@ function DeepNestingThenIf_render(__anchor, __block) {
|
|
|
241
290
|
|
|
242
291
|
{
|
|
243
292
|
var article = _$_.hydrating ? _$_.hydrate_child() : section_1.firstChild;
|
|
244
|
-
var node_9 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(section_1);
|
|
245
293
|
|
|
246
|
-
_$_.
|
|
294
|
+
var node_9 = _$_.hydrating
|
|
295
|
+
? _$_.hydrate_sibling()
|
|
296
|
+
: _$_.append_into(section_1, true);
|
|
297
|
+
|
|
298
|
+
var ifs_4 = _$_.if_static(node_9, if_5, 0, visible);
|
|
299
|
+
|
|
247
300
|
_$_.hydrating && _$_.pop(section_1);
|
|
248
301
|
}
|
|
249
302
|
|
|
250
303
|
var button_1 = _$_.hydrating ? _$_.hydrate_sibling() : section_1.nextSibling;
|
|
251
304
|
|
|
252
305
|
button_1.__click = () => visible.value = !visible.value;
|
|
306
|
+
_$_.render(render_4, { a: _$_.UNINITIALIZED, _a: visible, _b: ifs_4 });
|
|
253
307
|
_$_.append(__anchor, fragment_5);
|
|
254
308
|
}));
|
|
255
309
|
|
|
@@ -258,8 +312,8 @@ function DeepNestingThenIf_render(__anchor, __block) {
|
|
|
258
312
|
|
|
259
313
|
DeepNestingThenIf[_$_.$r] = DeepNestingThenIf_render;
|
|
260
314
|
|
|
261
|
-
var root_16 = _$_.template(`<pre class=
|
|
262
|
-
var root_17 = _$_.
|
|
315
|
+
var root_16 = _$_.template(`<pre class=code>const x = 1;`);
|
|
316
|
+
var root_17 = _$_.template_el('div', ['class', 'preview'], 'Preview content');
|
|
263
317
|
|
|
264
318
|
function consequent_5(__anchor, activeTab) {
|
|
265
319
|
var pre = root_16();
|
|
@@ -277,24 +331,31 @@ function if_6(activeTab) {
|
|
|
277
331
|
if (activeTab.value === 'code') return consequent_5; else return alternate;
|
|
278
332
|
}
|
|
279
333
|
|
|
280
|
-
var root_15 = _$_.template(`<div class=
|
|
334
|
+
var root_15 = _$_.template(`<div class=tabs><div class=tab-list><button class=tab>Code</button><button class=tab>Preview</button></div><div class=panel><!>`);
|
|
281
335
|
|
|
282
|
-
function
|
|
283
|
-
var
|
|
336
|
+
function render_5(__prev) {
|
|
337
|
+
var __activeTab_value = __prev._a.value;
|
|
338
|
+
var __a = __activeTab_value === 'code' ? 'true' : 'false';
|
|
284
339
|
|
|
285
340
|
if (__prev.a !== __a) {
|
|
286
|
-
|
|
341
|
+
__prev._b.setAttribute('aria-selected', __prev.a = __a);
|
|
287
342
|
}
|
|
288
343
|
|
|
289
|
-
var __b =
|
|
344
|
+
var __b = __activeTab_value === 'preview' ? 'true' : 'false';
|
|
290
345
|
|
|
291
346
|
if (__prev.b !== __b) {
|
|
292
|
-
|
|
347
|
+
__prev._c.setAttribute('aria-selected', __prev.b = __b);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
var __c = if_6(__prev._a);
|
|
351
|
+
|
|
352
|
+
if (__prev.c !== __c) {
|
|
353
|
+
_$_.if_update(__prev._d, __prev.c = __c);
|
|
293
354
|
}
|
|
294
355
|
}
|
|
295
356
|
|
|
296
357
|
function DomElementChildrenThenSibling_render(__anchor, __block) {
|
|
297
|
-
const activeTab = _$_.track('code', __block, '
|
|
358
|
+
const activeTab = _$_.track('code', __block, 'ebqq2n');
|
|
298
359
|
var div_12 = root_15();
|
|
299
360
|
|
|
300
361
|
{
|
|
@@ -316,18 +377,20 @@ function DomElementChildrenThenSibling_render(__anchor, __block) {
|
|
|
316
377
|
|
|
317
378
|
{
|
|
318
379
|
var node_11 = _$_.hydrating ? _$_.hydrate_child() : div_14.firstChild;
|
|
380
|
+
var ifs_5 = _$_.if_static(node_11, if_6, 0, activeTab);
|
|
319
381
|
|
|
320
|
-
_$_.if(node_11, if_6, false, activeTab);
|
|
321
382
|
_$_.hydrating && _$_.pop(div_14);
|
|
322
383
|
}
|
|
323
384
|
}
|
|
324
385
|
|
|
325
|
-
_$_.render(
|
|
386
|
+
_$_.render(render_5, {
|
|
326
387
|
a: void 0,
|
|
327
388
|
b: void 0,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
389
|
+
c: _$_.UNINITIALIZED,
|
|
390
|
+
_a: activeTab,
|
|
391
|
+
_b: button_2,
|
|
392
|
+
_c: button_3,
|
|
393
|
+
_d: ifs_5
|
|
331
394
|
});
|
|
332
395
|
|
|
333
396
|
_$_.append(__anchor, div_12);
|
|
@@ -335,13 +398,13 @@ function DomElementChildrenThenSibling_render(__anchor, __block) {
|
|
|
335
398
|
|
|
336
399
|
DomElementChildrenThenSibling[_$_.$r] = DomElementChildrenThenSibling_render;
|
|
337
400
|
|
|
338
|
-
var root_19 = _$_.template(`<div class=
|
|
401
|
+
var root_19 = _$_.template(`<div class=container><ul class=list><li class=item></li><li class=item>Another item</li></ul><h2 class=heading>Static Heading</h2><p class=para>Static paragraph</p></div><button class=inc>Increment`, 1, 2);
|
|
339
402
|
|
|
340
|
-
function
|
|
341
|
-
var __a = 'Item count: ' + String(__prev.
|
|
403
|
+
function render_6(__prev) {
|
|
404
|
+
var __a = 'Item count: ' + String(__prev._a.value ?? '');
|
|
342
405
|
|
|
343
406
|
if (__prev.a !== __a) {
|
|
344
|
-
_$_.set_text_content(__prev.
|
|
407
|
+
_$_.set_text_content(__prev._b, __a, __prev.a);
|
|
345
408
|
__prev.a = __a;
|
|
346
409
|
}
|
|
347
410
|
}
|
|
@@ -349,7 +412,7 @@ function render_1(__prev) {
|
|
|
349
412
|
var root_18 = _$_.template(`<!>`, 1, 1);
|
|
350
413
|
|
|
351
414
|
function DomChildrenThenStaticSiblings_render(__anchor, __block) {
|
|
352
|
-
const count = _$_.track(0, __block, '
|
|
415
|
+
const count = _$_.track(0, __block, '42buv9');
|
|
353
416
|
var fragment_6 = root_18();
|
|
354
417
|
var node_12 = _$_.first_child_frag(fragment_6);
|
|
355
418
|
|
|
@@ -372,7 +435,7 @@ function DomChildrenThenStaticSiblings_render(__anchor, __block) {
|
|
|
372
435
|
var button_4 = _$_.hydrating ? _$_.hydrate_sibling() : div_16.nextSibling;
|
|
373
436
|
|
|
374
437
|
button_4.__click = () => count.value++;
|
|
375
|
-
_$_.render(
|
|
438
|
+
_$_.render(render_6, { a: '', _a: count, _b: li });
|
|
376
439
|
_$_.append(__anchor, fragment_7);
|
|
377
440
|
}));
|
|
378
441
|
|
|
@@ -381,7 +444,7 @@ function DomChildrenThenStaticSiblings_render(__anchor, __block) {
|
|
|
381
444
|
|
|
382
445
|
DomChildrenThenStaticSiblings[_$_.$r] = DomChildrenThenStaticSiblings_render;
|
|
383
446
|
|
|
384
|
-
var root_20 = _$_.template(`<div class=
|
|
447
|
+
var root_20 = _$_.template(`<div class=wrapper><ul class=features><li><strong>Feature One</strong>: Description of feature one with <code>code</code> reference</li><li><strong>Feature Two</strong>: Another feature description</li><li><strong>Feature Three</strong>: Third feature</li></ul><h2 class=section-heading>Section Heading</h2><p class=section-content>Static paragraph with <a href=/link>a link</a> and more text.`);
|
|
385
448
|
|
|
386
449
|
function StaticListThenStaticSiblings_render(__anchor, __block) {
|
|
387
450
|
var div_17 = root_20();
|
|
@@ -391,8 +454,8 @@ function StaticListThenStaticSiblings_render(__anchor, __block) {
|
|
|
391
454
|
|
|
392
455
|
StaticListThenStaticSiblings[_$_.$r] = StaticListThenStaticSiblings_render;
|
|
393
456
|
|
|
394
|
-
var root_21 = _$_.
|
|
395
|
-
var root_22 = _$_.
|
|
457
|
+
var root_21 = _$_.template_el('span', ['class', 'root-if'], 'on');
|
|
458
|
+
var root_22 = _$_.template_el('span', ['class', 'root-if'], 'off');
|
|
396
459
|
|
|
397
460
|
function consequent_6(__anchor, props) {
|
|
398
461
|
var span = root_21();
|
|
@@ -410,19 +473,29 @@ function if_7(props) {
|
|
|
410
473
|
if (props.on.value) return consequent_6; else return alternate_1;
|
|
411
474
|
}
|
|
412
475
|
|
|
476
|
+
function render_7(__prev) {
|
|
477
|
+
var __a = if_7(__prev._a);
|
|
478
|
+
|
|
479
|
+
if (__prev.a !== __a) {
|
|
480
|
+
_$_.if_update(__prev._b, __prev.a = __a);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
413
484
|
function RootIfChild_render(__anchor, __block, props) {
|
|
414
|
-
_$_.
|
|
485
|
+
var ifs_6 = _$_.if_static(__anchor, if_7, 1, props);
|
|
486
|
+
|
|
487
|
+
_$_.render(render_7, { a: _$_.UNINITIALIZED, _a: props, _b: ifs_6 });
|
|
415
488
|
}
|
|
416
489
|
|
|
417
490
|
RootIfChild[_$_.$r] = RootIfChild_render;
|
|
418
491
|
|
|
419
|
-
var root_23 = _$_.
|
|
492
|
+
var root_23 = _$_.template_el('span', ['class', 'root-for']);
|
|
420
493
|
|
|
421
|
-
function
|
|
494
|
+
function render_8(__prev) {
|
|
422
495
|
var __a = __prev.$item;
|
|
423
496
|
|
|
424
497
|
if (__prev.a !== __a) {
|
|
425
|
-
_$_.set_text_content(__prev.
|
|
498
|
+
_$_.set_text_content(__prev._b, __a, __prev.a);
|
|
426
499
|
__prev.a = __a;
|
|
427
500
|
}
|
|
428
501
|
}
|
|
@@ -434,20 +507,20 @@ function RootForChild_render(__anchor, __block, props) {
|
|
|
434
507
|
(__anchor, pattern) => {
|
|
435
508
|
var span_2 = root_23();
|
|
436
509
|
|
|
437
|
-
_$_.item({ a: '', $item: pattern,
|
|
510
|
+
_$_.item({ a: '', $item: pattern, _b: span_2 });
|
|
438
511
|
_$_.append(__anchor, span_2);
|
|
439
512
|
},
|
|
440
513
|
144,
|
|
441
514
|
void 0,
|
|
442
515
|
void 0,
|
|
443
516
|
void 0,
|
|
444
|
-
|
|
517
|
+
render_8
|
|
445
518
|
);
|
|
446
519
|
}
|
|
447
520
|
|
|
448
521
|
RootForChild[_$_.$r] = RootForChild_render;
|
|
449
522
|
|
|
450
|
-
var root_24 = _$_.
|
|
523
|
+
var root_24 = _$_.template_el('span', ['class', 'trailing'], 'end');
|
|
451
524
|
|
|
452
525
|
function TrailingChild_render(__anchor, __block) {
|
|
453
526
|
var span_3 = root_24();
|
|
@@ -457,11 +530,11 @@ function TrailingChild_render(__anchor, __block) {
|
|
|
457
530
|
|
|
458
531
|
TrailingChild[_$_.$r] = TrailingChild_render;
|
|
459
532
|
|
|
460
|
-
var root_25 = _$_.template(`<div class=
|
|
533
|
+
var root_25 = _$_.template(`<div class=wrapper><div class=host></div><button class=toggle>Toggle</button><button class=rotate>Rotate`);
|
|
461
534
|
|
|
462
535
|
function ComponentChildrenWithControlFlowRoots_render(__anchor, __block) {
|
|
463
|
-
const on = _$_.track(true, __block, '
|
|
464
|
-
const items = _$_.track([1, 2, 3], __block, '
|
|
536
|
+
const on = _$_.track(true, __block, '1vo6ory');
|
|
537
|
+
const items = _$_.track([1, 2, 3], __block, 'c4uisw');
|
|
465
538
|
var div_18 = root_25();
|
|
466
539
|
|
|
467
540
|
{
|