@code0-tech/pictor 0.0.0-mvp.30 → 0.0.0-mvp.32

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 (134) hide show
  1. package/dist/components/avatar/Avatar.js +7 -7
  2. package/dist/components/breadcrumb/Breadcrumb.js +4 -4
  3. package/dist/components/button/Button.js +8 -8
  4. package/dist/components/context-menu/ContextMenu.js +131 -131
  5. package/dist/components/d-flow/DFlow.edges.hook.js +22 -22
  6. package/dist/components/d-flow/DFlow.js +32 -32
  7. package/dist/components/d-flow/DFlow.nodes.hook.js +8 -8
  8. package/dist/components/d-flow-file/DFlowTabDefault.js +16 -16
  9. package/dist/components/d-flow-folder/DFlowFolder.js +13 -13
  10. package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +5 -5
  11. package/dist/components/d-flow-folder/DFlowFolderCreateDialog.js +13 -13
  12. package/dist/components/d-flow-folder/DFlowFolderDeleteDialog.js +5 -5
  13. package/dist/components/d-flow-folder/DFlowFolderRenameDialog.js +11 -11
  14. package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +7 -7
  15. package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +9 -9
  16. package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +12 -12
  17. package/dist/components/d-flow-input/DFlowInputDataType.js +16 -16
  18. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +8 -8
  19. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +4 -4
  20. package/dist/components/d-flow-panel/DFlowExport.js +5 -5
  21. package/dist/components/d-flow-panel/DFlowPanelControl.js +4 -4
  22. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +4 -4
  23. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +7 -7
  24. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +12 -12
  25. package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +5 -5
  26. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +4 -4
  27. package/dist/components/d-flow-validation/DNodeValidation.hook.js +3 -3
  28. package/dist/components/d-fullscreen/DFullScreen.js +2 -2
  29. package/dist/components/d-member/DNamespaceMemberList.js +5 -5
  30. package/dist/components/d-organization/DOrganizationList.js +7 -7
  31. package/dist/components/d-organization/DOrganizationMenu.js +5 -5
  32. package/dist/components/d-organization/DOrganizatonContent.js +22 -22
  33. package/dist/components/d-project/DNamespaceProjectContent.js +6 -6
  34. package/dist/components/d-project/DNamespaceProjectList.js +5 -5
  35. package/dist/components/d-project/DNamespaceProjectMenu.js +2 -2
  36. package/dist/components/d-role/DNamespaceRolePermissions.js +5 -5
  37. package/dist/components/d-runtime/DRuntimeList.js +7 -7
  38. package/dist/components/d-user/DUser.session.hook.js +2 -2
  39. package/dist/components/d-user/DUserContent.js +13 -13
  40. package/dist/components/d-user/DUserList.js +9 -9
  41. package/dist/components/form/CheckboxInput.js +4 -4
  42. package/dist/components/form/EmailInput.js +9 -9
  43. package/dist/components/form/Input.js +311 -230
  44. package/dist/components/form/Input.utils.js +1 -1
  45. package/dist/components/form/InputContentEditable.hook.d.ts +14 -2
  46. package/dist/components/form/InputContentEditable.hook.js +296 -317
  47. package/dist/components/form/NumberInput.js +9 -9
  48. package/dist/components/form/PasswordInput.js +2 -2
  49. package/dist/components/form/SwitchInput.js +7 -7
  50. package/dist/components/form/TextInput.js +6 -6
  51. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
  52. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
  53. package/dist/utils/objectStore.js +15 -15
  54. package/dist/utils/reactiveArrayService.js +10 -10
  55. package/package.json +19 -19
  56. package/dist/_virtual/_commonjsHelpers.js +0 -6
  57. package/dist/_virtual/index.js +0 -4
  58. package/dist/_virtual/index2.js +0 -4
  59. package/dist/_virtual/react-contenteditable.js +0 -7
  60. package/dist/_virtual/react-contenteditable2.js +0 -4
  61. package/dist/_virtual/react-dom-server-legacy.browser.development.js +0 -4
  62. package/dist/_virtual/react-dom-server-legacy.browser.production.js +0 -4
  63. package/dist/_virtual/react-dom-server.browser.development.js +0 -4
  64. package/dist/_virtual/react-dom-server.browser.production.js +0 -4
  65. package/dist/_virtual/react-is.development.js +0 -4
  66. package/dist/_virtual/react-is.production.min.js +0 -4
  67. package/dist/_virtual/server.browser.js +0 -5
  68. package/dist/_virtual/server.browser2.js +0 -4
  69. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -527
  70. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -402
  71. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -208
  72. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -136
  73. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
  74. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -9
  75. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -24
  76. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -48
  77. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -29
  78. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -53
  79. package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +0 -222
  80. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -10
  81. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -127
  82. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -17
  83. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -136
  84. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -13
  85. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -636
  86. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -219
  87. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -15
  88. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -70
  89. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -36
  90. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -183
  91. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -49
  92. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -10
  93. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -52
  94. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -14
  95. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
  96. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -27
  97. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
  98. package/dist/node_modules/fast-deep-equal/index.js +0 -31
  99. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -7
  100. package/dist/node_modules/object-assign/index.js +0 -49
  101. package/dist/node_modules/prop-types/checkPropTypes.js +0 -54
  102. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +0 -52
  103. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +0 -329
  104. package/dist/node_modules/prop-types/index.js +0 -17
  105. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -10
  106. package/dist/node_modules/prop-types/lib/has.js +0 -7
  107. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -87
  108. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -70
  109. package/dist/node_modules/prop-types/node_modules/react-is/index.js +0 -10
  110. package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +0 -132
  111. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -6235
  112. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +0 -4096
  113. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -6753
  114. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +0 -4645
  115. package/dist/node_modules/react-dom/server.browser.js +0 -15
  116. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -11
  117. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -112
  118. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -31
  119. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -16
  120. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -68
  121. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  122. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  123. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -71
  124. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -7
  125. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -25
  126. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -11
  127. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -15
  128. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -30
  129. package/dist/node_modules/tslib/tslib.es6.js +0 -27
  130. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -6
  131. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -26
  132. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -25
  133. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -18
  134. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -67
