@marianmeres/stuic 3.153.0 → 3.155.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- 63 Svelte 5 component directories with consistent API patterns. All use runes-based reactivity.
5
+ 64 Svelte 5 component directories with consistent API patterns. All use runes-based reactivity.
6
6
 
7
7
  ## Component Categories
8
8
 
@@ -62,6 +62,7 @@
62
62
  | CronInput | Cron expression editor with presets and validation |
63
63
  | Fieldset | Field grouping with legend |
64
64
  | FieldKeyValues | Key-value pair editor |
65
+ | FieldsBuilder | Field-definition list editor ("what properties does a thing have?") |
65
66
  | FieldAssets | File/asset management |
66
67
  | LoginForm, LoginFormModal | Standalone login form with optional modal variant |
67
68
  | RegisterForm | Standalone registration form with declarative extra fields |
@@ -509,6 +510,65 @@ Exported from Input: `FieldObject`, `FieldObjectProps`.
509
510
 
510
511
  ---
511
512
 
513
+ ## FieldsBuilder
514
+
515
+ Composite form control for authoring an ordered list of field definitions — the end
516
+ user (typically non-technical) answers "what properties does a thing have?": add a
517
+ field, name it, pick its type, mark it required, reorder, delete. The bindable `value`
518
+ is a plain `FieldDef[]`; the type palette is a required prop (`types`), never a
519
+ built-in union. Emits a field list, NOT JSON Schema — compiling (and re-validating)
520
+ the list is the consumer's job, server-side. Own directory: `components/FieldsBuilder/`
521
+ (composes `InputWrap`, exports the validate quintet).
522
+
523
+ ### Exports
524
+
525
+ | Export | Kind | Description |
526
+ | ------------------------------------------------------------------ | --------- | ----------------------------------------------------------- |
527
+ | `FieldsBuilder` | component | Main component |
528
+ | `FieldsBuilderProps` | type | Props type |
529
+ | `FieldDef` | type | One field definition (the value unit) |
530
+ | `FieldLock` | type | Per-field edit locks |
531
+ | `FieldOptionDef` | type | Choice-type option `{ value, label }` |
532
+ | `FieldTypeDef` | type | Palette entry |
533
+ | `FieldTypeExtraDef` | type | Palette-declared boolean extra |
534
+ | `LocalizedText` | type | `string \| Record<language, string>` |
535
+ | `FIELDS_BUILDER_DEFAULT_TYPES` | constant | Starter palette (text/longtext/number/checkbox/select/date) |
536
+ | `FIELDS_BUILDER_DEFAULT_KEY_PATTERN` | constant | `/^[a-z][a-z0-9_]{0,62}$/` |
537
+ | `getLocalizedText`, `slugifyKey`, `uniqueKey`, `validateFieldDefs` | functions | Pure helpers (node-testable) |
538
+
539
+ ### Key Props
540
+
541
+ | Prop | Type | Default | Description |
542
+ | -------------------- | ---------------------------------------------- | -------- | ------------------------------------------------ |
543
+ | `value` | `FieldDef[]` | required | Bindable ordered field list |
544
+ | `name` | `string` | required | Hidden-input name |
545
+ | `types` | `FieldTypeDef[]` | required | The type palette |
546
+ | `languages` | `string[]` | — | Multi-language labels/descriptions/options |
547
+ | `keysImmutable` | `boolean` | `true` | Freeze keys loaded from `value` |
548
+ | `deriveKeyFromLabel` | `boolean \| (label) => string` | `true` | Live slug derivation (diacritics transliterated) |
549
+ | `reservedKeys` | `string[] \| (key) => boolean` | — | Forbidden keys (derivation auto-avoids them) |
550
+ | `deleteMode` | `"mark" \| "immediate"` | `"mark"` | Mark+undo vs outright removal |
551
+ | `onBeforeDelete` | `(field) => void \| false \| Promise` | — | Delete veto (Tree `onMove`-style) |
552
+ | `onBeforeTypeChange` | `(field, newType) => void \| false \| Promise` | — | Type-change veto for pre-existing fields |
553
+ | `preview` | `Snippet<[{ fields }]>` | — | Live preview pane (side-by-side when wide) |
554
+ | `maxFields` | `number` | — | Add-limit |
555
+
556
+ Features: collapsed rows (label + key + type chip) expanding to the full editor;
557
+ drag reorder + Move up/down buttons with aria-live announcements; `lock.*` per-field
558
+ locks (label/description always editable); unknown-type rows render degraded
559
+ read-only and round-trip untouched; per-row inline validation with
560
+ focus-first-offender `validate()`.
561
+
562
+ ### CSS Tokens
563
+
564
+ Prefix: `--stuic-fields-builder-*`
565
+
566
+ `row-border`, `row-toggle-bg-hover`, `key-text`, `chip-bg`, `chip-text`, `chip-radius`,
567
+ `muted-text`, `warning-text`, `error-text`, `drop-indicator-color`,
568
+ `drop-indicator-height`, `row-opacity-dragging`, `row-opacity-deleted`, `preview-border`
569
+
570
+ ---
571
+
512
572
  ## Checkout Components
513
573
 
514
574
  14 exported sub-components organized as atomic building blocks + composite step pages.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "3.153.0",
3
+ "version": "3.155.0",
4
4
  "packageManager": "pnpm@11.5.0",
5
5
  "scripts": {
6
6
  "dev": "vite dev",