@zag-js/pin-input 0.0.0-dev-20220709094318 → 0.0.0-dev-20220709145914

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
@@ -79,7 +79,7 @@ function getDocument(el) {
79
79
  return el;
80
80
  return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
81
81
  }
82
- function withRootHelpers(domUtils) {
82
+ function defineDomHelpers(domUtils) {
83
83
  const roots = {
84
84
  getRootNode: (ctx) => {
85
85
  var _a, _b;
@@ -89,7 +89,8 @@ function withRootHelpers(domUtils) {
89
89
  getWin: (ctx) => {
90
90
  var _a;
91
91
  return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
92
- }
92
+ },
93
+ getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
93
94
  };
94
95
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
95
96
  }
@@ -159,7 +160,7 @@ function invariant(...a) {
159
160
  }
160
161
 
161
162
  // src/pin-input.dom.ts
162
- var dom = withRootHelpers({
163
+ var dom = defineDomHelpers({
163
164
  getRootId: (ctx) => {
164
165
  var _a, _b;
165
166
  return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `pin-input:${ctx.id}`;
package/dist/index.mjs CHANGED
@@ -55,7 +55,7 @@ function getDocument(el) {
55
55
  return el;
56
56
  return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
57
57
  }
58
- function withRootHelpers(domUtils) {
58
+ function defineDomHelpers(domUtils) {
59
59
  const roots = {
60
60
  getRootNode: (ctx) => {
61
61
  var _a, _b;
@@ -65,7 +65,8 @@ function withRootHelpers(domUtils) {
65
65
  getWin: (ctx) => {
66
66
  var _a;
67
67
  return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
68
- }
68
+ },
69
+ getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
69
70
  };
70
71
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
71
72
  }
@@ -135,7 +136,7 @@ function invariant(...a) {
135
136
  }
136
137
 
137
138
  // src/pin-input.dom.ts
138
- var dom = withRootHelpers({
139
+ var dom = defineDomHelpers({
139
140
  getRootId: (ctx) => {
140
141
  var _a, _b;
141
142
  return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `pin-input:${ctx.id}`;
@@ -9,6 +9,9 @@ export declare const dom: {
9
9
  getWin: (ctx: {
10
10
  getRootNode?: () => Node | Document | ShadowRoot;
11
11
  }) => Window & typeof globalThis;
12
+ getActiveElement: (ctx: {
13
+ getRootNode?: () => Node | Document | ShadowRoot;
14
+ }) => HTMLElement;
12
15
  } & {
13
16
  getRootId: (ctx: Ctx) => string;
14
17
  getInputId: (ctx: Ctx, id: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/pin-input",
3
- "version": "0.0.0-dev-20220709094318",
3
+ "version": "0.0.0-dev-20220709145914",
4
4
  "description": "Core logic for the pin-input widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@zag-js/core": "0.1.7",
33
- "@zag-js/dom-utils": "0.0.0-dev-20220709094318",
34
- "@zag-js/types": "0.0.0-dev-20220709094318",
33
+ "@zag-js/dom-utils": "0.0.0-dev-20220709145914",
34
+ "@zag-js/types": "0.0.0-dev-20220709145914",
35
35
  "@zag-js/utils": "0.1.2"
36
36
  },
37
37
  "scripts": {