vue-to-reactive 1.0.2 → 1.0.4

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.
@@ -0,0 +1,46 @@
1
+ <p align="center">
2
+ <img src="banner.svg" alt="vue-to-reactive" width="100%" />
3
+ </p>
4
+
5
+ <h1 align="center">vue-to-reactive</h1>
6
+
7
+ <p align="center"></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/vue-to-reactive"><img src="https://img.shields.io/npm/v/vue-to-reactive.svg" alt="npm version" /></a>
11
+ <a href="https://www.npmjs.com/package/vue-to-reactive"><img src="https://img.shields.io/npm/dm/vue-to-reactive.svg" alt="npm downloads" /></a>
12
+ </p>
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install vue-to-reactive
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ Converts ref to reactive. Also made possible to create a "swapable" reactive object.
23
+
24
+ ```ts
25
+ import { toReactive } from 'vue-to-reactive'
26
+ import { ref } from 'vue'
27
+
28
+ const refState = ref({ foo: 'bar' })
29
+
30
+ console.log(refState.value.foo) // => 'bar'
31
+
32
+ const state = toReactive(refState) // <--
33
+
34
+ console.log(state.foo) // => 'bar'
35
+
36
+ refState.value = { bar: 'foo' }
37
+
38
+ console.log(state.foo) // => undefined
39
+ console.log(state.bar) // => 'foo'
40
+ ```
41
+
42
+ ## License
43
+
44
+ MIT
45
+
46
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/README.md CHANGED
@@ -4,15 +4,13 @@
4
4
 
5
5
  <h1 align="center">vue-to-reactive</h1>
6
6
 
7
- <p align="center">A Vue 3 composition API utility that converts a ref into a reactive proxy object, enabling direct property access without .value while maintaining full reactivity.</p>
7
+ <p align="center"></p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/vue-to-reactive"><img src="https://img.shields.io/npm/v/vue-to-reactive.svg" alt="npm version" /></a>
11
11
  <a href="https://www.npmjs.com/package/vue-to-reactive"><img src="https://img.shields.io/npm/dm/vue-to-reactive.svg" alt="npm downloads" /></a>
12
- <a href="https://github.com/vuefrag/vue-to-reactive/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vue-to-reactive.svg" alt="license" /></a>
13
12
  </p>
14
13
 
15
-
16
14
  ## Installation
17
15
 
18
16
  ```bash
@@ -21,10 +19,6 @@ npm install vue-to-reactive
21
19
 
22
20
  ## Usage
23
21
 
24
- ```ts
25
- import { toReactive } from 'vue-to-reactive';
26
- ```
27
-
28
22
  Converts ref to reactive. Also made possible to create a "swapable" reactive object.
29
23
 
30
24
  ```ts
@@ -45,9 +39,8 @@ console.log(state.foo) // => undefined
45
39
  console.log(state.bar) // => 'foo'
