@dooherceg/tiptap-controlled-editor-with-table 0.0.7 → 0.0.8

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 (112) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +8 -0
  2. package/dist/_virtual/index.js +7 -0
  3. package/dist/assets/components/tiptap-node/blockquote-node/blockquote-node.css +1 -0
  4. package/dist/assets/components/tiptap-node/code-block-node/code-block-node.css +1 -0
  5. package/dist/assets/components/tiptap-node/heading-node/heading-node.css +1 -0
  6. package/dist/assets/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.css +1 -0
  7. package/dist/assets/components/tiptap-node/image-node/image-node.css +1 -0
  8. package/dist/assets/components/tiptap-node/list-node/list-node.css +1 -0
  9. package/dist/assets/components/tiptap-node/paragraph-node/paragraph-node.css +1 -0
  10. package/dist/assets/components/tiptap-templates/simple/simple-editor.css +1 -0
  11. package/dist/assets/{badge.css → components/tiptap-ui-primitive/badge/badge-colors.css} +1 -1
  12. package/dist/assets/components/tiptap-ui-primitive/badge/badge-group.css +1 -0
  13. package/dist/assets/components/tiptap-ui-primitive/badge/badge.css +1 -0
  14. package/dist/assets/{button.css → components/tiptap-ui-primitive/button/button-colors.css} +1 -1
  15. package/dist/assets/components/tiptap-ui-primitive/button/button-group.css +1 -0
  16. package/dist/assets/components/tiptap-ui-primitive/button/button.css +1 -0
  17. package/dist/assets/styles/_keyframe-animations.css +1 -0
  18. package/dist/assets/styles/_variables.css +1 -0
  19. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.js +6 -58
  20. package/dist/components/tiptap-node/image-upload-node/image-upload-node.js +4 -3
  21. package/dist/components/tiptap-templates/simple/simple-editor.js +159 -1898
  22. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.js +6 -5
  23. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.js +1 -1
  24. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.js +16 -16
  25. package/dist/components/tiptap-ui-primitive/badge/badge.js +19 -16
  26. package/dist/components/tiptap-ui-primitive/button/button.js +18 -15
  27. package/dist/components/tiptap-ui-primitive/card/card.js +13 -12
  28. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.js +39 -1012
  29. package/dist/components/tiptap-ui-primitive/input/input.js +7 -6
  30. package/dist/components/tiptap-ui-primitive/popover/popover.js +24 -233
  31. package/dist/components/tiptap-ui-primitive/separator/separator.js +9 -8
  32. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.js +2 -1
  33. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.js +84 -1330
  34. package/dist/hooks/use-throttled-callback.js +13 -108
  35. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +527 -0
  36. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +402 -0
  37. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +932 -0
  38. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +185 -0
  39. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +208 -0
  40. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  41. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
  42. package/dist/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  43. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  44. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
  45. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  46. package/dist/node_modules/@radix-ui/react-context/dist/index.js +53 -0
  47. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
  48. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  49. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +221 -0
  50. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  51. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  52. package/dist/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  53. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +636 -0
  54. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +239 -0
  55. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +219 -0
  56. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  57. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  58. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  59. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
  60. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
  61. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  62. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  63. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  64. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  65. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  66. package/dist/node_modules/@tiptap/extension-highlight/dist/index.js +84 -0
  67. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +57 -0
  68. package/dist/node_modules/@tiptap/extension-image/dist/index.js +128 -0
  69. package/dist/node_modules/@tiptap/extension-list/dist/index.js +713 -0
  70. package/dist/node_modules/@tiptap/extension-subscript/dist/index.js +40 -0
  71. package/dist/node_modules/@tiptap/extension-superscript/dist/index.js +40 -0
  72. package/dist/node_modules/@tiptap/extension-table/dist/index.js +380 -0
  73. package/dist/node_modules/@tiptap/extension-text-align/dist/index.js +46 -0
  74. package/dist/node_modules/@tiptap/extension-typography/dist/index.js +125 -0
  75. package/dist/node_modules/@tiptap/extensions/dist/index.js +288 -0
  76. package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
  77. package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
  78. package/dist/node_modules/lodash.throttle/index.js +95 -0
  79. package/dist/{index-Bqw9S4qP.js → node_modules/react-hotkeys-hook/packages/react-hotkeys-hook/dist/index.js} +57 -55
  80. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
  81. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
  82. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
  83. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
  84. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +68 -0
  85. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
  86. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
  87. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
  88. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
  89. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
  90. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
  91. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
  92. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
  93. package/dist/node_modules/tabbable/dist/index.esm.js +197 -0
  94. package/dist/node_modules/tslib/tslib.es6.js +27 -0
  95. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
  96. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
  97. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
  98. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
  99. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
  100. package/package.json +1 -1
  101. package/dist/Combination-CO0ZtURs.js +0 -1333
  102. package/dist/assets/simple-editor.css +0 -1
  103. package/dist/floating-ui.react-dom-DgOuULHo.js +0 -1334
  104. /package/dist/assets/{image-upload-node.css → components/tiptap-node/image-upload-node/image-upload-node.css} +0 -0
  105. /package/dist/assets/{color-highlight-button.css → components/tiptap-ui/color-highlight-button/color-highlight-button.css} +0 -0
  106. /package/dist/assets/{card.css → components/tiptap-ui-primitive/card/card.css} +0 -0
  107. /package/dist/assets/{dropdown-menu.css → components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.css} +0 -0
  108. /package/dist/assets/{input.css → components/tiptap-ui-primitive/input/input.css} +0 -0
  109. /package/dist/assets/{popover.css → components/tiptap-ui-primitive/popover/popover.css} +0 -0
  110. /package/dist/assets/{separator.css → components/tiptap-ui-primitive/separator/separator.css} +0 -0
  111. /package/dist/assets/{toolbar.css → components/tiptap-ui-primitive/toolbar/toolbar.css} +0 -0
  112. /package/dist/assets/{tooltip.css → components/tiptap-ui-primitive/tooltip/tooltip.css} +0 -0
