Releases: bitifet/SmarkForm
Version 0.16.0
SmarkForm 0.16.0 ships a secure-by-default posture for mixin types and
JSON-encoded form submission — all new cross-origin and script-execution
capabilities are opt-in, protecting applications that haven't explicitly chosen
to allow them. Makes sortable lists easier to use with dedicated drag handles,
and fixes Shift+Space fold/unfold inside <summary> inputs. The npm tarball
is also trimmed to only include the production bundle files.
Features
- Sortable list drag handles: SmarkForm
labelelements now act as dedicated drag handles for sortable lists, preventing accidental drags when selecting text inside inputs. - Shift+Space inside
<summary>: Correctly toggles collapsible<details>sections when focus is on a<summary>-hosted input, with focus restored after folding. allowExternalMixins(default"block"): Mixin references to external URLs are blocked by default; opt in with"same-origin"or"allow".allowLocalMixinScripts/allowSameOriginMixinScripts/allowCrossOriginMixinScripts(default"block"):<script>elements in mixin templates are blocked by default; opt in with"allow"or silently strip with"noscript".enableJsonEncoding(defaultfalse):enctype="application/json"submission is now disabled by default; setenableJsonEncoding: trueto re-enable.- Security options are root-only: Mixin security options can no longer be overridden via
data-smarkmarkup, closing a privilege-escalation vector.
Other
- New "A Picture is Worth a Thousand Words" comparison page with live SmarkForm, React, and Vue demos.
- New
doctabscomponent for full-document examples in docs. npm filesallowlist:dist/examples/**no longer included in the npm tarball.- Example CSS now served from GitHub CDN (cdn.jsdelivr.net/gh) so it stays up to date without an npm publish.
- New docs chapters: Security Considerations, Error Codes Reference.
- CSS style standardisation across showcase, quick-start, FAQ, and index pages.
- Dev-dependency updates.
Version 0.15.0
SmarkForm 0.15.0 removes the early foldable decorator from form and list component types — an experiment that, after long reflection, didn't align with SmarkForm's philosophy of keeping layout concerns in HTML. In its place, this release delivers first-class support for native <details>/<summary> elements: the same collapsing behaviour, zero extra API surface, and a far richer keyboard experience. New keyboard shortcuts (Shift+Space toggle, Alt+Enter unfold-and-enter, Shift+Enter symmetric backward navigation) make collapsible sections feel like a first-class part of the form flow. This release is a net gain — even in what it removes.
Removed
foldabledecorator: Removed fromformandlistcomponent types. Migrate to native<details>/<summary>— they provide equivalent collapsing behaviour with richer browser/AT support and no library overhead.
Features
- Native
<details>/<summary>collapsible sections: Complete keyboard navigation — auto-open on Enter/addItem, Shift+Space toggle, Alt+Enter unfold-and-enter, Alt+Shift+Enter backward unfold-and-enter. - Auto-open
<details>ancestors onaddItem: When a new list item is added (non-silently), its enclosing<details>elements are automatically expanded so it is immediately visible and focusable.
Bug Fixes
- Space key in
<summary>inputs: Space no longer toggles the parent<details>when focus is inside a<summary>-hosted SmarkForm field. - Multi-level Enter navigation: Enter now correctly skips hidden fields inside closed
<details>elements at any nesting depth. - Shift+Enter backward navigation: Auto-opens closed
<details>elements when navigating backwards, symmetric with forward Enter behaviour.
Pluses
- New collapsible sections showcase example demonstrating native
<details>/<summary>in action. - Updated the home page example to show off the new collapsible improvements.
- Updated user guide with collapsible sections documentation, keyboard reference, and illustrations.
- Fixed Ace editor losing indentation in the playground due to HTML compressor whitespace collapsing.
- Prioritized render scheduler for the docs playground: concurrency-limited, priority-based iframe rendering so visible examples load first.
- Dev-dependency updates: Playwright 1.59.1, Sass 1.99.0, minimatch 10.2.5.
SmarkForm 0.14.2 — Mixin parametization and bug fixes
Mixin parameterization (DOM snippet parameters for mixin types, e.g. data-for / data-id) is the principal new feature; plus important event handling bug fixes, security check ordering, and tighter docs QA via integrated HTML validity checks.
Highlights
- ✨ Mixin parameterization (principal feature): DOM snippet parameters for mixin types (
data-for/data-id) enable safer per-instance DOM wiring and cleaner example patterns. - 🧪 Docs quality gate: HTML validity checks are now integrated into the co-located docs smoke tests.
- 🐛 Event API fix: Preserve the real DOM
preventDefault()inemit()and call it synchronously in thekeydownhandler where needed. - 🔒 Security hardening: Run nested
<script>checks after snippet parameter substitution. - 📖 Docs + showcase fixes: Corrected invalid HTML in showcase examples (incl. an unclosed
<div>inevent_planner_showcase) and aligned textarea CSS.
Details
Features
- Implemented DOM snippet parameters for mixin types (e.g.
data-for/data-id).
Bug fixes
- Preserve native
preventDefault()behavior in DOM-like event API (emit()+ synckeydownpath). - Reordered nested
<script>checks to occur after snippet parameter substitution. - Fixed invalid HTML and minor styling inconsistencies in docs/showcase examples.
Tests / Tooling
- Added HTML validity tests and integrated them into the co-located docs smoke tests (removing the separate static test file).
SmarkForm 0.14.1 — BeforeAction_import event fix
This is a patch release that fixes a bug where BeforeAction_import handlers could not alter the imported data. When a handler modified ev.data, the change was silently discarded because the import action read the original value from the options object instead of the handler-modified one. A sync-back step in emit() now ensures handler modifications are picked up correctly.
Bug Fixes
BeforeAction_importdata modification: Changes made toev.datainside aBeforeAction_importhandler are now correctly applied before the import proceeds.
Other
- Dev-dependency update (
serialize-javascript). - Dev-dependency security fix (
brace-expansion— moderate vulnerability in transitive dep).
SmarkForm 0.14.0 — Mixin Types
SmarkForm 0.14.0 — Mixin Types
SmarkForm 0.14.0 delivers Mixin Types — a first-class way to package reusable behaviour,
styles, and scripts inside <template> elements. Components reference typed mixins via # in
data-smark-type; the engine extracts <style>/<script> siblings and applies them
per-instance, enabling fully self-contained, composable components with no extra JS modules.
✨ Features
- Mixin Types:
<style>and<script>siblings inside<template>are extracted and applied per mixin instance. - DOM-like event API:
on(),onAll(),onLocal();focusenter/focusleaveevents; richer event metadata. - Auto-stop dev server:
npm run devterminates any previous instance automatically.
📦 Other
- Dev-dependency updates (Rollup bump).
- Minor documentation corrections.
Full Changelog: https://github.com/bitifet/SmarkForm/blob/main/CHANGELOG.md
SmarkForm 0.13.2
Release Notes Summary
SmarkForm 0.13.2 fixes a frustrating bug in Chromium-based mobile browsers (Chrome/Brave on Android) where pressing the "Next" key on the virtual keyboard would skip two fields instead of one. The root cause is a Chromium engine bug (IME_ACTION_NEXT) that moves the focus to the next field before firing the keydown event with the wrong target; SmarkForm now detects and suppresses this spurious event using a timestamp-based heuristic. A bug report has been filed with the Chromium project (https://issues.chromium.org/issues/492805133). Chromium mobile (Pixel 5 emulation) and Safari mobile are now part of the automated test suite to catch mobile-specific regressions early.
Features
- Smart value coercion: new documentation section with examples and tests.
- Responsive iframe height (
heightPct) in sampletabs for better editor experience. - List item animations applied to Team Event Planner showcase demo for a more thrilling landing page.
Bug Fixes
- Workaround for Chromium/Brave Android
IME_ACTION_NEXTdouble-field-advance — timestamp-based detection suppresses spurious synthetickeydown. (Upstream Chromium bug: https://issues.chromium.org/issues/492805133)
Other
- Chromium mobile (Pixel 5) and Safari mobile added to Playwright test matrix.
- New
npm test:quickpicks one browser at random and run tests over it. npm teststill runs the full browser matrix that now includes chromium-mobile and safari safari-mobile.- Improved
demoValueround-trip smoke test generator. - Documentation clarifications (editor UI references, animations section rewrite, code-tabs padding fix).
SmarkForm 0.13.1
Release Notes Summary
SmarkForm 0.13.1 is an improvement and polish release on top of 0.13.0. It includes several bug fixes and mobile accessibility improvements to the documentation. As the headline, the documentation examples are now fully editable in the browser — readers can modify the source code of any example, hit Run, and see the result immediately, without leaving the page. As a bonus, the native <form> element is now fully supported: standard enctypes perform a real form submit under the hood (including mailto: URLs), while the non-standard enctype="application/json" provides genuine JSON transport and enables all HTTP methods — such as PUT and PATCH — which are not supported by the HTML standard.
Features
- Editable live documentation examples: every example in the documentation can now be edited directly in the browser. Readers can tweak the HTML, CSS, or JavaScript, click Run, and see the updated result live — without leaving the page. This dramatically lowers the barrier to experimenting with SmarkForm and understanding how it works.
- Native
<form>support: SmarkForm now works with the standard<form>element out of the box, including configurable graceful degradation for nested data to commonly used serialisation patterns. Standard enctypes (application/x-www-form-urlencoded,multipart/form-data) perform a real browser form submit under the hood — fullmailto:support included. The non-standardenctype="application/json"provides genuine JSON transport and unlocks HTTP methods likePUTandPATCHthat the HTML standard does not support. demoValueround-trip smoke tests: co-located documentation examples can now declare ademoValuethat is automatically imported and re-exported to verify round-trip fidelity, keeping documentation accurate as the library evolves.
Bug Fixes
- Fixed
setDefaultpropagation: only the directly targeted field updates its stored default; descendants now always receivesetDefault:falseduring an import. - Fixed nested sub-form data being silently discarded when the
valueconstructor option was provided. - Fixed missing
awaiton async calls across the codebase, resolving potential async timing issues. - Fixed
sampletabsimport button to passsetDefault:false, so Clear correctly restores the original sample data rather than the last-imported value. - Fixed submit button inner-element click tracking and
mailto:JSON encoding edge cases. - Fixed Enter-key propagation to prevent accidental form submissions on text inputs.
Other
- Documentation: responsive sidebar typography, sticky TOC height cap, TOC counters via JS span injection, improved mobile nav font and padding.
- Documentation: FAQ updated with entries for form tag optionality and Enter-key / buttons /
mailto:behaviour. - Dev-dependency:
@rollup/plugin-babelbumped from 6.1.0 to 7.0.0. - Agent/CI instruction updates.
Version 0.13.0
SmarkForm 0.13.0 is a landmark release that delivers a wave of new features, deep developer-
experience improvements, comprehensive documentation, and a polished branding identity — all
while keeping the library at zero runtime dependencies.
New time and datetime-local component types complete the family of native date/time pickers
with the same null-aware, flexible import/export interface the rest of the library provides.
A brand-new reset action lets users restore any form, field, or list to its configured default
value with a single click or API call, and import() now updates the default automatically so
"Load then Reset" just works. UX is sharper too: lists retain keyboard focus when they become
empty, and min_items: 0 can now coexist peacefully with a pre-populated default initial item.
On the documentation front, the site gains an automatic light/dark color scheme, a brand-new
End-User Guide (for people filling in SmarkForm-powered forms, not only developers), a thorough
Branding section with a parametric SVG logo in eight variants, a revised FAQ, improved examples
with pre-filled demo data, and printer-friendly page layouts. A Code of Conduct is now in place,
and the project's landing page highlights SmarkForm's AI-agent-friendly design.
Features
- New
timecomponent type: Null-aware<input type="time">wrapper. AcceptsDateobjects,
epoch timestamps, and ISOHH:mm:ssstrings; exports normalizedHH:mm:ssornull. - New
datetime-localcomponent type: Null-aware<input type="datetime-local">wrapper.
AcceptsDate, epoch, and ISOYYYY-MM-DDTHH:mm:ssstrings; exports the same format ornull. resetaction: All fields, forms, and lists now expose aresettrigger action that
restores the component to its configureddefaultValue(distinct fromclear, which removes
all user values regardless of defaults).- Default value via
valueoption: Any component can declare a default value through its
data-smarkoptions:{"value": "Alice"}or the tag'svalueattribute for
actual native fields. On initialization the form resets to that state,
andreset()restores it at any time. import()updates the default (setDefault: trueby default): After importing data,
reset()restores to the imported state. "Load and Reset naturally work together." Opt out
withsetDefault: falsewhen needed (e.g. preview-without-committing patterns).- Focus retention on empty lists: When the last item is removed from a list, keyboard focus
automatically moves to the nearest "addItem" trigger, keeping the user in the flow without
reaching for the mouse. min_items: 0with default items: Lists can now havemin_items: 0(allowing fully empty
lists) while still rendering one or more items by default via thevalueoption.- Parametric SVG logo (8 variants): Full, compact, monochrome, and light/dark versions of
the SmarkForm logo, all generated from a single Pug template with parameterised colours and
geometry. Read the story behind it:
https://dev.to/bitifet/generating-a-parametric-svg-logo-with-pug-8m0 - Branding section in docs: Logo assets, CDN links, copy-paste badge snippets, placement
and accessibility guidelines, and a user-guide link pattern for SmarkForm-powered apps. - End-User Guide: A dedicated guide at
/resources/user_guidefor people filling in
SmarkForm forms — covering keyboard navigation, hotkey discovery, list management, and
accessibility tips. - Code of Conduct: Contributor Covenant added to the repository.
- Automatic light/dark color scheme for the documentation site: CSS
prefers-color-scheme
media queries plus a JS logo switcher — no configuration, no user action required. - AI-agent-ready: Landing page and features page updated to highlight SmarkForm's declarative,
markup-driven design as a natural fit for AI coding assistants. - Improved error detection and visual reporting: Misconfigured components are replaced in the
DOM by a visible error node (red badge with error code, clickable to re-log to the console),
making development-time mistakes impossible to miss. - Singleton options sync: When a wrapper component (singleton pattern) and its inner field
both declare options, they are now properly merged with a clear conflict error if keys collide.
Bug Fixes
- Fixed hotkeys-reveal regression: releasing Alt while holding Ctrl now correctly returns to the
first reveal level instead of collapsing entirely. - Fixed
VALUE_CONFLICTdetection: declaring both avalueHTML attribute and a"value"option
indata-smarkon the same element now throws a clear render error. - Minor correction in the color component type export path.
Other
- Landing page updated with a new AI-generated example form, and other optimizations for clarity and flow.
- Schedule example: layout migrated from HTML table to CSS grid, fixing horizontal scrollbars on
narrow viewports;exportEmpties: falseand default-value documentation added. - FAQ expanded: new entries for default values and reset, singleton behavior, null exports, and
the API interface. - Documentation examples pre-filled with realistic demo data throughout.
- Documentation pages are printer-friendly (print stylesheet included in the page layout).
- Co-located example tests extended; test-pick workflow gains "repeat last" and "test with all"
options. - Dev-dependency updates:
rollup→ 4.57+,@playwright/test→ 1.58.x, Babel 7.29. - Added more complete downloadable examples at /resources/examples. All AI
generated with almost no tweaks.
Version 0.12.9
👌 Smarter labels (implicit association, legends...)
Version 0.12.8
Maintenance version.
(Just a workaround for an edge case I've barely seen in one specific browser and version).
No more changes (other than new passing co-located tests).