@declarion/react 0.1.4 → 0.1.26

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.
@@ -0,0 +1,8 @@
1
+ export interface FieldRegion {
2
+ getField: (fieldName: string) => unknown;
3
+ setField: (fieldName: string, value: unknown) => void;
4
+ focusField: (fieldName: string) => void;
5
+ }
6
+ export declare function registerFieldRegion(name: string, region: FieldRegion): () => void;
7
+ export declare function getFieldRegion(name: string): FieldRegion | undefined;
8
+ export declare function useFieldRegion(name: string, region: FieldRegion): void;
@@ -0,0 +1,10 @@
1
+ import type { UIStep } from "../types/schema";
2
+ export interface UIActionContext {
3
+ row?: Record<string, unknown>;
4
+ }
5
+ export declare function interpolate(template: string, ctx: UIActionContext): string;
6
+ export declare function executeUISteps(steps: UIStep[], ctx: UIActionContext): Promise<void>;
7
+ export declare function isUIAction(action: {
8
+ ui_steps?: UIStep[];
9
+ handler?: string;
10
+ }): boolean;
@@ -1,4 +1,10 @@
1
1
  export type LocalizedString = Record<string, string>;
2
+ /**
3
+ * Reserved sentinel value for Screen.detail_screen (list screens). Disables
4
+ * row-click navigation even when the entity declares a canonical detail. Paired
5
+ * with Go's engine.DetailScreenNone - keep the literal "none" in sync.
6
+ */
7
+ export declare const DETAIL_SCREEN_NONE = "none";
2
8
  export declare function loc(ls: LocalizedString | undefined, lang?: string): string;
3
9
  export declare function fieldDisplayName(field: EntityField, fieldName: string, entities?: Record<string, Entity>): string;
4
10
  export interface RefDisplay {
@@ -43,6 +49,7 @@ export interface EntityField {
43
49
  ref?: RefConfig;
44
50
  structure?: string;
45
51
  array?: boolean;
52
+ copyable?: boolean;
46
53
  }
47
54
  export interface StructureDef {
48
55
  name: LocalizedString;
@@ -57,6 +64,8 @@ export interface TimelineConfig {
57
64
  summary_field?: string;
58
65
  content_field?: string;
59
66
  author_field?: string;
67
+ direction_field?: string;
68
+ intent_field?: string;
60
69
  scroll?: boolean;
61
70
  auto_scroll?: "none" | "bottom" | "top";
62
71
  }
@@ -169,6 +178,7 @@ export interface Entity {
169
178
  actions?: Record<string, Action>;
170
179
  handlers?: Record<string, HandlerDef>;
171
180
  associations?: Record<string, AssociationDef>;
181
+ detail_screen?: string;
172
182
  }
173
183
  export declare function getPrimaryKeyFields(entity: Entity): string[];
174
184
  export type PkValues = Record<string, string>;
@@ -199,6 +209,10 @@ export interface ColumnConfig {
199
209
  export interface TabsConfig {
200
210
  items: LayoutNode[];
201
211
  }
212
+ export interface LayoutField {
213
+ name: string;
214
+ actions?: Action[];
215
+ }
202
216
  export interface LayoutNode {
203
217
  row?: RowConfig;
204
218
  column?: ColumnConfig;
@@ -208,7 +222,7 @@ export interface LayoutNode {
208
222
  associated?: string;
209
223
  properties?: true | string[];
210
224
  statuses?: true | string[];
211
- fields?: string[];
225
+ fields?: LayoutField[];
212
226
  width?: SizeValue;
213
227
  height?: SizeValue;
214
228
  min_width?: string;
@@ -250,6 +264,7 @@ export interface Screen {
250
264
  self?: boolean;
251
265
  list_width?: string;
252
266
  list_resizable?: boolean;
267
+ detail_screen?: string;
253
268
  fixed_filters?: Record<string, unknown>;
254
269
  views?: ViewDefinition[];
255
270
  }
@@ -298,6 +313,20 @@ export interface ActionCondition {
298
313
  op?: string;
299
314
  value?: unknown;
300
315
  }
316
+ export interface UISetFieldStep {
317
+ target: string;
318
+ value: string;
319
+ }
320
+ export interface UIShowToastStep {
321
+ kind?: "success" | "error" | "info";
322
+ message: string;
323
+ }
324
+ export interface UIStep {
325
+ copy_to_clipboard?: string;
326
+ set_field?: UISetFieldStep;
327
+ focus_field?: string;
328
+ show_toast?: UIShowToastStep;
329
+ }
301
330
  export interface Action {
302
331
  handler?: string;
303
332
  type?: string;
@@ -314,6 +343,7 @@ export interface Action {
314
343
  conditions?: ActionCondition[];
315
344
  resolved_params?: Record<string, HandlerParam>;
316
345
  resolved_param_order?: string[];
346
+ ui_steps?: UIStep[];
317
347
  }
318
348
  export interface LanguageDef {
319
349
  code: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@declarion/react",
3
- "version": "0.1.4",
3
+ "version": "0.1.26",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "React SDK for Declarion, the schema-driven business apps platform.",