@dooc-dev/dooc 0.0.26 → 0.0.28

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.
Files changed (44) hide show
  1. package/dist/edit.global.js +280 -260
  2. package/dist/engine/compiler/format-collections.js +9 -3
  3. package/dist/engine/core/html.js +3 -5
  4. package/dist/engine/core/icons.js +2 -2
  5. package/dist/frontend/document-application.js +185 -90
  6. package/dist/frontend/git-style.d.ts +1 -0
  7. package/dist/frontend/git-style.js +172 -0
  8. package/dist/frontend/language-picker.d.ts +5 -1
  9. package/dist/frontend/language-picker.js +19 -4
  10. package/dist/frontend/link-preview.d.ts +2 -0
  11. package/dist/frontend/link-preview.js +385 -0
  12. package/dist/frontend/locales/eng.json +137 -3
  13. package/dist/frontend/locales/jpn.json +139 -5
  14. package/dist/frontend/locales/zho.json +137 -3
  15. package/dist/frontend/resource-download.js +11 -6
  16. package/dist/frontend/scrollbars.d.ts +1 -0
  17. package/dist/frontend/scrollbars.js +9 -0
  18. package/dist/frontend/video-ui.js +9 -3
  19. package/dist/manifest.global.js +188 -186
  20. package/dist/mcp-relay.mjs +20 -1
  21. package/dist/plugins.global.js +31 -31
  22. package/dist/server/build.js +11 -8
  23. package/dist/server/cli.js +6 -1
  24. package/dist/server/git-origin.js +1 -1
  25. package/dist/server/git.js +49 -26
  26. package/dist/server/operation-log.js +9 -1
  27. package/dist/server/serve.d.ts +1 -0
  28. package/dist/server/serve.js +18 -7
  29. package/dist/server/static-client.js +4 -14
  30. package/dist/server/workspace-server.js +2 -1
  31. package/dist/subformats.global.js +57 -57
  32. package/dist/ui.global.js +71 -69
  33. package/dist/workspace/git-review.d.ts +5 -0
  34. package/dist/workspace/git-review.js +56 -0
  35. package/dist/workspace/git-types.d.ts +29 -2
  36. package/dist/workspace/git-types.js +5 -1
  37. package/dist/workspace/github.d.ts +1 -1
  38. package/dist/workspace/github.js +73 -9
  39. package/dist/workspace/mcp-tools.js +20 -1
  40. package/dist/workspace-worker.global.js +337 -87
  41. package/package.json +1 -1
  42. package/dist/workspace-mcp-worker.global.js +0 -3263
  43. package/dist/workspace-reader-mcp-worker.global.js +0 -3263
  44. package/dist/workspace-reader-worker.global.js +0 -3263
@@ -234,6 +234,10 @@
234
234
  "Format collections": "フォーマットの分類",
235
235
  "Collection": "分類",
236
236
  "Grid": "グリッド",
237
+ "Grid layout": "グリッドの配置",
238
+ "Drag or use arrow keys to resize the grid": "ドラッグまたは矢印キーでグリッドを調整",
239
+ "Display": "表示設定",
240
+ "Pagination": "ページ送り",
237
241
  "Columns": "列数",
238
242
  "Rows": "行数",
239
243
  "Folder": "フォルダ",
@@ -268,6 +272,105 @@
268
272
  "Fullscreen is unavailable": "全画面表示を利用できません",
269
273
  "Some registered fonts could not be loaded": "一部の登録済みフォントを読み込めませんでした",
270
274
  "Done": "完了",
