react-bounded-overlay-manager 1.0.0-beta.1
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/README.md +30 -0
- package/dist/assets/Overlay.css +1 -0
- package/dist/assets/OverlaysContainer.css +1 -0
- package/dist/events-B7I8KoZ9.js +228 -0
- package/dist/index-7ofMxoL9.js +8811 -0
- package/dist/index.module-WXM1Xk0w.js +60 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +12 -0
- package/dist/react.esm-GKFzux-6.js +12736 -0
- package/dist/src/api/BoundedOverlayManagerApi.d.ts +14 -0
- package/dist/src/api/BoundedOverlayManagerApi.js +24 -0
- package/dist/src/components/BoundedOverlayManager.d.ts +7 -0
- package/dist/src/components/BoundedOverlayManager.js +17 -0
- package/dist/src/components/BoundedOverlayManagerContent.d.ts +15 -0
- package/dist/src/components/BoundedOverlayManagerContent.js +46 -0
- package/dist/src/components/Overlay.d.ts +26 -0
- package/dist/src/components/Overlay.js +43 -0
- package/dist/src/components/OverlaysContainer.d.ts +11 -0
- package/dist/src/components/OverlaysContainer.js +12 -0
- package/dist/src/components/test/BoundedOverlayManager.test.d.ts +0 -0
- package/dist/src/components/test/BoundedOverlayManager.test.js +37 -0
- package/dist/src/components/test/BoundedOverlayManagerContent.test.d.ts +0 -0
- package/dist/src/components/test/BoundedOverlayManagerContent.test.js +92 -0
- package/dist/src/components/test/Overlay.test.d.ts +0 -0
- package/dist/src/components/test/Overlay.test.js +245 -0
- package/dist/src/components/test/OverlaysContainer.test.d.ts +0 -0
- package/dist/src/components/test/OverlaysContainer.test.js +36 -0
- package/dist/src/config.d.ts +6 -0
- package/dist/src/config.js +9 -0
- package/dist/src/context/OverlayManagerContext.d.ts +13 -0
- package/dist/src/context/OverlayManagerContext.js +23 -0
- package/dist/src/context/test/OverlayManagerContext.test.d.ts +1 -0
- package/dist/src/context/test/OverlayManagerContext.test.js +31 -0
- package/dist/src/enum/PredefinedPosition.d.ts +12 -0
- package/dist/src/enum/PredefinedPosition.js +4 -0
- package/dist/src/hooks/test/useApiUpdateHandler.test.d.ts +1 -0
- package/dist/src/hooks/test/useApiUpdateHandler.test.js +28 -0
- package/dist/src/hooks/test/useForwardBoundingComponentEvents.test.d.ts +1 -0
- package/dist/src/hooks/test/useForwardBoundingComponentEvents.test.js +62 -0
- package/dist/src/hooks/test/useForwardOverlayEvents.test.d.ts +1 -0
- package/dist/src/hooks/test/useForwardOverlayEvents.test.js +43 -0
- package/dist/src/hooks/test/useFullscreenChange.test.d.ts +1 -0
- package/dist/src/hooks/test/useFullscreenChange.test.js +33 -0
- package/dist/src/hooks/test/useOverlayManagerEvents.test.d.ts +1 -0
- package/dist/src/hooks/test/useOverlayManagerEvents.test.js +87 -0
- package/dist/src/hooks/test/useResizeObserver.test.d.ts +1 -0
- package/dist/src/hooks/test/useResizeObserver.test.js +47 -0
- package/dist/src/hooks/test/useScrollOnDocument.test.d.ts +1 -0
- package/dist/src/hooks/test/useScrollOnDocument.test.js +38 -0
- package/dist/src/hooks/test/useTimedEventManager.test.d.ts +1 -0
- package/dist/src/hooks/test/useTimedEventManager.test.js +41 -0
- package/dist/src/hooks/test/useWindowResize.test.d.ts +1 -0
- package/dist/src/hooks/test/useWindowResize.test.js +38 -0
- package/dist/src/hooks/test/util.d.ts +7 -0
- package/dist/src/hooks/test/util.js +20 -0
- package/dist/src/hooks/useApiUpdateHandler.d.ts +6 -0
- package/dist/src/hooks/useApiUpdateHandler.js +10 -0
- package/dist/src/hooks/useForwardBoundingComponentEvents.d.ts +2 -0
- package/dist/src/hooks/useForwardBoundingComponentEvents.js +20 -0
- package/dist/src/hooks/useForwardOverlayEvents.d.ts +6 -0
- package/dist/src/hooks/useForwardOverlayEvents.js +21 -0
- package/dist/src/hooks/useFullscreenChange.d.ts +5 -0
- package/dist/src/hooks/useFullscreenChange.js +16 -0
- package/dist/src/hooks/useOverlayManagerEvents.d.ts +8 -0
- package/dist/src/hooks/useOverlayManagerEvents.js +34 -0
- package/dist/src/hooks/useResizeObserver.d.ts +6 -0
- package/dist/src/hooks/useResizeObserver.js +19 -0
- package/dist/src/hooks/useScrollOnDocument.d.ts +5 -0
- package/dist/src/hooks/useScrollOnDocument.js +11 -0
- package/dist/src/hooks/useTimedEventManager.d.ts +6 -0
- package/dist/src/hooks/useTimedEventManager.js +15 -0
- package/dist/src/hooks/useWindowResize.d.ts +5 -0
- package/dist/src/hooks/useWindowResize.js +11 -0
- package/dist/src/timer/TimedEventManager.d.ts +16 -0
- package/dist/src/timer/TimedEventManager.js +25 -0
- package/dist/src/timer/test/TimedEventManager.test.d.ts +1 -0
- package/dist/src/timer/test/TimedEventManager.test.js +26 -0
- package/dist/src/types/OffsetProps.d.ts +37 -0
- package/dist/src/types/OffsetProps.js +1 -0
- package/dist/src/util/bbox.d.ts +7 -0
- package/dist/src/util/bbox.js +20 -0
- package/dist/vite-env.d.js +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +70 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## Expanding the ESLint configuration
|
|
11
|
+
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
13
|
+
|
|
14
|
+
- Configure the top-level `parserOptions` property like this:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
export default {
|
|
18
|
+
// other rules...
|
|
19
|
+
parserOptions: {
|
|
20
|
+
ecmaVersion: 'latest',
|
|
21
|
+
sourceType: 'module',
|
|
22
|
+
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
23
|
+
tsconfigRootDir: __dirname,
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
29
|
+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
30
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._overlay_ractj_1{position:absolute;pointer-events:auto}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._overlaysContainer_wi19r_1{position:absolute;pointer-events:none}._overlaysContainerContent_wi19r_6{position:relative;width:100%;height:100%}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
var p = { exports: {} }, a = typeof Reflect == "object" ? Reflect : null, d = a && typeof a.apply == "function" ? a.apply : function(e, n, r) {
|
|
2
|
+
return Function.prototype.apply.call(e, n, r);
|
|
3
|
+
}, l;
|
|
4
|
+
a && typeof a.ownKeys == "function" ? l = a.ownKeys : Object.getOwnPropertySymbols ? l = function(e) {
|
|
5
|
+
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
6
|
+
} : l = function(e) {
|
|
7
|
+
return Object.getOwnPropertyNames(e);
|
|
8
|
+
};
|
|
9
|
+
function C(t) {
|
|
10
|
+
console && console.warn && console.warn(t);
|
|
11
|
+
}
|
|
12
|
+
var m = Number.isNaN || function(e) {
|
|
13
|
+
return e !== e;
|
|
14
|
+
};
|
|
15
|
+
function o() {
|
|
16
|
+
o.init.call(this);
|
|
17
|
+
}
|
|
18
|
+
p.exports = o;
|
|
19
|
+
p.exports.once = M;
|
|
20
|
+
o.EventEmitter = o;
|
|
21
|
+
o.prototype._events = void 0;
|
|
22
|
+
o.prototype._eventsCount = 0;
|
|
23
|
+
o.prototype._maxListeners = void 0;
|
|
24
|
+
var L = 10;
|
|
25
|
+
function v(t) {
|
|
26
|
+
if (typeof t != "function")
|
|
27
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, "defaultMaxListeners", {
|
|
30
|
+
enumerable: !0,
|
|
31
|
+
get: function() {
|
|
32
|
+
return L;
|
|
33
|
+
},
|
|
34
|
+
set: function(t) {
|
|
35
|
+
if (typeof t != "number" || t < 0 || m(t))
|
|
36
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
|
|
37
|
+
L = t;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
o.init = function() {
|
|
41
|
+
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
42
|
+
};
|
|
43
|
+
o.prototype.setMaxListeners = function(e) {
|
|
44
|
+
if (typeof e != "number" || e < 0 || m(e))
|
|
45
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
46
|
+
return this._maxListeners = e, this;
|
|
47
|
+
};
|
|
48
|
+
function y(t) {
|
|
49
|
+
return t._maxListeners === void 0 ? o.defaultMaxListeners : t._maxListeners;
|
|
50
|
+
}
|
|
51
|
+
o.prototype.getMaxListeners = function() {
|
|
52
|
+
return y(this);
|
|
53
|
+
};
|
|
54
|
+
o.prototype.emit = function(e) {
|
|
55
|
+
for (var n = [], r = 1; r < arguments.length; r++)
|
|
56
|
+
n.push(arguments[r]);
|
|
57
|
+
var i = e === "error", f = this._events;
|
|
58
|
+
if (f !== void 0)
|
|
59
|
+
i = i && f.error === void 0;
|
|
60
|
+
else if (!i)
|
|
61
|
+
return !1;
|
|
62
|
+
if (i) {
|
|
63
|
+
var s;
|
|
64
|
+
if (n.length > 0 && (s = n[0]), s instanceof Error)
|
|
65
|
+
throw s;
|
|
66
|
+
var u = new Error("Unhandled error." + (s ? " (" + s.message + ")" : ""));
|
|
67
|
+
throw u.context = s, u;
|
|
68
|
+
}
|
|
69
|
+
var c = f[e];
|
|
70
|
+
if (c === void 0)
|
|
71
|
+
return !1;
|
|
72
|
+
if (typeof c == "function")
|
|
73
|
+
d(c, this, n);
|
|
74
|
+
else
|
|
75
|
+
for (var h = c.length, x = E(c, h), r = 0; r < h; ++r)
|
|
76
|
+
d(x[r], this, n);
|
|
77
|
+
return !0;
|
|
78
|
+
};
|
|
79
|
+
function g(t, e, n, r) {
|
|
80
|
+
var i, f, s;
|
|
81
|
+
if (v(n), f = t._events, f === void 0 ? (f = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (f.newListener !== void 0 && (t.emit(
|
|
82
|
+
"newListener",
|
|
83
|
+
e,
|
|
84
|
+
n.listener ? n.listener : n
|
|
85
|
+
), f = t._events), s = f[e]), s === void 0)
|
|
86
|
+
s = f[e] = n, ++t._eventsCount;
|
|
87
|
+
else if (typeof s == "function" ? s = f[e] = r ? [n, s] : [s, n] : r ? s.unshift(n) : s.push(n), i = y(t), i > 0 && s.length > i && !s.warned) {
|
|
88
|
+
s.warned = !0;
|
|
89
|
+
var u = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
90
|
+
u.name = "MaxListenersExceededWarning", u.emitter = t, u.type = e, u.count = s.length, C(u);
|
|
91
|
+
}
|
|
92
|
+
return t;
|
|
93
|
+
}
|
|
94
|
+
o.prototype.addListener = function(e, n) {
|
|
95
|
+
return g(this, e, n, !1);
|
|
96
|
+
};
|
|
97
|
+
o.prototype.on = o.prototype.addListener;
|
|
98
|
+
o.prototype.prependListener = function(e, n) {
|
|
99
|
+
return g(this, e, n, !0);
|
|
100
|
+
};
|
|
101
|
+
function j() {
|
|
102
|
+
if (!this.fired)
|
|
103
|
+
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
104
|
+
}
|
|
105
|
+
function _(t, e, n) {
|
|
106
|
+
var r = { fired: !1, wrapFn: void 0, target: t, type: e, listener: n }, i = j.bind(r);
|
|
107
|
+
return i.listener = n, r.wrapFn = i, i;
|
|
108
|
+
}
|
|
109
|
+
o.prototype.once = function(e, n) {
|
|
110
|
+
return v(n), this.on(e, _(this, e, n)), this;
|
|
111
|
+
};
|
|
112
|
+
o.prototype.prependOnceListener = function(e, n) {
|
|
113
|
+
return v(n), this.prependListener(e, _(this, e, n)), this;
|
|
114
|
+
};
|
|
115
|
+
o.prototype.removeListener = function(e, n) {
|
|
116
|
+
var r, i, f, s, u;
|
|
117
|
+
if (v(n), i = this._events, i === void 0)
|
|
118
|
+
return this;
|
|
119
|
+
if (r = i[e], r === void 0)
|
|
120
|
+
return this;
|
|
121
|
+
if (r === n || r.listener === n)
|
|
122
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete i[e], i.removeListener && this.emit("removeListener", e, r.listener || n));
|
|
123
|
+
else if (typeof r != "function") {
|
|
124
|
+
for (f = -1, s = r.length - 1; s >= 0; s--)
|
|
125
|
+
if (r[s] === n || r[s].listener === n) {
|
|
126
|
+
u = r[s].listener, f = s;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
if (f < 0)
|
|
130
|
+
return this;
|
|
131
|
+
f === 0 ? r.shift() : R(r, f), r.length === 1 && (i[e] = r[0]), i.removeListener !== void 0 && this.emit("removeListener", e, u || n);
|
|
132
|
+
}
|
|
133
|
+
return this;
|
|
134
|
+
};
|
|
135
|
+
o.prototype.off = o.prototype.removeListener;
|
|
136
|
+
o.prototype.removeAllListeners = function(e) {
|
|
137
|
+
var n, r, i;
|
|
138
|
+
if (r = this._events, r === void 0)
|
|
139
|
+
return this;
|
|
140
|
+
if (r.removeListener === void 0)
|
|
141
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : r[e] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete r[e]), this;
|
|
142
|
+
if (arguments.length === 0) {
|
|
143
|
+
var f = Object.keys(r), s;
|
|
144
|
+
for (i = 0; i < f.length; ++i)
|
|
145
|
+
s = f[i], s !== "removeListener" && this.removeAllListeners(s);
|
|
146
|
+
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
147
|
+
}
|
|
148
|
+
if (n = r[e], typeof n == "function")
|
|
149
|
+
this.removeListener(e, n);
|
|
150
|
+
else if (n !== void 0)
|
|
151
|
+
for (i = n.length - 1; i >= 0; i--)
|
|
152
|
+
this.removeListener(e, n[i]);
|
|
153
|
+
return this;
|
|
154
|
+
};
|
|
155
|
+
function w(t, e, n) {
|
|
156
|
+
var r = t._events;
|
|
157
|
+
if (r === void 0)
|
|
158
|
+
return [];
|
|
159
|
+
var i = r[e];
|
|
160
|
+
return i === void 0 ? [] : typeof i == "function" ? n ? [i.listener || i] : [i] : n ? N(i) : E(i, i.length);
|
|
161
|
+
}
|
|
162
|
+
o.prototype.listeners = function(e) {
|
|
163
|
+
return w(this, e, !0);
|
|
164
|
+
};
|
|
165
|
+
o.prototype.rawListeners = function(e) {
|
|
166
|
+
return w(this, e, !1);
|
|
167
|
+
};
|
|
168
|
+
o.listenerCount = function(t, e) {
|
|
169
|
+
return typeof t.listenerCount == "function" ? t.listenerCount(e) : b.call(t, e);
|
|
170
|
+
};
|
|
171
|
+
o.prototype.listenerCount = b;
|
|
172
|
+
function b(t) {
|
|
173
|
+
var e = this._events;
|
|
174
|
+
if (e !== void 0) {
|
|
175
|
+
var n = e[t];
|
|
176
|
+
if (typeof n == "function")
|
|
177
|
+
return 1;
|
|
178
|
+
if (n !== void 0)
|
|
179
|
+
return n.length;
|
|
180
|
+
}
|
|
181
|
+
return 0;
|
|
182
|
+
}
|
|
183
|
+
o.prototype.eventNames = function() {
|
|
184
|
+
return this._eventsCount > 0 ? l(this._events) : [];
|
|
185
|
+
};
|
|
186
|
+
function E(t, e) {
|
|
187
|
+
for (var n = new Array(e), r = 0; r < e; ++r)
|
|
188
|
+
n[r] = t[r];
|
|
189
|
+
return n;
|
|
190
|
+
}
|
|
191
|
+
function R(t, e) {
|
|
192
|
+
for (; e + 1 < t.length; e++)
|
|
193
|
+
t[e] = t[e + 1];
|
|
194
|
+
t.pop();
|
|
195
|
+
}
|
|
196
|
+
function N(t) {
|
|
197
|
+
for (var e = new Array(t.length), n = 0; n < e.length; ++n)
|
|
198
|
+
e[n] = t[n].listener || t[n];
|
|
199
|
+
return e;
|
|
200
|
+
}
|
|
201
|
+
function M(t, e) {
|
|
202
|
+
return new Promise(function(n, r) {
|
|
203
|
+
function i(s) {
|
|
204
|
+
t.removeListener(e, f), r(s);
|
|
205
|
+
}
|
|
206
|
+
function f() {
|
|
207
|
+
typeof t.removeListener == "function" && t.removeListener("error", i), n([].slice.call(arguments));
|
|
208
|
+
}
|
|
209
|
+
O(t, e, f, { once: !0 }), e !== "error" && A(t, i, { once: !0 });
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
function A(t, e, n) {
|
|
213
|
+
typeof t.on == "function" && O(t, "error", e, n);
|
|
214
|
+
}
|
|
215
|
+
function O(t, e, n, r) {
|
|
216
|
+
if (typeof t.on == "function")
|
|
217
|
+
r.once ? t.once(e, n) : t.on(e, n);
|
|
218
|
+
else if (typeof t.addEventListener == "function")
|
|
219
|
+
t.addEventListener(e, function i(f) {
|
|
220
|
+
r.once && t.removeEventListener(e, i), n(f);
|
|
221
|
+
});
|
|
222
|
+
else
|
|
223
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
|
|
224
|
+
}
|
|
225
|
+
var P = p.exports;
|
|
226
|
+
export {
|
|
227
|
+
P as e
|
|
228
|
+
};
|