@tamagui/helpers 1.0.0-alpha.8 → 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.
- package/dist/cjs/allRules.js +32 -0
- package/dist/cjs/allRules.js.map +7 -0
- package/dist/cjs/concatClassName.js +91 -0
- package/dist/cjs/concatClassName.js.map +7 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/log.js +32 -0
- package/dist/cjs/log.js.map +7 -0
- package/dist/cjs/simpleHash.js +37 -0
- package/dist/cjs/simpleHash.js.map +7 -0
- package/dist/cjs/types.js +16 -0
- package/dist/cjs/types.js.map +7 -0
- package/dist/{index.cjs → cjs/validStyleProps.js} +63 -94
- package/dist/cjs/validStyleProps.js.map +7 -0
- package/dist/{allRules.js → esm/allRules.js} +1 -1
- package/dist/{allRules.js.map → esm/allRules.js.map} +2 -2
- package/dist/{concatClassName.js → esm/concatClassName.js} +8 -11
- package/dist/esm/concatClassName.js.map +7 -0
- package/dist/{index.js → esm/index.js} +1 -1
- package/dist/{index.js.map → esm/index.js.map} +2 -2
- package/dist/esm/log.js +10 -0
- package/dist/esm/log.js.map +7 -0
- package/dist/{simpleHash.js → esm/simpleHash.js} +0 -0
- package/dist/{simpleHash.js.map → esm/simpleHash.js.map} +2 -2
- package/dist/{types.js → esm/types.js} +0 -0
- package/dist/{types.js.map → esm/types.js.map} +0 -0
- package/dist/{validStyleProps.js → esm/validStyleProps.js} +35 -9
- package/dist/esm/validStyleProps.js.map +7 -0
- package/dist/jsx/allRules.js +8 -0
- package/dist/jsx/concatClassName.js +68 -0
- package/dist/jsx/index.js +4 -0
- package/dist/jsx/log.js +9 -0
- package/dist/jsx/simpleHash.js +14 -0
- package/dist/jsx/types.js +0 -0
- package/{src/validStyleProps.ts → dist/jsx/validStyleProps.js} +58 -35
- package/package.json +13 -10
- package/types/concatClassName.d.ts +2 -0
- package/types/concatClassName.d.ts.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -0
- package/types/log.d.ts +2 -0
- package/types/log.d.ts.map +1 -0
- package/types/simpleHash.d.ts +2 -0
- package/types/simpleHash.d.ts.map +1 -0
- package/types/types.d.ts +8 -0
- package/types/types.d.ts.map +1 -0
- package/types/validStyleProps.d.ts +517 -0
- package/types/validStyleProps.d.ts.map +1 -0
- package/LICENSE +0 -21
- package/dist/concatClassName.js.map +0 -7
- package/dist/getNiceKey.js +0 -16
- package/dist/getNiceKey.js.map +0 -7
- package/dist/getStylesAtomic.js +0 -96
- package/dist/getStylesAtomic.js.map +0 -7
- package/dist/getStylesAtomic.native.js +0 -11
- package/dist/getStylesAtomic.native.js.map +0 -7
- package/dist/index.cjs.map +0 -7
- package/dist/uniqueStyleKeys.js +0 -33
- package/dist/uniqueStyleKeys.js.map +0 -7
- package/dist/validStyleProps.js.map +0 -7
- package/src/allRules.ts +0 -5
- package/src/concatClassName.ts +0 -101
- package/src/index.ts +0 -4
- package/src/simpleHash.ts +0 -9
- package/src/types.ts +0 -7
- package/types.d.ts +0 -488
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
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;
|
|
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
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
const stylePropsTransform = Object.freeze({
|
|
2
4
|
x: true,
|
|
3
5
|
y: true,
|
|
4
6
|
scale: true,
|
|
@@ -12,11 +14,15 @@ const stylePropsTransform = {
|
|
|
12
14
|
rotateY: true,
|
|
13
15
|
rotateX: true,
|
|
14
16
|
rotateZ: true
|
|
15
|
-
};
|
|
17
|
+
});
|
|
16
18
|
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
|
|
141
|
+
const validPseudoKeys = Object.freeze({
|
|
142
|
+
enterStyle: true,
|
|
143
|
+
exitStyle: true,
|
|
133
144
|
hoverStyle: true,
|
|
134
145
|
pressStyle: true,
|
|
135
146
|
focusStyle: true
|
|
136
|
-
};
|
|
137
|
-
const validStyles = {
|
|
138
|
-
...
|
|
147
|
+
});
|
|
148
|
+
const validStyles = Object.freeze({
|
|
149
|
+
...validPseudoKeys,
|
|
139
150
|
...stylePropsView
|
|
151
|
+
});
|
|
152
|
+
const mapTransformKeys = {
|
|
153
|
+
x: "translateX",
|
|
154
|
+
y: "translateY"
|
|
155
|
+
};
|
|
156
|
+
const invertMapTransformKeys = {
|
|
157
|
+
translateX: "x",
|
|
158
|
+
translateY: "y"
|
|
140
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
|
-
|
|
148
|
-
|
|
173
|
+
validPseudoKeys,
|
|
174
|
+
validStyles
|
|
149
175
|
};
|
|
150
176
|
//# sourceMappingURL=validStyleProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/validStyleProps.ts"],
|
|
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,S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AO;AAAA,KACpC;AAAA,KACA;AACL,CAAC;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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
const AllRules = /* @__PURE__ */ new Set();
|
|
4
|
+
const getStyleRules = /* @__PURE__ */ __name(() => AllRules, "getStyleRules");
|
|
5
|
+
export {
|
|
6
|
+
AllRules,
|
|
7
|
+
getStyleRules
|
|
8
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function concatClassName(_cn) {
|
|
4
|
+
const cnOrPropObjcet = arguments;
|
|
5
|
+
const usedPrefixes = [];
|
|
6
|
+
let final = "";
|
|
7
|
+
const len = cnOrPropObjcet.length;
|
|
8
|
+
let propObjects = null;
|
|
9
|
+
for (let x = len; x >= 0; x--) {
|
|
10
|
+
const cns = cnOrPropObjcet[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 styleKey = name.slice(1, name.lastIndexOf("-"));
|
|
36
|
+
const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
|
|
37
|
+
const uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
38
|
+
if (usedPrefixes.indexOf(uid) > -1) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
usedPrefixes.push(uid);
|
|
42
|
+
const propName = styleKey;
|
|
43
|
+
if (propName && propObjects) {
|
|
44
|
+
if (propObjects.some((po) => {
|
|
45
|
+
if (mediaKey) {
|
|
46
|
+
const propKey = pseudoInvert[mediaKey];
|
|
47
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
48
|
+
}
|
|
49
|
+
const res = po && propName in po && po[propName] !== null;
|
|
50
|
+
return res;
|
|
51
|
+
})) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
final = name + " " + final;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return final;
|
|
59
|
+
}
|
|
60
|
+
__name(concatClassName, "concatClassName");
|
|
61
|
+
const pseudoInvert = {
|
|
62
|
+
hover: "hoverStyle",
|
|
63
|
+
focus: "focusStyle",
|
|
64
|
+
press: "pressStyle"
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
concatClassName
|
|
68
|
+
};
|
package/dist/jsx/log.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
};
|
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
const stylePropsTransform = Object.freeze({
|
|
3
4
|
x: true,
|
|
4
5
|
y: true,
|
|
5
6
|
scale: true,
|
|
@@ -12,13 +13,16 @@ export const stylePropsTransform = {
|
|
|
12
13
|
rotate: true,
|
|
13
14
|
rotateY: true,
|
|
14
15
|
rotateX: true,
|
|
15
|
-
rotateZ: true
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const stylePropsView = Object.freeze({
|
|
16
|
+
rotateZ: true
|
|
17
|
+
});
|
|
18
|
+
const stylePropsView = Object.freeze({
|
|
19
19
|
backfaceVisibility: true,
|
|
20
20
|
backgroundColor: true,
|
|
21
21
|
borderBottomColor: true,
|
|
22
|
+
borderBottomStyle: true,
|
|
23
|
+
borderTopStyle: true,
|
|
24
|
+
borderLeftStyle: true,
|
|
25
|
+
borderRightStyle: true,
|
|
22
26
|
borderBottomEndRadius: true,
|
|
23
27
|
borderBottomLeftRadius: true,
|
|
24
28
|
borderBottomRightRadius: true,
|
|
@@ -95,18 +99,18 @@ export const stylePropsView = Object.freeze({
|
|
|
95
99
|
shadowOpacity: true,
|
|
96
100
|
shadowRadius: true,
|
|
97
101
|
...stylePropsTransform,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
...process.env.TAMAGUI_TARGET === "web" && {
|
|
103
|
+
overflowX: true,
|
|
104
|
+
overflowY: true,
|
|
101
105
|
userSelect: true,
|
|
102
106
|
cursor: true,
|
|
103
107
|
contain: true,
|
|
104
108
|
pointerEvents: true,
|
|
105
109
|
boxSizing: true,
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
boxShadow: true
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
const stylePropsTextOnly = Object.freeze({
|
|
110
114
|
color: true,
|
|
111
115
|
fontFamily: true,
|
|
112
116
|
fontSize: true,
|
|
@@ -122,31 +126,50 @@ export const stylePropsTextOnly = Object.freeze({
|
|
|
122
126
|
textShadowOffset: true,
|
|
123
127
|
textShadowRadius: true,
|
|
124
128
|
textTransform: true,
|
|
125
|
-
|
|
126
|
-
// allow a few web only ones
|
|
127
|
-
// TODO
|
|
128
|
-
...(process.env.TAMAGUI_TARGET === 'web' && {
|
|
129
|
+
...process.env.TAMAGUI_TARGET === "web" && {
|
|
129
130
|
whiteSpace: true,
|
|
130
131
|
wordWrap: true,
|
|
131
132
|
textOverflow: true,
|
|
132
|
-
textDecorationDistance: true
|
|
133
|
-
}
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
export const stylePropsText = Object.freeze({
|
|
133
|
+
textDecorationDistance: true
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
const stylePropsText = Object.freeze({
|
|
137
137
|
...stylePropsView,
|
|
138
|
-
...stylePropsTextOnly
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
...stylePropsTextOnly
|
|
139
|
+
});
|
|
140
|
+
const stylePropsAll = stylePropsText;
|
|
141
|
+
const validPseudoKeys = Object.freeze({
|
|
142
|
+
enterStyle: true,
|
|
143
|
+
exitStyle: true,
|
|
144
144
|
hoverStyle: true,
|
|
145
145
|
pressStyle: true,
|
|
146
|
-
focusStyle: true
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
...
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
focusStyle: true
|
|
147
|
+
});
|
|
148
|
+
const validStyles = Object.freeze({
|
|
149
|
+
...validPseudoKeys,
|
|
150
|
+
...stylePropsView
|
|
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");
|
|
164
|
+
export {
|
|
165
|
+
invertMapTransformKeys,
|
|
166
|
+
mapTransformKeys,
|
|
167
|
+
mergeTransform,
|
|
168
|
+
stylePropsAll,
|
|
169
|
+
stylePropsText,
|
|
170
|
+
stylePropsTextOnly,
|
|
171
|
+
stylePropsTransform,
|
|
172
|
+
stylePropsView,
|
|
173
|
+
validPseudoKeys,
|
|
174
|
+
validStyles
|
|
175
|
+
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"types": "types",
|
|
6
|
+
"main": "dist/cjs",
|
|
7
|
+
"module": "dist/esm",
|
|
8
|
+
"module:jsx": "dist/jsx",
|
|
8
9
|
"files": [
|
|
9
|
-
"types
|
|
10
|
-
"dist"
|
|
11
|
-
"src"
|
|
10
|
+
"types",
|
|
11
|
+
"dist"
|
|
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-
|
|
20
|
+
"@tamagui/build": "^1.0.0-beta.0",
|
|
21
|
+
"react-native": "*"
|
|
19
22
|
},
|
|
20
23
|
"peerDependencies": {
|
|
21
24
|
"react-native": "*"
|
|
@@ -23,5 +26,5 @@
|
|
|
23
26
|
"publishConfig": {
|
|
24
27
|
"access": "public"
|
|
25
28
|
},
|
|
26
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
|
|
27
30
|
}
|
|
@@ -0,0 +1 @@
|
|
|
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
ADDED
|
@@ -0,0 +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,OAAO,CAAA"}
|
package/types/log.d.ts
ADDED
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simpleHash.d.ts","sourceRoot":"","sources":["../src/simpleHash.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QAAS,MAAM,WAQrC,CAAA"}
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,CAAA"}
|