@youtyan/code-viewer 0.9.1 → 0.10.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.
package/web/index.html CHANGED
@@ -30,6 +30,11 @@
30
30
  <a class="app-menu-item" data-route="history" href="/history">History</a>
31
31
  <a class="app-menu-item" data-route="journal" href="/journal">Work Log</a>
32
32
  <a class="app-menu-item" data-route="database" href="/database">Datastores</a>
33
+ <!-- Tools は画面遷移ではなくドロワーの開閉なので、リンクではなくボタン。
34
+ data-route はラベルのローカライズにだけ使う (SPA ナビの走査は
35
+ a.app-menu-item に限定してあるのでここは拾われない)。 -->
36
+ <button type="button" id="tools-btn" class="app-menu-item app-menu-action" data-route="tools" aria-pressed="false">Tools</button>
37
+ <a class="app-menu-item" data-route="help" href="/help">Help</a>
33
38
  </nav>
34
39
  <div class="global-actions">
35
40
  <button id="annotations-toggle" class="global-icon-action" title="code annotations" aria-label="code annotations"><span class="goi-icon" aria-hidden="true"></span><span id="annotations-count" hidden></span></button>
@@ -45,7 +50,6 @@
45
50
  <span id="status" class="status" role="status" aria-live="polite"><span class="status-label"></span></span>
46
51
  <a id="repo-web-link" class="global-icon-link" href="#" target="_blank" rel="noopener" hidden><span class="goi-icon" aria-hidden="true"></span></a>
47
52
  <button id="quick-help-btn" class="global-icon-action" title="quick help (shortcuts)" aria-label="quick help (shortcuts)"><span class="goi-icon" aria-hidden="true"></span></button>
48
- <a class="global-icon-link" data-route="help" href="/help"><span class="goi-icon" aria-hidden="true"></span></a>
49
53
  </div>
50
54
  </header>
51
55
  <header id="topbar">
@@ -191,7 +195,7 @@
191
195
  </label>
192
196
  <p id="datastore-s3-tooltip-help" class="scope-settings-help"></p>
193
197
  </div>
194
- <div class="scope-settings-section">
198
+ <div id="watch-settings-section" class="scope-settings-section">
195
199
  <strong id="watch-section-title" class="scope-settings-section-title">File change watcher</strong>
196
200
  <label for="scope-watch-limit">Maximum directories to watch</label>
197
201
  <div class="scope-watch-limit-row">
@@ -273,6 +277,8 @@
273
277
 
274
278
  <div id="doctor-sheet-overlay" class="doctor-sheet-overlay" hidden aria-hidden="true"></div>
275
279
  <aside id="doctor-sheet" class="doctor-sheet" hidden aria-hidden="true" inert aria-label="environment doctor"></aside>
280
+ <div id="tools-sheet-overlay" class="tools-sheet-overlay" hidden aria-hidden="true"></div>
281
+ <aside id="tools-sheet" class="tools-sheet" hidden aria-hidden="true" inert aria-label="tools"></aside>
276
282
  <main id="content">
277
283
  <section id="history-commit-info" hidden></section>
278
284
  <div id="empty" class="empty hidden">
package/web/style.css CHANGED
@@ -478,6 +478,14 @@ body[data-code-font-size="xlarge"] {
478
478
  color: var(--accent);
479
479
  font-weight: 600;
480
480
  }
481
+ /* メニューの中で唯一「画面遷移ではなく開閉」をする項目 (Tools)。見た目は
482
+ リンクの項目と揃えたいので、button 由来の既定値だけ打ち消す。 */
483
+ .app-menu-action {
484
+ font-family: inherit;
485
+ border: 0;
486
+ cursor: pointer;
487
+ background: transparent;
488
+ }
481
489
 
