create-kywi-app 0.6.4 → 0.6.5
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/assets/agent-patterns.md
CHANGED
|
@@ -308,8 +308,12 @@ Full recipe, worked example and hazards: the **`kywi-custom-modules` skill**.
|
|
|
308
308
|
**Design the props for the owner, not for yourself.** The props panel gives the
|
|
309
309
|
owner real controls for `text`/`textarea`/`richText` (text inputs),
|
|
310
310
|
`image`/`file` (media picker), `boolean` (checkbox) and `number`/`date`/`color`
|
|
311
|
-
(native inputs); `select
|
|
312
|
-
|
|
311
|
+
(native inputs); `select` and `multiSelect` render a real dropdown or checkbox
|
|
312
|
+
group when the prop declares `options` — `{ value, label }` pairs, or bare
|
|
313
|
+
strings where the string serves as both — so declare options for every closed
|
|
314
|
+
choice instead of trusting the owner to type the right value. `slug` and
|
|
315
|
+
`relationship` have no options field and are still plain text inputs; that's
|
|
316
|
+
the one place to name the allowed values in the label. A `json` prop is a
|
|
313
317
|
raw JSON textarea — developer territory. A "three stats" module with `stats: {
|
|
314
318
|
type: 'json' }` has taken the copy away from the owner; the same module with
|
|
315
319
|
`stat1Value` / `stat1Label` … as `text` props hasn't.
|
|
@@ -53,7 +53,8 @@ it — then pick the type:
|
|
|
53
53
|
| `image` / `file` | media picker | anything from the Media library |
|
|
54
54
|
| `boolean` | checkbox | layout flips (`reverse`), show/hide |
|
|
55
55
|
| `number` / `date` / `color` | native inputs | counts, deadlines, accents |
|
|
56
|
-
| `select` / `
|
|
56
|
+
| `select` / `multiSelect` | dropdown / checkbox group (needs `options`) | closed choices — declare `options: [{ value, label }, …]` (bare strings also work) per prop |
|
|
57
|
+
| `slug` / `relationship` | plain text input | constrained values with no options field yet — name the allowed values in the label |
|
|
57
58
|
| `json` | raw JSON textarea | **developer territory** — structure the owner never edits |
|
|
58
59
|
|
|
59
60
|
Two rules that decide whether the module is really editable:
|
|
@@ -84,6 +85,15 @@ export default defineKywiConfig({
|
|
|
84
85
|
body: { type: 'richText', label: 'Body' },
|
|
85
86
|
image: { type: 'image', label: 'Image' },
|
|
86
87
|
imageAlt: { type: 'text', label: 'Image alt text' },
|
|
88
|
+
layout: {
|
|
89
|
+
type: 'select',
|
|
90
|
+
label: 'Layout',
|
|
91
|
+
options: [
|
|
92
|
+
{ value: 'split', label: 'Media / text split' },
|
|
93
|
+
{ value: 'stacked', label: 'Stacked' },
|
|
94
|
+
],
|
|
95
|
+
defaultValue: 'split',
|
|
96
|
+
}, // closed choice = real dropdown
|
|
87
97
|
reverse: { type: 'boolean', label: 'Image on the left', defaultValue: false },
|
|
88
98
|
},
|
|
89
99
|
}),
|
package/package.json
CHANGED