react-native-unistyles 3.0.0-alpha.21 → 3.0.0-alpha.22
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/hybridObjects/HybridStyleSheet.cpp +1 -1
- package/cxx/hybridObjects/HybridStyleSheet.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
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.UnistylesShadowRegistry = void 0;
|
7
|
-
var _listener = require("./listener");
|
8
7
|
var _registry = require("./registry");
|
9
8
|
var _utils = require("./utils");
|
10
9
|
var _variants2 = require("./variants");
|
@@ -17,9 +16,8 @@ class UnistylesShadowRegistryBuilder {
|
|
17
16
|
dispose = () => {};
|
18
17
|
// END MOCKS
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
stylesMap = (0, _utils.createDoubleMap)();
|
19
|
+
resultsMap = (0, _utils.createDoubleMap)();
|
20
|
+
classNamesMap = (0, _utils.createDoubleMap)();
|
23
21
|
add = (ref, _style, _variants, _args) => {
|
24
22
|
// Style is not provided
|
25
23
|
if (!_style) {
|
@@ -41,13 +39,19 @@ class UnistylesShadowRegistryBuilder {
|
|
41
39
|
if (ref === null) {
|
42
40
|
const secrets = (0, _utils.extractSecrets)(_style);
|
43
41
|
secrets.forEach(({
|
44
|
-
__uni__refs
|
42
|
+
__uni__refs,
|
43
|
+
__uni__key
|
45
44
|
}) => {
|
46
45
|
__uni__refs.forEach(ref => {
|
47
46
|
if ((0, _utils.isInDocument)(ref)) {
|
48
47
|
return;
|
49
48
|
}
|
50
|
-
this.
|
49
|
+
const oldResult = this.resultsMap.get(ref, __uni__key);
|
50
|
+
this.resultsMap.delete(ref, __uni__key);
|
51
|
+
this.classNamesMap.delete(ref, __uni__key);
|
52
|
+
if (oldResult) {
|
53
|
+
_registry.UnistylesRegistry.remove(oldResult);
|
54
|
+
}
|
51
55
|
});
|
52
56
|
});
|
53
57
|
return;
|
@@ -61,63 +65,61 @@ class UnistylesShadowRegistryBuilder {
|
|
61
65
|
const {
|
62
66
|
__uni__key,
|
63
67
|
__uni__stylesheet,
|
64
|
-
__uni__refs,
|
65
68
|
__uni__variants,
|
66
|
-
__uni__args = []
|
69
|
+
__uni__args = [],
|
70
|
+
__uni__refs
|
67
71
|
} = secret;
|
68
72
|
const newComputedStylesheet = _registry.UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
|
69
73
|
const style = newComputedStylesheet[__uni__key];
|
70
74
|
const args = _args ?? __uni__args;
|
71
|
-
const
|
72
|
-
const result =
|
75
|
+
const variants = _variants && Object.keys(_variants).length > 0 ? _variants : __uni__variants;
|
76
|
+
const result = typeof style === 'function' ? style(...args) : style;
|
73
77
|
const {
|
74
|
-
|
78
|
+
variantsResult
|
75
79
|
} = Object.fromEntries((0, _variants2.getVariants)({
|
76
|
-
|
77
|
-
},
|
80
|
+
variantsResult: result
|
81
|
+
}, variants));
|
78
82
|
const resultWithVariants = {
|
79
83
|
...result,
|
80
|
-
...
|
84
|
+
...variantsResult
|
81
85
|
};
|
82
|
-
const
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
86
|
+
const oldResult = this.resultsMap.get(ref, __uni__key);
|
87
|
+
|
88
|
+
// If results are the same do nothing
|
89
|
+
if ((0, _utils.equal)(oldResult, resultWithVariants)) {
|
90
|
+
return;
|
91
|
+
}
|
92
|
+
const oldClassNames = this.classNamesMap.get(ref, __uni__key);
|
93
|
+
|
94
|
+
// Remove old styles
|
95
|
+
if (oldResult) {
|
96
|
+
_registry.UnistylesRegistry.remove(oldResult);
|
97
|
+
}
|
98
|
+
|
99
|
+
// Remove old classnames from the ref
|
100
|
+
oldClassNames?.forEach(className => ref.classList.remove(className));
|
101
|
+
this.resultsMap.set(ref, __uni__key, resultWithVariants);
|
102
|
+
const className = _registry.UnistylesRegistry.add({
|
87
103
|
key: __uni__key,
|
88
|
-
stylesheet: __uni__stylesheet,
|
89
104
|
args,
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
webUnistyle.unistyles.setStylesTarget(styleTag);
|
101
|
-
document.head.appendChild(styleTag);
|
102
|
-
__uni__refs.add(ref);
|
103
|
-
this.stylesMap.set(ref, __uni__key, styleTag);
|
104
|
-
}
|
105
|
-
if (storedWebUnistyle) {
|
106
|
-
_registry.UnistylesRegistry.updateStyles(webUnistyle.unistyles, resultWithVariants, webUnistyle.className);
|
105
|
+
stylesheet: __uni__stylesheet,
|
106
|
+
value: resultWithVariants,
|
107
|
+
variants
|
108
|
+
});
|
109
|
+
const injectedClassNames = resultWithVariants?._web?._classNames ?? [];
|
110
|
+
const newClassNames = injectedClassNames.concat(className);
|
111
|
+
const dependencies = (0, _utils.extractUnistyleDependencies)(resultWithVariants);
|
112
|
+
if (typeof __uni__stylesheet === 'function') {
|
113
|
+
// Add dependencies from dynamic styles to stylesheet
|
114
|
+
_registry.UnistylesRegistry.addDependenciesToStylesheet(__uni__stylesheet, dependencies);
|
107
115
|
}
|
116
|
+
__uni__refs.add(ref);
|
117
|
+
this.classNamesMap.set(ref, __uni__key, newClassNames);
|
118
|
+
// Add new classnames to the ref
|
119
|
+
ref.classList.add(...newClassNames);
|
108
120
|
});
|
109
121
|
};
|
110
|
-
remove = (
|
111
|
-
(0, _utils.extractSecrets)(style).forEach(({
|
112
|
-
__uni__key
|
113
|
-
}) => {
|
114
|
-
this.webUnistylesMap.delete(ref, __uni__key);
|
115
|
-
this.disposeMap.get(ref, __uni__key)?.();
|
116
|
-
this.disposeMap.delete(ref, __uni__key);
|
117
|
-
this.stylesMap.get(ref, __uni__key)?.remove();
|
118
|
-
this.stylesMap.delete(ref, __uni__key);
|
119
|
-
});
|
120
|
-
};
|
122
|
+
remove = () => {};
|
121
123
|
}
|
122
124
|
const UnistylesShadowRegistry = exports.UnistylesShadowRegistry = new UnistylesShadowRegistryBuilder();
|
123
125
|
//# sourceMappingURL=shadowRegistry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_registry","require","_utils","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","createDoubleMap","classNamesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","extractSecrets","__uni__refs","__uni__key","isInDocument","oldResult","get","delete","UnistylesRegistry","remove","HTMLElement","secret","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","args","variants","length","result","variantsResult","fromEntries","getVariants","resultWithVariants","equal","oldClassNames","className","classList","set","stylesheet","value","injectedClassNames","_web","_classNames","newClassNames","concat","dependencies","extractUnistyleDependencies","addDependenciesToStylesheet","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry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C,GAAGiD,aAAa,CAAC;IACvC,CAAC,CAAC;EACN,CAAC;EAED1B,MAAM,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB;AAEO,MAAM+B,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAI/D,8BAA8B,CAAC,CAAC","ignoreList":[]}
|
@@ -9,14 +9,18 @@ var _utils = require("./utils");
|
|
9
9
|
var _listener = require("./listener");
|
10
10
|
var _NativePlatform = require("../specs/NativePlatform");
|
11
11
|
class UnistylesStateBuilder {
|
12
|
-
isSSR = (0, _utils.isServer)();
|
13
12
|
themes = new Map();
|
13
|
+
matchingBreakpoints = new Map();
|
14
|
+
get breakpoint() {
|
15
|
+
const [currentBreakpoint] = Array.from(this.matchingBreakpoints).reverse().find(([_key, value]) => value) ?? [];
|
16
|
+
return currentBreakpoint;
|
17
|
+
}
|
14
18
|
hasAdaptiveThemes = false;
|
15
19
|
init = config => {
|
16
20
|
this.initThemes(config.themes);
|
17
21
|
this.initBreakpoints(config.breakpoints);
|
18
22
|
this.initSettings(config.settings);
|
19
|
-
if (
|
23
|
+
if ((0, _utils.isServer)()) {
|
20
24
|
return;
|
21
25
|
}
|
22
26
|
_listener.UnistylesListener.initListeners();
|
@@ -51,27 +55,15 @@ class UnistylesStateBuilder {
|
|
51
55
|
this.themeName = typeof settings.initialTheme === 'function' ? settings.initialTheme() : settings.initialTheme;
|
52
56
|
};
|
53
57
|
initBreakpoints = (breakpoints = {}) => {
|
54
|
-
const breakpointsMap = new Map();
|
55
58
|
this.breakpoints = breakpoints;
|
56
59
|
Object.entries(breakpoints).sort(([, a], [, b]) => a - b).forEach(([breakpoint, value]) => {
|
57
60
|
if ((0, _utils.isServer)()) {
|
58
61
|
return;
|
59
62
|
}
|
60
63
|
const mediaQuery = window.matchMedia(`(min-width: ${value}px)`);
|
61
|
-
|
62
|
-
if (mediaQuery.matches) {
|
63
|
-
this.breakpoint = breakpoint;
|
64
|
-
}
|
64
|
+
this.matchingBreakpoints.set(breakpoint, mediaQuery.matches);
|
65
65
|
mediaQuery.addEventListener('change', event => {
|
66
|
-
|
67
|
-
const [currentBreakpoint] = Array.from(breakpointsMap).find(([, mq]) => mq.matches) ?? [];
|
68
|
-
if (currentBreakpoint) {
|
69
|
-
this.breakpoint = currentBreakpoint;
|
70
|
-
_listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.Breakpoints);
|
71
|
-
}
|
72
|
-
return;
|
73
|
-
}
|
74
|
-
this.breakpoint = breakpoint;
|
66
|
+
this.matchingBreakpoints.set(breakpoint, event.matches);
|
75
67
|
_listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.Breakpoints);
|
76
68
|
});
|
77
69
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_runtime","require","_utils","_listener","_NativePlatform","UnistylesStateBuilder","
|
1
|
+
{"version":3,"names":["_runtime","require","_utils","_listener","_NativePlatform","UnistylesStateBuilder","themes","Map","matchingBreakpoints","breakpoint","currentBreakpoint","Array","from","reverse","find","_key","value","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","isServer","UnistylesListener","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","keys","initialTheme","length","Error","schemeToTheme","UnistylesRuntime","colorScheme","sort","a","b","mediaQuery","window","matchMedia","matches","addEventListener","event","emitChange","UnistyleDependency","Breakpoints","UnistylesState","exports"],"sourceRoot":"../../../src","sources":["web/state.ts"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,MAAMI,qBAAqB,CAAC;EACxBC,MAAM,GAAG,IAAIC,GAAG,CAAyB,CAAC;EAGlCC,mBAAmB,GAAG,IAAID,GAAG,CAAkB,CAAC;EAExD,IAAIE,UAAUA,CAAA,EAAG;IACb,MAAM,CAACC,iBAAiB,CAAC,G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AAG,IAAIlD,qBAAqB,CAAC,CAAC","ignoreList":[]}
|
@@ -3,24 +3,11 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.warn = exports.
|
7
|
-
var _types = require("../specs/types");
|
6
|
+
exports.warn = exports.reduceObject = exports.keyInObject = exports.isServer = exports.generateHash = exports.equal = exports.deepMergeObjects = exports.createDoubleMap = void 0;
|
8
7
|
const reduceObject = (obj, reducer) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, reducer(value, key)]));
|
9
8
|
exports.reduceObject = reduceObject;
|
10
9
|
const keyInObject = (obj, key) => key in obj;
|
11
10
|
exports.keyInObject = keyInObject;
|
12
|
-
const schemeToTheme = scheme => {
|
13
|
-
switch (scheme) {
|
14
|
-
case _types.ColorScheme.Dark:
|
15
|
-
return 'dark';
|
16
|
-
case _types.ColorScheme.Light:
|
17
|
-
default:
|
18
|
-
return 'light';
|
19
|
-
}
|
20
|
-
};
|
21
|
-
exports.schemeToTheme = schemeToTheme;
|
22
|
-
const hexToRGBA = (hex, opacity) => hex.replace('#', '').split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num)).reduce((acc, color) => `${acc}${color},`, 'rgba(').concat(`${opacity})`);
|
23
|
-
exports.hexToRGBA = hexToRGBA;
|
24
11
|
const isServer = () => typeof window === 'undefined';
|
25
12
|
|
26
13
|
/**
|
@@ -62,32 +49,14 @@ const equal = (a, b) => {
|
|
62
49
|
return keysA.every(key => Object.is(a[key], b[key]) && Object.prototype.hasOwnProperty.call(b, key));
|
63
50
|
};
|
64
51
|
exports.equal = equal;
|
65
|
-
const
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
const extractSecrets = object => {
|
72
|
-
const secrets = Object.entries(object).reduce((acc, [key, value]) => {
|
73
|
-
if (key.startsWith('__uni__secrets__')) {
|
74
|
-
acc.push(value);
|
75
|
-
}
|
76
|
-
return acc;
|
77
|
-
}, []);
|
78
|
-
return secrets;
|
79
|
-
};
|
80
|
-
exports.extractSecrets = extractSecrets;
|
81
|
-
const getStyles = values => {
|
82
|
-
const returnValue = {};
|
83
|
-
Object.defineProperties(returnValue, reduceObject(values, value => ({
|
84
|
-
value,
|
85
|
-
enumerable: false,
|
86
|
-
configurable: true
|
87
|
-
})));
|
88
|
-
return returnValue;
|
52
|
+
const generateHash = value => {
|
53
|
+
const str = JSON.stringify(value);
|
54
|
+
let hasher = 5381;
|
55
|
+
let length = str.length;
|
56
|
+
while (length--) hasher = hasher * 33 ^ str.charCodeAt(length);
|
57
|
+
return `unistyles-${(hasher >>> 0).toString(36)}`;
|
89
58
|
};
|
90
|
-
exports.
|
59
|
+
exports.generateHash = generateHash;
|
91
60
|
const createDoubleMap = () => {
|
92
61
|
const map = new Map();
|
93
62
|
return {
|
@@ -120,11 +89,4 @@ const createDoubleMap = () => {
|
|
120
89
|
};
|
121
90
|
};
|
122
91
|
exports.createDoubleMap = createDoubleMap;
|
123
|
-
|
124
|
-
const hiddenProperties = Object.getOwnPropertyNames(object);
|
125
|
-
return Object.fromEntries(hiddenProperties.filter(key => !key.startsWith('__uni__')).map(key => [key, object[key]]));
|
126
|
-
};
|
127
|
-
exports.extractHiddenProperties = extractHiddenProperties;
|
128
|
-
const isInDocument = element => document.body.contains(element);
|
129
|
-
exports.isInDocument = isInDocument;
|
130
|
-
//# sourceMappingURL=utils.js.map
|
92
|
+
//# sourceMappingURL=common.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","exports","keyInObject","isServer","window","deepMergeObjects","sources","target","forEach","source","keys","sourceValue","targetValue","warn","message","console","equal","a","b","is","keysA","length","every","prototype","hasOwnProperty","call","generateHash","str","JSON","stringify","hasher","charCodeAt","toString","createDoubleMap","Map","get","secondKey","mapForKey","undefined","set","delete","callback"],"sourceRoot":"../../../../src","sources":["web/utils/common.ts"],"mapp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ACN,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAAAC,OAAA,CAAAgC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
var _common = require("./common");
|
7
|
+
Object.keys(_common).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _common[key]) return;
|
10
|
+
Object.defineProperty(exports, key, {
|
11
|
+
enumerable: true,
|
12
|
+
get: function () {
|
13
|
+
return _common[key];
|
14
|
+
}
|
15
|
+
});
|
16
|
+
});
|
17
|
+
var _unistyle = require("./unistyle");
|
18
|
+
Object.keys(_unistyle).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (key in exports && exports[key] === _unistyle[key]) return;
|
21
|
+
Object.defineProperty(exports, key, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function () {
|
24
|
+
return _unistyle[key];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
28
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_common","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_unistyle"],"sourceRoot":"../../../../src","sources":["web/utils/index.ts"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,SAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,SAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,SAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,SAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.schemeToTheme = exports.isInDocument = exports.hexToRGBA = exports.getStyles = exports.getMediaQuery = exports.extractUnistyleDependencies = exports.extractSecrets = exports.extractMediaQueryValue = exports.assignSecrets = void 0;
|
7
|
+
var _types = require("../../specs/types");
|
8
|
+
var _mq = require("../mq");
|
9
|
+
var _state = require("../state");
|
10
|
+
var _common = require("./common");
|
11
|
+
const schemeToTheme = scheme => {
|
12
|
+
switch (scheme) {
|
13
|
+
case _types.ColorScheme.Dark:
|
14
|
+
return 'dark';
|
15
|
+
case _types.ColorScheme.Light:
|
16
|
+
default:
|
17
|
+
return 'light';
|
18
|
+
}
|
19
|
+
};
|
20
|
+
exports.schemeToTheme = schemeToTheme;
|
21
|
+
const hexToRGBA = (hex, opacity) => hex.replace('#', '').split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num)).reduce((acc, color) => `${acc}${color},`, 'rgba(').concat(`${opacity})`);
|
22
|
+
exports.hexToRGBA = hexToRGBA;
|
23
|
+
const assignSecrets = (object, secrets) => {
|
24
|
+
// @ts-expect-error - assign secrets to object
|
25
|
+
object[`__uni__secrets__${Math.random().toString(16).slice(2)}`] = secrets;
|
26
|
+
return object;
|
27
|
+
};
|
28
|
+
exports.assignSecrets = assignSecrets;
|
29
|
+
const extractSecrets = object => {
|
30
|
+
const secrets = Object.entries(object).reduce((acc, [key, value]) => {
|
31
|
+
if (key.startsWith('__uni__secrets__')) {
|
32
|
+
acc.push(value);
|
33
|
+
}
|
34
|
+
return acc;
|
35
|
+
}, []);
|
36
|
+
return secrets;
|
37
|
+
};
|
38
|
+
exports.extractSecrets = extractSecrets;
|
39
|
+
const getStyles = values => {
|
40
|
+
const returnValue = {};
|
41
|
+
Object.defineProperties(returnValue, (0, _common.reduceObject)(values, value => ({
|
42
|
+
value,
|
43
|
+
enumerable: false,
|
44
|
+
configurable: true
|
45
|
+
})));
|
46
|
+
return returnValue;
|
47
|
+
};
|
48
|
+
exports.getStyles = getStyles;
|
49
|
+
const isInDocument = element => document.body.contains(element);
|
50
|
+
exports.isInDocument = isInDocument;
|
51
|
+
const extractMediaQueryValue = query => {
|
52
|
+
const [_, px] = query.match(/(\d+)px/) ?? [];
|
53
|
+
if (!px) {
|
54
|
+
return undefined;
|
55
|
+
}
|
56
|
+
const value = Number(px);
|
57
|
+
return isNaN(value) ? undefined : value;
|
58
|
+
};
|
59
|
+
exports.extractMediaQueryValue = extractMediaQueryValue;
|
60
|
+
const getMediaQuery = query => {
|
61
|
+
if (Object.values(_types.Orientation).includes(query)) {
|
62
|
+
return `(orientation: ${query})`;
|
63
|
+
}
|
64
|
+
if ((0, _mq.isUnistylesMq)(query)) {
|
65
|
+
const {
|
66
|
+
minWidth,
|
67
|
+
maxWidth,
|
68
|
+
minHeight,
|
69
|
+
maxHeight
|
70
|
+
} = (0, _mq.parseMq)(query);
|
71
|
+
return [minWidth ? `(min-width: ${minWidth}px)` : undefined, maxWidth ? `(max-width: ${maxWidth}px)` : undefined, minHeight ? `(min-height: ${minHeight}px)` : undefined, maxHeight ? `(max-height: ${maxHeight}px)` : undefined].filter(Boolean).join(' and ');
|
72
|
+
}
|
73
|
+
const minWidth = _state.UnistylesState.breakpoints && (0, _common.keyInObject)(_state.UnistylesState.breakpoints, query) ? _state.UnistylesState.breakpoints[query] : undefined;
|
74
|
+
return `(min-width: ${minWidth ?? 0}px)`;
|
75
|
+
};
|
76
|
+
exports.getMediaQuery = getMediaQuery;
|
77
|
+
const extractUnistyleDependencies = value => {
|
78
|
+
const dependencies = (0, _common.keyInObject)(value, 'uni__dependencies') ? value.uni__dependencies : [];
|
79
|
+
return dependencies;
|
80
|
+
};
|
81
|
+
exports.extractUnistyleDependencies = extractUnistyleDependencies;
|
82
|
+
//# sourceMappingURL=unistyle.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_types","require","_mq","_state","_common","schemeToTheme","scheme","ColorScheme","Dark","Light","exports","hexToRGBA","hex","opacity","replace","split","map","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","assignSecrets","object","secrets","Math","random","toString","slice","extractSecrets","Object","entries","key","value","startsWith","push","getStyles","values","returnValue","defineProperties","reduceObject","enumerable","configurable","isInDocument","element","document","body","contains","extractMediaQueryValue","query","_","px","match","undefined","Number","getMediaQuery","Orientation","includes","isUnistylesMq","minWidth","maxWidth","minHeight","maxHeight","parseMq","Boolean","join","UnistylesState","breakpoints","keyInObject","extractUnistyleDependencies","dependencies","uni__dependencies"],"sourceRoot":"../../../../src","sources":["web/utils/unistyle.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEO,MAAMI,aAAa,GAAIC,MAAmB,IAAmB;EAChE,QAAQA,MAAM;IACV,KAAKC,kBAAW,CAACC,IAAI;MACjB,OAAO,MAAM;IACjB,KAAKD,kBAAW,CAACE,KAAK;IACtB;MACI,OAAO,OAAO;EACtB;AACJ,CAAC;AAAAC,OAAA,CAAAL,aAAA,GAAAA,aAAA;AAEM,MAAMM,SAAS,GAAGA,CAACC,GAAW,EAAEC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R,SAAS,EACtDS,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGT,SAAS,CACzD,CAACtC,MAAM,CAACiD,OAAO,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;EACnC;EAEA,MAAMN,QAAQ,GAAGO,qBAAc,CAACC,WAAW,IAAI,IAAAC,mBAAW,EAACF,qBAAc,CAACC,WAAW,EAAElB,KAAK,CAAC,GAAGiB,qBAAc,CAACC,WAAW,CAAClB,KAAK,CAAC,GAAGI,SAAS;EAE7I,OAAO,eAAeM,QAAQ,IAAI,CAAC,KAAK;AAC5C,CAAC;AAAArD,OAAA,CAAAiD,aAAA,GAAAA,aAAA;AAEM,MAAMc,2BAA2B,GAAIpC,KAAU,IAAK;EACvD,MAAMqC,YAAuC,GAAG,IAAAF,mBAAW,EAACnC,KAAK,EAAE,mBAAmB,CAAC,GAAGA,KAAK,CAACsC,iBAAiB,GAAG,EAAE;EAEtH,OAAOD,YAAY;AACvB,CAAC;AAAAhE,OAAA,CAAA+D,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
@@ -1,9 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
import { media } from 'typestyle';
|
4
3
|
import { deepMergeObjects, warn } from '../utils';
|
5
4
|
import { validateShadow } from './shadow';
|
6
|
-
import { convertBreakpoint } from './breakpoint';
|
7
5
|
import { BOX_SHADOW_STYLES } from './types';
|
8
6
|
import { extractShadowValue, normalizeColor, normalizeNumericValue } from './utils';
|
9
7
|
const createBoxShadowValue = style => {
|
@@ -53,17 +51,19 @@ export const getBoxShadowStyle = styles => {
|
|
53
51
|
} = extractShadowValue('shadowOffset', breakpoint, styles);
|
54
52
|
const radius = extractShadowValue('shadowRadius', breakpoint, styles);
|
55
53
|
const opacity = extractShadowValue('shadowOpacity', breakpoint, styles);
|
56
|
-
return
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
54
|
+
return {
|
55
|
+
[breakpoint]: {
|
56
|
+
boxShadow: createBoxShadowValue({
|
57
|
+
shadowColor: color,
|
58
|
+
shadowOffset: {
|
59
|
+
width,
|
60
|
+
height
|
61
|
+
},
|
62
|
+
shadowRadius: radius,
|
63
|
+
shadowOpacity: opacity
|
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":["deepMergeObjects","warn","validateShadow","BOX_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","width","offsetY","height","radius","color","getBoxShadowStyle","styles","missingStyles","filter","key","length","join","breakpointsSet","Set","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","opacity"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;AAAA,SAASA,gBAAgB,EAAEC,IAAI,QAAQ,UAAU;AACjD,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,iBAAiB,QAAwB,SAAS;AAC3D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,SAAS;AAEnF,MAAMC,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C;EACA,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KAAK;EACxE,MAAMK,OAAO,GAAGP,qBAAqB,CAACI,YAAY,CAACI,KAAK,CAAC;EACzD,MAAMC,OAAO,GAAGT,qBAAqB,CAACI,YAAY,CAACM,MAAM,CAAC;EAC1D,MAAMC,MAAM,GAAGX,qBAAqB,CAACM,YAAY,CAAC;EAClD,MAAMM,KAAK,GAAGb,cAAc,CAACI,WAAW,EAAYE,aAAuB,CAAC;EAE5E,OAAO,GAAGE,OAAO,IAAIE,OAAO,IAAIE,MA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EvE,OAAO;MACH,CAACe,UAAU,GAAG;QACVH,SAAS,EAAEzB,oBAAoB,CAAC;UAC5BE,WAAW,EAAES,KAAK;UAClBR,YAAY,EAAE;YACVI,KAAK;YACLE;UACJ,CAAC;UACDJ,YAAY,EAAEK,MAAM;UACpBN,aAAa,EAAEyB;QACnB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAOpC,gBAAgB,CAAC,GAAGiC,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
|
@@ -1,15 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
import {
|
4
|
-
import { isPseudo } from '../pseudo';
|
5
|
-
import { convertBreakpoint } from './breakpoint';
|
3
|
+
import { isPseudo } from './pseudo';
|
6
4
|
import { getStyle } from './style';
|
7
5
|
import { deepMergeObjects } from '../utils';
|
8
6
|
import { getTransformStyle } from './transform';
|
9
7
|
import { isBoxShadow, isTextShadow, isTransform } from './utils';
|
10
8
|
import { getTextShadowStyle } from './textShadow';
|
11
9
|
import { getBoxShadowStyle } from './boxShadow';
|
12
|
-
export const
|
10
|
+
export const convertUnistyles = value => {
|
13
11
|
// Flag to mark if textShadow is already created
|
14
12
|
let hasTextShadow = false;
|
15
13
|
// Flag to mark if boxShadow is already created
|
@@ -25,11 +23,9 @@ export const convertToTypeStyle = value => {
|
|
25
23
|
|
26
24
|
// Pseudo classes :hover, :before etc.
|
27
25
|
if (isPseudo(unistylesKey)) {
|
28
|
-
const
|
26
|
+
const flattenValues = convertUnistyles(unistylesValue);
|
29
27
|
return {
|
30
|
-
|
31
|
-
[unistylesKey.replace('_', '&:')]: typestyleValues
|
32
|
-
}
|
28
|
+
[unistylesKey]: flattenValues
|
33
29
|
};
|
34
30
|
}
|
35
31
|
|
@@ -59,7 +55,9 @@ export const convertToTypeStyle = value => {
|
|
59
55
|
// Breakpoints
|
60
56
|
if (typeof unistylesValue === 'object' && unistylesValue !== null) {
|
61
57
|
return Object.entries(unistylesValue).map(([breakpointKey, breakpointValue]) => {
|
62
|
-
return
|
58
|
+
return {
|
59
|
+
[breakpointKey]: getStyle(unistylesKey, breakpointValue)
|
60
|
+
};
|
63
61
|
});
|
64
62
|
}
|
65
63
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["isPseudo","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertUnistyles","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","flattenValues","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;AACA,SAASA,QAAQ,QAAQ,UAAU;AACnC,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,WAAW,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAChE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,OAAO,MAAMC,gBAAgB,GAAIC,KAAsB,IAAK;EACxD;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,YAAY,GAAG,KAAK;EAExB,MAAMC,WAAW,GAAGC,MAAM,CAACC,OAAO,CAAC;IAC/B,GAAGL,KAAK;IACR,GAAGA,KAAK,CAACM;EACb,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,CAACC,YAAY,EAAEC,cAAc,CAAC,KAAK;IAC3C;IACA,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAACC,QAAQ,CAACF,YAAY,CAAC,IAAIA,YAAY,CAACG,UAAU,CAAC,UAAU,CAAC,EAAE;MACrK,OAAO,EAAE;IACb;;IAEA;IACA,IAAIrB,QAAQ,CAACkB,YAAY,CAAC,EAAE;MACxB,MAAMI,aAAa,GAAGb,gBAAgB,CAACU,cAAiC,CAAC;MAEzE,OAAO;QAAE,CAACD,YAAY,GAAGI;MAAc,CAAC;IAC5C;;IAEA;IACA,IAAIjB,YAAY,CAACa,YAAY,CAAC,EAAE;MAC5B,IAAIP,aAAa,EAAE;QACf,OAAO,EAAE;MACb;MAEAA,aAAa,GAAG,IAAI;MAEpB,OAAOJ,kBAAkB,CAACG,KAAK,CAAC;IACpC;;IAEA;IACA,IAAIN,WAAW,CAACc,YAAY,CAAC,EAAE;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MAEAA,YAAY,GAAG,IAAI;MAEnB,OAAOJ,iBAAiB,CAACE,KAAK,CAAC;IACnC;;IAEA;IACA,IAAIJ,WAAW,CAACY,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAOhB,iBAAiB,CAACgB,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO;UAAE,CAACD,aAAa,GAAGvB,QAAQ,CAACiB,YAAY,EAAEO,eAAe;QAAE,CAAC;MACvE,CAAC,CAAC;IACN;;IAEA;IACA,OAAOxB,QAAQ,CAACiB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAOjB,gBAAgB,CAAC,GAAGW,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["pseudos","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../../src","sources":["web/convert/pseudo.ts"],"mappings":";;AAAA,OAAO,MAAMA,OAAO,GAAG,CACnB,cAAc,EACd,iBAAiB,EACjB,kB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