275
+ "Git views": "Git の表示",
276
+ "Detached HEAD": "切り離された HEAD",
277
+ "Branch name": "ブランチ名",
278
+ "No commits yet": "最初のコミット前",
279
+ "Changed files": "変更ファイル",
280
+ "Filter by path": "パスで絞り込み",
281
+ "Conflicts": "競合",
282
+ "Unstaged": "未ステージ",
283
+ "Staged": "ステージ済み",
284
+ "Conflict": "競合",
285
+ "Untracked": "未追跡",
286
+ "Deleted": "削除",
287
+ "Renamed": "名前変更",
288
+ "Type changed": "種類変更",
289
+ "Changed": "変更",
290
+ "View diff for {path}": "{path} の差分を表示",
291
+ "File diff": "ファイルの差分",
292
+ "No text changes": "テキストの差分はありません",
293
+ "Binary file": "バイナリファイル",
294
+ "File too large to preview": "ファイルが大きすぎるためプレビューできません",
295
+ "Showing the beginning of this diff.": "差分の先頭部分を表示しています。",
296
+ "Mark resolved": "解決済みにする",
297
+ "Loading diff…": "差分を読み込み中…",
298
+ "Show more files": "続きを表示",
299
+ "No matching files": "該当するファイルはありません",
300
+ "Clear filter": "絞り込みを解除",
301
+ "Check the updated changes and try again.": "変更が更新されました。内容を確認して、もう一度お試しください。",
302
+ "Another Git operation is in progress. Try again shortly.": "別のGit操作が進行中です。少し待ってからお試しください。",
303
+ "Loading repository…": "リポジトリを読み込み中…",
304
+ "Staged {path}": "{path} をステージしました",
305
+ "Unstaged {path}": "{path} のステージを解除しました",
306
+ "Commit created": "コミットしました",
307
+ "Committed locally. Check the current branch before pushing.": "ローカルにコミットしました。現在のブランチを確認してからプッシュしてください。",
308
+ "Changes stashed": "変更をスタッシュしました",
309
+ "Stash restored": "スタッシュを復元しました",
310
+ "Pull complete": "プルしました",
311
+ "Push complete": "プッシュしました",
312
+ "Pull request created": "プルリクエストを作成しました",
313
+ "Pull request updated": "プルリクエストを更新しました",
314
+ "Pull request merged": "プルリクエストをマージしました",
315
+ "Commit and push": "コミットしてプッシュ",
316
+ "Commit only": "コミットのみ",
317
+ "Commit options": "コミットの選択肢",
318
+ "Committed locally. Push failed: {error}": "コミットしました。プッシュに失敗しました({error})",
319
+ "Fetch failed: {error}": "リモートの更新を取得できません({error})",
320
+ "Commit": "コミット",
321
+ "{count} staged": "{count} 件ステージ済み",
322
+ "Resolve and stage conflicted files before committing.": "競合を解決し、ファイルをステージしてからコミットしてください。",
323
+ "Synchronization": "リモート同期",
324
+ "Up to date": "同期済み",
325
+ "{count} ahead": "{count} コミット先行",
326
+ "{count} behind": "{count} コミット遅れ",
327
+ "No upstream branch": "追跡ブランチ未設定",
328
+ "Pull": "プル",
329
+ "A clean working tree is required to pull.": "プルするには作業ツリーをクリーンにしてください。",
330
+ "Stash": "スタッシュ",
331
+ "Commit your changes before restoring the stash.": "変更をコミットしてからスタッシュを復元してください。",
332
+ "No pull requests": "プルリクエストはありません",
333
+ "This workspace has no pull request provider.": "このワークスペースにはプルリクエストのプロバイダーが設定されていません。",
334
+ "Pull requests could not be loaded.": "プルリクエストを取得できませんでした。",
335
+ "Loading pull requests…": "プルリクエストを読み込み中…",
336
+ "This workspace returns staged and unstaged changes together.": "このワークスペースでは、ステージ済みと未ステージの差分がまとめて表示されます。",
337
+ "Open in {provider}": "{provider} で開く",
338
+ "Review status unavailable": "レビュー状態を取得できません",
339
+ "PR head": "PR のコミット",
340
+ "Open #{number} in {provider}": "{provider} で #{number} を開く",
341
+ "Review required": "レビュー待ち",
342
+ "Approved": "承認済み",
343
+ "Changes requested": "変更依頼あり",
344
+ "Open": "オープン",
345
+ "Merged": "マージ済み",
346
+ "Closed": "クローズ",
347
+ "Pull request state": "プルリクエストの状態",
348
+ "All states": "すべての状態",
349
+ "No pull requests match this state.": "この状態のプルリクエストはありません。",
350
+ "Source branch: {branch}": "作成元ブランチ:{branch}",
351
+ "Push the source branch and choose a different base branch.": "作成元をプッシュし、別のブランチをマージ先に指定してください。",
352
+ "This pull request changed. Reset edits to load the latest version.": "プルリクエストが更新されました。編集をリセットすると最新版を読み込めます。",
353
+ "New pull request": "新しいプルリクエスト",
354
+ "Create a commit on a branch before opening a pull request.": "ブランチでコミットしてからプルリクエストを作成してください。",
355
+ "No description": "説明はありません",
356
+ "Edit details": "タイトルと説明を編集",
357
+ "Mark this draft ready in the review before merging.": "マージするには、レビュー画面でドラフトをレビュー可能にしてください。",
358
+ "Review submitted": "レビューを送信しました",
359
+ "Files changed": "変更されたファイル",
360
+ "Open the provider review to inspect this file.": "このファイルはプロバイダーのレビュー画面で確認できます。",
361
+ "Open the provider review for the remaining files.": "残りのファイルはプロバイダーのレビュー画面で確認できます。",
362
+ "No changed files": "変更されたファイルはありません",
363
+ "Page {number}": "{number} ページ",
364
+ "Review decision": "レビュー結果",
365
+ "Comment": "コメント",
366
+ "Approve": "承認",
367
+ "Request changes": "変更を依頼",
368
+ "Review comment": "レビューコメント",
369
+ "Submit review": "レビューを送信",
370
+ "Write a review": "レビューを書く",
371
+ "The pull request changed while you were writing this review.": "レビューの入力中にプルリクエストが更新されました。",
372
+ "Review latest revision": "最新版を対象にする",
373
+ "Merge #{number} ({commit}) into {base} using {method}?": "#{number} の {commit} を {method} で {base} にマージしますか?",
271
374
  "Git operation failed": "Git操作に失敗しました",
