@tamagui/helpers 1.0.0-alpha.63 → 1.0.0-beta.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.
Files changed (40) hide show
  1. package/dist/cjs/allRules.js +13 -13
  2. package/dist/cjs/allRules.js.map +1 -1
  3. package/dist/cjs/concatClassName.js +20 -24
  4. package/dist/cjs/concatClassName.js.map +2 -2
  5. package/dist/cjs/index.js +12 -16
  6. package/dist/cjs/index.js.map +2 -2
  7. package/dist/cjs/log.js +32 -0
  8. package/dist/cjs/log.js.map +7 -0
  9. package/dist/cjs/simpleHash.js +12 -13
  10. package/dist/cjs/simpleHash.js.map +1 -1
  11. package/dist/cjs/types.js +7 -12
  12. package/dist/cjs/types.js.map +1 -1
  13. package/dist/cjs/validStyleProps.js +51 -18
  14. package/dist/cjs/validStyleProps.js.map +2 -2
  15. package/dist/esm/allRules.js.map +1 -1
  16. package/dist/esm/concatClassName.js +8 -11
  17. package/dist/esm/concatClassName.js.map +2 -2
  18. package/dist/esm/index.js +1 -1
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/log.js +10 -0
  21. package/dist/esm/log.js.map +7 -0
  22. package/dist/esm/simpleHash.js.map +1 -1
  23. package/dist/esm/validStyleProps.js +31 -5
  24. package/dist/esm/validStyleProps.js.map +2 -2
  25. package/dist/jsx/concatClassName.js +8 -11
  26. package/dist/jsx/index.js +1 -1
  27. package/dist/jsx/log.js +9 -0
  28. package/dist/jsx/validStyleProps.js +31 -5
  29. package/package.json +7 -5
  30. package/types/concatClassName.d.ts +1 -1
  31. package/types/concatClassName.d.ts.map +1 -1
  32. package/types/index.d.ts +1 -1
  33. package/types/index.d.ts.map +1 -1
  34. package/types/log.d.ts +2 -0
  35. package/types/log.d.ts.map +1 -0
  36. package/types/validStyleProps.d.ts +43 -1
  37. package/types/validStyleProps.d.ts.map +1 -1
  38. package/LICENSE +0 -21
  39. package/types/allRules.d.ts +0 -3
  40. package/types/allRules.d.ts.map +0 -1
@@ -2,31 +2,31 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
5
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
10
9
  };
11
- var __reExport = (target, module2, copyDefault, desc) => {
12
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13
- for (let key of __getOwnPropNames(module2))
14
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
15
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
15
  }
17
- return target;
16
+ return to;
18
17
  };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
19
  var allRules_exports = {};
25
20
  __export(allRules_exports, {
26
21
  AllRules: () => AllRules,
27
22
  getStyleRules: () => getStyleRules
28
23
  });
24
+ module.exports = __toCommonJS(allRules_exports);
29
25
  const AllRules = /* @__PURE__ */ new Set();
30
26
  const getStyleRules = /* @__PURE__ */ __name(() => AllRules, "getStyleRules");
31
- module.exports = __toCommonJS(allRules_exports);
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ AllRules,
30
+ getStyleRules
31
+ });
32
32
  //# sourceMappingURL=allRules.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/allRules.ts"],
4
4
  "sourcesContent": ["// ssr only\n\nexport const AllRules = new Set()\n\nexport const getStyleRules = () => AllRules\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,WAAW,oBAAI;AAErB,MAAM,gBAAgB,6BAAM,UAAN;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,WAAW,oBAAI,IAAI;AAEzB,MAAM,gBAAgB,6BAAM,UAAN;",
6
6
  "names": []
7
7
  }
@@ -2,37 +2,33 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
5
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
10
9
  };
11
- var __reExport = (target, module2, copyDefault, desc) => {
12
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13
- for (let key of __getOwnPropNames(module2))
14
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
15
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
15
  }
17
- return target;
16
+ return to;
18
17
  };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
19
  var concatClassName_exports = {};
25
20
  __export(concatClassName_exports, {
26
21
  concatClassName: () => concatClassName
27
22
  });
