declarative-forms 2.0.0 → 2.1.0

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 DELETED
@@ -1,115 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented here.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ### Added
11
-
12
- - A second stylesheet, `declarative-forms/theme.css`: a modern redesign with
13
- automatic light and dark mode (`prefers-color-scheme`, overridable with
14
- `data-dl-theme`), focus rings, fluid widths and a fuller token set. It is a
15
- standalone alternative to `styles.css`, renders the identical DOM, and mirrors
16
- the default stylesheet's selectors and specificity so existing overrides keep
17
- winning. The default stylesheet is unchanged.
18
- - Under the modern theme, checkboxes are **keyboard-reachable**: the input is
19
- styled directly with `appearance: none` rather than hidden behind a
20
- pseudo-element. The default stylesheet keeps its existing behaviour.
21
- - Two wrapper classes for stacked dialogs: `dl-modal-stacked` on a dialog opened
22
- on top of another, and `dl-modal-restored` on one revealed again after being
23
- covered. Both mark a backdrop that is already on screen, so a theme can skip
24
- its entrance animation. A stacked wrapper also carries `--dl-stack-depth`, the
25
- number of dialogs underneath it.
26
- - Under the modern theme, a stacked dialog now **shows the stack**: the dialogs
27
- below it, which are hidden, are drawn as card edges peeking out above the
28
- dialog on top — one edge for a single dialog below, two for more. Sized with
29
- `--dl-stack-peek` and `--dl-stack-inset`. The default stylesheet is unchanged.
30
-
31
- ### Fixed
32
-
33
- - Opening or closing a stacked dialog no longer flashes the page under the
34
- backdrop. The covered dialog was hidden in the same frame the new one started
35
- fading in, leaving nothing over the page for the length of the animation; the
36
- modern theme now skips that animation for stacked and restored dialogs. The
37
- default stylesheet was never affected — it has no animations.
38
-
39
- ## [2.0.0-alpha.0]
40
-
41
- Complete rewrite in TypeScript with an object-oriented design.
42
-
43
- **The JavaScript API is a clean break; the rendered DOM is deliberately
44
- unchanged.** Stylesheets and DOM-based end-to-end selectors written against v1
45
- keep working. See the [migration guide](https://wolfoo2931.github.io/declarative-forms/migration-v1).
46
-
47
- ### Added
48
-
49
- - Discriminated `kind` on field descriptors, making them fully typable.
50
- - `form.field(name)` — a typed handle with `getValue`, `setValue`, `focus`,
51
- `setLoading`, `element` and `wrapper`.
52
- - `FieldRegistry`, so applications can register their own field kinds.
53
- - Pluggable `TooltipProvider`, with a native zero-dependency default.
54
- - `html()` / `escapeHtml()` for explicit, opt-in markup.
55
- - `whenReady()`, `destroy()`, and an unsubscribe return from
56
- `subscribeOnInput()`.
57
- - `dl-error` event on file-upload failure.
58
- - A `--dl-*` design-token layer and a dark theme.
59
- - Documentation site, and a live example playground under `examples/`.
60
-
61
- ### Changed
62
-
63
- - Package renamed to `declarative-forms`; the export is now named
64
- (`import { DeclarativeForm }`).
65
- - Constructor takes a single options object instead of five positional
66
- arguments.
67
- - Descriptor callbacks receive one context object instead of per-callback
68
- positional argument lists.
69
- - Renamed: `mapFiledsOnEdit` → `mapFieldsOnEdit`,
70
- `onValuesCalculationFailedMessage` → `onOptionsError`,
71
- `closeModalIfOpen` → `close`, `updateCalculatedFields` →
72
- `updateComputedFields`, `mulitple-allowed` → `multiple`.
73
- - `descriptor.domElement` replaced by `form.field(name)`; the library no longer
74
- mutates caller-supplied descriptors.
75
- - Dialog buttons are `<button type="button">` rather than `<div>`, keeping the
76
- `.btn` class.
77
- - Content is rendered as text by default; markup requires `html()`.
78
- - `message` fields no longer appear in `getValues()`.
79
- - `buttons` and `onConfirm` are independent — a single-button map no longer
80
- silently replaces `onConfirm`.
81
- - Test tooling replaced with Vitest, Playwright and tsup.
82
-
83
- ### Removed
84
-
85
- - All runtime dependencies: `tippy.js`, `@popperjs/core`,
86
- `@react-hookz/deep-equal`, and the unused `uuid`.
87
- - The v1 Karma/Jasmine/wdio/Browserify setup, which could not run — its
88
- packages were referenced by scripts but absent from `devDependencies`.
89
-
90
- ### Fixed
91
-
92
- - `<label for>` pointed at a field name that was never an element id, so no
93
- field was ever labelled for assistive technology.
94
- - Checkbox ids collided between a parent form and its array sub-form.
95
- - `getValues()` could not represent `''`, `0` or `false`.
96
- - The internal promise list grew without bound and was never cleared.
97
- - Tabs and tooltips were resolved with `document.querySelector`, so two open
98
- forms fought over each other's state.
99
- - A slow options load could overwrite a newer one; loads are now
100
- generation-guarded.
101
- - Caller data was interpolated as HTML in 21 places.
102
- - Option values containing a quote threw a `DOMException`.
103
- - A keydown listener and a stylesheet were installed as import side effects,
104
- breaking server-side rendering.
105
- - `class DlSelect extends HTMLElement` was evaluated at module load, so simply
106
- importing the package threw `HTMLElement is not defined` in Node and broke
107
- any server-rendered or prerendered app.
108
- - `classList.remove` was written as `Element.remove()`, deleting the confirm
109
- button whenever it showed its loading state.
110
- - `<dl-option>` was never registered as a custom element.
111
- - Buttons flashed disabled on every keystroke, and a well-timed click could be
112
- dropped.
113
-
114
- [Unreleased]: https://github.com/wolfoo2931/declarative-forms/compare/v2.0.0-alpha.0...HEAD
115
- [2.0.0-alpha.0]: https://github.com/wolfoo2931/declarative-forms/releases/tag/v2.0.0-alpha.0