@limetech/lime-elements 40.12.1 → 40.12.2

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.
@@ -62,6 +62,31 @@ export declare class ProsemirrorAdapter {
62
62
  * Specifies the visual appearance of the editor.
63
63
  */
64
64
  ui: EditorUiType;
65
+ /**
66
+ * The name of the editable area, read by assistive technology.
67
+ * Ids cannot be referenced across a shadow root, so a label that is
68
+ * rendered outside of the adapter cannot name the editable area.
69
+ */
70
+ accessibleLabel?: string;
71
+ /**
72
+ * The description of the editable area, read by assistive technology
73
+ * after its name.
74
+ */
75
+ accessibleDescription?: string;
76
+ /**
77
+ * A hint about what to type, which is exposed as the placeholder of the
78
+ * editable area. It is not shown by the adapter.
79
+ */
80
+ accessiblePlaceholder?: string;
81
+ /**
82
+ * Set to `true` to indicate that the editable area is required.
83
+ */
84
+ required?: boolean;
85
+ /**
86
+ * Set to `true` to indicate that the current value of the editable area
87
+ * is invalid.
88
+ */
89
+ invalid?: boolean;
65
90
  private host;
66
91
  private portalId;
67
92
  private view;
@@ -90,6 +115,7 @@ export declare class ProsemirrorAdapter {
90
115
  private transactionFired;
91
116
  private lastClickedPos;
92
117
  private focusRestoreTimeout;
118
+ private hadFocusWhenDisabled;
93
119
  private metadata;
94
120
  /**
95
121
  * Used to stop change event emitting as result of getting updated value from consumer
@@ -142,6 +168,8 @@ export declare class ProsemirrorAdapter {
142
168
  * their own copy when calling this.
143
169
  */
144
170
  clear(): Promise<void>;
171
+ protected watchEditableAttributes(): void;
172
+ protected watchDisabled(disabled: boolean): void;
145
173
  protected watchValue(newValue: string): void;
146
174
  componentWillLoad(): void;
147
175
  componentDidLoad(): void;
@@ -149,12 +177,17 @@ export declare class ProsemirrorAdapter {
149
177
  disconnectedCallback(): void;
150
178
  render(): any;
151
179
  renderToolbar(): any;
180
+ private getToolbarItems;
152
181
  renderLinkMenu(): any;
153
182
  private validateInlineImages;
154
183
  private setupContentConverter;
155
184
  private getActionBarItems;
156
185
  private getTranslatedItem;
157
186
  private initializeTextEditor;
187
+ private readonly isEditable;
188
+ private updateEditableProps;
189
+ private restoreFocus;
190
+ private getEditableAttributes;
158
191
  private initializeSchema;
159
192
  private parseInitialContent;
160
193
  private createEditorState;
@@ -165,6 +198,7 @@ export declare class ProsemirrorAdapter {
165
198
  private removeImagesFromCache;
166
199
  private handleActionBarItem;
167
200
  private handleCancelLinkMenu;
201
+ private closeLinkMenu;
168
202
  private handleSaveLinkMenu;
169
203
  private handleLinkChange;
170
204
  private handleFocus;
@@ -26,6 +26,7 @@ import { EditorUiType } from './types';
26
26
  * @exampleComponent limel-example-text-editor-ui
27
27
  * @exampleComponent limel-example-text-editor-custom-element
28
28
  * @exampleComponent limel-example-text-editor-triggers
29
+ * @exampleComponent limel-example-text-editor-accessibility
29
30
  * @exampleComponent limel-example-text-editor-composite
30
31
  * @beta
31
32
  */
@@ -191,10 +192,7 @@ export declare class TextEditor implements FormComponent<string> {
191
192
  * @alpha
192
193
  */
193
194
  triggerChange: EventEmitter<TriggerEventDetail>;
194
- private readonly helperTextId;
195
- private readonly editorId;
196
195
  private adapterElement?;
197
- constructor();
198
196
  /**
199
197
  * Emits any pending `change` event immediately, instead of waiting
200
198
  * for the debounce delay to elapse. Does nothing if no change is
@@ -3308,6 +3308,18 @@ export namespace Components {
3308
3308
  * @private
3309
3309
  */
3310
3310
  interface LimelProsemirrorAdapter {
3311
+ /**
3312
+ * The description of the editable area, read by assistive technology after its name.
3313
+ */
3314
+ "accessibleDescription"?: string;
3315
+ /**
3316
+ * The name of the editable area, read by assistive technology. Ids cannot be referenced across a shadow root, so a label that is rendered outside of the adapter cannot name the editable area.
3317
+ */
3318
+ "accessibleLabel"?: string;
3319
+ /**
3320
+ * A hint about what to type, which is exposed as the placeholder of the editable area. It is not shown by the adapter.
3321
+ */
3322
+ "accessiblePlaceholder"?: string;
3311
3323
  /**
3312
3324
  * 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.
3313
3325
  */
@@ -3339,10 +3351,20 @@ export namespace Components {
3339
3351
  * @alpha
3340
3352
  */
3341
3353
  "inlineImages"?: InlineImages;
3354
+ /**
3355
+ * Set to `true` to indicate that the current value of the editable area is invalid.
3356
+ * @default false
3357
+ */
3358
+ "invalid"?: boolean;
3342
3359
  /**
3343
3360
  * Defines the language for translations.
3344
3361
  */
3345
3362
  "language": Languages;
3363
+ /**
3364
+ * Set to `true` to indicate that the editable area is required.
3365
+ * @default false
3366
+ */
3367
+ "required"?: boolean;
3346
3368
  /**
3347
3369
  * set to private to avoid usage while under development
3348
3370
  * @private
@@ -4121,6 +4143,7 @@ export namespace Components {
4121
4143
  * @exampleComponent limel-example-text-editor-ui
4122
4144
  * @exampleComponent limel-example-text-editor-custom-element
4123
4145
  * @exampleComponent limel-example-text-editor-triggers
4146
+ * @exampleComponent limel-example-text-editor-accessibility
4124
4147
  * @exampleComponent limel-example-text-editor-composite
4125
4148
  * @beta
4126
4149
  */
@@ -6956,6 +6979,7 @@ declare global {
6956
6979
  * @exampleComponent limel-example-text-editor-ui
6957
6980
  * @exampleComponent limel-example-text-editor-custom-element
6958
6981
  * @exampleComponent limel-example-text-editor-triggers
6982
+ * @exampleComponent limel-example-text-editor-accessibility
6959
6983
  * @exampleComponent limel-example-text-editor-composite
6960
6984
  * @beta
6961
6985
  */
@@ -10536,6 +10560,18 @@ declare namespace LocalJSX {
10536
10560
  * @private
10537
10561
  */
10538
10562
  interface LimelProsemirrorAdapter {
10563
+ /**
10564
+ * The description of the editable area, read by assistive technology after its name.
10565
+ */
10566
+ "accessibleDescription"?: string;
10567
+ /**
10568
+ * The name of the editable area, read by assistive technology. Ids cannot be referenced across a shadow root, so a label that is rendered outside of the adapter cannot name the editable area.
10569
+ */
10570
+ "accessibleLabel"?: string;
10571
+ /**
10572
+ * A hint about what to type, which is exposed as the placeholder of the editable area. It is not shown by the adapter.
10573
+ */
10574
+ "accessiblePlaceholder"?: string;
10539
10575
  /**
10540
10576
  * 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
10541
10577
  * @default 'markdown'
@@ -10559,6 +10595,11 @@ declare namespace LocalJSX {
10559
10595
  * @alpha
10560
10596
  */
10561
10597
  "inlineImages"?: InlineImages;
10598
+ /**
10599
+ * Set to `true` to indicate that the current value of the editable area is invalid.
10600
+ * @default false
10601
+ */
10602
+ "invalid"?: boolean;
10562
10603
  /**
10563
10604
  * Defines the language for translations.
10564
10605
  */
@@ -10585,6 +10626,11 @@ declare namespace LocalJSX {
10585
10626
  * @alpha
10586
10627
  */
10587
10628
  "onMetadataChange"?: (event: LimelProsemirrorAdapterCustomEvent<EditorMetadata>) => void;
10629
+ /**
10630
+ * Set to `true` to indicate that the editable area is required.
10631
+ * @default false
10632
+ */
10633
+ "required"?: boolean;
10588
10634
  /**
10589
10635
  * set to private to avoid usage while under development
10590
10636
  * @private
@@ -11444,6 +11490,7 @@ declare namespace LocalJSX {
11444
11490
  * @exampleComponent limel-example-text-editor-ui
11445
11491
  * @exampleComponent limel-example-text-editor-custom-element
11446
11492
  * @exampleComponent limel-example-text-editor-triggers
11493
+ * @exampleComponent limel-example-text-editor-accessibility
11447
11494
  * @exampleComponent limel-example-text-editor-composite
11448
11495
  * @beta
11449
11496
  */
@@ -12182,6 +12229,11 @@ declare namespace LocalJSX {
12182
12229
  "language": Languages;
12183
12230
  "disabled": boolean;
12184
12231
  "ui": EditorUiType;
12232
+ "accessibleLabel": string;
12233
+ "accessibleDescription": string;
12234
+ "accessiblePlaceholder": string;
12235
+ "required": boolean;
12236
+ "invalid": boolean;
12185
12237
  }
12186
12238
  interface LimelRadioButtonAttributes {
12187
12239
  "checked": boolean;
@@ -13857,6 +13909,7 @@ declare module "@stencil/core" {
13857
13909
  * @exampleComponent limel-example-text-editor-ui
13858
13910
  * @exampleComponent limel-example-text-editor-custom-element
13859
13911
  * @exampleComponent limel-example-text-editor-triggers
13912
+ * @exampleComponent limel-example-text-editor-accessibility
13860
13913
  * @exampleComponent limel-example-text-editor-composite
13861
13914
  * @beta
13862
13915
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "40.12.1",
3
+ "version": "40.12.2",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -70,7 +70,7 @@
70
70
  "@types/react": "^19.3.0",
71
71
  "@types/react-dom": "^19.3.0",
72
72
  "@types/tabulator-tables": "^6.3.6",
73
- "@vitest/browser-playwright": "^4.1.11",
73
+ "@vitest/browser-playwright": "^4.1.12",
74
74
  "axe-core": "4.14.0",
75
75
  "codemirror": "^5.65.9",
76
76
  "cross-env": "^10.1.0",
@@ -93,7 +93,7 @@
93
93
  "morphdom": "^2.7.8",
94
94
  "number-abbreviate": "^2.0.0",
95
95
  "parse-css-color": "^0.2.1",
96
- "postal-mime": "^4.0.6",
96
+ "postal-mime": "^4.0.7",
97
97
  "prettier": "^3.9.10",
98
98
  "prosemirror-example-setup": "^1.2.3",
99
99
  "prosemirror-markdown": "^1.13.8",
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i,H as r}from"./p-BU9IJqli.js";import{c as o}from"./p-BrjD-ITe.js";const l=class{constructor(r){t(this,r),this.change=e(this,"change",7),this.imagePasted=e(this,"imagePasted",7),this.imageRemoved=e(this,"imageRemoved",7),this.metadataChange=e(this,"metadataChange",7),this.triggerStart=e(this,"triggerStart",7),this.triggerStop=e(this,"triggerStop",7),this.triggerChange=e(this,"triggerChange",7),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:"8a5ca6c89305056819747e51cd808f35036c8666"},i("limel-notched-outline",{key:"eb4bd944033212a2ec88d664aa1096fc3b07a5cf",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,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,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}