@zag-js/popover 0.0.0-dev-20220627111117 → 0.0.0-dev-20220628115342
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/index.js +6 -16
- package/dist/index.mjs +6 -16
- package/dist/popover.connect.d.ts +2 -2
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -138,16 +138,16 @@ function preventBodyPointerEvents(el, opts = {}) {
|
|
|
138
138
|
cleanups.forEach((cleanup) => cleanup == null ? void 0 : cleanup());
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
;
|
|
143
|
-
|
|
144
|
-
return
|
|
141
|
+
function getCache() {
|
|
142
|
+
const g = globalThis;
|
|
143
|
+
g.__styleCache__ = g.__styleCache__ || /* @__PURE__ */ new WeakMap();
|
|
144
|
+
return g.__styleCache__;
|
|
145
145
|
}
|
|
146
146
|
function getComputedStyle(el) {
|
|
147
147
|
var _a;
|
|
148
148
|
if (!el)
|
|
149
149
|
return {};
|
|
150
|
-
const cache =
|
|
150
|
+
const cache = getCache();
|
|
151
151
|
let style = cache.get(el);
|
|
152
152
|
if (!style) {
|
|
153
153
|
const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
|
|
@@ -240,16 +240,6 @@ function trackPointerDown(doc, onPointerDown) {
|
|
|
240
240
|
// src/popover.connect.ts
|
|
241
241
|
var import_popper = require("@zag-js/popper");
|
|
242
242
|
|
|
243
|
-
// ../../types/dist/index.mjs
|
|
244
|
-
function createNormalizer(fn) {
|
|
245
|
-
return new Proxy({}, {
|
|
246
|
-
get() {
|
|
247
|
-
return fn;
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
var normalizeProp = createNormalizer((v) => v);
|
|
252
|
-
|
|
253
243
|
// ../../utilities/core/dist/index.mjs
|
|
254
244
|
var first = (v) => v[0];
|
|
255
245
|
var last = (v) => v[v.length - 1];
|
|
@@ -335,7 +325,7 @@ var dom = {
|
|
|
335
325
|
};
|
|
336
326
|
|
|
337
327
|
// src/popover.connect.ts
|
|
338
|
-
function connect(state, send, normalize
|
|
328
|
+
function connect(state, send, normalize) {
|
|
339
329
|
const isOpen = state.matches("open");
|
|
340
330
|
const pointerdownNode = state.context.pointerdownNode;
|
|
341
331
|
const currentPlacement = state.context.currentPlacement;
|
package/dist/index.mjs
CHANGED
|
@@ -115,16 +115,16 @@ function preventBodyPointerEvents(el, opts = {}) {
|
|
|
115
115
|
cleanups.forEach((cleanup) => cleanup == null ? void 0 : cleanup());
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
;
|
|
120
|
-
|
|
121
|
-
return
|
|
118
|
+
function getCache() {
|
|
119
|
+
const g = globalThis;
|
|
120
|
+
g.__styleCache__ = g.__styleCache__ || /* @__PURE__ */ new WeakMap();
|
|
121
|
+
return g.__styleCache__;
|
|
122
122
|
}
|
|
123
123
|
function getComputedStyle(el) {
|
|
124
124
|
var _a;
|
|
125
125
|
if (!el)
|
|
126
126
|
return {};
|
|
127
|
-
const cache =
|
|
127
|
+
const cache = getCache();
|
|
128
128
|
let style = cache.get(el);
|
|
129
129
|
if (!style) {
|
|
130
130
|
const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
|
|
@@ -217,16 +217,6 @@ function trackPointerDown(doc, onPointerDown) {
|
|
|
217
217
|
// src/popover.connect.ts
|
|
218
218
|
import { getPlacementStyles } from "@zag-js/popper";
|
|
219
219
|
|
|
220
|
-
// ../../types/dist/index.mjs
|
|
221
|
-
function createNormalizer(fn) {
|
|
222
|
-
return new Proxy({}, {
|
|
223
|
-
get() {
|
|
224
|
-
return fn;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
var normalizeProp = createNormalizer((v) => v);
|
|
229
|
-
|
|
230
220
|
// ../../utilities/core/dist/index.mjs
|
|
231
221
|
var first = (v) => v[0];
|
|
232
222
|
var last = (v) => v[v.length - 1];
|
|
@@ -312,7 +302,7 @@ var dom = {
|
|
|
312
302
|
};
|
|
313
303
|
|
|
314
304
|
// src/popover.connect.ts
|
|
315
|
-
function connect(state, send, normalize
|
|
305
|
+
function connect(state, send, normalize) {
|
|
316
306
|
const isOpen = state.matches("open");
|
|
317
307
|
const pointerdownNode = state.context.pointerdownNode;
|
|
318
308
|
const currentPlacement = state.context.currentPlacement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
2
2
|
import type { Send, State } from "./popover.types";
|
|
3
|
-
export declare function connect<T extends PropTypes
|
|
3
|
+
export declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
|
|
4
4
|
portalled: boolean;
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
open(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/popover",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20220628115342",
|
|
4
4
|
"description": "Core logic for the popover widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@zag-js/aria-hidden": "0.1.0",
|
|
33
|
-
"@zag-js/core": "0.0.0-dev-
|
|
34
|
-
"@zag-js/dom-utils": "0.0.0-dev-
|
|
35
|
-
"@zag-js/popper": "0.0.0-dev-
|
|
33
|
+
"@zag-js/core": "0.0.0-dev-20220628115342",
|
|
34
|
+
"@zag-js/dom-utils": "0.0.0-dev-20220628115342",
|
|
35
|
+
"@zag-js/popper": "0.0.0-dev-20220628115342",
|
|
36
36
|
"@zag-js/remove-scroll": "0.1.0",
|
|
37
|
-
"@zag-js/types": "0.
|
|
37
|
+
"@zag-js/types": "0.0.0-dev-20220628115342",
|
|
38
38
|
"@zag-js/utils": "0.1.2",
|
|
39
39
|
"focus-trap": "6.7.1"
|
|
40
40
|
},
|