@tamagui/helpers 1.89.0-1706483140977 → 1.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/clamp.native.js +2 -23
- package/dist/esm/clamp.native.js.map +1 -1
- package/dist/esm/composeEventHandlers.native.js +2 -23
- package/dist/esm/composeEventHandlers.native.js.map +1 -1
- package/dist/esm/concatClassName.native.js +2 -23
- package/dist/esm/concatClassName.native.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.native.js +8 -31
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/native.js +4 -25
- package/dist/esm/native.js.map +1 -1
- package/dist/esm/types.native.js +0 -14
- package/dist/esm/types.native.js.map +2 -2
- package/dist/esm/validStyleProps.native.js +4 -35
- package/dist/esm/validStyleProps.native.js.map +1 -1
- package/dist/esm/withStaticProperties.native.js +5 -26
- package/dist/esm/withStaticProperties.native.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -0
- package/src/native.ts +70 -0
- package/src/types.ts +0 -6
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/native.d.ts +17 -0
- package/types/native.d.ts.map +1 -0
- package/types/types.d.ts +0 -2
- package/types/types.d.ts.map +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -16,6 +16,7 @@ __reExport(src_exports, require("./clamp"), module.exports);
|
|
|
16
16
|
__reExport(src_exports, require("./composeEventHandlers"), module.exports);
|
|
17
17
|
__reExport(src_exports, require("./concatClassName"), module.exports);
|
|
18
18
|
__reExport(src_exports, require("./types"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./native"), module.exports);
|
|
19
20
|
__reExport(src_exports, require("./validStyleProps"), module.exports);
|
|
20
21
|
__reExport(src_exports, require("./withStaticProperties"), module.exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oBADd;AAEA,wBAAc,mCAFd;AAGA,wBAAc,8BAHd;AAIA,wBAAc,oBAJd;AAKA,wBAAc,
|
|
4
|
+
"mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oBADd;AAEA,wBAAc,mCAFd;AAGA,wBAAc,8BAHd;AAIA,wBAAc,oBAJd;AAKA,wBAAc,qBALd;AAMA,wBAAc,8BANd;AAOA,wBAAc,mCAPd;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -17,6 +17,7 @@ __reExport(src_exports, require("./clamp"), module.exports);
|
|
|
17
17
|
__reExport(src_exports, require("./composeEventHandlers"), module.exports);
|
|
18
18
|
__reExport(src_exports, require("./concatClassName"), module.exports);
|
|
19
19
|
__reExport(src_exports, require("./types"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("./native"), module.exports);
|
|
20
21
|
__reExport(src_exports, require("./validStyleProps"), module.exports);
|
|
21
22
|
__reExport(src_exports, require("./withStaticProperties"), module.exports);
|
|
22
23
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -26,6 +27,7 @@ __reExport(src_exports, require("./withStaticProperties"), module.exports);
|
|
|
26
27
|
...require("./composeEventHandlers"),
|
|
27
28
|
...require("./concatClassName"),
|
|
28
29
|
...require("./types"),
|
|
30
|
+
...require("./native"),
|
|
29
31
|
...require("./validStyleProps"),
|
|
30
32
|
...require("./withStaticProperties")
|
|
31
33
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oBADd;AAEA,wBAAc,mCAFd;AAGA,wBAAc,8BAHd;AAIA,wBAAc,oBAJd;AAKA,wBAAc,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oBADd;AAEA,wBAAc,mCAFd;AAGA,wBAAc,8BAHd;AAIA,wBAAc,oBAJd;AAKA,wBAAc,qBALd;AAMA,wBAAc,8BANd;AAOA,wBAAc,mCAPd;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/clamp.native.js
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var clamp_exports = {};
|
|
17
|
-
__export(clamp_exports, {
|
|
18
|
-
clamp: () => clamp
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(clamp_exports);
|
|
21
1
|
function clamp(value, [min, max]) {
|
|
22
2
|
return Math.min(max, Math.max(min, value));
|
|
23
3
|
}
|
|
24
|
-
|
|
25
|
-
0 && (module.exports = {
|
|
4
|
+
export {
|
|
26
5
|
clamp
|
|
27
|
-
}
|
|
6
|
+
};
|
|
28
7
|
//# sourceMappingURL=clamp.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/clamp.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAO,SAAS,MAAM,OAAe,CAAC,KAAK,GAAG,GAA6B;AACzE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var composeEventHandlers_exports = {};
|
|
17
|
-
__export(composeEventHandlers_exports, {
|
|
18
|
-
composeEventHandlers: () => composeEventHandlers
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(composeEventHandlers_exports);
|
|
21
1
|
function composeEventHandlers(og, next, { checkDefaultPrevented = !0 } = {}) {
|
|
22
2
|
return !og || !next ? next || og || void 0 : (event) => {
|
|
23
3
|
if (og == null || og(event), !event || !(checkDefaultPrevented && "defaultPrevented" in event) || // @ts-ignore
|
|
@@ -25,8 +5,7 @@ function composeEventHandlers(og, next, { checkDefaultPrevented = !0 } = {}) {
|
|
|
25
5
|
return next == null ? void 0 : next(event);
|
|
26
6
|
};
|
|
27
7
|
}
|
|
28
|
-
|
|
29
|
-
0 && (module.exports = {
|
|
8
|
+
export {
|
|
30
9
|
composeEventHandlers
|
|
31
|
-
}
|
|
10
|
+
};
|
|
32
11
|
//# sourceMappingURL=composeEventHandlers.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/composeEventHandlers.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAIO,SAAS,qBACd,IACA,MACA,EAAE,wBAAwB,GAAK,IAAI,CAAC,GACpC;AACA,SAAI,CAAC,MAAM,CAAC,OACH,QAAQ,MAAM,SAEhB,CAAC,UAAa;AAEnB,QADA,iBAAK,QAEH,CAAC,SACD,EAAE,yBAAyB,sBAAsB;AAAA,IAEhD,sBAAsB,SAAS,CAAC,MAAM;AAEvC,aAAO,6BAAO;AAAA,EAElB;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var concatClassName_exports = {};
|
|
17
|
-
__export(concatClassName_exports, {
|
|
18
|
-
concatClassName: () => concatClassName
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(concatClassName_exports);
|
|
21
1
|
function concatClassName(_cn) {
|
|
22
2
|
const args = arguments, usedPrefixes = [];
|
|
23
3
|
let final = "";
|
|
@@ -66,8 +46,7 @@ const pseudoInvert = {
|
|
|
66
46
|
focus: "focusStyle",
|
|
67
47
|
press: "pressStyle"
|
|
68
48
|
};
|
|
69
|
-
|
|
70
|
-
0 && (module.exports = {
|
|
49
|
+
export {
|
|
71
50
|
concatClassName
|
|
72
|
-
}
|
|
51
|
+
};
|
|
73
52
|
//# sourceMappingURL=concatClassName.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/concatClassName.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAUO,SAAS,gBAAgB,KAAqD;AACnF,QAAM,OAAO,WACP,eAAyB,CAAC;AAChC,MAAI,QAAQ;AAEZ,QAAM,MAAM,KAAK;AACjB,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,KAAK,CAAC;AAElB,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,OAAQ,UAAU;AAElD,oBAAc,eAAe,CAAC,GAC9B,YAAY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|
export * from "./concatClassName";
|
|
5
5
|
export * from "./types";
|
|
6
|
+
export * from "./native";
|
|
6
7
|
export * from "./validStyleProps";
|
|
7
8
|
export * from "./withStaticProperties";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.native.js
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
return to;
|
|
11
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
12
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
-
var src_exports = {};
|
|
14
|
-
module.exports = __toCommonJS(src_exports);
|
|
15
|
-
__reExport(src_exports, require("@tamagui/simple-hash"), module.exports);
|
|
16
|
-
__reExport(src_exports, require("./clamp"), module.exports);
|
|
17
|
-
__reExport(src_exports, require("./composeEventHandlers"), module.exports);
|
|
18
|
-
__reExport(src_exports, require("./concatClassName"), module.exports);
|
|
19
|
-
__reExport(src_exports, require("./types"), module.exports);
|
|
20
|
-
__reExport(src_exports, require("./validStyleProps"), module.exports);
|
|
21
|
-
__reExport(src_exports, require("./withStaticProperties"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("@tamagui/simple-hash"),
|
|
25
|
-
...require("./clamp"),
|
|
26
|
-
...require("./composeEventHandlers"),
|
|
27
|
-
...require("./concatClassName"),
|
|
28
|
-
...require("./types"),
|
|
29
|
-
...require("./validStyleProps"),
|
|
30
|
-
...require("./withStaticProperties")
|
|
31
|
-
});
|
|
1
|
+
export * from "@tamagui/simple-hash";
|
|
2
|
+
export * from "./clamp";
|
|
3
|
+
export * from "./composeEventHandlers";
|
|
4
|
+
export * from "./concatClassName";
|
|
5
|
+
export * from "./types";
|
|
6
|
+
export * from "./native";
|
|
7
|
+
export * from "./validStyleProps";
|
|
8
|
+
export * from "./withStaticProperties";
|
|
32
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/native.js
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var native_exports = {};
|
|
17
|
-
__export(native_exports, {
|
|
18
|
-
shouldRenderNativePlatform: () => shouldRenderNativePlatform
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(native_exports);
|
|
21
|
-
var import_constants = require("@tamagui/constants");
|
|
1
|
+
import { currentPlatform } from "@tamagui/constants";
|
|
22
2
|
const ALL_PLATFORMS = ["web", "android", "ios"];
|
|
23
3
|
function shouldRenderNativePlatform(nativeProp) {
|
|
24
4
|
if (!nativeProp)
|
|
25
5
|
return null;
|
|
26
6
|
const userRequestedPlatforms = resolvePlatformNames(nativeProp);
|
|
27
7
|
for (const platform of ALL_PLATFORMS)
|
|
28
|
-
if (platform ===
|
|
8
|
+
if (platform === currentPlatform && userRequestedPlatforms.has(platform))
|
|
29
9
|
return platform;
|
|
30
10
|
return null;
|
|
31
11
|
}
|
|
@@ -33,8 +13,7 @@ function resolvePlatformNames(nativeProp) {
|
|
|
33
13
|
const platforms = nativeProp === !0 ? ALL_PLATFORMS : nativeProp === !1 ? [] : Array.isArray(nativeProp) ? nativeProp : [nativeProp], set = new Set(platforms);
|
|
34
14
|
return set.has("mobile") && (set.add("android"), set.add("ios"), set.delete("mobile")), set;
|
|
35
15
|
}
|
|
36
|
-
|
|
37
|
-
0 && (module.exports = {
|
|
16
|
+
export {
|
|
38
17
|
shouldRenderNativePlatform
|
|
39
|
-
}
|
|
18
|
+
};
|
|
40
19
|
//# sourceMappingURL=native.js.map
|
package/dist/esm/native.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/native.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,uBAAuB;AAuBhC,MAAM,gBAA0C,CAAC,OAAO,WAAW,KAAK;AAajE,SAAS,2BAA2B,YAA0B;AACnE,MAAI,CAAC;AACH,WAAO;AAET,QAAM,yBAAyB,qBAAqB,UAAU;AAE9D,aAAW,YAAY;AACrB,QAAI,aAAa,mBAAmB,uBAAuB,IAAI,QAAQ;AACrE,aAAO;AAIX,SAAO;AACT;AAEA,SAAS,qBAAqB,YAAyB;AACrD,QAAM,YACJ,eAAe,KACX,gBACA,eAAe,KACb,CAAC,IACD,MAAM,QAAQ,UAAU,IACtB,aACA,CAAC,UAAU,GACf,MAAM,IAAI,IAAI,SAAS;AAE7B,SAAI,IAAI,IAAI,QAAQ,MAElB,IAAI,IAAI,SAAS,GACjB,IAAI,IAAI,KAAK,GACb,IAAI,OAAO,QAAQ,IAEd;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/types.native.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
return to;
|
|
11
|
-
};
|
|
12
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
-
var types_exports = {};
|
|
14
|
-
module.exports = __toCommonJS(types_exports);
|
|
15
1
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var validStyleProps_exports = {};
|
|
17
|
-
__export(validStyleProps_exports, {
|
|
18
|
-
stylePropsAll: () => stylePropsAll,
|
|
19
|
-
stylePropsFont: () => stylePropsFont,
|
|
20
|
-
stylePropsText: () => stylePropsText,
|
|
21
|
-
stylePropsTextOnly: () => stylePropsTextOnly,
|
|
22
|
-
stylePropsTransform: () => stylePropsTransform,
|
|
23
|
-
stylePropsUnitless: () => stylePropsUnitless,
|
|
24
|
-
stylePropsView: () => stylePropsView,
|
|
25
|
-
tokenCategories: () => tokenCategories,
|
|
26
|
-
validPseudoKeys: () => validPseudoKeys,
|
|
27
|
-
validStyles: () => validStyles,
|
|
28
|
-
validStylesOnBaseProps: () => validStylesOnBaseProps
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(validStyleProps_exports);
|
|
31
|
-
var import_constants = require("@tamagui/constants");
|
|
1
|
+
import { isAndroid } from "@tamagui/constants";
|
|
32
2
|
const placeHolderTextColors = {
|
|
33
3
|
placeholderTextColor: !0
|
|
34
4
|
}, validStylesOnBaseProps = {
|
|
@@ -200,7 +170,7 @@ const placeHolderTextColors = {
|
|
|
200
170
|
...validStylesOnBaseProps,
|
|
201
171
|
...stylePropsTransform,
|
|
202
172
|
...stylePropsUnitless,
|
|
203
|
-
...
|
|
173
|
+
...isAndroid ? { elevationAndroid: !0 } : {}
|
|
204
174
|
}, stylePropsFont = {
|
|
205
175
|
fontFamily: !0,
|
|
206
176
|
fontSize: !0,
|
|
@@ -230,8 +200,7 @@ const placeHolderTextColors = {
|
|
|
230
200
|
...validPseudoKeys,
|
|
231
201
|
...stylePropsView
|
|
232
202
|
};
|
|
233
|
-
|
|
234
|
-
0 && (module.exports = {
|
|
203
|
+
export {
|
|
235
204
|
stylePropsAll,
|
|
236
205
|
stylePropsFont,
|
|
237
206
|
stylePropsText,
|
|
@@ -243,5 +212,5 @@ const placeHolderTextColors = {
|
|
|
243
212
|
validPseudoKeys,
|
|
244
213
|
validStyles,
|
|
245
214
|
validStylesOnBaseProps
|
|
246
|
-
}
|
|
215
|
+
};
|
|
247
216
|
//# sourceMappingURL=validStyleProps.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/validStyleProps.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,iBAAwB;AAIjC,MAAM,wBAAwB;AAAA,EAC5B,sBAAsB;AACxB,GAEa,yBAAyB;AAAA,EACpC,GAAG;AACL,GAEM,aAAa;AAAA,EACjB,OAAO;AAAA,EACP,GAAG;AAAA,EACH,qBAAqB;AAAA,EACrB,iBAAiB;AACnB,GAIa,kBAAkB;AAAA,EAC7B,QAAQ;AAAA,IACN,cAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,sBAAsB;AAAA,IACtB,wBAAwB;AAAA,IACxB,yBAAyB;AAAA;AAAA,IAGzB,wBAAwB;AAAA,IACxB,sBAAsB;AAAA,IACtB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,EACtB;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,uBAAu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GAAG;AAAA,EAwBH,GAAI,YAAY,EAAE,kBAAkB,GAAK,IAAI,CAAC;AAChD,GAEa,iBAAiB;AAAA,EAC5B,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,eAAe;AACjB,GAEa,qBAAqB;AAAA,EAChC,GAAG;AAAA,EACH,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,GAAG;AAAA,EACH,kBAAkB;AAAA,EAClB,kBAAkB;AAcpB,GAEa,iBAAiB;AAAA,EAC5B,GAAG;AAAA,EACH,GAAG;AACL,GAEa,gBAAgB,gBAEhB,kBAAkB;AAAA,EAC7B,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AACd,GAEa,cAAc;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AACL;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var withStaticProperties_exports = {};
|
|
17
|
-
__export(withStaticProperties_exports, {
|
|
18
|
-
withStaticProperties: () => withStaticProperties
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(withStaticProperties_exports);
|
|
21
|
-
var import_react = require("react");
|
|
1
|
+
import { createElement, forwardRef } from "react";
|
|
22
2
|
const Decorated = Symbol(), withStaticProperties = (component, staticProps) => {
|
|
23
3
|
const next = (() => {
|
|
24
4
|
if (component[Decorated]) {
|
|
25
|
-
const _ =
|
|
26
|
-
(props, ref) =>
|
|
5
|
+
const _ = forwardRef(
|
|
6
|
+
(props, ref) => createElement(component, { ...props, ref })
|
|
27
7
|
);
|
|
28
8
|
for (const key in component) {
|
|
29
9
|
const v = component[key];
|
|
@@ -34,8 +14,7 @@ const Decorated = Symbol(), withStaticProperties = (component, staticProps) => {
|
|
|
34
14
|
})();
|
|
35
15
|
return Object.assign(next, staticProps), next[Decorated] = !0, next;
|
|
36
16
|
};
|
|
37
|
-
|
|
38
|
-
0 && (module.exports = {
|
|
17
|
+
export {
|
|
39
18
|
withStaticProperties
|
|
40
|
-
}
|
|
19
|
+
};
|
|
41
20
|
//# sourceMappingURL=withStaticProperties.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/withStaticProperties.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,eAAe,kBAAkB;AAE1C,MAAM,YAAY,OAAO,GAIZ,uBAAuB,CAClC,WACA,gBACmB;AAEnB,QAAM,QAAQ,MAAM;AAClB,QAAI,UAAU,SAAS,GAAG;AACxB,YAAM,IAAI;AAAA,QAAW,CAAC,OAAO,QAC3B,cAAc,WAAkB,EAAE,GAAG,OAAO,IAAI,CAAC;AAAA,MACnD;AAEA,iBAAW,OAAO,WAAW;AAC3B,cAAM,IAAI,UAAU,GAAG;AAEvB,UAAE,GAAG,IAAI,KAAK,OAAO,KAAM,WAAW,EAAE,GAAG,EAAE,IAAI;AAAA,MACnD;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG;AAGH,gBAAO,OAAO,MAAM,WAAW,GAC/B,KAAK,SAAS,IAAI,IAEX;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"clean:build": "tamagui-build clean:build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tamagui/constants": "1.89.
|
|
23
|
-
"@tamagui/simple-hash": "1.89.
|
|
22
|
+
"@tamagui/constants": "1.89.1",
|
|
23
|
+
"@tamagui/simple-hash": "1.89.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tamagui/build": "1.89.
|
|
26
|
+
"@tamagui/build": "1.89.1"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
package/src/index.ts
CHANGED
package/src/native.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { currentPlatform } from '@tamagui/constants'
|
|
2
|
+
|
|
3
|
+
// these types and helpers are to be used on the components that support the `native` prop
|
|
4
|
+
// some usage examples are:
|
|
5
|
+
// `<Component native` means render natively on any platform if possible
|
|
6
|
+
// `<Component native={false}` means opt out of native
|
|
7
|
+
// `<Component native="web"` means render natively on web if possible
|
|
8
|
+
// `<Component native={["web", "android"]}` means render natively on web and android if possible
|
|
9
|
+
// `<Component native={["mobile"]}` means render natively on mobile (android or ios) if possible
|
|
10
|
+
|
|
11
|
+
export type NativePlatform =
|
|
12
|
+
| 'web'
|
|
13
|
+
| 'mobile' // called 'mobile' instead of 'native' because things could be 'native' to web as well
|
|
14
|
+
| 'android'
|
|
15
|
+
| 'ios'
|
|
16
|
+
|
|
17
|
+
export type ExplicitNativePlatform = Exclude<NativePlatform, 'mobile'>
|
|
18
|
+
|
|
19
|
+
export type NativeValue<Platform extends NativePlatform = NativePlatform> =
|
|
20
|
+
| boolean
|
|
21
|
+
| Platform
|
|
22
|
+
| Platform[]
|
|
23
|
+
|
|
24
|
+
const ALL_PLATFORMS: ExplicitNativePlatform[] = ['web', 'android', 'ios']
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* takes in what user has inputted the native-supporting component and returns the name of the native platform we should render
|
|
28
|
+
*
|
|
29
|
+
* @example ['android'] => 'android' (when current platform is android)
|
|
30
|
+
* @example ['android'] => null (when current platform is not android)
|
|
31
|
+
* @example ['mobile'] => 'ios' (when current platform is ios)
|
|
32
|
+
*
|
|
33
|
+
* @param supportedSpecificNativeValues the platforms your component/system supports
|
|
34
|
+
* @param nativeProp the platforms your user is requesting you to use
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export function shouldRenderNativePlatform(nativeProp?: NativeValue) {
|
|
38
|
+
if (!nativeProp) {
|
|
39
|
+
return null
|
|
40
|
+
}
|
|
41
|
+
const userRequestedPlatforms = resolvePlatformNames(nativeProp)
|
|
42
|
+
|
|
43
|
+
for (const platform of ALL_PLATFORMS) {
|
|
44
|
+
if (platform === currentPlatform && userRequestedPlatforms.has(platform)) {
|
|
45
|
+
return platform
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return null
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function resolvePlatformNames(nativeProp: NativeValue) {
|
|
53
|
+
const platforms: NativePlatform[] =
|
|
54
|
+
nativeProp === true // all native platforms
|
|
55
|
+
? ALL_PLATFORMS
|
|
56
|
+
: nativeProp === false // no native platform
|
|
57
|
+
? []
|
|
58
|
+
: Array.isArray(nativeProp)
|
|
59
|
+
? nativeProp
|
|
60
|
+
: [nativeProp]
|
|
61
|
+
const set = new Set(platforms)
|
|
62
|
+
|
|
63
|
+
if (set.has('mobile')) {
|
|
64
|
+
// mobile means android and ios so we'll just use the explicit platforms here
|
|
65
|
+
set.add('android')
|
|
66
|
+
set.add('ios')
|
|
67
|
+
set.delete('mobile')
|
|
68
|
+
}
|
|
69
|
+
return set as Set<ExplicitNativePlatform>
|
|
70
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -9,9 +9,3 @@ export type StyleObject = {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type MediaStyleObject = Omit<StyleObject, 'value'>
|
|
12
|
-
|
|
13
|
-
export type NativePlatform = 'web' | 'mobile' | 'android' | 'ios'
|
|
14
|
-
export type NativeValue<Platform extends NativePlatform = NativePlatform> =
|
|
15
|
-
| boolean
|
|
16
|
-
| Platform
|
|
17
|
-
| Platform[]
|
package/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './clamp';
|
|
|
3
3
|
export * from './composeEventHandlers';
|
|
4
4
|
export * from './concatClassName';
|
|
5
5
|
export * from './types';
|
|
6
|
+
export * from './native';
|
|
6
7
|
export * from './validStyleProps';
|
|
7
8
|
export * from './withStaticProperties';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type NativePlatform = 'web' | 'mobile' | 'android' | 'ios';
|
|
2
|
+
export type ExplicitNativePlatform = Exclude<NativePlatform, 'mobile'>;
|
|
3
|
+
export type NativeValue<Platform extends NativePlatform = NativePlatform> = boolean | Platform | Platform[];
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* takes in what user has inputted the native-supporting component and returns the name of the native platform we should render
|
|
7
|
+
*
|
|
8
|
+
* @example ['android'] => 'android' (when current platform is android)
|
|
9
|
+
* @example ['android'] => null (when current platform is not android)
|
|
10
|
+
* @example ['mobile'] => 'ios' (when current platform is ios)
|
|
11
|
+
*
|
|
12
|
+
* @param supportedSpecificNativeValues the platforms your component/system supports
|
|
13
|
+
* @param nativeProp the platforms your user is requesting you to use
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function shouldRenderNativePlatform(nativeProp?: NativeValue): ExplicitNativePlatform | null;
|
|
17
|
+
//# sourceMappingURL=native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,QAAQ,GACR,SAAS,GACT,KAAK,CAAA;AAET,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAA;AAEtE,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACpE,OAAO,GACP,QAAQ,GACR,QAAQ,EAAE,CAAA;AAGd;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,CAAC,EAAE,WAAW,iCAalE"}
|
package/types/types.d.ts
CHANGED
|
@@ -6,6 +6,4 @@ export type StyleObject = {
|
|
|
6
6
|
value?: any;
|
|
7
7
|
};
|
|
8
8
|
export type MediaStyleObject = Omit<StyleObject, 'value'>;
|
|
9
|
-
export type NativePlatform = 'web' | 'mobile' | 'android' | 'ios';
|
|
10
|
-
export type NativeValue<Platform extends NativePlatform = NativePlatform> = boolean | Platform | Platform[];
|
|
11
9
|
//# sourceMappingURL=types.d.ts.map
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;IAGf,KAAK,CAAC,EAAE,GAAG,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;IAGf,KAAK,CAAC,EAAE,GAAG,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA"}
|