react-native-unistyles 3.0.0-rc.5 → 3.0.1
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 +7 -7
- package/Unistyles.podspec +12 -1
- package/android/build.gradle +1 -1
- package/android/src/main/cxx/NativeUnistylesModule.cpp +2 -1
- package/android/src/main/cxx/NativeUnistylesModule.h +4 -0
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +1 -0
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +21 -9
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +7 -0
- package/cxx/core/UnistylesRegistry.cpp +7 -0
- package/cxx/core/UnistylesRegistry.h +2 -1
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +9 -2
- package/ios/UnistylesModuleOnLoad.mm +5 -0
- package/lib/commonjs/components/AdaptiveTheme.js +1 -1
- package/lib/commonjs/components/AdaptiveTheme.js.map +1 -1
- package/lib/commonjs/components/NamedTheme.js +1 -1
- package/lib/commonjs/components/NamedTheme.js.map +1 -1
- package/lib/commonjs/components/ScopedTheme.js +23 -18
- package/lib/commonjs/components/ScopedTheme.js.map +1 -1
- package/lib/commonjs/core/createUnistylesElement.js +2 -2
- package/lib/commonjs/core/createUnistylesElement.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.js +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js +2 -1
- package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js +14 -2
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.js +9 -3
- package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +9 -3
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/commonjs/mocks.js +21 -0
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js +0 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -1
- package/lib/commonjs/web/convert/pseudo.js +13 -3
- package/lib/commonjs/web/convert/pseudo.js.map +1 -1
- package/lib/commonjs/web/convert/utils.js +1 -0
- package/lib/commonjs/web/convert/utils.js.map +1 -1
- package/lib/commonjs/web/css/core.js +3 -1
- package/lib/commonjs/web/css/core.js.map +1 -1
- package/lib/commonjs/web/listener.js +2 -2
- package/lib/commonjs/web/listener.js.map +1 -1
- package/lib/commonjs/web/runtime.js +11 -1
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/module/components/AdaptiveTheme.js +1 -1
- package/lib/module/components/AdaptiveTheme.js.map +1 -1
- package/lib/module/components/NamedTheme.js +1 -1
- package/lib/module/components/NamedTheme.js.map +1 -1
- package/lib/module/components/ScopedTheme.js +23 -18
- package/lib/module/components/ScopedTheme.js.map +1 -1
- package/lib/module/core/createUnistylesElement.js +2 -2
- package/lib/module/core/createUnistylesElement.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/listener.js +1 -1
- package/lib/module/core/useProxifiedUnistyles/listener.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/listener.native.js +2 -1
- package/lib/module/core/useProxifiedUnistyles/listener.native.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js +14 -2
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -1
- package/lib/module/core/withUnistyles/withUnistyles.js +9 -3
- package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/module/core/withUnistyles/withUnistyles.native.js +9 -3
- package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/module/mocks.js +21 -0
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/specs/UnistylesRuntime/index.js +0 -1
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/module/web/convert/object/boxShadow.js.map +1 -1
- package/lib/module/web/convert/pseudo.js +10 -2
- package/lib/module/web/convert/pseudo.js.map +1 -1
- package/lib/module/web/convert/utils.js +1 -0
- package/lib/module/web/convert/utils.js.map +1 -1
- package/lib/module/web/css/core.js +3 -1
- package/lib/module/web/css/core.js.map +1 -1
- package/lib/module/web/listener.js +2 -2
- package/lib/module/web/listener.js.map +1 -1
- package/lib/module/web/runtime.js +11 -1
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/typescript/src/components/NamedTheme.d.ts +1 -1
- package/lib/typescript/src/components/NamedTheme.d.ts.map +1 -1
- package/lib/typescript/src/components/ScopedTheme.d.ts +9 -3
- package/lib/typescript/src/components/ScopedTheme.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.native.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/types.d.ts +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/types.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/types.d.ts +3 -1
- package/lib/typescript/src/core/withUnistyles/types.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/pseudo.d.ts +6 -3
- package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/css/core.d.ts.map +1 -1
- package/lib/typescript/src/web/listener.d.ts +4 -2
- package/lib/typescript/src/web/listener.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/components/AdaptiveTheme.tsx +1 -1
- package/src/components/NamedTheme.tsx +2 -2
- package/src/components/ScopedTheme.tsx +39 -32
- package/src/core/createUnistylesElement.tsx +5 -3
- package/src/core/useProxifiedUnistyles/listener.native.ts +3 -1
- package/src/core/useProxifiedUnistyles/listener.ts +1 -1
- package/src/core/useProxifiedUnistyles/types.ts +1 -1
- package/src/core/useProxifiedUnistyles/useProxifiedUnistyles.ts +19 -2
- package/src/core/withUnistyles/types.ts +1 -1
- package/src/core/withUnistyles/withUnistyles.native.tsx +9 -3
- package/src/core/withUnistyles/withUnistyles.tsx +11 -8
- package/src/mocks.ts +23 -0
- package/src/specs/UnistylesRuntime/index.ts +0 -1
- package/src/web/convert/object/boxShadow.ts +2 -2
- package/src/web/convert/pseudo.ts +23 -52
- package/src/web/convert/utils.ts +2 -1
- package/src/web/css/core.ts +3 -1
- package/src/web/listener.ts +8 -6
- package/src/web/runtime.ts +14 -1
- package/unistyles_get_rn_version.rb +28 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pseudo.d.ts","sourceRoot":"","sources":["../../../../../src/web/convert/pseudo.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pseudo.d.ts","sourceRoot":"","sources":["../../../../../src/web/convert/pseudo.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa,43BAoET,CAAA;AAGV,QAAA,MAAM,cAAc,uYAuBV,CAAA;AAEV,KAAK,kBAAkB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,MAAM,GAAG,GAAG,CAAC,CAAA;AAE3F,MAAM,MAAM,MAAM,GAAG,kBAAkB,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAEzG,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,YAA8D,CAAA;AAE5G,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,YAA+D,CAAA;AAE/G,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,YAAyD,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/web/convert/utils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/web/convert/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAqB,KAAK,OAAO,EAAsB,MAAM,SAAS,CAAA;AAEjH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,OAAO,GAAG,KAAG,KAAK,IAAI,KAAK,CAAC,eAAe,CAAgD,CAAA;AAEpI,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,YAA0E,CAAA;AAElH,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,YAAwE,CAAA;AAE5G,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,OAAO,GAAG,KAAG,KAAK,IAAI,KAAK,CAAC,OAAO,CAA6C,CAAA;AAEtH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,OAAO,GAAG,KAAG,KAAK,IAAI,KAAK,CAAC,cAAc,CAAgD,CAAA;AAEnI,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,GAAG,MAAM,oBAA8D,CAAA;AAE1H,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,gBAAW,WAyBxD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,IAAI,SAAS,aAAa,EAAE,KAAK,IAAI,EAAE,YAAY,MAAM,EAAE,QAAQ,GAAG,KAAG,SAAS,CAAC,IAAI,CAazH,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../src/web/css/core.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../src/web/css/core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,QAAQ,SA+DrF,CAAA"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { UnistyleDependency } from '../specs/NativePlatform';
|
2
2
|
import type { UnistylesServices } from './types';
|
3
|
+
type Listener = (dependency: UnistyleDependency) => void;
|
3
4
|
export declare class UnistylesListener {
|
4
5
|
private services;
|
5
6
|
private isInitialized;
|
@@ -8,7 +9,8 @@ export declare class UnistylesListener {
|
|
8
9
|
constructor(services: UnistylesServices);
|
9
10
|
emitChange: (dependency: UnistyleDependency) => void;
|
10
11
|
initListeners: () => void;
|
11
|
-
addListeners: (dependencies: Array<UnistyleDependency>, listener:
|
12
|
-
addStylesheetListeners: (dependencies: Array<UnistyleDependency>, listener:
|
12
|
+
addListeners: (dependencies: Array<UnistyleDependency>, listener: Listener) => () => void;
|
13
|
+
addStylesheetListeners: (dependencies: Array<UnistyleDependency>, listener: Listener) => () => void;
|
13
14
|
}
|
15
|
+
export {};
|
14
16
|
//# sourceMappingURL=listener.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../../src/web/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,qBAAa,iBAAiB;IAKd,OAAO,CAAC,QAAQ;IAJ5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,SAAS,
|
1
|
+
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../../src/web/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,KAAK,QAAQ,GAAG,CAAC,UAAU,EAAE,kBAAkB,KAAK,IAAI,CAAA;AAExD,qBAAa,iBAAiB;IAKd,OAAO,CAAC,QAAQ;IAJ5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,SAAS,CAAgG;IACjH,OAAO,CAAC,mBAAmB,CAAgG;gBAEvG,QAAQ,EAAE,iBAAiB;IAE/C,UAAU,GAAI,YAAY,kBAAkB,UAG3C;IAED,aAAa,aAkCZ;IAED,YAAY,GAAI,cAAc,KAAK,CAAC,kBAAkB,CAAC,EAAE,UAAU,QAAQ,gBAM1E;IAED,sBAAsB,GAAI,cAAc,KAAK,CAAC,kBAAkB,CAAC,EAAE,UAAU,QAAQ,gBAMpF;CACJ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/web/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC3F,OAAO,EAAuB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGhD,qBAAa,gBAAgB;IAKb,OAAO,CAAC,QAAQ;IAJ5B,UAAU,wBAAuB;IACjC,SAAS,wBAAsB;IAC/B,WAAW,iBAAsD;gBAE7C,QAAQ,EAAE,iBAAiB;IAE/C,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAYpB,IAAI,WAAW,gBASd;IAED,IAAI,SAAS,
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/web/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC3F,OAAO,EAAuB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGhD,qBAAa,gBAAgB;IAKb,OAAO,CAAC,QAAQ;IAJ5B,UAAU,wBAAuB;IACjC,SAAS,wBAAsB;IAC/B,WAAW,iBAAsD;gBAE7C,QAAQ,EAAE,iBAAiB;IAE/C,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAYpB,IAAI,WAAW,gBASd;IAED,IAAI,SAAS,cAYZ;IAED,IAAI,mBAAmB,2BAEtB;IAED,IAAI,WAAW,sCAEd;IAED,IAAI,UAAU,wDAEb;IAED,IAAI,WAAW,gBAMd;IAED,IAAI,WAAW,YAEd;IAED,IAAI,UAAU,YAEb;IAED,IAAI,KAAK,UAER;IAED,IAAI,UAAU,WAEb;IAED,IAAI,MAAM;;;MAYT;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,MAAM;;;;;;MAQT;IAED,IAAI,SAAS,oDAEZ;IAED,IAAI,GAAG,YAEN;IAED,IAAI,iBAAiB,YAEpB;IAED,IAAI,aAAa,2DAEhB;IAED,IAAI,WAAW,IAAI,oBAAoB,CAuBtC;IAED,QAAQ,GAAI,WAAW,YAAY,UAmBlC;IAED,iBAAiB,GAAI,WAAW,OAAO,UAiBtC;IAED,0BAA0B,GAAI,OAAO,MAAM,UAM1C;IAED,gBAAgB,aAAW;IAE3B,WAAW,GAAI,WAAW,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,QAAQ,KAAK,QAAQ,UAsBpF;IAED,QAAQ,GAAI,qBAA0B,EAAE,iBAAe,WActD;CACJ"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-unistyles",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.1",
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
5
5
|
"scripts": {
|
6
6
|
"test": "NODE_ENV=babel-test jest ./plugin",
|
@@ -91,6 +91,7 @@
|
|
91
91
|
"react-native.config.js",
|
92
92
|
"Unistyles.podspec",
|
93
93
|
"repack-plugin",
|
94
|
+
"unistyles_get_rn_version.rb",
|
94
95
|
"!repack-plugin/__tests__",
|
95
96
|
"!repack-plugin/src",
|
96
97
|
"!repack-plugin/esbuild.js",
|
@@ -14,7 +14,7 @@ export const AdaptiveTheme: React.FunctionComponent<AdaptiveThemeProps> = ({
|
|
14
14
|
previousScopedTheme
|
15
15
|
}) => {
|
16
16
|
const { rt } = useUnistyles()
|
17
|
-
const name = (rt.
|
17
|
+
const name = (rt.colorScheme === 'dark' ? 'light' : 'dark') as keyof UnistylesThemes
|
18
18
|
const mappedChildren = [
|
19
19
|
<ApplyScopedTheme key={name} name={name} />,
|
20
20
|
children,
|
@@ -5,7 +5,7 @@ import { UnistylesShadowRegistry } from '../specs'
|
|
5
5
|
import { ApplyScopedTheme } from './ApplyScopedTheme'
|
6
6
|
|
7
7
|
interface NamedThemeProps extends PropsWithChildren {
|
8
|
-
name: keyof UnistylesThemes,
|
8
|
+
name: keyof UnistylesThemes | undefined,
|
9
9
|
previousScopedTheme?: string
|
10
10
|
}
|
11
11
|
|
@@ -15,7 +15,7 @@ export const NamedTheme: React.FunctionComponent<NamedThemeProps> = ({
|
|
15
15
|
previousScopedTheme
|
16
16
|
}) => {
|
17
17
|
const mappedChildren = [
|
18
|
-
<ApplyScopedTheme key=
|
18
|
+
<ApplyScopedTheme key='apply' name={name} />,
|
19
19
|
children,
|
20
20
|
<ApplyScopedTheme key='dispose' name={previousScopedTheme as keyof UnistylesThemes | undefined} />
|
21
21
|
]
|
@@ -6,47 +6,54 @@ import { NamedTheme } from './NamedTheme'
|
|
6
6
|
|
7
7
|
type ThemeProps = {
|
8
8
|
name: keyof UnistylesThemes,
|
9
|
-
invertedAdaptive?:
|
9
|
+
invertedAdaptive?: never
|
10
|
+
reset?: never
|
10
11
|
} | {
|
11
|
-
name?:
|
12
|
-
invertedAdaptive:
|
12
|
+
name?: never,
|
13
|
+
invertedAdaptive: boolean,
|
14
|
+
reset?: never
|
15
|
+
} | {
|
16
|
+
name?: never,
|
17
|
+
invertedAdaptive?: never,
|
18
|
+
reset: boolean
|
13
19
|
}
|
14
20
|
|
15
21
|
export const ScopedTheme: React.FunctionComponent<React.PropsWithChildren<ThemeProps>> = ({
|
16
22
|
name,
|
17
23
|
children,
|
18
|
-
invertedAdaptive
|
24
|
+
invertedAdaptive,
|
25
|
+
reset
|
19
26
|
}) => {
|
20
27
|
const hasAdaptiveThemes = UnistylesRuntime.hasAdaptiveThemes
|
21
28
|
const isAdaptiveTheme = invertedAdaptive && hasAdaptiveThemes
|
22
|
-
|
23
|
-
if (invertedAdaptive && !hasAdaptiveThemes) {
|
24
|
-
return children
|
25
|
-
}
|
26
|
-
|
27
|
-
if (!invertedAdaptive && !name) {
|
28
|
-
if (__DEV__) {
|
29
|
-
console.error('ScopedTheme: name or invertedAdaptive must be provided')
|
30
|
-
}
|
31
|
-
|
32
|
-
return null
|
33
|
-
}
|
34
|
-
|
35
29
|
const previousScopedTheme = UnistylesShadowRegistry.getScopedTheme()
|
36
30
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
31
|
+
switch (true) {
|
32
|
+
case name !== undefined:
|
33
|
+
return (
|
34
|
+
<NamedTheme
|
35
|
+
name={name as keyof UnistylesThemes}
|
36
|
+
previousScopedTheme={previousScopedTheme}
|
37
|
+
>
|
38
|
+
{children}
|
39
|
+
</NamedTheme>
|
40
|
+
)
|
41
|
+
case isAdaptiveTheme:
|
42
|
+
return (
|
43
|
+
<AdaptiveTheme previousScopedTheme={previousScopedTheme}>
|
44
|
+
{children}
|
45
|
+
</AdaptiveTheme>
|
46
|
+
)
|
47
|
+
case reset:
|
48
|
+
return (
|
49
|
+
<NamedTheme
|
50
|
+
name={undefined}
|
51
|
+
previousScopedTheme={previousScopedTheme}
|
52
|
+
>
|
53
|
+
{children}
|
54
|
+
</NamedTheme>
|
55
|
+
)
|
56
|
+
default:
|
57
|
+
return children
|
58
|
+
}
|
52
59
|
}
|
@@ -7,14 +7,16 @@ import { createUnistylesRef } from '../web/utils/createUnistylesRef'
|
|
7
7
|
import { getClassName } from './getClassname'
|
8
8
|
import { maybeWarnAboutMultipleUnistyles } from './warn'
|
9
9
|
|
10
|
-
const STYLE_PROPS = ['
|
10
|
+
const STYLE_PROPS = ['contentContainerStyle', 'columnWrapperStyle'] as const
|
11
|
+
|
12
|
+
type StyleProp = typeof STYLE_PROPS[number] | 'style'
|
11
13
|
|
12
14
|
type ComponentProps = {
|
13
|
-
[K in
|
15
|
+
[K in StyleProp]?: UnistylesValues
|
14
16
|
}
|
15
17
|
|
16
18
|
const buildUnistylesProps = (Component: any, props: ComponentProps, forwardedRef: React.ForwardedRef<unknown>) => {
|
17
|
-
const componentStyleProps = STYLE_PROPS.filter(styleProp => styleProp in props)
|
19
|
+
const componentStyleProps = ['style' as const, ...STYLE_PROPS.filter(styleProp => styleProp in props)]
|
18
20
|
const classNames = Object.fromEntries(componentStyleProps.map(styleProp => [styleProp, getClassName(props[styleProp])]))
|
19
21
|
const refs = componentStyleProps.map(styleProp => {
|
20
22
|
return createUnistylesRef(
|
@@ -10,7 +10,9 @@ export const listener = ({ dependencies, updateTheme, updateRuntime }: ListenerP
|
|
10
10
|
}
|
11
11
|
|
12
12
|
if (changedDependencies.some((dependency: UnistyleDependency) => dependencies.includes(dependency))) {
|
13
|
-
|
13
|
+
const hasThemeNameChange = changedDependencies.includes(UnistyleDependency.ThemeName)
|
14
|
+
|
15
|
+
updateRuntime(hasThemeNameChange)
|
14
16
|
}
|
15
17
|
})
|
16
18
|
|
@@ -4,7 +4,7 @@ import type { ListenerProps } from './types'
|
|
4
4
|
|
5
5
|
export const listener = ({ dependencies, updateTheme, updateRuntime }: ListenerProps) => {
|
6
6
|
const disposeTheme = unistyles.services.listener.addListeners(dependencies.filter(dependency => dependency === UnistyleDependency.Theme), updateTheme)
|
7
|
-
const disposeRuntime = unistyles.services.listener.addListeners(dependencies.filter(dependency => dependency !== UnistyleDependency.Theme), updateRuntime)
|
7
|
+
const disposeRuntime = unistyles.services.listener.addListeners(dependencies.filter(dependency => dependency !== UnistyleDependency.Theme), dependency => updateRuntime(dependency === UnistyleDependency.ThemeName))
|
8
8
|
|
9
9
|
return () => {
|
10
10
|
disposeTheme()
|
@@ -28,7 +28,7 @@ const RTDependencyMap = {
|
|
28
28
|
} satisfies Partial<Record<keyof UnistylesMiniRuntime, UnistyleDependency>>
|
29
29
|
|
30
30
|
export const useProxifiedUnistyles = (forcedTheme?: UnistylesTheme) => {
|
31
|
-
const scopedTheme = forcedTheme ?? UnistylesShadowRegistry.getScopedTheme() as UnistylesTheme
|
31
|
+
const [scopedTheme, setScopedTheme] = useState(forcedTheme ?? UnistylesShadowRegistry.getScopedTheme() as UnistylesTheme)
|
32
32
|
const [dependencies] = useState(() => new Set<number>())
|
33
33
|
const [theme, setTheme] = useState(UnistylesRuntime.getTheme(scopedTheme))
|
34
34
|
const [_, runtimeChanged] = useReducer(() => ({}), {})
|
@@ -45,7 +45,13 @@ export const useProxifiedUnistyles = (forcedTheme?: UnistylesTheme) => {
|
|
45
45
|
|
46
46
|
setTheme(UnistylesRuntime.getTheme(scopedTheme))
|
47
47
|
},
|
48
|
-
updateRuntime: () =>
|
48
|
+
updateRuntime: (hasThemeNameChange: boolean) => {
|
49
|
+
if (hasThemeNameChange && scopedTheme) {
|
50
|
+
return
|
51
|
+
}
|
52
|
+
|
53
|
+
runtimeChanged()
|
54
|
+
}
|
49
55
|
})
|
50
56
|
}
|
51
57
|
|
@@ -55,6 +61,13 @@ export const useProxifiedUnistyles = (forcedTheme?: UnistylesTheme) => {
|
|
55
61
|
return () => disposeRef.current?.()
|
56
62
|
}, [dependencies.size])
|
57
63
|
|
64
|
+
|
65
|
+
const maybeNewScopedTheme = UnistylesShadowRegistry.getScopedTheme() as UnistylesTheme
|
66
|
+
|
67
|
+
if (scopedTheme && maybeNewScopedTheme && scopedTheme !== maybeNewScopedTheme) {
|
68
|
+
setScopedTheme(maybeNewScopedTheme)
|
69
|
+
}
|
70
|
+
|
58
71
|
const proxifiedTheme = new Proxy(theme, {
|
59
72
|
get: (target, prop) => {
|
60
73
|
dependencies.add(UnistyleDependency.Theme)
|
@@ -84,6 +97,10 @@ export const useProxifiedUnistyles = (forcedTheme?: UnistylesTheme) => {
|
|
84
97
|
dependencies.add(RTDependencyMap[prop as keyof typeof RTDependencyMap])
|
85
98
|
}
|
86
99
|
|
100
|
+
if (prop === 'themeName' && scopedTheme) {
|
101
|
+
return scopedTheme
|
102
|
+
}
|
103
|
+
|
87
104
|
return target[prop as keyof typeof target]
|
88
105
|
}
|
89
106
|
})
|
@@ -4,4 +4,4 @@ import type { UnistylesTheme } from '../../types';
|
|
4
4
|
export const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'] as const
|
5
5
|
|
6
6
|
export type SupportedStyleProps = typeof SUPPORTED_STYLE_PROPS[number]
|
7
|
-
export type Mappings<T = {}> = (theme: UnistylesTheme, rt: UnistylesMiniRuntime) => Omit<Partial<T>, SupportedStyleProps>
|
7
|
+
export type Mappings<T = {}> = (theme: UnistylesTheme, rt: UnistylesMiniRuntime) => Omit<Partial<T>, SupportedStyleProps> & { key?: string }
|
@@ -75,8 +75,8 @@ export const withUnistyles = <TComponent, TMappings extends GenericComponentProp
|
|
75
75
|
addDependencies(Array.from(new Set([...styleSecrets.dependencies, ...contentContainerStyleSecrets.dependencies])))
|
76
76
|
}, [narrowedProps.style, narrowedProps.contentContainerStyle])
|
77
77
|
|
78
|
-
const mappingsProps = mappings ? mappings(proxifiedTheme, proxifiedRuntime) : {}
|
79
|
-
const unistyleProps = narrowedProps.uniProps ? narrowedProps.uniProps(proxifiedTheme, proxifiedRuntime) : {}
|
78
|
+
const { key: mappingsKey, ...mappingsProps } = mappings ? mappings(proxifiedTheme, proxifiedRuntime) : {}
|
79
|
+
const { key: uniPropsKey, ...unistyleProps } = narrowedProps.uniProps ? narrowedProps.uniProps(proxifiedTheme, proxifiedRuntime) : {}
|
80
80
|
|
81
81
|
const styleSecrets = getSecrets(narrowedProps.style)
|
82
82
|
const contentContainerStyleSecrets = getSecrets(narrowedProps.contentContainerStyle)
|
@@ -91,6 +91,12 @@ export const withUnistyles = <TComponent, TMappings extends GenericComponentProp
|
|
91
91
|
} : {},
|
92
92
|
} as any
|
93
93
|
|
94
|
-
return
|
94
|
+
return (
|
95
|
+
<NativeComponent
|
96
|
+
key={uniPropsKey || mappingsKey}
|
97
|
+
{...finalProps as TProps}
|
98
|
+
ref={ref}
|
99
|
+
/>
|
100
|
+
)
|
95
101
|
})
|
96
102
|
}
|
@@ -27,16 +27,15 @@ export const withUnistyles = <TComponent, TMappings extends GenericComponentProp
|
|
27
27
|
const contentContainerStyleClassNames = getClassName(narrowedProps.contentContainerStyle)
|
28
28
|
const { proxifiedRuntime, proxifiedTheme } = useProxifiedUnistyles()
|
29
29
|
|
30
|
-
const mappingsProps = mappings ? mappings(proxifiedTheme, proxifiedRuntime) : {}
|
31
|
-
const unistyleProps = narrowedProps.uniProps ? narrowedProps.uniProps(proxifiedTheme, proxifiedRuntime) : {}
|
32
|
-
|
30
|
+
const { key: mappingsKey, ...mappingsProps } = mappings ? mappings(proxifiedTheme, proxifiedRuntime) : {}
|
31
|
+
const { key: uniPropsKey, ...unistyleProps } = narrowedProps.uniProps ? narrowedProps.uniProps(proxifiedTheme, proxifiedRuntime) : {}
|
33
32
|
|
34
33
|
const emptyStyles = narrowedProps.style
|
35
34
|
? Object.fromEntries(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
Object.entries(Object.getOwnPropertyDescriptors(narrowedProps.style))
|
36
|
+
.filter(([key]) => !key.startsWith("unistyles") && !key.startsWith("_"))
|
37
|
+
.map(([key]) => [key, undefined])
|
38
|
+
)
|
40
39
|
: undefined
|
41
40
|
|
42
41
|
const combinedProps = {
|
@@ -63,7 +62,11 @@ export const withUnistyles = <TComponent, TMappings extends GenericComponentProp
|
|
63
62
|
className={classNames?.hash}
|
64
63
|
style={{ display: 'contents' }}
|
65
64
|
>
|
66
|
-
<NativeComponent
|
65
|
+
<NativeComponent
|
66
|
+
key={uniPropsKey || mappingsKey}
|
67
|
+
{...combinedProps}
|
68
|
+
ref={ref}
|
69
|
+
/>
|
67
70
|
</div>
|
68
71
|
)
|
69
72
|
})
|
package/src/mocks.ts
CHANGED
@@ -217,4 +217,27 @@ jest.mock('react-native-unistyles', () => {
|
|
217
217
|
}
|
218
218
|
})
|
219
219
|
|
220
|
+
jest.mock('react-native-unistyles/reanimated', () => {
|
221
|
+
const unistyles = require('react-native-unistyles')
|
222
|
+
const mockedSharedValue = (value: any) => ({
|
223
|
+
value
|
224
|
+
})
|
220
225
|
|
226
|
+
return {
|
227
|
+
useAnimatedTheme: () => {
|
228
|
+
const theme = unistyles.useUnistyles().theme
|
229
|
+
const sharedTheme = mockedSharedValue(theme)
|
230
|
+
|
231
|
+
return sharedTheme
|
232
|
+
},
|
233
|
+
useAnimatedVariantColor: () => {
|
234
|
+
const fromValue = mockedSharedValue('#000000')
|
235
|
+
const toValue = mockedSharedValue('#FFFFFF')
|
236
|
+
|
237
|
+
return {
|
238
|
+
fromValue,
|
239
|
+
toValue
|
240
|
+
}
|
241
|
+
},
|
242
|
+
}
|
243
|
+
})
|
@@ -44,7 +44,6 @@ const HybridUnistylesRuntime = NitroModules
|
|
44
44
|
|
45
45
|
HybridUnistylesRuntime.statusBar = HybridUnistylesRuntime.createHybridStatusBar()
|
46
46
|
HybridUnistylesRuntime.navigationBar = HybridUnistylesRuntime.createHybridNavigationBar()
|
47
|
-
HybridUnistylesRuntime._setRootViewBackgroundColor = HybridUnistylesRuntime.setRootViewBackgroundColor
|
48
47
|
|
49
48
|
HybridUnistylesRuntime.setRootViewBackgroundColor = (color?: string) => {
|
50
49
|
const parsedColor = processColor(color) ?? 0
|
@@ -25,7 +25,7 @@ export const getBoxShadow = (boxShadow: Array<BoxShadowValue>) => {
|
|
25
25
|
const boxShadowStyle = Object.fromEntries(boxShadow.map(shadow => {
|
26
26
|
const [key] = Object.keys(shadow)
|
27
27
|
return [key, shadow[key as keyof BoxShadowValue]]
|
28
|
-
}))
|
28
|
+
})) as BoxShadowValue
|
29
29
|
|
30
30
|
return {
|
31
31
|
boxShadow: createBoxShadowValue(boxShadowStyle)
|
@@ -42,7 +42,7 @@ export const getBoxShadow = (boxShadow: Array<BoxShadowValue>) => {
|
|
42
42
|
}
|
43
43
|
|
44
44
|
return [key, value]
|
45
|
-
}))
|
45
|
+
})) as BoxShadowValue
|
46
46
|
|
47
47
|
return {
|
48
48
|
[breakpoint]: {
|
@@ -1,26 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
'_-moz-handler-blocked',
|
6
|
-
'_-moz-handler-crashed',
|
7
|
-
'_-moz-handler-disabled',
|
8
|
-
'_-moz-last-node',
|
9
|
-
'_-moz-loading',
|
10
|
-
'_-moz-locale-dir(ltr)',
|
11
|
-
'_-moz-locale-dir(rtl)',
|
12
|
-
'_-moz-only-whitespace',
|
13
|
-
'_-moz-submit-invalid',
|
14
|
-
'_-moz-suppressed',
|
15
|
-
'_-moz-user-disabled',
|
16
|
-
'_-moz-window-inactive',
|
1
|
+
// All non experimental pseudo clasess and elements
|
2
|
+
|
3
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes
|
4
|
+
const pseudoClasses = [
|
17
5
|
'_active',
|
18
6
|
'_any-link',
|
19
7
|
'_autofill',
|
20
|
-
'_blank',
|
21
8
|
'_buffering',
|
22
9
|
'_checked',
|
23
|
-
'_current',
|
24
10
|
'_default',
|
25
11
|
'_defined',
|
26
12
|
'_dir(',
|
@@ -33,8 +19,8 @@ export const pseudos = [
|
|
33
19
|
'_focus',
|
34
20
|
'_focus-visible',
|
35
21
|
'_focus-within',
|
36
|
-
'_fullscreen',
|
37
22
|
'_future',
|
23
|
+
'_has-slotted',
|
38
24
|
'_has(',
|
39
25
|
'_host',
|
40
26
|
'_host-context(',
|
@@ -49,7 +35,6 @@ export const pseudos = [
|
|
49
35
|
'_last-of-type',
|
50
36
|
'_left',
|
51
37
|
'_link',
|
52
|
-
'_local-link',
|
53
38
|
'_modal',
|
54
39
|
'_muted',
|
55
40
|
'_not(',
|
@@ -59,6 +44,7 @@ export const pseudos = [
|
|
59
44
|
'_nth-of-type(',
|
60
45
|
'_only-child',
|
61
46
|
'_only-of-type',
|
47
|
+
'_open',
|
62
48
|
'_optional',
|
63
49
|
'_out-of-range',
|
64
50
|
'_past',
|
@@ -71,45 +57,27 @@ export const pseudos = [
|
|
71
57
|
'_read-write',
|
72
58
|
'_required',
|
73
59
|
'_right',
|
60
|
+
'_root',
|
74
61
|
'_scope',
|
75
62
|
'_seeking',
|
76
63
|
'_stalled',
|
77
64
|
'_state(',
|
78
65
|
'_target',
|
79
|
-
'_target-within',
|
80
66
|
'_user-invalid',
|
81
67
|
'_user-valid',
|
82
68
|
'_valid',
|
83
69
|
'_visited',
|
84
70
|
'_volume-locked',
|
85
|
-
'_where
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
'_-moz-meter-bar',
|
91
|
-
'_-moz-progress-bar',
|
92
|
-
'_-moz-range-progress',
|
93
|
-
'_-moz-range-thumb',
|
94
|
-
'_-moz-range-track',
|
95
|
-
'_-webkit-inner-spin-button',
|
96
|
-
'_-webkit-meter-barDeprecated',
|
97
|
-
'_-webkit-meter-even-less-good-value',
|
98
|
-
'_-webkit-meter-inner-element',
|
99
|
-
'_-webkit-meter-optimum-value',
|
100
|
-
'_-webkit-meter-suboptimum-value',
|
101
|
-
'_-webkit-progress-bar',
|
102
|
-
'_-webkit-progress-inner-element',
|
103
|
-
'_-webkit-progress-value',
|
104
|
-
'_-webkit-scrollbar',
|
105
|
-
'_-webkit-search-cancel-button',
|
106
|
-
'_-webkit-search-results-button',
|
107
|
-
'_-webkit-slider-runnable-track',
|
108
|
-
'_-webkit-slider-thumb',
|
71
|
+
'_where',
|
72
|
+
] as const
|
73
|
+
|
74
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
|
75
|
+
const pseudoElements = [
|
109
76
|
'_after',
|
110
77
|
'_backdrop',
|
111
78
|
'_before',
|
112
79
|
'_cue',
|
80
|
+
'_details-content',
|
113
81
|
'_file-selector-button',
|
114
82
|
'_first-letter',
|
115
83
|
'_first-line',
|
@@ -123,15 +91,18 @@ export const pseudos = [
|
|
123
91
|
'_spelling-error',
|
124
92
|
'_target-text',
|
125
93
|
'_view-transition',
|
126
|
-
'_view-transition-group',
|
127
|
-
'_view-transition-image-pair',
|
128
|
-
'_view-transition-new',
|
129
|
-
'_view-transition-old',
|
94
|
+
'_view-transition-group(',
|
95
|
+
'_view-transition-image-pair(',
|
96
|
+
'_view-transition-new(',
|
97
|
+
'_view-transition-old(',
|
130
98
|
] as const
|
131
99
|
|
132
|
-
export const isPseudo = (selector: string) => pseudos.some(pseudo => selector.startsWith(pseudo))
|
133
|
-
|
134
100
|
type AddDynamicSelector<T extends string> = T extends `${infer U}(` ? `${U}(${string})` : T
|
135
101
|
|
136
|
-
export type Pseudo = AddDynamicSelector<typeof
|
102
|
+
export type Pseudo = AddDynamicSelector<(typeof pseudoClasses)[number] | (typeof pseudoElements)[number]>
|
103
|
+
|
104
|
+
export const isPseudoClass = (selector: string) => pseudoClasses.some(pseudo => selector.startsWith(pseudo))
|
105
|
+
|
106
|
+
export const isPseudoElement = (selector: string) => pseudoElements.some(pseudo => selector.startsWith(pseudo))
|
137
107
|
|
108
|
+
export const isPseudo = (selector: string) => isPseudoClass(selector) || isPseudoElement(selector)
|
package/src/web/convert/utils.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
// based on react-native-web normalizer
|
2
2
|
// https://github.com/necolas/react-native-web
|
3
|
+
/// <reference path="module.d.ts" />
|
3
4
|
import normalizeColors from '@react-native/normalize-colors'
|
4
5
|
import type { BoxShadowValue } from 'react-native'
|
5
6
|
import type { TransformStyles } from '../../types/core'
|
@@ -30,7 +31,7 @@ export const normalizeColor = (color: string, opacity = 1) => {
|
|
30
31
|
return color
|
31
32
|
}
|
32
33
|
|
33
|
-
const hex = integer.toString(16).padStart(8, '0')
|
34
|
+
const hex = integer.toString(16).padStart(8, '0') as string
|
34
35
|
|
35
36
|
if (hex.length === 8) {
|
36
37
|
const [r = 0, g = 0, b = 0, a = 1] = hex
|
package/src/web/css/core.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
import { isPseudoClass } from '../convert/pseudo'
|
1
2
|
import { getMediaQuery } from '../utils'
|
2
3
|
import type { CSSState } from './state'
|
3
4
|
|
4
5
|
export const convertToCSS = (hash: string, value: Record<string, any>, state: CSSState) => {
|
5
6
|
Object.entries(value).forEach(([styleKey, styleValue]) => {
|
6
7
|
if (styleKey[0] === '_') {
|
7
|
-
const
|
8
|
+
const isStylePseudoClass = isPseudoClass(styleKey)
|
9
|
+
const pseudoClassName = `${hash}${isStylePseudoClass ? ':' : '::'}${styleKey.slice(1)}`
|
8
10
|
|
9
11
|
Object.entries(styleValue).forEach(([pseudoStyleKey, pseudoStyleValue]) => {
|
10
12
|
if (typeof pseudoStyleValue === 'object' && pseudoStyleValue !== null) {
|
package/src/web/listener.ts
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
import { UnistyleDependency } from '../specs/NativePlatform'
|
2
2
|
import type { UnistylesServices } from './types'
|
3
3
|
|
4
|
+
type Listener = (dependency: UnistyleDependency) => void
|
5
|
+
|
4
6
|
export class UnistylesListener {
|
5
7
|
private isInitialized = false
|
6
|
-
private listeners = Array.from({ length: Object.keys(UnistyleDependency).length / 2 }, () => new Set<
|
7
|
-
private stylesheetListeners = Array.from({ length: Object.keys(UnistyleDependency).length / 2 }, () => new Set<
|
8
|
+
private listeners = Array.from({ length: Object.keys(UnistyleDependency).length / 2 }, () => new Set<Listener>())
|
9
|
+
private stylesheetListeners = Array.from({ length: Object.keys(UnistyleDependency).length / 2 }, () => new Set<Listener>())
|
8
10
|
|
9
11
|
constructor(private services: UnistylesServices) {}
|
10
12
|
|
11
13
|
emitChange = (dependency: UnistyleDependency) => {
|
12
|
-
this.stylesheetListeners[dependency]?.forEach(listener => listener())
|
13
|
-
this.listeners[dependency]?.forEach(listener => listener())
|
14
|
+
this.stylesheetListeners[dependency]?.forEach(listener => listener(dependency))
|
15
|
+
this.listeners[dependency]?.forEach(listener => listener(dependency))
|
14
16
|
}
|
15
17
|
|
16
18
|
initListeners = () => {
|
@@ -49,7 +51,7 @@ export class UnistylesListener {
|
|
49
51
|
window.addEventListener('resize', () => this.emitChange(UnistyleDependency.Dimensions))
|
50
52
|
}
|
51
53
|
|
52
|
-
addListeners = (dependencies: Array<UnistyleDependency>, listener:
|
54
|
+
addListeners = (dependencies: Array<UnistyleDependency>, listener: Listener) => {
|
53
55
|
dependencies.forEach(dependency => this.listeners[dependency]?.add(listener))
|
54
56
|
|
55
57
|
return () => {
|
@@ -57,7 +59,7 @@ export class UnistylesListener {
|
|
57
59
|
}
|
58
60
|
}
|
59
61
|
|
60
|
-
addStylesheetListeners = (dependencies: Array<UnistyleDependency>, listener:
|
62
|
+
addStylesheetListeners = (dependencies: Array<UnistyleDependency>, listener: Listener) => {
|
61
63
|
dependencies.forEach(dependency => this.stylesheetListeners[dependency]?.add(listener))
|
62
64
|
|
63
65
|
return () => {
|