272
375
  "Create pull request": "PRを作成",
273
376
  "Base branch": "対象ブランチ",
@@ -286,12 +389,10 @@
286
389
  "This branch does not contain {manifest} at the same path.": "このブランチには、同じ場所に {manifest} がありません。",
287
390
  "New branches start from the latest commit. Unsaved changes stay in the current workspace.": "新しいブランチは最新のコミットから作成します。未保存の変更は現在のワークスペースに保持されます。",
288
391
  "Changes": "変更",
289
- "Git uses saved files.": "保存済みファイルの変更を表示しています。",
290
392
  "Stage": "ステージ",
291
393
  "Unstage": "ステージを解除",
292
394
  "Working tree clean": "未コミットの変更はありません",
293
395
  "Commit message": "コミットメッセージ",
294
- "Commit staged changes": "ステージ済みの変更をコミット",
295
396
  "Fetch": "取得",
296
397
  "Pull (fast-forward)": "取り込む (fast-forward)",
297
398
  "Push": "Push",
@@ -305,8 +406,8 @@
305
406
  "Stash and switch": "退避して切り替え",
306
407
  "Create the first commit to switch branches.": "最初のコミット後にブランチを切り替えられます。",
307
408
  "Stash · empty": "Stash · 空",
308
- "Restore stash": "stashを復元",
309
- "Stash changes": "変更をstashへ退避",
409
+ "Restore stash": "スタッシュを復元",
410
+ "Stash changes": "変更を退避",
310
411
  "Library": "ライブラリ",
311
412
  "Subformats": "Subformats",
312
413
  "Expand card": "カードを展開",
