@stndrds/constants 0.1.0-alpha.67 → 1.0.0-alpha.100
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/index.d.mts +66 -1
- package/dist/index.d.ts +66 -1
- package/dist/index.js +276 -175
- package/dist/index.mjs +263 -174
- package/package.json +5 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI Chat constants shared between frontend and backend.
|
|
5
|
+
*
|
|
6
|
+
* These define the allowed file types, size limits, and count limits
|
|
7
|
+
* for AI chat attachments. Both the UI and the backend validate against
|
|
8
|
+
* these values to ensure consistency.
|
|
9
|
+
*/
|
|
10
|
+
/** Image MIME types supported by AI chat (subset of all image types) */
|
|
11
|
+
declare const AI_CHAT_SUPPORTED_IMAGES: readonly ["image/jpeg", "image/png", "image/webp", "image/gif"];
|
|
12
|
+
/** Document MIME types supported by AI chat */
|
|
13
|
+
declare const AI_CHAT_SUPPORTED_DOCUMENTS: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "text/plain", "text/markdown", "text/csv"];
|
|
14
|
+
/** All MIME types supported by AI chat */
|
|
15
|
+
declare const AI_CHAT_SUPPORTED_MIME_TYPES: readonly ["image/jpeg", "image/png", "image/webp", "image/gif", "application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "text/plain", "text/markdown", "text/csv"];
|
|
16
|
+
/** Comma-separated accept string for file inputs */
|
|
17
|
+
declare const AI_CHAT_ACCEPTED_TYPES: string;
|
|
18
|
+
/** Maximum file size for AI chat attachments (50 MB) */
|
|
19
|
+
declare const AI_CHAT_MAX_FILE_SIZE: number;
|
|
20
|
+
/** Maximum number of file attachments per message */
|
|
21
|
+
declare const AI_CHAT_MAX_FILES = 5;
|
|
22
|
+
/** Check if a MIME type is supported for AI chat */
|
|
23
|
+
declare function isAIChatSupportedMimeType(mimeType: string): boolean;
|
|
24
|
+
|
|
1
25
|
declare const ICONS: readonly ["a-arrow-down", "a-arrow-up", "academic-hat", "accessibility", "activity-square", "activity", "add-queue", "aeroplane", "air-conditioner", "airplay", "airpods", "alarm-check", "alarm-minus", "alarm-plus", "alarm-smoke", "alarm-snooze", "alarm-x", "alarm", "album", "align-bottom", "align-horizontal", "align-left", "align-right", "align-top", "align-vertical", "alt", "ambulance", "ampersand-square", "ampersand", "ampersands", "anchor", "angry-circle", "angry-ghost", "angry-square", "annoyed-circle", "annoyed-ghost", "annoyed-square", "aperture", "api", "ar", "archive", "arrow-diagonal-one", "arrow-diagonal-two", "arrow-down-circle", "arrow-down-left-circle", "arrow-down-left-square", "arrow-down-left-waves", "arrow-down-left", "arrow-down-right-circle", "arrow-down-right-square", "arrow-down-right-waves", "arrow-down-right", "arrow-down-square", "arrow-down-waves", "arrow-down", "arrow-left-circle", "arrow-left-right", "arrow-left-square", "arrow-left-waves", "arrow-left", "arrow-long-down-left", "arrow-long-down-right", "arrow-long-down", "arrow-long-left", "arrow-long-right", "arrow-long-up-left", "arrow-long-up-right", "arrow-long-up", "arrow-right-circle", "arrow-right-square", "arrow-right-waves", "arrow-right", "arrow-up-circle", "arrow-up-down", "arrow-up-left-circle", "arrow-up-left-square", "arrow-up-left-waves", "arrow-up-left", "arrow-up-right-circle", "arrow-up-right-square", "arrow-up-right-waves", "arrow-up-right", "arrow-up-square", "arrow-up-waves", "arrow-up", "asterisk-circle", "asterisk-diamond", "asterisk-hexagon", "asterisk-octagon", "asterisk-square", "asterisk-waves", "at", "atom", "baby", "backpack", "badge", "baggage-claim", "ban", "bank", "baseball", "bath", "battery-charging-four", "battery-charging-one", "battery-charging-three", "battery-charging-two", "battery-charging", "battery-check", "battery-empty", "battery-full", "battery-minus", "battery-plus", "battery-x", "bell-check", "bell-home", "bell-minus", "bell-on", "bell-plus", "bell-slash", "bell-snooze", "bell-user", "bell-x", "bell", "binoculars", "bitcoin-circle", "bitcoin-diamond", "bitcoin-hexagon", "bitcoin-octagon", "bitcoin-square", "bitcoin-waves", "bitcoin", "bluetooth", "boat", "book-check", "book-dot", "book-home", "book-image", "book-minus", "book-open", "book-plus", "book-slash", "book-snooze", "book-user", "book-x", "book", "bookmark-check", "bookmark-dot", "bookmark-home", "bookmark-minus", "bookmark-plus", "bookmark-slash", "bookmark-snooze", "bookmark-user", "bookmark-x", "bookmark", "bounding-box", "bowl", "box", "brand-chrome", "brand-codepen", "brand-codesandbox", "brand-dribbble", "brand-facebook", "brand-figma", "brand-framer", "brand-github", "brand-gitlab", "brand-google", "brand-instagram", "brand-linkedin", "brand-pinterest", "brand-pocket", "brand-slack", "brand-spotify", "brand-telegram", "brand-threads", "brand-trello", "brand-twitch", "brand-twitter", "brand-x", "brand-youtube", "briefcase-conveyor-belt", "briefcase", "brightness-high", "brightness-low", "bubbles", "building-one", "building", "cable-car", "cake", "calendar-check", "calendar-down", "calendar-minus", "calendar-plus", "calendar-slash", "calendar-up", "calendar-x", "calendar", "camera-slash", "camera", "campfire", "cannabis", "caravan", "cart-check", "cart-minus", "cart-plus", "cart-x", "cart", "cast-screen", "center-focus", "chart-area", "chart-bar-big", "chart-bar-decreasing", "chart-bar-increasing", "chart-bar-one", "chart-bar-stacked", "chart-bar", "chart-bubble", "chart-candlestick", "chart-column-big", "chart-column-decreasing", "chart-column-increasing", "chart-column-stacked", "chart-column", "chart-gantt", "chart-graph", "chart-line", "chart-network", "chart-no-axes-column-decreasing", "chart-no-axes-column-increasing", "chart-no-axes-column", "chart-no-axes-combined", "chart-no-axes-gantt", "chart-pie-one", "chart-pie-two", "chart-pie", "chart-scatter", "chart-spline", "chat-check", "chat-dots", "chat-messages", "chat-minus", "chat-plus", "chat-x", "chat", "check-circle-one", "check-circle", "check-diamond", "check-hexagon", "check-octagon", "check-square-one", "check-square", "check-waves", "check", "chevron-double-down-left", "chevron-double-down-right", "chevron-double-down", "chevron-double-left", "chevron-double-right", "chevron-double-up-left", "chevron-double-up-right", "chevron-double-up", "chevron-down-circle", "chevron-down-left-circle", "chevron-down-left-square", "chevron-down-left-waves", "chevron-down-left", "chevron-down-right-circle", "chevron-down-right-square", "chevron-down-right-waves", "chevron-down-right", "chevron-down-square", "chevron-down-waves", "chevron-down", "chevron-left-circle", "chevron-left-square", "chevron-left-waves", "chevron-left", "chevron-right-circle", "chevron-right-square", "chevron-right-waves", "chevron-right", "chevron-up-circle", "chevron-up-down", "chevron-up-left-circle", "chevron-up-left-square", "chevron-up-left-waves", "chevron-up-left", "chevron-up-right-circle", "chevron-up-right-square", "chevron-up-right-waves", "chevron-up-right", "chevron-up-square", "chevron-up-waves", "chevron-up", "chip", "cigarette-off", "cigarette", "circle-dashed", "circle-half-circle", "circle-half", "circle-notch", "circle", "click", "clipboard", "clock-circle", "clock-diamond", "clock-eight", "clock-eleven", "clock-five", "clock-four", "clock-hand", "clock-hexagon", "clock-nine", "clock-octagon", "clock-one", "clock-seven", "clock-six", "clock-square", "clock-ten", "clock-three", "clock-twelve", "clock-two", "clock-waves", "cloud-download", "cloud-drizzle", "cloud-fog", "cloud-hail", "cloud-lightning", "cloud-moon-rain", "cloud-moon", "cloud-off", "cloud-rain-wind", "cloud-rain", "cloud-snow", "cloud-sun-rain", "cloud-sun", "cloud-upload", "cloud", "cloudy", "cocktail", "code-circle", "code-diamond", "code-hexagon", "code-octagon", "code-square", "code-waves", "code", "coffee", "cog-four", "cog-one", "cog-three", "cog-two", "cog", "columns", "command", "compass", "components", "confetti", "config-vertical", "config", "contactless-circle", "contactless", "controller", "cookie", "copy", "copyleft", "copyright-slash", "copyright", "corner-down-left", "corner-down-right", "corner-left-down", "corner-left-up", "corner-right-down", "corner-right-up", "corner-up-left", "corner-up-right", "credit-card-check", "credit-card-minus", "credit-card-plus", "credit-card-x", "credit-card", "croissant", "crop", "crosshair", "cupcake", "danger-circle", "danger-diamond", "danger-hexagon", "danger-octagon", "danger-square", "danger-triangle", "danger-waves", "danger", "database", "daze-circle", "daze-ghost", "daze-square", "delete", "desktop", "diamond", "dice-five", "dice-four", "dice-one", "dice-six", "dice-three", "dice-two", "dislike", "divide", "dollar-circle", "dollar-diamond", "dollar-hexagon", "dollar-octagon", "dollar-square", "dollar-waves", "dollar", "door-closed-locked", "door-closed", "door-open", "dots-circle", "dots-diamond", "dots-hexagon", "dots-octagon", "dots-square", "dots-vertical-circle", "dots-vertical-diamond", "dots-vertical-hexagon", "dots-vertical-octagon", "dots-vertical-square", "dots-vertical-waves", "dots-vertical", "dots-waves", "dots", "download", "drop", "droplet-off", "droplet", "droplets", "ear-slash", "ear", "earth", "eclipse", "edit-one", "edit", "egg", "eight-circle", "eight-diamond", "eight-hexagon", "eight-octagon", "eight-square", "eight-waves", "eight", "elevator", "envelope-open", "envelope", "euro-circle", "euro-diamond", "euro-hexagon", "euro-octagon", "euro-square", "euro-waves", "euro", "exclude", "external-link", "eye-slash", "eye", "face-id", "fat-arrow-down-left", "fat-arrow-down-right", "fat-arrow-down", "fat-arrow-left", "fat-arrow-right", "fat-arrow-up-left", "fat-arrow-up-right", "fat-arrow-up", "fat-corner-down-left", "fat-corner-down-right", "fat-corner-left-down", "fat-corner-left-up", "fat-corner-right-down", "fat-corner-right-up", "fat-corner-up-left", "fat-corner-up-right", "female", "file-check", "file-minus", "file-plus", "file-text", "file-x", "file", "film", "filter-one", "filter", "fine-tune", "fire", "five-circle", "five-diamond", "five-hexagon", "five-octagon", "five-square", "five-waves", "five", "flag-one", "flag", "flame-kindling", "flame", "flask", "flower-2", "flower", "folder-check", "folder-heart", "folder-kanban", "folder-minus", "folder-one", "folder-plus", "folder-slash", "folder-two", "folder-x", "folder", "forward-circle", "forward-diamond", "forward-hexagon", "forward-octagon", "forward-square", "forward-waves", "forward", "four-circle", "four-diamond", "four-hexagon", "four-octagon", "four-square", "four-waves", "four", "frame", "funny-circle", "funny-ghost", "funny-square", "gift", "git-branch", "git-circle", "git-commit", "git-diamond", "git-diff", "git-hexagon", "git-merge", "git-octagon", "git-pull-request", "git-square", "git-waves", "glasses", "globe", "grid-one", "grid", "hand", "hard-drive", "hash-circle", "hash-diamond", "hash-hexagon", "hash-octagon", "hash-square", "hash-waves", "hash", "haze", "heading-five", "heading-four", "heading-one", "heading-six", "heading-three", "heading-two", "heading", "headphones", "heart-broken", "heart-check", "heart-circle", "heart-diamond", "heart-dot", "heart-hexagon", "heart-home", "heart-minus", "heart-octagon", "heart-plus", "heart-slash", "heart-snooze", "heart-square", "heart-user", "heart-waves", "heart-x", "heart", "hexagon", "home-check", "home-minus", "home-plus", "home-smile", "home-x", "home", "image-circle", "image-rectangle", "image", "inbox-archive", "inbox-check", "inbox-down", "inbox-minus", "inbox-plus", "inbox-up", "inbox-x", "inbox", "incognito", "indifferent-circle", "indifferent-ghost", "indifferent-square", "infinity", "info-circle", "info-diamond", "info-hexagon", "info-octagon", "info-square", "info-triangle", "info-waves", "info", "intersect", "kanban", "key", "keyboard-brightness-high", "keyboard-brightness-low", "keyboard", "label", "lamp", "layers-one", "layers-three", "layers-two", "layout", "leaf", "leaves", "letter-a-circle", "letter-a-diamond", "letter-a-hexagon", "letter-a-octagon", "letter-a-square", "letter-a-waves", "letter-a", "letter-b-circle", "letter-b-diamond", "letter-b-hexagon", "letter-b-octagon", "letter-b-square", "letter-b-waves", "letter-b", "letter-c-circle", "letter-c-diamond", "letter-c-hexagon", "letter-c-octagon", "letter-c-square", "letter-c-waves", "letter-c", "letter-d-circle", "letter-d-diamond", "letter-d-hexagon", "letter-d-octagon", "letter-d-square", "letter-d-waves", "letter-d", "letter-e-circle", "letter-e-diamond", "letter-e-hexagon", "letter-e-octagon", "letter-e-square", "letter-e-waves", "letter-e", "letter-f-circle", "letter-f-diamond", "letter-f-hexagon", "letter-f-octagon", "letter-f-square", "letter-f-waves", "letter-f", "letter-g-circle", "letter-g-diamond", "letter-g-hexagon", "letter-g-octagon", "letter-g-square", "letter-g-waves", "letter-g", "letter-h-circle", "letter-h-diamond", "letter-h-hexagon", "letter-h-octagon", "letter-h-square", "letter-h-waves", "letter-h", "letter-i-circle", "letter-i-diamond", "letter-i-hexagon", "letter-i-octagon", "letter-i-square", "letter-i-waves", "letter-i", "letter-j-circle", "letter-j-diamond", "letter-j-hexagon", "letter-j-octagon", "letter-j-square", "letter-j-waves", "letter-j", "letter-k-circle", "letter-k-diamond", "letter-k-hexagon", "letter-k-octagon", "letter-k-square", "letter-k-waves", "letter-k", "letter-l-circle", "letter-l-diamond", "letter-l-hexagon", "letter-l-octagon", "letter-l-square", "letter-l-waves", "letter-l", "letter-m-circle", "letter-m-diamond", "letter-m-hexagon", "letter-m-octagon", "letter-m-square", "letter-m-waves", "letter-m", "letter-n-circle", "letter-n-diamond", "letter-n-hexagon", "letter-n-octagon", "letter-n-square", "letter-n-waves", "letter-n", "letter-o-circle", "letter-o-diamond", "letter-o-hexagon", "letter-o-octagon", "letter-o-square", "letter-o-waves", "letter-o", "letter-p-circle", "letter-p-diamond", "letter-p-hexagon", "letter-p-octagon", "letter-p-square", "letter-p-waves", "letter-p", "letter-q-circle", "letter-q-diamond", "letter-q-hexagon", "letter-q-octagon", "letter-q-square", "letter-q-waves", "letter-q", "letter-r-circle", "letter-r-diamond", "letter-r-hexagon", "letter-r-octagon", "letter-r-square", "letter-r-waves", "letter-r", "letter-s-circle", "letter-s-diamond", "letter-s-hexagon", "letter-s-octagon", "letter-s-square", "letter-s-waves", "letter-s", "letter-t-circle", "letter-t-diamond", "letter-t-hexagon", "letter-t-octagon", "letter-t-square", "letter-t-waves", "letter-t", "letter-u-circle", "letter-u-diamond", "letter-u-hexagon", "letter-u-octagon", "letter-u-square", "letter-u-waves", "letter-u", "letter-v-circle", "letter-v-diamond", "letter-v-hexagon", "letter-v-octagon", "letter-v-square", "letter-v-waves", "letter-v", "letter-w-circle", "letter-w-diamond", "letter-w-hexagon", "letter-w-octagon", "letter-w-square", "letter-w-waves", "letter-w", "letter-x-circle", "letter-x-diamond", "letter-x-hexagon", "letter-x-octagon", "letter-x-square", "letter-x-waves", "letter-x", "letter-y-circle", "letter-y-diamond", "letter-y-hexagon", "letter-y-octagon", "letter-y-square", "letter-y-waves", "letter-y", "letter-z-circle", "letter-z-diamond", "letter-z-hexagon", "letter-z-octagon", "letter-z-square", "letter-z-waves", "letter-z", "lightning-off", "lightning", "like", "line-chart-circle", "line-chart-diamond", "line-chart-hexagon", "line-chart-octagon", "line-chart-square", "line-chart-waves", "link-one", "link-two", "link", "list-check", "list-number", "list", "location-check", "location-home", "location-minus", "location-plus", "location-selected", "location-slash", "location-snooze", "location-user", "location-x", "location", "lock-circle", "lock-diamond", "lock-hexagon", "lock-keyhole", "lock-octagon", "lock-open-keyhole", "lock-open-password", "lock-open", "lock-password", "lock-square", "lock-waves", "lock", "login", "logout", "magnet", "male", "map", "mask", "math-square", "math", "maximize-one", "maximize", "menu", "message-check", "message-dots", "message-minus", "message-plus", "message-reply", "message-x", "message", "microphone-slash", "microphone", "minimize-one", "minimize", "minus-circle", "minus-diamond", "minus-hexagon", "minus-octagon", "minus-square", "minus-waves", "minus", "mobile-signal-five", "mobile-signal-four", "mobile-signal-one", "mobile-signal-three", "mobile-signal-two", "mobile", "moon-star", "moon", "mountain-snow", "mountain", "mouse-pointer", "move-diagonal-one", "move-diagonal", "move-horizontal", "move-vertical", "move", "music-circle", "music-diamond", "music-hexagon", "music-octagon", "music-square", "music-waves", "music", "myna", "navigation-one", "navigation", "nine-circle", "nine-diamond", "nine-hexagon", "nine-octagon", "nine-square", "nine-waves", "nine", "notification", "octagon", "one-circle", "one-diamond", "one-hexagon", "one-octagon", "one-square", "one-waves", "one", "option", "package", "paint", "panel-bottom-close", "panel-bottom-inactive", "panel-bottom-open", "panel-bottom", "panel-left-close", "panel-left-inactive", "panel-left-open", "panel-left", "panel-right-close", "panel-right-inactive", "panel-right-open", "panel-right", "panel-top-close", "panel-top-inactive", "panel-top-open", "panel-top", "paperclip", "parking", "password", "path", "pause-circle", "pause-diamond", "pause-hexagon", "pause-octagon", "pause-square", "pause-waves", "pause", "pen", "pencil", "percentage-circle", "percentage-diamond", "percentage-hexagon", "percentage-octagon", "percentage-square", "percentage-waves", "percentage", "pin", "pizza", "planet", "play-circle", "play-diamond", "play-hexagon", "play-octagon", "play-square", "play-waves", "play", "plus-circle", "plus-diamond", "plus-hexagon", "plus-octagon", "plus-square", "plus-waves", "plus", "pokeball", "power", "presentation", "printer", "puzzle", "question-circle", "question-diamond", "question-hexagon", "question-octagon", "question-square", "question-waves", "question", "radio", "rainbow", "reception-bell", "record", "rectangle-vertical", "rectangle", "redo", "refresh-alt", "refresh", "repeat", "rewind-circle", "rewind-diamond", "rewind-hexagon", "rewind-octagon", "rewind-square", "rewind-waves", "rewind", "rhombus", "ribbon", "rocket", "room-service", "rows", "rss", "ruler", "rupee-circle", "rupee-diamond", "rupee-hexagon", "rupee-octagon", "rupee-square", "rupee-waves", "rupee", "sad-circle", "sad-ghost", "sad-square", "save", "scan", "scissors", "sea-waves", "search-check", "search-circle", "search-diamond", "search-dot", "search-hexagon", "search-home", "search-minus", "search-octagon", "search-plus", "search-slash", "search-snooze", "search-square", "search-user", "search-waves", "search-x", "search", "select-multiple", "send", "servers", "seven-circle", "seven-diamond", "seven-hexagon", "seven-octagon", "seven-square", "seven-waves", "seven", "share", "shell", "shield-check", "shield-crossed", "shield-minus", "shield-one", "shield-plus", "shield-slash", "shield-two", "shield-x", "shield", "shooting-star", "shopping-bag", "shovel", "shrub", "shuffle-alt", "shuffle", "sidebar-alt", "sidebar", "signal-circle", "signal-diamond", "signal-hexagon", "signal-octagon", "signal-square", "signal-waves", "signal", "six-circle", "six-diamond", "six-hexagon", "six-octagon", "six-square", "six-waves", "six", "skip-back", "skip-forward", "slash-circle", "slash-diamond", "slash-hexagon", "slash-octagon", "slash-square", "slash-waves", "smile-circle", "smile-ghost", "smile-square", "snow", "snowflake", "sofa", "sort", "sparkles", "speaker", "spinner-one", "spinner", "sprout", "square-chart-gantt", "square-dashed-kanban", "square-dashed", "square-half", "square-kanban", "square", "star", "stop-circle", "stop-diamond", "stop-hexagon", "stop-octagon", "stop-square", "stop-waves", "stop", "store", "subtract", "sun-dim", "sun-medium", "sun-snow", "sun", "sunrise", "sunset", "support", "swatches", "table", "tablet", "tag-plus", "tag", "tally-five", "tally-four", "tally-one", "tally-three", "tally-two", "target", "telephone-call", "telephone-forward", "telephone-in", "telephone-missed", "telephone-out", "telephone-slash", "telephone", "tent-tree", "tent", "terminal", "text-align-center", "text-align-left", "text-align-right", "text-justify", "thermometer-snowflake", "thermometer-sun", "thermometer", "three-circle", "three-diamond", "three-hexagon", "three-octagon", "three-square", "three-waves", "three", "ticket-slash", "ticket", "toggle-left", "toggle-right", "tool", "tornado", "train", "trash-one", "trash-two", "trash", "tree-deciduous", "tree-palm", "tree-pine", "tree", "trees", "trending-down", "trending-up-down", "trending-up", "triangle", "truck", "tv", "two-circle", "two-diamond", "two-hexagon", "two-octagon", "two-square", "two-waves", "two", "type-bold", "type-italic", "type-text", "type-underline", "umbrella-off", "umbrella", "undo", "union", "unlink", "upload", "user-check", "user-circle", "user-diamond", "user-hexagon", "user-minus", "user-octagon", "user-plus", "user-settings", "user-square", "user-waves", "user-x", "user", "users-group", "users", "video-slash", "video", "volume-check", "volume-high", "volume-low", "volume-minus", "volume-none", "volume-plus", "volume-slash", "volume-x", "watch", "waves", "webcam", "wheel", "wheelchair", "wifi-check", "wifi-low", "wifi-medium", "wifi-minus", "wifi-plus", "wifi-slash", "wifi-x", "wifi", "wind-arrow-down", "wind", "winds", "wine", "wink-circle", "wink-ghost", "wink-square", "wrench", "x-circle", "x-diamond", "x-hexagon", "x-octagon", "x-square", "x-triangle", "x-waves", "x", "yen-circle", "yen-diamond", "yen-hexagon", "yen-octagon", "yen-square", "yen-waves", "yen", "zap-off", "zap", "zero-circle", "zero-diamond", "zero-hexagon", "zero-octagon", "zero-square", "zero-waves", "zero"];
|
|
2
26
|
type IconName = (typeof ICONS)[number];
|
|
3
27
|
|
|
@@ -12,6 +36,12 @@ declare const DEFAULT_ATTRIBUTE_ICONS: Record<string, IconName>;
|
|
|
12
36
|
*/
|
|
13
37
|
declare function getDefaultAttributeIcon(type: string): IconName;
|
|
14
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Merge class names with Tailwind CSS classes.
|
|
41
|
+
* Uses clsx for conditional classes and tailwind-merge to handle conflicts.
|
|
42
|
+
*/
|
|
43
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
44
|
+
|
|
15
45
|
interface Color {
|
|
16
46
|
/** Background color - works on both light and dark mode */
|
|
17
47
|
background: string;
|
|
@@ -987,6 +1017,41 @@ declare const isValidIso2: (code: string) => code is CountryIso2;
|
|
|
987
1017
|
* Type guard to check if a string is a valid ISO3 country code
|
|
988
1018
|
*/
|
|
989
1019
|
declare const isValidIso3: (code: string) => code is CountryIso3;
|
|
1020
|
+
/**
|
|
1021
|
+
* Get the display name of a country in the specified locale.
|
|
1022
|
+
* Defaults to French with English as fallback.
|
|
1023
|
+
* Uses Intl.DisplayNames for locale-aware names (e.g., "Italie" for "IT" in French).
|
|
1024
|
+
* The Intl.DisplayNames instance is cached at module level to avoid repeated allocations.
|
|
1025
|
+
*
|
|
1026
|
+
* @param iso2 - ISO 3166-1 alpha-2 country code (e.g., "FR", "IT")
|
|
1027
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1028
|
+
*/
|
|
1029
|
+
declare function getCountryDisplayName(iso2: string, locales?: string | string[]): string;
|
|
1030
|
+
/**
|
|
1031
|
+
* Get the display name of a country by its ISO 3166-1 alpha-3 code.
|
|
1032
|
+
* Defaults to French with English as fallback.
|
|
1033
|
+
*
|
|
1034
|
+
* @param iso3 - ISO 3166-1 alpha-3 country code (e.g., "FRA", "ITA")
|
|
1035
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1036
|
+
*/
|
|
1037
|
+
declare function getCountryDisplayNameByIso3(iso3: string, locales?: string | string[]): string;
|
|
1038
|
+
/**
|
|
1039
|
+
* Get all countries sorted alphabetically by their display name in the given locale.
|
|
1040
|
+
* Sorted once — callers should store the result in a module-level constant.
|
|
1041
|
+
*
|
|
1042
|
+
* @param locale - BCP 47 language tag for sorting (default: 'fr')
|
|
1043
|
+
*/
|
|
1044
|
+
declare function getSortedCountries(locale?: string): Country[];
|
|
1045
|
+
/**
|
|
1046
|
+
* Strip the national trunk prefix from a phone number.
|
|
1047
|
+
* Pure string operation, no external dependencies.
|
|
1048
|
+
*
|
|
1049
|
+
* @example
|
|
1050
|
+
* stripTrunkPrefix("0612345678", "0") // "612345678"
|
|
1051
|
+
* stripTrunkPrefix("612345678", "0") // "612345678" (no prefix to strip)
|
|
1052
|
+
* stripTrunkPrefix("06301234567", "06") // "301234567" (Hungary)
|
|
1053
|
+
*/
|
|
1054
|
+
declare function stripTrunkPrefix(phoneNumber: string, trunkPrefix: string): string;
|
|
990
1055
|
|
|
991
1056
|
interface Currency {
|
|
992
1057
|
code: string;
|
|
@@ -1770,4 +1835,4 @@ declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
|
1770
1835
|
*/
|
|
1771
1836
|
declare const getExtensionFromMimeType: (mimeType: string) => string | null;
|
|
1772
1837
|
|
|
1773
|
-
export { ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes };
|
|
1838
|
+
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, cn, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryDisplayName, getCountryDisplayNameByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isAIChatSupportedMimeType, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI Chat constants shared between frontend and backend.
|
|
5
|
+
*
|
|
6
|
+
* These define the allowed file types, size limits, and count limits
|
|
7
|
+
* for AI chat attachments. Both the UI and the backend validate against
|
|
8
|
+
* these values to ensure consistency.
|
|
9
|
+
*/
|
|
10
|
+
/** Image MIME types supported by AI chat (subset of all image types) */
|
|
11
|
+
declare const AI_CHAT_SUPPORTED_IMAGES: readonly ["image/jpeg", "image/png", "image/webp", "image/gif"];
|
|
12
|
+
/** Document MIME types supported by AI chat */
|
|
13
|
+
declare const AI_CHAT_SUPPORTED_DOCUMENTS: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "text/plain", "text/markdown", "text/csv"];
|
|
14
|
+
/** All MIME types supported by AI chat */
|
|
15
|
+
declare const AI_CHAT_SUPPORTED_MIME_TYPES: readonly ["image/jpeg", "image/png", "image/webp", "image/gif", "application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "text/plain", "text/markdown", "text/csv"];
|
|
16
|
+
/** Comma-separated accept string for file inputs */
|
|
17
|
+
declare const AI_CHAT_ACCEPTED_TYPES: string;
|
|
18
|
+
/** Maximum file size for AI chat attachments (50 MB) */
|
|
19
|
+
declare const AI_CHAT_MAX_FILE_SIZE: number;
|
|
20
|
+
/** Maximum number of file attachments per message */
|
|
21
|
+
declare const AI_CHAT_MAX_FILES = 5;
|
|
22
|
+
/** Check if a MIME type is supported for AI chat */
|
|
23
|
+
declare function isAIChatSupportedMimeType(mimeType: string): boolean;
|
|
24
|
+
|
|
1
25
|
declare const ICONS: readonly ["a-arrow-down", "a-arrow-up", "academic-hat", "accessibility", "activity-square", "activity", "add-queue", "aeroplane", "air-conditioner", "airplay", "airpods", "alarm-check", "alarm-minus", "alarm-plus", "alarm-smoke", "alarm-snooze", "alarm-x", "alarm", "album", "align-bottom", "align-horizontal", "align-left", "align-right", "align-top", "align-vertical", "alt", "ambulance", "ampersand-square", "ampersand", "ampersands", "anchor", "angry-circle", "angry-ghost", "angry-square", "annoyed-circle", "annoyed-ghost", "annoyed-square", "aperture", "api", "ar", "archive", "arrow-diagonal-one", "arrow-diagonal-two", "arrow-down-circle", "arrow-down-left-circle", "arrow-down-left-square", "arrow-down-left-waves", "arrow-down-left", "arrow-down-right-circle", "arrow-down-right-square", "arrow-down-right-waves", "arrow-down-right", "arrow-down-square", "arrow-down-waves", "arrow-down", "arrow-left-circle", "arrow-left-right", "arrow-left-square", "arrow-left-waves", "arrow-left", "arrow-long-down-left", "arrow-long-down-right", "arrow-long-down", "arrow-long-left", "arrow-long-right", "arrow-long-up-left", "arrow-long-up-right", "arrow-long-up", "arrow-right-circle", "arrow-right-square", "arrow-right-waves", "arrow-right", "arrow-up-circle", "arrow-up-down", "arrow-up-left-circle", "arrow-up-left-square", "arrow-up-left-waves", "arrow-up-left", "arrow-up-right-circle", "arrow-up-right-square", "arrow-up-right-waves", "arrow-up-right", "arrow-up-square", "arrow-up-waves", "arrow-up", "asterisk-circle", "asterisk-diamond", "asterisk-hexagon", "asterisk-octagon", "asterisk-square", "asterisk-waves", "at", "atom", "baby", "backpack", "badge", "baggage-claim", "ban", "bank", "baseball", "bath", "battery-charging-four", "battery-charging-one", "battery-charging-three", "battery-charging-two", "battery-charging", "battery-check", "battery-empty", "battery-full", "battery-minus", "battery-plus", "battery-x", "bell-check", "bell-home", "bell-minus", "bell-on", "bell-plus", "bell-slash", "bell-snooze", "bell-user", "bell-x", "bell", "binoculars", "bitcoin-circle", "bitcoin-diamond", "bitcoin-hexagon", "bitcoin-octagon", "bitcoin-square", "bitcoin-waves", "bitcoin", "bluetooth", "boat", "book-check", "book-dot", "book-home", "book-image", "book-minus", "book-open", "book-plus", "book-slash", "book-snooze", "book-user", "book-x", "book", "bookmark-check", "bookmark-dot", "bookmark-home", "bookmark-minus", "bookmark-plus", "bookmark-slash", "bookmark-snooze", "bookmark-user", "bookmark-x", "bookmark", "bounding-box", "bowl", "box", "brand-chrome", "brand-codepen", "brand-codesandbox", "brand-dribbble", "brand-facebook", "brand-figma", "brand-framer", "brand-github", "brand-gitlab", "brand-google", "brand-instagram", "brand-linkedin", "brand-pinterest", "brand-pocket", "brand-slack", "brand-spotify", "brand-telegram", "brand-threads", "brand-trello", "brand-twitch", "brand-twitter", "brand-x", "brand-youtube", "briefcase-conveyor-belt", "briefcase", "brightness-high", "brightness-low", "bubbles", "building-one", "building", "cable-car", "cake", "calendar-check", "calendar-down", "calendar-minus", "calendar-plus", "calendar-slash", "calendar-up", "calendar-x", "calendar", "camera-slash", "camera", "campfire", "cannabis", "caravan", "cart-check", "cart-minus", "cart-plus", "cart-x", "cart", "cast-screen", "center-focus", "chart-area", "chart-bar-big", "chart-bar-decreasing", "chart-bar-increasing", "chart-bar-one", "chart-bar-stacked", "chart-bar", "chart-bubble", "chart-candlestick", "chart-column-big", "chart-column-decreasing", "chart-column-increasing", "chart-column-stacked", "chart-column", "chart-gantt", "chart-graph", "chart-line", "chart-network", "chart-no-axes-column-decreasing", "chart-no-axes-column-increasing", "chart-no-axes-column", "chart-no-axes-combined", "chart-no-axes-gantt", "chart-pie-one", "chart-pie-two", "chart-pie", "chart-scatter", "chart-spline", "chat-check", "chat-dots", "chat-messages", "chat-minus", "chat-plus", "chat-x", "chat", "check-circle-one", "check-circle", "check-diamond", "check-hexagon", "check-octagon", "check-square-one", "check-square", "check-waves", "check", "chevron-double-down-left", "chevron-double-down-right", "chevron-double-down", "chevron-double-left", "chevron-double-right", "chevron-double-up-left", "chevron-double-up-right", "chevron-double-up", "chevron-down-circle", "chevron-down-left-circle", "chevron-down-left-square", "chevron-down-left-waves", "chevron-down-left", "chevron-down-right-circle", "chevron-down-right-square", "chevron-down-right-waves", "chevron-down-right", "chevron-down-square", "chevron-down-waves", "chevron-down", "chevron-left-circle", "chevron-left-square", "chevron-left-waves", "chevron-left", "chevron-right-circle", "chevron-right-square", "chevron-right-waves", "chevron-right", "chevron-up-circle", "chevron-up-down", "chevron-up-left-circle", "chevron-up-left-square", "chevron-up-left-waves", "chevron-up-left", "chevron-up-right-circle", "chevron-up-right-square", "chevron-up-right-waves", "chevron-up-right", "chevron-up-square", "chevron-up-waves", "chevron-up", "chip", "cigarette-off", "cigarette", "circle-dashed", "circle-half-circle", "circle-half", "circle-notch", "circle", "click", "clipboard", "clock-circle", "clock-diamond", "clock-eight", "clock-eleven", "clock-five", "clock-four", "clock-hand", "clock-hexagon", "clock-nine", "clock-octagon", "clock-one", "clock-seven", "clock-six", "clock-square", "clock-ten", "clock-three", "clock-twelve", "clock-two", "clock-waves", "cloud-download", "cloud-drizzle", "cloud-fog", "cloud-hail", "cloud-lightning", "cloud-moon-rain", "cloud-moon", "cloud-off", "cloud-rain-wind", "cloud-rain", "cloud-snow", "cloud-sun-rain", "cloud-sun", "cloud-upload", "cloud", "cloudy", "cocktail", "code-circle", "code-diamond", "code-hexagon", "code-octagon", "code-square", "code-waves", "code", "coffee", "cog-four", "cog-one", "cog-three", "cog-two", "cog", "columns", "command", "compass", "components", "confetti", "config-vertical", "config", "contactless-circle", "contactless", "controller", "cookie", "copy", "copyleft", "copyright-slash", "copyright", "corner-down-left", "corner-down-right", "corner-left-down", "corner-left-up", "corner-right-down", "corner-right-up", "corner-up-left", "corner-up-right", "credit-card-check", "credit-card-minus", "credit-card-plus", "credit-card-x", "credit-card", "croissant", "crop", "crosshair", "cupcake", "danger-circle", "danger-diamond", "danger-hexagon", "danger-octagon", "danger-square", "danger-triangle", "danger-waves", "danger", "database", "daze-circle", "daze-ghost", "daze-square", "delete", "desktop", "diamond", "dice-five", "dice-four", "dice-one", "dice-six", "dice-three", "dice-two", "dislike", "divide", "dollar-circle", "dollar-diamond", "dollar-hexagon", "dollar-octagon", "dollar-square", "dollar-waves", "dollar", "door-closed-locked", "door-closed", "door-open", "dots-circle", "dots-diamond", "dots-hexagon", "dots-octagon", "dots-square", "dots-vertical-circle", "dots-vertical-diamond", "dots-vertical-hexagon", "dots-vertical-octagon", "dots-vertical-square", "dots-vertical-waves", "dots-vertical", "dots-waves", "dots", "download", "drop", "droplet-off", "droplet", "droplets", "ear-slash", "ear", "earth", "eclipse", "edit-one", "edit", "egg", "eight-circle", "eight-diamond", "eight-hexagon", "eight-octagon", "eight-square", "eight-waves", "eight", "elevator", "envelope-open", "envelope", "euro-circle", "euro-diamond", "euro-hexagon", "euro-octagon", "euro-square", "euro-waves", "euro", "exclude", "external-link", "eye-slash", "eye", "face-id", "fat-arrow-down-left", "fat-arrow-down-right", "fat-arrow-down", "fat-arrow-left", "fat-arrow-right", "fat-arrow-up-left", "fat-arrow-up-right", "fat-arrow-up", "fat-corner-down-left", "fat-corner-down-right", "fat-corner-left-down", "fat-corner-left-up", "fat-corner-right-down", "fat-corner-right-up", "fat-corner-up-left", "fat-corner-up-right", "female", "file-check", "file-minus", "file-plus", "file-text", "file-x", "file", "film", "filter-one", "filter", "fine-tune", "fire", "five-circle", "five-diamond", "five-hexagon", "five-octagon", "five-square", "five-waves", "five", "flag-one", "flag", "flame-kindling", "flame", "flask", "flower-2", "flower", "folder-check", "folder-heart", "folder-kanban", "folder-minus", "folder-one", "folder-plus", "folder-slash", "folder-two", "folder-x", "folder", "forward-circle", "forward-diamond", "forward-hexagon", "forward-octagon", "forward-square", "forward-waves", "forward", "four-circle", "four-diamond", "four-hexagon", "four-octagon", "four-square", "four-waves", "four", "frame", "funny-circle", "funny-ghost", "funny-square", "gift", "git-branch", "git-circle", "git-commit", "git-diamond", "git-diff", "git-hexagon", "git-merge", "git-octagon", "git-pull-request", "git-square", "git-waves", "glasses", "globe", "grid-one", "grid", "hand", "hard-drive", "hash-circle", "hash-diamond", "hash-hexagon", "hash-octagon", "hash-square", "hash-waves", "hash", "haze", "heading-five", "heading-four", "heading-one", "heading-six", "heading-three", "heading-two", "heading", "headphones", "heart-broken", "heart-check", "heart-circle", "heart-diamond", "heart-dot", "heart-hexagon", "heart-home", "heart-minus", "heart-octagon", "heart-plus", "heart-slash", "heart-snooze", "heart-square", "heart-user", "heart-waves", "heart-x", "heart", "hexagon", "home-check", "home-minus", "home-plus", "home-smile", "home-x", "home", "image-circle", "image-rectangle", "image", "inbox-archive", "inbox-check", "inbox-down", "inbox-minus", "inbox-plus", "inbox-up", "inbox-x", "inbox", "incognito", "indifferent-circle", "indifferent-ghost", "indifferent-square", "infinity", "info-circle", "info-diamond", "info-hexagon", "info-octagon", "info-square", "info-triangle", "info-waves", "info", "intersect", "kanban", "key", "keyboard-brightness-high", "keyboard-brightness-low", "keyboard", "label", "lamp", "layers-one", "layers-three", "layers-two", "layout", "leaf", "leaves", "letter-a-circle", "letter-a-diamond", "letter-a-hexagon", "letter-a-octagon", "letter-a-square", "letter-a-waves", "letter-a", "letter-b-circle", "letter-b-diamond", "letter-b-hexagon", "letter-b-octagon", "letter-b-square", "letter-b-waves", "letter-b", "letter-c-circle", "letter-c-diamond", "letter-c-hexagon", "letter-c-octagon", "letter-c-square", "letter-c-waves", "letter-c", "letter-d-circle", "letter-d-diamond", "letter-d-hexagon", "letter-d-octagon", "letter-d-square", "letter-d-waves", "letter-d", "letter-e-circle", "letter-e-diamond", "letter-e-hexagon", "letter-e-octagon", "letter-e-square", "letter-e-waves", "letter-e", "letter-f-circle", "letter-f-diamond", "letter-f-hexagon", "letter-f-octagon", "letter-f-square", "letter-f-waves", "letter-f", "letter-g-circle", "letter-g-diamond", "letter-g-hexagon", "letter-g-octagon", "letter-g-square", "letter-g-waves", "letter-g", "letter-h-circle", "letter-h-diamond", "letter-h-hexagon", "letter-h-octagon", "letter-h-square", "letter-h-waves", "letter-h", "letter-i-circle", "letter-i-diamond", "letter-i-hexagon", "letter-i-octagon", "letter-i-square", "letter-i-waves", "letter-i", "letter-j-circle", "letter-j-diamond", "letter-j-hexagon", "letter-j-octagon", "letter-j-square", "letter-j-waves", "letter-j", "letter-k-circle", "letter-k-diamond", "letter-k-hexagon", "letter-k-octagon", "letter-k-square", "letter-k-waves", "letter-k", "letter-l-circle", "letter-l-diamond", "letter-l-hexagon", "letter-l-octagon", "letter-l-square", "letter-l-waves", "letter-l", "letter-m-circle", "letter-m-diamond", "letter-m-hexagon", "letter-m-octagon", "letter-m-square", "letter-m-waves", "letter-m", "letter-n-circle", "letter-n-diamond", "letter-n-hexagon", "letter-n-octagon", "letter-n-square", "letter-n-waves", "letter-n", "letter-o-circle", "letter-o-diamond", "letter-o-hexagon", "letter-o-octagon", "letter-o-square", "letter-o-waves", "letter-o", "letter-p-circle", "letter-p-diamond", "letter-p-hexagon", "letter-p-octagon", "letter-p-square", "letter-p-waves", "letter-p", "letter-q-circle", "letter-q-diamond", "letter-q-hexagon", "letter-q-octagon", "letter-q-square", "letter-q-waves", "letter-q", "letter-r-circle", "letter-r-diamond", "letter-r-hexagon", "letter-r-octagon", "letter-r-square", "letter-r-waves", "letter-r", "letter-s-circle", "letter-s-diamond", "letter-s-hexagon", "letter-s-octagon", "letter-s-square", "letter-s-waves", "letter-s", "letter-t-circle", "letter-t-diamond", "letter-t-hexagon", "letter-t-octagon", "letter-t-square", "letter-t-waves", "letter-t", "letter-u-circle", "letter-u-diamond", "letter-u-hexagon", "letter-u-octagon", "letter-u-square", "letter-u-waves", "letter-u", "letter-v-circle", "letter-v-diamond", "letter-v-hexagon", "letter-v-octagon", "letter-v-square", "letter-v-waves", "letter-v", "letter-w-circle", "letter-w-diamond", "letter-w-hexagon", "letter-w-octagon", "letter-w-square", "letter-w-waves", "letter-w", "letter-x-circle", "letter-x-diamond", "letter-x-hexagon", "letter-x-octagon", "letter-x-square", "letter-x-waves", "letter-x", "letter-y-circle", "letter-y-diamond", "letter-y-hexagon", "letter-y-octagon", "letter-y-square", "letter-y-waves", "letter-y", "letter-z-circle", "letter-z-diamond", "letter-z-hexagon", "letter-z-octagon", "letter-z-square", "letter-z-waves", "letter-z", "lightning-off", "lightning", "like", "line-chart-circle", "line-chart-diamond", "line-chart-hexagon", "line-chart-octagon", "line-chart-square", "line-chart-waves", "link-one", "link-two", "link", "list-check", "list-number", "list", "location-check", "location-home", "location-minus", "location-plus", "location-selected", "location-slash", "location-snooze", "location-user", "location-x", "location", "lock-circle", "lock-diamond", "lock-hexagon", "lock-keyhole", "lock-octagon", "lock-open-keyhole", "lock-open-password", "lock-open", "lock-password", "lock-square", "lock-waves", "lock", "login", "logout", "magnet", "male", "map", "mask", "math-square", "math", "maximize-one", "maximize", "menu", "message-check", "message-dots", "message-minus", "message-plus", "message-reply", "message-x", "message", "microphone-slash", "microphone", "minimize-one", "minimize", "minus-circle", "minus-diamond", "minus-hexagon", "minus-octagon", "minus-square", "minus-waves", "minus", "mobile-signal-five", "mobile-signal-four", "mobile-signal-one", "mobile-signal-three", "mobile-signal-two", "mobile", "moon-star", "moon", "mountain-snow", "mountain", "mouse-pointer", "move-diagonal-one", "move-diagonal", "move-horizontal", "move-vertical", "move", "music-circle", "music-diamond", "music-hexagon", "music-octagon", "music-square", "music-waves", "music", "myna", "navigation-one", "navigation", "nine-circle", "nine-diamond", "nine-hexagon", "nine-octagon", "nine-square", "nine-waves", "nine", "notification", "octagon", "one-circle", "one-diamond", "one-hexagon", "one-octagon", "one-square", "one-waves", "one", "option", "package", "paint", "panel-bottom-close", "panel-bottom-inactive", "panel-bottom-open", "panel-bottom", "panel-left-close", "panel-left-inactive", "panel-left-open", "panel-left", "panel-right-close", "panel-right-inactive", "panel-right-open", "panel-right", "panel-top-close", "panel-top-inactive", "panel-top-open", "panel-top", "paperclip", "parking", "password", "path", "pause-circle", "pause-diamond", "pause-hexagon", "pause-octagon", "pause-square", "pause-waves", "pause", "pen", "pencil", "percentage-circle", "percentage-diamond", "percentage-hexagon", "percentage-octagon", "percentage-square", "percentage-waves", "percentage", "pin", "pizza", "planet", "play-circle", "play-diamond", "play-hexagon", "play-octagon", "play-square", "play-waves", "play", "plus-circle", "plus-diamond", "plus-hexagon", "plus-octagon", "plus-square", "plus-waves", "plus", "pokeball", "power", "presentation", "printer", "puzzle", "question-circle", "question-diamond", "question-hexagon", "question-octagon", "question-square", "question-waves", "question", "radio", "rainbow", "reception-bell", "record", "rectangle-vertical", "rectangle", "redo", "refresh-alt", "refresh", "repeat", "rewind-circle", "rewind-diamond", "rewind-hexagon", "rewind-octagon", "rewind-square", "rewind-waves", "rewind", "rhombus", "ribbon", "rocket", "room-service", "rows", "rss", "ruler", "rupee-circle", "rupee-diamond", "rupee-hexagon", "rupee-octagon", "rupee-square", "rupee-waves", "rupee", "sad-circle", "sad-ghost", "sad-square", "save", "scan", "scissors", "sea-waves", "search-check", "search-circle", "search-diamond", "search-dot", "search-hexagon", "search-home", "search-minus", "search-octagon", "search-plus", "search-slash", "search-snooze", "search-square", "search-user", "search-waves", "search-x", "search", "select-multiple", "send", "servers", "seven-circle", "seven-diamond", "seven-hexagon", "seven-octagon", "seven-square", "seven-waves", "seven", "share", "shell", "shield-check", "shield-crossed", "shield-minus", "shield-one", "shield-plus", "shield-slash", "shield-two", "shield-x", "shield", "shooting-star", "shopping-bag", "shovel", "shrub", "shuffle-alt", "shuffle", "sidebar-alt", "sidebar", "signal-circle", "signal-diamond", "signal-hexagon", "signal-octagon", "signal-square", "signal-waves", "signal", "six-circle", "six-diamond", "six-hexagon", "six-octagon", "six-square", "six-waves", "six", "skip-back", "skip-forward", "slash-circle", "slash-diamond", "slash-hexagon", "slash-octagon", "slash-square", "slash-waves", "smile-circle", "smile-ghost", "smile-square", "snow", "snowflake", "sofa", "sort", "sparkles", "speaker", "spinner-one", "spinner", "sprout", "square-chart-gantt", "square-dashed-kanban", "square-dashed", "square-half", "square-kanban", "square", "star", "stop-circle", "stop-diamond", "stop-hexagon", "stop-octagon", "stop-square", "stop-waves", "stop", "store", "subtract", "sun-dim", "sun-medium", "sun-snow", "sun", "sunrise", "sunset", "support", "swatches", "table", "tablet", "tag-plus", "tag", "tally-five", "tally-four", "tally-one", "tally-three", "tally-two", "target", "telephone-call", "telephone-forward", "telephone-in", "telephone-missed", "telephone-out", "telephone-slash", "telephone", "tent-tree", "tent", "terminal", "text-align-center", "text-align-left", "text-align-right", "text-justify", "thermometer-snowflake", "thermometer-sun", "thermometer", "three-circle", "three-diamond", "three-hexagon", "three-octagon", "three-square", "three-waves", "three", "ticket-slash", "ticket", "toggle-left", "toggle-right", "tool", "tornado", "train", "trash-one", "trash-two", "trash", "tree-deciduous", "tree-palm", "tree-pine", "tree", "trees", "trending-down", "trending-up-down", "trending-up", "triangle", "truck", "tv", "two-circle", "two-diamond", "two-hexagon", "two-octagon", "two-square", "two-waves", "two", "type-bold", "type-italic", "type-text", "type-underline", "umbrella-off", "umbrella", "undo", "union", "unlink", "upload", "user-check", "user-circle", "user-diamond", "user-hexagon", "user-minus", "user-octagon", "user-plus", "user-settings", "user-square", "user-waves", "user-x", "user", "users-group", "users", "video-slash", "video", "volume-check", "volume-high", "volume-low", "volume-minus", "volume-none", "volume-plus", "volume-slash", "volume-x", "watch", "waves", "webcam", "wheel", "wheelchair", "wifi-check", "wifi-low", "wifi-medium", "wifi-minus", "wifi-plus", "wifi-slash", "wifi-x", "wifi", "wind-arrow-down", "wind", "winds", "wine", "wink-circle", "wink-ghost", "wink-square", "wrench", "x-circle", "x-diamond", "x-hexagon", "x-octagon", "x-square", "x-triangle", "x-waves", "x", "yen-circle", "yen-diamond", "yen-hexagon", "yen-octagon", "yen-square", "yen-waves", "yen", "zap-off", "zap", "zero-circle", "zero-diamond", "zero-hexagon", "zero-octagon", "zero-square", "zero-waves", "zero"];
|
|
2
26
|
type IconName = (typeof ICONS)[number];
|
|
3
27
|
|
|
@@ -12,6 +36,12 @@ declare const DEFAULT_ATTRIBUTE_ICONS: Record<string, IconName>;
|
|
|
12
36
|
*/
|
|
13
37
|
declare function getDefaultAttributeIcon(type: string): IconName;
|
|
14
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Merge class names with Tailwind CSS classes.
|
|
41
|
+
* Uses clsx for conditional classes and tailwind-merge to handle conflicts.
|
|
42
|
+
*/
|
|
43
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
44
|
+
|
|
15
45
|
interface Color {
|
|
16
46
|
/** Background color - works on both light and dark mode */
|
|
17
47
|
background: string;
|
|
@@ -987,6 +1017,41 @@ declare const isValidIso2: (code: string) => code is CountryIso2;
|
|
|
987
1017
|
* Type guard to check if a string is a valid ISO3 country code
|
|
988
1018
|
*/
|
|
989
1019
|
declare const isValidIso3: (code: string) => code is CountryIso3;
|
|
1020
|
+
/**
|
|
1021
|
+
* Get the display name of a country in the specified locale.
|
|
1022
|
+
* Defaults to French with English as fallback.
|
|
1023
|
+
* Uses Intl.DisplayNames for locale-aware names (e.g., "Italie" for "IT" in French).
|
|
1024
|
+
* The Intl.DisplayNames instance is cached at module level to avoid repeated allocations.
|
|
1025
|
+
*
|
|
1026
|
+
* @param iso2 - ISO 3166-1 alpha-2 country code (e.g., "FR", "IT")
|
|
1027
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1028
|
+
*/
|
|
1029
|
+
declare function getCountryDisplayName(iso2: string, locales?: string | string[]): string;
|
|
1030
|
+
/**
|
|
1031
|
+
* Get the display name of a country by its ISO 3166-1 alpha-3 code.
|
|
1032
|
+
* Defaults to French with English as fallback.
|
|
1033
|
+
*
|
|
1034
|
+
* @param iso3 - ISO 3166-1 alpha-3 country code (e.g., "FRA", "ITA")
|
|
1035
|
+
* @param locales - BCP 47 language tags in preference order (default: ['fr', 'en'])
|
|
1036
|
+
*/
|
|
1037
|
+
declare function getCountryDisplayNameByIso3(iso3: string, locales?: string | string[]): string;
|
|
1038
|
+
/**
|
|
1039
|
+
* Get all countries sorted alphabetically by their display name in the given locale.
|
|
1040
|
+
* Sorted once — callers should store the result in a module-level constant.
|
|
1041
|
+
*
|
|
1042
|
+
* @param locale - BCP 47 language tag for sorting (default: 'fr')
|
|
1043
|
+
*/
|
|
1044
|
+
declare function getSortedCountries(locale?: string): Country[];
|
|
1045
|
+
/**
|
|
1046
|
+
* Strip the national trunk prefix from a phone number.
|
|
1047
|
+
* Pure string operation, no external dependencies.
|
|
1048
|
+
*
|
|
1049
|
+
* @example
|
|
1050
|
+
* stripTrunkPrefix("0612345678", "0") // "612345678"
|
|
1051
|
+
* stripTrunkPrefix("612345678", "0") // "612345678" (no prefix to strip)
|
|
1052
|
+
* stripTrunkPrefix("06301234567", "06") // "301234567" (Hungary)
|
|
1053
|
+
*/
|
|
1054
|
+
declare function stripTrunkPrefix(phoneNumber: string, trunkPrefix: string): string;
|
|
990
1055
|
|
|
991
1056
|
interface Currency {
|
|
992
1057
|
code: string;
|
|
@@ -1770,4 +1835,4 @@ declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
|
1770
1835
|
*/
|
|
1771
1836
|
declare const getExtensionFromMimeType: (mimeType: string) => string | null;
|
|
1772
1837
|
|
|
1773
|
-
export { ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes };
|
|
1838
|
+
export { AI_CHAT_ACCEPTED_TYPES, AI_CHAT_MAX_FILES, AI_CHAT_MAX_FILE_SIZE, AI_CHAT_SUPPORTED_DOCUMENTS, AI_CHAT_SUPPORTED_IMAGES, AI_CHAT_SUPPORTED_MIME_TYPES, ALL_MIME_TYPES, ARCHIVES, ARCHIVE_MIME_TYPES, ARCHIVE_MIME_TYPES_ARRAY, AUDIO, AUDIO_MIME_TYPES, AUDIO_MIME_TYPES_ARRAY, type ArchiveMimeType, type AudioMimeType, BYTES, CODE, CODE_MIME_TYPES, CODE_MIME_TYPES_ARRAY, COLORS, COLOR_GROUPS, COUNTRIES, CURRENCIES, type CodeMimeType, type Color, type ColorBackground, type ColorBorder, type ColorGroup, type ColorGroupColors, type ColorIcon, type ColorId, type ColorText, type Country, type CountryIso2, type CountryIso3, type CountryName, type CountryNumericCode, type CountryPhoneCode, type Currency, type CurrencyCode, type CurrencyName, type CurrencySymbol, DEFAULT_ATTRIBUTE_ICONS, DOCUMENTS, DOCUMENT_MIME_TYPES, DOCUMENT_MIME_TYPES_ARRAY, type DocumentMimeType, FILE_SIZE, FONTS, FONT_MIME_TYPES, FONT_MIME_TYPES_ARRAY, type FontMimeType, GIGABYTES, ICONS, IMAGES, IMAGE_MIME_TYPES, IMAGE_MIME_TYPES_ARRAY, type IconName, type ImageMimeType, KILOBYTES, MEDIA, MEGABYTES, type MimeType, OFFICE_DOCUMENTS, OTHER_MIME_TYPES, RECOMMENDED_MAX_SIZES, STATUS_COLORS, type StatusColorGroup, VIDEO, VIDEO_MIME_TYPES, VIDEO_MIME_TYPES_ARRAY, type VideoMimeType, WEB_IMAGES, bytesToGb, bytesToMb, cn, formatBytes, gbToBytes, getAllColors, getAllCountries, getAllCurrencies, getColor, getColorIds, getColorsByGroup, getCountryByIso2, getCountryByIso3, getCountryDisplayName, getCountryDisplayNameByIso3, getCountryPhoneCode, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getExtensionFromMimeType, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isAIChatSupportedMimeType, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
AI_CHAT_ACCEPTED_TYPES: () => AI_CHAT_ACCEPTED_TYPES,
|
|
24
|
+
AI_CHAT_MAX_FILES: () => AI_CHAT_MAX_FILES,
|
|
25
|
+
AI_CHAT_MAX_FILE_SIZE: () => AI_CHAT_MAX_FILE_SIZE,
|
|
26
|
+
AI_CHAT_SUPPORTED_DOCUMENTS: () => AI_CHAT_SUPPORTED_DOCUMENTS,
|
|
27
|
+
AI_CHAT_SUPPORTED_IMAGES: () => AI_CHAT_SUPPORTED_IMAGES,
|
|
28
|
+
AI_CHAT_SUPPORTED_MIME_TYPES: () => AI_CHAT_SUPPORTED_MIME_TYPES,
|
|
23
29
|
ALL_MIME_TYPES: () => ALL_MIME_TYPES,
|
|
24
30
|
ARCHIVES: () => ARCHIVES,
|
|
25
31
|
ARCHIVE_MIME_TYPES: () => ARCHIVE_MIME_TYPES,
|
|
@@ -61,6 +67,7 @@ __export(index_exports, {
|
|
|
61
67
|
WEB_IMAGES: () => WEB_IMAGES,
|
|
62
68
|
bytesToGb: () => bytesToGb,
|
|
63
69
|
bytesToMb: () => bytesToMb,
|
|
70
|
+
cn: () => cn,
|
|
64
71
|
formatBytes: () => formatBytes,
|
|
65
72
|
gbToBytes: () => gbToBytes,
|
|
66
73
|
getAllColors: () => getAllColors,
|
|
@@ -71,6 +78,8 @@ __export(index_exports, {
|
|
|
71
78
|
getColorsByGroup: () => getColorsByGroup,
|
|
72
79
|
getCountryByIso2: () => getCountryByIso2,
|
|
73
80
|
getCountryByIso3: () => getCountryByIso3,
|
|
81
|
+
getCountryDisplayName: () => getCountryDisplayName,
|
|
82
|
+
getCountryDisplayNameByIso3: () => getCountryDisplayNameByIso3,
|
|
74
83
|
getCountryPhoneCode: () => getCountryPhoneCode,
|
|
75
84
|
getCurrency: () => getCurrency,
|
|
76
85
|
getCurrencySymbol: () => getCurrencySymbol,
|
|
@@ -78,6 +87,8 @@ __export(index_exports, {
|
|
|
78
87
|
getExtensionFromMimeType: () => getExtensionFromMimeType,
|
|
79
88
|
getPhoneMaxDigits: () => getPhoneMaxDigits,
|
|
80
89
|
getPhoneTrunkPrefix: () => getPhoneTrunkPrefix,
|
|
90
|
+
getSortedCountries: () => getSortedCountries,
|
|
91
|
+
isAIChatSupportedMimeType: () => isAIChatSupportedMimeType,
|
|
81
92
|
isArchiveMimeType: () => isArchiveMimeType,
|
|
82
93
|
isAudioMimeType: () => isAudioMimeType,
|
|
83
94
|
isCodeMimeType: () => isCodeMimeType,
|
|
@@ -89,10 +100,210 @@ __export(index_exports, {
|
|
|
89
100
|
isValidIso3: () => isValidIso3,
|
|
90
101
|
isVideoMimeType: () => isVideoMimeType,
|
|
91
102
|
isWithinSizeLimit: () => isWithinSizeLimit,
|
|
92
|
-
mbToBytes: () => mbToBytes
|
|
103
|
+
mbToBytes: () => mbToBytes,
|
|
104
|
+
stripTrunkPrefix: () => stripTrunkPrefix
|
|
93
105
|
});
|
|
94
106
|
module.exports = __toCommonJS(index_exports);
|
|
95
107
|
|
|
108
|
+
// src/mimeTypes.ts
|
|
109
|
+
var IMAGE_MIME_TYPES = {
|
|
110
|
+
JPEG: "image/jpeg",
|
|
111
|
+
PNG: "image/png",
|
|
112
|
+
GIF: "image/gif",
|
|
113
|
+
WEBP: "image/webp",
|
|
114
|
+
SVG: "image/svg+xml",
|
|
115
|
+
BMP: "image/bmp",
|
|
116
|
+
TIFF: "image/tiff",
|
|
117
|
+
ICO: "image/x-icon",
|
|
118
|
+
HEIC: "image/heic",
|
|
119
|
+
HEIF: "image/heif"
|
|
120
|
+
};
|
|
121
|
+
var IMAGE_MIME_TYPES_ARRAY = Object.values(IMAGE_MIME_TYPES);
|
|
122
|
+
var DOCUMENT_MIME_TYPES = {
|
|
123
|
+
PDF: "application/pdf",
|
|
124
|
+
DOC: "application/msword",
|
|
125
|
+
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
126
|
+
XLS: "application/vnd.ms-excel",
|
|
127
|
+
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
128
|
+
PPT: "application/vnd.ms-powerpoint",
|
|
129
|
+
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
130
|
+
ODT: "application/vnd.oasis.opendocument.text",
|
|
131
|
+
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
132
|
+
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
133
|
+
RTF: "application/rtf",
|
|
134
|
+
TXT: "text/plain",
|
|
135
|
+
CSV: "text/csv",
|
|
136
|
+
MARKDOWN: "text/markdown"
|
|
137
|
+
};
|
|
138
|
+
var DOCUMENT_MIME_TYPES_ARRAY = Object.values(DOCUMENT_MIME_TYPES);
|
|
139
|
+
var ARCHIVE_MIME_TYPES = {
|
|
140
|
+
ZIP: "application/zip",
|
|
141
|
+
RAR: "application/vnd.rar",
|
|
142
|
+
TAR: "application/x-tar",
|
|
143
|
+
GZIP: "application/gzip",
|
|
144
|
+
"7Z": "application/x-7z-compressed",
|
|
145
|
+
BZ2: "application/x-bzip2"
|
|
146
|
+
};
|
|
147
|
+
var ARCHIVE_MIME_TYPES_ARRAY = Object.values(ARCHIVE_MIME_TYPES);
|
|
148
|
+
var AUDIO_MIME_TYPES = {
|
|
149
|
+
MP3: "audio/mpeg",
|
|
150
|
+
WAV: "audio/wav",
|
|
151
|
+
OGG: "audio/ogg",
|
|
152
|
+
AAC: "audio/aac",
|
|
153
|
+
FLAC: "audio/flac",
|
|
154
|
+
M4A: "audio/mp4",
|
|
155
|
+
WEBM: "audio/webm"
|
|
156
|
+
};
|
|
157
|
+
var AUDIO_MIME_TYPES_ARRAY = Object.values(AUDIO_MIME_TYPES);
|
|
158
|
+
var VIDEO_MIME_TYPES = {
|
|
159
|
+
MP4: "video/mp4",
|
|
160
|
+
WEBM: "video/webm",
|
|
161
|
+
OGG: "video/ogg",
|
|
162
|
+
AVI: "video/x-msvideo",
|
|
163
|
+
MOV: "video/quicktime",
|
|
164
|
+
MKV: "video/x-matroska",
|
|
165
|
+
FLV: "video/x-flv",
|
|
166
|
+
WMV: "video/x-ms-wmv",
|
|
167
|
+
MPEG: "video/mpeg"
|
|
168
|
+
};
|
|
169
|
+
var VIDEO_MIME_TYPES_ARRAY = Object.values(VIDEO_MIME_TYPES);
|
|
170
|
+
var CODE_MIME_TYPES = {
|
|
171
|
+
JAVASCRIPT: "text/javascript",
|
|
172
|
+
TYPESCRIPT: "text/typescript",
|
|
173
|
+
JSON: "application/json",
|
|
174
|
+
XML: "application/xml",
|
|
175
|
+
HTML: "text/html",
|
|
176
|
+
CSS: "text/css",
|
|
177
|
+
PYTHON: "text/x-python",
|
|
178
|
+
JAVA: "text/x-java-source",
|
|
179
|
+
C: "text/x-c",
|
|
180
|
+
CPP: "text/x-c++",
|
|
181
|
+
YAML: "application/x-yaml",
|
|
182
|
+
SQL: "application/sql"
|
|
183
|
+
};
|
|
184
|
+
var CODE_MIME_TYPES_ARRAY = Object.values(CODE_MIME_TYPES);
|
|
185
|
+
var FONT_MIME_TYPES = {
|
|
186
|
+
TTF: "font/ttf",
|
|
187
|
+
OTF: "font/otf",
|
|
188
|
+
WOFF: "font/woff",
|
|
189
|
+
WOFF2: "font/woff2",
|
|
190
|
+
EOT: "application/vnd.ms-fontobject"
|
|
191
|
+
};
|
|
192
|
+
var FONT_MIME_TYPES_ARRAY = Object.values(FONT_MIME_TYPES);
|
|
193
|
+
var OTHER_MIME_TYPES = {
|
|
194
|
+
BINARY: "application/octet-stream",
|
|
195
|
+
FORM_DATA: "multipart/form-data",
|
|
196
|
+
JSON_LD: "application/ld+json",
|
|
197
|
+
XHTML: "application/xhtml+xml"
|
|
198
|
+
};
|
|
199
|
+
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
200
|
+
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
201
|
+
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
202
|
+
var AUDIO = AUDIO_MIME_TYPES_ARRAY;
|
|
203
|
+
var VIDEO = VIDEO_MIME_TYPES_ARRAY;
|
|
204
|
+
var CODE = CODE_MIME_TYPES_ARRAY;
|
|
205
|
+
var FONTS = FONT_MIME_TYPES_ARRAY;
|
|
206
|
+
var WEB_IMAGES = [
|
|
207
|
+
IMAGE_MIME_TYPES.JPEG,
|
|
208
|
+
IMAGE_MIME_TYPES.PNG,
|
|
209
|
+
IMAGE_MIME_TYPES.GIF,
|
|
210
|
+
IMAGE_MIME_TYPES.WEBP
|
|
211
|
+
];
|
|
212
|
+
var OFFICE_DOCUMENTS = [
|
|
213
|
+
DOCUMENT_MIME_TYPES.PDF,
|
|
214
|
+
DOCUMENT_MIME_TYPES.DOC,
|
|
215
|
+
DOCUMENT_MIME_TYPES.DOCX,
|
|
216
|
+
DOCUMENT_MIME_TYPES.XLS,
|
|
217
|
+
DOCUMENT_MIME_TYPES.XLSX,
|
|
218
|
+
DOCUMENT_MIME_TYPES.PPT,
|
|
219
|
+
DOCUMENT_MIME_TYPES.PPTX
|
|
220
|
+
];
|
|
221
|
+
var MEDIA = [...IMAGES, ...AUDIO, ...VIDEO];
|
|
222
|
+
var ALL_MIME_TYPES = [
|
|
223
|
+
...IMAGES,
|
|
224
|
+
...DOCUMENTS,
|
|
225
|
+
...ARCHIVES,
|
|
226
|
+
...AUDIO,
|
|
227
|
+
...VIDEO,
|
|
228
|
+
...CODE,
|
|
229
|
+
...FONTS,
|
|
230
|
+
...Object.values(OTHER_MIME_TYPES)
|
|
231
|
+
];
|
|
232
|
+
var isImageMimeType = (mimeType) => {
|
|
233
|
+
return IMAGES.includes(mimeType);
|
|
234
|
+
};
|
|
235
|
+
var isDocumentMimeType = (mimeType) => {
|
|
236
|
+
return DOCUMENTS.includes(mimeType);
|
|
237
|
+
};
|
|
238
|
+
var isArchiveMimeType = (mimeType) => {
|
|
239
|
+
return ARCHIVES.includes(mimeType);
|
|
240
|
+
};
|
|
241
|
+
var isAudioMimeType = (mimeType) => {
|
|
242
|
+
return AUDIO.includes(mimeType);
|
|
243
|
+
};
|
|
244
|
+
var isVideoMimeType = (mimeType) => {
|
|
245
|
+
return VIDEO.includes(mimeType);
|
|
246
|
+
};
|
|
247
|
+
var isCodeMimeType = (mimeType) => {
|
|
248
|
+
return CODE.includes(mimeType);
|
|
249
|
+
};
|
|
250
|
+
var getExtensionFromMimeType = (mimeType) => {
|
|
251
|
+
const mimeToExt = {
|
|
252
|
+
// Images
|
|
253
|
+
"image/jpeg": "jpg",
|
|
254
|
+
"image/png": "png",
|
|
255
|
+
"image/gif": "gif",
|
|
256
|
+
"image/webp": "webp",
|
|
257
|
+
"image/svg+xml": "svg",
|
|
258
|
+
// Documents
|
|
259
|
+
"application/pdf": "pdf",
|
|
260
|
+
"application/msword": "doc",
|
|
261
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
|
|
262
|
+
"application/vnd.ms-excel": "xls",
|
|
263
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
|
|
264
|
+
// Archives
|
|
265
|
+
"application/zip": "zip",
|
|
266
|
+
"application/vnd.rar": "rar",
|
|
267
|
+
// Audio
|
|
268
|
+
"audio/mpeg": "mp3",
|
|
269
|
+
"audio/wav": "wav",
|
|
270
|
+
// Video
|
|
271
|
+
"video/mp4": "mp4",
|
|
272
|
+
"video/webm": "webm",
|
|
273
|
+
// Text
|
|
274
|
+
"text/plain": "txt",
|
|
275
|
+
"text/csv": "csv",
|
|
276
|
+
"application/json": "json"
|
|
277
|
+
};
|
|
278
|
+
return mimeToExt[mimeType] || null;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// src/aiChat.ts
|
|
282
|
+
var AI_CHAT_SUPPORTED_IMAGES = [
|
|
283
|
+
IMAGE_MIME_TYPES.JPEG,
|
|
284
|
+
IMAGE_MIME_TYPES.PNG,
|
|
285
|
+
IMAGE_MIME_TYPES.WEBP,
|
|
286
|
+
IMAGE_MIME_TYPES.GIF
|
|
287
|
+
];
|
|
288
|
+
var AI_CHAT_SUPPORTED_DOCUMENTS = [
|
|
289
|
+
DOCUMENT_MIME_TYPES.PDF,
|
|
290
|
+
DOCUMENT_MIME_TYPES.DOC,
|
|
291
|
+
DOCUMENT_MIME_TYPES.DOCX,
|
|
292
|
+
DOCUMENT_MIME_TYPES.TXT,
|
|
293
|
+
DOCUMENT_MIME_TYPES.MARKDOWN,
|
|
294
|
+
DOCUMENT_MIME_TYPES.CSV
|
|
295
|
+
];
|
|
296
|
+
var AI_CHAT_SUPPORTED_MIME_TYPES = [
|
|
297
|
+
...AI_CHAT_SUPPORTED_IMAGES,
|
|
298
|
+
...AI_CHAT_SUPPORTED_DOCUMENTS
|
|
299
|
+
];
|
|
300
|
+
var AI_CHAT_ACCEPTED_TYPES = AI_CHAT_SUPPORTED_MIME_TYPES.join(",");
|
|
301
|
+
var AI_CHAT_MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
302
|
+
var AI_CHAT_MAX_FILES = 5;
|
|
303
|
+
function isAIChatSupportedMimeType(mimeType) {
|
|
304
|
+
return AI_CHAT_SUPPORTED_MIME_TYPES.includes(mimeType);
|
|
305
|
+
}
|
|
306
|
+
|
|
96
307
|
// src/attribute-icons.ts
|
|
97
308
|
var DEFAULT_ATTRIBUTE_ICONS = {
|
|
98
309
|
text: "text-align-left",
|
|
@@ -118,6 +329,13 @@ function getDefaultAttributeIcon(type) {
|
|
|
118
329
|
return DEFAULT_ATTRIBUTE_ICONS[type] ?? "circle";
|
|
119
330
|
}
|
|
120
331
|
|
|
332
|
+
// src/cn.ts
|
|
333
|
+
var import_clsx = require("clsx");
|
|
334
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
335
|
+
function cn(...inputs) {
|
|
336
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
337
|
+
}
|
|
338
|
+
|
|
121
339
|
// src/colors.ts
|
|
122
340
|
var COLORS = {
|
|
123
341
|
// Neutral & Gray tones
|
|
@@ -1072,6 +1290,50 @@ var isValidIso3 = (code) => {
|
|
|
1072
1290
|
(country) => country.iso3.toUpperCase() === code.toUpperCase()
|
|
1073
1291
|
);
|
|
1074
1292
|
};
|
|
1293
|
+
var _displayNamesCache = /* @__PURE__ */ new Map();
|
|
1294
|
+
function _getDisplayNames(locales) {
|
|
1295
|
+
const key = locales.join("\0");
|
|
1296
|
+
const cached = _displayNamesCache.get(key);
|
|
1297
|
+
if (cached !== void 0) return cached;
|
|
1298
|
+
try {
|
|
1299
|
+
const dn = new Intl.DisplayNames(locales, { type: "region" });
|
|
1300
|
+
_displayNamesCache.set(key, dn);
|
|
1301
|
+
return dn;
|
|
1302
|
+
} catch {
|
|
1303
|
+
_displayNamesCache.set(key, null);
|
|
1304
|
+
return null;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
function getCountryDisplayName(iso2, locales = ["fr", "en"]) {
|
|
1308
|
+
const code = iso2.toUpperCase();
|
|
1309
|
+
const localeList = Array.isArray(locales) ? locales : [locales];
|
|
1310
|
+
const displayNames = _getDisplayNames(localeList);
|
|
1311
|
+
if (displayNames) {
|
|
1312
|
+
try {
|
|
1313
|
+
const name = displayNames.of(code);
|
|
1314
|
+
if (name) return name;
|
|
1315
|
+
} catch {
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
return COUNTRIES[code]?.name ?? code;
|
|
1319
|
+
}
|
|
1320
|
+
function getCountryDisplayNameByIso3(iso3, locales) {
|
|
1321
|
+
const country = getCountryByIso3(iso3);
|
|
1322
|
+
if (!country) return iso3;
|
|
1323
|
+
return getCountryDisplayName(country.iso2, locales);
|
|
1324
|
+
}
|
|
1325
|
+
function getSortedCountries(locale = "fr") {
|
|
1326
|
+
return getAllCountries().sort(
|
|
1327
|
+
(a, b) => getCountryDisplayName(a.iso2, locale).localeCompare(
|
|
1328
|
+
getCountryDisplayName(b.iso2, locale),
|
|
1329
|
+
locale
|
|
1330
|
+
)
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
function stripTrunkPrefix(phoneNumber, trunkPrefix) {
|
|
1334
|
+
if (!trunkPrefix) return phoneNumber;
|
|
1335
|
+
return phoneNumber.startsWith(trunkPrefix) ? phoneNumber.slice(trunkPrefix.length) : phoneNumber;
|
|
1336
|
+
}
|
|
1075
1337
|
|
|
1076
1338
|
// src/currencies.ts
|
|
1077
1339
|
var CURRENCIES = {
|
|
@@ -2534,181 +2796,14 @@ var ICONS = [
|
|
|
2534
2796
|
"zero-waves",
|
|
2535
2797
|
"zero"
|
|
2536
2798
|
];
|
|
2537
|
-
|
|
2538
|
-
// src/mimeTypes.ts
|
|
2539
|
-
var IMAGE_MIME_TYPES = {
|
|
2540
|
-
JPEG: "image/jpeg",
|
|
2541
|
-
PNG: "image/png",
|
|
2542
|
-
GIF: "image/gif",
|
|
2543
|
-
WEBP: "image/webp",
|
|
2544
|
-
SVG: "image/svg+xml",
|
|
2545
|
-
BMP: "image/bmp",
|
|
2546
|
-
TIFF: "image/tiff",
|
|
2547
|
-
ICO: "image/x-icon",
|
|
2548
|
-
HEIC: "image/heic",
|
|
2549
|
-
HEIF: "image/heif"
|
|
2550
|
-
};
|
|
2551
|
-
var IMAGE_MIME_TYPES_ARRAY = Object.values(IMAGE_MIME_TYPES);
|
|
2552
|
-
var DOCUMENT_MIME_TYPES = {
|
|
2553
|
-
PDF: "application/pdf",
|
|
2554
|
-
DOC: "application/msword",
|
|
2555
|
-
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2556
|
-
XLS: "application/vnd.ms-excel",
|
|
2557
|
-
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
2558
|
-
PPT: "application/vnd.ms-powerpoint",
|
|
2559
|
-
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
2560
|
-
ODT: "application/vnd.oasis.opendocument.text",
|
|
2561
|
-
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
2562
|
-
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
2563
|
-
RTF: "application/rtf",
|
|
2564
|
-
TXT: "text/plain",
|
|
2565
|
-
CSV: "text/csv",
|
|
2566
|
-
MARKDOWN: "text/markdown"
|
|
2567
|
-
};
|
|
2568
|
-
var DOCUMENT_MIME_TYPES_ARRAY = Object.values(DOCUMENT_MIME_TYPES);
|
|
2569
|
-
var ARCHIVE_MIME_TYPES = {
|
|
2570
|
-
ZIP: "application/zip",
|
|
2571
|
-
RAR: "application/vnd.rar",
|
|
2572
|
-
TAR: "application/x-tar",
|
|
2573
|
-
GZIP: "application/gzip",
|
|
2574
|
-
"7Z": "application/x-7z-compressed",
|
|
2575
|
-
BZ2: "application/x-bzip2"
|
|
2576
|
-
};
|
|
2577
|
-
var ARCHIVE_MIME_TYPES_ARRAY = Object.values(ARCHIVE_MIME_TYPES);
|
|
2578
|
-
var AUDIO_MIME_TYPES = {
|
|
2579
|
-
MP3: "audio/mpeg",
|
|
2580
|
-
WAV: "audio/wav",
|
|
2581
|
-
OGG: "audio/ogg",
|
|
2582
|
-
AAC: "audio/aac",
|
|
2583
|
-
FLAC: "audio/flac",
|
|
2584
|
-
M4A: "audio/mp4",
|
|
2585
|
-
WEBM: "audio/webm"
|
|
2586
|
-
};
|
|
2587
|
-
var AUDIO_MIME_TYPES_ARRAY = Object.values(AUDIO_MIME_TYPES);
|
|
2588
|
-
var VIDEO_MIME_TYPES = {
|
|
2589
|
-
MP4: "video/mp4",
|
|
2590
|
-
WEBM: "video/webm",
|
|
2591
|
-
OGG: "video/ogg",
|
|
2592
|
-
AVI: "video/x-msvideo",
|
|
2593
|
-
MOV: "video/quicktime",
|
|
2594
|
-
MKV: "video/x-matroska",
|
|
2595
|
-
FLV: "video/x-flv",
|
|
2596
|
-
WMV: "video/x-ms-wmv",
|
|
2597
|
-
MPEG: "video/mpeg"
|
|
2598
|
-
};
|
|
2599
|
-
var VIDEO_MIME_TYPES_ARRAY = Object.values(VIDEO_MIME_TYPES);
|
|
2600
|
-
var CODE_MIME_TYPES = {
|
|
2601
|
-
JAVASCRIPT: "text/javascript",
|
|
2602
|
-
TYPESCRIPT: "text/typescript",
|
|
2603
|
-
JSON: "application/json",
|
|
2604
|
-
XML: "application/xml",
|
|
2605
|
-
HTML: "text/html",
|
|
2606
|
-
CSS: "text/css",
|
|
2607
|
-
PYTHON: "text/x-python",
|
|
2608
|
-
JAVA: "text/x-java-source",
|
|
2609
|
-
C: "text/x-c",
|
|
2610
|
-
CPP: "text/x-c++",
|
|
2611
|
-
YAML: "application/x-yaml",
|
|
2612
|
-
SQL: "application/sql"
|
|
2613
|
-
};
|
|
2614
|
-
var CODE_MIME_TYPES_ARRAY = Object.values(CODE_MIME_TYPES);
|
|
2615
|
-
var FONT_MIME_TYPES = {
|
|
2616
|
-
TTF: "font/ttf",
|
|
2617
|
-
OTF: "font/otf",
|
|
2618
|
-
WOFF: "font/woff",
|
|
2619
|
-
WOFF2: "font/woff2",
|
|
2620
|
-
EOT: "application/vnd.ms-fontobject"
|
|
2621
|
-
};
|
|
2622
|
-
var FONT_MIME_TYPES_ARRAY = Object.values(FONT_MIME_TYPES);
|
|
2623
|
-
var OTHER_MIME_TYPES = {
|
|
2624
|
-
BINARY: "application/octet-stream",
|
|
2625
|
-
FORM_DATA: "multipart/form-data",
|
|
2626
|
-
JSON_LD: "application/ld+json",
|
|
2627
|
-
XHTML: "application/xhtml+xml"
|
|
2628
|
-
};
|
|
2629
|
-
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
2630
|
-
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
2631
|
-
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
2632
|
-
var AUDIO = AUDIO_MIME_TYPES_ARRAY;
|
|
2633
|
-
var VIDEO = VIDEO_MIME_TYPES_ARRAY;
|
|
2634
|
-
var CODE = CODE_MIME_TYPES_ARRAY;
|
|
2635
|
-
var FONTS = FONT_MIME_TYPES_ARRAY;
|
|
2636
|
-
var WEB_IMAGES = [
|
|
2637
|
-
IMAGE_MIME_TYPES.JPEG,
|
|
2638
|
-
IMAGE_MIME_TYPES.PNG,
|
|
2639
|
-
IMAGE_MIME_TYPES.GIF,
|
|
2640
|
-
IMAGE_MIME_TYPES.WEBP
|
|
2641
|
-
];
|
|
2642
|
-
var OFFICE_DOCUMENTS = [
|
|
2643
|
-
DOCUMENT_MIME_TYPES.PDF,
|
|
2644
|
-
DOCUMENT_MIME_TYPES.DOC,
|
|
2645
|
-
DOCUMENT_MIME_TYPES.DOCX,
|
|
2646
|
-
DOCUMENT_MIME_TYPES.XLS,
|
|
2647
|
-
DOCUMENT_MIME_TYPES.XLSX,
|
|
2648
|
-
DOCUMENT_MIME_TYPES.PPT,
|
|
2649
|
-
DOCUMENT_MIME_TYPES.PPTX
|
|
2650
|
-
];
|
|
2651
|
-
var MEDIA = [...IMAGES, ...AUDIO, ...VIDEO];
|
|
2652
|
-
var ALL_MIME_TYPES = [
|
|
2653
|
-
...IMAGES,
|
|
2654
|
-
...DOCUMENTS,
|
|
2655
|
-
...ARCHIVES,
|
|
2656
|
-
...AUDIO,
|
|
2657
|
-
...VIDEO,
|
|
2658
|
-
...CODE,
|
|
2659
|
-
...FONTS,
|
|
2660
|
-
...Object.values(OTHER_MIME_TYPES)
|
|
2661
|
-
];
|
|
2662
|
-
var isImageMimeType = (mimeType) => {
|
|
2663
|
-
return IMAGES.includes(mimeType);
|
|
2664
|
-
};
|
|
2665
|
-
var isDocumentMimeType = (mimeType) => {
|
|
2666
|
-
return DOCUMENTS.includes(mimeType);
|
|
2667
|
-
};
|
|
2668
|
-
var isArchiveMimeType = (mimeType) => {
|
|
2669
|
-
return ARCHIVES.includes(mimeType);
|
|
2670
|
-
};
|
|
2671
|
-
var isAudioMimeType = (mimeType) => {
|
|
2672
|
-
return AUDIO.includes(mimeType);
|
|
2673
|
-
};
|
|
2674
|
-
var isVideoMimeType = (mimeType) => {
|
|
2675
|
-
return VIDEO.includes(mimeType);
|
|
2676
|
-
};
|
|
2677
|
-
var isCodeMimeType = (mimeType) => {
|
|
2678
|
-
return CODE.includes(mimeType);
|
|
2679
|
-
};
|
|
2680
|
-
var getExtensionFromMimeType = (mimeType) => {
|
|
2681
|
-
const mimeToExt = {
|
|
2682
|
-
// Images
|
|
2683
|
-
"image/jpeg": "jpg",
|
|
2684
|
-
"image/png": "png",
|
|
2685
|
-
"image/gif": "gif",
|
|
2686
|
-
"image/webp": "webp",
|
|
2687
|
-
"image/svg+xml": "svg",
|
|
2688
|
-
// Documents
|
|
2689
|
-
"application/pdf": "pdf",
|
|
2690
|
-
"application/msword": "doc",
|
|
2691
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
|
|
2692
|
-
"application/vnd.ms-excel": "xls",
|
|
2693
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
|
|
2694
|
-
// Archives
|
|
2695
|
-
"application/zip": "zip",
|
|
2696
|
-
"application/vnd.rar": "rar",
|
|
2697
|
-
// Audio
|
|
2698
|
-
"audio/mpeg": "mp3",
|
|
2699
|
-
"audio/wav": "wav",
|
|
2700
|
-
// Video
|
|
2701
|
-
"video/mp4": "mp4",
|
|
2702
|
-
"video/webm": "webm",
|
|
2703
|
-
// Text
|
|
2704
|
-
"text/plain": "txt",
|
|
2705
|
-
"text/csv": "csv",
|
|
2706
|
-
"application/json": "json"
|
|
2707
|
-
};
|
|
2708
|
-
return mimeToExt[mimeType] || null;
|
|
2709
|
-
};
|
|
2710
2799
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2711
2800
|
0 && (module.exports = {
|
|
2801
|
+
AI_CHAT_ACCEPTED_TYPES,
|
|
2802
|
+
AI_CHAT_MAX_FILES,
|
|
2803
|
+
AI_CHAT_MAX_FILE_SIZE,
|
|
2804
|
+
AI_CHAT_SUPPORTED_DOCUMENTS,
|
|
2805
|
+
AI_CHAT_SUPPORTED_IMAGES,
|
|
2806
|
+
AI_CHAT_SUPPORTED_MIME_TYPES,
|
|
2712
2807
|
ALL_MIME_TYPES,
|
|
2713
2808
|
ARCHIVES,
|
|
2714
2809
|
ARCHIVE_MIME_TYPES,
|
|
@@ -2750,6 +2845,7 @@ var getExtensionFromMimeType = (mimeType) => {
|
|
|
2750
2845
|
WEB_IMAGES,
|
|
2751
2846
|
bytesToGb,
|
|
2752
2847
|
bytesToMb,
|
|
2848
|
+
cn,
|
|
2753
2849
|
formatBytes,
|
|
2754
2850
|
gbToBytes,
|
|
2755
2851
|
getAllColors,
|
|
@@ -2760,6 +2856,8 @@ var getExtensionFromMimeType = (mimeType) => {
|
|
|
2760
2856
|
getColorsByGroup,
|
|
2761
2857
|
getCountryByIso2,
|
|
2762
2858
|
getCountryByIso3,
|
|
2859
|
+
getCountryDisplayName,
|
|
2860
|
+
getCountryDisplayNameByIso3,
|
|
2763
2861
|
getCountryPhoneCode,
|
|
2764
2862
|
getCurrency,
|
|
2765
2863
|
getCurrencySymbol,
|
|
@@ -2767,6 +2865,8 @@ var getExtensionFromMimeType = (mimeType) => {
|
|
|
2767
2865
|
getExtensionFromMimeType,
|
|
2768
2866
|
getPhoneMaxDigits,
|
|
2769
2867
|
getPhoneTrunkPrefix,
|
|
2868
|
+
getSortedCountries,
|
|
2869
|
+
isAIChatSupportedMimeType,
|
|
2770
2870
|
isArchiveMimeType,
|
|
2771
2871
|
isAudioMimeType,
|
|
2772
2872
|
isCodeMimeType,
|
|
@@ -2778,5 +2878,6 @@ var getExtensionFromMimeType = (mimeType) => {
|
|
|
2778
2878
|
isValidIso3,
|
|
2779
2879
|
isVideoMimeType,
|
|
2780
2880
|
isWithinSizeLimit,
|
|
2781
|
-
mbToBytes
|
|
2881
|
+
mbToBytes,
|
|
2882
|
+
stripTrunkPrefix
|
|
2782
2883
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,202 @@
|
|
|
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 OTHER_MIME_TYPES = {
|
|
87
|
+
BINARY: "application/octet-stream",
|
|
88
|
+
FORM_DATA: "multipart/form-data",
|
|
89
|
+
JSON_LD: "application/ld+json",
|
|
90
|
+
XHTML: "application/xhtml+xml"
|
|
91
|
+
};
|
|
92
|
+
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
93
|
+
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
94
|
+
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
95
|
+
var AUDIO = AUDIO_MIME_TYPES_ARRAY;
|
|
96
|
+
var VIDEO = VIDEO_MIME_TYPES_ARRAY;
|
|
97
|
+
var CODE = CODE_MIME_TYPES_ARRAY;
|
|
98
|
+
var FONTS = FONT_MIME_TYPES_ARRAY;
|
|
99
|
+
var WEB_IMAGES = [
|
|
100
|
+
IMAGE_MIME_TYPES.JPEG,
|
|
101
|
+
IMAGE_MIME_TYPES.PNG,
|
|
102
|
+
IMAGE_MIME_TYPES.GIF,
|
|
103
|
+
IMAGE_MIME_TYPES.WEBP
|
|
104
|
+
];
|
|
105
|
+
var OFFICE_DOCUMENTS = [
|
|
106
|
+
DOCUMENT_MIME_TYPES.PDF,
|
|
107
|
+
DOCUMENT_MIME_TYPES.DOC,
|
|
108
|
+
DOCUMENT_MIME_TYPES.DOCX,
|
|
109
|
+
DOCUMENT_MIME_TYPES.XLS,
|
|
110
|
+
DOCUMENT_MIME_TYPES.XLSX,
|
|
111
|
+
DOCUMENT_MIME_TYPES.PPT,
|
|
112
|
+
DOCUMENT_MIME_TYPES.PPTX
|
|
113
|
+
];
|
|
114
|
+
var MEDIA = [...IMAGES, ...AUDIO, ...VIDEO];
|
|
115
|
+
var ALL_MIME_TYPES = [
|
|
116
|
+
...IMAGES,
|
|
117
|
+
...DOCUMENTS,
|
|
118
|
+
...ARCHIVES,
|
|
119
|
+
...AUDIO,
|
|
120
|
+
...VIDEO,
|
|
121
|
+
...CODE,
|
|
122
|
+
...FONTS,
|
|
123
|
+
...Object.values(OTHER_MIME_TYPES)
|
|
124
|
+
];
|
|
125
|
+
var isImageMimeType = (mimeType) => {
|
|
126
|
+
return IMAGES.includes(mimeType);
|
|
127
|
+
};
|
|
128
|
+
var isDocumentMimeType = (mimeType) => {
|
|
129
|
+
return DOCUMENTS.includes(mimeType);
|
|
130
|
+
};
|
|
131
|
+
var isArchiveMimeType = (mimeType) => {
|
|
132
|
+
return ARCHIVES.includes(mimeType);
|
|
133
|
+
};
|
|
134
|
+
var isAudioMimeType = (mimeType) => {
|
|
135
|
+
return AUDIO.includes(mimeType);
|
|
136
|
+
};
|
|
137
|
+
var isVideoMimeType = (mimeType) => {
|
|
138
|
+
return VIDEO.includes(mimeType);
|
|
139
|
+
};
|
|
140
|
+
var isCodeMimeType = (mimeType) => {
|
|
141
|
+
return CODE.includes(mimeType);
|
|
142
|
+
};
|
|
143
|
+
var getExtensionFromMimeType = (mimeType) => {
|
|
144
|
+
const mimeToExt = {
|
|
145
|
+
// Images
|
|
146
|
+
"image/jpeg": "jpg",
|
|
147
|
+
"image/png": "png",
|
|
148
|
+
"image/gif": "gif",
|
|
149
|
+
"image/webp": "webp",
|
|
150
|
+
"image/svg+xml": "svg",
|
|
151
|
+
// Documents
|
|
152
|
+
"application/pdf": "pdf",
|
|
153
|
+
"application/msword": "doc",
|
|
154
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
|
|
155
|
+
"application/vnd.ms-excel": "xls",
|
|
156
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
|
|
157
|
+
// Archives
|
|
158
|
+
"application/zip": "zip",
|
|
159
|
+
"application/vnd.rar": "rar",
|
|
160
|
+
// Audio
|
|
161
|
+
"audio/mpeg": "mp3",
|
|
162
|
+
"audio/wav": "wav",
|
|
163
|
+
// Video
|
|
164
|
+
"video/mp4": "mp4",
|
|
165
|
+
"video/webm": "webm",
|
|
166
|
+
// Text
|
|
167
|
+
"text/plain": "txt",
|
|
168
|
+
"text/csv": "csv",
|
|
169
|
+
"application/json": "json"
|
|
170
|
+
};
|
|
171
|
+
return mimeToExt[mimeType] || null;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// src/aiChat.ts
|
|
175
|
+
var AI_CHAT_SUPPORTED_IMAGES = [
|
|
176
|
+
IMAGE_MIME_TYPES.JPEG,
|
|
177
|
+
IMAGE_MIME_TYPES.PNG,
|
|
178
|
+
IMAGE_MIME_TYPES.WEBP,
|
|
179
|
+
IMAGE_MIME_TYPES.GIF
|
|
180
|
+
];
|
|
181
|
+
var AI_CHAT_SUPPORTED_DOCUMENTS = [
|
|
182
|
+
DOCUMENT_MIME_TYPES.PDF,
|
|
183
|
+
DOCUMENT_MIME_TYPES.DOC,
|
|
184
|
+
DOCUMENT_MIME_TYPES.DOCX,
|
|
185
|
+
DOCUMENT_MIME_TYPES.TXT,
|
|
186
|
+
DOCUMENT_MIME_TYPES.MARKDOWN,
|
|
187
|
+
DOCUMENT_MIME_TYPES.CSV
|
|
188
|
+
];
|
|
189
|
+
var AI_CHAT_SUPPORTED_MIME_TYPES = [
|
|
190
|
+
...AI_CHAT_SUPPORTED_IMAGES,
|
|
191
|
+
...AI_CHAT_SUPPORTED_DOCUMENTS
|
|
192
|
+
];
|
|
193
|
+
var AI_CHAT_ACCEPTED_TYPES = AI_CHAT_SUPPORTED_MIME_TYPES.join(",");
|
|
194
|
+
var AI_CHAT_MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
195
|
+
var AI_CHAT_MAX_FILES = 5;
|
|
196
|
+
function isAIChatSupportedMimeType(mimeType) {
|
|
197
|
+
return AI_CHAT_SUPPORTED_MIME_TYPES.includes(mimeType);
|
|
198
|
+
}
|
|
199
|
+
|
|
1
200
|
// src/attribute-icons.ts
|
|
2
201
|
var DEFAULT_ATTRIBUTE_ICONS = {
|
|
3
202
|
text: "text-align-left",
|
|
@@ -23,6 +222,13 @@ function getDefaultAttributeIcon(type) {
|
|
|
23
222
|
return DEFAULT_ATTRIBUTE_ICONS[type] ?? "circle";
|
|
24
223
|
}
|
|
25
224
|
|
|
225
|
+
// src/cn.ts
|
|
226
|
+
import { clsx } from "clsx";
|
|
227
|
+
import { twMerge } from "tailwind-merge";
|
|
228
|
+
function cn(...inputs) {
|
|
229
|
+
return twMerge(clsx(inputs));
|
|
230
|
+
}
|
|
231
|
+
|
|
26
232
|
// src/colors.ts
|
|
27
233
|
var COLORS = {
|
|
28
234
|
// Neutral & Gray tones
|
|
@@ -977,6 +1183,50 @@ var isValidIso3 = (code) => {
|
|
|
977
1183
|
(country) => country.iso3.toUpperCase() === code.toUpperCase()
|
|
978
1184
|
);
|
|
979
1185
|
};
|
|
1186
|
+
var _displayNamesCache = /* @__PURE__ */ new Map();
|
|
1187
|
+
function _getDisplayNames(locales) {
|
|
1188
|
+
const key = locales.join("\0");
|
|
1189
|
+
const cached = _displayNamesCache.get(key);
|
|
1190
|
+
if (cached !== void 0) return cached;
|
|
1191
|
+
try {
|
|
1192
|
+
const dn = new Intl.DisplayNames(locales, { type: "region" });
|
|
1193
|
+
_displayNamesCache.set(key, dn);
|
|
1194
|
+
return dn;
|
|
1195
|
+
} catch {
|
|
1196
|
+
_displayNamesCache.set(key, null);
|
|
1197
|
+
return null;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
function getCountryDisplayName(iso2, locales = ["fr", "en"]) {
|
|
1201
|
+
const code = iso2.toUpperCase();
|
|
1202
|
+
const localeList = Array.isArray(locales) ? locales : [locales];
|
|
1203
|
+
const displayNames = _getDisplayNames(localeList);
|
|
1204
|
+
if (displayNames) {
|
|
1205
|
+
try {
|
|
1206
|
+
const name = displayNames.of(code);
|
|
1207
|
+
if (name) return name;
|
|
1208
|
+
} catch {
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
return COUNTRIES[code]?.name ?? code;
|
|
1212
|
+
}
|
|
1213
|
+
function getCountryDisplayNameByIso3(iso3, locales) {
|
|
1214
|
+
const country = getCountryByIso3(iso3);
|
|
1215
|
+
if (!country) return iso3;
|
|
1216
|
+
return getCountryDisplayName(country.iso2, locales);
|
|
1217
|
+
}
|
|
1218
|
+
function getSortedCountries(locale = "fr") {
|
|
1219
|
+
return getAllCountries().sort(
|
|
1220
|
+
(a, b) => getCountryDisplayName(a.iso2, locale).localeCompare(
|
|
1221
|
+
getCountryDisplayName(b.iso2, locale),
|
|
1222
|
+
locale
|
|
1223
|
+
)
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
function stripTrunkPrefix(phoneNumber, trunkPrefix) {
|
|
1227
|
+
if (!trunkPrefix) return phoneNumber;
|
|
1228
|
+
return phoneNumber.startsWith(trunkPrefix) ? phoneNumber.slice(trunkPrefix.length) : phoneNumber;
|
|
1229
|
+
}
|
|
980
1230
|
|
|
981
1231
|
// src/currencies.ts
|
|
982
1232
|
var CURRENCIES = {
|
|
@@ -2439,180 +2689,13 @@ var ICONS = [
|
|
|
2439
2689
|
"zero-waves",
|
|
2440
2690
|
"zero"
|
|
2441
2691
|
];
|
|
2442
|
-
|
|
2443
|
-
// src/mimeTypes.ts
|
|
2444
|
-
var IMAGE_MIME_TYPES = {
|
|
2445
|
-
JPEG: "image/jpeg",
|
|
2446
|
-
PNG: "image/png",
|
|
2447
|
-
GIF: "image/gif",
|
|
2448
|
-
WEBP: "image/webp",
|
|
2449
|
-
SVG: "image/svg+xml",
|
|
2450
|
-
BMP: "image/bmp",
|
|
2451
|
-
TIFF: "image/tiff",
|
|
2452
|
-
ICO: "image/x-icon",
|
|
2453
|
-
HEIC: "image/heic",
|
|
2454
|
-
HEIF: "image/heif"
|
|
2455
|
-
};
|
|
2456
|
-
var IMAGE_MIME_TYPES_ARRAY = Object.values(IMAGE_MIME_TYPES);
|
|
2457
|
-
var DOCUMENT_MIME_TYPES = {
|
|
2458
|
-
PDF: "application/pdf",
|
|
2459
|
-
DOC: "application/msword",
|
|
2460
|
-
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2461
|
-
XLS: "application/vnd.ms-excel",
|
|
2462
|
-
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
2463
|
-
PPT: "application/vnd.ms-powerpoint",
|
|
2464
|
-
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
2465
|
-
ODT: "application/vnd.oasis.opendocument.text",
|
|
2466
|
-
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
2467
|
-
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
2468
|
-
RTF: "application/rtf",
|
|
2469
|
-
TXT: "text/plain",
|
|
2470
|
-
CSV: "text/csv",
|
|
2471
|
-
MARKDOWN: "text/markdown"
|
|
2472
|
-
};
|
|
2473
|
-
var DOCUMENT_MIME_TYPES_ARRAY = Object.values(DOCUMENT_MIME_TYPES);
|
|
2474
|
-
var ARCHIVE_MIME_TYPES = {
|
|
2475
|
-
ZIP: "application/zip",
|
|
2476
|
-
RAR: "application/vnd.rar",
|
|
2477
|
-
TAR: "application/x-tar",
|
|
2478
|
-
GZIP: "application/gzip",
|
|
2479
|
-
"7Z": "application/x-7z-compressed",
|
|
2480
|
-
BZ2: "application/x-bzip2"
|
|
2481
|
-
};
|
|
2482
|
-
var ARCHIVE_MIME_TYPES_ARRAY = Object.values(ARCHIVE_MIME_TYPES);
|
|
2483
|
-
var AUDIO_MIME_TYPES = {
|
|
2484
|
-
MP3: "audio/mpeg",
|
|
2485
|
-
WAV: "audio/wav",
|
|
2486
|
-
OGG: "audio/ogg",
|
|
2487
|
-
AAC: "audio/aac",
|
|
2488
|
-
FLAC: "audio/flac",
|
|
2489
|
-
M4A: "audio/mp4",
|
|
2490
|
-
WEBM: "audio/webm"
|
|
2491
|
-
};
|
|
2492
|
-
var AUDIO_MIME_TYPES_ARRAY = Object.values(AUDIO_MIME_TYPES);
|
|
2493
|
-
var VIDEO_MIME_TYPES = {
|
|
2494
|
-
MP4: "video/mp4",
|
|
2495
|
-
WEBM: "video/webm",
|
|
2496
|
-
OGG: "video/ogg",
|
|
2497
|
-
AVI: "video/x-msvideo",
|
|
2498
|
-
MOV: "video/quicktime",
|
|
2499
|
-
MKV: "video/x-matroska",
|
|
2500
|
-
FLV: "video/x-flv",
|
|
2501
|
-
WMV: "video/x-ms-wmv",
|
|
2502
|
-
MPEG: "video/mpeg"
|
|
2503
|
-
};
|
|
2504
|
-
var VIDEO_MIME_TYPES_ARRAY = Object.values(VIDEO_MIME_TYPES);
|
|
2505
|
-
var CODE_MIME_TYPES = {
|
|
2506
|
-
JAVASCRIPT: "text/javascript",
|
|
2507
|
-
TYPESCRIPT: "text/typescript",
|
|
2508
|
-
JSON: "application/json",
|
|
2509
|
-
XML: "application/xml",
|
|
2510
|
-
HTML: "text/html",
|
|
2511
|
-
CSS: "text/css",
|
|
2512
|
-
PYTHON: "text/x-python",
|
|
2513
|
-
JAVA: "text/x-java-source",
|
|
2514
|
-
C: "text/x-c",
|
|
2515
|
-
CPP: "text/x-c++",
|
|
2516
|
-
YAML: "application/x-yaml",
|
|
2517
|
-
SQL: "application/sql"
|
|
2518
|
-
};
|
|
2519
|
-
var CODE_MIME_TYPES_ARRAY = Object.values(CODE_MIME_TYPES);
|
|
2520
|
-
var FONT_MIME_TYPES = {
|
|
2521
|
-
TTF: "font/ttf",
|
|
2522
|
-
OTF: "font/otf",
|
|
2523
|
-
WOFF: "font/woff",
|
|
2524
|
-
WOFF2: "font/woff2",
|
|
2525
|
-
EOT: "application/vnd.ms-fontobject"
|
|
2526
|
-
};
|
|
2527
|
-
var FONT_MIME_TYPES_ARRAY = Object.values(FONT_MIME_TYPES);
|
|
2528
|
-
var OTHER_MIME_TYPES = {
|
|
2529
|
-
BINARY: "application/octet-stream",
|
|
2530
|
-
FORM_DATA: "multipart/form-data",
|
|
2531
|
-
JSON_LD: "application/ld+json",
|
|
2532
|
-
XHTML: "application/xhtml+xml"
|
|
2533
|
-
};
|
|
2534
|
-
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
2535
|
-
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
2536
|
-
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
2537
|
-
var AUDIO = AUDIO_MIME_TYPES_ARRAY;
|
|
2538
|
-
var VIDEO = VIDEO_MIME_TYPES_ARRAY;
|
|
2539
|
-
var CODE = CODE_MIME_TYPES_ARRAY;
|
|
2540
|
-
var FONTS = FONT_MIME_TYPES_ARRAY;
|
|
2541
|
-
var WEB_IMAGES = [
|
|
2542
|
-
IMAGE_MIME_TYPES.JPEG,
|
|
2543
|
-
IMAGE_MIME_TYPES.PNG,
|
|
2544
|
-
IMAGE_MIME_TYPES.GIF,
|
|
2545
|
-
IMAGE_MIME_TYPES.WEBP
|
|
2546
|
-
];
|
|
2547
|
-
var OFFICE_DOCUMENTS = [
|
|
2548
|
-
DOCUMENT_MIME_TYPES.PDF,
|
|
2549
|
-
DOCUMENT_MIME_TYPES.DOC,
|
|
2550
|
-
DOCUMENT_MIME_TYPES.DOCX,
|
|
2551
|
-
DOCUMENT_MIME_TYPES.XLS,
|
|
2552
|
-
DOCUMENT_MIME_TYPES.XLSX,
|
|
2553
|
-
DOCUMENT_MIME_TYPES.PPT,
|
|
2554
|
-
DOCUMENT_MIME_TYPES.PPTX
|
|
2555
|
-
];
|
|
2556
|
-
var MEDIA = [...IMAGES, ...AUDIO, ...VIDEO];
|
|
2557
|
-
var ALL_MIME_TYPES = [
|
|
2558
|
-
...IMAGES,
|
|
2559
|
-
...DOCUMENTS,
|
|
2560
|
-
...ARCHIVES,
|
|
2561
|
-
...AUDIO,
|
|
2562
|
-
...VIDEO,
|
|
2563
|
-
...CODE,
|
|
2564
|
-
...FONTS,
|
|
2565
|
-
...Object.values(OTHER_MIME_TYPES)
|
|
2566
|
-
];
|
|
2567
|
-
var isImageMimeType = (mimeType) => {
|
|
2568
|
-
return IMAGES.includes(mimeType);
|
|
2569
|
-
};
|
|
2570
|
-
var isDocumentMimeType = (mimeType) => {
|
|
2571
|
-
return DOCUMENTS.includes(mimeType);
|
|
2572
|
-
};
|
|
2573
|
-
var isArchiveMimeType = (mimeType) => {
|
|
2574
|
-
return ARCHIVES.includes(mimeType);
|
|
2575
|
-
};
|
|
2576
|
-
var isAudioMimeType = (mimeType) => {
|
|
2577
|
-
return AUDIO.includes(mimeType);
|
|
2578
|
-
};
|
|
2579
|
-
var isVideoMimeType = (mimeType) => {
|
|
2580
|
-
return VIDEO.includes(mimeType);
|
|
2581
|
-
};
|
|
2582
|
-
var isCodeMimeType = (mimeType) => {
|
|
2583
|
-
return CODE.includes(mimeType);
|
|
2584
|
-
};
|
|
2585
|
-
var getExtensionFromMimeType = (mimeType) => {
|
|
2586
|
-
const mimeToExt = {
|
|
2587
|
-
// Images
|
|
2588
|
-
"image/jpeg": "jpg",
|
|
2589
|
-
"image/png": "png",
|
|
2590
|
-
"image/gif": "gif",
|
|
2591
|
-
"image/webp": "webp",
|
|
2592
|
-
"image/svg+xml": "svg",
|
|
2593
|
-
// Documents
|
|
2594
|
-
"application/pdf": "pdf",
|
|
2595
|
-
"application/msword": "doc",
|
|
2596
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
|
|
2597
|
-
"application/vnd.ms-excel": "xls",
|
|
2598
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
|
|
2599
|
-
// Archives
|
|
2600
|
-
"application/zip": "zip",
|
|
2601
|
-
"application/vnd.rar": "rar",
|
|
2602
|
-
// Audio
|
|
2603
|
-
"audio/mpeg": "mp3",
|
|
2604
|
-
"audio/wav": "wav",
|
|
2605
|
-
// Video
|
|
2606
|
-
"video/mp4": "mp4",
|
|
2607
|
-
"video/webm": "webm",
|
|
2608
|
-
// Text
|
|
2609
|
-
"text/plain": "txt",
|
|
2610
|
-
"text/csv": "csv",
|
|
2611
|
-
"application/json": "json"
|
|
2612
|
-
};
|
|
2613
|
-
return mimeToExt[mimeType] || null;
|
|
2614
|
-
};
|
|
2615
2692
|
export {
|
|
2693
|
+
AI_CHAT_ACCEPTED_TYPES,
|
|
2694
|
+
AI_CHAT_MAX_FILES,
|
|
2695
|
+
AI_CHAT_MAX_FILE_SIZE,
|
|
2696
|
+
AI_CHAT_SUPPORTED_DOCUMENTS,
|
|
2697
|
+
AI_CHAT_SUPPORTED_IMAGES,
|
|
2698
|
+
AI_CHAT_SUPPORTED_MIME_TYPES,
|
|
2616
2699
|
ALL_MIME_TYPES,
|
|
2617
2700
|
ARCHIVES,
|
|
2618
2701
|
ARCHIVE_MIME_TYPES,
|
|
@@ -2654,6 +2737,7 @@ export {
|
|
|
2654
2737
|
WEB_IMAGES,
|
|
2655
2738
|
bytesToGb,
|
|
2656
2739
|
bytesToMb,
|
|
2740
|
+
cn,
|
|
2657
2741
|
formatBytes,
|
|
2658
2742
|
gbToBytes,
|
|
2659
2743
|
getAllColors,
|
|
@@ -2664,6 +2748,8 @@ export {
|
|
|
2664
2748
|
getColorsByGroup,
|
|
2665
2749
|
getCountryByIso2,
|
|
2666
2750
|
getCountryByIso3,
|
|
2751
|
+
getCountryDisplayName,
|
|
2752
|
+
getCountryDisplayNameByIso3,
|
|
2667
2753
|
getCountryPhoneCode,
|
|
2668
2754
|
getCurrency,
|
|
2669
2755
|
getCurrencySymbol,
|
|
@@ -2671,6 +2757,8 @@ export {
|
|
|
2671
2757
|
getExtensionFromMimeType,
|
|
2672
2758
|
getPhoneMaxDigits,
|
|
2673
2759
|
getPhoneTrunkPrefix,
|
|
2760
|
+
getSortedCountries,
|
|
2761
|
+
isAIChatSupportedMimeType,
|
|
2674
2762
|
isArchiveMimeType,
|
|
2675
2763
|
isAudioMimeType,
|
|
2676
2764
|
isCodeMimeType,
|
|
@@ -2682,5 +2770,6 @@ export {
|
|
|
2682
2770
|
isValidIso3,
|
|
2683
2771
|
isVideoMimeType,
|
|
2684
2772
|
isWithinSizeLimit,
|
|
2685
|
-
mbToBytes
|
|
2773
|
+
mbToBytes,
|
|
2774
|
+
stripTrunkPrefix
|
|
2686
2775
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stndrds/constants",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-alpha.100",
|
|
4
4
|
"description": "Currency and country data with ISO codes",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"clsx": "^2.1.1",
|
|
20
|
+
"tailwind-merge": "^2.6.0"
|
|
21
|
+
},
|
|
18
22
|
"devDependencies": {
|
|
19
23
|
"@vitest/coverage-v8": "^2.1.9",
|
|
20
24
|
"@vitest/ui": "^2.1.9",
|