vimd 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,11 +85,12 @@ html, body {
85
85
  min-height: 35px;
86
86
  }
87
87
 
88
+ /* Header title (VSCode-style) */
88
89
  .vimd-folder-name {
89
90
  font-size: 11px;
90
- font-weight: 600;
91
+ font-weight: 400;
91
92
  text-transform: uppercase;
92
- letter-spacing: 0.5px;
93
+ letter-spacing: 0.04em;
93
94
  color: var(--sidebar-text-muted);
94
95
  overflow: hidden;
95
96
  text-overflow: ellipsis;
@@ -76,6 +76,10 @@ export declare class FolderModeServer {
76
76
  * Escape HTML special characters
77
77
  */
78
78
  private escapeHtml;
79
+ /**
80
+ * Wrap file tree with root folder for VSCode-style explorer UI
81
+ */
82
+ private getWrappedTree;
79
83
  /**
80
84
  * Count total files in tree
81
85
  */
@@ -1 +1 @@
1
- {"version":3,"file":"folder-mode-server.d.ts","sourceRoot":"","sources":["../../../src/core/folder-mode/folder-mode-server.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EAEd,MAAM,YAAY,CAAC;AAKpB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB;AAUD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,OAAO,CAA0C;IACzD,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,YAAY,CAAuB;gBAE/B,OAAO,EAAE,iBAAiB;IAMtC;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAuEzC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B3B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuCxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;YACW,gBAAgB;IAuF9B;;OAEG;YACW,WAAW;IASzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAoBpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IASvC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;OAEG;YACW,cAAc;IAkC5B;;OAEG;IACH,OAAO,CAAC,UAAU;IASlB;;OAEG;IACH,OAAO,CAAC,UAAU;CAWnB"}
1
+ {"version":3,"file":"folder-mode-server.d.ts","sourceRoot":"","sources":["../../../src/core/folder-mode/folder-mode-server.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EAEd,MAAM,YAAY,CAAC;AAKpB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB;AAUD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,OAAO,CAA0C;IACzD,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,YAAY,CAAuB;gBAE/B,OAAO,EAAE,iBAAiB;IAMtC;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAuEzC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B3B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuCxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;YACW,gBAAgB;IAuF9B;;OAEG;YACW,WAAW;IASzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAoBpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IASvC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;OAEG;YACW,cAAc;IAkC5B;;OAEG;IACH,OAAO,CAAC,UAAU;IASlB;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB;;OAEG;IACH,OAAO,CAAC,UAAU;CAWnB"}
@@ -58,10 +58,10 @@ export class FolderModeServer {
58
58
  this.renderedHtml = await this.renderTemplate();
59
59
  // Create polka app
60
60
  const app = polka();
61
- // API: Get file tree
61
+ // API: Get file tree (wrapped with root folder)
62
62
  app.get('/api/tree', (_req, res) => {
63
63
  res.writeHead(200, { 'Content-Type': 'application/json' });
64
- res.end(JSON.stringify(this.fileTree));
64
+ res.end(JSON.stringify(this.getWrappedTree()));
65
65
  });
66
66
  // Serve folder mode HTML for all routes (SPA style)
67
67
  app.get('*', (req, res) => {
@@ -135,8 +135,8 @@ export class FolderModeServer {
135
135
  // Initialize client state
136
136
  this.clients.set(ws, { currentFile: null, watcher: null });
137
137
  Logger.info(`WebSocket client connected (${this.clients.size} total)`);
138
- // Send file tree on connection
139
- this.sendMessage(ws, { type: 'tree', data: this.fileTree });
138
+ // Send file tree on connection (wrapped with root folder)
139
+ this.sendMessage(ws, { type: 'tree', data: this.getWrappedTree() });
140
140
  // Handle messages from client
141
141
  ws.on('message', (data) => {
142
142
  try {
@@ -357,6 +357,20 @@ export class FolderModeServer {
357
357
  .replace(/"/g, '"')
358
358
  .replace(/'/g, ''');
359
359
  }
360
+ /**
361
+ * Wrap file tree with root folder for VSCode-style explorer UI
362
+ */
363
+ getWrappedTree() {
364
+ const folderName = path.basename(this.options.rootPath);
365
+ return [
366
+ {
367
+ type: 'folder',
368
+ name: folderName,
369
+ path: '',
370
+ children: this.fileTree,
371
+ },
372
+ ];
373
+ }
360
374
  /**
361
375
  * Count total files in tree
362
376
  */
@@ -52,7 +52,7 @@
52
52
  <!-- Sidebar -->
53
53
  <aside class="vimd-sidebar" id="sidebar">
54
54
  <div class="vimd-sidebar-header">
55
- <span class="vimd-folder-name">{{folder_name}}</span>
55
+ <span class="vimd-folder-name">エクスプローラー</span>
56
56
  <button class="vimd-toggle-btn" id="toggle-btn" title="Close Sidebar (Ctrl+B)">
57
57
  <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
58
58
  <path d="M10 2L6 8L10 14" stroke="currentColor" stroke-width="1.5" fill="none"/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vimd",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Real-time Markdown preview tool with pandoc (view markdown)",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -52,7 +52,7 @@
52
52
  <!-- Sidebar -->
53
53
  <aside class="vimd-sidebar" id="sidebar">
54
54
  <div class="vimd-sidebar-header">
55
- <span class="vimd-folder-name">{{folder_name}}</span>
55
+ <span class="vimd-folder-name">エクスプローラー</span>
56
56
  <button class="vimd-toggle-btn" id="toggle-btn" title="Close Sidebar (Ctrl+B)">
57
57
  <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
58
58
  <path d="M10 2L6 8L10 14" stroke="currentColor" stroke-width="1.5" fill="none"/>