occam-dom 3.1.130 → 4.0.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.
Files changed (41) hide show
  1. package/README.md +1 -53
  2. package/package.json +9 -11
  3. package/bin/main.js +0 -15
  4. package/example.js +0 -35580
  5. package/index.html +0 -47
  6. package/lib/constants.js +0 -13
  7. package/lib/example/utilities/token.js +0 -28
  8. package/lib/example/view/div/sizeable.js +0 -39
  9. package/lib/example/view/input/expression.js +0 -156
  10. package/lib/example/view/input/maximumDepth.js +0 -156
  11. package/lib/example/view/input.js +0 -39
  12. package/lib/example/view/subHeading.js +0 -39
  13. package/lib/example/view/textarea/content.js +0 -155
  14. package/lib/example/view/textarea/nodes.js +0 -176
  15. package/lib/example/view/textarea/parseTree.js +0 -183
  16. package/lib/example/view/textarea.js +0 -39
  17. package/lib/example/view.js +0 -250
  18. package/lib/example.js +0 -19
  19. package/lib/index.js +0 -27
  20. package/lib/query.js +0 -168
  21. package/lib/spread.js +0 -86
  22. package/lib/utilities/array.js +0 -61
  23. package/lib/utilities/query.js +0 -79
  24. package/src/constants.js +0 -3
  25. package/src/example/utilities/token.js +0 -21
  26. package/src/example/view/div/sizeable.js +0 -12
  27. package/src/example/view/input/expression.js +0 -35
  28. package/src/example/view/input/maximumDepth.js +0 -35
  29. package/src/example/view/input.js +0 -14
  30. package/src/example/view/subHeading.js +0 -16
  31. package/src/example/view/textarea/content.js +0 -33
  32. package/src/example/view/textarea/nodes.js +0 -64
  33. package/src/example/view/textarea/parseTree.js +0 -50
  34. package/src/example/view/textarea.js +0 -18
  35. package/src/example/view.js +0 -120
  36. package/src/example.js +0 -21
  37. package/src/index.js +0 -4
  38. package/src/query.js +0 -170
  39. package/src/spread.js +0 -65
  40. package/src/utilities/array.js +0 -30
  41. package/src/utilities/query.js +0 -52
package/README.md CHANGED
@@ -13,31 +13,7 @@
13
13
 
14
14
  ## Introduction
15
15
 
16
- This package provides a simple, [XPath](https://en.wikipedia.org/wiki/XPath)-like query language for selecting nodes from document object models returned by Occam's [parsers](https://github.com/djalbat/occam-parsers).
17
-
18
- A query expression consists of a leading, forward slash `/` followed by an optional forward slash to signify arbitrary depth, followed by a list of either non-terminal node rule names or terminal node significant token types, finally followed by an optional spread expression and a sub-query. You cannot mix rule names and significant token types and the sub-queries of query expressions with significant token types are ignored. Further explanation would likely just confuse. It is best simply to play around with the expression in the example to select different nodes.
19
-
20
- Here is an example DOM together with some query expressions and their meaning, to help clarify:
21
- ```
22
- stylesheet
23
- |
24
- ruleSet
25
- |
26
- ------------------------------------------------------------------------------------------------------
27
- | | | |
28
- selectors {[special] declaration }[special]
29
- | |
30
- selector ---------------------------------------------
31
- | | | | |
32
- class property :[special] expression ;[special]
33
- | | |
34
- ------------------------------- background[identifier] term
35
- | | | |
36
- .[special] <NO_WHITESPACE> view[identifier] red[identifier]
37
- ```
38
- * `/stylesheet` matches the topmost `stylesheet` non-terminal node.
39
- * `//term` matches all `term` non-terminal nodes to an arbitrary depth.
40
- * `//@special[2...4]` matches from the third to the fifth of all `special` terminal nodes.
16
+ ...
41
17
 
42
18
  ## Installation
43
19
 
@@ -75,35 +51,7 @@ One last thing to bear in mind is that this package is included by way of a rela
75
51
 
76
52
  ## Usage
77
53
 
78
- The collection of query utility functions is exported as a plain old JavaScript object. The only one of use is the `queryByExpression(...)` function:
79
-
80
- ```
81
- import { queryUtilities } from "occam-dom";
82
-
83
- const { queryByExpression } = queryUtilities;
84
-
85
- const node = ...,
86
- expression = "...",
87
- maximumDepth = 10,
88
- nodes = queryByExpression(node, expression, maximumDepth);
89
-
90
- ...
91
- ```
92
- The `maximumDepth` argument is optional, the default is `Infinity`.
93
-
94
- If repeatedly using the same query expression, build a `query` object and make use of its `execute(...)` method:
95
-
96
- ```
97
- import { Query } from "occam-dom";
98
-
99
- const node = ...,
100
- expression = "...",
101
- query = Query.fromExpression(expression)
102
- nodes = query.execute(node);
103
-
104
54
  ...
105
- ```
106
- This is quicker than using the `queryByExpression()` function, which will create such an object each time it is invoked. Again there is an optional last `maximumDepth` argument, left out here.
107
55
 
108
56
  ## Building
109
57
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "occam-dom",
3
3
  "author": "James Smith",
4
- "version": "3.1.130",
4
+ "version": "4.0.3",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/occam-dom",
7
7
  "description": "Occam's DOM related functionality.",
@@ -9,19 +9,17 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/djalbat/occam-dom"
11
11
  },
12
- "dependencies": {
13
- "necessary": "^13.3.1"
14
- },
12
+ "dependencies": {},
15
13
  "devDependencies": {
16
- "@swc/core": "^1.2.50",
17
- "easy": "^16.0.19",
18
- "easy-layout": "^6.0.121",
19
- "easy-with-style": "^3.0.312",
14
+ "@swc/core": "^1.5.6",
15
+ "easy": "^23.0.1",
16
+ "easy-layout": "^6.0.225",
17
+ "easy-with-style": "^3.0.456",
20
18
  "esbuild": "^0.9.2",
21
19
  "express": "^4.17.1",
22
- "juxtapose": "^4.0.80",
23
- "lively-cli": "^2.0.52",
24
- "watchful-cli": "^1.7.44",
20
+ "juxtapose": "^4.0.117",
21
+ "lively-cli": "^2.0.65",
22
+ "watchful-cli": "^1.7.56",
25
23
  "with-style": "^5.0.129"
26
24
  },
27
25
  "scripts": {
package/bin/main.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- const express = require("express");
4
-
5
- const { createLiveReloadHandler } = require("lively-cli");
6
-
7
- const server = express(), ///
8
- staticRouter = express.static("."),
9
- liveReloadHandler = createLiveReloadHandler("./example.js");
10
-
11
- server.use(staticRouter);
12
-
13
- server.get("/live-reload", liveReloadHandler);
14
-
15
- server.listen(8888);