46
40
  ```
47
41
 
48
- > Extracted from [VueUse](https://vueuse.org/) for standalone use.
49
-
50
-
51
42
  ## License
52
43
 
53
44
  MIT
45
+
46
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/README.npm.md ADDED
@@ -0,0 +1,46 @@
1
+ <p align="center">
2
+ <img src="logo.svg" alt="vue-to-reactive" width="180" />
3
+ </p>
4
+
5
+ <h1 align="center">vue-to-reactive</h1>
6
+
7
+ <p align="center"></p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/vue-to-reactive"><img src="https://img.shields.io/npm/v/vue-to-reactive.svg" alt="npm version" /></a>
11
+ <a href="https://www.npmjs.com/package/vue-to-reactive"><img src="https://img.shields.io/npm/dm/vue-to-reactive.svg" alt="npm downloads" /></a>
12
+ </p>
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install vue-to-reactive
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ Converts ref to reactive. Also made possible to create a "swapable" reactive object.
23
+
24
+ ```ts
25
+ import { toReactive } from 'vue-to-reactive'
26
+ import { ref } from 'vue'
27
+
28
+ const refState = ref({ foo: 'bar' })
29
+
30
+ console.log(refState.value.foo) // => 'bar'
31
+
32
+ const state = toReactive(refState) // <--
33
+
34
+ console.log(state.foo) // => 'bar'
35
+
36
+ refState.value = { bar: 'foo' }
37
+
38
+ console.log(state.foo) // => undefined
39
+ console.log(state.bar) // => 'foo'
40
+ ```
41
+
42
+ ## License
43
+
44
+ MIT
45
+
46
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/banner.svg CHANGED
@@ -10,27 +10,27 @@
10
10
  <rect width="1280" height="640" fill="url(#banner-bg)"/>
11
11
 
12
12
  <!-- Decorative elements -->
13
- <circle cx="1200" cy="100" r="300" fill="#42b883" opacity="0.05"/>
14
- <circle cx="80" cy="540" r="200" fill="#42b883" opacity="0.05"/>
13
+ <circle cx="200" cy="150" r="120" fill="#42b883" opacity="0.06"/>
14
+ <circle cx="1150" cy="500" r="100" fill="#42b883" opacity="0.06"/>
15
15
 
16
16
  <!-- Top accent bar -->
17
17
  <rect x="0" y="0" width="1280" height="8" fill="#42b883"/>
18
18
 
19
- <!-- VueFrag badge -->
19
+ <!-- Vuefrag badge -->
20
20
  <g transform="translate(80, 80)">
21
21
  <rect width="140" height="50" rx="8" fill="#42b883"/>
22
- <text x="70" y="33" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="22" font-weight="700" fill="white">VueFrag</text>
22
+ <text x="70" y="33" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="22" font-weight="700" fill="white">Vuefrag</text>
23
23
  </g>
24
24
 
25
25
  <!-- Package name -->
26
26
  <text x="80" y="280" font-family="system-ui, -apple-system, sans-serif" font-size="72" font-weight="700" fill="white">vue-to-reactive</text>
27
27
 
28
28
  <!-- Description -->
29
- <text x="80" y="360" font-family="system-ui, -apple-system, sans-serif" font-size="32" fill="#94a3b8">Vue 3 utility converting ref to reactive proxy object</text>
29
+ <text x="80" y="360" font-family="system-ui, -apple-system, sans-serif" font-size="32" fill="#94a3b8">Vue 3 composable utility</text>
30
30
 
31
31
  <!-- Install command -->
32
32
  <g transform="translate(80, 420)">
33
- <rect width="500" height="60" rx="8" fill="#0f172a"/>
33
+ <rect width="456" height="60" rx="8" fill="#0f172a"/>
34
34
  <text x="20" y="40" font-family="ui-monospace, monospace" font-size="24" fill="#94a3b8">npm install</text>
35
35
  <text x="200" y="40" font-family="ui-monospace, monospace" font-size="24" fill="#42b883">vue-to-reactive</text>
36
36
  </g>
@@ -41,12 +41,8 @@
41
41
  <text x="86" y="27" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="18" fill="#42b883">Reactivity</text>
42
42
  </g>
43
43
 
44
- <!-- Vue logo hint -->
45
- <g transform="translate(1080, 480)">
46
- <polygon points="100,20 140,100 60,100" fill="#42b883" opacity="0.3"/>
47
- <polygon points="100,40 125,90 75,90" fill="#42b883" opacity="0.5"/>
44
+ <!-- Category icon (top right corner) -->
45
+ <g>
46
+ <circle cx="1080" cy="150" r="60" fill="none" stroke="#42b883" stroke-width="15"/><circle cx="1080" cy="150" r="25" fill="#42b883"/><path d="M1000 150h-20M1160 150h20M1080 70v-20M1080 230v20" stroke="#42b883" stroke-width="10" stroke-linecap="round"/>
48
47
  </g>
49
-
50
- <!-- Bottom text -->
51
- <text x="1200" y="600" text-anchor="end" font-family="system-ui, -apple-system, sans-serif" font-size="18" fill="#64748b">Standalone VueUse function</text>
52
48
  </svg>
package/logo.svg CHANGED
@@ -1,30 +1,11 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="256" height="256">
2
- <defs>
3
- <linearGradient id="bg-grad" x1="0%" y1="0%" x2="100%" y2="100%">
4
- <stop offset="0%" style="stop-color:#35495e;stop-opacity:1" />
5
- <stop offset="100%" style="stop-color:#1a252f;stop-opacity:1" />
6
- </linearGradient>
7
- </defs>
8
-
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
9
2
  <!-- Background -->
10
- <rect width="96" height="96" rx="16" fill="url(#bg-grad)"/>
11
-
12
-
13
- <!-- Vue badge -->
14
- <g transform="translate(8, 8)">
15
- <rect width="18" height="9" rx="2" fill="#42b883"/>
16
- <text x="9" y="6.8" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="4.5" font-weight="700" fill="white">VUE</text>
17
- </g>
18
-
19
- <!-- Category icon -->
20
- <g>
21
- <circle cx="48" cy="28" r="12" fill="none" stroke="#42b883" stroke-width="3"/><circle cx="48" cy="28" r="5" fill="#42b883"/><path d="M36 28h-4M60 28h4M48 16v-4M48 40v4" stroke="#42b883" stroke-width="2" stroke-linecap="round"/>
22
- </g>
3
+ <rect width="96" height="96" rx="16" fill="#35495e"/>
23
4
 
24
- <!-- Function name - textLength ensures it fits within bounds -->
25
- <text x="48" y="57" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="10" font-weight="600" fill="white" textLength="66" lengthAdjust="spacingAndGlyphs">To Reactive</text>
5
+ <!-- Primary shape -->
6
+ <circle cx="48" cy="42" r="20" fill="#42b883"/>
26
7
 
27
- <!-- Category label -->
8
+ <!-- Function name -->
28
9
  <text x="48" y="72" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="7" fill="#42b883" opacity="0.85">Reactivity</text>
29
10
 
30
11
  <!-- Bottom accent line -->
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-to-reactive",
3
- "version": "1.0.2",
4
- "description": "Vue 3 utility converting ref to reactive proxy object",
3
+ "version": "1.0.4",
4
+ "description": "Vue 3 composable utility",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -15,30 +15,22 @@
15
15
  "files": [
16
16
  "dist",
17
17
  "logo.svg",
18
- "banner.svg"
18
+ "banner.svg",
19
+ "README.md"
19
20
  ],
20
21
  "scripts": {
21
22
  "build": "unbuild",
22
- "prepublishOnly": "npm run build"
23
+ "prepublishOnly": "cp README.npm.md README.md && npm run build",
24
+ "postpublish": "cp README.github.md README.md"
23
25
  },
24
26
  "keywords": [
25
- "vue",
26
- "vue3",
27
- "vue-3",
28
- "composable",
29
- "composition-api",
30
- "vueuse",
31
27
  "reactive",
32
- "reactivity",
33
- "computed",
34
28
  "ref",
35
- "state",
36
29
  "convert",
37
30
  "unwrap",
38
31
  "proxy",
39
32
  "object",
40
- "no-value",
41
- "toReactive"
33
+ "no-value"
42
34
  ],
43
35
  "author": "VueFrag",
44
36
  "license": "MIT",