@zag-js/popover 0.0.0-dev-20220709135250 → 0.0.0-dev-20220709181637

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 CHANGED
@@ -88,7 +88,7 @@ function getEventTarget(event) {
88
88
  var _a, _b;
89
89
  return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
90
90
  }
91
- function withRootHelpers(domUtils) {
91
+ function defineDomHelpers(domUtils) {
92
92
  const roots = {
93
93
  getRootNode: (ctx) => {
94
94
  var _a, _b;
@@ -98,7 +98,8 @@ function withRootHelpers(domUtils) {
98
98
  getWin: (ctx) => {
99
99
  var _a;
100
100
  return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
101
- }
101
+ },
102
+ getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
102
103
  };
103
104
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
104
105
  }
@@ -228,7 +229,7 @@ var runIfFn2 = (v, ...a) => {
228
229
  };
229
230
 
230
231
  // src/popover.dom.ts
231
- var dom = withRootHelpers({
232
+ var dom = defineDomHelpers({
232
233
  getActiveEl: (ctx) => dom.getDoc(ctx).activeElement,
233
234
  getAnchorId: (ctx) => {
234
235
  var _a, _b;
@@ -727,7 +728,7 @@ function machine(ctx) {
727
728
  }
728
729
  },
729
730
  closed: {
730
- entry: ["clearPointerDown", "invokeOnClose"],
731
+ entry: "invokeOnClose",
731
732
  on: {
732
733
  TOGGLE: "open",
733
734
  OPEN: "open"
@@ -896,9 +897,6 @@ function machine(ctx) {
896
897
  });
897
898
  });
898
899
  },
899
- clearPointerDown(ctx2) {
900
- ctx2.pointerdownNode = null;
901
- },
902
900
  setInitialFocus(ctx2) {
903
901
  raf(() => {
904
902
  var _a;
package/dist/index.mjs CHANGED
@@ -64,7 +64,7 @@ function getEventTarget(event) {
64
64
  var _a, _b;
65
65
  return (_b = (_a = event.composedPath) == null ? void 0 : _a.call(event)[0]) != null ? _b : event.target;
66
66
  }
67
- function withRootHelpers(domUtils) {
67
+ function defineDomHelpers(domUtils) {
68
68
  const roots = {
69
69
  getRootNode: (ctx) => {
70
70
  var _a, _b;
@@ -74,7 +74,8 @@ function withRootHelpers(domUtils) {
74
74
  getWin: (ctx) => {
75
75
  var _a;
76
76
  return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
77
- }
77
+ },
78
+ getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
78
79
  };
79
80
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
80
81
  }
@@ -204,7 +205,7 @@ var runIfFn2 = (v, ...a) => {
204
205
  };
205
206
 
206
207
  // src/popover.dom.ts
207
- var dom = withRootHelpers({
208
+ var dom = defineDomHelpers({
208
209
  getActiveEl: (ctx) => dom.getDoc(ctx).activeElement,
209
210
  getAnchorId: (ctx) => {
210
211
  var _a, _b;
@@ -703,7 +704,7 @@ function machine(ctx) {
703
704
  }
704
705
  },
705
706
  closed: {
706
- entry: ["clearPointerDown", "invokeOnClose"],
707
+ entry: "invokeOnClose",
707
708
  on: {
708
709
  TOGGLE: "open",
709
710
  OPEN: "open"
@@ -872,9 +873,6 @@ function machine(ctx) {
872
873
  });
873
874
  });
874
875
  },
875
- clearPointerDown(ctx2) {
876
- ctx2.pointerdownNode = null;
877
- },
878
876
  setInitialFocus(ctx2) {
879
877
  raf(() => {
880
878
  var _a;
@@ -9,6 +9,9 @@ export declare const dom: {
9
9
  getWin: (ctx: {
10
10
  getRootNode?: () => Document | Node | ShadowRoot;
11
11
  }) => Window & typeof globalThis;
12
+ getActiveElement: (ctx: {
13
+ getRootNode?: () => Document | Node | ShadowRoot;
14
+ }) => HTMLElement;
12
15
  } & {
13
16
  getActiveEl: (ctx: Ctx) => Element;
14
17
  getAnchorId: (ctx: Ctx) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/popover",
3
- "version": "0.0.0-dev-20220709135250",
3
+ "version": "0.0.0-dev-20220709181637",
4
4
  "description": "Core logic for the popover widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -31,10 +31,10 @@
31
31
  "dependencies": {
32
32
  "@zag-js/aria-hidden": "0.1.0",
33
33
  "@zag-js/core": "0.1.7",
34
- "@zag-js/dom-utils": "0.0.0-dev-20220709135250",
35
- "@zag-js/popper": "0.0.0-dev-20220709135250",
36
- "@zag-js/remove-scroll": "0.0.0-dev-20220709135250",
37
- "@zag-js/types": "0.0.0-dev-20220709135250",
34
+ "@zag-js/dom-utils": "0.0.0-dev-20220709181637",
35
+ "@zag-js/popper": "0.0.0-dev-20220709181637",
36
+ "@zag-js/remove-scroll": "0.0.0-dev-20220709181637",
37
+ "@zag-js/types": "0.0.0-dev-20220709181637",
38
38
  "@zag-js/utils": "0.1.2",
39
39
  "focus-trap": "6.9.4"
40
40
  },