@tamagui/helpers 1.0.0-alpha.29 → 1.0.0-alpha.36

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.0.0-alpha.29",
3
+ "version": "1.0.0-alpha.36",
4
4
  "source": "src/index.ts",
5
5
  "typings": "types",
6
6
  "main": "dist/cjs",
@@ -15,7 +15,7 @@
15
15
  "watch": "tamagui-build --watch"
16
16
  },
17
17
  "devDependencies": {
18
- "@tamagui/build": "^1.0.0-alpha.22",
18
+ "@tamagui/build": "^1.0.0-alpha.36",
19
19
  "react-native": "*"
20
20
  },
21
21
  "peerDependencies": {
@@ -24,5 +24,5 @@
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  },
27
- "gitHead": "ef2e601f5d8524d1f8722208341cb16d866285f9"
27
+ "gitHead": "d5b75feefe9694ee2f107b69c1be98a5f107eada"
28
28
  }
package/dist/allRules.js DELETED
@@ -1,9 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const AllRules = new Set();
4
- const getStyleRules = /* @__PURE__ */ __name(() => AllRules, "getStyleRules");
5
- export {
6
- AllRules,
7
- getStyleRules
8
- };
9
- //# sourceMappingURL=allRules.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/allRules.ts"],
4
- "sourcesContent": ["// ssr only\n\nexport const AllRules = new Set()\n\nexport const getStyleRules = () => AllRules\n"],
5
- "mappings": ";;AAEO,MAAM,WAAW,IAAI;AAErB,MAAM,gBAAgB,6BAAM,UAAN;",
6
- "names": []
7
- }
@@ -1,72 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- function concatClassName(_cn) {
4
- const classNamesOrPropObjects = arguments;
5
- const usedPrefixes = [];
6
- let final = "";
7
- const len = classNamesOrPropObjects.length;
8
- let propObjects = null;
9
- for (let x = len; x >= 0; x--) {
10
- const cns = classNamesOrPropObjects[x];
11
- if (!cns)
12
- continue;
13
- if (!Array.isArray(cns) && typeof cns !== "string") {
14
- propObjects = propObjects || [];
15
- propObjects.push(cns);
16
- continue;
17
- }
18
- const names = Array.isArray(cns) ? cns : cns.split(" ");
19
- const numNames = names.length;
20
- for (let i = numNames - 1; i >= 0; i--) {
21
- const name = names[i];
22
- if (!name || name === " ")
23
- continue;
24
- if (name[0] !== "_") {
25
- final = name + " " + final;
26
- continue;
27
- }
28
- const splitIndex = name.indexOf("-");
29
- if (splitIndex < 1) {
30
- final = name + " " + final;
31
- continue;
32
- }
33
- const nextChar = name[splitIndex + 1];
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;
38
- const uid = mediaKey ? styleKey + mediaKey : styleKey;
39
- if (!isMediaQuery && !isPsuedoQuery) {
40
- if (usedPrefixes.indexOf(uid) > -1) {
41
- continue;
42
- }
43
- usedPrefixes.push(uid);
44
- }
45
- const propName = styleKey;
46
- if (propName && propObjects) {
47
- if (propObjects.some((po) => {
48
- if (mediaKey) {
49
- const propKey = pseudoInvert[mediaKey];
50
- return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
51
- }
52
- const res = po && propName in po && po[propName] !== null;
53
- return res;
54
- })) {
55
- continue;
56
- }
57
- }
58
- final = name + " " + final;
59
- }
60
- }
61
- return final;
62
- }
63
- __name(concatClassName, "concatClassName");
64
- const pseudoInvert = {
65
- hover: "hoverStyle",
66
- focus: "focusStyle",
67
- press: "pressStyle"
68
- };
69
- export {
70
- concatClassName
71
- };
72
- //# sourceMappingURL=concatClassName.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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 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 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 const names = Array.isArray(cns) ? cns : cns.split(' ')\n\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\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 const splitIndex = name.indexOf('-')\n\n if (splitIndex < 1) {\n final = name + ' ' + final\n continue\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\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\n if (!isMediaQuery && !isPsuedoQuery) {\n if (usedPrefixes.indexOf(uid) > -1) {\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 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;AAOxC,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;AACpC,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,QAAQ,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe;AAC7B,kBAAY,KAAK;AACjB;AAAA;AAEF,UAAM,QAAQ,MAAM,QAAQ,OAAO,MAAM,IAAI,MAAM;AAEnD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM;AACnB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,OAAO,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA;AAEF,YAAM,aAAa,KAAK,QAAQ;AAEhC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AACrB;AAAA;AAEF,YAAM,WAAW,KAAK,aAAa;AAGnC,YAAM,eAAe,aAAa;AAElC,YAAM,gBAAgB,aAAa;AAEnC,YAAM,WAAW,KAAK,MAAM,GAAG;AAC/B,YAAM,WACJ,gBAAgB,gBAAgB,KAAK,MAAM,aAAa,GAAG,aAAa,KAAK;AAC/E,YAAM,MAAM,WAAW,WAAW,WAAW;AAE7C,UAAI,CAAC,gBAAgB,CAAC,eAAe;AACnC,YAAI,aAAa,QAAQ,OAAO,IAAI;AAClC;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;AACA;AAAA;AAAA;AAIJ,cAAQ,OAAO,MAAM;AAAA;AAAA;AAQzB,SAAO;AAAA;AAnFO;AAsFhB,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- function getNiceKey(name, len = 2) {
4
- let key = "";
5
- for (const [index, char] of name.split("").entries()) {
6
- if (index === 0 || char.toUpperCase() === char) {
7
- key += name.slice(index, index + len);
8
- }
9
- }
10
- return key;
11
- }
12
- __name(getNiceKey, "getNiceKey");
13
- export {
14
- getNiceKey
15
- };
16
- //# sourceMappingURL=getNiceKey.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/getNiceKey.ts"],
4
- "sourcesContent": ["export function getNiceKey(name: string, len = 2) {\n let key = ''\n for (const [index, char] of name.split('').entries()) {\n if (index === 0 || char.toUpperCase() === char) {\n key += name.slice(index, index + len)\n }\n }\n return key\n}\n"],
5
- "mappings": ";;AAAO,oBAAoB,MAAc,MAAM,GAAG;AAChD,MAAI,MAAM;AACV,aAAW,CAAC,OAAO,SAAS,KAAK,MAAM,IAAI,WAAW;AACpD,QAAI,UAAU,KAAK,KAAK,kBAAkB,MAAM;AAC9C,aAAO,KAAK,MAAM,OAAO,QAAQ;AAAA;AAAA;AAGrC,SAAO;AAAA;AAPO;",
6
- "names": []
7
- }
@@ -1,96 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import { atomic } from "react-native-web/dist/cjs/exports/StyleSheet/compile";
4
- import createCompileableStyle from "react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle";
5
- import createReactDOMStyle from "react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle";
6
- import i18Style from "react-native-web/dist/cjs/exports/StyleSheet/i18nStyle";
7
- import { AllRules } from "./AllRules";
8
- const pseudos = {
9
- focusStyle: {
10
- name: "focus",
11
- priority: 3
12
- },
13
- pressStyle: {
14
- name: "active",
15
- priority: 2
16
- },
17
- hoverStyle: {
18
- name: "hover",
19
- priority: 1
20
- }
21
- };
22
- const borderDefaults = {
23
- borderWidth: "borderStyle",
24
- borderBottomWidth: "borderBottomStyle",
25
- borderTopWidth: "borderTopStyle",
26
- borderLeftWidth: "borderLeftStyle",
27
- borderRightWidth: "borderRightStyle"
28
- };
29
- function getStylesAtomic(style, avoidCollection = false) {
30
- const styles = {
31
- base: {}
32
- };
33
- for (const key in style) {
34
- if (!!pseudos[key]) {
35
- styles[key] = style[key];
36
- } else {
37
- styles.base[key] = style[key];
38
- }
39
- }
40
- return Object.keys(styles).map((key) => {
41
- return getAtomicStyle(styles[key], pseudos[key], avoidCollection);
42
- }).flat();
43
- }
44
- __name(getStylesAtomic, "getStylesAtomic");
45
- const importantRegex = /\!important*/g;
46
- function getAtomicStyle(style, pseudo, avoidCollection) {
47
- if (style == null || typeof style !== "object") {
48
- throw new Error(`Wrong style type: "${typeof style}": ${style}`);
49
- }
50
- for (const key in borderDefaults) {
51
- if (key in style) {
52
- style[borderDefaults[key]] = style[borderDefaults[key]] ?? "solid";
53
- }
54
- }
55
- const all = {
56
- ...atomic(createCompileableStyle(createReactDOMStyle(i18Style(style))))
57
- };
58
- return Object.keys(all).map((key) => {
59
- const val = all[key];
60
- const hash = val.identifier.slice(`${val.identifier}`.lastIndexOf("-") + 1);
61
- const psuedoPrefix = pseudo ? `-${pseudo.name}-` : "";
62
- const identifier = `_${val.property}-${psuedoPrefix}${hash}`;
63
- const className = `.${identifier}`;
64
- const rules = val.rules.map((rule) => {
65
- if (pseudo) {
66
- const psuedoPrefixSelect = [...Array(pseudo.priority)].map(() => ":root").join("") + " ";
67
- let res = rule.replace(`.${val.identifier}`, `${psuedoPrefixSelect} ${className}`).replace("{", `:${pseudo.name}{`);
68
- if (pseudo.name === "hover") {
69
- res = `@media not all and (hover: none) { ${res} }`;
70
- }
71
- return res;
72
- }
73
- return rule.replace(`.${val.identifier}`, className).replace(importantRegex, "");
74
- });
75
- if (!avoidCollection) {
76
- if (rules.length > 1) {
77
- console.warn("have never seen more than one, verifying");
78
- }
79
- AllRules.add(rules[0]);
80
- }
81
- const result = {
82
- property: val.property,
83
- value: val.value,
84
- identifier,
85
- className,
86
- rules
87
- };
88
- return result;
89
- });
90
- }
91
- __name(getAtomicStyle, "getAtomicStyle");
92
- export {
93
- getStylesAtomic,
94
- pseudos
95
- };
96
- //# sourceMappingURL=getStylesAtomic.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/getStylesAtomic.ts"],
4
- "sourcesContent": ["import type { ViewStyle } from 'react-native'\nimport { atomic } from 'react-native-web/dist/cjs/exports/StyleSheet/compile'\nimport createCompileableStyle from 'react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle'\nimport createReactDOMStyle from 'react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle'\nimport i18Style from 'react-native-web/dist/cjs/exports/StyleSheet/i18nStyle'\n\nimport { AllRules } from './AllRules'\nimport { StyleObject } from './types'\n\nexport const pseudos = {\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n}\n\nconst borderDefaults = {\n borderWidth: 'borderStyle',\n borderBottomWidth: 'borderBottomStyle',\n borderTopWidth: 'borderTopStyle',\n borderLeftWidth: 'borderLeftStyle',\n borderRightWidth: 'borderRightStyle',\n}\n\nexport function getStylesAtomic(style: any, avoidCollection = false) {\n const styles: { [key: string]: ViewStyle } = {\n base: {},\n }\n // split pseudos\n for (const key in style) {\n if (!!pseudos[key]) {\n styles[key] = style[key]\n } else {\n styles.base[key] = style[key]\n }\n }\n return Object.keys(styles)\n .map((key) => {\n return getAtomicStyle(styles[key], pseudos[key], avoidCollection)\n })\n .flat()\n}\n\nconst importantRegex = /\\!important*/g\n\nfunction getAtomicStyle(\n style: ViewStyle,\n pseudo?: { name: string; priority: number },\n avoidCollection?: boolean\n): StyleObject[] {\n if (style == null || typeof style !== 'object') {\n throw new Error(`Wrong style type: \"${typeof style}\": ${style}`)\n }\n\n // why is this diff from react-native-web!? need to figure out\n for (const key in borderDefaults) {\n if (key in style) {\n style[borderDefaults[key]] = style[borderDefaults[key]] ?? 'solid'\n }\n }\n\n const all = {\n // TODO man, rnw has a ton of function calls etc here\n ...atomic(createCompileableStyle(createReactDOMStyle(i18Style(style)))),\n }\n\n return Object.keys(all).map((key) => {\n const val = all[key]\n const hash = val.identifier.slice(`${val.identifier}`.lastIndexOf('-') + 1)\n // pseudos have a `--` to be easier to find with concatClassNames\n const psuedoPrefix = pseudo ? `-${pseudo.name}-` : ''\n const identifier = `_${val.property}-${psuedoPrefix}${hash}`\n const className = `.${identifier}`\n const rules = val.rules.map((rule) => {\n if (pseudo) {\n const psuedoPrefixSelect = [...Array(pseudo.priority)].map(() => ':root').join('') + ' '\n let res = rule\n .replace(`.${val.identifier}`, `${psuedoPrefixSelect} ${className}`)\n .replace('{', `:${pseudo.name}{`)\n\n if (pseudo.name === 'hover') {\n // hover styles need to be conditional\n // perhaps this can be generalized but for now lets just shortcut\n // and hardcode for hover styles, if we need to later we can\n // WEIRD SYNTAX, SEE:\n // https://stackoverflow.com/questions/40532204/media-query-for-devices-supporting-hover\n res = `@media not all and (hover: none) { ${res} }`\n }\n return res\n }\n return rule.replace(`.${val.identifier}`, className).replace(importantRegex, '')\n })\n\n if (!avoidCollection) {\n if (rules.length > 1) {\n console.warn('have never seen more than one, verifying')\n }\n AllRules.add(rules[0])\n }\n\n const result: StyleObject = {\n property: val.property,\n value: val.value,\n identifier,\n className,\n rules,\n }\n return result\n })\n}\n"],
5
- "mappings": ";;AACA;AACA;AACA;AACA;AAEA;AAGO,MAAM,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA;AAAA;AAId,MAAM,iBAAiB;AAAA,EACrB,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA;AAGb,yBAAyB,OAAY,kBAAkB,OAAO;AACnE,QAAM,SAAuC;AAAA,IAC3C,MAAM;AAAA;AAGR,aAAW,OAAO,OAAO;AACvB,QAAI,CAAC,CAAC,QAAQ,MAAM;AAClB,aAAO,OAAO,MAAM;AAAA,WACf;AACL,aAAO,KAAK,OAAO,MAAM;AAAA;AAAA;AAG7B,SAAO,OAAO,KAAK,QAChB,IAAI,CAAC,QAAQ;AACZ,WAAO,eAAe,OAAO,MAAM,QAAQ,MAAM;AAAA,KAElD;AAAA;AAhBW;AAmBhB,MAAM,iBAAiB;AAEvB,wBACE,OACA,QACA,iBACe;AACf,MAAI,SAAS,QAAQ,OAAO,UAAU,UAAU;AAC9C,UAAM,IAAI,MAAM,sBAAsB,OAAO,WAAW;AAAA;AAI1D,aAAW,OAAO,gBAAgB;AAChC,QAAI,OAAO,OAAO;AAChB,YAAM,eAAe,QAAQ,MAAM,eAAe,SAAS;AAAA;AAAA;AAI/D,QAAM,MAAM;AAAA,OAEP,OAAO,uBAAuB,oBAAoB,SAAS;AAAA;AAGhE,SAAO,OAAO,KAAK,KAAK,IAAI,CAAC,QAAQ;AACnC,UAAM,MAAM,IAAI;AAChB,UAAM,OAAO,IAAI,WAAW,MAAM,GAAG,IAAI,aAAa,YAAY,OAAO;AAEzE,UAAM,eAAe,SAAS,IAAI,OAAO,UAAU;AACnD,UAAM,aAAa,IAAI,IAAI,YAAY,eAAe;AACtD,UAAM,YAAY,IAAI;AACtB,UAAM,QAAQ,IAAI,MAAM,IAAI,CAAC,SAAS;AACpC,UAAI,QAAQ;AACV,cAAM,qBAAqB,CAAC,GAAG,MAAM,OAAO,WAAW,IAAI,MAAM,SAAS,KAAK,MAAM;AACrF,YAAI,MAAM,KACP,QAAQ,IAAI,IAAI,cAAc,GAAG,sBAAsB,aACvD,QAAQ,KAAK,IAAI,OAAO;AAE3B,YAAI,OAAO,SAAS,SAAS;AAM3B,gBAAM,sCAAsC;AAAA;AAE9C,eAAO;AAAA;AAET,aAAO,KAAK,QAAQ,IAAI,IAAI,cAAc,WAAW,QAAQ,gBAAgB;AAAA;AAG/E,QAAI,CAAC,iBAAiB;AACpB,UAAI,MAAM,SAAS,GAAG;AACpB,gBAAQ,KAAK;AAAA;AAEf,eAAS,IAAI,MAAM;AAAA;AAGrB,UAAM,SAAsB;AAAA,MAC1B,UAAU,IAAI;AAAA,MACd,OAAO,IAAI;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA;AAEF,WAAO;AAAA;AAAA;AA9DF;",
6
- "names": []
7
- }
@@ -1,11 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- console.log("is this importing");
4
- function getStylesAtomic() {
5
- console.warn("no-op native");
6
- }
7
- __name(getStylesAtomic, "getStylesAtomic");
8
- export {
9
- getStylesAtomic
10
- };
11
- //# sourceMappingURL=getStylesAtomic.native.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/getStylesAtomic.native.ts"],
4
- "sourcesContent": ["console.log('is this importing')\n\nexport function getStylesAtomic() {\n console.warn('no-op native')\n}\n"],
5
- "mappings": ";;AAAA,QAAQ,IAAI;AAEL,2BAA2B;AAChC,UAAQ,KAAK;AAAA;AADC;",
6
- "names": []
7
- }
package/dist/index.cjs DELETED
@@ -1,243 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
18
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
19
- var __export = (target, all) => {
20
- __markAsModule(target);
21
- for (var name in all)
22
- __defProp(target, name, { get: all[name], enumerable: true });
23
- };
24
-
25
- // src/index.ts
26
- __export(exports, {
27
- AllRules: () => AllRules,
28
- concatClassName: () => concatClassName,
29
- getStyleRules: () => getStyleRules,
30
- stylePropsAll: () => stylePropsAll,
31
- stylePropsText: () => stylePropsText,
32
- stylePropsTextOnly: () => stylePropsTextOnly,
33
- stylePropsTransform: () => stylePropsTransform,
34
- stylePropsView: () => stylePropsView,
35
- validStyles: () => validStyles,
36
- validStylesPseudo: () => validStylesPseudo
37
- });
38
-
39
- // src/concatClassName.ts
40
- function concatClassName(_cn) {
41
- const classNamesOrPropObjects = arguments;
42
- const usedPrefixes = [];
43
- let final = "";
44
- const len = classNamesOrPropObjects.length;
45
- let propObjects = null;
46
- for (let x = len; x >= 0; x--) {
47
- const cns = classNamesOrPropObjects[x];
48
- if (!cns)
49
- continue;
50
- if (!Array.isArray(cns) && typeof cns !== "string") {
51
- propObjects = propObjects || [];
52
- propObjects.push(cns);
53
- continue;
54
- }
55
- const names = Array.isArray(cns) ? cns : cns.split(" ");
56
- const numNames = names.length;
57
- for (let i = numNames - 1; i >= 0; i--) {
58
- const name = names[i];
59
- if (!name || name === " ")
60
- continue;
61
- if (name[0] !== "_") {
62
- final = name + " " + final;
63
- continue;
64
- }
65
- const splitIndex = name.indexOf("-");
66
- if (splitIndex < 1) {
67
- final = name + " " + final;
68
- continue;
69
- }
70
- const nextChar = name[splitIndex + 1];
71
- const isMediaQuery = nextChar === "_";
72
- const isPsuedoQuery = nextChar === "-";
73
- const styleKey = name.slice(1, splitIndex);
74
- const mediaKey = isMediaQuery || isPsuedoQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
75
- const uid = mediaKey ? styleKey + mediaKey : styleKey;
76
- if (!isMediaQuery && !isPsuedoQuery) {
77
- if (usedPrefixes.indexOf(uid) > -1) {
78
- continue;
79
- }
80
- usedPrefixes.push(uid);
81
- }
82
- const propName = styleKey;
83
- if (propName && propObjects) {
84
- if (propObjects.some((po) => {
85
- if (mediaKey) {
86
- const propKey = pseudoInvert[mediaKey];
87
- return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
88
- }
89
- const res = po && propName in po && po[propName] !== null;
90
- return res;
91
- })) {
92
- continue;
93
- }
94
- }
95
- final = name + " " + final;
96
- }
97
- }
98
- return final;
99
- }
100
- __name(concatClassName, "concatClassName");
101
- var pseudoInvert = {
102
- hover: "hoverStyle",
103
- focus: "focusStyle",
104
- press: "pressStyle"
105
- };
106
-
107
- // src/validStyleProps.ts
108
- var stylePropsTransform = {
109
- x: true,
110
- y: true,
111
- scale: true,
112
- perspective: true,
113
- scaleX: true,
114
- scaleY: true,
115
- skewX: true,
116
- skewY: true,
117
- matrix: true,
118
- rotate: true,
119
- rotateY: true,
120
- rotateX: true,
121
- rotateZ: true
122
- };
123
- var stylePropsView = Object.freeze(__spreadValues(__spreadValues({
124
- backfaceVisibility: true,
125
- backgroundColor: true,
126
- borderBottomColor: true,
127
- borderBottomEndRadius: true,
128
- borderBottomLeftRadius: true,
129
- borderBottomRightRadius: true,
130
- borderBottomStartRadius: true,
131
- borderBottomWidth: true,
132
- borderColor: true,
133
- borderEndColor: true,
134
- borderLeftColor: true,
135
- borderLeftWidth: true,
136
- borderRadius: true,
137
- borderRightColor: true,
138
- borderRightWidth: true,
139
- borderStartColor: true,
140
- borderStyle: true,
141
- borderTopColor: true,
142
- borderTopEndRadius: true,
143
- borderTopLeftRadius: true,
144
- borderTopRightRadius: true,
145
- borderTopStartRadius: true,
146
- borderTopWidth: true,
147
- borderWidth: true,
148
- opacity: true,
149
- transform: true,
150
- alignContent: true,
151
- alignItems: true,
152
- alignSelf: true,
153
- aspectRatio: true,
154
- borderEndWidth: true,
155
- borderStartWidth: true,
156
- bottom: true,
157
- display: true,
158
- end: true,
159
- flex: true,
160
- flexBasis: true,
161
- flexDirection: true,
162
- flexGrow: true,
163
- flexShrink: true,
164
- flexWrap: true,
165
- height: true,
166
- justifyContent: true,
167
- left: true,
168
- margin: true,
169
- marginBottom: true,
170
- marginEnd: true,
171
- marginHorizontal: true,
172
- marginLeft: true,
173
- marginRight: true,
174
- marginStart: true,
175
- marginTop: true,
176
- marginVertical: true,
177
- maxHeight: true,
178
- maxWidth: true,
179
- minHeight: true,
180
- minWidth: true,
181
- overflow: true,
182
- padding: true,
183
- paddingBottom: true,
184
- paddingEnd: true,
185
- paddingHorizontal: true,
186
- paddingLeft: true,
187
- paddingRight: true,
188
- paddingStart: true,
189
- paddingTop: true,
190
- paddingVertical: true,
191
- position: true,
192
- right: true,
193
- start: true,
194
- top: true,
195
- width: true,
196
- zIndex: true,
197
- direction: true,
198
- shadowColor: true,
199
- shadowOffset: true,
200
- shadowOpacity: true,
201
- shadowRadius: true
202
- }, stylePropsTransform), process.env.TAMAGUI_TARGET === "web" && {
203
- userSelect: true,
204
- cursor: true,
205
- contain: true,
206
- pointerEvents: true,
207
- boxSizing: true
208
- }));
209
- var stylePropsTextOnly = Object.freeze(__spreadValues({
210
- color: true,
211
- fontFamily: true,
212
- fontSize: true,
213
- fontStyle: true,
214
- fontWeight: true,
215
- letterSpacing: true,
216
- lineHeight: true,
217
- textAlign: true,
218
- textDecorationLine: true,
219
- textDecorationStyle: true,
220
- textDecorationColor: true,
221
- textShadowColor: true,
222
- textShadowOffset: true,
223
- textShadowRadius: true,
224
- textTransform: true
225
- }, process.env.TAMAGUI_TARGET === "web" && {
226
- whiteSpace: true,
227
- wordWrap: true,
228
- textOverflow: true,
229
- textDecorationDistance: true
230
- }));
231
- var stylePropsText = Object.freeze(__spreadValues(__spreadValues({}, stylePropsView), stylePropsTextOnly));
232
- var stylePropsAll = stylePropsText;
233
- var validStylesPseudo = {
234
- hoverStyle: true,
235
- pressStyle: true,
236
- focusStyle: true
237
- };
238
- var validStyles = __spreadValues(__spreadValues({}, validStylesPseudo), stylePropsView);
239
-
240
- // src/allRules.ts
241
- var AllRules = new Set();
242
- var getStyleRules = /* @__PURE__ */ __name(() => AllRules, "getStyleRules");
243
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts", "../src/concatClassName.ts", "../src/validStyleProps.ts", "../src/allRules.ts"],
4
- "sourcesContent": ["export * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './allRules'\n", "// 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 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 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 const names = Array.isArray(cns) ? cns : cns.split(' ')\n\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\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 const splitIndex = name.indexOf('-')\n\n if (splitIndex < 1) {\n final = name + ' ' + final\n continue\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\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\n if (!isMediaQuery && !isPsuedoQuery) {\n if (usedPrefixes.indexOf(uid) > -1) {\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 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", "// flat transform props\nexport const stylePropsTransform = {\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 = {\n hoverStyle: true,\n pressStyle: true,\n focusStyle: true,\n}\n\nexport const validStyles = {\n ...validStylesPseudo,\n ...stylePropsView,\n}\n", "// ssr only\n\nexport const AllRules = new Set()\n\nexport const getStyleRules = () => AllRules\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,yBAAyB,KAAU;AAOxC,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;AACpC,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,QAAQ,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe;AAC7B,kBAAY,KAAK;AACjB;AAAA;AAEF,UAAM,QAAQ,MAAM,QAAQ,OAAO,MAAM,IAAI,MAAM;AAEnD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM;AACnB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,OAAO,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA;AAEF,YAAM,aAAa,KAAK,QAAQ;AAEhC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AACrB;AAAA;AAEF,YAAM,WAAW,KAAK,aAAa;AAGnC,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AQ,IAAI,mBAAmB,SAAS;AAAA,EAC1C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,eAAe;AAAA,EACf,WAAW;AAAA;AAIR,IAAM,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,GAIX,QAAQ,IAAI,mBAAmB,SAAS;AAAA,EAC1C,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd,wBAAwB;AAAA;AAIrB,IAAM,iBAAiB,OAAO,OAAO,kCACvC,iBACA;AAGE,IAAM,gBAAgB;AAEtB,IAAM,oBAAoB;AAAA,EAC/B,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA;AAGP,IAAM,cAAc,kCACtB,oBACA;;;ACpJE,IAAM,WAAW,IAAI;AAErB,IAAM,gBAAgB,6BAAM,UAAN;",
6
- "names": []
7
- }
package/dist/index.js DELETED
@@ -1,5 +0,0 @@
1
- export * from "./concatClassName";
2
- export * from "./validStyleProps";
3
- export * from "./types";
4
- export * from "./allRules";
5
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './allRules'\n"],
5
- "mappings": "AAAA;AACA;AACA;AACA;",
6
- "names": []
7
- }
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const simpleHash = /* @__PURE__ */ __name((str) => {
4
- let hash = 0;
5
- for (let i = 0; i < str.length; i++) {
6
- const char = str.charCodeAt(i);
7
- hash = (hash << 5) - hash + char;
8
- hash &= hash;
9
- }
10
- return new Uint32Array([hash])[0].toString(36);
11
- }, "simpleHash");
12
- export {
13
- simpleHash
14
- };
15
- //# sourceMappingURL=simpleHash.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/simpleHash.ts"],
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;",
6
- "names": []
7
- }
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,33 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import { getNiceKey } from "./getNiceKey";
4
- import { stylePropsAll } from "./validStyleProps";
5
- const existing = new Set();
6
- const uniqueStyleKeys = {};
7
- const uniqueKeyToStyleName = {};
8
- for (const name in stylePropsAll) {
9
- addStylePrefix(name);
10
- }
11
- function getOrCreateStylePrefix(name) {
12
- return uniqueStyleKeys[name] ?? addStylePrefix(name);
13
- }
14
- __name(getOrCreateStylePrefix, "getOrCreateStylePrefix");
15
- function addStylePrefix(name) {
16
- let len = 1;
17
- let key = getNiceKey(name);
18
- while (existing.has(key)) {
19
- len++;
20
- key = getNiceKey(name, len);
21
- }
22
- existing.add(key);
23
- uniqueStyleKeys[name] = key;
24
- uniqueKeyToStyleName[key] = name;
25
- return key;
26
- }
27
- __name(addStylePrefix, "addStylePrefix");
28
- export {
29
- getOrCreateStylePrefix,
30
- uniqueKeyToStyleName,
31
- uniqueStyleKeys
32
- };
33
- //# sourceMappingURL=uniqueStyleKeys.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/uniqueStyleKeys.ts"],
4
- "sourcesContent": ["import { getNiceKey } from './getNiceKey'\nimport { stylePropsAll } from './validStyleProps'\n\nconst existing = new Set<string>()\n\n// unique shortkey for each style key\n// for atomic styles prefixing and collision dedupe\nexport const uniqueStyleKeys: { [key: string]: string } = {}\nexport const uniqueKeyToStyleName: { [key: string]: string } = {}\n\nfor (const name in stylePropsAll) {\n addStylePrefix(name)\n}\n\nexport function getOrCreateStylePrefix(name: string) {\n return uniqueStyleKeys[name] ?? addStylePrefix(name)\n}\n\nfunction addStylePrefix(name: string) {\n let len = 1\n let key = getNiceKey(name)\n while (existing.has(key)) {\n len++\n key = getNiceKey(name, len)\n }\n existing.add(key)\n uniqueStyleKeys[name] = key\n uniqueKeyToStyleName[key] = name\n return key\n}\n"],
5
- "mappings": ";;AAAA;AACA;AAEA,MAAM,WAAW,IAAI;AAId,MAAM,kBAA6C;AACnD,MAAM,uBAAkD;AAE/D,WAAW,QAAQ,eAAe;AAChC,iBAAe;AAAA;AAGV,gCAAgC,MAAc;AACnD,SAAO,gBAAgB,SAAS,eAAe;AAAA;AADjC;AAIhB,wBAAwB,MAAc;AACpC,MAAI,MAAM;AACV,MAAI,MAAM,WAAW;AACrB,SAAO,SAAS,IAAI,MAAM;AACxB;AACA,UAAM,WAAW,MAAM;AAAA;AAEzB,WAAS,IAAI;AACb,kBAAgB,QAAQ;AACxB,uBAAqB,OAAO;AAC5B,SAAO;AAAA;AAVA;",
6
- "names": []
7
- }
@@ -1,150 +0,0 @@
1
- const stylePropsTransform = {
2
- x: true,
3
- y: true,
4
- scale: true,
5
- perspective: true,
6
- scaleX: true,
7
- scaleY: true,
8
- skewX: true,
9
- skewY: true,
10
- matrix: true,
11
- rotate: true,
12
- rotateY: true,
13
- rotateX: true,
14
- rotateZ: true
15
- };
16
- const stylePropsView = Object.freeze({
17
- backfaceVisibility: true,
18
- backgroundColor: true,
19
- borderBottomColor: true,
20
- borderBottomEndRadius: true,
21
- borderBottomLeftRadius: true,
22
- borderBottomRightRadius: true,
23
- borderBottomStartRadius: true,
24
- borderBottomWidth: true,
25
- borderColor: true,
26
- borderEndColor: true,
27
- borderLeftColor: true,
28
- borderLeftWidth: true,
29
- borderRadius: true,
30
- borderRightColor: true,
31
- borderRightWidth: true,
32
- borderStartColor: true,
33
- borderStyle: true,
34
- borderTopColor: true,
35
- borderTopEndRadius: true,
36
- borderTopLeftRadius: true,
37
- borderTopRightRadius: true,
38
- borderTopStartRadius: true,
39
- borderTopWidth: true,
40
- borderWidth: true,
41
- opacity: true,
42
- transform: true,
43
- alignContent: true,
44
- alignItems: true,
45
- alignSelf: true,
46
- aspectRatio: true,
47
- borderEndWidth: true,
48
- borderStartWidth: true,
49
- bottom: true,
50
- display: true,
51
- end: true,
52
- flex: true,
53
- flexBasis: true,
54
- flexDirection: true,
55
- flexGrow: true,
56
- flexShrink: true,
57
- flexWrap: true,
58
- height: true,
59
- justifyContent: true,
60
- left: true,
61
- margin: true,
62
- marginBottom: true,
63
- marginEnd: true,
64
- marginHorizontal: true,
65
- marginLeft: true,
66
- marginRight: true,
67
- marginStart: true,
68
- marginTop: true,
69
- marginVertical: true,
70
- maxHeight: true,
71
- maxWidth: true,
72
- minHeight: true,
73
- minWidth: true,
74
- overflow: true,
75
- padding: true,
76
- paddingBottom: true,
77
- paddingEnd: true,
78
- paddingHorizontal: true,
79
- paddingLeft: true,
80
- paddingRight: true,
81
- paddingStart: true,
82
- paddingTop: true,
83
- paddingVertical: true,
84
- position: true,
85
- right: true,
86
- start: true,
87
- top: true,
88
- width: true,
89
- zIndex: true,
90
- direction: true,
91
- shadowColor: true,
92
- shadowOffset: true,
93
- shadowOpacity: true,
94
- shadowRadius: true,
95
- ...stylePropsTransform,
96
- ...process.env.TAMAGUI_TARGET === "web" && {
97
- userSelect: true,
98
- cursor: true,
99
- contain: true,
100
- pointerEvents: true,
101
- boxSizing: true
102
- }
103
- });
104
- const stylePropsTextOnly = Object.freeze({
105
- color: true,
106
- fontFamily: true,
107
- fontSize: true,
108
- fontStyle: true,
109
- fontWeight: true,
110
- letterSpacing: true,
111
- lineHeight: true,
112
- textAlign: true,
113
- textDecorationLine: true,
114
- textDecorationStyle: true,
115
- textDecorationColor: true,
116
- textShadowColor: true,
117
- textShadowOffset: true,
118
- textShadowRadius: true,
119
- textTransform: true,
120
- ...process.env.TAMAGUI_TARGET === "web" && {
121
- whiteSpace: true,
122
- wordWrap: true,
123
- textOverflow: true,
124
- textDecorationDistance: true
125
- }
126
- });
127
- const stylePropsText = Object.freeze({
128
- ...stylePropsView,
129
- ...stylePropsTextOnly
130
- });
131
- const stylePropsAll = stylePropsText;
132
- const validStylesPseudo = {
133
- hoverStyle: true,
134
- pressStyle: true,
135
- focusStyle: true
136
- };
137
- const validStyles = {
138
- ...validStylesPseudo,
139
- ...stylePropsView
140
- };
141
- export {
142
- stylePropsAll,
143
- stylePropsText,
144
- stylePropsTextOnly,
145
- stylePropsTransform,
146
- stylePropsView,
147
- validStyles,
148
- validStylesPseudo
149
- };
150
- //# sourceMappingURL=validStyleProps.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/validStyleProps.ts"],
4
- "sourcesContent": ["// flat transform props\nexport const stylePropsTransform = {\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 = {\n hoverStyle: true,\n pressStyle: true,\n focusStyle: true,\n}\n\nexport const validStyles = {\n ...validStylesPseudo,\n ...stylePropsView,\n}\n"],
5
- "mappings": "AACO,MAAM,sBAAsB;AAAA,EACjC,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;AAAA,EACtB,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,aAA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