dsh-laivox-tts 0.7.8 → 0.7.9

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 CHANGED
@@ -34,7 +34,7 @@ Make sure the `dsh` command is available:
34
34
  dsh plugin --profile desktop add "https://github.com/xiaolai181/dsh_laivox_tts/releases/latest/download/dsh-laivox-tts.tgz"
35
35
  ```
36
36
 
37
- This installs a prebuilt package—nothing is compiled locally and no install scripts run. To pin a specific version, replace `latest/download` with `download/v0.7.8` (see [Releases](https://github.com/xiaolai181/dsh_laivox_tts/releases)).
37
+ This installs a prebuilt package—nothing is compiled locally and no install scripts run. To pin a specific version, replace `latest/download` with `download/v0.7.9` (see [Releases](https://github.com/xiaolai181/dsh_laivox_tts/releases)).
38
38
 
39
39
  ### Offline package install
40
40
 
package/README.zh-CN.md CHANGED
@@ -36,7 +36,7 @@
36
36
  dsh plugin --profile desktop add "https://github.com/xiaolai181/dsh_laivox_tts/releases/latest/download/dsh-laivox-tts.tgz"
37
37
  ```
38
38
 
39
- 安装的是预构建插件包,无需在本地编译或授权构建脚本。如需锁定版本,可将 `latest/download` 替换为 `download/v0.7.8`(全部版本见 [Releases](https://github.com/xiaolai181/dsh_laivox_tts/releases))。
39
+ 安装的是预构建插件包,无需在本地编译或授权构建脚本。如需锁定版本,可将 `latest/download` 替换为 `download/v0.7.9`(全部版本见 [Releases](https://github.com/xiaolai181/dsh_laivox_tts/releases))。
40
40
 
41
41
  ### 离线安装包安装
42
42
 
package/lib/client.js CHANGED
@@ -1428,7 +1428,15 @@ var en_default = {
1428
1428
  "\u5185\u7F6E\u793A\u4F8B\u6587\u4EF6\u6821\u9A8C\u672A\u901A\u8FC7\u3002": "Built-in sample checksum verification failed.",
1429
1429
  "\u5185\u7F6E\u793A\u4F8B\u4E66\u7C4D\u6570\u636E\u65E0\u6548\u3002": "Built-in sample book data is invalid.",
1430
1430
  "\u5185\u7F6E\u793A\u4F8B\u97F3\u9891\u5206\u6BB5\u4E0D\u5B8C\u6574\u3002": "Built-in sample audio segments are incomplete.",
1431
- "\u5185\u7F6E\u793A\u4F8B\u97F3\u9891\u683C\u5F0F\u65E0\u6548\u3002": "Built-in sample audio format is invalid."
1431
+ "\u5185\u7F6E\u793A\u4F8B\u97F3\u9891\u683C\u5F0F\u65E0\u6548\u3002": "Built-in sample audio format is invalid.",
1432
+ \u9009\u62E9\u4E00\u672C\u4E66\u67E5\u770B\u7AE0\u8282\u76EE\u5F55: "Select a book to view its chapters",
1433
+ \u5173\u95ED\u64AD\u653E\u5668: "Close player",
1434
+ \u6682\u505C\u5E76\u5173\u95ED\u64AD\u653E\u5668: "Pause and close player",
1435
+ \u6682\u505C\u5E76\u5173\u95ED: "Pause and close",
1436
+ \u53F3\u4E0B\u89D2\u8FF7\u4F60\u64AD\u653E\u6761: "Bottom-right mini player",
1437
+ \u64AD\u653E\u6216\u6682\u505C\u65F6: "While playing or paused",
1438
+ \u4EC5\u64AD\u653E\u65F6: "Only while playing",
1439
+ "\u79BB\u5F00\u5DE5\u4F5C\u53F0\u540E\u53F3\u4E0B\u89D2\u60AC\u6D6E\u64AD\u653E\u6761\u7684\u663E\u793A\u65F6\u673A\uFF1B\u4E5F\u53EF\u968F\u65F6\u70B9\u6761\u4E0A\u7684 \xD7 \u5173\u95ED\u3002\u5BF9\u8BDD\u6D88\u606F\u7684\u5373\u65F6\u6717\u8BFB\u63D0\u793A\u4E0D\u53D7\u5F71\u54CD\u3002": "Controls when the floating mini player appears in the bottom-right corner outside the workbench; you can still close it anytime with \xD7. Instant chat message readings are unaffected."
1432
1440
  };
1433
1441
 
1434
1442
  // src/client/i18n/zh-hant.json
@@ -2822,7 +2830,15 @@ var zh_hant_default = {
2822
2830
  "\u5185\u7F6E\u793A\u4F8B\u6587\u4EF6\u6821\u9A8C\u672A\u901A\u8FC7\u3002": "\u5167\u5EFA\u7BC4\u4F8B\u6A94\u6848\u6821\u9A57\u672A\u901A\u904E\u3002",
2823
2831
  "\u5185\u7F6E\u793A\u4F8B\u4E66\u7C4D\u6570\u636E\u65E0\u6548\u3002": "\u5167\u5EFA\u7BC4\u4F8B\u66F8\u7C4D\u8CC7\u6599\u7121\u6548\u3002",
2824
2832
  "\u5185\u7F6E\u793A\u4F8B\u97F3\u9891\u5206\u6BB5\u4E0D\u5B8C\u6574\u3002": "\u5167\u5EFA\u7BC4\u4F8B\u97F3\u8A0A\u5206\u6BB5\u4E0D\u5B8C\u6574\u3002",
2825
- "\u5185\u7F6E\u793A\u4F8B\u97F3\u9891\u683C\u5F0F\u65E0\u6548\u3002": "\u5167\u5EFA\u7BC4\u4F8B\u97F3\u8A0A\u683C\u5F0F\u7121\u6548\u3002"
2833
+ "\u5185\u7F6E\u793A\u4F8B\u97F3\u9891\u683C\u5F0F\u65E0\u6548\u3002": "\u5167\u5EFA\u7BC4\u4F8B\u97F3\u8A0A\u683C\u5F0F\u7121\u6548\u3002",
2834
+ \u9009\u62E9\u4E00\u672C\u4E66\u67E5\u770B\u7AE0\u8282\u76EE\u5F55: "\u9078\u64C7\u4E00\u672C\u66F8\u6AA2\u8996\u7AE0\u7BC0\u76EE\u9304",
2835
+ \u5173\u95ED\u64AD\u653E\u5668: "\u95DC\u9589\u64AD\u653E\u5668",
2836
+ \u6682\u505C\u5E76\u5173\u95ED\u64AD\u653E\u5668: "\u66AB\u505C\u4E26\u95DC\u9589\u64AD\u653E\u5668",
2837
+ \u6682\u505C\u5E76\u5173\u95ED: "\u66AB\u505C\u4E26\u95DC\u9589",
2838
+ \u53F3\u4E0B\u89D2\u8FF7\u4F60\u64AD\u653E\u6761: "\u53F3\u4E0B\u89D2\u8FF7\u4F60\u64AD\u653E\u689D",
2839
+ \u64AD\u653E\u6216\u6682\u505C\u65F6: "\u64AD\u653E\u6216\u66AB\u505C\u6642",
2840
+ \u4EC5\u64AD\u653E\u65F6: "\u50C5\u64AD\u653E\u6642",
2841
+ "\u79BB\u5F00\u5DE5\u4F5C\u53F0\u540E\u53F3\u4E0B\u89D2\u60AC\u6D6E\u64AD\u653E\u6761\u7684\u663E\u793A\u65F6\u673A\uFF1B\u4E5F\u53EF\u968F\u65F6\u70B9\u6761\u4E0A\u7684 \xD7 \u5173\u95ED\u3002\u5BF9\u8BDD\u6D88\u606F\u7684\u5373\u65F6\u6717\u8BFB\u63D0\u793A\u4E0D\u53D7\u5F71\u54CD\u3002": "\u96E2\u958B\u5DE5\u4F5C\u53F0\u5F8C\u53F3\u4E0B\u89D2\u61F8\u6D6E\u64AD\u653E\u689D\u7684\u986F\u793A\u6642\u6A5F\uFF1B\u4E5F\u53EF\u96A8\u6642\u9EDE\u689D\u4E0A\u7684 \xD7 \u95DC\u9589\u3002\u5C0D\u8A71\u8A0A\u606F\u7684\u5373\u6642\u6717\u8B80\u63D0\u793A\u4E0D\u53D7\u5F71\u97FF\u3002"
2826
2842
  };
2827
2843
 
2828
2844
  // src/client/i18n/locale.mjs
@@ -4332,6 +4348,7 @@ var defaultSettings = {
4332
4348
  autoContinue: true,
4333
4349
  audioLimit: 2 * 1024 ** 3,
4334
4350
  chatDock: "auto",
4351
+ miniCapsule: "auto",
4335
4352
  snippetRetention: "7d",
4336
4353
  laivoxNarratorDefault: LAIVOX_DEFAULT_NARRATOR,
4337
4354
  // Voices for instant speech, by the language of the text.
@@ -6719,6 +6736,20 @@ function ChapterReview({ data, session, onUpdate, busy, setBusy, setReviewCanLea
6719
6736
  ] });
6720
6737
  }
6721
6738
 
6739
+ // src/client/library/shelfLayout.mjs
6740
+ var SHELF_SPLIT_WIDTH = 960;
6741
+ function shelfMode({ split, hasBooks, hasSelectedBook, detail }) {
6742
+ if (split) return hasBooks || hasSelectedBook ? "split" : "books";
6743
+ return detail && hasSelectedBook ? "detail" : "books";
6744
+ }
6745
+ function shouldLoadShelfChapters({ onShelf, mode, bookId }) {
6746
+ return Boolean(onShelf && bookId && (mode === "split" || mode === "detail"));
6747
+ }
6748
+ function nextShelfDetailOnResize({ wasSplit, isSplit, detail, batch, renaming }) {
6749
+ if (wasSplit && !isSplit) return Boolean(batch || renaming);
6750
+ return Boolean(detail);
6751
+ }
6752
+
6722
6753
  // src/client/library/LibraryView.jsx
6723
6754
  var import_jsx_runtime12 = require("react/jsx-runtime");
6724
6755
  function exportText(state) {
@@ -6899,6 +6930,11 @@ function LibraryView({
6899
6930
  chapters,
6900
6931
  selectedBook,
6901
6932
  active,
6933
+ mode = "books",
6934
+ split = false,
6935
+ openShelfDetail,
6936
+ closeShelfDetail,
6937
+ openBook,
6902
6938
  booksQuery,
6903
6939
  changeBooksQuery,
6904
6940
  chapterQuery,
@@ -6938,6 +6974,10 @@ function LibraryView({
6938
6974
  const contentsHeading = (0, import_react15.useRef)(null);
6939
6975
  const moveToContents = (0, import_react15.useRef)(false);
6940
6976
  const anchor = (0, import_react15.useRef)(null);
6977
+ const prevSplit = (0, import_react15.useRef)(split);
6978
+ const prevMode = (0, import_react15.useRef)(mode);
6979
+ const returnBookId = (0, import_react15.useRef)(null);
6980
+ const booksContainerRef = (0, import_react15.useRef)(null);
6941
6981
  const [renaming, setRenaming] = (0, import_react15.useState)(false);
6942
6982
  const [name2, setName] = (0, import_react15.useState)("");
6943
6983
  const book = selectedBook?.id;
@@ -6958,11 +6998,31 @@ function LibraryView({
6958
6998
  if (active) activeRef.current?.scrollIntoView({ block: "nearest" });
6959
6999
  }, [active, contents]);
6960
7000
  (0, import_react15.useEffect)(() => {
6961
- if (moveToContents.current) {
7001
+ if (moveToContents.current && (mode === "split" || mode === "detail")) {
6962
7002
  moveToContents.current = false;
6963
7003
  contentsHeading.current?.focus();
6964
7004
  }
6965
- }, [book]);
7005
+ }, [book, mode]);
7006
+ (0, import_react15.useEffect)(() => {
7007
+ const wasSplit = prevSplit.current;
7008
+ prevSplit.current = split;
7009
+ if (wasSplit === split) return;
7010
+ const keepDetail = nextShelfDetailOnResize({ wasSplit, isSplit: split, detail: mode === "detail", batch, renaming });
7011
+ if (wasSplit && !split) {
7012
+ if (keepDetail && book) openShelfDetail?.();
7013
+ else closeShelfDetail?.();
7014
+ }
7015
+ }, [split, mode, batch, renaming, book]);
7016
+ (0, import_react15.useEffect)(() => {
7017
+ const wasMode = prevMode.current;
7018
+ prevMode.current = mode;
7019
+ if (wasMode === "detail" && mode === "books" && returnBookId.current) {
7020
+ const targetId = returnBookId.current;
7021
+ returnBookId.current = null;
7022
+ const buttons = [...booksContainerRef.current?.querySelectorAll(":scope > button") ?? []];
7023
+ buttons.find((button) => button.dataset.bookId === targetId)?.focus();
7024
+ }
7025
+ }, [mode]);
6966
7026
  (0, import_react15.useEffect)(() => {
6967
7027
  anchor.current = null;
6968
7028
  }, [book, batch]);
@@ -6976,7 +7036,44 @@ function LibraryView({
6976
7036
  toggleChapter(row);
6977
7037
  anchor.current = index;
6978
7038
  }
6979
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("aside", { className: "lv-shelf", "aria-label": translate("\u4E66\u67B6"), children: [
7039
+ const bookActions = book && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-inline", children: [
7040
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled, onClick: append, children: translate("\u6DFB\u52A0\u7AE0\u8282") }),
7041
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled, "aria-pressed": batch, onClick: toggleBatch, children: batch ? translate("\u7ED3\u675F\u9009\u62E9") : translate("\u6279\u91CF\u9009\u62E9") }),
7042
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Popover, { label: translate("\u4E66\u7C4D\u64CD\u4F5C"), trigger: translate("\u4E66\u7C4D\u64CD\u4F5C"), placement: "bottom-end", children: (close) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-menu lv-book-menu", children: [
7043
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled: disabled || renaming, onClick: () => {
7044
+ close();
7045
+ setName(selectedBook.title);
7046
+ setRenaming(true);
7047
+ }, children: translate("\u91CD\u547D\u540D") }),
7048
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled, onClick: () => {
7049
+ close();
7050
+ clearAudio({ book });
7051
+ }, children: translate("\u6E05\u7406\u4E66\u4E2D\u97F3\u9891") }),
7052
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("hr", { className: "lv-menu-divider" }),
7053
+ ["mp3", "wav"].map((format) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7054
+ "button",
7055
+ {
7056
+ disabled: disabled || exportInfo?.state === "running",
7057
+ onClick: () => {
7058
+ close();
7059
+ exportBook(book, format, selectedBook.title);
7060
+ },
7061
+ children: translate("\u5BFC\u51FA\u6574\u672C \xB7 {format}", { format: format.toUpperCase() })
7062
+ },
7063
+ format
7064
+ )),
7065
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("hr", { className: "lv-menu-divider" }),
7066
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { className: "lv-destructive", disabled, onClick: () => {
7067
+ close();
7068
+ deleteBook(book, {
7069
+ title: selectedBook.title,
7070
+ chapters: selectedBook.chapters,
7071
+ audioBytes: selectedBook.audioBytes
7072
+ });
7073
+ }, children: translate("\u5220\u9664\u672C\u4E66") })
7074
+ ] }) })
7075
+ ] });
7076
+ const booksPane = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
6980
7077
  uploading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-inline", children: [
