@petrarca/sonnet-playground 0.4.2 → 0.5.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pages/PlayGraph.tsx","../src/pages/graph/inMemoryGraphEditing.ts","../src/pages/graph/relationWidget.tsx"],"sourcesContent":["/**\n * Playground page for @petrarca/sonnet-graph.\n * Accessible at /playground/graph\n *\n * Demonstrates graph visualization with static mock data -- no backend required.\n * Uses the GraphStoresContext provider pattern that consumers like explorer\n * and any consumer app would use to wire their own stores.\n */\n\nimport React, { useCallback, useMemo, useRef, useState } from \"react\";\nimport {\n GraphVisualizer,\n ActionPanel,\n GraphA11yList,\n GraphRendererProvider,\n GraphStoresContext,\n GraphEditToolbar,\n createGraphDataStore,\n createGraphFilterStore,\n createGraphExplorationStore,\n createSelectionStore,\n createGraphFocusStore,\n enrichNodes,\n enrichEdges,\n buildColorPalette,\n GraphModelEditor,\n type GraphModel,\n type GraphModelCapabilities,\n type GraphCapabilities,\n type RawGraphNode,\n type RawGraphEdge,\n type WorkspaceStores,\n} from \"@petrarca/sonnet-graph\";\nimport { DEFAULT_WIDGETS, type WidgetRegistry } from \"@petrarca/sonnet-forms\";\nimport {\n createInMemoryPort,\n createModelSchemaProvider,\n type GraphStore,\n} from \"./graph/inMemoryGraphEditing\";\nimport { createRelationWidget } from \"./graph/relationWidget\";\nimport {\n Button,\n Alert,\n AlertDescription,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n ResizeHandle,\n} from \"@petrarca/sonnet-ui\";\nimport { FormSelect } from \"@petrarca/sonnet-forms\";\nimport { Play, RotateCcw } from \"lucide-react\";\n\n// ---------------------------------------------------------------------------\n// Technology Stack dataset (fictitious) -- a Product at the centre, broken\n// into Components, the Technologies they use, and external Dependencies.\n// Domain inspired by the lauro tech-stack/knowledge graph.\n// ---------------------------------------------------------------------------\n\nconst TECH_NODES: RawGraphNode[] = [\n {\n id_: 1,\n label_: \"Product\",\n properties_: { key: \"product-a\", name: \"Product A\" },\n },\n {\n id_: 2,\n label_: \"Product\",\n properties_: { key: \"product-b\", name: \"Product B\" },\n },\n {\n id_: 3,\n label_: \"TechnologyStack\",\n properties_: { key: \"product-a-stack\", name: \"Product A stack\" },\n },\n {\n id_: 4,\n label_: \"TechnologyStack\",\n properties_: { key: \"product-b-stack\", name: \"Product B stack\" },\n },\n {\n id_: 5,\n label_: \"Technology\",\n properties_: { key: \"react\", name: \"React\" },\n },\n {\n id_: 6,\n label_: \"Technology\",\n properties_: { key: \"postgresql\", name: \"PostgreSQL\" },\n },\n {\n id_: 7,\n label_: \"Technology\",\n properties_: { key: \"kafka\", name: \"Kafka\" },\n },\n {\n id_: 8,\n label_: \"Technology\",\n properties_: { key: \"go\", name: \"Go\" },\n },\n {\n id_: 9,\n label_: \"TechnologyCategory\",\n properties_: { key: \"frontend-framework\", name: \"Frontend Framework\" },\n },\n {\n id_: 10,\n label_: \"TechnologyCategory\",\n properties_: { key: \"database\", name: \"Database\" },\n },\n {\n id_: 11,\n label_: \"TechnologyCategory\",\n properties_: { key: \"messaging\", name: \"Messaging\" },\n },\n {\n id_: 12,\n label_: \"TechnologyCategory\",\n properties_: { key: \"language\", name: \"Language\" },\n },\n];\n\nconst TECH_EDGES: RawGraphEdge[] = [\n // Two products, each with its own stack; both stacks share PostgreSQL.\n {\n id_: 101,\n label_: \"HAS_TECH_STACK\",\n start_id_: 1,\n end_id_: 3,\n properties_: {},\n },\n {\n id_: 102,\n label_: \"HAS_TECH_STACK\",\n start_id_: 2,\n end_id_: 4,\n properties_: {},\n },\n {\n id_: 103,\n label_: \"INTEGRATES_WITH\",\n start_id_: 1,\n end_id_: 2,\n properties_: {},\n },\n // Product A stack: React, PostgreSQL, Kafka.\n {\n id_: 104,\n label_: \"USES_TECHNOLOGY\",\n start_id_: 3,\n end_id_: 5,\n properties_: {},\n },\n {\n id_: 105,\n label_: \"USES_TECHNOLOGY\",\n start_id_: 3,\n end_id_: 6,\n properties_: {},\n },\n {\n id_: 106,\n label_: \"USES_TECHNOLOGY\",\n start_id_: 3,\n end_id_: 7,\n properties_: {},\n },\n // Product B stack: Go + the shared PostgreSQL.\n {\n id_: 107,\n label_: \"USES_TECHNOLOGY\",\n start_id_: 4,\n end_id_: 6,\n properties_: {},\n },\n {\n id_: 108,\n label_: \"USES_TECHNOLOGY\",\n start_id_: 4,\n end_id_: 8,\n properties_: {},\n },\n // Technology -> category.\n { id_: 109, label_: \"BELONGS_TO\", start_id_: 5, end_id_: 9, properties_: {} },\n {\n id_: 110,\n label_: \"BELONGS_TO\",\n start_id_: 6,\n end_id_: 10,\n properties_: {},\n },\n {\n id_: 111,\n label_: \"BELONGS_TO\",\n start_id_: 7,\n end_id_: 11,\n properties_: {},\n },\n {\n id_: 112,\n label_: \"BELONGS_TO\",\n start_id_: 8,\n end_id_: 12,\n properties_: {},\n },\n];\n\n// ---------------------------------------------------------------------------\n// Store setup\n//\n// Stores are created once at module load, not inside the component.\n// This avoids re-creation on re-render and removes the need for useMemo.\n// ---------------------------------------------------------------------------\n\nfunction createPlaygroundStores(): WorkspaceStores {\n const graphFilter = createGraphFilterStore();\n const graphData = createGraphDataStore();\n const selection = createSelectionStore();\n const graphFocus = createGraphFocusStore();\n const graphExploration = createGraphExplorationStore({\n graphData,\n selection,\n graphFocus,\n graphFilter,\n // Static data -- no server expansion available in the playground\n expandNode: async () => ({ nodes: [], edges: [], has_more: false }),\n getNodes: async () => [],\n });\n return { graphFilter, graphData, graphExploration, selection };\n}\n\nconst PLAYGROUND_STORES = createPlaygroundStores();\n\n// ---------------------------------------------------------------------------\n// Data helpers\n// ---------------------------------------------------------------------------\n\ninterface GraphInput {\n nodes: RawGraphNode[];\n edges: RawGraphEdge[];\n}\n\nconst EMPTY_DATA: GraphInput = { nodes: [], edges: [] };\n\nfunction serializeGraphData(data: GraphInput): string {\n return JSON.stringify(data, null, 2);\n}\n\nfunction validateNode(n: unknown, i: number): string | null {\n if (!n || typeof n !== \"object\") return `nodes[${i}] must be an object`;\n const node = n as Record<string, unknown>;\n if (node.id_ === undefined) return `nodes[${i}] is missing id_`;\n if (typeof node.label_ !== \"string\") return `nodes[${i}] is missing label_`;\n return null;\n}\n\nfunction validateEdge(e: unknown, i: number): string | null {\n if (!e || typeof e !== \"object\") return `edges[${i}] must be an object`;\n const edge = e as Record<string, unknown>;\n if (edge.id_ === undefined) return `edges[${i}] is missing id_`;\n if (typeof edge.label_ !== \"string\") return `edges[${i}] is missing label_`;\n if (edge.start_id_ === undefined) return `edges[${i}] is missing start_id_`;\n if (edge.end_id_ === undefined) return `edges[${i}] is missing end_id_`;\n return null;\n}\n\n/** Validates that parsed JSON is a usable GraphInput. Returns an error string or null. */\nfunction validateGraphInput(value: unknown): string | null {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return \"JSON must be an object with nodes and edges arrays\";\n }\n const obj = value as Record<string, unknown>;\n if (!Array.isArray(obj.nodes)) return '\"nodes\" must be an array';\n if (!Array.isArray(obj.edges)) return '\"edges\" must be an array';\n for (const [i, n] of (obj.nodes as unknown[]).entries()) {\n const err = validateNode(n, i);\n if (err) return err;\n }\n for (const [i, e] of (obj.edges as unknown[]).entries()) {\n const err = validateEdge(e, i);\n if (err) return err;\n }\n return null;\n}\n\nfunction loadIntoStore(stores: WorkspaceStores, data: GraphInput) {\n const labelCounts: Record<string, number> = {};\n for (const n of data.nodes) {\n labelCounts[n.label_] = (labelCounts[n.label_] ?? 0) + 1;\n }\n const palette = buildColorPalette(labelCounts);\n const nodes = enrichNodes(data.nodes, palette);\n const edges = enrichEdges(data.edges, palette);\n stores.graphFilter.getState().resetFilters();\n stores.graphData.getState().setQueryData(nodes, edges, {\n nodes: nodes.length,\n edges: edges.length,\n });\n // Signal renderers to re-fit layout after data change\n stores.graphFilter.getState().notifyDataChange();\n}\n\n// The mutable in-memory dataset the instance-editing port operates on. It is\n// the single source of truth shared by the Data JSON tab and the live editor;\n// after each edit it is re-enriched into the graph data store (the consumer's\n// cache-patch analog). Initialised to the default dataset's data below.\nconst LIVE_STORE: GraphStore = { nodes: [], edges: [] };\n\n// Replace LIVE_STORE's contents and load them into the visual store.\nfunction setLiveData(stores: WorkspaceStores, data: GraphInput): void {\n LIVE_STORE.nodes = data.nodes.map((n) => ({ ...n }));\n LIVE_STORE.edges = data.edges.map((e) => ({ ...e }));\n loadIntoStore(stores, LIVE_STORE);\n}\n\n// Load the default dataset's data immediately -- no effect needed, no empty\n// render cycle. (The dataset bundle is defined below; its data lives here.)\nsetLiveData(PLAYGROUND_STORES, { nodes: TECH_NODES, edges: TECH_EDGES });\n\n// ---------------------------------------------------------------------------\n// Model tab -- GraphModelEditor over the metamodel of the Graph/Data tabs\n// ---------------------------------------------------------------------------\n\n// A faithful subset of the apex-graph tech-stack domain model: Product at the\n// centre, with TechnologyStack, Technology and TechnologyCategory node types\n// and the real relation types between them (HAS_TECH_STACK, INTEGRATES_WITH,\n// USES_TECHNOLOGY, BELONGS_TO). PROVIDES_STACK_FOR is a second, fictitious\n// Product -> TechnologyStack relation so a single node-type pair has two\n// distinct relation types (exercises the edge editor's multi-relation create).\n// The Model tab is the schema; the Graph / Data tabs are instances conforming\n// to it.\nconst TECH_MODEL: GraphModel = [\n {\n title: \"Product\",\n type: \"object\",\n properties: { key: { type: \"string\" }, name: { type: \"string\" } },\n required: [\"key\", \"name\"],\n \"x-graph\": {\n type: \"NODE\",\n label: \"Product\",\n relations: [\n {\n rel_type_name: \"HAS_TECH_STACK\",\n to_type_name: \"TechnologyStack\",\n cardinality: \"ONE_TO_ONE\",\n form_field: true,\n },\n {\n // Fictitious second Product -> TechnologyStack relation: a product\n // may also provision a stack it does not own (one-to-many).\n rel_type_name: \"PROVIDES_STACK_FOR\",\n to_type_name: \"TechnologyStack\",\n cardinality: \"ONE_TO_MANY\",\n form_field: true,\n },\n {\n rel_type_name: \"INTEGRATES_WITH\",\n to_type_name: \"Product\",\n cardinality: \"ONE_TO_MANY\",\n form_field: true,\n },\n ],\n },\n },\n {\n title: \"TechnologyStack\",\n type: \"object\",\n properties: { key: { type: \"string\" }, name: { type: \"string\" } },\n \"x-graph\": {\n type: \"NODE\",\n label: \"TechnologyStack\",\n relations: [\n {\n rel_type_name: \"USES_TECHNOLOGY\",\n to_type_name: \"Technology\",\n cardinality: \"ONE_TO_MANY\",\n form_field: true,\n },\n ],\n },\n },\n {\n title: \"Technology\",\n type: \"object\",\n properties: { key: { type: \"string\" }, name: { type: \"string\" } },\n required: [\"key\", \"name\"],\n \"x-graph\": {\n type: \"NODE\",\n label: \"Technology\",\n relations: [\n {\n rel_type_name: \"BELONGS_TO\",\n to_type_name: \"TechnologyCategory\",\n cardinality: \"ONE_TO_ONE\",\n form_field: true,\n },\n ],\n },\n },\n {\n title: \"TechnologyCategory\",\n type: \"object\",\n properties: { key: { type: \"string\" }, name: { type: \"string\" } },\n required: [\"key\", \"name\"],\n \"x-graph\": { type: \"NODE\", label: \"TechnologyCategory\" },\n },\n];\n\n// The Organization metamodel -- a subset of the Sestina organization model\n// (see sestina web/docs/design/organization-graph.md). Node-type labels are\n// the organization types (Network, Hospital, Department, Practice). Relations\n// are directional triples: `partOf` is containment (child -> parent, FHIR\n// Organization.partOf); `affiliation` is a non-hierarchical link (FHIR\n// OrganizationAffiliation). Directionality encodes the rules (a Department is\n// partOf a Hospital, not the reverse). Paired with a locked-down profile (see\n// the dataset below): edgeTypes \"catalog\" (a fixed relation-type vocabulary,\n// no new edge types) and no property editing.\nconst ORG_MODEL: GraphModel = [\n {\n title: \"Network\",\n type: \"object\",\n \"x-graph\": { type: \"NODE\", label: \"Network\" },\n },\n {\n title: \"Hospital\",\n type: \"object\",\n \"x-graph\": {\n type: \"NODE\",\n label: \"Hospital\",\n relations: [\n {\n rel_type_name: \"partOf\",\n to_type_name: \"Network\",\n cardinality: \"ONE_TO_ONE\",\n },\n ],\n },\n },\n {\n title: \"Department\",\n type: \"object\",\n \"x-graph\": {\n type: \"NODE\",\n label: \"Department\",\n relations: [\n {\n rel_type_name: \"partOf\",\n to_type_name: \"Hospital\",\n cardinality: \"ONE_TO_ONE\",\n },\n ],\n },\n },\n {\n title: \"Practice\",\n type: \"object\",\n \"x-graph\": {\n type: \"NODE\",\n label: \"Practice\",\n relations: [\n {\n rel_type_name: \"partOf\",\n to_type_name: \"Network\",\n cardinality: \"ONE_TO_ONE\",\n },\n {\n rel_type_name: \"affiliation\",\n to_type_name: \"Hospital\",\n cardinality: \"ONE_TO_MANY\",\n },\n ],\n },\n },\n // Pre-defined relation-type catalog. With edgeTypes \"catalog\", relations may\n // only use these types; no new edge types can be created.\n {\n title: \"partOf\",\n type: \"object\",\n \"x-graph\": { type: \"EDGE\", label: \"partOf\" },\n },\n {\n title: \"affiliation\",\n type: \"object\",\n \"x-graph\": { type: \"EDGE\", label: \"affiliation\" },\n },\n];\n\nconst ORG_NODES: RawGraphNode[] = [\n {\n id_: 1,\n label_: \"Network\",\n properties_: { name: \"Northwind Care Network\" },\n },\n { id_: 2, label_: \"Hospital\", properties_: { name: \"Riverside General\" } },\n { id_: 3, label_: \"Hospital\", properties_: { name: \"Lakeside Clinic\" } },\n { id_: 4, label_: \"Department\", properties_: { name: \"Cardiology\" } },\n { id_: 5, label_: \"Department\", properties_: { name: \"Radiology\" } },\n { id_: 6, label_: \"Practice\", properties_: { name: \"Maple Street GP\" } },\n];\n\nconst ORG_EDGES: RawGraphEdge[] = [\n // partOf: child -> parent (containment).\n { id_: 201, label_: \"partOf\", start_id_: 2, end_id_: 1, properties_: {} },\n { id_: 202, label_: \"partOf\", start_id_: 3, end_id_: 1, properties_: {} },\n { id_: 203, label_: \"partOf\", start_id_: 4, end_id_: 2, properties_: {} },\n { id_: 204, label_: \"partOf\", start_id_: 5, end_id_: 2, properties_: {} },\n // affiliation: a practice affiliated with a hospital (non-hierarchical).\n {\n id_: 205,\n label_: \"affiliation\",\n start_id_: 6,\n end_id_: 2,\n properties_: {},\n },\n];\n\n// ---------------------------------------------------------------------------\n// Datasets -- each bundles { graph data + model + capability profile }. The\n// selector above the tabs swaps all three at once.\n// ---------------------------------------------------------------------------\n\n// The Model Editor's { readOnly, capabilities } config, edited as JSON on the\n// Capabilities tab and applied to the GraphModelEditor.\ninterface CapabilitiesConfig {\n readOnly: boolean;\n capabilities: GraphModelCapabilities;\n}\n\ninterface GraphDataset {\n label: string;\n data: GraphInput;\n model: GraphModel;\n capabilities: CapabilitiesConfig;\n /** Instance-editing capabilities for the live data graph (the Graph tab). */\n editCapabilities: GraphCapabilities;\n}\n\nconst DATASETS: Record<string, GraphDataset> = {\n empty: {\n label: \"Empty\",\n data: EMPTY_DATA,\n model: [],\n capabilities: { readOnly: false, capabilities: {} },\n // No model to drive forms, so editing stays off.\n editCapabilities: {},\n },\n techStack: {\n label: \"Technology Stack\",\n data: { nodes: TECH_NODES, edges: TECH_EDGES },\n model: TECH_MODEL,\n capabilities: { readOnly: false, capabilities: {} },\n // Full instance editing: create / edit / delete nodes and edges.\n editCapabilities: {\n createNode: \"edit\",\n updateNode: \"edit\",\n deleteNode: \"edit\",\n createEdge: \"edit\",\n updateEdge: \"edit\",\n deleteEdge: \"edit\",\n },\n },\n organization: {\n label: \"Organization model\",\n data: { nodes: ORG_NODES, edges: ORG_EDGES },\n model: ORG_MODEL,\n // Simulates the planned Sestina org editor: fixed edge-type catalog (no new\n // edge types) and no property editing (node/edge properties hidden).\n capabilities: {\n readOnly: false,\n capabilities: {\n edgeTypes: \"catalog\",\n nodeProperties: \"hidden\",\n edgeProperties: \"hidden\",\n },\n },\n // A constrained instance-editing profile: edges may be linked / unlinked\n // (partOf / affiliation), but nodes are not created or deleted here.\n editCapabilities: {\n updateNode: \"edit\",\n createEdge: \"edit\",\n deleteEdge: \"edit\",\n },\n },\n};\n\nconst DATASET_OPTIONS = Object.entries(DATASETS).map(([value, d]) => ({\n value,\n label: d.label,\n}));\n\nconst DEFAULT_DATASET = \"techStack\";\n\ninterface ModelState {\n model: GraphModel;\n modelText: string;\n modelError: string | null;\n setModelText: (v: string) => void;\n applyModel: () => void;\n /** Replace the model wholesale (used by the dataset selector). */\n loadModel: (model: GraphModel) => void;\n /** Apply an edited model (from the graph editor) and re-sync the JSON text. */\n updateModel: (model: GraphModel) => void;\n}\n\n// Shared model state for the Model and Model JSON tabs.\nfunction useModelState(initialModel: GraphModel): ModelState {\n const [modelText, setModelText] = useState(() =>\n JSON.stringify(initialModel, null, 2),\n );\n const [model, setModel] = useState<GraphModel>(initialModel);\n const [modelError, setModelError] = useState<string | null>(null);\n\n const applyModel = useCallback(() => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(modelText);\n } catch (e) {\n setModelError(e instanceof Error ? e.message : \"Invalid JSON\");\n return;\n }\n if (!Array.isArray(parsed)) {\n setModelError(\"A graph model must be a JSON array of type schemas.\");\n return;\n }\n setModelError(null);\n setModel(parsed as GraphModel);\n }, [modelText]);\n\n const loadModel = useCallback((next: GraphModel) => {\n setModelText(JSON.stringify(next, null, 2));\n setModel(next);\n setModelError(null);\n }, []);\n\n const updateModel = useCallback((next: GraphModel) => {\n setModel(next);\n setModelText(JSON.stringify(next, null, 2));\n setModelError(null);\n }, []);\n\n return {\n model,\n modelText,\n modelError,\n setModelText,\n applyModel,\n loadModel,\n updateModel,\n };\n}\n\n// Full-canvas model editor (editable; changes flow back to the shared state).\nfunction ModelGraphTab({\n model,\n onChange,\n readOnly,\n capabilities,\n}: {\n model: GraphModel;\n onChange: (model: GraphModel) => void;\n readOnly: boolean;\n capabilities: GraphModelCapabilities;\n}): React.ReactElement {\n return (\n <div className=\"h-[640px] rounded-lg border overflow-hidden\">\n <GraphModelEditor\n value={model}\n onChange={onChange}\n readOnly={readOnly}\n capabilities={capabilities}\n widgetOptions={[\"entity-select\", \"coded-value\", \"textarea\"]}\n />\n </div>\n );\n}\n\nfunction CapabilitiesTab({\n config,\n onApply,\n}: {\n config: CapabilitiesConfig;\n onApply: (config: CapabilitiesConfig) => void;\n}): React.ReactElement {\n const [text, setText] = useState(() => JSON.stringify(config, null, 2));\n const [error, setError] = useState<string | null>(null);\n\n const apply = useCallback(() => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch (e) {\n setError(e instanceof Error ? e.message : \"Invalid JSON\");\n return;\n }\n setError(null);\n const obj = parsed as Partial<CapabilitiesConfig>;\n onApply({\n readOnly: Boolean(obj.readOnly),\n capabilities: (obj.capabilities ?? {}) as GraphModelCapabilities,\n });\n }, [text, onApply]);\n\n const reset = useCallback(() => {\n const fresh: CapabilitiesConfig = { readOnly: false, capabilities: {} };\n setText(JSON.stringify(fresh, null, 2));\n setError(null);\n onApply(fresh);\n }, [onApply]);\n\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Button size=\"sm\" onClick={apply}>\n <Play className=\"h-4 w-4 mr-1\" />\n Apply\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={reset}>\n <RotateCcw className=\"h-4 w-4 mr-1\" />\n Reset\n </Button>\n <span className=\"text-xs text-muted-foreground ml-2\">\n Edit, Apply, then open the Model Editor tab and select a node.\n </span>\n </div>\n {error && (\n <Alert variant=\"destructive\">\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n <textarea\n value={text}\n onChange={(e) => setText(e.target.value)}\n spellCheck={false}\n className=\"w-full h-[280px] font-mono text-xs p-3 border rounded-lg bg-muted/30 resize-y focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n <div>\n <p className=\"text-xs font-medium text-muted-foreground mb-1\">\n Effective config (applied to GraphModelEditor)\n </p>\n <pre className=\"rounded-md bg-muted px-3 py-2 text-xs overflow-auto max-h-40\">\n {JSON.stringify(config, null, 2)}\n </pre>\n <p className=\"mt-2 text-xs text-muted-foreground\">\n readOnly = lock everything. capabilities: nodeTypes / relations (edit\n | readonly), edgeTypes (edit = select or create | catalog = select\n only | readonly), nodeProperties / edgeProperties (edit | readonly |\n hidden), showEdgeTypes (bool, default false starts edge-type nodes\n deselected; true shows them). More fields are added as the editor\n grows.\n </p>\n </div>\n </div>\n );\n}\n\n// Editable model JSON, applied to the shared model state.\nfunction ModelJsonTab({\n state,\n onReset,\n}: {\n state: ModelState;\n onReset: () => void;\n}): React.ReactElement {\n const { modelText, modelError, setModelText, applyModel } = state;\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Button size=\"sm\" onClick={applyModel}>\n <Play className=\"h-4 w-4 mr-1\" />\n Apply\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={onReset}>\n <RotateCcw className=\"h-4 w-4 mr-1\" />\n Reset\n </Button>\n <span className=\"text-xs text-muted-foreground ml-2\">\n Edit the model, Apply, then switch to the Model tab\n </span>\n </div>\n {modelError && (\n <Alert variant=\"destructive\">\n <AlertDescription>{modelError}</AlertDescription>\n </Alert>\n )}\n <textarea\n value={modelText}\n onChange={(e) => setModelText(e.target.value)}\n spellCheck={false}\n className=\"w-full h-[600px] font-mono text-xs p-3 border rounded-lg bg-muted/30 resize-y focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport default function PlayGraph(): React.ReactElement {\n const [datasetKey, setDatasetKey] = useState(DEFAULT_DATASET);\n const [jsonText, setJsonText] = useState(() =>\n serializeGraphData(DATASETS[DEFAULT_DATASET].data),\n );\n const [parseError, setParseError] = useState<string | null>(null);\n const modelState = useModelState(DATASETS[DEFAULT_DATASET].model);\n const { loadModel } = modelState;\n const [capsConfig, setCapsConfig] = useState<CapabilitiesConfig>(\n DATASETS[DEFAULT_DATASET].capabilities,\n );\n\n // Instance-editing seams over the in-memory store + the current model. The\n // port re-loads LIVE_STORE into the visual store after every mutation; the\n // schema provider resolves forms from the (live-edited) model. Recreated when\n // the model changes so edits use the latest schema.\n const editPort = useMemo(\n () =>\n createInMemoryPort(LIVE_STORE, () =>\n loadIntoStore(PLAYGROUND_STORES, LIVE_STORE),\n ),\n [],\n );\n const editSchemaProvider = useMemo(\n () => createModelSchemaProvider(modelState.model),\n [modelState.model],\n );\n // Keep the Data JSON tab in sync after a live edit.\n const handleMutated = useCallback(() => {\n setJsonText(serializeGraphData(LIVE_STORE));\n }, []);\n\n // App-supplied form widgets: the relation widget resolves __rel_* options\n // from the in-memory store, registered under \"entity-select\" (the library's\n // default relation widget hint). This is the playground analog of the\n // explorer's cypher-select.\n const editWidgets = useMemo<WidgetRegistry>(\n () => ({\n ...DEFAULT_WIDGETS,\n \"entity-select\": createRelationWidget(LIVE_STORE),\n }),\n [],\n );\n\n // Swap the whole dataset: graph data + model + capability profile.\n const loadDataset = useCallback(\n (key: string) => {\n const ds = DATASETS[key];\n if (!ds) return;\n setDatasetKey(key);\n setJsonText(serializeGraphData(ds.data));\n setParseError(null);\n setLiveData(PLAYGROUND_STORES, ds.data);\n loadModel(ds.model);\n setCapsConfig(ds.capabilities);\n },\n [loadModel],\n );\n\n // Resizable side panel (demonstrates ResizeHandle).\n const [panelWidth, setPanelWidth] = useState(300);\n const rowRef = useRef<HTMLDivElement>(null);\n const startResize = useCallback((e: React.PointerEvent) => {\n e.preventDefault();\n const target = e.currentTarget as HTMLElement;\n target.setPointerCapture(e.pointerId);\n const move = (ev: PointerEvent) => {\n const right = rowRef.current?.getBoundingClientRect().right ?? 0;\n setPanelWidth(Math.min(560, Math.max(200, right - ev.clientX)));\n };\n const up = () => {\n window.removeEventListener(\"pointermove\", move);\n window.removeEventListener(\"pointerup\", up);\n };\n window.addEventListener(\"pointermove\", move);\n window.addEventListener(\"pointerup\", up);\n }, []);\n\n const handleApply = useCallback(() => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(jsonText);\n } catch (e) {\n setParseError(e instanceof Error ? e.message : \"Invalid JSON\");\n return;\n }\n const validationError = validateGraphInput(parsed);\n if (validationError) {\n setParseError(validationError);\n return;\n }\n setParseError(null);\n setLiveData(PLAYGROUND_STORES, parsed as GraphInput);\n }, [jsonText]);\n\n const handleReset = useCallback(() => {\n const data = DATASETS[datasetKey].data;\n setJsonText(serializeGraphData(data));\n setParseError(null);\n setLiveData(PLAYGROUND_STORES, data);\n }, [datasetKey]);\n\n // Reset the model JSON tab to the current dataset's model.\n const handleResetModel = useCallback(() => {\n loadModel(DATASETS[datasetKey].model);\n }, [datasetKey, loadModel]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === \"Enter\") {\n e.preventDefault();\n handleApply();\n }\n },\n [handleApply],\n );\n\n return (\n <div className=\"space-y-6\">\n <div>\n <h1>Graph Visualization</h1>\n <p className=\"text-sm text-muted-foreground mt-1\">\n Interactive property graph with dual renderer support. Edit the JSON\n data and apply to re-render. The Model tab renders a graph model\n (metamodel) with GraphModelEditor.\n </p>\n </div>\n <div className=\"flex items-center gap-3\">\n <FormSelect\n label=\"Dataset\"\n options={DATASET_OPTIONS}\n value={datasetKey}\n onChange={(v) => v && loadDataset(v)}\n clearable={false}\n wrapperClassName=\"w-64\"\n />\n <span className=\"text-xs text-muted-foreground mt-5\">\n A dataset bundles graph data + model + capability profile.\n </span>\n </div>\n <GraphStoresContext.Provider value={PLAYGROUND_STORES}>\n <Tabs defaultValue=\"graph\" className=\"space-y-3\">\n <TabsList>\n <TabsTrigger value=\"graph\">Graph</TabsTrigger>\n <TabsTrigger value=\"data\">Data JSON</TabsTrigger>\n <TabsTrigger value=\"model\">Model Editor</TabsTrigger>\n <TabsTrigger value=\"model-json\">Model JSON</TabsTrigger>\n <TabsTrigger value=\"model-capabilities\">\n Model Editor Capabilities\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"graph\" className=\"mt-0\">\n <GraphRendererProvider defaultRenderer=\"cytoscape\">\n <div ref={rowRef} className=\"flex overflow-hidden h-[600px]\">\n <div className=\"flex-1 min-w-0\">\n <GraphVisualizer />\n </div>\n {/* Drag to resize the side panel (ResizeHandle demo). */}\n <ResizeHandle\n orientation=\"vertical\"\n aria-valuenow={panelWidth}\n aria-valuemin={200}\n aria-valuemax={560}\n onPointerDown={startResize}\n onDoubleClick={() => setPanelWidth(300)}\n />\n <div\n style={{ width: panelWidth }}\n className=\"flex-shrink-0 flex flex-col min-h-0\"\n >\n <div className=\"flex-1 min-h-0 overflow-hidden\">\n <ActionPanel\n actions={\n <GraphEditToolbar\n port={editPort}\n schemaProvider={editSchemaProvider}\n capabilities={DATASETS[datasetKey].editCapabilities}\n widgets={editWidgets}\n onMutated={handleMutated}\n />\n }\n />\n </div>\n {/* Accessible DOM mirror (playground demo only): keyboard / AT /\n automation can select the same nodes/edges as the canvas.\n Real consumers render it sr-only (omit `visible`). */}\n <div className=\"shrink-0 px-4 pb-4 pt-2\">\n <p className=\"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2\">\n Accessible list (demo)\n </p>\n <GraphA11yList visible maxHeight={160} />\n </div>\n </div>\n </div>\n </GraphRendererProvider>\n </TabsContent>\n\n <TabsContent value=\"data\" className=\"mt-0\">\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Button size=\"sm\" onClick={handleApply}>\n <Play className=\"h-4 w-4 mr-1\" />\n Apply\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={handleReset}>\n <RotateCcw className=\"h-4 w-4 mr-1\" />\n Reset\n </Button>\n <span className=\"text-xs text-muted-foreground ml-2\">\n Cmd+Enter to apply\n </span>\n </div>\n {parseError && (\n <Alert variant=\"destructive\">\n <AlertDescription>{parseError}</AlertDescription>\n </Alert>\n )}\n <textarea\n value={jsonText}\n onChange={(e) => setJsonText(e.target.value)}\n onKeyDown={handleKeyDown}\n spellCheck={false}\n className=\"w-full h-[600px] font-mono text-xs p-3 border rounded-lg bg-muted/30 resize-y focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n </TabsContent>\n\n <TabsContent value=\"model\" className=\"mt-0\">\n <ModelGraphTab\n model={modelState.model}\n onChange={modelState.updateModel}\n readOnly={capsConfig.readOnly}\n capabilities={capsConfig.capabilities}\n />\n </TabsContent>\n\n <TabsContent value=\"model-json\" className=\"mt-0\">\n <ModelJsonTab state={modelState} onReset={handleResetModel} />\n </TabsContent>\n\n <TabsContent value=\"model-capabilities\" className=\"mt-0\">\n <CapabilitiesTab config={capsConfig} onApply={setCapsConfig} />\n </TabsContent>\n </Tabs>\n </GraphStoresContext.Provider>\n </div>\n );\n}\n","/**\n * In-memory graph-editing adapters for the playground.\n *\n * Implements the sonnet-graph instance-editing seams against a mutable\n * in-memory dataset and the selected dataset's model, with NO backend:\n *\n * - `createInMemoryPort` -> a `GraphMutationPort` that mutates the dataset\n * and re-loads the store so the canvas reflects the change.\n * - `createModelSchemaProvider` -> a `GraphSchemaProvider` that resolves\n * node/edge schemas and relations synchronously from the in-memory model.\n *\n * This is the playground's acceptance demo (tier 1 of the override model): the\n * shared library editor driven end-to-end with zero app-specific UI. A real\n * consumer (e.g. the explorer) implements the same seams over its REST API.\n */\n\nimport type {\n GraphMutationPort,\n GraphSchemaProvider,\n RelationDef,\n RawGraphNode,\n RawGraphEdge,\n GraphModel,\n CreateNodeInput,\n UpdateNodeInput,\n CreateEdgeInput,\n UpdateEdgeInput,\n CreateNodeWithRelationsInput,\n UpdateNodeWithRelationsInput,\n RelationMap,\n} from \"@petrarca/sonnet-graph\";\nimport type { JsonSchema } from \"@petrarca/sonnet-core/schema\";\n\n/** The mutable dataset the in-memory port operates on. */\nexport interface GraphStore {\n nodes: RawGraphNode[];\n edges: RawGraphEdge[];\n}\n\n/** Allocates monotonically increasing ids, seeded above the existing maximum.\n * Uses reduce instead of spread-into-Math.max to avoid stack overflow on large\n * stores. */\nfunction createIdAllocator(store: GraphStore): () => number {\n const allIds = [\n ...store.nodes.map((n) => n.id_ ?? 0),\n ...store.edges.map((e) => e.id_ ?? 0),\n ];\n const max = allIds.reduce((m, id) => (id > m ? id : m), 0);\n let next = max + 1;\n return () => next++;\n}\n\n/** Edges touching a node, as the inbound / outbound subsets. */\nfunction edgesForNode(\n store: GraphStore,\n id: number,\n): { inbound: RawGraphEdge[]; outbound: RawGraphEdge[] } {\n return {\n inbound: store.edges.filter((e) => e.end_id_ === id),\n outbound: store.edges.filter((e) => e.start_id_ === id),\n };\n}\n\n/**\n * Apply a relation map to a node by diffing against its current edges: create\n * edges for new targets, delete edges for removed targets, keep the rest.\n * Returns the created and deleted-edge ids (mirrors the backend's atomic diff).\n */\nfunction diffRelations(\n store: GraphStore,\n nodeId: number,\n relations: RelationMap,\n nextId: () => number,\n): { created: RawGraphEdge[]; deleted: number[] } {\n const created: RawGraphEdge[] = [];\n const deleted: number[] = [];\n\n for (const [relType, targetIds] of Object.entries(relations)) {\n const existing = store.edges.filter(\n (e) => e.label_ === relType && e.start_id_ === nodeId,\n );\n const desired = new Set(targetIds);\n\n // Delete edges whose target is no longer desired.\n for (const edge of existing) {\n if (!desired.has(edge.end_id_) && edge.id_ != null) {\n deleted.push(edge.id_);\n }\n }\n // Create edges for desired targets not already present.\n const present = new Set(existing.map((e) => e.end_id_));\n for (const targetId of targetIds) {\n if (!present.has(targetId)) {\n const edge: RawGraphEdge = {\n id_: nextId(),\n label_: relType,\n start_id_: nodeId,\n end_id_: targetId,\n properties_: {},\n };\n created.push(edge);\n }\n }\n }\n\n store.edges = store.edges\n .filter((e) => e.id_ == null || !deleted.includes(e.id_))\n .concat(created);\n return { created, deleted };\n}\n\n/**\n * Build a `GraphMutationPort` over a mutable in-memory store. `onChange` is\n * called after every mutation so the playground can re-load the store into the\n * graph data store (the consumer's cache-patch analog).\n */\nexport function createInMemoryPort(\n store: GraphStore,\n onChange: () => void,\n): GraphMutationPort {\n const nextId = createIdAllocator(store);\n\n const createNode = (input: CreateNodeInput): RawGraphNode => {\n const node: RawGraphNode = {\n id_: nextId(),\n label_: input.label_,\n properties_: input.properties_,\n };\n store.nodes = [...store.nodes, node];\n return node;\n };\n\n const updateNode = (input: UpdateNodeInput): RawGraphNode => {\n const node: RawGraphNode = {\n id_: input.id_,\n label_: input.label_,\n properties_: input.properties_,\n };\n store.nodes = store.nodes.map((n) => (n.id_ === input.id_ ? node : n));\n return node;\n };\n\n const createEdge = (input: CreateEdgeInput): RawGraphEdge => {\n const edge: RawGraphEdge = {\n id_: nextId(),\n label_: input.label_,\n start_id_: input.start_id_,\n end_id_: input.end_id_,\n properties_: input.properties_ ?? {},\n };\n store.edges = [...store.edges, edge];\n return edge;\n };\n\n const updateEdge = (input: UpdateEdgeInput): RawGraphEdge => {\n let updated: RawGraphEdge | undefined;\n store.edges = store.edges.map((e) => {\n if (e.id_ !== input.id_) return e;\n updated = { ...e, properties_: input.properties_ };\n return updated;\n });\n if (!updated) throw new Error(`Edge ${input.id_} not found`);\n return updated;\n };\n\n // Wrap each mutation: call onChange synchronously after the mutation\n // completes so the canvas reflects the change immediately (the playground\n // has no async cache layer). The Promise wrapper satisfies the port contract.\n const withRefresh = <Args extends unknown[], R>(\n fn: (...args: Args) => R,\n ): ((...args: Args) => Promise<R>) => {\n return (...args: Args) => {\n const result = fn(...args);\n onChange();\n return Promise.resolve(result);\n };\n };\n\n return {\n createNode: withRefresh(createNode),\n updateNode: withRefresh(updateNode),\n deleteNode: withRefresh((id: number) => {\n store.nodes = store.nodes.filter((n) => n.id_ !== id);\n store.edges = store.edges.filter(\n (e) => e.start_id_ !== id && e.end_id_ !== id,\n );\n }),\n createEdge: withRefresh(createEdge),\n updateEdge: withRefresh(updateEdge),\n deleteEdge: withRefresh((id: number) => {\n store.edges = store.edges.filter((e) => e.id_ !== id);\n }),\n createNodeWithRelations: withRefresh(\n (input: CreateNodeWithRelationsInput) => {\n const node = createNode(input);\n const { created } = diffRelations(\n store,\n node.id_!,\n input.relations,\n nextId,\n );\n return { node, edges: created };\n },\n ),\n updateNodeWithRelations: withRefresh(\n (input: UpdateNodeWithRelationsInput) => {\n const node = updateNode(input);\n const { created, deleted } = diffRelations(\n store,\n input.id_,\n input.relations,\n nextId,\n );\n return { node, edges: { created, deleted } };\n },\n ),\n getInboundEdges: (id: number) =>\n Promise.resolve(edgesForNode(store, id).inbound),\n getOutboundEdges: (id: number) =>\n Promise.resolve(edgesForNode(store, id).outbound),\n getPairEdges: (a: number, b: number) =>\n Promise.resolve(\n store.edges.filter(\n (e) =>\n (e.start_id_ === a && e.end_id_ === b) ||\n (e.start_id_ === b && e.end_id_ === a),\n ),\n ),\n getNodes: (ids: number[]) =>\n Promise.resolve(\n store.nodes.filter((n) => n.id_ != null && ids.includes(n.id_)),\n ),\n };\n}\n\n/**\n * Strip the model's `x-graph` extension, yielding a plain property JSON Schema.\n * `GraphModelProperty` is structurally compatible with `JsonSchemaProperty`\n * (same keys: type, title, description, enum, format, items, default); the cast\n * via unknown is safe here and confined to this playground adapter.\n */\nfunction toPropertySchema(\n type: GraphModel[number] | undefined,\n): JsonSchema | null {\n if (!type) return null;\n return {\n type: \"object\",\n properties: (type.properties ?? {}) as unknown as JsonSchema[\"properties\"],\n required: type.required ?? [],\n } as unknown as JsonSchema;\n}\n\n/**\n * Build a `GraphSchemaProvider` from an in-memory `GraphModel`. All lookups\n * resolve synchronously (wrapped in `Promise.resolve`); a host with the model\n * already in memory does not need an async source.\n */\nexport function createModelSchemaProvider(\n model: GraphModel,\n): GraphSchemaProvider {\n const byLabel = new Map(model.map((t) => [t[\"x-graph\"].label, t]));\n\n const nodeLabels = model\n .filter((t) => t[\"x-graph\"].type !== \"EDGE\")\n .map((t) => t[\"x-graph\"].label);\n\n return {\n getNodeSchema: (label: string) =>\n Promise.resolve(toPropertySchema(byLabel.get(label))),\n getEdgeSchema: (type: string) =>\n Promise.resolve(toPropertySchema(byLabel.get(type))),\n listNodeLabels: () => Promise.resolve(nodeLabels),\n relationsFor: (label: string): Promise<RelationDef[]> => {\n const relations = byLabel.get(label)?.[\"x-graph\"].relations ?? [];\n return Promise.resolve(\n relations.map((r) => ({\n rel_type_name: r.rel_type_name,\n to_type_name: r.to_type_name,\n form_field: r.form_field,\n // cardinality drives single- vs multi-select in the form.\n cardinality: r.cardinality as RelationDef[\"cardinality\"],\n })),\n );\n },\n };\n}\n","/**\n * Playground relation widget -- an app-level form widget that renders the\n * `__rel_*` relation fields produced by the library's schema enrichment.\n *\n * This is the playground's analog of the explorer's `cypher-select` widget: the\n * library emits the relation field schema/uiSchema (with `x-ui-widget:\n * \"entity-select\"` and `x-ui-options.targetType`), and the consuming app\n * supplies the actual widget via the form widget registry. Here the options are\n * resolved synchronously from the in-memory store; the explorer resolves them\n * via Cypher. This demonstrates the \"widget stays app-level\" seam.\n */\n\nimport React from \"react\";\nimport {\n FormSelect,\n FormMultiSelect,\n type WidgetProps,\n} from \"@petrarca/sonnet-forms\";\nimport { extractDisplayLabel } from \"@petrarca/sonnet-graph\";\nimport type { GraphStore } from \"./inMemoryGraphEditing\";\n\ninterface RelationOption {\n value: string;\n label: string;\n}\n\n// Options for a target node-type label: every node of that label as {id, name}.\nfunction optionsForType(\n store: GraphStore,\n targetType: string,\n): RelationOption[] {\n return store.nodes\n .filter((n) => n.label_ === targetType && n.id_ != null)\n .map((n) => ({ value: String(n.id_), label: extractDisplayLabel(n) }));\n}\n\nfunction toStringArray(value: unknown): string[] {\n if (Array.isArray(value)) return value.map(String);\n if (value == null || value === \"\") return [];\n return [String(value)];\n}\n\n/**\n * Build the relation widget bound to a store. Registered under \"entity-select\"\n * (the library's default relation widget hint) so the enriched `__rel_*` fields\n * resolve to it.\n */\nexport function createRelationWidget(store: GraphStore) {\n return function RelationWidget({\n value,\n onChange,\n label,\n options,\n placeholder,\n }: WidgetProps): React.ReactElement {\n const targetType = String(options?.targetType ?? \"\");\n const multiple = options?.multiple !== false;\n const selectOptions = optionsForType(store, targetType);\n\n if (multiple) {\n return (\n <FormMultiSelect\n label={label || false}\n options={selectOptions}\n value={toStringArray(value)}\n onChange={(v) => onChange(v)}\n placeholder={placeholder ?? `Select ${targetType}...`}\n />\n );\n }\n\n const single = toStringArray(value)[0] ?? null;\n return (\n <FormSelect\n label={label || false}\n options={selectOptions}\n value={single}\n onChange={(v) => onChange(v ?? \"\")}\n placeholder={placeholder ?? `Select ${targetType}...`}\n />\n );\n };\n}\n"],"mappings":";AASA,S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WAAU,sCAAqC,gCAErD;AAAA,WACF;AAAA,QACC,cACC,gBAAAA,KAAC,SAAM,SAAQ,eACb,0BAAAA,KAAC,oBAAkB,sBAAW,GAChC;AAAA,QAEF,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU,CAAC,MAAM,YAAY,EAAE,OAAO,KAAK;AAAA,YAC3C,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,WAAU;AAAA;AAAA,QACZ;AAAA,SACF,GACF;AAAA,MAEA,gBAAAA,KAAC,eAAY,OAAM,SAAQ,WAAU,QACnC,0BAAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,WAAW;AAAA,UAClB,UAAU,WAAW;AAAA,UACrB,UAAU,WAAW;AAAA,UACrB,cAAc,WAAW;AAAA;AAAA,MAC3B,GACF;AAAA,MAEA,gBAAAA,KAAC,eAAY,OAAM,cAAa,WAAU,QACxC,0BAAAA,KAAC,gBAAa,OAAO,YAAY,SAAS,kBAAkB,GAC9D;AAAA,MAEA,gBAAAA,KAAC,eAAY,OAAM,sBAAqB,WAAU,QAChD,0BAAAA,KAAC,mBAAgB,QAAQ,YAAY,SAAS,eAAe,GAC/D;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["FormSelect","jsx"]}
@@ -0,0 +1,191 @@
1
+ // src/pages/PlaySchemaDesigner.tsx
2
+ import { useState } from "react";
3
+ import {
4
+ SchemaDesigner
5
+ } from "@petrarca/sonnet-schema-designer";
6
+ import { FormSelect } from "@petrarca/sonnet-forms";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var SAMPLE_SCHEMA = {
9
+ title: "Patient",
10
+ type: "object",
11
+ properties: {
12
+ first_name: { type: "string", title: "First name", minLength: 1 },
13
+ last_name: { type: "string", title: "Last name", minLength: 1 },
14
+ date_of_birth: { type: "string", format: "date", title: "Date of birth" },
15
+ gender: {
16
+ type: "string",
17
+ title: "Gender",
18
+ enum: ["male", "female", "other", "unknown"]
19
+ },
20
+ active: { type: "boolean", title: "Active" },
21
+ contact: {
22
+ type: "object",
23
+ title: "Contact",
24
+ properties: {
25
+ email: { type: "string", format: "email", title: "Email" },
26
+ phone: { type: "string", title: "Phone" }
27
+ },
28
+ required: ["email"]
29
+ },
30
+ addresses: {
31
+ type: "array",
32
+ title: "Addresses",
33
+ minItems: 1,
34
+ maxItems: 3,
35
+ items: {
36
+ type: "object",
37
+ properties: {
38
+ street: { type: "string", title: "Street" },
39
+ city: { type: "string", title: "City" },
40
+ zip: { type: "string", title: "ZIP" },
41
+ country: { type: "string", title: "Country" }
42
+ },
43
+ required: ["street", "city"]
44
+ }
45
+ }
46
+ },
47
+ required: ["first_name", "last_name"]
48
+ };
49
+ var AUDIT_SCHEMA = {
50
+ title: "AuditEvent",
51
+ type: "object",
52
+ properties: {
53
+ actor: {
54
+ type: "object",
55
+ title: "Actor",
56
+ properties: {
57
+ type: { type: "string", title: "Type" },
58
+ id: { type: "string", title: "ID" },
59
+ metadata: {
60
+ type: "object",
61
+ title: "Actor metadata",
62
+ properties: { role: { type: "string", title: "Role" } }
63
+ }
64
+ }
65
+ },
66
+ targets: {
67
+ type: "array",
68
+ title: "Targets",
69
+ items: {
70
+ type: "object",
71
+ properties: {
72
+ type: { type: "string", title: "Type" },
73
+ id: { type: "string", title: "ID" },
74
+ metadata: {
75
+ type: "object",
76
+ title: "Target metadata",
77
+ properties: { ward: { type: "string", title: "Ward" } }
78
+ }
79
+ }
80
+ }
81
+ },
82
+ metadata: {
83
+ type: "object",
84
+ title: "Metadata",
85
+ properties: { reason: { type: "string", title: "Reason" } }
86
+ }
87
+ }
88
+ };
89
+ var AUDIT_EDITABLE_PATHS = [
90
+ "/properties/metadata/properties",
91
+ "/properties/actor/properties/metadata/properties",
92
+ "/properties/targets/items/properties/metadata/properties"
93
+ ];
94
+ var PROFILES = {
95
+ full: {
96
+ label: "Full (schema + uiSchema)",
97
+ description: "Default: author the schema and its form presentation hints.",
98
+ schema: SAMPLE_SCHEMA,
99
+ capabilities: { previews: ["form", "table", "json", "capabilities"] }
100
+ },
101
+ data: {
102
+ label: "Data schema only",
103
+ description: "Pure JSON Schema (audit, terminology): no UI/Combined tabs, JSON preview only.",
104
+ schema: SAMPLE_SCHEMA,
105
+ capabilities: { mode: "data", previews: ["json", "capabilities"] }
106
+ },
107
+ scoped: {
108
+ label: "Scoped (audit event)",
109
+ description: "Fixed envelope; only the three metadata containers are editable.",
110
+ schema: AUDIT_SCHEMA,
111
+ capabilities: {
112
+ mode: "data",
113
+ editablePaths: AUDIT_EDITABLE_PATHS,
114
+ previews: ["json", "capabilities"]
115
+ }
116
+ },
117
+ structure: {
118
+ label: "Structure only (no preview)",
119
+ description: "Tree + inspector only; the center preview pane is hidden.",
120
+ schema: SAMPLE_SCHEMA,
121
+ capabilities: { mode: "data", previews: [] }
122
+ },
123
+ readonly: {
124
+ label: "Read-only",
125
+ description: "Fully locked -- view only, no edit affordances.",
126
+ schema: SAMPLE_SCHEMA,
127
+ readOnly: true,
128
+ capabilities: { previews: ["form", "table", "json", "capabilities"] }
129
+ }
130
+ };
131
+ function PlaySchemaDesigner() {
132
+ const [profileKey, setProfileKey] = useState("full");
133
+ const profile = PROFILES[profileKey];
134
+ const [schema, setSchema] = useState(profile.schema);
135
+ const [uiSchema, setUiSchema] = useState({});
136
+ const selectProfile = (key) => {
137
+ setProfileKey(key);
138
+ setSchema(PROFILES[key].schema);
139
+ setUiSchema({});
140
+ };
141
+ return /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col gap-3 h-[calc(100vh-8rem)]", children: [
142
+ /* @__PURE__ */ jsxs("div", { children: [
143
+ /* @__PURE__ */ jsx("h1", { children: "Schema Designer" }),
144
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-3", children: "Visually author a JSON Schema and its UI presentation hints. Edits flow through onChange as a valid schema + uiSchema." })
145
+ ] }),
146
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
147
+ /* @__PURE__ */ jsx(
148
+ "label",
149
+ {
150
+ htmlFor: "capability-profile",
151
+ className: "shrink-0 text-sm font-medium",
152
+ children: "Capability profile"
153
+ }
154
+ ),
155
+ /* @__PURE__ */ jsx("div", { className: "w-72", children: /* @__PURE__ */ jsx(
156
+ FormSelect,
157
+ {
158
+ id: "capability-profile",
159
+ name: "profile",
160
+ value: profileKey,
161
+ options: Object.keys(PROFILES).map((k) => ({
162
+ value: k,
163
+ label: PROFILES[k].label
164
+ })),
165
+ onChange: (v) => selectProfile(v ?? "full"),
166
+ clearable: false
167
+ }
168
+ ) }),
169
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: profile.description })
170
+ ] }),
171
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsx(
172
+ SchemaDesigner,
173
+ {
174
+ schema,
175
+ uiSchema,
176
+ capabilities: profile.capabilities,
177
+ readOnly: profile.readOnly,
178
+ onChange: (nextSchema, nextUiSchema) => {
179
+ setSchema(nextSchema);
180
+ setUiSchema(nextUiSchema);
181
+ }
182
+ },
183
+ profileKey
184
+ ) })
185
+ ] });
186
+ }
187
+
188
+ export {
189
+ PlaySchemaDesigner
190
+ };
191
+ //# sourceMappingURL=chunk-PBT6HTKY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pages/PlaySchemaDesigner.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport {\n SchemaDesigner,\n type SchemaDesignerCapabilities,\n} from \"@petrarca/sonnet-schema-designer\";\nimport { FormSelect } from \"@petrarca/sonnet-forms\";\nimport type { JsonSchema, UISchema } from \"@petrarca/sonnet-core/schema\";\n\nconst SAMPLE_SCHEMA: JsonSchema = {\n title: \"Patient\",\n type: \"object\",\n properties: {\n first_name: { type: \"string\", title: \"First name\", minLength: 1 },\n last_name: { type: \"string\", title: \"Last name\", minLength: 1 },\n date_of_birth: { type: \"string\", format: \"date\", title: \"Date of birth\" },\n gender: {\n type: \"string\",\n title: \"Gender\",\n enum: [\"male\", \"female\", \"other\", \"unknown\"],\n },\n active: { type: \"boolean\", title: \"Active\" },\n contact: {\n type: \"object\",\n title: \"Contact\",\n properties: {\n email: { type: \"string\", format: \"email\", title: \"Email\" },\n phone: { type: \"string\", title: \"Phone\" },\n },\n required: [\"email\"],\n },\n addresses: {\n type: \"array\",\n title: \"Addresses\",\n minItems: 1,\n maxItems: 3,\n items: {\n type: \"object\",\n properties: {\n street: { type: \"string\", title: \"Street\" },\n city: { type: \"string\", title: \"City\" },\n zip: { type: \"string\", title: \"ZIP\" },\n country: { type: \"string\", title: \"Country\" },\n },\n required: [\"street\", \"city\"],\n },\n },\n },\n required: [\"first_name\", \"last_name\"],\n};\n\n// An audit-event-like schema: a fixed envelope (actor, targets) with three\n// extensible metadata containers. Used to demo scoped editing.\nconst AUDIT_SCHEMA: JsonSchema = {\n title: \"AuditEvent\",\n type: \"object\",\n properties: {\n actor: {\n type: \"object\",\n title: \"Actor\",\n properties: {\n type: { type: \"string\", title: \"Type\" },\n id: { type: \"string\", title: \"ID\" },\n metadata: {\n type: \"object\",\n title: \"Actor metadata\",\n properties: { role: { type: \"string\", title: \"Role\" } },\n },\n },\n },\n targets: {\n type: \"array\",\n title: \"Targets\",\n items: {\n type: \"object\",\n properties: {\n type: { type: \"string\", title: \"Type\" },\n id: { type: \"string\", title: \"ID\" },\n metadata: {\n type: \"object\",\n title: \"Target metadata\",\n properties: { ward: { type: \"string\", title: \"Ward\" } },\n },\n },\n },\n },\n metadata: {\n type: \"object\",\n title: \"Metadata\",\n properties: { reason: { type: \"string\", title: \"Reason\" } },\n },\n },\n};\n\nconst AUDIT_EDITABLE_PATHS = [\n \"/properties/metadata/properties\",\n \"/properties/actor/properties/metadata/properties\",\n \"/properties/targets/items/properties/metadata/properties\",\n];\n\ntype ProfileKey = \"full\" | \"data\" | \"scoped\" | \"structure\" | \"readonly\";\n\ninterface Profile {\n label: string;\n description: string;\n schema: JsonSchema;\n capabilities?: SchemaDesignerCapabilities;\n readOnly?: boolean;\n}\n\nconst PROFILES: Record<ProfileKey, Profile> = {\n full: {\n label: \"Full (schema + uiSchema)\",\n description: \"Default: author the schema and its form presentation hints.\",\n schema: SAMPLE_SCHEMA,\n capabilities: { previews: [\"form\", \"table\", \"json\", \"capabilities\"] },\n },\n data: {\n label: \"Data schema only\",\n description:\n \"Pure JSON Schema (audit, terminology): no UI/Combined tabs, JSON preview only.\",\n schema: SAMPLE_SCHEMA,\n capabilities: { mode: \"data\", previews: [\"json\", \"capabilities\"] },\n },\n scoped: {\n label: \"Scoped (audit event)\",\n description:\n \"Fixed envelope; only the three metadata containers are editable.\",\n schema: AUDIT_SCHEMA,\n capabilities: {\n mode: \"data\",\n editablePaths: AUDIT_EDITABLE_PATHS,\n previews: [\"json\", \"capabilities\"],\n },\n },\n structure: {\n label: \"Structure only (no preview)\",\n description: \"Tree + inspector only; the center preview pane is hidden.\",\n schema: SAMPLE_SCHEMA,\n capabilities: { mode: \"data\", previews: [] },\n },\n readonly: {\n label: \"Read-only\",\n description: \"Fully locked -- view only, no edit affordances.\",\n schema: SAMPLE_SCHEMA,\n readOnly: true,\n capabilities: { previews: [\"form\", \"table\", \"json\", \"capabilities\"] },\n },\n};\n\n/**\n * PlaySchemaDesigner -- exercises SchemaDesigner: visually author a JsonSchema\n * (and its uiSchema presentation hints), with a live preview. The profile\n * switcher presets the capability profile (data/full triage, scoped editing,\n * read-only); the in-designer Capabilities tab tweaks it live.\n */\nexport default function PlaySchemaDesigner() {\n const [profileKey, setProfileKey] = useState<ProfileKey>(\"full\");\n const profile = PROFILES[profileKey];\n\n const [schema, setSchema] = useState<JsonSchema>(profile.schema);\n const [uiSchema, setUiSchema] = useState<Record<string, UISchema>>({});\n\n const selectProfile = (key: ProfileKey) => {\n setProfileKey(key);\n setSchema(PROFILES[key].schema);\n setUiSchema({});\n };\n\n return (\n <div className=\"w-full flex flex-col gap-3 h-[calc(100vh-8rem)]\">\n <div>\n <h1>Schema Designer</h1>\n <p className=\"text-sm text-muted-foreground mb-3\">\n Visually author a JSON Schema and its UI presentation hints. Edits\n flow through onChange as a valid schema + uiSchema.\n </p>\n </div>\n\n <div className=\"flex items-center gap-3\">\n <label\n htmlFor=\"capability-profile\"\n className=\"shrink-0 text-sm font-medium\"\n >\n Capability profile\n </label>\n <div className=\"w-72\">\n <FormSelect\n id=\"capability-profile\"\n name=\"profile\"\n value={profileKey}\n options={(Object.keys(PROFILES) as ProfileKey[]).map((k) => ({\n value: k,\n label: PROFILES[k].label,\n }))}\n onChange={(v) => selectProfile((v as ProfileKey) ?? \"full\")}\n clearable={false}\n />\n </div>\n <p className=\"text-sm text-muted-foreground\">{profile.description}</p>\n </div>\n\n <div style={{ flex: 1, minHeight: 0 }}>\n <SchemaDesigner\n key={profileKey}\n schema={schema}\n uiSchema={uiSchema}\n capabilities={profile.capabilities}\n readOnly={profile.readOnly}\n onChange={(nextSchema, nextUiSchema) => {\n setSchema(nextSchema);\n setUiSchema(nextUiSchema);\n }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,OAEK;AACP,SAAS,kBAAkB;AAqKrB,SACE,KADF;AAlKN,IAAM,gBAA4B;AAAA,EAChC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,YAAY;AAAA,IACV,YAAY,EAAE,MAAM,UAAU,OAAO,cAAc,WAAW,EAAE;AAAA,IAChE,WAAW,EAAE,MAAM,UAAU,OAAO,aAAa,WAAW,EAAE;AAAA,IAC9D,eAAe,EAAE,MAAM,UAAU,QAAQ,QAAQ,OAAO,gBAAgB;AAAA,IACxE,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAM,CAAC,QAAQ,UAAU,SAAS,SAAS;AAAA,IAC7C;AAAA,IACA,QAAQ,EAAE,MAAM,WAAW,OAAO,SAAS;AAAA,IAC3C,SAAS;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,QACV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ner";
8
8
  import {
9
9
  Spinner,
10
10
  Button,
11
+ IconButton,
11
12
  Badge,
12
13
  Alert,
13
14
  AlertDescription,
@@ -40,7 +41,15 @@ import {
40
41
  DialogTrigger
41
42
  } from "@petrarca/sonnet-ui";
42
43
  import { useClipboard, useDisclosure } from "@petrarca/sonnet-core/hooks";
43
- import { Info, AlertTriangle, CheckCircle } from "lucide-react";
44
+ import {
45
+ Info,
46
+ AlertTriangle,
47
+ CheckCircle,
48
+ Pencil,
49
+ Trash2,
50
+ Plus,
51
+ Copy
52
+ } from "lucide-react";
44
53
  import { jsx, jsxs } from "react/jsx-runtime";
45
54
  function PlayCoreComponents() {
46
55
  const [spinnerSize, setSpinnerSize] = useState("md");
@@ -91,6 +100,48 @@ function PlayCoreComponents() {
91
100
  ] })
