occam-dom 5.2.40 → 5.2.43
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/README.md +5 -5
- package/example.js +42 -13
- package/lib/example/view/textarea/content.js +1 -1
- package/lib/example/view/textarea/expressions.js +1 -1
- package/lib/example/view/textarea/parseTree/inner.js +1 -1
- package/lib/example/view/textarea/parseTree/outer.js +1 -1
- package/lib/example/view/textarea/parseTree.js +1 -1
- package/lib/example/view.js +1 -1
- package/lib/node.js +1 -1
- package/lib/parseTree/childNodes.js +1 -1
- package/lib/parseTree/horizontalBranch.js +1 -1
- package/lib/parseTree/node.js +1 -1
- package/lib/parseTree/string.js +1 -1
- package/lib/transform.js +1 -1
- package/lib/utilities/node.js +33 -13
- package/package.json +3 -3
- package/src/utilities/node.js +3 -11
package/README.md
CHANGED
|
@@ -129,15 +129,17 @@ import { nodeUtilities } from "occam-dom";
|
|
|
129
129
|
|
|
130
130
|
const { topmostNodeFromOuterNodes } = nodeUtilities;
|
|
131
131
|
|
|
132
|
+
import ClassFromOuterNode from "./classFromOuterNode";
|
|
133
|
+
|
|
132
134
|
...
|
|
133
135
|
|
|
134
136
|
const outerNodes = nodes, ///
|
|
135
|
-
topmostNode = topmostNodeFromOuterNodes(outerNode);
|
|
137
|
+
topmostNode = topmostNodeFromOuterNodes(ClassFromOuterNode, outerNode);
|
|
136
138
|
|
|
137
139
|
...
|
|
138
140
|
```
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
The first argument is a callback that maps outer node classes to inner node ones:
|
|
141
143
|
|
|
142
144
|
```
|
|
143
145
|
import htmlNodeMap from "../map/node/html";
|
|
@@ -157,11 +159,9 @@ function ClassFromOuterNode(outerNode) {
|
|
|
157
159
|
|
|
158
160
|
return Class;
|
|
159
161
|
}
|
|
160
|
-
|
|
161
|
-
const topmostNode = topmostNodeFromOuterNodes(ClassFromOuterNode, outerNode);
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
Note that the topmost inner node has no corresponding outer node and that a default of `HTMLNode` has been provided. There is no need to provide a unique class for every type of outer node that the algorithm may come across.
|
|
164
|
+
Note that the topmost inner node has no corresponding outer node and that a default of `HTMLNode` has been provided. There is no need to provide a unique class for every type of outer node that the algorithm may come across, by the way.
|
|
165
165
|
|
|
166
166
|
## Building
|
|
167
167
|
|