@aaa_iii/fzv 0.1.1 → 0.3.0

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 (31) hide show
  1. package/README.ja.md +178 -0
  2. package/README.md +131 -72
  3. package/THIRD_PARTY_NOTICES.md +4 -1
  4. package/dist/client/assets/{c-pw5cNQ6f.js → c-Bt2S8zZg.js} +1 -1
  5. package/dist/client/assets/{cpp-BzP2DU1a.js → cpp-DPK4tyRH.js} +1 -1
  6. package/dist/client/assets/{highlight-m6b6lqez.js → highlight-Cjbz6wKa.js} +4 -4
  7. package/dist/client/assets/index-CDvmZwbk.js +69 -0
  8. package/dist/client/assets/{index-CmRL0QNk.css → index-CUTCg_dk.css} +1 -1
  9. package/dist/client/assets/{java-D112xljv.js → java-J15MpnFT.js} +1 -1
  10. package/dist/client/assets/{jsx-Czjwr3X8.js → jsx-DUOQ5e6U.js} +1 -1
  11. package/dist/client/assets/{latex-DyPjLw3u.js → latex-CJrCGu_N.js} +1 -1
  12. package/dist/client/assets/{lua-C7IYe9JZ.js → lua-CKx32ZrF.js} +1 -1
  13. package/dist/client/assets/{pdf-APdaxgPI.js → pdf-27wT5C7q.js} +2 -2
  14. package/dist/client/assets/{r-9GJvLLqN.js → r-C56hVSf1.js} +1 -1
  15. package/dist/client/assets/{ruby-BcWFKqsj.js → ruby-CmgALhjT.js} +1 -1
  16. package/dist/client/assets/{tsx-COvetw7Z.js → tsx-clVZ5Fr8.js} +1 -1
  17. package/dist/client/assets/{typescript-D48Br3Og.js → typescript-D4OylR-N.js} +1 -1
  18. package/dist/client/assets/worker-12brr2uW.js +4 -0
  19. package/dist/client/assets/{xml-_pY6RLHw.js → xml-DDzn0dx3.js} +1 -1
  20. package/dist/client/index.html +105 -2
  21. package/dist/navigation.js +2 -2
  22. package/dist/server/catalog.js +6 -0
  23. package/dist/server/cli.js +36 -9
  24. package/dist/server/git.js +131 -0
  25. package/dist/server/network.js +4 -0
  26. package/dist/server/office.js +244 -0
  27. package/dist/server/server.js +66 -4
  28. package/dist/shared.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/client/assets/index-DZRy_kMM.js +0 -69
  31. package/dist/server/interactive.js +0 -32
