@duskmoon-dev/el-markdown-input 1.7.6 → 1.8.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/dist/cjs/index.js +26 -3
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/register.js +26 -3
- package/dist/cjs/register.js.map +4 -4
- package/dist/esm/index.js +26 -3
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/register.js +26 -3
- package/dist/esm/register.js.map +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/css.d.ts.map +1 -1
- package/dist/types/element.d.ts +7 -0
- package/dist/types/element.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -313,7 +313,17 @@ var elementStyles = import_el_base.css`
|
|
|
313
313
|
color: var(--md-text);
|
|
314
314
|
overflow: hidden;
|
|
315
315
|
height: inherit;
|
|
316
|
-
min-height: 12rem;
|
|
316
|
+
min-height: var(--md-editor-min-height, 12rem);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
:host([auto-grow]) .editor {
|
|
320
|
+
height: auto;
|
|
321
|
+
max-height: var(--md-editor-max-height, 24rem);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:host([auto-grow]) .write-area {
|
|
325
|
+
flex: 0 1 auto;
|
|
326
|
+
grid-template-columns: minmax(0, 1fr);
|
|
317
327
|
}
|
|
318
328
|
|
|
319
329
|
.editor:focus-within {
|
|
@@ -406,6 +416,11 @@ var elementStyles = import_el_base.css`
|
|
|
406
416
|
color: var(--md-text);
|
|
407
417
|
}
|
|
408
418
|
|
|
419
|
+
:host([auto-grow]) .render-layer,
|
|
420
|
+
:host([auto-grow]) textarea {
|
|
421
|
+
overflow-wrap: anywhere;
|
|
422
|
+
}
|
|
423
|
+
|
|
409
424
|
/*
|
|
410
425
|
* Textarea: grid overlay on top of the render layer. Transparent text
|
|
411
426
|
* lets highlighted content show through; caret-color keeps cursor visible.
|
|
@@ -1186,7 +1201,8 @@ class ElDmMarkdownInput extends import_el_base2.BaseElement {
|
|
|
1186
1201
|
katexCssUrl: { type: String, reflect: true, attribute: "katex-css-url" },
|
|
1187
1202
|
mermaidSrc: { type: String, reflect: true, attribute: "mermaid-src" },
|
|
1188
1203
|
resize: { type: String, reflect: true, default: "none" },
|
|
1189
|
-
noPreview: { type: Boolean, reflect: true, attribute: "no-preview" }
|
|
1204
|
+
noPreview: { type: Boolean, reflect: true, attribute: "no-preview" },
|
|
1205
|
+
autoGrow: { type: Boolean, reflect: true, attribute: "auto-grow" }
|
|
1190
1206
|
};
|
|
1191
1207
|
static get observedAttributes() {
|
|
1192
1208
|
return [...super.observedAttributes, "id"];
|
|
@@ -1565,6 +1581,13 @@ class ElDmMarkdownInput extends import_el_base2.BaseElement {
|
|
|
1565
1581
|
#scheduleHighlight() {
|
|
1566
1582
|
if (this.#highlightTimer !== null)
|
|
1567
1583
|
clearTimeout(this.#highlightTimer);
|
|
1584
|
+
if (this.autoGrow) {
|
|
1585
|
+
this.#highlightTimer = null;
|
|
1586
|
+
if (this.#renderLayer && this.#textarea) {
|
|
1587
|
+
this.#renderLayer.innerHTML = highlightMarkdown(this.#textarea.value);
|
|
1588
|
+
}
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1568
1591
|
this.#highlightTimer = setTimeout(() => {
|
|
1569
1592
|
this.#highlightTimer = null;
|
|
1570
1593
|
if (this.#renderLayer && this.#textarea) {
|
|
@@ -2032,5 +2055,5 @@ var MarkdownInputHook = {
|
|
|
2032
2055
|
}
|
|
2033
2056
|
};
|
|
2034
2057
|
|
|
2035
|
-
//# debugId=
|
|
2058
|
+
//# debugId=EDF0CD63436FDC2964756E2164756E21
|
|
2036
2059
|
//# sourceMappingURL=index.js.map
|