@zag-js/interact-outside
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,2 +0,2 @@ | ||
export declare type InteractOutsideHandlers = { | ||
declare type InteractOutsideHandlers = { | ||
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void; | ||
@@ -6,3 +6,3 @@ onFocusOutside?: (event: FocusOutsideEvent) => void; | ||
}; | ||
export declare type InteractOutsideOptions = InteractOutsideHandlers & { | ||
declare type InteractOutsideOptions = InteractOutsideHandlers & { | ||
exclude?: (target: HTMLElement) => boolean; | ||
@@ -15,6 +15,7 @@ }; | ||
}; | ||
export declare type PointerDownOutsideEvent = CustomEvent<EventDetails<PointerEvent>>; | ||
export declare type FocusOutsideEvent = CustomEvent<EventDetails<FocusEvent>>; | ||
export declare type InteractOutsideEvent = PointerDownOutsideEvent | FocusOutsideEvent; | ||
export declare function trackInteractOutside(node: HTMLElement | null, options: InteractOutsideOptions): () => void; | ||
export {}; | ||
declare type PointerDownOutsideEvent = CustomEvent<EventDetails<PointerEvent>>; | ||
declare type FocusOutsideEvent = CustomEvent<EventDetails<FocusEvent>>; | ||
declare type InteractOutsideEvent = PointerDownOutsideEvent | FocusOutsideEvent; | ||
declare function trackInteractOutside(node: HTMLElement | null, options: InteractOutsideOptions): (() => void) | undefined; | ||
export { FocusOutsideEvent, InteractOutsideEvent, InteractOutsideHandlers, InteractOutsideOptions, PointerDownOutsideEvent, trackInteractOutside }; |
@@ -30,3 +30,3 @@ "use strict"; | ||
const res = typeof v === "function" ? v(...a) : v; | ||
return res != null ? res : void 0; | ||
return res ?? void 0; | ||
}; | ||
@@ -36,5 +36,4 @@ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
function getPlatform() { | ||
var _a; | ||
const agent = navigator.userAgentData; | ||
return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform; | ||
return (agent == null ? void 0 : agent.platform) ?? navigator.platform; | ||
} | ||
@@ -51,3 +50,2 @@ var pt = (v) => isDom() && v.test(getPlatform()); | ||
function getDocument(el) { | ||
var _a; | ||
if (isWindow(el)) | ||
@@ -57,11 +55,10 @@ return el.document; | ||
return el; | ||
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document; | ||
return (el == null ? void 0 : el.ownerDocument) ?? document; | ||
} | ||
function getWindow(el) { | ||
var _a; | ||
return (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window; | ||
return (el == null ? void 0 : el.ownerDocument.defaultView) ?? window; | ||
} | ||
function getEventTarget(event) { | ||
var _a, _b; | ||
return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target; | ||
var _a; | ||
return ((_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) ?? event.target; | ||
} | ||
@@ -192,1 +189,5 @@ function contains(parent, child) { | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
trackInteractOutside | ||
}); |
{ | ||
"name": "@zag-js/interact-outside", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Track interations or focus outside an element", | ||
@@ -21,14 +21,6 @@ "keywords": [ | ||
], | ||
"scripts": { | ||
"build:fast": "yarn zag build", | ||
"start": "yarn zag build --watch", | ||
"build": "yarn zag build --prod", | ||
"test": "jest --config ../../../jest.config.js --rootDir tests", | ||
"lint": "eslint src --ext .ts,.tsx", | ||
"test:ci": "yarn test --ci --runInBand --updateSnapshot", | ||
"test:watch": "yarn test --watchAll" | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.1.8", | ||
"@zag-js/utils": "0.1.3" | ||
}, | ||
"dependencies": { | ||
"@zag-js/dom-utils": "0.1.7" | ||
}, | ||
"publishConfig": { | ||
@@ -39,3 +31,12 @@ "access": "public" | ||
"url": "https://github.com/chakra-ui/zag/issues" | ||
}, | ||
"scripts": { | ||
"build-fast": "tsup src/index.ts --format=esm,cjs", | ||
"start": "pnpm build --watch", | ||
"build": "tsup src/index.ts --format=esm,cjs --dts", | ||
"test": "jest --config ../../../jest.config.js --rootDir tests", | ||
"lint": "eslint src --ext .ts,.tsx", | ||
"test-ci": "pnpm test --ci --runInBand -u", | ||
"test-watch": "pnpm test --watchAll" | ||
} | ||
} | ||
} |
@@ -15,9 +15,6 @@ # @zag-js/interact-outside | ||
Yes please! See the | ||
[contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) | ||
for details. | ||
Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details. | ||
## Licence | ||
This project is licensed under the terms of the | ||
[MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE). | ||
This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15559
0
6
2
363
20
- Removed@zag-js/dom-utils@0.1.7
- Removed@zag-js/dom-utils@0.1.7(transitive)
- Removed@zag-js/types@0.2.2(transitive)
- Removed@zag-js/utils@0.1.2(transitive)
- Removedcsstype@3.1.0(transitive)