@kommo-crm/crm-react-ui-kit 1.1.1-beta.0 → 1.1.1-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.
Files changed (42) hide show
  1. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  2. package/dist/components/ContextMenu/ContextMenu.js +75 -72
  3. package/dist/components/ContextMenu/ContextMenu.props.d.ts +4 -0
  4. package/dist/components/ContextMenu/ContextMenu.props.d.ts.map +1 -1
  5. package/dist/components/ContextMenu/ContextMenu.types.d.ts +4 -0
  6. package/dist/components/ContextMenu/ContextMenu.types.d.ts.map +1 -1
  7. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +1 -1
  8. package/dist/components/ContextMenu/components/Content/Content.js +1 -1
  9. package/dist/components/ContextMenu/components/Content/index.js +1 -1
  10. package/dist/components/ContextMenu/components/Item/Item.d.ts.map +1 -1
  11. package/dist/components/ContextMenu/components/Item/Item.js +64 -56
  12. package/dist/components/ContextMenu/components/Item/Item.props.d.ts +8 -2
  13. package/dist/components/ContextMenu/components/Item/Item.props.d.ts.map +1 -1
  14. package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +1 -1
  15. package/dist/components/ContextMenu/components/Sub/Sub.d.ts.map +1 -1
  16. package/dist/components/ContextMenu/components/Sub/Sub.js +18 -16
  17. package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts +4 -0
  18. package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts.map +1 -1
  19. package/dist/components/ContextMenu/components/SubRoot/SubRoot.d.ts.map +1 -1
  20. package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +56 -53
  21. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +1 -1
  22. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +1 -1
  23. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.d.ts.map +1 -1
  24. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +53 -50
  25. package/dist/components/ContextMenu/components/Trigger/Trigger.d.ts.map +1 -1
  26. package/dist/components/ContextMenu/components/Trigger/Trigger.js +24 -24
  27. package/dist/components/ContextMenu/hooks/index.js +1 -1
  28. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts.map +1 -1
  29. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +1 -1
  30. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts +1 -0
  31. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts.map +1 -1
  32. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +56 -46
  33. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts +4 -3
  34. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts.map +1 -1
  35. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +55 -87
  36. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts +1 -0
  37. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts.map +1 -1
  38. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +57 -54
  39. package/dist/components/ContextMenu/index.js +1 -1
  40. package/dist/useContentPositioning-27D32n5u.mjs +185 -0
  41. package/package.json +1 -1
  42. package/dist/useContentPositioning-BIVWgixU.mjs +0 -174
@@ -1,82 +1,85 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as D, useImperativeHandle as E } from "react";
3
- import { R as N } from "../../../../index-BA3njR2k.mjs";
4
- import { useContextMenuContext as T, ContextMenuProvider as w } from "../../ContextMenu.context.js";
5
- import { ContextMenuMode as L } from "../../ContextMenu.enums.js";
6
- import { useContextMenuSubMenu as P } from "../../hooks/useContextMenuSubMenu/useContextMenuSubMenu.js";
7
- import "../../../../useContentPositioning-BIVWgixU.mjs";
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { forwardRef as E, useImperativeHandle as N } from "react";
3
+ import { R as T } from "../../../../index-BA3njR2k.mjs";
4
+ import { useContextMenuContext as w, ContextMenuProvider as L } from "../../ContextMenu.context.js";
5
+ import { ContextMenuMode as P } from "../../ContextMenu.enums.js";
6
+ import { useContextMenuSubMenu as j } from "../../hooks/useContextMenuSubMenu/useContextMenuSubMenu.js";
7
+ import "../../../../useContentPositioning-27D32n5u.mjs";
8
8
  import "../Content/Content.utils.js";
9
9
  import "../../providers/LevelProvider/LevelProvider.js";
