@zag-js/dismissable
Advanced tools
Comparing version 0.0.0-dev-20220714012600 to 0.0.0-dev-20220714091855
@@ -1,1 +0,15 @@ | ||
export * from "./dismissable-layer"; | ||
import { InteractOutsideHandlers } from '@zag-js/interact-outside'; | ||
declare type Container = HTMLElement | null | Array<HTMLElement | null>; | ||
declare type DismissableElementHandlers = InteractOutsideHandlers & { | ||
onEscapeKeyDown?: (event: KeyboardEvent) => void; | ||
}; | ||
declare type DismissableElementOptions = DismissableElementHandlers & { | ||
debug?: boolean; | ||
pointerBlocking?: boolean; | ||
onDismiss: () => void; | ||
exclude?: Container | (() => Container); | ||
}; | ||
declare function trackDismissableElement(node: HTMLElement | null, options: DismissableElementOptions): (() => void) | undefined; | ||
export { DismissableElementHandlers, DismissableElementOptions, trackDismissableElement }; |
@@ -30,3 +30,3 @@ "use strict"; | ||
const res = typeof v === "function" ? v(...a) : v; | ||
return res != null ? res : void 0; | ||
return res ?? void 0; | ||
}; | ||
@@ -41,3 +41,2 @@ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
function getDocument(el) { | ||
var _a; | ||
if (isWindow(el)) | ||
@@ -47,7 +46,7 @@ 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 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; | ||
} | ||
@@ -78,3 +77,3 @@ function contains(parent, child) { | ||
const c = a.length === 2 ? a[0] : true; | ||
if (c && void 0 !== "production") { | ||
if (c && process.env.NODE_ENV !== "production") { | ||
console.warn(m); | ||
@@ -256,1 +255,5 @@ } | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
trackDismissableElement | ||
}); |
{ | ||
"name": "@zag-js/dismissable", | ||
"version": "0.0.0-dev-20220714012600", | ||
"version": "0.0.0-dev-20220714091855", | ||
"description": "Dismissable layer utilities for the DOM", | ||
@@ -25,11 +25,2 @@ "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" | ||
}, | ||
"publishConfig": { | ||
@@ -39,10 +30,20 @@ "access": "public" | ||
"dependencies": { | ||
"@zag-js/interact-outside": "0.0.0-dev-20220714012600" | ||
"@zag-js/interact-outside": "0.0.0-dev-20220714091855" | ||
}, | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.0.0-dev-20220714012600" | ||
"@zag-js/dom-utils": "0.0.0-dev-20220714091855", | ||
"@zag-js/utils": "0.0.0-dev-20220714091855" | ||
}, | ||
"bugs": { | ||
"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" | ||
} | ||
} | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
19610
2
6
482
3
+ Added@zag-js/interact-outside@0.0.0-dev-20220714091855(transitive)
- Removed@zag-js/dom-utils@0.0.0-dev-20220714012600(transitive)
- Removed@zag-js/interact-outside@0.0.0-dev-20220714012600(transitive)
- Removed@zag-js/types@0.0.0-dev-20220714012600(transitive)
- Removed@zag-js/utils@0.1.2(transitive)
- Removedcsstype@3.1.0(transitive)