@zag-js/tooltip 0.2.6 → 0.2.7

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.
@@ -2,7 +2,7 @@ import {
2
2
  dom,
3
3
  getScrollParents,
4
4
  isHTMLElement
5
- } from "./chunk-PFKIRGNP.mjs";
5
+ } from "./chunk-X5RNQNZU.mjs";
6
6
  import {
7
7
  store
8
8
  } from "./chunk-GQYNO326.mjs";
@@ -59,25 +59,7 @@ function defineDomHelpers(helpers) {
59
59
  return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
60
60
  },
61
61
  getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
62
- getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
63
- createEmitter: (ctx, target) => {
64
- const win = dom2.getWin(ctx);
65
- return function emit(evt, detail, options) {
66
- const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
67
- const eventName = `zag:${evt}`;
68
- const init = { bubbles, cancelable, composed, detail };
69
- const event = new win.CustomEvent(eventName, init);
70
- target.dispatchEvent(event);
71
- };
72
- },
73
- createListener: (target) => {
74
- return function listen(evt, handler) {
75
- const eventName = `zag:${evt}`;
76
- const listener = (e) => handler(e);
77
- target.addEventListener(eventName, listener);
78
- return () => target.removeEventListener(eventName, listener);
79
- };
80
- }
62
+ getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
81
63
  };
82
64
  return {
83
65
  ...dom2,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RRQRIZBA.mjs";
4
4
  import {
5
5
  dom
6
- } from "./chunk-PFKIRGNP.mjs";
6
+ } from "./chunk-X5RNQNZU.mjs";
7
7
  import {
8
8
  store
9
9
  } from "./chunk-GQYNO326.mjs";
package/dist/index.js CHANGED
@@ -129,25 +129,7 @@ function defineDomHelpers(helpers) {
129
129
  return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
130
130
  },
131
131
  getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
132
- getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
133
- createEmitter: (ctx, target) => {
134
- const win = dom2.getWin(ctx);
135
- return function emit(evt, detail, options) {
136
- const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
137
- const eventName = `zag:${evt}`;
138
- const init = { bubbles, cancelable, composed, detail };
139
- const event = new win.CustomEvent(eventName, init);
140
- target.dispatchEvent(event);
141
- };
142
- },
143
- createListener: (target) => {
144
- return function listen(evt, handler) {
145
- const eventName = `zag:${evt}`;
146
- const listener = (e) => handler(e);
147
- target.addEventListener(eventName, listener);
148
- return () => target.removeEventListener(eventName, listener);
149
- };
150
- }
132
+ getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
151
133
  };
152
134
  return {
153
135
  ...dom2,
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-XZ6HXWV2.mjs";
3
+ } from "./chunk-Y37ZX4UJ.mjs";
4
4
  import {
5
5
  anatomy
6
6
  } from "./chunk-RRQRIZBA.mjs";
7
7
  import {
8
8
  machine
9
- } from "./chunk-JWVFZJC7.mjs";
10
- import "./chunk-PFKIRGNP.mjs";
9
+ } from "./chunk-ANNOJ3Y7.mjs";
10
+ import "./chunk-X5RNQNZU.mjs";
11
11
  import "./chunk-GQYNO326.mjs";
12
12
  export {
13
13
  anatomy,
@@ -86,25 +86,7 @@ function defineDomHelpers(helpers) {
86
86
  return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
87
87
  },
88
88
  getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
89
- getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
90
- createEmitter: (ctx, target) => {
91
- const win = dom2.getWin(ctx);
92
- return function emit(evt, detail, options) {
93
- const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
94
- const eventName = `zag:${evt}`;
95
- const init = { bubbles, cancelable, composed, detail };
96
- const event = new win.CustomEvent(eventName, init);
97
- target.dispatchEvent(event);
98
- };
99
- },
100
- createListener: (target) => {
101
- return function listen(evt, handler) {
102
- const eventName = `zag:${evt}`;
103
- const listener = (e) => handler(e);
104
- target.addEventListener(eventName, listener);
105
- return () => target.removeEventListener(eventName, listener);
106
- };
107
- }
89
+ getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
108
90
  };
109
91
  return {
110
92
  ...dom2,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-XZ6HXWV2.mjs";
3
+ } from "./chunk-Y37ZX4UJ.mjs";
4
4
  import "./chunk-RRQRIZBA.mjs";
