@symbiote-native/splash-screen 3.1.0 → 3.2.0
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.md +21 -4
- package/build/angular/services/hide-animation.service/index.js +4 -2
- package/build/solid/index.d.ts +3 -0
- package/build/solid/index.js +8 -0
- package/build/solid/primitives/create-hide-animation.d.ts +3 -0
- package/build/solid/primitives/create-hide-animation.js +24 -0
- package/build-ngc/angular/services/hide-animation.service/index.js +4 -2
- package/build-ngc/angular/services/hide-animation.service/index.js.map +1 -1
- package/build-ngc/core/hide-animation-controller.js.map +1 -1
- package/build-ngc/core/native-module.js.map +1 -1
- package/package.json +23 -9
- package/src/angular/services/hide-animation.service/index.ts +11 -2
- package/src/core/hide-animation-controller.ts +8 -2
- package/src/core/native-module.ts +3 -1
- package/src/core/types.ts +4 -1
- package/src/react/hooks/use-hide-animation/index.ts +3 -1
- package/src/solid/index.ts +17 -0
- package/src/solid/primitives/create-hide-animation.ts +37 -0
- package/src/svelte/runes/use-hide-animation.svelte.ts +5 -1
- package/src/vue/composables/use-hide-animation/index.ts +3 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A wrapper package for [SymbioteNative](../../README.md) that makes
|
|
4
4
|
[`react-native-bootsplash`](https://github.com/zoontek/react-native-bootsplash) usable from
|
|
5
|
-
**every** adapter — React, Vue, and Angular — not just React. Unlike a native
|
|
5
|
+
**every** adapter — React, Vue, Svelte, Solid, and Angular — not just React. Unlike a native-_view_ wrapper
|
|
6
6
|
(see `@symbiote-native/slider`), bootsplash exposes an imperative TurboModule (`hide`/`isVisible`)
|
|
7
7
|
plus a React hook (`useHideAnimation`) that composes a fade-out overlay from plain `View`/`Image`
|
|
8
8
|
primitives — there is no `ViewConfig` to register, only lifecycle to port per adapter.
|
|
@@ -26,6 +26,9 @@ src/core/ hide()/isVisible() (re-exported as-is — zero React upstream),
|
|
|
26
26
|
react-native-bootsplash's useHideAnimation body, framework-agnostic
|
|
27
27
|
src/react/ @symbiote-native/splash-screen/react — useHideAnimation hook
|
|
28
28
|
src/vue/ @symbiote-native/splash-screen/vue — useHideAnimation composable
|
|
29
|
+
src/svelte/ @symbiote-native/splash-screen/svelte — useHideAnimation rune
|
|
30
|
+
src/solid/ @symbiote-native/splash-screen/solid — createHideAnimation primitive (Solid
|
|
31
|
+
reserves `use*` for consuming existing state)
|
|
29
32
|
src/angular/ @symbiote-native/splash-screen/angular — HideAnimationService (signals)
|
|
30
33
|
```
|
|
31
34
|
|
|
@@ -109,6 +112,14 @@ import { hide } from '@symbiote-native/splash-screen/angular';
|
|
|
109
112
|
// call once from the root component's constructor/ngOnInit.
|
|
110
113
|
```
|
|
111
114
|
|
|
115
|
+
```tsx
|
|
116
|
+
// Solid
|
|
117
|
+
import { onMount } from 'solid-js';
|
|
118
|
+
import { hide } from '@symbiote-native/splash-screen/solid';
|
|
119
|
+
|
|
120
|
+
onMount(() => void hide());
|
|
121
|
+
```
|
|
122
|
+
|
|
112
123
|
For a fade transition gated on real readiness (layout committed + logo/brand images loaded +
|
|
113
124
|
your own `ready` flag) instead of an immediate `hide()`, use `useHideAnimation` — it returns the
|
|
114
125
|
same `{ container, logo, brand }` prop bags upstream's hook does, which you bind onto your own
|
|
@@ -128,7 +139,7 @@ const { container, logo } = useHideAnimation({
|
|
|
128
139
|
```
|
|
129
140
|
|
|
130
141
|
See the docs-site package page (`docs/packages/splash-screen`) for the full config surface and
|
|
131
|
-
the Vue/Angular equivalents.
|
|
142
|
+
the Vue/Svelte/Solid/Angular equivalents.
|
|
132
143
|
|
|
133
144
|
## API
|
|
134
145
|
|
|
@@ -162,14 +173,20 @@ useHideAnimation(config: IHideAnimationConfig): IHideAnimationResult
|
|
|
162
173
|
// @symbiote-native/splash-screen/vue — setup runs once, so a getter
|
|
163
174
|
useHideAnimation(getConfig: () => IHideAnimationConfig): ComputedRef<IHideAnimationResult>
|
|
164
175
|
|
|
176
|
+
// @symbiote-native/splash-screen/svelte — the script body runs once, so a getter
|
|
177
|
+
useHideAnimation(getConfig: () => IHideAnimationConfig): { readonly current: IHideAnimationResult }
|
|
178
|
+
|
|
179
|
+
// @symbiote-native/splash-screen/solid — the component body runs once, so an accessor
|
|
180
|
+
createHideAnimation(config: Accessor<IHideAnimationConfig>): Accessor<IHideAnimationResult>
|
|
181
|
+
|
|
165
182
|
// @symbiote-native/splash-screen/angular — inject(HideAnimationService), connect() once
|
|
166
183
|
connect(getConfig: () => IHideAnimationConfig): Signal<IHideAnimationResult>
|
|
167
184
|
```
|
|
168
185
|
|
|
169
186
|
## Test it
|
|
170
187
|
|
|
171
|
-
Headless
|
|
172
|
-
(`src/{react,vue}/{hooks,composables}
|
|
188
|
+
Headless lifecycle-wrapper tests live next to each adapter entry
|
|
189
|
+
(`src/{react,vue,svelte,solid}/{hooks,composables,runes,primitives}/*hide-animation*.test.{ts,tsx}`) and mock
|
|
173
190
|
`react-native-bootsplash`'s `hide`/`isVisible` plus a fake `__turboModuleProxy` for
|
|
174
191
|
`getConstants()`, so they run without a real Fabric host. Native asset generation and the
|
|
175
192
|
Android/iOS wiring above are verified on-device (see the parent [README](../../README.md) for the
|
|
@@ -32,7 +32,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import { computed, effect, inject, Injectable, Injector } from '@angular/core';
|
|
35
|
+
import { computed, effect, inject, Injectable, Injector, } from '@angular/core';
|
|
36
36
|
import { computeHideAnimationStyles, HideAnimationController, } from '../../../core/index.js';
|
|
37
37
|
// Angular twin of React's `useHideAnimation` hook and Vue's `useHideAnimation` composable.
|
|
38
38
|
// Angular has no per-instance hook, so `connect()` stands in for it: call it ONCE (typically
|
|
@@ -64,7 +64,9 @@ let HideAnimationService = (() => {
|
|
|
64
64
|
// is a build error, and a splash quietly stuck in light mode would ship unnoticed.
|
|
65
65
|
connect(getConfig) {
|
|
66
66
|
const controller = new HideAnimationController(getConfig());
|
|
67
|
-
effect(() => controller.updateConfig(getConfig()), {
|
|
67
|
+
effect(() => controller.updateConfig(getConfig()), {
|
|
68
|
+
injector: this.injector,
|
|
69
|
+
});
|
|
68
70
|
return computed(() => computeHideAnimationStyles(getConfig(), controller.constants, controller));
|
|
69
71
|
}
|
|
70
72
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @symbiote-native/splash-screen/solid: the Solid entry over the framework-agnostic core.
|
|
2
|
+
// hide/isVisible carry zero lifecycle and are re-exported verbatim; createHideAnimation wraps
|
|
3
|
+
// HideAnimationController + computeHideAnimationStyles with Solid's own reactivity
|
|
4
|
+
// (primitives/create-hide-animation.ts) — mirrors the lifecycle-bucket naming convention of
|
|
5
|
+
// adapters/solid/src/primitives (never `hooks`/`composables`/`runes`, those are React's, Vue's
|
|
6
|
+
// and Svelte's terms).
|
|
7
|
+
export { hide, isVisible } from '../core/index.js';
|
|
8
|
+
export { createHideAnimation } from './primitives/create-hide-animation.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Solid lifecycle wiring over the framework-agnostic HideAnimationController + style computation
|
|
2
|
+
// (core/) — the Solid twin of React's useHideAnimation hook, Vue's composable and Svelte's rune.
|
|
3
|
+
//
|
|
4
|
+
// `primitives/` and `create*`, never `hooks/`+`use*`: Solid's ecosystem calls a composable
|
|
5
|
+
// reactive function a PRIMITIVE and reserves `use*` for consuming something that already exists.
|
|
6
|
+
// Full rationale in adapters/solid/src/primitives/create-color-scheme.ts.
|
|
7
|
+
//
|
|
8
|
+
// Takes a config ACCESSOR, not a plain value, and returns one: a Solid component body runs ONCE
|
|
9
|
+
// (like Vue's setup, unlike a React hook re-running every render), so a plain config would freeze
|
|
10
|
+
// at its boot value and `ready` flipping true would never be seen. The effect below re-syncs the
|
|
11
|
+
// controller on every signal the accessor reads, mirroring Vue's watchEffect.
|
|
12
|
+
//
|
|
13
|
+
// The controller stays a plain local, never a signal: only its methods are called. It also carries
|
|
14
|
+
// the native constants, read once in its constructor — so a missing RNBootSplash throws straight
|
|
15
|
+
// out of the primitive body, on purpose.
|
|
16
|
+
import { createEffect, createMemo } from 'solid-js';
|
|
17
|
+
import { computeHideAnimationStyles, HideAnimationController, } from '../../core/index.js';
|
|
18
|
+
export function createHideAnimation(config) {
|
|
19
|
+
const controller = new HideAnimationController(config());
|
|
20
|
+
createEffect(() => {
|
|
21
|
+
controller.updateConfig(config());
|
|
22
|
+
});
|
|
23
|
+
return createMemo(() => computeHideAnimationStyles(config(), controller.constants, controller));
|
|
24
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, effect, inject, Injectable, Injector } from '@angular/core';
|
|
1
|
+
import { computed, effect, inject, Injectable, Injector, } from '@angular/core';
|
|
2
2
|
import { computeHideAnimationStyles, HideAnimationController, } from '../../../core';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
// Angular twin of React's `useHideAnimation` hook and Vue's `useHideAnimation` composable.
|
|
@@ -18,7 +18,9 @@ export class HideAnimationService {
|
|
|
18
18
|
// is a build error, and a splash quietly stuck in light mode would ship unnoticed.
|
|
19
19
|
connect(getConfig) {
|
|
20
20
|
const controller = new HideAnimationController(getConfig());
|
|
21
|
-
effect(() => controller.updateConfig(getConfig()), {
|
|
21
|
+
effect(() => controller.updateConfig(getConfig()), {
|
|
22
|
+
injector: this.injector,
|
|
23
|
+
});
|
|
22
24
|
return computed(() => computeHideAnimationStyles(getConfig(), controller.constants, controller));
|
|
23
25
|
}
|
|
24
26
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: HideAnimationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/angular/services/hide-animation.service/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/angular/services/hide-animation.service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAU,EACV,QAAQ,GAET,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,GAGxB,MAAM,eAAe,CAAC;;AAEvB,2FAA2F;AAC3F,6FAA6F;AAC7F,6FAA6F;AAC7F,2FAA2F;AAC3F,EAAE;AACF,wFAAwF;AACxF,gFAAgF;AAEhF,MAAM,OAAO,oBAAoB;IAC/B,2FAA2F;IAC3F,4FAA4F;IAC5F,qFAAqF;IACpE,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAE7C,0FAA0F;IAC1F,4FAA4F;IAC5F,mFAAmF;IACnF,OAAO,CAAC,SAAqC;QAC3C,MAAM,UAAU,GAAG,IAAI,uBAAuB,CAAC,SAAS,EAAE,CAAC,CAAC;QAE5D,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,EAAE;YACjD,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,GAAG,EAAE,CACnB,0BAA0B,CAAC,SAAS,EAAE,EAAE,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC1E,CAAC;IACJ,CAAC;uGAnBU,oBAAoB;2GAApB,oBAAoB,cADP,MAAM;;2FACnB,oBAAoB;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hide-animation-controller.js","sourceRoot":"","sources":["../../src/core/hide-animation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"hide-animation-controller.js","sourceRoot":"","sources":["../../src/core/hide-animation-controller.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,gFAAgF;AAChF,wFAAwF;AACxF,qFAAqF;AACrF,yFAAyF;AACzF,oFAAoF;AACpF,4DAA4D;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAMlD,kFAAkF;AAClF,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,4FAA4F;AAC5F,8FAA8F;AAC9F,mGAAmG;AACnG,2EAA2E;AAC3E,EAAE;AACF,0FAA0F;AAC1F,kGAAkG;AAClG,+FAA+F;AAC/F,mFAAmF;AACnF,EAAE;AACF,6FAA6F;AAC7F,mGAAmG;AACnG,kGAAkG;AAClG,gCAAgC;AAChC,MAAM,UAAU,yBAAyB;IACvC,OAAO,wBAAwB,
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,gFAAgF;AAChF,wFAAwF;AACxF,qFAAqF;AACrF,yFAAyF;AACzF,oFAAoF;AACpF,4DAA4D;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAMlD,kFAAkF;AAClF,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,4FAA4F;AAC5F,8FAA8F;AAC9F,mGAAmG;AACnG,2EAA2E;AAC3E,EAAE;AACF,0FAA0F;AAC1F,kGAAkG;AAClG,+FAA+F;AAC/F,mFAAmF;AACnF,EAAE;AACF,6FAA6F;AAC7F,mGAAmG;AACnG,kGAAkG;AAClG,gCAAgC;AAChC,MAAM,UAAU,yBAAyB;IACvC,OAAO,wBAAwB,CAC7B,0BAA0B,CAC3B,CAAC,YAAY,EAAE,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/splash-screen",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Third-party splash-screen native module wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters.",
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"description": "Third-party splash-screen native module wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"types": "./build/svelte/index.d.ts",
|
|
38
38
|
"default": "./build/svelte/index.js"
|
|
39
39
|
},
|
|
40
|
+
"./solid": {
|
|
41
|
+
"types": "./build/solid/index.d.ts",
|
|
42
|
+
"default": "./build/solid/index.js"
|
|
43
|
+
},
|
|
40
44
|
"./angular": {
|
|
41
45
|
"types": "./build-ngc/angular/index.d.ts",
|
|
42
46
|
"react-native": "./build-ngc/angular/index.js",
|
|
@@ -69,18 +73,20 @@
|
|
|
69
73
|
"dependencies": {
|
|
70
74
|
"react-native-bootsplash": "7.3.2",
|
|
71
75
|
"react-native-is-edge-to-edge": "^1.3.1",
|
|
72
|
-
"@symbiote-native/components": "0.
|
|
76
|
+
"@symbiote-native/components": "0.5.0"
|
|
73
77
|
},
|
|
74
78
|
"peerDependencies": {
|
|
75
79
|
"@symbiote-native/angular": ">=0.6.2",
|
|
76
80
|
"@symbiote-native/engine": ">=0.1.7",
|
|
77
81
|
"@symbiote-native/react": ">=0.2.8",
|
|
82
|
+
"@symbiote-native/solid": ">=0.0.1",
|
|
78
83
|
"@symbiote-native/svelte": ">=0.1.0",
|
|
79
84
|
"@symbiote-native/vue": ">=0.3.8",
|
|
80
85
|
"@angular/core": ">=20",
|
|
81
86
|
"@vue/runtime-core": "^3.5.13",
|
|
82
87
|
"react": ">=19.0.0",
|
|
83
88
|
"react-native": ">=0.86",
|
|
89
|
+
"solid-js": ">=1.9.0",
|
|
84
90
|
"svelte": ">=5.0.0",
|
|
85
91
|
"vue": ">=3.5.0"
|
|
86
92
|
},
|
|
@@ -91,6 +97,9 @@
|
|
|
91
97
|
"@symbiote-native/react": {
|
|
92
98
|
"optional": true
|
|
93
99
|
},
|
|
100
|
+
"@symbiote-native/solid": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
94
103
|
"@symbiote-native/svelte": {
|
|
95
104
|
"optional": true
|
|
96
105
|
},
|
|
@@ -106,6 +115,9 @@
|
|
|
106
115
|
"react": {
|
|
107
116
|
"optional": true
|
|
108
117
|
},
|
|
118
|
+
"solid-js": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
109
121
|
"svelte": {
|
|
110
122
|
"optional": true
|
|
111
123
|
},
|
|
@@ -121,14 +133,16 @@
|
|
|
121
133
|
"@types/react": "^19.2.0",
|
|
122
134
|
"@vue/runtime-core": "^3.5.13",
|
|
123
135
|
"react": "19.2.3",
|
|
136
|
+
"solid-js": "^1.9.14",
|
|
124
137
|
"svelte": "^5.56.0",
|
|
125
138
|
"typescript": "~6.0.0",
|
|
126
|
-
"@symbiote-native/angular": "0.
|
|
127
|
-
"@symbiote-native/engine": "0.
|
|
128
|
-
"@symbiote-native/react": "0.
|
|
129
|
-
"@symbiote-native/
|
|
130
|
-
"@symbiote-native/
|
|
131
|
-
"@symbiote-native/
|
|
139
|
+
"@symbiote-native/angular": "0.8.0",
|
|
140
|
+
"@symbiote-native/engine": "0.3.0",
|
|
141
|
+
"@symbiote-native/react": "0.4.0",
|
|
142
|
+
"@symbiote-native/solid": "0.1.0",
|
|
143
|
+
"@symbiote-native/svelte": "0.3.0",
|
|
144
|
+
"@symbiote-native/test-utils": "0.2.0",
|
|
145
|
+
"@symbiote-native/vue": "0.5.0"
|
|
132
146
|
},
|
|
133
147
|
"scripts": {
|
|
134
148
|
"typecheck": "tsc --build",
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
effect,
|
|
4
|
+
inject,
|
|
5
|
+
Injectable,
|
|
6
|
+
Injector,
|
|
7
|
+
type Signal,
|
|
8
|
+
} from '@angular/core';
|
|
2
9
|
import {
|
|
3
10
|
computeHideAnimationStyles,
|
|
4
11
|
HideAnimationController,
|
|
@@ -26,7 +33,9 @@ export class HideAnimationService {
|
|
|
26
33
|
connect(getConfig: () => IHideAnimationConfig): Signal<IHideAnimationResult> {
|
|
27
34
|
const controller = new HideAnimationController(getConfig());
|
|
28
35
|
|
|
29
|
-
effect(() => controller.updateConfig(getConfig()), {
|
|
36
|
+
effect(() => controller.updateConfig(getConfig()), {
|
|
37
|
+
injector: this.injector,
|
|
38
|
+
});
|
|
30
39
|
|
|
31
40
|
return computed(() =>
|
|
32
41
|
computeHideAnimationStyles(getConfig(), controller.constants, controller),
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { dlog } from '@symbiote-native/engine';
|
|
2
2
|
import { hide } from './hide';
|
|
3
3
|
import { getHideAnimationConstants } from './native-module';
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
IHideAnimationConfig,
|
|
6
|
+
IHideAnimationConstants,
|
|
7
|
+
IHideAnimationFailure,
|
|
8
|
+
} from './types';
|
|
5
9
|
|
|
6
10
|
type IReadinessState = {
|
|
7
11
|
layoutReady: boolean;
|
|
@@ -35,7 +39,9 @@ export class HideAnimationController {
|
|
|
35
39
|
// dlog is DEBUG-gated, so it is the developer's seam, not the report: config.onError is the
|
|
36
40
|
// channel the app actually hears about this on.
|
|
37
41
|
private readonly reportFailure = (failure: IHideAnimationFailure): void => {
|
|
38
|
-
dlog(
|
|
42
|
+
dlog(
|
|
43
|
+
`splash-screen: hide animation degraded at "${failure.stage}": ${String(failure.error)}`,
|
|
44
|
+
);
|
|
39
45
|
this.readiness.onError?.(failure);
|
|
40
46
|
};
|
|
41
47
|
|
|
@@ -33,5 +33,7 @@ type IRNBootSplashSpec = {
|
|
|
33
33
|
// throw never reaches the app. That is a defect in THAT adapter, tracked separately — it is not a
|
|
34
34
|
// reason to stop throwing here.
|
|
35
35
|
export function getHideAnimationConstants(): IHideAnimationConstants {
|
|
36
|
-
return getEnforcingNativeModule<IRNBootSplashSpec>(
|
|
36
|
+
return getEnforcingNativeModule<IRNBootSplashSpec>(
|
|
37
|
+
RN_BOOT_SPLASH_MODULE_NAME,
|
|
38
|
+
).getConstants();
|
|
37
39
|
}
|
package/src/core/types.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
IImageSourceProp,
|
|
3
|
+
IResizeMode,
|
|
4
|
+
} from '@symbiote-native/components';
|
|
2
5
|
import type { IStyleProp, IViewStyle } from '@symbiote-native/engine';
|
|
3
6
|
|
|
4
7
|
export type IHideConfig = {
|
|
@@ -18,7 +18,9 @@ import {
|
|
|
18
18
|
type IHideAnimationResult,
|
|
19
19
|
} from '../../../core';
|
|
20
20
|
|
|
21
|
-
export function useHideAnimation(
|
|
21
|
+
export function useHideAnimation(
|
|
22
|
+
config: IHideAnimationConfig,
|
|
23
|
+
): IHideAnimationResult {
|
|
22
24
|
const controllerRef = useRef<HideAnimationController | null>(null);
|
|
23
25
|
if (controllerRef.current == null) {
|
|
24
26
|
controllerRef.current = new HideAnimationController(config);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @symbiote-native/splash-screen/solid: the Solid entry over the framework-agnostic core.
|
|
2
|
+
// hide/isVisible carry zero lifecycle and are re-exported verbatim; createHideAnimation wraps
|
|
3
|
+
// HideAnimationController + computeHideAnimationStyles with Solid's own reactivity
|
|
4
|
+
// (primitives/create-hide-animation.ts) — mirrors the lifecycle-bucket naming convention of
|
|
5
|
+
// adapters/solid/src/primitives (never `hooks`/`composables`/`runes`, those are React's, Vue's
|
|
6
|
+
// and Svelte's terms).
|
|
7
|
+
|
|
8
|
+
export { hide, isVisible } from '../core';
|
|
9
|
+
export { createHideAnimation } from './primitives/create-hide-animation';
|
|
10
|
+
export type {
|
|
11
|
+
IHideAnimationConfig,
|
|
12
|
+
IHideAnimationFailure,
|
|
13
|
+
IHideAnimationFailureStage,
|
|
14
|
+
IHideAnimationResult,
|
|
15
|
+
IManifest,
|
|
16
|
+
IHideConfig,
|
|
17
|
+
} from '../core';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Solid lifecycle wiring over the framework-agnostic HideAnimationController + style computation
|
|
2
|
+
// (core/) — the Solid twin of React's useHideAnimation hook, Vue's composable and Svelte's rune.
|
|
3
|
+
//
|
|
4
|
+
// `primitives/` and `create*`, never `hooks/`+`use*`: Solid's ecosystem calls a composable
|
|
5
|
+
// reactive function a PRIMITIVE and reserves `use*` for consuming something that already exists.
|
|
6
|
+
// Full rationale in adapters/solid/src/primitives/create-color-scheme.ts.
|
|
7
|
+
//
|
|
8
|
+
// Takes a config ACCESSOR, not a plain value, and returns one: a Solid component body runs ONCE
|
|
9
|
+
// (like Vue's setup, unlike a React hook re-running every render), so a plain config would freeze
|
|
10
|
+
// at its boot value and `ready` flipping true would never be seen. The effect below re-syncs the
|
|
11
|
+
// controller on every signal the accessor reads, mirroring Vue's watchEffect.
|
|
12
|
+
//
|
|
13
|
+
// The controller stays a plain local, never a signal: only its methods are called. It also carries
|
|
14
|
+
// the native constants, read once in its constructor — so a missing RNBootSplash throws straight
|
|
15
|
+
// out of the primitive body, on purpose.
|
|
16
|
+
|
|
17
|
+
import { createEffect, createMemo, type Accessor } from 'solid-js';
|
|
18
|
+
import {
|
|
19
|
+
computeHideAnimationStyles,
|
|
20
|
+
HideAnimationController,
|
|
21
|
+
type IHideAnimationConfig,
|
|
22
|
+
type IHideAnimationResult,
|
|
23
|
+
} from '../../core';
|
|
24
|
+
|
|
25
|
+
export function createHideAnimation(
|
|
26
|
+
config: Accessor<IHideAnimationConfig>,
|
|
27
|
+
): Accessor<IHideAnimationResult> {
|
|
28
|
+
const controller = new HideAnimationController(config());
|
|
29
|
+
|
|
30
|
+
createEffect(() => {
|
|
31
|
+
controller.updateConfig(config());
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return createMemo(() =>
|
|
35
|
+
computeHideAnimationStyles(config(), controller.constants, controller),
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -26,7 +26,11 @@ export function useHideAnimation(getConfig: () => IHideAnimationConfig): {
|
|
|
26
26
|
$effect(() => {
|
|
27
27
|
const config = getConfig();
|
|
28
28
|
controller.updateConfig(config);
|
|
29
|
-
result = computeHideAnimationStyles(
|
|
29
|
+
result = computeHideAnimationStyles(
|
|
30
|
+
config,
|
|
31
|
+
controller.constants,
|
|
32
|
+
controller,
|
|
33
|
+
);
|
|
30
34
|
});
|
|
31
35
|
|
|
32
36
|
return {
|
|
@@ -26,5 +26,7 @@ export function useHideAnimation(
|
|
|
26
26
|
controller.updateConfig(getConfig());
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
return computed(() =>
|
|
29
|
+
return computed(() =>
|
|
30
|
+
computeHideAnimationStyles(getConfig(), controller.constants, controller),
|
|
31
|
+
);
|
|
30
32
|
}
|