ripple 0.4.0 → 0.4.2
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 +82 -0
- package/package.json +3 -2
- package/src/constants.js +4 -0
- package/src/jsx-runtime.d.ts +12 -2
- package/src/runtime/internal/client/constants.js +6 -0
- package/src/runtime/internal/client/for.js +224 -50
- package/src/runtime/internal/client/hydration.js +0 -16
- package/src/runtime/internal/client/index.js +2 -2
- package/src/runtime/internal/client/operations.js +1 -2
- package/src/runtime/internal/client/render.js +42 -4
- package/src/runtime/internal/client/runtime.js +45 -2
- package/src/runtime/internal/server/index.js +11 -6
- package/tests/client/basic/basic.attributes.test.tsrx +37 -0
- package/tests/client/compiler/compiler.basic.test.tsrx +2 -2
- package/tests/client/for-item.test.tsrx +404 -0
- package/tests/hydration/compiled/client/basic.js +29 -55
- package/tests/hydration/compiled/client/events.js +80 -67
- package/tests/hydration/compiled/client/for.js +95 -80
- package/tests/hydration/compiled/client/fragment-cursor.js +412 -344
- package/tests/hydration/compiled/client/head.js +4 -7
- package/tests/hydration/compiled/client/html.js +40 -64
- package/tests/hydration/compiled/client/if-children.js +30 -34
- package/tests/hydration/compiled/client/if-fragment-controlflow.js +7 -7
- package/tests/hydration/compiled/client/if.js +4 -4
- package/tests/hydration/compiled/client/mixed-control-flow.js +20 -50
- package/tests/hydration/compiled/client/nested-control-flow.js +97 -185
- package/tests/hydration/compiled/client/portal.js +2 -2
- package/tests/hydration/compiled/client/reactivity.js +17 -31
- package/tests/hydration/compiled/client/streaming.js +4 -8
- package/tests/hydration/compiled/client/typed-text.js +4 -15
- package/tests/hydration/compiled/server/events.js +5 -53
- package/tests/hydration/compiled/server/for.js +1 -9
- package/tests/hydration/compiled/server/fragment-cursor.js +36 -324
- package/tests/server/basic.attributes.test.tsrx +28 -0
- package/tests/server/basic.test.tsrx +23 -0
- package/tests/utils/jsx-runtime-types.test.js +67 -2
- package/tests/utils/tracked-types.test.js +117 -0
- package/types/index.d.ts +7 -8
- package/tests/client/compiler/__snapshots__/compiler.assignments.test.rsrx.snap +0 -12
- package/tests/client/compiler/__snapshots__/compiler.typescript.test.rsrx.snap +0 -46
|
@@ -208,13 +208,14 @@ function ConditionalTitle_render(__anchor, __block) {
|
|
|
208
208
|
|
|
209
209
|
ConditionalTitle[_$_.$r] = ConditionalTitle_render;
|
|
210
210
|
|
|
211
|
-
var root_17 = _$_.template(`<div><span
|
|
211
|
+
var root_17 = _$_.template(`<div><span></span></div>`, 0);
|
|
212
212
|
|
|
213
213
|
function render(__prev) {
|
|
214
214
|
var __a = __prev._count.value;
|
|
215
215
|
|
|
216
216
|
if (__prev.a !== __a) {
|
|
217
|
-
_$_.
|
|
217
|
+
_$_.set_text_content(__prev._span_1, __a, __prev.a);
|
|
218
|
+
__prev.a = __a;
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
221
|
|
|
@@ -231,10 +232,6 @@ function ComputedTitle_render(__anchor, __block) {
|
|
|
231
232
|
|
|
232
233
|
{
|
|
233
234
|
var span_1 = _$_.hydrating ? _$_.hydrate_child() : div_7.firstChild;
|
|
234
|
-
|
|
235
|
-
{
|
|
236
|
-
var expression_4 = _$_.hydrating ? _$_.hydrate_text() : span_1.firstChild;
|
|
237
|
-
}
|
|
238
235
|
}
|
|
239
236
|
|
|
240
237
|
_$_.head('60e9fce1', (__anchor) => {
|
|
@@ -243,7 +240,7 @@ function ComputedTitle_render(__anchor, __block) {
|
|
|
243
240
|
});
|
|
244
241
|
});
|
|
245
242
|
|
|
246
|
-
_$_.render(render, { a: '
|
|
243
|
+
_$_.render(render, { a: '', _count: count, _span_1: span_1 });
|
|
247
244
|
_$_.append(__anchor, div_7);
|
|
248
245
|
}));
|
|
249
246
|
|
|
@@ -289,13 +289,14 @@ function if_2(nextLink) {
|
|
|
289
289
|
if (nextLink) return consequent_1;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
var root_18 = _$_.template(`<li><a
|
|
292
|
+
var root_18 = _$_.template(`<li><a></a></li>`, 0);
|
|
293
293
|
|
|
294
294
|
function render_4(__prev) {
|
|
295
295
|
var __a = __prev._item.text;
|
|
296
296
|
|
|
297
297
|
if (__prev.a !== __a) {
|
|
298
|
-
_$_.
|
|
298
|
+
_$_.set_text_content(__prev._a_2, __a, __prev.a);
|
|
299
|
+
__prev.a = __a;
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
var __b = __prev._item.href;
|
|
@@ -322,23 +323,14 @@ function consequent_2(__anchor, toc) {
|
|
|
322
323
|
|
|
323
324
|
{
|
|
324
325
|
var a_2 = _$_.hydrating ? _$_.hydrate_child() : li.firstChild;
|
|
325
|
-
|
|
326
|
-
{
|
|
327
|
-
var expression_3 = _$_.hydrating ? _$_.hydrate_text() : a_2.firstChild;
|
|
328
|
-
}
|
|
329
326
|
}
|
|
330
327
|
|
|
331
|
-
_$_.
|
|
332
|
-
a: ' ',
|
|
333
|
-
b: void 0,
|
|
334
|
-
_item: item,
|
|
335
|
-
_expression_3: expression_3,
|
|
336
|
-
_a_2: a_2
|
|
337
|
-
});
|
|
338
|
-
|
|
328
|
+
_$_.item({ a: '', b: void 0, _item: item, _a_2: a_2 });
|
|
339
329
|
_$_.append(__anchor, li);
|
|
340
330
|
},
|
|
341
|
-
4
|
|
331
|
+
4,
|
|
332
|
+
void 0,
|
|
333
|
+
render_4
|
|
342
334
|
);
|
|
343
335
|
|
|
344
336
|
_$_.hydrating && _$_.pop(ul);
|
|
@@ -352,7 +344,7 @@ function if_3(toc) {
|
|
|
352
344
|
if (toc.length > 0) return consequent_2;
|
|
353
345
|
}
|
|
354
346
|
|
|
355
|
-
var root_14 = _$_.template(`<div class="layout"><div class="content-container"><article><div><!></div></article
|
|
347
|
+
var root_14 = _$_.template(`<div class="layout"><div class="content-container"><article><div><!></div></article></div><aside><!></aside></div>`, 0);
|
|
356
348
|
|
|
357
349
|
function DocLayout_render(
|
|
358
350
|
__anchor,
|
|
@@ -380,11 +372,11 @@ function DocLayout_render(
|
|
|
380
372
|
|
|
381
373
|
_$_.hydrating && _$_.pop(article);
|
|
382
374
|
|
|
383
|
-
var node_5 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
375
|
+
var node_5 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_14);
|
|
384
376
|
|
|
385
377
|
_$_.if(node_5, if_1, false, editPath);
|
|
386
378
|
|
|
387
|
-
var node_6 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
379
|
+
var node_6 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_14);
|
|
388
380
|
|
|
389
381
|
_$_.if(node_6, if_2, false, nextLink);
|
|
390
382
|
|
|
@@ -650,7 +642,7 @@ function HtmlAfterIfInChildren_render(__anchor, __block) {
|
|
|
650
642
|
|
|
651
643
|
HtmlAfterIfInChildren[_$_.$r] = HtmlAfterIfInChildren_render;
|
|
652
644
|
|
|
653
|
-
var root_30 = _$_.template(`<span class="for-item"
|
|
645
|
+
var root_30 = _$_.template(`<span class="for-item"></span>`, 0);
|
|
654
646
|
|
|
655
647
|
function ForList_render(__anchor, __block, { items }) {
|
|
656
648
|
_$_.for(
|
|
@@ -660,9 +652,7 @@ function ForList_render(__anchor, __block, { items }) {
|
|
|
660
652
|
var span = root_30();
|
|
661
653
|
|
|
662
654
|
{
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
expression_11.nodeValue = item;
|
|
655
|
+
span.textContent = item;
|
|
666
656
|
}
|
|
667
657
|
|
|
668
658
|
_$_.append(__anchor, span);
|
|
@@ -695,7 +685,7 @@ function HtmlAfterForInChildren_render(__anchor, __block) {
|
|
|
695
685
|
|
|
696
686
|
HtmlAfterForInChildren[_$_.$r] = HtmlAfterForInChildren_render;
|
|
697
687
|
|
|
698
|
-
var root_32 = _$_.template(`<div class="try-box"
|
|
688
|
+
var root_32 = _$_.template(`<div class="try-box"></div>`, 0);
|
|
699
689
|
var root_33 = _$_.template(`<span>error</span>`, 0);
|
|
700
690
|
|
|
701
691
|
function TryBox_render(__anchor, __block, { value }) {
|
|
@@ -705,9 +695,7 @@ function TryBox_render(__anchor, __block, { value }) {
|
|
|
705
695
|
var div_26 = root_32();
|
|
706
696
|
|
|
707
697
|
{
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
expression_12.nodeValue = value;
|
|
698
|
+
div_26.textContent = value;
|
|
711
699
|
}
|
|
712
700
|
|
|
713
701
|
_$_.append(__anchor, div_26);
|
|
@@ -813,7 +801,7 @@ function if_5(active) {
|
|
|
813
801
|
if (active) return consequent_4;
|
|
814
802
|
}
|
|
815
803
|
|
|
816
|
-
var root_38 = _$_.template(`<div><!><a><span
|
|
804
|
+
var root_38 = _$_.template(`<div><!><a><span></span></a></div>`, 0);
|
|
817
805
|
|
|
818
806
|
function NavItem_render(__anchor, __block, { href, text: label, active = false }) {
|
|
819
807
|
var div_27 = root_38();
|
|
@@ -833,9 +821,7 @@ function NavItem_render(__anchor, __block, { href, text: label, active = false }
|
|
|
833
821
|
var span_3 = _$_.hydrating ? _$_.hydrate_child() : a_3.firstChild;
|
|
834
822
|
|
|
835
823
|
{
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
expression_15.nodeValue = label;
|
|
824
|
+
span_3.textContent = label;
|
|
839
825
|
}
|
|
840
826
|
}
|
|
841
827
|
|
|
@@ -866,7 +852,7 @@ function if_6({ expanded, children }) {
|
|
|
866
852
|
if (expanded.value) return consequent_5;
|
|
867
853
|
}
|
|
868
854
|
|
|
869
|
-
var root_40 = _$_.template(`<section class="sidebar-section"><div class="section-header"><h2
|
|
855
|
+
var root_40 = _$_.template(`<section class="sidebar-section"><div class="section-header"><h2></h2><button>Toggle</button></div></section>`, 0);
|
|
870
856
|
|
|
871
857
|
function SidebarSection_render(__anchor, __block, { title, children }) {
|
|
872
858
|
const expanded = _$_.track(true, __block, '6ac6906f');
|
|
@@ -879,9 +865,7 @@ function SidebarSection_render(__anchor, __block, { title, children }) {
|
|
|
879
865
|
var h2_2 = _$_.hydrating ? _$_.hydrate_child() : div_29.firstChild;
|
|
880
866
|
|
|
881
867
|
{
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
expression_16.nodeValue = title;
|
|
868
|
+
h2_2.textContent = title;
|
|
885
869
|
}
|
|
886
870
|
|
|
887
871
|
var button = _$_.hydrating ? _$_.hydrate_sibling() : h2_2.nextSibling;
|
|
@@ -891,7 +875,7 @@ function SidebarSection_render(__anchor, __block, { title, children }) {
|
|
|
891
875
|
|
|
892
876
|
_$_.hydrating && _$_.pop(div_29);
|
|
893
877
|
|
|
894
|
-
var node_20 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
878
|
+
var node_20 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(section_1);
|
|
895
879
|
|
|
896
880
|
_$_.if(node_20, if_6, false, { expanded, children });
|
|
897
881
|
_$_.hydrating && _$_.pop(section_1);
|
|
@@ -1006,7 +990,7 @@ function if_7() {
|
|
|
1006
990
|
if (true) return consequent_6;
|
|
1007
991
|
}
|
|
1008
992
|
|
|
1009
|
-
var root_46 = _$_.template(`<div class="layout"><!><div class="content-wrapper"><!><main class="main-content"><div class="article"><div><h1>Introduction</h1><p>Welcome to the docs.</p></div></div
|
|
993
|
+
var root_46 = _$_.template(`<div class="layout"><!><div class="content-wrapper"><!><main class="main-content"><div class="article"><div><h1>Introduction</h1><p>Welcome to the docs.</p></div></div></main></div></div>`, 0);
|
|
1010
994
|
|
|
1011
995
|
function LayoutWithSidebarAndMain_render(__anchor, __block) {
|
|
1012
996
|
var div_33 = root_46();
|
|
@@ -1027,7 +1011,7 @@ function LayoutWithSidebarAndMain_render(__anchor, __block) {
|
|
|
1027
1011
|
|
|
1028
1012
|
{
|
|
1029
1013
|
var div_35 = _$_.hydrating ? _$_.hydrate_child() : main.firstChild;
|
|
1030
|
-
var node_27 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1014
|
+
var node_27 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(main);
|
|
1031
1015
|
|
|
1032
1016
|
_$_.if(node_27, if_7);
|
|
1033
1017
|
|
|
@@ -1104,7 +1088,7 @@ function if_9() {
|
|
|
1104
1088
|
if (true) return consequent_8;
|
|
1105
1089
|
}
|
|
1106
1090
|
|
|
1107
|
-
var root_50 = _$_.template(`<div class="content-container"
|
|
1091
|
+
var root_50 = _$_.template(`<div class="content-container"><!><!><!><!></div>`, 0);
|
|
1108
1092
|
|
|
1109
1093
|
function ArticleWithChildrenThenSibling_render(__anchor, __block) {
|
|
1110
1094
|
var div_38 = root_50();
|
|
@@ -1129,7 +1113,7 @@ function ArticleWithChildrenThenSibling_render(__anchor, __block) {
|
|
|
1129
1113
|
|
|
1130
1114
|
_$_.if(node_31, if_9);
|
|
1131
1115
|
|
|
1132
|
-
var node_32 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1116
|
+
var node_32 = _$_.hydrating ? _$_.hydrate_sibling() : node_31.nextSibling;
|
|
1133
1117
|
|
|
1134
1118
|
_$_.render_component(SimpleFooter, node_32, {});
|
|
1135
1119
|
_$_.hydrating && _$_.pop(div_38);
|
|
@@ -1153,7 +1137,7 @@ function if_10() {
|
|
|
1153
1137
|
if (true) return consequent_9;
|
|
1154
1138
|
}
|
|
1155
1139
|
|
|
1156
|
-
var root_54 = _$_.template(`<div class="content-container"
|
|
1140
|
+
var root_54 = _$_.template(`<div class="content-container"><!><!><!></div>`, 0);
|
|
1157
1141
|
|
|
1158
1142
|
function ArticleWithHtmlChildThenSibling_render(__anchor, __block) {
|
|
1159
1143
|
const htmlContent = '<pre><code>const x = 1;</code></pre>';
|
|
@@ -1175,7 +1159,7 @@ function ArticleWithHtmlChildThenSibling_render(__anchor, __block) {
|
|
|
1175
1159
|
|
|
1176
1160
|
_$_.if(node_34, if_10);
|
|
1177
1161
|
|
|
1178
|
-
var node_35 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1162
|
+
var node_35 = _$_.hydrating ? _$_.hydrate_sibling() : node_34.nextSibling;
|
|
1179
1163
|
|
|
1180
1164
|
_$_.render_component(SimpleFooter, node_35, {});
|
|
1181
1165
|
_$_.hydrating && _$_.pop(div_40);
|
|
@@ -1198,7 +1182,7 @@ function if_11() {
|
|
|
1198
1182
|
if (true) return consequent_10;
|
|
1199
1183
|
}
|
|
1200
1184
|
|
|
1201
|
-
var root_57 = _$_.template(`<div class="content-container"><article class="doc-content"><div><!></div></article
|
|
1185
|
+
var root_57 = _$_.template(`<div class="content-container"><article class="doc-content"><div><!></div></article></div>`, 0);
|
|
1202
1186
|
|
|
1203
1187
|
function InlineArticleLayout_render(__anchor, __block, { children }) {
|
|
1204
1188
|
var div_43 = root_57();
|
|
@@ -1219,7 +1203,7 @@ function InlineArticleLayout_render(__anchor, __block, { children }) {
|
|
|
1219
1203
|
|
|
1220
1204
|
_$_.hydrating && _$_.pop(article_2);
|
|
1221
1205
|
|
|
1222
|
-
var node_36 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1206
|
+
var node_36 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_43);
|
|
1223
1207
|
|
|
1224
1208
|
_$_.if(node_36, if_11);
|
|
1225
1209
|
|
|
@@ -1325,7 +1309,7 @@ function if_13(nextLink) {
|
|
|
1325
1309
|
if (nextLink) return consequent_12;
|
|
1326
1310
|
}
|
|
1327
1311
|
|
|
1328
|
-
var root_63 = _$_.template(`<div class="layout"><!><div class="docs-wrapper"><!><main class="docs-main"><div class="docs-container"><div class="content"><div class="content-container"><article class="doc-content"><div><!></div></article
|
|
1312
|
+
var root_63 = _$_.template(`<div class="layout"><!><div class="docs-wrapper"><!><main class="docs-main"><div class="docs-container"><div class="content"><div class="content-container"><article class="doc-content"><div><!></div></article></div></div></div></main></div></div>`, 0);
|
|
1329
1313
|
|
|
1330
1314
|
function DocsLayoutInner_render(
|
|
1331
1315
|
__anchor,
|
|
@@ -1373,11 +1357,11 @@ function DocsLayoutInner_render(
|
|
|
1373
1357
|
|
|
1374
1358
|
_$_.hydrating && _$_.pop(article_3);
|
|
1375
1359
|
|
|
1376
|
-
var node_40 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1360
|
+
var node_40 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_49);
|
|
1377
1361
|
|
|
1378
1362
|
_$_.if(node_40, if_12, false, editPath);
|
|
1379
1363
|
|
|
1380
|
-
var node_41 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1364
|
+
var node_41 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_49);
|
|
1381
1365
|
|
|
1382
1366
|
_$_.if(node_41, if_13, false, nextLink);
|
|
1383
1367
|
|
|
@@ -1550,13 +1534,14 @@ function if_17({ prevLink, nextLink }) {
|
|
|
1550
1534
|
if (prevLink || nextLink) return consequent_16;
|
|
1551
1535
|
}
|
|
1552
1536
|
|
|
1553
|
-
var root_75 = _$_.template(`<a
|
|
1537
|
+
var root_75 = _$_.template(`<a></a>`, 0);
|
|
1554
1538
|
|
|
1555
1539
|
function render_8(__prev) {
|
|
1556
1540
|
var __a = __prev._item.text;
|
|
1557
1541
|
|
|
1558
1542
|
if (__prev.a !== __a) {
|
|
1559
|
-
_$_.
|
|
1543
|
+
_$_.set_text_content(__prev._a_8, __a, __prev.a);
|
|
1544
|
+
__prev.a = __a;
|
|
1560
1545
|
}
|
|
1561
1546
|
|
|
1562
1547
|
var __b = __prev._item.href;
|
|
@@ -1581,21 +1566,12 @@ function consequent_17(__anchor, toc) {
|
|
|
1581
1566
|
(__anchor, item) => {
|
|
1582
1567
|
var a_8 = root_75();
|
|
1583
1568
|
|
|
1584
|
-
{
|
|
1585
|
-
var expression_25 = _$_.hydrating ? _$_.hydrate_text() : a_8.firstChild;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
_$_.render(render_8, {
|
|
1589
|
-
a: ' ',
|
|
1590
|
-
b: void 0,
|
|
1591
|
-
_item: item,
|
|
1592
|
-
_expression_25: expression_25,
|
|
1593
|
-
_a_8: a_8
|
|
1594
|
-
});
|
|
1595
|
-
|
|
1569
|
+
_$_.item({ a: '', b: void 0, _item: item, _a_8: a_8 });
|
|
1596
1570
|
_$_.append(__anchor, a_8);
|
|
1597
1571
|
},
|
|
1598
|
-
4
|
|
1572
|
+
4,
|
|
1573
|
+
void 0,
|
|
1574
|
+
render_8
|
|
1599
1575
|
);
|
|
1600
1576
|
|
|
1601
1577
|
_$_.hydrating && _$_.pop(nav_5);
|
|
@@ -1609,7 +1585,7 @@ function if_18(toc) {
|
|
|
1609
1585
|
if (toc.length > 0) return consequent_17;
|
|
1610
1586
|
}
|
|
1611
1587
|
|
|
1612
|
-
var root_68 = _$_.template(`<div class="layout"><!><div class="docs-wrapper"><!><main class="docs-main"><div class="docs-container"><div class="content"><div class="content-container"><article class="doc-content"><div><!></div></article
|
|
1588
|
+
var root_68 = _$_.template(`<div class="layout"><!><div class="docs-wrapper"><!><main class="docs-main"><div class="docs-container"><div class="content"><div class="content-container"><article class="doc-content"><div><!></div></article></div></div><aside class="aside"><!></aside></div></main></div></div>`, 0);
|
|
1613
1589
|
|
|
1614
1590
|
function DocsLayoutExact_render(
|
|
1615
1591
|
__anchor,
|
|
@@ -1663,11 +1639,11 @@ function DocsLayoutExact_render(
|
|
|
1663
1639
|
|
|
1664
1640
|
_$_.hydrating && _$_.pop(article_4);
|
|
1665
1641
|
|
|
1666
|
-
var node_45 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1642
|
+
var node_45 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_58);
|
|
1667
1643
|
|
|
1668
1644
|
_$_.if(node_45, if_14, false, editPath);
|
|
1669
1645
|
|
|
1670
|
-
var node_46 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
1646
|
+
var node_46 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_58);
|
|
1671
1647
|
|
|
1672
1648
|
_$_.if(node_46, if_17, false, { prevLink, nextLink });
|
|
1673
1649
|
|
|
@@ -20,7 +20,7 @@ function if_1({ expanded, children }) {
|
|
|
20
20
|
if (expanded.value) return consequent;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
var root = _$_.template(`<div class="container"><div role="button" class="header">Toggle</div
|
|
23
|
+
var root = _$_.template(`<div class="container"><div role="button" class="header">Toggle</div></div>`, 0);
|
|
24
24
|
|
|
25
25
|
function IfWithChildren_render(__anchor, __block, { children }) {
|
|
26
26
|
const expanded = _$_.track(true, __block, 'c64714b1');
|
|
@@ -31,7 +31,7 @@ function IfWithChildren_render(__anchor, __block, { children }) {
|
|
|
31
31
|
|
|
32
32
|
div_1.__click = () => expanded.value = !expanded.value;
|
|
33
33
|
|
|
34
|
-
var node = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
34
|
+
var node = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div);
|
|
35
35
|
|
|
36
36
|
_$_.if(node, if_1, false, { expanded, children });
|
|
37
37
|
_$_.hydrating && _$_.pop(div);
|
|
@@ -42,15 +42,13 @@ function IfWithChildren_render(__anchor, __block, { children }) {
|
|
|
42
42
|
|
|
43
43
|
IfWithChildren[_$_.$r] = IfWithChildren_render;
|
|
44
44
|
|
|
45
|
-
var root_2 = _$_.template(`<div class="item"
|
|
45
|
+
var root_2 = _$_.template(`<div class="item"></div>`, 0);
|
|
46
46
|
|
|
47
47
|
function ChildItem_render(__anchor, __block, { text: label }) {
|
|
48
48
|
var div_3 = root_2();
|
|
49
49
|
|
|
50
50
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
expression_1.nodeValue = label;
|
|
51
|
+
div_3.textContent = label;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
_$_.append(__anchor, div_3);
|
|
@@ -90,7 +88,7 @@ function if_2(expanded) {
|
|
|
90
88
|
if (expanded.value) return consequent_1;
|
|
91
89
|
}
|
|
92
90
|
|
|
93
|
-
var root_4 = _$_.template(`<div class="container"><div role="button" class="header">Toggle</div
|
|
91
|
+
var root_4 = _$_.template(`<div class="container"><div role="button" class="header">Toggle</div></div>`, 0);
|
|
94
92
|
|
|
95
93
|
function IfWithStaticChildren_render(__anchor, __block) {
|
|
96
94
|
const expanded = _$_.track(true, __block, '3bba8f77');
|
|
@@ -101,7 +99,7 @@ function IfWithStaticChildren_render(__anchor, __block) {
|
|
|
101
99
|
|
|
102
100
|
div_5.__click = () => expanded.value = !expanded.value;
|
|
103
101
|
|
|
104
|
-
var node_3 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
102
|
+
var node_3 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_4);
|
|
105
103
|
|
|
106
104
|
_$_.if(node_3, if_2, false, expanded);
|
|
107
105
|
_$_.hydrating && _$_.pop(div_4);
|
|
@@ -131,7 +129,7 @@ function if_3({ expanded, children }) {
|
|
|
131
129
|
if (expanded.value) return consequent_2;
|
|
132
130
|
}
|
|
133
131
|
|
|
134
|
-
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"></path></svg></div></div
|
|
132
|
+
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"></path></svg></div></div></section>`, 0);
|
|
135
133
|
|
|
136
134
|
function IfWithSiblingsAndChildren_render(__anchor, __block, { children }) {
|
|
137
135
|
const expanded = _$_.track(true, __block, 'a1b8fb4c');
|
|
@@ -143,7 +141,7 @@ function IfWithSiblingsAndChildren_render(__anchor, __block, { children }) {
|
|
|
143
141
|
div_7.__click = () => expanded.value = !expanded.value;
|
|
144
142
|
_$_.hydrating && _$_.pop(div_7);
|
|
145
143
|
|
|
146
|
-
var node_4 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
144
|
+
var node_4 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(section);
|
|
147
145
|
|
|
148
146
|
_$_.if(node_4, if_3, false, { expanded, children });
|
|
149
147
|
_$_.hydrating && _$_.pop(section);
|
|
@@ -186,7 +184,7 @@ function if_4(show) {
|
|
|
186
184
|
if (show.value) return consequent_3;
|
|
187
185
|
}
|
|
188
186
|
|
|
189
|
-
var root_10 = _$_.template(`<div class="wrapper"><div class="nested-parent"><div class="nested-child"><span class="deep">Deep content</span></div></div
|
|
187
|
+
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</button>`, 1, 2);
|
|
190
188
|
var root_9 = _$_.template(`<!>`, 1, 1);
|
|
191
189
|
|
|
192
190
|
function ElementWithChildrenThenIf_render(__anchor, __block) {
|
|
@@ -196,17 +194,17 @@ function ElementWithChildrenThenIf_render(__anchor, __block) {
|
|
|
196
194
|
|
|
197
195
|
_$_.expression(node_8, () => _$_.tsrx_element((__anchor, __block) => {
|
|
198
196
|
var fragment_3 = root_10();
|
|
199
|
-
var
|
|
197
|
+
var div_9 = _$_.first_child_frag(fragment_3);
|
|
200
198
|
|
|
201
199
|
{
|
|
202
|
-
var
|
|
203
|
-
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : div_9
|
|
200
|
+
var div_10 = _$_.hydrating ? _$_.hydrate_child() : div_9.firstChild;
|
|
201
|
+
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_9);
|
|
204
202
|
|
|
205
203
|
_$_.if(node_7, if_4, false, show);
|
|
206
|
-
_$_.hydrating && _$_.pop(
|
|
204
|
+
_$_.hydrating && _$_.pop(div_9);
|
|
207
205
|
}
|
|
208
206
|
|
|
209
|
-
var button = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
207
|
+
var button = _$_.hydrating ? _$_.hydrate_sibling() : div_9.nextSibling;
|
|
210
208
|
|
|
211
209
|
button.__click = () => show.value = !show.value;
|
|
212
210
|
_$_.append(__anchor, fragment_3);
|
|
@@ -229,7 +227,7 @@ function if_5(visible) {
|
|
|
229
227
|
if (visible.value) return consequent_4;
|
|
230
228
|
}
|
|
231
229
|
|
|
232
|
-
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
|
|
230
|
+
var root_13 = _$_.template(`<section class="outer"><article class="middle"><div class="inner"><p class="leaf"><strong>Bold</strong><em>Italic</em></p></div></article></section><button class="btn">Toggle</button>`, 1, 2);
|
|
233
231
|
var root_12 = _$_.template(`<!>`, 1, 1);
|
|
234
232
|
|
|
235
233
|
function DeepNestingThenIf_render(__anchor, __block) {
|
|
@@ -243,7 +241,7 @@ function DeepNestingThenIf_render(__anchor, __block) {
|
|
|
243
241
|
|
|
244
242
|
{
|
|
245
243
|
var article = _$_.hydrating ? _$_.hydrate_child() : section_1.firstChild;
|
|
246
|
-
var node_9 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
244
|
+
var node_9 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(section_1);
|
|
247
245
|
|
|
248
246
|
_$_.if(node_9, if_5, false, visible);
|
|
249
247
|
_$_.hydrating && _$_.pop(section_1);
|
|
@@ -337,13 +335,14 @@ function DomElementChildrenThenSibling_render(__anchor, __block) {
|
|
|
337
335
|
|
|
338
336
|
DomElementChildrenThenSibling[_$_.$r] = DomElementChildrenThenSibling_render;
|
|
339
337
|
|
|
340
|
-
var root_19 = _$_.template(`<div class="container"><ul class="list"><li class="item"
|
|
338
|
+
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</button>`, 1, 2);
|
|
341
339
|
|
|
342
340
|
function render_1(__prev) {
|
|
343
341
|
var __a = 'Item count: ' + String(__prev._count.value ?? '');
|
|
344
342
|
|
|
345
343
|
if (__prev.a !== __a) {
|
|
346
|
-
_$_.
|
|
344
|
+
_$_.set_text_content(__prev._li, __a, __prev.a);
|
|
345
|
+
__prev.a = __a;
|
|
347
346
|
}
|
|
348
347
|
}
|
|
349
348
|
|
|
@@ -363,10 +362,6 @@ function DomChildrenThenStaticSiblings_render(__anchor, __block) {
|
|
|
363
362
|
|
|
364
363
|
{
|
|
365
364
|
var li = _$_.hydrating ? _$_.hydrate_child() : ul.firstChild;
|
|
366
|
-
|
|
367
|
-
{
|
|
368
|
-
var expression_3 = _$_.hydrating ? _$_.hydrate_text() : li.firstChild;
|
|
369
|
-
}
|
|
370
365
|
}
|
|
371
366
|
|
|
372
367
|
_$_.hydrating && _$_.pop(ul);
|
|
@@ -377,7 +372,7 @@ function DomChildrenThenStaticSiblings_render(__anchor, __block) {
|
|
|
377
372
|
var button_4 = _$_.hydrating ? _$_.hydrate_sibling() : div_16.nextSibling;
|
|
378
373
|
|
|
379
374
|
button_4.__click = () => count.value++;
|
|
380
|
-
_$_.render(render_1, { a: '
|
|
375
|
+
_$_.render(render_1, { a: '', _count: count, _li: li });
|
|
381
376
|
_$_.append(__anchor, fragment_7);
|
|
382
377
|
}));
|
|
383
378
|
|
|
@@ -421,13 +416,14 @@ function RootIfChild_render(__anchor, __block, props) {
|
|
|
421
416
|
|
|
422
417
|
RootIfChild[_$_.$r] = RootIfChild_render;
|
|
423
418
|
|
|
424
|
-
var root_23 = _$_.template(`<span class="root-for"
|
|
419
|
+
var root_23 = _$_.template(`<span class="root-for"></span>`, 0);
|
|
425
420
|
|
|
426
421
|
function render_2(__prev) {
|
|
427
|
-
var __a =
|
|
422
|
+
var __a = __prev.$item;
|
|
428
423
|
|
|
429
424
|
if (__prev.a !== __a) {
|
|
430
|
-
_$_.
|
|
425
|
+
_$_.set_text_content(__prev._span_2, __a, __prev.a);
|
|
426
|
+
__prev.a = __a;
|
|
431
427
|
}
|
|
432
428
|
}
|
|
433
429
|
|
|
@@ -438,14 +434,14 @@ function RootForChild_render(__anchor, __block, props) {
|
|
|
438
434
|
(__anchor, pattern) => {
|
|
439
435
|
var span_2 = root_23();
|
|
440
436
|
|
|
441
|
-
{
|
|
442
|
-
var expression_4 = _$_.hydrating ? _$_.hydrate_text() : span_2.firstChild;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
_$_.render(render_2, { a: ' ', _pattern: pattern, _expression_4: expression_4 });
|
|
437
|
+
_$_.item({ a: '', $item: pattern, _span_2: span_2 });
|
|
446
438
|
_$_.append(__anchor, span_2);
|
|
447
439
|
},
|
|
448
|
-
|
|
440
|
+
144,
|
|
441
|
+
void 0,
|
|
442
|
+
void 0,
|
|
443
|
+
void 0,
|
|
444
|
+
render_2
|
|
449
445
|
);
|
|
450
446
|
}
|
|
451
447
|
|
|
@@ -24,7 +24,7 @@ function consequent(__anchor, { hasLoaded, muzes }) {
|
|
|
24
24
|
_$_.append(__anchor, p);
|
|
25
25
|
},
|
|
26
26
|
0,
|
|
27
|
-
(pattern) =>
|
|
27
|
+
(pattern) => pattern.muzeId
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
_$_.next();
|
|
@@ -101,7 +101,7 @@ function consequent_3(__anchor, { hasLoaded, muzes }) {
|
|
|
101
101
|
_$_.append(__anchor, p_1);
|
|
102
102
|
},
|
|
103
103
|
0,
|
|
104
|
-
(pattern_1) =>
|
|
104
|
+
(pattern_1) => pattern_1.muzeId
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
var node_4 = _$_.hydrating ? _$_.hydrate_sibling() : node_3.nextSibling;
|
|
@@ -197,7 +197,7 @@ function ComponentBodyFragmentControlFlow_render(__anchor, __block) {
|
|
|
197
197
|
_$_.append(__anchor, p_2);
|
|
198
198
|
},
|
|
199
199
|
0,
|
|
200
|
-
(pattern_2) =>
|
|
200
|
+
(pattern_2) => pattern_2.muzeId
|
|
201
201
|
);
|
|
202
202
|
|
|
203
203
|
_$_.next();
|
|
@@ -241,7 +241,7 @@ function ComponentBodyCodeBlockControlFlow_render(__anchor, __block) {
|
|
|
241
241
|
_$_.append(__anchor, p_3);
|
|
242
242
|
},
|
|
243
243
|
16,
|
|
244
|
-
(pattern_3) =>
|
|
244
|
+
(pattern_3) => pattern_3.muzeId
|
|
245
245
|
);
|
|
246
246
|
}));
|
|
247
247
|
|
|
@@ -280,7 +280,7 @@ function consequent_5(__anchor, { hasLoaded, muzes }) {
|
|
|
280
280
|
_$_.append(__anchor, p_4);
|
|
281
281
|
},
|
|
282
282
|
16,
|
|
283
|
-
(pattern_4) =>
|
|
283
|
+
(pattern_4) => pattern_4.muzeId
|
|
284
284
|
);
|
|
285
285
|
}));
|
|
286
286
|
|
|
@@ -341,7 +341,7 @@ function alternate(__anchor, { hasLoaded, muzes }) {
|
|
|
341
341
|
_$_.append(__anchor, p_5);
|
|
342
342
|
},
|
|
343
343
|
0,
|
|
344
|
-
(pattern_5) =>
|
|
344
|
+
(pattern_5) => pattern_5.muzeId
|
|
345
345
|
);
|
|
346
346
|
|
|
347
347
|
_$_.next();
|
|
@@ -396,7 +396,7 @@ function consequent_7(__anchor, { hasLoaded, muzes }) {
|
|
|
396
396
|
_$_.append(__anchor, p_6);
|
|
397
397
|
},
|
|
398
398
|
0,
|
|
399
|
-
(pattern_6) =>
|
|
399
|
+
(pattern_6) => pattern_6.muzeId
|
|
400
400
|
);
|
|
401
401
|
|
|
402
402
|
_$_.hydrating && _$_.pop(section);
|
|
@@ -165,14 +165,14 @@ function if_6(inner) {
|
|
|
165
165
|
if (inner.value) return consequent_5;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
var root_13 = _$_.template(`<div class="outer-content">Outer
|
|
168
|
+
var root_13 = _$_.template(`<div class="outer-content">Outer</div>`, 0);
|
|
169
169
|
|
|
170
170
|
function consequent_6(__anchor, { outer, inner }) {
|
|
171
171
|
var div_7 = root_13();
|
|
172
172
|
|
|
173
173
|
{
|
|
174
174
|
var expression = _$_.hydrating ? _$_.hydrate_child() : div_7.firstChild;
|
|
175
|
-
var node_5 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
175
|
+
var node_5 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_7);
|
|
176
176
|
|
|
177
177
|
_$_.if(node_5, if_6, false, inner);
|
|
178
178
|
_$_.hydrating && _$_.pop(div_7);
|
|
@@ -245,7 +245,7 @@ function if_8(status) {
|
|
|
245
245
|
if (status.value === 'loading') return consequent_7; else if (status.value === 'success') return consequent_8; else return alternate_2;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
var root_15 = _$_.template(`<div><button class="success">Success</button><button class="error">Error</button><button class="loading">Loading</button
|
|
248
|
+
var root_15 = _$_.template(`<div><button class="success">Success</button><button class="error">Error</button><button class="loading">Loading</button></div>`, 0);
|
|
249
249
|
|
|
250
250
|
function IfElseIfChain_render(__anchor, __block) {
|
|
251
251
|
const status = _$_.track('loading', __block, '4c69c94a');
|
|
@@ -270,7 +270,7 @@ function IfElseIfChain_render(__anchor, __block) {
|
|
|
270
270
|
status.value = 'loading';
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
-
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() :
|
|
273
|
+
var node_7 = _$_.hydrating ? _$_.hydrate_sibling() : _$_.append_into(div_8);
|
|
274
274
|
|
|
275
275
|
_$_.if(node_7, if_8, false, status);
|
|
276
276
|
_$_.hydrating && _$_.pop(div_8);
|