@dfosco/storyboard-react 4.2.0-beta.2 → 4.2.0-beta.3

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dfosco/storyboard-react",
3
- "version": "4.2.0-beta.2",
3
+ "version": "4.2.0-beta.3",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@base-ui/react": "^1.4.0",
7
- "@dfosco/storyboard-core": "4.2.0-beta.2",
8
- "@dfosco/tiny-canvas": "4.2.0-beta.2",
7
+ "@dfosco/storyboard-core": "4.2.0-beta.3",
8
+ "@dfosco/tiny-canvas": "4.2.0-beta.3",
9
9
  "@neodrag/react": "^2.3.1",
10
10
  "glob": "^11.0.0",
11
11
  "jsonc-parser": "^3.3.1",
@@ -27,7 +27,13 @@
27
27
  "@primer/octicons-react": ">=19",
28
28
  "react": ">=18",
29
29
  "react-router-dom": ">=6",
30
- "vite": ">=5"
30
+ "vite": ">=5",
31
+ "ghostty-web": ">=0.4.0"
32
+ },
33
+ "peerDependenciesMeta": {
34
+ "ghostty-web": {
35
+ "optional": true
36
+ }
31
37
  },
32
38
  "exports": {
33
39
  ".": "./src/index.js",
@@ -14,10 +14,16 @@ const terminalSchema = schemas['terminal']
14
14
  let ghosttyPromise = null
15
15
  function loadGhostty() {
16
16
  if (!ghosttyPromise) {
17
- ghosttyPromise = import('ghostty-web').then(async (mod) => {
18
- if (mod.init) await mod.init()
19
- return mod
20
- })
17
+ ghosttyPromise = import(/* @vite-ignore */ 'ghostty-web')
18
+ .then(async (mod) => {
19
+ if (mod.init) await mod.init()
20
+ return mod
21
+ })
22
+ .catch((err) => {
23
+ ghosttyPromise = null
24
+ console.warn('[TerminalWidget] ghostty-web not available:', err.message)
25
+ return null
26
+ })
21
27
  }
22
28
  return ghosttyPromise
23
29
  }
@@ -102,7 +108,7 @@ export default function TerminalWidget({ id, props, onUpdate, resizable }) {
102
108
  async function setup() {
103
109
  try {
104
110
  const ghostty = await loadGhostty()
105
- if (disposed) return
111
+ if (disposed || !ghostty) return
106
112
 
107
113
  const dims = calcDimensions(width, height)
108
114
  const cfg = getTerminalConfig()