ripple 0.3.64 → 0.3.65
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
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Ripple is an elegant TypeScript UI framework",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.65",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "src/runtime/index-client.js",
|
|
9
9
|
"main": "src/runtime/index-client.js",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"clsx": "^2.1.1",
|
|
75
75
|
"devalue": "^5.8.1",
|
|
76
76
|
"esm-env": "^1.2.2",
|
|
77
|
-
"@tsrx/core": "0.1.
|
|
78
|
-
"@tsrx/ripple": "0.1.
|
|
77
|
+
"@tsrx/core": "0.1.13",
|
|
78
|
+
"@tsrx/ripple": "0.1.13"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@types/estree": "^1.0.8",
|
|
@@ -37,7 +37,9 @@ describe('tsx expression', () => {
|
|
|
37
37
|
|
|
38
38
|
it('renders a basic fragment shorthand element', () => {
|
|
39
39
|
component App() {
|
|
40
|
-
const el = <tsx
|
|
40
|
+
const el = <tsx>
|
|
41
|
+
<div>hello world</div>
|
|
42
|
+
</tsx>;
|
|
41
43
|
{el}
|
|
42
44
|
}
|
|
43
45
|
render(App);
|
|
@@ -97,7 +99,9 @@ describe('tsx expression', () => {
|
|
|
97
99
|
|
|
98
100
|
it('renders a tsx element assigned to a variable', () => {
|
|
99
101
|
component App() {
|
|
100
|
-
const el = <tsx
|
|
102
|
+
const el = <tsx>
|
|
103
|
+
<span class="test">content</span>
|
|
104
|
+
</tsx>;
|
|
101
105
|
{el}
|
|
102
106
|
}
|
|
103
107
|
render(App);
|
|
@@ -140,7 +144,9 @@ describe('tsx expression', () => {
|
|
|
140
144
|
|
|
141
145
|
it('renders a tsx element inline in a parent element', () => {
|
|
142
146
|
component App() {
|
|
143
|
-
const el = <tsx
|
|
147
|
+
const el = <tsx>
|
|
148
|
+
<span>inline</span>
|
|
149
|
+
</tsx>;
|
|
144
150
|
<div class="parent">{el}</div>
|
|
145
151
|
}
|
|
146
152
|
render(App);
|
|
@@ -172,7 +178,9 @@ describe('tsx expression', () => {
|
|
|
172
178
|
it('conditionally renders tsx elements', () => {
|
|
173
179
|
component App() {
|
|
174
180
|
let &[show] = track(true);
|
|
175
|
-
const el = <tsx
|
|
181
|
+
const el = <tsx>
|
|
182
|
+
<div class="tsx-content">visible</div>
|
|
183
|
+
</tsx>;
|
|
176
184
|
|
|
177
185
|
if (show) {
|
|
178
186
|
{el}
|
|
@@ -197,7 +205,9 @@ describe('tsx expression', () => {
|
|
|
197
205
|
}
|
|
198
206
|
|
|
199
207
|
component App() {
|
|
200
|
-
const el = <tsx
|
|
208
|
+
const el = <tsx>
|
|
209
|
+
<span>from tsx</span>
|
|
210
|
+
</tsx>;
|
|
201
211
|
<Child children={el} />
|
|
202
212
|
}
|
|
203
213
|
render(App);
|
|
@@ -209,12 +219,14 @@ describe('tsx expression', () => {
|
|
|
209
219
|
|
|
210
220
|
it('renders tsx element with text content only', () => {
|
|
211
221
|
component App() {
|
|
212
|
-
const el = <tsx>
|
|
222
|
+
const el = <tsx>
|
|
223
|
+
just text
|
|
224
|
+
</tsx>;
|
|
213
225
|
{el}
|
|
214
226
|
}
|
|
215
227
|
|
|
216
228
|
render(App);
|
|
217
|
-
expect(container.textContent).toBe('just text');
|
|
229
|
+
expect(container.textContent.trim()).toBe('just text');
|
|
218
230
|
});
|
|
219
231
|
|
|
220
232
|
it('renders tsx element with static attributes', () => {
|
|
@@ -237,7 +249,9 @@ describe('tsx expression', () => {
|
|
|
237
249
|
component App() {
|
|
238
250
|
let &[name] = track('initial');
|
|
239
251
|
|
|
240
|
-
const el = <tsx
|
|
252
|
+
const el = <tsx>
|
|
253
|
+
<div id={name} class={'cls-' + name}>content</div>
|
|
254
|
+
</tsx>;
|
|
241
255
|
{el}
|
|
242
256
|
<button onClick={() => (name = 'updated')}>{'update'}</button>
|
|
243
257
|
}
|
|
@@ -299,7 +313,9 @@ describe('tsx expression', () => {
|
|
|
299
313
|
component App() {
|
|
300
314
|
let &[color] = track('red');
|
|
301
315
|
|
|
302
|
-
const el = <tsx
|
|
316
|
+
const el = <tsx>
|
|
317
|
+
<div style={'color: ' + color}>styled</div>
|
|
318
|
+
</tsx>;
|
|
303
319
|
{el}
|
|
304
320
|
<button onClick={() => (color = 'blue')}>{'change color'}</button>
|
|
305
321
|
}
|
|
@@ -351,7 +367,11 @@ describe('tsx expression', () => {
|
|
|
351
367
|
}
|
|
352
368
|
|
|
353
369
|
component App() {
|
|
354
|
-
<Wrapper
|
|
370
|
+
<Wrapper
|
|
371
|
+
content={<tsx>
|
|
372
|
+
<span class="inner">direct prop</span>
|
|
373
|
+
</tsx>}
|
|
374
|
+
/>
|
|
355
375
|
}
|
|
356
376
|
|
|
357
377
|
render(App);
|
|
@@ -371,8 +391,12 @@ describe('tsx expression', () => {
|
|
|
371
391
|
|
|
372
392
|
component App() {
|
|
373
393
|
<Card
|
|
374
|
-
title={<tsx
|
|
375
|
-
|
|
394
|
+
title={<tsx>
|
|
395
|
+
<span class="bold">Title</span>
|
|
396
|
+
</tsx>}
|
|
397
|
+
children={<tsx>
|
|
398
|
+
<p>Card content here</p>
|
|
399
|
+
</tsx>}
|
|
376
400
|
/>
|
|
377
401
|
}
|
|
378
402
|
|
|
@@ -384,7 +408,9 @@ describe('tsx expression', () => {
|
|
|
384
408
|
|
|
385
409
|
it('renders tsx from function defined outside component', () => {
|
|
386
410
|
function createBadge(label: string) {
|
|
387
|
-
return <tsx
|
|
411
|
+
return <tsx>
|
|
412
|
+
<span class="badge">{label}</span>
|
|
413
|
+
</tsx>;
|
|
388
414
|
}
|
|
389
415
|
|
|
390
416
|
component App() {
|
|
@@ -399,7 +425,9 @@ describe('tsx expression', () => {
|
|
|
399
425
|
|
|
400
426
|
it('renders tsx from function with multiple elements', () => {
|
|
401
427
|
function createListItem(item: string) {
|
|
402
|
-
return <tsx
|
|
428
|
+
return <tsx>
|
|
429
|
+
<li class="list-item">{item}</li>
|
|
430
|
+
</tsx>;
|
|
403
431
|
}
|
|
404
432
|
|
|
405
433
|
component App() {
|
|
@@ -479,7 +507,9 @@ describe('tsx expression', () => {
|
|
|
479
507
|
|
|
480
508
|
it('renders nested tsx from multiple functions', () => {
|
|
481
509
|
function createIcon(name: string) {
|
|
482
|
-
return <tsx
|
|
510
|
+
return <tsx>
|
|
511
|
+
<i class={'icon icon-' + name}></i>
|
|
512
|
+
</tsx>;
|
|
483
513
|
}
|
|
484
514
|
|
|
485
515
|
function createButton(icon: string, label: string) {
|
|
@@ -521,7 +551,9 @@ describe('tsx expression', () => {
|
|
|
521
551
|
}
|
|
522
552
|
|
|
523
553
|
component App() {
|
|
524
|
-
{<tsx>
|
|
554
|
+
{<tsx>
|
|
555
|
+
{[1, 2, 3].map((item) => <div class="app-item">{item}</div>)}
|
|
556
|
+
</tsx>}
|
|
525
557
|
{makeFragment('from helper')}
|
|
526
558
|
}
|
|
527
559
|
|
|
@@ -615,7 +647,12 @@ describe('tsx expression', () => {
|
|
|
615
647
|
|
|
616
648
|
component App() {
|
|
617
649
|
<Alert message="No icon" />
|
|
618
|
-
<Alert
|
|
650
|
+
<Alert
|
|
651
|
+
icon={<tsx>
|
|
652
|
+
<span class="custom-icon">✓</span>
|
|
653
|
+
</tsx>}
|
|
654
|
+
message="Custom icon"
|
|
655
|
+
/>
|
|
619
656
|
}
|
|
620
657
|
|
|
621
658
|
render(App);
|
|
@@ -627,7 +664,9 @@ describe('tsx expression', () => {
|
|
|
627
664
|
|
|
628
665
|
it('renders tsx stored in array via function', () => {
|
|
629
666
|
function createItem(className: string, content: string) {
|
|
630
|
-
return <tsx
|
|
667
|
+
return <tsx>
|
|
668
|
+
<div class={className}>{content}</div>
|
|
669
|
+
</tsx>;
|
|
631
670
|
}
|
|
632
671
|
|
|
633
672
|
component App() {
|
|
@@ -654,11 +693,17 @@ describe('tsx expression', () => {
|
|
|
654
693
|
it('renders tsx conditionally from function', () => {
|
|
655
694
|
function createContent(type: string) {
|
|
656
695
|
if (type === 'success') {
|
|
657
|
-
return <tsx
|
|
696
|
+
return <tsx>
|
|
697
|
+
<div class="success">Success!</div>
|
|
698
|
+
</tsx>;
|
|
658
699
|
} else if (type === 'error') {
|
|
659
|
-
return <tsx
|
|
700
|
+
return <tsx>
|
|
701
|
+
<div class="error">Error!</div>
|
|
702
|
+
</tsx>;
|
|
660
703
|
}
|
|
661
|
-
return <tsx
|
|
704
|
+
return <tsx>
|
|
705
|
+
<div class="default">Default</div>
|
|
706
|
+
</tsx>;
|
|
662
707
|
}
|
|
663
708
|
|
|
664
709
|
component App() {
|
|
@@ -83,7 +83,9 @@ function makeNestedTsxTsrxFragment(label: string) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
export component NestedTsxTsrxExpressionValues() {
|
|
86
|
-
{<tsx>
|
|
86
|
+
{<tsx>
|
|
87
|
+
{[1, 2, 3].map((item) => <div class="app-item">{item}</div>)}
|
|
88
|
+
</tsx>}
|
|
87
89
|
{makeNestedTsxTsrxFragment('from helper')}
|
|
88
90
|
}
|
|
89
91
|
|