vue-ref-default 1.0.0 → 1.0.2

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/README.github.md CHANGED
@@ -9,7 +9,6 @@
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/vue-ref-default"><img src="https://img.shields.io/npm/v/vue-ref-default.svg" alt="npm version" /></a>
11
11
  <a href="https://www.npmjs.com/package/vue-ref-default"><img src="https://img.shields.io/npm/dm/vue-ref-default.svg" alt="npm downloads" /></a>
12
- <a href="https://github.com/vuefrag/vue-ref-default/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vue-ref-default.svg" alt="license" /></a>
13
12
  </p>
14
13
 
15
14
  ## Installation
@@ -21,15 +20,10 @@ npm install vue-ref-default
21
20
  ## Usage
22
21
 
23
22
  ```ts
24
- import { refDefault } from 'vue-ref-default';
25
- ```
26
-
27
- Apply default value to a ref.
28
-
29
- ```ts
30
- import { refDefault, useStorage } from 'vue-ref-default'
23
+ import { refDefault } from 'vue-ref-default'
24
+ import { ref } from 'vue'
31
25
 
32
- const raw = useStorage('key')
26
+ const raw = ref<string | undefined>()
33
27
  const state = refDefault(raw, 'default')
34
28
 
35
29
  raw.value = 'hello'
@@ -39,8 +33,8 @@ raw.value = undefined
39
33
  console.log(state.value) // default
40
34
  ```
41
35
 
