dsh-pdf-workbench 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +192 -163
- package/client.js +911 -223
- package/docs/RELEASE.md +110 -0
- package/icon.svg +6 -6
- package/index.js +18 -0
- package/package.json +1 -1
- package/screenshots.json +8 -8
- package/src/client/viewer.js +80 -80
- package/src/host/libraries.js +9 -12
- package/src/host/links.js +1 -1
- package/src/host/pending.js +1 -1
- package/src/host/routes.js +58 -12
- package/tools/AGENTS.md +33 -33
- package/tools/README.md +138 -138
- package/tools/auto_chapters.py +122 -122
- package/tools/dsfile.mjs +198 -198
- package/tools/export_chapter.py +108 -108
- package/tools/export_page.py +91 -91
- package/tools/md2overlay.py +200 -200
- package/tools/md2tex.py +422 -422
- package/tools/pdf_blocks.py +110 -110
- package/tools/pdf_fontsize.py +20 -20
- package/tools/pdf_merge.py +15 -15
- package/tools/pdf_pagesizes.py +8 -8
- package/tools/pdf_raster.py +21 -21
- package/tools/pdfkit.py +896 -896
- package/tools/realign_overlay.py +248 -248
- package/tools/rebuild_overlay.py +55 -55
- package/tools/rename_chapters.py +93 -93
- package/tools//350/247/204/350/214/203/00_/345/205/261/345/220/214/347/272/246/345/256/232.md +142 -142
- package/tools//350/247/204/350/214/203/01_/346/226/207/346/234/254/346/217/220/345/217/226.md +204 -204
- package/tools//350/247/204/350/214/203/02_/347/255/224/347/226/221.md +61 -61
- package/tools//350/247/204/350/214/203/03_/344/271/240/351/242/230/350/247/243/347/255/224.md +77 -77
- package/tools//350/247/204/350/214/203/api/346/217/220/347/244/272/350/257/215_/346/217/220/345/217/226.md +11 -11
- package/vendor/cmaps/LICENSE.txt +36 -36
- package/vendor/fonts/excalifont/OFL.txt +98 -98
- package/vendor/fonts/zhhand/OFL.txt +99 -99
- package/vendor/pdf.min.mjs +28 -28
- package/vendor/pdf.worker.min.mjs +28 -28
- package/vendor/pdfjs-LICENSE.txt +177 -177
- package/vendor/rough/LICENSE +21 -21
- package/vendor/rough/rough.mjs +1 -1
- package/vendor/wasm/LICENSE_JBIG2 +196 -196
- package/vendor/wasm/LICENSE_OPENJPEG +39 -39
- package/vendor/wasm/LICENSE_PDFJS_JBIG2 +13 -13
- package/vendor/wasm/LICENSE_PDFJS_OPENJPEG +22 -22
- package/vendor/wasm/LICENSE_PDFJS_QCMS +19 -19
- package/vendor/wasm/LICENSE_QCMS +21 -21
- package/vendor/wasm/jbig2_nowasm_fallback.js +15 -15
- package/vendor/wasm/openjpeg_nowasm_fallback.js +17 -17
- package//345/256/211/350/243/205/344/270/216/345/210/206/345/217/221.md +2 -2
package/client.js
CHANGED
|
@@ -32,11 +32,135 @@ window.__ModuleLoader__.load({
|
|
|
32
32
|
|
|
33
33
|
/** Session modes, in the order the chapter shows them. */
|
|
34
34
|
const MODES = ['extract', 'qa', 'exercise']
|
|
35
|
+
/** The always-available, purpose-free session type. */
|
|
36
|
+
const GENERAL_MODE = 'general'
|
|
37
|
+
const ALL_MODES = [GENERAL_MODE, ...MODES]
|
|
38
|
+
/** Types shown in the session panel; general is always present. */
|
|
39
|
+
const SESSION_TYPES = Object.freeze([
|
|
40
|
+
{ id: GENERAL_MODE, workflow: '' },
|
|
41
|
+
{ id: 'extract', workflow: 'math' },
|
|
42
|
+
{ id: 'qa', workflow: 'math' },
|
|
43
|
+
{ id: 'exercise', workflow: 'math' },
|
|
44
|
+
])
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Session types available for one workflow.
|
|
48
|
+
* @param {string} workflow - active workflow id, or '' for general.
|
|
49
|
+
* @returns {string[]} type ids.
|
|
50
|
+
*/
|
|
51
|
+
function sessionModesFor(workflow) {
|
|
52
|
+
return SESSION_TYPES.filter(item => item.workflow === '' || item.workflow === workflow).map(item => item.id)
|
|
53
|
+
}
|
|
35
54
|
|
|
36
55
|
/** The mode word written into a session title (data, not UI copy). */
|
|
37
|
-
const TITLE_MODE = { extract: '提取', qa: '答疑', exercise: '习题' }
|
|
56
|
+
const TITLE_MODE = { general: '会话', extract: '提取', qa: '答疑', exercise: '习题' }
|
|
38
57
|
const GITHUB_URL = 'https://github.com/minggemofashi/dsh-pdf-workbench'
|
|
39
58
|
const TEXLIVE_URL = 'https://tug.org/texlive/acquire.html'
|
|
59
|
+
const PYTHON_URL = 'https://www.python.org/downloads/windows/'
|
|
60
|
+
|
|
61
|
+
/** Optional workflows; general is the always-on base and has no entry here. */
|
|
62
|
+
const WORKFLOWS = Object.freeze([
|
|
63
|
+
{ id: 'math', labelKey: 'workflowMath', descKey: 'workflowMathDesc' },
|
|
64
|
+
])
|
|
65
|
+
const WORKFLOW_STORAGE = 'pdfdesk:workflow'
|
|
66
|
+
const WORKFLOW_EVENT = 'pdfdesk:workflow'
|
|
67
|
+
const WORKSPACE_STORAGE = 'pdfdesk:workspace:'
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The workspace the user explicitly chose for one library, if any.
|
|
71
|
+
* @param {string} libraryId - library id.
|
|
72
|
+
* @returns {{ workspaceId: string, cwd: string } | null} the stored target.
|
|
73
|
+
*/
|
|
74
|
+
function readStoredWorkspace(libraryId) {
|
|
75
|
+
if (typeof libraryId !== 'string' || libraryId === '') return null
|
|
76
|
+
try {
|
|
77
|
+
const raw = window.localStorage.getItem(`${WORKSPACE_STORAGE}${libraryId}`)
|
|
78
|
+
if (raw === null || raw === '') return null
|
|
79
|
+
const parsed = JSON.parse(raw)
|
|
80
|
+
if (parsed === null || typeof parsed !== 'object') return null
|
|
81
|
+
if (typeof parsed.workspaceId !== 'string' || parsed.workspaceId === '') return null
|
|
82
|
+
return { workspaceId: parsed.workspaceId, cwd: typeof parsed.cwd === 'string' ? parsed.cwd : '' }
|
|
83
|
+
} catch {
|
|
84
|
+
return null
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Remember an explicit workspace choice across reloads.
|
|
90
|
+
* @param {string} libraryId - library id.
|
|
91
|
+
* @param {{ workspaceId: string, cwd: string }} target - chosen workspace.
|
|
92
|
+
* @returns {void}
|
|
93
|
+
*/
|
|
94
|
+
function writeStoredWorkspace(libraryId, target) {
|
|
95
|
+
if (typeof libraryId !== 'string' || libraryId === '') return
|
|
96
|
+
try {
|
|
97
|
+
window.localStorage.setItem(`${WORKSPACE_STORAGE}${libraryId}`, JSON.stringify(target))
|
|
98
|
+
} catch {
|
|
99
|
+
// storage unavailable
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Forget a workspace choice (library removed or workspace gone).
|
|
105
|
+
* @param {string} libraryId - library id.
|
|
106
|
+
* @returns {void}
|
|
107
|
+
*/
|
|
108
|
+
function clearStoredWorkspace(libraryId) {
|
|
109
|
+
if (typeof libraryId !== 'string' || libraryId === '') return
|
|
110
|
+
try {
|
|
111
|
+
window.localStorage.removeItem(`${WORKSPACE_STORAGE}${libraryId}`)
|
|
112
|
+
} catch {
|
|
113
|
+
// storage unavailable
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The one optional workflow that is enabled, or '' for general mode.
|
|
119
|
+
* @returns {string} a workflow id or ''.
|
|
120
|
+
*/
|
|
121
|
+
function readWorkflowMode() {
|
|
122
|
+
try {
|
|
123
|
+
const value = window.localStorage.getItem(WORKFLOW_STORAGE)
|
|
124
|
+
return WORKFLOWS.some(item => item.id === value) ? value : ''
|
|
125
|
+
} catch {
|
|
126
|
+
return ''
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Persist one workflow id and notify the other mounted halves.
|
|
132
|
+
* @param {string} value - workflow id, or '' for general.
|
|
133
|
+
* @returns {void}
|
|
134
|
+
*/
|
|
135
|
+
function writeWorkflowMode(value) {
|
|
136
|
+
const next = WORKFLOWS.some(item => item.id === value) ? value : ''
|
|
137
|
+
try {
|
|
138
|
+
if (next === '') window.localStorage.removeItem(WORKFLOW_STORAGE)
|
|
139
|
+
else window.localStorage.setItem(WORKFLOW_STORAGE, next)
|
|
140
|
+
} catch {
|
|
141
|
+
// storage unavailable: keep the in-memory switch
|
|
142
|
+
}
|
|
143
|
+
if (typeof window.dispatchEvent === 'function') window.dispatchEvent(new Event(WORKFLOW_EVENT))
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Follow the active workflow across the page and the side preview.
|
|
148
|
+
* @returns {string} the active workflow id, or '' for general.
|
|
149
|
+
*/
|
|
150
|
+
function useWorkflowMode() {
|
|
151
|
+
const [value, setValue] = React.useState(readWorkflowMode)
|
|
152
|
+
React.useEffect(() => {
|
|
153
|
+
const sync = () => setValue(readWorkflowMode())
|
|
154
|
+
if (typeof window.addEventListener !== 'function') return undefined
|
|
155
|
+
window.addEventListener(WORKFLOW_EVENT, sync)
|
|
156
|
+
window.addEventListener('storage', sync)
|
|
157
|
+
return () => {
|
|
158
|
+
window.removeEventListener(WORKFLOW_EVENT, sync)
|
|
159
|
+
window.removeEventListener('storage', sync)
|
|
160
|
+
}
|
|
161
|
+
}, [])
|
|
162
|
+
return value
|
|
163
|
+
}
|
|
40
164
|
|
|
41
165
|
/**
|
|
42
166
|
* Last page read for one chapter, so leaving the reader does not reset it.
|
|
@@ -74,9 +198,11 @@ window.__ModuleLoader__.load({
|
|
|
74
198
|
|
|
75
199
|
/** Mode word (Chinese canonical, English alias) → mode key; tolerant of a suffix such as `答疑(续)`. */
|
|
76
200
|
const MODE_OF = [
|
|
201
|
+
['会话', 'general'],
|
|
77
202
|
['提取', 'extract'],
|
|
78
203
|
['答疑', 'qa'],
|
|
79
204
|
['习题', 'exercise'],
|
|
205
|
+
['general', 'general'],
|
|
80
206
|
['extract', 'extract'],
|
|
81
207
|
['qa', 'qa'],
|
|
82
208
|
['exercise', 'exercise'],
|
|
@@ -138,7 +264,7 @@ window.__ModuleLoader__.load({
|
|
|
138
264
|
manualNaming2: '一章一个 PDF,保留目录;文件名带页码范围或 cNN 即可,工作台自动编号。',
|
|
139
265
|
manualNaming3: '不想拆:整本 PDF 放进 整本\\,会作为只有一章的一本书。',
|
|
140
266
|
manualSessionLine: '会话按「书 / 章 / 模式」归档,已有会话也可以导入。',
|
|
141
|
-
manualEnvLead: 'Markdown 转 PDF 需要 Python 3 + TeX(xelatex、ctex
|
|
267
|
+
manualEnvLead: 'Markdown 转 PDF 需要 Python 3 + TeX(xelatex、ctex);翻译还需要 DeepSeek API Key。没装时对应按钮会给出说明和下载入口,阅读、会话和预览不受影响。',
|
|
142
268
|
aiPromptTitle: '给 AI 的拆分提示词',
|
|
143
269
|
manualStructureTitle: '书库结构',
|
|
144
270
|
manualNamingTitle: '拆分与命名',
|
|
@@ -327,6 +453,14 @@ window.__ModuleLoader__.load({
|
|
|
327
453
|
translateCancel: '取消翻译',
|
|
328
454
|
translateResume: '补译缺失页',
|
|
329
455
|
translateResumeHint: '只译还没有缓存的页,按缺失页数花 token',
|
|
456
|
+
translateNeedsEnv: '翻译需要 Python + TeX,并先在 设置 → 环境 配置 DeepSeek API Key。',
|
|
457
|
+
exportNeedsPython: '导出需要 Python;请先安装,并在 设置 → 环境 查看状态。',
|
|
458
|
+
generalSession: '会话',
|
|
459
|
+
generalSessionHint: '新建一个只带书籍地址的通用会话,不预设用途',
|
|
460
|
+
generalSeedBook: '书籍',
|
|
461
|
+
generalSeedLibrary: '书库',
|
|
462
|
+
generalSeedBookDir: '书目录',
|
|
463
|
+
generalSeedPdf: '当前 PDF',
|
|
330
464
|
translatingResume: '正在补译缺失页…',
|
|
331
465
|
translateCancelled: '翻译已取消',
|
|
332
466
|
translateOverwriteConfirm: '这一章已经有译文,重新翻译会覆盖它。继续吗?',
|
|
@@ -350,6 +484,7 @@ window.__ModuleLoader__.load({
|
|
|
350
484
|
readerNewHint: '接着本章该分组的会话;快满时另起续会话;右侧同时开 PDF',
|
|
351
485
|
readerInSessionFailed: '会话建好了,但右侧 PDF 没打开(可能不在库工作区)',
|
|
352
486
|
sessionsTitle: '会话',
|
|
487
|
+
sessionsNoModes: '通用模式没有预设会话类型;用工具栏「会话」开始一个只带书籍地址的会话。',
|
|
353
488
|
newSession: '新建',
|
|
354
489
|
newSessionOf: '新建{mode}会话',
|
|
355
490
|
newSessionHint: '优先接着本章该分组的会话,快满时另起续会话',
|
|
@@ -441,6 +576,7 @@ window.__ModuleLoader__.load({
|
|
|
441
576
|
railRight: '右',
|
|
442
577
|
sketchRoughness: '手绘强度',
|
|
443
578
|
settingsTabReading: '阅读',
|
|
579
|
+
settingsTabWorkflow: '模式',
|
|
444
580
|
settingsTabKeys: '快捷键',
|
|
445
581
|
settingsTabEnv: '环境',
|
|
446
582
|
settingsTabAbout: '关于',
|
|
@@ -463,8 +599,41 @@ window.__ModuleLoader__.load({
|
|
|
463
599
|
apiKeyConfigured: '已配置',
|
|
464
600
|
apiKeyMissing: '未配置',
|
|
465
601
|
apiKeySave: '保存',
|
|
466
|
-
envReady: '已就绪:md
|
|
467
|
-
envMissing: '
|
|
602
|
+
envReady: '已就绪:md→PDF、翻译和导出可用',
|
|
603
|
+
envMissing: '缺少 Python / TeX:md→PDF、翻译、导出会受限',
|
|
604
|
+
envImpact: '缺少 Python:md→PDF、翻译、导出不可用;缺少 TeX:md→PDF、翻译译文合成不可用;翻译还需要 API Key。',
|
|
605
|
+
envPromptTitle: '需要环境',
|
|
606
|
+
envNeedPython: 'Python 3',
|
|
607
|
+
envNeedTex: 'TeX Live(xelatex、ctex)',
|
|
608
|
+
envNeedKey: 'DeepSeek API Key',
|
|
609
|
+
envUseRender: 'Markdown 转 PDF',
|
|
610
|
+
envUseTranslate: '整章翻译与译文合成',
|
|
611
|
+
envUseExport: '导出本页 / 整章',
|
|
612
|
+
envPromptBody: '需要 {needs},用于 {use}。',
|
|
613
|
+
envPromptBack: '返回',
|
|
614
|
+
envPromptDownloadPython: '下载 Python',
|
|
615
|
+
envPromptDownloadTex: '下载 TeX Live',
|
|
616
|
+
envPromptKey: '配置 API Key',
|
|
617
|
+
workflowTitle: '工作流',
|
|
618
|
+
workflowHint: '通用始终加载,不能被选择;点一个模式开启,再点当前模式退出。以后有多个模式时,点另一个会直接切换。',
|
|
619
|
+
workflowGeneral: '通用',
|
|
620
|
+
workflowGeneralDesc: '阅读、标注、翻译与通用工具;不需要选择,始终作为基础。',
|
|
621
|
+
workflowGeneralAlways: '始终启用',
|
|
622
|
+
workflowMath: '数学',
|
|
623
|
+
workflowMathDesc: '提取 / 答疑 / 习题三种会话、数学提示词与 LaTeX 模板。',
|
|
624
|
+
workflowOnlyOne: '同一时间只能启用一个模式;以后会增加其它工作流,结构已经按单选写好。',
|
|
625
|
+
workflowActiveHint: '已启用;再次点击这张卡片即可退出到通用。',
|
|
626
|
+
workspaceTitle: '需要工作区',
|
|
627
|
+
workspaceBody: '会话需要一个工作区来存放。工作区只保存对话,不会移动、复制或删除书库文件。',
|
|
628
|
+
workspaceSelect: '选择已有工作区',
|
|
629
|
+
workspaceEmpty: '还没有工作区',
|
|
630
|
+
workspaceNew: '为书库目录新建工作区',
|
|
631
|
+
workspacePath: '工作区目录',
|
|
632
|
+
workspaceCreate: '创建并继续',
|
|
633
|
+
workspaceCancel: '取消',
|
|
634
|
+
workspaceUnavailable: '当前 DSH 不支持从插件创建工作区;请先在 DSH 的工作区页新建,再回来重试。',
|
|
635
|
+
workspaceCreateFailed: '创建工作区失败',
|
|
636
|
+
workspaceRequired: '请先选择或新建一个工作区,再开始会话。',
|
|
468
637
|
envDownload: '下载 TeX Live(约 5 GB)',
|
|
469
638
|
envHint: '需要 TeX Live(xelatex、ctex)与 Python 3;装好后把 TeX 的 bin 加进 PATH 并重启 DSH',
|
|
470
639
|
updateChecking: '检查中…',
|
|
@@ -501,6 +670,7 @@ window.__ModuleLoader__.load({
|
|
|
501
670
|
sessionTarget: '会话建在:{dir}',
|
|
502
671
|
titleLegend: '书 id(会话标题与产物目录共用):{pairs}',
|
|
503
672
|
running: '运行中',
|
|
673
|
+
'mode.general': '通用',
|
|
504
674
|
'mode.extract': '提取',
|
|
505
675
|
'mode.qa': '答疑',
|
|
506
676
|
'mode.exercise': '习题',
|
|
@@ -627,7 +797,7 @@ window.__ModuleLoader__.load({
|
|
|
627
797
|
manualNaming2: 'One PDF per chapter, keep the contents; a page range or cNN in the file name is enough, the workbench numbers it.',
|
|
628
798
|
manualNaming3: 'Do not want to split? Put a whole PDF under 整本\\ and it becomes a one-chapter book.',
|
|
629
799
|
manualSessionLine: 'Conversations are filed by book / chapter / mode, and existing ones can be imported.',
|
|
630
|
-
manualEnvLead: 'Markdown-to-PDF needs Python 3 + TeX (xelatex, ctex). Without
|
|
800
|
+
manualEnvLead: 'Markdown-to-PDF needs Python 3 + TeX (xelatex, ctex); translation also needs a DeepSeek API key. Without them the matching buttons explain what to install and offer downloads; reading, conversations and preview still work.',
|
|
631
801
|
aiPromptTitle: 'Prompt for an AI splitter',
|
|
632
802
|
manualStructureTitle: 'Library structure',
|
|
633
803
|
manualNamingTitle: 'Splitting and naming',
|
|
@@ -815,6 +985,14 @@ window.__ModuleLoader__.load({
|
|
|
815
985
|
translateCancel: 'Cancel translation',
|
|
816
986
|
translateResume: 'Fill missing pages',
|
|
817
987
|
translateResumeHint: 'Translate only the pages without cached text; pages that already have one are reused, so only the missing pages cost tokens',
|
|
988
|
+
translateNeedsEnv: 'Translation needs Python + TeX and a DeepSeek API key in Settings → Environment.',
|
|
989
|
+
exportNeedsPython: 'Export needs Python; install it and check Settings → Environment.',
|
|
990
|
+
generalSession: 'Session',
|
|
991
|
+
generalSessionHint: 'Start a general conversation that only carries the book address, with no preset purpose',
|
|
992
|
+
generalSeedBook: 'Book',
|
|
993
|
+
generalSeedLibrary: 'Library',
|
|
994
|
+
generalSeedBookDir: 'Book folder',
|
|
995
|
+
generalSeedPdf: 'Current PDF',
|
|
818
996
|
translatingResume: 'Filling in the missing pages…',
|
|
819
997
|
translateCancelled: 'Translation cancelled',
|
|
820
998
|
translateOverwriteConfirm: 'This chapter already has a translation; translating again overwrites it. Continue?',
|
|
@@ -838,6 +1016,7 @@ window.__ModuleLoader__.load({
|
|
|
838
1016
|
readerNewHint: 'Continues this chapter’s group conversation; starts a continuation when it fills up; opens the PDF on the right',
|
|
839
1017
|
readerInSessionFailed: 'The session was created, but the PDF could not open on its right side',
|
|
840
1018
|
sessionsTitle: 'Sessions',
|
|
1019
|
+
sessionsNoModes: 'General mode has no preset session types; use the toolbar’s Session button to start one that only carries the book address.',
|
|
841
1020
|
newSession: 'New',
|
|
842
1021
|
newSessionOf: 'New {mode} session',
|
|
843
1022
|
newSessionHint: 'Continues this chapter’s group conversation; starts a continuation when it fills up',
|
|
@@ -930,6 +1109,7 @@ window.__ModuleLoader__.load({
|
|
|
930
1109
|
railRight: 'Right',
|
|
931
1110
|
sketchRoughness: 'Sketch strength',
|
|
932
1111
|
settingsTabReading: 'Reading',
|
|
1112
|
+
settingsTabWorkflow: 'Modes',
|
|
933
1113
|
settingsTabKeys: 'Shortcuts',
|
|
934
1114
|
settingsTabEnv: 'Toolchain',
|
|
935
1115
|
settingsTabAbout: 'About',
|
|
@@ -952,8 +1132,41 @@ window.__ModuleLoader__.load({
|
|
|
952
1132
|
apiKeyConfigured: 'configured',
|
|
953
1133
|
apiKeyMissing: 'not configured',
|
|
954
1134
|
apiKeySave: 'Save',
|
|
955
|
-
envReady: 'ready: md
|
|
956
|
-
envMissing: 'missing: md-to-PDF
|
|
1135
|
+
envReady: 'ready: md-to-PDF, translation and export are available',
|
|
1136
|
+
envMissing: 'Python / TeX missing: md-to-PDF, translation and export are limited',
|
|
1137
|
+
envImpact: 'Without Python: md-to-PDF, translation and export are unavailable; without TeX: md-to-PDF and translation composition are unavailable; translation also needs an API key.',
|
|
1138
|
+
envPromptTitle: 'Environment required',
|
|
1139
|
+
envNeedPython: 'Python 3',
|
|
1140
|
+
envNeedTex: 'TeX Live (xelatex, ctex)',
|
|
1141
|
+
envNeedKey: 'DeepSeek API key',
|
|
1142
|
+
envUseRender: 'Markdown-to-PDF',
|
|
1143
|
+
envUseTranslate: 'whole-chapter translation and PDF composition',
|
|
1144
|
+
envUseExport: 'exporting a page or chapter',
|
|
1145
|
+
envPromptBody: 'Requires {needs}, used for {use}.',
|
|
1146
|
+
envPromptBack: 'Back',
|
|
1147
|
+
envPromptDownloadPython: 'Download Python',
|
|
1148
|
+
envPromptDownloadTex: 'Download TeX Live',
|
|
1149
|
+
envPromptKey: 'Configure API key',
|
|
1150
|
+
workflowTitle: 'Workflows',
|
|
1151
|
+
workflowHint: 'General is always loaded and cannot be selected; click a mode to enable it, and click the active mode again to return to General. With more modes, clicking another switches directly.',
|
|
1152
|
+
workflowGeneral: 'General',
|
|
1153
|
+
workflowGeneralDesc: 'Reading, annotations, translation and general tools; always on, no selection needed.',
|
|
1154
|
+
workflowGeneralAlways: 'Always on',
|
|
1155
|
+
workflowMath: 'Math',
|
|
1156
|
+
workflowMathDesc: 'Extract / Q&A / exercise sessions, math prompts and LaTeX templates.',
|
|
1157
|
+
workflowOnlyOne: 'Only one mode can be active at a time; the single-select structure is ready for more workflows.',
|
|
1158
|
+
workflowActiveHint: 'Enabled; click this card again to return to General.',
|
|
1159
|
+
workspaceTitle: 'Workspace required',
|
|
1160
|
+
workspaceBody: 'A conversation needs a workspace. The workspace stores conversations only; it never moves, copies or deletes library files.',
|
|
1161
|
+
workspaceSelect: 'Choose an existing workspace',
|
|
1162
|
+
workspaceEmpty: 'No workspaces yet',
|
|
1163
|
+
workspaceNew: 'Create a workspace for the library folder',
|
|
1164
|
+
workspacePath: 'Workspace folder',
|
|
1165
|
+
workspaceCreate: 'Create and continue',
|
|
1166
|
+
workspaceCancel: 'Cancel',
|
|
1167
|
+
workspaceUnavailable: 'This DSH cannot create a workspace from the plugin; create one on the DSH Workspaces page and retry.',
|
|
1168
|
+
workspaceCreateFailed: 'Could not create the workspace',
|
|
1169
|
+
workspaceRequired: 'Choose or create a workspace before starting a conversation.',
|
|
957
1170
|
envDownload: 'Download TeX Live (~5 GB)',
|
|
958
1171
|
envHint: 'Needs TeX Live (xelatex, ctex) and Python 3; add TeX bin to PATH and restart DSH',
|
|
959
1172
|
updateChecking: 'Checking…',
|
|
@@ -990,6 +1203,7 @@ window.__ModuleLoader__.load({
|
|
|
990
1203
|
sessionTarget: 'Sessions are created in: {dir}',
|
|
991
1204
|
titleLegend: 'Book ids (shared by session titles and produced-file folders): {pairs}',
|
|
992
1205
|
running: 'Running',
|
|
1206
|
+
'mode.general': 'General',
|
|
993
1207
|
'mode.extract': 'Extract',
|
|
994
1208
|
'mode.qa': 'Q&A',
|
|
995
1209
|
'mode.exercise': 'Exercises',
|
|
@@ -1591,7 +1805,7 @@ window.__ModuleLoader__.load({
|
|
|
1591
1805
|
return
|
|
1592
1806
|
}
|
|
1593
1807
|
const key = `${book.id}|${code}`
|
|
1594
|
-
const groups = byChapter.get(key) ?? { extract: [], qa: [], exercise: [] }
|
|
1808
|
+
const groups = byChapter.get(key) ?? { general: [], extract: [], qa: [], exercise: [] }
|
|
1595
1809
|
groups[mode].push(row)
|
|
1596
1810
|
byChapter.set(key, groups)
|
|
1597
1811
|
placed.add(marker(book.id, code, row.id))
|
|
@@ -1649,7 +1863,7 @@ window.__ModuleLoader__.load({
|
|
|
1649
1863
|
if (book === undefined || !Array.isArray(book.chapters)) continue
|
|
1650
1864
|
const chapter = book.chapters.find(item => item.code === entry.code)
|
|
1651
1865
|
if (chapter === undefined) continue
|
|
1652
|
-
if (!
|
|
1866
|
+
if (!ALL_MODES.includes(entry.mode)) continue
|
|
1653
1867
|
if (placed.has(marker(book.id, chapter.code, id))) continue
|
|
1654
1868
|
push(book, chapter.code, entry.mode, {
|
|
1655
1869
|
id,
|
|
@@ -1682,7 +1896,7 @@ window.__ModuleLoader__.load({
|
|
|
1682
1896
|
if (book === undefined || !Array.isArray(book.chapters)) continue
|
|
1683
1897
|
const chapter = book.chapters.find(item => item.code === entry.code)
|
|
1684
1898
|
if (chapter === undefined) continue
|
|
1685
|
-
if (!
|
|
1899
|
+
if (!ALL_MODES.includes(entry.mode)) continue
|
|
1686
1900
|
push(book, entry.code, entry.mode, {
|
|
1687
1901
|
id,
|
|
1688
1902
|
title: entry.title,
|
|
@@ -1697,7 +1911,7 @@ window.__ModuleLoader__.load({
|
|
|
1697
1911
|
seen.add(id)
|
|
1698
1912
|
}
|
|
1699
1913
|
for (const groups of byChapter.values()) {
|
|
1700
|
-
for (const mode of
|
|
1914
|
+
for (const mode of ALL_MODES) groups[mode].sort((left, right) => right.updatedAt - left.updatedAt)
|
|
1701
1915
|
}
|
|
1702
1916
|
return { byChapter, byArtifact, unresolved, loaded: true, pendingCount }
|
|
1703
1917
|
}
|
|
@@ -1709,7 +1923,7 @@ window.__ModuleLoader__.load({
|
|
|
1709
1923
|
*/
|
|
1710
1924
|
function sessionCount(groups) {
|
|
1711
1925
|
if (groups === undefined) return 0
|
|
1712
|
-
return
|
|
1926
|
+
return ALL_MODES.reduce((sum, mode) => sum + (Array.isArray(groups[mode]) ? groups[mode].length : 0), 0)
|
|
1713
1927
|
}
|
|
1714
1928
|
|
|
1715
1929
|
/**
|
|
@@ -1838,7 +2052,7 @@ window.__ModuleLoader__.load({
|
|
|
1838
2052
|
* @param {string} text - the outline Markdown.
|
|
1839
2053
|
* @returns {Promise<{ applied: boolean, reference: object | null }>} the result and the held retention.
|
|
1840
2054
|
*/
|
|
1841
|
-
async function beginPrefill(sessionId, text) {
|
|
2055
|
+
async function beginPrefill(sessionId, text, whenDraftExists = 'append') {
|
|
1842
2056
|
const sessions = sessionService()
|
|
1843
2057
|
const conversation = clientContext === null ? null : clientContext.get('conversation')
|
|
1844
2058
|
if (sessions === null || sessions === undefined || conversation === null || conversation === undefined) {
|
|
@@ -1854,9 +2068,9 @@ window.__ModuleLoader__.load({
|
|
|
1854
2068
|
const binding = await reference.ready
|
|
1855
2069
|
const result = conversation.input.requestDraftInitialization(binding, {
|
|
1856
2070
|
prompt: text,
|
|
1857
|
-
//
|
|
1858
|
-
//
|
|
1859
|
-
whenDraftExists
|
|
2071
|
+
// New sessions append, because a reused blank may hold the user's
|
|
2072
|
+
// draft; resuming uses keep so an existing draft is never duplicated.
|
|
2073
|
+
whenDraftExists,
|
|
1860
2074
|
})
|
|
1861
2075
|
return { applied: result === 'applied', reference }
|
|
1862
2076
|
} catch {
|
|
@@ -2718,11 +2932,146 @@ window.__ModuleLoader__.load({
|
|
|
2718
2932
|
* @param {{ version: string, envTools: object, previewPdf: boolean, allowNonPdfDelete: boolean, onPreview: Function, onNonPdf: Function, onClose: Function }} props - settings state and handlers.
|
|
2719
2933
|
* @returns {import('react').ReactElement} the dialog.
|
|
2720
2934
|
*/
|
|
2935
|
+
/**
|
|
2936
|
+
* Explain which environment a feature needs and offer the download links.
|
|
2937
|
+
* @param {{ kind: string, envTools: object, onClose: Function, onOpenSettings: Function }} props - feature kind and capabilities.
|
|
2938
|
+
* @returns {import('react').ReactElement} the dialog.
|
|
2939
|
+
*/
|
|
2940
|
+
function EnvPrompt(props) {
|
|
2941
|
+
const kind = props.kind
|
|
2942
|
+
const python = props.envTools === undefined || props.envTools.python !== true
|
|
2943
|
+
const tex = (kind === 'render' || kind === 'translate') && (props.envTools === undefined || props.envTools.tex !== true)
|
|
2944
|
+
const key = kind === 'translate' && (props.envTools === undefined || props.envTools.apiKey !== true)
|
|
2945
|
+
const needs = [
|
|
2946
|
+
python ? format('envNeedPython') : '',
|
|
2947
|
+
tex ? format('envNeedTex') : '',
|
|
2948
|
+
key ? format('envNeedKey') : '',
|
|
2949
|
+
].filter(Boolean)
|
|
2950
|
+
const useKey = kind === 'render' ? 'envUseRender' : kind === 'export' ? 'envUseExport' : 'envUseTranslate'
|
|
2951
|
+
const open = url => {
|
|
2952
|
+
try {
|
|
2953
|
+
window.open(url, '_blank', 'noopener')
|
|
2954
|
+
} catch {
|
|
2955
|
+
// popup blocked
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
return h('div', {
|
|
2959
|
+
className: 'md-env-backdrop',
|
|
2960
|
+
role: 'presentation',
|
|
2961
|
+
onClick: event => {
|
|
2962
|
+
if (event.target === event.currentTarget) props.onClose()
|
|
2963
|
+
},
|
|
2964
|
+
},
|
|
2965
|
+
h('div', {
|
|
2966
|
+
className: 'md-env-dialog', role: 'dialog', 'aria-modal': 'true',
|
|
2967
|
+
'aria-label': format('envPromptTitle'),
|
|
2968
|
+
},
|
|
2969
|
+
h('h3', { className: 'md-env-title' }, format('envPromptTitle')),
|
|
2970
|
+
h('p', { className: 'md-env-body' }, format('envPromptBody', {
|
|
2971
|
+
needs: needs.join(' + '),
|
|
2972
|
+
use: format(useKey),
|
|
2973
|
+
})),
|
|
2974
|
+
h('div', { className: 'md-env-actions' },
|
|
2975
|
+
h('button', { type: 'button', className: 'md-btn', onClick: props.onClose }, format('envPromptBack')),
|
|
2976
|
+
python ? h('button', {
|
|
2977
|
+
type: 'button', className: 'md-btn md-btn-small',
|
|
2978
|
+
onClick: () => open(PYTHON_URL),
|
|
2979
|
+
}, format('envPromptDownloadPython')) : null,
|
|
2980
|
+
tex ? h('button', {
|
|
2981
|
+
type: 'button', className: 'md-btn md-btn-small',
|
|
2982
|
+
onClick: () => open(TEXLIVE_URL),
|
|
2983
|
+
}, format('envPromptDownloadTex')) : null,
|
|
2984
|
+
key ? h('button', {
|
|
2985
|
+
type: 'button', className: 'md-btn md-btn-small',
|
|
2986
|
+
onClick: () => {
|
|
2987
|
+
if (typeof props.onOpenSettings === 'function') props.onOpenSettings()
|
|
2988
|
+
},
|
|
2989
|
+
}, format('envPromptKey')) : null
|
|
2990
|
+
)
|
|
2991
|
+
)
|
|
2992
|
+
)
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
/**
|
|
2996
|
+
* Ask the user which workspace should own the next conversation. General
|
|
2997
|
+
* mode never creates one silently.
|
|
2998
|
+
* @param {{ workspaces: object[], defaultPath: string, onPick: Function, onCreate: Function, onCancel: Function }} props - options and callbacks.
|
|
2999
|
+
* @returns {import('react').ReactElement} the dialog.
|
|
3000
|
+
*/
|
|
3001
|
+
function WorkspacePrompt(props) {
|
|
3002
|
+
const [path, setPath] = React.useState(props.defaultPath ?? '')
|
|
3003
|
+
const [busy, setBusy] = React.useState(false)
|
|
3004
|
+
const [error, setError] = React.useState('')
|
|
3005
|
+
const create = async () => {
|
|
3006
|
+
if (busy) return
|
|
3007
|
+
setBusy(true)
|
|
3008
|
+
setError('')
|
|
3009
|
+
try {
|
|
3010
|
+
await props.onCreate(path)
|
|
3011
|
+
} catch (reason) {
|
|
3012
|
+
setError(errorText(reason))
|
|
3013
|
+
} finally {
|
|
3014
|
+
setBusy(false)
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
return h('div', {
|
|
3018
|
+
className: 'md-env-backdrop',
|
|
3019
|
+
role: 'presentation',
|
|
3020
|
+
onClick: event => {
|
|
3021
|
+
if (event.target === event.currentTarget) props.onCancel()
|
|
3022
|
+
},
|
|
3023
|
+
},
|
|
3024
|
+
h('div', {
|
|
3025
|
+
className: 'md-env-dialog md-workspace-dialog',
|
|
3026
|
+
role: 'dialog', 'aria-modal': 'true', 'aria-label': format('workspaceTitle'),
|
|
3027
|
+
},
|
|
3028
|
+
h('h3', { className: 'md-env-title' }, format('workspaceTitle')),
|
|
3029
|
+
h('p', { className: 'md-env-body' }, format('workspaceBody')),
|
|
3030
|
+
h('div', { className: 'md-workspace-list' },
|
|
3031
|
+
h('span', { className: 'md-workspace-label' }, format('workspaceSelect')),
|
|
3032
|
+
props.workspaces.length === 0
|
|
3033
|
+
? h('span', { className: 'md-shelf-sub' }, format('workspaceEmpty'))
|
|
3034
|
+
: props.workspaces.map(item => h('button', {
|
|
3035
|
+
key: item.id,
|
|
3036
|
+
type: 'button', className: 'md-workspace-item',
|
|
3037
|
+
onClick: () => props.onPick(item),
|
|
3038
|
+
},
|
|
3039
|
+
h('strong', null, item.title === '' ? item.path : item.title),
|
|
3040
|
+
h('span', null, item.path)
|
|
3041
|
+
))
|
|
3042
|
+
),
|
|
3043
|
+
h('div', { className: 'md-workspace-new' },
|
|
3044
|
+
h('span', { className: 'md-workspace-label' }, format('workspaceNew')),
|
|
3045
|
+
h('span', { className: 'md-shelf-sub' }, format('workspacePath')),
|
|
3046
|
+
h('input', {
|
|
3047
|
+
className: 'md-settings-input',
|
|
3048
|
+
value: path,
|
|
3049
|
+
onChange: event => setPath(event.target.value),
|
|
3050
|
+
onKeyDown: event => {
|
|
3051
|
+
if (event.key !== 'Enter') return
|
|
3052
|
+
event.preventDefault()
|
|
3053
|
+
void create()
|
|
3054
|
+
},
|
|
3055
|
+
})
|
|
3056
|
+
),
|
|
3057
|
+
error === '' ? null : h('p', { className: 'md-settings-note' }, error),
|
|
3058
|
+
h('div', { className: 'md-env-actions' },
|
|
3059
|
+
h('button', { type: 'button', className: 'md-btn', onClick: props.onCancel }, format('workspaceCancel')),
|
|
3060
|
+
h('button', {
|
|
3061
|
+
type: 'button', className: 'md-btn md-btn-small',
|
|
3062
|
+
disabled: busy || path.trim() === '',
|
|
3063
|
+
onClick: () => { void create() },
|
|
3064
|
+
}, busy ? format('creating') : format('workspaceCreate'))
|
|
3065
|
+
)
|
|
3066
|
+
)
|
|
3067
|
+
)
|
|
3068
|
+
}
|
|
3069
|
+
|
|
2721
3070
|
function SettingsDialog(props) {
|
|
2722
|
-
const envTools = props.envTools ?? { python: false, tex: false }
|
|
3071
|
+
const envTools = props.envTools ?? { python: false, tex: false, apiKey: false }
|
|
2723
3072
|
// The dialog is paged: reading switches, the keyboard table, the toolchain
|
|
2724
3073
|
// check, and the about/update row. Tabs keep it from becoming a long scroll.
|
|
2725
|
-
const [tab, setTab] = useState('reading')
|
|
3074
|
+
const [tab, setTab] = useState(props.initialTab ?? 'reading')
|
|
2726
3075
|
const [apiKey, setApiKey] = useState('')
|
|
2727
3076
|
const [apiKeyNote, setApiKeyNote] = useState('')
|
|
2728
3077
|
const [bindings, setBindingsState] = useState(() => readShortcutBindings())
|
|
@@ -2756,8 +3105,10 @@ window.__ModuleLoader__.load({
|
|
|
2756
3105
|
const saveApiKey = async () => {
|
|
2757
3106
|
try {
|
|
2758
3107
|
const payload = await request('POST', 'deepseek-key', { key: apiKey })
|
|
2759
|
-
|
|
3108
|
+
const configured = payload !== null && payload.configured === true
|
|
3109
|
+
setApiKeyNote(configured ? format('apiKeyConfigured') : format('apiKeyMissing'))
|
|
2760
3110
|
setApiKey('')
|
|
3111
|
+
if (typeof props.onApiKeyChange === 'function') props.onApiKeyChange(configured)
|
|
2761
3112
|
} catch (error) {
|
|
2762
3113
|
setApiKeyNote(error !== null && error !== undefined && error.message ? String(error.message) : String(error))
|
|
2763
3114
|
}
|
|
@@ -2771,6 +3122,7 @@ window.__ModuleLoader__.load({
|
|
|
2771
3122
|
}
|
|
2772
3123
|
const tabs = [
|
|
2773
3124
|
{ id: 'reading', label: format('settingsTabReading') },
|
|
3125
|
+
{ id: 'workflow', label: format('settingsTabWorkflow') },
|
|
2774
3126
|
{ id: 'keys', label: format('settingsTabKeys') },
|
|
2775
3127
|
{ id: 'env', label: format('settingsTabEnv') },
|
|
2776
3128
|
{ id: 'about', label: format('settingsTabAbout') },
|
|
@@ -2823,6 +3175,49 @@ window.__ModuleLoader__.load({
|
|
|
2823
3175
|
h('p', { className: 'md-shelf-sub' }, format('settingsNotesHint'))
|
|
2824
3176
|
)
|
|
2825
3177
|
)
|
|
3178
|
+
const workflow = h('div', { className: 'md-settings-section' },
|
|
3179
|
+
h('h4', { className: 'md-settings-heading' }, format('workflowTitle')),
|
|
3180
|
+
h('p', { className: 'md-shelf-sub' }, format('workflowHint')),
|
|
3181
|
+
h('div', {
|
|
3182
|
+
className: 'md-workflow-base',
|
|
3183
|
+
},
|
|
3184
|
+
h('span', { className: 'md-mode-pill', 'data-mode': 'general' }, format('workflowGeneral')),
|
|
3185
|
+
h('span', { className: 'md-shelf-sub' }, format('workflowGeneralDesc')),
|
|
3186
|
+
h('span', { className: 'md-workflow-always' }, format('workflowGeneralAlways'))
|
|
3187
|
+
),
|
|
3188
|
+
WORKFLOWS.map(item => h('div', {
|
|
3189
|
+
key: item.id,
|
|
3190
|
+
className: 'md-workflow-card',
|
|
3191
|
+
'data-active': props.activeWorkflow === item.id ? 'true' : 'false',
|
|
3192
|
+
role: 'switch',
|
|
3193
|
+
tabIndex: 0,
|
|
3194
|
+
'aria-checked': props.activeWorkflow === item.id ? 'true' : 'false',
|
|
3195
|
+
title: props.activeWorkflow === item.id ? format('workflowActiveHint') : undefined,
|
|
3196
|
+
onClick: () => {
|
|
3197
|
+
if (typeof props.onWorkflowChange === 'function') {
|
|
3198
|
+
props.onWorkflowChange(props.activeWorkflow === item.id ? '' : item.id)
|
|
3199
|
+
}
|
|
3200
|
+
},
|
|
3201
|
+
onKeyDown: event => {
|
|
3202
|
+
if (event.key !== 'Enter' && event.key !== ' ') return
|
|
3203
|
+
event.preventDefault()
|
|
3204
|
+
if (typeof props.onWorkflowChange === 'function') {
|
|
3205
|
+
props.onWorkflowChange(props.activeWorkflow === item.id ? '' : item.id)
|
|
3206
|
+
}
|
|
3207
|
+
},
|
|
3208
|
+
},
|
|
3209
|
+
h('span', {
|
|
3210
|
+
className: 'md-workflow-dot',
|
|
3211
|
+
'data-on': props.activeWorkflow === item.id ? 'true' : 'false',
|
|
3212
|
+
'aria-hidden': 'true',
|
|
3213
|
+
}),
|
|
3214
|
+
h('span', { className: 'md-workflow-text' },
|
|
3215
|
+
h('strong', null, format(item.labelKey)),
|
|
3216
|
+
h('span', null, format(item.descKey))
|
|
3217
|
+
)
|
|
3218
|
+
)),
|
|
3219
|
+
h('p', { className: 'md-shelf-sub' }, format('workflowOnlyOne'))
|
|
3220
|
+
)
|
|
2826
3221
|
const keys = h('div', { className: 'md-settings-section' },
|
|
2827
3222
|
h('h4', { className: 'md-settings-heading' }, format('shortcutsTitle')),
|
|
2828
3223
|
h('p', { className: 'md-shelf-sub' }, format('shortcutsHint')),
|
|
@@ -2876,7 +3271,9 @@ window.__ModuleLoader__.load({
|
|
|
2876
3271
|
h('div', { className: 'md-settings-row' },
|
|
2877
3272
|
h('span', null, `${format('envTex')}:${envTools.tex ? format('envOn') : format('envOff')}(${format('envTexSize')})`),
|
|
2878
3273
|
envTools.tex ? null : h('button', { type: 'button', className: 'md-btn md-btn-small', onClick: () => openLink(TEXLIVE_URL) }, format('envDownload'))
|
|
2879
|
-
)
|
|
3274
|
+
),
|
|
3275
|
+
h('p', { className: 'md-shelf-sub' }, format('envImpact')),
|
|
3276
|
+
h('p', { className: 'md-shelf-sub' }, `${format('apiKeyTitle')}:${envTools.apiKey ? format('apiKeyConfigured') : format('apiKeyMissing')}`)
|
|
2880
3277
|
),
|
|
2881
3278
|
h('div', { className: 'md-settings-section' },
|
|
2882
3279
|
h('h4', { className: 'md-settings-heading' }, format('apiKeyTitle')),
|
|
@@ -2925,7 +3322,7 @@ window.__ModuleLoader__.load({
|
|
|
2925
3322
|
onClick: () => setTab(item.id),
|
|
2926
3323
|
}, item.label))
|
|
2927
3324
|
),
|
|
2928
|
-
tab === 'reading' ? reading : tab === 'keys' ? keys : tab === 'env' ? env : about
|
|
3325
|
+
tab === 'reading' ? reading : tab === 'workflow' ? workflow : tab === 'keys' ? keys : tab === 'env' ? env : about
|
|
2929
3326
|
)
|
|
2930
3327
|
)
|
|
2931
3328
|
}
|
|
@@ -2966,7 +3363,7 @@ window.__ModuleLoader__.load({
|
|
|
2966
3363
|
}
|
|
2967
3364
|
|
|
2968
3365
|
function LibrariesPage(props) {
|
|
2969
|
-
const envTools = props.envTools ?? { python: false, tex: false }
|
|
3366
|
+
const envTools = props.envTools ?? { python: false, tex: false, apiKey: false }
|
|
2970
3367
|
const [dir, setDir] = useState('')
|
|
2971
3368
|
const [name, setName] = useState('')
|
|
2972
3369
|
const [confirmId, setConfirmId] = useState('')
|
|
@@ -3035,11 +3432,13 @@ window.__ModuleLoader__.load({
|
|
|
3035
3432
|
type: 'button', className: 'md-btn md-btn-primary', disabled: busy,
|
|
3036
3433
|
onClick: scrollToAdd,
|
|
3037
3434
|
}, format('libraryAddTitle')),
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3435
|
+
props.libraries.length === 0
|
|
3436
|
+
? null
|
|
3437
|
+
: h('button', {
|
|
3438
|
+
type: 'button', className: 'md-btn',
|
|
3439
|
+
disabled: props.sampleBusy || busy || props.sample?.book == null,
|
|
3440
|
+
onClick: props.onLoadSample,
|
|
3441
|
+
}, props.sampleBusy ? format('sampleBusy') : format('sampleLoad')),
|
|
3043
3442
|
h('button', { type: 'button', className: 'md-btn md-btn-ghost', onClick: scrollToManual }, format('manualTitle'))
|
|
3044
3443
|
),
|
|
3045
3444
|
stuck
|
|
@@ -3210,26 +3609,28 @@ window.__ModuleLoader__.load({
|
|
|
3210
3609
|
},
|
|
3211
3610
|
},
|
|
3212
3611
|
h('h3', { className: 'md-subheading' }, format('toolbarTitle')),
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
? h('p', { className: 'md-shelf-sub' }, format('
|
|
3219
|
-
:
|
|
3220
|
-
h('p', { className: 'md-shelf-sub' },
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3612
|
+
props.libraries.length === 0
|
|
3613
|
+
? null
|
|
3614
|
+
: h('div', { className: 'md-library-samples md-tool-card' },
|
|
3615
|
+
h('h3', { className: 'md-subheading' }, format('sampleTitle')),
|
|
3616
|
+
props.sample === null
|
|
3617
|
+
? h('p', { className: 'md-shelf-sub' }, format('sampleLoading'))
|
|
3618
|
+
: props.sample.book === null || props.sample.book === undefined
|
|
3619
|
+
? h('p', { className: 'md-shelf-sub' }, format('sampleEmpty'))
|
|
3620
|
+
: h(React.Fragment, null,
|
|
3621
|
+
h('p', { className: 'md-shelf-sub' },
|
|
3622
|
+
`${props.sample.book.title} · ${format('sampleMeta', {
|
|
3623
|
+
chapters: props.sample.book.chapters,
|
|
3624
|
+
size: formatBytes(props.sample.book.bytes),
|
|
3625
|
+
})}`),
|
|
3626
|
+
h('p', { className: 'md-shelf-sub' }, format('sampleHint')),
|
|
3627
|
+
h('button', {
|
|
3628
|
+
type: 'button', className: 'md-btn',
|
|
3629
|
+
disabled: props.sampleBusy || props.busy,
|
|
3630
|
+
onClick: props.onLoadSample,
|
|
3631
|
+
}, props.sampleBusy ? format('sampleBusy') : format('sampleLoad'))
|
|
3632
|
+
)
|
|
3633
|
+
),
|
|
3233
3634
|
h('div', { className: 'md-tool-card' },
|
|
3234
3635
|
h('h3', { className: 'md-subheading' }, format('splitToolTitle')),
|
|
3235
3636
|
h('p', { className: 'md-shelf-sub' }, format('splitHint')),
|
|
@@ -3450,6 +3851,7 @@ window.__ModuleLoader__.load({
|
|
|
3450
3851
|
*/
|
|
3451
3852
|
function ChapterSessions(props) {
|
|
3452
3853
|
const busy = props.creatingMode !== ''
|
|
3854
|
+
const modes = Array.isArray(props.modes) ? props.modes : MODES
|
|
3453
3855
|
const renaming = props.renaming
|
|
3454
3856
|
const row = item => {
|
|
3455
3857
|
const label = item.title === '' ? item.displayTitle : item.title
|
|
@@ -3566,7 +3968,9 @@ window.__ModuleLoader__.load({
|
|
|
3566
3968
|
onClick: props.onRetryRename,
|
|
3567
3969
|
}, format('retryRename'))
|
|
3568
3970
|
),
|
|
3569
|
-
|
|
3971
|
+
modes.length === 0
|
|
3972
|
+
? h('p', { className: 'md-session-state' }, format('sessionsNoModes'))
|
|
3973
|
+
: modes.map(mode => {
|
|
3570
3974
|
const items = props.groups !== undefined && Array.isArray(props.groups[mode]) ? props.groups[mode] : []
|
|
3571
3975
|
return h('div', { key: mode, className: 'md-session-group' },
|
|
3572
3976
|
h('div', { className: 'md-session-group-head' },
|
|
@@ -3735,7 +4139,8 @@ window.__ModuleLoader__.load({
|
|
|
3735
4139
|
onContextMenu: event => {
|
|
3736
4140
|
if (/\.md$/i.test(item.name)) {
|
|
3737
4141
|
event.preventDefault()
|
|
3738
|
-
props.onRender(item, props.code)
|
|
4142
|
+
if (props.canRender === true) props.onRender(item, props.code)
|
|
4143
|
+
else if (typeof props.onEnvRequired === 'function') props.onEnvRequired('render')
|
|
3739
4144
|
return
|
|
3740
4145
|
}
|
|
3741
4146
|
if (item.kind === 'pdf') {
|
|
@@ -3758,19 +4163,21 @@ window.__ModuleLoader__.load({
|
|
|
3758
4163
|
h('span', { className: 'md-file-name' }, item.name),
|
|
3759
4164
|
h('span', { className: 'md-file-meta', 'aria-hidden': true },
|
|
3760
4165
|
[formatSize(item.size), formatDate(item.mtime)].filter(Boolean).join(' · ')),
|
|
3761
|
-
/\.md$/i.test(item.name)
|
|
4166
|
+
/\.md$/i.test(item.name)
|
|
3762
4167
|
? h('span', {
|
|
3763
4168
|
className: 'md-file-action', role: 'button', tabIndex: 0,
|
|
3764
4169
|
title: format('renderActionHint'),
|
|
3765
4170
|
onClick: event => {
|
|
3766
4171
|
event.stopPropagation()
|
|
3767
|
-
props.onRender(item, props.code)
|
|
4172
|
+
if (props.canRender === true) props.onRender(item, props.code)
|
|
4173
|
+
else if (typeof props.onEnvRequired === 'function') props.onEnvRequired('render')
|
|
3768
4174
|
},
|
|
3769
4175
|
onKeyDown: event => {
|
|
3770
4176
|
if (event.key !== 'Enter' && event.key !== ' ') return
|
|
3771
4177
|
event.preventDefault()
|
|
3772
4178
|
event.stopPropagation()
|
|
3773
|
-
props.onRender(item, props.code)
|
|
4179
|
+
if (props.canRender === true) props.onRender(item, props.code)
|
|
4180
|
+
else if (typeof props.onEnvRequired === 'function') props.onEnvRequired('render')
|
|
3774
4181
|
},
|
|
3775
4182
|
}, format('renderAction'))
|
|
3776
4183
|
: null
|
|
@@ -3785,7 +4192,7 @@ window.__ModuleLoader__.load({
|
|
|
3785
4192
|
},
|
|
3786
4193
|
}, format('trashAction'))
|
|
3787
4194
|
: null,
|
|
3788
|
-
h('div', { className: 'md-artifact-modes' },
|
|
4195
|
+
props.mathMode === true ? h('div', { className: 'md-artifact-modes' },
|
|
3789
4196
|
MODES.map(mode => h(React.Fragment, { key: mode },
|
|
3790
4197
|
h('button', {
|
|
3791
4198
|
type: 'button',
|
|
@@ -3810,10 +4217,9 @@ window.__ModuleLoader__.load({
|
|
|
3810
4217
|
},
|
|
3811
4218
|
}, `+ ${format('forceNew')}`)
|
|
3812
4219
|
))
|
|
3813
|
-
),
|
|
3814
|
-
|
|
3815
|
-
? null
|
|
3816
|
-
: h(React.Fragment, null,
|
|
4220
|
+
) : null,
|
|
4221
|
+
props.mathMode === true && groups !== undefined
|
|
4222
|
+
? h(React.Fragment, null,
|
|
3817
4223
|
h('button', {
|
|
3818
4224
|
type: 'button', className: 'md-artifact-session-toggle',
|
|
3819
4225
|
onClick: event => {
|
|
@@ -3838,6 +4244,7 @@ window.__ModuleLoader__.load({
|
|
|
3838
4244
|
))))
|
|
3839
4245
|
: null
|
|
3840
4246
|
)
|
|
4247
|
+
: null
|
|
3841
4248
|
)
|
|
3842
4249
|
}
|
|
3843
4250
|
const ordered = [...items].sort((left, right) => {
|
|
@@ -4561,13 +4968,15 @@ window.__ModuleLoader__.load({
|
|
|
4561
4968
|
* @returns {null} nothing to draw.
|
|
4562
4969
|
*/
|
|
4563
4970
|
function QaPersonaSeat(props) {
|
|
4971
|
+
const workflow = useWorkflowMode()
|
|
4564
4972
|
const list = useSessionList()
|
|
4565
4973
|
const summary = list === null || list.byId === undefined ? undefined : list.byId[props.sessionId]
|
|
4566
4974
|
const title = summary === undefined ? '' : summary.title
|
|
4567
4975
|
useEffect(() => {
|
|
4976
|
+
if (workflow !== 'math') return
|
|
4568
4977
|
const parsed = parseSessionTitle(title)
|
|
4569
4978
|
if (parsed !== null && parsed.mode === 'qa') void seedQaPersona(props.sessionId)
|
|
4570
|
-
}, [props.sessionId, title])
|
|
4979
|
+
}, [props.sessionId, title, workflow])
|
|
4571
4980
|
return null
|
|
4572
4981
|
}
|
|
4573
4982
|
|
|
@@ -6750,6 +7159,10 @@ window.__ModuleLoader__.load({
|
|
|
6750
7159
|
// Whole chapter: pages without masks or notes stay the plain original; the
|
|
6751
7160
|
// sidecar JSON keeps the normalized data next to the PDF.
|
|
6752
7161
|
const exportChapter = async () => {
|
|
7162
|
+
if (props.canExport !== true) {
|
|
7163
|
+
if (typeof props.onEnvRequired === 'function') props.onEnvRequired('export')
|
|
7164
|
+
return
|
|
7165
|
+
}
|
|
6753
7166
|
updateNote(format('exportingChapter'))
|
|
6754
7167
|
try {
|
|
6755
7168
|
const total = reader.count > 0 ? reader.count : 1
|
|
@@ -6800,6 +7213,10 @@ window.__ModuleLoader__.load({
|
|
|
6800
7213
|
// of the overlay PDF, and the annotations. Saved into the chapter's
|
|
6801
7214
|
// produced files so it can be opened from the shelf like any artifact.
|
|
6802
7215
|
const exportPage = async () => {
|
|
7216
|
+
if (props.canExport !== true) {
|
|
7217
|
+
if (typeof props.onEnvRequired === 'function') props.onEnvRequired('export')
|
|
7218
|
+
return
|
|
7219
|
+
}
|
|
6803
7220
|
updateNote(format('exporting'))
|
|
6804
7221
|
try {
|
|
6805
7222
|
const payload = await request('POST', 'export-page', {
|
|
@@ -7111,6 +7528,10 @@ window.__ModuleLoader__.load({
|
|
|
7111
7528
|
props.onPage(value)
|
|
7112
7529
|
}
|
|
7113
7530
|
const runTranslate = async (resume = false) => {
|
|
7531
|
+
if (props.canTranslate !== true) {
|
|
7532
|
+
if (typeof props.onEnvRequired === 'function') props.onEnvRequired('translate')
|
|
7533
|
+
return
|
|
7534
|
+
}
|
|
7114
7535
|
if (translating || reader.phase !== 'ready') return
|
|
7115
7536
|
setTranslating(true)
|
|
7116
7537
|
setDeskStatus('busy')
|
|
@@ -7501,6 +7922,15 @@ window.__ModuleLoader__.load({
|
|
|
7501
7922
|
}, '×')
|
|
7502
7923
|
),
|
|
7503
7924
|
h('div', { className: 'md-reader-subbar', style: toolsOpen ? undefined : { display: 'none' } },
|
|
7925
|
+
h('button', {
|
|
7926
|
+
type: 'button', className: 'md-btn md-btn-small',
|
|
7927
|
+
disabled: props.busy,
|
|
7928
|
+
title: format('generalSessionHint'),
|
|
7929
|
+
onClick: () => {
|
|
7930
|
+
if (typeof props.onGeneralSession === 'function') props.onGeneralSession()
|
|
7931
|
+
},
|
|
7932
|
+
}, format('generalSession')),
|
|
7933
|
+
h('span', { className: 'md-reader-sep', 'aria-hidden': true }),
|
|
7504
7934
|
h('span', { className: 'md-reader-modes', role: 'group', 'aria-label': format('readerMode') },
|
|
7505
7935
|
h('button', {
|
|
7506
7936
|
type: 'button', className: 'md-btn md-btn-small', 'aria-pressed': modeOf('single') ? 'true' : 'false',
|
|
@@ -7520,6 +7950,10 @@ window.__ModuleLoader__.load({
|
|
|
7520
7950
|
title: format('dualHint'),
|
|
7521
7951
|
onClick: () => {
|
|
7522
7952
|
if (!hasTranslation) {
|
|
7953
|
+
if (props.canTranslate !== true) {
|
|
7954
|
+
if (typeof props.onEnvRequired === 'function') props.onEnvRequired('translate')
|
|
7955
|
+
return
|
|
7956
|
+
}
|
|
7523
7957
|
if (typeof window !== 'undefined' && typeof window.confirm === 'function'
|
|
7524
7958
|
&& window.confirm(format('dualNeedsTranslation'))) {
|
|
7525
7959
|
void runTranslate()
|
|
@@ -7543,6 +7977,10 @@ window.__ModuleLoader__.load({
|
|
|
7543
7977
|
onClick: () => {
|
|
7544
7978
|
if (reader.variant === 'translated') return
|
|
7545
7979
|
if (!overlay && !hasTranslation) {
|
|
7980
|
+
if (props.canTranslate !== true) {
|
|
7981
|
+
if (typeof props.onEnvRequired === 'function') props.onEnvRequired('translate')
|
|
7982
|
+
return
|
|
7983
|
+
}
|
|
7546
7984
|
if (typeof window !== 'undefined' && typeof window.confirm === 'function'
|
|
7547
7985
|
&& window.confirm(format('dualNeedsTranslation'))) {
|
|
7548
7986
|
void runTranslate()
|
|
@@ -7600,13 +8038,17 @@ window.__ModuleLoader__.load({
|
|
|
7600
8038
|
disabled: translating || reader.phase !== 'ready',
|
|
7601
8039
|
title: format('translateHint'),
|
|
7602
8040
|
onClick: () => {
|
|
8041
|
+
if (props.canTranslate !== true) {
|
|
8042
|
+
if (typeof props.onEnvRequired === 'function') props.onEnvRequired('translate')
|
|
8043
|
+
return
|
|
8044
|
+
}
|
|
7603
8045
|
if (!window.confirm(format('translateCostConfirm'))) return
|
|
7604
8046
|
if (hasTranslation && !window.confirm(format('translateOverwriteConfirm'))) return
|
|
7605
8047
|
void runTranslate()
|
|
7606
8048
|
},
|
|
7607
8049
|
}, translating ? format('translating') : format('translateChapterAction'))
|
|
7608
8050
|
),
|
|
7609
|
-
|
|
8051
|
+
props.mathMode !== true
|
|
7610
8052
|
? null
|
|
7611
8053
|
: h(React.Fragment, null,
|
|
7612
8054
|
h('span', { className: 'md-reader-sep', 'aria-hidden': true }),
|
|
@@ -7635,7 +8077,7 @@ window.__ModuleLoader__.load({
|
|
|
7635
8077
|
type: 'button', className: 'md-btn md-btn-small',
|
|
7636
8078
|
onClick: cancelTranslate,
|
|
7637
8079
|
}, format('translateCancel')) : null,
|
|
7638
|
-
!translating && partialPages.length > 0
|
|
8080
|
+
!translating && partialPages.length > 0 && props.canTranslate === true
|
|
7639
8081
|
? h('button', {
|
|
7640
8082
|
type: 'button', className: 'md-btn md-btn-small',
|
|
7641
8083
|
title: format('translateResumeHint'),
|
|
@@ -8112,6 +8554,7 @@ window.__ModuleLoader__.load({
|
|
|
8112
8554
|
open: sessionsOpen,
|
|
8113
8555
|
onToggle: () => setSessionsOpen(value => !value),
|
|
8114
8556
|
chapter,
|
|
8557
|
+
modes: sessionModesFor(typeof props.workflow === 'string' ? props.workflow : (props.mathMode === true ? 'math' : '')),
|
|
8115
8558
|
groups: props.groups,
|
|
8116
8559
|
creatingMode: props.creatingMode,
|
|
8117
8560
|
loaded: props.loaded,
|
|
@@ -8138,6 +8581,8 @@ window.__ModuleLoader__.load({
|
|
|
8138
8581
|
code: chapter.code,
|
|
8139
8582
|
sessionIndex: props.sessionIndex,
|
|
8140
8583
|
canRender: props.canRender,
|
|
8584
|
+
mathMode: props.mathMode,
|
|
8585
|
+
onEnvRequired: props.onEnvRequired,
|
|
8141
8586
|
onArtifactSession: props.onArtifactSession,
|
|
8142
8587
|
allowNonPdfDelete: props.allowNonPdfDelete,
|
|
8143
8588
|
onOpenSession: props.onOpenSession,
|
|
@@ -8209,6 +8654,8 @@ window.__ModuleLoader__.load({
|
|
|
8209
8654
|
sessionIndex: props.sessionIndex,
|
|
8210
8655
|
onArtifactSession: props.onArtifactSession,
|
|
8211
8656
|
canRender: props.canRender,
|
|
8657
|
+
mathMode: props.mathMode,
|
|
8658
|
+
onEnvRequired: props.onEnvRequired,
|
|
8212
8659
|
allowNonPdfDelete: props.allowNonPdfDelete,
|
|
8213
8660
|
artifacts: props.artifacts[key],
|
|
8214
8661
|
counts: props.counts,
|
|
@@ -8309,6 +8756,31 @@ window.__ModuleLoader__.load({
|
|
|
8309
8756
|
.md-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 28px 0 14px; }
|
|
8310
8757
|
.md-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .01em; }
|
|
8311
8758
|
.md-subtitle { margin: 4px 0 0; font-size: 12.5px; color: var(--dsw-alias-label-secondary); }
|
|
8759
|
+
.md-mode-pill { display: inline-flex; align-items: center; align-self: flex-start; margin-top: 6px; padding: 1px 8px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; font-size: 11px; line-height: 18px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); }
|
|
8760
|
+
.md-mode-pill[data-mode='math'] { color: var(--dsw-alias-brand-primary); border-color: var(--dsw-alias-brand-primary); }
|
|
8761
|
+
.md-workflow-base { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; }
|
|
8762
|
+
.md-workflow-always { margin-left: auto; font-size: 11px; color: var(--dsw-alias-label-secondary); }
|
|
8763
|
+
.md-workflow-base .md-mode-pill { margin-top: 0; }
|
|
8764
|
+
.md-workflow-card { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; cursor: pointer; }
|
|
8765
|
+
.md-workflow-card:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
|
|
8766
|
+
.md-workflow-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--dsw-alias-label-secondary); opacity: .45; }
|
|
8767
|
+
.md-workflow-dot[data-on='true'] { background: var(--dsw-alias-state-success-primary); opacity: 1; }
|
|
8768
|
+
.md-workflow-text { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--dsw-alias-label-secondary); }
|
|
8769
|
+
.md-workflow-text strong { font-size: 13px; color: var(--dsw-alias-label-primary); }
|
|
8770
|
+
.md-env-backdrop { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; background: color-mix(in srgb, var(--dsw-static-neutral-bluish-1000) 28%, transparent); }
|
|
8771
|
+
.md-env-dialog { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 18px; border: .5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); box-shadow: var(--dsw-elevation-prominent); }
|
|
8772
|
+
.md-env-title { margin: 0; font-size: 15px; }
|
|
8773
|
+
.md-env-body { margin: 0; font-size: 13px; line-height: 1.6; color: var(--dsw-alias-label-secondary); }
|
|
8774
|
+
.md-env-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
|
|
8775
|
+
.md-workspace-dialog { width: min(520px, 100%); }
|
|
8776
|
+
.md-workspace-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
|
|
8777
|
+
.md-workspace-label { font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-primary); }
|
|
8778
|
+
.md-workspace-item { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 8px 10px; text-align: left; border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); cursor: pointer; }
|
|
8779
|
+
.md-workspace-item:hover { border-color: var(--dsw-alias-brand-primary); }
|
|
8780
|
+
.md-workspace-item strong { font-size: 12.5px; }
|
|
8781
|
+
.md-workspace-item span { font-size: 11.5px; color: var(--dsw-alias-label-secondary); overflow: hidden; text-overflow: ellipsis; }
|
|
8782
|
+
.md-workspace-new { display: flex; flex-direction: column; gap: 4px; }
|
|
8783
|
+
.md-workspace-new .md-settings-input { width: 100%; box-sizing: border-box; }
|
|
8312
8784
|
.md-head-actions { display: flex; align-items: center; gap: 8px; }
|
|
8313
8785
|
.md-settings { position: relative; }
|
|
8314
8786
|
.md-settings-version { padding: 4px 8px; font-size: 11.5px; color: var(--dsw-alias-label-secondary); }
|
|
@@ -8323,9 +8795,9 @@ window.__ModuleLoader__.load({
|
|
|
8323
8795
|
.md-shortcut-list { display: flex; flex-direction: column; gap: 4px; }
|
|
8324
8796
|
.md-shortcut-row { gap: 8px; }
|
|
8325
8797
|
.md-shortcut-name { flex: 1 1 auto; min-width: 0; }
|
|
8326
|
-
.md-shortcut-key { flex: 0 0 auto; min-width: 88px; padding: 2px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-
|
|
8798
|
+
.md-shortcut-key { flex: 0 0 auto; min-width: 88px; padding: 2px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); border-radius: 6px; text-align: center; white-space: nowrap; }
|
|
8327
8799
|
.md-shortcut-row .md-btn { flex: 0 0 auto; }
|
|
8328
|
-
.md-btn { font: inherit; font-size: 13px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-
|
|
8800
|
+
.md-btn { font: inherit; font-size: 13px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; padding: 6px 12px; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
|
|
8329
8801
|
.md-btn:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); border-color: var(--dsw-alias-border-l3); }
|
|
8330
8802
|
.md-btn:disabled { opacity: .55; cursor: default; }
|
|
8331
8803
|
.md-btn-small { font-size: 12px; padding: 4px 10px; }
|
|
@@ -8336,7 +8808,7 @@ window.__ModuleLoader__.load({
|
|
|
8336
8808
|
.md-crumb:hover:not(:disabled) { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }
|
|
8337
8809
|
.md-crumb-sep { opacity: .5; }
|
|
8338
8810
|
.md-crumb-current { color: var(--dsw-alias-label-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
|
|
8339
|
-
.md-notice { flex: none; margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: var(--dsw-alias-
|
|
8811
|
+
.md-notice { flex: none; margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); color: var(--dsw-alias-label-secondary); font-size: 13px; }
|
|
8340
8812
|
.md-alert { flex: none; display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 9%, var(--dsw-alias-bg-base)); border: 1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary) 34%, transparent); color: var(--dsw-alias-label-primary); font-size: 13px; }
|
|
8341
8813
|
.md-alert-text { flex: 1; min-width: 0; }
|
|
8342
8814
|
.md-hint { flex: none; margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 10%, var(--dsw-alias-bg-base)); border-left: 3px solid var(--dsw-alias-state-warn-primary); color: var(--dsw-alias-label-secondary); font-size: 12.5px; }
|
|
@@ -8357,9 +8829,9 @@ window.__ModuleLoader__.load({
|
|
|
8357
8829
|
.md-preview-state { padding: 14px 0; font-size: 12.5px; color: var(--dsw-alias-label-secondary); }
|
|
8358
8830
|
.md-preview-notices { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
|
|
8359
8831
|
.md-preview-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 10px; overflow: auto; }
|
|
8360
|
-
.md-preview-note { flex: none; font-size: 11px; color: var(--dsw-alias-label-secondary); border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; padding: 1px 8px; background: var(--dsw-alias-
|
|
8361
|
-
.md-code-block { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; background: var(--dsw-alias-
|
|
8362
|
-
.md-code-gutter { position: sticky; left: 0; flex: none; margin: 0; padding-right: 2px; background: var(--dsw-alias-
|
|
8832
|
+
.md-preview-note { flex: none; font-size: 11px; color: var(--dsw-alias-label-secondary); border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; padding: 1px 8px; background: var(--dsw-alias-bg-layer-2); }
|
|
8833
|
+
.md-code-block { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; overflow-x: auto; }
|
|
8834
|
+
.md-code-gutter { position: sticky; left: 0; flex: none; margin: 0; padding-right: 2px; background: var(--dsw-alias-bg-layer-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; color: var(--dsw-alias-label-secondary); text-align: right; font-variant-numeric: tabular-nums; user-select: none; }
|
|
8363
8835
|
.md-code-text { flex: 1 1 auto; min-width: 0; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; color: var(--dsw-alias-label-primary); white-space: pre; }
|
|
8364
8836
|
.md-artifacts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--dsw-alias-border-l2); }
|
|
8365
8837
|
.md-artifacts-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
|
|
@@ -8368,7 +8840,7 @@ window.__ModuleLoader__.load({
|
|
|
8368
8840
|
.md-artifacts-title { font-size: 12.5px; color: var(--dsw-alias-label-primary); }
|
|
8369
8841
|
.md-artifacts-empty { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--dsw-alias-label-secondary); }
|
|
8370
8842
|
.md-artifacts-empty .md-btn { align-self: flex-start; }
|
|
8371
|
-
.md-path { align-self: flex-start; max-width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--dsw-alias-label-primary); word-break: break-all; background: var(--dsw-alias-
|
|
8843
|
+
.md-path { align-self: flex-start; max-width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--dsw-alias-label-primary); word-break: break-all; background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); border-radius: 6px; padding: 3px 6px; }
|
|
8372
8844
|
.md-file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
|
|
8373
8845
|
.md-file { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 4px 6px; font: inherit; font-size: 12.5px; color: var(--dsw-alias-label-primary); text-align: left; background: none; border: 0; border-radius: 6px; cursor: pointer; }
|
|
8374
8846
|
.md-file:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
@@ -8386,14 +8858,14 @@ window.__ModuleLoader__.load({
|
|
|
8386
8858
|
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
|
|
8387
8859
|
.md-card { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 12px; text-align: left; font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 12px; cursor: pointer; transition: border-color .14s ease, background .14s ease, transform .14s ease; position: relative; }
|
|
8388
8860
|
.md-card-selected { border-color: var(--dsw-alias-brand-primary); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, transparent); }
|
|
8389
|
-
.md-card-check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--dsw-alias-brand-primary); color: var(--dsw-alias-label-
|
|
8861
|
+
.md-card-check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--dsw-alias-brand-primary); color: var(--dsw-alias-label-primary-foreground); display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
|
|
8390
8862
|
.md-shelf { position: relative; display: flex; flex-direction: column; gap: 16px; }
|
|
8391
8863
|
.md-shelf-head { display: flex; align-items: baseline; gap: 10px; }
|
|
8392
8864
|
.md-collection-row { display: flex; flex-wrap: wrap; gap: 16px; }
|
|
8393
8865
|
.md-collection { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 12px; text-align: left; font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
|
|
8394
8866
|
.md-collection:hover { background: var(--dsw-alias-interactive-bg-hover); border-color: transparent; transform: translateY(-2px); }
|
|
8395
8867
|
.md-collection-stack { position: relative; display: block; aspect-ratio: 3 / 4; }
|
|
8396
|
-
.md-collection-sheet { position: absolute; inset: 0; border-radius: 8px; border: 1px solid var(--dsw-alias-border-l3); background: var(--dsw-alias-
|
|
8868
|
+
.md-collection-sheet { position: absolute; inset: 0; border-radius: 8px; border: 1px solid var(--dsw-alias-border-l3); background: var(--dsw-alias-bg-layer-2); }
|
|
8397
8869
|
.md-collection-sheet.md-sheet-1 { background: linear-gradient(160deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, var(--dsw-alias-bg-layer-2)), var(--dsw-alias-bg-layer-2) 72%); }
|
|
8398
8870
|
.md-collection-sheet.md-sheet-2 { transform: translate(-6px, 6px) rotate(-2deg); opacity: .8; }
|
|
8399
8871
|
.md-collection-sheet.md-sheet-3 { transform: translate(-12px, 12px) rotate(-4deg); opacity: .55; }
|
|
@@ -8423,15 +8895,15 @@ window.__ModuleLoader__.load({
|
|
|
8423
8895
|
.md-libraries > .md-library-toolcell { grid-column: 2; grid-row: 3; }
|
|
8424
8896
|
.md-libraries > .md-details { grid-row: 4; }
|
|
8425
8897
|
.md-library-toolcell { position: relative; height: 100%; }
|
|
8426
|
-
.md-library-toolscroll { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-
|
|
8898
|
+
.md-library-toolscroll { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-bg-layer-2); scrollbar-width: thin; scrollbar-color: transparent transparent; }
|
|
8427
8899
|
.md-library-toolscroll::-webkit-scrollbar { width: 6px; }
|
|
8428
8900
|
.md-library-toolscroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
|
|
8429
8901
|
.md-library-toolscroll.md-scrolling { scrollbar-color: var(--dsw-alias-border-l4) transparent; }
|
|
8430
8902
|
.md-library-toolscroll.md-scrolling::-webkit-scrollbar-thumb { background: var(--dsw-alias-border-l4); }
|
|
8431
|
-
.md-tool-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-
|
|
8903
|
+
.md-tool-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-bg-layer-2); }
|
|
8432
8904
|
.md-libraries > .md-library-samples { grid-column: 2; }
|
|
8433
8905
|
.md-library-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
|
8434
|
-
.md-library { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-
|
|
8906
|
+
.md-library { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-bg-layer-2); cursor: pointer; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
|
|
8435
8907
|
.md-library:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
8436
8908
|
.md-library-active { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, var(--dsw-alias-border-l3)); box-shadow: inset 3px 0 0 var(--dsw-alias-brand-primary); }
|
|
8437
8909
|
.md-library-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
@@ -8439,7 +8911,7 @@ window.__ModuleLoader__.load({
|
|
|
8439
8911
|
.md-libraries .md-path { font-size: 12.5px; }
|
|
8440
8912
|
.md-libraries .md-shelf-sub { font-size: 13.5px; line-height: 1.65; }
|
|
8441
8913
|
.md-badge { font-size: 11px; line-height: 1.6; padding: 0 7px; border-radius: 999px; color: var(--dsw-alias-brand-primary); background: color-mix(in srgb, var(--dsw-alias-brand-primary) 13%, transparent); border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 30%, transparent); }
|
|
8442
|
-
.md-badge-quiet { color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-
|
|
8914
|
+
.md-badge-quiet { color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); border-color: var(--dsw-alias-border-l3); }
|
|
8443
8915
|
.md-library-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
|
8444
8916
|
.md-library-actions .md-icon-btn { font-size: 18px; line-height: 1.2; padding: 0 8px; }
|
|
8445
8917
|
.md-subheading { margin: 0; font-size: 14px; font-weight: 600; color: var(--dsw-alias-label-primary); }
|
|
@@ -8448,14 +8920,14 @@ window.__ModuleLoader__.load({
|
|
|
8448
8920
|
.md-input { font: inherit; font-size: 13px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-radius: 7px; padding: 6px 8px; }
|
|
8449
8921
|
.md-input:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
|
|
8450
8922
|
.md-library-manual { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px dashed var(--dsw-alias-border-l3); border-radius: 10px; }
|
|
8451
|
-
.md-details { padding: 12px 16px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-
|
|
8923
|
+
.md-details { padding: 12px 16px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-bg-layer-2); }
|
|
8452
8924
|
.md-details-summary { cursor: pointer; font-size: 13px; font-weight: 550; color: var(--dsw-alias-label-primary); }
|
|
8453
8925
|
.md-details[open] .md-details-summary { margin-bottom: 6px; }
|
|
8454
|
-
.md-library-samples { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-
|
|
8926
|
+
.md-library-samples { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-bg-layer-2); }
|
|
8455
8927
|
.md-manual-path { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
8456
8928
|
.md-manual-label { font-size: 11.5px; color: var(--dsw-alias-label-secondary); }
|
|
8457
8929
|
.md-library-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
|
|
8458
|
-
.md-library-add { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-
|
|
8930
|
+
.md-library-add { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--dsw-alias-border-l3); border-radius: 14px; background: var(--dsw-alias-bg-layer-2); }
|
|
8459
8931
|
/* Library landing: generous whitespace, a pixel whale in the hero, and a sticky
|
|
8460
8932
|
action bar that only appears once the hero has scrolled away. */
|
|
8461
8933
|
.md-home { position: relative; display: flex; flex-direction: column; gap: 0; max-width: 1120px; margin: 0 auto; padding: 0 28px 72px; box-sizing: border-box; }
|
|
@@ -8476,14 +8948,14 @@ window.__ModuleLoader__.load({
|
|
|
8476
8948
|
.md-hero-meta { margin: 22px 0 0; font-size: 12.5px; color: var(--dsw-alias-label-secondary); }
|
|
8477
8949
|
.md-hero-whale { position: absolute; top: 30px; right: 12px; width: 340px; height: auto; color: var(--dsw-alias-brand-primary); opacity: .1; pointer-events: none; animation: md-whale 16s ease-in-out infinite alternate; }
|
|
8478
8950
|
@keyframes md-whale { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-20px, 10px, 0); } }
|
|
8479
|
-
.md-btn-primary { color: var(--dsw-alias-label-
|
|
8951
|
+
.md-btn-primary { color: var(--dsw-alias-label-primary-foreground); background: var(--dsw-alias-brand-primary); border-color: var(--dsw-alias-brand-primary); }
|
|
8480
8952
|
.md-btn-primary:hover { filter: brightness(1.06); }
|
|
8481
8953
|
.md-home .md-shelf-head .md-heading { font-size: 18px; }
|
|
8482
8954
|
.md-home .md-library-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
|
|
8483
8955
|
.md-home .md-library-list:empty { display: none; }
|
|
8484
|
-
.md-home .md-library { position: relative; padding: 20px 22px 18px; border-radius: 16px; background: var(--dsw-alias-
|
|
8485
|
-
.md-home .md-library:hover { transform: translateY(-1px); border-color: var(--dsw-alias-border-l4); box-shadow:
|
|
8486
|
-
.md-home .md-library-active { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, transparent); background: color-mix(in srgb, var(--dsw-alias-brand-primary) 5%, var(--dsw-alias-
|
|
8956
|
+
.md-home .md-library { position: relative; padding: 20px 22px 18px; border-radius: 16px; background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
|
|
8957
|
+
.md-home .md-library:hover { transform: translateY(-1px); border-color: var(--dsw-alias-border-l4); box-shadow: var(--dsw-elevation-soft); }
|
|
8958
|
+
.md-home .md-library-active { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, transparent); background: color-mix(in srgb, var(--dsw-alias-brand-primary) 5%, var(--dsw-alias-bg-layer-2)); }
|
|
8487
8959
|
.md-home .md-library-name { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
|
|
8488
8960
|
.md-home .md-library .md-path { margin-top: 10px; font-size: 12px; }
|
|
8489
8961
|
.md-home .md-library-actions { position: absolute; top: 14px; right: 14px; opacity: 0; transition: opacity .16s ease; }
|
|
@@ -8502,10 +8974,10 @@ window.__ModuleLoader__.load({
|
|
|
8502
8974
|
.md-home .md-library-toolcell { position: static; height: auto; }
|
|
8503
8975
|
.md-home .md-library-toolscroll { position: static; display: flex; flex-direction: row; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 16px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-border-l4) transparent; }
|
|
8504
8976
|
.md-home .md-library-toolscroll::-webkit-scrollbar { height: 8px; }
|
|
8505
|
-
.md-home .md-library-toolscroll::-webkit-scrollbar-track { background: var(--dsw-alias-
|
|
8977
|
+
.md-home .md-library-toolscroll::-webkit-scrollbar-track { background: var(--dsw-alias-bg-layer-2); border-radius: 4px; }
|
|
8506
8978
|
.md-home .md-library-toolscroll::-webkit-scrollbar-thumb { background: var(--dsw-alias-border-l4); border-radius: 4px; }
|
|
8507
8979
|
.md-home .md-library-toolscroll > .md-subheading { display: none; }
|
|
8508
|
-
.md-home .md-tool-card { flex: 0 0 300px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 16px; background: var(--dsw-alias-
|
|
8980
|
+
.md-home .md-tool-card { flex: 0 0 300px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 16px; background: var(--dsw-alias-bg-layer-2); }
|
|
8509
8981
|
.md-home .md-tool-card .md-btn { align-self: flex-start; margin-top: auto; }
|
|
8510
8982
|
.md-home .md-manual { border-radius: 18px; padding: 0; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2); background: transparent; }
|
|
8511
8983
|
.md-manual-summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 18px 22px; cursor: pointer; }
|
|
@@ -8521,17 +8993,17 @@ window.__ModuleLoader__.load({
|
|
|
8521
8993
|
.md-manual-lead { margin: 0; font-size: 14px; line-height: 1.85; color: var(--dsw-alias-label-primary); }
|
|
8522
8994
|
.md-manual-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: mdstep; }
|
|
8523
8995
|
.md-manual-steps li { position: relative; padding-left: 34px; font-size: 14px; line-height: 1.75; color: var(--dsw-alias-label-secondary); }
|
|
8524
|
-
.md-manual-steps li::before { counter-increment: mdstep; content: counter(mdstep); position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; color: var(--dsw-alias-label-
|
|
8996
|
+
.md-manual-steps li::before { counter-increment: mdstep; content: counter(mdstep); position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; color: var(--dsw-alias-label-primary-foreground); background: var(--dsw-alias-brand-primary); }
|
|
8525
8997
|
.md-manual-block { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; border-top: 1px solid var(--dsw-alias-border-l2); }
|
|
8526
8998
|
.md-manual-heading { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--dsw-alias-label-primary); }
|
|
8527
8999
|
.md-manual-text { margin: 0; font-size: 13.5px; line-height: 1.8; color: var(--dsw-alias-label-secondary); }
|
|
8528
9000
|
.md-manual-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.8; color: var(--dsw-alias-label-secondary); }
|
|
8529
|
-
.md-manual-tree { margin: 0; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.7; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-
|
|
9001
|
+
.md-manual-tree { margin: 0; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.7; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); border-radius: 10px; overflow: auto; white-space: pre; }
|
|
8530
9002
|
.md-manual-sub { margin-top: 4px; padding: 10px 14px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 10px; }
|
|
8531
9003
|
.md-manual-sub-summary { cursor: pointer; font-size: 12.5px; font-weight: 550; color: var(--dsw-alias-label-primary); }
|
|
8532
9004
|
.md-manual-sub[open] .md-manual-sub-summary { margin-bottom: 8px; }
|
|
8533
9005
|
.md-manual-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
8534
|
-
.md-manual-code { display: block; max-height: 130px; overflow: auto; margin: 0; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.6; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-
|
|
9006
|
+
.md-manual-code { display: block; max-height: 130px; overflow: auto; margin: 0; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.6; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; white-space: pre-wrap; word-break: break-all; }
|
|
8535
9007
|
.md-manual-path { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
8536
9008
|
.md-book-head { display: flex; flex-direction: column; gap: 6px; padding: 4px 4px 16px; }
|
|
8537
9009
|
.md-book-title { margin: 0; font-size: 18px; font-weight: 600; }
|
|
@@ -8582,7 +9054,7 @@ window.__ModuleLoader__.load({
|
|
|
8582
9054
|
.md-session-actions { flex: none; display: flex; gap: 2px; padding-right: 4px; opacity: 0; transition: opacity .1s ease; }
|
|
8583
9055
|
.md-session-row:hover .md-session-actions, .md-session-row:focus-within .md-session-actions { opacity: 1; }
|
|
8584
9056
|
.md-icon-btn { font: inherit; font-size: 12px; line-height: 1.4; color: var(--dsw-alias-label-secondary); background: none; border: 0; border-radius: 4px; padding: 1px 5px; cursor: pointer; }
|
|
8585
|
-
.md-icon-btn:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-
|
|
9057
|
+
.md-icon-btn:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-2); }
|
|
8586
9058
|
.md-icon-btn-text { font-size: 11px; }
|
|
8587
9059
|
.md-session-edit { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 2px 4px; }
|
|
8588
9060
|
.md-session-input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 12.5px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-radius: 6px; padding: 2px 6px; }
|
|
@@ -8603,7 +9075,7 @@ window.__ModuleLoader__.load({
|
|
|
8603
9075
|
.md-picker-note { flex: none; font-size: 11.5px; color: var(--dsw-alias-label-secondary); }
|
|
8604
9076
|
.md-picker-empty { padding: 24px 4px; font-size: 13px; color: var(--dsw-alias-label-secondary); }
|
|
8605
9077
|
.md-digest { width: min(760px, 94%); }
|
|
8606
|
-
.md-digest-text { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 12px; background: var(--dsw-alias-
|
|
9078
|
+
.md-digest-text { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 12px; background: var(--dsw-alias-bg-layer-2); border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; color: var(--dsw-alias-label-primary); }
|
|
8607
9079
|
.md-digest-actions { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
8608
9080
|
.md-refs-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
|
|
8609
9081
|
.md-refs-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 11.5px; color: var(--dsw-alias-label-secondary); }
|
|
@@ -8660,16 +9132,16 @@ window.__ModuleLoader__.load({
|
|
|
8660
9132
|
.md-annot[data-tool="pen"], .md-annot[data-tool="erase"], .md-annot[data-tool="text"] { pointer-events: auto; }
|
|
8661
9133
|
.md-annot[data-tool="line"], .md-annot[data-tool="arrow"], .md-annot[data-tool="rect"], .md-annot[data-tool="diamond"], .md-annot[data-tool="ellipse"] { pointer-events: auto; cursor: crosshair; }
|
|
8662
9134
|
.md-annot[data-tool="select"] { pointer-events: auto; cursor: default; }
|
|
8663
|
-
.md-annot-text.md-annot-selected { outline: 2px solid
|
|
9135
|
+
.md-annot-text.md-annot-selected { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 3px; border-radius: 3px; }
|
|
8664
9136
|
/* The vertical tool rail: collected PDF tools, revealed only while the pointer
|
|
8665
9137
|
is on the page edge, with a short fade/slide so it does not pop. */
|
|
8666
9138
|
.md-rail-wrap { position: absolute; top: 0; bottom: 0; z-index: 40; width: 30px; display: flex; align-items: center; justify-content: center; pointer-events: auto; }
|
|
8667
|
-
.md-rail-tab { position: absolute; top: 50%; transform: translateY(-50%); width: 18px; height: 58px; border-radius: 6px 0 0 6px; display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-right: none; box-shadow:
|
|
9139
|
+
.md-rail-tab { position: absolute; top: 50%; transform: translateY(-50%); width: 18px; height: 58px; border-radius: 6px 0 0 6px; display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-right: none; box-shadow: var(--dsw-elevation-soft); opacity: .9; z-index: 39; pointer-events: none; transition: opacity .18s ease; }
|
|
8668
9140
|
.md-rail-tab[data-side="right"] { right: 0; }
|
|
8669
9141
|
.md-rail-tab[data-side="left"] { left: 0; border-radius: 0 6px 6px 0; border-right: 1px solid var(--dsw-alias-border-l3); border-left: none; }
|
|
8670
9142
|
.md-rail-wrap[data-side="right"] { right: 0; }
|
|
8671
9143
|
.md-rail-wrap[data-side="left"] { left: 0; }
|
|
8672
|
-
.md-rail { display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; max-height: 78vh; overflow-y: auto; background: color-mix(in srgb, var(--dsw-alias-bg-base) 92%, transparent); border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px; box-shadow:
|
|
9144
|
+
.md-rail { display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; max-height: 78vh; overflow-y: auto; background: color-mix(in srgb, var(--dsw-alias-bg-base) 92%, transparent); border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px; box-shadow: var(--dsw-elevation-prominent); opacity: 0; transform: translateX(10px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
|
|
8673
9145
|
.md-rail-wrap[data-side="left"] .md-rail { transform: translateX(-10px); }
|
|
8674
9146
|
.md-rail-wrap:hover .md-rail, .md-rail:hover, .md-rail:focus-within, .md-rail[data-open="true"] { opacity: 1; transform: none; pointer-events: auto; }
|
|
8675
9147
|
.md-rail-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; }
|
|
@@ -8677,15 +9149,15 @@ window.__ModuleLoader__.load({
|
|
|
8677
9149
|
.md-rail-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent); color: var(--dsw-alias-brand-primary); }
|
|
8678
9150
|
.md-rail-btn:disabled { opacity: .35; cursor: default; }
|
|
8679
9151
|
.md-rail-sep { height: 1px; margin: 3px 4px; background: var(--dsw-alias-border-l2); }
|
|
8680
|
-
.md-selection-panel { position: absolute; top: 64px; z-index: 15; width: min(280px, 86vw); display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-radius: 10px; box-shadow:
|
|
9152
|
+
.md-selection-panel { position: absolute; top: 64px; z-index: 15; width: min(280px, 86vw); display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-radius: 10px; box-shadow: var(--dsw-elevation-prominent); }
|
|
8681
9153
|
.md-selection-panel[data-side="right"] { right: 58px; }
|
|
8682
9154
|
.md-selection-panel[data-side="left"] { left: 58px; }
|
|
8683
9155
|
.md-selection-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 550; color: var(--dsw-alias-label-primary); }
|
|
8684
|
-
.md-selection-delete { align-self: flex-start; color: var(--dsw-alias-
|
|
9156
|
+
.md-selection-delete { align-self: flex-start; color: var(--dsw-alias-state-error-primary); }
|
|
8685
9157
|
.md-selection-actions { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
8686
9158
|
.md-reader[data-rail="right"] .md-reader-stage { padding-right: 58px; }
|
|
8687
9159
|
.md-reader[data-rail="left"] .md-reader-stage { padding-left: 58px; }
|
|
8688
|
-
.md-rail-panel { position: absolute; top: 50%; transform: translateY(-50%); width: 260px; max-height: calc(100vh - 110px); overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: color-mix(in srgb, var(--dsw-alias-bg-base) 96%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--dsw-alias-border-l3); border-radius: 12px; box-shadow:
|
|
9160
|
+
.md-rail-panel { position: absolute; top: 50%; transform: translateY(-50%); width: 260px; max-height: calc(100vh - 110px); overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: color-mix(in srgb, var(--dsw-alias-bg-base) 96%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--dsw-alias-border-l3); border-radius: 12px; box-shadow: var(--dsw-elevation-prominent); z-index: 42; pointer-events: auto; }
|
|
8689
9161
|
.md-rail-panel[data-side="right"] { right: 28px; }
|
|
8690
9162
|
.md-rail-panel[data-side="left"] { left: 28px; }
|
|
8691
9163
|
.md-rail-panel-title { font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-primary); padding-bottom: 8px; border-bottom: 1px solid var(--dsw-alias-border-l2); }
|
|
@@ -8694,7 +9166,7 @@ window.__ModuleLoader__.load({
|
|
|
8694
9166
|
.md-side-rail-wrap { top: 44px; bottom: 0; }
|
|
8695
9167
|
.md-side-rail-tab { top: calc(50% + 22px); }
|
|
8696
9168
|
.md-shape-handles { position: absolute; inset: 0; pointer-events: none; }
|
|
8697
|
-
.md-shape-handle { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--dsw-alias-bg-base); border: 1.5px solid
|
|
9169
|
+
.md-shape-handle { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--dsw-alias-bg-base); border: 1.5px solid var(--dsw-alias-brand-primary); border-radius: 2px; pointer-events: auto; cursor: nwse-resize; }
|
|
8698
9170
|
.md-annot[data-tool="pen"] { cursor: crosshair; }
|
|
8699
9171
|
.md-annot[data-tool="text"] { cursor: text; }
|
|
8700
9172
|
.md-annot[data-tool="erase"] { cursor: cell; }
|
|
@@ -8711,7 +9183,7 @@ window.__ModuleLoader__.load({
|
|
|
8711
9183
|
.md-note-style { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 0; background: transparent; box-shadow: none; }
|
|
8712
9184
|
/* Text parameters now live in the toolbar: a nested menu, not a box on the page. */
|
|
8713
9185
|
.md-note-style-wrap { position: relative; display: inline-flex; align-items: center; }
|
|
8714
|
-
.md-note-style-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: min(280px, 82vw); display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-radius: 10px; box-shadow:
|
|
9186
|
+
.md-note-style-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: min(280px, 82vw); display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-border-l3); border-radius: 10px; box-shadow: var(--dsw-elevation-prominent); }
|
|
8715
9187
|
.md-note-style-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
|
|
8716
9188
|
.md-note-style-label { min-width: 34px; font-size: 11px; color: var(--dsw-alias-label-secondary); }
|
|
8717
9189
|
.md-note-style-btn { min-width: 20px; height: 20px; padding: 0 4px; font: inherit; font-size: 11px; line-height: 1; color: var(--dsw-alias-label-secondary); background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; text-shadow: 0 1px 2px color-mix(in srgb, var(--dsw-alias-bg-base) 90%, transparent); }
|
|
@@ -8720,7 +9192,7 @@ window.__ModuleLoader__.load({
|
|
|
8720
9192
|
.md-note-size-range { width: 74px; height: 16px; margin: 0; padding: 0; accent-color: var(--dsw-alias-brand-primary); cursor: pointer; }
|
|
8721
9193
|
.md-note-size-value { min-width: 30px; font-size: 10px; line-height: 1; color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px color-mix(in srgb, var(--dsw-alias-bg-base) 90%, transparent); }
|
|
8722
9194
|
.md-note-style-sep { width: 1px; height: 14px; margin: 0 2px; background: color-mix(in srgb, var(--dsw-alias-border-l3) 70%, transparent); }
|
|
8723
|
-
.md-note-color { width: 14px; height: 14px; padding: 0; border: 1px solid
|
|
9195
|
+
.md-note-color { width: 14px; height: 14px; padding: 0; border: 1px solid var(--dsw-alias-border-l3); border-radius: 50%; cursor: pointer; }
|
|
8724
9196
|
.md-note-color[data-on="true"] { box-shadow: 0 0 0 2px var(--dsw-alias-bg-base), 0 0 0 3px var(--dsw-alias-brand-primary); }
|
|
8725
9197
|
.md-note-input { box-sizing: border-box; width: 100%; min-height: 28px; max-height: 240px; overflow: auto; line-height: 1.35; padding: 2px; border-radius: 4px; border: none; background: transparent; box-shadow: none; outline: none; caret-color: currentColor; }
|
|
8726
9198
|
.md-note-input::placeholder { color: var(--dsw-alias-label-secondary); opacity: 0.85; }
|
|
@@ -8735,8 +9207,8 @@ window.__ModuleLoader__.load({
|
|
|
8735
9207
|
.md-annot-width { display: inline-flex; align-items: center; gap: 5px; padding: 0 2px; }
|
|
8736
9208
|
.md-annot-width input[type="range"] { width: 68px; accent-color: var(--dsw-alias-brand-primary); cursor: pointer; }
|
|
8737
9209
|
.md-annot-width-value { min-width: 28px; font-size: 11px; color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }
|
|
8738
|
-
.md-reader-note-overlay { color: var(--dsw-alias-state-
|
|
8739
|
-
.md-mask { position: absolute; box-sizing: border-box; overflow: visible; border: 1px dashed
|
|
9210
|
+
.md-reader-note-overlay { color: var(--dsw-alias-state-warn-primary, var(--dsw-alias-label-secondary)); }
|
|
9211
|
+
.md-mask { position: absolute; box-sizing: border-box; overflow: visible; border: 1px dashed color-mix(in srgb, var(--dsw-alias-brand-primary) 90%, transparent); }
|
|
8740
9212
|
/* The image is clipped by the inner wrapper, so the handles on the border are
|
|
8741
9213
|
not cut off. */
|
|
8742
9214
|
.md-mask-clip { position: absolute; inset: 0; overflow: hidden; }
|
|
@@ -8744,7 +9216,7 @@ window.__ModuleLoader__.load({
|
|
|
8744
9216
|
.md-mask-boxes { position: absolute; inset: 0; pointer-events: auto; }
|
|
8745
9217
|
.md-mask-boxes .md-mask { pointer-events: none; }
|
|
8746
9218
|
.md-mask-boxes .md-mask-active { border-style: solid; }
|
|
8747
|
-
.md-mask-handle { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px; background: var(--dsw-alias-bg-base); border: 1px solid
|
|
9219
|
+
.md-mask-handle { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px; background: var(--dsw-alias-bg-base); border: 1px solid var(--dsw-alias-brand-primary); box-shadow: var(--dsw-elevation-soft); pointer-events: auto; opacity: 0; transition: opacity .12s ease; }
|
|
8748
9220
|
.md-mask[data-hover='true'] .md-mask-handle, .md-mask-active .md-mask-handle, .md-annot-edit .md-mask-handle { opacity: 1; }
|
|
8749
9221
|
.md-mask-handle-nw { left: 0; top: 0; cursor: nwse-resize; }
|
|
8750
9222
|
.md-mask-handle-n { left: 50%; top: 0; cursor: ns-resize; }
|
|
@@ -8756,7 +9228,7 @@ window.__ModuleLoader__.load({
|
|
|
8756
9228
|
.md-mask-handle-w { left: 0; top: 50%; cursor: ew-resize; }
|
|
8757
9229
|
/* A drag on the box body draws the next box, so moving has its own grip: it
|
|
8758
9230
|
appears on hover and is the only target that starts a move besides Alt+drag. */
|
|
8759
|
-
.md-mask-grip { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--dsw-alias-bg-base) 92%, transparent); border: 1px solid
|
|
9231
|
+
.md-mask-grip { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--dsw-alias-bg-base) 92%, transparent); border: 1px solid var(--dsw-alias-brand-primary); color: var(--dsw-alias-brand-primary); cursor: move; pointer-events: auto; opacity: 0; transition: opacity .12s ease; }
|
|
8760
9232
|
.md-mask[data-hover='true'] .md-mask-grip, .md-mask-active .md-mask-grip, .md-annot-edit .md-mask-grip { opacity: 1; }
|
|
8761
9233
|
.md-mask-grip .md-icon { width: 12px; height: 12px; }
|
|
8762
9234
|
.md-mask-draft { border-style: solid; background: color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent); }
|
|
@@ -8780,16 +9252,16 @@ window.__ModuleLoader__.load({
|
|
|
8780
9252
|
}
|
|
8781
9253
|
.md-hidden { display: none; }
|
|
8782
9254
|
.md-desk-mark { position: absolute; right: -4px; top: -2px; width: 7px; height: 7px; border-radius: 50%; }
|
|
8783
|
-
.md-desk-done { background:
|
|
8784
|
-
.md-desk-error { background:
|
|
9255
|
+
.md-desk-done { background: var(--dsw-alias-state-success-primary); }
|
|
9256
|
+
.md-desk-error { background: var(--dsw-alias-state-error-primary); }
|
|
8785
9257
|
.md-desk-spin { background: transparent; border: 2px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 35%, transparent); border-top-color: var(--dsw-alias-brand-primary); width: 8px; height: 8px; animation: md-desk-spin .8s linear infinite; }
|
|
8786
9258
|
@keyframes md-desk-spin { to { transform: rotate(360deg); } }
|
|
8787
9259
|
.md-reader-coltitle { font-size: 12px; color: var(--dsw-alias-label-secondary); margin-right: auto; }
|
|
8788
9260
|
.md-reader-page-wrap { position: relative; display: inline-block; max-width: 100%; }
|
|
8789
9261
|
.md-blocklayer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
|
|
8790
|
-
.md-blockbox { position: absolute; box-sizing: border-box; border: 1px dashed
|
|
8791
|
-
.md-blockbox[data-kind="heading"] { border-color:
|
|
8792
|
-
.md-blockbox[data-kind="formula"] { border-color:
|
|
9262
|
+
.md-blockbox { position: absolute; box-sizing: border-box; border: 1px dashed color-mix(in srgb, var(--dsw-alias-state-error-primary) 85%, transparent); background: transparent; }
|
|
9263
|
+
.md-blockbox[data-kind="heading"] { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 95%, transparent); background: transparent; }
|
|
9264
|
+
.md-blockbox[data-kind="formula"] { border-color: color-mix(in srgb, var(--dsw-alias-state-success-primary) 95%, transparent); background: transparent; }
|
|
8793
9265
|
.md-reader-continuous { display: flex; flex-direction: column; align-items: safe center; gap: 18px; width: 100%; }
|
|
8794
9266
|
.md-reader-slot { display: flex; flex-direction: column; align-items: safe center; min-height: 240px; position: relative; }
|
|
8795
9267
|
.md-reader-ghost { justify-content: center; opacity: .55; }
|
|
@@ -8798,7 +9270,7 @@ window.__ModuleLoader__.load({
|
|
|
8798
9270
|
.md-reader-modes { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
|
|
8799
9271
|
.md-reader-subbar .md-btn { white-space: nowrap; flex: 0 0 auto; }
|
|
8800
9272
|
.md-reader-export { min-width: 92px; font-size: 12px; }
|
|
8801
|
-
.md-reader-modes .md-btn[aria-pressed="true"] { border-color: var(--dsw-alias-border-l4); background: var(--dsw-alias-
|
|
9273
|
+
.md-reader-modes .md-btn[aria-pressed="true"] { border-color: var(--dsw-alias-border-l4); background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
|
|
8802
9274
|
/* The block-box button stays pressed while its own boxes are on the page; the
|
|
8803
9275
|
next press is the cancel. */
|
|
8804
9276
|
.md-btn[aria-pressed="true"].md-blocks-toggle { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 60%, transparent); background: color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent); color: var(--dsw-alias-brand-primary); }
|
|
@@ -8831,7 +9303,7 @@ window.__ModuleLoader__.load({
|
|
|
8831
9303
|
.md-side-more { font-size: 15px; line-height: 1; padding: 2px 9px; }
|
|
8832
9304
|
/* With the toolbar hidden, the handle fades in on hover and sits in the stage's
|
|
8833
9305
|
top padding so it never covers the page itself. */
|
|
8834
|
-
.md-side-handle { position: absolute; top: 6px; right: 8px; z-index: 7; opacity: 0; transition: opacity .12s ease; font-size: 15px; line-height: 1; padding: 2px 9px; background: color-mix(in srgb, var(--dsw-alias-
|
|
9306
|
+
.md-side-handle { position: absolute; top: 6px; right: 8px; z-index: 7; opacity: 0; transition: opacity .12s ease; font-size: 15px; line-height: 1; padding: 2px 9px; background: color-mix(in srgb, var(--dsw-alias-bg-layer-2) 90%, transparent); }
|
|
8835
9307
|
.md-side:hover .md-side-handle, .md-side-handle:focus-visible { opacity: 1; }
|
|
8836
9308
|
.md-side[data-toolbar='hidden'] .md-side-body > .md-reader-stage { padding-top: 32px; }
|
|
8837
9309
|
.md-side-gap { flex: 1 1 auto; }
|
|
@@ -8842,10 +9314,10 @@ window.__ModuleLoader__.load({
|
|
|
8842
9314
|
.md-side-body > .md-reader-stage { padding: 8px 10px 16px; scrollbar-gutter: stable; }
|
|
8843
9315
|
.md-side .md-side-body > .md-reader-stage { padding-right: 40px; }
|
|
8844
9316
|
/* The developer readout (Ctrl+Alt+D): one small overlay, never takes a click. */
|
|
8845
|
-
.md-hud { position: absolute; left: 8px; bottom: 8px; z-index: 60; margin: 0; padding: 6px 8px; max-width: calc(100% - 16px); overflow: hidden; white-space: pre-wrap; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-
|
|
9317
|
+
.md-hud { position: absolute; left: 8px; bottom: 8px; z-index: 60; margin: 0; padding: 6px 8px; max-width: calc(100% - 16px); overflow: hidden; white-space: pre-wrap; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-base)); border: 1px solid var(--dsw-alias-border-l3); border-radius: 6px; pointer-events: none; opacity: 0.94; }
|
|
8846
9318
|
/* The preview's action list when the shared context menu service is absent. */
|
|
8847
9319
|
.md-fallback-backdrop { position: fixed; inset: 0; z-index: 80; }
|
|
8848
|
-
.md-fallback-menu { position: fixed; min-width: 190px; max-width: 240px; max-height: 70vh; overflow: auto; padding: 4px; background: var(--dsw-alias-
|
|
9320
|
+
.md-fallback-menu { position: fixed; min-width: 190px; max-width: 240px; max-height: 70vh; overflow: auto; padding: 4px; background: var(--dsw-alias-bg-layer-1); border: 1px solid var(--dsw-alias-border-l3); border-radius: 8px; box-shadow: var(--dsw-elevation-prominent); }
|
|
8849
9321
|
.md-fallback-row { display: block; width: 100%; padding: 6px 10px; font: inherit; font-size: 13px; text-align: left; color: var(--dsw-alias-label-primary); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
|
|
8850
9322
|
.md-fallback-row:hover:not(:disabled), .md-fallback-row:focus-visible { background: var(--dsw-alias-interactive-bg-hover); outline: none; }
|
|
8851
9323
|
.md-fallback-row:disabled { opacity: 0.45; cursor: default; }
|
|
@@ -8863,7 +9335,7 @@ body[data-pdfdesk-reading='1'] .dshwv-root { opacity: .28; }
|
|
|
8863
9335
|
.md-annot-edit[data-tool='mask'] { cursor: copy; }
|
|
8864
9336
|
/* The reader's overlay boxes, read-only: below the ink, above the page. */
|
|
8865
9337
|
.md-masks-readonly { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
|
|
8866
|
-
.md-masks-readonly .md-mask { border-color: color-mix(in srgb,
|
|
9338
|
+
.md-masks-readonly .md-mask { border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, transparent); }
|
|
8867
9339
|
.md-root :focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
|
|
8868
9340
|
html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-clearance, 48px) + 4px); }
|
|
8869
9341
|
@container pdfdesk (max-width: 620px) {
|
|
@@ -8900,6 +9372,7 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
8900
9372
|
*/
|
|
8901
9373
|
function SidePdfView(props) {
|
|
8902
9374
|
useT()
|
|
9375
|
+
const mathMode = useWorkflowMode() === 'math'
|
|
8903
9376
|
const info = props.useTabInfo()
|
|
8904
9377
|
const target = sideTarget(info.tab.contentId)
|
|
8905
9378
|
// A restored tab record may carry no navigation yet.
|
|
@@ -10036,9 +10509,9 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
10036
10509
|
},
|
|
10037
10510
|
],
|
|
10038
10511
|
},
|
|
10039
|
-
]
|
|
10512
|
+
].filter(item => mathMode || item.id !== 'sessions')
|
|
10040
10513
|
// The action bodies read `menuState`, so only the constructors matter.
|
|
10041
|
-
}, [fitToColumn, goPage, toggleAutoFit, toggleFollow, zoomTo])
|
|
10514
|
+
}, [fitToColumn, goPage, mathMode, toggleAutoFit, toggleFollow, zoomTo])
|
|
10042
10515
|
|
|
10043
10516
|
const openSideMenu = useCallback(event => {
|
|
10044
10517
|
if (event !== null && event !== undefined) {
|
|
@@ -10285,77 +10758,77 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
10285
10758
|
}, '⋯')),
|
|
10286
10759
|
h('div', { className: 'md-side-body' }, body),
|
|
10287
10760
|
h('div', { className: 'md-rail-tab md-side-rail-tab', 'data-side': 'right', 'aria-hidden': true }, '‹'),
|
|
10288
|
-
h('div', {
|
|
10289
|
-
className: 'md-rail-wrap md-side-rail-wrap',
|
|
10290
|
-
'data-side': 'right',
|
|
10291
|
-
onPointerLeave: leaveSidePanel,
|
|
10292
|
-
},
|
|
10293
|
-
h('div', { className: 'md-rail md-side-rail' },
|
|
10294
|
-
sideRailTool('pen', 'annotPen', 'M12 20h9M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'),
|
|
10295
|
-
sideRailTool('erase', 'annotErase', 'm7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21M22 21H7M5 11l9 9'),
|
|
10296
|
-
sideRailTool('text', 'annotText', 'M4 6h16M12 6v13M9 19h6'),
|
|
10297
|
-
sideRailTool('line', 'shapeLine', 'M4 20 20 4'),
|
|
10298
|
-
sideRailTool('arrow', 'shapeArrow', 'M4 20 20 4M10 4h10v10'),
|
|
10299
|
-
sideRailTool('rect', 'shapeRect', 'M4 5h16v14H4z'),
|
|
10300
|
-
sideRailTool('diamond', 'shapeDiamond', 'M12 3 21 12 12 21 3 12z'),
|
|
10301
|
-
sideRailTool('ellipse', 'shapeEllipse', 'M12 5c5 0 8 3 8 7s-3 7-8 7-8-3-8-7 3-7 8-7z'),
|
|
10302
|
-
sideRailTool('mask', 'overlayToggle', 'M4 4h16v16H4zM8 4v16M16 4v16'),
|
|
10303
|
-
h('span', { className: 'md-rail-sep', 'aria-hidden': true }),
|
|
10304
|
-
h('button', {
|
|
10305
|
-
type: 'button', className: 'md-rail-btn',
|
|
10306
|
-
disabled: historyCounts.undo === 0,
|
|
10307
|
-
title: format('undoHint'), 'aria-label': format('undo'),
|
|
10308
|
-
onClick: () => undoPage(),
|
|
10309
|
-
}, annotIcon('M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3')),
|
|
10310
|
-
h('button', {
|
|
10311
|
-
type: 'button', className: 'md-rail-btn',
|
|
10312
|
-
disabled: historyCounts.redo === 0,
|
|
10313
|
-
title: format('redoHint'), 'aria-label': format('redo'),
|
|
10314
|
-
onClick: () => redoPage(),
|
|
10315
|
-
}, annotIcon('M15 14l5-5-5-5M20 9H9a5 5 0 0 0 0 10h3'))
|
|
10316
|
-
),
|
|
10317
|
-
sidePanel && sidePanelTool !== ''
|
|
10318
|
-
? h('div', {
|
|
10319
|
-
className: 'md-rail-panel',
|
|
10320
|
-
'data-side': 'right',
|
|
10321
|
-
style: sideAnchor === null ? undefined : { top: `${sideAnchor}px` },
|
|
10322
|
-
},
|
|
10323
|
-
h('div', { className: 'md-rail-panel-title' },
|
|
10324
|
-
`${format('toolSettings')} · ${format(TOOL_LABELS[sidePanelTool] ?? 'annotPen')}`),
|
|
10325
|
-
sidePanelTool === 'text'
|
|
10326
|
-
? h(NoteStyleControls, { style: noteEdit ?? noteStyle, onChange: changeNoteStyle })
|
|
10327
|
-
: sidePanelTool === 'mask'
|
|
10328
|
-
? h('p', { className: 'md-rail-panel-hint' }, format('toolPanelMaskHint'))
|
|
10329
|
-
: sidePanelTool === 'erase'
|
|
10330
|
-
? h('p', { className: 'md-rail-panel-hint' }, format('annotEraseHint'))
|
|
10331
|
-
: h(React.Fragment, null,
|
|
10332
|
-
h('div', { className: 'md-note-style-row' },
|
|
10333
|
-
h('span', { className: 'md-note-style-label' }, format('annotColor')),
|
|
10334
|
-
['#1f1f1f', '#e0554a', '#2f6df6', '#2ecc71'].map(color => h('button', {
|
|
10335
|
-
key: color,
|
|
10336
|
-
type: 'button',
|
|
10337
|
-
className: 'md-note-color',
|
|
10338
|
-
style: { background: color },
|
|
10339
|
-
'data-on': sideColor === color ? 'true' : undefined,
|
|
10340
|
-
'aria-label': color,
|
|
10341
|
-
onMouseDown: event => event.preventDefault(),
|
|
10342
|
-
onClick: () => setSideColor(color),
|
|
10343
|
-
}))
|
|
10344
|
-
),
|
|
10345
|
-
h('div', { className: 'md-note-style-row' },
|
|
10346
|
-
h('span', { className: 'md-note-style-label' }, format('annotWidthHint')),
|
|
10347
|
-
h('input', {
|
|
10348
|
-
type: 'range', min: 1, max: 10, step: 1,
|
|
10349
|
-
value: sideWidth,
|
|
10350
|
-
'aria-label': format('annotWidthHint'),
|
|
10351
|
-
onChange: event => setSideWidth(Number(event.target.value) || 2),
|
|
10352
|
-
}),
|
|
10353
|
-
h('span', { className: 'md-note-size-value' }, `${sideWidth}px`)
|
|
10354
|
-
)
|
|
10355
|
-
)
|
|
10356
|
-
)
|
|
10357
|
-
: null
|
|
10358
|
-
),
|
|
10761
|
+
h('div', {
|
|
10762
|
+
className: 'md-rail-wrap md-side-rail-wrap',
|
|
10763
|
+
'data-side': 'right',
|
|
10764
|
+
onPointerLeave: leaveSidePanel,
|
|
10765
|
+
},
|
|
10766
|
+
h('div', { className: 'md-rail md-side-rail' },
|
|
10767
|
+
sideRailTool('pen', 'annotPen', 'M12 20h9M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'),
|
|
10768
|
+
sideRailTool('erase', 'annotErase', 'm7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21M22 21H7M5 11l9 9'),
|
|
10769
|
+
sideRailTool('text', 'annotText', 'M4 6h16M12 6v13M9 19h6'),
|
|
10770
|
+
sideRailTool('line', 'shapeLine', 'M4 20 20 4'),
|
|
10771
|
+
sideRailTool('arrow', 'shapeArrow', 'M4 20 20 4M10 4h10v10'),
|
|
10772
|
+
sideRailTool('rect', 'shapeRect', 'M4 5h16v14H4z'),
|
|
10773
|
+
sideRailTool('diamond', 'shapeDiamond', 'M12 3 21 12 12 21 3 12z'),
|
|
10774
|
+
sideRailTool('ellipse', 'shapeEllipse', 'M12 5c5 0 8 3 8 7s-3 7-8 7-8-3-8-7 3-7 8-7z'),
|
|
10775
|
+
sideRailTool('mask', 'overlayToggle', 'M4 4h16v16H4zM8 4v16M16 4v16'),
|
|
10776
|
+
h('span', { className: 'md-rail-sep', 'aria-hidden': true }),
|
|
10777
|
+
h('button', {
|
|
10778
|
+
type: 'button', className: 'md-rail-btn',
|
|
10779
|
+
disabled: historyCounts.undo === 0,
|
|
10780
|
+
title: format('undoHint'), 'aria-label': format('undo'),
|
|
10781
|
+
onClick: () => undoPage(),
|
|
10782
|
+
}, annotIcon('M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3')),
|
|
10783
|
+
h('button', {
|
|
10784
|
+
type: 'button', className: 'md-rail-btn',
|
|
10785
|
+
disabled: historyCounts.redo === 0,
|
|
10786
|
+
title: format('redoHint'), 'aria-label': format('redo'),
|
|
10787
|
+
onClick: () => redoPage(),
|
|
10788
|
+
}, annotIcon('M15 14l5-5-5-5M20 9H9a5 5 0 0 0 0 10h3'))
|
|
10789
|
+
),
|
|
10790
|
+
sidePanel && sidePanelTool !== ''
|
|
10791
|
+
? h('div', {
|
|
10792
|
+
className: 'md-rail-panel',
|
|
10793
|
+
'data-side': 'right',
|
|
10794
|
+
style: sideAnchor === null ? undefined : { top: `${sideAnchor}px` },
|
|
10795
|
+
},
|
|
10796
|
+
h('div', { className: 'md-rail-panel-title' },
|
|
10797
|
+
`${format('toolSettings')} · ${format(TOOL_LABELS[sidePanelTool] ?? 'annotPen')}`),
|
|
10798
|
+
sidePanelTool === 'text'
|
|
10799
|
+
? h(NoteStyleControls, { style: noteEdit ?? noteStyle, onChange: changeNoteStyle })
|
|
10800
|
+
: sidePanelTool === 'mask'
|
|
10801
|
+
? h('p', { className: 'md-rail-panel-hint' }, format('toolPanelMaskHint'))
|
|
10802
|
+
: sidePanelTool === 'erase'
|
|
10803
|
+
? h('p', { className: 'md-rail-panel-hint' }, format('annotEraseHint'))
|
|
10804
|
+
: h(React.Fragment, null,
|
|
10805
|
+
h('div', { className: 'md-note-style-row' },
|
|
10806
|
+
h('span', { className: 'md-note-style-label' }, format('annotColor')),
|
|
10807
|
+
['#1f1f1f', '#e0554a', '#2f6df6', '#2ecc71'].map(color => h('button', {
|
|
10808
|
+
key: color,
|
|
10809
|
+
type: 'button',
|
|
10810
|
+
className: 'md-note-color',
|
|
10811
|
+
style: { background: color },
|
|
10812
|
+
'data-on': sideColor === color ? 'true' : undefined,
|
|
10813
|
+
'aria-label': color,
|
|
10814
|
+
onMouseDown: event => event.preventDefault(),
|
|
10815
|
+
onClick: () => setSideColor(color),
|
|
10816
|
+
}))
|
|
10817
|
+
),
|
|
10818
|
+
h('div', { className: 'md-note-style-row' },
|
|
10819
|
+
h('span', { className: 'md-note-style-label' }, format('annotWidthHint')),
|
|
10820
|
+
h('input', {
|
|
10821
|
+
type: 'range', min: 1, max: 10, step: 1,
|
|
10822
|
+
value: sideWidth,
|
|
10823
|
+
'aria-label': format('annotWidthHint'),
|
|
10824
|
+
onChange: event => setSideWidth(Number(event.target.value) || 2),
|
|
10825
|
+
}),
|
|
10826
|
+
h('span', { className: 'md-note-size-value' }, `${sideWidth}px`)
|
|
10827
|
+
)
|
|
10828
|
+
)
|
|
10829
|
+
)
|
|
10830
|
+
: null
|
|
10831
|
+
),
|
|
10359
10832
|
diag
|
|
10360
10833
|
? h(DiagPanel, {
|
|
10361
10834
|
lines: [
|
|
@@ -10482,6 +10955,14 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
10482
10955
|
const [phase, setPhase] = useState('loading')
|
|
10483
10956
|
const [error, setError] = useState('')
|
|
10484
10957
|
const [notice, setNotice] = useState('')
|
|
10958
|
+
const activeWorkflow = useWorkflowMode()
|
|
10959
|
+
const mathMode = activeWorkflow === 'math'
|
|
10960
|
+
const [envPrompt, setEnvPrompt] = useState('')
|
|
10961
|
+
const [workspaces, setWorkspaces] = useState([])
|
|
10962
|
+
const [workspacePrompt, setWorkspacePrompt] = useState(null)
|
|
10963
|
+
const workspaceTarget = useRef(null)
|
|
10964
|
+
const workspaceRequest = useRef(null)
|
|
10965
|
+
const inFlightSessions = useRef(new Set())
|
|
10485
10966
|
const [reloadKey, setReloadKey] = useState(0)
|
|
10486
10967
|
// A chapter the right column asked to open, held until the catalog knows it.
|
|
10487
10968
|
const [deskRequest, setDeskRequest] = useState(null)
|
|
@@ -10569,6 +11050,7 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
10569
11050
|
}
|
|
10570
11051
|
})
|
|
10571
11052
|
const [settingsOpen, setSettingsOpen] = useState(false)
|
|
11053
|
+
const [settingsTab, setSettingsTab] = useState('reading')
|
|
10572
11054
|
// Which edge the vertical tool rail sits on; a page reload keeps the choice.
|
|
10573
11055
|
const [railSide, setRailSide] = useState(() => {
|
|
10574
11056
|
try {
|
|
@@ -10587,7 +11069,7 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
10587
11069
|
}
|
|
10588
11070
|
})
|
|
10589
11071
|
const [socratic, setSocratic] = useState(() => socraticEnabled())
|
|
10590
|
-
const [envTools, setEnvTools] = useState({ python: false, tex: false })
|
|
11072
|
+
const [envTools, setEnvTools] = useState({ python: false, tex: false, apiKey: false })
|
|
10591
11073
|
useEffect(() => {
|
|
10592
11074
|
if (!settingsOpen) return undefined
|
|
10593
11075
|
const onDown = event => {
|
|
@@ -11444,6 +11926,21 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
11444
11926
|
if (Array.isArray(codes)) expandedByBook[id] = codes.filter(code => typeof code === 'string')
|
|
11445
11927
|
}
|
|
11446
11928
|
const known = typeof stored.bookId === 'string' && books.some(book => book.id === stored.bookId)
|
|
11929
|
+
const libraryId = data.library !== null && typeof data.library === 'object' && typeof data.library.id === 'string' ? data.library.id : ''
|
|
11930
|
+
const storedWorkspace = readStoredWorkspace(libraryId)
|
|
11931
|
+
const storedWorkspaceEntry = storedWorkspace !== null && Array.isArray(data.workspaces)
|
|
11932
|
+
? data.workspaces.find(item => item !== null && typeof item === 'object' && item.id === storedWorkspace.workspaceId)
|
|
11933
|
+
: null
|
|
11934
|
+
if (storedWorkspace !== null && storedWorkspaceEntry === undefined) clearStoredWorkspace(libraryId)
|
|
11935
|
+
const effectiveTarget = storedWorkspaceEntry !== null && storedWorkspaceEntry !== undefined
|
|
11936
|
+
? { workspaceId: storedWorkspaceEntry.id, cwd: typeof storedWorkspaceEntry.path === 'string' ? storedWorkspaceEntry.path : storedWorkspace.cwd }
|
|
11937
|
+
: data.target !== null && typeof data.target === 'object'
|
|
11938
|
+
? {
|
|
11939
|
+
workspaceId: typeof data.target.workspaceId === 'string' && data.target.workspaceId !== '' ? data.target.workspaceId : null,
|
|
11940
|
+
cwd: typeof data.target.cwd === 'string' ? data.target.cwd : '',
|
|
11941
|
+
}
|
|
11942
|
+
: { workspaceId: null, cwd: '' }
|
|
11943
|
+
workspaceTarget.current = effectiveTarget.workspaceId === null ? null : effectiveTarget
|
|
11447
11944
|
setCatalog({
|
|
11448
11945
|
books,
|
|
11449
11946
|
skipped: Array.isArray(data.skipped) ? data.skipped : [],
|
|
@@ -11457,12 +11954,7 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
11457
11954
|
fragmentDir: typeof data.fragmentDir === 'string' ? data.fragmentDir : '',
|
|
11458
11955
|
artifactDir: typeof data.artifactDir === 'string' ? data.artifactDir : '',
|
|
11459
11956
|
resumeRatio: typeof data.resumeRatio === 'number' ? data.resumeRatio : 0.85,
|
|
11460
|
-
target:
|
|
11461
|
-
? {
|
|
11462
|
-
workspaceId: typeof data.target.workspaceId === 'string' && data.target.workspaceId !== '' ? data.target.workspaceId : null,
|
|
11463
|
-
cwd: typeof data.target.cwd === 'string' ? data.target.cwd : '',
|
|
11464
|
-
}
|
|
11465
|
-
: { workspaceId: null, cwd: '' },
|
|
11957
|
+
target: effectiveTarget,
|
|
11466
11958
|
})
|
|
11467
11959
|
setLibs(data.libraries !== null && typeof data.libraries === 'object' && Array.isArray(data.libraries.items)
|
|
11468
11960
|
? { items: data.libraries.items, activeId: typeof data.libraries.activeId === 'string' ? data.libraries.activeId : '' }
|
|
@@ -11473,7 +11965,11 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
11473
11965
|
const shelves = Array.isArray(groups.shelves)
|
|
11474
11966
|
? groups.shelves.filter(item => item !== null && typeof item === 'object' && typeof item.id === 'string' && typeof item.name === 'string')
|
|
11475
11967
|
: []
|
|
11476
|
-
setEnvTools(data.environment !== null && typeof data.environment === 'object' ? { python: data.environment.python === true, tex: data.environment.tex === true } : { python: false, tex: false })
|
|
11968
|
+
setEnvTools(data.environment !== null && typeof data.environment === 'object' ? { python: data.environment.python === true, tex: data.environment.tex === true, apiKey: data.environment.apiKey === true } : { python: false, tex: false, apiKey: false })
|
|
11969
|
+
setWorkspaces(Array.isArray(data.workspaces)
|
|
11970
|
+
? data.workspaces.filter(item => item !== null && typeof item === 'object'
|
|
11971
|
+
&& typeof item.id === 'string' && typeof item.path === 'string')
|
|
11972
|
+
: [])
|
|
11477
11973
|
setShelfGroups({ hidden, shelves })
|
|
11478
11974
|
// Refresh re-reads data; it must not lose the shelf you are looking at.
|
|
11479
11975
|
setGroup(previous => {
|
|
@@ -11968,9 +12464,9 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
11968
12464
|
for (const [id, entry] of Object.entries(pendingRef.current ?? {})) {
|
|
11969
12465
|
if (entry.bookId !== bookId || entry.code !== code || entry.mode !== mode) continue
|
|
11970
12466
|
const summary = sessionList === null || sessionList.byId === undefined ? undefined : sessionList.byId[id]
|
|
11971
|
-
if (summary
|
|
12467
|
+
if (summary !== undefined && summary.blank !== true) continue
|
|
11972
12468
|
if (archivedIds.has(id)) continue
|
|
11973
|
-
return { id, pending: true }
|
|
12469
|
+
return { id, pending: true, blank: true }
|
|
11974
12470
|
}
|
|
11975
12471
|
if (sessionList === null || sessionList === undefined || sessionList.phase !== 'ready' || !Array.isArray(sessionList.ids)) return null
|
|
11976
12472
|
let best = null
|
|
@@ -11983,9 +12479,9 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
11983
12479
|
?? books.find(item => item.title === parsed.bookKey)
|
|
11984
12480
|
if (book === undefined || book.id !== bookId) continue
|
|
11985
12481
|
const updatedAt = typeof summary.updatedAt === 'number' ? summary.updatedAt : 0
|
|
11986
|
-
if (best === null || updatedAt > best.updatedAt) best = { id, updatedAt }
|
|
12482
|
+
if (best === null || updatedAt > best.updatedAt) best = { id, updatedAt, blank: summary.blank === true }
|
|
11987
12483
|
}
|
|
11988
|
-
return best === null ? null : { id: best.id, pending: false }
|
|
12484
|
+
return best === null ? null : { id: best.id, pending: false, blank: best.blank }
|
|
11989
12485
|
}, [archivedIds, books, sessionList])
|
|
11990
12486
|
|
|
11991
12487
|
/**
|
|
@@ -12048,6 +12544,53 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12048
12544
|
return sessionSeedText(bookRow, chapter, position, paths ?? null, typeof persona === 'string' ? persona : '')
|
|
12049
12545
|
}, [])
|
|
12050
12546
|
|
|
12547
|
+
/**
|
|
12548
|
+
* Restore the address seed when a blank session's draft is empty, without
|
|
12549
|
+
* appending it to a draft the user is already editing.
|
|
12550
|
+
* @param {string} sessionId - the session about to open.
|
|
12551
|
+
* @param {object} chapter - catalog chapter row.
|
|
12552
|
+
* @param {string} mode - session type.
|
|
12553
|
+
* @returns {Promise<void>} completion (best effort).
|
|
12554
|
+
*/
|
|
12555
|
+
const seedExistingSession = useCallback(async (sessionId, chapter, mode) => {
|
|
12556
|
+
if (book === null || catalog === null) return
|
|
12557
|
+
const paths = {
|
|
12558
|
+
libraryDir: typeof catalog.libraryDir === 'string' ? catalog.libraryDir : '',
|
|
12559
|
+
bookDir: typeof catalog.fragmentDir === 'string' && catalog.fragmentDir !== ''
|
|
12560
|
+
&& typeof book.dir === 'string' && book.dir !== ''
|
|
12561
|
+
? `${catalog.fragmentDir}\\${book.dir}`
|
|
12562
|
+
: '',
|
|
12563
|
+
pdfPath: typeof chapter.pdfPath === 'string' ? chapter.pdfPath : '',
|
|
12564
|
+
artifactDir: typeof catalog.artifactDir === 'string' && catalog.artifactDir !== ''
|
|
12565
|
+
? `${catalog.artifactDir}\\${book.id}\\${chapter.code}\\`
|
|
12566
|
+
: '',
|
|
12567
|
+
}
|
|
12568
|
+
let persona = ''
|
|
12569
|
+
if (mode === 'qa' && socraticEnabled()) {
|
|
12570
|
+
try {
|
|
12571
|
+
const payload = await request('GET', 'qa-persona')
|
|
12572
|
+
persona = typeof payload.persona === 'string' ? payload.persona.trim() : ''
|
|
12573
|
+
} catch {
|
|
12574
|
+
// The context seed is still useful without the optional persona.
|
|
12575
|
+
}
|
|
12576
|
+
}
|
|
12577
|
+
const draft = mode === GENERAL_MODE
|
|
12578
|
+
? [
|
|
12579
|
+
`${format('generalSeedBook')}:${book.title === '' ? book.id : `${book.title}(${book.id})`}`,
|
|
12580
|
+
`${format('generalSeedLibrary')}:${paths.libraryDir}`,
|
|
12581
|
+
paths.bookDir === '' ? '' : `${format('generalSeedBookDir')}:${paths.bookDir}`,
|
|
12582
|
+
paths.pdfPath === '' ? '' : `${format('generalSeedPdf')}:${paths.pdfPath}`,
|
|
12583
|
+
].filter(Boolean).join('\n')
|
|
12584
|
+
: `${seedFor(book, chapter, paths, persona)}\n\n${format('sessionQuestionLead')}`
|
|
12585
|
+
const prefill = await beginPrefill(sessionId, draft, 'keep')
|
|
12586
|
+
if (prefill.applied && persona !== '') {
|
|
12587
|
+
try { window.localStorage.setItem(`pdfdesk:qa-persona:${sessionId}`, '1') } catch { /* storage unavailable */ }
|
|
12588
|
+
}
|
|
12589
|
+
if (prefill.reference !== null) {
|
|
12590
|
+
try { prefill.reference.release() } catch { /* already released */ }
|
|
12591
|
+
}
|
|
12592
|
+
}, [beginPrefill, book, catalog, seedFor])
|
|
12593
|
+
|
|
12051
12594
|
/**
|
|
12052
12595
|
* Whether the right column would open our own chapter tab. An address no
|
|
12053
12596
|
* type claims would throw inside `openResource`, so ask the registry first.
|
|
@@ -12133,9 +12676,9 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12133
12676
|
|
|
12134
12677
|
const createSession = useCallback(async (chapter, mode, options) => {
|
|
12135
12678
|
if (book === null || catalog === null || creatingRef.current) return
|
|
12136
|
-
const target = catalog.target
|
|
12137
|
-
if (target.workspaceId === null
|
|
12138
|
-
setCreateError({ bookId: book.id, code: chapter.code, message: format('
|
|
12679
|
+
const target = options !== undefined && options.target !== undefined ? options.target : catalog.target
|
|
12680
|
+
if (target.workspaceId === null || target.workspaceId === '') {
|
|
12681
|
+
setCreateError({ bookId: book.id, code: chapter.code, message: format('workspaceRequired') })
|
|
12139
12682
|
return
|
|
12140
12683
|
}
|
|
12141
12684
|
creatingRef.current = true
|
|
@@ -12210,31 +12753,45 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12210
12753
|
? `${catalog.artifactDir}\\${book.id}\\${chapter.code}\\`
|
|
12211
12754
|
: '',
|
|
12212
12755
|
}
|
|
12213
|
-
// The Q&A persona is part of the same initial prompt as the paths: one
|
|
12214
|
-
// block the model reads before the user's question, gated by Settings.
|
|
12215
12756
|
let persona = ''
|
|
12216
12757
|
let personaFailed = false
|
|
12217
|
-
if (mode === 'qa' && socraticEnabled()) {
|
|
12218
|
-
try {
|
|
12219
|
-
const payload = await request('GET', 'qa-persona')
|
|
12220
|
-
persona = typeof payload.persona === 'string' ? payload.persona.trim() : ''
|
|
12221
|
-
} catch {
|
|
12222
|
-
personaFailed = true
|
|
12223
|
-
}
|
|
12224
|
-
}
|
|
12225
|
-
const parts = [seedFor(book, chapter, paths, persona)]
|
|
12226
|
-
if (artifact !== '') parts.push(`产物:${artifact}(本章产物区里的这个文件)`)
|
|
12227
12758
|
let hasOutline = false
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12759
|
+
let draft
|
|
12760
|
+
if (mode === GENERAL_MODE) {
|
|
12761
|
+
// The universal session carries only addresses: no persona, no
|
|
12762
|
+
// outline, no question lead and no purpose prompt.
|
|
12763
|
+
const bookDir = paths !== null && typeof paths.bookDir === 'string' ? paths.bookDir : ''
|
|
12764
|
+
const pdfPath = paths !== null && typeof paths.pdfPath === 'string' ? paths.pdfPath : ''
|
|
12765
|
+
draft = [
|
|
12766
|
+
`${format('generalSeedBook')}:${book.title === '' ? book.id : `${book.title}(${book.id})`}`,
|
|
12767
|
+
`${format('generalSeedLibrary')}:${paths === null ? '' : paths.libraryDir}`,
|
|
12768
|
+
bookDir === '' ? '' : `${format('generalSeedBookDir')}:${bookDir}`,
|
|
12769
|
+
pdfPath === '' ? '' : `${format('generalSeedPdf')}:${pdfPath}`,
|
|
12770
|
+
].filter(Boolean).join('\n')
|
|
12771
|
+
} else {
|
|
12772
|
+
// The Q&A persona is part of the same initial prompt as the paths:
|
|
12773
|
+
// one block the model reads before the user's question, gated by Settings.
|
|
12774
|
+
if (mode === 'qa' && socraticEnabled()) {
|
|
12775
|
+
try {
|
|
12776
|
+
const payload = await request('GET', 'qa-persona')
|
|
12777
|
+
persona = typeof payload.persona === 'string' ? payload.persona.trim() : ''
|
|
12778
|
+
} catch {
|
|
12779
|
+
personaFailed = true
|
|
12780
|
+
}
|
|
12233
12781
|
}
|
|
12782
|
+
const parts = [seedFor(book, chapter, paths, persona)]
|
|
12783
|
+
if (artifact !== '') parts.push(`产物:${artifact}(本章产物区里的这个文件)`)
|
|
12784
|
+
if (continuation >= 2) {
|
|
12785
|
+
const outline = await loadOutline(book.id, chapter.code)
|
|
12786
|
+
if (outline !== '') {
|
|
12787
|
+
parts.push(outline)
|
|
12788
|
+
hasOutline = true
|
|
12789
|
+
}
|
|
12790
|
+
}
|
|
12791
|
+
// End every preset prompt with a lead-in: some hosts mishandle a prompt
|
|
12792
|
+
// that ends without a separator, and this line gives the user a cursor.
|
|
12793
|
+
draft = `${parts.join('\n\n')}\n\n${format('sessionQuestionLead')}`
|
|
12234
12794
|
}
|
|
12235
|
-
// End every preset prompt with a lead-in: some hosts mishandle a prompt
|
|
12236
|
-
// that ends without a separator, and this line gives the user a cursor.
|
|
12237
|
-
const draft = `${parts.join('\n\n')}\n\n${format('sessionQuestionLead')}`
|
|
12238
12795
|
let draftReference = null
|
|
12239
12796
|
const prefill = await beginPrefill(sessionId, draft)
|
|
12240
12797
|
if (prefill.applied) {
|
|
@@ -12287,8 +12844,68 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12287
12844
|
* does; the chapter page does not); `forceNew` skips continuing on purpose.
|
|
12288
12845
|
* @returns {Promise<void>} completion.
|
|
12289
12846
|
*/
|
|
12847
|
+
const resolveWorkspacePrompt = useCallback(target => {
|
|
12848
|
+
workspaceRequest.current = null
|
|
12849
|
+
setWorkspacePrompt(current => {
|
|
12850
|
+
if (current !== null) current.resolve(target)
|
|
12851
|
+
return null
|
|
12852
|
+
})
|
|
12853
|
+
}, [])
|
|
12854
|
+
|
|
12855
|
+
/**
|
|
12856
|
+
* A session needs an explicit workspace. Never silently fall back to a
|
|
12857
|
+
* cwd: when the library has no owning workspace, ask the user.
|
|
12858
|
+
* @returns {Promise<{ workspaceId: string, cwd: string } | null>} the chosen target, or null when cancelled.
|
|
12859
|
+
*/
|
|
12860
|
+
const ensureWorkspaceTarget = useCallback(async () => {
|
|
12861
|
+
const chosen = workspaceTarget.current
|
|
12862
|
+
if (chosen !== null && typeof chosen.workspaceId === 'string' && chosen.workspaceId !== '') return chosen
|
|
12863
|
+
if (workspaceRequest.current !== null) return await workspaceRequest.current
|
|
12864
|
+
if (catalog !== null && catalog.target !== null && typeof catalog.target.workspaceId === 'string' && catalog.target.workspaceId !== '') {
|
|
12865
|
+
return { workspaceId: catalog.target.workspaceId, cwd: typeof catalog.target.cwd === 'string' ? catalog.target.cwd : '' }
|
|
12866
|
+
}
|
|
12867
|
+
const request = new Promise(resolve => setWorkspacePrompt({ resolve }))
|
|
12868
|
+
workspaceRequest.current = request
|
|
12869
|
+
return await request
|
|
12870
|
+
}, [catalog])
|
|
12871
|
+
|
|
12872
|
+
const createWorkspace = useCallback(async path => {
|
|
12873
|
+
const service = clientContext === null || clientContext === undefined ? null : clientContext.get('workspaces')
|
|
12874
|
+
if (service === null || service === undefined || typeof service.create !== 'function') {
|
|
12875
|
+
throw new Error(format('workspaceUnavailable'))
|
|
12876
|
+
}
|
|
12877
|
+
let view
|
|
12878
|
+
try {
|
|
12879
|
+
view = await service.create({ path })
|
|
12880
|
+
} catch (error) {
|
|
12881
|
+
throw new Error(`${format('workspaceCreateFailed')} (${errorText(error)})`)
|
|
12882
|
+
}
|
|
12883
|
+
const target = { workspaceId: String(view.id), cwd: typeof view.path === 'string' ? view.path : path }
|
|
12884
|
+
workspaceTarget.current = target
|
|
12885
|
+
if (library !== null) writeStoredWorkspace(library.id, target)
|
|
12886
|
+
setCatalog(current => current === null ? current : { ...current, target })
|
|
12887
|
+
setWorkspaces(current => {
|
|
12888
|
+
const entry = { id: target.workspaceId, title: typeof view.title === 'string' ? view.title : '', path: target.cwd }
|
|
12889
|
+
return [entry, ...current.filter(item => item.id !== entry.id)]
|
|
12890
|
+
})
|
|
12891
|
+
resolveWorkspacePrompt(target)
|
|
12892
|
+
return target
|
|
12893
|
+
}, [library, resolveWorkspacePrompt])
|
|
12894
|
+
|
|
12895
|
+
const pickWorkspace = useCallback(workspace => {
|
|
12896
|
+
const target = { workspaceId: String(workspace.id), cwd: workspace.path }
|
|
12897
|
+
workspaceTarget.current = target
|
|
12898
|
+
if (library !== null) writeStoredWorkspace(library.id, target)
|
|
12899
|
+
setCatalog(current => current === null ? current : { ...current, target })
|
|
12900
|
+
resolveWorkspacePrompt(target)
|
|
12901
|
+
}, [library, resolveWorkspacePrompt])
|
|
12902
|
+
|
|
12290
12903
|
const resumeOrCreate = useCallback(async (chapter, mode, options) => {
|
|
12291
12904
|
if (book === null || catalog === null || creatingRef.current) return
|
|
12905
|
+
const key = `${book.id}|${chapter.code}|${mode}`
|
|
12906
|
+
if (inFlightSessions.current.has(key)) return
|
|
12907
|
+
inFlightSessions.current.add(key)
|
|
12908
|
+
try {
|
|
12292
12909
|
const limit = typeof catalog.resumeRatio === 'number' ? catalog.resumeRatio : 0.85
|
|
12293
12910
|
const current = options !== undefined && options.forceNew === true
|
|
12294
12911
|
? null
|
|
@@ -12307,8 +12924,12 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12307
12924
|
}
|
|
12308
12925
|
}
|
|
12309
12926
|
if (ratio < limit) {
|
|
12927
|
+
// A blank session whose draft was deleted gets its address block back.
|
|
12928
|
+
// A non-empty draft is preserved because beginPrefill uses `keep`.
|
|
12929
|
+
if (current.pending === true || current.blank === true) {
|
|
12930
|
+
await seedExistingSession(current.id, chapter, mode)
|
|
12931
|
+
}
|
|
12310
12932
|
await flushSave()
|
|
12311
|
-
if (mode === 'qa') await seedQaPersona(current.id)
|
|
12312
12933
|
openHostSession(current.id)
|
|
12313
12934
|
if (previewPdf) void openPdfInSession(current.id)
|
|
12314
12935
|
showNotice(format('sessionResumed', {
|
|
@@ -12318,20 +12939,46 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12318
12939
|
return
|
|
12319
12940
|
}
|
|
12320
12941
|
const continuation = nextContinuation(book.id, chapter.code, mode)
|
|
12942
|
+
const target = await ensureWorkspaceTarget()
|
|
12943
|
+
if (target === null) return
|
|
12321
12944
|
showNotice(format('sessionContinued', { pct: Math.round(ratio * 100) }))
|
|
12322
12945
|
await createSession(chapter, mode, {
|
|
12323
12946
|
jump: options !== undefined && options.jumpOnCreate === true,
|
|
12324
12947
|
continuation,
|
|
12948
|
+
target,
|
|
12325
12949
|
})
|
|
12326
12950
|
return
|
|
12327
12951
|
}
|
|
12328
12952
|
// No session to continue (or the caller asked for a fresh one): number the
|
|
12329
12953
|
// new session after whatever chain the chapter already has.
|
|
12954
|
+
const target = await ensureWorkspaceTarget()
|
|
12955
|
+
if (target === null) return
|
|
12330
12956
|
await createSession(chapter, mode, {
|
|
12331
12957
|
jump: options !== undefined && options.jumpOnCreate === true,
|
|
12332
12958
|
continuation: nextContinuation(book.id, chapter.code, mode),
|
|
12959
|
+
target,
|
|
12333
12960
|
})
|
|
12334
|
-
|
|
12961
|
+
} finally {
|
|
12962
|
+
inFlightSessions.current.delete(key)
|
|
12963
|
+
}
|
|
12964
|
+
}, [book, catalog, createSession, ensureWorkspaceTarget, findCurrentSession, flushSave, nextContinuation, openPdfInSession, previewPdf, seedExistingSession, showNotice])
|
|
12965
|
+
|
|
12966
|
+
/**
|
|
12967
|
+
* The toolbar's universal session: a tracked chapter session of the
|
|
12968
|
+
* general type, carrying only the book address.
|
|
12969
|
+
* @returns {Promise<void>} completion.
|
|
12970
|
+
*/
|
|
12971
|
+
const openGeneralSession = useCallback(async () => {
|
|
12972
|
+
if (book === null || reader === null || creatingRef.current) return
|
|
12973
|
+
const chapter = Array.isArray(book.chapters)
|
|
12974
|
+
? book.chapters.find(item => item !== null && typeof item === 'object' && item.code === reader.code)
|
|
12975
|
+
: null
|
|
12976
|
+
if (chapter === undefined) {
|
|
12977
|
+
showNotice(format('targetMissing'))
|
|
12978
|
+
return
|
|
12979
|
+
}
|
|
12980
|
+
await resumeOrCreate(chapter, GENERAL_MODE, { jumpOnCreate: true })
|
|
12981
|
+
}, [book, reader, resumeOrCreate, showNotice])
|
|
12335
12982
|
|
|
12336
12983
|
// A 提取/答疑/习题 request from the right column: switch the page to that
|
|
12337
12984
|
// book first, then let this effect run again with the chapter list in hand.
|
|
@@ -12886,6 +13533,9 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12886
13533
|
const skippedFiles = catalog === null ? 0 : catalog.skipped.reduce((sum, item) => sum + (Number(item.pdfCount) || 0), 0)
|
|
12887
13534
|
const unparsedFiles = books.reduce((sum, item) => sum + (Number(item.unparsed) || 0), 0)
|
|
12888
13535
|
const partialFiles = skippedFiles + unparsedFiles
|
|
13536
|
+
const canRender = envTools.python && envTools.tex
|
|
13537
|
+
const canTranslate = canRender && envTools.apiKey === true
|
|
13538
|
+
const canExport = envTools.python
|
|
12889
13539
|
|
|
12890
13540
|
let body
|
|
12891
13541
|
if (blockingError !== '' && (catalog === null || work === null)) {
|
|
@@ -12905,7 +13555,7 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12905
13555
|
libraries: libs.items,
|
|
12906
13556
|
activeId: libs.activeId,
|
|
12907
13557
|
envTools,
|
|
12908
|
-
canRender
|
|
13558
|
+
canRender,
|
|
12909
13559
|
busy: libBusy,
|
|
12910
13560
|
error: libError !== '' ? libError : problemText,
|
|
12911
13561
|
onUse: activateLibrary,
|
|
@@ -12936,6 +13586,9 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12936
13586
|
headingRef,
|
|
12937
13587
|
sessionIndex,
|
|
12938
13588
|
sessionAvailable,
|
|
13589
|
+
mathMode,
|
|
13590
|
+
workflow: activeWorkflow,
|
|
13591
|
+
onEnvRequired: setEnvPrompt,
|
|
12939
13592
|
artifacts,
|
|
12940
13593
|
libraryDir: catalog.libraryDir,
|
|
12941
13594
|
counts: counts[book.id],
|
|
@@ -12956,7 +13609,7 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
12956
13609
|
onDigest: generateDigest,
|
|
12957
13610
|
onOpenArtifact: openArtifact,
|
|
12958
13611
|
onArtifactSession: newArtifactSession,
|
|
12959
|
-
canRender
|
|
13612
|
+
canRender,
|
|
12960
13613
|
allowNonPdfDelete,
|
|
12961
13614
|
onRenderArtifact: renderArtifact,
|
|
12962
13615
|
onTrashArtifact: trashArtifact,
|
|
@@ -13077,7 +13730,12 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
13077
13730
|
onDoubleClick: () => backToLibraries(),
|
|
13078
13731
|
},
|
|
13079
13732
|
h('h1', { className: 'md-title' }, format('title')),
|
|
13080
|
-
h('p', { className: 'md-subtitle' }, format('subtitle', { books: books.length, chapters: totalChapters }))
|
|
13733
|
+
h('p', { className: 'md-subtitle' }, format('subtitle', { books: books.length, chapters: totalChapters })),
|
|
13734
|
+
h('span', {
|
|
13735
|
+
className: 'md-mode-pill',
|
|
13736
|
+
'data-mode': mathMode ? 'math' : 'general',
|
|
13737
|
+
title: format('workflowHint'),
|
|
13738
|
+
}, format(mathMode ? 'workflowMath' : 'workflowGeneral'))
|
|
13081
13739
|
),
|
|
13082
13740
|
h('div', { className: 'md-head-actions' },
|
|
13083
13741
|
book === null ? null : h('button', {
|
|
@@ -13194,6 +13852,10 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
13194
13852
|
? h(SettingsDialog, {
|
|
13195
13853
|
version: catalog === null ? '' : catalog.version,
|
|
13196
13854
|
envTools,
|
|
13855
|
+
initialTab: settingsTab,
|
|
13856
|
+
activeWorkflow,
|
|
13857
|
+
onWorkflowChange: value => writeWorkflowMode(value),
|
|
13858
|
+
onApiKeyChange: configured => setEnvTools(current => ({ ...current, apiKey: configured === true })),
|
|
13197
13859
|
updateBusy,
|
|
13198
13860
|
onCheckUpdate: checkUpdates,
|
|
13199
13861
|
previewPdf,
|
|
@@ -13264,6 +13926,11 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
13264
13926
|
reader,
|
|
13265
13927
|
railSide,
|
|
13266
13928
|
roughness,
|
|
13929
|
+
canTranslate,
|
|
13930
|
+
canExport,
|
|
13931
|
+
mathMode,
|
|
13932
|
+
onEnvRequired: setEnvPrompt,
|
|
13933
|
+
onGeneralSession: openGeneralSession,
|
|
13267
13934
|
doc: readerDoc.current,
|
|
13268
13935
|
busy: creatingKey !== '',
|
|
13269
13936
|
forceNew: readerForceNew,
|
|
@@ -13297,6 +13964,27 @@ html[data-platform='darwin'] .md-head { padding-top: calc(var(--dsh-frame-top-cl
|
|
|
13297
13964
|
bookTitle: reader.bookTitle,
|
|
13298
13965
|
}, true),
|
|
13299
13966
|
onExported: () => { void loadArtifacts(reader.bookId, reader.code, true) },
|
|
13967
|
+
}),
|
|
13968
|
+
envPrompt === ''
|
|
13969
|
+
? null
|
|
13970
|
+
: h(EnvPrompt, {
|
|
13971
|
+
kind: envPrompt,
|
|
13972
|
+
envTools,
|
|
13973
|
+
onClose: () => setEnvPrompt(''),
|
|
13974
|
+
onOpenSettings: () => {
|
|
13975
|
+
setEnvPrompt('')
|
|
13976
|
+
setSettingsTab('env')
|
|
13977
|
+
setSettingsOpen(true)
|
|
13978
|
+
},
|
|
13979
|
+
}),
|
|
13980
|
+
workspacePrompt === null
|
|
13981
|
+
? null
|
|
13982
|
+
: h(WorkspacePrompt, {
|
|
13983
|
+
workspaces,
|
|
13984
|
+
defaultPath: catalog === null ? '' : catalog.libraryDir,
|
|
13985
|
+
onPick: pickWorkspace,
|
|
13986
|
+
onCreate: createWorkspace,
|
|
13987
|
+
onCancel: () => resolveWorkspacePrompt(null),
|
|
13300
13988
|
})
|
|
13301
13989
|
)
|
|
13302
13990
|
}
|