@tamagui/helpers 1.0.1-beta.71 → 1.0.1-beta.74
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 +0 -2
- package/dist/cjs/clamp.js.map +1 -1
- 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 +1 -1
- 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/esm/clamp.js +0 -3
- package/dist/esm/clamp.js.map +1 -1
- 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 +1 -1
- 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/jsx/clamp.js +0 -3
- package/dist/jsx/composeEventHandlers.js +2 -5
- package/dist/jsx/concatClassName.js +0 -3
- package/dist/jsx/log.js +2 -4
- package/dist/jsx/simpleHash.js +2 -4
- package/package.json +2 -2
package/dist/cjs/clamp.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 });
|
|
@@ -24,7 +23,6 @@ module.exports = __toCommonJS(clamp_exports);
|
|
|
24
23
|
function clamp(value, [min, max]) {
|
|
25
24
|
return Math.min(max, Math.max(min, value));
|
|
26
25
|
}
|
|
27
|
-
__name(clamp, "clamp");
|
|
28
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
27
|
0 && (module.exports = {
|
|
30
28
|
clamp
|
package/dist/cjs/clamp.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/clamp.ts"],
|
|
4
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": "
|
|
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
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 });
|
|
@@ -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",
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/concatClassName.ts"],
|
|
4
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": "
|
|
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/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/esm/clamp.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
function clamp(value, [min, max]) {
|
|
4
2
|
return Math.min(max, Math.max(min, value));
|
|
5
3
|
}
|
|
6
|
-
__name(clamp, "clamp");
|
|
7
4
|
export {
|
|
8
5
|
clamp
|
|
9
6
|
};
|
package/dist/esm/clamp.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/clamp.ts"],
|
|
4
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": "
|
|
5
|
+
"mappings": "AAAO,eAAe,OAAe,CAAC,KAAK,MAAgC;AACzE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;",
|
|
6
6
|
"names": []
|
|
7
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",
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/concatClassName.ts"],
|
|
4
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": "
|
|
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/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
|
}
|
package/dist/jsx/clamp.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
function clamp(value, [min, max]) {
|
|
4
2
|
return Math.min(max, Math.max(min, value));
|
|
5
3
|
}
|
|
6
|
-
__name(clamp, "clamp");
|
|
7
4
|
export {
|
|
8
5
|
clamp
|
|
9
6
|
};
|
|
@@ -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
|
};
|
|
@@ -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",
|
package/dist/jsx/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/jsx/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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.74",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
21
|
+
"@tamagui/build": "^1.0.1-beta.74",
|
|
22
22
|
"react": "*",
|
|
23
23
|
"react-native": "*"
|
|
24
24
|
},
|