@@ -537,5 +638,38 @@
537
638
  "Conversation is too large. Start a new chat.": "会話が長すぎます。新しいチャットを開始してください。",
538
639
  "Attach at most 16 context items per message.": "1 回の送信で追加できる範囲は 16 件までです。",
539
640
  "Workspace changed. Start a new chat.": "ワークスペースが変わりました。新しいチャットを開始してください。",
540
- "No matching files or skills.": "一致するファイルやスキルがありません。"
641
+ "No matching files or skills.": "一致するファイルやスキルがありません。",
642
+ "LLM chat": "LLM チャット",
643
+ "Chat": "チャット",
644
+ "Open chat": "チャットを開く",
645
+ "Providers": "プロバイダー",
646
+ "Add an API key": "API キーを追加",
647
+ "Remove API key": "API キーを削除",
648
+ "Saved in this browser": "このブラウザーに保存済み",
649
+ "Saved in this browser. Sent only to the provider.": "このブラウザーに保存。送信先はプロバイダーのみ。",
650
+ "Saved providers could not be loaded. Check browser storage.": "保存した設定を読み込めません。ブラウザーのストレージを確認してください。",
651
+ "Could not save. Check browser storage and try again.": "保存できません。ブラウザーのストレージを確認して再試行してください。",
652
+ "Enter a valid API key and model.": "有効な API キーとモデルを入力してください。",
653
+ "Add an API key in Providers to start.": "プロバイダー設定で API キーを追加してください。",
654
+ "Open section agent": "節のエージェントを開く",
655
+ "Agent": "エージェント",
656
+ "Move conversation": "対話を移動",
657
+ "Move to sidebar": "サイドバーへ移動",
658
+ "Message the agent": "エージェントに指示する",
659
+ "Read and write": "読み取り・編集",
660
+ "Read only": "読み取り専用",
661
+ "Section updated": "節を更新しました",
662
+ "Section read": "節を読み取りました",
663
+ "The source changed. Select the section again before editing.": "ソースが変更されました。編集する節を選び直してください。",
664
+ "This section is read-only.": "この節は読み取り専用です。",
665
+ "Read the section before editing it.": "編集する前に節を読み取ってください。",
666
+ "Invalid section action.": "節への操作が無効です。",
667
+ "The section could not be updated.": "節を更新できませんでした。",
668
+ "Agent step limit reached. Review the changes and send a follow-up.": "操作回数の上限に達しました。変更を確認して続きの指示を送ってください。",
669
+ "No section is selected for agent actions.": "操作する節が選択されていません。",
670
+ "The provider returned invalid tool calls.": "プロバイダーから無効な操作が返されました。",
671
+ "Model": "モデル",
672
+ "API key missing": "API キー未設定",
673
+ "Model list unavailable. Using local choices.": "モデル一覧を取得できません。標準の候補を表示しています。",
674
+ "Enter to select; Ctrl+Enter to configure": "Enter で選択、Ctrl+Enter で設定"
541
675
  }
@@ -234,6 +234,10 @@
234
234
  "Format collections": "格式分类",
235
235
  "Collection": "分类",
236
236
  "Grid": "网格",
237
+ "Grid layout": "网格布局",
238
+ "Drag or use arrow keys to resize the grid": "拖动或使用方向键调整网格",
239
+ "Display": "显示设置",
240
+ "Pagination": "分页",
237
241
  "Columns": "列数",
238
242
  "Rows": "行数",
239
243
  "Folder": "文件夹",
@@ -268,6 +272,105 @@
268
272
  "Fullscreen is unavailable": "无法进入全屏",
269
273
  "Some registered fonts could not be loaded": "部分已注册字体无法加载",
270
274
  "Done": "完成",
