@tamagui/helpers 1.93.3 → 1.94.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers",
3
- "version": "1.93.3",
3
+ "version": "1.94.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.93.3",
23
- "@tamagui/simple-hash": "1.93.3"
22
+ "@tamagui/constants": "1.94.1",
23
+ "@tamagui/simple-hash": "1.94.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@tamagui/build": "1.93.3"
26
+ "@tamagui/build": "1.94.1"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"
@@ -1,40 +0,0 @@
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
@@ -1,6 +0,0 @@
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
- }
@@ -1,19 +0,0 @@
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
@@ -1,6 +0,0 @@
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/types/native.d.ts DELETED
@@ -1,17 +0,0 @@
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
@@ -1 +0,0 @@
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"}