@cosmicdrift/kumiko-types 0.239.0 → 0.240.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/screen.ts +49 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.239.0",
3
+ "version": "0.240.0",
4
4
  "description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
package/src/screen.ts CHANGED
@@ -697,7 +697,11 @@ export type EditFieldSpec =
697
697
  // id, so a bundled feature (e.g. custom-fields) can load and persist its
698
698
  // own data inside the form. `relatedList` runs its own query instead —
699
699
  // see `EditRelatedListSection`.
700
- export type EditSectionSpec = EditFieldsSection | EditExtensionSection | EditRelatedListSection;
700
+ export type EditSectionSpec =
701
+ | EditFieldsSection
702
+ | EditExtensionSection
703
+ | EditRelatedListSection
704
+ | EditWriteFormSection;
701
705
 
702
706
  export type EditFieldsSection = {
703
707
  /** Kebab-case tab id, used as the `?tab=` value. Required by the
@@ -766,6 +770,50 @@ export type EditRelatedListSection = {
766
770
  * is named here. `idColumn` names the row key holding that id (default
767
771
  * "id"). Omit `rowClick` for a non-interactive list. */
768
772
  readonly rowClick?: { readonly entity: string; readonly idColumn?: string };
773
+ /** Per-row actions — same type and dispatch semantics as `entityList`/
774
+ * `projectionList`'s `rowActions` (writeHandler dispatch with a
775
+ * declarative `payload` extractor, or navigate). A successful
776
+ * writeHandler action re-runs this section's own query, same as a
777
+ * projectionList row action re-running its list query. */
778
+ readonly rowActions?: readonly RowAction[];
779
+ };
780
+
781
+ // A declarative, self-persisting form section for `projectionDetail`
782
+ // (fw editable-detail-screens). Unlike the plain `fields` section — which
783
+ // projectionDetail forces read-only, see the type's own doc — this section's
784
+ // fields ARE editable and submit through their own write-handler, entirely
785
+ // independent of the (nonexistent) outer form submit. Modeled on
786
+ // `ActionFormScreenDefinition`: `fieldDefs` carries the field-type map (a
787
+ // projectionDetail's synthesized display entity has no real field types to
788
+ // draw on), `fields` the rendered order/overrides, same as
789
+ // `EditFieldsSection.fields`. Only supported on projectionDetail — the
790
+ // boot-validator rejects it on entityEdit/configEdit/actionForm, same as
791
+ // `relatedList`.
792
+ export type EditWriteFormSection = {
793
+ /** Kebab-case tab id, used as the `?tab=` value. Required by the
794
+ * boot-validator when the enclosing `EditLayout.mode` is "tabs". */
795
+ readonly id?: string;
796
+ readonly kind: "writeForm";
797
+ readonly title?: string;
798
+ readonly description?: string;
799
+ readonly columns?: number;
800
+ readonly icon?: IconKey;
801
+ /** Field-type map for this section's own form — same shape as
802
+ * `ActionFormScreenDefinition.fields`. */
803
+ readonly fieldDefs: Readonly<Record<string, FieldDefinition>>;
804
+ /** Rendered fields, in order — same shape as `EditFieldsSection.fields`.
805
+ * Every referenced field must have an entry in `fieldDefs`. */
806
+ readonly fields: readonly EditFieldSpec[];
807
+ /** Write-handler QN dispatched on submit. The submitted values (not a
808
+ * diff) land 1:1 as payload, same as `ActionFormScreenDefinition.handler`.
809
+ * The payload carries only this section's own fields — no parent/record
810
+ * id is injected automatically. To thread the host record's id through,
811
+ * declare it in `fieldDefs` with `visible: false` on its `fields` entry:
812
+ * it gets prefilled from the loaded record like any other field and rides
813
+ * along in the submit payload without being shown in the form. */
814
+ readonly handler: string;
815
+ /** i18n-key for the submit button. Default: "kumiko.actions.save". */
816
+ readonly submitLabel?: string;
769
817
  };
770
818
 
771
819
  // Max width of the form container (see FormScreenShell in renderer-web).