275
+ "Git views": "Git 视图",
276
+ "Detached HEAD": "分离的 HEAD",
277
+ "Branch name": "分支名称",
278
+ "No commits yet": "尚无提交",
279
+ "Changed files": "更改的文件",
280
+ "Filter by path": "按路径筛选",
281
+ "Conflicts": "冲突",
282
+ "Unstaged": "未暂存",
283
+ "Staged": "已暂存",
284
+ "Conflict": "冲突",
285
+ "Untracked": "未跟踪",
286
+ "Deleted": "已删除",
287
+ "Renamed": "已重命名",
288
+ "Type changed": "类型已更改",
289
+ "Changed": "已更改",
290
+ "View diff for {path}": "查看 {path} 的差异",
291
+ "File diff": "文件差异",
292
+ "No text changes": "没有文本差异",
293
+ "Binary file": "二进制文件",
294
+ "File too large to preview": "文件过大,无法预览",
295
+ "Showing the beginning of this diff.": "仅显示差异的开头部分。",
296
+ "Mark resolved": "标记为已解决",
297
+ "Loading diff…": "正在加载差异…",
298
+ "Show more files": "显示更多文件",
299
+ "No matching files": "没有匹配的文件",
300
+ "Clear filter": "清除筛选",
301
+ "Check the updated changes and try again.": "更改已更新。请确认最新内容后重试。",
302
+ "Another Git operation is in progress. Try again shortly.": "其他 Git 操作正在进行,请稍后重试。",
303
+ "Loading repository…": "正在加载仓库…",
304
+ "Staged {path}": "已暂存 {path}",
305
+ "Unstaged {path}": "已取消暂存 {path}",
306
+ "Commit created": "已创建提交",
307
+ "Committed locally. Check the current branch before pushing.": "已在本地提交,请确认当前分支后再推送。",
308
+ "Changes stashed": "已贮藏更改",
309
+ "Stash restored": "已恢复贮藏",
310
+ "Pull complete": "已完成拉取",
311
+ "Push complete": "已完成推送",
312
+ "Pull request created": "已创建拉取请求",
313
+ "Pull request updated": "已更新拉取请求",
314
+ "Pull request merged": "已合并拉取请求",
315
+ "Commit and push": "提交并推送",
316
+ "Commit only": "仅提交",
317
+ "Commit options": "提交选项",
318
+ "Committed locally. Push failed: {error}": "已在本地提交。推送失败:{error}",
319
+ "Fetch failed: {error}": "无法获取远程更新:{error}",
320
+ "Commit": "提交",
321
+ "{count} staged": "已暂存 {count} 个文件",
322
+ "Resolve and stage conflicted files before committing.": "提交前请先解决冲突并暂存相关文件。",
323
+ "Synchronization": "远程同步",
324
+ "Up to date": "已同步",
325
+ "{count} ahead": "领先 {count} 个提交",
326
+ "{count} behind": "落后 {count} 个提交",
327
+ "No upstream branch": "未设置上游分支",
328
+ "Pull": "拉取",
329
+ "A clean working tree is required to pull.": "拉取前需要清理工作区更改。",
330
+ "Stash": "贮藏",
331
+ "Commit your changes before restoring the stash.": "恢复贮藏前请先提交当前更改。",
332
+ "No pull requests": "暂无拉取请求",
333
+ "This workspace has no pull request provider.": "此工作区未配置拉取请求提供方。",
334
+ "Pull requests could not be loaded.": "无法加载拉取请求。",
335
+ "Loading pull requests…": "正在加载拉取请求…",
336
+ "This workspace returns staged and unstaged changes together.": "此工作区合并显示已暂存和未暂存的差异。",
337
+ "Open in {provider}": "在 {provider} 中打开",
338
+ "Review status unavailable": "无法获取评审状态",
339
+ "PR head": "PR 提交",
340
+ "Open #{number} in {provider}": "在 {provider} 中打开 #{number}",
341
+ "Review required": "等待评审",
342
+ "Approved": "已批准",
343
+ "Changes requested": "已请求更改",
344
+ "Open": "待合并",
345
+ "Merged": "已合并",
346
+ "Closed": "已关闭",
347
+ "Pull request state": "拉取请求状态",
348
+ "All states": "所有状态",
349
+ "No pull requests match this state.": "没有此状态的拉取请求。",
350
+ "Source branch: {branch}": "源分支:{branch}",
351
+ "Push the source branch and choose a different base branch.": "请推送源分支,并选择另一个分支作为目标。",
352
+ "This pull request changed. Reset edits to load the latest version.": "拉取请求已更新。请重置编辑以加载最新版本。",
353
+ "New pull request": "新建拉取请求",
354
+ "Create a commit on a branch before opening a pull request.": "请先在分支上提交,再创建拉取请求。",
355
+ "No description": "暂无说明",
356
+ "Edit details": "编辑标题和说明",
357
+ "Mark this draft ready in the review before merging.": "合并前请在评审页面将草稿标记为可供评审。",
358
+ "Review submitted": "已提交评审",
359
+ "Files changed": "变更文件",
360
+ "Open the provider review to inspect this file.": "请在提供方的评审页面查看此文件。",
361
+ "Open the provider review for the remaining files.": "请在提供方的评审页面查看其余文件。",
362
+ "No changed files": "没有变更文件",
363
+ "Page {number}": "第 {number} 页",
364
+ "Review decision": "评审结论",
365
+ "Comment": "评论",
366
+ "Approve": "批准",
367
+ "Request changes": "请求更改",
368
+ "Review comment": "评审意见",
369
+ "Submit review": "提交评审",
370
+ "Write a review": "撰写评审",
371
+ "The pull request changed while you were writing this review.": "撰写评审期间,拉取请求已更新。",
372
+ "Review latest revision": "改为评审最新版本",
373
+ "Merge #{number} ({commit}) into {base} using {method}?": "使用 {method} 将 #{number} 的 {commit} 合并到 {base}?",
271
374
  "Git operation failed": "Git 操作失败",