6981
7078
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { role: "status", children: translate("\u6B63\u5728\u6253\u5F00\u5BFC\u5165\u9884\u89C8\u2026") }),
6982
7079
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { onClick: cancelUpload, children: translate("\u53D6\u6D88") })
@@ -6997,19 +7094,28 @@ function LibraryView({
6997
7094
  ] }),
6998
7095
  !data && !books.error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { role: "status", children: translate("\u6B63\u5728\u8BFB\u53D6\u4E66\u67B6\u2026") }),
6999
7096
  data && !data.books.length && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "lv-muted", children: booksQuery ? translate("\u6CA1\u6709\u5339\u914D\u7684\u4E66\u7C4D\u3002") : translate("\u8FD8\u6CA1\u6709\u4E66\u7C4D\u3002\u53EF\u4EE5\u5BFC\u5165\u6587\u4EF6\uFF0C\u6216\u65B0\u5EFA\u4E66\u7C4D\u540E\u7C98\u8D34\u6B63\u6587\u3002") }),
7000
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lv-books", onKeyDown: (event) => {
7097
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: booksContainerRef, className: "lv-books", onKeyDown: (event) => {
7001
7098
  if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return;
7002
7099
  const buttons = [...event.currentTarget.querySelectorAll(":scope > button")];
7003
7100
  const index = buttons.indexOf(document.activeElement);
7004
7101
  if (index < 0) return;
7005
7102
  event.preventDefault();
7006
7103
  buttons[rovingIndex(event.key, index, buttons.length)]?.focus();
7007
- }, children: data?.books?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { "aria-pressed": book === item.id, disabled, onClick: () => {
7104
+ }, children: data?.books?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { "data-book-id": item.id, "aria-pressed": book === item.id, disabled, onClick: () => {
7105
+ if (mode !== "split") {
7106
+ returnBookId.current = item.id;
7107
+ moveToContents.current = true;
7108
+ selectShelfBook(item);
7109
+ openShelfDetail?.();
7110
+ return;
7111
+ }
7008
7112
  if (book === item.id) contentsHeading.current?.focus();
7009
7113
  else {
7010
7114
  moveToContents.current = true;
7011
7115
  selectShelfBook(item);
7012
7116
  }
7117
+ }, onDoubleClick: () => {
7118
+ if (mode === "split" && !disabled) void openBook?.(item.id);
7013
7119
  }, children: [
7014
7120
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { "aria-hidden": "true", className: "lv-book-cover", style: { "--lv-role-color": roleColor(item.id) }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "lv-book-title", children: item.title }) }),
7015
7121
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "lv-book-meta", children: [
@@ -7022,47 +7128,21 @@ function LibraryView({
7022
7128
  books.previous && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { onClick: books.previous, children: translate("\u4E0A\u9875\u4E66\u67B6") }),
7023
7129
  books.next && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { onClick: books.next, children: translate("\u66F4\u591A\u4E66\u7C4D") })
7024
7130
  ] }),
7025
- data?.space && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StorageUsage, { compact: true, space: data.space }),
7131
+ data?.space && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StorageUsage, { compact: true, space: data.space })
7132
+ ] });
7133
+ const chaptersPane = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
7134
+ mode === "detail" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-shelf-detail-bar", children: [
7135
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: "lv-subtle lv-shelf-back", onClick: closeShelfDetail, children: [
7136
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon2, { name: "ChevronLeft", size: 16 }),
7137
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: translate("\u8FD4\u56DE\u4E66\u67B6") })
7138
+ ] }),
7139
+ bookActions
7140
+ ] }),
7141
+ !book && mode === "split" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lv-shelf-empty-detail", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "lv-muted", children: translate("\u9009\u62E9\u4E00\u672C\u4E66\u67E5\u770B\u7AE0\u8282\u76EE\u5F55") }) }),
7026
7142
  book && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
7027
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-heading lv-contents-heading", children: [
7143
+ mode === "detail" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { ref: contentsHeading, tabIndex: -1, className: "lv-shelf-detail-heading", children: translate("\u300A{title}\u300B\u7684\u7AE0\u8282\u76EE\u5F55", { title: selectedBook.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-heading lv-contents-heading", children: [
7028
7144
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { ref: contentsHeading, tabIndex: -1, children: translate("\u300A{title}\u300B\u7684\u7AE0\u8282\u76EE\u5F55", { title: selectedBook.title }) }),
7029
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-inline", children: [
7030
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled, onClick: append, children: translate("\u6DFB\u52A0\u7AE0\u8282") }),
7031
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled, "aria-pressed": batch, onClick: toggleBatch, children: batch ? translate("\u7ED3\u675F\u9009\u62E9") : translate("\u6279\u91CF\u9009\u62E9") }),
7032
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Popover, { label: translate("\u4E66\u7C4D\u64CD\u4F5C"), trigger: translate("\u4E66\u7C4D\u64CD\u4F5C"), placement: "bottom-end", children: (close) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lv-menu lv-book-menu", children: [
7033
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled: disabled || renaming, onClick: () => {
7034
- close();
7035
- setName(selectedBook.title);
7036
- setRenaming(true);
7037
- }, children: translate("\u91CD\u547D\u540D") }),
7038
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { disabled, onClick: () => {
7039
- close();
7040
- clearAudio({ book });
7041
- }, children: translate("\u6E05\u7406\u4E66\u4E2D\u97F3\u9891") }),
7042
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("hr", { className: "lv-menu-divider" }),
7043
- ["mp3", "wav"].map((format) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7044
- "button",
7045
- {
7046
- disabled: disabled || exportInfo?.state === "running",
7047
- onClick: () => {
7048
- close();
7049
- exportBook(book, format, selectedBook.title);
7050
- },
7051
- children: translate("\u5BFC\u51FA\u6574\u672C \xB7 {format}", { format: format.toUpperCase() })
7052
- },
7053
- format
7054
- )),
7055
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("hr", { className: "lv-menu-divider" }),
7056
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { className: "lv-destructive", disabled, onClick: () => {
7057
- close();
7058
- deleteBook(book, {
7059
- title: selectedBook.title,
7060
- chapters: selectedBook.chapters,
7061
- audioBytes: selectedBook.audioBytes
7062
- });
7063
- }, children: translate("\u5220\u9664\u672C\u4E66") })
7064
- ] }) })
7065
- ] })
7145
+ bookActions
7066
7146
  ] }),
7067
7147
  renaming && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("form", { className: "lv-rename", onSubmit: (event) => {
7068
7148
  event.preventDefault();
@@ -7150,7 +7230,10 @@ function LibraryView({
7150
7230
  }
7151
7231
  ),
7152
7232
  state && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { className: "lv-chapter-state " + state[1], title: state[0], children: state[0] }),
7153
- !batch && chapter.hasAudio && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "lv-subtle lv-chapter-listen", "aria-label": translate("\u6536\u542C") + " \xB7 " + chapter.title, onClick: () => listenChapter?.(chapter.id), children: translate("\u6536\u542C") })
7233
+ !batch && Boolean(chapter.hasAudio) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: "lv-chapter-listen", "aria-label": translate("\u6536\u542C") + " \xB7 " + chapter.title, onClick: () => listenChapter?.(chapter.id), children: [
7234
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon2, { name: "Play", size: 13 }),
7235
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: translate("\u6536\u542C") })
7236
+ ] })
7154
7237
  ]
7155
7238
  },
7156
7239
  chapter.id
@@ -7162,21 +7245,28 @@ function LibraryView({
7162
7245
  ] })
7163
7246
  ] })
7164
7247
  ] });
7248
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("aside", { className: "lv-shelf" + (mode === "split" ? " lv-shelf-split" : ""), "aria-label": translate("\u4E66\u67B6"), children: mode === "split" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
7249
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lv-shelf-books-pane", children: booksPane }),
7250
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lv-shelf-chapters-pane", children: chaptersPane })
7251
+ ] }) : mode === "detail" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lv-shelf-chapters-pane", children: chaptersPane }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lv-shelf-books-pane", children: booksPane }) });
7165
7252
  }
7166
7253
 
7167
7254
  // src/client/library/LibraryScene.jsx
7168
7255
  var import_react16 = __toESM(require("react"), 1);
7169
7256
  var import_jsx_runtime13 = require("react/jsx-runtime");
7170
- function LibraryScene({ children, create, creatingDisabled, importFile, uploading, tab = "books", setTab }) {
7171
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "lv-library-scene", children: [
7172
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: "lv-heading", children: [
7173
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h1", { children: translate("\u6211\u7684\u4E66\u67B6") }),
7174
- tab === "books" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "lv-inline", children: [
7175
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { className: "lv-primary", onClick: importFile, disabled: uploading, children: translate("\u5BFC\u5165 TXT / EPUB / PDF") }),
7176
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { onClick: create, disabled: creatingDisabled, children: translate("\u65B0\u5EFA\u4E66\u7C4D") })
7177
- ] })
7257
+ function LibraryScene({ children, create, creatingDisabled, importFile, uploading, tab = "books", setTab, compactHeader = false, split = false }) {
7258
+ const classes = "lv-library-scene" + (split ? " lv-library-split" : "") + (compactHeader ? " lv-library-detail" : "");
7259
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: classes, children: [
7260
+ !compactHeader && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7261
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: "lv-heading", children: [
7262
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h1", { children: translate("\u6211\u7684\u4E66\u67B6") }),
7263
+ tab === "books" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "lv-inline", children: [
7264
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { className: "lv-primary", onClick: importFile, disabled: uploading, children: translate("\u5BFC\u5165 TXT / EPUB / PDF") }),
7265
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { onClick: create, disabled: creatingDisabled, children: translate("\u65B0\u5EFA\u4E66\u7C4D") })
7266
+ ] })
7267
+ ] }),
7268
+ setTab && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "lv-segmented lv-library-tabs", role: "group", "aria-label": translate("\u4E66\u67B6\u5185\u5BB9"), children: [["books", translate("\u4E66\u7C4D")], ["snippets", translate("\u5BF9\u8BDD\u7247\u6BB5")]].map(([value, label]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", "aria-pressed": tab === value, onClick: () => setTab(value), children: label }, value)) })
7178
7269
  ] }),
7179
- setTab && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "lv-segmented lv-library-tabs", role: "group", "aria-label": translate("\u4E66\u67B6\u5185\u5BB9"), children: [["books", translate("\u4E66\u7C4D")], ["snippets", translate("\u5BF9\u8BDD\u7247\u6BB5")]].map(([value, label]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", "aria-pressed": tab === value, onClick: () => setTab(value), children: label }, value)) }),
7180
7270
  children
7181
7271
  ] });
7182
7272
  }
@@ -8328,12 +8418,19 @@ function Listening({ values, save: save2 }) {
8328
8418
  }
8329
8419
  function Conversation({ values, save: save2 }) {
8330
8420
  const value = values.chatDock ?? "auto";
8421
+ const capsuleValue = values.miniCapsule ?? "auto";
8331
8422
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { className: "lv-card", children: [
8332
8423
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { children: translate("\u5BF9\u8BDD\u5DE5\u4F5C\u6761") }),
8424
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "lv-field-label", children: translate("\u8F93\u5165\u6846\u4E0A\u65B9\u7684 LaiVox \u680F") }),
8333
8425
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "lv-segmented", role: "group", "aria-label": translate("\u8F93\u5165\u6846\u4E0A\u65B9\u7684 LaiVox \u680F"), children: [["auto", translate("\u81EA\u52A8")], ["active", translate("\u53EA\u5728\u5F85\u786E\u8BA4\u6216\u5236\u4F5C\u4E2D")], ["never", translate("\u4E0D\u663E\u793A")]].map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", "aria-pressed": value === key, onClick: () => {
8334
8426
  if (value !== key) void save2({ chatDock: key });
8335
8427
  }, children: label }, key)) }),
8336
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: translate("\u63A7\u5236\u8F93\u5165\u6846\u4E0A\u65B9\u7684 LaiVox \u680F\u4F55\u65F6\u663E\u793A\u3002\u300C\u81EA\u52A8\u300D\u65F6\u4E5F\u4F1A\u663E\u793A\u300C\u7EE7\u7EED\u542C\u300D\uFF1B\u5F85\u786E\u8BA4\u7684\u6717\u8BFB\u4EFB\u52A1\u548C\u5BFC\u5165\u59CB\u7EC8\u663E\u793A\u5728\u56DE\u7B54\u4E0B\u65B9\u3002") })
8428
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: translate("\u63A7\u5236\u8F93\u5165\u6846\u4E0A\u65B9\u7684 LaiVox \u680F\u4F55\u65F6\u663E\u793A\u3002\u300C\u81EA\u52A8\u300D\u65F6\u4E5F\u4F1A\u663E\u793A\u300C\u7EE7\u7EED\u542C\u300D\uFF1B\u5F85\u786E\u8BA4\u7684\u6717\u8BFB\u4EFB\u52A1\u548C\u5BFC\u5165\u59CB\u7EC8\u663E\u793A\u5728\u56DE\u7B54\u4E0B\u65B9\u3002") }),
8429
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "lv-field-label", children: translate("\u53F3\u4E0B\u89D2\u8FF7\u4F60\u64AD\u653E\u6761") }),
8430
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "lv-segmented", role: "group", "aria-label": translate("\u53F3\u4E0B\u89D2\u8FF7\u4F60\u64AD\u653E\u6761"), children: [["auto", translate("\u64AD\u653E\u6216\u6682\u505C\u65F6")], ["playing", translate("\u4EC5\u64AD\u653E\u65F6")], ["never", translate("\u4E0D\u663E\u793A")]].map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", "aria-pressed": capsuleValue === key, onClick: () => {
8431
+ if (capsuleValue !== key) void save2({ miniCapsule: key });
8432
+ }, children: label }, key)) }),
8433
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: translate("\u79BB\u5F00\u5DE5\u4F5C\u53F0\u540E\u53F3\u4E0B\u89D2\u60AC\u6D6E\u64AD\u653E\u6761\u7684\u663E\u793A\u65F6\u673A\uFF1B\u4E5F\u53EF\u968F\u65F6\u70B9\u6761\u4E0A\u7684 \xD7 \u5173\u95ED\u3002\u5BF9\u8BDD\u6D88\u606F\u7684\u5373\u65F6\u6717\u8BFB\u63D0\u793A\u4E0D\u53D7\u5F71\u54CD\u3002") })
8337
8434
  ] });
