@declarion/react 0.1.21 → 0.1.27
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-lib/api/data.d.ts +19 -5
- package/dist-lib/components/detail-layout/FieldsBlock.d.ts +2 -1
- package/dist-lib/components/fields/StringField.d.ts +1 -1
- package/dist-lib/components/shared/CopyButton.d.ts +8 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useSSE.d.ts +8 -0
- package/dist-lib/index.js +3555 -3356
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/lib/field-regions.d.ts +8 -0
- package/dist-lib/lib/ui-actions.d.ts +10 -0
- package/dist-lib/types/schema.d.ts +23 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -49,6 +49,7 @@ export interface EntityField {
|
|
|
49
49
|
ref?: RefConfig;
|
|
50
50
|
structure?: string;
|
|
51
51
|
array?: boolean;
|
|
52
|
+
copyable?: boolean;
|
|
52
53
|
}
|
|
53
54
|
export interface StructureDef {
|
|
54
55
|
name: LocalizedString;
|
|
@@ -63,6 +64,8 @@ export interface TimelineConfig {
|
|
|
63
64
|
summary_field?: string;
|
|
64
65
|
content_field?: string;
|
|
65
66
|
author_field?: string;
|
|
67
|
+
direction_field?: string;
|
|
68
|
+
intent_field?: string;
|
|
66
69
|
scroll?: boolean;
|
|
67
70
|
auto_scroll?: "none" | "bottom" | "top";
|
|
68
71
|
}
|
|
@@ -206,6 +209,10 @@ export interface ColumnConfig {
|
|
|
206
209
|
export interface TabsConfig {
|
|
207
210
|
items: LayoutNode[];
|
|
208
211
|
}
|
|
212
|
+
export interface LayoutField {
|
|
213
|
+
name: string;
|
|
214
|
+
actions?: Action[];
|
|
215
|
+
}
|
|
209
216
|
export interface LayoutNode {
|
|
210
217
|
row?: RowConfig;
|
|
211
218
|
column?: ColumnConfig;
|
|
@@ -215,7 +222,7 @@ export interface LayoutNode {
|
|
|
215
222
|
associated?: string;
|
|
216
223
|
properties?: true | string[];
|
|
217
224
|
statuses?: true | string[];
|
|
218
|
-
fields?:
|
|
225
|
+
fields?: LayoutField[];
|
|
219
226
|
width?: SizeValue;
|
|
220
227
|
height?: SizeValue;
|
|
221
228
|
min_width?: string;
|
|
@@ -306,6 +313,20 @@ export interface ActionCondition {
|
|
|
306
313
|
op?: string;
|
|
307
314
|
value?: unknown;
|
|
308
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
|
+
}
|
|
309
330
|
export interface Action {
|
|
310
331
|
handler?: string;
|
|
311
332
|
type?: string;
|
|
@@ -322,6 +343,7 @@ export interface Action {
|
|
|
322
343
|
conditions?: ActionCondition[];
|
|
323
344
|
resolved_params?: Record<string, HandlerParam>;
|
|
324
345
|
resolved_param_order?: string[];
|
|
346
|
+
ui_steps?: UIStep[];
|
|
325
347
|
}
|
|
326
348
|
export interface LanguageDef {
|
|
327
349
|
code: string;
|