@petrarca/sonnet-playground 0.8.0 → 0.9.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.
- package/README.md +10 -8
- package/dist/{PlayAdvancedComponents-ZYK66UII.js → PlayAdvancedComponents-VMUI472R.js} +2 -2
- package/dist/PlayCodeEditor-AMTFE5SW.js +8 -0
- package/dist/PlayCodedValues-G2EVIVMO.js +9 -0
- package/dist/{PlayCoreComponents-YTEAS3GL.js → PlayCoreComponents-EQ2BMY2S.js} +2 -2
- package/dist/{PlayDataComponents-W44OITT5.js → PlayDataComponents-W2KQHOI7.js} +2 -2
- package/dist/PlayFhirQuestionnaire-TO35Q7CP.js +8 -0
- package/dist/{PlayFormWidgets-6JYFRTAL.js → PlayFormWidgets-HP3VF2LK.js} +2 -2
- package/dist/PlayForms-4CQNEBLS.js +7 -0
- package/dist/PlayGraph-25ZKQAQR.js +7 -0
- package/dist/PlayGraph-25ZKQAQR.js.map +1 -0
- package/dist/PlayMarkdownViewer-X6AIFO2U.js +8 -0
- package/dist/PlayMarkdownViewer-X6AIFO2U.js.map +1 -0
- package/dist/PlayQuestionnaireDesigner-IR7TKSOT.js +9 -0
- package/dist/PlayQuestionnaireDesigner-IR7TKSOT.js.map +1 -0
- package/dist/PlaySchemaDesigner-ZQBA7AYO.js +8 -0
- package/dist/PlaySchemaDesigner-ZQBA7AYO.js.map +1 -0
- package/dist/{PlayShellApi-5O6VYR2X.js → PlayShellApi-MMCQ2AKK.js} +2 -2
- package/dist/PlayShellApi-MMCQ2AKK.js.map +1 -0
- package/dist/chunk-3FYM6B3E.js +1163 -0
- package/dist/chunk-3FYM6B3E.js.map +1 -0
- package/dist/{chunk-CQ6PGFRV.js → chunk-3RZHYZRL.js} +57 -1
- package/dist/chunk-3RZHYZRL.js.map +1 -0
- package/dist/chunk-7IMCPUSI.js +100 -0
- package/dist/chunk-7IMCPUSI.js.map +1 -0
- package/dist/{chunk-2XMWOZ5O.js → chunk-EPCUUTBZ.js} +48 -41
- package/dist/chunk-EPCUUTBZ.js.map +1 -0
- package/dist/{chunk-BRH3FFFT.js → chunk-LDCNLHO2.js} +15 -1
- package/dist/chunk-LDCNLHO2.js.map +1 -0
- package/dist/chunk-LVV32F7G.js +104 -0
- package/dist/chunk-LVV32F7G.js.map +1 -0
- package/dist/chunk-OUL3DN2E.js +510 -0
- package/dist/chunk-OUL3DN2E.js.map +1 -0
- package/dist/chunk-QKFQI4VX.js +83 -0
- package/dist/chunk-QKFQI4VX.js.map +1 -0
- package/dist/{chunk-6WI3N7JI.js → chunk-RGBSHXS5.js} +145 -4
- package/dist/chunk-RGBSHXS5.js.map +1 -0
- package/dist/{chunk-UB7462QG.js → chunk-RLJI5VMP.js} +72 -1
- package/dist/chunk-RLJI5VMP.js.map +1 -0
- package/dist/chunk-VGAS5Z6X.js +543 -0
- package/dist/chunk-VGAS5Z6X.js.map +1 -0
- package/dist/chunk-VKZ2RJFL.js +647 -0
- package/dist/chunk-VKZ2RJFL.js.map +1 -0
- package/dist/chunk-WR74TMW4.js +219 -0
- package/dist/chunk-WR74TMW4.js.map +1 -0
- package/dist/{chunk-E5X7GVLU.js → chunk-XNDD4UN4.js} +2 -2
- package/dist/chunk-XNDD4UN4.js.map +1 -0
- package/dist/chunk-YTGQRDD2.js +343 -0
- package/dist/chunk-YTGQRDD2.js.map +1 -0
- package/dist/index.d.ts +13 -10
- package/dist/index.js +72 -11
- package/dist/index.js.map +1 -1
- package/dist/pages/index.d.ts +56 -20
- package/dist/pages/index.js +39 -17
- package/package.json +15 -14
- package/dist/PlayForms-U2TWUX5L.js +0 -7
- package/dist/PlayGraph-M4KQSFI7.js +0 -7
- package/dist/PlaySchemaDesigner-S4DBB53G.js +0 -7
- package/dist/chunk-2XMWOZ5O.js.map +0 -1
- package/dist/chunk-4Y4JFKAK.js +0 -240
- package/dist/chunk-4Y4JFKAK.js.map +0 -1
- package/dist/chunk-6WI3N7JI.js.map +0 -1
- package/dist/chunk-BRH3FFFT.js.map +0 -1
- package/dist/chunk-CQ6PGFRV.js.map +0 -1
- package/dist/chunk-E5X7GVLU.js.map +0 -1
- package/dist/chunk-O2QMWJZI.js +0 -881
- package/dist/chunk-O2QMWJZI.js.map +0 -1
- package/dist/chunk-UB7462QG.js.map +0 -1
- /package/dist/{PlayAdvancedComponents-ZYK66UII.js.map → PlayAdvancedComponents-VMUI472R.js.map} +0 -0
- /package/dist/{PlayCoreComponents-YTEAS3GL.js.map → PlayCodeEditor-AMTFE5SW.js.map} +0 -0
- /package/dist/{PlayDataComponents-W44OITT5.js.map → PlayCodedValues-G2EVIVMO.js.map} +0 -0
- /package/dist/{PlayFormWidgets-6JYFRTAL.js.map → PlayCoreComponents-EQ2BMY2S.js.map} +0 -0
- /package/dist/{PlayForms-U2TWUX5L.js.map → PlayDataComponents-W2KQHOI7.js.map} +0 -0
- /package/dist/{PlayGraph-M4KQSFI7.js.map → PlayFhirQuestionnaire-TO35Q7CP.js.map} +0 -0
- /package/dist/{PlaySchemaDesigner-S4DBB53G.js.map → PlayFormWidgets-HP3VF2LK.js.map} +0 -0
- /package/dist/{PlayShellApi-5O6VYR2X.js.map → PlayForms-4CQNEBLS.js.map} +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/PlaygroundRegistry.ts","../src/builtinEntries.ts","../src/createPlaygroundModule.tsx","../src/PlaygroundOverview.tsx","../src/PlaygroundSettingsPanel.tsx","../src/PlaygroundSettings.tsx","../src/index.ts"],"sourcesContent":["/**\n * PlaygroundRegistry -- mutable collection of playground entries.\n *\n * The library ships a default instance pre-populated with the built-in\n * sonnet component demos. Consumers register additional entries for\n * domain-specific playgrounds before passing the registry to\n * createPlaygroundModule().\n */\nimport { warnLog } from \"@petrarca/sonnet-core\";\nimport type { PlaygroundEntry } from \"./types\";\n\nexport class PlaygroundRegistry {\n private entries: Map<string, PlaygroundEntry> = new Map();\n\n /**\n * Report registrations that cannot work, rather than silently misbehaving.\n *\n * Entries are keyed by `id`, so two entries may legally share a `path` --\n * and then both produce a route on the same URL and one is unreachable.\n * Groups are bucketed by their exact label, so two labels differing only by\n * case become two separate groups.\n *\n * Neither is corrected here: dropping an entry, or merging groups the caller\n * spelled differently, would be its own surprise. The registration stands and\n * the problem is made diagnosable.\n */\n private warnOnConflicts(entry: PlaygroundEntry): void {\n for (const existing of this.entries.values()) {\n if (existing.id === entry.id) continue;\n\n if (existing.path === entry.path) {\n warnLog(\n `[PlaygroundRegistry] entries \"${existing.id}\" and \"${entry.id}\" share the path \"${entry.path}\". Both will route to the same URL and one will be unreachable.`,\n );\n }\n\n const group = entry.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n const existingGroup = existing.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n if (\n group !== existingGroup &&\n group.toLowerCase() === existingGroup.toLowerCase()\n ) {\n warnLog(\n `[PlaygroundRegistry] group \"${group}\" differs from \"${existingGroup}\" only by case; they will render as two separate groups.`,\n );\n }\n }\n }\n\n /** Register a playground entry. Overwrites any existing entry with the same id. */\n register(entry: PlaygroundEntry): void {\n this.warnOnConflicts(entry);\n this.entries.set(entry.id, entry);\n }\n\n /** Register multiple entries at once. */\n registerAll(entries: PlaygroundEntry[]): void {\n for (const entry of entries) {\n this.register(entry);\n }\n }\n\n /** Remove an entry by id. Returns true if it existed. */\n unregister(id: string): boolean {\n return this.entries.delete(id);\n }\n\n /** Get a single entry by id. */\n get(id: string): PlaygroundEntry | undefined {\n return this.entries.get(id);\n }\n\n /** Fallback group label for entries with no group defined. */\n static readonly DEFAULT_GROUP = \"General\";\n\n /**\n * All registered entries, sorted by group registration order then\n * by `order` within each group.\n */\n getAll(): PlaygroundEntry[] {\n const groupOrder = this.getGroupOrder();\n return [...this.entries.values()].sort((a, b) => {\n const groupA = a.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n const groupB = b.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n if (groupA !== groupB) {\n return (\n (groupOrder.get(groupA) ?? 999) - (groupOrder.get(groupB) ?? 999)\n );\n }\n return (a.order ?? 0) - (b.order ?? 0);\n });\n }\n\n /**\n * Entries grouped by their group label.\n * Returns an array of [groupLabel, entries[]] tuples, preserving\n * first-seen registration order for groups and `order` within each group.\n */\n getGrouped(): Array<[string, PlaygroundEntry[]]> {\n const grouped = new Map<string, PlaygroundEntry[]>();\n for (const entry of this.getAll()) {\n const group = entry.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n const list = grouped.get(group) ?? [];\n list.push(entry);\n grouped.set(group, list);\n }\n return [...grouped.entries()];\n }\n\n /** Map of group name → first-seen index (registration order). */\n private getGroupOrder(): Map<string, number> {\n const order = new Map<string, number>();\n let idx = 0;\n for (const entry of this.entries.values()) {\n const group = entry.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n if (!order.has(group)) {\n order.set(group, idx++);\n }\n }\n return order;\n }\n\n /** Number of registered entries. */\n get size(): number {\n return this.entries.size;\n }\n}\n","/**\n * Built-in playground entries for the sonnet component library.\n *\n * These entries demonstrate @petrarca/sonnet-* components with static\n * mock data -- no application backend required. Each page is lazy-loaded.\n */\nimport { lazy } from \"react\";\nimport {\n Type,\n Palette,\n Grid,\n Layers,\n Braces,\n Check,\n Edit,\n Package,\n Table2,\n Network,\n SquareTerminal,\n PencilRuler,\n ShieldCheck,\n} from \"lucide-react\";\nimport type { PlaygroundEntry } from \"./types\";\n\nexport const builtinEntries: PlaygroundEntry[] = [\n {\n id: \"sonnet.typography\",\n title: \"Typography\",\n description:\n \"Living style-guide for the typography system. Font families, type scale, weights, heading hierarchy, color tiers, and component patterns.\",\n icon: Type,\n color: \"teal\",\n path: \"typography\",\n component: lazy(() => import(\"./pages/PlayTypography\")),\n group: \"Design System\",\n order: 0,\n },\n {\n id: \"sonnet.color-palette\",\n title: \"Color Palette\",\n description:\n \"Living reference for the color system. Semantic tokens, extended palette, badge colors, icon accents, and usage guidance.\",\n icon: Palette,\n color: \"violet\",\n path: \"color-palette\",\n component: lazy(() => import(\"./pages/PlayColorPalette\")),\n group: \"Design System\",\n order: 1,\n },\n {\n id: \"sonnet.core-components\",\n title: \"Core UI Components\",\n description:\n \"Test all core UI components (notifications, buttons, dialogs, forms, etc.) in isolation before production use.\",\n icon: Grid,\n color: \"indigo\",\n path: \"core-components\",\n component: lazy(() => import(\"./pages/PlayCoreComponents\")),\n group: \"Components\",\n order: 0,\n },\n {\n id: \"sonnet.advanced-components\",\n title: \"Advanced Components\",\n description:\n \"Multi-step workflows (Stepper) and hierarchical data structures (TreeView) with keyboard navigation and selection.\",\n icon: Layers,\n color: \"emerald\",\n path: \"advanced-components\",\n component: lazy(() => import(\"./pages/PlayAdvancedComponents\")),\n group: \"Components\",\n order: 1,\n },\n {\n id: \"sonnet.json-editor\",\n title: \"JSON Editor\",\n description:\n \"Constrained JSON editor with selectively editable regions using JSON Pointer (RFC 6901). Readonly sections are visible but locked.\",\n icon: Braces,\n color: \"amber\",\n path: \"json-editor\",\n component: lazy(() => import(\"./pages/PlayJsonEditor\")),\n group: \"Components\",\n order: 2,\n },\n {\n id: \"sonnet.form-components\",\n title: \"Form Components\",\n description:\n \"Test custom Form wrapper components with labels, descriptions, and error states. Includes Input, Textarea, Number, Checkbox, Select, MultiSelect, and Tags.\",\n icon: Check,\n color: \"blue\",\n path: \"form-components\",\n component: lazy(() => import(\"./pages/PlayFormComponents\")),\n group: \"Forms\",\n order: 0,\n },\n {\n id: \"sonnet.forms\",\n title: \"Forms Renderer\",\n description:\n \"Test and experiment with the JsonSchemaFormRenderer component. Try different schemas and see real-time validation.\",\n icon: Edit,\n color: \"purple\",\n path: \"forms\",\n component: lazy(() => import(\"./pages/PlayForms\")),\n group: \"Forms\",\n order: 1,\n },\n {\n id: \"sonnet.form-widgets\",\n title: \"Form Widgets\",\n description:\n \"Pluggable field components consumed by the Forms Renderer. Each widget maps to a JSON Schema type or format and can be swapped independently.\",\n icon: Package,\n color: \"indigo\",\n path: \"form-widgets\",\n component: lazy(() => import(\"./pages/PlayFormWidgets\")),\n group: \"Forms\",\n order: 2,\n },\n {\n id: \"sonnet.schema-designer\",\n title: \"Schema Designer\",\n description:\n \"Visually author a JSON Schema and its UI presentation hints. Field tree, inspector, and live preview; edits emit a valid schema + uiSchema.\",\n icon: PencilRuler,\n color: \"teal\",\n path: \"schema-designer\",\n component: lazy(() => import(\"./pages/PlaySchemaDesigner\")),\n group: \"Schemas\",\n order: 0,\n },\n {\n id: \"sonnet.data-components\",\n title: \"Data Components\",\n description:\n \"Interactive sandbox for SearchInput (simple and faceted mode) and EntityTable. Includes a live table wired to the faceted search.\",\n icon: Table2,\n color: \"teal\",\n path: \"data-components\",\n component: lazy(() => import(\"./pages/PlayDataComponents\")),\n group: \"Data\",\n order: 0,\n },\n {\n id: \"sonnet.graph\",\n title: \"Graph Visualization\",\n description:\n \"Interactive property graph visualization with dual renderer support (Cytoscape, Reagraph). Org hierarchy demo with filtering, selection, and exploration.\",\n icon: Network,\n color: \"cyan\",\n path: \"graph\",\n component: lazy(() => import(\"./pages/PlayGraph\")),\n group: \"Graph\",\n order: 0,\n },\n {\n id: \"sonnet.shell-api\",\n title: \"Shell API\",\n description:\n \"Interactive demo of the shell API: notifications, dialogs, programmatic navigation, slide-over panels, the resizable sidePane, and the Cmd+K command menu.\",\n icon: SquareTerminal,\n color: \"orange\",\n path: \"shell-api\",\n component: lazy(() => import(\"./pages/PlayShellApi\")),\n group: \"Shell\",\n order: 0,\n },\n {\n id: \"sonnet.auth\",\n title: \"Auth Screens\",\n description:\n \"The pre-application login and organization selection screens: identifier-first and legacy flows, provider combinations, error and loading states, and every org-selection outcome.\",\n icon: ShieldCheck,\n color: \"teal\",\n path: \"auth\",\n component: lazy(() => import(\"./pages/PlayAuth\")),\n group: \"Shell\",\n order: 1,\n },\n];\n","/**\n * Factory that turns a PlaygroundRegistry into a ShellModule.\n *\n * Generates routes (lazy + Suspense), sidebar navigation, and the\n * overview index page -- all derived from the registry entries.\n * The consumer just passes a registry and optional overrides.\n */\nimport React, { Suspense } from \"react\";\nimport { Outlet } from \"react-router-dom\";\nimport { FlaskConical } from \"lucide-react\";\nimport type { ShellModule, NavGroup } from \"@petrarca/sonnet-shell\";\nimport type { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nimport type { PlaygroundModuleOptions } from \"./types\";\nimport { PlaygroundOverview } from \"./PlaygroundOverview\";\nimport { PlaygroundSettingsProvider } from \"./PlaygroundSettings\";\n\nfunction buildNavigation(\n registry: PlaygroundRegistry,\n basePath: string,\n): NavGroup[] {\n const groups = registry.getGrouped();\n const navGroups: NavGroup[] = [];\n\n navGroups.push({\n id: \"playground-overview\",\n links: [{ label: \"Overview\", path: basePath }],\n });\n\n for (const [groupLabel, entries] of groups) {\n navGroups.push({\n id: `playground-${groupLabel.toLowerCase().replace(/\\s+/g, \"-\")}`,\n heading: groupLabel,\n links: entries.map((e) => ({\n label: e.title,\n path: `${basePath}/${e.path}`,\n })),\n });\n }\n\n return navGroups;\n}\n\n// Wrap a component in Suspense for lazy loading.\nfunction suspended(Component: React.ComponentType): React.ReactElement {\n return (\n <Suspense>\n <Component />\n </Suspense>\n );\n}\n\n// Layout route element: a single PlaygroundSettingsProvider wrapping all\n// playground routes via <Outlet>. Mounted once, never torn down on navigation,\n// so settings state is stable across route changes within the playground.\nfunction PlaygroundLayout(): React.ReactElement {\n return (\n <PlaygroundSettingsProvider>\n <Outlet />\n </PlaygroundSettingsProvider>\n );\n}\n\nexport function createPlaygroundModule(\n registry: PlaygroundRegistry,\n options: PlaygroundModuleOptions = {},\n): ShellModule {\n const {\n icon = FlaskConical,\n label = \"Playground\",\n basePath = \"/playground\",\n overviewTitle = \"Developer Playground\",\n overviewSubtitle = \"Experiment with components, test features, and explore capabilities.\",\n grouped = true,\n } = options;\n\n const routeBase = basePath.replace(/^\\//, \"\");\n\n // A single layout route wraps all playground routes. The settings provider\n // lives here -- mounted once, alive for the full playground session.\n const routes = [\n {\n path: routeBase,\n element: <PlaygroundLayout />,\n children: [\n {\n index: true,\n element: suspended(() => (\n <PlaygroundOverview\n registry={registry}\n basePath={basePath}\n title={overviewTitle}\n subtitle={overviewSubtitle}\n grouped={grouped}\n />\n )),\n },\n ...registry.getAll().map((entry) => ({\n path: entry.path,\n element: suspended(entry.component),\n })),\n ],\n },\n ];\n\n return {\n id: \"playground\",\n label,\n icon,\n basePath,\n pinBottom: true,\n navigation: buildNavigation(registry, basePath),\n routes,\n };\n}\n","/**\n * PlaygroundOverview -- tile grid rendered from a PlaygroundRegistry.\n *\n * Displays cards with colored icons. Clicking a card navigates to the\n * playground page. A toggle in the header lets the user switch between\n * grouped (by category) and flat (all tiles) views.\n */\nimport React, { useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { LayoutGrid, List } from \"lucide-react\";\nimport { Card, Button, SimpleTooltip } from \"@petrarca/sonnet-ui\";\nimport type { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nimport type { PlaygroundColor, PlaygroundEntry } from \"./types\";\nimport { PlaygroundSettingsPanel } from \"./PlaygroundSettingsPanel\";\n\n// Maps colour name to icon container classes (bg-*-100 text-*-600 pairing).\nconst COLOR_CLASSES: Record<PlaygroundColor, string> = {\n blue: \"bg-blue-100 text-blue-600\",\n violet: \"bg-violet-100 text-violet-600\",\n indigo: \"bg-indigo-100 text-indigo-600\",\n purple: \"bg-purple-100 text-purple-600\",\n teal: \"bg-teal-100 text-teal-600\",\n amber: \"bg-amber-100 text-amber-600\",\n emerald: \"bg-emerald-100 text-emerald-600\",\n rose: \"bg-rose-100 text-rose-600\",\n orange: \"bg-orange-100 text-orange-600\",\n cyan: \"bg-cyan-100 text-cyan-600\",\n};\n\nconst TILE_GRID = \"grid grid-cols-1 sm:grid-cols-2 2xl:grid-cols-3 gap-6\";\n\ninterface PlaygroundOverviewProps {\n registry: PlaygroundRegistry;\n basePath: string;\n title: string;\n subtitle: string;\n /** Initial grouping state. Defaults to true. User can toggle at runtime. */\n grouped?: boolean;\n}\n\ninterface TileProps {\n item: PlaygroundEntry;\n onNavigate: (path: string) => void;\n}\n\n/** A single playground tile card. */\nfunction PlaygroundTile({ item, onNavigate }: TileProps): React.ReactElement {\n return (\n <Card\n className=\"cursor-pointer shadow-sm border rounded-md p-6 transition-transform duration-200 motion-safe:hover:-translate-y-1\"\n onClick={() => onNavigate(item.path)}\n >\n <div className=\"flex items-center mb-4\">\n <div\n className={`flex items-center justify-center w-9 h-9 rounded-md ${COLOR_CLASSES[item.color] ?? COLOR_CLASSES.blue}`}\n >\n <item.icon size={18} />\n </div>\n </div>\n <h3 className=\"heading-section mb-1\">{item.title}</h3>\n <p className=\"text-sm text-muted-foreground\">{item.description}</p>\n </Card>\n );\n}\n\n/** Developer playground overview -- card grid linking to all registered pages. */\nexport function PlaygroundOverview({\n registry,\n basePath,\n title,\n subtitle,\n grouped: initialGrouped = true,\n}: PlaygroundOverviewProps): React.ReactElement {\n const navigate = useNavigate();\n const [grouped, setGrouped] = useState(initialGrouped);\n\n const handleNavigate = (path: string) => navigate(`${basePath}/${path}`);\n\n return (\n <div className=\"w-full\">\n <div className=\"flex items-start justify-between mb-6\">\n <div>\n <h1 className=\"mb-1\">{title}</h1>\n <p className=\"text-sm text-muted-foreground\">{subtitle}</p>\n </div>\n <div className=\"flex items-center gap-1\">\n <SimpleTooltip\n label={grouped ? \"Show flat list\" : \"Group by category\"}\n >\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => setGrouped((v) => !v)}\n >\n {grouped ? (\n <LayoutGrid className=\"h-4 w-4\" />\n ) : (\n <List className=\"h-4 w-4\" />\n )}\n </Button>\n </SimpleTooltip>\n <PlaygroundSettingsPanel />\n </div>\n </div>\n\n {grouped ? (\n registry.getGrouped().map(([groupLabel, entries]) => (\n <div key={groupLabel} className=\"mb-8\">\n <h2 className=\"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4\">\n {groupLabel}\n </h2>\n <div className={TILE_GRID}>\n {entries.map((item) => (\n <PlaygroundTile\n key={item.id}\n item={item}\n onNavigate={handleNavigate}\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className={TILE_GRID}>\n {registry.getAll().map((item) => (\n <PlaygroundTile\n key={item.id}\n item={item}\n onNavigate={handleNavigate}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n","/**\n * PlaygroundSettingsPanel -- gear button that opens a right-side settings sheet.\n *\n * Hosts playground-wide settings (currently locale). Edits flow through\n * usePlaygroundSettings, which drives the SonnetConfigProvider wrapping all\n * playground routes.\n */\n\nimport React, { useState } from \"react\";\nimport { Settings } from \"lucide-react\";\nimport {\n IconButton,\n Label,\n Sheet,\n SheetContent,\n SheetHeader,\n SheetTitle,\n SheetDescription,\n SheetBody,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from \"@petrarca/sonnet-ui\";\nimport { usePlaygroundSettings } from \"./PlaygroundSettings\";\n\n// Locale choices for the playground. \"__inherit__\" uses the app/browser locale.\nconst INHERIT = \"__inherit__\";\nconst LOCALE_OPTIONS = [\n { code: INHERIT, label: \"Inherit (app / browser)\" },\n { code: \"en-US\", label: \"English (US) - MM/DD, Sun\" },\n { code: \"en-GB\", label: \"English (UK) - DD/MM, Mon\" },\n { code: \"de-DE\", label: \"German - DD.MM, Mon\" },\n { code: \"fr-FR\", label: \"French - DD/MM, Mon\" },\n { code: \"sv-SE\", label: \"Swedish - YYYY-MM-DD, Mon\" },\n { code: \"ja-JP\", label: \"Japanese - YYYY/MM/DD, Sun\" },\n];\n\nexport function PlaygroundSettingsPanel(): React.ReactElement {\n const [open, setOpen] = useState(false);\n const { settings, setSettings } = usePlaygroundSettings();\n\n return (\n <Sheet open={open} onOpenChange={setOpen}>\n <IconButton label=\"Playground settings\" onClick={() => setOpen(true)}>\n <Settings />\n </IconButton>\n <SheetContent side=\"right\">\n <SheetHeader>\n <SheetTitle>Playground settings</SheetTitle>\n <SheetDescription>\n Scoped to the playground. Values exchanged with components stay\n locale-independent (ISO); only display and input parsing change.\n </SheetDescription>\n </SheetHeader>\n <SheetBody>\n <div className=\"space-y-2\">\n <Label htmlFor=\"playground-locale\">Locale</Label>\n <Select\n value={settings.locale || INHERIT}\n onValueChange={(value) =>\n setSettings({ locale: value === INHERIT ? \"\" : value })\n }\n >\n <SelectTrigger id=\"playground-locale\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {LOCALE_OPTIONS.map((opt) => (\n <SelectItem key={opt.code} value={opt.code}>\n {opt.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <p className=\"text-xs text-tertiary-foreground\">\n Drives locale-sensitive components (e.g. Date Input) across every\n playground page.\n </p>\n </div>\n </SheetBody>\n </SheetContent>\n </Sheet>\n );\n}\n","/**\n * Playground-scoped settings (locale, ...).\n *\n * A self-contained provider that wraps all playground routes. It owns a small\n * settings object, persists it to a namespaced localStorage key, and renders a\n * SonnetConfigProvider so the settings flow to every playground page.\n *\n * Scope and containment: the provider is nested under any host-app provider and\n * merges onto it, so a playground override shadows the app/browser value only\n * within the playground subtree -- it never mutates the host app's global\n * config. The default is \"inherit\" (empty locale), so out of the box the\n * playground changes nothing.\n */\n\nimport React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { SonnetConfigProvider } from \"@petrarca/sonnet-core/config\";\n\nconst STORAGE_KEY = \"sonnet.playground.settings\";\n\nexport interface PlaygroundSettings {\n /** BCP-47 locale override, or \"\" to inherit the app/browser locale. */\n locale: string;\n}\n\ninterface PlaygroundSettingsContextValue {\n settings: PlaygroundSettings;\n setSettings: (next: Partial<PlaygroundSettings>) => void;\n}\n\nconst DEFAULT_SETTINGS: PlaygroundSettings = { locale: \"\" };\n\nconst PlaygroundSettingsContext =\n createContext<PlaygroundSettingsContextValue | null>(null);\n\n// Safe localStorage access (guards against SSR and storage failures).\nconst storage = {\n get(key: string): string | null {\n try {\n return typeof localStorage !== \"undefined\"\n ? localStorage.getItem(key)\n : null;\n } catch {\n return null;\n }\n },\n set(key: string, value: string): void {\n try {\n if (typeof localStorage !== \"undefined\") localStorage.setItem(key, value);\n } catch {\n // Ignore quota / private-mode failures.\n }\n },\n};\n\nfunction loadSettings(): PlaygroundSettings {\n const raw = storage.get(STORAGE_KEY);\n if (!raw) return DEFAULT_SETTINGS;\n try {\n return { ...DEFAULT_SETTINGS, ...(JSON.parse(raw) as PlaygroundSettings) };\n } catch {\n return DEFAULT_SETTINGS;\n }\n}\n\nfunction persistSettings(settings: PlaygroundSettings): void {\n storage.set(STORAGE_KEY, JSON.stringify(settings));\n}\n\nexport interface PlaygroundSettingsProviderProps {\n children: React.ReactNode;\n}\n\nexport function PlaygroundSettingsProvider({\n children,\n}: PlaygroundSettingsProviderProps): React.ReactElement {\n const [settings, setSettingsState] =\n useState<PlaygroundSettings>(loadSettings);\n\n const setSettings = useCallback(\n (next: Partial<PlaygroundSettings>) =>\n setSettingsState((prev) => {\n const merged = { ...prev, ...next };\n persistSettings(merged);\n return merged;\n }),\n [],\n );\n\n const contextValue = useMemo(\n () => ({ settings, setSettings }),\n [settings, setSettings],\n );\n\n // Only override the global locale when explicitly set; \"\" inherits.\n const config = useMemo(\n () => ({ globals: { locale: settings.locale || undefined } }),\n [settings.locale],\n );\n\n return (\n <PlaygroundSettingsContext.Provider value={contextValue}>\n <SonnetConfigProvider value={config}>{children}</SonnetConfigProvider>\n </PlaygroundSettingsContext.Provider>\n );\n}\n\n/** Access playground settings. Returns defaults when no provider is present. */\nexport function usePlaygroundSettings(): PlaygroundSettingsContextValue {\n return (\n useContext(PlaygroundSettingsContext) ?? {\n settings: DEFAULT_SETTINGS,\n setSettings: () => {},\n }\n );\n}\n","/**\n * @petrarca/sonnet-playground\n *\n * Playground framework and built-in component demos for the Petrarca\n * Sonnet component library.\n *\n * Usage:\n *\n * import {\n * createPlaygroundRegistry,\n * createPlaygroundModule,\n * } from \"@petrarca/sonnet-playground\";\n *\n * const playground = createPlaygroundRegistry();\n * // Optionally register additional entries:\n * playground.register({ id: \"app.custom\", ... });\n *\n * const playgroundModule = createPlaygroundModule(playground);\n */\n\nimport { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nimport { builtinEntries } from \"./builtinEntries\";\n\n// Framework\nexport { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nexport { createPlaygroundModule } from \"./createPlaygroundModule\";\nexport { PlaygroundOverview } from \"./PlaygroundOverview\";\nexport { PlaygroundSection, ExampleBlock } from \"./PlaygroundSection\";\nexport {\n PlaygroundSettingsProvider,\n usePlaygroundSettings,\n type PlaygroundSettings,\n} from \"./PlaygroundSettings\";\nexport { PlaygroundSettingsPanel } from \"./PlaygroundSettingsPanel\";\n\n// Types\nexport type {\n PlaygroundEntry,\n PlaygroundColor,\n PlaygroundModuleOptions,\n} from \"./types\";\n\n// Built-in entries (for selective use or extending)\nexport { builtinEntries } from \"./builtinEntries\";\n\n/**\n * Convenience factory: creates a new PlaygroundRegistry pre-populated\n * with all built-in sonnet component demos.\n */\nexport function createPlaygroundRegistry(): PlaygroundRegistry {\n const registry = new PlaygroundRegistry();\n registry.registerAll(builtinEntries);\n return registry;\n}\n"],"mappings":";;;;;;AAQA,SAAS,eAAe;AAGjB,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EACtB,UAAwC,oBAAI,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAchD,gBAAgB,OAA8B;AACpD,eAAW,YAAY,KAAK,QAAQ,OAAO,GAAG;AAC5C,UAAI,SAAS,OAAO,MAAM,GAAI;AAE9B,UAAI,SAAS,SAAS,MAAM,MAAM;AAChC;AAAA,UACE,iCAAiC,SAAS,EAAE,UAAU,MAAM,EAAE,qBAAqB,MAAM,IAAI;AAAA,QAC/F;AAAA,MACF;AAEA,YAAM,QAAQ,MAAM,SAAS,oBAAmB;AAChD,YAAM,gBAAgB,SAAS,SAAS,oBAAmB;AAC3D,UACE,UAAU,iBACV,MAAM,YAAY,MAAM,cAAc,YAAY,GAClD;AACA;AAAA,UACE,+BAA+B,KAAK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AAA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA,OAAO;AAAA,cACP,UAAU;AAAA,cACV;AAAA;AAAA,UACF,CACD;AAAA,QACH;AAAA,QACA,GAAG,SAAS,OAAO,EAAE,IAAI,CAAC,WAAW;AAAA,UACnC,MAAM,MAAM;AAAA,UACZ,SAAS,UAAU,MAAM,SAAS;AAAA,QACpC,EAAE;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY,gBAAgB,UAAU,QAAQ;AAAA,IAC9C;AAAA,EACF;AACF;;;AIhEO,SAAS,2BAA+C;AAC7D,QAAM,WAAW,IAAI,mBAAmB;AACxC,WAAS,YAAY,cAAc;AACnC,SAAO;AACT;","names":["useState","useState","jsx","useState","jsx","jsxs","useState","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../src/PlaygroundRegistry.ts","../src/builtinEntries.ts","../src/createPlaygroundModule.tsx","../src/PlaygroundOverview.tsx","../src/PlaygroundSettingsPanel.tsx","../src/PlaygroundSettings.tsx","../src/index.ts"],"sourcesContent":["/**\n * PlaygroundRegistry -- mutable collection of playground entries.\n *\n * The library ships a default instance pre-populated with the built-in\n * sonnet component demos. Consumers register additional entries for\n * domain-specific playgrounds before passing the registry to\n * createPlaygroundModule().\n */\nimport { warnLog } from \"@petrarca/sonnet-core\";\nimport type { PlaygroundEntry } from \"./types\";\n\nexport class PlaygroundRegistry {\n private entries: Map<string, PlaygroundEntry> = new Map();\n\n /**\n * Report registrations that cannot work, rather than silently misbehaving.\n *\n * Entries are keyed by `id`, so two entries may legally share a `path` --\n * and then both produce a route on the same URL and one is unreachable.\n * Groups are bucketed by their exact label, so two labels differing only by\n * case become two separate groups.\n *\n * Neither is corrected here: dropping an entry, or merging groups the caller\n * spelled differently, would be its own surprise. The registration stands and\n * the problem is made diagnosable.\n */\n private warnOnConflicts(entry: PlaygroundEntry): void {\n for (const existing of this.entries.values()) {\n if (existing.id === entry.id) continue;\n\n if (existing.path === entry.path) {\n warnLog(\n `[PlaygroundRegistry] entries \"${existing.id}\" and \"${entry.id}\" share the path \"${entry.path}\". Both will route to the same URL and one will be unreachable.`,\n );\n }\n\n const group = entry.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n const existingGroup = existing.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n if (\n group !== existingGroup &&\n group.toLowerCase() === existingGroup.toLowerCase()\n ) {\n warnLog(\n `[PlaygroundRegistry] group \"${group}\" differs from \"${existingGroup}\" only by case; they will render as two separate groups.`,\n );\n }\n }\n }\n\n /** Register a playground entry. Overwrites any existing entry with the same id. */\n register(entry: PlaygroundEntry): void {\n this.warnOnConflicts(entry);\n this.entries.set(entry.id, entry);\n }\n\n /** Register multiple entries at once. */\n registerAll(entries: PlaygroundEntry[]): void {\n for (const entry of entries) {\n this.register(entry);\n }\n }\n\n /** Remove an entry by id. Returns true if it existed. */\n unregister(id: string): boolean {\n return this.entries.delete(id);\n }\n\n /** Get a single entry by id. */\n get(id: string): PlaygroundEntry | undefined {\n return this.entries.get(id);\n }\n\n /** Fallback group label for entries with no group defined. */\n static readonly DEFAULT_GROUP = \"General\";\n\n /**\n * All registered entries, sorted by group registration order then\n * by `order` within each group.\n */\n getAll(): PlaygroundEntry[] {\n const groupOrder = this.getGroupOrder();\n return [...this.entries.values()].sort((a, b) => {\n const groupA = a.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n const groupB = b.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n if (groupA !== groupB) {\n return (\n (groupOrder.get(groupA) ?? 999) - (groupOrder.get(groupB) ?? 999)\n );\n }\n return (a.order ?? 0) - (b.order ?? 0);\n });\n }\n\n /**\n * Entries grouped by their group label.\n * Returns an array of [groupLabel, entries[]] tuples, preserving\n * first-seen registration order for groups and `order` within each group.\n */\n getGrouped(): Array<[string, PlaygroundEntry[]]> {\n const grouped = new Map<string, PlaygroundEntry[]>();\n for (const entry of this.getAll()) {\n const group = entry.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n const list = grouped.get(group) ?? [];\n list.push(entry);\n grouped.set(group, list);\n }\n return [...grouped.entries()];\n }\n\n /** Map of group name → first-seen index (registration order). */\n private getGroupOrder(): Map<string, number> {\n const order = new Map<string, number>();\n let idx = 0;\n for (const entry of this.entries.values()) {\n const group = entry.group ?? PlaygroundRegistry.DEFAULT_GROUP;\n if (!order.has(group)) {\n order.set(group, idx++);\n }\n }\n return order;\n }\n\n /** Number of registered entries. */\n get size(): number {\n return this.entries.size;\n }\n}\n","/**\n * Built-in playground entries for the sonnet component library.\n *\n * These entries demonstrate @petrarca/sonnet-* components with static\n * mock data -- no application backend required. Each page is lazy-loaded.\n */\nimport { lazy } from \"react\";\nimport {\n Type,\n Palette,\n Grid,\n Layers,\n Braces,\n FileCode,\n FileText,\n Check,\n Edit,\n Package,\n Table2,\n Network,\n SquareTerminal,\n PencilRuler,\n ClipboardList,\n ShieldCheck,\n FileJson,\n ListTree,\n} from \"lucide-react\";\nimport type { PlaygroundEntry } from \"./types\";\n\nexport const builtinEntries: PlaygroundEntry[] = [\n {\n id: \"sonnet.typography\",\n title: \"Typography\",\n description:\n \"Living style-guide for the typography system. Font families, type scale, weights, heading hierarchy, color tiers, and component patterns.\",\n icon: Type,\n color: \"teal\",\n path: \"typography\",\n component: lazy(() => import(\"./pages/PlayTypography\")),\n group: \"Design System\",\n order: 0,\n },\n {\n id: \"sonnet.color-palette\",\n title: \"Color Palette\",\n description:\n \"Living reference for the color system. Semantic tokens, extended palette, badge colors, icon accents, and usage guidance.\",\n icon: Palette,\n color: \"violet\",\n path: \"color-palette\",\n component: lazy(() => import(\"./pages/PlayColorPalette\")),\n group: \"Design System\",\n order: 1,\n },\n {\n id: \"sonnet.core-components\",\n title: \"Core UI Components\",\n description:\n \"Test all core UI components (notifications, buttons, dialogs, forms, etc.) in isolation before production use.\",\n icon: Grid,\n color: \"indigo\",\n path: \"core-components\",\n component: lazy(() => import(\"./pages/PlayCoreComponents\")),\n group: \"Components\",\n order: 0,\n },\n {\n id: \"sonnet.advanced-components\",\n title: \"Advanced Components\",\n description:\n \"Multi-step workflows (Stepper) and hierarchical data structures (TreeView) with keyboard navigation and selection.\",\n icon: Layers,\n color: \"emerald\",\n path: \"advanced-components\",\n component: lazy(() => import(\"./pages/PlayAdvancedComponents\")),\n group: \"Components\",\n order: 1,\n },\n {\n id: \"sonnet.json-editor\",\n title: \"JSON Editor\",\n description:\n \"Constrained JSON editor with selectively editable regions using JSON Pointer (RFC 6901). Readonly sections are visible but locked.\",\n icon: Braces,\n color: \"amber\",\n path: \"json-editor\",\n component: lazy(() => import(\"./pages/PlayJsonEditor\")),\n group: \"Content\",\n order: 0,\n },\n {\n id: \"sonnet.code-editor\",\n title: \"Code Editor\",\n description:\n \"CodeMirror with the sonnet look: code read-only (full and compact), and text editing. Languages load on demand; large files draw only the visible lines.\",\n icon: FileCode,\n color: \"amber\",\n path: \"code-editor\",\n component: lazy(() => import(\"./pages/PlayCodeEditor\")),\n group: \"Content\",\n order: 1,\n },\n {\n id: \"sonnet.markdown-viewer\",\n title: \"Markdown Viewer\",\n description:\n \"Markdown for reading: GitHub-flavoured, code blocks in the code editor, Mermaid diagrams, untrusted content sanitized; also streamed, for a chat.\",\n icon: FileText,\n color: \"amber\",\n path: \"markdown-viewer\",\n component: lazy(() => import(\"./pages/PlayMarkdownViewer\")),\n group: \"Content\",\n order: 2,\n },\n\n {\n id: \"sonnet.form-components\",\n title: \"Form Components\",\n description:\n \"Test custom Form wrapper components with labels, descriptions, and error states. Includes Input, Textarea, Number, Checkbox, Select, MultiSelect, and Tags.\",\n icon: Check,\n color: \"blue\",\n path: \"form-components\",\n component: lazy(() => import(\"./pages/PlayFormComponents\")),\n group: \"Forms\",\n order: 0,\n },\n {\n id: \"sonnet.forms\",\n title: \"Forms Renderer\",\n description:\n \"Test and experiment with the JsonSchemaFormRenderer component. Try different schemas and see real-time validation.\",\n icon: Edit,\n color: \"purple\",\n path: \"forms\",\n component: lazy(() => import(\"./pages/PlayForms\")),\n group: \"Forms\",\n order: 1,\n },\n {\n id: \"sonnet.form-widgets\",\n title: \"Form Widgets\",\n description:\n \"Pluggable field components consumed by the Forms Renderer. Each widget maps to a JSON Schema type or format and can be swapped independently.\",\n icon: Package,\n color: \"indigo\",\n path: \"form-widgets\",\n component: lazy(() => import(\"./pages/PlayFormWidgets\")),\n group: \"Forms\",\n order: 2,\n },\n {\n id: \"sonnet.coded-values\",\n title: \"Coded Values\",\n description:\n \"Codes from a list a terminology service serves: the coded-value widget -- a list or a search, a code or a coding, one or several -- its display, the coding table cell, and the codeable concept: one answer coded in several lists.\",\n icon: ListTree,\n color: \"indigo\",\n path: \"coded-values\",\n component: lazy(() => import(\"./pages/PlayCodedValues\")),\n group: \"Forms\",\n order: 3,\n },\n {\n id: \"sonnet.schema-designer\",\n title: \"Schema Designer\",\n description:\n \"Visually author a JSON Schema and its UI presentation hints. Field tree, inspector, and live preview; edits emit a valid schema + uiSchema.\",\n icon: PencilRuler,\n color: \"teal\",\n path: \"schema-designer\",\n component: lazy(() => import(\"./pages/PlaySchemaDesigner\")),\n group: \"Schemas\",\n order: 0,\n },\n {\n id: \"sonnet.questionnaire-designer\",\n title: \"Questionnaire Designer\",\n description:\n \"Author a questionnaire as sections and questions, over the same JSON Schema and uiSchema as the Schema Designer. Parts it does not understand are kept as they are.\",\n icon: ClipboardList,\n color: \"teal\",\n path: \"questionnaire-designer\",\n component: lazy(() => import(\"./pages/PlayQuestionnaireDesigner\")),\n group: \"Schemas\",\n order: 1,\n },\n {\n id: \"sonnet.data-components\",\n title: \"Data Components\",\n description:\n \"Interactive sandbox for SearchInput (simple and faceted mode) and EntityTable. Includes a live table wired to the faceted search.\",\n icon: Table2,\n color: \"teal\",\n path: \"data-components\",\n component: lazy(() => import(\"./pages/PlayDataComponents\")),\n group: \"Data\",\n order: 0,\n },\n {\n id: \"sonnet.graph\",\n title: \"Graph Visualization\",\n description:\n \"Interactive property graph visualization with dual renderer support (Cytoscape, Reagraph). Org hierarchy demo with filtering, selection, and exploration.\",\n icon: Network,\n color: \"cyan\",\n path: \"graph\",\n component: lazy(() => import(\"./pages/PlayGraph\")),\n group: \"Graph\",\n order: 0,\n },\n {\n id: \"sonnet.shell-api\",\n title: \"Shell API\",\n description:\n \"Interactive demo of the shell API: notifications, dialogs, programmatic navigation, slide-over panels, the resizable sidePane, and the Cmd+K command menu.\",\n icon: SquareTerminal,\n color: \"orange\",\n path: \"shell-api\",\n component: lazy(() => import(\"./pages/PlayShellApi\")),\n group: \"Shell\",\n order: 0,\n },\n {\n id: \"sonnet.auth\",\n title: \"Auth Screens\",\n description:\n \"The pre-application login and organization selection screens: identifier-first and legacy flows, provider combinations, error and loading states, and every org-selection outcome.\",\n icon: ShieldCheck,\n color: \"teal\",\n path: \"auth\",\n component: lazy(() => import(\"./pages/PlayAuth\")),\n group: \"Shell\",\n order: 1,\n },\n {\n id: \"sonnet.fhir-questionnaire\",\n title: \"HL7 FHIR Questionnaire\",\n navLabel: \"FHIR Questionnaire\",\n description:\n \"End to end, in FHIR R4 and R5: read a Questionnaire as a questionnaire on JSON Schema, fill its form, submit it as a QuestionnaireResponse, and read a response back.\",\n icon: FileJson,\n color: \"teal\",\n path: \"fhir-questionnaire\",\n component: lazy(() => import(\"./pages/PlayFhirQuestionnaire\")),\n group: \"HL7 FHIR\",\n order: 0,\n },\n];\n","/**\n * Factory that turns a PlaygroundRegistry into a ShellModule.\n *\n * Generates routes (lazy + Suspense), sidebar navigation, and the\n * overview index page -- all derived from the registry entries.\n * The consumer just passes a registry and optional overrides.\n */\nimport React, { Suspense } from \"react\";\nimport { Outlet } from \"react-router-dom\";\nimport { FlaskConical } from \"lucide-react\";\nimport type { ShellModule, NavGroup } from \"@petrarca/sonnet-shell\";\nimport type { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nimport type { PlaygroundModuleOptions } from \"./types\";\nimport { PlaygroundOverview } from \"./PlaygroundOverview\";\nimport { PlaygroundSettingsProvider } from \"./PlaygroundSettings\";\n\nfunction buildNavigation(\n registry: PlaygroundRegistry,\n basePath: string,\n): NavGroup[] {\n const groups = registry.getGrouped();\n const navGroups: NavGroup[] = [];\n\n navGroups.push({\n id: \"playground-overview\",\n links: [{ label: \"Overview\", path: basePath }],\n });\n\n for (const [groupLabel, entries] of groups) {\n navGroups.push({\n id: `playground-${groupLabel.toLowerCase().replace(/\\s+/g, \"-\")}`,\n heading: groupLabel,\n links: entries.map((e) => ({\n label: e.navLabel ?? e.title,\n path: `${basePath}/${e.path}`,\n })),\n });\n }\n\n return navGroups;\n}\n\n// Wrap a component in Suspense for lazy loading.\nfunction suspended(Component: React.ComponentType): React.ReactElement {\n return (\n <Suspense>\n <Component />\n </Suspense>\n );\n}\n\n// Layout route element: a single PlaygroundSettingsProvider wrapping all\n// playground routes via <Outlet>. Mounted once, never torn down on navigation,\n// so settings state is stable across route changes within the playground.\nfunction PlaygroundLayout(): React.ReactElement {\n return (\n <PlaygroundSettingsProvider>\n <Outlet />\n </PlaygroundSettingsProvider>\n );\n}\n\nexport function createPlaygroundModule(\n registry: PlaygroundRegistry,\n options: PlaygroundModuleOptions = {},\n): ShellModule {\n const {\n icon = FlaskConical,\n label = \"Playground\",\n basePath = \"/playground\",\n overviewTitle = \"Developer Playground\",\n overviewSubtitle = \"Experiment with components, test features, and explore capabilities.\",\n grouped = true,\n } = options;\n\n const routeBase = basePath.replace(/^\\//, \"\");\n\n // A single layout route wraps all playground routes. The settings provider\n // lives here -- mounted once, alive for the full playground session.\n const routes = [\n {\n path: routeBase,\n element: <PlaygroundLayout />,\n children: [\n {\n index: true,\n element: suspended(() => (\n <PlaygroundOverview\n registry={registry}\n basePath={basePath}\n title={overviewTitle}\n subtitle={overviewSubtitle}\n grouped={grouped}\n />\n )),\n },\n ...registry.getAll().map((entry) => ({\n path: entry.path,\n element: suspended(entry.component),\n })),\n ],\n },\n ];\n\n return {\n id: \"playground\",\n label,\n icon,\n basePath,\n pinBottom: true,\n navigation: buildNavigation(registry, basePath),\n routes,\n };\n}\n","/**\n * PlaygroundOverview -- tile grid rendered from a PlaygroundRegistry.\n *\n * Displays cards with colored icons. Clicking a card navigates to the\n * playground page. A toggle in the header lets the user switch between\n * grouped (by category) and flat (all tiles) views.\n */\nimport React, { useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { LayoutGrid, List } from \"lucide-react\";\nimport { Card, Button, SimpleTooltip } from \"@petrarca/sonnet-ui\";\nimport type { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nimport type { PlaygroundColor, PlaygroundEntry } from \"./types\";\nimport { PlaygroundSettingsPanel } from \"./PlaygroundSettingsPanel\";\n\n// Maps colour name to icon container classes (bg-*-100 text-*-600 pairing).\nconst COLOR_CLASSES: Record<PlaygroundColor, string> = {\n blue: \"bg-blue-100 text-blue-600\",\n violet: \"bg-violet-100 text-violet-600\",\n indigo: \"bg-indigo-100 text-indigo-600\",\n purple: \"bg-purple-100 text-purple-600\",\n teal: \"bg-teal-100 text-teal-600\",\n amber: \"bg-amber-100 text-amber-600\",\n emerald: \"bg-emerald-100 text-emerald-600\",\n rose: \"bg-rose-100 text-rose-600\",\n orange: \"bg-orange-100 text-orange-600\",\n cyan: \"bg-cyan-100 text-cyan-600\",\n};\n\nconst TILE_GRID = \"grid grid-cols-1 sm:grid-cols-2 2xl:grid-cols-3 gap-6\";\n\ninterface PlaygroundOverviewProps {\n registry: PlaygroundRegistry;\n basePath: string;\n title: string;\n subtitle: string;\n /** Initial grouping state. Defaults to true. User can toggle at runtime. */\n grouped?: boolean;\n}\n\ninterface TileProps {\n item: PlaygroundEntry;\n onNavigate: (path: string) => void;\n}\n\n/** A single playground tile card. */\nfunction PlaygroundTile({ item, onNavigate }: TileProps): React.ReactElement {\n return (\n <Card\n className=\"cursor-pointer shadow-sm border rounded-md p-6 transition-transform duration-200 motion-safe:hover:-translate-y-1\"\n onClick={() => onNavigate(item.path)}\n >\n <div className=\"flex items-center mb-4\">\n <div\n className={`flex items-center justify-center w-9 h-9 rounded-md ${COLOR_CLASSES[item.color] ?? COLOR_CLASSES.blue}`}\n >\n <item.icon size={18} />\n </div>\n </div>\n <h3 className=\"heading-section mb-1\">{item.title}</h3>\n <p className=\"text-sm text-muted-foreground\">{item.description}</p>\n </Card>\n );\n}\n\n/** Developer playground overview -- card grid linking to all registered pages. */\nexport function PlaygroundOverview({\n registry,\n basePath,\n title,\n subtitle,\n grouped: initialGrouped = true,\n}: PlaygroundOverviewProps): React.ReactElement {\n const navigate = useNavigate();\n const [grouped, setGrouped] = useState(initialGrouped);\n\n const handleNavigate = (path: string) => navigate(`${basePath}/${path}`);\n\n return (\n <div className=\"w-full\">\n <div className=\"flex items-start justify-between mb-6\">\n <div>\n <h1 className=\"mb-1\">{title}</h1>\n <p className=\"text-sm text-muted-foreground\">{subtitle}</p>\n </div>\n <div className=\"flex items-center gap-1\">\n <SimpleTooltip\n label={grouped ? \"Show flat list\" : \"Group by category\"}\n >\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => setGrouped((v) => !v)}\n >\n {grouped ? (\n <LayoutGrid className=\"h-4 w-4\" />\n ) : (\n <List className=\"h-4 w-4\" />\n )}\n </Button>\n </SimpleTooltip>\n <PlaygroundSettingsPanel />\n </div>\n </div>\n\n {grouped ? (\n registry.getGrouped().map(([groupLabel, entries]) => (\n <div key={groupLabel} className=\"mb-8\">\n <h2 className=\"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4\">\n {groupLabel}\n </h2>\n <div className={TILE_GRID}>\n {entries.map((item) => (\n <PlaygroundTile\n key={item.id}\n item={item}\n onNavigate={handleNavigate}\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className={TILE_GRID}>\n {registry.getAll().map((item) => (\n <PlaygroundTile\n key={item.id}\n item={item}\n onNavigate={handleNavigate}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n","/**\n * PlaygroundSettingsPanel -- gear button that opens a right-side settings sheet.\n *\n * Hosts playground-wide settings (currently locale). Edits flow through\n * usePlaygroundSettings, which drives the SonnetConfigProvider wrapping all\n * playground routes.\n */\n\nimport React, { useState } from \"react\";\nimport { Settings } from \"lucide-react\";\nimport {\n IconButton,\n Label,\n Sheet,\n SheetContent,\n SheetHeader,\n SheetTitle,\n SheetDescription,\n SheetBody,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from \"@petrarca/sonnet-ui\";\nimport { usePlaygroundSettings } from \"./PlaygroundSettings\";\n\n// Locale choices for the playground. \"__inherit__\" uses the app/browser locale.\nconst INHERIT = \"__inherit__\";\nconst LOCALE_OPTIONS = [\n { code: INHERIT, label: \"Inherit (app / browser)\" },\n { code: \"en-US\", label: \"English (US) - MM/DD, Sun\" },\n { code: \"en-GB\", label: \"English (UK) - DD/MM, Mon\" },\n { code: \"de-DE\", label: \"German - DD.MM, Mon\" },\n { code: \"fr-FR\", label: \"French - DD/MM, Mon\" },\n { code: \"sv-SE\", label: \"Swedish - YYYY-MM-DD, Mon\" },\n { code: \"ja-JP\", label: \"Japanese - YYYY/MM/DD, Sun\" },\n];\n\nexport function PlaygroundSettingsPanel(): React.ReactElement {\n const [open, setOpen] = useState(false);\n const { settings, setSettings } = usePlaygroundSettings();\n\n return (\n <Sheet open={open} onOpenChange={setOpen}>\n <IconButton label=\"Playground settings\" onClick={() => setOpen(true)}>\n <Settings />\n </IconButton>\n <SheetContent side=\"right\">\n <SheetHeader>\n <SheetTitle>Playground settings</SheetTitle>\n <SheetDescription>\n Scoped to the playground. Values exchanged with components stay\n locale-independent (ISO); only display and input parsing change.\n </SheetDescription>\n </SheetHeader>\n <SheetBody>\n <div className=\"space-y-2\">\n <Label htmlFor=\"playground-locale\">Locale</Label>\n <Select\n value={settings.locale || INHERIT}\n onValueChange={(value) =>\n setSettings({ locale: value === INHERIT ? \"\" : value })\n }\n >\n <SelectTrigger id=\"playground-locale\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {LOCALE_OPTIONS.map((opt) => (\n <SelectItem key={opt.code} value={opt.code}>\n {opt.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <p className=\"text-xs text-tertiary-foreground\">\n Drives locale-sensitive components (e.g. Date Input) across every\n playground page.\n </p>\n </div>\n </SheetBody>\n </SheetContent>\n </Sheet>\n );\n}\n","/**\n * Playground-scoped settings (locale, ...).\n *\n * A self-contained provider that wraps all playground routes. It owns a small\n * settings object, persists it to a namespaced localStorage key, and renders a\n * SonnetConfigProvider so the settings flow to every playground page.\n *\n * Scope and containment: the provider is nested under any host-app provider and\n * merges onto it, so a playground override shadows the app/browser value only\n * within the playground subtree -- it never mutates the host app's global\n * config. The default is \"inherit\" (empty locale), so out of the box the\n * playground changes nothing.\n */\n\nimport React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { SonnetConfigProvider } from \"@petrarca/sonnet-core/config\";\n\nconst STORAGE_KEY = \"sonnet.playground.settings\";\n\nexport interface PlaygroundSettings {\n /** BCP-47 locale override, or \"\" to inherit the app/browser locale. */\n locale: string;\n}\n\ninterface PlaygroundSettingsContextValue {\n settings: PlaygroundSettings;\n setSettings: (next: Partial<PlaygroundSettings>) => void;\n}\n\nconst DEFAULT_SETTINGS: PlaygroundSettings = { locale: \"\" };\n\nconst PlaygroundSettingsContext =\n createContext<PlaygroundSettingsContextValue | null>(null);\n\n// Safe localStorage access (guards against SSR and storage failures).\nconst storage = {\n get(key: string): string | null {\n try {\n return typeof localStorage !== \"undefined\"\n ? localStorage.getItem(key)\n : null;\n } catch {\n return null;\n }\n },\n set(key: string, value: string): void {\n try {\n if (typeof localStorage !== \"undefined\") localStorage.setItem(key, value);\n } catch {\n // Ignore quota / private-mode failures.\n }\n },\n};\n\nfunction loadSettings(): PlaygroundSettings {\n const raw = storage.get(STORAGE_KEY);\n if (!raw) return DEFAULT_SETTINGS;\n try {\n return { ...DEFAULT_SETTINGS, ...(JSON.parse(raw) as PlaygroundSettings) };\n } catch {\n return DEFAULT_SETTINGS;\n }\n}\n\nfunction persistSettings(settings: PlaygroundSettings): void {\n storage.set(STORAGE_KEY, JSON.stringify(settings));\n}\n\nexport interface PlaygroundSettingsProviderProps {\n children: React.ReactNode;\n}\n\nexport function PlaygroundSettingsProvider({\n children,\n}: PlaygroundSettingsProviderProps): React.ReactElement {\n const [settings, setSettingsState] =\n useState<PlaygroundSettings>(loadSettings);\n\n const setSettings = useCallback(\n (next: Partial<PlaygroundSettings>) =>\n setSettingsState((prev) => {\n const merged = { ...prev, ...next };\n persistSettings(merged);\n return merged;\n }),\n [],\n );\n\n const contextValue = useMemo(\n () => ({ settings, setSettings }),\n [settings, setSettings],\n );\n\n // Only override the global locale when explicitly set; \"\" inherits.\n const config = useMemo(\n () => ({ globals: { locale: settings.locale || undefined } }),\n [settings.locale],\n );\n\n return (\n <PlaygroundSettingsContext.Provider value={contextValue}>\n <SonnetConfigProvider value={config}>{children}</SonnetConfigProvider>\n </PlaygroundSettingsContext.Provider>\n );\n}\n\n/** Access playground settings. Returns defaults when no provider is present. */\nexport function usePlaygroundSettings(): PlaygroundSettingsContextValue {\n return (\n useContext(PlaygroundSettingsContext) ?? {\n settings: DEFAULT_SETTINGS,\n setSettings: () => {},\n }\n );\n}\n","/**\n * @petrarca/sonnet-playground\n *\n * Playground framework and built-in component demos for the Petrarca\n * Sonnet component library.\n *\n * Usage:\n *\n * import {\n * createPlaygroundRegistry,\n * createPlaygroundModule,\n * } from \"@petrarca/sonnet-playground\";\n *\n * const playground = createPlaygroundRegistry();\n * // Optionally register additional entries:\n * playground.register({ id: \"app.custom\", ... });\n *\n * const playgroundModule = createPlaygroundModule(playground);\n */\n\nimport { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nimport { builtinEntries } from \"./builtinEntries\";\n\n// Framework\nexport { PlaygroundRegistry } from \"./PlaygroundRegistry\";\nexport { createPlaygroundModule } from \"./createPlaygroundModule\";\nexport { PlaygroundOverview } from \"./PlaygroundOverview\";\nexport { PlaygroundSection, ExampleBlock } from \"./PlaygroundSection\";\nexport {\n PlaygroundSettingsProvider,\n usePlaygroundSettings,\n type PlaygroundSettings,\n} from \"./PlaygroundSettings\";\nexport { PlaygroundSettingsPanel } from \"./PlaygroundSettingsPanel\";\n\n// Types\nexport type {\n PlaygroundEntry,\n PlaygroundColor,\n PlaygroundModuleOptions,\n} from \"./types\";\n\n// Built-in entries (for selective use or extending)\nexport { builtinEntries } from \"./builtinEntries\";\n\n/**\n * Convenience factory: creates a new PlaygroundRegistry pre-populated\n * with all built-in sonnet component demos.\n */\nexport function createPlaygroundRegistry(): PlaygroundRegistry {\n const registry = new PlaygroundRegistry();\n registry.registerAll(builtinEntries);\n return registry;\n}\n"],"mappings":";;;;;;AAQA,SAAS,eAAe;AAGjB,IAAM,qBAAN,MAAM,oBAAmB;AAAA,EACtB,UAAwC,oBAAI,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAchD,gBAAgB,OAA8B;AACpD,eAAW,YAAY,KAAK,QAAQ,OAAO,GAAG;AAC5C,UAAI,SAAS,OAAO,MAAM,GAAI;AAE9B,UAAI,SAAS,SAAS,MAAM,MAAM;AAChC;AAAA,UACE,iCAAiC,SAAS,EAAE,UAAU,MAAM,EAAE,qBAAqB,MAAM,IAAI;AAAA,QAC/F;AAAA,MACF;AAEA,YAAM,QAAQ,MAAM,SAAS,oBAAmB;AAChD,YAAM,gBAAgB,SAAS,SAAS,oBAAmB;AAC3D,UACE,UAAU,iBACV,MAAM,YAAY,MAAM,cAAc,YAAY,GAClD;AACA;AAAA,UACE,+BAA+B,KAAK,mBAAmB,aAAa;AAAA,QACtE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,SAAS,OAA8B;AACrC,SAAK,gBAAgB,KAAK;AAC1B,SAAK,QAAQ,IAAI,MAAM,IAAI,KAAK;AAAA,EAClC;AAAA;AA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SAAO;AAAA,IACL,IAAI;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY,gBAAgB,UAAU,QAAQ;AAAA,IAC9C;AAAA,EACF;AACF;;;AIhEO,SAAS,2BAA+C;AAC7D,QAAM,WAAW,IAAI,mBAAmB;AACxC,WAAS,YAAY,cAAc;AACnC,SAAO;AACT;","names":["useState","useState","jsx","useState","jsx","jsxs","useState","jsx"]}
|
package/dist/pages/index.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import { TerminologyService } from '@petrarca/sonnet-core/terminology';
|
|
3
4
|
|
|
4
|
-
declare function PlayTypography():
|
|
5
|
+
declare function PlayTypography(): react__default.ReactElement;
|
|
5
6
|
|
|
6
7
|
/** Color Palette playground -- living reference for the design system color tokens. */
|
|
7
|
-
declare function PlayColorPalette():
|
|
8
|
+
declare function PlayColorPalette(): react__default.ReactElement;
|
|
8
9
|
|
|
9
10
|
/** PlayCoreComponents — showcase for all core UI primitives. */
|
|
10
|
-
declare function PlayCoreComponents():
|
|
11
|
+
declare function PlayCoreComponents(): react.JSX.Element;
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* PlayAdvancedComponents — Stepper and TreeView demos.
|
|
14
15
|
*
|
|
15
16
|
* Split from PlayCoreComponents to keep files manageable.
|
|
16
17
|
*/
|
|
17
|
-
declare function PlayAdvancedComponents():
|
|
18
|
+
declare function PlayAdvancedComponents(): react.JSX.Element;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Playground page for the JsonEditor component.
|
|
@@ -23,7 +24,13 @@ declare function PlayAdvancedComponents(): react_jsx_runtime.JSX.Element;
|
|
|
23
24
|
* is editable. The rest of the schema (properties, required, etc.)
|
|
24
25
|
* is visible but locked.
|
|
25
26
|
*/
|
|
26
|
-
declare function PlayJsonEditor():
|
|
27
|
+
declare function PlayJsonEditor(): react.JSX.Element;
|
|
28
|
+
|
|
29
|
+
/** PlayCodeEditor -- CodeEditor in its three uses: a file, a snippet, text. */
|
|
30
|
+
declare function PlayCodeEditor(): react.JSX.Element;
|
|
31
|
+
|
|
32
|
+
/** PlayMarkdownViewer -- a document, and a streamed chat answer. */
|
|
33
|
+
declare function PlayMarkdownViewer(): react.JSX.Element;
|
|
27
34
|
|
|
28
35
|
/**
|
|
29
36
|
* Playground page for testing Form components
|
|
@@ -32,27 +39,30 @@ declare function PlayJsonEditor(): react_jsx_runtime.JSX.Element;
|
|
|
32
39
|
* Tests all custom Form wrapper components that provide consistent
|
|
33
40
|
* label, description, and error handling around base UI components.
|
|
34
41
|
*/
|
|
35
|
-
declare function PlayFormComponents():
|
|
42
|
+
declare function PlayFormComponents(): react.JSX.Element;
|
|
36
43
|
|
|
37
44
|
/**
|
|
38
45
|
* Playground page for testing JsonSchemaFormRenderer
|
|
39
46
|
* Accessible at /playground/forms
|
|
40
47
|
*/
|
|
41
|
-
declare function PlayForms():
|
|
48
|
+
declare function PlayForms(): react.JSX.Element;
|
|
42
49
|
|
|
43
50
|
/**
|
|
44
51
|
* Playground page for testing form widgets
|
|
45
52
|
* Accessible at /playground/form-widgets
|
|
46
53
|
*/
|
|
47
|
-
declare function PlayFormWidgets():
|
|
54
|
+
declare function PlayFormWidgets(): react.JSX.Element;
|
|
48
55
|
|
|
49
56
|
/**
|
|
50
57
|
* PlaySchemaDesigner -- exercises SchemaDesigner: visually author a JsonSchema
|
|
51
|
-
* (and its uiSchema presentation hints), with a live preview.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
58
|
+
* (and its uiSchema presentation hints), with a live preview. Two separate
|
|
59
|
+
* choices: the example schema to work on, simple to advanced, and the
|
|
60
|
+
* capability profile to work with (data/full triage, scoped editing, no
|
|
61
|
+
* preview); the in-designer Capabilities tab tweaks the profile live.
|
|
54
62
|
*/
|
|
55
|
-
declare function PlaySchemaDesigner():
|
|
63
|
+
declare function PlaySchemaDesigner(): react.JSX.Element;
|
|
64
|
+
|
|
65
|
+
declare function PlayQuestionnaireDesigner(): react.JSX.Element;
|
|
56
66
|
|
|
57
67
|
/**
|
|
58
68
|
* Playground page for SearchInput, EntitySelect, EntityTable, and EntityTree.
|
|
@@ -68,7 +78,7 @@ declare function PlaySchemaDesigner(): react_jsx_runtime.JSX.Element;
|
|
|
68
78
|
*/
|
|
69
79
|
|
|
70
80
|
/** Playground sandbox for SearchInput, EntitySelect, and EntityTable. */
|
|
71
|
-
declare function PlayDataComponents():
|
|
81
|
+
declare function PlayDataComponents(): react__default.ReactElement;
|
|
72
82
|
|
|
73
83
|
/**
|
|
74
84
|
* Playground page for @petrarca/sonnet-graph.
|
|
@@ -79,16 +89,42 @@ declare function PlayDataComponents(): React.ReactElement;
|
|
|
79
89
|
* and any consumer app would use to wire their own stores.
|
|
80
90
|
*/
|
|
81
91
|
|
|
82
|
-
declare function PlayGraph():
|
|
92
|
+
declare function PlayGraph(): react__default.ReactElement;
|
|
83
93
|
|
|
84
94
|
/**
|
|
85
95
|
* PlayShellApi -- playground page that exercises the shell API surface.
|
|
86
96
|
*
|
|
87
97
|
* Covers: notification, dialog, navigation, panel, sidePane,
|
|
88
|
-
*
|
|
98
|
+
* the command menu (Cmd+K), and useCollapsedSubNav.
|
|
89
99
|
*/
|
|
90
|
-
declare function PlayShellApi():
|
|
100
|
+
declare function PlayShellApi(): react.JSX.Element;
|
|
91
101
|
|
|
92
|
-
declare function PlayAuth():
|
|
102
|
+
declare function PlayAuth(): react.JSX.Element;
|
|
93
103
|
|
|
94
|
-
|
|
104
|
+
/**
|
|
105
|
+
* FHIR Questionnaire -- end to end: read a FHIR Questionnaire (R4 or R5) as a
|
|
106
|
+
* questionnaire on JSON Schema, fill its form, submit it as a
|
|
107
|
+
* QuestionnaireResponse, and read a response back into the form. Two panes:
|
|
108
|
+
* the FHIR JSON (into the form, editable and read by its pane's action; from
|
|
109
|
+
* the form, generated) and the form.
|
|
110
|
+
*/
|
|
111
|
+
declare function PlayFhirQuestionnaire(): react.JSX.Element;
|
|
112
|
+
|
|
113
|
+
/** The lists, by what the playground offers them as. */
|
|
114
|
+
/** A list the coded-value page offers: its identifier, its label, whether it is a value set or a code system. */
|
|
115
|
+
interface CodedValueList {
|
|
116
|
+
id: string;
|
|
117
|
+
label: string;
|
|
118
|
+
kind: "valueSet" | "system";
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface PlayCodedValuesProps {
|
|
122
|
+
/** The terminology service the page asks; default: lists in memory (staticTerminology). */
|
|
123
|
+
service?: TerminologyService;
|
|
124
|
+
/** The lists the widget offers, the first chosen; default: the in-memory lists'. */
|
|
125
|
+
lists?: CodedValueList[];
|
|
126
|
+
}
|
|
127
|
+
declare function PlayCodedValues({ service, lists, }?: PlayCodedValuesProps): react.JSX.Element;
|
|
128
|
+
|
|
129
|
+
export { PlayAdvancedComponents, PlayAuth, PlayCodeEditor, PlayCodedValues, PlayColorPalette, PlayCoreComponents, PlayDataComponents, PlayFhirQuestionnaire, PlayFormComponents, PlayFormWidgets, PlayForms, PlayGraph, PlayJsonEditor, PlayMarkdownViewer, PlayQuestionnaireDesigner, PlaySchemaDesigner, PlayShellApi, PlayTypography };
|
|
130
|
+
export type { CodedValueList, PlayCodedValuesProps };
|
package/dist/pages/index.js
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PlayGraph
|
|
3
|
+
} from "../chunk-XNDD4UN4.js";
|
|
4
|
+
import {
|
|
5
|
+
PlayShellApi
|
|
6
|
+
} from "../chunk-3RZHYZRL.js";
|
|
7
|
+
import {
|
|
8
|
+
PlayAuth
|
|
9
|
+
} from "../chunk-RYCRENYO.js";
|
|
10
|
+
import {
|
|
11
|
+
PlayFhirQuestionnaire
|
|
12
|
+
} from "../chunk-OUL3DN2E.js";
|
|
13
|
+
import {
|
|
14
|
+
PlayMarkdownViewer
|
|
15
|
+
} from "../chunk-7IMCPUSI.js";
|
|
16
|
+
import {
|
|
17
|
+
PlayFormComponents
|
|
18
|
+
} from "../chunk-32DDRRWU.js";
|
|
1
19
|
import {
|
|
2
20
|
PlayForms
|
|
3
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-LDCNLHO2.js";
|
|
4
22
|
import {
|
|
5
23
|
PlayFormWidgets
|
|
6
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-RLJI5VMP.js";
|
|
7
25
|
import {
|
|
8
|
-
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import {
|
|
11
|
-
PlayDataComponents
|
|
12
|
-
} from "../chunk-O2QMWJZI.js";
|
|
26
|
+
PlayCodedValues
|
|
27
|
+
} from "../chunk-VGAS5Z6X.js";
|
|
13
28
|
import {
|
|
14
|
-
|
|
15
|
-
} from "../chunk-
|
|
29
|
+
PlaySchemaDesigner
|
|
30
|
+
} from "../chunk-EPCUUTBZ.js";
|
|
16
31
|
import {
|
|
17
|
-
|
|
18
|
-
} from "../chunk-
|
|
32
|
+
PlayQuestionnaireDesigner
|
|
33
|
+
} from "../chunk-VKZ2RJFL.js";
|
|
34
|
+
import "../chunk-WR74TMW4.js";
|
|
35
|
+
import "../chunk-QKFQI4VX.js";
|
|
19
36
|
import {
|
|
20
|
-
|
|
21
|
-
} from "../chunk-
|
|
37
|
+
PlayDataComponents
|
|
38
|
+
} from "../chunk-3FYM6B3E.js";
|
|
22
39
|
import {
|
|
23
40
|
PlayTypography
|
|
24
41
|
} from "../chunk-7IBZEHLI.js";
|
|
@@ -27,28 +44,33 @@ import {
|
|
|
27
44
|
} from "../chunk-DA3BIB5N.js";
|
|
28
45
|
import {
|
|
29
46
|
PlayCoreComponents
|
|
30
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-RGBSHXS5.js";
|
|
31
48
|
import {
|
|
32
49
|
PlayAdvancedComponents
|
|
33
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-YTGQRDD2.js";
|
|
34
51
|
import {
|
|
35
52
|
PlayJsonEditor
|
|
36
53
|
} from "../chunk-FZ3ZC7VM.js";
|
|
37
54
|
import {
|
|
38
|
-
|
|
39
|
-
} from "../chunk-
|
|
55
|
+
PlayCodeEditor
|
|
56
|
+
} from "../chunk-LVV32F7G.js";
|
|
40
57
|
import "../chunk-C2EZ2ECG.js";
|
|
41
58
|
export {
|
|
42
59
|
PlayAdvancedComponents,
|
|
43
60
|
PlayAuth,
|
|
61
|
+
PlayCodeEditor,
|
|
62
|
+
PlayCodedValues,
|
|
44
63
|
PlayColorPalette,
|
|
45
64
|
PlayCoreComponents,
|
|
46
65
|
PlayDataComponents,
|
|
66
|
+
PlayFhirQuestionnaire,
|
|
47
67
|
PlayFormComponents,
|
|
48
68
|
PlayFormWidgets,
|
|
49
69
|
PlayForms,
|
|
50
70
|
PlayGraph,
|
|
51
71
|
PlayJsonEditor,
|
|
72
|
+
PlayMarkdownViewer,
|
|
73
|
+
PlayQuestionnaireDesigner,
|
|
52
74
|
PlaySchemaDesigner,
|
|
53
75
|
PlayShellApi,
|
|
54
76
|
PlayTypography
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@petrarca/sonnet-playground",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Playground framework and built-in component demos for the Petrarca Sonnet component library",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,14 +24,15 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"lucide-react": "^0.553.0",
|
|
27
|
-
"sonner": "^2.0.
|
|
28
|
-
"zod": "^4.
|
|
29
|
-
"@petrarca/sonnet-core": "0.
|
|
30
|
-
"@petrarca/sonnet-
|
|
31
|
-
"@petrarca/sonnet-graph": "0.
|
|
32
|
-
"@petrarca/sonnet-schema-designer": "0.
|
|
33
|
-
"@petrarca/sonnet-
|
|
34
|
-
"@petrarca/sonnet-
|
|
27
|
+
"sonner": "^2.0.8",
|
|
28
|
+
"zod": "^4.6.7",
|
|
29
|
+
"@petrarca/sonnet-core": "0.9.0",
|
|
30
|
+
"@petrarca/sonnet-fhir": "0.9.0",
|
|
31
|
+
"@petrarca/sonnet-graph": "0.9.0",
|
|
32
|
+
"@petrarca/sonnet-schema-designer": "0.9.0",
|
|
33
|
+
"@petrarca/sonnet-forms": "0.9.0",
|
|
34
|
+
"@petrarca/sonnet-shell": "0.9.0",
|
|
35
|
+
"@petrarca/sonnet-ui": "0.9.0"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"react": ">=19",
|
|
@@ -40,17 +41,17 @@
|
|
|
40
41
|
"tailwindcss": ">=3"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@types/react": "^19.
|
|
44
|
-
"@types/react-dom": "^19.
|
|
45
|
-
"tsup": "^
|
|
46
|
-
"typescript": "^5.9.
|
|
44
|
+
"@types/react": "^19.3.0",
|
|
45
|
+
"@types/react-dom": "^19.3.0",
|
|
46
|
+
"tsup": "^9.0.0",
|
|
47
|
+
"typescript": "^5.9.3"
|
|
47
48
|
},
|
|
48
49
|
"scripts": {
|
|
49
50
|
"build": "tsup",
|
|
50
51
|
"dev": "tsup --watch",
|
|
51
52
|
"typecheck": "tsc --noEmit",
|
|
52
53
|
"lint": "tsc --noEmit",
|
|
53
|
-
"test": "vitest run",
|
|
54
|
+
"test": "vitest run --config ../../vitest.config.ts",
|
|
54
55
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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\n// A schema exercising every logic construct the designer can author: a oneOf\n// discriminated variant (payment method), if/then/else conditionals (authored\n// as allOf members), a const-tagged field, and a nullable anyOf optional field.\n// x-ui-order places each conditional field right after the property it depends\n// on (see docs/design/logic-authoring.md in the schema-designer package,\n// ordering note).\nconst LOGIC_SCHEMA: JsonSchema = {\n title: \"Checkout\",\n type: \"object\",\n // A reusable definition referenced by $ref (shows read-only expansion).\n $defs: {\n Address: {\n type: \"object\",\n properties: {\n street: { type: \"string\", title: \"Street\" },\n city: { type: \"string\", title: \"City\" },\n zip: { type: \"string\", title: \"ZIP\" },\n },\n },\n },\n \"x-ui-order\": [\n \"schema_version\",\n \"amount\",\n \"requires_approval\",\n \"currency\",\n \"expedited\",\n \"delivery_window\",\n \"gift_wrap\",\n \"gift_message\",\n \"shipping_address\",\n \"note\",\n \"payment\",\n ],\n properties: {\n // A $ref to the shared Address definition (read-only in the tree).\n shipping_address: { $ref: \"#/$defs/Address\", title: \"Shipping address\" },\n // A fixed value carried by every document (const authoring).\n schema_version: {\n type: \"string\",\n title: \"Schema version\",\n const: \"checkout/v1\",\n },\n amount: { type: \"number\", title: \"Amount\", minimum: 0 },\n currency: {\n type: \"string\",\n title: \"Currency\",\n enum: [\"EUR\", \"USD\", \"GBP\"],\n },\n expedited: { type: \"boolean\", title: \"Expedited\" },\n gift_wrap: { type: \"boolean\", title: \"Gift wrap\" },\n // Declarative visibility rule (x-ui-rule): declared at its own position,\n // shown only when gift_wrap is checked. Contrast with the if/then/else\n // fields above, which are structurally added by their conditionals.\n gift_message: {\n type: \"string\",\n title: \"Gift message\",\n \"x-ui-rule\": {\n effect: \"show\",\n condition: { scope: \"/gift_wrap\", schema: { const: true } },\n },\n },\n // Nullable optional (anyOf [T, null]) -- the renderer unwraps to T.\n note: {\n title: \"Note (optional)\",\n anyOf: [{ type: \"string\" }, { type: \"null\" }],\n },\n // A discriminated union (oneOf): the payment method.\n payment: {\n type: \"object\",\n title: \"Payment method\",\n discriminator: { propertyName: \"kind\" },\n oneOf: [\n {\n title: \"Card\",\n properties: {\n kind: { const: \"card\" },\n card_number: { type: \"string\", title: \"Card number\" },\n cvc: { type: \"string\", title: \"CVC\" },\n },\n },\n {\n title: \"Bank transfer\",\n properties: {\n kind: { const: \"bank\" },\n iban: { type: \"string\", title: \"IBAN\" },\n },\n },\n {\n title: \"Cash\",\n properties: { kind: { const: \"cash\" } },\n },\n ],\n },\n },\n required: [\"amount\", \"currency\"],\n // Conditionals (if/then/else) authored as allOf members.\n allOf: [\n {\n // Large amounts require an approval reference.\n if: {\n properties: { amount: { exclusiveMinimum: 1000 } },\n required: [\"amount\"],\n },\n then: {\n properties: {\n requires_approval: {\n type: \"string\",\n title: \"Approval reference\",\n },\n },\n required: [\"requires_approval\"],\n },\n },\n {\n // Expedited orders ask for a delivery window; otherwise none.\n if: {\n properties: { expedited: { const: true } },\n required: [\"expedited\"],\n },\n then: {\n properties: {\n delivery_window: {\n type: \"string\",\n title: \"Delivery window\",\n enum: [\"morning\", \"afternoon\", \"evening\"],\n },\n },\n },\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\" | \"logic\";\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 logic: {\n label: \"Logic (variants + conditionals)\",\n description:\n \"Shows every logic construct: a oneOf variant, if/then/else conditionals, a const field, and a nullable optional.\",\n schema: LOGIC_SCHEMA,\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;AAySrB,SACE,KADF;AAtSN,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,OAAO,EAAE,MAAM,UAAU,QAAQ,SAAS,OAAO,QAAQ;AAAA,QACzD,OAAO,EAAE,MAAM,UAAU,OAAO,QAAQ;AAAA,MAC1C;AAAA,MACA,UAAU,CAAC,OAAO;AAAA,IACpB;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAU;AAAA,MACV,OAAO;AAAA,QACL,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ,EAAE,MAAM,UAAU,OA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