@zag-js/tooltip 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/tooltip.connect.d.ts +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -128,16 +128,16 @@ function raf(fn) {
|
|
|
128
128
|
globalThis.cancelAnimationFrame(id);
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
;
|
|
133
|
-
|
|
134
|
-
return
|
|
131
|
+
function getCache() {
|
|
132
|
+
const g = globalThis;
|
|
133
|
+
g.__styleCache__ = g.__styleCache__ || /* @__PURE__ */ new WeakMap();
|
|
134
|
+
return g.__styleCache__;
|
|
135
135
|
}
|
|
136
136
|
function getComputedStyle(el) {
|
|
137
137
|
var _a;
|
|
138
138
|
if (!el)
|
|
139
139
|
return {};
|
|
140
|
-
const cache =
|
|
140
|
+
const cache = getCache();
|
|
141
141
|
let style = cache.get(el);
|
|
142
142
|
if (!style) {
|
|
143
143
|
const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
|
|
@@ -213,16 +213,6 @@ function getScrollParents(el, list = []) {
|
|
|
213
213
|
// src/tooltip.connect.ts
|
|
214
214
|
var import_popper = require("@zag-js/popper");
|
|
215
215
|
|
|
216
|
-
// ../../types/dist/index.mjs
|
|
217
|
-
function createNormalizer(fn) {
|
|
218
|
-
return new Proxy({}, {
|
|
219
|
-
get() {
|
|
220
|
-
return fn;
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
var normalizeProp = createNormalizer((v) => v);
|
|
225
|
-
|
|
226
216
|
// src/tooltip.dom.ts
|
|
227
217
|
var dom = {
|
|
228
218
|
getDoc: (ctx) => {
|
|
@@ -273,7 +263,7 @@ var store = (0, import_core.proxy)({
|
|
|
273
263
|
});
|
|
274
264
|
|
|
275
265
|
// src/tooltip.connect.ts
|
|
276
|
-
function connect(state, send, normalize
|
|
266
|
+
function connect(state, send, normalize) {
|
|
277
267
|
const id = state.context.id;
|
|
278
268
|
const hasAriaLabel = state.context.hasAriaLabel;
|
|
279
269
|
const isOpen = state.hasTag("open");
|
package/dist/index.mjs
CHANGED
|
@@ -105,16 +105,16 @@ function raf(fn) {
|
|
|
105
105
|
globalThis.cancelAnimationFrame(id);
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
;
|
|
110
|
-
|
|
111
|
-
return
|
|
108
|
+
function getCache() {
|
|
109
|
+
const g = globalThis;
|
|
110
|
+
g.__styleCache__ = g.__styleCache__ || /* @__PURE__ */ new WeakMap();
|
|
111
|
+
return g.__styleCache__;
|
|
112
112
|
}
|
|
113
113
|
function getComputedStyle(el) {
|
|
114
114
|
var _a;
|
|
115
115
|
if (!el)
|
|
116
116
|
return {};
|
|
117
|
-
const cache =
|
|
117
|
+
const cache = getCache();
|
|
118
118
|
let style = cache.get(el);
|
|
119
119
|
if (!style) {
|
|
120
120
|
const win = (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
|
|
@@ -190,16 +190,6 @@ function getScrollParents(el, list = []) {
|
|
|
190
190
|
// src/tooltip.connect.ts
|
|
191
191
|
import { getPlacementStyles } from "@zag-js/popper";
|
|
192
192
|
|
|
193
|
-
// ../../types/dist/index.mjs
|
|
194
|
-
function createNormalizer(fn) {
|
|
195
|
-
return new Proxy({}, {
|
|
196
|
-
get() {
|
|
197
|
-
return fn;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
var normalizeProp = createNormalizer((v) => v);
|
|
202
|
-
|
|
203
193
|
// src/tooltip.dom.ts
|
|
204
194
|
var dom = {
|
|
205
195
|
getDoc: (ctx) => {
|
|
@@ -250,7 +240,7 @@ var store = proxy({
|
|
|
250
240
|
});
|
|
251
241
|
|
|
252
242
|
// src/tooltip.connect.ts
|
|
253
|
-
function connect(state, send, normalize
|
|
243
|
+
function connect(state, send, normalize) {
|
|
254
244
|
const id = state.context.id;
|
|
255
245
|
const hasAriaLabel = state.context.hasAriaLabel;
|
|
256
246
|
const isOpen = state.hasTag("open");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Send, State } from "./tooltip.types";
|
|
3
|
-
export declare function connect<T extends PropTypes
|
|
1
|
+
import type { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
2
|
+
import type { Send, State } from "./tooltip.types";
|
|
3
|
+
export declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
open(): void;
|
|
6
6
|
close(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/tooltip",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20220628115342",
|
|
4
4
|
"description": "Core logic for the tooltip widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zag-js/core": "0.0.0-dev-
|
|
33
|
-
"@zag-js/dom-utils": "0.0.0-dev-
|
|
34
|
-
"@zag-js/popper": "0.0.0-dev-
|
|
35
|
-
"@zag-js/types": "0.
|
|
32
|
+
"@zag-js/core": "0.0.0-dev-20220628115342",
|
|
33
|
+
"@zag-js/dom-utils": "0.0.0-dev-20220628115342",
|
|
34
|
+
"@zag-js/popper": "0.0.0-dev-20220628115342",
|
|
35
|
+
"@zag-js/types": "0.0.0-dev-20220628115342"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build:fast": "zag build",
|