@limetech/lime-elements 39.33.2 → 39.34.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 +7 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +21 -3
- package/dist/cjs/limel-text-editor.cjs.entry.js +15 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +42 -3
- package/dist/collection/components/text-editor/text-editor.js +37 -3
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +21 -3
- package/dist/esm/limel-text-editor.entry.js +15 -2
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-4a9b5914.entry.js +1 -0
- package/dist/lime-elements/{p-444e571b.entry.js → p-5b9d84b4.entry.js} +1 -1
- package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +14 -0
- package/dist/types/components/text-editor/text-editor.d.ts +11 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-8203eea8.entry.js +0 -1
|
@@ -65,6 +65,15 @@ export declare class ProsemirrorAdapter {
|
|
|
65
65
|
private contentConverter;
|
|
66
66
|
private actionBarElement;
|
|
67
67
|
private lastEmittedValue;
|
|
68
|
+
/**
|
|
69
|
+
* The value most recently delivered to the consumer via the `change`
|
|
70
|
+
* event. Unlike `lastEmittedValue`, which is updated already when a
|
|
71
|
+
* change is queued for the debounced emit, this is only updated when
|
|
72
|
+
* the event is actually dispatched. It is used to tell a consumer's
|
|
73
|
+
* echo of an emitted value apart from an intentional external update.
|
|
74
|
+
* `undefined` until the first `change` event is dispatched.
|
|
75
|
+
*/
|
|
76
|
+
private lastDispatchedValue;
|
|
68
77
|
private changeWaiting;
|
|
69
78
|
private transactionFired;
|
|
70
79
|
private lastClickedPos;
|
|
@@ -99,6 +108,11 @@ export declare class ProsemirrorAdapter {
|
|
|
99
108
|
*/
|
|
100
109
|
private metadataChange;
|
|
101
110
|
constructor();
|
|
111
|
+
/**
|
|
112
|
+
* Emits any pending debounced `change` event immediately.
|
|
113
|
+
* Does nothing if no change is pending.
|
|
114
|
+
*/
|
|
115
|
+
flushPendingChanges(): Promise<void>;
|
|
102
116
|
protected watchValue(newValue: string): void;
|
|
103
117
|
componentWillLoad(): void;
|
|
104
118
|
componentDidLoad(): void;
|
|
@@ -179,7 +179,18 @@ export declare class TextEditor implements FormComponent<string> {
|
|
|
179
179
|
triggerChange: EventEmitter<TriggerEventDetail>;
|
|
180
180
|
private readonly helperTextId;
|
|
181
181
|
private readonly editorId;
|
|
182
|
+
private adapterElement?;
|
|
182
183
|
constructor();
|
|
184
|
+
/**
|
|
185
|
+
* Emits any pending `change` event immediately, instead of waiting
|
|
186
|
+
* for the debounce delay to elapse. Does nothing if no change is
|
|
187
|
+
* pending.
|
|
188
|
+
*
|
|
189
|
+
* Useful when the current content is needed right away, for example
|
|
190
|
+
* when the user activates a "send" or "save" action right after
|
|
191
|
+
* typing.
|
|
192
|
+
*/
|
|
193
|
+
flushPendingChanges(): Promise<void>;
|
|
183
194
|
render(): any;
|
|
184
195
|
private renderEditor;
|
|
185
196
|
private renderPlaceholder;
|
|
@@ -3169,6 +3169,10 @@ export namespace Components {
|
|
|
3169
3169
|
* @default false
|
|
3170
3170
|
*/
|
|
3171
3171
|
"disabled"?: boolean;
|
|
3172
|
+
/**
|
|
3173
|
+
* Emits any pending debounced `change` event immediately. Does nothing if no change is pending.
|
|
3174
|
+
*/
|
|
3175
|
+
"flushPendingChanges": () => Promise<void>;
|
|
3172
3176
|
/**
|
|
3173
3177
|
* Defines the language for translations.
|
|
3174
3178
|
*/
|
|
@@ -3813,6 +3817,10 @@ export namespace Components {
|
|
|
3813
3817
|
* @default false
|
|
3814
3818
|
*/
|
|
3815
3819
|
"disabled"?: boolean;
|
|
3820
|
+
/**
|
|
3821
|
+
* Emits any pending `change` event immediately, instead of waiting for the debounce delay to elapse. Does nothing if no change is pending. Useful when the current content is needed right away, for example when the user activates a "send" or "save" action right after typing.
|
|
3822
|
+
*/
|
|
3823
|
+
"flushPendingChanges": () => Promise<void>;
|
|
3816
3824
|
/**
|
|
3817
3825
|
* Optional helper text to display below the input field when it has focus
|
|
3818
3826
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r}from"./p-DBTJNfo7.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()}render(){return i(r,{key:"31661aea27e0dea61827560c031587bd208f8bed"},i("limel-notched-outline",{key:"81571a171ba0b629117d8b153e091e6d34c98c70",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",{slot:"content","aria-placeholder":this.placeholder,contentType:this.contentType,onChange:this.handleChange,onImagePasted:this.handleImagePasted,onImageRemoved:this.handleImageRemoved,onMetadataChange:this.handleMetadataChange,customElements:this.customElements,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}
|