8338
8435
  }
8339
8436
  var SPEECH_LANGUAGES = [["zh-CN", "\u7B80\u4F53\u4E2D\u6587", "zh-CN-"], ["zh-TW", "\u7E41\u4F53\u4E2D\u6587", "zh-TW-"], ["en", "\u82F1\u6587", "en-"]];
@@ -12765,6 +12862,7 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
12765
12862
  const [chapterQuery, setChapterQuery] = (0, import_react46.useState)("");
12766
12863
  const [shelfQuery, setShelfQuery] = (0, import_react46.useState)("");
12767
12864
  const [shelfPick, setShelfPick] = (0, import_react46.useState)(null);
12865
+ const [shelfDetail, setShelfDetail] = (0, import_react46.useState)(false);
12768
12866
  const [batch, setBatch] = (0, import_react46.useState)(false);
12769
12867
  const selectingAll = (0, import_react46.useRef)(null);
12770
12868
  const [theme, setTheme] = (0, import_react46.useState)(null);
@@ -12774,9 +12872,12 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
12774
12872
  const shelfBookId = shelfPick?.id ?? (!chapter?.isSnippet ? chapter?.book : null);
12775
12873
  const shelfBook = books.value?.books?.find((item) => item.id === shelfBookId) ?? shelfPick ?? (shelfBookId ? { id: shelfBookId, title: chapter.bookTitle } : null);
12776
12874
  const onShelf = scene.scene === "library" && scene.libraryTab === "books" && page !== "import";
12875
+ const shelfSplit = width >= SHELF_SPLIT_WIDTH;
12876
+ const hasShelfBooks = (books.value?.books?.length ?? 0) > 0;
12877
+ const viewShelfMode = shelfMode({ split: shelfSplit, hasBooks: hasShelfBooks, hasSelectedBook: Boolean(shelfBook), detail: shelfDetail });
12777
12878
  const shelfChapters = useResults(
12778
12879
  "library/chapters",
12779
- onShelf ? shelfBookId || false : false,
12880
+ shouldLoadShelfChapters({ onShelf, mode: viewShelfMode, bookId: shelfBookId }) ? shelfBookId : false,
12780
12881
  80,
12781
12882
  shelfQuery || shelfBookId !== chapter?.book ? 0 : Math.floor(((chapter?.ordinal ?? 1) - 1) / 80) * 80,
12782
12883
  w.shelfVersion,
@@ -12898,8 +12999,27 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
12898
12999
  w.errors(error);
12899
13000
  }
12900
13001
  }
13002
+ function exitShelfDetail() {
13003
+ setShelfDetail(false);
13004
+ if (batch) {
13005
+ selectingAll.current?.abort();
13006
+ w.clearSelection();
13007
+ setBatch(false);
13008
+ }
13009
+ }
13010
+ function chooseScene(value) {
13011
+ if (value === "library") exitShelfDetail();
13012
+ scene.setScene(value);
13013
+ }
13014
+ function selectLibraryTab(value) {
13015
+ if (value !== "books") exitShelfDetail();
13016
+ scene.setLibraryTab(value);
13017
+ }
12901
13018
  async function cancelCreation() {
13019
+ const appending = Boolean(w.appendBook);
12902
13020
  if (!await w.cancelCreation()) return;
13021
+ if (appending) setShelfDetail(true);
13022
+ else exitShelfDetail();
12903
13023
  scene.setLibraryTab("books");
12904
13024
  scene.setScene("library");
12905
13025
  }
@@ -12907,7 +13027,9 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
12907
13027
  setBooksQuery("");
12908
13028
  books.first();
12909
13029
  setShelfPick(book);
13030
+ setShelfDetail(true);
12910
13031
  scene.setLibraryTab("books");
13032
+ scene.setScene("library");
12911
13033
  }
12912
13034
  async function nav(target) {
12913
13035
  if (await w.navigate(target)) {
@@ -13002,6 +13124,11 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13002
13124
  chapters: shelfChapters,
13003
13125
  selectedBook: shelfBook,
13004
13126
  active: chapter?.id,
13127
+ mode: viewShelfMode,
13128
+ split: shelfSplit,
13129
+ openShelfDetail: () => setShelfDetail(true),
13130
+ closeShelfDetail: exitShelfDetail,
13131
+ openBook: (id) => nav({ book: id }),
13005
13132
  booksQuery,
13006
13133
  changeBooksQuery: setBooksQuery,
13007
13134
  chapterQuery: shelfQuery,
@@ -13053,7 +13180,10 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13053
13180
  return saved;
13054
13181
  },
13055
13182
  deleteBook: async (id, meta) => {
13056
- if (await w.deleteBook(id, meta)) setShelfPick((current) => current?.id === id ? null : current);
13183
+ if (await w.deleteBook(id, meta)) {
13184
+ setShelfPick((current) => current?.id === id ? null : current);
13185
+ if (shelfBookId === id) exitShelfDetail();
13186
+ }
13057
13187
  }
13058
13188
  }
13059
13189
  );
@@ -13079,6 +13209,11 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13079
13209
  else closePanel();
13080
13210
  return;
13081
13211
  }
13212
+ if (event.key === "Escape" && onShelf && viewShelfMode === "detail" && !event.target.closest("input,textarea,select")) {
13213
+ event.preventDefault();
13214
+ exitShelfDetail();
13215
+ return;
13216
+ }
13082
13217
  if (event.target.closest("button,a,[role=tab],[role=listbox]")) return;
13083
13218
  const action = shortcutAction(event);
13084
13219
  if (!action) return;
@@ -13121,7 +13256,7 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13121
13256
  event.target.value = "";
13122
13257
  if (file) void openImport((signal) => upload(file, signal));
13123
13258
  } }),
13124
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TopBar, { chapter, draftBookTitle: w.appendBook?.title, books: books.value?.books, openBook: (id) => nav({ book: id }), scene: scene.scene, setScene: scene.setScene, tasks: inProgress, openQueue: () => openQueue(), openSettings: () => scene.openSheet("settings"), openRail: () => setShelfOpen(true) }),
13259
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TopBar, { chapter, draftBookTitle: w.appendBook?.title, books: books.value?.books, openBook: (id) => nav({ book: id }), scene: scene.scene, setScene: chooseScene, tasks: inProgress, openQueue: () => openQueue(), openSettings: () => scene.openSheet("settings"), openRail: () => setShelfOpen(true) }),
13125
13260
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "lv-shell-body", children: [
13126
13261
  width >= 1024 && scene.scene !== "library" && (chapter || w.booting) && rail,
13127
13262
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "lv-scene-room", children: [
@@ -13130,7 +13265,7 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13130
13265
  w.memory.activeId && !w.creationSaved && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { onClick: () => w.reloadChapter().then(w.clearError).catch(w.errors), children: translate("\u91CD\u65B0\u52A0\u8F7D") })
13131
13266
  ] }),
13132
13267
  blockedActions(),
13133
- scene.scene === "listen" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StageScene, { w, player, immersive: scene.immersive, setImmersive: scene.setImmersive, navigate: (id) => nav({ chapter: id }), listenFrom: w.listenFrom, create: () => nav({ new: true }), openImport: () => fileInput.current.click(), books: books.value?.books, openBook: (id) => nav({ book: id }), openLibrary: () => scene.setScene("library") }),
13268
+ scene.scene === "listen" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StageScene, { w, player, immersive: scene.immersive, setImmersive: scene.setImmersive, navigate: (id) => nav({ chapter: id }), listenFrom: w.listenFrom, create: () => nav({ new: true }), openImport: () => fileInput.current.click(), books: books.value?.books, openBook: (id) => nav({ book: id }), openLibrary: () => chooseScene("library") }),
13134
13269
  scene.scene === "studio" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StudioScene, { w, player, tab: scene.studioTab, change: scene.setStudioTab, roleData, staleScript, saveCreation, cancelCreation, openQueue: () => openQueue({ chapter: chapter?.id }) }),
13135
13270
  scene.scene === "library" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
13136
13271
  LibraryScene,
@@ -13140,7 +13275,9 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13140
13275
  importFile: () => fileInput.current.click(),
13141
13276
  uploading,
13142
13277
  tab: page === "import" && w.importEntry ? "books" : scene.libraryTab,
13143
- setTab: page === "import" && w.importEntry ? null : scene.setLibraryTab,
13278
+ setTab: page === "import" && w.importEntry ? null : selectLibraryTab,
13279
+ compactHeader: scene.libraryTab === "books" && !(page === "import" && w.importEntry) && viewShelfMode === "detail",
13280
+ split: scene.libraryTab === "books" && !(page === "import" && w.importEntry) && viewShelfMode === "split",
13144
13281
  children: scene.libraryTab === "snippets" && !(page === "import" && w.importEntry) ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
13145
13282
  SnippetsView,
13146
13283
  {
@@ -13170,7 +13307,7 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13170
13307
  rail,
13171
13308
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { onClick: () => {
13172
13309
  setShelfOpen(false);
13173
- scene.setScene("library");
13310
+ chooseScene("library");
13174
13311
  }, children: translate("\u6253\u5F00\u4E66\u67B6") })
13175
13312
  ] }),
13176
13313
  scene.sheet === "queue" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Sheet, { title: translate("\u4EFB\u52A1"), close: closePanel, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
@@ -13202,10 +13339,59 @@ function Shell({ player, navigation, memory, isPanelActive, useSessions }) {
13202
13339
 
13203
13340
  // src/client/player/MiniCapsule.jsx
13204
13341
  var import_react47 = __toESM(require("react"), 1);
13342
+
13343
+ // src/client/player/capsuleState.mjs
13344
+ function shouldShowNovelCapsule({ phase, job, segments, resume, notice, dismissed, mode = "auto" }) {
13345
+ if (mode === "never" || !job || !segments?.length || dismissed) return false;
13346
+ if (mode === "playing") return phase === "playing" || phase === "buffering" || Boolean(notice);
13347
+ if (notice || resume) return true;
13348
+ return phase !== "idle";
13349
+ }
13350
+ function createCapsuleState({ noticeMs = 6e3 } = {}) {
13351
+ let state = { notice: null, dismissed: false };
13352
+ let timer = null;
13353
+ const listeners3 = /* @__PURE__ */ new Set();
13354
+ function emit(next) {
13355
+ if (next.notice === state.notice && next.dismissed === state.dismissed) return;
13356
+ state = next;
13357
+ for (const listener of listeners3) listener();
13358
+ }
13359
+ return {
13360
+ subscribe(listener) {
13361
+ listeners3.add(listener);
13362
+ return () => listeners3.delete(listener);
13363
+ },
13364
+ getSnapshot: () => state,
13365
+ show(message) {
13366
+ clearTimeout(timer);
13367
+ emit({ notice: message, dismissed: false });
13368
+ timer = setTimeout(() => {
13369
+ timer = null;
13370
+ emit({ ...state, notice: null });
13371
+ }, noticeMs);
13372
+ timer.unref?.();
13373
+ },
13374
+ dismiss() {
13375
+ clearTimeout(timer);
13376
+ timer = null;
13377
+ emit({ notice: null, dismissed: true });
13378
+ },
13379
+ wake() {
13380
+ if (state.dismissed) emit({ ...state, dismissed: false });
13381
+ },
13382
+ dispose() {
13383
+ clearTimeout(timer);
13384
+ timer = null;
13385
+ listeners3.clear();
13386
+ }
13387
+ };
13388
+ }
13389
+
13390
+ // src/client/player/MiniCapsule.jsx
13205
13391
  var import_jsx_runtime40 = require("react/jsx-runtime");
13206
13392
  var quietSpeech = { subscribe: () => () => {
13207
13393
  }, getSnapshot: () => null };
13208
- function MiniCapsule({ player, open, notice, speech }) {
13394
+ function MiniCapsule({ player, open, notice, dismissed = false, dismiss, mode = "auto", speech }) {
13209
13395
  const s = (0, import_react47.useSyncExternalStore)(player.subscribe, player.getSnapshot);
13210
13396
  const voice = (0, import_react47.useSyncExternalStore)((speech ?? quietSpeech).subscribe, (speech ?? quietSpeech).getSnapshot);
13211
13397
  if (voice && ["loading", "playing", "blocked", "error"].includes(voice.phase)) {
@@ -13216,17 +13402,32 @@ function MiniCapsule({ player, open, notice, speech }) {
13216
13402
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { className: "lv-hbtn", onClick: () => speech.stop(), children: voice.phase === "error" ? translate("\u5173\u95ED") : translate("\u505C\u6B62") })
13217
13403
  ] });
13218
13404
  }
13219
- if (!s.job || !s.segments.length) return null;
13220
13405
  const part = s.segments[s.n];
13221
13406
  const playing = ["playing", "buffering"].includes(s.phase);
13222
13407
  const resume = !playing && voice?.resume?.chapter === s.chapter ? voice.resume : null;
13408
+ if (!shouldShowNovelCapsule({ phase: s.phase, job: s.job, segments: s.segments, resume, notice, dismissed, mode })) return null;
13223
13409
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { className: "lv-mini-capsule", "aria-label": translate("\u5C0F\u8BF4\u64AD\u653E\u5668"), children: [
13224
13410
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { className: "lv-hplay", disabled: s.settled && !s.segments.some((row) => row.ready) || s.phase === "blocked", "aria-label": playing ? translate("\u6682\u505C\u64AD\u653E") : translate("\u64AD\u653E"), onClick: () => {
13225
13411
  if (resume) speech.resumeNovel();
13226
13412
  else player.toggle();
13227
13413
  }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon2, { name: playing ? "Pause" : "Play", size: 14 }) }),
13228
13414
  notice ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { role: "status", children: displayText(notice) }) : resume ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { role: "status", children: translate("\u6717\u8BFB\u5DF2\u7ED3\u675F \xB7 \u7EE7\u7EED\u542C") }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: [...part?.text ?? s.title].slice(0, 18).join("") }),
13229
- resume ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { className: "lv-hbtn", onClick: () => speech.resumeNovel(), children: translate("\u7EE7\u7EED\u542C") }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { className: "lv-hbtn", onClick: () => open(s.chapter, s.job), children: translate("\u56DE\u5230\u5C0F\u8BF4") })
13415
+ resume ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { className: "lv-hbtn", onClick: () => speech.resumeNovel(), children: translate("\u7EE7\u7EED\u542C") }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { className: "lv-hbtn", onClick: () => open(s.chapter, s.job), children: translate("\u56DE\u5230\u5C0F\u8BF4") }),
13416
+ dismiss && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
13417
+ "button",
13418
+ {
13419
+ type: "button",
13420
+ className: "lv-hbtn lv-hclose lv-hicon",
13421
+ "aria-label": playing ? translate("\u6682\u505C\u5E76\u5173\u95ED\u64AD\u653E\u5668") : translate("\u5173\u95ED\u64AD\u653E\u5668"),
13422
+ title: playing ? translate("\u6682\u505C\u5E76\u5173\u95ED") : translate("\u5173\u95ED"),
13423
+ onClick: () => {
13424
+ if (playing) player.pause();
13425
+ if (resume) speech?.dismissResume?.();
13426
+ dismiss();
13427
+ },
13428
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon2, { name: "X", size: 14 })
13429
+ }
13430
+ )
13230
13431
  ] });
