react-native-unistyles 3.0.0-alpha.21 → 3.0.0-alpha.23
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/core/UnistylesRegistry.cpp +26 -0
- package/cxx/core/UnistylesRegistry.h +1 -0
- package/cxx/hybridObjects/HybridStyleSheet.cpp +11 -5
- package/cxx/hybridObjects/HybridStyleSheet.h +1 -1
- package/cxx/parser/Parser.cpp +27 -1
- package/cxx/parser/Parser.h +1 -1
- package/lib/commonjs/web/convert/boxShadow.js +13 -13
- package/lib/commonjs/web/convert/boxShadow.js.map +1 -1
- package/lib/commonjs/web/convert/index.js +9 -11
- package/lib/commonjs/web/convert/index.js.map +1 -1
- package/lib/commonjs/web/convert/pseudo.js.map +1 -0
- package/lib/commonjs/web/convert/style.js +11 -7
- package/lib/commonjs/web/convert/style.js.map +1 -1
- package/lib/commonjs/web/convert/textShadow.js +12 -12
- package/lib/commonjs/web/convert/textShadow.js.map +1 -1
- package/lib/commonjs/web/convert/transform.js +5 -5
- package/lib/commonjs/web/convert/transform.js.map +1 -1
- package/lib/commonjs/web/{listener/listener.js → listener.js} +2 -2
- package/lib/commonjs/web/listener.js.map +1 -0
- package/lib/commonjs/web/mq.js.map +1 -1
- package/lib/commonjs/web/registry.js +159 -21
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +50 -48
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/state.js +8 -16
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/{utils.js → utils/common.js} +9 -47
- package/lib/commonjs/web/utils/common.js.map +1 -0
- package/lib/commonjs/web/utils/index.js +28 -0
- package/lib/commonjs/web/utils/index.js.map +1 -0
- package/lib/commonjs/web/utils/unistyle.js +82 -0
- package/lib/commonjs/web/utils/unistyle.js.map +1 -0
- package/lib/module/web/convert/boxShadow.js +13 -13
- package/lib/module/web/convert/boxShadow.js.map +1 -1
- package/lib/module/web/convert/index.js +7 -9
- package/lib/module/web/convert/index.js.map +1 -1
- package/lib/module/web/convert/pseudo.js.map +1 -0
- package/lib/module/web/convert/style.js +11 -7
- package/lib/module/web/convert/style.js.map +1 -1
- package/lib/module/web/convert/textShadow.js +12 -12
- package/lib/module/web/convert/textShadow.js.map +1 -1
- package/lib/module/web/convert/transform.js +5 -5
- package/lib/module/web/convert/transform.js.map +1 -1
- package/lib/module/web/{listener/listener.js → listener.js} +2 -2
- package/lib/module/web/listener.js.map +1 -0
- package/lib/module/web/mq.js.map +1 -1
- package/lib/module/web/registry.js +160 -22
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +51 -49
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/state.js +8 -16
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/{utils.js → utils/common.js} +7 -39
- package/lib/module/web/utils/common.js.map +1 -0
- package/lib/module/web/utils/index.js +5 -0
- package/lib/module/web/utils/index.js.map +1 -0
- package/lib/module/web/utils/unistyle.js +69 -0
- package/lib/module/web/utils/unistyle.js.map +1 -0
- 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/types/stylesheet.d.ts +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/boxShadow.d.ts +7 -2
- package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/index.d.ts +1 -2
- package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/style.d.ts +1 -2
- package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/textShadow.d.ts +7 -2
- package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/transform.d.ts +1 -2
- package/lib/typescript/src/web/convert/transform.d.ts.map +1 -1
- package/lib/typescript/src/web/{listener/listener.d.ts → listener.d.ts} +1 -1
- package/lib/typescript/src/web/listener.d.ts.map +1 -0
- package/lib/typescript/src/web/mq.d.ts +6 -2
- package/lib/typescript/src/web/mq.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts +21 -8
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts +3 -4
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/state.d.ts +2 -2
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/{utils.d.ts → utils/common.d.ts} +2 -20
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/index.d.ts +3 -0
- package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
- package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +8 -8
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +22 -22
- package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +2 -2
- package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +2 -2
- package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
- package/nitrogen/generated/ios/Unistyles+autolinking.rb +5 -3
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +32 -32
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +0 -29
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +0 -12
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +134 -110
- package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
- package/package.json +4 -15
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +1 -1
- package/src/types/stylesheet.ts +1 -1
- package/src/web/convert/boxShadow.ts +14 -15
- package/src/web/convert/index.ts +6 -13
- package/src/web/convert/style.ts +61 -10
- package/src/web/convert/textShadow.ts +13 -14
- package/src/web/convert/transform.ts +7 -8
- package/src/web/{listener/listener.ts → listener.ts} +2 -2
- package/src/web/mq.ts +1 -3
- package/src/web/registry.ts +202 -23
- package/src/web/shadowRegistry.ts +49 -49
- package/src/web/state.ts +13 -23
- package/src/web/{utils.ts → utils/common.ts} +6 -68
- package/src/web/utils/index.ts +2 -0
- package/src/web/utils/unistyle.ts +104 -0
- package/lib/commonjs/web/convert/breakpoint.js +0 -25
- package/lib/commonjs/web/convert/breakpoint.js.map +0 -1
- package/lib/commonjs/web/createUnistylesComponent.js +0 -61
- package/lib/commonjs/web/createUnistylesComponent.js.map +0 -1
- package/lib/commonjs/web/listener/index.js +0 -20
- package/lib/commonjs/web/listener/index.js.map +0 -1
- package/lib/commonjs/web/listener/listenToDependencies.js +0 -38
- package/lib/commonjs/web/listener/listenToDependencies.js.map +0 -1
- package/lib/commonjs/web/listener/listener.js.map +0 -1
- package/lib/commonjs/web/pseudo.js.map +0 -1
- package/lib/commonjs/web/utils.js.map +0 -1
- package/lib/module/web/convert/breakpoint.js +0 -20
- package/lib/module/web/convert/breakpoint.js.map +0 -1
- package/lib/module/web/createUnistylesComponent.js +0 -54
- package/lib/module/web/createUnistylesComponent.js.map +0 -1
- package/lib/module/web/listener/index.js +0 -5
- package/lib/module/web/listener/index.js.map +0 -1
- package/lib/module/web/listener/listenToDependencies.js +0 -33
- package/lib/module/web/listener/listenToDependencies.js.map +0 -1
- package/lib/module/web/listener/listener.js.map +0 -1
- package/lib/module/web/pseudo.js.map +0 -1
- package/lib/module/web/utils.js.map +0 -1
- package/lib/typescript/src/web/convert/breakpoint.d.ts +0 -3
- package/lib/typescript/src/web/convert/breakpoint.d.ts.map +0 -1
- package/lib/typescript/src/web/createUnistylesComponent.d.ts +0 -3
- package/lib/typescript/src/web/createUnistylesComponent.d.ts.map +0 -1
- package/lib/typescript/src/web/listener/index.d.ts +0 -3
- package/lib/typescript/src/web/listener/index.d.ts.map +0 -1
- package/lib/typescript/src/web/listener/listenToDependencies.d.ts +0 -12
- package/lib/typescript/src/web/listener/listenToDependencies.d.ts.map +0 -1
- package/lib/typescript/src/web/listener/listener.d.ts.map +0 -1
- package/lib/typescript/src/web/pseudo.d.ts.map +0 -1
- package/lib/typescript/src/web/utils.d.ts.map +0 -1
- package/src/web/convert/breakpoint.ts +0 -21
- package/src/web/createUnistylesComponent.tsx +0 -54
- package/src/web/listener/index.ts +0 -2
- package/src/web/listener/listenToDependencies.ts +0 -45
- /package/lib/commonjs/web/{pseudo.js → convert/pseudo.js} +0 -0
- /package/lib/module/web/{pseudo.js → convert/pseudo.js} +0 -0
- /package/lib/typescript/src/web/{pseudo.d.ts → convert/pseudo.d.ts} +0 -0
- /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
- /package/src/web/{pseudo.ts → convert/pseudo.ts} +0 -0
@@ -149,3 +149,29 @@ core::DependencyMap core::UnistylesRegistry::buildDependencyMap(jsi::Runtime& rt
|
|
149
149
|
|
150
150
|
return dependencyMap;
|
151
151
|
}
|
152
|
+
|
153
|
+
std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyleSheetsToRefresh(jsi::Runtime& rt, bool themeDidChange, bool runtimeDidChange) {
|
154
|
+
std::vector<std::shared_ptr<core::StyleSheet>> stylesheetsToRefresh{};
|
155
|
+
|
156
|
+
if (!themeDidChange && !runtimeDidChange) {
|
157
|
+
return stylesheetsToRefresh;
|
158
|
+
}
|
159
|
+
|
160
|
+
auto& styleSheets = this->_styleSheetRegistry[&rt];
|
161
|
+
|
162
|
+
std::for_each(styleSheets.begin(), styleSheets.end(), [&](std::pair<int, std::shared_ptr<core::StyleSheet>> pair){
|
163
|
+
auto& [_, styleSheet] = pair;
|
164
|
+
|
165
|
+
if (styleSheet->type == StyleSheetType::ThemableWithMiniRuntime && runtimeDidChange) {
|
166
|
+
stylesheetsToRefresh.emplace_back(styleSheet);
|
167
|
+
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
|
171
|
+
if (styleSheet->type == StyleSheetType::Themable && themeDidChange) {
|
172
|
+
stylesheetsToRefresh.emplace_back(styleSheet);
|
173
|
+
}
|
174
|
+
});
|
175
|
+
|
176
|
+
return stylesheetsToRefresh;
|
177
|
+
}
|
@@ -36,6 +36,7 @@ struct UnistylesRegistry: public StyleSheetRegistry {
|
|
36
36
|
|
37
37
|
UnistylesState& getState(jsi::Runtime& rt);
|
38
38
|
void createState(jsi::Runtime& rt);
|
39
|
+
std::vector<std::shared_ptr<core::StyleSheet>> getStyleSheetsToRefresh(jsi::Runtime& rt, bool themeDidChange, bool runtimeDidChange);
|
39
40
|
void linkShadowNodeWithUnistyle(jsi::Runtime& rt, const ShadowNodeFamily*, std::vector<core::Unistyle::Shared>& unistyles, Variants& variants, std::vector<folly::dynamic>&);
|
40
41
|
void unlinkShadowNodeWithUnistyles(jsi::Runtime& rt, const ShadowNodeFamily*);
|
41
42
|
std::shared_ptr<core::StyleSheet> addStyleSheet(jsi::Runtime& rt, int tag, core::StyleSheetType type, jsi::Object&& rawValue);
|
@@ -9,7 +9,7 @@ double HybridStyleSheet::getHairlineWidth() {
|
|
9
9
|
return nearestPixel / pixelRatio;
|
10
10
|
}
|
11
11
|
|
12
|
-
double HybridStyleSheet::
|
12
|
+
double HybridStyleSheet::getUnid() {
|
13
13
|
return this->__unid;
|
14
14
|
}
|
15
15
|
|
@@ -223,18 +223,24 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
|
|
223
223
|
|
224
224
|
// check if color scheme changed and then if Unistyles state depend on it (adaptive themes)
|
225
225
|
auto colorSchemeIt = std::find(dependencies.begin(), dependencies.end(), UnistyleDependency::COLORSCHEME);
|
226
|
-
|
227
|
-
|
226
|
+
auto hasNewColorScheme = colorSchemeIt != dependencies.end();
|
227
|
+
|
228
|
+
// in a later step, we will rebuild only Unistyles with mounted StyleSheets
|
229
|
+
// however, user may have StyleSheets with components that haven't mounted yet
|
230
|
+
// we need to rebuild all dependent StyleSheets as well
|
231
|
+
auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, hasNewColorScheme, dependencies.size() > 1);
|
232
|
+
|
233
|
+
if (hasNewColorScheme) {
|
228
234
|
this->_unistylesRuntime->includeDependenciesForColorSchemeChange(dependencies);
|
229
235
|
}
|
230
|
-
|
236
|
+
|
231
237
|
auto dependencyMap = registry.buildDependencyMap(rt, dependencies);
|
232
238
|
|
233
239
|
if (dependencyMap.size() == 0) {
|
234
240
|
return;
|
235
241
|
}
|
236
242
|
|
237
|
-
parser.rebuildUnistylesInDependencyMap(rt, dependencyMap);
|
243
|
+
parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets);
|
238
244
|
|
239
245
|
// this is required, otherwise shadow tree will ignore Unistyles commit
|
240
246
|
registry.trafficController.setHasUnistylesCommit(true);
|
package/cxx/parser/Parser.cpp
CHANGED
@@ -99,9 +99,16 @@ void parser::Parser::rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_
|
|
99
99
|
}
|
100
100
|
|
101
101
|
// rebuild all unistyles that are affected by platform event
|
102
|
-
void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap) {
|
102
|
+
void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>> styleSheets) {
|
103
103
|
std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value> parsedStyleSheets{};
|
104
|
+
std::unordered_map<std::shared_ptr<core::Unistyle>, bool> parsedUnistyles{};
|
104
105
|
|
106
|
+
// parse all stylesheets that depends on changes
|
107
|
+
for (auto styleSheet : styleSheets) {
|
108
|
+
parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet));
|
109
|
+
}
|
110
|
+
|
111
|
+
// then parse all visible Unistyles
|
105
112
|
for (auto& [shadowNode, unistyles] : dependencyMap) {
|
106
113
|
auto styleSheet = unistyles.begin()->get()->unistyle->parent;
|
107
114
|
|
@@ -116,6 +123,10 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
116
123
|
// for RN styles or inline styles, compute styles only once
|
117
124
|
if (unistyle->styleKey == helpers::EXOTIC_STYLE_KEY.c_str() && !unistyleData->parsedStyle.has_value()) {
|
118
125
|
unistyleData->parsedStyle = jsi::Value(rt, unistyle->rawValue).asObject(rt);
|
126
|
+
|
127
|
+
if (!parsedUnistyles.contains(unistyle)) {
|
128
|
+
parsedUnistyles.emplace(unistyle, true);
|
129
|
+
}
|
119
130
|
|
120
131
|
continue;
|
121
132
|
}
|
@@ -128,6 +139,21 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
128
139
|
unistyle->rawValue = parsedStyleSheets[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
|
129
140
|
this->rebuildUnistyle(rt, styleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
|
130
141
|
unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
|
142
|
+
|
143
|
+
if (!parsedUnistyles.contains(unistyle)) {
|
144
|
+
parsedUnistyles.emplace(unistyle, true);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
// parse whatever left in StyleSheets
|
150
|
+
for (auto styleSheet : styleSheets) {
|
151
|
+
for (auto& [_, unistyle] : styleSheet->unistyles) {
|
152
|
+
if (!parsedUnistyles.contains(unistyle)) {
|
153
|
+
parsedUnistyles.emplace(unistyle, true);
|
154
|
+
unistyle->rawValue = parsedStyleSheets[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
|
155
|
+
this->rebuildUnistyle(rt, styleSheet, unistyle, {}, std::nullopt);
|
156
|
+
}
|
131
157
|
}
|
132
158
|
}
|
133
159
|
}
|
package/cxx/parser/Parser.h
CHANGED
@@ -24,7 +24,7 @@ struct Parser {
|
|
24
24
|
void buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
25
25
|
void parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
26
26
|
void rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants);
|
27
|
-
void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap);
|
27
|
+
void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>> styleSheets);
|
28
28
|
shadow::ShadowLeafUpdates dependencyMapToShadowLeafUpdates(core::DependencyMap& dependencyMap);
|
29
29
|
|
30
30
|
private:
|
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getBoxShadowStyle = void 0;
|
7
|
-
var _typestyle = require("typestyle");
|
8
7
|
var _utils = require("../utils");
|
9
8
|
var _shadow = require("./shadow");
|
10
|
-
var _breakpoint = require("./breakpoint");
|
11
9
|
var _types = require("./types");
|
12
10
|
var _utils2 = require("./utils");
|
13
11
|
const createBoxShadowValue = style => {
|
@@ -57,17 +55,19 @@ const getBoxShadowStyle = styles => {
|
|
57
55
|
} = (0, _utils2.extractShadowValue)('shadowOffset', breakpoint, styles);
|
58
56
|
const radius = (0, _utils2.extractShadowValue)('shadowRadius', breakpoint, styles);
|
59
57
|
const opacity = (0, _utils2.extractShadowValue)('shadowOpacity', breakpoint, styles);
|
60
|
-
return
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
58
|
+
return {
|
59
|
+
[breakpoint]: {
|
60
|
+
boxShadow: createBoxShadowValue({
|
61
|
+
shadowColor: color,
|
62
|
+
shadowOffset: {
|
63
|
+
width,
|
64
|
+
height
|
65
|
+
},
|
66
|
+
shadowRadius: radius,
|
67
|
+
shadowOpacity: opacity
|
68
|
+
})
|
69
|
+
}
|
70
|
+
};
|
71
71
|
});
|
72
72
|
|
73
73
|
// Merge all breakpoints styles into one
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_utils","require","_shadow","_types","_utils2","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","normalizeNumericValue","width","offsetY","height","radius","color","normalizeColor","getBoxShadowStyle","styles","missingStyles","BOX_SHADOW_STYLES","filter","key","length","warn","join","breakpointsSet","Set","validateShadow","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","extractShadowValue","opacity","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,MAAMI,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C;EACA,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CA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MAAMrB,KAAK,GAAG,IAAAsB,0BAAkB,EAAC,aAAa,EAAED,UAAU,EAAElB,MAAM,CAAC;IACnE,MAAM;MAAEP,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAAwB,0BAAkB,EAAC,cAAc,EAAED,UAAU,EAAElB,MAAM,CAAC;IAChF,MAAMJ,MAAM,GAAG,IAAAuB,0BAAkB,EAAC,cAAc,EAAED,UAAU,EAAElB,MAAM,CAAC;IACrE,MAAMoB,OAAO,GAAG,IAAAD,0BAAkB,EAAC,eAAe,EAAED,UAAU,EAAElB,MAAM,CAAC;IAEvE,OAAO;MACH,CAACkB,UAAU,GAAG;QACVH,SAAS,EAAE9B,oBAAoB,CAAC;UAC5BE,WAAW,EAAEU,KAAK;UAClBT,YAAY,EAAE;YACVK,KAAK;YACLE;UACJ,CAAC;UACDL,YAAY,EAAEM,MAAM;UACpBP,aAAa,EAAE+B;QACnB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAO,IAAAC,uBAAgB,EAAC,GAAGL,gBAAgB,CAAC;AAChD,CAAC;AAAAM,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
@@ -3,17 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
7
|
-
var
|
8
|
-
var _pseudo = require("../pseudo");
|
9
|
-
var _breakpoint = require("./breakpoint");
|
6
|
+
exports.convertUnistyles = void 0;
|
7
|
+
var _pseudo = require("./pseudo");
|
10
8
|
var _style = require("./style");
|
11
9
|
var _utils = require("../utils");
|
12
10
|
var _transform = require("./transform");
|
13
11
|
var _utils2 = require("./utils");
|
14
12
|
var _textShadow = require("./textShadow");
|
15
13
|
var _boxShadow = require("./boxShadow");
|
16
|
-
const
|
14
|
+
const convertUnistyles = value => {
|
17
15
|
// Flag to mark if textShadow is already created
|
18
16
|
let hasTextShadow = false;
|
19
17
|
// Flag to mark if boxShadow is already created
|
@@ -29,11 +27,9 @@ const convertToTypeStyle = value => {
|
|
29
27
|
|
30
28
|
// Pseudo classes :hover, :before etc.
|
31
29
|
if ((0, _pseudo.isPseudo)(unistylesKey)) {
|
32
|
-
const
|
30
|
+
const flattenValues = convertUnistyles(unistylesValue);
|
33
31
|
return {
|
34
|
-
|
35
|
-
[unistylesKey.replace('_', '&:')]: typestyleValues
|
36
|
-
}
|
32
|
+
[unistylesKey]: flattenValues
|
37
33
|
};
|
38
34
|
}
|
39
35
|
|
@@ -63,7 +59,9 @@ const convertToTypeStyle = value => {
|
|
63
59
|
// Breakpoints
|
64
60
|
if (typeof unistylesValue === 'object' && unistylesValue !== null) {
|
65
61
|
return Object.entries(unistylesValue).map(([breakpointKey, breakpointValue]) => {
|
66
|
-
return
|
62
|
+
return {
|
63
|
+
[breakpointKey]: (0, _style.getStyle)(unistylesKey, breakpointValue)
|
64
|
+
};
|
67
65
|
});
|
68
66
|
}
|
69
67
|
|
@@ -72,5 +70,5 @@ const convertToTypeStyle = value => {
|
|
72
70
|
});
|
73
71
|
return (0, _utils.deepMergeObjects)(...stylesArray);
|
74
72
|
};
|
75
|
-
exports.
|
73
|
+
exports.convertUnistyles = convertUnistyles;
|
76
74
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_pseudo","require","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertUnistyles","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","isPseudo","flattenValues","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OA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E;MAC3C,OAAO,IAAAU,4BAAiB,EAACV,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACW,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO;UAAE,CAACD,aAAa,GAAG,IAAAE,eAAQ,EAACf,YAAY,EAAEc,eAAe;QAAE,CAAC;MACvE,CAAC,CAAC;IACN;;IAEA;IACA,OAAO,IAAAC,eAAQ,EAACf,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAO,IAAAe,uBAAgB,EAAC,GAAGrB,WAAW,CAAC;AAC3C,CAAC;AAAAsB,OAAA,CAAA1B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["pseudos","exports","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../../src","sources":["web/convert/pseudo.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,CACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,gBAAg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D,MAAM,CAAC,CAAC;AAAAJ,OAAA,CAAAC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.getStyle = void 0;
|
7
7
|
var _utils = require("../utils");
|
8
|
-
const
|
8
|
+
const SKIP_STYLES = ['borderCurve', 'elevation', 'textAlignVertical', 'includeFontPadding', 'overlayColor', 'tintColor'];
|
9
|
+
const CSS_NUMBER_KEYS = ['animationIterationCount', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'columns', 'counterIncrement', 'counterReset', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'fontWeight', 'gridArea', 'gridColumn', 'gridColumnEnd', 'gridColumnSpan', 'gridColumnStart', 'gridRow', 'gridRowEnd', 'gridRowSpan', 'gridRowStart', 'line-clamp', 'line-height', 'opacity', 'order', 'orphans', 'tabSize', 'widows', 'zIndex', 'zoom', 'fillOpacity', 'floodOpacity', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth'];
|
9
10
|
const convertMap = {
|
10
11
|
marginHorizontal: value => ({
|
11
12
|
marginInline: value
|
@@ -69,20 +70,23 @@ const convertMap = {
|
|
69
70
|
}),
|
70
71
|
resizeMode: value => ({
|
71
72
|
backgroundSize: value
|
72
|
-
}),
|
73
|
-
lineHeight: value => ({
|
74
|
-
lineHeight: `${value}px`
|
75
73
|
})
|
76
74
|
};
|
75
|
+
const convertNumber = (key, value) => {
|
76
|
+
if (typeof value === 'number') {
|
77
|
+
return CSS_NUMBER_KEYS.includes(key, value) ? value : `${value}px`;
|
78
|
+
}
|
79
|
+
return value;
|
80
|
+
};
|
77
81
|
const getStyle = (key, value) => {
|
78
|
-
if (
|
82
|
+
if (SKIP_STYLES.includes(key)) {
|
79
83
|
return {};
|
80
84
|
}
|
81
85
|
if ((0, _utils.keyInObject)(convertMap, key)) {
|
82
|
-
return convertMap[key]?.(value) ?? {};
|
86
|
+
return convertMap[key]?.(convertNumber(key, value)) ?? {};
|
83
87
|
}
|
84
88
|
return {
|
85
|
-
[key]: value
|
89
|
+
[key]: convertNumber(key, value)
|
86
90
|
};
|
87
91
|
};
|
88
92
|
exports.getStyle = getStyle;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_utils","require","
|
1
|
+
{"version":3,"names":["_utils","require","SKIP_STYLES","CSS_NUMBER_KEYS","convertMap","marginHorizontal","value","marginInline","marginVertical","marginBlock","paddingHorizontal","paddingInline","paddingVertical","paddingBlock","writingDirection","direction","borderBottomEndRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomLeftRadius","borderEndColor","borderInlineEndColor","borderStartColor","borderInlineStartColor","borderTopEndRadius","borderTopRightRadius","borderTopStartRadius","borderTopLeftRadius","borderEndWidth","borderInlineEndWidth","borderStartWidth","borderInlineStartWidth","end","right","start","left","marginEnd","marginRight","marginStart","marginLeft","paddingEnd","paddingRight","paddingStart","paddingLeft","transformMatrix","transform","join","resizeMode","backgroundSize","convertNumber","key","includes","getStyle","keyInObject","exports"],"sourceRoot":"../../../../src","sources":["web/convert/style.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,WAAW,GAAG,CAChB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,WAAW,CACd;AAED,MAAMC,eAAe,GAAG,CACpB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,EA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AAC,CAAC,IAAI,CAAC,CAAC;EAC7D;EAEA,OAAO;IACH,CAAC4C,GAAG,GAAGD,aAAa,CAACC,GAAG,EAAE5C,KAAK;EACnC,CAAC;AACL,CAAC;AAAAgD,OAAA,CAAAF,QAAA,GAAAA,QAAA","ignoreList":[]}
|
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getTextShadowStyle = void 0;
|
7
|
-
var _typestyle = require("typestyle");
|
8
7
|
var _utils = require("../utils");
|
9
8
|
var _shadow = require("./shadow");
|
10
|
-
var _breakpoint = require("./breakpoint");
|
11
9
|
var _types = require("./types");
|
12
10
|
var _utils2 = require("./utils");
|
13
11
|
const createTextShadowValue = style => {
|
@@ -54,16 +52,18 @@ const getTextShadowStyle = styles => {
|
|
54
52
|
height
|
55
53
|
} = (0, _utils2.extractShadowValue)('textShadowOffset', breakpoint, styles);
|
56
54
|
const radius = (0, _utils2.extractShadowValue)('textShadowRadius', breakpoint, styles);
|
57
|
-
return
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
55
|
+
return {
|
56
|
+
[breakpoint]: {
|
57
|
+
textShadow: createTextShadowValue({
|
58
|
+
textShadowColor: color,
|
59
|
+
textShadowOffset: {
|
60
|
+
width,
|
61
|
+
height
|
62
|
+
},
|
63
|
+
textShadowRadius: radius
|
64
|
+
})
|
65
|
+
}
|
66
|
+
};
|
67
67
|
});
|
68
68
|
|
69
69
|
// Merge all breakpoints styles into one
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_utils","require","_shadow","_types","_utils2","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","normalizeNumericValue","width","offsetY","height","radius","color","normalizeColor","getTextShadowStyle","styles","missingStyles","TEXT_SHADOW_STYLES","filter","key","length","warn","join","breakpointsSet","Set","validateShadow","error","breakpoints","Array","from","textShadow","breakpointStyles","map","breakpoint","extractShadowValue","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/textShadow.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,MAAMI,qBAAqB,GAAIC,KAAiB,IAAK;EACjD,MAAM;IAAEC,eAAe;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAGH,KAAK;EACrE,MAAMI,OAAO,GAAG,IAAAC,6BAAqB,EAACH,gBAAgB,CAACI,KAAK,CAAC;EAC7D,MAAMC,OAAO,GAAG,IAAAF,6BAAqB,EAACH,gBAAgB,CAACM,MAAM,CAAC;EAC9D,MAAMC,MAAM,GAAG,IAAAJ,6BAAqB,EAACF,gBAAgB,CAAC;EACtD,MAAMO,KAAK,GAAG,IAAAC,sBAAc,EAACV,eAAyB,CAAC;EAEvD,OAAO,GAAGG,OAAO,IAAIG,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAEM,MAAME,kBAAkB,GAAIC,MAA2B,IAAK;EAC/D,MAAMC,aAAa,GAAGC,yBAAkB,CAACC,MAAM,CAACC,GAAG,IAAI,EAAEA,GAAG,IAAIJ,MAAM,CAAC,CAAC;EAExE,IAAIC,aAAa,CAACI,MAAM,EAAE;IACtB,IAAAC,WAAI,EAAC,yDAAyDL,aAAa,CAACM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAEzF,OAAO,CAAC,CAAC;EACb;EAEA,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAS,CAAC;EAExC,IAAI;IACA,IAAAC,sBAAc,EAACR,yBAAkB,EAAEF,MAAM,EAAEQ,cAAc,CAAC;EAC9D,CAAC,CAAC,OAAOG,KAAK,EAAE;IACZ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MAC3B,IAAAL,WAAI,EAACK,KAAK,CAAC;IACf;IAEA,OAAO,CAAC,CAAC;EACb;EAEA,MAAMC,WAAW,GAAGC,KAAK,CAACC,IAAI,CAACN,cAAc,CAAC;;EAE9C;EACA,IAAII,WAAW,CAACP,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHU,UAAU,EAAE7B,qBAAqB,CAACc,MAAoB;IAC1D,CAAC;EACL;;EAEA;EACA,MAAMgB,gBAAgB,GAAGJ,WAAW,CAACK,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMrB,KAAK,GAAG,IAAAsB,0BAAkB,EAAC,iBAAiB,EAAED,UAAU,EAAElB,MAAM,CAAC;IACvE,MAAM;MAAEP,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAAwB,0BAAkB,EAAC,kBAAkB,EAAED,UAAU,EAAElB,MAAM,CAAC;IACpF,MAAMJ,MAAM,GAAG,IAAAuB,0BAAkB,EAAC,kBAAkB,EAAED,UAAU,EAAElB,MAAM,CAAC;IAEzE,OAAO;MACH,CAACkB,UAAU,GAAG;QACVH,UAAU,EAAE7B,qBAAqB,CAAC;UAC9BE,eAAe,EAAES,KAAK;UACtBR,gBAAgB,EAAE;YACdI,KAAK;YACLE;UACJ,CAAC;UACDL,gBAAgB,EAAEM;QACtB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAO,IAAAwB,uBAAgB,EAAC,GAAGJ,gBAAgB,CAAC;AAChD,CAAC;AAAAK,OAAA,CAAAtB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getTransformStyle = void 0;
|
7
|
-
var _typestyle = require("typestyle");
|
8
7
|
var _utils = require("../utils");
|
9
8
|
var _utils2 = require("./utils");
|
10
|
-
var _breakpoint = require("./breakpoint");
|
11
9
|
const normalizeTransform = (key, value) => {
|
12
10
|
if (key.includes('scale')) {
|
13
11
|
return value;
|
@@ -60,9 +58,11 @@ const getTransformStyle = transforms => {
|
|
60
58
|
}
|
61
59
|
return [];
|
62
60
|
});
|
63
|
-
return
|
64
|
-
|
65
|
-
|
61
|
+
return [{
|
62
|
+
[breakpoint]: {
|
63
|
+
transform: createTransformValue(transformsPerBreakpoint)
|
64
|
+
}
|
65
|
+
}];
|
66
66
|
});
|
67
67
|
return (0, _utils.deepMergeObjects)({
|
68
68
|
transform: createTransformValue(normalTransforms)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_utils","require","_utils2","normalizeTransform","key","value","includes","normalizeNumericValue","createTransformValue","transforms","map","transform","Object","keys","undefined","join","filter","Boolean","getTransformStyle","breakpoints","Set","normalTransforms","forEach","property","Array","isArray","breakpoint","add","push","breakpointTransforms","from","flatMap","transformsPerBreakpoint","keyInObject","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/transform.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAIA,MAAME,kBAAkB,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAK;EACpD,IAAID,GAAG,CAACE,QAAQ,CAAC,OAAO,CAAC,EAAE;IACvB,OAAOD,KAAK;EAChB;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAO,IAAAE,6BAAqB,EAACF,KAAK,CAAC;EACvC;EAEA,OAAOA,KAAK;AAChB,CAAC;AAED,MAAMG,oBAAoB,GAAIC,UAAsB,IAAKA,UAAU,CAC9DC,GAAG,CAACC,SAAS,IAAI;EACd,MAAM,CAACP,GAAG,CAAC,GAAGQ,MAAM,CAACC,IAAI,CAACF,SAAS,CAAC;EAEpC,IAAI,CAACP,GAAG,EAAE;IACN,OAAOU,SAAS;EACpB;EAEA,MAAMT,KAAK,GAAGM,SAAS,CAACP,GAAG,CAAC;EAE5B,QAAO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B,KAAK,GAAGM,SAAS,CAACY,QAAQ,CAAC;MAEjC,IAAI,OAAOlB,KAAK,KAAK,QAAQ,IAAI,CAACmB,KAAK,CAACC,OAAO,CAACpB,KAAK,CAAC,EAAE;QACpD,OAAO,IAAA4B,kBAAW,EAAC5B,KAAK,EAAEqB,UAAU,CAAC,GAAG,CAAC;UAAE,CAACH,QAAQ,GAAGlB,KAAK,CAACqB,UAAU;QAAE,CAAC,CAAC,GAAG,EAAE;MACpF;MAEA,OAAO,EAAE;IACb,CAAC,CAAC;IAEF,OAAO,CAAC;MACJ,CAACA,UAAU,GAAG;QACVf,SAAS,EAAEH,oBAAoB,CAACwB,uBAAuB;MAC3D;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAO,IAAAE,uBAAgB,EAAsB;IACzCvB,SAAS,EAAEH,oBAAoB,CAACa,gBAAgB;EACpD,CAAC,EAAE,GAAGQ,oBAAoB,CAAC;AAC/B,CAAC;AAAAM,OAAA,CAAAjB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.UnistylesListener = void 0;
|
7
|
-
var _NativePlatform = require("
|
8
|
-
var _runtime = require("
|
7
|
+
var _NativePlatform = require("../specs/NativePlatform");
|
8
|
+
var _runtime = require("./runtime");
|
9
9
|
class UnistylesListenerBuilder {
|
10
10
|
isInitialized = false;
|
11
11
|
listeners = Array.from({
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_NativePlatform","require","_runtime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","UnistyleDependency","Set","emitChange","dependency","forEach","listener","initListeners","UnistylesRuntime","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","UnistylesListener","exports"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAA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,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEe,MAAM,CAACb,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;AACL;AAEO,MAAMc,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAI3B,wBAAwB,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","parseMq","mq","width","fromW","toW","exec","height","fromH","toH","minWidth","undefined","Number","maxWidth","minHeight","maxHeight","exports","isUnistylesMq","test"],"sourceRoot":"../../../src","sources":["web/mq.ts"],"mappings":";;;;;;
|
1
|
+
{"version":3,"names":["IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","parseMq","mq","width","fromW","toW","exec","height","fromH","toH","minWidth","undefined","Number","maxWidth","minHeight","maxHeight","exports","isUnistylesMq","test"],"sourceRoot":"../../../src","sources":["web/mq.ts"],"mappings":";;;;;;AAAA,MAAMA,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAE7D,MAAMC,OAAO,GAAIC,EAAU,IAAK;EACnC,MAAM,GAAGC,KAAK,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGN,qBAAqB,CAACO,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAClE,MAAM,GAAGK,MAAM,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGT,sBAAsB,CAACM,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAEpE,OAAO;IACHQ,QAAQ,EAAE,CAACP,KAAK,IAAIC,KAAK,KAAK,UAAU,GAAGO,SAAS,GAAGC,MAAM,CAACR,KAAK,CAAC;IACpES,QAAQ,EAAE,CAACV,KAAK,IAAIE,GAAG,KAAK,UAAU,GAAGM,SAAS,GAAGC,MAAM,CAACP,GAAG,CAAC;IAChES,SAAS,EAAE,CAACP,MAAM,IAAIC,KAAK,KAAK,UAAU,GAAGG,SAAS,GAAGC,MAAM,CAACJ,KAAK,CAAC;IACtEO,SAAS,EAAE,CAACR,MAAM,IAAIE,GAAG,KAAK,UAAU,GAAGE,SAAS,GAAGC,MAAM,CAACH,GAAG;EACrE,CAAC;AACL,CAAC;AAAAO,OAAA,CAAAf,OAAA,GAAAA,OAAA;AAEM,MAAMgB,aAAa,GAAIf,EAAU,IAAKJ,kBAAkB,CAACoB,IAAI,CAAChB,EAAE,CAAC;AAAAc,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
|