@tamagui/calc 1.114.3 → 1.115.0

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.
@@ -0,0 +1,47 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ calc: () => calc
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+ var import_core = require("@tamagui/core");
27
+ const operators = {
28
+ "+": (a, b) => a + b,
29
+ "-": (a, b) => a - b,
30
+ "/": (a, b) => a / b,
31
+ "*": (a, b) => a * b
32
+ },
33
+ calc = (...valuesAndOperators) => {
34
+ if (import_core.isWeb) {
35
+ let res2 = "calc(";
36
+ for (const cur of valuesAndOperators) operators[cur] ? res2 += ` ${cur} ` : res2 += convertToVariableOrNumber(cur);
37
+ return `${res2})`;
38
+ }
39
+ let res = 0,
40
+ nextOp = null;
41
+ for (const cur of valuesAndOperators) operators[cur] ? nextOp = operators[cur] : nextOp ? (res = nextOp(res, cur), nextOp = null) : res = +cur;
42
+ return res;
43
+ },
44
+ convertToVariableOrNumber = v => {
45
+ const varOrVal = (0, import_core.getVariableVariable)(v);
46
+ return typeof varOrVal == "number" ? `${varOrVal}px` : varOrVal;
47
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/calc",
3
- "version": "1.114.3",
3
+ "version": "1.115.0",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -24,14 +24,15 @@
24
24
  "react-native": "./dist/cjs/index.native.js",
25
25
  "types": "./types/index.d.ts",
26
26
  "import": "./dist/esm/index.mjs",
27
- "require": "./dist/cjs/index.js"
27
+ "require": "./dist/cjs/index.cjs",
28
+ "default": "./dist/cjs/index.native.js"
28
29
  }
29
30
  },
30
31
  "dependencies": {
31
- "@tamagui/core": "1.114.3"
32
+ "@tamagui/core": "1.115.0"
32
33
  },
33
34
  "devDependencies": {
34
- "@tamagui/build": "1.114.3"
35
+ "@tamagui/build": "1.115.0"
35
36
  },
36
37
  "publishConfig": {
37
38
  "access": "public"
package/dist/cjs/index.js DELETED
@@ -1,41 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var src_exports = {};
16
- __export(src_exports, {
17
- calc: () => calc
18
- });
19
- module.exports = __toCommonJS(src_exports);
20
- var import_core = require("@tamagui/core");
21
- const operators = {
22
- "+": (a, b) => a + b,
23
- "-": (a, b) => a - b,
24
- "/": (a, b) => a / b,
25
- "*": (a, b) => a * b
26
- }, calc = (...valuesAndOperators) => {
27
- if (import_core.isWeb) {
28
- let res2 = "calc(";
29
- for (const cur of valuesAndOperators)
30
- operators[cur] ? res2 += ` ${cur} ` : res2 += convertToVariableOrNumber(cur);
31
- return `${res2})`;
32
- }
33
- let res = 0, nextOp = null;
34
- for (const cur of valuesAndOperators)
35
- operators[cur] ? nextOp = operators[cur] : nextOp ? (res = nextOp(res, cur), nextOp = null) : res = +cur;
36
- return res;
37
- }, convertToVariableOrNumber = (v) => {
38
- const varOrVal = (0, import_core.getVariableVariable)(v);
39
- return typeof varOrVal == "number" ? `${varOrVal}px` : varOrVal;
40
- };
41
- //# sourceMappingURL=index.js.map
File without changes