react-native-unistyles 3.0.0-alpha.13 → 3.0.0-alpha.14
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/core/UnistyleWrapper.h +1 -1
- package/cxx/core/UnistylesCommitHook.cpp +5 -2
- package/cxx/hybridObjects/HybridStyleSheet.cpp +1 -3
- package/cxx/hybridObjects/HybridStyleSheet.h +1 -1
- package/lib/commonjs/index.js +4 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +7 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/web/convert/index.js +1 -1
- package/lib/commonjs/web/convert/index.js.map +1 -1
- package/lib/commonjs/web/create.js +25 -63
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/createUnistylesComponent.js +61 -0
- package/lib/commonjs/web/createUnistylesComponent.js.map +1 -0
- package/lib/commonjs/web/index.js +12 -3
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web/listener/index.js +7 -0
- package/lib/commonjs/web/listener/index.js.map +1 -1
- package/lib/commonjs/web/listener/listenToDependencies.js +39 -0
- package/lib/commonjs/web/listener/listenToDependencies.js.map +1 -0
- package/lib/commonjs/web/listener/listener.js +1 -2
- package/lib/commonjs/web/listener/listener.js.map +1 -1
- package/lib/commonjs/web/mock.js +1 -10
- package/lib/commonjs/web/mock.js.map +1 -1
- package/lib/commonjs/web/pseudo.js +2 -3
- package/lib/commonjs/web/pseudo.js.map +1 -1
- package/lib/commonjs/web/registry.js +2 -4
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/runtime.js +0 -1
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +120 -0
- package/lib/commonjs/web/shadowRegistry.js.map +1 -0
- package/lib/commonjs/web/state.js +0 -40
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/utils.js +66 -14
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web/variants/useVariants.js +1 -34
- package/lib/commonjs/web/variants/useVariants.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +7 -1
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/web/convert/index.js +1 -1
- package/lib/module/web/convert/index.js.map +1 -1
- package/lib/module/web/create.js +26 -64
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/createUnistylesComponent.js +54 -0
- package/lib/module/web/createUnistylesComponent.js.map +1 -0
- package/lib/module/web/index.js +4 -2
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/listener/index.js +1 -0
- package/lib/module/web/listener/index.js.map +1 -1
- package/lib/module/web/listener/listenToDependencies.js +34 -0
- package/lib/module/web/listener/listenToDependencies.js.map +1 -0
- package/lib/module/web/listener/listener.js +1 -1
- package/lib/module/web/listener/listener.js.map +1 -1
- package/lib/module/web/mock.js +0 -9
- package/lib/module/web/mock.js.map +1 -1
- package/lib/module/web/pseudo.js +2 -3
- package/lib/module/web/pseudo.js.map +1 -1
- package/lib/module/web/registry.js +2 -4
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/runtime.js +0 -1
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +116 -0
- package/lib/module/web/shadowRegistry.js.map +1 -0
- package/lib/module/web/state.js +0 -40
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/utils.js +59 -12
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web/variants/useVariants.js +1 -34
- package/lib/module/web/variants/useVariants.js.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/createUnistylesComponent.d.ts +3 -0
- package/lib/typescript/src/web/createUnistylesComponent.d.ts.map +1 -0
- package/lib/typescript/src/web/index.d.ts +2 -1
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/listener/index.d.ts +1 -0
- package/lib/typescript/src/web/listener/index.d.ts.map +1 -1
- package/lib/typescript/src/web/listener/listenToDependencies.d.ts +12 -0
- package/lib/typescript/src/web/listener/listenToDependencies.d.ts.map +1 -0
- package/lib/typescript/src/web/listener/listener.d.ts +2 -1
- package/lib/typescript/src/web/listener/listener.d.ts.map +1 -1
- package/lib/typescript/src/web/mock.d.ts +0 -9
- package/lib/typescript/src/web/mock.d.ts.map +1 -1
- package/lib/typescript/src/web/pseudo.d.ts +4 -2
- package/lib/typescript/src/web/pseudo.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts +1 -1
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +0 -1
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts +17 -0
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -0
- package/lib/typescript/src/web/state.d.ts +0 -5
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/utils.d.ts +22 -7
- package/lib/typescript/src/web/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/variants/useVariants.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +6 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +8 -3
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +1 -1
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +14 -2
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +3 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +4 -1
- package/package.json +3 -3
- package/src/index.ts +3 -0
- package/src/specs/ShadowRegistry/index.ts +7 -1
- package/src/web/convert/index.ts +1 -1
- package/src/web/create.ts +24 -79
- package/src/web/createUnistylesComponent.tsx +56 -0
- package/src/web/index.ts +3 -2
- package/src/web/listener/index.ts +1 -0
- package/src/web/listener/listenToDependencies.ts +50 -0
- package/src/web/listener/listener.ts +1 -1
- package/src/web/mock.ts +0 -10
- package/src/web/pseudo.ts +131 -5
- package/src/web/registry.ts +3 -5
- package/src/web/runtime.ts +0 -2
- package/src/web/shadowRegistry.ts +121 -0
- package/src/web/state.ts +0 -44
- package/src/web/utils.ts +90 -16
- package/src/web/variants/useVariants.ts +1 -37
@@ -60,7 +60,7 @@ inline static jsi::Value valueFromUnistyle(jsi::Runtime& rt, Unistyle::Shared un
|
|
60
60
|
auto hostFn = jsi::Value(rt, unistyleFn->proxiedFunction.value()).asObject(rt).asFunction(rt);
|
61
61
|
|
62
62
|
hostFn.setNativeState(rt, std::move(wrappedUnistyle));
|
63
|
-
|
63
|
+
helpers::defineHiddenProperty(rt, hostFn, helpers::UNISTYLES_ID.c_str(), unistyleFn->styleKey);
|
64
64
|
|
65
65
|
return std::move(hostFn);
|
66
66
|
}
|
@@ -25,10 +25,13 @@ RootShadowNode::Unshared core::UnistylesCommitHook::shadowTreeWillCommit(
|
|
25
25
|
|
26
26
|
return newRootShadowNode;
|
27
27
|
}
|
28
|
+
|
29
|
+
auto& registry = core::UnistylesRegistry::get();
|
28
30
|
|
29
|
-
|
31
|
+
if (!registry.trafficController.hasUnistylesCommit()) {
|
32
|
+
return newRootShadowNode;
|
33
|
+
}
|
30
34
|
|
31
|
-
auto& registry = core::UnistylesRegistry::get();
|
32
35
|
auto shadowLeafUpdates = this->getUnistylesUpdates();
|
33
36
|
|
34
37
|
if (shadowLeafUpdates.size() == 0) {
|
@@ -9,7 +9,7 @@ double HybridStyleSheet::getHairlineWidth() {
|
|
9
9
|
return nearestPixel / pixelRatio;
|
10
10
|
}
|
11
11
|
|
12
|
-
double HybridStyleSheet::
|
12
|
+
double HybridStyleSheet::get__unid() {
|
13
13
|
return this->__unid;
|
14
14
|
}
|
15
15
|
|
@@ -35,8 +35,6 @@ jsi::Value HybridStyleSheet::create(jsi::Runtime& rt, const jsi::Value &thisVal,
|
|
35
35
|
auto style = std::make_shared<core::HostStyle>(registeredStyleSheet, this->_unistylesRuntime);
|
36
36
|
auto styleHostObject = jsi::Object::createFromHostObject(rt, style);
|
37
37
|
|
38
|
-
registry.trafficController.setHasUnistylesCommit(true);
|
39
|
-
|
40
38
|
return styleHostObject;
|
41
39
|
}
|
42
40
|
|
package/lib/commonjs/index.js
CHANGED
@@ -27,6 +27,10 @@ Object.keys(_specs).forEach(function (key) {
|
|
27
27
|
});
|
28
28
|
var _mq = require("./mq");
|
29
29
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
30
|
+
// TODO: export Native createUnistylesComponent
|
31
|
+
// can't import it this way, it will break native build
|
32
|
+
// export { createUnistylesComponent } from './web/createUnistylesComponent'
|
33
|
+
|
30
34
|
// todo verify true min version
|
31
35
|
const minReactVersionRequiredByUnistyles = '18.3.1';
|
32
36
|
if (_react.default.version < minReactVersionRequiredByUnistyles) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_specs","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_mq","e","__esModule","default","minReactVersionRequiredByUnistyles","React","version","Error"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,GAAA,GAAAd,OAAA;AAAyB,SAAAD,uBAAAgB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_specs","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_mq","e","__esModule","default","minReactVersionRequiredByUnistyles","React","version","Error"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,GAAA,GAAAd,OAAA;AAAyB,SAAAD,uBAAAgB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzB;AACA;AACA;;AAEA;AACA,MAAMG,kCAAkC,GAAG,QAAQ;AAEnD,IAAIC,cAAK,CAACC,OAAO,GAAGF,kCAAkC,EAAE;EACpD,MAAM,IAAIG,KAAK,CAAC;AACpB,sDAAsDF,cAAK,CAACC,OAAO;AACnE,4CAA4CF,kCAAkC;AAC9E,KAAK,CAAC;AACN","ignoreList":[]}
|
@@ -15,7 +15,13 @@ const findShadowNodeForHandle = handle => {
|
|
15
15
|
return node;
|
16
16
|
};
|
17
17
|
HybridShadowRegistry.add = (handle, style, variants, args) => {
|
18
|
-
|
18
|
+
// virtualized nodes can be null
|
19
|
+
if (!handle || !style) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
|
23
|
+
// at this point unistyle can be only object or dynamic function
|
24
|
+
if (typeof style !== 'object' && typeof style !== 'function') {
|
19
25
|
return;
|
20
26
|
}
|
21
27
|
HybridShadowRegistry.link(findShadowNodeForHandle(handle), style, variants ?? {}, args ?? []);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","args","link","remove","__unid","unlink","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAaA,MAAMC,oBAAoB,GAAGC,qCAAY,CAACC,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP;IACA,MAAM,IAAIK,KAAK,CAAC,uDAAuD,CAAC;EAC5E;EAEA,OAAOL,IAAI;AACf,CAAC;AAEDL,oBAAoB,CAACW,GAAG,GAAG,CAACP,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEC,IAAI,KAAK;EAC1D,IAAI,CAACV,MAAM,IAAI,
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","args","link","remove","__unid","unlink","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAaA,MAAMC,oBAAoB,GAAGC,qCAAY,CAACC,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP;IACA,MAAM,IAAIK,KAAK,CAAC,uDAAuD,CAAC;EAC5E;EAEA,OAAOL,IAAI;AACf,CAAC;AAEDL,oBAAoB,CAACW,GAAG,GAAG,CAACP,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEC,IAAI,KAAK;EAC1D;EACA,IAAI,CAACV,MAAM,IAAI,CAACQ,KAAK,EAAE;IACnB;EACJ;;EAEA;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;IAC1D;EACJ;EAEAZ,oBAAoB,CAACe,IAAI,CAACZ,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,EAAEC,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,CAAC;AACjG,CAAC;AAEDd,oBAAoB,CAACgB,MAAM,GAAG,CAACZ,MAAM,EAAEQ,KAAK,KAAK;EAC7C,IAAI,CAACR,MAAM,IAAI,CAACQ,KAAK,EAAEK,MAAM,EAAE;IAC3B;EACJ;EAEAjB,oBAAoB,CAACkB,MAAM,CAACf,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,CAAC;AACvE,CAAC;AAQM,MAAMO,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAGnB,oBAA4D","ignoreList":[]}
|
@@ -23,7 +23,7 @@ const convertToTypeStyle = value => {
|
|
23
23
|
...value._web
|
24
24
|
}).flatMap(([unistylesKey, unistylesValue]) => {
|
25
25
|
// Keys to omit
|
26
|
-
if (['_css', '_web', 'variants', 'compoundVariants', 'uni__dependencies'].includes(unistylesKey)) {
|
26
|
+
if (['_css', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
|
27
27
|
return [];
|
28
28
|
}
|
29
29
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_typestyle","require","_pseudo","_breakpoint","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","isPseudo","typestyleValues","$nest","replace","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","media","convertBreakpoint","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAEO,MAAMS,kBAAkB,GAAIC,KAAsB,IAAK;EAC1D;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,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAACC,QAAQ,CAACF,YAAY,CAAC,EAAE;
|
1
|
+
{"version":3,"names":["_typestyle","require","_pseudo","_breakpoint","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","isPseudo","typestyleValues","$nest","replace","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","media","convertBreakpoint","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;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AAW,EAACV,YAAY,CAAC,EAAE;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MAEAA,YAAY,GAAG,IAAI;MAEnB,OAAO,IAAAiB,4BAAiB,EAACnB,KAAK,CAAC;IACnC;;IAEA;IACA,IAAI,IAAAoB,mBAAW,EAACZ,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAO,IAAAY,4BAAiB,EAACZ,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO,IAAAC,gBAAK,EAAC,IAAAC,6BAAiB,EAACH,aAAa,CAAC,EAAE,IAAAI,eAAQ,EAACnB,YAAY,EAAEgB,eAAe,CAAC,CAAC;MAC3F,CAAC,CAAC;IACN;;IAEA;IACA,OAAO,IAAAG,eAAQ,EAACnB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAO,IAAAmB,uBAAgB,EAAC,GAAGzB,WAAW,CAAC;AAC3C,CAAC;AAAA0B,OAAA,CAAA9B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
@@ -4,85 +4,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.create = void 0;
|
7
|
-
var _registry = require("./registry");
|
8
7
|
var _utils = require("./utils");
|
9
8
|
var _runtime = require("./runtime");
|
10
9
|
var _variants = require("./variants");
|
11
|
-
var _listener = require("./listener");
|
12
10
|
const create = stylesheet => {
|
13
11
|
const computedStylesheet = typeof stylesheet === 'function' ? stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime) : stylesheet;
|
14
|
-
|
15
|
-
const
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
args
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
return _listener.UnistylesListener.addListeners(dependencies, () => {
|
27
|
-
const newComputedStylesheet = typeof stylesheet === 'function' ? stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime) : stylesheet;
|
28
|
-
if (!(0, _utils.keyInObject)(newComputedStylesheet, key)) {
|
29
|
-
return;
|
30
|
-
}
|
31
|
-
const value = newComputedStylesheet[key];
|
32
|
-
const result = typeof value === 'function' ? value(...args) : value;
|
33
|
-
_registry.UnistylesRegistry.updateStyles(unistyles, result, className);
|
34
|
-
});
|
35
|
-
};
|
36
|
-
const styles = (0, _utils.reduceObject)(computedStylesheet, (value, key) => {
|
12
|
+
const selectedVariants = new Map();
|
13
|
+
const copyVariants = () => Object.fromEntries(selectedVariants.entries());
|
14
|
+
const addSecrets = (value, key, args) => (0, _utils.assignSecrets)(value, {
|
15
|
+
__uni__key: key,
|
16
|
+
__uni__refs: new Set(),
|
17
|
+
__uni__stylesheet: stylesheet,
|
18
|
+
__uni__args: args,
|
19
|
+
__uni__variants: copyVariants()
|
20
|
+
});
|
21
|
+
const styles = (0, _utils.reduceObject)(computedStylesheet, (value, _key) => {
|
22
|
+
const key = String(_key);
|
37
23
|
if (typeof value === 'function') {
|
38
|
-
const
|
39
|
-
const disposeByRef = new Map();
|
40
|
-
return (...args) => {
|
41
|
-
const [ref] = args.slice(-1);
|
24
|
+
const dynamicStyle = (...args) => {
|
42
25
|
const result = value(...args);
|
43
26
|
const variants = Object.fromEntries((0, _variants.getVariants)({
|
44
27
|
[key]: result
|
45
|
-
},
|
28
|
+
}, copyVariants()));
|
46
29
|
const resultWithVariants = {
|
47
30
|
...result,
|
48
31
|
...variants[key]
|
49
32
|
};
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
webUnistyleByRef.set(ref, webUnistyle);
|
54
|
-
disposeByRef.get(ref)?.();
|
55
|
-
disposeByRef.set(ref, listenToDependencies({
|
56
|
-
key,
|
57
|
-
value,
|
58
|
-
unistyles: webUnistyle.unistyles,
|
59
|
-
className: webUnistyle.className,
|
60
|
-
args
|
61
|
-
}));
|
62
|
-
ref.classList.add(webUnistyle.className);
|
63
|
-
if (storedWebUnistyle) {
|
64
|
-
_registry.UnistylesRegistry.updateStyles(webUnistyle.unistyles, resultWithVariants, webUnistyle.className);
|
65
|
-
}
|
66
|
-
return;
|
67
|
-
}
|
68
|
-
return (0, _utils.toReactNativeClassName)(null, resultWithVariants);
|
33
|
+
|
34
|
+
// Add secrets to result of dynamic styles function
|
35
|
+
return addSecrets((0, _utils.getStyles)(resultWithVariants), key, args);
|
69
36
|
};
|
37
|
+
|
38
|
+
// Add secrets to dynamic styles function
|
39
|
+
return addSecrets(dynamicStyle, key);
|
70
40
|
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
} = _registry.UnistylesRegistry.createStyles(value, key);
|
75
|
-
listenToDependencies({
|
76
|
-
key,
|
77
|
-
value,
|
78
|
-
unistyles,
|
79
|
-
className
|
80
|
-
});
|
81
|
-
return (0, _utils.toReactNativeClassName)(className, value);
|
82
|
-
});
|
83
|
-
(0, _variants.createUseVariants)(styles, newVariants => {
|
84
|
-
lastlySelectedVariants = newVariants;
|
41
|
+
|
42
|
+
// Add secrets to static styles
|
43
|
+
return addSecrets((0, _utils.getStyles)(value), key);
|
85
44
|
});
|
45
|
+
|
46
|
+
// Inject useVariants hook to styles
|
47
|
+
(0, _variants.createUseVariants)(styles, newVariants => Object.entries(newVariants).forEach(([key, value]) => selectedVariants.set(key, value)));
|
86
48
|
return styles;
|
87
49
|
};
|
88
50
|
exports.create = create;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_utils","require","_runtime","_variants","create","stylesheet","computedStylesheet","UnistylesRuntime","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","assignSecrets","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","reduceObject","_key","String","dynamicStyle","result","variants","getVariants","resultWithVariants","getStyles","createUseVariants","newVariants","forEach","set","exports"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEO,MAAMG,MAAM,GAAIC,UAAiD,IAAK;EACzE,MAAMC,kBAAkB,GAAG,OAAOD,UAAU,KAAK,UAAU,GACrDA,UAAU,CAACE,yBAAgB,CAACC,KAAK,EAAED,yBAAgB,CAACE,WAAW,CAAC,GAChEJ,UAAU;EAChB,MAAMK,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,KAAK,IAAAC,oBAAa,EAACH,KAAK,EAAE;IACpFI,UAAU,EAAEH,GAAG;IACfI,WAAW,EAAE,IAAIC,GAAG,CAAC,CAAC;IACtBC,iBAAiB,EAAEnB,UAAU;IAC7BoB,WAAW,EAAEN,IAAI;IACjBO,eAAe,EAAEd,YAAY,CAAC;EAClC,CAAC,CAAC;EAEF,MAAMe,MAAM,GAAG,IAAAC,mBAAY,EAACtB,kBAAkB,EAAE,CAACW,KAAK,EAAEY,IAAI,KAAK;IAC7D,MAAMX,GAAG,GAAGY,MAAM,CAACD,IAAI,CAAC;IAExB,IAAI,OAAOZ,KAAK,KAAK,UAAU,EAAE;MAC7B,MAAMc,YAAY,GAAGA,CAAC,GAAGZ,IAAgB,KAAK;QAC1C,MAAMa,MAAM,GAAGf,KAAK,CAAC,GAAGE,IAAI,CAAC;QAC7B,MAAMc,QAAQ,GAAGpB,MAAM,CAACC,WAAW,CAAC,IAAAoB,qBAAW,EAAC;UAAE,CAAChB,GAAG,GAAGc;QAAO,CAAC,EAAuCpB,YAAY,CAAC,CAAC,CAAC,CAAC;QACxH,MAAMuB,kBAAkB,GAAG;UACvB,GAAGH,MAAM;UACT,GAAGC,QAAQ,CAACf,GAAG;QACnB,CAAC;;QAED;QACA,OAAOF,UAAU,CAAC,IAAAoB,gBAAS,EAACD,kBAAkB,CAAC,EAAEjB,GAAG,EAAEC,IAAI,CAAC;MAC/D,CAAC;;MAED;MACA,OAAOH,UAAU,CAACe,YAAY,EAAEb,GAAG,CAAC;IACxC;;IAEA;IACA,OAAOF,UAAU,CAAC,IAAAoB,gBAAS,EAACnB,KAAK,CAAC,EAAEC,GAAG,CAAC;EAC5C,CAAC,CAAsC;;EAEvC;EACA,IAAAmB,2BAAiB,EAACV,MAAM,EAAEW,WAAW,IAAIzB,MAAM,CAACE,OAAO,CAACuB,WAAW,CAAC,CAACC,OAAO,CAAC,CAAC,CAACrB,GAAG,EAAED,KAAK,CAAC,KAAKP,gBAAgB,CAAC8B,GAAG,CAACtB,GAAG,EAAED,KAAK,CAAC,CAAC,CAAC;EAEjI,OAAOU,MAAM;AACjB,CAAC;AAAAc,OAAA,CAAArC,MAAA,GAAAA,MAAA","ignoreList":[]}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createUnistylesComponent = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _utils = require("./utils");
|
9
|
+
var _runtime = require("./runtime");
|
10
|
+
var _variants = require("./variants");
|
11
|
+
var _listener = require("./listener");
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
15
|
+
const getStyles = value => {
|
16
|
+
const secrets = (0, _utils.extractSecrets)(value);
|
17
|
+
if (secrets.length === 0) {
|
18
|
+
return undefined;
|
19
|
+
}
|
20
|
+
return secrets.reduce((acc, {
|
21
|
+
__uni__stylesheet,
|
22
|
+
__uni__key,
|
23
|
+
__uni__args = [],
|
24
|
+
__uni__variants
|
25
|
+
}) => {
|
26
|
+
const newComputedStylesheet = typeof __uni__stylesheet === 'function' ? __uni__stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime) : __uni__stylesheet;
|
27
|
+
const style = newComputedStylesheet[__uni__key];
|
28
|
+
const resultHidden = typeof style === 'function' ? style(...__uni__args) : style;
|
29
|
+
const result = (0, _utils.extractHiddenProperties)(resultHidden);
|
30
|
+
const {
|
31
|
+
variants
|
32
|
+
} = Object.fromEntries((0, _variants.getVariants)({
|
33
|
+
variants: result
|
34
|
+
}, __uni__variants));
|
35
|
+
const resultWithVariants = {
|
36
|
+
...result,
|
37
|
+
...variants
|
38
|
+
};
|
39
|
+
return {
|
40
|
+
...acc,
|
41
|
+
...resultWithVariants
|
42
|
+
};
|
43
|
+
}, {});
|
44
|
+
};
|
45
|
+
const createUnistylesComponent = Component => props => {
|
46
|
+
const passedStyles = props.style ?? {};
|
47
|
+
const [style, setStyle] = (0, _react.useState)(getStyles(passedStyles));
|
48
|
+
(0, _react.useEffect)(() => {
|
49
|
+
const newStyles = getStyles(passedStyles);
|
50
|
+
const dependencies = newStyles?.['uni__dependencies'] ?? [];
|
51
|
+
const dispose = _listener.UnistylesListener.addListeners(dependencies, () => setStyle(getStyles(passedStyles)));
|
52
|
+
setStyle(newStyles);
|
53
|
+
return dispose;
|
54
|
+
}, [passedStyles]);
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
56
|
+
...props,
|
57
|
+
style: style
|
58
|
+
});
|
59
|
+
};
|
60
|
+
exports.createUnistylesComponent = createUnistylesComponent;
|
61
|
+
//# sourceMappingURL=createUnistylesComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_utils","_runtime","_variants","_listener","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","getStyles","value","secrets","extractSecrets","length","undefined","reduce","acc","__uni__stylesheet","__uni__key","__uni__args","__uni__variants","newComputedStylesheet","UnistylesRuntime","theme","miniRuntime","style","resultHidden","result","extractHiddenProperties","variants","fromEntries","getVariants","resultWithVariants","createUnistylesComponent","Component","props","passedStyles","setStyle","useState","useEffect","newStyles","dependencies","dispose","UnistylesListener","addListeners","jsx","exports"],"sourceRoot":"../../../src","sources":["web/createUnistylesComponent.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA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N,YAAY,CAAC,CAAC;EAElB,oBACI,IAAAhD,WAAA,CAAAyD,GAAA,EAACX,SAAS;IAAA,GACFC,KAAK;IACTV,KAAK,EAAEA;EAAM,CAChB,CAAC;AAEV,CAAC;AAAAqB,OAAA,CAAAb,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
var _exportNames = {
|
7
7
|
StyleSheet: true,
|
8
8
|
getSSRUnistyles: true,
|
9
|
-
UnistylesRuntime: true
|
9
|
+
UnistylesRuntime: true,
|
10
|
+
UnistylesShadowRegistry: true
|
10
11
|
};
|
11
12
|
exports.StyleSheet = void 0;
|
12
13
|
Object.defineProperty(exports, "UnistylesRuntime", {
|
@@ -15,11 +16,18 @@ Object.defineProperty(exports, "UnistylesRuntime", {
|
|
15
16
|
return _runtime.UnistylesRuntime;
|
16
17
|
}
|
17
18
|
});
|
19
|
+
Object.defineProperty(exports, "UnistylesShadowRegistry", {
|
20
|
+
enumerable: true,
|
21
|
+
get: function () {
|
22
|
+
return _shadowRegistry.UnistylesShadowRegistry;
|
23
|
+
}
|
24
|
+
});
|
18
25
|
exports.getSSRUnistyles = void 0;
|
19
26
|
var _create = require("./create");
|
20
|
-
var _runtime = require("./runtime");
|
21
27
|
var _state = require("./state");
|
22
28
|
var _utils = require("./utils");
|
29
|
+
var _runtime = require("./runtime");
|
30
|
+
var _shadowRegistry = require("./shadowRegistry");
|
23
31
|
var _mock = require("./mock");
|
24
32
|
Object.keys(_mock).forEach(function (key) {
|
25
33
|
if (key === "default" || key === "__esModule") return;
|
@@ -46,6 +54,7 @@ const StyleSheet = exports.StyleSheet = {
|
|
46
54
|
flatten: (...styles) => (0, _utils.deepMergeObjects)(...styles),
|
47
55
|
hairlineWidth: 1
|
48
56
|
};
|
49
|
-
|
57
|
+
// TODO: Work on SSR
|
58
|
+
const getSSRUnistyles = () => [];
|
50
59
|
exports.getSSRUnistyles = getSSRUnistyles;
|
51
60
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_create","require","
|
1
|
+
{"version":3,"names":["_create","require","_state","_utils","_runtime","_shadowRegistry","_mock","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","StyleSheet","configure","UnistylesState","init","create","absoluteFill","position","left","top","right","bottom","compose","a","b","deepMergeObjects","flatten","styles","hairlineWidth","getSSRUnistyles"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAiBA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAAM,MAAA,CAAAC,IAAA,CAAAF,KAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,KAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAjBO,MAAMS,UAAU,GAAAJ,OAAA,CAAAI,UAAA,GAAG;EACtBC,SAAS,EAAEC,qBAAc,CAACC,IAAI;EAC9BC,MAAM,EAANA,cAAM;EACNC,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAK,IAAAC,uBAAgB,EAACF,CAAC,EAAEC,CAAC,CAAC;EACzDE,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAK,IAAAF,uBAAgB,EAAC,GAAGE,MAAM,CAAC;EAClEC,aAAa,EAAE;AACnB,CAAC;AAMD;AACO,MAAMC,eAAe,GAAGA,CAAA,KAAM,EAAE;AAAAtB,OAAA,CAAAsB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
@@ -9,5 +9,12 @@ Object.defineProperty(exports, "UnistylesListener", {
|
|
9
9
|
return _listener.UnistylesListener;
|
10
10
|
}
|
11
11
|
});
|
12
|
+
Object.defineProperty(exports, "listenToDependencies", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _listenToDependencies.listenToDependencies;
|
16
|
+
}
|
17
|
+
});
|
12
18
|
var _listener = require("./listener");
|
19
|
+
var _listenToDependencies = require("./listenToDependencies");
|
13
20
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_listener","require"],"sourceRoot":"../../../../src","sources":["web/listener/index.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_listener","require","_listenToDependencies"],"sourceRoot":"../../../../src","sources":["web/listener/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA","ignoreList":[]}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.listenToDependencies = void 0;
|
7
|
+
var _listener = require("./listener");
|
8
|
+
var _runtime = require("../runtime");
|
9
|
+
var _utils = require("../utils");
|
10
|
+
var _registry = require("../registry");
|
11
|
+
const listenToDependencies = ({
|
12
|
+
key,
|
13
|
+
className,
|
14
|
+
unistyles,
|
15
|
+
args = [],
|
16
|
+
stylesheet
|
17
|
+
}) => {
|
18
|
+
const newComputedStylesheet = typeof stylesheet === 'function' ? stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime) : stylesheet;
|
19
|
+
const _value = (0, _utils.keyInObject)(newComputedStylesheet, key) ? newComputedStylesheet[key] : undefined;
|
20
|
+
if (!_value) {
|
21
|
+
return;
|
22
|
+
}
|
23
|
+
const value = typeof _value === 'function' ? _value(...args) : _value;
|
24
|
+
const dependencies = 'uni__dependencies' in value ? value['uni__dependencies'] : [];
|
25
|
+
if (dependencies.length === 0) {
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
return _listener.UnistylesListener.addListeners(dependencies, () => {
|
29
|
+
const newComputedStylesheet = typeof stylesheet === 'function' ? stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime) : stylesheet;
|
30
|
+
if (!(0, _utils.keyInObject)(newComputedStylesheet, key)) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
const value = newComputedStylesheet[key];
|
34
|
+
const result = typeof value === 'function' ? value(...args) : value;
|
35
|
+
_registry.UnistylesRegistry.updateStyles(unistyles, result, className);
|
36
|
+
});
|
37
|
+
};
|
38
|
+
exports.listenToDependencies = listenToDependencies;
|
39
|
+
//# sourceMappingURL=listenToDependencies.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_listener","require","_runtime","_utils","_registry","listenToDependencies","key","className","unistyles","args","stylesheet","newComputedStylesheet","UnistylesRuntime","theme","miniRuntime","_value","keyInObject","undefined","value","dependencies","length","UnistylesListener","addListeners","result","UnistylesRegistry","updateStyles","exports"],"sourceRoot":"../../../../src","sources":["web/listener/listenToDependencies.ts"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAUO,MAAMI,o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ArB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.UnistylesListener = void 0;
|
7
7
|
var _NativePlatform = require("../../specs/NativePlatform");
|
8
8
|
var _runtime = require("../runtime");
|
9
9
|
class UnistylesListenerBuilder {
|
@@ -31,6 +31,5 @@ class UnistylesListenerBuilder {
|
|
31
31
|
};
|
32
32
|
};
|
33
33
|
}
|
34
|
-
exports.UnistylesListenerBuilder = UnistylesListenerBuilder;
|
35
34
|
const UnistylesListener = exports.UnistylesListener = new UnistylesListenerBuilder();
|
36
35
|
//# sourceMappingURL=listener.js.map
|
@@ -1 +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","
|
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/listener.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACC,kCAAkB,CAAC,CAACH,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAII,GAAG,CAAe,CAAC,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 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.StatusBar = exports.NavigationBar = void 0;
|
7
7
|
const StatusBar = exports.StatusBar = {
|
8
8
|
width: 0,
|
9
9
|
height: 0,
|
@@ -25,13 +25,4 @@ const NavigationBar = exports.NavigationBar = {
|
|
25
25
|
__type: 'web',
|
26
26
|
name: 'NavigationBar'
|
27
27
|
};
|
28
|
-
const UnistylesShadowRegistry = exports.UnistylesShadowRegistry = {
|
29
|
-
name: 'UnistylesShadowRegistry',
|
30
|
-
__type: 'web',
|
31
|
-
equals: () => true,
|
32
|
-
toString: () => 'UnistylesShadowRegistry',
|
33
|
-
dispose: () => {},
|
34
|
-
add: () => {},
|
35
|
-
remove: () => {}
|
36
|
-
};
|
37
28
|
//# sourceMappingURL=mock.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["StatusBar","exports","width","height","setStyle","setHidden","setBackgroundColor","equals","toString","__type","name","NavigationBar"
|
1
|
+
{"version":3,"names":["StatusBar","exports","width","height","setStyle","setHidden","setBackgroundColor","equals","toString","__type","name","NavigationBar"],"sourceRoot":"../../../src","sources":["web/mock.ts"],"mappings":";;;;;;AAGO,MAAMA,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACpCE,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,QAAQ,EAAEA,CAAA,KAAM,CAAC,CAAC;EAClBC,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EACnBC,kBAAkB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC5BC,MAAM,EAAEA,CAAA,KAAM,IAAI;EAClBC,QAAQ,EAAEA,CAAA,KAAM,WAAW;EAC3BC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE;AACV,CAAC;AAEM,MAAMC,aAAgC,GAAAV,OAAA,CAAAU,aAAA,GAAG;EAC5CT,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTE,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EACnBC,kBAAkB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC5BC,MAAM,EAAEA,CAAA,KAAM,IAAI;EAClBC,QAAQ,EAAEA,CAAA,KAAM,eAAe;EAC/BC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE;AACV,CAAC","ignoreList":[]}
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.pseudos = exports.isPseudo = void 0;
|
7
|
-
|
8
|
-
const
|
9
|
-
const isPseudo = selector => pseudos.includes(selector);
|
7
|
+
const pseudos = exports.pseudos = ['_-moz-broken', '_-moz-drag-over', '_-moz-first-node', '_-moz-handler-blocked', '_-moz-handler-crashed', '_-moz-handler-disabled', '_-moz-last-node', '_-moz-loading', '_-moz-locale-dir(ltr)', '_-moz-locale-dir(rtl)', '_-moz-only-whitespace', '_-moz-submit-invalid', '_-moz-suppressed', '_-moz-user-disabled', '_-moz-window-inactive', '_active', '_any-link', '_autofill', '_blank', '_buffering', '_checked', '_current', '_default', '_defined', '_dir(', '_disabled', '_empty', '_enabled', '_first', '_first-child', '_first-of-type', '_focus', '_focus-visible', '_focus-within', '_fullscreen', '_future', '_has(', '_host', '_host-context(', '_host(', '_hover', '_in-range', '_indeterminate', '_invalid', '_is(', '_lang(', '_last-child', '_last-of-type', '_left', '_link', '_local-link', '_modal', '_muted', '_not(', '_nth-child(', '_nth-last-child(', '_nth-last-of-type(', '_nth-of-type(', '_only-child', '_only-of-type', '_optional', '_out-of-range', '_past', '_paused', '_picture-in-picture', '_placeholder-shown', '_playing', '_popover-open', '_read-only', '_read-write', '_required', '_right', '_scope', '_seeking', '_stalled', '_state(', '_target', '_target-within', '_user-invalid', '_user-valid', '_valid', '_visited', '_volume-locked', '_where(', '_-moz-color-swatch', '_-moz-focus-inner', '_-moz-list-bullet', '_-moz-list-number', '_-moz-meter-bar', '_-moz-progress-bar', '_-moz-range-progress', '_-moz-range-thumb', '_-moz-range-track', '_-webkit-inner-spin-button', '_-webkit-meter-barDeprecated', '_-webkit-meter-even-less-good-value', '_-webkit-meter-inner-element', '_-webkit-meter-optimum-value', '_-webkit-meter-suboptimum-value', '_-webkit-progress-bar', '_-webkit-progress-inner-element', '_-webkit-progress-value', '_-webkit-scrollbar', '_-webkit-search-cancel-button', '_-webkit-search-results-button', '_-webkit-slider-runnable-track', '_-webkit-slider-thumb', '_after', '_backdrop', '_before', '_cue', '_file-selector-button', '_first-letter', '_first-line', '_grammar-error', '_highlight(', '_marker', '_part(', '_placeholder', '_selection', '_slotted(', '_spelling-error', '_target-text', '_view-transition', '_view-transition-group', '_view-transition-image-pair', '_view-transition-new', '_view-transition-old'];
|
8
|
+
const isPseudo = selector => pseudos.some(pseudo => selector.startsWith(pseudo));
|
10
9
|
exports.isPseudo = isPseudo;
|
11
10
|
//# sourceMappingURL=pseudo.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["pseudos","exports","isPseudo","selector","
|
1
|
+
{"version":3,"names":["pseudos","exports","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../src","sources":["web/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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AAQ,GAAIC,QAAgB,IAAKH,OAAO,CAACI,IAAI,CAACC,MAAM,IAAIF,QAAQ,CAACG,UAAU,CAACD,MAAM,CAAC,CAAC;AAAAJ,OAAA,CAAAC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.UnistylesRegistry = void 0;
|
7
7
|
var _typestyle = require("typestyle");
|
8
8
|
var _convert = require("./convert");
|
9
|
-
var _state = require("./state");
|
10
9
|
class UnistylesRegistryBuilder {
|
11
10
|
createStyles = (stylesheet, key) => {
|
12
|
-
const
|
13
|
-
const unistyles = (0, _typestyle.createTypeStyle)(stylesTag);
|
11
|
+
const unistyles = (0, _typestyle.createTypeStyle)();
|
14
12
|
const typestyleStylesheet = (0, _convert.convertToTypeStyle)(stylesheet);
|
15
13
|
const className = unistyles.style({
|
16
|
-
$debugName:
|
14
|
+
$debugName: `${key}-${Math.random().toString(16).slice(10)}`
|
17
15
|
}, typestyleStylesheet);
|
18
16
|
if (stylesheet._web?._css) {
|
19
17
|
const customClassName = Array.isArray(stylesheet._web._css) ? stylesheet._web._css.join(' ') : stylesheet._web._css;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_typestyle","require","_convert","
|
1
|
+
{"version":3,"names":["_typestyle","require","_convert","UnistylesRegistryBuilder","createStyles","stylesheet","key","unistyles","createTypeStyle","typestyleStylesheet","convertToTypeStyle","className","style","$debugName","Math","random","toString","slice","_web","_css","customClassName","Array","isArray","join","updateStyles","reinit","cssRule","UnistylesRegistry","exports"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EAC3BC,YAAY,GAAGA,CAACC,UAA2B,EAAEC,GAAW,KAAK;IACzD,MAAMC,SAAS,GAAG,IAAAC,0BAAe,EAAC,CAAC;IACnC,MAAMC,mBAAmB,GAAG,IAAAC,2BAAkB,EAACL,UAAU,CAAC;IAE1D,MAAMM,SAAS,GAAGJ,SAAS,CAACK,KAAK,CAAC;MAC9BC,UAAU,EAAE,GAAGP,GAAG,IAAIQ,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,EAAE,CAAC;IAC9D,CAAC,EAAER,mBAAmB,CAAC;IAEvB,IAAIJ,UAAU,CAACa,IAAI,EAAEC,IAAI,EAAE;MACvB,MAAMC,eAAe,GAAGC,KAAK,CAACC,OAAO,CAACjB,UAAU,CAACa,IAAI,CAACC,IAAI,CAAC,GACrDd,UAAU,CAACa,IAAI,CAACC,IAAI,CAACI,IAAI,CAAC,GAAG,CAAC,GAC9BlB,UAAU,CAACa,IAAI,CAACC,IAAI;MAE1B,OAAO;QACHR,SAAS,EAAE,GAAGA,SAAS,IAAIS,eAAe,EAAE;QAC5Cb;MACJ,CAAC;IACL;IAEA,OAAO;MACHI,SAAS;MACTJ;IACJ,CAAC;EACL,CAAC;EAEDiB,YAAY,GAAGA,CAACjB,SAAoB,EAAEF,UAA2B,EAAEM,SAAiB,KAAK;IACrF,MAAMF,mBAAmB,GAAG,IAAAC,2BAAkB,EAACL,UAAU,CAAC;IAE1DE,SAAS,CAACkB,MAAM,CAAC,CAAC;IAClBlB,SAAS,CAACmB,OAAO,CAAC,IAAIf,SAAS,EAAE,EAAEF,mBAAmB,CAAC;EAC3D,CAAC;AACL;AAEO,MAAMkB,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIxB,wBAAwB,CAAC,CAAC","ignoreList":[]}
|
@@ -158,7 +158,6 @@ class UnistylesRuntimeBuilder {
|
|
158
158
|
}
|
159
159
|
_state.UnistylesState.themes.set(themeName, updater(oldTheme));
|
160
160
|
};
|
161
|
-
getSSRUnistyles = () => _state.UnistylesState.tags;
|
162
161
|
}
|
163
162
|
const UnistylesRuntime = exports.UnistylesRuntime = new UnistylesRuntimeBuilder();
|
164
163
|
//# sourceMappingURL=runtime.js.map
|