@unoverse-platform/studio 0.1.7 → 0.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unoverse-platform/studio",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "description": "Unoverse Studio: the local authoring app. Reads your own rx/ folder, no backend.",
6
6
  "scripts": {
@@ -9,7 +9,7 @@ import { UnoverseComponent, type ResolvedTheme } from "@unoverse/sdk";
9
9
  import { client, authedFetch, hasSourceAccess } from "studio-host";
10
10
  import { SourceView } from "./SourceView";
11
11
  import { stateActivation } from "./states";
12
- import { usePersistentState } from "studio-host";
12
+ import { usePersistentState, useRegistryToggles, ToggleSwitch } from "studio-host";
13
13
 
14
14
  const CHAT_ID = "demo";
15
15
 
@@ -58,6 +58,7 @@ const VIEWPORTS: { id: string; label: string; w: number | null }[] = [
58
58
  export function ComponentsView({ theme, org = "all" }: { theme: ResolvedTheme; org?: string }) {
59
59
  const store = useMemo(() => new ComponentStore(), []);
60
60
  const [components, setComponents] = useState<ComponentDef[]>([]);
61
+ const available = useRegistryToggles("component");
61
62
  const [selected, setSelected] = usePersistentState<string | null>("wb:components:selected", null);
62
63
  const [values, setValues] = useState<Record<string, unknown>>({}); // typed values → store/render
63
64
  const [text, setText] = useState<Record<string, string>>({}); // raw editor strings (decoupled from the typed value)
@@ -500,11 +501,22 @@ export function ComponentsView({ theme, org = "all" }: { theme: ResolvedTheme; o
500
501
  {/* Spatial toggle — ONLY for spatial-capable components (manifest.json present).
501
502
  Same two-level model as templates/skills: this is Level 1 (workbench
502
503
  eligibility); the Content Engine's per-workflow toggle is Level 2. */}
503
- {/* NO SPATIAL TOGGLE HERE. It wrote `plugin_state.enabled`, which the spatial catalogue
504
- deliberately IGNORES (`routeRegistrySpatial`): published IS available. What is actually
505
- on a map is the PER-WORKFLOW row, switched in Canvas's Content Library — spatial is
506
- unique to each workflow, and this screen has no workflow. A control that reads as the
507
- answer to "is this in spatial?" while writing where nothing reads is worse than none. */}
504
+ {/* AVAILABLE — the MASTER switch, and the first of two.
505
+ Studio available: is this offered to workflows at all? (here)
506
+ A canvas installed: is it on THIS workflow's map? (Content Library)
507
+ Studio decides the menu; each canvas orders from it. Both exist because
508
+ spatial is per workflow and an org can have hundreds of them carrying
509
+ different components.
510
+ It is NOT called "Spatial": two controls both called that, one of which the
511
+ catalogue ignored, is what made this switch look authoritative and do
512
+ nothing. This one is honoured — off means no canvas can install it. */}
513
+ {current?.spatial && (
514
+ <ToggleSwitch
515
+ on={available.isEnabled(current.name)}
516
+ onClick={() => available.toggle(current.name)}
517
+ label="Available"
518
+ />
519
+ )}
508
520
  {current?.spatial && (
509
521
  <button
510
522
  onClick={() => setMetaOpen((o) => !o)}