@object-ui/types 3.0.2 → 3.1.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.
- package/dist/app.d.ts +217 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +85 -1
- package/dist/complex.d.ts +129 -35
- package/dist/complex.d.ts.map +1 -1
- package/dist/data-display.d.ts +105 -1
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data.d.ts +45 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/designer.d.ts +197 -35
- package/dist/designer.d.ts.map +1 -1
- package/dist/designer.js +11 -1
- package/dist/index.d.ts +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/layout.d.ts +39 -2
- package/dist/layout.d.ts.map +1 -1
- package/dist/navigation.d.ts +27 -0
- package/dist/navigation.d.ts.map +1 -1
- package/dist/objectql.d.ts +641 -7
- package/dist/objectql.d.ts.map +1 -1
- package/dist/record-components.d.ts +160 -0
- package/dist/record-components.d.ts.map +1 -0
- package/dist/record-components.js +8 -0
- package/dist/reports.d.ts +37 -0
- package/dist/reports.d.ts.map +1 -1
- package/dist/theme.d.ts +5 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/views.d.ts +257 -3
- package/dist/views.d.ts.map +1 -1
- package/dist/workflow.d.ts +198 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/zod/app.zod.d.ts +42 -2
- package/dist/zod/app.zod.d.ts.map +1 -1
- package/dist/zod/app.zod.js +61 -1
- package/dist/zod/complex.zod.d.ts +138 -6
- package/dist/zod/complex.zod.d.ts.map +1 -1
- package/dist/zod/complex.zod.js +65 -2
- package/dist/zod/data-display.zod.d.ts +4 -0
- package/dist/zod/data-display.zod.d.ts.map +1 -1
- package/dist/zod/data-display.zod.js +2 -0
- package/dist/zod/form.zod.d.ts +6 -6
- package/dist/zod/index.zod.d.ts +368 -43
- package/dist/zod/index.zod.d.ts.map +1 -1
- package/dist/zod/index.zod.js +2 -2
- package/dist/zod/layout.zod.d.ts +6 -6
- package/dist/zod/navigation.zod.d.ts +58 -12
- package/dist/zod/navigation.zod.d.ts.map +1 -1
- package/dist/zod/navigation.zod.js +21 -9
- package/dist/zod/objectql.zod.d.ts +515 -27
- package/dist/zod/objectql.zod.d.ts.map +1 -1
- package/dist/zod/objectql.zod.js +162 -0
- package/dist/zod/reports.zod.d.ts +38 -38
- package/dist/zod/views.zod.d.ts +161 -7
- package/dist/zod/views.zod.d.ts.map +1 -1
- package/dist/zod/views.zod.js +21 -2
- package/package.json +2 -2
- package/src/__tests__/app-creation-types.test.ts +177 -0
- package/src/__tests__/dashboard-config.test.ts +208 -0
- package/src/__tests__/examples-metadata-compliance.test.ts +264 -0
- package/src/__tests__/navigation-model.test.ts +406 -0
- package/src/__tests__/p1-spec-alignment.test.ts +660 -0
- package/src/__tests__/p2-spec-exports.test.ts +312 -0
- package/src/__tests__/phase2-schemas.test.ts +108 -0
- package/src/app.ts +377 -0
- package/src/complex.ts +131 -31
- package/src/data-display.ts +107 -0
- package/src/data.ts +49 -0
- package/src/designer.ts +219 -30
- package/src/index.ts +192 -3
- package/src/layout.ts +55 -2
- package/src/navigation.ts +20 -0
- package/src/objectql.ts +757 -8
- package/src/record-components.ts +188 -0
- package/src/reports.ts +43 -0
- package/src/theme.ts +6 -0
- package/src/views.ts +275 -3
- package/src/workflow.ts +226 -0
- package/src/zod/app.zod.ts +74 -1
- package/src/zod/complex.zod.ts +67 -2
- package/src/zod/data-display.zod.ts +2 -0
- package/src/zod/index.zod.ts +5 -0
- package/src/zod/navigation.zod.ts +22 -10
- package/src/zod/objectql.zod.ts +167 -0
- package/src/zod/views.zod.ts +21 -2
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @object-ui/types - Record Component Schemas
|
|
11
|
+
*
|
|
12
|
+
* Type definitions for record:* page components.
|
|
13
|
+
* Aligned with @objectstack/spec RecordDetailsProps, RecordRelatedListProps,
|
|
14
|
+
* RecordHighlightsProps, RecordActivityProps, RecordChatterProps, RecordPathProps.
|
|
15
|
+
*
|
|
16
|
+
* @module record-components
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* ARIA props shared across all record components.
|
|
22
|
+
* Aligned with @objectstack/spec AriaPropsSchema.
|
|
23
|
+
*/
|
|
24
|
+
export interface RecordComponentAriaProps {
|
|
25
|
+
ariaLabel?: string;
|
|
26
|
+
ariaDescribedBy?: string;
|
|
27
|
+
role?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// record:details — Record Detail Panel
|
|
32
|
+
// ============================================================================
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Props for the record:details page component.
|
|
36
|
+
* Displays a record's fields in a structured detail layout.
|
|
37
|
+
* Aligned with @objectstack/spec RecordDetailsProps.
|
|
38
|
+
*/
|
|
39
|
+
export interface RecordDetailsComponentProps {
|
|
40
|
+
/** Number of columns for field layout (1-4) */
|
|
41
|
+
columns?: number;
|
|
42
|
+
/** Detail layout mode */
|
|
43
|
+
layout?: 'stacked' | 'inline' | 'compact';
|
|
44
|
+
/** Sections to organize fields */
|
|
45
|
+
sections?: Array<{
|
|
46
|
+
label?: string;
|
|
47
|
+
fields: string[];
|
|
48
|
+
collapsible?: boolean;
|
|
49
|
+
collapsed?: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
/** Specific fields to display (overrides auto-detection from object) */
|
|
52
|
+
fields?: string[];
|
|
53
|
+
/** ARIA accessibility attributes */
|
|
54
|
+
aria?: RecordComponentAriaProps;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// record:highlights — Key Field Summary
|
|
59
|
+
// ============================================================================
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Props for the record:highlights page component.
|
|
63
|
+
* Shows key fields as a summary/highlights panel (e.g., top of detail page).
|
|
64
|
+
* Aligned with @objectstack/spec RecordHighlightsProps.
|
|
65
|
+
*/
|
|
66
|
+
export interface RecordHighlightsComponentProps {
|
|
67
|
+
/** Fields to display as highlights */
|
|
68
|
+
fields: string[];
|
|
69
|
+
/** Layout mode for highlights display */
|
|
70
|
+
layout?: 'horizontal' | 'vertical' | 'grid';
|
|
71
|
+
/** ARIA accessibility attributes */
|
|
72
|
+
aria?: RecordComponentAriaProps;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ============================================================================
|
|
76
|
+
// record:related_list — Related Records Table
|
|
77
|
+
// ============================================================================
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Props for the record:related_list page component.
|
|
81
|
+
* Displays a list of related records via a relationship field.
|
|
82
|
+
* Aligned with @objectstack/spec RecordRelatedListProps.
|
|
83
|
+
*/
|
|
84
|
+
export interface RecordRelatedListComponentProps {
|
|
85
|
+
/** Related object name */
|
|
86
|
+
objectName: string;
|
|
87
|
+
/** Field on the related object that links back to this record */
|
|
88
|
+
relationshipField: string;
|
|
89
|
+
/** Columns to display in the related list */
|
|
90
|
+
columns?: string[];
|
|
91
|
+
/** Sort configuration */
|
|
92
|
+
sort?: Array<{ field: string; order: 'asc' | 'desc' }>;
|
|
93
|
+
/** Maximum records to display */
|
|
94
|
+
limit?: number;
|
|
95
|
+
/** Filter conditions */
|
|
96
|
+
filter?: any;
|
|
97
|
+
/** Section title */
|
|
98
|
+
title?: string;
|
|
99
|
+
/** Show "View All" link */
|
|
100
|
+
showViewAll?: boolean;
|
|
101
|
+
/** Available actions for the related list */
|
|
102
|
+
actions?: string[];
|
|
103
|
+
/** ARIA accessibility attributes */
|
|
104
|
+
aria?: RecordComponentAriaProps;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ============================================================================
|
|
108
|
+
// record:activity — Activity Timeline
|
|
109
|
+
// ============================================================================
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Props for the record:activity page component.
|
|
113
|
+
* Displays an activity feed/timeline for a record.
|
|
114
|
+
* Aligned with @objectstack/spec RecordActivityProps.
|
|
115
|
+
*/
|
|
116
|
+
export interface RecordActivityComponentProps {
|
|
117
|
+
/** Activity types to display */
|
|
118
|
+
types?: string[];
|
|
119
|
+
/** Filter mode for activity types */
|
|
120
|
+
filterMode?: string;
|
|
121
|
+
/** Show filter toggle UI */
|
|
122
|
+
showFilterToggle?: boolean;
|
|
123
|
+
/** Maximum activities to display */
|
|
124
|
+
limit?: number;
|
|
125
|
+
/** Show completed/resolved activities */
|
|
126
|
+
showCompleted?: boolean;
|
|
127
|
+
/** Merge all activity types into a single timeline */
|
|
128
|
+
unifiedTimeline?: boolean;
|
|
129
|
+
/** Show comment input box */
|
|
130
|
+
showCommentInput?: boolean;
|
|
131
|
+
/** Enable @mentions in comments */
|
|
132
|
+
enableMentions?: boolean;
|
|
133
|
+
/** Enable emoji reactions on activities */
|
|
134
|
+
enableReactions?: boolean;
|
|
135
|
+
/** Enable threaded comment replies */
|
|
136
|
+
enableThreading?: boolean;
|
|
137
|
+
/** Show subscribe/unsubscribe toggle */
|
|
138
|
+
showSubscriptionToggle?: boolean;
|
|
139
|
+
/** ARIA accessibility attributes */
|
|
140
|
+
aria?: RecordComponentAriaProps;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ============================================================================
|
|
144
|
+
// record:chatter — Comments & Discussion
|
|
145
|
+
// ============================================================================
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Props for the record:chatter page component.
|
|
149
|
+
* Provides a chat/discussion panel for a record.
|
|
150
|
+
* Aligned with @objectstack/spec RecordChatterProps.
|
|
151
|
+
*/
|
|
152
|
+
export interface RecordChatterComponentProps {
|
|
153
|
+
/** Panel position */
|
|
154
|
+
position?: 'bottom' | 'right' | 'left';
|
|
155
|
+
/** Panel width (CSS value) */
|
|
156
|
+
width?: string;
|
|
157
|
+
/** Whether the chatter panel is collapsible */
|
|
158
|
+
collapsible?: boolean;
|
|
159
|
+
/** Whether the chatter panel starts collapsed */
|
|
160
|
+
defaultCollapsed?: boolean;
|
|
161
|
+
/** Activity feed configuration within chatter */
|
|
162
|
+
feed?: RecordActivityComponentProps;
|
|
163
|
+
/** ARIA accessibility attributes */
|
|
164
|
+
aria?: RecordComponentAriaProps;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ============================================================================
|
|
168
|
+
// record:path — Record Path / Progress Indicator
|
|
169
|
+
// ============================================================================
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Props for the record:path page component.
|
|
173
|
+
* Displays a progress/stage indicator for the record (e.g., Lead → Qualified → Won).
|
|
174
|
+
* Aligned with @objectstack/spec RecordPathProps.
|
|
175
|
+
*/
|
|
176
|
+
export interface RecordPathComponentProps {
|
|
177
|
+
/** Field that holds the current status/stage value */
|
|
178
|
+
statusField: string;
|
|
179
|
+
/** Ordered list of stages */
|
|
180
|
+
stages: Array<{
|
|
181
|
+
/** Stage value (matches statusField values) */
|
|
182
|
+
value: string;
|
|
183
|
+
/** Display label for the stage */
|
|
184
|
+
label: string;
|
|
185
|
+
}>;
|
|
186
|
+
/** ARIA accessibility attributes */
|
|
187
|
+
aria?: RecordComponentAriaProps;
|
|
188
|
+
}
|
package/src/reports.ts
CHANGED
|
@@ -69,6 +69,16 @@ export interface ReportField {
|
|
|
69
69
|
* Sort order
|
|
70
70
|
*/
|
|
71
71
|
sortOrder?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Custom render style (e.g., 'badge' for status fields)
|
|
75
|
+
*/
|
|
76
|
+
renderAs?: 'badge' | 'text';
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Color mapping for badge rendering (value → CSS class or color)
|
|
80
|
+
*/
|
|
81
|
+
colorMap?: Record<string, string>;
|
|
72
82
|
}
|
|
73
83
|
|
|
74
84
|
/**
|
|
@@ -246,6 +256,14 @@ export interface ReportExportConfig {
|
|
|
246
256
|
options?: Record<string, any>;
|
|
247
257
|
}
|
|
248
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Report Type
|
|
261
|
+
* - tabular: flat table
|
|
262
|
+
* - summary: grouped with subtotals
|
|
263
|
+
* - matrix: pivot table
|
|
264
|
+
*/
|
|
265
|
+
export type ReportType = 'tabular' | 'summary' | 'matrix';
|
|
266
|
+
|
|
249
267
|
/**
|
|
250
268
|
* Report Schema - Main report configuration
|
|
251
269
|
*/
|
|
@@ -262,6 +280,11 @@ export interface ReportSchema extends BaseSchema {
|
|
|
262
280
|
*/
|
|
263
281
|
description?: string;
|
|
264
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Report type (tabular, summary, matrix)
|
|
285
|
+
*/
|
|
286
|
+
reportType?: ReportType;
|
|
287
|
+
|
|
265
288
|
/**
|
|
266
289
|
* Data source configuration
|
|
267
290
|
*/
|
|
@@ -331,6 +354,26 @@ export interface ReportSchema extends BaseSchema {
|
|
|
331
354
|
* Report data
|
|
332
355
|
*/
|
|
333
356
|
data?: any[];
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Conditional formatting rules
|
|
360
|
+
*/
|
|
361
|
+
conditionalFormatting?: Array<{
|
|
362
|
+
field: string;
|
|
363
|
+
operator: 'equals' | 'not_equals' | 'contains' | 'greater_than' | 'less_than';
|
|
364
|
+
value: any;
|
|
365
|
+
backgroundColor?: string;
|
|
366
|
+
textColor?: string;
|
|
367
|
+
}>;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Chart configuration (visual chart editor output)
|
|
371
|
+
*/
|
|
372
|
+
chartConfig?: {
|
|
373
|
+
chartType?: string;
|
|
374
|
+
xAxisField?: string;
|
|
375
|
+
yAxisFields?: string[];
|
|
376
|
+
};
|
|
334
377
|
}
|
|
335
378
|
|
|
336
379
|
/**
|
package/src/theme.ts
CHANGED
|
@@ -78,6 +78,12 @@ export type { ZIndex } from '@objectstack/spec/ui';
|
|
|
78
78
|
*/
|
|
79
79
|
export type { ThemeMode } from '@objectstack/spec/ui';
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Theme Mode Schema
|
|
83
|
+
* Canonical Zod schema from @objectstack/spec/ui.
|
|
84
|
+
*/
|
|
85
|
+
export type { ThemeModeSchema } from '@objectstack/spec/ui';
|
|
86
|
+
|
|
81
87
|
// Import spec types for local use in interfaces below
|
|
82
88
|
import type {
|
|
83
89
|
ColorPalette,
|
package/src/views.ts
CHANGED
|
@@ -20,11 +20,12 @@ import type { BaseSchema, SchemaNode } from './base';
|
|
|
20
20
|
import type { ActionSchema } from './crud';
|
|
21
21
|
import type { TableColumn } from './data-display';
|
|
22
22
|
import type { FormField } from './form';
|
|
23
|
+
import type { SelectOptionMetadata } from './field-types';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* View Type
|
|
26
27
|
*/
|
|
27
|
-
export type ViewType = 'list' | 'detail' | 'grid' | 'kanban' | 'calendar' | 'timeline' | 'map';
|
|
28
|
+
export type ViewType = 'list' | 'detail' | 'grid' | 'kanban' | 'calendar' | 'timeline' | 'map' | 'gallery' | 'gantt';
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* Detail View Field Configuration
|
|
@@ -39,9 +40,14 @@ export interface DetailViewField {
|
|
|
39
40
|
*/
|
|
40
41
|
label?: string;
|
|
41
42
|
/**
|
|
42
|
-
* Field type for rendering
|
|
43
|
+
* Field type for rendering.
|
|
44
|
+
* Supports both display-oriented types (image, link, badge, json, html, markdown, custom)
|
|
45
|
+
* and data-oriented types (number, currency, percent, boolean, select, lookup, master_detail,
|
|
46
|
+
* email, url, phone, user) for type-aware cell rendering via getCellRenderer.
|
|
43
47
|
*/
|
|
44
|
-
type?: 'text' | '
|
|
48
|
+
type?: 'text' | 'number' | 'currency' | 'percent' | 'boolean' | 'select' | 'lookup' | 'master_detail'
|
|
49
|
+
| 'email' | 'url' | 'phone' | 'user'
|
|
50
|
+
| 'image' | 'link' | 'badge' | 'date' | 'datetime' | 'json' | 'html' | 'markdown' | 'custom';
|
|
45
51
|
/**
|
|
46
52
|
* Format string (e.g., date format)
|
|
47
53
|
*/
|
|
@@ -66,6 +72,22 @@ export interface DetailViewField {
|
|
|
66
72
|
* Span across columns (for grid layout)
|
|
67
73
|
*/
|
|
68
74
|
span?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Options for select/lookup fields
|
|
77
|
+
*/
|
|
78
|
+
options?: SelectOptionMetadata[];
|
|
79
|
+
/**
|
|
80
|
+
* Referenced object name for lookup/master_detail fields
|
|
81
|
+
*/
|
|
82
|
+
reference_to?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Display field on the referenced object for lookup/master_detail fields
|
|
85
|
+
*/
|
|
86
|
+
reference_field?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Currency code for currency fields (e.g. 'USD', 'EUR')
|
|
89
|
+
*/
|
|
90
|
+
currency?: string;
|
|
69
91
|
}
|
|
70
92
|
|
|
71
93
|
/**
|
|
@@ -114,6 +136,11 @@ export interface DetailViewSection {
|
|
|
114
136
|
* @example 'muted', 'primary/10'
|
|
115
137
|
*/
|
|
116
138
|
headerColor?: string;
|
|
139
|
+
/**
|
|
140
|
+
* When true, hide fields whose value is null, undefined, or empty string.
|
|
141
|
+
* If all fields are hidden, the entire section is hidden.
|
|
142
|
+
*/
|
|
143
|
+
hideEmpty?: boolean;
|
|
117
144
|
}
|
|
118
145
|
|
|
119
146
|
/**
|
|
@@ -146,6 +173,207 @@ export interface DetailViewTab {
|
|
|
146
173
|
badge?: string | number;
|
|
147
174
|
}
|
|
148
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Comment Entry - represents a single comment on a record
|
|
178
|
+
*/
|
|
179
|
+
export interface CommentEntry {
|
|
180
|
+
/** Unique identifier */
|
|
181
|
+
id: string | number;
|
|
182
|
+
/** Comment text */
|
|
183
|
+
text: string;
|
|
184
|
+
/** Author display name */
|
|
185
|
+
author: string;
|
|
186
|
+
/** Avatar URL (optional) */
|
|
187
|
+
avatarUrl?: string;
|
|
188
|
+
/** Timestamp when the comment was created */
|
|
189
|
+
createdAt: string;
|
|
190
|
+
/** Whether this comment is pinned/starred */
|
|
191
|
+
pinned?: boolean;
|
|
192
|
+
/** Mentioned user IDs extracted from the comment text */
|
|
193
|
+
mentions?: string[];
|
|
194
|
+
/** Object/record this comment belongs to (for cross-record search) */
|
|
195
|
+
objectName?: string;
|
|
196
|
+
/** Record ID this comment belongs to (for cross-record search) */
|
|
197
|
+
recordId?: string | number;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Mention notification - delivered when a user is @mentioned in a comment
|
|
202
|
+
*/
|
|
203
|
+
export interface MentionNotification {
|
|
204
|
+
/** Unique notification ID */
|
|
205
|
+
id: string;
|
|
206
|
+
/** Type of notification */
|
|
207
|
+
type: 'mention';
|
|
208
|
+
/** ID of the user being notified */
|
|
209
|
+
recipientId: string;
|
|
210
|
+
/** The comment that contains the mention */
|
|
211
|
+
commentId: string | number;
|
|
212
|
+
/** Author who mentioned the recipient */
|
|
213
|
+
mentionedBy: string;
|
|
214
|
+
/** The comment text (or excerpt) */
|
|
215
|
+
commentText: string;
|
|
216
|
+
/** Object name the comment belongs to */
|
|
217
|
+
objectName?: string;
|
|
218
|
+
/** Record ID the comment belongs to */
|
|
219
|
+
recordId?: string | number;
|
|
220
|
+
/** When the mention was created */
|
|
221
|
+
createdAt: string;
|
|
222
|
+
/** Whether the notification has been read */
|
|
223
|
+
read?: boolean;
|
|
224
|
+
/** Delivery channels */
|
|
225
|
+
channels?: Array<'in_app' | 'email' | 'push'>;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Comment search result - returned when searching comments across records
|
|
230
|
+
*/
|
|
231
|
+
export interface CommentSearchResult {
|
|
232
|
+
/** The matching comment */
|
|
233
|
+
comment: CommentEntry;
|
|
234
|
+
/** Object name the comment belongs to */
|
|
235
|
+
objectName: string;
|
|
236
|
+
/** Record ID the comment belongs to */
|
|
237
|
+
recordId: string | number;
|
|
238
|
+
/** Highlighted text snippet with search term marked */
|
|
239
|
+
highlight?: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Activity Entry - represents a single activity/field change on a record
|
|
244
|
+
*/
|
|
245
|
+
export interface ActivityEntry {
|
|
246
|
+
/** Unique identifier */
|
|
247
|
+
id: string | number;
|
|
248
|
+
/** Activity type */
|
|
249
|
+
type: 'field_change' | 'create' | 'delete' | 'comment' | 'status_change';
|
|
250
|
+
/** Field that was changed (for field_change type) */
|
|
251
|
+
field?: string;
|
|
252
|
+
/** Previous value */
|
|
253
|
+
oldValue?: any;
|
|
254
|
+
/** New value */
|
|
255
|
+
newValue?: any;
|
|
256
|
+
/** User who made the change */
|
|
257
|
+
user: string;
|
|
258
|
+
/** Timestamp of the change */
|
|
259
|
+
timestamp: string;
|
|
260
|
+
/** Human-readable description of the change */
|
|
261
|
+
description?: string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// ============================================================================
|
|
265
|
+
// Feed / Chatter Protocol Types
|
|
266
|
+
// Aligned with @objectstack/spec FeedItemSchema, MentionSchema, ReactionSchema,
|
|
267
|
+
// FieldChangeEntrySchema, RecordSubscriptionSchema
|
|
268
|
+
// ============================================================================
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Feed item type — determines rendering style in the activity timeline.
|
|
272
|
+
* Aligned with @objectstack/spec FeedItemSchema.type enum.
|
|
273
|
+
*/
|
|
274
|
+
export type FeedItemType = 'comment' | 'field_change' | 'task' | 'event' | 'system' | 'email' | 'call';
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* FeedItem — A single item in the unified activity feed.
|
|
278
|
+
* Aligned with @objectstack/spec FeedItemSchema.
|
|
279
|
+
*/
|
|
280
|
+
export interface FeedItem {
|
|
281
|
+
/** Unique identifier */
|
|
282
|
+
id: string | number;
|
|
283
|
+
/** Feed item type */
|
|
284
|
+
type: FeedItemType;
|
|
285
|
+
/** Actor / author display name */
|
|
286
|
+
actor: string;
|
|
287
|
+
/** Actor avatar URL */
|
|
288
|
+
actorAvatarUrl?: string;
|
|
289
|
+
/** Main body / text content (may contain Markdown) */
|
|
290
|
+
body?: string;
|
|
291
|
+
/** Creation timestamp (ISO 8601) */
|
|
292
|
+
createdAt: string;
|
|
293
|
+
/** Last update timestamp (ISO 8601) */
|
|
294
|
+
updatedAt?: string;
|
|
295
|
+
/** Source of the feed item (e.g., 'manual', 'api', 'automation') */
|
|
296
|
+
source?: string;
|
|
297
|
+
/** Parent feed item ID (for threading) */
|
|
298
|
+
parentId?: string | number;
|
|
299
|
+
/** Number of replies (if this is a root comment) */
|
|
300
|
+
replyCount?: number;
|
|
301
|
+
/** Field change entries (for field_change type) */
|
|
302
|
+
fieldChanges?: FieldChangeEntry[];
|
|
303
|
+
/** Mentions within this feed item */
|
|
304
|
+
mentions?: Mention[];
|
|
305
|
+
/** Reactions on this feed item */
|
|
306
|
+
reactions?: Reaction[];
|
|
307
|
+
/** Whether this item is pinned */
|
|
308
|
+
pinned?: boolean;
|
|
309
|
+
/** Whether this item has been edited */
|
|
310
|
+
edited?: boolean;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* FieldChangeEntry — A single field change within a feed item.
|
|
315
|
+
* Aligned with @objectstack/spec FieldChangeEntrySchema.
|
|
316
|
+
*/
|
|
317
|
+
export interface FieldChangeEntry {
|
|
318
|
+
/** Field API name */
|
|
319
|
+
field: string;
|
|
320
|
+
/** Field display label */
|
|
321
|
+
fieldLabel?: string;
|
|
322
|
+
/** Previous raw value */
|
|
323
|
+
oldValue?: unknown;
|
|
324
|
+
/** New raw value */
|
|
325
|
+
newValue?: unknown;
|
|
326
|
+
/** Previous human-readable display value */
|
|
327
|
+
oldDisplayValue?: string;
|
|
328
|
+
/** New human-readable display value */
|
|
329
|
+
newDisplayValue?: string;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Mention — An @mention within a feed item.
|
|
334
|
+
* Aligned with @objectstack/spec MentionSchema.
|
|
335
|
+
*/
|
|
336
|
+
export interface Mention {
|
|
337
|
+
/** Mention target type */
|
|
338
|
+
type: 'user' | 'team' | 'group';
|
|
339
|
+
/** Mentioned entity ID */
|
|
340
|
+
id: string;
|
|
341
|
+
/** Display name */
|
|
342
|
+
name: string;
|
|
343
|
+
/** Offset in the body text */
|
|
344
|
+
offset?: number;
|
|
345
|
+
/** Length of the mention text */
|
|
346
|
+
length?: number;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Reaction — An emoji reaction on a feed item.
|
|
351
|
+
* Aligned with @objectstack/spec ReactionSchema.
|
|
352
|
+
*/
|
|
353
|
+
export interface Reaction {
|
|
354
|
+
/** Emoji identifier (e.g. '👍', '❤️', '🎉') */
|
|
355
|
+
emoji: string;
|
|
356
|
+
/** Number of users who reacted with this emoji */
|
|
357
|
+
count: number;
|
|
358
|
+
/** Whether the current user reacted with this emoji */
|
|
359
|
+
reacted?: boolean;
|
|
360
|
+
/** IDs of users who reacted */
|
|
361
|
+
userIds?: string[];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* RecordSubscription — Notification subscription state for a record.
|
|
366
|
+
* Aligned with @objectstack/spec RecordSubscriptionSchema.
|
|
367
|
+
*/
|
|
368
|
+
export interface RecordSubscription {
|
|
369
|
+
/** Record ID */
|
|
370
|
+
recordId: string | number;
|
|
371
|
+
/** Whether the current user is subscribed */
|
|
372
|
+
subscribed: boolean;
|
|
373
|
+
/** Notification channels */
|
|
374
|
+
channels?: Array<'in_app' | 'email' | 'push'>;
|
|
375
|
+
}
|
|
376
|
+
|
|
149
377
|
/**
|
|
150
378
|
* Detail View Schema - Display detailed information about a single record
|
|
151
379
|
* Enhanced in Phase 2 with better organization and features
|
|
@@ -172,6 +400,15 @@ export interface DetailViewSchema extends BaseSchema {
|
|
|
172
400
|
* Data to display (if not fetching from API)
|
|
173
401
|
*/
|
|
174
402
|
data?: any;
|
|
403
|
+
/**
|
|
404
|
+
* Primary field name whose value is displayed as the record title in the header.
|
|
405
|
+
* Falls back to `title` when not set or when the field value is empty.
|
|
406
|
+
*/
|
|
407
|
+
primaryField?: string;
|
|
408
|
+
/**
|
|
409
|
+
* Field names whose values are rendered as summary Badges next to the header title.
|
|
410
|
+
*/
|
|
411
|
+
summaryFields?: string[];
|
|
175
412
|
/**
|
|
176
413
|
* Layout mode
|
|
177
414
|
*/
|
|
@@ -274,6 +511,30 @@ export interface DetailViewSchema extends BaseSchema {
|
|
|
274
511
|
*/
|
|
275
512
|
fields?: string[];
|
|
276
513
|
}>;
|
|
514
|
+
/**
|
|
515
|
+
* Record navigation configuration for prev/next navigation.
|
|
516
|
+
* Allows navigating through a result set from within the detail view.
|
|
517
|
+
*/
|
|
518
|
+
recordNavigation?: {
|
|
519
|
+
/** All record IDs in the current view's result set */
|
|
520
|
+
recordIds: Array<string | number>;
|
|
521
|
+
/** Current record's index in the result set (0-based) */
|
|
522
|
+
currentIndex: number;
|
|
523
|
+
/** Callback to navigate to a specific record by ID */
|
|
524
|
+
onNavigate: (recordId: string | number) => void;
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* Comments associated with this record
|
|
528
|
+
*/
|
|
529
|
+
comments?: CommentEntry[];
|
|
530
|
+
/**
|
|
531
|
+
* Callback to add a new comment
|
|
532
|
+
*/
|
|
533
|
+
onAddComment?: (text: string) => void | Promise<void>;
|
|
534
|
+
/**
|
|
535
|
+
* Activity history entries for this record
|
|
536
|
+
*/
|
|
537
|
+
activities?: ActivityEntry[];
|
|
277
538
|
}
|
|
278
539
|
|
|
279
540
|
/**
|
|
@@ -331,6 +592,17 @@ export interface ViewSwitcherSchema extends BaseSchema {
|
|
|
331
592
|
* Storage key for persisting view
|
|
332
593
|
*/
|
|
333
594
|
storageKey?: string;
|
|
595
|
+
/**
|
|
596
|
+
* Show "+" button to add/create a new view
|
|
597
|
+
*/
|
|
598
|
+
allowCreateView?: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* Per-view action icons (e.g., share, settings, duplicate, delete)
|
|
601
|
+
*/
|
|
602
|
+
viewActions?: Array<{
|
|
603
|
+
type: 'share' | 'settings' | 'duplicate' | 'delete';
|
|
604
|
+
icon?: string;
|
|
605
|
+
}>;
|
|
334
606
|
}
|
|
335
607
|
|
|
336
608
|
/**
|