@limetech/lime-elements 39.43.0 → 39.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/{files-Bt11HLi4.js → files-DI4jItxi.js} +5 -2
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +4 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +3 -0
- package/dist/collection/components/text-editor/text-editor.js +8 -2
- package/dist/collection/util/files.js +5 -2
- package/dist/esm/{files-CZAZotms.js → files-DnkFEKoB.js} +5 -2
- package/dist/esm/limel-file-dropzone_2.entry.js +1 -1
- package/dist/esm/limel-profile-picture.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +4 -1
- package/dist/esm/limel-text-editor.entry.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-99055d40.entry.js → p-10186cbd.entry.js} +1 -1
- package/dist/lime-elements/{p-8893e1df.entry.js → p-6722e6e2.entry.js} +1 -1
- package/dist/lime-elements/{p-C4caLnTg.js → p-CGVVDGcv.js} +1 -1
- package/dist/lime-elements/{p-1f35fc44.entry.js → p-a45b8634.entry.js} +1 -1
- package/dist/lime-elements/{p-92ea6adc.entry.js → p-ea34a4bc.entry.js} +1 -1
- package/dist/types/components/text-editor/text-editor.d.ts +7 -2
- package/dist/types/components/text-editor/text-editor.types.d.ts +8 -2
- package/dist/types/components.d.ts +5 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as o}from"./p-BGxJfR2f.js";import{i as r}from"./p-C4caLnTg.js";import{g as s}from"./p-CgNJbSP4.js";import{t as a}from"./p-Cb9R_zmF.js";import{c as l}from"./p-JbKhhoXs.js";import{r as n}from"./p-BTSG--2-.js";import{I as h}from"./p-Dpg0OkbJ.js";import"./p-BCq5M9TE.js";import"./p-Bu_YRgCL.js";const c=class{constructor(o){t(this,o),this.change=e(this,"change"),this.filesRejected=e(this,"filesRejected"),this.language="en",this.icon="user",this.disabled=!1,this.readonly=!1,this.required=!1,this.invalid=!1,this.loading=!1,this.imageFit="cover",this.accept="image/jpeg,image/png,image/heic,.jpg,.jpeg,.png,.heic",this.imageError=!1,this.isErrorMessagePopoverOpen=!1,this.removeButtonId=l(),this.browseButtonId=l(),this.renderHelperText=()=>{if(this.helperText)return i("limel-tooltip",{elementId:this.browseButtonId,label:this.helperText})},this.handleNewFiles=async t=>{var e,i,o,s;if(t.stopPropagation(),this.disabled)return;const a=null===(e=t.detail)||void 0===e?void 0:e[0];if(!a)return;if(!r(a,this.accept))return void this.filesRejected.emit([a]);this.revokeObjectUrl(),this.imageError=!1;let l=a;if(this.resize&&a.fileContent instanceof File)try{const t=await n(a.fileContent,Object.assign(Object.assign({},this.resize),{fit:null!==(i=this.resize.fit)&&void 0!==i?i:this.imageFit,type:null!==(o=this.resize.type)&&void 0!==o?o:"image/jpeg",quality:null!==(s=this.resize.quality)&&void 0!==s?s:.85}));l=Object.assign(Object.assign({},a),{filename:t.name,size:t.size,contentType:t.type,fileContent:t})}catch(t){l=a}!l.href&&l.fileContent instanceof File&&(this.objectUrl=URL.createObjectURL(l.fileContent)),this.change.emit(l)},this.handleRejectedFiles=t=>{t.stopPropagation(),this.filesRejected.emit(t.detail)},this.handleClear=t=>{t.stopPropagation(),this.revokeObjectUrl(),this.imageError=!1,this.change.emit(void 0)},this.onImageError=()=>{this.imageError=!0},this.openPopover=t=>{t.stopPropagation(),this.isErrorMessagePopoverOpen=!0},this.onPopoverClose=t=>{t.stopPropagation(),this.isErrorMessagePopoverOpen=!1},this.getTranslation=t=>a.get(t,this.language)}disconnectedCallback(){this.revokeObjectUrl()}handleValueChange(){this.revokeObjectUrl(),this.imageError=!1;const t=this.value;t&&"string"!=typeof t&&!t.href&&t.fileContent instanceof File&&(this.objectUrl=URL.createObjectURL(t.fileContent))}render(){const t={"has-image-error":this.imageError};return this.readonly?i(o,{class:t},this.renderAvatar()):i(o,{class:t},i("limel-file-dropzone",{disabled:this.disabled,accept:this.accept,onFilesSelected:this.handleNewFiles,onFilesRejected:this.handleRejectedFiles},i("limel-file-input",{accept:this.accept,disabled:this.disabled,"aria-required":this.required?"true":void 0,"aria-invalid":this.invalid?"true":void 0},this.renderBrowseButton())),this.renderClearButton(),this.renderSpinner(),this.renderErrorMessage(),this.renderHelperText())}get hasValue(){return"string"==typeof this.value?!!this.value:!(!this.value||!this.value.href&&!this.value.fileContent)||!!this.objectUrl}renderBrowseButton(){return i("button",{id:this.browseButtonId,type:"button",class:"avatar",disabled:this.disabled,"aria-label":this.label,"aria-busy":this.loading?"true":"false","aria-live":"polite"},this.renderAvatar())}renderAvatar(){const t=this.getImageSrc();return t?i(h,{image:{src:t,alt:"",referrerpolicy:"no-referrer"},style:{"--limel-profile-picture-object-fit":this.imageFit},onError:this.onImageError}):this.renderIcon()}renderIcon(){var t,e;const o=s(this.icon);return i("limel-icon",{name:o,style:{color:`${null===(t=this.icon)||void 0===t?void 0:t.color}`,"background-color":`${null===(e=this.icon)||void 0===e?void 0:e.backgroundColor}`}})}renderClearButton(){if(this.hasValue&&!this.disabled)return[i("button",{class:"remove",type:"button",id:this.removeButtonId,onClick:this.handleClear}),i("limel-tooltip",{label:this.getTranslation("profile-picture.remove"),elementId:this.removeButtonId})]}renderSpinner(){if(this.loading)return i("limel-spinner",null)}getUnsupportedPreviewContext(){const t=this.value;return{hasNoSrc:!this.getImageSrc(),hasLocalFile:!(!(t&&"string"!=typeof t&&t.fileContent instanceof File)||t.href),isResizeConfigured:!!this.resize}}shouldShowErrorMessage(){const{hasNoSrc:t,hasLocalFile:e,isResizeConfigured:i}=this.getUnsupportedPreviewContext();return(t||this.imageError)&&e&&i}renderErrorMessage(){if(this.shouldShowErrorMessage())return i("limel-popover",{open:this.isErrorMessagePopoverOpen,onClick:this.openPopover,onClose:this.onPopoverClose},i("limel-icon-button",{slot:"trigger",elevated:!0,icon:{name:"error",color:"rgb(var(--color-orange-dark))"},"aria-live":"polite",label:this.getTranslation("profile-picture.unsupported-preview.title")}),i("limel-callout",{type:"warning",style:{maxWidth:"20rem",borderRadius:"0.75rem"},heading:this.getTranslation("profile-picture.unsupported-preview.title")},this.getTranslation("profile-picture.unsupported-preview.description")))}getImageSrc(){return this.value?"string"==typeof this.value?this.value:this.value.href?this.value.href:this.value.fileContent instanceof File?this.objectUrl:void 0:this.objectUrl}revokeObjectUrl(){this.objectUrl&&(URL.revokeObjectURL(this.objectUrl),this.objectUrl=void 0)}static get watchers(){return{value:[{handleValueChange:0}]}}};c.style="@charset \"UTF-8\";:host(limel-profile-picture){position:relative;display:inline-flex;min-width:1.5rem;min-height:1.5rem;border-radius:var(--profile-picture-border-radius, 100vw);background-color:rgb(var(--contrast-400))}*{box-sizing:border-box}limel-file-dropzone,limel-file-input,button.avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%}button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;display:block}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.avatar{overflow:hidden;border-radius:var(--profile-picture-border-radius, 100vw)}:host(:not([disabled]):not([disabled=true])) button.avatar{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{will-change:color, background-color, box-shadow, transform}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover{box-shadow:var(--button-shadow-hovered)}:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host([invalid]:not([invalid=false])) button.avatar{box-shadow:var(--shadow-error-state)}button.remove{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:rgb(var(--contrast-900))}button.remove:hover,button.remove:focus,button.remove:focus-visible{will-change:color, background-color, box-shadow, transform}button.remove:hover,button.remove:focus-visible{transform:translate3d(0, 0.01rem, 0);color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}button.remove:hover{box-shadow:var(--button-shadow-hovered)}button.remove:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button.remove:hover,button.remove:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button.remove{cursor:pointer;height:1.25rem;width:1.25rem;border-radius:50%;background-repeat:no-repeat;background-position:center;background-size:0.75rem;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3E%3Cdefs/%3E%3Cpath%20fill='rgb(255,255,255)'%20d='M7.219%205.781L5.78%207.22%2014.563%2016%205.78%2024.781%207.22%2026.22%2016%2017.437l8.781%208.782%201.438-1.438L17.437%2016l8.782-8.781L24.78%205.78%2016%2014.563z'/%3E%3C/svg%3E\");position:absolute;top:0;left:0;opacity:0}:host(:hover) button.remove,:host(:focus) button.remove,:host(:focus-visible) button.remove,:host(:focus-within) button.remove,:host(:active) button.remove{animation:show 0.4s ease-in-out forwards}@keyframes show{0%{transform:scale(0.9);opacity:0}100%{transform:scale(1);opacity:1}}button.avatar,img,limel-icon{border-radius:var(--profile-picture-border-radius, 100vw)}limel-icon{width:calc(100% - 1rem);min-width:1rem;max-width:4rem;color:var(--limel-theme-text-secondary-on-background-color);margin:auto}img{object-fit:var(--limel-profile-picture-object-fit);width:100%;height:100%}:host(.has-image-error) img{border:1px dashed rgb(var(--contrast-600));background:url(\"data:image/svg+xml;charset=utf-8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' style='fill-rule:evenodd;'><path fill='rgba(186,186,192,0.16)' d='M0 0h4v4H0zM4 4h4v4H4z'/></svg>\");background-size:0.5rem}limel-spinner{position:absolute;inset:0;margin:auto}limel-popover{position:absolute;inset:auto 0 0 auto;display:block;width:2.25rem;height:2.25rem}";export{c as limel_profile_picture}
|
|
1
|
+
import{r as t,c as e,h as i,H as o}from"./p-BGxJfR2f.js";import{i as r}from"./p-CGVVDGcv.js";import{g as s}from"./p-CgNJbSP4.js";import{t as a}from"./p-Cb9R_zmF.js";import{c as l}from"./p-JbKhhoXs.js";import{r as n}from"./p-BTSG--2-.js";import{I as h}from"./p-Dpg0OkbJ.js";import"./p-BCq5M9TE.js";import"./p-Bu_YRgCL.js";const c=class{constructor(o){t(this,o),this.change=e(this,"change"),this.filesRejected=e(this,"filesRejected"),this.language="en",this.icon="user",this.disabled=!1,this.readonly=!1,this.required=!1,this.invalid=!1,this.loading=!1,this.imageFit="cover",this.accept="image/jpeg,image/png,image/heic,.jpg,.jpeg,.png,.heic",this.imageError=!1,this.isErrorMessagePopoverOpen=!1,this.removeButtonId=l(),this.browseButtonId=l(),this.renderHelperText=()=>{if(this.helperText)return i("limel-tooltip",{elementId:this.browseButtonId,label:this.helperText})},this.handleNewFiles=async t=>{var e,i,o,s;if(t.stopPropagation(),this.disabled)return;const a=null===(e=t.detail)||void 0===e?void 0:e[0];if(!a)return;if(!r(a,this.accept))return void this.filesRejected.emit([a]);this.revokeObjectUrl(),this.imageError=!1;let l=a;if(this.resize&&a.fileContent instanceof File)try{const t=await n(a.fileContent,Object.assign(Object.assign({},this.resize),{fit:null!==(i=this.resize.fit)&&void 0!==i?i:this.imageFit,type:null!==(o=this.resize.type)&&void 0!==o?o:"image/jpeg",quality:null!==(s=this.resize.quality)&&void 0!==s?s:.85}));l=Object.assign(Object.assign({},a),{filename:t.name,size:t.size,contentType:t.type,fileContent:t})}catch(t){l=a}!l.href&&l.fileContent instanceof File&&(this.objectUrl=URL.createObjectURL(l.fileContent)),this.change.emit(l)},this.handleRejectedFiles=t=>{t.stopPropagation(),this.filesRejected.emit(t.detail)},this.handleClear=t=>{t.stopPropagation(),this.revokeObjectUrl(),this.imageError=!1,this.change.emit(void 0)},this.onImageError=()=>{this.imageError=!0},this.openPopover=t=>{t.stopPropagation(),this.isErrorMessagePopoverOpen=!0},this.onPopoverClose=t=>{t.stopPropagation(),this.isErrorMessagePopoverOpen=!1},this.getTranslation=t=>a.get(t,this.language)}disconnectedCallback(){this.revokeObjectUrl()}handleValueChange(){this.revokeObjectUrl(),this.imageError=!1;const t=this.value;t&&"string"!=typeof t&&!t.href&&t.fileContent instanceof File&&(this.objectUrl=URL.createObjectURL(t.fileContent))}render(){const t={"has-image-error":this.imageError};return this.readonly?i(o,{class:t},this.renderAvatar()):i(o,{class:t},i("limel-file-dropzone",{disabled:this.disabled,accept:this.accept,onFilesSelected:this.handleNewFiles,onFilesRejected:this.handleRejectedFiles},i("limel-file-input",{accept:this.accept,disabled:this.disabled,"aria-required":this.required?"true":void 0,"aria-invalid":this.invalid?"true":void 0},this.renderBrowseButton())),this.renderClearButton(),this.renderSpinner(),this.renderErrorMessage(),this.renderHelperText())}get hasValue(){return"string"==typeof this.value?!!this.value:!(!this.value||!this.value.href&&!this.value.fileContent)||!!this.objectUrl}renderBrowseButton(){return i("button",{id:this.browseButtonId,type:"button",class:"avatar",disabled:this.disabled,"aria-label":this.label,"aria-busy":this.loading?"true":"false","aria-live":"polite"},this.renderAvatar())}renderAvatar(){const t=this.getImageSrc();return t?i(h,{image:{src:t,alt:"",referrerpolicy:"no-referrer"},style:{"--limel-profile-picture-object-fit":this.imageFit},onError:this.onImageError}):this.renderIcon()}renderIcon(){var t,e;const o=s(this.icon);return i("limel-icon",{name:o,style:{color:`${null===(t=this.icon)||void 0===t?void 0:t.color}`,"background-color":`${null===(e=this.icon)||void 0===e?void 0:e.backgroundColor}`}})}renderClearButton(){if(this.hasValue&&!this.disabled)return[i("button",{class:"remove",type:"button",id:this.removeButtonId,onClick:this.handleClear}),i("limel-tooltip",{label:this.getTranslation("profile-picture.remove"),elementId:this.removeButtonId})]}renderSpinner(){if(this.loading)return i("limel-spinner",null)}getUnsupportedPreviewContext(){const t=this.value;return{hasNoSrc:!this.getImageSrc(),hasLocalFile:!(!(t&&"string"!=typeof t&&t.fileContent instanceof File)||t.href),isResizeConfigured:!!this.resize}}shouldShowErrorMessage(){const{hasNoSrc:t,hasLocalFile:e,isResizeConfigured:i}=this.getUnsupportedPreviewContext();return(t||this.imageError)&&e&&i}renderErrorMessage(){if(this.shouldShowErrorMessage())return i("limel-popover",{open:this.isErrorMessagePopoverOpen,onClick:this.openPopover,onClose:this.onPopoverClose},i("limel-icon-button",{slot:"trigger",elevated:!0,icon:{name:"error",color:"rgb(var(--color-orange-dark))"},"aria-live":"polite",label:this.getTranslation("profile-picture.unsupported-preview.title")}),i("limel-callout",{type:"warning",style:{maxWidth:"20rem",borderRadius:"0.75rem"},heading:this.getTranslation("profile-picture.unsupported-preview.title")},this.getTranslation("profile-picture.unsupported-preview.description")))}getImageSrc(){return this.value?"string"==typeof this.value?this.value:this.value.href?this.value.href:this.value.fileContent instanceof File?this.objectUrl:void 0:this.objectUrl}revokeObjectUrl(){this.objectUrl&&(URL.revokeObjectURL(this.objectUrl),this.objectUrl=void 0)}static get watchers(){return{value:[{handleValueChange:0}]}}};c.style="@charset \"UTF-8\";:host(limel-profile-picture){position:relative;display:inline-flex;min-width:1.5rem;min-height:1.5rem;border-radius:var(--profile-picture-border-radius, 100vw);background-color:rgb(var(--contrast-400))}*{box-sizing:border-box}limel-file-dropzone,limel-file-input,button.avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%}button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;display:block}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.avatar{overflow:hidden;border-radius:var(--profile-picture-border-radius, 100vw)}:host(:not([disabled]):not([disabled=true])) button.avatar{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{will-change:color, background-color, box-shadow, transform}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover{box-shadow:var(--button-shadow-hovered)}:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host([invalid]:not([invalid=false])) button.avatar{box-shadow:var(--shadow-error-state)}button.remove{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:rgb(var(--contrast-900))}button.remove:hover,button.remove:focus,button.remove:focus-visible{will-change:color, background-color, box-shadow, transform}button.remove:hover,button.remove:focus-visible{transform:translate3d(0, 0.01rem, 0);color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}button.remove:hover{box-shadow:var(--button-shadow-hovered)}button.remove:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button.remove:hover,button.remove:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button.remove{cursor:pointer;height:1.25rem;width:1.25rem;border-radius:50%;background-repeat:no-repeat;background-position:center;background-size:0.75rem;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3E%3Cdefs/%3E%3Cpath%20fill='rgb(255,255,255)'%20d='M7.219%205.781L5.78%207.22%2014.563%2016%205.78%2024.781%207.22%2026.22%2016%2017.437l8.781%208.782%201.438-1.438L17.437%2016l8.782-8.781L24.78%205.78%2016%2014.563z'/%3E%3C/svg%3E\");position:absolute;top:0;left:0;opacity:0}:host(:hover) button.remove,:host(:focus) button.remove,:host(:focus-visible) button.remove,:host(:focus-within) button.remove,:host(:active) button.remove{animation:show 0.4s ease-in-out forwards}@keyframes show{0%{transform:scale(0.9);opacity:0}100%{transform:scale(1);opacity:1}}button.avatar,img,limel-icon{border-radius:var(--profile-picture-border-radius, 100vw)}limel-icon{width:calc(100% - 1rem);min-width:1rem;max-width:4rem;color:var(--limel-theme-text-secondary-on-background-color);margin:auto}img{object-fit:var(--limel-profile-picture-object-fit);width:100%;height:100%}:host(.has-image-error) img{border:1px dashed rgb(var(--contrast-600));background:url(\"data:image/svg+xml;charset=utf-8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' style='fill-rule:evenodd;'><path fill='rgba(186,186,192,0.16)' d='M0 0h4v4H0zM4 4h4v4H4z'/></svg>\");background-size:0.5rem}limel-spinner{position:absolute;inset:0;margin:auto}limel-popover{position:absolute;inset:auto 0 0 auto;display:block;width:2.25rem;height:2.25rem}";export{c as limel_profile_picture}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as n,a as t,b as o,c as r}from"./p-BCq5M9TE.js";function e(e){const i={id:crypto.randomUUID(),filename:e.name,contentType:e.type,size:e.size,fileContent:e};return i.icon={name:r(i),title:o(i),color:t(i),backgroundColor:n(i)},i}function i(n,t){return void 0===t||"*"===t||t.split(",").map((n=>n.trim())).some((t=>{if(t===n.contentType)return!0;if(t.endsWith("/*")){const o=t.split("/")[0];return n.contentType.startsWith(`${o}/`)}
|
|
1
|
+
import{g as n,a as t,b as o,c as r}from"./p-BCq5M9TE.js";function e(e){const i={id:crypto.randomUUID(),filename:e.name,contentType:e.type,size:e.size,fileContent:e};return i.icon={name:r(i),title:o(i),color:t(i),backgroundColor:n(i)},i}function i(n,t){return void 0===t||"*"===t||t.split(",").map((n=>n.trim())).some((t=>{if(t===n.contentType)return!0;if(t.endsWith("/*")){const o=t.split("/")[0];return n.contentType.startsWith(`${o}/`)}return t.startsWith(".")?n.filename.toLowerCase().endsWith(t.toLowerCase()):void 0}))}export{e as c,i}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r}from"./p-BGxJfR2f.js";import{c as o}from"./p-JbKhhoXs.js";const l=class{constructor(r){t(this,r),this.change=e(this,"change"),this.imagePasted=e(this,"imagePasted"),this.imageRemoved=e(this,"imageRemoved"),this.metadataChange=e(this,"metadataChange"),this.triggerStart=e(this,"triggerStart"),this.triggerStop=e(this,"triggerStop"),this.triggerChange=e(this,"triggerChange"),this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.customElements=[],this.triggers=[],this.required=!1,this.allowResize=!0,this.ui="standard",this.renderHelperLine=()=>{if(this.helperText)return i("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.isInvalid()})},this.isInvalid=()=>!this.readonly&&(!!this.invalid||void 0),this.handleChange=t=>{t.stopPropagation(),this.change.emit(t.detail)},this.handleImagePasted=t=>{t.stopPropagation(),this.imagePasted.emit(t.detail)},this.handleMetadataChange=t=>{t.stopPropagation(),this.metadataChange.emit(t.detail)},this.handleImageRemoved=t=>{t.stopPropagation(),this.imageRemoved.emit(t.detail)},this.helperTextId=o(),this.editorId=o()}async flushPendingChanges(){var t;await(null===(t=this.adapterElement)||void 0===t?void 0:t.flushPendingChanges())}async clear(){var t;await(null===(t=this.adapterElement)||void 0===t?void 0:t.clear())}render(){return i(r,{key:"
|
|
1
|
+
import{r as t,c as e,h as i,H as r}from"./p-BGxJfR2f.js";import{c as o}from"./p-JbKhhoXs.js";const l=class{constructor(r){t(this,r),this.change=e(this,"change"),this.imagePasted=e(this,"imagePasted"),this.imageRemoved=e(this,"imageRemoved"),this.metadataChange=e(this,"metadataChange"),this.triggerStart=e(this,"triggerStart"),this.triggerStop=e(this,"triggerStop"),this.triggerChange=e(this,"triggerChange"),this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.customElements=[],this.triggers=[],this.required=!1,this.allowResize=!0,this.ui="standard",this.renderHelperLine=()=>{if(this.helperText)return i("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.isInvalid()})},this.isInvalid=()=>!this.readonly&&(!!this.invalid||void 0),this.handleChange=t=>{t.stopPropagation(),this.change.emit(t.detail)},this.handleImagePasted=t=>{t.stopPropagation(),this.imagePasted.emit(t.detail)},this.handleMetadataChange=t=>{t.stopPropagation(),this.metadataChange.emit(t.detail)},this.handleImageRemoved=t=>{t.stopPropagation(),this.imageRemoved.emit(t.detail)},this.helperTextId=o(),this.editorId=o()}async flushPendingChanges(){var t;await(null===(t=this.adapterElement)||void 0===t?void 0:t.flushPendingChanges())}async clear(){var t;await(null===(t=this.adapterElement)||void 0===t?void 0:t.clear())}render(){return i(r,{key:"8546f7fb9e2634d610dea93fefcd14f3667b5ad3"},i("limel-notched-outline",{key:"f76998e3fc01cf0adf30375956a29a2669b72e79",labelId:this.editorId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:!0},this.renderEditor(),this.renderPlaceholder()),this.renderHelperLine())}renderEditor(){return this.readonly?i("limel-markdown",{slot:"content",value:this.value,"aria-controls":this.helperText?this.helperTextId:void 0,id:this.editorId}):i("limel-prosemirror-adapter",{ref:t=>this.adapterElement=t,slot:"content","aria-placeholder":this.placeholder,contentType:this.contentType,onChange:this.handleChange,onImagePasted:this.handleImagePasted,onImageRemoved:this.handleImageRemoved,onMetadataChange:this.handleMetadataChange,customElements:this.customElements,inlineImages:this.inlineImages,value:this.value,"aria-controls":this.helperText?this.helperTextId:void 0,id:this.editorId,"aria-disabled":this.disabled,"aria-invalid":this.invalid,"aria-required":this.required,language:this.language,triggerCharacters:this.triggers,disabled:this.disabled,ui:this.ui})}renderPlaceholder(){if(this.placeholder&&!this.value)return i("span",{class:"placeholder","aria-hidden":"true",slot:"content"},this.placeholder)}static get delegatesFocus(){return!0}};l.style='@charset "UTF-8";*{box-sizing:border-box}:host(limel-text-editor){--limel-notched-outline-z-index:2;--limel-prosemirror-adapter-toolbar-opacity:0.6;--limel-text-editor-padding:0.25rem 1rem 0.75rem 1rem;--limel-prosemirror-adapter-toolbar-grid-template-rows:1fr;--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration:0.3s;--limel-prosemirror-adapter-toolbar-transition-timing-function:cubic-bezier( 0.19, 0.23, 0.26, 0.89 );position:relative;isolation:isolate;display:flex;flex-direction:column;width:100%;min-width:5rem;min-height:5rem;height:100%;max-height:var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem));padding:1px}:host(limel-text-editor) limel-notched-outline{height:100%}:host(limel-text-editor:focus-within),:host(limel-text-editor:not([ui=minimal]):hover){--limel-prosemirror-adapter-toolbar-opacity:1}:host(limel-text-editor[ui=minimal]:not(:focus-within)){--limel-prosemirror-adapter-toolbar-grid-template-rows:0fr;--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration:0.46s;--limel-prosemirror-adapter-action-bar-padding-top-bottom:0;--limel-prosemirror-adapter-toolbar-opacity:0}:host(limel-text-editor[ui=minimal]:not(:focus-within)),:host(limel-text-editor[ui=no-toolbar]){--limel-text-editor-padding:0.75rem 1rem 0.75rem 1rem;--limel-text-editor-placeholder-top:0;min-height:2.5rem}:host(limel-text-editor[ui=minimal]:not(:focus-within)) limel-prosemirror-adapter,:host(limel-text-editor[ui=no-toolbar]) limel-prosemirror-adapter{min-height:2.5rem}:host(limel-text-editor:focus-within) .placeholder,:host(limel-text-editor:focus) .placeholder{opacity:0}:host(limel-text-editor[disabled]:not([disabled=false])) limel-prosemirror-adapter{cursor:not-allowed;opacity:0.4;pointer-events:none}:host(limel-text-editor[readonly]:not([readonly=false])){--limel-text-editor-padding:0.75rem 1rem 0.75rem 1rem;--limel-text-editor-placeholder-top:0}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown{display:block;padding:var(--limel-text-editor-padding);overflow-y:auto;-webkit-overflow-scrolling:touch;height:100%}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before,:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{z-index:1;pointer-events:none;content:"";display:block;position:absolute;width:100%}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{height:1.75rem;top:0;background:linear-gradient(var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))), transparent)}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before{height:2rem;bottom:-0.25rem;background:linear-gradient(transparent, var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))))}.placeholder{transition-property:top;transition-duration:var(--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration);transition-timing-function:var(--limel-prosemirror-adapter-toolbar-transition-timing-function);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;position:absolute;top:var(--limel-text-editor-placeholder-top, 2.25rem);left:0;right:0;padding:var(--limel-text-editor-padding);font-style:italic;font-size:var(--limel-theme-default-font-size);color:rgb(var(--contrast-900))}limel-prosemirror-adapter{flex-grow:1;min-width:0;min-height:5rem;height:100%;max-height:100%;overflow:hidden auto;-webkit-overflow-scrolling:touch}:host(limel-text-editor:focus),:host(limel-text-editor:focus-visible),:host(limel-text-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-text-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-text-editor:focus) limel-helper-line,:host(limel-text-editor:focus-visible) limel-helper-line,:host(limel-text-editor:focus-within) limel-helper-line,:host(limel-text-editor:hover) limel-helper-line{will-change:grid-template-rows}:host(limel-text-editor[allow-resize]) limel-prosemirror-adapter{resize:vertical}';export{l as limel_text_editor}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,a as r}from"./p-BGxJfR2f.js";import{c as o,i as a}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e,a as r}from"./p-BGxJfR2f.js";import{c as o,i as a}from"./p-CGVVDGcv.js";import{a as n}from"./p-DtrvybFR.js";import{c}from"./p-BE1Efiuj.js";import{i as h}from"./p-B8VKuhvH.js";import{c as l}from"./p-JbKhhoXs.js";import"./p-BCq5M9TE.js";import"./p-Bu_YRgCL.js";import"./p-CgNJbSP4.js";import"./p-mmkVLOjW.js";import"./p-CZ30nDJE.js";import"./p-D4RdItCq.js";import"./p-BJQylLSL.js";import"./p-oiMYqRQ0.js";import"./p-BYfPV0O4.js";import"./p-BcJ-TDVt.js";import"./p-DbBZn7JO.js";import"./p-B--C3qwe.js";import"./p-BOEi1C7r.js";import"./p-CK4jS9_E.js";function p(t,i,s,e){for(var r=-1,o=null==t?0:t.length;++r<o;){var a=t[r];i(e,a,s(a),t)}return e}function f(t,i,s,e){return n(t,(function(t,r,o){i(e,t,s(t),o)})),e}var d,m,b=(d=function(t,i,s){t[s?0:1].push(i)},m=function(){return[[],[]]},function(t,i){var s=h(t)?p:f,e=m?[[],[]]:{};return s(t,d,c(i),e)});const u=class{constructor(e){t(this,e),this.filesSelected=i(this,"filesSelected"),this.filesRejected=i(this,"filesRejected"),this.accept="*",this.disabled=!1,this.helperText="",this.hasFileToDrop=!1,this.renderOnDragLayout=()=>{if(!this.disabled&&this.hasFileToDrop)return s("div",{class:"has-file-to-drop"},s("limel-icon",{class:"icon",name:"upload_2"}),s("div",{class:"text-helpertext"},this.renderText(),this.renderHelperText()))},this.renderText=()=>{if(this.text)return s("span",{class:"text"},this.text)},this.renderHelperText=()=>{if(this.helperText)return s("span",{class:"helper-text"},this.helperText)},this.handleDrop=t=>{if(t.stopPropagation(),t.preventDefault(),this.hasFileToDrop=!1,this.disabled)return;const i=[...t.dataTransfer.files].map(o),[s,e]=b(i,(t=>a(t,this.accept)));s.length>0&&this.filesSelected.emit(s),e.length>0&&this.filesRejected.emit(e)},this.handleDragOver=t=>{this.hasFileToDrop=!0,t.preventDefault()},this.handleDragLeave=t=>{this.hasFileToDrop=!1,t.preventDefault()}}render(){return s(e,{key:"5143c9cda4ccbcd0c34bb55fb7f8eb6b9d028863",onDrop:this.handleDrop,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave},s("slot",{key:"c283ffdb9838d4cee80842127360303f77a6de39"}),this.renderOnDragLayout())}};u.style=":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 j=class{constructor(s){t(this,s),this.filesSelected=i(this,"filesSelected"),this.accept="*",this.disabled=!1,this.multiple=!1,this.fileInputId=l(),this.handleClick=t=>{if(this.disabled)return t.stopPropagation(),void t.preventDefault();this.triggerFileDialog(),t.stopPropagation()},this.handleKeyUp=t=>{t.stopPropagation(),t.preventDefault(),"Enter"===t.code&&this.triggerFileDialog()},this.handleFileChange=t=>{const i=[...this.fileInput.files];i.length>0&&(t.stopPropagation(),this.filesSelected.emit(i.map(o)),this.fileInput.value="")}}componentDidLoad(){this.fileInput=this.element.shadowRoot.getElementById(this.fileInputId)}render(){return s(e,{key:"4746b407c045a406385f4b26b7a82298a37c7fca",onClick:this.handleClick,onKeyUp:this.handleKeyUp,onKeyDown:this.handleKeyDown},s("input",{key:"b599d3a8d60802f0977c2ffc12f14975a7a8d4f0",hidden:!0,id:this.fileInputId,onChange:this.handleFileChange,type:"file",accept:this.accept,disabled:this.disabled,multiple:this.multiple}),s("slot",{key:"4e526023fd5287a112708d2012cc9b897facb93b"}))}handleKeyDown(t){"Tab"!==t.code&&"Backspace"!==t.code&&"Enter"!==t.code&&(t.preventDefault(),t.stopPropagation())}triggerFileDialog(){this.fileInput.click()}get element(){return r(this)}};export{u as limel_file_dropzone,j as limel_file_input}
|
|
@@ -144,6 +144,8 @@ export declare class TextEditor implements FormComponent<string> {
|
|
|
144
144
|
*
|
|
145
145
|
* @private
|
|
146
146
|
* @alpha
|
|
147
|
+
* @deprecated Use the `inlineImages` prop instead, which lets the editor
|
|
148
|
+
* own the whole paste lifecycle. Will be removed in a future version.
|
|
147
149
|
*/
|
|
148
150
|
private readonly imagePasted;
|
|
149
151
|
/**
|
|
@@ -151,8 +153,8 @@ export declare class TextEditor implements FormComponent<string> {
|
|
|
151
153
|
*
|
|
152
154
|
* @private
|
|
153
155
|
* @alpha
|
|
154
|
-
* @deprecated
|
|
155
|
-
*
|
|
156
|
+
* @deprecated Use the `inlineImages` prop instead. Will be removed in a
|
|
157
|
+
* future version.
|
|
156
158
|
*/
|
|
157
159
|
private readonly imageRemoved;
|
|
158
160
|
/**
|
|
@@ -160,6 +162,9 @@ export declare class TextEditor implements FormComponent<string> {
|
|
|
160
162
|
*
|
|
161
163
|
* @private
|
|
162
164
|
* @alpha
|
|
165
|
+
* @deprecated Unused alpha event. Image handling now lives in the
|
|
166
|
+
* `inlineImages` prop; link changes have no direct replacement yet. Will
|
|
167
|
+
* be removed in a future version.
|
|
163
168
|
*/
|
|
164
169
|
private readonly metadataChange;
|
|
165
170
|
/**
|
|
@@ -30,6 +30,8 @@ export type TextEditorNode = {
|
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* @alpha
|
|
33
|
+
* @deprecated Superseded by the `InlineImages` config, which lets the editor
|
|
34
|
+
* own the whole paste lifecycle. Will be removed in a future version.
|
|
33
35
|
*/
|
|
34
36
|
export interface ImageInserter {
|
|
35
37
|
fileInfo: FileInfo;
|
|
@@ -110,6 +112,8 @@ export declare function isInlineImageTag(config: InlineImages): config is Inline
|
|
|
110
112
|
export type EditorImageState = 'loading' | 'failed' | 'success';
|
|
111
113
|
/**
|
|
112
114
|
* @alpha
|
|
115
|
+
* @deprecated Superseded by the `InlineImages` config. Will be removed in a
|
|
116
|
+
* future version.
|
|
113
117
|
*/
|
|
114
118
|
export interface EditorImage {
|
|
115
119
|
/**
|
|
@@ -172,10 +176,12 @@ export interface TriggerEventDetail {
|
|
|
172
176
|
value: string;
|
|
173
177
|
}
|
|
174
178
|
/**
|
|
179
|
+
* Interface representing metadata extracted from the editor document
|
|
175
180
|
*
|
|
176
181
|
* @alpha
|
|
177
|
-
*
|
|
178
|
-
*
|
|
182
|
+
* @deprecated Unused alpha API. Image handling now lives in the `InlineImages`
|
|
183
|
+
* config; link metadata has no direct replacement yet. Will be removed in a
|
|
184
|
+
* future version.
|
|
179
185
|
*/
|
|
180
186
|
export interface EditorMetadata {
|
|
181
187
|
/**
|
|
@@ -10691,20 +10691,22 @@ declare namespace LocalJSX {
|
|
|
10691
10691
|
/**
|
|
10692
10692
|
* Dispatched when a image is pasted into the editor
|
|
10693
10693
|
* @private
|
|
10694
|
-
* @alpha
|
|
10694
|
+
* @alpha
|
|
10695
|
+
* @deprecated Use the `inlineImages` prop instead, which lets the editor own the whole paste lifecycle. Will be removed in a future version.
|
|
10695
10696
|
*/
|
|
10696
10697
|
"onImagePasted"?: (event: LimelTextEditorCustomEvent<ImageInserter>) => void;
|
|
10697
10698
|
/**
|
|
10698
10699
|
* Dispatched when a image is removed from the editor
|
|
10699
10700
|
* @private
|
|
10700
10701
|
* @alpha
|
|
10701
|
-
* @deprecated
|
|
10702
|
+
* @deprecated Use the `inlineImages` prop instead. Will be removed in a future version.
|
|
10702
10703
|
*/
|
|
10703
10704
|
"onImageRemoved"?: (event: LimelTextEditorCustomEvent<EditorImage>) => void;
|
|
10704
10705
|
/**
|
|
10705
10706
|
* Dispatched when the metadata of the editor changes
|
|
10706
10707
|
* @private
|
|
10707
|
-
* @alpha
|
|
10708
|
+
* @alpha
|
|
10709
|
+
* @deprecated Unused alpha event. Image handling now lives in the `inlineImages` prop; link changes have no direct replacement yet. Will be removed in a future version.
|
|
10708
10710
|
*/
|
|
10709
10711
|
"onMetadataChange"?: (event: LimelTextEditorCustomEvent<EditorMetadata>) => void;
|
|
10710
10712
|
/**
|