ripple 0.2.208 → 0.2.210
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 +43 -0
- package/README.md +2 -1
- package/package.json +2 -6
- package/shims/rollup-estree-types.d.ts +1 -1
- package/src/compiler/index.d.ts +1 -0
- package/src/compiler/index.js +7 -1
- package/src/compiler/phases/1-parse/index.js +15 -6
- package/src/compiler/phases/2-analyze/css-analyze.js +100 -104
- package/src/compiler/phases/2-analyze/index.js +215 -2
- package/src/compiler/phases/3-transform/client/index.js +388 -50
- package/src/compiler/phases/3-transform/segments.js +123 -39
- package/src/compiler/phases/3-transform/server/index.js +266 -13
- package/src/compiler/types/index.d.ts +16 -3
- package/src/compiler/utils.js +1 -15
- package/src/constants.js +0 -2
- package/src/helpers.d.ts +4 -0
- package/src/html-tree-validation.js +211 -0
- package/src/jsx-runtime.d.ts +260 -259
- package/src/jsx-runtime.js +12 -12
- package/src/runtime/array.js +17 -17
- package/src/runtime/create-subscriber.js +1 -1
- package/src/runtime/index-client.js +1 -5
- package/src/runtime/index-server.js +15 -0
- package/src/runtime/internal/client/compat.js +3 -3
- package/src/runtime/internal/client/composite.js +6 -1
- package/src/runtime/internal/client/head.js +50 -4
- package/src/runtime/internal/client/html.js +73 -12
- package/src/runtime/internal/client/hydration.js +12 -0
- package/src/runtime/internal/client/index.js +1 -1
- package/src/runtime/internal/client/portal.js +54 -29
- package/src/runtime/internal/client/rpc.js +3 -1
- package/src/runtime/internal/client/switch.js +5 -0
- package/src/runtime/internal/client/template.js +117 -11
- package/src/runtime/internal/client/try.js +1 -0
- package/src/runtime/internal/server/index.js +113 -1
- package/src/runtime/internal/server/rpc.js +4 -4
- package/src/runtime/map.js +2 -2
- package/src/runtime/object.js +6 -6
- package/src/runtime/proxy.js +12 -11
- package/src/runtime/reactive-value.js +9 -1
- package/src/runtime/set.js +12 -7
- package/src/runtime/url-search-params.js +0 -1
- package/src/server/index.js +4 -0
- package/src/utils/hashing.js +15 -0
- package/src/utils/normalize_css_property_name.js +1 -1
- package/tests/client/array/array.mutations.test.ripple +8 -8
- package/tests/client/basic/basic.errors.test.ripple +28 -0
- package/tests/client/basic/basic.events.test.ripple +6 -3
- package/tests/client/basic/basic.utilities.test.ripple +1 -1
- package/tests/client/compiler/compiler.regex.test.ripple +10 -8
- package/tests/client/composite/composite.generics.test.ripple +5 -2
- package/tests/client/dynamic-elements.test.ripple +30 -1
- package/tests/client/function-overload-import.ripple +6 -7
- package/tests/client/html.test.ripple +0 -1
- package/tests/client/object.test.ripple +2 -2
- package/tests/client/portal.test.ripple +3 -3
- package/tests/client/return.test.ripple +2500 -0
- package/tests/client/try.test.ripple +69 -0
- package/tests/client/typescript-generics.test.ripple +1 -1
- package/tests/client/url/url.derived.test.ripple +1 -1
- package/tests/client/url/url.parsing.test.ripple +3 -3
- package/tests/client/url/url.partial-removal.test.ripple +7 -7
- package/tests/client/url/url.reactivity.test.ripple +15 -15
- package/tests/client/url/url.serialization.test.ripple +2 -2
- package/tests/hydration/basic.test.js +23 -0
- package/tests/hydration/build-components.js +10 -4
- package/tests/hydration/compiled/client/basic.js +165 -3
- package/tests/hydration/compiled/client/for.js +1140 -23
- package/tests/hydration/compiled/client/head.js +234 -0
- package/tests/hydration/compiled/client/html.js +135 -0
- package/tests/hydration/compiled/client/portal.js +172 -0
- package/tests/hydration/compiled/client/reactivity.js +3 -1
- package/tests/hydration/compiled/client/return.js +1976 -0
- package/tests/hydration/compiled/client/switch.js +162 -0
- package/tests/hydration/compiled/server/basic.js +249 -0
- package/tests/hydration/compiled/server/events.js +1 -1
- package/tests/hydration/compiled/server/for.js +891 -1
- package/tests/hydration/compiled/server/head.js +291 -0
- package/tests/hydration/compiled/server/html.js +133 -0
- package/tests/hydration/compiled/server/if.js +1 -1
- package/tests/hydration/compiled/server/portal.js +250 -0
- package/tests/hydration/compiled/server/reactivity.js +1 -1
- package/tests/hydration/compiled/server/return.js +1969 -0
- package/tests/hydration/compiled/server/switch.js +130 -0
- package/tests/hydration/components/basic.ripple +55 -0
- package/tests/hydration/components/for.ripple +403 -0
- package/tests/hydration/components/head.ripple +111 -0
- package/tests/hydration/components/html.ripple +38 -0
- package/tests/hydration/components/portal.ripple +49 -0
- package/tests/hydration/components/return.ripple +564 -0
- package/tests/hydration/components/switch.ripple +51 -0
- package/tests/hydration/for.test.js +363 -0
- package/tests/hydration/head.test.js +105 -0
- package/tests/hydration/html.test.js +46 -0
- package/tests/hydration/portal.test.js +71 -0
- package/tests/hydration/return.test.js +544 -0
- package/tests/hydration/switch.test.js +42 -0
- package/tests/server/basic.attributes.test.ripple +1 -1
- package/tests/server/compiler.test.ripple +22 -0
- package/tests/server/composite.test.ripple +5 -2
- package/tests/server/html-nesting-validation.test.ripple +237 -0
- package/tests/server/return.test.ripple +1379 -0
- package/tests/setup-hydration.js +6 -1
- package/tests/utils/escaping.test.js +3 -1
- package/tests/utils/normalize_css_property_name.test.js +0 -1
- package/tests/utils/patterns.test.js +6 -2
- package/tests/utils/sanitize_template_string.test.js +3 -2
- package/types/server.d.ts +16 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import * as _$_ from 'ripple/internal/server';
|
|
2
|
+
|
|
3
|
+
import { track } from 'ripple/server';
|
|
4
|
+
|
|
5
|
+
export function StaticTitle(__output) {
|
|
6
|
+
_$_.push_component();
|
|
7
|
+
__output.push('<div');
|
|
8
|
+
__output.push('>');
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
__output.push('Content');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
__output.push('</div>');
|
|
15
|
+
__output.target = 'head';
|
|
16
|
+
__output.push('<!--qwqurq-->');
|
|
17
|
+
__output.push('<title');
|
|
18
|
+
__output.push('>');
|
|
19
|
+
|
|
20
|
+
{
|
|
21
|
+
__output.push('Static Test Title');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
__output.push('</title>');
|
|
25
|
+
__output.target = null;
|
|
26
|
+
_$_.pop_component();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function ReactiveTitle(__output) {
|
|
30
|
+
_$_.push_component();
|
|
31
|
+
|
|
32
|
+
let title = track('Initial Title');
|
|
33
|
+
|
|
34
|
+
__output.push('<div');
|
|
35
|
+
__output.push('>');
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
__output.push('<span');
|
|
39
|
+
__output.push('>');
|
|
40
|
+
|
|
41
|
+
{
|
|
42
|
+
__output.push(_$_.escape(_$_.get(title)));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
__output.push('</span>');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
__output.push('</div>');
|
|
49
|
+
__output.target = 'head';
|
|
50
|
+
__output.push('<!--1h8nm28-->');
|
|
51
|
+
__output.push('<title');
|
|
52
|
+
__output.push('>');
|
|
53
|
+
|
|
54
|
+
{
|
|
55
|
+
__output.push(_$_.escape(_$_.get(title)));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
__output.push('</title>');
|
|
59
|
+
__output.target = null;
|
|
60
|
+
_$_.pop_component();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function MultipleHeadElements(__output) {
|
|
64
|
+
_$_.push_component();
|
|
65
|
+
__output.push('<div');
|
|
66
|
+
__output.push('>');
|
|
67
|
+
|
|
68
|
+
{
|
|
69
|
+
__output.push('Page content');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
__output.push('</div>');
|
|
73
|
+
__output.target = 'head';
|
|
74
|
+
__output.push('<!--9v67ol-->');
|
|
75
|
+
__output.push('<title');
|
|
76
|
+
__output.push('>');
|
|
77
|
+
|
|
78
|
+
{
|
|
79
|
+
__output.push('Page Title');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
__output.push('</title>');
|
|
83
|
+
__output.push('<meta');
|
|
84
|
+
__output.push(' name="description"');
|
|
85
|
+
__output.push(' content="Page description"');
|
|
86
|
+
__output.push(' />');
|
|
87
|
+
__output.push('<link');
|
|
88
|
+
__output.push(' rel="stylesheet"');
|
|
89
|
+
__output.push(' href="/styles.css"');
|
|
90
|
+
__output.push(' />');
|
|
91
|
+
__output.target = null;
|
|
92
|
+
_$_.pop_component();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function ReactiveMetaTags(__output) {
|
|
96
|
+
_$_.push_component();
|
|
97
|
+
|
|
98
|
+
let description = track('Initial description');
|
|
99
|
+
|
|
100
|
+
__output.push('<div');
|
|
101
|
+
__output.push('>');
|
|
102
|
+
|
|
103
|
+
{
|
|
104
|
+
__output.push(_$_.escape(_$_.get(description)));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
__output.push('</div>');
|
|
108
|
+
__output.target = 'head';
|
|
109
|
+
__output.push('<!--166unm-->');
|
|
110
|
+
__output.push('<title');
|
|
111
|
+
__output.push('>');
|
|
112
|
+
|
|
113
|
+
{
|
|
114
|
+
__output.push('My Page');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
__output.push('</title>');
|
|
118
|
+
__output.push('<meta');
|
|
119
|
+
__output.push(' name="description"');
|
|
120
|
+
__output.push(_$_.attr('content', _$_.get(description), false));
|
|
121
|
+
__output.push(' />');
|
|
122
|
+
__output.target = null;
|
|
123
|
+
_$_.pop_component();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function TitleWithTemplate(__output) {
|
|
127
|
+
_$_.push_component();
|
|
128
|
+
|
|
129
|
+
let name = track('World');
|
|
130
|
+
|
|
131
|
+
__output.push('<div');
|
|
132
|
+
__output.push('>');
|
|
133
|
+
|
|
134
|
+
{
|
|
135
|
+
__output.push(_$_.escape(_$_.get(name)));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
__output.push('</div>');
|
|
139
|
+
__output.target = 'head';
|
|
140
|
+
__output.push('<!--3o3mh2-->');
|
|
141
|
+
__output.push('<title');
|
|
142
|
+
__output.push('>');
|
|
143
|
+
|
|
144
|
+
{
|
|
145
|
+
__output.push(_$_.escape(`Hello ${_$_.get(name)}!`));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
__output.push('</title>');
|
|
149
|
+
__output.target = null;
|
|
150
|
+
_$_.pop_component();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function EmptyTitle(__output) {
|
|
154
|
+
_$_.push_component();
|
|
155
|
+
__output.push('<div');
|
|
156
|
+
__output.push('>');
|
|
157
|
+
|
|
158
|
+
{
|
|
159
|
+
__output.push('Empty title test');
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
__output.push('</div>');
|
|
163
|
+
__output.target = 'head';
|
|
164
|
+
__output.push('<!--kwo3k6-->');
|
|
165
|
+
__output.push('<title');
|
|
166
|
+
__output.push('>');
|
|
167
|
+
|
|
168
|
+
{
|
|
169
|
+
__output.push('');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
__output.push('</title>');
|
|
173
|
+
__output.target = null;
|
|
174
|
+
_$_.pop_component();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function ConditionalTitle(__output) {
|
|
178
|
+
_$_.push_component();
|
|
179
|
+
|
|
180
|
+
let showPrefix = track(true);
|
|
181
|
+
let title = track('Main Page');
|
|
182
|
+
|
|
183
|
+
__output.push('<div');
|
|
184
|
+
__output.push('>');
|
|
185
|
+
|
|
186
|
+
{
|
|
187
|
+
__output.push(_$_.escape(_$_.get(title)));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
__output.push('</div>');
|
|
191
|
+
__output.target = 'head';
|
|
192
|
+
__output.push('<!--c2i5xr-->');
|
|
193
|
+
__output.push('<title');
|
|
194
|
+
__output.push('>');
|
|
195
|
+
|
|
196
|
+
{
|
|
197
|
+
__output.push(_$_.escape(_$_.get(showPrefix) ? 'App - ' + _$_.get(title) : _$_.get(title)));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
__output.push('</title>');
|
|
201
|
+
__output.target = null;
|
|
202
|
+
_$_.pop_component();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function ComputedTitle(__output) {
|
|
206
|
+
_$_.push_component();
|
|
207
|
+
|
|
208
|
+
let count = track(0);
|
|
209
|
+
let prefix = 'Count: ';
|
|
210
|
+
|
|
211
|
+
__output.push('<div');
|
|
212
|
+
__output.push('>');
|
|
213
|
+
|
|
214
|
+
{
|
|
215
|
+
__output.push('<span');
|
|
216
|
+
__output.push('>');
|
|
217
|
+
|
|
218
|
+
{
|
|
219
|
+
__output.push(_$_.escape(_$_.get(count)));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
__output.push('</span>');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
__output.push('</div>');
|
|
226
|
+
__output.target = 'head';
|
|
227
|
+
__output.push('<!--1h2z3z5-->');
|
|
228
|
+
__output.push('<title');
|
|
229
|
+
__output.push('>');
|
|
230
|
+
|
|
231
|
+
{
|
|
232
|
+
__output.push(_$_.escape(prefix + _$_.get(count)));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
__output.push('</title>');
|
|
236
|
+
__output.target = null;
|
|
237
|
+
_$_.pop_component();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function MultipleHeadBlocks(__output) {
|
|
241
|
+
_$_.push_component();
|
|
242
|
+
__output.push('<div');
|
|
243
|
+
__output.push('>');
|
|
244
|
+
|
|
245
|
+
{
|
|
246
|
+
__output.push('Content');
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
__output.push('</div>');
|
|
250
|
+
__output.target = 'head';
|
|
251
|
+
__output.push('<!--14rv3le-->');
|
|
252
|
+
__output.push('<title');
|
|
253
|
+
__output.push('>');
|
|
254
|
+
|
|
255
|
+
{
|
|
256
|
+
__output.push('First Head');
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
__output.push('</title>');
|
|
260
|
+
__output.push('<!--1eh1mn5-->');
|
|
261
|
+
__output.push('<meta');
|
|
262
|
+
__output.push(' name="author"');
|
|
263
|
+
__output.push(' content="Test Author"');
|
|
264
|
+
__output.push(' />');
|
|
265
|
+
__output.target = null;
|
|
266
|
+
_$_.pop_component();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export function HeadWithStyle(__output) {
|
|
270
|
+
_$_.push_component();
|
|
271
|
+
__output.push('<div');
|
|
272
|
+
__output.push('>');
|
|
273
|
+
|
|
274
|
+
{
|
|
275
|
+
__output.push('Styled content');
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
__output.push('</div>');
|
|
279
|
+
__output.target = 'head';
|
|
280
|
+
__output.push('<!--1dxk6yg-->');
|
|
281
|
+
__output.push('<title');
|
|
282
|
+
__output.push('>');
|
|
283
|
+
|
|
284
|
+
{
|
|
285
|
+
__output.push('Styled Page');
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
__output.push('</title>');
|
|
289
|
+
__output.target = null;
|
|
290
|
+
_$_.pop_component();
|
|
291
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as _$_ from 'ripple/internal/server';
|
|
2
|
+
|
|
3
|
+
import { track } from 'ripple/server';
|
|
4
|
+
|
|
5
|
+
export function StaticHtml(__output) {
|
|
6
|
+
_$_.push_component();
|
|
7
|
+
|
|
8
|
+
const html = '<p><strong>Bold</strong> text</p>';
|
|
9
|
+
|
|
10
|
+
__output.push('<div');
|
|
11
|
+
__output.push('>');
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
const html_value = String(html ?? '');
|
|
15
|
+
|
|
16
|
+
__output.push('<!--' + _$_.hash(html_value) + '-->');
|
|
17
|
+
__output.push(html_value);
|
|
18
|
+
__output.push('<!---->');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
__output.push('</div>');
|
|
22
|
+
_$_.pop_component();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function DynamicHtml(__output) {
|
|
26
|
+
_$_.push_component();
|
|
27
|
+
|
|
28
|
+
const content = '<p>Dynamic <span>HTML</span> content</p>';
|
|
29
|
+
|
|
30
|
+
__output.push('<div');
|
|
31
|
+
__output.push('>');
|
|
32
|
+
|
|
33
|
+
{
|
|
34
|
+
const html_value_1 = String(content ?? '');
|
|
35
|
+
|
|
36
|
+
__output.push('<!--' + _$_.hash(html_value_1) + '-->');
|
|
37
|
+
__output.push(html_value_1);
|
|
38
|
+
__output.push('<!---->');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
__output.push('</div>');
|
|
42
|
+
_$_.pop_component();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function EmptyHtml(__output) {
|
|
46
|
+
_$_.push_component();
|
|
47
|
+
|
|
48
|
+
const html = '';
|
|
49
|
+
|
|
50
|
+
__output.push('<div');
|
|
51
|
+
__output.push('>');
|
|
52
|
+
|
|
53
|
+
{
|
|
54
|
+
const html_value_2 = String(html ?? '');
|
|
55
|
+
|
|
56
|
+
__output.push('<!--' + _$_.hash(html_value_2) + '-->');
|
|
57
|
+
__output.push(html_value_2);
|
|
58
|
+
__output.push('<!---->');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
__output.push('</div>');
|
|
62
|
+
_$_.pop_component();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function ComplexHtml(__output) {
|
|
66
|
+
_$_.push_component();
|
|
67
|
+
|
|
68
|
+
const html = '<div class="nested"><span>Nested <em>content</em></span></div>';
|
|
69
|
+
|
|
70
|
+
__output.push('<section');
|
|
71
|
+
__output.push('>');
|
|
72
|
+
|
|
73
|
+
{
|
|
74
|
+
const html_value_3 = String(html ?? '');
|
|
75
|
+
|
|
76
|
+
__output.push('<!--' + _$_.hash(html_value_3) + '-->');
|
|
77
|
+
__output.push(html_value_3);
|
|
78
|
+
__output.push('<!---->');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
__output.push('</section>');
|
|
82
|
+
_$_.pop_component();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function MultipleHtml(__output) {
|
|
86
|
+
_$_.push_component();
|
|
87
|
+
|
|
88
|
+
const html1 = '<p>First paragraph</p>';
|
|
89
|
+
const html2 = '<p>Second paragraph</p>';
|
|
90
|
+
|
|
91
|
+
__output.push('<div');
|
|
92
|
+
__output.push('>');
|
|
93
|
+
|
|
94
|
+
{
|
|
95
|
+
const html_value_4 = String(html1 ?? '');
|
|
96
|
+
|
|
97
|
+
__output.push('<!--' + _$_.hash(html_value_4) + '-->');
|
|
98
|
+
__output.push(html_value_4);
|
|
99
|
+
__output.push('<!---->');
|
|
100
|
+
|
|
101
|
+
const html_value_5 = String(html2 ?? '');
|
|
102
|
+
|
|
103
|
+
__output.push('<!--' + _$_.hash(html_value_5) + '-->');
|
|
104
|
+
__output.push(html_value_5);
|
|
105
|
+
__output.push('<!---->');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
__output.push('</div>');
|
|
109
|
+
_$_.pop_component();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function HtmlWithReactivity(__output) {
|
|
113
|
+
_$_.push_component();
|
|
114
|
+
__output.push('<div');
|
|
115
|
+
__output.push('>');
|
|
116
|
+
|
|
117
|
+
{
|
|
118
|
+
__output.push('<!--1tb17hh-->');
|
|
119
|
+
__output.push('<p>Count: 0</p>');
|
|
120
|
+
__output.push('<!---->');
|
|
121
|
+
__output.push('<button');
|
|
122
|
+
__output.push('>');
|
|
123
|
+
|
|
124
|
+
{
|
|
125
|
+
__output.push('Increment');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
__output.push('</button>');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
__output.push('</div>');
|
|
132
|
+
_$_.pop_component();
|
|
133
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import * as _$_ from 'ripple/internal/server';
|
|
2
|
+
|
|
3
|
+
import { Portal } from 'ripple/server';
|
|
4
|
+
|
|
5
|
+
export async function SimplePortal(__output) {
|
|
6
|
+
return _$_.async(async () => {
|
|
7
|
+
_$_.push_component();
|
|
8
|
+
__output.push('<div');
|
|
9
|
+
__output.push(' class="container"');
|
|
10
|
+
__output.push('>');
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
__output.push('<h1');
|
|
14
|
+
__output.push('>');
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
__output.push('Main Content');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
__output.push('</h1>');
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
const comp = Portal;
|
|
24
|
+
|
|
25
|
+
const args = [
|
|
26
|
+
__output,
|
|
27
|
+
|
|
28
|
+
{
|
|
29
|
+
target: typeof document !== 'undefined' ? document.body : null,
|
|
30
|
+
|
|
31
|
+
children: function children(__output) {
|
|
32
|
+
_$_.push_component();
|
|
33
|
+
__output.push('<div');
|
|
34
|
+
__output.push(' class="portal-content"');
|
|
35
|
+
__output.push('>');
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
__output.push('Portal content');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
__output.push('</div>');
|
|
42
|
+
_$_.pop_component();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
if (comp?.async) {
|
|
48
|
+
await comp(...args);
|
|
49
|
+
} else if (comp) {
|
|
50
|
+
comp(...args);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
__output.push('</div>');
|
|
56
|
+
_$_.pop_component();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export async function ConditionalPortal(__output) {
|
|
61
|
+
return _$_.async(async () => {
|
|
62
|
+
_$_.push_component();
|
|
63
|
+
|
|
64
|
+
let show = _$_.get(true);
|
|
65
|
+
|
|
66
|
+
__output.push('<div');
|
|
67
|
+
__output.push(' class="container"');
|
|
68
|
+
__output.push('>');
|
|
69
|
+
|
|
70
|
+
{
|
|
71
|
+
__output.push('<button');
|
|
72
|
+
__output.push(' class="toggle"');
|
|
73
|
+
__output.push('>');
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
__output.push('Toggle');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
__output.push('</button>');
|
|
80
|
+
__output.push('<!--[-->');
|
|
81
|
+
|
|
82
|
+
if (_$_.get(show)) {
|
|
83
|
+
{
|
|
84
|
+
const comp = Portal;
|
|
85
|
+
|
|
86
|
+
const args = [
|
|
87
|
+
__output,
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
target: typeof document !== 'undefined' ? document.body : null,
|
|
91
|
+
|
|
92
|
+
children: function children(__output) {
|
|
93
|
+
_$_.push_component();
|
|
94
|
+
__output.push('<div');
|
|
95
|
+
__output.push(' class="portal-content"');
|
|
96
|
+
__output.push('>');
|
|
97
|
+
|
|
98
|
+
{
|
|
99
|
+
__output.push('Portal is visible');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
__output.push('</div>');
|
|
103
|
+
_$_.pop_component();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
if (comp?.async) {
|
|
109
|
+
await comp(...args);
|
|
110
|
+
} else if (comp) {
|
|
111
|
+
comp(...args);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
__output.push('<!--]-->');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
__output.push('</div>');
|
|
120
|
+
_$_.pop_component();
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export async function PortalWithMainContent(__output) {
|
|
125
|
+
return _$_.async(async () => {
|
|
126
|
+
_$_.push_component();
|
|
127
|
+
__output.push('<div');
|
|
128
|
+
__output.push('>');
|
|
129
|
+
|
|
130
|
+
{
|
|
131
|
+
__output.push('<div');
|
|
132
|
+
__output.push(' class="main-content"');
|
|
133
|
+
__output.push('>');
|
|
134
|
+
|
|
135
|
+
{
|
|
136
|
+
__output.push('Main page content');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
__output.push('</div>');
|
|
140
|
+
|
|
141
|
+
{
|
|
142
|
+
const comp = Portal;
|
|
143
|
+
|
|
144
|
+
const args = [
|
|
145
|
+
__output,
|
|
146
|
+
|
|
147
|
+
{
|
|
148
|
+
target: typeof document !== 'undefined' ? document.body : null,
|
|
149
|
+
|
|
150
|
+
children: function children(__output) {
|
|
151
|
+
_$_.push_component();
|
|
152
|
+
__output.push('<div');
|
|
153
|
+
__output.push(' class="portal-content"');
|
|
154
|
+
__output.push('>');
|
|
155
|
+
|
|
156
|
+
{
|
|
157
|
+
__output.push('Modal content');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
__output.push('</div>');
|
|
161
|
+
_$_.pop_component();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
];
|
|
165
|
+
|
|
166
|
+
if (comp?.async) {
|
|
167
|
+
await comp(...args);
|
|
168
|
+
} else if (comp) {
|
|
169
|
+
comp(...args);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
__output.push('<div');
|
|
174
|
+
__output.push(' class="footer"');
|
|
175
|
+
__output.push('>');
|
|
176
|
+
|
|
177
|
+
{
|
|
178
|
+
__output.push('Footer');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
__output.push('</div>');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
__output.push('</div>');
|
|
185
|
+
_$_.pop_component();
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export async function NestedContentWithPortal(__output) {
|
|
190
|
+
return _$_.async(async () => {
|
|
191
|
+
_$_.push_component();
|
|
192
|
+
__output.push('<div');
|
|
193
|
+
__output.push(' class="outer"');
|
|
194
|
+
__output.push('>');
|
|
195
|
+
|
|
196
|
+
{
|
|
197
|
+
__output.push('<div');
|
|
198
|
+
__output.push(' class="inner"');
|
|
199
|
+
__output.push('>');
|
|
200
|
+
|
|
201
|
+
{
|
|
202
|
+
__output.push('<span');
|
|
203
|
+
__output.push('>');
|
|
204
|
+
|
|
205
|
+
{
|
|
206
|
+
__output.push('Nested content');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
__output.push('</span>');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
__output.push('</div>');
|
|
213
|
+
|
|
214
|
+
{
|
|
215
|
+
const comp = Portal;
|
|
216
|
+
|
|
217
|
+
const args = [
|
|
218
|
+
__output,
|
|
219
|
+
|
|
220
|
+
{
|
|
221
|
+
target: typeof document !== 'undefined' ? document.body : null,
|
|
222
|
+
|
|
223
|
+
children: function children(__output) {
|
|
224
|
+
_$_.push_component();
|
|
225
|
+
__output.push('<div');
|
|
226
|
+
__output.push(' class="portal-content"');
|
|
227
|
+
__output.push('>');
|
|
228
|
+
|
|
229
|
+
{
|
|
230
|
+
__output.push('Portal content');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
__output.push('</div>');
|
|
234
|
+
_$_.pop_component();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
];
|
|
238
|
+
|
|
239
|
+
if (comp?.async) {
|
|
240
|
+
await comp(...args);
|
|
241
|
+
} else if (comp) {
|
|
242
|
+
comp(...args);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
__output.push('</div>');
|
|
248
|
+
_$_.pop_component();
|
|
249
|
+
});
|
|
250
|
+
}
|