482
490
  .global-actions {
483
491
  position: relative;
@@ -13521,6 +13529,326 @@ body.db-resizing {
13521
13529
  background: var(--attn, #9a6700);
13522
13530
  }
13523
13531
 
13532
+ /* ===== Tools sheet (right-side drawer) =====
13533
+ 開閉の作りは doctor sheet と同じ (hidden でも display を残したまま
13534
+ transform でスライドさせ、閉じている間は inert で無効化する)。違いは
13535
+ 中身が入力 / 出力の 2 ペインなので、ドロワーを大きく取る点。 */
13536
+ .tools-sheet {
13537
+ position: fixed;
13538
+ /* グローバルヘッダは隠さない。ドロワーを開いたままメニューを切り替えたり、
13539
+ Tools をもう一度押して閉じたりできるようにする。 */
13540
+ top: var(--global-header-h);
13541
+ right: 0;
13542
+ bottom: 0;
13543
+ /* 既定幅。左端のハンドルでドラッグすると --tools-sheet-width が入る。
13544
+ 画面に収める上限はここで掛けるので、記憶した幅は狭いウィンドウで開いても
13545
+ 縮まない (広い画面に戻せばそのまま復元される)。 */
13546
+ width: min(var(--tools-sheet-width, 1180px), 96vw);
13547
+ max-width: 100vw;
13548
+ background: var(--bg, #fff);
13549
+ border-left: 1px solid var(--border, #d0d7de);
13550
+ box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
13551
+ z-index: 60;
13552
+ display: flex;
13553
+ flex-direction: column;
13554
+ min-height: 0;
13555
+ box-sizing: border-box;
13556
+ transform: translateX(100%);
13557
+ transition: transform 200ms ease;
13558
+ }
13559
+ .tools-sheet:not([hidden]) {
13560
+ transform: translateX(0);
13561
+ }
13562
+ .tools-sheet[hidden] {
13563
+ display: flex;
13564
+ pointer-events: none;
13565
+ }
13566
+ .tools-sheet-overlay {
13567
+ position: fixed;
13568
+ inset: var(--global-header-h) 0 0 0;
13569
+ background: rgba(0, 0, 0, 0.28);
13570
+ z-index: 55;
13571
+ opacity: 0;
13572
+ transition: opacity 200ms ease;
13573
+ pointer-events: none;
13574
+ }
13575
+ .tools-sheet-overlay:not([hidden]) {
13576
+ opacity: 1;
13577
+ pointer-events: auto;
13578
+ }
13579
+ .tools-sheet-overlay[hidden] {
13580
+ display: block;
13581
+ opacity: 0;
13582
+ pointer-events: none;
13583
+ }
13584
+ /* ドロワー左端の掴みしろ。annotation パネルのリサイザーと同じ作り (境界を
13585
+ またぐ 8px の透明な帯) だが、ドロワーが画面の大半を覆って端が分かりにくい
13586
+ ので、掴める位置を示すグリップを常時出す。 */
13587
+ .tools-sheet-resizer {
13588
+ position: absolute;
13589
+ left: -4px;
13590
+ top: 0;
13591
+ bottom: 0;
13592
+ width: 8px;
13593
+ cursor: col-resize;
13594
+ touch-action: none;
13595
+ z-index: 1;
13596
+ }
13597
+ .tools-sheet-resizer::before {
13598
+ content: "";
13599
+ position: absolute;
13600
+ left: 2px;
13601
+ top: 50%;
13602
+ width: 4px;
13603
+ height: 48px;
13604
+ transform: translateY(-50%);
13605
+ border-radius: 2px;
13606
+ background: var(--fg-muted, #57606a);
13607
+ opacity: 0.45;
13608
+ }
13609
+ .tools-sheet-resizer:hover,
13610
+ .tools-sheet-resizing .tools-sheet-resizer {
13611
+ background: var(--accent-muted, rgba(9, 105, 218, 0.2));
13612
+ }
13613
+ .tools-sheet-resizer:hover::before,
13614
+ .tools-sheet-resizing .tools-sheet-resizer::before {
13615
+ background: var(--accent, #0969da);
13616
+ opacity: 1;
13617
+ }
13618
+ .tools-sheet-resizer:focus-visible {
13619
+ outline: 2px solid var(--accent, #0969da);
13620
+ outline-offset: -2px;
13621
+ }
13622
+ /* ドラッグ中はスライドのトランジションを切る (追従が遅れて見えるため)。 */
13623
+ .tools-sheet-resizing {
13624
+ transition: none;
13625
+ }
13626
+ .tools-header {
13627
+ display: flex;
13628
+ align-items: center;
13629
+ gap: 12px;
13630
+ flex: 0 0 auto;
13631
+ padding: 12px 16px;
13632
+ border-bottom: 1px solid var(--border, #d0d7de);
13633
+ }
13634
+ .tools-header h1 {
13635
+ font-size: 16px;
13636
+ margin: 0;
13637
+ }
13638
+ .tools-tabs {
13639
+ margin-left: 4px;
13640
+ }
13641
+ .tools-close {
13642
+ font: inherit;
13643
+ font-size: 18px;
13644
+ line-height: 1;
13645
+ width: 28px;
13646
+ height: 28px;
13647
+ margin-left: auto;
13648
+ border-radius: 6px;
13649
+ border: 1px solid transparent;
13650
+ background: transparent;
13651
+ color: var(--fg-muted, #57606a);
13652
+ cursor: pointer;
13653
+ }
13654
+ .tools-close:hover {
13655
+ background: var(--bg-mute, #eaeef2);
13656
+ color: var(--fg, #1f2328);
13657
+ }
13658
+ .tools-body {
13659
+ flex: 1 1 auto;
13660
+ min-height: 0;
13661
+ }
13662
+ .tools-pane {
13663
+ display: grid;
13664
+ grid-template-columns: var(--tools-input-width, 1fr) 6px minmax(0, 1fr);
13665
+ height: 100%;
13666
+ min-height: 0;
13667
+ }
13668
+ .tools-pane[hidden] {
13669
+ display: none;
13670
+ }
13671
+ .tools-pane-side {
13672
+ display: flex;
13673
+ flex-direction: column;
13674
+ min-width: 0;
13675
+ min-height: 0;
13676
+ }
13677
+ .tools-pane-output {
13678
+ border-left: 1px solid var(--border, #d0d7de);
13679
+ }
13680
+ .tools-pane-head {
13681
+ display: flex;
13682
+ align-items: center;
13683
+ gap: 8px;
13684
+ flex: 0 0 auto;
13685
+ padding: 6px 12px;
13686
+ border-bottom: 1px solid var(--border, #d0d7de);
13687
+ background: var(--bg-soft, #f6f8fa);
13688
+ }
13689
+ .tools-pane-title {
13690
+ font-size: 11px;
13691
+ font-weight: 600;
13692
+ text-transform: uppercase;
13693
+ letter-spacing: 0.04em;
13694
+ color: var(--fg-muted, #57606a);
13695
+ }
13696
+ .tools-pane-actions {
13697
+ display: flex;
13698
+ align-items: center;
13699
+ gap: 6px;
13700
+ margin-left: auto;
13701
+ }
13702
+ .tools-pane-action {
13703
+ font: inherit;
13704
+ font-size: 12px;
13705
+ line-height: 20px;
13706
+ height: 24px;
13707
+ min-width: 32px;
13708
+ padding: 0 8px;
13709
+ border-radius: 6px;
13710
+ border: 1px solid var(--border, #d0d7de);
13711
+ background: var(--bg, #fff);
13712
+ color: var(--fg);
13713
+ cursor: pointer;
13714
+ }
13715
+ /* 入力側ヘッダは clear ボタンが直下に 1 つだけなので、それを右端に寄せる。
13716
+ 出力側はボタン群を .tools-pane-actions がまとめて右に送る。 */
13717
+ .tools-pane-head > .tools-pane-action {
13718
+ margin-left: auto;
13719
+ }
13720
+ .tools-pane-action:hover:not([disabled]) {
13721
+ background: var(--bg-mute, #eaeef2);
13722
+ }
13723
+ .tools-pane-action.active {
13724
+ background: var(--bg-mute, #eaeef2);
13725
+ border-color: var(--accent, #0969da);
13726
+ }
13727
+ .tools-pane-action[disabled] {
13728
+ opacity: 0.5;
13729
+ cursor: default;
13730
+ }
13731
+ /* 幅を固定しておかないと、文言が出た瞬間に隣のボタンがずれる。 */
13732
+ .tools-pane-status {
13733
+ flex: 0 0 auto;
13734
+ width: 168px;
13735
+ text-align: right;
13736
+ font-size: 11px;
13737
+ color: var(--fg-muted, #57606a);
13738
+ overflow: hidden;
13739
+ text-overflow: ellipsis;
13740
+ white-space: nowrap;
13741
+ }
13742
+ .tools-pane-status-error {
13743
+ color: var(--danger, #cf222e);
13744
+ }
13745
+ .tools-textarea {
13746
+ flex: 1 1 auto;
13747
+ min-height: 0;
13748
+ width: 100%;
13749
+ box-sizing: border-box;
13750
+ resize: none;
13751
+ border: 0;
13752
+ outline: none;
13753
+ padding: 12px;
13754
+ background: var(--bg, #fff);
13755
+ color: var(--fg);
13756
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
13757
+ monospace;
13758
+ font-size: 12px;
13759
+ line-height: 1.6;
13760
+ tab-size: 2;
13761
+ }
13762
+ .tools-pane-body {
13763
+ flex: 1 1 auto;
13764
+ min-height: 0;
13765
+ overflow: auto;
13766
+ padding: 12px 16px;
13767
+ }
13768
+ .tools-pane-empty,
13769
+ .tools-pane-error {
13770
+ margin: 0;
13771
+ padding: 24px 8px;
13772
+ font-size: 13px;
13773
+ color: var(--fg-muted, #57606a);
13774
+ }
13775
+ .tools-pane-error {
13776
+ color: var(--danger, #cf222e);
13777
+ white-space: pre-wrap;
13778
+ }
13779
+ /* 解釈はできたが注意点がある場合 (YAML の警告)。出力の上に添える。 */
13780
+ .tools-pane-warning {
13781
+ margin: 0 0 12px 0;
13782
+ padding: 8px 10px;
13783
+ border-radius: 6px;
13784
+ background: var(--bg-mute, #eaeef2);
13785
+ color: var(--attn, #9a6700);
13786
+ font-size: 12px;
13787
+ white-space: pre-wrap;
13788
+ }
13789
+ .tools-pane-resizer {
13790
+ cursor: col-resize;
13791
+ background: var(--border, #d0d7de);
13792
+ opacity: 0.35;
13793
+ }
13794
+ .tools-pane-resizer:hover,
13795
+ .tools-pane-resizing .tools-pane-resizer {
13796
+ opacity: 1;
13797
+ background: var(--accent, #0969da);
13798
+ }
13799
+ .tools-pane-resizer:focus-visible {
13800
+ outline: 2px solid var(--accent, #0969da);
13801
+ outline-offset: -2px;
13802
+ }
13803
+ .tools-code {
13804
+ margin: 0;
13805
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
13806
+ monospace;
13807
+ font-size: 12px;
13808
+ line-height: 1.6;
13809
+ white-space: pre;
13810
+ tab-size: 2;
13811
+ }
13812
+ /* 出力ペインはファイル閲覧時より狭いので、markdown の 280px 固定 TOC を
13813
+ 横に置くと本文が潰れる。ここでは目次を本文の上に積む。 */
13814
+ .tools-pane-markdown .gdp-markdown-layout {
13815
+ display: block;
13816
+ }
13817
+ .tools-pane-markdown .gdp-markdown-toc {
13818
+ position: static;
13819
+ max-height: 220px;
13820
+ padding: 0 0 10px 0;
13821
+ margin-bottom: 12px;
13822
+ border-right: 0;
13823
+ border-bottom: 1px solid var(--border);
13824
+ }
13825
+ /* shiki が `<span style="--shiki-light:#xxx;--shiki-dark:#yyy">` の inline
13826
+ CSS 変数で token ごとの色を出すので、light/dark 用にそれぞれ参照する。
13827
+ db-session-log-sql と同じスキーム。 */
13828
+ .tools-code span[style] {
13829
+ color: var(--shiki-light);
13830
+ }
13831
+ @media (prefers-color-scheme: dark) {
13832
+ .tools-code span[style] {
13833
+ color: var(--shiki-dark);
13834
+ }
13835
+ }
13836
+ html[data-theme="dark"] .tools-code span[style] {
13837
+ color: var(--shiki-dark);
13838
+ }
13839
+ .tools-mermaid-container {
13840
+ width: 100%;
13841
+ height: 100%;
13842
+ overflow: auto;
13843
+ }
13844
+ .tools-mermaid-canvas {
13845
+ display: inline-block;
13846
+ min-width: min-content;
13847
+ }
13848
+ .tools-pane-mermaid .tools-pane-body {
13849
+ padding: 8px;
13850
+ }
13851
+
13524
13852
  /* ==========================================================================
13525
13853
  Datastore page — premium glass theme
13526
13854
  データストアページ (.db-root) 全体にスコープした装飾レイヤ。
@@ -216,6 +216,7 @@ Package Summary
216
216
  | vscode-languageserver-types | 3.17.5 | MIT | https://github.com/Microsoft/vscode-languageserver-node.git |
217
217
  | vscode-uri | 3.1.0 | MIT | https://github.com/microsoft/vscode-uri#readme |
218
218
  | xtend | 4.0.2 | MIT | https://github.com/Raynos/xtend |
219
+ | yaml | 2.9.0 | ISC | https://eemeli.org/yaml/ |
219
220
  | zwitch | 2.0.4 | MIT | wooorm/zwitch |
220
221
 
221
222
  License Texts
@@ -8788,6 +8789,29 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
8788
8789
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
8789
8790
  THE SOFTWARE.
8790
8791
 
8792
+ yaml@2.9.0
8793
+ ----------
8794
+
8795
+ License metadata: ISC
8796
+ Source: https://eemeli.org/yaml/
8797
+ Package metadata: node_modules/yaml/package.json
8798
+
8799
+ File: node_modules/yaml/LICENSE
8800
+
8801
+ Copyright Eemeli Aro <eemeli@gmail.com>
8802
+
8803
+ Permission to use, copy, modify, and/or distribute this software for any purpose
8804
+ with or without fee is hereby granted, provided that the above copyright notice
8805
+ and this permission notice appear in all copies.
8806
+
8807
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8808
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
8809
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
8810
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
8811
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
8812
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
8813
+ THIS SOFTWARE.
8814
+
8791
8815
  zwitch@2.0.4
8792
8816
  ------------
8793
8817