nextia 8.0.3 → 8.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nextia",
3
3
  "description": "Create fast web applications",
4
- "version": "8.0.3",
4
+ "version": "8.0.4",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "engines": {
@@ -37,11 +37,10 @@
37
37
  "test:coverage": "vitest run --silent --coverage"
38
38
  },
39
39
  "peerDependencies": {
40
- "react": "^19.0.0",
41
- "react-dom": "^19.0.0"
40
+ "react": "^19.0.0"
42
41
  },
43
42
  "devDependencies": {
44
- "@vitejs/plugin-react": "6.0.1",
43
+ "@vitejs/plugin-react": "6.0.2",
45
44
  "@vitest/coverage-v8": "4.1.6",
46
45
  "jsdom": "29.1.1",
47
46
  "vitest": "4.1.6"
package/src/lib/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  import { Pagex, useCx, useFx } from './fx.js'
11
11
  import { useQueryString, useResize } from './hooks.js'
12
12
  import { I18n, Icon, Link, Svg } from './ui.js'
13
- import { css, startViewTransition } from './utils.js'
13
+ import { css, startViewTransition, version } from './utils.js'
14
14
 
15
15
  export {
16
16
  css,
@@ -23,5 +23,6 @@ export {
23
23
  useCx,
24
24
  useFx,
25
25
  useQueryString,
26
- useResize
26
+ useResize,
27
+ version
27
28
  }
package/src/lib/utils.js CHANGED
@@ -7,8 +7,6 @@
7
7
  * https://github.com/sinuhedev/nextia
8
8
  */
9
9
 
10
- import { flushSync } from 'react-dom'
11
-
12
10
  /**
13
11
  * View Transition
14
12
  */
@@ -17,7 +15,7 @@ async function startViewTransition(fun = () => {}, ref, animation = 'fade') {
17
15
  if (!document.startViewTransition) return fun()
18
16
 
19
17
  ref.style.viewTransitionName = animation
20
- await document.startViewTransition(() => flushSync(fun)).finished
18
+ await document.startViewTransition(() => fun).finished
21
19
  ref.style.viewTransitionName = ''
22
20
  }
23
21
 
@@ -44,4 +42,20 @@ function css(...classNames) {
44
42
  .join(' ')
45
43
  }
46
44
 
47
- export { css, startViewTransition }
45
+ /**
46
+ * getVersion
47
+ */
48
+
49
+ const version = () =>
50
+ Object.fromEntries(
51
+ document
52
+ .querySelector('meta[name="version"]')
53
+ ?.getAttribute('content')
54
+ .split(', ')
55
+ .map((item) => {
56
+ const [key, value] = item.split('=')
57
+ return [key, value]
58
+ }) ?? ''
59
+ )
60
+
61
+ export { css, startViewTransition, version }