dsh-theone 0.3.21 → 0.3.22
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/README.md +43 -19
- package/README.zh.md +44 -19
- package/dist/client-locales.d.ts +33 -0
- package/dist/client-locales.js +66 -0
- package/dist/client.js +406 -41
- package/dist/feedback.d.ts +113 -0
- package/dist/feedback.js +146 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +89 -0
- package/package.json +21 -3
package/dist/client.js
CHANGED
|
@@ -203,6 +203,9 @@ var zh = {
|
|
|
203
203
|
"settings.help.gatewayKey": "\u533A\u5206\u4E0D\u540C\u7684\u4E3B\u804A\u5929\u5165\u53E3\u72B6\u6001\uFF08\u5F53\u524D\u8BDD\u9898\u3001\u8DEF\u7531\u8BB0\u5F55\u3001\u8BBE\u7F6E\uFF09\u3002\u6539\u52A8\u76F8\u5F53\u4E8E\u6362\u4E00\u4E2A\u65B0\u7684\u5165\u53E3\uFF0C\u56E0\u6B64\u53EA\u80FD\u7528\u73AF\u5883\u53D8\u91CF THEONE_GATEWAY_KEY \u4FEE\u6539\uFF0C\u901A\u5E38\u4FDD\u7559 default\u3002",
|
|
204
204
|
"catalog.title": "\u8BDD\u9898\u5DE5\u4F5C\u533A",
|
|
205
205
|
"catalog.subtitle": "\u76F8\u5173\u7684\u4E8B\u60C5\u653E\u5728\u4E00\u8D77\uFF0C\u968F\u65F6\u56DE\u5230\u4E3B\u804A\u5929\u7EE7\u7EED\u3002",
|
|
206
|
+
"catalog.figTopics": "\u8BDD\u9898",
|
|
207
|
+
"catalog.figGroups": "\u5DE5\u4F5C\u533A",
|
|
208
|
+
"catalog.figKept": "\u6CA1\u88AB\u66F4\u6B63",
|
|
206
209
|
"catalog.refresh": "\u6574\u7406\u5386\u53F2",
|
|
207
210
|
"link.label": "\u5173\u8054\uFF1A",
|
|
208
211
|
"link.none": "\u6682\u65E0\u5173\u8054\u8BDD\u9898",
|
|
@@ -236,6 +239,7 @@ var zh = {
|
|
|
236
239
|
"catalog.unassignedSummary": "\u8FD9\u4E9B\u8BDD\u9898\u8FD8\u5728\u7B49\u5F85\u81EA\u52A8\u5F52\u7C7B\u3002",
|
|
237
240
|
"topic.opening": "\u6B63\u5728\u6253\u5F00\u2026",
|
|
238
241
|
"topic.continue": "\u7EE7\u7EED\u804A\u5929",
|
|
242
|
+
"topic.continueHidden": "\u8FD9\u4E2A\u8BDD\u9898\u7684\u539F\u4F1A\u8BDD\u5DF2\u4E0D\u5728\uFF08\u5DF2\u5220\u9664\u6216\u5DF2\u5F52\u6863\uFF09\uFF0C\u6CA1\u6709\u53EF\u4EE5\u63A5\u7740\u804A\u7684\u5185\u5BB9\u3002\u53D6\u6D88\u5F52\u6863\u540E\u5373\u53EF\u7EE7\u7EED\u3002",
|
|
239
243
|
"topic.source": "\u67E5\u770B\u539F\u4F1A\u8BDD",
|
|
240
244
|
"topic.state": "\u8FDB\u5C55\uFF1A",
|
|
241
245
|
"topic.constraints": "\u7EA6\u675F\uFF1A",
|
|
@@ -281,6 +285,35 @@ var zh = {
|
|
|
281
285
|
"routes.error": "\u5206\u7C7B\u51FA\u9519\uFF1A{code}",
|
|
282
286
|
"routes.rules": "\u89C4\u5219\u5224\u65AD",
|
|
283
287
|
"routes.removed": "\uFF08\u5DF2\u5220\u9664\u7684\u8BDD\u9898\uFF09",
|
|
288
|
+
"routes.report": "\u62A5\u544A\u95EE\u9898",
|
|
289
|
+
"feedback.open": "\u53CD\u9988\u95EE\u9898",
|
|
290
|
+
"feedback.title": "\u53CD\u9988\u95EE\u9898",
|
|
291
|
+
"feedback.titleMessage": "\u62A5\u544A\u8FD9\u6761\u56DE\u590D\u7684\u95EE\u9898",
|
|
292
|
+
"feedback.intro": "\u8BF4\u8BF4\u53D1\u751F\u4E86\u4EC0\u4E48\u3002\u4E0B\u9762\u80FD\u770B\u5230\u8981\u53D1\u51FA\u7684\u5168\u90E8\u5185\u5BB9\uFF0C\u70B9\u300C\u53D1\u9001\u300D\u4E4B\u524D\u4EC0\u4E48\u90FD\u4E0D\u4F1A\u53D1\u51FA\u3002",
|
|
293
|
+
"feedback.description": "\u53D1\u751F\u4E86\u4EC0\u4E48\uFF1F\u6BD4\u5982\uFF1A\u56DE\u590D\u91CC\u51FA\u73B0\u4E71\u7801\u3001\u5206\u9519\u4E86\u8BDD\u9898\u3001\u67D0\u4E2A\u6309\u94AE\u6CA1\u53CD\u5E94",
|
|
294
|
+
"feedback.contact": "\u8054\u7CFB\u65B9\u5F0F\uFF08\u9009\u586B\uFF09\uFF1A\u90AE\u7BB1\u3001QQ \u6216\u5FAE\u4FE1\uFF0C\u65B9\u4FBF\u4F5C\u8005\u56DE\u590D\u4F60",
|
|
295
|
+
"feedback.includeReply": "\u9644\u4E0A\u8FD9\u6761\u6D88\u606F\u548C\u56DE\u590D\u7684\u539F\u6587\uFF08\u6392\u67E5\u4E71\u7801\u8FD9\u7C7B\u95EE\u9898\u65F6\u9700\u8981\uFF09",
|
|
296
|
+
"feedback.preview": "\u8981\u53D1\u9001\u7684\u5185\u5BB9",
|
|
297
|
+
"feedback.privacy": "\u53D1\u9001\u5230 feedback.yulid.org\uFF0C\u53EA\u7528\u4E8E\u6392\u67E5\u95EE\u9898\uFF0C\u7531 TheOne \u4F5C\u8005\u4FDD\u5B58 90 \u5929\u540E\u81EA\u52A8\u5220\u9664\u3002\u9ED8\u8BA4\u53EA\u542B\u7248\u672C\u3001\u8BBE\u7F6E\u548C\u8DEF\u7531\u7684\u9519\u8BEF\u7801\u4E0E\u8017\u65F6\uFF0C\u4E0D\u542B\u804A\u5929\u5185\u5BB9\u3002",
|
|
298
|
+
"feedback.loading": "\u6B63\u5728\u6574\u7406\u8BCA\u65AD\u4FE1\u606F\u2026",
|
|
299
|
+
"feedback.loadError": "\u8BCA\u65AD\u4FE1\u606F\u6CA1\u6709\u6574\u7406\u51FA\u6765\uFF0C\u4F60\u4ECD\u7136\u53EF\u4EE5\u5199\u4E0B\u95EE\u9898\uFF0C\u590D\u5236\u540E\u53D1\u90AE\u4EF6\u5230 {email}\u3002",
|
|
300
|
+
"feedback.send": "\u53D1\u9001",
|
|
301
|
+
"feedback.sending": "\u6B63\u5728\u53D1\u9001\u2026",
|
|
302
|
+
"feedback.copy": "\u590D\u5236\u5185\u5BB9",
|
|
303
|
+
"feedback.copied": "\u5DF2\u590D\u5236",
|
|
304
|
+
"feedback.email": "\u53D1\u90AE\u4EF6",
|
|
305
|
+
"feedback.cancel": "\u53D6\u6D88",
|
|
306
|
+
"feedback.close": "\u5173\u95ED",
|
|
307
|
+
"feedback.sent": "\u5DF2\u53D1\u9001\uFF0C\u7F16\u53F7 {id}\u3002\u5728\u8BC4\u8BBA\u6216\u90AE\u4EF6\u91CC\u63D0\u5230\u8FD9\u4E2A\u7F16\u53F7\uFF0C\u4F5C\u8005\u5C31\u80FD\u627E\u5230\u5B83\u3002\u8C22\u8C22\uFF01",
|
|
308
|
+
"feedback.fallback": "\u4E5F\u53EF\u4EE5\u70B9\u300C\u590D\u5236\u5185\u5BB9\u300D\uFF0C\u53D1\u90AE\u4EF6\u5230 {email}\u3002",
|
|
309
|
+
"feedback.error.UNREACHABLE": "\u8FDE\u4E0D\u4E0A\u53CD\u9988\u670D\u52A1\u5668\u3002",
|
|
310
|
+
"feedback.error.RATE_LIMITED": "\u53D1\u9001\u5F97\u592A\u9891\u7E41\u4E86\uFF0C\u8BF7\u4E00\u5C0F\u65F6\u540E\u518D\u8BD5\u3002",
|
|
311
|
+
"feedback.error.REJECTED": "\u53CD\u9988\u670D\u52A1\u5668\u6CA1\u6709\u63A5\u6536\u8FD9\u4EFD\u62A5\u544A\u3002",
|
|
312
|
+
"feedback.error.SERVER_ERROR": "\u53CD\u9988\u670D\u52A1\u5668\u6682\u65F6\u51FA\u4E86\u95EE\u9898\u3002",
|
|
313
|
+
"feedback.error.DESCRIPTION_REQUIRED": "\u5148\u5199\u4E00\u53E5\u53D1\u751F\u4E86\u4EC0\u4E48\u3002",
|
|
314
|
+
"feedback.error.TOO_LARGE": "\u5185\u5BB9\u592A\u957F\u4E86\uFF0C\u8BF7\u7F29\u77ED\u63CF\u8FF0\uFF0C\u6216\u53BB\u6389\u56DE\u590D\u539F\u6587\u3002",
|
|
315
|
+
"feedback.error.DIRECT_OFF": "\u8FD9\u4E2A DSH \u5173\u95ED\u4E86\u76F4\u63A5\u53D1\u9001\u3002",
|
|
316
|
+
"feedback.error.other": "\u6CA1\u6709\u53D1\u9001\u6210\u529F\u3002",
|
|
284
317
|
"route.reason.steering": "\u56DE\u590D\u4E2D\u8865\u5145",
|
|
285
318
|
"route.reason.short-continuation": "\u63A5\u7740\u8BF4",
|
|
286
319
|
"route.reason.attachment-only": "\u53EA\u6709\u9644\u4EF6",
|
|
@@ -420,6 +453,9 @@ var en = {
|
|
|
420
453
|
"settings.help.gatewayKey": "Separates main-chat entry state (current topic, routing records, settings). Changing it amounts to a new entry, so it can only be set through THEONE_GATEWAY_KEY; usually leave it as default.",
|
|
421
454
|
"catalog.title": "Topic workspaces",
|
|
422
455
|
"catalog.subtitle": "Keep related topics together and pick up the conversation in main chat.",
|
|
456
|
+
"catalog.figTopics": "Topics",
|
|
457
|
+
"catalog.figGroups": "Workspaces",
|
|
458
|
+
"catalog.figKept": "Kept as routed",
|
|
423
459
|
"catalog.refresh": "Organize history",
|
|
424
460
|
"link.label": "Related:",
|
|
425
461
|
"link.none": "No related topics",
|
|
@@ -453,6 +489,7 @@ var en = {
|
|
|
453
489
|
"catalog.unassignedSummary": "These topics are waiting to be grouped.",
|
|
454
490
|
"topic.opening": "Opening\u2026",
|
|
455
491
|
"topic.continue": "Continue chatting",
|
|
492
|
+
"topic.continueHidden": "This topic\u2019s conversations are gone (deleted or archived), so there is nothing to continue. Unarchive them to pick it up again.",
|
|
456
493
|
"topic.source": "View original chat",
|
|
457
494
|
"topic.state": "Progress:",
|
|
458
495
|
"topic.constraints": "Constraints:",
|
|
@@ -498,6 +535,35 @@ var en = {
|
|
|
498
535
|
"routes.error": "Classifier error: {code}",
|
|
499
536
|
"routes.rules": "rules",
|
|
500
537
|
"routes.removed": "(deleted topic)",
|
|
538
|
+
"routes.report": "Report a problem",
|
|
539
|
+
"feedback.open": "Report a problem",
|
|
540
|
+
"feedback.title": "Report a problem",
|
|
541
|
+
"feedback.titleMessage": "Report a problem with this reply",
|
|
542
|
+
"feedback.intro": "Tell us what happened. Everything that would be sent is shown below; nothing leaves this computer until you press Send.",
|
|
543
|
+
"feedback.description": "What happened? For example: garbled text in a reply, the wrong topic, a button that does nothing",
|
|
544
|
+
"feedback.contact": "Contact (optional): email or any handle, so the author can reply",
|
|
545
|
+
"feedback.includeReply": "Include this message and its reply as text (needed for problems like garbled replies)",
|
|
546
|
+
"feedback.preview": "What will be sent",
|
|
547
|
+
"feedback.privacy": "Sent to feedback.yulid.org, used only to look into the problem, and deleted by TheOne's author after 90 days. By default it holds versions, settings and routing error codes and timings, no chat content.",
|
|
548
|
+
"feedback.loading": "Gathering diagnostics\u2026",
|
|
549
|
+
"feedback.loadError": "Diagnostics could not be gathered. You can still describe the problem, copy it and email {email}.",
|
|
550
|
+
"feedback.send": "Send",
|
|
551
|
+
"feedback.sending": "Sending\u2026",
|
|
552
|
+
"feedback.copy": "Copy",
|
|
553
|
+
"feedback.copied": "Copied",
|
|
554
|
+
"feedback.email": "Email",
|
|
555
|
+
"feedback.cancel": "Cancel",
|
|
556
|
+
"feedback.close": "Close",
|
|
557
|
+
"feedback.sent": "Sent as {id}. Mention this id in a comment or email and the author can find it. Thank you!",
|
|
558
|
+
"feedback.fallback": "You can also press Copy and email {email}.",
|
|
559
|
+
"feedback.error.UNREACHABLE": "The feedback server cannot be reached.",
|
|
560
|
+
"feedback.error.RATE_LIMITED": "Too many reports in a short time; try again in an hour.",
|
|
561
|
+
"feedback.error.REJECTED": "The feedback server did not accept this report.",
|
|
562
|
+
"feedback.error.SERVER_ERROR": "The feedback server has a problem right now.",
|
|
563
|
+
"feedback.error.DESCRIPTION_REQUIRED": "Say in a sentence what happened first.",
|
|
564
|
+
"feedback.error.TOO_LARGE": "Too long; shorten the description or leave out the reply text.",
|
|
565
|
+
"feedback.error.DIRECT_OFF": "Sending directly is turned off in this DSH.",
|
|
566
|
+
"feedback.error.other": "The report was not sent.",
|
|
501
567
|
"route.reason.steering": "Added during a reply",
|
|
502
568
|
"route.reason.short-continuation": "Continuation",
|
|
503
569
|
"route.reason.attachment-only": "Attachment only",
|
|
@@ -699,6 +765,160 @@ function apply(ctx) {
|
|
|
699
765
|
document.body.append(backdrop);
|
|
700
766
|
(allow ?? footer.querySelector("button"))?.focus();
|
|
701
767
|
}
|
|
768
|
+
function openFeedbackDialog(messageId) {
|
|
769
|
+
if (document.querySelector(".theone-dialog-backdrop")) return;
|
|
770
|
+
const backdrop = document.createElement("div");
|
|
771
|
+
backdrop.className = "theone-dialog-backdrop";
|
|
772
|
+
backdrop.setAttribute("translate", "no");
|
|
773
|
+
const card = document.createElement("div");
|
|
774
|
+
card.className = "theone-dialog theone-feedback";
|
|
775
|
+
card.setAttribute("role", "dialog");
|
|
776
|
+
card.setAttribute("aria-modal", "true");
|
|
777
|
+
const title = document.createElement("h2");
|
|
778
|
+
title.id = "theone-feedback-title";
|
|
779
|
+
title.textContent = t(messageId ? "feedback.titleMessage" : "feedback.title");
|
|
780
|
+
card.setAttribute("aria-labelledby", title.id);
|
|
781
|
+
const intro = document.createElement("p");
|
|
782
|
+
intro.textContent = t("feedback.intro");
|
|
783
|
+
const description = document.createElement("textarea");
|
|
784
|
+
description.maxLength = 4e3;
|
|
785
|
+
description.rows = 4;
|
|
786
|
+
description.placeholder = t("feedback.description");
|
|
787
|
+
description.setAttribute("aria-label", t("feedback.description"));
|
|
788
|
+
const contact = document.createElement("input");
|
|
789
|
+
contact.maxLength = 200;
|
|
790
|
+
contact.placeholder = t("feedback.contact");
|
|
791
|
+
contact.setAttribute("aria-label", t("feedback.contact"));
|
|
792
|
+
const include = document.createElement("input");
|
|
793
|
+
include.type = "checkbox";
|
|
794
|
+
const includeLabel = document.createElement("label");
|
|
795
|
+
includeLabel.className = "theone-feedback-check";
|
|
796
|
+
includeLabel.append(include, " ", t("feedback.includeReply"));
|
|
797
|
+
const preview = document.createElement("details");
|
|
798
|
+
preview.className = "theone-feedback-preview";
|
|
799
|
+
const summary = document.createElement("summary");
|
|
800
|
+
summary.textContent = t("feedback.preview");
|
|
801
|
+
const pre = document.createElement("pre");
|
|
802
|
+
preview.append(summary, pre);
|
|
803
|
+
const privacy = document.createElement("p");
|
|
804
|
+
privacy.className = "theone-dialog-note";
|
|
805
|
+
privacy.textContent = t("feedback.privacy");
|
|
806
|
+
const status = document.createElement("p");
|
|
807
|
+
status.className = "theone-dialog-note";
|
|
808
|
+
status.setAttribute("role", "status");
|
|
809
|
+
status.textContent = t("feedback.loading");
|
|
810
|
+
const footer = document.createElement("div");
|
|
811
|
+
footer.className = "theone-dialog-actions";
|
|
812
|
+
const button = (text2, primary, act) => {
|
|
813
|
+
const element = document.createElement("button");
|
|
814
|
+
element.type = "button";
|
|
815
|
+
element.textContent = text2;
|
|
816
|
+
if (primary) element.className = "theone-dialog-primary";
|
|
817
|
+
element.addEventListener("click", act);
|
|
818
|
+
footer.append(element);
|
|
819
|
+
return element;
|
|
820
|
+
};
|
|
821
|
+
let draft;
|
|
822
|
+
let email = "theone@yulid.org";
|
|
823
|
+
let direct = false;
|
|
824
|
+
let sentId;
|
|
825
|
+
let sending = false;
|
|
826
|
+
const language = () => localeSnapshot().active.startsWith("zh") ? "zh" : "en";
|
|
827
|
+
const report = () => ({ description: description.value.trim(), ...contact.value.trim() ? { contact: contact.value.trim() } : {}, lang: language(), ...draft ?? {} });
|
|
828
|
+
const render = () => {
|
|
829
|
+
pre.textContent = JSON.stringify(report(), null, 2);
|
|
830
|
+
send.disabled = sending || !!sentId || !direct || !draft || !description.value.trim();
|
|
831
|
+
send.textContent = t(sending ? "feedback.sending" : "feedback.send");
|
|
832
|
+
};
|
|
833
|
+
const load = async () => {
|
|
834
|
+
status.textContent = t("feedback.loading");
|
|
835
|
+
draft = void 0;
|
|
836
|
+
render();
|
|
837
|
+
try {
|
|
838
|
+
const response = await fetch("/api/theone/feedback", {
|
|
839
|
+
method: "POST",
|
|
840
|
+
headers: { "content-type": "application/json" },
|
|
841
|
+
signal: lifetime.signal,
|
|
842
|
+
body: JSON.stringify({ action: "draft", ...messageId ? { messageId, includeReply: include.checked } : {} })
|
|
843
|
+
});
|
|
844
|
+
const body = await response.json();
|
|
845
|
+
if (!response.ok || !body.draft) throw new Error("draft");
|
|
846
|
+
draft = body.draft;
|
|
847
|
+
email = body.email ?? email;
|
|
848
|
+
direct = body.direct === true;
|
|
849
|
+
status.textContent = direct ? "" : t("feedback.fallback", { email });
|
|
850
|
+
} catch {
|
|
851
|
+
status.textContent = t("feedback.loadError", { email });
|
|
852
|
+
}
|
|
853
|
+
render();
|
|
854
|
+
};
|
|
855
|
+
const close = () => {
|
|
856
|
+
backdrop.remove();
|
|
857
|
+
document.removeEventListener("keydown", keydown, true);
|
|
858
|
+
};
|
|
859
|
+
const keydown = (event) => {
|
|
860
|
+
if (event.key === "Escape") {
|
|
861
|
+
event.preventDefault();
|
|
862
|
+
close();
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
const text = () => sentId ? sentId : JSON.stringify(report(), null, 2);
|
|
866
|
+
button(t("feedback.cancel"), false, close);
|
|
867
|
+
const copy = button(t("feedback.copy"), false, () => {
|
|
868
|
+
void navigator.clipboard?.writeText(text()).then(() => {
|
|
869
|
+
copy.textContent = t("feedback.copied");
|
|
870
|
+
setTimeout(() => {
|
|
871
|
+
copy.textContent = t("feedback.copy");
|
|
872
|
+
}, 2e3);
|
|
873
|
+
}, () => {
|
|
874
|
+
});
|
|
875
|
+
});
|
|
876
|
+
button(t("feedback.email"), false, () => {
|
|
877
|
+
const subject = `TheOne ${String(draft?.version ?? "")} ${description.value.trim().split("\n")[0].slice(0, 40)}`.trim();
|
|
878
|
+
window.open(`mailto:${email}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(text().slice(0, 1800))}`, "_self");
|
|
879
|
+
});
|
|
880
|
+
const send = button(t("feedback.send"), true, () => {
|
|
881
|
+
if (send.disabled) return;
|
|
882
|
+
sending = true;
|
|
883
|
+
render();
|
|
884
|
+
void (async () => {
|
|
885
|
+
try {
|
|
886
|
+
const response = await fetch("/api/theone/feedback", {
|
|
887
|
+
method: "POST",
|
|
888
|
+
headers: { "content-type": "application/json" },
|
|
889
|
+
signal: lifetime.signal,
|
|
890
|
+
body: JSON.stringify({ action: "send", draft, description: description.value, contact: contact.value, lang: language() })
|
|
891
|
+
});
|
|
892
|
+
const body = await response.json().catch(() => ({}));
|
|
893
|
+
if (!response.ok || !body.id) throw new Error(body.error ?? "other");
|
|
894
|
+
sentId = body.id;
|
|
895
|
+
status.textContent = t("feedback.sent", { id: body.id });
|
|
896
|
+
description.disabled = contact.disabled = include.disabled = true;
|
|
897
|
+
} catch (error) {
|
|
898
|
+
const code = error instanceof Error ? error.message : "";
|
|
899
|
+
const known = ["UNREACHABLE", "RATE_LIMITED", "REJECTED", "SERVER_ERROR", "DESCRIPTION_REQUIRED", "TOO_LARGE", "DIRECT_OFF"].includes(code);
|
|
900
|
+
status.textContent = `${t(known ? `feedback.error.${code}` : "feedback.error.other")} ${t("feedback.fallback", { email })}`;
|
|
901
|
+
} finally {
|
|
902
|
+
sending = false;
|
|
903
|
+
render();
|
|
904
|
+
}
|
|
905
|
+
})();
|
|
906
|
+
});
|
|
907
|
+
description.addEventListener("input", render);
|
|
908
|
+
contact.addEventListener("input", render);
|
|
909
|
+
include.addEventListener("change", () => {
|
|
910
|
+
void load();
|
|
911
|
+
});
|
|
912
|
+
card.append(title, intro, description, contact, ...messageId ? [includeLabel] : [], preview, privacy, status, footer);
|
|
913
|
+
backdrop.append(card);
|
|
914
|
+
backdrop.addEventListener("pointerdown", (event) => {
|
|
915
|
+
if (event.target === backdrop && !description.value.trim()) close();
|
|
916
|
+
});
|
|
917
|
+
document.addEventListener("keydown", keydown, true);
|
|
918
|
+
document.body.append(backdrop);
|
|
919
|
+
description.focus();
|
|
920
|
+
void load();
|
|
921
|
+
}
|
|
702
922
|
const ICONS = {
|
|
703
923
|
download: ["M12 4v11", "M7 10l5 5 5-5", "M5 20h14"],
|
|
704
924
|
restart: ["M20 12a8 8 0 1 1-2.34-5.66L20 8.5", "M20 4v4.5h-4.5"],
|
|
@@ -732,9 +952,9 @@ function apply(ctx) {
|
|
|
732
952
|
const status = (0, import_react.useSyncExternalStore)(subscribeUpdate, () => update);
|
|
733
953
|
const waiting = !!status?.waiting && !status.available && !status.state;
|
|
734
954
|
if (!status || !status.available && !status.state && !waiting) return null;
|
|
735
|
-
const
|
|
955
|
+
const label2 = waiting ? t2("update.waiting") : status.state === "installing" ? t2("update.installing") : status.state === "reloading" ? t2("update.reloading") : status.state === "restart" ? t2("update.restart") : status.state === "failed" ? t2("update.failed") : t2("update.available");
|
|
736
956
|
const hint = waiting ? t2("update.waitingHint", { latest: status.waiting.version }) : status.error === "GATEWAY_BUSY" ? t2("update.busy") : status.state === "reloading" ? t2("update.reloadingHint") : status.state === "restart" ? t2("update.restartHint") : status.state === "failed" ? status.error === "OTHER_RELEASE_AGE" ? t2("update.otherAge", { names: status.detail ?? "" }) : status.error === "MINIMUM_RELEASE_AGE" ? status.exempt ? t2("update.ageStill", { detail: status.detail ?? "" }) : t2("update.tooNew") : status.error === "NETWORK" ? t2("update.network") : t2("update.failedHint", { error: status.detail ?? status.error ?? "" }) : status.installable ? t2("update.hint", { current: status.current, latest: status.latest ?? "" }) : t2("update.manualHint", { current: status.current, latest: status.latest ?? "" });
|
|
737
|
-
const title = `${
|
|
957
|
+
const title = `${label2} \xB7 ${hint}`;
|
|
738
958
|
const act = (event) => {
|
|
739
959
|
event.preventDefault();
|
|
740
960
|
event.stopPropagation();
|
|
@@ -950,7 +1170,7 @@ function apply(ctx) {
|
|
|
950
1170
|
const pinned = settings?.values.workerProvider && settings.values.workerModel ? { provider: settings.values.workerProvider, model: settings.values.workerModel } : null;
|
|
951
1171
|
const nameOf = (provider, model) => settings?.models.find((item) => item.provider === provider && item.id === model)?.name ?? model;
|
|
952
1172
|
const effective = settings?.model ? nameOf(settings.model.provider, settings.model.model) : void 0;
|
|
953
|
-
const
|
|
1173
|
+
const label2 = pinned ? nameOf(pinned.provider, pinned.model) : effective ?? t2("bg.follow");
|
|
954
1174
|
const choose = async (choice) => {
|
|
955
1175
|
closeMenu.current?.();
|
|
956
1176
|
setSaving(true);
|
|
@@ -1075,7 +1295,7 @@ function apply(ctx) {
|
|
|
1075
1295
|
window.addEventListener("blur", close);
|
|
1076
1296
|
(search ?? rows().find((row) => row.getAttribute("aria-checked") === "true") ?? rows()[0])?.focus();
|
|
1077
1297
|
};
|
|
1078
|
-
const title = failed ? t2("bg.error") : t2(pinned ? "bg.hint" : "bg.hintFollow", { model:
|
|
1298
|
+
const title = failed ? t2("bg.error") : t2(pinned ? "bg.hint" : "bg.hintFollow", { model: label2 });
|
|
1079
1299
|
return (0, import_react.createElement)(
|
|
1080
1300
|
"button",
|
|
1081
1301
|
{
|
|
@@ -1095,7 +1315,7 @@ function apply(ctx) {
|
|
|
1095
1315
|
}
|
|
1096
1316
|
},
|
|
1097
1317
|
(0, import_react.createElement)("span", { className: "theone-bg-caption", "aria-hidden": true }, icon("layers", 15)),
|
|
1098
|
-
(0, import_react.createElement)("span", { className: "theone-bg-text" },
|
|
1318
|
+
(0, import_react.createElement)("span", { className: "theone-bg-text" }, label2),
|
|
1099
1319
|
(0, import_react.createElement)("span", { className: "theone-bg-chevron", "aria-hidden": true }, saving ? "\u2026" : icon("chevron", 12))
|
|
1100
1320
|
);
|
|
1101
1321
|
}
|
|
@@ -1495,7 +1715,7 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1495
1715
|
}, []);
|
|
1496
1716
|
const own = new Set(topic.sourceSessionIds);
|
|
1497
1717
|
const edited = title.trim() !== topic.title || summary.trim() !== topic.summary || rules.trim() !== constraints;
|
|
1498
|
-
const field = (
|
|
1718
|
+
const field = (label2, control) => (0, import_react.createElement)("label", { className: "theone-manage-field" }, (0, import_react.createElement)("span", null, t2(label2)), control);
|
|
1499
1719
|
return (0, import_react.createElement)(
|
|
1500
1720
|
"div",
|
|
1501
1721
|
{ className: "theone-manage" },
|
|
@@ -1595,6 +1815,7 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1595
1815
|
)
|
|
1596
1816
|
);
|
|
1597
1817
|
}
|
|
1818
|
+
const label = (text) => text.replace(/\s*[::]\s*$/, "");
|
|
1598
1819
|
function RouteList({ routes, stats, contexts, post, busy }) {
|
|
1599
1820
|
const t2 = useText();
|
|
1600
1821
|
const titleOf = (id) => contexts.find((context) => context.id === id)?.title ?? t2("routes.removed");
|
|
@@ -1626,17 +1847,18 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1626
1847
|
return (0, import_react.createElement)(
|
|
1627
1848
|
"li",
|
|
1628
1849
|
{ key: route.messageId },
|
|
1850
|
+
(0, import_react.createElement)("time", null, new Date(route.at).toLocaleTimeString(localeSnapshot().active, { hour: "2-digit", minute: "2-digit" })),
|
|
1851
|
+
(0, import_react.createElement)("q", null, route.excerpt || "\u2026"),
|
|
1629
1852
|
(0, import_react.createElement)(
|
|
1630
1853
|
"div",
|
|
1631
|
-
{ className: "theone-route-
|
|
1632
|
-
(0, import_react.createElement)("
|
|
1633
|
-
(0, import_react.createElement)("
|
|
1854
|
+
{ className: "theone-route-target" },
|
|
1855
|
+
(0, import_react.createElement)("strong", null, route.decision.action === "CLARIFY" ? t2("routes.clarify") : `\u2192 ${titleOf(target)}`),
|
|
1856
|
+
(0, import_react.createElement)("small", null, details)
|
|
1634
1857
|
),
|
|
1635
1858
|
(0, import_react.createElement)(
|
|
1636
1859
|
"div",
|
|
1637
|
-
{ className: "theone-route-
|
|
1638
|
-
(0, import_react.createElement)("
|
|
1639
|
-
(0, import_react.createElement)("small", null, details),
|
|
1860
|
+
{ className: "theone-route-actions" },
|
|
1861
|
+
(0, import_react.createElement)("button", { type: "button", className: "theone-quiet", onClick: () => openFeedbackDialog(route.messageId) }, t2("routes.report")),
|
|
1640
1862
|
route.correctedTo ? (0, import_react.createElement)("span", { className: "theone-route-fixed" }, t2("routes.corrected", { title: titleOf(route.correctedTo) })) : (0, import_react.createElement)(
|
|
1641
1863
|
"select",
|
|
1642
1864
|
{
|
|
@@ -1781,6 +2003,10 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1781
2003
|
if (!linkage || linkage.scope === "off") return null;
|
|
1782
2004
|
const own = linkage.topics[id];
|
|
1783
2005
|
if (!own) return null;
|
|
2006
|
+
if (managing !== id) return own.related.length || own.private ? [
|
|
2007
|
+
(0, import_react.createElement)("dt", { key: "dt" }, label(t2("link.label"))),
|
|
2008
|
+
(0, import_react.createElement)("dd", { key: "dd" }, own.related.map((topic) => topic.title).join(" \xB7 "), own.private ? (0, import_react.createElement)("span", { className: "theone-tag" }, t2("link.private")) : null)
|
|
2009
|
+
] : null;
|
|
1784
2010
|
const related = new Set(own.related.map((topic) => topic.id));
|
|
1785
2011
|
const others = snapshot.contexts.filter((context) => context.id !== id && !related.has(context.id));
|
|
1786
2012
|
return (0, import_react.createElement)(
|
|
@@ -1845,26 +2071,48 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1845
2071
|
const assigned = new Set(snapshot?.groups.flatMap((group) => group.contextIds) ?? []);
|
|
1846
2072
|
const groups = [...snapshot?.groups ?? [], ...snapshot?.contexts.some((c) => !assigned.has(c.id)) ? [{ id: "pending", title: t2("catalog.unassigned"), summary: t2("catalog.unassignedSummary"), contextIds: snapshot.contexts.filter((c) => !assigned.has(c.id)).map((c) => c.id) }] : []];
|
|
1847
2073
|
const status = snapshot?.status;
|
|
2074
|
+
const kept = routeStats?.total ? Math.round(100 * (routeStats.total - routeStats.corrected) / routeStats.total) : void 0;
|
|
2075
|
+
const figure = (value, name) => (0, import_react.createElement)("div", { key: name }, (0, import_react.createElement)("dd", null, value), (0, import_react.createElement)("dt", null, name));
|
|
1848
2076
|
return (0, import_react.createElement)(
|
|
1849
2077
|
"section",
|
|
1850
2078
|
{ className: "theone-catalog", translate: "no" },
|
|
1851
2079
|
(0, import_react.createElement)(
|
|
1852
2080
|
"header",
|
|
1853
2081
|
{ className: "theone-catalog-header" },
|
|
1854
|
-
(0, import_react.createElement)(
|
|
2082
|
+
(0, import_react.createElement)(
|
|
2083
|
+
"div",
|
|
2084
|
+
{ className: "theone-catalog-heading" },
|
|
2085
|
+
(0, import_react.createElement)("p", { className: "theone-overline" }, "TheOne"),
|
|
2086
|
+
(0, import_react.createElement)("h1", null, t2("catalog.title")),
|
|
2087
|
+
(0, import_react.createElement)("p", { className: "theone-catalog-lede" }, t2("catalog.subtitle"))
|
|
2088
|
+
),
|
|
2089
|
+
snapshot ? (0, import_react.createElement)(
|
|
2090
|
+
"dl",
|
|
2091
|
+
{ className: "theone-figures" },
|
|
2092
|
+
figure(snapshot.contexts.length, t2("catalog.figTopics")),
|
|
2093
|
+
figure(snapshot.groups.length, t2("catalog.figGroups")),
|
|
2094
|
+
kept !== void 0 ? figure(`${kept}%`, t2("catalog.figKept")) : null
|
|
2095
|
+
) : null
|
|
2096
|
+
),
|
|
2097
|
+
(0, import_react.createElement)(
|
|
2098
|
+
"div",
|
|
2099
|
+
{ className: "theone-toolbar" },
|
|
2100
|
+
(0, import_react.createElement)("p", { className: "theone-catalog-status", role: "status" }, snapshot ? status?.running ? t2("catalog.indexing") : status?.pending ? t2("catalog.pending", { count: status.pending, sessionSuffix: status.pending === 1 ? "" : "s" }) : t2("catalog.updated") : t2("catalog.reading")),
|
|
1855
2101
|
(0, import_react.createElement)(
|
|
1856
2102
|
"div",
|
|
1857
2103
|
{ className: "theone-catalog-tools" },
|
|
1858
|
-
(0, import_react.createElement)("button", { type: "button", disabled: !!busy, onClick: () => setCreating((open) => !open) }, t2("manage.create")),
|
|
2104
|
+
(0, import_react.createElement)("button", { type: "button", className: "theone-primary", disabled: !!busy, onClick: () => setCreating((open) => !open) }, t2("manage.create")),
|
|
2105
|
+
(0, import_react.createElement)("button", { type: "button", onClick: refresh, disabled: !!busy || status?.running }, t2("catalog.refresh")),
|
|
1859
2106
|
snapshot?.linkage && snapshot.linkage.scope !== "off" ? (0, import_react.createElement)("button", {
|
|
1860
2107
|
type: "button",
|
|
2108
|
+
className: "theone-quiet",
|
|
1861
2109
|
disabled: !!busy,
|
|
1862
2110
|
title: t2("link.clearLearnedHint"),
|
|
1863
2111
|
onClick: () => {
|
|
1864
2112
|
void editLinks({ action: "clearLearned" });
|
|
1865
2113
|
}
|
|
1866
2114
|
}, t2("link.clearLearned")) : null,
|
|
1867
|
-
(0, import_react.createElement)("button", { type: "button",
|
|
2115
|
+
(0, import_react.createElement)("button", { type: "button", className: "theone-quiet", onClick: () => openFeedbackDialog() }, t2("feedback.open"))
|
|
1868
2116
|
)
|
|
1869
2117
|
),
|
|
1870
2118
|
creating ? (0, import_react.createElement)(
|
|
@@ -1874,57 +2122,83 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1874
2122
|
void post("/api/theone/topics", { action: "create", title: newTitle });
|
|
1875
2123
|
} },
|
|
1876
2124
|
(0, import_react.createElement)("input", { value: newTitle, maxLength: 80, autoFocus: true, placeholder: t2("manage.title"), disabled: !!busy, onChange: (event) => setNewTitle(event.target.value) }),
|
|
1877
|
-
(0, import_react.createElement)("button", { type: "submit", disabled: !!busy || !newTitle.trim() }, t2("manage.createButton")),
|
|
1878
|
-
(0, import_react.createElement)("button", { type: "button", onClick: () => {
|
|
2125
|
+
(0, import_react.createElement)("button", { type: "submit", className: "theone-primary", disabled: !!busy || !newTitle.trim() }, t2("manage.createButton")),
|
|
2126
|
+
(0, import_react.createElement)("button", { type: "button", className: "theone-quiet", onClick: () => {
|
|
1879
2127
|
setCreating(false);
|
|
1880
2128
|
setNewTitle("");
|
|
1881
2129
|
} }, t2("manage.cancel"))
|
|
1882
2130
|
) : null,
|
|
1883
|
-
snapshot?.linkage?.scope === "off" ? (0, import_react.createElement)("p", { className: "theone-catalog-
|
|
1884
|
-
(0, import_react.createElement)("p", { className: "theone-catalog-status", role: "status" }, snapshot ? t2("catalog.counts", { topics: snapshot.contexts.length, groups: snapshot.groups.length, topicSuffix: snapshot.contexts.length === 1 ? "" : "s", groupSuffix: snapshot.groups.length === 1 ? "" : "s" }) + " \xB7 " + (status?.running ? t2("catalog.indexing") : status?.pending ? t2("catalog.pending", { count: status.pending, sessionSuffix: status.pending === 1 ? "" : "s" }) : t2("catalog.updated")) : t2("catalog.reading")),
|
|
2131
|
+
snapshot?.linkage?.scope === "off" ? (0, import_react.createElement)("p", { className: "theone-catalog-note" }, t2("link.off")) : null,
|
|
1885
2132
|
status?.failed ? (0, import_react.createElement)("p", { className: "theone-catalog-warning" }, t2("catalog.failed", { count: status.failed, sessionSuffix: status.failed === 1 ? "" : "s" })) : null,
|
|
1886
2133
|
status?.searchUnavailable ? (0, import_react.createElement)("p", { className: "theone-catalog-warning" }, t2("catalog.searchUnavailable")) : null,
|
|
1887
2134
|
error ? (0, import_react.createElement)("p", { role: "alert", className: "theone-catalog-warning" }, t2(error)) : null,
|
|
1888
2135
|
snapshot ? (0, import_react.createElement)(RouteList, { routes, stats: routeStats, contexts: snapshot.contexts, post, busy: !!busy }) : null,
|
|
1889
2136
|
snapshot && !snapshot.contexts.length ? (0, import_react.createElement)("p", { className: "theone-catalog-empty" }, t2(status?.running ? "catalog.emptyIndexing" : "catalog.empty")) : null,
|
|
1890
|
-
(0, import_react.createElement)("div", { className: "theone-catalog-groups" }, ...groups.map((group) => (0, import_react.createElement)(
|
|
2137
|
+
(0, import_react.createElement)("div", { className: "theone-catalog-groups" }, ...groups.map((group, index) => (0, import_react.createElement)(
|
|
1891
2138
|
"section",
|
|
1892
2139
|
{ key: group.id, className: "theone-topic-group" },
|
|
1893
|
-
(0, import_react.createElement)(
|
|
1894
|
-
|
|
1895
|
-
|
|
2140
|
+
(0, import_react.createElement)(
|
|
2141
|
+
"header",
|
|
2142
|
+
{ className: "theone-group-head" },
|
|
2143
|
+
(0, import_react.createElement)("span", { className: "theone-group-index" }, String(index + 1).padStart(2, "0")),
|
|
2144
|
+
(0, import_react.createElement)("h2", null, group.title, (0, import_react.createElement)("span", null, group.contextIds.length)),
|
|
2145
|
+
group.summary ? (0, import_react.createElement)("p", { className: "theone-group-summary" }, group.summary) : null
|
|
2146
|
+
),
|
|
2147
|
+
(0, import_react.createElement)("ol", { className: "theone-topic-list" }, ...group.contextIds.flatMap((id) => {
|
|
1896
2148
|
const topic = snapshot?.contexts.find((c) => c.id === id);
|
|
1897
2149
|
if (!topic) return [];
|
|
1898
2150
|
const constraints = snapshot?.linkage?.topics[id]?.constraints ?? "";
|
|
2151
|
+
const open = managing === id;
|
|
2152
|
+
const links = linkRow(id);
|
|
1899
2153
|
return [(0, import_react.createElement)(
|
|
1900
|
-
"
|
|
1901
|
-
{ key: id, className:
|
|
1902
|
-
(0, import_react.createElement)(
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
2154
|
+
"li",
|
|
2155
|
+
{ key: id, className: `theone-topic-card${open ? " theone-open" : ""}${topic.hidden ? " theone-hidden" : ""}` },
|
|
2156
|
+
(0, import_react.createElement)(
|
|
2157
|
+
"div",
|
|
2158
|
+
{ className: "theone-topic-main" },
|
|
2159
|
+
(0, import_react.createElement)("h3", null, topic.title),
|
|
2160
|
+
topic.summary && topic.summary.trim() !== topic.title.trim() ? (0, import_react.createElement)("p", { className: "theone-topic-summary" }, topic.summary) : null,
|
|
2161
|
+
topic.hidden ? (0, import_react.createElement)("p", { className: "theone-topic-warning" }, t2(topic.hidden === "archived" ? "topic.hiddenArchived" : "topic.hiddenOrphaned")) : null,
|
|
2162
|
+
topic.lastState || constraints || links && !open ? (0, import_react.createElement)(
|
|
2163
|
+
"dl",
|
|
2164
|
+
{ className: "theone-topic-meta" },
|
|
2165
|
+
topic.lastState ? [(0, import_react.createElement)("dt", { key: "s" }, label(t2("topic.state"))), (0, import_react.createElement)("dd", { key: "sv" }, topic.lastState)] : null,
|
|
2166
|
+
constraints ? [(0, import_react.createElement)("dt", { key: "c" }, label(t2("topic.constraints"))), (0, import_react.createElement)("dd", { key: "cv" }, constraints)] : null,
|
|
2167
|
+
open ? null : links
|
|
2168
|
+
) : null
|
|
2169
|
+
),
|
|
1908
2170
|
(0, import_react.createElement)(
|
|
1909
2171
|
"div",
|
|
1910
2172
|
{ className: "theone-topic-actions" },
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
2173
|
+
// A hidden topic has nothing left to continue: its conversations are gone or archived.
|
|
2174
|
+
(0, import_react.createElement)("button", {
|
|
2175
|
+
type: "button",
|
|
2176
|
+
className: "theone-continue",
|
|
2177
|
+
disabled: !!busy || !!topic.hidden,
|
|
2178
|
+
title: topic.hidden ? t2("topic.continueHidden") : void 0,
|
|
2179
|
+
onClick: () => {
|
|
2180
|
+
void continueTopic(id);
|
|
2181
|
+
}
|
|
2182
|
+
}, t2(busy === id ? "topic.opening" : "topic.continue"), (0, import_react.createElement)("span", { "aria-hidden": true }, " \u2192")),
|
|
2183
|
+
(0, import_react.createElement)("button", { type: "button", className: "theone-quiet", "aria-expanded": open, onClick: () => setManaging((current) => current === id ? void 0 : id) }, t2(open ? "manage.close" : "manage.open")),
|
|
2184
|
+
...(topic.hidden === "orphaned" ? [] : topic.sourceSessionIds).slice(0, 3).map((sessionId, i) => (0, import_react.createElement)("button", {
|
|
1916
2185
|
key: sessionId,
|
|
1917
2186
|
type: "button",
|
|
1918
|
-
className: "theone-
|
|
2187
|
+
className: "theone-quiet",
|
|
1919
2188
|
onClick: () => {
|
|
1920
2189
|
ctx.layout.beginNavigation();
|
|
1921
2190
|
ctx.uiWorkspace.openSession(sessionId);
|
|
1922
2191
|
}
|
|
1923
2192
|
}, t2("topic.source") + (topic.sourceSessionIds.length > 1 ? " " + (i + 1) : "")))
|
|
1924
2193
|
),
|
|
1925
|
-
|
|
2194
|
+
open ? (0, import_react.createElement)(
|
|
2195
|
+
"div",
|
|
2196
|
+
{ className: "theone-topic-edit" },
|
|
2197
|
+
links,
|
|
2198
|
+
(0, import_react.createElement)(TopicManager, { key: `${id}:${topic.title}:${topic.summary}:${constraints}`, topic, constraints, groups: snapshot.groups, contexts: snapshot.contexts, post, busy: !!busy })
|
|
2199
|
+
) : null
|
|
1926
2200
|
)];
|
|
1927
|
-
})
|
|
2201
|
+
}))
|
|
1928
2202
|
)))
|
|
1929
2203
|
);
|
|
1930
2204
|
}
|
|
@@ -2004,6 +2278,12 @@ button:has(.theone-nav[data-wide=true])>span:has(.theone-nav){flex:1;min-width:0
|
|
|
2004
2278
|
.theone-dialog-actions .theone-dialog-primary:hover{background:#4a7fc0}
|
|
2005
2279
|
.theone-dialog-actions button:focus-visible{outline:2px solid #4a7fc0;outline-offset:2px}
|
|
2006
2280
|
.theone-dialog .theone-dialog-body{white-space:pre-wrap;color:var(--dsw-alias-label-primary,#e8e8ea)}
|
|
2281
|
+
.theone-feedback{width:min(560px,100%);max-height:calc(100vh - 32px);overflow:auto}
|
|
2282
|
+
.theone-feedback textarea,.theone-feedback input:not([type=checkbox]){display:block;width:100%;box-sizing:border-box;margin:0 0 10px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2,#ffffff1f);border-radius:9px;background:transparent;color:inherit;font:inherit;resize:vertical}
|
|
2283
|
+
.theone-feedback .theone-feedback-check{display:block;margin:0 0 10px;font-size:13px;color:var(--dsw-alias-label-secondary,#a0a0a6)}
|
|
2284
|
+
.theone-feedback-preview{margin:0 0 10px;font-size:13px}
|
|
2285
|
+
.theone-feedback-preview summary{cursor:pointer;color:var(--dsw-alias-label-secondary,#a0a0a6)}
|
|
2286
|
+
.theone-feedback-preview pre{max-height:220px;overflow:auto;margin:6px 0 0;padding:8px 10px;border-radius:9px;background:#0000001f;font-size:12px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
|
|
2007
2287
|
.theone-notice{display:flex;align-items:center;gap:8px;margin:6px 4px 0;padding:6px 8px 6px 10px;border:1px solid var(--dsw-alias-border-l2,#ffffff1f);border-radius:10px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#a0a0a6);min-width:0}
|
|
2008
2288
|
.theone-notice-tag{flex:none;display:inline-flex;padding:3px;border-radius:6px;background:#3b6fb033;color:#7fa9dd}
|
|
2009
2289
|
.theone-notice-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -2027,8 +2307,93 @@ button:has(.theone-nav[data-wide=true])>span:has(.theone-nav){flex:1;min-width:0
|
|
|
2027
2307
|
`;
|
|
2028
2308
|
var catalogCss = `
|
|
2029
2309
|
button:has(.theone-catalog-entry)>span:not(:has(.theone-catalog-entry)){display:none}
|
|
2030
|
-
.theone-catalog{
|
|
2031
|
-
|
|
2310
|
+
.theone-catalog{--t-fg:var(--dsw-alias-label-primary,#18181b);--t-muted:var(--dsw-alias-label-secondary,#6b6b72);--t-rule:var(--dsw-alias-border-l2,#18181b1f);--t-accent:#b4531c;--t-warn:#c2410c;--t-field:#18181b0a;
|
|
2311
|
+
container-type:inline-size;box-sizing:border-box;height:100%;overflow:auto;padding:48px 56px 96px;color:var(--t-fg);font-feature-settings:"tnum" 1}
|
|
2312
|
+
[data-ds-dark-theme] .theone-catalog{--t-accent:#8cc2ef;--t-warn:#fb923c;--t-field:#ffffff0d}
|
|
2313
|
+
.theone-catalog>*{max-width:1120px;margin-left:auto;margin-right:auto}
|
|
2314
|
+
.theone-catalog button{font:inherit;font-size:13px;line-height:1.4;color:inherit;background:transparent;border:1px solid var(--t-rule);border-radius:6px;padding:6px 12px;cursor:pointer;white-space:nowrap}
|
|
2315
|
+
.theone-catalog button:hover:not(:disabled){border-color:var(--t-fg)}
|
|
2316
|
+
.theone-catalog button:disabled{opacity:.4;cursor:default}
|
|
2317
|
+
.theone-catalog button:focus-visible{outline:2px solid var(--t-accent);outline-offset:2px}
|
|
2318
|
+
.theone-catalog .theone-primary{background:var(--t-fg);border-color:var(--t-fg);color:var(--dsw-alias-bg-primary,#fff)}
|
|
2319
|
+
[data-ds-dark-theme] .theone-catalog .theone-primary{color:#111}
|
|
2320
|
+
.theone-catalog .theone-quiet{border-color:transparent;color:var(--t-muted);padding-left:6px;padding-right:6px}
|
|
2321
|
+
.theone-catalog .theone-quiet:hover:not(:disabled){border-color:transparent;color:var(--t-fg);text-decoration:underline;text-underline-offset:3px}
|
|
2322
|
+
.theone-catalog .theone-continue{border-color:transparent;color:var(--t-accent);font-weight:600;padding-left:0;padding-right:6px}
|
|
2323
|
+
.theone-catalog .theone-continue:hover:not(:disabled){border-color:transparent;text-decoration:underline;text-underline-offset:3px}
|
|
2324
|
+
.theone-catalog-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:24px 48px;padding-bottom:28px;border-bottom:2px solid var(--t-fg)}
|
|
2325
|
+
.theone-overline{margin:0 0 14px;font-size:12px;font-weight:600;letter-spacing:.06em;color:var(--t-accent)}
|
|
2326
|
+
.theone-catalog h1{margin:0;font-size:44px;line-height:1.05;font-weight:700;letter-spacing:-.02em}
|
|
2327
|
+
.theone-catalog-lede{margin:14px 0 0;max-width:34em;font-size:15px;line-height:1.6;color:var(--t-muted)}
|
|
2328
|
+
.theone-figures{display:flex;gap:40px;margin:0}
|
|
2329
|
+
.theone-figures>div{display:flex;flex-direction:column-reverse;gap:6px;min-width:64px}
|
|
2330
|
+
.theone-figures dd{margin:0;font-size:40px;line-height:1;font-weight:600;letter-spacing:-.02em}
|
|
2331
|
+
.theone-figures dt{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--t-muted)}
|
|
2332
|
+
.theone-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 24px;padding:14px 0 40px}
|
|
2333
|
+
.theone-catalog-status{margin:0;font-size:13px;color:var(--t-muted)}
|
|
2334
|
+
.theone-catalog-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
|
2335
|
+
.theone-catalog-note,.theone-catalog-empty{color:var(--t-muted);font-size:14px;line-height:1.7}
|
|
2336
|
+
.theone-catalog-empty{padding:48px 0}
|
|
2337
|
+
.theone-catalog-warning{margin:0 0 24px;padding:10px 0 10px 14px;border-left:2px solid var(--t-warn);font-size:13px;line-height:1.6}
|
|
2338
|
+
.theone-catalog-entry{display:flex;align-items:center;gap:10px;font-size:14px}
|
|
2339
|
+
.theone-routes{margin-bottom:56px;border-top:1px solid var(--t-rule);border-bottom:1px solid var(--t-rule)}
|
|
2340
|
+
.theone-routes summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:14px 0;cursor:pointer;font-size:13px;font-weight:600;letter-spacing:.04em;list-style:none}
|
|
2341
|
+
.theone-routes summary::-webkit-details-marker{display:none}
|
|
2342
|
+
.theone-routes summary::before{content:"+";display:inline-block;width:14px;color:var(--t-muted);font-weight:400}
|
|
2343
|
+
.theone-routes[open] summary::before{content:"\u2212"}
|
|
2344
|
+
.theone-routes summary>span{color:var(--t-muted);font-weight:400}
|
|
2345
|
+
.theone-route-stats{font-weight:400;color:var(--t-muted);font-size:12px}
|
|
2346
|
+
.theone-routes .theone-manage-hint{margin:0 0 12px 26px;max-width:46em}
|
|
2347
|
+
.theone-routes ol{list-style:none;margin:0;padding:0 0 8px}
|
|
2348
|
+
.theone-routes li{display:grid;grid-template-columns:52px minmax(0,1.3fr) minmax(0,1fr) auto;gap:4px 20px;align-items:baseline;padding:10px 0;border-top:1px solid var(--t-rule);font-size:13px}
|
|
2349
|
+
.theone-routes time{color:var(--t-muted)}
|
|
2350
|
+
.theone-routes q{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;quotes:none}
|
|
2351
|
+
.theone-route-target{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
2352
|
+
.theone-route-target strong{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
2353
|
+
.theone-route-target small{color:var(--t-muted);font-size:12px}
|
|
2354
|
+
.theone-route-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end}
|
|
2355
|
+
.theone-route-fixed{color:var(--t-muted);font-size:12px}
|
|
2356
|
+
.theone-routes select{width:auto;max-width:150px;padding-top:4px;padding-bottom:4px;font-size:12px}
|
|
2357
|
+
.theone-catalog-groups{display:flex;flex-direction:column;gap:56px}
|
|
2358
|
+
.theone-topic-group{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,9fr);gap:0 40px;border-top:2px solid var(--t-fg);padding-top:16px}
|
|
2359
|
+
.theone-group-head{position:sticky;top:0;align-self:start}
|
|
2360
|
+
.theone-group-index{display:block;margin-bottom:10px;font-size:13px;font-weight:600;color:var(--t-accent)}
|
|
2361
|
+
.theone-topic-group h2{margin:0;font-size:22px;line-height:1.2;font-weight:700;letter-spacing:-.01em}
|
|
2362
|
+
.theone-topic-group h2 span{margin-left:8px;font-size:13px;font-weight:400;color:var(--t-muted)}
|
|
2363
|
+
.theone-group-summary{margin:10px 0 0;font-size:13px;line-height:1.6;color:var(--t-muted)}
|
|
2364
|
+
.theone-topic-list{list-style:none;margin:0;padding:0}
|
|
2365
|
+
.theone-topic-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 32px;padding:18px 0 20px;border-top:1px solid var(--t-rule)}
|
|
2366
|
+
.theone-topic-card:first-child{border-top:0;padding-top:4px}
|
|
2367
|
+
.theone-topic-card.theone-hidden .theone-topic-main{opacity:.6}
|
|
2368
|
+
.theone-topic-card h3{margin:0;font-size:16px;line-height:1.4;font-weight:600}
|
|
2369
|
+
.theone-topic-summary{margin:6px 0 0;max-width:42em;font-size:14px;line-height:1.6;color:var(--t-muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
|
2370
|
+
.theone-topic-meta{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 16px;margin:14px 0 0;max-width:46em;font-size:13px;line-height:1.55}
|
|
2371
|
+
.theone-topic-meta dt{color:var(--t-muted);font-size:12px;white-space:nowrap}
|
|
2372
|
+
.theone-topic-meta dd{margin:0}
|
|
2373
|
+
.theone-tag{display:inline-block;margin-left:8px;padding:0 6px;border:1px solid var(--t-rule);border-radius:4px;font-size:11px;color:var(--t-muted)}
|
|
2374
|
+
.theone-topic-warning{margin:10px 0 0;padding-left:12px;border-left:2px solid var(--t-warn);font-size:12px;line-height:1.6}
|
|
2375
|
+
.theone-topic-actions{display:flex;flex-direction:column;align-items:flex-end;gap:0}.theone-topic-actions button{padding-top:3px;padding-bottom:3px}
|
|
2376
|
+
.theone-topic-edit{grid-column:1/-1;margin-top:12px;padding:4px 0 4px 20px;border-left:2px solid var(--t-accent)}
|
|
2377
|
+
.theone-topic-links{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0 0 16px;font-size:13px}
|
|
2378
|
+
.theone-links-label,.theone-links-empty{color:var(--t-muted)}
|
|
2379
|
+
.theone-link-chip{display:inline-flex;align-items:center;gap:2px;padding:2px 2px 2px 10px;border:1px solid var(--t-rule);border-radius:4px}
|
|
2380
|
+
.theone-catalog .theone-link-chip button{border:0;padding:0 6px;font-size:14px;line-height:1;color:var(--t-muted)}
|
|
2381
|
+
.theone-link-private{display:inline-flex;align-items:center;gap:6px;color:var(--t-muted);cursor:pointer}
|
|
2382
|
+
.theone-catalog input:not([type=checkbox]),.theone-catalog textarea,.theone-catalog select{font:inherit;font-size:13px;color:inherit;background:var(--t-field);border:1px solid transparent;border-bottom-color:var(--t-rule);border-radius:4px 4px 0 0;padding:7px 10px;box-sizing:border-box;min-width:0}
|
|
2383
|
+
.theone-catalog input:not([type=checkbox]):focus,.theone-catalog textarea:focus,.theone-catalog select:focus{outline:none;border-bottom-color:var(--t-accent)}
|
|
2384
|
+
.theone-manage{display:flex;flex-direction:column;gap:14px;font-size:13px}
|
|
2385
|
+
.theone-create{flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 40px;padding:16px 0;border-top:1px solid var(--t-rule);border-bottom:1px solid var(--t-rule)}
|
|
2386
|
+
.theone-create input{flex:1;min-width:200px}
|
|
2387
|
+
.theone-manage-field{display:flex;flex-direction:column;gap:6px}
|
|
2388
|
+
.theone-manage-field>span{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--t-muted)}
|
|
2389
|
+
.theone-manage textarea{resize:vertical;width:100%}
|
|
2390
|
+
.theone-manage-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
|
2391
|
+
.theone-manage-row select,.theone-manage-row input{flex:1;min-width:160px}
|
|
2392
|
+
.theone-manage-hint{margin:0;font-size:12px;line-height:1.6;color:var(--t-muted)}
|
|
2393
|
+
.theone-catalog .theone-danger{color:var(--t-warn);border-color:var(--t-warn)}
|
|
2394
|
+
@container (max-width:860px){.theone-topic-group{grid-template-columns:1fr}.theone-group-head{position:static;margin-bottom:20px}.theone-catalog-header{grid-template-columns:1fr}.theone-figures{gap:32px}}
|
|
2395
|
+
@container (max-width:640px){.theone-catalog h1{font-size:32px}.theone-figures dd{font-size:30px}.theone-topic-card{grid-template-columns:1fr}.theone-topic-actions{flex-direction:row;flex-wrap:wrap;align-items:center}.theone-routes li{grid-template-columns:44px minmax(0,1fr)}.theone-route-target,.theone-route-actions{grid-column:2}.theone-route-actions{justify-content:flex-start}}
|
|
2396
|
+
@media(max-width:640px){.theone-catalog{padding:28px 16px 64px}}
|
|
2032
2397
|
`;
|
|
2033
2398
|
var composerCss = `
|
|
2034
2399
|
.theone-bg{display:inline-flex;align-items:center;gap:5px;height:32px;padding:0 10px;border:0;border-radius:10px;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;white-space:nowrap;cursor:pointer;max-width:220px}
|