react-native-unistyles 3.0.0-alpha.41 → 3.0.0-alpha.42
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -1
- package/cxx/common/Constants.h +0 -1
- package/cxx/core/UnistylesRegistry.cpp +10 -4
- package/cxx/core/UnistylesRegistry.h +1 -1
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +2 -2
- package/cxx/parser/Parser.cpp +7 -22
- package/cxx/parser/Parser.h +0 -1
- package/lib/commonjs/components/Display.js +2 -2
- package/lib/commonjs/components/Display.js.map +1 -1
- package/lib/commonjs/components/Hide.js +2 -2
- package/lib/commonjs/components/Hide.js.map +1 -1
- package/lib/commonjs/components/Pressable.js +64 -0
- package/lib/commonjs/components/Pressable.js.map +1 -0
- package/lib/commonjs/components/Pressable.web.js +97 -0
- package/lib/commonjs/components/Pressable.web.js.map +1 -0
- package/lib/commonjs/components/index.js +7 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/core/getBoundArgs.js +18 -0
- package/lib/commonjs/core/getBoundArgs.js.map +1 -0
- package/lib/commonjs/core/getId.js +9 -0
- package/lib/commonjs/core/getId.js.map +1 -0
- package/lib/commonjs/core/index.js +14 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/hooks/index.js +13 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useMedia.js.map +1 -0
- package/lib/commonjs/hooks/useMedia.web.js.map +1 -0
- package/lib/commonjs/index.js +8 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mq.js +6 -6
- package/lib/commonjs/mq.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +3 -4
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -2
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
- package/lib/commonjs/specs/index.web.js +0 -7
- package/lib/commonjs/specs/index.web.js.map +1 -1
- package/lib/commonjs/utils.js +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/convert/types.js.map +1 -1
- package/lib/commonjs/web/convert/utils.js +1 -1
- package/lib/commonjs/web/convert/utils.js.map +1 -1
- package/lib/commonjs/web/create.js +4 -1
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/index.js +7 -5
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web/listener.js.map +1 -1
- package/lib/commonjs/web/runtime.js +7 -7
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/state.js +23 -16
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/utils/common.js +3 -3
- package/lib/commonjs/web/utils/common.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js +2 -4
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/commonjs/web/variants/getVariants.js +1 -1
- package/lib/commonjs/web/variants/getVariants.js.map +1 -1
- package/lib/commonjs/web/variants/useVariants.js +1 -1
- package/lib/module/components/Display.js +1 -1
- package/lib/module/components/Display.js.map +1 -1
- package/lib/module/components/Hide.js +1 -1
- package/lib/module/components/Hide.js.map +1 -1
- package/lib/module/components/Pressable.js +58 -0
- package/lib/module/components/Pressable.js.map +1 -0
- package/lib/module/components/Pressable.web.js +91 -0
- package/lib/module/components/Pressable.web.js.map +1 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/core/getBoundArgs.js +13 -0
- package/lib/module/core/getBoundArgs.js.map +1 -0
- package/lib/module/core/getId.js +4 -0
- package/lib/module/core/getId.js.map +1 -0
- package/lib/module/core/index.js +2 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/hooks/index.js +4 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useMedia.js.map +1 -0
- package/lib/module/hooks/useMedia.web.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mq.js +6 -6
- package/lib/module/mq.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +3 -4
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/index.js.map +1 -1
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -2
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
- package/lib/module/specs/index.web.js +0 -1
- package/lib/module/specs/index.web.js.map +1 -1
- package/lib/module/utils.js +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/convert/types.js.map +1 -1
- package/lib/module/web/convert/utils.js +1 -1
- package/lib/module/web/convert/utils.js.map +1 -1
- package/lib/module/web/create.js +5 -2
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/index.js +7 -3
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/listener.js.map +1 -1
- package/lib/module/web/runtime.js +8 -8
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/state.js +24 -17
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/utils/common.js +1 -1
- package/lib/module/web/utils/common.js.map +1 -1
- package/lib/module/web/utils/unistyle.js +1 -2
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/module/web/variants/getVariants.js +1 -1
- package/lib/module/web/variants/getVariants.js.map +1 -1
- package/lib/module/web/variants/useVariants.js +1 -1
- package/lib/typescript/src/components/Pressable.d.ts +7 -0
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/Pressable.web.d.ts +13 -0
- package/lib/typescript/src/components/Pressable.web.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/core/getBoundArgs.d.ts +2 -0
- package/lib/typescript/src/core/getBoundArgs.d.ts.map +1 -0
- package/lib/typescript/src/core/getId.d.ts +2 -0
- package/lib/typescript/src/core/getId.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +2 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +2 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useMedia.web.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +2 -2
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +1 -0
- package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +1 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts +3 -2
- package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.web.d.ts +0 -2
- package/lib/typescript/src/specs/index.web.d.ts.map +1 -1
- package/lib/typescript/src/types/common.d.ts +1 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +1 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/types.d.ts +1 -1
- package/lib/typescript/src/web/convert/types.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts +1 -1
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts +8 -2
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/listener.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/common.d.ts +1 -1
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +0 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/package.json +12 -16
- package/plugin/common.js +1 -4
- package/plugin/import.js +29 -3
- package/plugin/index.js +18 -8
- package/plugin/ref.js +14 -74
- package/plugin/style.js +117 -63
- package/src/components/Display.tsx +1 -1
- package/src/components/Hide.tsx +1 -1
- package/src/components/Pressable.tsx +72 -0
- package/src/components/Pressable.web.tsx +103 -0
- package/src/components/index.ts +1 -0
- package/src/core/getBoundArgs.ts +15 -0
- package/src/core/getId.ts +1 -0
- package/src/core/index.ts +2 -0
- package/src/hooks/index.ts +1 -0
- package/src/index.ts +1 -1
- package/src/mq.ts +6 -6
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +1 -1
- package/src/specs/ShadowRegistry/index.ts +5 -6
- package/src/specs/ShadowRegistry/types.ts +2 -1
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +1 -1
- package/src/specs/StyleSheet/index.ts +3 -2
- package/src/specs/TurboUnistyles/NativeTurboUnistyles.ts +1 -2
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +1 -1
- package/src/specs/UnistylesRuntime/index.ts +1 -1
- package/src/specs/index.web.ts +0 -4
- package/src/types/common.ts +1 -0
- package/src/types/index.ts +1 -1
- package/src/utils.ts +1 -1
- package/src/web/convert/types.ts +1 -1
- package/src/web/convert/utils.ts +2 -2
- package/src/web/create.ts +6 -2
- package/src/web/index.ts +7 -3
- package/src/web/listener.ts +2 -0
- package/src/web/registry.ts +1 -1
- package/src/web/runtime.ts +9 -9
- package/src/web/shadowRegistry.ts +2 -2
- package/src/web/state.ts +36 -17
- package/src/web/utils/common.ts +1 -1
- package/src/web/utils/unistyle.ts +3 -9
- package/src/web/variants/getVariants.ts +1 -1
- package/src/web/variants/useVariants.ts +1 -1
- package/lib/commonjs/components/useMedia.js.map +0 -1
- package/lib/commonjs/components/useMedia.web.js.map +0 -1
- package/lib/module/components/useMedia.js.map +0 -1
- package/lib/module/components/useMedia.web.js.map +0 -1
- package/lib/typescript/src/components/useMedia.d.ts.map +0 -1
- package/lib/typescript/src/components/useMedia.web.d.ts.map +0 -1
- /package/lib/commonjs/{components → hooks}/useMedia.js +0 -0
- /package/lib/commonjs/{components → hooks}/useMedia.web.js +0 -0
- /package/lib/module/{components → hooks}/useMedia.js +0 -0
- /package/lib/module/{components → hooks}/useMedia.web.js +0 -0
- /package/lib/typescript/src/{components → hooks}/useMedia.d.ts +0 -0
- /package/lib/typescript/src/{components → hooks}/useMedia.web.d.ts +0 -0
- /package/src/{components → hooks}/useMedia.ts +0 -0
- /package/src/{components → hooks}/useMedia.web.ts +0 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React, { forwardRef, useRef } from 'react';
|
4
|
+
import { Pressable as NativePressableReactNative } from 'react-native';
|
5
|
+
import { UnistylesShadowRegistry } from '../specs';
|
6
|
+
import { getId } from '../core';
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
export const Pressable = /*#__PURE__*/forwardRef(({
|
9
|
+
variants,
|
10
|
+
style,
|
11
|
+
rawStyle,
|
12
|
+
...props
|
13
|
+
}, passedRef) => {
|
14
|
+
const storedRef = useRef();
|
15
|
+
return /*#__PURE__*/_jsx(NativePressableReactNative, {
|
16
|
+
...props,
|
17
|
+
ref: ref => {
|
18
|
+
storedRef.current = ref;
|
19
|
+
const styleResult = typeof style === 'function' ? style({
|
20
|
+
pressed: false
|
21
|
+
}) : style;
|
22
|
+
const fnArgs = typeof styleResult === 'function'
|
23
|
+
// @ts-expect-error - this is hidden from TS
|
24
|
+
? styleResult.getBoundArgs() : [];
|
25
|
+
if (typeof passedRef === 'object' && passedRef !== null) {
|
26
|
+
passedRef.current = ref;
|
27
|
+
}
|
28
|
+
const returnFn = typeof passedRef === 'function' ? passedRef(ref) : () => {};
|
29
|
+
|
30
|
+
// @ts-expect-error - this is hidden from TS
|
31
|
+
UnistylesShadowRegistry.add(ref, rawStyle ?? [], variants, [fnArgs]);
|
32
|
+
return () => {
|
33
|
+
// @ts-expect-error - this is hidden from TS
|
34
|
+
UnistylesShadowRegistry.remove(ref);
|
35
|
+
if (typeof returnFn === 'function') {
|
36
|
+
returnFn();
|
37
|
+
}
|
38
|
+
};
|
39
|
+
},
|
40
|
+
style: state => {
|
41
|
+
const styleResult = typeof style === 'function' ? style(state) : style;
|
42
|
+
const fnArgs = typeof styleResult === 'function'
|
43
|
+
// @ts-expect-error - this is hidden from TS
|
44
|
+
? styleResult.getBoundArgs() : [];
|
45
|
+
const pressId = getId();
|
46
|
+
if (storedRef.current) {
|
47
|
+
// @ts-expect-error - this is hidden from TS
|
48
|
+
UnistylesShadowRegistry.remove(storedRef.current);
|
49
|
+
// @ts-expect-error - this is hidden from TS
|
50
|
+
UnistylesShadowRegistry.add(storedRef.current, rawStyle ?? [], variants, [fnArgs], pressId);
|
51
|
+
}
|
52
|
+
return typeof styleResult === 'function'
|
53
|
+
// @ts-expect-error - this is hidden from TS
|
54
|
+
? styleResult(pressId) : styleResult;
|
55
|
+
}
|
56
|
+
});
|
57
|
+
});
|
58
|
+
//# sourceMappingURL=Pressable.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","getId","jsx","_jsx","variants","style","rawStyle","props","passedRef","storedRef","ref","current","styleResult","pressed","fnArgs","getBoundArgs","returnF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M,QAAQ,KAAK,UAAU,EAAE;UAChCA,QAAQ,CAAC,CAAC;QACd;MACJ,CAAC;IACL,CAAE;IACFX,KAAK,EAAEc,KAAK,IAAI;MACZ,MAAMP,WAAW,GAAG,OAAOP,KAAK,KAAK,UAAU,GACzCA,KAAK,CAACc,KAAK,CAAC,GACZd,KAAK;MACX,MAAMS,MAAM,GAAG,OAAOF,WAAW,KAAK;MAClC;MAAA,EACEA,WAAW,CAACG,YAAY,CAAC,CAAC,GAC1B,EAAE;MACR,MAAMK,OAAO,GAAGnB,KAAK,CAAC,CAAC;MAEvB,IAAIQ,SAAS,CAACE,OAAO,EAAE;QACnB;QACAX,uBAAuB,CAACkB,MAAM,CAACT,SAAS,CAACE,OAAO,CAAC;QACjD;QACAX,uBAAuB,CAACiB,GAAG,CAACR,SAAS,CAACE,OAAO,EAAEL,QAAQ,IAAI,EAAE,EAAEF,QAAQ,EAAE,CAACU,MAAM,CAAC,EAAEM,OAAO,CAAC;MAC/F;MAEA,OAAO,OAAOR,WAAW,KAAK;MAC1B;MAAA,EACEA,WAAW,CAACQ,OAAO,CAAC,GACpBR,WAAW;IACrB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import React, { forwardRef, useEffect, useRef } from 'react';
|
4
|
+
import { Pressable as NativePressableReactNative } from 'react-native';
|
5
|
+
import { UnistylesShadowRegistry } from '../specs';
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
const initialState = {
|
8
|
+
pressed: false,
|
9
|
+
hovered: false,
|
10
|
+
focused: false
|
11
|
+
};
|
12
|
+
const events = {
|
13
|
+
'pointerdown': {
|
14
|
+
pressed: true
|
15
|
+
},
|
16
|
+
'pointerup': {
|
17
|
+
pressed: false
|
18
|
+
},
|
19
|
+
'pointerenter': {
|
20
|
+
hovered: true
|
21
|
+
},
|
22
|
+
'pointerleave': {
|
23
|
+
hovered: false
|
24
|
+
},
|
25
|
+
'focus': {
|
26
|
+
focused: true
|
27
|
+
},
|
28
|
+
'blur': {
|
29
|
+
focused: false
|
30
|
+
}
|
31
|
+
};
|
32
|
+
export const Pressable = /*#__PURE__*/forwardRef(({
|
33
|
+
variants,
|
34
|
+
style,
|
35
|
+
...props
|
36
|
+
}, passedRef) => {
|
37
|
+
const storedRef = useRef();
|
38
|
+
const state = useRef(initialState);
|
39
|
+
const styleRef = useRef(style);
|
40
|
+
useEffect(() => {
|
41
|
+
styleRef.current = style;
|
42
|
+
}, [style]);
|
43
|
+
useEffect(() => {
|
44
|
+
const handler = newState => () => {
|
45
|
+
state.current = {
|
46
|
+
...state.current,
|
47
|
+
...newState
|
48
|
+
};
|
49
|
+
const styleResult = typeof styleRef.current === 'function' ? styleRef.current(state.current) : styleRef.current;
|
50
|
+
const fnArgs = typeof styleResult === 'function'
|
51
|
+
// @ts-expect-error - this is hidden from TS
|
52
|
+
? styleResult.getBoundArgs() : [];
|
53
|
+
const extractedResult = typeof styleResult === 'function' ? styleResult() : styleResult;
|
54
|
+
|
55
|
+
// @ts-expect-error - this is hidden from TS
|
56
|
+
UnistylesShadowRegistry.add(storedRef.current, [extractedResult], variants, [fnArgs]);
|
57
|
+
};
|
58
|
+
if (!storedRef.current) {
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
|
62
|
+
// ref on the web is dom element
|
63
|
+
const ref = storedRef.current;
|
64
|
+
Object.entries(events).forEach(([event, state]) => {
|
65
|
+
ref.addEventListener(event, handler(state));
|
66
|
+
});
|
67
|
+
return () => {
|
68
|
+
Object.entries(events).forEach(([event, state]) => {
|
69
|
+
ref.removeEventListener(event, handler(state));
|
70
|
+
});
|
71
|
+
};
|
72
|
+
}, []);
|
73
|
+
return /*#__PURE__*/_jsx(NativePressableReactNative, {
|
74
|
+
...props,
|
75
|
+
ref: ref => {
|
76
|
+
storedRef.current = ref;
|
77
|
+
const styleResult = typeof style === 'function' ? style(initialState) : style;
|
78
|
+
const fnArgs = typeof styleResult === 'function'
|
79
|
+
// @ts-expect-error - this is hidden from TS
|
80
|
+
? styleResult.getBoundArgs() : [];
|
81
|
+
const extractedResult = typeof styleResult === 'function' ? styleResult() : styleResult;
|
82
|
+
if (typeof passedRef === 'object' && passedRef !== null) {
|
83
|
+
passedRef.current = ref;
|
84
|
+
}
|
85
|
+
|
86
|
+
// @ts-expect-error - this is hidden from TS
|
87
|
+
UnistylesShadowRegistry.add(ref, [extractedResult], variants, [fnArgs]);
|
88
|
+
}
|
89
|
+
});
|
90
|
+
});
|
91
|
+
//# sourceMappingURL=Pressable.web.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useEffect","useRef","Pressable","NativePressableReactNative","UnistylesShadowRegistry","jsx","_jsx","initialState","pressed","hovered","focused","events","variants","style","props","passedRef","storedRef","state","styleRef","current","handler","newState","styleResult","fnArgs","getBoundArgs","extractedResult","add","ref","Object","entries","forEach","event","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["components/Pressable.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC5D,SAASC,SAAS,IAAIC,0BAA0B,QAAQ,cAAc;AAEtE,SAASC,uBAAuB,QAAQ,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAalD,MAAMC,YAA+B,GAAG;EACpCC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE;AACb,CAAC;AAED,MAAMC,MAAM,GAAG;EACX,aAAa,EAAE;IAAEH,OAAO,EAAE;EAAK,CAAC;EAChC,WAAW,EAAE;IAAEA,OAAO,EAAE;EAAM,CAAC;EAC/B,cAAc,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EACjC,cAAc,EAAE;IAAEA,OAAO,EAAE;EAAM,CAAC;EAClC,OAAO,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EAC1B,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AM,CAAC,CAACmB,OAAO,CAAC,CAAC,CAACC,KAAK,EAAEd,KAAK,CAAC,KAAK;MAC/CU,GAAG,CAACK,gBAAgB,CAACD,KAAK,EAAEX,OAAO,CAACH,KAAK,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,OAAO,MAAM;MACTW,MAAM,CAACC,OAAO,CAAClB,MAAM,CAAC,CAACmB,OAAO,CAAC,CAAC,CAACC,KAAK,EAAEd,KAAK,CAAC,KAAK;QAC/CU,GAAG,CAACM,mBAAmB,CAACF,KAAK,EAAEX,OAAO,CAACH,KAAK,CAAC,CAAC;MAClD,CAAC,CAAC;IACN,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBACIX,IAAA,CAACH,0BAA0B;IAAA,GACnBW,KAAK;IACTa,GAAG,EAAEA,GAAG,IAAI;MACRX,SAAS,CAACG,OAAO,GAAGQ,GAAG;MACvB,MAAML,WAAW,GAAG,OAAOT,KAAK,KAAK,UAAU,GACzCA,KAAK,CAACN,YAAY,CAAC,GACnBM,KAAK;MACX,MAAMU,MAAM,GAAG,OAAOD,WAAW,KAAK;MAClC;MAAA,EACEA,WAAW,CAACE,YAAY,CAAC,CAAC,GAC1B,EAAE;MACR,MAAMC,eAAe,GAAG,OAAOH,WAAW,KAAK,UAAU,GAClDA,WAAW,CAAc,CAAC,GAC3BA,WAAW;MAEjB,IAAI,OAAOP,SAAS,KAAK,QAAQ,IAAIA,SAAS,KAAK,IAAI,EAAE;QACrDA,SAAS,CAACI,OAAO,GAAGQ,GAAG;MAC3B;;MAEA;MACAvB,uBAAuB,CAACsB,GAAG,CAACC,GAAG,EAAE,CAACF,eAAe,CAAC,EAAEb,QAAQ,EAAE,CAACW,MAAM,CAAC,CAAC;IAC3E;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Hide","Display"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,WAAW","ignoreList":[]}
|
1
|
+
{"version":3,"names":["Hide","Display","Pressable"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,QAAQ;AAC7B,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,SAAS,QAAQ,aAAa","ignoreList":[]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export const getBoundArgs = fn => {
|
4
|
+
const boundArgs = [];
|
5
|
+
fn.bind = (thisArg, ...args) => {
|
6
|
+
boundArgs.push(...args);
|
7
|
+
const newFn = Function.prototype.bind.apply(fn, [thisArg, ...args]);
|
8
|
+
newFn.getBoundArgs = () => boundArgs;
|
9
|
+
return newFn;
|
10
|
+
};
|
11
|
+
return fn;
|
12
|
+
};
|
13
|
+
//# sourceMappingURL=getBoundArgs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["getBoundArgs","fn","boundArgs","bind","thisArg","args","push","newFn","Function","prototype","apply"],"sourceRoot":"../../../src","sources":["core/getBoundArgs.ts"],"mappings":";;AAAA,OAAO,MAAMA,YAAY,GAAIC,EAAY,IAAK;EAC1C,MAAMC,SAAS,GAAG,EAAgB;EAElCD,EAAE,CAACE,IAAI,GAAG,CAACC,OAAO,EAAE,GAAGC,IAAI,KAAK;IAC5BH,SAAS,CAACI,IAAI,CAAC,GAAGD,IAAI,CAAC;IAEvB,MAAME,KAAK,GAAGC,QAAQ,CAACC,SAAS,CAACN,IAAI,CAACO,KAAK,CAACT,EAAE,EAAE,CAACG,OAAO,EAAE,GAAGC,IAAI,CAAC,CAAC;IAEnEE,KAAK,CAACP,YAAY,GAAG,MAAME,SAAS;IAEpC,OAAOK,KAAK;EAChB,CAAC;EAED,OAAON,EAAE;AACb,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["getId","Math","random","toString","substring"],"sourceRoot":"../../../src","sources":["core/getId.ts"],"mappings":";;AAAA,OAAO,MAAMA,KAAK,GAAGA,CAAA,KAAM,GAAGC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE","ignoreList":[]}
|
package/lib/module/core/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createUnistylesComponent"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,4BAA4B","ignoreList":[]}
|
1
|
+
{"version":3,"names":["createUnistylesComponent","getBoundArgs","getId"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,KAAK,QAAQ,SAAS","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useMedia"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,YAAY","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useEffect","useLayoutEffect","useState","StyleSheet","UnistyleDependency","UnistylesRuntime","isValidMq","parseMq","isUnistylesMq","useMedia","config","computeIsVisible","maybeMq","mq","console","error","parsedMq","width","height","screen","minWidth","undefined","maxWidth","minHeight","maxHeight","isVisible","setIsVisible","removeChangeListener","addChangeListener","dependencies","includes","Breakpoints"],"sourceRoot":"../../../src","sources":["hooks/useMedia.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,SAASC,UAAU,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAkC,UAAU;AACrG,SAASC,SAAS,EAAEC,OAAO,EAAEC,aAAa,QAAQ,OAAO;AAEzD,OAAO,MAAMC,QAAQ,GAAIC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,CAAC,MAAM;IAClB,MAAM0B,oBAAoB,GAAIxB,UAAU,CAAyByB,iBAAiB,CAACC,YAAY,IAAI;MAC/F,IAAIA,YAAY,CAACC,QAAQ,CAAC1B,kBAAkB,CAAC2B,WAAW,CAAC,EAAE;QACvDL,YAAY,CAACf,gBAAgB,CAAC,CAAC,CAAC;MACpC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM;MACTgB,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,CAACjB,MAAM,CAACG,EAAE,CAAC,CAAC;EAEf,OAAO;IACHY;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","isUnistylesMq","isValidMq","parseMq","useMedia","config","disposeRef","isVisible","setIsVisible","maybeMq","mq","console","error","parsedMq","minWidth","maxWidth","minHeight","maxHeight","mediaQuery","undefined","filter","Boolean","join","media","window","matchMedia","handler","event","matches","addEventListener","current","removeEventListener"],"sourceRoot":"../../../src","sources":["hooks/useMedia.web.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,aAAa,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAEzD,OAAO,MAAMC,QAAQ,GAAIC,MAAsB,IAAK;EAChD,MAAMC,UAAU,GAAGP,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;EACnC,MAAM,CAACQ,SAAS,EAAEC,YAAY,CAAC,GAAGR,QAAQ,CAAC,MAAM;IAC7C,MAAMS,OAAO,GAAGJ,MAAM,CAACK,EAAuB;IAE9C,IAAI,CAACT,aAAa,CAACQ,OAAO,CAAC,EAAE;MACzBE,OAAO,CAACC,KAAK,CAAC,sCAAsCH,OAAO,EAAE,CAAC;MAE9D,OAAO,KAAK;IAChB;IAEA,MAAMI,QAAQ,GAAGV,OAAO,CAACM,OAAO,CAAC;IAEjC,IAAI,CAACP,SAAS,CAACW,QAAQ,CAAC,EAAE;MACtBF,OAAO,CAACC,KAAK,CAAC,oEAAoEH,OAAO,EAAE,CAAC;MAE5F,OAAO,KAAK;IAChB;IAEA,MAAM;MAAEK,QAAQ;MAAEC,QAAQ;MAAEC,SAAS;MAAEC;IAAU,CAAC,GAAGJ,QAAQ;IAE7D,MAAMK,UAAU,GAAG,CACfJ,QAAQ,KAAKK,SAAS,GAAG,eAAeL,QAAQ,KAAK,GAAGK,SAAS,EACjEJ,QAAQ,KAAKI,SAAS,GAAG,eAAeJ,QAAQ,KAAK,GAAGI,SAAS,EACjEH,SAAS,KAAKG,SAAS,GAAG,gBAAgBH,SAAS,KAAK,GAAGG,SAAS,EACpEF,SAAS,KAAKE,SAAS,GAAG,gBAAgBF,SAAS,KAAK,GAAGE,SAAS,CACvE,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;IAE/B,MAAMC,KAAK,GAAGC,MAAM,CAACC,UAAU,CAACP,UAAU,CAAC;IAC3C,MAAMQ,OAAO,GAAIC,KAA0B,IAAKnB,YAAY,CAACmB,KAAK,CAACC,OAAO,CAAC;IAE3EL,KAAK,CAACM,gBAAgB,CAAC,QAAQ,EAAEH,OAAO,CAAC;IACzCpB,UAAU,CAACwB,OAAO,GAAG,MAAMP,KAAK,CAACQ,mBAAmB,CAAC,QAAQ,EAAEL,OAAO,CAAC;IAEvE,OAAOH,KAAK,CAACK,OAAO;EACxB,CAAC,CAAC;;EAEF;EACA9B,SAAS,CAAC,MAAM,MAAMQ,UAAU,CAACwB,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC;EAE/C,OAAO;IACHvB;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["mq","createUnistylesComponent"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,SAASA,EAAE,QAAQ,MAAM;AAEzB,SAASC,wBAAwB,QAAQ,QAAQ;
|
1
|
+
{"version":3,"names":["mq","createUnistylesComponent","getBoundArgs"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,SAASA,EAAE,QAAQ,MAAM;AAEzB,SAASC,wBAAwB,EAAEC,YAAY,QAAQ,QAAQ;AAE/D,cAAc,cAAc","ignoreList":[]}
|
package/lib/module/mq.js
CHANGED
@@ -21,17 +21,17 @@ const getMQValue = value => {
|
|
21
21
|
*/
|
22
22
|
export const mq = {
|
23
23
|
only: {
|
24
|
-
width: (wMin = 0, wMax =
|
25
|
-
height: (hMin = 0, hMax =
|
24
|
+
width: (wMin = 0, wMax = Number.POSITIVE_INFINITY) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`,
|
25
|
+
height: (hMin = 0, hMax = Number.POSITIVE_INFINITY) => `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
|
26
26
|
},
|
27
|
-
width: (wMin = 0, wMax =
|
27
|
+
width: (wMin = 0, wMax = Number.POSITIVE_INFINITY) => ({
|
28
28
|
and: {
|
29
|
-
height: (hMin = 0, hMax =
|
29
|
+
height: (hMin = 0, hMax = Number.POSITIVE_INFINITY) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
|
30
30
|
}
|
31
31
|
}),
|
32
|
-
height: (hMin = 0, hMax =
|
32
|
+
height: (hMin = 0, hMax = Number.POSITIVE_INFINITY) => ({
|
33
33
|
and: {
|
34
|
-
width: (wMin = 0, wMax =
|
34
|
+
width: (wMin = 0, wMax = Number.POSITIVE_INFINITY) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
|
35
35
|
}
|
36
36
|
})
|
37
37
|
};
|
package/lib/module/mq.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistylesRuntime","IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","getMQValue","value","breakpoints","mq","only","width","wMin","wMax","
|
1
|
+
{"version":3,"names":["UnistylesRuntime","IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","getMQValue","value","breakpoints","mq","only","width","wMin","wMax","Number","POSITIVE_INFINITY","height","hMin","hMax","and","parseMq","fromW","toW","exec","fromH","toH","minWidth","undefined","maxWidth","minHeight","maxHeight","isUnistylesMq","test","isValidMq","parsedMQ","isWidthValid","isHeightValid"],"sourceRoot":"../../src","sources":["mq.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,SAAS;AAE1C,MAAMC,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAqBpE,MAAMC,UAAU,GAAIC,KAAwB,IAAK;EAC7C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EAEA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChB,OAAO,CAAC;EACZ;EAEA,MAAMC,WAAW,GAAGN,gBAAgB,CAACM,WAAW;EAEhD,OAAOA,WAAW,CAACD,KAAK,CAAC,IAAI,CAAC;AAClC,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAME,EAAa,GAAG;EACzBC,IAAI,EAAE;IACFC,KAAK,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGC,MAAM,CAACC,iBAAiB,KAAM,MAAMT,UAAU,CAACM,IAAI,CAAC,KAAKN,UAAU,CAACO,IAAI,CAAC,GAAyB;IACvJG,MAAM,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGJ,MAAM,CAACC,iBAAiB,KAAM,MAAMT,UAAU,CAACW,IAAI,CAAC,KAAKX,UAAU,CAACY,IAAI,CAAC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AAS,EAAE,CAACb,MAAM,IAAIQ,KAAK,KAAK,UAAU,GAAGG,SAAS,GAAGb,MAAM,CAACU,KAAK,CAAC;IACtEM,SAAS,EAAE,CAACd,MAAM,IAAIS,GAAG,KAAK,UAAU,GAAGE,SAAS,GAAGb,MAAM,CAACW,GAAG;EACrE,CAAC;AACL,CAAC;AAED,OAAO,MAAMM,aAAa,GAAItB,EAAU,IAAKN,kBAAkB,CAAC6B,IAAI,CAACvB,EAAE,CAAC;AAExE,OAAO,MAAMwB,SAAS,GAAIC,QAAoC,IAAK;EAC/D,MAAMC,YAAY,GAAGD,QAAQ,CAACR,QAAQ,KAAKC,SAAS,IAAIO,QAAQ,CAACN,QAAQ,KAAKD,SAAS,IAAIO,QAAQ,CAACR,QAAQ,IAAIQ,QAAQ,CAACN,QAAQ;EACjI,MAAMQ,aAAa,GAAGF,QAAQ,CAACL,SAAS,KAAKF,SAAS,IAAIO,QAAQ,CAACJ,SAAS,KAAKH,SAAS,IAAIO,QAAQ,CAACL,SAAS,IAAIK,QAAQ,CAACJ,SAAS;EAEtI,OAAOK,YAAY,IAAIC,aAAa;AACxC,CAAC","ignoreList":[]}
|
@@ -5,12 +5,11 @@ const HybridShadowRegistry = NitroModules.createHybridObject('UnistylesShadowReg
|
|
5
5
|
const findShadowNodeForHandle = handle => {
|
6
6
|
const node = handle?.__internalInstanceHandle?.stateNode?.node ?? handle?.getScrollResponder?.()?.getNativeScrollRef?.()?.__internalInstanceHandle?.stateNode?.node ?? handle?.getNativeScrollRef?.()?.__internalInstanceHandle?.stateNode?.node;
|
7
7
|
if (!node) {
|
8
|
-
|
9
|
-
throw new Error('Could not find shadow node for one of your components');
|
8
|
+
throw new Error(`Unistyles: Could not find shadow node for one of your components of type ${handle?.__internalInstanceHandle?.elementType ?? 'unknown'}`);
|
10
9
|
}
|
11
10
|
return node;
|
12
11
|
};
|
13
|
-
HybridShadowRegistry.add = (handle, styles, variants, args,
|
12
|
+
HybridShadowRegistry.add = (handle, styles, variants, args, id) => {
|
14
13
|
// virtualized nodes can be null
|
15
14
|
if (!handle || !styles || !Array.isArray(styles)) {
|
16
15
|
return;
|
@@ -18,7 +17,7 @@ HybridShadowRegistry.add = (handle, styles, variants, args, uniquePressableId) =
|
|
18
17
|
|
19
18
|
// filter Reanimated styles and styles that are undefined
|
20
19
|
const filteredStyles = styles.filter(style => !style?.initial?.updater).filter(Boolean);
|
21
|
-
HybridShadowRegistry.link(findShadowNodeForHandle(handle), filteredStyles, variants ?? {}, args ?? [],
|
20
|
+
HybridShadowRegistry.link(findShadowNodeForHandle(handle), filteredStyles, variants ?? {}, args ?? [], id);
|
22
21
|
};
|
23
22
|
HybridShadowRegistry.remove = handle => {
|
24
23
|
if (!handle) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","styles","variants","args","
|
1
|
+
{"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","elementType","add","styles","variants","args","id","Array","isArray","filteredStyles","filter","style","initial","updater","Boolean","link","remove","unlink","UnistylesShadowRegistry"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAazD,MAAMC,oBAAoB,GAAGD,YAAY,CAACE,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP,MAAM,IAAIK,KAAK,CAAC,4EAA4EN,MAAM,EAAEE,wBAAwB,EAAEK,WAAW,IAAI,SAAS,EAAE,CAAC;EAC7J;EAEA,OAAON,IAAI;AACf,CAAC;AAEDJ,oBAAoB,CAACW,GAAG,GAAG,CAACR,MAAM,EAAES,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,EAAE,KAAK;EAC/D;EACA,IAAI,CAACZ,MAAM,IAAI,CAACS,MAAM,IAAI,CAACI,KAAK,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;IAC9C;EACJ;;EAEA;EACA,MAAMM,cAAc,GAAGN,MAAM,CACxBO,MAAM,CAACC,KAAK,IAAI,CAACA,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC,CACzCH,MAAM,CAACI,OAAO,CAAC;EAEpBvB,oBAAoB,CAACwB,IAAI,CAACtB,uBAAuB,CAACC,MAAM,CAAC,EAAEe,cAAc,EAAEL,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,EAAEC,EAAE,CAAC;AAC9G,CAAC;AAEDf,oBAAoB,CAACyB,MAAM,GAAGtB,MAAM,IAAI;EACpC,IAAI,CAACA,MAAM,EAAE;IACT;EACJ;EAEAH,oBAAoB,CAAC0B,MAAM,CAACxB,uBAAuB,CAACC,MAAM,CAAC,CAAC;AAChE,CAAC;AAQD,OAAO,MAAMwB,uBAAuB,GAAG3B,oBAA4D","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods","init"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;
|
1
|
+
{"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods","init"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AAiC3E,MAAMC,yBAAyB,GAAGJ,YAAY,CACzCK,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnED,yBAAyB,CAACE,kBAAkB,GAAGH,gBAAgB,CAACG,kBAAkB;AAClFF,yBAAyB,CAACG,YAAY,GAAGJ,gBAAgB,CAACI,YAAY;AACtEH,yBAAyB,CAACI,OAAO,GAAGL,gBAAgB,CAACK,OAAO;AAC5DJ,yBAAyB,CAACK,OAAO,GAAGN,gBAAgB,CAACM,OAAO;AAC5DL,yBAAyB,CAACM,SAAS,GAAG;EAClCT;AACJ,CAAC;AAEDG,yBAAyB,CAACO,IAAI,CAAC,CAAC;AAIhC,OAAO,MAAMT,UAAU,GAAGE,yBAAsE","ignoreList":[]}
|
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
import { TurboModuleRegistry } from 'react-native';
|
4
4
|
|
5
|
-
// this is empty spec for TurboModule that is required to hook
|
6
|
-
// Unistyles to Fabric
|
5
|
+
// this is empty spec for TurboModule that is required to hook Unistyles to Fabric
|
7
6
|
|
8
7
|
TurboModuleRegistry.get('Unistyles');
|
9
8
|
//# sourceMappingURL=NativeTurboUnistyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/TurboUnistyles/NativeTurboUnistyles.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/TurboUnistyles/NativeTurboUnistyles.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;;AAGAA,mBAAmB,CAACC,GAAG,CAAO,WAAW,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["specs/index.web.ts"],"mappings":";;AAAA,cAAc,QAAQ","ignoreList":[]}
|
package/lib/module/utils.js
CHANGED
@@ -6,7 +6,7 @@ export const deepMergeObjects = (...sources) => {
|
|
6
6
|
Object.keys(source).forEach(key => {
|
7
7
|
const sourceValue = source[key];
|
8
8
|
const targetValue = target[key];
|
9
|
-
if (Object(sourceValue)
|
9
|
+
if (Object(sourceValue) === sourceValue && Object(targetValue) === targetValue) {
|
10
10
|
// @ts-expect-error - can't assign to generic
|
11
11
|
target[key] = deepMergeObjects(targetValue, sourceValue);
|
12
12
|
return;
|
package/lib/module/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["deepMergeObjects","sources","target","forEach","source","Object","keys","key","sourceValue","targetValue"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;AAAA,OAAO,MAAMA,gBAAgB,GAAGA,CAAqC,GAAGC,OAAiB,KAAK;EAC1F,MAAMC,MAAM,GAAG,CAAC,CAAM;EAEtBD,OAAO,CAACE,OAAO,CAACC,MAAM,IAAI;IACtBC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACD,OAAO,CAACI,GAAG,IAAI;MAC/B,MAAMC,WAAW,GAAGJ,MAAM,CAACG,GAAG,CAAC;MAC/B,MAAME,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAC;MAE/B,IAAIF,MAAM,CAACG,WAAW,CAAC,
|
1
|
+
{"version":3,"names":["deepMergeObjects","sources","target","forEach","source","Object","keys","key","sourceValue","targetValue"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;AAAA,OAAO,MAAMA,gBAAgB,GAAGA,CAAqC,GAAGC,OAAiB,KAAK;EAC1F,MAAMC,MAAM,GAAG,CAAC,CAAM;EAEtBD,OAAO,CAACE,OAAO,CAACC,MAAM,IAAI;IACtBC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACD,OAAO,CAACI,GAAG,IAAI;MAC/B,MAAMC,WAAW,GAAGJ,MAAM,CAACG,GAAG,CAAC;MAC/B,MAAME,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAC;MAE/B,IAAIF,MAAM,CAACG,WAAW,CAAC,KAAKA,WAAW,IAAIH,MAAM,CAACI,WAAW,CAAC,KAAKA,WAAW,EAAE;QAC5E;QACAP,MAAM,CAACK,GAAG,CAAC,GAAGP,gBAAgB,CAACS,WAAW,EAAED,WAAW,CAAC;QAExD;MACJ;;MAEA;MACAN,MAAM,CAACK,GAAG,CAAC,GAAGC,WAAW;IAC7B,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAON,MAAM;AACjB,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["TEXT_SHADOW_STYLES","BOX_SHADOW_STYLES"],"sourceRoot":"../../../../src","sources":["web/convert/types.ts"],"mappings":";;
|
1
|
+
{"version":3,"names":["TEXT_SHADOW_STYLES","BOX_SHADOW_STYLES"],"sourceRoot":"../../../../src","sources":["web/convert/types.ts"],"mappings":";;AAMA,OAAO,MAAMA,kBAAkB,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAU;AAItG,OAAO,MAAMC,iBAAiB,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,CAAU","ignoreList":[]}
|
@@ -23,7 +23,7 @@ export const normalizeColor = (color, opacity = 1) => {
|
|
23
23
|
}
|
24
24
|
const hex = integer.toString(16).padStart(8, '0');
|
25
25
|
if (hex.length === 8) {
|
26
|
-
const [r = 0, g = 0, b = 0, a = 1] = hex.split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num));
|
26
|
+
const [r = 0, g = 0, b = 0, a = 1] = hex.split(/(?=(?:..)*$)/).map(x => Number.parseInt(x, 16)).filter(num => !Number.isNaN(num));
|
27
27
|
return `rgba(${r},${g},${b},${a / 255 * opacity})`;
|
28
28
|
}
|
29
29
|
return color;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["normalizeColors","BOX_SHADOW_STYLES","TEXT_SHADOW_STYLES","isTransform","key","value","Array","isArray","isTextShadow","includes","isShadow","isFilter","isBoxShadow","normalizeNumericValue","normalizeColor","color","opacity","integer","hex","toString","padStart","length","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","extractShadowValue","breakpoint","styles","width","height"],"sourceRoot":"../../../../src","sources":["web/convert/utils.ts"],"mappings":";;AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAC5D,SAASC,iBAAiB,EAAEC,kBAAkB,QAA0D,SAAS;AAIjH,OAAO,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAsCD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEpI,OAAO,MAAMG,YAAY,GAAIJ,GAAW,IAAKF,kBAAkB,CAACO,QAAQ,CAACL,GAAwC,CAAC;AAElH,OAAO,MAAMM,QAAQ,GAAIN,GAAW,IAAKH,iBAAiB,CAACQ,QAAQ,CAACL,GAAuC,CAAC;AAE5G,OAAO,MAAMO,QAAQ,GAAGA,CAACP,GAAW,EAAEC,KAAU,KAA8BD,GAAG,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEtH,OAAO,MAAMO,WAAW,GAAGA,CAACR,GAAW,EAAEC,KAAU,KAAqCD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEnI,OAAO,MAAMQ,qBAAqB,GAAIR,KAAsB,IAAKA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAAG,GAAGA,KAAK,IAAI,GAAGA,KAAK;AAE1H,OAAO,MAAMS,cAAc,GAAGA,CAACC,KAAa,EAAEC,OAAO,GAAG,CAAC,KAAK;EAC1D;EACA,IAAIA,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAME,OAAO,GAAGjB,eAAe,CAACe,KAAK,CAAC;;EAEtC;EACA,IAAIE,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOF,KAAK;EAChB;EAEA,MAAMG,GAAG,GAAGD,OAAO,CAACE,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEjD,IAAIF,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;IAClB,MAAM,CAACC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,CAAC,GAAGP,GAAG,CACnCQ,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,
|
1
|
+
{"version":3,"names":["normalizeColors","BOX_SHADOW_STYLES","TEXT_SHADOW_STYLES","isTransform","key","value","Array","isArray","isTextShadow","includes","isShadow","isFilter","isBoxShadow","normalizeNumericValue","normalizeColor","color","opacity","integer","hex","toString","padStart","length","r","g","b","a","split","map","x","Number","parseInt","filter","num","isNaN","extractShadowValue","breakpoint","styles","width","height"],"sourceRoot":"../../../../src","sources":["web/convert/utils.ts"],"mappings":";;AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAC5D,SAASC,iBAAiB,EAAEC,kBAAkB,QAA0D,SAAS;AAIjH,OAAO,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAsCD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEpI,OAAO,MAAMG,YAAY,GAAIJ,GAAW,IAAKF,kBAAkB,CAACO,QAAQ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D,GAAG,CAAC,CAAC;IAEtC,OAAO,QAAQV,CAAC,IAAIC,CAAC,IAAIC,CAAC,IAAKC,CAAC,GAAG,GAAG,GAAIT,OAAO,GAAG;EACxD;EAEA,OAAOD,KAAK;AAChB,CAAC;AAED,OAAO,MAAMmB,kBAAkB,GAAGA,CAA6B9B,GAAS,EAAE+B,UAAkB,EAAEC,MAAW,KAAsB;EAC3H,MAAM/B,KAAK,GAAG+B,MAAM,CAAChC,GAAG,CAAC;EAEzB,IAAIA,GAAG,KAAK,kBAAkB,IAAIA,GAAG,KAAK,cAAc,EAAE;IACtD,MAAM;MAAEiC,KAAK;MAAEC;IAAO,CAAC,GAAGjC,KAAK;IAE/B,OAAO;MACHgC,KAAK,EAAE,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACF,UAAU,CAAC,GAAGE,KAAK;MAC5DC,MAAM,EAAE,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,CAACH,UAAU,CAAC,GAAGG;IAC9D,CAAC;EACL;EAEA,OAAO,OAAOjC,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAAC8B,UAAU,CAAC,GAAG9B,KAAK;AAChE,CAAC","ignoreList":[]}
|
package/lib/module/web/create.js
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
import { assignSecrets, reduceObject, getStyles } from './utils';
|
3
|
+
import { assignSecrets, reduceObject, getStyles, error } from './utils';
|
4
4
|
import { deepMergeObjects } from '../utils';
|
5
5
|
import { UnistylesRuntime } from './runtime';
|
6
6
|
import { createUseVariants, getVariants } from './variants';
|
7
|
-
export const create = stylesheet => {
|
7
|
+
export const create = (stylesheet, id) => {
|
8
|
+
if (!id) {
|
9
|
+
throw error('Unistyles is not initialized correctly. Please add babel plugin to your babel config.');
|
10
|
+
}
|
8
11
|
const computedStylesheet = typeof stylesheet === 'function' ? stylesheet(UnistylesRuntime.theme, UnistylesRuntime.miniRuntime) : stylesheet;
|
9
12
|
const selectedVariants = new Map();
|
10
13
|
const copyVariants = () => Object.fromEntries(selectedVariants.entries());
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["assignSecrets","reduceObject","getStyles","deepMergeObjects","UnistylesRuntime","createUseVariants","getVariants","create","stylesheet","computedStylesheet","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","_key","String","dynamicStyle","result","variants","resultWithVariants","newVariants","forEach","set"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;AAEA,SAASA,aAAa,EAAEC,YAAY,EAAEC,SAAS,QAAQ,SAAS;
|
1
|
+
{"version":3,"names":["assignSecrets","reduceObject","getStyles","error","deepMergeObjects","UnistylesRuntime","createUseVariants","getVariants","create","stylesheet","id","computedStylesheet","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","_key","String","dynamicStyle","result","variants","resultWithVariants","newVariants","forEach","set"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;AAEA,SAASA,aAAa,EAAEC,YAAY,EAAEC,SAAS,EAAEC,KAAK,QAAQ,SAAS;AACvE,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,YAAY;AAE3D,OAAO,MAAMC,MAAM,GAAGA,CAACC,UAAiD,EAAEC,EAAW,KAAK;EACtF,IAAI,CAACA,EAAE,EAAE;IACL,MAAMP,KAAK,CAAC,uFAAuF,CAAC;EACxG;EAEA,MAAMQ,kBAAkB,GAAG,OAAOF,UAAU,KAAK,UAAU,GACrDA,UAAU,CAACJ,gBAAgB,CAACO,KAAK,EAAEP,gBAAgB,CAACQ,WAAW,CAAC,GAChEJ,UAAU;EAChB,MAAMK,gBAAgB,GA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ACAhB,iBAAiB,CAACwB,MAAM,EAAEO,WAAW,IAAIpB,MAAM,CAACE,OAAO,CAACkB,WAAW,CAAC,CAACC,OAAO,CAAC,CAAC,CAAChB,GAAG,EAAED,KAAK,CAAC,KAAKP,gBAAgB,CAACyB,GAAG,CAACjB,GAAG,EAAED,KAAK,CAAC,CAAC,CAAC;EAEjI,OAAOS,MAAM;AACjB,CAAC","ignoreList":[]}
|
package/lib/module/web/index.js
CHANGED
@@ -13,6 +13,13 @@ export const StyleSheet = {
|
|
13
13
|
right: 0,
|
14
14
|
bottom: 0
|
15
15
|
},
|
16
|
+
absoluteFillObject: {
|
17
|
+
position: 'absolute',
|
18
|
+
left: 0,
|
19
|
+
top: 0,
|
20
|
+
right: 0,
|
21
|
+
bottom: 0
|
22
|
+
},
|
16
23
|
compose: (a, b) => deepMergeObjects(a, b),
|
17
24
|
flatten: (...styles) => deepMergeObjects(...styles),
|
18
25
|
hairlineWidth: 1
|
@@ -20,7 +27,4 @@ export const StyleSheet = {
|
|
20
27
|
export { UnistylesRuntime } from './runtime';
|
21
28
|
export { UnistylesShadowRegistry } from './shadowRegistry';
|
22
29
|
export * from './mock';
|
23
|
-
|
24
|
-
// TODO: Work on SSR
|
25
|
-
export const getSSRUnistyles = () => [];
|
26
30
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["create","UnistylesState","deepMergeObjects","StyleSheet","configure","init","absoluteFill","position","left","top","right","bottom","compose","a","b","flatten","styles","hairlineWidth","UnistylesRuntime","UnistylesShadowRegistry"
|
1
|
+
{"version":3,"names":["create","UnistylesState","deepMergeObjects","StyleSheet","configure","init","absoluteFill","position","left","top","right","bottom","absoluteFillObject","compose","a","b","flatten","styles","hairlineWidth","UnistylesRuntime","UnistylesShadowRegistry"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,UAAU;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,gBAAgB,QAAQ,UAAU;AAE3C,OAAO,MAAMC,UAAU,GAAG;EACtBC,SAAS,EAAEH,cAAc,CAACI,IAAI;EAC9BL,MAAM;EACNM,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,kBAAkB,EAAE;IAChBL,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDE,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAKb,gBAAgB,CAACY,CAAC,EAAEC,CAAC,CAAC;EACzDC,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAKf,gBAAgB,CAAC,GAAGe,MAAM,CAAC;EAClEC,aAAa,EAAE;AACnB,CAAC;AAED,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,cAAc,QAAQ","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","stylesheetListeners","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","event","matches","ColorScheme","hasAdaptiveThemes","Theme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","addStylesheetListeners","UnistylesListener"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,WAAW;AAE5C,MAAMC,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACO,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAIG,GAAG,CAAe,CAAC,CAAC;EAC7GC,mBAAmB,GAAGN,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACO,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAIG,GAAG,CAAe,CAAC,CAAC;EAE/HE,UAAU,GAAIC,UAA8B,IAAK;IAC7C,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;IACrE,IAAI,CAACX,SAAS,CAACS,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;EAC/D,CAAC;EAEDC,aAAa,GAAGA,CAAA,KAAM;IAClB,IAAI,IAAI,CAACb,aAAa,EAAE;MACpB;IACJ;IAEA,IAAI,CAACA,aAAa,GAAG,IAAI;
|
1
|
+
{"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","stylesheetListeners","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","event","matches","ColorScheme","hasAdaptiveThemes","Theme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","addStylesheetListeners","UnistylesListener"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,WAAW;AAE5C,MAAMC,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACO,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAIG,GAAG,CAAe,CAAC,CAAC;EAC7GC,mBAAmB,GAA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I,CAACN,UAAU,CAACZ,kBAAkB,CAAC0B,WAAW,CAAC,CAAC;IACnGD,MAAM,CAACP,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACZ,kBAAkB,CAAC2B,UAAU,CAAC,CAAC;EAC3F,CAAC;EAEDC,YAAY,GAAGA,CAACC,YAAuC,EAAEd,QAAsB,KAAK;IAChFc,YAAY,CAACf,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEiB,GAAG,CAACf,QAAQ,CAAC,CAAC;IAE7E,OAAO,MAAM;MACTc,YAAY,CAACf,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEkB,MAAM,CAAChB,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;EAEDiB,sBAAsB,GAAGA,CAACH,YAAuC,EAAEd,QAAsB,KAAK;IAC1Fc,YAAY,CAACf,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEiB,GAAG,CAACf,QAAQ,CAAC,CAAC;IAEvF,OAAO,MAAM;MACTc,YAAY,CAACf,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEkB,MAAM,CAAChB,QAAQ,CAAC,CAAC;IAC9F,CAAC;EACL,CAAC;AACL;AAEA,OAAO,MAAMkB,iBAAiB,GAAG,IAAI/B,wBAAwB,CAAC,CAAC","ignoreList":[]}
|
@@ -6,7 +6,7 @@ import { WebContentSizeCategory } from '../types';
|
|
6
6
|
import { UnistylesListener } from './listener';
|
7
7
|
import { NavigationBar, StatusBar } from './mock';
|
8
8
|
import { UnistylesState } from './state';
|
9
|
-
import { isServer, schemeToTheme } from './utils';
|
9
|
+
import { error, isServer, schemeToTheme } from './utils';
|
10
10
|
class UnistylesRuntimeBuilder {
|
11
11
|
lightMedia = this.getLightMedia();
|
12
12
|
darkMedia = this.getDarkMedia();
|
@@ -126,6 +126,9 @@ class UnistylesRuntimeBuilder {
|
|
126
126
|
};
|
127
127
|
}
|
128
128
|
setTheme = themeName => {
|
129
|
+
if (this.hasAdaptiveThemes) {
|
130
|
+
throw error(`You're trying to set theme to: '${themeName}', but adaptiveThemes are enabled.`);
|
131
|
+
}
|
129
132
|
if (themeName === UnistylesRuntime.themeName) {
|
130
133
|
return;
|
131
134
|
}
|
@@ -150,17 +153,14 @@ class UnistylesRuntimeBuilder {
|
|
150
153
|
updateTheme = (themeName, updater) => {
|
151
154
|
const oldTheme = UnistylesState.themes.get(themeName);
|
152
155
|
if (!oldTheme) {
|
153
|
-
throw
|
156
|
+
throw error(`Unistyles: You're trying to update theme "${themeName}" but it wasn't registered.`);
|
154
157
|
}
|
155
158
|
UnistylesState.themes.set(themeName, updater(oldTheme));
|
156
159
|
};
|
157
160
|
getTheme = (themeName = this.themeName) => {
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
const theme = UnistylesState.themes.get(themeName);
|
162
|
-
if (!theme) {
|
163
|
-
throw new Error(`🦄 Theme "${this.themeName}" is not registered!`);
|
161
|
+
const theme = UnistylesState.themes.get(themeName ?? '');
|
162
|
+
if (!themeName || !theme) {
|
163
|
+
throw error(`You're trying to get theme "${themeName}" but it wasn't registered.`);
|
164
164
|
}
|
165
165
|
return theme;
|
166
166
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","hasAdaptiveThemes","contentSizeCategory","breakpoints","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","navigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","color","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","
|
1
|
+
{"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","error","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","hasAdaptiveThemes","contentSizeCategory","breakpoints","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","navigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","color","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","set"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,EAAEC,WAAW,QAA0C,gBAAgB;AAE3F,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,EAAEC,SAAS,QAAQ,QAAQ;AACjD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,KAAK,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AAExD,MAAMC,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAIJ,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CA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