@synchra24/app-ui 0.0.0-stage → 0.2.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/CHANGELOG.md +11 -0
- package/FONT-SOURCES.md +21 -0
- package/README.md +121 -2
- package/custom-elements.json +2251 -0
- package/dist/auto.js +3929 -0
- package/dist/index.d.ts +261 -0
- package/dist/index.js +3926 -0
- package/dist/react.d.ts +260 -0
- package/dist/react.js +2 -0
- package/dist/synchra-app-ui.js +437 -0
- package/docs/AI-AGENT.md +115 -0
- package/docs/API.md +392 -0
- package/docs/DEVELOPMENT.md +78 -0
- package/licenses/google-material-symbols-Apache-2.0.txt +201 -0
- package/package.json +72 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
export const version: string;
|
|
2
|
+
export type Runtime = "web" | "mobile";
|
|
3
|
+
export interface Theme {
|
|
4
|
+
active: "light" | "dark";
|
|
5
|
+
current: Record<string, string>;
|
|
6
|
+
/** Native window dimensions (not the widget size); forwarded by Synchra24. */
|
|
7
|
+
layout?: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
fontScale?: number;
|
|
11
|
+
allowFontScaling?: boolean;
|
|
12
|
+
platform?: "ios" | "android";
|
|
13
|
+
};
|
|
14
|
+
tokens?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export interface SDK {
|
|
17
|
+
getRuntime?(): Runtime;
|
|
18
|
+
getSynchraTheme?(): Theme | null;
|
|
19
|
+
onSynchraThemeChange?(callback: (theme: Theme) => void): () => void;
|
|
20
|
+
getCapabilities?(): {
|
|
21
|
+
inputEditor?: number;
|
|
22
|
+
nativePickers?: number;
|
|
23
|
+
nativeSelect?: number;
|
|
24
|
+
serviceWidgets?: number;
|
|
25
|
+
};
|
|
26
|
+
selectOption?(options: {
|
|
27
|
+
value?: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
options: SelectOption[];
|
|
31
|
+
}): Promise<{ supported: boolean; cancelled?: boolean; value?: string }>;
|
|
32
|
+
selectDate?(options?: {
|
|
33
|
+
date?: string;
|
|
34
|
+
min_date?: string;
|
|
35
|
+
max_date?: string;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
date?: string | null;
|
|
38
|
+
cancelled?: boolean;
|
|
39
|
+
supported?: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
selectTime?(options?: {
|
|
42
|
+
time?: string;
|
|
43
|
+
}): Promise<{ time?: string; cancelled?: boolean; supported?: boolean }>;
|
|
44
|
+
editText?(
|
|
45
|
+
options: Record<string, unknown>
|
|
46
|
+
): Promise<
|
|
47
|
+
| { supported: false }
|
|
48
|
+
| { supported: true; cancelled?: boolean; value: string }
|
|
49
|
+
>;
|
|
50
|
+
}
|
|
51
|
+
export interface SelectOption {
|
|
52
|
+
value: string;
|
|
53
|
+
label: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface ValueElement extends HTMLElement {
|
|
58
|
+
value: string;
|
|
59
|
+
disabled: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface MaterialIconDefinition {
|
|
62
|
+
xml: string;
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
export interface IconElement extends HTMLElement {
|
|
66
|
+
icon?: MaterialIconDefinition;
|
|
67
|
+
}
|
|
68
|
+
export type TypographyVariant =
|
|
69
|
+
| "caption"
|
|
70
|
+
| "footnote"
|
|
71
|
+
| "callout"
|
|
72
|
+
| "body"
|
|
73
|
+
| "title3"
|
|
74
|
+
| "title2"
|
|
75
|
+
| "title1"
|
|
76
|
+
| "largeTitle";
|
|
77
|
+
export const typography: Record<
|
|
78
|
+
Runtime,
|
|
79
|
+
Record<TypographyVariant, { fontSize: number; lineHeight: number }>
|
|
80
|
+
>;
|
|
81
|
+
export const catalogCount: number;
|
|
82
|
+
export interface ButtonElement extends HTMLElement {
|
|
83
|
+
disabled: boolean;
|
|
84
|
+
loading: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface CircleButtonElement extends ButtonElement {
|
|
87
|
+
icon?: MaterialIconDefinition;
|
|
88
|
+
}
|
|
89
|
+
export interface TabsElement extends HTMLElement {
|
|
90
|
+
value: string;
|
|
91
|
+
}
|
|
92
|
+
export interface ChoiceElement extends ValueElement {
|
|
93
|
+
checked: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface SelectElement extends ValueElement {
|
|
96
|
+
options: SelectOption[];
|
|
97
|
+
open(): Promise<void>;
|
|
98
|
+
close(): void;
|
|
99
|
+
}
|
|
100
|
+
export interface PickerElement extends ValueElement {
|
|
101
|
+
open(): void;
|
|
102
|
+
close(): void;
|
|
103
|
+
}
|
|
104
|
+
export interface SliderElement extends ValueElement {
|
|
105
|
+
valueAsNumber: number;
|
|
106
|
+
}
|
|
107
|
+
export interface DialogElement extends HTMLElement {
|
|
108
|
+
showModal(): void;
|
|
109
|
+
close(returnValue?: string): void;
|
|
110
|
+
}
|
|
111
|
+
export function defineComponents(registry?: CustomElementRegistry): void;
|
|
112
|
+
export function connect(
|
|
113
|
+
root: HTMLElement,
|
|
114
|
+
options?: { sdk?: SDK; runtime?: Runtime; theme?: Theme | null }
|
|
115
|
+
): () => void;
|
|
116
|
+
export const geometry: Record<Runtime, Record<string, string>>;
|
|
117
|
+
declare global {
|
|
118
|
+
interface HTMLElementTagNameMap {
|
|
119
|
+
"s24-button": ButtonElement;
|
|
120
|
+
"s24-circle-button": CircleButtonElement;
|
|
121
|
+
"s24-search": ValueElement;
|
|
122
|
+
"s24-input": ValueElement;
|
|
123
|
+
"s24-textarea": ValueElement;
|
|
124
|
+
"s24-checkbox": ChoiceElement;
|
|
125
|
+
"s24-radio": ChoiceElement;
|
|
126
|
+
"s24-switch": ChoiceElement;
|
|
127
|
+
"s24-select": SelectElement;
|
|
128
|
+
"s24-date-picker": PickerElement;
|
|
129
|
+
"s24-time-picker": PickerElement;
|
|
130
|
+
"s24-slider": SliderElement;
|
|
131
|
+
"s24-dialog": DialogElement;
|
|
132
|
+
"s24-tabs": TabsElement;
|
|
133
|
+
"s24-tab": HTMLElement;
|
|
134
|
+
"s24-island": HTMLElement;
|
|
135
|
+
"s24-well": HTMLElement;
|
|
136
|
+
"s24-space": HTMLElement;
|
|
137
|
+
"s24-screen": HTMLElement;
|
|
138
|
+
"s24-stack": HTMLElement;
|
|
139
|
+
"s24-text": HTMLElement;
|
|
140
|
+
"s24-typography": HTMLElement;
|
|
141
|
+
"s24-icon": IconElement;
|
|
142
|
+
"s24-row": HTMLElement;
|
|
143
|
+
"s24-badge": HTMLElement;
|
|
144
|
+
"s24-divider": HTMLElement;
|
|
145
|
+
"s24-empty": HTMLElement;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Employee IDs are company profile IDs, never account user IDs. */
|
|
150
|
+
export interface EmployeeItem {
|
|
151
|
+
profile_id: number;
|
|
152
|
+
name: string;
|
|
153
|
+
position?: string;
|
|
154
|
+
avatar?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface AttachmentItem {
|
|
157
|
+
id?: string;
|
|
158
|
+
file?: string;
|
|
159
|
+
bucket?: string;
|
|
160
|
+
name: string;
|
|
161
|
+
type?: string;
|
|
162
|
+
size?: number;
|
|
163
|
+
/** Preview data URL, or a safe URL provided by the integration. Do not persist preview data. */
|
|
164
|
+
preview?: string;
|
|
165
|
+
url?: string;
|
|
166
|
+
localFile?: File;
|
|
167
|
+
duration_ms?: number;
|
|
168
|
+
bars?: number[];
|
|
169
|
+
}
|
|
170
|
+
export interface WidgetResult {
|
|
171
|
+
supported: boolean;
|
|
172
|
+
cancelled?: boolean;
|
|
173
|
+
items?: AttachmentItem[];
|
|
174
|
+
}
|
|
175
|
+
export interface SDK {
|
|
176
|
+
selectEmployees?(options?: {
|
|
177
|
+
profile_ids?: number[];
|
|
178
|
+
all_users?: boolean;
|
|
179
|
+
max_selected?: number;
|
|
180
|
+
}): Promise<{
|
|
181
|
+
supported?: boolean;
|
|
182
|
+
cancelled?: boolean;
|
|
183
|
+
profile_ids?: number[];
|
|
184
|
+
employees?: EmployeeItem[];
|
|
185
|
+
}>;
|
|
186
|
+
selectEmployeeProfiles?(options?: {
|
|
187
|
+
profile_ids?: number[];
|
|
188
|
+
all_users?: boolean;
|
|
189
|
+
}): Promise<{
|
|
190
|
+
supported?: boolean;
|
|
191
|
+
cancelled?: boolean;
|
|
192
|
+
profile_ids?: number[];
|
|
193
|
+
}>;
|
|
194
|
+
capturePhoto?(options?: {
|
|
195
|
+
max_files?: number;
|
|
196
|
+
max_size?: number;
|
|
197
|
+
}): Promise<WidgetResult>;
|
|
198
|
+
attachFiles?(options?: {
|
|
199
|
+
max_files?: number;
|
|
200
|
+
max_size?: number;
|
|
201
|
+
}): Promise<WidgetResult>;
|
|
202
|
+
showInfo?(options: {
|
|
203
|
+
title?: string;
|
|
204
|
+
description: string;
|
|
205
|
+
}): Promise<{ supported: boolean }>;
|
|
206
|
+
editRichText?(options: {
|
|
207
|
+
value: string;
|
|
208
|
+
label?: string;
|
|
209
|
+
placeholder?: string;
|
|
210
|
+
}): Promise<{ supported: boolean; cancelled?: boolean; value?: string }>;
|
|
211
|
+
startVoiceRecording?(options: {
|
|
212
|
+
session_id: string;
|
|
213
|
+
max_duration?: number;
|
|
214
|
+
}): Promise<{ supported: boolean; started?: boolean }>;
|
|
215
|
+
stopVoiceRecording?(options: { session_id: string }): Promise<WidgetResult>;
|
|
216
|
+
cancelVoiceRecording?(options: { session_id: string }): Promise<WidgetResult>;
|
|
217
|
+
recordVoice?(options?: { max_duration?: number }): Promise<WidgetResult>;
|
|
218
|
+
}
|
|
219
|
+
export interface EmployeesElement extends HTMLElement {
|
|
220
|
+
value: number[];
|
|
221
|
+
employees: EmployeeItem[];
|
|
222
|
+
disabled: boolean;
|
|
223
|
+
open(): Promise<void>;
|
|
224
|
+
}
|
|
225
|
+
export interface AttachmentsElement extends HTMLElement {
|
|
226
|
+
value: AttachmentItem[];
|
|
227
|
+
disabled: boolean;
|
|
228
|
+
/** Browser/standalone upload adapter. Without it, s24-change contains localFile. */
|
|
229
|
+
upload?: (file: File) => Promise<AttachmentItem>;
|
|
230
|
+
add(): Promise<void>;
|
|
231
|
+
}
|
|
232
|
+
export interface VoiceRecorderElement extends HTMLElement {
|
|
233
|
+
value: AttachmentItem | null;
|
|
234
|
+
disabled: boolean;
|
|
235
|
+
upload?: (file: File) => Promise<AttachmentItem>;
|
|
236
|
+
record(): Promise<void>;
|
|
237
|
+
stop(): Promise<void>;
|
|
238
|
+
cancel(): Promise<void>;
|
|
239
|
+
}
|
|
240
|
+
declare global {
|
|
241
|
+
interface HTMLElementTagNameMap {
|
|
242
|
+
"s24-info": InfoElement;
|
|
243
|
+
"s24-progress": ProgressElement;
|
|
244
|
+
"s24-text-editor": TextEditorElement;
|
|
245
|
+
"s24-employees": EmployeesElement;
|
|
246
|
+
"s24-photos": AttachmentsElement;
|
|
247
|
+
"s24-files": AttachmentsElement;
|
|
248
|
+
"s24-voice-recorder": VoiceRecorderElement;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface InfoElement extends HTMLElement {
|
|
253
|
+
open(): Promise<void>;
|
|
254
|
+
}
|
|
255
|
+
export interface ProgressElement extends HTMLElement {
|
|
256
|
+
value: number;
|
|
257
|
+
}
|
|
258
|
+
export interface TextEditorElement extends HTMLElement {
|
|
259
|
+
value: string;
|
|
260
|
+
open(): Promise<void>;
|
|
261
|
+
}
|