@loomcycle/explorer 0.2.0 → 0.3.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/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +942 -694
- package/dist/index.js.map +1 -1
- package/dist/lib/createClient.d.ts +10 -0
- package/dist/lib/dataLayer.d.ts +5 -1
- package/dist/lib/imageUpload.d.ts +7 -0
- package/dist/styles.css +37 -0
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,104 +1,153 @@
|
|
|
1
1
|
import { jsx as n, jsxs as d, Fragment as q } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { LoomcycleClient as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
function
|
|
2
|
+
import { createContext as Je, useContext as Ve, useMemo as H, useState as y, useRef as K, useEffect as I, useCallback as G } from "react";
|
|
3
|
+
import { LoomcycleClient as Ze } from "@loomcycle/client";
|
|
4
|
+
import qe from "react-markdown";
|
|
5
|
+
import Qe from "remark-gfm";
|
|
6
|
+
function ye(e, r) {
|
|
7
7
|
return {
|
|
8
|
-
pathLs: (
|
|
9
|
-
{ op: "ls", path:
|
|
10
|
-
|
|
8
|
+
pathLs: (t, a, c, s) => e.path(
|
|
9
|
+
{ op: "ls", path: t, scope: a, recursive: c },
|
|
10
|
+
s
|
|
11
11
|
),
|
|
12
|
-
pathMkdir: (
|
|
13
|
-
pathMv: (
|
|
14
|
-
pathRm: (
|
|
15
|
-
documentCreate: (
|
|
16
|
-
{ op: "create_document", title:
|
|
17
|
-
|
|
12
|
+
pathMkdir: (t, a, c) => e.path({ op: "mkdir", path: t, scope: a }, c),
|
|
13
|
+
pathMv: (t, a, c, s) => e.path({ op: "mv", path: t, to: a, scope: c }, s),
|
|
14
|
+
pathRm: (t, a, c, s) => e.path({ op: "rm", path: t, scope: a, recursive: c }, s),
|
|
15
|
+
documentCreate: (t, a, c, s) => e.document(
|
|
16
|
+
{ op: "create_document", title: t, path: a, scope: c },
|
|
17
|
+
s
|
|
18
18
|
),
|
|
19
|
-
documentDelete: (
|
|
20
|
-
documentGet: (
|
|
21
|
-
documentsSummary: (
|
|
19
|
+
documentDelete: (t, a, c) => e.document({ op: "delete_document", id: t, scope: a }, c),
|
|
20
|
+
documentGet: (t, a, c) => e.document({ op: "get_document", id: t, scope: a }, c),
|
|
21
|
+
documentsSummary: (t, a, c) => e.document(
|
|
22
22
|
// documents_summary + document_ids are RFC BN wire additions the pinned
|
|
23
23
|
// SDK type doesn't enumerate; the /v1/_document passthrough accepts them
|
|
24
24
|
// verbatim, so cast past DocumentToolInput (same pattern as update_chunk).
|
|
25
25
|
{
|
|
26
26
|
op: "documents_summary",
|
|
27
|
-
scope:
|
|
28
|
-
...
|
|
29
|
-
...
|
|
27
|
+
scope: a,
|
|
28
|
+
...t.documentIds ? { document_ids: t.documentIds } : {},
|
|
29
|
+
...t.underPath ? { under_path: t.underPath } : {}
|
|
30
|
+
},
|
|
31
|
+
c
|
|
32
|
+
),
|
|
33
|
+
documentQueryChunks: (t, a, c) => e.document(
|
|
34
|
+
{ op: "query_chunks", document_id: t, scope: a, limit: 1e3 },
|
|
35
|
+
c
|
|
36
|
+
),
|
|
37
|
+
documentGetChunk: (t, a, c) => e.document({ op: "get_chunk", id: t, scope: a }, c),
|
|
38
|
+
documentCreateChunk: (t, a, c, s, o) => e.document(
|
|
39
|
+
{
|
|
40
|
+
op: "create_chunk",
|
|
41
|
+
document_id: t,
|
|
42
|
+
parent_id: a,
|
|
43
|
+
scope: s,
|
|
44
|
+
...c
|
|
30
45
|
},
|
|
31
|
-
|
|
46
|
+
o
|
|
32
47
|
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
documentSetAsset: (t, a, c, s, o, i) => e.document(
|
|
49
|
+
// set_asset is an RFC BO wire op the pinned SDK type doesn't enumerate;
|
|
50
|
+
// the /v1/_document passthrough accepts it verbatim.
|
|
51
|
+
{
|
|
52
|
+
op: "set_asset",
|
|
53
|
+
id: t,
|
|
54
|
+
media_type: a,
|
|
55
|
+
data: c,
|
|
56
|
+
...s ? { filename: s } : {},
|
|
57
|
+
scope: o
|
|
58
|
+
},
|
|
59
|
+
i
|
|
36
60
|
),
|
|
37
|
-
|
|
38
|
-
documentGetEdges: (a, t, r) => e.document(
|
|
61
|
+
documentGetEdges: (t, a, c) => e.document(
|
|
39
62
|
// get_edges is an RFC BN P4 wire op the pinned SDK type doesn't
|
|
40
63
|
// enumerate; the /v1/_document passthrough accepts it verbatim.
|
|
41
|
-
{ op: "get_edges", document_id:
|
|
42
|
-
|
|
64
|
+
{ op: "get_edges", document_id: t, scope: a },
|
|
65
|
+
c
|
|
43
66
|
),
|
|
44
|
-
documentUpdateChunk: (
|
|
67
|
+
documentUpdateChunk: (t, a, c, s, o) => e.document(
|
|
45
68
|
// `patch.fields` is unknown but DocumentToolInput.fields is a typed
|
|
46
69
|
// Record; the cast reconciles the spread (the server accepts arbitrary
|
|
47
70
|
// JSON there). Op order + arg names mirror the wire contract exactly.
|
|
48
71
|
{
|
|
49
72
|
op: "update_chunk",
|
|
50
|
-
id:
|
|
51
|
-
revision:
|
|
52
|
-
scope:
|
|
53
|
-
...
|
|
73
|
+
id: t,
|
|
74
|
+
revision: a,
|
|
75
|
+
scope: s,
|
|
76
|
+
...c
|
|
54
77
|
},
|
|
55
|
-
|
|
78
|
+
o
|
|
56
79
|
),
|
|
57
|
-
documentExportMd: (
|
|
80
|
+
documentExportMd: (t, a, c, s) => e.document(
|
|
58
81
|
{
|
|
59
82
|
op: "export_md",
|
|
60
|
-
document_id:
|
|
61
|
-
scope:
|
|
62
|
-
include_metadata:
|
|
83
|
+
document_id: t,
|
|
84
|
+
scope: a,
|
|
85
|
+
include_metadata: c
|
|
63
86
|
},
|
|
64
|
-
|
|
65
|
-
)
|
|
87
|
+
s
|
|
88
|
+
),
|
|
89
|
+
// Present only when an AssetFetch was supplied (the connection path); a bare
|
|
90
|
+
// client can't do the raw binary GET, so the op is omitted and the viewer
|
|
91
|
+
// shows a placeholder.
|
|
92
|
+
...r ? {
|
|
93
|
+
documentAssetObjectUrl: async (t, a, c) => {
|
|
94
|
+
const s = new URLSearchParams({ scope: a });
|
|
95
|
+
c?.scopeId && s.set("scope_id", c.scopeId), c?.tenant && s.set("tenant", c.tenant);
|
|
96
|
+
const o = await r(
|
|
97
|
+
`/v1/_document/asset/${encodeURIComponent(t)}?${s.toString()}`
|
|
98
|
+
);
|
|
99
|
+
if (!o.ok) throw new Error(`asset fetch failed: ${o.status}`);
|
|
100
|
+
const i = await o.blob();
|
|
101
|
+
return URL.createObjectURL(i);
|
|
102
|
+
}
|
|
103
|
+
} : {}
|
|
66
104
|
};
|
|
67
105
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
106
|
+
const Se = Je(null);
|
|
107
|
+
function Xe({
|
|
70
108
|
value: e,
|
|
71
|
-
children:
|
|
109
|
+
children: r
|
|
72
110
|
}) {
|
|
73
|
-
return /* @__PURE__ */ n(
|
|
111
|
+
return /* @__PURE__ */ n(Se.Provider, { value: e, children: r });
|
|
74
112
|
}
|
|
75
|
-
function
|
|
76
|
-
const e =
|
|
113
|
+
function se() {
|
|
114
|
+
const e = Ve(Se);
|
|
77
115
|
if (!e)
|
|
78
116
|
throw new Error(
|
|
79
117
|
"useExplorerData must be used within <PathExplorer> or <DocumentViewer> (no ExplorerDataLayer in context)"
|
|
80
118
|
);
|
|
81
119
|
return e;
|
|
82
120
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
return new
|
|
121
|
+
function Ye(e) {
|
|
122
|
+
const r = e.fetch;
|
|
123
|
+
return new Ze({
|
|
86
124
|
baseUrl: e.baseUrl,
|
|
87
125
|
authToken: e.token || void 0,
|
|
88
|
-
fetch: (t,
|
|
126
|
+
fetch: (t, a) => r ? r(t, a) : fetch(t, a)
|
|
89
127
|
});
|
|
90
128
|
}
|
|
91
|
-
function
|
|
92
|
-
const
|
|
93
|
-
return
|
|
129
|
+
function Ke(e) {
|
|
130
|
+
const r = e.fetch, t = (a, c) => r ? r(a, c) : fetch(a, c);
|
|
131
|
+
return (a) => {
|
|
132
|
+
const c = {};
|
|
133
|
+
return e.token && (c.Authorization = `Bearer ${e.token}`), t(e.baseUrl + a, { headers: c });
|
|
134
|
+
};
|
|
94
135
|
}
|
|
95
|
-
function
|
|
136
|
+
function xe(e) {
|
|
137
|
+
const { dataLayer: r, client: t, connection: a } = e;
|
|
138
|
+
return H(() => r || (t ? ye(t) : a ? ye(
|
|
139
|
+
Ye(a),
|
|
140
|
+
Ke(a)
|
|
141
|
+
// RFC BO — binary image-asset GET
|
|
142
|
+
) : null), [r, t, a?.baseUrl, a?.token, a?.fetch]);
|
|
143
|
+
}
|
|
144
|
+
function $e({
|
|
96
145
|
theme: e,
|
|
97
|
-
dataLayer:
|
|
146
|
+
dataLayer: r,
|
|
98
147
|
children: t
|
|
99
148
|
}) {
|
|
100
|
-
const
|
|
101
|
-
return
|
|
149
|
+
const a = e ? { "data-theme": e } : {};
|
|
150
|
+
return r ? /* @__PURE__ */ n("div", { className: "loomcycle-explorer", ...a, children: /* @__PURE__ */ n(Xe, { value: r, children: t }) }) : /* @__PURE__ */ n("div", { className: "loomcycle-explorer", ...a, children: /* @__PURE__ */ d("div", { className: "error-banner", children: [
|
|
102
151
|
"@loomcycle/explorer: provide a ",
|
|
103
152
|
/* @__PURE__ */ n("code", { children: "connection" }),
|
|
104
153
|
", ",
|
|
@@ -109,48 +158,48 @@ function we({
|
|
|
109
158
|
" prop."
|
|
110
159
|
] }) });
|
|
111
160
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
161
|
+
const be = 6;
|
|
162
|
+
function et({
|
|
114
163
|
children: e,
|
|
115
|
-
defaultLeftWidth:
|
|
164
|
+
defaultLeftWidth: r = 380,
|
|
116
165
|
minLeftWidth: t = 180,
|
|
117
|
-
minRightWidth:
|
|
166
|
+
minRightWidth: a = 240,
|
|
118
167
|
storageKey: c,
|
|
119
|
-
className:
|
|
168
|
+
className: s
|
|
120
169
|
}) {
|
|
121
|
-
const [
|
|
170
|
+
const [o, i] = y(() => {
|
|
122
171
|
if (c) {
|
|
123
|
-
const
|
|
124
|
-
if (Number.isFinite(
|
|
172
|
+
const N = localStorage.getItem(c), D = N ? parseInt(N, 10) : NaN;
|
|
173
|
+
if (Number.isFinite(D) && D >= t) return D;
|
|
125
174
|
}
|
|
126
|
-
return
|
|
127
|
-
}),
|
|
175
|
+
return r;
|
|
176
|
+
}), l = K(null), [m, p] = y(!1);
|
|
128
177
|
I(() => {
|
|
129
|
-
!c ||
|
|
130
|
-
}, [c,
|
|
131
|
-
const
|
|
132
|
-
|
|
178
|
+
!c || m || localStorage.setItem(c, String(Math.round(o)));
|
|
179
|
+
}, [c, o, m]);
|
|
180
|
+
const b = G((N) => {
|
|
181
|
+
N.preventDefault(), p(!0), N.target.setPointerCapture(N.pointerId);
|
|
133
182
|
}, []), g = G(
|
|
134
|
-
(
|
|
135
|
-
if (!
|
|
136
|
-
const
|
|
137
|
-
|
|
183
|
+
(N) => {
|
|
184
|
+
if (!m || !l.current) return;
|
|
185
|
+
const D = l.current.getBoundingClientRect(), U = N.clientX - D.left, R = D.width - a - be, W = Math.max(t, Math.min(U, R));
|
|
186
|
+
i(W);
|
|
138
187
|
},
|
|
139
|
-
[
|
|
140
|
-
),
|
|
141
|
-
|
|
188
|
+
[m, t, a]
|
|
189
|
+
), O = G((N) => {
|
|
190
|
+
p(!1);
|
|
142
191
|
try {
|
|
143
|
-
|
|
192
|
+
N.target.releasePointerCapture(N.pointerId);
|
|
144
193
|
} catch {
|
|
145
194
|
}
|
|
146
195
|
}, []);
|
|
147
196
|
return /* @__PURE__ */ d(
|
|
148
197
|
"div",
|
|
149
198
|
{
|
|
150
|
-
ref:
|
|
151
|
-
className: `splitter ${
|
|
199
|
+
ref: l,
|
|
200
|
+
className: `splitter ${s ?? ""} ${m ? "dragging" : ""}`,
|
|
152
201
|
style: {
|
|
153
|
-
gridTemplateColumns: `${
|
|
202
|
+
gridTemplateColumns: `${o}px ${be}px 1fr`
|
|
154
203
|
},
|
|
155
204
|
children: [
|
|
156
205
|
/* @__PURE__ */ n("div", { className: "splitter-pane splitter-left", children: e[0] }),
|
|
@@ -160,11 +209,11 @@ function Ue({
|
|
|
160
209
|
className: "splitter-handle",
|
|
161
210
|
role: "separator",
|
|
162
211
|
"aria-orientation": "vertical",
|
|
163
|
-
"aria-valuenow": Math.round(
|
|
164
|
-
onPointerDown:
|
|
212
|
+
"aria-valuenow": Math.round(o),
|
|
213
|
+
onPointerDown: b,
|
|
165
214
|
onPointerMove: g,
|
|
166
|
-
onPointerUp:
|
|
167
|
-
onPointerCancel:
|
|
215
|
+
onPointerUp: O,
|
|
216
|
+
onPointerCancel: O
|
|
168
217
|
}
|
|
169
218
|
),
|
|
170
219
|
/* @__PURE__ */ n("div", { className: "splitter-pane splitter-right", children: e[1] })
|
|
@@ -172,7 +221,39 @@ function Ue({
|
|
|
172
221
|
}
|
|
173
222
|
);
|
|
174
223
|
}
|
|
175
|
-
const
|
|
224
|
+
const tt = ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
225
|
+
function Me(e) {
|
|
226
|
+
return tt.includes(e);
|
|
227
|
+
}
|
|
228
|
+
function Le(e) {
|
|
229
|
+
return new Promise((r, t) => {
|
|
230
|
+
if (!Me(e.type)) {
|
|
231
|
+
t(new Error(`unsupported image type "${e.type || "unknown"}" (png, jpeg, gif, webp only)`));
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const a = new FileReader();
|
|
235
|
+
a.onerror = () => t(a.error ?? new Error("failed to read file")), a.onload = () => {
|
|
236
|
+
const c = String(a.result ?? ""), s = c.indexOf(",");
|
|
237
|
+
if (s < 0) {
|
|
238
|
+
t(new Error("could not decode image data"));
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
r({ mediaType: e.type, data: c.slice(s + 1) });
|
|
242
|
+
}, a.readAsDataURL(e);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
function nt(e) {
|
|
246
|
+
if (!e) return null;
|
|
247
|
+
for (let r = 0; r < e.length; r++) {
|
|
248
|
+
const t = e[r];
|
|
249
|
+
if (t.kind === "file" && Me(t.type)) {
|
|
250
|
+
const a = t.getAsFile();
|
|
251
|
+
if (a) return a;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
const me = {
|
|
176
257
|
"doc.rfc.draft": "#c99a3a",
|
|
177
258
|
"doc.rfc.review": "#6a7bd6",
|
|
178
259
|
"doc.rfc.confirmed": "#3a9ad6",
|
|
@@ -184,119 +265,122 @@ const se = {
|
|
|
184
265
|
"chunk.review": "#6a7bd6",
|
|
185
266
|
"chunk.confirmed": "#3a9ad6",
|
|
186
267
|
"chunk.done": "#3aa06a"
|
|
187
|
-
},
|
|
188
|
-
function
|
|
189
|
-
return e && Object.keys(e).length > 0 ? e :
|
|
268
|
+
}, at = 0.16;
|
|
269
|
+
function fe(e) {
|
|
270
|
+
return e && Object.keys(e).length > 0 ? e : me;
|
|
190
271
|
}
|
|
191
|
-
function
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
272
|
+
function De(e, r, t) {
|
|
273
|
+
const a = e ?? "", c = r ?? "";
|
|
274
|
+
if (a && c && t[`doc.${a}.${c}`]) return t[`doc.${a}.${c}`];
|
|
275
|
+
if (a && t[`doc.${a}`]) return t[`doc.${a}`];
|
|
195
276
|
}
|
|
196
|
-
function
|
|
277
|
+
function rt(e, r) {
|
|
197
278
|
const t = e ?? "";
|
|
198
|
-
return t ?
|
|
279
|
+
return t ? r[`chunk.${t}`] : void 0;
|
|
199
280
|
}
|
|
200
|
-
function
|
|
201
|
-
const
|
|
202
|
-
if (!
|
|
203
|
-
let t =
|
|
281
|
+
function ct(e) {
|
|
282
|
+
const r = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
|
|
283
|
+
if (!r) return;
|
|
284
|
+
let t = r[1];
|
|
204
285
|
t.length === 3 && (t = t[0] + t[0] + t[1] + t[1] + t[2] + t[2]);
|
|
205
|
-
const
|
|
206
|
-
return `rgba(${
|
|
286
|
+
const a = parseInt(t.slice(0, 2), 16), c = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16);
|
|
287
|
+
return `rgba(${a}, ${c}, ${s}, ${at})`;
|
|
207
288
|
}
|
|
208
|
-
function
|
|
289
|
+
function ge(e) {
|
|
209
290
|
if (!e) return;
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
return { background:
|
|
291
|
+
const r = ct(e);
|
|
292
|
+
if (r)
|
|
293
|
+
return { background: r, borderLeft: `3px solid ${e}` };
|
|
213
294
|
}
|
|
214
|
-
function
|
|
215
|
-
const
|
|
216
|
-
e.forEach((c) =>
|
|
295
|
+
function ot(e) {
|
|
296
|
+
const r = /* @__PURE__ */ new Map();
|
|
297
|
+
e.forEach((c) => r.set(c.id, { row: c, children: [] }));
|
|
217
298
|
const t = [];
|
|
218
299
|
e.forEach((c) => {
|
|
219
|
-
const
|
|
220
|
-
c.parent_id &&
|
|
300
|
+
const s = r.get(c.id);
|
|
301
|
+
c.parent_id && r.has(c.parent_id) ? r.get(c.parent_id).children.push(s) : t.push(s);
|
|
221
302
|
});
|
|
222
|
-
const
|
|
223
|
-
c.sort((
|
|
303
|
+
const a = (c) => {
|
|
304
|
+
c.sort((s, o) => s.row.position - o.row.position), c.forEach((s) => a(s.children));
|
|
224
305
|
};
|
|
225
|
-
return
|
|
306
|
+
return a(t), t;
|
|
226
307
|
}
|
|
227
|
-
function
|
|
308
|
+
function ke(e) {
|
|
309
|
+
return e === "image" ? "🖼" : e === "mermaid" ? "📊" : "";
|
|
310
|
+
}
|
|
311
|
+
function Re(e, r) {
|
|
228
312
|
for (const t of e) {
|
|
229
|
-
if (t.row.id ===
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
313
|
+
if (t.row.id === r) return t;
|
|
314
|
+
const a = Re(t.children, r);
|
|
315
|
+
if (a) return a;
|
|
232
316
|
}
|
|
233
317
|
}
|
|
234
|
-
function
|
|
318
|
+
function st({
|
|
235
319
|
tree: e,
|
|
236
|
-
selectedId:
|
|
320
|
+
selectedId: r,
|
|
237
321
|
onSelect: t,
|
|
238
|
-
colorEnabled:
|
|
322
|
+
colorEnabled: a,
|
|
239
323
|
scheme: c,
|
|
240
|
-
linkedIds:
|
|
324
|
+
linkedIds: s
|
|
241
325
|
}) {
|
|
242
|
-
const [
|
|
243
|
-
|
|
244
|
-
const g = new Map(
|
|
245
|
-
return g.set(
|
|
326
|
+
const [o, i] = y(() => /* @__PURE__ */ new Map()), l = G((p) => {
|
|
327
|
+
i((b) => {
|
|
328
|
+
const g = new Map(b);
|
|
329
|
+
return g.set(p, b.get(p) === !1), g;
|
|
246
330
|
});
|
|
247
331
|
}, []);
|
|
248
332
|
I(() => {
|
|
249
|
-
if (!
|
|
250
|
-
const
|
|
251
|
-
|
|
333
|
+
if (!r) return;
|
|
334
|
+
const p = it(e, r);
|
|
335
|
+
p.length !== 0 && i((b) => {
|
|
252
336
|
let g = !1;
|
|
253
|
-
const
|
|
254
|
-
for (const
|
|
255
|
-
|
|
256
|
-
return g ?
|
|
337
|
+
const O = new Map(b);
|
|
338
|
+
for (const N of p)
|
|
339
|
+
O.get(N) === !1 && (O.set(N, !0), g = !0);
|
|
340
|
+
return g ? O : b;
|
|
257
341
|
});
|
|
258
|
-
}, [e,
|
|
259
|
-
const
|
|
260
|
-
return e.length === 0 ? /* @__PURE__ */ n("div", { className: "empty", children: /* @__PURE__ */ n("p", { children: "No chunks." }) }) : /* @__PURE__ */ n("ul", { className: "tree chunk-tree", children: e.map((
|
|
261
|
-
|
|
342
|
+
}, [e, r]);
|
|
343
|
+
const m = a ? fe(c) : null;
|
|
344
|
+
return e.length === 0 ? /* @__PURE__ */ n("div", { className: "empty", children: /* @__PURE__ */ n("p", { children: "No chunks." }) }) : /* @__PURE__ */ n("ul", { className: "tree chunk-tree", children: e.map((p) => /* @__PURE__ */ n(
|
|
345
|
+
Ae,
|
|
262
346
|
{
|
|
263
|
-
node:
|
|
264
|
-
expanded:
|
|
265
|
-
toggle:
|
|
266
|
-
selectedId:
|
|
347
|
+
node: p,
|
|
348
|
+
expanded: o,
|
|
349
|
+
toggle: l,
|
|
350
|
+
selectedId: r,
|
|
267
351
|
onSelect: t,
|
|
268
|
-
tintScheme:
|
|
269
|
-
linkedIds:
|
|
352
|
+
tintScheme: m,
|
|
353
|
+
linkedIds: s
|
|
270
354
|
},
|
|
271
|
-
|
|
355
|
+
p.row.id
|
|
272
356
|
)) });
|
|
273
357
|
}
|
|
274
|
-
function
|
|
275
|
-
const t = [],
|
|
276
|
-
for (const
|
|
277
|
-
if (
|
|
278
|
-
return t.push(...
|
|
279
|
-
if (
|
|
358
|
+
function it(e, r) {
|
|
359
|
+
const t = [], a = (c, s) => {
|
|
360
|
+
for (const o of c) {
|
|
361
|
+
if (o.row.id === r)
|
|
362
|
+
return t.push(...s), !0;
|
|
363
|
+
if (a(o.children, [...s, o.row.id])) return !0;
|
|
280
364
|
}
|
|
281
365
|
return !1;
|
|
282
366
|
};
|
|
283
|
-
return
|
|
367
|
+
return a(e, []), t;
|
|
284
368
|
}
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
return /* @__PURE__ */ d("li", { className: `node chunk-node ${
|
|
288
|
-
/* @__PURE__ */ d("div", { className: "row chunk-row", style:
|
|
369
|
+
function Ae({ node: e, expanded: r, toggle: t, selectedId: a, onSelect: c, tintScheme: s, linkedIds: o }) {
|
|
370
|
+
const i = e.children.length > 0, l = r.get(e.row.id) !== !1, m = a === e.row.id, p = s ? ge(rt(e.row.status, s)) : void 0, b = o?.has(e.row.id);
|
|
371
|
+
return /* @__PURE__ */ d("li", { className: `node chunk-node ${m ? "selected" : ""}`, children: [
|
|
372
|
+
/* @__PURE__ */ d("div", { className: "row chunk-row", style: p, children: [
|
|
289
373
|
/* @__PURE__ */ n(
|
|
290
374
|
"button",
|
|
291
375
|
{
|
|
292
376
|
type: "button",
|
|
293
377
|
className: "tree-caret",
|
|
294
|
-
"aria-label":
|
|
295
|
-
disabled: !
|
|
378
|
+
"aria-label": l ? "collapse" : "expand",
|
|
379
|
+
disabled: !i,
|
|
296
380
|
onClick: (g) => {
|
|
297
|
-
g.stopPropagation(),
|
|
381
|
+
g.stopPropagation(), i && t(e.row.id);
|
|
298
382
|
},
|
|
299
|
-
children:
|
|
383
|
+
children: i ? l ? "▼" : "▶" : "·"
|
|
300
384
|
}
|
|
301
385
|
),
|
|
302
386
|
/* @__PURE__ */ d(
|
|
@@ -307,71 +391,105 @@ function xe({ node: e, expanded: a, toggle: t, selectedId: r, onSelect: c, tintS
|
|
|
307
391
|
onClick: () => c(e),
|
|
308
392
|
title: e.row.title,
|
|
309
393
|
children: [
|
|
394
|
+
ke(e.row.type) && /* @__PURE__ */ n("span", { className: "chunk-type-icon", "aria-hidden": !0, children: ke(e.row.type) }),
|
|
310
395
|
/* @__PURE__ */ n("span", { className: "chunk-title", children: e.row.title || "(untitled)" }),
|
|
311
396
|
e.row.type && /* @__PURE__ */ n("span", { className: "chunk-badge", children: e.row.type }),
|
|
312
397
|
e.row.status && /* @__PURE__ */ n("span", { className: "chunk-badge chunk-status", children: e.row.status }),
|
|
313
|
-
|
|
398
|
+
b && /* @__PURE__ */ n("span", { className: "chunk-link-badge", title: "Has cross-reference links", "aria-label": "linked", children: "🔗" })
|
|
314
399
|
]
|
|
315
400
|
}
|
|
316
401
|
)
|
|
317
402
|
] }),
|
|
318
|
-
|
|
319
|
-
|
|
403
|
+
i && l && /* @__PURE__ */ n("ul", { className: "children chunk-children", children: e.children.map((g) => /* @__PURE__ */ n(
|
|
404
|
+
Ae,
|
|
320
405
|
{
|
|
321
406
|
node: g,
|
|
322
|
-
expanded:
|
|
407
|
+
expanded: r,
|
|
323
408
|
toggle: t,
|
|
324
|
-
selectedId:
|
|
409
|
+
selectedId: a,
|
|
325
410
|
onSelect: c,
|
|
326
|
-
tintScheme:
|
|
327
|
-
linkedIds:
|
|
411
|
+
tintScheme: s,
|
|
412
|
+
linkedIds: o
|
|
328
413
|
},
|
|
329
414
|
g.row.id
|
|
330
415
|
)) })
|
|
331
416
|
] });
|
|
332
417
|
}
|
|
333
|
-
|
|
334
|
-
|
|
418
|
+
let lt = 0;
|
|
419
|
+
function ie({ code: e }) {
|
|
420
|
+
const r = K(null), [t, a] = y({});
|
|
421
|
+
return I(() => {
|
|
422
|
+
let c = !1;
|
|
423
|
+
return (async () => {
|
|
424
|
+
try {
|
|
425
|
+
const s = (await import("mermaid")).default, o = r.current?.closest("[data-theme]")?.getAttribute("data-theme"), i = o ? o === "dark" : !0;
|
|
426
|
+
s.initialize({ startOnLoad: !1, theme: i ? "dark" : "default", securityLevel: "strict" });
|
|
427
|
+
const { svg: l } = await s.render(`lc-mmd-${lt++}`, e);
|
|
428
|
+
c || a({ svg: l });
|
|
429
|
+
} catch {
|
|
430
|
+
c || a({ err: !0 });
|
|
431
|
+
}
|
|
432
|
+
})(), () => {
|
|
433
|
+
c = !0;
|
|
434
|
+
};
|
|
435
|
+
}, [e]), t.err ? /* @__PURE__ */ n("pre", { className: "md-pre md-mermaid-error", title: "diagram failed to render", children: /* @__PURE__ */ n("code", { children: e }) }) : t.svg ? /* @__PURE__ */ n("div", { ref: r, className: "md-mermaid", dangerouslySetInnerHTML: { __html: t.svg } }) : /* @__PURE__ */ n("div", { ref: r, className: "md-mermaid md-mermaid-loading", children: "rendering diagram…" });
|
|
436
|
+
}
|
|
437
|
+
function dt({ chunk: e, scope: r, browse: t, onClose: a, onSaved: c }) {
|
|
438
|
+
const s = se(), [o, i] = y(e.title), [l, m] = y(e.type ?? ""), [p, b] = y(e.status ?? ""), [g, O] = y(e.body ?? ""), [N, D] = y(
|
|
335
439
|
e.fields ? JSON.stringify(e.fields, null, 2) : ""
|
|
336
|
-
), [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
const
|
|
440
|
+
), [U, R] = y(!1), [W, M] = y(null), [z, j] = y(!1), B = l === "mermaid", _ = l === "image" || !!e.asset, [w, L] = y(g);
|
|
441
|
+
I(() => {
|
|
442
|
+
if (!B) return;
|
|
443
|
+
const u = setTimeout(() => L(g), 400);
|
|
444
|
+
return () => clearTimeout(u);
|
|
445
|
+
}, [g, B]);
|
|
446
|
+
const F = async (u) => {
|
|
447
|
+
M(null), R(!0);
|
|
448
|
+
try {
|
|
449
|
+
const { mediaType: h, data: C } = await Le(u), E = await s.documentSetAsset(e.id, h, C, u.name, r, t);
|
|
450
|
+
c(E), a();
|
|
451
|
+
} catch (h) {
|
|
452
|
+
M(h instanceof Error ? h.message : String(h)), R(!1);
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
return /* @__PURE__ */ n("div", { className: "modal-overlay", onClick: a, children: /* @__PURE__ */ d("form", { className: "modal chunk-editor", onClick: (u) => u.stopPropagation(), onSubmit: async (u) => {
|
|
456
|
+
u.preventDefault(), M(null), j(!1);
|
|
457
|
+
const h = {
|
|
340
458
|
body: g,
|
|
341
|
-
title:
|
|
342
|
-
type:
|
|
343
|
-
status:
|
|
459
|
+
title: o,
|
|
460
|
+
type: l,
|
|
461
|
+
status: p
|
|
344
462
|
};
|
|
345
|
-
if (
|
|
463
|
+
if (N.trim() !== "")
|
|
346
464
|
try {
|
|
347
|
-
|
|
465
|
+
h.fields = JSON.parse(N);
|
|
348
466
|
} catch {
|
|
349
|
-
|
|
467
|
+
M("fields must be valid JSON");
|
|
350
468
|
return;
|
|
351
469
|
}
|
|
352
470
|
R(!0);
|
|
353
471
|
try {
|
|
354
|
-
const
|
|
355
|
-
c(
|
|
356
|
-
} catch (
|
|
357
|
-
const
|
|
358
|
-
|
|
472
|
+
const C = await s.documentUpdateChunk(e.id, e.revision, h, r, t);
|
|
473
|
+
c(C), a();
|
|
474
|
+
} catch (C) {
|
|
475
|
+
const E = C instanceof Error ? C.message : String(C);
|
|
476
|
+
M(E), j(/revision conflict/i.test(E)), R(!1);
|
|
359
477
|
}
|
|
360
478
|
}, children: [
|
|
361
479
|
/* @__PURE__ */ d("div", { className: "modal-header sticky-top", children: [
|
|
362
480
|
/* @__PURE__ */ n("h3", { children: "Edit chunk" }),
|
|
363
481
|
/* @__PURE__ */ d("div", { className: "modal-buttons modal-buttons-top", children: [
|
|
364
|
-
/* @__PURE__ */ n("button", { type: "button", onClick:
|
|
365
|
-
/* @__PURE__ */ n("button", { type: "submit", className: "primary", disabled:
|
|
482
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: a, disabled: U, children: "cancel" }),
|
|
483
|
+
/* @__PURE__ */ n("button", { type: "submit", className: "primary", disabled: U, children: U ? "saving…" : "save" })
|
|
366
484
|
] })
|
|
367
485
|
] }),
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
486
|
+
W && /* @__PURE__ */ d("div", { className: "modal-err", children: [
|
|
487
|
+
W,
|
|
488
|
+
z && " — reopen the chunk to load the latest, then reapply your edit."
|
|
371
489
|
] }),
|
|
372
490
|
/* @__PURE__ */ d("label", { className: "path-field", children: [
|
|
373
491
|
/* @__PURE__ */ n("span", { children: "Title" }),
|
|
374
|
-
/* @__PURE__ */ n("input", { className: "path-modal-input", value:
|
|
492
|
+
/* @__PURE__ */ n("input", { className: "path-modal-input", value: o, onChange: (u) => i(u.target.value) })
|
|
375
493
|
] }),
|
|
376
494
|
/* @__PURE__ */ d("div", { className: "chunk-editor-row", children: [
|
|
377
495
|
/* @__PURE__ */ d("label", { className: "path-field", children: [
|
|
@@ -380,9 +498,9 @@ function Ve({ chunk: e, scope: a, browse: t, onClose: r, onSaved: c }) {
|
|
|
380
498
|
"input",
|
|
381
499
|
{
|
|
382
500
|
className: "path-modal-input",
|
|
383
|
-
value:
|
|
501
|
+
value: l,
|
|
384
502
|
placeholder: "(none)",
|
|
385
|
-
onChange: (
|
|
503
|
+
onChange: (u) => m(u.target.value)
|
|
386
504
|
}
|
|
387
505
|
)
|
|
388
506
|
] }),
|
|
@@ -392,25 +510,44 @@ function Ve({ chunk: e, scope: a, browse: t, onClose: r, onSaved: c }) {
|
|
|
392
510
|
"input",
|
|
393
511
|
{
|
|
394
512
|
className: "path-modal-input",
|
|
395
|
-
value:
|
|
513
|
+
value: p,
|
|
396
514
|
placeholder: "(none)",
|
|
397
|
-
onChange: (
|
|
515
|
+
onChange: (u) => b(u.target.value)
|
|
398
516
|
}
|
|
399
517
|
)
|
|
400
518
|
] })
|
|
401
519
|
] }),
|
|
520
|
+
_ && /* @__PURE__ */ d("label", { className: "path-field", children: [
|
|
521
|
+
/* @__PURE__ */ n("span", { children: "Replace image" }),
|
|
522
|
+
/* @__PURE__ */ n(
|
|
523
|
+
"input",
|
|
524
|
+
{
|
|
525
|
+
type: "file",
|
|
526
|
+
accept: "image/png,image/jpeg,image/gif,image/webp",
|
|
527
|
+
disabled: U,
|
|
528
|
+
onChange: (u) => {
|
|
529
|
+
const h = u.target.files?.[0];
|
|
530
|
+
h && F(h);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
] }),
|
|
402
535
|
/* @__PURE__ */ d("label", { className: "path-field", children: [
|
|
403
|
-
/* @__PURE__ */ n("span", { children: "Body (Markdown)" }),
|
|
536
|
+
/* @__PURE__ */ n("span", { children: B ? "Mermaid source" : _ ? "Caption (optional)" : "Body (Markdown)" }),
|
|
404
537
|
/* @__PURE__ */ n(
|
|
405
538
|
"textarea",
|
|
406
539
|
{
|
|
407
540
|
className: "modal-textarea chunk-body-input",
|
|
408
|
-
rows: 12,
|
|
541
|
+
rows: B ? 8 : 12,
|
|
409
542
|
value: g,
|
|
410
|
-
onChange: (
|
|
543
|
+
onChange: (u) => O(u.target.value)
|
|
411
544
|
}
|
|
412
545
|
)
|
|
413
546
|
] }),
|
|
547
|
+
B && /* @__PURE__ */ d("div", { className: "path-field", children: [
|
|
548
|
+
/* @__PURE__ */ n("span", { children: "Preview" }),
|
|
549
|
+
/* @__PURE__ */ n("div", { className: "chunk-mermaid-preview", children: w.trim() ? /* @__PURE__ */ n(ie, { code: w }) : /* @__PURE__ */ n("p", { className: "doc-empty-body", children: "(enter Mermaid source above)" }) })
|
|
550
|
+
] }),
|
|
414
551
|
/* @__PURE__ */ d("label", { className: "path-field", children: [
|
|
415
552
|
/* @__PURE__ */ n("span", { children: "Fields (JSON, optional)" }),
|
|
416
553
|
/* @__PURE__ */ n(
|
|
@@ -418,118 +555,118 @@ function Ve({ chunk: e, scope: a, browse: t, onClose: r, onSaved: c }) {
|
|
|
418
555
|
{
|
|
419
556
|
className: "modal-textarea chunk-fields-input",
|
|
420
557
|
rows: 4,
|
|
421
|
-
value:
|
|
558
|
+
value: N,
|
|
422
559
|
placeholder: "{}",
|
|
423
|
-
onChange: (
|
|
560
|
+
onChange: (u) => D(u.target.value)
|
|
424
561
|
}
|
|
425
562
|
)
|
|
426
563
|
] })
|
|
427
564
|
] }) });
|
|
428
565
|
}
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
if (!
|
|
432
|
-
let t =
|
|
566
|
+
function ut(e) {
|
|
567
|
+
const r = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec((e ?? "").trim());
|
|
568
|
+
if (!r) return "#888888";
|
|
569
|
+
let t = r[1];
|
|
433
570
|
return t.length === 3 && (t = t[0] + t[0] + t[1] + t[1] + t[2] + t[2]), "#" + t.toLowerCase();
|
|
434
571
|
}
|
|
435
|
-
function
|
|
572
|
+
function ht({
|
|
436
573
|
documentId: e,
|
|
437
|
-
rootChunkId:
|
|
574
|
+
rootChunkId: r,
|
|
438
575
|
docType: t,
|
|
439
|
-
docStatus:
|
|
576
|
+
docStatus: a,
|
|
440
577
|
chunkStatuses: c,
|
|
441
|
-
scope:
|
|
442
|
-
browse:
|
|
443
|
-
onClose:
|
|
444
|
-
onSaved:
|
|
578
|
+
scope: s,
|
|
579
|
+
browse: o,
|
|
580
|
+
onClose: i,
|
|
581
|
+
onSaved: l
|
|
445
582
|
}) {
|
|
446
|
-
const
|
|
447
|
-
const
|
|
448
|
-
t &&
|
|
449
|
-
for (const
|
|
450
|
-
return [...
|
|
451
|
-
}, [t,
|
|
583
|
+
const m = se(), [p, b] = y(null), [g, O] = y(!1), [N, D] = y({}), [U, R] = y(!1), [W, M] = y(null), [z, j] = y(null), B = H(() => {
|
|
584
|
+
const u = new Set(Object.keys(me));
|
|
585
|
+
t && u.add(`doc.${t}.${a || "draft"}`);
|
|
586
|
+
for (const h of c) h && u.add(`chunk.${h}`);
|
|
587
|
+
return [...u].sort();
|
|
588
|
+
}, [t, a, c]);
|
|
452
589
|
I(() => {
|
|
453
|
-
let
|
|
454
|
-
return
|
|
455
|
-
if (
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
}).catch((
|
|
462
|
-
|
|
590
|
+
let u = !1;
|
|
591
|
+
return m.documentGetChunk(r, s, o).then((h) => {
|
|
592
|
+
if (u) return;
|
|
593
|
+
b(h);
|
|
594
|
+
const C = h.fields ?? {};
|
|
595
|
+
O(C.color_enabled === !0);
|
|
596
|
+
const E = C.color_scheme ?? {};
|
|
597
|
+
D({ ...me, ...E });
|
|
598
|
+
}).catch((h) => !u && j(h instanceof Error ? h.message : String(h))), () => {
|
|
599
|
+
u = !0;
|
|
463
600
|
};
|
|
464
|
-
}, [
|
|
465
|
-
const
|
|
466
|
-
...
|
|
601
|
+
}, [m, r, s, o]);
|
|
602
|
+
const _ = (u, h) => D((C) => ({ ...C, [u]: h })), w = (u) => ({
|
|
603
|
+
...u ?? {},
|
|
467
604
|
color_enabled: g,
|
|
468
|
-
color_scheme:
|
|
469
|
-
}),
|
|
470
|
-
if (
|
|
471
|
-
R(!0),
|
|
605
|
+
color_scheme: N
|
|
606
|
+
}), L = async () => {
|
|
607
|
+
if (p) {
|
|
608
|
+
R(!0), j(null), M(null);
|
|
472
609
|
try {
|
|
473
|
-
await
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
{ fields:
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
),
|
|
480
|
-
} catch (
|
|
481
|
-
|
|
610
|
+
await m.documentUpdateChunk(
|
|
611
|
+
r,
|
|
612
|
+
p.revision,
|
|
613
|
+
{ fields: w(p.fields) },
|
|
614
|
+
s,
|
|
615
|
+
o
|
|
616
|
+
), l(), i();
|
|
617
|
+
} catch (u) {
|
|
618
|
+
j(u instanceof Error ? u.message : String(u)), R(!1);
|
|
482
619
|
}
|
|
483
620
|
}
|
|
484
621
|
}, F = async () => {
|
|
485
622
|
if (!t) {
|
|
486
|
-
|
|
623
|
+
j("this document has no type to match");
|
|
487
624
|
return;
|
|
488
625
|
}
|
|
489
|
-
R(!0),
|
|
626
|
+
R(!0), j(null), M(null);
|
|
490
627
|
try {
|
|
491
|
-
const { documents:
|
|
492
|
-
(
|
|
628
|
+
const { documents: u } = await m.documentsSummary({ underPath: "/" }, s, o), h = (u ?? []).filter(
|
|
629
|
+
(E) => E.type === t && E.document_id !== e && E.root_chunk_id
|
|
493
630
|
);
|
|
494
|
-
let
|
|
495
|
-
for (const
|
|
631
|
+
let C = 0;
|
|
632
|
+
for (const E of h)
|
|
496
633
|
try {
|
|
497
|
-
const
|
|
498
|
-
await
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
{ fields:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
),
|
|
634
|
+
const A = await m.documentGetChunk(E.root_chunk_id, s, o);
|
|
635
|
+
await m.documentUpdateChunk(
|
|
636
|
+
E.root_chunk_id,
|
|
637
|
+
A.revision,
|
|
638
|
+
{ fields: w(A.fields) },
|
|
639
|
+
s,
|
|
640
|
+
o
|
|
641
|
+
), C++;
|
|
505
642
|
} catch {
|
|
506
643
|
}
|
|
507
|
-
|
|
508
|
-
} catch (
|
|
509
|
-
|
|
644
|
+
M(`Applied to ${C} other ${t} document(s).`), l();
|
|
645
|
+
} catch (u) {
|
|
646
|
+
j(u instanceof Error ? u.message : String(u));
|
|
510
647
|
} finally {
|
|
511
648
|
R(!1);
|
|
512
649
|
}
|
|
513
|
-
},
|
|
514
|
-
return /* @__PURE__ */ n("div", { className: "modal-overlay", onClick:
|
|
650
|
+
}, Q = B.filter((u) => u.startsWith("doc.")), X = B.filter((u) => u.startsWith("chunk."));
|
|
651
|
+
return /* @__PURE__ */ n("div", { className: "modal-overlay", onClick: i, children: /* @__PURE__ */ d("div", { className: "modal scheme-editor", onClick: (u) => u.stopPropagation(), children: [
|
|
515
652
|
/* @__PURE__ */ d("div", { className: "scheme-editor-head", children: [
|
|
516
653
|
/* @__PURE__ */ n("h3", { children: "Document colors" }),
|
|
517
654
|
/* @__PURE__ */ d("div", { className: "scheme-editor-actions", children: [
|
|
518
|
-
/* @__PURE__ */ n("button", { type: "button", onClick:
|
|
655
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: i, disabled: U, children: "cancel" }),
|
|
519
656
|
/* @__PURE__ */ n("button", { type: "button", className: "primary", onClick: () => {
|
|
520
|
-
|
|
521
|
-
}, disabled:
|
|
657
|
+
L();
|
|
658
|
+
}, disabled: U || !p, children: U ? "saving…" : "save" })
|
|
522
659
|
] })
|
|
523
660
|
] }),
|
|
524
|
-
|
|
525
|
-
|
|
661
|
+
z && /* @__PURE__ */ n("div", { className: "modal-err", children: z }),
|
|
662
|
+
p ? /* @__PURE__ */ d(q, { children: [
|
|
526
663
|
/* @__PURE__ */ d("label", { className: "scheme-toggle", children: [
|
|
527
664
|
/* @__PURE__ */ n(
|
|
528
665
|
"input",
|
|
529
666
|
{
|
|
530
667
|
type: "checkbox",
|
|
531
668
|
checked: g,
|
|
532
|
-
onChange: (
|
|
669
|
+
onChange: (u) => O(u.target.checked)
|
|
533
670
|
}
|
|
534
671
|
),
|
|
535
672
|
/* @__PURE__ */ n("span", { children: "Enable coloring for this document" })
|
|
@@ -537,277 +674,372 @@ function qe({
|
|
|
537
674
|
/* @__PURE__ */ n("p", { className: "modal-context", children: "Document rows are tinted by type + status; chunk tiles by status. Colors apply as a semi-transparent wash so text stays readable." }),
|
|
538
675
|
/* @__PURE__ */ d("div", { className: "scheme-group", children: [
|
|
539
676
|
/* @__PURE__ */ n("h4", { children: "Document (type · status)" }),
|
|
540
|
-
|
|
677
|
+
Q.map((u) => /* @__PURE__ */ n(ve, { label: u.slice(4), value: N[u], onChange: (h) => _(u, h) }, u))
|
|
541
678
|
] }),
|
|
542
679
|
/* @__PURE__ */ d("div", { className: "scheme-group", children: [
|
|
543
680
|
/* @__PURE__ */ n("h4", { children: "Chunks (status)" }),
|
|
544
|
-
|
|
681
|
+
X.map((u) => /* @__PURE__ */ n(ve, { label: u.slice(6), value: N[u], onChange: (h) => _(u, h) }, u))
|
|
545
682
|
] }),
|
|
546
683
|
/* @__PURE__ */ d("div", { className: "scheme-editor-foot", children: [
|
|
547
684
|
/* @__PURE__ */ d("button", { type: "button", onClick: () => {
|
|
548
685
|
F();
|
|
549
|
-
}, disabled:
|
|
686
|
+
}, disabled: U || !t, title: t ? `Apply this palette to every other ${t} document` : "This document has no type", children: [
|
|
550
687
|
"copy to all ",
|
|
551
688
|
t || "same-type",
|
|
552
689
|
" documents"
|
|
553
690
|
] }),
|
|
554
|
-
|
|
691
|
+
W && /* @__PURE__ */ n("span", { className: "scheme-status", children: W })
|
|
555
692
|
] })
|
|
556
693
|
] }) : /* @__PURE__ */ n("p", { className: "modal-context", children: "Loading…" })
|
|
557
694
|
] }) });
|
|
558
695
|
}
|
|
559
|
-
function
|
|
560
|
-
const
|
|
696
|
+
function ve({ label: e, value: r, onChange: t }) {
|
|
697
|
+
const a = ut(r);
|
|
561
698
|
return /* @__PURE__ */ d("label", { className: "scheme-row", children: [
|
|
562
|
-
/* @__PURE__ */ n("input", { type: "color", value:
|
|
699
|
+
/* @__PURE__ */ n("input", { type: "color", value: a, onChange: (c) => t(c.target.value) }),
|
|
563
700
|
/* @__PURE__ */ n("span", { className: "scheme-key", children: e }),
|
|
564
|
-
/* @__PURE__ */ n("code", { className: "scheme-hex", children:
|
|
701
|
+
/* @__PURE__ */ n("code", { className: "scheme-hex", children: a })
|
|
565
702
|
] });
|
|
566
703
|
}
|
|
567
|
-
|
|
568
|
-
function
|
|
569
|
-
const a = ee(null), [t, r] = b({});
|
|
570
|
-
return I(() => {
|
|
571
|
-
let c = !1;
|
|
572
|
-
return (async () => {
|
|
573
|
-
try {
|
|
574
|
-
const l = (await import("mermaid")).default, s = a.current?.closest("[data-theme]")?.getAttribute("data-theme"), o = s ? s === "dark" : !0;
|
|
575
|
-
l.initialize({ startOnLoad: !1, theme: o ? "dark" : "default", securityLevel: "strict" });
|
|
576
|
-
const { svg: i } = await l.render(`lc-mmd-${Qe++}`, e);
|
|
577
|
-
c || r({ svg: i });
|
|
578
|
-
} catch {
|
|
579
|
-
c || r({ err: !0 });
|
|
580
|
-
}
|
|
581
|
-
})(), () => {
|
|
582
|
-
c = !0;
|
|
583
|
-
};
|
|
584
|
-
}, [e]), t.err ? /* @__PURE__ */ n("pre", { className: "md-pre md-mermaid-error", title: "diagram failed to render", children: /* @__PURE__ */ n("code", { children: e }) }) : t.svg ? /* @__PURE__ */ n("div", { ref: a, className: "md-mermaid", dangerouslySetInnerHTML: { __html: t.svg } }) : /* @__PURE__ */ n("div", { ref: a, className: "md-mermaid md-mermaid-loading", children: "rendering diagram…" });
|
|
585
|
-
}
|
|
586
|
-
const oe = 24;
|
|
587
|
-
function Xe({
|
|
704
|
+
const he = 24;
|
|
705
|
+
function mt({
|
|
588
706
|
edges: e,
|
|
589
|
-
documentId:
|
|
707
|
+
documentId: r,
|
|
590
708
|
selectedId: t,
|
|
591
|
-
onSelectChunk:
|
|
709
|
+
onSelectChunk: a
|
|
592
710
|
}) {
|
|
593
|
-
const [c,
|
|
711
|
+
const [c, s] = y(!1), [o, i] = y(!1);
|
|
594
712
|
if (e.length === 0) return null;
|
|
595
|
-
const
|
|
713
|
+
const l = t ? e.filter((b) => b.from_id === t || b.to_id === t) : [], m = o ? e : e.slice(0, he), p = ft(m);
|
|
596
714
|
return /* @__PURE__ */ d("div", { className: "doc-refs", children: [
|
|
597
715
|
t && /* @__PURE__ */ d("div", { className: "doc-refs-list-wrap", children: [
|
|
598
716
|
/* @__PURE__ */ n("h4", { children: "References" }),
|
|
599
|
-
|
|
600
|
-
|
|
717
|
+
l.length === 0 ? /* @__PURE__ */ n("p", { className: "doc-refs-empty", children: "This chunk has no links." }) : /* @__PURE__ */ n("ul", { className: "doc-refs-list", children: l.map((b, g) => /* @__PURE__ */ n(
|
|
718
|
+
pt,
|
|
601
719
|
{
|
|
602
|
-
edge:
|
|
720
|
+
edge: b,
|
|
603
721
|
selectedId: t,
|
|
604
|
-
documentId:
|
|
605
|
-
onSelectChunk:
|
|
722
|
+
documentId: r,
|
|
723
|
+
onSelectChunk: a
|
|
606
724
|
},
|
|
607
|
-
`${
|
|
725
|
+
`${b.from_id}-${b.to_id}-${b.kind}-${g}`
|
|
608
726
|
)) })
|
|
609
727
|
] }),
|
|
610
728
|
/* @__PURE__ */ d("div", { className: "doc-graph", children: [
|
|
611
|
-
/* @__PURE__ */ d("button", { type: "button", className: "doc-graph-toggle", onClick: () =>
|
|
729
|
+
/* @__PURE__ */ d("button", { type: "button", className: "doc-graph-toggle", onClick: () => s((b) => !b), children: [
|
|
612
730
|
c ? "▼" : "▶",
|
|
613
731
|
" relationship graph (",
|
|
614
732
|
e.length,
|
|
615
733
|
")"
|
|
616
734
|
] }),
|
|
617
735
|
c && /* @__PURE__ */ d(q, { children: [
|
|
618
|
-
/* @__PURE__ */ n(
|
|
619
|
-
e.length >
|
|
736
|
+
/* @__PURE__ */ n(ie, { code: p }),
|
|
737
|
+
e.length > he && /* @__PURE__ */ n("button", { type: "button", className: "doc-graph-more", onClick: () => i((b) => !b), children: o ? `show top ${he}` : `show all ${e.length}` })
|
|
620
738
|
] })
|
|
621
739
|
] })
|
|
622
740
|
] });
|
|
623
741
|
}
|
|
624
|
-
function
|
|
742
|
+
function pt({
|
|
625
743
|
edge: e,
|
|
626
|
-
selectedId:
|
|
744
|
+
selectedId: r,
|
|
627
745
|
documentId: t,
|
|
628
|
-
onSelectChunk:
|
|
746
|
+
onSelectChunk: a
|
|
629
747
|
}) {
|
|
630
|
-
const c = e.from_id ===
|
|
748
|
+
const c = e.from_id === r, s = c ? e.to_id : e.from_id, o = (c ? e.to_title : e.from_title) || s.slice(0, 8), i = c ? e.to_document_id : e.from_document_id, l = !i || i === t;
|
|
631
749
|
return /* @__PURE__ */ d("li", { className: "doc-ref", children: [
|
|
632
750
|
/* @__PURE__ */ n("span", { className: "doc-ref-kind", children: e.kind }),
|
|
633
751
|
/* @__PURE__ */ n("span", { className: "doc-ref-arrow", "aria-hidden": !0, children: c ? "→" : "←" }),
|
|
634
|
-
|
|
635
|
-
|
|
752
|
+
l ? /* @__PURE__ */ n("button", { type: "button", className: "doc-ref-target", onClick: () => a(s), children: o }) : /* @__PURE__ */ d("span", { className: "doc-ref-target external", title: "In another document", children: [
|
|
753
|
+
o,
|
|
636
754
|
" ↗"
|
|
637
755
|
] })
|
|
638
756
|
] });
|
|
639
757
|
}
|
|
640
|
-
function
|
|
641
|
-
const
|
|
758
|
+
function ft(e) {
|
|
759
|
+
const r = ["graph LR"];
|
|
642
760
|
for (const t of e) {
|
|
643
|
-
const
|
|
644
|
-
|
|
761
|
+
const a = `${Ne(t.from_id)}["${we(t.from_title, t.from_id)}"]`, c = `${Ne(t.to_id)}["${we(t.to_title, t.to_id)}"]`, s = (t.kind || "link").replace(/[|"]/g, " ");
|
|
762
|
+
r.push(` ${a} -->|${s}| ${c}`);
|
|
645
763
|
}
|
|
646
|
-
return
|
|
764
|
+
return r.join(`
|
|
647
765
|
`);
|
|
648
766
|
}
|
|
649
|
-
function
|
|
767
|
+
function Ne(e) {
|
|
650
768
|
return "n" + e.replace(/[^a-zA-Z0-9]/g, "");
|
|
651
769
|
}
|
|
652
|
-
function
|
|
653
|
-
const
|
|
654
|
-
return
|
|
770
|
+
function we(e, r) {
|
|
771
|
+
const a = (e ?? "").replace(/["[\]{}|<>]/g, " ").replace(/\s+/g, " ").trim() || r.slice(0, 6);
|
|
772
|
+
return a.length > 30 ? a.slice(0, 29) + "…" : a;
|
|
655
773
|
}
|
|
656
|
-
function
|
|
657
|
-
return /* @__PURE__ */ n("div", { className: "md", children: /* @__PURE__ */ n(
|
|
774
|
+
function Ce({ source: e }) {
|
|
775
|
+
return /* @__PURE__ */ n("div", { className: "md", children: /* @__PURE__ */ n(qe, { remarkPlugins: [Qe], components: gt, children: e }) });
|
|
658
776
|
}
|
|
659
|
-
const
|
|
777
|
+
const gt = {
|
|
660
778
|
// react-markdown already sanitized the href; add target/rel for external links.
|
|
661
|
-
a({ href: e, children:
|
|
662
|
-
const t = e ?? "",
|
|
663
|
-
return /* @__PURE__ */ n("a", { href: t, target:
|
|
779
|
+
a({ href: e, children: r }) {
|
|
780
|
+
const t = e ?? "", a = /^https?:\/\//i.test(t);
|
|
781
|
+
return /* @__PURE__ */ n("a", { href: t, target: a ? "_blank" : void 0, rel: a ? "noopener noreferrer" : void 0, children: r });
|
|
664
782
|
},
|
|
665
783
|
// Let the code renderer own the block wrapper so a mermaid fence isn't wrapped
|
|
666
784
|
// in a <pre> (and a normal code block gets exactly one <pre>).
|
|
667
785
|
pre({ children: e }) {
|
|
668
786
|
return /* @__PURE__ */ n(q, { children: e });
|
|
669
787
|
},
|
|
670
|
-
code({ className: e, children:
|
|
671
|
-
const t = /language-(\w+)/.exec(e ?? "")?.[1],
|
|
672
|
-
return t === "mermaid" ? /* @__PURE__ */ n(
|
|
673
|
-
`) ? /* @__PURE__ */ n("pre", { className: "md-pre", children: /* @__PURE__ */ n("code", { className: e, children:
|
|
788
|
+
code({ className: e, children: r }) {
|
|
789
|
+
const t = /language-(\w+)/.exec(e ?? "")?.[1], a = String(r ?? "");
|
|
790
|
+
return t === "mermaid" ? /* @__PURE__ */ n(ie, { code: a.replace(/\n$/, "") }) : t || a.includes(`
|
|
791
|
+
`) ? /* @__PURE__ */ n("pre", { className: "md-pre", children: /* @__PURE__ */ n("code", { className: e, children: r }) }) : /* @__PURE__ */ n("code", { children: r });
|
|
674
792
|
}
|
|
675
793
|
};
|
|
676
|
-
function
|
|
794
|
+
function yt(e) {
|
|
795
|
+
const r = e.fields ?? {};
|
|
796
|
+
return typeof r.alt == "string" && r.alt.trim() !== "" ? r.alt : e.title || "image";
|
|
797
|
+
}
|
|
798
|
+
function Pe({
|
|
677
799
|
documentId: e,
|
|
678
|
-
scope:
|
|
800
|
+
scope: r,
|
|
679
801
|
titleHint: t,
|
|
680
|
-
browse:
|
|
802
|
+
browse: a,
|
|
681
803
|
principal: c,
|
|
682
|
-
renderAssistant:
|
|
804
|
+
renderAssistant: s
|
|
683
805
|
}) {
|
|
684
|
-
const
|
|
685
|
-
() =>
|
|
686
|
-
[
|
|
687
|
-
), [
|
|
806
|
+
const o = se(), i = H(
|
|
807
|
+
() => a && (a.scopeId || a.tenant) ? { scopeId: a.scopeId, tenant: a.tenant } : void 0,
|
|
808
|
+
[a?.scopeId, a?.tenant]
|
|
809
|
+
), [l, m] = y([]), [p, b] = y(void 0), [g, O] = y(null), [N, D] = y("chunks"), [U, R] = y(null), [W, M] = y(null), [z, j] = y(null), B = K(null), [_, w] = y(null), [L, F] = y(null), [Q, X] = y(!1), [u, h] = y(0), [C, E] = y(!1), [A, ee] = y(null), [te, ne] = y(!1), [Y, ae] = y([]), v = G(() => h((f) => f + 1), []), $ = H(() => ot(l), [l]), P = H(() => l.find((k) => !k.parent_id)?.title || t || "document", [l, t]), V = H(
|
|
688
810
|
() => !!g && !g.parent_id,
|
|
689
811
|
[g]
|
|
690
|
-
),
|
|
691
|
-
() =>
|
|
692
|
-
[
|
|
693
|
-
),
|
|
694
|
-
() => [...new Set(
|
|
695
|
-
[
|
|
696
|
-
),
|
|
697
|
-
const
|
|
698
|
-
for (const
|
|
699
|
-
|
|
700
|
-
return
|
|
701
|
-
}, [
|
|
702
|
-
() =>
|
|
703
|
-
[
|
|
812
|
+
), J = H(
|
|
813
|
+
() => A?.root_chunk_id ?? l.find((f) => !f.parent_id)?.id,
|
|
814
|
+
[A, l]
|
|
815
|
+
), Oe = H(
|
|
816
|
+
() => [...new Set(l.map((f) => f.status).filter((f) => !!f))],
|
|
817
|
+
[l]
|
|
818
|
+
), re = !!A?.color_enabled, Ue = H(() => {
|
|
819
|
+
const f = /* @__PURE__ */ new Set();
|
|
820
|
+
for (const k of Y)
|
|
821
|
+
f.add(k.from_id), f.add(k.to_id);
|
|
822
|
+
return f;
|
|
823
|
+
}, [Y]), je = H(
|
|
824
|
+
() => re ? ge(De(A?.type, A?.status, fe(A?.color_scheme))) : void 0,
|
|
825
|
+
[re, A?.type, A?.status, A?.color_scheme]
|
|
704
826
|
);
|
|
705
827
|
I(() => {
|
|
706
|
-
let
|
|
707
|
-
return
|
|
708
|
-
if (
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
}).catch((
|
|
712
|
-
|
|
828
|
+
let f = !1;
|
|
829
|
+
return X(!0), F(null), o.documentQueryChunks(e, r, i).then((k) => {
|
|
830
|
+
if (f) return;
|
|
831
|
+
const S = k.chunks ?? [];
|
|
832
|
+
m(S), b((x) => x ?? S.find((T) => !T.parent_id)?.id);
|
|
833
|
+
}).catch((k) => !f && F(k instanceof Error ? k.message : String(k))).finally(() => !f && X(!1)), () => {
|
|
834
|
+
f = !0;
|
|
713
835
|
};
|
|
714
|
-
}, [
|
|
715
|
-
let
|
|
716
|
-
return
|
|
717
|
-
|
|
836
|
+
}, [o, e, r, u, i]), I(() => {
|
|
837
|
+
let f = !1;
|
|
838
|
+
return o.documentGet(e, r, i).then((k) => !f && ee(k)).catch(() => !f && ee(null)), () => {
|
|
839
|
+
f = !0;
|
|
718
840
|
};
|
|
719
|
-
}, [
|
|
720
|
-
let
|
|
721
|
-
return
|
|
722
|
-
|
|
841
|
+
}, [o, e, r, u, i]), I(() => {
|
|
842
|
+
let f = !1;
|
|
843
|
+
return o.documentGetEdges(e, r, i).then((k) => !f && ae(k.edges ?? [])).catch(() => !f && ae([])), () => {
|
|
844
|
+
f = !0;
|
|
723
845
|
};
|
|
724
|
-
}, [
|
|
725
|
-
|
|
726
|
-
}, [e,
|
|
727
|
-
if (!
|
|
728
|
-
|
|
846
|
+
}, [o, e, r, u, i]), I(() => {
|
|
847
|
+
b(void 0), O(null), R(null), D("chunks"), ee(null), ae([]);
|
|
848
|
+
}, [e, r]), I(() => {
|
|
849
|
+
if (!p) {
|
|
850
|
+
O(null);
|
|
729
851
|
return;
|
|
730
852
|
}
|
|
731
|
-
let
|
|
732
|
-
return
|
|
733
|
-
|
|
853
|
+
let f = !1;
|
|
854
|
+
return o.documentGetChunk(p, r, i).then((k) => !f && O(k)).catch((k) => !f && F(k instanceof Error ? k.message : String(k))), () => {
|
|
855
|
+
f = !0;
|
|
734
856
|
};
|
|
735
|
-
}, [
|
|
736
|
-
|
|
857
|
+
}, [o, p, r, u, i]), I(() => {
|
|
858
|
+
const f = g?.type === "image" || !!g?.asset;
|
|
859
|
+
if (!g || !f || !o.documentAssetObjectUrl) {
|
|
860
|
+
M(null), j(null);
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
let k = !1, S = null;
|
|
864
|
+
return j(null), o.documentAssetObjectUrl(g.id, r, i).then((x) => {
|
|
865
|
+
if (k) {
|
|
866
|
+
URL.revokeObjectURL(x);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
S = x, M(x);
|
|
870
|
+
}).catch((x) => !k && j(x instanceof Error ? x.message : String(x))), () => {
|
|
871
|
+
k = !0, S && URL.revokeObjectURL(S);
|
|
872
|
+
};
|
|
873
|
+
}, [o, g, r, i]), I(() => {
|
|
874
|
+
if (N !== "markdown" || !p) {
|
|
737
875
|
R(null);
|
|
738
876
|
return;
|
|
739
877
|
}
|
|
740
|
-
const
|
|
741
|
-
if (!
|
|
742
|
-
let
|
|
743
|
-
const
|
|
744
|
-
|
|
878
|
+
const f = Re($, p);
|
|
879
|
+
if (!f) return;
|
|
880
|
+
let k = !1;
|
|
881
|
+
const S = [], x = (T, ce) => {
|
|
882
|
+
S.push({ node: T, depth: ce }), T.children.forEach((oe) => x(oe, ce + 1));
|
|
745
883
|
};
|
|
746
|
-
return
|
|
747
|
-
if (
|
|
748
|
-
const
|
|
749
|
-
const
|
|
750
|
-
|
|
884
|
+
return x(f, 0), Promise.all(S.map((T) => o.documentGetChunk(T.node.row.id, r, i))).then((T) => {
|
|
885
|
+
if (k) return;
|
|
886
|
+
const ce = S.map((oe, He) => {
|
|
887
|
+
const We = Math.min(oe.depth + 1, 6), Z = T[He], ue = "#".repeat(We) + " " + oe.node.row.title;
|
|
888
|
+
if (Z.type === "mermaid" && Z.body)
|
|
889
|
+
return ue + "\n\n```mermaid\n" + Z.body + "\n```\n";
|
|
890
|
+
if (Z.type === "image" || Z.asset) {
|
|
891
|
+
const ze = Z.body ? " — " + Z.body : "";
|
|
892
|
+
return ue + `
|
|
893
|
+
|
|
894
|
+
_🖼 image chunk_` + ze + `
|
|
895
|
+
`;
|
|
896
|
+
}
|
|
897
|
+
return ue + (Z.body ? `
|
|
751
898
|
|
|
752
|
-
` +
|
|
899
|
+
` + Z.body : "") + `
|
|
753
900
|
`;
|
|
754
901
|
}).join(`
|
|
755
902
|
`);
|
|
756
|
-
R(
|
|
757
|
-
}).catch((
|
|
758
|
-
|
|
903
|
+
R(ce);
|
|
904
|
+
}).catch((T) => !k && F(T instanceof Error ? T.message : String(T))), () => {
|
|
905
|
+
k = !0;
|
|
759
906
|
};
|
|
760
|
-
}, [
|
|
761
|
-
const
|
|
907
|
+
}, [o, N, p, $, r, u, i]);
|
|
908
|
+
const Fe = G((f) => b(f.row.id), []), Ge = G(async () => {
|
|
762
909
|
try {
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
} catch (
|
|
766
|
-
|
|
910
|
+
const f = await o.documentExportMd(e, r, !0, i), k = new Blob([f.markdown], { type: "text/markdown" }), S = URL.createObjectURL(k), x = document.createElement("a");
|
|
911
|
+
x.href = S, x.download = (f.title || "document").replace(/[^\w.-]+/g, "_") + ".md", x.click(), URL.revokeObjectURL(S);
|
|
912
|
+
} catch (f) {
|
|
913
|
+
F(f instanceof Error ? f.message : String(f));
|
|
767
914
|
}
|
|
768
|
-
}, [
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
915
|
+
}, [o, e, r, i]), le = !!o.documentCreateChunk && !!J, de = G(
|
|
916
|
+
async (f) => {
|
|
917
|
+
if (!o.documentCreateChunk || !o.documentSetAsset) return;
|
|
918
|
+
const k = p || J;
|
|
919
|
+
if (k) {
|
|
920
|
+
F(null);
|
|
921
|
+
try {
|
|
922
|
+
const { mediaType: S, data: x } = await Le(f), T = await o.documentCreateChunk(
|
|
923
|
+
e,
|
|
924
|
+
k,
|
|
925
|
+
{ title: f.name || "image", type: "image" },
|
|
926
|
+
r,
|
|
927
|
+
i
|
|
928
|
+
);
|
|
929
|
+
await o.documentSetAsset(T.id, S, x, f.name, r, i), v(), b(T.id);
|
|
930
|
+
} catch (S) {
|
|
931
|
+
F(S instanceof Error ? S.message : String(S));
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
[o, e, r, i, p, J, v]
|
|
936
|
+
), Be = G(async () => {
|
|
937
|
+
if (!o.documentCreateChunk) return;
|
|
938
|
+
const f = p || J;
|
|
939
|
+
if (f) {
|
|
940
|
+
F(null);
|
|
941
|
+
try {
|
|
942
|
+
const k = await o.documentCreateChunk(
|
|
943
|
+
e,
|
|
944
|
+
f,
|
|
945
|
+
{ title: "Diagram", type: "mermaid", body: `graph TD
|
|
946
|
+
A[Start] --> B[End]` },
|
|
947
|
+
r,
|
|
948
|
+
i
|
|
949
|
+
);
|
|
950
|
+
v(), b(k.id), w(k);
|
|
951
|
+
} catch (k) {
|
|
952
|
+
F(k instanceof Error ? k.message : String(k));
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}, [o, e, r, i, p, J, v]);
|
|
956
|
+
return I(() => {
|
|
957
|
+
if (!le) return;
|
|
958
|
+
const f = (k) => {
|
|
959
|
+
if (_ || te) return;
|
|
960
|
+
const S = document.activeElement, x = S?.tagName;
|
|
961
|
+
if (x === "INPUT" || x === "TEXTAREA" || S?.isContentEditable) return;
|
|
962
|
+
const T = nt(k.clipboardData?.items);
|
|
963
|
+
T && (k.preventDefault(), de(T));
|
|
964
|
+
};
|
|
965
|
+
return window.addEventListener("paste", f), () => window.removeEventListener("paste", f);
|
|
966
|
+
}, [le, _, te, de]), /* @__PURE__ */ d("div", { className: "doc-viewer", children: [
|
|
967
|
+
/* @__PURE__ */ n(
|
|
968
|
+
"input",
|
|
969
|
+
{
|
|
970
|
+
ref: B,
|
|
971
|
+
type: "file",
|
|
972
|
+
accept: "image/png,image/jpeg,image/gif,image/webp",
|
|
973
|
+
style: { display: "none" },
|
|
974
|
+
onChange: (f) => {
|
|
975
|
+
const k = f.target.files?.[0];
|
|
976
|
+
f.target.value = "", k && de(k);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
),
|
|
980
|
+
/* @__PURE__ */ d("div", { className: "doc-toolbar", style: je, children: [
|
|
981
|
+
/* @__PURE__ */ n("strong", { className: "doc-title", title: P, children: P }),
|
|
772
982
|
/* @__PURE__ */ d("div", { className: "doc-toolbar-actions", children: [
|
|
983
|
+
le && /* @__PURE__ */ d(q, { children: [
|
|
984
|
+
/* @__PURE__ */ n(
|
|
985
|
+
"button",
|
|
986
|
+
{
|
|
987
|
+
type: "button",
|
|
988
|
+
onClick: () => B.current?.click(),
|
|
989
|
+
title: "Add an image chunk (upload — or paste a screenshot into the view)",
|
|
990
|
+
children: "+ image"
|
|
991
|
+
}
|
|
992
|
+
),
|
|
993
|
+
/* @__PURE__ */ n(
|
|
994
|
+
"button",
|
|
995
|
+
{
|
|
996
|
+
type: "button",
|
|
997
|
+
onClick: () => {
|
|
998
|
+
Be();
|
|
999
|
+
},
|
|
1000
|
+
title: "Add a Mermaid diagram chunk",
|
|
1001
|
+
children: "+ diagram"
|
|
1002
|
+
}
|
|
1003
|
+
)
|
|
1004
|
+
] }),
|
|
773
1005
|
/* @__PURE__ */ n(
|
|
774
1006
|
"button",
|
|
775
1007
|
{
|
|
776
1008
|
type: "button",
|
|
777
|
-
className:
|
|
778
|
-
onClick: () =>
|
|
779
|
-
disabled: !
|
|
1009
|
+
className: re ? "active" : "",
|
|
1010
|
+
onClick: () => ne(!0),
|
|
1011
|
+
disabled: !J,
|
|
780
1012
|
title: "Colors — tint chunk tiles + the Path tree by type/status",
|
|
781
1013
|
children: "colors"
|
|
782
1014
|
}
|
|
783
1015
|
),
|
|
784
1016
|
/* @__PURE__ */ n("button", { type: "button", onClick: () => {
|
|
785
|
-
|
|
1017
|
+
Ge();
|
|
786
1018
|
}, title: "Download the whole document as Markdown (.md)", children: "↓ .md" }),
|
|
787
|
-
|
|
1019
|
+
s && /* @__PURE__ */ n(
|
|
788
1020
|
"button",
|
|
789
1021
|
{
|
|
790
1022
|
type: "button",
|
|
791
|
-
className:
|
|
792
|
-
onClick: () =>
|
|
1023
|
+
className: C ? "active" : "",
|
|
1024
|
+
onClick: () => E((f) => !f),
|
|
793
1025
|
title: "Document Assistant — instruct an agent to restructure/import/link chunks",
|
|
794
1026
|
children: "assistant"
|
|
795
1027
|
}
|
|
796
1028
|
),
|
|
797
|
-
/* @__PURE__ */ n("button", { type: "button", onClick:
|
|
1029
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: v, title: "Reload", children: "↻" })
|
|
798
1030
|
] })
|
|
799
1031
|
] }),
|
|
800
|
-
|
|
1032
|
+
L && /* @__PURE__ */ n("div", { className: "paths-err", children: L }),
|
|
801
1033
|
/* @__PURE__ */ d("div", { className: "doc-split", children: [
|
|
802
|
-
/* @__PURE__ */ n("div", { className: "doc-chunktree", children:
|
|
803
|
-
|
|
1034
|
+
/* @__PURE__ */ n("div", { className: "doc-chunktree", children: Q && l.length === 0 ? /* @__PURE__ */ n("div", { className: "empty", children: /* @__PURE__ */ n("p", { children: "Loading…" }) }) : /* @__PURE__ */ n(
|
|
1035
|
+
st,
|
|
804
1036
|
{
|
|
805
|
-
tree:
|
|
806
|
-
selectedId:
|
|
807
|
-
onSelect:
|
|
808
|
-
colorEnabled:
|
|
809
|
-
scheme:
|
|
810
|
-
linkedIds:
|
|
1037
|
+
tree: $,
|
|
1038
|
+
selectedId: p,
|
|
1039
|
+
onSelect: Fe,
|
|
1040
|
+
colorEnabled: re,
|
|
1041
|
+
scheme: A?.color_scheme,
|
|
1042
|
+
linkedIds: Ue
|
|
811
1043
|
}
|
|
812
1044
|
) }),
|
|
813
1045
|
/* @__PURE__ */ n("div", { className: "doc-content", children: g ? /* @__PURE__ */ d(q, { children: [
|
|
@@ -827,8 +1059,8 @@ function Ee({
|
|
|
827
1059
|
"button",
|
|
828
1060
|
{
|
|
829
1061
|
type: "button",
|
|
830
|
-
className:
|
|
831
|
-
onClick: () =>
|
|
1062
|
+
className: N === "chunks" ? "active" : "",
|
|
1063
|
+
onClick: () => D("chunks"),
|
|
832
1064
|
title: "This chunk's own content",
|
|
833
1065
|
children: "chunk"
|
|
834
1066
|
}
|
|
@@ -837,162 +1069,177 @@ function Ee({
|
|
|
837
1069
|
"button",
|
|
838
1070
|
{
|
|
839
1071
|
type: "button",
|
|
840
|
-
className:
|
|
841
|
-
onClick: () =>
|
|
842
|
-
title:
|
|
1072
|
+
className: N === "markdown" ? "active" : "",
|
|
1073
|
+
onClick: () => D("markdown"),
|
|
1074
|
+
title: V ? "Whole document as Markdown" : "This chunk + its sub-chunks as Markdown",
|
|
843
1075
|
children: "markdown"
|
|
844
1076
|
}
|
|
845
1077
|
)
|
|
846
1078
|
] }),
|
|
847
|
-
/* @__PURE__ */ n("button", { type: "button", onClick: () =>
|
|
1079
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: () => w(g), children: "edit" })
|
|
848
1080
|
] })
|
|
849
1081
|
] }),
|
|
850
|
-
/* @__PURE__ */ n("div", { className: "doc-content-body", children:
|
|
1082
|
+
/* @__PURE__ */ n("div", { className: "doc-content-body", children: g.type === "mermaid" ? (
|
|
1083
|
+
// RFC BO — a diagram chunk: body IS the Mermaid source.
|
|
1084
|
+
g.body ? /* @__PURE__ */ d(q, { children: [
|
|
1085
|
+
/* @__PURE__ */ n(ie, { code: g.body }),
|
|
1086
|
+
N === "markdown" && /* @__PURE__ */ n("pre", { className: "md-pre doc-mermaid-source", children: /* @__PURE__ */ n("code", { children: g.body }) })
|
|
1087
|
+
] }) : /* @__PURE__ */ n("p", { className: "doc-empty-body", children: "(empty diagram)" })
|
|
1088
|
+
) : g.type === "image" || g.asset ? (
|
|
1089
|
+
// RFC BO — an image chunk: bytes come from the auth'd asset GET.
|
|
1090
|
+
z ? /* @__PURE__ */ d("p", { className: "doc-empty-body", children: [
|
|
1091
|
+
"Image failed to load: ",
|
|
1092
|
+
z
|
|
1093
|
+
] }) : W ? /* @__PURE__ */ d("figure", { className: "doc-image", children: [
|
|
1094
|
+
/* @__PURE__ */ n("img", { src: W, alt: yt(g) }),
|
|
1095
|
+
g.body && /* @__PURE__ */ n("figcaption", { children: g.body })
|
|
1096
|
+
] }) : /* @__PURE__ */ n("p", { className: "doc-empty-body", children: "Loading image…" })
|
|
1097
|
+
) : N === "markdown" ? U !== null ? /* @__PURE__ */ n(Ce, { source: U }) : /* @__PURE__ */ n("p", { className: "doc-empty-body", children: "Assembling Markdown…" }) : g.body ? /* @__PURE__ */ n(Ce, { source: g.body }) : /* @__PURE__ */ n("p", { className: "doc-empty-body", children: "(empty chunk)" }) }),
|
|
851
1098
|
/* @__PURE__ */ n(
|
|
852
|
-
|
|
1099
|
+
mt,
|
|
853
1100
|
{
|
|
854
|
-
edges:
|
|
1101
|
+
edges: Y,
|
|
855
1102
|
documentId: e,
|
|
856
|
-
selectedId:
|
|
857
|
-
onSelectChunk:
|
|
1103
|
+
selectedId: p,
|
|
1104
|
+
onSelectChunk: b
|
|
858
1105
|
}
|
|
859
1106
|
)
|
|
860
1107
|
] }) : /* @__PURE__ */ n("div", { className: "empty", children: /* @__PURE__ */ n("p", { children: "Select a chunk on the left." }) }) })
|
|
861
1108
|
] }),
|
|
862
|
-
|
|
1109
|
+
C && s && /* @__PURE__ */ n("div", { className: "doc-assistant", children: s({
|
|
863
1110
|
documentId: e,
|
|
864
|
-
scope:
|
|
1111
|
+
scope: r,
|
|
865
1112
|
subject: c?.subject,
|
|
866
1113
|
// Pass the viewer's own reload so the injected assistant can refresh
|
|
867
1114
|
// the tree + selected chunk after a turn mutates the document.
|
|
868
|
-
onChanged:
|
|
1115
|
+
onChanged: v
|
|
869
1116
|
}) }),
|
|
870
|
-
|
|
871
|
-
|
|
1117
|
+
_ && /* @__PURE__ */ n(
|
|
1118
|
+
dt,
|
|
872
1119
|
{
|
|
873
|
-
chunk:
|
|
874
|
-
scope:
|
|
875
|
-
browse:
|
|
876
|
-
onClose: () =>
|
|
877
|
-
onSaved:
|
|
1120
|
+
chunk: _,
|
|
1121
|
+
scope: r,
|
|
1122
|
+
browse: i,
|
|
1123
|
+
onClose: () => w(null),
|
|
1124
|
+
onSaved: v
|
|
878
1125
|
}
|
|
879
1126
|
),
|
|
880
|
-
|
|
881
|
-
|
|
1127
|
+
te && J && /* @__PURE__ */ n(
|
|
1128
|
+
ht,
|
|
882
1129
|
{
|
|
883
1130
|
documentId: e,
|
|
884
|
-
rootChunkId:
|
|
885
|
-
docType:
|
|
886
|
-
docStatus:
|
|
887
|
-
chunkStatuses:
|
|
888
|
-
scope:
|
|
889
|
-
browse:
|
|
890
|
-
onClose: () =>
|
|
891
|
-
onSaved:
|
|
1131
|
+
rootChunkId: J,
|
|
1132
|
+
docType: A?.type,
|
|
1133
|
+
docStatus: A?.status,
|
|
1134
|
+
chunkStatuses: Oe,
|
|
1135
|
+
scope: r,
|
|
1136
|
+
browse: i,
|
|
1137
|
+
onClose: () => ne(!1),
|
|
1138
|
+
onSaved: v
|
|
892
1139
|
}
|
|
893
1140
|
)
|
|
894
1141
|
] });
|
|
895
1142
|
}
|
|
896
|
-
function
|
|
897
|
-
const
|
|
1143
|
+
function bt(e) {
|
|
1144
|
+
const r = {
|
|
898
1145
|
name: "",
|
|
899
1146
|
fullPath: "",
|
|
900
1147
|
kind: "directory",
|
|
901
1148
|
explicit: !0,
|
|
902
1149
|
children: []
|
|
903
|
-
}, t = /* @__PURE__ */ new Map([["",
|
|
904
|
-
const
|
|
905
|
-
if (
|
|
906
|
-
const
|
|
907
|
-
name:
|
|
908
|
-
fullPath:
|
|
1150
|
+
}, t = /* @__PURE__ */ new Map([["", r]]), a = (s) => {
|
|
1151
|
+
const o = t.get(s);
|
|
1152
|
+
if (o) return o;
|
|
1153
|
+
const i = s.lastIndexOf("/"), l = i <= 0 ? "" : s.slice(0, i), m = s.slice(i + 1), p = a(l), b = {
|
|
1154
|
+
name: m,
|
|
1155
|
+
fullPath: s,
|
|
909
1156
|
kind: "directory",
|
|
910
1157
|
explicit: !1,
|
|
911
1158
|
children: []
|
|
912
1159
|
};
|
|
913
|
-
return
|
|
1160
|
+
return p.children.push(b), t.set(s, b), b;
|
|
914
1161
|
};
|
|
915
|
-
for (const
|
|
916
|
-
const
|
|
917
|
-
|
|
1162
|
+
for (const s of e) {
|
|
1163
|
+
const o = a(s.full_path);
|
|
1164
|
+
o.kind = s.kind, o.explicit = !0, o.resourceRef = s.resource_ref;
|
|
918
1165
|
}
|
|
919
|
-
const c = (
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
return
|
|
923
|
-
}),
|
|
1166
|
+
const c = (s) => {
|
|
1167
|
+
s.sort((o, i) => {
|
|
1168
|
+
const l = o.kind === "directory", m = i.kind === "directory";
|
|
1169
|
+
return l !== m ? l ? -1 : 1 : o.name.localeCompare(i.name);
|
|
1170
|
+
}), s.forEach((o) => c(o.children));
|
|
924
1171
|
};
|
|
925
|
-
return c(
|
|
1172
|
+
return c(r.children), r.children;
|
|
926
1173
|
}
|
|
927
|
-
function
|
|
928
|
-
const
|
|
929
|
-
return
|
|
1174
|
+
function pe(e) {
|
|
1175
|
+
const r = e.lastIndexOf("/");
|
|
1176
|
+
return r <= 0 ? "" : e.slice(0, r);
|
|
930
1177
|
}
|
|
931
|
-
function
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
const c =
|
|
935
|
-
c?.document_id &&
|
|
1178
|
+
function kt(e) {
|
|
1179
|
+
const r = [], t = (a) => {
|
|
1180
|
+
if (a.kind === "document") {
|
|
1181
|
+
const c = a.resourceRef;
|
|
1182
|
+
c?.document_id && r.push(c.document_id);
|
|
936
1183
|
}
|
|
937
|
-
|
|
1184
|
+
a.children.forEach(t);
|
|
938
1185
|
};
|
|
939
|
-
return t(e),
|
|
1186
|
+
return t(e), r;
|
|
940
1187
|
}
|
|
941
|
-
const
|
|
1188
|
+
const vt = {
|
|
942
1189
|
directory: "📁",
|
|
943
1190
|
document: "📄",
|
|
944
1191
|
volume_mount: "💾",
|
|
945
1192
|
memory_entry: "🧠"
|
|
946
1193
|
};
|
|
947
|
-
function
|
|
948
|
-
const [c,
|
|
949
|
-
|
|
950
|
-
const
|
|
951
|
-
return
|
|
1194
|
+
function Nt({ tree: e, selectedPath: r, onSelect: t, summaries: a }) {
|
|
1195
|
+
const [c, s] = y(() => /* @__PURE__ */ new Map()), o = G((i) => {
|
|
1196
|
+
s((l) => {
|
|
1197
|
+
const m = new Map(l);
|
|
1198
|
+
return m.set(i, l.get(i) === !1), m;
|
|
952
1199
|
});
|
|
953
1200
|
}, []);
|
|
954
1201
|
return I(() => {
|
|
955
|
-
|
|
956
|
-
let
|
|
957
|
-
const
|
|
958
|
-
let
|
|
959
|
-
for (;
|
|
960
|
-
|
|
961
|
-
return
|
|
1202
|
+
r && s((i) => {
|
|
1203
|
+
let l = !1;
|
|
1204
|
+
const m = new Map(i);
|
|
1205
|
+
let p = pe(r);
|
|
1206
|
+
for (; p !== ""; )
|
|
1207
|
+
m.get(p) === !1 && (m.set(p, !0), l = !0), p = pe(p);
|
|
1208
|
+
return l ? m : i;
|
|
962
1209
|
});
|
|
963
|
-
}, [
|
|
964
|
-
|
|
1210
|
+
}, [r]), e.length === 0 ? /* @__PURE__ */ n("div", { className: "empty", children: /* @__PURE__ */ n("p", { children: "This tree is empty. Create a folder or document to begin." }) }) : /* @__PURE__ */ n("ul", { className: "tree path-tree", children: e.map((i) => /* @__PURE__ */ n(
|
|
1211
|
+
Te,
|
|
965
1212
|
{
|
|
966
|
-
node:
|
|
1213
|
+
node: i,
|
|
967
1214
|
expanded: c,
|
|
968
|
-
toggle:
|
|
969
|
-
selectedPath:
|
|
1215
|
+
toggle: o,
|
|
1216
|
+
selectedPath: r,
|
|
970
1217
|
onSelect: t,
|
|
971
|
-
summaries:
|
|
1218
|
+
summaries: a
|
|
972
1219
|
},
|
|
973
|
-
|
|
1220
|
+
i.fullPath
|
|
974
1221
|
)) });
|
|
975
1222
|
}
|
|
976
|
-
function
|
|
977
|
-
if (e.kind !== "document" || !
|
|
1223
|
+
function wt(e, r) {
|
|
1224
|
+
if (e.kind !== "document" || !r) return;
|
|
978
1225
|
const t = e.resourceRef;
|
|
979
|
-
return t?.document_id ?
|
|
1226
|
+
return t?.document_id ? r.get(t.document_id) : void 0;
|
|
980
1227
|
}
|
|
981
|
-
function
|
|
982
|
-
const
|
|
983
|
-
return /* @__PURE__ */ d("li", { className: `node path-node kind-${e.kind} ${
|
|
984
|
-
/* @__PURE__ */ d("div", { className: "row path-row", style:
|
|
1228
|
+
function Te({ node: e, expanded: r, toggle: t, selectedPath: a, onSelect: c, summaries: s }) {
|
|
1229
|
+
const o = e.children.length > 0, i = r.get(e.fullPath) !== !1, l = a === e.fullPath, m = wt(e, s), p = m && m.color_enabled ? ge(De(m.type, m.status, fe(m.color_scheme))) : void 0;
|
|
1230
|
+
return /* @__PURE__ */ d("li", { className: `node path-node kind-${e.kind} ${l ? "selected" : ""}`, children: [
|
|
1231
|
+
/* @__PURE__ */ d("div", { className: "row path-row", style: p, children: [
|
|
985
1232
|
/* @__PURE__ */ n(
|
|
986
1233
|
"button",
|
|
987
1234
|
{
|
|
988
1235
|
type: "button",
|
|
989
1236
|
className: "tree-caret",
|
|
990
|
-
"aria-label":
|
|
991
|
-
disabled: !
|
|
992
|
-
onClick: (
|
|
993
|
-
|
|
1237
|
+
"aria-label": i ? "collapse" : "expand",
|
|
1238
|
+
disabled: !o,
|
|
1239
|
+
onClick: (b) => {
|
|
1240
|
+
b.stopPropagation(), o && t(e.fullPath);
|
|
994
1241
|
},
|
|
995
|
-
children:
|
|
1242
|
+
children: o ? i ? "▼" : "▶" : "·"
|
|
996
1243
|
}
|
|
997
1244
|
),
|
|
998
1245
|
/* @__PURE__ */ d(
|
|
@@ -1003,189 +1250,189 @@ function $e({ node: e, expanded: a, toggle: t, selectedPath: r, onSelect: c, sum
|
|
|
1003
1250
|
onClick: () => c(e),
|
|
1004
1251
|
title: e.fullPath,
|
|
1005
1252
|
children: [
|
|
1006
|
-
/* @__PURE__ */ n("span", { className: "path-kind-icon", "aria-hidden": !0, children:
|
|
1253
|
+
/* @__PURE__ */ n("span", { className: "path-kind-icon", "aria-hidden": !0, children: vt[e.kind] ?? "•" }),
|
|
1007
1254
|
/* @__PURE__ */ n("span", { className: "path-name", children: e.name }),
|
|
1008
|
-
|
|
1009
|
-
|
|
1255
|
+
m?.type && /* @__PURE__ */ n("span", { className: "chunk-badge", children: m.type }),
|
|
1256
|
+
m?.status && /* @__PURE__ */ n("span", { className: "chunk-badge chunk-status", children: m.status }),
|
|
1010
1257
|
!e.explicit && /* @__PURE__ */ n("span", { className: "path-implicit", title: "Implicit directory (no stored entry)", children: "implicit" })
|
|
1011
1258
|
]
|
|
1012
1259
|
}
|
|
1013
1260
|
)
|
|
1014
1261
|
] }),
|
|
1015
|
-
|
|
1016
|
-
|
|
1262
|
+
o && i && /* @__PURE__ */ n("ul", { className: "children path-children", children: e.children.map((b) => /* @__PURE__ */ n(
|
|
1263
|
+
Te,
|
|
1017
1264
|
{
|
|
1018
|
-
node:
|
|
1019
|
-
expanded:
|
|
1265
|
+
node: b,
|
|
1266
|
+
expanded: r,
|
|
1020
1267
|
toggle: t,
|
|
1021
|
-
selectedPath:
|
|
1268
|
+
selectedPath: a,
|
|
1022
1269
|
onSelect: c,
|
|
1023
|
-
summaries:
|
|
1270
|
+
summaries: s
|
|
1024
1271
|
},
|
|
1025
|
-
|
|
1272
|
+
b.fullPath
|
|
1026
1273
|
)) })
|
|
1027
1274
|
] });
|
|
1028
1275
|
}
|
|
1029
|
-
const
|
|
1030
|
-
function
|
|
1031
|
-
return `${e}/${
|
|
1276
|
+
const _e = /^[A-Za-z0-9._-]+$/;
|
|
1277
|
+
function Ee(e, r) {
|
|
1278
|
+
return `${e}/${r}`;
|
|
1032
1279
|
}
|
|
1033
|
-
function
|
|
1280
|
+
function Ie(e, r) {
|
|
1034
1281
|
for (const t of e) {
|
|
1035
|
-
if (t.fullPath ===
|
|
1036
|
-
const
|
|
1037
|
-
if (
|
|
1282
|
+
if (t.fullPath === r) return t;
|
|
1283
|
+
const a = Ie(t.children, r);
|
|
1284
|
+
if (a) return a;
|
|
1038
1285
|
}
|
|
1039
1286
|
}
|
|
1040
|
-
function
|
|
1041
|
-
const { theme:
|
|
1042
|
-
return /* @__PURE__ */ n(
|
|
1043
|
-
|
|
1287
|
+
function Lt(e) {
|
|
1288
|
+
const { theme: r, defaultScope: t, path: a, onPathChange: c, browse: s, principal: o, renderAssistant: i, onError: l } = e, m = xe(e);
|
|
1289
|
+
return /* @__PURE__ */ n($e, { theme: r, dataLayer: m, children: /* @__PURE__ */ n(
|
|
1290
|
+
Ct,
|
|
1044
1291
|
{
|
|
1045
1292
|
defaultScope: t,
|
|
1046
|
-
path:
|
|
1293
|
+
path: a,
|
|
1047
1294
|
onPathChange: c,
|
|
1048
|
-
browse:
|
|
1049
|
-
principal:
|
|
1050
|
-
renderAssistant:
|
|
1051
|
-
onError:
|
|
1295
|
+
browse: s,
|
|
1296
|
+
principal: o,
|
|
1297
|
+
renderAssistant: i,
|
|
1298
|
+
onError: l
|
|
1052
1299
|
}
|
|
1053
1300
|
) });
|
|
1054
1301
|
}
|
|
1055
|
-
function
|
|
1302
|
+
function Ct({
|
|
1056
1303
|
defaultScope: e,
|
|
1057
|
-
path:
|
|
1304
|
+
path: r,
|
|
1058
1305
|
onPathChange: t,
|
|
1059
|
-
browse:
|
|
1306
|
+
browse: a,
|
|
1060
1307
|
principal: c,
|
|
1061
|
-
renderAssistant:
|
|
1062
|
-
onError:
|
|
1308
|
+
renderAssistant: s,
|
|
1309
|
+
onError: o
|
|
1063
1310
|
}) {
|
|
1064
|
-
const
|
|
1311
|
+
const i = se(), [l, m] = y(e ?? "user"), [p, b] = y([]), [g, O] = y(void 0), [N, D] = y(null), [U, R] = y(!1), [W, M] = y(null), z = r !== void 0 ? r : g, j = K(t);
|
|
1065
1312
|
I(() => {
|
|
1066
|
-
|
|
1313
|
+
j.current = t;
|
|
1067
1314
|
}, [t]);
|
|
1068
|
-
const
|
|
1315
|
+
const B = K(o);
|
|
1069
1316
|
I(() => {
|
|
1070
|
-
|
|
1071
|
-
}, [
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1074
|
-
}, []),
|
|
1075
|
-
() =>
|
|
1076
|
-
[
|
|
1077
|
-
),
|
|
1078
|
-
R(!0),
|
|
1317
|
+
B.current = o;
|
|
1318
|
+
}, [o]);
|
|
1319
|
+
const _ = G((v) => {
|
|
1320
|
+
j.current?.(v), O(v);
|
|
1321
|
+
}, []), w = H(
|
|
1322
|
+
() => a && (a.scopeId || a.tenant) ? { scopeId: a.scopeId, tenant: a.tenant } : void 0,
|
|
1323
|
+
[a?.scopeId, a?.tenant]
|
|
1324
|
+
), L = G(async () => {
|
|
1325
|
+
R(!0), D(null);
|
|
1079
1326
|
try {
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
} catch (
|
|
1083
|
-
|
|
1327
|
+
const v = await i.pathLs("/", l, !0, w);
|
|
1328
|
+
b(v.entries ?? []);
|
|
1329
|
+
} catch (v) {
|
|
1330
|
+
D(v instanceof Error ? v.message : String(v)), b([]), B.current?.(v);
|
|
1084
1331
|
} finally {
|
|
1085
1332
|
R(!1);
|
|
1086
1333
|
}
|
|
1087
|
-
}, [
|
|
1334
|
+
}, [i, l, w]), F = K(!0);
|
|
1088
1335
|
I(() => {
|
|
1089
|
-
F.current ? F.current = !1 :
|
|
1090
|
-
}, [
|
|
1091
|
-
const
|
|
1336
|
+
F.current ? F.current = !1 : _(void 0), L();
|
|
1337
|
+
}, [L, _]);
|
|
1338
|
+
const Q = H(() => bt(p), [p]), [X, u] = y(() => /* @__PURE__ */ new Map());
|
|
1092
1339
|
I(() => {
|
|
1093
|
-
if (
|
|
1094
|
-
|
|
1340
|
+
if (l === "tenant") {
|
|
1341
|
+
u(/* @__PURE__ */ new Map());
|
|
1095
1342
|
return;
|
|
1096
1343
|
}
|
|
1097
|
-
const
|
|
1098
|
-
if (
|
|
1099
|
-
|
|
1344
|
+
const v = p.filter((P) => P.kind === "document").map((P) => P.resource_ref?.document_id).filter((P) => !!P);
|
|
1345
|
+
if (v.length === 0) {
|
|
1346
|
+
u(/* @__PURE__ */ new Map());
|
|
1100
1347
|
return;
|
|
1101
1348
|
}
|
|
1102
|
-
let
|
|
1103
|
-
return
|
|
1104
|
-
if (
|
|
1105
|
-
const
|
|
1106
|
-
for (const
|
|
1107
|
-
|
|
1349
|
+
let $ = !1;
|
|
1350
|
+
return i.documentsSummary({ documentIds: v }, l, w).then((P) => {
|
|
1351
|
+
if ($) return;
|
|
1352
|
+
const V = /* @__PURE__ */ new Map();
|
|
1353
|
+
for (const J of P.documents ?? []) V.set(J.document_id, J);
|
|
1354
|
+
u(V);
|
|
1108
1355
|
}).catch(() => {
|
|
1109
|
-
|
|
1356
|
+
$ || u(/* @__PURE__ */ new Map());
|
|
1110
1357
|
}), () => {
|
|
1111
|
-
|
|
1358
|
+
$ = !0;
|
|
1112
1359
|
};
|
|
1113
|
-
}, [
|
|
1114
|
-
const
|
|
1115
|
-
() =>
|
|
1116
|
-
[
|
|
1117
|
-
),
|
|
1118
|
-
|
|
1119
|
-
title: `New folder in ${
|
|
1360
|
+
}, [i, p, l, w]);
|
|
1361
|
+
const h = H(
|
|
1362
|
+
() => z ? Ie(Q, z) : void 0,
|
|
1363
|
+
[Q, z]
|
|
1364
|
+
), C = H(() => h ? h.kind === "directory" ? h.fullPath : pe(h.fullPath) : "", [h]), E = C || "/", A = l !== "tenant", ee = G(() => {
|
|
1365
|
+
M({
|
|
1366
|
+
title: `New folder in ${E}`,
|
|
1120
1367
|
fields: [{ key: "name", label: "Folder name", placeholder: "e.g. launches" }],
|
|
1121
1368
|
submitLabel: "Create",
|
|
1122
|
-
onSubmit: async (
|
|
1123
|
-
const
|
|
1124
|
-
if (!
|
|
1125
|
-
const
|
|
1126
|
-
await
|
|
1369
|
+
onSubmit: async (v) => {
|
|
1370
|
+
const $ = v.name.trim();
|
|
1371
|
+
if (!_e.test($)) throw new Error("name may contain only [A-Za-z0-9._-]");
|
|
1372
|
+
const P = Ee(C, $);
|
|
1373
|
+
await i.pathMkdir(P, l, w), await L(), _(P);
|
|
1127
1374
|
}
|
|
1128
1375
|
});
|
|
1129
|
-
}, [
|
|
1130
|
-
|
|
1131
|
-
title: `New document in ${
|
|
1376
|
+
}, [i, C, E, l, w, L, _]), te = G(() => {
|
|
1377
|
+
M({
|
|
1378
|
+
title: `New document in ${E}`,
|
|
1132
1379
|
fields: [
|
|
1133
1380
|
{ key: "name", label: "Path name", placeholder: "e.g. launch-plan" },
|
|
1134
1381
|
{ key: "title", label: "Title", placeholder: "e.g. Launch Plan" }
|
|
1135
1382
|
],
|
|
1136
1383
|
submitLabel: "Create",
|
|
1137
|
-
onSubmit: async (
|
|
1138
|
-
const
|
|
1139
|
-
if (!
|
|
1140
|
-
const
|
|
1141
|
-
await
|
|
1384
|
+
onSubmit: async (v) => {
|
|
1385
|
+
const $ = v.name.trim();
|
|
1386
|
+
if (!_e.test($)) throw new Error("name may contain only [A-Za-z0-9._-]");
|
|
1387
|
+
const P = v.title.trim() || $, V = Ee(C, $);
|
|
1388
|
+
await i.documentCreate(P, V, l, w), await L(), _(V);
|
|
1142
1389
|
}
|
|
1143
1390
|
});
|
|
1144
|
-
}, [
|
|
1145
|
-
|
|
1146
|
-
title: `Rename / move ${
|
|
1147
|
-
fields: [{ key: "to", label: "New path", value:
|
|
1391
|
+
}, [i, C, E, l, w, L, _]), ne = G(() => {
|
|
1392
|
+
h && M({
|
|
1393
|
+
title: `Rename / move ${h.fullPath}`,
|
|
1394
|
+
fields: [{ key: "to", label: "New path", value: h.fullPath }],
|
|
1148
1395
|
submitLabel: "Move",
|
|
1149
|
-
onSubmit: async (
|
|
1150
|
-
const
|
|
1151
|
-
if (
|
|
1152
|
-
await
|
|
1396
|
+
onSubmit: async (v) => {
|
|
1397
|
+
const $ = v.to.trim();
|
|
1398
|
+
if (!$.startsWith("/")) throw new Error("path must start with /");
|
|
1399
|
+
await i.pathMv(h.fullPath, $, l, w), await L(), _($);
|
|
1153
1400
|
}
|
|
1154
1401
|
});
|
|
1155
|
-
}, [
|
|
1156
|
-
if (!
|
|
1157
|
-
if (
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
title: `Delete document ${
|
|
1402
|
+
}, [i, h, l, w, L, _]), Y = G(() => {
|
|
1403
|
+
if (!h) return;
|
|
1404
|
+
if (h.kind === "document") {
|
|
1405
|
+
const V = h.resourceRef?.document_id;
|
|
1406
|
+
M({
|
|
1407
|
+
title: `Delete document ${h.fullPath}`,
|
|
1161
1408
|
message: "This deletes the document, all its chunks, and its path entry. This cannot be undone.",
|
|
1162
1409
|
fields: [],
|
|
1163
1410
|
submitLabel: "Delete",
|
|
1164
1411
|
danger: !0,
|
|
1165
1412
|
onSubmit: async () => {
|
|
1166
|
-
if (!
|
|
1167
|
-
await
|
|
1413
|
+
if (!V) throw new Error("this document dirent has no document_id");
|
|
1414
|
+
await i.documentDelete(V, l, w), await L(), _(void 0);
|
|
1168
1415
|
}
|
|
1169
1416
|
});
|
|
1170
1417
|
return;
|
|
1171
1418
|
}
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
title: `Delete branch ${
|
|
1175
|
-
message:
|
|
1419
|
+
const v = l === "tenant" ? [] : kt(h), $ = h.children.length;
|
|
1420
|
+
M({
|
|
1421
|
+
title: `Delete branch ${h.fullPath}`,
|
|
1422
|
+
message: $ === 0 ? "This removes the (empty) folder." : "This removes the folder and everything under it" + (v.length > 0 ? ` — including ${v.length} document(s), whose chunks are deleted.` : "."),
|
|
1176
1423
|
fields: [],
|
|
1177
1424
|
submitLabel: "Delete",
|
|
1178
1425
|
danger: !0,
|
|
1179
1426
|
onSubmit: async () => {
|
|
1180
|
-
for (const
|
|
1181
|
-
await
|
|
1182
|
-
await
|
|
1427
|
+
for (const P of v)
|
|
1428
|
+
await i.documentDelete(P, l, w);
|
|
1429
|
+
await i.pathRm(h.fullPath, l, !0, w), await L(), _(void 0);
|
|
1183
1430
|
}
|
|
1184
1431
|
});
|
|
1185
|
-
}, [
|
|
1432
|
+
}, [i, h, l, w, L, _]), ae = h && (h.kind === "directory" || h.kind === "document");
|
|
1186
1433
|
return /* @__PURE__ */ d(q, { children: [
|
|
1187
1434
|
/* @__PURE__ */ d(
|
|
1188
|
-
|
|
1435
|
+
et,
|
|
1189
1436
|
{
|
|
1190
1437
|
className: "paths-view",
|
|
1191
1438
|
defaultLeftWidth: 420,
|
|
@@ -1197,159 +1444,160 @@ function ot({
|
|
|
1197
1444
|
/* @__PURE__ */ d("div", { className: "paths-toolbar", children: [
|
|
1198
1445
|
/* @__PURE__ */ d("label", { className: "paths-scope", children: [
|
|
1199
1446
|
/* @__PURE__ */ n("span", { children: "scope" }),
|
|
1200
|
-
/* @__PURE__ */ d("select", { value:
|
|
1447
|
+
/* @__PURE__ */ d("select", { value: l, onChange: (v) => m(v.target.value), children: [
|
|
1201
1448
|
/* @__PURE__ */ n("option", { value: "user", children: "user" }),
|
|
1202
1449
|
/* @__PURE__ */ n("option", { value: "agent", children: "agent" }),
|
|
1203
1450
|
/* @__PURE__ */ n("option", { value: "tenant", children: "tenant" })
|
|
1204
1451
|
] })
|
|
1205
1452
|
] }),
|
|
1206
1453
|
/* @__PURE__ */ d("div", { className: "paths-toolbar-actions", children: [
|
|
1207
|
-
/* @__PURE__ */ n("button", { type: "button", onClick:
|
|
1454
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: ee, title: `New folder in ${E}`, children: "+ folder" }),
|
|
1208
1455
|
/* @__PURE__ */ n(
|
|
1209
1456
|
"button",
|
|
1210
1457
|
{
|
|
1211
1458
|
type: "button",
|
|
1212
|
-
onClick:
|
|
1213
|
-
disabled: !
|
|
1214
|
-
title:
|
|
1459
|
+
onClick: te,
|
|
1460
|
+
disabled: !A,
|
|
1461
|
+
title: A ? `New document in ${E}` : "Documents are agent/user scope only",
|
|
1215
1462
|
children: "+ document"
|
|
1216
1463
|
}
|
|
1217
1464
|
),
|
|
1218
1465
|
/* @__PURE__ */ n("button", { type: "button", onClick: () => {
|
|
1219
|
-
|
|
1466
|
+
L();
|
|
1220
1467
|
}, title: "Reload the tree", children: "↻" })
|
|
1221
1468
|
] })
|
|
1222
1469
|
] }),
|
|
1223
1470
|
/* @__PURE__ */ d("p", { className: "paths-context", children: [
|
|
1224
1471
|
"new items → ",
|
|
1225
|
-
/* @__PURE__ */ n("code", { children:
|
|
1226
|
-
|
|
1472
|
+
/* @__PURE__ */ n("code", { children: E }),
|
|
1473
|
+
w?.scopeId && /* @__PURE__ */ d(q, { children: [
|
|
1227
1474
|
" · ",
|
|
1228
1475
|
"subject ",
|
|
1229
|
-
/* @__PURE__ */ n("code", { children:
|
|
1476
|
+
/* @__PURE__ */ n("code", { children: w.scopeId })
|
|
1230
1477
|
] }),
|
|
1231
|
-
|
|
1478
|
+
w?.tenant && /* @__PURE__ */ d(q, { children: [
|
|
1232
1479
|
" · ",
|
|
1233
1480
|
"tenant ",
|
|
1234
|
-
/* @__PURE__ */ n("code", { children:
|
|
1481
|
+
/* @__PURE__ */ n("code", { children: w.tenant })
|
|
1235
1482
|
] })
|
|
1236
1483
|
] }),
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1484
|
+
N && /* @__PURE__ */ n("div", { className: "paths-err", children: N }),
|
|
1485
|
+
U && p.length === 0 ? /* @__PURE__ */ n("div", { className: "empty", children: /* @__PURE__ */ n("p", { children: "Loading…" }) }) : /* @__PURE__ */ n(
|
|
1486
|
+
Nt,
|
|
1240
1487
|
{
|
|
1241
|
-
tree:
|
|
1242
|
-
selectedPath:
|
|
1243
|
-
onSelect: (
|
|
1244
|
-
summaries:
|
|
1488
|
+
tree: Q,
|
|
1489
|
+
selectedPath: z,
|
|
1490
|
+
onSelect: (v) => _(v.fullPath),
|
|
1491
|
+
summaries: X
|
|
1245
1492
|
}
|
|
1246
1493
|
)
|
|
1247
1494
|
] }),
|
|
1248
|
-
/* @__PURE__ */ n("div", { className: "right", children:
|
|
1495
|
+
/* @__PURE__ */ n("div", { className: "right", children: h ? h.kind === "document" ? /* @__PURE__ */ d("div", { className: "paths-doc", children: [
|
|
1249
1496
|
/* @__PURE__ */ d("div", { className: "paths-doc-head", children: [
|
|
1250
|
-
/* @__PURE__ */ n("code", { className: "paths-doc-path", children:
|
|
1497
|
+
/* @__PURE__ */ n("code", { className: "paths-doc-path", children: h.fullPath }),
|
|
1251
1498
|
/* @__PURE__ */ d("div", { className: "paths-detail-actions", children: [
|
|
1252
|
-
/* @__PURE__ */ n("button", { type: "button", onClick:
|
|
1253
|
-
/* @__PURE__ */ n("button", { type: "button", className: "danger", onClick:
|
|
1499
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: ne, children: "rename / move" }),
|
|
1500
|
+
/* @__PURE__ */ n("button", { type: "button", className: "danger", onClick: Y, children: "delete" })
|
|
1254
1501
|
] })
|
|
1255
1502
|
] }),
|
|
1256
1503
|
/* @__PURE__ */ n(
|
|
1257
|
-
|
|
1504
|
+
Pe,
|
|
1258
1505
|
{
|
|
1259
|
-
documentId:
|
|
1260
|
-
scope:
|
|
1261
|
-
titleHint:
|
|
1262
|
-
browse:
|
|
1506
|
+
documentId: h.resourceRef?.document_id ?? "",
|
|
1507
|
+
scope: l === "agent" ? "agent" : "user",
|
|
1508
|
+
titleHint: h.name,
|
|
1509
|
+
browse: w,
|
|
1263
1510
|
principal: c,
|
|
1264
|
-
renderAssistant:
|
|
1511
|
+
renderAssistant: s
|
|
1265
1512
|
}
|
|
1266
1513
|
)
|
|
1267
1514
|
] }) : /* @__PURE__ */ d("div", { className: "paths-detail", children: [
|
|
1268
1515
|
/* @__PURE__ */ d("h2", { children: [
|
|
1269
|
-
/* @__PURE__ */ n("span", { className: "paths-detail-kind", children:
|
|
1270
|
-
/* @__PURE__ */ n("code", { children:
|
|
1516
|
+
/* @__PURE__ */ n("span", { className: "paths-detail-kind", children: h.kind }),
|
|
1517
|
+
/* @__PURE__ */ n("code", { children: h.fullPath })
|
|
1271
1518
|
] }),
|
|
1272
1519
|
/* @__PURE__ */ d("dl", { className: "paths-detail-meta", children: [
|
|
1273
1520
|
/* @__PURE__ */ n("dt", { children: "scope" }),
|
|
1274
|
-
/* @__PURE__ */ n("dd", { children:
|
|
1521
|
+
/* @__PURE__ */ n("dd", { children: l }),
|
|
1275
1522
|
/* @__PURE__ */ n("dt", { children: "stored" }),
|
|
1276
|
-
/* @__PURE__ */ n("dd", { children:
|
|
1523
|
+
/* @__PURE__ */ n("dd", { children: h.explicit ? "yes" : "implicit (no entry)" })
|
|
1277
1524
|
] }),
|
|
1278
|
-
|
|
1279
|
-
/* @__PURE__ */ n("button", { type: "button", onClick:
|
|
1280
|
-
/* @__PURE__ */ n("button", { type: "button", className: "danger", onClick:
|
|
1525
|
+
ae ? /* @__PURE__ */ d("div", { className: "paths-detail-actions", children: [
|
|
1526
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: ne, children: "rename / move" }),
|
|
1527
|
+
/* @__PURE__ */ n("button", { type: "button", className: "danger", onClick: Y, children: "delete" })
|
|
1281
1528
|
] }) : /* @__PURE__ */ d("p", { className: "paths-readonly", children: [
|
|
1282
1529
|
"Read-only — ",
|
|
1283
|
-
|
|
1530
|
+
h.kind,
|
|
1284
1531
|
" entries are managed by their own tool."
|
|
1285
1532
|
] })
|
|
1286
1533
|
] }) : /* @__PURE__ */ n("div", { className: "empty", children: /* @__PURE__ */ n("p", { children: "Select a path on the left, or create a folder / document." }) }) })
|
|
1287
1534
|
]
|
|
1288
1535
|
}
|
|
1289
1536
|
),
|
|
1290
|
-
|
|
1537
|
+
W && /* @__PURE__ */ n(_t, { state: W, onClose: () => M(null) })
|
|
1291
1538
|
] });
|
|
1292
1539
|
}
|
|
1293
|
-
function
|
|
1294
|
-
const [t,
|
|
1295
|
-
() => Object.fromEntries(e.fields.map((
|
|
1296
|
-
), [c,
|
|
1297
|
-
return /* @__PURE__ */ n("div", { className: "modal-overlay", onClick:
|
|
1298
|
-
|
|
1540
|
+
function _t({ state: e, onClose: r }) {
|
|
1541
|
+
const [t, a] = y(
|
|
1542
|
+
() => Object.fromEntries(e.fields.map((m) => [m.key, m.value ?? ""]))
|
|
1543
|
+
), [c, s] = y(!1), [o, i] = y(null);
|
|
1544
|
+
return /* @__PURE__ */ n("div", { className: "modal-overlay", onClick: r, children: /* @__PURE__ */ d("form", { className: "modal", onClick: (m) => m.stopPropagation(), onSubmit: async (m) => {
|
|
1545
|
+
m.preventDefault(), s(!0), i(null);
|
|
1299
1546
|
try {
|
|
1300
|
-
await e.onSubmit(t),
|
|
1301
|
-
} catch (
|
|
1302
|
-
|
|
1547
|
+
await e.onSubmit(t), r();
|
|
1548
|
+
} catch (p) {
|
|
1549
|
+
i(p instanceof Error ? p.message : String(p)), s(!1);
|
|
1303
1550
|
}
|
|
1304
1551
|
}, children: [
|
|
1305
1552
|
/* @__PURE__ */ d("div", { className: "modal-header sticky-top", children: [
|
|
1306
1553
|
/* @__PURE__ */ n("h3", { children: e.title }),
|
|
1307
1554
|
/* @__PURE__ */ d("div", { className: "modal-buttons modal-buttons-top", children: [
|
|
1308
|
-
/* @__PURE__ */ n("button", { type: "button", onClick:
|
|
1555
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: r, disabled: c, children: "cancel" }),
|
|
1309
1556
|
/* @__PURE__ */ n("button", { type: "submit", className: e.danger ? "danger" : "primary", disabled: c, children: c ? "working…" : e.submitLabel })
|
|
1310
1557
|
] })
|
|
1311
1558
|
] }),
|
|
1312
1559
|
e.message && /* @__PURE__ */ n("p", { className: "modal-context", children: e.message }),
|
|
1313
|
-
e.fields.map((
|
|
1314
|
-
/* @__PURE__ */ n("span", { children:
|
|
1560
|
+
e.fields.map((m, p) => /* @__PURE__ */ d("label", { className: "path-field", children: [
|
|
1561
|
+
/* @__PURE__ */ n("span", { children: m.label }),
|
|
1315
1562
|
/* @__PURE__ */ n(
|
|
1316
1563
|
"input",
|
|
1317
1564
|
{
|
|
1318
1565
|
className: "path-modal-input",
|
|
1319
|
-
value: t[
|
|
1320
|
-
placeholder:
|
|
1321
|
-
autoFocus:
|
|
1322
|
-
onChange: (
|
|
1566
|
+
value: t[m.key],
|
|
1567
|
+
placeholder: m.placeholder,
|
|
1568
|
+
autoFocus: p === 0,
|
|
1569
|
+
onChange: (b) => a((g) => ({ ...g, [m.key]: b.target.value }))
|
|
1323
1570
|
}
|
|
1324
1571
|
)
|
|
1325
|
-
] },
|
|
1326
|
-
|
|
1572
|
+
] }, m.key)),
|
|
1573
|
+
o && /* @__PURE__ */ n("div", { className: "modal-err", children: o })
|
|
1327
1574
|
] }) });
|
|
1328
1575
|
}
|
|
1329
|
-
function
|
|
1330
|
-
const { documentId:
|
|
1331
|
-
return /* @__PURE__ */ n(
|
|
1332
|
-
|
|
1576
|
+
function Dt(e) {
|
|
1577
|
+
const { documentId: r, scope: t, titleHint: a, browse: c, theme: s, principal: o, renderAssistant: i } = e, l = xe(e);
|
|
1578
|
+
return /* @__PURE__ */ n($e, { theme: s, dataLayer: l, children: /* @__PURE__ */ n(
|
|
1579
|
+
Pe,
|
|
1333
1580
|
{
|
|
1334
|
-
documentId:
|
|
1581
|
+
documentId: r,
|
|
1335
1582
|
scope: t,
|
|
1336
|
-
titleHint:
|
|
1583
|
+
titleHint: a,
|
|
1337
1584
|
browse: c,
|
|
1338
|
-
principal:
|
|
1339
|
-
renderAssistant:
|
|
1585
|
+
principal: o,
|
|
1586
|
+
renderAssistant: i
|
|
1340
1587
|
}
|
|
1341
1588
|
) });
|
|
1342
1589
|
}
|
|
1343
1590
|
export {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1591
|
+
me as DEFAULT_SCHEME,
|
|
1592
|
+
Dt as DocumentViewer,
|
|
1593
|
+
Lt as PathExplorer,
|
|
1594
|
+
Ke as assetFetchFromConnection,
|
|
1595
|
+
rt as chunkColor,
|
|
1596
|
+
Ye as createLoomcycleClient,
|
|
1597
|
+
ye as dataLayerFromClient,
|
|
1598
|
+
De as docColor,
|
|
1599
|
+
fe as effectiveScheme,
|
|
1600
|
+
ct as hexToTint,
|
|
1601
|
+
ge as tintStyle
|
|
1354
1602
|
};
|
|
1355
1603
|
//# sourceMappingURL=index.js.map
|