42
- > Extracted from [VueUse](https://vueuse.org/) for standalone use.
43
-
44
36
  ## License
45
37
 
46
38
  MIT
39
+
40
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="logo.svg" alt="vue-ref-default" width="180" />
2
+ <img src="https://raw.githubusercontent.com/vuefrag/vue-ref-default/main/banner.svg" alt="vue-ref-default" width="100%" />
3
3
  </p>
4
4
 
5
5
  <h1 align="center">vue-ref-default</h1>
@@ -9,7 +9,6 @@
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/vue-ref-default"><img src="https://img.shields.io/npm/v/vue-ref-default.svg" alt="npm version" /></a>
11
11
  <a href="https://www.npmjs.com/package/vue-ref-default"><img src="https://img.shields.io/npm/dm/vue-ref-default.svg" alt="npm downloads" /></a>
12
- <a href="https://github.com/vuefrag/vue-ref-default/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vue-ref-default.svg" alt="license" /></a>
13
12
  </p>
14
13
 
15
14
  ## Installation
@@ -21,15 +20,10 @@ npm install vue-ref-default
21
20
  ## Usage
22
21
 
23
22
  ```ts
24
- import { refDefault } from 'vue-ref-default';
25
- ```
26
-
27
- Apply default value to a ref.
28
-
29
- ```ts
30
- import { refDefault, useStorage } from 'vue-ref-default'
23
+ import { refDefault } from 'vue-ref-default'
24
+ import { ref } from 'vue'
31
25
 
32
- const raw = useStorage('key')
26
+ const raw = ref<string | undefined>()
33
27
  const state = refDefault(raw, 'default')
34
28
 
35
29
  raw.value = 'hello'
@@ -39,8 +33,8 @@ raw.value = undefined
39
33
  console.log(state.value) // default
40
34
  ```
41
35
 
42
- > Extracted from [VueUse](https://vueuse.org/) for standalone use.
43
-
44
36
  ## License
45
37
 
46
38
  MIT
39
+
40
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/README.npm.md CHANGED
@@ -9,7 +9,6 @@
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/vue-ref-default"><img src="https://img.shields.io/npm/v/vue-ref-default.svg" alt="npm version" /></a>
11
11
  <a href="https://www.npmjs.com/package/vue-ref-default"><img src="https://img.shields.io/npm/dm/vue-ref-default.svg" alt="npm downloads" /></a>
12
- <a href="https://github.com/vuefrag/vue-ref-default/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vue-ref-default.svg" alt="license" /></a>
13
12
  </p>
14
13
 
15
14
  ## Installation
@@ -21,15 +20,10 @@ npm install vue-ref-default
21
20
  ## Usage
22
21
 
23
22
  ```ts
24
- import { refDefault } from 'vue-ref-default';
25
- ```
26
-
27
- Apply default value to a ref.
28
-
29
- ```ts
30
- import { refDefault, useStorage } from 'vue-ref-default'
23
+ import { refDefault } from 'vue-ref-default'
24
+ import { ref } from 'vue'
31
25
 
32
- const raw = useStorage('key')
26
+ const raw = ref<string | undefined>()
33
27
  const state = refDefault(raw, 'default')
34
28
 
35
29
  raw.value = 'hello'
@@ -39,8 +33,8 @@ raw.value = undefined
39
33
  console.log(state.value) // default
40
34
  ```
41
35
 
42
- > Extracted from [VueUse](https://vueuse.org/) for standalone use.
43
-
44
36
  ## License
45
37
 
46
38
  MIT
39
+
40
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/logo.svg CHANGED
@@ -1,31 +1,71 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="256" height="256">
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
2
+ <!-- Premium background with depth -->
2
3
  <defs>
3
- <linearGradient id="bg-grad" x1="0%" y1="0%" x2="100%" y2="100%">
4
+ <linearGradient id="logo-bg-Reactivity" x1="0%" y1="0%" x2="100%" y2="100%">
4
5
  <stop offset="0%" style="stop-color:#35495e;stop-opacity:1" />
5
- <stop offset="100%" style="stop-color:#1a252f;stop-opacity:1" />
6
+ <stop offset="50%" style="stop-color:#1e2936;stop-opacity:1" />
7
+ <stop offset="100%" style="stop-color:#0f1419;stop-opacity:1" />
6
8
  </linearGradient>
9
+ <filter id="logo-shadow">
10
+ <feGaussianBlur in="SourceAlpha" stdDeviation="1.5"/>
11
+ <feOffset dx="0" dy="1" result="offsetblur"/>
12
+ <feComponentTransfer>
13
+ <feFuncA type="linear" slope="0.3"/>
14
+ </feComponentTransfer>
15
+ <feMerge>
16
+ <feMergeNode/>
17
+ <feMergeNode in="SourceGraphic"/>
18
+ </feMerge>
19
+ </filter>
20
+ <filter id="glow">
21
+ <feGaussianBlur stdDeviation="1" result="coloredBlur"/>
22
+ <feMerge>
23
+ <feMergeNode in="coloredBlur"/>
24
+ <feMergeNode in="SourceGraphic"/>
25
+ </feMerge>
26
+ </filter>
7
27
  </defs>
8
28
 
9
29
  <!-- Background -->
10
- <rect width="96" height="96" rx="16" fill="url(#bg-grad)"/>
30
+ <rect width="96" height="96" rx="20" fill="url(#logo-bg-Reactivity)"/>
11
31
 
12
- <!-- Vue badge -->
13
- <g transform="translate(8, 8)">
14
- <rect width="18" height="9" rx="2" fill="#42b883"/>
15
- <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>
32
+ <!-- Subtle inner border -->
33
+ <rect x="2" y="2" width="92" height="92" rx="18" fill="none" stroke="#42b883" stroke-width="0.5" opacity="0.12"/>
34
+
35
+ <!-- Vuefrag badge (top, smaller and moved right) -->
36
+ <g filter="url(#logo-shadow)">
37
+ <rect x="10" y="7" width="26" height="9" rx="2.5" fill="#42b883" opacity="0.8"/>
38
+ <text x="23" y="13.5" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="6" font-weight="600" fill="white" letter-spacing="-0.2">Vuefrag</text>
16
39
  </g>
17
40
 
18
- <!-- Category icon -->
19
- <g>
20
- <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"/>
41
+ <!-- Category icon (centered, balanced size) -->
42
+ <g filter="url(#glow)">
43
+
44
+ <!-- Atomic structure -->
45
+ <circle cx="48" cy="34" r="16" fill="none" stroke="#42b883" stroke-width="3.5" opacity="0.3"/>
46
+ <circle cx="48" cy="34" r="5" fill="#42b883"/>
47
+ <circle cx="64" cy="34" r="3.5" fill="#42b883"/>
48
+ <circle cx="32" cy="34" r="3.5" fill="#42b883"/>
49
+ <circle cx="48" cy="18" r="3" fill="#42b883" opacity="0.7"/>
50
+ <circle cx="48" cy="50" r="3" fill="#42b883" opacity="0.7"/>
21
51
  </g>
22
52
 
23
- <!-- Function name - textLength ensures it fits within bounds -->
24
- <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">Ref Default</text>
53
+ <!-- Package name (bold, readable) -->
54
+ <text x="48" y="70" text-anchor="middle"
55
+ font-family="ui-monospace, 'SF Mono', Menlo, monospace"
56
+ font-size="8"
57
+ font-weight="600"
58
+ fill="#42b883"
59
+ letter-spacing="-0.3">vue-ref-default</text>
25
60
 
26
- <!-- Category label -->
27
- <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>
61
+ <!-- Category name (smaller, subtle) -->
62
+ <text x="48" y="80" text-anchor="middle"
63
+ font-family="system-ui, -apple-system, sans-serif"
64
+ font-size="6.5"
65
+ font-weight="500"
66
+ fill="#42b883"
67
+ opacity="0.5">Reactivity</text>
28
68
 
29
69
  <!-- Bottom accent line -->
30
- <rect x="28" y="82" width="40" height="2" rx="1" fill="#42b883" opacity="0.5"/>
70
+ <rect x="24" y="88" width="48" height="1.5" rx="0.75" fill="#42b883" opacity="0.18"/>
31
71
  </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-ref-default",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Vue 3 computed ref providing fallback for null/undefined values",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -15,31 +15,24 @@
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
- "build": "unbuild",
22
- "prepublishOnly": "cp README.npm.md README.md && npm run build",
23
- "postpublish": "cp README.github.md README.md"
22
+ "build": "unbuild"
24
23
  },
25
24
  "keywords": [
26
25
  "vue",
27
26
  "vue3",
28
- "vue-3",
29
- "composable",
30
27
  "composition-api",
28
+ "composable",
31
29
  "vueuse",
32
- "reactive",
33
- "reactivity",
34
- "computed",
35
30
  "ref",
36
- "state",
37
31
  "default",
38
32
  "fallback",
39
33
  "nullable",
40
34
  "value",
41
- "nullish-coalescing",
42
- "refDefault"
35
+ "nullish-coalescing"
43
36
  ],
44
37
  "author": "VueFrag",
45
38
  "license": "MIT",
@@ -59,4 +52,4 @@
59
52
  "typescript": "^5.0.0",
60
53
  "vue": "^3.4.0"
61
54
  }
62
- }
55
+ }