@synchra24/app-ui 0.1.0 → 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/README.md +16 -2
- package/custom-elements.json +423 -0
- package/dist/auto.js +1486 -8
- package/dist/index.d.ts +118 -2
- package/dist/index.js +1486 -8
- package/dist/react.d.ts +64 -1
- package/dist/synchra-app-ui.js +131 -8
- package/docs/AI-AGENT.md +20 -0
- package/docs/API.md +115 -0
- package/docs/DEVELOPMENT.md +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface SDK {
|
|
|
21
21
|
inputEditor?: number;
|
|
22
22
|
nativePickers?: number;
|
|
23
23
|
nativeSelect?: number;
|
|
24
|
+
serviceWidgets?: number;
|
|
24
25
|
};
|
|
25
26
|
selectOption?(options: {
|
|
26
27
|
value?: string;
|
|
@@ -41,7 +42,7 @@ export interface SDK {
|
|
|
41
42
|
time?: string;
|
|
42
43
|
}): Promise<{ time?: string; cancelled?: boolean; supported?: boolean }>;
|
|
43
44
|
editText?(
|
|
44
|
-
options: Record<string, unknown
|
|
45
|
+
options: Record<string, unknown>
|
|
45
46
|
): Promise<
|
|
46
47
|
| { supported: false }
|
|
47
48
|
| { supported: true; cancelled?: boolean; value: string }
|
|
@@ -110,13 +111,14 @@ export interface DialogElement extends HTMLElement {
|
|
|
110
111
|
export function defineComponents(registry?: CustomElementRegistry): void;
|
|
111
112
|
export function connect(
|
|
112
113
|
root: HTMLElement,
|
|
113
|
-
options?: { sdk?: SDK; runtime?: Runtime; theme?: Theme | null }
|
|
114
|
+
options?: { sdk?: SDK; runtime?: Runtime; theme?: Theme | null }
|
|
114
115
|
): () => void;
|
|
115
116
|
export const geometry: Record<Runtime, Record<string, string>>;
|
|
116
117
|
declare global {
|
|
117
118
|
interface HTMLElementTagNameMap {
|
|
118
119
|
"s24-button": ButtonElement;
|
|
119
120
|
"s24-circle-button": CircleButtonElement;
|
|
121
|
+
"s24-search": ValueElement;
|
|
120
122
|
"s24-input": ValueElement;
|
|
121
123
|
"s24-textarea": ValueElement;
|
|
122
124
|
"s24-checkbox": ChoiceElement;
|
|
@@ -143,3 +145,117 @@ declare global {
|
|
|
143
145
|
"s24-empty": HTMLElement;
|
|
144
146
|
}
|
|
145
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
|
+
}
|