@limetech/lime-elements 39.35.0 → 39.36.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.
@@ -113,6 +113,22 @@ export declare class ProsemirrorAdapter {
113
113
  * Does nothing if no change is pending.
114
114
  */
115
115
  flushPendingChanges(): Promise<void>;
116
+ /**
117
+ * Clear the editor's content imperatively.
118
+ *
119
+ * Assigning an empty `value` prop only clears the editor when the value
120
+ * changes. The editor debounces its `change` event, so a consumer's
121
+ * bound value can lag the live document; assigning `''` when the prop was
122
+ * already `''` is skipped by change detection and would leave the typed
123
+ * content untouched — for example, clearing the editor right after a
124
+ * send. Use this to empty the editor regardless of the prop's change
125
+ * detection.
126
+ *
127
+ * Does not emit a `change` event. Consumers that mirror the editor
128
+ * content on `change` (drafts, validation, dirty state) should reset
129
+ * their own copy when calling this.
130
+ */
131
+ clear(): Promise<void>;
116
132
  protected watchValue(newValue: string): void;
117
133
  componentWillLoad(): void;
118
134
  componentDidLoad(): void;
@@ -191,6 +191,23 @@ export declare class TextEditor implements FormComponent<string> {
191
191
  * typing.
192
192
  */
193
193
  flushPendingChanges(): Promise<void>;
194
+ /**
195
+ * Clear the editor's content imperatively, bypassing the `value` prop's
196
+ * change detection.
197
+ *
198
+ * Assigning an empty `value` prop only clears the editor when the value
199
+ * changes. Because the editor debounces its `change` event, a consumer's
200
+ * bound value can lag the live content, so assigning `''` when the prop
201
+ * was already `''` is skipped and the content is left untouched — for
202
+ * example, clearing the editor immediately after a send. Use this to
203
+ * empty the editor regardless of the prop's change detection.
204
+ *
205
+ * Does not emit a `change` event. If you mirror the editor content on
206
+ * `change` (drafts, validation, dirty state), reset your own copy when
207
+ * calling this. In readonly mode no editor is rendered, so this is a
208
+ * silent no-op.
209
+ */
210
+ clear(): Promise<void>;
194
211
  render(): any;
195
212
  private renderEditor;
196
213
  private renderPlaceholder;
@@ -3155,6 +3155,10 @@ export namespace Components {
3155
3155
  * @private
3156
3156
  */
3157
3157
  interface LimelProsemirrorAdapter {
3158
+ /**
3159
+ * Clear the editor's content imperatively. Assigning an empty `value` prop only clears the editor when the value changes. The editor debounces its `change` event, so a consumer's bound value can lag the live document; assigning `''` when the prop was already `''` is skipped by change detection and would leave the typed content untouched — for example, clearing the editor right after a send. Use this to empty the editor regardless of the prop's change detection. Does not emit a `change` event. Consumers that mirror the editor content on `change` (drafts, validation, dirty state) should reset their own copy when calling this.
3160
+ */
3161
+ "clear": () => Promise<void>;
3158
3162
  /**
3159
3163
  * The type of content that the editor should handle and emit, defaults to `markdown` Assumed to be set only once, so not reactive to changes
3160
3164
  * @default 'markdown'
@@ -3803,6 +3807,10 @@ export namespace Components {
3803
3807
  * @default true
3804
3808
  */
3805
3809
  "allowResize": boolean;
3810
+ /**
3811
+ * Clear the editor's content imperatively, bypassing the `value` prop's change detection. Assigning an empty `value` prop only clears the editor when the value changes. Because the editor debounces its `change` event, a consumer's bound value can lag the live content, so assigning `''` when the prop was already `''` is skipped and the content is left untouched — for example, clearing the editor immediately after a send. Use this to empty the editor regardless of the prop's change detection. Does not emit a `change` event. If you mirror the editor content on `change` (drafts, validation, dirty state), reset your own copy when calling this. In readonly mode no editor is rendered, so this is a silent no-op.
3812
+ */
3813
+ "clear": () => Promise<void>;
3806
3814
  /**
3807
3815
  * The type of content that the editor should handle and emit, defaults to `markdown` Assumed to be set only once, so not reactive to changes
3808
3816
  * @default 'markdown'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.35.0",
3
+ "version": "39.36.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -1 +0,0 @@
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())}render(){return i(r,{key:"5d73675909084c010819fb357d2b0b78d5ae3cfb"},i("limel-notched-outline",{key:"3fe07fb082afca0ba93f645f0f9a4a703ac62311",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,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}