gopeak 2.3.6 → 2.3.8

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.
@@ -526,10 +526,10 @@ export function buildCategoryList() {
526
526
  const item = document.createElement('div');
527
527
  item.className = 'cat-item' + (activeCategories.has(cat.id) ? '' : ' inactive');
528
528
  item.dataset.catId = cat.id;
529
- item.innerHTML = `
530
- <div class="cat-dot" style="background:${cat.color}"></div>
531
- <span class="cat-label">${cat.label}</span>
532
- <span class="cat-count">${cat.count}</span>
529
+ item.innerHTML = `
530
+ <div class="cat-dot" style="background:${cat.color}"></div>
531
+ <span class="cat-label">${cat.label}</span>
532
+ <span class="cat-count">${cat.count}</span>
533
533
  `;
534
534
  item.addEventListener('click', () => {
535
535
  toggleCategory(cat.id);
@@ -756,21 +756,21 @@ function startInlineRename(screenX, screenY, node, scenePath) {
756
756
  input.id = 'inline-rename-input';
757
757
  input.type = 'text';
758
758
  input.value = node.name;
759
- input.style.cssText = `
760
- position: fixed;
761
- left: ${screenX - 50}px;
762
- top: ${screenY - 12}px;
763
- width: 120px;
764
- padding: 4px 8px;
765
- font-size: 12px;
766
- font-family: -apple-system, system-ui, sans-serif;
767
- font-weight: 600;
768
- background: #0f1014;
769
- border: 2px solid #7aa2f7;
770
- border-radius: 4px;
771
- color: #f0f0f5;
772
- z-index: 1000;
773
- outline: none;
759
+ input.style.cssText = `
760
+ position: fixed;
761
+ left: ${screenX - 50}px;
762
+ top: ${screenY - 12}px;
763
+ width: 120px;
764
+ padding: 4px 8px;
765
+ font-size: 12px;
766
+ font-family: -apple-system, system-ui, sans-serif;
767
+ font-weight: 600;
768
+ background: #0f1014;
769
+ border: 2px solid #7aa2f7;
770
+ border-radius: 4px;
771
+ color: #f0f0f5;
772
+ z-index: 1000;
773
+ outline: none;
774
774
  `;
775
775
  document.body.appendChild(input);
776
776
  input.focus();
@@ -318,24 +318,24 @@ window.toggleFunc = function (fi) {
318
318
  if (!f.body)
319
319
  return;
320
320
  const editorId = `code-editor-${fi}`;
321
- viewer.innerHTML = `
322
- <div class="func-viewer-header">
323
- <span><span class="func-title">${esc(f.name)}</span> · <span id="line-count-${fi}">${f.body.split('\n').length}</span> lines</span>
324
- <button class="func-viewer-close" onclick="toggleFunc(${fi})">&times;</button>
325
- </div>
326
- <div class="func-viewer-code">
327
- <div class="code-editor-container" id="${editorId}">
328
- <div class="code-editor-highlight" id="highlight-${fi}"></div>
329
- <textarea class="code-editor-textarea" id="textarea-${fi}" spellcheck="false"></textarea>
330
- </div>
331
- </div>
332
- <div class="func-viewer-footer">
333
- <span class="status" id="status-${fi}">Modified</span>
334
- <span style="display:flex;gap:8px;align-items:center">
335
- <span style="opacity:0.6">Ctrl+S to save</span>
336
- <button class="save-btn" id="save-btn-${fi}" onclick="saveFunction(${fi})">Save</button>
337
- </span>
338
- </div>
321
+ viewer.innerHTML = `
322
+ <div class="func-viewer-header">
323
+ <span><span class="func-title">${esc(f.name)}</span> · <span id="line-count-${fi}">${f.body.split('\n').length}</span> lines</span>
324
+ <button class="func-viewer-close" onclick="toggleFunc(${fi})">&times;</button>
325
+ </div>
326
+ <div class="func-viewer-code">
327
+ <div class="code-editor-container" id="${editorId}">
328
+ <div class="code-editor-highlight" id="highlight-${fi}"></div>
329
+ <textarea class="code-editor-textarea" id="textarea-${fi}" spellcheck="false"></textarea>
330
+ </div>
331
+ </div>
332
+ <div class="func-viewer-footer">
333
+ <span class="status" id="status-${fi}">Modified</span>
334
+ <span style="display:flex;gap:8px;align-items:center">
335
+ <span style="opacity:0.6">Ctrl+S to save</span>
336
+ <button class="save-btn" id="save-btn-${fi}" onclick="saveFunction(${fi})">Save</button>
337
+ </span>
338
+ </div>
339
339
  `;
340
340
  const textarea = document.getElementById(`textarea-${fi}`);
341
341
  const highlight = document.getElementById(`highlight-${fi}`);
@@ -848,9 +848,9 @@ function renderPropertyRow(prop, scenePath, nodePath) {
848
848
  switch (type) {
849
849
  case 1: { // TYPE_BOOL
850
850
  const boolChecked = value === true ? 'checked' : '';
851
- html += `<label class="toggle-switch">
852
- <input type="checkbox" ${boolChecked} data-prop="${esc(name)}" data-type="${type}">
853
- <span class="toggle-slider"></span>
851
+ html += `<label class="toggle-switch">
852
+ <input type="checkbox" ${boolChecked} data-prop="${esc(name)}" data-type="${type}">
853
+ <span class="toggle-slider"></span>
854
854
  </label>`;
855
855
  break;
856
856
  }
@@ -925,18 +925,18 @@ function renderRangeSlider(name, type, value, hintString, isInt) {
925
925
  const min = parseFloat(parts[0]) || 0;
926
926
  const max = parseFloat(parts[1]) || 100;
927
927
  const step = parts[2] ? parseFloat(parts[2]) : (isInt ? 1 : 0.01);
928
- return `<div class="range-input-group">
929
- <input type="range" class="property-range" value="${value ?? min}" min="${min}" max="${max}" step="${step}" data-prop="${esc(name)}" data-type="${type}">
930
- <input type="number" class="property-input range-number" value="${value ?? min}" min="${min}" max="${max}" step="${step}" data-prop="${esc(name)}" data-type="${type}">
928
+ return `<div class="range-input-group">
929
+ <input type="range" class="property-range" value="${value ?? min}" min="${min}" max="${max}" step="${step}" data-prop="${esc(name)}" data-type="${type}">
930
+ <input type="number" class="property-input range-number" value="${value ?? min}" min="${min}" max="${max}" step="${step}" data-prop="${esc(name)}" data-type="${type}">
931
931
  </div>`;
932
932
  }
933
933
  function renderVector2Input(name, type, value, isInt = false) {
934
934
  const x = value?.x ?? 0;
935
935
  const y = value?.y ?? 0;
936
936
  const step = isInt ? '1' : '0.01';
937
- return `<div class="vector-input-group" data-prop="${esc(name)}" data-type="${type}">
938
- <label>x</label><input type="number" class="property-input vec-x" value="${x}" step="${step}" data-component="x">
939
- <label>y</label><input type="number" class="property-input vec-y" value="${y}" step="${step}" data-component="y">
937
+ return `<div class="vector-input-group" data-prop="${esc(name)}" data-type="${type}">
938
+ <label>x</label><input type="number" class="property-input vec-x" value="${x}" step="${step}" data-component="x">
939
+ <label>y</label><input type="number" class="property-input vec-y" value="${y}" step="${step}" data-component="y">
940
940
  </div>`;
941
941
  }
942
942
  function renderVector3Input(name, type, value, isInt = false) {
@@ -944,10 +944,10 @@ function renderVector3Input(name, type, value, isInt = false) {
944
944
  const y = value?.y ?? 0;
945
945
  const z = value?.z ?? 0;
946
946
  const step = isInt ? '1' : '0.01';
947
- return `<div class="vector-input-group vec3" data-prop="${esc(name)}" data-type="${type}">
948
- <label>x</label><input type="number" class="property-input vec-x" value="${x}" step="${step}" data-component="x">
949
- <label>y</label><input type="number" class="property-input vec-y" value="${y}" step="${step}" data-component="y">
950
- <label>z</label><input type="number" class="property-input vec-z" value="${z}" step="${step}" data-component="z">
947
+ return `<div class="vector-input-group vec3" data-prop="${esc(name)}" data-type="${type}">
948
+ <label>x</label><input type="number" class="property-input vec-x" value="${x}" step="${step}" data-component="x">
949
+ <label>y</label><input type="number" class="property-input vec-y" value="${y}" step="${step}" data-component="y">
950
+ <label>z</label><input type="number" class="property-input vec-z" value="${z}" step="${step}" data-component="z">
951
951
  </div>`;
952
952
  }
953
953
  function renderColorInput(name, type, value) {
@@ -956,9 +956,9 @@ function renderColorInput(name, type, value) {
956
956
  const b = Math.round((value?.b ?? 1) * 255);
957
957
  const a = value?.a ?? 1;
958
958
  const hex = `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
959
- return `<div class="color-input-group" data-prop="${esc(name)}" data-type="${type}">
960
- <input type="color" class="property-color" value="${hex}" data-prop="${esc(name)}">
961
- <input type="number" class="property-input color-alpha" value="${a}" min="0" max="1" step="0.01" placeholder="α" data-component="a">
959
+ return `<div class="color-input-group" data-prop="${esc(name)}" data-type="${type}">
960
+ <input type="color" class="property-color" value="${hex}" data-prop="${esc(name)}">
961
+ <input type="number" class="property-input color-alpha" value="${a}" min="0" max="1" step="0.01" placeholder="α" data-component="a">
962
962
  </div>`;
963
963
  }
964
964
  function initPropertyEditing(scenePath, nodePath) {
@@ -59,20 +59,20 @@ function renderUsagePanel() {
59
59
  listEl.innerHTML = currentUsages.map((u, i) => {
60
60
  const highlightedCode = highlightUsageInCode(u.code, itemName);
61
61
  const fileName = u.file.split('/').pop().replace('.gd', '');
62
- return `
63
- <div class="ufp-item"
64
- data-usage-index="${i}"
65
- data-file="${u.file}"
66
- data-line="${u.line}"
67
- data-func="${u.funcName || ''}"
68
- onclick="navigateToUsage(this)">
69
- <div class="ufp-loc">
70
- <span class="ufp-func">${u.funcName || 'unknown'}</span>
71
- <span class="ufp-line">line ${u.line}</span>
72
- </div>
73
- <div class="ufp-code">${highlightedCode}</div>
74
- <div class="ufp-file">${fileName}.gd</div>
75
- </div>
62
+ return `
63
+ <div class="ufp-item"
64
+ data-usage-index="${i}"
65
+ data-file="${u.file}"
66
+ data-line="${u.line}"
67
+ data-func="${u.funcName || ''}"
68
+ onclick="navigateToUsage(this)">
69
+ <div class="ufp-loc">
70
+ <span class="ufp-func">${u.funcName || 'unknown'}</span>
71
+ <span class="ufp-line">line ${u.line}</span>
72
+ </div>
73
+ <div class="ufp-code">${highlightedCode}</div>
74
+ <div class="ufp-file">${fileName}.gd</div>
75
+ </div>
76
76
  `;
77
77
  }).join('');
78
78
  deleteBtn.textContent = 'Delete Anyway';
@@ -8,17 +8,17 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
8
  let wss = null;
9
9
  let currentProjectPath = null;
10
10
  let currentBridge = null;
11
- const DEFAULT_VISUALIZER_HTML = `<!doctype html>
12
- <html lang="en">
13
- <head>
14
- <meta charset="utf-8" />
15
- <meta name="viewport" content="width=device-width, initial-scale=1" />
16
- <title>Godot MCP Visualizer</title>
17
- </head>
18
- <body>
19
- <h1>Godot MCP Visualizer</h1>
20
- <p>Run the map_project tool to load visualization data.</p>
21
- </body>
11
+ const DEFAULT_VISUALIZER_HTML = `<!doctype html>
12
+ <html lang="en">
13
+ <head>
14
+ <meta charset="utf-8" />
15
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
16
+ <title>Godot MCP Visualizer</title>
17
+ </head>
18
+ <body>
19
+ <h1>Godot MCP Visualizer</h1>
20
+ <p>Run the map_project tool to load visualization data.</p>
21
+ </body>
22
22
  </html>`;
23
23
  const handleVisualizerConnectionRef = (socket) => {
24
24
  handleVisualizerConnection(socket);