13231
13432
  }
13232
13433
 
@@ -14628,7 +14829,7 @@ function OutcomeLine({ job, open, listen, player, manage }) {
14628
14829
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "lv-hgrow", children: [
14629
14830
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "lv-hmeta", children: [
14630
14831
  status,
14631
- job.isSnippet && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
14832
+ Boolean(job.isSnippet) && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
14632
14833
  " \xB7 ",
14633
14834
  manage ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { className: "lv-hlink", title: translate("\u5728\u5BF9\u8BDD\u7247\u6BB5\u4E2D\u7BA1\u7406"), onClick: manage, children: translate("\u5BF9\u8BDD\u7247\u6BB5") }) : translate("\u5BF9\u8BDD\u7247\u6BB5")
14634
14835
  ] })
@@ -15589,8 +15790,8 @@ var base_default = `.lv-ui *, .lv-ui *::before, .lv-ui *::after { box-sizing: bo
15589
15790
  background: var(--lv-surface-2); color: var(--lv-accent); font: normal 650 .94rem var(--lv-serif);\r
15590
15791
  border-left: 2px solid var(--lv-accent);\r
15591
15792
  }\r
15592
- .lv-ui .lv-contents > div { display: flex; align-items: center; gap: .25rem; min-width: 0; }\r
15593
- .lv-ui .lv-contents button { flex: 1; min-width: 0; }\r
15793
+ .lv-ui .lv-contents > div { display: flex; align-items: center; gap: .5rem; min-width: 0; }\r
15794
+ .lv-ui .lv-contents button.lv-link { flex: 1; min-width: 0; }\r
15594
15795
  .lv-ui .lv-ordinal { color: var(--lv-ink-mute); padding-left: .32rem; font-size: .72rem; font-variant-numeric: tabular-nums; }\r
15595
15796
  .lv-ui .lv-active { background: var(--lv-surface-2); border-radius: 9px; }\r
15596
15797
  .lv-ui .lv-active button { font-weight: 650; }\r
@@ -15861,7 +16062,7 @@ var stage_default = `\r
15861
16062
  var studio_default = '\r\n.lv-studio { max-width:1200px; margin:auto; padding:28px 36px 90px; }\r\n.lv-pipeline { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:24px 0; border:1px solid var(--lv-line); border-radius:var(--lv-r-l); overflow:hidden; background:var(--lv-bg); }\r\n.lv-ui .lv-pipeline button { padding:16px; border:0; border-right:1px solid var(--lv-line); border-radius:0; text-align:left; background:transparent; display:grid; grid-template-columns:24px 1fr; gap:5px; }\r\n.lv-pipeline button small {grid-column:1/-1;line-height:1.6;}\r\n.lv-ui .lv-pipeline button[aria-current=step] {background:var(--lv-elevated);box-shadow:inset 0 -2px var(--lv-ink);}\r\n.lv-pipeline-number {font-family:var(--lv-mono);color:var(--lv-ink-dim);}\r\n.lv-text-step { display:grid; gap:18px; }\r\n.lv-text-step textarea { font:var(--lv-prose); min-height:280px; }\r\n.lv-create-chapter { margin-top:24px; max-width:760px; }\r\n.lv-create-chapter label { display:grid; gap:6px; }\r\n.lv-create-chapter textarea { min-height:200px; }\r\n.lv-script { display:block; margin-top:20px; }\r\n.lv-script article { padding:18px 12px; border:0; border-bottom:1px solid var(--lv-line); border-radius:0; background:transparent; }\r\n.lv-script article[data-dialogue=true] {border-left:2px solid var(--lv-role-color);}\r\n.lv-script article p { font:var(--lv-prose); margin:12px 0 6px; }\r\n.lv-ui .lv-direction { border:0; background:none; color:var(--lv-ink-mute); padding:0; text-align:left; margin-right:12px; }\r\n.lv-row-editor { display:grid; gap:14px; padding:18px; background:var(--lv-bg); border:1px solid var(--lv-line-strong); border-radius:var(--lv-r-l); margin-top:16px; }\r\n.lv-script-filters { display:grid; gap:12px; margin-top:18px; }\r\n.lv-studio .lv-role-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}\r\n.lv-studio .lv-role-card {display:flex;align-items:start;gap:12px;flex-wrap:wrap;padding:20px;background:var(--lv-bg);border-radius:var(--lv-r-l);}\r\n.lv-role-card .lv-inline {width:100%;}\r\n.lv-save-bar {position:absolute;z-index:4;bottom:112px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:14px;padding:12px 18px;background:var(--lv-ink);color:var(--lv-surface);border-radius:var(--lv-r-l);box-shadow:var(--lv-shadow);max-width:calc(100% - 24px);}\r\n.lv-ui .lv-save-bar button {color:var(--lv-surface);background:transparent;}\r\n.lv-ui .lv-save-bar .lv-save-action {color:var(--lv-on-accent);background:var(--lv-accent);}\r\n@container (min-width:1180px) {.lv-studio .lv-role-grid {grid-template-columns:repeat(3,minmax(0,1fr));}}\r\n@container (max-width:759px) {.lv-studio {padding:20px 16px 110px;}.lv-pipeline {grid-template-columns:repeat(2,minmax(0,1fr));}.lv-studio .lv-role-grid {grid-template-columns:1fr;}.lv-save-bar {gap:8px;padding:10px;font-size:12px;width:max-content;}.lv-row-editor {padding:12px;}}\r\n\r\n.lv-ui .lv-script article {display:block;position:relative;padding:18px 12px;}\r\n.lv-ui .lv-script-preview {display:inline-grid;place-items:center;width:32px;height:32px;padding:0;border-radius:50%;}\r\n.lv-removed-lines del {color:var(--lv-ink-dim);}\r\n.lv-pipeline-badge {grid-column:1/-1;font-size:11px;border:1px solid var(--lv-line-strong);border-radius:var(--lv-r-s);padding:2px 5px;justify-self:start;}\r\n.lv-pipeline-badge[data-dirty=true] {color:var(--lv-accent);border-color:var(--lv-accent);}\r\n\r\n.lv-studio .lv-production { margin-top:16px; }\r\n.lv-studio-hint { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px; padding:10px 14px; border:1px dashed var(--lv-line-strong); border-radius:var(--lv-r-m); color:var(--lv-ink-dim); font-size:13px; }\r\n.lv-row-editor { display:grid; gap:12px; }\r\n.lv-row-directions { display:grid; gap:8px; }\r\n.lv-ui .lv-direction-chip { display:inline-flex; align-items:center; gap:6px; }\r\n.lv-strength { display:inline-flex; gap:2px; }\r\n.lv-strength::before, .lv-strength::after { content:""; width:4px; height:4px; border-radius:50%; background:currentColor; opacity:.7; }\r\n.lv-strength[data-level="1"]::after { display:none; }\r\n.lv-row-custom { display:flex; align-items:end; gap:8px; }\r\n.lv-row-custom label { flex:1; display:grid; gap:.35rem; }\r\n.lv-row-custom .lv-tooltip-anchor { width:auto; height:auto; flex:none; }\r\n.lv-help { display:inline-grid; place-items:center; width:20px; height:20px; border-radius:50%; border:1px solid var(--lv-line-strong); color:var(--lv-ink-mute); font-size:11px; cursor:help; margin-bottom:8px; }\r\n.lv-row-engine-hint { color:var(--lv-ink-mute); font-size:12px; }\r\n';
15862
16063
 
15863
16064
  // src/client/styles/library.css
15864
- var library_default = "\r\n.lv-library-scene {padding:28px 36px;max-width:1400px;margin:auto;}\r\n.lv-library-scene .lv-shelf {display:block;overflow:visible;padding:24px 0;border:0;background:transparent;width:auto;}\r\n.lv-library-scene .lv-books {display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:18px;margin:20px 0;}\r\n.lv-library-scene .lv-books button {display:flex;flex-direction:column;gap:14px;align-items:stretch;border:1px solid var(--lv-line);padding:14px;background:var(--lv-bg);}\r\n.lv-library-scene .lv-books button[aria-pressed=true] {border-color:var(--lv-accent);background:var(--lv-surface-2);}\r\n.lv-library-scene .lv-book-cover {height:135px;width:100%;border-radius:var(--lv-r-s);display:grid;place-items:center;background:var(--lv-surface-2);font:var(--lv-title);font-size:44px;color:var(--lv-ink);border:0;}\r\n.lv-library-scene .lv-contents>div {padding:12px;border-bottom:1px solid var(--lv-line);}\r\n.lv-library-scene .lv-contents-heading {margin-top:26px;}\r\n@container (max-width:759px) {.lv-library-scene {padding:20px 16px;}.lv-library-scene .lv-books {grid-template-columns:repeat(2,minmax(0,1fr));}.lv-library-scene .lv-book-cover {height:100px;}}\r\n\r\n.lv-library-scene .lv-book-cover {position:relative;}\r\n.lv-book-cover .lv-role-dot {position:absolute;bottom:10px;left:10px;}\r\n\r\n.lv-library-scene {padding-bottom:48px;}\r\n.lv-import-banner {display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 14px;margin:4px 0 16px;border-radius:var(--lv-r-m);background:var(--lv-surface-2);font-size:13px;color:var(--lv-ink-dim);}\r\n.lv-import-banner span {margin-right:auto;}\r\n\r\n/* \u300C\u4E66\u67B6 / \u5BF9\u8BDD\u97F3\u9891\u300Dtabs and the conversation audio list. */\r\n.lv-library-scene .lv-library-tabs {margin:14px 0 4px;}\r\n.lv-snippets {display:flex;flex-direction:column;gap:14px;padding:18px 0;}\r\n.lv-snippets-summary {display:flex;align-items:center;gap:12px;flex-wrap:wrap;color:var(--lv-ink-dim);font-size:13px;}\r\n.lv-snippets-summary > span {margin-right:auto;min-width:0;}\r\n.lv-ui .lv-snippets-summary .lv-link {display:inline;min-height:0;padding:0;border:0;background:none;color:var(--lv-ink);text-decoration:underline;text-underline-offset:2px;}\r\n.lv-snippets-saved {padding:10px 14px;border-radius:var(--lv-r-m);background:var(--lv-surface-2);}\r\n.lv-snippets-edit {display:flex;flex-wrap:wrap;align-items:end;gap:8px;}\r\n.lv-snippets-edit label {display:flex;flex-direction:column;gap:4px;flex:1 1 14rem;min-width:0;}\r\n.lv-snippets-edit small {flex-basis:100%;}\r\n.lv-snippet-group h3 {margin:6px 0;font-size:13px;color:var(--lv-ink-mute);font-weight:600;}\r\n.lv-snippet {display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--lv-line);}\r\n.lv-snippet-main {display:flex;flex-direction:column;gap:2px;flex:1 1 16rem;min-width:0;}\r\n.lv-snippet-main strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}\r\n.lv-snippet-actions {flex-wrap:nowrap;}\r\n.lv-ui .lv-field-label {font-size:13px;color:var(--lv-ink-dim);}\r\n.lv-batch-config {color:var(--lv-ink-mute);font-size:12px;}\r\n";
16065
+ var library_default = "\r\n.lv-library-scene {padding:24px 32px 44px;max-width:1400px;margin:auto;}\r\n.lv-library-scene.lv-library-detail {padding-top:16px;}\r\n.lv-library-scene .lv-shelf {display:block;overflow:visible;padding:18px 0 0;border:0;background:transparent;width:auto;}\r\n.lv-library-scene.lv-library-detail .lv-shelf {padding-top:0;}\r\n.lv-library-scene .lv-shelf-books-pane,\r\n.lv-library-scene .lv-shelf-chapters-pane {display:flex;flex-direction:column;gap:12px;min-width:0;}\r\n.lv-library-scene .lv-books {display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px;margin:10px 0;}\r\n.lv-library-scene .lv-books button {display:flex;flex-direction:column;gap:10px;align-items:stretch;border:1px solid var(--lv-line);padding:10px;background:var(--lv-bg);}\r\n.lv-library-scene .lv-books button[aria-pressed=true] {border-color:var(--lv-accent);background:var(--lv-surface-2);}\r\n.lv-library-scene .lv-book-cover {position:relative;height:112px;width:100%;border-radius:var(--lv-r-s);display:grid;place-items:center;background:var(--lv-surface-2);font:var(--lv-title);font-size:44px;color:var(--lv-ink);border:0;}\r\n.lv-library-scene .lv-contents>div {padding:12px;border-bottom:1px solid var(--lv-line);}\r\n.lv-ui .lv-contents .lv-chapter-listen {flex:none;display:inline-flex;align-items:center;gap:5px;min-height:28px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:550;background:var(--lv-elevated);border-color:var(--lv-line-strong);color:var(--lv-ink);white-space:nowrap;}\r\n.lv-ui .lv-contents .lv-chapter-listen:hover:not(:disabled) {background:var(--lv-play-bg);border-color:var(--lv-play-bg);color:var(--lv-play-fg);}\r\n.lv-library-scene .lv-contents-heading {margin-top:0;}\r\n.lv-library-scene .lv-shelf-detail-bar {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;}\r\n.lv-ui .lv-shelf-back {display:inline-flex;align-items:center;gap:4px;padding-left:4px;font-weight:600;}\r\n.lv-library-scene .lv-shelf-detail-heading {margin:0;font-size:1.15rem;}\r\n.lv-library-scene .lv-shelf-empty-detail {display:grid;place-items:center;min-height:180px;padding:24px;border:1px dashed var(--lv-line);border-radius:var(--lv-r-m);}\r\n\r\n.lv-library-scene.lv-library-split {display:flex;flex-direction:column;min-height:0;padding-left:24px;padding-right:24px;}\r\n.lv-library-scene .lv-shelf-split {display:grid;grid-template-columns:minmax(270px,340px) minmax(0,1fr);gap:20px;align-items:start;flex:1;min-height:0;padding:14px 0 0;}\r\n.lv-library-scene .lv-shelf-split .lv-books {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:4px 0;}\r\n.lv-library-scene .lv-shelf-split .lv-book-cover {height:92px;}\r\n.lv-library-scene .lv-shelf-split .lv-shelf-chapters-pane {border-left:1px solid var(--lv-line);padding-left:20px;}\r\n\r\n@media (min-height: 520px) {\r\n .lv-library-scene.lv-library-split {height:100%;padding-bottom:20px;}\r\n .lv-library-scene.lv-library-split .lv-shelf-split {align-items:stretch;overflow:hidden;}\r\n .lv-library-scene.lv-library-split .lv-shelf-books-pane,\r\n .lv-library-scene.lv-library-split .lv-shelf-chapters-pane {min-height:0;overflow-y:auto;padding-bottom:24px;}\r\n}\r\n\r\n@container (max-width:759px) {\r\n .lv-library-scene {padding:16px 14px 40px;}\r\n .lv-library-scene .lv-books {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0;}\r\n .lv-library-scene .lv-book-cover {height:88px;}\r\n}\r\n\r\n.lv-book-cover .lv-role-dot {position:absolute;bottom:10px;left:10px;}\r\n\r\n.lv-import-banner {display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 14px;margin:4px 0 16px;border-radius:var(--lv-r-m);background:var(--lv-surface-2);font-size:13px;color:var(--lv-ink-dim);}\r\n.lv-import-banner span {margin-right:auto;}\r\n\r\n/* \u300C\u4E66\u67B6 / \u5BF9\u8BDD\u97F3\u9891\u300Dtabs and the conversation audio list. */\r\n.lv-library-scene .lv-library-tabs {margin:14px 0 4px;}\r\n.lv-snippets {display:flex;flex-direction:column;gap:14px;padding:18px 0;}\r\n.lv-snippets-summary {display:flex;align-items:center;gap:12px;flex-wrap:wrap;color:var(--lv-ink-dim);font-size:13px;}\r\n.lv-snippets-summary > span {margin-right:auto;min-width:0;}\r\n.lv-ui .lv-snippets-summary .lv-link {display:inline;min-height:0;padding:0;border:0;background:none;color:var(--lv-ink);text-decoration:underline;text-underline-offset:2px;}\r\n.lv-snippets-saved {padding:10px 14px;border-radius:var(--lv-r-m);background:var(--lv-surface-2);}\r\n.lv-snippets-edit {display:flex;flex-wrap:wrap;align-items:end;gap:8px;}\r\n.lv-snippets-edit label {display:flex;flex-direction:column;gap:4px;flex:1 1 14rem;min-width:0;}\r\n.lv-snippets-edit small {flex-basis:100%;}\r\n.lv-snippet-group h3 {margin:6px 0;font-size:13px;color:var(--lv-ink-mute);font-weight:600;}\r\n.lv-snippet {display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--lv-line);}\r\n.lv-snippet-main {display:flex;flex-direction:column;gap:2px;flex:1 1 16rem;min-width:0;}\r\n.lv-snippet-main strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}\r\n.lv-snippet-actions {flex-wrap:nowrap;}\r\n.lv-ui .lv-field-label {font-size:13px;color:var(--lv-ink-dim);}\r\n.lv-batch-config {color:var(--lv-ink-mute);font-size:12px;}\r\n";
15865
16066
 
