@stndrds/constants 1.0.0-alpha.294 → 1.0.0-alpha.69
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/README.md +6 -1
- package/dist/index.d.mts +146 -173
- package/dist/index.d.ts +146 -173
- package/dist/index.js +304 -486
- package/dist/index.mjs +300 -466
- package/package.json +4 -8
package/dist/index.mjs
CHANGED
|
@@ -1,212 +1,3 @@
|
|
|
1
|
-
// src/mimeTypes.ts
|
|
2
|
-
var IMAGE_MIME_TYPES = {
|
|
3
|
-
JPEG: "image/jpeg",
|
|
4
|
-
PNG: "image/png",
|
|
5
|
-
GIF: "image/gif",
|
|
6
|
-
WEBP: "image/webp",
|
|
7
|
-
SVG: "image/svg+xml",
|
|
8
|
-
BMP: "image/bmp",
|
|
9
|
-
TIFF: "image/tiff",
|
|
10
|
-
ICO: "image/x-icon",
|
|
11
|
-
HEIC: "image/heic",
|
|
12
|
-
HEIF: "image/heif"
|
|
13
|
-
};
|
|
14
|
-
var IMAGE_MIME_TYPES_ARRAY = Object.values(IMAGE_MIME_TYPES);
|
|
15
|
-
var DOCUMENT_MIME_TYPES = {
|
|
16
|
-
PDF: "application/pdf",
|
|
17
|
-
DOC: "application/msword",
|
|
18
|
-
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
19
|
-
XLS: "application/vnd.ms-excel",
|
|
20
|
-
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
21
|
-
PPT: "application/vnd.ms-powerpoint",
|
|
22
|
-
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
23
|
-
ODT: "application/vnd.oasis.opendocument.text",
|
|
24
|
-
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
25
|
-
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
26
|
-
RTF: "application/rtf",
|
|
27
|
-
TXT: "text/plain",
|
|
28
|
-
CSV: "text/csv",
|
|
29
|
-
MARKDOWN: "text/markdown"
|
|
30
|
-
};
|
|
31
|
-
var DOCUMENT_MIME_TYPES_ARRAY = Object.values(DOCUMENT_MIME_TYPES);
|
|
32
|
-
var ARCHIVE_MIME_TYPES = {
|
|
33
|
-
ZIP: "application/zip",
|
|
34
|
-
RAR: "application/vnd.rar",
|
|
35
|
-
TAR: "application/x-tar",
|
|
36
|
-
GZIP: "application/gzip",
|
|
37
|
-
"7Z": "application/x-7z-compressed",
|
|
38
|
-
BZ2: "application/x-bzip2"
|
|
39
|
-
};
|
|
40
|
-
var ARCHIVE_MIME_TYPES_ARRAY = Object.values(ARCHIVE_MIME_TYPES);
|
|
41
|
-
var AUDIO_MIME_TYPES = {
|
|
42
|
-
MP3: "audio/mpeg",
|
|
43
|
-
WAV: "audio/wav",
|
|
44
|
-
OGG: "audio/ogg",
|
|
45
|
-
AAC: "audio/aac",
|
|
46
|
-
FLAC: "audio/flac",
|
|
47
|
-
M4A: "audio/mp4",
|
|
48
|
-
WEBM: "audio/webm"
|
|
49
|
-
};
|
|
50
|
-
var AUDIO_MIME_TYPES_ARRAY = Object.values(AUDIO_MIME_TYPES);
|
|
51
|
-
var VIDEO_MIME_TYPES = {
|
|
52
|
-
MP4: "video/mp4",
|
|
53
|
-
WEBM: "video/webm",
|
|
54
|
-
OGG: "video/ogg",
|
|
55
|
-
AVI: "video/x-msvideo",
|
|
56
|
-
MOV: "video/quicktime",
|
|
57
|
-
MKV: "video/x-matroska",
|
|
58
|
-
FLV: "video/x-flv",
|
|
59
|
-
WMV: "video/x-ms-wmv",
|
|
60
|
-
MPEG: "video/mpeg"
|
|
61
|
-
};
|
|
62
|
-
var VIDEO_MIME_TYPES_ARRAY = Object.values(VIDEO_MIME_TYPES);
|
|
63
|
-
var CODE_MIME_TYPES = {
|
|
64
|
-
JAVASCRIPT: "text/javascript",
|
|
65
|
-
TYPESCRIPT: "text/typescript",
|
|
66
|
-
JSON: "application/json",
|
|
67
|
-
XML: "application/xml",
|
|
68
|
-
HTML: "text/html",
|
|
69
|
-
CSS: "text/css",
|
|
70
|
-
PYTHON: "text/x-python",
|
|
71
|
-
JAVA: "text/x-java-source",
|
|
72
|
-
C: "text/x-c",
|
|
73
|
-
CPP: "text/x-c++",
|
|
74
|
-
YAML: "application/x-yaml",
|
|
75
|
-
SQL: "application/sql"
|
|
76
|
-
};
|
|
77
|
-
var CODE_MIME_TYPES_ARRAY = Object.values(CODE_MIME_TYPES);
|
|
78
|
-
var FONT_MIME_TYPES = {
|
|
79
|
-
TTF: "font/ttf",
|
|
80
|
-
OTF: "font/otf",
|
|
81
|
-
WOFF: "font/woff",
|
|
82
|
-
WOFF2: "font/woff2",
|
|
83
|
-
EOT: "application/vnd.ms-fontobject"
|
|
84
|
-
};
|
|
85
|
-
var FONT_MIME_TYPES_ARRAY = Object.values(FONT_MIME_TYPES);
|
|
86
|
-
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
87
|
-
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
88
|
-
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
89
|
-
var AUDIO = AUDIO_MIME_TYPES_ARRAY;
|
|
90
|
-
var VIDEO = VIDEO_MIME_TYPES_ARRAY;
|
|
91
|
-
var CODE = CODE_MIME_TYPES_ARRAY;
|
|
92
|
-
var FONTS = FONT_MIME_TYPES_ARRAY;
|
|
93
|
-
var WEB_IMAGES = [
|
|
94
|
-
IMAGE_MIME_TYPES.JPEG,
|
|
95
|
-
IMAGE_MIME_TYPES.PNG,
|
|
96
|
-
IMAGE_MIME_TYPES.GIF,
|
|
97
|
-
IMAGE_MIME_TYPES.WEBP
|
|
98
|
-
];
|
|
99
|
-
var OFFICE_DOCUMENTS = [
|
|
100
|
-
DOCUMENT_MIME_TYPES.PDF,
|
|
101
|
-
DOCUMENT_MIME_TYPES.DOC,
|
|
102
|
-
DOCUMENT_MIME_TYPES.DOCX,
|
|
103
|
-
DOCUMENT_MIME_TYPES.XLS,
|
|
104
|
-
DOCUMENT_MIME_TYPES.XLSX,
|
|
105
|
-
DOCUMENT_MIME_TYPES.PPT,
|
|
106
|
-
DOCUMENT_MIME_TYPES.PPTX
|
|
107
|
-
];
|
|
108
|
-
var MEDIA = [...IMAGES, ...AUDIO, ...VIDEO];
|
|
109
|
-
var ALL_MIME_TYPES = [
|
|
110
|
-
...IMAGES,
|
|
111
|
-
...DOCUMENTS,
|
|
112
|
-
...ARCHIVES,
|
|
113
|
-
...AUDIO,
|
|
114
|
-
...VIDEO,
|
|
115
|
-
...CODE,
|
|
116
|
-
...FONTS
|
|
117
|
-
];
|
|
118
|
-
var isImageMimeType = (mimeType) => {
|
|
119
|
-
return IMAGES.includes(mimeType);
|
|
120
|
-
};
|
|
121
|
-
var isDocumentMimeType = (mimeType) => {
|
|
122
|
-
return DOCUMENTS.includes(mimeType);
|
|
123
|
-
};
|
|
124
|
-
var isArchiveMimeType = (mimeType) => {
|
|
125
|
-
return ARCHIVES.includes(mimeType);
|
|
126
|
-
};
|
|
127
|
-
var isAudioMimeType = (mimeType) => {
|
|
128
|
-
return AUDIO.includes(mimeType);
|
|
129
|
-
};
|
|
130
|
-
var isVideoMimeType = (mimeType) => {
|
|
131
|
-
return VIDEO.includes(mimeType);
|
|
132
|
-
};
|
|
133
|
-
var isCodeMimeType = (mimeType) => {
|
|
134
|
-
return CODE.includes(mimeType);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// src/aiChat.ts
|
|
138
|
-
var AI_CHAT_SUPPORTED_IMAGES = [
|
|
139
|
-
IMAGE_MIME_TYPES.JPEG,
|
|
140
|
-
IMAGE_MIME_TYPES.PNG,
|
|
141
|
-
IMAGE_MIME_TYPES.WEBP,
|
|
142
|
-
IMAGE_MIME_TYPES.GIF,
|
|
143
|
-
IMAGE_MIME_TYPES.SVG
|
|
144
|
-
];
|
|
145
|
-
var AI_CHAT_SUPPORTED_DOCUMENTS = [
|
|
146
|
-
DOCUMENT_MIME_TYPES.PDF,
|
|
147
|
-
DOCUMENT_MIME_TYPES.DOC,
|
|
148
|
-
DOCUMENT_MIME_TYPES.DOCX,
|
|
149
|
-
DOCUMENT_MIME_TYPES.TXT,
|
|
150
|
-
DOCUMENT_MIME_TYPES.MARKDOWN,
|
|
151
|
-
DOCUMENT_MIME_TYPES.CSV
|
|
152
|
-
];
|
|
153
|
-
var AI_CHAT_SUPPORTED_MIME_TYPES = [
|
|
154
|
-
...AI_CHAT_SUPPORTED_IMAGES,
|
|
155
|
-
...AI_CHAT_SUPPORTED_DOCUMENTS
|
|
156
|
-
];
|
|
157
|
-
var AI_CHAT_ACCEPTED_TYPES = AI_CHAT_SUPPORTED_MIME_TYPES.join(",");
|
|
158
|
-
var AI_CHAT_MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
159
|
-
var AI_CHAT_MAX_FILES = 5;
|
|
160
|
-
|
|
161
|
-
// src/agentTools.ts
|
|
162
|
-
var BUILT_IN_AGENT_TOOL_GROUPS = {
|
|
163
|
-
bulk: ["bulk_create_records", "bulk_delete_records", "bulk_search", "bulk_update_records"],
|
|
164
|
-
calendar: ["get_calendar_event", "get_meeting_transcript", "search_calendar_events"],
|
|
165
|
-
core: [
|
|
166
|
-
"archive_document",
|
|
167
|
-
"ask_questions",
|
|
168
|
-
"attach_file",
|
|
169
|
-
"call_reflex",
|
|
170
|
-
"create_folder",
|
|
171
|
-
"create_record",
|
|
172
|
-
"delete_record",
|
|
173
|
-
"exec_command",
|
|
174
|
-
"get_record",
|
|
175
|
-
"get_schema",
|
|
176
|
-
"get_skill",
|
|
177
|
-
"global_search",
|
|
178
|
-
"initialize_record_drive_structure",
|
|
179
|
-
"list_record_drive",
|
|
180
|
-
"list_workspace_users",
|
|
181
|
-
"load_toolset",
|
|
182
|
-
"publish_artifact",
|
|
183
|
-
"read_document",
|
|
184
|
-
"remove_file",
|
|
185
|
-
"request_work_mode",
|
|
186
|
-
"sandbox_get_file",
|
|
187
|
-
"sandbox_upload_file",
|
|
188
|
-
"sandbox_validate_payload",
|
|
189
|
-
"search_records",
|
|
190
|
-
"update_document",
|
|
191
|
-
"update_record",
|
|
192
|
-
"write_todos"
|
|
193
|
-
],
|
|
194
|
-
email: ["download_email_attachments", "get_email", "get_email_thread", "search_emails"],
|
|
195
|
-
memory: ["get_memory", "save_memory", "search_memories"],
|
|
196
|
-
orchestration: ["message_agent", "spawn_agent"],
|
|
197
|
-
schema: [
|
|
198
|
-
"apply_architect_operation",
|
|
199
|
-
"describe_architect_operation",
|
|
200
|
-
"discard_architect_draft",
|
|
201
|
-
"get_default_view",
|
|
202
|
-
"get_schema_history",
|
|
203
|
-
"request_design_review",
|
|
204
|
-
"search_icons"
|
|
205
|
-
],
|
|
206
|
-
web: ["read_webpage", "web_search"]
|
|
207
|
-
};
|
|
208
|
-
var BUILT_IN_AGENT_TOOL_NAMES = Object.values(BUILT_IN_AGENT_TOOL_GROUPS).flat();
|
|
209
|
-
|
|
210
1
|
// src/attribute-icons.ts
|
|
211
2
|
var DEFAULT_ATTRIBUTE_ICONS = {
|
|
212
3
|
text: "text-align-left",
|
|
@@ -232,120 +23,131 @@ function getDefaultAttributeIcon(type) {
|
|
|
232
23
|
return DEFAULT_ATTRIBUTE_ICONS[type] ?? "circle";
|
|
233
24
|
}
|
|
234
25
|
|
|
235
|
-
// src/tab-icons.ts
|
|
236
|
-
var DEFAULT_TAB_ICONS = {
|
|
237
|
-
/** Arranged groups of fields. */
|
|
238
|
-
form: "layout",
|
|
239
|
-
/** Related records, in rows. */
|
|
240
|
-
table: "table",
|
|
241
|
-
/** A caller-supplied component slotted into the record. */
|
|
242
|
-
custom: "puzzle",
|
|
243
|
-
activity: "activity",
|
|
244
|
-
richtext: "file-text",
|
|
245
|
-
documents: "folder",
|
|
246
|
-
/** Form submissions gathered on this record. */
|
|
247
|
-
forms: "clipboard",
|
|
248
|
-
emails: "envelope",
|
|
249
|
-
meetings: "calendar"
|
|
250
|
-
};
|
|
251
|
-
function getDefaultTabIcon(type) {
|
|
252
|
-
return DEFAULT_TAB_ICONS[type] ?? "circle";
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// src/cn.ts
|
|
256
|
-
import { clsx } from "clsx";
|
|
257
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
258
|
-
var twMerge = extendTailwindMerge({
|
|
259
|
-
extend: {
|
|
260
|
-
classGroups: {
|
|
261
|
-
/* Every text rung the design system ships, not a subset. The three
|
|
262
|
-
`control` rungs below were registered when this fix was written; the
|
|
263
|
-
six added since — `2xs` and `xs`, the whole `row` family, `metric` —
|
|
264
|
-
were not, so 199 call sites were still silently losing either their
|
|
265
|
-
size or their colour to the merge.
|
|
266
|
-
It fails the way the comment above describes and no louder: the class
|
|
267
|
-
is dropped, the element inherits the 16px root, and nothing warns.
|
|
268
|
-
Measured live on the records grid, the column header rendered at 16px
|
|
269
|
-
for exactly this reason. Any rung added to `theme.css` has to be added
|
|
270
|
-
here in the same change, or it is not really a rung. */
|
|
271
|
-
"font-size": [
|
|
272
|
-
"text-control-2xs",
|
|
273
|
-
"text-control-xs",
|
|
274
|
-
"text-control-sm",
|
|
275
|
-
"text-control-default",
|
|
276
|
-
"text-control-lg",
|
|
277
|
-
"text-row-sm",
|
|
278
|
-
"text-row-default",
|
|
279
|
-
"text-row-lg",
|
|
280
|
-
"text-metric"
|
|
281
|
-
],
|
|
282
|
-
h: [
|
|
283
|
-
"h-control-sm",
|
|
284
|
-
"h-control-default",
|
|
285
|
-
"h-control-lg",
|
|
286
|
-
"h-row-sm",
|
|
287
|
-
"h-row-default",
|
|
288
|
-
"h-row-lg"
|
|
289
|
-
],
|
|
290
|
-
w: ["w-control-sm", "w-control-default", "w-control-lg", "w-query-popover"],
|
|
291
|
-
size: ["size-control-sm", "size-control-default", "size-control-lg"],
|
|
292
|
-
/* `@stndrds/ds`'s `SURFACE_PADDING` rungs (`packages/ds/src/variants/surface.ts`).
|
|
293
|
-
`PopoverContent` bakes in `p-4`; a caller setting `p-surface-sm` on it
|
|
294
|
-
(e.g. `relation-filter-popover.tsx`) needs tailwind-merge to drop the
|
|
295
|
-
built-in `p-4` rather than keep both. All three rungs registered, not
|
|
296
|
-
just the one in use today, so the next call site doesn't rediscover
|
|
297
|
-
this. */
|
|
298
|
-
p: ["p-surface-sm", "p-surface-default", "p-surface-lg"]
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
function cn(...inputs) {
|
|
303
|
-
return twMerge(clsx(inputs));
|
|
304
|
-
}
|
|
305
|
-
|
|
306
26
|
// src/colors.ts
|
|
307
|
-
var lightDark = (light, dark) => `light-dark(${light}, ${dark})`;
|
|
308
|
-
function defineColor(vivid, textLight, textDark) {
|
|
309
|
-
const r = Number.parseInt(vivid.slice(1, 3), 16);
|
|
310
|
-
const g = Number.parseInt(vivid.slice(3, 5), 16);
|
|
311
|
-
const b = Number.parseInt(vivid.slice(5, 7), 16);
|
|
312
|
-
const alpha = (a) => `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
313
|
-
return {
|
|
314
|
-
background: lightDark(alpha(0.15), alpha(0.22)),
|
|
315
|
-
border: lightDark(alpha(0.3), alpha(0.42)),
|
|
316
|
-
text: lightDark(textLight, textDark),
|
|
317
|
-
icon: vivid
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
27
|
var COLORS = {
|
|
321
28
|
// Neutral & Gray tones
|
|
322
|
-
gray:
|
|
323
|
-
|
|
29
|
+
gray: {
|
|
30
|
+
background: "rgba(107, 114, 128, 0.15)",
|
|
31
|
+
border: "rgba(107, 114, 128, 0.3)",
|
|
32
|
+
text: "#6B7280",
|
|
33
|
+
icon: "#6B7280"
|
|
34
|
+
},
|
|
35
|
+
slate: {
|
|
36
|
+
background: "rgba(100, 116, 139, 0.15)",
|
|
37
|
+
border: "rgba(100, 116, 139, 0.3)",
|
|
38
|
+
text: "#64748B",
|
|
39
|
+
icon: "#64748B"
|
|
40
|
+
},
|
|
324
41
|
// Blue tones (Info, In Progress)
|
|
325
|
-
blue:
|
|
326
|
-
|
|
327
|
-
|
|
42
|
+
blue: {
|
|
43
|
+
background: "rgba(59, 130, 246, 0.15)",
|
|
44
|
+
border: "rgba(59, 130, 246, 0.3)",
|
|
45
|
+
text: "#3B82F6",
|
|
46
|
+
icon: "#3B82F6"
|
|
47
|
+
},
|
|
48
|
+
sky: {
|
|
49
|
+
background: "rgba(14, 165, 233, 0.15)",
|
|
50
|
+
border: "rgba(14, 165, 233, 0.3)",
|
|
51
|
+
text: "#0EA5E9",
|
|
52
|
+
icon: "#0EA5E9"
|
|
53
|
+
},
|
|
54
|
+
indigo: {
|
|
55
|
+
background: "rgba(99, 102, 241, 0.15)",
|
|
56
|
+
border: "rgba(99, 102, 241, 0.3)",
|
|
57
|
+
text: "#6366F1",
|
|
58
|
+
icon: "#6366F1"
|
|
59
|
+
},
|
|
328
60
|
// Green tones (Success, Done, Active)
|
|
329
|
-
green:
|
|
330
|
-
|
|
331
|
-
|
|
61
|
+
green: {
|
|
62
|
+
background: "rgba(34, 197, 94, 0.15)",
|
|
63
|
+
border: "rgba(34, 197, 94, 0.3)",
|
|
64
|
+
text: "#22C55E",
|
|
65
|
+
icon: "#22C55E"
|
|
66
|
+
},
|
|
67
|
+
emerald: {
|
|
68
|
+
background: "rgba(16, 185, 129, 0.15)",
|
|
69
|
+
border: "rgba(16, 185, 129, 0.3)",
|
|
70
|
+
text: "#10B981",
|
|
71
|
+
icon: "#10B981"
|
|
72
|
+
},
|
|
73
|
+
teal: {
|
|
74
|
+
background: "rgba(20, 184, 166, 0.15)",
|
|
75
|
+
border: "rgba(20, 184, 166, 0.3)",
|
|
76
|
+
text: "#14B8A6",
|
|
77
|
+
icon: "#14B8A6"
|
|
78
|
+
},
|
|
332
79
|
// Red tones (Error, Danger, Cancelled)
|
|
333
|
-
red:
|
|
334
|
-
|
|
80
|
+
red: {
|
|
81
|
+
background: "rgba(239, 68, 68, 0.15)",
|
|
82
|
+
border: "rgba(239, 68, 68, 0.3)",
|
|
83
|
+
text: "#EF4444",
|
|
84
|
+
icon: "#EF4444"
|
|
85
|
+
},
|
|
86
|
+
rose: {
|
|
87
|
+
background: "rgba(244, 63, 94, 0.15)",
|
|
88
|
+
border: "rgba(244, 63, 94, 0.3)",
|
|
89
|
+
text: "#F43F5E",
|
|
90
|
+
icon: "#F43F5E"
|
|
91
|
+
},
|
|
335
92
|
// Yellow/Orange tones (Warning, Pending)
|
|
336
|
-
yellow:
|
|
337
|
-
|
|
338
|
-
|
|
93
|
+
yellow: {
|
|
94
|
+
background: "rgba(234, 179, 8, 0.15)",
|
|
95
|
+
border: "rgba(234, 179, 8, 0.3)",
|
|
96
|
+
text: "#EAB308",
|
|
97
|
+
icon: "#EAB308"
|
|
98
|
+
},
|
|
99
|
+
amber: {
|
|
100
|
+
background: "rgba(245, 158, 11, 0.15)",
|
|
101
|
+
border: "rgba(245, 158, 11, 0.3)",
|
|
102
|
+
text: "#F59E0B",
|
|
103
|
+
icon: "#F59E0B"
|
|
104
|
+
},
|
|
105
|
+
orange: {
|
|
106
|
+
background: "rgba(249, 115, 22, 0.15)",
|
|
107
|
+
border: "rgba(249, 115, 22, 0.3)",
|
|
108
|
+
text: "#F97316",
|
|
109
|
+
icon: "#F97316"
|
|
110
|
+
},
|
|
339
111
|
// Purple tones (Special, Featured)
|
|
340
|
-
purple:
|
|
341
|
-
|
|
342
|
-
|
|
112
|
+
purple: {
|
|
113
|
+
background: "rgba(168, 85, 247, 0.15)",
|
|
114
|
+
border: "rgba(168, 85, 247, 0.3)",
|
|
115
|
+
text: "#A855F7",
|
|
116
|
+
icon: "#A855F7"
|
|
117
|
+
},
|
|
118
|
+
violet: {
|
|
119
|
+
background: "rgba(139, 92, 246, 0.15)",
|
|
120
|
+
border: "rgba(139, 92, 246, 0.3)",
|
|
121
|
+
text: "#8B5CF6",
|
|
122
|
+
icon: "#8B5CF6"
|
|
123
|
+
},
|
|
124
|
+
fuchsia: {
|
|
125
|
+
background: "rgba(217, 70, 239, 0.15)",
|
|
126
|
+
border: "rgba(217, 70, 239, 0.3)",
|
|
127
|
+
text: "#D946EF",
|
|
128
|
+
icon: "#D946EF"
|
|
129
|
+
},
|
|
343
130
|
// Pink tones (Accent)
|
|
344
|
-
pink:
|
|
131
|
+
pink: {
|
|
132
|
+
background: "rgba(236, 72, 153, 0.15)",
|
|
133
|
+
border: "rgba(236, 72, 153, 0.3)",
|
|
134
|
+
text: "#EC4899",
|
|
135
|
+
icon: "#EC4899"
|
|
136
|
+
},
|
|
345
137
|
// Cyan (Alternative Info)
|
|
346
|
-
cyan:
|
|
138
|
+
cyan: {
|
|
139
|
+
background: "rgba(6, 182, 212, 0.15)",
|
|
140
|
+
border: "rgba(6, 182, 212, 0.3)",
|
|
141
|
+
text: "#06B6D4",
|
|
142
|
+
icon: "#06B6D4"
|
|
143
|
+
},
|
|
347
144
|
// Lime (Alternative Success)
|
|
348
|
-
lime:
|
|
145
|
+
lime: {
|
|
146
|
+
background: "rgba(132, 204, 22, 0.15)",
|
|
147
|
+
border: "rgba(132, 204, 22, 0.3)",
|
|
148
|
+
text: "#84CC16",
|
|
149
|
+
icon: "#84CC16"
|
|
150
|
+
}
|
|
349
151
|
};
|
|
350
152
|
var getColor = (id) => {
|
|
351
153
|
return COLORS[id];
|
|
@@ -1158,6 +960,9 @@ var getCountryByIso3 = (iso3) => {
|
|
|
1158
960
|
var getAllCountries = () => {
|
|
1159
961
|
return Object.values(COUNTRIES);
|
|
1160
962
|
};
|
|
963
|
+
var getCountryPhoneCode = (iso2) => {
|
|
964
|
+
return COUNTRIES[iso2.toUpperCase()]?.phoneCode || "";
|
|
965
|
+
};
|
|
1161
966
|
var getPhoneMaxDigits = (iso2) => {
|
|
1162
967
|
return COUNTRIES[iso2.toUpperCase()]?.phoneMaxDigits ?? 15;
|
|
1163
968
|
};
|
|
@@ -1172,46 +977,6 @@ var isValidIso3 = (code) => {
|
|
|
1172
977
|
(country) => country.iso3.toUpperCase() === code.toUpperCase()
|
|
1173
978
|
);
|
|
1174
979
|
};
|
|
1175
|
-
var _displayNamesCache = /* @__PURE__ */ new Map();
|
|
1176
|
-
function _getDisplayNames(locales) {
|
|
1177
|
-
const key = locales.join("\0");
|
|
1178
|
-
const cached = _displayNamesCache.get(key);
|
|
1179
|
-
if (cached !== void 0) return cached;
|
|
1180
|
-
try {
|
|
1181
|
-
const dn = new Intl.DisplayNames(locales, { type: "region" });
|
|
1182
|
-
_displayNamesCache.set(key, dn);
|
|
1183
|
-
return dn;
|
|
1184
|
-
} catch {
|
|
1185
|
-
_displayNamesCache.set(key, null);
|
|
1186
|
-
return null;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
function getCountryDisplayName(iso2, locales = ["fr", "en"]) {
|
|
1190
|
-
const code = iso2.toUpperCase();
|
|
1191
|
-
const localeList = Array.isArray(locales) ? locales : [locales];
|
|
1192
|
-
const displayNames = _getDisplayNames(localeList);
|
|
1193
|
-
if (displayNames) {
|
|
1194
|
-
try {
|
|
1195
|
-
const name = displayNames.of(code);
|
|
1196
|
-
if (name) return name;
|
|
1197
|
-
} catch {
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
return COUNTRIES[code]?.name ?? code;
|
|
1201
|
-
}
|
|
1202
|
-
function getCountryDisplayNameByIso3(iso3, locales) {
|
|
1203
|
-
const country = getCountryByIso3(iso3);
|
|
1204
|
-
if (!country) return iso3;
|
|
1205
|
-
return getCountryDisplayName(country.iso2, locales);
|
|
1206
|
-
}
|
|
1207
|
-
function getSortedCountries(locale = "fr") {
|
|
1208
|
-
return getAllCountries().sort(
|
|
1209
|
-
(a, b) => getCountryDisplayName(a.iso2, locale).localeCompare(
|
|
1210
|
-
getCountryDisplayName(b.iso2, locale),
|
|
1211
|
-
locale
|
|
1212
|
-
)
|
|
1213
|
-
);
|
|
1214
|
-
}
|
|
1215
980
|
function stripTrunkPrefix(phoneNumber, trunkPrefix) {
|
|
1216
981
|
if (!trunkPrefix) return phoneNumber;
|
|
1217
982
|
return phoneNumber.startsWith(trunkPrefix) ? phoneNumber.slice(trunkPrefix.length) : phoneNumber;
|
|
@@ -1379,6 +1144,14 @@ var RECOMMENDED_MAX_SIZES = {
|
|
|
1379
1144
|
/** Large archives: 1 GB */
|
|
1380
1145
|
ARCHIVE: FILE_SIZE.GB_1
|
|
1381
1146
|
};
|
|
1147
|
+
var formatBytes = (bytes, decimals = 2) => {
|
|
1148
|
+
if (bytes === 0) return "0 B";
|
|
1149
|
+
const k = 1024;
|
|
1150
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
1151
|
+
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
1152
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1153
|
+
return `${Number.parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
|
|
1154
|
+
};
|
|
1382
1155
|
var mbToBytes = (mb) => {
|
|
1383
1156
|
return mb * 1024 * 1024;
|
|
1384
1157
|
};
|
|
@@ -2671,108 +2444,179 @@ var ICONS = [
|
|
|
2671
2444
|
"zero"
|
|
2672
2445
|
];
|
|
2673
2446
|
|
|
2674
|
-
// src/
|
|
2675
|
-
var
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2447
|
+
// src/mimeTypes.ts
|
|
2448
|
+
var IMAGE_MIME_TYPES = {
|
|
2449
|
+
JPEG: "image/jpeg",
|
|
2450
|
+
PNG: "image/png",
|
|
2451
|
+
GIF: "image/gif",
|
|
2452
|
+
WEBP: "image/webp",
|
|
2453
|
+
SVG: "image/svg+xml",
|
|
2454
|
+
BMP: "image/bmp",
|
|
2455
|
+
TIFF: "image/tiff",
|
|
2456
|
+
ICO: "image/x-icon",
|
|
2457
|
+
HEIC: "image/heic",
|
|
2458
|
+
HEIF: "image/heif"
|
|
2459
|
+
};
|
|
2460
|
+
var IMAGE_MIME_TYPES_ARRAY = Object.values(IMAGE_MIME_TYPES);
|
|
2461
|
+
var DOCUMENT_MIME_TYPES = {
|
|
2462
|
+
PDF: "application/pdf",
|
|
2463
|
+
DOC: "application/msword",
|
|
2464
|
+
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2465
|
+
XLS: "application/vnd.ms-excel",
|
|
2466
|
+
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
2467
|
+
PPT: "application/vnd.ms-powerpoint",
|
|
2468
|
+
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
2469
|
+
ODT: "application/vnd.oasis.opendocument.text",
|
|
2470
|
+
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
2471
|
+
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
2472
|
+
RTF: "application/rtf",
|
|
2473
|
+
TXT: "text/plain",
|
|
2474
|
+
CSV: "text/csv",
|
|
2475
|
+
MARKDOWN: "text/markdown"
|
|
2476
|
+
};
|
|
2477
|
+
var DOCUMENT_MIME_TYPES_ARRAY = Object.values(DOCUMENT_MIME_TYPES);
|
|
2478
|
+
var ARCHIVE_MIME_TYPES = {
|
|
2479
|
+
ZIP: "application/zip",
|
|
2480
|
+
RAR: "application/vnd.rar",
|
|
2481
|
+
TAR: "application/x-tar",
|
|
2482
|
+
GZIP: "application/gzip",
|
|
2483
|
+
"7Z": "application/x-7z-compressed",
|
|
2484
|
+
BZ2: "application/x-bzip2"
|
|
2485
|
+
};
|
|
2486
|
+
var ARCHIVE_MIME_TYPES_ARRAY = Object.values(ARCHIVE_MIME_TYPES);
|
|
2487
|
+
var AUDIO_MIME_TYPES = {
|
|
2488
|
+
MP3: "audio/mpeg",
|
|
2489
|
+
WAV: "audio/wav",
|
|
2490
|
+
OGG: "audio/ogg",
|
|
2491
|
+
AAC: "audio/aac",
|
|
2492
|
+
FLAC: "audio/flac",
|
|
2493
|
+
M4A: "audio/mp4",
|
|
2494
|
+
WEBM: "audio/webm"
|
|
2495
|
+
};
|
|
2496
|
+
var AUDIO_MIME_TYPES_ARRAY = Object.values(AUDIO_MIME_TYPES);
|
|
2497
|
+
var VIDEO_MIME_TYPES = {
|
|
2498
|
+
MP4: "video/mp4",
|
|
2499
|
+
WEBM: "video/webm",
|
|
2500
|
+
OGG: "video/ogg",
|
|
2501
|
+
AVI: "video/x-msvideo",
|
|
2502
|
+
MOV: "video/quicktime",
|
|
2503
|
+
MKV: "video/x-matroska",
|
|
2504
|
+
FLV: "video/x-flv",
|
|
2505
|
+
WMV: "video/x-ms-wmv",
|
|
2506
|
+
MPEG: "video/mpeg"
|
|
2507
|
+
};
|
|
2508
|
+
var VIDEO_MIME_TYPES_ARRAY = Object.values(VIDEO_MIME_TYPES);
|
|
2509
|
+
var CODE_MIME_TYPES = {
|
|
2510
|
+
JAVASCRIPT: "text/javascript",
|
|
2511
|
+
TYPESCRIPT: "text/typescript",
|
|
2512
|
+
JSON: "application/json",
|
|
2513
|
+
XML: "application/xml",
|
|
2514
|
+
HTML: "text/html",
|
|
2515
|
+
CSS: "text/css",
|
|
2516
|
+
PYTHON: "text/x-python",
|
|
2517
|
+
JAVA: "text/x-java-source",
|
|
2518
|
+
C: "text/x-c",
|
|
2519
|
+
CPP: "text/x-c++",
|
|
2520
|
+
YAML: "application/x-yaml",
|
|
2521
|
+
SQL: "application/sql"
|
|
2522
|
+
};
|
|
2523
|
+
var CODE_MIME_TYPES_ARRAY = Object.values(CODE_MIME_TYPES);
|
|
2524
|
+
var FONT_MIME_TYPES = {
|
|
2525
|
+
TTF: "font/ttf",
|
|
2526
|
+
OTF: "font/otf",
|
|
2527
|
+
WOFF: "font/woff",
|
|
2528
|
+
WOFF2: "font/woff2",
|
|
2529
|
+
EOT: "application/vnd.ms-fontobject"
|
|
2530
|
+
};
|
|
2531
|
+
var FONT_MIME_TYPES_ARRAY = Object.values(FONT_MIME_TYPES);
|
|
2532
|
+
var OTHER_MIME_TYPES = {
|
|
2533
|
+
BINARY: "application/octet-stream",
|
|
2534
|
+
FORM_DATA: "multipart/form-data",
|
|
2535
|
+
JSON_LD: "application/ld+json",
|
|
2536
|
+
XHTML: "application/xhtml+xml"
|
|
2537
|
+
};
|
|
2538
|
+
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
2539
|
+
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
2540
|
+
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
2541
|
+
var AUDIO = AUDIO_MIME_TYPES_ARRAY;
|
|
2542
|
+
var VIDEO = VIDEO_MIME_TYPES_ARRAY;
|
|
2543
|
+
var CODE = CODE_MIME_TYPES_ARRAY;
|
|
2544
|
+
var FONTS = FONT_MIME_TYPES_ARRAY;
|
|
2545
|
+
var WEB_IMAGES = [
|
|
2546
|
+
IMAGE_MIME_TYPES.JPEG,
|
|
2547
|
+
IMAGE_MIME_TYPES.PNG,
|
|
2548
|
+
IMAGE_MIME_TYPES.GIF,
|
|
2549
|
+
IMAGE_MIME_TYPES.WEBP
|
|
2550
|
+
];
|
|
2551
|
+
var OFFICE_DOCUMENTS = [
|
|
2552
|
+
DOCUMENT_MIME_TYPES.PDF,
|
|
2553
|
+
DOCUMENT_MIME_TYPES.DOC,
|
|
2554
|
+
DOCUMENT_MIME_TYPES.DOCX,
|
|
2555
|
+
DOCUMENT_MIME_TYPES.XLS,
|
|
2556
|
+
DOCUMENT_MIME_TYPES.XLSX,
|
|
2557
|
+
DOCUMENT_MIME_TYPES.PPT,
|
|
2558
|
+
DOCUMENT_MIME_TYPES.PPTX
|
|
2768
2559
|
];
|
|
2560
|
+
var MEDIA = [...IMAGES, ...AUDIO, ...VIDEO];
|
|
2561
|
+
var ALL_MIME_TYPES = [
|
|
2562
|
+
...IMAGES,
|
|
2563
|
+
...DOCUMENTS,
|
|
2564
|
+
...ARCHIVES,
|
|
2565
|
+
...AUDIO,
|
|
2566
|
+
...VIDEO,
|
|
2567
|
+
...CODE,
|
|
2568
|
+
...FONTS,
|
|
2569
|
+
...Object.values(OTHER_MIME_TYPES)
|
|
2570
|
+
];
|
|
2571
|
+
var isImageMimeType = (mimeType) => {
|
|
2572
|
+
return IMAGES.includes(mimeType);
|
|
2573
|
+
};
|
|
2574
|
+
var isDocumentMimeType = (mimeType) => {
|
|
2575
|
+
return DOCUMENTS.includes(mimeType);
|
|
2576
|
+
};
|
|
2577
|
+
var isArchiveMimeType = (mimeType) => {
|
|
2578
|
+
return ARCHIVES.includes(mimeType);
|
|
2579
|
+
};
|
|
2580
|
+
var isAudioMimeType = (mimeType) => {
|
|
2581
|
+
return AUDIO.includes(mimeType);
|
|
2582
|
+
};
|
|
2583
|
+
var isVideoMimeType = (mimeType) => {
|
|
2584
|
+
return VIDEO.includes(mimeType);
|
|
2585
|
+
};
|
|
2586
|
+
var isCodeMimeType = (mimeType) => {
|
|
2587
|
+
return CODE.includes(mimeType);
|
|
2588
|
+
};
|
|
2589
|
+
var getExtensionFromMimeType = (mimeType) => {
|
|
2590
|
+
const mimeToExt = {
|
|
2591
|
+
// Images
|
|
2592
|
+
"image/jpeg": "jpg",
|
|
2593
|
+
"image/png": "png",
|
|
2594
|
+
"image/gif": "gif",
|
|
2595
|
+
"image/webp": "webp",
|
|
2596
|
+
"image/svg+xml": "svg",
|
|
2597
|
+
// Documents
|
|
2598
|
+
"application/pdf": "pdf",
|
|
2599
|
+
"application/msword": "doc",
|
|
2600
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
|
|
2601
|
+
"application/vnd.ms-excel": "xls",
|
|
2602
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
|
|
2603
|
+
// Archives
|
|
2604
|
+
"application/zip": "zip",
|
|
2605
|
+
"application/vnd.rar": "rar",
|
|
2606
|
+
// Audio
|
|
2607
|
+
"audio/mpeg": "mp3",
|
|
2608
|
+
"audio/wav": "wav",
|
|
2609
|
+
// Video
|
|
2610
|
+
"video/mp4": "mp4",
|
|
2611
|
+
"video/webm": "webm",
|
|
2612
|
+
// Text
|
|
2613
|
+
"text/plain": "txt",
|
|
2614
|
+
"text/csv": "csv",
|
|
2615
|
+
"application/json": "json"
|
|
2616
|
+
};
|
|
2617
|
+
return mimeToExt[mimeType] || null;
|
|
2618
|
+
};
|
|
2769
2619
|
export {
|
|
2770
|
-
AI_CHAT_ACCEPTED_TYPES,
|
|
2771
|
-
AI_CHAT_MAX_FILES,
|
|
2772
|
-
AI_CHAT_MAX_FILE_SIZE,
|
|
2773
|
-
AI_CHAT_SUPPORTED_DOCUMENTS,
|
|
2774
|
-
AI_CHAT_SUPPORTED_IMAGES,
|
|
2775
|
-
AI_CHAT_SUPPORTED_MIME_TYPES,
|
|
2776
2620
|
ALL_MIME_TYPES,
|
|
2777
2621
|
ARCHIVES,
|
|
2778
2622
|
ARCHIVE_MIME_TYPES,
|
|
@@ -2780,8 +2624,6 @@ export {
|
|
|
2780
2624
|
AUDIO,
|
|
2781
2625
|
AUDIO_MIME_TYPES,
|
|
2782
2626
|
AUDIO_MIME_TYPES_ARRAY,
|
|
2783
|
-
BUILT_IN_AGENT_TOOL_GROUPS,
|
|
2784
|
-
BUILT_IN_AGENT_TOOL_NAMES,
|
|
2785
2627
|
BYTES,
|
|
2786
2628
|
CODE,
|
|
2787
2629
|
CODE_MIME_TYPES,
|
|
@@ -2791,8 +2633,6 @@ export {
|
|
|
2791
2633
|
COUNTRIES,
|
|
2792
2634
|
CURRENCIES,
|
|
2793
2635
|
DEFAULT_ATTRIBUTE_ICONS,
|
|
2794
|
-
DEFAULT_TAB_ICONS,
|
|
2795
|
-
DEFAULT_TENANT_ID,
|
|
2796
2636
|
DOCUMENTS,
|
|
2797
2637
|
DOCUMENT_MIME_TYPES,
|
|
2798
2638
|
DOCUMENT_MIME_TYPES_ARRAY,
|
|
@@ -2808,21 +2648,17 @@ export {
|
|
|
2808
2648
|
KILOBYTES,
|
|
2809
2649
|
MEDIA,
|
|
2810
2650
|
MEGABYTES,
|
|
2811
|
-
MEMORY_DESCRIPTION_MAX_LENGTH,
|
|
2812
|
-
MEMORY_NAME_MAX_LENGTH,
|
|
2813
2651
|
OFFICE_DOCUMENTS,
|
|
2652
|
+
OTHER_MIME_TYPES,
|
|
2814
2653
|
RECOMMENDED_MAX_SIZES,
|
|
2815
|
-
SKILL_DESCRIPTION_MAX_LENGTH,
|
|
2816
|
-
SKILL_NAME_MAX_LENGTH,
|
|
2817
2654
|
STATUS_COLORS,
|
|
2818
|
-
TEXT_FORMAT_PRESETS,
|
|
2819
2655
|
VIDEO,
|
|
2820
2656
|
VIDEO_MIME_TYPES,
|
|
2821
2657
|
VIDEO_MIME_TYPES_ARRAY,
|
|
2822
2658
|
WEB_IMAGES,
|
|
2823
2659
|
bytesToGb,
|
|
2824
2660
|
bytesToMb,
|
|
2825
|
-
|
|
2661
|
+
formatBytes,
|
|
2826
2662
|
gbToBytes,
|
|
2827
2663
|
getAllColors,
|
|
2828
2664
|
getAllCountries,
|
|
@@ -2832,15 +2668,13 @@ export {
|
|
|
2832
2668
|
getColorsByGroup,
|
|
2833
2669
|
getCountryByIso2,
|
|
2834
2670
|
getCountryByIso3,
|
|
2835
|
-
|
|
2836
|
-
getCountryDisplayNameByIso3,
|
|
2671
|
+
getCountryPhoneCode,
|
|
2837
2672
|
getCurrency,
|
|
2838
2673
|
getCurrencySymbol,
|
|
2839
2674
|
getDefaultAttributeIcon,
|
|
2840
|
-
|
|
2675
|
+
getExtensionFromMimeType,
|
|
2841
2676
|
getPhoneMaxDigits,
|
|
2842
2677
|
getPhoneTrunkPrefix,
|
|
2843
|
-
getSortedCountries,
|
|
2844
2678
|
isArchiveMimeType,
|
|
2845
2679
|
isAudioMimeType,
|
|
2846
2680
|
isCodeMimeType,
|