@nice2dev/ui-forms 1.4.10 → 1.4.12

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/dist/index.d.ts CHANGED
@@ -328,6 +328,9 @@ export declare const nativeDataSourcesKind: NiceStudioFileKind<NiceDataSourceDef
328
328
 
329
329
  export declare const nativeEntitiesKind: NiceStudioFileKind<Row_3[]>;
330
330
 
331
+ /** `{id}.environments.json`: declared variables and the sets of their values (1.4.12). */
332
+ export declare const nativeEnvironmentsKind: NiceStudioFileKind<Record<string, unknown>>;
333
+
331
334
  /** The file kinds of the native format, in matching order. */
332
335
  export declare const nativeFileKinds: NiceStudioFileKind[];
333
336
 
@@ -335,6 +338,12 @@ export declare const nativeHooksKind: NiceStudioFileKind<NiceHookBinding[]>;
335
338
 
336
339
  export declare const nativeI18nKind: NiceStudioFileKind<NiceStudioTranslations>;
337
340
 
341
+ /**
342
+ * `{id}.integrations.json`: `{ integrations: [...] }` (1.4.12) — edited by the host's `integrations`
343
+ * editor plug-in (@nice2dev/ui-api), else as JSON.
344
+ */
345
+ export declare const nativeIntegrationsKind: NiceStudioFileKind<Record<string, unknown>>;
346
+
338
347
  export declare const nativeManifestKind: NiceStudioFileKind<Row_3>;
339
348
 
340
349
  export declare const nativeRbacKind: NiceStudioFileKind<NiceRbacModel>;
@@ -454,6 +463,14 @@ export declare interface NiceDevelopmentStudioProps extends NiceStandardProps {
454
463
  reviewBeforeSave?: boolean;
455
464
  /** Runs script files (`script` documents) in a NiceScriptRunner. */
456
465
  scriptRunner?: Omit<NiceScriptRunnerProps, 'value' | 'onChange'>;
466
+ /**
467
+ * Editors for file kinds the studio has none of (1.4.12), by the kind's `editor` id — e.g.
468
+ * `niceApiStudioEditors()` from @nice2dev/ui-api for `integrations` and `environments`. A kind with
469
+ * no editor opens as JSON.
470
+ */
471
+ editors?: Readonly<Record<string, NiceStudioEditorPlugin>>;
472
+ /** What the editor plug-ins are given: the host's proxy, data source preview, script runner, secrets. */
473
+ editorServices?: NiceStudioEditorServices;
457
474
  /**
458
475
  * The host's data for a module's no-code scripts (1.4.6): with it the script editor's Run runs
459
476
  * the steps against it (`read` a data source, `write` rows, `callScript`).
@@ -810,12 +827,54 @@ export declare interface NiceStudioDocument<M = unknown> {
810
827
  error?: string;
811
828
  }
812
829
 
830
+ /** What an editor plug-in is given for the document it edits (1.4.12). */
831
+ export declare interface NiceStudioEditorContext {
832
+ /** The document's model (its kind's `decode`). */
833
+ value: unknown;
834
+ /** A new model — the studio encodes and saves it like any other draft. */
835
+ onChange: (value: unknown) => void;
836
+ readOnly: boolean;
837
+ module: {
838
+ workspaceId: string;
839
+ id: string;
840
+ label: string;
841
+ };
842
+ /** The module's files as edited — a plug-in may read its neighbours (an environments file). */
843
+ files: ReadonlyArray<{
844
+ path: string;
845
+ text: string;
846
+ }>;
847
+ services: NiceStudioEditorServices;
848
+ }
849
+
813
850
  /**
814
851
  * The editors a file kind can open in: a built-in one, or the id of an editor the host registers
815
852
  * (1.4.5 — the union was closed; an unknown id opens as raw JSON / text until one is registered).
816
853
  */
817
854
  export declare type NiceStudioEditorId = NiceStudioBuiltinEditorId | (string & {});
818
855
 
856
+ /**
857
+ * An editor the host registers for a file kind's `editor` id (1.4.12) — e.g. the integrations
858
+ * and environment sets editors of @nice2dev/ui-api (`niceApiStudioEditors()`).
859
+ */
860
+ export declare interface NiceStudioEditorPlugin {
861
+ /** A React node (typed `unknown` so this core stays free of React types). */
862
+ render: (ctx: NiceStudioEditorContext) => unknown;
863
+ }
864
+
865
+ /**
866
+ * The services a host hands editor plug-ins (1.4.12): sending HTTP through its proxy, running data
867
+ * sources and scripts, resolving secrets — whatever its plug-ins need. Typed loosely: the studio
868
+ * passes them on and knows none of them.
869
+ */
870
+ export declare interface NiceStudioEditorServices {
871
+ sendRequest?: unknown;
872
+ previewDataSource?: unknown;
873
+ runScript?: unknown;
874
+ resolveSecret?: (key: string) => string | undefined;
875
+ [name: string]: unknown;
876
+ }
877
+
819
878
  /** New and removed files of an encoded document. */
820
879
  export declare interface NiceStudioEncoded {
821
880
  files: Array<{