15866
16067
  // src/client/styles/sheets.css
15867
16068
  var sheets_default = "\r\n.lv-ui .lv-sheet {position:absolute;z-index:20;top:var(--lv-top-inset,52px);bottom:var(--lv-dock-inset,0px);right:0;width:min(400px,100%);display:flex;flex-direction:column;min-height:0;background:var(--lv-surface);border-left:1px solid var(--lv-line);box-shadow:var(--lv-shadow);animation:lv-sheet-in 180ms cubic-bezier(.2,.7,.2,1);outline:none;}\r\n.lv-sheet-head {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 12px 24px;border-bottom:1px solid var(--lv-line);flex:none;}\r\n.lv-ui .lv-sheet-head h2 {font-size:16px;font-weight:600;line-height:1.4;letter-spacing:0;margin:0;}\r\n.lv-sheet-body {flex:1;min-height:0;overflow:auto;padding:20px 24px 28px;display:flex;flex-direction:column;gap:22px;}\r\n.lv-sheet .lv-card {border:0;border-bottom:1px solid var(--lv-line);border-radius:0;box-shadow:none;padding:18px 0;background:transparent;}\r\n.lv-ui .lv-sheet-plan {z-index:21;}\r\n@container (max-width:759px) {.lv-ui .lv-sheet {width:100%;border-left:0;}}\r\n@keyframes lv-sheet-in {from {opacity:0;transform:translateX(16px);} to {opacity:1;transform:none;}}\r\n@media (prefers-reduced-motion:reduce) {.lv-ui .lv-sheet {animation:none;}}\r\n.lv-plan-sheet {display:grid;gap:20px;min-width:0;}\r\n.lv-plan-steps {list-style:none;margin:0;padding:0;display:grid;gap:18px;}\r\n.lv-plan-steps li {display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;}\r\n.lv-plan-index {width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-size:12px;border:1px solid var(--lv-line-strong);color:var(--lv-ink-mute);}\r\n.lv-plan-steps h3 {display:flex;align-items:center;gap:8px;font-size:14px;margin:2px 0 4px;}\r\n.lv-plan-steps p {margin:0;color:var(--lv-ink-dim);font-size:13px;}\r\n.lv-plan-voices {margin-top:10px;}\r\n.lv-plan-cost {margin:0;padding-top:14px;border-top:1px solid var(--lv-line);font-size:12px;color:var(--lv-ink-mute);}\r\n.lv-plan-note {margin:0;color:var(--lv-warn);font-size:13px;}\r\n.lv-ai-label {color:var(--lv-accent)!important;}\r\n.lv-voice-chip {display:inline-flex;gap:6px;align-items:center;font-size:12px;padding:5px 9px;border:1px solid var(--lv-line);border-radius:var(--lv-r-s);}\r\n.lv-skin-previews {display:flex;gap:12px;}\r\n.lv-ui .lv-skin-preview {width:110px;display:grid;gap:6px;justify-items:start;background:var(--lv-surface);color:var(--lv-ink);border-color:var(--lv-line-strong);}\r\n.lv-skin-preview span {font:var(--lv-title);}\r\n.lv-laivox-account {display:flex;flex-wrap:wrap;align-items:baseline;column-gap:12px;row-gap:4px;}\r\n.lv-laivox-account > small {overflow-wrap:anywhere;}\r\n.lv-laivox-account > small + small {white-space:nowrap;}\r\n.lv-laivox-account-id {display:block;overflow-wrap:anywhere;color:var(--lv-ink-mute);margin-bottom:6px;}\r\n.lv-laivox-embedded {display:grid;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid var(--lv-line);}\r\n.lv-laivox-fold h3 {display:flex;align-items:center;gap:6px;flex-wrap:wrap;}\r\n.lv-laivox-quota {\r\n display:grid;gap:6px;padding:12px;border:1px solid var(--lv-line);\r\n border-radius:var(--lv-r-m);background:var(--lv-surface-2);\r\n}\r\n.lv-laivox-quota > strong {color:var(--lv-ink);font-size:15px;line-height:1.5;}\r\n.lv-laivox-quota > strong[role=alert] {font-size:13px;}\r\n.lv-laivox-quota > .lv-inline {margin-top:3px;}\r\n.lv-laivox-narrator {display:grid;gap:5px;}\r\n.lv-laivox-voice-control {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;}\r\n.lv-laivox-voice-control > label {display:grid;gap:.35rem;min-width:0;}\r\n.lv-laivox-voice-control button {white-space:nowrap;}\r\n.lv-popover,.lv-tooltip {position:fixed;inset:auto;margin:0;padding:12px;border:1px solid var(--lv-line-strong);border-radius:var(--lv-r-m);background:var(--lv-elevated);color:var(--lv-ink);box-shadow:var(--lv-shadow);max-width:calc(100vw - 16px);overflow:auto;overscroll-behavior:contain;}\r\n.lv-popover .lv-menu {display:grid;gap:6px;max-height:min(450px,70vh);overflow:auto;min-width:120px;}\r\n.lv-menu a {color:var(--lv-ink);padding:8px;text-decoration:none;}\r\n.lv-tooltip {pointer-events:none;font-size:12px;padding:6px 10px;}\r\n.lv-tooltip-anchor {display:inline-flex;width:100%;height:100%;}\r\n@keyframes lv-fade-in {from {opacity:0;} to {opacity:1;}}\r\n\r\n/* Task sheet: compact rows, bulk actions in the \u22EF menu, finished jobs folded. */\r\n.lv-sheet .lv-queue { padding:0; overflow:visible; display:grid; gap:14px; }\r\n.lv-queue-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--lv-ink-mute); font-size:12px; }\r\n.lv-queue-scope { display:inline-flex; align-items:center; gap:8px; padding:3px 4px 3px 10px; border-radius:999px; background:var(--lv-surface-2); color:var(--lv-ink); }\r\n.lv-queue-note { margin:0; padding:8px 10px; border-radius:var(--lv-r-m); background:var(--lv-surface-2); color:var(--lv-warn); font-size:12px; }\r\n.lv-queue-group { display:grid; gap:2px; }\r\n.lv-queue-group h3, .lv-queue-group summary { font-size:12px; font-weight:600; color:var(--lv-ink-mute); margin:0 0 4px; letter-spacing:.04em; }\r\n.lv-queue-group h3 small, .lv-queue-group summary small { font-weight:400; margin-left:4px; }\r\n.lv-queue-finished summary { cursor:pointer; }\r\n.lv-queue-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:start; padding:10px 0; border-bottom:1px solid var(--lv-line); }\r\n.lv-queue-main { display:grid; gap:3px; min-width:0; }\r\n.lv-ui .lv-queue-title { text-align:left; font-weight:600; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; padding:0; }\r\n.lv-queue-title span { color:var(--lv-ink-mute); font-weight:400; }\r\n.lv-queue-actions { display:flex; gap:4px; }\r\n.lv-job-detail { color:var(--lv-ink-mute); font-size:12px; overflow-wrap:anywhere; }\r\n.lv-job-detail[data-error] { color:var(--lv-warn); }\r\n.lv-job-detail code { color:var(--lv-ink-mute); font-size:11px; }\r\n.lv-queue-row[data-state=completed] .lv-job-progress small, .lv-queue-row[data-state=cancelled] .lv-job-progress small { color:var(--lv-ink-mute); }\r\n";
@@ -15876,124 +16077,125 @@ var live_default = '/* Production live view: a manuscript sheet where every squa
15876
16077
  var metrics_default = ".lv-ui .lv-level {\r\n --lv-level-fill: var(--lv-accent);\r\n position: relative;\r\n min-width: 0;\r\n min-height: 5px;\r\n overflow: hidden;\r\n border-radius: 999px;\r\n background: var(--lv-line-strong);\r\n}\r\n.lv-ui .lv-level[data-tone=warn] { --lv-level-fill: var(--lv-warn); }\r\n.lv-ui .lv-level[data-tone=danger] { --lv-level-fill: var(--lv-danger); }\r\n.lv-ui .lv-level[data-tone=muted] { --lv-level-fill: var(--lv-ink-mute); }\r\n.lv-ui .lv-level > span {\r\n position: absolute;\r\n inset: 0;\r\n border-radius: inherit;\r\n background: var(--lv-level-fill);\r\n transform: scaleX(var(--lv-level, 0));\r\n transform-origin: left;\r\n transition: transform 420ms var(--lv-ease);\r\n}\r\n.lv-ui .lv-level[data-indeterminate] > span {\r\n inset-inline-end: auto;\r\n width: 32%;\r\n transform: none;\r\n animation: lv-level-sweep 1.65s var(--lv-ease) infinite;\r\n}\r\n@keyframes lv-level-sweep {\r\n from { transform: translateX(-100%); }\r\n to { transform: translateX(320%); }\r\n}\r\n\r\n.lv-ui .lv-metric-caption, .lv-ui .lv-metric-action {\r\n display: inline-flex;\r\n align-items: center;\r\n gap: 6px;\r\n}\r\n.lv-metric-caption > svg, .lv-metric-action > svg { flex: none; }\r\n.lv-metric-caption[data-tone=warn] { color: var(--lv-warn); }\r\n.lv-metric-caption[data-tone=danger] { color: var(--lv-danger); }\r\n.lv-activity-mark { display: inline-grid; place-items: center; flex: none; }\r\n.lv-activity-mark[data-mark=LoaderCircle], .lv-activity-mark[data-mark=AudioLines] { color: var(--lv-accent); }\r\n.lv-activity-mark[data-mark=LoaderCircle] svg { animation: lv-metric-spin 1.2s linear infinite; }\r\n.lv-activity-mark[data-mark=AudioLines] svg { animation: lv-metric-wave 1.4s ease-in-out infinite; }\r\n.lv-activity-mark[data-mark=CircleAlert] { color: var(--lv-warn); }\r\n@keyframes lv-metric-spin { to { transform: rotate(360deg); } }\r\n@keyframes lv-metric-wave { 50% { transform: scaleY(.65); } }\r\n\r\n.lv-storage-metric { display: grid; gap: 7px; min-width: 0; }\r\n.lv-storage-metric[data-compact] { gap: 5px; }\r\n.lv-laivox-quota > .lv-level { margin: 3px 0 1px; min-height: 7px; }\r\n.lv-quota-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; }\r\n.lv-quota-meta .lv-metric-caption { white-space: nowrap; }\r\n.lv-production-status > .lv-level { flex: 0 0 100%; }\r\n.lv-job-progress > .lv-level { width: min(16rem, 100%); }\r\n.lv-review-meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }\r\n.lv-ui .lv-ai-usage { display: grid; width: min(22rem, 100%); min-width: 0; gap: 4px; color: var(--lv-ink-mute); }\r\n.lv-ai-usage .lv-metric-caption { align-items: baseline; font-variant-numeric: tabular-nums; }\r\n.lv-chapter-review > .lv-ai-usage { margin-block: .45rem; }\r\n.lv-token-split { position: relative; height: 5px; overflow: hidden; border-radius: 999px; background: var(--lv-ink-mute); }\r\n.lv-token-split > span {\r\n position: absolute;\r\n inset: 0;\r\n background: var(--lv-accent);\r\n transform: scaleX(var(--lv-token-input));\r\n transform-origin: left;\r\n transition: transform 420ms var(--lv-ease);\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n .lv-ui .lv-level[data-indeterminate] > span { inset-inline-start: 34%; }\r\n}\r\n";
15877
16078
 
15878
16079
  // src/client/styles/polish.css
