@tamagui/helpers 1.86.6 → 1.87.0-1705788268756
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/native.js +40 -0
- package/dist/cjs/native.js.map +6 -0
- package/dist/esm/native.js +19 -0
- package/dist/esm/native.js.map +6 -0
- package/package.json +4 -4
|
@@ -0,0 +1,40 @@
|
|
|
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 native_exports = {};
|
|
17
|
+
__export(native_exports, {
|
|
18
|
+
shouldRenderNativePlatform: () => shouldRenderNativePlatform
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(native_exports);
|
|
21
|
+
var import_constants = require("@tamagui/constants");
|
|
22
|
+
const ALL_PLATFORMS = ["web", "android", "ios"];
|
|
23
|
+
function shouldRenderNativePlatform(nativeProp) {
|
|
24
|
+
if (!nativeProp)
|
|
25
|
+
return null;
|
|
26
|
+
const userRequestedPlatforms = resolvePlatformNames(nativeProp);
|
|
27
|
+
for (const platform of ALL_PLATFORMS)
|
|
28
|
+
if (platform === import_constants.currentPlatform && userRequestedPlatforms.has(platform))
|
|
29
|
+
return platform;
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
function resolvePlatformNames(nativeProp) {
|
|
33
|
+
const platforms = nativeProp === !0 ? ALL_PLATFORMS : nativeProp === !1 ? [] : Array.isArray(nativeProp) ? nativeProp : [nativeProp], set = new Set(platforms);
|
|
34
|
+
return set.has("mobile") && (set.add("android"), set.add("ios"), set.delete("mobile")), set;
|
|
35
|
+
}
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
shouldRenderNativePlatform
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=native.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/native.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgC;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,oCAAmB,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
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { currentPlatform } from "@tamagui/constants";
|
|
2
|
+
const ALL_PLATFORMS = ["web", "android", "ios"];
|
|
3
|
+
function shouldRenderNativePlatform(nativeProp) {
|
|
4
|
+
if (!nativeProp)
|
|
5
|
+
return null;
|
|
6
|
+
const userRequestedPlatforms = resolvePlatformNames(nativeProp);
|
|
7
|
+
for (const platform of ALL_PLATFORMS)
|
|
8
|
+
if (platform === currentPlatform && userRequestedPlatforms.has(platform))
|
|
9
|
+
return platform;
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
function resolvePlatformNames(nativeProp) {
|
|
13
|
+
const platforms = nativeProp === !0 ? ALL_PLATFORMS : nativeProp === !1 ? [] : Array.isArray(nativeProp) ? nativeProp : [nativeProp], set = new Set(platforms);
|
|
14
|
+
return set.has("mobile") && (set.add("android"), set.add("ios"), set.delete("mobile")), set;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
shouldRenderNativePlatform
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=native.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/native.ts"],
|
|
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
|
+
"names": []
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.87.0-1705788268756",
|
|
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.
|
|
23
|
-
"@tamagui/simple-hash": "1.
|
|
22
|
+
"@tamagui/constants": "1.87.0-1705788268756",
|
|
23
|
+
"@tamagui/simple-hash": "1.87.0-1705788268756"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tamagui/build": "1.
|
|
26
|
+
"@tamagui/build": "1.87.0-1705788268756"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|