react-godot-shader-preview 0.5.8 → 0.6.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.
@@ -41,7 +41,6 @@
41
41
  position: relative;
42
42
  overflow: hidden;
43
43
  border: 1px solid var(--rgs-b);
44
- border-radius: 6px;
45
44
  background: #000;
46
45
  aspect-ratio: 1;
47
46
  height: 100%;
package/dist/style.css CHANGED
@@ -41,7 +41,6 @@
41
41
  position: relative;
42
42
  overflow: hidden;
43
43
  border: 1px solid var(--rgs-b);
44
- border-radius: 6px;
45
44
  background: #000;
46
45
  aspect-ratio: 1;
47
46
  height: 100%;
package/godot/index.html CHANGED
@@ -11,7 +11,7 @@
11
11
  h1 { margin: 0 0 16px 0; font-size: 1.5rem; color: #c6c6c6; }
12
12
  .viewer-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; min-height: 400px; }
13
13
  .viewer-code { flex: 1; min-width: 0; display: flex; flex-direction: column; }
14
- .viewer-code .code-wrap { flex: 1; min-height: 360px; position: relative; border: 1px solid #444; border-radius: 6px; overflow: hidden; background: #1a1a1a; }
14
+ .viewer-code .code-wrap { flex: 1; min-height: 360px; position: relative; border: 1px solid #444; overflow: hidden; background: #1a1a1a; }
15
15
  .code-wrap textarea { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 12px 14px; resize: none; border: none; background: transparent; color: transparent; caret-color: #c6c6c6; font: 14px/1.5 'Consolas', 'Monaco', monospace; outline: none; z-index: 2; }
16
16
  .code-wrap pre { margin: 0; padding: 12px 14px; overflow: auto; font: 14px/1.5 'Consolas', 'Monaco', monospace; white-space: pre; word-wrap: normal; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: transparent; color: #c6c6c6; }
17
17
  .code-wrap pre code { font: inherit; background: transparent; }
@@ -38,13 +38,12 @@
38
38
  .validation-bar.has-error .validation-message { color: #e07c6e; }
39
39
  .validation-bar .validation-meta { display: flex; align-items: center; gap: 12px; color: #888; flex-shrink: 0; }
40
40
  .validation-bar .validation-meta span { white-space: nowrap; }
41
- .viewer-code .code-wrap { border-radius: 6px 6px 0 0; }
42
41
  .viewer-code .toolbar { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
43
42
  .viewer-code .toolbar button { background: #4a9eff; color: white; border: none; padding: 8px 16px; font-size: 14px; cursor: pointer; border-radius: 4px; }
44
43
  .viewer-code .toolbar button:disabled { opacity: 0.5; cursor: not-allowed; }
45
44
  .viewer-code .toolbar button:hover { background: #3a8eef; }
46
45
  .viewer-preview-wrap { flex: 0 0 320px; max-width: 100%; min-width: 0; }
47
- .viewer-preview { width: 100%; padding-bottom: 100%; height: 0; position: relative; overflow: hidden; border: 1px solid #444; border-radius: 6px; background: #000; }
46
+ .viewer-preview { width: 100%; padding-bottom: 100%; height: 0; position: relative; overflow: hidden; border: 1px solid #444; background: #000; }
48
47
  @media (max-width: 700px) { .viewer-row { flex-direction: column; } .viewer-preview-wrap { flex: 0 0 auto; width: 100%; max-width: 400px; } }
49
48
  #godot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: fill; }
50
49
  .status { padding: 8px 12px; border-radius: 4px; font-size: 13px; margin-top: 8px; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-godot-shader-preview",
3
- "version": "0.5.8",
3
+ "version": "0.6.0",
4
4
  "description": "React component for live Godot shader preview via WebAssembly. Load shader code, switch mesh (sphere/plane), edit uniforms and samplers.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -5,27 +5,31 @@ import { fileURLToPath } from 'node:url';
5
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
6
  const packageRoot = path.resolve(__dirname, '..');
7
7
  const sourceDir = path.join(packageRoot, 'godot');
8
- const embedFolder = 'react_godot_shader_preview_embed';
8
+ const embedFolderName = 'react_godot_shader_preview_embed';
9
9
  // When installed as a dependency, cwd is the package dir; project root is two levels up.
10
10
  const projectRoot = path.resolve(packageRoot, '..', '..');
11
- const destDir = path.join(projectRoot, embedFolder);
11
+ const publicDir = path.join(projectRoot, 'public');
12
+ const destDir = path.join(publicDir, embedFolderName);
12
13
 
13
14
  if (!fs.existsSync(sourceDir)) {
14
15
  console.warn('[react-godot-shader-preview] postinstall: godot folder not found, skip copy');
15
16
  process.exit(0);
16
17
  }
17
18
 
18
- if (!fs.existsSync(destDir)) {
19
- fs.mkdirSync(destDir, { recursive: true });
19
+ if (fs.existsSync(destDir)) {
20
+ fs.rmSync(destDir, { recursive: true });
20
21
  }
21
22
 
23
+ fs.mkdirSync(publicDir, { recursive: true });
24
+ fs.mkdirSync(destDir, { recursive: true });
25
+
22
26
  function copyRecursive(src, dest) {
23
27
  const entries = fs.readdirSync(src, { withFileTypes: true });
24
28
  for (const e of entries) {
25
29
  const srcPath = path.join(src, e.name);
26
30
  const destPath = path.join(dest, e.name);
27
31
  if (e.isDirectory()) {
28
- if (!fs.existsSync(destPath)) fs.mkdirSync(destPath, { recursive: true });
32
+ fs.mkdirSync(destPath, { recursive: true });
29
33
  copyRecursive(srcPath, destPath);
30
34
  } else {
31
35
  fs.copyFileSync(srcPath, destPath);
@@ -34,4 +38,4 @@ function copyRecursive(src, dest) {
34
38
  }
35
39
 
36
40
  copyRecursive(sourceDir, destDir);
37
- console.log(`[react-godot-shader-preview] Copied godot export to ${embedFolder}/`);
41
+ console.log(`[react-godot-shader-preview] Copied godot export to public/${embedFolderName}/`);