15879
- var polish_default = '/* Shared control language for the workbench. Paper and graphite both use these\r\n tokens; chat cards and the LaiVox dock keep their own surfaces. */\r\n\r\n.lv-ui button {\r\n transition: background var(--lv-dur-1) var(--lv-ease), border-color var(--lv-dur-1) var(--lv-ease), color var(--lv-dur-1) var(--lv-ease), opacity var(--lv-dur-1) var(--lv-ease);\r\n}\r\n.lv-ui button.lv-primary,\r\n.lv-ui button.lv-primary:hover:not(:disabled) {\r\n background: var(--lv-play-bg); border-color: var(--lv-play-bg); color: var(--lv-play-fg);\r\n}\r\n.lv-ui button.lv-primary:hover:not(:disabled) { filter: brightness(1.08); }\r\n.lv-ui button.lv-play:active:not(:disabled) { transform: scale(.96); }\r\n\r\n.lv-ui button.lv-chip {\r\n border-radius: 999px; min-height: var(--lv-h-sm); padding: 2px 12px;\r\n background: var(--lv-surface-2); border-color: transparent; color: var(--lv-ink-mute);\r\n}\r\n.lv-chip-row { display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }\r\n.lv-chip-row > button { flex: none; }\r\n\r\n.lv-ui .lv-segmented button[aria-pressed=true],\r\n.lv-ui .lv-segmented button[aria-selected=true],\r\n.lv-ui .lv-scene-tabs button[aria-selected=true],\r\n.lv-ui button.lv-chip[aria-pressed=true],\r\n.lv-library-scene .lv-books button[aria-pressed=true] {\r\n background: var(--lv-elevated); color: var(--lv-ink); border-color: var(--lv-ink);\r\n box-shadow: inset 0 0 0 2px var(--lv-ink);\r\n}\r\n.lv-script-filters { position: sticky; top: 0; z-index: 2; background: var(--lv-bg); padding: 8px 0; }\r\n.lv-ui .lv-script article {\r\n display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto;\r\n gap: 8px 16px; align-items: start; padding: 14px 12px 14px 14px;\r\n border-radius: var(--lv-r-m); scroll-margin-top: 72px;\r\n}\r\n.lv-ui .lv-script article:focus-visible { outline: 2px solid var(--lv-accent); outline-offset: 2px; }\r\n.lv-script-check { grid-column: 1 / -1; }\r\n.lv-script-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--lv-ink-mute); font-size: var(--lv-fs-meta); }\r\n.lv-script-who span { color: var(--lv-ink); font-weight: 650; }\r\n.lv-script-main { min-width: 0; }\r\n.lv-ui .lv-script article p { margin: 0; }\r\n.lv-script-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }\r\n.lv-script-status { color: var(--lv-ink-dim); font-size: var(--lv-fs-meta); text-align: right; }\r\n.lv-script-extra { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; }\r\n.lv-script-extra, .lv-chapter-listen { opacity: 0; }\r\n.lv-script article:hover .lv-script-extra,\r\n.lv-script article:focus-within .lv-script-extra,\r\n.lv-contents > div:hover .lv-chapter-listen,\r\n.lv-contents > div:focus-within .lv-chapter-listen { opacity: 1; }\r\n\r\n.lv-row-editor {\r\n opacity: 1; transform: none;\r\n transition: opacity var(--lv-dur-2) var(--lv-ease), transform var(--lv-dur-2) var(--lv-ease);\r\n background: var(--lv-surface-2);\r\n}\r\n@starting-style { .lv-row-editor { opacity: 0; transform: translateY(4px); } }\r\n\r\n.lv-studio .lv-role-card {\r\n position: relative; display: grid; gap: 8px; align-items: start;\r\n padding: 14px 14px 14px 18px; overflow: hidden;\r\n}\r\n.lv-studio .lv-role-card::before {\r\n content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;\r\n background: var(--lv-role-color, var(--lv-ink-dim));\r\n}\r\n.lv-role-voice { display: flex; align-items: center; gap: 8px; min-width: 0; }\r\n.lv-ui .lv-role-pick { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; }\r\n.lv-ui .lv-role-pick span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\r\n.lv-ui .lv-role-pick small { flex: none; white-space: nowrap; }\r\n.lv-role-edge { color: var(--lv-ink-mute); }\r\n.lv-role-list { display: flex; flex-direction: column; }\r\n.lv-role-row {\r\n display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px;\r\n border-bottom: 1px solid var(--lv-line); box-shadow: inset 4px 0 0 var(--lv-role-color, transparent);\r\n}\r\n.lv-role-row strong { flex: 0 1 8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\r\n.lv-role-row .lv-role-pick { flex: 1; }\r\n\r\n.lv-library-scene .lv-books button:hover:not(:disabled) { box-shadow: var(--lv-shadow); }\r\n.lv-library-scene .lv-book-cover {\r\n aspect-ratio: 3 / 4; height: auto; display: flex; align-items: flex-end;\r\n padding: 12px; box-shadow: inset 5px 0 0 var(--lv-role-color, var(--lv-ink-dim));\r\n font-size: inherit; place-items: unset;\r\n}\r\n.lv-ui .lv-books .lv-book-title {\r\n width: 100%;\r\n font-family: var(--lv-serif); font-size: var(--lv-fs-h3); font-weight: 650; line-height: 1.35;\r\n text-align: left; white-space: normal;\r\n display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;\r\n}\r\n.lv-book-meta { display: flex; align-items: center; gap: 6px; color: var(--lv-ink-mute); font-size: var(--lv-fs-meta); }\r\n.lv-batch { background: var(--lv-surface-2); border-radius: var(--lv-r-m); padding: 12px; margin: 8px 0; }\r\n\r\n.lv-queue-row { grid-template-columns: auto minmax(0, 1fr) auto; }\r\n.lv-status-dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--lv-ink-dim); }\r\n.lv-queue-row[data-state=running] .lv-status-dot { background: var(--lv-ink); }\r\n.lv-queue-row[data-state=paused] .lv-status-dot { background: var(--lv-warn); }\r\n.lv-queue-row[data-state=queued] .lv-status-dot { background: var(--lv-line-strong); }\r\n\r\n@supports selector(::details-content) {\r\n .lv-ui details::details-content { transition: opacity var(--lv-dur-2) var(--lv-ease), content-visibility var(--lv-dur-2) allow-discrete; opacity: 0; }\r\n .lv-ui details[open]::details-content { opacity: 1; }\r\n}\r\n\r\n@container workbench (max-width: 759px) {\r\n .lv-ui .lv-script article { grid-template-columns: minmax(0, 1fr); }\r\n .lv-script-actions { align-items: flex-start; }\r\n .lv-script-extra, .lv-chapter-listen { opacity: 1; }\r\n .lv-library-scene .lv-books { grid-template-columns: repeat(2, minmax(0, 1fr)); }\r\n}\r\n@media (max-width: 759px), (hover: none) {\r\n .lv-ui .lv-script article { grid-template-columns: minmax(0, 1fr); }\r\n .lv-script-extra, .lv-chapter-listen { opacity: 1; }\r\n}\r\n';
16080
+ var polish_default = '/* Shared control language for the workbench. Paper and graphite both use these\r\n tokens; chat cards and the LaiVox dock keep their own surfaces. */\r\n\r\n.lv-ui button {\r\n transition: background var(--lv-dur-1) var(--lv-ease), border-color var(--lv-dur-1) var(--lv-ease), color var(--lv-dur-1) var(--lv-ease), opacity var(--lv-dur-1) var(--lv-ease);\r\n}\r\n.lv-ui button.lv-primary,\r\n.lv-ui button.lv-primary:hover:not(:disabled) {\r\n background: var(--lv-play-bg); border-color: var(--lv-play-bg); color: var(--lv-play-fg);\r\n}\r\n.lv-ui button.lv-primary:hover:not(:disabled) { filter: brightness(1.08); }\r\n.lv-ui button.lv-play:active:not(:disabled) { transform: scale(.96); }\r\n\r\n.lv-ui button.lv-chip {\r\n border-radius: 999px; min-height: var(--lv-h-sm); padding: 2px 12px;\r\n background: var(--lv-surface-2); border-color: transparent; color: var(--lv-ink-mute);\r\n}\r\n.lv-chip-row { display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }\r\n.lv-chip-row > button { flex: none; }\r\n\r\n.lv-ui .lv-segmented button[aria-pressed=true],\r\n.lv-ui .lv-segmented button[aria-selected=true],\r\n.lv-ui .lv-scene-tabs button[aria-selected=true],\r\n.lv-ui button.lv-chip[aria-pressed=true],\r\n.lv-library-scene .lv-books button[aria-pressed=true] {\r\n background: var(--lv-elevated); color: var(--lv-ink); border-color: var(--lv-ink);\r\n box-shadow: inset 0 0 0 2px var(--lv-ink);\r\n}\r\n.lv-script-filters { position: sticky; top: 0; z-index: 2; background: var(--lv-bg); padding: 8px 0; }\r\n.lv-ui .lv-script article {\r\n display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto;\r\n gap: 8px 16px; align-items: start; padding: 14px 12px 14px 14px;\r\n border-radius: var(--lv-r-m); scroll-margin-top: 72px;\r\n}\r\n.lv-ui .lv-script article:focus-visible { outline: 2px solid var(--lv-accent); outline-offset: 2px; }\r\n.lv-script-check { grid-column: 1 / -1; }\r\n.lv-script-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--lv-ink-mute); font-size: var(--lv-fs-meta); }\r\n.lv-script-who span { color: var(--lv-ink); font-weight: 650; }\r\n.lv-script-main { min-width: 0; }\r\n.lv-ui .lv-script article p { margin: 0; }\r\n.lv-script-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }\r\n.lv-script-status { color: var(--lv-ink-dim); font-size: var(--lv-fs-meta); text-align: right; }\r\n.lv-script-extra { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; }\r\n.lv-script-extra { opacity: 0; }\r\n.lv-script article:hover .lv-script-extra,\r\n.lv-script article:focus-within .lv-script-extra { opacity: 1; }\r\n\r\n.lv-row-editor {\r\n opacity: 1; transform: none;\r\n transition: opacity var(--lv-dur-2) var(--lv-ease), transform var(--lv-dur-2) var(--lv-ease);\r\n background: var(--lv-surface-2);\r\n}\r\n@starting-style { .lv-row-editor { opacity: 0; transform: translateY(4px); } }\r\n\r\n.lv-studio .lv-role-card {\r\n position: relative; display: grid; gap: 8px; align-items: start;\r\n padding: 14px 14px 14px 18px; overflow: hidden;\r\n}\r\n.lv-studio .lv-role-card::before {\r\n content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;\r\n background: var(--lv-role-color, var(--lv-ink-dim));\r\n}\r\n.lv-role-voice { display: flex; align-items: center; gap: 8px; min-width: 0; }\r\n.lv-ui .lv-role-pick { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; }\r\n.lv-ui .lv-role-pick span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\r\n.lv-ui .lv-role-pick small { flex: none; white-space: nowrap; }\r\n.lv-role-edge { color: var(--lv-ink-mute); }\r\n.lv-role-list { display: flex; flex-direction: column; }\r\n.lv-role-row {\r\n display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px;\r\n border-bottom: 1px solid var(--lv-line); box-shadow: inset 4px 0 0 var(--lv-role-color, transparent);\r\n}\r\n.lv-role-row strong { flex: 0 1 8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\r\n.lv-role-row .lv-role-pick { flex: 1; }\r\n\r\n.lv-library-scene .lv-books button:hover:not(:disabled) { box-shadow: var(--lv-shadow); }\r\n.lv-library-scene .lv-book-cover {\r\n display: flex; align-items: flex-end;\r\n padding: 10px 12px; box-shadow: inset 5px 0 0 var(--lv-role-color, var(--lv-ink-dim));\r\n font-size: inherit; place-items: unset;\r\n}\r\n.lv-ui .lv-books .lv-book-title {\r\n width: 100%;\r\n font-family: var(--lv-serif); font-size: var(--lv-fs-h3); font-weight: 650; line-height: 1.35;\r\n text-align: left; white-space: normal;\r\n display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;\r\n}\r\n.lv-book-meta { display: flex; align-items: center; gap: 6px; color: var(--lv-ink-mute); font-size: var(--lv-fs-meta); }\r\n.lv-batch { background: var(--lv-surface-2); border-radius: var(--lv-r-m); padding: 12px; margin: 8px 0; }\r\n\r\n.lv-queue-row { grid-template-columns: auto minmax(0, 1fr) auto; }\r\n.lv-status-dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--lv-ink-dim); }\r\n.lv-queue-row[data-state=running] .lv-status-dot { background: var(--lv-ink); }\r\n.lv-queue-row[data-state=paused] .lv-status-dot { background: var(--lv-warn); }\r\n.lv-queue-row[data-state=queued] .lv-status-dot { background: var(--lv-line-strong); }\r\n\r\n@supports selector(::details-content) {\r\n .lv-ui details::details-content { transition: opacity var(--lv-dur-2) var(--lv-ease), content-visibility var(--lv-dur-2) allow-discrete; opacity: 0; }\r\n .lv-ui details[open]::details-content { opacity: 1; }\r\n}\r\n\r\n@container workbench (max-width: 759px) {\r\n .lv-ui .lv-script article { grid-template-columns: minmax(0, 1fr); }\r\n .lv-script-actions { align-items: flex-start; }\r\n .lv-script-extra { opacity: 1; }\r\n .lv-library-scene .lv-books { grid-template-columns: repeat(2, minmax(0, 1fr)); }\r\n}\r\n@media (max-width: 759px), (hover: none) {\r\n .lv-ui .lv-script article { grid-template-columns: minmax(0, 1fr); }\r\n .lv-script-extra { opacity: 1; }\r\n}\r\n';
15880
16081
 
15881
16082
  // src/client/styles/host.css
