@limetech/lime-elements 37.19.0-dev.1 → 37.19.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/dist/{esm/icons-d4830de7.js → cjs/file-metadata-f259bba5.js} +56 -33
  3. package/dist/cjs/file-metadata-f259bba5.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +0 -6
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/limel-action-bar.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-action-bar.cjs.entry.js.map +1 -1
  8. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -2
  9. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js.map +1 -1
  10. package/dist/cjs/limel-file.cjs.entry.js +1 -2
  11. package/dist/cjs/limel-file.cjs.entry.js.map +1 -1
  12. package/dist/cjs/limel-text-editor.cjs.entry.js +88 -4
  13. package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
  14. package/dist/collection/components/action-bar/action-bar.css +2 -1
  15. package/dist/collection/components/file/icon-background-colors.js +0 -11
  16. package/dist/collection/components/file/icon-background-colors.js.map +1 -1
  17. package/dist/collection/components/file/icon-fill-colors.js +0 -11
  18. package/dist/collection/components/file/icon-fill-colors.js.map +1 -1
  19. package/dist/collection/components/file/icons.js +0 -9
  20. package/dist/collection/components/file/icons.js.map +1 -1
  21. package/dist/collection/components/text-editor/menu/{default-menu.js → full-menu.js} +4 -4
  22. package/dist/collection/components/text-editor/menu/full-menu.js.map +1 -0
  23. package/dist/collection/components/text-editor/menu/menu-filter.js +83 -0
  24. package/dist/collection/components/text-editor/menu/menu-filter.js.map +1 -0
  25. package/dist/collection/components/text-editor/menu/types.js +2 -0
  26. package/dist/collection/components/text-editor/menu/types.js.map +1 -0
  27. package/dist/collection/components/text-editor/text-editor.js +5 -2
  28. package/dist/collection/components/text-editor/text-editor.js.map +1 -1
  29. package/dist/collection/interface.js +2 -3
  30. package/dist/collection/interface.js.map +1 -1
  31. package/dist/{cjs/icons-8ecb9740.js → esm/file-metadata-9a4780e2.js} +50 -36
  32. package/dist/esm/file-metadata-9a4780e2.js.map +1 -0
  33. package/dist/esm/index.js +0 -2
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/limel-action-bar.entry.js +1 -1
  36. package/dist/esm/limel-action-bar.entry.js.map +1 -1
  37. package/dist/esm/limel-file-dropzone_2.entry.js +1 -2
  38. package/dist/esm/limel-file-dropzone_2.entry.js.map +1 -1
  39. package/dist/esm/limel-file.entry.js +1 -2
  40. package/dist/esm/limel-file.entry.js.map +1 -1
  41. package/dist/esm/limel-text-editor.entry.js +88 -4
  42. package/dist/esm/limel-text-editor.entry.js.map +1 -1
  43. package/dist/lime-elements/index.esm.js +1 -1
  44. package/dist/lime-elements/index.esm.js.map +1 -1
  45. package/dist/lime-elements/lime-elements.esm.js +1 -1
  46. package/dist/lime-elements/{p-7968bfa0.entry.js → p-10edf8b8.entry.js} +2 -2
  47. package/dist/lime-elements/p-10edf8b8.entry.js.map +1 -0
  48. package/dist/lime-elements/p-8bc1584b.js +2 -0
  49. package/dist/lime-elements/p-8bc1584b.js.map +1 -0
  50. package/dist/lime-elements/p-af964180.entry.js +2 -0
  51. package/dist/lime-elements/p-af964180.entry.js.map +1 -0
  52. package/dist/lime-elements/p-c9ffb1b4.entry.js +2 -0
  53. package/dist/lime-elements/{p-a1ffb47f.entry.js.map → p-c9ffb1b4.entry.js.map} +1 -1
  54. package/dist/lime-elements/p-fc91537a.entry.js +2 -0
  55. package/dist/lime-elements/{p-6c36f090.entry.js.map → p-fc91537a.entry.js.map} +1 -1
  56. package/dist/types/components/file/icon-background-colors.d.ts +0 -11
  57. package/dist/types/components/file/icon-fill-colors.d.ts +0 -11
  58. package/dist/types/components/file/icons.d.ts +0 -9
  59. package/dist/types/components/text-editor/menu/{default-menu.d.ts → full-menu.d.ts} +3 -3
  60. package/dist/types/components/text-editor/menu/menu-filter.d.ts +11 -0
  61. package/dist/types/components/text-editor/menu/types.d.ts +35 -0
  62. package/dist/types/interface.d.ts +2 -3
  63. package/package.json +1 -1
  64. package/dist/cjs/file-metadata-062e1135.js +0 -58
  65. package/dist/cjs/file-metadata-062e1135.js.map +0 -1
  66. package/dist/cjs/icons-8ecb9740.js.map +0 -1
  67. package/dist/collection/components/file/index.js +0 -4
  68. package/dist/collection/components/file/index.js.map +0 -1
  69. package/dist/collection/components/text-editor/menu/default-menu.js.map +0 -1
  70. package/dist/esm/file-metadata-f5ba6228.js +0 -53
  71. package/dist/esm/file-metadata-f5ba6228.js.map +0 -1
  72. package/dist/esm/icons-d4830de7.js.map +0 -1
  73. package/dist/lime-elements/p-35e7a41b.js +0 -2
  74. package/dist/lime-elements/p-35e7a41b.js.map +0 -1
  75. package/dist/lime-elements/p-48b9449e.js +0 -2
  76. package/dist/lime-elements/p-48b9449e.js.map +0 -1
  77. package/dist/lime-elements/p-613d6e99.entry.js +0 -2
  78. package/dist/lime-elements/p-613d6e99.entry.js.map +0 -1
  79. package/dist/lime-elements/p-6c36f090.entry.js +0 -2
  80. package/dist/lime-elements/p-7968bfa0.entry.js.map +0 -1
  81. package/dist/lime-elements/p-a1ffb47f.entry.js +0 -2
  82. package/dist/types/components/file/index.d.ts +0 -4
