book-index-ui 0.2.12 → 0.2.13
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 +3 -3
- package/dist/index.d.ts +4 -0
- package/dist/index.js +757 -760
- package/dist/{storage-entry-sPrgfaS5.cjs → storage-entry-QB1IoDUU.cjs} +1 -1
- package/dist/{storage-entry-CWocbrbM.js → storage-entry-UQLfmeLb.js} +250 -221
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.ts +4 -0
- package/dist/storage.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { e as Vt, a as gn } from "./storage-entry-
|
|
2
|
-
import { B as Ei, b as $i, c as
|
|
1
|
+
import { e as Vt, a as gn } from "./storage-entry-UQLfmeLb.js";
|
|
2
|
+
import { B as Ei, b as $i, c as Ai, d as Pi, f as Mi, C as Hi, G as Oi, I as Di, g as ji, L as Fi, M as Ui, S as Vi, h as Ni, i as Ki, j as Yi, k as Gi, l as Ji, m as qi, n as Zi, o as Xi, p as Qi, q as el, s as tl, v as nl } from "./storage-entry-UQLfmeLb.js";
|
|
3
3
|
import { jsx as t, jsxs as i, Fragment as j } from "react/jsx-runtime";
|
|
4
|
-
import rt, { createContext as Nt, useMemo as
|
|
4
|
+
import rt, { createContext as Nt, useMemo as ce, useContext as Ve, useState as w, useEffect as $, useCallback as F, useRef as Q } from "react";
|
|
5
5
|
import { createPortal as hn } from "react-dom";
|
|
6
6
|
const xn = (e) => `/book-index?id=${e}`, Kt = Nt(xn);
|
|
7
7
|
function Si({ buildUrl: e, children: n }) {
|
|
8
|
-
const o =
|
|
8
|
+
const o = ce(() => e, [e]);
|
|
9
9
|
return /* @__PURE__ */ t(Kt.Provider, { value: o, children: n });
|
|
10
10
|
}
|
|
11
11
|
function de() {
|
|
@@ -619,13 +619,13 @@ const _n = "zh-Hant", wi = ({
|
|
|
619
619
|
children: o
|
|
620
620
|
}) => {
|
|
621
621
|
const [r, a] = w(e ?? _n), l = e ?? r;
|
|
622
|
-
|
|
622
|
+
$(() => {
|
|
623
623
|
if (e) return;
|
|
624
624
|
const g = Sn();
|
|
625
625
|
g && g !== r && a(g);
|
|
626
626
|
}, []);
|
|
627
627
|
const [c, s] = w(null);
|
|
628
|
-
|
|
628
|
+
$(() => {
|
|
629
629
|
l === "zh-Hans" ? import("opencc-js/t2cn").then((g) => {
|
|
630
630
|
const f = g.Converter({ from: "tw", to: "cn" });
|
|
631
631
|
s(() => f);
|
|
@@ -633,9 +633,9 @@ const _n = "zh-Hant", wi = ({
|
|
|
633
633
|
s(() => (g) => g);
|
|
634
634
|
}) : s(null);
|
|
635
635
|
}, [l]);
|
|
636
|
-
const d =
|
|
636
|
+
const d = F((g) => {
|
|
637
637
|
a(g), wn(g), n == null || n(g);
|
|
638
|
-
}, [n]), u =
|
|
638
|
+
}, [n]), u = ce(() => ({
|
|
639
639
|
locale: l,
|
|
640
640
|
setLocale: d,
|
|
641
641
|
messages: kn[l],
|
|
@@ -648,10 +648,10 @@ function H() {
|
|
|
648
648
|
return (e == null ? void 0 : e.messages) ?? Gt;
|
|
649
649
|
}
|
|
650
650
|
const zn = 2e3;
|
|
651
|
-
function
|
|
651
|
+
function Y() {
|
|
652
652
|
const e = Ve(Ne), n = (e == null ? void 0 : e.locale) ?? "zh-Hant", o = (e == null ? void 0 : e.converter) ?? null, r = Q(/* @__PURE__ */ new Map()), a = Q(n);
|
|
653
653
|
a.current !== n && (r.current.clear(), a.current = n);
|
|
654
|
-
const l =
|
|
654
|
+
const l = F((c) => {
|
|
655
655
|
if (!c) return "";
|
|
656
656
|
if (!o) return c;
|
|
657
657
|
const s = r.current.get(c);
|
|
@@ -663,7 +663,7 @@ function K() {
|
|
|
663
663
|
}
|
|
664
664
|
return r.current.set(c, d), d;
|
|
665
665
|
}, [o]);
|
|
666
|
-
return
|
|
666
|
+
return ce(() => ({
|
|
667
667
|
convert: l,
|
|
668
668
|
locale: n,
|
|
669
669
|
isSimplified: n === "zh-Hans"
|
|
@@ -709,35 +709,35 @@ const st = ({
|
|
|
709
709
|
], u = [
|
|
710
710
|
{ value: "catalog", label: l.rootType.catalog },
|
|
711
711
|
{ value: "search", label: l.rootType.search }
|
|
712
|
-
], g = (
|
|
712
|
+
], g = (m) => {
|
|
713
713
|
if (!a) return !0;
|
|
714
|
-
const v = ke(
|
|
714
|
+
const v = ke(m);
|
|
715
715
|
return a === "text" ? v.includes("text") : a === "image" ? v.includes("image") || v.includes("physical") : a === "physical" ? v.includes("physical") : v.includes(a);
|
|
716
|
-
}, f = e.map((
|
|
717
|
-
const
|
|
718
|
-
a && (
|
|
719
|
-
}, p = (
|
|
720
|
-
n(e.filter((v, k) => k !==
|
|
721
|
-
}, b = (
|
|
722
|
-
const
|
|
723
|
-
if (
|
|
716
|
+
}, f = e.map((m, v) => ({ item: m, originalIndex: v })).filter(({ item: m }) => g(m)), x = () => {
|
|
717
|
+
const m = In();
|
|
718
|
+
a && (m.type = a), n([...e, m]), s(e.length);
|
|
719
|
+
}, p = (m) => {
|
|
720
|
+
n(e.filter((v, k) => k !== m)), s(null);
|
|
721
|
+
}, b = (m, v, k) => {
|
|
722
|
+
const I = [...e];
|
|
723
|
+
if (I[m] = { ...I[m], [v]: k }, v === "url" && !I[m].id) {
|
|
724
724
|
const _ = Cn(k);
|
|
725
|
-
_ && (
|
|
725
|
+
_ && (I[m].id = _);
|
|
726
726
|
}
|
|
727
|
-
n(
|
|
728
|
-
}, S = (
|
|
729
|
-
const _ = { ...e[
|
|
730
|
-
k ? _[v] = k : delete _[v], b(
|
|
731
|
-
}, h = (
|
|
732
|
-
const k = v.trim() ? v.split(/[,,、]/).map((
|
|
733
|
-
b(
|
|
734
|
-
}, z = (
|
|
735
|
-
const _ = e[
|
|
736
|
-
v === "level" ? _.level = parseInt(k) || 1 : _.ranges = k, b(
|
|
727
|
+
n(I);
|
|
728
|
+
}, S = (m, v, k) => {
|
|
729
|
+
const _ = { ...e[m].metadata || {} };
|
|
730
|
+
k ? _[v] = k : delete _[v], b(m, "metadata", Object.keys(_).length > 0 ? _ : void 0);
|
|
731
|
+
}, h = (m, v) => {
|
|
732
|
+
const k = v.trim() ? v.split(/[,,、]/).map((I) => I.trim()).filter(Boolean) : void 0;
|
|
733
|
+
b(m, "structure", k);
|
|
734
|
+
}, z = (m, v, k) => {
|
|
735
|
+
const _ = e[m].coverage || { level: 1, ranges: "" };
|
|
736
|
+
v === "level" ? _.level = parseInt(k) || 1 : _.ranges = k, b(m, "coverage", _.ranges ? _ : void 0);
|
|
737
737
|
};
|
|
738
738
|
return /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
739
|
-
f.map(({ item:
|
|
740
|
-
var k,
|
|
739
|
+
f.map(({ item: m, originalIndex: v }) => {
|
|
740
|
+
var k, I, _;
|
|
741
741
|
return /* @__PURE__ */ i(
|
|
742
742
|
"div",
|
|
743
743
|
{
|
|
@@ -765,32 +765,32 @@ const st = ({
|
|
|
765
765
|
fontSize: "11px",
|
|
766
766
|
padding: "1px 6px",
|
|
767
767
|
borderRadius: "3px",
|
|
768
|
-
background: Tn(
|
|
768
|
+
background: Tn(m.type ?? "text"),
|
|
769
769
|
color: "#fff"
|
|
770
770
|
}, children: (() => {
|
|
771
|
-
var
|
|
772
|
-
const
|
|
773
|
-
return
|
|
771
|
+
var B, W;
|
|
772
|
+
const y = ke(m);
|
|
773
|
+
return y.length === 0 ? m.type ?? "text" : y.length === 1 ? ((B = d.find((E) => E.value === y[0])) == null ? void 0 : B.label) ?? y[0] : y.includes("text") && y.includes("image") ? ((W = d.find((E) => E.value === "text+image")) == null ? void 0 : W.label) ?? "text+image" : y.join("+");
|
|
774
774
|
})() }),
|
|
775
|
-
/* @__PURE__ */ t("span", { style: { flex: 1, fontSize: "13px", fontWeight: 500 }, children:
|
|
776
|
-
|
|
777
|
-
|
|
775
|
+
/* @__PURE__ */ t("span", { style: { flex: 1, fontSize: "13px", fontWeight: 500 }, children: m.name || `${l.editor.resourcePlaceholder} ${v + 1}` }),
|
|
776
|
+
m.id && /* @__PURE__ */ t("span", { style: { fontSize: "11px", opacity: 0.5 }, children: m.id }),
|
|
777
|
+
m.url && /* @__PURE__ */ t(
|
|
778
778
|
"a",
|
|
779
779
|
{
|
|
780
|
-
href:
|
|
780
|
+
href: m.url,
|
|
781
781
|
target: "_blank",
|
|
782
782
|
rel: "noopener noreferrer",
|
|
783
|
-
onClick: (
|
|
783
|
+
onClick: (y) => y.stopPropagation(),
|
|
784
784
|
style: { fontSize: "12px", opacity: 0.7 },
|
|
785
785
|
children: "🔗"
|
|
786
786
|
}
|
|
787
787
|
),
|
|
788
|
-
o &&
|
|
788
|
+
o && m.url && Rn(v, r == null ? void 0 : r[v], o, l),
|
|
789
789
|
/* @__PURE__ */ t(
|
|
790
790
|
"button",
|
|
791
791
|
{
|
|
792
|
-
onClick: (
|
|
793
|
-
|
|
792
|
+
onClick: (y) => {
|
|
793
|
+
y.stopPropagation(), p(v);
|
|
794
794
|
},
|
|
795
795
|
style: {
|
|
796
796
|
background: "transparent",
|
|
@@ -808,7 +808,7 @@ const st = ({
|
|
|
808
808
|
}
|
|
809
809
|
),
|
|
810
810
|
c === v && /* @__PURE__ */ i("div", { style: { padding: "12px", borderTop: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: [
|
|
811
|
-
bn(
|
|
811
|
+
bn(m, "image") && m.url && Ln(m, l),
|
|
812
812
|
/* @__PURE__ */ i("div", { style: { display: "grid", gap: "8px" }, children: [
|
|
813
813
|
/* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
814
814
|
/* @__PURE__ */ i("label", { style: Le, children: [
|
|
@@ -816,10 +816,10 @@ const st = ({
|
|
|
816
816
|
/* @__PURE__ */ t(
|
|
817
817
|
"select",
|
|
818
818
|
{
|
|
819
|
-
value:
|
|
820
|
-
onChange: (
|
|
819
|
+
value: m.type,
|
|
820
|
+
onChange: (y) => b(v, "type", y.target.value),
|
|
821
821
|
style: { ...ge, flex: 1 },
|
|
822
|
-
children: d.map((
|
|
822
|
+
children: d.map((y) => /* @__PURE__ */ t("option", { value: y.value, children: y.label }, y.value))
|
|
823
823
|
}
|
|
824
824
|
)
|
|
825
825
|
] }),
|
|
@@ -828,10 +828,10 @@ const st = ({
|
|
|
828
828
|
/* @__PURE__ */ t(
|
|
829
829
|
"select",
|
|
830
830
|
{
|
|
831
|
-
value:
|
|
832
|
-
onChange: (
|
|
831
|
+
value: m.root_type || "catalog",
|
|
832
|
+
onChange: (y) => b(v, "root_type", y.target.value),
|
|
833
833
|
style: { ...ge, flex: 1 },
|
|
834
|
-
children: u.map((
|
|
834
|
+
children: u.map((y) => /* @__PURE__ */ t("option", { value: y.value, children: y.label }, y.value))
|
|
835
835
|
}
|
|
836
836
|
)
|
|
837
837
|
] })
|
|
@@ -841,8 +841,8 @@ const st = ({
|
|
|
841
841
|
"input",
|
|
842
842
|
{
|
|
843
843
|
type: "text",
|
|
844
|
-
value:
|
|
845
|
-
onChange: (
|
|
844
|
+
value: m.id,
|
|
845
|
+
onChange: (y) => b(v, "id", y.target.value),
|
|
846
846
|
placeholder: l.editor.idAutoExtract,
|
|
847
847
|
style: { ...ge, width: "140px", flexShrink: 0 }
|
|
848
848
|
}
|
|
@@ -851,8 +851,8 @@ const st = ({
|
|
|
851
851
|
"input",
|
|
852
852
|
{
|
|
853
853
|
type: "text",
|
|
854
|
-
value:
|
|
855
|
-
onChange: (
|
|
854
|
+
value: m.name,
|
|
855
|
+
onChange: (y) => b(v, "name", y.target.value),
|
|
856
856
|
placeholder: l.editor.resourceName,
|
|
857
857
|
style: { ...ge, flex: 1 }
|
|
858
858
|
}
|
|
@@ -862,8 +862,8 @@ const st = ({
|
|
|
862
862
|
"input",
|
|
863
863
|
{
|
|
864
864
|
type: "text",
|
|
865
|
-
value:
|
|
866
|
-
onChange: (
|
|
865
|
+
value: m.url,
|
|
866
|
+
onChange: (y) => b(v, "url", y.target.value),
|
|
867
867
|
placeholder: l.editor.resourceUrl,
|
|
868
868
|
style: ge
|
|
869
869
|
}
|
|
@@ -872,8 +872,8 @@ const st = ({
|
|
|
872
872
|
"input",
|
|
873
873
|
{
|
|
874
874
|
type: "text",
|
|
875
|
-
value: ((k =
|
|
876
|
-
onChange: (
|
|
875
|
+
value: ((k = m.structure) == null ? void 0 : k.join("、")) || "",
|
|
876
|
+
onChange: (y) => h(v, y.target.value),
|
|
877
877
|
placeholder: l.editor.structurePlaceholder,
|
|
878
878
|
style: ge
|
|
879
879
|
}
|
|
@@ -886,8 +886,8 @@ const st = ({
|
|
|
886
886
|
{
|
|
887
887
|
type: "number",
|
|
888
888
|
min: 1,
|
|
889
|
-
value: ((
|
|
890
|
-
onChange: (
|
|
889
|
+
value: ((I = m.coverage) == null ? void 0 : I.level) ?? "",
|
|
890
|
+
onChange: (y) => z(v, "level", y.target.value),
|
|
891
891
|
placeholder: "1",
|
|
892
892
|
style: { ...ge, width: "60px" }
|
|
893
893
|
}
|
|
@@ -899,8 +899,8 @@ const st = ({
|
|
|
899
899
|
"input",
|
|
900
900
|
{
|
|
901
901
|
type: "text",
|
|
902
|
-
value: ((_ =
|
|
903
|
-
onChange: (
|
|
902
|
+
value: ((_ = m.coverage) == null ? void 0 : _.ranges) || "",
|
|
903
|
+
onChange: (y) => z(v, "ranges", y.target.value),
|
|
904
904
|
placeholder: l.editor.coverageRangePlaceholder,
|
|
905
905
|
style: { ...ge, flex: 1 }
|
|
906
906
|
}
|
|
@@ -910,29 +910,29 @@ const st = ({
|
|
|
910
910
|
/* @__PURE__ */ t(
|
|
911
911
|
"textarea",
|
|
912
912
|
{
|
|
913
|
-
value:
|
|
914
|
-
onChange: (
|
|
913
|
+
value: m.details || "",
|
|
914
|
+
onChange: (y) => b(v, "details", y.target.value),
|
|
915
915
|
placeholder: l.editor.detailsPlaceholder,
|
|
916
916
|
style: { ...ge, minHeight: "60px", resize: "vertical" }
|
|
917
917
|
}
|
|
918
918
|
),
|
|
919
919
|
/* @__PURE__ */ i("div", { style: { borderTop: "1px solid var(--bim-widget-border, #e0e0e0)", paddingTop: "8px", marginTop: "4px" }, children: [
|
|
920
920
|
/* @__PURE__ */ t("div", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #717171)", marginBottom: "6px" }, children: l.label.metadata }),
|
|
921
|
-
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "6px" }, children: Object.entries(l.metadata).map(([
|
|
921
|
+
/* @__PURE__ */ t("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "6px" }, children: Object.entries(l.metadata).map(([y, B]) => {
|
|
922
922
|
var W;
|
|
923
923
|
return /* @__PURE__ */ i("label", { style: { ...Le, gap: "4px" }, children: [
|
|
924
|
-
/* @__PURE__ */ t("span", { style: { ...Be, minWidth: "56px" }, children:
|
|
924
|
+
/* @__PURE__ */ t("span", { style: { ...Be, minWidth: "56px" }, children: B }),
|
|
925
925
|
/* @__PURE__ */ t(
|
|
926
926
|
"input",
|
|
927
927
|
{
|
|
928
928
|
type: "text",
|
|
929
|
-
value: ((W =
|
|
930
|
-
onChange: (
|
|
931
|
-
placeholder:
|
|
929
|
+
value: ((W = m.metadata) == null ? void 0 : W[y]) || "",
|
|
930
|
+
onChange: (E) => S(v, y, E.target.value),
|
|
931
|
+
placeholder: B,
|
|
932
932
|
style: { ...ge, flex: 1 }
|
|
933
933
|
}
|
|
934
934
|
)
|
|
935
|
-
] },
|
|
935
|
+
] }, y);
|
|
936
936
|
}) })
|
|
937
937
|
] })
|
|
938
938
|
] })
|
|
@@ -1102,7 +1102,7 @@ const qt = ({
|
|
|
1102
1102
|
onNavigate: o,
|
|
1103
1103
|
renderLink: r
|
|
1104
1104
|
}) => {
|
|
1105
|
-
const a = H(), l =
|
|
1105
|
+
const a = H(), l = ce(() => $n(e || []), [e]), c = {
|
|
1106
1106
|
text: a.resourceType.text,
|
|
1107
1107
|
image: a.resourceType.image,
|
|
1108
1108
|
"text+image": a.resourceType.textImage,
|
|
@@ -1164,13 +1164,13 @@ const qt = ({
|
|
|
1164
1164
|
background: o.bg,
|
|
1165
1165
|
color: o.fg
|
|
1166
1166
|
}, children: o.label }) : /* @__PURE__ */ t("span", { children: e });
|
|
1167
|
-
},
|
|
1167
|
+
}, An = (e, n, o, r) => {
|
|
1168
1168
|
if (e === "check_type" && typeof n == "string") return /* @__PURE__ */ t(Zt, { value: n });
|
|
1169
1169
|
if (e === "has_translation") return n ? o.misc.hasTranslation : o.misc.noTranslation;
|
|
1170
1170
|
const a = String(n);
|
|
1171
1171
|
return r ? r(a) : a;
|
|
1172
1172
|
};
|
|
1173
|
-
function
|
|
1173
|
+
function Pn(e, n) {
|
|
1174
1174
|
try {
|
|
1175
1175
|
if (new URL(e).hostname.includes("wikimedia.org")) {
|
|
1176
1176
|
const a = e.match(/\/wiki\/File:(.+?)(?:#|$)/);
|
|
@@ -1201,7 +1201,7 @@ const On = {
|
|
|
1201
1201
|
color: { label: "", bg: "#fff8e1", fg: "#f57f17" }
|
|
1202
1202
|
}, ft = ({ item: e, onNavigate: n, renderLink: o }) => {
|
|
1203
1203
|
var S;
|
|
1204
|
-
const r = H(), { convert: a } =
|
|
1204
|
+
const r = H(), { convert: a } = Y(), l = de(), [c, s] = w(!1), d = ce(() => (e.url ? Wn(e.url) : void 0) || a(e.name), [e.url, e.name, a]), u = ce(() => !e.volumes || e.volumes.length === 0 ? null : e.volumes.map((h) => ({
|
|
1205
1205
|
...h,
|
|
1206
1206
|
url: h.url || Hn(h)
|
|
1207
1207
|
})), [e.volumes]), g = u && u.length > 0, f = g ? new Set(u.filter((h) => h.status !== "missing").map((h) => h.volume)).size : 0, x = g ? new Set(u.filter((h) => h.status === "missing").map((h) => h.volume)).size : 0, p = e.expected_volumes ?? (g ? f + x : 0), b = e.color_mode ? {
|
|
@@ -1253,7 +1253,7 @@ const On = {
|
|
|
1253
1253
|
{
|
|
1254
1254
|
href: (() => {
|
|
1255
1255
|
const h = Mn(e.metadata);
|
|
1256
|
-
return h ?
|
|
1256
|
+
return h ? Pn(e.url, h) : e.url;
|
|
1257
1257
|
})(),
|
|
1258
1258
|
target: "_blank",
|
|
1259
1259
|
rel: "noopener noreferrer",
|
|
@@ -1285,7 +1285,7 @@ const On = {
|
|
|
1285
1285
|
e.metadata && Object.entries(e.metadata).filter(([h]) => h !== "check_type").map(([h, z]) => /* @__PURE__ */ i("span", { children: [
|
|
1286
1286
|
r.metadata[h] || h,
|
|
1287
1287
|
": ",
|
|
1288
|
-
|
|
1288
|
+
An(h, z, r, a)
|
|
1289
1289
|
] }, h)),
|
|
1290
1290
|
e.details && !g && /* @__PURE__ */ t("span", { children: a(e.details) }),
|
|
1291
1291
|
e.structure && /* @__PURE__ */ i("span", { children: [
|
|
@@ -1306,12 +1306,12 @@ const On = {
|
|
|
1306
1306
|
if (h) {
|
|
1307
1307
|
let v = null;
|
|
1308
1308
|
for (const k of u) {
|
|
1309
|
-
const
|
|
1310
|
-
(!v || v.title !==
|
|
1309
|
+
const I = k.group || "";
|
|
1310
|
+
(!v || v.title !== I) && (v = { title: I, group_id: k.group_id, vols: [] }, z.push(v)), v.vols.push(k);
|
|
1311
1311
|
}
|
|
1312
1312
|
} else
|
|
1313
1313
|
z.push({ vols: u });
|
|
1314
|
-
const
|
|
1314
|
+
const m = (v) => {
|
|
1315
1315
|
const k = v.status === "missing";
|
|
1316
1316
|
return v.url && !k ? /* @__PURE__ */ t(
|
|
1317
1317
|
"a",
|
|
@@ -1353,14 +1353,14 @@ const On = {
|
|
|
1353
1353
|
flexDirection: "column",
|
|
1354
1354
|
gap: "8px"
|
|
1355
1355
|
}, children: z.map((v, k) => {
|
|
1356
|
-
const
|
|
1357
|
-
let _ =
|
|
1358
|
-
return v.title && v.group_id && (o ? _ = o(v.group_id,
|
|
1356
|
+
const I = v.title ? a(v.title) : "";
|
|
1357
|
+
let _ = I;
|
|
1358
|
+
return v.title && v.group_id && (o ? _ = o(v.group_id, I) : n && (_ = /* @__PURE__ */ t(
|
|
1359
1359
|
"a",
|
|
1360
1360
|
{
|
|
1361
1361
|
href: l(v.group_id),
|
|
1362
|
-
onClick: (
|
|
1363
|
-
|
|
1362
|
+
onClick: (y) => {
|
|
1363
|
+
y.metaKey || y.ctrlKey || (y.preventDefault(), n(v.group_id));
|
|
1364
1364
|
},
|
|
1365
1365
|
style: {
|
|
1366
1366
|
color: "var(--bim-link-fg, #0066cc)",
|
|
@@ -1368,9 +1368,9 @@ const On = {
|
|
|
1368
1368
|
textDecoration: "none",
|
|
1369
1369
|
borderBottom: "1px dashed var(--bim-link-fg, #0066cc)"
|
|
1370
1370
|
},
|
|
1371
|
-
onMouseEnter: (
|
|
1372
|
-
onMouseLeave: (
|
|
1373
|
-
children:
|
|
1371
|
+
onMouseEnter: (y) => y.currentTarget.style.borderBottomStyle = "solid",
|
|
1372
|
+
onMouseLeave: (y) => y.currentTarget.style.borderBottomStyle = "dashed",
|
|
1373
|
+
children: I
|
|
1374
1374
|
}
|
|
1375
1375
|
))), /* @__PURE__ */ i("div", { children: [
|
|
1376
1376
|
v.title && /* @__PURE__ */ i("div", { style: {
|
|
@@ -1386,7 +1386,7 @@ const On = {
|
|
|
1386
1386
|
")"
|
|
1387
1387
|
] })
|
|
1388
1388
|
] }),
|
|
1389
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: v.vols.map(
|
|
1389
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: v.vols.map(m) })
|
|
1390
1390
|
] }, k);
|
|
1391
1391
|
}) });
|
|
1392
1392
|
})()
|
|
@@ -1563,96 +1563,91 @@ const Vn = ({
|
|
|
1563
1563
|
book: c.indexType.book,
|
|
1564
1564
|
collection: c.indexType.collection,
|
|
1565
1565
|
entity: c.indexType.entity
|
|
1566
|
-
}, [u, g] = w(!1), [f, x] = w([]), [p, b] = w(-1), [S, h] = w(null), [z,
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
let I = !1;
|
|
1570
|
-
return e.getAllEntries().then((E) => {
|
|
1571
|
-
I || h(E);
|
|
1566
|
+
}, [u, g] = w(!1), [f, x] = w([]), [p, b] = w(-1), [S, h] = w(null), [z, m] = w($e), v = Q(null), k = Q(null), I = Q(null), _ = Q(!1), y = F(() => {
|
|
1567
|
+
_.current || !e.getAllEntries || (_.current = !0, e.getAllEntries().then((T) => {
|
|
1568
|
+
h(T);
|
|
1572
1569
|
}).catch(() => {
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
if (!I.trim())
|
|
1579
|
-
return z.map((C) => ({ type: "history", text: C }));
|
|
1570
|
+
_.current = !1;
|
|
1571
|
+
}));
|
|
1572
|
+
}, [e]), B = F((T) => {
|
|
1573
|
+
if (!T.trim())
|
|
1574
|
+
return z.map((P) => ({ type: "history", text: P }));
|
|
1580
1575
|
if (!S) return [];
|
|
1581
|
-
const
|
|
1582
|
-
for (const
|
|
1583
|
-
if (
|
|
1584
|
-
const
|
|
1585
|
-
if (
|
|
1586
|
-
|
|
1587
|
-
else if (
|
|
1588
|
-
|
|
1576
|
+
const D = T.toLowerCase(), C = [], R = [];
|
|
1577
|
+
for (const P of S) {
|
|
1578
|
+
if (C.length + R.length >= ht * 2) break;
|
|
1579
|
+
const J = (P.title ?? "").toLowerCase();
|
|
1580
|
+
if (J.startsWith(D))
|
|
1581
|
+
C.push({ type: "entry", text: P.title, entry: P });
|
|
1582
|
+
else if (J.includes(D))
|
|
1583
|
+
R.push({ type: "entry", text: P.title, entry: P });
|
|
1589
1584
|
else {
|
|
1590
|
-
const
|
|
1591
|
-
for (const
|
|
1592
|
-
const
|
|
1593
|
-
if (
|
|
1594
|
-
|
|
1585
|
+
const V = [...P.additional_titles || [], ...P.attached_texts || []];
|
|
1586
|
+
for (const ee of V) {
|
|
1587
|
+
const te = typeof ee == "string" ? ee : ee == null ? void 0 : ee.book_title;
|
|
1588
|
+
if (te != null && te.toLowerCase().includes(D)) {
|
|
1589
|
+
C.push({ type: "entry", text: `${P.title}`, entry: P });
|
|
1595
1590
|
break;
|
|
1596
1591
|
}
|
|
1597
1592
|
}
|
|
1598
1593
|
}
|
|
1599
1594
|
}
|
|
1600
|
-
return [...
|
|
1595
|
+
return [...C, ...R].slice(0, ht);
|
|
1601
1596
|
}, [S, z]);
|
|
1602
|
-
|
|
1603
|
-
x(
|
|
1604
|
-
}, [n,
|
|
1605
|
-
const
|
|
1606
|
-
|
|
1597
|
+
$(() => {
|
|
1598
|
+
x(B(n)), b(-1);
|
|
1599
|
+
}, [n, B]), $(() => {
|
|
1600
|
+
const T = (D) => {
|
|
1601
|
+
I.current && !I.current.contains(D.target) && g(!1);
|
|
1607
1602
|
};
|
|
1608
|
-
return document.addEventListener("mousedown",
|
|
1609
|
-
}, []),
|
|
1610
|
-
const
|
|
1611
|
-
var
|
|
1612
|
-
if (
|
|
1613
|
-
const
|
|
1614
|
-
if (
|
|
1615
|
-
|
|
1603
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
1604
|
+
}, []), $(() => {
|
|
1605
|
+
const T = (D) => {
|
|
1606
|
+
var C, R;
|
|
1607
|
+
if (D.key === "/" && document.activeElement !== v.current) {
|
|
1608
|
+
const P = (C = document.activeElement) == null ? void 0 : C.tagName;
|
|
1609
|
+
if (P === "INPUT" || P === "TEXTAREA" || P === "SELECT") return;
|
|
1610
|
+
D.preventDefault(), (R = v.current) == null || R.focus();
|
|
1616
1611
|
}
|
|
1617
1612
|
};
|
|
1618
|
-
return document.addEventListener("keydown",
|
|
1613
|
+
return document.addEventListener("keydown", T), () => document.removeEventListener("keydown", T);
|
|
1619
1614
|
}, []);
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1622
|
-
}, [r]),
|
|
1623
|
-
|
|
1624
|
-
}, [o,
|
|
1615
|
+
const W = F((T) => {
|
|
1616
|
+
T.trim() && (jn(T.trim()), m($e())), r(T), g(!1);
|
|
1617
|
+
}, [r]), E = F((T) => {
|
|
1618
|
+
T.type === "history" ? (o(T.text), W(T.text)) : T.entry && (a ? (a(T.entry), g(!1)) : (o(T.text), W(T.text)));
|
|
1619
|
+
}, [o, W, a]), O = F((T) => {
|
|
1625
1620
|
if (!u || f.length === 0) {
|
|
1626
|
-
|
|
1621
|
+
T.key === "Enter" && W(n);
|
|
1627
1622
|
return;
|
|
1628
1623
|
}
|
|
1629
|
-
switch (
|
|
1624
|
+
switch (T.key) {
|
|
1630
1625
|
case "ArrowDown":
|
|
1631
|
-
|
|
1626
|
+
T.preventDefault(), b((D) => (D + 1) % f.length);
|
|
1632
1627
|
break;
|
|
1633
1628
|
case "ArrowUp":
|
|
1634
|
-
|
|
1629
|
+
T.preventDefault(), b((D) => (D - 1 + f.length) % f.length);
|
|
1635
1630
|
break;
|
|
1636
1631
|
case "Enter":
|
|
1637
|
-
|
|
1632
|
+
T.preventDefault(), p >= 0 && p < f.length ? E(f[p]) : W(n);
|
|
1638
1633
|
break;
|
|
1639
1634
|
case "Escape":
|
|
1640
|
-
|
|
1635
|
+
T.preventDefault(), g(!1);
|
|
1641
1636
|
break;
|
|
1642
1637
|
}
|
|
1643
|
-
}, [u, f, p, n,
|
|
1644
|
-
|
|
1645
|
-
}, []),
|
|
1646
|
-
|
|
1638
|
+
}, [u, f, p, n, W, E]), A = F((T, D) => {
|
|
1639
|
+
D.stopPropagation(), Fn(T), m($e()), x((C) => C.filter((R) => !(R.type === "history" && R.text === T)));
|
|
1640
|
+
}, []), N = F((T) => {
|
|
1641
|
+
T.stopPropagation(), Un(), m([]), x([]);
|
|
1647
1642
|
}, []);
|
|
1648
|
-
|
|
1643
|
+
$(() => {
|
|
1649
1644
|
if (p >= 0 && k.current) {
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1645
|
+
const T = k.current.children;
|
|
1646
|
+
T[p] && T[p].scrollIntoView({ block: "nearest" });
|
|
1652
1647
|
}
|
|
1653
1648
|
}, [p]);
|
|
1654
|
-
const
|
|
1655
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
1649
|
+
const U = !n.trim() && z.length > 0;
|
|
1650
|
+
return /* @__PURE__ */ i("div", { ref: I, style: { position: "relative", flex: 1 }, children: [
|
|
1656
1651
|
/* @__PURE__ */ t(
|
|
1657
1652
|
"input",
|
|
1658
1653
|
{
|
|
@@ -1660,11 +1655,13 @@ const Vn = ({
|
|
|
1660
1655
|
type: "text",
|
|
1661
1656
|
placeholder: s,
|
|
1662
1657
|
value: n,
|
|
1663
|
-
onChange: (
|
|
1664
|
-
o(
|
|
1658
|
+
onChange: (T) => {
|
|
1659
|
+
o(T.target.value), g(!0), y();
|
|
1660
|
+
},
|
|
1661
|
+
onFocus: () => {
|
|
1662
|
+
g(!0), y();
|
|
1665
1663
|
},
|
|
1666
|
-
|
|
1667
|
-
onKeyDown: W,
|
|
1664
|
+
onKeyDown: O,
|
|
1668
1665
|
style: {
|
|
1669
1666
|
width: "100%",
|
|
1670
1667
|
padding: "8px 12px",
|
|
@@ -1696,7 +1693,7 @@ const Vn = ({
|
|
|
1696
1693
|
overflow: "auto"
|
|
1697
1694
|
},
|
|
1698
1695
|
children: [
|
|
1699
|
-
|
|
1696
|
+
U && /* @__PURE__ */ i("div", { style: {
|
|
1700
1697
|
display: "flex",
|
|
1701
1698
|
justifyContent: "space-between",
|
|
1702
1699
|
alignItems: "center",
|
|
@@ -1709,7 +1706,7 @@ const Vn = ({
|
|
|
1709
1706
|
/* @__PURE__ */ t(
|
|
1710
1707
|
"button",
|
|
1711
1708
|
{
|
|
1712
|
-
onClick:
|
|
1709
|
+
onClick: N,
|
|
1713
1710
|
style: {
|
|
1714
1711
|
border: "none",
|
|
1715
1712
|
background: "transparent",
|
|
@@ -1722,10 +1719,10 @@ const Vn = ({
|
|
|
1722
1719
|
}
|
|
1723
1720
|
)
|
|
1724
1721
|
] }),
|
|
1725
|
-
f.map((
|
|
1722
|
+
f.map((T, D) => /* @__PURE__ */ i(
|
|
1726
1723
|
"div",
|
|
1727
1724
|
{
|
|
1728
|
-
onClick: () =>
|
|
1725
|
+
onClick: () => E(T),
|
|
1729
1726
|
style: {
|
|
1730
1727
|
display: "flex",
|
|
1731
1728
|
alignItems: "center",
|
|
@@ -1734,20 +1731,20 @@ const Vn = ({
|
|
|
1734
1731
|
cursor: "pointer",
|
|
1735
1732
|
fontSize: "13px",
|
|
1736
1733
|
color: "var(--bim-fg, #333)",
|
|
1737
|
-
background:
|
|
1734
|
+
background: D === p ? "var(--bim-list-active-bg, #e8f0fe)" : "transparent"
|
|
1738
1735
|
},
|
|
1739
1736
|
children: [
|
|
1740
|
-
/* @__PURE__ */ t("span", { style: { fontSize: "12px", opacity: 0.5, width: "16px", textAlign: "center" }, children:
|
|
1741
|
-
/* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children:
|
|
1742
|
-
|
|
1743
|
-
d[
|
|
1744
|
-
|
|
1745
|
-
|
|
1737
|
+
/* @__PURE__ */ t("span", { style: { fontSize: "12px", opacity: 0.5, width: "16px", textAlign: "center" }, children: T.type === "history" ? "🕐" : "🔍" }),
|
|
1738
|
+
/* @__PURE__ */ t("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: T.text }),
|
|
1739
|
+
T.entry && /* @__PURE__ */ i("span", { style: { fontSize: "11px", color: "var(--bim-desc-fg, #717171)", flexShrink: 0 }, children: [
|
|
1740
|
+
d[T.entry.type],
|
|
1741
|
+
T.entry.edition && ` · ${T.entry.edition}`,
|
|
1742
|
+
T.entry.author && ` · ${T.entry.author}`
|
|
1746
1743
|
] }),
|
|
1747
|
-
|
|
1744
|
+
T.type === "history" && /* @__PURE__ */ t(
|
|
1748
1745
|
"button",
|
|
1749
1746
|
{
|
|
1750
|
-
onClick: (
|
|
1747
|
+
onClick: (C) => A(T.text, C),
|
|
1751
1748
|
style: {
|
|
1752
1749
|
border: "none",
|
|
1753
1750
|
background: "transparent",
|
|
@@ -1763,14 +1760,14 @@ const Vn = ({
|
|
|
1763
1760
|
)
|
|
1764
1761
|
]
|
|
1765
1762
|
},
|
|
1766
|
-
`${
|
|
1763
|
+
`${T.type}-${T.text}-${D}`
|
|
1767
1764
|
))
|
|
1768
1765
|
]
|
|
1769
1766
|
}
|
|
1770
1767
|
)
|
|
1771
1768
|
] });
|
|
1772
1769
|
}, Me = "bim-recent-ids", xt = "bim-recent-entries", bt = 50, Xe = 5, Nn = 50, Kn = 200;
|
|
1773
|
-
function
|
|
1770
|
+
function Ae() {
|
|
1774
1771
|
try {
|
|
1775
1772
|
const e = localStorage.getItem(Me);
|
|
1776
1773
|
if (e) return JSON.parse(e);
|
|
@@ -1786,14 +1783,14 @@ function Pe() {
|
|
|
1786
1783
|
}
|
|
1787
1784
|
function Yn(e) {
|
|
1788
1785
|
try {
|
|
1789
|
-
const n =
|
|
1786
|
+
const n = Ae().filter((o) => o !== e);
|
|
1790
1787
|
n.unshift(e), n.length > bt && (n.length = bt), localStorage.setItem(Me, JSON.stringify(n));
|
|
1791
1788
|
} catch {
|
|
1792
1789
|
}
|
|
1793
1790
|
}
|
|
1794
1791
|
function Gn(e) {
|
|
1795
1792
|
try {
|
|
1796
|
-
const n =
|
|
1793
|
+
const n = Ae().filter((o) => o !== e);
|
|
1797
1794
|
localStorage.setItem(Me, JSON.stringify(n));
|
|
1798
1795
|
} catch {
|
|
1799
1796
|
}
|
|
@@ -1829,21 +1826,21 @@ const qn = {
|
|
|
1829
1826
|
{ type: "book", icon: "📖", name: p.indexType.book, key: "books" },
|
|
1830
1827
|
{ type: "collection", icon: "📚", name: p.indexType.collection, key: "collections" },
|
|
1831
1828
|
{ type: "entity", icon: "👤", name: p.indexType.entity, key: "entities" }
|
|
1832
|
-
], [S, h] = w(g ?? ""), [z,
|
|
1829
|
+
], [S, h] = w(g ?? ""), [z, m] = w(null), [v, k] = w(null), [I, _] = w(!1), [y, B] = w(null), [W, E] = w(""), [O, A] = w(!g), [N, U] = w(Ae), [T, D] = w([]), [C, R] = w(!1), [P, J] = w(!1), [V, ee] = w(null), [te, pe] = w(null), ve = Q(void 0), ye = Q(!1), ne = F(async (M, Z) => {
|
|
1833
1830
|
if (!M.trim()) {
|
|
1834
|
-
A(!0),
|
|
1831
|
+
A(!0), m(null), k(null);
|
|
1835
1832
|
return;
|
|
1836
1833
|
}
|
|
1837
|
-
A(!1), _(!0),
|
|
1834
|
+
A(!1), _(!0), E("");
|
|
1838
1835
|
try {
|
|
1839
1836
|
if (e.searchAll) {
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1837
|
+
const G = await e.searchAll(M, Z ?? Xe);
|
|
1838
|
+
m(G);
|
|
1842
1839
|
} else {
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1840
|
+
const G = ["work", "book", "collection", "entity"], q = await Promise.all(
|
|
1841
|
+
G.map((oe) => e.search(M, oe, { page: 1, pageSize: Z ?? Xe }))
|
|
1845
1842
|
);
|
|
1846
|
-
|
|
1843
|
+
m({
|
|
1847
1844
|
works: q[0].entries,
|
|
1848
1845
|
books: q[1].entries,
|
|
1849
1846
|
collections: q[2].entries,
|
|
@@ -1854,21 +1851,21 @@ const qn = {
|
|
|
1854
1851
|
totalEntities: q[3].total
|
|
1855
1852
|
});
|
|
1856
1853
|
}
|
|
1857
|
-
} catch (
|
|
1858
|
-
|
|
1854
|
+
} catch (G) {
|
|
1855
|
+
E(G instanceof Error ? G.message : String(G)), m(null);
|
|
1859
1856
|
} finally {
|
|
1860
1857
|
_(!1);
|
|
1861
1858
|
}
|
|
1862
1859
|
}, [e]);
|
|
1863
|
-
|
|
1860
|
+
$(() => {
|
|
1864
1861
|
let M = !1;
|
|
1865
1862
|
const Z = () => {
|
|
1866
|
-
var
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1869
|
-
),
|
|
1870
|
-
Promise.all([q,
|
|
1871
|
-
M || (
|
|
1863
|
+
var K, ie;
|
|
1864
|
+
const G = ["work", "book", "collection", "entity"], q = Promise.all(
|
|
1865
|
+
G.map((ue) => e.loadEntries(ue, { page: 1, pageSize: 1 }).catch(() => ({ total: 0 })))
|
|
1866
|
+
), oe = ((K = e.getResourceCounts) == null ? void 0 : K.call(e).catch(() => null)) ?? Promise.resolve(null), L = ((ie = e.getSubtypeStats) == null ? void 0 : ie.call(e).catch(() => null)) ?? Promise.resolve(null);
|
|
1867
|
+
Promise.all([q, oe, L]).then(([ue, fe, ct]) => {
|
|
1868
|
+
M || (ee({
|
|
1872
1869
|
works: ue[0].total,
|
|
1873
1870
|
books: ue[1].total,
|
|
1874
1871
|
collections: ue[2].total,
|
|
@@ -1878,62 +1875,62 @@ const qn = {
|
|
|
1878
1875
|
}), ct && pe(ct));
|
|
1879
1876
|
});
|
|
1880
1877
|
};
|
|
1881
|
-
return e.getCounts ? e.getCounts().then((
|
|
1882
|
-
var q,
|
|
1883
|
-
M || (
|
|
1884
|
-
works:
|
|
1885
|
-
books:
|
|
1886
|
-
collections:
|
|
1887
|
-
entities:
|
|
1888
|
-
hasText: (q =
|
|
1889
|
-
hasImage: (
|
|
1890
|
-
}),
|
|
1878
|
+
return e.getCounts ? e.getCounts().then((G) => {
|
|
1879
|
+
var q, oe;
|
|
1880
|
+
M || (ee({
|
|
1881
|
+
works: G.works,
|
|
1882
|
+
books: G.books,
|
|
1883
|
+
collections: G.collections,
|
|
1884
|
+
entities: G.entities,
|
|
1885
|
+
hasText: (q = G.resourceCounts) == null ? void 0 : q.hasText,
|
|
1886
|
+
hasImage: (oe = G.resourceCounts) == null ? void 0 : oe.hasImage
|
|
1887
|
+
}), G.subtypeStats && pe(G.subtypeStats));
|
|
1891
1888
|
}).catch(() => {
|
|
1892
1889
|
M || Z();
|
|
1893
1890
|
}) : Z(), () => {
|
|
1894
1891
|
M = !0;
|
|
1895
1892
|
};
|
|
1896
|
-
}, [e]),
|
|
1897
|
-
ye.current || !(g != null && g.trim()) || (ye.current = !0,
|
|
1898
|
-
}, [g,
|
|
1899
|
-
const X =
|
|
1893
|
+
}, [e]), $(() => {
|
|
1894
|
+
ye.current || !(g != null && g.trim()) || (ye.current = !0, ne(g));
|
|
1895
|
+
}, [g, ne]);
|
|
1896
|
+
const X = F((M) => {
|
|
1900
1897
|
if (h(M), f == null || f(M), !M.trim()) {
|
|
1901
|
-
A(!0),
|
|
1898
|
+
A(!0), m(null), k(null);
|
|
1902
1899
|
return;
|
|
1903
1900
|
}
|
|
1904
1901
|
ve.current && clearTimeout(ve.current), ve.current = setTimeout(() => {
|
|
1905
|
-
k(null),
|
|
1902
|
+
k(null), ne(M);
|
|
1906
1903
|
}, Kn);
|
|
1907
|
-
}, [
|
|
1908
|
-
ve.current && clearTimeout(ve.current), f == null || f(M),
|
|
1909
|
-
}, [
|
|
1910
|
-
k(M),
|
|
1911
|
-
}, [S,
|
|
1912
|
-
|
|
1913
|
-
if (!
|
|
1914
|
-
|
|
1904
|
+
}, [ne, f]), Ge = F((M) => {
|
|
1905
|
+
ve.current && clearTimeout(ve.current), f == null || f(M), ne(M);
|
|
1906
|
+
}, [ne, f]), Je = F((M) => {
|
|
1907
|
+
k(M), ne(S, Nn);
|
|
1908
|
+
}, [S, ne]);
|
|
1909
|
+
$(() => {
|
|
1910
|
+
if (!N.length) {
|
|
1911
|
+
D([]);
|
|
1915
1912
|
return;
|
|
1916
1913
|
}
|
|
1917
1914
|
let M = !1;
|
|
1918
|
-
return
|
|
1919
|
-
|
|
1920
|
-
var
|
|
1915
|
+
return R(!0), Promise.all(
|
|
1916
|
+
N.slice(0, 10).map(async (Z) => {
|
|
1917
|
+
var G, q, oe;
|
|
1921
1918
|
try {
|
|
1922
1919
|
if (e.getEntry) {
|
|
1923
|
-
const
|
|
1924
|
-
if (
|
|
1920
|
+
const K = await e.getEntry(Z);
|
|
1921
|
+
if (K) return K;
|
|
1925
1922
|
}
|
|
1926
|
-
const
|
|
1927
|
-
if (
|
|
1928
|
-
const
|
|
1923
|
+
const L = await e.getItem(Z);
|
|
1924
|
+
if (L) {
|
|
1925
|
+
const K = L.authors;
|
|
1929
1926
|
return {
|
|
1930
1927
|
id: Z,
|
|
1931
|
-
title:
|
|
1932
|
-
type:
|
|
1933
|
-
author: (
|
|
1934
|
-
dynasty: (q =
|
|
1935
|
-
role: (
|
|
1936
|
-
edition:
|
|
1928
|
+
title: L.title || Z,
|
|
1929
|
+
type: L.type || "work",
|
|
1930
|
+
author: (G = K == null ? void 0 : K[0]) == null ? void 0 : G.name,
|
|
1931
|
+
dynasty: (q = K == null ? void 0 : K[0]) == null ? void 0 : q.dynasty,
|
|
1932
|
+
role: (oe = K == null ? void 0 : K[0]) == null ? void 0 : oe.role,
|
|
1933
|
+
edition: L.edition || void 0
|
|
1937
1934
|
};
|
|
1938
1935
|
}
|
|
1939
1936
|
} catch {
|
|
@@ -1941,17 +1938,17 @@ const qn = {
|
|
|
1941
1938
|
return { id: Z, title: Z, type: "work", notFound: !0 };
|
|
1942
1939
|
})
|
|
1943
1940
|
).then((Z) => {
|
|
1944
|
-
M || (
|
|
1941
|
+
M || (D(Z), R(!1));
|
|
1945
1942
|
}), () => {
|
|
1946
1943
|
M = !0;
|
|
1947
1944
|
};
|
|
1948
|
-
}, [
|
|
1945
|
+
}, [N, e]);
|
|
1949
1946
|
const Te = (M) => {
|
|
1950
|
-
|
|
1947
|
+
B(M.id), Yn(M.id), U(Ae()), r == null || r(M);
|
|
1951
1948
|
}, Re = (M) => {
|
|
1952
|
-
Gn(M),
|
|
1949
|
+
Gn(M), U(Ae());
|
|
1953
1950
|
}, qe = () => {
|
|
1954
|
-
Jn(),
|
|
1951
|
+
Jn(), U([]);
|
|
1955
1952
|
}, He = (M) => b.find((Z) => Z.type === M), Ze = z && (z.works.length > 0 || z.books.length > 0 || z.collections.length > 0);
|
|
1956
1953
|
return /* @__PURE__ */ i("div", { className: "bim-browser-container", children: [
|
|
1957
1954
|
/* @__PURE__ */ t("header", { style: { padding: "12px 20px", borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
@@ -2000,7 +1997,7 @@ const qn = {
|
|
|
2000
1997
|
}
|
|
2001
1998
|
)
|
|
2002
1999
|
] }),
|
|
2003
|
-
|
|
2000
|
+
V && O && /* @__PURE__ */ i("div", { style: {
|
|
2004
2001
|
padding: "0 20px 8px",
|
|
2005
2002
|
fontSize: "12px",
|
|
2006
2003
|
color: "var(--bim-desc-fg, #999)",
|
|
@@ -2009,64 +2006,64 @@ const qn = {
|
|
|
2009
2006
|
flexWrap: "wrap",
|
|
2010
2007
|
gap: "4px"
|
|
2011
2008
|
}, children: [
|
|
2012
|
-
/* @__PURE__ */ t("span", { children:
|
|
2013
|
-
(
|
|
2009
|
+
/* @__PURE__ */ t("span", { children: te ? /* @__PURE__ */ i(j, { children: [
|
|
2010
|
+
(te.book ?? 0) > 0 && /* @__PURE__ */ i(j, { children: [
|
|
2014
2011
|
"書 ",
|
|
2015
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2012
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: te.book.toLocaleString() }),
|
|
2016
2013
|
" 部 ,",
|
|
2017
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2014
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.books.toLocaleString() }),
|
|
2018
2015
|
" 本"
|
|
2019
2016
|
] }),
|
|
2020
|
-
|
|
2017
|
+
te.article ? /* @__PURE__ */ i(j, { children: [
|
|
2021
2018
|
/* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
|
|
2022
2019
|
"文章 ",
|
|
2023
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2020
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: te.article.toLocaleString() }),
|
|
2024
2021
|
" 篇"
|
|
2025
2022
|
] }) : null,
|
|
2026
|
-
|
|
2023
|
+
te.poem ? /* @__PURE__ */ i(j, { children: [
|
|
2027
2024
|
/* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
|
|
2028
2025
|
"詩詞 ",
|
|
2029
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2026
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: te.poem.toLocaleString() }),
|
|
2030
2027
|
" 首"
|
|
2031
2028
|
] }) : null,
|
|
2032
2029
|
/* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
|
|
2033
2030
|
"叢編 ",
|
|
2034
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2031
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.collections.toLocaleString() })
|
|
2035
2032
|
] }) : /* @__PURE__ */ i(j, { children: [
|
|
2036
2033
|
p.indexType.work,
|
|
2037
2034
|
" ",
|
|
2038
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2035
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.works.toLocaleString() }),
|
|
2039
2036
|
/* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
|
|
2040
2037
|
p.indexType.book,
|
|
2041
2038
|
" ",
|
|
2042
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2039
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.books.toLocaleString() }),
|
|
2043
2040
|
/* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
|
|
2044
2041
|
p.indexType.collection,
|
|
2045
2042
|
" ",
|
|
2046
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2047
|
-
|
|
2043
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.collections.toLocaleString() }),
|
|
2044
|
+
V.entities > 0 && /* @__PURE__ */ i(j, { children: [
|
|
2048
2045
|
/* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
|
|
2049
2046
|
p.indexType.entity,
|
|
2050
2047
|
" ",
|
|
2051
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2048
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.entities.toLocaleString() })
|
|
2052
2049
|
] })
|
|
2053
2050
|
] }) }),
|
|
2054
|
-
|
|
2051
|
+
V.hasImage != null && V.hasText != null && /* @__PURE__ */ i("span", { children: [
|
|
2055
2052
|
p.resourceType.image,
|
|
2056
2053
|
" ",
|
|
2057
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2054
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.hasImage.toLocaleString() }),
|
|
2058
2055
|
/* @__PURE__ */ t("span", { style: { margin: "0 6px" }, children: "·" }),
|
|
2059
2056
|
p.resourceType.text,
|
|
2060
2057
|
" ",
|
|
2061
|
-
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children:
|
|
2058
|
+
/* @__PURE__ */ t("strong", { style: { color: "var(--bim-fg, #555)" }, children: V.hasText.toLocaleString() })
|
|
2062
2059
|
] })
|
|
2063
2060
|
] }),
|
|
2064
|
-
/* @__PURE__ */ t("div", { style: { padding: "0 20px 20px", flex: 1, display: "flex", flexDirection: "column", overflow: "auto" }, children:
|
|
2061
|
+
/* @__PURE__ */ t("div", { style: { padding: "0 20px 20px", flex: 1, display: "flex", flexDirection: "column", overflow: "auto" }, children: I ? /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "40px", color: "var(--bim-desc-fg, #717171)" }, children: p.search.searching }) : W ? /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "40px" }, children: [
|
|
2065
2062
|
/* @__PURE__ */ t("div", { style: { fontSize: "24px", marginBottom: "8px" }, children: "⚠️" }),
|
|
2066
2063
|
/* @__PURE__ */ t("p", { style: { color: "var(--bim-desc-fg, #717171)" }, children: W })
|
|
2067
|
-
] }) :
|
|
2064
|
+
] }) : O ? (
|
|
2068
2065
|
/* Recent entries view */
|
|
2069
|
-
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: C ? /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "40px", color: "var(--bim-desc-fg, #717171)" }, children: p.search.loading }) :
|
|
2066
|
+
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: C ? /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "40px", color: "var(--bim-desc-fg, #717171)" }, children: p.search.loading }) : T.length > 0 ? /* @__PURE__ */ i(j, { children: [
|
|
2070
2067
|
/* @__PURE__ */ i("div", { style: { padding: "8px 0", fontSize: "12px", color: "var(--bim-desc-fg, #717171)", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
2071
2068
|
/* @__PURE__ */ t("span", { children: p.search.recentBrowse }),
|
|
2072
2069
|
/* @__PURE__ */ t(
|
|
@@ -2085,7 +2082,7 @@ const qn = {
|
|
|
2085
2082
|
}
|
|
2086
2083
|
)
|
|
2087
2084
|
] }),
|
|
2088
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children:
|
|
2085
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: T.slice(0, P ? 10 : 3).map((M) => M.notFound ? /* @__PURE__ */ t(
|
|
2089
2086
|
Zn,
|
|
2090
2087
|
{
|
|
2091
2088
|
id: M.id,
|
|
@@ -2097,17 +2094,17 @@ const qn = {
|
|
|
2097
2094
|
yt,
|
|
2098
2095
|
{
|
|
2099
2096
|
entry: M,
|
|
2100
|
-
selected:
|
|
2097
|
+
selected: y === M.id,
|
|
2101
2098
|
onClick: Te,
|
|
2102
2099
|
getConfig: He,
|
|
2103
2100
|
onRemove: Re
|
|
2104
2101
|
},
|
|
2105
2102
|
M.id
|
|
2106
2103
|
)) }),
|
|
2107
|
-
!
|
|
2104
|
+
!P && T.length > 3 && /* @__PURE__ */ t(
|
|
2108
2105
|
"button",
|
|
2109
2106
|
{
|
|
2110
|
-
onClick: () =>
|
|
2107
|
+
onClick: () => J(!0),
|
|
2111
2108
|
style: {
|
|
2112
2109
|
display: "block",
|
|
2113
2110
|
margin: "8px auto 0",
|
|
@@ -2129,10 +2126,10 @@ const qn = {
|
|
|
2129
2126
|
] }) })
|
|
2130
2127
|
) : Ze ? (
|
|
2131
2128
|
/* Grouped search results */
|
|
2132
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: b.map(({ type: M, icon: Z, name:
|
|
2133
|
-
const
|
|
2134
|
-
if (
|
|
2135
|
-
const ue = !(v === M) &&
|
|
2129
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: b.map(({ type: M, icon: Z, name: G, key: q }) => {
|
|
2130
|
+
const oe = z[q] ?? [], L = qn[q], K = z[L] ?? 0;
|
|
2131
|
+
if (oe.length === 0) return null;
|
|
2132
|
+
const ue = !(v === M) && K > Xe;
|
|
2136
2133
|
return /* @__PURE__ */ i("div", { children: [
|
|
2137
2134
|
/* @__PURE__ */ i("div", { style: {
|
|
2138
2135
|
display: "flex",
|
|
@@ -2145,9 +2142,9 @@ const qn = {
|
|
|
2145
2142
|
/* @__PURE__ */ i("span", { style: { fontSize: "13px", fontWeight: 600, color: "var(--bim-fg, #333)" }, children: [
|
|
2146
2143
|
Z,
|
|
2147
2144
|
" ",
|
|
2148
|
-
|
|
2145
|
+
G,
|
|
2149
2146
|
/* @__PURE__ */ i("span", { style: { fontWeight: 400, color: "var(--bim-desc-fg, #717171)", marginLeft: "6px" }, children: [
|
|
2150
|
-
|
|
2147
|
+
K,
|
|
2151
2148
|
" ",
|
|
2152
2149
|
p.unit.items
|
|
2153
2150
|
] })
|
|
@@ -2167,11 +2164,11 @@ const qn = {
|
|
|
2167
2164
|
}
|
|
2168
2165
|
)
|
|
2169
2166
|
] }),
|
|
2170
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children:
|
|
2167
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: oe.map((fe) => /* @__PURE__ */ t(
|
|
2171
2168
|
yt,
|
|
2172
2169
|
{
|
|
2173
2170
|
entry: fe,
|
|
2174
|
-
selected:
|
|
2171
|
+
selected: y === fe.id,
|
|
2175
2172
|
onClick: Te,
|
|
2176
2173
|
getConfig: He,
|
|
2177
2174
|
query: S
|
|
@@ -2187,7 +2184,7 @@ const qn = {
|
|
|
2187
2184
|
] }) })
|
|
2188
2185
|
] });
|
|
2189
2186
|
}, yt = ({ entry: e, selected: n, onClick: o, getConfig: r, query: a, onRemove: l }) => {
|
|
2190
|
-
const c = H(), { convert: s } =
|
|
2187
|
+
const c = H(), { convert: s } = Y(), d = [...e.additional_titles || [], ...e.attached_texts || []], u = a && d.length ? d.find((g) => {
|
|
2191
2188
|
const f = typeof g == "string" ? g : g == null ? void 0 : g.book_title;
|
|
2192
2189
|
return f == null ? void 0 : f.toLowerCase().includes(a.toLowerCase());
|
|
2193
2190
|
}) : void 0;
|
|
@@ -2314,7 +2311,7 @@ function Xn(e) {
|
|
|
2314
2311
|
return !e.dynasty && !e.birth_year && !e.death_year && (!e.alt_names || e.alt_names.length === 0) && !((n = e.description) != null && n.text);
|
|
2315
2312
|
}
|
|
2316
2313
|
function Qn({ data: e }) {
|
|
2317
|
-
const { convert: n } =
|
|
2314
|
+
const { convert: n } = Y(), { dynasty: o, birth_year: r, death_year: a } = e, l = [];
|
|
2318
2315
|
return o && l.push(`〔${n(o)}〕`), r !== void 0 && a !== void 0 ? l.push(`${r}—${a}`) : r !== void 0 ? l.push(`${r}—?`) : a !== void 0 && l.push(`?—${a}`), l.length === 0 ? null : /* @__PURE__ */ t("span", { style: {
|
|
2319
2316
|
fontSize: "14px",
|
|
2320
2317
|
color: "var(--bim-desc-fg, #717171)",
|
|
@@ -2323,7 +2320,7 @@ function Qn({ data: e }) {
|
|
|
2323
2320
|
}, children: l.join(" ") });
|
|
2324
2321
|
}
|
|
2325
2322
|
function eo({ alt_names: e }) {
|
|
2326
|
-
const { convert: n } =
|
|
2323
|
+
const { convert: n } = Y(), o = /* @__PURE__ */ new Map();
|
|
2327
2324
|
for (const l of e) {
|
|
2328
2325
|
const c = l.type || "別名";
|
|
2329
2326
|
o.has(c) || o.set(c, []), o.get(c).push(l.name);
|
|
@@ -2411,8 +2408,8 @@ function to({ data: e }) {
|
|
|
2411
2408
|
}, children: o });
|
|
2412
2409
|
}
|
|
2413
2410
|
function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
|
|
2414
|
-
const a = H(), { convert: l } =
|
|
2415
|
-
|
|
2411
|
+
const a = H(), { convert: l } = Y(), c = de(), [s, d] = w(/* @__PURE__ */ new Map());
|
|
2412
|
+
$(() => {
|
|
2416
2413
|
if (!n) return;
|
|
2417
2414
|
let x = !1;
|
|
2418
2415
|
const p = e.map((S) => S.work_id);
|
|
@@ -2422,9 +2419,9 @@ function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
|
|
|
2422
2419
|
try {
|
|
2423
2420
|
const v = await n.getEntriesByIds(p);
|
|
2424
2421
|
let k = !0;
|
|
2425
|
-
for (let
|
|
2426
|
-
const _ = v[
|
|
2427
|
-
_ != null && _.title ? S.set(p[
|
|
2422
|
+
for (let I = 0; I < p.length; I++) {
|
|
2423
|
+
const _ = v[I];
|
|
2424
|
+
_ != null && _.title ? S.set(p[I], _.title) : _ != null && _.primary_name ? S.set(p[I], _.primary_name) : k = !1;
|
|
2428
2425
|
}
|
|
2429
2426
|
if (k) return S;
|
|
2430
2427
|
} catch {
|
|
@@ -2432,15 +2429,15 @@ function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
|
|
|
2432
2429
|
if (n.getAllEntries)
|
|
2433
2430
|
try {
|
|
2434
2431
|
const v = await n.getAllEntries(), k = new Map(v.map((_) => [_.id, _.title || _.primary_name || _.id]));
|
|
2435
|
-
let
|
|
2432
|
+
let I = !0;
|
|
2436
2433
|
for (const _ of p) {
|
|
2437
|
-
const
|
|
2438
|
-
|
|
2434
|
+
const y = k.get(_);
|
|
2435
|
+
y ? S.set(_, y) : I = !1;
|
|
2439
2436
|
}
|
|
2440
|
-
if (
|
|
2437
|
+
if (I) return S;
|
|
2441
2438
|
} catch {
|
|
2442
2439
|
}
|
|
2443
|
-
const h = [...p], z = 8,
|
|
2440
|
+
const h = [...p], z = 8, m = new Array(z).fill(0).map(async () => {
|
|
2444
2441
|
for (; h.length; ) {
|
|
2445
2442
|
const v = h.shift();
|
|
2446
2443
|
if (!v) break;
|
|
@@ -2453,14 +2450,14 @@ function no({ works: e, transport: n, onNavigate: o, renderLink: r }) {
|
|
|
2453
2450
|
continue;
|
|
2454
2451
|
}
|
|
2455
2452
|
}
|
|
2456
|
-
const k = await n.getItem(v),
|
|
2457
|
-
S.set(v,
|
|
2453
|
+
const k = await n.getItem(v), I = k && (k.title || k.primary_name) || v;
|
|
2454
|
+
S.set(v, I);
|
|
2458
2455
|
} catch {
|
|
2459
2456
|
S.set(v, v);
|
|
2460
2457
|
}
|
|
2461
2458
|
}
|
|
2462
2459
|
});
|
|
2463
|
-
return await Promise.all(
|
|
2460
|
+
return await Promise.all(m), S;
|
|
2464
2461
|
})().then((S) => {
|
|
2465
2462
|
x || d(S);
|
|
2466
2463
|
}), () => {
|
|
@@ -2549,7 +2546,7 @@ const oo = ({
|
|
|
2549
2546
|
headerExtra: a
|
|
2550
2547
|
}) => {
|
|
2551
2548
|
var g;
|
|
2552
|
-
const l = H(), { convert: c } =
|
|
2549
|
+
const l = H(), { convert: c } = Y();
|
|
2553
2550
|
let s = !1;
|
|
2554
2551
|
try {
|
|
2555
2552
|
s = Vt(e.id) === "draft";
|
|
@@ -2720,7 +2717,7 @@ function lo({ id: e }) {
|
|
|
2720
2717
|
)
|
|
2721
2718
|
] });
|
|
2722
2719
|
}
|
|
2723
|
-
function
|
|
2720
|
+
function le({ children: e, extra: n }) {
|
|
2724
2721
|
return /* @__PURE__ */ i("div", { style: {
|
|
2725
2722
|
display: "flex",
|
|
2726
2723
|
alignItems: "center",
|
|
@@ -2745,7 +2742,7 @@ function xe({ label: e, children: n }) {
|
|
|
2745
2742
|
] });
|
|
2746
2743
|
}
|
|
2747
2744
|
function en({ authors: e, type: n, onNavigate: o, renderLink: r }) {
|
|
2748
|
-
const { convert: a } =
|
|
2745
|
+
const { convert: a } = Y();
|
|
2749
2746
|
return /* @__PURE__ */ t("span", { style: {
|
|
2750
2747
|
fontSize: "14px",
|
|
2751
2748
|
color: "var(--bim-fg, #333)",
|
|
@@ -2850,11 +2847,11 @@ function ao({ id: e, title: n, edition: o, type: r, isDraft: a, authors: l, volu
|
|
|
2850
2847
|
] });
|
|
2851
2848
|
}
|
|
2852
2849
|
function tn({ items: e, label: n, showMeta: o, onNavigate: r, renderLink: a }) {
|
|
2853
|
-
const l = H(), { convert: c } =
|
|
2850
|
+
const l = H(), { convert: c } = Y();
|
|
2854
2851
|
if (!e.length) return null;
|
|
2855
2852
|
const [s, d] = w(null);
|
|
2856
2853
|
return /* @__PURE__ */ i(j, { children: [
|
|
2857
|
-
/* @__PURE__ */ t(
|
|
2854
|
+
/* @__PURE__ */ t(le, { children: n }),
|
|
2858
2855
|
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: e.map((u, g) => {
|
|
2859
2856
|
const f = s === g;
|
|
2860
2857
|
return /* @__PURE__ */ i("div", { style: {
|
|
@@ -2999,9 +2996,9 @@ function so({ items: e, onNavigate: n, renderLink: o }) {
|
|
|
2999
2996
|
return /* @__PURE__ */ t(tn, { items: e, label: r.section.emendated, onNavigate: n, renderLink: o });
|
|
3000
2997
|
}
|
|
3001
2998
|
function nn({ label: e, items: n }) {
|
|
3002
|
-
const { convert: o } =
|
|
2999
|
+
const { convert: o } = Y();
|
|
3003
3000
|
return n.length ? /* @__PURE__ */ i(j, { children: [
|
|
3004
|
-
/* @__PURE__ */ t(
|
|
3001
|
+
/* @__PURE__ */ t(le, { children: e }),
|
|
3005
3002
|
/* @__PURE__ */ t("div", { style: {
|
|
3006
3003
|
display: "flex",
|
|
3007
3004
|
flexWrap: "wrap",
|
|
@@ -3031,9 +3028,9 @@ function uo({ items: e }) {
|
|
|
3031
3028
|
return /* @__PURE__ */ t(nn, { label: n.section.attachedTexts, items: e });
|
|
3032
3029
|
}
|
|
3033
3030
|
function fo({ items: e }) {
|
|
3034
|
-
const n = H(), { convert: o } =
|
|
3031
|
+
const n = H(), { convert: o } = Y();
|
|
3035
3032
|
return e.length ? /* @__PURE__ */ i(j, { children: [
|
|
3036
|
-
/* @__PURE__ */ t(
|
|
3033
|
+
/* @__PURE__ */ t(le, { children: n.section.appendix }),
|
|
3037
3034
|
/* @__PURE__ */ t("div", { style: {
|
|
3038
3035
|
display: "flex",
|
|
3039
3036
|
flexWrap: "wrap",
|
|
@@ -3060,9 +3057,9 @@ function fo({ items: e }) {
|
|
|
3060
3057
|
] }) : null;
|
|
3061
3058
|
}
|
|
3062
3059
|
function go({ items: e }) {
|
|
3063
|
-
const n = H(), { convert: o } =
|
|
3060
|
+
const n = H(), { convert: o } = Y();
|
|
3064
3061
|
return e.length ? /* @__PURE__ */ i(j, { children: [
|
|
3065
|
-
/* @__PURE__ */ t(
|
|
3062
|
+
/* @__PURE__ */ t(le, { children: n.section.locationHistory }),
|
|
3066
3063
|
/* @__PURE__ */ i("div", { style: { position: "relative", paddingLeft: "18px" }, children: [
|
|
3067
3064
|
/* @__PURE__ */ t("div", { style: {
|
|
3068
3065
|
position: "absolute",
|
|
@@ -3090,9 +3087,9 @@ function go({ items: e }) {
|
|
|
3090
3087
|
] }) : null;
|
|
3091
3088
|
}
|
|
3092
3089
|
function ho({ items: e }) {
|
|
3093
|
-
const n = H(), { convert: o } =
|
|
3090
|
+
const n = H(), { convert: o } = Y();
|
|
3094
3091
|
return e.length ? /* @__PURE__ */ i(j, { children: [
|
|
3095
|
-
/* @__PURE__ */ t(
|
|
3092
|
+
/* @__PURE__ */ t(le, { children: n.section.historyOverview }),
|
|
3096
3093
|
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: e.map((r, a) => /* @__PURE__ */ i("div", { style: {
|
|
3097
3094
|
fontSize: "13px",
|
|
3098
3095
|
color: "var(--bim-fg, #333)",
|
|
@@ -3111,8 +3108,8 @@ function ho({ items: e }) {
|
|
|
3111
3108
|
] }) : null;
|
|
3112
3109
|
}
|
|
3113
3110
|
function kt({ title: e, ids: n, transport: o, onNavigate: r, renderLink: a }) {
|
|
3114
|
-
const { convert: l } =
|
|
3115
|
-
return
|
|
3111
|
+
const { convert: l } = Y(), [c, s] = w([]);
|
|
3112
|
+
return $(() => {
|
|
3116
3113
|
if (!n.length) {
|
|
3117
3114
|
s([]);
|
|
3118
3115
|
return;
|
|
@@ -3137,7 +3134,7 @@ function kt({ title: e, ids: n, transport: o, onNavigate: r, renderLink: a }) {
|
|
|
3137
3134
|
d = !0;
|
|
3138
3135
|
};
|
|
3139
3136
|
}, [n, o]), n.length ? /* @__PURE__ */ i(j, { children: [
|
|
3140
|
-
/* @__PURE__ */ i(
|
|
3137
|
+
/* @__PURE__ */ i(le, { children: [
|
|
3141
3138
|
e,
|
|
3142
3139
|
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
|
|
3143
3140
|
"(",
|
|
@@ -3166,7 +3163,7 @@ function kt({ title: e, ids: n, transport: o, onNavigate: r, renderLink: a }) {
|
|
|
3166
3163
|
] }) : null;
|
|
3167
3164
|
}
|
|
3168
3165
|
function xo({ book: e, onNavigate: n, renderLink: o }) {
|
|
3169
|
-
const r = H(), { convert: a } =
|
|
3166
|
+
const r = H(), { convert: a } = Y(), [l, c] = w(!1), s = e.resources && e.resources.length > 0, d = e.edition ? a(e.edition) : a(e.title) || void 0;
|
|
3170
3167
|
return /* @__PURE__ */ i("div", { style: {
|
|
3171
3168
|
border: "1px solid var(--bim-widget-border, #e0e0e0)",
|
|
3172
3169
|
borderRadius: "6px",
|
|
@@ -3204,7 +3201,7 @@ function xo({ book: e, onNavigate: n, renderLink: o }) {
|
|
|
3204
3201
|
}
|
|
3205
3202
|
function bo({ ids: e, transport: n, onNavigate: o, renderLink: r }) {
|
|
3206
3203
|
const a = H(), [l, c] = w([]);
|
|
3207
|
-
return
|
|
3204
|
+
return $(() => {
|
|
3208
3205
|
if (!e.length) {
|
|
3209
3206
|
c([]);
|
|
3210
3207
|
return;
|
|
@@ -3229,7 +3226,7 @@ function bo({ ids: e, transport: n, onNavigate: o, renderLink: r }) {
|
|
|
3229
3226
|
s = !0;
|
|
3230
3227
|
};
|
|
3231
3228
|
}, [e, n]), e.length ? /* @__PURE__ */ i(j, { children: [
|
|
3232
|
-
/* @__PURE__ */ i(
|
|
3229
|
+
/* @__PURE__ */ i(le, { children: [
|
|
3233
3230
|
a.section.relatedVersions,
|
|
3234
3231
|
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
|
|
3235
3232
|
"(",
|
|
@@ -3242,7 +3239,7 @@ function bo({ ids: e, transport: n, onNavigate: o, renderLink: r }) {
|
|
|
3242
3239
|
}
|
|
3243
3240
|
function mo({ workData: e, onNavigate: n, renderLink: o }) {
|
|
3244
3241
|
var l, c, s;
|
|
3245
|
-
const r = H(), { convert: a } =
|
|
3242
|
+
const r = H(), { convert: a } = Y();
|
|
3246
3243
|
return /* @__PURE__ */ i("div", { style: {
|
|
3247
3244
|
border: "1px solid var(--bim-widget-border, #e0e0e0)",
|
|
3248
3245
|
borderRadius: "8px",
|
|
@@ -3289,7 +3286,7 @@ function mo({ workData: e, onNavigate: n, renderLink: o }) {
|
|
|
3289
3286
|
] });
|
|
3290
3287
|
}
|
|
3291
3288
|
function yo({ items: e, onNavigate: n, renderLink: o }) {
|
|
3292
|
-
const r = H(), { convert: a } =
|
|
3289
|
+
const r = H(), { convert: a } = Y();
|
|
3293
3290
|
return e.length ? /* @__PURE__ */ t("div", { style: {
|
|
3294
3291
|
display: "flex",
|
|
3295
3292
|
flexWrap: "wrap",
|
|
@@ -3324,43 +3321,43 @@ const on = ({
|
|
|
3324
3321
|
className: c,
|
|
3325
3322
|
style: s
|
|
3326
3323
|
}) => {
|
|
3327
|
-
var
|
|
3328
|
-
const d = H(), { convert: u } =
|
|
3329
|
-
if (
|
|
3324
|
+
var O, A, N, U, T, D;
|
|
3325
|
+
const d = H(), { convert: u } = Y(), [g, f] = w(null), [x, p] = w(!1), [b, S] = w(null), [h, z] = w(null), [m, v] = w([]), k = e || g;
|
|
3326
|
+
if ($(() => {
|
|
3330
3327
|
if (e || !n || !o) return;
|
|
3331
3328
|
let C = !1;
|
|
3332
|
-
return p(!0), S(null), o.getItem(n).then((
|
|
3333
|
-
C || (
|
|
3334
|
-
}).catch((
|
|
3335
|
-
C || S(
|
|
3329
|
+
return p(!0), S(null), o.getItem(n).then((R) => {
|
|
3330
|
+
C || (R ? f(R) : S(d.misc.notFoundEntry));
|
|
3331
|
+
}).catch((R) => {
|
|
3332
|
+
C || S(R instanceof Error ? R.message : d.misc.loadFailed);
|
|
3336
3333
|
}).finally(() => {
|
|
3337
3334
|
C || p(!1);
|
|
3338
3335
|
}), () => {
|
|
3339
3336
|
C = !0;
|
|
3340
3337
|
};
|
|
3341
|
-
}, [e, n, o]),
|
|
3338
|
+
}, [e, n, o]), $(() => {
|
|
3342
3339
|
if (!k || !o) {
|
|
3343
3340
|
z(null), v([]);
|
|
3344
3341
|
return;
|
|
3345
3342
|
}
|
|
3346
3343
|
let C = !1;
|
|
3347
|
-
const
|
|
3348
|
-
if (
|
|
3349
|
-
!C &&
|
|
3344
|
+
const R = k.type === "book" || k.type === "collection" ? k.work_id : void 0;
|
|
3345
|
+
if (R ? o.getItem(R).then((P) => {
|
|
3346
|
+
!C && P && P.type === "work" && z(P);
|
|
3350
3347
|
}).catch(() => {
|
|
3351
3348
|
}) : z(null), k.type === "book") {
|
|
3352
|
-
const
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
const
|
|
3356
|
-
return o.getItem(
|
|
3357
|
-
id:
|
|
3358
|
-
title:
|
|
3359
|
-
volume_index:
|
|
3360
|
-
})).catch(() => ({ id:
|
|
3349
|
+
const P = k;
|
|
3350
|
+
P.contained_in && P.contained_in.length > 0 ? Promise.all(
|
|
3351
|
+
P.contained_in.map((J) => {
|
|
3352
|
+
const V = typeof J == "string" ? J : J.id, ee = typeof J == "string" ? void 0 : J.volume_index;
|
|
3353
|
+
return o.getItem(V).then((te) => ({
|
|
3354
|
+
id: V,
|
|
3355
|
+
title: te && te.title || V,
|
|
3356
|
+
volume_index: ee
|
|
3357
|
+
})).catch(() => ({ id: V, title: V, volume_index: ee }));
|
|
3361
3358
|
})
|
|
3362
|
-
).then((
|
|
3363
|
-
C || v(
|
|
3359
|
+
).then((J) => {
|
|
3360
|
+
C || v(J);
|
|
3364
3361
|
}) : v([]);
|
|
3365
3362
|
} else
|
|
3366
3363
|
v([]);
|
|
@@ -3368,13 +3365,13 @@ const on = ({
|
|
|
3368
3365
|
C = !0;
|
|
3369
3366
|
};
|
|
3370
3367
|
}, [k, o]), x)
|
|
3371
|
-
return /* @__PURE__ */ t("div", { className: c, style: { ...s, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [180, 260, 160].map((C,
|
|
3372
|
-
height:
|
|
3368
|
+
return /* @__PURE__ */ t("div", { className: c, style: { ...s, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [180, 260, 160].map((C, R) => /* @__PURE__ */ t("div", { style: {
|
|
3369
|
+
height: R === 1 ? "32px" : "16px",
|
|
3373
3370
|
width: `${C}px`,
|
|
3374
3371
|
background: "var(--bim-widget-border, #e0e0e0)",
|
|
3375
3372
|
borderRadius: "4px",
|
|
3376
3373
|
opacity: 0.4
|
|
3377
|
-
} },
|
|
3374
|
+
} }, R)) }) });
|
|
3378
3375
|
if (b)
|
|
3379
3376
|
return /* @__PURE__ */ t("div", { className: c, style: {
|
|
3380
3377
|
...s,
|
|
@@ -3395,20 +3392,20 @@ const on = ({
|
|
|
3395
3392
|
headerExtra: l
|
|
3396
3393
|
}
|
|
3397
3394
|
) });
|
|
3398
|
-
const
|
|
3399
|
-
let
|
|
3395
|
+
const I = k.type === "book" ? k : null, _ = k.type === "collection" ? k : null, y = k.type === "work" ? k : null;
|
|
3396
|
+
let B = !1;
|
|
3400
3397
|
try {
|
|
3401
|
-
|
|
3398
|
+
B = Vt(k.id) === "draft";
|
|
3402
3399
|
} catch {
|
|
3403
3400
|
}
|
|
3404
3401
|
let W = "";
|
|
3405
|
-
k.measure_info ? W = u(k.measure_info) : (
|
|
3406
|
-
const
|
|
3407
|
-
return (
|
|
3408
|
-
/* @__PURE__ */ t(xe, { label: d.label.parentWork, children: /* @__PURE__ */ t(se, { id:
|
|
3409
|
-
),
|
|
3410
|
-
/* @__PURE__ */ t(xe, { label: d.label.parentWork, children:
|
|
3411
|
-
|
|
3402
|
+
k.measure_info ? W = u(k.measure_info) : (O = k.juan_count) != null && O.number ? W = Xt(k.juan_count.number) + d.unit.juan : (A = k.juan_count) != null && A.description && (W = u(k.juan_count.description));
|
|
3403
|
+
const E = [];
|
|
3404
|
+
return (N = k.publication_info) != null && N.year && E.push(/* @__PURE__ */ t(xe, { label: d.label.year, children: k.publication_info.year }, "year")), (U = k.current_location) != null && U.name && E.push(/* @__PURE__ */ t(xe, { label: d.label.currentLocation, children: u(k.current_location.name) }, "loc")), (T = k.page_count) != null && T.description && E.push(/* @__PURE__ */ t(xe, { label: d.label.pageCount, children: k.page_count.description }, "page")), I != null && I.edition && E.push(/* @__PURE__ */ t(xe, { label: d.label.edition, children: u(I.edition) }, "ver")), y != null && y.parent_work && E.push(
|
|
3405
|
+
/* @__PURE__ */ t(xe, { label: d.label.parentWork, children: /* @__PURE__ */ t(se, { id: y.parent_work.id, label: u(y.parent_work.title), onNavigate: r, renderLink: a }) }, "pw")
|
|
3406
|
+
), y != null && y.parent_works && y.parent_works.length > 0 && !y.parent_work && E.push(
|
|
3407
|
+
/* @__PURE__ */ t(xe, { label: d.label.parentWork, children: y.parent_works.map((C, R) => /* @__PURE__ */ i("span", { children: [
|
|
3408
|
+
R > 0 && "、",
|
|
3412
3409
|
/* @__PURE__ */ t(se, { id: C, onNavigate: r, renderLink: a })
|
|
3413
3410
|
] }, C)) }, "pws")
|
|
3414
3411
|
), /* @__PURE__ */ i("div", { className: c, style: s, children: [
|
|
@@ -3419,28 +3416,28 @@ const on = ({
|
|
|
3419
3416
|
title: u(k.title),
|
|
3420
3417
|
edition: k.edition ? u(k.edition) : void 0,
|
|
3421
3418
|
type: k.type,
|
|
3422
|
-
isDraft:
|
|
3419
|
+
isDraft: B,
|
|
3423
3420
|
authors: k.authors,
|
|
3424
3421
|
volumeText: W,
|
|
3425
|
-
meta:
|
|
3422
|
+
meta: E,
|
|
3426
3423
|
headerExtra: l,
|
|
3427
3424
|
onNavigate: r,
|
|
3428
3425
|
renderLink: a
|
|
3429
3426
|
}
|
|
3430
3427
|
),
|
|
3431
|
-
((
|
|
3428
|
+
((D = k.description) == null ? void 0 : D.text) && /* @__PURE__ */ t("p", { style: {
|
|
3432
3429
|
fontSize: "14px",
|
|
3433
3430
|
color: "var(--bim-fg, #444)",
|
|
3434
3431
|
lineHeight: 1.9,
|
|
3435
3432
|
margin: "0 0 4px",
|
|
3436
3433
|
textAlign: "justify"
|
|
3437
3434
|
}, children: u(k.description.text) }),
|
|
3438
|
-
|
|
3439
|
-
/* @__PURE__ */ t(
|
|
3440
|
-
/* @__PURE__ */ t(yo, { items:
|
|
3435
|
+
m.length > 0 && /* @__PURE__ */ i(j, { children: [
|
|
3436
|
+
/* @__PURE__ */ t(le, { children: d.section.containedIn }),
|
|
3437
|
+
/* @__PURE__ */ t(yo, { items: m, onNavigate: r, renderLink: a })
|
|
3441
3438
|
] }),
|
|
3442
3439
|
h && /* @__PURE__ */ i(j, { children: [
|
|
3443
|
-
/* @__PURE__ */ t(
|
|
3440
|
+
/* @__PURE__ */ t(le, { children: d.section.belongsToWork }),
|
|
3444
3441
|
/* @__PURE__ */ t(mo, { workData: h, onNavigate: r, renderLink: a })
|
|
3445
3442
|
] }),
|
|
3446
3443
|
k.additional_works && k.additional_works.length > 0 && /* @__PURE__ */ t(fo, { items: k.additional_works }),
|
|
@@ -3449,15 +3446,15 @@ const on = ({
|
|
|
3449
3446
|
k.indexed_by && k.indexed_by.length > 0 && /* @__PURE__ */ t(co, { items: k.indexed_by, onNavigate: r, renderLink: a }),
|
|
3450
3447
|
k.emendated_by && k.emendated_by.length > 0 && /* @__PURE__ */ t(so, { items: k.emendated_by, onNavigate: r, renderLink: a }),
|
|
3451
3448
|
k.resources && k.resources.length > 0 && /* @__PURE__ */ i(j, { children: [
|
|
3452
|
-
/* @__PURE__ */ t(
|
|
3449
|
+
/* @__PURE__ */ t(le, { children: d.section.resources }),
|
|
3453
3450
|
/* @__PURE__ */ t(qt, { items: k.resources, groupByType: !0, onNavigate: r, renderLink: a })
|
|
3454
3451
|
] }),
|
|
3455
|
-
(
|
|
3452
|
+
(I == null ? void 0 : I.location_history) && I.location_history.length > 0 && /* @__PURE__ */ t(go, { items: I.location_history }),
|
|
3456
3453
|
(_ == null ? void 0 : _.history) && _.history.length > 0 && /* @__PURE__ */ t(ho, { items: _.history }),
|
|
3457
|
-
(
|
|
3454
|
+
(I == null ? void 0 : I.related_books) && I.related_books.length > 0 && /* @__PURE__ */ t(kt, { title: d.section.relatedVersions, ids: I.related_books, transport: o, onNavigate: r, renderLink: a }),
|
|
3458
3455
|
(_ == null ? void 0 : _.books) && _.books.length > 0 && /* @__PURE__ */ t(kt, { title: d.section.containedBooks, ids: _.books, transport: o, onNavigate: r, renderLink: a }),
|
|
3459
3456
|
(_ == null ? void 0 : _.contained_works) && _.contained_works.length > 0 && /* @__PURE__ */ i("div", { children: [
|
|
3460
|
-
/* @__PURE__ */ i(
|
|
3457
|
+
/* @__PURE__ */ i(le, { children: [
|
|
3461
3458
|
d.section.containedWorks,
|
|
3462
3459
|
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
|
|
3463
3460
|
"(",
|
|
@@ -3476,19 +3473,19 @@ const on = ({
|
|
|
3476
3473
|
background: "var(--bim-input-bg, #fff)"
|
|
3477
3474
|
}, children: /* @__PURE__ */ t(se, { id: C.id, label: u(C.title), onNavigate: r, renderLink: a }) }, C.id)) })
|
|
3478
3475
|
] }),
|
|
3479
|
-
(
|
|
3480
|
-
(
|
|
3481
|
-
const C = [],
|
|
3482
|
-
return
|
|
3483
|
-
/* @__PURE__ */ i(
|
|
3484
|
-
|
|
3476
|
+
(y == null ? void 0 : y.books) && y.books.length > 0 && /* @__PURE__ */ t(bo, { ids: y.books, transport: o, onNavigate: r, renderLink: a }),
|
|
3477
|
+
(y == null ? void 0 : y.related_works) && y.related_works.length > 0 && (() => {
|
|
3478
|
+
const C = [], R = y.related_works.filter((V) => V.relation === "part_of"), P = y.related_works.filter((V) => V.relation === "has_part"), J = y.related_works.filter((V) => !V.relation);
|
|
3479
|
+
return R.length > 0 && C.push({ label: d.section.belongsToWork, items: R }), P.length > 0 && C.push({ label: d.section.containedWorks, items: P }), J.length > 0 && C.push({ label: d.section.relatedWorks, items: J }), C.map((V) => /* @__PURE__ */ i("div", { children: [
|
|
3480
|
+
/* @__PURE__ */ i(le, { children: [
|
|
3481
|
+
V.label,
|
|
3485
3482
|
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--bim-desc-fg, #aaa)", fontWeight: 400 }, children: [
|
|
3486
3483
|
"(",
|
|
3487
|
-
|
|
3484
|
+
V.items.length,
|
|
3488
3485
|
")"
|
|
3489
3486
|
] })
|
|
3490
3487
|
] }),
|
|
3491
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" }, children:
|
|
3488
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" }, children: V.items.map((ee) => /* @__PURE__ */ t("span", { style: {
|
|
3492
3489
|
display: "inline-flex",
|
|
3493
3490
|
alignItems: "center",
|
|
3494
3491
|
gap: "4px",
|
|
@@ -3497,13 +3494,13 @@ const on = ({
|
|
|
3497
3494
|
border: "1px solid var(--bim-widget-border, #e0e0e0)",
|
|
3498
3495
|
borderRadius: "4px",
|
|
3499
3496
|
background: "var(--bim-input-bg, #fff)"
|
|
3500
|
-
}, children: /* @__PURE__ */ t(se, { id:
|
|
3501
|
-
] },
|
|
3497
|
+
}, children: /* @__PURE__ */ t(se, { id: ee.id, label: u(ee.title), onNavigate: r, renderLink: a }) }, ee.id)) })
|
|
3498
|
+
] }, V.label));
|
|
3502
3499
|
})()
|
|
3503
3500
|
] });
|
|
3504
3501
|
};
|
|
3505
3502
|
function vo({ data: e }) {
|
|
3506
|
-
const n = H(), { convert: o } =
|
|
3503
|
+
const n = H(), { convert: o } = Y(), { stats: r } = e, a = r.processed_volumes ?? r.total_found_volumes, l = a != null && e.total_volumes > 0 ? Math.round(a / e.total_volumes * 100) : null;
|
|
3507
3504
|
return /* @__PURE__ */ i("div", { style: { marginBottom: "24px" }, children: [
|
|
3508
3505
|
/* @__PURE__ */ t("h2", { style: {
|
|
3509
3506
|
fontSize: "18px",
|
|
@@ -3649,7 +3646,7 @@ function wo(e, n) {
|
|
|
3649
3646
|
return r - o + 1 === e.length ? `${o}–${r}` : e.length <= 3 ? e.join(", ") : `${o}–${r} (${e.length}${n})`;
|
|
3650
3647
|
}
|
|
3651
3648
|
function wt({ book: e, onNavigate: n, renderLink: o, showVolumes: r }) {
|
|
3652
|
-
const a = H(), { convert: l } =
|
|
3649
|
+
const a = H(), { convert: l } = Y(), c = e.book_id || e.work_id, s = r && e.volumes.length > 0 ? wo(e.volumes, a.unit.volume) : null, d = e.missing_volumes && e.missing_volumes.length > 0;
|
|
3653
3650
|
return /* @__PURE__ */ i("div", { style: {
|
|
3654
3651
|
display: "flex",
|
|
3655
3652
|
alignItems: "baseline",
|
|
@@ -3724,60 +3721,60 @@ const _o = ({
|
|
|
3724
3721
|
className: l,
|
|
3725
3722
|
style: c
|
|
3726
3723
|
}) => {
|
|
3727
|
-
const s = H(), [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(""),
|
|
3728
|
-
|
|
3724
|
+
const s = H(), [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(""), m = e || d;
|
|
3725
|
+
$(() => {
|
|
3729
3726
|
if (e || !n || !(o != null && o.getCollectionCatalog)) return;
|
|
3730
|
-
let
|
|
3731
|
-
return f(!0), p(null), o.getCollectionCatalog(n).then((
|
|
3732
|
-
|
|
3733
|
-
}).catch((
|
|
3734
|
-
|
|
3727
|
+
let y = !1;
|
|
3728
|
+
return f(!0), p(null), o.getCollectionCatalog(n).then((B) => {
|
|
3729
|
+
y || (B ? u(B) : p(s.catalog.notFound));
|
|
3730
|
+
}).catch((B) => {
|
|
3731
|
+
y || p(B instanceof Error ? B.message : s.catalog.loadFailed);
|
|
3735
3732
|
}).finally(() => {
|
|
3736
|
-
|
|
3733
|
+
y || f(!1);
|
|
3737
3734
|
}), () => {
|
|
3738
|
-
|
|
3735
|
+
y = !0;
|
|
3739
3736
|
};
|
|
3740
3737
|
}, [e, n, o, s]);
|
|
3741
|
-
const v = (
|
|
3742
|
-
if (!
|
|
3743
|
-
if (
|
|
3744
|
-
const
|
|
3745
|
-
return new Set(
|
|
3746
|
-
}, [
|
|
3747
|
-
if (!
|
|
3748
|
-
let
|
|
3749
|
-
if (b && (
|
|
3750
|
-
const
|
|
3751
|
-
|
|
3752
|
-
(W) => W.title.toLowerCase().includes(
|
|
3738
|
+
const v = (m == null ? void 0 : m.sections) && m.sections.length > 0, k = ce(() => {
|
|
3739
|
+
if (!m) return !1;
|
|
3740
|
+
if (m.volume_index && Object.keys(m.volume_index).length > 0) return !0;
|
|
3741
|
+
const y = m.books.map((W) => W.volumes[0]).filter((W) => W != null);
|
|
3742
|
+
return new Set(y).size < y.length;
|
|
3743
|
+
}, [m]), I = ce(() => {
|
|
3744
|
+
if (!m) return [];
|
|
3745
|
+
let y = m.books;
|
|
3746
|
+
if (b && (y = y.filter((B) => B.section === b)), h.trim()) {
|
|
3747
|
+
const B = h.trim().toLowerCase();
|
|
3748
|
+
y = y.filter(
|
|
3749
|
+
(W) => W.title.toLowerCase().includes(B) || W.sub_items && W.sub_items.some((E) => E.toLowerCase().includes(B)) || W.edition && W.edition.toLowerCase().includes(B)
|
|
3753
3750
|
);
|
|
3754
3751
|
}
|
|
3755
|
-
return
|
|
3756
|
-
}, [
|
|
3752
|
+
return y;
|
|
3753
|
+
}, [m, b, h]), _ = ce(() => {
|
|
3757
3754
|
if (!k) return null;
|
|
3758
|
-
const
|
|
3759
|
-
for (const
|
|
3760
|
-
if (
|
|
3761
|
-
const
|
|
3762
|
-
|
|
3755
|
+
const y = [], B = /* @__PURE__ */ new Map();
|
|
3756
|
+
for (const E of I) {
|
|
3757
|
+
if (!E.volumes || E.volumes.length === 0) continue;
|
|
3758
|
+
const O = E.volumes[0];
|
|
3759
|
+
B.has(O) || B.set(O, []), B.get(O).push(E);
|
|
3763
3760
|
}
|
|
3764
|
-
const W = [...
|
|
3765
|
-
for (const
|
|
3766
|
-
|
|
3767
|
-
return
|
|
3768
|
-
}, [
|
|
3761
|
+
const W = [...B.keys()].sort((E, O) => E - O);
|
|
3762
|
+
for (const E of W)
|
|
3763
|
+
y.push({ volume: E, books: B.get(E) });
|
|
3764
|
+
return y;
|
|
3765
|
+
}, [I, k]);
|
|
3769
3766
|
return g ? /* @__PURE__ */ t("div", { className: l, style: { ...c, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { color: "var(--bim-desc-fg, #717171)", fontSize: "13px" }, children: s.catalog.loading }) }) : x ? /* @__PURE__ */ t("div", { className: l, style: {
|
|
3770
3767
|
...c,
|
|
3771
3768
|
padding: "24px",
|
|
3772
3769
|
textAlign: "center",
|
|
3773
3770
|
color: "var(--bim-desc-fg, #717171)",
|
|
3774
3771
|
fontSize: "13px"
|
|
3775
|
-
}, children: x }) :
|
|
3776
|
-
/* @__PURE__ */ t(vo, { data:
|
|
3772
|
+
}, children: x }) : m ? /* @__PURE__ */ i("div", { className: l, style: c, children: [
|
|
3773
|
+
/* @__PURE__ */ t(vo, { data: m }),
|
|
3777
3774
|
v && /* @__PURE__ */ t(
|
|
3778
3775
|
ko,
|
|
3779
3776
|
{
|
|
3780
|
-
sections:
|
|
3777
|
+
sections: m.sections,
|
|
3781
3778
|
activeSection: b,
|
|
3782
3779
|
onSelect: S
|
|
3783
3780
|
}
|
|
@@ -3789,7 +3786,7 @@ const _o = ({
|
|
|
3789
3786
|
type: "text",
|
|
3790
3787
|
placeholder: s.search.searchBookName,
|
|
3791
3788
|
value: h,
|
|
3792
|
-
onChange: (
|
|
3789
|
+
onChange: (y) => z(y.target.value),
|
|
3793
3790
|
style: {
|
|
3794
3791
|
width: "100%",
|
|
3795
3792
|
maxWidth: "320px",
|
|
@@ -3808,7 +3805,7 @@ const _o = ({
|
|
|
3808
3805
|
fontSize: "12px",
|
|
3809
3806
|
color: "var(--bim-desc-fg, #999)"
|
|
3810
3807
|
}, children: [
|
|
3811
|
-
|
|
3808
|
+
I.length,
|
|
3812
3809
|
" ",
|
|
3813
3810
|
s.unit.bu
|
|
3814
3811
|
] })
|
|
@@ -3820,7 +3817,7 @@ const _o = ({
|
|
|
3820
3817
|
}, children: [
|
|
3821
3818
|
_ ? (
|
|
3822
3819
|
/* 按册分组模式 */
|
|
3823
|
-
_.map((
|
|
3820
|
+
_.map((y, B) => /* @__PURE__ */ i("div", { children: [
|
|
3824
3821
|
/* @__PURE__ */ t("div", { style: {
|
|
3825
3822
|
padding: "4px 12px",
|
|
3826
3823
|
background: "var(--bim-bg, #f8f8f8)",
|
|
@@ -3831,8 +3828,8 @@ const _o = ({
|
|
|
3831
3828
|
position: "sticky",
|
|
3832
3829
|
top: 0,
|
|
3833
3830
|
zIndex: 1
|
|
3834
|
-
}, children: Ke(s.catalog.volume, { n:
|
|
3835
|
-
|
|
3831
|
+
}, children: Ke(s.catalog.volume, { n: y.volume }) }),
|
|
3832
|
+
y.books.map((W, E) => /* @__PURE__ */ t(
|
|
3836
3833
|
wt,
|
|
3837
3834
|
{
|
|
3838
3835
|
book: W,
|
|
@@ -3840,23 +3837,23 @@ const _o = ({
|
|
|
3840
3837
|
renderLink: a,
|
|
3841
3838
|
showVolumes: W.volumes.length > 1
|
|
3842
3839
|
},
|
|
3843
|
-
`${
|
|
3840
|
+
`${y.volume}-${E}`
|
|
3844
3841
|
))
|
|
3845
|
-
] }, `${
|
|
3842
|
+
] }, `${y.volume}-${B}`))
|
|
3846
3843
|
) : (
|
|
3847
3844
|
/* 平铺模式(百衲本等,每本书独立行) */
|
|
3848
|
-
|
|
3845
|
+
I.map((y, B) => /* @__PURE__ */ t(
|
|
3849
3846
|
wt,
|
|
3850
3847
|
{
|
|
3851
|
-
book:
|
|
3848
|
+
book: y,
|
|
3852
3849
|
onNavigate: r,
|
|
3853
3850
|
renderLink: a,
|
|
3854
3851
|
showVolumes: !0
|
|
3855
3852
|
},
|
|
3856
|
-
|
|
3853
|
+
B
|
|
3857
3854
|
))
|
|
3858
3855
|
),
|
|
3859
|
-
|
|
3856
|
+
I.length === 0 && /* @__PURE__ */ t("div", { style: {
|
|
3860
3857
|
padding: "32px",
|
|
3861
3858
|
textAlign: "center",
|
|
3862
3859
|
color: "var(--bim-desc-fg, #999)",
|
|
@@ -3866,11 +3863,11 @@ const _o = ({
|
|
|
3866
3863
|
] }) : null;
|
|
3867
3864
|
}, Se = () => {
|
|
3868
3865
|
const [e, n] = w(1);
|
|
3869
|
-
return
|
|
3866
|
+
return $(() => {
|
|
3870
3867
|
const o = setInterval(() => n((r) => r >= 3 ? 1 : r + 1), 500);
|
|
3871
3868
|
return () => clearInterval(o);
|
|
3872
3869
|
}, []), /* @__PURE__ */ t("div", { style: { textAlign: "center", padding: "32px 0", color: "var(--bim-desc-fg, #717171)", fontSize: "14px" }, children: "加载中" + ".".repeat(e) });
|
|
3873
|
-
},
|
|
3870
|
+
}, re = 6, Oe = 7, zo = ({
|
|
3874
3871
|
content: e,
|
|
3875
3872
|
children: n,
|
|
3876
3873
|
placement: o = "top",
|
|
@@ -3878,25 +3875,25 @@ const _o = ({
|
|
|
3878
3875
|
maxWidth: a = 280,
|
|
3879
3876
|
wrapperStyle: l
|
|
3880
3877
|
}) => {
|
|
3881
|
-
const [c, s] = w(!1), [d, u] = w(null), g = Q(null), f = Q(null), x = Q(null), p =
|
|
3878
|
+
const [c, s] = w(!1), [d, u] = w(null), g = Q(null), f = Q(null), x = Q(null), p = F(() => {
|
|
3882
3879
|
const h = f.current, z = x.current;
|
|
3883
3880
|
if (!h || !z) return;
|
|
3884
|
-
const
|
|
3881
|
+
const m = h.getBoundingClientRect(), v = z.getBoundingClientRect(), k = window.innerHeight, I = document.documentElement.clientWidth;
|
|
3885
3882
|
let _ = o;
|
|
3886
|
-
o === "top" &&
|
|
3887
|
-
const
|
|
3888
|
-
let
|
|
3889
|
-
|
|
3890
|
-
}, [o]), b =
|
|
3883
|
+
o === "top" && m.top - v.height - Oe < 8 && (_ = "bottom"), o === "bottom" && m.bottom + v.height + Oe > k - 8 && (_ = "top");
|
|
3884
|
+
const y = _ === "top" ? m.top - v.height - Oe : m.bottom + Oe;
|
|
3885
|
+
let B = m.left + m.width / 2 - v.width / 2;
|
|
3886
|
+
B = Math.max(8, Math.min(B, I - v.width - 8)), u({ left: B, top: y, placement: _ });
|
|
3887
|
+
}, [o]), b = F(() => {
|
|
3891
3888
|
g.current && clearTimeout(g.current), g.current = setTimeout(() => s(!0), r);
|
|
3892
|
-
}, [r]), S =
|
|
3889
|
+
}, [r]), S = F(() => {
|
|
3893
3890
|
g.current && clearTimeout(g.current), s(!1), u(null);
|
|
3894
3891
|
}, []);
|
|
3895
|
-
return
|
|
3892
|
+
return $(() => {
|
|
3896
3893
|
if (!c) return;
|
|
3897
3894
|
const h = requestAnimationFrame(p);
|
|
3898
3895
|
return () => cancelAnimationFrame(h);
|
|
3899
|
-
}, [c, p]),
|
|
3896
|
+
}, [c, p]), $(() => () => {
|
|
3900
3897
|
g.current && clearTimeout(g.current);
|
|
3901
3898
|
}, []), /* @__PURE__ */ i(j, { children: [
|
|
3902
3899
|
/* @__PURE__ */ t(
|
|
@@ -3946,19 +3943,19 @@ const _o = ({
|
|
|
3946
3943
|
style: {
|
|
3947
3944
|
position: "absolute",
|
|
3948
3945
|
left: "50%",
|
|
3949
|
-
marginLeft: -
|
|
3946
|
+
marginLeft: -re,
|
|
3950
3947
|
width: 0,
|
|
3951
3948
|
height: 0,
|
|
3952
3949
|
...d.placement === "top" ? {
|
|
3953
|
-
bottom: -
|
|
3954
|
-
borderTop: `${
|
|
3955
|
-
borderLeft: `${
|
|
3956
|
-
borderRight: `${
|
|
3950
|
+
bottom: -re,
|
|
3951
|
+
borderTop: `${re}px solid var(--bim-widget-border, #e0e0e0)`,
|
|
3952
|
+
borderLeft: `${re}px solid transparent`,
|
|
3953
|
+
borderRight: `${re}px solid transparent`
|
|
3957
3954
|
} : {
|
|
3958
|
-
top: -
|
|
3959
|
-
borderBottom: `${
|
|
3960
|
-
borderLeft: `${
|
|
3961
|
-
borderRight: `${
|
|
3955
|
+
top: -re,
|
|
3956
|
+
borderBottom: `${re}px solid var(--bim-widget-border, #e0e0e0)`,
|
|
3957
|
+
borderLeft: `${re}px solid transparent`,
|
|
3958
|
+
borderRight: `${re}px solid transparent`
|
|
3962
3959
|
}
|
|
3963
3960
|
}
|
|
3964
3961
|
}
|
|
@@ -3974,14 +3971,14 @@ const _o = ({
|
|
|
3974
3971
|
height: 0,
|
|
3975
3972
|
...d.placement === "top" ? {
|
|
3976
3973
|
bottom: -5,
|
|
3977
|
-
borderTop: `${
|
|
3978
|
-
borderLeft: `${
|
|
3979
|
-
borderRight: `${
|
|
3974
|
+
borderTop: `${re - 1}px solid var(--bim-input-bg, #fff)`,
|
|
3975
|
+
borderLeft: `${re - 1}px solid transparent`,
|
|
3976
|
+
borderRight: `${re - 1}px solid transparent`
|
|
3980
3977
|
} : {
|
|
3981
3978
|
top: -5,
|
|
3982
|
-
borderBottom: `${
|
|
3983
|
-
borderLeft: `${
|
|
3984
|
-
borderRight: `${
|
|
3979
|
+
borderBottom: `${re - 1}px solid var(--bim-input-bg, #fff)`,
|
|
3980
|
+
borderLeft: `${re - 1}px solid transparent`,
|
|
3981
|
+
borderRight: `${re - 1}px solid transparent`
|
|
3985
3982
|
}
|
|
3986
3983
|
}
|
|
3987
3984
|
}
|
|
@@ -4026,24 +4023,24 @@ function Ro(e, n) {
|
|
|
4026
4023
|
}
|
|
4027
4024
|
return a.replace(/〇$/, "");
|
|
4028
4025
|
}
|
|
4029
|
-
let
|
|
4026
|
+
let Pe = null, De = null;
|
|
4030
4027
|
const Ue = /* @__PURE__ */ new Set();
|
|
4031
4028
|
function Lo() {
|
|
4032
|
-
return
|
|
4033
|
-
|
|
4029
|
+
return Pe ? Promise.resolve() : De || (De = import("opencc-js/t2cn").then((e) => {
|
|
4030
|
+
Pe = e.Converter({ from: "tw", to: "cn" }), Ue.forEach((n) => n());
|
|
4034
4031
|
}).catch(() => {
|
|
4035
|
-
|
|
4032
|
+
Pe = (e) => e, Ue.forEach((e) => e());
|
|
4036
4033
|
}), De);
|
|
4037
4034
|
}
|
|
4038
4035
|
function me() {
|
|
4039
4036
|
const [, e] = w(0);
|
|
4040
|
-
return
|
|
4041
|
-
if (
|
|
4037
|
+
return $(() => {
|
|
4038
|
+
if (Pe) return;
|
|
4042
4039
|
const n = () => e((o) => o + 1);
|
|
4043
4040
|
return Ue.add(n), Lo(), () => {
|
|
4044
4041
|
Ue.delete(n);
|
|
4045
4042
|
};
|
|
4046
|
-
}, []),
|
|
4043
|
+
}, []), Pe ?? ((n) => n);
|
|
4047
4044
|
}
|
|
4048
4045
|
function Ce(e, n) {
|
|
4049
4046
|
return n(e).toLowerCase();
|
|
@@ -4162,33 +4159,33 @@ function $o(e, n) {
|
|
|
4162
4159
|
function sn({ group: e, activeFile: n, onSelect: o, depth: r = 0, juanMeta: a, matchStates: l }) {
|
|
4163
4160
|
var b;
|
|
4164
4161
|
const c = an(e, n || ""), s = $o(e, l), d = typeof s == "number" && s > 0, u = s === 0, [g, f] = w(c || d), x = cn(e), p = !!((b = e.children) != null && b.length);
|
|
4165
|
-
if (
|
|
4162
|
+
if ($(() => {
|
|
4166
4163
|
c && f(!0);
|
|
4167
|
-
}, [c]),
|
|
4164
|
+
}, [c]), $(() => {
|
|
4168
4165
|
d && f(!0);
|
|
4169
4166
|
}, [d]), e.files.length === 1 && !p) {
|
|
4170
|
-
const S = e.files[0], h = n === S, z = l[S],
|
|
4167
|
+
const S = e.files[0], h = n === S, z = l[S], m = z === 0, v = z === "loading", k = typeof z == "number" && z > 0;
|
|
4171
4168
|
return /* @__PURE__ */ i(
|
|
4172
4169
|
"button",
|
|
4173
4170
|
{
|
|
4174
4171
|
onClick: () => {
|
|
4175
|
-
|
|
4172
|
+
m || o(S);
|
|
4176
4173
|
},
|
|
4177
|
-
disabled:
|
|
4174
|
+
disabled: m,
|
|
4178
4175
|
style: {
|
|
4179
4176
|
display: "inline-block",
|
|
4180
4177
|
padding: "3px 8px",
|
|
4181
4178
|
margin: "2px 0",
|
|
4182
4179
|
marginLeft: `${8 + r * 16}px`,
|
|
4183
|
-
border: h ? "1px solid var(--bim-primary, #8e6f3e)" :
|
|
4180
|
+
border: h ? "1px solid var(--bim-primary, #8e6f3e)" : m ? "1px dashed var(--bim-widget-border, #e0e0e0)" : "1px solid var(--bim-widget-border, #e0e0e0)",
|
|
4184
4181
|
borderRadius: "3px",
|
|
4185
4182
|
background: h ? "color-mix(in srgb, var(--bim-primary, #8e6f3e) 10%, transparent)" : k ? `${it}40` : "transparent",
|
|
4186
|
-
color: h ? "var(--bim-primary, #8e6f3e)" :
|
|
4187
|
-
cursor:
|
|
4183
|
+
color: h ? "var(--bim-primary, #8e6f3e)" : m ? "var(--bim-desc-fg, #bbb)" : "var(--bim-fg, #333)",
|
|
4184
|
+
cursor: m ? "not-allowed" : "pointer",
|
|
4188
4185
|
fontSize: "12px",
|
|
4189
4186
|
fontWeight: h ? 600 : 400,
|
|
4190
4187
|
lineHeight: 1.4,
|
|
4191
|
-
opacity:
|
|
4188
|
+
opacity: m ? 0.5 : 1
|
|
4192
4189
|
},
|
|
4193
4190
|
children: [
|
|
4194
4191
|
e.label,
|
|
@@ -4248,7 +4245,7 @@ function sn({ group: e, activeFile: n, onSelect: o, depth: r = 0, juanMeta: a, m
|
|
|
4248
4245
|
] })
|
|
4249
4246
|
] });
|
|
4250
4247
|
}
|
|
4251
|
-
function
|
|
4248
|
+
function Ao({
|
|
4252
4249
|
files: e,
|
|
4253
4250
|
groups: n,
|
|
4254
4251
|
activeFile: o,
|
|
@@ -4267,7 +4264,7 @@ function Po({
|
|
|
4267
4264
|
padding: "4px 0"
|
|
4268
4265
|
}, children: c.map((s) => /* @__PURE__ */ t(ln, { file: s, isActive: o === s, onSelect: r, meta: a == null ? void 0 : a[s], matchState: l[s] }, s)) });
|
|
4269
4266
|
}
|
|
4270
|
-
function
|
|
4267
|
+
function Po({ type: e }) {
|
|
4271
4268
|
const n = at[e] || "#717171";
|
|
4272
4269
|
return /* @__PURE__ */ t("span", { style: {
|
|
4273
4270
|
display: "inline-block",
|
|
@@ -4282,12 +4279,12 @@ function Ao({ type: e }) {
|
|
|
4282
4279
|
}, children: e });
|
|
4283
4280
|
}
|
|
4284
4281
|
function Mo({ section: e, onNavigate: n, highlightQuery: o = "" }) {
|
|
4285
|
-
const { convert: r } =
|
|
4282
|
+
const { convert: r } = Y(), a = de(), l = me(), c = (S) => {
|
|
4286
4283
|
if (!S) return "";
|
|
4287
4284
|
const h = r(S);
|
|
4288
4285
|
return o ? Ie(h, o, l) : h;
|
|
4289
4286
|
}, [s, d] = w(!1), u = !!e.summary, g = !!e.comment, f = !!e.additional_comment, x = !!(e.content && e.content.length > 60), p = u || g || f || x;
|
|
4290
|
-
|
|
4287
|
+
$(() => {
|
|
4291
4288
|
o && d(!0);
|
|
4292
4289
|
}, [o]);
|
|
4293
4290
|
const b = !s && x ? e.content.replace(/\n/g, " ").slice(0, 80) + "…" : null;
|
|
@@ -4469,7 +4466,7 @@ function Mo({ section: e, onNavigate: n, highlightQuery: o = "" }) {
|
|
|
4469
4466
|
] });
|
|
4470
4467
|
}
|
|
4471
4468
|
function Ho({ section: e, highlightQuery: n = "" }) {
|
|
4472
|
-
const { convert: o } =
|
|
4469
|
+
const { convert: o } = Y(), r = me(), a = (d) => {
|
|
4473
4470
|
if (!d) return "";
|
|
4474
4471
|
const u = o(d);
|
|
4475
4472
|
return n ? Ie(u, n, r) : u;
|
|
@@ -4487,7 +4484,7 @@ function Ho({ section: e, highlightQuery: n = "" }) {
|
|
|
4487
4484
|
userSelect: "none"
|
|
4488
4485
|
},
|
|
4489
4486
|
children: [
|
|
4490
|
-
/* @__PURE__ */ t(
|
|
4487
|
+
/* @__PURE__ */ t(Po, { type: e.type }),
|
|
4491
4488
|
/* @__PURE__ */ t("span", { style: {
|
|
4492
4489
|
fontSize: "15px",
|
|
4493
4490
|
fontWeight: 600,
|
|
@@ -4520,7 +4517,7 @@ function Ho({ section: e, highlightQuery: n = "" }) {
|
|
|
4520
4517
|
] });
|
|
4521
4518
|
}
|
|
4522
4519
|
function Oo({ section: e, highlightQuery: n = "" }) {
|
|
4523
|
-
const { convert: o } =
|
|
4520
|
+
const { convert: o } = Y(), r = me();
|
|
4524
4521
|
if (!e.content && !e.title) return null;
|
|
4525
4522
|
const a = o((e.content || e.title || "").replace(/\n{2,}/g, `
|
|
4526
4523
|
`)), l = n ? Ie(a, n, r) : a, c = at[e.type] || "#717171", s = e.type === "序" || e.type === "结语";
|
|
@@ -4553,7 +4550,7 @@ function Oo({ section: e, highlightQuery: n = "" }) {
|
|
|
4553
4550
|
}
|
|
4554
4551
|
function Do(e, n, o) {
|
|
4555
4552
|
const [r, a] = w({});
|
|
4556
|
-
return
|
|
4553
|
+
return $(() => {
|
|
4557
4554
|
var u;
|
|
4558
4555
|
if (!n || e.length === 0) return;
|
|
4559
4556
|
let l = !1;
|
|
@@ -4595,12 +4592,12 @@ function Do(e, n, o) {
|
|
|
4595
4592
|
}, [e.join(","), n]), r;
|
|
4596
4593
|
}
|
|
4597
4594
|
function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highlightQuery: a = "" }) {
|
|
4598
|
-
const { convert: l } =
|
|
4599
|
-
if (!
|
|
4600
|
-
const v = l(
|
|
4595
|
+
const { convert: l } = Y(), c = de(), s = me(), d = (m) => {
|
|
4596
|
+
if (!m) return "";
|
|
4597
|
+
const v = l(m);
|
|
4601
4598
|
return a ? Ie(v, a, s) : v;
|
|
4602
4599
|
}, [u, g] = w(!1);
|
|
4603
|
-
|
|
4600
|
+
$(() => {
|
|
4604
4601
|
a && g(!0);
|
|
4605
4602
|
}, [a]);
|
|
4606
4603
|
const f = e.type, x = Wo[f] || "#717171", p = !!e.content, b = e.work_ids || [], S = b.length > 1, h = Do(
|
|
@@ -4652,8 +4649,8 @@ function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highli
|
|
|
4652
4649
|
"a",
|
|
4653
4650
|
{
|
|
4654
4651
|
href: c(b[0]),
|
|
4655
|
-
onClick: (
|
|
4656
|
-
|
|
4652
|
+
onClick: (m) => {
|
|
4653
|
+
m.metaKey || m.ctrlKey || (m.preventDefault(), m.stopPropagation(), n(b[0]));
|
|
4657
4654
|
},
|
|
4658
4655
|
style: {
|
|
4659
4656
|
fontSize: "11px",
|
|
@@ -4693,14 +4690,14 @@ function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highli
|
|
|
4693
4690
|
display: "flex",
|
|
4694
4691
|
flexWrap: "wrap",
|
|
4695
4692
|
gap: "4px 12px"
|
|
4696
|
-
}, children: b.map((
|
|
4697
|
-
const v = h[
|
|
4693
|
+
}, children: b.map((m) => {
|
|
4694
|
+
const v = h[m], k = v ? `${l(v.title)}${v.author ? `(${l(v.author)})` : ""}` : m.slice(0, 8) + "…";
|
|
4698
4695
|
return /* @__PURE__ */ i(
|
|
4699
4696
|
"a",
|
|
4700
4697
|
{
|
|
4701
|
-
href: c(
|
|
4702
|
-
onClick: (
|
|
4703
|
-
|
|
4698
|
+
href: c(m),
|
|
4699
|
+
onClick: (I) => {
|
|
4700
|
+
I.metaKey || I.ctrlKey || (I.preventDefault(), I.stopPropagation(), n(m));
|
|
4704
4701
|
},
|
|
4705
4702
|
style: {
|
|
4706
4703
|
fontSize: "12px",
|
|
@@ -4709,13 +4706,13 @@ function jo({ section: e, onNavigate: n, transport: o, workLabelCache: r, highli
|
|
|
4709
4706
|
textDecoration: "none",
|
|
4710
4707
|
lineHeight: 1.8
|
|
4711
4708
|
},
|
|
4712
|
-
title:
|
|
4709
|
+
title: m,
|
|
4713
4710
|
children: [
|
|
4714
4711
|
"→",
|
|
4715
4712
|
k
|
|
4716
4713
|
]
|
|
4717
4714
|
},
|
|
4718
|
-
|
|
4715
|
+
m
|
|
4719
4716
|
);
|
|
4720
4717
|
}) }),
|
|
4721
4718
|
u && p && /* @__PURE__ */ i("div", { style: {
|
|
@@ -4752,7 +4749,7 @@ function Fo({
|
|
|
4752
4749
|
transport: r,
|
|
4753
4750
|
workLabelCache: a
|
|
4754
4751
|
}) {
|
|
4755
|
-
const { convert: l } =
|
|
4752
|
+
const { convert: l } = Y(), c = me(), s = n.trim(), d = ce(() => s ? e.sections.filter((f) => lt(f, s, !0, c)) : e.sections, [e.sections, s, c]), u = e.sections.filter((f) => f.type === "考证").length, g = d.filter((f) => f.type === "考证").length;
|
|
4756
4753
|
return /* @__PURE__ */ i("div", { children: [
|
|
4757
4754
|
/* @__PURE__ */ i("div", { style: {
|
|
4758
4755
|
display: "flex",
|
|
@@ -4798,7 +4795,7 @@ function Fo({
|
|
|
4798
4795
|
] });
|
|
4799
4796
|
}
|
|
4800
4797
|
function Uo({ text: e, highlightQuery: n = "" }) {
|
|
4801
|
-
const { convert: o } =
|
|
4798
|
+
const { convert: o } = Y(), r = me(), a = (c) => {
|
|
4802
4799
|
const s = o(c);
|
|
4803
4800
|
return n ? Ie(s, n, r) : s;
|
|
4804
4801
|
}, l = e.split(`
|
|
@@ -4819,7 +4816,7 @@ function Uo({ text: e, highlightQuery: n = "" }) {
|
|
|
4819
4816
|
}) });
|
|
4820
4817
|
}
|
|
4821
4818
|
function Vo({ sections: e, onNavigate: n, highlightQuery: o = "" }) {
|
|
4822
|
-
const { convert: r } =
|
|
4819
|
+
const { convert: r } = Y(), a = de(), l = me(), c = (u) => {
|
|
4823
4820
|
if (!u) return "";
|
|
4824
4821
|
const g = r(u);
|
|
4825
4822
|
return o ? Ie(g, o, l) : g;
|
|
@@ -4855,7 +4852,7 @@ function No({
|
|
|
4855
4852
|
searchQuery: o,
|
|
4856
4853
|
onNavigate: r
|
|
4857
4854
|
}) {
|
|
4858
|
-
const { convert: a } =
|
|
4855
|
+
const { convert: a } = Y(), l = me(), [c, s] = w("catalog"), d = o.trim(), u = ce(() => d ? e.sections.filter((p) => lt(p, d, !1, l)) : e.sections, [e.sections, d, l]), g = e.sections.filter((p) => p.type === "书").length, f = e.sections.filter((p) => p.type === "詩").length, x = d ? u.filter((p) => p.type === "书" || p.type === "詩").length : null;
|
|
4859
4856
|
return /* @__PURE__ */ i("div", { children: [
|
|
4860
4857
|
/* @__PURE__ */ i("div", { style: {
|
|
4861
4858
|
display: "flex",
|
|
@@ -4911,19 +4908,19 @@ function Ct(e) {
|
|
|
4911
4908
|
}
|
|
4912
4909
|
function Ko(e) {
|
|
4913
4910
|
const { workId: n, transport: o, files: r, activeFile: a, activeJuan: l, activeRawText: c, query: s, isKaozhen: d } = e, u = me(), g = Q(/* @__PURE__ */ new Map()), [f, x] = w({});
|
|
4914
|
-
|
|
4911
|
+
$(() => {
|
|
4915
4912
|
a && l && g.current.set(a, { juan: l, rawText: c });
|
|
4916
|
-
}, [a, l, c]),
|
|
4913
|
+
}, [a, l, c]), $(() => {
|
|
4917
4914
|
g.current.clear(), x({});
|
|
4918
4915
|
}, [n]);
|
|
4919
|
-
const p =
|
|
4916
|
+
const p = F((b, S) => {
|
|
4920
4917
|
let h = 0;
|
|
4921
4918
|
if (b.juan)
|
|
4922
4919
|
for (const z of b.juan.sections)
|
|
4923
4920
|
lt(z, S, d, u) && h++;
|
|
4924
4921
|
return h === 0 && b.rawText && Bo(b.rawText, S, u) && (h = 1), h;
|
|
4925
4922
|
}, [d, u]);
|
|
4926
|
-
return
|
|
4923
|
+
return $(() => {
|
|
4927
4924
|
const b = s.trim();
|
|
4928
4925
|
if (!b) {
|
|
4929
4926
|
x({});
|
|
@@ -4933,31 +4930,31 @@ function Ko(e) {
|
|
|
4933
4930
|
let S = !1;
|
|
4934
4931
|
const h = {}, z = [];
|
|
4935
4932
|
for (const _ of r) {
|
|
4936
|
-
const
|
|
4937
|
-
|
|
4933
|
+
const y = g.current.get(_);
|
|
4934
|
+
y ? h[_] = p(y, b) : (h[_] = "loading", z.push(_));
|
|
4938
4935
|
}
|
|
4939
4936
|
x(h);
|
|
4940
|
-
const
|
|
4937
|
+
const m = 8;
|
|
4941
4938
|
let v = 0;
|
|
4942
4939
|
const k = async () => {
|
|
4943
4940
|
var _;
|
|
4944
4941
|
for (; v < z.length; ) {
|
|
4945
4942
|
if (S) return;
|
|
4946
|
-
const
|
|
4943
|
+
const y = v++, B = z[y];
|
|
4947
4944
|
try {
|
|
4948
|
-
const [W,
|
|
4949
|
-
o.getCollatedJuan(n,
|
|
4950
|
-
((_ = o.getCollatedJuanText) == null ? void 0 : _.call(o, n,
|
|
4951
|
-
]),
|
|
4952
|
-
if (g.current.set(
|
|
4953
|
-
x((A) => ({ ...A, [
|
|
4945
|
+
const [W, E] = await Promise.all([
|
|
4946
|
+
o.getCollatedJuan(n, B),
|
|
4947
|
+
((_ = o.getCollatedJuanText) == null ? void 0 : _.call(o, n, B)) ?? Promise.resolve(null)
|
|
4948
|
+
]), O = { juan: W, rawText: E };
|
|
4949
|
+
if (g.current.set(B, O), S) return;
|
|
4950
|
+
x((A) => ({ ...A, [B]: p(O, b) }));
|
|
4954
4951
|
} catch {
|
|
4955
4952
|
if (S) return;
|
|
4956
|
-
x((W) => ({ ...W, [
|
|
4953
|
+
x((W) => ({ ...W, [B]: 0 }));
|
|
4957
4954
|
}
|
|
4958
4955
|
}
|
|
4959
|
-
},
|
|
4960
|
-
return Promise.all(
|
|
4956
|
+
}, I = Array.from({ length: Math.min(m, z.length) }, () => k());
|
|
4957
|
+
return Promise.all(I), () => {
|
|
4961
4958
|
S = !0;
|
|
4962
4959
|
};
|
|
4963
4960
|
}, [s, n, o, r.join(","), p, u]), { matchStates: f };
|
|
@@ -4972,59 +4969,59 @@ const Yo = ({
|
|
|
4972
4969
|
className: c,
|
|
4973
4970
|
style: s
|
|
4974
4971
|
}) => {
|
|
4975
|
-
const [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(null), [
|
|
4972
|
+
const [d, u] = w(null), [g, f] = w(!1), [x, p] = w(null), [b, S] = w(null), [h, z] = w(null), [m, v] = w(!1), [k, I] = w(null), [_, y] = w(""), B = Q(/* @__PURE__ */ new Map()), W = a ?? b, E = F((C) => {
|
|
4976
4973
|
S(C), l == null || l(C);
|
|
4977
|
-
}, [l]),
|
|
4978
|
-
|
|
4974
|
+
}, [l]), O = e || d;
|
|
4975
|
+
$(() => {
|
|
4979
4976
|
e && (f(!1), p(null));
|
|
4980
|
-
}, [e]),
|
|
4977
|
+
}, [e]), $(() => {
|
|
4981
4978
|
if (e || !n || !(o != null && o.getCollatedEditionIndex)) return;
|
|
4982
4979
|
let C = !1;
|
|
4983
|
-
return f(!0), p(null), o.getCollatedEditionIndex(n).then((
|
|
4980
|
+
return f(!0), p(null), o.getCollatedEditionIndex(n).then((R) => {
|
|
4984
4981
|
if (!C)
|
|
4985
|
-
if (!
|
|
4982
|
+
if (!R)
|
|
4986
4983
|
p("未找到整理本数据");
|
|
4987
4984
|
else {
|
|
4988
|
-
u(
|
|
4989
|
-
const
|
|
4990
|
-
!a &&
|
|
4985
|
+
u(R);
|
|
4986
|
+
const P = Ct(R);
|
|
4987
|
+
!a && P && E(P);
|
|
4991
4988
|
}
|
|
4992
|
-
}).catch((
|
|
4993
|
-
C || p(
|
|
4989
|
+
}).catch((R) => {
|
|
4990
|
+
C || p(R instanceof Error ? R.message : "加载失败");
|
|
4994
4991
|
}).finally(() => {
|
|
4995
4992
|
C || f(!1);
|
|
4996
4993
|
}), () => {
|
|
4997
4994
|
C = !0;
|
|
4998
4995
|
};
|
|
4999
|
-
}, [e, n, o, a,
|
|
4996
|
+
}, [e, n, o, a, E]), $(() => {
|
|
5000
4997
|
const C = e || d;
|
|
5001
4998
|
if (C && !W) {
|
|
5002
|
-
const
|
|
5003
|
-
|
|
4999
|
+
const R = Ct(C);
|
|
5000
|
+
R && E(R);
|
|
5004
5001
|
}
|
|
5005
|
-
}, [e, d, W,
|
|
5006
|
-
const A = n || (
|
|
5007
|
-
var
|
|
5002
|
+
}, [e, d, W, E]);
|
|
5003
|
+
const A = n || (O == null ? void 0 : O.work_id), N = F(async (C) => {
|
|
5004
|
+
var R;
|
|
5008
5005
|
if (!(!A || !(o != null && o.getCollatedJuan))) {
|
|
5009
|
-
v(!0), z(null),
|
|
5006
|
+
v(!0), z(null), I(null);
|
|
5010
5007
|
try {
|
|
5011
|
-
const [
|
|
5008
|
+
const [P, J] = await Promise.all([
|
|
5012
5009
|
o.getCollatedJuan(A, C),
|
|
5013
|
-
((
|
|
5010
|
+
((R = o.getCollatedJuanText) == null ? void 0 : R.call(o, A, C)) ?? Promise.resolve(null)
|
|
5014
5011
|
]);
|
|
5015
|
-
z(
|
|
5012
|
+
z(P), I(J);
|
|
5016
5013
|
} catch {
|
|
5017
|
-
z(null),
|
|
5014
|
+
z(null), I(null);
|
|
5018
5015
|
} finally {
|
|
5019
5016
|
v(!1);
|
|
5020
5017
|
}
|
|
5021
5018
|
}
|
|
5022
5019
|
}, [A, o]);
|
|
5023
|
-
|
|
5024
|
-
W &&
|
|
5025
|
-
}, [W,
|
|
5026
|
-
const
|
|
5027
|
-
|
|
5020
|
+
$(() => {
|
|
5021
|
+
W && N(W);
|
|
5022
|
+
}, [W, N]);
|
|
5023
|
+
const U = (C) => {
|
|
5024
|
+
E(C);
|
|
5028
5025
|
};
|
|
5029
5026
|
if (g)
|
|
5030
5027
|
return /* @__PURE__ */ t("div", { className: c, style: { ...s, padding: "24px" }, children: /* @__PURE__ */ t("div", { style: { color: "var(--bim-desc-fg, #717171)", fontSize: "13px" }, children: "加载整理本..." }) });
|
|
@@ -5036,27 +5033,27 @@ const Yo = ({
|
|
|
5036
5033
|
color: "var(--bim-desc-fg, #717171)",
|
|
5037
5034
|
fontSize: "13px"
|
|
5038
5035
|
}, children: x });
|
|
5039
|
-
if (!
|
|
5040
|
-
const
|
|
5036
|
+
if (!O) return null;
|
|
5037
|
+
const T = O.type === "kaozhen", D = dn(O);
|
|
5041
5038
|
return /* @__PURE__ */ t(
|
|
5042
5039
|
Go,
|
|
5043
5040
|
{
|
|
5044
5041
|
className: c,
|
|
5045
5042
|
style: s,
|
|
5046
|
-
index:
|
|
5047
|
-
allFiles:
|
|
5048
|
-
isKaozhen:
|
|
5043
|
+
index: O,
|
|
5044
|
+
allFiles: D,
|
|
5045
|
+
isKaozhen: T,
|
|
5049
5046
|
effectiveWorkId: A,
|
|
5050
5047
|
transport: o,
|
|
5051
5048
|
activeFile: W,
|
|
5052
|
-
handleSelectFile:
|
|
5049
|
+
handleSelectFile: U,
|
|
5053
5050
|
juanData: h,
|
|
5054
5051
|
juanRawText: k,
|
|
5055
|
-
juanLoading:
|
|
5052
|
+
juanLoading: m,
|
|
5056
5053
|
searchQuery: _,
|
|
5057
|
-
setSearchQuery:
|
|
5054
|
+
setSearchQuery: y,
|
|
5058
5055
|
onNavigate: r,
|
|
5059
|
-
workLabelCacheRef:
|
|
5056
|
+
workLabelCacheRef: B
|
|
5060
5057
|
}
|
|
5061
5058
|
);
|
|
5062
5059
|
}, Go = ({
|
|
@@ -5153,7 +5150,7 @@ const Yo = ({
|
|
|
5153
5150
|
})()
|
|
5154
5151
|
] }),
|
|
5155
5152
|
/* @__PURE__ */ t(
|
|
5156
|
-
|
|
5153
|
+
Ao,
|
|
5157
5154
|
{
|
|
5158
5155
|
files: r,
|
|
5159
5156
|
groups: o.juan_groups,
|
|
@@ -5198,14 +5195,14 @@ const Yo = ({
|
|
|
5198
5195
|
marginBottom: "8px",
|
|
5199
5196
|
letterSpacing: "2px"
|
|
5200
5197
|
}, children: "參考文獻" }),
|
|
5201
|
-
o.references.map((z,
|
|
5198
|
+
o.references.map((z, m) => /* @__PURE__ */ i("div", { style: {
|
|
5202
5199
|
fontSize: "12px",
|
|
5203
5200
|
color: "var(--bim-desc-fg, #999)",
|
|
5204
5201
|
lineHeight: 1.8,
|
|
5205
5202
|
paddingLeft: "12px"
|
|
5206
5203
|
}, children: [
|
|
5207
5204
|
/* @__PURE__ */ i("span", { children: [
|
|
5208
|
-
|
|
5205
|
+
m + 1,
|
|
5209
5206
|
". "
|
|
5210
5207
|
] }),
|
|
5211
5208
|
z.url ? /* @__PURE__ */ t(
|
|
@@ -5231,7 +5228,7 @@ const Yo = ({
|
|
|
5231
5228
|
"。",
|
|
5232
5229
|
z.note
|
|
5233
5230
|
] })
|
|
5234
|
-
] },
|
|
5231
|
+
] }, m))
|
|
5235
5232
|
] })
|
|
5236
5233
|
] });
|
|
5237
5234
|
}, Jo = {
|
|
@@ -5331,63 +5328,63 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5331
5328
|
onTabChange: a,
|
|
5332
5329
|
feedbackApiUrl: l
|
|
5333
5330
|
}) => {
|
|
5334
|
-
const c = H(), [s, d] = w(null), [u, g] = w([]), [f, x] = w("recommend"), [p, b] = w([]), [S, h] = w(!1), z = r ?? f,
|
|
5331
|
+
const c = H(), [s, d] = w(null), [u, g] = w([]), [f, x] = w("recommend"), [p, b] = w([]), [S, h] = w(!1), z = r ?? f, m = (A) => {
|
|
5335
5332
|
x(A), a == null || a(A);
|
|
5336
|
-
}, [v, k] = w(!0), [
|
|
5337
|
-
|
|
5333
|
+
}, [v, k] = w(!0), [I, _] = w(null), [y, B] = w(null), [W, E] = w(null);
|
|
5334
|
+
$(() => {
|
|
5338
5335
|
let A = !1;
|
|
5339
|
-
const
|
|
5340
|
-
A || d(
|
|
5341
|
-
},
|
|
5342
|
-
e.getAllEntries && e.getAllEntries().then((
|
|
5343
|
-
|
|
5344
|
-
works:
|
|
5345
|
-
books:
|
|
5346
|
-
collections:
|
|
5336
|
+
const N = (T) => {
|
|
5337
|
+
A || d(T);
|
|
5338
|
+
}, U = () => {
|
|
5339
|
+
e.getAllEntries && e.getAllEntries().then((T) => {
|
|
5340
|
+
N({
|
|
5341
|
+
works: T.filter((D) => D.type === "work").length,
|
|
5342
|
+
books: T.filter((D) => D.type === "book").length,
|
|
5343
|
+
collections: T.filter((D) => D.type === "collection").length
|
|
5347
5344
|
});
|
|
5348
5345
|
}).catch(() => {
|
|
5349
5346
|
});
|
|
5350
5347
|
};
|
|
5351
|
-
return e.getCounts ? e.getCounts().then((
|
|
5348
|
+
return e.getCounts ? e.getCounts().then((T) => N({ works: T.works, books: T.books, collections: T.collections })).catch(U) : U(), () => {
|
|
5352
5349
|
A = !0;
|
|
5353
5350
|
};
|
|
5354
|
-
}, [e]),
|
|
5351
|
+
}, [e]), $(() => {
|
|
5355
5352
|
let A = !1;
|
|
5356
5353
|
return (async () => {
|
|
5357
5354
|
if (o) return o;
|
|
5358
5355
|
if (e.getRecommended)
|
|
5359
5356
|
try {
|
|
5360
|
-
const
|
|
5361
|
-
if (
|
|
5362
|
-
return
|
|
5363
|
-
(
|
|
5357
|
+
const U = await e.getRecommended();
|
|
5358
|
+
if (U != null && U.groups)
|
|
5359
|
+
return U.groups.flatMap(
|
|
5360
|
+
(T) => T.items.map((D) => ({ ...D, group: T.name }))
|
|
5364
5361
|
);
|
|
5365
5362
|
} catch {
|
|
5366
5363
|
}
|
|
5367
5364
|
return [];
|
|
5368
|
-
})().then(async (
|
|
5365
|
+
})().then(async (U) => {
|
|
5369
5366
|
if (A) return;
|
|
5370
|
-
const
|
|
5371
|
-
if (
|
|
5367
|
+
const T = U.filter((C) => C.id);
|
|
5368
|
+
if (T.length === 0) {
|
|
5372
5369
|
k(!1);
|
|
5373
5370
|
return;
|
|
5374
5371
|
}
|
|
5375
|
-
const
|
|
5376
|
-
|
|
5372
|
+
const D = await Promise.all(
|
|
5373
|
+
T.map(async (C) => {
|
|
5377
5374
|
try {
|
|
5378
|
-
let
|
|
5375
|
+
let R = null;
|
|
5379
5376
|
if (e.getEntry)
|
|
5380
|
-
|
|
5377
|
+
R = await e.getEntry(C.id);
|
|
5381
5378
|
else {
|
|
5382
|
-
const
|
|
5383
|
-
|
|
5379
|
+
const P = await e.getItem(C.id);
|
|
5380
|
+
P && (R = {
|
|
5384
5381
|
id: C.id,
|
|
5385
|
-
title:
|
|
5386
|
-
type:
|
|
5382
|
+
title: P.title || C.id,
|
|
5383
|
+
type: P.type || "work"
|
|
5387
5384
|
});
|
|
5388
5385
|
}
|
|
5389
|
-
if (
|
|
5390
|
-
return { ...
|
|
5386
|
+
if (R)
|
|
5387
|
+
return { ...R, group: C.group, fallbackDescription: C.description };
|
|
5391
5388
|
} catch {
|
|
5392
5389
|
}
|
|
5393
5390
|
return {
|
|
@@ -5399,43 +5396,43 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5399
5396
|
};
|
|
5400
5397
|
})
|
|
5401
5398
|
);
|
|
5402
|
-
A || (g(
|
|
5399
|
+
A || (g(D.filter((C) => C !== null)), k(!1));
|
|
5403
5400
|
}), () => {
|
|
5404
5401
|
A = !0;
|
|
5405
5402
|
};
|
|
5406
|
-
}, [e, o]),
|
|
5403
|
+
}, [e, o]), $(() => {
|
|
5407
5404
|
let A = !1;
|
|
5408
|
-
const
|
|
5409
|
-
if (
|
|
5410
|
-
return
|
|
5411
|
-
A || _(
|
|
5405
|
+
const N = e.getCatalogProgress ?? e.getResourceProgress;
|
|
5406
|
+
if (N)
|
|
5407
|
+
return N.call(e).then((U) => {
|
|
5408
|
+
A || _(U);
|
|
5412
5409
|
}).catch(() => {
|
|
5413
5410
|
}), () => {
|
|
5414
5411
|
A = !0;
|
|
5415
5412
|
};
|
|
5416
|
-
}, [e]),
|
|
5413
|
+
}, [e]), $(() => {
|
|
5417
5414
|
if (!e.getCollectionProgress) return;
|
|
5418
5415
|
let A = !1;
|
|
5419
|
-
return e.getCollectionProgress().then((
|
|
5420
|
-
A ||
|
|
5416
|
+
return e.getCollectionProgress().then((N) => {
|
|
5417
|
+
A || B(N);
|
|
5421
5418
|
}).catch(() => {
|
|
5422
5419
|
}), () => {
|
|
5423
5420
|
A = !0;
|
|
5424
5421
|
};
|
|
5425
|
-
}, [e]),
|
|
5422
|
+
}, [e]), $(() => {
|
|
5426
5423
|
if (!e.getSiteProgress) return;
|
|
5427
5424
|
let A = !1;
|
|
5428
|
-
return e.getSiteProgress().then((
|
|
5429
|
-
A ||
|
|
5425
|
+
return e.getSiteProgress().then((N) => {
|
|
5426
|
+
A || E(N);
|
|
5430
5427
|
}).catch(() => {
|
|
5431
5428
|
}), () => {
|
|
5432
5429
|
A = !0;
|
|
5433
5430
|
};
|
|
5434
|
-
}, [e]),
|
|
5431
|
+
}, [e]), $(() => {
|
|
5435
5432
|
if (!l || z !== "feedback") return;
|
|
5436
5433
|
let A = !1;
|
|
5437
|
-
return h(!0), fetch(l).then((
|
|
5438
|
-
!A &&
|
|
5434
|
+
return h(!0), fetch(l).then((N) => N.json()).then((N) => {
|
|
5435
|
+
!A && N.success && b(N.items || []);
|
|
5439
5436
|
}).catch(() => {
|
|
5440
5437
|
}).finally(() => {
|
|
5441
5438
|
A || h(!1);
|
|
@@ -5443,7 +5440,7 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5443
5440
|
A = !0;
|
|
5444
5441
|
};
|
|
5445
5442
|
}, [l, z]);
|
|
5446
|
-
const
|
|
5443
|
+
const O = (A) => {
|
|
5447
5444
|
switch (A) {
|
|
5448
5445
|
case "work":
|
|
5449
5446
|
return "✍️";
|
|
@@ -5475,7 +5472,7 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5475
5472
|
{
|
|
5476
5473
|
label: c.home.recommendTab,
|
|
5477
5474
|
active: z === "recommend",
|
|
5478
|
-
onClick: () =>
|
|
5475
|
+
onClick: () => m("recommend")
|
|
5479
5476
|
}
|
|
5480
5477
|
),
|
|
5481
5478
|
/* @__PURE__ */ t(
|
|
@@ -5483,7 +5480,7 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5483
5480
|
{
|
|
5484
5481
|
label: c.home.catalogTab,
|
|
5485
5482
|
active: z === "catalog",
|
|
5486
|
-
onClick: () =>
|
|
5483
|
+
onClick: () => m("catalog")
|
|
5487
5484
|
}
|
|
5488
5485
|
),
|
|
5489
5486
|
/* @__PURE__ */ t(
|
|
@@ -5491,7 +5488,7 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5491
5488
|
{
|
|
5492
5489
|
label: c.home.collectionTab,
|
|
5493
5490
|
active: z === "collection",
|
|
5494
|
-
onClick: () =>
|
|
5491
|
+
onClick: () => m("collection")
|
|
5495
5492
|
}
|
|
5496
5493
|
),
|
|
5497
5494
|
/* @__PURE__ */ t(
|
|
@@ -5499,7 +5496,7 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5499
5496
|
{
|
|
5500
5497
|
label: c.home.siteTab,
|
|
5501
5498
|
active: z === "site",
|
|
5502
|
-
onClick: () =>
|
|
5499
|
+
onClick: () => m("site")
|
|
5503
5500
|
}
|
|
5504
5501
|
),
|
|
5505
5502
|
l && /* @__PURE__ */ t(
|
|
@@ -5507,7 +5504,7 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5507
5504
|
{
|
|
5508
5505
|
label: c.home.feedbackTab,
|
|
5509
5506
|
active: z === "feedback",
|
|
5510
|
-
onClick: () =>
|
|
5507
|
+
onClick: () => m("feedback")
|
|
5511
5508
|
}
|
|
5512
5509
|
)
|
|
5513
5510
|
] }),
|
|
@@ -5517,12 +5514,12 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5517
5514
|
recommended: u,
|
|
5518
5515
|
loading: v,
|
|
5519
5516
|
onNavigate: n,
|
|
5520
|
-
getIcon:
|
|
5517
|
+
getIcon: O,
|
|
5521
5518
|
t: c
|
|
5522
5519
|
}
|
|
5523
5520
|
),
|
|
5524
|
-
z === "catalog" && /* @__PURE__ */ t(Lt, { progress:
|
|
5525
|
-
z === "collection" && /* @__PURE__ */ t(Lt, { progress:
|
|
5521
|
+
z === "catalog" && /* @__PURE__ */ t(Lt, { progress: I, t: c, onNavigate: n }),
|
|
5522
|
+
z === "collection" && /* @__PURE__ */ t(Lt, { progress: y, t: c, onNavigate: n }),
|
|
5526
5523
|
z === "site" && /* @__PURE__ */ t(sr, { progress: W, t: c, totalWorks: (s == null ? void 0 : s.works) ?? 0 }),
|
|
5527
5524
|
z === "feedback" && l && /* @__PURE__ */ t(Xo, { items: p, loading: S })
|
|
5528
5525
|
] }) });
|
|
@@ -5782,7 +5779,7 @@ const Xo = ({ items: e, loading: n }) => {
|
|
|
5782
5779
|
}, Wt = "(max-width: 768px)";
|
|
5783
5780
|
function dr() {
|
|
5784
5781
|
const [e, n] = w(() => typeof window > "u" ? !1 : window.matchMedia(Wt).matches);
|
|
5785
|
-
return
|
|
5782
|
+
return $(() => {
|
|
5786
5783
|
const o = window.matchMedia(Wt), r = (a) => n(a.matches);
|
|
5787
5784
|
return o.addEventListener("change", r), () => o.removeEventListener("change", r);
|
|
5788
5785
|
}, []), e;
|
|
@@ -5794,22 +5791,22 @@ const _i = ({
|
|
|
5794
5791
|
recommendedIds: r,
|
|
5795
5792
|
headerRight: a
|
|
5796
5793
|
}) => {
|
|
5797
|
-
var
|
|
5798
|
-
const l = H(), { convert: c } =
|
|
5794
|
+
var D;
|
|
5795
|
+
const l = H(), { convert: c } = Y(), s = dr(), [d, u] = w(null), [g, f] = w(null), [x, p] = w(!1), [b, S] = w("detail"), [h, z] = w([]), [m, v] = w(!1), [k, I] = w(null), [_, y] = w(!1), B = F(async (C) => {
|
|
5799
5796
|
if (!e.getCollatedEditionIndex) {
|
|
5800
|
-
|
|
5797
|
+
I(null);
|
|
5801
5798
|
return;
|
|
5802
5799
|
}
|
|
5803
|
-
|
|
5800
|
+
y(!0);
|
|
5804
5801
|
try {
|
|
5805
|
-
const
|
|
5806
|
-
|
|
5802
|
+
const R = await e.getCollatedEditionIndex(C);
|
|
5803
|
+
I(R);
|
|
5807
5804
|
} catch {
|
|
5808
|
-
|
|
5805
|
+
I(null);
|
|
5809
5806
|
} finally {
|
|
5810
|
-
|
|
5807
|
+
y(!1);
|
|
5811
5808
|
}
|
|
5812
|
-
}, [e]), W =
|
|
5809
|
+
}, [e]), W = F(async (C) => {
|
|
5813
5810
|
if (!e.getCollectionCatalogs && !e.getCollectionCatalog) {
|
|
5814
5811
|
z([]);
|
|
5815
5812
|
return;
|
|
@@ -5817,48 +5814,48 @@ const _i = ({
|
|
|
5817
5814
|
v(!0);
|
|
5818
5815
|
try {
|
|
5819
5816
|
if (e.getCollectionCatalogs) {
|
|
5820
|
-
const
|
|
5821
|
-
z(
|
|
5817
|
+
const R = await e.getCollectionCatalogs(C);
|
|
5818
|
+
z(R || []);
|
|
5822
5819
|
} else if (e.getCollectionCatalog) {
|
|
5823
|
-
const
|
|
5824
|
-
z(
|
|
5820
|
+
const R = await e.getCollectionCatalog(C);
|
|
5821
|
+
z(R ? [{ resource_id: "", data: R }] : []);
|
|
5825
5822
|
}
|
|
5826
5823
|
} catch {
|
|
5827
5824
|
z([]);
|
|
5828
5825
|
} finally {
|
|
5829
5826
|
v(!1);
|
|
5830
5827
|
}
|
|
5831
|
-
}, [e]),
|
|
5828
|
+
}, [e]), E = F(async (C) => {
|
|
5832
5829
|
if (o) {
|
|
5833
5830
|
o(C);
|
|
5834
5831
|
return;
|
|
5835
5832
|
}
|
|
5836
|
-
u(C), f(null), z([]),
|
|
5833
|
+
u(C), f(null), z([]), I(null), S("detail"), p(!0);
|
|
5837
5834
|
try {
|
|
5838
|
-
const
|
|
5839
|
-
|
|
5840
|
-
} catch (
|
|
5841
|
-
console.error("加载详情失败:",
|
|
5835
|
+
const R = await e.getItem(C.id);
|
|
5836
|
+
R && (f(R), R.type === "collection" ? W(C.id) : R.type === "work" && R.has_collated && B(C.id));
|
|
5837
|
+
} catch (R) {
|
|
5838
|
+
console.error("加载详情失败:", R);
|
|
5842
5839
|
} finally {
|
|
5843
5840
|
p(!1);
|
|
5844
5841
|
}
|
|
5845
|
-
}, [e, o, W,
|
|
5846
|
-
f(null), z([]),
|
|
5842
|
+
}, [e, o, W, B]), O = F(async (C) => {
|
|
5843
|
+
f(null), z([]), I(null), S("detail"), p(!0);
|
|
5847
5844
|
try {
|
|
5848
|
-
const
|
|
5849
|
-
|
|
5845
|
+
const R = await e.getItem(C);
|
|
5846
|
+
R && (f(R), u({
|
|
5850
5847
|
id: C,
|
|
5851
|
-
title:
|
|
5852
|
-
type:
|
|
5853
|
-
}),
|
|
5854
|
-
} catch (
|
|
5855
|
-
console.error("导航失败:",
|
|
5848
|
+
title: R.title || C,
|
|
5849
|
+
type: R.type || "book"
|
|
5850
|
+
}), R.type === "collection" ? W(C) : R.type === "work" && R.has_collated && B(C));
|
|
5851
|
+
} catch (R) {
|
|
5852
|
+
console.error("导航失败:", R);
|
|
5856
5853
|
} finally {
|
|
5857
5854
|
p(!1);
|
|
5858
5855
|
}
|
|
5859
|
-
}, [e, W,
|
|
5860
|
-
u(null), f(null), z([]),
|
|
5861
|
-
}, []),
|
|
5856
|
+
}, [e, W, B]), A = (g == null ? void 0 : g.type) === "collection" && (h.length > 0 || m) || (g == null ? void 0 : g.type) === "work" && (k || _), N = s && (x || g), U = F(() => {
|
|
5857
|
+
u(null), f(null), z([]), I(null), S("detail");
|
|
5858
|
+
}, []), T = /* @__PURE__ */ t(j, { children: x ? /* @__PURE__ */ t(Se, {}) : g ? /* @__PURE__ */ i(j, { children: [
|
|
5862
5859
|
(A || a) && /* @__PURE__ */ i("div", { style: {
|
|
5863
5860
|
display: "flex",
|
|
5864
5861
|
alignItems: "center",
|
|
@@ -5877,7 +5874,7 @@ const _i = ({
|
|
|
5877
5874
|
children: l.detailTab.basicInfo
|
|
5878
5875
|
}
|
|
5879
5876
|
),
|
|
5880
|
-
g.type === "collection" &&
|
|
5877
|
+
g.type === "collection" && m && h.length === 0 && /* @__PURE__ */ i(
|
|
5881
5878
|
"button",
|
|
5882
5879
|
{
|
|
5883
5880
|
onClick: () => {
|
|
@@ -5917,13 +5914,13 @@ const _i = ({
|
|
|
5917
5914
|
{
|
|
5918
5915
|
data: g,
|
|
5919
5916
|
transport: e,
|
|
5920
|
-
onNavigate:
|
|
5917
|
+
onNavigate: O
|
|
5921
5918
|
}
|
|
5922
5919
|
) : b.startsWith("catalog:") ? /* @__PURE__ */ t(
|
|
5923
5920
|
_o,
|
|
5924
5921
|
{
|
|
5925
|
-
data: (
|
|
5926
|
-
onNavigate:
|
|
5922
|
+
data: (D = h.find((C) => `catalog:${C.resource_id}` === b)) == null ? void 0 : D.data,
|
|
5923
|
+
onNavigate: O
|
|
5927
5924
|
}
|
|
5928
5925
|
) : b === "collated" ? /* @__PURE__ */ t(
|
|
5929
5926
|
Yo,
|
|
@@ -5931,14 +5928,14 @@ const _i = ({
|
|
|
5931
5928
|
index: k || void 0,
|
|
5932
5929
|
workId: g.id,
|
|
5933
5930
|
transport: e,
|
|
5934
|
-
onNavigate:
|
|
5931
|
+
onNavigate: O
|
|
5935
5932
|
}
|
|
5936
5933
|
) : null })
|
|
5937
5934
|
] }) : /* @__PURE__ */ t(
|
|
5938
5935
|
Rt,
|
|
5939
5936
|
{
|
|
5940
5937
|
transport: e,
|
|
5941
|
-
onNavigate:
|
|
5938
|
+
onNavigate: O,
|
|
5942
5939
|
recommendedIds: r
|
|
5943
5940
|
}
|
|
5944
5941
|
) });
|
|
@@ -5949,7 +5946,7 @@ const _i = ({
|
|
|
5949
5946
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif',
|
|
5950
5947
|
background: "var(--bim-bg, #f5f5f5)",
|
|
5951
5948
|
color: "var(--bim-fg, #333)"
|
|
5952
|
-
}, children:
|
|
5949
|
+
}, children: N ? /* @__PURE__ */ i(j, { children: [
|
|
5953
5950
|
/* @__PURE__ */ t("div", { style: {
|
|
5954
5951
|
padding: "8px 12px",
|
|
5955
5952
|
borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)",
|
|
@@ -5958,7 +5955,7 @@ const _i = ({
|
|
|
5958
5955
|
}, children: /* @__PURE__ */ i(
|
|
5959
5956
|
"button",
|
|
5960
5957
|
{
|
|
5961
|
-
onClick:
|
|
5958
|
+
onClick: U,
|
|
5962
5959
|
style: {
|
|
5963
5960
|
padding: "4px 12px",
|
|
5964
5961
|
border: "1px solid var(--bim-widget-border, #e0e0e0)",
|
|
@@ -5974,13 +5971,13 @@ const _i = ({
|
|
|
5974
5971
|
]
|
|
5975
5972
|
}
|
|
5976
5973
|
) }),
|
|
5977
|
-
/* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children:
|
|
5974
|
+
/* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: T })
|
|
5978
5975
|
] }) : /* @__PURE__ */ i("div", { style: { flex: 1, overflow: "auto" }, children: [
|
|
5979
5976
|
/* @__PURE__ */ t(
|
|
5980
5977
|
mt,
|
|
5981
5978
|
{
|
|
5982
5979
|
transport: e,
|
|
5983
|
-
onEntryClick:
|
|
5980
|
+
onEntryClick: E,
|
|
5984
5981
|
hideModeIndicator: n
|
|
5985
5982
|
}
|
|
5986
5983
|
),
|
|
@@ -5988,7 +5985,7 @@ const _i = ({
|
|
|
5988
5985
|
Rt,
|
|
5989
5986
|
{
|
|
5990
5987
|
transport: e,
|
|
5991
|
-
onNavigate:
|
|
5988
|
+
onNavigate: O,
|
|
5992
5989
|
recommendedIds: r
|
|
5993
5990
|
}
|
|
5994
5991
|
)
|
|
@@ -6011,11 +6008,11 @@ const _i = ({
|
|
|
6011
6008
|
mt,
|
|
6012
6009
|
{
|
|
6013
6010
|
transport: e,
|
|
6014
|
-
onEntryClick:
|
|
6011
|
+
onEntryClick: E,
|
|
6015
6012
|
hideModeIndicator: n
|
|
6016
6013
|
}
|
|
6017
6014
|
) }) }),
|
|
6018
|
-
/* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", background: "var(--bim-bg, #f5f5f5)", display: "flex", flexDirection: "column" }, children:
|
|
6015
|
+
/* @__PURE__ */ t("div", { style: { flex: 1, overflow: "auto", background: "var(--bim-bg, #f5f5f5)", display: "flex", flexDirection: "column" }, children: T })
|
|
6019
6016
|
] });
|
|
6020
6017
|
};
|
|
6021
6018
|
function je(e) {
|
|
@@ -6037,7 +6034,7 @@ const zi = ({
|
|
|
6037
6034
|
style: r
|
|
6038
6035
|
}) => {
|
|
6039
6036
|
var g;
|
|
6040
|
-
const a = H(), { convert: l } =
|
|
6037
|
+
const a = H(), { convert: l } = Y(), [c, s] = w(((g = e.divisions[0]) == null ? void 0 : g.name) ?? null), [d, u] = w(null);
|
|
6041
6038
|
return /* @__PURE__ */ i("div", { className: o, style: r, children: [
|
|
6042
6039
|
/* @__PURE__ */ i("div", { style: { marginBottom: "16px" }, children: [
|
|
6043
6040
|
/* @__PURE__ */ t("h2", { style: { fontSize: "18px", fontWeight: 600, color: "var(--bim-fg, #1a1a1a)", margin: "0 0 8px" }, children: l(e.title) }),
|
|
@@ -6081,7 +6078,7 @@ const zi = ({
|
|
|
6081
6078
|
)) })
|
|
6082
6079
|
] });
|
|
6083
6080
|
}, pr = ({ division: e, expanded: n, onToggle: o, expandedCat: r, onCatToggle: a, onNavigate: l }) => {
|
|
6084
|
-
const { convert: c } =
|
|
6081
|
+
const { convert: c } = Y(), s = e.categories.reduce((d, u) => {
|
|
6085
6082
|
const g = u.stats || { zhulu: 0, cunmu: 0 };
|
|
6086
6083
|
return d + (g.zhulu || 0) + (g.cunmu || 0);
|
|
6087
6084
|
}, 0);
|
|
@@ -6136,7 +6133,7 @@ const zi = ({
|
|
|
6136
6133
|
] });
|
|
6137
6134
|
}, ur = ({ category: e, expanded: n, onToggle: o, onNavigate: r }) => {
|
|
6138
6135
|
var d, u, g, f;
|
|
6139
|
-
const { convert: a } =
|
|
6136
|
+
const { convert: a } = Y(), l = ((d = e.books) == null ? void 0 : d.zhulu) || [], c = ((u = e.books) == null ? void 0 : u.cunmu) || [], s = (((g = e.stats) == null ? void 0 : g.zhulu) || l.length) + (((f = e.stats) == null ? void 0 : f.cunmu) || c.length);
|
|
6140
6137
|
return /* @__PURE__ */ i("div", { children: [
|
|
6141
6138
|
/* @__PURE__ */ i(
|
|
6142
6139
|
"button",
|
|
@@ -6177,7 +6174,7 @@ const zi = ({
|
|
|
6177
6174
|
] })
|
|
6178
6175
|
] });
|
|
6179
6176
|
}, Et = ({ label: e, books: n, onNavigate: o }) => {
|
|
6180
|
-
const { convert: r } =
|
|
6177
|
+
const { convert: r } = Y(), a = de(), [l, c] = w(n.length <= 20), s = l ? n : n.slice(0, 10);
|
|
6181
6178
|
return /* @__PURE__ */ i("div", { style: { marginBottom: "8px" }, children: [
|
|
6182
6179
|
/* @__PURE__ */ i("div", { style: { fontSize: "11px", color: "var(--bim-desc-fg, #999)", marginBottom: "4px", fontWeight: 500 }, children: [
|
|
6183
6180
|
e,
|
|
@@ -6264,7 +6261,7 @@ const zi = ({
|
|
|
6264
6261
|
background: "transparent",
|
|
6265
6262
|
color: "var(--bim-fg, #333)",
|
|
6266
6263
|
cursor: "pointer"
|
|
6267
|
-
},
|
|
6264
|
+
}, ae = ({ label: e, value: n, onChange: o, placeholder: r, disabled: a }) => /* @__PURE__ */ i("div", { style: { marginBottom: "16px" }, children: [
|
|
6268
6265
|
/* @__PURE__ */ t("label", { style: {
|
|
6269
6266
|
display: "block",
|
|
6270
6267
|
fontSize: "11px",
|
|
@@ -6295,7 +6292,7 @@ const zi = ({
|
|
|
6295
6292
|
)
|
|
6296
6293
|
] }), ze = ({ value: e, onChange: n, placeholder: o }) => {
|
|
6297
6294
|
const r = Q(null);
|
|
6298
|
-
return
|
|
6295
|
+
return $(() => {
|
|
6299
6296
|
r.current && (r.current.style.height = "auto", r.current.style.height = `${r.current.scrollHeight}px`);
|
|
6300
6297
|
}, [e]), /* @__PURE__ */ t(
|
|
6301
6298
|
"textarea",
|
|
@@ -6339,7 +6336,7 @@ function hr(e) {
|
|
|
6339
6336
|
}
|
|
6340
6337
|
const Qe = ({ value: e, onChange: n, label: o }) => {
|
|
6341
6338
|
const [r, a] = w(!1), l = Q(null), c = hr(e || "");
|
|
6342
|
-
return
|
|
6339
|
+
return $(() => {
|
|
6343
6340
|
r && l.current && l.current.focus();
|
|
6344
6341
|
}, [r]), !r && c ? /* @__PURE__ */ i("div", { style: { marginBottom: "16px" }, children: [
|
|
6345
6342
|
/* @__PURE__ */ t("label", { style: $t, children: o }),
|
|
@@ -6469,12 +6466,12 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
|
|
|
6469
6466
|
!f.type && /* @__PURE__ */ i("div", { children: [
|
|
6470
6467
|
/* @__PURE__ */ t("label", { style: be, children: r.editor.selectSourceType }),
|
|
6471
6468
|
/* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px", marginTop: "8px" }, children: [
|
|
6472
|
-
/* @__PURE__ */ i("button", { onClick: () => u(x, "bookID"), style: { ...
|
|
6469
|
+
/* @__PURE__ */ i("button", { onClick: () => u(x, "bookID"), style: { ...At, borderColor: "#4caf50", color: "#4caf50" }, children: [
|
|
6473
6470
|
/* @__PURE__ */ t("span", { style: { fontSize: "18px" }, children: "📚" }),
|
|
6474
6471
|
/* @__PURE__ */ t("span", { children: "Book ID" }),
|
|
6475
6472
|
/* @__PURE__ */ t("span", { style: { fontSize: "11px", opacity: 0.7 }, children: r.editor.fromExistingBook })
|
|
6476
6473
|
] }),
|
|
6477
|
-
/* @__PURE__ */ i("button", { onClick: () => u(x, "url"), style: { ...
|
|
6474
|
+
/* @__PURE__ */ i("button", { onClick: () => u(x, "url"), style: { ...At, borderColor: "#2196f3", color: "#2196f3" }, children: [
|
|
6478
6475
|
/* @__PURE__ */ t("span", { style: { fontSize: "18px" }, children: "🔗" }),
|
|
6479
6476
|
/* @__PURE__ */ t("span", { children: "URL" }),
|
|
6480
6477
|
/* @__PURE__ */ t("span", { style: { fontSize: "11px", opacity: 0.7 }, children: r.editor.enterUrl })
|
|
@@ -6487,7 +6484,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
|
|
|
6487
6484
|
/* @__PURE__ */ t("button", { onClick: () => {
|
|
6488
6485
|
const p = [...e];
|
|
6489
6486
|
p[x] = { ...p[x], type: "", id: "", name: "" }, n(p);
|
|
6490
|
-
}, style:
|
|
6487
|
+
}, style: Pt, children: r.action.changeType })
|
|
6491
6488
|
] }),
|
|
6492
6489
|
f.id && f.name ? /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: "8px", padding: "10px 14px", background: "var(--bim-bg, #fff)", border: "1px solid #4caf50", borderRadius: "6px" }, children: [
|
|
6493
6490
|
/* @__PURE__ */ t("span", { style: { color: "#4caf50", fontSize: "16px" }, children: "✓" }),
|
|
@@ -6508,7 +6505,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
|
|
|
6508
6505
|
/* @__PURE__ */ t("button", { onClick: () => {
|
|
6509
6506
|
const p = [...e];
|
|
6510
6507
|
p[x] = { ...p[x], type: "", id: "", name: "" }, n(p);
|
|
6511
|
-
}, style:
|
|
6508
|
+
}, style: Pt, children: r.action.changeType })
|
|
6512
6509
|
] }),
|
|
6513
6510
|
/* @__PURE__ */ t("input", { type: "text", value: f.name, onChange: (p) => d(x, "name", p.target.value), placeholder: r.editor.sourceNamePlaceholder, style: we })
|
|
6514
6511
|
] }),
|
|
@@ -6575,7 +6572,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
|
|
|
6575
6572
|
borderRadius: "2px",
|
|
6576
6573
|
fontSize: "13px",
|
|
6577
6574
|
boxSizing: "border-box"
|
|
6578
|
-
},
|
|
6575
|
+
}, At = {
|
|
6579
6576
|
flex: 1,
|
|
6580
6577
|
display: "flex",
|
|
6581
6578
|
flexDirection: "column",
|
|
@@ -6589,7 +6586,7 @@ const mr = ({ items: e, onChange: n, onOpenEntityPicker: o }) => {
|
|
|
6589
6586
|
fontSize: "13px",
|
|
6590
6587
|
fontWeight: 500,
|
|
6591
6588
|
transition: "all 0.2s"
|
|
6592
|
-
},
|
|
6589
|
+
}, Pt = {
|
|
6593
6590
|
background: "transparent",
|
|
6594
6591
|
border: "none",
|
|
6595
6592
|
color: "var(--bim-link-fg, #0066cc)",
|
|
@@ -6929,7 +6926,7 @@ const Sr = {
|
|
|
6929
6926
|
excludeId: u
|
|
6930
6927
|
}) => {
|
|
6931
6928
|
const [g, f] = w(""), x = u ? c.filter((h) => h.id !== u) : c;
|
|
6932
|
-
|
|
6929
|
+
$(() => {
|
|
6933
6930
|
e && (f(""), s(""));
|
|
6934
6931
|
}, [e]);
|
|
6935
6932
|
const p = (h) => {
|
|
@@ -7048,7 +7045,7 @@ const Sr = {
|
|
|
7048
7045
|
onCancel: l
|
|
7049
7046
|
}) => {
|
|
7050
7047
|
const [c, s] = w(""), d = Q(null);
|
|
7051
|
-
|
|
7048
|
+
$(() => {
|
|
7052
7049
|
e && (s((r == null ? void 0 : r.title) || ""), setTimeout(() => {
|
|
7053
7050
|
var x, p;
|
|
7054
7051
|
(x = d.current) == null || x.focus(), (p = d.current) == null || p.select();
|
|
@@ -7118,9 +7115,9 @@ const Sr = {
|
|
|
7118
7115
|
] })
|
|
7119
7116
|
] }),
|
|
7120
7117
|
/* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "flex-end", gap: "8px" }, children: [
|
|
7121
|
-
/* @__PURE__ */ t("button", { onClick: l, style:
|
|
7118
|
+
/* @__PURE__ */ t("button", { onClick: l, style: Ar, children: "取消" }),
|
|
7122
7119
|
/* @__PURE__ */ t("button", { onClick: g, disabled: !c.trim(), style: {
|
|
7123
|
-
...
|
|
7120
|
+
...Pr,
|
|
7124
7121
|
opacity: c.trim() ? 1 : 0.6,
|
|
7125
7122
|
cursor: c.trim() ? "pointer" : "not-allowed"
|
|
7126
7123
|
}, children: "创建" })
|
|
@@ -7155,7 +7152,7 @@ const Sr = {
|
|
|
7155
7152
|
color: "var(--bim-input-fg, #333)",
|
|
7156
7153
|
outline: "none",
|
|
7157
7154
|
boxSizing: "border-box"
|
|
7158
|
-
},
|
|
7155
|
+
}, Ar = {
|
|
7159
7156
|
padding: "8px 16px",
|
|
7160
7157
|
fontSize: "13px",
|
|
7161
7158
|
border: "1px solid var(--bim-widget-border, #e0e0e0)",
|
|
@@ -7163,7 +7160,7 @@ const Sr = {
|
|
|
7163
7160
|
background: "transparent",
|
|
7164
7161
|
color: "var(--bim-fg, #333)",
|
|
7165
7162
|
cursor: "pointer"
|
|
7166
|
-
},
|
|
7163
|
+
}, Pr = {
|
|
7167
7164
|
padding: "8px 16px",
|
|
7168
7165
|
fontSize: "13px",
|
|
7169
7166
|
border: "none",
|
|
@@ -7220,15 +7217,15 @@ const Or = ({
|
|
|
7220
7217
|
onCreate: u,
|
|
7221
7218
|
onSearch: g
|
|
7222
7219
|
}) => {
|
|
7223
|
-
const [f, x] = w(""), [p, b] = w([]), [S, h] = w(!1), [z,
|
|
7224
|
-
|
|
7225
|
-
e && (x(""), b([]),
|
|
7226
|
-
}, [e, r.length]),
|
|
7220
|
+
const [f, x] = w(""), [p, b] = w([]), [S, h] = w(!1), [z, m] = w("recent");
|
|
7221
|
+
$(() => {
|
|
7222
|
+
e && (x(""), b([]), m(r.length > 0 ? "recent" : "search"));
|
|
7223
|
+
}, [e, r.length]), $(() => {
|
|
7227
7224
|
if (!f.trim()) {
|
|
7228
7225
|
b([]);
|
|
7229
7226
|
return;
|
|
7230
7227
|
}
|
|
7231
|
-
const
|
|
7228
|
+
const B = setTimeout(async () => {
|
|
7232
7229
|
h(!0);
|
|
7233
7230
|
try {
|
|
7234
7231
|
b(await g(f, o));
|
|
@@ -7238,16 +7235,16 @@ const Or = ({
|
|
|
7238
7235
|
h(!1);
|
|
7239
7236
|
}
|
|
7240
7237
|
}, 300);
|
|
7241
|
-
return () => clearTimeout(
|
|
7238
|
+
return () => clearTimeout(B);
|
|
7242
7239
|
}, [f, o, g]);
|
|
7243
|
-
const v =
|
|
7244
|
-
x(
|
|
7245
|
-
}, []), k =
|
|
7240
|
+
const v = F((B) => {
|
|
7241
|
+
x(B.target.value), B.target.value.trim() && m("search");
|
|
7242
|
+
}, []), k = F((B) => a ? B.filter((W) => W.id !== a) : B, [a]);
|
|
7246
7243
|
if (!e) return null;
|
|
7247
|
-
const
|
|
7244
|
+
const I = n || (o === "all" ? "选择实体" : `选择${un(o)}`), _ = k(r), y = k(p);
|
|
7248
7245
|
return /* @__PURE__ */ t("div", { style: jr, children: /* @__PURE__ */ i("div", { style: Fr, children: [
|
|
7249
7246
|
/* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px 20px", borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: [
|
|
7250
|
-
/* @__PURE__ */ t("div", { style: { fontSize: "15px", fontWeight: 600 }, children:
|
|
7247
|
+
/* @__PURE__ */ t("div", { style: { fontSize: "15px", fontWeight: 600 }, children: I }),
|
|
7251
7248
|
/* @__PURE__ */ t("button", { onClick: d, style: Ur, children: "✕" })
|
|
7252
7249
|
] }),
|
|
7253
7250
|
/* @__PURE__ */ t("div", { style: { padding: "16px 20px 12px" }, children: /* @__PURE__ */ i("div", { style: { position: "relative" }, children: [
|
|
@@ -7266,17 +7263,17 @@ const Or = ({
|
|
|
7266
7263
|
S && /* @__PURE__ */ t("span", { style: { position: "absolute", right: "14px", top: "50%", transform: "translateY(-50%)", fontSize: "12px", opacity: 0.6 }, children: "搜索中..." })
|
|
7267
7264
|
] }) }),
|
|
7268
7265
|
_.length > 0 && /* @__PURE__ */ i("div", { style: { display: "flex", padding: "0 20px", gap: "4px", borderBottom: "1px solid var(--bim-widget-border, #e0e0e0)" }, children: [
|
|
7269
|
-
/* @__PURE__ */ i(Ot, { active: z === "recent", onClick: () =>
|
|
7266
|
+
/* @__PURE__ */ i(Ot, { active: z === "recent", onClick: () => m("recent"), children: [
|
|
7270
7267
|
"最近使用 (",
|
|
7271
7268
|
_.length,
|
|
7272
7269
|
")"
|
|
7273
7270
|
] }),
|
|
7274
|
-
/* @__PURE__ */ i(Ot, { active: z === "search", onClick: () =>
|
|
7271
|
+
/* @__PURE__ */ i(Ot, { active: z === "search", onClick: () => m("search"), children: [
|
|
7275
7272
|
"搜索结果 ",
|
|
7276
|
-
|
|
7273
|
+
y.length > 0 && `(${y.length})`
|
|
7277
7274
|
] })
|
|
7278
7275
|
] }),
|
|
7279
|
-
/* @__PURE__ */ t("div", { style: { flex: 1, overflowY: "auto", padding: "12px 20px", minHeight: "200px", maxHeight: "400px" }, children: z === "recent" && _.length > 0 ? /* @__PURE__ */ t(Dt, { entities: _, onSelect: s }) : f.trim() ? S ? /* @__PURE__ */ t(tt, { message: "搜索中..." }) :
|
|
7276
|
+
/* @__PURE__ */ t("div", { style: { flex: 1, overflowY: "auto", padding: "12px 20px", minHeight: "200px", maxHeight: "400px" }, children: z === "recent" && _.length > 0 ? /* @__PURE__ */ t(Dt, { entities: _, onSelect: s }) : f.trim() ? S ? /* @__PURE__ */ t(tt, { message: "搜索中..." }) : y.length > 0 ? /* @__PURE__ */ t(Dt, { entities: y, onSelect: s }) : /* @__PURE__ */ t(tt, { message: "未找到匹配的结果" }) : /* @__PURE__ */ t(tt, { message: "输入关键词开始搜索" }) }),
|
|
7280
7277
|
l && u && /* @__PURE__ */ i("div", { style: { padding: "12px 20px", borderTop: "1px solid var(--bim-widget-border, #e0e0e0)", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
7281
7278
|
/* @__PURE__ */ t("span", { style: { fontSize: "12px", opacity: 0.7 }, children: "找不到?" }),
|
|
7282
7279
|
/* @__PURE__ */ t("button", { onClick: u, style: Nr, children: c || "创建新实体" })
|
|
@@ -7389,42 +7386,42 @@ const Or = ({
|
|
|
7389
7386
|
relations: f,
|
|
7390
7387
|
onRelationsChange: x
|
|
7391
7388
|
}) => {
|
|
7392
|
-
var
|
|
7393
|
-
const p = H(), [b, S] = w(!1), [h, z] = w("work"), [
|
|
7389
|
+
var oe;
|
|
7390
|
+
const p = H(), [b, S] = w(!1), [h, z] = w("work"), [m, v] = w(""), [k, I] = w(""), [_, y] = w([]), [B, W] = w(!1), [E, O] = w(!1), [A, N] = w("work"), [U, T] = w(""), [D, C] = w(), [R, P] = w(!1), [J, V] = w(null), [ee, te] = w([]);
|
|
7394
7391
|
Q(null);
|
|
7395
|
-
const pe = e.type, ve = pe === "work", ye = pe === "collection",
|
|
7396
|
-
n({ ...e, [
|
|
7397
|
-
}, [e, n]), Ge =
|
|
7398
|
-
v(
|
|
7399
|
-
}, [p]), Je =
|
|
7400
|
-
r != null && r.unlinkEntity && r.unlinkEntity(e.id,
|
|
7401
|
-
}, [r, e.id]), Te =
|
|
7402
|
-
a == null || a(
|
|
7403
|
-
}, [a]), Re =
|
|
7404
|
-
const ue = { ...
|
|
7405
|
-
|
|
7406
|
-
}, [e.author, e.dynasty]), qe =
|
|
7407
|
-
r != null && r.createAndLink && r.createAndLink(e.id,
|
|
7408
|
-
}, [r, e.id,
|
|
7409
|
-
if (!
|
|
7410
|
-
|
|
7392
|
+
const pe = e.type, ve = pe === "work", ye = pe === "collection", ne = pe === "book", X = F((L, K) => {
|
|
7393
|
+
n({ ...e, [L]: K });
|
|
7394
|
+
}, [e, n]), Ge = F((L, K) => {
|
|
7395
|
+
v(L), z(K), I(p.editor.selectToLink + p.indexType[K]), y([]), S(!0);
|
|
7396
|
+
}, [p]), Je = F((L) => {
|
|
7397
|
+
r != null && r.unlinkEntity && r.unlinkEntity(e.id, L);
|
|
7398
|
+
}, [r, e.id]), Te = F((L) => {
|
|
7399
|
+
a == null || a(L.id, L.type);
|
|
7400
|
+
}, [a]), Re = F((L, K, ie) => {
|
|
7401
|
+
const ue = { ...ie, author: (ie == null ? void 0 : ie.author) || e.author, dynasty: (ie == null ? void 0 : ie.dynasty) || e.dynasty };
|
|
7402
|
+
N(K), T(L), C(ue), O(!0);
|
|
7403
|
+
}, [e.author, e.dynasty]), qe = F((L, K) => {
|
|
7404
|
+
r != null && r.createAndLink && r.createAndLink(e.id, U, { type: A, title: L, inheritData: K }), O(!1);
|
|
7405
|
+
}, [r, e.id, U, A]), He = F((L) => {
|
|
7406
|
+
if (!L.trim()) {
|
|
7407
|
+
y([]);
|
|
7411
7408
|
return;
|
|
7412
7409
|
}
|
|
7413
|
-
W(!0), r != null && r.searchEntities && r.searchEntities(
|
|
7414
|
-
|
|
7410
|
+
W(!0), r != null && r.searchEntities && r.searchEntities(L, h).then((K) => {
|
|
7411
|
+
y(K), W(!1);
|
|
7415
7412
|
}).catch(() => {
|
|
7416
|
-
|
|
7413
|
+
y([]), W(!1);
|
|
7417
7414
|
});
|
|
7418
|
-
}, [r, h]), Ze =
|
|
7419
|
-
r != null && r.linkEntity && r.linkEntity(e.id,
|
|
7420
|
-
}, [r, e.id,
|
|
7415
|
+
}, [r, h]), Ze = F((L) => {
|
|
7416
|
+
r != null && r.linkEntity && r.linkEntity(e.id, m, L.id), S(!1);
|
|
7417
|
+
}, [r, e.id, m]), M = F(() => {
|
|
7421
7418
|
o();
|
|
7422
|
-
}, [o]), Z =
|
|
7423
|
-
|
|
7419
|
+
}, [o]), Z = F((L) => {
|
|
7420
|
+
V(() => L), P(!0), r != null && r.getRecentEntities && r.getRecentEntities().then(te).catch(() => {
|
|
7424
7421
|
});
|
|
7425
|
-
}, [r]),
|
|
7426
|
-
r != null && r.addRecentEntity && r.addRecentEntity(
|
|
7427
|
-
}, [r,
|
|
7422
|
+
}, [r]), G = F((L, K) => r != null && r.searchEntities ? r.searchEntities(L, K === "all" ? void 0 : K) : Promise.resolve([]), [r]), q = F((L) => {
|
|
7423
|
+
r != null && r.addRecentEntity && r.addRecentEntity(L), te((K) => [L, ...K.filter((ie) => ie.id !== L.id)].slice(0, 10)), J == null || J(L), P(!1), V(null);
|
|
7424
|
+
}, [r, J]);
|
|
7428
7425
|
return /* @__PURE__ */ i("div", { style: { padding: "16px", maxWidth: "900px", margin: "0 auto" }, children: [
|
|
7429
7426
|
/* @__PURE__ */ t("div", { style: {
|
|
7430
7427
|
display: "flex",
|
|
@@ -7452,46 +7449,46 @@ const Or = ({
|
|
|
7452
7449
|
{
|
|
7453
7450
|
label: ve ? p.editor.workTitle : ye ? p.editor.collectionTitle : p.editor.bookTitle,
|
|
7454
7451
|
value: e.title,
|
|
7455
|
-
onChange: (
|
|
7452
|
+
onChange: (L) => X("title", L)
|
|
7456
7453
|
}
|
|
7457
7454
|
),
|
|
7458
|
-
|
|
7459
|
-
/* @__PURE__ */ t(
|
|
7460
|
-
/* @__PURE__ */ t(
|
|
7461
|
-
(
|
|
7462
|
-
(
|
|
7463
|
-
(
|
|
7464
|
-
/* @__PURE__ */ t("div", { style: { gridColumn: "1 / -1" }, children: /* @__PURE__ */ t(
|
|
7455
|
+
ne && /* @__PURE__ */ t(Qe, { label: p.editor.belongsToWork, value: e.workName || "", onChange: (L) => X("workName", L) }),
|
|
7456
|
+
/* @__PURE__ */ t(ae, { label: p.editor.authorLabel, value: e.author || "", onChange: (L) => X("author", L) }),
|
|
7457
|
+
/* @__PURE__ */ t(ae, { label: p.editor.dynastyLabel, value: e.dynasty || "", onChange: (L) => X("dynasty", L) }),
|
|
7458
|
+
(ne || ye) && /* @__PURE__ */ t(Qe, { label: p.editor.containedIn, value: e.collection || "", onChange: (L) => X("collection", L) }),
|
|
7459
|
+
(ne || ye) && /* @__PURE__ */ t(ae, { label: p.editor.holderLabel, value: e.holder || "", onChange: (L) => X("holder", L) }),
|
|
7460
|
+
(ne || ye) && /* @__PURE__ */ t(ae, { label: ne ? p.editor.pageLabel : p.editor.volumeLabel, value: e.pages || "", onChange: (L) => X("pages", L) }),
|
|
7461
|
+
/* @__PURE__ */ t("div", { style: { gridColumn: "1 / -1" }, children: /* @__PURE__ */ t(ae, { label: p.editor.firstImageLabel, value: e.firstImage || "", onChange: (L) => X("firstImage", L) }) })
|
|
7465
7462
|
] })
|
|
7466
7463
|
}
|
|
7467
7464
|
),
|
|
7468
|
-
/* @__PURE__ */ t(he, { title: p.section.description, onSave: o, onAskAI: s ? () => s("介绍") : void 0, children: /* @__PURE__ */ t(ze, { value: e.description || "", onChange: (
|
|
7469
|
-
(((
|
|
7465
|
+
/* @__PURE__ */ t(he, { title: p.section.description, onSave: o, onAskAI: s ? () => s("介绍") : void 0, children: /* @__PURE__ */ t(ze, { value: e.description || "", onChange: (L) => X("description", L), placeholder: p.editor.descriptionPlaceholder }) }),
|
|
7466
|
+
(((oe = e.additional_works) == null ? void 0 : oe.length) || 0) > 0 && /* @__PURE__ */ t(he, { title: p.section.additionalWorks, onSave: o, children: /* @__PURE__ */ t(
|
|
7470
7467
|
Jr,
|
|
7471
7468
|
{
|
|
7472
7469
|
items: e.additional_works || [],
|
|
7473
|
-
onChange: (
|
|
7470
|
+
onChange: (L) => X("additional_works", L)
|
|
7474
7471
|
}
|
|
7475
7472
|
) }),
|
|
7476
7473
|
/* @__PURE__ */ t(he, { title: p.section.indexedBy, onSave: o, onAskAI: s ? () => s("收录于") : void 0, children: /* @__PURE__ */ t(
|
|
7477
7474
|
qr,
|
|
7478
7475
|
{
|
|
7479
7476
|
items: e.indexed_by || [],
|
|
7480
|
-
onChange: (
|
|
7477
|
+
onChange: (L) => X("indexed_by", L)
|
|
7481
7478
|
}
|
|
7482
7479
|
) }),
|
|
7483
7480
|
/* @__PURE__ */ t(he, { title: p.section.emendatedBy, onSave: o, onAskAI: s ? () => s("考证") : void 0, children: /* @__PURE__ */ t(
|
|
7484
7481
|
Zr,
|
|
7485
7482
|
{
|
|
7486
7483
|
items: e.emendated_by || [],
|
|
7487
|
-
onChange: (
|
|
7484
|
+
onChange: (L) => X("emendated_by", L)
|
|
7488
7485
|
}
|
|
7489
7486
|
) }),
|
|
7490
7487
|
/* @__PURE__ */ t(he, { title: p.section.textResources, onSave: o, onAskAI: s ? () => s("资源") : void 0, children: /* @__PURE__ */ t(
|
|
7491
7488
|
st,
|
|
7492
7489
|
{
|
|
7493
7490
|
items: e.resources || [],
|
|
7494
|
-
onChange: (
|
|
7491
|
+
onChange: (L) => X("resources", L),
|
|
7495
7492
|
onDownload: u,
|
|
7496
7493
|
downloadStatuses: g,
|
|
7497
7494
|
filterType: "text"
|
|
@@ -7501,7 +7498,7 @@ const Or = ({
|
|
|
7501
7498
|
st,
|
|
7502
7499
|
{
|
|
7503
7500
|
items: e.resources || [],
|
|
7504
|
-
onChange: (
|
|
7501
|
+
onChange: (L) => X("resources", L),
|
|
7505
7502
|
onDownload: u,
|
|
7506
7503
|
downloadStatuses: g,
|
|
7507
7504
|
filterType: "image"
|
|
@@ -7511,12 +7508,12 @@ const Or = ({
|
|
|
7511
7508
|
mr,
|
|
7512
7509
|
{
|
|
7513
7510
|
items: yr(e.sources || ""),
|
|
7514
|
-
onChange: (
|
|
7511
|
+
onChange: (L) => X("sources", vr(L)),
|
|
7515
7512
|
onOpenEntityPicker: Z
|
|
7516
7513
|
}
|
|
7517
7514
|
) }),
|
|
7518
|
-
(
|
|
7519
|
-
|
|
7515
|
+
(ne || ye) && /* @__PURE__ */ t(he, { title: p.section.provenance, onSave: o, onAskAI: s ? () => s("收藏历史") : void 0, children: /* @__PURE__ */ t(ze, { value: e.provenance || "", onChange: (L) => X("provenance", L), placeholder: p.editor.provenancePlaceholder }) }),
|
|
7516
|
+
ne && /* @__PURE__ */ t(he, { title: p.section.otherEditions, onSave: o, onAskAI: s ? () => s("其他版本") : void 0, children: /* @__PURE__ */ t(ze, { value: e.otherEditions || "", onChange: (L) => X("otherEditions", L), placeholder: p.editor.otherEditionsPlaceholder }) }),
|
|
7520
7517
|
/* @__PURE__ */ t(
|
|
7521
7518
|
kr,
|
|
7522
7519
|
{
|
|
@@ -7566,38 +7563,38 @@ const Or = ({
|
|
|
7566
7563
|
onSelect: Ze,
|
|
7567
7564
|
onCancel: () => S(!1),
|
|
7568
7565
|
onCreate: () => {
|
|
7569
|
-
S(!1), Re(
|
|
7566
|
+
S(!1), Re(m, h);
|
|
7570
7567
|
},
|
|
7571
7568
|
searchResults: _,
|
|
7572
7569
|
onSearch: He,
|
|
7573
|
-
isLoading:
|
|
7570
|
+
isLoading: B,
|
|
7574
7571
|
excludeId: e.id
|
|
7575
7572
|
}
|
|
7576
7573
|
),
|
|
7577
7574
|
/* @__PURE__ */ t(
|
|
7578
7575
|
Br,
|
|
7579
7576
|
{
|
|
7580
|
-
isOpen:
|
|
7577
|
+
isOpen: E,
|
|
7581
7578
|
entityType: A,
|
|
7582
|
-
relationField:
|
|
7583
|
-
inheritData:
|
|
7579
|
+
relationField: U,
|
|
7580
|
+
inheritData: D,
|
|
7584
7581
|
onConfirm: qe,
|
|
7585
|
-
onCancel: () =>
|
|
7582
|
+
onCancel: () => O(!1)
|
|
7586
7583
|
}
|
|
7587
7584
|
),
|
|
7588
7585
|
/* @__PURE__ */ t(
|
|
7589
7586
|
Or,
|
|
7590
7587
|
{
|
|
7591
|
-
isOpen:
|
|
7588
|
+
isOpen: R,
|
|
7592
7589
|
title: p.action.selectBookOrWork,
|
|
7593
7590
|
filterType: "all",
|
|
7594
|
-
recentEntities:
|
|
7591
|
+
recentEntities: ee,
|
|
7595
7592
|
excludeId: e.id,
|
|
7596
7593
|
onSelect: q,
|
|
7597
7594
|
onCancel: () => {
|
|
7598
|
-
|
|
7595
|
+
P(!1), V(null);
|
|
7599
7596
|
},
|
|
7600
|
-
onSearch:
|
|
7597
|
+
onSearch: G
|
|
7601
7598
|
}
|
|
7602
7599
|
)
|
|
7603
7600
|
] });
|
|
@@ -7609,8 +7606,8 @@ function Jr({ items: e, onChange: n }) {
|
|
|
7609
7606
|
}, a = (c) => n(e.filter((s, d) => d !== c)), l = () => n([...e, { book_title: "" }]);
|
|
7610
7607
|
return /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
7611
7608
|
e.map((c, s) => /* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
|
|
7612
|
-
/* @__PURE__ */ t(
|
|
7613
|
-
/* @__PURE__ */ t("div", { style: { width: "100px" }, children: /* @__PURE__ */ t(
|
|
7609
|
+
/* @__PURE__ */ t(ae, { label: o.editor.bookNameLabel, value: c.book_title, onChange: (d) => r(s, "book_title", d) }),
|
|
7610
|
+
/* @__PURE__ */ t("div", { style: { width: "100px" }, children: /* @__PURE__ */ t(ae, { label: o.label.juanCount, value: c.n_juan != null ? String(c.n_juan) : "", onChange: (d) => r(s, "n_juan", d && parseInt(d, 10) || void 0) }) }),
|
|
7614
7611
|
/* @__PURE__ */ t("button", { onClick: () => a(s), style: {
|
|
7615
7612
|
padding: "4px 8px",
|
|
7616
7613
|
fontSize: "12px",
|
|
@@ -7686,15 +7683,15 @@ function fn({ items: e, onChange: n, showMeta: o, addLabel: r }) {
|
|
|
7686
7683
|
] }),
|
|
7687
7684
|
x && /* @__PURE__ */ i("div", { style: { padding: "8px 12px 12px", display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
7688
7685
|
/* @__PURE__ */ i("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" }, children: [
|
|
7689
|
-
/* @__PURE__ */ t(
|
|
7690
|
-
/* @__PURE__ */ t(
|
|
7686
|
+
/* @__PURE__ */ t(ae, { label: a.label.sourceName, value: g.source, onChange: (p) => s(f, "source", p) }),
|
|
7687
|
+
/* @__PURE__ */ t(ae, { label: a.label.sourceBid, value: g.source_bid || "", onChange: (p) => s(f, "source_bid", p) })
|
|
7691
7688
|
] }),
|
|
7692
7689
|
o && /* @__PURE__ */ i(j, { children: [
|
|
7693
7690
|
/* @__PURE__ */ i("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "8px" }, children: [
|
|
7694
|
-
/* @__PURE__ */ t(
|
|
7695
|
-
/* @__PURE__ */ t(
|
|
7691
|
+
/* @__PURE__ */ t(ae, { label: a.label.titleInfo, value: g.title_info || "", onChange: (p) => s(f, "title_info", p) }),
|
|
7692
|
+
/* @__PURE__ */ t(ae, { label: a.label.authorInfo, value: g.author_info || "", onChange: (p) => s(f, "author_info", p) })
|
|
7696
7693
|
] }),
|
|
7697
|
-
/* @__PURE__ */ t(
|
|
7694
|
+
/* @__PURE__ */ t(ae, { label: a.label.edition, value: g.edition || "", onChange: (p) => s(f, "edition", p) })
|
|
7698
7695
|
] }),
|
|
7699
7696
|
/* @__PURE__ */ t(ze, { value: g.summary || "", onChange: (p) => s(f, "summary", p), placeholder: a.editor.summaryPlaceholder }),
|
|
7700
7697
|
/* @__PURE__ */ t(ze, { value: g.comment || "", onChange: (p) => s(f, "comment", p), placeholder: a.editor.commentPlaceholder }),
|
|
@@ -7787,28 +7784,28 @@ const Ii = (e) => {
|
|
|
7787
7784
|
relations: S,
|
|
7788
7785
|
onRelationsChange: h,
|
|
7789
7786
|
headerExtra: z,
|
|
7790
|
-
className:
|
|
7787
|
+
className: m,
|
|
7791
7788
|
style: v
|
|
7792
7789
|
} = e;
|
|
7793
7790
|
H();
|
|
7794
|
-
const [k,
|
|
7795
|
-
|
|
7796
|
-
a !== k &&
|
|
7791
|
+
const [k, I] = w(a), _ = l ? a : k;
|
|
7792
|
+
$(() => {
|
|
7793
|
+
a !== k && I(a);
|
|
7797
7794
|
}, [a]);
|
|
7798
|
-
const
|
|
7799
|
-
const
|
|
7800
|
-
l ? l(
|
|
7801
|
-
}, [_, l]), [
|
|
7802
|
-
|
|
7803
|
-
o && r && r.getItem(o).then((
|
|
7804
|
-
|
|
7795
|
+
const y = F(() => {
|
|
7796
|
+
const U = _ === "view" ? "edit" : "view";
|
|
7797
|
+
l ? l(U) : I(U);
|
|
7798
|
+
}, [_, l]), [B, W] = w(null);
|
|
7799
|
+
$(() => {
|
|
7800
|
+
o && r && r.getItem(o).then((U) => {
|
|
7801
|
+
U && W(U);
|
|
7805
7802
|
});
|
|
7806
7803
|
}, [o, r]);
|
|
7807
|
-
const
|
|
7804
|
+
const E = n || B, O = ce(() => E ? Xr(E) : null, [E]), N = /* @__PURE__ */ i(j, { children: [
|
|
7808
7805
|
l || !n ? /* @__PURE__ */ t(
|
|
7809
7806
|
"button",
|
|
7810
7807
|
{
|
|
7811
|
-
onClick:
|
|
7808
|
+
onClick: y,
|
|
7812
7809
|
style: {
|
|
7813
7810
|
padding: "4px 12px",
|
|
7814
7811
|
fontSize: "12px",
|
|
@@ -7827,23 +7824,23 @@ const Ii = (e) => {
|
|
|
7827
7824
|
) : null,
|
|
7828
7825
|
z
|
|
7829
7826
|
] });
|
|
7830
|
-
return
|
|
7827
|
+
return !E && !O ? /* @__PURE__ */ t(Se, {}) : _ === "view" ? /* @__PURE__ */ t(
|
|
7831
7828
|
on,
|
|
7832
7829
|
{
|
|
7833
|
-
data:
|
|
7830
|
+
data: E,
|
|
7834
7831
|
transport: r,
|
|
7835
|
-
onNavigate: u ? (
|
|
7832
|
+
onNavigate: u ? (U) => u(U) : void 0,
|
|
7836
7833
|
renderLink: g,
|
|
7837
|
-
headerExtra:
|
|
7838
|
-
className:
|
|
7834
|
+
headerExtra: N,
|
|
7835
|
+
className: m,
|
|
7839
7836
|
style: v
|
|
7840
7837
|
}
|
|
7841
|
-
) :
|
|
7842
|
-
|
|
7838
|
+
) : O ? /* @__PURE__ */ i("div", { className: m, style: v, children: [
|
|
7839
|
+
N && /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "flex-end", padding: "8px 0", gap: "8px" }, children: N }),
|
|
7843
7840
|
/* @__PURE__ */ t(
|
|
7844
7841
|
Gr,
|
|
7845
7842
|
{
|
|
7846
|
-
data:
|
|
7843
|
+
data: O,
|
|
7847
7844
|
onChange: c || (() => {
|
|
7848
7845
|
}),
|
|
7849
7846
|
onSave: s || (() => {
|
|
@@ -7866,19 +7863,19 @@ const Ii = (e) => {
|
|
|
7866
7863
|
{ value: "resource", label: "添加资源", icon: "📚", placeholder: "请提供完整资源链接和简要版本说明" }
|
|
7867
7864
|
], Qr = ({ isOpen: e, onClose: n, onSubmit: o, feedbackListUrl: r }) => {
|
|
7868
7865
|
const [a, l] = w(null), [c, s] = w(""), [d, u] = w("idle"), [g, f] = w(""), x = Q(null);
|
|
7869
|
-
|
|
7866
|
+
$(() => {
|
|
7870
7867
|
e && (l(null), s(""), u("idle"), f(""));
|
|
7871
|
-
}, [e]),
|
|
7868
|
+
}, [e]), $(() => {
|
|
7872
7869
|
a && setTimeout(() => {
|
|
7873
7870
|
var h;
|
|
7874
7871
|
return (h = x.current) == null ? void 0 : h.focus();
|
|
7875
7872
|
}, 100);
|
|
7876
|
-
}, [a]),
|
|
7873
|
+
}, [a]), $(() => {
|
|
7877
7874
|
if (d === "success") {
|
|
7878
7875
|
const h = setTimeout(n, 2e3);
|
|
7879
7876
|
return () => clearTimeout(h);
|
|
7880
7877
|
}
|
|
7881
|
-
}, [d, n]),
|
|
7878
|
+
}, [d, n]), $(() => {
|
|
7882
7879
|
if (!e) return;
|
|
7883
7880
|
const h = (z) => {
|
|
7884
7881
|
z.key === "Escape" && n();
|
|
@@ -8090,7 +8087,7 @@ const Ii = (e) => {
|
|
|
8090
8087
|
{ value: "resource", label: "添加资源", icon: "📚", placeholder: "请提供完整资源链接和简要版本说明" }
|
|
8091
8088
|
], Ri = ({ onSubmit: e }) => {
|
|
8092
8089
|
const [n, o] = w("bug"), [r, a] = w(""), [l, c] = w("idle"), [s, d] = w(""), u = Q(null);
|
|
8093
|
-
|
|
8090
|
+
$(() => {
|
|
8094
8091
|
n && setTimeout(() => {
|
|
8095
8092
|
var p;
|
|
8096
8093
|
return (p = u.current) == null ? void 0 : p.focus();
|
|
@@ -8270,8 +8267,8 @@ export {
|
|
|
8270
8267
|
Ei as BidLink,
|
|
8271
8268
|
Si as BidUrlProvider,
|
|
8272
8269
|
$i as BookIndexError,
|
|
8273
|
-
|
|
8274
|
-
|
|
8270
|
+
Ai as BookIndexManager,
|
|
8271
|
+
Pi as BookIndexStorage,
|
|
8275
8272
|
Mi as BundleStorage,
|
|
8276
8273
|
Yo as CollatedEdition,
|
|
8277
8274
|
_o as CollectionCatalog,
|
|
@@ -8285,7 +8282,7 @@ export {
|
|
|
8285
8282
|
Qr as FeedbackDialog,
|
|
8286
8283
|
Ri as FeedbackForm,
|
|
8287
8284
|
Xo as FeedbackList,
|
|
8288
|
-
|
|
8285
|
+
ae as FormInput,
|
|
8289
8286
|
ze as FormTextArea,
|
|
8290
8287
|
Oi as GithubStorage,
|
|
8291
8288
|
Rt as HomePage,
|
|
@@ -8330,7 +8327,7 @@ export {
|
|
|
8330
8327
|
tl as smartDecode,
|
|
8331
8328
|
vr as stringifySources,
|
|
8332
8329
|
de as useBidUrl,
|
|
8333
|
-
|
|
8330
|
+
Y as useConvert,
|
|
8334
8331
|
H as useT,
|
|
8335
8332
|
nl as validateResource
|
|
8336
8333
|
};
|