@limetech/lime-elements 38.23.4 → 38.24.0
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 +18 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
- package/dist/cjs/limel-badge.cjs.entry.js +42 -0
- package/dist/cjs/limel-badge.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-callout.cjs.entry.js +2 -2
- package/dist/cjs/limel-callout.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/{limel-portal_2.cjs.entry.js → limel-portal_3.cjs.entry.js} +107 -11
- package/dist/cjs/limel-portal_3.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-profile-picture.cjs.entry.js +536 -0
- package/dist/cjs/limel-profile-picture.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{translations-2746c4c6.js → translations-7499f391.js} +25 -1
- package/dist/cjs/translations-7499f391.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/callout/callout.css +1 -0
- package/dist/collection/components/dialog/dialog.css +1 -0
- package/dist/collection/components/profile-picture/profile-picture.css +255 -0
- package/dist/collection/components/profile-picture/profile-picture.js +554 -0
- package/dist/collection/components/profile-picture/profile-picture.js.map +1 -0
- package/dist/collection/translations/da.js +3 -0
- package/dist/collection/translations/da.js.map +1 -1
- package/dist/collection/translations/de.js +3 -0
- package/dist/collection/translations/de.js.map +1 -1
- package/dist/collection/translations/en.js +3 -0
- package/dist/collection/translations/en.js.map +1 -1
- package/dist/collection/translations/fi.js +3 -0
- package/dist/collection/translations/fi.js.map +1 -1
- package/dist/collection/translations/fr.js +3 -0
- package/dist/collection/translations/fr.js.map +1 -1
- package/dist/collection/translations/nl.js +3 -0
- package/dist/collection/translations/nl.js.map +1 -1
- package/dist/collection/translations/no.js +3 -0
- package/dist/collection/translations/no.js.map +1 -1
- package/dist/collection/translations/sv.js +3 -0
- package/dist/collection/translations/sv.js.map +1 -1
- package/dist/collection/util/image-resize.js +305 -0
- package/dist/collection/util/image-resize.js.map +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar_2.entry.js +1 -1
- package/dist/esm/limel-ai-avatar.entry.js +1 -1
- package/dist/esm/limel-badge.entry.js +38 -0
- package/dist/esm/limel-badge.entry.js.map +1 -0
- package/dist/esm/limel-callout.entry.js +2 -2
- package/dist/esm/limel-callout.entry.js.map +1 -1
- package/dist/esm/limel-chart.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- package/dist/esm/limel-dialog.entry.js +1 -1
- package/dist/esm/limel-dialog.entry.js.map +1 -1
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-linear-progress.entry.js +1 -1
- package/dist/esm/{limel-portal_2.entry.js → limel-portal_3.entry.js} +107 -12
- package/dist/esm/limel-portal_3.entry.js.map +1 -0
- package/dist/esm/limel-profile-picture.entry.js +532 -0
- package/dist/esm/limel-profile-picture.entry.js.map +1 -0
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{translations-0c3c0779.js → translations-1d617679.js} +25 -1
- package/dist/esm/translations-1d617679.js.map +1 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/{p-6edfe426.entry.js → p-011f5d81.entry.js} +2 -2
- package/dist/lime-elements/p-18a3c28a.entry.js +2 -0
- package/dist/lime-elements/p-18a3c28a.entry.js.map +1 -0
- package/dist/lime-elements/{p-8a7bc823.entry.js → p-20d1913a.entry.js} +2 -2
- package/dist/lime-elements/p-3f698d18.entry.js +2 -0
- package/dist/lime-elements/p-3f698d18.entry.js.map +1 -0
- package/dist/lime-elements/{p-9abbe61a.entry.js → p-441c1eab.entry.js} +2 -2
- package/dist/lime-elements/{p-b957a3ca.entry.js → p-4558a60e.entry.js} +2 -2
- package/dist/lime-elements/p-58777116.js +2 -0
- package/dist/lime-elements/p-58777116.js.map +1 -0
- package/dist/lime-elements/{p-d7e93894.entry.js → p-597e6f79.entry.js} +2 -2
- package/dist/lime-elements/{p-208f87d2.entry.js → p-78abbc50.entry.js} +2 -2
- package/dist/lime-elements/p-7e3a4f49.entry.js +2 -0
- package/dist/lime-elements/p-7e3a4f49.entry.js.map +1 -0
- package/dist/lime-elements/{p-e4d64dd2.entry.js → p-8ae75f4a.entry.js} +2 -2
- package/dist/lime-elements/{p-5018673b.entry.js → p-99de518a.entry.js} +2 -2
- package/dist/lime-elements/p-b5a96409.entry.js +2 -0
- package/dist/lime-elements/p-b5a96409.entry.js.map +1 -0
- package/dist/lime-elements/{p-2173d6d5.entry.js → p-bd619d56.entry.js} +2 -2
- package/dist/lime-elements/{p-65d5d2fb.entry.js → p-bd6878ee.entry.js} +2 -2
- package/dist/lime-elements/{p-5bf57c21.entry.js → p-ce29c097.entry.js} +2 -2
- package/dist/lime-elements/{p-d90430e9.entry.js → p-d7d68f71.entry.js} +2 -2
- package/dist/lime-elements/{p-d90430e9.entry.js.map → p-d7d68f71.entry.js.map} +1 -1
- package/dist/lime-elements/{p-00aee6b6.entry.js → p-e7201ebd.entry.js} +2 -2
- package/dist/types/components/profile-picture/profile-picture.d.ts +126 -0
- package/dist/types/components.d.ts +203 -0
- package/dist/types/translations/da.d.ts +3 -0
- package/dist/types/translations/de.d.ts +3 -0
- package/dist/types/translations/en.d.ts +3 -0
- package/dist/types/translations/fi.d.ts +3 -0
- package/dist/types/translations/fr.d.ts +3 -0
- package/dist/types/translations/nl.d.ts +3 -0
- package/dist/types/translations/no.d.ts +3 -0
- package/dist/types/translations/sv.d.ts +3 -0
- package/dist/types/util/image-resize.d.ts +138 -0
- package/package.json +1 -1
- package/dist/cjs/limel-badge_2.cjs.entry.js +0 -138
- package/dist/cjs/limel-badge_2.cjs.entry.js.map +0 -1
- package/dist/cjs/limel-portal_2.cjs.entry.js.map +0 -1
- package/dist/cjs/translations-2746c4c6.js.map +0 -1
- package/dist/esm/limel-badge_2.entry.js +0 -133
- package/dist/esm/limel-badge_2.entry.js.map +0 -1
- package/dist/esm/limel-portal_2.entry.js.map +0 -1
- package/dist/esm/translations-0c3c0779.js.map +0 -1
- package/dist/lime-elements/p-29b1f083.entry.js +0 -2
- package/dist/lime-elements/p-29b1f083.entry.js.map +0 -1
- package/dist/lime-elements/p-c8825e88.js +0 -2
- package/dist/lime-elements/p-c8825e88.js.map +0 -1
- package/dist/lime-elements/p-fe7243c1.entry.js +0 -2
- package/dist/lime-elements/p-fe7243c1.entry.js.map +0 -1
- package/dist/lime-elements/p-ffd52fa1.entry.js +0 -2
- package/dist/lime-elements/p-ffd52fa1.entry.js.map +0 -1
- /package/dist/lime-elements/{p-6edfe426.entry.js.map → p-011f5d81.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8a7bc823.entry.js.map → p-20d1913a.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-9abbe61a.entry.js.map → p-441c1eab.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-b957a3ca.entry.js.map → p-4558a60e.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-d7e93894.entry.js.map → p-597e6f79.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-208f87d2.entry.js.map → p-78abbc50.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-e4d64dd2.entry.js.map → p-8ae75f4a.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-5018673b.entry.js.map → p-99de518a.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-2173d6d5.entry.js.map → p-bd619d56.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-65d5d2fb.entry.js.map → p-bd6878ee.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-5bf57c21.entry.js.map → p-ce29c097.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-00aee6b6.entry.js.map → p-e7201ebd.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as e,H as s,g as n}from"./p-288f0842.js";import{t as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as e,H as s,g as n}from"./p-288f0842.js";import{t as r}from"./p-58777116.js";import{i as a}from"./p-fc998171.js";import{a as o,E as l}from"./p-aa25f475.js";const h='@charset "UTF-8";: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)));transition:max-width 0.3s ease}: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-shrunk) .items{opacity:0}:host(limel-action-bar:not(.is-shrunk)) .items{opacity:1}: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)}:host(limel-action-bar.is-shrunk){max-width:5rem;transition:max-width 0.3s ease-in-out}:host(limel-action-bar.is-shrunk) .expand-shrink{transition:transform 0.3s ease;transform:rotateY(180deg)}:host(limel-action-bar:not(.is-shrunk)){max-width:100%;transition:max-width 0.3s ease-in-out}:host(limel-action-bar:not(.is-shrunk)) .expand-shrink{transition:transform 0.3s ease;transform:rotateY(0deg)}:host(limel-action-bar.can-be-shrunk.is-full-width) .expand-shrink{margin-left:auto}.expand-shrink{all:unset;box-sizing:border-box;border-radius:50%;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;display:flex;justify-content:center;align-items:center}.expand-shrink:hover,.expand-shrink:focus,.expand-shrink:focus-visible{will-change:color, background-color, box-shadow, transform}.expand-shrink:hover,.expand-shrink:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.expand-shrink:hover{box-shadow:var(--button-shadow-hovered)}.expand-shrink:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.expand-shrink:hover,.expand-shrink:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.expand-shrink:focus{outline:none}.expand-shrink:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.expand-shrink limel-icon{width:1.5rem;height:1.5rem;padding:0.125rem;color:var(--action-bar-shrink-icon-color, rgb(var(--contrast-1000)))}';const c=class{constructor(s){i(this,s);this.itemSelected=t(this,"itemSelected",7);this.hasRendered=false;this.isFirstIntersectionCheck=true;this.actionBarItems=[];this.renderActionBarItem=(i,t)=>e("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}const t={name:"more",color:"rgb(var(--contrast-1000))",title:this.getTranslation("action-bar.actions")};return e("limel-action-bar-overflow-menu",{openDirection:this.openDirection,items:i,onSelect:this.handleSelect,role:"gridcell",overFlowIcon:this.actionBarIsShrunk?t:undefined})};this.handleCollapseExpandClick=()=>{this.actionBarIsShrunk=!this.actionBarIsShrunk};this.handleSelect=i=>{i.stopPropagation();if(a(i.detail)){this.itemSelected.emit(i.detail)}};this.getTranslation=i=>r.get(i,this.language);this.handleIntersection=i=>{const t=i.filter((i=>i.isIntersecting));const e=i.filter((i=>!i.isIntersecting));if(this.isFirstIntersectionCheck){this.overflowCutoff=t.length}else{this.overflowCutoff=this.overflowCutoff+t.length-e.length}this.isFirstIntersectionCheck=false};this.actions=[];this.language=document.documentElement.lang;this.accessibleLabel=undefined;this.layout=undefined;this.collapsible=false;this.openDirection=undefined;this.overflowCutoff=this.actions.length;this.actionBarIsShrunk=false}connectedCallback(){if(this.hasRendered){this.createIntersectionObserver()}}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=[]}render(){this.hasRendered=true;let i=[];if(this.actions.length>0){i=this.actions.slice(this.overflowCutoff)}return e(s,{"aria-label":this.accessibleLabel,class:{"is-full-width":this.layout==="fullWidth","is-floating":this.layout==="floating","is-shrunk":this.actionBarIsShrunk&&this.collapsible,"can-be-shrunk":!!this.collapsible},role:"grid"},e("div",{class:"items",role:"rowgroup"},this.actions.map(this.renderActionBarItem)),this.renderOverflowMenu(i),this.renderCollapseExpandButton())}renderCollapseExpandButton(){if(!this.collapsible||this.actions.length<=1){return}return e("button",{class:{"expand-shrink":true},"aria-label":this.tooltipLabel,type:"button",onClick:this.handleCollapseExpandClick},e("limel-icon",{name:"double_left",id:"tooltip-expand-shrink-button"}),e("limel-tooltip",{label:this.tooltipLabel,elementId:"tooltip-expand-shrink-button"}))}isVisible(i){return i<this.overflowCutoff}get tooltipLabel(){let i="action-bar.collapse";if(this.actionBarIsShrunk){i="action-bar.expand"}return this.getTranslation(i)}createIntersectionObserver(){const i={root:this.host.shadowRoot.querySelector(".items"),rootMargin:"0px",threshold:1};this.overflowCutoff=this.actions.length;this.isFirstIntersectionCheck=true;this.actionBarItems=[];this.intersectionObserver=new IntersectionObserver(this.handleIntersection,i);for(const i of this.host.shadowRoot.querySelectorAll("limel-action-bar-item")){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=[...this.host.shadowRoot.querySelectorAll("limel-action-bar-item")].some((i=>!this.actionBarItems.includes(i)));return i||t}get host(){return n(this)}};c.style=h;const d=":host(limel-text-editor-link-menu){animation:fade 0.2s ease forwards;animation-delay:0.1s;opacity:0;display:flex;flex-direction:column;gap:0.5rem;padding:0.5rem;max-width:calc(100vw - 2rem);border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-16)}.actions{display:flex;justify-content:end;gap:0.5rem}@keyframes fade{0%{scale:0.86;opacity:0}100%{scale:1;opacity:1}}";const m=class{constructor(e){i(this,e);this.cancel=t(this,"cancel",7);this.save=t(this,"save",7);this.linkChange=t(this,"linkChange",7);this.getTranslation=i=>r.get(i,this.language);this.isValid=i=>{try{new URL(i)}catch(i){return false}return true};this.handleKeyDown=i=>{var t;if(i.key!==o){return}if(this.saveButton){this.saveButton.focus()}i.preventDefault();if(this.isValid((t=this.link)===null||t===void 0?void 0:t.href)){this.handleSave(i)}};this.handleCancel=i=>{if(i instanceof KeyboardEvent&&i.key!==l){return}i.stopPropagation();i.preventDefault();this.cancel.emit()};this.handleSave=i=>{i.stopPropagation();this.save.emit()};this.handleLinkInputAction=i=>{window.open(this.link.href,"_blank");i.stopPropagation()};this.handleLinkTitleChange=i=>{var t;this.emitLinkChange(i.detail,(t=this.link)===null||t===void 0?void 0:t.href)};this.handleLinkValueChange=i=>{var t;const e=i.detail;this.emitLinkChange((t=this.link)===null||t===void 0?void 0:t.text,e)};this.emitLinkChange=(i,t)=>{const e={text:i,href:t};this.linkChange.emit(e)};this.link=undefined;this.language="en";this.isOpen=false}connectedCallback(){this.setupGlobalHandlers()}disconnectedCallback(){this.teardownGlobalHandlers()}setupGlobalHandlers(){if(this.isOpen){document.addEventListener("keyup",this.handleCancel)}}teardownGlobalHandlers(){document.removeEventListener("keyup",this.handleCancel)}componentDidLoad(){this.focusOnTextInput()}focusOnTextInput(){if(this.textInput){const i=this.textInput.shadowRoot.querySelector("input");if(i){requestAnimationFrame((()=>{i.focus()}))}}}render(){var i,t;const s=this.isValid(this.link.href);return[e("limel-input-field",{label:this.getTranslation("editor-link-menu.text"),value:((i=this.link)===null||i===void 0?void 0:i.text)||"",leadingIcon:"text_cursor",onChange:this.handleLinkTitleChange,onKeyDown:this.handleKeyDown,ref:i=>this.textInput=i}),e("limel-input-field",{label:this.getTranslation("editor-link-menu.link"),value:((t=this.link)===null||t===void 0?void 0:t.href)||"",type:"text",leadingIcon:"-lime-text-link",trailingIcon:"external_link",invalid:!s,onChange:this.handleLinkValueChange,onAction:this.handleLinkInputAction,onKeyDown:this.handleKeyDown}),e("div",{class:"actions"},e("limel-button",{label:this.getTranslation("cancel"),onClick:this.handleCancel}),e("limel-button",{primary:true,label:this.getTranslation("save"),disabled:!s,onClick:this.handleSave,ref:i=>this.saveButton=i,slot:"button"}))]}};m.style=d;export{c as limel_action_bar,m as limel_text_editor_link_menu};
|
|
2
|
+
//# sourceMappingURL=p-e7201ebd.entry.js.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { FileInfo } from '../../global/shared-types/file.types';
|
|
3
|
+
import { Icon } from '../../global/shared-types/icon.types';
|
|
4
|
+
import { Languages } from '../date-picker/date.types';
|
|
5
|
+
import { ResizeOptions } from '../../util/image-resize';
|
|
6
|
+
/**
|
|
7
|
+
* This component displays a profile picture, while allowing the user
|
|
8
|
+
* to change it via a file input or drag-and-drop.
|
|
9
|
+
*
|
|
10
|
+
* It supports client-side image resizing and conversion,
|
|
11
|
+
* as well as a simple lazy-loading mechanism.
|
|
12
|
+
*
|
|
13
|
+
* @exampleComponent limel-example-profile-picture-basic
|
|
14
|
+
* @exampleComponent limel-example-profile-picture-helper-text
|
|
15
|
+
* @exampleComponent limel-example-profile-picture-icon
|
|
16
|
+
* @exampleComponent limel-example-profile-picture-with-value
|
|
17
|
+
* @exampleComponent limel-example-profile-picture-loading
|
|
18
|
+
* @exampleComponent limel-example-profile-picture-image-fit
|
|
19
|
+
* @exampleComponent limel-example-profile-picture-composite
|
|
20
|
+
* @exampleComponent limel-example-profile-picture-resize-contain
|
|
21
|
+
* @exampleComponent limel-example-profile-picture-resize-cover
|
|
22
|
+
* @exampleComponent limel-example-profile-picture-resize-fallback
|
|
23
|
+
* @exampleComponent limel-example-profile-picture-styling
|
|
24
|
+
* @beta
|
|
25
|
+
*/
|
|
26
|
+
export declare class ProfilePicture {
|
|
27
|
+
/**
|
|
28
|
+
* Defines the language for translations.
|
|
29
|
+
* Will translate the translatable strings on the components.
|
|
30
|
+
*/
|
|
31
|
+
language: Languages;
|
|
32
|
+
/**
|
|
33
|
+
* Accessible label for the the browse button.
|
|
34
|
+
*/
|
|
35
|
+
label: string;
|
|
36
|
+
/**
|
|
37
|
+
* Placeholder icon of the component, displayed when no image is present.
|
|
38
|
+
*/
|
|
39
|
+
icon: string | Icon;
|
|
40
|
+
/**
|
|
41
|
+
* Helper text shown as a tooltip on hover or focus.
|
|
42
|
+
*/
|
|
43
|
+
helperText?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Disables user interaction.
|
|
46
|
+
* Prevents uploading new pictures or removing existing ones.
|
|
47
|
+
*/
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Readonly prevents changing the value but allows interaction like focus.
|
|
51
|
+
*/
|
|
52
|
+
readonly: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Marks the control as required.
|
|
55
|
+
*/
|
|
56
|
+
required: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Marks the control as invalid.
|
|
59
|
+
*/
|
|
60
|
+
invalid: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Set to `true` to put the component in the `loading` state,
|
|
63
|
+
* and render an indeterminate progress indicator inside.
|
|
64
|
+
* This does _not_ disable the interactivity of the component!
|
|
65
|
+
*/
|
|
66
|
+
loading: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Current image to display. Either a URL string or a `FileInfo` with an href.
|
|
69
|
+
*/
|
|
70
|
+
value?: string | FileInfo;
|
|
71
|
+
/**
|
|
72
|
+
* How the image should fit within the container.
|
|
73
|
+
* - `cover` will fill the container and crop excess parts.
|
|
74
|
+
* - `contain` will scale the image to fit within the container without cropping.
|
|
75
|
+
*/
|
|
76
|
+
imageFit: 'cover' | 'contain';
|
|
77
|
+
/**
|
|
78
|
+
* A comma-separated list of accepted file types.
|
|
79
|
+
*/
|
|
80
|
+
accept: string;
|
|
81
|
+
/**
|
|
82
|
+
* Optional client-side resize before emitting the file.
|
|
83
|
+
* If provided, the selected image will be resized on the client device.
|
|
84
|
+
* :::note
|
|
85
|
+
* HEIC may not decode in all browsers; when decoding fails, the original
|
|
86
|
+
* file will be emitted. See the examples for more info.
|
|
87
|
+
* :::
|
|
88
|
+
*/
|
|
89
|
+
resize?: ResizeOptions;
|
|
90
|
+
/**
|
|
91
|
+
* Emitted when the picture changes (first FileInfo only).
|
|
92
|
+
*/
|
|
93
|
+
change: EventEmitter<FileInfo | undefined>;
|
|
94
|
+
/**
|
|
95
|
+
* Emitted when a file is rejected by accept filter.
|
|
96
|
+
*/
|
|
97
|
+
filesRejected: EventEmitter<FileInfo[]>;
|
|
98
|
+
private objectUrl?;
|
|
99
|
+
private imageError;
|
|
100
|
+
private isErrorMessagePopoverOpen;
|
|
101
|
+
private removeButtonId;
|
|
102
|
+
private browseButtonId;
|
|
103
|
+
disconnectedCallback(): void;
|
|
104
|
+
protected handleValueChange(): void;
|
|
105
|
+
render(): any;
|
|
106
|
+
private get hasValue();
|
|
107
|
+
private renderBrowseButton;
|
|
108
|
+
private renderAvatar;
|
|
109
|
+
private renderIcon;
|
|
110
|
+
private renderClearButton;
|
|
111
|
+
private renderSpinner;
|
|
112
|
+
private renderHelperText;
|
|
113
|
+
private getUnsupportedPreviewContext;
|
|
114
|
+
private shouldShowErrorMessage;
|
|
115
|
+
private renderErrorMessage;
|
|
116
|
+
private handleNewFiles;
|
|
117
|
+
private handleRejectedFiles;
|
|
118
|
+
private getImageSrc;
|
|
119
|
+
private revokeObjectUrl;
|
|
120
|
+
private handleClear;
|
|
121
|
+
private onImageError;
|
|
122
|
+
private openPopover;
|
|
123
|
+
private onPopoverClose;
|
|
124
|
+
private getTranslation;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=profile-picture.d.ts.map
|
|
@@ -38,6 +38,7 @@ import { CustomElementDefinition } from "./global/shared-types/custom-element.ty
|
|
|
38
38
|
import { PickerValue } from "./components/picker/value.types";
|
|
39
39
|
import { Searcher } from "./components/picker/searcher.types";
|
|
40
40
|
import { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
|
|
41
|
+
import { ResizeOptions } from "./util/image-resize";
|
|
41
42
|
import { FlowItem } from "./components/progress-flow/progress-flow.types";
|
|
42
43
|
import { EditorImage, EditorMetadata, ImageInserter, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
43
44
|
import { EditorUiType } from "./components/text-editor/types";
|
|
@@ -80,6 +81,7 @@ export { CustomElementDefinition } from "./global/shared-types/custom-element.ty
|
|
|
80
81
|
export { PickerValue } from "./components/picker/value.types";
|
|
81
82
|
export { Searcher } from "./components/picker/searcher.types";
|
|
82
83
|
export { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
|
|
84
|
+
export { ResizeOptions } from "./util/image-resize";
|
|
83
85
|
export { FlowItem } from "./components/progress-flow/progress-flow.types";
|
|
84
86
|
export { EditorImage, EditorMetadata, ImageInserter, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
85
87
|
export { EditorUiType } from "./components/text-editor/types";
|
|
@@ -2304,6 +2306,78 @@ export namespace Components {
|
|
|
2304
2306
|
*/
|
|
2305
2307
|
"visible": boolean;
|
|
2306
2308
|
}
|
|
2309
|
+
/**
|
|
2310
|
+
* This component displays a profile picture, while allowing the user
|
|
2311
|
+
* to change it via a file input or drag-and-drop.
|
|
2312
|
+
* It supports client-side image resizing and conversion,
|
|
2313
|
+
* as well as a simple lazy-loading mechanism.
|
|
2314
|
+
* @exampleComponent limel-example-profile-picture-basic
|
|
2315
|
+
* @exampleComponent limel-example-profile-picture-helper-text
|
|
2316
|
+
* @exampleComponent limel-example-profile-picture-icon
|
|
2317
|
+
* @exampleComponent limel-example-profile-picture-with-value
|
|
2318
|
+
* @exampleComponent limel-example-profile-picture-loading
|
|
2319
|
+
* @exampleComponent limel-example-profile-picture-image-fit
|
|
2320
|
+
* @exampleComponent limel-example-profile-picture-composite
|
|
2321
|
+
* @exampleComponent limel-example-profile-picture-resize-contain
|
|
2322
|
+
* @exampleComponent limel-example-profile-picture-resize-cover
|
|
2323
|
+
* @exampleComponent limel-example-profile-picture-resize-fallback
|
|
2324
|
+
* @exampleComponent limel-example-profile-picture-styling
|
|
2325
|
+
* @beta
|
|
2326
|
+
*/
|
|
2327
|
+
interface LimelProfilePicture {
|
|
2328
|
+
/**
|
|
2329
|
+
* A comma-separated list of accepted file types.
|
|
2330
|
+
*/
|
|
2331
|
+
"accept": string;
|
|
2332
|
+
/**
|
|
2333
|
+
* Disables user interaction. Prevents uploading new pictures or removing existing ones.
|
|
2334
|
+
*/
|
|
2335
|
+
"disabled": boolean;
|
|
2336
|
+
/**
|
|
2337
|
+
* Helper text shown as a tooltip on hover or focus.
|
|
2338
|
+
*/
|
|
2339
|
+
"helperText"?: string;
|
|
2340
|
+
/**
|
|
2341
|
+
* Placeholder icon of the component, displayed when no image is present.
|
|
2342
|
+
*/
|
|
2343
|
+
"icon": string | Icon;
|
|
2344
|
+
/**
|
|
2345
|
+
* How the image should fit within the container. - `cover` will fill the container and crop excess parts. - `contain` will scale the image to fit within the container without cropping.
|
|
2346
|
+
*/
|
|
2347
|
+
"imageFit": 'cover' | 'contain';
|
|
2348
|
+
/**
|
|
2349
|
+
* Marks the control as invalid.
|
|
2350
|
+
*/
|
|
2351
|
+
"invalid": boolean;
|
|
2352
|
+
/**
|
|
2353
|
+
* Accessible label for the the browse button.
|
|
2354
|
+
*/
|
|
2355
|
+
"label": string;
|
|
2356
|
+
/**
|
|
2357
|
+
* Defines the language for translations. Will translate the translatable strings on the components.
|
|
2358
|
+
*/
|
|
2359
|
+
"language": Languages;
|
|
2360
|
+
/**
|
|
2361
|
+
* Set to `true` to put the component in the `loading` state, and render an indeterminate progress indicator inside. This does _not_ disable the interactivity of the component!
|
|
2362
|
+
*/
|
|
2363
|
+
"loading": boolean;
|
|
2364
|
+
/**
|
|
2365
|
+
* Readonly prevents changing the value but allows interaction like focus.
|
|
2366
|
+
*/
|
|
2367
|
+
"readonly": boolean;
|
|
2368
|
+
/**
|
|
2369
|
+
* Marks the control as required.
|
|
2370
|
+
*/
|
|
2371
|
+
"required": boolean;
|
|
2372
|
+
/**
|
|
2373
|
+
* Optional client-side resize before emitting the file. If provided, the selected image will be resized on the client device. :::note HEIC may not decode in all browsers; when decoding fails, the original file will be emitted. See the examples for more info. :::
|
|
2374
|
+
*/
|
|
2375
|
+
"resize"?: ResizeOptions;
|
|
2376
|
+
/**
|
|
2377
|
+
* Current image to display. Either a URL string or a `FileInfo` with an href.
|
|
2378
|
+
*/
|
|
2379
|
+
"value"?: string | FileInfo;
|
|
2380
|
+
}
|
|
2307
2381
|
/**
|
|
2308
2382
|
* @exampleComponent limel-example-progress-flow-basic
|
|
2309
2383
|
* @exampleComponent limel-example-progress-flow-secondary-text
|
|
@@ -3166,6 +3240,10 @@ export interface LimelPopoverCustomEvent<T> extends CustomEvent<T> {
|
|
|
3166
3240
|
detail: T;
|
|
3167
3241
|
target: HTMLLimelPopoverElement;
|
|
3168
3242
|
}
|
|
3243
|
+
export interface LimelProfilePictureCustomEvent<T> extends CustomEvent<T> {
|
|
3244
|
+
detail: T;
|
|
3245
|
+
target: HTMLLimelProfilePictureElement;
|
|
3246
|
+
}
|
|
3169
3247
|
export interface LimelProgressFlowCustomEvent<T> extends CustomEvent<T> {
|
|
3170
3248
|
detail: T;
|
|
3171
3249
|
target: HTMLLimelProgressFlowElement;
|
|
@@ -4371,6 +4449,30 @@ declare global {
|
|
|
4371
4449
|
prototype: HTMLLimelPortalElement;
|
|
4372
4450
|
new (): HTMLLimelPortalElement;
|
|
4373
4451
|
};
|
|
4452
|
+
/**
|
|
4453
|
+
* This component displays a profile picture, while allowing the user
|
|
4454
|
+
* to change it via a file input or drag-and-drop.
|
|
4455
|
+
* It supports client-side image resizing and conversion,
|
|
4456
|
+
* as well as a simple lazy-loading mechanism.
|
|
4457
|
+
* @exampleComponent limel-example-profile-picture-basic
|
|
4458
|
+
* @exampleComponent limel-example-profile-picture-helper-text
|
|
4459
|
+
* @exampleComponent limel-example-profile-picture-icon
|
|
4460
|
+
* @exampleComponent limel-example-profile-picture-with-value
|
|
4461
|
+
* @exampleComponent limel-example-profile-picture-loading
|
|
4462
|
+
* @exampleComponent limel-example-profile-picture-image-fit
|
|
4463
|
+
* @exampleComponent limel-example-profile-picture-composite
|
|
4464
|
+
* @exampleComponent limel-example-profile-picture-resize-contain
|
|
4465
|
+
* @exampleComponent limel-example-profile-picture-resize-cover
|
|
4466
|
+
* @exampleComponent limel-example-profile-picture-resize-fallback
|
|
4467
|
+
* @exampleComponent limel-example-profile-picture-styling
|
|
4468
|
+
* @beta
|
|
4469
|
+
*/
|
|
4470
|
+
interface HTMLLimelProfilePictureElement extends Components.LimelProfilePicture, HTMLStencilElement {
|
|
4471
|
+
}
|
|
4472
|
+
var HTMLLimelProfilePictureElement: {
|
|
4473
|
+
prototype: HTMLLimelProfilePictureElement;
|
|
4474
|
+
new (): HTMLLimelProfilePictureElement;
|
|
4475
|
+
};
|
|
4374
4476
|
/**
|
|
4375
4477
|
* @exampleComponent limel-example-progress-flow-basic
|
|
4376
4478
|
* @exampleComponent limel-example-progress-flow-secondary-text
|
|
@@ -4777,6 +4879,7 @@ declare global {
|
|
|
4777
4879
|
"limel-popover": HTMLLimelPopoverElement;
|
|
4778
4880
|
"limel-popover-surface": HTMLLimelPopoverSurfaceElement;
|
|
4779
4881
|
"limel-portal": HTMLLimelPortalElement;
|
|
4882
|
+
"limel-profile-picture": HTMLLimelProfilePictureElement;
|
|
4780
4883
|
"limel-progress-flow": HTMLLimelProgressFlowElement;
|
|
4781
4884
|
"limel-progress-flow-item": HTMLLimelProgressFlowItemElement;
|
|
4782
4885
|
"limel-prosemirror-adapter": HTMLLimelProsemirrorAdapterElement;
|
|
@@ -7204,6 +7307,86 @@ declare namespace LocalJSX {
|
|
|
7204
7307
|
*/
|
|
7205
7308
|
"visible"?: boolean;
|
|
7206
7309
|
}
|
|
7310
|
+
/**
|
|
7311
|
+
* This component displays a profile picture, while allowing the user
|
|
7312
|
+
* to change it via a file input or drag-and-drop.
|
|
7313
|
+
* It supports client-side image resizing and conversion,
|
|
7314
|
+
* as well as a simple lazy-loading mechanism.
|
|
7315
|
+
* @exampleComponent limel-example-profile-picture-basic
|
|
7316
|
+
* @exampleComponent limel-example-profile-picture-helper-text
|
|
7317
|
+
* @exampleComponent limel-example-profile-picture-icon
|
|
7318
|
+
* @exampleComponent limel-example-profile-picture-with-value
|
|
7319
|
+
* @exampleComponent limel-example-profile-picture-loading
|
|
7320
|
+
* @exampleComponent limel-example-profile-picture-image-fit
|
|
7321
|
+
* @exampleComponent limel-example-profile-picture-composite
|
|
7322
|
+
* @exampleComponent limel-example-profile-picture-resize-contain
|
|
7323
|
+
* @exampleComponent limel-example-profile-picture-resize-cover
|
|
7324
|
+
* @exampleComponent limel-example-profile-picture-resize-fallback
|
|
7325
|
+
* @exampleComponent limel-example-profile-picture-styling
|
|
7326
|
+
* @beta
|
|
7327
|
+
*/
|
|
7328
|
+
interface LimelProfilePicture {
|
|
7329
|
+
/**
|
|
7330
|
+
* A comma-separated list of accepted file types.
|
|
7331
|
+
*/
|
|
7332
|
+
"accept"?: string;
|
|
7333
|
+
/**
|
|
7334
|
+
* Disables user interaction. Prevents uploading new pictures or removing existing ones.
|
|
7335
|
+
*/
|
|
7336
|
+
"disabled"?: boolean;
|
|
7337
|
+
/**
|
|
7338
|
+
* Helper text shown as a tooltip on hover or focus.
|
|
7339
|
+
*/
|
|
7340
|
+
"helperText"?: string;
|
|
7341
|
+
/**
|
|
7342
|
+
* Placeholder icon of the component, displayed when no image is present.
|
|
7343
|
+
*/
|
|
7344
|
+
"icon"?: string | Icon;
|
|
7345
|
+
/**
|
|
7346
|
+
* How the image should fit within the container. - `cover` will fill the container and crop excess parts. - `contain` will scale the image to fit within the container without cropping.
|
|
7347
|
+
*/
|
|
7348
|
+
"imageFit"?: 'cover' | 'contain';
|
|
7349
|
+
/**
|
|
7350
|
+
* Marks the control as invalid.
|
|
7351
|
+
*/
|
|
7352
|
+
"invalid"?: boolean;
|
|
7353
|
+
/**
|
|
7354
|
+
* Accessible label for the the browse button.
|
|
7355
|
+
*/
|
|
7356
|
+
"label"?: string;
|
|
7357
|
+
/**
|
|
7358
|
+
* Defines the language for translations. Will translate the translatable strings on the components.
|
|
7359
|
+
*/
|
|
7360
|
+
"language"?: Languages;
|
|
7361
|
+
/**
|
|
7362
|
+
* Set to `true` to put the component in the `loading` state, and render an indeterminate progress indicator inside. This does _not_ disable the interactivity of the component!
|
|
7363
|
+
*/
|
|
7364
|
+
"loading"?: boolean;
|
|
7365
|
+
/**
|
|
7366
|
+
* Emitted when the picture changes (first FileInfo only).
|
|
7367
|
+
*/
|
|
7368
|
+
"onChange"?: (event: LimelProfilePictureCustomEvent<FileInfo | undefined>) => void;
|
|
7369
|
+
/**
|
|
7370
|
+
* Emitted when a file is rejected by accept filter.
|
|
7371
|
+
*/
|
|
7372
|
+
"onFilesRejected"?: (event: LimelProfilePictureCustomEvent<FileInfo[]>) => void;
|
|
7373
|
+
/**
|
|
7374
|
+
* Readonly prevents changing the value but allows interaction like focus.
|
|
7375
|
+
*/
|
|
7376
|
+
"readonly"?: boolean;
|
|
7377
|
+
/**
|
|
7378
|
+
* Marks the control as required.
|
|
7379
|
+
*/
|
|
7380
|
+
"required"?: boolean;
|
|
7381
|
+
/**
|
|
7382
|
+
* Optional client-side resize before emitting the file. If provided, the selected image will be resized on the client device. :::note HEIC may not decode in all browsers; when decoding fails, the original file will be emitted. See the examples for more info. :::
|
|
7383
|
+
*/
|
|
7384
|
+
"resize"?: ResizeOptions;
|
|
7385
|
+
/**
|
|
7386
|
+
* Current image to display. Either a URL string or a `FileInfo` with an href.
|
|
7387
|
+
*/
|
|
7388
|
+
"value"?: string | FileInfo;
|
|
7389
|
+
}
|
|
7207
7390
|
/**
|
|
7208
7391
|
* @exampleComponent limel-example-progress-flow-basic
|
|
7209
7392
|
* @exampleComponent limel-example-progress-flow-secondary-text
|
|
@@ -8138,6 +8321,7 @@ declare namespace LocalJSX {
|
|
|
8138
8321
|
"limel-popover": LimelPopover;
|
|
8139
8322
|
"limel-popover-surface": LimelPopoverSurface;
|
|
8140
8323
|
"limel-portal": LimelPortal;
|
|
8324
|
+
"limel-profile-picture": LimelProfilePicture;
|
|
8141
8325
|
"limel-progress-flow": LimelProgressFlow;
|
|
8142
8326
|
"limel-progress-flow-item": LimelProgressFlowItem;
|
|
8143
8327
|
"limel-prosemirror-adapter": LimelProsemirrorAdapter;
|
|
@@ -9040,6 +9224,25 @@ declare module "@stencil/core" {
|
|
|
9040
9224
|
* @exampleComponent limel-example-portal-basic
|
|
9041
9225
|
*/
|
|
9042
9226
|
"limel-portal": LocalJSX.LimelPortal & JSXBase.HTMLAttributes<HTMLLimelPortalElement>;
|
|
9227
|
+
/**
|
|
9228
|
+
* This component displays a profile picture, while allowing the user
|
|
9229
|
+
* to change it via a file input or drag-and-drop.
|
|
9230
|
+
* It supports client-side image resizing and conversion,
|
|
9231
|
+
* as well as a simple lazy-loading mechanism.
|
|
9232
|
+
* @exampleComponent limel-example-profile-picture-basic
|
|
9233
|
+
* @exampleComponent limel-example-profile-picture-helper-text
|
|
9234
|
+
* @exampleComponent limel-example-profile-picture-icon
|
|
9235
|
+
* @exampleComponent limel-example-profile-picture-with-value
|
|
9236
|
+
* @exampleComponent limel-example-profile-picture-loading
|
|
9237
|
+
* @exampleComponent limel-example-profile-picture-image-fit
|
|
9238
|
+
* @exampleComponent limel-example-profile-picture-composite
|
|
9239
|
+
* @exampleComponent limel-example-profile-picture-resize-contain
|
|
9240
|
+
* @exampleComponent limel-example-profile-picture-resize-cover
|
|
9241
|
+
* @exampleComponent limel-example-profile-picture-resize-fallback
|
|
9242
|
+
* @exampleComponent limel-example-profile-picture-styling
|
|
9243
|
+
* @beta
|
|
9244
|
+
*/
|
|
9245
|
+
"limel-profile-picture": LocalJSX.LimelProfilePicture & JSXBase.HTMLAttributes<HTMLLimelProfilePictureElement>;
|
|
9043
9246
|
/**
|
|
9044
9247
|
* @exampleComponent limel-example-progress-flow-basic
|
|
9045
9248
|
* @exampleComponent limel-example-progress-flow-secondary-text
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=da.d.ts.map
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=de.d.ts.map
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=en.d.ts.map
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=fi.d.ts.map
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=fr.d.ts.map
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=nl.d.ts.map
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=no.d.ts.map
|
|
@@ -50,6 +50,9 @@ declare const _default: {
|
|
|
50
50
|
'ai-avatar.thinking': string;
|
|
51
51
|
'table.select-all': string;
|
|
52
52
|
'table.select-row': string;
|
|
53
|
+
'profile-picture.remove': string;
|
|
54
|
+
'profile-picture.unsupported-preview.title': string;
|
|
55
|
+
'profile-picture.unsupported-preview.description': string;
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
55
58
|
//# sourceMappingURL=sv.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image resize utilities
|
|
3
|
+
*
|
|
4
|
+
* Overview
|
|
5
|
+
* --------
|
|
6
|
+
* This module provides a small, dependency-free utility to resize images on the client
|
|
7
|
+
* (in the browser) before uploading. It works by decoding an input `File` to an
|
|
8
|
+
* `ImageBitmap` (or falling back to an `HTMLImageElement`), drawing it onto a
|
|
9
|
+
* `Canvas`/`OffscreenCanvas` with the requested strategy (cover/contain), and
|
|
10
|
+
* then exporting the result to a new `File` with your preferred MIME type and
|
|
11
|
+
* quality.
|
|
12
|
+
*
|
|
13
|
+
* Why resize client-side?
|
|
14
|
+
* - Faster perceived uploads and lower bandwidth usage
|
|
15
|
+
* - Consistent avatar sizes and formats (e.g., JPEG 400x400)
|
|
16
|
+
* - No server-side transformation required for common cases
|
|
17
|
+
*
|
|
18
|
+
* Fit strategies
|
|
19
|
+
* - `cover` (default): The image is scaled to cover the target rectangle, and
|
|
20
|
+
* the excess parts are center-cropped. Good for avatars.
|
|
21
|
+
* - `contain`: The image is scaled to fit entirely within the target rectangle
|
|
22
|
+
* without cropping, letterboxing if needed. Good when you must preserve the
|
|
23
|
+
* entire image.
|
|
24
|
+
*
|
|
25
|
+
* Decoding & EXIF orientation
|
|
26
|
+
* EXIF orientation is a piece of metadata stored inside image files
|
|
27
|
+
* (usually JPEGs) that tells image renderer software how the image should be displayed
|
|
28
|
+
* i.e., whether it should be rotated or flipped. This meta data is normally added
|
|
29
|
+
* to photos by digital cameras and phones.
|
|
30
|
+
* - When available, `createImageBitmap(file, { imageOrientation: 'from-image' })`
|
|
31
|
+
* is used to automatically respect EXIF orientation.
|
|
32
|
+
* - If not available or it fails (e.g., unsupported format), we fall back to
|
|
33
|
+
* decoding via an `HTMLImageElement`.
|
|
34
|
+
*
|
|
35
|
+
* OffscreenCanvas
|
|
36
|
+
* - If the environment supports `OffscreenCanvas`, it will be used for the draw
|
|
37
|
+
* and encode operations for better performance in some cases. Otherwise, a
|
|
38
|
+
* regular `HTMLCanvasElement` is used.
|
|
39
|
+
*
|
|
40
|
+
* HEIC/HEIF notes
|
|
41
|
+
* - All major browsers except Safari lack native HEIC/HEIF decoding.
|
|
42
|
+
* In such cases the `resizeImage` function will throw when decoding fails.
|
|
43
|
+
* The caller should catch and fall back
|
|
44
|
+
* to using the original file or handle conversion on the server.
|
|
45
|
+
* - If we need guaranteed client-side HEIC->JPEG conversion, we must add a small
|
|
46
|
+
* library or WASM module; this utility intentionally avoids extra dependencies.
|
|
47
|
+
*
|
|
48
|
+
* Output type & quality
|
|
49
|
+
* - Default output is `image/jpeg` with `quality=0.85`, which is typically
|
|
50
|
+
* appropriate for avatars. You can switch to `image/png` to preserve
|
|
51
|
+
* transparency.
|
|
52
|
+
* - The output filename extension is adjusted to match the chosen MIME type by
|
|
53
|
+
* default (e.g., `.jpg` or `.png`). You can override naming via the `rename`
|
|
54
|
+
* option.
|
|
55
|
+
*
|
|
56
|
+
* Error handling
|
|
57
|
+
* - Throws if canvas/context cannot be created or if canvas->blob conversion fails.
|
|
58
|
+
* - Decoding failures (unsupported type) will throw; caller can try/catch and
|
|
59
|
+
* fall back to the original file.
|
|
60
|
+
*
|
|
61
|
+
* Performance tips
|
|
62
|
+
* - Keep target sizes reasonable (e.g., 256–1024 px) to avoid long processing
|
|
63
|
+
* times on modest devices.
|
|
64
|
+
* - JPEG with quality 0.8–0.9 often strikes a good balance between size and
|
|
65
|
+
* perceived quality for photos/avatars.
|
|
66
|
+
*
|
|
67
|
+
* Usage examples
|
|
68
|
+
* --------------
|
|
69
|
+
* Basic usage:
|
|
70
|
+
* ```ts
|
|
71
|
+
* import { resizeImage } from '@limetech/lime-elements/util/image-resize';
|
|
72
|
+
*
|
|
73
|
+
* const processed = await resizeImage(file, {
|
|
74
|
+
* width: 400,
|
|
75
|
+
* height: 400,
|
|
76
|
+
* fit: 'cover', // default; center-crops
|
|
77
|
+
* type: 'image/jpeg', // default
|
|
78
|
+
* quality: 0.85, // default
|
|
79
|
+
* });
|
|
80
|
+
* // Upload `processed` instead of the original file
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* With custom naming:
|
|
84
|
+
* ```ts
|
|
85
|
+
* const processed = await resizeImage(file, {
|
|
86
|
+
* width: 800,
|
|
87
|
+
* height: 800,
|
|
88
|
+
* fit: 'contain',
|
|
89
|
+
* type: 'image/png',
|
|
90
|
+
* rename: (name) => name.replace(/\.[^.]+$/, '') + '_resized.png',
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* In a Stencil component (simplified):
|
|
95
|
+
* ```tsx
|
|
96
|
+
* private async handleFilesSelected(file: File) {
|
|
97
|
+
* try {
|
|
98
|
+
* const resized = await resizeImage(file, { width: 400, height: 400 });
|
|
99
|
+
* // build your FileInfo and emit
|
|
100
|
+
* } catch {
|
|
101
|
+
* // fall back to original
|
|
102
|
+
* }
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
/**
|
|
107
|
+
* Options for client-side image resizing.
|
|
108
|
+
* @beta
|
|
109
|
+
*/
|
|
110
|
+
export type ResizeOptions = {
|
|
111
|
+
/** Target width in CSS pixels. */
|
|
112
|
+
width: number;
|
|
113
|
+
/** Target height in CSS pixels. */
|
|
114
|
+
height: number;
|
|
115
|
+
/** Fit strategy; defaults to 'cover'. */
|
|
116
|
+
fit?: 'cover' | 'contain';
|
|
117
|
+
/** Output MIME type; 'image/jpeg' by default. */
|
|
118
|
+
type?: 'image/jpeg' | 'image/png';
|
|
119
|
+
/** JPEG quality (0..1); used only for 'image/jpeg'. Defaults to 0.85. */
|
|
120
|
+
quality?: number;
|
|
121
|
+
/** Optional renaming function. Defaults to changing extension to match MIME. */
|
|
122
|
+
rename?: (originalName: string) => string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Resize an image file on the client using Canvas/OffscreenCanvas.
|
|
126
|
+
* Returns a new File with the requested format and dimensions.
|
|
127
|
+
*
|
|
128
|
+
* Contract
|
|
129
|
+
* - Input: image `File`
|
|
130
|
+
* - Output: resized image as a new `File` with updated `type`, name, and size
|
|
131
|
+
* - Errors: may throw on decode failure or canvas export failure
|
|
132
|
+
*
|
|
133
|
+
* @beta
|
|
134
|
+
* @param file - The image file to resize.
|
|
135
|
+
* @param options - Configuration for the resize operation.
|
|
136
|
+
*/
|
|
137
|
+
export declare function resizeImage(file: File, options: ResizeOptions): Promise<File>;
|
|
138
|
+
//# sourceMappingURL=image-resize.d.ts.map
|