@@ -0,0 +1,2 @@
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
@@ -0,0 +1 @@
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,EAGN4B,KAAM3B,EACN4B,IAAK5B,EAGL6B,IAAK5B,EACL6B,IAAK7B,EAGL8B,IAAK3B,EACL4B,IAAK5B,EACL6B,KAAM7B,EACN8B,KAAM9B,EACN+B,KAAM/B,EACNgC,KAAMhC,EACNiC,IAAK7B,EACL8B,MAAO9B,EAGP+B,IAAKzB,EAGL0B,IAAKrC,EACLsC,IAAKtC,EACLuC,IAAKvC,EACLwC,KAAMxC,EACNyC,KAAMzC,EACN0C,KAAM1C,EACN2C,KAAM3C,EACN4C,KAAM5C,EACN6C,KAAM7C,EACN8C,KAAM9C,EACN+C,KAAM/C,EACNgD,KAAMhD,EACNiD,IAAK7C,EACL8C,IAAK9C,EAGL+C,IAAK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KAAM,OACNC,KAAM8C,GACN7C,IAAK6C,GACL5C,GAAI4C,GACJ3C,IAAK2C,I,SAGOG,GAAe5C,GAC3B,OAAO0C,GAAkB1C,EAAUC,gBAAkBsB,CACzD,C,SCtHgBsB,GAAYC,GACxB,MAAMC,EAAOC,EAAYF,EAAKG,MAE9B,GAAIF,EAAM,CACN,OAAOA,C,CAGX,MAAM/C,EAAYkD,GAAaJ,GAC/B,IAAK9C,EAAW,CACZ,M,CAGJ,OAAO4C,GAAe5C,EAC1B,C,SAEgBmD,GAAaL,GACzB,MAAMM,EAAQC,EAAaP,EAAKG,KAAMH,EAAKQ,WAE3C,GAAIF,EAAO,CACP,OAAOA,C,CAGX,MAAMpD,EAAYkD,GAAaJ,GAC/B,IAAK9C,EAAW,CACZ,M,CAGJ,OAAOsB,EAAwBtB,EACnC,C,SAEgBuD,GAAuBT,GACnC,MAAMU,EAAkBC,EACpBX,EAAKG,KACLH,EAAKY,qBAGT,GAAIF,EAAiB,CACjB,OAAOA,C,CAGX,MAAMxD,EAAYkD,GAAaJ,GAC/B,IAAK9C,EAAW,CACZ,M,CAGJ,OAAOD,EAA8BC,EACzC,C,SAEgB2D,GAAsBb,GAClC,MAAMC,EAAOC,EAAYF,EAAKG,MAE9B,GAAIF,EAAM,CACN,OAAOA,C,CAGX,OAAOG,GAAaJ,EACxB,C,SAEgBI,GAAaJ,GACzB,IAAKA,EAAM,CACP,M,CAGJ,OAAOA,EAAKc,SAASC,MAAM,KAAKC,KACpC,Q"}
@@ -0,0 +1,2 @@
1
+ import{r as i,c as t,h as s,H as e,g as r}from"./p-443111b3.js";function o(i){return!("separator"in i)}const a=":host(limel-action-bar){--action-bar-item-height:2rem;--limel-action-bar-item-text-color:var(\n --action-bar-item-text-color,\n rgb(var(--contrast-1100))\n );box-sizing:border-box;display:inline-flex;align-items:center;padding:0.125rem 0.25rem;max-width:100%;border-radius:var(--action-bar-border-radius);background-color:var(--action-bar-background-color, rgb(var(--contrast-100)))}:host(limel-action-bar),.items{gap:0.25rem}@media (pointer: coarse){:host(limel-action-bar),.items{gap:0.5rem}}.items{display:inline-flex;max-width:100%;min-width:0}:host(limel-action-bar.is-full-width){width:100%}:host(limel-action-bar.is-floating){--action-bar-border-radius:100vw;border:1px solid rgb(var(--contrast-400));padding-right:0.125rem;padding-left:0.125rem;max-width:calc(100% - 2rem);box-shadow:var(--shadow-depth-16), var(--shadow-depth-8)}";const h=class{constructor(e){i(this,e);this.itemSelected=t(this,"itemSelected",7);this.firstRender=true;this.actionBarItems=[];this.renderActionBarItem=(i,t)=>s("limel-action-bar-item",{item:i,onSelect:this.handleSelect,isVisible:this.isVisible(t),role:"gridcell"});this.renderOverflowMenu=i=>{if(!(this.actions.length-this.overflowCutoff)){return}return s("limel-action-bar-overflow-menu",{openDirection:this.openDirection,items:i,onSelect:this.handleSelect,role:"gridcell"})};this.handleSelect=i=>{i.stopPropagation();if(o(i.detail)){this.itemSelected.emit(i.detail)}};this.handleIntersection=i=>{const t=i.filter((i=>i.isIntersecting));const s=i.filter((i=>!i.isIntersecting));if(this.firstRender){this.overflowCutoff=t.length}else{this.overflowCutoff=this.overflowCutoff+t.length-s.length}this.firstRender=false};this.actions=[];this.accessibleLabel=undefined;this.layout=undefined;this.openDirection=undefined;this.overflowCutoff=this.actions.length}render(){let i=[];if(this.actions.length){i=this.actions.slice(this.overflowCutoff)}return s(e,{"aria-label":this.accessibleLabel,class:{"is-full-width":this.layout==="fullWidth","is-floating":this.layout==="floating"},role:"grid"},s("div",{class:"items",role:"rowgroup"},this.actions.map(this.renderActionBarItem)),this.renderOverflowMenu(i))}connectedCallback(){}componentDidRender(){var i;if(this.haveItemsChanged()){(i=this.intersectionObserver)===null||i===void 0?void 0:i.disconnect();this.createIntersectionObserver()}}disconnectedCallback(){var i;(i=this.intersectionObserver)===null||i===void 0?void 0:i.disconnect();this.intersectionObserver=undefined;this.actionBarItems=[];this.connectedCallback=()=>this.createIntersectionObserver()}isVisible(i){return i<this.overflowCutoff}createIntersectionObserver(){const i={root:this.host.shadowRoot.querySelector(".items"),rootMargin:"0px",threshold:1};this.overflowCutoff=this.actions.length;this.firstRender=true;this.actionBarItems=[];this.intersectionObserver=new IntersectionObserver(this.handleIntersection,i);this.host.shadowRoot.querySelectorAll("limel-action-bar-item").forEach((i=>{this.observe(i)}))}observe(i){this.intersectionObserver.observe(i);this.actionBarItems.push(i)}haveItemsChanged(){const i=this.actionBarItems.some((i=>!this.host.shadowRoot.contains(i)));const t=Array.from(this.host.shadowRoot.querySelectorAll("limel-action-bar-item")).some((i=>!this.actionBarItems.includes(i)));return i||t}get host(){return r(this)}};h.style=a;export{h as limel_action_bar};
2
+ //# sourceMappingURL=p-af964180.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isItem","item","actionBarCss","ActionBar","this","firstRender","actionBarItems","renderActionBarItem","index","h","onSelect","handleSelect","isVisible","role","renderOverflowMenu","items","actions","length","overflowCutoff","openDirection","event","stopPropagation","detail","itemSelected","emit","handleIntersection","entries","intersectingItems","filter","entry","isIntersecting","notIntersectingItems","render","overflowActions","slice","Host","accessibleLabel","class","layout","map","connectedCallback","componentDidRender","haveItemsChanged","_a","intersectionObserver","disconnect","createIntersectionObserver","disconnectedCallback","undefined","options","root","host","shadowRoot","querySelector","rootMargin","threshold","IntersectionObserver","querySelectorAll","forEach","actionBarItem","observe","push","someItemRemoved","some","contains","someItemAdded","Array","from","includes"],"sources":["./src/components/action-bar/isItem.ts","./src/components/action-bar/action-bar.scss?tag=limel-action-bar&encapsulation=shadow","./src/components/action-bar/action-bar.tsx"],"sourcesContent":["import { ActionBarItem } from '../action-bar/action-bar.types';\nimport { ListSeparator } from '../list/list-item.types';\n\nexport function isItem(\n item: ActionBarItem | ListSeparator,\n): item is ActionBarItem {\n return !('separator' in item);\n}\n","/**\n* @prop --action-bar-item-text-color: Text color of action bar items, defaults to `--contrast-1100`.\n* @prop --action-bar-item-icon-color: Color of the icons displayed on each action bar item. Defaults to the text color. To specify a color for an individual item, use the `iconColor` prop instead.\n* @prop --action-bar-item-max-width: Maximum width of a button in the action bar. Defaults to `10rem`. Keep in mind that the buttons should not appear too big.\n* @prop --action-bar-border-radius: Defines the roundness of the corners of the action bar. Defaults to `0`.\n* @prop --action-bar-background-color: Background color of the whole component. Defaults to `--contrast-100`.\n*/\n\n:host(limel-action-bar) {\n --action-bar-item-height: 2rem;\n\n --limel-action-bar-item-text-color: var(\n --action-bar-item-text-color,\n rgb(var(--contrast-1100))\n );\n\n box-sizing: border-box;\n\n display: inline-flex;\n align-items: center;\n padding: 0.125rem 0.25rem;\n max-width: 100%;\n border-radius: var(--action-bar-border-radius);\n\n background-color: var(\n --action-bar-background-color,\n rgb(var(--contrast-100))\n );\n}\n\n:host(limel-action-bar),\n.items {\n gap: 0.25rem;\n @media (pointer: coarse) {\n gap: 0.5rem;\n }\n}\n\n.items {\n display: inline-flex;\n max-width: 100%;\n min-width: 0;\n}\n\n:host(limel-action-bar.is-full-width) {\n width: 100%;\n}\n\n:host(limel-action-bar.is-floating) {\n --action-bar-border-radius: 100vw;\n border: 1px solid rgb(var(--contrast-400));\n\n padding-right: 0.125rem;\n padding-left: 0.125rem;\n\n max-width: calc(100% - 2rem);\n box-shadow: var(--shadow-depth-16), var(--shadow-depth-8);\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Element,\n} from '@stencil/core';\nimport { ListSeparator } from '../list/list-item.types';\nimport { MenuItem, OpenDirection } from '../menu/menu.types';\nimport { ActionBarItem } from './action-bar.types';\nimport { isItem } from './isItem';\n\n/**\n * An action bar is a user interface element commonly found in software applications and websites.\n * It typically appears at the top of the screen or within a specific section\n * and serves as a centralized hub for accessing various actions and commands\n * relevant to the current context or page.\n *\n * The action bar often contains a set of clickable icons or buttons (icons + labels)\n * that represent specific actions, such as saving, deleting, editing, sharing,\n * or bulk operations for selected items.\n *\n * The purpose of an action bar is to provide quick and convenient access to\n * frequently used functionalities, enabling users to perform common tasks efficiently.\n * It enhances usability by organizing important actions in a visually prominent and easily accessible location.\n *\n * The action bar's design and layout can vary based on the platform or application,\n * but its primary goal remains consistent—to\n * empower users to interact with the software and perform desired actions effortlessly.\n *\n * @exampleComponent limel-example-action-bar\n * @exampleComponent limel-example-action-bar-overflow-menu\n * @exampleComponent limel-example-action-bar-colors\n * @exampleComponent limel-example-action-bar-floating\n * @exampleComponent limel-example-action-bar-styling\n * @exampleComponent limel-example-action-bar-as-primary-component\n */\n@Component({\n tag: 'limel-action-bar',\n shadow: true,\n styleUrl: 'action-bar.scss',\n})\nexport class ActionBar {\n /**\n * Items that are placed in the action bar.\n * These represent primary actions.\n */\n @Prop()\n public actions: Array<ActionBarItem | ListSeparator> = [];\n\n /**\n * A label used to describe the purpose of the element to users\n * of assistive technologies, like screen readers.\n * Example value: \"toolbar\"\n */\n @Prop({ reflect: true })\n public accessibleLabel?: string;\n\n /**\n * - When set to `fullWidth`, the component will take the\n * entire width of its container.\n * - When set to `floating`, the component will get basic stylings\n * to visualize the floating state.\n * :::note\n * You should still properly position the component\n * according to the structure of your user interface.\n * For example, use an `absolute` or `fixed` position.\n * :::\n */\n @Prop({ reflect: true })\n public layout?: 'fullWidth' | 'floating';\n\n /**\n * Defines the location that the content of the overflow menu\n * appears, in relation to its trigger.\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection;\n\n /**\n * Fired when a action bar item has been clicked.\n * @public\n */\n @Event()\n public itemSelected: EventEmitter<ActionBarItem>;\n\n @Element()\n private host: HTMLElement;\n\n @State()\n private overflowCutoff: number = this.actions.length;\n\n private intersectionObserver: IntersectionObserver;\n private firstRender = true;\n private actionBarItems: HTMLLimelActionBarItemElement[] = [];\n\n public render() {\n let overflowActions: Array<MenuItem | ListSeparator> = [];\n if (this.actions.length) {\n overflowActions = this.actions.slice(this.overflowCutoff);\n }\n\n return (\n <Host\n aria-label={this.accessibleLabel}\n class={{\n 'is-full-width': this.layout === 'fullWidth',\n 'is-floating': this.layout === 'floating',\n }}\n role=\"grid\"\n >\n <div class=\"items\" role=\"rowgroup\">\n {this.actions.map(this.renderActionBarItem)}\n </div>\n {this.renderOverflowMenu(overflowActions)}\n </Host>\n );\n }\n\n public connectedCallback() {}\n\n public componentDidRender() {\n if (this.haveItemsChanged()) {\n this.intersectionObserver?.disconnect();\n this.createIntersectionObserver();\n }\n }\n\n public disconnectedCallback() {\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = undefined;\n this.actionBarItems = [];\n this.connectedCallback = () => this.createIntersectionObserver();\n }\n\n private renderActionBarItem = (item: ActionBarItem, index: number) => {\n return (\n <limel-action-bar-item\n item={item}\n onSelect={this.handleSelect}\n isVisible={this.isVisible(index)}\n role=\"gridcell\"\n />\n );\n };\n\n private renderOverflowMenu = (items: Array<MenuItem | ListSeparator>) => {\n if (!(this.actions.length - this.overflowCutoff)) {\n return;\n }\n\n return (\n <limel-action-bar-overflow-menu\n openDirection={this.openDirection}\n items={items}\n onSelect={this.handleSelect}\n role=\"gridcell\"\n />\n );\n };\n\n private isVisible(index: number) {\n return index < this.overflowCutoff;\n }\n\n private handleSelect = (\n event: CustomEvent<ActionBarItem | ListSeparator>,\n ) => {\n event.stopPropagation();\n if (isItem(event.detail)) {\n this.itemSelected.emit(event.detail);\n }\n };\n\n private handleIntersection = (entries: IntersectionObserverEntry[]) => {\n const intersectingItems = entries.filter(\n (entry) => entry.isIntersecting,\n );\n\n const notIntersectingItems = entries.filter(\n (entry) => !entry.isIntersecting,\n );\n\n if (this.firstRender) {\n this.overflowCutoff = intersectingItems.length;\n } else {\n this.overflowCutoff =\n this.overflowCutoff +\n intersectingItems.length -\n notIntersectingItems.length;\n }\n\n this.firstRender = false;\n };\n\n private createIntersectionObserver() {\n const options = {\n root: this.host.shadowRoot.querySelector('.items'),\n rootMargin: '0px',\n threshold: 1.0,\n };\n\n this.overflowCutoff = this.actions.length;\n this.firstRender = true;\n\n this.actionBarItems = [];\n\n this.intersectionObserver = new IntersectionObserver(\n this.handleIntersection,\n options,\n );\n\n this.host.shadowRoot\n .querySelectorAll('limel-action-bar-item')\n .forEach((actionBarItem) => {\n this.observe(actionBarItem);\n });\n }\n\n private observe(actionBarItem: HTMLLimelActionBarItemElement) {\n this.intersectionObserver.observe(actionBarItem);\n this.actionBarItems.push(actionBarItem);\n }\n\n private haveItemsChanged() {\n const someItemRemoved = this.actionBarItems.some(\n (actionBarItem: HTMLLimelActionBarItemElement) =>\n !this.host.shadowRoot.contains(actionBarItem),\n );\n\n const someItemAdded = Array.from(\n this.host.shadowRoot.querySelectorAll('limel-action-bar-item'),\n ).some(\n (actionBarItem: HTMLLimelActionBarItemElement) =>\n !this.actionBarItems.includes(actionBarItem),\n );\n\n return someItemRemoved || someItemAdded;\n }\n}\n"],"mappings":"yEAGgBA,EACZC,GAEA,QAAS,cAAeA,EAC5B,CCPA,MAAMC,EAAe,o1B,MC6CRC,EAAS,M,oEAmDVC,KAAAC,YAAc,KACdD,KAAAE,eAAkD,GAyClDF,KAAAG,oBAAsB,CAACN,EAAqBO,IAE5CC,EAAA,yBACIR,KAAMA,EACNS,SAAUN,KAAKO,aACfC,UAAWR,KAAKQ,UAAUJ,GAC1BK,KAAK,aAKTT,KAAAU,mBAAsBC,IAC1B,KAAMX,KAAKY,QAAQC,OAASb,KAAKc,gBAAiB,CAC9C,M,CAGJ,OACIT,EAAA,kCACIU,cAAef,KAAKe,cACpBJ,MAAOA,EACPL,SAAUN,KAAKO,aACfE,KAAK,YACP,EAQFT,KAAAO,aACJS,IAEAA,EAAMC,kBACN,GAAIrB,EAAOoB,EAAME,QAAS,CACtBlB,KAAKmB,aAAaC,KAAKJ,EAAME,O,GAI7BlB,KAAAqB,mBAAsBC,IAC1B,MAAMC,EAAoBD,EAAQE,QAC7BC,GAAUA,EAAMC,iBAGrB,MAAMC,EAAuBL,EAAQE,QAChCC,IAAWA,EAAMC,iBAGtB,GAAI1B,KAAKC,YAAa,CAClBD,KAAKc,eAAiBS,EAAkBV,M,KACrC,CACHb,KAAKc,eACDd,KAAKc,eACLS,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,MAAMoB,EAAkB1D,KAAKE,eAAeyD,MACvCJ,IACIvD,KAAK+C,KAAKC,WAAWY,SAASL,KAGvC,MAAMM,EAAgBC,MAAMC,KACxB/D,KAAK+C,KAAKC,WAAWK,iBAAiB,0BACxCM,MACGJ,IACIvD,KAAKE,eAAe8D,SAAST,KAGtC,OAAOG,GAAmBG,C"}
@@ -0,0 +1,2 @@
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 +1 @@
1
- {"version":3,"names":["arrayAggregator","array","setter","iteratee","accumulator","index","length","value","createBaseEach","eachFunc","fromRight","collection","isArrayLike","iterable","Object","baseEach","baseForOwn","baseAggregator","key","createAggregator","initializer","func","isArray","baseIteratee","partition","result","push","createFileInfo","file","limeFile","id","crypto","randomUUID","filename","name","contentType","type","size","fileContent","icon","getFileIcon","title","getFileExtensionTitle","color","getFileColor","backgroundColor","getFileBackgroundColor","isTypeAccepted","accept","undefined","acceptList","split","map","raw","trim","some","acceptedType","endsWith","baseType","startsWith","fileType","fileDropzoneCss","FileDropzone","this","renderOnDragLayout","disabled","hasFileToDrop","h","class","renderText","renderHelperText","text","helperText","handleDrop","event","stopPropagation","preventDefault","files","Array","from","dataTransfer","fileInfos","acceptedFileInfos","rejectedFileInfos","filesSelected","emit","filesRejected","handleDragOver","handleDragLeave","render","Host","onDrop","onDragOver","onDragLeave","FileInput","fileInputId","createRandomString","handleClick","triggerFileDialog","handleKeyUp","code","handleFileChange","fileInput","componentDidLoad","element","shadowRoot","getElementById","onClick","onKeyUp","onKeyDown","handleKeyDown","hidden","onChange","multiple","click"],"sources":["./node_modules/lodash-es/_arrayAggregator.js","./node_modules/lodash-es/_createBaseEach.js","./node_modules/lodash-es/_baseEach.js","./node_modules/lodash-es/_baseAggregator.js","./node_modules/lodash-es/_createAggregator.js","./node_modules/lodash-es/partition.js","./src/util/files.ts","./src/components/file-dropzone/file-dropzone.scss?tag=limel-file-dropzone&encapsulation=shadow","./src/components/file-dropzone/file-dropzone.tsx","./src/components/file-input/file-input.tsx"],"sourcesContent":["/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nexport default arrayAggregator;\n","import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","import baseEach from './_baseEach.js';\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nexport default baseAggregator;\n","import arrayAggregator from './_arrayAggregator.js';\nimport baseAggregator from './_baseAggregator.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nexport default createAggregator;\n","import createAggregator from './_createAggregator.js';\n\n/**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\nvar partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n}, function() { return [[], []]; });\n\nexport default partition;\n","import { FileInfo } from '../global/shared-types/file.types';\nimport {\n getFileBackgroundColor,\n getFileColor,\n getFileExtensionTitle,\n getFileIcon,\n} from './file-metadata';\n\nexport function createFileInfo(file: File): FileInfo {\n const limeFile: FileInfo = {\n id: crypto.randomUUID(),\n filename: file.name,\n contentType: file.type,\n size: file.size,\n fileContent: file,\n };\n limeFile.icon = {\n name: getFileIcon(limeFile),\n title: getFileExtensionTitle(limeFile),\n color: getFileColor(limeFile),\n backgroundColor: getFileBackgroundColor(limeFile),\n };\n\n return limeFile;\n}\n\nexport function isTypeAccepted(file: FileInfo, accept?: string): boolean {\n if (accept === undefined || accept === '*') {\n return true;\n }\n\n const acceptList = accept.split(',').map((raw) => raw.trim());\n\n return acceptList.some((acceptedType: string) => {\n if (acceptedType === file.contentType) {\n return true;\n }\n\n if (acceptedType.endsWith('/*')) {\n const baseType = acceptedType.split('/')[0];\n\n return file.contentType.startsWith(`${baseType}/`);\n }\n\n if (acceptedType.startsWith('.')) {\n const fileType = acceptedType.split('.')[1];\n\n return file.contentType.endsWith(`/${fileType}`);\n }\n });\n}\n",":host(limel-file-dropzone) {\n display: block;\n position: relative;\n}\n\n.has-file-to-drop {\n animation: display-drop-zone 0.6s ease forwards;\n\n box-sizing: border-box;\n isolation: isolate;\n z-index: 1;\n position: absolute;\n inset: 0.25rem;\n\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n\n color: rgb(var(--contrast-700));\n\n border: 0.125rem dashed rgb(var(--color-cyan-light));\n border-radius: 0.75rem;\n}\n\n.text-helpertext {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n}\n\n.icon {\n width: clamp(2rem, 5vh, 7rem);\n}\n\n.text {\n font-size: clamp(1rem, 2vh, 1.75rem);\n}\n\n.helper-text {\n font-size: clamp(0.75rem, 1.5vh, 1rem);\n}\n\n@keyframes display-drop-zone {\n 0% {\n background-color: rgb(var(--contrast-1100), 0);\n backdrop-filter: blur(0);\n -webkit-backdrop-filter: blur(0);\n scale: 0.9;\n opacity: 0;\n }\n\n 50% {\n scale: 1;\n opacity: 1;\n }\n\n 100% {\n background-color: rgb(var(--contrast-1100), 0.8);\n backdrop-filter: blur(0.25rem);\n -webkit-backdrop-filter: blur(0.25rem);\n }\n}\n","import {\n Component,\n h,\n Event,\n EventEmitter,\n Host,\n Prop,\n State,\n} from '@stencil/core';\nimport { FileInfo } from '../../global/shared-types/file.types';\nimport { createFileInfo, isTypeAccepted } from '../../util/files';\nimport { partition } from 'lodash-es';\n\n/**\n * This component enables you to seamlessly convert any region of the user interface into\n * a file dropzone area, just by wrapping it inside the `limel-file-dropzone`.\n *\n * The file dropzone can then be used to allow end-users to upload files\n * by dragging and dropping them into the specified area, for example to trigger an upload process.\n *\n * After receiving the files, the component emits a `filesSelected` event. For unsupported\n * files (specified with the `accept` prop) a `filesRejected` event will be emitted.\n *\n * The event detail would be an array of `FileInfo` objects,\n * each representing a file dropped into the dropzone.\n *\n * @exampleComponent limel-example-file-dropzone\n * @exampleComponent limel-example-file-dropzone-type-filtering\n * @private\n */\n@Component({\n tag: 'limel-file-dropzone',\n shadow: true,\n styleUrl: 'file-dropzone.scss',\n})\nexport class FileDropzone {\n /**\n * Specifies the types of files that the dropzone will accept. By default, all file types are accepted.\n *\n * For media files, formats can be specified using: `audio/*`, `video/*`, `image/*`.\n * Unique file type specifiers can also be used, for example: `.jpg`, `.pdf`.\n * A comma-separated list of file extensions or MIME types is also acceptable, e.g., `image/png, image/jpeg` or\n * `.png, .jpg, .jpeg`.\n *\n * @see [HTML attribute: accept](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept) for more\n * details.\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Set to `true` to disable the file dropzone.\n */\n @Prop()\n public disabled: boolean = false;\n\n /**\n * Is displayed when the user is dragging a file over the dropzone.\n * A suitable text could for instance be \"Drop your files here\".\n */\n @Prop()\n public text: string;\n\n /**\n * Is displayed to provide supplementary information to the end users,\n * for instance, which filetypes or file sizes are accepted.\n */\n @Prop()\n public helperText?: string = '';\n\n /**\n * Sets to true when there is a file to drop\n */\n @State()\n private hasFileToDrop: boolean = false;\n\n /**\n * Emitted when files are selected\n */\n @Event()\n filesSelected: EventEmitter<FileInfo[]>;\n\n /**\n * Emitted when files are selected but do not conform with the `accept` property specifications.\n * This can happen when the file types or formats of the selected files are not among the ones allowed by the dropzone,\n * as defined by the `accept` property.\n *\n * @see `accept` for details on how to specify acceptable file types.\n */\n @Event()\n filesRejected: EventEmitter<FileInfo[]>;\n\n public render() {\n return (\n <Host\n onDrop={this.handleDrop}\n onDragOver={this.handleDragOver}\n onDragLeave={this.handleDragLeave}\n >\n <slot />\n {this.renderOnDragLayout()}\n </Host>\n );\n }\n\n private renderOnDragLayout = () => {\n if (this.disabled || !this.hasFileToDrop) {\n return;\n }\n\n return (\n <div class=\"has-file-to-drop\">\n <limel-icon class=\"icon\" name=\"upload_2\" />\n <div class=\"text-helpertext\">\n {this.renderText()}\n {this.renderHelperText()}\n </div>\n </div>\n );\n };\n\n private renderText = () => {\n if (!this.text) {\n return;\n }\n\n return <span class=\"text\">{this.text}</span>;\n };\n\n private renderHelperText = () => {\n if (!this.helperText) {\n return;\n }\n\n return <span class=\"helper-text\">{this.helperText}</span>;\n };\n\n private handleDrop = (event: DragEvent) => {\n event.stopPropagation();\n event.preventDefault();\n this.hasFileToDrop = false;\n\n if (this.disabled) {\n return;\n }\n\n const files: File[] = Array.from(event.dataTransfer.files);\n const fileInfos: FileInfo[] = files.map(createFileInfo);\n\n const [acceptedFileInfos, rejectedFileInfos] = partition(\n fileInfos,\n (file) => isTypeAccepted(file, this.accept),\n );\n\n if (acceptedFileInfos.length > 0) {\n this.filesSelected.emit(acceptedFileInfos);\n }\n\n if (rejectedFileInfos.length > 0) {\n this.filesRejected.emit(rejectedFileInfos);\n }\n };\n\n private handleDragOver = (event: DragEvent) => {\n this.hasFileToDrop = true;\n event.preventDefault();\n };\n\n private handleDragLeave = (event: DragEvent) => {\n this.hasFileToDrop = false;\n event.preventDefault();\n };\n}\n","import {\n h,\n Event,\n EventEmitter,\n Host,\n Component,\n Element,\n Prop,\n} from '@stencil/core';\nimport { createRandomString } from '../../util/random-string';\nimport { FileInfo } from '../../global/shared-types/file.types';\nimport { createFileInfo } from '../../util/files';\n\n/**\n * This component enables you to seamlessly transform any other clickable component that\n * generates a `click` event into a file input selector.\n *\n * To use it, just wrap any clickable component inside the `limel-file-input` component.\n * Upon reception of the `click` event this component will open the native file selection\n * dialog.\n *\n * After receiving the files, the component emits a `filesSelected` event.\n *\n * The event detail would be an array of `FileInfo` objects,\n * each representing a file dropped into the dropzone.\n *\n * @exampleComponent limel-example-file-input\n * @exampleComponent limel-example-file-input-type-filtering\n * @private\n */\n@Component({\n tag: 'limel-file-input',\n shadow: true,\n})\nexport class FileInput {\n /**\n * Specifies the types of files that the dropzone will accept. By default, all file types are accepted.\n *\n * For media files, formats can be specified using: `audio/*`, `video/*`, `image/*`.\n * Unique file type specifiers can also be used, for example: `.jpg`, `.pdf`.\n * A comma-separated list of file extensions or MIME types is also acceptable, e.g., `image/png, image/jpeg` or\n * `.png, .jpg, .jpeg`.\n *\n * @see [HTML attribute: accept](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept) for more\n * details.\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Set to `true` to disable file input selection.\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * Set to `true` to enable selection of multiple files\n */\n @Prop({ reflect: true })\n public multiple: boolean = false;\n\n /**\n * Emitted when files are selected\n */\n @Event()\n filesSelected: EventEmitter<FileInfo[]>;\n\n @Element()\n private element: HTMLLimelFileElement;\n\n private fileInput: HTMLInputElement;\n private fileInputId = createRandomString();\n\n public componentDidLoad() {\n this.fileInput = this.element.shadowRoot.getElementById(\n this.fileInputId,\n ) as HTMLInputElement;\n }\n\n public render() {\n return (\n <Host\n onClick={this.handleClick}\n onKeyUp={this.handleKeyUp}\n onKeyDown={this.handleKeyDown}\n >\n <input\n hidden={true}\n id={this.fileInputId}\n onChange={this.handleFileChange}\n type=\"file\"\n accept={this.accept}\n disabled={this.disabled}\n multiple={this.multiple}\n />\n <slot />\n </Host>\n );\n }\n\n private handleClick = (event: Event) => {\n if (this.disabled) {\n event.stopPropagation();\n event.preventDefault();\n\n return;\n }\n\n this.triggerFileDialog();\n\n event.stopPropagation();\n };\n\n private handleKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n event.preventDefault();\n\n if (event.code === 'Enter') {\n this.triggerFileDialog();\n }\n };\n\n private handleKeyDown(event: KeyboardEvent) {\n if (\n event.code === 'Tab' ||\n event.code === 'Backspace' ||\n event.code === 'Enter'\n ) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n }\n\n private triggerFileDialog() {\n this.fileInput.click();\n }\n\n private handleFileChange = (event: Event) => {\n const files = Array.from(this.fileInput.files);\n if (files.length > 0) {\n event.stopPropagation();\n this.filesSelected.emit(files.map(createFileInfo));\n this.fileInput.value = '';\n }\n };\n}\n"],"mappings":"qgBAUA,SAASA,EAAgBC,EAAOC,EAAQC,EAA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,KAAKoC,YACdU,UAAW9C,KAAK+C,eAEhB3C,EAAA,SACI4C,OAAQ,KACRjF,GAAIiC,KAAKgC,YACTiB,SAAUjD,KAAKsC,iBACfjE,KAAK,OACLY,OAAQe,KAAKf,OACbiB,SAAUF,KAAKE,SACfgD,SAAUlD,KAAKkD,WAEnB9C,EAAA,a,CA2BJ2C,cAAcpC,GAClB,GACIA,EAAM0B,OAAS,OACf1B,EAAM0B,OAAS,aACf1B,EAAM0B,OAAS,QACjB,CACE,M,CAGJ1B,EAAME,iBACNF,EAAMC,iB,CAGFuB,oBACJnC,KAAKuC,UAAUY,O"}
1
+ {"version":3,"names":["arrayAggregator","array","setter","iteratee","accumulator","index","length","value","createBaseEach","eachFunc","fromRight","collection","isArrayLike","iterable","Object","baseEach","baseForOwn","baseAggregator","key","createAggregator","initializer","func","isArray","baseIteratee","partition","result","push","createFileInfo","file","limeFile","id","crypto","randomUUID","filename","name","contentType","type","size","fileContent","icon","getFileIcon","title","getFileExtensionTitle","color","getFileColor","backgroundColor","getFileBackgroundColor","isTypeAccepted","accept","undefined","acceptList","split","map","raw","trim","some","acceptedType","endsWith","baseType","startsWith","fileType","fileDropzoneCss","FileDropzone","this","renderOnDragLayout","disabled","hasFileToDrop","h","class","renderText","renderHelperText","text","helperText","handleDrop","event","stopPropagation","preventDefault","files","Array","from","dataTransfer","fileInfos","acceptedFileInfos","rejectedFileInfos","filesSelected","emit","filesRejected","handleDragOver","handleDragLeave","render","Host","onDrop","onDragOver","onDragLeave","FileInput","fileInputId","createRandomString","handleClick","triggerFileDialog","handleKeyUp","code","handleFileChange","fileInput","componentDidLoad","element","shadowRoot","getElementById","onClick","onKeyUp","onKeyDown","handleKeyDown","hidden","onChange","multiple","click"],"sources":["./node_modules/lodash-es/_arrayAggregator.js","./node_modules/lodash-es/_createBaseEach.js","./node_modules/lodash-es/_baseEach.js","./node_modules/lodash-es/_baseAggregator.js","./node_modules/lodash-es/_createAggregator.js","./node_modules/lodash-es/partition.js","./src/util/files.ts","./src/components/file-dropzone/file-dropzone.scss?tag=limel-file-dropzone&encapsulation=shadow","./src/components/file-dropzone/file-dropzone.tsx","./src/components/file-input/file-input.tsx"],"sourcesContent":["/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nexport default arrayAggregator;\n","import isArrayLike from './isArrayLike.js';\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nexport default createBaseEach;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","import baseEach from './_baseEach.js';\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nexport default baseAggregator;\n","import arrayAggregator from './_arrayAggregator.js';\nimport baseAggregator from './_baseAggregator.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nexport default createAggregator;\n","import createAggregator from './_createAggregator.js';\n\n/**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\nvar partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n}, function() { return [[], []]; });\n\nexport default partition;\n","import { FileInfo } from '../global/shared-types/file.types';\nimport {\n getFileBackgroundColor,\n getFileColor,\n getFileExtensionTitle,\n getFileIcon,\n} from './file-metadata';\n\nexport function createFileInfo(file: File): FileInfo {\n const limeFile: FileInfo = {\n id: crypto.randomUUID(),\n filename: file.name,\n contentType: file.type,\n size: file.size,\n fileContent: file,\n };\n limeFile.icon = {\n name: getFileIcon(limeFile),\n title: getFileExtensionTitle(limeFile),\n color: getFileColor(limeFile),\n backgroundColor: getFileBackgroundColor(limeFile),\n };\n\n return limeFile;\n}\n\nexport function isTypeAccepted(file: FileInfo, accept?: string): boolean {\n if (accept === undefined || accept === '*') {\n return true;\n }\n\n const acceptList = accept.split(',').map((raw) => raw.trim());\n\n return acceptList.some((acceptedType: string) => {\n if (acceptedType === file.contentType) {\n return true;\n }\n\n if (acceptedType.endsWith('/*')) {\n const baseType = acceptedType.split('/')[0];\n\n return file.contentType.startsWith(`${baseType}/`);\n }\n\n if (acceptedType.startsWith('.')) {\n const fileType = acceptedType.split('.')[1];\n\n return file.contentType.endsWith(`/${fileType}`);\n }\n });\n}\n",":host(limel-file-dropzone) {\n display: block;\n position: relative;\n}\n\n.has-file-to-drop {\n animation: display-drop-zone 0.6s ease forwards;\n\n box-sizing: border-box;\n isolation: isolate;\n z-index: 1;\n position: absolute;\n inset: 0.25rem;\n\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n\n color: rgb(var(--contrast-700));\n\n border: 0.125rem dashed rgb(var(--color-cyan-light));\n border-radius: 0.75rem;\n}\n\n.text-helpertext {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n}\n\n.icon {\n width: clamp(2rem, 5vh, 7rem);\n}\n\n.text {\n font-size: clamp(1rem, 2vh, 1.75rem);\n}\n\n.helper-text {\n font-size: clamp(0.75rem, 1.5vh, 1rem);\n}\n\n@keyframes display-drop-zone {\n 0% {\n background-color: rgb(var(--contrast-1100), 0);\n backdrop-filter: blur(0);\n -webkit-backdrop-filter: blur(0);\n scale: 0.9;\n opacity: 0;\n }\n\n 50% {\n scale: 1;\n opacity: 1;\n }\n\n 100% {\n background-color: rgb(var(--contrast-1100), 0.8);\n backdrop-filter: blur(0.25rem);\n -webkit-backdrop-filter: blur(0.25rem);\n }\n}\n","import {\n Component,\n h,\n Event,\n EventEmitter,\n Host,\n Prop,\n State,\n} from '@stencil/core';\nimport { FileInfo } from '../../global/shared-types/file.types';\nimport { createFileInfo, isTypeAccepted } from '../../util/files';\nimport { partition } from 'lodash-es';\n\n/**\n * This component enables you to seamlessly convert any region of the user interface into\n * a file dropzone area, just by wrapping it inside the `limel-file-dropzone`.\n *\n * The file dropzone can then be used to allow end-users to upload files\n * by dragging and dropping them into the specified area, for example to trigger an upload process.\n *\n * After receiving the files, the component emits a `filesSelected` event. For unsupported\n * files (specified with the `accept` prop) a `filesRejected` event will be emitted.\n *\n * The event detail would be an array of `FileInfo` objects,\n * each representing a file dropped into the dropzone.\n *\n * @exampleComponent limel-example-file-dropzone\n * @exampleComponent limel-example-file-dropzone-type-filtering\n * @private\n */\n@Component({\n tag: 'limel-file-dropzone',\n shadow: true,\n styleUrl: 'file-dropzone.scss',\n})\nexport class FileDropzone {\n /**\n * Specifies the types of files that the dropzone will accept. By default, all file types are accepted.\n *\n * For media files, formats can be specified using: `audio/*`, `video/*`, `image/*`.\n * Unique file type specifiers can also be used, for example: `.jpg`, `.pdf`.\n * A comma-separated list of file extensions or MIME types is also acceptable, e.g., `image/png, image/jpeg` or\n * `.png, .jpg, .jpeg`.\n *\n * @see [HTML attribute: accept](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept) for more\n * details.\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Set to `true` to disable the file dropzone.\n */\n @Prop()\n public disabled: boolean = false;\n\n /**\n * Is displayed when the user is dragging a file over the dropzone.\n * A suitable text could for instance be \"Drop your files here\".\n */\n @Prop()\n public text: string;\n\n /**\n * Is displayed to provide supplementary information to the end users,\n * for instance, which filetypes or file sizes are accepted.\n */\n @Prop()\n public helperText?: string = '';\n\n /**\n * Sets to true when there is a file to drop\n */\n @State()\n private hasFileToDrop: boolean = false;\n\n /**\n * Emitted when files are selected\n */\n @Event()\n filesSelected: EventEmitter<FileInfo[]>;\n\n /**\n * Emitted when files are selected but do not conform with the `accept` property specifications.\n * This can happen when the file types or formats of the selected files are not among the ones allowed by the dropzone,\n * as defined by the `accept` property.\n *\n * @see `accept` for details on how to specify acceptable file types.\n */\n @Event()\n filesRejected: EventEmitter<FileInfo[]>;\n\n public render() {\n return (\n <Host\n onDrop={this.handleDrop}\n onDragOver={this.handleDragOver}\n onDragLeave={this.handleDragLeave}\n >\n <slot />\n {this.renderOnDragLayout()}\n </Host>\n );\n }\n\n private renderOnDragLayout = () => {\n if (this.disabled || !this.hasFileToDrop) {\n return;\n }\n\n return (\n <div class=\"has-file-to-drop\">\n <limel-icon class=\"icon\" name=\"upload_2\" />\n <div class=\"text-helpertext\">\n {this.renderText()}\n {this.renderHelperText()}\n </div>\n </div>\n );\n };\n\n private renderText = () => {\n if (!this.text) {\n return;\n }\n\n return <span class=\"text\">{this.text}</span>;\n };\n\n private renderHelperText = () => {\n if (!this.helperText) {\n return;\n }\n\n return <span class=\"helper-text\">{this.helperText}</span>;\n };\n\n private handleDrop = (event: DragEvent) => {\n event.stopPropagation();\n event.preventDefault();\n this.hasFileToDrop = false;\n\n if (this.disabled) {\n return;\n }\n\n const files: File[] = Array.from(event.dataTransfer.files);\n const fileInfos: FileInfo[] = files.map(createFileInfo);\n\n const [acceptedFileInfos, rejectedFileInfos] = partition(\n fileInfos,\n (file) => isTypeAccepted(file, this.accept),\n );\n\n if (acceptedFileInfos.length > 0) {\n this.filesSelected.emit(acceptedFileInfos);\n }\n\n if (rejectedFileInfos.length > 0) {\n this.filesRejected.emit(rejectedFileInfos);\n }\n };\n\n private handleDragOver = (event: DragEvent) => {\n this.hasFileToDrop = true;\n event.preventDefault();\n };\n\n private handleDragLeave = (event: DragEvent) => {\n this.hasFileToDrop = false;\n event.preventDefault();\n };\n}\n","import {\n h,\n Event,\n EventEmitter,\n Host,\n Component,\n Element,\n Prop,\n} from '@stencil/core';\nimport { createRandomString } from '../../util/random-string';\nimport { FileInfo } from '../../global/shared-types/file.types';\nimport { createFileInfo } from '../../util/files';\n\n/**\n * This component enables you to seamlessly transform any other clickable component that\n * generates a `click` event into a file input selector.\n *\n * To use it, just wrap any clickable component inside the `limel-file-input` component.\n * Upon reception of the `click` event this component will open the native file selection\n * dialog.\n *\n * After receiving the files, the component emits a `filesSelected` event.\n *\n * The event detail would be an array of `FileInfo` objects,\n * each representing a file dropped into the dropzone.\n *\n * @exampleComponent limel-example-file-input\n * @exampleComponent limel-example-file-input-type-filtering\n * @private\n */\n@Component({\n tag: 'limel-file-input',\n shadow: true,\n})\nexport class FileInput {\n /**\n * Specifies the types of files that the dropzone will accept. By default, all file types are accepted.\n *\n * For media files, formats can be specified using: `audio/*`, `video/*`, `image/*`.\n * Unique file type specifiers can also be used, for example: `.jpg`, `.pdf`.\n * A comma-separated list of file extensions or MIME types is also acceptable, e.g., `image/png, image/jpeg` or\n * `.png, .jpg, .jpeg`.\n *\n * @see [HTML attribute: accept](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept) for more\n * details.\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Set to `true` to disable file input selection.\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * Set to `true` to enable selection of multiple files\n */\n @Prop({ reflect: true })\n public multiple: boolean = false;\n\n /**\n * Emitted when files are selected\n */\n @Event()\n filesSelected: EventEmitter<FileInfo[]>;\n\n @Element()\n private element: HTMLLimelFileElement;\n\n private fileInput: HTMLInputElement;\n private fileInputId = createRandomString();\n\n public componentDidLoad() {\n this.fileInput = this.element.shadowRoot.getElementById(\n this.fileInputId,\n ) as HTMLInputElement;\n }\n\n public render() {\n return (\n <Host\n onClick={this.handleClick}\n onKeyUp={this.handleKeyUp}\n onKeyDown={this.handleKeyDown}\n >\n <input\n hidden={true}\n id={this.fileInputId}\n onChange={this.handleFileChange}\n type=\"file\"\n accept={this.accept}\n disabled={this.disabled}\n multiple={this.multiple}\n />\n <slot />\n </Host>\n );\n }\n\n private handleClick = (event: Event) => {\n if (this.disabled) {\n event.stopPropagation();\n event.preventDefault();\n\n return;\n }\n\n this.triggerFileDialog();\n\n event.stopPropagation();\n };\n\n private handleKeyUp = (event: KeyboardEvent) => {\n event.stopPropagation();\n event.preventDefault();\n\n if (event.code === 'Enter') {\n this.triggerFileDialog();\n }\n };\n\n private handleKeyDown(event: KeyboardEvent) {\n if (\n event.code === 'Tab' ||\n event.code === 'Backspace' ||\n event.code === 'Enter'\n ) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n }\n\n private triggerFileDialog() {\n this.fileInput.click();\n }\n\n private handleFileChange = (event: Event) => {\n const files = Array.from(this.fileInput.files);\n if (files.length > 0) {\n event.stopPropagation();\n this.filesSelected.emit(files.map(createFileInfo));\n this.fileInput.value = '';\n }\n };\n}\n"],"mappings":"6eAUA,SAASA,EAAgBC,EAAOC,EAAQC,EAAUC,GAChD,IAAIC,GAAS,EACTC,EAASL,GAAS,KAAO,EAAIA,EAAMK,OAEvC,QAASD,EAAQC,EAAQ,CACvB,IAAIC,EAAQN,EAAMI,GAClBH,EAAOE,EAAaG,EAAOJ,EAASI,GAAQN,EAChD,CACE,OAAOG,CACT,CCTA,SAASI,EAAeC,EAAUC,GAChC,OAAO,SAASC,EAAYR,GAC1B,GAAIQ,GAAc,KAAM,CACtB,OAAOA,CACb,CACI,IAAKC,EAAYD,GAAa,CAC5B,OAAOF,EAASE,EAAYR,EAClC,CACI,IAAIG,EAASK,EAAWL,OACpBD,EAAQ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,O"}
@@ -0,0 +1,2 @@
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
@@ -1 +1 @@
1
- {"version":3,"names":["fileCss","DEFAULT_FILE_CHIP","id","text","removable","File","this","handleNewFiles","event","preventAndStop","change","emit","detail","handleChipSetChange","stopPropagation","file","length","handleChipInteract","interact","render","h","disabled","readonly","value","accept","onFilesSelected","renderChipset","getChipArray","filename","icon","name","getFileIcon","title","getFileExtensionTitle","color","getFileColor","backgroundColor","getFileBackgroundColor","href","chipset","invalid","label","leadingIcon","language","onChange","onInteract","required","type","getTranslation","preventDefault","key","translate","get"],"sources":["./src/components/file/file.scss?tag=limel-file&encapsulation=shadow","./src/components/file/file.tsx"],"sourcesContent":["/**\n * @prop --icon-background-color: Background color of the icon. Defaults to `--contrast-400`.\n * @prop --icon-color: Color of the icon. Defaults to `--contrast-1100`.\n */\n","import translate from '../../global/translations';\nimport { Chip } from '../chip-set/chip.types';\nimport { Languages } from '../date-picker/date.types';\nimport { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport {\n getFileBackgroundColor,\n getFileColor,\n getFileExtensionTitle,\n getFileIcon,\n} from '../../util/file-metadata';\nimport { FileInfo } from '../../global/shared-types/file.types';\n\nconst DEFAULT_FILE_CHIP: Chip = {\n id: null,\n text: null,\n removable: true,\n};\n\n/**\n * This component lets end-users select a *single* file from their device\n * storage. Regardless of the user's device or operating system, this component\n * opens up a file picker dialog that allows the user to choose a file.\n *\n * ## Using correct labels\n *\n * This file picker can be used in different contexts. The component's distinct\n * visual design including the upload icon hints end-users that this is not a\n * normal input field like other fields in the form for example.\n *\n * :::important\n * you need to use a descriptive `label` that clarifies the\n * functionality of the file picker, and/or provides users with clear\n * instructions.\n *\n * Depending on the context, you may need to avoid labels such as:\n * - File\n * - Document\n *\n * and instead consider using labels like:\n * - Attach a file\n * - Upload a file\n * - Choose a document\n * - Choose a file\n *\n * and similar phrases...\n * :::\n *\n * @exampleComponent limel-example-file\n * @exampleComponent limel-example-file-custom-icon\n * @exampleComponent limel-example-file-accepted-types\n * @exampleComponent limel-example-file-composite\n */\n@Component({\n tag: 'limel-file',\n shadow: true,\n styleUrl: 'file.scss',\n})\nexport class File {\n /**\n * The selected file.\n */\n @Prop()\n public value: FileInfo;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required: boolean = false;\n\n /**\n * True if the input should be disabled\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * Set to `true` to disable adding and removing files, but allow interaction\n * with any already existing file.\n */\n @Prop({ reflect: true })\n public readonly: boolean = false;\n\n /**\n * Set to `true` to indicate that the current value of the chosen file is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The [accepted file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers)\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Defines the localisation for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Dispatched when a file is selected/deselected\n */\n @Event()\n private change: EventEmitter<FileInfo>;\n\n /**\n * Dispatched when clicking on a chip\n */\n @Event()\n private interact: EventEmitter<number | string>;\n\n public render() {\n return (\n <limel-file-dropzone\n disabled={this.disabled || this.readonly || !!this.value}\n accept={this.accept}\n onFilesSelected={this.handleNewFiles}\n >\n {this.renderChipset()}\n </limel-file-dropzone>\n );\n }\n\n private handleNewFiles = (event: CustomEvent<FileInfo[]>) => {\n this.preventAndStop(event);\n this.change.emit(event.detail[0]);\n };\n\n private getChipArray(): Chip[] {\n if (!this.value) {\n return [];\n }\n\n return [\n {\n ...DEFAULT_FILE_CHIP,\n text: this.value.filename,\n id: this.value.id,\n icon: {\n name: getFileIcon(this.value),\n title: getFileExtensionTitle(this.value),\n color: getFileColor(this.value),\n backgroundColor: getFileBackgroundColor(this.value),\n },\n href: this.value.href,\n },\n ];\n }\n\n private renderChipset() {\n const chipset = (\n <limel-chip-set\n disabled={this.disabled}\n readonly={this.readonly}\n invalid={this.invalid}\n label={this.label}\n leadingIcon=\"upload_to_cloud\"\n language={this.language}\n onChange={this.handleChipSetChange}\n onInteract={this.handleChipInteract}\n required={this.required}\n type=\"input\"\n value={this.getChipArray()}\n title={this.getTranslation('drag-and-drop-tips')}\n />\n );\n\n if (this.value) {\n return chipset;\n }\n\n return (\n <limel-file-input\n accept={this.accept}\n disabled={this.disabled || this.readonly}\n >\n {chipset}\n </limel-file-input>\n );\n }\n\n private handleChipSetChange = (event: CustomEvent) => {\n event.stopPropagation();\n const file = !event.detail.length ? event.detail[0] : null;\n if (!file) {\n this.change.emit(file);\n }\n };\n\n private handleChipInteract = (event: CustomEvent<Chip>) => {\n this.preventAndStop(event);\n this.interact.emit(event.detail.id);\n };\n\n private preventAndStop(event: Event) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private getTranslation(key: string) {\n return translate.get(`file.${key}`, this.language);\n }\n}\n"],"mappings":"+LAAA,MAAMA,EAAU,GCYhB,MAAMC,EAA0B,CAC5BC,GAAI,KACJC,KAAM,KACNC,UAAW,M,MA0CFC,EAAI,M,2FA2ELC,KAAAC,eAAkBC,IACtBF,KAAKG,eAAeD,GACpBF,KAAKI,OAAOC,KAAKH,EAAMI,OAAO,GAAG,EAwD7BN,KAAAO,oBAAuBL,IAC3BA,EAAMM,kBACN,MAAMC,GAAQP,EAAMI,OAAOI,OAASR,EAAMI,OAAO,GAAK,KACtD,IAAKG,EAAM,CACPT,KAAKI,OAAOC,KAAKI,E,GAIjBT,KAAAW,mBAAsBT,IAC1BF,KAAKG,eAAeD,GACpBF,KAAKY,SAASP,KAAKH,EAAMI,OAAOV,GAAG,E,wDA9HZ,M,cAMA,M,cAOA,M,aAOV,M,YAMO,I,cAMK,I,CActBiB,SACH,OACIC,EAAA,uBACIC,SAAUf,KAAKe,UAAYf,KAAKgB,YAAchB,KAAKiB,MACnDC,OAAQlB,KAAKkB,OACbC,gBAAiBnB,KAAKC,gBAErBD,KAAKoB,gB,CAUVC,eACJ,IAAKrB,KAAKiB,MAAO,CACb,MAAO,E,CAGX,MAAO,C,+BAEItB,GAAiB,CACpBE,KAAMG,KAAKiB,MAAMK,SACjB1B,GAAII,KAAKiB,MAAMrB,GACf2B,KAAM,CACFC,KAAMC,EAAYzB,KAAKiB,OACvBS,MAAOC,EAAsB3B,KAAKiB,OAClCW,MAAOC,EAAa7B,KAAKiB,OACzBa,gBAAiBC,EAAuB/B,KAAKiB,QAEjDe,KAAMhC,KAAKiB,MAAMe,O,CAKrBZ,gBACJ,MAAMa,EACFnB,EAAA,kBACIC,SAAUf,KAAKe,SACfC,SAAUhB,KAAKgB,SACfkB,QAASlC,KAAKkC,QACdC,MAAOnC,KAAKmC,MACZC,YAAY,kBACZC,SAAUrC,KAAKqC,SACfC,SAAUtC,KAAKO,oBACfgC,WAAYvC,KAAKW,mBACjB6B,SAAUxC,KAAKwC,SACfC,KAAK,QACLxB,MAAOjB,KAAKqB,eACZK,MAAO1B,KAAK0C,eAAe,wBAInC,GAAI1C,KAAKiB,MAAO,CACZ,OAAOgB,C,CAGX,OACInB,EAAA,oBACII,OAAQlB,KAAKkB,OACbH,SAAUf,KAAKe,UAAYf,KAAKgB,UAE/BiB,E,CAkBL9B,eAAeD,GACnBA,EAAMM,kBACNN,EAAMyC,gB,CAGFD,eAAeE,GACnB,OAAOC,EAAUC,IAAI,QAAQF,IAAO5C,KAAKqC,S"}
1
+ {"version":3,"names":["fileCss","DEFAULT_FILE_CHIP","id","text","removable","File","this","handleNewFiles","event","preventAndStop","change","emit","detail","handleChipSetChange","stopPropagation","file","length","handleChipInteract","interact","render","h","disabled","readonly","value","accept","onFilesSelected","renderChipset","getChipArray","filename","icon","name","getFileIcon","title","getFileExtensionTitle","color","getFileColor","backgroundColor","getFileBackgroundColor","href","chipset","invalid","label","leadingIcon","language","onChange","onInteract","required","type","getTranslation","preventDefault","key","translate","get"],"sources":["./src/components/file/file.scss?tag=limel-file&encapsulation=shadow","./src/components/file/file.tsx"],"sourcesContent":["/**\n * @prop --icon-background-color: Background color of the icon. Defaults to `--contrast-400`.\n * @prop --icon-color: Color of the icon. Defaults to `--contrast-1100`.\n */\n","import translate from '../../global/translations';\nimport { Chip } from '../chip-set/chip.types';\nimport { Languages } from '../date-picker/date.types';\nimport { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport {\n getFileBackgroundColor,\n getFileColor,\n getFileExtensionTitle,\n getFileIcon,\n} from '../../util/file-metadata';\nimport { FileInfo } from '../../global/shared-types/file.types';\n\nconst DEFAULT_FILE_CHIP: Chip = {\n id: null,\n text: null,\n removable: true,\n};\n\n/**\n * This component lets end-users select a *single* file from their device\n * storage. Regardless of the user's device or operating system, this component\n * opens up a file picker dialog that allows the user to choose a file.\n *\n * ## Using correct labels\n *\n * This file picker can be used in different contexts. The component's distinct\n * visual design including the upload icon hints end-users that this is not a\n * normal input field like other fields in the form for example.\n *\n * :::important\n * you need to use a descriptive `label` that clarifies the\n * functionality of the file picker, and/or provides users with clear\n * instructions.\n *\n * Depending on the context, you may need to avoid labels such as:\n * - File\n * - Document\n *\n * and instead consider using labels like:\n * - Attach a file\n * - Upload a file\n * - Choose a document\n * - Choose a file\n *\n * and similar phrases...\n * :::\n *\n * @exampleComponent limel-example-file\n * @exampleComponent limel-example-file-custom-icon\n * @exampleComponent limel-example-file-accepted-types\n * @exampleComponent limel-example-file-composite\n */\n@Component({\n tag: 'limel-file',\n shadow: true,\n styleUrl: 'file.scss',\n})\nexport class File {\n /**\n * The selected file.\n */\n @Prop()\n public value: FileInfo;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required: boolean = false;\n\n /**\n * True if the input should be disabled\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * Set to `true` to disable adding and removing files, but allow interaction\n * with any already existing file.\n */\n @Prop({ reflect: true })\n public readonly: boolean = false;\n\n /**\n * Set to `true` to indicate that the current value of the chosen file is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The [accepted file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers)\n */\n @Prop({ reflect: true })\n public accept: string = '*';\n\n /**\n * Defines the localisation for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Dispatched when a file is selected/deselected\n */\n @Event()\n private change: EventEmitter<FileInfo>;\n\n /**\n * Dispatched when clicking on a chip\n */\n @Event()\n private interact: EventEmitter<number | string>;\n\n public render() {\n return (\n <limel-file-dropzone\n disabled={this.disabled || this.readonly || !!this.value}\n accept={this.accept}\n onFilesSelected={this.handleNewFiles}\n >\n {this.renderChipset()}\n </limel-file-dropzone>\n );\n }\n\n private handleNewFiles = (event: CustomEvent<FileInfo[]>) => {\n this.preventAndStop(event);\n this.change.emit(event.detail[0]);\n };\n\n private getChipArray(): Chip[] {\n if (!this.value) {\n return [];\n }\n\n return [\n {\n ...DEFAULT_FILE_CHIP,\n text: this.value.filename,\n id: this.value.id,\n icon: {\n name: getFileIcon(this.value),\n title: getFileExtensionTitle(this.value),\n color: getFileColor(this.value),\n backgroundColor: getFileBackgroundColor(this.value),\n },\n href: this.value.href,\n },\n ];\n }\n\n private renderChipset() {\n const chipset = (\n <limel-chip-set\n disabled={this.disabled}\n readonly={this.readonly}\n invalid={this.invalid}\n label={this.label}\n leadingIcon=\"upload_to_cloud\"\n language={this.language}\n onChange={this.handleChipSetChange}\n onInteract={this.handleChipInteract}\n required={this.required}\n type=\"input\"\n value={this.getChipArray()}\n title={this.getTranslation('drag-and-drop-tips')}\n />\n );\n\n if (this.value) {\n return chipset;\n }\n\n return (\n <limel-file-input\n accept={this.accept}\n disabled={this.disabled || this.readonly}\n >\n {chipset}\n </limel-file-input>\n );\n }\n\n private handleChipSetChange = (event: CustomEvent) => {\n event.stopPropagation();\n const file = !event.detail.length ? event.detail[0] : null;\n if (!file) {\n this.change.emit(file);\n }\n };\n\n private handleChipInteract = (event: CustomEvent<Chip>) => {\n this.preventAndStop(event);\n this.interact.emit(event.detail.id);\n };\n\n private preventAndStop(event: Event) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private getTranslation(key: string) {\n return translate.get(`file.${key}`, this.language);\n }\n}\n"],"mappings":"uKAAA,MAAMA,EAAU,GCYhB,MAAMC,EAA0B,CAC5BC,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KiB,MAAO,CACZ,OAAOgB,C,CAGX,OACInB,EAAA,oBACII,OAAQlB,KAAKkB,OACbH,SAAUf,KAAKe,UAAYf,KAAKgB,UAE/BiB,E,CAkBL9B,eAAeD,GACnBA,EAAMM,kBACNN,EAAMyC,gB,CAGFD,eAAeE,GACnB,OAAOC,EAAUC,IAAI,QAAQF,IAAO5C,KAAKqC,S"}
@@ -1,13 +1,2 @@
1
- /**
2
- * Takes a file extension as argument and returns the background color to use.
3
- * While some file types have a fairly universally accepted icon color, like
4
- * blue for Word documents, others are more arbitrary. This function provides
5
- * a convention that we use at Lime. If you are using this code in your own
6
- * project, you may or may not find this helper useful.
7
- *
8
- * @param extension - The file extension (without the dot).
9
- * @returns The color to use for the icon.
10
- * @public
11
- */
12
1
  export declare function getIconBackgroundColorForFile(extension: string): string;
