@stndrds/constants 1.0.0-alpha.192 → 1.0.0-alpha.194
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 +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +87 -0
- package/dist/index.mjs +86 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1825,4 +1825,21 @@ declare const isVideoMimeType: (mimeType: string) => boolean;
|
|
|
1825
1825
|
*/
|
|
1826
1826
|
declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
1827
1827
|
|
|
1828
|
-
|
|
1828
|
+
type FormatPresetGroup = "communication" | "identifiants" | "business_fr" | "design";
|
|
1829
|
+
type FormatPreset = {
|
|
1830
|
+
/** Stable identifier — referenced in tests and selection logic. */
|
|
1831
|
+
id: string;
|
|
1832
|
+
label: string;
|
|
1833
|
+
icon: IconName;
|
|
1834
|
+
group: FormatPresetGroup;
|
|
1835
|
+
storage: {
|
|
1836
|
+
kind: "format";
|
|
1837
|
+
value: "email" | "url" | "slug";
|
|
1838
|
+
} | {
|
|
1839
|
+
kind: "pattern";
|
|
1840
|
+
regex: string;
|
|
1841
|
+
};
|
|
1842
|
+
};
|
|
1843
|
+
declare const TEXT_FORMAT_PRESETS: readonly FormatPreset[];
|
|
1844
|
+
|
|
1845
|
+
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, type FormatPreset, type FormatPresetGroup, 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, TEXT_FORMAT_PRESETS, 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
|
@@ -1825,4 +1825,21 @@ declare const isVideoMimeType: (mimeType: string) => boolean;
|
|
|
1825
1825
|
*/
|
|
1826
1826
|
declare const isCodeMimeType: (mimeType: string) => boolean;
|
|
1827
1827
|
|
|
1828
|
-
|
|
1828
|
+
type FormatPresetGroup = "communication" | "identifiants" | "business_fr" | "design";
|
|
1829
|
+
type FormatPreset = {
|
|
1830
|
+
/** Stable identifier — referenced in tests and selection logic. */
|
|
1831
|
+
id: string;
|
|
1832
|
+
label: string;
|
|
1833
|
+
icon: IconName;
|
|
1834
|
+
group: FormatPresetGroup;
|
|
1835
|
+
storage: {
|
|
1836
|
+
kind: "format";
|
|
1837
|
+
value: "email" | "url" | "slug";
|
|
1838
|
+
} | {
|
|
1839
|
+
kind: "pattern";
|
|
1840
|
+
regex: string;
|
|
1841
|
+
};
|
|
1842
|
+
};
|
|
1843
|
+
declare const TEXT_FORMAT_PRESETS: readonly FormatPreset[];
|
|
1844
|
+
|
|
1845
|
+
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, type FormatPreset, type FormatPresetGroup, 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, TEXT_FORMAT_PRESETS, 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
|
@@ -60,6 +60,7 @@ __export(index_exports, {
|
|
|
60
60
|
OFFICE_DOCUMENTS: () => OFFICE_DOCUMENTS,
|
|
61
61
|
RECOMMENDED_MAX_SIZES: () => RECOMMENDED_MAX_SIZES,
|
|
62
62
|
STATUS_COLORS: () => STATUS_COLORS,
|
|
63
|
+
TEXT_FORMAT_PRESETS: () => TEXT_FORMAT_PRESETS,
|
|
63
64
|
VIDEO: () => VIDEO,
|
|
64
65
|
VIDEO_MIME_TYPES: () => VIDEO_MIME_TYPES,
|
|
65
66
|
VIDEO_MIME_TYPES_ARRAY: () => VIDEO_MIME_TYPES_ARRAY,
|
|
@@ -2749,6 +2750,91 @@ var ICONS = [
|
|
|
2749
2750
|
"zero-waves",
|
|
2750
2751
|
"zero"
|
|
2751
2752
|
];
|
|
2753
|
+
|
|
2754
|
+
// src/text-format-presets.ts
|
|
2755
|
+
var TEXT_FORMAT_PRESETS = [
|
|
2756
|
+
// Communication
|
|
2757
|
+
{
|
|
2758
|
+
id: "email",
|
|
2759
|
+
label: "Email",
|
|
2760
|
+
icon: "envelope",
|
|
2761
|
+
group: "communication",
|
|
2762
|
+
storage: { kind: "format", value: "email" }
|
|
2763
|
+
},
|
|
2764
|
+
{
|
|
2765
|
+
id: "url",
|
|
2766
|
+
label: "URL",
|
|
2767
|
+
icon: "link",
|
|
2768
|
+
group: "communication",
|
|
2769
|
+
storage: { kind: "format", value: "url" }
|
|
2770
|
+
},
|
|
2771
|
+
{
|
|
2772
|
+
id: "phone_fr",
|
|
2773
|
+
label: "T\xE9l\xE9phone (FR)",
|
|
2774
|
+
icon: "telephone",
|
|
2775
|
+
group: "communication",
|
|
2776
|
+
storage: { kind: "pattern", regex: "^0[1-9]([-. ]?[0-9]{2}){4}$" }
|
|
2777
|
+
},
|
|
2778
|
+
// Identifiants
|
|
2779
|
+
{
|
|
2780
|
+
id: "slug",
|
|
2781
|
+
label: "Slug (kebab-case)",
|
|
2782
|
+
icon: "hash",
|
|
2783
|
+
group: "identifiants",
|
|
2784
|
+
storage: { kind: "format", value: "slug" }
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
id: "alphanumeric",
|
|
2788
|
+
label: "Alphanum\xE9rique",
|
|
2789
|
+
icon: "type-text",
|
|
2790
|
+
group: "identifiants",
|
|
2791
|
+
storage: { kind: "pattern", regex: "^[a-zA-Z0-9]+$" }
|
|
2792
|
+
},
|
|
2793
|
+
// Business (FR)
|
|
2794
|
+
{
|
|
2795
|
+
id: "siren",
|
|
2796
|
+
label: "SIREN",
|
|
2797
|
+
icon: "building",
|
|
2798
|
+
group: "business_fr",
|
|
2799
|
+
storage: { kind: "pattern", regex: "^[0-9]{9}$" }
|
|
2800
|
+
},
|
|
2801
|
+
{
|
|
2802
|
+
id: "siret",
|
|
2803
|
+
label: "SIRET",
|
|
2804
|
+
icon: "building",
|
|
2805
|
+
group: "business_fr",
|
|
2806
|
+
storage: { kind: "pattern", regex: "^[0-9]{14}$" }
|
|
2807
|
+
},
|
|
2808
|
+
{
|
|
2809
|
+
id: "postcode_fr",
|
|
2810
|
+
label: "Code postal (FR)",
|
|
2811
|
+
icon: "location",
|
|
2812
|
+
group: "business_fr",
|
|
2813
|
+
storage: { kind: "pattern", regex: "^[0-9]{5}$" }
|
|
2814
|
+
},
|
|
2815
|
+
{
|
|
2816
|
+
id: "iban",
|
|
2817
|
+
label: "IBAN",
|
|
2818
|
+
icon: "credit-card",
|
|
2819
|
+
group: "business_fr",
|
|
2820
|
+
storage: { kind: "pattern", regex: "^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$" }
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
id: "vat_fr",
|
|
2824
|
+
label: "TVA intracom",
|
|
2825
|
+
icon: "credit-card",
|
|
2826
|
+
group: "business_fr",
|
|
2827
|
+
storage: { kind: "pattern", regex: "^[A-Z]{2}[0-9A-Z]{2,12}$" }
|
|
2828
|
+
},
|
|
2829
|
+
// Design
|
|
2830
|
+
{
|
|
2831
|
+
id: "hex_color",
|
|
2832
|
+
label: "Code couleur hex",
|
|
2833
|
+
icon: "paint",
|
|
2834
|
+
group: "design",
|
|
2835
|
+
storage: { kind: "pattern", regex: "^#[0-9A-Fa-f]{6}$" }
|
|
2836
|
+
}
|
|
2837
|
+
];
|
|
2752
2838
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2753
2839
|
0 && (module.exports = {
|
|
2754
2840
|
AI_CHAT_ACCEPTED_TYPES,
|
|
@@ -2791,6 +2877,7 @@ var ICONS = [
|
|
|
2791
2877
|
OFFICE_DOCUMENTS,
|
|
2792
2878
|
RECOMMENDED_MAX_SIZES,
|
|
2793
2879
|
STATUS_COLORS,
|
|
2880
|
+
TEXT_FORMAT_PRESETS,
|
|
2794
2881
|
VIDEO,
|
|
2795
2882
|
VIDEO_MIME_TYPES,
|
|
2796
2883
|
VIDEO_MIME_TYPES_ARRAY,
|
package/dist/index.mjs
CHANGED
|
@@ -2646,6 +2646,91 @@ var ICONS = [
|
|
|
2646
2646
|
"zero-waves",
|
|
2647
2647
|
"zero"
|
|
2648
2648
|
];
|
|
2649
|
+
|
|
2650
|
+
// src/text-format-presets.ts
|
|
2651
|
+
var TEXT_FORMAT_PRESETS = [
|
|
2652
|
+
// Communication
|
|
2653
|
+
{
|
|
2654
|
+
id: "email",
|
|
2655
|
+
label: "Email",
|
|
2656
|
+
icon: "envelope",
|
|
2657
|
+
group: "communication",
|
|
2658
|
+
storage: { kind: "format", value: "email" }
|
|
2659
|
+
},
|
|
2660
|
+
{
|
|
2661
|
+
id: "url",
|
|
2662
|
+
label: "URL",
|
|
2663
|
+
icon: "link",
|
|
2664
|
+
group: "communication",
|
|
2665
|
+
storage: { kind: "format", value: "url" }
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
id: "phone_fr",
|
|
2669
|
+
label: "T\xE9l\xE9phone (FR)",
|
|
2670
|
+
icon: "telephone",
|
|
2671
|
+
group: "communication",
|
|
2672
|
+
storage: { kind: "pattern", regex: "^0[1-9]([-. ]?[0-9]{2}){4}$" }
|
|
2673
|
+
},
|
|
2674
|
+
// Identifiants
|
|
2675
|
+
{
|
|
2676
|
+
id: "slug",
|
|
2677
|
+
label: "Slug (kebab-case)",
|
|
2678
|
+
icon: "hash",
|
|
2679
|
+
group: "identifiants",
|
|
2680
|
+
storage: { kind: "format", value: "slug" }
|
|
2681
|
+
},
|
|
2682
|
+
{
|
|
2683
|
+
id: "alphanumeric",
|
|
2684
|
+
label: "Alphanum\xE9rique",
|
|
2685
|
+
icon: "type-text",
|
|
2686
|
+
group: "identifiants",
|
|
2687
|
+
storage: { kind: "pattern", regex: "^[a-zA-Z0-9]+$" }
|
|
2688
|
+
},
|
|
2689
|
+
// Business (FR)
|
|
2690
|
+
{
|
|
2691
|
+
id: "siren",
|
|
2692
|
+
label: "SIREN",
|
|
2693
|
+
icon: "building",
|
|
2694
|
+
group: "business_fr",
|
|
2695
|
+
storage: { kind: "pattern", regex: "^[0-9]{9}$" }
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
id: "siret",
|
|
2699
|
+
label: "SIRET",
|
|
2700
|
+
icon: "building",
|
|
2701
|
+
group: "business_fr",
|
|
2702
|
+
storage: { kind: "pattern", regex: "^[0-9]{14}$" }
|
|
2703
|
+
},
|
|
2704
|
+
{
|
|
2705
|
+
id: "postcode_fr",
|
|
2706
|
+
label: "Code postal (FR)",
|
|
2707
|
+
icon: "location",
|
|
2708
|
+
group: "business_fr",
|
|
2709
|
+
storage: { kind: "pattern", regex: "^[0-9]{5}$" }
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
id: "iban",
|
|
2713
|
+
label: "IBAN",
|
|
2714
|
+
icon: "credit-card",
|
|
2715
|
+
group: "business_fr",
|
|
2716
|
+
storage: { kind: "pattern", regex: "^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$" }
|
|
2717
|
+
},
|
|
2718
|
+
{
|
|
2719
|
+
id: "vat_fr",
|
|
2720
|
+
label: "TVA intracom",
|
|
2721
|
+
icon: "credit-card",
|
|
2722
|
+
group: "business_fr",
|
|
2723
|
+
storage: { kind: "pattern", regex: "^[A-Z]{2}[0-9A-Z]{2,12}$" }
|
|
2724
|
+
},
|
|
2725
|
+
// Design
|
|
2726
|
+
{
|
|
2727
|
+
id: "hex_color",
|
|
2728
|
+
label: "Code couleur hex",
|
|
2729
|
+
icon: "paint",
|
|
2730
|
+
group: "design",
|
|
2731
|
+
storage: { kind: "pattern", regex: "^#[0-9A-Fa-f]{6}$" }
|
|
2732
|
+
}
|
|
2733
|
+
];
|
|
2649
2734
|
export {
|
|
2650
2735
|
AI_CHAT_ACCEPTED_TYPES,
|
|
2651
2736
|
AI_CHAT_MAX_FILES,
|
|
@@ -2687,6 +2772,7 @@ export {
|
|
|
2687
2772
|
OFFICE_DOCUMENTS,
|
|
2688
2773
|
RECOMMENDED_MAX_SIZES,
|
|
2689
2774
|
STATUS_COLORS,
|
|
2775
|
+
TEXT_FORMAT_PRESETS,
|
|
2690
2776
|
VIDEO,
|
|
2691
2777
|
VIDEO_MIME_TYPES,
|
|
2692
2778
|
VIDEO_MIME_TYPES_ARRAY,
|