react-native-unistyles 2.0.0-alpha.13 → 2.0.0-alpha.15
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/UnistylesRuntime.h +6 -6
- package/lib/commonjs/common.js +15 -15
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/core/UnistyleRegistry.js +3 -2
- package/lib/commonjs/core/UnistyleRegistry.js.map +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
- package/lib/commonjs/createStyleSheet.js +1 -6
- package/lib/commonjs/createStyleSheet.js.map +1 -1
- package/lib/commonjs/hooks/index.js +7 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useUnistyles.js +4 -7
- package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
- package/lib/commonjs/hooks/useVariants.js +24 -0
- package/lib/commonjs/hooks/useVariants.js.map +1 -0
- package/lib/commonjs/plugins/normalizer/normalizer.js +1 -1
- package/lib/commonjs/plugins/normalizer/normalizer.js.map +1 -1
- package/lib/commonjs/plugins/withPlugins.js +2 -6
- package/lib/commonjs/plugins/withPlugins.js.map +1 -1
- package/lib/commonjs/types/stylesheet.js +6 -0
- package/lib/commonjs/types/stylesheet.js.map +1 -0
- package/lib/commonjs/useStyles.js +8 -11
- package/lib/commonjs/useStyles.js.map +1 -1
- package/lib/commonjs/utils/index.js +22 -5
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/mq.js +42 -28
- package/lib/commonjs/utils/mq.js.map +1 -1
- package/lib/commonjs/utils/styles.js +19 -23
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/commonjs/utils/variants.js +43 -8
- package/lib/commonjs/utils/variants.js.map +1 -1
- package/lib/module/common.js +14 -14
- package/lib/module/common.js.map +1 -1
- package/lib/module/core/UnistyleRegistry.js +4 -3
- package/lib/module/core/UnistyleRegistry.js.map +1 -1
- package/lib/module/core/UnistylesRuntime.js +1 -1
- package/lib/module/core/UnistylesRuntime.js.map +1 -1
- package/lib/module/createStyleSheet.js +1 -6
- package/lib/module/createStyleSheet.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useUnistyles.js +5 -8
- package/lib/module/hooks/useUnistyles.js.map +1 -1
- package/lib/module/hooks/useVariants.js +17 -0
- package/lib/module/hooks/useVariants.js.map +1 -0
- package/lib/module/plugins/normalizer/normalizer.js +1 -1
- package/lib/module/plugins/normalizer/normalizer.js.map +1 -1
- package/lib/module/plugins/withPlugins.js +2 -6
- package/lib/module/plugins/withPlugins.js.map +1 -1
- package/lib/module/types/stylesheet.js +2 -0
- package/lib/module/types/stylesheet.js.map +1 -0
- package/lib/module/useStyles.js +9 -12
- package/lib/module/useStyles.js.map +1 -1
- package/lib/module/utils/index.js +1 -2
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/mq.js +41 -27
- package/lib/module/utils/mq.js.map +1 -1
- package/lib/module/utils/styles.js +20 -24
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/module/utils/variants.js +41 -6
- package/lib/module/utils/variants.js.map +1 -1
- package/lib/typescript/src/common.d.ts +10 -10
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -1
- package/lib/typescript/src/createStyleSheet.d.ts +2 -2
- package/lib/typescript/src/createStyleSheet.d.ts.map +1 -1
- package/lib/typescript/src/global.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useVariants.d.ts +3 -0
- package/lib/typescript/src/hooks/useVariants.d.ts.map +1 -0
- package/lib/typescript/src/plugins/normalizer/normalizer.d.ts.map +1 -1
- package/lib/typescript/src/plugins/withPlugins.d.ts +3 -2
- package/lib/typescript/src/plugins/withPlugins.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +20 -14
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/core.d.ts +3 -26
- package/lib/typescript/src/types/core.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/mq.d.ts +2 -2
- package/lib/typescript/src/types/mq.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +47 -0
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/types/unistyles.d.ts +5 -6
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/lib/typescript/src/types/variants.d.ts +13 -7
- package/lib/typescript/src/types/variants.d.ts.map +1 -1
- package/lib/typescript/src/useStyles.d.ts +3 -3
- package/lib/typescript/src/useStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +1 -2
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/mq.d.ts +19 -13
- package/lib/typescript/src/utils/mq.d.ts.map +1 -1
- package/lib/typescript/src/utils/styles.d.ts +4 -4
- package/lib/typescript/src/utils/styles.d.ts.map +1 -1
- package/lib/typescript/src/utils/variants.d.ts +2 -2
- package/lib/typescript/src/utils/variants.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/common.ts +10 -10
- package/src/core/UnistyleRegistry.ts +6 -3
- package/src/core/UnistylesRuntime.ts +1 -1
- package/src/createStyleSheet.ts +2 -8
- package/src/global.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useUnistyles.ts +5 -8
- package/src/hooks/useVariants.ts +23 -0
- package/src/plugins/normalizer/normalizer.ts +3 -3
- package/src/plugins/withPlugins.ts +13 -15
- package/src/types/breakpoints.ts +47 -26
- package/src/types/core.ts +6 -42
- package/src/types/index.ts +1 -1
- package/src/types/mq.ts +2 -2
- package/src/types/stylesheet.ts +56 -0
- package/src/types/unistyles.ts +5 -6
- package/src/types/variants.ts +17 -9
- package/src/useStyles.ts +22 -16
- package/src/utils/index.ts +1 -2
- package/src/utils/mq.ts +56 -41
- package/src/utils/styles.ts +28 -45
- package/src/utils/variants.ts +55 -7
package/cxx/UnistylesRuntime.h
CHANGED
@@ -12,9 +12,9 @@ const std::string UnistylesDarkScheme = "dark";
|
|
12
12
|
const std::string UnistylesLightScheme = "light";
|
13
13
|
const std::string UnistylesUnspecifiedScheme = "unspecified";
|
14
14
|
|
15
|
-
const std::string UnistylesErrorBreakpointsCannotBeEmpty = "
|
16
|
-
const std::string UnistylesErrorBreakpointsMustStartFromZero = "
|
17
|
-
const std::string UnistylesErrorThemesCannotBeEmpty = "
|
15
|
+
const std::string UnistylesErrorBreakpointsCannotBeEmpty = "You are trying to register an empty breakpoints object.";
|
16
|
+
const std::string UnistylesErrorBreakpointsMustStartFromZero = "One breakpoint must start from 0.";
|
17
|
+
const std::string UnistylesErrorThemesCannotBeEmpty = "You are trying to register an empty themes object.";
|
18
18
|
|
19
19
|
class JSI_EXPORT UnistylesRuntime : public jsi::HostObject {
|
20
20
|
private:
|
@@ -41,15 +41,15 @@ public:
|
|
41
41
|
std::vector<std::string> pluginNames;
|
42
42
|
std::vector<std::string> themes;
|
43
43
|
std::vector<std::pair<std::string, double>> sortedBreakpointPairs;
|
44
|
-
|
44
|
+
|
45
45
|
void onThemeChange(std::function<void(std::string)> callback) {
|
46
46
|
this->onThemeChangeCallback = callback;
|
47
47
|
}
|
48
|
-
|
48
|
+
|
49
49
|
void onLayoutChange(std::function<void(std::string breakpoint, std::string orientation, int screenWidth, int screenHeight)> callback) {
|
50
50
|
this->onLayoutChangeCallback = callback;
|
51
51
|
}
|
52
|
-
|
52
|
+
|
53
53
|
void onPluginChange(std::function<void()> callback) {
|
54
54
|
this->onPluginChangeCallback = callback;
|
55
55
|
}
|
package/lib/commonjs/common.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.warn = exports.isWeb = exports.isServer = exports.isMobile = exports.isIOS = exports.isAndroid = exports.
|
6
|
+
exports.warn = exports.isWeb = exports.isServer = exports.isMobile = exports.isIOS = exports.isAndroid = exports.UnistylesEventType = exports.UnistylesError = exports.ScreenOrientation = void 0;
|
7
7
|
var _reactNative = require("react-native");
|
8
8
|
const warn = message => {
|
9
9
|
console.warn(`🦄 [react-native-unistyles]: ${message}`);
|
@@ -18,22 +18,22 @@ const ScreenOrientation = exports.ScreenOrientation = {
|
|
18
18
|
Landscape: 'landscape',
|
19
19
|
Portrait: 'portrait'
|
20
20
|
};
|
21
|
-
let
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
return
|
21
|
+
let UnistylesEventType = exports.UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
|
22
|
+
UnistylesEventType["Theme"] = "theme";
|
23
|
+
UnistylesEventType["Layout"] = "layout";
|
24
|
+
UnistylesEventType["Plugin"] = "plugin";
|
25
|
+
return UnistylesEventType;
|
26
26
|
}({});
|
27
27
|
let UnistylesError = exports.UnistylesError = /*#__PURE__*/function (UnistylesError) {
|
28
|
-
UnistylesError["RuntimeUnavailable"] = "
|
29
|
-
UnistylesError["ThemeNotFound"] = "
|
30
|
-
UnistylesError["ThemeNotRegistered"] = "
|
31
|
-
UnistylesError["ThemesCannotBeEmpty"] = "
|
32
|
-
UnistylesError["BreakpointsCannotBeEmpty"] = "
|
33
|
-
UnistylesError["BreakpointsMustStartFromZero"] = "
|
34
|
-
UnistylesError["InvalidPluginName"] = "
|
35
|
-
UnistylesError["DuplicatePluginName"] = "
|
36
|
-
UnistylesError["CantRemoveInternalPlugin"] = "
|
28
|
+
UnistylesError["RuntimeUnavailable"] = "Unistyles runtime is not available. Make sure you followed the installation instructions.";
|
29
|
+
UnistylesError["ThemeNotFound"] = "You are trying to get a theme that is not registered.";
|
30
|
+
UnistylesError["ThemeNotRegistered"] = "You are trying to set a theme that is not registered.";
|
31
|
+
UnistylesError["ThemesCannotBeEmpty"] = "You are trying to register an empty themes object.";
|
32
|
+
UnistylesError["BreakpointsCannotBeEmpty"] = "You are trying to register an empty breakpoints object.";
|
33
|
+
UnistylesError["BreakpointsMustStartFromZero"] = "One breakpoint must start from 0.";
|
34
|
+
UnistylesError["InvalidPluginName"] = "Plugin name can't start from reserved prefix. Use another name.";
|
35
|
+
UnistylesError["DuplicatePluginName"] = "You are trying to register a plugin with a name that is already registered.";
|
36
|
+
UnistylesError["CantRemoveInternalPlugin"] = "You are trying to remove an internal unistyles plugin.";
|
37
37
|
return UnistylesError;
|
38
38
|
}({});
|
39
39
|
//# sourceMappingURL=common.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","warn","message","console","exports","isMobile","Platform","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","
|
1
|
+
{"version":3,"names":["_reactNative","require","warn","message","console","exports","isMobile","Platform","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA;AAEM,MAAMI,QAAQ,GAAAD,OAAA,CAAAC,QAAA,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAID,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnE,MAAMC,KAAK,GAAAJ,OAAA,CAAAI,KAAA,GAAGF,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAME,KAAK,GAAAL,OAAA,CAAAK,KAAA,GAAGH,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAMG,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAGJ,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAC3C,MAAMI,QAAQ,GAAAP,OAAA,CAAAO,QAAA,GAAG,OAAOC,MAAM,KAAK,WAAW;AAE9C,MAAMC,iBAAiB,GAAAT,OAAA,CAAAS,iBAAA,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAAA,IAEEC,kBAAkB,GAAAZ,OAAA,CAAAY,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAAA,IAMlBC,cAAc,GAAAb,OAAA,CAAAa,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.UnistyleRegistry = void 0;
|
7
7
|
var _common = require("../common");
|
8
|
+
var _plugins = require("../plugins");
|
8
9
|
class UnistyleRegistry {
|
9
10
|
config = {};
|
10
|
-
plugins = [];
|
11
|
+
plugins = _common.isWeb ? [_plugins.normalizeWebStylesPlugin] : [];
|
11
12
|
themeNames = [];
|
12
13
|
themes = {};
|
13
14
|
breakpoints = {};
|
@@ -64,7 +65,7 @@ class UnistyleRegistry {
|
|
64
65
|
})) {
|
65
66
|
throw new Error(_common.UnistylesError.DuplicatePluginName);
|
66
67
|
}
|
67
|
-
_this.plugins = _this.plugins
|
68
|
+
_this.plugins = [plugin].concat(_this.plugins);
|
68
69
|
_this.unistylesBridge.addPlugin(plugin.name, notify);
|
69
70
|
};
|
70
71
|
})();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_common","require","UnistyleRegistry","config","plugins","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","useBreakpoints","addConfig","adaptiveThemes","useAdaptiveThemes","experimentalPlugins","forEach","plugin","addPlugin","initialTheme","useTheme","getTheme","forName","length","hasTheme","Error","UnistylesError","ThemeNotFound","_this","notify","arguments","undefined","name","startsWith","InvalidPluginName","some","_ref","DuplicatePluginName","concat","removePlugin","CantRemoveInternalPlugin","filter","_ref2","exports"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAEO,
|
1
|
+
{"version":3,"names":["_common","require","_plugins","UnistyleRegistry","config","plugins","isWeb","normalizeWebStylesPlugin","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","useBreakpoints","addConfig","adaptiveThemes","useAdaptiveThemes","experimentalPlugins","forEach","plugin","addPlugin","initialTheme","useTheme","getTheme","forName","length","hasTheme","Error","UnistylesError","ThemeNotFound","_this","notify","arguments","undefined","name","startsWith","InvalidPluginName","some","_ref","DuplicatePluginName","concat","removePlugin","CantRemoveInternalPlugin","filter","_ref2","exports"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2BC,aAAK,GACxC,CAACC,iCAAwB,CAAC,GAC1B,EAAE;EACDC,UAAU,GAAiC,EAAE;EAC7CC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,WAAW,GAAyB,CAAC,CAAC;EACtCC,qBAAqB,GAA0F,EAAE;EAExHC,WAAWA,CAASC,eAAgC,EAAE;IAAA,KAAlCA,eAAgC,GAAhCA,eAAgC;EAAG;EAEhDC,SAAS,GAAIL,MAAuB,IAAK;IAC5C,IAAI,CAACA,MA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yC,OAAA,CAAA/C,gBAAA,GAAAA,gBAAA"}
|
@@ -42,7 +42,7 @@ class UnistylesRuntime {
|
|
42
42
|
return _common.ScreenOrientation.Portrait;
|
43
43
|
}
|
44
44
|
setTheme = name => {
|
45
|
-
if (this.unistylesRegistry.hasTheme(name)) {
|
45
|
+
if (name !== this.themeName && this.unistylesRegistry.hasTheme(name)) {
|
46
46
|
this.unistylesBridge.useTheme(name);
|
47
47
|
return true;
|
48
48
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_common","require","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","ScreenOrientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;EAEpG,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,eAAe,CAACG,iBAAiB;EACjD;EAEA,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACJ,eAAe,CAACI,SAAS;EACzC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACL,eAAe,CAACK,UAAU;EAC1C;EAEA,IAAWC,cAAcA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACN,eAAe,CAACM,cAAc;EAC9C;EAEA,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO;MACHC,KAAK,EAAE,IAAI,CAACR,eAAe,CAACS,WAAW;MACvCC,MAAM,EAAE,IAAI,CAACV,eAAe,CAACW;IACjC,CAAC;EACL;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,MAAM;MAAEJ,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAI,CAACH,MAAM;IAErC,IAAIC,KAAK,GAAGE,MAAM,EAAE;MAChB,OAAOG,yBAAiB,CAACC,SAAS;IACtC;IAEA,OAAOD,yBAAiB,CAACE,QAAQ;EACrC;EAEOC,QAAQ,GAAIC,IAA2B,IAAK;IAC/C,IAAI,IAAI,
|
1
|
+
{"version":3,"names":["_common","require","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","ScreenOrientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;EAEpG,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,eAAe,CAACG,iBAAiB;EACjD;EAEA,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACJ,eAAe,CAACI,SAAS;EACzC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IA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});
|
6
6
|
exports.createStyleSheet = void 0;
|
7
|
-
const createStyleSheet =
|
8
|
-
if (typeof styles === 'function') {
|
9
|
-
return styles;
|
10
|
-
}
|
11
|
-
return styles;
|
12
|
-
};
|
7
|
+
const createStyleSheet = stylesheet => stylesheet;
|
13
8
|
exports.createStyleSheet = createStyleSheet;
|
14
9
|
//# sourceMappingURL=createStyleSheet.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createStyleSheet","
|
1
|
+
{"version":3,"names":["createStyleSheet","stylesheet","exports"],"sourceRoot":"../../src","sources":["createStyleSheet.ts"],"mappings":";;;;;;AAEO,MAAMA,gBAAgB,GAAyCC,UAAa,IAAQA,UAAU;AAAAC,OAAA,CAAAF,gBAAA,GAAAA,gBAAA"}
|
@@ -15,6 +15,13 @@ Object.defineProperty(exports, "useUnistyles", {
|
|
15
15
|
return _useUnistyles.useUnistyles;
|
16
16
|
}
|
17
17
|
});
|
18
|
+
Object.defineProperty(exports, "useVariants", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function () {
|
21
|
+
return _useVariants.useVariants;
|
22
|
+
}
|
23
|
+
});
|
18
24
|
var _useInitialTheme = require("./useInitialTheme");
|
19
25
|
var _useUnistyles = require("./useUnistyles");
|
26
|
+
var _useVariants = require("./useVariants");
|
20
27
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_useInitialTheme","require","_useUnistyles"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_useInitialTheme","require","_useUnistyles","_useVariants"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA"}
|
@@ -23,24 +23,21 @@ const useUnistyles = () => {
|
|
23
23
|
(0, _react.useEffect)(() => {
|
24
24
|
const subscription = unistylesEvents.addListener('onChange', event => {
|
25
25
|
switch (event.type) {
|
26
|
-
case _common.
|
26
|
+
case _common.UnistylesEventType.Theme:
|
27
27
|
{
|
28
28
|
const themeEvent = event;
|
29
29
|
return setTheme(_core.unistyles.registry.getTheme(themeEvent.payload.themeName));
|
30
30
|
}
|
31
|
-
case _common.
|
31
|
+
case _common.UnistylesEventType.Layout:
|
32
32
|
{
|
33
33
|
const layoutEvent = event;
|
34
34
|
return setLayout({
|
35
35
|
breakpoint: layoutEvent.payload.breakpoint,
|
36
36
|
orientation: layoutEvent.payload.orientation,
|
37
|
-
screenSize:
|
38
|
-
width: layoutEvent.payload.screen.width,
|
39
|
-
height: layoutEvent.payload.screen.height
|
40
|
-
}
|
37
|
+
screenSize: layoutEvent.payload.screen
|
41
38
|
});
|
42
39
|
}
|
43
|
-
case _common.
|
40
|
+
case _common.UnistylesEventType.Plugin:
|
44
41
|
{
|
45
42
|
return setPlugins(_core.unistyles.runtime.enabledPlugins);
|
46
43
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_react","_core","_common","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","useUnistyles","plugins","setPlugins","useState","unistyles","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","useEffect","subscription","addListener","event","type","
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_core","_common","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","useUnistyles","plugins","setPlugins","useState","unistyles","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","useEffect","subscription","addListener","event","type","UnistylesEventType","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","remove","exports"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,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,OAAO,CAACd,UAAU;cAC1CC,WAAW,EAAEe,WAAW,CAACF,OAAO,CAACb,WAAW;cAC5CC,UAAU,EAAEc,WAAW,CAACF,OAAO,CAACV;YACpC,CAAC,CAAC;UACN;QACA,KAAKO,0BAAkB,CAACM,MAAM;UAAE;YAC5B,OAAO7B,UAAU,CAACE,eAAS,CAACC,OAAO,CAACC,cAAc,CAAC;UACvD;QACA;UACI;MACR;IACJ,CACJ,CAAC;IAED,OAAOe,YAAY,CAACW,MAAM;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACH/B,OAAO;IACPM,KAAK;IACLK;EACJ,CAAC;AACL,CAAC;AAAAqB,OAAA,CAAAjC,YAAA,GAAAA,YAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useVariants = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
const compareVariants = (prevVariants, nextVariants) => {
|
9
|
+
const keysA = Object.keys(prevVariants ?? {});
|
10
|
+
const keysB = Object.keys(nextVariants ?? {});
|
11
|
+
if (keysA.length !== keysB.length) {
|
12
|
+
return false;
|
13
|
+
}
|
14
|
+
return keysA.every(key => prevVariants[key] === (nextVariants ?? {})[key]);
|
15
|
+
};
|
16
|
+
const useVariants = variantsMap => {
|
17
|
+
const variantsRef = (0, _react.useRef)(variantsMap);
|
18
|
+
if (!compareVariants(variantsRef.current, variantsMap)) {
|
19
|
+
variantsRef.current = variantsMap;
|
20
|
+
}
|
21
|
+
return variantsRef.current;
|
22
|
+
};
|
23
|
+
exports.useVariants = useVariants;
|
24
|
+
//# sourceMappingURL=useVariants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","require","compareVariants","prevVariants","nextVariants","keysA","Object","keys","keysB","length","every","key","useVariants","variantsMap","variantsRef","useRef","current","exports"],"sourceRoot":"../../../src","sources":["hooks/useVariants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,MAAMC,eAAe,GAAGA,CAACC,YAA+C,EAAEC,YAA+C,KAAK;EAC1H,MAAMC,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACJ,YAAY,IAAI,CAAC,CAAC,CAAC;EAC7C,MAAMK,KAAK,GAAGF,MAAM,CAACC,IAAI,CAACH,YAAY,IAAI,CAAC,CAAC,CAAC;EAE7C,IAAIC,KAAK,CAACI,MAAM,KAAKD,KAAK,CAACC,MAAM,EAAE;IAC/B,OAAO,KAAK;EAChB;EAEA,OAAOJ,KAAK,CAACK,KAAK,CAACC,GAAG,IAAIR,YAAY,CAAEQ,GAAG,CAAC,KAAK,CAACP,YAAY,IAAI,CAAC,CAAC,EAAEO,GAAG,CAAC,CAAC;AAC/E,CAAC;AAEM,MAAMC,WAAW,GAAIC,WAA8C,IAAK;EAC3E,MAAMC,WAAW,GAAG,IAAAC,aAAM,EAA6CF,WAAW,CAAC;EAEnF,IAAI,CAACX,eAAe,CAACY,WAAW,CAACE,OAAO,EAAEH,WAAW,CAAC,EAAE;IACpDC,WAAW,CAACE,OAAO,GAAGH,WAAW;EACrC;EAEA,OAAOC,WAAW,CAACE,OAAO;AAC9B,CAAC;AAAAC,OAAA,CAAAL,WAAA,GAAAA,WAAA"}
|
@@ -17,7 +17,7 @@ const normalizeColor = function (color) {
|
|
17
17
|
}
|
18
18
|
const integer = (0, _normalizeColors.default)(color);
|
19
19
|
|
20
|
-
// If the
|
20
|
+
// If the color is an unknown format, the return value is null
|
21
21
|
if (integer === null) {
|
22
22
|
return color;
|
23
23
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_normalizeColors","_interopRequireDefault","require","obj","__esModule","default","normalizeColor","color","opacity","arguments","length","undefined","integer","normalizeColors","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","exports","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizer.ts"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF5D;AACA;;AAUO,MAAMG,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC7D;EACA,IAAID,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAMK,OAAO,GAAG,IAAAC,wBAAe,EAACN,KAAK,
|
1
|
+
{"version":3,"names":["_normalizeColors","_interopRequireDefault","require","obj","__esModule","default","normalizeColor","color","opacity","arguments","length","undefined","integer","normalizeColors","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","exports","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../../src","sources":["plugins/normalizer/normalizer.ts"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF5D;AACA;;AAUO,MAAMG,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B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;IACN,OAAOrB,SAAS;EACpB;EAEA,MAAMmB,KAAK,GAAGqB,SAAS,CAACnB,GAAG,CAA2B;EAEtD,QAAOA,GAAG;IACN,KAAK,QAAQ;IACb,KAAK,UAAU;MACX,OAAQ,GAAEA,GAAI,IAAIF,KAAK,CAAmBwB,IAAI,CAAC,GAAG,CAAE,GAAE;IAC1D;MACI,OAAQ,GAAEtB,GAAI,IAAGD,kBAAkB,CAACC,GAAG,EAAEF,KAAK,CAAE,GAAE;EAC1D;AACJ,CAAC,CAAC,CACDL,MAAM,CAAC8B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEP,MAAME,YAA0B,GAAA5B,OAAA,CAAA4B,YAAA,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,CAAC"}
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.withPlugins = void 0;
|
7
|
-
|
8
|
-
var _common = require("../common");
|
9
|
-
var _core = require("../core");
|
10
|
-
const UNISTYLES_PLUGINS = _common.isWeb ? [_normalizeWebStylesPlugin.normalizeWebStylesPlugin] : [];
|
11
|
-
const withPlugins = (key, style) => _core.unistyles.registry.plugins.concat(UNISTYLES_PLUGINS).reduce((acc, plugin) => {
|
7
|
+
const withPlugins = (key, style, plugins, runtime) => plugins.reduce((acc, plugin) => {
|
12
8
|
if (plugin.onParsedStyle) {
|
13
|
-
return plugin.onParsedStyle(key, acc,
|
9
|
+
return plugin.onParsedStyle(key, acc, runtime);
|
14
10
|
}
|
15
11
|
return acc;
|
16
12
|
}, style);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["withPlugins","key","style","plugins","runtime","reduce","acc","plugin","onParsedStyle","exports"],"sourceRoot":"../../../src","sources":["plugins/withPlugins.ts"],"mappings":";;;;;;AAGO,MAAMA,WAAW,GAAGA,CACvBC,GAAW,EACXC,KAAc,EACdC,OAA+B,EAC/BC,OAAyB,KACxBD,OAAO,CAACE,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAK;EACjC,IAAIA,MAAM,CAACC,aAAa,EAAE;IACtB,OAAOD,MAAM,CAACC,aAAa,CAACP,GAAG,EAAEK,GAAG,EAAEF,OAAO,CAAC;EAClD;EAEA,OAAOE,GAAG;AACd,CAAC,EAAEJ,KAAK,CAAC;AAAAO,OAAA,CAAAT,WAAA,GAAAA,WAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":""}
|
@@ -8,41 +8,38 @@ var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
9
9
|
var _utils = require("./utils");
|
10
10
|
var _hooks = require("./hooks");
|
11
|
-
|
11
|
+
var _core = require("./core");
|
12
|
+
const useStyles = (stylesheet, variantsMap) => {
|
12
13
|
const {
|
13
14
|
theme,
|
14
15
|
layout,
|
15
16
|
plugins
|
16
17
|
} = (0, _hooks.useUnistyles)();
|
17
|
-
const {
|
18
|
-
screenSize,
|
19
|
-
breakpoint
|
20
|
-
} = layout;
|
21
18
|
if (!stylesheet) {
|
22
19
|
return {
|
23
20
|
theme,
|
24
|
-
breakpoint,
|
21
|
+
breakpoint: layout.breakpoint,
|
25
22
|
styles: {}
|
26
23
|
};
|
27
24
|
}
|
25
|
+
const variants = (0, _hooks.useVariants)(variantsMap);
|
28
26
|
const parsedStyles = (0, _react.useMemo)(() => typeof stylesheet === 'function' ? stylesheet(theme) : stylesheet, [theme, stylesheet, layout]);
|
29
27
|
const dynamicStyleSheet = (0, _react.useMemo)(() => Object.entries(parsedStyles).reduce((acc, _ref) => {
|
30
28
|
let [key, value] = _ref;
|
31
|
-
const style = value;
|
32
29
|
if (typeof value === 'function') {
|
33
30
|
return {
|
34
31
|
...acc,
|
35
|
-
[key]: (0, _utils.proxifyFunction)(key, value,
|
32
|
+
[key]: (0, _utils.proxifyFunction)(key, value, _core.unistyles.registry.plugins, _core.unistyles.runtime, variants)
|
36
33
|
};
|
37
34
|
}
|
38
35
|
return _reactNative.StyleSheet.create({
|
39
36
|
...acc,
|
40
|
-
[key]: (0, _utils.parseStyle)(key,
|
37
|
+
[key]: (0, _utils.parseStyle)(key, value, _core.unistyles.registry.plugins, _core.unistyles.runtime, variants)
|
41
38
|
});
|
42
|
-
}, {}), [
|
39
|
+
}, {}), [layout, parsedStyles, variants, plugins]);
|
43
40
|
return {
|
44
41
|
theme,
|
45
|
-
breakpoint,
|
42
|
+
breakpoint: layout.breakpoint,
|
46
43
|
styles: dynamicStyleSheet
|
47
44
|
};
|
48
45
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_utils","_hooks","useStyles","stylesheet","
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_hooks","_core","useStyles","stylesheet","variantsMap","theme","layout","plugins","useUnistyles","breakpoint","styles","variants","useVariants","parsedStyles","useMemo","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","proxifyFunction","unistyles","registry","runtime","StyleSheet","create","parseStyle","exports"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AAcO,MAAMK,SAAS,GAAGA,CACrBC,UAAe,EACfC,WAAoD,KAC7B;EACvB,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAG,IAAAC,mBAAY,EAAC,CAAC;EAEjD,IAAI,CAACL,UAAU,EAAE;IACb,OAAO;MACHE,KAAK;MACLI,UAAU,EAAEH,MAAM,CAACG,UAAU;MAC7BC,MAAM,EAAE,CAAC;IACb,CAAC;EACL;EAEA,MAAMC,QAAQ,GAAG,IAAAC,k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{
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _mq.MQHeight;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "MQHeightAndWidth", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _mq.MQHeightAndWidth;
|
16
|
+
}
|
17
|
+
});
|
6
18
|
Object.defineProperty(exports, "MQSymbol", {
|
7
19
|
enumerable: true,
|
8
20
|
get: function () {
|
9
21
|
return _mq.MQSymbol;
|
10
22
|
}
|
11
23
|
});
|
12
|
-
Object.defineProperty(exports, "
|
24
|
+
Object.defineProperty(exports, "MQWidth", {
|
13
25
|
enumerable: true,
|
14
26
|
get: function () {
|
15
|
-
return
|
27
|
+
return _mq.MQWidth;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
Object.defineProperty(exports, "MQWidthAndHeight", {
|
31
|
+
enumerable: true,
|
32
|
+
get: function () {
|
33
|
+
return _mq.MQWidthAndHeight;
|
16
34
|
}
|
17
35
|
});
|
18
|
-
Object.defineProperty(exports, "
|
36
|
+
Object.defineProperty(exports, "getKeyForUnistylesMediaQuery", {
|
19
37
|
enumerable: true,
|
20
38
|
get: function () {
|
21
|
-
return
|
39
|
+
return _mqParser.getKeyForUnistylesMediaQuery;
|
22
40
|
}
|
23
41
|
});
|
24
42
|
Object.defineProperty(exports, "getValueForBreakpoint", {
|
@@ -64,7 +82,6 @@ Object.defineProperty(exports, "proxifyFunction", {
|
|
64
82
|
}
|
65
83
|
});
|
66
84
|
var _mq = require("./mq");
|
67
|
-
var _variants = require("./variants");
|
68
85
|
var _mqParser = require("./mqParser");
|
69
86
|
var _breakpoints = require("./breakpoints");
|
70
87
|
var _styles = require("./styles");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_mq","require","
|
1
|
+
{"version":3,"names":["_mq","require","_mqParser","_breakpoints","_styles"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA"}
|
package/lib/commonjs/utils/mq.js
CHANGED
@@ -3,15 +3,19 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.mq = exports.MQSymbol = void 0;
|
6
|
+
exports.mq = exports.MQWidthAndHeight = exports.MQWidth = exports.MQSymbol = exports.MQHeightAndWidth = exports.MQHeight = void 0;
|
7
7
|
var _core = require("../core");
|
8
8
|
const MQSymbol = exports.MQSymbol = Symbol('unistyles-mq');
|
9
|
+
const MQWidth = exports.MQWidth = Symbol('unistyles-mq-width');
|
10
|
+
const MQHeight = exports.MQHeight = Symbol('unistyles-mq-height');
|
11
|
+
const MQWidthAndHeight = exports.MQWidthAndHeight = Symbol('unistyles-mq-width-and-height');
|
12
|
+
const MQHeightAndWidth = exports.MQHeightAndWidth = Symbol('unistyles-mq-height-and-width');
|
9
13
|
var MQProp = /*#__PURE__*/function (MQProp) {
|
10
14
|
MQProp["toString"] = "toString";
|
11
15
|
MQProp["width"] = "width";
|
12
16
|
MQProp["height"] = "height";
|
13
|
-
MQProp["
|
14
|
-
MQProp["
|
17
|
+
MQProp["only"] = "only";
|
18
|
+
MQProp["and"] = "and";
|
15
19
|
return MQProp;
|
16
20
|
}(MQProp || {});
|
17
21
|
const getMQValue = value => {
|
@@ -31,18 +35,20 @@ const widthHandler = function () {
|
|
31
35
|
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
32
36
|
return () => `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
33
37
|
}
|
34
|
-
if (prop === MQProp.
|
35
|
-
return
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
if (prop === MQProp.and) {
|
39
|
+
return {
|
40
|
+
width: function () {
|
41
|
+
let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
42
|
+
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
43
|
+
return new Proxy({}, {
|
44
|
+
get: (target, prop, receiver) => {
|
45
|
+
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
46
|
+
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
47
|
+
}
|
48
|
+
return Reflect.get(target, prop, receiver);
|
42
49
|
}
|
43
|
-
|
44
|
-
|
45
|
-
});
|
50
|
+
});
|
51
|
+
}
|
46
52
|
};
|
47
53
|
}
|
48
54
|
return Reflect.get(target, prop, receiver);
|
@@ -57,18 +63,20 @@ const heightHandler = function () {
|
|
57
63
|
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
58
64
|
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`;
|
59
65
|
}
|
60
|
-
if (prop === MQProp.
|
61
|
-
return
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
66
|
+
if (prop === MQProp.and) {
|
67
|
+
return {
|
68
|
+
height: function () {
|
69
|
+
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
70
|
+
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
71
|
+
return new Proxy({}, {
|
72
|
+
get: (target, prop, receiver) => {
|
73
|
+
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
74
|
+
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
75
|
+
}
|
76
|
+
return Reflect.get(target, prop, receiver);
|
68
77
|
}
|
69
|
-
|
70
|
-
|
71
|
-
});
|
78
|
+
});
|
79
|
+
}
|
72
80
|
};
|
73
81
|
}
|
74
82
|
return Reflect.get(target, prop, receiver);
|
@@ -77,12 +85,18 @@ const heightHandler = function () {
|
|
77
85
|
};
|
78
86
|
const mq = exports.mq = new Proxy({}, {
|
79
87
|
get: (target, prop, receiver) => {
|
80
|
-
if (prop === MQProp.
|
81
|
-
return
|
88
|
+
if (prop === MQProp.only) {
|
89
|
+
return {
|
90
|
+
width: heightHandler,
|
91
|
+
height: widthHandler
|
92
|
+
};
|
82
93
|
}
|
83
|
-
if (prop === MQProp.
|
94
|
+
if (prop === MQProp.height) {
|
84
95
|
return widthHandler;
|
85
96
|
}
|
97
|
+
if (prop === MQProp.width) {
|
98
|
+
return heightHandler;
|
99
|
+
}
|
86
100
|
return Reflect.get(target, prop, receiver);
|
87
101
|
}
|
88
102
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_core","require","MQSymbol","exports","Symbol","MQProp","getMQValue","value","unistyles","registry","breakpoints","widthHandler","hMin","arguments","length","undefined","hMax","Infinity","Proxy","get","target","prop","receiver","toPrimitive","toString","
|
1
|
+
{"version":3,"names":["_core","require","MQSymbol","exports","Symbol","MQWidth","MQHeight","MQWidthAndHeight","MQHeightAndWidth","MQProp","getMQValue","value","unistyles","registry","breakpoints","widthHandler","hMin","arguments","length","undefined","hMax","Infinity","Proxy","get","target","prop","receiver","toPrimitive","toString","and","width","wMin","wMax","Reflect","heightHandler","height","mq","only"],"sourceRoot":"../../../src","sources":["utils/mq.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAAC,cAAc,CAAC;AACvC,MAAMC,OAAO,GAAAF,OAAA,CAAAE,OAAA,GAAGD,MAAM,CAAC,oBAAoB,CAAC;AAC5C,MAAME,QAAQ,GAAAH,OAAA,CAAAG,QAAA,GAAGF,MAAM,CAAC,qBAAqB,CAAC;AAC9C,MAAMG,gBA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