asma-ui-core 3.110.0 → 3.111.0

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.
@@ -1,15 +1,15 @@
1
- import { useCallback as r, useSyncExternalStore as s } from "react";
2
- var c = { popover: "manual" }, p = {
1
+ import { useCallback as s, useSyncExternalStore as a } from "react";
2
+ var p = { popover: "manual" }, g = {
3
3
  margin: 0,
4
4
  inset: "auto"
5
5
  };
6
- function f(e) {
6
+ function w(e) {
7
7
  if (!(e instanceof Element)) return;
8
8
  const o = e.closest("dialog");
9
9
  return o instanceof HTMLDialogElement && o.open ? o : void 0;
10
10
  }
11
11
  function t() {
12
- if (typeof window > "u") return a ??= {
12
+ if (typeof window > "u") return l ??= {
13
13
  dialogs: [],
14
14
  listeners: /* @__PURE__ */ new Set()
15
15
  };
@@ -19,34 +19,37 @@ function t() {
19
19
  listeners: /* @__PURE__ */ new Set()
20
20
  };
21
21
  }
22
- var a, i = () => {
22
+ var l, r = () => {
23
23
  for (const e of [...t().listeners]) e();
24
24
  };
25
- function g(e) {
26
- return t().dialogs.push(e), i(), () => {
25
+ function v(e) {
26
+ return t().dialogs.push(e), r(), () => {
27
27
  const { dialogs: o } = t(), n = o.indexOf(e);
28
- n !== -1 && (o.splice(n, 1), i());
28
+ n !== -1 && (o.splice(n, 1), r());
29
29
  };
30
30
  }
31
- function l() {
32
- const { dialogs: e } = t();
33
- for (let o = e.length - 1; o >= 0; o -= 1) {
34
- const n = e[o];
35
- if (n?.isConnected && n.open) return n;
31
+ function u(e) {
32
+ const { dialogs: o } = t();
33
+ for (let n = o.length - 1; n >= 0; n -= 1) {
34
+ const i = o[n];
35
+ if (i?.isConnected && e(i)) return i;
36
36
  }
37
37
  }
38
- var u = (e) => (t().listeners.add(e), () => {
38
+ function d() {
39
+ return u((e) => e.open);
40
+ }
41
+ var c = (e) => (t().listeners.add(e), () => {
39
42
  t().listeners.delete(e);
40
43
  });
41
- function w() {
42
- return s(u, l, () => {
44
+ function m() {
45
+ return a(c, d, () => {
43
46
  });
44
47
  }
45
- function v(e) {
48
+ function O(e) {
46
49
  return e == null;
47
50
  }
48
- function O(e, o = !0) {
49
- return r((n) => {
51
+ function T(e, o = !0) {
52
+ return s((n) => {
50
53
  if (e(n), !(!n || !o))
51
54
  try {
52
55
  typeof n.showPopover == "function" && !n.matches(":popover-open") && n.showPopover();
@@ -55,11 +58,12 @@ function O(e, o = !0) {
55
58
  }, [e, o]);
56
59
  }
57
60
  export {
58
- c as TOP_LAYER_PROPS,
59
- p as TOP_LAYER_RESET_STYLE,
60
- f as getOpenModalDialogAncestor,
61
- g as registerOpenModalDialog,
62
- v as shouldUsePopoverTopLayer,
63
- O as useTopLayerRef,
64
- w as useTopmostOpenModalDialog
61
+ p as TOP_LAYER_PROPS,
62
+ g as TOP_LAYER_RESET_STYLE,
63
+ u as findTopmostConnectedModalDialog,
64
+ w as getOpenModalDialogAncestor,
65
+ v as registerOpenModalDialog,
66
+ O as shouldUsePopoverTopLayer,
67
+ T as useTopLayerRef,
68
+ m as useTopmostOpenModalDialog
65
69
  };