13
2
  //# sourceMappingURL=icon-background-colors.d.ts.map
@@ -1,13 +1,2 @@
1
- /**
2
- * Takes a file extension as argument and returns the fill color to use.
3
- * While some file types have a fairly universally accepted icon color, like
4
- * blue for Word documents, others are more arbitrary. This function provides
5
- * a convention that we use at Lime. If you are using this code in your own
6
- * project, you may or may not find this helper useful.
7
- *
8
- * @param extension - The file extension (without the dot).
9
- * @returns The color to use for the icon.
10
- * @public
11
- */
12
1
  export declare function getIconFillColorForFile(extension: string): string;
13
2
  //# sourceMappingURL=icon-fill-colors.d.ts.map
@@ -1,11 +1,2 @@
1
- /**
2
- * Takes a file extension as argument and returns the corresponding icon name.
3
- * Uses the names from the private icon package `lime-icons8`. If you are using
4
- * a different icon package, this functions is probably not useful for you.
5
- *
6
- * @param extension - The file extension (without the dot).
7
- * @returns The name of the icon to use.
8
- * @public
9
- */
10
1
  export declare function getIconForFile(extension: string): string;
11
2
  //# sourceMappingURL=icons.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { Schema } from 'prosemirror-model';
2
2
  import { MenuElement } from 'prosemirror-menu';