23
+ module.exports = __toCommonJS(concatClassName_exports);
28
24
  function concatClassName(_cn) {
29
- const classNamesOrPropObjects = arguments;
25
+ const cnOrPropObjcet = arguments;
30
26
  const usedPrefixes = [];
31
27
  let final = "";
32
- const len = classNamesOrPropObjects.length;
28
+ const len = cnOrPropObjcet.length;
33
29
  let propObjects = null;
34
30
  for (let x = len; x >= 0; x--) {
35
- const cns = classNamesOrPropObjects[x];
31
+ const cns = cnOrPropObjcet[x];
36
32
  if (!cns)
37
33
  continue;
38
34
  if (!Array.isArray(cns) && typeof cns !== "string") {
@@ -57,16 +53,13 @@ function concatClassName(_cn) {
57
53
  }
58
54
  const nextChar = name[splitIndex + 1];
59
55
  const isMediaQuery = nextChar === "_";
60
- const isPsuedoQuery = nextChar === "-";
61
- const styleKey = name.slice(1, splitIndex);
62
- const mediaKey = isMediaQuery || isPsuedoQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
56
+ const styleKey = name.slice(1, name.lastIndexOf("-"));
57
+ const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
63
58
  const uid = mediaKey ? styleKey + mediaKey : styleKey;
64
- if (!isMediaQuery && !isPsuedoQuery) {
65
- if (usedPrefixes.indexOf(uid) > -1) {
66
- continue;
67
- }
68
- usedPrefixes.push(uid);
59
+ if (usedPrefixes.indexOf(uid) > -1) {
60
+ continue;
69
61
  }
62
+ usedPrefixes.push(uid);
70
63
  const propName = styleKey;
71
64
  if (propName && propObjects) {
72
65
  if (propObjects.some((po) => {
@@ -91,5 +84,8 @@ const pseudoInvert = {
91
84
  focus: "focusStyle",
92
85
  press: "pressStyle"
93
86
  };
94
- module.exports = __toCommonJS(concatClassName_exports);
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ concatClassName
90
+ });
95
91
  //# sourceMappingURL=concatClassName.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/concatClassName.ts"],
4
- "sourcesContent": ["// perf sensitive so doing some weird stuff\n\n// testing caching\n// because we can hit these recent ones a ton of times in common cases\n// we're caching the simple case, this shouldn't be bad on memory either\n// const recently = new Map()\n// setInterval(() => {\n// recently.clear()\n// }, 1000)\n\nexport function concatClassName(_cn: any) {\n // if (arguments.length === 1) {\n // if (recently.has(arguments[0])) {\n // return recently.get(arguments[0])\n // }\n // }\n\n // const shouldDebug = _cn.includes('_right-_gtMd_hxu0ph')\n // if (shouldDebug) console.log('debug:', _cn)\n const classNamesOrPropObjects = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = classNamesOrPropObjects.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = classNamesOrPropObjects[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n const isPsuedoQuery = nextChar === '-'\n const styleKey = name.slice(1, splitIndex)\n const mediaKey =\n isMediaQuery || isPsuedoQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null\n const uid = mediaKey ? styleKey + mediaKey : styleKey\n if (!isMediaQuery && !isPsuedoQuery) {\n if (usedPrefixes.indexOf(uid) > -1) {\n // if (shouldDebug) console.log('debug exclude:', usedPrefixes, name)\n continue\n }\n usedPrefixes.push(uid)\n }\n\n // overrides for full safety\n const propName = styleKey\n if (propName && propObjects) {\n if (\n propObjects.some((po) => {\n if (mediaKey) {\n const propKey = pseudoInvert[mediaKey]\n return po && po[propKey] && propName in po[propKey] && po[propKey] !== null\n }\n const res = po && propName in po && po[propName] !== null\n return res\n })\n ) {\n // if (shouldDebug) console.log('debug exclude:', name)\n continue\n }\n }\n\n final = name + ' ' + final\n }\n }\n\n // if (arguments.length === 1) {\n // recently.set(arguments[0], final)\n // }\n\n return final\n}\n\nconst pseudoInvert = {\n hover: 'hoverStyle',\n focus: 'focusStyle',\n press: 'pressStyle',\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAUO,yBAAyB,KAAU;AASxC,QAAM,0BAA0B;AAChC,QAAM,eAAyB;AAC/B,MAAI,QAAQ;AAEZ,QAAM,MAAM,wBAAwB;AACpC,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,wBAAwB;AAEpC,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,QAAQ,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe;AAC7B,kBAAY,KAAK;AACjB;AAAA;AAGF,UAAM,QAAQ,MAAM,QAAQ,OAAO,MAAM,IAAI,MAAM;AACnD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM;AAEnB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,OAAO,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA;AAGF,YAAM,aAAa,KAAK,QAAQ;AAChC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AAErB;AAAA;AAGF,YAAM,WAAW,KAAK,aAAa;AAGnC,YAAM,eAAe,aAAa;AAElC,YAAM,gBAAgB,aAAa;AACnC,YAAM,WAAW,KAAK,MAAM,GAAG;AAC/B,YAAM,WACJ,gBAAgB,gBAAgB,KAAK,MAAM,aAAa,GAAG,aAAa,KAAK;AAC/E,YAAM,MAAM,WAAW,WAAW,WAAW;AAC7C,UAAI,CAAC,gBAAgB,CAAC,eAAe;AACnC,YAAI,aAAa,QAAQ,OAAO,IAAI;AAElC;AAAA;AAEF,qBAAa,KAAK;AAAA;AAIpB,YAAM,WAAW;AACjB,UAAI,YAAY,aAAa;AAC3B,YACE,YAAY,KAAK,CAAC,OAAO;AACvB,cAAI,UAAU;AACZ,kBAAM,UAAU,aAAa;AAC7B,mBAAO,MAAM,GAAG,YAAY,YAAY,GAAG,YAAY,GAAG,aAAa;AAAA;AAEzE,gBAAM,MAAM,MAAM,YAAY,MAAM,GAAG,cAAc;AACrD,iBAAO;AAAA,YAET;AAEA;AAAA;AAAA;AAIJ,cAAQ,OAAO,MAAM;AAAA;AAAA;AAQzB,SAAO;AAAA;AAzFO;AA4FhB,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA;",
4
+ "sourcesContent": ["// perf sensitive so doing some weird stuff\n\nimport { ViewStyle } from 'react-native'\n\nexport function concatClassName(...args: any[]): any\nexport function concatClassName(_cn: ViewStyle | null | undefined): string {\n const cnOrPropObjcet = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = cnOrPropObjcet.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = cnOrPropObjcet[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n // commenting out three things to make pseudos override properly\n // (leave in for a bit to see if other bugs pop up later):\n // 1. const isPsuedoQuery = nextChar === '0'\n const styleKey = name.slice(1, name.lastIndexOf('-'))\n // 2. isMediaQuery || isPsuedoQuery\n const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null\n const uid = mediaKey ? styleKey + mediaKey : styleKey\n // 3. && !isPsuedoQuery\n\n if (usedPrefixes.indexOf(uid) > -1) {\n // if (shouldDebug) console.log('debug exclude:', usedPrefixes, name)\n continue\n }\n usedPrefixes.push(uid)\n\n // overrides for full safety\n const propName = styleKey\n if (propName && propObjects) {\n if (\n propObjects.some((po) => {\n if (mediaKey) {\n const propKey = pseudoInvert[mediaKey]\n return po && po[propKey] && propName in po[propKey] && po[propKey] !== null\n }\n const res = po && propName in po && po[propName] !== null\n return res\n })\n ) {\n // if (shouldDebug) console.log('debug exclude:', name)\n continue\n }\n }\n\n final = name + ' ' + final\n }\n }\n\n return final\n}\n\nconst pseudoInvert = {\n hover: 'hoverStyle',\n focus: 'focusStyle',\n press: 'pressStyle',\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,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ACzE;AACA,gBAAM,MAAM,MAAM,YAAY,MAAM,GAAG,cAAc;AACrD,iBAAO;AAAA,QACT,CAAC,GACD;AAEA;AAAA,QACF;AAAA,MACF;AAEA,cAAQ,OAAO,MAAM;AAAA,IACvB;AAAA,EACF;AAEA,SAAO;AACT;AAhFgB;AAkFhB,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -2,24 +2,20 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
- var __reExport = (target, module2, copyDefault, desc) => {
7
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
8
- for (let key of __getOwnPropNames(module2))
9
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
10
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
10
  }
12
- return target;
11
+ return to;
13
12
  };
14
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
15
- return (module2, temp) => {
16
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
17
- };
18
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
15
  var src_exports = {};
20
- __reExport(src_exports, require("./concatClassName"));
21
- __reExport(src_exports, require("./validStyleProps"));
22
- __reExport(src_exports, require("./types"));
23
- __reExport(src_exports, require("./allRules"));
24
16
  module.exports = __toCommonJS(src_exports);
17
+ __reExport(src_exports, require("./concatClassName"), module.exports);
18
+ __reExport(src_exports, require("./validStyleProps"), module.exports);
19
+ __reExport(src_exports, require("./types"), module.exports);
20
+ __reExport(src_exports, require("./log"), module.exports);
25
21
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './allRules'\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA,wBAAc;AACd,wBAAc;AACd,wBAAc;AACd,wBAAc;",
4
+ "sourcesContent": ["export * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,8BAAd;AACA,wBAAc,8BADd;AAEA,wBAAc,oBAFd;AAGA,wBAAc,kBAHd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var log_exports = {};
20
+ __export(log_exports, {
21
+ log: () => log
22
+ });
23
+ module.exports = __toCommonJS(log_exports);
24
+ const log = /* @__PURE__ */ __name((...args) => {
25
+ console.log(...args);
26
+ return args[0];
27
+ }, "log");
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ log
31
+ });
32
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/log.ts"],
4
+ "sourcesContent": ["export const log = (...args: any) => {\n console.log(...args)\n return args[0]\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,MAAM,2BAAI,SAAc;AACnC,UAAQ,IAAI,GAAG,IAAI;AACnB,SAAO,KAAK;AACd,GAHmB;",
6
+ "names": []
7
+ }
@@ -2,29 +2,25 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
5
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
10
9
  };
11
- var __reExport = (target, module2, copyDefault, desc) => {
12
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13
- for (let key of __getOwnPropNames(module2))
14
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
15
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
15
  }
17
- return target;
16
+ return to;
18
17
  };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
19
  var simpleHash_exports = {};
25
20
  __export(simpleHash_exports, {
26
21
  simpleHash: () => simpleHash
27
22
  });
23
+ module.exports = __toCommonJS(simpleHash_exports);
28
24
  const simpleHash = /* @__PURE__ */ __name((str) => {
29
25
  let hash = 0;
30
26
  for (let i = 0; i < str.length; i++) {
@@ -34,5 +30,8 @@ const simpleHash = /* @__PURE__ */ __name((str) => {
34
30
  }
35
31
  return new Uint32Array([hash])[0].toString(36);
36
32
  }, "simpleHash");
37
- module.exports = __toCommonJS(simpleHash_exports);
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ simpleHash
36
+ });
38
37
  //# sourceMappingURL=simpleHash.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/simpleHash.ts"],
4
4
  "sourcesContent": ["export const simpleHash = (str: string) => {\n let hash = 0\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return new Uint32Array([hash])[0].toString(36)\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAa,wBAAC,QAAgB;AACzC,MAAI,OAAO;AACX,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAM,OAAO,IAAI,WAAW;AAC5B,WAAQ,SAAQ,KAAK,OAAO;AAC5B,YAAQ;AAAA;AAEV,SAAO,IAAI,YAAY,CAAC,OAAO,GAAG,SAAS;AAAA,GAPnB;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAa,wBAAC,QAAgB;AACzC,MAAI,OAAO;AACX,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAM,OAAO,IAAI,WAAW,CAAC;AAC7B,WAAQ,SAAQ,KAAK,OAAO;AAC5B,YAAQ;AAAA,EACV;AACA,SAAO,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE;AAC/C,GAR0B;",
6
6
  "names": []
7
7
  }
package/dist/cjs/types.js CHANGED
@@ -2,20 +2,15 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
- var __reExport = (target, module2, copyDefault, desc) => {
7
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
8
- for (let key of __getOwnPropNames(module2))
9
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
10
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
10
  }
12
- return target;
11
+ return to;
13
12
  };
14
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
15
- return (module2, temp) => {
16
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
17
- };
18
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
14
  var types_exports = {};
20
15
  module.exports = __toCommonJS(types_exports);
21
16
  //# sourceMappingURL=types.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/types.ts"],
4
4
  "sourcesContent": ["export type StyleObject = {\n property: string\n value: string\n className: string\n identifier: string\n rules: string[]\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -16,34 +16,34 @@ var __spreadValues = (a, b) => {
16
16
  }
17
17
  return a;
18
18
  };
19
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
19
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
20
20
  var __export = (target, all) => {
21
21
  for (var name in all)
22
22
  __defProp(target, name, { get: all[name], enumerable: true });
23
23
  };
24
- var __reExport = (target, module2, copyDefault, desc) => {
25
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
26
- for (let key of __getOwnPropNames(module2))
27
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
28
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
29
  }
30
- return target;
30
+ return to;
31
31
  };
32
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
33
- return (module2, temp) => {
34
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
35
- };
36
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
33
  var validStyleProps_exports = {};
38
34
  __export(validStyleProps_exports, {
35
+ invertMapTransformKeys: () => invertMapTransformKeys,
36
+ mapTransformKeys: () => mapTransformKeys,
37
+ mergeTransform: () => mergeTransform,
39
38
  stylePropsAll: () => stylePropsAll,
40
39
  stylePropsText: () => stylePropsText,
41
40
  stylePropsTextOnly: () => stylePropsTextOnly,
42
41
  stylePropsTransform: () => stylePropsTransform,
43
42
  stylePropsView: () => stylePropsView,
44
- validStyles: () => validStyles,
45
- validStylesPseudo: () => validStylesPseudo
43
+ validPseudoKeys: () => validPseudoKeys,
44
+ validStyles: () => validStyles
46
45
  });
46
+ module.exports = __toCommonJS(validStyleProps_exports);
47
47
  const stylePropsTransform = Object.freeze({
48
48
  x: true,
49
49
  y: true,
@@ -63,6 +63,10 @@ const stylePropsView = Object.freeze(__spreadValues(__spreadValues({
63
63
  backfaceVisibility: true,
64
64
  backgroundColor: true,
65
65
  borderBottomColor: true,
66
+ borderBottomStyle: true,
67
+ borderTopStyle: true,
68
+ borderLeftStyle: true,
69
+ borderRightStyle: true,
66
70
  borderBottomEndRadius: true,
67
71
  borderBottomLeftRadius: true,
68
72
  borderBottomRightRadius: true,
@@ -139,11 +143,14 @@ const stylePropsView = Object.freeze(__spreadValues(__spreadValues({
139
143
  shadowOpacity: true,
140
144
  shadowRadius: true
141
145
  }, stylePropsTransform), process.env.TAMAGUI_TARGET === "web" && {
146
+ overflowX: true,
147
+ overflowY: true,
142
148
  userSelect: true,
143
149
  cursor: true,
144
150
  contain: true,
145
151
  pointerEvents: true,
146
- boxSizing: true
152
+ boxSizing: true,
153
+ boxShadow: true
147
154
  }));
148
155
  const stylePropsTextOnly = Object.freeze(__spreadValues({
149
156
  color: true,
@@ -169,11 +176,37 @@ const stylePropsTextOnly = Object.freeze(__spreadValues({
169
176
  }));
170
177
  const stylePropsText = Object.freeze(__spreadValues(__spreadValues({}, stylePropsView), stylePropsTextOnly));
171
178
  const stylePropsAll = stylePropsText;
172
- const validStylesPseudo = Object.freeze({
179
+ const validPseudoKeys = Object.freeze({
180
+ enterStyle: true,
181
+ exitStyle: true,
173
182
  hoverStyle: true,
174
183
  pressStyle: true,
175
184
  focusStyle: true
176
185
  });
177
- const validStyles = Object.freeze(__spreadValues(__spreadValues({}, validStylesPseudo), stylePropsView));
178
- module.exports = __toCommonJS(validStyleProps_exports);
186
+ const validStyles = Object.freeze(__spreadValues(__spreadValues({}, validPseudoKeys), stylePropsView));
187
+ const mapTransformKeys = {
188
+ x: "translateX",
189
+ y: "translateY"
190
+ };
191
+ const invertMapTransformKeys = {
192
+ translateX: "x",
193
+ translateY: "y"
194
+ };
195
+ const mergeTransform = /* @__PURE__ */ __name((obj, key, val) => {
196
+ obj.transform || (obj.transform = []);
197
+ obj.transform.push({ [mapTransformKeys[key] || key]: val });
198
+ }, "mergeTransform");
199
+ // Annotate the CommonJS export names for ESM import in node:
200
+ 0 && (module.exports = {
201
+ invertMapTransformKeys,
202
+ mapTransformKeys,
203
+ mergeTransform,
204
+ stylePropsAll,
205
+ stylePropsText,
206
+ stylePropsTextOnly,
207
+ stylePropsTransform,
208
+ stylePropsView,
209
+ validPseudoKeys,
210
+ validStyles
211
+ });
179
212
  //# sourceMappingURL=validStyleProps.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/validStyleProps.ts"],
4
- "sourcesContent": ["// flat transform props\nexport const stylePropsTransform = Object.freeze({\n x: true,\n y: true,\n scale: true,\n perspective: true,\n scaleX: true,\n scaleY: true,\n skewX: true,\n skewY: true,\n matrix: true,\n rotate: true,\n rotateY: true,\n rotateX: true,\n rotateZ: true,\n})\n\nexport const stylePropsView = Object.freeze({\n backfaceVisibility: true,\n backgroundColor: true,\n borderBottomColor: true,\n borderBottomEndRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomStartRadius: true,\n borderBottomWidth: true,\n borderColor: true,\n borderEndColor: true,\n borderLeftColor: true,\n borderLeftWidth: true,\n borderRadius: true,\n borderRightColor: true,\n borderRightWidth: true,\n borderStartColor: true,\n borderStyle: true,\n borderTopColor: true,\n borderTopEndRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopStartRadius: true,\n borderTopWidth: true,\n borderWidth: true,\n opacity: true,\n transform: true,\n alignContent: true,\n alignItems: true,\n alignSelf: true,\n aspectRatio: true,\n borderEndWidth: true,\n borderStartWidth: true,\n bottom: true,\n display: true,\n end: true,\n flex: true,\n flexBasis: true,\n flexDirection: true,\n flexGrow: true,\n flexShrink: true,\n flexWrap: true,\n height: true,\n justifyContent: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginEnd: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginStart: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n overflow: true,\n padding: true,\n paddingBottom: true,\n paddingEnd: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingStart: true,\n paddingTop: true,\n paddingVertical: true,\n position: true,\n right: true,\n start: true,\n top: true,\n width: true,\n zIndex: true,\n direction: true,\n shadowColor: true,\n shadowOffset: true,\n shadowOpacity: true,\n shadowRadius: true,\n ...stylePropsTransform,\n\n // allow a few web only ones\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n userSelect: true,\n cursor: true,\n contain: true,\n pointerEvents: true,\n boxSizing: true,\n }),\n})\n\nexport const stylePropsTextOnly = Object.freeze({\n color: true,\n fontFamily: true,\n fontSize: true,\n fontStyle: true,\n fontWeight: true,\n letterSpacing: true,\n lineHeight: true,\n textAlign: true,\n textDecorationLine: true,\n textDecorationStyle: true,\n textDecorationColor: true,\n textShadowColor: true,\n textShadowOffset: true,\n textShadowRadius: true,\n textTransform: true,\n\n // allow a few web only ones\n // TODO\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n }),\n})\n\nexport const stylePropsText = Object.freeze({\n ...stylePropsView,\n ...stylePropsTextOnly,\n})\n\nexport const stylePropsAll = stylePropsText\n\nexport const validStylesPseudo = Object.freeze({\n hoverStyle: true,\n pressStyle: true,\n focusStyle: true,\n})\n\nexport const validStyles = Object.freeze({\n ...validStylesPseudo,\n ...stylePropsView,\n})\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA;AAGJ,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,sBAAsB;A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AAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,eAAe;AAAA,GAIX,QAAQ,IAAI,mBAAmB,SAAS;AAAA,EAC1C,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd,wBAAwB;AAAA;AAIrB,MAAM,iBAAiB,OAAO,OAAO,kCACvC,iBACA;AAGE,MAAM,gBAAgB;AAEtB,MAAM,oBAAoB,OAAO,OAAO;AAAA,EAC7C,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA;AAGP,MAAM,cAAc,OAAO,OAAO,kCACpC,oBACA;",
4
+ "sourcesContent": ["import { ViewStyle } from 'react-native'\n\n// flat transform props\nexport const stylePropsTransform = Object.freeze({\n x: true,\n y: true,\n scale: true,\n perspective: true,\n scaleX: true,\n scaleY: true,\n skewX: true,\n skewY: true,\n matrix: true,\n rotate: true,\n rotateY: true,\n rotateX: true,\n rotateZ: true,\n})\n\nexport const stylePropsView = Object.freeze({\n backfaceVisibility: true,\n backgroundColor: true,\n borderBottomColor: true,\n borderBottomStyle: true,\n borderTopStyle: true,\n borderLeftStyle: true,\n borderRightStyle: true,\n borderBottomEndRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomStartRadius: true,\n borderBottomWidth: true,\n borderColor: true,\n borderEndColor: true,\n borderLeftColor: true,\n borderLeftWidth: true,\n borderRadius: true,\n borderRightColor: true,\n borderRightWidth: true,\n borderStartColor: true,\n borderStyle: true,\n borderTopColor: true,\n borderTopEndRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopStartRadius: true,\n borderTopWidth: true,\n borderWidth: true,\n opacity: true,\n transform: true,\n alignContent: true,\n alignItems: true,\n alignSelf: true,\n aspectRatio: true,\n borderEndWidth: true,\n borderStartWidth: true,\n bottom: true,\n display: true,\n end: true,\n flex: true,\n flexBasis: true,\n flexDirection: true,\n flexGrow: true,\n flexShrink: true,\n flexWrap: true,\n height: true,\n justifyContent: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginEnd: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginStart: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n overflow: true,\n padding: true,\n paddingBottom: true,\n paddingEnd: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingStart: true,\n paddingTop: true,\n paddingVertical: true,\n position: true,\n right: true,\n start: true,\n top: true,\n width: true,\n zIndex: true,\n direction: true,\n shadowColor: true,\n shadowOffset: true,\n shadowOpacity: true,\n shadowRadius: true,\n ...stylePropsTransform,\n\n // allow a few web only ones\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n overflowX: true,\n overflowY: true,\n userSelect: true,\n cursor: true,\n contain: true,\n pointerEvents: true,\n boxSizing: true,\n boxShadow: true,\n }),\n})\n\nexport const stylePropsTextOnly = Object.freeze({\n color: true,\n fontFamily: true,\n fontSize: true,\n fontStyle: true,\n fontWeight: true,\n letterSpacing: true,\n lineHeight: true,\n textAlign: true,\n textDecorationLine: true,\n textDecorationStyle: true,\n textDecorationColor: true,\n textShadowColor: true,\n textShadowOffset: true,\n textShadowRadius: true,\n textTransform: true,\n\n // allow a few web only ones\n // TODO\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n }),\n})\n\nexport const stylePropsText = Object.freeze({\n ...stylePropsView,\n ...stylePropsTextOnly,\n})\n\nexport const stylePropsAll = stylePropsText\n\nexport const validPseudoKeys = Object.freeze({\n enterStyle: true,\n exitStyle: true,\n hoverStyle: true,\n pressStyle: true,\n focusStyle: true,\n})\n\nexport const validStyles = Object.freeze({\n ...validPseudoKeys,\n ...stylePropsView,\n})\n\nexport const mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n\nexport const invertMapTransformKeys = {\n translateX: 'x',\n translateY: 'y',\n}\n\nexport const mergeTransform = (obj: ViewStyle, key: string, val: any) => {\n obj.transform ||= []\n // @ts-ignore\n obj.transform.push({ [mapTransformKeys[key] || key]: val })\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AACX,CAAC;AAEM,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,sBAAsB;AA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A,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,eAAe;AAAA,GAIX,QAAQ,IAAI,mBAAmB,SAAS;AAAA,EAC1C,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd,wBAAwB;AAC1B,EACD;AAEM,MAAM,iBAAiB,OAAO,OAAO,kCACvC,iBACA,mBACJ;AAEM,MAAM,gBAAgB;AAEtB,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AACd,CAAC;AAEM,MAAM,cAAc,OAAO,OAAO,kCACpC,kBACA,eACJ;AAEM,MAAM,mBAAmB;AAAA,EAC9B,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,yBAAyB;AAAA,EACpC,YAAY;AAAA,EACZ,YAAY;AACd;AAEO,MAAM,iBAAiB,wBAAC,KAAgB,KAAa,QAAa;AACvE,MAAI,aAAJ,KAAI,YAAc,CAAC;AAEnB,MAAI,UAAU,KAAK,GAAG,iBAAiB,QAAQ,MAAM,IAAI,CAAC;AAC5D,GAJ8B;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/allRules.ts"],
4
4
  "sourcesContent": ["// ssr only\n\nexport const AllRules = new Set()\n\nexport const getStyleRules = () => AllRules\n"],
5
- "mappings": ";;AAEO,MAAM,WAAW,oBAAI;AAErB,MAAM,gBAAgB,6BAAM,UAAN;",
5
+ "mappings": ";;AAEO,MAAM,WAAW,oBAAI,IAAI;AAEzB,MAAM,gBAAgB,6BAAM,UAAN;",
6
6
  "names": []
7
7
  }
@@ -1,13 +1,13 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  function concatClassName(_cn) {
4
- const classNamesOrPropObjects = arguments;
4
+ const cnOrPropObjcet = arguments;
5
5
  const usedPrefixes = [];
6
6
  let final = "";
7
- const len = classNamesOrPropObjects.length;
7
+ const len = cnOrPropObjcet.length;
8
8
  let propObjects = null;
9
9
  for (let x = len; x >= 0; x--) {
10
- const cns = classNamesOrPropObjects[x];
10
+ const cns = cnOrPropObjcet[x];
11
11
  if (!cns)
12
12
  continue;
13
13
  if (!Array.isArray(cns) && typeof cns !== "string") {
@@ -32,16 +32,13 @@ function concatClassName(_cn) {
32
32
  }
33
33
  const nextChar = name[splitIndex + 1];
34
34
  const isMediaQuery = nextChar === "_";
35
- const isPsuedoQuery = nextChar === "-";
36
- const styleKey = name.slice(1, splitIndex);
37
- const mediaKey = isMediaQuery || isPsuedoQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
35
+ const styleKey = name.slice(1, name.lastIndexOf("-"));
36
+ const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
38
37
  const uid = mediaKey ? styleKey + mediaKey : styleKey;
39
- if (!isMediaQuery && !isPsuedoQuery) {
40
- if (usedPrefixes.indexOf(uid) > -1) {
41
- continue;
42
- }
43
- usedPrefixes.push(uid);
38
+ if (usedPrefixes.indexOf(uid) > -1) {
39
+ continue;
44
40
  }
41
+ usedPrefixes.push(uid);
45
42
  const propName = styleKey;
46
43
  if (propName && propObjects) {
47
44
  if (propObjects.some((po) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/concatClassName.ts"],
4
- "sourcesContent": ["// perf sensitive so doing some weird stuff\n\n// testing caching\n// because we can hit these recent ones a ton of times in common cases\n// we're caching the simple case, this shouldn't be bad on memory either\n// const recently = new Map()\n// setInterval(() => {\n// recently.clear()\n// }, 1000)\n\nexport function concatClassName(_cn: any) {\n // if (arguments.length === 1) {\n // if (recently.has(arguments[0])) {\n // return recently.get(arguments[0])\n // }\n // }\n\n // const shouldDebug = _cn.includes('_right-_gtMd_hxu0ph')\n // if (shouldDebug) console.log('debug:', _cn)\n const classNamesOrPropObjects = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = classNamesOrPropObjects.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = classNamesOrPropObjects[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n const isPsuedoQuery = nextChar === '-'\n const styleKey = name.slice(1, splitIndex)\n const mediaKey =\n isMediaQuery || isPsuedoQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null\n const uid = mediaKey ? styleKey + mediaKey : styleKey\n if (!isMediaQuery && !isPsuedoQuery) {\n if (usedPrefixes.indexOf(uid) > -1) {\n // if (shouldDebug) console.log('debug exclude:', usedPrefixes, name)\n continue\n }\n usedPrefixes.push(uid)\n }\n\n // overrides for full safety\n const propName = styleKey\n if (propName && propObjects) {\n if (\n propObjects.some((po) => {\n if (mediaKey) {\n const propKey = pseudoInvert[mediaKey]\n return po && po[propKey] && propName in po[propKey] && po[propKey] !== null\n }\n const res = po && propName in po && po[propName] !== null\n return res\n })\n ) {\n // if (shouldDebug) console.log('debug exclude:', name)\n continue\n }\n }\n\n final = name + ' ' + final\n }\n }\n\n // if (arguments.length === 1) {\n // recently.set(arguments[0], final)\n // }\n\n return final\n}\n\nconst pseudoInvert = {\n hover: 'hoverStyle',\n focus: 'focusStyle',\n press: 'pressStyle',\n}\n"],
5
- "mappings": ";;AAUO,yBAAyB,KAAU;AASxC,QAAM,0BAA0B;AAChC,QAAM,eAAyB;AAC/B,MAAI,QAAQ;AAEZ,QAAM,MAAM,wBAAwB;AACpC,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,wBAAwB;AAEpC,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,QAAQ,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe;AAC7B,kBAAY,KAAK;AACjB;AAAA;AAGF,UAAM,QAAQ,MAAM,QAAQ,OAAO,MAAM,IAAI,MAAM;AACnD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM;AAEnB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,OAAO,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA;AAGF,YAAM,aAAa,KAAK,QAAQ;AAChC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AAErB;AAAA;AAGF,YAAM,WAAW,KAAK,aAAa;AAGnC,YAAM,eAAe,aAAa;AAElC,YAAM,gBAAgB,aAAa;AACnC,YAAM,WAAW,KAAK,MAAM,GAAG;AAC/B,YAAM,WACJ,gBAAgB,gBAAgB,KAAK,MAAM,aAAa,GAAG,aAAa,KAAK;AAC/E,YAAM,MAAM,WAAW,WAAW,WAAW;AAC7C,UAAI,CAAC,gBAAgB,CAAC,eAAe;AACnC,YAAI,aAAa,QAAQ,OAAO,IAAI;AAElC;AAAA;AAEF,qBAAa,KAAK;AAAA;AAIpB,YAAM,WAAW;AACjB,UAAI,YAAY,aAAa;AAC3B,YACE,YAAY,KAAK,CAAC,OAAO;AACvB,cAAI,UAAU;AACZ,kBAAM,UAAU,aAAa;AAC7B,mBAAO,MAAM,GAAG,YAAY,YAAY,GAAG,YAAY,GAAG,aAAa;AAAA;AAEzE,gBAAM,MAAM,MAAM,YAAY,MAAM,GAAG,cAAc;AACrD,iBAAO;AAAA,YAET;AAEA;AAAA;AAAA;AAIJ,cAAQ,OAAO,MAAM;AAAA;AAAA;AAQzB,SAAO;AAAA;AAzFO;AA4FhB,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA;",
4
+ "sourcesContent": ["// perf sensitive so doing some weird stuff\n\nimport { ViewStyle } from 'react-native'\n\nexport function concatClassName(...args: any[]): any\nexport function concatClassName(_cn: ViewStyle | null | undefined): string {\n const cnOrPropObjcet = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = cnOrPropObjcet.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = cnOrPropObjcet[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n // commenting out three things to make pseudos override properly\n // (leave in for a bit to see if other bugs pop up later):\n // 1. const isPsuedoQuery = nextChar === '0'\n const styleKey = name.slice(1, name.lastIndexOf('-'))\n // 2. isMediaQuery || isPsuedoQuery\n const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null\n const uid = mediaKey ? styleKey + mediaKey : styleKey\n // 3. && !isPsuedoQuery\n\n if (usedPrefixes.indexOf(uid) > -1) {\n // if (shouldDebug) console.log('debug exclude:', usedPrefixes, name)\n continue\n }\n usedPrefixes.push(uid)\n\n // overrides for full safety\n const propName = styleKey\n if (propName && propObjects) {\n if (\n propObjects.some((po) => {\n if (mediaKey) {\n const propKey = pseudoInvert[mediaKey]\n return po && po[propKey] && propName in po[propKey] && po[propKey] !== null\n }\n const res = po && propName in po && po[propName] !== null\n return res\n })\n ) {\n // if (shouldDebug) console.log('debug exclude:', name)\n continue\n }\n }\n\n final = name + ' ' + final\n }\n }\n\n return final\n}\n\nconst pseudoInvert = {\n hover: 'hoverStyle',\n focus: 'focusStyle',\n press: 'pressStyle',\n}\n"],
5
+ "mappings": ";;AAKO,yBAAyB,KAA2C;AACzE,QAAM,iBAAiB;AACvB,QAAM,eAAyB,CAAC;AAChC,MAAI,QAAQ;AAEZ,QAAM,MAAM,eAAe;AAC3B,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,eAAe;AAE3B,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe,CAAC;AAC9B,kBAAY,KAAK,GAAG;AACpB;AAAA,IACF;AAEA,UAAM,QAAQ,MAAM,QAAQ,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG;AACtD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM;AAEnB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,OAAO,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA,MACF;AAEA,YAAM,aAAa,KAAK,QAAQ,GAAG;AACnC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AAErB;AAAA,MACF;AAEA,YAAM,WAAW,KAAK,aAAa;AAGnC,YAAM,eAAe,aAAa;AAKlC,YAAM,WAAW,KAAK,MAAM,GAAG,KAAK,YAAY,GAAG,CAAC;AAEpD,YAAM,WAAW,eAAe,KAAK,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI;AAC7E,YAAM,MAAM,WAAW,WAAW,WAAW;AAG7C,UAAI,aAAa,QAAQ,GAAG,IAAI,IAAI;AAElC;AAAA,MACF;AACA,mBAAa,KAAK,GAAG;AAGrB,YAAM,WAAW;AACjB,UAAI,YAAY,aAAa;AAC3B,YACE,YAAY,KAAK,CAAC,OAAO;AACvB,cAAI,UAAU;AACZ,kBAAM,UAAU,aAAa;AAC7B,mBAAO,MAAM,GAAG,YAAY,YAAY,GAAG,YAAY,GAAG,aAAa;AAAA,UACzE;AACA,gBAAM,MAAM,MAAM,YAAY,MAAM,GAAG,cAAc;AACrD,iBAAO;AAAA,QACT,CAAC,GACD;AAEA;AAAA,QACF;AAAA,MACF;AAEA,cAAQ,OAAO,MAAM;AAAA,IACvB;AAAA,EACF;AAEA,SAAO;AACT;AAhFgB;AAkFhB,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./concatClassName";
2
2
  export * from "./validStyleProps";
3
3
  export * from "./types";
4
- export * from "./allRules";
4
+ export * from "./log";
5
5
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './allRules'\n"],
4
+ "sourcesContent": ["export * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\n"],
5
5
  "mappings": "AAAA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const log = /* @__PURE__ */ __name((...args) => {
4
+ console.log(...args);
5
+ return args[0];
6
+ }, "log");
7
+ export {
8
+ log
9
+ };
10
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/log.ts"],
4
+ "sourcesContent": ["export const log = (...args: any) => {\n console.log(...args)\n return args[0]\n}\n"],
5
+ "mappings": ";;AAAO,MAAM,MAAM,2BAAI,SAAc;AACnC,UAAQ,IAAI,GAAG,IAAI;AACnB,SAAO,KAAK;AACd,GAHmB;",
6
+ "names": []
7
+ }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/simpleHash.ts"],
4
4
  "sourcesContent": ["export const simpleHash = (str: string) => {\n let hash = 0\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return new Uint32Array([hash])[0].toString(36)\n}\n"],
5
- "mappings": ";;AAAO,MAAM,aAAa,wBAAC,QAAgB;AACzC,MAAI,OAAO;AACX,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAM,OAAO,IAAI,WAAW;AAC5B,WAAQ,SAAQ,KAAK,OAAO;AAC5B,YAAQ;AAAA;AAEV,SAAO,IAAI,YAAY,CAAC,OAAO,GAAG,SAAS;AAAA,GAPnB;",
5
+ "mappings": ";;AAAO,MAAM,aAAa,wBAAC,QAAgB;AACzC,MAAI,OAAO;AACX,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAM,OAAO,IAAI,WAAW,CAAC;AAC7B,WAAQ,SAAQ,KAAK,OAAO;AAC5B,YAAQ;AAAA,EACV;AACA,SAAO,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE;AAC/C,GAR0B;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,5 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
1
3
  const stylePropsTransform = Object.freeze({
2
4
  x: true,
3
5
  y: true,
@@ -17,6 +19,10 @@ const stylePropsView = Object.freeze({
17
19
  backfaceVisibility: true,
18
20
  backgroundColor: true,
19
21
  borderBottomColor: true,
22
+ borderBottomStyle: true,
23
+ borderTopStyle: true,
24
+ borderLeftStyle: true,
25
+ borderRightStyle: true,
20
26
  borderBottomEndRadius: true,
21
27
  borderBottomLeftRadius: true,
22
28
  borderBottomRightRadius: true,
@@ -94,11 +100,14 @@ const stylePropsView = Object.freeze({
94
100
  shadowRadius: true,
95
101
  ...stylePropsTransform,
96
102
  ...process.env.TAMAGUI_TARGET === "web" && {
103
+ overflowX: true,
104
+ overflowY: true,
97
105
  userSelect: true,
98
106
  cursor: true,
99
107
  contain: true,
100
108
  pointerEvents: true,
101
- boxSizing: true
109
+ boxSizing: true,
110
+ boxShadow: true
102
111
  }
103
112
  });
104
113
  const stylePropsTextOnly = Object.freeze({
@@ -129,22 +138,39 @@ const stylePropsText = Object.freeze({
129
138
  ...stylePropsTextOnly
130
139
  });
131
140
  const stylePropsAll = stylePropsText;
132
- const validStylesPseudo = Object.freeze({
141
+ const validPseudoKeys = Object.freeze({
142
+ enterStyle: true,
143
+ exitStyle: true,
133
144
  hoverStyle: true,
134
145
  pressStyle: true,
135
146
  focusStyle: true
136
147
  });
137
148
  const validStyles = Object.freeze({
138
- ...validStylesPseudo,
149
+ ...validPseudoKeys,
139
150
  ...stylePropsView
140
151
  });
152
+ const mapTransformKeys = {
153
+ x: "translateX",
154
+ y: "translateY"
155
+ };
156
+ const invertMapTransformKeys = {
157
+ translateX: "x",
158
+ translateY: "y"
159
+ };
160
+ const mergeTransform = /* @__PURE__ */ __name((obj, key, val) => {
161
+ obj.transform || (obj.transform = []);
162
+ obj.transform.push({ [mapTransformKeys[key] || key]: val });
163
+ }, "mergeTransform");
141
164
  export {
165
+ invertMapTransformKeys,
166
+ mapTransformKeys,
167
+ mergeTransform,
142
168
  stylePropsAll,
143
169
  stylePropsText,
144
170
  stylePropsTextOnly,
145
171
  stylePropsTransform,
146
172
  stylePropsView,
147
- validStyles,
148
- validStylesPseudo
173
+ validPseudoKeys,
174
+ validStyles
149
175
  };
150
176
  //# sourceMappingURL=validStyleProps.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/validStyleProps.ts"],
4
- "sourcesContent": ["// flat transform props\nexport const stylePropsTransform = Object.freeze({\n x: true,\n y: true,\n scale: true,\n perspective: true,\n scaleX: true,\n scaleY: true,\n skewX: true,\n skewY: true,\n matrix: true,\n rotate: true,\n rotateY: true,\n rotateX: true,\n rotateZ: true,\n})\n\nexport const stylePropsView = Object.freeze({\n backfaceVisibility: true,\n backgroundColor: true,\n borderBottomColor: true,\n borderBottomEndRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomStartRadius: true,\n borderBottomWidth: true,\n borderColor: true,\n borderEndColor: true,\n borderLeftColor: true,\n borderLeftWidth: true,\n borderRadius: true,\n borderRightColor: true,\n borderRightWidth: true,\n borderStartColor: true,\n borderStyle: true,\n borderTopColor: true,\n borderTopEndRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopStartRadius: true,\n borderTopWidth: true,\n borderWidth: true,\n opacity: true,\n transform: true,\n alignContent: true,\n alignItems: true,\n alignSelf: true,\n aspectRatio: true,\n borderEndWidth: true,\n borderStartWidth: true,\n bottom: true,\n display: true,\n end: true,\n flex: true,\n flexBasis: true,\n flexDirection: true,\n flexGrow: true,\n flexShrink: true,\n flexWrap: true,\n height: true,\n justifyContent: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginEnd: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginStart: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n overflow: true,\n padding: true,\n paddingBottom: true,\n paddingEnd: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingStart: true,\n paddingTop: true,\n paddingVertical: true,\n position: true,\n right: true,\n start: true,\n top: true,\n width: true,\n zIndex: true,\n direction: true,\n shadowColor: true,\n shadowOffset: true,\n shadowOpacity: true,\n shadowRadius: true,\n ...stylePropsTransform,\n\n // allow a few web only ones\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n userSelect: true,\n cursor: true,\n contain: true,\n pointerEvents: true,\n boxSizing: true,\n }),\n})\n\nexport const stylePropsTextOnly = Object.freeze({\n color: true,\n fontFamily: true,\n fontSize: true,\n fontStyle: true,\n fontWeight: true,\n letterSpacing: true,\n lineHeight: true,\n textAlign: true,\n textDecorationLine: true,\n textDecorationStyle: true,\n textDecorationColor: true,\n textShadowColor: true,\n textShadowOffset: true,\n textShadowRadius: true,\n textTransform: true,\n\n // allow a few web only ones\n // TODO\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n }),\n})\n\nexport const stylePropsText = Object.freeze({\n ...stylePropsView,\n ...stylePropsTextOnly,\n})\n\nexport const stylePropsAll = stylePropsText\n\nexport const validStylesPseudo = Object.freeze({\n hoverStyle: true,\n pressStyle: true,\n focusStyle: true,\n})\n\nexport const validStyles = Object.freeze({\n ...validStylesPseudo,\n ...stylePropsView,\n})\n"],
5
- "mappings": "AACO,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EAC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A,EACf,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,eAAe;AAAA,EACf,cAAc;AAAA,KACX;AAAA,KAGC,QAAQ,IAAI,mBAAmB,SAAS;AAAA,IAC1C,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,WAAW;AAAA;AAAA;AAIR,MAAM,qBAAqB,OAAO,OAAO;AAAA,EAC9C,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,eAAe;AAAA,KAIX,QAAQ,IAAI,mBAAmB,SAAS;AAAA,IAC1C,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,wBAAwB;AAAA;AAAA;AAIrB,MAAM,iBAAiB,OAAO,OAAO;AAAA,KACvC;AAAA,KACA;AAAA;AAGE,MAAM,gBAAgB;AAEtB,MAAM,oBAAoB,OAAO,OAAO;AAAA,EAC7C,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA;AAGP,MAAM,cAAc,OAAO,OAAO;AAAA,KACpC;AAAA,KACA;AAAA;",
4
+ "sourcesContent": ["import { ViewStyle } from 'react-native'\n\n// flat transform props\nexport const stylePropsTransform = Object.freeze({\n x: true,\n y: true,\n scale: true,\n perspective: true,\n scaleX: true,\n scaleY: true,\n skewX: true,\n skewY: true,\n matrix: true,\n rotate: true,\n rotateY: true,\n rotateX: true,\n rotateZ: true,\n})\n\nexport const stylePropsView = Object.freeze({\n backfaceVisibility: true,\n backgroundColor: true,\n borderBottomColor: true,\n borderBottomStyle: true,\n borderTopStyle: true,\n borderLeftStyle: true,\n borderRightStyle: true,\n borderBottomEndRadius: true,\n borderBottomLeftRadius: true,\n borderBottomRightRadius: true,\n borderBottomStartRadius: true,\n borderBottomWidth: true,\n borderColor: true,\n borderEndColor: true,\n borderLeftColor: true,\n borderLeftWidth: true,\n borderRadius: true,\n borderRightColor: true,\n borderRightWidth: true,\n borderStartColor: true,\n borderStyle: true,\n borderTopColor: true,\n borderTopEndRadius: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderTopStartRadius: true,\n borderTopWidth: true,\n borderWidth: true,\n opacity: true,\n transform: true,\n alignContent: true,\n alignItems: true,\n alignSelf: true,\n aspectRatio: true,\n borderEndWidth: true,\n borderStartWidth: true,\n bottom: true,\n display: true,\n end: true,\n flex: true,\n flexBasis: true,\n flexDirection: true,\n flexGrow: true,\n flexShrink: true,\n flexWrap: true,\n height: true,\n justifyContent: true,\n left: true,\n margin: true,\n marginBottom: true,\n marginEnd: true,\n marginHorizontal: true,\n marginLeft: true,\n marginRight: true,\n marginStart: true,\n marginTop: true,\n marginVertical: true,\n maxHeight: true,\n maxWidth: true,\n minHeight: true,\n minWidth: true,\n overflow: true,\n padding: true,\n paddingBottom: true,\n paddingEnd: true,\n paddingHorizontal: true,\n paddingLeft: true,\n paddingRight: true,\n paddingStart: true,\n paddingTop: true,\n paddingVertical: true,\n position: true,\n right: true,\n start: true,\n top: true,\n width: true,\n zIndex: true,\n direction: true,\n shadowColor: true,\n shadowOffset: true,\n shadowOpacity: true,\n shadowRadius: true,\n ...stylePropsTransform,\n\n // allow a few web only ones\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n overflowX: true,\n overflowY: true,\n userSelect: true,\n cursor: true,\n contain: true,\n pointerEvents: true,\n boxSizing: true,\n boxShadow: true,\n }),\n})\n\nexport const stylePropsTextOnly = Object.freeze({\n color: true,\n fontFamily: true,\n fontSize: true,\n fontStyle: true,\n fontWeight: true,\n letterSpacing: true,\n lineHeight: true,\n textAlign: true,\n textDecorationLine: true,\n textDecorationStyle: true,\n textDecorationColor: true,\n textShadowColor: true,\n textShadowOffset: true,\n textShadowRadius: true,\n textTransform: true,\n\n // allow a few web only ones\n // TODO\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n }),\n})\n\nexport const stylePropsText = Object.freeze({\n ...stylePropsView,\n ...stylePropsTextOnly,\n})\n\nexport const stylePropsAll = stylePropsText\n\nexport const validPseudoKeys = Object.freeze({\n enterStyle: true,\n exitStyle: true,\n hoverStyle: true,\n pressStyle: true,\n focusStyle: true,\n})\n\nexport const validStyles = Object.freeze({\n ...validPseudoKeys,\n ...stylePropsView,\n})\n\nexport const mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n\nexport const invertMapTransformKeys = {\n translateX: 'x',\n translateY: 'y',\n}\n\nexport const mergeTransform = (obj: ViewStyle, key: string, val: any) => {\n obj.transform ||= []\n // @ts-ignore\n obj.transform.push({ [mapTransformKeys[key] || key]: val })\n}\n"],
5
+ "mappings": ";;AAGO,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AACX,CAAC;AAEM,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,mBA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AAM,yBAAyB;AAAA,EACpC,YAAY;AAAA,EACZ,YAAY;AACd;AAEO,MAAM,iBAAiB,wBAAC,KAAgB,KAAa,QAAa;AACvE,MAAI,aAAJ,KAAI,YAAc,CAAC;AAEnB,MAAI,UAAU,KAAK,GAAG,iBAAiB,QAAQ,MAAM,IAAI,CAAC;AAC5D,GAJ8B;",
6
6
  "names": []
7
7
  }
@@ -1,13 +1,13 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  function concatClassName(_cn) {
4
- const classNamesOrPropObjects = arguments;
4
+ const cnOrPropObjcet = arguments;
5
5
  const usedPrefixes = [];
6
6
  let final = "";
7
- const len = classNamesOrPropObjects.length;
7
+ const len = cnOrPropObjcet.length;
8
8
  let propObjects = null;
9
9
  for (let x = len; x >= 0; x--) {
10
- const cns = classNamesOrPropObjects[x];
10
+ const cns = cnOrPropObjcet[x];
11
11
  if (!cns)
12
12
  continue;
13
13
  if (!Array.isArray(cns) && typeof cns !== "string") {
@@ -32,16 +32,13 @@ function concatClassName(_cn) {
32
32
  }
33
33
  const nextChar = name[splitIndex + 1];
34
34
  const isMediaQuery = nextChar === "_";
35
- const isPsuedoQuery = nextChar === "-";
36
- const styleKey = name.slice(1, splitIndex);
37
- const mediaKey = isMediaQuery || isPsuedoQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
35
+ const styleKey = name.slice(1, name.lastIndexOf("-"));
36
+ const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
38
37
  const uid = mediaKey ? styleKey + mediaKey : styleKey;
39
- if (!isMediaQuery && !isPsuedoQuery) {
40
- if (usedPrefixes.indexOf(uid) > -1) {
41
- continue;
42
- }
43
- usedPrefixes.push(uid);
38
+ if (usedPrefixes.indexOf(uid) > -1) {
39
+ continue;
44
40
  }
41
+ usedPrefixes.push(uid);
45
42
  const propName = styleKey;
46
43
  if (propName && propObjects) {
47
44
  if (propObjects.some((po) => {
package/dist/jsx/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from "./concatClassName";
2
2
  export * from "./validStyleProps";
3
3
  export * from "./types";
4
- export * from "./allRules";
4
+ export * from "./log";
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ const log = /* @__PURE__ */ __name((...args) => {
4
+ console.log(...args);
5
+ return args[0];
6
+ }, "log");
7
+ export {
8
+ log
9
+ };
@@ -1,3 +1,5 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
1
3
  const stylePropsTransform = Object.freeze({
2
4
  x: true,
3
5
  y: true,
@@ -17,6 +19,10 @@ const stylePropsView = Object.freeze({
17
19
  backfaceVisibility: true,
18
20
  backgroundColor: true,
19
21
  borderBottomColor: true,
22
+ borderBottomStyle: true,
23
+ borderTopStyle: true,
24
+ borderLeftStyle: true,
25
+ borderRightStyle: true,
20
26
  borderBottomEndRadius: true,
21
27
  borderBottomLeftRadius: true,
22
28
  borderBottomRightRadius: true,
@@ -94,11 +100,14 @@ const stylePropsView = Object.freeze({
94
100
  shadowRadius: true,
95
101
  ...stylePropsTransform,
96
102
  ...process.env.TAMAGUI_TARGET === "web" && {
103
+ overflowX: true,
104
+ overflowY: true,
97
105
  userSelect: true,
98
106
  cursor: true,
99
107
  contain: true,
100
108
  pointerEvents: true,
101
- boxSizing: true
109
+ boxSizing: true,
110
+ boxShadow: true
102
111
  }
103
112
  });
104
113
  const stylePropsTextOnly = Object.freeze({
@@ -129,21 +138,38 @@ const stylePropsText = Object.freeze({
129
138
  ...stylePropsTextOnly
130
139
  });
131
140
  const stylePropsAll = stylePropsText;
132
- const validStylesPseudo = Object.freeze({
141
+ const validPseudoKeys = Object.freeze({
142
+ enterStyle: true,
143
+ exitStyle: true,
133
144
  hoverStyle: true,
134
145
  pressStyle: true,
135
146
  focusStyle: true
136
147
  });
137
148
  const validStyles = Object.freeze({
138
- ...validStylesPseudo,
149
+ ...validPseudoKeys,
139
150
  ...stylePropsView
140
151
  });
152
+ const mapTransformKeys = {
153
+ x: "translateX",
154
+ y: "translateY"
155
+ };
156
+ const invertMapTransformKeys = {
157
+ translateX: "x",
158
+ translateY: "y"
159
+ };
160
+ const mergeTransform = /* @__PURE__ */ __name((obj, key, val) => {
161
+ obj.transform || (obj.transform = []);
162
+ obj.transform.push({ [mapTransformKeys[key] || key]: val });
163
+ }, "mergeTransform");
141
164
  export {
165
+ invertMapTransformKeys,
166
+ mapTransformKeys,
167
+ mergeTransform,
142
168
  stylePropsAll,
143
169
  stylePropsText,
144
170
  stylePropsTextOnly,
145
171
  stylePropsTransform,
146
172
  stylePropsView,
147
- validStyles,
148
- validStylesPseudo
173
+ validPseudoKeys,
174
+ validStyles
149
175
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tamagui/helpers",
3
- "version": "1.0.0-alpha.63",
3
+ "version": "1.0.0-beta.0",
4
4
  "source": "src/index.ts",
5
- "typings": "types",
5
+ "types": "types",
6
6
  "main": "dist/cjs",
7
7
  "module": "dist/esm",
8
8
  "module:jsx": "dist/jsx",
@@ -12,10 +12,12 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "build": "tamagui-build",
15
- "watch": "tamagui-build --watch"
15
+ "watch": "tamagui-build --watch",
16
+ "clean": "tamagui-build clean",
17
+ "clean:build": "tamagui-build clean:build"
16
18
  },
17
19
  "devDependencies": {
18
- "@tamagui/build": "^1.0.0-alpha.58",
20
+ "@tamagui/build": "^1.0.0-beta.0",
19
21
  "react-native": "*"
20
22
  },
21
23
  "peerDependencies": {
@@ -24,5 +26,5 @@
24
26
  "publishConfig": {
25
27
  "access": "public"
26
28
  },
27
- "gitHead": "0682fe0472fa1604a247f9934e7cd05d7feedfb5"
29
+ "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
28
30
  }
@@ -1,2 +1,2 @@
1
- export declare function concatClassName(_cn: any): string;
1
+ export declare function concatClassName(...args: any[]): any;
2
2
  //# sourceMappingURL=concatClassName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"concatClassName.d.ts","sourceRoot":"","sources":["../src/concatClassName.ts"],"names":[],"mappings":"AAUA,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,UA0FvC"}
1
+ {"version":3,"file":"concatClassName.d.ts","sourceRoot":"","sources":["../src/concatClassName.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA"}
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './concatClassName';
2
2
  export * from './validStyleProps';
3
3
  export * from './types';
4
- export * from './allRules';
4
+ export * from './log';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
package/types/log.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const log: (...args: any) => any;
2
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,YAAa,GAAG,QAG/B,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { ViewStyle } from 'react-native';
1
2
  export declare const stylePropsTransform: Readonly<{
2
3
  x: boolean;
3
4
  y: boolean;
@@ -14,11 +15,14 @@ export declare const stylePropsTransform: Readonly<{
14
15
  rotateZ: boolean;
15
16
  }>;
16
17
  export declare const stylePropsView: Readonly<{
18
+ overflowX?: boolean | undefined;
19
+ overflowY?: boolean | undefined;
17
20
  userSelect?: boolean | undefined;
18
21
  cursor?: boolean | undefined;
19
22
  contain?: boolean | undefined;
20
23
  pointerEvents?: boolean | undefined;
21
24
  boxSizing?: boolean | undefined;
25
+ boxShadow?: boolean | undefined;
22
26
  x: boolean;
23
27
  y: boolean;
24
28
  scale: boolean;
@@ -35,6 +39,10 @@ export declare const stylePropsView: Readonly<{
35
39
  backfaceVisibility: boolean;
36
40
  backgroundColor: boolean;
37
41
  borderBottomColor: boolean;
42
+ borderBottomStyle: boolean;
43
+ borderTopStyle: boolean;
44
+ borderLeftStyle: boolean;
45
+ borderRightStyle: boolean;
38
46
  borderBottomEndRadius: boolean;
39
47
  borderBottomLeftRadius: boolean;
40
48
  borderBottomRightRadius: boolean;
@@ -152,11 +160,14 @@ export declare const stylePropsText: Readonly<{
152
160
  textShadowOffset: boolean;
153
161
  textShadowRadius: boolean;
154
162
  textTransform: boolean;
163
+ overflowX?: boolean | undefined;
164
+ overflowY?: boolean | undefined;
155
165
  userSelect?: boolean | undefined;
156
166
  cursor?: boolean | undefined;
157
167
  contain?: boolean | undefined;
158
168
  pointerEvents?: boolean | undefined;
159
169
  boxSizing?: boolean | undefined;
170
+ boxShadow?: boolean | undefined;
160
171
  x: boolean;
161
172
  y: boolean;
162
173
  scale: boolean;
@@ -173,6 +184,10 @@ export declare const stylePropsText: Readonly<{
173
184
  backfaceVisibility: boolean;
174
185
  backgroundColor: boolean;
175
186
  borderBottomColor: boolean;
187
+ borderBottomStyle: boolean;
188
+ borderTopStyle: boolean;
189
+ borderLeftStyle: boolean;
190
+ borderRightStyle: boolean;
176
191
  borderBottomEndRadius: boolean;
177
192
  borderBottomLeftRadius: boolean;
178
193
  borderBottomRightRadius: boolean;
@@ -269,11 +284,14 @@ export declare const stylePropsAll: Readonly<{
269
284
  textShadowOffset: boolean;
270
285
  textShadowRadius: boolean;
271
286
  textTransform: boolean;
287
+ overflowX?: boolean | undefined;
288
+ overflowY?: boolean | undefined;
272
289
  userSelect?: boolean | undefined;
273
290
  cursor?: boolean | undefined;
274
291
  contain?: boolean | undefined;
275
292
  pointerEvents?: boolean | undefined;
276
293
  boxSizing?: boolean | undefined;
294
+ boxShadow?: boolean | undefined;
277
295
  x: boolean;
278
296
  y: boolean;
279
297
  scale: boolean;
@@ -290,6 +308,10 @@ export declare const stylePropsAll: Readonly<{
290
308
  backfaceVisibility: boolean;
291
309
  backgroundColor: boolean;
292
310
  borderBottomColor: boolean;
311
+ borderBottomStyle: boolean;
312
+ borderTopStyle: boolean;
313
+ borderLeftStyle: boolean;
314
+ borderRightStyle: boolean;
293
315
  borderBottomEndRadius: boolean;
294
316
  borderBottomLeftRadius: boolean;
295
317
  borderBottomRightRadius: boolean;
@@ -366,17 +388,22 @@ export declare const stylePropsAll: Readonly<{
366
388
  shadowOpacity: boolean;
367
389
  shadowRadius: boolean;
368
390
  }>;
369
- export declare const validStylesPseudo: Readonly<{
391
+ export declare const validPseudoKeys: Readonly<{
392
+ enterStyle: boolean;
393
+ exitStyle: boolean;
370
394
  hoverStyle: boolean;
371
395
  pressStyle: boolean;
372
396
  focusStyle: boolean;
373
397
  }>;
374
398
  export declare const validStyles: Readonly<{
399
+ overflowX?: boolean | undefined;
400
+ overflowY?: boolean | undefined;
375
401
  userSelect?: boolean | undefined;
376
402
  cursor?: boolean | undefined;
377
403
  contain?: boolean | undefined;
378
404
  pointerEvents?: boolean | undefined;
379
405
  boxSizing?: boolean | undefined;
406
+ boxShadow?: boolean | undefined;
380
407
  x: boolean;
381
408
  y: boolean;
382
409
  scale: boolean;
@@ -393,6 +420,10 @@ export declare const validStyles: Readonly<{
393
420
  backfaceVisibility: boolean;
394
421
  backgroundColor: boolean;
395
422
  borderBottomColor: boolean;
423
+ borderBottomStyle: boolean;
424
+ borderTopStyle: boolean;
425
+ borderLeftStyle: boolean;
426
+ borderRightStyle: boolean;
396
427
  borderBottomEndRadius: boolean;
397
428
  borderBottomLeftRadius: boolean;
398
429
  borderBottomRightRadius: boolean;
@@ -468,8 +499,19 @@ export declare const validStyles: Readonly<{
468
499
  shadowOffset: boolean;
469
500
  shadowOpacity: boolean;
470
501
  shadowRadius: boolean;
502
+ enterStyle: boolean;
503
+ exitStyle: boolean;
471
504
  hoverStyle: boolean;
472
505
  pressStyle: boolean;
473
506
  focusStyle: boolean;
474
507
  }>;
508
+ export declare const mapTransformKeys: {
509
+ x: string;
510
+ y: string;
511
+ };
512
+ export declare const invertMapTransformKeys: {
513
+ translateX: string;
514
+ translateY: string;
515
+ };
516
+ export declare const mergeTransform: (obj: ViewStyle, key: string, val: any) => void;
475
517
  //# sourceMappingURL=validStyleProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validStyleProps.d.ts","sourceRoot":"","sources":["../src/validStyleProps.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;EAc9B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyFzB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;EAyB7B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGzB,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiB,CAAA;AAE3C,eAAO,MAAM,i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AAsB;;;CAGlC,CAAA;AAED,eAAO,MAAM,cAAc,QAAS,SAAS,OAAO,MAAM,OAAO,GAAG,SAInE,CAAA"}
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Nate Wienert
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,3 +0,0 @@
1
- export declare const AllRules: Set<unknown>;
2
- export declare const getStyleRules: () => Set<unknown>;
3
- //# sourceMappingURL=allRules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"allRules.d.ts","sourceRoot":"","sources":["../src/allRules.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,cAAY,CAAA;AAEjC,eAAO,MAAM,aAAa,oBAAiB,CAAA"}