ripple 0.3.63 → 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
@@ -1,5 +1,16 @@
1
1
  # ripple
2
2
 
3
+ ## 0.3.65
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ [[`95c2976`](https://github.com/Ripple-TS/ripple/commit/95c2976b9ec2c20c4160ad13b636c1ed03e863ef)]:
9
+ - @tsrx/core@0.1.13
10
+ - @tsrx/ripple@0.1.13
11
+
12
+ ## 0.3.64
13
+
3
14
  ## 0.3.63
4
15
 
5
16
  ### Patch Changes
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.63",
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.12",
78
- "@tsrx/ripple": "0.1.12"
77
+ "@tsrx/core": "0.1.13",
78
+ "@tsrx/ripple": "0.1.13"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@types/estree": "^1.0.8",
@@ -531,10 +531,11 @@ component App() {
531
531
 
532
532
  function find_mapping(source_offset: number, generated_offset: number) {
533
533
  return result.mappings.find(
534
- (mapping) => mapping.sourceOffsets[0] === source_offset &&
535
- mapping.generatedOffsets[0] === generated_offset &&
536
- mapping.lengths[0] === 'nested'.length &&
537
- mapping.generatedLengths[0] === 'nested'.length,
534
+ (mapping) =>
535
+ mapping.sourceOffsets[0] === source_offset &&
536
+ mapping.generatedOffsets[0] === generated_offset &&
537
+ mapping.lengths[0] === 'nested'.length &&
538
+ mapping.generatedLengths[0] === 'nested'.length,
538
539
  );
539
540
  }
540
541
 
@@ -668,10 +669,11 @@ export function optionalFn(declRequired: string, declMaybe?: string) {
668
669
  generatedOffsets: number[];
669
670
  lengths: number[];
670
671
  generatedLengths: number[];
671
- }) => mapping.sourceOffsets[0] === source_offset &&
672
- mapping.generatedOffsets[0] === generated_offset &&
673
- mapping.lengths[0] === identifier.length &&
674
- mapping.generatedLengths[0] === identifier.length,
672
+ }) =>
673
+ mapping.sourceOffsets[0] === source_offset &&
674
+ mapping.generatedOffsets[0] === generated_offset &&
675
+ mapping.lengths[0] === identifier.length &&
676
+ mapping.generatedLengths[0] === identifier.length,
675
677
  );
676
678
 
677
679
  expect(source_offset).toBeGreaterThan(-1);
@@ -969,10 +971,11 @@ component App() {
969
971
  generated_length = length,
970
972
  ) {
971
973
  return result.mappings.find(
972
- (mapping) => mapping.sourceOffsets[0] === source_offset &&
973
- mapping.generatedOffsets[0] === generated_offset &&
974
- mapping.lengths[0] === length &&
975
- mapping.generatedLengths[0] === generated_length,
974
+ (mapping) =>
975
+ mapping.sourceOffsets[0] === source_offset &&
976
+ mapping.generatedOffsets[0] === generated_offset &&
977
+ mapping.lengths[0] === length &&
978
+ mapping.generatedLengths[0] === generated_length,
976
979
  );
977
980
  }
978
981
 
@@ -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><div>hello world</div></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><span class="test">content</span></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><span>inline</span></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><div class="tsx-content">visible</div></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><span>from tsx</span></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>just text</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><div id={name} class={'cls-' + name}>content</div></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><div style={'color: ' + color}>styled</div></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 content={<tsx><span class="inner">direct prop</span></tsx>} />
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><span class="bold">Title</span></tsx>}
375
- children={<tsx><p>Card content here</p></tsx>}
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><span class="badge">{label}</span></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><li class="list-item">{item}</li></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><i class={'icon icon-' + name}></i></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>{[1, 2, 3].map((item) => <div class="app-item">{item}</div>)}</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 icon={<tsx><span class="custom-icon">✓</span></tsx>} message="Custom icon" />
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><div class={className}>{content}</div></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><div class="success">Success!</div></tsx>;
696
+ return <tsx>
697
+ <div class="success">Success!</div>
698
+ </tsx>;
658
699
  } else if (type === 'error') {
659
- return <tsx><div class="error">Error!</div></tsx>;
700
+ return <tsx>
701
+ <div class="error">Error!</div>
702
+ </tsx>;
660
703
  }
661
- return <tsx><div class="default">Default</div></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>{[1, 2, 3].map((item) => <div class="app-item">{item}</div>)}</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
 
@@ -73,7 +73,9 @@ second"</pre>
73
73
  }
74
74
 
75
75
  component Basic() {
76
- {<tsx>{[1, 2, 3].map((item) => <div class="app-item">{item}</div>)}</tsx>}
76
+ {<tsx>
77
+ {[1, 2, 3].map((item) => <div class="app-item">{item}</div>)}
78
+ </tsx>}
77
79
  {makeFragment('from helper')}
78
80
  }
79
81