92
101
  }
93
102
  ),
103
+ /* @__PURE__ */ jsx(
104
+ PlaygroundSection,
105
+ {
106
+ title: "Icon Button",
107
+ description: "Compact, square icon-only button with tooltip + accessible label. The house standard for inline affordances (edit/delete) and small toolbar actions.",
108
+ variant: "card",
109
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
110
+ /* @__PURE__ */ jsxs("div", { children: [
111
+ /* @__PURE__ */ jsx("h4", { className: "mb-3", children: "Ghost (inline affordances)" }),
112
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
113
+ /* @__PURE__ */ jsx(IconButton, { label: "Edit", children: /* @__PURE__ */ jsx(Pencil, {}) }),
114
+ /* @__PURE__ */ jsx(IconButton, { label: "Delete", tone: "destructive", children: /* @__PURE__ */ jsx(Trash2, {}) }),
115
+ /* @__PURE__ */ jsx(IconButton, { label: "Copy", children: /* @__PURE__ */ jsx(Copy, {}) })
116
+ ] })
117
+ ] }),
118
+ /* @__PURE__ */ jsx(Separator, {}),
119
+ /* @__PURE__ */ jsxs("div", { children: [
120
+ /* @__PURE__ */ jsx("h4", { className: "mb-3", children: "Outline (toolbar actions)" }),
121
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
122
+ /* @__PURE__ */ jsx(IconButton, { label: "Add node type", variant: "outline", children: /* @__PURE__ */ jsx(Plus, {}) }),
123
+ /* @__PURE__ */ jsx(
124
+ IconButton,
125
+ {
126
+ label: "Delete (outline)",
127
+ variant: "outline",
128
+ tone: "destructive",
129
+ children: /* @__PURE__ */ jsx(Trash2, {})
130
+ }
131
+ )
132
+ ] })
133
+ ] }),
134
+ /* @__PURE__ */ jsx(Separator, {}),
135
+ /* @__PURE__ */ jsxs("div", { children: [
136
+ /* @__PURE__ */ jsx("h4", { className: "mb-3", children: "Disabled" }),
137
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
138
+ /* @__PURE__ */ jsx(IconButton, { label: "Edit (disabled)", disabled: true, children: /* @__PURE__ */ jsx(Pencil, {}) }),
139
+ /* @__PURE__ */ jsx(IconButton, { label: "Add (disabled)", variant: "outline", disabled: true, children: /* @__PURE__ */ jsx(Plus, {}) })
140
+ ] })
141
+ ] })
142
+ ] })
143
+ }
144
+ ),
94
145
  /* @__PURE__ */ jsx(
95
146
  PlaygroundSection,
96
147
  {
@@ -931,4 +982,4 @@ function PlayCoreComponents() {
931
982
  export {
932
983
  PlayCoreComponents
933
984
  };
934
- //# sourceMappingURL=chunk-YOOWJORD.js.map
985
+ //# sourceMappingURL=chunk-Q6NLY2BZ.js.map