@tamagui/helpers 1.0.0-beta.0.210 → 1.0.0-beta.10
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 +32 -0
- package/dist/cjs/clamp.js.map +7 -0
- package/dist/cjs/composeEventHandlers.js +37 -0
- package/dist/cjs/composeEventHandlers.js.map +7 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/clamp.js +10 -0
- package/dist/esm/clamp.js.map +7 -0
- package/dist/esm/composeEventHandlers.js +15 -0
- package/dist/esm/composeEventHandlers.js.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/jsx/clamp.js +9 -0
- package/dist/jsx/composeEventHandlers.js +14 -0
- package/dist/jsx/index.js +1 -0
- package/package.json +3 -3
- package/types/clamp.d.ts.map +1 -0
- package/types/composeEventHandlers.d.ts +7 -0
- package/types/composeEventHandlers.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/LICENSE +0 -21
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var clamp_exports = {};
|
|
20
|
+
__export(clamp_exports, {
|
|
21
|
+
clamp: () => clamp
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(clamp_exports);
|
|
24
|
+
function clamp(value, [min, max]) {
|
|
25
|
+
return Math.min(max, Math.max(min, value));
|
|
26
|
+
}
|
|
27
|
+
__name(clamp, "clamp");
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
clamp
|
|
31
|
+
});
|
|
32
|
+
//# 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;AAFgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var composeEventHandlers_exports = {};
|
|
20
|
+
__export(composeEventHandlers_exports, {
|
|
21
|
+
composeEventHandlers: () => composeEventHandlers
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(composeEventHandlers_exports);
|
|
24
|
+
function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
25
|
+
return /* @__PURE__ */ __name(function composedEventHandler(event) {
|
|
26
|
+
og == null ? void 0 : og(event);
|
|
27
|
+
if (!checkDefaultPrevented || !event.defaultPrevented) {
|
|
28
|
+
return next == null ? void 0 : next(event);
|
|
29
|
+
}
|
|
30
|
+
}, "composedEventHandler");
|
|
31
|
+
}
|
|
32
|
+
__name(composeEventHandlers, "composeEventHandlers");
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
composeEventHandlers
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=composeEventHandlers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/composeEventHandlers.ts"],
|
|
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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,8BACL,IACA,MACA,EAAE,wBAAwB,SAAS,CAAC,GACpC;AACA,SAAO,qDAA8B,OAAU;AAC7C,6BAAK;AACL,QAAI,CAAC,yBAAyB,CAAC,MAAM,kBAAkB;AACrD,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF,GALO;AAMT;AAXgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,6 +14,7 @@ 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("./composeEventHandlers"), module.exports);
|
|
17
18
|
__reExport(src_exports, require("./concatClassName"), module.exports);
|
|
18
19
|
__reExport(src_exports, require("./validStyleProps"), module.exports);
|
|
19
20
|
__reExport(src_exports, require("./types"), module.exports);
|
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 './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,
|
|
4
|
+
"sourcesContent": ["export * from './composeEventHandlers'\nexport * from './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,mCAAd;AACA,wBAAc,8BADd;AAEA,wBAAc,8BAFd;AAGA,wBAAc,oBAHd;AAIA,wBAAc,kBAJd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function clamp(value, [min, max]) {
|
|
4
|
+
return Math.min(max, Math.max(min, value));
|
|
5
|
+
}
|
|
6
|
+
__name(clamp, "clamp");
|
|
7
|
+
export {
|
|
8
|
+
clamp
|
|
9
|
+
};
|
|
10
|
+
//# 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": ";;AAAO,eAAe,OAAe,CAAC,KAAK,MAAgC;AACzE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;AAFgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
4
|
+
return /* @__PURE__ */ __name(function composedEventHandler(event) {
|
|
5
|
+
og == null ? void 0 : og(event);
|
|
6
|
+
if (!checkDefaultPrevented || !event.defaultPrevented) {
|
|
7
|
+
return next == null ? void 0 : next(event);
|
|
8
|
+
}
|
|
9
|
+
}, "composedEventHandler");
|
|
10
|
+
}
|
|
11
|
+
__name(composeEventHandlers, "composeEventHandlers");
|
|
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": ["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": ";;AAKO,8BACL,IACA,MACA,EAAE,wBAAwB,SAAS,CAAC,GACpC;AACA,SAAO,qDAA8B,OAAU;AAC7C,6BAAK;AACL,QAAI,CAAC,yBAAyB,CAAC,MAAM,kBAAkB;AACrD,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF,GALO;AAMT;AAXgB;",
|
|
6
|
+
"names": []
|
|
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 './concatClassName'\nexport * from './validStyleProps'\nexport * from './types'\nexport * from './log'\n"],
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AACA;",
|
|
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;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function clamp(value, [min, max]) {
|
|
4
|
+
return Math.min(max, Math.max(min, value));
|
|
5
|
+
}
|
|
6
|
+
__name(clamp, "clamp");
|
|
7
|
+
export {
|
|
8
|
+
clamp
|
|
9
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
|
|
4
|
+
return /* @__PURE__ */ __name(function composedEventHandler(event) {
|
|
5
|
+
og == null ? void 0 : og(event);
|
|
6
|
+
if (!checkDefaultPrevented || !event.defaultPrevented) {
|
|
7
|
+
return next == null ? void 0 : next(event);
|
|
8
|
+
}
|
|
9
|
+
}, "composedEventHandler");
|
|
10
|
+
}
|
|
11
|
+
__name(composeEventHandlers, "composeEventHandlers");
|
|
12
|
+
export {
|
|
13
|
+
composeEventHandlers
|
|
14
|
+
};
|
package/dist/jsx/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "types",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"clean:build": "tamagui-build clean:build"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@tamagui/build": "^1.0.0-beta.
|
|
20
|
+
"@tamagui/build": "^1.0.0-beta.10",
|
|
21
21
|
"react-native": "*"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
|
|
30
30
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../src/clamp.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAEzE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FocusEvent } from 'react';
|
|
2
|
+
import { GestureResponderEvent } from 'react-native';
|
|
3
|
+
export declare type EventHandler<E extends Event | GestureResponderEvent | FocusEvent> = (event: E) => void;
|
|
4
|
+
export declare function composeEventHandlers<E extends Event | GestureResponderEvent | FocusEvent>(og?: EventHandler<E>, next?: EventHandler<E>, { checkDefaultPrevented }?: {
|
|
5
|
+
checkDefaultPrevented?: boolean | undefined;
|
|
6
|
+
}): (event: E) => void;
|
|
7
|
+
//# sourceMappingURL=composeEventHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composeEventHandlers.d.ts","sourceRoot":"","sources":["../src/composeEventHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEpD,oBAAY,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,qBAAqB,GAAG,UAAU,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;AAEnG,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,KAAK,GAAG,qBAAqB,GAAG,UAAU,EACvF,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EACpB,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EACtB,EAAE,qBAA4B,EAAE;;CAAK,WAEO,CAAC,UAM9C"}
|
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -1 +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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Nate Wienert
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|