@lukekaalim/act-web 5.0.0 → 5.1.1
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 +19 -0
- package/hast.ts +2 -6
- package/package.json +4 -4
- package/props.ts +8 -2
- package/rehydrate.ts +1 -1
- package/render.ts +2 -1
- package/space.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @lukekaalim/act-web
|
|
2
2
|
|
|
3
|
+
## 5.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 114c53f: Fix issue with adding/remove ref props from Web elements
|
|
8
|
+
|
|
9
|
+
## 5.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Improve debugger support
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @lukekaalim/act-recon@4.0.0
|
|
19
|
+
- @lukekaalim/act@4.2.0
|
|
20
|
+
- @lukekaalim/act-backstage@3.1.1
|
|
21
|
+
|
|
3
22
|
## 5.0.0
|
|
4
23
|
|
|
5
24
|
### Major Changes
|
package/hast.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { h, s } from 'hastscript';
|
|
2
2
|
import { Element, ElementContent, Nodes as HNode, Root } from 'hast';
|
|
3
|
-
import { NodeBuilder,
|
|
4
|
-
import {
|
|
5
|
-
import { CommitID, CommitTree2, Reconciler2, Scheduler } from '@lukekaalim/act-recon';
|
|
6
|
-
import { createDOMScheduler } from './scheduler';
|
|
7
|
-
import { recon } from '../three/deps';
|
|
8
|
-
import { HTML } from './space';
|
|
3
|
+
import { NodeBuilder, setPropObject } from "@lukekaalim/act-backstage";
|
|
4
|
+
import { primitiveNodeTypes } from '@lukekaalim/act';
|
|
9
5
|
|
|
10
6
|
export const createHASTBuilder = (root: Root): NodeBuilder<HNode, 'web:html' | 'web:svg'> => ({
|
|
11
7
|
roots: new Set(['web:html', 'web:svg']),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukekaalim/act-web",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "mod.ts",
|
|
6
6
|
"exports": {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"./node": "./nodejs/index.ts"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@lukekaalim/act": "^4.
|
|
12
|
-
"@lukekaalim/act-backstage": "^3.1.
|
|
13
|
-
"@lukekaalim/act-recon": "^
|
|
11
|
+
"@lukekaalim/act": "^4.2.0",
|
|
12
|
+
"@lukekaalim/act-backstage": "^3.1.1",
|
|
13
|
+
"@lukekaalim/act-recon": "^4.0.0",
|
|
14
14
|
"@types/hast": "^3.0.4",
|
|
15
15
|
"hast-util-to-html": "^9.0.5",
|
|
16
16
|
"hastscript": "^9.0.1",
|
package/props.ts
CHANGED
|
@@ -41,7 +41,10 @@ export const setSVGElementProps = (
|
|
|
41
41
|
}
|
|
42
42
|
switch (name) {
|
|
43
43
|
case 'ref':
|
|
44
|
-
(
|
|
44
|
+
if (prev)
|
|
45
|
+
(prev as any).current = null;
|
|
46
|
+
if (next)
|
|
47
|
+
(next as any).current = node;
|
|
45
48
|
return true;
|
|
46
49
|
case 'style':
|
|
47
50
|
return (setStyleProp(node.style, next as any, prev as any), true);
|
|
@@ -72,7 +75,10 @@ export const setHTMLElementProps = (
|
|
|
72
75
|
}
|
|
73
76
|
switch (name) {
|
|
74
77
|
case 'ref':
|
|
75
|
-
(
|
|
78
|
+
if (prev)
|
|
79
|
+
(prev as any).current = null;
|
|
80
|
+
if (next)
|
|
81
|
+
(next as any).current = node;
|
|
76
82
|
return true;
|
|
77
83
|
case 'style':
|
|
78
84
|
return (setStyleProp(node.style, next as any, prev as any), true);
|
package/rehydrate.ts
CHANGED
package/render.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Reconciler2 } from "@lukekaalim/act-recon";
|
|
|
9
9
|
*/
|
|
10
10
|
type Options = {
|
|
11
11
|
window?: Window;
|
|
12
|
+
Reconciler?: typeof Reconciler2,
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -22,7 +23,7 @@ type Options = {
|
|
|
22
23
|
*/
|
|
23
24
|
export const render = (node: Node, root: HTMLElement, options: Options = {}) => {
|
|
24
25
|
const scheduler = createDOMScheduler();
|
|
25
|
-
const reconciler = new Reconciler2(scheduler);
|
|
26
|
+
const reconciler = new (options.Reconciler || Reconciler2)(scheduler);
|
|
26
27
|
const space = new RenderSpace2(reconciler.tree, createWebNodeBuilder(root, options.window));
|
|
27
28
|
|
|
28
29
|
reconciler.bus = space.bus;
|
package/space.ts
CHANGED
|
@@ -22,7 +22,7 @@ export const createWebNodeBuilder = (
|
|
|
22
22
|
switch (tag) {
|
|
23
23
|
case act.primitiveNodeTypes.string:
|
|
24
24
|
case act.primitiveNodeTypes.number:
|
|
25
|
-
return window.document.createTextNode(
|
|
25
|
+
return window.document.createTextNode((element.props.value as any).toString());
|
|
26
26
|
default:
|
|
27
27
|
return null;
|
|
28
28
|
}
|