@onekeyfe/react-native-skeleton 6.7.0-5 → 6.7.0-50

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.
Files changed (2) hide show
  1. package/README.md +61 -31
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -1,17 +1,40 @@
1
+ <div align="center">
2
+
1
3
  # @onekeyfe/react-native-skeleton
2
4
 
3
- A native shimmer loading placeholder for OneKey React Native applications on
4
- iOS and Android. The Nitro view animates its own native rendering surface;
5
- the application decides when to display it and when loaded content replaces it.
5
+ **Native shimmer placeholders for OneKey's iOS and Android surfaces.**
6
+
7
+ [![npm](https://img.shields.io/npm/v/%40onekeyfe%2Freact-native-skeleton?label=npm&color=4D6BFE)](https://www.npmjs.com/package/@onekeyfe/react-native-skeleton)
8
+ [![license](https://img.shields.io/npm/l/%40onekeyfe%2Freact-native-skeleton?label=license&color=4D6BFE)](LICENSE)
9
+ ![iOS](https://img.shields.io/badge/iOS-000000?logo=apple&logoColor=white)
10
+ ![Android](https://img.shields.io/badge/Android-3DDC84?logo=android&logoColor=white)
11
+ ![Nitro Modules](https://img.shields.io/badge/Nitro_Modules-4D6BFE)
12
+
13
+ </div>
14
+
15
+ A Nitro view that renders a shimmering placeholder while content loads. The
16
+ native renderer owns the animation; the application owns the loading state and
17
+ decides when the placeholder is mounted and removed.
18
+
19
+ ## Features
20
+
21
+ - **Native animation** — the shimmer runs on the native rendering surface, not
22
+ in JavaScript frames.
23
+ - **Per-instance styling** — speed and a two-color gradient are props, so one
24
+ package serves every loading surface.
25
+ - **Pure placeholder** — no load/error events, no data fetching and no global
26
+ state to clean up.
27
+ - **New architecture** — a Nitro view registered through Fabric.
6
28
 
7
29
  ## Installation
8
30
 
9
31
  ```sh
10
- yarn add @onekeyfe/react-native-skeleton react-native-nitro-modules
32
+ yarn add @onekeyfe/react-native-skeleton
11
33
  ```
12
34
 
13
- Install the application's iOS pods and rebuild the native application after
14
- adding the package. A JavaScript-only install does not register the Nitro view.
35
+ The package registers a native view, so install the app's iOS pods and rebuild
36
+ the native binary; a JavaScript-only install does not register it. Android links
37
+ through autolinking.
15
38
 
16
39
  ## Usage
17
40
 
@@ -25,38 +48,45 @@ import { SkeletonView } from '@onekeyfe/react-native-skeleton';
25
48
  />;
26
49
  ```
27
50
 
28
- Give the view a width and height through its layout style. The example uses the
29
- actual exported package name and supported shimmer props; there is no public
30
- `color` prop on this view.
51
+ Give the view explicit layout dimensions, and reuse the loaded content's
52
+ dimensions if a layout shift would be visible.
53
+
54
+ ## API
55
+
56
+ | Prop | Type | Default | Description |
57
+ | --- | --- | --- | --- |
58
+ | `shimmerSpeed` | `number` | `3` | Animation duration in seconds; clamped to at least `0.1`. |
59
+ | `shimmerGradientColors` | `string[]` | native defaults | Two gradient colors; only the first two entries are used. |
60
+
61
+ The component accepts a standard React Native `style` for size, radius and
62
+ placement. Use six-digit hex strings for the gradient so iOS and Android agree.
63
+ See [`src/Skeleton.nitro.ts`](src/Skeleton.nitro.ts) for the native interface and
64
+ [`src/index.tsx`](src/index.tsx) for the exported component.
31
65
 
32
- ## Props and lifecycle
66
+ ## Platform support
33
67
 
34
- | Prop | Meaning |
35
- | --- | --- |
36
- | `shimmerSpeed` | Animation duration in seconds; defaults to 3 and is clamped to at least 0.1. |
37
- | `shimmerGradientColors` | Two gradient colors; native uses the first two entries and falls back to its defaults when fewer are provided. |
68
+ | Capability | iOS | Android | Web |
69
+ | --- | :-: | :-: | :-: |
70
+ | `SkeletonView` | ✅ | ✅ | — |
71
+ | Native shimmer | ✅ | ✅ | — |
72
+ | `shimmerSpeed`, `shimmerGradientColors` | ✅ | ✅ | — |
38
73
 
39
- Use six-digit hex colors for consistent iOS and Android input. The view's native
40
- renderer handles attachment and animation lifecycle; it does not track network
41
- requests or emit a loading-completion event. Consumers control whether the
42
- placeholder remains mounted and should verify the resulting layout with their
43
- actual content.
74
+ ## Caveats
44
75
 
45
- The current interface is in [src/Skeleton.nitro.ts](src/Skeleton.nitro.ts), and
46
- the public component is exported from [src/index.tsx](src/index.tsx).
76
+ > [!NOTE]
77
+ > The view tracks no loading state and emits no completion event. The
78
+ > application removes the placeholder when its own loading state finishes.
47
79
 
48
- ## Loading-state ownership
80
+ > [!IMPORTANT]
81
+ > `shimmerGradientColors` is a string array, not React Native color objects, and
82
+ > `shimmerSpeed` is a duration in seconds, not frames per second.
49
83
 
50
- `SkeletonView` is the exported native host component. The package declares no
51
- `onLoad`, `onError` or network-request prop: the application removes or hides
52
- the placeholder when its own loading state changes.
84
+ ## References
53
85
 
54
- `shimmerGradientColors` supplies a string array rather than React Native color
55
- objects, and `shimmerSpeed` is a duration rather than frames per second.
56
- Preserve layout dimensions when replacing the skeleton with loaded content if
57
- the consumer needs to avoid a layout shift. Native animation results remain
58
- separate from the application's data-loading completion.
86
+ - [Public interface](src/Skeleton.nitro.ts)
87
+ - [npm package](https://www.npmjs.com/package/@onekeyfe/react-native-skeleton)
88
+ - [Changelog](../../CHANGELOG.md)
59
89
 
60
90
  ## License
61
91
 
62
- MIT.
92
+ MIT. See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-skeleton",
3
- "version": "6.7.0-5",
3
+ "version": "6.7.0-50",
4
4
  "description": "Native shimmer loading placeholder for OneKey on iOS and Android",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -67,11 +67,11 @@
67
67
  "@eslint/compat": "^1.3.2",
68
68
  "@eslint/eslintrc": "^3.3.1",
69
69
  "@eslint/js": "^9.35.0",
70
- "@react-native/babel-preset": "0.86.2",
71
- "@react-native/eslint-config": "0.86.2",
70
+ "@react-native/babel-preset": "0.88.0",
71
+ "@react-native/eslint-config": "0.88.0",
72
72
  "@release-it/conventional-changelog": "^10.0.1",
73
73
  "@types/jest": "^29.5.14",
74
- "@types/react": "^19.2.0",
74
+ "@types/react": "^19.3.0",
75
75
  "commitlint": "^19.8.1",
76
76
  "del-cli": "^6.0.0",
77
77
  "eslint": "^9.35.0",
@@ -81,8 +81,8 @@
81
81
  "lefthook": "^2.0.3",
82
82
  "nitrogen": "0.37.0",
83
83
  "prettier": "^2.8.8",
84
- "react": "19.2.3",
85
- "react-native": "patch:react-native@npm%3A0.86.2#~/.yarn/patches/react-native-npm-0.86.2-c9d546616f.patch",
84
+ "react": "19.3.0",
85
+ "react-native": "patch:react-native@npm%3A0.88.0#~/.yarn/patches/react-native-npm-0.88.0-60c6201dd2.patch",
86
86
  "react-native-builder-bob": "^0.40.13",
87
87
  "react-native-nitro-modules": "0.37.0",
88
88
  "release-it": "^19.0.4",
@@ -94,7 +94,7 @@
94
94
  "react-native": "*",
95
95
  "react-native-nitro-modules": "0.37.0"
96
96
  },
97
- "packageManager": "yarn@4.11.0",
97
+ "packageManager": "yarn@4.1.0",
98
98
  "react-native-builder-bob": {
99
99
  "source": "src",
100
100
  "output": "lib",
@@ -128,7 +128,7 @@
128
128
  "useTabs": false
129
129
  },
130
130
  "jest": {
131
- "preset": "react-native",
131
+ "preset": "@react-native/jest-preset",
132
132
  "modulePathIgnorePatterns": [
133
133
  "<rootDir>/example/node_modules",
134
134
  "<rootDir>/lib/"