272
375
  "Create pull request": "创建拉取请求",
273
376
  "Base branch": "目标分支",
@@ -286,12 +389,10 @@
286
389
  "This branch does not contain {manifest} at the same path.": "此分支的相同路径下没有 {manifest}。",
287
390
  "New branches start from the latest commit. Unsaved changes stay in the current workspace.": "新分支从最新提交创建。未保存的更改会保留在当前工作区。",
288
391
  "Changes": "更改",
289
- "Git uses saved files.": "显示已保存文件的更改。",
290
392
  "Stage": "暂存",
291
393
  "Unstage": "取消暂存",
292
394
  "Working tree clean": "工作区无更改",
293
395
  "Commit message": "提交说明",
294
- "Commit staged changes": "提交暂存的更改",
295
396
  "Fetch": "获取",
296
397
  "Pull (fast-forward)": "拉取 (fast-forward)",
297
398
  "Push": "推送",
@@ -537,5 +638,38 @@
537
638
  "Conversation is too large. Start a new chat.": "对话过长。请开始新对话。",
538
639
  "Attach at most 16 context items per message.": "每条消息最多附加 16 个上下文项目。",
539
640
  "Workspace changed. Start a new chat.": "工作区已更改。请开始新对话。",
540
- "No matching files or skills.": "没有匹配的文件或技能。"
641
+ "No matching files or skills.": "没有匹配的文件或技能。",
642
+ "LLM chat": "LLM 聊天",
643
+ "Chat": "聊天",
644
+ "Open chat": "打开聊天",
645
+ "Providers": "提供商",
646
+ "Add an API key": "添加 API 密钥",
647
+ "Remove API key": "删除 API 密钥",
648
+ "Saved in this browser": "已保存在此浏览器",
649
+ "Saved in this browser. Sent only to the provider.": "保存在此浏览器,仅发送给所选提供商。",
650
+ "Saved providers could not be loaded. Check browser storage.": "无法加载已保存的提供商,请检查浏览器存储。",
651
+ "Could not save. Check browser storage and try again.": "无法保存,请检查浏览器存储后重试。",
652
+ "Enter a valid API key and model.": "请输入有效的 API 密钥和模型。",
653
+ "Add an API key in Providers to start.": "请在提供商设置中添加 API 密钥。",
654
+ "Open section agent": "打开章节智能体",
655
+ "Agent": "智能体",
656
+ "Move conversation": "移动对话",
657
+ "Move to sidebar": "移至侧栏",
658
+ "Message the agent": "向智能体发送指令",
659
+ "Read and write": "读取和编辑",
660
+ "Read only": "只读",
661
+ "Section updated": "已更新章节",
662
+ "Section read": "已读取章节",
663
+ "The source changed. Select the section again before editing.": "源文件已更改。请重新选择要编辑的章节。",
664
+ "This section is read-only.": "此章节为只读。",
665
+ "Read the section before editing it.": "请先读取章节再编辑。",
666
+ "Invalid section action.": "章节操作无效。",
667
+ "The section could not be updated.": "无法更新章节。",
668
+ "Agent step limit reached. Review the changes and send a follow-up.": "智能体已达到操作次数上限。请检查更改并发送后续指令。",
669
+ "No section is selected for agent actions.": "尚未选择要操作的章节。",
670
+ "The provider returned invalid tool calls.": "提供商返回了无效的工具调用。",
671
+ "Model": "模型",
672
+ "API key missing": "未设置 API 密钥",
673
+ "Model list unavailable. Using local choices.": "无法获取模型列表。正在使用本地选项。",
674
+ "Enter to select; Ctrl+Enter to configure": "Enter 选择;Ctrl+Enter 设置"
541
675
  }