5
- import "./chunk-PFKIRGNP.mjs";
5
+ import "./chunk-X5RNQNZU.mjs";
6
6
  import "./chunk-GQYNO326.mjs";
7
7
  export {
8
8
  connect
@@ -19,10 +19,6 @@ declare const dom: {
19
19
  getById: <T = HTMLElement>(ctx: {
20
20
  getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
21
21
  }, id: string) => T | null;
22
- createEmitter: (ctx: {
23
- getRootNode?: (() => Node | Document | ShadowRoot) | undefined;
24
- }, target: HTMLElement) => (evt: string, detail: Record<string, any>, options?: EventInit | undefined) => void;
25
- createListener: (target: HTMLElement) => <T_1 = any>(evt: string, handler: (e: CustomEvent<T_1>) => void) => () => void;
26
22
  } & {
27
23
  getTriggerId: (ctx: MachineContext) => string;
28
24
  getContentId: (ctx: MachineContext) => string;
@@ -81,25 +81,7 @@ function defineDomHelpers(helpers) {
81
81
  return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
82
82
  },
83
83
  getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
84
- getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
85
- createEmitter: (ctx, target) => {
86
- const win = dom2.getWin(ctx);
87
- return function emit(evt, detail, options) {
88
- const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
89
- const eventName = `zag:${evt}`;
90
- const init = { bubbles, cancelable, composed, detail };
91
- const event = new win.CustomEvent(eventName, init);
92
- target.dispatchEvent(event);
93
- };
94
- },
95
- createListener: (target) => {
96
- return function listen(evt, handler) {
97
- const eventName = `zag:${evt}`;
98
- const listener = (e) => handler(e);
99
- target.addEventListener(eventName, listener);
100
- return () => target.removeEventListener(eventName, listener);
101
- };
102
- }
84
+ getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
103
85
  };
104
86
  return {
105
87
  ...dom2,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dom
3
- } from "./chunk-PFKIRGNP.mjs";
3
+ } from "./chunk-X5RNQNZU.mjs";
4
4
  export {
5
5
  dom
6
6
  };
@@ -118,25 +118,7 @@ function defineDomHelpers(helpers) {
118
118
  return (_a = dom2.getDoc(ctx).defaultView) != null ? _a : window;
119
119
  },
120
120
  getActiveElement: (ctx) => dom2.getDoc(ctx).activeElement,
121
- getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id),
122
- createEmitter: (ctx, target) => {
123
- const win = dom2.getWin(ctx);
124
- return function emit(evt, detail, options) {
125
- const { bubbles = true, cancelable, composed = true } = options != null ? options : {};
126
- const eventName = `zag:${evt}`;
127
- const init = { bubbles, cancelable, composed, detail };
128
- const event = new win.CustomEvent(eventName, init);
129
- target.dispatchEvent(event);
130
- };
131
- },
132
- createListener: (target) => {
133
- return function listen(evt, handler) {
134
- const eventName = `zag:${evt}`;
135
- const listener = (e) => handler(e);
136
- target.addEventListener(eventName, listener);
137
- return () => target.removeEventListener(eventName, listener);
138
- };
139
- }
121
+ getById: (ctx, id) => dom2.getRootNode(ctx).getElementById(id)
140
122
  };
141
123
  return {
142
124
  ...dom2,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  machine
3
- } from "./chunk-JWVFZJC7.mjs";
4
- import "./chunk-PFKIRGNP.mjs";
3
+ } from "./chunk-ANNOJ3Y7.mjs";
4
+ import "./chunk-X5RNQNZU.mjs";
5
5
  import "./chunk-GQYNO326.mjs";
6
6
  export {
7
7
  machine
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/tooltip",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Core logic for the tooltip widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@zag-js/anatomy": "0.1.3",
30
- "@zag-js/core": "0.2.4",
30
+ "@zag-js/core": "0.2.5",
31
31
  "@zag-js/popper": "0.2.2",
32
- "@zag-js/types": "0.3.2"
32
+ "@zag-js/types": "0.3.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "clean-package": "2.2.0",
36
- "@zag-js/dom-utils": "0.2.2",
36
+ "@zag-js/dom-utils": "0.2.3",
37
37
  "@zag-js/utils": "0.3.2"
38
38
  },
39
39
  "clean-package": "../../../clean-package.config.json",