@lukekaalim/act-web 0.4.1 → 0.4.5

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.
Files changed (3) hide show
  1. package/node.js +2 -0
  2. package/package.json +2 -2
  3. package/prop.js +7 -1
package/node.js CHANGED
@@ -10,6 +10,8 @@ export const createNode = (element/*: Element*/, namespace/*: string*/)/*: ?Node
10
10
  return null;
11
11
  if (element.type === 'act:string')
12
12
  return document.createTextNode('');
13
+ if (element.type === 'act:context')
14
+ return null;
13
15
  return document.createElementNS(namespace, element.type);
14
16
  };
15
17
  export const removeNode = (node/*: Node*/) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@lukekaalim/act-web",
3
3
  "main": "main.js",
4
4
  "type": "module",
5
- "version": "0.4.1",
5
+ "version": "0.4.5",
6
6
  "sideEffects": false,
7
7
  "scripts": {
8
8
  "test": "cd ../..; npm test",
@@ -10,7 +10,7 @@
10
10
  "preversion": "npm run test"
11
11
  },
12
12
  "dependencies": {
13
- "@lukekaalim/act-reconciler": "^2.0.1"
13
+ "@lukekaalim/act-reconciler": "^2.0.4"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@lukekaalim/act": "*"
package/prop.js CHANGED
@@ -16,7 +16,13 @@ export const setStylesProp = (
16
16
 
17
17
  for (const [rule, { next }] of diff.entries()) {
18
18
  const nextRuleValue = (typeof next === 'string' || typeof next === 'number') ? next : null;
19
- (style/*: Object*/)[rule] = nextRuleValue;
19
+ if (typeof (style/*: any*/)[rule] !== 'undefined')
20
+ (style/*: any*/)[rule] = nextRuleValue;
21
+ else
22
+ if (nextRuleValue === null)
23
+ style.removeProperty(rule);
24
+ else
25
+ style.setProperty(rule, nextRuleValue.toString());
20
26
  }
21
27
  };
22
28