@@ -116,11 +116,12 @@ export const mountResourceDownloads = (request = fetch) => {
116
116
  */
117
117
  export const mountResourceExpand = () => {
118
118
  document.addEventListener("click", (event) => {
119
- const source = event.target instanceof Element
120
- ? event.target
121
- .closest("[data-resource-expand]")
122
- ?.closest(".downloadable-resource")
119
+ const trigger = event.target instanceof Element
120
+ ? event.target.closest("[data-resource-expand]")
123
121
  : null;
122
+ const source = trigger?.dataset.resourceExpand
123
+ ? document.getElementById(trigger.dataset.resourceExpand)
124
+ : trigger?.closest(".downloadable-resource");
124
125
  if (!source)
125
126
  return;
126
127
  const dialog = document.createElement("dialog");
@@ -130,8 +131,9 @@ export const mountResourceExpand = () => {
130
131
  const [stage, surface, bar] = dialog.children;
131
132
  if (!stage || !surface || !bar)
132
133
  return;
134
+ surface.hidden = !!source.querySelector("video, audio");
133
135
  // The copy keeps the inline layout width; 100% is that layout scaled to fit the dialog.
134
- stage.style.width = `${source.getBoundingClientRect().width}px`;
136
+ stage.style.width = `${surface.hidden || source.closest(".format-list-preview") ? Math.min(960, innerWidth - 96) : source.getBoundingClientRect().width}px`;
135
137
  for (const node of source.children)
136
138
  if (!node.classList.contains("resource-download-tools"))
137
139
  stage.append(node.cloneNode(true));
@@ -146,7 +148,7 @@ export const mountResourceExpand = () => {
146
148
  control.title = label;
147
149
  }
148
150
  const apply = () => {
149
- const fit = Math.min((dialog.clientWidth - 48) / stage.offsetWidth, (dialog.clientHeight - 48) / stage.offsetHeight, 4);
151
+ const fit = Math.min((dialog.clientWidth - 48) / stage.offsetWidth, (dialog.clientHeight - 48) / stage.offsetHeight, surface.hidden ? 1 : 4);
150
152
  stage.style.transform = `translate(calc(-50% + ${x}px), calc(-50% + ${y}px)) scale(${fit * zoom})`;
151
153
  surface.style.cursor = points.size ? "grabbing" : zoom === 1 ? "" : "grab";
152
154
  bar.firstElementChild.textContent = `${Math.round(zoom * 100)}%`;
@@ -250,6 +252,9 @@ export const mountResourceExpand = () => {
250
252
  dialog.addEventListener("keydown", (event) => {
251
253
  if (event.isComposing || event.ctrlKey || event.metaKey || event.altKey)
252
254
  return;
255
+ if (event.target instanceof Element &&
256
+ event.target.closest("input, select, video, audio"))
257
+ return;
253
258
  if (["+", "=", "-", "0", "Home"].includes(event.key)) {
254
259
  setZoom(event.key === "0" || event.key === "Home"
255
260
  ? 1
@@ -0,0 +1 @@
1
+ export declare const SCROLLBAR_CSS = "\n@media (forced-colors: none) {\n * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--doc-fg-2, currentColor) 55%, transparent) transparent; }\n ::-webkit-scrollbar { width: 8px; height: 8px; }\n ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }\n ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--doc-fg-2, currentColor) 55%, transparent); border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }\n @media (hover: hover) { ::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--doc-fg-2, currentColor) 80%, transparent); } }\n @supports selector(::-webkit-scrollbar) { * { scrollbar-width: auto; scrollbar-color: auto; } }\n}";
@@ -0,0 +1,9 @@
1
+ export const SCROLLBAR_CSS = `
2
+ @media (forced-colors: none) {
3
+ * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--doc-fg-2, currentColor) 55%, transparent) transparent; }
4
+ ::-webkit-scrollbar { width: 8px; height: 8px; }
5
+ ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
6
+ ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--doc-fg-2, currentColor) 55%, transparent); border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
7
+ @media (hover: hover) { ::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--doc-fg-2, currentColor) 80%, transparent); } }
8
+ @supports selector(::-webkit-scrollbar) { * { scrollbar-width: auto; scrollbar-color: auto; } }
9
+ }`;
@@ -28,8 +28,13 @@ export function mountVideos(doc) {
28
28
  };
29
29
  const initialize = () => {
30
30
  for (const video of doc.querySelectorAll("video[data-dooc-video]")) {
31
- if (mounted.has(video) || video.closest("a"))
31
+ if (mounted.has(video) ||
32
+ video.closest("a") ||
33
+ (video.closest(".format-list-preview") && !video.closest(".resource-modal")))
32
34
  continue;
35
+ // Expanded previews clone the markup, so rebuild controls with live handlers.
36
+ if (video.parentElement?.classList.contains("video-player"))
37
+ video.parentElement.replaceWith(video);
33
38
  const player = doc.createElement("div");
34
39
  player.className = "video-player";
35
40
  video.before(player);
@@ -88,7 +93,7 @@ export function mountVideos(doc) {
88
93
  speedLabel.append(speedText, speedValue, speed);
89
94
  options.append(speedLabel);
90
95
  const fullscreen = button("Fullscreen", icon('<path d="M9 3H3v6m12-6h6v6M3 15v6h6m12-6v6h-6"/>'));
91
- fullscreen.hidden = !doc.fullscreenEnabled;
96
+ fullscreen.hidden = !doc.fullscreenEnabled || !!video.closest(".format-card");
92
97
  const status = doc.createElement("p");
93
98
  status.className = "video-status";
94
99
  status.setAttribute("role", "status");
@@ -99,7 +104,8 @@ export function mountVideos(doc) {
99
104
  status.hidden = false;
100
105
  };
101
106
  const sync = () => {
102
- const overlay = mobile.matches || !!doc.fullscreenElement?.contains(video);
107
+ const overlay = (mobile.matches && !video.closest(".format-card")) ||
108
+ !!doc.fullscreenElement?.contains(video);
103
109
  video.controls = overlay;
104
110
  bar.hidden = overlay;
105
111
  if (overlay && options.matches(":popover-open")) {