react-native-unistyles 3.0.0-alpha.27 → 3.0.0-alpha.29
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -0
- package/android/CMakeLists.txt +12 -21
- package/cxx/core/UnistylesMountHook.cpp +0 -10
- package/cxx/core/UnistylesMountHook.h +3 -8
- package/cxx/core/UnistylesRegistry.cpp +4 -8
- package/cxx/core/UnistylesRegistry.h +1 -1
- package/cxx/core/UnistylesState.cpp +2 -10
- package/cxx/core/UnistylesState.h +1 -1
- package/cxx/hybridObjects/HybridStyleSheet.cpp +67 -34
- package/cxx/hybridObjects/HybridStyleSheet.h +9 -1
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +15 -7
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +5 -1
- package/cxx/parser/Parser.cpp +73 -5
- package/cxx/parser/Parser.h +2 -0
- package/ios/NativePlatform+ios.swift +16 -5
- package/ios/NativePlatform+keyboard.swift +83 -0
- package/ios/NativePlatformListener+ios.swift +19 -6
- package/ios/UnistylesModuleOnLoad.h +3 -1
- package/ios/UnistylesModuleOnLoad.mm +11 -1
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/types.js +3 -0
- package/lib/commonjs/specs/ShadowRegistry/types.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/UnistylesStatusBar.nitro.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/UnistylesStyleSheet.nitro.js +2 -4
- package/lib/commonjs/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +1 -1
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -3
- package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js.map +2 -1
- package/lib/commonjs/specs/TurboUnistyles/index.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +2 -1
- package/lib/commonjs/specs/index.web.js.map +2 -1
- package/lib/commonjs/specs/types.js +10 -10
- package/lib/commonjs/specs/types.js.map +1 -1
- package/lib/commonjs/types/stylesheet.js.map +1 -1
- package/lib/commonjs/web/create.js +1 -4
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/registry.js +1 -4
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +1 -4
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +2 -1
- package/lib/module/specs/NavigtionBar/UnistylesNavigationBar.nitro.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +1 -0
- package/lib/module/specs/ShadowRegistry/types.js +2 -0
- package/lib/module/specs/ShadowRegistry/types.js.map +1 -1
- package/lib/module/specs/StatusBar/UnistylesStatusBar.nitro.js.map +1 -0
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js +1 -1
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +1 -0
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js +2 -3
- package/lib/module/specs/UnistylesRuntime/UnistylesRuntime.nitro.js.map +1 -1
- package/lib/module/specs/index.js.map +2 -1
- package/lib/module/specs/index.web.js.map +2 -1
- package/lib/module/specs/types.js +10 -10
- package/lib/module/specs/types.js.map +1 -0
- package/lib/module/types/stylesheet.js.map +1 -1
- package/lib/module/web/create.js +2 -5
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/registry.js +2 -5
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +2 -5
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/typescript/src/global.d.ts +0 -2
- package/lib/typescript/src/global.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +4 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +11 -11
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +4 -2
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts +204 -0
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/index.d.ts +204 -0
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +3 -3
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/state.d.ts +1 -1
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +2 -2
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void.hpp +48 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +3 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void.kt +45 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +2 -1
- package/nitrogen/generated/android/unistylesOnLoad.cpp +2 -0
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +29 -1
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +6 -0
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +27 -0
- package/nitrogen/generated/ios/swift/UnistyleDependency.swift +4 -0
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -1
- package/package.json +13 -13
- package/plugin/common.js +9 -0
- package/plugin/stylesheet.js +7 -1
- package/src/global.ts +1 -4
- package/src/specs/NativePlatform/NativePlatform.nitro.js +18 -0
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +5 -2
- package/src/specs/NativePlatform/index.js +1 -0
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.js +1 -0
- package/src/specs/NavigtionBar/index.js +9 -0
- package/src/specs/ShadowRegistry/ShadowRegistry.nitro.js +1 -0
- package/src/specs/ShadowRegistry/index.js +26 -0
- package/src/specs/ShadowRegistry/types.js +1 -0
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.js +1 -0
- package/src/specs/StatusBar/index.js +25 -0
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.js +1 -0
- package/src/specs/StyleSheet/index.js +13 -0
- package/src/specs/TurboUnistyles/NativeTurboUnistyles.js +2 -0
- package/src/specs/TurboUnistyles/index.js +1 -0
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.js +1 -0
- package/src/specs/UnistylesRuntime/index.js +20 -0
- package/src/specs/index.js +8 -0
- package/src/specs/index.web.js +2 -0
- package/src/specs/types.js +17 -0
- package/src/types/breakpoints.ts +25 -13
- package/src/types/stylesheet.ts +5 -3
- package/src/web/create.ts +2 -5
- package/src/web/registry.ts +2 -5
- package/src/web/runtime.ts +1 -1
- package/src/web/shadowRegistry.ts +2 -5
- package/src/web/state.ts +3 -3
- package/src/web/utils/unistyle.ts +2 -2
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistyleDependency","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.
|
1
|
+
{"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistyleDependency","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.js"],"mappings":";;AAAA,OAAO,kBAAkB;AACzB,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,cAAc,EAAEC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASH,cAAc,EAAEC,WAAW,EAAEC,WAAW,EAAEC,kBAAkB;AACrE,SAASJ,uBAAuB,EAAEF,OAAO,IAAIO,gBAAgB,EAAEN,UAAU","ignoreList":[]}
|
2
|
+
}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["getSSRUnistyles"],"sourceRoot":"../../../src","sources":["specs/index.web.
|
1
|
+
{"version":3,"names":["getSSRUnistyles"],"sourceRoot":"../../../src","sources":["specs/index.web.js"],"mappings":";;AAAA,OAAO,MAAMA,eAAe,GAAGA,CAAA,KAAM,EAAE;AACvC,cAAc,QAAQ","ignoreList":[]}
|
2
|
+
|
@@ -1,20 +1,20 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
export
|
3
|
+
export var ColorScheme;
|
4
|
+
(function (ColorScheme) {
|
4
5
|
ColorScheme["Light"] = "light";
|
5
6
|
ColorScheme["Dark"] = "dark";
|
6
7
|
ColorScheme["Unspecified"] = "unspecified";
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
})(ColorScheme || (ColorScheme = {}));
|
9
|
+
export var Orientation;
|
10
|
+
(function (Orientation) {
|
10
11
|
Orientation["Portrait"] = "portrait";
|
11
12
|
Orientation["Landscape"] = "landscape";
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
})(Orientation || (Orientation = {}));
|
14
|
+
export var StatusBarStyle;
|
15
|
+
(function (StatusBarStyle) {
|
15
16
|
StatusBarStyle["Default"] = "default";
|
16
17
|
StatusBarStyle["Light"] = "light";
|
17
18
|
StatusBarStyle["Dark"] = "dark";
|
18
|
-
|
19
|
-
|
20
|
-
//# sourceMappingURL=types.js.map
|
19
|
+
})(StatusBarStyle || (StatusBarStyle = {}));
|
20
|
+
//# sourceMappingURL=types.js.mapjs.map
|
@@ -1 +1,2 @@
|
|
1
1
|
{"version":3,"names":["ColorScheme","Orientation","StatusBarStyle"],"sourceRoot":"../../../src","sources":["specs/types.ts"],"mappings":";;AAGA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAMvB,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAkBvB,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
2
|
+
WAAW,EAAE;EACpBA,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;EACpCA,WAAW,CAAC,WAAW,CAAC,GAAG,WAAW;AAC1C,CAAC,EAAEA,WAAW,KAAKA,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;AACrC,OAAO,IAAIC,cAAc;AACzB,CAAC,UAAUA,cAAc,EAAE;EACvBA,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS;EACrCA,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO;EACjCA,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM;AACnC,CAAC,EAAEA,cAAc,KAAKA,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["create","stylesheet"],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":";;AASA;;
|
1
|
+
{"version":3,"names":["create","stylesheet"],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":";;AASA;;AAwEA,MAAMA,MAAM,GAA0BC,UAAwC,IAAoEA,UAA2E;AAAA","ignoreList":[]}
|
package/lib/module/web/create.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
import { assignSecrets, reduceObject, getStyles } from './utils';
|
3
|
+
import { assignSecrets, reduceObject, getStyles, deepMergeObjects } from './utils';
|
4
4
|
import { UnistylesRuntime } from './runtime';
|
5
5
|
import { createUseVariants, getVariants } from './variants';
|
6
6
|
export const create = stylesheet => {
|
@@ -22,10 +22,7 @@ export const create = stylesheet => {
|
|
22
22
|
const variants = Object.fromEntries(getVariants({
|
23
23
|
[key]: result
|
24
24
|
}, copyVariants()));
|
25
|
-
const resultWithVariants = {
|
26
|
-
...result,
|
27
|
-
...variants[key]
|
28
|
-
};
|
25
|
+
const resultWithVariants = deepMergeObjects(result, variants[key] ?? {});
|
29
26
|
|
30
27
|
// Add secrets to result of dynamic styles function
|
31
28
|
return addSecrets(getStyles(resultWithVariants), key, args);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["assignSecrets","reduceObject","getStyles","UnistylesRuntime","createUseVariants","getVariants","create","stylesheet","computedStylesheet","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","_key","String","dynamicStyle","result","variants","resultWithVariants","newVariants","forEach","set"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;AAEA,SAASA,aAAa,EAAEC,YAAY,EAAEC,SAAS,QAAQ,SAAS;
|
1
|
+
{"version":3,"names":["assignSecrets","reduceObject","getStyles","deepMergeObjects","UnistylesRuntime","createUseVariants","getVariants","create","stylesheet","computedStylesheet","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","_key","String","dynamicStyle","result","variants","resultWithVariants","newVariants","forEach","set"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;AAEA,SAASA,aAAa,EAAEC,YAAY,EAAEC,SAAS,EAAEC,gBAAgB,QAAQ,SAAS;AAClF,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,YAAY;AAE3D,OAAO,MAAMC,MAAM,GAAIC,UAAiD,IAAK;EACzE,MAAMC,kBAAkB,GAAG,OAAOD,UAAU,KAAK,UAAU,GACrDA,UAAU,CAACJ,gBAAgB,CAACM,KAAK,EAAEN,gBAAgB,CAACO,WAAW,CAAC,GAChEH,UAAU;EAChB,MAAMI,gBAAgB,GAAG,IAAIC,GAAG,CAAc,CAAC;EAE/C,MAAMC,YAAY,GAAGA,CAAA,KAAMC,MAAM,CAACC,WAAW,CAACJ,gBAAgB,CAACK,OAAO,CAAC,CAAC,CAAC;EACzE,MAAMC,UAAU,GAAGA,CAACC,KAAU,EAAEC,GAAW,EAAEC,IAAiB,KAAKrB,aAAa,CAACmB,KAAK,EAAE;IACpFG,UAAU,EAAEF,GAAG;IACfG,WAAW,EAAE,IAAIC,GAAG,CAAC,CAAC;IACtBC,iBAAiB,EAAEjB,UAAU;IAC7BkB,WAAW,EAAEL,IAAI;IACjBM,eAAe,EAAEb,YAAY,CAAC;EAClC,CAAC,CAAC;EAEF,MAAMc,MAAM,GAAG3B,YAAY,CAACQ,kBAAkB,EAAE,CAACU,KAAK,EAAEU,IAAI,KAAK;IAC7D,MAAMT,GAAG,GAAGU,MAAM,CAACD,IAAI,CAAC;IAExB,IAAI,OAAOV,KAAK,KAAK,UAAU,EAAE;MAC7B,MAAMY,YAAY,GAAGA,CAAC,GAAGV,IAAgB,KAAK;QAC1C,MAAMW,MAAM,GAAGb,KAAK,CAAC,GAAGE,IAAI,CAAC;QAC7B,MAAMY,QAAQ,GAAGlB,MAAM,CAACC,WAAW,CAACV,WAAW,CAAC;UAAE,CAACc,GAAG,GAAGY;QAAO,CAAC,EAAuClB,YAAY,CAAC,CAAC,CAAC,CAAC;QACxH,MAAMoB,kBAAkB,GAAG/B,gBAAgB,CAAC6B,MAAM,EAAEC,QAAQ,CAACb,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;;QAExE;QACA,OAAOF,UAAU,CAAChB,SAAS,CAACgC,kBAAkB,CAAC,EAAEd,GAAG,EAAEC,IAAI,CAAC;MAC/D,CAAC;;MAED;MACA,OAAOH,UAAU,CAACa,YAAY,EAAEX,GAAG,CAAC;IACxC;;IAEA;IACA,OAAOF,UAAU,CAAChB,SAAS,CAACiB,KAAK,CAAC,EAAEC,GAAG,CAAC;EAC5C,CAAC,CAAsC;;EAEvC;EACAf,iBAAiB,CAACuB,MAAM,EAAEO,WAAW,IAAIpB,MAAM,CAACE,OAAO,CAACkB,WAAW,CAAC,CAACC,OAAO,CAAC,CAAC,CAAChB,GAAG,EAAED,KAAK,CAAC,KAAKP,gBAAgB,CAACyB,GAAG,CAACjB,GAAG,EAAED,KAAK,CAAC,CAAC,CAAC;EAEjI,OAAOS,MAAM;AACjB,CAAC","ignoreList":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
import { UnistylesRuntime } from './runtime';
|
4
|
-
import { extractMediaQueryValue, keyInObject, getMediaQuery, generateHash, extractUnistyleDependencies } from './utils';
|
4
|
+
import { extractMediaQueryValue, keyInObject, getMediaQuery, generateHash, extractUnistyleDependencies, deepMergeObjects } from './utils';
|
5
5
|
import { UnistylesListener } from './listener';
|
6
6
|
import { convertUnistyles } from './convert';
|
7
7
|
import { getVariants } from './variants';
|
@@ -73,10 +73,7 @@ class UnistylesRegistryBuilder {
|
|
73
73
|
} = Object.fromEntries(getVariants({
|
74
74
|
variantsResult: result
|
75
75
|
}, variants));
|
76
|
-
const resultWithVariants = {
|
77
|
-
...result,
|
78
|
-
...variantsResult
|
79
|
-
};
|
76
|
+
const resultWithVariants = deepMergeObjects(result, variantsResult ?? {});
|
80
77
|
this.applyStyles(hash, convertUnistyles(resultWithVariants));
|
81
78
|
});
|
82
79
|
return hash;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistylesRuntime","extractMediaQueryValue","keyInObject","getMediaQuery","generateHash","extractUnistyleDependencies","UnistylesListener","convertUnistyles","getVariants","UnistylesRegistryBuilder","stylesheets","Map","stylesCounter","styleTag","disposeListenersMap","dependenciesMap","tag","newTag","document","createElement","id","head","appendChild","getComputedStylesheet","stylesheet","computedStylesheet","get","createdStylesheet","theme","miniRuntime","dependencies","Object","values","flatMap","value","addDependenciesToStylesheet","set","Set","forEach","dependency","add","dispose","addListeners","Array","from","newComputedStylesheet","key","args","variants","hash","existingCounter","size","counter","applyStyles","Promise","resolve","newComputedStyleSheet","newValue","result","variantsResult","fromEntries","resultWithVariants","styles","entries","sheet","startsWith","mediaQuery","cssRules","queryRule","find","rule","CSSMediaRule","media","item","includes","mediaQueryValue","ruleIndex","reduce","acc","ruleMediaQueryValue","conditionText","undefined","length","insertRule","mqKey","mqValue","applyRule","pseudoKey","pseudoValue","replace","CSSStyleRule","selectorText","style","remove","existingStyles","delete","findIndex","cssText","deleteRule","UnistylesRegistry"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,sBAAsB,EAAEC,WAAW,EAAEC,aAAa,EAAEC,YAAY,EAAEC,2BAA2B,QAAQ,SAAS;
|
1
|
+
{"version":3,"names":["UnistylesRuntime","extractMediaQueryValue","keyInObject","getMediaQuery","generateHash","extractUnistyleDependencies","deepMergeObjects","UnistylesListener","convertUnistyles","getVariants","UnistylesRegistryBuilder","stylesheets","Map","stylesCounter","styleTag","disposeListenersMap","dependenciesMap","tag","newTag","document","createElement","id","head","appendChild","getComputedStylesheet","stylesheet","computedStylesheet","get","createdStylesheet","theme","miniRuntime","dependencies","Object","values","flatMap","value","addDependenciesToStylesheet","set","Set","forEach","dependency","add","dispose","addListeners","Array","from","newComputedStylesheet","key","args","variants","hash","existingCounter","size","counter","applyStyles","Promise","resolve","newComputedStyleSheet","newValue","result","variantsResult","fromEntries","resultWithVariants","styles","entries","sheet","startsWith","mediaQuery","cssRules","queryRule","find","rule","CSSMediaRule","media","item","includes","mediaQueryValue","ruleIndex","reduce","acc","ruleMediaQueryValue","conditionText","undefined","length","insertRule","mqKey","mqValue","applyRule","pseudoKey","pseudoValue","replace","CSSStyleRule","selectorText","style","remove","existingStyles","delete","findIndex","cssText","deleteRule","UnistylesRegistry"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,sBAAsB,EAAEC,WAAW,EAAEC,aAAa,EAAEC,YAAY,EAAEC,2BAA2B,EAAEC,gBAAgB,QAAQ,SAAS;AACzI,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,gBAAgB,QAAQ,WAAW;AAG5C,SAASC,WAAW,QAAQ,YAAY;AAmBxC,MAAMC,wBAAwB,CAAC;EACVC,WAAW,GAAG,IAAIC,GAAG,CAAoD,CAAC;EAC1EC,aAAa,GAAG,IAAID,GAAG,CAA+B,CAAC;EACxE,CAACE,QAAQ,GAA4B,IAAI;EACxBC,mBAAmB,GAAG,IAAIH,GAAG,CAAuB,CAAC;EACrDI,eAAe,GAAG,IAAIJ,GAAG,CAAiE,CAAC;EAE5G,IAAYE,QAAQA,CAAA,EAAG;IACnB,MAAMG,GAAG,GAAG,IAAI,CAAC,CAACH,QAAQ;IAE1B,IAAI,CAACG,GAAG,EAAE;MACN,M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EAAE;MAClE;IACJ;IAEAwB,IAAI,CAACsB,KAAK,CAAC9C,GAAG,CAAwC,GAAGZ,KAAK;EAClE,CAAC;EAED2D,MAAM,GAAI3D,KAAsB,IAAK;IACjC,MAAMe,IAAI,GAAG9C,YAAY,CAAC+B,KAAK,CAAC;IAChC,MAAM4D,cAAc,GAAG,IAAI,CAAClF,aAAa,CAACc,GAAG,CAACuB,IAAI,CAAC;IAEnD,IAAI,CAAC6C,cAAc,EAAE;MACjB;IACJ;IAEAA,cAAc,CAACC,MAAM,CAAC7D,KAAK,CAAC;IAE5B,IAAI4D,cAAc,CAAC3C,IAAI,KAAK,CAAC,EAAE;MAC3B,MAAMyB,SAAS,GAAGjC,KAAK,CAACC,IAAI,CAAC,IAAI,CAAC/B,QAAQ,CAACmD,KAAK,EAAEG,QAAQ,IAAI,EAAE,CAAC,CAAC6B,SAAS,CAAC1B,IAAI,IAAIA,IAAI,CAAC2B,OAAO,CAACvB,QAAQ,CAAC,IAAIzB,IAAI,EAAE,CAAC,CAAC;MAEtH,IAAI,CAACpC,QAAQ,CAACmD,KAAK,EAAEkC,UAAU,CAACtB,SAAS,CAAC;IAC9C;EACJ,CAAC;AACL;AAEA,OAAO,MAAMuB,iBAAiB,GAAG,IAAI1F,wBAAwB,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","hexToRGBA","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","contentSizeCategory","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","Error","set"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,EAAEC,WAAW,QAA0C,gBAAgB;AAE3F,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,EAAEC,SAAS,QAAQ,QAAQ;AACjD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AAE5D,MAAMC,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAIJ,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACG,UAAU,EAAE;MAClB,IAAI,CAACA,UAAU,GAAGI,MAAM,CAACC,UAAU,CAAC,+BAA+B,CAAC;IACxE;IAEA,OAAO,IAAI,CAACL,UAAU;EAC1B;EAEQG,YAAYA,CAAA,EAA0B;IAC1C,IAAIN,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACK,SAAS,EAAE;MACjB,IAAI,CAACA,SAAS,GAAGE,MAAM,CAACC,UAAU,CAAC,8BAA8B,CAAC;IACtE;IAEA,OAAO,IAAI,CAACH,SAAS;EACzB;EAEA,IAAII,WAAWA,CAAA,EAAG;IACd,QAAQ,IAAI;MACR,KAAK,IAAI,CAACL,aAAa,CAAC,CAAC,EAAEM,OAAO;QAC9B,OAAOlB,WAAW,CAACmB,KAAK;MAC5B,KAAK,I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,GAAIlC,SAAuB,IAAK;IACpC,IAAIA,SAAS,KAAKmC,gBAAgB,CAACnC,SAAS,EAAE;MAC1C;IACJ;IAEAhB,cAAc,CAACgB,SAAS,GAAGA,SAAS;IACpCnB,iBAAiB,CAACuD,UAAU,CAAC3D,kBAAkB,CAAC4D,KAAK,CAAC;IACtDxD,iBAAiB,CAACuD,UAAU,CAAC3D,kBAAkB,CAAC6D,SAAS,CAAC;EAC9D,CAAC;EAEDC,iBAAiB,GAAIC,SAAkB,IAAK;IACxCxD,cAAc,CAAC6C,iBAAiB,GAAGW,SAAS;IAE5C,IAAI,CAACA,SAAS,EAAE;MACZ;IACJ;IAEA,IAAI,CAACN,QAAQ,CAAC/C,aAAa,CAACgD,gBAAgB,CAACxC,WAAW,
|
1
|
+
{"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","hexToRGBA","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","contentSizeCategory","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","Error","set"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,EAAEC,WAAW,QAA0C,gBAAgB;AAE3F,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,EAAEC,SAAS,Q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-1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
import { UnistylesRegistry } from './registry';
|
4
|
-
import { createDoubleMap, equal, extractSecrets, extractUnistyleDependencies, isInDocument } from './utils';
|
4
|
+
import { createDoubleMap, deepMergeObjects, equal, extractSecrets, extractUnistyleDependencies, isInDocument } from './utils';
|
5
5
|
import { getVariants } from './variants';
|
6
6
|
class UnistylesShadowRegistryBuilder {
|
7
7
|
// MOCKS
|
@@ -75,10 +75,7 @@ class UnistylesShadowRegistryBuilder {
|
|
75
75
|
} = Object.fromEntries(getVariants({
|
76
76
|
variantsResult: result
|
77
77
|
}, variants));
|
78
|
-
const resultWithVariants = {
|
79
|
-
...result,
|
80
|
-
...variantsResult
|
81
|
-
};
|
78
|
+
const resultWithVariants = deepMergeObjects(result, variantsResult ?? {});
|
82
79
|
const oldResult = this.resultsMap.get(ref, __uni__key);
|
83
80
|
|
84
81
|
// If results are the same do nothing
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistylesRegistry","createDoubleMap","equal","extractSecrets","extractUnistyleDependencies","isInDocument","getVariants","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","classNamesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","__uni__refs","__uni__key","oldResult","get","delete","remove","HTMLElement","secret","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","args","variants","length","result","variantsResult","fromEntries","resultWithVariants","oldClassNames","className","classList","set","stylesheet","value","injectedClassNames","_web","_classNames","newClassNames","concat","dependencies","addDependenciesToStylesheet","UnistylesShadowRegistry"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;AACA,SAASA,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,eAAe,EAAEC,KAAK,EAAEC,cAAc,EAAEC,2BAA2B,EAAEC,YAAY,QAAQ,SAAS;
|
1
|
+
{"version":3,"names":["UnistylesRegistry","createDoubleMap","deepMergeObjects","equal","extractSecrets","extractUnistyleDependencies","isInDocument","getVariants","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","classNamesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","__uni__refs","__uni__key","oldResult","get","delete","remove","HTMLElement","secret","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","args","variants","length","result","variantsResult","fromEntries","resultWithVariants","oldClassNames","className","classList","set","stylesheet","value","injectedClassNames","_web","_classNames","newClassNames","concat","dependencies","addDependenciesToStylesheet","UnistylesShadowRegistry"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;AACA,SAASA,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,eAAe,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,cAAc,EAAEC,2BAA2B,EAAEC,YAAY,QAAQ,SAAS;AAC7H,SAASC,WAAW,QAAQ,YAAY;AAIxC,MAAMC,8BAA8B,CAAC;EACjC;EACAC,IAAI,GAAG,yBAAyB;EAChCC,MAAM,GAAG,KAAK;EACdC,MAAM,GAAGA,CAAA,KAAM,IAAI;EACnBC,QAAQ,GAAGA,CAAA,KAAM,yBAAyB;EAC1CC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB;;EAEQC,UAAU,GAAGb,eAAe,CAAuC,CAAC;EACpEc,aAAa,GAAGd,eAAe,CAAqC,CAAC;EAE7Ee,GAAG,GAAGA,CAACC,GAAQ,EAAEC,MAA6B,EAAEC,SAA+B,EAAEC,KAAkB,KAAK;IACpG;IACA,IAAI,CAACF,MAAM,EAAE;MACT;IACJ;;IAEA;IACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,EAAE;MACvBA,MAAM,CAACK,OAAO,CAACC,KAAK,IAAI,IAAI,CAACR,GAAG,CAACC,GAAG,EAAEO,KAAK,EAAEL,SAAS,EAAEC,KAAK,CAAC,CAAC;MAE/D;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,EAAEC,WAAW,IAAI,EAAE;MACrF,MAAMC,aAAa,GAAGH,kBAAkB,CAACI,MAAM,CAACT,SAAS,CAAC;MAC1D,MAAMU,YAAY,GAAGzD,2BAA2B,CAAC6C,kBAAkB,CAAC;MAEpE,IAAI,OAAOX,iBAAiB,KAAK,UAAU,EAAE;QACzC;QACAvC,iBAAiB,CAAC+D,2BAA2B,CAACxB,iBAAiB,EAAEuB,YAAY,CAAC;MAClF;MAEA/B,WAAW,CAACf,GAAG,CAACC,GAAG,CAAC;MACpB,IAAI,CAACF,aAAa,CAACuC,GAAG,CAACrC,GAAG,EAAEe,UAAU,EAAE4B,aAAa,CAAC;MACtD;MACA3C,GAAG,CAACoC,SAAS,CAACrC,GAAG,CAAC,GAAG4C,aAAa,CAAC;IACvC,CAAC,CAAC;EACN,CAAC;EAEDxB,MAAM,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB;AAEA,OAAO,MAAM4B,uBAAuB,GAAG,IAAIxD,8BAA8B,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnistylesRuntime","isServer","schemeToTheme","UnistylesListener","UnistyleDependency","UnistylesStateBuilder","themes","Map","matchingBreakpoints","breakpoint","currentBreakpoint","Array","from","reverse","find","_key","value","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","keys","initialTheme","length","Error","colorScheme","sort","a","b","mediaQuery","window","matchMedia","matches","addEventListener","event","emitChange","Breakpoints","UnistylesState"],"sourceRoot":"../../../src","sources":["web/state.ts"],"mappings":";;AAIA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D,MAAMC,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,GAAGC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACJ,mBAAmB,CAAC,CAC3DK,OAAO,CAAC,CAAC,CACTC,IAAI,CAAC,CAAC,CAACC,IAAI,EAAEC,KAAK,CAAC,KAAKA,KAAK,CAAC,IAAI,EAAE;IAEzC,OAAON,iBAAiB;EAC5B;EAIAO,iBAAiB,GAAG,KAAK;EAEzBC,IAAI,GAAIC,MAAuB,IAAK;IAChC,IAAI,CAACC,UAAU,CAACD,MAAM,CAACb,MAAM,CAAC;IAC9B,IAAI,CAACe,eAAe,CAACF,MAAM,CAACG,WAAW,CAAC;IACxC,IAAI,CAACC,YAAY,CAACJ,MAAM,CAACK,QAAQ,CAAC;IAElC,IAAIvB,QAAQ,CAAC,CAAC,EAAE;MACZ;IACJ;IAEAE,iBAAiB,CAACsB,aAAa,CAAC,CAAC;EACrC,CAAC;EAEOL,UAAU,GAAGA,CAACd,MAAM,GAAG,CAAC,CAAoB,KAAK;IACrDoB,MAAM,CAACC,OAAO,CAACrB,MAAM,CAAC,CAACsB,OAAO,CAAC,CAAC,CAACC,SAAS,EAAEC,KAAK,CAAC,KAAK;MACnD,IAAI,CAACxB,MAAM,CAACyB,GAAG,CAACF,SAAS,EAAEC,
|
1
|
+
{"version":3,"names":["UnistylesRuntime","isServer","schemeToTheme","UnistylesListener","UnistyleDependency","UnistylesStateBuilder","themes","Map","matchingBreakpoints","breakpoint","currentBreakpoint","Array","from","reverse","find","_key","value","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","keys","initialTheme","length","Error","colorScheme","sort","a","b","mediaQuery","window","matchMedia","matches","addEventListener","event","emitChange","Breakpoints","UnistylesState"],"sourceRoot":"../../../src","sources":["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U,EAAEiC,UAAU,CAACG,OAAO,CAAC;MAE5DH,UAAU,CAACI,gBAAgB,CAAC,QAAQ,EAAEC,KAAK,IAAI;QAC3C,IAAI,CAACvC,mBAAmB,CAACuB,GAAG,CAACtB,UAAU,EAAEsC,KAAK,CAACF,OAAO,CAAC;QACvD1C,iBAAiB,CAAC6C,UAAU,CAAC5C,kBAAkB,CAAC6C,WAAW,CAAC;MAChE,CAAC,CAAC;IACN,CAAC,CAAC;EACV,CAAC;AACL;AAEA,OAAO,MAAMC,cAAc,GAAG,IAAI7C,qBAAqB,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ColorScheme","Orientation","isUnistylesMq","parseMq","UnistylesState","keyInObject","reduceObject","schemeToTheme","scheme","Dark","Light","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","enumerable","configurable","isInDocument","element","document","body","contains","extractMediaQueryValue","query","_","px","match","undefined","Number","getMediaQuery","includes","minWidth","maxWidth","minHeight","maxHeight","Boolean","join","breakpoints","extractUnistyleDependencies","dependencies","uni__dependencies"],"sourceRoot":"../../../../src","sources":["web/utils/unistyle.ts"],"mappings":";;AACA,
|
1
|
+
{"version":3,"names":["ColorScheme","Orientation","isUnistylesMq","parseMq","UnistylesState","keyInObject","reduceObject","schemeToTheme","scheme","Dark","Light","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","enumerable","configurable","isInDocument","element","document","body","contains","extractMediaQueryValue","query","_","px","match","undefined","Number","getMediaQuery","includes","minWidth","maxWidth","minHeight","maxHeight","Boolean","join","breakpoints","extractUnistyleDependencies","dependencies","uni__dependencies"],"sourceRoot":"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U,CAAC,GAAG5D,OAAO,CAACiD,KAAK,CAAC;IAEnE,OAAO,CACHQ,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGJ,SAAS,EACnDK,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGL,SAAS,EACnDM,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGN,SAAS,EACtDO,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGP,SAAS,CACzD,CAACrC,MAAM,CAAC6C,OAAO,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;EACnC;EAEA,MAAML,QAAQ,GAAGxD,cAAc,CAAC8D,WAAW,IAAI7D,WAAW,CAACD,cAAc,CAAC8D,WAAW,EAAEd,KAAK,CAAC,GAAGhD,cAAc,CAAC8D,WAAW,CAACd,KAAK,CAAC,GAAGI,SAAS;EAE7I,OAAO,eAAeI,QAAQ,IAAI,CAAC,KAAK;AAC5C,CAAC;AAED,OAAO,MAAMO,2BAA2B,GAAI9B,KAAU,IAAK;EACvD,MAAM+B,YAAuC,GAAG/D,WAAW,CAACgC,KAAK,EAAE,mBAAmB,CAAC,GAAGA,KAAK,CAACgC,iBAAiB,GAAG,EAAE;EAEtH,OAAOD,YAAY;AACvB,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/global.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;CAAG;AACnC,MAAM,WAAW,oBAAoB;IAEjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
@@ -16,7 +16,8 @@ export declare enum UnistyleDependency {
|
|
16
16
|
PixelRatio = 10,
|
17
17
|
FontScale = 11,
|
18
18
|
StatusBar = 12,
|
19
|
-
NavigationBar = 13
|
19
|
+
NavigationBar = 13,
|
20
|
+
Ime = 14
|
20
21
|
}
|
21
22
|
export interface UnistylesNativeMiniRuntime {
|
22
23
|
readonly colorScheme: ColorScheme;
|
@@ -53,6 +54,8 @@ export interface NativePlatform extends HybridObject<{
|
|
53
54
|
setImmersiveMode(isEnabled: boolean): void;
|
54
55
|
getMiniRuntime(): UnistylesNativeMiniRuntime;
|
55
56
|
registerPlatformListener(callback: (dependencies: Array<UnistyleDependency>) => void): void;
|
57
|
+
registerImeListener(callback: () => void): void;
|
58
|
+
unregisterPlatformListeners(): void;
|
56
59
|
}
|
57
60
|
export {};
|
58
61
|
//# sourceMappingURL=NativePlatform.nitro.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NativePlatform.nitro.d.ts","sourceRoot":"","sources":["../../../../../src/specs/NativePlatform/NativePlatform.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAEvD,KAAK,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,CAAA;AACnD,KAAK,WAAW,GAAG,UAAU,GAAG,WAAW,CAAA;AAE3C,oBAAY,kBAAkB;IAC1B,KAAK,IAAI;IACT,SAAS,IAAI;IACb,cAAc,IAAI;IAClB,WAAW,IAAI;IACf,QAAQ,IAAI;IACZ,WAAW,IAAI;IACf,UAAU,IAAI;IACd,WAAW,IAAI;IACf,mBAAmB,IAAI;IACvB,MAAM,IAAI;IACV,UAAU,KAAK;IACf,SAAS,KAAK;IACd,SAAS,KAAK;IACd,aAAa,KAAK;
|
1
|
+
{"version":3,"file":"NativePlatform.nitro.d.ts","sourceRoot":"","sources":["../../../../../src/specs/NativePlatform/NativePlatform.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;A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cAAc,IAAI,WAAW,CAAC;IAC9B,sBAAsB,IAAI,MAAM,CAAC;IACjC,mBAAmB,IAAI,UAAU,CAAC;IAClC,sBAAsB,IAAI,UAAU,CAAC;IACrC,0BAA0B,IAAI,UAAU,CAAC;IACzC,sBAAsB,IAAI,OAAO,CAAC;IAElC,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,+BAA+B,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,sBAAsB,CAAC,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACjD,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,2BAA2B,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAG3C,cAAc,IAAI,0BAA0B,CAAC;IAC7C,wBAAwB,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,kBAAkB,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC5F,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAChD,2BAA2B,IAAI,IAAI,CAAA;CACtC"}
|
@@ -8,28 +8,28 @@ type ExtractTransformArray<T> = T extends object ? {
|
|
8
8
|
type ExtractBreakpoints<T> = T extends object ? keyof T extends BreakpointsOrMediaQueries ? T[keyof T] : T extends Array<ToDeepUnistyles<TransformStyles>> ? Array<ExtractTransformArray<T[number]>> : {
|
9
9
|
[K in keyof T]: ExtractBreakpoints<T[K]>;
|
10
10
|
} : T;
|
11
|
-
type ParseNestedObject<T> = T extends (...args: infer A) => infer R ? (...args: A) => ParseNestedObject<R> : T extends object ? T extends {
|
11
|
+
type ParseNestedObject<T, ShouldFlatten> = T extends (...args: infer A) => infer R ? (...args: A) => ParseNestedObject<R, false> : T extends object ? T extends {
|
12
12
|
variants: infer R;
|
13
13
|
compoundVariants: infer C;
|
14
|
-
} ? ParseVariants<FlattenVariants<R>> & FlattenCompoundVariants<C> & ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>> : T extends {
|
14
|
+
} ? (ParseVariants<FlattenVariants<R, false>> & FlattenCompoundVariants<C, false> & ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false>) extends never ? ParseVariants<FlattenVariants<R, true>> & FlattenCompoundVariants<C, true> & ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false> : ParseVariants<FlattenVariants<R, false>> & FlattenCompoundVariants<C, false> & ParseNestedObject<Omit<T, 'variants' | 'compoundVariants'>, false> : T extends {
|
15
15
|
variants: infer R;
|
16
|
-
} ? ParseVariants<FlattenVariants<R>> & ParseNestedObject<Omit<T, 'variants'>> : T extends {
|
16
|
+
} ? (ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false>) extends never ? ParseVariants<FlattenVariants<R, true>> & ParseNestedObject<Omit<T, 'variants'>, false> : ParseVariants<FlattenVariants<R, false>> & ParseNestedObject<Omit<T, 'variants'>, false> : T extends {
|
17
17
|
compoundVariants: object;
|
18
|
-
} ? ParseNestedObject<Omit<T, 'compoundVariants'
|
19
|
-
[K in keyof T as K extends '_web' ? never : K]: T[K] extends object ? T[K] extends OpaqueColorValue ? ColorValue : ExtractBreakpoints<T[K]> : T[K];
|
18
|
+
} ? ParseNestedObject<Omit<T, 'compoundVariants'>, false> : {
|
19
|
+
[K in keyof T as K extends '_web' ? never : K]: T[K] extends object ? T[K] extends OpaqueColorValue ? ColorValue : ExtractBreakpoints<T[K]> : T[K] extends string ? ShouldFlatten extends true ? string : T[K] : T[K];
|
20
20
|
} : T;
|
21
|
-
type FlattenVariants<T> = T extends object ? {
|
21
|
+
type FlattenVariants<T, ShouldFlatten> = T extends object ? {
|
22
22
|
[K in keyof T]: T[K] extends object ? {
|
23
|
-
[key in keyof T[K]]: T[K][key] extends object ? ParseNestedObject<T[K][key]> : never;
|
23
|
+
[key in keyof T[K]]: T[K][key] extends object ? ParseNestedObject<T[K][key], ShouldFlatten> : never;
|
24
24
|
} : never;
|
25
25
|
} : never;
|
26
|
-
type FlattenCompoundVariants<T> = T extends Array<infer _> ? FlattenCompoundVariants<T[number]> : T extends {
|
26
|
+
type FlattenCompoundVariants<T, ShouldFlatten> = T extends Array<infer _> ? FlattenCompoundVariants<T[number], ShouldFlatten> : T extends {
|
27
27
|
styles: infer S;
|
28
|
-
} ? ParseNestedObject<S> : never;
|
29
|
-
type ParseVariants<T> = T extends object ? T[keyof T] extends object ? UnionToIntersection<ParseVariants<T[keyof T]>> : T : T;
|
28
|
+
} ? ParseNestedObject<S, ShouldFlatten> : never;
|
29
|
+
type ParseVariants<T> = T extends object ? T[keyof T] extends object ? UnionToIntersection<ParseVariants<T[keyof T]>> extends never ? ParseVariants<T[keyof T]> : UnionToIntersection<ParseVariants<T[keyof T]>> : T : T;
|
30
30
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
31
31
|
type ParseStyleKeys<T> = T extends object ? {
|
32
|
-
[K in keyof T]: ParseNestedObject<T[K]>;
|
32
|
+
[K in keyof T]: ParseNestedObject<T[K], false>;
|
33
33
|
} : never;
|
34
34
|
export type ReactNativeStyleSheet<T> = ParseStyleKeys<SafeReturnType<T>>;
|
35
35
|
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,KAAK,qBAAqB,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CAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
1
|
+
import type { BoxShadowValue, ImageStyle, TextStyle, ViewStyle, FilterFunction } from 'react-native';
|
2
2
|
import type { ShadowOffset, TransformStyles, UnistylesTheme } from './core';
|
3
3
|
import type { UnistylesBreakpoints } from '../global';
|
4
4
|
import type { UnistylesMiniRuntime } from '../specs';
|
@@ -6,7 +6,7 @@ import type { ReactNativeStyleSheet } from './breakpoints';
|
|
6
6
|
import type { ExtractVariantNames } from './variants';
|
7
7
|
import type { CSSProperties } from 'react';
|
8
8
|
import type { Pseudo } from '../web/convert/pseudo';
|
9
|
-
type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset';
|
9
|
+
type NestedKeys = 'shadowOffset' | 'transform' | 'textShadowOffset' | 'boxShadow' | 'filter';
|
10
10
|
export type UnistyleView = Omit<ViewStyle, NestedKeys>;
|
11
11
|
export type UnistyleText = Omit<TextStyle, NestedKeys>;
|
12
12
|
export type UnistyleImage = Omit<ImageStyle, NestedKeys>;
|
@@ -14,6 +14,8 @@ type UnistyleNestedStyles = {
|
|
14
14
|
shadowOffset?: ToDeepUnistyles<ShadowOffset>;
|
15
15
|
textShadowOffset?: ToDeepUnistyles<ShadowOffset>;
|
16
16
|
transform?: Array<ToDeepUnistyles<TransformStyles>>;
|
17
|
+
boxShadow?: Array<ToDeepUnistyles<BoxShadowValue>> | string;
|
18
|
+
filter?: Array<ToDeepUnistyles<FilterFunction>> | string;
|
17
19
|
};
|
18
20
|
type VariantsObject = {
|
19
21
|
[variantName: string]: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../../../src/types/stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;
|
1
|
+
{"version":3,"file":"stylesheet.d.ts","sourceRoot":"","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