@@ -1,636 +0,0 @@
1
- import * as o from "react";
2
- import { composeEventHandlers as v } from "../../primitive/dist/index.js";
3
- import { createCollection as ze } from "../../react-collection/dist/index.js";
4
- import { composeRefs as Ze, useComposedRefs as D } from "../../react-compose-refs/dist/index.js";
5
- import { createContextScope as $e } from "../../react-context/dist/index.js";
6
- import { useDirection as qe } from "../../react-direction/dist/index.js";
7
- import { DismissableLayer as Je } from "../../react-dismissable-layer/dist/index.js";
8
- import { useFocusGuards as Qe } from "../../react-focus-guards/dist/index.js";
9
- import { FocusScope as et } from "../../react-focus-scope/dist/index.js";
10
- import { useId as de } from "../../react-id/dist/index.js";
11
- import { createPopperScope as pe, Root as me, Anchor as tt, Content as nt, Arrow as ot } from "../../react-popper/dist/index.js";
12
- import { Portal as rt } from "../../react-portal/dist/index.js";
13
- import { Presence as X } from "../../react-presence/dist/index.js";
14
- import { Primitive as N, dispatchDiscreteCustomEvent as ct } from "../../react-primitive/dist/index.js";
15
- import { createRovingFocusGroupScope as he, Item as at, Root as st } from "../../react-roving-focus/dist/index.js";
16
- import { createSlot as ut } from "../../react-slot/dist/index.js";
17
- import { useCallbackRef as q } from "../../react-use-callback-ref/dist/index.js";
18
- import { hideOthers as it } from "../../../aria-hidden/dist/es2015/index.js";
19
- import lt from "../../../react-remove-scroll/dist/es2015/Combination.js";
20
- import { jsx as s } from "react/jsx-runtime";
21
- var $ = ["Enter", " "], dt = ["ArrowDown", "PageUp", "Home"], Me = ["ArrowUp", "PageDown", "End"], ft = [...dt, ...Me], pt = {
22
- ltr: [...$, "ArrowRight"],
23
- rtl: [...$, "ArrowLeft"]
24
- }, mt = {
25
- ltr: ["ArrowLeft"],
26
- rtl: ["ArrowRight"]
27
- }, F = "Menu", [O, ht, Mt] = ze(F), [P, on] = $e(F, [
28
- Mt,
29
- pe,
30
- he
31
- ]), L = pe(), ve = he(), [Ce, R] = P(F), [vt, K] = P(F), ge = (e) => {
32
- const { __scopeMenu: n, open: t = !1, children: r, dir: u, onOpenChange: c, modal: d = !0 } = e, m = L(n), [h, p] = o.useState(null), l = o.useRef(!1), a = q(c), f = qe(u);
33
- return o.useEffect(() => {
34
- const g = () => {
35
- l.current = !0, document.addEventListener("pointerdown", M, { capture: !0, once: !0 }), document.addEventListener("pointermove", M, { capture: !0, once: !0 });
36
- }, M = () => l.current = !1;
37
- return document.addEventListener("keydown", g, { capture: !0 }), () => {
38
- document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", M, { capture: !0 }), document.removeEventListener("pointermove", M, { capture: !0 });
39
- };
40
- }, []), /* @__PURE__ */ s(me, { ...m, children: /* @__PURE__ */ s(
41
- Ce,
42
- {
43
- scope: n,
44
- open: t,
45
- onOpenChange: a,
46
- content: h,
47
- onContentChange: p,
48
- children: /* @__PURE__ */ s(
49
- vt,
50
- {
51
- scope: n,
52
- onClose: o.useCallback(() => a(!1), [a]),
53
- isUsingKeyboardRef: l,
54
- dir: f,
55
- modal: d,
56
- children: r
57
- }
58
- )
59
- }
60
- ) });
61
- };
62
- ge.displayName = F;
63
- var Ct = "MenuAnchor", J = o.forwardRef(
64
- (e, n) => {
65
- const { __scopeMenu: t, ...r } = e, u = L(t);
66
- return /* @__PURE__ */ s(tt, { ...u, ...r, ref: n });
67
- }
68
- );
69
- J.displayName = Ct;
70
- var Q = "MenuPortal", [gt, _e] = P(Q, {
71
- forceMount: void 0
72
- }), Re = (e) => {
73
- const { __scopeMenu: n, forceMount: t, children: r, container: u } = e, c = R(Q, n);
74
- return /* @__PURE__ */ s(gt, { scope: n, forceMount: t, children: /* @__PURE__ */ s(X, { present: t || c.open, children: /* @__PURE__ */ s(rt, { asChild: !0, container: u, children: r }) }) });
75
- };
76
- Re.displayName = Q;
77
- var _ = "MenuContent", [_t, ee] = P(_), Se = o.forwardRef(
78
- (e, n) => {
79
- const t = _e(_, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, c = R(_, e.__scopeMenu), d = K(_, e.__scopeMenu);
80
- return /* @__PURE__ */ s(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(X, { present: r || c.open, children: /* @__PURE__ */ s(O.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ s(Rt, { ...u, ref: n }) : /* @__PURE__ */ s(St, { ...u, ref: n }) }) }) });
81
- }
82
- ), Rt = o.forwardRef(
83
- (e, n) => {
84
- const t = R(_, e.__scopeMenu), r = o.useRef(null), u = D(n, r);
85
- return o.useEffect(() => {
86
- const c = r.current;
87
- if (c) return it(c);
88
- }, []), /* @__PURE__ */ s(
89
- te,
90
- {
91
- ...e,
92
- ref: u,
93
- trapFocus: t.open,
94
- disableOutsidePointerEvents: t.open,
95
- disableOutsideScroll: !0,
96
- onFocusOutside: v(
97
- e.onFocusOutside,
98
- (c) => c.preventDefault(),
99
- { checkForDefaultPrevented: !1 }
100
- ),
101
- onDismiss: () => t.onOpenChange(!1)
102
- }
103
- );
104
- }
105
- ), St = o.forwardRef((e, n) => {
106
- const t = R(_, e.__scopeMenu);
107
- return /* @__PURE__ */ s(
108
- te,
109
- {
110
- ...e,
111
- ref: n,
112
- trapFocus: !1,
113
- disableOutsidePointerEvents: !1,
114
- disableOutsideScroll: !1,
115
- onDismiss: () => t.onOpenChange(!1)
116
- }
117
- );
118
- }), Pt = ut("MenuContent.ScrollLock"), te = o.forwardRef(
119
- (e, n) => {
120
- const {
121
- __scopeMenu: t,
122
- loop: r = !1,
123
- trapFocus: u,
124
- onOpenAutoFocus: c,
125
- onCloseAutoFocus: d,
126
- disableOutsidePointerEvents: m,
127
- onEntryFocus: h,
128
- onEscapeKeyDown: p,
129
- onPointerDownOutside: l,
130
- onFocusOutside: a,
131
- onInteractOutside: f,
132
- onDismiss: g,
133
- disableOutsideScroll: M,
134
- ...E
135
- } = e, x = R(_, t), w = K(_, t), Ue = L(t), Be = ve(t), ae = ht(t), [Ve, se] = o.useState(null), G = o.useRef(null), Ye = D(n, G, x.onContentChange), U = o.useRef(0), B = o.useRef(""), Xe = o.useRef(0), H = o.useRef(null), ue = o.useRef("right"), W = o.useRef(0), je = M ? lt : o.Fragment, He = M ? { as: Pt, allowPinchZoom: !0 } : void 0, We = (i) => {
136
- const y = B.current + i, S = ae().filter((C) => !C.disabled), b = document.activeElement, z = S.find((C) => C.ref.current === b)?.textValue, Z = S.map((C) => C.textValue), ie = Nt(Z, y, z), T = S.find((C) => C.textValue === ie)?.ref.current;
137
- (function C(le) {
138
- B.current = le, window.clearTimeout(U.current), le !== "" && (U.current = window.setTimeout(() => C(""), 1e3));
139
- })(y), T && setTimeout(() => T.focus());
140
- };
141
- o.useEffect(() => () => window.clearTimeout(U.current), []), Qe();
142
- const I = o.useCallback((i) => ue.current === H.current?.side && Lt(i, H.current?.area), []);
143
- return /* @__PURE__ */ s(
144
- _t,
145
- {
146
- scope: t,
147
- searchRef: B,
148
- onItemEnter: o.useCallback(
149
- (i) => {
150
- I(i) && i.preventDefault();
151
- },
152
- [I]
153
- ),
154
- onItemLeave: o.useCallback(
155
- (i) => {
156
- I(i) || (G.current?.focus(), se(null));
157
- },
158
- [I]
159
- ),
160
- onTriggerLeave: o.useCallback(
161
- (i) => {
162
- I(i) && i.preventDefault();
163
- },
164
- [I]
165
- ),
166
- pointerGraceTimerRef: Xe,
167
- onPointerGraceIntentChange: o.useCallback((i) => {
168
- H.current = i;
169
- }, []),
170
- children: /* @__PURE__ */ s(je, { ...He, children: /* @__PURE__ */ s(
171
- et,
172
- {
173
- asChild: !0,
174
- trapped: u,
175
- onMountAutoFocus: v(c, (i) => {
176
- i.preventDefault(), G.current?.focus({ preventScroll: !0 });
177
- }),
178
- onUnmountAutoFocus: d,
179
- children: /* @__PURE__ */ s(
180
- Je,
181
- {
182
- asChild: !0,
183
- disableOutsidePointerEvents: m,
184
- onEscapeKeyDown: p,
185
- onPointerDownOutside: l,
186
- onFocusOutside: a,
187
- onInteractOutside: f,
188
- onDismiss: g,
189
- children: /* @__PURE__ */ s(
190
- st,
191
- {
192
- asChild: !0,
193
- ...Be,
194
- dir: w.dir,
195
- orientation: "vertical",
196
- loop: r,
197
- currentTabStopId: Ve,
198
- onCurrentTabStopIdChange: se,
199
- onEntryFocus: v(h, (i) => {
200
- w.isUsingKeyboardRef.current || i.preventDefault();
201
- }),
202
- preventScrollOnEntryFocus: !0,
203
- children: /* @__PURE__ */ s(
204
- nt,
205
- {
206
- role: "menu",
207
- "aria-orientation": "vertical",
208
- "data-state": Ge(x.open),
209
- "data-radix-menu-content": "",
210
- dir: w.dir,
211
- ...Ue,
212
- ...E,
213
- ref: Ye,
214
- style: { outline: "none", ...E.style },
215
- onKeyDown: v(E.onKeyDown, (i) => {
216
- const S = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, z = i.key.length === 1;
217
- S && (i.key === "Tab" && i.preventDefault(), !b && z && We(i.key));
218
- const Z = G.current;
219
- if (i.target !== Z || !ft.includes(i.key)) return;
220
- i.preventDefault();
221
- const T = ae().filter((C) => !C.disabled).map((C) => C.ref.current);
222
- Me.includes(i.key) && T.reverse(), kt(T);
223
- }),
224
- onBlur: v(e.onBlur, (i) => {
225
- i.currentTarget.contains(i.target) || (window.clearTimeout(U.current), B.current = "");
226
- }),
227
- onPointerMove: v(
228
- e.onPointerMove,
229
- k((i) => {
230
- const y = i.target, S = W.current !== i.clientX;
231
- if (i.currentTarget.contains(y) && S) {
232
- const b = i.clientX > W.current ? "right" : "left";
233
- ue.current = b, W.current = i.clientX;
234
- }
235
- })
236
- )
237
- }
238
- )
239
- }
240
- )
241
- }
242
- )
243
- }
244
- ) })
245
- }
246
- );
247
- }
248
- );
249
- Se.displayName = _;
250
- var Et = "MenuGroup", ne = o.forwardRef(
251
- (e, n) => {
252
- const { __scopeMenu: t, ...r } = e;
253
- return /* @__PURE__ */ s(N.div, { role: "group", ...r, ref: n });
254
- }
255
- );
256
- ne.displayName = Et;
257
- var wt = "MenuLabel", Pe = o.forwardRef(
258
- (e, n) => {
259
- const { __scopeMenu: t, ...r } = e;
260
- return /* @__PURE__ */ s(N.div, { ...r, ref: n });
261
- }
262
- );
263
- Pe.displayName = wt;
264
- var V = "MenuItem", fe = "menu.itemSelect", j = o.forwardRef(
265
- (e, n) => {
266
- const { disabled: t = !1, onSelect: r, ...u } = e, c = o.useRef(null), d = K(V, e.__scopeMenu), m = ee(V, e.__scopeMenu), h = D(n, c), p = o.useRef(!1), l = () => {
267
- const a = c.current;
268
- if (!t && a) {
269
- const f = new CustomEvent(fe, { bubbles: !0, cancelable: !0 });
270
- a.addEventListener(fe, (g) => r?.(g), { once: !0 }), ct(a, f), f.defaultPrevented ? p.current = !1 : d.onClose();
271
- }
272
- };
273
- return /* @__PURE__ */ s(
274
- Ee,
275
- {
276
- ...u,
277
- ref: h,
278
- disabled: t,
279
- onClick: v(e.onClick, l),
280
- onPointerDown: (a) => {
281
- e.onPointerDown?.(a), p.current = !0;
282
- },
283
- onPointerUp: v(e.onPointerUp, (a) => {
284
- p.current || a.currentTarget?.click();
285
- }),
286
- onKeyDown: v(e.onKeyDown, (a) => {
287
- const f = m.searchRef.current !== "";
288
- t || f && a.key === " " || $.includes(a.key) && (a.currentTarget.click(), a.preventDefault());
289
- })
290
- }
291
- );
292
- }
293
- );
294
- j.displayName = V;
295
- var Ee = o.forwardRef(
296
- (e, n) => {
297
- const { __scopeMenu: t, disabled: r = !1, textValue: u, ...c } = e, d = ee(V, t), m = ve(t), h = o.useRef(null), p = D(n, h), [l, a] = o.useState(!1), [f, g] = o.useState("");
298
- return o.useEffect(() => {
299
- const M = h.current;
300
- M && g((M.textContent ?? "").trim());
301
- }, [c.children]), /* @__PURE__ */ s(
302
- O.ItemSlot,
303
- {
304
- scope: t,
305
- disabled: r,
306
- textValue: u ?? f,
307
- children: /* @__PURE__ */ s(at, { asChild: !0, ...m, focusable: !r, children: /* @__PURE__ */ s(
308
- N.div,
309
- {
310
- role: "menuitem",
311
- "data-highlighted": l ? "" : void 0,
312
- "aria-disabled": r || void 0,
313
- "data-disabled": r ? "" : void 0,
314
- ...c,
315
- ref: p,
316
- onPointerMove: v(
317
- e.onPointerMove,
318
- k((M) => {
319
- r ? d.onItemLeave(M) : (d.onItemEnter(M), M.defaultPrevented || M.currentTarget.focus({ preventScroll: !0 }));
320
- })
321
- ),
322
- onPointerLeave: v(
323
- e.onPointerLeave,
324
- k((M) => d.onItemLeave(M))
325
- ),
326
- onFocus: v(e.onFocus, () => a(!0)),
327
- onBlur: v(e.onBlur, () => a(!1))
328
- }
329
- ) })
330
- }
331
- );
332
- }
333
- ), It = "MenuCheckboxItem", we = o.forwardRef(
334
- (e, n) => {
335
- const { checked: t = !1, onCheckedChange: r, ...u } = e;
336
- return /* @__PURE__ */ s(Te, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ s(
337
- j,
338
- {
339
- role: "menuitemcheckbox",
340
- "aria-checked": Y(t) ? "mixed" : t,
341
- ...u,
342
- ref: n,
343
- "data-state": ce(t),
344
- onSelect: v(
345
- u.onSelect,
346
- () => r?.(Y(t) ? !0 : !t),
347
- { checkForDefaultPrevented: !1 }
348
- )
349
- }
350
- ) });
351
- }
352
- );
353
- we.displayName = It;
354
- var Ie = "MenuRadioGroup", [yt, xt] = P(
355
- Ie,
356
- { value: void 0, onValueChange: () => {
357
- } }
358
- ), ye = o.forwardRef(
359
- (e, n) => {
360
- const { value: t, onValueChange: r, ...u } = e, c = q(r);
361
- return /* @__PURE__ */ s(yt, { scope: e.__scopeMenu, value: t, onValueChange: c, children: /* @__PURE__ */ s(ne, { ...u, ref: n }) });
362
- }
363
- );
364
- ye.displayName = Ie;
365
- var xe = "MenuRadioItem", be = o.forwardRef(
366
- (e, n) => {
367
- const { value: t, ...r } = e, u = xt(xe, e.__scopeMenu), c = t === u.value;
368
- return /* @__PURE__ */ s(Te, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ s(
369
- j,
370
- {
371
- role: "menuitemradio",
372
- "aria-checked": c,
373
- ...r,
374
- ref: n,
375
- "data-state": ce(c),
376
- onSelect: v(
377
- r.onSelect,
378
- () => u.onValueChange?.(t),
379
- { checkForDefaultPrevented: !1 }
380
- )
381
- }
382
- ) });
383
- }
384
- );
385
- be.displayName = xe;
386
- var oe = "MenuItemIndicator", [Te, bt] = P(
387
- oe,
388
- { checked: !1 }
389
- ), Ae = o.forwardRef(
390
- (e, n) => {
391
- const { __scopeMenu: t, forceMount: r, ...u } = e, c = bt(oe, t);
392
- return /* @__PURE__ */ s(
393
- X,
394
- {
395
- present: r || Y(c.checked) || c.checked === !0,
396
- children: /* @__PURE__ */ s(
397
- N.span,
398
- {
399
- ...u,
400
- ref: n,
401
- "data-state": ce(c.checked)
402
- }
403
- )
404
- }
405
- );
406
- }
407
- );
408
- Ae.displayName = oe;
409
- var Tt = "MenuSeparator", Oe = o.forwardRef(
410
- (e, n) => {
411
- const { __scopeMenu: t, ...r } = e;
412
- return /* @__PURE__ */ s(
413
- N.div,
414
- {
415
- role: "separator",
416
- "aria-orientation": "horizontal",
417
- ...r,
418
- ref: n
419
- }
420
- );
421
- }
422
- );
423
- Oe.displayName = Tt;
424
- var At = "MenuArrow", ke = o.forwardRef(
425
- (e, n) => {
426
- const { __scopeMenu: t, ...r } = e, u = L(t);
427
- return /* @__PURE__ */ s(ot, { ...u, ...r, ref: n });
428
- }
429
- );
430
- ke.displayName = At;
431
- var re = "MenuSub", [Ot, De] = P(re), Ne = (e) => {
432
- const { __scopeMenu: n, children: t, open: r = !1, onOpenChange: u } = e, c = R(re, n), d = L(n), [m, h] = o.useState(null), [p, l] = o.useState(null), a = q(u);
433
- return o.useEffect(() => (c.open === !1 && a(!1), () => a(!1)), [c.open, a]), /* @__PURE__ */ s(me, { ...d, children: /* @__PURE__ */ s(
434
- Ce,
435
- {
436
- scope: n,
437
- open: r,
438
- onOpenChange: a,
439
- content: p,
440
- onContentChange: l,
441
- children: /* @__PURE__ */ s(
442
- Ot,
443
- {
444
- scope: n,
445
- contentId: de(),
446
- triggerId: de(),
447
- trigger: m,
448
- onTriggerChange: h,
449
- children: t
450
- }
451
- )
452
- }
453
- ) });
454
- };
455
- Ne.displayName = re;
456
- var A = "MenuSubTrigger", Fe = o.forwardRef(
457
- (e, n) => {
458
- const t = R(A, e.__scopeMenu), r = K(A, e.__scopeMenu), u = De(A, e.__scopeMenu), c = ee(A, e.__scopeMenu), d = o.useRef(null), { pointerGraceTimerRef: m, onPointerGraceIntentChange: h } = c, p = { __scopeMenu: e.__scopeMenu }, l = o.useCallback(() => {
459
- d.current && window.clearTimeout(d.current), d.current = null;
460
- }, []);
461
- return o.useEffect(() => l, [l]), o.useEffect(() => {
462
- const a = m.current;
463
- return () => {
464
- window.clearTimeout(a), h(null);
465
- };
466
- }, [m, h]), /* @__PURE__ */ s(J, { asChild: !0, ...p, children: /* @__PURE__ */ s(
467
- Ee,
468
- {
469
- id: u.triggerId,
470
- "aria-haspopup": "menu",
471
- "aria-expanded": t.open,
472
- "aria-controls": u.contentId,
473
- "data-state": Ge(t.open),
474
- ...e,
475
- ref: Ze(n, u.onTriggerChange),
476
- onClick: (a) => {
477
- e.onClick?.(a), !(e.disabled || a.defaultPrevented) && (a.currentTarget.focus(), t.open || t.onOpenChange(!0));
478
- },
479
- onPointerMove: v(
480
- e.onPointerMove,
481
- k((a) => {
482
- c.onItemEnter(a), !a.defaultPrevented && !e.disabled && !t.open && !d.current && (c.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
483
- t.onOpenChange(!0), l();
484
- }, 100));
485
- })
486
- ),
487
- onPointerLeave: v(
488
- e.onPointerLeave,
489
- k((a) => {
490
- l();
491
- const f = t.content?.getBoundingClientRect();
492
- if (f) {
493
- const g = t.content?.dataset.side, M = g === "right", E = M ? -5 : 5, x = f[M ? "left" : "right"], w = f[M ? "right" : "left"];
494
- c.onPointerGraceIntentChange({
495
- area: [
496
- // Apply a bleed on clientX to ensure that our exit point is
497
- // consistently within polygon bounds
498
- { x: a.clientX + E, y: a.clientY },
499
- { x, y: f.top },
500
- { x: w, y: f.top },
501
- { x: w, y: f.bottom },
502
- { x, y: f.bottom }
503
- ],
504
- side: g
505
- }), window.clearTimeout(m.current), m.current = window.setTimeout(
506
- () => c.onPointerGraceIntentChange(null),
507
- 300
508
- );
509
- } else {
510
- if (c.onTriggerLeave(a), a.defaultPrevented) return;
511
- c.onPointerGraceIntentChange(null);
512
- }
513
- })
514
- ),
515
- onKeyDown: v(e.onKeyDown, (a) => {
516
- const f = c.searchRef.current !== "";
517
- e.disabled || f && a.key === " " || pt[r.dir].includes(a.key) && (t.onOpenChange(!0), t.content?.focus(), a.preventDefault());
518
- })
519
- }
520
- ) });
521
- }
522
- );
523
- Fe.displayName = A;
524
- var Le = "MenuSubContent", Ke = o.forwardRef(
525
- (e, n) => {
526
- const t = _e(_, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, c = R(_, e.__scopeMenu), d = K(_, e.__scopeMenu), m = De(Le, e.__scopeMenu), h = o.useRef(null), p = D(n, h);
527
- return /* @__PURE__ */ s(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(X, { present: r || c.open, children: /* @__PURE__ */ s(O.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(
528
- te,
529
- {
530
- id: m.contentId,
531
- "aria-labelledby": m.triggerId,
532
- ...u,
533
- ref: p,
534
- align: "start",
535
- side: d.dir === "rtl" ? "left" : "right",
536
- disableOutsidePointerEvents: !1,
537
- disableOutsideScroll: !1,
538
- trapFocus: !1,
539
- onOpenAutoFocus: (l) => {
540
- d.isUsingKeyboardRef.current && h.current?.focus(), l.preventDefault();
541
- },
542
- onCloseAutoFocus: (l) => l.preventDefault(),
543
- onFocusOutside: v(e.onFocusOutside, (l) => {
544
- l.target !== m.trigger && c.onOpenChange(!1);
545
- }),
546
- onEscapeKeyDown: v(e.onEscapeKeyDown, (l) => {
547
- d.onClose(), l.preventDefault();
548
- }),
549
- onKeyDown: v(e.onKeyDown, (l) => {
550
- const a = l.currentTarget.contains(l.target), f = mt[d.dir].includes(l.key);
551
- a && f && (c.onOpenChange(!1), m.trigger?.focus(), l.preventDefault());
552
- })
553
- }
554
- ) }) }) });
555
- }
556
- );
557
- Ke.displayName = Le;
558
- function Ge(e) {
559
- return e ? "open" : "closed";
560
- }
561
- function Y(e) {
562
- return e === "indeterminate";
563
- }
564
- function ce(e) {
565
- return Y(e) ? "indeterminate" : e ? "checked" : "unchecked";
566
- }
567
- function kt(e) {
568
- const n = document.activeElement;
569
- for (const t of e)
570
- if (t === n || (t.focus(), document.activeElement !== n)) return;
571
- }
572
- function Dt(e, n) {
573
- return e.map((t, r) => e[(n + r) % e.length]);
574
- }
575
- function Nt(e, n, t) {
576
- const u = n.length > 1 && Array.from(n).every((p) => p === n[0]) ? n[0] : n, c = t ? e.indexOf(t) : -1;
577
- let d = Dt(e, Math.max(c, 0));
578
- u.length === 1 && (d = d.filter((p) => p !== t));
579
- const h = d.find(
580
- (p) => p.toLowerCase().startsWith(u.toLowerCase())
581
- );
582
- return h !== t ? h : void 0;
583
- }
584
- function Ft(e, n) {
585
- const { x: t, y: r } = e;
586
- let u = !1;
587
- for (let c = 0, d = n.length - 1; c < n.length; d = c++) {
588
- const m = n[c], h = n[d], p = m.x, l = m.y, a = h.x, f = h.y;
589
- l > r != f > r && t < (a - p) * (r - l) / (f - l) + p && (u = !u);
590
- }
591
- return u;
592
- }
593
- function Lt(e, n) {
594
- if (!n) return !1;
595
- const t = { x: e.clientX, y: e.clientY };
596
- return Ft(t, n);
597
- }
598
- function k(e) {
599
- return (n) => n.pointerType === "mouse" ? e(n) : void 0;
600
- }
601
- var rn = ge, cn = J, an = Re, sn = Se, un = ne, ln = Pe, dn = j, fn = we, pn = ye, mn = be, hn = Ae, Mn = Oe, vn = ke, Cn = Ne, gn = Fe, _n = Ke;
602
- export {
603
- cn as Anchor,
604
- vn as Arrow,
605
- fn as CheckboxItem,
606
- sn as Content,
607
- un as Group,
608
- dn as Item,
609
- hn as ItemIndicator,
610
- ln as Label,
611
- ge as Menu,
612
- J as MenuAnchor,
613
- ke as MenuArrow,
614
- we as MenuCheckboxItem,
615
- Se as MenuContent,
616
- ne as MenuGroup,
617
- j as MenuItem,
618
- Ae as MenuItemIndicator,
619
- Pe as MenuLabel,
620
- Re as MenuPortal,
621
- ye as MenuRadioGroup,
622
- be as MenuRadioItem,
623
- Oe as MenuSeparator,
624
- Ne as MenuSub,
625
- Ke as MenuSubContent,
626
- Fe as MenuSubTrigger,
627
- an as Portal,
628
- pn as RadioGroup,
629
- mn as RadioItem,
630
- rn as Root,
631
- Mn as Separator,
632
- Cn as Sub,
633
- _n as SubContent,
634
- gn as SubTrigger,
635
- on as createMenuScope
636
- };