kempo-ui 0.4.16 → 0.4.17
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 +8 -0
- package/dist/components/MarkdownEditor.js +3 -0
- package/docs/components/markdown-editor.html +24 -4
- package/docs/src/components/MarkdownEditor.js +3 -0
- package/docs-src/components/markdown-editor.page.html +24 -4
- package/package.json +1 -1
- package/src/components/MarkdownEditor.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.17] - 2026-05-03
|
|
10
|
+
### Added
|
|
11
|
+
- **Markdown Editor component**: CSS size variables `--min-height` and `--max-height`
|
|
12
|
+
- New `--min-height` CSS variable to prevent editor from shrinking below a minimum size
|
|
13
|
+
- New `--max-height` CSS variable to add vertical scrollbar when content exceeds max height
|
|
14
|
+
- Works alongside existing `--height` variable for flexible sizing
|
|
15
|
+
- Documentation updated with sizing example showing all three variables used together
|
|
16
|
+
|
|
9
17
|
## [0.4.16] - 2026-05-03
|
|
10
18
|
### Added
|
|
11
19
|
- **Markdown Editor component**: Debounced change event during input
|
|
@@ -62,6 +62,8 @@ import{html as t,css as e,nothing as i}from"../lit-all.min.js";import s from"./S
|
|
|
62
62
|
k-resize {
|
|
63
63
|
width: 100%;
|
|
64
64
|
height: var(--height, 14rem);
|
|
65
|
+
min-height: var(--min-height);
|
|
66
|
+
max-height: var(--max-height);
|
|
65
67
|
background: var(--c_bg);
|
|
66
68
|
}
|
|
67
69
|
.frame {
|
|
@@ -100,6 +102,7 @@ import{html as t,css as e,nothing as i}from"../lit-all.min.js";import s from"./S
|
|
|
100
102
|
overflow-y: auto;
|
|
101
103
|
scrollbar-width: thin;
|
|
102
104
|
resize: none;
|
|
105
|
+
max-height: none !important;
|
|
103
106
|
}
|
|
104
107
|
.preview-empty {
|
|
105
108
|
color: var(--tc_muted);
|
|
@@ -502,6 +502,7 @@
|
|
|
502
502
|
<a href="#disabled">Disabled / Read-only</a><br />
|
|
503
503
|
<a href="#tagFiltering">Tag Filtering</a><br />
|
|
504
504
|
<a href="#customControls">Custom Controls</a><br />
|
|
505
|
+
<a href="#sizingExample">Sizing Example</a><br />
|
|
505
506
|
|
|
506
507
|
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
507
508
|
<a href="#constructor">Constructor</a><br />
|
|
@@ -768,6 +769,25 @@
|
|
|
768
769
|
customElements.<span class="hljs-title function_">define</span>(<span class="hljs-string">'k-md-hr'</span>, <span class="hljs-title class_">MarkdownHr</span>);</code></pre>
|
|
769
770
|
</k-card>
|
|
770
771
|
|
|
772
|
+
<h3 id="sizingExample"><a href="#sizingExample" class="no-link">Sizing Example</a></h3>
|
|
773
|
+
<p>Use the three sizing CSS variables together to control the editor dimensions. Set <code>--height</code> for the default size, <code>--min-height</code> to prevent it from shrinking, and <code>--max-height</code> to add a vertical scrollbar when content grows.</p>
|
|
774
|
+
<div class="row -mx">
|
|
775
|
+
<div class="col m-span-12 px">
|
|
776
|
+
<k-card label="CSS">
|
|
777
|
+
<pre><code class="hljs css"><span class="hljs-selector-tag">k-markdown-editor</span> {
|
|
778
|
+
<span class="hljs-attr">--height</span>: <span class="hljs-number">20rem</span>;
|
|
779
|
+
<span class="hljs-attr">--min-height</span>: <span class="hljs-number">10rem</span>;
|
|
780
|
+
<span class="hljs-attr">--max-height</span>: <span class="hljs-number">40rem</span>;
|
|
781
|
+
}</code></pre>
|
|
782
|
+
</k-card>
|
|
783
|
+
</div>
|
|
784
|
+
<div class="col m-span-12 px">
|
|
785
|
+
<k-card label="Output">
|
|
786
|
+
<k-markdown-editor placeholder="Type to expand, but max out at 40rem..." style="--height: 20rem; --min-height: 10rem; --max-height: 40rem;"></k-markdown-editor>
|
|
787
|
+
</k-card>
|
|
788
|
+
</div>
|
|
789
|
+
</div>
|
|
790
|
+
|
|
771
791
|
<h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
772
792
|
|
|
773
793
|
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
@@ -864,10 +884,10 @@ customElements.<span class="hljs-title function_">define</span>(<span class="hlj
|
|
|
864
884
|
<table class="b">
|
|
865
885
|
<thead><tr><th>Variable</th><th>Default</th><th>Description</th></tr></thead>
|
|
866
886
|
<tbody>
|
|
867
|
-
<tr><td><code>--
|
|
868
|
-
<tr><td><code>--
|
|
887
|
+
<tr><td><code>--height</code></td><td><code>14rem</code></td><td>Height of the editor container</td></tr>
|
|
888
|
+
<tr><td><code>--min-height</code></td><td>none</td><td>Minimum height of the editor</td></tr>
|
|
889
|
+
<tr><td><code>--max-height</code></td><td>none</td><td>Maximum height before the editor scrolls internally</td></tr>
|
|
869
890
|
<tr><td><code>--padding</code></td><td><code>0.5rem 0.75rem</code></td><td>Padding inside the textarea / preview</td></tr>
|
|
870
|
-
<tr><td><code>--border</code></td><td><code>1px solid var(--c_border)</code></td><td>Border around the editor</td></tr>
|
|
871
891
|
</tbody>
|
|
872
892
|
</table>
|
|
873
893
|
<p class="mt">The component also uses kempo-css's global <code>--c_border</code>, <code>--c_bg</code>, <code>--tc</code>, <code>--tc_muted</code>, <code>--radius</code>, <code>--animation_ms</code>, and <code>--focus_shadow</code>; override those globally for site-wide tuning.</p>
|
|
@@ -877,7 +897,7 @@ customElements.<span class="hljs-title function_">define</span>(<span class="hlj
|
|
|
877
897
|
<p>Fires on every keystroke (or programmatic change via the selection-manipulation API). <code>detail.value</code> is the current markdown.</p>
|
|
878
898
|
|
|
879
899
|
<h5><code>change</code></h5>
|
|
880
|
-
<p>Fires
|
|
900
|
+
<p>Fires with a 300ms debounce whenever text is typed, and also on blur. <code>detail.value</code> is the current markdown. Useful for enabling/disabling a "Save" button during long typing sessions without waiting for blur.</p>
|
|
881
901
|
|
|
882
902
|
<h5><code>mode-change</code></h5>
|
|
883
903
|
<p>Fires when the user switches between Write and Preview tabs. <code>detail.mode</code> is the new mode.</p>
|
|
@@ -62,6 +62,8 @@ import{html as t,css as e,nothing as i}from"../lit-all.min.js";import s from"./S
|
|
|
62
62
|
k-resize {
|
|
63
63
|
width: 100%;
|
|
64
64
|
height: var(--height, 14rem);
|
|
65
|
+
min-height: var(--min-height);
|
|
66
|
+
max-height: var(--max-height);
|
|
65
67
|
background: var(--c_bg);
|
|
66
68
|
}
|
|
67
69
|
.frame {
|
|
@@ -100,6 +102,7 @@ import{html as t,css as e,nothing as i}from"../lit-all.min.js";import s from"./S
|
|
|
100
102
|
overflow-y: auto;
|
|
101
103
|
scrollbar-width: thin;
|
|
102
104
|
resize: none;
|
|
105
|
+
max-height: none !important;
|
|
103
106
|
}
|
|
104
107
|
.preview-empty {
|
|
105
108
|
color: var(--tc_muted);
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<a href="#disabled">Disabled / Read-only</a><br />
|
|
15
15
|
<a href="#tagFiltering">Tag Filtering</a><br />
|
|
16
16
|
<a href="#customControls">Custom Controls</a><br />
|
|
17
|
+
<a href="#sizingExample">Sizing Example</a><br />
|
|
17
18
|
|
|
18
19
|
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
19
20
|
<a href="#constructor">Constructor</a><br />
|
|
@@ -280,6 +281,25 @@
|
|
|
280
281
|
customElements.<span class="hljs-title function_">define</span>(<span class="hljs-string">'k-md-hr'</span>, <span class="hljs-title class_">MarkdownHr</span>);</code></pre>
|
|
281
282
|
</k-card>
|
|
282
283
|
|
|
284
|
+
<h3 id="sizingExample"><a href="#sizingExample" class="no-link">Sizing Example</a></h3>
|
|
285
|
+
<p>Use the three sizing CSS variables together to control the editor dimensions. Set <code>--height</code> for the default size, <code>--min-height</code> to prevent it from shrinking, and <code>--max-height</code> to add a vertical scrollbar when content grows.</p>
|
|
286
|
+
<div class="row -mx">
|
|
287
|
+
<div class="col m-span-12 px">
|
|
288
|
+
<k-card label="CSS">
|
|
289
|
+
<pre><code class="hljs css"><span class="hljs-selector-tag">k-markdown-editor</span> {
|
|
290
|
+
<span class="hljs-attr">--height</span>: <span class="hljs-number">20rem</span>;
|
|
291
|
+
<span class="hljs-attr">--min-height</span>: <span class="hljs-number">10rem</span>;
|
|
292
|
+
<span class="hljs-attr">--max-height</span>: <span class="hljs-number">40rem</span>;
|
|
293
|
+
}</code></pre>
|
|
294
|
+
</k-card>
|
|
295
|
+
</div>
|
|
296
|
+
<div class="col m-span-12 px">
|
|
297
|
+
<k-card label="Output">
|
|
298
|
+
<k-markdown-editor placeholder="Type to expand, but max out at 40rem..." style="--height: 20rem; --min-height: 10rem; --max-height: 40rem;"></k-markdown-editor>
|
|
299
|
+
</k-card>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
283
303
|
<h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
284
304
|
|
|
285
305
|
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
@@ -376,10 +396,10 @@ customElements.<span class="hljs-title function_">define</span>(<span class="hlj
|
|
|
376
396
|
<table class="b">
|
|
377
397
|
<thead><tr><th>Variable</th><th>Default</th><th>Description</th></tr></thead>
|
|
378
398
|
<tbody>
|
|
379
|
-
<tr><td><code>--
|
|
380
|
-
<tr><td><code>--
|
|
399
|
+
<tr><td><code>--height</code></td><td><code>14rem</code></td><td>Height of the editor container</td></tr>
|
|
400
|
+
<tr><td><code>--min-height</code></td><td>none</td><td>Minimum height of the editor</td></tr>
|
|
401
|
+
<tr><td><code>--max-height</code></td><td>none</td><td>Maximum height before the editor scrolls internally</td></tr>
|
|
381
402
|
<tr><td><code>--padding</code></td><td><code>0.5rem 0.75rem</code></td><td>Padding inside the textarea / preview</td></tr>
|
|
382
|
-
<tr><td><code>--border</code></td><td><code>1px solid var(--c_border)</code></td><td>Border around the editor</td></tr>
|
|
383
403
|
</tbody>
|
|
384
404
|
</table>
|
|
385
405
|
<p class="mt">The component also uses kempo-css's global <code>--c_border</code>, <code>--c_bg</code>, <code>--tc</code>, <code>--tc_muted</code>, <code>--radius</code>, <code>--animation_ms</code>, and <code>--focus_shadow</code>; override those globally for site-wide tuning.</p>
|
|
@@ -389,7 +409,7 @@ customElements.<span class="hljs-title function_">define</span>(<span class="hlj
|
|
|
389
409
|
<p>Fires on every keystroke (or programmatic change via the selection-manipulation API). <code>detail.value</code> is the current markdown.</p>
|
|
390
410
|
|
|
391
411
|
<h5><code>change</code></h5>
|
|
392
|
-
<p>Fires
|
|
412
|
+
<p>Fires with a 300ms debounce whenever text is typed, and also on blur. <code>detail.value</code> is the current markdown. Useful for enabling/disabling a "Save" button during long typing sessions without waiting for blur.</p>
|
|
393
413
|
|
|
394
414
|
<h5><code>mode-change</code></h5>
|
|
395
415
|
<p>Fires when the user switches between Write and Preview tabs. <code>detail.mode</code> is the new mode.</p>
|
package/package.json
CHANGED
|
@@ -470,6 +470,8 @@ export default class MarkdownEditor extends ShadowComponent {
|
|
|
470
470
|
k-resize {
|
|
471
471
|
width: 100%;
|
|
472
472
|
height: var(--height, 14rem);
|
|
473
|
+
min-height: var(--min-height);
|
|
474
|
+
max-height: var(--max-height);
|
|
473
475
|
background: var(--c_bg);
|
|
474
476
|
}
|
|
475
477
|
.frame {
|
|
@@ -508,6 +510,7 @@ export default class MarkdownEditor extends ShadowComponent {
|
|
|
508
510
|
overflow-y: auto;
|
|
509
511
|
scrollbar-width: thin;
|
|
510
512
|
resize: none;
|
|
513
|
+
max-height: none !important;
|
|
511
514
|
}
|
|
512
515
|
.preview-empty {
|
|
513
516
|
color: var(--tc_muted);
|