15882
- var host_default = `/* Plugin pieces rendered inside DSH's conversation (dock, tool cards, turn tail,
15883
- mini capsule). They follow the host's look: every color, radius and focus ring
15884
- comes from DSH's --dsw-* tokens, never from the workbench skins. The fallbacks
15885
- only apply where the host tokens are absent (the test fixture). Every selector
15886
- starts with .lv-host so nothing leaks into the host or the workbench. */
15887
- .lv-host {
15888
- --lvh-fb-ink: rgb(15, 17, 21); --lvh-fb-ink-2: rgb(97, 102, 107); --lvh-fb-ink-3: rgb(129, 133, 140);
15889
- --lvh-fb-line: rgba(0, 0, 0, .04); --lvh-fb-line-2: rgba(0, 0, 0, .1); --lvh-fb-hover: rgba(38, 49, 72, .06);
15890
- --lvh-fb-strong: rgb(15, 17, 21); --lvh-fb-on-strong: rgb(255, 255, 255); --lvh-fb-error: rgb(236, 19, 19);
15891
- --lvh-fb-accent: rgb(65, 118, 230); --lvh-fb-field: rgb(255, 255, 255); --lvh-fb-menu: rgba(252, 253, 254, .92);
15892
- }
15893
- @media (prefers-color-scheme: dark) {
15894
- .lv-host {
15895
- --lvh-fb-ink: rgb(249, 250, 251); --lvh-fb-ink-2: rgb(207, 211, 214); --lvh-fb-ink-3: rgb(173, 178, 184);
15896
- --lvh-fb-line: rgba(255, 255, 255, .06); --lvh-fb-line-2: rgba(255, 255, 255, .12); --lvh-fb-hover: rgba(255, 255, 255, .08);
15897
- --lvh-fb-strong: rgb(249, 250, 251); --lvh-fb-on-strong: rgb(15, 17, 21); --lvh-fb-error: rgb(242, 90, 90);
15898
- --lvh-fb-accent: rgb(122, 170, 255); --lvh-fb-field: rgb(21, 21, 23); --lvh-fb-menu: rgba(48, 49, 54, .92);
15899
- }
15900
- }
15901
- .lv-host {
15902
- --lvh-ink: var(--dsw-alias-label-primary, var(--lvh-fb-ink));
15903
- --lvh-ink-2: var(--dsw-alias-label-secondary, var(--lvh-fb-ink-2));
15904
- --lvh-ink-3: var(--dsw-alias-label-tertiary, var(--lvh-fb-ink-3));
15905
- --lvh-line: var(--dsw-alias-border-l1, var(--lvh-fb-line));
15906
- --lvh-line-2: var(--dsw-alias-border-l2, var(--lvh-fb-line-2));
15907
- --lvh-hover: var(--dsw-alias-interactive-bg-hover, var(--lvh-fb-hover));
15908
- --lvh-strong: var(--dsw-alias-button-primary-fill, var(--dsw-alias-brand-primary, var(--lvh-fb-strong)));
15909
- --lvh-on-strong: var(--dsw-alias-label-primary-foreground, var(--lvh-fb-on-strong));
15910
- --lvh-error: var(--dsw-alias-state-error-primary, var(--lvh-fb-error));
15911
- --lvh-accent: var(--dsw-alias-state-business-primary, var(--lvh-fb-accent));
15912
- --lvh-field: var(--dsw-alias-bg-base, var(--lvh-fb-field));
15913
- --lvh-menu: var(--dsw-specific-menu, var(--lvh-fb-menu));
15914
- --lvh-radius-sm: var(--dsw-radius-sm, 6px);
15915
- --lvh-radius-md: var(--dsw-radius-md, 8px);
15916
- --lvh-radius-lg: var(--dsw-radius-lg, 12px);
15917
- color: var(--lvh-ink);
15918
- font: inherit;
15919
- min-width: 0;
15920
- }
15921
- .lv-host * { box-sizing: border-box; }
15922
- .lv-host :focus-visible { outline: var(--dsw-focus-ring-width, 2px) solid var(--dsw-focus-ring-color, var(--lvh-accent)); outline-offset: -2px; }
15923
-
15924
- /* one line: text that may wrap, actions on the right */
15925
- .lv-host .lv-hline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 32px; font-size: 13px; line-height: 1.5; }
15926
- .lv-host .lv-hgrow { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
15927
- .lv-host .lv-htitle { font-weight: 500; }
15928
- .lv-host .lv-hmeta { color: var(--lvh-ink-3); }
15929
- .lv-host .lv-hmeta.lv-herror, .lv-host .lv-herror { color: var(--lvh-error); }
15930
- .lv-host .lv-hactions { display: inline-flex; flex: none; flex-wrap: wrap; align-items: center; gap: 2px; }
15931
- .lv-host .lv-hdot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--lvh-ink-3); }
15932
- .lv-host .lv-htime { font-variant-numeric: tabular-nums; }
15933
- .lv-host .lv-hglyph { flex: none; display: inline-grid; place-items: center; color: var(--lvh-ink-3); }
15934
-
15935
- .lv-host button.lv-hbtn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 0; border-radius: var(--lvh-radius-sm);
15936
- background: transparent; color: var(--lvh-ink-2); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
15937
- .lv-host button.lv-hbtn:hover:not(:disabled) { background: var(--lvh-hover); color: var(--lvh-ink); }
15938
- .lv-host button.lv-hbtn.lv-hprimary { background: var(--lvh-strong); color: var(--lvh-on-strong); }
15939
- .lv-host button.lv-hbtn.lv-hprimary:hover:not(:disabled) { background: var(--lvh-strong); opacity: .88; color: var(--lvh-on-strong); }
15940
- .lv-host button.lv-hbtn:disabled { opacity: .45; cursor: default; }
15941
-
15942
- /* tool card and turn tail: no fill, no border */
15943
- .lv-host.lv-htool, .lv-host.lv-hresult { display: grid; gap: 2px; margin: 2px 0 8px; }
15944
- .lv-host .lv-hexpand { display: grid; gap: 8px; margin: 4px 0; padding: 10px 12px; border: .5px solid var(--lvh-line-2); border-radius: var(--lvh-radius-md); }
15945
- .lv-host .lv-hexpand textarea { width: 100%; min-height: 64px; resize: vertical; padding: 8px; border: .5px solid var(--lvh-line-2); border-radius: var(--lvh-radius-sm);
15946
- background: var(--lvh-field); color: var(--lvh-ink); font: inherit; font-size: 13px; line-height: 1.6; }
15947
- .lv-host .lv-hexpand label { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13px; color: var(--lvh-ink-2); }
15948
- .lv-host .lv-hhint { font-size: 12px; color: var(--lvh-ink-3); }
15949
- .lv-host .lv-halert { font-size: 12px; color: var(--lvh-error); }
15950
-
15951
- /* Dock: the geometry of the host's own QueueDock (dsh-client-ui-conversation),
15952
- attached to the top of the composer card. */
15953
- .lv-host.lv-hdock {
15954
- flex: none;
15955
- width: calc(100% - var(--dsh-composer-side-clearance, 0px) - var(--dsh-composer-side-clearance, 0px) - var(--dsh-composer-dock-inset, 12px) - var(--dsh-composer-dock-inset, 12px));
15956
- max-width: calc(var(--dsh-composer-card-max-width, 100%) - var(--dsh-composer-dock-inset, 12px) - var(--dsh-composer-dock-inset, 12px));
15957
- margin: 0 auto calc(0px - var(--dsh-composer-stack-gap, 0px) - 3px);
15958
- padding: 0 var(--dsh-composer-dock-inset, 0px);
15959
- }
15960
- .lv-host .lv-hdock-panel { position: relative; isolation: isolate; overflow: hidden; width: 100%; padding: 2px 0 5px; border-radius: var(--lvh-radius-lg) var(--lvh-radius-lg) 0 0; }
15961
- .lv-host .lv-hdock-panel::before { content: ''; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: var(--lvh-menu);
15962
- backdrop-filter: var(--dsw-menu-backdrop-filter, blur(20px)); pointer-events: none; }
15963
- .lv-host .lv-hdock-panel::after { content: ''; position: absolute; inset: 0; border: .5px solid var(--lvh-line); border-bottom: none; border-radius: inherit; pointer-events: none; }
15964
- .lv-host .lv-hdock-head { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 6px 4px 12px; }
15965
- .lv-host .lv-hdock-count { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 13px; font-weight: 500; line-height: 24px; text-overflow: ellipsis; white-space: nowrap; }
15966
- .lv-host .lv-hdock-count .lv-hmeta { font-weight: 400; }
15967
- .lv-host .lv-hdock-body { max-height: 240px; overflow-y: auto; }
15968
- .lv-host .lv-hdock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 36px; padding: 4px 6px 4px 12px; font-size: 13px; box-shadow: inset 0 1px 0 var(--lvh-line); }
15969
- .lv-host .lv-hdock-row > .lv-hexpand { flex: 1 1 100%; }
15970
- .lv-host .lv-hprogress { height: 2px; margin-top: 4px; overflow: hidden; border-radius: 2px; background: var(--lvh-line-2); }
15971
- .lv-host .lv-hprogress > i { display: block; height: 100%; background: var(--lvh-accent); }
15972
-
15973
- /* mini capsule (floats over the host frame) */
15974
- .lv-host.lv-mini-anchor { position: fixed; right: .9rem; bottom: .9rem; z-index: 12; width: min(22rem, calc(100% - 1.8rem)); display: flex; justify-content: flex-end; }
15975
- .lv-host .lv-mini-capsule { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 40px; padding: 0 6px; border: .5px solid var(--lvh-line-2); border-radius: 999px;
15976
- background: var(--lvh-menu); backdrop-filter: var(--dsw-menu-backdrop-filter, blur(20px)); box-shadow: 0 4px 16px rgba(0, 0, 0, .08); font-size: 13px; }
15977
- .lv-host .lv-mini-capsule span { min-width: 0; overflow: hidden; color: var(--lvh-ink-2); text-overflow: ellipsis; white-space: nowrap; }
15978
- .lv-host .lv-mini-capsule button.lv-hplay { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
15979
- background: var(--lvh-strong); color: var(--lvh-on-strong); cursor: pointer; }
15980
- .lv-host .lv-mini-capsule button.lv-hplay:disabled { opacity: .45; cursor: default; }
15981
- .lv-host .lv-mini-capsule .lv-role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lv-role-color, var(--lvh-ink-3)); flex: none; }
15982
- .lv-host button.lv-hbtn.lv-hclose { padding: 0 6px; color: var(--lvh-ink-3); }
15983
-
15984
- /* "\u5BF9\u8BDD\u7247\u6BB5" in a result line: a quiet link to the conversation audio list. */
15985
- .lv-host button.lv-hlink { display: inline; height: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
15986
- .lv-host button.lv-hlink:hover { color: var(--lvh-ink); }
15987
-
15988
- /* The message "read aloud" button: icon only, like the host's copy button. */
15989
- .lv-host.lv-hspeak { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
15990
- .lv-host button.lv-hbtn.lv-hicon { width: 28px; padding: 0; justify-content: center; }
15991
- .lv-host .lv-hspinning svg { animation: lv-hspin 0.9s linear infinite; }
15992
- @keyframes lv-hspin { to { transform: rotate(360deg); } }
15993
- @media (prefers-reduced-motion: reduce) { .lv-host .lv-hspinning svg { animation: none; } }
15994
-
15995
- /* The chapter list of a production batch. */
15996
- .lv-host .lv-hlist { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--lvh-ink-2); }
16083
+ var host_default = `/* Plugin pieces rendered inside DSH's conversation (dock, tool cards, turn tail,\r
16084
+ mini capsule). They follow the host's look: every color, radius and focus ring\r
16085
+ comes from DSH's --dsw-* tokens, never from the workbench skins. The fallbacks\r
16086
+ only apply where the host tokens are absent (the test fixture). Every selector\r
16087
+ starts with .lv-host so nothing leaks into the host or the workbench. */\r
16088
+ .lv-host {\r
16089
+ --lvh-fb-ink: rgb(15, 17, 21); --lvh-fb-ink-2: rgb(97, 102, 107); --lvh-fb-ink-3: rgb(129, 133, 140);\r
16090
+ --lvh-fb-line: rgba(0, 0, 0, .04); --lvh-fb-line-2: rgba(0, 0, 0, .1); --lvh-fb-hover: rgba(38, 49, 72, .06);\r
16091
+ --lvh-fb-strong: rgb(15, 17, 21); --lvh-fb-on-strong: rgb(255, 255, 255); --lvh-fb-error: rgb(236, 19, 19);\r
16092
+ --lvh-fb-accent: rgb(65, 118, 230); --lvh-fb-field: rgb(255, 255, 255); --lvh-fb-menu: rgba(252, 253, 254, .92);\r
16093
+ }\r
16094
+ @media (prefers-color-scheme: dark) {\r
16095
+ .lv-host {\r
16096
+ --lvh-fb-ink: rgb(249, 250, 251); --lvh-fb-ink-2: rgb(207, 211, 214); --lvh-fb-ink-3: rgb(173, 178, 184);\r
16097
+ --lvh-fb-line: rgba(255, 255, 255, .06); --lvh-fb-line-2: rgba(255, 255, 255, .12); --lvh-fb-hover: rgba(255, 255, 255, .08);\r
16098
+ --lvh-fb-strong: rgb(249, 250, 251); --lvh-fb-on-strong: rgb(15, 17, 21); --lvh-fb-error: rgb(242, 90, 90);\r
16099
+ --lvh-fb-accent: rgb(122, 170, 255); --lvh-fb-field: rgb(21, 21, 23); --lvh-fb-menu: rgba(48, 49, 54, .92);\r
16100
+ }\r
16101
+ }\r
16102
+ .lv-host {\r
16103
+ --lvh-ink: var(--dsw-alias-label-primary, var(--lvh-fb-ink));\r
16104
+ --lvh-ink-2: var(--dsw-alias-label-secondary, var(--lvh-fb-ink-2));\r
16105
+ --lvh-ink-3: var(--dsw-alias-label-tertiary, var(--lvh-fb-ink-3));\r
16106
+ --lvh-line: var(--dsw-alias-border-l1, var(--lvh-fb-line));\r
16107
+ --lvh-line-2: var(--dsw-alias-border-l2, var(--lvh-fb-line-2));\r
16108
+ --lvh-hover: var(--dsw-alias-interactive-bg-hover, var(--lvh-fb-hover));\r
16109
+ --lvh-strong: var(--dsw-alias-button-primary-fill, var(--dsw-alias-brand-primary, var(--lvh-fb-strong)));\r
16110
+ --lvh-on-strong: var(--dsw-alias-label-primary-foreground, var(--lvh-fb-on-strong));\r
16111
+ --lvh-error: var(--dsw-alias-state-error-primary, var(--lvh-fb-error));\r
16112
+ --lvh-accent: var(--dsw-alias-state-business-primary, var(--lvh-fb-accent));\r
16113
+ --lvh-field: var(--dsw-alias-bg-base, var(--lvh-fb-field));\r
16114
+ --lvh-menu: var(--dsw-specific-menu, var(--lvh-fb-menu));\r
16115
+ --lvh-radius-sm: var(--dsw-radius-sm, 6px);\r
16116
+ --lvh-radius-md: var(--dsw-radius-md, 8px);\r
16117
+ --lvh-radius-lg: var(--dsw-radius-lg, 12px);\r
16118
+ color: var(--lvh-ink);\r
16119
+ font: inherit;\r
16120
+ min-width: 0;\r
16121
+ }\r
16122
+ .lv-host * { box-sizing: border-box; }\r
16123
+ .lv-host :focus-visible { outline: var(--dsw-focus-ring-width, 2px) solid var(--dsw-focus-ring-color, var(--lvh-accent)); outline-offset: -2px; }\r
16124
+ \r
16125
+ /* one line: text that may wrap, actions on the right */\r
16126
+ .lv-host .lv-hline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 32px; font-size: 13px; line-height: 1.5; }\r
16127
+ .lv-host .lv-hgrow { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }\r
16128
+ .lv-host .lv-htitle { font-weight: 500; }\r
16129
+ .lv-host .lv-hmeta { color: var(--lvh-ink-3); }\r
16130
+ .lv-host .lv-hmeta.lv-herror, .lv-host .lv-herror { color: var(--lvh-error); }\r
16131
+ .lv-host .lv-hactions { display: inline-flex; flex: none; flex-wrap: wrap; align-items: center; gap: 2px; }\r
16132
+ .lv-host .lv-hdot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--lvh-ink-3); }\r
16133
+ .lv-host .lv-htime { font-variant-numeric: tabular-nums; }\r
16134
+ .lv-host .lv-hglyph { flex: none; display: inline-grid; place-items: center; color: var(--lvh-ink-3); }\r
16135
+ \r
16136
+ .lv-host button.lv-hbtn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 0; border-radius: var(--lvh-radius-sm);\r
16137
+ background: transparent; color: var(--lvh-ink-2); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }\r
16138
+ .lv-host button.lv-hbtn:hover:not(:disabled) { background: var(--lvh-hover); color: var(--lvh-ink); }\r
16139
+ .lv-host button.lv-hbtn.lv-hprimary { background: var(--lvh-strong); color: var(--lvh-on-strong); }\r
16140
+ .lv-host button.lv-hbtn.lv-hprimary:hover:not(:disabled) { background: var(--lvh-strong); opacity: .88; color: var(--lvh-on-strong); }\r
16141
+ .lv-host button.lv-hbtn:disabled { opacity: .45; cursor: default; }\r
16142
+ \r
16143
+ /* tool card and turn tail: no fill, no border */\r
16144
+ .lv-host.lv-htool, .lv-host.lv-hresult { display: grid; gap: 2px; margin: 2px 0 8px; }\r
16145
+ .lv-host .lv-hexpand { display: grid; gap: 8px; margin: 4px 0; padding: 10px 12px; border: .5px solid var(--lvh-line-2); border-radius: var(--lvh-radius-md); }\r
16146
+ .lv-host .lv-hexpand textarea { width: 100%; min-height: 64px; resize: vertical; padding: 8px; border: .5px solid var(--lvh-line-2); border-radius: var(--lvh-radius-sm);\r
16147
+ background: var(--lvh-field); color: var(--lvh-ink); font: inherit; font-size: 13px; line-height: 1.6; }\r
16148
+ .lv-host .lv-hexpand label { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13px; color: var(--lvh-ink-2); }\r
16149
+ .lv-host .lv-hhint { font-size: 12px; color: var(--lvh-ink-3); }\r
16150
+ .lv-host .lv-halert { font-size: 12px; color: var(--lvh-error); }\r
16151
+ \r
16152
+ /* Dock: the geometry of the host's own QueueDock (dsh-client-ui-conversation),\r
16153
+ attached to the top of the composer card. */\r
16154
+ .lv-host.lv-hdock {\r
16155
+ flex: none;\r
16156
+ width: calc(100% - var(--dsh-composer-side-clearance, 0px) - var(--dsh-composer-side-clearance, 0px) - var(--dsh-composer-dock-inset, 12px) - var(--dsh-composer-dock-inset, 12px));\r
16157
+ max-width: calc(var(--dsh-composer-card-max-width, 100%) - var(--dsh-composer-dock-inset, 12px) - var(--dsh-composer-dock-inset, 12px));\r
16158
+ margin: 0 auto calc(0px - var(--dsh-composer-stack-gap, 0px) - 3px);\r
16159
+ padding: 0 var(--dsh-composer-dock-inset, 0px);\r
16160
+ }\r
16161
+ .lv-host .lv-hdock-panel { position: relative; isolation: isolate; overflow: hidden; width: 100%; padding: 2px 0 5px; border-radius: var(--lvh-radius-lg) var(--lvh-radius-lg) 0 0; }\r
16162
+ .lv-host .lv-hdock-panel::before { content: ''; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: var(--lvh-menu);\r
16163
+ backdrop-filter: var(--dsw-menu-backdrop-filter, blur(20px)); pointer-events: none; }\r
16164
+ .lv-host .lv-hdock-panel::after { content: ''; position: absolute; inset: 0; border: .5px solid var(--lvh-line); border-bottom: none; border-radius: inherit; pointer-events: none; }\r
16165
+ .lv-host .lv-hdock-head { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 6px 4px 12px; }\r
16166
+ .lv-host .lv-hdock-count { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 13px; font-weight: 500; line-height: 24px; text-overflow: ellipsis; white-space: nowrap; }\r
16167
+ .lv-host .lv-hdock-count .lv-hmeta { font-weight: 400; }\r
16168
+ .lv-host .lv-hdock-body { max-height: 240px; overflow-y: auto; }\r
16169
+ .lv-host .lv-hdock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 36px; padding: 4px 6px 4px 12px; font-size: 13px; box-shadow: inset 0 1px 0 var(--lvh-line); }\r
16170
+ .lv-host .lv-hdock-row > .lv-hexpand { flex: 1 1 100%; }\r
16171
+ .lv-host .lv-hprogress { height: 2px; margin-top: 4px; overflow: hidden; border-radius: 2px; background: var(--lvh-line-2); }\r
16172
+ .lv-host .lv-hprogress > i { display: block; height: 100%; background: var(--lvh-accent); }\r
16173
+ \r
16174
+ /* mini capsule (floats over the host frame) */\r
16175
+ .lv-host.lv-mini-anchor { position: fixed; right: .9rem; bottom: .9rem; z-index: 12; width: min(24rem, calc(100% - 1.8rem)); display: flex; justify-content: flex-end; }\r
16176
+ .lv-host .lv-mini-capsule { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 40px; padding: 0 6px; border: .5px solid var(--lvh-line-2); border-radius: 999px;\r
16177
+ background: var(--lvh-menu); backdrop-filter: var(--dsw-menu-backdrop-filter, blur(20px)); box-shadow: 0 4px 16px rgba(0, 0, 0, .08); font-size: 13px; }\r
16178
+ .lv-host .lv-mini-capsule span { min-width: 0; overflow: hidden; color: var(--lvh-ink-2); text-overflow: ellipsis; white-space: nowrap; }\r
16179
+ .lv-host .lv-mini-capsule button.lv-hplay { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;\r
16180
+ background: var(--lvh-strong); color: var(--lvh-on-strong); cursor: pointer; }\r
16181
+ .lv-host .lv-mini-capsule button.lv-hplay:disabled { opacity: .45; cursor: default; }\r
16182
+ .lv-host .lv-mini-capsule .lv-role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lv-role-color, var(--lvh-ink-3)); flex: none; }\r
16183
+ .lv-host button.lv-hbtn.lv-hclose { padding: 0 6px; color: var(--lvh-ink-3); }\r
16184
+ .lv-host .lv-mini-capsule button.lv-hclose { flex: none; border-radius: 50%; }\r
16185
+ \r
16186
+ /* "\u5BF9\u8BDD\u7247\u6BB5" in a result line: a quiet link to the conversation audio list. */\r
16187
+ .lv-host button.lv-hlink { display: inline; height: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }\r
16188
+ .lv-host button.lv-hlink:hover { color: var(--lvh-ink); }\r
16189
+ \r
16190
+ /* The message "read aloud" button: icon only, like the host's copy button. */\r
16191
+ .lv-host.lv-hspeak { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }\r
16192
+ .lv-host button.lv-hbtn.lv-hicon { width: 28px; padding: 0; justify-content: center; }\r
16193
+ .lv-host .lv-hspinning svg { animation: lv-hspin 0.9s linear infinite; }\r
16194
+ @keyframes lv-hspin { to { transform: rotate(360deg); } }\r
16195
+ @media (prefers-reduced-motion: reduce) { .lv-host .lv-hspinning svg { animation: none; } }\r
16196
+ \r
16197
+ /* The chapter list of a production batch. */\r
16198
+ .lv-host .lv-hlist { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--lvh-ink-2); }\r
15997
16199
  `;
15998
16200
 
15999
16201
  // src/client/index.jsx
@@ -16061,6 +16263,7 @@ function apply(ctx) {
16061
16263
  }
16062
16264
  const isPanelActive = () => ctx.layout.panelInfo.getSnapshot().activePanelId === PANEL;
16063
16265
  let chatDock = memory.settings?.values?.chatDock ?? "auto";
16266
+ let miniCapsule = memory.settings?.values?.miniCapsule ?? "auto";
16064
16267
  const prefListeners = /* @__PURE__ */ new Set();
16065
16268
  const dockPrefs = {
16066
16269
  subscribe(listener) {
@@ -16069,10 +16272,19 @@ function apply(ctx) {
16069
16272
  },
16070
16273
  getSnapshot: () => chatDock
16071
16274
  };
16275
+ const capsulePrefs = {
16276
+ subscribe(listener) {
16277
+ prefListeners.add(listener);
16278
+ return () => prefListeners.delete(listener);
16279
+ },
16280
+ getSnapshot: () => miniCapsule
16281
+ };
16072
16282
  function readPrefs(values) {
16073
- const next = values?.chatDock ?? "auto";
16074
- if (next === chatDock) return;
16075
- chatDock = next;
16283
+ const nextDock = values?.chatDock ?? "auto";
16284
+ const nextCapsule = values?.miniCapsule ?? "auto";
16285
+ if (nextDock === chatDock && nextCapsule === miniCapsule) return;
16286
+ chatDock = nextDock;
16287
+ miniCapsule = nextCapsule;
16076
16288
  for (const item of prefListeners) item();
16077
16289
  }
16078
16290
  const dismissed = /* @__PURE__ */ new Map();
@@ -16082,25 +16294,7 @@ function apply(ctx) {
16082
16294
  dismissed.set(session, new Set(keys));
16083
16295
  }
16084
16296
  };
16085
- let capsuleNotice = null;
16086
- let capsuleTimer;
16087
- const capsuleListeners = /* @__PURE__ */ new Set();
16088
- const capsule = {
16089
- subscribe(listener) {
16090
- capsuleListeners.add(listener);
16091
- return () => capsuleListeners.delete(listener);
16092
- },
16093
- getSnapshot: () => capsuleNotice,
16094
- show(message) {
16095
- clearTimeout(capsuleTimer);
16096
- capsuleNotice = message;
16097
- for (const item of capsuleListeners) item();
16098
- capsuleTimer = setTimeout(() => {
16099
- capsuleNotice = null;
16100
- for (const item of capsuleListeners) item();
16101
- }, 6e3);
16102
- }
16103
- };
16297
+ const capsule = createCapsuleState();
16104
16298
  ctx.effect(() => {
16105
16299
  const off = player.onEnded(async ({ nextId }) => {
16106
16300
  if (isPanelActive() || !nextId) return;
@@ -16117,10 +16311,7 @@ function apply(ctx) {
16117
16311
  capsule.show(deferText(() => translate("\u4E0B\u4E00\u7AE0\u8FD8\u6CA1\u6709\u97F3\u9891")));
16118
16312
  }
16119
16313
  });
16120
- return () => {
16121
- off();
16122
- clearTimeout(capsuleTimer);
16123
- };
16314
+ return () => off();
16124
16315
  });
16125
16316
  ctx.effect(() => {
16126
16317
  const controller = new AbortController();
@@ -16173,9 +16364,26 @@ function apply(ctx) {
16173
16364
  void tick();
16174
16365
  const flush = () => player.flush();
16175
16366
  window.addEventListener("pagehide", flush);
16367
+ let lastPhase = player.getSnapshot().phase;
16368
+ const offPlayer = player.subscribe(() => {
16369
+ const phase = player.getSnapshot().phase;
16370
+ if (phase === lastPhase) return;
16371
+ lastPhase = phase;
16372
+ if (phase === "playing" || phase === "buffering") capsule.wake();
16373
+ });
16374
+ let lastResume = speech.getSnapshot().resume;
16375
+ const offSpeech = speech.subscribe(() => {
16376
+ const resume = speech.getSnapshot().resume;
16377
+ if (resume === lastResume) return;
16378
+ lastResume = resume;
16379
+ if (resume) capsule.wake();
16380
+ });
16176
16381
  return () => {
16177
16382
  clearTimeout(timer);
16178
16383
  shutdown.abort();
16384
+ offPlayer();
16385
+ offSpeech();
16386
+ capsule.dispose();
16179
16387
  if (typeof document !== "undefined") document.removeEventListener("visibilitychange", wake);
16180
16388
  window.removeEventListener("pagehide", flush);
16181
16389
  style.remove();
@@ -16200,8 +16408,9 @@ function apply(ctx) {
16200
16408
  const openSnippets = () => navigate({ snippets: true });
16201
16409
  function MiniPlayer() {
16202
16410
  const layout = (0, import_react57.useSyncExternalStore)(ctx.layout.panelInfo.subscribe.bind(ctx.layout.panelInfo), ctx.layout.panelInfo.getSnapshot.bind(ctx.layout.panelInfo));
16203
- const notice = (0, import_react57.useSyncExternalStore)(capsule.subscribe, capsule.getSnapshot);
16204
- return layout.activePanelId === PANEL ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "lv-host lv-mini-anchor", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MiniCapsule, { player, notice, open: openChapter, speech }) });
16411
+ const capsuleState = (0, import_react57.useSyncExternalStore)(capsule.subscribe, capsule.getSnapshot);
16412
+ const capsuleMode = (0, import_react57.useSyncExternalStore)(capsulePrefs.subscribe, capsulePrefs.getSnapshot);
16413
+ return layout.activePanelId === PANEL ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "lv-host lv-mini-anchor", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MiniCapsule, { player, notice: capsuleState.notice, dismissed: capsuleState.dismissed, dismiss: capsule.dismiss, mode: capsuleMode, open: openChapter, speech }) });
16205
16414
  }
16206
16415
  function DockSlot({ sessionKey, sessionId }) {
16207
16416
  const session = sessionKey ?? sessionId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-laivox-tts",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "private": false,
5
5
  "description": "把 TXT、EPUB、PDF 小说做成单人朗读或多角色有声书,也能一键朗读对话里的 AI 回答,支持本地书架与 MP3/WAV 导出。",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@ export const MAX_RESUBMITS = 2
12
12
  export const emotions = ['neutral', 'happy', 'sad', 'angry', 'afraid', 'tense', 'gentle']
13
13
  export const narrator = { id: 'narrator', name: '旁白', gender: '', voices: {} }
14
14
  export const roleNameKey = name => name.normalize('NFKC').trim().toLowerCase()
15
- export const defaultSettings = { theme: 'system', skin: 'paper', paragraphPause: true, engine: 'edge', mode: 'reading', clean: false, selection: null, autoContinue: true, audioLimit: 2 * 1024 ** 3, chatDock: 'auto', snippetRetention: '7d', laivoxNarratorDefault: LAIVOX_DEFAULT_NARRATOR,
15
+ export const defaultSettings = { theme: 'system', skin: 'paper', paragraphPause: true, engine: 'edge', mode: 'reading', clean: false, selection: null, autoContinue: true, audioLimit: 2 * 1024 ** 3, chatDock: 'auto', miniCapsule: 'auto', snippetRetention: '7d', laivoxNarratorDefault: LAIVOX_DEFAULT_NARRATOR,
16
16
  // Voices for instant speech, by the language of the text.
17
17
  speechVoices: { 'zh-CN': 'zh-CN-XiaoxiaoNeural', 'zh-TW': 'zh-TW-HsiaoChenNeural', en: 'en-US-AriaNeural' } }
18
18
 
@@ -88,6 +88,7 @@ export function createProductionService(library, gatewayFor) {
88
88
  (key === 'clean' && typeof value !== 'boolean') ||
89
89
  (key === 'autoContinue' && typeof value !== 'boolean') ||
90
90
  (key === 'chatDock' && !['auto', 'active', 'never'].includes(value)) ||
91
+ (key === 'miniCapsule' && !['auto', 'playing', 'never'].includes(value)) ||
91
92
  (key === 'snippetRetention' && !['1d', '7d', '30d', 'never'].includes(value)) ||
92
93
  (key === 'speechVoices' && !validSpeechVoices(value)) ||
93
94
  (key === 'laivoxNarratorDefault' && !narratorDefaultShape(value)) ||