@tamagui/helpers 1.0.21 → 1.0.23
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/composeEventHandlers.js +1 -1
- package/dist/cjs/composeEventHandlers.js.map +2 -2
- package/dist/esm/composeEventHandlers.js +1 -1
- package/dist/esm/composeEventHandlers.js.map +2 -2
- package/dist/jsx/clamp.js +7 -0
- package/dist/jsx/clamp.js.map +7 -0
- package/dist/jsx/composeEventHandlers.js +15 -0
- package/dist/jsx/composeEventHandlers.js.map +7 -0
- package/dist/jsx/concatClassName.js +66 -0
- package/dist/jsx/concatClassName.js.map +7 -0
- package/dist/jsx/index.js +7 -0
- package/dist/jsx/index.js.map +7 -0
- package/dist/jsx/types.js +1 -0
- package/dist/jsx/types.js.map +7 -0
- package/dist/jsx/validStyleProps.js +173 -0
- package/dist/jsx/validStyleProps.js.map +7 -0
- package/package.json +4 -3
- package/src/composeEventHandlers.ts +1 -0
|
@@ -27,7 +27,7 @@ function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
|
27
27
|
}
|
|
28
28
|
return function composedEventHandler(event) {
|
|
29
29
|
og == null ? void 0 : og(event);
|
|
30
|
-
if (!(checkDefaultPrevented && "defaultPrevented" in event) || "defaultPrevented" in event && !event.defaultPrevented) {
|
|
30
|
+
if (!event || !(checkDefaultPrevented && "defaultPrevented" in event) || "defaultPrevented" in event && !event.defaultPrevented) {
|
|
31
31
|
return next == null ? void 0 : next(event);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/composeEventHandlers.ts"],
|
|
4
|
-
"sourcesContent": ["type Events = Object\n\nexport type EventHandler<E extends Events> = (event: E) => void\n\nexport function composeEventHandlers<E extends Events>(\n og?: EventHandler<E>,\n next?: EventHandler<E>,\n { checkDefaultPrevented = true } = {}\n) {\n if (!og || !next) {\n return next || og\n }\n return function composedEventHandler(event: E) {\n og?.(event)\n if (\n !(checkDefaultPrevented && 'defaultPrevented' in event) ||\n // @ts-ignore\n ('defaultPrevented' in event && !event.defaultPrevented)\n ) {\n return next?.(event)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,SAAS,qBACd,IACA,MACA,EAAE,wBAAwB,KAAK,IAAI,CAAC,GACpC;AACA,MAAI,CAAC,MAAM,CAAC,MAAM;AAChB,WAAO,QAAQ;AAAA,EACjB;AACA,SAAO,SAAS,qBAAqB,OAAU;AAC7C,6BAAK;AACL,QACE,EAAE,yBAAyB,sBAAsB,UAEhD,sBAAsB,SAAS,CAAC,MAAM,kBACvC;AACA,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
4
|
+
"sourcesContent": ["type Events = Object\n\nexport type EventHandler<E extends Events> = (event: E) => void\n\nexport function composeEventHandlers<E extends Events>(\n og?: EventHandler<E>,\n next?: EventHandler<E>,\n { checkDefaultPrevented = true } = {}\n) {\n if (!og || !next) {\n return next || og\n }\n return function composedEventHandler(event: E) {\n og?.(event)\n if (\n !event ||\n !(checkDefaultPrevented && 'defaultPrevented' in event) ||\n // @ts-ignore\n ('defaultPrevented' in event && !event.defaultPrevented)\n ) {\n return next?.(event)\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,SAAS,qBACd,IACA,MACA,EAAE,wBAAwB,KAAK,IAAI,CAAC,GACpC;AACA,MAAI,CAAC,MAAM,CAAC,MAAM;AAChB,WAAO,QAAQ;AAAA,EACjB;AACA,SAAO,SAAS,qBAAqB,OAAU;AAC7C,6BAAK;AACL,QACE,CAAC,SACD,EAAE,yBAAyB,sBAAsB,UAEhD,sBAAsB,SAAS,CAAC,MAAM,kBACvC;AACA,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
|
4
4
|
}
|
|
5
5
|
return function composedEventHandler(event) {
|
|
6
6
|
og == null ? void 0 : og(event);
|
|
7
|
-
if (!(checkDefaultPrevented && "defaultPrevented" in event) || "defaultPrevented" in event && !event.defaultPrevented) {
|
|
7
|
+
if (!event || !(checkDefaultPrevented && "defaultPrevented" in event) || "defaultPrevented" in event && !event.defaultPrevented) {
|
|
8
8
|
return next == null ? void 0 : next(event);
|
|
9
9
|
}
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/composeEventHandlers.ts"],
|
|
4
|
-
"sourcesContent": ["type Events = Object\n\nexport type EventHandler<E extends Events> = (event: E) => void\n\nexport function composeEventHandlers<E extends Events>(\n og?: EventHandler<E>,\n next?: EventHandler<E>,\n { checkDefaultPrevented = true } = {}\n) {\n if (!og || !next) {\n return next || og\n }\n return function composedEventHandler(event: E) {\n og?.(event)\n if (\n !(checkDefaultPrevented && 'defaultPrevented' in event) ||\n // @ts-ignore\n ('defaultPrevented' in event && !event.defaultPrevented)\n ) {\n return next?.(event)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "AAIO,SAAS,qBACd,IACA,MACA,EAAE,wBAAwB,KAAK,IAAI,CAAC,GACpC;AACA,MAAI,CAAC,MAAM,CAAC,MAAM;AAChB,WAAO,QAAQ;AAAA,EACjB;AACA,SAAO,SAAS,qBAAqB,OAAU;AAC7C,6BAAK;AACL,QACE,EAAE,yBAAyB,sBAAsB,UAEhD,sBAAsB,SAAS,CAAC,MAAM,kBACvC;AACA,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
4
|
+
"sourcesContent": ["type Events = Object\n\nexport type EventHandler<E extends Events> = (event: E) => void\n\nexport function composeEventHandlers<E extends Events>(\n og?: EventHandler<E>,\n next?: EventHandler<E>,\n { checkDefaultPrevented = true } = {}\n) {\n if (!og || !next) {\n return next || og\n }\n return function composedEventHandler(event: E) {\n og?.(event)\n if (\n !event ||\n !(checkDefaultPrevented && 'defaultPrevented' in event) ||\n // @ts-ignore\n ('defaultPrevented' in event && !event.defaultPrevented)\n ) {\n return next?.(event)\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAIO,SAAS,qBACd,IACA,MACA,EAAE,wBAAwB,KAAK,IAAI,CAAC,GACpC;AACA,MAAI,CAAC,MAAM,CAAC,MAAM;AAChB,WAAO,QAAQ;AAAA,EACjB;AACA,SAAO,SAAS,qBAAqB,OAAU;AAC7C,6BAAK;AACL,QACE,CAAC,SACD,EAAE,yBAAyB,sBAAsB,UAEhD,sBAAsB,SAAS,CAAC,MAAM,kBACvC;AACA,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/clamp.ts"],
|
|
4
|
+
"sourcesContent": ["export function clamp(value: number, [min, max]: [number, number]): number {\n return Math.min(max, Math.max(min, value))\n}\n"],
|
|
5
|
+
"mappings": "AAAO,SAAS,MAAM,OAAe,CAAC,KAAK,GAAG,GAA6B;AACzE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
2
|
+
if (!og || !next) {
|
|
3
|
+
return next || og;
|
|
4
|
+
}
|
|
5
|
+
return function composedEventHandler(event) {
|
|
6
|
+
og?.(event);
|
|
7
|
+
if (!(checkDefaultPrevented && "defaultPrevented" in event) || "defaultPrevented" in event && !event.defaultPrevented) {
|
|
8
|
+
return next?.(event);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
composeEventHandlers
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=composeEventHandlers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/composeEventHandlers.ts"],
|
|
4
|
+
"sourcesContent": ["type Events = Object\n\nexport type EventHandler<E extends Events> = (event: E) => void\n\nexport function composeEventHandlers<E extends Events>(\n og?: EventHandler<E>,\n next?: EventHandler<E>,\n { checkDefaultPrevented = true } = {}\n) {\n if (!og || !next) {\n return next || og\n }\n return function composedEventHandler(event: E) {\n og?.(event)\n if (\n !(checkDefaultPrevented && 'defaultPrevented' in event) ||\n // @ts-ignore\n ('defaultPrevented' in event && !event.defaultPrevented)\n ) {\n return next?.(event)\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAIO,SAAS,qBACd,IACA,MACA,EAAE,wBAAwB,KAAK,IAAI,CAAC,GACpC;AACA,MAAI,CAAC,MAAM,CAAC,MAAM;AAChB,WAAO,QAAQ;AAAA,EACjB;AACA,SAAO,SAAS,qBAAqB,OAAU;AAC7C,SAAK,KAAK;AACV,QACE,EAAE,yBAAyB,sBAAsB,UAEhD,sBAAsB,SAAS,CAAC,MAAM,kBACvC;AACA,aAAO,OAAO,KAAK;AAAA,IACrB;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function concatClassName(_cn) {
|
|
2
|
+
const args = arguments;
|
|
3
|
+
const usedPrefixes = [];
|
|
4
|
+
let final = "";
|
|
5
|
+
const len = args.length;
|
|
6
|
+
let propObjects = null;
|
|
7
|
+
for (let x = len; x >= 0; x--) {
|
|
8
|
+
const cns = args[x];
|
|
9
|
+
if (!cns)
|
|
10
|
+
continue;
|
|
11
|
+
if (!Array.isArray(cns) && typeof cns !== "string") {
|
|
12
|
+
propObjects = propObjects || [];
|
|
13
|
+
propObjects.push(cns);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const names = Array.isArray(cns) ? cns : cns.split(" ");
|
|
17
|
+
const numNames = names.length;
|
|
18
|
+
for (let i = numNames - 1; i >= 0; i--) {
|
|
19
|
+
const name = names[i];
|
|
20
|
+
if (!name || name === " ")
|
|
21
|
+
continue;
|
|
22
|
+
if (name[0] !== "_") {
|
|
23
|
+
final = name + " " + final;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const splitIndex = name.indexOf("-");
|
|
27
|
+
if (splitIndex < 1) {
|
|
28
|
+
final = name + " " + final;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const nextChar = name[splitIndex + 1];
|
|
32
|
+
const isMediaQuery = nextChar === "_";
|
|
33
|
+
const styleKey = name.slice(1, name.lastIndexOf("-"));
|
|
34
|
+
const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
|
|
35
|
+
const uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
36
|
+
if (usedPrefixes.indexOf(uid) > -1) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
usedPrefixes.push(uid);
|
|
40
|
+
const propName = styleKey;
|
|
41
|
+
if (propName && propObjects) {
|
|
42
|
+
if (propObjects.some((po) => {
|
|
43
|
+
if (mediaKey) {
|
|
44
|
+
const propKey = pseudoInvert[mediaKey];
|
|
45
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
46
|
+
}
|
|
47
|
+
const res = po && propName in po && po[propName] !== null;
|
|
48
|
+
return res;
|
|
49
|
+
})) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
final = name + " " + final;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return final;
|
|
57
|
+
}
|
|
58
|
+
const pseudoInvert = {
|
|
59
|
+
hover: "hoverStyle",
|
|
60
|
+
focus: "focusStyle",
|
|
61
|
+
press: "pressStyle"
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
concatClassName
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=concatClassName.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/concatClassName.ts"],
|
|
4
|
+
"sourcesContent": ["// perf sensitive so doing some weird stuff\n\n/**\n * next - take objects:\n *\n * { _shorthand: 'postfix' }\n *\n */\n\nexport function concatClassName(...args: any[]): any\nexport function concatClassName(_cn: Record<string, any> | null | undefined): string {\n const args = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = args.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = args[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 isPseudoQuery = nextChar === '0'\n const styleKey = name.slice(1, name.lastIndexOf('-'))\n // 2. isMediaQuery || isPseudoQuery\n const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null\n const uid = mediaKey ? styleKey + mediaKey : styleKey\n // 3. && !isPseudoQuery\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": "AAUO,SAAS,gBAAgB,KAAqD;AACnF,QAAM,OAAO;AACb,QAAM,eAAyB,CAAC;AAChC,MAAI,QAAQ;AAEZ,QAAM,MAAM,KAAK;AACjB,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,KAAK;AAEjB,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;AAEA,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './clamp'\nexport * from './composeEventHandlers'\nexport * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from '@tamagui/simple-hash'\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const stylePropsTransform = Object.freeze({
|
|
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 validStylesOnBaseProps = Object.freeze({
|
|
17
|
+
placeholderTextColor: true
|
|
18
|
+
});
|
|
19
|
+
const stylePropsView = Object.freeze({
|
|
20
|
+
backfaceVisibility: true,
|
|
21
|
+
backgroundColor: true,
|
|
22
|
+
borderBottomColor: true,
|
|
23
|
+
borderBottomStyle: true,
|
|
24
|
+
borderTopStyle: true,
|
|
25
|
+
borderLeftStyle: true,
|
|
26
|
+
borderRightStyle: true,
|
|
27
|
+
borderBottomEndRadius: true,
|
|
28
|
+
borderBottomLeftRadius: true,
|
|
29
|
+
borderBottomRightRadius: true,
|
|
30
|
+
borderBottomStartRadius: true,
|
|
31
|
+
borderBottomWidth: true,
|
|
32
|
+
borderColor: true,
|
|
33
|
+
borderEndColor: true,
|
|
34
|
+
borderLeftColor: true,
|
|
35
|
+
borderLeftWidth: true,
|
|
36
|
+
borderRadius: true,
|
|
37
|
+
borderRightColor: true,
|
|
38
|
+
borderRightWidth: true,
|
|
39
|
+
borderStartColor: true,
|
|
40
|
+
borderStyle: true,
|
|
41
|
+
borderTopColor: true,
|
|
42
|
+
borderTopEndRadius: true,
|
|
43
|
+
borderTopLeftRadius: true,
|
|
44
|
+
borderTopRightRadius: true,
|
|
45
|
+
borderTopStartRadius: true,
|
|
46
|
+
borderTopWidth: true,
|
|
47
|
+
borderWidth: true,
|
|
48
|
+
opacity: true,
|
|
49
|
+
transform: true,
|
|
50
|
+
alignContent: true,
|
|
51
|
+
alignItems: true,
|
|
52
|
+
alignSelf: true,
|
|
53
|
+
aspectRatio: true,
|
|
54
|
+
borderEndWidth: true,
|
|
55
|
+
borderStartWidth: true,
|
|
56
|
+
bottom: true,
|
|
57
|
+
display: true,
|
|
58
|
+
end: true,
|
|
59
|
+
flex: true,
|
|
60
|
+
flexBasis: true,
|
|
61
|
+
flexDirection: true,
|
|
62
|
+
flexGrow: true,
|
|
63
|
+
flexShrink: true,
|
|
64
|
+
flexWrap: true,
|
|
65
|
+
height: true,
|
|
66
|
+
justifyContent: true,
|
|
67
|
+
left: true,
|
|
68
|
+
margin: true,
|
|
69
|
+
marginBottom: true,
|
|
70
|
+
marginEnd: true,
|
|
71
|
+
marginHorizontal: true,
|
|
72
|
+
marginLeft: true,
|
|
73
|
+
marginRight: true,
|
|
74
|
+
marginStart: true,
|
|
75
|
+
marginTop: true,
|
|
76
|
+
marginVertical: true,
|
|
77
|
+
maxHeight: true,
|
|
78
|
+
maxWidth: true,
|
|
79
|
+
minHeight: true,
|
|
80
|
+
minWidth: true,
|
|
81
|
+
overflow: true,
|
|
82
|
+
padding: true,
|
|
83
|
+
paddingBottom: true,
|
|
84
|
+
paddingEnd: true,
|
|
85
|
+
paddingHorizontal: true,
|
|
86
|
+
paddingLeft: true,
|
|
87
|
+
paddingRight: true,
|
|
88
|
+
paddingStart: true,
|
|
89
|
+
paddingTop: true,
|
|
90
|
+
paddingVertical: true,
|
|
91
|
+
position: true,
|
|
92
|
+
right: true,
|
|
93
|
+
start: true,
|
|
94
|
+
top: true,
|
|
95
|
+
width: true,
|
|
96
|
+
zIndex: true,
|
|
97
|
+
direction: true,
|
|
98
|
+
shadowColor: true,
|
|
99
|
+
shadowOffset: true,
|
|
100
|
+
shadowOpacity: true,
|
|
101
|
+
shadowRadius: true,
|
|
102
|
+
...validStylesOnBaseProps,
|
|
103
|
+
...stylePropsTransform,
|
|
104
|
+
...process.env.TAMAGUI_TARGET === "web" && {
|
|
105
|
+
overflowX: true,
|
|
106
|
+
overflowY: true,
|
|
107
|
+
userSelect: true,
|
|
108
|
+
cursor: true,
|
|
109
|
+
contain: true,
|
|
110
|
+
pointerEvents: true,
|
|
111
|
+
boxSizing: true,
|
|
112
|
+
boxShadow: true,
|
|
113
|
+
outlineColor: true,
|
|
114
|
+
outlineStyle: true,
|
|
115
|
+
outlineOffset: true,
|
|
116
|
+
outlineWidth: true
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const stylePropsTextOnly = Object.freeze({
|
|
120
|
+
color: true,
|
|
121
|
+
fontFamily: true,
|
|
122
|
+
fontSize: true,
|
|
123
|
+
fontStyle: true,
|
|
124
|
+
fontWeight: true,
|
|
125
|
+
letterSpacing: true,
|
|
126
|
+
lineHeight: true,
|
|
127
|
+
textAlign: true,
|
|
128
|
+
textDecorationLine: true,
|
|
129
|
+
textDecorationStyle: true,
|
|
130
|
+
textDecorationColor: true,
|
|
131
|
+
textShadowColor: true,
|
|
132
|
+
textShadowOffset: true,
|
|
133
|
+
textShadowRadius: true,
|
|
134
|
+
textTransform: true,
|
|
135
|
+
...process.env.TAMAGUI_TARGET === "web" && {
|
|
136
|
+
whiteSpace: true,
|
|
137
|
+
wordWrap: true,
|
|
138
|
+
textOverflow: true,
|
|
139
|
+
textDecorationDistance: true,
|
|
140
|
+
userSelect: true,
|
|
141
|
+
selectable: true,
|
|
142
|
+
cursor: true,
|
|
143
|
+
WebkitLineClamp: true,
|
|
144
|
+
WebkitBoxOrient: true
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const stylePropsText = Object.freeze({
|
|
148
|
+
...stylePropsView,
|
|
149
|
+
...stylePropsTextOnly
|
|
150
|
+
});
|
|
151
|
+
const stylePropsAll = stylePropsText;
|
|
152
|
+
const validPseudoKeys = Object.freeze({
|
|
153
|
+
enterStyle: true,
|
|
154
|
+
exitStyle: true,
|
|
155
|
+
hoverStyle: true,
|
|
156
|
+
pressStyle: true,
|
|
157
|
+
focusStyle: true
|
|
158
|
+
});
|
|
159
|
+
const validStyles = Object.freeze({
|
|
160
|
+
...validPseudoKeys,
|
|
161
|
+
...stylePropsView
|
|
162
|
+
});
|
|
163
|
+
export {
|
|
164
|
+
stylePropsAll,
|
|
165
|
+
stylePropsText,
|
|
166
|
+
stylePropsTextOnly,
|
|
167
|
+
stylePropsTransform,
|
|
168
|
+
stylePropsView,
|
|
169
|
+
validPseudoKeys,
|
|
170
|
+
validStyles,
|
|
171
|
+
validStylesOnBaseProps
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=validStyleProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 validStylesOnBaseProps = Object.freeze({\n placeholderTextColor: 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 ...validStylesOnBaseProps,\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 outlineColor: true,\n outlineStyle: true,\n outlineOffset: true,\n outlineWidth: 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 some web only ones\n ...(process.env.TAMAGUI_TARGET === 'web' && {\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n userSelect: true,\n selectable: true,\n cursor: true,\n WebkitLineClamp: true,\n WebkitBoxOrient: 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 ...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iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EAGf,GAAI,QAAQ,IAAI,mBAAmB,SAAS;AAAA,IAC1C,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,wBAAwB;AAAA,IACxB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,EACnB;AACF,CAAC;AAEM,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,GAAG;AAAA,EACH,GAAG;AACL,CAAC;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;AAAA,EACvC,GAAG;AAAA,EACH,GAAG;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"clean:build": "tamagui-build clean:build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tamagui/simple-hash": "^1.0.
|
|
22
|
+
"@tamagui/simple-hash": "^1.0.23"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tamagui/build": "^1.0.
|
|
25
|
+
"@tamagui/build": "^1.0.23"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"exports": {
|
|
31
31
|
"./package.json": "./package.json",
|
|
32
32
|
".": {
|
|
33
|
+
"types": "./types/index.d.ts",
|
|
33
34
|
"import": "./dist/esm/index.js",
|
|
34
35
|
"require": "./dist/cjs/index.js"
|
|
35
36
|
}
|
|
@@ -13,6 +13,7 @@ export function composeEventHandlers<E extends Events>(
|
|
|
13
13
|
return function composedEventHandler(event: E) {
|
|
14
14
|
og?.(event)
|
|
15
15
|
if (
|
|
16
|
+
!event ||
|
|
16
17
|
!(checkDefaultPrevented && 'defaultPrevented' in event) ||
|
|
17
18
|
// @ts-ignore
|
|
18
19
|
('defaultPrevented' in event && !event.defaultPrevented)
|