@aiquants/markdown-explorer 0.15.0 → 0.16.0
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/CHANGELOG.md +91 -0
- package/README.md +32 -11
- package/dist/EditSurface-CwKsTS11.cjs +2 -0
- package/dist/EditSurface-DGMLY7Gh.js +786 -0
- package/dist/ExplorerSplit-BLOaU5fE.cjs +1 -0
- package/dist/{ExplorerSplit-BPLECNpv.js → ExplorerSplit-tUCp0XdJ.js} +613 -592
- package/dist/MultiLayout-BBP2ajz8.cjs +1 -0
- package/dist/MultiLayout-DYy66vcO.js +963 -0
- package/dist/{NativeScrollBar-BUWXPvTV.cjs → NativeScrollBar-BkFg1EcW.cjs} +1 -1
- package/dist/{NativeScrollBar-BFF12oEd.js → NativeScrollBar-Dazd542j.js} +1 -1
- package/dist/TreeLayout-C8s5lBH_.cjs +1 -0
- package/dist/TreeLayout-CXX-rFO6.js +72 -0
- package/dist/client/storage.d.cts +1 -0
- package/dist/client/storage.d.ts +1 -0
- package/dist/core/geometry.d.cts +20 -1
- package/dist/core/geometry.d.ts +20 -1
- package/dist/core/labels.d.cts +7 -0
- package/dist/core/labels.d.ts +7 -0
- package/dist/core/location.d.cts +3 -0
- package/dist/core/location.d.ts +3 -0
- package/dist/core/treeSettings.d.cts +3 -1
- package/dist/core/treeSettings.d.ts +3 -1
- package/dist/index-DTKGgaok.js +3613 -0
- package/dist/index-DffJZ8-y.cjs +13 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +25 -25
- package/dist/location-D85EXiPt.cjs +1 -0
- package/dist/location-G7psbmv_.js +499 -0
- package/dist/{merge-Bi2VedIr.js → merge-BkFru0eg.js} +5 -5
- package/dist/{merge-BFk7nT59.cjs → merge-SRws1-Zj.cjs} +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/{storage-BSthKLSG.js → storage-CmGHg7OA.js} +11 -10
- package/dist/storage-DM0EvkVf.cjs +1 -0
- package/dist/storage.cjs +1 -1
- package/dist/storage.js +1 -1
- package/dist/styles/markdown-explorer.css +1 -1
- package/dist/useSplitPersistence-B1b5Lg5E.js +42 -0
- package/dist/useSplitPersistence-DRjsPZdH.cjs +1 -0
- package/docs/behavior/dom-hooks.md +15 -10
- package/docs/behavior/layout.md +53 -14
- package/docs/behavior/localization.md +2 -1
- package/docs/behavior/url-contract.md +18 -6
- package/package.json +1 -1
- package/dist/EditSurface-BLlu5zEt.cjs +0 -2
- package/dist/EditSurface-CF2io496.js +0 -705
- package/dist/ExplorerSplit-Cjvy0JHP.cjs +0 -1
- package/dist/MultiLayout-BjA0k-5n.cjs +0 -1
- package/dist/MultiLayout-D8F0BfxA.js +0 -947
- package/dist/TreeLayout-CQUpgsxz.cjs +0 -1
- package/dist/TreeLayout-rhyVTfrI.js +0 -29
- package/dist/index-Dn7cYy-4.cjs +0 -13
- package/dist/index-v997iKxe.js +0 -3464
- package/dist/location-D6RE3wAN.cjs +0 -1
- package/dist/location-IRD9h42r.js +0 -444
- package/dist/storage-Dgi4JXaB.cjs +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import { u as
|
|
3
|
-
import * as
|
|
4
|
-
import { use as
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as m, jsxs as L, Fragment as Qe } from "react/jsx-runtime";
|
|
2
|
+
import { u as $, p as kt, O as Oe, L as Je, Q as At, x as Pe, R as Lt, S as Ot, k as Pt, T as qt, U as Ct, V as Ft } from "./index-DTKGgaok.js";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { use as ye, createContext as qe, useState as F, useCallback as w, useMemo as C, useRef as E, useLayoutEffect as H, useEffect as D, useSyncExternalStore as Ce, Suspense as et, useId as Re } from "react";
|
|
5
|
+
import { n as Mt, o as _t, q as tt, v as It, s as Dt, t as Ht, C as $t, F as Zt, u as Ve, x as Bt, y as zt, b as Ee, A as Vt } from "./location-G7psbmv_.js";
|
|
6
6
|
import { useDirectoryTreeState as jt, DirectoryTree as Kt } from "@aiquants/directory-tree";
|
|
7
|
-
import { T as
|
|
8
|
-
import { s as
|
|
9
|
-
import { PanelGroup as Wt, Panel as
|
|
10
|
-
import {
|
|
11
|
-
|
|
7
|
+
import { T as Ut } from "./tapScrollCircle-u4EXeLhx.js";
|
|
8
|
+
import { s as Gt } from "./storage-CmGHg7OA.js";
|
|
9
|
+
import { PanelGroup as Wt, Panel as je, PanelResizeHandle as Xt } from "@aiquants/resize-panels";
|
|
10
|
+
import { a as Yt, u as Qt } from "./useSplitPersistence-B1b5Lg5E.js";
|
|
11
|
+
import { useLocation as Jt } from "react-router";
|
|
12
|
+
function en({
|
|
12
13
|
title: e,
|
|
13
14
|
titleId: t,
|
|
14
15
|
...n
|
|
15
16
|
}, r) {
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
17
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
18
19
|
viewBox: "0 0 24 24",
|
|
19
20
|
fill: "currentColor",
|
|
@@ -21,21 +22,21 @@ function Qt({
|
|
|
21
22
|
"data-slot": "icon",
|
|
22
23
|
ref: r,
|
|
23
24
|
"aria-labelledby": t
|
|
24
|
-
}, n), e ? /* @__PURE__ */
|
|
25
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
25
26
|
id: t
|
|
26
|
-
}, e) : null, /* @__PURE__ */
|
|
27
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
27
28
|
fillRule: "evenodd",
|
|
28
29
|
d: "M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15ZM9 12.75a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5H9Z",
|
|
29
30
|
clipRule: "evenodd"
|
|
30
31
|
}));
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
33
|
+
const tn = /* @__PURE__ */ f.forwardRef(en);
|
|
34
|
+
function nn({
|
|
34
35
|
title: e,
|
|
35
36
|
titleId: t,
|
|
36
37
|
...n
|
|
37
38
|
}, r) {
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
39
40
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
41
|
viewBox: "0 0 24 24",
|
|
41
42
|
fill: "currentColor",
|
|
@@ -43,21 +44,21 @@ function en({
|
|
|
43
44
|
"data-slot": "icon",
|
|
44
45
|
ref: r,
|
|
45
46
|
"aria-labelledby": t
|
|
46
|
-
}, n), e ? /* @__PURE__ */
|
|
47
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
47
48
|
id: t
|
|
48
|
-
}, e) : null, /* @__PURE__ */
|
|
49
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
49
50
|
fillRule: "evenodd",
|
|
50
51
|
d: "M19.5 21a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-5.379a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H4.5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h15Zm-6.75-10.5a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25v2.25a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V10.5Z",
|
|
51
52
|
clipRule: "evenodd"
|
|
52
53
|
}));
|
|
53
54
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
55
|
+
const rn = /* @__PURE__ */ f.forwardRef(nn);
|
|
56
|
+
function an({
|
|
56
57
|
title: e,
|
|
57
58
|
titleId: t,
|
|
58
59
|
...n
|
|
59
60
|
}, r) {
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
61
62
|
xmlns: "http://www.w3.org/2000/svg",
|
|
62
63
|
viewBox: "0 0 24 24",
|
|
63
64
|
fill: "currentColor",
|
|
@@ -65,21 +66,21 @@ function nn({
|
|
|
65
66
|
"data-slot": "icon",
|
|
66
67
|
ref: r,
|
|
67
68
|
"aria-labelledby": t
|
|
68
|
-
}, n), e ? /* @__PURE__ */
|
|
69
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
69
70
|
id: t
|
|
70
|
-
}, e) : null, /* @__PURE__ */
|
|
71
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
71
72
|
d: "M16.5 6a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v7.5a3 3 0 0 0 3 3v-6A4.5 4.5 0 0 1 10.5 6h6Z"
|
|
72
|
-
}), /* @__PURE__ */
|
|
73
|
+
}), /* @__PURE__ */ f.createElement("path", {
|
|
73
74
|
d: "M18 7.5a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-7.5a3 3 0 0 1-3-3v-7.5a3 3 0 0 1 3-3H18Z"
|
|
74
75
|
}));
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
-
function
|
|
77
|
+
const ln = /* @__PURE__ */ f.forwardRef(an);
|
|
78
|
+
function on({
|
|
78
79
|
title: e,
|
|
79
80
|
titleId: t,
|
|
80
81
|
...n
|
|
81
82
|
}, r) {
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
83
84
|
xmlns: "http://www.w3.org/2000/svg",
|
|
84
85
|
viewBox: "0 0 24 24",
|
|
85
86
|
fill: "currentColor",
|
|
@@ -87,17 +88,17 @@ function an({
|
|
|
87
88
|
"data-slot": "icon",
|
|
88
89
|
ref: r,
|
|
89
90
|
"aria-labelledby": t
|
|
90
|
-
}, n), e ? /* @__PURE__ */
|
|
91
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
91
92
|
id: t
|
|
92
|
-
}, e) : null, /* @__PURE__ */
|
|
93
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
93
94
|
fillRule: "evenodd",
|
|
94
95
|
d: "M3 6a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3V6ZM3 15.75a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-2.25Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3v-2.25Z",
|
|
95
96
|
clipRule: "evenodd"
|
|
96
97
|
}));
|
|
97
98
|
}
|
|
98
|
-
const
|
|
99
|
-
const { notices: e } =
|
|
100
|
-
return t.length === 0 ? null : /* @__PURE__ */ m("div", { className: "aqmx-explorer-notices", children: t.map((n) => /* @__PURE__ */
|
|
99
|
+
const sn = /* @__PURE__ */ f.forwardRef(on), cn = () => {
|
|
100
|
+
const { notices: e } = $(), t = ye(e);
|
|
101
|
+
return t.length === 0 ? null : /* @__PURE__ */ m("div", { className: "aqmx-explorer-notices", children: t.map((n) => /* @__PURE__ */ L("div", { className: "aqmx-callout", "data-aqmx-tone": n.tone, "data-testid": "markdown-explorer-notice", "data-aqmx-notice": n.id, children: [
|
|
101
102
|
/* @__PURE__ */ m("p", { className: "aqmx-callout-title", children: n.title }),
|
|
102
103
|
n.body === void 0 ? null : /* @__PURE__ */ m("p", { className: "aqmx-callout-body", children: n.body }),
|
|
103
104
|
n.action === void 0 ? null : (
|
|
@@ -105,12 +106,12 @@ const ln = /* @__PURE__ */ p.forwardRef(an), on = () => {
|
|
|
105
106
|
)
|
|
106
107
|
] }, n.id)) });
|
|
107
108
|
};
|
|
108
|
-
function
|
|
109
|
+
function dn({
|
|
109
110
|
title: e,
|
|
110
111
|
titleId: t,
|
|
111
112
|
...n
|
|
112
113
|
}, r) {
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
114
115
|
xmlns: "http://www.w3.org/2000/svg",
|
|
115
116
|
viewBox: "0 0 24 24",
|
|
116
117
|
fill: "currentColor",
|
|
@@ -118,15 +119,15 @@ function sn({
|
|
|
118
119
|
"data-slot": "icon",
|
|
119
120
|
ref: r,
|
|
120
121
|
"aria-labelledby": t
|
|
121
|
-
}, n), e ? /* @__PURE__ */
|
|
122
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
122
123
|
id: t
|
|
123
|
-
}, e) : null, /* @__PURE__ */
|
|
124
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
124
125
|
fillRule: "evenodd",
|
|
125
126
|
d: "M6.912 3a3 3 0 0 0-2.868 2.118l-2.411 7.838a3 3 0 0 0-.133.882V18a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3v-4.162c0-.299-.045-.596-.133-.882l-2.412-7.838A3 3 0 0 0 17.088 3H6.912Zm13.823 9.75-2.213-7.191A1.5 1.5 0 0 0 17.088 4.5H6.912a1.5 1.5 0 0 0-1.434 1.059L3.265 12.75H6.11a3 3 0 0 1 2.684 1.658l.256.513a1.5 1.5 0 0 0 1.342.829h3.218a1.5 1.5 0 0 0 1.342-.83l.256-.512a3 3 0 0 1 2.684-1.658h2.844Z",
|
|
126
127
|
clipRule: "evenodd"
|
|
127
128
|
}));
|
|
128
129
|
}
|
|
129
|
-
const
|
|
130
|
+
const un = /* @__PURE__ */ f.forwardRef(dn), Fe = qe(!0), nt = "\0loop\0", rt = "\0", mn = () => {
|
|
130
131
|
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = (l) => {
|
|
131
132
|
const a = e.get(l);
|
|
132
133
|
if (a !== void 0) return a;
|
|
@@ -134,28 +135,28 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
134
135
|
return e.set(l, s), s;
|
|
135
136
|
}, o = (l, a, s) => {
|
|
136
137
|
let d = !1;
|
|
137
|
-
const u = l.map((
|
|
138
|
-
const h = c(
|
|
139
|
-
return h !==
|
|
138
|
+
const u = l.map((p) => {
|
|
139
|
+
const h = c(p, a, s);
|
|
140
|
+
return h !== p && (d = !0), h;
|
|
140
141
|
});
|
|
141
142
|
if (!d) return l;
|
|
142
143
|
const i = n.get(l);
|
|
143
|
-
return i !== void 0 && i.length === u.length && i.every((
|
|
144
|
+
return i !== void 0 && i.length === u.length && i.every((p, h) => p === u[h]) ? i : (n.set(l, u), u);
|
|
144
145
|
}, c = (l, a, s) => {
|
|
145
146
|
if (l.type !== "directory") return l;
|
|
146
147
|
if (s.has(l.path)) return r(l);
|
|
147
148
|
const d = l.lazy === !0 ? a(l.path) : void 0, u = d?.status === "loaded", i = u ? d.entries : l.children;
|
|
148
149
|
if (i === void 0) return l;
|
|
149
150
|
s.add(l.path);
|
|
150
|
-
const
|
|
151
|
-
if (s.delete(l.path), !u &&
|
|
151
|
+
const p = o(i, a, s);
|
|
152
|
+
if (s.delete(l.path), !u && p === l.children) return l;
|
|
152
153
|
const h = t.get(l);
|
|
153
|
-
if (h !== void 0 && h.state === d && h.children ===
|
|
154
|
-
const
|
|
155
|
-
return t.set(l, { state: d, children:
|
|
154
|
+
if (h !== void 0 && h.state === d && h.children === p) return h.grafted;
|
|
155
|
+
const g = { ...l, children: p, lazy: u ? !1 : l.lazy };
|
|
156
|
+
return t.set(l, { state: d, children: p, grafted: g }), g;
|
|
156
157
|
};
|
|
157
158
|
return (l, a) => o(l, a, /* @__PURE__ */ new Set());
|
|
158
|
-
},
|
|
159
|
+
}, fn = (e, t) => `${nt}${e}${rt}${t}`, pe = (e) => e.startsWith(nt), pn = (e) => e.slice(e.lastIndexOf(rt) + 1), ce = "data-aqmx-path", hn = (e, t, n, r, o) => {
|
|
159
160
|
const c = { aqmxPath: e.path };
|
|
160
161
|
return e.modifiedAt !== void 0 && (c.aqmxModifiedAt = e.modifiedAt), n && (c.aqmxOpen = !0), (r === "loading" || r === "failed") && (c.aqmxChildren = r), {
|
|
161
162
|
name: e.name,
|
|
@@ -167,41 +168,41 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
167
168
|
label: o,
|
|
168
169
|
data: c
|
|
169
170
|
};
|
|
170
|
-
},
|
|
171
|
-
const o =
|
|
171
|
+
}, xn = (e, t, n, r) => {
|
|
172
|
+
const o = fn(t, e.path);
|
|
172
173
|
return { name: n, type: "directory", absolutePath: o, relativePath: o, children: r, data: { aqmxLoop: e.path } };
|
|
173
|
-
},
|
|
174
|
+
}, wn = () => {
|
|
174
175
|
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = [], o = (a, s, d) => {
|
|
175
|
-
const u = a.map((
|
|
176
|
-
return i !== void 0 && i.length === u.length && i.every((
|
|
176
|
+
const u = a.map((p) => p.type === "loop" ? c(p, s, d) : l(p, s)), i = n.get(a);
|
|
177
|
+
return i !== void 0 && i.length === u.length && i.every((p, h) => p === u[h]) ? i : (n.set(a, u), u);
|
|
177
178
|
}, c = (a, s, d) => {
|
|
178
179
|
const u = t.get(a);
|
|
179
180
|
if (u !== void 0 && u.parentKey === d && u.loopFolderName === s.loopFolderName) return u.row;
|
|
180
|
-
const i =
|
|
181
|
+
const i = xn(a, d, s.loopFolderName(a.name), r);
|
|
181
182
|
return t.set(a, { row: i, parentKey: d, loopFolderName: s.loopFolderName }), i;
|
|
182
183
|
}, l = (a, s) => {
|
|
183
|
-
const d = a.type === "directory" ? a.children === void 0 ? r : o(a.children, s, a.path) : void 0, u = s.openPaths.has(a.path), i = a.type === "directory" && a.lazy === !0 ? s.childrenOf(a.path)?.status : void 0,
|
|
184
|
-
if (h !== void 0 && h.open === u && h.childrenStatus === i && h.children === d && h.renderFailedFolder ===
|
|
184
|
+
const d = a.type === "directory" ? a.children === void 0 ? r : o(a.children, s, a.path) : void 0, u = s.openPaths.has(a.path), i = a.type === "directory" && a.lazy === !0 ? s.childrenOf(a.path)?.status : void 0, p = i === "failed" ? s.renderFailedFolder : void 0, h = e.get(a);
|
|
185
|
+
if (h !== void 0 && h.open === u && h.childrenStatus === i && h.children === d && h.renderFailedFolder === p)
|
|
185
186
|
return h.row;
|
|
186
|
-
const
|
|
187
|
-
return e.set(a, { row:
|
|
187
|
+
const g = hn(a, d, u, i, p === void 0 ? void 0 : p(a));
|
|
188
|
+
return e.set(a, { row: g, open: u, childrenStatus: i, children: d, renderFailedFolder: p }), g;
|
|
188
189
|
};
|
|
189
190
|
return (a, s) => o(a, s, "");
|
|
190
|
-
},
|
|
191
|
+
}, gn = (e) => {
|
|
191
192
|
if (e === void 0) return;
|
|
192
193
|
const t = (n) => {
|
|
193
194
|
const r = n.data?.aqmxModifiedAt;
|
|
194
195
|
return typeof r == "number" ? { name: n.name, path: n.absolutePath, type: n.type, modifiedAt: r } : { name: n.name, path: n.absolutePath, type: n.type };
|
|
195
196
|
};
|
|
196
197
|
return (n, r) => e(t(n), t(r));
|
|
197
|
-
},
|
|
198
|
+
}, Le = (e, t) => {
|
|
198
199
|
const n = e.filter((r) => r.type === "directory");
|
|
199
200
|
return t === void 0 ? n : n.sort(t);
|
|
200
|
-
},
|
|
201
|
+
}, vn = (e, t) => {
|
|
201
202
|
const n = /* @__PURE__ */ new Map();
|
|
202
203
|
let r = 0;
|
|
203
204
|
const o = (c) => {
|
|
204
|
-
for (const l of
|
|
205
|
+
for (const l of Le(c, t.compare))
|
|
205
206
|
if (t.isShownExpanded(l.path)) {
|
|
206
207
|
if (l.lazy !== !0) {
|
|
207
208
|
l.children !== void 0 && o(l.children);
|
|
@@ -211,21 +212,21 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
211
212
|
}
|
|
212
213
|
};
|
|
213
214
|
return o(e), { folders: n, waiting: r };
|
|
214
|
-
},
|
|
215
|
+
}, bn = (e) => {
|
|
215
216
|
const t = /* @__PURE__ */ new Set(), n = (r) => {
|
|
216
217
|
for (const o of r)
|
|
217
218
|
o.type === "directory" && (o.lazy === !0 && t.add(o.path), o.children !== void 0 && n(o.children));
|
|
218
219
|
};
|
|
219
220
|
return n(e), t;
|
|
220
|
-
},
|
|
221
|
+
}, at = (e, t) => {
|
|
221
222
|
for (const n of e) {
|
|
222
223
|
if (n.type !== "directory") continue;
|
|
223
224
|
if (n.path === t) return n;
|
|
224
|
-
const r = n.children === void 0 ? null :
|
|
225
|
+
const r = n.children === void 0 ? null : at(n.children, t);
|
|
225
226
|
if (r !== null) return r;
|
|
226
227
|
}
|
|
227
228
|
return null;
|
|
228
|
-
},
|
|
229
|
+
}, En = (e, t, n, r) => {
|
|
229
230
|
let o = e;
|
|
230
231
|
for (const c of t) {
|
|
231
232
|
const l = o.find((a) => a.type === "directory" && a.path === c);
|
|
@@ -235,14 +236,14 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
235
236
|
o = l.children ?? [];
|
|
236
237
|
}
|
|
237
238
|
return o.some((c) => c.type === "file" && c.path === n) ? "ready" : "missing";
|
|
238
|
-
},
|
|
239
|
+
}, Ke = /* @__PURE__ */ new Set(), yn = (e, t) => e.has(t) ? e : new Set(e).add(t), Rn = (e, t) => {
|
|
239
240
|
if (!t.some((r) => e.has(r))) return e;
|
|
240
241
|
const n = new Set(t);
|
|
241
242
|
return new Set([...e].filter((r) => !n.has(r)));
|
|
242
|
-
},
|
|
243
|
-
const [e, t] =
|
|
244
|
-
return
|
|
245
|
-
},
|
|
243
|
+
}, Sn = (e, t) => [...e].every((n) => t.has(n)) ? e : new Set([...e].filter((n) => t.has(n))), Tn = () => {
|
|
244
|
+
const [e, t] = F(Ke), n = w((l) => t((a) => yn(a, l)), []), r = w((l) => t((a) => Rn(a, l)), []), o = w((l) => t((a) => Sn(a, l)), []), c = w(() => t(Ke), []);
|
|
245
|
+
return C(() => ({ direct: e, markDirect: n, unmarkDirect: r, pruneDirect: o, clearDirect: c }), [e, n, r, o, c]);
|
|
246
|
+
}, Nn = (e) => ({
|
|
246
247
|
budget: e,
|
|
247
248
|
handled: /* @__PURE__ */ new Set(),
|
|
248
249
|
loads: /* @__PURE__ */ new Set(),
|
|
@@ -251,9 +252,9 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
251
252
|
depthLimited: !1,
|
|
252
253
|
announcedStart: !1,
|
|
253
254
|
issuedAgainst: null
|
|
254
|
-
}),
|
|
255
|
+
}), kn = (e, t) => {
|
|
255
256
|
const n = [];
|
|
256
|
-
let r =
|
|
257
|
+
let r = Le(t.entries, t.compare);
|
|
257
258
|
for (let o = 1; r.length > 0; o += 1) {
|
|
258
259
|
const c = [];
|
|
259
260
|
for (const l of r) {
|
|
@@ -275,130 +276,130 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
275
276
|
}
|
|
276
277
|
n.push(a), e.opened += 1;
|
|
277
278
|
}
|
|
278
|
-
l.lazy !== !0 && l.children !== void 0 && c.push(...
|
|
279
|
+
l.lazy !== !0 && l.children !== void 0 && c.push(...Le(l.children, t.compare));
|
|
279
280
|
}
|
|
280
281
|
r = c;
|
|
281
282
|
}
|
|
282
283
|
return n;
|
|
283
|
-
},
|
|
284
|
+
}, lt = (e, t) => e.every((n) => n.type !== "directory" || t(n.path) && (n.lazy === !0 || n.children === void 0 || lt(n.children, t))), An = (e, t) => {
|
|
284
285
|
if (e.folderLimited) return { kind: "folder-limit", opened: e.opened };
|
|
285
286
|
if (e.depthLimited) return { kind: "depth-limit", opened: e.opened };
|
|
286
287
|
let n = 0;
|
|
287
288
|
for (const r of e.loads) t.childrenOf(r)?.status === "failed" && (n += 1);
|
|
288
|
-
return { kind: "done", opened: e.opened, failed: n, complete:
|
|
289
|
-
},
|
|
290
|
-
const t =
|
|
291
|
-
|
|
289
|
+
return { kind: "done", opened: e.opened, failed: n, complete: lt(t.entries, t.isShownExpanded) };
|
|
290
|
+
}, ke = Object.freeze({ state: "idle" }), Ln = (e) => {
|
|
291
|
+
const t = E(null), n = E(e), [r, o] = F(ke);
|
|
292
|
+
H(() => {
|
|
292
293
|
n.current = e;
|
|
293
294
|
});
|
|
294
295
|
const c = w(() => {
|
|
295
|
-
t.current === null && (t.current =
|
|
296
|
+
t.current === null && (t.current = Nn(n.current.budget), o({ state: "running", opened: 0 }));
|
|
296
297
|
}, []), l = w(() => {
|
|
297
|
-
t.current = null, o(
|
|
298
|
+
t.current = null, o(ke);
|
|
298
299
|
}, []), a = w((s) => {
|
|
299
300
|
const d = t.current;
|
|
300
301
|
if (d === null) return;
|
|
301
|
-
const u =
|
|
302
|
+
const u = kn(d, s);
|
|
302
303
|
if (u.length > 0 && (d.issuedAgainst = s.expanded, n.current.expandMultiple([...u])), !d.announcedStart && (d.loads.size > 0 || s.waiting > 0) && (d.announcedStart = !0, n.current.onStart()), u.length === 0 && !s.expansionPending && s.expanded !== d.issuedAgainst && s.waiting === 0) {
|
|
303
304
|
t.current = null;
|
|
304
|
-
const
|
|
305
|
-
o(
|
|
305
|
+
const p = An(d, s);
|
|
306
|
+
o(p.kind === "done" ? ke : { state: "stopped", stop: p.kind, opened: p.opened }), n.current.onFinish(p);
|
|
306
307
|
return;
|
|
307
308
|
}
|
|
308
309
|
const { opened: i } = d;
|
|
309
|
-
o((
|
|
310
|
+
o((p) => p.state === "running" && p.opened === i ? p : { state: "running", opened: i });
|
|
310
311
|
}, []);
|
|
311
|
-
return
|
|
312
|
-
},
|
|
313
|
-
const s =
|
|
314
|
-
|
|
315
|
-
h.current = r,
|
|
312
|
+
return C(() => ({ status: r, start: c, end: l, advance: a }), [r, c, l, a]);
|
|
313
|
+
}, Ue = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], On = 8, Ge = { least: Number.POSITIVE_INFINITY, stalled: 0 }, Pn = ({ tree: e, container: t, path: n, chain: r, rows: o, cancel: c, displayed: l, placement: a }) => {
|
|
314
|
+
const s = E(null), d = E(!0), u = E(Ge), i = E(null), p = E(null), h = E(r), g = E(a);
|
|
315
|
+
H(() => {
|
|
316
|
+
h.current = r, g.current = a;
|
|
316
317
|
}, [r, a]);
|
|
317
|
-
const
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
}, []),
|
|
321
|
-
s.current = null,
|
|
322
|
-
}, [
|
|
323
|
-
const
|
|
324
|
-
s.current === null ||
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
d.current = !0, i.current?.phase === "opening" &&
|
|
318
|
+
const v = w(() => {
|
|
319
|
+
const R = i.current;
|
|
320
|
+
R !== null && (i.current = null, R.phase === "asking" ? R.controller.abort() : h.current?.open(null));
|
|
321
|
+
}, []), O = w(() => {
|
|
322
|
+
s.current = null, v();
|
|
323
|
+
}, [v]), A = w(() => {
|
|
324
|
+
const R = t.current;
|
|
325
|
+
s.current === null || p.current !== null || R === null || R.getClientRects().length === 0 || (p.current = requestAnimationFrame(() => {
|
|
326
|
+
p.current = null;
|
|
327
|
+
const k = s.current;
|
|
328
|
+
if (k === null) return;
|
|
329
|
+
const S = g.current(k);
|
|
330
|
+
if (S === 0) {
|
|
331
|
+
d.current = !0, i.current?.phase === "opening" && v();
|
|
331
332
|
return;
|
|
332
333
|
}
|
|
333
|
-
if (e.current?.scrollToPath(
|
|
334
|
-
i.current?.phase === "opening" &&
|
|
335
|
-
const { least:
|
|
336
|
-
u.current =
|
|
334
|
+
if (e.current?.scrollToPath(k, { align: "nearest" }) === !0) {
|
|
335
|
+
i.current?.phase === "opening" && v();
|
|
336
|
+
const { least: _, stalled: B } = u.current;
|
|
337
|
+
u.current = S < _ ? { least: S, stalled: 0 } : { least: _, stalled: B + 1 }, u.current.stalled < On && A();
|
|
337
338
|
return;
|
|
338
339
|
}
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
340
|
+
const b = i.current;
|
|
341
|
+
if (b === null) {
|
|
341
342
|
s.current = null;
|
|
342
343
|
return;
|
|
343
344
|
}
|
|
344
|
-
|
|
345
|
+
b.phase === "opening" && h.current?.progress(b.folders, k) !== "loading" && O();
|
|
345
346
|
}));
|
|
346
|
-
}, [e, t,
|
|
347
|
-
d.current = !1, u.current =
|
|
348
|
-
}, [
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
for (const
|
|
347
|
+
}, [e, t, v, O]), q = w(() => {
|
|
348
|
+
d.current = !1, u.current = Ge, A();
|
|
349
|
+
}, [A]);
|
|
350
|
+
D(() => {
|
|
351
|
+
const R = t.current;
|
|
352
|
+
if (R === null) return;
|
|
353
|
+
const k = typeof ResizeObserver > "u" ? null : new ResizeObserver(q);
|
|
354
|
+
k?.observe(R);
|
|
355
|
+
for (const S of Ue) R.addEventListener(S, O, { passive: !0 });
|
|
355
356
|
return () => {
|
|
356
|
-
|
|
357
|
-
for (const
|
|
358
|
-
|
|
357
|
+
k?.disconnect();
|
|
358
|
+
for (const S of Ue) R.removeEventListener(S, O);
|
|
359
|
+
p.current !== null && cancelAnimationFrame(p.current), p.current = null, v();
|
|
359
360
|
};
|
|
360
|
-
}, [t,
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
361
|
+
}, [t, q, O, v]);
|
|
362
|
+
const y = r !== null;
|
|
363
|
+
D(() => {
|
|
364
|
+
const R = t.current;
|
|
365
|
+
if (O(), n === null || R === null || R.contains(R.ownerDocument.activeElement)) return;
|
|
365
366
|
s.current = n;
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
const
|
|
369
|
-
i.current =
|
|
370
|
-
i.current ===
|
|
367
|
+
const k = h.current;
|
|
368
|
+
if (y && k !== null) {
|
|
369
|
+
const S = new AbortController(), b = { phase: "asking", controller: S };
|
|
370
|
+
i.current = b, k.ancestors(n, S.signal).then((_) => {
|
|
371
|
+
i.current === b && (_ === null ? i.current = null : (i.current = { phase: "opening", folders: _ }, h.current?.open(_)), q());
|
|
371
372
|
});
|
|
372
373
|
}
|
|
373
|
-
|
|
374
|
-
}, [n,
|
|
375
|
-
(i.current?.phase === "opening" || s.current !== null && !d.current) &&
|
|
376
|
-
}, [o,
|
|
377
|
-
const Z =
|
|
378
|
-
|
|
379
|
-
Z.current !== c && (Z.current = c,
|
|
380
|
-
}, [c,
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}, [l,
|
|
385
|
-
},
|
|
386
|
-
const t =
|
|
374
|
+
q();
|
|
375
|
+
}, [n, y, t, O, q]), D(() => {
|
|
376
|
+
(i.current?.phase === "opening" || s.current !== null && !d.current) && q();
|
|
377
|
+
}, [o, q]);
|
|
378
|
+
const Z = E(c);
|
|
379
|
+
D(() => {
|
|
380
|
+
Z.current !== c && (Z.current = c, O());
|
|
381
|
+
}, [c, O]);
|
|
382
|
+
const N = E(l);
|
|
383
|
+
D(() => {
|
|
384
|
+
N.current && !l && v(), N.current = l;
|
|
385
|
+
}, [l, v]);
|
|
386
|
+
}, qn = "--aqmx-tree-line", Cn = Object.freeze(["(forced-colors: active)", "(prefers-color-scheme: dark)"]), Fn = "data-aqmx-tree-probe", Mn = Object.freeze({ rowHeight: Mt, lineColor: null }), _n = /^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/u, In = (e) => {
|
|
387
|
+
const t = _n.exec(e);
|
|
387
388
|
return t === null ? e : `#${t.slice(1).map((n) => Number(n).toString(16).padStart(2, "0")).join("")}`;
|
|
388
|
-
},
|
|
389
|
-
const [n, r] =
|
|
390
|
-
return
|
|
389
|
+
}, Dn = (e, t) => {
|
|
390
|
+
const [n, r] = F(Mn);
|
|
391
|
+
return H(() => {
|
|
391
392
|
const o = e.current;
|
|
392
393
|
if (o === null) return;
|
|
393
394
|
const c = () => {
|
|
394
|
-
const s = Math.round(o.getBoundingClientRect().height), d = getComputedStyle(o), u = d.getPropertyValue(
|
|
395
|
+
const s = Math.round(o.getBoundingClientRect().height), d = getComputedStyle(o), u = d.getPropertyValue(qn).trim() === "" ? null : In(d.color);
|
|
395
396
|
r((i) => {
|
|
396
|
-
const
|
|
397
|
-
return i.rowHeight ===
|
|
397
|
+
const p = Number.isFinite(s) && s > 0 ? s : i.rowHeight;
|
|
398
|
+
return i.rowHeight === p && i.lineColor === u ? i : { rowHeight: p, lineColor: u };
|
|
398
399
|
});
|
|
399
400
|
};
|
|
400
401
|
c();
|
|
401
|
-
const l =
|
|
402
|
+
const l = Cn.map((s) => window.matchMedia(s));
|
|
402
403
|
for (const s of l) s.addEventListener("change", c);
|
|
403
404
|
const a = typeof ResizeObserver > "u" ? null : new ResizeObserver(c);
|
|
404
405
|
return a?.observe(o), () => {
|
|
@@ -406,13 +407,13 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
406
407
|
a?.disconnect();
|
|
407
408
|
};
|
|
408
409
|
}, [e, t]), n;
|
|
409
|
-
},
|
|
410
|
-
const n =
|
|
410
|
+
}, ot = "markdown-explorer-tree-scroll", Hn = 0.5, st = (e, t) => [...e.querySelectorAll(`[role="treeitem"][${ce}]`)].find((n) => n.getAttribute(ce) === t), $n = (e, t) => {
|
|
411
|
+
const n = st(e, t), r = n?.closest(`[data-testid="${ot}"]`);
|
|
411
412
|
if (n === void 0 || r === null || r === void 0) return Number.POSITIVE_INFINITY;
|
|
412
413
|
const o = r.getBoundingClientRect(), c = n.getBoundingClientRect(), l = o.top - c.top, a = c.height > o.height ? Math.abs(l) : Math.max(0, l) + Math.max(0, c.bottom - o.bottom);
|
|
413
|
-
return a <=
|
|
414
|
-
},
|
|
415
|
-
testId:
|
|
414
|
+
return a <= Hn ? 0 : a;
|
|
415
|
+
}, Zn = {
|
|
416
|
+
testId: ot,
|
|
416
417
|
overscanCount: 13,
|
|
417
418
|
callbackThrottleMs: 13,
|
|
418
419
|
scrollBarOptions: {
|
|
@@ -422,17 +423,17 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
422
423
|
enableArrowButtons: !0,
|
|
423
424
|
enableArrowButtonTabStops: !1,
|
|
424
425
|
enableScrollToTopBottomButtons: !0,
|
|
425
|
-
tapScrollCircleOptions:
|
|
426
|
+
tapScrollCircleOptions: Ut
|
|
426
427
|
},
|
|
427
428
|
behaviorOptions: { enablePointerDrag: !0 }
|
|
428
|
-
},
|
|
429
|
-
const t = e instanceof Element ? e.closest(`[${
|
|
430
|
-
return t === null || t.getAttribute("data-entry-type") !== "file" ? null : t.getAttribute(
|
|
431
|
-
},
|
|
432
|
-
const { labels: e } =
|
|
433
|
-
return /* @__PURE__ */
|
|
429
|
+
}, Bn = { hoverClassName: "", directorySelectedClassName: "", itemSelectedClassName: "" }, zn = { color: "inherit", fontSize: "inherit" }, Vn = { paddingBlock: 0, fontSize: "inherit" }, jn = /* @__PURE__ */ new Set(), Kn = /* @__PURE__ */ new Map(), Un = { color: "var(--aqmx-tree-line)" }, Gn = (e) => {
|
|
430
|
+
const t = e instanceof Element ? e.closest(`[${ce}]`) : null;
|
|
431
|
+
return t === null || t.getAttribute("data-entry-type") !== "file" ? null : t.getAttribute(ce);
|
|
432
|
+
}, ct = (e, t, n, r) => n === "folder-limit" ? e.expandAllFolderLimit(r, t.maxFolders, e.expandAll) : e.expandAllDepthLimit(r, t.maxDepth), Wn = (e, t, n) => n.kind === "done" ? e.expandAllDone(n.opened, n.failed, n.complete) : ct(e, t, n.kind, n.opened), it = () => {
|
|
433
|
+
const { labels: e } = $();
|
|
434
|
+
return /* @__PURE__ */ L("div", { className: "aqmx-explorer-loading", "aria-busy": "true", "data-testid": "markdown-explorer-tree-loading", children: [
|
|
434
435
|
/* @__PURE__ */ m("p", { className: "aqmx-explorer-loading-text", children: e.treeLoading }),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ L("div", { className: "aqmx-skeleton", "aria-hidden": "true", children: [
|
|
436
437
|
/* @__PURE__ */ m("span", {}),
|
|
437
438
|
/* @__PURE__ */ m("span", {}),
|
|
438
439
|
/* @__PURE__ */ m("span", {}),
|
|
@@ -440,19 +441,19 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
440
441
|
/* @__PURE__ */ m("span", {})
|
|
441
442
|
] })
|
|
442
443
|
] });
|
|
443
|
-
},
|
|
444
|
-
const { labels: e } =
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */ m(
|
|
444
|
+
}, Xn = () => {
|
|
445
|
+
const { labels: e } = $();
|
|
446
|
+
return /* @__PURE__ */ L("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-tree-empty", children: [
|
|
447
|
+
/* @__PURE__ */ m(un, { className: "aqmx-explorer-empty-icon", "aria-hidden": "true" }),
|
|
447
448
|
/* @__PURE__ */ m("p", { className: "aqmx-empty-title", children: e.treeEmptyTitle }),
|
|
448
449
|
/* @__PURE__ */ m("p", { className: "aqmx-explorer-empty-body", children: e.treeEmptyBody })
|
|
449
450
|
] });
|
|
450
|
-
},
|
|
451
|
-
const { labels: n } =
|
|
452
|
-
return /* @__PURE__ */
|
|
451
|
+
}, Yn = ({ name: e, onRetry: t }) => {
|
|
452
|
+
const { labels: n } = $(), r = Re();
|
|
453
|
+
return /* @__PURE__ */ L("span", { className: "aqmx-explorer-folder-failed", children: [
|
|
453
454
|
/* @__PURE__ */ m("span", { className: "aqmx-explorer-folder-name", children: e }),
|
|
454
455
|
/* @__PURE__ */ m("span", { id: r, className: "aqmx-explorer-folder-error", children: n.folderLoadFailed }),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ L(
|
|
456
457
|
"button",
|
|
457
458
|
{
|
|
458
459
|
type: "button",
|
|
@@ -462,7 +463,7 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
462
463
|
onClick: (o) => {
|
|
463
464
|
o.stopPropagation();
|
|
464
465
|
const c = o.currentTarget, l = c.ownerDocument.activeElement === c ? c.closest('[role="treeitem"]') : null;
|
|
465
|
-
l instanceof HTMLElement &&
|
|
466
|
+
l instanceof HTMLElement && Je(l), t();
|
|
466
467
|
},
|
|
467
468
|
onKeyDown: (o) => {
|
|
468
469
|
o.key !== "Escape" && o.stopPropagation();
|
|
@@ -474,7 +475,7 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
474
475
|
}
|
|
475
476
|
)
|
|
476
477
|
] });
|
|
477
|
-
},
|
|
478
|
+
}, Qn = ({
|
|
478
479
|
entries: e,
|
|
479
480
|
version: t,
|
|
480
481
|
mode: n,
|
|
@@ -484,151 +485,158 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
484
485
|
openPaths: l,
|
|
485
486
|
selection: a,
|
|
486
487
|
onOpenDocument: s,
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
488
|
+
folders: d,
|
|
489
|
+
onRevealSource: u,
|
|
490
|
+
expansion: i,
|
|
491
|
+
onShown: p,
|
|
492
|
+
marks: h,
|
|
493
|
+
claimsHeld: g,
|
|
492
494
|
expandAll: v,
|
|
493
|
-
revealCancel:
|
|
495
|
+
revealCancel: O
|
|
494
496
|
}) => {
|
|
495
|
-
const { trees:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}, [
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
j !== void 0 &&
|
|
497
|
+
const { trees: A, documents: q, labels: y, locale: Z, theme: N, data: R, config: k, sources: S, reveals: b } = $(), _ = ye(Fe), [B] = F(wn), ie = E(null), { rowHeight: re, lineColor: K } = Dn(ie, N), { isExpanded: U, toggle: ae, expandMultiple: z, collapseMultiple: Q, expanded: J, isPending: ee } = i, { alwaysExpanded: M, sortMode: le, folderPlacement: de, readmePlacement: he } = o, { direct: oe, markDirect: G, unmarkDirect: te, pruneDirect: we } = h, { running: ue, advance: me } = v, xe = E(null), se = E(null), W = C(() => _t({ sortMode: le, folderPlacement: de, readmePlacement: he }), [le, de, he]), P = C(() => gn(W), [W]), I = w((x) => A.children(r, x), [A, r]), V = C(() => bn(e), [e]), ne = w((x) => !pe(x) && (U(x) || M && !V.has(x)), [U, M, V]), X = E({ shownExpanded: ne, isExpanded: U, unloadedFolders: V, entries: e, childrenOf: I });
|
|
498
|
+
H(() => {
|
|
499
|
+
X.current = { shownExpanded: ne, isExpanded: U, unloadedFolders: V, entries: e, childrenOf: I };
|
|
500
|
+
}, [ne, U, V, e, I]);
|
|
501
|
+
const Ie = w((x) => {
|
|
502
|
+
xe.current?.scrollToPath(x, { align: "nearest" }), requestAnimationFrame(() => {
|
|
503
|
+
const T = se.current, j = T === null ? void 0 : st(T, x);
|
|
504
|
+
j !== void 0 && Je(j);
|
|
503
505
|
});
|
|
504
|
-
}, []),
|
|
506
|
+
}, []), ht = w(
|
|
505
507
|
(x) => {
|
|
506
508
|
if (pe(x)) {
|
|
507
|
-
|
|
509
|
+
Ie(pn(x));
|
|
508
510
|
return;
|
|
509
511
|
}
|
|
510
|
-
|
|
512
|
+
X.current.isExpanded(x) ? te([x]) : X.current.unloadedFolders.has(x) && G(x), ae(x);
|
|
511
513
|
},
|
|
512
|
-
[
|
|
513
|
-
),
|
|
514
|
+
[Ie, G, te, ae]
|
|
515
|
+
), Se = w(
|
|
514
516
|
(x) => {
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
+
const T = x.filter((j) => !pe(j));
|
|
518
|
+
T.length !== 0 && (te(T), Q(T));
|
|
517
519
|
},
|
|
518
|
-
[
|
|
519
|
-
),
|
|
520
|
+
[te, Q]
|
|
521
|
+
), xt = w(
|
|
520
522
|
(x) => {
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
+
const T = x.filter((j) => !pe(j));
|
|
524
|
+
T.length !== 0 && (T.length < x.length && T.every((j) => X.current.shownExpanded(j)) ? Se(T) : z(T));
|
|
523
525
|
},
|
|
524
|
-
[
|
|
525
|
-
),
|
|
526
|
+
[z, Se]
|
|
527
|
+
), De = w(
|
|
526
528
|
(x) => /* @__PURE__ */ m(
|
|
527
|
-
|
|
529
|
+
Yn,
|
|
528
530
|
{
|
|
529
531
|
name: x.name,
|
|
530
532
|
onRetry: () => {
|
|
531
|
-
|
|
533
|
+
G(x.path), A.retryChildren(r, x.path), X.current.shownExpanded(x.path) || z([x.path]);
|
|
532
534
|
}
|
|
533
535
|
}
|
|
534
536
|
),
|
|
535
|
-
[
|
|
536
|
-
),
|
|
537
|
-
for (const x of
|
|
538
|
-
}, [
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}, [
|
|
542
|
-
const
|
|
537
|
+
[A, r, G, z]
|
|
538
|
+
), He = n === "multi" ? l : jn, { loopFolderName: $e } = y, wt = C(() => B(e, { openPaths: He, childrenOf: I, renderFailedFolder: De, loopFolderName: $e }), [B, e, He, I, De, $e, t]), gt = At(q, Gn), Ze = E([]), ge = w(() => {
|
|
539
|
+
for (const x of Ze.current) X.current.unloadedFolders.has(x) && G(x);
|
|
540
|
+
}, [G]), { maxDepth: Te } = k.revealDocument, Be = E(u);
|
|
541
|
+
H(() => {
|
|
542
|
+
Be.current = u;
|
|
543
|
+
}, [u]);
|
|
544
|
+
const vt = C(
|
|
543
545
|
() => ({
|
|
544
|
-
ancestors: async (x,
|
|
545
|
-
const j =
|
|
546
|
+
ancestors: async (x, T) => {
|
|
547
|
+
const j = b.take(r, x);
|
|
546
548
|
if (j !== null) return j;
|
|
547
|
-
if (!
|
|
548
|
-
const
|
|
549
|
-
return
|
|
549
|
+
if (!b.mayMove(x)) {
|
|
550
|
+
const fe = await R.ancestors(r, x, T);
|
|
551
|
+
return fe.status !== "ok" || fe.ancestors === null || fe.ancestors.length > Te ? null : fe.ancestors;
|
|
550
552
|
}
|
|
551
|
-
const
|
|
552
|
-
return
|
|
553
|
+
const Y = await R.reveal(r, x, T);
|
|
554
|
+
return Y.status !== "ok" || Y.source === null || Y.ancestors.length > Te ? null : Y.source === r ? Y.ancestors : (T.aborted || !S.some((fe) => fe.id === Y.source) || (b.move(Y.source, x, Y.ancestors), Be.current(Y.source)), null);
|
|
553
555
|
},
|
|
554
556
|
open: (x) => {
|
|
555
|
-
|
|
557
|
+
Ze.current = x ?? [], x !== null && (ge(), z([...x]));
|
|
556
558
|
},
|
|
557
|
-
progress: (x,
|
|
559
|
+
progress: (x, T) => En(X.current.entries, x, T, { isShownExpanded: X.current.shownExpanded, childrenOf: X.current.childrenOf })
|
|
558
560
|
}),
|
|
559
|
-
[
|
|
561
|
+
[R, r, S, b, Te, ge, z]
|
|
560
562
|
);
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}, [e,
|
|
568
|
-
|
|
569
|
-
}, [
|
|
570
|
-
const
|
|
563
|
+
D(() => ge(), [ge, V]);
|
|
564
|
+
const bt = C(() => [e, t, J], [e, t, J]), Et = w((x) => se.current === null ? Number.POSITIVE_INFINITY : $n(se.current, x), []);
|
|
565
|
+
Pn({ tree: xe, container: se, path: c.path, chain: c.openFolders ? vt : null, rows: bt, cancel: O, displayed: _, placement: Et });
|
|
566
|
+
const ze = w((x) => oe.has(x), [oe]), ve = C(() => vn(e, { isShownExpanded: ne, childrenOf: I, compare: W, isDirect: ze }), [e, ne, I, W, ze, t]), be = _ && g;
|
|
567
|
+
H(() => {
|
|
568
|
+
p(e);
|
|
569
|
+
}, [e, p]), H(() => () => p(null), [p]), D(() => A.claimChildren(r, be ? ve.folders : Kn), [A, r, be, ve]), D(() => we(V), [we, V]), D(() => {
|
|
570
|
+
be && ue && me({ entries: e, isShownExpanded: ne, childrenOf: I, compare: W, expanded: J, waiting: ve.waiting, expansionPending: ee });
|
|
571
|
+
}, [be, ue, me, e, ne, I, W, J, ve, ee]);
|
|
572
|
+
const yt = w(
|
|
571
573
|
(x) => {
|
|
572
|
-
|
|
574
|
+
const T = x.entry.absolutePath;
|
|
575
|
+
if (x.isDirectory) {
|
|
576
|
+
if (d === null || pe(T) || T === d.current) return;
|
|
577
|
+
x.isExpanded && x.preventDefault(), b.settle(T), d.open(T);
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
b.settle(T), s(T);
|
|
573
581
|
},
|
|
574
|
-
[
|
|
575
|
-
), { onChange:
|
|
576
|
-
() =>
|
|
577
|
-
pe(x.absolutePath) ||
|
|
582
|
+
[b, s, d]
|
|
583
|
+
), { onChange: Ne } = a, Rt = C(
|
|
584
|
+
() => Ne === null ? void 0 : (x, T) => {
|
|
585
|
+
pe(x.absolutePath) || Ne({ path: x.absolutePath, name: x.name, selected: T });
|
|
578
586
|
},
|
|
579
|
-
[
|
|
580
|
-
),
|
|
587
|
+
[Ne]
|
|
588
|
+
), St = C(() => new Set(a.items), [a.items]), Tt = C(
|
|
581
589
|
() => ({
|
|
582
|
-
entryKindDirectory:
|
|
583
|
-
entryKindFile:
|
|
584
|
-
scrollUp:
|
|
585
|
-
scrollDown:
|
|
586
|
-
scrollToTop:
|
|
587
|
-
scrollToBottom:
|
|
590
|
+
entryKindDirectory: y.treeEntryKindDirectory,
|
|
591
|
+
entryKindFile: y.treeEntryKindFile,
|
|
592
|
+
scrollUp: y.treeScrollUp,
|
|
593
|
+
scrollDown: y.treeScrollDown,
|
|
594
|
+
scrollToTop: y.treeScrollToTop,
|
|
595
|
+
scrollToBottom: y.treeScrollToBottom
|
|
588
596
|
}),
|
|
589
|
-
[
|
|
590
|
-
),
|
|
591
|
-
return /* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */ m("span", { ref:
|
|
597
|
+
[y]
|
|
598
|
+
), Nt = K === null ? { showTreeLines: !1 } : { showTreeLines: o.lines, lineColor: K };
|
|
599
|
+
return /* @__PURE__ */ L("div", { ref: se, className: "aqmx-explorer-tree", "data-testid": "markdown-explorer-tree", ...gt, children: [
|
|
600
|
+
/* @__PURE__ */ m("span", { ref: ie, className: "aqmx-explorer-tree-probe", "aria-hidden": "true", [Fn]: "" }),
|
|
593
601
|
/* @__PURE__ */ m(
|
|
594
602
|
Kt,
|
|
595
603
|
{
|
|
596
|
-
ref:
|
|
597
|
-
entries:
|
|
604
|
+
ref: xe,
|
|
605
|
+
entries: wt,
|
|
598
606
|
expansion: {
|
|
599
|
-
toggle:
|
|
600
|
-
isExpanded:
|
|
601
|
-
expandMultiple:
|
|
602
|
-
collapseMultiple:
|
|
603
|
-
isPending:
|
|
607
|
+
toggle: ht,
|
|
608
|
+
isExpanded: ne,
|
|
609
|
+
expandMultiple: xt,
|
|
610
|
+
collapseMultiple: Se,
|
|
611
|
+
isPending: ee && !ue,
|
|
604
612
|
doubleClickAction: o.doubleClickAction
|
|
605
613
|
},
|
|
606
|
-
selection: { mode: a.mode, selectedPath: a.shownPath, currentPath: a.shownPath, selectedItems:
|
|
614
|
+
selection: { mode: a.mode, selectedPath: a.shownPath, currentPath: a.shownPath, selectedItems: St, onEntryClick: yt, onSelectionChange: Rt },
|
|
607
615
|
visual: {
|
|
608
616
|
className: "aqmx-explorer-tree-view",
|
|
609
|
-
ariaLabel:
|
|
610
|
-
...
|
|
617
|
+
ariaLabel: y.treeRegion,
|
|
618
|
+
...Nt,
|
|
611
619
|
showExpandIcons: o.expandIcons,
|
|
612
|
-
expandIconStyle:
|
|
620
|
+
expandIconStyle: Un,
|
|
613
621
|
showDirectoryIcons: o.directoryIcons,
|
|
614
622
|
showFileIcons: o.fileIcons,
|
|
615
623
|
expandIconSize: o.expandIconSize,
|
|
616
|
-
itemHeight:
|
|
624
|
+
itemHeight: re,
|
|
617
625
|
removeRootIndent: o.removeRootIndent,
|
|
618
|
-
highlightStyles:
|
|
619
|
-
entryStyle:
|
|
620
|
-
nameStyle:
|
|
626
|
+
highlightStyles: Bn,
|
|
627
|
+
entryStyle: Vn,
|
|
628
|
+
nameStyle: zn
|
|
621
629
|
},
|
|
622
|
-
virtualScroll:
|
|
623
|
-
sort:
|
|
624
|
-
locale:
|
|
625
|
-
labels:
|
|
630
|
+
virtualScroll: Zn,
|
|
631
|
+
sort: P,
|
|
632
|
+
locale: Z,
|
|
633
|
+
labels: Tt
|
|
626
634
|
}
|
|
627
635
|
)
|
|
628
636
|
] });
|
|
629
|
-
},
|
|
630
|
-
const { labels: n } =
|
|
631
|
-
|
|
637
|
+
}, Jn = ({ pending: e, status: t }) => {
|
|
638
|
+
const { labels: n } = $(), r = t.state !== "running", [o, c] = F(0), l = E(!0);
|
|
639
|
+
H(() => {
|
|
632
640
|
const s = l.current;
|
|
633
641
|
if (l.current = r, !r || e > 0 && !s) {
|
|
634
642
|
c(0);
|
|
@@ -643,62 +651,62 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt =
|
|
|
643
651
|
return () => clearTimeout(d);
|
|
644
652
|
}, [r, e, o]);
|
|
645
653
|
const a = r && e === 0 ? o : e;
|
|
646
|
-
return a === 0 && r ? null : /* @__PURE__ */
|
|
654
|
+
return a === 0 && r ? null : /* @__PURE__ */ L("p", { className: "aqmx-explorer-tree-progress", "data-testid": "markdown-explorer-tree-progress", "data-aqmx-loading": String(a), "data-aqmx-expand-all": t.state, children: [
|
|
647
655
|
a > 0 ? /* @__PURE__ */ m(Oe, { className: "aqmx-explorer-tree-progress-icon", "aria-hidden": "true" }) : null,
|
|
648
656
|
/* @__PURE__ */ m("span", { children: t.state === "running" ? n.expandAllProgress(t.opened, a) : n.foldersLoading(a) })
|
|
649
657
|
] });
|
|
650
|
-
},
|
|
651
|
-
const { labels: r } =
|
|
652
|
-
return /* @__PURE__ */ m("p", { className: "aqmx-explorer-expand-all-stop", "data-testid": "markdown-explorer-expand-all-stop", "data-aqmx-stop": e, children:
|
|
653
|
-
},
|
|
654
|
-
const { trees: n } =
|
|
655
|
-
return l.length === 0 ? /* @__PURE__ */ m(
|
|
656
|
-
},
|
|
657
|
-
const { renderTreeFailure: r } =
|
|
658
|
-
if (o.status === "deferred") return /* @__PURE__ */ m(
|
|
659
|
-
if (o.status === "ok") return /* @__PURE__ */ m(
|
|
658
|
+
}, er = ({ stop: e, opened: t, budget: n }) => {
|
|
659
|
+
const { labels: r } = $();
|
|
660
|
+
return /* @__PURE__ */ m("p", { className: "aqmx-explorer-expand-all-stop", "data-testid": "markdown-explorer-expand-all-stop", "data-aqmx-stop": e, children: ct(r, n, e, t) });
|
|
661
|
+
}, tr = ({ entries: e, ...t }) => {
|
|
662
|
+
const { trees: n } = $(), r = Ce(n.subscribe, n.version, n.version), { sourceId: o } = t, [c] = F(mn), l = C(() => c(e, (a) => n.children(o, a)), [c, e, n, o, r]);
|
|
663
|
+
return l.length === 0 ? /* @__PURE__ */ m(Xn, {}) : /* @__PURE__ */ m(Qn, { entries: l, version: r, ...t });
|
|
664
|
+
}, nr = ({ result: e, onRetry: t, ...n }) => {
|
|
665
|
+
const { renderTreeFailure: r } = $(), o = ye(e);
|
|
666
|
+
if (o.status === "deferred") return /* @__PURE__ */ m(it, {});
|
|
667
|
+
if (o.status === "ok") return /* @__PURE__ */ m(tr, { entries: o.entries, ...n });
|
|
660
668
|
const c = r?.(o.failure);
|
|
661
|
-
return /* @__PURE__ */ m("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: c !== void 0 ? c : /* @__PURE__ */ m(
|
|
662
|
-
},
|
|
663
|
-
const { trees: n, storageNamespace: r, labels: o, announcer: c, config: l } =
|
|
664
|
-
|
|
669
|
+
return /* @__PURE__ */ m("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: c !== void 0 ? c : /* @__PURE__ */ m(kt, { failure: o.failure, alert: !0, onRetry: t, testId: null }) });
|
|
670
|
+
}, rr = ({ onControls: e, ...t }) => {
|
|
671
|
+
const { trees: n, storageNamespace: r, labels: o, announcer: c, config: l } = $(), { sourceId: a } = t, s = jt({ storageKey: Gt(r).treeExpansion(a) });
|
|
672
|
+
Ce(n.subscribe, n.version, n.version);
|
|
665
673
|
const d = n.read(a), u = w(() => n.retry(a), [n, a]);
|
|
666
|
-
|
|
667
|
-
const i =
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
}, [
|
|
671
|
-
const
|
|
672
|
-
|
|
674
|
+
H(() => n.open(a), [n, a]);
|
|
675
|
+
const i = Tn(), { expanded: p, expandMultiple: h, collapseAll: g } = s, [v, O] = F(null), A = v !== p, q = E(p);
|
|
676
|
+
H(() => {
|
|
677
|
+
q.current = p;
|
|
678
|
+
}, [p]);
|
|
679
|
+
const y = l.expandAll, Z = w(() => c.announce(o.expandAllStarted), [c, o]), N = w((M) => c.announce(Wn(o, y, M)), [c, o, y]), R = Ln({ budget: y, expandMultiple: h, onStart: Z, onFinish: N }), { status: k, start: S, end: b, advance: _ } = R, B = k.state === "running", ie = C(() => ({ running: B, advance: _ }), [B, _]), re = E(null), [K, U] = F(!1), ae = w((M) => {
|
|
680
|
+
re.current = M, U(M !== null);
|
|
673
681
|
}, []);
|
|
674
|
-
|
|
675
|
-
() => n.subscribeChildrenFailures((
|
|
676
|
-
const
|
|
677
|
-
|
|
682
|
+
D(
|
|
683
|
+
() => n.subscribeChildrenFailures((M) => {
|
|
684
|
+
const le = M.sourceId === a && re.current !== null ? at(re.current, M.path) : null;
|
|
685
|
+
le !== null && c.announce({ list: o.foldersLoadFailedNamed, item: le.name });
|
|
678
686
|
}),
|
|
679
687
|
[n, a, c, o]
|
|
680
688
|
);
|
|
681
|
-
const { clearDirect:
|
|
682
|
-
|
|
683
|
-
}, [
|
|
684
|
-
return
|
|
685
|
-
e({ collapseAll:
|
|
686
|
-
}, [e,
|
|
687
|
-
|
|
688
|
-
}, [
|
|
689
|
-
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */ m(
|
|
692
|
-
/* @__PURE__ */ m(
|
|
689
|
+
const { clearDirect: z } = i, [Q, J] = F(0), ee = w(() => {
|
|
690
|
+
J((M) => M + 1), b(), z(), O(q.current), g();
|
|
691
|
+
}, [b, z, g]);
|
|
692
|
+
return D(() => {
|
|
693
|
+
e({ collapseAll: ee, expandAll: K ? S : null, expanding: B });
|
|
694
|
+
}, [e, ee, S, K, B]), D(() => () => e(null), [e]), D(() => {
|
|
695
|
+
K || b();
|
|
696
|
+
}, [K, b]), /* @__PURE__ */ L(Qe, { children: [
|
|
697
|
+
k.state === "stopped" ? /* @__PURE__ */ m(er, { stop: k.stop, opened: k.opened, budget: y }) : null,
|
|
698
|
+
/* @__PURE__ */ L("div", { className: "aqmx-explorer-tree-area", children: [
|
|
699
|
+
/* @__PURE__ */ m(et, { fallback: /* @__PURE__ */ m(it, {}), children: /* @__PURE__ */ m(nr, { result: d, onRetry: u, expansion: s, onShown: ae, marks: i, claimsHeld: A, expandAll: ie, revealCancel: Q, ...t }) }),
|
|
700
|
+
/* @__PURE__ */ m(Jn, { pending: n.pendingChildren(a), status: k })
|
|
693
701
|
] })
|
|
694
702
|
] });
|
|
695
703
|
};
|
|
696
|
-
function
|
|
704
|
+
function ar({
|
|
697
705
|
title: e,
|
|
698
706
|
titleId: t,
|
|
699
707
|
...n
|
|
700
708
|
}, r) {
|
|
701
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
702
710
|
xmlns: "http://www.w3.org/2000/svg",
|
|
703
711
|
viewBox: "0 0 24 24",
|
|
704
712
|
fill: "currentColor",
|
|
@@ -706,69 +714,69 @@ function nr({
|
|
|
706
714
|
"data-slot": "icon",
|
|
707
715
|
ref: r,
|
|
708
716
|
"aria-labelledby": t
|
|
709
|
-
}, n), e ? /* @__PURE__ */
|
|
717
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
710
718
|
id: t
|
|
711
|
-
}, e) : null, /* @__PURE__ */
|
|
719
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
712
720
|
fillRule: "evenodd",
|
|
713
721
|
d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
|
|
714
722
|
clipRule: "evenodd"
|
|
715
723
|
}));
|
|
716
724
|
}
|
|
717
|
-
const
|
|
718
|
-
const { labels: c } =
|
|
719
|
-
if (
|
|
720
|
-
const h = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${
|
|
721
|
-
|
|
725
|
+
const dt = /* @__PURE__ */ f.forwardRef(ar), We = "markdown-explorer-selection-remove", lr = ({ selection: e, onRemove: t, onClear: n, onOpenSelection: r, onLeave: o }) => {
|
|
726
|
+
const { labels: c } = $(), l = Re(), a = E(null), s = [...e], d = (i, p) => {
|
|
727
|
+
if (p.ownerDocument.activeElement === p) {
|
|
728
|
+
const h = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${We}"]`)], g = h.indexOf(p), v = [h[g + 1], h[g - 1]].find((O) => O !== void 0);
|
|
729
|
+
v === void 0 ? o() : v.focus();
|
|
722
730
|
}
|
|
723
731
|
t(i);
|
|
724
732
|
}, u = () => {
|
|
725
733
|
const i = a.current;
|
|
726
734
|
i !== null && i.contains(i.ownerDocument.activeElement) && o(), n();
|
|
727
735
|
};
|
|
728
|
-
return /* @__PURE__ */
|
|
729
|
-
/* @__PURE__ */
|
|
736
|
+
return /* @__PURE__ */ L("section", { ref: a, className: "aqmx-explorer-tray", "aria-labelledby": l, "data-testid": "markdown-explorer-selection-tray", children: [
|
|
737
|
+
/* @__PURE__ */ L("div", { className: "aqmx-explorer-tray-header", children: [
|
|
730
738
|
/* @__PURE__ */ m("p", { id: l, className: "aqmx-explorer-tray-title", children: c.selectionTitle(s.length) }),
|
|
731
739
|
/* @__PURE__ */ m("button", { type: "button", className: "aqmx-explorer-tray-button", "data-testid": "markdown-explorer-selection-clear", onClick: u, children: c.clearSelection })
|
|
732
740
|
] }),
|
|
733
|
-
/* @__PURE__ */ m("ul", { className: "aqmx-explorer-tray-list", children: s.map(([i,
|
|
734
|
-
/* @__PURE__ */ m("span", { className: "aqmx-explorer-tray-name", title: i, children:
|
|
741
|
+
/* @__PURE__ */ m("ul", { className: "aqmx-explorer-tray-list", children: s.map(([i, p]) => /* @__PURE__ */ L("li", { className: "aqmx-explorer-tray-item", children: [
|
|
742
|
+
/* @__PURE__ */ m("span", { className: "aqmx-explorer-tray-name", title: i, children: p }),
|
|
735
743
|
/* @__PURE__ */ m(
|
|
736
744
|
"button",
|
|
737
745
|
{
|
|
738
746
|
type: "button",
|
|
739
747
|
className: "aqmx-icon-button aqmx-explorer-tray-remove",
|
|
740
|
-
"aria-label": c.removeFromSelection(
|
|
741
|
-
title: c.removeFromSelection(
|
|
742
|
-
"data-testid":
|
|
748
|
+
"aria-label": c.removeFromSelection(p),
|
|
749
|
+
title: c.removeFromSelection(p),
|
|
750
|
+
"data-testid": We,
|
|
743
751
|
"data-aqmx-path": i,
|
|
744
752
|
onClick: (h) => d(i, h.currentTarget),
|
|
745
|
-
children: /* @__PURE__ */ m(
|
|
753
|
+
children: /* @__PURE__ */ m(dt, { "aria-hidden": "true" })
|
|
746
754
|
}
|
|
747
755
|
)
|
|
748
756
|
] }, i)) }),
|
|
749
757
|
r === void 0 ? null : /* @__PURE__ */ m("button", { type: "button", className: "aqmx-explorer-tray-open", "data-testid": "markdown-explorer-selection-open", onClick: () => r(s.map(([i]) => i)), children: c.openSelectionInMulti(s.length) })
|
|
750
758
|
] });
|
|
751
|
-
},
|
|
759
|
+
}, Ae = /* @__PURE__ */ new Map(), or = (e, t) => {
|
|
752
760
|
if (t.selected === e.has(t.path)) return e;
|
|
753
761
|
const n = new Map(e);
|
|
754
762
|
return t.selected ? n.set(t.path, t.name) : n.delete(t.path), n;
|
|
755
|
-
},
|
|
763
|
+
}, sr = (e, t) => {
|
|
756
764
|
if (!e.has(t)) return e;
|
|
757
765
|
const n = new Map(e);
|
|
758
766
|
return n.delete(t), n;
|
|
759
|
-
},
|
|
760
|
-
const t =
|
|
761
|
-
|
|
767
|
+
}, ut = qe(null), cr = (e) => {
|
|
768
|
+
const t = ye(ut);
|
|
769
|
+
H(() => {
|
|
762
770
|
if (t !== null)
|
|
763
771
|
return t(e), () => t(!1);
|
|
764
772
|
}, [t, e]);
|
|
765
773
|
};
|
|
766
|
-
function
|
|
774
|
+
function ir({
|
|
767
775
|
title: e,
|
|
768
776
|
titleId: t,
|
|
769
777
|
...n
|
|
770
778
|
}, r) {
|
|
771
|
-
return /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
772
780
|
xmlns: "http://www.w3.org/2000/svg",
|
|
773
781
|
viewBox: "0 0 24 24",
|
|
774
782
|
fill: "currentColor",
|
|
@@ -776,21 +784,21 @@ function sr({
|
|
|
776
784
|
"data-slot": "icon",
|
|
777
785
|
ref: r,
|
|
778
786
|
"aria-labelledby": t
|
|
779
|
-
}, n), e ? /* @__PURE__ */
|
|
787
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
780
788
|
id: t
|
|
781
|
-
}, e) : null, /* @__PURE__ */
|
|
789
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
782
790
|
fillRule: "evenodd",
|
|
783
791
|
d: "M15 3.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0V5.56l-3.97 3.97a.75.75 0 1 1-1.06-1.06l3.97-3.97h-2.69a.75.75 0 0 1-.75-.75Zm-12 0A.75.75 0 0 1 3.75 3h4.5a.75.75 0 0 1 0 1.5H5.56l3.97 3.97a.75.75 0 0 1-1.06 1.06L4.5 5.56v2.69a.75.75 0 0 1-1.5 0v-4.5Zm11.47 11.78a.75.75 0 1 1 1.06-1.06l3.97 3.97v-2.69a.75.75 0 0 1 1.5 0v4.5a.75.75 0 0 1-.75.75h-4.5a.75.75 0 0 1 0-1.5h2.69l-3.97-3.97Zm-4.94-1.06a.75.75 0 0 1 0 1.06L5.56 19.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75v-4.5a.75.75 0 0 1 1.5 0v2.69l3.97-3.97a.75.75 0 0 1 1.06 0Z",
|
|
784
792
|
clipRule: "evenodd"
|
|
785
793
|
}));
|
|
786
794
|
}
|
|
787
|
-
const
|
|
788
|
-
function
|
|
795
|
+
const dr = /* @__PURE__ */ f.forwardRef(ir);
|
|
796
|
+
function ur({
|
|
789
797
|
title: e,
|
|
790
798
|
titleId: t,
|
|
791
799
|
...n
|
|
792
800
|
}, r) {
|
|
793
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
794
802
|
xmlns: "http://www.w3.org/2000/svg",
|
|
795
803
|
viewBox: "0 0 24 24",
|
|
796
804
|
fill: "currentColor",
|
|
@@ -798,21 +806,21 @@ function ir({
|
|
|
798
806
|
"data-slot": "icon",
|
|
799
807
|
ref: r,
|
|
800
808
|
"aria-labelledby": t
|
|
801
|
-
}, n), e ? /* @__PURE__ */
|
|
809
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
802
810
|
id: t
|
|
803
|
-
}, e) : null, /* @__PURE__ */
|
|
811
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
804
812
|
fillRule: "evenodd",
|
|
805
813
|
d: "M6.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.25 4.81V16.5a.75.75 0 0 1-1.5 0V4.81L3.53 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5Zm9.53 4.28a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V7.5a.75.75 0 0 1 .75-.75Z",
|
|
806
814
|
clipRule: "evenodd"
|
|
807
815
|
}));
|
|
808
816
|
}
|
|
809
|
-
const
|
|
810
|
-
function
|
|
817
|
+
const mr = /* @__PURE__ */ f.forwardRef(ur);
|
|
818
|
+
function fr({
|
|
811
819
|
title: e,
|
|
812
820
|
titleId: t,
|
|
813
821
|
...n
|
|
814
822
|
}, r) {
|
|
815
|
-
return /* @__PURE__ */
|
|
823
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
816
824
|
xmlns: "http://www.w3.org/2000/svg",
|
|
817
825
|
viewBox: "0 0 24 24",
|
|
818
826
|
fill: "currentColor",
|
|
@@ -820,21 +828,41 @@ function ur({
|
|
|
820
828
|
"data-slot": "icon",
|
|
821
829
|
ref: r,
|
|
822
830
|
"aria-labelledby": t
|
|
823
|
-
}, n), e ? /* @__PURE__ */
|
|
831
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
824
832
|
id: t
|
|
825
|
-
}, e) : null, /* @__PURE__ */
|
|
833
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
834
|
+
d: "M11.25 4.533A9.707 9.707 0 0 0 6 3a9.735 9.735 0 0 0-3.25.555.75.75 0 0 0-.5.707v14.25a.75.75 0 0 0 1 .707A8.237 8.237 0 0 1 6 18.75c1.995 0 3.823.707 5.25 1.886V4.533ZM12.75 20.636A8.214 8.214 0 0 1 18 18.75c.966 0 1.89.166 2.75.47a.75.75 0 0 0 1-.708V4.262a.75.75 0 0 0-.5-.707A9.735 9.735 0 0 0 18 3a9.707 9.707 0 0 0-5.25 1.533v16.103Z"
|
|
835
|
+
}));
|
|
836
|
+
}
|
|
837
|
+
const pr = /* @__PURE__ */ f.forwardRef(fr);
|
|
838
|
+
function hr({
|
|
839
|
+
title: e,
|
|
840
|
+
titleId: t,
|
|
841
|
+
...n
|
|
842
|
+
}, r) {
|
|
843
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
844
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
845
|
+
viewBox: "0 0 24 24",
|
|
846
|
+
fill: "currentColor",
|
|
847
|
+
"aria-hidden": "true",
|
|
848
|
+
"data-slot": "icon",
|
|
849
|
+
ref: r,
|
|
850
|
+
"aria-labelledby": t
|
|
851
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
852
|
+
id: t
|
|
853
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
826
854
|
fillRule: "evenodd",
|
|
827
855
|
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
828
856
|
clipRule: "evenodd"
|
|
829
857
|
}));
|
|
830
858
|
}
|
|
831
|
-
const
|
|
832
|
-
function
|
|
859
|
+
const xr = /* @__PURE__ */ f.forwardRef(hr);
|
|
860
|
+
function wr({
|
|
833
861
|
title: e,
|
|
834
862
|
titleId: t,
|
|
835
863
|
...n
|
|
836
864
|
}, r) {
|
|
837
|
-
return /* @__PURE__ */
|
|
865
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
838
866
|
xmlns: "http://www.w3.org/2000/svg",
|
|
839
867
|
viewBox: "0 0 24 24",
|
|
840
868
|
fill: "currentColor",
|
|
@@ -842,21 +870,21 @@ function fr({
|
|
|
842
870
|
"data-slot": "icon",
|
|
843
871
|
ref: r,
|
|
844
872
|
"aria-labelledby": t
|
|
845
|
-
}, n), e ? /* @__PURE__ */
|
|
873
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
846
874
|
id: t
|
|
847
|
-
}, e) : null, /* @__PURE__ */
|
|
875
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
848
876
|
fillRule: "evenodd",
|
|
849
877
|
d: "M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z",
|
|
850
878
|
clipRule: "evenodd"
|
|
851
879
|
}));
|
|
852
880
|
}
|
|
853
|
-
const
|
|
854
|
-
function
|
|
881
|
+
const gr = /* @__PURE__ */ f.forwardRef(wr);
|
|
882
|
+
function vr({
|
|
855
883
|
title: e,
|
|
856
884
|
titleId: t,
|
|
857
885
|
...n
|
|
858
886
|
}, r) {
|
|
859
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
860
888
|
xmlns: "http://www.w3.org/2000/svg",
|
|
861
889
|
viewBox: "0 0 24 24",
|
|
862
890
|
fill: "currentColor",
|
|
@@ -864,21 +892,21 @@ function hr({
|
|
|
864
892
|
"data-slot": "icon",
|
|
865
893
|
ref: r,
|
|
866
894
|
"aria-labelledby": t
|
|
867
|
-
}, n), e ? /* @__PURE__ */
|
|
895
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
868
896
|
id: t
|
|
869
|
-
}, e) : null, /* @__PURE__ */
|
|
897
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
870
898
|
fillRule: "evenodd",
|
|
871
899
|
d: "M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z",
|
|
872
900
|
clipRule: "evenodd"
|
|
873
901
|
}));
|
|
874
902
|
}
|
|
875
|
-
const
|
|
876
|
-
function
|
|
903
|
+
const br = /* @__PURE__ */ f.forwardRef(vr);
|
|
904
|
+
function Er({
|
|
877
905
|
title: e,
|
|
878
906
|
titleId: t,
|
|
879
907
|
...n
|
|
880
908
|
}, r) {
|
|
881
|
-
return /* @__PURE__ */
|
|
909
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
882
910
|
xmlns: "http://www.w3.org/2000/svg",
|
|
883
911
|
viewBox: "0 0 24 24",
|
|
884
912
|
fill: "currentColor",
|
|
@@ -886,21 +914,21 @@ function wr({
|
|
|
886
914
|
"data-slot": "icon",
|
|
887
915
|
ref: r,
|
|
888
916
|
"aria-labelledby": t
|
|
889
|
-
}, n), e ? /* @__PURE__ */
|
|
917
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
890
918
|
id: t
|
|
891
|
-
}, e) : null, /* @__PURE__ */
|
|
919
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
892
920
|
fillRule: "evenodd",
|
|
893
921
|
d: "M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z",
|
|
894
922
|
clipRule: "evenodd"
|
|
895
923
|
}));
|
|
896
924
|
}
|
|
897
|
-
const
|
|
898
|
-
function
|
|
925
|
+
const yr = /* @__PURE__ */ f.forwardRef(Er);
|
|
926
|
+
function Rr({
|
|
899
927
|
title: e,
|
|
900
928
|
titleId: t,
|
|
901
929
|
...n
|
|
902
930
|
}, r) {
|
|
903
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
904
932
|
xmlns: "http://www.w3.org/2000/svg",
|
|
905
933
|
viewBox: "0 0 24 24",
|
|
906
934
|
fill: "currentColor",
|
|
@@ -908,21 +936,21 @@ function vr({
|
|
|
908
936
|
"data-slot": "icon",
|
|
909
937
|
ref: r,
|
|
910
938
|
"aria-labelledby": t
|
|
911
|
-
}, n), e ? /* @__PURE__ */
|
|
939
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
912
940
|
id: t
|
|
913
|
-
}, e) : null, /* @__PURE__ */
|
|
941
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
914
942
|
fillRule: "evenodd",
|
|
915
943
|
d: "M12 1.5a.75.75 0 0 1 .75.75V4.5a.75.75 0 0 1-1.5 0V2.25A.75.75 0 0 1 12 1.5ZM5.636 4.136a.75.75 0 0 1 1.06 0l1.592 1.591a.75.75 0 0 1-1.061 1.06l-1.591-1.59a.75.75 0 0 1 0-1.061Zm12.728 0a.75.75 0 0 1 0 1.06l-1.591 1.592a.75.75 0 0 1-1.06-1.061l1.59-1.591a.75.75 0 0 1 1.061 0Zm-6.816 4.496a.75.75 0 0 1 .82.311l5.228 7.917a.75.75 0 0 1-.777 1.148l-2.097-.43 1.045 3.9a.75.75 0 0 1-1.45.388l-1.044-3.899-1.601 1.42a.75.75 0 0 1-1.247-.606l.569-9.47a.75.75 0 0 1 .554-.68ZM3 10.5a.75.75 0 0 1 .75-.75H6a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 10.5Zm14.25 0a.75.75 0 0 1 .75-.75h2.25a.75.75 0 0 1 0 1.5H18a.75.75 0 0 1-.75-.75Zm-8.962 3.712a.75.75 0 0 1 0 1.061l-1.591 1.591a.75.75 0 1 1-1.061-1.06l1.591-1.592a.75.75 0 0 1 1.06 0Z",
|
|
916
944
|
clipRule: "evenodd"
|
|
917
945
|
}));
|
|
918
946
|
}
|
|
919
|
-
const
|
|
920
|
-
function
|
|
947
|
+
const Sr = /* @__PURE__ */ f.forwardRef(Rr);
|
|
948
|
+
function Tr({
|
|
921
949
|
title: e,
|
|
922
950
|
titleId: t,
|
|
923
951
|
...n
|
|
924
952
|
}, r) {
|
|
925
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
926
954
|
xmlns: "http://www.w3.org/2000/svg",
|
|
927
955
|
viewBox: "0 0 24 24",
|
|
928
956
|
fill: "currentColor",
|
|
@@ -930,23 +958,23 @@ function Er({
|
|
|
930
958
|
"data-slot": "icon",
|
|
931
959
|
ref: r,
|
|
932
960
|
"aria-labelledby": t
|
|
933
|
-
}, n), e ? /* @__PURE__ */
|
|
961
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
934
962
|
id: t
|
|
935
|
-
}, e) : null, /* @__PURE__ */
|
|
963
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
936
964
|
fillRule: "evenodd",
|
|
937
965
|
d: "M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z",
|
|
938
966
|
clipRule: "evenodd"
|
|
939
|
-
}), /* @__PURE__ */
|
|
967
|
+
}), /* @__PURE__ */ f.createElement("path", {
|
|
940
968
|
d: "M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
|
|
941
969
|
}));
|
|
942
970
|
}
|
|
943
|
-
const
|
|
944
|
-
function
|
|
971
|
+
const Nr = /* @__PURE__ */ f.forwardRef(Tr);
|
|
972
|
+
function kr({
|
|
945
973
|
title: e,
|
|
946
974
|
titleId: t,
|
|
947
975
|
...n
|
|
948
976
|
}, r) {
|
|
949
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
950
978
|
xmlns: "http://www.w3.org/2000/svg",
|
|
951
979
|
viewBox: "0 0 24 24",
|
|
952
980
|
fill: "currentColor",
|
|
@@ -954,19 +982,19 @@ function Rr({
|
|
|
954
982
|
"data-slot": "icon",
|
|
955
983
|
ref: r,
|
|
956
984
|
"aria-labelledby": t
|
|
957
|
-
}, n), e ? /* @__PURE__ */
|
|
985
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
958
986
|
id: t
|
|
959
|
-
}, e) : null, /* @__PURE__ */
|
|
987
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
960
988
|
d: "M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"
|
|
961
989
|
}));
|
|
962
990
|
}
|
|
963
|
-
const
|
|
964
|
-
function
|
|
991
|
+
const Ar = /* @__PURE__ */ f.forwardRef(kr);
|
|
992
|
+
function Lr({
|
|
965
993
|
title: e,
|
|
966
994
|
titleId: t,
|
|
967
995
|
...n
|
|
968
996
|
}, r) {
|
|
969
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
970
998
|
xmlns: "http://www.w3.org/2000/svg",
|
|
971
999
|
viewBox: "0 0 24 24",
|
|
972
1000
|
fill: "currentColor",
|
|
@@ -974,19 +1002,19 @@ function Tr({
|
|
|
974
1002
|
"data-slot": "icon",
|
|
975
1003
|
ref: r,
|
|
976
1004
|
"aria-labelledby": t
|
|
977
|
-
}, n), e ? /* @__PURE__ */
|
|
1005
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
978
1006
|
id: t
|
|
979
|
-
}, e) : null, /* @__PURE__ */
|
|
1007
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
980
1008
|
d: "M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z"
|
|
981
1009
|
}));
|
|
982
1010
|
}
|
|
983
|
-
const
|
|
984
|
-
function
|
|
1011
|
+
const Or = /* @__PURE__ */ f.forwardRef(Lr);
|
|
1012
|
+
function Pr({
|
|
985
1013
|
title: e,
|
|
986
1014
|
titleId: t,
|
|
987
1015
|
...n
|
|
988
1016
|
}, r) {
|
|
989
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
990
1018
|
xmlns: "http://www.w3.org/2000/svg",
|
|
991
1019
|
viewBox: "0 0 24 24",
|
|
992
1020
|
fill: "currentColor",
|
|
@@ -994,21 +1022,21 @@ function Lr({
|
|
|
994
1022
|
"data-slot": "icon",
|
|
995
1023
|
ref: r,
|
|
996
1024
|
"aria-labelledby": t
|
|
997
|
-
}, n), e ? /* @__PURE__ */
|
|
1025
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
998
1026
|
id: t
|
|
999
|
-
}, e) : null, /* @__PURE__ */
|
|
1027
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
1000
1028
|
fillRule: "evenodd",
|
|
1001
1029
|
d: "M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Zm8.25-3.75a.75.75 0 0 1 .75.75v2.25h2.25a.75.75 0 0 1 0 1.5h-2.25v2.25a.75.75 0 0 1-1.5 0v-2.25H7.5a.75.75 0 0 1 0-1.5h2.25V7.5a.75.75 0 0 1 .75-.75Z",
|
|
1002
1030
|
clipRule: "evenodd"
|
|
1003
1031
|
}));
|
|
1004
1032
|
}
|
|
1005
|
-
const
|
|
1006
|
-
function
|
|
1033
|
+
const qr = /* @__PURE__ */ f.forwardRef(Pr);
|
|
1034
|
+
function Cr({
|
|
1007
1035
|
title: e,
|
|
1008
1036
|
titleId: t,
|
|
1009
1037
|
...n
|
|
1010
1038
|
}, r) {
|
|
1011
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
1012
1040
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1013
1041
|
viewBox: "0 0 24 24",
|
|
1014
1042
|
fill: "currentColor",
|
|
@@ -1016,32 +1044,33 @@ function Or({
|
|
|
1016
1044
|
"data-slot": "icon",
|
|
1017
1045
|
ref: r,
|
|
1018
1046
|
"aria-labelledby": t
|
|
1019
|
-
}, n), e ? /* @__PURE__ */
|
|
1047
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
1020
1048
|
id: t
|
|
1021
|
-
}, e) : null, /* @__PURE__ */
|
|
1049
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
1022
1050
|
d: "M5.625 3.75a2.625 2.625 0 1 0 0 5.25h12.75a2.625 2.625 0 0 0 0-5.25H5.625ZM3.75 11.25a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75ZM3 15.75a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75ZM3.75 18.75a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Z"
|
|
1023
1051
|
}));
|
|
1024
1052
|
}
|
|
1025
|
-
const
|
|
1026
|
-
sortMode:
|
|
1027
|
-
folderPlacement:
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1053
|
+
const Fr = /* @__PURE__ */ f.forwardRef(Cr), Mr = Object.freeze({
|
|
1054
|
+
sortMode: mr,
|
|
1055
|
+
folderPlacement: Ar,
|
|
1056
|
+
readmePlacement: pr,
|
|
1057
|
+
selectionMode: xr,
|
|
1058
|
+
doubleClickAction: Sr,
|
|
1059
|
+
expandIconSize: qr,
|
|
1060
|
+
alwaysExpanded: dr,
|
|
1061
|
+
revealDocument: Lt,
|
|
1062
|
+
removeRootIndent: gr,
|
|
1063
|
+
lines: Fr,
|
|
1064
|
+
expandIcons: br,
|
|
1065
|
+
directoryIcons: Or,
|
|
1066
|
+
fileIcons: Nr
|
|
1067
|
+
}), mt = (e, t) => {
|
|
1039
1068
|
const n = e[t.labelKey];
|
|
1040
1069
|
if (typeof n != "string") throw new TypeError(`[markdown-explorer] the tree setting ${t.key} must name a string label; labels.${t.labelKey} is a ${typeof n}`);
|
|
1041
1070
|
return n;
|
|
1042
|
-
},
|
|
1043
|
-
const { labels: l } =
|
|
1044
|
-
|
|
1071
|
+
}, _r = ({ id: e, settings: t, descriptors: n, onAdvance: r, onClose: o, ref: c }) => {
|
|
1072
|
+
const { labels: l } = $(), a = E([]);
|
|
1073
|
+
D(() => {
|
|
1045
1074
|
a.current[0]?.focus();
|
|
1046
1075
|
}, []);
|
|
1047
1076
|
const s = w(
|
|
@@ -1066,7 +1095,7 @@ const Ar = /* @__PURE__ */ p.forwardRef(Or), Pr = Object.freeze({
|
|
|
1066
1095
|
u.preventDefault(), s(n.length - 1);
|
|
1067
1096
|
break;
|
|
1068
1097
|
case "Escape":
|
|
1069
|
-
|
|
1098
|
+
Pe(u), o();
|
|
1070
1099
|
break;
|
|
1071
1100
|
case "Tab":
|
|
1072
1101
|
o();
|
|
@@ -1076,58 +1105,58 @@ const Ar = /* @__PURE__ */ p.forwardRef(Or), Pr = Object.freeze({
|
|
|
1076
1105
|
[n.length, s, o]
|
|
1077
1106
|
);
|
|
1078
1107
|
return /* @__PURE__ */ m("div", { ref: c, id: e, role: "menu", "aria-label": l.treeSettings, className: "aqmx-explorer-menu", "data-testid": "markdown-explorer-tree-settings-menu", children: n.map((u, i) => {
|
|
1079
|
-
const
|
|
1080
|
-
return /* @__PURE__ */
|
|
1108
|
+
const p = Mr[u.key], h = mt(l, u), g = tt(l, t, u.key), v = t[u.key], O = typeof v == "boolean" ? { role: "menuitemcheckbox", "aria-checked": v, "aria-label": h } : { role: "menuitem", "aria-label": `${h}: ${g}` };
|
|
1109
|
+
return /* @__PURE__ */ L(
|
|
1081
1110
|
"button",
|
|
1082
1111
|
{
|
|
1083
|
-
ref: (
|
|
1084
|
-
a.current[i] =
|
|
1112
|
+
ref: (A) => {
|
|
1113
|
+
a.current[i] = A;
|
|
1085
1114
|
},
|
|
1086
1115
|
type: "button",
|
|
1087
1116
|
tabIndex: -1,
|
|
1088
|
-
...
|
|
1089
|
-
title: `${h}: ${
|
|
1117
|
+
...O,
|
|
1118
|
+
title: `${h}: ${g}`,
|
|
1090
1119
|
className: "aqmx-explorer-menu-item",
|
|
1091
1120
|
"data-testid": "markdown-explorer-tree-settings-item",
|
|
1092
1121
|
"data-aqmx-setting": u.key,
|
|
1093
1122
|
onClick: () => r(u),
|
|
1094
|
-
onKeyDown: (
|
|
1123
|
+
onKeyDown: (A) => d(A, i),
|
|
1095
1124
|
children: [
|
|
1096
|
-
/* @__PURE__ */ m(
|
|
1125
|
+
/* @__PURE__ */ m(p, { className: "aqmx-explorer-menu-icon", "aria-hidden": "true" }),
|
|
1097
1126
|
/* @__PURE__ */ m("span", { className: "aqmx-explorer-menu-name", children: h }),
|
|
1098
|
-
/* @__PURE__ */ m("span", { className: "aqmx-explorer-menu-value", children:
|
|
1127
|
+
/* @__PURE__ */ m("span", { className: "aqmx-explorer-menu-value", children: g })
|
|
1099
1128
|
]
|
|
1100
1129
|
},
|
|
1101
1130
|
u.key
|
|
1102
1131
|
);
|
|
1103
1132
|
}) });
|
|
1104
|
-
},
|
|
1105
|
-
const { labels: r, announcer: o } =
|
|
1133
|
+
}, Ir = ({ settings: e, descriptors: t, onAdvance: n }) => {
|
|
1134
|
+
const { labels: r, announcer: o } = $(), [c, l] = F(!1), a = E(null), s = E(null), d = E(null), u = Re(), i = w(() => {
|
|
1106
1135
|
a.current?.focus(), l(!1);
|
|
1107
1136
|
}, []);
|
|
1108
|
-
|
|
1137
|
+
D(() => {
|
|
1109
1138
|
if (!c) return;
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1139
|
+
const g = (v) => {
|
|
1140
|
+
v.target instanceof Node && (a.current?.contains(v.target) === !0 || s.current?.contains(v.target) === !0) || (l(!1), d.current !== null && window.clearTimeout(d.current), d.current = window.setTimeout(() => {
|
|
1112
1141
|
d.current = null, (document.activeElement === null || document.activeElement === document.body) && a.current?.focus();
|
|
1113
1142
|
}, 0));
|
|
1114
1143
|
};
|
|
1115
|
-
return document.addEventListener("pointerdown",
|
|
1116
|
-
}, [c]),
|
|
1144
|
+
return document.addEventListener("pointerdown", g), () => document.removeEventListener("pointerdown", g);
|
|
1145
|
+
}, [c]), D(
|
|
1117
1146
|
() => () => {
|
|
1118
1147
|
d.current !== null && window.clearTimeout(d.current);
|
|
1119
1148
|
},
|
|
1120
1149
|
[]
|
|
1121
1150
|
);
|
|
1122
|
-
const
|
|
1123
|
-
(
|
|
1124
|
-
|
|
1151
|
+
const p = w(
|
|
1152
|
+
(g) => {
|
|
1153
|
+
g.key !== "Escape" || !c || (Pe(g), i());
|
|
1125
1154
|
},
|
|
1126
1155
|
[c, i]
|
|
1127
1156
|
), h = w(
|
|
1128
|
-
(
|
|
1129
|
-
const
|
|
1130
|
-
o.announce(r.settingAnnouncement(
|
|
1157
|
+
(g) => {
|
|
1158
|
+
const v = n(g.key);
|
|
1159
|
+
o.announce(r.settingAnnouncement(mt(r, g), tt(r, v, g.key)));
|
|
1131
1160
|
},
|
|
1132
1161
|
[o, r, n]
|
|
1133
1162
|
);
|
|
@@ -1144,73 +1173,73 @@ const Ar = /* @__PURE__ */ p.forwardRef(Or), Pr = Object.freeze({
|
|
|
1144
1173
|
"aria-label": r.treeSettings,
|
|
1145
1174
|
title: r.treeSettings,
|
|
1146
1175
|
"data-testid": "markdown-explorer-tree-settings",
|
|
1147
|
-
onClick: () => l((
|
|
1148
|
-
onKeyDown:
|
|
1149
|
-
children: /* @__PURE__ */ m(
|
|
1176
|
+
onClick: () => l((g) => !g),
|
|
1177
|
+
onKeyDown: p,
|
|
1178
|
+
children: /* @__PURE__ */ m(yr, { "aria-hidden": "true" })
|
|
1150
1179
|
}
|
|
1151
1180
|
),
|
|
1152
|
-
menu: c ? /* @__PURE__ */ m(
|
|
1181
|
+
menu: c ? /* @__PURE__ */ m(_r, { ref: s, id: u, settings: e, descriptors: t, onAdvance: h, onClose: i }) : null
|
|
1153
1182
|
};
|
|
1154
|
-
},
|
|
1155
|
-
const { treeSettings: e } =
|
|
1156
|
-
return { settings:
|
|
1157
|
-
},
|
|
1158
|
-
const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: c, onSourceChange: l, onRevealSource: a, viewSwitch: s } = e, { labels: d, sources: u, trees: i, documents:
|
|
1159
|
-
|
|
1160
|
-
const
|
|
1161
|
-
(
|
|
1162
|
-
const
|
|
1163
|
-
return
|
|
1183
|
+
}, Dr = () => {
|
|
1184
|
+
const { treeSettings: e } = $();
|
|
1185
|
+
return { settings: Ce(e.subscribe, e.getSnapshot, e.getServerSnapshot), advance: e.advance };
|
|
1186
|
+
}, Xe = /* @__PURE__ */ new Set(), Hr = '[role="tree"] [role="treeitem"][tabindex="0"]', $r = "[data-directory-tree-tab-stop]", ca = (e) => {
|
|
1187
|
+
const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: c, onSourceChange: l, onRevealSource: a, viewSwitch: s } = e, { labels: d, sources: u, trees: i, documents: p, announcer: h, reveals: g } = $(), { settings: v, advance: O } = Dr(), A = C(() => It(t === "tree"), [t]), q = t === "tree" && v.selectionMode === "multiple";
|
|
1188
|
+
cr(q);
|
|
1189
|
+
const y = e.mode === "tree" ? e.tray.onGatheredChange : null, Z = e.mode === "tree" ? e.onOpenSelection : void 0, N = e.mode === "tree" ? e.onOpenFolder : null, R = e.mode === "tree" && e.currentFolder, k = C(() => N === null ? null : { current: r, open: N }, [N, r]), S = e.mode === "tree" && q ? e.tray.gathered : Ae, b = w(
|
|
1190
|
+
(P) => {
|
|
1191
|
+
const I = O(P);
|
|
1192
|
+
return I.selectionMode !== "multiple" && y?.(Ae), I;
|
|
1164
1193
|
},
|
|
1165
|
-
[
|
|
1166
|
-
),
|
|
1167
|
-
const
|
|
1168
|
-
if (
|
|
1169
|
-
[
|
|
1170
|
-
}, []),
|
|
1194
|
+
[O, y]
|
|
1195
|
+
), _ = Ir({ settings: v, descriptors: A, onAdvance: b }), B = w((P) => y?.((I) => or(I, P)), [y]), ie = w((P) => y?.((I) => sr(I, P)), [y]), re = w(() => y?.(Ae), [y]), K = E(null), U = w(() => {
|
|
1196
|
+
const P = K.current;
|
|
1197
|
+
if (P === null) return;
|
|
1198
|
+
[Hr, $r, '[data-testid="markdown-explorer-tree-settings"]'].map((V) => P.querySelector(V)).find((V) => V !== null)?.focus();
|
|
1199
|
+
}, []), ae = C(() => new Set(S.keys()), [S]), z = C(() => r === null ? Xe : /* @__PURE__ */ new Set([r]), [r]), Q = C(() => {
|
|
1171
1200
|
if (t === "multi") return { mode: "multiple", items: o, shownPath: null, onChange: null };
|
|
1172
|
-
switch (
|
|
1201
|
+
switch (v.selectionMode) {
|
|
1173
1202
|
case "single":
|
|
1174
|
-
return { mode: "single", items:
|
|
1203
|
+
return { mode: "single", items: z, shownPath: r, onChange: null };
|
|
1175
1204
|
case "multiple":
|
|
1176
|
-
return { mode: "multiple", items:
|
|
1205
|
+
return { mode: "multiple", items: ae, shownPath: r, onChange: B };
|
|
1177
1206
|
case "none":
|
|
1178
|
-
return { mode: "none", items:
|
|
1207
|
+
return { mode: "none", items: Xe, shownPath: null, onChange: null };
|
|
1179
1208
|
}
|
|
1180
|
-
}, [t, o,
|
|
1181
|
-
(
|
|
1182
|
-
r !== null &&
|
|
1209
|
+
}, [t, o, v.selectionMode, z, r, ae, B]), J = C(() => v.revealDocument ? { path: r, openFolders: !R } : { path: Q.shownPath, openFolders: !1 }, [v.revealDocument, r, R, Q.shownPath]), ee = w(
|
|
1210
|
+
(P) => {
|
|
1211
|
+
r !== null && g.settle(r), l(P);
|
|
1183
1212
|
},
|
|
1184
|
-
[r,
|
|
1185
|
-
), [
|
|
1186
|
-
if (!
|
|
1187
|
-
|
|
1213
|
+
[r, g, l]
|
|
1214
|
+
), [M, le] = F(null), [de, he] = F(!1), [oe, G] = F(null), te = E(!1), we = w(async () => {
|
|
1215
|
+
if (!te.current) {
|
|
1216
|
+
te.current = !0, he(!0), G(null);
|
|
1188
1217
|
try {
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
|
|
1218
|
+
const P = await i.refresh(n);
|
|
1219
|
+
if (P.status === "superseded") return;
|
|
1220
|
+
p.invalidate(), P.status === "failed" ? G({ sourceId: n, failure: P.failure }) : h.announce(d.treeRefreshed);
|
|
1192
1221
|
} finally {
|
|
1193
|
-
|
|
1222
|
+
te.current = !1, he(!1);
|
|
1194
1223
|
}
|
|
1195
1224
|
}
|
|
1196
|
-
}, [i,
|
|
1197
|
-
return /* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1199
|
-
u.length > 1 ? /* @__PURE__ */ m("select", { className: "aqmx-explorer-source", "aria-label": d.sourceLabel, title:
|
|
1200
|
-
/* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */ m(Ot, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label":
|
|
1202
|
-
/* @__PURE__ */
|
|
1225
|
+
}, [i, p, n, h, d]), ue = M === null ? null : M.expandAll, me = M?.expanding === !0, xe = u.find((P) => P.id === n), se = s.target === "multi" ? sn : ln, W = s.target === "multi" ? d.switchToMulti : d.switchToTree;
|
|
1226
|
+
return /* @__PURE__ */ L("nav", { ref: K, "aria-label": d.explorerRegion, className: "aqmx-explorer", "data-testid": "markdown-explorer-explorer", "data-aqmx-mode": t, children: [
|
|
1227
|
+
/* @__PURE__ */ L("div", { className: "aqmx-explorer-header", children: [
|
|
1228
|
+
u.length > 1 ? /* @__PURE__ */ m("select", { className: "aqmx-explorer-source", "aria-label": d.sourceLabel, title: xe?.label, value: n, onChange: (P) => ee(P.currentTarget.value), "data-testid": "markdown-explorer-source-select", children: u.map((P) => /* @__PURE__ */ m("option", { value: P.id, children: P.label }, P.id)) }) : null,
|
|
1229
|
+
/* @__PURE__ */ L("div", { className: "aqmx-explorer-actions", children: [
|
|
1230
|
+
/* @__PURE__ */ m(Ot, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label": W, title: W, "data-testid": "markdown-explorer-view-switch", "data-aqmx-target": s.target, children: /* @__PURE__ */ m(se, { "aria-hidden": "true" }) }),
|
|
1231
|
+
/* @__PURE__ */ L(
|
|
1203
1232
|
"button",
|
|
1204
1233
|
{
|
|
1205
1234
|
type: "button",
|
|
1206
1235
|
className: "aqmx-icon-button aqmx-labelled-button",
|
|
1207
1236
|
title: d.refreshTree,
|
|
1208
|
-
"aria-disabled":
|
|
1209
|
-
"aria-busy":
|
|
1210
|
-
"data-aqmx-busy":
|
|
1237
|
+
"aria-disabled": de,
|
|
1238
|
+
"aria-busy": de,
|
|
1239
|
+
"data-aqmx-busy": de ? "true" : void 0,
|
|
1211
1240
|
"data-testid": "markdown-explorer-refresh",
|
|
1212
1241
|
onClick: () => {
|
|
1213
|
-
|
|
1242
|
+
we();
|
|
1214
1243
|
},
|
|
1215
1244
|
children: [
|
|
1216
1245
|
/* @__PURE__ */ m(Oe, { "aria-hidden": "true" }),
|
|
@@ -1225,36 +1254,33 @@ const Ar = /* @__PURE__ */ p.forwardRef(Or), Pr = Object.freeze({
|
|
|
1225
1254
|
className: "aqmx-icon-button",
|
|
1226
1255
|
"aria-label": d.expandAll,
|
|
1227
1256
|
title: d.expandAll,
|
|
1228
|
-
"aria-disabled":
|
|
1229
|
-
"aria-busy":
|
|
1230
|
-
"data-aqmx-busy":
|
|
1257
|
+
"aria-disabled": ue === null || me,
|
|
1258
|
+
"aria-busy": me,
|
|
1259
|
+
"data-aqmx-busy": me ? "true" : void 0,
|
|
1231
1260
|
"data-testid": "markdown-explorer-expand-all",
|
|
1232
|
-
onClick: () =>
|
|
1233
|
-
children: /* @__PURE__ */ m(
|
|
1261
|
+
onClick: () => ue?.(),
|
|
1262
|
+
children: /* @__PURE__ */ m(rn, { "aria-hidden": "true" })
|
|
1234
1263
|
}
|
|
1235
1264
|
),
|
|
1236
|
-
/* @__PURE__ */ m("button", { type: "button", className: "aqmx-icon-button", "aria-label": d.collapseAll, title: d.collapseAll, "aria-disabled":
|
|
1237
|
-
|
|
1265
|
+
/* @__PURE__ */ m("button", { type: "button", className: "aqmx-icon-button", "aria-label": d.collapseAll, title: d.collapseAll, "aria-disabled": M === null, "data-testid": "markdown-explorer-collapse-all", onClick: () => M?.collapseAll(), children: /* @__PURE__ */ m(tn, { "aria-hidden": "true" }) }),
|
|
1266
|
+
_.trigger
|
|
1238
1267
|
] })
|
|
1239
1268
|
] }),
|
|
1240
|
-
/* @__PURE__ */
|
|
1241
|
-
|
|
1242
|
-
/* @__PURE__ */ m(
|
|
1243
|
-
/* @__PURE__ */ m(
|
|
1244
|
-
|
|
1245
|
-
|
|
1269
|
+
/* @__PURE__ */ L("div", { className: "aqmx-explorer-body", "data-aqmx-explorer-body": "", children: [
|
|
1270
|
+
oe !== null && oe.sourceId === n ? /* @__PURE__ */ m("p", { role: "alert", className: "aqmx-explorer-refresh-failure", "data-testid": "markdown-explorer-refresh-failure", "data-aqmx-failure": oe.failure.reason, children: d.treeRefreshFailed(Pt(d, oe.failure.reason)) }) : null,
|
|
1271
|
+
/* @__PURE__ */ m(et, { fallback: null, children: /* @__PURE__ */ m(cn, {}) }),
|
|
1272
|
+
/* @__PURE__ */ m(rr, { mode: t, sourceId: n, settings: v, reveal: J, openPaths: o, selection: Q, onOpenDocument: c, folders: k, onRevealSource: a, onControls: le }, n),
|
|
1273
|
+
q && S.size > 0 ? /* @__PURE__ */ m(lr, { selection: S, onRemove: ie, onClear: re, onOpenSelection: Z, onLeave: U }) : null,
|
|
1274
|
+
_.menu
|
|
1246
1275
|
] })
|
|
1247
1276
|
] });
|
|
1248
|
-
}
|
|
1249
|
-
const t = window.matchMedia(ut);
|
|
1250
|
-
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
1251
|
-
}, Dr = () => window.matchMedia(ut).matches, Hr = () => !1, $r = () => Ee(Ir, Dr, Hr);
|
|
1277
|
+
};
|
|
1252
1278
|
function Zr({
|
|
1253
1279
|
title: e,
|
|
1254
1280
|
titleId: t,
|
|
1255
1281
|
...n
|
|
1256
1282
|
}, r) {
|
|
1257
|
-
return /* @__PURE__ */
|
|
1283
|
+
return /* @__PURE__ */ f.createElement("svg", Object.assign({
|
|
1258
1284
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1259
1285
|
viewBox: "0 0 24 24",
|
|
1260
1286
|
fill: "currentColor",
|
|
@@ -1262,61 +1288,61 @@ function Zr({
|
|
|
1262
1288
|
"data-slot": "icon",
|
|
1263
1289
|
ref: r,
|
|
1264
1290
|
"aria-labelledby": t
|
|
1265
|
-
}, n), e ? /* @__PURE__ */
|
|
1291
|
+
}, n), e ? /* @__PURE__ */ f.createElement("title", {
|
|
1266
1292
|
id: t
|
|
1267
|
-
}, e) : null, /* @__PURE__ */
|
|
1293
|
+
}, e) : null, /* @__PURE__ */ f.createElement("path", {
|
|
1268
1294
|
fillRule: "evenodd",
|
|
1269
1295
|
d: "M3 6.75A.75.75 0 0 1 3.75 6h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 6.75ZM3 12a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 12Zm0 5.25a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75Z",
|
|
1270
1296
|
clipRule: "evenodd"
|
|
1271
1297
|
}));
|
|
1272
1298
|
}
|
|
1273
|
-
const Br = /* @__PURE__ */
|
|
1274
|
-
const { labels: c } =
|
|
1275
|
-
u.navigated !== l && (i({ navigated: l, source: a.source }), u.source === a.source && !
|
|
1276
|
-
const [
|
|
1277
|
-
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
}, [s, t, r]),
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
}, []),
|
|
1286
|
-
|
|
1287
|
-
}, []),
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1290
|
-
}, []),
|
|
1299
|
+
const Br = /* @__PURE__ */ f.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t, covered: n, onNoticeSlotChange: r, dismissals: o }) => {
|
|
1300
|
+
const { labels: c } = $(), l = Jt(), { location: a } = qt(), [s, d] = F(!1), [u, i] = F({ navigated: l, source: a.source }), [p, h] = F(!1);
|
|
1301
|
+
u.navigated !== l && (i({ navigated: l, source: a.source }), u.source === a.source && !p && d(!1));
|
|
1302
|
+
const [g, v] = F(o);
|
|
1303
|
+
g !== o && (v(o), d(!1));
|
|
1304
|
+
const O = E(null), A = E(null), q = E(null), y = E(!1), Z = Re();
|
|
1305
|
+
H(() => {
|
|
1306
|
+
const b = O.current;
|
|
1307
|
+
b !== null && (s && !b.open ? (b.showModal(), A.current?.focus()) : !s && b.open && (b.close(), t.current?.focus()), r(s ? q.current : null));
|
|
1308
|
+
}, [s, t, r]), H(() => () => r(null), [r]);
|
|
1309
|
+
const N = w((b) => {
|
|
1310
|
+
b.key !== "Escape" || b.defaultPrevented || (Pe(b), d(!1));
|
|
1311
|
+
}, []), R = w((b) => {
|
|
1312
|
+
y.current = b.target === b.currentTarget;
|
|
1313
|
+
}, []), k = w((b) => {
|
|
1314
|
+
const _ = y.current;
|
|
1315
|
+
y.current = !1, _ && b.target === b.currentTarget && d(!1);
|
|
1316
|
+
}, []), S = w(() => {
|
|
1291
1317
|
d(!1);
|
|
1292
1318
|
}, []);
|
|
1293
|
-
return /* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */ m("div", { className: "aqmx-sheet-bar", inert: n, children: /* @__PURE__ */
|
|
1319
|
+
return /* @__PURE__ */ L(Qe, { children: [
|
|
1320
|
+
/* @__PURE__ */ m("div", { className: "aqmx-sheet-bar", inert: n, children: /* @__PURE__ */ L("button", { ref: t, type: "button", className: "aqmx-sheet-toggle", "aria-haspopup": "dialog", "aria-expanded": s, "aria-controls": Z, "data-testid": "markdown-explorer-sheet-toggle", onClick: () => d(!0), children: [
|
|
1295
1321
|
/* @__PURE__ */ m(Br, { "aria-hidden": "true" }),
|
|
1296
1322
|
/* @__PURE__ */ m("span", { children: c.showExplorer })
|
|
1297
1323
|
] }) }),
|
|
1298
|
-
/* @__PURE__ */ m("dialog", { ref:
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */ m("div", { ref:
|
|
1301
|
-
/* @__PURE__ */ m("button", { ref:
|
|
1324
|
+
/* @__PURE__ */ m("dialog", { ref: O, id: Z, className: "aqmx-sheet", "aria-label": c.explorerRegion, "data-testid": "markdown-explorer-sheet", onKeyDown: N, onPointerDown: R, onClick: k, onClose: S, children: /* @__PURE__ */ L("div", { className: "aqmx-sheet-panel", children: [
|
|
1325
|
+
/* @__PURE__ */ L("div", { className: "aqmx-sheet-header", children: [
|
|
1326
|
+
/* @__PURE__ */ m("div", { ref: q, className: "aqmx-sheet-notice-slot" }),
|
|
1327
|
+
/* @__PURE__ */ m("button", { ref: A, type: "button", className: "aqmx-sheet-close", "aria-label": c.hideExplorer, title: c.hideExplorer, "data-testid": "markdown-explorer-sheet-close", onClick: () => d(!1), children: /* @__PURE__ */ m(dt, { "aria-hidden": "true" }) })
|
|
1302
1328
|
] }),
|
|
1303
|
-
/* @__PURE__ */ m("div", { className: "aqmx-sheet-body", children: /* @__PURE__ */ m(
|
|
1304
|
-
/* @__PURE__ */ m(
|
|
1329
|
+
/* @__PURE__ */ m("div", { className: "aqmx-sheet-body", children: /* @__PURE__ */ m(Fe, { value: s, children: /* @__PURE__ */ m(ut, { value: h, children: e }) }) }),
|
|
1330
|
+
/* @__PURE__ */ m(Ct, { holds: s, testId: "markdown-explorer-sheet-announcer" })
|
|
1305
1331
|
] }) })
|
|
1306
1332
|
] });
|
|
1307
|
-
}, Vr =
|
|
1308
|
-
for (const n of e.querySelectorAll(`[data-panel-id="${
|
|
1333
|
+
}, Vr = qe(null), Me = "aqmx-explorer", ft = "aqmx-content", jr = "--aqmx-split-band", _e = '[role="tree"] [role="treeitem"]', Kr = `${_e}[tabindex="0"]`, Ur = "[data-directory-tree-tab-stop]", Gr = (e, t) => {
|
|
1334
|
+
for (const n of e.querySelectorAll(`[data-panel-id="${Me}"] ${_e}`)) if (n.getAttribute(ce) === t) return n;
|
|
1309
1335
|
return null;
|
|
1310
|
-
},
|
|
1336
|
+
}, Ye = (e, t) => ({
|
|
1311
1337
|
inlineSize: e > 0 ? e : null,
|
|
1312
1338
|
rootFontPixels: t > 0 ? t : Vt
|
|
1313
|
-
}),
|
|
1314
|
-
const [n, r] =
|
|
1315
|
-
return
|
|
1339
|
+
}), Wr = (e, t) => {
|
|
1340
|
+
const [n, r] = F(() => Ye(0, 0));
|
|
1341
|
+
return H(() => {
|
|
1316
1342
|
const o = e.current, c = t.current;
|
|
1317
1343
|
if (o === null || c === null) throw new Error("[markdown-explorer] the split frame is not mounted");
|
|
1318
1344
|
const l = { frame: o.getBoundingClientRect().width, rem: c.getBoundingClientRect().width }, a = () => {
|
|
1319
|
-
const d =
|
|
1345
|
+
const d = Ye(l.frame, l.rem);
|
|
1320
1346
|
r((u) => u.inlineSize === d.inlineSize && u.rootFontPixels === d.rootFontPixels ? u : d);
|
|
1321
1347
|
};
|
|
1322
1348
|
a();
|
|
@@ -1329,14 +1355,14 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1329
1355
|
});
|
|
1330
1356
|
return s.observe(o), s.observe(c), () => s.disconnect();
|
|
1331
1357
|
}, [e, t]), n;
|
|
1332
|
-
},
|
|
1333
|
-
const o =
|
|
1334
|
-
|
|
1358
|
+
}, pt = (e) => `aqmx-split-handle-${e}`, Xr = (e, { frameRef: t, sheetToggleRef: n, handleId: r }) => {
|
|
1359
|
+
const o = E(!1), c = E(null), l = E(!1);
|
|
1360
|
+
H(() => {
|
|
1335
1361
|
const s = t.current;
|
|
1336
1362
|
if (s === null) throw new Error("[markdown-explorer] the split frame is not mounted");
|
|
1337
1363
|
const d = (i) => {
|
|
1338
|
-
const
|
|
1339
|
-
o.current =
|
|
1364
|
+
const p = i.target instanceof Element ? i.target : null;
|
|
1365
|
+
o.current = p !== null && p.closest(`[data-panel-id="${ft}"]`) === null, !l.current && (c.current = p?.closest(`${_e}[${ce}]`)?.getAttribute(ce) ?? null);
|
|
1340
1366
|
}, u = (i) => {
|
|
1341
1367
|
i.relatedTarget instanceof Node && !s.contains(i.relatedTarget) && (o.current = !1);
|
|
1342
1368
|
};
|
|
@@ -1344,16 +1370,16 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1344
1370
|
s.removeEventListener("focusin", d), s.removeEventListener("focusout", u);
|
|
1345
1371
|
};
|
|
1346
1372
|
}, [t]);
|
|
1347
|
-
const a =
|
|
1348
|
-
|
|
1373
|
+
const a = E(e);
|
|
1374
|
+
H(() => {
|
|
1349
1375
|
if (a.current === e) return;
|
|
1350
1376
|
a.current = e;
|
|
1351
1377
|
const s = t.current;
|
|
1352
1378
|
if (s === null || !o.current) return;
|
|
1353
1379
|
const d = (u) => {
|
|
1354
|
-
const { activeElement: i, body:
|
|
1355
|
-
if (i !== null && i !==
|
|
1356
|
-
const h = u.find((
|
|
1380
|
+
const { activeElement: i, body: p } = s.ownerDocument;
|
|
1381
|
+
if (i !== null && i !== p) return;
|
|
1382
|
+
const h = u.find((g) => g !== null);
|
|
1357
1383
|
if (h != null) {
|
|
1358
1384
|
l.current = !0;
|
|
1359
1385
|
try {
|
|
@@ -1369,23 +1395,23 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1369
1395
|
}
|
|
1370
1396
|
queueMicrotask(() => {
|
|
1371
1397
|
if (a.current !== e || !o.current) return;
|
|
1372
|
-
const u = c.current, i = `[data-panel-id="${
|
|
1398
|
+
const u = c.current, i = `[data-panel-id="${Me}"]`;
|
|
1373
1399
|
d([
|
|
1374
1400
|
u === null ? null : Gr(s, u),
|
|
1375
|
-
s.querySelector(`${i} ${jr}`),
|
|
1376
1401
|
s.querySelector(`${i} ${Kr}`),
|
|
1402
|
+
s.querySelector(`${i} ${Ur}`),
|
|
1377
1403
|
s.querySelector(`[data-resize-handle-id="${r}"]`)
|
|
1378
1404
|
]);
|
|
1379
1405
|
});
|
|
1380
1406
|
}, [e, t, n, r]);
|
|
1381
|
-
},
|
|
1382
|
-
const l =
|
|
1383
|
-
return
|
|
1407
|
+
}, ia = ({ view: e, explorer: t, content: n, contentCoversPage: r = !1, sheetDismissals: o = 0, onDraggingChange: c }) => {
|
|
1408
|
+
const l = E(null), [a, s] = F(null), d = E(null), u = E(null), { inlineSize: i, rootFontPixels: p } = Wr(l, d), h = i !== null && i < Dt(p);
|
|
1409
|
+
return Xr(h, { frameRef: l, sheetToggleRef: u, handleId: pt(e) }), /* @__PURE__ */ L("div", { ref: l, className: "aqmx-split-frame", "data-aqmx-explorer-mode": h ? "sheet" : "split", children: [
|
|
1384
1410
|
/* @__PURE__ */ m("span", { ref: d, className: "aqmx-rem-probe", "aria-hidden": "true", "data-aqmx-rem-probe": "" }),
|
|
1385
1411
|
h ? /* @__PURE__ */ m(zr, { explorer: t, toggleRef: u, covered: r, onNoticeSlotChange: s, dismissals: o }) : null,
|
|
1386
|
-
/* @__PURE__ */ m(Vr, { value: h ? a : null, children: /* @__PURE__ */ m(
|
|
1412
|
+
/* @__PURE__ */ m(Vr, { value: h ? a : null, children: /* @__PURE__ */ m(Yr, { view: e, sheet: h, explorer: t, content: n, contentCoversPage: r, onDraggingChange: c, explorerMinPixels: Ht(p) }) })
|
|
1387
1413
|
] });
|
|
1388
|
-
},
|
|
1414
|
+
}, Yr = ({
|
|
1389
1415
|
view: e,
|
|
1390
1416
|
sheet: t,
|
|
1391
1417
|
explorer: n,
|
|
@@ -1394,79 +1420,74 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
|
|
|
1394
1420
|
onDraggingChange: c,
|
|
1395
1421
|
explorerMinPixels: l
|
|
1396
1422
|
}) => {
|
|
1397
|
-
const { viewSettings: a, labels: s } =
|
|
1398
|
-
|
|
1399
|
-
|
|
1423
|
+
const { viewSettings: a, labels: s } = $(), u = Ft((N) => e === "tree" ? N.treeExplorer : N.multiExplorer) ?? (e === "tree" ? Bt : zt), i = E(!1), [p, h] = F(!1), g = E(c);
|
|
1424
|
+
H(() => {
|
|
1425
|
+
g.current = c;
|
|
1400
1426
|
}, [c]);
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1427
|
+
const v = Yt(
|
|
1428
|
+
w(
|
|
1429
|
+
(N) => {
|
|
1430
|
+
if (N.length !== 2) return;
|
|
1431
|
+
const [R = 0, k = 0] = N, S = R + k;
|
|
1432
|
+
if (S <= 0 || R <= 0) return;
|
|
1433
|
+
const b = Math.min(Ve, R / S * 100);
|
|
1434
|
+
a.update(e === "tree" ? { treeExplorer: b } : { multiExplorer: b });
|
|
1435
|
+
},
|
|
1436
|
+
[a, e]
|
|
1437
|
+
)
|
|
1438
|
+
);
|
|
1439
|
+
D(
|
|
1414
1440
|
() => () => {
|
|
1415
|
-
|
|
1441
|
+
i.current && g.current?.(!1);
|
|
1416
1442
|
},
|
|
1417
1443
|
[]
|
|
1418
1444
|
);
|
|
1419
|
-
const
|
|
1420
|
-
(
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
b.length === 2 && A > 0 && S(y <= 0), R.source === "keyboard" ? L() : R.source === "pointer" && (h.current = !0);
|
|
1445
|
+
const A = Qt() ? $t : Zt, q = C(() => ({ [jr]: `${String(t ? 0 : A)}px` }), [t, A]), y = w(
|
|
1446
|
+
(N, R) => {
|
|
1447
|
+
const [k = 0, S = 0] = N;
|
|
1448
|
+
N.length === 2 && S > 0 && h(k <= 0), v.layoutChanged(N, R);
|
|
1424
1449
|
},
|
|
1425
|
-
[
|
|
1426
|
-
),
|
|
1427
|
-
(
|
|
1428
|
-
|
|
1429
|
-
h.current = !1;
|
|
1430
|
-
return;
|
|
1431
|
-
}
|
|
1432
|
-
h.current && (h.current = !1, L());
|
|
1450
|
+
[v]
|
|
1451
|
+
), Z = w(
|
|
1452
|
+
(N) => {
|
|
1453
|
+
i.current = N, c?.(N), v.draggingChanged(N);
|
|
1433
1454
|
},
|
|
1434
|
-
[c,
|
|
1455
|
+
[c, v]
|
|
1435
1456
|
);
|
|
1436
|
-
return /* @__PURE__ */
|
|
1457
|
+
return /* @__PURE__ */ L(Wt, { id: `aqmx-split-${e}`, direction: "horizontal", onLayout: y, className: "aqmx-split", style: q, "data-aqmx-split": e, children: [
|
|
1437
1458
|
t ? null : /* @__PURE__ */ m(
|
|
1438
|
-
|
|
1459
|
+
je,
|
|
1439
1460
|
{
|
|
1440
|
-
id:
|
|
1461
|
+
id: Me,
|
|
1441
1462
|
defaultSize: { value: u, unit: "percentage" },
|
|
1442
1463
|
minSize: { value: l, unit: "pixels" },
|
|
1443
|
-
maxSize: { value:
|
|
1464
|
+
maxSize: { value: Ve, unit: "percentage" },
|
|
1444
1465
|
collapsible: { from: "end" },
|
|
1445
1466
|
pixelAdjustPriority: 1,
|
|
1446
1467
|
inert: o,
|
|
1447
1468
|
className: "aqmx-split-explorer",
|
|
1448
|
-
children: /* @__PURE__ */ m(
|
|
1469
|
+
children: /* @__PURE__ */ m(Fe, { value: !p, children: n })
|
|
1449
1470
|
}
|
|
1450
1471
|
),
|
|
1451
1472
|
t ? null : /* @__PURE__ */ m(
|
|
1452
1473
|
Xt,
|
|
1453
1474
|
{
|
|
1454
|
-
id:
|
|
1455
|
-
thickness:
|
|
1456
|
-
indicator: { visible: !0, thickness:
|
|
1475
|
+
id: pt(e),
|
|
1476
|
+
thickness: A,
|
|
1477
|
+
indicator: { visible: !0, thickness: Ee.gripThickness, length: Ee.gripLength, barThickness: Ee.barThickness, barLength: Ee.barLength },
|
|
1457
1478
|
title: s.resizeExplorer,
|
|
1458
1479
|
"aria-label": s.resizeExplorer,
|
|
1459
|
-
onDragging:
|
|
1480
|
+
onDragging: Z,
|
|
1460
1481
|
inert: o,
|
|
1461
1482
|
className: "aqmx-split-handle"
|
|
1462
1483
|
}
|
|
1463
1484
|
),
|
|
1464
|
-
/* @__PURE__ */ m(
|
|
1485
|
+
/* @__PURE__ */ m(je, { id: ft, defaultSize: { value: 100 - u, unit: "percentage" }, contentOverflow: "hidden", className: "aqmx-split-content", ...o ? { style: { isolation: "auto" } } : {}, children: r })
|
|
1465
1486
|
] });
|
|
1466
1487
|
};
|
|
1467
1488
|
export {
|
|
1468
|
-
|
|
1489
|
+
Ae as E,
|
|
1469
1490
|
Vr as S,
|
|
1470
|
-
|
|
1471
|
-
|
|
1491
|
+
ia as a,
|
|
1492
|
+
ca as b
|
|
1472
1493
|
};
|