package/README.ja.md ADDED
@@ -0,0 +1,178 @@
1
+ # fzv
2
+
3
+ [![npm](https://img.shields.io/npm/v/@aaa_iii/fzv)](https://www.npmjs.com/package/@aaa_iii/fzv)
4
+ [![CI](https://github.com/iiii1224/fzv/actions/workflows/ci.yml/badge.svg)](https://github.com/iiii1224/fzv/actions/workflows/ci.yml)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/iiii1224/fzv/blob/main/LICENSE)
6
+
7
+ [English](https://github.com/iiii1224/fzv/blob/main/README.md) | 日本語
8
+
9
+ コーディングエージェントに作らせたファイルを、IDE を開かずにブラウザで探して読むための読み取り専用ビューアです。PDF、HTML、画像、ソースコード、Office 文書を、同じタブと分割画面で切り替えながら確認できます。
10
+
11
+ ```console
12
+ $ npx --yes @aaa_iii/fzv@latest --watch
13
+
14
+ fzv 0.3.0
15
+ Project ~/dev/fzv
16
+ Viewer http://127.0.0.1:29814/
17
+ Office ibisOffice (~/.local/bin/ibisOffice)
18
+
19
+ Press Ctrl+C to stop.
20
+ ```
21
+
22
+ 表示された URL をブラウザで開き、`/` でファイルを検索します。
23
+
24
+ ## 特徴
25
+
26
+ ターミナルでエージェントに指示を出しながら、生成された成果物だけを横で確かめる、という使い方を想定しています。
27
+
28
+ - **`npx` 一行で起動**: 実行時に依存パッケージを取得しません。UI、PDF.js、フォントは配布パッケージに含まれており、インストール時のビルドもありません。
29
+ - **形式が違っても操作は同じ**: PDF も Markdown も画像も、同じタブ、分割、キー操作で扱います。
30
+ - **キーボードで完結**: `/` であいまい検索、`hjkl` でスクロール、`f` で画面上のリンクやボタンへジャンプします。
31
+ - **ファイルを書き換えない**: 書き込み機能はなく、プロジェクトのルートより外へのアクセスは拒否します。
32
+
33
+ **できないこと**: ファイルの編集、ファイル内容の全文検索、`.gitignore` の解釈、旧形式の Office 文書(`.doc`、`.xls`、`.ppt`)の表示、認証付きの公開。編集や全文検索には、エディタや `rg` を併用してください。
34
+
35
+ ## 必要なもの
36
+
37
+ - Node.js 24 以降
38
+ - 現行のデスクトップブラウザ
39
+ - Office 文書を表示する場合: [ibisOffice](https://github.com/ibisjp/ibis-office) または [LibreOffice](https://www.libreoffice.org/)
40
+
41
+ ## 起動する
42
+
43
+ ```bash
44
+ # カレントディレクトリを開く
45
+ npx --yes @aaa_iii/fzv@latest
46
+
47
+ # ファイルの変更を検知して、検索対象と開いているタブを更新する
48
+ npx --yes @aaa_iii/fzv@latest --watch
49
+
50
+ # 別のディレクトリを開く
51
+ npx --yes @aaa_iii/fzv@latest --root ~/projects/example
52
+ ```
53
+
54
+ `Ctrl+C` で終了します。
55
+
56
+ ポートは、プロジェクトのパスから 20000〜29999 番の中で決まります。同じプロジェクトなら毎回同じ URL になるので、ブラウザに保存されたタブ、分割、テーマが次の起動時にも戻ります。そのポートが使用中のときは空いているポートで起動し、ターミナルに警告を出します。この場合は URL が変わるため、前回の状態は戻りません。
57
+
58
+ ## 使い方
59
+
60
+ ### ファイルを探す
61
+
62
+ `/` を押すか「Find a file」をクリックすると検索が開きます。何も入力していないときは、ルート直下のファイルとディレクトリが並びます。ディレクトリを選ぶとその中に移動し、文字を入力するとパスをあいまい検索します。スペースで区切った語は、すべて含むパスだけに絞り込みます。
63
+
64
+ ファイル一覧は検索を開くたびに裏で読み直すため、ページを開いた後に作られたファイルも見つかります。読み直している間も、直前の一覧でそのまま検索できます。
65
+
66
+ 隠しファイルと隠しディレクトリ、`node_modules`、`__pycache__` は一覧に出ません。
67
+
68
+ ### サイドバー
69
+
70
+ 左端のアクティビティバーで、サイドバーの表示を Explorer と Source Control(git リポジトリの場合)に切り替えます。Explorer は検索と同じファイルをフォルダのツリーで表示し、git の状態を色と文字で示します。開いているタブのファイルを自動で表示し、展開したフォルダを覚えています。選択中のアイコンをクリックするか `Ctrl/Cmd+B` を押すとサイドバーを隠せます。端をドラッグすると幅を変えられます。狭いウィンドウではエディタに重ねて開きます。
71
+
72
+ ### タブと分割
73
+
74
+ ファイルはタブで開きます。タブはドラッグして並べ替えたり、上下左右にドロップして画面を分割したりできます。`Ctrl` を押しながら(macOS では `Option`)ドラッグすると、移動ではなく複製になります。分割は最大 32 個で、境界をドラッグして大きさを変えられます。
75
+
76
+ 開いているタブ、分割の配置、表示モードはブラウザに保存され、再読み込みしても戻ります。
77
+
78
+ ### プレビューできる形式
79
+
80
+ | 形式 | 拡張子 | 表示 |
81
+ | -------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
82
+ | PDF | `.pdf` | 文字選択、文書内検索、ズーム |
83
+ | HTML | `.html` `.htm` | sandbox 内で描画。ソース表示に切り替え可能 |
84
+ | Markdown | `.md` | 整形表示。ソース表示に切り替え可能 |
85
+ | 画像 | `.png` `.jpg` `.jpeg` `.gif` `.webp` `.avif` `.bmp` `.svg` `.ico` | 拡大、縮小、移動 |
86
+ | Office | `.docx` `.xlsx` `.pptx` | PDF に変換して表示 |
87
+ | テキスト | `.ts` `.js` `.py` `.rs` `.go` `.json` `.yaml` `.toml` `.tex` `.csv` など、`Makefile` `Dockerfile` | 行番号とシンタックスハイライト付きのソース表示 |
88
+
89
+ 1 ファイルあたり 20 MiB までです。表示中のファイルは「Download」から元の形式で保存できます。
90
+
91
+ ### 変更の確認
92
+
93
+ プロジェクトが git リポジトリ内にあり、`PATH` に `git` がある場合、未コミットの変更があるテキストファイルのツールバーに「Open Changes」ボタンが表示されます。VS Code と同じ形式の diff を左右に並べて開き、変更された行と、その中で変わった文字をハイライトします。作業ツリーの変更は index とディスク上のファイルを、ステージ済みの変更だけがある場合は `HEAD` と index を比較します。
94
+
95
+ diff のツールバーでは、変更間の移動(`]c` / `[c` でも可)、インライン表示への切り替え、変更のない範囲の折りたたみ、行頭・行末の空白の差分を表示するかどうかの切り替えができます。空白の差分は既定で表示します。fzv は git を読み取るだけで、ステージやコミット、index のロック取得は行いません。
96
+
97
+ サイドバーの Source Control ビューは、VS Code と同じく「Staged Changes」「Changes」(未追跡ファイルを含む)、競合がある場合は「Merge Changes」に分けて変更を一覧し、VS Code と同じステータス文字と色で表示します。変更を選ぶと、削除されたファイルも含めて diff を開きます。ファイルのボタンではファイルそのものを開きます。現在のブランチはステータスバーに表示され、一覧はファイルの変更時とウィンドウにフォーカスが戻ったときに更新されます。
98
+
99
+ ## キー操作
100
+
101
+ | キー | 操作 |
102
+ | ------------------------ | -------------------------------------------- |
103
+ | `/` | ファイル検索を開く |
104
+ | `?` | キー操作の一覧を表示 |
105
+ | `f` | リンクやボタンにラベルを出し、入力でジャンプ |
106
+ | `h` `j` `k` `l` | プレビューをスクロール |
107
+ | `gg` / `G` | 先頭 / 末尾へ移動 |
108
+ | `r` | 表示中のファイルを読み直す |
109
+ | `Alt+J` / `Alt+K` | 同じ分割内で次 / 前のタブへ |
110
+ | `Ctrl/Cmd+\` | 右に分割 |
111
+ | `Ctrl/Cmd+Shift+\` | 下に分割 |
112
+ | `Ctrl/Cmd+1`〜`9` | 分割領域にフォーカス |
113
+ | `Ctrl/Cmd+F` | PDF 内を検索 |
114
+ | `Ctrl/Cmd` + `+` `-` `0` | 画像と PDF のズーム(`0` で画面に合わせる) |
115
+ | `]c` / `[c` | diff で次 / 前の変更へ |
116
+ | `Ctrl/Cmd+Shift+E` | Explorer を表示 |
117
+ | `Ctrl/Cmd+Shift+G` | Source Control を表示 |
118
+ | `Ctrl/Cmd+B` | サイドバーの表示 / 非表示 |
119
+ | `Escape` | 検索、ヘルプ、ラベル表示を閉じる |
120
+
121
+ 入力欄では文字入力が優先されます。ブラウザが予約しているショートカットは、ブラウザの動作が優先されます。
122
+
123
+ ## Office 文書のプレビュー
124
+
125
+ `.docx`、`.xlsx`、`.pptx` は、手元の ibisOffice か LibreOffice で PDF に変換してから表示します。fzv は起動時に `PATH` から `ibisOffice`、`soffice`、`libreoffice` の順で探し、macOS では `/Applications` 内のアプリも探します。見つかった変換ソフトは起動メッセージの `Office` 行に表示されます。
126
+
127
+ 見つからない場所にある場合は、`--office-converter` でパスを指定します。
128
+
129
+ ```bash
130
+ npx --yes @aaa_iii/fzv@latest --office-converter ~/Applications/ibisOffice-0.8.4-Linux.AppImage
131
+ ```
132
+
133
+ 実行ファイル名が `soffice` または `libreoffice` で始まる場合は LibreOffice として、それ以外は ibisOffice として呼び出します。変換結果はファイルの内容ごとにキャッシュされ、内容が変わると変換し直します。
134
+
135
+ ## オプション
136
+
137
+ | オプション | 既定値 | 説明 |
138
+ | ------------------------- | -------------------------- | -------------------------------------------------------------------- |
139
+ | `--root PATH` | カレントディレクトリ | 開くプロジェクトのルート |
140
+ | `--host HOST` | `127.0.0.1` | 待ち受けるアドレス |
141
+ | `--port PORT` | プロジェクトのパスから決定 | `0` で空きポート。明示したポートが使用中なら起動しない |
142
+ | `--watch` | 無効 | ファイルの変更を検知して、検索対象と開いているタブを更新 |
143
+ | `--allow-html-network` | 無効 | HTML プレビューに外部スクリプトの読み込みとネットワーク通信を許可 |
144
+ | `--office-converter PATH` | `PATH` から自動検出 | Office 文書の変換に使う ibisOffice または LibreOffice の実行ファイル |
145
+ | `-h`, `--help` | | ヘルプを表示 |
146
+ | `-v`, `--version` | | バージョンを表示 |
147
+
148
+ ## セキュリティ
149
+
150
+ 既定では `127.0.0.1` だけで待ち受け、このマシンからしか開けません。LAN 内の別の端末から開くには、待ち受けアドレスを明示します。
151
+
152
+ ```bash
153
+ npx --yes @aaa_iii/fzv@latest --host 0.0.0.0 --port 8000
154
+ ```
155
+
156
+ **注意**: 認証も TLS もありません。接続できる人は誰でも、プロジェクト内の表示対象ファイルを読めます。信頼できるネットワークでだけ使ってください。
157
+
158
+ - サーバーは GET と HEAD だけを受け付け、別オリジンからの API リクエストを拒否します。
159
+ - HTML プレビューは sandbox 内で動き、fzv 本体のページやストレージには触れません。インラインスクリプトは動きますが、外部スクリプトと API 通信は既定で遮断します。画像、CSS、フォントは読み込まれる場合があります。`--allow-html-network` は、中身を信頼できる HTML にだけ使ってください。
160
+ - Office 文書は、検証したファイルの内容を一時ディレクトリにコピーしてから変換ソフトに渡します。変換ソフトがプロジェクトのパスを直接読むことはありません。一時ディレクトリは終了時に削除します。
161
+
162
+ ## 開発状況
163
+
164
+ 0.x 系で開発中です。オプションやキー操作は、マイナーバージョンの更新でも変わることがあります。
165
+
166
+ ## ソースから動かす
167
+
168
+ ```bash
169
+ npm ci
170
+ npm run build
171
+ node dist/server/cli.js --watch
172
+ ```
173
+
174
+ UI を変更しながら確認するときは、サーバーを起動したまま別のターミナルで `npm run dev:ui` を実行し、Vite が表示する URL を開きます。テストは `npm test` と `npm run test:browser` です。
175
+
176
+ ## ライセンス
177
+
178
+ [MIT](https://github.com/iiii1224/fzv/blob/main/LICENSE)。同梱しているコンポーネントのライセンスと、あいまい検索の実装の出典は [THIRD_PARTY_NOTICES.md](https://github.com/iiii1224/fzv/blob/main/THIRD_PARTY_NOTICES.md) にあります。
package/README.md CHANGED
@@ -1,119 +1,178 @@
1
1
  # fzv
2
2
 
3
- プロジェクトのファイルを検索して、ブラウザで読むための読み取り専用ビューアです。ターミナルやコーディングエージェントで作業を続けながら、PDF、HTML、画像、ソースコードをタブや分割画面で確認できます。
3
+ [![npm](https://img.shields.io/npm/v/@aaa_iii/fzv)](https://www.npmjs.com/package/@aaa_iii/fzv)
4
+ [![CI](https://github.com/iiii1224/fzv/actions/workflows/ci.yml/badge.svg)](https://github.com/iiii1224/fzv/actions/workflows/ci.yml)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/iiii1224/fzv/blob/main/LICENSE)
4
6
 
5
- ## 必要な環境
7
+ English | [日本語](https://github.com/iiii1224/fzv/blob/main/README.ja.md)
6
8
 
7
- - Node.js 24 以降
8
- - 現行のデスクトップブラウザ
9
+ A read-only browser viewer for finding and reading the files your coding agent produces, without opening an IDE. Switch between PDFs, HTML, images, source code, and Office documents in the same tabs and split panes.
9
10
 
10
- 実行時に追加のnpmパッケージをインストールしません。配布パッケージにはUIと必要なアセットが含まれています。
11
+ ```console
12
+ $ npx --yes @aaa_iii/fzv@latest --watch
11
13
 
12
- ## 使い始める
14
+ fzv 0.3.0
15
+ Project ~/dev/fzv
16
+ Viewer http://127.0.0.1:29814/
17
+ Office ibisOffice (~/.local/bin/ibisOffice)
13
18
 
14
- npmレジストリから起動します。プロジェクトのディレクトリで実行してください。
15
-
16
- ```bash
17
- npx --yes @aaa_iii/fzv@latest --root .
19
+ Press Ctrl+C to stop.
18
20
  ```
19
21
 
20
- 自動再読み込みを有効にするには `--watch` を付けます。
22
+ Open the printed URL in your browser and press `/` to find a file.
21
23
 
22
- ```bash
23
- npx --yes @aaa_iii/fzv@latest --root . --watch
24
- ```
24
+ ## Why fzv
25
25
 
26
- ターミナルに表示されたURLをブラウザで開きます。既定では `http://127.0.0.1:8000/` で待ち受けます。終了するには `Ctrl+C` を押します。
26
+ fzv is built for keeping an eye on generated output while you keep directing an agent from the terminal.
27
27
 
28
- ## コマンドラインオプション
28
+ - **One `npx` command**: nothing is downloaded at runtime. The UI, PDF.js, and fonts ship inside the package, and there is no install-time build.
29
+ - **One workflow for every format**: PDFs, Markdown, and images all use the same tabs, splits, and keys.
30
+ - **Keyboard-driven**: `/` for fuzzy search, `hjkl` to scroll, `f` to jump to any link or button on screen.
31
+ - **Never modifies files**: there is no write path, and requests outside the project root are rejected.
29
32
 
30
- | オプション | 既定値 | 説明 |
31
- | ---------------------- | -------------------- | ------------------------------------------------------ |
32
- | `--root PATH` | カレントディレクトリ | 閲覧するプロジェクトのルート |
33
- | `--host HOST` | `127.0.0.1` | 待ち受けアドレス |
34
- | `--port PORT` | `8000` | ポート番号。`0` を指定すると空きポートを使う |
35
- | `--watch` | 無効 | プロジェクト内の変更後に検索対象と表示を更新 |
36
- | `--allow-html-network` | 無効 | HTMLプレビューで外部スクリプトとネットワーク通信を許可 |
37
- | `-h`, `--help` | — | ヘルプを表示 |
38
- | `-v`, `--version` | — | バージョンを表示 |
33
+ **What it does not do**: edit files, search file contents, honor `.gitignore`, preview legacy Office formats (`.doc`, `.xls`, `.ppt`), or serve with authentication. Pair it with an editor or `rg` for editing and full-text search.
39
34
 
40
- 別のプロジェクトやポートで起動する例:
35
+ ## Requirements
36
+
37
+ - Node.js 24 or later
38
+ - A current desktop browser
39
+ - For Office documents only: [ibisOffice](https://github.com/ibisjp/ibis-office) or [LibreOffice](https://www.libreoffice.org/)
40
+
41
+ ## Start
41
42
 
42
43
  ```bash
43
- npx --yes @aaa_iii/fzv@latest --root ~/projects/example --port 8001 --watch
44
+ # Open the current directory
45
+ npx --yes @aaa_iii/fzv@latest
46
+
47
+ # Watch for changes and refresh the search index and open tabs
48
+ npx --yes @aaa_iii/fzv@latest --watch
49
+
50
+ # Open another directory
51
+ npx --yes @aaa_iii/fzv@latest --root ~/projects/example
44
52
  ```
45
53
 
46
- ## ファイルを探して読む
54
+ Press `Ctrl+C` to stop.
47
55
 
48
- `/` キーまたは「Find a file」から検索を開きます。空の検索欄には現在のディレクトリ直下の項目が表示されます。ディレクトリを選ぶとその中へ移動し、文字を入力するとパスをあいまい検索します。検索語をスペースで区切ると、すべての語を含むパスを探します。
56
+ The port is derived from the project path, in the range 20000–29999. The same project always gets the same URL, so the tabs, splits, and theme saved in your browser come back on the next run. If that port is taken, fzv starts on a free port and prints a warning. The URL then differs, so the previous session is not restored.
49
57
 
50
- ファイルはタブで開きます。タブは並べ替えられ、ドラッグして上下左右に画面を分割したり、別の領域へ移動したりできます。分割領域はドラッグでサイズを調整でき、最大32個まで作成できます。タブ、分割、選択中のファイルはブラウザに保存され、再読み込み後に復元されます。
58
+ ## Usage
51
59
 
52
- ### プレビュー形式
60
+ ### Find files
53
61
 
54
- - PDF: ページ表示、文字選択、文書内検索、ズーム
55
- - HTML (`.html`, `.htm`): Viewer / Source 切り替え
56
- - 画像: PNG、JPEG、GIF、WebP、AVIF、BMP、SVG、ICO。拡大・縮小・移動
57
- - テキスト: Markdown、JSON、JavaScript、TypeScript、Python、Rust、Go、YAML、CSVなど。ソース表示とシンタックスハイライト
62
+ Press `/` or click "Find a file" to open search. With an empty query, it lists the files and directories at the project root. Selecting a directory moves into it; typing fuzzy-matches paths. Space-separated terms narrow results to paths that contain all of them.
58
63
 
59
- Markdownは整形表示とソース表示を切り替えられます。HTML、Markdown、PDF以外のテキストはソース表示で開きます。1ファイルの上限は20 MiBです。
64
+ The file list is rescanned in the background each time search opens, so files created after the page loaded show up too. While the rescan runs, you can keep searching the previous list.
60
65
 
61
- 検索画面を開くたびにファイル一覧を裏で取り直すので、ページを開いたあとに作られたファイルも検索できます。取り直しの間は直前の一覧で検索でき、届いた時点で結果が更新されます。`--watch` を使うと、対象プロジェクトの変更後に検索対象のファイル一覧と変更されたファイルのタブを自動で更新します。更新中も検索は直前の一覧で使えます。
66
+ Hidden files and directories, `node_modules`, and `__pycache__` are not listed.
62
67
 
63
- ## キーボード操作
68
+ ### Side bar
64
69
 
65
- | キー | 操作 |
66
- | ------------------- | -------------------------------------------------- |
67
- | `/` | ファイル検索を開く |
68
- | `↑` / `↓`, `Enter` | 検索結果を選択して開く |
69
- | `Escape` | 検索やヘルプを閉じる、ヒントを解除 |
70
- | `?` | キーボード操作一覧を表示 |
71
- | `f` | 画面上のリンクや操作部品にジャンプするヒントを表示 |
72
- | `h` `j` `k` `l` | プレビューをスクロール |
73
- | `gg` / `G` | プレビューの先頭 / 末尾へ移動 |
74
- | `r` | 選択中のプレビューを再取得 |
75
- | `Alt+J` / `Alt+K` | 現在の領域で次 / 前のタブへ移動 |
76
- | `Ctrl/Cmd+\` | 右に分割 |
77
- | `Ctrl/Cmd+Shift+\` | 下に分割 |
78
- | `Ctrl/Cmd+1` 〜 `9` | 分割領域へフォーカス |
70
+ The activity bar on the left switches the side bar between the Explorer and, in git repositories, Source Control. The Explorer shows the same files as search as a folder tree, with git status colors and letters; it follows the active tab and remembers expanded folders. Click the active icon or press `Ctrl/Cmd+B` to hide the side bar, and drag its edge to resize it. In narrow windows it opens over the editor.
79
71
 
80
- ブラウザが `Ctrl+Tab` をアプリへ渡す場合は、タブ切り替えにも使えます。ブラウザが予約しているキー操作はブラウザ側が優先されます。入力欄では文字入力を優先します。
72
+ ### Tabs and splits
81
73
 
82
- ## セキュリティとアクセス範囲
74
+ Files open in tabs. Drag a tab to reorder it, or drop it on any edge to split the view. Hold `Ctrl` (`Option` on macOS) while dragging to copy the tab instead of moving it. Up to 32 split panes are supported, and the dividers can be dragged to resize them.
83
75
 
84
- サーバーは既定でこのマシンの `127.0.0.1` だけに接続を受け付けます。LANの別端末から開く場合は、たとえば次のように起動します。
76
+ Open tabs, the split layout, and view modes are saved in the browser and restored on reload.
85
77
 
86
- ```bash
87
- npx --yes @aaa_iii/fzv@latest --root . --host 0.0.0.0 --port 8001
88
- ```
78
+ ### Supported formats
79
+
80
+ | Format | Extensions | View |
81
+ | -------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
82
+ | PDF | `.pdf` | Text selection, in-document search, zoom |
83
+ | HTML | `.html` `.htm` | Rendered in a sandbox; switchable to source |
84
+ | Markdown | `.md` | Rendered; switchable to source |
85
+ | Image | `.png` `.jpg` `.jpeg` `.gif` `.webp` `.avif` `.bmp` `.svg` `.ico` | Zoom and pan |
86
+ | Office | `.docx` `.xlsx` `.pptx` | Converted to PDF |
87
+ | Text | `.ts` `.js` `.py` `.rs` `.go` `.json` `.yaml` `.toml` `.tex` `.csv`, and more; `Makefile` `Dockerfile` | Source with line numbers and syntax highlighting |
88
+
89
+ Files are limited to 20 MiB each. "Download" saves the current file in its original format.
90
+
91
+ ### Changes
92
+
93
+ When the project is inside a git repository and `git` is on `PATH`, a text file with uncommitted changes shows an "Open Changes" button in its toolbar. It opens a diff in the style of VS Code: side by side, with changed lines and the changed characters within them highlighted. Working tree changes compare the index with the file on disk; staged-only changes compare `HEAD` with the index.
94
+
95
+ The diff toolbar moves between changes (also `]c` / `[c`), switches to an inline view, collapses unchanged regions, and toggles whether leading and trailing whitespace differences are shown. They are shown by default. fzv only reads from git: it never stages, commits, or takes the index lock.
96
+
97
+ The Source Control view in the side bar lists changes like VS Code: "Staged Changes", "Changes" (including untracked files), and "Merge Changes" for conflicts, each with VS Code's status letters and colors. Selecting a change opens its diff, including deleted files; the file button opens the file itself. The current branch appears in the status bar, and the list refreshes when files change or the window regains focus.
89
98
 
90
- ネットワーク公開には認証もTLSもありません。接続できる端末からプロジェクト内の公開対象ファイルを閲覧できます。信頼できるネットワークでのみ使用してください。
99
+ ## Keyboard shortcuts
91
100
 
92
- fzvはファイルを書き換えず、ルート外へのパスアクセスを拒否します。隠しファイルとディレクトリ、`node_modules`、`__pycache__` は表示・配信しません。`.gitignore` は解釈しません。
101
+ | Keys | Action |
102
+ | ------------------------ | --------------------------------------------- |
103
+ | `/` | Open file search |
104
+ | `?` | Show all shortcuts |
105
+ | `f` | Label links and buttons; type a label to jump |
106
+ | `h` `j` `k` `l` | Scroll the preview |
107
+ | `gg` / `G` | Go to the top / bottom |
108
+ | `r` | Reload the current file |
109
+ | `Alt+J` / `Alt+K` | Next / previous tab in the same pane |
110
+ | `Ctrl/Cmd+\` | Split right |
111
+ | `Ctrl/Cmd+Shift+\` | Split down |
112
+ | `Ctrl/Cmd+1`–`9` | Focus a pane |
113
+ | `Ctrl/Cmd+F` | Search within a PDF |
114
+ | `Ctrl/Cmd` + `+` `-` `0` | Zoom images and PDFs (`0` fits to the view) |
115
+ | `]c` / `[c` | Next / previous change in a diff |
116
+ | `Ctrl/Cmd+Shift+E` | Show the Explorer |
117
+ | `Ctrl/Cmd+Shift+G` | Show Source Control |
118
+ | `Ctrl/Cmd+B` | Show / hide the side bar |
119
+ | `Escape` | Close search, help, or labels |
93
120
 
94
- HTMLプレビューはsandbox内で動作します。インラインスクリプトは実行できますが、既定では外部スクリプトの読み込みとAPI通信を許可しません。画像、CSS、フォントなどはHTMLのプレビュー方針に従って読み込まれる場合があります。信頼できるHTMLで外部スクリプトや通信が必要な場合だけ `--allow-html-network` を指定してください。この設定はHTMLからネットワークへの接続を許可します。
121
+ Text fields keep their normal typing behavior. Shortcuts reserved by the browser take precedence.
95
122
 
96
- ## ソースから実行する
123
+ ## Office documents
124
+
125
+ `.docx`, `.xlsx`, and `.pptx` files are converted to PDF with a local ibisOffice or LibreOffice before display. At startup, fzv searches `PATH` for `ibisOffice`, `soffice`, and `libreoffice`, in that order, and also checks `/Applications` on macOS. The converter it finds is shown on the `Office` line of the startup message.
126
+
127
+ If the converter lives somewhere else, pass its path with `--office-converter`:
97
128
 
98
129
  ```bash
99
- npm ci
100
- npm run build
101
- node dist/server/cli.js --root . --watch
130
+ npx --yes @aaa_iii/fzv@latest --office-converter ~/Applications/ibisOffice-0.8.4-Linux.AppImage
102
131
  ```
103
132
 
104
- 開発中にUIの変更を確認する場合は、サーバーを起動したまま別のターミナルで次を実行し、Viteが表示するURLを開きます。
133
+ Executables whose names start with `soffice` or `libreoffice` are run as LibreOffice; anything else is run as ibisOffice. Converted PDFs are cached by file content and regenerated when the content changes.
134
+
135
+ ## Options
136
+
137
+ | Option | Default | Description |
138
+ | ------------------------- | ----------------------- | --------------------------------------------------------------------- |
139
+ | `--root PATH` | Current directory | Project root to open |
140
+ | `--host HOST` | `127.0.0.1` | Address to listen on |
141
+ | `--port PORT` | Derived from the path | `0` picks a free port. An explicit port that is in use stops startup |
142
+ | `--watch` | Off | Watch for changes and refresh the search index and open tabs |
143
+ | `--allow-html-network` | Off | Let HTML previews load external scripts and make network requests |
144
+ | `--office-converter PATH` | Auto-detected on `PATH` | ibisOffice or LibreOffice executable used to convert Office documents |
145
+ | `-h`, `--help` | | Show help |
146
+ | `-v`, `--version` | | Show the version |
147
+
148
+ ## Security
149
+
150
+ By default fzv listens on `127.0.0.1` only, so it is reachable from this machine alone. To open it from another device on your LAN, set the listen address explicitly:
105
151
 
106
152
  ```bash
107
- npm run dev:ui
153
+ npx --yes @aaa_iii/fzv@latest --host 0.0.0.0 --port 8000
108
154
  ```
109
155
 
110
- 主な検証コマンド:
156
+ **Warning**: there is no authentication and no TLS. Anyone who can connect can read the viewable files in the project. Use it only on networks you trust.
157
+
158
+ - The server accepts only GET and HEAD and rejects cross-origin API requests.
159
+ - HTML previews run in a sandbox and cannot reach the fzv page or its storage. Inline scripts run, but external scripts and API requests are blocked by default. Images, CSS, and fonts may still load. Use `--allow-html-network` only for HTML you trust.
160
+ - Office documents are copied from the validated file into a temporary directory before conversion. The converter never reads project paths directly. The temporary directory is removed on exit.
161
+
162
+ ## Status
163
+
164
+ fzv is in 0.x development. Options and shortcuts may change in minor releases.
165
+
166
+ ## Run from source
111
167
 
112
168
  ```bash
113
- npm test
114
- npm run test:browser
169
+ npm ci
170
+ npm run build
171
+ node dist/server/cli.js --watch
115
172
  ```
116
173
 
117
- ## ライセンス
174
+ To work on the UI, keep the server running, run `npm run dev:ui` in another terminal, and open the URL Vite prints. Run the tests with `npm test` and `npm run test:browser`.
175
+
176
+ ## License
118
177
 
119
- MIT License。依存コンポーネントのライセンスと検索実装の帰属情報は [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) に記載しています。
178
+ [MIT](https://github.com/iiii1224/fzv/blob/main/LICENSE). Licenses for bundled components and the attribution for the fuzzy search implementation are in [THIRD_PARTY_NOTICES.md](https://github.com/iiii1224/fzv/blob/main/THIRD_PARTY_NOTICES.md).
@@ -66,7 +66,10 @@ License copy: `licenses/dompurify-APACHE-2.0.txt`.
66
66
  ## Visual Studio Code
67
67
 
68
68
  Tabs, Quick Input styling, and the Light Modern / Dark Modern UI palettes use assets from
69
- Microsoft Visual Studio Code 1.106.0, adapted to the browser workspace.
69
+ Microsoft Visual Studio Code 1.106.0, adapted to the browser workspace. The diff view
70
+ includes VS Code's default lines diff algorithm and ports its diff editor alignment,
71
+ decoration, and unchanged-region rules. The activity bar, side bar, Explorer, and Source Control view
72
+ adapt VS Code's workbench styles and its git extension's status letters and decoration colors.
70
73
  Copyright (c) Microsoft Corporation. All rights reserved.
71
74
 
72
75
  Upstream: https://github.com/microsoft/vscode/tree/1.106.0