10
- import { useContextMenuItemContext as j } from "../Item/Item.context.js";
11
- import { Trigger as V } from "./components/Trigger/Trigger.js";
12
- import { Content as Y } from "./components/Content/Content.js";
13
- const e = "ContextMenu.SubRoot", t = D(
10
+ import { useContextMenuItemContext as B } from "../Item/Item.context.js";
11
+ import { Trigger as K } from "./components/Trigger/Trigger.js";
12
+ import { Content as V } from "./components/Content/Content.js";
13
+ const e = "ContextMenu.SubRoot", t = E(
14
14
  ({
15
- children: p,
16
- mode: a = L.HOVER,
17
- onOpen: l,
18
- defaultOpen: M,
19
- isCloseWithRootMenu: d = !1,
20
- ...C
21
- }, f) => {
15
+ children: a,
16
+ mode: l = P.HOVER,
17
+ onOpen: M,
18
+ defaultOpen: d,
19
+ isCloseWithRootMenu: C = !1,
20
+ ...f
21
+ }, x) => {
22
22
  const {
23
23
  animationDuration: n,
24
24
  hoverCloseDelay: r,
25
- closeMenuImmediately: x
26
- } = T(e), { subMenuOpen: o, setSubMenuOpen: m } = j(e), c = d ? x : void 0, {
27
- mode: R,
28
- open: b,
25
+ closeMenuImmediately: c
26
+ } = w(e), { subMenuOpen: o, setSubMenuOpen: m } = B(e), y = C ? c : void 0, {
27
+ mode: b,
28
+ open: R,
29
29
  onOpenChange: g,
30
- triggerRef: y,
30
+ triggerRef: O,
31
31
  contentRef: I,
32
- inheritedArrowColor: O,
33
- animatedOpen: v,
34
- temporaryHoverClose: S,
32
+ inheritedArrowColor: v,
33
+ animatedOpen: S,
34
+ temporaryHoverClose: h,
35
35
  closeMenuImmediately: i,
36
- onMouseEnter: h,
37
- onMouseLeave: H,
36
+ onMouseEnter: H,
37
+ onMouseLeave: A,
38
38
  enableTemporaryHoverClose: u,
39
- triggerId: A
40
- } = P({
39
+ triggerId: D,
40
+ onOpenByKeyboard: s
41
+ } = j({
41
42
  displayName: e,
42
- mode: a,
43
- defaultOpen: M,
44
- onOpen: l,
43
+ mode: l,
44
+ defaultOpen: d,
45
+ onOpen: M,
45
46
  animationDuration: n,
46
47
  subMenuOpen: o,
47
48
  setSubMenuOpen: m,
48
49
  hoverCloseDelay: r,
49
- closeRootMenuImmediately: c
50
+ closeRootMenuImmediately: y
50
51
  });
51
- return E(f, () => ({
52
+ return N(x, () => ({
52
53
  closeMenuImmediately: i,
53
- enableTemporaryHoverClose: u
54
- })), /* @__PURE__ */ s(
55
- w,
54
+ enableTemporaryHoverClose: u,
55
+ onOpenByKeyboard: s
56
+ })), /* @__PURE__ */ p(
57
+ L,
56
58
  {
57
- mode: R,
58
- triggerRef: y,
59
+ mode: b,
60
+ triggerRef: O,
59
61
  contentRef: I,
60
- inheritedArrowColor: O,
61
- animatedOpen: v,
62
+ inheritedArrowColor: v,
63
+ animatedOpen: S,
62
64
  animationDuration: n,
63
65
  hoverCloseDelay: r,
64
- temporaryHoverClose: S,
66
+ temporaryHoverClose: h,
65
67
  closeMenuImmediately: i,
66
- onMouseEnter: h,
67
- onMouseLeave: H,
68
+ onMouseEnter: H,
69
+ onMouseLeave: A,
68
70
  enableTemporaryHoverClose: u,
69
71
  subMenuOpen: o,
70
72
  setSubMenuOpen: m,
71
- triggerId: A,
72
- children: /* @__PURE__ */ s(
73
- N,
73
+ triggerId: D,
74
+ onOpenByKeyboard: s,
75
+ children: /* @__PURE__ */ p(
76
+ T,
74
77
  {
75
- open: b || o,
78
+ open: R || o,
76
79
  onOpenChange: g,
77
80
  modal: !1,
78
- ...C,
79
- children: p
81
+ ...f,
82
+ children: a
80
83
  }
81
84
  )
82
85
  }
@@ -84,8 +87,8 @@ const e = "ContextMenu.SubRoot", t = D(
84
87
  }
85
88
  );
86
89
  t.displayName = e;
87
- t.Trigger = V;
88
- t.Content = Y;
90
+ t.Trigger = K;
91
+ t.Content = V;
89
92
  export {
90
93
  t as SubRoot
91
94
  };
@@ -8,7 +8,7 @@ import { LevelProvider as j } from "../../../../providers/LevelProvider/LevelPro
8
8
  import { useContextMenuContext as k } from "../../../../ContextMenu.context.js";
9
9
  import { ContextMenuMode as p } from "../../../../ContextMenu.enums.js";
10
10
  import { focusParentItem as z } from "../../../../utils/focusParentItem/focusParentItem.js";
11
- import { u as F, s as X } from "../../../../../../useContentPositioning-BIVWgixU.mjs";
11
+ import { u as F, s as X } from "../../../../../../useContentPositioning-27D32n5u.mjs";
12
12
  import { Direction as Y } from "../../../Content/Content.enums.js";
13
13
  import { directionToSide as q } from "../../../Content/Content.utils.js";
14
14
  const u = "ContextMenu.Content", J = P(
@@ -6,7 +6,7 @@ import { mergeRefs as E } from "../../../../../../lib/utils.js";
6
6
  import { useContextMenuContext as C } from "../../../../ContextMenu.context.js";
7
7
  import { ContextMenuMode as D } from "../../../../ContextMenu.enums.js";
8
8
  import "../../../../providers/LevelProvider/LevelProvider.js";
9
- import "../../../../../../useContentPositioning-BIVWgixU.mjs";
9
+ import "../../../../../../useContentPositioning-27D32n5u.mjs";
10
10
  import "../../../Content/Content.utils.js";
11
11
  import { useContextMenuItemFocus as L } from "../../../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
12
12
  const r = "ContextMenu.Trigger", N = c(
@@ -1 +1 @@
1
- {"version":3,"file":"SubTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubTrigger/SubTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAoB1C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAmFtB,CAAC"}
1
+ {"version":3,"file":"SubTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubTrigger/SubTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAoB1C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAgGtB,CAAC"}
@@ -1,74 +1,77 @@
1
1
  import { jsx as x } from "react/jsx-runtime";
2
- import { forwardRef as h } from "react";
2
+ import { forwardRef as E } from "react";
3
3
  import { b as P } from "../../../../index-BA3njR2k.mjs";
4
4
  import { c as _ } from "../../../../index-L8X2o7IH.mjs";
5
- import { useLevelContext as E } from "../../providers/LevelProvider/LevelProvider.js";
6
- import { useContextMenuSubContext as K } from "../Sub/Sub.context.js";
7
- import { hasItemIcon as S } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import { ContextMenuMode as r } from "../../ContextMenu.enums.js";
9
- import "../../../../useContentPositioning-BIVWgixU.mjs";
5
+ import { useLevelContext as S } from "../../providers/LevelProvider/LevelProvider.js";
6
+ import { useContextMenuSubContext as A } from "../Sub/Sub.context.js";
7
+ import { hasItemIcon as N } from "../../utils/hasItemIcon/hasItemIcon.js";
8
+ import { ContextMenuMode as t } from "../../ContextMenu.enums.js";
9
+ import "../../../../useContentPositioning-27D32n5u.mjs";
10
10
  import "../Content/Content.utils.js";
11
11
  import "../../ContextMenu.context.js";
12
- import { useContextMenuItemFocus as D } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
13
- import '../../../../assets/SubTrigger.css';const N = "_sub_trigger_d2xgz_1", O = {
14
- sub_trigger: N
15
- }, n = "ContextMenu.SubTrigger", T = h(
16
- ({ className: u, children: i, isDisabled: a, ...m }, p) => {
17
- const { hasItemWithIcon: g } = E(n), {
18
- mode: e,
19
- open: s,
20
- defaultOpen: t,
21
- setOpen: d,
22
- animatedOpen: f,
23
- onMouseEnter: v,
24
- onMouseLeave: C,
25
- triggerId: c
26
- } = K(n), {
27
- dataHighlighted: l,
28
- onFocus: M,
12
+ import { useContextMenuItemFocus as O } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
13
+ import '../../../../assets/SubTrigger.css';const T = "_sub_trigger_d2xgz_1", k = {
14
+ sub_trigger: T
15
+ }, i = "ContextMenu.SubTrigger", y = E(
16
+ ({ className: g, children: s, isDisabled: u, onKeyDown: n, ...m }, d) => {
17
+ const { hasItemWithIcon: f } = S(i), {
18
+ mode: o,
19
+ open: a,
20
+ defaultOpen: r,
21
+ setOpen: c,
22
+ onMouseEnter: l,
23
+ onMouseLeave: v,
24
+ triggerId: C,
25
+ onOpenByKeyboard: p
26
+ } = A(i), {
27
+ dataHighlighted: M,
28
+ onFocus: L,
29
29
  onMouseEnter: I,
30
- onBlur: L,
31
- onMouseLeave: b
32
- } = D({
33
- displayName: n,
34
- id: c,
35
- isDisabled: a,
36
- onMouseEnter: v,
37
- onMouseLeave: C
30
+ onBlur: b,
31
+ onMouseLeave: h
32
+ } = O({
33
+ displayName: i,
34
+ id: C,
35
+ isDisabled: u,
36
+ onMouseEnter: l,
37
+ onMouseLeave: v
38
38
  });
39
39
  return /* @__PURE__ */ x(
40
40
  P,
41
41
  {
42
- ref: p,
43
- className: _(O.sub_trigger, u),
44
- disabled: a,
42
+ ref: d,
43
+ className: _(k.sub_trigger, g),
44
+ disabled: u,
45
45
  "data-item": !0,
46
- "data-no-icon-align": S(i) || !g ? "" : void 0,
47
- "data-highlighted": f || l === "" || e === r.CLICK && s ? "" : void 0,
46
+ "data-no-icon-align": N(s) || !f ? "" : void 0,
47
+ "data-highlighted": a || M === "" || o === t.CLICK && a ? "" : void 0,
48
48
  "data-submenu-trigger": !0,
49
- onFocus: M,
50
49
  onMouseEnter: I,
51
- onBlur: L,
52
- onMouseLeave: b,
53
- onClick: (o) => {
54
- (e === r.CLICK || t !== void 0) && (o.preventDefault(), o.stopPropagation(), t === void 0 && d(!s));
50
+ onKeyDown: (e) => {
51
+ o === t.HOVER && (["Enter", " ", "ArrowRight"].includes(e.key) ? p(!0) : e.key === "ArrowLeft" && (p(!1), e.currentTarget.focus())), n == null || n(e);
55
52
  },
56
- onPointerEnter: (o) => {
57
- (e === r.CLICK || t !== void 0) && (o.preventDefault(), o.stopPropagation());
53
+ onFocus: L,
54
+ onBlur: b,
55
+ onMouseLeave: h,
56
+ onClick: (e) => {
57
+ (o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation(), r === void 0 && c(!a));
58
58
  },
59
- onPointerMove: (o) => {
60
- (e === r.CLICK || t !== void 0) && (o.preventDefault(), o.stopPropagation());
59
+ onPointerEnter: (e) => {
60
+ (o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
61
61
  },
62
- onPointerLeave: (o) => {
63
- (e === r.CLICK || t !== void 0) && (o.preventDefault(), o.stopPropagation());
62
+ onPointerMove: (e) => {
63
+ (o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
64
+ },
65
+ onPointerLeave: (e) => {
66
+ (o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
64
67
  },
65
68
  ...m,
66
- children: i
69
+ children: s
67
70
  }
68
71
  );
69
72
  }
70
73
  );
71
- T.displayName = n;
74
+ y.displayName = i;
72
75
  export {
73
- T as SubTrigger
76
+ y as SubTrigger
74
77
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Trigger/Trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAc1C,eAAO,MAAM,OAAO,kMA6BnB,CAAC"}
1
+ {"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Trigger/Trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAc1C,eAAO,MAAM,OAAO,kMAoCnB,CAAC"}
@@ -1,33 +1,33 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { forwardRef as u } from "react";
3
- import { T as x } from "../../../../index-BA3njR2k.mjs";
4
- import { c as M } from "../../../../index-L8X2o7IH.mjs";
5
- import { mergeRefs as c } from "../../../../lib/utils.js";
6
- import { useContextMenuContext as D } from "../../ContextMenu.context.js";
7
- import { ContextMenuMode as e } from "../../ContextMenu.enums.js";
8
- const t = "ContextMenu.Trigger", w = u(
9
- ({ className: n, children: m, ...i }, f) => {
10
- const { triggerRef: p, mode: r, onMouseEnter: s, onMouseLeave: a } = D(t);
11
- return /* @__PURE__ */ g(
12
- x,
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { forwardRef as x } from "react";
3
+ import { T as M } from "../../../../index-BA3njR2k.mjs";
4
+ import { c as d } from "../../../../index-L8X2o7IH.mjs";
5
+ import { mergeRefs as l } from "../../../../lib/utils.js";
6
+ import { useContextMenuContext as E } from "../../ContextMenu.context.js";
7
+ import { ContextMenuMode as i } from "../../ContextMenu.enums.js";
8
+ const n = "ContextMenu.Trigger", R = x(
9
+ ({ className: s, children: f, onKeyDown: e, ...m }, a) => {
10
+ const { triggerRef: p, mode: o, onMouseEnter: g, onMouseLeave: u, onOpenByKeyboard: t } = E(n);
11
+ return /* @__PURE__ */ c(
12
+ M,
13
13
  {
14
- ref: c(p, f),
15
- className: M(n),
16
- onPointerDown: (o) => {
17
- r === e.HOVER && (o.preventDefault(), o.stopPropagation());
14
+ ref: l(p, a),
15
+ className: d(s),
16
+ onPointerDown: (r) => {
17
+ o === i.HOVER && (r.preventDefault(), r.stopPropagation());
18
18
  },
19
- onKeyDown: (o) => {
20
- r === e.HOVER && o.key === "ArrowDown" && (o.preventDefault(), o.stopPropagation());
19
+ onKeyDown: (r) => {
20
+ o === i.HOVER && (r.stopPropagation(), ["Enter", " ", "ArrowDown"].includes(r.key) ? t(!0) : r.key === "Escape" && t(!1)), e == null || e(r);
21
21
  },
22
- onMouseEnter: s,
23
- onMouseLeave: a,
24
- ...i,
25
- children: m
22
+ onMouseEnter: g,
23
+ onMouseLeave: u,
24
+ ...m,
25
+ children: f
26
26
  }
27
27
  );
28
28
  }
29
29
  );
30
- w.displayName = t;
30
+ R.displayName = n;
31
31
  export {
32
- w as Trigger
32
+ R as Trigger
33
33
  };
@@ -1,7 +1,7 @@
1
1
  import { useContextMenu as t } from "./useContextMenu/useContextMenu.js";
2
2
  import { useContextMenuSubMenu as u } from "./useContextMenuSubMenu/useContextMenuSubMenu.js";
3
3
  import { useInheritedArrowColor as s } from "./useInheritedArrowColor/useInheritedArrowColor.js";
4
- import { u as m } from "../../../useContentPositioning-BIVWgixU.mjs";
4
+ import { u as m } from "../../../useContentPositioning-27D32n5u.mjs";
5
5
  import { useContextMenuSub as p } from "./useContextMenuSub/useContextMenuSub.js";
6
6
  import { useContextMenuItemFocus as i } from "./useContextMenuItemFocus/useContextMenuItemFocus.js";
7
7
  import { useIsTouchDevice as c } from "./useIsTouchDevice/useIsTouchDevice.js";
@@ -1 +1 @@
1
- {"version":3,"file":"useContentPositioning.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,WAAe,EACf,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,QAAQ,GACT,EAAE,4BAA4B;;;;EAoL9B"}
1
+ {"version":3,"file":"useContentPositioning.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,WAAe,EACf,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,QAAQ,GACT,EAAE,4BAA4B;;;;EAmM9B"}
@@ -1,5 +1,5 @@
1
1
  import "react";
2
- import { u as n } from "../../../../useContentPositioning-BIVWgixU.mjs";
2
+ import { u as n } from "../../../../useContentPositioning-27D32n5u.mjs";
3
3
  import "../../components/Content/Content.enums.js";
4
4
  import "../../components/Content/Content.utils.js";
5
5
  export {
@@ -4,6 +4,7 @@ export declare const useContextMenu: ({ mode: rootMode, defaultOpen, animationDu
4
4
  open: boolean;
5
5
  mode: ContextMenuMode;
6
6
  onOpenChange: (value: boolean) => void;
7
+ onOpenByKeyboard: (value: boolean) => void;
7
8
  inheritedArrowColor: string | null;
8
9
  triggerRef: import('react').RefObject<HTMLButtonElement>;
9
10
  contentRef: import('react').RefObject<HTMLDivElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"useContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,eAAO,MAAM,cAAc,iFAMxB,qBAAqB;;;0BA2EW,OAAO;;;;;;;;;;;;CA+HzC,CAAC"}
1
+ {"version":3,"file":"useContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,eAAO,MAAM,cAAc,iFAMxB,qBAAqB;;;0BA4EW,OAAO;8BA2BP,OAAO;;;;;;;;;;;;CAkIzC,CAAC"}
@@ -1,63 +1,73 @@
1
- import { useId as B, useState as f, useRef as m, useEffect as O } from "react";
2
- import { ContextMenuMode as u } from "../../ContextMenu.enums.js";
1
+ import { useId as k, useState as l, useRef as a, useEffect as V } from "react";
2
+ import { ContextMenuMode as o } from "../../ContextMenu.enums.js";
3
3
  import "../../providers/LevelProvider/LevelProvider.js";
4
- import { useInheritedArrowColor as S } from "../useInheritedArrowColor/useInheritedArrowColor.js";
5
- import "../../../../useContentPositioning-BIVWgixU.mjs";
4
+ import { useInheritedArrowColor as z } from "../useInheritedArrowColor/useInheritedArrowColor.js";
5
+ import "../../../../useContentPositioning-27D32n5u.mjs";
6
6
  import "../../components/Content/Content.utils.js";
7
7
  import "../../ContextMenu.context.js";
8
- import { useIsTouchDevice as j } from "../useIsTouchDevice/useIsTouchDevice.js";
9
- import { contextMenuBus as C } from "../../utils/contextMenuBus/contextMenuBus.js";
10
- const W = ({
11
- mode: V,
12
- defaultOpen: p,
13
- animationDuration: h,
14
- hoverCloseDelay: a,
8
+ import { useIsTouchDevice as D } from "../useIsTouchDevice/useIsTouchDevice.js";
9
+ import { contextMenuBus as b } from "../../utils/contextMenuBus/contextMenuBus.js";
10
+ const Z = ({
11
+ mode: g,
12
+ defaultOpen: h,
13
+ animationDuration: R,
14
+ hoverCloseDelay: d,
15
15
  onOpen: T
16
16
  }) => {
17
- const i = B(), [s, l] = f(p || !1), [g, c] = f(!1), [R, o] = f(!1), [r, d] = f(!1), x = m(null), I = m(null), e = m(null), n = m(null), t = j() ? u.CLICK : V, M = () => {
18
- e.current && (clearTimeout(e.current), e.current = null), n.current && (clearTimeout(n.current), n.current = null);
19
- }, v = () => {
20
- l(!1), o(!1), d(!1);
21
- }, E = () => {
22
- M(), t === u.HOVER || r ? (c(!1), n.current = setTimeout(() => {
23
- v();
24
- }, h)) : v();
17
+ const f = k(), [c, m] = l(h || !1), [x, u] = l(!1), [I, s] = l(!1), [M, p] = l(!1), [n, C] = l(!1), B = a(null), y = a(null), e = a(null), r = a(null), t = D() ? o.CLICK : g, E = () => {
18
+ e.current && (clearTimeout(e.current), e.current = null), r.current && (clearTimeout(r.current), r.current = null);
25
19
  }, H = () => {
26
- M(), c(!1), l(!1), o(!1), d(!1);
27
- }, L = (b) => {
28
- t === u.CLICK && p !== void 0 || (b ? (n.current && (clearTimeout(n.current), n.current = null), (t === u.HOVER || r) && c(!0), l(!0), T == null || T(!0), setTimeout(() => C.emit(i), 0)) : E());
20
+ m(!1), s(!1), C(!1);
21
+ }, v = () => {
22
+ E(), t === o.HOVER || n ? (u(!1), r.current = setTimeout(() => {
23
+ H();
24
+ }, R)) : H();
25
+ }, O = () => {
26
+ E(), u(!1), m(!1), s(!1), C(!1);
27
+ }, K = (i) => {
28
+ t === o.CLICK && h !== void 0 || (i ? (r.current && (clearTimeout(r.current), r.current = null), (t === o.HOVER || n) && u(!0), m(!0), T == null || T(!0), setTimeout(() => b.emit(f), 0)) : v());
29
+ }, L = (i) => {
30
+ p(i), K(i);
29
31
  }, A = () => {
30
- t !== u.HOVER && !r || (s ? o(!0) : (e.current && (clearTimeout(e.current), e.current = null), c(!0), l(!0), o(!0), setTimeout(() => C.emit(i), 0)));
32
+ t !== o.HOVER && !n || (p(!1), r.current && (clearTimeout(r.current), r.current = null, u(!0)), c ? s(!0) : (e.current && (clearTimeout(e.current), e.current = null), u(!0), m(!0), s(!0), setTimeout(() => b.emit(f), 0)));
31
33
  }, w = () => {
32
- t !== u.HOVER && !r || (e.current && (clearTimeout(e.current), e.current = null), o(!1));
33
- }, y = () => {
34
- c(!0), o(!0), d(!0);
34
+ t !== o.HOVER && !n || (p(!1), e.current && (clearTimeout(e.current), e.current = null), s(!1));
35
+ }, q = () => {
36
+ u(!0), s(!0), C(!0);
35
37
  };
36
- O(() => C.subscribe((q) => {
37
- q !== i && H();
38
- }), [i]), O(() => {
39
- !s || t !== u.HOVER && !r || (R ? e.current && (clearTimeout(e.current), e.current = null) : e.current || (e.current = setTimeout(() => {
40
- E();
41
- }, a)));
42
- }, [t, s, R, r, a]);
43
- const K = S(s, I);
38
+ V(() => b.subscribe((j) => {
39
+ j !== f && O();
40
+ }), [f]), V(() => {
41
+ !c || t !== o.HOVER && !n || M || (I ? e.current && (clearTimeout(e.current), e.current = null) : e.current || (e.current = setTimeout(() => {
42
+ v();
43
+ }, d)));
44
+ }, [
45
+ t,
46
+ c,
47
+ I,
48
+ n,
49
+ d,
50
+ M
51
+ ]);
52
+ const S = z(c, y);
44
53
  return {
45
- open: s,
54
+ open: c,
46
55
  mode: t,
47
- onOpenChange: L,
48
- inheritedArrowColor: K,
49
- triggerRef: x,
50
- contentRef: I,
51
- animatedOpen: g,
52
- animationDuration: h,
53
- hoverCloseDelay: a,
54
- temporaryHoverClose: r,
55
- closeMenuImmediately: H,
56
+ onOpenChange: K,
57
+ onOpenByKeyboard: L,
58
+ inheritedArrowColor: S,
59
+ triggerRef: B,
60
+ contentRef: y,
61
+ animatedOpen: x,
62
+ animationDuration: R,
63
+ hoverCloseDelay: d,
64
+ temporaryHoverClose: n,
65
+ closeMenuImmediately: O,
56
66
  onMouseEnter: A,
57
67
  onMouseLeave: w,
58
- enableTemporaryHoverClose: y
68
+ enableTemporaryHoverClose: q
59
69
  };
60
70
  };
61
71
  export {
62
- W as useContextMenu
72
+ Z as useContextMenu
63
73
  };
@@ -4,9 +4,10 @@ export declare function useContextMenuSub({ displayName, mode: initialMode, defa
4
4
  setOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
5
5
  animatedOpen: boolean;
6
6
  startAnimation: () => void;
7
- handleMouseEnter: (e: React.MouseEvent<HTMLElement>) => void;
8
- handleMouseLeave: (e: React.MouseEvent<HTMLElement>) => void;
9
- handleOpenChange: (val: boolean) => void;
7
+ handleMouseEnter: () => void;
8
+ handleMouseLeave: () => void;
9
+ handleOpenChange: (value: boolean) => void;
10
+ onOpenByKeyboard: (value: boolean) => void;
10
11
  triggerId: string;
11
12
  };
12
13
  //# sourceMappingURL=useContextMenuSub.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useContextMenuSub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,IAAI,EAAE,WAAW,EACjB,WAAW,GACZ,EAAE,wBAAwB;;;;;0BAoEnB,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;0BA+B7B,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;4BAyB3B,OAAO;;EA8EhB"}
1
+ {"version":3,"file":"useContextMenuSub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,IAAI,EAAE,WAAW,EACjB,WAAW,GACZ,EAAE,wBAAwB;;;;;;;8BAyEQ,OAAO;8BAmCP,OAAO;;EA4GzC"}