You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Refactor GitHub Actions workflows for simpler test and release
processes.
- Introduce new features like JSON language support, collapsible
sections, button bindings, download feature, and improved gutter rail
behavior.
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,23 @@
1
1
# Release Notes
2
2
3
-
## 1.0.8
3
+
## NEXT RELEASE
4
+
5
+
### Features
6
+
7
+
-**JSON language**: New `language="json"` with dedicated syntax highlighting (property keys vs string values, `true`/`false`/`null`, numbers, punctuation). JSONC `//` and `/* */` comments are displayed but stripped from copy/download so the exported content stays valid (RFC 8259).
8
+
-**Collapsible sections**: New `collapsible` attribute on `<textarea>` folds a range of non-interactive lines (GitHub-diff style), with `collapsed` to start folded. The collapsed band shows the hidden line count (`▸ ⋯ N lines`); when expanded, a collapse chevron sits in the gutter/margin of the first and last line. Folding is purely visual — copy/download still export the full content. Keyboard accessible (`role="button"`, Enter/Space).
9
+
-**Button binding type**: New `type="button"` renders a clickable action token that emits a `change` event on every click (`e.detail` = its `value`) with no re-render — ideal for a hub of actions. `value` is the label (a `button<index>` default is synthesized when omitted). Exposes a `trigger()` method.
10
+
-**Download button**: New `show-download` attribute displays a download button (next to copy) that exports the full content as a file. The file name comes from the optional `download="name.ext"` attribute or defaults to `snippet.<ext>` based on the language; MIME type matches the language.
11
+
-**Gutter rail**: A fixed-width left gutter is now reserved whenever the component has line numbers, collapsible sections, or comment toggles — so fold chevrons and comment toggles share a consistent rail. Comment and block-comment toggles moved into the gutter, which **preserves the code indentation** regardless of comment state (toggling a comment no longer shifts the code). Width is customizable via `--code-gutter-width`.
12
+
13
+
### Improvements
14
+
15
+
-**Comment toggles no longer shift code**: line/block comment indicators are rendered in the gutter (out of flow), so commenting/uncommenting keeps the code aligned. Copy/download output is unchanged.
16
+
17
+
### Tests
18
+
19
+
- Added `src/new-features.spec.ts` (13 tests): JSON highlighting, JSONC comment stripping on export, collapsible sections, button type, download, and gutter behavior.
20
+
- Fixed a pre-existing XSS test whose assertion checked `innerHTML` serialization (which legitimately decodes `<` inside attribute values); it now asserts no `<script>` element is injected.
<p>Use <code>language="json"</code> for syntax-highlighted, editable JSON. JSONC <code>//</code> comments are shown but stripped from copy/download so the exported file stays valid. Add <code>show-download</code> (and optionally <code>download="name.json"</code>) for large payloads:</p>
1000
+
1001
+
<divclass="code-header"><span>Written by developer</span></div>
<divid="preview-json" class="preview-card" style="border-color: var(--accent-blue);">theme: dark · 14px · 🔔 on</div>
1041
+
</div>
1042
+
</div>
1043
+
</div>
1044
+
</article>
1045
+
1046
+
<!-- Collapsible Sections -->
1047
+
<articleclass="doc-section">
1048
+
<h3>Collapsible Sections</h3>
1049
+
<p>Add <code>collapsible</code> on a <code><textarea></code> to fold a range of non-interactive lines (GitHub-diff style). Add <code>collapsed</code> to start folded. Folding is purely visual — copy/download still export the full content:</p>
1050
+
1051
+
<divclass="code-header"><span>Written by developer</span></div>
<divid="preview-fold" class="preview-card" style="border-color: var(--accent-purple);">id: api · enabled: true</div>
1092
+
</div>
1093
+
</div>
1094
+
</div>
1095
+
</article>
1096
+
1097
+
<!-- Button Type -->
1098
+
<articleclass="doc-section">
1099
+
<h3>Button Type</h3>
1100
+
<p>A <code>button</code> binding is a clickable action token: it emits a <code>change</code> event on every click (<code>e.detail</code> = its <code>value</code>), with no re-render. Great for a hub of actions:</p>
1101
+
1102
+
<divclass="code-header"><span>Written by developer</span></div>
0 commit comments