@@ -1,1028 +1,55 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import L, { forwardRef as ge } from "react";
4
- import { a as ae, d as A, j as me, u as we, m as ce, P as O, e as g, b as W, c as Te, A as xn, f as se, k as Nn, i as An, F as On, D as Fn, C as kn, g as Gn, h as Ln, R as xe, n as Kn, o as Ne, l as $n } from "../../../Combination-CO0ZtURs.js";
5
- import { cn as Ae } from "../../../lib/tiptap-utils.js";
6
- import '../../../assets/dropdown-menu.css';function Oe(e) {
7
- const o = e + "CollectionProvider", [n, t] = ae(o), [r, s] = n(
8
- o,
9
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
- ), l = (R) => {
11
- const { scope: M, children: C } = R, E = L.useRef(null), h = L.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ c(r, { scope: M, itemMap: h, collectionRef: E, children: C });
13
- };
14
- l.displayName = o;
15
- const d = e + "CollectionSlot", m = me(d), f = L.forwardRef(
16
- (R, M) => {
17
- const { scope: C, children: E } = R, h = s(d, C), I = A(M, h.collectionRef);
18
- return /* @__PURE__ */ c(m, { ref: I, children: E });
19
- }
20
- );
21
- f.displayName = d;
22
- const i = e + "CollectionItemSlot", u = "data-radix-collection-item", v = me(i), _ = L.forwardRef(
23
- (R, M) => {
24
- const { scope: C, children: E, ...h } = R, I = L.useRef(null), N = A(M, I), y = s(i, C);
25
- return L.useEffect(() => (y.itemMap.set(I, { ref: I, ...h }), () => void y.itemMap.delete(I))), /* @__PURE__ */ c(v, { [u]: "", ref: N, children: E });
26
- }
27
- );
28
- _.displayName = i;
29
- function w(R) {
30
- const M = s(e + "CollectionConsumer", R);
31
- return L.useCallback(() => {
32
- const E = M.collectionRef.current;
33
- if (!E) return [];
34
- const h = Array.from(E.querySelectorAll(`[${u}]`));
35
- return Array.from(M.itemMap.values()).sort(
36
- (y, T) => h.indexOf(y.ref.current) - h.indexOf(T.ref.current)
37
- );
38
- }, [M.collectionRef, M.itemMap]);
39
- }
40
- return [
41
- { Provider: l, Slot: f, ItemSlot: _ },
42
- w,
43
- t
44
- ];
45
- }
46
- var Un = a.createContext(void 0);
47
- function Fe(e) {
48
- const o = a.useContext(Un);
49
- return e || o || "ltr";
50
- }
51
- var fe = "rovingFocusGroup.onEntryFocus", Bn = { bubbles: !1, cancelable: !0 }, Z = "RovingFocusGroup", [ve, ke, Vn] = Oe(Z), [Yn, Ge] = ae(
52
- Z,
53
- [Vn]
54
- ), [jn, Xn] = Yn(Z), Le = a.forwardRef(
55
- (e, o) => /* @__PURE__ */ c(ve.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(ve.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(Hn, { ...e, ref: o }) }) })
56
- );
57
- Le.displayName = Z;
58
- var Hn = a.forwardRef((e, o) => {
59
- const {
60
- __scopeRovingFocusGroup: n,
61
- orientation: t,
62
- loop: r = !1,
63
- dir: s,
64
- currentTabStopId: l,
65
- defaultCurrentTabStopId: d,
66
- onCurrentTabStopIdChange: m,
67
- onEntryFocus: f,
68
- preventScrollOnEntryFocus: i = !1,
69
- ...u
70
- } = e, v = a.useRef(null), _ = A(o, v), w = Fe(s), [R, M] = we({
71
- prop: l,
72
- defaultProp: d ?? null,
73
- onChange: m,
74
- caller: Z
75
- }), [C, E] = a.useState(!1), h = ce(f), I = ke(n), N = a.useRef(!1), [y, T] = a.useState(0);
76
- return a.useEffect(() => {
77
- const b = v.current;
78
- if (b)
79
- return b.addEventListener(fe, h), () => b.removeEventListener(fe, h);
80
- }, [h]), /* @__PURE__ */ c(
81
- jn,
82
- {
83
- scope: n,
84
- orientation: t,
85
- dir: w,
86
- loop: r,
87
- currentTabStopId: R,
88
- onItemFocus: a.useCallback(
89
- (b) => M(b),
90
- [M]
91
- ),
92
- onItemShiftTab: a.useCallback(() => E(!0), []),
93
- onFocusableItemAdd: a.useCallback(
94
- () => T((b) => b + 1),
95
- []
96
- ),
97
- onFocusableItemRemove: a.useCallback(
98
- () => T((b) => b - 1),
99
- []
100
- ),
101
- children: /* @__PURE__ */ c(
102
- O.div,
103
- {
104
- tabIndex: C || y === 0 ? -1 : 0,
105
- "data-orientation": t,
106
- ...u,
107
- ref: _,
108
- style: { outline: "none", ...e.style },
109
- onMouseDown: g(e.onMouseDown, () => {
110
- N.current = !0;
111
- }),
112
- onFocus: g(e.onFocus, (b) => {
113
- const $ = !N.current;
114
- if (b.target === b.currentTarget && $ && !C) {
115
- const k = new CustomEvent(fe, Bn);
116
- if (b.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
117
- const V = I().filter((x) => x.focusable), Y = V.find((x) => x.active), ne = V.find((x) => x.id === R), le = [Y, ne, ...V].filter(
118
- Boolean
119
- ).map((x) => x.ref.current);
120
- Ue(le, i);
121
- }
122
- }
123
- N.current = !1;
124
- }),
125
- onBlur: g(e.onBlur, () => E(!1))
126
- }
127
- )
128
- }
129
- );
130
- }), Ke = "RovingFocusGroupItem", $e = a.forwardRef(
131
- (e, o) => {
132
- const {
133
- __scopeRovingFocusGroup: n,
134
- focusable: t = !0,
135
- active: r = !1,
136
- tabStopId: s,
137
- children: l,
138
- ...d
139
- } = e, m = W(), f = s || m, i = Xn(Ke, n), u = i.currentTabStopId === f, v = ke(n), { onFocusableItemAdd: _, onFocusableItemRemove: w, currentTabStopId: R } = i;
140
- return a.useEffect(() => {
141
- if (t)
142
- return _(), () => w();
143
- }, [t, _, w]), /* @__PURE__ */ c(
144
- ve.ItemSlot,
145
- {
146
- scope: n,
147
- id: f,
148
- focusable: t,
149
- active: r,
150
- children: /* @__PURE__ */ c(
151
- O.span,
152
- {
153
- tabIndex: u ? 0 : -1,
154
- "data-orientation": i.orientation,
155
- ...d,
156
- ref: o,
157
- onMouseDown: g(e.onMouseDown, (M) => {
158
- t ? i.onItemFocus(f) : M.preventDefault();
159
- }),
160
- onFocus: g(e.onFocus, () => i.onItemFocus(f)),
161
- onKeyDown: g(e.onKeyDown, (M) => {
162
- if (M.key === "Tab" && M.shiftKey) {
163
- i.onItemShiftTab();
164
- return;
165
- }
166
- if (M.target !== M.currentTarget) return;
167
- const C = qn(M, i.orientation, i.dir);
168
- if (C !== void 0) {
169
- if (M.metaKey || M.ctrlKey || M.altKey || M.shiftKey) return;
170
- M.preventDefault();
171
- let h = v().filter((I) => I.focusable).map((I) => I.ref.current);
172
- if (C === "last") h.reverse();
173
- else if (C === "prev" || C === "next") {
174
- C === "prev" && h.reverse();
175
- const I = h.indexOf(M.currentTarget);
176
- h = i.loop ? Zn(h, I + 1) : h.slice(I + 1);
177
- }
178
- setTimeout(() => Ue(h));
179
- }
180
- }),
181
- children: typeof l == "function" ? l({ isCurrentTabStop: u, hasTabStop: R != null }) : l
182
- }
183
- )
184
- }
185
- );
186
- }
187
- );
188
- $e.displayName = Ke;
189
- var Wn = {
190
- ArrowLeft: "prev",
191
- ArrowUp: "prev",
192
- ArrowRight: "next",
193
- ArrowDown: "next",
194
- PageUp: "first",
195
- Home: "first",
196
- PageDown: "last",
197
- End: "last"
198
- };
199
- function zn(e, o) {
200
- return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
201
- }
202
- function qn(e, o, n) {
203
- const t = zn(e.key, n);
204
- if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(t)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(t)))
205
- return Wn[t];
206
- }
207
- function Ue(e, o = !1) {
208
- const n = document.activeElement;
209
- for (const t of e)
210
- if (t === n || (t.focus({ preventScroll: o }), document.activeElement !== n)) return;
211
- }
212
- function Zn(e, o) {
213
- return e.map((n, t) => e[(o + t) % e.length]);
214
- }
215
- var Jn = Le, Qn = $e, Me = ["Enter", " "], eo = ["ArrowDown", "PageUp", "Home"], Be = ["ArrowUp", "PageDown", "End"], no = [...eo, ...Be], oo = {
216
- ltr: [...Me, "ArrowRight"],
217
- rtl: [...Me, "ArrowLeft"]
218
- }, to = {
219
- ltr: ["ArrowLeft"],
220
- rtl: ["ArrowRight"]
221
- }, J = "Menu", [z, ro, ao] = Oe(J), [K, Ve] = ae(J, [
222
- ao,
223
- Te,
224
- Ge
225
- ]), Q = Te(), Ye = Ge(), [je, F] = K(J), [co, ee] = K(J), Xe = (e) => {
226
- const { __scopeMenu: o, open: n = !1, children: t, dir: r, onOpenChange: s, modal: l = !0 } = e, d = Q(o), [m, f] = a.useState(null), i = a.useRef(!1), u = ce(s), v = Fe(r);
227
- return a.useEffect(() => {
228
- const _ = () => {
229
- i.current = !0, document.addEventListener("pointerdown", w, { capture: !0, once: !0 }), document.addEventListener("pointermove", w, { capture: !0, once: !0 });
230
- }, w = () => i.current = !1;
231
- return document.addEventListener("keydown", _, { capture: !0 }), () => {
232
- document.removeEventListener("keydown", _, { capture: !0 }), document.removeEventListener("pointerdown", w, { capture: !0 }), document.removeEventListener("pointermove", w, { capture: !0 });
233
- };
234
- }, []), /* @__PURE__ */ c(xe, { ...d, children: /* @__PURE__ */ c(
235
- je,
236
- {
237
- scope: o,
238
- open: n,
239
- onOpenChange: u,
240
- content: m,
241
- onContentChange: f,
242
- children: /* @__PURE__ */ c(
243
- co,
244
- {
245
- scope: o,
246
- onClose: a.useCallback(() => u(!1), [u]),
247
- isUsingKeyboardRef: i,
248
- dir: v,
249
- modal: l,
250
- children: t
251
- }
252
- )
253
- }
254
- ) });
255
- };
256
- Xe.displayName = J;
257
- var so = "MenuAnchor", Ce = a.forwardRef(
258
- (e, o) => {
259
- const { __scopeMenu: n, ...t } = e, r = Q(n);
260
- return /* @__PURE__ */ c(xn, { ...r, ...t, ref: o });
261
- }
262
- );
263
- Ce.displayName = so;
264
- var he = "MenuPortal", [uo, He] = K(he, {
265
- forceMount: void 0
266
- }), We = (e) => {
267
- const { __scopeMenu: o, forceMount: n, children: t, container: r } = e, s = F(he, o);
268
- return /* @__PURE__ */ c(uo, { scope: o, forceMount: n, children: /* @__PURE__ */ c(se, { present: n || s.open, children: /* @__PURE__ */ c(Gn, { asChild: !0, container: r, children: t }) }) });
269
- };
270
- We.displayName = he;
271
- var P = "MenuContent", [io, _e] = K(P), ze = a.forwardRef(
272
- (e, o) => {
273
- const n = He(P, e.__scopeMenu), { forceMount: t = n.forceMount, ...r } = e, s = F(P, e.__scopeMenu), l = ee(P, e.__scopeMenu);
274
- return /* @__PURE__ */ c(z.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(se, { present: t || s.open, children: /* @__PURE__ */ c(z.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ c(lo, { ...r, ref: o }) : /* @__PURE__ */ c(po, { ...r, ref: o }) }) }) });
275
- }
276
- ), lo = a.forwardRef(
277
- (e, o) => {
278
- const n = F(P, e.__scopeMenu), t = a.useRef(null), r = A(o, t);
279
- return a.useEffect(() => {
280
- const s = t.current;
281
- if (s) return Ln(s);
282
- }, []), /* @__PURE__ */ c(
283
- Re,
284
- {
285
- ...e,
286
- ref: r,
287
- trapFocus: n.open,
288
- disableOutsidePointerEvents: n.open,
289
- disableOutsideScroll: !0,
290
- onFocusOutside: g(
291
- e.onFocusOutside,
292
- (s) => s.preventDefault(),
293
- { checkForDefaultPrevented: !1 }
294
- ),
295
- onDismiss: () => n.onOpenChange(!1)
296
- }
297
- );
298
- }
299
- ), po = a.forwardRef((e, o) => {
300
- const n = F(P, e.__scopeMenu);
301
- return /* @__PURE__ */ c(
302
- Re,
303
- {
304
- ...e,
305
- ref: o,
306
- trapFocus: !1,
307
- disableOutsidePointerEvents: !1,
308
- disableOutsideScroll: !1,
309
- onDismiss: () => n.onOpenChange(!1)
310
- }
311
- );
312
- }), fo = me("MenuContent.ScrollLock"), Re = a.forwardRef(
313
- (e, o) => {
314
- const {
315
- __scopeMenu: n,
316
- loop: t = !1,
317
- trapFocus: r,
318
- onOpenAutoFocus: s,
319
- onCloseAutoFocus: l,
320
- disableOutsidePointerEvents: d,
321
- onEntryFocus: m,
322
- onEscapeKeyDown: f,
323
- onPointerDownOutside: i,
324
- onFocusOutside: u,
325
- onInteractOutside: v,
326
- onDismiss: _,
327
- disableOutsideScroll: w,
328
- ...R
329
- } = e, M = F(P, n), C = ee(P, n), E = Q(n), h = Ye(n), I = ro(n), [N, y] = a.useState(null), T = a.useRef(null), b = A(o, T, M.onContentChange), $ = a.useRef(0), k = a.useRef(""), V = a.useRef(0), Y = a.useRef(null), ne = a.useRef("right"), oe = a.useRef(0), le = w ? An : a.Fragment, x = w ? { as: fo, allowPinchZoom: !0 } : void 0, Tn = (p) => {
330
- const B = k.current + p, G = I().filter((D) => !D.disabled), j = document.activeElement, de = G.find((D) => D.ref.current === j)?.textValue, pe = G.map((D) => D.textValue), De = bo(pe, B, de), X = G.find((D) => D.textValue === De)?.ref.current;
331
- (function D(Pe) {
332
- k.current = Pe, window.clearTimeout($.current), Pe !== "" && ($.current = window.setTimeout(() => D(""), 1e3));
333
- })(B), X && setTimeout(() => X.focus());
334
- };
335
- a.useEffect(() => () => window.clearTimeout($.current), []), Nn();
336
- const U = a.useCallback((p) => ne.current === Y.current?.side && Do(p, Y.current?.area), []);
337
- return /* @__PURE__ */ c(
338
- io,
339
- {
340
- scope: n,
341
- searchRef: k,
342
- onItemEnter: a.useCallback(
343
- (p) => {
344
- U(p) && p.preventDefault();
345
- },
346
- [U]
347
- ),
348
- onItemLeave: a.useCallback(
349
- (p) => {
350
- U(p) || (T.current?.focus(), y(null));
351
- },
352
- [U]
353
- ),
354
- onTriggerLeave: a.useCallback(
355
- (p) => {
356
- U(p) && p.preventDefault();
357
- },
358
- [U]
359
- ),
360
- pointerGraceTimerRef: V,
361
- onPointerGraceIntentChange: a.useCallback((p) => {
362
- Y.current = p;
363
- }, []),
364
- children: /* @__PURE__ */ c(le, { ...x, children: /* @__PURE__ */ c(
365
- On,
366
- {
367
- asChild: !0,
368
- trapped: r,
369
- onMountAutoFocus: g(s, (p) => {
370
- p.preventDefault(), T.current?.focus({ preventScroll: !0 });
371
- }),
372
- onUnmountAutoFocus: l,
373
- children: /* @__PURE__ */ c(
374
- Fn,
375
- {
376
- asChild: !0,
377
- disableOutsidePointerEvents: d,
378
- onEscapeKeyDown: f,
379
- onPointerDownOutside: i,
380
- onFocusOutside: u,
381
- onInteractOutside: v,
382
- onDismiss: _,
383
- children: /* @__PURE__ */ c(
384
- Jn,
385
- {
386
- asChild: !0,
387
- ...h,
388
- dir: C.dir,
389
- orientation: "vertical",
390
- loop: t,
391
- currentTabStopId: N,
392
- onCurrentTabStopIdChange: y,
393
- onEntryFocus: g(m, (p) => {
394
- C.isUsingKeyboardRef.current || p.preventDefault();
395
- }),
396
- preventScrollOnEntryFocus: !0,
397
- children: /* @__PURE__ */ c(
398
- kn,
399
- {
400
- role: "menu",
401
- "aria-orientation": "vertical",
402
- "data-state": fn(M.open),
403
- "data-radix-menu-content": "",
404
- dir: C.dir,
405
- ...E,
406
- ...R,
407
- ref: b,
408
- style: { outline: "none", ...R.style },
409
- onKeyDown: g(R.onKeyDown, (p) => {
410
- const G = p.target.closest("[data-radix-menu-content]") === p.currentTarget, j = p.ctrlKey || p.altKey || p.metaKey, de = p.key.length === 1;
411
- G && (p.key === "Tab" && p.preventDefault(), !j && de && Tn(p.key));
412
- const pe = T.current;
413
- if (p.target !== pe || !no.includes(p.key)) return;
414
- p.preventDefault();
415
- const X = I().filter((D) => !D.disabled).map((D) => D.ref.current);
416
- Be.includes(p.key) && X.reverse(), Io(X);
417
- }),
418
- onBlur: g(e.onBlur, (p) => {
419
- p.currentTarget.contains(p.target) || (window.clearTimeout($.current), k.current = "");
420
- }),
421
- onPointerMove: g(
422
- e.onPointerMove,
423
- q((p) => {
424
- const B = p.target, G = oe.current !== p.clientX;
425
- if (p.currentTarget.contains(B) && G) {
426
- const j = p.clientX > oe.current ? "right" : "left";
427
- ne.current = j, oe.current = p.clientX;
428
- }
429
- })
430
- )
431
- }
432
- )
433
- }
434
- )
435
- }
436
- )
437
- }
438
- ) })
439
- }
440
- );
441
- }
442
- );
443
- ze.displayName = P;
444
- var mo = "MenuGroup", Ie = a.forwardRef(
445
- (e, o) => {
446
- const { __scopeMenu: n, ...t } = e;
447
- return /* @__PURE__ */ c(O.div, { role: "group", ...t, ref: o });
448
- }
449
- );
450
- Ie.displayName = mo;
451
- var vo = "MenuLabel", qe = a.forwardRef(
452
- (e, o) => {
453
- const { __scopeMenu: n, ...t } = e;
454
- return /* @__PURE__ */ c(O.div, { ...t, ref: o });
455
- }
456
- );
457
- qe.displayName = vo;
458
- var te = "MenuItem", ye = "menu.itemSelect", ue = a.forwardRef(
459
- (e, o) => {
460
- const { disabled: n = !1, onSelect: t, ...r } = e, s = a.useRef(null), l = ee(te, e.__scopeMenu), d = _e(te, e.__scopeMenu), m = A(o, s), f = a.useRef(!1), i = () => {
461
- const u = s.current;
462
- if (!n && u) {
463
- const v = new CustomEvent(ye, { bubbles: !0, cancelable: !0 });
464
- u.addEventListener(ye, (_) => t?.(_), { once: !0 }), Kn(u, v), v.defaultPrevented ? f.current = !1 : l.onClose();
465
- }
466
- };
467
- return /* @__PURE__ */ c(
468
- Ze,
469
- {
470
- ...r,
471
- ref: m,
472
- disabled: n,
473
- onClick: g(e.onClick, i),
474
- onPointerDown: (u) => {
475
- e.onPointerDown?.(u), f.current = !0;
476
- },
477
- onPointerUp: g(e.onPointerUp, (u) => {
478
- f.current || u.currentTarget?.click();
479
- }),
480
- onKeyDown: g(e.onKeyDown, (u) => {
481
- const v = d.searchRef.current !== "";
482
- n || v && u.key === " " || Me.includes(u.key) && (u.currentTarget.click(), u.preventDefault());
483
- })
484
- }
485
- );
486
- }
487
- );
488
- ue.displayName = te;
489
- var Ze = a.forwardRef(
490
- (e, o) => {
491
- const { __scopeMenu: n, disabled: t = !1, textValue: r, ...s } = e, l = _e(te, n), d = Ye(n), m = a.useRef(null), f = A(o, m), [i, u] = a.useState(!1), [v, _] = a.useState("");
492
- return a.useEffect(() => {
493
- const w = m.current;
494
- w && _((w.textContent ?? "").trim());
495
- }, [s.children]), /* @__PURE__ */ c(
496
- z.ItemSlot,
497
- {
498
- scope: n,
499
- disabled: t,
500
- textValue: r ?? v,
501
- children: /* @__PURE__ */ c(Qn, { asChild: !0, ...d, focusable: !t, children: /* @__PURE__ */ c(
502
- O.div,
503
- {
504
- role: "menuitem",
505
- "data-highlighted": i ? "" : void 0,
506
- "aria-disabled": t || void 0,
507
- "data-disabled": t ? "" : void 0,
508
- ...s,
509
- ref: f,
510
- onPointerMove: g(
511
- e.onPointerMove,
512
- q((w) => {
513
- t ? l.onItemLeave(w) : (l.onItemEnter(w), w.defaultPrevented || w.currentTarget.focus({ preventScroll: !0 }));
514
- })
515
- ),
516
- onPointerLeave: g(
517
- e.onPointerLeave,
518
- q((w) => l.onItemLeave(w))
519
- ),
520
- onFocus: g(e.onFocus, () => u(!0)),
521
- onBlur: g(e.onBlur, () => u(!1))
522
- }
523
- ) })
524
- }
525
- );
526
- }
527
- ), Mo = "MenuCheckboxItem", Je = a.forwardRef(
528
- (e, o) => {
529
- const { checked: n = !1, onCheckedChange: t, ...r } = e;
530
- return /* @__PURE__ */ c(tn, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ c(
531
- ue,
532
- {
533
- role: "menuitemcheckbox",
534
- "aria-checked": re(n) ? "mixed" : n,
535
- ...r,
536
- ref: o,
537
- "data-state": Ee(n),
538
- onSelect: g(
539
- r.onSelect,
540
- () => t?.(re(n) ? !0 : !n),
541
- { checkForDefaultPrevented: !1 }
542
- )
543
- }
544
- ) });
545
- }
546
- );
547
- Je.displayName = Mo;
548
- var Qe = "MenuRadioGroup", [go, wo] = K(
549
- Qe,
550
- { value: void 0, onValueChange: () => {
551
- } }
552
- ), en = a.forwardRef(
553
- (e, o) => {
554
- const { value: n, onValueChange: t, ...r } = e, s = ce(t);
555
- return /* @__PURE__ */ c(go, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ c(Ie, { ...r, ref: o }) });
556
- }
557
- );
558
- en.displayName = Qe;
559
- var nn = "MenuRadioItem", on = a.forwardRef(
560
- (e, o) => {
561
- const { value: n, ...t } = e, r = wo(nn, e.__scopeMenu), s = n === r.value;
562
- return /* @__PURE__ */ c(tn, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ c(
563
- ue,
564
- {
565
- role: "menuitemradio",
566
- "aria-checked": s,
567
- ...t,
568
- ref: o,
569
- "data-state": Ee(s),
570
- onSelect: g(
571
- t.onSelect,
572
- () => r.onValueChange?.(n),
573
- { checkForDefaultPrevented: !1 }
574
- )
575
- }
576
- ) });
577
- }
578
- );
579
- on.displayName = nn;
580
- var Se = "MenuItemIndicator", [tn, Co] = K(
581
- Se,
582
- { checked: !1 }
583
- ), rn = a.forwardRef(
584
- (e, o) => {
585
- const { __scopeMenu: n, forceMount: t, ...r } = e, s = Co(Se, n);
586
- return /* @__PURE__ */ c(
587
- se,
588
- {
589
- present: t || re(s.checked) || s.checked === !0,
590
- children: /* @__PURE__ */ c(
591
- O.span,
592
- {
593
- ...r,
594
- ref: o,
595
- "data-state": Ee(s.checked)
596
- }
597
- )
598
- }
599
- );
600
- }
601
- );
602
- rn.displayName = Se;
603
- var ho = "MenuSeparator", an = a.forwardRef(
604
- (e, o) => {
605
- const { __scopeMenu: n, ...t } = e;
606
- return /* @__PURE__ */ c(
607
- O.div,
608
- {
609
- role: "separator",
610
- "aria-orientation": "horizontal",
611
- ...t,
612
- ref: o
613
- }
614
- );
615
- }
616
- );
617
- an.displayName = ho;
618
- var _o = "MenuArrow", cn = a.forwardRef(
619
- (e, o) => {
620
- const { __scopeMenu: n, ...t } = e, r = Q(n);
621
- return /* @__PURE__ */ c($n, { ...r, ...t, ref: o });
622
- }
623
- );
624
- cn.displayName = _o;
625
- var be = "MenuSub", [Ro, sn] = K(be), un = (e) => {
626
- const { __scopeMenu: o, children: n, open: t = !1, onOpenChange: r } = e, s = F(be, o), l = Q(o), [d, m] = a.useState(null), [f, i] = a.useState(null), u = ce(r);
627
- return a.useEffect(() => (s.open === !1 && u(!1), () => u(!1)), [s.open, u]), /* @__PURE__ */ c(xe, { ...l, children: /* @__PURE__ */ c(
628
- je,
629
- {
630
- scope: o,
631
- open: t,
632
- onOpenChange: u,
633
- content: f,
634
- onContentChange: i,
635
- children: /* @__PURE__ */ c(
636
- Ro,
637
- {
638
- scope: o,
639
- contentId: W(),
640
- triggerId: W(),
641
- trigger: d,
642
- onTriggerChange: m,
643
- children: n
644
- }
645
- )
646
- }
647
- ) });
648
- };
649
- un.displayName = be;
650
- var H = "MenuSubTrigger", ln = a.forwardRef(
651
- (e, o) => {
652
- const n = F(H, e.__scopeMenu), t = ee(H, e.__scopeMenu), r = sn(H, e.__scopeMenu), s = _e(H, e.__scopeMenu), l = a.useRef(null), { pointerGraceTimerRef: d, onPointerGraceIntentChange: m } = s, f = { __scopeMenu: e.__scopeMenu }, i = a.useCallback(() => {
653
- l.current && window.clearTimeout(l.current), l.current = null;
654
- }, []);
655
- return a.useEffect(() => i, [i]), a.useEffect(() => {
656
- const u = d.current;
657
- return () => {
658
- window.clearTimeout(u), m(null);
659
- };
660
- }, [d, m]), /* @__PURE__ */ c(Ce, { asChild: !0, ...f, children: /* @__PURE__ */ c(
661
- Ze,
662
- {
663
- id: r.triggerId,
664
- "aria-haspopup": "menu",
665
- "aria-expanded": n.open,
666
- "aria-controls": r.contentId,
667
- "data-state": fn(n.open),
668
- ...e,
669
- ref: Ne(o, r.onTriggerChange),
670
- onClick: (u) => {
671
- e.onClick?.(u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), n.open || n.onOpenChange(!0));
672
- },
673
- onPointerMove: g(
674
- e.onPointerMove,
675
- q((u) => {
676
- s.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !l.current && (s.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
677
- n.onOpenChange(!0), i();
678
- }, 100));
679
- })
680
- ),
681
- onPointerLeave: g(
682
- e.onPointerLeave,
683
- q((u) => {
684
- i();
685
- const v = n.content?.getBoundingClientRect();
686
- if (v) {
687
- const _ = n.content?.dataset.side, w = _ === "right", R = w ? -5 : 5, M = v[w ? "left" : "right"], C = v[w ? "right" : "left"];
688
- s.onPointerGraceIntentChange({
689
- area: [
690
- // Apply a bleed on clientX to ensure that our exit point is
691
- // consistently within polygon bounds
692
- { x: u.clientX + R, y: u.clientY },
693
- { x: M, y: v.top },
694
- { x: C, y: v.top },
695
- { x: C, y: v.bottom },
696
- { x: M, y: v.bottom }
697
- ],
698
- side: _
699
- }), window.clearTimeout(d.current), d.current = window.setTimeout(
700
- () => s.onPointerGraceIntentChange(null),
701
- 300
702
- );
703
- } else {
704
- if (s.onTriggerLeave(u), u.defaultPrevented) return;
705
- s.onPointerGraceIntentChange(null);
706
- }
707
- })
708
- ),
709
- onKeyDown: g(e.onKeyDown, (u) => {
710
- const v = s.searchRef.current !== "";
711
- e.disabled || v && u.key === " " || oo[t.dir].includes(u.key) && (n.onOpenChange(!0), n.content?.focus(), u.preventDefault());
712
- })
713
- }
714
- ) });
715
- }
716
- );
717
- ln.displayName = H;
718
- var dn = "MenuSubContent", pn = a.forwardRef(
719
- (e, o) => {
720
- const n = He(P, e.__scopeMenu), { forceMount: t = n.forceMount, ...r } = e, s = F(P, e.__scopeMenu), l = ee(P, e.__scopeMenu), d = sn(dn, e.__scopeMenu), m = a.useRef(null), f = A(o, m);
721
- return /* @__PURE__ */ c(z.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(se, { present: t || s.open, children: /* @__PURE__ */ c(z.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(
722
- Re,
723
- {
724
- id: d.contentId,
725
- "aria-labelledby": d.triggerId,
726
- ...r,
727
- ref: f,
728
- align: "start",
729
- side: l.dir === "rtl" ? "left" : "right",
730
- disableOutsidePointerEvents: !1,
731
- disableOutsideScroll: !1,
732
- trapFocus: !1,
733
- onOpenAutoFocus: (i) => {
734
- l.isUsingKeyboardRef.current && m.current?.focus(), i.preventDefault();
735
- },
736
- onCloseAutoFocus: (i) => i.preventDefault(),
737
- onFocusOutside: g(e.onFocusOutside, (i) => {
738
- i.target !== d.trigger && s.onOpenChange(!1);
739
- }),
740
- onEscapeKeyDown: g(e.onEscapeKeyDown, (i) => {
741
- l.onClose(), i.preventDefault();
742
- }),
743
- onKeyDown: g(e.onKeyDown, (i) => {
744
- const u = i.currentTarget.contains(i.target), v = to[l.dir].includes(i.key);
745
- u && v && (s.onOpenChange(!1), d.trigger?.focus(), i.preventDefault());
746
- })
747
- }
748
- ) }) }) });
749
- }
750
- );
751
- pn.displayName = dn;
752
- function fn(e) {
753
- return e ? "open" : "closed";
754
- }
755
- function re(e) {
756
- return e === "indeterminate";
757
- }
758
- function Ee(e) {
759
- return re(e) ? "indeterminate" : e ? "checked" : "unchecked";
760
- }
761
- function Io(e) {
762
- const o = document.activeElement;
763
- for (const n of e)
764
- if (n === o || (n.focus(), document.activeElement !== o)) return;
765
- }
766
- function So(e, o) {
767
- return e.map((n, t) => e[(o + t) % e.length]);
768
- }
769
- function bo(e, o, n) {
770
- const r = o.length > 1 && Array.from(o).every((f) => f === o[0]) ? o[0] : o, s = n ? e.indexOf(n) : -1;
771
- let l = So(e, Math.max(s, 0));
772
- r.length === 1 && (l = l.filter((f) => f !== n));
773
- const m = l.find(
774
- (f) => f.toLowerCase().startsWith(r.toLowerCase())
775
- );
776
- return m !== n ? m : void 0;
777
- }
778
- function Eo(e, o) {
779
- const { x: n, y: t } = e;
780
- let r = !1;
781
- for (let s = 0, l = o.length - 1; s < o.length; l = s++) {
782
- const d = o[s], m = o[l], f = d.x, i = d.y, u = m.x, v = m.y;
783
- i > t != v > t && n < (u - f) * (t - i) / (v - i) + f && (r = !r);
784
- }
785
- return r;
786
- }
787
- function Do(e, o) {
788
- if (!o) return !1;
789
- const n = { x: e.clientX, y: e.clientY };
790
- return Eo(n, o);
791
- }
792
- function q(e) {
793
- return (o) => o.pointerType === "mouse" ? e(o) : void 0;
794
- }
795
- var Po = Xe, yo = Ce, To = We, xo = ze, No = Ie, Ao = qe, Oo = ue, Fo = Je, ko = en, Go = on, Lo = rn, Ko = an, $o = cn, Uo = un, Bo = ln, Vo = pn, ie = "DropdownMenu", [Yo] = ae(
796
- ie,
797
- [Ve]
798
- ), S = Ve(), [jo, mn] = Yo(ie), vn = (e) => {
799
- const {
800
- __scopeDropdownMenu: o,
801
- children: n,
802
- dir: t,
803
- open: r,
804
- defaultOpen: s,
805
- onOpenChange: l,
806
- modal: d = !0
807
- } = e, m = S(o), f = a.useRef(null), [i, u] = we({
808
- prop: r,
809
- defaultProp: s ?? !1,
810
- onChange: l,
811
- caller: ie
812
- });
813
- return /* @__PURE__ */ c(
814
- jo,
815
- {
816
- scope: o,
817
- triggerId: W(),
818
- triggerRef: f,
819
- contentId: W(),
820
- open: i,
821
- onOpenChange: u,
822
- onOpenToggle: a.useCallback(() => u((v) => !v), [u]),
823
- modal: d,
824
- children: /* @__PURE__ */ c(Po, { ...m, open: i, onOpenChange: u, dir: t, modal: d, children: n })
825
- }
826
- );
827
- };
828
- vn.displayName = ie;
829
- var Mn = "DropdownMenuTrigger", gn = a.forwardRef(
830
- (e, o) => {
831
- const { __scopeDropdownMenu: n, disabled: t = !1, ...r } = e, s = mn(Mn, n), l = S(n);
832
- return /* @__PURE__ */ c(yo, { asChild: !0, ...l, children: /* @__PURE__ */ c(
833
- O.button,
834
- {
835
- type: "button",
836
- id: s.triggerId,
837
- "aria-haspopup": "menu",
838
- "aria-expanded": s.open,
839
- "aria-controls": s.open ? s.contentId : void 0,
840
- "data-state": s.open ? "open" : "closed",
841
- "data-disabled": t ? "" : void 0,
842
- disabled: t,
843
- ...r,
844
- ref: Ne(o, s.triggerRef),
845
- onPointerDown: g(e.onPointerDown, (d) => {
846
- !t && d.button === 0 && d.ctrlKey === !1 && (s.onOpenToggle(), s.open || d.preventDefault());
847
- }),
848
- onKeyDown: g(e.onKeyDown, (d) => {
849
- t || (["Enter", " "].includes(d.key) && s.onOpenToggle(), d.key === "ArrowDown" && s.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
850
- })
851
- }
852
- ) });
853
- }
854
- );
855
- gn.displayName = Mn;
856
- var Xo = "DropdownMenuPortal", wn = (e) => {
857
- const { __scopeDropdownMenu: o, ...n } = e, t = S(o);
858
- return /* @__PURE__ */ c(To, { ...t, ...n });
859
- };
860
- wn.displayName = Xo;
861
- var Cn = "DropdownMenuContent", hn = a.forwardRef(
862
- (e, o) => {
863
- const { __scopeDropdownMenu: n, ...t } = e, r = mn(Cn, n), s = S(n), l = a.useRef(!1);
864
- return /* @__PURE__ */ c(
865
- xo,
866
- {
867
- id: r.contentId,
868
- "aria-labelledby": r.triggerId,
869
- ...s,
870
- ...t,
871
- ref: o,
872
- onCloseAutoFocus: g(e.onCloseAutoFocus, (d) => {
873
- l.current || r.triggerRef.current?.focus(), l.current = !1, d.preventDefault();
874
- }),
875
- onInteractOutside: g(e.onInteractOutside, (d) => {
876
- const m = d.detail.originalEvent, f = m.button === 0 && m.ctrlKey === !0, i = m.button === 2 || f;
877
- (!r.modal || i) && (l.current = !0);
878
- }),
879
- style: {
880
- ...e.style,
881
- "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
882
- "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
883
- "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
884
- "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
885
- "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
886
- }
887
- }
888
- );
889
- }
890
- );
891
- hn.displayName = Cn;
892
- var Ho = "DropdownMenuGroup", _n = a.forwardRef(
893
- (e, o) => {
894
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
895
- return /* @__PURE__ */ c(No, { ...r, ...t, ref: o });
896
- }
897
- );
898
- _n.displayName = Ho;
899
- var Wo = "DropdownMenuLabel", zo = a.forwardRef(
900
- (e, o) => {
901
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
902
- return /* @__PURE__ */ c(Ao, { ...r, ...t, ref: o });
903
- }
904
- );
905
- zo.displayName = Wo;
906
- var qo = "DropdownMenuItem", Rn = a.forwardRef(
907
- (e, o) => {
908
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
909
- return /* @__PURE__ */ c(Oo, { ...r, ...t, ref: o });
910
- }
911
- );
912
- Rn.displayName = qo;
913
- var Zo = "DropdownMenuCheckboxItem", Jo = a.forwardRef((e, o) => {
914
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
915
- return /* @__PURE__ */ c(Fo, { ...r, ...t, ref: o });
916
- });
917
- Jo.displayName = Zo;
918
- var Qo = "DropdownMenuRadioGroup", In = a.forwardRef((e, o) => {
919
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
920
- return /* @__PURE__ */ c(ko, { ...r, ...t, ref: o });
921
- });
922
- In.displayName = Qo;
923
- var et = "DropdownMenuRadioItem", nt = a.forwardRef((e, o) => {
924
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
925
- return /* @__PURE__ */ c(Go, { ...r, ...t, ref: o });
926
- });
927
- nt.displayName = et;
928
- var ot = "DropdownMenuItemIndicator", tt = a.forwardRef((e, o) => {
929
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
930
- return /* @__PURE__ */ c(Lo, { ...r, ...t, ref: o });
931
- });
932
- tt.displayName = ot;
933
- var rt = "DropdownMenuSeparator", at = a.forwardRef((e, o) => {
934
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
935
- return /* @__PURE__ */ c(Ko, { ...r, ...t, ref: o });
936
- });
937
- at.displayName = rt;
938
- var ct = "DropdownMenuArrow", st = a.forwardRef(
939
- (e, o) => {
940
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
941
- return /* @__PURE__ */ c($o, { ...r, ...t, ref: o });
942
- }
943
- );
944
- st.displayName = ct;
945
- var ut = (e) => {
946
- const { __scopeDropdownMenu: o, children: n, open: t, onOpenChange: r, defaultOpen: s } = e, l = S(o), [d, m] = we({
947
- prop: t,
948
- defaultProp: s ?? !1,
949
- onChange: r,
950
- caller: "DropdownMenuSub"
951
- });
952
- return /* @__PURE__ */ c(Uo, { ...l, open: d, onOpenChange: m, children: n });
953
- }, it = "DropdownMenuSubTrigger", Sn = a.forwardRef((e, o) => {
954
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
955
- return /* @__PURE__ */ c(Bo, { ...r, ...t, ref: o });
956
- });
957
- Sn.displayName = it;
958
- var lt = "DropdownMenuSubContent", bn = a.forwardRef((e, o) => {
959
- const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
960
- return /* @__PURE__ */ c(
961
- Vo,
962
- {
963
- ...r,
964
- ...t,
965
- ref: o,
966
- style: {
967
- ...e.style,
968
- "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
969
- "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
970
- "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
971
- "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
972
- "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
973
- }
974
- }
975
- );
976
- });
977
- bn.displayName = lt;
978
- var dt = vn, En = gn, pt = wn, Dn = hn, ft = _n, mt = Rn, vt = In, Mt = ut, gt = Sn, Pn = bn;
979
- function bt({
980
- ...e
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as a } from "react";
3
+ import { Trigger as p, SubContent as d, Content as i, Portal as f, Item as w, Root as b, Group as D, Sub as g, SubTrigger as M, RadioGroup as S } from "../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
4
+ import { cn as m } from "../../../lib/tiptap-utils.js";
5
+ import '../../../assets/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.css';/* empty css */
6
+ function P({
7
+ ...o
981
8
  }) {
982
- return /* @__PURE__ */ c(dt, { modal: !1, ...e });
9
+ return /* @__PURE__ */ e(b, { modal: !1, ...o });
983
10
  }
984
- function yn({
985
- ...e
11
+ function c({
12
+ ...o
986
13
  }) {
987
- return /* @__PURE__ */ c(pt, { ...e });
14
+ return /* @__PURE__ */ e(f, { ...o });
988
15
  }
989
- const wt = ge(({ ...e }, o) => /* @__PURE__ */ c(En, { ref: o, ...e }));
990
- wt.displayName = En.displayName;
991
- const Et = ft, Dt = Mt, Pt = vt, yt = mt, Tt = gt, Ct = ge(({ className: e, portal: o = !0, ...n }, t) => {
992
- const r = /* @__PURE__ */ c(
993
- Pn,
16
+ const y = a(({ ...o }, n) => /* @__PURE__ */ e(p, { ref: n, ...o }));
17
+ y.displayName = p.displayName;
18
+ const h = D, x = g, v = S, A = w, F = M, N = a(({ className: o, portal: n = !0, ...t }, u) => {
19
+ const r = /* @__PURE__ */ e(
20
+ d,
994
21
  {
995
- ref: t,
996
- className: Ae("tiptap-dropdown-menu", e),
997
- ...n
22
+ ref: u,
23
+ className: m("tiptap-dropdown-menu", o),
24
+ ...t
998
25
  }
999
26
  );
1000
- return o ? /* @__PURE__ */ c(yn, { ...typeof o == "object" ? o : {}, children: r }) : r;
27
+ return n ? /* @__PURE__ */ e(c, { ...typeof n == "object" ? n : {}, children: r }) : r;
1001
28
  });
1002
- Ct.displayName = Pn.displayName;
1003
- const ht = ge(({ className: e, sideOffset: o = 4, portal: n = !1, ...t }, r) => {
1004
- const s = /* @__PURE__ */ c(
1005
- Dn,
29
+ N.displayName = d.displayName;
30
+ const C = a(({ className: o, sideOffset: n = 4, portal: t = !1, ...u }, r) => {
31
+ const s = /* @__PURE__ */ e(
32
+ i,
1006
33
  {
1007
34
  ref: r,
1008
- sideOffset: o,
35
+ sideOffset: n,
1009
36
  onCloseAutoFocus: (l) => l.preventDefault(),
1010
- className: Ae("tiptap-dropdown-menu", e),
1011
- ...t
37
+ className: m("tiptap-dropdown-menu", o),
38
+ ...u
1012
39
  }
1013
40
  );
1014
- return n ? /* @__PURE__ */ c(yn, { ...typeof n == "object" ? n : {}, children: s }) : s;
41
+ return t ? /* @__PURE__ */ e(c, { ...typeof t == "object" ? t : {}, children: s }) : s;
1015
42
  });
1016
- ht.displayName = Dn.displayName;
43
+ C.displayName = i.displayName;
1017
44
  export {
1018
- bt as DropdownMenu,
1019
- ht as DropdownMenuContent,
1020
- Et as DropdownMenuGroup,
1021
- yt as DropdownMenuItem,
1022
- yn as DropdownMenuPortal,
1023
- Pt as DropdownMenuRadioGroup,
1024
- Dt as DropdownMenuSub,
1025
- Ct as DropdownMenuSubContent,
1026
- Tt as DropdownMenuSubTrigger,
1027
- wt as DropdownMenuTrigger
45
+ P as DropdownMenu,
46
+ C as DropdownMenuContent,
47
+ h as DropdownMenuGroup,
48
+ A as DropdownMenuItem,
49
+ c as DropdownMenuPortal,
50
+ v as DropdownMenuRadioGroup,
51
+ x as DropdownMenuSub,
52
+ N as DropdownMenuSubContent,
53
+ F as DropdownMenuSubTrigger,
54
+ y as DropdownMenuTrigger
1028
55
  };