astro-md-editor 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.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/index-CstiJsWh.js +378 -0
- package/.output/public/assets/{main-BrRIwdKE.js → main-Cc9C-tdG.js} +1 -1
- package/.output/public/assets/styles-DCSwPMSs.css +1 -0
- package/.output/server/{__root-CL_tq3ov.mjs → __root-Bv3dTvZ5.mjs} +1 -1
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +210 -0
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +11 -0
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +69 -0
- package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +17 -0
- package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +6 -0
- package/.output/server/_libs/aria-hidden.mjs +122 -0
- package/.output/server/_libs/base-ui__react.mjs +2548 -2548
- package/.output/server/_libs/base-ui__utils.mjs +2 -2
- package/.output/server/_libs/cmdk.mjs +315 -0
- package/.output/server/_libs/detect-node-es.mjs +1 -0
- package/.output/server/_libs/get-nonce.mjs +9 -0
- package/.output/server/_libs/lucide-react.mjs +25 -17
- package/.output/server/_libs/radix-ui__primitive.mjs +11 -0
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +39 -0
- package/.output/server/_libs/radix-ui__react-context.mjs +78 -0
- package/.output/server/_libs/radix-ui__react-dialog.mjs +319 -0
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +29 -0
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +206 -0
- package/.output/server/_libs/radix-ui__react-id.mjs +14 -0
- package/.output/server/_libs/radix-ui__react-portal.mjs +16 -0
- package/.output/server/_libs/radix-ui__react-presence.mjs +128 -0
- package/.output/server/_libs/radix-ui__react-primitive.mjs +75 -0
- package/.output/server/_libs/radix-ui__react-slot.mjs +184 -0
- package/.output/server/_libs/react-remove-scroll-bar.mjs +82 -0
- package/.output/server/_libs/react-remove-scroll.mjs +328 -0
- package/.output/server/_libs/react-style-singleton.mjs +69 -0
- package/.output/server/_libs/react.mjs +2 -0
- package/.output/server/_libs/tslib.mjs +576 -0
- package/.output/server/_libs/use-callback-ref.mjs +66 -0
- package/.output/server/_libs/use-sidecar.mjs +106 -0
- package/.output/server/_ssr/{ImageAssetBrowser-DNDdTqtf.mjs → ImageAssetBrowser-DuPVChYO.mjs} +2 -2
- package/.output/server/_ssr/{collections.server-s12asITg.mjs → collections.server-DjgohZR7.mjs} +2 -1
- package/.output/server/_ssr/{file-history.api-oydnxFVV.mjs → file-history.api-JMkTXrYq.mjs} +1 -1
- package/.output/server/_ssr/{image-assets.server-Ci2E1_Tm.mjs → image-assets.server-2-0DgxSb.mjs} +1 -1
- package/.output/server/_ssr/{image-preview.api-pcN5PQhH.mjs → image-preview.api-V_Q-MBx9.mjs} +2 -2
- package/.output/server/_ssr/{index-BjQuGIib.mjs → index-ByW88Uz2.mjs} +3 -2
- package/.output/server/_ssr/{index-qpTkRHX1.mjs → index-C6Fb3DjG.mjs} +796 -409
- package/.output/server/_ssr/index.mjs +15 -15
- package/.output/server/_ssr/{router-DU3Hv7p_.mjs → router-DbnWNAi_.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-BdKE8Xjm.mjs → _tanstack-start-manifest_v-BDWWBEf1.mjs} +1 -1
- package/.output/server/index.mjs +49 -49
- package/LICENSE.md +1 -1
- package/package.json +2 -1
- package/scripts/bootstrap-collections.mjs +2 -0
- package/.output/public/assets/index-CBGDT9fi.js +0 -334
- package/.output/public/assets/styles-CezfLgHY.css +0 -1
|
@@ -946,8 +946,8 @@ function isMouseWithinBounds(event) {
|
|
|
946
946
|
export {
|
|
947
947
|
AnimationFrame as A,
|
|
948
948
|
useScrollLock as B,
|
|
949
|
-
|
|
950
|
-
|
|
949
|
+
useOnFirstRender as C,
|
|
950
|
+
useStore as D,
|
|
951
951
|
EMPTY_OBJECT as E,
|
|
952
952
|
visuallyHiddenInput as F,
|
|
953
953
|
isMouseWithinBounds as G,
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { R as Root, P as Portal, O as Overlay, C as Content } from "./radix-ui__react-dialog.mjs";
|
|
2
|
+
import { r as reactExports } from "./react.mjs";
|
|
3
|
+
import { P as Primitive } from "./radix-ui__react-primitive.mjs";
|
|
4
|
+
import { u as useId } from "./radix-ui__react-id.mjs";
|
|
5
|
+
import { c as composeRefs } from "./radix-ui__react-compose-refs.mjs";
|
|
6
|
+
var U = 1, Y$1 = 0.9, H = 0.8, J = 0.17, p = 0.1, u = 0.999, $ = 0.9999;
|
|
7
|
+
var k$1 = 0.99, m = /[\\\/_+.#"@\[\(\{&]/, B$1 = /[\\\/_+.#"@\[\(\{&]/g, K$1 = /[\s-]/, X = /[\s-]/g;
|
|
8
|
+
function G(_, C, h, P2, A, f, O) {
|
|
9
|
+
if (f === C.length) return A === _.length ? U : k$1;
|
|
10
|
+
var T2 = `${A},${f}`;
|
|
11
|
+
if (O[T2] !== void 0) return O[T2];
|
|
12
|
+
for (var L2 = P2.charAt(f), c = h.indexOf(L2, A), S = 0, E, N2, R, M; c >= 0; ) E = G(_, C, h, P2, c + 1, f + 1, O), E > S && (c === A ? E *= U : m.test(_.charAt(c - 1)) ? (E *= H, R = _.slice(A, c - 1).match(B$1), R && A > 0 && (E *= Math.pow(u, R.length))) : K$1.test(_.charAt(c - 1)) ? (E *= Y$1, M = _.slice(A, c - 1).match(X), M && A > 0 && (E *= Math.pow(u, M.length))) : (E *= J, A > 0 && (E *= Math.pow(u, c - A))), _.charAt(c) !== C.charAt(f) && (E *= $)), (E < p && h.charAt(c - 1) === P2.charAt(f + 1) || P2.charAt(f + 1) === P2.charAt(f) && h.charAt(c - 1) !== P2.charAt(f)) && (N2 = G(_, C, h, P2, c + 1, f + 2, O), N2 * p > E && (E = N2 * p)), E > S && (S = E), c = h.indexOf(L2, c + 1);
|
|
13
|
+
return O[T2] = S, S;
|
|
14
|
+
}
|
|
15
|
+
function D(_) {
|
|
16
|
+
return _.toLowerCase().replace(X, " ");
|
|
17
|
+
}
|
|
18
|
+
function W(_, C, h) {
|
|
19
|
+
return _ = h && h.length > 0 ? `${_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
|
|
20
|
+
}
|
|
21
|
+
var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-heading=""]', le = '[cmdk-item=""]', ce = `${le}:not([aria-disabled="true"])`, Z = "cmdk-item-select", T = "data-value", Re = (r, o, n) => W(r, o, n), ue = reactExports.createContext(void 0), K = () => reactExports.useContext(ue), de = reactExports.createContext(void 0), ee = () => reactExports.useContext(de), fe = reactExports.createContext(void 0), me = reactExports.forwardRef((r, o) => {
|
|
22
|
+
let n = L(() => {
|
|
23
|
+
var e, a;
|
|
24
|
+
return { search: "", value: (a = (e = r.value) != null ? e : r.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
25
|
+
}), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 = useId(), q = useId(), _ = useId(), I = reactExports.useRef(null), v = ke();
|
|
26
|
+
k(() => {
|
|
27
|
+
if (R !== void 0) {
|
|
28
|
+
let e = R.trim();
|
|
29
|
+
n.current.value = e, E.emit();
|
|
30
|
+
}
|
|
31
|
+
}, [R]), k(() => {
|
|
32
|
+
v(6, ne);
|
|
33
|
+
}, []);
|
|
34
|
+
let E = reactExports.useMemo(() => ({ subscribe: (e) => (f.current.add(e), () => f.current.delete(e)), snapshot: () => n.current, setState: (e, a, s) => {
|
|
35
|
+
var i, l, g, y;
|
|
36
|
+
if (!Object.is(n.current[e], a)) {
|
|
37
|
+
if (n.current[e] = a, e === "search") J2(), z(), v(1, W2);
|
|
38
|
+
else if (e === "value") {
|
|
39
|
+
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
40
|
+
let h = document.getElementById(_);
|
|
41
|
+
h ? h.focus() : (i = document.getElementById($2)) == null || i.focus();
|
|
42
|
+
}
|
|
43
|
+
if (v(7, () => {
|
|
44
|
+
var h;
|
|
45
|
+
n.current.selectedItemId = (h = M()) == null ? void 0 : h.id, E.emit();
|
|
46
|
+
}), s || v(5, ne), ((l = p2.current) == null ? void 0 : l.value) !== void 0) {
|
|
47
|
+
let h = a != null ? a : "";
|
|
48
|
+
(y = (g = p2.current).onValueChange) == null || y.call(g, h);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
E.emit();
|
|
53
|
+
}
|
|
54
|
+
}, emit: () => {
|
|
55
|
+
f.current.forEach((e) => e());
|
|
56
|
+
} }), []), U2 = reactExports.useMemo(() => ({ value: (e, a, s) => {
|
|
57
|
+
var i;
|
|
58
|
+
a !== ((i = d.current.get(e)) == null ? void 0 : i.value) && (d.current.set(e, { value: a, keywords: s }), n.current.filtered.items.set(e, te(a, s)), v(2, () => {
|
|
59
|
+
z(), E.emit();
|
|
60
|
+
}));
|
|
61
|
+
}, item: (e, a) => (u2.current.add(e), a && (c.current.has(a) ? c.current.get(a).add(e) : c.current.set(a, /* @__PURE__ */ new Set([e]))), v(3, () => {
|
|
62
|
+
J2(), z(), n.current.value || W2(), E.emit();
|
|
63
|
+
}), () => {
|
|
64
|
+
d.current.delete(e), u2.current.delete(e), n.current.filtered.items.delete(e);
|
|
65
|
+
let s = M();
|
|
66
|
+
v(4, () => {
|
|
67
|
+
J2(), (s == null ? void 0 : s.getAttribute("id")) === e && W2(), E.emit();
|
|
68
|
+
});
|
|
69
|
+
}), group: (e) => (c.current.has(e) || c.current.set(e, /* @__PURE__ */ new Set()), () => {
|
|
70
|
+
d.current.delete(e), c.current.delete(e);
|
|
71
|
+
}), filter: () => p2.current.shouldFilter, label: b || r["aria-label"], getDisablePointerSelection: () => p2.current.disablePointerSelection, listId: $2, inputId: _, labelId: q, listInnerRef: I }), []);
|
|
72
|
+
function te(e, a) {
|
|
73
|
+
var i, l;
|
|
74
|
+
let s = (l = (i = p2.current) == null ? void 0 : i.filter) != null ? l : Re;
|
|
75
|
+
return e ? s(e, n.current.search, a) : 0;
|
|
76
|
+
}
|
|
77
|
+
function z() {
|
|
78
|
+
if (!n.current.search || p2.current.shouldFilter === false) return;
|
|
79
|
+
let e = n.current.filtered.items, a = [];
|
|
80
|
+
n.current.filtered.groups.forEach((i) => {
|
|
81
|
+
let l = c.current.get(i), g = 0;
|
|
82
|
+
l.forEach((y) => {
|
|
83
|
+
let h = e.get(y);
|
|
84
|
+
g = Math.max(h, g);
|
|
85
|
+
}), a.push([i, g]);
|
|
86
|
+
});
|
|
87
|
+
let s = I.current;
|
|
88
|
+
V().sort((i, l) => {
|
|
89
|
+
var h, F;
|
|
90
|
+
let g = i.getAttribute("id"), y = l.getAttribute("id");
|
|
91
|
+
return ((h = e.get(y)) != null ? h : 0) - ((F = e.get(g)) != null ? F : 0);
|
|
92
|
+
}).forEach((i) => {
|
|
93
|
+
let l = i.closest(Y);
|
|
94
|
+
l ? l.appendChild(i.parentElement === l ? i : i.closest(`${Y} > *`)) : s.appendChild(i.parentElement === s ? i : i.closest(`${Y} > *`));
|
|
95
|
+
}), a.sort((i, l) => l[1] - i[1]).forEach((i) => {
|
|
96
|
+
var g;
|
|
97
|
+
let l = (g = I.current) == null ? void 0 : g.querySelector(`${N}[${T}="${encodeURIComponent(i[0])}"]`);
|
|
98
|
+
l == null || l.parentElement.appendChild(l);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function W2() {
|
|
102
|
+
let e = V().find((s) => s.getAttribute("aria-disabled") !== "true"), a = e == null ? void 0 : e.getAttribute(T);
|
|
103
|
+
E.setState("value", a || void 0);
|
|
104
|
+
}
|
|
105
|
+
function J2() {
|
|
106
|
+
var a, s, i, l;
|
|
107
|
+
if (!n.current.search || p2.current.shouldFilter === false) {
|
|
108
|
+
n.current.filtered.count = u2.current.size;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
n.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
112
|
+
let e = 0;
|
|
113
|
+
for (let g of u2.current) {
|
|
114
|
+
let y = (s = (a = d.current.get(g)) == null ? void 0 : a.value) != null ? s : "", h = (l = (i = d.current.get(g)) == null ? void 0 : i.keywords) != null ? l : [], F = te(y, h);
|
|
115
|
+
n.current.filtered.items.set(g, F), F > 0 && e++;
|
|
116
|
+
}
|
|
117
|
+
for (let [g, y] of c.current) for (let h of y) if (n.current.filtered.items.get(h) > 0) {
|
|
118
|
+
n.current.filtered.groups.add(g);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
n.current.filtered.count = e;
|
|
122
|
+
}
|
|
123
|
+
function ne() {
|
|
124
|
+
var a, s, i;
|
|
125
|
+
let e = M();
|
|
126
|
+
e && (((a = e.parentElement) == null ? void 0 : a.firstChild) === e && ((i = (s = e.closest(N)) == null ? void 0 : s.querySelector(be)) == null || i.scrollIntoView({ block: "nearest" })), e.scrollIntoView({ block: "nearest" }));
|
|
127
|
+
}
|
|
128
|
+
function M() {
|
|
129
|
+
var e;
|
|
130
|
+
return (e = I.current) == null ? void 0 : e.querySelector(`${le}[aria-selected="true"]`);
|
|
131
|
+
}
|
|
132
|
+
function V() {
|
|
133
|
+
var e;
|
|
134
|
+
return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
|
|
135
|
+
}
|
|
136
|
+
function X2(e) {
|
|
137
|
+
let s = V()[e];
|
|
138
|
+
s && E.setState("value", s.getAttribute(T));
|
|
139
|
+
}
|
|
140
|
+
function Q(e) {
|
|
141
|
+
var g;
|
|
142
|
+
let a = M(), s = V(), i = s.findIndex((y) => y === a), l = s[i + e];
|
|
143
|
+
(g = p2.current) != null && g.loop && (l = i + e < 0 ? s[s.length - 1] : i + e === s.length ? s[0] : s[i + e]), l && E.setState("value", l.getAttribute(T));
|
|
144
|
+
}
|
|
145
|
+
function re(e) {
|
|
146
|
+
let a = M(), s = a == null ? void 0 : a.closest(N), i;
|
|
147
|
+
for (; s && !i; ) s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
|
|
148
|
+
i ? E.setState("value", i.getAttribute(T)) : Q(e);
|
|
149
|
+
}
|
|
150
|
+
let oe = () => X2(V().length - 1), ie = (e) => {
|
|
151
|
+
e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
|
|
152
|
+
}, se = (e) => {
|
|
153
|
+
e.preventDefault(), e.metaKey ? X2(0) : e.altKey ? re(-1) : Q(-1);
|
|
154
|
+
};
|
|
155
|
+
return reactExports.createElement(Primitive.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
|
|
156
|
+
var s;
|
|
157
|
+
(s = O.onKeyDown) == null || s.call(O, e);
|
|
158
|
+
let a = e.nativeEvent.isComposing || e.keyCode === 229;
|
|
159
|
+
if (!(e.defaultPrevented || a)) switch (e.key) {
|
|
160
|
+
case "n":
|
|
161
|
+
case "j": {
|
|
162
|
+
j && e.ctrlKey && ie(e);
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
case "ArrowDown": {
|
|
166
|
+
ie(e);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
case "p":
|
|
170
|
+
case "k": {
|
|
171
|
+
j && e.ctrlKey && se(e);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case "ArrowUp": {
|
|
175
|
+
se(e);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case "Home": {
|
|
179
|
+
e.preventDefault(), X2(0);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "End": {
|
|
183
|
+
e.preventDefault(), oe();
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case "Enter": {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
let i = M();
|
|
189
|
+
if (i) {
|
|
190
|
+
let l = new Event(Z);
|
|
191
|
+
i.dispatchEvent(l);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
} }, reactExports.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B(r, (e) => reactExports.createElement(de.Provider, { value: E }, reactExports.createElement(ue.Provider, { value: U2 }, e))));
|
|
196
|
+
}), he = reactExports.forwardRef((r, o) => {
|
|
197
|
+
var _, I;
|
|
198
|
+
let n = useId(), u2 = reactExports.useRef(null), c = reactExports.useContext(fe), d = K(), f = pe(r), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
|
|
199
|
+
k(() => {
|
|
200
|
+
if (!p2) return d.item(n, c == null ? void 0 : c.id);
|
|
201
|
+
}, [p2]);
|
|
202
|
+
let b = ve(n, u2, [r.value, r.children, u2], r.keywords), m2 = ee(), R = P((v) => v.value && v.value === b.current), x = P((v) => p2 || d.filter() === false ? true : v.search ? v.filtered.items.get(n) > 0 : true);
|
|
203
|
+
reactExports.useEffect(() => {
|
|
204
|
+
let v = u2.current;
|
|
205
|
+
if (!(!v || r.disabled)) return v.addEventListener(Z, C), () => v.removeEventListener(Z, C);
|
|
206
|
+
}, [x, r.onSelect, r.disabled]);
|
|
207
|
+
function C() {
|
|
208
|
+
var v, E;
|
|
209
|
+
S(), (E = (v = f.current).onSelect) == null || E.call(v, b.current);
|
|
210
|
+
}
|
|
211
|
+
function S() {
|
|
212
|
+
m2.setState("value", b.current, true);
|
|
213
|
+
}
|
|
214
|
+
if (!x) return null;
|
|
215
|
+
let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r;
|
|
216
|
+
return reactExports.createElement(Primitive.div, { ref: composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r.children);
|
|
217
|
+
}), Ee = reactExports.forwardRef((r, o) => {
|
|
218
|
+
let { heading: n, children: u2, forceMount: c, ...d } = r, f = useId(), p2 = reactExports.useRef(null), b = reactExports.useRef(null), m2 = useId(), R = K(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
|
|
219
|
+
k(() => R.group(f), []), ve(f, p2, [r.value, r.heading, b]);
|
|
220
|
+
let C = reactExports.useMemo(() => ({ id: f, forceMount: c }), [c]);
|
|
221
|
+
return reactExports.createElement(Primitive.div, { ref: composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && reactExports.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B(r, (S) => reactExports.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, reactExports.createElement(fe.Provider, { value: C }, S))));
|
|
222
|
+
}), ye = reactExports.forwardRef((r, o) => {
|
|
223
|
+
let { alwaysRender: n, ...u2 } = r, c = reactExports.useRef(null), d = P((f) => !f.search);
|
|
224
|
+
return !n && !d ? null : reactExports.createElement(Primitive.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
|
|
225
|
+
}), Se = reactExports.forwardRef((r, o) => {
|
|
226
|
+
let { onValueChange: n, ...u2 } = r, c = r.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K();
|
|
227
|
+
return reactExports.useEffect(() => {
|
|
228
|
+
r.value != null && d.setState("search", r.value);
|
|
229
|
+
}, [r.value]), reactExports.createElement(Primitive.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r.value : f, onChange: (m2) => {
|
|
230
|
+
c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
|
|
231
|
+
} });
|
|
232
|
+
}), Ce = reactExports.forwardRef((r, o) => {
|
|
233
|
+
let { children: n, label: u2 = "Suggestions", ...c } = r, d = reactExports.useRef(null), f = reactExports.useRef(null), p2 = P((m2) => m2.selectedItemId), b = K();
|
|
234
|
+
return reactExports.useEffect(() => {
|
|
235
|
+
if (f.current && d.current) {
|
|
236
|
+
let m2 = f.current, R = d.current, x, C = new ResizeObserver(() => {
|
|
237
|
+
x = requestAnimationFrame(() => {
|
|
238
|
+
let S = m2.offsetHeight;
|
|
239
|
+
R.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
return C.observe(m2), () => {
|
|
243
|
+
cancelAnimationFrame(x), C.unobserve(m2);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}, []), reactExports.createElement(Primitive.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B(r, (m2) => reactExports.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
|
|
247
|
+
}), xe = reactExports.forwardRef((r, o) => {
|
|
248
|
+
let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r;
|
|
249
|
+
return reactExports.createElement(Root, { open: n, onOpenChange: u2 }, reactExports.createElement(Portal, { container: f }, reactExports.createElement(Overlay, { "cmdk-overlay": "", className: c }), reactExports.createElement(Content, { "aria-label": r.label, "cmdk-dialog": "", className: d }, reactExports.createElement(me, { ref: o, ...p2 }))));
|
|
250
|
+
}), Ie = reactExports.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? reactExports.createElement(Primitive.div, { ref: o, ...r, "cmdk-empty": "", role: "presentation" }) : null), Pe = reactExports.forwardRef((r, o) => {
|
|
251
|
+
let { progress: n, children: u2, label: c = "Loading...", ...d } = r;
|
|
252
|
+
return reactExports.createElement(Primitive.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B(r, (f) => reactExports.createElement("div", { "aria-hidden": true }, f)));
|
|
253
|
+
}), _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
|
|
254
|
+
function we(r, o) {
|
|
255
|
+
let n = r.nextElementSibling;
|
|
256
|
+
for (; n; ) {
|
|
257
|
+
if (n.matches(o)) return n;
|
|
258
|
+
n = n.nextElementSibling;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function De(r, o) {
|
|
262
|
+
let n = r.previousElementSibling;
|
|
263
|
+
for (; n; ) {
|
|
264
|
+
if (n.matches(o)) return n;
|
|
265
|
+
n = n.previousElementSibling;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function pe(r) {
|
|
269
|
+
let o = reactExports.useRef(r);
|
|
270
|
+
return k(() => {
|
|
271
|
+
o.current = r;
|
|
272
|
+
}), o;
|
|
273
|
+
}
|
|
274
|
+
var k = typeof window == "undefined" ? reactExports.useEffect : reactExports.useLayoutEffect;
|
|
275
|
+
function L(r) {
|
|
276
|
+
let o = reactExports.useRef();
|
|
277
|
+
return o.current === void 0 && (o.current = r()), o;
|
|
278
|
+
}
|
|
279
|
+
function P(r) {
|
|
280
|
+
let o = ee(), n = () => r(o.snapshot());
|
|
281
|
+
return reactExports.useSyncExternalStore(o.subscribe, n, n);
|
|
282
|
+
}
|
|
283
|
+
function ve(r, o, n, u2 = []) {
|
|
284
|
+
let c = reactExports.useRef(), d = K();
|
|
285
|
+
return k(() => {
|
|
286
|
+
var b;
|
|
287
|
+
let f = (() => {
|
|
288
|
+
var m2;
|
|
289
|
+
for (let R of n) {
|
|
290
|
+
if (typeof R == "string") return R.trim();
|
|
291
|
+
if (typeof R == "object" && "current" in R) return R.current ? (m2 = R.current.textContent) == null ? void 0 : m2.trim() : c.current;
|
|
292
|
+
}
|
|
293
|
+
})(), p2 = u2.map((m2) => m2.trim());
|
|
294
|
+
d.value(r, f, p2), (b = o.current) == null || b.setAttribute(T, f), c.current = f;
|
|
295
|
+
}), c;
|
|
296
|
+
}
|
|
297
|
+
var ke = () => {
|
|
298
|
+
let [r, o] = reactExports.useState(), n = L(() => /* @__PURE__ */ new Map());
|
|
299
|
+
return k(() => {
|
|
300
|
+
n.current.forEach((u2) => u2()), n.current = /* @__PURE__ */ new Map();
|
|
301
|
+
}, [r]), (u2, c) => {
|
|
302
|
+
n.current.set(u2, c), o({});
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
function Me(r) {
|
|
306
|
+
let o = r.type;
|
|
307
|
+
return typeof o == "function" ? o(r.props) : "render" in o ? o.render(r.props) : r;
|
|
308
|
+
}
|
|
309
|
+
function B({ asChild: r, children: o }, n) {
|
|
310
|
+
return r && reactExports.isValidElement(o) ? reactExports.cloneElement(Me(o), { ref: o.ref }, n(o.props.children)) : n(o);
|
|
311
|
+
}
|
|
312
|
+
var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
313
|
+
export {
|
|
314
|
+
_e as _
|
|
315
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -75,6 +75,13 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
75
75
|
Component.displayName = toPascalCase(iconName);
|
|
76
76
|
return Component;
|
|
77
77
|
};
|
|
78
|
+
const __iconNode$x = [
|
|
79
|
+
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
80
|
+
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
81
|
+
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
82
|
+
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
83
|
+
];
|
|
84
|
+
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$x);
|
|
78
85
|
const __iconNode$w = [
|
|
79
86
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
80
87
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
@@ -298,6 +305,7 @@ const __iconNode = [
|
|
|
298
305
|
];
|
|
299
306
|
const X = createLucideIcon("x", __iconNode);
|
|
300
307
|
export {
|
|
308
|
+
ArrowUpDown as A,
|
|
301
309
|
CircleCheck as C,
|
|
302
310
|
Heading1 as H,
|
|
303
311
|
Info as I,
|
|
@@ -312,23 +320,23 @@ export {
|
|
|
312
320
|
PanelLeftOpen as a,
|
|
313
321
|
PanelRightClose as b,
|
|
314
322
|
PanelRightOpen as c,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
323
|
+
Search as d,
|
|
324
|
+
Trash2 as e,
|
|
325
|
+
LaptopMinimal as f,
|
|
326
|
+
Sun as g,
|
|
327
|
+
ChevronDown as h,
|
|
328
|
+
Check as i,
|
|
329
|
+
Heading2 as j,
|
|
330
|
+
List as k,
|
|
331
|
+
ListOrdered as l,
|
|
332
|
+
ListChecks as m,
|
|
333
|
+
CodeXml as n,
|
|
334
|
+
Minus as o,
|
|
335
|
+
Link as p,
|
|
336
|
+
Image as q,
|
|
337
|
+
CalendarDays as r,
|
|
338
|
+
Clock3 as s,
|
|
339
|
+
ChevronUp as t,
|
|
332
340
|
ChevronLeft as u,
|
|
333
341
|
ChevronRight as v
|
|
334
342
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
2
|
+
return function handleEvent(event) {
|
|
3
|
+
originalEventHandler?.(event);
|
|
4
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
5
|
+
return ourEventHandler?.(event);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
composeEventHandlers as c
|
|
11
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { r as reactExports } from "./react.mjs";
|
|
2
|
+
function setRef(ref, value) {
|
|
3
|
+
if (typeof ref === "function") {
|
|
4
|
+
return ref(value);
|
|
5
|
+
} else if (ref !== null && ref !== void 0) {
|
|
6
|
+
ref.current = value;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function composeRefs(...refs) {
|
|
10
|
+
return (node) => {
|
|
11
|
+
let hasCleanup = false;
|
|
12
|
+
const cleanups = refs.map((ref) => {
|
|
13
|
+
const cleanup = setRef(ref, node);
|
|
14
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
15
|
+
hasCleanup = true;
|
|
16
|
+
}
|
|
17
|
+
return cleanup;
|
|
18
|
+
});
|
|
19
|
+
if (hasCleanup) {
|
|
20
|
+
return () => {
|
|
21
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
22
|
+
const cleanup = cleanups[i];
|
|
23
|
+
if (typeof cleanup == "function") {
|
|
24
|
+
cleanup();
|
|
25
|
+
} else {
|
|
26
|
+
setRef(refs[i], null);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function useComposedRefs(...refs) {
|
|
34
|
+
return reactExports.useCallback(composeRefs(...refs), refs);
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
composeRefs as c,
|
|
38
|
+
useComposedRefs as u
|
|
39
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
2
|
+
function createContext2(rootComponentName, defaultContext) {
|
|
3
|
+
const Context = reactExports.createContext(defaultContext);
|
|
4
|
+
const Provider = (props) => {
|
|
5
|
+
const { children, ...context } = props;
|
|
6
|
+
const value = reactExports.useMemo(() => context, Object.values(context));
|
|
7
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
|
|
8
|
+
};
|
|
9
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
10
|
+
function useContext2(consumerName) {
|
|
11
|
+
const context = reactExports.useContext(Context);
|
|
12
|
+
if (context) return context;
|
|
13
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
14
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
15
|
+
}
|
|
16
|
+
return [Provider, useContext2];
|
|
17
|
+
}
|
|
18
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
19
|
+
let defaultContexts = [];
|
|
20
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
21
|
+
const BaseContext = reactExports.createContext(defaultContext);
|
|
22
|
+
const index = defaultContexts.length;
|
|
23
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
24
|
+
const Provider = (props) => {
|
|
25
|
+
const { scope, children, ...context } = props;
|
|
26
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
27
|
+
const value = reactExports.useMemo(() => context, Object.values(context));
|
|
28
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
|
|
29
|
+
};
|
|
30
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
31
|
+
function useContext2(consumerName, scope) {
|
|
32
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
33
|
+
const context = reactExports.useContext(Context);
|
|
34
|
+
if (context) return context;
|
|
35
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
36
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
37
|
+
}
|
|
38
|
+
return [Provider, useContext2];
|
|
39
|
+
}
|
|
40
|
+
const createScope = () => {
|
|
41
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
42
|
+
return reactExports.createContext(defaultContext);
|
|
43
|
+
});
|
|
44
|
+
return function useScope(scope) {
|
|
45
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
46
|
+
return reactExports.useMemo(
|
|
47
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
48
|
+
[scope, contexts]
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
createScope.scopeName = scopeName;
|
|
53
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
54
|
+
}
|
|
55
|
+
function composeContextScopes(...scopes) {
|
|
56
|
+
const baseScope = scopes[0];
|
|
57
|
+
if (scopes.length === 1) return baseScope;
|
|
58
|
+
const createScope = () => {
|
|
59
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
60
|
+
useScope: createScope2(),
|
|
61
|
+
scopeName: createScope2.scopeName
|
|
62
|
+
}));
|
|
63
|
+
return function useComposedScopes(overrideScopes) {
|
|
64
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
65
|
+
const scopeProps = useScope(overrideScopes);
|
|
66
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
67
|
+
return { ...nextScopes2, ...currentScope };
|
|
68
|
+
}, {});
|
|
69
|
+
return reactExports.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
createScope.scopeName = baseScope.scopeName;
|
|
73
|
+
return createScope;
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
createContext2 as a,
|
|
77
|
+
createContextScope as c
|
|
78
|
+
};
|