@panphora/hyper-cms 0.11.1 → 0.11.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panphora/hyper-cms",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "description": "Live edit-in-place CMS sidebar for HTML pages with a hyper-html-api rules tag",
5
5
  "keywords": [
6
6
  "HTML",
@@ -47,8 +47,8 @@
47
47
  "test:all": "npm run test:node && npm run test:browser"
48
48
  },
49
49
  "dependencies": {
50
- "hyper-html-api": "^0.9.0",
51
- "hyper-morph": "^1.0.0"
50
+ "hyper-html-api": "^0.10.0",
51
+ "hyper-morph": "^1.3.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@open-wc/testing": "^4.0.0",
@@ -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 ('checked' in source && 'checked' in copy) copy.checked = source.checked
12
- if ('selected' in source && 'selected' in copy) copy.selected = source.selected
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 ? hasCapability(source, capability) : matchesWithin(source, capabilityMatch, boundary, false)) ||
33
- (exclude && matchesWithin(source, exclude, boundary, inherit))
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)