3
3
  /**
4
- * Creates the default menu for the text editor
4
+ * Creates the full menu for the text editor
5
5
  * based on the default menu already in prosemirror-example-setup
6
6
  * @param schema - the schema to use for the menu
7
7
  *
8
8
  * @returns the default menu for the text editor
9
9
  */
10
- export declare const buildDefaultMenu: (schema: Schema) => MenuElement[][];
11
- //# sourceMappingURL=default-menu.d.ts.map
10
+ export declare const buildFullMenu: (schema: Schema) => MenuElement[][];
11
+ //# sourceMappingURL=full-menu.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { MenuElement } from 'prosemirror-menu';
2
+ import { EditorPluginButton } from './types';
3
+ /**
4
+ * Filters the full menu recursively based on the items provided
5
+ *
6
+ * @param menu - The menu to filter
7
+ * @param items - The menu items to display. If undefined, all items will be displayed
8
+ * @returns The filtered menu
9
+ */
10
+ export declare const getFilteredMenu: (menu: MenuElement[], items: EditorPluginButton[] | undefined) => MenuElement[];
11
+ //# sourceMappingURL=menu-filter.d.ts.map
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The `EditorButton` type is used to specify the type of buttons that can be used in the editor toolbar.
3
+ * Each string represents a different button that can be added to the toolbar.
4
+ *
5
+ * The following buttons are available:
6
+ * 'strong' - Button for making text bold.
7
+ * 'emphasis' - Button for italicizing text.
8
+ * 'link' - Button for adding a hyperlink.
9
+ * 'heading 1 - Button for creating a level 1 heading.
10
+ * 'heading 2 - Button for creating a level 2 heading.
11
+ * 'heading 3 - Button for creating a level 3 heading.
12
+ * 'heading 4 - Button for creating a level 4 heading.
13
+ * 'heading 5 - Button for creating a level 5 heading.
14
+ * 'heading 6 - Button for creating a level 6 heading.
15
+ * 'block quote' - Button for creating a block quote.
16
+ *
17
+ * @beta
18
+ */
19
+ export type EditorButton = 'strong' | 'emphasis' | 'link' | 'heading 1' | 'heading 2' | 'heading 3' | 'heading 4' | 'heading 5' | 'heading 6' | 'block quote' | 'bullet list' | 'ordered list' | EditorPluginButton;
20
+ /**
21
+ * The `EditorPluginButton` type is used to specify the type of buttons that can be added to the editor toolbar.
22
+ *
23
+ * 'code' - Button for marking inline code.
24
+ * 'horizontal rule' - Button for inserting a horizontal rule.
25
+ * 'code block' - Button for creating a block of code.
26
+ * 'paragraph'- Button for creating a new paragraph.
27
+ * 'join above' - Button for joining the current block with the one above it.
28
+ * 'lift out' - Button for lifting the current block out of its parent block.
29
+ * 'undo' - Button for undoing the last action.
30
+ * 'redo' - Button for redoing the last undone action.
31
+ *
32
+ * @beta
33
+ */
34
+ export type EditorPluginButton = 'code' | 'horizontal rule' | 'code block' | 'paragraph' | 'join above' | 'lift out' | 'undo' | 'redo';
35
+ //# sourceMappingURL=types.d.ts.map
@@ -9,7 +9,7 @@ export * from './components/collapsible-section/action';
9
9
  export * from './components/date-picker/date.types';
