@loomcycle/explorer 0.14.0 → 0.16.1
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/DocumentViewer.d.ts +5 -0
- package/dist/components/StackSplitter.d.ts +17 -0
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +484 -399
- package/dist/index.js.map +1 -1
- package/dist/styles.css +43 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1170,6 +1170,10 @@ var Z = {
|
|
|
1170
1170
|
"doc.document.done": "#3aa06a",
|
|
1171
1171
|
"doc.research.done": "#8a6ad6",
|
|
1172
1172
|
"doc.publication.draft": "#c99a3a",
|
|
1173
|
+
"doc.*.draft": "#c99a3a",
|
|
1174
|
+
"doc.*.review": "#6a7bd6",
|
|
1175
|
+
"doc.*.confirmed": "#3a9ad6",
|
|
1176
|
+
"doc.*.done": "#3aa06a",
|
|
1173
1177
|
"chunk.draft": "#c99a3a",
|
|
1174
1178
|
"chunk.review": "#6a7bd6",
|
|
1175
1179
|
"chunk.confirmed": "#3a9ad6",
|
|
@@ -1181,41 +1185,45 @@ var Z = {
|
|
|
1181
1185
|
function Be(e) {
|
|
1182
1186
|
return e && Object.keys(e).length > 0 ? e : Z;
|
|
1183
1187
|
}
|
|
1184
|
-
function Ve(e, t
|
|
1188
|
+
function Ve(e, t) {
|
|
1189
|
+
if (Object.prototype.hasOwnProperty.call(e, t) && e[t]) return e[t];
|
|
1190
|
+
let n = t.toLowerCase();
|
|
1191
|
+
for (let t of Object.keys(e)) if (t.toLowerCase() === n && e[t]) return e[t];
|
|
1192
|
+
}
|
|
1193
|
+
function He(e, t, n) {
|
|
1185
1194
|
let r = e ?? "", i = t ?? "";
|
|
1186
|
-
|
|
1187
|
-
if (r && n[`doc.${r}`]) return n[`doc.${r}`];
|
|
1195
|
+
return (r && i ? Ve(n, `doc.${r}.${i}`) : void 0) ?? (r ? Ve(n, `doc.${r}`) : void 0) ?? (i ? Ve(n, `doc.*.${i}`) : void 0) ?? Ve(n, "doc.*");
|
|
1188
1196
|
}
|
|
1189
|
-
function
|
|
1197
|
+
function Ue(e, t) {
|
|
1190
1198
|
let n = e ?? "";
|
|
1191
|
-
return n ? t
|
|
1199
|
+
return n ? Ve(t, `chunk.${n}`) : void 0;
|
|
1192
1200
|
}
|
|
1193
|
-
function
|
|
1201
|
+
function We(e) {
|
|
1194
1202
|
let t = String(e["chunk.inherit"] ?? "").trim().toLowerCase();
|
|
1195
1203
|
return t !== "false" && t !== "none" && t !== "off" && t !== "0";
|
|
1196
1204
|
}
|
|
1197
|
-
function
|
|
1205
|
+
function Ge(e, t = Q) {
|
|
1198
1206
|
let n = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
|
|
1199
1207
|
if (!n) return;
|
|
1200
1208
|
let r = n[1];
|
|
1201
1209
|
return r.length === 3 && (r = r[0] + r[0] + r[1] + r[1] + r[2] + r[2]), `rgba(${parseInt(r.slice(0, 2), 16)}, ${parseInt(r.slice(2, 4), 16)}, ${parseInt(r.slice(4, 6), 16)}, ${t})`;
|
|
1202
1210
|
}
|
|
1203
|
-
function
|
|
1211
|
+
function Ke(e) {
|
|
1204
1212
|
if (!e) return;
|
|
1205
|
-
let t =
|
|
1213
|
+
let t = Ge(e);
|
|
1206
1214
|
if (t) return {
|
|
1207
1215
|
background: t,
|
|
1208
1216
|
borderLeft: `3px solid ${e}`
|
|
1209
1217
|
};
|
|
1210
1218
|
}
|
|
1211
|
-
function
|
|
1219
|
+
function qe(e) {
|
|
1212
1220
|
if (!e) return;
|
|
1213
|
-
let t =
|
|
1221
|
+
let t = Ge(e, Q / 2);
|
|
1214
1222
|
return t ? { background: t } : void 0;
|
|
1215
1223
|
}
|
|
1216
|
-
function
|
|
1224
|
+
function $(e) {
|
|
1217
1225
|
let { status: t, isRoot: n, documentColor: r, scheme: i } = e;
|
|
1218
|
-
if (i) return n ?
|
|
1226
|
+
if (i) return n ? Ke(r) ?? Ke(Ue(t, i)) : Ke(Ue(t, i)) ?? (We(i) ? qe(r) : void 0);
|
|
1219
1227
|
}
|
|
1220
1228
|
//#endregion
|
|
1221
1229
|
//#region src/lib/clipboard.ts
|
|
@@ -1228,7 +1236,7 @@ async function Je(e) {
|
|
|
1228
1236
|
}
|
|
1229
1237
|
//#endregion
|
|
1230
1238
|
//#region src/components/IdCopy.tsx
|
|
1231
|
-
function
|
|
1239
|
+
function Ye({ value: e, label: t, compact: n, title: r }) {
|
|
1232
1240
|
let [i, a] = o("idle"), s = async (t) => {
|
|
1233
1241
|
t.stopPropagation(), t.preventDefault();
|
|
1234
1242
|
let n = await Je(e);
|
|
@@ -1259,7 +1267,7 @@ function $({ value: e, label: t, compact: n, title: r }) {
|
|
|
1259
1267
|
}
|
|
1260
1268
|
//#endregion
|
|
1261
1269
|
//#region src/components/DocumentChunkTree.tsx
|
|
1262
|
-
function
|
|
1270
|
+
function Xe(e) {
|
|
1263
1271
|
let t = /* @__PURE__ */ new Map();
|
|
1264
1272
|
e.forEach((e) => t.set(e.id, {
|
|
1265
1273
|
row: e,
|
|
@@ -1275,17 +1283,17 @@ function Ye(e) {
|
|
|
1275
1283
|
};
|
|
1276
1284
|
return r(n), n;
|
|
1277
1285
|
}
|
|
1278
|
-
function
|
|
1286
|
+
function Ze(e) {
|
|
1279
1287
|
return e === "image" ? "🖼" : e === "mermaid" ? "📊" : "";
|
|
1280
1288
|
}
|
|
1281
|
-
function
|
|
1289
|
+
function Qe(e, t) {
|
|
1282
1290
|
for (let n of e) {
|
|
1283
1291
|
if (n.row.id === t) return n;
|
|
1284
|
-
let e =
|
|
1292
|
+
let e = Qe(n.children, t);
|
|
1285
1293
|
if (e) return e;
|
|
1286
1294
|
}
|
|
1287
1295
|
}
|
|
1288
|
-
function
|
|
1296
|
+
function $e({ tree: e, selectedId: n, onSelect: i, colorEnabled: a, scheme: s, documentColor: c, linkedIds: u }) {
|
|
1289
1297
|
let [d, f] = o(() => /* @__PURE__ */ new Map()), p = t((e) => {
|
|
1290
1298
|
f((t) => {
|
|
1291
1299
|
let n = new Map(t);
|
|
@@ -1294,7 +1302,7 @@ function Qe({ tree: e, selectedId: n, onSelect: i, colorEnabled: a, scheme: s, d
|
|
|
1294
1302
|
}, []);
|
|
1295
1303
|
r(() => {
|
|
1296
1304
|
if (!n) return;
|
|
1297
|
-
let t =
|
|
1305
|
+
let t = et(e, n);
|
|
1298
1306
|
t.length !== 0 && f((e) => {
|
|
1299
1307
|
let n = !1, r = new Map(e);
|
|
1300
1308
|
for (let e of t) r.get(e) === !1 && (r.set(e, !0), n = !0);
|
|
@@ -1307,7 +1315,7 @@ function Qe({ tree: e, selectedId: n, onSelect: i, colorEnabled: a, scheme: s, d
|
|
|
1307
1315
|
children: /* @__PURE__ */ l("p", { children: "No chunks." })
|
|
1308
1316
|
}) : /* @__PURE__ */ l("ul", {
|
|
1309
1317
|
className: "tree chunk-tree",
|
|
1310
|
-
children: e.map((e) => /* @__PURE__ */ l(
|
|
1318
|
+
children: e.map((e) => /* @__PURE__ */ l(tt, {
|
|
1311
1319
|
node: e,
|
|
1312
1320
|
expanded: d,
|
|
1313
1321
|
toggle: p,
|
|
@@ -1320,7 +1328,7 @@ function Qe({ tree: e, selectedId: n, onSelect: i, colorEnabled: a, scheme: s, d
|
|
|
1320
1328
|
}, e.row.id))
|
|
1321
1329
|
});
|
|
1322
1330
|
}
|
|
1323
|
-
function
|
|
1331
|
+
function et(e, t) {
|
|
1324
1332
|
let n = [], r = (e, i) => {
|
|
1325
1333
|
for (let a of e) {
|
|
1326
1334
|
if (a.row.id === t) return n.push(...i), !0;
|
|
@@ -1330,8 +1338,8 @@ function $e(e, t) {
|
|
|
1330
1338
|
};
|
|
1331
1339
|
return r(e, []), n;
|
|
1332
1340
|
}
|
|
1333
|
-
function
|
|
1334
|
-
let d = e.children.length > 0, f = t.get(e.row.id) !== !1, p = r === e.row.id, m =
|
|
1341
|
+
function tt({ node: e, expanded: t, toggle: n, selectedId: r, onSelect: i, tintScheme: a, documentColor: o, isRoot: s = !1, linkedIds: c }) {
|
|
1342
|
+
let d = e.children.length > 0, f = t.get(e.row.id) !== !1, p = r === e.row.id, m = $({
|
|
1335
1343
|
status: e.row.status,
|
|
1336
1344
|
isRoot: s,
|
|
1337
1345
|
documentColor: o,
|
|
@@ -1359,10 +1367,10 @@ function et({ node: e, expanded: t, toggle: n, selectedId: r, onSelect: i, tintS
|
|
|
1359
1367
|
onClick: () => i(e),
|
|
1360
1368
|
title: e.row.title,
|
|
1361
1369
|
children: [
|
|
1362
|
-
|
|
1370
|
+
Ze(e.row.type) && /* @__PURE__ */ l("span", {
|
|
1363
1371
|
className: "chunk-type-icon",
|
|
1364
1372
|
"aria-hidden": !0,
|
|
1365
|
-
children:
|
|
1373
|
+
children: Ze(e.row.type)
|
|
1366
1374
|
}),
|
|
1367
1375
|
/* @__PURE__ */ l("span", {
|
|
1368
1376
|
className: "chunk-title",
|
|
@@ -1384,7 +1392,7 @@ function et({ node: e, expanded: t, toggle: n, selectedId: r, onSelect: i, tintS
|
|
|
1384
1392
|
})
|
|
1385
1393
|
]
|
|
1386
1394
|
}),
|
|
1387
|
-
/* @__PURE__ */ l(
|
|
1395
|
+
/* @__PURE__ */ l(Ye, {
|
|
1388
1396
|
value: e.row.id,
|
|
1389
1397
|
compact: !0,
|
|
1390
1398
|
title: `Copy chunk id: ${e.row.id}`
|
|
@@ -1392,7 +1400,7 @@ function et({ node: e, expanded: t, toggle: n, selectedId: r, onSelect: i, tintS
|
|
|
1392
1400
|
]
|
|
1393
1401
|
}), d && f && /* @__PURE__ */ l("ul", {
|
|
1394
1402
|
className: "children chunk-children",
|
|
1395
|
-
children: e.children.map((e) => /* @__PURE__ */ l(
|
|
1403
|
+
children: e.children.map((e) => /* @__PURE__ */ l(tt, {
|
|
1396
1404
|
node: e,
|
|
1397
1405
|
expanded: t,
|
|
1398
1406
|
toggle: n,
|
|
@@ -1407,12 +1415,12 @@ function et({ node: e, expanded: t, toggle: n, selectedId: r, onSelect: i, tintS
|
|
|
1407
1415
|
}
|
|
1408
1416
|
//#endregion
|
|
1409
1417
|
//#region src/components/Mermaid.tsx
|
|
1410
|
-
var
|
|
1411
|
-
function
|
|
1418
|
+
var nt = 0;
|
|
1419
|
+
function rt(e) {
|
|
1412
1420
|
let t = e?.closest("g.node");
|
|
1413
1421
|
return t ? /flowchart-(.+)-\d+$/.exec(t.id)?.[1] : void 0;
|
|
1414
1422
|
}
|
|
1415
|
-
function
|
|
1423
|
+
function it({ code: e, onNodeClick: t }) {
|
|
1416
1424
|
let n = a(null), [i, s] = o({});
|
|
1417
1425
|
return r(() => {
|
|
1418
1426
|
let t = !1;
|
|
@@ -1424,7 +1432,7 @@ function rt({ code: e, onNodeClick: t }) {
|
|
|
1424
1432
|
theme: a ? "dark" : "default",
|
|
1425
1433
|
securityLevel: "strict"
|
|
1426
1434
|
});
|
|
1427
|
-
let { svg: o } = await r.render(`lc-mmd-${
|
|
1435
|
+
let { svg: o } = await r.render(`lc-mmd-${nt++}`, e);
|
|
1428
1436
|
t || s({ svg: o });
|
|
1429
1437
|
} catch {
|
|
1430
1438
|
t || s({ err: !0 });
|
|
@@ -1440,7 +1448,7 @@ function rt({ code: e, onNodeClick: t }) {
|
|
|
1440
1448
|
ref: n,
|
|
1441
1449
|
className: t ? "md-mermaid md-mermaid-nav" : "md-mermaid",
|
|
1442
1450
|
onClick: t && ((e) => {
|
|
1443
|
-
let n =
|
|
1451
|
+
let n = rt(e.target);
|
|
1444
1452
|
n && t(n);
|
|
1445
1453
|
}),
|
|
1446
1454
|
dangerouslySetInnerHTML: { __html: i.svg }
|
|
@@ -1452,7 +1460,7 @@ function rt({ code: e, onNodeClick: t }) {
|
|
|
1452
1460
|
}
|
|
1453
1461
|
//#endregion
|
|
1454
1462
|
//#region src/components/ChunkEditorModal.tsx
|
|
1455
|
-
function
|
|
1463
|
+
function at({ chunk: e, scope: t, browse: n, onClose: i, onSaved: a }) {
|
|
1456
1464
|
let s = M(), [c, d] = o(e.title), [f, p] = o(e.type ?? ""), [m, h] = o(e.status ?? ""), [g, _] = o(e.body ?? ""), [v, y] = o(e.fields ? JSON.stringify(e.fields, null, 2) : ""), [b, x] = o((e.tags ?? []).join(", ")), [S, C] = o(!1), [w, T] = o(null), [E, D] = o(!1), O = f === "mermaid", k = f === "image" || !!e.asset, [A, j] = o(g);
|
|
1457
1465
|
r(() => {
|
|
1458
1466
|
if (!O) return;
|
|
@@ -1581,7 +1589,7 @@ function it({ chunk: e, scope: t, browse: n, onClose: i, onSaved: a }) {
|
|
|
1581
1589
|
className: "path-field",
|
|
1582
1590
|
children: [/* @__PURE__ */ l("span", { children: "Preview" }), /* @__PURE__ */ l("div", {
|
|
1583
1591
|
className: "chunk-mermaid-preview",
|
|
1584
|
-
children: A.trim() ? /* @__PURE__ */ l(
|
|
1592
|
+
children: A.trim() ? /* @__PURE__ */ l(it, { code: A }) : /* @__PURE__ */ l("p", {
|
|
1585
1593
|
className: "doc-empty-body",
|
|
1586
1594
|
children: "(enter Mermaid source above)"
|
|
1587
1595
|
})
|
|
@@ -1603,7 +1611,7 @@ function it({ chunk: e, scope: t, browse: n, onClose: i, onSaved: a }) {
|
|
|
1603
1611
|
}
|
|
1604
1612
|
//#endregion
|
|
1605
1613
|
//#region src/components/SubjectTypeModal.tsx
|
|
1606
|
-
function
|
|
1614
|
+
function ot({ chunk: e, scope: t, browse: n, onClose: i, onSaved: a }) {
|
|
1607
1615
|
let s = M(), [c, d] = o(null), [f, p] = o(e.type ?? ""), [m, h] = o(!1), [g, _] = o(null), [v, b] = o(null);
|
|
1608
1616
|
r(() => {
|
|
1609
1617
|
let e = !1;
|
|
@@ -1696,18 +1704,18 @@ function at({ chunk: e, scope: t, browse: n, onClose: i, onSaved: a }) {
|
|
|
1696
1704
|
}
|
|
1697
1705
|
//#endregion
|
|
1698
1706
|
//#region src/lib/classify.ts
|
|
1699
|
-
function
|
|
1707
|
+
function st(e) {
|
|
1700
1708
|
return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
1701
1709
|
}
|
|
1702
|
-
function
|
|
1710
|
+
function ct(e) {
|
|
1703
1711
|
if (!e || typeof e != "object") return;
|
|
1704
1712
|
let t = e.classification;
|
|
1705
1713
|
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
1706
1714
|
let n = t, r = {};
|
|
1707
|
-
return typeof n.by == "string" && (r.by = n.by), typeof n.at == "number" && (r.at = n.at), typeof n.applied_type == "string" && n.applied_type && (r.applied_type = n.applied_type), typeof n.proposed_type == "string" && n.proposed_type && (r.proposed_type = n.proposed_type), n.proposed_fields && typeof n.proposed_fields == "object" && !Array.isArray(n.proposed_fields) && (r.proposed_fields = n.proposed_fields),
|
|
1715
|
+
return typeof n.by == "string" && (r.by = n.by), typeof n.at == "number" && (r.at = n.at), typeof n.applied_type == "string" && n.applied_type && (r.applied_type = n.applied_type), typeof n.proposed_type == "string" && n.proposed_type && (r.proposed_type = n.proposed_type), n.proposed_fields && typeof n.proposed_fields == "object" && !Array.isArray(n.proposed_fields) && (r.proposed_fields = n.proposed_fields), st(n.proposed_tags) && (r.proposed_tags = n.proposed_tags), st(n.statements) && (r.statements = n.statements), r;
|
|
1708
1716
|
}
|
|
1709
|
-
function
|
|
1710
|
-
let t =
|
|
1717
|
+
function lt(e) {
|
|
1718
|
+
let t = ct(e);
|
|
1711
1719
|
if (!t) return;
|
|
1712
1720
|
let n = t.proposed_tags ?? [], r = t.statements?.length ?? 0;
|
|
1713
1721
|
if (t.proposed_type || n.length !== 0 || r !== 0) return {
|
|
@@ -1716,7 +1724,7 @@ function ct(e) {
|
|
|
1716
1724
|
statementCount: r
|
|
1717
1725
|
};
|
|
1718
1726
|
}
|
|
1719
|
-
function
|
|
1727
|
+
function ut(e) {
|
|
1720
1728
|
let t = e.write === "report";
|
|
1721
1729
|
switch (e.result) {
|
|
1722
1730
|
case "classified": return t ? "would be classified" : "classified";
|
|
@@ -1726,46 +1734,46 @@ function lt(e) {
|
|
|
1726
1734
|
default: return String(e.result);
|
|
1727
1735
|
}
|
|
1728
1736
|
}
|
|
1729
|
-
function
|
|
1737
|
+
function dt(e) {
|
|
1730
1738
|
if (!e.class) return;
|
|
1731
1739
|
if (e.result === "kept") return "not applied";
|
|
1732
1740
|
let t = e.write === "report";
|
|
1733
1741
|
return e.live ? t ? "would be applied" : "applied" : t ? "would be proposed" : "proposed";
|
|
1734
1742
|
}
|
|
1735
|
-
function
|
|
1743
|
+
function ft(e) {
|
|
1736
1744
|
return e.write === "report" ? e.result === "classified" || e.result === "proposed" || (e.concepts?.length ?? 0) > 0 || (e.issued_by?.length ?? 0) > 0 : !1;
|
|
1737
1745
|
}
|
|
1738
|
-
function
|
|
1746
|
+
function pt(e) {
|
|
1739
1747
|
return e == null || !Number.isFinite(e) ? "" : `${Math.round(e * 100)}%`;
|
|
1740
1748
|
}
|
|
1741
|
-
var
|
|
1749
|
+
var mt = {
|
|
1742
1750
|
rules: "Rules",
|
|
1743
1751
|
vote: "Neighbourhood vote",
|
|
1744
1752
|
model: "Model"
|
|
1745
1753
|
};
|
|
1746
|
-
function mt(e) {
|
|
1747
|
-
return pt[e] ?? e;
|
|
1748
|
-
}
|
|
1749
1754
|
function ht(e) {
|
|
1755
|
+
return mt[e] ?? e;
|
|
1756
|
+
}
|
|
1757
|
+
function gt(e) {
|
|
1750
1758
|
let t = [];
|
|
1751
1759
|
e.quote && t.push(e.from ? `“${e.quote}” (${e.from})` : `“${e.quote}”`), e.votes != null && t.push(`${e.votes} vote${e.votes === 1 ? "" : "s"}`);
|
|
1752
|
-
let n =
|
|
1760
|
+
let n = pt(e.share);
|
|
1753
1761
|
return n && t.push(n), t.join(" · ");
|
|
1754
1762
|
}
|
|
1755
|
-
function
|
|
1763
|
+
function _t(e) {
|
|
1756
1764
|
return {
|
|
1757
|
-
label:
|
|
1765
|
+
label: ht(e.step),
|
|
1758
1766
|
...e.chosen ? { chosen: e.chosen } : {},
|
|
1759
1767
|
...e.method ? { method: e.method } : {},
|
|
1760
1768
|
...e.neighbours ? { neighbours: e.neighbours } : {},
|
|
1761
1769
|
...e.reason ? { reason: e.reason } : {},
|
|
1762
1770
|
candidates: (e.candidates ?? []).map((e) => ({
|
|
1763
1771
|
class: e.class,
|
|
1764
|
-
detail:
|
|
1772
|
+
detail: gt(e)
|
|
1765
1773
|
}))
|
|
1766
1774
|
};
|
|
1767
1775
|
}
|
|
1768
|
-
function
|
|
1776
|
+
function vt(e) {
|
|
1769
1777
|
let t = [];
|
|
1770
1778
|
e.type && t.push(`type ${e.type}`);
|
|
1771
1779
|
let n = e.accepted_statements?.length ?? 0;
|
|
@@ -1778,18 +1786,18 @@ function _t(e) {
|
|
|
1778
1786
|
notices: r
|
|
1779
1787
|
};
|
|
1780
1788
|
}
|
|
1781
|
-
function
|
|
1789
|
+
function yt(e) {
|
|
1782
1790
|
let t = e instanceof Error ? e.message : String(e);
|
|
1783
1791
|
return t.includes("nothing_pending") ? "Nothing is pending for this document — it may already have been accepted." : t;
|
|
1784
1792
|
}
|
|
1785
1793
|
//#endregion
|
|
1786
1794
|
//#region src/components/Classification.tsx
|
|
1787
|
-
function
|
|
1788
|
-
let f = M(), [p, m] = o(null), [h, g] = o(!1), [_, v] = o(null), [y, b] = o(!1), [x, S] = o(null), [C, w] = o(null), T = i(() => f.documentAcceptClassification ?
|
|
1795
|
+
function bt({ documentId: e, scope: t, browse: n, rootFields: a, requestKey: s, onClose: c, onChanged: d }) {
|
|
1796
|
+
let f = M(), [p, m] = o(null), [h, g] = o(!1), [_, v] = o(null), [y, b] = o(!1), [x, S] = o(null), [C, w] = o(null), T = i(() => f.documentAcceptClassification ? lt(a) : void 0, [f, a]);
|
|
1789
1797
|
r(() => {
|
|
1790
1798
|
if (s === 0 || !f.documentClassify) return;
|
|
1791
1799
|
let r = !1;
|
|
1792
|
-
return g(!0), v(null), m(null), f.documentClassify(e, "report", t, n).then((e) => !r && m(e)).catch((e) => !r && v(
|
|
1800
|
+
return g(!0), v(null), m(null), f.documentClassify(e, "report", t, n).then((e) => !r && m(e)).catch((e) => !r && v(yt(e))).finally(() => !r && g(!1)), () => {
|
|
1793
1801
|
r = !0;
|
|
1794
1802
|
};
|
|
1795
1803
|
}, [
|
|
@@ -1805,7 +1813,7 @@ function yt({ documentId: e, scope: t, browse: n, rootFields: a, requestKey: s,
|
|
|
1805
1813
|
try {
|
|
1806
1814
|
m(await f.documentClassify(e, "propose", t, n)), d();
|
|
1807
1815
|
} catch (e) {
|
|
1808
|
-
v(
|
|
1816
|
+
v(yt(e));
|
|
1809
1817
|
} finally {
|
|
1810
1818
|
g(!1);
|
|
1811
1819
|
}
|
|
@@ -1816,14 +1824,14 @@ function yt({ documentId: e, scope: t, browse: n, rootFields: a, requestKey: s,
|
|
|
1816
1824
|
try {
|
|
1817
1825
|
w(await f.documentAcceptClassification(e, t, n)), d();
|
|
1818
1826
|
} catch (e) {
|
|
1819
|
-
S(
|
|
1827
|
+
S(yt(e));
|
|
1820
1828
|
} finally {
|
|
1821
1829
|
b(!1);
|
|
1822
1830
|
}
|
|
1823
1831
|
}
|
|
1824
1832
|
}, O = s > 0;
|
|
1825
1833
|
if (!O && !T && !C && !x) return null;
|
|
1826
|
-
let k = C ?
|
|
1834
|
+
let k = C ? vt(C) : void 0;
|
|
1827
1835
|
return /* @__PURE__ */ u("div", {
|
|
1828
1836
|
className: "doc-classify",
|
|
1829
1837
|
children: [
|
|
@@ -1894,7 +1902,7 @@ function yt({ documentId: e, scope: t, browse: n, rootFields: a, requestKey: s,
|
|
|
1894
1902
|
/* @__PURE__ */ l("h4", { children: "Classify" }),
|
|
1895
1903
|
p && /* @__PURE__ */ l("span", {
|
|
1896
1904
|
className: `doc-classify-result ${p.result}`,
|
|
1897
|
-
children:
|
|
1905
|
+
children: ut(p)
|
|
1898
1906
|
}),
|
|
1899
1907
|
p?.write === "report" && /* @__PURE__ */ l("span", {
|
|
1900
1908
|
className: "doc-classify-hint",
|
|
@@ -1918,8 +1926,8 @@ function yt({ documentId: e, scope: t, browse: n, rootFields: a, requestKey: s,
|
|
|
1918
1926
|
role: "alert",
|
|
1919
1927
|
children: _
|
|
1920
1928
|
}),
|
|
1921
|
-
p && /* @__PURE__ */ l(
|
|
1922
|
-
p &&
|
|
1929
|
+
p && /* @__PURE__ */ l(xt, { answer: p }),
|
|
1930
|
+
p && ft(p) && /* @__PURE__ */ l("div", {
|
|
1923
1931
|
className: "doc-classify-actions",
|
|
1924
1932
|
children: /* @__PURE__ */ l("button", {
|
|
1925
1933
|
type: "button",
|
|
@@ -1934,8 +1942,8 @@ function yt({ documentId: e, scope: t, browse: n, rootFields: a, requestKey: s,
|
|
|
1934
1942
|
]
|
|
1935
1943
|
});
|
|
1936
1944
|
}
|
|
1937
|
-
function
|
|
1938
|
-
let t =
|
|
1945
|
+
function xt({ answer: e }) {
|
|
1946
|
+
let t = dt(e), n = Object.entries(e.fields ?? {}), r = e.issued_by ?? [], i = e.concepts ?? [], a = (e.steps ?? []).map(_t), o = e.statements?.length ?? 0;
|
|
1939
1947
|
return /* @__PURE__ */ u(c, { children: [
|
|
1940
1948
|
/* @__PURE__ */ u("dl", {
|
|
1941
1949
|
className: "doc-classify-rows",
|
|
@@ -1973,7 +1981,7 @@ function bt({ answer: e }) {
|
|
|
1973
1981
|
title: e.tag,
|
|
1974
1982
|
children: [e.concept, /* @__PURE__ */ u("span", {
|
|
1975
1983
|
className: "doc-classify-hint",
|
|
1976
|
-
children: [" ",
|
|
1984
|
+
children: [" ", pt(e.share)]
|
|
1977
1985
|
})]
|
|
1978
1986
|
}, e.tag)) })] }),
|
|
1979
1987
|
o > 0 && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("dt", { children: "statements" }), /* @__PURE__ */ u("dd", { children: [
|
|
@@ -2041,13 +2049,13 @@ function bt({ answer: e }) {
|
|
|
2041
2049
|
}
|
|
2042
2050
|
//#endregion
|
|
2043
2051
|
//#region src/components/ColorSchemeEditor.tsx
|
|
2044
|
-
function
|
|
2052
|
+
function St(e) {
|
|
2045
2053
|
let t = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec((e ?? "").trim());
|
|
2046
2054
|
if (!t) return "#888888";
|
|
2047
2055
|
let n = t[1];
|
|
2048
2056
|
return n.length === 3 && (n = n[0] + n[0] + n[1] + n[1] + n[2] + n[2]), "#" + n.toLowerCase();
|
|
2049
2057
|
}
|
|
2050
|
-
function
|
|
2058
|
+
function Ct({ documentId: e, rootChunkId: t, docType: n, docStatus: a, chunkStatuses: s, scope: d, browse: f, onClose: p, onSaved: m }) {
|
|
2051
2059
|
let h = M(), [g, _] = o(null), [v, y] = o(!1), [b, x] = o({}), [S, C] = o(!1), [w, T] = o(null), [E, D] = o(null), O = i(() => {
|
|
2052
2060
|
let e = new Set(Object.keys(Z));
|
|
2053
2061
|
n && e.add(`doc.${n}.${a || "draft"}`);
|
|
@@ -2157,7 +2165,7 @@ function St({ documentId: e, rootChunkId: t, docType: n, docStatus: a, chunkStat
|
|
|
2157
2165
|
}),
|
|
2158
2166
|
/* @__PURE__ */ u("div", {
|
|
2159
2167
|
className: "scheme-group",
|
|
2160
|
-
children: [/* @__PURE__ */ l("h4", { children: "Document (type · status)" }), P.map((e) => /* @__PURE__ */ l(
|
|
2168
|
+
children: [/* @__PURE__ */ l("h4", { children: "Document (type · status)" }), P.map((e) => /* @__PURE__ */ l(wt, {
|
|
2161
2169
|
label: e.slice(4),
|
|
2162
2170
|
value: b[e],
|
|
2163
2171
|
onChange: (t) => k(e, t)
|
|
@@ -2165,7 +2173,7 @@ function St({ documentId: e, rootChunkId: t, docType: n, docStatus: a, chunkStat
|
|
|
2165
2173
|
}),
|
|
2166
2174
|
/* @__PURE__ */ u("div", {
|
|
2167
2175
|
className: "scheme-group",
|
|
2168
|
-
children: [/* @__PURE__ */ l("h4", { children: "Chunks (status)" }), F.map((e) => /* @__PURE__ */ l(
|
|
2176
|
+
children: [/* @__PURE__ */ l("h4", { children: "Chunks (status)" }), F.map((e) => /* @__PURE__ */ l(wt, {
|
|
2169
2177
|
label: e.slice(6),
|
|
2170
2178
|
value: b[e],
|
|
2171
2179
|
onChange: (t) => k(e, t)
|
|
@@ -2196,8 +2204,8 @@ function St({ documentId: e, rootChunkId: t, docType: n, docStatus: a, chunkStat
|
|
|
2196
2204
|
})
|
|
2197
2205
|
});
|
|
2198
2206
|
}
|
|
2199
|
-
function
|
|
2200
|
-
let r =
|
|
2207
|
+
function wt({ label: e, value: t, onChange: n }) {
|
|
2208
|
+
let r = St(t);
|
|
2201
2209
|
return /* @__PURE__ */ u("label", {
|
|
2202
2210
|
className: "scheme-row",
|
|
2203
2211
|
children: [
|
|
@@ -2219,7 +2227,7 @@ function Ct({ label: e, value: t, onChange: n }) {
|
|
|
2219
2227
|
}
|
|
2220
2228
|
//#endregion
|
|
2221
2229
|
//#region src/components/ChunkTarget.tsx
|
|
2222
|
-
function
|
|
2230
|
+
function Tt({ id: e, title: t, targetDocumentId: n, documentId: r, onSelectChunk: i, onOpenDocument: a }) {
|
|
2223
2231
|
let o = t || e.slice(0, 8);
|
|
2224
2232
|
return !n || n === r ? /* @__PURE__ */ l("button", {
|
|
2225
2233
|
type: "button",
|
|
@@ -2240,7 +2248,7 @@ function wt({ id: e, title: t, targetDocumentId: n, documentId: r, onSelectChunk
|
|
|
2240
2248
|
}
|
|
2241
2249
|
//#endregion
|
|
2242
2250
|
//#region src/components/Statement.tsx
|
|
2243
|
-
function
|
|
2251
|
+
function Et({ statement: e }) {
|
|
2244
2252
|
let t = Ce(e), n = we(e), r = De(e), i = Ee(e), { rows: a, more: o } = Oe(e);
|
|
2245
2253
|
return /* @__PURE__ */ u(c, { children: [
|
|
2246
2254
|
t && /* @__PURE__ */ l("span", {
|
|
@@ -2285,7 +2293,7 @@ function Tt({ statement: e }) {
|
|
|
2285
2293
|
})
|
|
2286
2294
|
] });
|
|
2287
2295
|
}
|
|
2288
|
-
function
|
|
2296
|
+
function Dt({ id: e, onRule: t }) {
|
|
2289
2297
|
let [n, r] = o(!1), [i, a] = o(""), [s, d] = o(!1), [f, p] = o(null), m = async (n) => {
|
|
2290
2298
|
d(!0), p(null);
|
|
2291
2299
|
try {
|
|
@@ -2343,8 +2351,8 @@ function Et({ id: e, onRule: t }) {
|
|
|
2343
2351
|
}
|
|
2344
2352
|
//#endregion
|
|
2345
2353
|
//#region src/components/ProposalReview.tsx
|
|
2346
|
-
var
|
|
2347
|
-
function
|
|
2354
|
+
var Ot = 3;
|
|
2355
|
+
function kt({ documentId: e, proposals: t, incomplete: n, scope: r, browse: i, onChanged: s, onSelectChunk: c, onOpenDocument: d }) {
|
|
2348
2356
|
let f = M(), [p, m] = o(/* @__PURE__ */ new Set()), [h, g] = o({ kind: "idle" }), [_, v] = o(""), [y, b] = o(null), [x, S] = o(null), C = a(null), w = new Set(t.map((e) => e.id)), T = [...p].filter((e) => w.has(e)), E = h.kind !== "idle" && h.kind !== "reason", D = (e, t) => {
|
|
2349
2357
|
b(null), S(null), e === "reject" ? g({
|
|
2350
2358
|
kind: "reason",
|
|
@@ -2504,7 +2512,7 @@ function Ot({ documentId: e, proposals: t, incomplete: n, scope: r, browse: i, o
|
|
|
2504
2512
|
className: "doc-conn-empty",
|
|
2505
2513
|
children: "counting…"
|
|
2506
2514
|
}),
|
|
2507
|
-
h.kind === "confirm" && /* @__PURE__ */ l(
|
|
2515
|
+
h.kind === "confirm" && /* @__PURE__ */ l(At, {
|
|
2508
2516
|
step: h,
|
|
2509
2517
|
onAnswer: k
|
|
2510
2518
|
}),
|
|
@@ -2541,7 +2549,7 @@ function Ot({ documentId: e, proposals: t, incomplete: n, scope: r, browse: i, o
|
|
|
2541
2549
|
disabled: E,
|
|
2542
2550
|
onChange: () => j(t.id)
|
|
2543
2551
|
}),
|
|
2544
|
-
/* @__PURE__ */ l(
|
|
2552
|
+
/* @__PURE__ */ l(Tt, {
|
|
2545
2553
|
id: t.from_id,
|
|
2546
2554
|
title: t.from_title,
|
|
2547
2555
|
targetDocumentId: t.from_document_id,
|
|
@@ -2553,7 +2561,7 @@ function Ot({ documentId: e, proposals: t, incomplete: n, scope: r, browse: i, o
|
|
|
2553
2561
|
className: "doc-ref-kind",
|
|
2554
2562
|
children: t.kind
|
|
2555
2563
|
}),
|
|
2556
|
-
/* @__PURE__ */ l(
|
|
2564
|
+
/* @__PURE__ */ l(Tt, {
|
|
2557
2565
|
id: t.to_id,
|
|
2558
2566
|
title: t.to_title,
|
|
2559
2567
|
targetDocumentId: t.to_document_id,
|
|
@@ -2561,14 +2569,14 @@ function Ot({ documentId: e, proposals: t, incomplete: n, scope: r, browse: i, o
|
|
|
2561
2569
|
onSelectChunk: c,
|
|
2562
2570
|
onOpenDocument: d
|
|
2563
2571
|
}),
|
|
2564
|
-
/* @__PURE__ */ l(
|
|
2572
|
+
/* @__PURE__ */ l(Et, { statement: t })
|
|
2565
2573
|
]
|
|
2566
2574
|
}, t.id))
|
|
2567
2575
|
})
|
|
2568
2576
|
]
|
|
2569
2577
|
});
|
|
2570
2578
|
}
|
|
2571
|
-
function
|
|
2579
|
+
function At({ step: e, onAnswer: t }) {
|
|
2572
2580
|
let { dry: n } = e, r = e.action === "accept" ? "Accept" : "Reject", i = Pe(n.matched);
|
|
2573
2581
|
return /* @__PURE__ */ u("div", {
|
|
2574
2582
|
className: "doc-bulk-step doc-bulk-confirm",
|
|
@@ -2590,7 +2598,7 @@ function kt({ step: e, onAnswer: t }) {
|
|
|
2590
2598
|
] }),
|
|
2591
2599
|
(n.sample ?? []).length > 0 && /* @__PURE__ */ l("ul", {
|
|
2592
2600
|
className: "doc-bulk-sample",
|
|
2593
|
-
children: (n.sample ?? []).slice(0,
|
|
2601
|
+
children: (n.sample ?? []).slice(0, Ot).map((e) => /* @__PURE__ */ u("li", { children: [
|
|
2594
2602
|
e.from_title || e.from_id,
|
|
2595
2603
|
" ",
|
|
2596
2604
|
/* @__PURE__ */ l("span", {
|
|
@@ -2621,26 +2629,26 @@ function kt({ step: e, onAnswer: t }) {
|
|
|
2621
2629
|
}
|
|
2622
2630
|
//#endregion
|
|
2623
2631
|
//#region src/components/Connections.tsx
|
|
2624
|
-
var
|
|
2625
|
-
function
|
|
2632
|
+
var jt = 8, Mt = 20;
|
|
2633
|
+
function Nt(e) {
|
|
2626
2634
|
return /embedder|embedding|vector|semantic|not configured/i.test(e);
|
|
2627
2635
|
}
|
|
2628
|
-
function
|
|
2636
|
+
function Pt({ documentId: e, selectedId: t, scope: n, browse: i, onSelectChunk: a, onOpenDocument: s, refreshKey: d, review: f }) {
|
|
2629
2637
|
let p = M(), [m, h] = o(!1), [g, _] = o(!1), [v, y] = o(void 0), [b, x] = o([]), [S, C] = o([]), [w, T] = o(null), [E, D] = o([]), [O, k] = o(!1);
|
|
2630
2638
|
r(() => {
|
|
2631
2639
|
if (!m || !t) return;
|
|
2632
2640
|
let e = t, r = !1;
|
|
2633
2641
|
return _(!0), Promise.allSettled([
|
|
2634
2642
|
p.documentBacklinks(e, n, i),
|
|
2635
|
-
p.documentRelated(e, n, i,
|
|
2636
|
-
p.documentUnlinkedMentions(e, n, i,
|
|
2643
|
+
p.documentRelated(e, n, i, jt),
|
|
2644
|
+
p.documentUnlinkedMentions(e, n, i, Mt)
|
|
2637
2645
|
]).then(([t, n, i]) => {
|
|
2638
2646
|
if (!r) {
|
|
2639
2647
|
if (x(t.status === "fulfilled" ? t.value.backlinks ?? [] : []), n.status === "fulfilled") C(n.value.related ?? []), T(null);
|
|
2640
2648
|
else {
|
|
2641
2649
|
C([]);
|
|
2642
2650
|
let e = n.reason instanceof Error ? n.reason.message : String(n.reason);
|
|
2643
|
-
T(
|
|
2651
|
+
T(Nt(e) ? "semantic search not configured" : e);
|
|
2644
2652
|
}
|
|
2645
2653
|
i.status === "fulfilled" ? (D(i.value.unlinked_mentions ?? []), k(!!i.value.truncated)) : (D([]), k(!1)), y(e), _(!1);
|
|
2646
2654
|
}
|
|
@@ -2655,7 +2663,7 @@ function Nt({ documentId: e, selectedId: t, scope: n, browse: i, onSelectChunk:
|
|
|
2655
2663
|
i,
|
|
2656
2664
|
d
|
|
2657
2665
|
]);
|
|
2658
|
-
let A = (t, n, r) => /* @__PURE__ */ l(
|
|
2666
|
+
let A = (t, n, r) => /* @__PURE__ */ l(Tt, {
|
|
2659
2667
|
id: t,
|
|
2660
2668
|
title: n,
|
|
2661
2669
|
targetDocumentId: r,
|
|
@@ -2672,7 +2680,7 @@ function Nt({ documentId: e, selectedId: t, scope: n, browse: i, onSelectChunk:
|
|
|
2672
2680
|
children: [m ? "▼" : "▶", " Connections"]
|
|
2673
2681
|
}), m && /* @__PURE__ */ u("div", {
|
|
2674
2682
|
className: "doc-conn-body",
|
|
2675
|
-
children: [f && /* @__PURE__ */ l(
|
|
2683
|
+
children: [f && /* @__PURE__ */ l(kt, {
|
|
2676
2684
|
documentId: e,
|
|
2677
2685
|
proposals: f.proposals,
|
|
2678
2686
|
incomplete: f.incomplete,
|
|
@@ -2702,7 +2710,7 @@ function Nt({ documentId: e, selectedId: t, scope: n, browse: i, onSelectChunk:
|
|
|
2702
2710
|
title: "Auto-linked from a [[wikilink]]",
|
|
2703
2711
|
children: "auto"
|
|
2704
2712
|
}),
|
|
2705
|
-
/* @__PURE__ */ l(
|
|
2713
|
+
/* @__PURE__ */ l(Et, { statement: e })
|
|
2706
2714
|
]
|
|
2707
2715
|
}, `${e.from_id}-${e.kind}-${t}`))
|
|
2708
2716
|
})]
|
|
@@ -2756,11 +2764,11 @@ function Nt({ documentId: e, selectedId: t, scope: n, browse: i, onSelectChunk:
|
|
|
2756
2764
|
}
|
|
2757
2765
|
//#endregion
|
|
2758
2766
|
//#region src/components/CrossReferences.tsx
|
|
2759
|
-
var
|
|
2760
|
-
function
|
|
2767
|
+
var Ft = 24;
|
|
2768
|
+
function It({ edges: e, documentId: t, selectedId: n, onSelectChunk: r, onOpenDocument: i, onRuleStatement: a, incomplete: s }) {
|
|
2761
2769
|
let [d, f] = o(!1), [p, m] = o(!1);
|
|
2762
2770
|
if (e.length === 0) return null;
|
|
2763
|
-
let h = n ? e.filter((e) => e.from_id === n || e.to_id === n) : [], g = p ? e : e.slice(0,
|
|
2771
|
+
let h = n ? e.filter((e) => e.from_id === n || e.to_id === n) : [], g = p ? e : e.slice(0, Ft), _ = Rt(g);
|
|
2764
2772
|
return /* @__PURE__ */ u("div", {
|
|
2765
2773
|
className: "doc-refs",
|
|
2766
2774
|
children: [
|
|
@@ -2779,7 +2787,7 @@ function Ft({ edges: e, documentId: t, selectedId: n, onSelectChunk: r, onOpenDo
|
|
|
2779
2787
|
children: "This chunk has no links."
|
|
2780
2788
|
}) : /* @__PURE__ */ l("ul", {
|
|
2781
2789
|
className: "doc-refs-list",
|
|
2782
|
-
children: h.map((e, o) => /* @__PURE__ */ l(
|
|
2790
|
+
children: h.map((e, o) => /* @__PURE__ */ l(Lt, {
|
|
2783
2791
|
edge: e,
|
|
2784
2792
|
selectedId: n,
|
|
2785
2793
|
documentId: t,
|
|
@@ -2801,23 +2809,23 @@ function Ft({ edges: e, documentId: t, selectedId: n, onSelectChunk: r, onOpenDo
|
|
|
2801
2809
|
e.length,
|
|
2802
2810
|
")"
|
|
2803
2811
|
]
|
|
2804
|
-
}), d && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(
|
|
2812
|
+
}), d && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(it, {
|
|
2805
2813
|
code: _,
|
|
2806
2814
|
onNodeClick: (e) => {
|
|
2807
|
-
let n =
|
|
2815
|
+
let n = zt(g, e);
|
|
2808
2816
|
n && (!n.documentId || n.documentId === t ? r(n.id) : i?.(n.documentId, n.id, n.title));
|
|
2809
2817
|
}
|
|
2810
|
-
}), e.length >
|
|
2818
|
+
}), e.length > Ft && /* @__PURE__ */ l("button", {
|
|
2811
2819
|
type: "button",
|
|
2812
2820
|
className: "doc-graph-more",
|
|
2813
2821
|
onClick: () => m((e) => !e),
|
|
2814
|
-
children: p ? `show top ${
|
|
2822
|
+
children: p ? `show top ${Ft}` : `show all ${e.length}`
|
|
2815
2823
|
})] })]
|
|
2816
2824
|
})
|
|
2817
2825
|
]
|
|
2818
2826
|
});
|
|
2819
2827
|
}
|
|
2820
|
-
function
|
|
2828
|
+
function Lt({ edge: e, selectedId: t, documentId: n, onSelectChunk: r, onOpenDocument: i, onRuleStatement: a }) {
|
|
2821
2829
|
let o = e.from_id === t, s = o ? e.to_id : e.from_id, c = o ? e.to_title : e.from_title, d = o ? e.to_document_id : e.from_document_id;
|
|
2822
2830
|
return /* @__PURE__ */ u("li", {
|
|
2823
2831
|
className: "doc-ref",
|
|
@@ -2831,7 +2839,7 @@ function It({ edge: e, selectedId: t, documentId: n, onSelectChunk: r, onOpenDoc
|
|
|
2831
2839
|
"aria-hidden": !0,
|
|
2832
2840
|
children: o ? "→" : "←"
|
|
2833
2841
|
}),
|
|
2834
|
-
/* @__PURE__ */ l(
|
|
2842
|
+
/* @__PURE__ */ l(Tt, {
|
|
2835
2843
|
id: s,
|
|
2836
2844
|
title: c,
|
|
2837
2845
|
targetDocumentId: d,
|
|
@@ -2839,46 +2847,113 @@ function It({ edge: e, selectedId: t, documentId: n, onSelectChunk: r, onOpenDoc
|
|
|
2839
2847
|
onSelectChunk: r,
|
|
2840
2848
|
onOpenDocument: i
|
|
2841
2849
|
}),
|
|
2842
|
-
/* @__PURE__ */ l(
|
|
2843
|
-
a && q(e) && /* @__PURE__ */ l(
|
|
2850
|
+
/* @__PURE__ */ l(Et, { statement: e }),
|
|
2851
|
+
a && q(e) && /* @__PURE__ */ l(Dt, {
|
|
2844
2852
|
id: e.id,
|
|
2845
2853
|
onRule: a
|
|
2846
2854
|
})
|
|
2847
2855
|
]
|
|
2848
2856
|
});
|
|
2849
2857
|
}
|
|
2850
|
-
function
|
|
2858
|
+
function Rt(e) {
|
|
2851
2859
|
let t = ["graph LR"];
|
|
2852
2860
|
for (let n of e) {
|
|
2853
|
-
let e = `${
|
|
2861
|
+
let e = `${Bt(n.from_id)}["${Vt(n.from_title, n.from_id)}"]`, r = `${Bt(n.to_id)}["${Vt(n.to_title, n.to_id)}"]`, i = (n.kind || "link").replace(/[|"]/g, " "), a = n.status === "proposed" ? "-.->" : "-->";
|
|
2854
2862
|
t.push(` ${e} ${a}|${i}| ${r}`);
|
|
2855
2863
|
}
|
|
2856
2864
|
return t.join("\n");
|
|
2857
2865
|
}
|
|
2858
|
-
function
|
|
2866
|
+
function zt(e, t) {
|
|
2859
2867
|
for (let n of e) {
|
|
2860
|
-
if (
|
|
2868
|
+
if (Bt(n.from_id) === t) return {
|
|
2861
2869
|
id: n.from_id,
|
|
2862
2870
|
documentId: n.from_document_id,
|
|
2863
2871
|
title: n.from_title
|
|
2864
2872
|
};
|
|
2865
|
-
if (
|
|
2873
|
+
if (Bt(n.to_id) === t) return {
|
|
2866
2874
|
id: n.to_id,
|
|
2867
2875
|
documentId: n.to_document_id,
|
|
2868
2876
|
title: n.to_title
|
|
2869
2877
|
};
|
|
2870
2878
|
}
|
|
2871
2879
|
}
|
|
2872
|
-
function
|
|
2880
|
+
function Bt(e) {
|
|
2873
2881
|
return "n" + e.replace(/[^a-zA-Z0-9]/g, "");
|
|
2874
2882
|
}
|
|
2875
|
-
function
|
|
2883
|
+
function Vt(e, t) {
|
|
2876
2884
|
let n = (e ?? "").replace(/["[\]{}|<>]/g, " ").replace(/\s+/g, " ").trim() || t.slice(0, 6);
|
|
2877
2885
|
return n.length > 30 ? n.slice(0, 29) + "…" : n;
|
|
2878
2886
|
}
|
|
2879
2887
|
//#endregion
|
|
2888
|
+
//#region src/components/StackSplitter.tsx
|
|
2889
|
+
var Ht = 6;
|
|
2890
|
+
function Ut(e, t, n, r) {
|
|
2891
|
+
let i = Math.max(r, t - n - Ht);
|
|
2892
|
+
return Math.round(Math.max(r, Math.min(e, i)));
|
|
2893
|
+
}
|
|
2894
|
+
function Wt({ children: e, defaultBottomHeight: n = 240, minTopHeight: i = 96, minBottomHeight: s = 48, storageKey: c, className: d }) {
|
|
2895
|
+
let [f, p] = o(() => {
|
|
2896
|
+
if (c) try {
|
|
2897
|
+
let e = parseInt(localStorage.getItem(c) ?? "", 10);
|
|
2898
|
+
if (Number.isFinite(e) && e >= s) return e;
|
|
2899
|
+
} catch {}
|
|
2900
|
+
return n;
|
|
2901
|
+
}), m = a(null), [h, g] = o(!1);
|
|
2902
|
+
r(() => {
|
|
2903
|
+
if (c && !h) try {
|
|
2904
|
+
localStorage.setItem(c, String(f));
|
|
2905
|
+
} catch {}
|
|
2906
|
+
}, [
|
|
2907
|
+
c,
|
|
2908
|
+
f,
|
|
2909
|
+
h
|
|
2910
|
+
]);
|
|
2911
|
+
let _ = t((e) => {
|
|
2912
|
+
e.preventDefault(), g(!0), e.target.setPointerCapture(e.pointerId);
|
|
2913
|
+
}, []), v = t((e) => {
|
|
2914
|
+
if (!h || !m.current) return;
|
|
2915
|
+
let t = m.current.getBoundingClientRect();
|
|
2916
|
+
p(Ut(t.bottom - e.clientY, t.height, i, s));
|
|
2917
|
+
}, [
|
|
2918
|
+
h,
|
|
2919
|
+
i,
|
|
2920
|
+
s
|
|
2921
|
+
]), y = t((e) => {
|
|
2922
|
+
g(!1);
|
|
2923
|
+
try {
|
|
2924
|
+
e.target.releasePointerCapture(e.pointerId);
|
|
2925
|
+
} catch {}
|
|
2926
|
+
}, []);
|
|
2927
|
+
return /* @__PURE__ */ u("div", {
|
|
2928
|
+
ref: m,
|
|
2929
|
+
className: `stack-splitter ${d ?? ""} ${h ? "dragging" : ""}`,
|
|
2930
|
+
style: { gridTemplateRows: `minmax(${i}px, 1fr) ${Ht}px min(${f}px, calc(100% - ${i + Ht}px))` },
|
|
2931
|
+
children: [
|
|
2932
|
+
/* @__PURE__ */ l("div", {
|
|
2933
|
+
className: "stack-splitter-pane stack-splitter-top",
|
|
2934
|
+
children: e[0]
|
|
2935
|
+
}),
|
|
2936
|
+
/* @__PURE__ */ l("div", {
|
|
2937
|
+
className: "stack-splitter-handle",
|
|
2938
|
+
role: "separator",
|
|
2939
|
+
"aria-orientation": "horizontal",
|
|
2940
|
+
"aria-valuenow": f,
|
|
2941
|
+
title: "Drag to share the space between the text and its links",
|
|
2942
|
+
onPointerDown: _,
|
|
2943
|
+
onPointerMove: v,
|
|
2944
|
+
onPointerUp: y,
|
|
2945
|
+
onPointerCancel: y
|
|
2946
|
+
}),
|
|
2947
|
+
/* @__PURE__ */ l("div", {
|
|
2948
|
+
className: "stack-splitter-pane stack-splitter-bottom",
|
|
2949
|
+
children: e[1]
|
|
2950
|
+
})
|
|
2951
|
+
]
|
|
2952
|
+
});
|
|
2953
|
+
}
|
|
2954
|
+
//#endregion
|
|
2880
2955
|
//#region src/components/DocUnavailable.tsx
|
|
2881
|
-
function
|
|
2956
|
+
function Gt({ documentId: e, scope: t, detail: n }) {
|
|
2882
2957
|
return /* @__PURE__ */ u("div", {
|
|
2883
2958
|
className: "doc-unavailable",
|
|
2884
2959
|
role: "alert",
|
|
@@ -2901,11 +2976,11 @@ function Vt({ documentId: e, scope: t, detail: n }) {
|
|
|
2901
2976
|
}
|
|
2902
2977
|
//#endregion
|
|
2903
2978
|
//#region src/components/HistoryModal.tsx
|
|
2904
|
-
function
|
|
2979
|
+
function Kt(e) {
|
|
2905
2980
|
let t = typeof e == "number" ? e / 1e6 : Date.parse(String(e));
|
|
2906
2981
|
return !Number.isFinite(t) || t <= 0 ? String(e ?? "") : new Date(t).toLocaleString();
|
|
2907
2982
|
}
|
|
2908
|
-
function
|
|
2983
|
+
function qt({ chunkId: e, chunkTitle: t, scope: n, browse: i, onClose: a }) {
|
|
2909
2984
|
let s = M(), [d, f] = o([]), [p, m] = o(!0), [h, g] = o(null), [_, v] = o("none"), [y, b] = o(null), [x, S] = o(""), [C, w] = o(!1), [T, E] = o(null), [D, O] = o(null), [k, A] = o("");
|
|
2910
2985
|
r(() => {
|
|
2911
2986
|
let t = !1;
|
|
@@ -2990,7 +3065,7 @@ function Ut({ chunkId: e, chunkTitle: t, scope: n, browse: i, onClose: a }) {
|
|
|
2990
3065
|
}),
|
|
2991
3066
|
/* @__PURE__ */ l("span", {
|
|
2992
3067
|
className: "doc-hist-rev-time",
|
|
2993
|
-
children:
|
|
3068
|
+
children: Kt(e.created_at)
|
|
2994
3069
|
}),
|
|
2995
3070
|
/* @__PURE__ */ l("span", {
|
|
2996
3071
|
className: "doc-hist-rev-actor",
|
|
@@ -3038,7 +3113,7 @@ function Ut({ chunkId: e, chunkTitle: t, scope: n, browse: i, onClose: a }) {
|
|
|
3038
3113
|
children: C ? /* @__PURE__ */ l("p", {
|
|
3039
3114
|
className: "doc-empty-body",
|
|
3040
3115
|
children: "loading…"
|
|
3041
|
-
}) : _ === "diff" ? /* @__PURE__ */ l(
|
|
3116
|
+
}) : _ === "diff" ? /* @__PURE__ */ l(Jt, { text: k }) : _ === "version" ? /* @__PURE__ */ l("pre", {
|
|
3042
3117
|
className: "md-pre doc-hist-version",
|
|
3043
3118
|
children: /* @__PURE__ */ l("code", { children: x || "(empty)" })
|
|
3044
3119
|
}) : /* @__PURE__ */ l("p", {
|
|
@@ -3051,7 +3126,7 @@ function Ut({ chunkId: e, chunkTitle: t, scope: n, browse: i, onClose: a }) {
|
|
|
3051
3126
|
})
|
|
3052
3127
|
});
|
|
3053
3128
|
}
|
|
3054
|
-
function
|
|
3129
|
+
function Jt({ text: e }) {
|
|
3055
3130
|
if (!e.trim()) return /* @__PURE__ */ l("p", {
|
|
3056
3131
|
className: "doc-empty-body",
|
|
3057
3132
|
children: "(no differences)"
|
|
@@ -3070,17 +3145,17 @@ function Wt({ text: e }) {
|
|
|
3070
3145
|
}
|
|
3071
3146
|
//#endregion
|
|
3072
3147
|
//#region src/components/Markdown.tsx
|
|
3073
|
-
function
|
|
3148
|
+
function Yt({ source: e }) {
|
|
3074
3149
|
return /* @__PURE__ */ l("div", {
|
|
3075
3150
|
className: "md",
|
|
3076
3151
|
children: /* @__PURE__ */ l(f, {
|
|
3077
3152
|
remarkPlugins: [p],
|
|
3078
|
-
components:
|
|
3153
|
+
components: Xt,
|
|
3079
3154
|
children: e
|
|
3080
3155
|
})
|
|
3081
3156
|
});
|
|
3082
3157
|
}
|
|
3083
|
-
var
|
|
3158
|
+
var Xt = {
|
|
3084
3159
|
a({ href: e, children: t }) {
|
|
3085
3160
|
let n = e ?? "", r = /^https?:\/\//i.test(n);
|
|
3086
3161
|
return /* @__PURE__ */ l("a", {
|
|
@@ -3095,7 +3170,7 @@ var Kt = {
|
|
|
3095
3170
|
},
|
|
3096
3171
|
code({ className: e, children: t }) {
|
|
3097
3172
|
let n = /language-(\w+)/.exec(e ?? "")?.[1], r = String(t ?? "");
|
|
3098
|
-
return n === "mermaid" ? /* @__PURE__ */ l(
|
|
3173
|
+
return n === "mermaid" ? /* @__PURE__ */ l(it, { code: r.replace(/\n$/, "") }) : n || r.includes("\n") ? /* @__PURE__ */ l("pre", {
|
|
3099
3174
|
className: "md-pre",
|
|
3100
3175
|
children: /* @__PURE__ */ l("code", {
|
|
3101
3176
|
className: e,
|
|
@@ -3106,11 +3181,11 @@ var Kt = {
|
|
|
3106
3181
|
};
|
|
3107
3182
|
//#endregion
|
|
3108
3183
|
//#region src/components/DocumentViewerBody.tsx
|
|
3109
|
-
function
|
|
3184
|
+
function Zt(e) {
|
|
3110
3185
|
let t = e.fields ?? {};
|
|
3111
3186
|
return typeof t.alt == "string" && t.alt.trim() !== "" ? t.alt : e.title || "image";
|
|
3112
3187
|
}
|
|
3113
|
-
function
|
|
3188
|
+
function Qt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, renderAssistant: p, initialChunkId: m, onOpenDocument: h, onTitle: g, onChunkSelect: v, focusChunk: y }) {
|
|
3114
3189
|
let b = M(), x = i(() => d && (d.scopeId || d.tenant) ? {
|
|
3115
3190
|
scopeId: d.scopeId,
|
|
3116
3191
|
tenant: d.tenant
|
|
@@ -3118,7 +3193,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3118
3193
|
Ae.current = m;
|
|
3119
3194
|
let je = a(g);
|
|
3120
3195
|
je.current = g;
|
|
3121
|
-
let Me = i(() =>
|
|
3196
|
+
let Me = i(() => Xe(S), [S]), Ne = i(() => S.find((e) => !e.parent_id)?.title || s || "document", [S, s]), Y = i(() => !!E && !E.parent_id, [E]), Pe = i(() => xe(S, E?.id), [S, E]), X = i(() => W?.root_chunk_id ?? S.find((e) => !e.parent_id)?.id, [W, S]), Re = a(v);
|
|
3122
3197
|
Re.current = v, r(() => {
|
|
3123
3198
|
w && Re.current?.(w === X ? void 0 : w);
|
|
3124
3199
|
}, [w, X]);
|
|
@@ -3126,12 +3201,12 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3126
3201
|
let e = /* @__PURE__ */ new Set();
|
|
3127
3202
|
for (let t of K) e.add(t.from_id), e.add(t.to_id);
|
|
3128
3203
|
return e;
|
|
3129
|
-
}, [K]),
|
|
3204
|
+
}, [K]), Ve = i(() => Z ? He(W?.type, W?.status, Be(W?.color_scheme)) : void 0, [
|
|
3130
3205
|
Z,
|
|
3131
3206
|
W?.type,
|
|
3132
3207
|
W?.status,
|
|
3133
3208
|
W?.color_scheme
|
|
3134
|
-
]), Ue = i(() =>
|
|
3209
|
+
]), Ue = i(() => Ke(Ve), [Ve]);
|
|
3135
3210
|
r(() => {
|
|
3136
3211
|
let t = !1;
|
|
3137
3212
|
return le(!0), z(null), V(null), b.documentQueryChunks(e, n, x).then((r) => {
|
|
@@ -3150,10 +3225,10 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3150
3225
|
fe,
|
|
3151
3226
|
x
|
|
3152
3227
|
]);
|
|
3153
|
-
let We = !ce && (de !== null || ue === `${n}:${e}` && S.length === 0),
|
|
3228
|
+
let We = !ce && (de !== null || ue === `${n}:${e}` && S.length === 0), Ge = i(() => S.find((t) => !t.parent_id && t.document_id === e)?.title, [S, e]);
|
|
3154
3229
|
r(() => {
|
|
3155
|
-
|
|
3156
|
-
}, [e,
|
|
3230
|
+
Ge && je.current?.(e, Ge);
|
|
3231
|
+
}, [e, Ge]), r(() => {
|
|
3157
3232
|
let t = !1;
|
|
3158
3233
|
return b.documentGet(e, n, x).then((e) => !t && ge(e)).catch(() => !t && ge(null)), () => {
|
|
3159
3234
|
t = !0;
|
|
@@ -3205,18 +3280,20 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3205
3280
|
b,
|
|
3206
3281
|
n,
|
|
3207
3282
|
x
|
|
3208
|
-
]),
|
|
3283
|
+
]), $ = i(() => Fe(b, n), [b, n]), Je = i(() => Ie(K, e), [K, e]), Ze = t(() => Te((e) => e + 1), []), et = i(() => Le($, Je, Ce, Ze), [
|
|
3284
|
+
$,
|
|
3209
3285
|
Je,
|
|
3210
|
-
Xe,
|
|
3211
3286
|
Ce,
|
|
3212
|
-
|
|
3287
|
+
Ze
|
|
3213
3288
|
]), tt = y?.seq, nt = a(y);
|
|
3214
3289
|
nt.current = y;
|
|
3215
|
-
let
|
|
3216
|
-
|
|
3290
|
+
let rt = a(X);
|
|
3291
|
+
rt.current = X;
|
|
3292
|
+
let st = a(S);
|
|
3293
|
+
st.current = S, r(() => {
|
|
3217
3294
|
if (tt === void 0) return;
|
|
3218
|
-
let e = nt.current?.chunkId ??
|
|
3219
|
-
|
|
3295
|
+
let e = nt.current?.chunkId, t = st.current.length > 0 ? U(st.current, e) : e ?? rt.current;
|
|
3296
|
+
t && T(t);
|
|
3220
3297
|
}, [tt]), r(() => {
|
|
3221
3298
|
T(void 0), D(null), j(null), k("chunks"), ge(null), Se([]), we(!1), De(0), ke(void 0);
|
|
3222
3299
|
}, [e, n]), r(() => {
|
|
@@ -3256,7 +3333,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3256
3333
|
j(null);
|
|
3257
3334
|
return;
|
|
3258
3335
|
}
|
|
3259
|
-
let e =
|
|
3336
|
+
let e = Qe(Me, w);
|
|
3260
3337
|
if (!e) return;
|
|
3261
3338
|
let t = !1, r = [], i = (e, t) => {
|
|
3262
3339
|
r.push({
|
|
@@ -3288,7 +3365,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3288
3365
|
fe,
|
|
3289
3366
|
x
|
|
3290
3367
|
]);
|
|
3291
|
-
let
|
|
3368
|
+
let ct = t((e) => T(e.row.id), []), lt = t((t, n, r) => h?.({
|
|
3292
3369
|
documentId: t,
|
|
3293
3370
|
chunkId: n,
|
|
3294
3371
|
title: r
|
|
@@ -3301,7 +3378,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3301
3378
|
e,
|
|
3302
3379
|
w,
|
|
3303
3380
|
Ne
|
|
3304
|
-
]),
|
|
3381
|
+
]), ut = t(async () => {
|
|
3305
3382
|
try {
|
|
3306
3383
|
let t = await b.documentExportMd(e, n, !0, x), r = new Blob([t.markdown], { type: "text/markdown" }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
3307
3384
|
a.href = i, a.download = (t.title || "document").replace(/[^\w.-]+/g, "_") + ".md", a.click(), URL.revokeObjectURL(i);
|
|
@@ -3313,7 +3390,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3313
3390
|
e,
|
|
3314
3391
|
n,
|
|
3315
3392
|
x
|
|
3316
|
-
]),
|
|
3393
|
+
]), dt = t(async () => {
|
|
3317
3394
|
try {
|
|
3318
3395
|
let t = await b.documentExportCanvas(e, n, x), r = new Blob([JSON.stringify(t.canvas, null, 2)], { type: "application/json" }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
3319
3396
|
a.href = i, a.download = (Ne || "document").replace(/[^\w.-]+/g, "_") + ".canvas", a.click(), URL.revokeObjectURL(i);
|
|
@@ -3326,7 +3403,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3326
3403
|
n,
|
|
3327
3404
|
x,
|
|
3328
3405
|
Ne
|
|
3329
|
-
]),
|
|
3406
|
+
]), ft = !!b.documentCreateChunk && !!X, pt = t(async (t) => {
|
|
3330
3407
|
if (!b.documentCreateChunk || !b.documentSetAsset) return;
|
|
3331
3408
|
let r = w || X;
|
|
3332
3409
|
if (r) {
|
|
@@ -3349,7 +3426,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3349
3426
|
w,
|
|
3350
3427
|
X,
|
|
3351
3428
|
J
|
|
3352
|
-
]),
|
|
3429
|
+
]), mt = t(async () => {
|
|
3353
3430
|
if (!b.documentCreateChunk) return;
|
|
3354
3431
|
let t = w || X;
|
|
3355
3432
|
if (t) {
|
|
@@ -3373,7 +3450,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3373
3450
|
w,
|
|
3374
3451
|
X,
|
|
3375
3452
|
J
|
|
3376
|
-
]),
|
|
3453
|
+
]), ht = t(async () => {
|
|
3377
3454
|
if (!b.documentCreateChunk) return;
|
|
3378
3455
|
let t = w && !Y ? w : void 0, r = w || X;
|
|
3379
3456
|
if (r) {
|
|
@@ -3397,7 +3474,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3397
3474
|
Y,
|
|
3398
3475
|
X,
|
|
3399
3476
|
J
|
|
3400
|
-
]),
|
|
3477
|
+
]), gt = t(async () => {
|
|
3401
3478
|
if (b.documentCreateChunk && w) {
|
|
3402
3479
|
z(null);
|
|
3403
3480
|
try {
|
|
@@ -3417,7 +3494,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3417
3494
|
x,
|
|
3418
3495
|
w,
|
|
3419
3496
|
J
|
|
3420
|
-
]),
|
|
3497
|
+
]), _t = i(() => {
|
|
3421
3498
|
if (!E || Y) return {
|
|
3422
3499
|
canUp: !1,
|
|
3423
3500
|
canDown: !1
|
|
@@ -3431,7 +3508,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3431
3508
|
S,
|
|
3432
3509
|
E,
|
|
3433
3510
|
Y
|
|
3434
|
-
]),
|
|
3511
|
+
]), vt = t(async (e) => {
|
|
3435
3512
|
if (b.documentReorderChunk && w) {
|
|
3436
3513
|
z(null);
|
|
3437
3514
|
try {
|
|
@@ -3446,7 +3523,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3446
3523
|
n,
|
|
3447
3524
|
x,
|
|
3448
3525
|
J
|
|
3449
|
-
]),
|
|
3526
|
+
]), yt = t(async () => {
|
|
3450
3527
|
if (!b.documentDeleteChunk || !E) return;
|
|
3451
3528
|
z(null);
|
|
3452
3529
|
let e = E.parent_id;
|
|
@@ -3464,20 +3541,20 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3464
3541
|
J
|
|
3465
3542
|
]);
|
|
3466
3543
|
return r(() => {
|
|
3467
|
-
if (!
|
|
3544
|
+
if (!ft) return;
|
|
3468
3545
|
let e = (e) => {
|
|
3469
3546
|
if (ne || G) return;
|
|
3470
3547
|
let t = document.activeElement, n = t?.tagName;
|
|
3471
3548
|
if (n === "INPUT" || n === "TEXTAREA" || t?.isContentEditable) return;
|
|
3472
3549
|
let r = ve(e.clipboardData?.items);
|
|
3473
|
-
r && (e.preventDefault(),
|
|
3550
|
+
r && (e.preventDefault(), pt(r));
|
|
3474
3551
|
};
|
|
3475
3552
|
return window.addEventListener("paste", e), () => window.removeEventListener("paste", e);
|
|
3476
3553
|
}, [
|
|
3477
|
-
|
|
3554
|
+
ft,
|
|
3478
3555
|
ne,
|
|
3479
3556
|
G,
|
|
3480
|
-
|
|
3557
|
+
pt
|
|
3481
3558
|
]), /* @__PURE__ */ u("div", {
|
|
3482
3559
|
className: "doc-viewer",
|
|
3483
3560
|
children: [
|
|
@@ -3488,7 +3565,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3488
3565
|
style: { display: "none" },
|
|
3489
3566
|
onChange: (e) => {
|
|
3490
3567
|
let t = e.target.files?.[0];
|
|
3491
|
-
e.target.value = "", t &&
|
|
3568
|
+
e.target.value = "", t && pt(t);
|
|
3492
3569
|
}
|
|
3493
3570
|
}),
|
|
3494
3571
|
/* @__PURE__ */ u("div", {
|
|
@@ -3500,23 +3577,23 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3500
3577
|
title: Ne,
|
|
3501
3578
|
children: Ne
|
|
3502
3579
|
}),
|
|
3503
|
-
/* @__PURE__ */ l(
|
|
3580
|
+
/* @__PURE__ */ l(Ye, {
|
|
3504
3581
|
value: e,
|
|
3505
3582
|
label: "doc"
|
|
3506
3583
|
}),
|
|
3507
3584
|
/* @__PURE__ */ u("div", {
|
|
3508
3585
|
className: "doc-toolbar-actions",
|
|
3509
3586
|
children: [
|
|
3510
|
-
|
|
3587
|
+
ft && /* @__PURE__ */ u(c, { children: [
|
|
3511
3588
|
/* @__PURE__ */ l("button", {
|
|
3512
3589
|
type: "button",
|
|
3513
|
-
onClick: () => void
|
|
3590
|
+
onClick: () => void ht(),
|
|
3514
3591
|
title: "Add a text chunk AFTER the selected chunk, at the same level",
|
|
3515
3592
|
children: "+ text"
|
|
3516
3593
|
}),
|
|
3517
3594
|
/* @__PURE__ */ l("button", {
|
|
3518
3595
|
type: "button",
|
|
3519
|
-
onClick: () => void
|
|
3596
|
+
onClick: () => void gt(),
|
|
3520
3597
|
disabled: !w,
|
|
3521
3598
|
title: w ? "Add a chunk NESTED UNDER the selected chunk (in the ontology, a child is a subclass)" : "Select a chunk first — this nests a new chunk under it",
|
|
3522
3599
|
children: "+ child"
|
|
@@ -3529,7 +3606,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3529
3606
|
}),
|
|
3530
3607
|
/* @__PURE__ */ l("button", {
|
|
3531
3608
|
type: "button",
|
|
3532
|
-
onClick: () => void
|
|
3609
|
+
onClick: () => void mt(),
|
|
3533
3610
|
title: "Add a Mermaid diagram chunk",
|
|
3534
3611
|
children: "+ diagram"
|
|
3535
3612
|
})
|
|
@@ -3551,13 +3628,13 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3551
3628
|
}),
|
|
3552
3629
|
/* @__PURE__ */ l("button", {
|
|
3553
3630
|
type: "button",
|
|
3554
|
-
onClick: () => void
|
|
3631
|
+
onClick: () => void ut(),
|
|
3555
3632
|
title: "Download the whole document as Markdown (.md)",
|
|
3556
3633
|
children: "↓ .md"
|
|
3557
3634
|
}),
|
|
3558
3635
|
/* @__PURE__ */ l("button", {
|
|
3559
3636
|
type: "button",
|
|
3560
|
-
onClick: () => void
|
|
3637
|
+
onClick: () => void dt(),
|
|
3561
3638
|
title: "Download the whole document as a node/edge canvas graph (.canvas)",
|
|
3562
3639
|
children: "↓ .canvas"
|
|
3563
3640
|
}),
|
|
@@ -3582,7 +3659,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3582
3659
|
className: "paths-err",
|
|
3583
3660
|
children: R
|
|
3584
3661
|
}),
|
|
3585
|
-
!We && /* @__PURE__ */ l(
|
|
3662
|
+
!We && /* @__PURE__ */ l(bt, {
|
|
3586
3663
|
documentId: e,
|
|
3587
3664
|
scope: n,
|
|
3588
3665
|
browse: x,
|
|
@@ -3591,7 +3668,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3591
3668
|
onClose: () => De(0),
|
|
3592
3669
|
onChanged: J
|
|
3593
3670
|
}, `${n}:${e}`),
|
|
3594
|
-
We ? /* @__PURE__ */ l(
|
|
3671
|
+
We ? /* @__PURE__ */ l(Gt, {
|
|
3595
3672
|
documentId: e,
|
|
3596
3673
|
scope: n,
|
|
3597
3674
|
detail: de ?? void 0
|
|
@@ -3606,142 +3683,143 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3606
3683
|
children: ce && S.length === 0 ? /* @__PURE__ */ l("div", {
|
|
3607
3684
|
className: "empty",
|
|
3608
3685
|
children: /* @__PURE__ */ l("p", { children: "Loading…" })
|
|
3609
|
-
}) : /* @__PURE__ */ l(
|
|
3686
|
+
}) : /* @__PURE__ */ l($e, {
|
|
3610
3687
|
tree: Me,
|
|
3611
3688
|
selectedId: w,
|
|
3612
|
-
onSelect:
|
|
3689
|
+
onSelect: ct,
|
|
3613
3690
|
colorEnabled: Z,
|
|
3614
3691
|
scheme: W?.color_scheme,
|
|
3615
|
-
documentColor:
|
|
3692
|
+
documentColor: Ve,
|
|
3616
3693
|
linkedIds: Q
|
|
3617
3694
|
})
|
|
3618
3695
|
}), /* @__PURE__ */ l("div", {
|
|
3619
3696
|
className: "doc-content",
|
|
3620
|
-
children: E ? /* @__PURE__ */ u(c, { children: [
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
children: /* @__PURE__ */ l("button", {
|
|
3638
|
-
type: "button",
|
|
3639
|
-
className: "doc-trail-crumb",
|
|
3640
|
-
onClick: () => T(e.id),
|
|
3641
|
-
title: e.title || "(untitled)",
|
|
3642
|
-
children: e.title || "(untitled)"
|
|
3643
|
-
})
|
|
3644
|
-
}, e.id)), /* @__PURE__ */ l("li", {
|
|
3645
|
-
className: "doc-trail-item",
|
|
3646
|
-
children: /* @__PURE__ */ l("span", {
|
|
3647
|
-
className: "doc-trail-current",
|
|
3648
|
-
"aria-current": "location",
|
|
3649
|
-
title: E.title || "(untitled)",
|
|
3650
|
-
children: E.title || "(untitled)"
|
|
3651
|
-
})
|
|
3652
|
-
})]
|
|
3653
|
-
})]
|
|
3654
|
-
}),
|
|
3655
|
-
/* @__PURE__ */ l("h3", { children: E.title || "(untitled)" }),
|
|
3656
|
-
/* @__PURE__ */ u("div", {
|
|
3657
|
-
className: "doc-content-meta",
|
|
3658
|
-
children: [
|
|
3659
|
-
E.type && /* @__PURE__ */ l("span", {
|
|
3660
|
-
className: "chunk-badge",
|
|
3661
|
-
children: E.type
|
|
3662
|
-
}),
|
|
3663
|
-
E.status && /* @__PURE__ */ l("span", {
|
|
3664
|
-
className: "chunk-badge chunk-status",
|
|
3665
|
-
children: E.status
|
|
3666
|
-
}),
|
|
3667
|
-
/* @__PURE__ */ u("span", {
|
|
3668
|
-
className: "chunk-rev",
|
|
3669
|
-
children: ["rev ", E.revision]
|
|
3670
|
-
}),
|
|
3671
|
-
E.tags?.map((e) => /* @__PURE__ */ l("span", {
|
|
3672
|
-
className: "chunk-tag",
|
|
3673
|
-
children: e
|
|
3674
|
-
}, e)),
|
|
3675
|
-
/* @__PURE__ */ l($, {
|
|
3676
|
-
value: E.id,
|
|
3677
|
-
label: "chunk"
|
|
3678
|
-
})
|
|
3679
|
-
]
|
|
3680
|
-
}),
|
|
3681
|
-
/* @__PURE__ */ u("div", {
|
|
3682
|
-
className: "doc-content-controls",
|
|
3683
|
-
children: [
|
|
3684
|
-
/* @__PURE__ */ u("div", {
|
|
3685
|
-
className: "doc-mode-toggle",
|
|
3686
|
-
children: [/* @__PURE__ */ l("button", {
|
|
3687
|
-
type: "button",
|
|
3688
|
-
className: O === "chunks" ? "active" : "",
|
|
3689
|
-
onClick: () => k("chunks"),
|
|
3690
|
-
title: "This chunk's own content",
|
|
3691
|
-
children: "chunk"
|
|
3692
|
-
}), /* @__PURE__ */ l("button", {
|
|
3693
|
-
type: "button",
|
|
3694
|
-
className: O === "markdown" ? "active" : "",
|
|
3695
|
-
onClick: () => k("markdown"),
|
|
3696
|
-
title: Y ? "Whole document as Markdown" : "This chunk + its sub-chunks as Markdown",
|
|
3697
|
-
children: "markdown"
|
|
3698
|
-
})]
|
|
3699
|
-
}),
|
|
3700
|
-
/* @__PURE__ */ l("button", {
|
|
3701
|
-
type: "button",
|
|
3702
|
-
className: "chunk-edit",
|
|
3703
|
-
onClick: () => re(E),
|
|
3704
|
-
children: "edit"
|
|
3705
|
-
}),
|
|
3706
|
-
b.documentEntityTypes && _(E) && /* @__PURE__ */ l("button", {
|
|
3707
|
-
type: "button",
|
|
3708
|
-
onClick: () => ae(E),
|
|
3709
|
-
title: "Change this subject's type to another type in force",
|
|
3710
|
-
children: "change type"
|
|
3711
|
-
}),
|
|
3712
|
-
/* @__PURE__ */ l("button", {
|
|
3697
|
+
children: E ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("div", {
|
|
3698
|
+
className: "doc-content-head",
|
|
3699
|
+
children: [
|
|
3700
|
+
Pe.length > 0 && /* @__PURE__ */ u("nav", {
|
|
3701
|
+
className: "chunk-ancestry",
|
|
3702
|
+
"aria-label": "Chunks above this one",
|
|
3703
|
+
children: [/* @__PURE__ */ l("button", {
|
|
3704
|
+
type: "button",
|
|
3705
|
+
className: "chunk-ancestry-up",
|
|
3706
|
+
onClick: () => T(Pe[Pe.length - 1].id),
|
|
3707
|
+
title: `Up to ${Pe[Pe.length - 1].title || "(untitled)"}`,
|
|
3708
|
+
children: "↰ Up"
|
|
3709
|
+
}), /* @__PURE__ */ u("ol", {
|
|
3710
|
+
className: "doc-trail-list",
|
|
3711
|
+
children: [Pe.map((e) => /* @__PURE__ */ l("li", {
|
|
3712
|
+
className: "doc-trail-item",
|
|
3713
|
+
children: /* @__PURE__ */ l("button", {
|
|
3713
3714
|
type: "button",
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3715
|
+
className: "doc-trail-crumb",
|
|
3716
|
+
onClick: () => T(e.id),
|
|
3717
|
+
title: e.title || "(untitled)",
|
|
3718
|
+
children: e.title || "(untitled)"
|
|
3719
|
+
})
|
|
3720
|
+
}, e.id)), /* @__PURE__ */ l("li", {
|
|
3721
|
+
className: "doc-trail-item",
|
|
3722
|
+
children: /* @__PURE__ */ l("span", {
|
|
3723
|
+
className: "doc-trail-current",
|
|
3724
|
+
"aria-current": "location",
|
|
3725
|
+
title: E.title || "(untitled)",
|
|
3726
|
+
children: E.title || "(untitled)"
|
|
3727
|
+
})
|
|
3728
|
+
})]
|
|
3729
|
+
})]
|
|
3730
|
+
}),
|
|
3731
|
+
/* @__PURE__ */ l("h3", { children: E.title || "(untitled)" }),
|
|
3732
|
+
/* @__PURE__ */ u("div", {
|
|
3733
|
+
className: "doc-content-meta",
|
|
3734
|
+
children: [
|
|
3735
|
+
E.type && /* @__PURE__ */ l("span", {
|
|
3736
|
+
className: "chunk-badge",
|
|
3737
|
+
children: E.type
|
|
3738
|
+
}),
|
|
3739
|
+
E.status && /* @__PURE__ */ l("span", {
|
|
3740
|
+
className: "chunk-badge chunk-status",
|
|
3741
|
+
children: E.status
|
|
3742
|
+
}),
|
|
3743
|
+
/* @__PURE__ */ u("span", {
|
|
3744
|
+
className: "chunk-rev",
|
|
3745
|
+
children: ["rev ", E.revision]
|
|
3746
|
+
}),
|
|
3747
|
+
E.tags?.map((e) => /* @__PURE__ */ l("span", {
|
|
3748
|
+
className: "chunk-tag",
|
|
3749
|
+
children: e
|
|
3750
|
+
}, e)),
|
|
3751
|
+
/* @__PURE__ */ l(Ye, {
|
|
3752
|
+
value: E.id,
|
|
3753
|
+
label: "chunk"
|
|
3754
|
+
})
|
|
3755
|
+
]
|
|
3756
|
+
}),
|
|
3757
|
+
/* @__PURE__ */ u("div", {
|
|
3758
|
+
className: "doc-content-controls",
|
|
3759
|
+
children: [
|
|
3760
|
+
/* @__PURE__ */ u("div", {
|
|
3761
|
+
className: "doc-mode-toggle",
|
|
3762
|
+
children: [/* @__PURE__ */ l("button", {
|
|
3719
3763
|
type: "button",
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
title: "
|
|
3723
|
-
children: "
|
|
3764
|
+
className: O === "chunks" ? "active" : "",
|
|
3765
|
+
onClick: () => k("chunks"),
|
|
3766
|
+
title: "This chunk's own content",
|
|
3767
|
+
children: "chunk"
|
|
3724
3768
|
}), /* @__PURE__ */ l("button", {
|
|
3725
3769
|
type: "button",
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
title: "
|
|
3729
|
-
children: "
|
|
3730
|
-
})]
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3770
|
+
className: O === "markdown" ? "active" : "",
|
|
3771
|
+
onClick: () => k("markdown"),
|
|
3772
|
+
title: Y ? "Whole document as Markdown" : "This chunk + its sub-chunks as Markdown",
|
|
3773
|
+
children: "markdown"
|
|
3774
|
+
})]
|
|
3775
|
+
}),
|
|
3776
|
+
/* @__PURE__ */ l("button", {
|
|
3777
|
+
type: "button",
|
|
3778
|
+
className: "chunk-edit",
|
|
3779
|
+
onClick: () => re(E),
|
|
3780
|
+
children: "edit"
|
|
3781
|
+
}),
|
|
3782
|
+
b.documentEntityTypes && _(E) && /* @__PURE__ */ l("button", {
|
|
3783
|
+
type: "button",
|
|
3784
|
+
onClick: () => ae(E),
|
|
3785
|
+
title: "Change this subject's type to another type in force",
|
|
3786
|
+
children: "change type"
|
|
3787
|
+
}),
|
|
3788
|
+
/* @__PURE__ */ l("button", {
|
|
3789
|
+
type: "button",
|
|
3790
|
+
onClick: () => L(!0),
|
|
3791
|
+
title: "View this chunk's edit history + diffs",
|
|
3792
|
+
children: "history"
|
|
3793
|
+
}),
|
|
3794
|
+
!Y && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
|
|
3795
|
+
type: "button",
|
|
3796
|
+
onClick: () => void vt("up"),
|
|
3797
|
+
disabled: !_t.canUp,
|
|
3798
|
+
title: "Move this chunk up within its level",
|
|
3799
|
+
children: "↑"
|
|
3800
|
+
}), /* @__PURE__ */ l("button", {
|
|
3801
|
+
type: "button",
|
|
3802
|
+
onClick: () => void vt("down"),
|
|
3803
|
+
disabled: !_t.canDown,
|
|
3804
|
+
title: "Move this chunk down within its level",
|
|
3805
|
+
children: "↓"
|
|
3806
|
+
})] }),
|
|
3807
|
+
!Y && /* @__PURE__ */ l("button", {
|
|
3808
|
+
type: "button",
|
|
3809
|
+
className: "danger",
|
|
3810
|
+
onClick: () => se(!0),
|
|
3811
|
+
title: "Delete this chunk and its sub-chunks",
|
|
3812
|
+
children: "delete"
|
|
3813
|
+
})
|
|
3814
|
+
]
|
|
3815
|
+
})
|
|
3816
|
+
]
|
|
3817
|
+
}), /* @__PURE__ */ u(Wt, {
|
|
3818
|
+
storageKey: "loomcycle.explorer.doc-links-height",
|
|
3819
|
+
className: "doc-content-split",
|
|
3820
|
+
children: [/* @__PURE__ */ l("div", {
|
|
3743
3821
|
className: "doc-content-body",
|
|
3744
|
-
children: E.type === "mermaid" ? E.body ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(
|
|
3822
|
+
children: E.type === "mermaid" ? E.body ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(it, { code: E.body }), O === "markdown" && /* @__PURE__ */ l("pre", {
|
|
3745
3823
|
className: "md-pre doc-mermaid-source",
|
|
3746
3824
|
children: /* @__PURE__ */ l("code", { children: E.body })
|
|
3747
3825
|
})] }) : /* @__PURE__ */ l("p", {
|
|
@@ -3754,7 +3832,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3754
3832
|
className: "doc-image",
|
|
3755
3833
|
children: [/* @__PURE__ */ l("img", {
|
|
3756
3834
|
src: N,
|
|
3757
|
-
alt:
|
|
3835
|
+
alt: Zt(E)
|
|
3758
3836
|
}), E.body && /* @__PURE__ */ l("figcaption", { children: E.body })]
|
|
3759
3837
|
}) : /* @__PURE__ */ l("p", {
|
|
3760
3838
|
className: "doc-empty-body",
|
|
@@ -3762,31 +3840,32 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3762
3840
|
}) : O === "markdown" ? A === null ? /* @__PURE__ */ l("p", {
|
|
3763
3841
|
className: "doc-empty-body",
|
|
3764
3842
|
children: "Assembling Markdown…"
|
|
3765
|
-
}) : /* @__PURE__ */ l(
|
|
3843
|
+
}) : /* @__PURE__ */ l(Yt, { source: A }) : E.body ? /* @__PURE__ */ l(Yt, { source: E.body }) : /* @__PURE__ */ l("p", {
|
|
3766
3844
|
className: "doc-empty-body",
|
|
3767
3845
|
children: "(empty chunk)"
|
|
3768
3846
|
})
|
|
3769
|
-
}),
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3847
|
+
}), /* @__PURE__ */ u("div", {
|
|
3848
|
+
className: "doc-links-pane",
|
|
3849
|
+
children: [/* @__PURE__ */ l(It, {
|
|
3850
|
+
edges: K,
|
|
3851
|
+
incomplete: Ce,
|
|
3852
|
+
documentId: e,
|
|
3853
|
+
selectedId: w,
|
|
3854
|
+
onSelectChunk: T,
|
|
3855
|
+
onOpenDocument: h ? lt : void 0,
|
|
3856
|
+
onRuleStatement: qe
|
|
3857
|
+
}), /* @__PURE__ */ l(Pt, {
|
|
3858
|
+
documentId: e,
|
|
3859
|
+
selectedId: w,
|
|
3860
|
+
scope: n,
|
|
3861
|
+
browse: x,
|
|
3862
|
+
onSelectChunk: T,
|
|
3863
|
+
onOpenDocument: h ? lt : void 0,
|
|
3864
|
+
refreshKey: q,
|
|
3865
|
+
review: et
|
|
3866
|
+
})]
|
|
3867
|
+
})]
|
|
3868
|
+
})] }) : /* @__PURE__ */ l("div", {
|
|
3790
3869
|
className: "empty",
|
|
3791
3870
|
children: /* @__PURE__ */ l("p", { children: "Select a chunk on the left." })
|
|
3792
3871
|
})
|
|
@@ -3801,28 +3880,28 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3801
3880
|
onChanged: J
|
|
3802
3881
|
})
|
|
3803
3882
|
}),
|
|
3804
|
-
ne && /* @__PURE__ */ l(
|
|
3883
|
+
ne && /* @__PURE__ */ l(at, {
|
|
3805
3884
|
chunk: ne,
|
|
3806
3885
|
scope: n,
|
|
3807
3886
|
browse: x,
|
|
3808
3887
|
onClose: () => re(null),
|
|
3809
3888
|
onSaved: J
|
|
3810
3889
|
}),
|
|
3811
|
-
ie && /* @__PURE__ */ l(
|
|
3890
|
+
ie && /* @__PURE__ */ l(ot, {
|
|
3812
3891
|
chunk: ie,
|
|
3813
3892
|
scope: n,
|
|
3814
3893
|
browse: x,
|
|
3815
3894
|
onClose: () => ae(null),
|
|
3816
3895
|
onSaved: J
|
|
3817
3896
|
}),
|
|
3818
|
-
I && E && /* @__PURE__ */ l(
|
|
3897
|
+
I && E && /* @__PURE__ */ l(qt, {
|
|
3819
3898
|
chunkId: E.id,
|
|
3820
3899
|
chunkTitle: E.title,
|
|
3821
3900
|
scope: n,
|
|
3822
3901
|
browse: x,
|
|
3823
3902
|
onClose: () => L(!1)
|
|
3824
3903
|
}),
|
|
3825
|
-
G && X && /* @__PURE__ */ l(
|
|
3904
|
+
G && X && /* @__PURE__ */ l(Ct, {
|
|
3826
3905
|
documentId: e,
|
|
3827
3906
|
rootChunkId: X,
|
|
3828
3907
|
docType: W?.type,
|
|
@@ -3858,7 +3937,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3858
3937
|
}), /* @__PURE__ */ l("button", {
|
|
3859
3938
|
type: "button",
|
|
3860
3939
|
className: "danger",
|
|
3861
|
-
onClick: () => void
|
|
3940
|
+
onClick: () => void yt(),
|
|
3862
3941
|
children: "delete"
|
|
3863
3942
|
})]
|
|
3864
3943
|
})
|
|
@@ -3870,7 +3949,7 @@ function Jt({ documentId: e, scope: n, titleHint: s, browse: d, principal: f, re
|
|
|
3870
3949
|
}
|
|
3871
3950
|
//#endregion
|
|
3872
3951
|
//#region src/components/PathTree.tsx
|
|
3873
|
-
function
|
|
3952
|
+
function $t(e, t = "") {
|
|
3874
3953
|
let n = e.get(t);
|
|
3875
3954
|
if (!n) return [];
|
|
3876
3955
|
let r = n.entries.map((n) => {
|
|
@@ -3881,7 +3960,7 @@ function Yt(e, t = "") {
|
|
|
3881
3960
|
kind: n.kind,
|
|
3882
3961
|
resourceRef: n.resource_ref,
|
|
3883
3962
|
listing: r ? e.get(n.full_path) : void 0,
|
|
3884
|
-
children: r ?
|
|
3963
|
+
children: r ? $t(e, n.full_path) : []
|
|
3885
3964
|
};
|
|
3886
3965
|
});
|
|
3887
3966
|
return r.sort((e, t) => {
|
|
@@ -3889,13 +3968,13 @@ function Yt(e, t = "") {
|
|
|
3889
3968
|
return n === (t.kind === "directory") ? e.name.localeCompare(t.name) : n ? -1 : 1;
|
|
3890
3969
|
}), r;
|
|
3891
3970
|
}
|
|
3892
|
-
var
|
|
3971
|
+
var en = {
|
|
3893
3972
|
directory: "📁",
|
|
3894
3973
|
document: "📄",
|
|
3895
3974
|
volume_mount: "💾",
|
|
3896
3975
|
memory_entry: "🧠"
|
|
3897
3976
|
};
|
|
3898
|
-
function
|
|
3977
|
+
function tn(e) {
|
|
3899
3978
|
let { tree: t, root: n } = e;
|
|
3900
3979
|
return !n || !n.loaded && n.loading ? /* @__PURE__ */ l("div", {
|
|
3901
3980
|
className: "empty",
|
|
@@ -3905,17 +3984,17 @@ function Zt(e) {
|
|
|
3905
3984
|
children: /* @__PURE__ */ l("p", { children: "This tree is empty. Create a folder or document to begin." })
|
|
3906
3985
|
}) : /* @__PURE__ */ u("ul", {
|
|
3907
3986
|
className: "tree path-tree",
|
|
3908
|
-
children: [t.map((t) => /* @__PURE__ */ l(
|
|
3987
|
+
children: [t.map((t) => /* @__PURE__ */ l(an, {
|
|
3909
3988
|
node: t,
|
|
3910
3989
|
...e
|
|
3911
|
-
}, t.fullPath)), /* @__PURE__ */ l(
|
|
3990
|
+
}, t.fullPath)), /* @__PURE__ */ l(nn, {
|
|
3912
3991
|
dir: "",
|
|
3913
3992
|
listing: n,
|
|
3914
3993
|
...e
|
|
3915
3994
|
})]
|
|
3916
3995
|
});
|
|
3917
3996
|
}
|
|
3918
|
-
function
|
|
3997
|
+
function nn({ dir: e, listing: t, onLoadMore: n, onRetry: r }) {
|
|
3919
3998
|
let i = [];
|
|
3920
3999
|
return !t || t.loading && t.entries.length === 0 ? i.push(/* @__PURE__ */ l("li", {
|
|
3921
4000
|
className: "node path-status",
|
|
@@ -3955,13 +4034,13 @@ function Qt({ dir: e, listing: t, onLoadMore: n, onRetry: r }) {
|
|
|
3955
4034
|
})
|
|
3956
4035
|
}, "more")), /* @__PURE__ */ l(c, { children: i });
|
|
3957
4036
|
}
|
|
3958
|
-
function
|
|
4037
|
+
function rn(e, t) {
|
|
3959
4038
|
if (e.kind !== "document" || !t) return;
|
|
3960
4039
|
let n = e.resourceRef;
|
|
3961
4040
|
return n?.document_id ? t.get(n.document_id) : void 0;
|
|
3962
4041
|
}
|
|
3963
|
-
function
|
|
3964
|
-
let { node: t, expanded: n, onToggle: r, selectedPath: i, onSelect: a, summaries: o } = e, s = t.kind === "directory", c = s && n.has(t.fullPath), d = i === t.fullPath, f =
|
|
4042
|
+
function an(e) {
|
|
4043
|
+
let { node: t, expanded: n, onToggle: r, selectedPath: i, onSelect: a, summaries: o } = e, s = t.kind === "directory", c = s && n.has(t.fullPath), d = i === t.fullPath, f = rn(t, o), p = f && f.color_enabled ? Ke(He(f.type, f.status, Be(f.color_scheme))) : void 0;
|
|
3965
4044
|
return /* @__PURE__ */ u("li", {
|
|
3966
4045
|
className: `node path-node kind-${t.kind} ${d ? "selected" : ""}`,
|
|
3967
4046
|
children: [/* @__PURE__ */ u("div", {
|
|
@@ -3986,7 +4065,7 @@ function en(e) {
|
|
|
3986
4065
|
/* @__PURE__ */ l("span", {
|
|
3987
4066
|
className: "path-kind-icon",
|
|
3988
4067
|
"aria-hidden": !0,
|
|
3989
|
-
children:
|
|
4068
|
+
children: en[t.kind] ?? "•"
|
|
3990
4069
|
}),
|
|
3991
4070
|
/* @__PURE__ */ l("span", {
|
|
3992
4071
|
className: "path-name",
|
|
@@ -4004,10 +4083,10 @@ function en(e) {
|
|
|
4004
4083
|
})]
|
|
4005
4084
|
}), c && /* @__PURE__ */ u("ul", {
|
|
4006
4085
|
className: "children path-children",
|
|
4007
|
-
children: [t.children.map((t) => /* @__PURE__ */ l(
|
|
4086
|
+
children: [t.children.map((t) => /* @__PURE__ */ l(an, {
|
|
4008
4087
|
...e,
|
|
4009
4088
|
node: t
|
|
4010
|
-
}, t.fullPath)), /* @__PURE__ */ l(
|
|
4089
|
+
}, t.fullPath)), /* @__PURE__ */ l(nn, {
|
|
4011
4090
|
...e,
|
|
4012
4091
|
dir: t.fullPath,
|
|
4013
4092
|
listing: t.listing
|
|
@@ -4017,23 +4096,23 @@ function en(e) {
|
|
|
4017
4096
|
}
|
|
4018
4097
|
//#endregion
|
|
4019
4098
|
//#region src/PathExplorer.tsx
|
|
4020
|
-
var
|
|
4021
|
-
function
|
|
4099
|
+
var on = /^[A-Za-z0-9._-]+$/;
|
|
4100
|
+
function sn(e, t) {
|
|
4022
4101
|
return `${e}/${t}`;
|
|
4023
4102
|
}
|
|
4024
|
-
function
|
|
4103
|
+
function cn(e, t) {
|
|
4025
4104
|
for (let n of e) {
|
|
4026
4105
|
if (n.fullPath === t) return n;
|
|
4027
|
-
let e =
|
|
4106
|
+
let e = cn(n.children, t);
|
|
4028
4107
|
if (e) return e;
|
|
4029
4108
|
}
|
|
4030
4109
|
}
|
|
4031
|
-
function
|
|
4110
|
+
function ln(e) {
|
|
4032
4111
|
let { theme: t, defaultScope: n, path: r, onPathChange: i, browse: a, principal: o, renderAssistant: s, renderNavigator: c, navigator: u, onError: d } = e, f = R(e);
|
|
4033
4112
|
return /* @__PURE__ */ l(z, {
|
|
4034
4113
|
theme: t,
|
|
4035
4114
|
dataLayer: f,
|
|
4036
|
-
children: /* @__PURE__ */ l(
|
|
4115
|
+
children: /* @__PURE__ */ l(un, {
|
|
4037
4116
|
defaultScope: n,
|
|
4038
4117
|
path: r,
|
|
4039
4118
|
onPathChange: i,
|
|
@@ -4046,7 +4125,7 @@ function an(e) {
|
|
|
4046
4125
|
})
|
|
4047
4126
|
});
|
|
4048
4127
|
}
|
|
4049
|
-
function
|
|
4128
|
+
function un({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p, renderAssistant: m, renderNavigator: _, navigator: v, onError: y }) {
|
|
4050
4129
|
let b = M(), [x, S] = o(e ?? "user"), [C, w] = o(void 0), [T, E] = o(null), [D, O] = o(null), [k, A] = o(null), [j, N] = o(() => /* @__PURE__ */ new Set()), P = n === void 0 ? C : n, te = a(d);
|
|
4051
4130
|
r(() => {
|
|
4052
4131
|
te.current = d;
|
|
@@ -4111,7 +4190,6 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4111
4190
|
P,
|
|
4112
4191
|
U
|
|
4113
4192
|
]), r(() => {
|
|
4114
|
-
if (x === "tenant") return;
|
|
4115
4193
|
let e = [];
|
|
4116
4194
|
for (let t of H.values()) for (let n of ae(t.entries)) De.current.has(n) || (De.current.add(n), e.push(n));
|
|
4117
4195
|
let t = Oe.current;
|
|
@@ -4128,7 +4206,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4128
4206
|
x,
|
|
4129
4207
|
B
|
|
4130
4208
|
]);
|
|
4131
|
-
let je = i(() =>
|
|
4209
|
+
let je = i(() => $t(H), [H]), Me = t(async () => {
|
|
4132
4210
|
E(null), ke(), xe((e) => e + 1), await V.refresh(j).catch(U), P && await V.reveal(P).catch(U);
|
|
4133
4211
|
}, [
|
|
4134
4212
|
V,
|
|
@@ -4143,7 +4221,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4143
4221
|
});
|
|
4144
4222
|
}, []), Y = t((e) => V.loadMore(e).catch(U), [V, U]), Pe = t((e) => {
|
|
4145
4223
|
(V.getSnapshot().get(e)?.loaded ? V.loadMore(e) : V.loadDir(e)).catch(U);
|
|
4146
|
-
}, [V, U]), X = i(() => P ?
|
|
4224
|
+
}, [V, U]), X = i(() => P ? cn(je, P) : void 0, [je, P]), Fe = H.get("")?.error, Ie = X?.kind === "directory" ? X.fullPath : void 0, [Le, Re] = o(null);
|
|
4147
4225
|
r(() => {
|
|
4148
4226
|
if (!Ie || !b.pathIsStored) return;
|
|
4149
4227
|
let e = !1;
|
|
@@ -4161,7 +4239,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4161
4239
|
x,
|
|
4162
4240
|
B
|
|
4163
4241
|
]);
|
|
4164
|
-
let ze = X ? X.kind === "directory" ? Le?.path === X.fullPath ? Le.explicit ? "yes" : "implicit (no entry)" : void 0 : "yes" : void 0, Z = i(() => X ? X.kind === "directory" ? X.fullPath : F(X.fullPath) : "", [X]), Q = Z || "/", Be =
|
|
4242
|
+
let ze = X ? X.kind === "directory" ? Le?.path === X.fullPath ? Le.explicit ? "yes" : "implicit (no entry)" : void 0 : "yes" : void 0, Z = i(() => X ? X.kind === "directory" ? X.fullPath : F(X.fullPath) : "", [X]), Q = Z || "/", Be = t(() => {
|
|
4165
4243
|
O({
|
|
4166
4244
|
title: `New folder in ${Q}`,
|
|
4167
4245
|
fields: [{
|
|
@@ -4172,8 +4250,8 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4172
4250
|
submitLabel: "Create",
|
|
4173
4251
|
onSubmit: async (e) => {
|
|
4174
4252
|
let t = e.name.trim();
|
|
4175
|
-
if (!
|
|
4176
|
-
let n =
|
|
4253
|
+
if (!on.test(t)) throw Error("name may contain only [A-Za-z0-9._-]");
|
|
4254
|
+
let n = sn(Z, t);
|
|
4177
4255
|
await b.pathMkdir(n, x, B), await q(n).catch(U), z(n);
|
|
4178
4256
|
}
|
|
4179
4257
|
});
|
|
@@ -4186,7 +4264,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4186
4264
|
B,
|
|
4187
4265
|
U,
|
|
4188
4266
|
z
|
|
4189
|
-
]),
|
|
4267
|
+
]), Ve = t(() => {
|
|
4190
4268
|
O({
|
|
4191
4269
|
title: `New document in ${Q}`,
|
|
4192
4270
|
fields: [{
|
|
@@ -4201,8 +4279,8 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4201
4279
|
submitLabel: "Create",
|
|
4202
4280
|
onSubmit: async (e) => {
|
|
4203
4281
|
let t = e.name.trim();
|
|
4204
|
-
if (!
|
|
4205
|
-
let n = e.title.trim() || t, r =
|
|
4282
|
+
if (!on.test(t)) throw Error("name may contain only [A-Za-z0-9._-]");
|
|
4283
|
+
let n = e.title.trim() || t, r = sn(Z, t);
|
|
4206
4284
|
await b.documentCreate(n, r, x, B), await q(r).catch(U), z(r);
|
|
4207
4285
|
}
|
|
4208
4286
|
});
|
|
@@ -4215,7 +4293,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4215
4293
|
B,
|
|
4216
4294
|
U,
|
|
4217
4295
|
z
|
|
4218
|
-
]),
|
|
4296
|
+
]), He = t(() => {
|
|
4219
4297
|
X && O({
|
|
4220
4298
|
title: `Rename / move ${X.fullPath}`,
|
|
4221
4299
|
fields: [{
|
|
@@ -4238,7 +4316,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4238
4316
|
B,
|
|
4239
4317
|
U,
|
|
4240
4318
|
z
|
|
4241
|
-
]),
|
|
4319
|
+
]), Ue = t(() => {
|
|
4242
4320
|
if (!X) return;
|
|
4243
4321
|
if (X.kind === "document") {
|
|
4244
4322
|
let e = X.resourceRef?.document_id;
|
|
@@ -4264,7 +4342,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4264
4342
|
E(`could not list ${e.fullPath} for delete: ${t instanceof Error ? t.message : String(t)}`);
|
|
4265
4343
|
return;
|
|
4266
4344
|
}
|
|
4267
|
-
let n =
|
|
4345
|
+
let n = ae(t);
|
|
4268
4346
|
O({
|
|
4269
4347
|
title: `Delete branch ${e.fullPath}`,
|
|
4270
4348
|
message: t.length === 0 ? "This removes the (empty) folder." : "This removes the folder and everything under it" + (n.length > 0 ? ` — including ${n.length} document(s), whose chunks are deleted.` : "."),
|
|
@@ -4285,7 +4363,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4285
4363
|
B,
|
|
4286
4364
|
U,
|
|
4287
4365
|
z
|
|
4288
|
-
]),
|
|
4366
|
+
]), We = X && (X.kind === "directory" || X.kind === "document"), Ge = !!b.documentsTransfer && !!We, Ke = t(() => {
|
|
4289
4367
|
if (X) {
|
|
4290
4368
|
if (X.kind === "document") {
|
|
4291
4369
|
let e = X.resourceRef?.document_id;
|
|
@@ -4302,7 +4380,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4302
4380
|
fromPath: X.fullPath
|
|
4303
4381
|
});
|
|
4304
4382
|
}
|
|
4305
|
-
}, [X]),
|
|
4383
|
+
}, [X]), qe = t((e) => {
|
|
4306
4384
|
e.op === "move" ? (q(e.from, { dropSubtree: !0 }).catch(U), L([]), z(void 0)) : e.toScope === x && q(e.to).catch(U);
|
|
4307
4385
|
}, [
|
|
4308
4386
|
q,
|
|
@@ -4316,7 +4394,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4316
4394
|
path: X.fullPath,
|
|
4317
4395
|
title: X.name
|
|
4318
4396
|
};
|
|
4319
|
-
}, [I, X]),
|
|
4397
|
+
}, [I, X]), Je = t((e, t) => {
|
|
4320
4398
|
let n = ++oe.current, r = fe(V.getSnapshot(), e.documentId);
|
|
4321
4399
|
L(ce(I, {
|
|
4322
4400
|
...t,
|
|
@@ -4335,10 +4413,10 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4335
4413
|
x,
|
|
4336
4414
|
B,
|
|
4337
4415
|
R
|
|
4338
|
-
]),
|
|
4416
|
+
]), Ye = t((e) => {
|
|
4339
4417
|
let t = le(I, e);
|
|
4340
4418
|
t !== I && (oe.current++, L(t), R(t[t.length - 1].path));
|
|
4341
|
-
}, [I, R]),
|
|
4419
|
+
}, [I, R]), Xe = t((e, t) => L((n) => ue(n, e, { title: t })), []), Ze = t((e) => {
|
|
4342
4420
|
we((t) => ({
|
|
4343
4421
|
documentId: e.documentId,
|
|
4344
4422
|
chunkId: e.chunkId,
|
|
@@ -4351,7 +4429,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4351
4429
|
$?.documentId,
|
|
4352
4430
|
z,
|
|
4353
4431
|
R
|
|
4354
|
-
]),
|
|
4432
|
+
]), Qe = i(() => ({
|
|
4355
4433
|
scope: x,
|
|
4356
4434
|
browse: B,
|
|
4357
4435
|
selection: {
|
|
@@ -4359,7 +4437,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4359
4437
|
chunkId: K && K.documentId === $?.documentId ? K.chunkId : void 0,
|
|
4360
4438
|
path: $?.path
|
|
4361
4439
|
},
|
|
4362
|
-
onSelect:
|
|
4440
|
+
onSelect: Ze,
|
|
4363
4441
|
reloadToken: be,
|
|
4364
4442
|
maximized: ve,
|
|
4365
4443
|
onToggleMaximize: () => ye((e) => !e),
|
|
@@ -4370,11 +4448,11 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4370
4448
|
$?.documentId,
|
|
4371
4449
|
$?.path,
|
|
4372
4450
|
K,
|
|
4373
|
-
|
|
4451
|
+
Ze,
|
|
4374
4452
|
be,
|
|
4375
4453
|
ve,
|
|
4376
4454
|
p?.subject
|
|
4377
|
-
]),
|
|
4455
|
+
]), $e = Ce && $ && Ce.documentId === $.documentId ? Ce : void 0, et = !!$?.path && X?.kind === "document" && X.fullPath === $.path;
|
|
4378
4456
|
return /* @__PURE__ */ u(c, { children: [
|
|
4379
4457
|
/* @__PURE__ */ u(he, {
|
|
4380
4458
|
className: G ? "paths-view paths-view--stars" : "paths-view",
|
|
@@ -4434,14 +4512,13 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4434
4512
|
className: "paths-toolbar-actions",
|
|
4435
4513
|
children: [!G && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
|
|
4436
4514
|
type: "button",
|
|
4437
|
-
onClick:
|
|
4515
|
+
onClick: Be,
|
|
4438
4516
|
title: `New folder in ${Q}`,
|
|
4439
4517
|
children: "+ folder"
|
|
4440
4518
|
}), /* @__PURE__ */ l("button", {
|
|
4441
4519
|
type: "button",
|
|
4442
|
-
onClick:
|
|
4443
|
-
|
|
4444
|
-
title: Be ? `New document in ${Q}` : "Documents are agent/user scope only",
|
|
4520
|
+
onClick: Ve,
|
|
4521
|
+
title: `New document in ${Q}`,
|
|
4445
4522
|
children: "+ document"
|
|
4446
4523
|
})] }), /* @__PURE__ */ l("button", {
|
|
4447
4524
|
type: "button",
|
|
@@ -4475,8 +4552,8 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4475
4552
|
}),
|
|
4476
4553
|
G && _ ? /* @__PURE__ */ l("div", {
|
|
4477
4554
|
className: "paths-navigator",
|
|
4478
|
-
children: _(
|
|
4479
|
-
}) : /* @__PURE__ */ l(
|
|
4555
|
+
children: _(Qe)
|
|
4556
|
+
}) : /* @__PURE__ */ l(tn, {
|
|
4480
4557
|
tree: je,
|
|
4481
4558
|
root: H.get(""),
|
|
4482
4559
|
expanded: j,
|
|
@@ -4495,7 +4572,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4495
4572
|
children: [
|
|
4496
4573
|
/* @__PURE__ */ l(pe, {
|
|
4497
4574
|
trail: I,
|
|
4498
|
-
onJump:
|
|
4575
|
+
onJump: Ye
|
|
4499
4576
|
}),
|
|
4500
4577
|
/* @__PURE__ */ u("div", {
|
|
4501
4578
|
className: "paths-doc-head",
|
|
@@ -4510,44 +4587,44 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4510
4587
|
" ",
|
|
4511
4588
|
/* @__PURE__ */ l("em", { children: "· opened by id, not in the tree" })
|
|
4512
4589
|
]
|
|
4513
|
-
}),
|
|
4590
|
+
}), et && /* @__PURE__ */ u("div", {
|
|
4514
4591
|
className: "paths-detail-actions",
|
|
4515
4592
|
children: [
|
|
4516
4593
|
/* @__PURE__ */ l("button", {
|
|
4517
4594
|
type: "button",
|
|
4518
|
-
onClick:
|
|
4595
|
+
onClick: He,
|
|
4519
4596
|
children: "rename / move"
|
|
4520
4597
|
}),
|
|
4521
|
-
|
|
4598
|
+
Ge && /* @__PURE__ */ l("button", {
|
|
4522
4599
|
type: "button",
|
|
4523
|
-
onClick:
|
|
4600
|
+
onClick: Ke,
|
|
4524
4601
|
title: "Copy or move to another scope",
|
|
4525
4602
|
children: "copy / move to…"
|
|
4526
4603
|
}),
|
|
4527
4604
|
/* @__PURE__ */ l("button", {
|
|
4528
4605
|
type: "button",
|
|
4529
4606
|
className: "danger",
|
|
4530
|
-
onClick:
|
|
4607
|
+
onClick: Ue,
|
|
4531
4608
|
children: "delete"
|
|
4532
4609
|
})
|
|
4533
4610
|
]
|
|
4534
4611
|
})]
|
|
4535
4612
|
}),
|
|
4536
|
-
/* @__PURE__ */ l(
|
|
4613
|
+
/* @__PURE__ */ l(Qt, {
|
|
4537
4614
|
documentId: $.documentId,
|
|
4538
4615
|
scope: x,
|
|
4539
4616
|
titleHint: $.title,
|
|
4540
4617
|
browse: B,
|
|
4541
4618
|
principal: p,
|
|
4542
4619
|
renderAssistant: m,
|
|
4543
|
-
initialChunkId: $.chunkId ??
|
|
4544
|
-
onOpenDocument:
|
|
4545
|
-
onTitle:
|
|
4620
|
+
initialChunkId: $.chunkId ?? $e?.chunkId,
|
|
4621
|
+
onOpenDocument: Je,
|
|
4622
|
+
onTitle: Xe,
|
|
4546
4623
|
onChunkSelect: (e) => Se({
|
|
4547
4624
|
documentId: $.documentId,
|
|
4548
4625
|
chunkId: e
|
|
4549
4626
|
}),
|
|
4550
|
-
focusChunk:
|
|
4627
|
+
focusChunk: $e
|
|
4551
4628
|
}, I.length)
|
|
4552
4629
|
]
|
|
4553
4630
|
}) : X ? /* @__PURE__ */ u("div", {
|
|
@@ -4565,24 +4642,24 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4565
4642
|
ze && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("dt", { children: "stored" }), /* @__PURE__ */ l("dd", { children: ze })] })
|
|
4566
4643
|
]
|
|
4567
4644
|
}),
|
|
4568
|
-
|
|
4645
|
+
We ? /* @__PURE__ */ u("div", {
|
|
4569
4646
|
className: "paths-detail-actions",
|
|
4570
4647
|
children: [
|
|
4571
4648
|
/* @__PURE__ */ l("button", {
|
|
4572
4649
|
type: "button",
|
|
4573
|
-
onClick:
|
|
4650
|
+
onClick: He,
|
|
4574
4651
|
children: "rename / move"
|
|
4575
4652
|
}),
|
|
4576
|
-
|
|
4653
|
+
Ge && /* @__PURE__ */ l("button", {
|
|
4577
4654
|
type: "button",
|
|
4578
|
-
onClick:
|
|
4655
|
+
onClick: Ke,
|
|
4579
4656
|
title: "Copy or move to another scope",
|
|
4580
4657
|
children: "copy / move to…"
|
|
4581
4658
|
}),
|
|
4582
4659
|
/* @__PURE__ */ l("button", {
|
|
4583
4660
|
type: "button",
|
|
4584
4661
|
className: "danger",
|
|
4585
|
-
onClick:
|
|
4662
|
+
onClick: Ue,
|
|
4586
4663
|
children: "delete"
|
|
4587
4664
|
})
|
|
4588
4665
|
]
|
|
@@ -4601,7 +4678,7 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4601
4678
|
})
|
|
4602
4679
|
})]
|
|
4603
4680
|
}),
|
|
4604
|
-
D && /* @__PURE__ */ l(
|
|
4681
|
+
D && /* @__PURE__ */ l(dn, {
|
|
4605
4682
|
state: D,
|
|
4606
4683
|
onClose: () => O(null)
|
|
4607
4684
|
}),
|
|
@@ -4613,11 +4690,11 @@ function on({ defaultScope: e, path: n, onPathChange: d, browse: f, principal: p
|
|
|
4613
4690
|
underPath: k.underPath,
|
|
4614
4691
|
fromPath: k.fromPath,
|
|
4615
4692
|
onClose: () => A(null),
|
|
4616
|
-
onDone:
|
|
4693
|
+
onDone: qe
|
|
4617
4694
|
})
|
|
4618
4695
|
] });
|
|
4619
4696
|
}
|
|
4620
|
-
function
|
|
4697
|
+
function dn({ state: e, onClose: t }) {
|
|
4621
4698
|
let [n, r] = o(() => Object.fromEntries(e.fields.map((e) => [e.key, e.value ?? ""]))), [i, a] = o(!1), [s, c] = o(null);
|
|
4622
4699
|
return /* @__PURE__ */ l("div", {
|
|
4623
4700
|
className: "modal-overlay",
|
|
@@ -4678,34 +4755,42 @@ function sn({ state: e, onClose: t }) {
|
|
|
4678
4755
|
}
|
|
4679
4756
|
//#endregion
|
|
4680
4757
|
//#region src/DocumentViewer.tsx
|
|
4681
|
-
function
|
|
4758
|
+
function fn(e) {
|
|
4682
4759
|
let { documentId: t, scope: n, browse: r, theme: i } = e, a = R(e);
|
|
4683
4760
|
return /* @__PURE__ */ l(z, {
|
|
4684
4761
|
theme: i,
|
|
4685
4762
|
dataLayer: a,
|
|
4686
|
-
children: /* @__PURE__ */ l(
|
|
4763
|
+
children: /* @__PURE__ */ l(pn, { ...e }, `${n}:${t}:${r?.scopeId ?? ""}:${r?.tenant ?? ""}`)
|
|
4687
4764
|
});
|
|
4688
4765
|
}
|
|
4689
|
-
function
|
|
4690
|
-
let [
|
|
4691
|
-
|
|
4692
|
-
|
|
4766
|
+
function pn({ documentId: e, chunkId: n, scope: i, titleHint: s, browse: d, principal: f, renderAssistant: p, onOpenDocument: m }) {
|
|
4767
|
+
let [h, g] = o([]), _ = h[h.length - 1], [v, y] = o(), b = a(n);
|
|
4768
|
+
r(() => {
|
|
4769
|
+
n !== b.current && (b.current = n, h.length > 0 ? (y(void 0), g([])) : y((e) => ({
|
|
4770
|
+
chunkId: n,
|
|
4771
|
+
seq: (e?.seq ?? 0) + 1
|
|
4772
|
+
})));
|
|
4773
|
+
}, [n]);
|
|
4774
|
+
let x = t((e, t) => {
|
|
4775
|
+
m ? m(e, t) : g((n) => ce(n, t, e));
|
|
4776
|
+
}, [m]), S = t((e) => g((t) => le(t, e)), []), C = t((e, t) => g((n) => ue(n, e, { title: t })), []);
|
|
4693
4777
|
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(pe, {
|
|
4694
|
-
trail:
|
|
4695
|
-
onJump:
|
|
4696
|
-
}), /* @__PURE__ */ l(
|
|
4697
|
-
documentId:
|
|
4698
|
-
scope:
|
|
4699
|
-
titleHint:
|
|
4700
|
-
browse:
|
|
4701
|
-
principal:
|
|
4702
|
-
renderAssistant:
|
|
4703
|
-
initialChunkId:
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4778
|
+
trail: h,
|
|
4779
|
+
onJump: S
|
|
4780
|
+
}), /* @__PURE__ */ l(Qt, {
|
|
4781
|
+
documentId: _?.documentId ?? e,
|
|
4782
|
+
scope: i,
|
|
4783
|
+
titleHint: _ ? _.title : s,
|
|
4784
|
+
browse: d,
|
|
4785
|
+
principal: f,
|
|
4786
|
+
renderAssistant: p,
|
|
4787
|
+
initialChunkId: _ ? _.chunkId : n,
|
|
4788
|
+
focusChunk: _ ? void 0 : v,
|
|
4789
|
+
onOpenDocument: x,
|
|
4790
|
+
onTitle: C
|
|
4791
|
+
}, h.length)] });
|
|
4707
4792
|
}
|
|
4708
4793
|
//#endregion
|
|
4709
|
-
export { Z as DEFAULT_SCHEME,
|
|
4794
|
+
export { Z as DEFAULT_SCHEME, fn as DocumentViewer, ye as EDGE_PAGE_CAP, ln as PathExplorer, Ae as QUEUE_CHANGED_RETRIES, J as RULING_CHUNK, oe as RequestError, L as assetFetchFromConnection, Ue as chunkColor, Pe as chunkCount, We as chunkInheritsDocColor, $ as chunkRowStyle, I as createLoomcycleClient, O as dataLayerFromClient, He as docColor, Be as effectiveScheme, Ge as hexToTint, Me as isQueueChanged, se as jsonPostFromConnection, be as loadDocumentEdges, Ne as runRuling, Ke as tintStyle, b as transferInput, Y as undoRulings, qe as washStyle };
|
|
4710
4795
|
|
|
4711
4796
|
//# sourceMappingURL=index.js.map
|