@joycostudio/studio 0.2.0 → 0.2.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.
package/dist/client.js CHANGED
@@ -2,8 +2,9 @@ import {
2
2
  createStudio,
3
3
  everyFrame,
4
4
  postCompare
5
- } from "./chunk-ZPKMVZ67.js";
6
- import "./chunk-OEJWPWYJ.js";
5
+ } from "./chunk-BBS4RC6N.js";
6
+ import "./chunk-SN5V6C26.js";
7
+ import "./chunk-C6BT4KJA.js";
7
8
  export {
8
9
  createStudio,
9
10
  everyFrame,
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  hasConfig,
7
7
  success,
8
8
  validateConfig
9
- } from "./chunk-OEJWPWYJ.js";
9
+ } from "./chunk-C6BT4KJA.js";
10
10
  export {
11
11
  DEFAULT_PORT,
12
12
  defineConfig,
package/dist/next.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  createStudio
3
- } from "./chunk-ZPKMVZ67.js";
4
- import "./chunk-OEJWPWYJ.js";
3
+ } from "./chunk-BBS4RC6N.js";
4
+ import "./chunk-SN5V6C26.js";
5
+ import "./chunk-C6BT4KJA.js";
5
6
 
6
7
  // src/next.ts
7
8
  function createStudio2(config, options = {}) {
package/dist/next.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/next.ts"],"sourcesContent":["import { createStudio as createClient, type StudioOptions } from './client/studio'\n\n/** Next.js replaces this public environment variable in browser bundles. */\nexport function createStudio(config: StudioOptions, options: Pick<StudioOptions, 'runtime'> = {}) {\n return createClient(config, {\n runtime:\n options.runtime ??\n config.runtime ??\n (process.env.NODE_ENV === 'development' && (process.env.NEXT_PUBLIC_STUDIO_RUNTIME || false)),\n })\n}\n"],"mappings":";;;;;;AAGO,SAASA,cAAa,QAAuB,UAA0C,CAAC,GAAG;AAChG,SAAO,aAAa,QAAQ;AAAA,IAC1B,SACE,QAAQ,WACR,OAAO,YACN,QAAQ,IAAI,aAAa,kBAAkB,QAAQ,IAAI,8BAA8B;AAAA,EAC1F,CAAC;AACH;","names":["createStudio"]}
1
+ {"version":3,"sources":["../src/next.ts"],"sourcesContent":["import { createStudio as createClient, type StudioOptions } from './client/studio'\n\n/** Next.js replaces this public environment variable in browser bundles. */\nexport function createStudio(config: StudioOptions, options: Pick<StudioOptions, 'runtime'> = {}) {\n return createClient(config, {\n runtime:\n options.runtime ??\n config.runtime ??\n (process.env.NODE_ENV === 'development' && (process.env.NEXT_PUBLIC_STUDIO_RUNTIME || false)),\n })\n}\n"],"mappings":";;;;;;;AAGO,SAASA,cAAa,QAAuB,UAA0C,CAAC,GAAG;AAChG,SAAO,aAAa,QAAQ;AAAA,IAC1B,SACE,QAAQ,WACR,OAAO,YACN,QAAQ,IAAI,aAAa,kBAAkB,QAAQ,IAAI,8BAA8B;AAAA,EAC1F,CAAC;AACH;","names":["createStudio"]}
package/dist/react.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  import { useEffect as useEffect6, useRef as useRef3, useState as useState10 } from "react";
15
15
 
16
16
  // package.json
17
- var version = "0.2.0";
17
+ var version = "0.2.1";
18
18
 
19
19
  // src/client/studio.ts
20
20
  import { button } from "@joycostudio/xyz/debug";
@@ -531,7 +531,13 @@ function Inspector({
531
531
  const title = definition.title ?? definition.id;
532
532
  void ui.inline(container.current, { title }).then((host) => {
533
533
  if (disposed || !container.current) return host.dispose();
534
- const bound = bindDebugSchema(host, { schema: () => handle.controls() });
534
+ let bound;
535
+ try {
536
+ bound = bindDebugSchema(host, { schema: () => handle.controls() });
537
+ } catch (cause) {
538
+ host.dispose();
539
+ return console.error(`[studio] could not draw the "${definition.id}" controls:`, cause);
540
+ }
535
541
  const root = container.current.getRootNode();
536
542
  if (root instanceof ShadowRoot) void ui.adoptStyles(root);
537
543
  const unsubscribe = handle.subscribe(() => bound.refresh());