@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/register.js
CHANGED
|
@@ -304,7 +304,17 @@ var elementStyles = import_el_base.css`
|
|
|
304
304
|
color: var(--md-text);
|
|
305
305
|
overflow: hidden;
|
|
306
306
|
height: inherit;
|
|
307
|
-
min-height: 12rem;
|
|
307
|
+
min-height: var(--md-editor-min-height, 12rem);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
:host([auto-grow]) .editor {
|
|
311
|
+
height: auto;
|
|
312
|
+
max-height: var(--md-editor-max-height, 24rem);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
:host([auto-grow]) .write-area {
|
|
316
|
+
flex: 0 1 auto;
|
|
317
|
+
grid-template-columns: minmax(0, 1fr);
|
|
308
318
|
}
|
|
309
319
|
|
|
310
320
|
.editor:focus-within {
|
|
@@ -397,6 +407,11 @@ var elementStyles = import_el_base.css`
|
|
|
397
407
|
color: var(--md-text);
|
|
398
408
|
}
|
|
399
409
|
|
|
410
|
+
:host([auto-grow]) .render-layer,
|
|
411
|
+
:host([auto-grow]) textarea {
|
|
412
|
+
overflow-wrap: anywhere;
|
|
413
|
+
}
|
|
414
|
+
|
|
400
415
|
/*
|
|
401
416
|
* Textarea: grid overlay on top of the render layer. Transparent text
|
|
402
417
|
* lets highlighted content show through; caret-color keeps cursor visible.
|
|
@@ -1177,7 +1192,8 @@ class ElDmMarkdownInput extends import_el_base2.BaseElement {
|
|
|
1177
1192
|
katexCssUrl: { type: String, reflect: true, attribute: "katex-css-url" },
|
|
1178
1193
|
mermaidSrc: { type: String, reflect: true, attribute: "mermaid-src" },
|
|
1179
1194
|
resize: { type: String, reflect: true, default: "none" },
|
|
1180
|
-
noPreview: { type: Boolean, reflect: true, attribute: "no-preview" }
|
|
1195
|
+
noPreview: { type: Boolean, reflect: true, attribute: "no-preview" },
|
|
1196
|
+
autoGrow: { type: Boolean, reflect: true, attribute: "auto-grow" }
|
|
1181
1197
|
};
|
|
1182
1198
|
static get observedAttributes() {
|
|
1183
1199
|
return [...super.observedAttributes, "id"];
|
|
@@ -1556,6 +1572,13 @@ class ElDmMarkdownInput extends import_el_base2.BaseElement {
|
|
|
1556
1572
|
#scheduleHighlight() {
|
|
1557
1573
|
if (this.#highlightTimer !== null)
|
|
1558
1574
|
clearTimeout(this.#highlightTimer);
|
|
1575
|
+
if (this.autoGrow) {
|
|
1576
|
+
this.#highlightTimer = null;
|
|
1577
|
+
if (this.#renderLayer && this.#textarea) {
|
|
1578
|
+
this.#renderLayer.innerHTML = highlightMarkdown(this.#textarea.value);
|
|
1579
|
+
}
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1559
1582
|
this.#highlightTimer = setTimeout(() => {
|
|
1560
1583
|
this.#highlightTimer = null;
|
|
1561
1584
|
if (this.#renderLayer && this.#textarea) {
|
|
@@ -2003,5 +2026,5 @@ if (!customElements.get("el-dm-markdown-input")) {
|
|
|
2003
2026
|
customElements.define("el-dm-markdown-input", ElDmMarkdownInput);
|
|
2004
2027
|
}
|
|
2005
2028
|
|
|
2006
|
-
//# debugId=
|
|
2029
|
+
//# debugId=AE86C9C6A49859A464756E2164756E21
|
|
2007
2030
|
//# sourceMappingURL=register.js.map
|