@tamagui/helpers 1.0.0-beta.8 → 1.0.1-beta.100
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/clamp.js +30 -0
- package/dist/cjs/clamp.js.map +7 -0
- package/dist/cjs/composeEventHandlers.js +2 -4
- package/dist/cjs/composeEventHandlers.js.map +1 -1
- package/dist/cjs/concatClassName.js +0 -2
- package/dist/cjs/concatClassName.js.map +2 -2
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/log.js +2 -3
- package/dist/cjs/log.js.map +1 -1
- package/dist/cjs/simpleHash.js +2 -3
- package/dist/cjs/simpleHash.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/validStyleProps.js +4 -20
- package/dist/cjs/validStyleProps.js.map +2 -2
- package/dist/esm/clamp.js +7 -0
- package/dist/esm/clamp.js.map +7 -0
- package/dist/esm/composeEventHandlers.js +2 -5
- package/dist/esm/composeEventHandlers.js.map +1 -1
- package/dist/esm/concatClassName.js +0 -3
- package/dist/esm/concatClassName.js.map +2 -2
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/log.js +2 -4
- package/dist/esm/log.js.map +1 -1
- package/dist/esm/simpleHash.js +2 -4
- package/dist/esm/simpleHash.js.map +1 -1
- package/dist/esm/validStyleProps.js +40 -47
- package/dist/esm/validStyleProps.js.map +2 -2
- package/dist/jsx/clamp.js +7 -0
- package/dist/jsx/clamp.js.map +7 -0
- package/dist/jsx/composeEventHandlers.js +3 -5
- package/dist/jsx/composeEventHandlers.js.map +7 -0
- package/dist/jsx/concatClassName.js +1 -3
- package/dist/jsx/concatClassName.js.map +7 -0
- package/dist/jsx/index.js +3 -0
- package/dist/jsx/index.js.map +7 -0
- package/dist/jsx/log.js +3 -4
- package/dist/jsx/log.js.map +7 -0
- package/dist/jsx/simpleHash.js +3 -4
- package/dist/jsx/simpleHash.js.map +7 -0
- package/dist/jsx/types.js +1 -0
- package/dist/jsx/types.js.map +7 -0
- package/dist/jsx/validStyleProps.js +5 -18
- package/dist/jsx/validStyleProps.js.map +7 -0
- package/package.json +6 -3
- package/src/clamp.ts +3 -0
- package/src/composeEventHandlers.ts +17 -0
- package/src/concatClassName.ts +92 -0
- package/src/index.ts +7 -0
- package/src/log.ts +4 -0
- package/src/simpleHash.ts +9 -0
- package/src/types.ts +7 -0
- package/src/validStyleProps.ts +163 -0
- package/types/clamp.d.ts +2 -0
- package/types/composeEventHandlers.d.ts +0 -0
- package/types/composeEventHandlers.d.ts.map +0 -0
- package/types/concatClassName.d.ts +0 -0
- package/types/index.d.ts +2 -0
- package/types/log.d.ts +0 -0
- package/types/simpleHash.d.ts +0 -0
- package/types/simpleHash.d.ts.map +0 -0
- package/types/types.d.ts +1 -1
- package/types/validStyleProps.d.ts +497 -502
- package/types/concatClassName.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/log.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
- package/types/validStyleProps.d.ts.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var clamp_exports = {};
|
|
19
|
+
__export(clamp_exports, {
|
|
20
|
+
clamp: () => clamp
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(clamp_exports);
|
|
23
|
+
function clamp(value, [min, max]) {
|
|
24
|
+
return Math.min(max, Math.max(min, value));
|
|
25
|
+
}
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
clamp
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=clamp.js.map
|
|
@@ -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": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,eAAe,OAAe,CAAC,KAAK,MAAgC;AACzE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -22,14 +21,13 @@ __export(composeEventHandlers_exports, {
|
|
|
22
21
|
});
|
|
23
22
|
module.exports = __toCommonJS(composeEventHandlers_exports);
|
|
24
23
|
function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
25
|
-
return
|
|
24
|
+
return function composedEventHandler(event) {
|
|
26
25
|
og == null ? void 0 : og(event);
|
|
27
26
|
if (!checkDefaultPrevented || !event.defaultPrevented) {
|
|
28
27
|
return next == null ? void 0 : next(event);
|
|
29
28
|
}
|
|
30
|
-
}
|
|
29
|
+
};
|
|
31
30
|
}
|
|
32
|
-
__name(composeEventHandlers, "composeEventHandlers");
|
|
33
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
32
|
0 && (module.exports = {
|
|
35
33
|
composeEventHandlers
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/composeEventHandlers.ts"],
|
|
4
4
|
"sourcesContent": ["import { FocusEvent } from 'react'\nimport { GestureResponderEvent } from 'react-native'\n\nexport type EventHandler<E extends Event | GestureResponderEvent | FocusEvent> = (event: E) => void\n\nexport function composeEventHandlers<E extends Event | GestureResponderEvent | FocusEvent>(\n og?: EventHandler<E>,\n next?: EventHandler<E>,\n { checkDefaultPrevented = true } = {}\n) {\n return function composedEventHandler(event: E) {\n og?.(event)\n if (!checkDefaultPrevented || !event.defaultPrevented) {\n return next?.(event)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,8BACL,IACA,MACA,EAAE,wBAAwB,SAAS,CAAC,GACpC;AACA,SAAO,8BAA8B,OAAU;AAC7C,6BAAK;AACL,QAAI,CAAC,yBAAyB,CAAC,MAAM,kBAAkB;AACrD,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -78,7 +77,6 @@ function concatClassName(_cn) {
|
|
|
78
77
|
}
|
|
79
78
|
return final;
|
|
80
79
|
}
|
|
81
|
-
__name(concatClassName, "concatClassName");
|
|
82
80
|
const pseudoInvert = {
|
|
83
81
|
hover: "hoverStyle",
|
|
84
82
|
focus: "focusStyle",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/concatClassName.ts"],
|
|
4
|
-
"sourcesContent": ["// perf sensitive so doing some weird stuff\n\nimport { ViewStyle } from 'react-native'\n\nexport function concatClassName(...args: any[]): any\nexport function concatClassName(_cn: ViewStyle | null | undefined): string {\n const cnOrPropObjcet = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = cnOrPropObjcet.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = cnOrPropObjcet[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n // commenting out three things to make pseudos override properly\n // (leave in for a bit to see if other bugs pop up later):\n // 1. const
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// perf sensitive so doing some weird stuff\n\nimport { ViewStyle } from 'react-native'\n\nexport function concatClassName(...args: any[]): any\nexport function concatClassName(_cn: ViewStyle | null | undefined): string {\n const cnOrPropObjcet = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = cnOrPropObjcet.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = cnOrPropObjcet[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n // commenting out three things to make pseudos override properly\n // (leave in for a bit to see if other bugs pop up later):\n // 1. const 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": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,yBAAyB,KAA2C;AACzE,QAAM,iBAAiB;AACvB,QAAM,eAAyB,CAAC;AAChC,MAAI,QAAQ;AAEZ,QAAM,MAAM,eAAe;AAC3B,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,eAAe;AAE3B,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe,CAAC;AAC9B,kBAAY,KAAK,GAAG;AACpB;AAAA,IACF;AAEA,UAAM,QAAQ,MAAM,QAAQ,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG;AACtD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM;AAEnB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,OAAO,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA,MACF;AAEA,YAAM,aAAa,KAAK,QAAQ,GAAG;AACnC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AAErB;AAAA,MACF;AAEA,YAAM,WAAW,KAAK,aAAa;AAGnC,YAAM,eAAe,aAAa;AAKlC,YAAM,WAAW,KAAK,MAAM,GAAG,KAAK,YAAY,GAAG,CAAC;AAEpD,YAAM,WAAW,eAAe,KAAK,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI;AAC7E,YAAM,MAAM,WAAW,WAAW,WAAW;AAG7C,UAAI,aAAa,QAAQ,GAAG,IAAI,IAAI;AAElC;AAAA,MACF;AACA,mBAAa,KAAK,GAAG;AAGrB,YAAM,WAAW;AACjB,UAAI,YAAY,aAAa;AAC3B,YACE,YAAY,KAAK,CAAC,OAAO;AACvB,cAAI,UAAU;AACZ,kBAAM,UAAU,aAAa;AAC7B,mBAAO,MAAM,GAAG,YAAY,YAAY,GAAG,YAAY,GAAG,aAAa;AAAA,UACzE;AACA,gBAAM,MAAM,MAAM,YAAY,MAAM,GAAG,cAAc;AACrD,iBAAO;AAAA,QACT,CAAC,GACD;AAEA;AAAA,QACF;AAAA,MACF;AAEA,cAAQ,OAAO,MAAM;AAAA,IACvB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,9 +14,11 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
14
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
15
|
var src_exports = {};
|
|
16
16
|
module.exports = __toCommonJS(src_exports);
|
|
17
|
+
__reExport(src_exports, require("./clamp"), module.exports);
|
|
17
18
|
__reExport(src_exports, require("./composeEventHandlers"), module.exports);
|
|
18
19
|
__reExport(src_exports, require("./concatClassName"), module.exports);
|
|
19
20
|
__reExport(src_exports, require("./validStyleProps"), module.exports);
|
|
20
21
|
__reExport(src_exports, require("./types"), module.exports);
|
|
21
22
|
__reExport(src_exports, require("./log"), module.exports);
|
|
23
|
+
__reExport(src_exports, require("./simpleHash"), module.exports);
|
|
22
24
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './composeEventHandlers'\nexport * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,
|
|
4
|
+
"sourcesContent": ["export * from './clamp'\nexport * from './composeEventHandlers'\nexport * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\nexport * from './simpleHash'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,oBAAd;AACA,wBAAc,mCADd;AAEA,wBAAc,8BAFd;AAGA,wBAAc,8BAHd;AAIA,wBAAc,oBAJd;AAKA,wBAAc,kBALd;AAMA,wBAAc,yBANd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/log.js
CHANGED
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -21,10 +20,10 @@ __export(log_exports, {
|
|
|
21
20
|
log: () => log
|
|
22
21
|
});
|
|
23
22
|
module.exports = __toCommonJS(log_exports);
|
|
24
|
-
const log =
|
|
23
|
+
const log = (...args) => {
|
|
25
24
|
console.log(...args);
|
|
26
25
|
return args[0];
|
|
27
|
-
}
|
|
26
|
+
};
|
|
28
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
28
|
0 && (module.exports = {
|
|
30
29
|
log
|
package/dist/cjs/log.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/log.ts"],
|
|
4
4
|
"sourcesContent": ["export const log = (...args: any) => {\n console.log(...args)\n return args[0]\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,MAAM,IAAI,SAAc;AACnC,UAAQ,IAAI,GAAG,IAAI;AACnB,SAAO,KAAK;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/simpleHash.js
CHANGED
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -21,7 +20,7 @@ __export(simpleHash_exports, {
|
|
|
21
20
|
simpleHash: () => simpleHash
|
|
22
21
|
});
|
|
23
22
|
module.exports = __toCommonJS(simpleHash_exports);
|
|
24
|
-
const simpleHash =
|
|
23
|
+
const simpleHash = (str) => {
|
|
25
24
|
let hash = 0;
|
|
26
25
|
for (let i = 0; i < str.length; i++) {
|
|
27
26
|
const char = str.charCodeAt(i);
|
|
@@ -29,7 +28,7 @@ const simpleHash = /* @__PURE__ */ __name((str) => {
|
|
|
29
28
|
hash &= hash;
|
|
30
29
|
}
|
|
31
30
|
return new Uint32Array([hash])[0].toString(36);
|
|
32
|
-
}
|
|
31
|
+
};
|
|
33
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
33
|
0 && (module.exports = {
|
|
35
34
|
simpleHash
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/simpleHash.ts"],
|
|
4
4
|
"sourcesContent": ["export const simpleHash = (str: string) => {\n let hash = 0\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return new Uint32Array([hash])[0].toString(36)\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAa,CAAC,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;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["export type StyleObject = {\n property: string\n
|
|
4
|
+
"sourcesContent": ["export type StyleObject = {\n property: string\n pseudo?: 'hover' | 'focus' | 'active'\n value: string\n identifier: string\n rules: string[]\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -16,7 +16,6 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
}
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
20
19
|
var __export = (target, all) => {
|
|
21
20
|
for (var name in all)
|
|
22
21
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -32,9 +31,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
32
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
32
|
var validStyleProps_exports = {};
|
|
34
33
|
__export(validStyleProps_exports, {
|
|
35
|
-
invertMapTransformKeys: () => invertMapTransformKeys,
|
|
36
|
-
mapTransformKeys: () => mapTransformKeys,
|
|
37
|
-
mergeTransform: () => mergeTransform,
|
|
38
34
|
stylePropsAll: () => stylePropsAll,
|
|
39
35
|
stylePropsText: () => stylePropsText,
|
|
40
36
|
stylePropsTextOnly: () => stylePropsTextOnly,
|
|
@@ -172,7 +168,10 @@ const stylePropsTextOnly = Object.freeze(__spreadValues({
|
|
|
172
168
|
whiteSpace: true,
|
|
173
169
|
wordWrap: true,
|
|
174
170
|
textOverflow: true,
|
|
175
|
-
textDecorationDistance: true
|
|
171
|
+
textDecorationDistance: true,
|
|
172
|
+
userSelect: true,
|
|
173
|
+
selectable: true,
|
|
174
|
+
cursor: true
|
|
176
175
|
}));
|
|
177
176
|
const stylePropsText = Object.freeze(__spreadValues(__spreadValues({}, stylePropsView), stylePropsTextOnly));
|
|
178
177
|
const stylePropsAll = stylePropsText;
|
|
@@ -184,23 +183,8 @@ const validPseudoKeys = Object.freeze({
|
|
|
184
183
|
focusStyle: true
|
|
185
184
|
});
|
|
186
185
|
const validStyles = Object.freeze(__spreadValues(__spreadValues({}, validPseudoKeys), stylePropsView));
|
|
187
|
-
const mapTransformKeys = {
|
|
188
|
-
x: "translateX",
|
|
189
|
-
y: "translateY"
|
|
190
|
-
};
|
|
191
|
-
const invertMapTransformKeys = {
|
|
192
|
-
translateX: "x",
|
|
193
|
-
translateY: "y"
|
|
194
|
-
};
|
|
195
|
-
const mergeTransform = /* @__PURE__ */ __name((obj, key, val) => {
|
|
196
|
-
obj.transform || (obj.transform = []);
|
|
197
|
-
obj.transform.push({ [mapTransformKeys[key] || key]: val });
|
|
198
|
-
}, "mergeTransform");
|
|
199
186
|
// Annotate the CommonJS export names for ESM import in node:
|
|
200
187
|
0 && (module.exports = {
|
|
201
|
-
invertMapTransformKeys,
|
|
202
|
-
mapTransformKeys,
|
|
203
|
-
mergeTransform,
|
|
204
188
|
stylePropsAll,
|
|
205
189
|
stylePropsText,
|
|
206
190
|
stylePropsTextOnly,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/validStyleProps.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// flat transform props\nexport const stylePropsTransform = Object.freeze({\n x: true,\n y: true,\n scale: true,\n perspective: true,\n scaleX: true,\n scaleY: true,\n skewX: true,\n skewY: true,\n matrix: true,\n rotate: true,\n rotateY: true,\n rotateX: true,\n rotateZ: true,\n})\n\nexport const stylePropsView = Object.freeze({\n backfaceVisibility: true,\n backgroundColor: true,\n borderBottomColor: true,\n 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 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 }),\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"],
|
|
5
|
+
"mappings": "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",
|
|
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,eAAe,OAAe,CAAC,KAAK,MAAgC;AACzE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
4
|
-
return
|
|
2
|
+
return function composedEventHandler(event) {
|
|
5
3
|
og == null ? void 0 : og(event);
|
|
6
4
|
if (!checkDefaultPrevented || !event.defaultPrevented) {
|
|
7
5
|
return next == null ? void 0 : next(event);
|
|
8
6
|
}
|
|
9
|
-
}
|
|
7
|
+
};
|
|
10
8
|
}
|
|
11
|
-
__name(composeEventHandlers, "composeEventHandlers");
|
|
12
9
|
export {
|
|
13
10
|
composeEventHandlers
|
|
14
11
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/composeEventHandlers.ts"],
|
|
4
4
|
"sourcesContent": ["import { FocusEvent } from 'react'\nimport { GestureResponderEvent } from 'react-native'\n\nexport type EventHandler<E extends Event | GestureResponderEvent | FocusEvent> = (event: E) => void\n\nexport function composeEventHandlers<E extends Event | GestureResponderEvent | FocusEvent>(\n og?: EventHandler<E>,\n next?: EventHandler<E>,\n { checkDefaultPrevented = true } = {}\n) {\n return function composedEventHandler(event: E) {\n og?.(event)\n if (!checkDefaultPrevented || !event.defaultPrevented) {\n return next?.(event)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAKO,8BACL,IACA,MACA,EAAE,wBAAwB,SAAS,CAAC,GACpC;AACA,SAAO,8BAA8B,OAAU;AAC7C,6BAAK;AACL,QAAI,CAAC,yBAAyB,CAAC,MAAM,kBAAkB;AACrD,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
function concatClassName(_cn) {
|
|
4
2
|
const cnOrPropObjcet = arguments;
|
|
5
3
|
const usedPrefixes = [];
|
|
@@ -57,7 +55,6 @@ function concatClassName(_cn) {
|
|
|
57
55
|
}
|
|
58
56
|
return final;
|
|
59
57
|
}
|
|
60
|
-
__name(concatClassName, "concatClassName");
|
|
61
58
|
const pseudoInvert = {
|
|
62
59
|
hover: "hoverStyle",
|
|
63
60
|
focus: "focusStyle",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/concatClassName.ts"],
|
|
4
|
-
"sourcesContent": ["// perf sensitive so doing some weird stuff\n\nimport { ViewStyle } from 'react-native'\n\nexport function concatClassName(...args: any[]): any\nexport function concatClassName(_cn: ViewStyle | null | undefined): string {\n const cnOrPropObjcet = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = cnOrPropObjcet.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = cnOrPropObjcet[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n // commenting out three things to make pseudos override properly\n // (leave in for a bit to see if other bugs pop up later):\n // 1. const
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// perf sensitive so doing some weird stuff\n\nimport { ViewStyle } from 'react-native'\n\nexport function concatClassName(...args: any[]): any\nexport function concatClassName(_cn: ViewStyle | null | undefined): string {\n const cnOrPropObjcet = arguments\n const usedPrefixes: string[] = []\n let final = ''\n\n const len = cnOrPropObjcet.length\n let propObjects: any = null\n for (let x = len; x >= 0; x--) {\n const cns = cnOrPropObjcet[x]\n\n if (!cns) continue\n if (!Array.isArray(cns) && typeof cns !== 'string') {\n // is prop object\n propObjects = propObjects || []\n propObjects.push(cns)\n continue\n }\n\n const names = Array.isArray(cns) ? cns : cns.split(' ')\n const numNames = names.length\n for (let i = numNames - 1; i >= 0; i--) {\n const name = names[i]\n\n if (!name || name === ' ') continue\n if (name[0] !== '_') {\n // not snack style (todo slightly stronger heuristic)\n final = name + ' ' + final\n continue\n }\n\n const splitIndex = name.indexOf('-')\n if (splitIndex < 1) {\n final = name + ' ' + final\n // if (shouldDebug) console.log('debug exclude:', name, final)\n continue\n }\n\n const nextChar = name[splitIndex + 1]\n // synced to static-ui constants\n // MEDIA_SEP\n const isMediaQuery = nextChar === '_'\n // PSEUDO_SEP\n // commenting out three things to make pseudos override properly\n // (leave in for a bit to see if other bugs pop up later):\n // 1. const 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": "AAKO,yBAAyB,KAA2C;AACzE,QAAM,iBAAiB;AACvB,QAAM,eAAyB,CAAC;AAChC,MAAI,QAAQ;AAEZ,QAAM,MAAM,eAAe;AAC3B,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,eAAe;AAE3B,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe,CAAC;AAC9B,kBAAY,KAAK,GAAG;AACpB;AAAA,IACF;AAEA,UAAM,QAAQ,MAAM,QAAQ,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG;AACtD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM;AAEnB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,OAAO,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA,MACF;AAEA,YAAM,aAAa,KAAK,QAAQ,GAAG;AACnC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AAErB;AAAA,MACF;AAEA,YAAM,WAAW,KAAK,aAAa;AAGnC,YAAM,eAAe,aAAa;AAKlC,YAAM,WAAW,KAAK,MAAM,GAAG,KAAK,YAAY,GAAG,CAAC;AAEpD,YAAM,WAAW,eAAe,KAAK,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI;AAC7E,YAAM,MAAM,WAAW,WAAW,WAAW;AAG7C,UAAI,aAAa,QAAQ,GAAG,IAAI,IAAI;AAElC;AAAA,MACF;AACA,mBAAa,KAAK,GAAG;AAGrB,YAAM,WAAW;AACjB,UAAI,YAAY,aAAa;AAC3B,YACE,YAAY,KAAK,CAAC,OAAO;AACvB,cAAI,UAAU;AACZ,kBAAM,UAAU,aAAa;AAC7B,mBAAO,MAAM,GAAG,YAAY,YAAY,GAAG,YAAY,GAAG,aAAa;AAAA,UACzE;AACA,gBAAM,MAAM,MAAM,YAAY,MAAM,GAAG,cAAc;AACrD,iBAAO;AAAA,QACT,CAAC,GACD;AAEA;AAAA,QACF;AAAA,MACF;AAEA,cAAQ,OAAO,MAAM;AAAA,IACvB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './composeEventHandlers'\nexport * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\n"],
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AACA;AACA;",
|
|
4
|
+
"sourcesContent": ["export * from './clamp'\nexport * from './composeEventHandlers'\nexport * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\nexport * from './simpleHash'\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/log.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const log = /* @__PURE__ */ __name((...args) => {
|
|
1
|
+
const log = (...args) => {
|
|
4
2
|
console.log(...args);
|
|
5
3
|
return args[0];
|
|
6
|
-
}
|
|
4
|
+
};
|
|
7
5
|
export {
|
|
8
6
|
log
|
|
9
7
|
};
|
package/dist/esm/log.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/log.ts"],
|
|
4
4
|
"sourcesContent": ["export const log = (...args: any) => {\n console.log(...args)\n return args[0]\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAO,MAAM,MAAM,IAAI,SAAc;AACnC,UAAQ,IAAI,GAAG,IAAI;AACnB,SAAO,KAAK;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/simpleHash.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const simpleHash = /* @__PURE__ */ __name((str) => {
|
|
1
|
+
const simpleHash = (str) => {
|
|
4
2
|
let hash = 0;
|
|
5
3
|
for (let i = 0; i < str.length; i++) {
|
|
6
4
|
const char = str.charCodeAt(i);
|
|
@@ -8,7 +6,7 @@ const simpleHash = /* @__PURE__ */ __name((str) => {
|
|
|
8
6
|
hash &= hash;
|
|
9
7
|
}
|
|
10
8
|
return new Uint32Array([hash])[0].toString(36);
|
|
11
|
-
}
|
|
9
|
+
};
|
|
12
10
|
export {
|
|
13
11
|
simpleHash
|
|
14
12
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/simpleHash.ts"],
|
|
4
4
|
"sourcesContent": ["export const simpleHash = (str: string) => {\n let hash = 0\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return new Uint32Array([hash])[0].toString(36)\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "AAAO,MAAM,aAAa,CAAC,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;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
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
|
+
};
|
|
3
17
|
const stylePropsTransform = Object.freeze({
|
|
4
18
|
x: true,
|
|
5
19
|
y: true,
|
|
@@ -15,7 +29,7 @@ const stylePropsTransform = Object.freeze({
|
|
|
15
29
|
rotateX: true,
|
|
16
30
|
rotateZ: true
|
|
17
31
|
});
|
|
18
|
-
const stylePropsView = Object.freeze({
|
|
32
|
+
const stylePropsView = Object.freeze(__spreadValues(__spreadValues({
|
|
19
33
|
backfaceVisibility: true,
|
|
20
34
|
backgroundColor: true,
|
|
21
35
|
borderBottomColor: true,
|
|
@@ -97,20 +111,18 @@ const stylePropsView = Object.freeze({
|
|
|
97
111
|
shadowColor: true,
|
|
98
112
|
shadowOffset: true,
|
|
99
113
|
shadowOpacity: true,
|
|
100
|
-
shadowRadius: true
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
});
|
|
113
|
-
const stylePropsTextOnly = Object.freeze({
|
|
114
|
+
shadowRadius: true
|
|
115
|
+
}, stylePropsTransform), process.env.TAMAGUI_TARGET === "web" && {
|
|
116
|
+
overflowX: true,
|
|
117
|
+
overflowY: true,
|
|
118
|
+
userSelect: true,
|
|
119
|
+
cursor: true,
|
|
120
|
+
contain: true,
|
|
121
|
+
pointerEvents: true,
|
|
122
|
+
boxSizing: true,
|
|
123
|
+
boxShadow: true
|
|
124
|
+
}));
|
|
125
|
+
const stylePropsTextOnly = Object.freeze(__spreadValues({
|
|
114
126
|
color: true,
|
|
115
127
|
fontFamily: true,
|
|
116
128
|
fontSize: true,
|
|
@@ -125,18 +137,17 @@ const stylePropsTextOnly = Object.freeze({
|
|
|
125
137
|
textShadowColor: true,
|
|
126
138
|
textShadowOffset: true,
|
|
127
139
|
textShadowRadius: true,
|
|
128
|
-
textTransform: true
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
+
textTransform: true
|
|
141
|
+
}, process.env.TAMAGUI_TARGET === "web" && {
|
|
142
|
+
whiteSpace: true,
|
|
143
|
+
wordWrap: true,
|
|
144
|
+
textOverflow: true,
|
|
145
|
+
textDecorationDistance: true,
|
|
146
|
+
userSelect: true,
|
|
147
|
+
selectable: true,
|
|
148
|
+
cursor: true
|
|
149
|
+
}));
|
|
150
|
+
const stylePropsText = Object.freeze(__spreadValues(__spreadValues({}, stylePropsView), stylePropsTextOnly));
|
|
140
151
|
const stylePropsAll = stylePropsText;
|
|
141
152
|
const validPseudoKeys = Object.freeze({
|
|
142
153
|
enterStyle: true,
|
|
@@ -145,26 +156,8 @@ const validPseudoKeys = Object.freeze({
|
|
|
145
156
|
pressStyle: true,
|
|
146
157
|
focusStyle: true
|
|
147
158
|
});
|
|
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");
|
|
159
|
+
const validStyles = Object.freeze(__spreadValues(__spreadValues({}, validPseudoKeys), stylePropsView));
|
|
164
160
|
export {
|
|
165
|
-
invertMapTransformKeys,
|
|
166
|
-
mapTransformKeys,
|
|
167
|
-
mergeTransform,
|
|
168
161
|
stylePropsAll,
|
|
169
162
|
stylePropsText,
|
|
170
163
|
stylePropsTextOnly,
|