@limetech/lime-elements 37.17.3 → 37.19.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/file-metadata-062e1135.js +58 -0
- package/dist/cjs/file-metadata-062e1135.js.map +1 -0
- package/dist/{esm/file-metadata-9a4780e2.js → cjs/icons-8ecb9740.js} +36 -50
- package/dist/cjs/icons-8ecb9740.js.map +1 -0
- package/dist/cjs/index.cjs.js +6 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +2 -1
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +2 -1
- package/dist/cjs/limel-file.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js +38 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
- package/dist/collection/components/file/icon-background-colors.js +11 -0
- package/dist/collection/components/file/icon-background-colors.js.map +1 -1
- package/dist/collection/components/file/icon-fill-colors.js +11 -0
- package/dist/collection/components/file/icon-fill-colors.js.map +1 -1
- package/dist/collection/components/file/icons.js +9 -0
- package/dist/collection/components/file/icons.js.map +1 -1
- package/dist/collection/components/file/index.js +4 -0
- package/dist/collection/components/file/index.js.map +1 -0
- package/dist/collection/components/text-editor/menu/default-menu.js +35 -0
- package/dist/collection/components/text-editor/menu/default-menu.js.map +1 -0
- package/dist/collection/components/text-editor/text-editor.js +6 -1
- package/dist/collection/components/text-editor/text-editor.js.map +1 -1
- package/dist/collection/interface.js +3 -2
- package/dist/collection/interface.js.map +1 -1
- package/dist/esm/file-metadata-f5ba6228.js +53 -0
- package/dist/esm/file-metadata-f5ba6228.js.map +1 -0
- package/dist/{cjs/file-metadata-f259bba5.js → esm/icons-d4830de7.js} +33 -56
- package/dist/esm/icons-d4830de7.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/limel-file-dropzone_2.entry.js +2 -1
- package/dist/esm/limel-file-dropzone_2.entry.js.map +1 -1
- package/dist/esm/limel-file.entry.js +2 -1
- package/dist/esm/limel-file.entry.js.map +1 -1
- package/dist/esm/limel-text-editor.entry.js +38 -1
- package/dist/esm/limel-text-editor.entry.js.map +1 -1
- package/dist/lime-elements/index.esm.js +1 -1
- package/dist/lime-elements/index.esm.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-35e7a41b.js +2 -0
- package/dist/lime-elements/p-35e7a41b.js.map +1 -0
- package/dist/lime-elements/p-48b9449e.js +2 -0
- package/dist/lime-elements/p-48b9449e.js.map +1 -0
- package/dist/lime-elements/p-6c36f090.entry.js +2 -0
- package/dist/lime-elements/{p-fc91537a.entry.js.map → p-6c36f090.entry.js.map} +1 -1
- package/dist/lime-elements/{p-6a0eac83.entry.js → p-7968bfa0.entry.js} +2 -2
- package/dist/lime-elements/p-7968bfa0.entry.js.map +1 -0
- package/dist/lime-elements/p-a1ffb47f.entry.js +2 -0
- package/dist/lime-elements/{p-c9ffb1b4.entry.js.map → p-a1ffb47f.entry.js.map} +1 -1
- package/dist/types/components/file/icon-background-colors.d.ts +11 -0
- package/dist/types/components/file/icon-fill-colors.d.ts +11 -0
- package/dist/types/components/file/icons.d.ts +9 -0
- package/dist/types/components/file/index.d.ts +4 -0
- package/dist/types/components/text-editor/menu/default-menu.d.ts +11 -0
- package/dist/types/interface.d.ts +3 -2
- package/package.json +3 -3
- package/dist/cjs/file-metadata-f259bba5.js.map +0 -1
- package/dist/esm/file-metadata-9a4780e2.js.map +0 -1
- package/dist/lime-elements/p-6a0eac83.entry.js.map +0 -1
- package/dist/lime-elements/p-8bc1584b.js +0 -2
- package/dist/lime-elements/p-8bc1584b.js.map +0 -1
- package/dist/lime-elements/p-c9ffb1b4.entry.js +0 -2
- package/dist/lime-elements/p-fc91537a.entry.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g as o,a as r,b as t}from"./p-2f777fdb.js";const c="rgba(var(--color-gray-lighter), 0.4)";const a="rgba(var(--color-cyan-lighter), 0.4)";const s="rgba(var(--color-gray-lighter), 0.4)";const e="rgba(var(--color-blue-lighter), 0.4)";const n="rgba(var(--color-yellow-lighter), 0.4)";const l="rgba(var(--color-green-lighter), 0.4)";const g="rgba(var(--color-coral-lighter), 0.4)";const p="rgba(var(--color-sky-lighter), 0.4)";const i="rgba(var(--color-lime-lighter), 0.4)";const d="rgba(var(--color-magenta-lighter), 0.4)";const m="rgba(var(--color-blue-lighter), 0.4)";const b="rgba(var(--color-orange-lighter), 0.4)";const v="rgba(var(--color-green-lighter), 0.4)";const f="rgba(var(--color-indigo-lighter), 0.4)";const h="rgba(var(--color-red-lighter), 0.4)";const u="rgba(var(--color-orange-lighter), 0.4)";const x="rgba(var(--color-yellow-lighter), 0.4)";const k="rgba(var(--color-red-lighter), 0.4)";const y="rgba(var(--color-glaucous-lighter), 0.4)";const _={msg:x,ics:a,ical:a,icalendar:a,ifb:a,email:s,eml:s,oft:s,ost:s,emlx:s,html:e,xml:e,txt:n,rtf:n,dot:p,doc:p,docx:p,dotx:p,docm:p,dotm:p,odt:b,pages:b,pdf:k,ppt:g,pot:g,pps:g,pptx:g,pptm:g,potx:g,potm:g,ppam:g,ppsx:g,ppsm:g,sldx:g,sldm:g,odp:m,key:m,xls:l,xlsx:l,csv:c,numbers:v,bmp:i,jpg:i,jpeg:i,heic:i,png:i,gif:i,psd:m,ai:b,svg:d,svgz:d,ep:d,eps:d,sketch:d,mp3:f,wav:f,wma:f,ogg:f,flv:h,h264:h,mov:h,mp4:h,mwv:h,zip:u,"7z":u,rar:u,json:y,yaml:y,sql:y,db:y,dbf:y};function w(o){return _[o.toLowerCase()]||c}const j="rgb(var(--color-gray-dark))";const z="rgb(var(--color-cyan-dark))";const q="rgb(var(--color-gray-dark))";const D="rgb(var(--color-blue-dark))";const F="rgb(var(--color-yellow-darker))";const P="rgb(var(--color-green-dark))";const A="rgb(var(--color-coral-dark))";const B="rgb(var(--color-sky-dark))";const C="rgb(var(--color-lime-dark))";const E="rgb(var(--color-magenta-dark))";const G="rgb(var(--color-blue-dark))";const H="rgb(var(--color-orange-dark))";const I="rgb(var(--color-green-dark))";const J="rgb(var(--color-indigo-dark))";const K="rgb(var(--color-red-dark))";const L="rgb(var(--color-brown-default))";const M="rgb(var(--color-yellow-dark))";const N="rgb(var(--color-red-dark))";const O="rgb(var(--color-glaucous-dark))";const Q={msg:M,ics:z,ical:z,icalendar:z,ifb:z,email:q,eml:q,oft:q,ost:q,emlx:q,html:D,xml:D,txt:F,rtf:F,dot:B,doc:B,docx:B,dotx:B,docm:B,dotm:B,odt:H,pages:H,pdf:N,ppt:A,pot:A,pps:A,pptx:A,pptm:A,potx:A,potm:A,ppam:A,ppsx:A,ppsm:A,sldx:A,sldm:A,odp:G,key:G,xls:P,xlsx:P,csv:j,numbers:I,bmp:C,jpg:C,jpeg:C,heic:C,png:C,gif:C,psd:G,ai:H,svg:E,svgz:E,ep:E,eps:E,sketch:E,mp3:J,wav:J,wma:J,ogg:J,flv:K,h264:K,mov:K,mp4:K,mwv:K,zip:L,"7z":L,rar:L,json:O,yaml:O,sql:O,db:O,dbf:O};function R(o){return Q[o.toLowerCase()]||j}const S="file";const T="tear_off_calendar";const U="email";const V="internet";const W="text_box";const X="ms_excel_copyrighted";const Y="ms_word_copyrighted";const Z="ms_powerpoint_copyrighted";const $="picture";const oo="camera";const ro="vector";const to="presentation_filled";const co="overview_pages_2";const ao="data_sheet";const so="audio_wave";const eo="video_file";const no="condom_package";const lo="ms_outlook_copyrighted";const go="database";const po={msg:lo,ics:T,ical:T,icalendar:T,ifb:T,email:U,eml:U,oft:U,ost:U,emlx:U,html:V,xml:V,txt:W,rtf:W,dot:Y,doc:Y,docx:Y,dotx:Y,docm:Y,dotm:Y,odt:co,pages:co,pdf:"PDF_2",ppt:Z,pot:Z,pps:Z,pptx:Z,pptm:Z,potx:Z,potm:Z,ppam:Z,ppsx:Z,ppsm:Z,sldx:Z,sldm:Z,odp:to,key:to,xls:X,xlsx:X,csv:ao,numbers:ao,jpg:oo,jpeg:oo,heic:oo,bmp:$,png:$,gif:$,psd:"adobe_photoshop_copyrighted",ai:"adobe_illustrator_copyrighted",svg:ro,svgz:ro,ep:ro,eps:ro,sketch:ro,mp3:so,wav:so,wma:so,ogg:so,avi:eo,flv:eo,h264:eo,mov:eo,mp4:eo,mwv:eo,zip:no,"7z":no,rar:no,json:"json",yaml:go,sql:go,db:go,dbf:go};function io(o){return po[o.toLowerCase()]||S}function mo(r){const t=o(r.icon);if(t){return t}const c=ho(r);if(!c){return}return io(c)}function bo(o){const t=r(o.icon,o.iconColor);if(t){return t}const c=ho(o);if(!c){return}return R(c)}function vo(o){const r=t(o.icon,o.iconBackgroundColor);if(r){return r}const c=ho(o);if(!c){return}return w(c)}function fo(r){const t=o(r.icon);if(t){return t}return ho(r)}function ho(o){if(!o){return}return o.filename.split(".").pop()}export{fo as a,bo as b,vo as c,mo as g};
|
|
2
|
-
//# sourceMappingURL=p-8bc1584b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_ICON_BACKGROUND_COLOR","CALENDAR_ICON_BACKGROUND_COLOR","EMAIL_ICON_BACKGROUND_COLOR","HTML_ICON_BACKGROUND_COLOR","TEXT_ICON_BACKGROUND_COLOR","EXCEL_ICON_BACKGROUND_COLOR","POWERPOINT_ICON_BACKGROUND_COLOR","WORD_ICON_BACKGROUND_COLOR","IMAGE_ICON_BACKGROUND_COLOR","VECTOR_GRAPHIC_ICON_BACKGROUND_COLOR","PRESENTATION_BACKGROUND_COLOR","DOCUMENT_ICON_BACKGROUND_COLOR","SPREADSHEET_ICON_BACKGROUND_COLOR","AUDIO_ICON_BACKGROUND_COLOR","VIDEO_ICON_BACKGROUND_COLOR","COMPRESSED_ICON_BACKGROUND_COLOR","MESSAGE_ICON_BACKGROUND_COLOR","PDF_ICON_BACKGROUND_COLOR","DATA_ICON_BACKGROUND_COLOR","filetypeBackgroundColorTable","msg","ics","ical","icalendar","ifb","email","eml","oft","ost","emlx","html","xml","txt","rtf","dot","doc","docx","dotx","docm","dotm","odt","pages","pdf","ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm","odp","key","xls","xlsx","csv","numbers","bmp","jpg","jpeg","heic","png","gif","psd","ai","svg","svgz","ep","eps","sketch","mp3","wav","wma","ogg","flv","h264","mov","mp4","mwv","zip","rar","json","yaml","sql","db","dbf","getIconBackgroundColorForFile","extension","toLowerCase","DEFAULT_ICON_FILL_COLOR","CALENDAR_ICON_FILL_COLOR","EMAIL_ICON_FILL_COLOR","HTML_ICON_FILL_COLOR","TEXT_ICON_FILL_COLOR","EXCEL_ICON_FILL_COLOR","POWERPOINT_ICON_FILL_COLOR","WORD_ICON_FILL_COLOR","IMAGE_ICON_FILL_COLOR","VECTOR_GRAPHIC_FILL_COLOR","PRESENTATION_ICON_FILL_COLOR","DOCUMENT_ICON_FILL_COLOR","SPREADSHEET_ICON_FILL_COLOR","AUDIO_ICON_FILL_COLOR","VIDEO_ICON_FILL_COLOR","COMPRESSED_ICON_FILL_COLOR","MESSAGE_ICON_FILL_COLOR","PDF_ICON_FILL_COLOR","DATA_ICON_FILL_COLOR","filetypeFillColorTable","getIconFillColorForFile","DEFAULT_ICON","CALENDAR_ICON","EMAIL_ICON","HTML_ICON","TEXT_ICON","EXCEL_ICON","WORD_ICON","POWERPOINT_ICON","IMAGE_ICON","PHOTO_ICON","VECTOR_GRAPHIC_ICON","PRESENTATION_ICON","DOCUMENT_ICON","SPREADSHEET_ICON","AUDIO_ICON","VIDEO_ICON","COMPRESSED_ICON","MESSAGE_ICON","DATA_ICON","filetypeIconTable","avi","getIconForFile","getFileIcon","file","name","getIconName","icon","getExtension","getFileColor","color","getIconColor","iconColor","getFileBackgroundColor","backgroundColor","getIconBackgroundColor","iconBackgroundColor","getFileExtensionTitle","filename","split","pop"],"sources":["./src/components/file/icon-background-colors.ts","./src/components/file/icon-fill-colors.ts","./src/components/file/icons.ts","./src/util/file-metadata.ts"],"sourcesContent":["const DEFAULT_ICON_BACKGROUND_COLOR = 'rgba(var(--color-gray-lighter), 0.4)';\nconst CALENDAR_ICON_BACKGROUND_COLOR = 'rgba(var(--color-cyan-lighter), 0.4)';\nconst EMAIL_ICON_BACKGROUND_COLOR = 'rgba(var(--color-gray-lighter), 0.4)';\nconst HTML_ICON_BACKGROUND_COLOR = 'rgba(var(--color-blue-lighter), 0.4)';\nconst TEXT_ICON_BACKGROUND_COLOR = 'rgba(var(--color-yellow-lighter), 0.4)';\nconst EXCEL_ICON_BACKGROUND_COLOR = 'rgba(var(--color-green-lighter), 0.4)';\nconst POWERPOINT_ICON_BACKGROUND_COLOR =\n 'rgba(var(--color-coral-lighter), 0.4)';\nconst WORD_ICON_BACKGROUND_COLOR = 'rgba(var(--color-sky-lighter), 0.4)';\nconst IMAGE_ICON_BACKGROUND_COLOR = 'rgba(var(--color-lime-lighter), 0.4)';\nconst VECTOR_GRAPHIC_ICON_BACKGROUND_COLOR =\n 'rgba(var(--color-magenta-lighter), 0.4)';\nconst PRESENTATION_BACKGROUND_COLOR = 'rgba(var(--color-blue-lighter), 0.4)';\nconst DOCUMENT_ICON_BACKGROUND_COLOR = 'rgba(var(--color-orange-lighter), 0.4)';\nconst SPREADSHEET_ICON_BACKGROUND_COLOR =\n 'rgba(var(--color-green-lighter), 0.4)';\nconst AUDIO_ICON_BACKGROUND_COLOR = 'rgba(var(--color-indigo-lighter), 0.4)';\nconst VIDEO_ICON_BACKGROUND_COLOR = 'rgba(var(--color-red-lighter), 0.4)';\nconst COMPRESSED_ICON_BACKGROUND_COLOR =\n 'rgba(var(--color-orange-lighter), 0.4)';\nconst MESSAGE_ICON_BACKGROUND_COLOR = 'rgba(var(--color-yellow-lighter), 0.4)';\nconst PDF_ICON_BACKGROUND_COLOR = 'rgba(var(--color-red-lighter), 0.4)';\nconst DATA_ICON_BACKGROUND_COLOR = 'rgba(var(--color-glaucous-lighter), 0.4)';\n\nconst filetypeBackgroundColorTable: Record<string, string> = {\n // Message\n msg: MESSAGE_ICON_BACKGROUND_COLOR,\n\n // Calendar\n ics: CALENDAR_ICON_BACKGROUND_COLOR,\n ical: CALENDAR_ICON_BACKGROUND_COLOR,\n icalendar: CALENDAR_ICON_BACKGROUND_COLOR,\n\n // Email\n ifb: CALENDAR_ICON_BACKGROUND_COLOR,\n email: EMAIL_ICON_BACKGROUND_COLOR,\n eml: EMAIL_ICON_BACKGROUND_COLOR,\n oft: EMAIL_ICON_BACKGROUND_COLOR,\n ost: EMAIL_ICON_BACKGROUND_COLOR,\n emlx: EMAIL_ICON_BACKGROUND_COLOR,\n\n // Web\n html: HTML_ICON_BACKGROUND_COLOR,\n xml: HTML_ICON_BACKGROUND_COLOR,\n\n // Editable text\n txt: TEXT_ICON_BACKGROUND_COLOR,\n rtf: TEXT_ICON_BACKGROUND_COLOR,\n\n // Editable document\n dot: WORD_ICON_BACKGROUND_COLOR,\n doc: WORD_ICON_BACKGROUND_COLOR,\n docx: WORD_ICON_BACKGROUND_COLOR,\n dotx: WORD_ICON_BACKGROUND_COLOR,\n docm: WORD_ICON_BACKGROUND_COLOR,\n dotm: WORD_ICON_BACKGROUND_COLOR,\n odt: DOCUMENT_ICON_BACKGROUND_COLOR,\n pages: DOCUMENT_ICON_BACKGROUND_COLOR,\n\n // Portable document\n pdf: PDF_ICON_BACKGROUND_COLOR,\n\n // Presentation\n ppt: POWERPOINT_ICON_BACKGROUND_COLOR,\n pot: POWERPOINT_ICON_BACKGROUND_COLOR,\n pps: POWERPOINT_ICON_BACKGROUND_COLOR,\n pptx: POWERPOINT_ICON_BACKGROUND_COLOR,\n pptm: POWERPOINT_ICON_BACKGROUND_COLOR,\n potx: POWERPOINT_ICON_BACKGROUND_COLOR,\n potm: POWERPOINT_ICON_BACKGROUND_COLOR,\n ppam: POWERPOINT_ICON_BACKGROUND_COLOR,\n ppsx: POWERPOINT_ICON_BACKGROUND_COLOR,\n ppsm: POWERPOINT_ICON_BACKGROUND_COLOR,\n sldx: POWERPOINT_ICON_BACKGROUND_COLOR,\n sldm: POWERPOINT_ICON_BACKGROUND_COLOR,\n odp: PRESENTATION_BACKGROUND_COLOR,\n key: PRESENTATION_BACKGROUND_COLOR,\n\n // Spreadsheet\n xls: EXCEL_ICON_BACKGROUND_COLOR,\n xlsx: EXCEL_ICON_BACKGROUND_COLOR,\n csv: DEFAULT_ICON_BACKGROUND_COLOR,\n numbers: SPREADSHEET_ICON_BACKGROUND_COLOR,\n\n // Image\n bmp: IMAGE_ICON_BACKGROUND_COLOR,\n jpg: IMAGE_ICON_BACKGROUND_COLOR,\n jpeg: IMAGE_ICON_BACKGROUND_COLOR,\n heic: IMAGE_ICON_BACKGROUND_COLOR,\n png: IMAGE_ICON_BACKGROUND_COLOR,\n gif: IMAGE_ICON_BACKGROUND_COLOR,\n\n // Editable image\n psd: PRESENTATION_BACKGROUND_COLOR,\n ai: DOCUMENT_ICON_BACKGROUND_COLOR,\n\n // Vector graphic\n svg: VECTOR_GRAPHIC_ICON_BACKGROUND_COLOR,\n svgz: VECTOR_GRAPHIC_ICON_BACKGROUND_COLOR,\n ep: VECTOR_GRAPHIC_ICON_BACKGROUND_COLOR,\n eps: VECTOR_GRAPHIC_ICON_BACKGROUND_COLOR,\n sketch: VECTOR_GRAPHIC_ICON_BACKGROUND_COLOR,\n\n // Audio\n mp3: AUDIO_ICON_BACKGROUND_COLOR,\n wav: AUDIO_ICON_BACKGROUND_COLOR,\n wma: AUDIO_ICON_BACKGROUND_COLOR,\n ogg: AUDIO_ICON_BACKGROUND_COLOR,\n\n // Video\n flv: VIDEO_ICON_BACKGROUND_COLOR,\n h264: VIDEO_ICON_BACKGROUND_COLOR,\n mov: VIDEO_ICON_BACKGROUND_COLOR,\n mp4: VIDEO_ICON_BACKGROUND_COLOR,\n mwv: VIDEO_ICON_BACKGROUND_COLOR,\n\n // Compressed:\n zip: COMPRESSED_ICON_BACKGROUND_COLOR,\n '7z': COMPRESSED_ICON_BACKGROUND_COLOR,\n rar: COMPRESSED_ICON_BACKGROUND_COLOR,\n\n // Data\n json: DATA_ICON_BACKGROUND_COLOR,\n yaml: DATA_ICON_BACKGROUND_COLOR,\n sql: DATA_ICON_BACKGROUND_COLOR,\n db: DATA_ICON_BACKGROUND_COLOR,\n dbf: DATA_ICON_BACKGROUND_COLOR,\n};\n\nexport function getIconBackgroundColorForFile(extension: string): string {\n return (\n filetypeBackgroundColorTable[extension.toLowerCase()] ||\n DEFAULT_ICON_BACKGROUND_COLOR\n );\n}\n","const DEFAULT_ICON_FILL_COLOR = 'rgb(var(--color-gray-dark))';\nconst CALENDAR_ICON_FILL_COLOR = 'rgb(var(--color-cyan-dark))';\nconst EMAIL_ICON_FILL_COLOR = 'rgb(var(--color-gray-dark))';\nconst HTML_ICON_FILL_COLOR = 'rgb(var(--color-blue-dark))';\nconst TEXT_ICON_FILL_COLOR = 'rgb(var(--color-yellow-darker))';\nconst EXCEL_ICON_FILL_COLOR = 'rgb(var(--color-green-dark))';\nconst POWERPOINT_ICON_FILL_COLOR = 'rgb(var(--color-coral-dark))';\nconst WORD_ICON_FILL_COLOR = 'rgb(var(--color-sky-dark))';\nconst IMAGE_ICON_FILL_COLOR = 'rgb(var(--color-lime-dark))';\nconst VECTOR_GRAPHIC_FILL_COLOR = 'rgb(var(--color-magenta-dark))';\nconst PRESENTATION_ICON_FILL_COLOR = 'rgb(var(--color-blue-dark))';\nconst DOCUMENT_ICON_FILL_COLOR = 'rgb(var(--color-orange-dark))';\nconst SPREADSHEET_ICON_FILL_COLOR = 'rgb(var(--color-green-dark))';\nconst AUDIO_ICON_FILL_COLOR = 'rgb(var(--color-indigo-dark))';\nconst VIDEO_ICON_FILL_COLOR = 'rgb(var(--color-red-dark))';\nconst COMPRESSED_ICON_FILL_COLOR = 'rgb(var(--color-brown-default))';\nconst MESSAGE_ICON_FILL_COLOR = 'rgb(var(--color-yellow-dark))';\nconst PDF_ICON_FILL_COLOR = 'rgb(var(--color-red-dark))';\nconst DATA_ICON_FILL_COLOR = 'rgb(var(--color-glaucous-dark))';\n\nconst filetypeFillColorTable: Record<string, string> = {\n // Message\n msg: MESSAGE_ICON_FILL_COLOR,\n\n // Calendar\n ics: CALENDAR_ICON_FILL_COLOR,\n ical: CALENDAR_ICON_FILL_COLOR,\n icalendar: CALENDAR_ICON_FILL_COLOR,\n ifb: CALENDAR_ICON_FILL_COLOR,\n\n // Email\n email: EMAIL_ICON_FILL_COLOR,\n eml: EMAIL_ICON_FILL_COLOR,\n oft: EMAIL_ICON_FILL_COLOR,\n ost: EMAIL_ICON_FILL_COLOR,\n emlx: EMAIL_ICON_FILL_COLOR,\n\n // Web\n html: HTML_ICON_FILL_COLOR,\n xml: HTML_ICON_FILL_COLOR,\n\n // Editable text\n txt: TEXT_ICON_FILL_COLOR,\n rtf: TEXT_ICON_FILL_COLOR,\n\n // Editable document\n dot: WORD_ICON_FILL_COLOR,\n doc: WORD_ICON_FILL_COLOR,\n docx: WORD_ICON_FILL_COLOR,\n dotx: WORD_ICON_FILL_COLOR,\n docm: WORD_ICON_FILL_COLOR,\n dotm: WORD_ICON_FILL_COLOR,\n odt: DOCUMENT_ICON_FILL_COLOR,\n pages: DOCUMENT_ICON_FILL_COLOR,\n\n // Portable document\n pdf: PDF_ICON_FILL_COLOR,\n\n // Presentation\n ppt: POWERPOINT_ICON_FILL_COLOR,\n pot: POWERPOINT_ICON_FILL_COLOR,\n pps: POWERPOINT_ICON_FILL_COLOR,\n pptx: POWERPOINT_ICON_FILL_COLOR,\n pptm: POWERPOINT_ICON_FILL_COLOR,\n potx: POWERPOINT_ICON_FILL_COLOR,\n potm: POWERPOINT_ICON_FILL_COLOR,\n ppam: POWERPOINT_ICON_FILL_COLOR,\n ppsx: POWERPOINT_ICON_FILL_COLOR,\n ppsm: POWERPOINT_ICON_FILL_COLOR,\n sldx: POWERPOINT_ICON_FILL_COLOR,\n sldm: POWERPOINT_ICON_FILL_COLOR,\n odp: PRESENTATION_ICON_FILL_COLOR,\n key: PRESENTATION_ICON_FILL_COLOR,\n\n // Spreadsheet\n xls: EXCEL_ICON_FILL_COLOR,\n xlsx: EXCEL_ICON_FILL_COLOR,\n csv: DEFAULT_ICON_FILL_COLOR,\n numbers: SPREADSHEET_ICON_FILL_COLOR,\n\n // Image\n bmp: IMAGE_ICON_FILL_COLOR,\n jpg: IMAGE_ICON_FILL_COLOR,\n jpeg: IMAGE_ICON_FILL_COLOR,\n heic: IMAGE_ICON_FILL_COLOR,\n png: IMAGE_ICON_FILL_COLOR,\n gif: IMAGE_ICON_FILL_COLOR,\n\n // Editable image\n psd: PRESENTATION_ICON_FILL_COLOR,\n ai: DOCUMENT_ICON_FILL_COLOR,\n\n // Vector graphic\n svg: VECTOR_GRAPHIC_FILL_COLOR,\n svgz: VECTOR_GRAPHIC_FILL_COLOR,\n ep: VECTOR_GRAPHIC_FILL_COLOR,\n eps: VECTOR_GRAPHIC_FILL_COLOR,\n sketch: VECTOR_GRAPHIC_FILL_COLOR,\n\n // Audio\n mp3: AUDIO_ICON_FILL_COLOR,\n wav: AUDIO_ICON_FILL_COLOR,\n wma: AUDIO_ICON_FILL_COLOR,\n ogg: AUDIO_ICON_FILL_COLOR,\n\n // Video\n flv: VIDEO_ICON_FILL_COLOR,\n h264: VIDEO_ICON_FILL_COLOR,\n mov: VIDEO_ICON_FILL_COLOR,\n mp4: VIDEO_ICON_FILL_COLOR,\n mwv: VIDEO_ICON_FILL_COLOR,\n\n // Compressed\n zip: COMPRESSED_ICON_FILL_COLOR,\n '7z': COMPRESSED_ICON_FILL_COLOR,\n rar: COMPRESSED_ICON_FILL_COLOR,\n\n // Data\n json: DATA_ICON_FILL_COLOR,\n yaml: DATA_ICON_FILL_COLOR,\n sql: DATA_ICON_FILL_COLOR,\n db: DATA_ICON_FILL_COLOR,\n dbf: DATA_ICON_FILL_COLOR,\n};\n\nexport function getIconFillColorForFile(extension: string): string {\n return (\n filetypeFillColorTable[extension.toLowerCase()] ||\n DEFAULT_ICON_FILL_COLOR\n );\n}\n","const DEFAULT_ICON = 'file';\nconst CALENDAR_ICON = 'tear_off_calendar';\nconst EMAIL_ICON = 'email';\nconst HTML_ICON = 'internet';\nconst TEXT_ICON = 'text_box';\nconst EXCEL_ICON = 'ms_excel_copyrighted';\nconst WORD_ICON = 'ms_word_copyrighted';\nconst POWERPOINT_ICON = 'ms_powerpoint_copyrighted';\nconst IMAGE_ICON = 'picture';\nconst PHOTO_ICON = 'camera';\nconst VECTOR_GRAPHIC_ICON = 'vector';\nconst PRESENTATION_ICON = 'presentation_filled';\nconst DOCUMENT_ICON = 'overview_pages_2';\nconst SPREADSHEET_ICON = 'data_sheet';\nconst AUDIO_ICON = 'audio_wave';\nconst VIDEO_ICON = 'video_file';\nconst COMPRESSED_ICON = 'condom_package';\nconst MESSAGE_ICON = 'ms_outlook_copyrighted';\nconst DATA_ICON = 'database';\n\nconst filetypeIconTable: Record<string, string> = {\n // Message\n msg: MESSAGE_ICON,\n\n // Calendar\n ics: CALENDAR_ICON,\n ical: CALENDAR_ICON,\n icalendar: CALENDAR_ICON,\n ifb: CALENDAR_ICON,\n\n // Email\n email: EMAIL_ICON,\n eml: EMAIL_ICON,\n oft: EMAIL_ICON,\n ost: EMAIL_ICON,\n emlx: EMAIL_ICON,\n\n // Web\n html: HTML_ICON,\n xml: HTML_ICON,\n\n // Editable text\n txt: TEXT_ICON,\n rtf: TEXT_ICON,\n\n // Editable document\n dot: WORD_ICON,\n doc: WORD_ICON,\n docx: WORD_ICON,\n dotx: WORD_ICON,\n docm: WORD_ICON,\n dotm: WORD_ICON,\n odt: DOCUMENT_ICON,\n pages: DOCUMENT_ICON,\n\n // Portable document\n pdf: 'PDF_2',\n\n // Presentation\n ppt: POWERPOINT_ICON,\n pot: POWERPOINT_ICON,\n pps: POWERPOINT_ICON,\n pptx: POWERPOINT_ICON,\n pptm: POWERPOINT_ICON,\n potx: POWERPOINT_ICON,\n potm: POWERPOINT_ICON,\n ppam: POWERPOINT_ICON,\n ppsx: POWERPOINT_ICON,\n ppsm: POWERPOINT_ICON,\n sldx: POWERPOINT_ICON,\n sldm: POWERPOINT_ICON,\n odp: PRESENTATION_ICON,\n key: PRESENTATION_ICON,\n\n // Spreadsheet\n xls: EXCEL_ICON,\n xlsx: EXCEL_ICON,\n csv: SPREADSHEET_ICON,\n numbers: SPREADSHEET_ICON,\n\n // Image\n jpg: PHOTO_ICON,\n jpeg: PHOTO_ICON,\n heic: PHOTO_ICON,\n bmp: IMAGE_ICON,\n png: IMAGE_ICON,\n gif: IMAGE_ICON,\n\n // Editable image\n psd: 'adobe_photoshop_copyrighted',\n ai: 'adobe_illustrator_copyrighted',\n\n // Vector graphic\n svg: VECTOR_GRAPHIC_ICON,\n svgz: VECTOR_GRAPHIC_ICON,\n ep: VECTOR_GRAPHIC_ICON,\n eps: VECTOR_GRAPHIC_ICON,\n sketch: VECTOR_GRAPHIC_ICON,\n\n // Audio\n mp3: AUDIO_ICON,\n wav: AUDIO_ICON,\n wma: AUDIO_ICON,\n ogg: AUDIO_ICON,\n\n // Video\n avi: VIDEO_ICON,\n flv: VIDEO_ICON,\n h264: VIDEO_ICON,\n mov: VIDEO_ICON,\n mp4: VIDEO_ICON,\n mwv: VIDEO_ICON,\n\n // Compressed\n zip: COMPRESSED_ICON,\n '7z': COMPRESSED_ICON,\n rar: COMPRESSED_ICON,\n\n // Data\n json: 'json',\n yaml: DATA_ICON,\n sql: DATA_ICON,\n db: DATA_ICON,\n dbf: DATA_ICON,\n};\n\nexport function getIconForFile(extension: string): string {\n return filetypeIconTable[extension.toLowerCase()] || DEFAULT_ICON;\n}\n","import { FileInfo } from '../global/shared-types/file.types';\nimport { getIconBackgroundColorForFile } from '../components/file/icon-background-colors';\nimport { getIconFillColorForFile } from '../components/file/icon-fill-colors';\nimport { getIconForFile } from '../components/file/icons';\nimport {\n getIconBackgroundColor,\n getIconColor,\n getIconName,\n} from '../components/icon/get-icon-props';\n\nexport function getFileIcon(file: FileInfo) {\n const name = getIconName(file.icon);\n\n if (name) {\n return name;\n }\n\n const extension = getExtension(file);\n if (!extension) {\n return;\n }\n\n return getIconForFile(extension);\n}\n\nexport function getFileColor(file: FileInfo) {\n const color = getIconColor(file.icon, file.iconColor);\n\n if (color) {\n return color;\n }\n\n const extension = getExtension(file);\n if (!extension) {\n return;\n }\n\n return getIconFillColorForFile(extension);\n}\n\nexport function getFileBackgroundColor(file: FileInfo) {\n const backgroundColor = getIconBackgroundColor(\n file.icon,\n file.iconBackgroundColor,\n );\n\n if (backgroundColor) {\n return backgroundColor;\n }\n\n const extension = getExtension(file);\n if (!extension) {\n return;\n }\n\n return getIconBackgroundColorForFile(extension);\n}\n\nexport function getFileExtensionTitle(file: FileInfo) {\n const name = getIconName(file.icon);\n\n if (name) {\n return name;\n }\n\n return getExtension(file);\n}\n\nexport function getExtension(file: FileInfo) {\n if (!file) {\n return;\n }\n\n return file.filename.split('.').pop();\n}\n"],"mappings":"kDAAA,MAAMA,EAAgC,uCACtC,MAAMC,EAAiC,uCACvC,MAAMC,EAA8B,uCACpC,MAAMC,EAA6B,uCACnC,MAAMC,EAA6B,yCACnC,MAAMC,EAA8B,wCACpC,MAAMC,EACF,wCACJ,MAAMC,EAA6B,sCACnC,MAAMC,EAA8B,uCACpC,MAAMC,EACF,0CACJ,MAAMC,EAAgC,uCACtC,MAAMC,EAAiC,yCACvC,MAAMC,EACF,wCACJ,MAAMC,EAA8B,yCACpC,MAAMC,EAA8B,sCACpC,MAAMC,EACF,yCACJ,MAAMC,EAAgC,yCACtC,MAAMC,EAA4B,sCAClC,MAAMC,EAA6B,2CAEnC,MAAMC,EAAuD,CAEzDC,IAAKJ,EAGLK,IAAKpB,EACLqB,KAAMrB,EACNsB,UAAWtB,EAGXuB,IAAKvB,EACLwB,MAAOvB,EACPwB,IAAKxB,EACLyB,IAAKzB,EACL0B,IAAK1B,EACL2B,KAAM3B,EA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,OAAOA,C,CAGX,OAAOG,GAAaJ,EACxB,C,SAEgBI,GAAaJ,GACzB,IAAKA,EAAM,CACP,M,CAGJ,OAAOA,EAAKc,SAASC,MAAM,KAAKC,KACpC,Q"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as r,g as s}from"./p-443111b3.js";import{g as n,a as o,b as a,c as l}from"./p-8bc1584b.js";import{b as c}from"./p-160569a4.js";import{b as h}from"./p-9acf7b5d.js";import{b as f}from"./p-99f6893d.js";import{i as p}from"./p-0b1af919.js";import{c as u}from"./p-3ccdc4a3.js";import"./p-2f777fdb.js";import"./p-48ed11c0.js";import"./p-eda23c05.js";import"./p-c93050d6.js";import"./p-4c3358cb.js";import"./p-858c6b82.js";import"./p-d529bb7d.js";import"./p-669626e5.js";function d(t,i,e,r){var s=-1,n=t==null?0:t.length;while(++s<n){var o=t[s];i(r,o,e(o),t)}return r}function m(t,i){return function(e,r){if(e==null){return e}if(!h(e)){return t(e,r)}var s=e.length,n=i?s:-1,o=Object(e);while(i?n--:++n<s){if(r(o[n],n,o)===false){break}}return e}}var b=m(c);function g(t,i,e,r){b(t,(function(t,s,n){i(r,t,e(t),n)}));return r}function j(t,i){return function(e,r){var s=p(e)?d:g,n=i?i():{};return s(e,t,f(r),n)}}var v=j((function(t,i,e){t[e?0:1].push(i)}),(function(){return[[],[]]}));function y(t){const i={id:crypto.randomUUID(),filename:t.name,contentType:t.type,size:t.size,fileContent:t};i.icon={name:n(i),title:o(i),color:a(i),backgroundColor:l(i)};return i}function x(t,i){if(i===undefined||i==="*"){return true}const e=i.split(",").map((t=>t.trim()));return e.some((i=>{if(i===t.contentType){return true}if(i.endsWith("/*")){const e=i.split("/")[0];return t.contentType.startsWith(`${e}/`)}if(i.startsWith(".")){const e=i.split(".")[1];return t.contentType.endsWith(`/${e}`)}}))}const k=":host(limel-file-dropzone){display:block;position:relative}.has-file-to-drop{animation:display-drop-zone 0.6s ease forwards;box-sizing:border-box;isolation:isolate;z-index:1;position:absolute;inset:0.25rem;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:0.5rem;color:rgb(var(--contrast-700));border:0.125rem dashed rgb(var(--color-cyan-light));border-radius:0.75rem}.text-helpertext{display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.icon{width:clamp(2rem, 5vh, 7rem)}.text{font-size:clamp(1rem, 2vh, 1.75rem)}.helper-text{font-size:clamp(0.75rem, 1.5vh, 1rem)}@keyframes display-drop-zone{0%{background-color:rgb(var(--contrast-1100), 0);backdrop-filter:blur(0);-webkit-backdrop-filter:blur(0);scale:0.9;opacity:0}50%{scale:1;opacity:1}100%{background-color:rgb(var(--contrast-1100), 0.8);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem)}}";const w=class{constructor(r){t(this,r);this.filesSelected=i(this,"filesSelected",7);this.filesRejected=i(this,"filesRejected",7);this.renderOnDragLayout=()=>{if(this.disabled||!this.hasFileToDrop){return}return e("div",{class:"has-file-to-drop"},e("limel-icon",{class:"icon",name:"upload_2"}),e("div",{class:"text-helpertext"},this.renderText(),this.renderHelperText()))};this.renderText=()=>{if(!this.text){return}return e("span",{class:"text"},this.text)};this.renderHelperText=()=>{if(!this.helperText){return}return e("span",{class:"helper-text"},this.helperText)};this.handleDrop=t=>{t.stopPropagation();t.preventDefault();this.hasFileToDrop=false;if(this.disabled){return}const i=Array.from(t.dataTransfer.files);const e=i.map(y);const[r,s]=v(e,(t=>x(t,this.accept)));if(r.length>0){this.filesSelected.emit(r)}if(s.length>0){this.filesRejected.emit(s)}};this.handleDragOver=t=>{this.hasFileToDrop=true;t.preventDefault()};this.handleDragLeave=t=>{this.hasFileToDrop=false;t.preventDefault()};this.accept="*";this.disabled=false;this.text=undefined;this.helperText="";this.hasFileToDrop=false}render(){return e(r,{onDrop:this.handleDrop,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave},e("slot",null),this.renderOnDragLayout())}};w.style=k;const z=class{constructor(e){t(this,e);this.filesSelected=i(this,"filesSelected",7);this.fileInputId=u();this.handleClick=t=>{if(this.disabled){t.stopPropagation();t.preventDefault();return}this.triggerFileDialog();t.stopPropagation()};this.handleKeyUp=t=>{t.stopPropagation();t.preventDefault();if(t.code==="Enter"){this.triggerFileDialog()}};this.handleFileChange=t=>{const i=Array.from(this.fileInput.files);if(i.length>0){t.stopPropagation();this.filesSelected.emit(i.map(y));this.fileInput.value=""}};this.accept="*";this.disabled=false;this.multiple=false}componentDidLoad(){this.fileInput=this.element.shadowRoot.getElementById(this.fileInputId)}render(){return e(r,{onClick:this.handleClick,onKeyUp:this.handleKeyUp,onKeyDown:this.handleKeyDown},e("input",{hidden:true,id:this.fileInputId,onChange:this.handleFileChange,type:"file",accept:this.accept,disabled:this.disabled,multiple:this.multiple}),e("slot",null))}handleKeyDown(t){if(t.code==="Tab"||t.code==="Backspace"||t.code==="Enter"){return}t.preventDefault();t.stopPropagation()}triggerFileDialog(){this.fileInput.click()}get element(){return s(this)}};export{w as limel_file_dropzone,z as limel_file_input};
|
|
2
|
-
//# sourceMappingURL=p-c9ffb1b4.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-443111b3.js";import{t as e}from"./p-3ee3dcdc.js";import{g as h,a as n,b as r,c as l}from"./p-8bc1584b.js";import"./p-2f777fdb.js";const a="";const o={id:null,text:null,removable:true};const d=class{constructor(s){t(this,s);this.change=i(this,"change",7);this.interact=i(this,"interact",7);this.handleNewFiles=t=>{this.preventAndStop(t);this.change.emit(t.detail[0])};this.handleChipSetChange=t=>{t.stopPropagation();const i=!t.detail.length?t.detail[0]:null;if(!i){this.change.emit(i)}};this.handleChipInteract=t=>{this.preventAndStop(t);this.interact.emit(t.detail.id)};this.value=undefined;this.label=undefined;this.required=false;this.disabled=false;this.readonly=false;this.invalid=false;this.accept="*";this.language="en"}render(){return s("limel-file-dropzone",{disabled:this.disabled||this.readonly||!!this.value,accept:this.accept,onFilesSelected:this.handleNewFiles},this.renderChipset())}getChipArray(){if(!this.value){return[]}return[Object.assign(Object.assign({},o),{text:this.value.filename,id:this.value.id,icon:{name:h(this.value),title:n(this.value),color:r(this.value),backgroundColor:l(this.value)},href:this.value.href})]}renderChipset(){const t=s("limel-chip-set",{disabled:this.disabled,readonly:this.readonly,invalid:this.invalid,label:this.label,leadingIcon:"upload_to_cloud",language:this.language,onChange:this.handleChipSetChange,onInteract:this.handleChipInteract,required:this.required,type:"input",value:this.getChipArray(),title:this.getTranslation("drag-and-drop-tips")});if(this.value){return t}return s("limel-file-input",{accept:this.accept,disabled:this.disabled||this.readonly},t)}preventAndStop(t){t.stopPropagation();t.preventDefault()}getTranslation(t){return e.get(`file.${t}`,this.language)}};d.style=a;export{d as limel_file};
|
|
2
|
-
//# sourceMappingURL=p-fc91537a.entry.js.map
|