reviw 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ja.md CHANGED
@@ -14,14 +14,9 @@
14
14
 
15
15
  ---
16
16
 
17
- > [!WARNING]
18
- > **アルファ版ソフトウェア**: このプロジェクトは現在開発中です。破壊的変更、APIの不安定性、機能の不完全さが予想されます。本番環境での使用はご自身の責任でお願いします。
19
-
20
- ---
21
-
22
17
  # reviw
23
18
 
24
- 表形式データ、テキスト、Markdown、diffファイルをレビュー・注釈するための軽量ブラウザベースツール。CSV、TSV、プレーンテキスト、Markdown、unified diff形式をサポート。コメントはYAML形式で標準出力に出力されます。
19
+ 表形式データ、テキスト、Markdown、diffファイルをレビュー・注釈するための軽量ブラウザベースツール。[MoonBit](https://www.moonbitlang.com/)で書かれており、手書きJavaScriptはゼロ。CSV、TSV、プレーンテキスト、Markdown、unified diff形式をサポート。コメントはYAML形式で標準出力に出力されます。
25
20
 
26
21
  ## 機能
27
22
 
@@ -131,6 +126,9 @@ reviw changes.diff
131
126
  ### コメントダイアログ(画像添付対応)
132
127
  ![Comment Dialog](https://raw.githubusercontent.com/kazuph/reviw/main/assets/screenshot-comment-dialog.png)
133
128
 
129
+ ### 動画フルスクリーン(タイムラインサムネイル付き)
130
+ ![Video Fullscreen](https://raw.githubusercontent.com/kazuph/reviw/main/assets/screenshot-video-thumbnails.png)
131
+
134
132
  ### Mermaidフルスクリーン(ミニマップ付き)
135
133
  ![Mermaid Fullscreen](https://raw.githubusercontent.com/kazuph/reviw/main/assets/screenshot-mermaid-fullscreen.png)
136
134
 
@@ -433,8 +431,21 @@ git add --force .artifacts/feature/videos/demo.mp4
433
431
 
434
432
  ## 開発
435
433
 
436
- - メインソース: `cli.cjs`
437
- - テスト: `npm test`(vitest + playwright)
434
+ reviwは[MoonBit](https://www.moonbitlang.com/)で書かれており、JavaScriptにコンパイルされます。
435
+
436
+ ```bash
437
+ # ビルド
438
+ cd v2 && moon build --target js --release
439
+
440
+ # テスト実行
441
+ cd v2 && moon test --target js
442
+
443
+ # npmパッケージング(MoonBitビルド + dist/にコピー)
444
+ npm run prepack
445
+ ```
446
+
447
+ - ソース: `v2/src/`(MoonBit)
448
+ - ビルド出力: `dist/server/server.js`、`dist/ui/ui.js`
438
449
  - プラグイン: `plugin/`ディレクトリ
439
450
 
440
451
  ## ライセンス
package/README.md CHANGED
@@ -14,14 +14,9 @@
14
14
 
15
15
  ---
16
16
 
17
- > [!WARNING]
18
- > **Alpha Software**: This project is in active development. Expect breaking changes, API instability, and incomplete features. Use at your own risk in production environments.
19
-
20
- ---
21
-
22
17
  # reviw
23
18
 
24
- A lightweight browser-based tool for reviewing and annotating tabular data, text, Markdown, and diff files. Supports CSV, TSV, plain text, Markdown, and unified diff formats. Comments are output as YAML to stdout.
19
+ A lightweight browser-based tool for reviewing and annotating tabular data, text, Markdown, and diff files. Built entirely in [MoonBit](https://www.moonbitlang.com/) (zero hand-written JavaScript). Supports CSV, TSV, plain text, Markdown, and unified diff formats. Comments are output as YAML to stdout.
25
20
 
26
21
  ## Features
27
22
 
@@ -131,6 +126,9 @@ reviw changes.diff
131
126
  ### Comment Dialog with Image Attachment
132
127
  ![Comment Dialog](https://raw.githubusercontent.com/kazuph/reviw/main/assets/screenshot-comment-dialog.png)
133
128
 
129
+ ### Video Fullscreen with Timeline Thumbnails
130
+ ![Video Fullscreen](https://raw.githubusercontent.com/kazuph/reviw/main/assets/screenshot-video-thumbnails.png)
131
+
134
132
  ### Mermaid Fullscreen with Minimap
135
133
  ![Mermaid Fullscreen](https://raw.githubusercontent.com/kazuph/reviw/main/assets/screenshot-mermaid-fullscreen.png)
136
134
 
@@ -476,8 +474,21 @@ This approach gives you full control: ignore by default, commit only what matter
476
474
 
477
475
  ## Development
478
476
 
479
- - Main source: `cli.cjs`
480
- - Tests: `npm test` (vitest + playwright)
477
+ reviw is written entirely in [MoonBit](https://www.moonbitlang.com/) and compiled to JavaScript.
478
+
479
+ ```bash
480
+ # Build
481
+ cd v2 && moon build --target js --release
482
+
483
+ # Run tests
484
+ cd v2 && moon test --target js
485
+
486
+ # Package for npm (builds MoonBit + copies to dist/)
487
+ npm run prepack
488
+ ```
489
+
490
+ - Source: `v2/src/` (MoonBit)
491
+ - Build output: `dist/server/server.js`, `dist/ui/ui.js`
481
492
  - Plugin: `plugin/` directory
482
493
 
483
494
  ## License
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { dirname as dirname$2065, join as join$1985, resolve as resolve$2017, extname as extname$2005, basename as basename$2015 } from "node:path";
3
- import { spawnSync as spawnSync$2087, execSync as execSync$2052, spawn as spawn$2082 } from "node:child_process";
4
- import { createHash as createHash$2039 } from "node:crypto";
5
- import { createServer as createServer$2022 } from "node:http";
6
- import { tmpdir as tmpdir$2057, homedir as homedir$1990 } from "node:os";
7
- import { statSync as statSync$2101, unwatchFile as unwatchFile$2045, readdirSync as readdirSync$2068, existsSync as existsSync$1982, rmSync as rmSync$2077, mkdtempSync as mkdtempSync$2056, createReadStream as createReadStream$2105, writeFileSync as writeFileSync$1996, unlinkSync as unlinkSync$1998, readFileSync as readFileSync$1988, watchFile as watchFile$2141, mkdirSync as mkdirSync$1993 } from "node:fs";
2
+ import { dirname as dirname$2025, join as join$2008, resolve as resolve$2046, extname as extname$2034, basename as basename$2044 } from "node:path";
3
+ import { spawnSync as spawnSync$2114, execSync as execSync$2079, spawn as spawn$2109 } from "node:child_process";
4
+ import { createHash as createHash$2066 } from "node:crypto";
5
+ import { createServer as createServer$2051 } from "node:http";
6
+ import { tmpdir as tmpdir$2084, homedir as homedir$2013 } from "node:os";
7
+ import { statSync as statSync$2129, unwatchFile as unwatchFile$2072, readdirSync as readdirSync$2094, existsSync as existsSync$2005, rmSync as rmSync$2103, mkdtempSync as mkdtempSync$2083, createReadStream as createReadStream$2133, writeFileSync as writeFileSync$2019, unlinkSync as unlinkSync$2021, readFileSync as readFileSync$2011, watchFile as watchFile$2169, mkdirSync as mkdirSync$2016 } from "node:fs";
8
8
  class $PanicError extends Error {}
9
9
  function $panic() {
10
10
  throw new $PanicError();
@@ -44,6 +44,7 @@ function $make_array_len_and_init(a, b) {
44
44
  }
45
45
  const _M0MP311moonbitlang4core7builtin7JSArray4push = (arr, val) => { arr.push(val); };
46
46
  const _M0MP311moonbitlang4core7builtin7JSArray4copy = (arr) => arr.slice(0);
47
+ const _M0FP311moonbitlang4core7builtin15ryu__to__string = (number) => number.toString();
47
48
  const _M0MP311moonbitlang4core7builtin7JSArray11set__length = (arr, len) => { arr.length = len; };
48
49
  const _M0MP311moonbitlang4core7builtin7JSArray3pop = (arr) => arr.pop();
49
50
  const _M0MP311moonbitlang4core7builtin7JSArray6splice = (arr, idx, cnt) => arr.splice(idx, cnt);
@@ -62,6 +63,8 @@ const _M0FP36kazuph5reviw6server13get__env__var = (name) => process.env[name] ||
62
63
  const _M0FP36kazuph5reviw6server22mkdir__recursive__opts = () => ({ recursive: true });
63
64
  const _M0FP36kazuph5reviw6server12console__log = (msg) => console.log(msg);
64
65
  const _M0FP36kazuph5reviw6server9get__argv = () => process.argv;
66
+ const _M0FP36kazuph5reviw6server20parse__json__version = (s) => { try { return JSON.parse(s).version || "unknown"; } catch { return "unknown"; } };
67
+ const _M0FP36kazuph5reviw6server17try__call__string = (fn, fb) => { try { return fn(); } catch(e) { return fb; } };
65
68
  const _M0FP36kazuph5reviw6server14is__stdin__tty = () => process.stdin.isTTY || false;
66
69
  const _M0FP36kazuph5reviw6server19on__process__signal = (sig, handler) => process.on(sig, handler);
67
70
  const _M0FP36kazuph5reviw6server13process__exit = (code) => process.exit(code);
@@ -85,7 +88,6 @@ const _M0FP36kazuph5reviw6server20extract__base64__ext = (data) => {
85
88
  const m = data.match(/^data:image\/(\w+);base64,/);
86
89
  return m ? (m[1] === "jpeg" ? "jpg" : m[1]) : "";
87
90
  };
88
- const _M0FP36kazuph5reviw6server17try__call__string = (fn, fb) => { try { return fn(); } catch(e) { return fb; } };
89
91
  const _M0FP36kazuph5reviw6server8iso__now = () => new Date().toISOString();
90
92
  const _M0FP36kazuph5reviw6server21json__parse__comments = (s) => {
91
93
  try {
@@ -101,7 +103,11 @@ const _M0FP36kazuph5reviw6server27hash__update__digest__hex16 = (h, d) => h.upda
101
103
  const _M0FP36kazuph5reviw6server15try__call__void = (fn) => { try { fn(); } catch(e) {} };
102
104
  const _M0FP36kazuph5reviw6server15js__stdio__pipe = () => ({ stdio: "pipe" });
103
105
  const _M0FP36kazuph5reviw6server15try__call__bool = (fn) => { try { return fn(); } catch(e) { return false; } };
104
- const _M0FP36kazuph5reviw6server16on__spawn__close = (proc, handler) => proc.on("close", (code) => handler(code || 0));
106
+ const _M0FP36kazuph5reviw6server30on__spawn__close__with__stderr = (proc, handler) => {
107
+ let buf = '';
108
+ if (proc.stderr) proc.stderr.on('data', (chunk) => { buf += chunk.toString(); });
109
+ proc.on('close', (code) => handler(code || 0, buf));
110
+ };
105
111
  const _M0FP36kazuph5reviw6server16on__spawn__error = (proc, handler) => proc.on("error", () => handler());
106
112
  const _M0FP36kazuph5reviw6server19parse__query__param = (url, key) => {
107
113
  try {
@@ -109,6 +115,14 @@ const _M0FP36kazuph5reviw6server19parse__query__param = (url, key) => {
109
115
  return u.searchParams.get(key) || "";
110
116
  } catch(e) { return ""; }
111
117
  };
118
+ const _M0FP36kazuph5reviw6server27parse__showinfo__timestamps = (stderr) => {
119
+ const times = [];
120
+ for (const line of stderr.split('\n')) {
121
+ const m = line.match(/pts_time:\s*([\d.]+)/);
122
+ if (m) times.push(parseFloat(m[1]));
123
+ }
124
+ return times;
125
+ };
112
126
  const _M0FP36kazuph5reviw6server15buf__to__base64 = (buf) => buf.toString("base64");
113
127
  const _M0FP36kazuph5reviw6server24try__call__array__string = (fn) => { try { return fn(); } catch(e) { return []; } };
114
128
  const _M0FP36kazuph5reviw6server8res__end = (res, data) => res.end(data);
@@ -123,6 +137,7 @@ const _M0FP36kazuph5reviw6server10setup__sse = (res) => {
123
137
  });
124
138
  res.write("retry: 3000\n\n");
125
139
  };
140
+ const _M0FP36kazuph5reviw6server13sort__strings = (arr) => arr.sort();
126
141
  const _M0FP36kazuph5reviw6server15js__parse__json = (s) => JSON.parse(s);
127
142
  const _M0FP36kazuph5reviw6server21js__spawn__opts__pipe = () => ({ stdio: ["pipe", "pipe", "pipe"] });
128
143
  const _M0FP36kazuph5reviw6server15js__obj__stdout = (obj) => obj?.stdout || "";
@@ -291,24 +306,24 @@ const _M0FP36kazuph5reviw4core27parse__diff_2e_2abind_7c956 = "--- ";
291
306
  const _M0FP36kazuph5reviw4core27parse__diff_2e_2abind_7c957 = "+++ ";
292
307
  const _M0FP36kazuph5reviw6server15active__servers = [];
293
308
  const _M0FP36kazuph5reviw6server12all__results = [];
294
- const _M0FP36kazuph5reviw6server26print__usage_2eusage_7c384 = "Usage: reviw <file...> [options]\n\nOptions:\n --port <n> Base port (default: 4989)\n --no-open Don't open browser\n -e, --encoding <enc> Force encoding (e.g. shift-jis, euc-jp)\n -h, --help Show help\n -v, --version Show version\n\nSupported formats: CSV, TSV, Markdown, Diff, Plain text\nPipe stdin for diff: git diff | reviw";
295
- const _M0FP36kazuph5reviw6server28detect__mode_2e_2abind_7c427 = ".";
296
- const _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c458 = "..";
297
- const _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c461 = "scene_";
298
- const _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c462 = ".jpg";
299
- const _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c489 = "/";
300
- const _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c487 = "..";
301
- const _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c488 = "video/";
302
- const _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c491 = "/";
303
- const _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c490 = "..";
304
- const _M0FP36kazuph5reviw6server31handle__request_2e_2abind_7c492 = "/video-timeline?";
305
- const _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c493 = "true";
306
- const _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c494 = "true";
307
- const _M0FP36kazuph5reviw6server26_2ainit_2a_2e_2abind_7c504 = "-";
309
+ const _M0FP36kazuph5reviw6server26print__usage_2eusage_7c402 = "Usage: reviw <file...> [options]\n\nOptions:\n --port <n> Base port (default: 4989)\n --no-open Don't open browser\n -e, --encoding <enc> Force encoding (e.g. shift-jis, euc-jp)\n -h, --help Show help\n -v, --version Show version\n\nSupported formats: CSV, TSV, Markdown, Diff, Plain text\nPipe stdin for diff: git diff | reviw";
310
+ const _M0FP36kazuph5reviw6server28detect__mode_2e_2abind_7c448 = ".";
311
+ const _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c479 = "..";
312
+ const _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c482 = "scene_";
313
+ const _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c483 = ".jpg";
314
+ const _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c512 = "/";
315
+ const _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c510 = "..";
316
+ const _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c511 = "video/";
317
+ const _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c514 = "/";
318
+ const _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c513 = "..";
319
+ const _M0FP36kazuph5reviw6server31handle__request_2e_2abind_7c515 = "/video-timeline?";
320
+ const _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c516 = "true";
321
+ const _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c517 = "true";
322
+ const _M0FP36kazuph5reviw6server26_2ainit_2a_2e_2abind_7c527 = "-";
308
323
  const _M0FP36kazuph5reviw6server15expected__count = _M0MP311moonbitlang4core3ref3Ref3newGiE(0);
309
324
  const _M0FP36kazuph5reviw6server18encoding__override = _M0MP311moonbitlang4core3ref3Ref3newGsE("");
310
- const _M0FP311moonbitlang4core7builtin33brute__force__find_2econstr_2f241 = 0;
311
- const _M0FP311moonbitlang4core7builtin43boyer__moore__horspool__find_2econstr_2f227 = 0;
325
+ const _M0FP311moonbitlang4core7builtin33brute__force__find_2econstr_2f244 = 0;
326
+ const _M0FP311moonbitlang4core7builtin43boyer__moore__horspool__find_2econstr_2f230 = 0;
312
327
  const _M0FP36kazuph5reviw6server13ui__js__cache = _M0MP311moonbitlang4core3ref3Ref3newGsE("");
313
328
  const _M0FP311moonbitlang4core7builtin4seed = _M0FP311moonbitlang4core7builtin12random__seed();
314
329
  const _M0FP36kazuph5reviw4core16heading__counter = _M0MP311moonbitlang4core3ref3Ref3newGiE(0);
@@ -376,6 +391,15 @@ function _M0MP311moonbitlang4core5array5Array2atGRP311moonbitlang4core7builtin5A
376
391
  return $panic();
377
392
  }
378
393
  }
394
+ function _M0MP311moonbitlang4core5array5Array2atGdE(self, index) {
395
+ const len = self.length;
396
+ if (index >= 0 && index < len) {
397
+ $bound_check(self, index);
398
+ return self[index];
399
+ } else {
400
+ return $panic();
401
+ }
402
+ }
379
403
  function _M0MP311moonbitlang4core5array5Array2atGRP36kazuph5reviw4core12ReviewResultE(self, index) {
380
404
  const len = self.length;
381
405
  if (index >= 0 && index < len) {
@@ -1146,7 +1170,7 @@ function _M0FP311moonbitlang4core7builtin28boyer__moore__horspool__find(haystack
1146
1170
  return undefined;
1147
1171
  }
1148
1172
  } else {
1149
- return _M0FP311moonbitlang4core7builtin43boyer__moore__horspool__find_2econstr_2f227;
1173
+ return _M0FP311moonbitlang4core7builtin43boyer__moore__horspool__find_2econstr_2f230;
1150
1174
  }
1151
1175
  }
1152
1176
  function _M0FP311moonbitlang4core7builtin18brute__force__find(haystack, needle) {
@@ -1205,7 +1229,7 @@ function _M0FP311moonbitlang4core7builtin18brute__force__find(haystack, needle)
1205
1229
  return undefined;
1206
1230
  }
1207
1231
  } else {
1208
- return _M0FP311moonbitlang4core7builtin33brute__force__find_2econstr_2f241;
1232
+ return _M0FP311moonbitlang4core7builtin33brute__force__find_2econstr_2f244;
1209
1233
  }
1210
1234
  }
1211
1235
  function _M0MP311moonbitlang4core6string10StringView4find(self, str) {
@@ -1765,6 +1789,9 @@ function _M0MP311moonbitlang4core7builtin6Hasher15combine__string(self, value) {
1765
1789
  function _M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Hash13hash__combine(self, hasher) {
1766
1790
  _M0MP311moonbitlang4core7builtin6Hasher15combine__string(hasher, self);
1767
1791
  }
1792
+ function _M0MP311moonbitlang4core6double6Double10to__string(self) {
1793
+ return _M0FP311moonbitlang4core7builtin15ryu__to__string(self);
1794
+ }
1768
1795
  function _M0IP311moonbitlang4core7builtin13SourceLocReprP311moonbitlang4core7builtin4Show6output(self, logger) {
1769
1796
  const pkg = self.pkg;
1770
1797
  const _data = pkg.str;
@@ -4959,13 +4986,13 @@ function _M0FP36kazuph5reviw4core21csv__data__from__flat(flat) {
4959
4986
  }
4960
4987
  }
4961
4988
  function _M0FP36kazuph5reviw6server12exists__sync(_tmp) {
4962
- return existsSync$1982(_tmp);
4989
+ return existsSync$2005(_tmp);
4963
4990
  }
4964
4991
  function _M0FP36kazuph5reviw6server10path__join(_tmp, _tmp$2) {
4965
- return join$1985(_tmp, _tmp$2);
4992
+ return join$2008(_tmp, _tmp$2);
4966
4993
  }
4967
4994
  function _M0FP36kazuph5reviw6server16read__file__sync(_tmp, _tmp$2) {
4968
- return readFileSync$1988(_tmp, _tmp$2);
4995
+ return readFileSync$2011(_tmp, _tmp$2);
4969
4996
  }
4970
4997
  function _M0FP36kazuph5reviw6server12load__ui__js() {
4971
4998
  if (_M0FP36kazuph5reviw6server13ui__js__cache.val.length > 0) {
@@ -4983,7 +5010,7 @@ function _M0FP36kazuph5reviw6server12load__ui__js() {
4983
5010
  }
4984
5011
  }
4985
5012
  function _M0FP36kazuph5reviw6server11os__homedir() {
4986
- return homedir$1990();
5013
+ return homedir$2013();
4987
5014
  }
4988
5015
  function _M0FP36kazuph5reviw6server9lock__dir() {
4989
5016
  const override_dir = _M0FP36kazuph5reviw6server13get__env__var("REVIW_LOCK_DIR");
@@ -4994,7 +5021,7 @@ function _M0FP36kazuph5reviw6server10lock__path(port) {
4994
5021
  return _M0FP36kazuph5reviw6server10path__join(dir, `${_M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGiE(port)}.lock`);
4995
5022
  }
4996
5023
  function _M0FP36kazuph5reviw6server11mkdir__sync(_tmp, _tmp$2) {
4997
- return mkdirSync$1993(_tmp, _tmp$2);
5024
+ return mkdirSync$2016(_tmp, _tmp$2);
4998
5025
  }
4999
5026
  function _M0FP36kazuph5reviw6server17ensure__lock__dir() {
5000
5027
  const dir = _M0FP36kazuph5reviw6server9lock__dir();
@@ -5010,7 +5037,7 @@ function _M0FP36kazuph5reviw6server16is__port__locked(port) {
5010
5037
  return _M0FP36kazuph5reviw6server12exists__sync(lp);
5011
5038
  }
5012
5039
  function _M0FP36kazuph5reviw6server17write__file__sync(_tmp, _tmp$2) {
5013
- return writeFileSync$1996(_tmp, _tmp$2);
5040
+ return writeFileSync$2019(_tmp, _tmp$2);
5014
5041
  }
5015
5042
  function _M0FP36kazuph5reviw6server11write__lock(port) {
5016
5043
  _M0FP36kazuph5reviw6server17ensure__lock__dir();
@@ -5018,7 +5045,7 @@ function _M0FP36kazuph5reviw6server11write__lock(port) {
5018
5045
  _M0FP36kazuph5reviw6server17write__file__sync(lp, _M0MP311moonbitlang4core3int3Int18to__string_2einner(port, 10));
5019
5046
  }
5020
5047
  function _M0FP36kazuph5reviw6server12unlink__sync(_tmp) {
5021
- return unlinkSync$1998(_tmp);
5048
+ return unlinkSync$2021(_tmp);
5022
5049
  }
5023
5050
  function _M0FP36kazuph5reviw6server12remove__lock(port) {
5024
5051
  const lp = _M0FP36kazuph5reviw6server10lock__path(port);
@@ -5047,6 +5074,35 @@ function _M0FP36kazuph5reviw6server21find__available__port(base) {
5047
5074
  }
5048
5075
  return base;
5049
5076
  }
5077
+ function _M0FP36kazuph5reviw6server13path__dirname(_tmp) {
5078
+ return dirname$2025(_tmp);
5079
+ }
5080
+ function _M0FP36kazuph5reviw6server16read__file__safe(path) {
5081
+ return _M0FP36kazuph5reviw6server17try__call__string(() => _M0FP36kazuph5reviw6server16read__file__sync(path, "utf-8"), "");
5082
+ }
5083
+ function _M0FP36kazuph5reviw6server21get__package__version() {
5084
+ let dir = _M0FP36kazuph5reviw6server16get__script__dir();
5085
+ let _tmp = 0;
5086
+ while (true) {
5087
+ const i = _tmp;
5088
+ if (i < 5) {
5089
+ const content = _M0FP36kazuph5reviw6server16read__file__safe(_M0FP36kazuph5reviw6server10path__join(dir, "package.json"));
5090
+ if (content.length > 0) {
5091
+ const ver = _M0FP36kazuph5reviw6server20parse__json__version(content);
5092
+ const _p = "unknown";
5093
+ if (!(ver === _p)) {
5094
+ return ver;
5095
+ }
5096
+ }
5097
+ dir = _M0FP36kazuph5reviw6server13path__dirname(dir);
5098
+ _tmp = i + 1 | 0;
5099
+ continue;
5100
+ } else {
5101
+ break;
5102
+ }
5103
+ }
5104
+ return "unknown";
5105
+ }
5050
5106
  function _M0FP36kazuph5reviw6server11parse__port(s) {
5051
5107
  let n = 0;
5052
5108
  const chars = _M0MP311moonbitlang4core6string6String9to__array(s);
@@ -5068,17 +5124,17 @@ function _M0FP36kazuph5reviw6server11parse__port(s) {
5068
5124
  return n === 0 ? 4989 : n;
5069
5125
  }
5070
5126
  function _M0FP36kazuph5reviw6server12print__usage() {
5071
- _M0FP36kazuph5reviw6server12console__log(_M0FP36kazuph5reviw6server26print__usage_2eusage_7c384);
5127
+ _M0FP36kazuph5reviw6server12console__log(_M0FP36kazuph5reviw6server26print__usage_2eusage_7c402);
5072
5128
  }
5073
5129
  function _M0FP36kazuph5reviw6server17read__stdin__sync() {
5074
5130
  return _M0FP36kazuph5reviw6server16read__file__sync("/dev/stdin", "utf-8");
5075
5131
  }
5076
5132
  function _M0FP36kazuph5reviw6server13path__extname(_tmp) {
5077
- return extname$2005(_tmp);
5133
+ return extname$2034(_tmp);
5078
5134
  }
5079
5135
  function _M0FP36kazuph5reviw6server12detect__mode(file_path) {
5080
5136
  const ext = _M0FP36kazuph5reviw6server13path__extname(file_path);
5081
- const ext_lower = _M0MP311moonbitlang4core6string6String11has__prefix(ext, { str: _M0FP36kazuph5reviw6server28detect__mode_2e_2abind_7c427, start: 0, end: _M0FP36kazuph5reviw6server28detect__mode_2e_2abind_7c427.length }) ? _M0MP311moonbitlang4core6string6String9to__lower(_M0FP36kazuph5reviw4core11safe__slice(ext, 1)) : _M0MP311moonbitlang4core6string6String9to__lower(ext);
5137
+ const ext_lower = _M0MP311moonbitlang4core6string6String11has__prefix(ext, { str: _M0FP36kazuph5reviw6server28detect__mode_2e_2abind_7c448, start: 0, end: _M0FP36kazuph5reviw6server28detect__mode_2e_2abind_7c448.length }) ? _M0MP311moonbitlang4core6string6String9to__lower(_M0FP36kazuph5reviw4core11safe__slice(ext, 1)) : _M0MP311moonbitlang4core6string6String9to__lower(ext);
5082
5138
  return _M0MP36kazuph5reviw4core8FileMode15from__extension(ext_lower);
5083
5139
  }
5084
5140
  function _M0FP36kazuph5reviw6server16detect__encoding(buf) {
@@ -5176,7 +5232,7 @@ function _M0FP36kazuph5reviw6server16detect__encoding(buf) {
5176
5232
  return "utf-8";
5177
5233
  }
5178
5234
  function _M0FP36kazuph5reviw6server18read__file__buffer(_tmp) {
5179
- return readFileSync$1988(_tmp);
5235
+ return readFileSync$2011(_tmp);
5180
5236
  }
5181
5237
  function _M0FP36kazuph5reviw6server12decode__file(path, override_enc) {
5182
5238
  const buf = _M0FP36kazuph5reviw6server18read__file__buffer(path);
@@ -5218,19 +5274,19 @@ function _M0FP36kazuph5reviw6server22load__and__build__html(ctx) {
5218
5274
  return _M0FP36kazuph5reviw4core16build__csv__html(data, ctx.filename, ctx.port);
5219
5275
  }
5220
5276
  function _M0FP36kazuph5reviw6server14path__basename(_tmp) {
5221
- return basename$2015(_tmp);
5277
+ return basename$2044(_tmp);
5222
5278
  }
5223
5279
  function _M0FP36kazuph5reviw6server13path__resolve(_tmp) {
5224
- return resolve$2017(_tmp);
5280
+ return resolve$2046(_tmp);
5225
5281
  }
5226
5282
  function _M0FP36kazuph5reviw6server25http__create__server__raw(_tmp) {
5227
- return createServer$2022(_tmp);
5283
+ return createServer$2051(_tmp);
5228
5284
  }
5229
5285
  function _M0FP36kazuph5reviw6server14create__server(handler) {
5230
5286
  return _M0FP36kazuph5reviw6server25http__create__server__raw(handler);
5231
5287
  }
5232
5288
  function _M0FP36kazuph5reviw6server22write__file__sync__buf(_tmp, _tmp$2) {
5233
- return writeFileSync$1996(_tmp, _tmp$2);
5289
+ return writeFileSync$2019(_tmp, _tmp$2);
5234
5290
  }
5235
5291
  function _M0FP36kazuph5reviw6server16base64__to__file(data, dir, index) {
5236
5292
  const ext = _M0FP36kazuph5reviw6server20extract__base64__ext(data);
@@ -5264,7 +5320,7 @@ function _M0FP36kazuph5reviw6server20ensure__history__dir() {
5264
5320
  }
5265
5321
  }
5266
5322
  function _M0FP36kazuph5reviw6server20crypto__create__hash(_tmp) {
5267
- return createHash$2039(_tmp);
5323
+ return createHash$2066(_tmp);
5268
5324
  }
5269
5325
  function _M0FP36kazuph5reviw6server14crypto__sha256(s) {
5270
5326
  return _M0FP36kazuph5reviw6server27hash__update__digest__hex16(_M0FP36kazuph5reviw6server20crypto__create__hash("sha256"), s);
@@ -5273,9 +5329,6 @@ function _M0FP36kazuph5reviw6server13history__path(file_path) {
5273
5329
  const hash = _M0FP36kazuph5reviw6server14crypto__sha256(_M0FP36kazuph5reviw6server13path__resolve(file_path));
5274
5330
  return _M0FP36kazuph5reviw6server10path__join(_M0FP36kazuph5reviw6server12history__dir(), `${hash}.json`);
5275
5331
  }
5276
- function _M0FP36kazuph5reviw6server16read__file__safe(path) {
5277
- return _M0FP36kazuph5reviw6server17try__call__string(() => _M0FP36kazuph5reviw6server16read__file__sync(path, "utf-8"), "");
5278
- }
5279
5332
  function _M0FP36kazuph5reviw6server17trim__json__array(json, max_entries) {
5280
5333
  const chars = _M0MP311moonbitlang4core6string6String9to__array(json);
5281
5334
  const len = chars.length;
@@ -5326,7 +5379,7 @@ function _M0FP36kazuph5reviw6server13save__history(file_path, entry_json) {
5326
5379
  _M0FP36kazuph5reviw6server11chmod__sync(hp, 384);
5327
5380
  }
5328
5381
  function _M0FP36kazuph5reviw6server13unwatch__file(_tmp) {
5329
- return unwatchFile$2045(_tmp);
5382
+ return unwatchFile$2072(_tmp);
5330
5383
  }
5331
5384
  function _M0FP36kazuph5reviw6server14handle__submit(ctx, body) {
5332
5385
  const summary = _M0FP36kazuph5reviw6server19json__parse__string("summary", body);
@@ -5426,7 +5479,7 @@ function _M0FP36kazuph5reviw6server14handle__submit(ctx, body) {
5426
5479
  }
5427
5480
  }
5428
5481
  function _M0FP36kazuph5reviw6server17child__exec__sync(_tmp, _tmp$2) {
5429
- return execSync$2052(_tmp, _tmp$2);
5482
+ return execSync$2079(_tmp, _tmp$2);
5430
5483
  }
5431
5484
  function _M0FP36kazuph5reviw6server15command__exists(cmd) {
5432
5485
  return _M0FP36kazuph5reviw6server15try__call__bool(() => {
@@ -5479,28 +5532,25 @@ function _M0FP36kazuph5reviw6server19json__encode__value(s) {
5479
5532
  return buf.val;
5480
5533
  }
5481
5534
  function _M0FP36kazuph5reviw6server17fs__mkdtemp__sync(_tmp) {
5482
- return mkdtempSync$2056(_tmp);
5535
+ return mkdtempSync$2083(_tmp);
5483
5536
  }
5484
5537
  function _M0FP36kazuph5reviw6server10os__tmpdir() {
5485
- return tmpdir$2057();
5538
+ return tmpdir$2084();
5486
5539
  }
5487
5540
  function _M0FP36kazuph5reviw6server15make__temp__dir() {
5488
5541
  return _M0FP36kazuph5reviw6server17fs__mkdtemp__sync(`${_M0FP36kazuph5reviw6server10os__tmpdir()}/reviw-`);
5489
5542
  }
5490
- function _M0FP36kazuph5reviw6server13path__dirname(_tmp) {
5491
- return dirname$2065(_tmp);
5492
- }
5493
5543
  function _M0FP36kazuph5reviw6server18read__file__base64(path) {
5494
5544
  return _M0FP36kazuph5reviw6server17try__call__string(() => _M0FP36kazuph5reviw6server15buf__to__base64(_M0FP36kazuph5reviw6server18read__file__buffer(path)), "");
5495
5545
  }
5496
5546
  function _M0FP36kazuph5reviw6server22fs__readdir__sync__raw(_tmp) {
5497
- return readdirSync$2068(_tmp);
5547
+ return readdirSync$2094(_tmp);
5498
5548
  }
5499
5549
  function _M0FP36kazuph5reviw6server13readdir__sync(path) {
5500
5550
  return _M0FP36kazuph5reviw6server24try__call__array__string(() => _M0FP36kazuph5reviw6server22fs__readdir__sync__raw(path));
5501
5551
  }
5502
5552
  function _M0FP36kazuph5reviw6server12fs__rm__sync(_tmp, _tmp$2) {
5503
- return rmSync$2077(_tmp, _tmp$2);
5553
+ return rmSync$2103(_tmp, _tmp$2);
5504
5554
  }
5505
5555
  function _M0FP36kazuph5reviw6server18rm__dir__recursive(path) {
5506
5556
  _M0FP36kazuph5reviw6server15try__call__void(() => {
@@ -5508,13 +5558,13 @@ function _M0FP36kazuph5reviw6server18rm__dir__recursive(path) {
5508
5558
  });
5509
5559
  }
5510
5560
  function _M0FP36kazuph5reviw6server12child__spawn(_tmp, _tmp$2, _tmp$3) {
5511
- return spawn$2082(_tmp, _tmp$2, _tmp$3);
5561
+ return spawn$2109(_tmp, _tmp$2, _tmp$3);
5512
5562
  }
5513
5563
  function _M0FP36kazuph5reviw6server12spawn__async(cmd, args_json) {
5514
5564
  return _M0FP36kazuph5reviw6server12child__spawn(cmd, _M0FP36kazuph5reviw6server15js__parse__json(args_json), _M0FP36kazuph5reviw6server21js__spawn__opts__pipe());
5515
5565
  }
5516
5566
  function _M0FP36kazuph5reviw6server18child__spawn__sync(_tmp, _tmp$2, _tmp$3) {
5517
- return spawnSync$2087(_tmp, _tmp$2, _tmp$3);
5567
+ return spawnSync$2114(_tmp, _tmp$2, _tmp$3);
5518
5568
  }
5519
5569
  function _M0FP36kazuph5reviw6server19spawn__sync__stdout(cmd, args_json) {
5520
5570
  return _M0FP36kazuph5reviw6server17try__call__string(() => _M0FP36kazuph5reviw6server15js__obj__stdout(_M0FP36kazuph5reviw6server18child__spawn__sync(cmd, _M0FP36kazuph5reviw6server15js__parse__json(args_json), _M0FP36kazuph5reviw6server27js__spawn__opts__utf8__pipe())), "");
@@ -5522,7 +5572,7 @@ function _M0FP36kazuph5reviw6server19spawn__sync__stdout(cmd, args_json) {
5522
5572
  function _M0FP36kazuph5reviw6server23handle__video__timeline(ctx, url, res) {
5523
5573
  const video_path = _M0FP36kazuph5reviw6server19parse__query__param(url, "path");
5524
5574
  const scene_str = _M0FP36kazuph5reviw6server19parse__query__param(url, "scene");
5525
- if (_M0MP311moonbitlang4core6string6String8contains(video_path, { str: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c458, start: 0, end: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c458.length })) {
5575
+ if (_M0MP311moonbitlang4core6string6String8contains(video_path, { str: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c479, start: 0, end: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c479.length })) {
5526
5576
  _M0FP36kazuph5reviw6server16res__write__head(res, 400, "text/plain");
5527
5577
  _M0FP36kazuph5reviw6server8res__end(res, "Invalid path");
5528
5578
  return undefined;
@@ -5557,22 +5607,18 @@ function _M0FP36kazuph5reviw6server23handle__video__timeline(ctx, url, res) {
5557
5607
  }
5558
5608
  const scene_threshold = scene_str.length > 0 ? scene_str : "0.01";
5559
5609
  const ffmpeg_proc = _M0FP36kazuph5reviw6server12spawn__async("ffmpeg", `[\"-i\", ${_M0FP36kazuph5reviw6server19json__encode__value(resolved_video)}, \"-vf\", \"select='gt(scene,${scene_threshold})',showinfo,scale=160:-1\", \"-vsync\", \"vfr\", \"-q:v\", \"5\", ${_M0FP36kazuph5reviw6server19json__encode__value(_M0FP36kazuph5reviw6server10path__join(tmp_dir, "scene_%04d.jpg"))}]`);
5560
- const scene_index = _M0MP311moonbitlang4core3ref3Ref3newGiE(1);
5561
- _M0FP36kazuph5reviw6server16on__spawn__close(ffmpeg_proc, (_code) => {
5610
+ _M0FP36kazuph5reviw6server30on__spawn__close__with__stderr(ffmpeg_proc, (_code, stderr) => {
5611
+ const timestamps = _M0FP36kazuph5reviw6server27parse__showinfo__timestamps(stderr);
5562
5612
  const files = _M0FP36kazuph5reviw6server13readdir__sync(tmp_dir);
5613
+ const scene_files = [];
5563
5614
  const _len = files.length;
5564
5615
  let _tmp = 0;
5565
5616
  while (true) {
5566
5617
  const _i = _tmp;
5567
5618
  if (_i < _len) {
5568
5619
  const file = files[_i];
5569
- if (_M0MP311moonbitlang4core6string6String11has__prefix(file, { str: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c461, start: 0, end: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c461.length }) && _M0MP311moonbitlang4core6string6String11has__suffix(file, { str: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c462, start: 0, end: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c462.length })) {
5570
- const fpath = _M0FP36kazuph5reviw6server10path__join(tmp_dir, file);
5571
- const b64 = _M0FP36kazuph5reviw6server18read__file__base64(fpath);
5572
- if (b64.length > 0) {
5573
- _M0FP36kazuph5reviw6server9sse__send(res, "message", `{\"type\":\"thumbnail\",\"time\":${_M0MP311moonbitlang4core3int3Int18to__string_2einner(scene_index.val, 10)},\"index\":${_M0MP311moonbitlang4core3int3Int18to__string_2einner(scene_index.val, 10)},\"data\":\"data:image/jpeg;base64,${b64}\"}`);
5574
- scene_index.val = scene_index.val + 1 | 0;
5575
- }
5620
+ if (_M0MP311moonbitlang4core6string6String11has__prefix(file, { str: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c482, start: 0, end: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c482.length }) && _M0MP311moonbitlang4core6string6String11has__suffix(file, { str: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c483, start: 0, end: _M0FP36kazuph5reviw6server39handle__video__timeline_2e_2abind_7c483.length })) {
5621
+ _M0MP311moonbitlang4core5array5Array4pushGsE(scene_files, file);
5576
5622
  }
5577
5623
  _tmp = _i + 1 | 0;
5578
5624
  continue;
@@ -5580,7 +5626,28 @@ function _M0FP36kazuph5reviw6server23handle__video__timeline(ctx, url, res) {
5580
5626
  break;
5581
5627
  }
5582
5628
  }
5583
- _M0FP36kazuph5reviw6server9sse__send(res, "message", `{\"type\":\"complete\",\"total\":${_M0MP311moonbitlang4core3int3Int18to__string_2einner(scene_index.val, 10)}}`);
5629
+ const sorted_files = _M0FP36kazuph5reviw6server13sort__strings(scene_files);
5630
+ let scene_idx = 0;
5631
+ const _len$2 = sorted_files.length;
5632
+ let _tmp$2 = 0;
5633
+ while (true) {
5634
+ const _i = _tmp$2;
5635
+ if (_i < _len$2) {
5636
+ const file = sorted_files[_i];
5637
+ const fpath = _M0FP36kazuph5reviw6server10path__join(tmp_dir, file);
5638
+ const b64 = _M0FP36kazuph5reviw6server18read__file__base64(fpath);
5639
+ if (b64.length > 0) {
5640
+ const time_val = scene_idx < timestamps.length ? _M0MP311moonbitlang4core5array5Array2atGdE(timestamps, scene_idx) : (scene_idx + 1 | 0) + 0;
5641
+ _M0FP36kazuph5reviw6server9sse__send(res, "message", `{\"type\":\"thumbnail\",\"time\":${_M0MP311moonbitlang4core6double6Double10to__string(time_val)},\"index\":${_M0MP311moonbitlang4core3int3Int18to__string_2einner(scene_idx + 1 | 0, 10)},\"data\":\"data:image/jpeg;base64,${b64}\"}`);
5642
+ scene_idx = scene_idx + 1 | 0;
5643
+ }
5644
+ _tmp$2 = _i + 1 | 0;
5645
+ continue;
5646
+ } else {
5647
+ break;
5648
+ }
5649
+ }
5650
+ _M0FP36kazuph5reviw6server9sse__send(res, "message", `{\"type\":\"complete\",\"total\":${_M0MP311moonbitlang4core3int3Int18to__string_2einner(scene_idx, 10)}}`);
5584
5651
  _M0FP36kazuph5reviw6server8res__end(res, "");
5585
5652
  _M0FP36kazuph5reviw6server18rm__dir__recursive(tmp_dir);
5586
5653
  });
@@ -5711,13 +5778,13 @@ function _M0FP36kazuph5reviw6server9index__of(s, target) {
5711
5778
  return -1;
5712
5779
  }
5713
5780
  function _M0FP36kazuph5reviw6server14fs__stat__sync(_tmp) {
5714
- return statSync$2101(_tmp);
5781
+ return statSync$2129(_tmp);
5715
5782
  }
5716
5783
  function _M0FP36kazuph5reviw6server14is__file__sync(path) {
5717
5784
  return _M0FP36kazuph5reviw6server18js__stat__is__file(_M0FP36kazuph5reviw6server14fs__stat__sync(path));
5718
5785
  }
5719
5786
  function _M0FP36kazuph5reviw6server30fs__create__read__stream__opts(_tmp, _tmp$2) {
5720
- return createReadStream$2105(_tmp, _tmp$2);
5787
+ return createReadStream$2133(_tmp, _tmp$2);
5721
5788
  }
5722
5789
  function _M0FP36kazuph5reviw6server17pipe__file__range(file_path, res, content_type, range_header) {
5723
5790
  const stat = _M0FP36kazuph5reviw6server14fs__stat__sync(file_path);
@@ -5732,7 +5799,7 @@ function _M0FP36kazuph5reviw6server17pipe__file__range(file_path, res, content_t
5732
5799
  _M0FP36kazuph5reviw6server8js__pipe(stream, res);
5733
5800
  }
5734
5801
  function _M0FP36kazuph5reviw6server24fs__create__read__stream(_tmp) {
5735
- return createReadStream$2105(_tmp);
5802
+ return createReadStream$2133(_tmp);
5736
5803
  }
5737
5804
  function _M0FP36kazuph5reviw6server24pipe__file__to__response(file_path, res, content_type) {
5738
5805
  const stat = _M0FP36kazuph5reviw6server14fs__stat__sync(file_path);
@@ -5745,8 +5812,8 @@ function _M0FP36kazuph5reviw6server24pipe__file__to__response(file_path, res, co
5745
5812
  function _M0FP36kazuph5reviw6server19serve__static__file(ctx, url, req, res) {
5746
5813
  const qmark = _M0FP36kazuph5reviw6server9index__of(url, 63);
5747
5814
  const url_path = qmark >= 0 ? _M0FP36kazuph5reviw4core18safe__slice__range(url, 0, qmark) : url;
5748
- const relative_path = _M0MP311moonbitlang4core6string6String11has__prefix(url_path, { str: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c489, start: 0, end: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c489.length }) ? _M0FP36kazuph5reviw4core11safe__slice(url_path, 1) : url_path;
5749
- if (_M0MP311moonbitlang4core6string6String8contains(relative_path, { str: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c487, start: 0, end: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c487.length })) {
5815
+ const relative_path = _M0MP311moonbitlang4core6string6String11has__prefix(url_path, { str: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c512, start: 0, end: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c512.length }) ? _M0FP36kazuph5reviw4core11safe__slice(url_path, 1) : url_path;
5816
+ if (_M0MP311moonbitlang4core6string6String8contains(relative_path, { str: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c510, start: 0, end: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c510.length })) {
5750
5817
  _M0FP36kazuph5reviw6server16res__write__head(res, 403, "text/plain");
5751
5818
  _M0FP36kazuph5reviw6server8res__end(res, "Forbidden");
5752
5819
  return undefined;
@@ -5763,7 +5830,7 @@ function _M0FP36kazuph5reviw6server19serve__static__file(ctx, url, req, res) {
5763
5830
  if (_M0FP36kazuph5reviw6server12exists__sync(resolved_static) && _M0FP36kazuph5reviw6server14is__file__sync(resolved_static)) {
5764
5831
  const ext = _M0MP311moonbitlang4core6string6String9to__lower(_M0FP36kazuph5reviw6server13path__extname(resolved_static));
5765
5832
  const content_type = _M0FP36kazuph5reviw6server15get__mime__type(ext);
5766
- const is_video = _M0MP311moonbitlang4core6string6String11has__prefix(content_type, { str: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c488, start: 0, end: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c488.length });
5833
+ const is_video = _M0MP311moonbitlang4core6string6String11has__prefix(content_type, { str: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c511, start: 0, end: _M0FP36kazuph5reviw6server35serve__static__file_2e_2abind_7c511.length });
5767
5834
  const range = _M0FP36kazuph5reviw6server18req__range__header(req);
5768
5835
  if (is_video && range.length > 0) {
5769
5836
  _M0FP36kazuph5reviw6server17pipe__file__range(resolved_static, res, content_type, range);
@@ -5781,8 +5848,8 @@ function _M0FP36kazuph5reviw6server19serve__static__file(ctx, url, req, res) {
5781
5848
  function _M0FP36kazuph5reviw6server25serve__static__file__head(ctx, url, res) {
5782
5849
  const qmark = _M0FP36kazuph5reviw6server9index__of(url, 63);
5783
5850
  const url_path = qmark >= 0 ? _M0FP36kazuph5reviw4core18safe__slice__range(url, 0, qmark) : url;
5784
- const relative_path = _M0MP311moonbitlang4core6string6String11has__prefix(url_path, { str: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c491, start: 0, end: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c491.length }) ? _M0FP36kazuph5reviw4core11safe__slice(url_path, 1) : url_path;
5785
- if (_M0MP311moonbitlang4core6string6String8contains(relative_path, { str: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c490, start: 0, end: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c490.length })) {
5851
+ const relative_path = _M0MP311moonbitlang4core6string6String11has__prefix(url_path, { str: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c514, start: 0, end: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c514.length }) ? _M0FP36kazuph5reviw4core11safe__slice(url_path, 1) : url_path;
5852
+ if (_M0MP311moonbitlang4core6string6String8contains(relative_path, { str: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c513, start: 0, end: _M0FP36kazuph5reviw6server41serve__static__file__head_2e_2abind_7c513.length })) {
5786
5853
  _M0FP36kazuph5reviw6server16res__write__head(res, 403, "text/plain");
5787
5854
  _M0FP36kazuph5reviw6server8res__end(res, "");
5788
5855
  return undefined;
@@ -5843,7 +5910,7 @@ function _M0FP36kazuph5reviw6server15handle__request(ctx, req, res) {
5843
5910
  _M0FP36kazuph5reviw6server8res__end(res, history_json);
5844
5911
  return;
5845
5912
  } else {
5846
- if (http_method === "GET" && _M0MP311moonbitlang4core6string6String11has__prefix(url, { str: _M0FP36kazuph5reviw6server31handle__request_2e_2abind_7c492, start: 0, end: _M0FP36kazuph5reviw6server31handle__request_2e_2abind_7c492.length })) {
5913
+ if (http_method === "GET" && _M0MP311moonbitlang4core6string6String11has__prefix(url, { str: _M0FP36kazuph5reviw6server31handle__request_2e_2abind_7c515, start: 0, end: _M0FP36kazuph5reviw6server31handle__request_2e_2abind_7c515.length })) {
5847
5914
  _M0FP36kazuph5reviw6server23handle__video__timeline(ctx, url, res);
5848
5915
  return;
5849
5916
  } else {
@@ -5914,13 +5981,13 @@ function _M0FP36kazuph5reviw6server28try__activate__existing__tab(url) {
5914
5981
  }
5915
5982
  const chrome_script = `set found to false\ntell application \"System Events\"\n if exists process \"Google Chrome\" then\n tell application \"Google Chrome\"\n set targetUrl to \"${url}\"\n repeat with w in windows\n set tabIndex to 1\n repeat with t in tabs of w\n if URL of t starts with targetUrl then\n set active tab index of w to tabIndex\n set index of w to 1\n activate\n set found to true\n exit repeat\n end if\n set tabIndex to tabIndex + 1\n end repeat\n if found then exit repeat\n end repeat\n end tell\n end if\nend tell\nfound`;
5916
5983
  const chrome_result = _M0FP36kazuph5reviw6server19spawn__sync__result("osascript", `[\"-e\", ${_M0FP36kazuph5reviw6server19json__encode__value(chrome_script)}]`);
5917
- if (_M0MP311moonbitlang4core6string6String8contains(chrome_result, { str: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c493, start: 0, end: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c493.length })) {
5984
+ if (_M0MP311moonbitlang4core6string6String8contains(chrome_result, { str: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c516, start: 0, end: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c516.length })) {
5918
5985
  _M0FP36kazuph5reviw6server12console__log(`Activated existing Chrome tab: ${url}`);
5919
5986
  return true;
5920
5987
  }
5921
5988
  const safari_script = `set found to false\ntell application \"System Events\"\n if exists process \"Safari\" then\n tell application \"Safari\"\n set targetUrl to \"${url}\"\n repeat with w in windows\n repeat with t in tabs of w\n if URL of t starts with targetUrl then\n set current tab of w to t\n set index of w to 1\n activate\n set found to true\n exit repeat\n end if\n end repeat\n if found then exit repeat\n end repeat\n end tell\n end if\nend tell\nfound`;
5922
5989
  const safari_result = _M0FP36kazuph5reviw6server19spawn__sync__result("osascript", `[\"-e\", ${_M0FP36kazuph5reviw6server19json__encode__value(safari_script)}]`);
5923
- if (_M0MP311moonbitlang4core6string6String8contains(safari_result, { str: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c494, start: 0, end: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c494.length })) {
5990
+ if (_M0MP311moonbitlang4core6string6String8contains(safari_result, { str: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c517, start: 0, end: _M0FP36kazuph5reviw6server44try__activate__existing__tab_2e_2abind_7c517.length })) {
5924
5991
  _M0FP36kazuph5reviw6server12console__log(`Activated existing Safari tab: ${url}`);
5925
5992
  return true;
5926
5993
  }
@@ -5996,7 +6063,7 @@ function _M0FP36kazuph5reviw6server19start__http__server(ctx, no_open) {
5996
6063
  _M0FP36kazuph5reviw6server11try__listen(ctx, ctx.port, 0, no_open);
5997
6064
  }
5998
6065
  function _M0FP36kazuph5reviw6server11watch__file(_tmp, _tmp$2) {
5999
- return watchFile$2141(_tmp, _tmp$2);
6066
+ return watchFile$2169(_tmp, _tmp$2);
6000
6067
  }
6001
6068
  function _M0FP36kazuph5reviw6server19start__file__server(file_path, port, no_open) {
6002
6069
  const resolved = _M0FP36kazuph5reviw6server13path__resolve(file_path);
@@ -6039,11 +6106,11 @@ function _M0FP36kazuph5reviw6server20start__stdin__server(content, port, no_open
6039
6106
  (() => {
6040
6107
  const argv = _M0FP36kazuph5reviw6server9get__argv();
6041
6108
  const args = [];
6042
- const _end388 = argv.length;
6109
+ const _end406 = argv.length;
6043
6110
  let _tmp = 2;
6044
6111
  while (true) {
6045
6112
  const i = _tmp;
6046
- if (i < _end388) {
6113
+ if (i < _end406) {
6047
6114
  _M0MP311moonbitlang4core5array5Array4pushGsE(args, _M0MP311moonbitlang4core5array5Array2atGsE(argv, i));
6048
6115
  _tmp = i + 1 | 0;
6049
6116
  continue;
@@ -6063,7 +6130,8 @@ function _M0FP36kazuph5reviw6server20start__stdin__server(content, port, no_open
6063
6130
  _M0FP36kazuph5reviw6server13process__exit(0);
6064
6131
  } else {
6065
6132
  if (arg === "--version" || arg === "-v") {
6066
- _M0FP36kazuph5reviw6server12console__log("reviw 2.0.0 (moonbit)");
6133
+ const ver = _M0FP36kazuph5reviw6server21get__package__version();
6134
+ _M0FP36kazuph5reviw6server12console__log(`reviw ${ver} (moonbit)`);
6067
6135
  _M0FP36kazuph5reviw6server13process__exit(0);
6068
6136
  } else {
6069
6137
  if (arg === "--port") {
@@ -6081,7 +6149,7 @@ function _M0FP36kazuph5reviw6server20start__stdin__server(content, port, no_open
6081
6149
  _M0FP36kazuph5reviw6server18encoding__override.val = _M0MP311moonbitlang4core5array5Array2atGsE(args, i);
6082
6150
  }
6083
6151
  } else {
6084
- if (!_M0MP311moonbitlang4core6string6String11has__prefix(arg, { str: _M0FP36kazuph5reviw6server26_2ainit_2a_2e_2abind_7c504, start: 0, end: _M0FP36kazuph5reviw6server26_2ainit_2a_2e_2abind_7c504.length })) {
6152
+ if (!_M0MP311moonbitlang4core6string6String11has__prefix(arg, { str: _M0FP36kazuph5reviw6server26_2ainit_2a_2e_2abind_7c527, start: 0, end: _M0FP36kazuph5reviw6server26_2ainit_2a_2e_2abind_7c527.length })) {
6085
6153
  _M0MP311moonbitlang4core5array5Array4pushGsE(files, arg);
6086
6154
  }
6087
6155
  }
package/dist/ui/ui.js CHANGED
@@ -436,7 +436,7 @@ const _M0FP36kazuph5reviw2ui40setup__preview__mouseup_2e_2abind_7c1628 = "\n";
436
436
  const _M0FP36kazuph5reviw2ui40build__heading__anchors_2e_2abind_7c1641 = "#";
437
437
  const _M0FP36kazuph5reviw2ui23heading__anchors__cache = [];
438
438
  const _M0FP36kazuph5reviw2ui39toggle__history__panel_2e_2abind_7c1673 = "open";
439
- const _M0FP36kazuph5reviw2ui39default__toggle__config_2erecord_2f1101 = { start_level: 2, end_level: 6, initially_open: true, animate: true };
439
+ const _M0FP36kazuph5reviw2ui39default__toggle__config_2erecord_2f1108 = { start_level: 2, end_level: 6, initially_open: true, animate: true };
440
440
  const _M0FP36kazuph5reviw2ui14fs__image__zpv = _M0MP311moonbitlang4core3ref3Ref3newGORP36kazuph5reviw2ui8ZPVStateE(undefined);
441
441
  const _M0FP36kazuph5reviw2ui21current__image__index = _M0MP311moonbitlang4core3ref3Ref3newGiE(-1);
442
442
  const _M0FP36kazuph5reviw2ui20current__video__path = _M0MP311moonbitlang4core3ref3Ref3newGsE("");
@@ -452,16 +452,16 @@ const _M0FP36kazuph5reviw2ui23current__comment__image = _M0MP311moonbitlang4core
452
452
  const _M0FP36kazuph5reviw2ui15active__toggles = _M0MP311moonbitlang4core3ref3Ref3newGRP311moonbitlang4core7builtin5ArrayGRP36kazuph5reviw2ui13HeadingToggleEE([]);
453
453
  const _M0FP311moonbitlang4core7builtin33brute__force__find_2econstr_2f261 = 0;
454
454
  const _M0FP311moonbitlang4core7builtin43boyer__moore__horspool__find_2econstr_2f247 = 0;
455
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f980 = { _0: "少なめ", _1: 0.3 };
456
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f981 = { _0: "やや少", _1: 0.1 };
457
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f982 = { _0: "標準", _1: 0.01 };
458
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f983 = { _0: "やや多", _1: 0.005 };
459
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f984 = { _0: "多め", _1: 0.001 };
460
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f985 = { _0: "弱め", _1: 0.5 };
461
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f986 = { _0: "やや弱", _1: 0.2 };
462
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f987 = { _0: "標準", _1: 0.1 };
463
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f988 = { _0: "やや強", _1: 0.05 };
464
- const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f989 = { _0: "強め", _1: 0.02 };
455
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f987 = { _0: "少なめ", _1: 0.3 };
456
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f988 = { _0: "やや少", _1: 0.1 };
457
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f989 = { _0: "標準", _1: 0.01 };
458
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f990 = { _0: "やや多", _1: 0.005 };
459
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f991 = { _0: "多め", _1: 0.001 };
460
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f992 = { _0: "弱め", _1: 0.5 };
461
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f993 = { _0: "やや弱", _1: 0.2 };
462
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f994 = { _0: "標準", _1: 0.1 };
463
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f995 = { _0: "やや強", _1: 0.05 };
464
+ const _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f996 = { _0: "強め", _1: 0.02 };
465
465
  const _M0FP36kazuph5reviw2ui15global__sidebar = _M0MP311moonbitlang4core3ref3Ref3newGORP36kazuph5reviw2ui17MediaSidebarStateE(undefined);
466
466
  const _M0FP36kazuph5reviw2ui20scroll__active__pane = _M0MP311moonbitlang4core3ref3Ref3newGsE("");
467
467
  const _M0FP36kazuph5reviw2ui29scroll__sync__disabled__until = _M0MP311moonbitlang4core3ref3Ref3newGdE(0);
@@ -471,7 +471,7 @@ const _M0FP36kazuph5reviw2ui12is__dragging = _M0MP311moonbitlang4core3ref3Ref3ne
471
471
  const _M0FP36kazuph5reviw2ui16drag__start__row = _M0MP311moonbitlang4core3ref3Ref3newGiE(-1);
472
472
  const _M0FP36kazuph5reviw2ui14drag__end__row = _M0MP311moonbitlang4core3ref3Ref3newGiE(-1);
473
473
  const _M0FP36kazuph5reviw2ui16fs__mermaid__zpv = _M0MP311moonbitlang4core3ref3Ref3newGORP36kazuph5reviw2ui8ZPVStateE(undefined);
474
- const _M0FP36kazuph5reviw2ui39find__code__block__range_2etuple_2f1414 = { _0: -1, _1: -1 };
474
+ const _M0FP36kazuph5reviw2ui39find__code__block__range_2etuple_2f1421 = { _0: -1, _1: -1 };
475
475
  function _M0FP311moonbitlang4core5abort5abortGsE(msg) {
476
476
  return $panic();
477
477
  }
@@ -3066,8 +3066,41 @@ function _M0FP36kazuph5reviw2ui15is__video__type(type_) {
3066
3066
  return false;
3067
3067
  }
3068
3068
  }
3069
+ function _M0FP36kazuph5reviw2ui40render__image__viewer_2einit__zpv_7c1189(_env) {
3070
+ const wrapper = _env._5;
3071
+ const zoom_info = _env._4;
3072
+ const viewport = _env._3;
3073
+ const zpv_ref = _env._2;
3074
+ const img = _env._1;
3075
+ const state = _env._0;
3076
+ const nw = _M0FP36kazuph5reviw2ui19get__natural__width(img);
3077
+ const nh = _M0FP36kazuph5reviw2ui20get__natural__height(img);
3078
+ if (nw <= 0 || nh <= 0) {
3079
+ return undefined;
3080
+ }
3081
+ const _p = zpv_ref.val;
3082
+ if (!(_p === undefined)) {
3083
+ const _p$2 = zpv_ref.val;
3084
+ let _tmp;
3085
+ if (_p$2 === undefined) {
3086
+ _tmp = $panic();
3087
+ } else {
3088
+ const _p$3 = _p$2;
3089
+ _tmp = _p$3;
3090
+ }
3091
+ _M0FP36kazuph5reviw2ui26destroy__zoom__pan__viewer(_tmp);
3092
+ }
3093
+ _M0FP36kazuph5reviw2ui10set__style(img, "width", `${_M0MP311moonbitlang4core6double6Double10to__string(nw)}px`);
3094
+ _M0FP36kazuph5reviw2ui10set__style(img, "height", `${_M0MP311moonbitlang4core6double6Double10to__string(nh)}px`);
3095
+ const zpv = _M0FP36kazuph5reviw2ui34create__zoom__pan__viewer__moonbit(viewport, wrapper, nw, nh, zoom_info, false, _M0FP36kazuph5reviw2ui13null__element(), 184, 134, 8, 0.1, 20, true);
3096
+ zpv_ref.val = zpv;
3097
+ state.current_zpv = zpv_ref.val;
3098
+ _M0FP36kazuph5reviw2ui17fit__to__viewport(zpv);
3099
+ _M0FP36kazuph5reviw2ui10set__style(wrapper, "visibility", "visible");
3100
+ }
3069
3101
  function _M0FP36kazuph5reviw2ui21render__image__viewer(state, content, item) {
3070
3102
  const viewport = _M0FP36kazuph5reviw2ui15create__element("div");
3103
+ _M0FP36kazuph5reviw2ui10set__style(viewport, "width", "100%");
3071
3104
  _M0FP36kazuph5reviw2ui10set__style(viewport, "height", "calc(100vh - 140px)");
3072
3105
  _M0FP36kazuph5reviw2ui10set__style(viewport, "overflow", "hidden");
3073
3106
  _M0FP36kazuph5reviw2ui10set__style(viewport, "position", "relative");
@@ -3090,43 +3123,23 @@ function _M0FP36kazuph5reviw2ui21render__image__viewer(state, content, item) {
3090
3123
  _M0FP36kazuph5reviw2ui13append__child(content, viewport);
3091
3124
  _M0FP36kazuph5reviw2ui10set__style(wrapper, "visibility", "hidden");
3092
3125
  const zpv_ref = { val: undefined };
3093
- const init_zpv = () => {
3094
- const nw = _M0FP36kazuph5reviw2ui19get__natural__width(img);
3095
- const nh = _M0FP36kazuph5reviw2ui20get__natural__height(img);
3096
- if (nw <= 0 || nh <= 0) {
3097
- return undefined;
3098
- }
3099
- const _p = zpv_ref.val;
3100
- if (!(_p === undefined)) {
3101
- const _p$2 = zpv_ref.val;
3102
- let _tmp;
3103
- if (_p$2 === undefined) {
3104
- _tmp = $panic();
3105
- } else {
3106
- const _p$3 = _p$2;
3107
- _tmp = _p$3;
3108
- }
3109
- _M0FP36kazuph5reviw2ui26destroy__zoom__pan__viewer(_tmp);
3110
- }
3111
- _M0FP36kazuph5reviw2ui10set__style(img, "width", `${_M0MP311moonbitlang4core6double6Double10to__string(nw)}px`);
3112
- _M0FP36kazuph5reviw2ui10set__style(img, "height", `${_M0MP311moonbitlang4core6double6Double10to__string(nh)}px`);
3113
- const zpv = _M0FP36kazuph5reviw2ui34create__zoom__pan__viewer__moonbit(viewport, wrapper, nw, nh, zoom_info, false, _M0FP36kazuph5reviw2ui13null__element(), 184, 134, 8, 0.1, 20, true);
3114
- zpv_ref.val = zpv;
3115
- state.current_zpv = zpv_ref.val;
3116
- _M0FP36kazuph5reviw2ui17fit__to__viewport(zpv);
3117
- _M0FP36kazuph5reviw2ui10set__style(wrapper, "visibility", "visible");
3118
- };
3126
+ const _env = { _0: state, _1: img, _2: zpv_ref, _3: viewport, _4: zoom_info, _5: wrapper };
3119
3127
  const h = _M0FP36kazuph5reviw2ui24on__with__handle_2einner(img, "load", (e) => {
3120
3128
  if (_M0FP36kazuph5reviw2ui18get__client__width(viewport) > 100) {
3121
- init_zpv();
3129
+ _M0FP36kazuph5reviw2ui40render__image__viewer_2einit__zpv_7c1189(_env);
3122
3130
  return;
3123
3131
  } else {
3132
+ _M0FP36kazuph5reviw2ui12set__timeout(() => {
3133
+ _M0FP36kazuph5reviw2ui40render__image__viewer_2einit__zpv_7c1189(_env);
3134
+ }, 500);
3124
3135
  return;
3125
3136
  }
3126
3137
  }, false, true);
3127
3138
  _M0MP311moonbitlang4core5array5Array4pushGRP36kazuph5reviw2ui14ListenerHandleE(state.handles, h);
3128
3139
  if (_M0FP36kazuph5reviw2ui19get__natural__width(img) > 0) {
3129
- state.pending_fit = init_zpv;
3140
+ _M0FP36kazuph5reviw2ui12set__timeout(() => {
3141
+ _M0FP36kazuph5reviw2ui40render__image__viewer_2einit__zpv_7c1189(_env);
3142
+ }, 500);
3130
3143
  }
3131
3144
  state.current_cleanup = () => {
3132
3145
  const _p = zpv_ref.val;
@@ -3343,8 +3356,8 @@ function _M0FP36kazuph5reviw2ui21render__video__viewer(state, content, item) {
3343
3356
  const scene_title = _M0FP36kazuph5reviw2ui15create__element("h4");
3344
3357
  _M0FP36kazuph5reviw2ui18set__text__content(scene_title, "Scene Sensitivity");
3345
3358
  _M0FP36kazuph5reviw2ui13append__child(settings_panel, scene_title);
3346
- const scene_levels = [_M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f980, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f981, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f982, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f983, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f984];
3347
- const stab_levels = [_M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f985, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f986, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f987, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f988, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f989];
3359
+ const scene_levels = [_M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f987, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f988, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f989, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f990, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f991];
3360
+ const stab_levels = [_M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f992, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f993, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f994, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f995, _M0FP36kazuph5reviw2ui35render__video__viewer_2etuple_2f996];
3348
3361
  const cur_scene = { val: 0.01 };
3349
3362
  const cur_stab = { val: 0.1 };
3350
3363
  const on_scene_change = (new_val) => {
@@ -3993,7 +4006,7 @@ function _M0FP36kazuph5reviw2ui24setup__heading__observer() {
3993
4006
  function _M0FP36kazuph5reviw2ui22init__heading__toggles(config) {
3994
4007
  let cfg;
3995
4008
  if (config === undefined) {
3996
- cfg = _M0FP36kazuph5reviw2ui39default__toggle__config_2erecord_2f1101;
4009
+ cfg = _M0FP36kazuph5reviw2ui39default__toggle__config_2erecord_2f1108;
3997
4010
  } else {
3998
4011
  const _Some = config;
3999
4012
  cfg = _Some;
@@ -5179,7 +5192,7 @@ function _M0FP36kazuph5reviw2ui24find__code__block__range(code_text) {
5179
5192
  break;
5180
5193
  }
5181
5194
  }
5182
- return _M0FP36kazuph5reviw2ui39find__code__block__range_2etuple_2f1414;
5195
+ return _M0FP36kazuph5reviw2ui39find__code__block__range_2etuple_2f1421;
5183
5196
  }
5184
5197
  function _M0FP36kazuph5reviw2ui17extract__filename(path) {
5185
5198
  const chars = _M0MP311moonbitlang4core6string6String9to__array(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reviw",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Lightweight file reviewer with in-browser comments for CSV, TSV, Markdown, and Git diffs.",
5
5
  "type": "module",
6
6
  "bin": {