@petrarca/sonnet-playground 0.6.0 → 0.7.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 +63 -101
- package/dist/PlayAuth-SOEYPOOL.js +8 -0
- package/dist/PlayForms-L532W3JL.js +7 -0
- package/dist/PlayGraph-M4KQSFI7.js +7 -0
- package/dist/PlaySchemaDesigner-S4DBB53G.js +7 -0
- package/dist/PlaySchemaDesigner-S4DBB53G.js.map +1 -0
- package/dist/{chunk-6VQJFBTM.js → chunk-2XMWOZ5O.js} +1 -1
- package/dist/chunk-2XMWOZ5O.js.map +1 -0
- package/dist/{chunk-C2P3UQMZ.js → chunk-E5X7GVLU.js} +2 -2
- package/dist/chunk-E5X7GVLU.js.map +1 -0
- package/dist/{chunk-ZSUCFEB6.js → chunk-I2FLG6ZD.js} +2 -1
- package/dist/{chunk-ZSUCFEB6.js.map → chunk-I2FLG6ZD.js.map} +1 -1
- package/dist/chunk-RYCRENYO.js +401 -0
- package/dist/chunk-RYCRENYO.js.map +1 -0
- package/dist/index.d.ts +20 -10
- package/dist/index.js +50 -5
- package/dist/index.js.map +1 -1
- package/dist/pages/index.d.ts +3 -1
- package/dist/pages/index.js +7 -3
- package/package.json +7 -7
- package/dist/PlayForms-2G7PROCH.js +0 -7
- package/dist/PlayGraph-M7UE5MZC.js +0 -7
- package/dist/PlaySchemaDesigner-ZM4F7KBU.js +0 -7
- package/dist/chunk-6VQJFBTM.js.map +0 -1
- package/dist/chunk-C2P3UQMZ.js.map +0 -1
- /package/dist/{PlayForms-2G7PROCH.js.map → PlayAuth-SOEYPOOL.js.map} +0 -0
- /package/dist/{PlayGraph-M7UE5MZC.js.map → PlayForms-L532W3JL.js.map} +0 -0
- /package/dist/{PlaySchemaDesigner-ZM4F7KBU.js.map → PlayGraph-M4KQSFI7.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
# @petrarca/sonnet-playground
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
The living reference for the Petrarca Sonnet component library: a registry of
|
|
4
|
+
demonstration pages and a factory that turns it into a `ShellModule`. It is a
|
|
5
|
+
library, not a hosted site -- you mount it in your own application and get a
|
|
6
|
+
working component reference inside your own build
|
|
7
|
+
([ADR-0005](../../docs/adr/0005-the-playground-is-the-living-documentation.md)).
|
|
5
8
|
|
|
6
|
-
## What
|
|
9
|
+
## What it provides
|
|
7
10
|
|
|
8
|
-
**
|
|
9
|
-
|
|
11
|
+
**A registry.** `PlaygroundRegistry` and `createPlaygroundRegistry`, which
|
|
12
|
+
returns one pre-populated with the built-in entries. Register your own pages
|
|
13
|
+
beside them, grouped under a label you choose.
|
|
10
14
|
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
**A module factory.** `createPlaygroundModule` turns a registry into a
|
|
16
|
+
`ShellModule` with an overview page, generated routes and navigation, ready to
|
|
17
|
+
pass to `createModuleRegistry`.
|
|
14
18
|
|
|
15
|
-
**
|
|
16
|
-
|
|
19
|
+
**Twelve built-in pages**, each lazily loaded: Typography and Color Palette
|
|
20
|
+
under Design System; Core UI Components, Advanced Components and JSON Editor
|
|
21
|
+
under Components; Form Components, Forms Renderer and Form Widgets under Forms;
|
|
22
|
+
Schema Designer under Schemas; Data Components under Data; Graph Visualization
|
|
23
|
+
under Graph; Shell API under Shell.
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
**Page building blocks.** `PlaygroundSection` for consistent section chrome,
|
|
26
|
+
`PlaygroundOverview` for the tile grid, and the playground settings provider,
|
|
27
|
+
hook and panel.
|
|
19
28
|
|
|
20
29
|
## Install
|
|
21
30
|
|
|
@@ -23,120 +32,73 @@ used by all playground pages.
|
|
|
23
32
|
pnpm add @petrarca/sonnet-playground
|
|
24
33
|
```
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
That single install pulls in all six other `@petrarca/sonnet-*` packages --
|
|
36
|
+
`sonnet-core`, `sonnet-ui`, `sonnet-forms`, `sonnet-shell`, `sonnet-graph` and
|
|
37
|
+
`sonnet-schema-designer` -- as regular dependencies, because the pages import
|
|
38
|
+
from every one of them.
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// src/modules/playground/index.ts
|
|
35
|
-
import {
|
|
36
|
-
createPlaygroundRegistry,
|
|
37
|
-
createPlaygroundModule,
|
|
38
|
-
} from "@petrarca/sonnet-playground";
|
|
39
|
-
|
|
40
|
-
const registry = createPlaygroundRegistry();
|
|
41
|
-
|
|
42
|
-
// Optionally add app-specific pages:
|
|
43
|
-
registry.register({
|
|
44
|
-
id: "app.my-page",
|
|
45
|
-
title: "My Page",
|
|
46
|
-
description: "Custom demo page.",
|
|
47
|
-
icon: SomeIcon,
|
|
48
|
-
color: "teal",
|
|
49
|
-
path: "my-page",
|
|
50
|
-
component: React.lazy(() => import("./pages/MyPage")),
|
|
51
|
-
group: "App",
|
|
52
|
-
order: 0,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export default createPlaygroundModule(registry);
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
// src/modules/registry.ts
|
|
60
|
-
import { createModuleRegistry } from "@petrarca/sonnet-shell";
|
|
61
|
-
import home from "./home";
|
|
62
|
-
import playground from "./playground";
|
|
63
|
-
|
|
64
|
-
export const registry = createModuleRegistry([
|
|
65
|
-
home,
|
|
66
|
-
playground, // pinBottom: true is set automatically by createPlaygroundModule
|
|
67
|
-
]);
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
`createPlaygroundModule` returns a `ShellModule` — pass it directly to
|
|
71
|
-
`createModuleRegistry` alongside your app's own modules.
|
|
72
|
-
|
|
73
|
-
---
|
|
40
|
+
| Peer | Range | Needed for |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| `react`, `react-dom` | `>=19` | Everything |
|
|
43
|
+
| `react-router-dom` | `>=7` | The generated routes and the layout outlet |
|
|
44
|
+
| `tailwindcss` | `>=3` | Every page's styling |
|
|
74
45
|
|
|
75
|
-
|
|
46
|
+
Those dependencies carry further peers of their own, and some that are only
|
|
47
|
+
optional down there are required here -- the graph page needs every renderer
|
|
48
|
+
peer, and the JSON editor page needs CodeMirror. Getting that wrong shows up as
|
|
49
|
+
one page throwing rather than as an install error. See
|
|
50
|
+
[getting started](docs/usage/getting-started.md).
|
|
76
51
|
|
|
77
|
-
|
|
78
|
-
`registry.register()` before passing the registry to `createPlaygroundModule`.
|
|
79
|
-
Pages appear in the overview tile grid grouped under your chosen `group` label.
|
|
52
|
+
## Usage
|
|
80
53
|
|
|
81
54
|
```ts
|
|
82
55
|
// src/modules/playground/index.ts
|
|
83
56
|
import { lazy } from "react";
|
|
84
|
-
import {
|
|
57
|
+
import { Boxes } from "lucide-react";
|
|
85
58
|
import {
|
|
86
|
-
createPlaygroundRegistry,
|
|
87
59
|
createPlaygroundModule,
|
|
60
|
+
createPlaygroundRegistry,
|
|
88
61
|
} from "@petrarca/sonnet-playground";
|
|
89
62
|
|
|
90
63
|
const registry = createPlaygroundRegistry();
|
|
91
64
|
|
|
92
|
-
// Register app-specific pages
|
|
93
65
|
registry.register({
|
|
94
|
-
id: "app.
|
|
95
|
-
title: "
|
|
96
|
-
description: "Interactive demo of
|
|
97
|
-
icon:
|
|
66
|
+
id: "app.widgets",
|
|
67
|
+
title: "Widgets",
|
|
68
|
+
description: "Interactive demo of the Widget components.",
|
|
69
|
+
icon: Boxes,
|
|
98
70
|
color: "teal",
|
|
99
|
-
path: "
|
|
100
|
-
component: lazy(() => import("./pages/
|
|
101
|
-
group: "App Components",
|
|
71
|
+
path: "widgets",
|
|
72
|
+
component: lazy(() => import("./pages/PlayWidgets")),
|
|
73
|
+
group: "App Components",
|
|
102
74
|
order: 0,
|
|
103
75
|
});
|
|
104
76
|
|
|
105
77
|
export default createPlaygroundModule(registry);
|
|
106
78
|
```
|
|
107
79
|
|
|
108
|
-
|
|
109
|
-
|
|
80
|
+
`createPlaygroundModule` returns a `ShellModule`, so it goes into
|
|
81
|
+
`createModuleRegistry` alongside your own modules. Its options are `icon`,
|
|
82
|
+
`label`, `basePath`, `overviewTitle`, `overviewSubtitle` and `grouped`; the
|
|
83
|
+
defaults are `FlaskConical`, `"Playground"`, `"/playground"`,
|
|
84
|
+
`"Developer Playground"`, `"Experiment with components, test features, and
|
|
85
|
+
explore capabilities."` and `true`.
|
|
110
86
|
|
|
111
|
-
|
|
112
|
-
|
|
87
|
+
Individual built-in pages are available from
|
|
88
|
+
`@petrarca/sonnet-playground/pages` when you want one on a route of your own.
|
|
113
89
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
## Pages subpath
|
|
117
|
-
|
|
118
|
-
Individual built-in pages are available at `@petrarca/sonnet-playground/pages`
|
|
119
|
-
for consumers who want to cherry-pick or re-export them:
|
|
120
|
-
|
|
121
|
-
```tsx
|
|
122
|
-
import { PlayTypography, PlayColorPalette } from "@petrarca/sonnet-playground/pages";
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## createPlaygroundModule options
|
|
128
|
-
|
|
129
|
-
| Option | Type | Default |
|
|
130
|
-
|---|---|---|
|
|
131
|
-
| `icon` | `LucideIcon` | `FlaskConical` |
|
|
132
|
-
| `label` | `string` | `"Playground"` |
|
|
133
|
-
| `basePath` | `string` | `"/playground"` |
|
|
134
|
-
| `overviewTitle` | `string` | `"Developer Playground"` |
|
|
135
|
-
| `overviewSubtitle` | `string` | `""` |
|
|
136
|
-
| `grouped` | `boolean` | `true` |
|
|
90
|
+
## Documentation
|
|
137
91
|
|
|
138
|
-
|
|
92
|
+
- [Usage guides](docs/usage/index.md) -- getting started,
|
|
93
|
+
[adding pages](docs/usage/adding-pages.md) and
|
|
94
|
+
[embedding](docs/usage/embedding.md).
|
|
95
|
+
- [Design docs](docs/design/index.md) -- the registry model and the page
|
|
96
|
+
contract.
|
|
97
|
+
- [sonnet-shell: getting started](../sonnet-shell/docs/usage/getting-started.md)
|
|
98
|
+
-- the application frame this module plugs into.
|
|
99
|
+
- [Workspace documentation](../../docs/README.md) -- how the packages layer and
|
|
100
|
+
the architecture decision records.
|
|
139
101
|
|
|
140
102
|
## License
|
|
141
103
|
|
|
142
|
-
See [LICENSE.md](../../LICENSE.md).
|
|
104
|
+
Apache 2.0. See [LICENSE.md](../../LICENSE.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -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\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,QA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;AAAA,QAEC;AAAA,QACA;AAAA,QACA,cAAc,QAAQ;AAAA,QACtB,UAAU,QAAQ;AAAA,QAClB,UAAU,CAAC,YAAY,iBAAiB;AACtC,oBAAU,UAAU;AACpB,sBAAY,YAAY;AAAA,QAC1B;AAAA;AAAA,MARK;AAAA,IASP,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -419,7 +419,7 @@ function createPlaygroundStores() {
|
|
|
419
419
|
expandNode: async () => ({ nodes: [], edges: [], has_more: false }),
|
|
420
420
|
getNodes: async () => []
|
|
421
421
|
});
|
|
422
|
-
return { graphFilter, graphData, graphExploration, selection };
|
|
422
|
+
return { graphFilter, graphData, graphExploration, selection, graphFocus };
|
|
423
423
|
}
|
|
424
424
|
var PLAYGROUND_STORES = createPlaygroundStores();
|
|
425
425
|
var EMPTY_DATA = { nodes: [], edges: [] };
|
|
@@ -1055,4 +1055,4 @@ function PlayGraph() {
|
|
|
1055
1055
|
export {
|
|
1056
1056
|
PlayGraph
|
|
1057
1057
|
};
|
|
1058
|
-
//# sourceMappingURL=chunk-
|
|
1058
|
+
//# sourceMappingURL=chunk-E5X7GVLU.js.map
|
|
@@ -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: a technology / 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, graphFocus };\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 small healthcare-organization example.\n// Node-type labels are the organization types (Network, Hospital, Department,\n// Practice). Relations are directional triples: `partOf` is containment\n// (child -> parent, FHIR Organization.partOf); `affiliation` is a\n// non-hierarchical link (FHIR OrganizationAffiliation). Directionality\n// 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,SAAgB,aAAa,SAAS,QAAQ,gBAAgB;AAC9D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP,SAAS,uBAA4C;;;ACSrD,SAAS,kBAAkB,OAAiC;AAC1D,QAAM,SAAS;AAAA,IACb,GAAG,MAAM,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;AAAA,IACpC,GAAG,MAAM,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;AAAA,EACtC;AACA,QAAM,MAAM,OAAO,OAAO,CAAC,GAAG,OAAQ,KAAK,IAAI,KAAK,GAAI,CAAC;AACzD,MAAI,OAAO,MAAM;AACjB,SAAO,MAAM;AACf;AAGA,SAAS,aACP,OACA,IACuD;AACvD,SAAO;AAAA,IACL,SAAS,MAAM,MAAM,OAAO,CAAC,MAAM,EAAE,YAAY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AA,KAAC,eAAY,OAAM,sBAAqB,WAAU,QAChD,0BAAAA,KAAC,mBAAgB,QAAQ,YAAY,SAAS,eAAe,GAC/D;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["FormSelect","jsx"]}
|
|
@@ -836,6 +836,7 @@ function FormColumn({
|
|
|
836
836
|
onCancel: handleCancel,
|
|
837
837
|
onValidationChange: handleValidationChange,
|
|
838
838
|
showActions: true,
|
|
839
|
+
allowPristineSave: true,
|
|
839
840
|
deferStateUpdates: state.deferStateUpdates,
|
|
840
841
|
saveLabel: "Save Changes",
|
|
841
842
|
cancelLabel: "Reset",
|
|
@@ -974,4 +975,4 @@ function PlayForms() {
|
|
|
974
975
|
export {
|
|
975
976
|
PlayForms
|
|
976
977
|
};
|
|
977
|
-
//# sourceMappingURL=chunk-
|
|
978
|
+
//# sourceMappingURL=chunk-I2FLG6ZD.js.map
|