10
10
  export * from './components/dialog/dialog.types';
11
11
  export * from './components/dock/dock.types';
12
- export * from './components/file';
12
+ export * from './global/shared-types/file.types';
13
13
  export * from './components/flex-container/flex-container.types';
14
14
  export { EventEmitter, ValidationStatus, FormError, ValidationError, FormComponent, FormInfo, LimeSchemaOptions, LimeLayoutOptions, FormComponentOptions, FormLayoutOptions, GridLayoutOptions, RowLayoutOptions, FormLayoutType, ReplaceObjectType, FormSchemaArrayItem, FormSubKeySchema, } from './components/form/form.types';
15
15
  export * from './components/help/help.types';
@@ -28,7 +28,6 @@ export * from './components/select/option.types';
28
28
  export * from './components/spinner/spinner.types';
29
29
  export * from './components/tab-panel/tab-panel.types';
30
30
  export * from './components/table/table.types';
31
- export * from './global/shared-types/file.types';
32
- export * from './global/shared-types/icon.types';
33
31
  export * from './global/shared-types/separator.types';
32
+ export * from './global/shared-types/icon.types';
34
33
  //# sourceMappingURL=interface.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "37.19.0-dev.1",
3
+ "version": "37.19.1",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -1,58 +0,0 @@
1
- 'use strict';
2
-
3
- const icons = require('./icons-8ecb9740.js');
4
- const getIconProps = require('./get-icon-props-50be7440.js');
5
-
6
- function getFileIcon(file) {
7
- const name = getIconProps.getIconName(file.icon);
8
- if (name) {
9
- return name;
10
- }
11
- const extension = getExtension(file);
12
- if (!extension) {
13
- return;
14
- }
15
- return icons.getIconForFile(extension);
16
- }
17
- function getFileColor(file) {
18
- const color = getIconProps.getIconColor(file.icon, file.iconColor);
19
- if (color) {
20
- return color;
21
- }
22
- const extension = getExtension(file);
23
- if (!extension) {
24
- return;
25
- }
26
- return icons.getIconFillColorForFile(extension);
27
- }
28
- function getFileBackgroundColor(file) {
29
- const backgroundColor = getIconProps.getIconBackgroundColor(file.icon, file.iconBackgroundColor);
30
- if (backgroundColor) {
31
- return backgroundColor;
32
- }
33
- const extension = getExtension(file);
34
- if (!extension) {
35
- return;
36
- }
37
- return icons.getIconBackgroundColorForFile(extension);
38
- }
39
- function getFileExtensionTitle(file) {
40
- const name = getIconProps.getIconName(file.icon);
41
- if (name) {
42
- return name;
43
- }
44
- return getExtension(file);
45
- }
46
- function getExtension(file) {
47
- if (!file) {
48
- return;
49
- }
50
- return file.filename.split('.').pop();
51
- }
52
-
53
- exports.getFileBackgroundColor = getFileBackgroundColor;
54
- exports.getFileColor = getFileColor;
55
- exports.getFileExtensionTitle = getFileExtensionTitle;
56
- exports.getFileIcon = getFileIcon;
57
-
58
- //# sourceMappingURL=file-metadata-062e1135.js.map
@@ -1 +0,0 @@
1
- {"file":"file-metadata-062e1135.js","mappings":";;;;;SAUgB,WAAW,CAAC,IAAc;EACtC,MAAM,IAAI,GAAGA,wBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAEpC,IAAI,IAAI,EAAE;IACN,OAAO,IAAI,CAAC;GACf;EAED,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;EACrC,IAAI,CAAC,SAAS,EAAE;IACZ,OAAO;GACV;EAED,OAAOC,oBAAc,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;SAEe,YAAY,CAAC,IAAc;EACvC,MAAM,KAAK,GAAGC,yBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;EAEtD,IAAI,KAAK,EAAE;IACP,OAAO,KAAK,CAAC;GAChB;EAED,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;EACrC,IAAI,CAAC,SAAS,EAAE;IACZ,OAAO;GACV;EAED,OAAOC,6BAAuB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC;SAEe,sBAAsB,CAAC,IAAc;EACjD,MAAM,eAAe,GAAGC,mCAAsB,CAC1C,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,mBAAmB,CAC3B,CAAC;EAEF,IAAI,eAAe,EAAE;IACjB,OAAO,eAAe,CAAC;GAC1B;EAED,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;EACrC,IAAI,CAAC,SAAS,EAAE;IACZ,OAAO;GACV;EAED,OAAOC,mCAA6B,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC;SAEe,qBAAqB,CAAC,IAAc;EAChD,MAAM,IAAI,GAAGL,wBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAEpC,IAAI,IAAI,EAAE;IACN,OAAO,IAAI,CAAC;GACf;EAED,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;SAEe,YAAY,CAAC,IAAc;EACvC,IAAI,CAAC,IAAI,EAAE;IACP,OAAO;GACV;EAED,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AAC1C;;;;;;;","names":["getIconName","getIconForFile","getIconColor","getIconFillColorForFile","getIconBackgroundColor","getIconBackgroundColorForFile"],"sources":["./src/util/file-metadata.ts"],"sourcesContent":["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"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"icons-8ecb9740.js","mappings":";;AAAA,MAAM,6BAA6B,GAAG,sCAAsC,CAAC;AAC7E,MAAM,8BAA8B,GAAG,sCAAsC,CAAC;AAC9E,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAC3E,MAAM,0BAA0B,GAAG,sCAAsC,CAAC;AAC1E,MAAM,0BAA0B,GAAG,wCAAwC,CAAC;AAC5E,MAAM,2BAA2B,GAAG,uCAAuC,CAAC;AAC5E,MAAM,gCAAgC,GAClC,uCAAuC,CAAC;AAC5C,MAAM,0BAA0B,GAAG,qCAAqC,CAAC;AACzE,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAC3E,MAAM,oCAAoC,GACtC,yCAAyC,CAAC;AAC9C,MAAM,6BAA6B,GAAG,sCAAsC,CAAC;AAC7E,MAAM,8BAA8B,GAAG,wCAAwC,CAAC;AACh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BAAmB;;EAG3B,GAAG,EAAE,UAAU;EACf,GAAG,EAAE,UAAU;EACf,GAAG,EAAE,UAAU;EACf,GAAG,EAAE,UAAU;;EAGf,GAAG,EAAE,UAAU;EACf,GAAG,EAAE,UAAU;EACf,IAAI,EAAE,UAAU;EAChB,GAAG,EAAE,UAAU;EACf,GAAG,EAAE,UAAU;EACf,GAAG,EAAE,UAAU;;EAGf,GAAG,EAAE,eAAe;EACpB,IAAI,EAAE,eAAe;EACrB,GAAG,EAAE,eAAe;;EAGpB,IAAI,EAAE,MAAM;EACZ,IAAI,EAAE,SAAS;EACf,GAAG,EAAE,SAAS;EACd,EAAE,EAAE,SAAS;EACb,GAAG,EAAE,SAAS;CACjB,CAAC;AAEF;;;;;;;;;SASgB,cAAc,CAAC,SAAiB;EAC5C,OAAO,iBAAiB,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,YAAY,CAAC;AACtE;;;;;;","names":[],"sources":["./src/components/file/icon-background-colors.ts","./src/components/file/icon-fill-colors.ts","./src/components/file/icons.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\n/**\n * Takes a file extension as argument and returns the background color to use.\n * While some file types have a fairly universally accepted icon color, like\n * blue for Word documents, others are more arbitrary. This function provides\n * a convention that we use at Lime. If you are using this code in your own\n * project, you may or may not find this helper useful.\n *\n * @param extension - The file extension (without the dot).\n * @returns The color to use for the icon.\n * @public\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\n/**\n * Takes a file extension as argument and returns the fill color to use.\n * While some file types have a fairly universally accepted icon color, like\n * blue for Word documents, others are more arbitrary. This function provides\n * a convention that we use at Lime. If you are using this code in your own\n * project, you may or may not find this helper useful.\n *\n * @param extension - The file extension (without the dot).\n * @returns The color to use for the icon.\n * @public\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\n/**\n * Takes a file extension as argument and returns the corresponding icon name.\n * Uses the names from the private icon package `lime-icons8`. If you are using\n * a different icon package, this functions is probably not useful for you.\n *\n * @param extension - The file extension (without the dot).\n * @returns The name of the icon to use.\n * @public\n */\nexport function getIconForFile(extension: string): string {\n return filetypeIconTable[extension.toLowerCase()] || DEFAULT_ICON;\n}\n"],"version":3}
@@ -1,4 +0,0 @@
1
- export * from './icon-background-colors';
2
- export * from './icon-fill-colors';
3
- export * from './icons';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/file/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC","sourcesContent":["export * from './icon-background-colors';\nexport * from './icon-fill-colors';\nexport * from './icons';\n"]}
@@ -1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C,SAA0B,EAAiB,EAAE;EAC/D,4CAA4C;EAC5C,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC","sourcesContent":["import { Schema } from 'prosemirror-model';\nimport { MenuElement, Dropdown, MenuItem } from 'prosemirror-menu';\nimport { buildMenuItems } from 'prosemirror-example-setup';\n\n/**\n * Creates the default menu for the text editor\n * based on the default menu already in prosemirror-example-setup\n * @param schema - the schema to use for the menu\n *\n * @returns the default menu for the text editor\n */\nexport const buildDefaultMenu = (schema: Schema): MenuElement[][] => {\n const menuItems = buildMenuItems(schema) as unknown as {\n blockMenu: MenuElement[][];\n fullMenu: MenuElement[][];\n inlineMenu: MenuElement[][];\n insertHorizontalRule: MenuItem;\n typeMenu: Dropdown & {\n content: MenuElement[];\n };\n };\n const { inlineMenu, insertHorizontalRule } = menuItems;\n const typeMenu = getNewMenu(menuItems.typeMenu);\n const newHorizontalRule = new MenuItem({\n ...insertHorizontalRule.spec,\n label: 'hr',\n });\n const historyButtons = menuItems.fullMenu[2];\n const blockMenu = getBlockMenu(menuItems.blockMenu);\n\n return [\n inlineMenu[0],\n [newHorizontalRule],\n ...typeMenu,\n historyButtons,\n blockMenu,\n ];\n};\n\nconst getNewMenu = (\n typeMenu: Dropdown & { content: MenuElement[] },\n): MenuElement[][] => {\n const headingDropdown: Dropdown = new Dropdown(\n (typeMenu.content[2] as Partial<{ content: MenuElement[] }>).content,\n {\n label: 'H',\n },\n );\n\n return [[typeMenu.content[0], typeMenu.content[1]], [headingDropdown]];\n};\n\nconst getBlockMenu = (blockMenu: MenuElement[][]): MenuElement[] => {\n // eslint-disable-next-line no-magic-numbers\n return [...blockMenu[0].slice(0, 5)];\n};\n"]}