@petrarca/sonnet-playground 0.2.0 → 0.4.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 +142 -0
- package/dist/PlayAdvancedComponents-ZYK66UII.js +8 -0
- package/dist/PlayColorPalette-IWECRZUS.js +8 -0
- package/dist/PlayCoreComponents-GXFMB24T.js +8 -0
- package/dist/PlayDataComponents-M4SJ4XEL.js +8 -0
- package/dist/PlayFormComponents-4E2A2Y2W.js +8 -0
- package/dist/PlayFormWidgets-IWJJQ5XL.js +8 -0
- package/dist/PlayForms-FOF3XE6G.js +7 -0
- package/dist/PlayGraph-3F56PREG.js +7 -0
- package/dist/PlayJsonEditor-SYZYEJEA.js +7 -0
- package/dist/PlayShellApi-5O6VYR2X.js +8 -0
- package/dist/PlayShellApi-5O6VYR2X.js.map +1 -0
- package/dist/PlayTypography-T6SMPHUB.js +8 -0
- package/dist/PlayTypography-T6SMPHUB.js.map +1 -0
- package/dist/chunk-32DDRRWU.js +617 -0
- package/dist/chunk-32DDRRWU.js.map +1 -0
- package/dist/chunk-4Y4JFKAK.js +240 -0
- package/dist/chunk-4Y4JFKAK.js.map +1 -0
- package/dist/{chunk-QIETZUEN.js → chunk-6DZ3TSV4.js} +66 -71
- package/dist/chunk-6DZ3TSV4.js.map +1 -0
- package/dist/{chunk-CYNK2P2Q.js → chunk-7IBZEHLI.js} +14 -13
- package/dist/chunk-7IBZEHLI.js.map +1 -0
- package/dist/chunk-C2EZ2ECG.js +40 -0
- package/dist/chunk-C2EZ2ECG.js.map +1 -0
- package/dist/chunk-CQ6PGFRV.js +341 -0
- package/dist/chunk-CQ6PGFRV.js.map +1 -0
- package/dist/{chunk-A3IK3CVW.js → chunk-DA3BIB5N.js} +24 -25
- package/dist/{chunk-A3IK3CVW.js.map → chunk-DA3BIB5N.js.map} +1 -1
- package/dist/chunk-DZB6WFHA.js +401 -0
- package/dist/chunk-DZB6WFHA.js.map +1 -0
- package/dist/{chunk-KAT24CQQ.js → chunk-FZ3ZC7VM.js} +8 -6
- package/dist/chunk-FZ3ZC7VM.js.map +1 -0
- package/dist/{chunk-PGI54O43.js → chunk-VOC5VZG2.js} +84 -46
- package/dist/chunk-VOC5VZG2.js.map +1 -0
- package/dist/{chunk-TZGJH7YS.js → chunk-YEBK2TUW.js} +325 -331
- package/dist/chunk-YEBK2TUW.js.map +1 -0
- package/dist/chunk-YOOWJORD.js +934 -0
- package/dist/chunk-YOOWJORD.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.js +41 -17
- package/dist/index.js.map +1 -1
- package/dist/pages/index.d.ts +15 -11
- package/dist/pages/index.js +20 -12
- package/package.json +6 -6
- package/dist/PlayColorPalette-UFMTJTUB.js +0 -8
- package/dist/PlayCoreComponents-7QCDFQLT.js +0 -7
- package/dist/PlayDataComponents-GZSRTW4F.js +0 -7
- package/dist/PlayFormComponents-RJB6WZHD.js +0 -7
- package/dist/PlayFormWidgets-OFV7TJKH.js +0 -7
- package/dist/PlayForms-24XX5DC6.js +0 -7
- package/dist/PlayGraph-FLGLSUWV.js +0 -8
- package/dist/PlayJsonEditor-4L5INQPU.js +0 -7
- package/dist/PlayTypography-ID6DLFZD.js +0 -8
- package/dist/chunk-5V27QDAY.js +0 -617
- package/dist/chunk-5V27QDAY.js.map +0 -1
- package/dist/chunk-CYNK2P2Q.js.map +0 -1
- package/dist/chunk-FTN2A5YL.js +0 -20
- package/dist/chunk-FTN2A5YL.js.map +0 -1
- package/dist/chunk-GYKEPHHA.js +0 -1154
- package/dist/chunk-GYKEPHHA.js.map +0 -1
- package/dist/chunk-KAT24CQQ.js.map +0 -1
- package/dist/chunk-P7I5IDXA.js +0 -432
- package/dist/chunk-P7I5IDXA.js.map +0 -1
- package/dist/chunk-PGI54O43.js.map +0 -1
- package/dist/chunk-QIETZUEN.js.map +0 -1
- package/dist/chunk-TZGJH7YS.js.map +0 -1
- /package/dist/{PlayColorPalette-UFMTJTUB.js.map → PlayAdvancedComponents-ZYK66UII.js.map} +0 -0
- /package/dist/{PlayCoreComponents-7QCDFQLT.js.map → PlayColorPalette-IWECRZUS.js.map} +0 -0
- /package/dist/{PlayDataComponents-GZSRTW4F.js.map → PlayCoreComponents-GXFMB24T.js.map} +0 -0
- /package/dist/{PlayFormComponents-RJB6WZHD.js.map → PlayDataComponents-M4SJ4XEL.js.map} +0 -0
- /package/dist/{PlayFormWidgets-OFV7TJKH.js.map → PlayFormComponents-4E2A2Y2W.js.map} +0 -0
- /package/dist/{PlayForms-24XX5DC6.js.map → PlayFormWidgets-IWJJQ5XL.js.map} +0 -0
- /package/dist/{PlayGraph-FLGLSUWV.js.map → PlayForms-FOF3XE6G.js.map} +0 -0
- /package/dist/{PlayJsonEditor-4L5INQPU.js.map → PlayGraph-3F56PREG.js.map} +0 -0
- /package/dist/{PlayTypography-ID6DLFZD.js.map → PlayJsonEditor-SYZYEJEA.js.map} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# @petrarca/sonnet-playground
|
|
2
|
+
|
|
3
|
+
Playground framework and built-in component demos for the Petrarca Sonnet
|
|
4
|
+
component library.
|
|
5
|
+
|
|
6
|
+
## What's included
|
|
7
|
+
|
|
8
|
+
**Playground framework** — Registry, overview tile grid, and `createPlaygroundModule()`
|
|
9
|
+
factory. Wire a playground into any `sonnet-shell` app with a few lines.
|
|
10
|
+
|
|
11
|
+
**Built-in demos** — Pre-built showcase pages for all Sonnet components:
|
|
12
|
+
Typography, Color Palette, Core UI, Advanced Components, JSON Editor, Forms,
|
|
13
|
+
Form Components, Form Widgets, Data Components, Graph Visualization, Shell API.
|
|
14
|
+
|
|
15
|
+
**PlaygroundSection** — Shared section wrapper (`default` and `card` variants)
|
|
16
|
+
used by all playground pages.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm add @petrarca/sonnet-playground
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Peer dependencies: `react`, `react-dom`, `@petrarca/sonnet-shell`,
|
|
27
|
+
`@petrarca/sonnet-ui`, `@petrarca/sonnet-forms`, `@petrarca/sonnet-graph`.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Basic usage
|
|
32
|
+
|
|
33
|
+
```ts
|
|
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
|
+
---
|
|
74
|
+
|
|
75
|
+
## Adding app-specific pages
|
|
76
|
+
|
|
77
|
+
Register your own pages alongside the built-in demos by calling
|
|
78
|
+
`registry.register()` before passing the registry to `createPlaygroundModule`.
|
|
79
|
+
Pages appear in the overview tile grid grouped under your chosen `group` label.
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
// src/modules/playground/index.ts
|
|
83
|
+
import { lazy } from "react";
|
|
84
|
+
import { Search } from "lucide-react";
|
|
85
|
+
import {
|
|
86
|
+
createPlaygroundRegistry,
|
|
87
|
+
createPlaygroundModule,
|
|
88
|
+
} from "@petrarca/sonnet-playground";
|
|
89
|
+
|
|
90
|
+
const registry = createPlaygroundRegistry();
|
|
91
|
+
|
|
92
|
+
// Register app-specific pages
|
|
93
|
+
registry.register({
|
|
94
|
+
id: "app.my-widget",
|
|
95
|
+
title: "My Widget",
|
|
96
|
+
description: "Interactive demo of MyWidget with live configuration.",
|
|
97
|
+
icon: Search,
|
|
98
|
+
color: "teal",
|
|
99
|
+
path: "my-widget",
|
|
100
|
+
component: lazy(() => import("./pages/PlayMyWidget")),
|
|
101
|
+
group: "App Components", // appears as a group heading in the overview
|
|
102
|
+
order: 0,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export default createPlaygroundModule(registry);
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pages are lazy-loaded automatically — wrap the component in `React.lazy()`
|
|
109
|
+
as shown above. The framework handles the `Suspense` boundary.
|
|
110
|
+
|
|
111
|
+
`group` is optional. Pages without a group appear under the default group in
|
|
112
|
+
the overview. Pages with the same `group` string are grouped together.
|
|
113
|
+
|
|
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` |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
See [LICENSE.md](../../LICENSE.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|