@limetech/lime-elements 39.45.0 → 39.45.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 +7 -0
- package/dist/cjs/limel-form.cjs.entry.js +41 -9
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +6 -6
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +6 -6
- package/dist/esm/limel-form.entry.js +41 -9
- package/dist/esm/limel-text-editor-link-menu.entry.js +6 -6
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-1fb4bfa9.entry.js → p-421612f9.entry.js} +2 -2
- package/dist/lime-elements/p-d97df2cd.entry.js +1 -0
- package/dist/types/components/text-editor/link-menu/editor-link-menu.d.ts +2 -2
- package/package.json +3 -3
- package/dist/lime-elements/p-e8df7a2e.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as e}from"./p-BGxJfR2f.js";import{t as s}from"./p-Cb9R_zmF.js";import{a,E as n}from"./p-C4_9qUMP.js";const l=class{constructor(e){i(this,e),this.cancel=t(this,"cancel"),this.save=t(this,"save"),this.linkChange=t(this,"linkChange"),this.language="en",this.isOpen=!1,this.getTranslation=i=>s.get(i,this.language),this.isValid=i=>{try{new URL(i)}catch(i){return!1}return!0},this.handleKeyDown=i=>{var t;i.key===a&&(this.saveButton&&this.saveButton.focus(),i.preventDefault(),this.isValid(null===(t=this.link)||void 0===t?void 0:t.href)&&this.handleSave(i))},this.handleCancel=i=>{i instanceof KeyboardEvent&&i.key!==n||(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,null===(t=this.link)||void 0===t?void 0:t.href)},this.handleLinkValueChange=i=>{var t;this.emitLinkChange(null===(t=this.link)||void 0===t?void 0:t.text,i.detail)},this.emitLinkChange=(i,t)=>{this.linkChange.emit({text:i,href:t})}}connectedCallback(){this.setupGlobalHandlers()}disconnectedCallback(){this.teardownGlobalHandlers()}setupGlobalHandlers(){this.isOpen&&document.addEventListener("keyup",this.handleCancel)}teardownGlobalHandlers(){document.removeEventListener("keyup",this.handleCancel)}componentDidLoad(){this.focusOnLinkInput()}focusOnLinkInput(){if(this.linkInput){const i=this.linkInput.shadowRoot.querySelector("input");i&&requestAnimationFrame((()=>{i.focus()}))}}render(){var i,t;const s=this.isValid(this.link.href);return[e("limel-input-field",{key:"8da44ef5f8141c0b7e4cadf75babd07a62614674",label:this.getTranslation("editor-link-menu.text"),value:(null===(i=this.link)||void 0===i?void 0:i.text)||"",leadingIcon:"text_cursor",onChange:this.handleLinkTitleChange,onKeyDown:this.handleKeyDown}),e("limel-input-field",{key:"a16f2a13564809011551bf96e34e100b0683493c",label:this.getTranslation("editor-link-menu.link"),value:(null===(t=this.link)||void 0===t?void 0:t.href)||"",type:"text",leadingIcon:"-lime-text-link",trailingIcon:"external_link",invalid:!s,onChange:this.handleLinkValueChange,onAction:this.handleLinkInputAction,onKeyDown:this.handleKeyDown,ref:i=>this.linkInput=i}),e("div",{key:"ee392b700a4293eb2b2121d08bfef852f8b4404e",class:"actions"},e("limel-button",{key:"be9f4711edf45a69f8087341e61fc4183c59ba2d",label:this.getTranslation("cancel"),onClick:this.handleCancel}),e("limel-button",{key:"b958cae7915cc42133e5143589d4f454f8bb2ffa",primary:!0,label:this.getTranslation("save"),disabled:!s,onClick:this.handleSave,ref:i=>this.saveButton=i,slot:"button"}))]}};l.style=":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}}";export{l as limel_text_editor_link_menu}
|
|
@@ -32,14 +32,14 @@ export declare class TextEditorLinkMenu {
|
|
|
32
32
|
* Emitted when the user inputs new values for the link
|
|
33
33
|
*/
|
|
34
34
|
private linkChange;
|
|
35
|
-
private
|
|
35
|
+
private linkInput;
|
|
36
36
|
private saveButton;
|
|
37
37
|
connectedCallback(): void;
|
|
38
38
|
disconnectedCallback(): void;
|
|
39
39
|
private setupGlobalHandlers;
|
|
40
40
|
private teardownGlobalHandlers;
|
|
41
41
|
componentDidLoad(): void;
|
|
42
|
-
private
|
|
42
|
+
private focusOnLinkInput;
|
|
43
43
|
render(): any[];
|
|
44
44
|
private getTranslation;
|
|
45
45
|
private isValid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "39.45.
|
|
3
|
+
"version": "39.45.1",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@playwright/test": "1.62.1",
|
|
59
59
|
"@popperjs/core": "^2.11.8",
|
|
60
60
|
"@rjsf/core": "^6.7.1",
|
|
61
|
-
"@rjsf/utils": "^6.
|
|
62
|
-
"@rjsf/validator-ajv8": "^6.
|
|
61
|
+
"@rjsf/utils": "^6.8.0",
|
|
62
|
+
"@rjsf/validator-ajv8": "^6.8.0",
|
|
63
63
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
64
64
|
"@stencil/core": "^4.43.5",
|
|
65
65
|
"@stencil/sass": "^3.3.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-BGxJfR2f.js";import{t as s}from"./p-Cb9R_zmF.js";import{a,E as n}from"./p-C4_9qUMP.js";const l=class{constructor(e){t(this,e),this.cancel=i(this,"cancel"),this.save=i(this,"save"),this.linkChange=i(this,"linkChange"),this.language="en",this.isOpen=!1,this.getTranslation=t=>s.get(t,this.language),this.isValid=t=>{try{new URL(t)}catch(t){return!1}return!0},this.handleKeyDown=t=>{var i;t.key===a&&(this.saveButton&&this.saveButton.focus(),t.preventDefault(),this.isValid(null===(i=this.link)||void 0===i?void 0:i.href)&&this.handleSave(t))},this.handleCancel=t=>{t instanceof KeyboardEvent&&t.key!==n||(t.stopPropagation(),t.preventDefault(),this.cancel.emit())},this.handleSave=t=>{t.stopPropagation(),this.save.emit()},this.handleLinkInputAction=t=>{window.open(this.link.href,"_blank"),t.stopPropagation()},this.handleLinkTitleChange=t=>{var i;this.emitLinkChange(t.detail,null===(i=this.link)||void 0===i?void 0:i.href)},this.handleLinkValueChange=t=>{var i;this.emitLinkChange(null===(i=this.link)||void 0===i?void 0:i.text,t.detail)},this.emitLinkChange=(t,i)=>{this.linkChange.emit({text:t,href:i})}}connectedCallback(){this.setupGlobalHandlers()}disconnectedCallback(){this.teardownGlobalHandlers()}setupGlobalHandlers(){this.isOpen&&document.addEventListener("keyup",this.handleCancel)}teardownGlobalHandlers(){document.removeEventListener("keyup",this.handleCancel)}componentDidLoad(){this.focusOnTextInput()}focusOnTextInput(){if(this.textInput){const t=this.textInput.shadowRoot.querySelector("input");t&&requestAnimationFrame((()=>{t.focus()}))}}render(){var t,i;const s=this.isValid(this.link.href);return[e("limel-input-field",{key:"0416f2d94ec54c569455938babfebee34bc1b17c",label:this.getTranslation("editor-link-menu.text"),value:(null===(t=this.link)||void 0===t?void 0:t.text)||"",leadingIcon:"text_cursor",onChange:this.handleLinkTitleChange,onKeyDown:this.handleKeyDown,ref:t=>this.textInput=t}),e("limel-input-field",{key:"6dfb8808eee203e9aa9e87e3bf3720aae217c5e0",label:this.getTranslation("editor-link-menu.link"),value:(null===(i=this.link)||void 0===i?void 0:i.href)||"",type:"text",leadingIcon:"-lime-text-link",trailingIcon:"external_link",invalid:!s,onChange:this.handleLinkValueChange,onAction:this.handleLinkInputAction,onKeyDown:this.handleKeyDown}),e("div",{key:"ee392b700a4293eb2b2121d08bfef852f8b4404e",class:"actions"},e("limel-button",{key:"be9f4711edf45a69f8087341e61fc4183c59ba2d",label:this.getTranslation("cancel"),onClick:this.handleCancel}),e("limel-button",{key:"b958cae7915cc42133e5143589d4f454f8bb2ffa",primary:!0,label:this.getTranslation("save"),disabled:!s,onClick:this.handleSave,ref:t=>this.saveButton=t,slot:"button"}))]}};l.style=":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}}";export{l as limel_text_editor_link_menu}
|