@kommo-crm/crm-react-ui-kit 1.1.1-beta.13 → 1.1.1-beta.14

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 (46) hide show
  1. package/dist/components/ContextMenu/ContextMenu.js +1 -1
  2. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +1 -1
  3. package/dist/components/ContextMenu/components/Content/Content.d.ts +1 -1
  4. package/dist/components/ContextMenu/components/Content/Content.d.ts.map +1 -1
  5. package/dist/components/ContextMenu/components/Content/Content.js +1 -1
  6. package/dist/components/ContextMenu/components/Content/Content.props.d.ts +5 -1
  7. package/dist/components/ContextMenu/components/Content/Content.props.d.ts.map +1 -1
  8. package/dist/components/ContextMenu/components/Content/index.js +1 -1
  9. package/dist/components/ContextMenu/components/FocusBlocker/FocusBlocker.js +1 -1
  10. package/dist/components/ContextMenu/components/FocusBlocker/index.js +1 -1
  11. package/dist/components/ContextMenu/components/Item/Item.js +1 -1
  12. package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.js +1 -1
  13. package/dist/components/ContextMenu/components/Label/Label.js +1 -1
  14. package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +1 -1
  15. package/dist/components/ContextMenu/components/Sub/Sub.js +1 -1
  16. package/dist/components/ContextMenu/components/SubContent/SubContent.d.ts +1 -0
  17. package/dist/components/ContextMenu/components/SubContent/SubContent.d.ts.map +1 -1
  18. package/dist/components/ContextMenu/components/SubContent/SubContent.js +60 -58
  19. package/dist/components/ContextMenu/components/SubContent/SubContent.props.d.ts +4 -0
  20. package/dist/components/ContextMenu/components/SubContent/SubContent.props.d.ts.map +1 -1
  21. package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +1 -1
  22. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.d.ts +1 -1
  23. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.d.ts.map +1 -1
  24. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +59 -57
  25. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +1 -1
  26. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +1 -1
  27. package/dist/components/ContextMenu/hooks/index.d.ts +1 -0
  28. package/dist/components/ContextMenu/hooks/index.d.ts.map +1 -1
  29. package/dist/components/ContextMenu/hooks/index.js +9 -7
  30. package/dist/components/ContextMenu/hooks/useChildrenWithBlocker/useChildrenWithBlocker.js +1 -1
  31. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts +1 -1
  32. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts.map +1 -1
  33. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +2 -1
  34. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.types.d.ts +4 -0
  35. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.types.d.ts.map +1 -1
  36. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +1 -1
  37. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +1 -1
  38. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +1 -1
  39. package/dist/components/ContextMenu/hooks/useItemInnerFocus/useItemInnerFocus.js +1 -1
  40. package/dist/components/ContextMenu/hooks/usePrevious/usePrevious.d.ts +2 -0
  41. package/dist/components/ContextMenu/hooks/usePrevious/usePrevious.d.ts.map +1 -0
  42. package/dist/components/ContextMenu/hooks/usePrevious/usePrevious.js +10 -0
  43. package/dist/components/ContextMenu/index.js +1 -1
  44. package/dist/useContentPositioning-CLU2E_Oz.mjs +2433 -0
  45. package/package.json +1 -1
  46. package/dist/useContentPositioning-BokVuzge.mjs +0 -2425
@@ -5,7 +5,7 @@ import { useContextMenu as G } from "./hooks/useContextMenu/useContextMenu.js";
5
5
  import "./providers/LevelProvider/LevelProvider.js";
6
6
  import "./providers/SubMenuProvider/SubMenuProvider.js";
7
7
  import { ContextMenuRootProvider as H, ContextMenuProvider as _, DISPLAY_NAME as W } from "./ContextMenu.context.js";
8
- import { C as Y, F as j } from "../../useContentPositioning-BokVuzge.mjs";
8
+ import { C as Y, F as j } from "../../useContentPositioning-CLU2E_Oz.mjs";
9
9
  import "./components/Content/Content.utils.js";
10
10
  import { Trigger as K } from "./components/Trigger/Trigger.js";
11
11
  import { Portal as U } from "./components/Portal/Portal.js";
