hyper-undo 0.6.0 → 0.6.2
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 +18 -0
- package/package.json +1 -1
- package/src/lib/content-dom.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# hyper-undo changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.2] - 2026-10-03
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Cloning now preserves the values of file, checkbox, radio, and option elements
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [0.6.1] - 2026-09-30
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- The packed contract now loads hyper-undo
|
|
14
|
+
- The packed contract is excluded from the published npm package
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- A descendant's own region marker is now checked on the element itself (content-dom.js synced from ClayJS)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
3
21
|
## [0.6.0] - 2026-09-11
|
|
4
22
|
|
|
5
23
|
### Changed
|
package/package.json
CHANGED
package/src/lib/content-dom.js
CHANGED
|
@@ -7,9 +7,9 @@ const UNSUPPORTED_SELECTOR = /:(?:focus(?:-within|-visible)?|hover|active|visite
|
|
|
7
7
|
function copyControlState(source, copy) {
|
|
8
8
|
if (!/^(INPUT|TEXTAREA|SELECT|OPTION)$/.test(source.tagName || '')) return
|
|
9
9
|
const type = (source.getAttribute?.('type') || '').toLowerCase()
|
|
10
|
-
if ('value' in source && 'value' in copy && source.tagName !== 'OPTION' && type !== 'checkbox' && type !== 'radio') copy.value = source.value
|
|
11
|
-
if ('
|
|
12
|
-
if (
|
|
10
|
+
if ('value' in source && 'value' in copy && source.tagName !== 'OPTION' && type !== 'checkbox' && type !== 'radio' && type !== 'file') copy.value = source.value
|
|
11
|
+
if (source.tagName === 'INPUT' && (type === 'checkbox' || type === 'radio')) copy.checked = source.checked
|
|
12
|
+
if (source.tagName === 'OPTION') copy.selected = source.selected
|
|
13
13
|
if (source.tagName === 'SELECT') {
|
|
14
14
|
for (let i = 0; i < source.options.length; i++) copy.options[i].selected = source.options[i].selected
|
|
15
15
|
}
|
|
@@ -29,8 +29,10 @@ function matchesWithin(node, selector, boundary, inherit) {
|
|
|
29
29
|
|
|
30
30
|
function importTree(source, targetDocument, capability, capabilityMatch, exclude, boundary, inherit, maps) {
|
|
31
31
|
if (source.nodeType === 1 && (
|
|
32
|
-
(inherit
|
|
33
|
-
|
|
32
|
+
(inherit
|
|
33
|
+
? hasCapability(source, capability)
|
|
34
|
+
: matchesWithin(source, capabilityMatch, boundary, false)) ||
|
|
35
|
+
(exclude && (inherit && source !== boundary ? source.matches(exclude) : matchesWithin(source, exclude, boundary, inherit)))
|
|
34
36
|
)) return null
|
|
35
37
|
const copy = targetDocument.importNode(source, false)
|
|
36
38
|
maps.cloneToLive.set(copy, source)
|