@stndrds/constants 1.0.0-alpha.100 → 1.0.0-alpha.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -6
- package/dist/index.d.mts +10 -20
- package/dist/index.d.ts +10 -20
- package/dist/index.js +6 -58
- package/dist/index.mjs +6 -54
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ const code: CurrencyCode = "EUR"; // Type-safe
|
|
|
60
60
|
### File Sizes
|
|
61
61
|
|
|
62
62
|
```typescript
|
|
63
|
-
import { FILE_SIZE, RECOMMENDED_MAX_SIZES,
|
|
63
|
+
import { FILE_SIZE, RECOMMENDED_MAX_SIZES, mbToBytes } from "@stndrds/constants";
|
|
64
64
|
|
|
65
65
|
// Intuitive constants
|
|
66
66
|
const avatarMaxSize = FILE_SIZE.MB_2; // 2,097,152 bytes
|
|
@@ -74,7 +74,6 @@ const maxSize = RECOMMENDED_MAX_SIZES.VIDEO; // 500 MB
|
|
|
74
74
|
|
|
75
75
|
// Conversion utilities
|
|
76
76
|
const bytes = mbToBytes(5); // 5,242,880
|
|
77
|
-
const formatted = formatBytes(1048576); // "1 MB"
|
|
78
77
|
|
|
79
78
|
// Validation
|
|
80
79
|
import { isWithinSizeLimit } from "@stndrds/constants";
|
|
@@ -91,7 +90,6 @@ import {
|
|
|
91
90
|
WEB_IMAGES,
|
|
92
91
|
OFFICE_DOCUMENTS,
|
|
93
92
|
isImageMimeType,
|
|
94
|
-
getExtensionFromMimeType,
|
|
95
93
|
} from "@stndrds/constants";
|
|
96
94
|
|
|
97
95
|
// Individual MIME types
|
|
@@ -107,9 +105,6 @@ const officeFiles = OFFICE_DOCUMENTS; // [PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX
|
|
|
107
105
|
const isImage = isImageMimeType("image/jpeg"); // true
|
|
108
106
|
const isDoc = isDocumentMimeType("application/pdf"); // true
|
|
109
107
|
|
|
110
|
-
// Get extension
|
|
111
|
-
const ext = getExtensionFromMimeType("image/jpeg"); // "jpg"
|
|
112
|
-
|
|
113
108
|
// Type-safe MIME types
|
|
114
109
|
import type { MimeType, ImageMimeType } from "@stndrds/constants";
|
|
115
110
|
const type: MimeType = "image/jpeg"; // Type-safe
|
package/dist/index.d.mts
CHANGED
|
@@ -19,8 +19,6 @@ declare const AI_CHAT_ACCEPTED_TYPES: string;
|
|
|
19
19
|
declare const AI_CHAT_MAX_FILE_SIZE: number;
|
|
20
20
|
/** Maximum number of file attachments per message */
|
|
21
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
22
|
|
|
25
23
|
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"];
|
|
26
24
|
type IconName = (typeof ICONS)[number];
|
|
@@ -1006,7 +1004,6 @@ type CountryNumericCode = (typeof COUNTRIES)[CountryIso2]["numericCode"];
|
|
|
1006
1004
|
declare const getCountryByIso2: (iso2: string) => Country | undefined;
|
|
1007
1005
|
declare const getCountryByIso3: (iso3: string) => Country | undefined;
|
|
1008
1006
|
declare const getAllCountries: () => Country[];
|
|
1009
|
-
declare const getCountryPhoneCode: (iso2: string) => string;
|
|
1010
1007
|
declare const getPhoneMaxDigits: (iso2: string) => number;
|
|
1011
1008
|
declare const getPhoneTrunkPrefix: (iso2: string) => string;
|
|
1012
1009
|
/**
|
|
@@ -1579,16 +1576,19 @@ declare const RECOMMENDED_MAX_SIZES: {
|
|
|
1579
1576
|
readonly ARCHIVE: number;
|
|
1580
1577
|
};
|
|
1581
1578
|
/**
|
|
1582
|
-
*
|
|
1579
|
+
* Format a byte count into a human-readable string
|
|
1580
|
+
*
|
|
1581
|
+
* @param bytes - Number of bytes
|
|
1582
|
+
* @param decimals - Number of decimal places (default: 2)
|
|
1583
|
+
* @returns Formatted string, e.g. "1.5 MB"
|
|
1583
1584
|
*
|
|
1584
1585
|
* @example
|
|
1585
1586
|
* ```typescript
|
|
1586
|
-
* formatBytes(
|
|
1587
|
-
* formatBytes(
|
|
1588
|
-
* formatBytes(1073741824) // "1 GB"
|
|
1587
|
+
* formatBytes(1048576) // "1 MB"
|
|
1588
|
+
* formatBytes(1500, 1) // "1.5 KB"
|
|
1589
1589
|
* ```
|
|
1590
1590
|
*/
|
|
1591
|
-
declare
|
|
1591
|
+
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
1592
1592
|
/**
|
|
1593
1593
|
* Convert megabytes to bytes
|
|
1594
1594
|
*
|
|
@@ -1724,12 +1724,6 @@ declare const FONT_MIME_TYPES: {
|
|
|
1724
1724
|
readonly EOT: "application/vnd.ms-fontobject";
|
|
1725
1725
|
};
|
|
1726
1726
|
declare const FONT_MIME_TYPES_ARRAY: ("font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject")[];
|
|
1727
|
-
declare const OTHER_MIME_TYPES: {
|
|
1728
|
-
readonly BINARY: "application/octet-stream";
|
|
1729
|
-
readonly FORM_DATA: "multipart/form-data";
|
|
1730
|
-
readonly JSON_LD: "application/ld+json";
|
|
1731
|
-
readonly XHTML: "application/xhtml+xml";
|
|
1732
|
-
};
|
|
1733
1727
|
/**
|
|
1734
1728
|
* All image MIME types
|
|
1735
1729
|
*/
|
|
@@ -1773,7 +1767,7 @@ declare const MEDIA: readonly ("image/jpeg" | "image/png" | "image/gif" | "image
|
|
|
1773
1767
|
/**
|
|
1774
1768
|
* All MIME types combined
|
|
1775
1769
|
*/
|
|
1776
|
-
declare const ALL_MIME_TYPES: readonly ("image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "image/x-icon" | "image/heic" | "image/heif" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/rtf" | "text/plain" | "text/csv" | "text/markdown" | "application/zip" | "application/vnd.rar" | "application/x-tar" | "application/gzip" | "application/x-7z-compressed" | "application/x-bzip2" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/mp4" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "video/x-msvideo" | "video/quicktime" | "video/x-matroska" | "video/x-flv" | "video/x-ms-wmv" | "video/mpeg" | "text/javascript" | "text/typescript" | "application/json" | "application/xml" | "text/html" | "text/css" | "text/x-python" | "text/x-java-source" | "text/x-c" | "text/x-c++" | "application/x-yaml" | "application/sql" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject"
|
|
1770
|
+
declare const ALL_MIME_TYPES: readonly ("image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "image/x-icon" | "image/heic" | "image/heif" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/rtf" | "text/plain" | "text/csv" | "text/markdown" | "application/zip" | "application/vnd.rar" | "application/x-tar" | "application/gzip" | "application/x-7z-compressed" | "application/x-bzip2" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/mp4" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "video/x-msvideo" | "video/quicktime" | "video/x-matroska" | "video/x-flv" | "video/x-ms-wmv" | "video/mpeg" | "text/javascript" | "text/typescript" | "application/json" | "application/xml" | "text/html" | "text/css" | "text/x-python" | "text/x-java-source" | "text/x-c" | "text/x-c++" | "application/x-yaml" | "application/sql" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject")[];
|
|
1777
1771
|
/**
|
|
1778
1772
|
* Union type of all valid MIME types
|
|
1779
1773
|
*/
|
|
@@ -1830,9 +1824,5 @@ declare const isVideoMimeType: (mimeType: string) => boolean;
|
|
|
1830
1824
|
* Check if a MIME type is code
|
|
1831
1825
|
*/
|
|
1832
1826
|
declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
1833
|
-
/**
|
|
1834
|
-
* Get file extension from MIME type
|
|
1835
|
-
*/
|
|
1836
|
-
declare const getExtensionFromMimeType: (mimeType: string) => string | null;
|
|
1837
1827
|
|
|
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,
|
|
1828
|
+
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, 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, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,8 +19,6 @@ declare const AI_CHAT_ACCEPTED_TYPES: string;
|
|
|
19
19
|
declare const AI_CHAT_MAX_FILE_SIZE: number;
|
|
20
20
|
/** Maximum number of file attachments per message */
|
|
21
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
22
|
|
|
25
23
|
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"];
|
|
26
24
|
type IconName = (typeof ICONS)[number];
|
|
@@ -1006,7 +1004,6 @@ type CountryNumericCode = (typeof COUNTRIES)[CountryIso2]["numericCode"];
|
|
|
1006
1004
|
declare const getCountryByIso2: (iso2: string) => Country | undefined;
|
|
1007
1005
|
declare const getCountryByIso3: (iso3: string) => Country | undefined;
|
|
1008
1006
|
declare const getAllCountries: () => Country[];
|
|
1009
|
-
declare const getCountryPhoneCode: (iso2: string) => string;
|
|
1010
1007
|
declare const getPhoneMaxDigits: (iso2: string) => number;
|
|
1011
1008
|
declare const getPhoneTrunkPrefix: (iso2: string) => string;
|
|
1012
1009
|
/**
|
|
@@ -1579,16 +1576,19 @@ declare const RECOMMENDED_MAX_SIZES: {
|
|
|
1579
1576
|
readonly ARCHIVE: number;
|
|
1580
1577
|
};
|
|
1581
1578
|
/**
|
|
1582
|
-
*
|
|
1579
|
+
* Format a byte count into a human-readable string
|
|
1580
|
+
*
|
|
1581
|
+
* @param bytes - Number of bytes
|
|
1582
|
+
* @param decimals - Number of decimal places (default: 2)
|
|
1583
|
+
* @returns Formatted string, e.g. "1.5 MB"
|
|
1583
1584
|
*
|
|
1584
1585
|
* @example
|
|
1585
1586
|
* ```typescript
|
|
1586
|
-
* formatBytes(
|
|
1587
|
-
* formatBytes(
|
|
1588
|
-
* formatBytes(1073741824) // "1 GB"
|
|
1587
|
+
* formatBytes(1048576) // "1 MB"
|
|
1588
|
+
* formatBytes(1500, 1) // "1.5 KB"
|
|
1589
1589
|
* ```
|
|
1590
1590
|
*/
|
|
1591
|
-
declare
|
|
1591
|
+
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
1592
1592
|
/**
|
|
1593
1593
|
* Convert megabytes to bytes
|
|
1594
1594
|
*
|
|
@@ -1724,12 +1724,6 @@ declare const FONT_MIME_TYPES: {
|
|
|
1724
1724
|
readonly EOT: "application/vnd.ms-fontobject";
|
|
1725
1725
|
};
|
|
1726
1726
|
declare const FONT_MIME_TYPES_ARRAY: ("font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject")[];
|
|
1727
|
-
declare const OTHER_MIME_TYPES: {
|
|
1728
|
-
readonly BINARY: "application/octet-stream";
|
|
1729
|
-
readonly FORM_DATA: "multipart/form-data";
|
|
1730
|
-
readonly JSON_LD: "application/ld+json";
|
|
1731
|
-
readonly XHTML: "application/xhtml+xml";
|
|
1732
|
-
};
|
|
1733
1727
|
/**
|
|
1734
1728
|
* All image MIME types
|
|
1735
1729
|
*/
|
|
@@ -1773,7 +1767,7 @@ declare const MEDIA: readonly ("image/jpeg" | "image/png" | "image/gif" | "image
|
|
|
1773
1767
|
/**
|
|
1774
1768
|
* All MIME types combined
|
|
1775
1769
|
*/
|
|
1776
|
-
declare const ALL_MIME_TYPES: readonly ("image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "image/x-icon" | "image/heic" | "image/heif" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/rtf" | "text/plain" | "text/csv" | "text/markdown" | "application/zip" | "application/vnd.rar" | "application/x-tar" | "application/gzip" | "application/x-7z-compressed" | "application/x-bzip2" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/mp4" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "video/x-msvideo" | "video/quicktime" | "video/x-matroska" | "video/x-flv" | "video/x-ms-wmv" | "video/mpeg" | "text/javascript" | "text/typescript" | "application/json" | "application/xml" | "text/html" | "text/css" | "text/x-python" | "text/x-java-source" | "text/x-c" | "text/x-c++" | "application/x-yaml" | "application/sql" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject"
|
|
1770
|
+
declare const ALL_MIME_TYPES: readonly ("image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "image/x-icon" | "image/heic" | "image/heif" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.oasis.opendocument.text" | "application/vnd.oasis.opendocument.spreadsheet" | "application/vnd.oasis.opendocument.presentation" | "application/rtf" | "text/plain" | "text/csv" | "text/markdown" | "application/zip" | "application/vnd.rar" | "application/x-tar" | "application/gzip" | "application/x-7z-compressed" | "application/x-bzip2" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "audio/mp4" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "video/x-msvideo" | "video/quicktime" | "video/x-matroska" | "video/x-flv" | "video/x-ms-wmv" | "video/mpeg" | "text/javascript" | "text/typescript" | "application/json" | "application/xml" | "text/html" | "text/css" | "text/x-python" | "text/x-java-source" | "text/x-c" | "text/x-c++" | "application/x-yaml" | "application/sql" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "application/vnd.ms-fontobject")[];
|
|
1777
1771
|
/**
|
|
1778
1772
|
* Union type of all valid MIME types
|
|
1779
1773
|
*/
|
|
@@ -1830,9 +1824,5 @@ declare const isVideoMimeType: (mimeType: string) => boolean;
|
|
|
1830
1824
|
* Check if a MIME type is code
|
|
1831
1825
|
*/
|
|
1832
1826
|
declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
1833
|
-
/**
|
|
1834
|
-
* Get file extension from MIME type
|
|
1835
|
-
*/
|
|
1836
|
-
declare const getExtensionFromMimeType: (mimeType: string) => string | null;
|
|
1837
1827
|
|
|
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,
|
|
1828
|
+
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, 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, getCurrency, getCurrencySymbol, getDefaultAttributeIcon, getPhoneMaxDigits, getPhoneTrunkPrefix, getSortedCountries, isArchiveMimeType, isAudioMimeType, isCodeMimeType, isDocumentMimeType, isImageMimeType, isValidColorId, isValidCurrencyCode, isValidIso2, isValidIso3, isVideoMimeType, isWithinSizeLimit, mbToBytes, stripTrunkPrefix };
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,6 @@ __export(index_exports, {
|
|
|
58
58
|
MEDIA: () => MEDIA,
|
|
59
59
|
MEGABYTES: () => MEGABYTES,
|
|
60
60
|
OFFICE_DOCUMENTS: () => OFFICE_DOCUMENTS,
|
|
61
|
-
OTHER_MIME_TYPES: () => OTHER_MIME_TYPES,
|
|
62
61
|
RECOMMENDED_MAX_SIZES: () => RECOMMENDED_MAX_SIZES,
|
|
63
62
|
STATUS_COLORS: () => STATUS_COLORS,
|
|
64
63
|
VIDEO: () => VIDEO,
|
|
@@ -80,15 +79,12 @@ __export(index_exports, {
|
|
|
80
79
|
getCountryByIso3: () => getCountryByIso3,
|
|
81
80
|
getCountryDisplayName: () => getCountryDisplayName,
|
|
82
81
|
getCountryDisplayNameByIso3: () => getCountryDisplayNameByIso3,
|
|
83
|
-
getCountryPhoneCode: () => getCountryPhoneCode,
|
|
84
82
|
getCurrency: () => getCurrency,
|
|
85
83
|
getCurrencySymbol: () => getCurrencySymbol,
|
|
86
84
|
getDefaultAttributeIcon: () => getDefaultAttributeIcon,
|
|
87
|
-
getExtensionFromMimeType: () => getExtensionFromMimeType,
|
|
88
85
|
getPhoneMaxDigits: () => getPhoneMaxDigits,
|
|
89
86
|
getPhoneTrunkPrefix: () => getPhoneTrunkPrefix,
|
|
90
87
|
getSortedCountries: () => getSortedCountries,
|
|
91
|
-
isAIChatSupportedMimeType: () => isAIChatSupportedMimeType,
|
|
92
88
|
isArchiveMimeType: () => isArchiveMimeType,
|
|
93
89
|
isAudioMimeType: () => isAudioMimeType,
|
|
94
90
|
isCodeMimeType: () => isCodeMimeType,
|
|
@@ -190,12 +186,6 @@ var FONT_MIME_TYPES = {
|
|
|
190
186
|
EOT: "application/vnd.ms-fontobject"
|
|
191
187
|
};
|
|
192
188
|
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
189
|
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
200
190
|
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
201
191
|
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
@@ -226,8 +216,7 @@ var ALL_MIME_TYPES = [
|
|
|
226
216
|
...AUDIO,
|
|
227
217
|
...VIDEO,
|
|
228
218
|
...CODE,
|
|
229
|
-
...FONTS
|
|
230
|
-
...Object.values(OTHER_MIME_TYPES)
|
|
219
|
+
...FONTS
|
|
231
220
|
];
|
|
232
221
|
var isImageMimeType = (mimeType) => {
|
|
233
222
|
return IMAGES.includes(mimeType);
|
|
@@ -247,36 +236,6 @@ var isVideoMimeType = (mimeType) => {
|
|
|
247
236
|
var isCodeMimeType = (mimeType) => {
|
|
248
237
|
return CODE.includes(mimeType);
|
|
249
238
|
};
|
|
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
239
|
|
|
281
240
|
// src/aiChat.ts
|
|
282
241
|
var AI_CHAT_SUPPORTED_IMAGES = [
|
|
@@ -300,9 +259,6 @@ var AI_CHAT_SUPPORTED_MIME_TYPES = [
|
|
|
300
259
|
var AI_CHAT_ACCEPTED_TYPES = AI_CHAT_SUPPORTED_MIME_TYPES.join(",");
|
|
301
260
|
var AI_CHAT_MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
302
261
|
var AI_CHAT_MAX_FILES = 5;
|
|
303
|
-
function isAIChatSupportedMimeType(mimeType) {
|
|
304
|
-
return AI_CHAT_SUPPORTED_MIME_TYPES.includes(mimeType);
|
|
305
|
-
}
|
|
306
262
|
|
|
307
263
|
// src/attribute-icons.ts
|
|
308
264
|
var DEFAULT_ATTRIBUTE_ICONS = {
|
|
@@ -1273,9 +1229,6 @@ var getCountryByIso3 = (iso3) => {
|
|
|
1273
1229
|
var getAllCountries = () => {
|
|
1274
1230
|
return Object.values(COUNTRIES);
|
|
1275
1231
|
};
|
|
1276
|
-
var getCountryPhoneCode = (iso2) => {
|
|
1277
|
-
return COUNTRIES[iso2.toUpperCase()]?.phoneCode || "";
|
|
1278
|
-
};
|
|
1279
1232
|
var getPhoneMaxDigits = (iso2) => {
|
|
1280
1233
|
return COUNTRIES[iso2.toUpperCase()]?.phoneMaxDigits ?? 15;
|
|
1281
1234
|
};
|
|
@@ -1497,14 +1450,13 @@ var RECOMMENDED_MAX_SIZES = {
|
|
|
1497
1450
|
/** Large archives: 1 GB */
|
|
1498
1451
|
ARCHIVE: FILE_SIZE.GB_1
|
|
1499
1452
|
};
|
|
1500
|
-
|
|
1501
|
-
if (bytes === 0) return "0
|
|
1453
|
+
function formatBytes(bytes, decimals = 2) {
|
|
1454
|
+
if (bytes === 0) return "0 Bytes";
|
|
1502
1455
|
const k = 1024;
|
|
1503
|
-
const
|
|
1504
|
-
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
1456
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
|
|
1505
1457
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1506
|
-
return `${Number.parseFloat((bytes / k ** i).toFixed(
|
|
1507
|
-
}
|
|
1458
|
+
return `${Number.parseFloat((bytes / k ** i).toFixed(decimals))} ${sizes[i]}`;
|
|
1459
|
+
}
|
|
1508
1460
|
var mbToBytes = (mb) => {
|
|
1509
1461
|
return mb * 1024 * 1024;
|
|
1510
1462
|
};
|
|
@@ -2836,7 +2788,6 @@ var ICONS = [
|
|
|
2836
2788
|
MEDIA,
|
|
2837
2789
|
MEGABYTES,
|
|
2838
2790
|
OFFICE_DOCUMENTS,
|
|
2839
|
-
OTHER_MIME_TYPES,
|
|
2840
2791
|
RECOMMENDED_MAX_SIZES,
|
|
2841
2792
|
STATUS_COLORS,
|
|
2842
2793
|
VIDEO,
|
|
@@ -2858,15 +2809,12 @@ var ICONS = [
|
|
|
2858
2809
|
getCountryByIso3,
|
|
2859
2810
|
getCountryDisplayName,
|
|
2860
2811
|
getCountryDisplayNameByIso3,
|
|
2861
|
-
getCountryPhoneCode,
|
|
2862
2812
|
getCurrency,
|
|
2863
2813
|
getCurrencySymbol,
|
|
2864
2814
|
getDefaultAttributeIcon,
|
|
2865
|
-
getExtensionFromMimeType,
|
|
2866
2815
|
getPhoneMaxDigits,
|
|
2867
2816
|
getPhoneTrunkPrefix,
|
|
2868
2817
|
getSortedCountries,
|
|
2869
|
-
isAIChatSupportedMimeType,
|
|
2870
2818
|
isArchiveMimeType,
|
|
2871
2819
|
isAudioMimeType,
|
|
2872
2820
|
isCodeMimeType,
|
package/dist/index.mjs
CHANGED
|
@@ -83,12 +83,6 @@ var FONT_MIME_TYPES = {
|
|
|
83
83
|
EOT: "application/vnd.ms-fontobject"
|
|
84
84
|
};
|
|
85
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
86
|
var IMAGES = IMAGE_MIME_TYPES_ARRAY;
|
|
93
87
|
var DOCUMENTS = DOCUMENT_MIME_TYPES_ARRAY;
|
|
94
88
|
var ARCHIVES = ARCHIVE_MIME_TYPES_ARRAY;
|
|
@@ -119,8 +113,7 @@ var ALL_MIME_TYPES = [
|
|
|
119
113
|
...AUDIO,
|
|
120
114
|
...VIDEO,
|
|
121
115
|
...CODE,
|
|
122
|
-
...FONTS
|
|
123
|
-
...Object.values(OTHER_MIME_TYPES)
|
|
116
|
+
...FONTS
|
|
124
117
|
];
|
|
125
118
|
var isImageMimeType = (mimeType) => {
|
|
126
119
|
return IMAGES.includes(mimeType);
|
|
@@ -140,36 +133,6 @@ var isVideoMimeType = (mimeType) => {
|
|
|
140
133
|
var isCodeMimeType = (mimeType) => {
|
|
141
134
|
return CODE.includes(mimeType);
|
|
142
135
|
};
|
|
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
136
|
|
|
174
137
|
// src/aiChat.ts
|
|
175
138
|
var AI_CHAT_SUPPORTED_IMAGES = [
|
|
@@ -193,9 +156,6 @@ var AI_CHAT_SUPPORTED_MIME_TYPES = [
|
|
|
193
156
|
var AI_CHAT_ACCEPTED_TYPES = AI_CHAT_SUPPORTED_MIME_TYPES.join(",");
|
|
194
157
|
var AI_CHAT_MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
195
158
|
var AI_CHAT_MAX_FILES = 5;
|
|
196
|
-
function isAIChatSupportedMimeType(mimeType) {
|
|
197
|
-
return AI_CHAT_SUPPORTED_MIME_TYPES.includes(mimeType);
|
|
198
|
-
}
|
|
199
159
|
|
|
200
160
|
// src/attribute-icons.ts
|
|
201
161
|
var DEFAULT_ATTRIBUTE_ICONS = {
|
|
@@ -1166,9 +1126,6 @@ var getCountryByIso3 = (iso3) => {
|
|
|
1166
1126
|
var getAllCountries = () => {
|
|
1167
1127
|
return Object.values(COUNTRIES);
|
|
1168
1128
|
};
|
|
1169
|
-
var getCountryPhoneCode = (iso2) => {
|
|
1170
|
-
return COUNTRIES[iso2.toUpperCase()]?.phoneCode || "";
|
|
1171
|
-
};
|
|
1172
1129
|
var getPhoneMaxDigits = (iso2) => {
|
|
1173
1130
|
return COUNTRIES[iso2.toUpperCase()]?.phoneMaxDigits ?? 15;
|
|
1174
1131
|
};
|
|
@@ -1390,14 +1347,13 @@ var RECOMMENDED_MAX_SIZES = {
|
|
|
1390
1347
|
/** Large archives: 1 GB */
|
|
1391
1348
|
ARCHIVE: FILE_SIZE.GB_1
|
|
1392
1349
|
};
|
|
1393
|
-
|
|
1394
|
-
if (bytes === 0) return "0
|
|
1350
|
+
function formatBytes(bytes, decimals = 2) {
|
|
1351
|
+
if (bytes === 0) return "0 Bytes";
|
|
1395
1352
|
const k = 1024;
|
|
1396
|
-
const
|
|
1397
|
-
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
1353
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
|
|
1398
1354
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
1399
|
-
return `${Number.parseFloat((bytes / k ** i).toFixed(
|
|
1400
|
-
}
|
|
1355
|
+
return `${Number.parseFloat((bytes / k ** i).toFixed(decimals))} ${sizes[i]}`;
|
|
1356
|
+
}
|
|
1401
1357
|
var mbToBytes = (mb) => {
|
|
1402
1358
|
return mb * 1024 * 1024;
|
|
1403
1359
|
};
|
|
@@ -2728,7 +2684,6 @@ export {
|
|
|
2728
2684
|
MEDIA,
|
|
2729
2685
|
MEGABYTES,
|
|
2730
2686
|
OFFICE_DOCUMENTS,
|
|
2731
|
-
OTHER_MIME_TYPES,
|
|
2732
2687
|
RECOMMENDED_MAX_SIZES,
|
|
2733
2688
|
STATUS_COLORS,
|
|
2734
2689
|
VIDEO,
|
|
@@ -2750,15 +2705,12 @@ export {
|
|
|
2750
2705
|
getCountryByIso3,
|
|
2751
2706
|
getCountryDisplayName,
|
|
2752
2707
|
getCountryDisplayNameByIso3,
|
|
2753
|
-
getCountryPhoneCode,
|
|
2754
2708
|
getCurrency,
|
|
2755
2709
|
getCurrencySymbol,
|
|
2756
2710
|
getDefaultAttributeIcon,
|
|
2757
|
-
getExtensionFromMimeType,
|
|
2758
2711
|
getPhoneMaxDigits,
|
|
2759
2712
|
getPhoneTrunkPrefix,
|
|
2760
2713
|
getSortedCountries,
|
|
2761
|
-
isAIChatSupportedMimeType,
|
|
2762
2714
|
isArchiveMimeType,
|
|
2763
2715
|
isAudioMimeType,
|
|
2764
2716
|
isCodeMimeType,
|