@@ -5,7 +5,7 @@ import { c as S } from "../../../../index-L8X2o7IH.mjs";
5
5
  import { mergeRefs as T } from "../../../../lib/utils.js";
6
6
  import { useLevelContext as U } from "../../providers/LevelProvider/LevelProvider.js";
7
7
  import { hasItemIcon as V } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import "../../../../useContentPositioning-BokVuzge.mjs";
8
+ import "../../../../useContentPositioning-CLU2E_Oz.mjs";
9
9
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
10
10
  import { useContextMenuRootContext as X } from "../../ContextMenu.context.js";
11
11
  import "../Content/Content.utils.js";
@@ -272,7 +272,6 @@ export declare const Content: React.ForwardRefExoticComponent<{
272
272
  asChild?: boolean | undefined;
273
273
  side?: ("left" | "right" | "bottom" | "top") | undefined;
274
274
  sideOffset?: number | undefined;
275
- align?: ("center" | "end" | "start") | undefined;
276
275
  alignOffset?: number | undefined;
277
276
  arrowPadding?: number | undefined;
278
277
  collisionBoundary?: ((Element | null) | (Element | null)[]) | undefined;
@@ -298,5 +297,6 @@ export declare const Content: React.ForwardRefExoticComponent<{
298
297
  direction?: import('./Content.types').DirectionType;
299
298
  collisionBoundary?: Element;
300
299
  disableAutoPositioning?: boolean;
300
+ disableRepositioning?: boolean;
301
301
  } & React.RefAttributes<HTMLDivElement>>;
302
302
  //# sourceMappingURL=Content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA4BpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAoInB,CAAC"}
1
+ {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA4BpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAsInB,CAAC"}
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../../index-DmGLJEdp.mjs";
4
4
  import "../../../../index-L8X2o7IH.mjs";
5
- import { C as b } from "../../../../useContentPositioning-BokVuzge.mjs";
5
+ import { C as b } from "../../../../useContentPositioning-CLU2E_Oz.mjs";
6
6
  import "../../../../lib/utils.js";
7
7
  import "../../providers/LevelProvider/LevelProvider.js";
8
8
  import "../../ContextMenu.context.js";
@@ -1,7 +1,7 @@
1
1
  import { ComponentPropsWithoutRef } from 'react';
2
2
  import { Content as RadixDropdownMenuContent } from '@radix-ui/react-dropdown-menu';
3
3
  import { DirectionType } from './Content.types';
4
- type RadixContentProps = Omit<ComponentPropsWithoutRef<typeof RadixDropdownMenuContent>, 'avoidCollisions'>;
4
+ type RadixContentProps = Omit<ComponentPropsWithoutRef<typeof RadixDropdownMenuContent>, 'avoidCollisions' | 'align'>;
5
5
  export type ContentProps = RadixContentProps & {
6
6
  /**
7
7
  * Preferred opening direction for the menu.
@@ -22,6 +22,10 @@ export type ContentProps = RadixContentProps & {
22
22
  * such as server-side rendering or automated tests.
23
23
  */
24
24
  disableAutoPositioning?: boolean;
25
+ /**
26
+ * Whether to disable repositioning.
27
+ */
28
+ disableRepositioning?: boolean;
25
29
  };
26
30
  export interface ContextMenuContentContextProps {
27
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Content.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Content/Content.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,KAAK,iBAAiB,GAAG,IAAI,CAC3B,wBAAwB,CAAC,OAAO,wBAAwB,CAAC,EACzD,iBAAiB,CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG;IAC7C;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B"}
1
+ {"version":3,"file":"Content.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Content/Content.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,KAAK,iBAAiB,GAAG,IAAI,CAC3B,wBAAwB,CAAC,OAAO,wBAAwB,CAAC,EACzD,iBAAiB,GAAG,OAAO,CAC5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG;IAC7C;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B"}
@@ -1,4 +1,4 @@
1
- import { C as e } from "../../../../useContentPositioning-BokVuzge.mjs";
1
+ import { C as e } from "../../../../useContentPositioning-CLU2E_Oz.mjs";
2
2
  import { Direction as i } from "./Content.enums.js";
3
3
  import { directionToSide as f } from "./Content.utils.js";
4
4
  export {
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../../index-L8X2o7IH.mjs";
4
- import { F as a } from "../../../../useContentPositioning-BokVuzge.mjs";
4
+ import { F as a } from "../../../../useContentPositioning-CLU2E_Oz.mjs";
5
5
  import "../../providers/LevelProvider/LevelProvider.js";
6
6
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
7
7
  import "../../ContextMenu.context.js";
@@ -1,4 +1,4 @@
1
- import { F as c } from "../../../../useContentPositioning-BokVuzge.mjs";
1
+ import { F as c } from "../../../../useContentPositioning-CLU2E_Oz.mjs";
2
2
  export {
3
3
  c as FocusBlocker
4
4
  };
@@ -5,7 +5,7 @@ import { c as D } from "../../../../index-L8X2o7IH.mjs";
5
5
  import { mergeRefs as F } from "../../../../lib/utils.js";
6
6
  import { useLevelContext as V } from "../../providers/LevelProvider/LevelProvider.js";
7
7
  import { hasItemIcon as X } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import "../../../../useContentPositioning-BokVuzge.mjs";
8
+ import "../../../../useContentPositioning-CLU2E_Oz.mjs";
9
9
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
10
10
  import { useContextMenuRootContext as Z } from "../../ContextMenu.context.js";
11
11
  import "../Content/Content.utils.js";
@@ -2,7 +2,7 @@ import { jsx as b } from "react/jsx-runtime";
2
2
  import { forwardRef as v, useRef as E, useState as _, useEffect as y } from "react";
3
3
  import { c as H } from "../../../../index-L8X2o7IH.mjs";
4
4
  import { mergeRefs as I } from "../../../../lib/utils.js";
5
- import "../../../../useContentPositioning-BokVuzge.mjs";
5
+ import "../../../../useContentPositioning-CLU2E_Oz.mjs";
6
6
  import "../../providers/LevelProvider/LevelProvider.js";
7
7
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
8
8
  import "../../ContextMenu.context.js";
@@ -5,7 +5,7 @@ import { c as b } from "../../../../index-L8X2o7IH.mjs";
5
5
  import { mergeRefs as u } from "../../../../lib/utils.js";
6
6
  import { useLevelContext as d } from "../../providers/LevelProvider/LevelProvider.js";
7
7
  import { hasItemIcon as L } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import "../../../../useContentPositioning-BokVuzge.mjs";
8
+ import "../../../../useContentPositioning-CLU2E_Oz.mjs";
9
9
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
10
10
  import "../../ContextMenu.context.js";
11
11
  import "../Content/Content.utils.js";
@@ -5,7 +5,7 @@ import { c as z } from "../../../../index-L8X2o7IH.mjs";
5
5
  import { mergeRefs as J } from "../../../../lib/utils.js";
6
6
  import { useLevelContext as Q } from "../../providers/LevelProvider/LevelProvider.js";
7
7
  import { hasItemIcon as S } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import "../../../../useContentPositioning-BokVuzge.mjs";
8
+ import "../../../../useContentPositioning-CLU2E_Oz.mjs";
9
9
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
10
10
  import { useContextMenuRootContext as T } from "../../ContextMenu.context.js";
11
11
  import "../Content/Content.utils.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as R, useImperativeHandle as v } from "react";
3
3
  import { S as E } from "../../../../index-DmGLJEdp.mjs";
4
- import "../../../../useContentPositioning-BokVuzge.mjs";
4
+ import "../../../../useContentPositioning-CLU2E_Oz.mjs";
5
5
  import { ContextMenuMode as I } from "../../ContextMenu.enums.js";
6
6
  import "../../providers/LevelProvider/LevelProvider.js";
7
7
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export declare const SubContent: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-dropdown-menu').DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
3
3
  disableAutoPositioning?: boolean;
4
+ disableRepositioning?: boolean;
4
5
  } & React.RefAttributes<HTMLDivElement>>;
5
6
  //# sourceMappingURL=SubContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubContent/SubContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAqBrE,eAAO,MAAM,UAAU;;wCAyItB,CAAC"}
1
+ {"version":3,"file":"SubContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubContent/SubContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAqBrE,eAAO,MAAM,UAAU;;;wCA2ItB,CAAC"}
@@ -1,15 +1,15 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as M, useState as f, useLayoutEffect as C } from "react";
3
- import { c as T } from "../../../../index-DmGLJEdp.mjs";
4
- import { u as X, a as Y, e as B, b as J } from "../../../../useContentPositioning-BokVuzge.mjs";
5
- import { c as Q } from "../../../../index-L8X2o7IH.mjs";
6
- import { mergeRefs as U } from "../../../../lib/utils.js";
7
- import { useLevelContext as V, LevelProvider as Z } from "../../providers/LevelProvider/LevelProvider.js";
8
- import { useContextMenuSubContext as $ } from "../Sub/Sub.context.js";
9
- import { useContextMenuContext as w } from "../../ContextMenu.context.js";
10
- import '../../../../assets/SubContent.css';const D = "_sub_content_y6v65_1", E = {
11
- sub_content: D
12
- }, e = "ContextMenu.SubContent", K = M(
2
+ import { forwardRef as T, useState as f, useLayoutEffect as C } from "react";
3
+ import { c as X } from "../../../../index-DmGLJEdp.mjs";
4
+ import { u as Y, a as B, e as J, b as Q } from "../../../../useContentPositioning-CLU2E_Oz.mjs";
5
+ import { c as U } from "../../../../index-L8X2o7IH.mjs";
6
+ import { mergeRefs as V } from "../../../../lib/utils.js";
7
+ import { useLevelContext as Z, LevelProvider as $ } from "../../providers/LevelProvider/LevelProvider.js";
8
+ import { useContextMenuSubContext as w } from "../Sub/Sub.context.js";
9
+ import { useContextMenuContext as D } from "../../ContextMenu.context.js";
10
+ import '../../../../assets/SubContent.css';const E = "_sub_content_y6v65_1", K = {
11
+ sub_content: E
12
+ }, e = "ContextMenu.SubContent", tt = T(
13
13
  ({
14
14
  className: I,
15
15
  children: l,
@@ -19,84 +19,86 @@ import '../../../../assets/SubContent.css';const D = "_sub_content_y6v65_1", E =
19
19
  onMouseLeave: o,
20
20
  alignOffset: S,
21
21
  disableAutoPositioning: _ = !1,
22
- onEscapeKeyDown: i,
23
- ...x
24
- }, O) => {
25
- const [v, A] = f(null), {
26
- animatedOpen: s,
27
- startAnimation: R,
28
- onMouseEnter: r,
29
- onMouseLeave: a,
22
+ disableRepositioning: x = !1,
23
+ onEscapeKeyDown: s,
24
+ ...O
25
+ }, v) => {
26
+ const [A, R] = f(null), {
27
+ animatedOpen: i,
28
+ startAnimation: h,
29
+ onMouseEnter: a,
30
+ onMouseLeave: r,
30
31
  defaultOpen: u,
31
- isOpen: h,
32
- triggerRef: N,
32
+ isOpen: N,
33
+ triggerRef: P,
33
34
  contentRef: d,
34
- onChildOpen: P,
35
- onSubRootOpen: y,
35
+ onChildOpen: y,
36
+ onSubRootOpen: F,
36
37
  closeMenuImmediately: p,
37
- isCloseOnClick: F,
38
- shouldCloseRootMenuOnClick: k
39
- } = $(e), { animationDuration: W } = w(e), { level: j } = V(e), { offset: q } = X({
38
+ isCloseOnClick: k,
39
+ shouldCloseRootMenuOnClick: W
40
+ } = w(e), { animationDuration: j } = D(e), { level: q } = Z(e), { offset: z } = Y({
40
41
  alignOffset: S,
41
42
  disableAutoPositioning: _,
42
- triggerRef: N,
43
+ triggerRef: P,
43
44
  contentRef: d,
44
- children: l
45
- }), [z, G] = f(!1), [H, m] = f(!1);
45
+ children: l,
46
+ disableRepositioning: x
47
+ }), [G, H] = f(!1), [L, m] = f(!1);
46
48
  C(() => {
47
- R();
49
+ h();
48
50
  }, []), C(() => {
49
51
  let t;
50
- return s ? (m(!1), t = requestAnimationFrame(() => {
52
+ return i ? (m(!1), t = requestAnimationFrame(() => {
51
53
  m(!0);
52
54
  })) : m(!1), () => {
53
55
  t && cancelAnimationFrame(t);
54
56
  };
55
- }, [s]);
56
- const L = Y({
57
- opacity: H && s || u !== void 0 ? 1 : 0,
58
- config: u === void 0 ? { duration: W, easing: B.easeInOutCubic } : { duration: 0 }
57
+ }, [i]);
58
+ const M = B({
59
+ opacity: L && i || u !== void 0 ? 1 : 0,
60
+ config: u === void 0 ? { duration: j, easing: J.easeInOutCubic } : { duration: 0 }
59
61
  });
60
62
  return /* @__PURE__ */ c(
61
- Z,
63
+ $,
62
64
  {
63
- hasItemWithIcon: z,
64
- setHasItemWithIcon: G,
65
- activeItemId: v,
66
- setActiveItemId: A,
67
- onChildOpen: P,
68
- onSubRootOpen: y,
69
- isCloseOnClick: F,
65
+ hasItemWithIcon: G,
66
+ setHasItemWithIcon: H,
67
+ activeItemId: A,
68
+ setActiveItemId: R,
69
+ onChildOpen: y,
70
+ onSubRootOpen: F,
71
+ isCloseOnClick: k,
70
72
  closeMenuImmediately: p,
71
- shouldCloseRootMenuOnClick: k,
72
- level: j + 1,
73
- children: h && /* @__PURE__ */ c(
74
- J.div,
73
+ shouldCloseRootMenuOnClick: W,
74
+ level: q + 1,
75
+ children: N && /* @__PURE__ */ c(
76
+ Q.div,
75
77
  {
76
78
  style: {
77
79
  position: "fixed",
78
80
  zIndex: Number.MAX_SAFE_INTEGER - 10,
79
- ...L
81
+ ...M
80
82
  },
81
83
  onMouseEnter: (t) => {
82
- r == null || r(t), n == null || n(t);
84
+ a == null || a(t), n == null || n(t);
83
85
  },
84
86
  onMouseLeave: (t) => {
85
- a == null || a(t), o == null || o(t);
87
+ r == null || r(t), o == null || o(t);
86
88
  },
87
89
  "data-content-wrapper": !0,
88
90
  children: /* @__PURE__ */ c(
89
- T,
91
+ X,
90
92
  {
91
- ref: U(d, O),
92
- className: Q(E.sub_content, I),
93
+ ref: V(d, v),
94
+ className: U(K.sub_content, I),
93
95
  sideOffset: b,
94
96
  collisionPadding: g,
95
- alignOffset: q,
97
+ alignOffset: z,
96
98
  onEscapeKeyDown: (t) => {
97
- p(), i == null || i(t);
99
+ p(), s == null || s(t);
98
100
  },
99
- ...x,
101
+ ...O,
100
102
  children: l
101
103
  }
102
104
  )
@@ -106,7 +108,7 @@ import '../../../../assets/SubContent.css';const D = "_sub_content_y6v65_1", E =
106
108
  );
107
109
  }
108
110
  );
109
- K.displayName = e;
111
+ tt.displayName = e;
110
112
  export {
111
- K as SubContent
113
+ tt as SubContent
112
114
  };
@@ -5,5 +5,9 @@ export type SubContentProps = ComponentPropsWithoutRef<typeof RadixDropdownMenuS
5
5
  * Whether to disable auto positioning.
6
6
  */
7
7
  disableAutoPositioning?: boolean;
8
+ /**
9
+ * Whether to disable repositioning.
10
+ */
11
+ disableRepositioning?: boolean;
8
12
  };
9
13
  //# sourceMappingURL=SubContent.props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubContent.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubContent/SubContent.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE1F,MAAM,MAAM,eAAe,GAAG,wBAAwB,CACpD,OAAO,2BAA2B,CACnC,GAAG;IACF;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"SubContent.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubContent/SubContent.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE1F,MAAM,MAAM,eAAe,GAAG,wBAAwB,CACpD,OAAO,2BAA2B,CACnC,GAAG;IACF;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC"}
@@ -3,7 +3,7 @@ import { forwardRef as T, useImperativeHandle as j } from "react";
3
3
  import { R as k } from "../../../../index-DmGLJEdp.mjs";
4
4
  import { useContextMenuContext as w, ContextMenuProvider as B } from "../../ContextMenu.context.js";
5
5
  import { ContextMenuMode as F } from "../../ContextMenu.enums.js";
6
- import { F as L } from "../../../../useContentPositioning-BokVuzge.mjs";
6
+ import { F as L } from "../../../../useContentPositioning-CLU2E_Oz.mjs";
7
7
  import { useContextMenuSubMenu as P } from "../../hooks/useContextMenuSubMenu/useContextMenuSubMenu.js";
8
8
  import "../Content/Content.utils.js";
9
9
  import "../../providers/LevelProvider/LevelProvider.js";
@@ -272,7 +272,6 @@ export declare const Content: React.ForwardRefExoticComponent<{
272
272
  asChild?: boolean | undefined;
273
273
  side?: ("left" | "right" | "bottom" | "top") | undefined;
274
274
  sideOffset?: number | undefined;
275
- align?: ("center" | "end" | "start") | undefined;
276
275
  alignOffset?: number | undefined;
277
276
  arrowPadding?: number | undefined;
278
277
  collisionBoundary?: ((Element | null) | (Element | null)[]) | undefined;
@@ -298,5 +297,6 @@ export declare const Content: React.ForwardRefExoticComponent<{
298
297
  direction?: import('../../../Content').DirectionType;
299
298
  collisionBoundary?: Element;
300
299
  disableAutoPositioning?: boolean;
300
+ disableRepositioning?: boolean;
301
301
  } & React.RefAttributes<HTMLDivElement>>;
302
302
  //# sourceMappingURL=Content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/components/SubRoot/components/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA+BpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAgInB,CAAC"}
1
+ {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/components/SubRoot/components/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA+BpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAkInB,CAAC"}
@@ -1,19 +1,19 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as z, useState as O } from "react";
3
- import { g as F } from "../../../../../../index-DmGLJEdp.mjs";
4
- import { c as X } from "../../../../../../index-L8X2o7IH.mjs";
5
- import { u as Y, a as q, e as J, b as K } from "../../../../../../useContentPositioning-BokVuzge.mjs";
6
- import { mergeRefs as Q } from "../../../../../../lib/utils.js";
7
- import { useLevelContext as U, LevelProvider as V } from "../../../../providers/LevelProvider/LevelProvider.js";
8
- import { useContextMenuContext as Z } from "../../../../ContextMenu.context.js";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as F, useState as O } from "react";
3
+ import { g as X } from "../../../../../../index-DmGLJEdp.mjs";
4
+ import { c as Y } from "../../../../../../index-L8X2o7IH.mjs";
5
+ import { u as q, a as J, e as K, b as Q } from "../../../../../../useContentPositioning-CLU2E_Oz.mjs";
6
+ import { mergeRefs as U } from "../../../../../../lib/utils.js";
7
+ import { useLevelContext as V, LevelProvider as Z } from "../../../../providers/LevelProvider/LevelProvider.js";
8
+ import { useContextMenuContext as $ } from "../../../../ContextMenu.context.js";
9
9
  import { ContextMenuMode as R } from "../../../../ContextMenu.enums.js";
10
- import { focusParentItem as $ } from "../../../../utils/focusParentItem/focusParentItem.js";
10
+ import { focusParentItem as B } from "../../../../utils/focusParentItem/focusParentItem.js";
11
11
  import "../../../../providers/SubMenuProvider/SubMenuProvider.js";
12
- import { Direction as B } from "../../../Content/Content.enums.js";
13
- import { directionToSide as tt } from "../../../Content/Content.utils.js";
14
- import '../../../../../../assets/Content.css';const et = "_content_k9opk_1", ot = {
15
- content: et
16
- }, m = "ContextMenu.SubRoot.Content", nt = z(
12
+ import { Direction as tt } from "../../../Content/Content.enums.js";
13
+ import { directionToSide as et } from "../../../Content/Content.utils.js";
14
+ import '../../../../../../assets/Content.css';const ot = "_content_k9opk_1", nt = {
15
+ content: ot
16
+ }, m = "ContextMenu.SubRoot.Content", it = F(
17
17
  ({
18
18
  style: h,
19
19
  className: x,
@@ -21,86 +21,88 @@ import '../../../../../../assets/Content.css';const et = "_content_k9opk_1", ot
21
21
  alignOffset: v,
22
22
  arrowPadding: S = 5,
23
23
  collisionBoundary: c,
24
- direction: f = B.DOWN_RIGHT,
24
+ direction: f = tt.DOWN_RIGHT,
25
25
  disableAutoPositioning: l = !1,
26
+ disableRepositioning: _ = !1,
26
27
  onMouseEnter: e,
27
28
  onMouseLeave: o,
28
29
  onKeyDown: n,
29
- ..._
30
- }, k) => {
31
- const [N, y] = O(!1), [A, P] = O(null), {
30
+ ...k
31
+ }, N) => {
32
+ const [y, A] = O(!1), [P, b] = O(null), {
32
33
  triggerRef: p,
33
34
  contentRef: d,
34
- animatedOpen: b,
35
- animationDuration: H,
35
+ animatedOpen: H,
36
+ animationDuration: L,
36
37
  mode: C,
37
38
  temporaryHoverClose: u,
38
39
  onMouseEnter: i,
39
- onMouseLeave: r,
40
+ onMouseLeave: s,
40
41
  closeMenuImmediately: I,
41
- isOpen: L,
42
- onChildOpen: M,
43
- isCloseOnClick: T,
44
- shouldCloseRootMenuOnClick: W
45
- } = Z(m), { level: D } = U(m), { align: E, offset: G, isPositioned: g } = Y({
42
+ isOpen: M,
43
+ onChildOpen: T,
44
+ isCloseOnClick: W,
45
+ shouldCloseRootMenuOnClick: D
46
+ } = $(m), { level: E } = V(m), { align: G, offset: j, isPositioned: g } = q({
46
47
  direction: f,
47
48
  alignOffset: v,
48
49
  disableAutoPositioning: l,
49
50
  triggerRef: p,
50
51
  contentRef: d,
51
52
  collisionBoundary: c,
52
- children: a
53
- }), j = q({
54
- opacity: g && (C === R.CLICK && !u || b) ? 1 : 0,
55
- config: C === R.CLICK && !u ? { duration: 0 } : { duration: H, easing: J.easeInOutCubic }
56
- }), w = (t) => {
57
- t.key === "ArrowLeft" && (I(), $(p.current)), n == null || n(t);
53
+ children: a,
54
+ disableRepositioning: _
55
+ }), w = J({
56
+ opacity: g && (C === R.CLICK && !u || H) ? 1 : 0,
57
+ config: C === R.CLICK && !u ? { duration: 0 } : { duration: L, easing: K.easeInOutCubic }
58
+ }), z = (t) => {
59
+ t.key === "ArrowLeft" && (I(), B(p.current)), n == null || n(t);
58
60
  };
59
- return /* @__PURE__ */ s(
60
- V,
61
+ return /* @__PURE__ */ r(
62
+ Z,
61
63
  {
62
- hasItemWithIcon: N,
63
- setHasItemWithIcon: y,
64
- activeItemId: A,
65
- setActiveItemId: P,
66
- onChildOpen: M,
67
- isCloseOnClick: T,
64
+ hasItemWithIcon: y,
65
+ setHasItemWithIcon: A,
66
+ activeItemId: P,
67
+ setActiveItemId: b,
68
+ onChildOpen: T,
69
+ isCloseOnClick: W,
68
70
  closeMenuImmediately: I,
69
- shouldCloseRootMenuOnClick: W ?? !1,
70
- level: D + 1,
71
- children: L && /* @__PURE__ */ s(
72
- K.div,
71
+ shouldCloseRootMenuOnClick: D ?? !1,
72
+ level: E + 1,
73
+ children: M && /* @__PURE__ */ r(
74
+ Q.div,
73
75
  {
74
76
  style: {
75
77
  zIndex: Number.MAX_SAFE_INTEGER - 10,
76
78
  position: "fixed",
77
- ...j
79
+ ...w
78
80
  },
79
81
  "data-content-wrapper": !0,
80
- children: /* @__PURE__ */ s(
81
- F,
82
+ children: /* @__PURE__ */ r(
83
+ X,
82
84
  {
83
- ref: Q(d, k),
84
- className: X(ot.content, x),
85
+ ref: U(d, N),
86
+ className: Y(nt.content, x),
85
87
  style: {
86
88
  ...h || {},
87
89
  pointerEvents: l || g ? "auto" : "none"
88
90
  },
89
91
  collisionBoundary: c,
90
- side: tt[f],
91
- align: E,
92
+ side: et[f],
93
+ align: G,
92
94
  arrowPadding: S,
93
- alignOffset: G,
95
+ alignOffset: j,
94
96
  onMouseEnter: (t) => {
95
97
  i == null || i(t), e == null || e(t);
96
98
  },
97
99
  onMouseLeave: (t) => {
98
- r == null || r(t), o == null || o(t);
100
+ s == null || s(t), o == null || o(t);
99
101
  },
100
102
  onKeyDown: (t) => {
101
- w(t);
103
+ z(t);
102
104
  },
103
- ..._,
105
+ ...k,
104
106
  children: a
105
107
  }
106
108
  )
@@ -110,7 +112,7 @@ import '../../../../../../assets/Content.css';const et = "_content_k9opk_1", ot
110
112
  );
111
113
  }
112
114
  );
113
- nt.displayName = m;
115
+ it.displayName = m;
114
116
  export {
115
- nt as Content
117
+ it as Content
116
118
  };
@@ -5,7 +5,7 @@ import { c as b } from "../../../../../../index-L8X2o7IH.mjs";
5
5
  import { mergeRefs as L } from "../../../../../../lib/utils.js";
6
6
  import { useContextMenuContext as y } from "../../../../ContextMenu.context.js";
7
7
  import { ContextMenuMode as A } from "../../../../ContextMenu.enums.js";
8
- import "../../../../../../useContentPositioning-BokVuzge.mjs";
8
+ import "../../../../../../useContentPositioning-CLU2E_Oz.mjs";
9
9
  import "../../../../providers/LevelProvider/LevelProvider.js";
10
10
  import "../../../../providers/SubMenuProvider/SubMenuProvider.js";
11
11
  import "../../../Content/Content.utils.js";
@@ -6,7 +6,7 @@ import { mergeRefs as z } from "../../../../lib/utils.js";
6
6
  import { useLevelContext as G } from "../../providers/LevelProvider/LevelProvider.js";
7
7
  import { useContextMenuSubContext as J } from "../Sub/Sub.context.js";
8
8
  import { hasItemIcon as Q } from "../../utils/hasItemIcon/hasItemIcon.js";
9
- import "../../../../useContentPositioning-BokVuzge.mjs";
9
+ import "../../../../useContentPositioning-CLU2E_Oz.mjs";
10
10
  import { ContextMenuMode as r } from "../../ContextMenu.enums.js";
11
11
  import "../../providers/SubMenuProvider/SubMenuProvider.js";
12
12
  import "../../ContextMenu.context.js";
@@ -12,4 +12,5 @@ export { useInnerInputsFocus } from './useInnerInputsFocus/useInnerInputsFocus';
12
12
  export { useItemInnerFocus } from './useItemInnerFocus/useItemInnerFocus';
13
13
  export { useChildrenWithBlocker } from './useChildrenWithBlocker/useChildrenWithBlocker';
14
14
  export { useMouseMoveOutside } from './useMouseMoveOutside/useMouseMoveOutside';
15
+ export { usePrevious } from './usePrevious/usePrevious';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ContextMenu/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ContextMenu/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC"}