ripple 0.3.70 → 0.3.71

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,15 @@
1
1
  # ripple
2
2
 
3
+ ## 0.3.71
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ [[`0574e73`](https://github.com/Ripple-TS/ripple/commit/0574e73830a549f515cef6aa8c0a1e38c79b06cc),
9
+ [`0574e73`](https://github.com/Ripple-TS/ripple/commit/0574e73830a549f515cef6aa8c0a1e38c79b06cc)]:
10
+ - @tsrx/core@0.1.19
11
+ - @tsrx/ripple@0.1.19
12
+
3
13
  ## 0.3.70
4
14
 
5
15
  ### 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.70",
6
+ "version": "0.3.71",
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.18",
78
- "@tsrx/ripple": "0.1.18"
77
+ "@tsrx/core": "0.1.19",
78
+ "@tsrx/ripple": "0.1.19"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@types/estree": "^1.0.8",
@@ -524,6 +524,36 @@ function App() { return <>
524
524
  expect(result).toContain('const content = <div class="native">');
525
525
  });
526
526
 
527
+ it('keeps assigned style blocks anchored in to_ts output', () => {
528
+ const source = `
529
+ function App() { return <>
530
+ const styles = <style>
531
+ .logo { display: block; }
532
+ </style>;
533
+
534
+ <div class={styles.logo} />
535
+ </>; }
536
+ `;
537
+ const result = compile_to_volar_mappings(source, 'test.tsrx', { loose: true });
538
+ const source_offset = source.indexOf('<style>') + 1;
539
+ const mapping = result.mappings.find((mapping: {
540
+ sourceOffsets: number[];
541
+ lengths: number[];
542
+ }) => {
543
+ const start = mapping.sourceOffsets[0];
544
+ const end = start + mapping.lengths[0];
545
+ return source_offset >= start && source_offset < end;
546
+ });
547
+
548
+ expect(result.code).toContain('<style></style>');
549
+ expect(result.code).toContain('const styles = {');
550
+ expect(result.code).not.toContain('(<style></style>,');
551
+ expect(result.code).toContain('\'logo\'');
552
+ expect(mapping).toBeDefined();
553
+ expect(mapping?.data.completion).toBe(true);
554
+ expect(mapping?.data.verification).toBe(false);
555
+ });
556
+
527
557
  it('maps identifiers from native expression values in to_ts output', () => {
528
558
  const source = `
529
559
  function App() { return <>