@ac-kit/model-markup 0.0.0-stage → 0.1.0
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 +59 -0
- package/LICENSE +28 -0
- package/README.md +199 -2
- package/dist/_text-run.d.ts +26 -0
- package/dist/_text-run.d.ts.map +1 -0
- package/dist/_text-run.js +56 -0
- package/dist/_text-run.js.map +1 -0
- package/dist/index-markup-tree.d.ts +37 -0
- package/dist/index-markup-tree.d.ts.map +1 -0
- package/dist/index-markup-tree.js +200 -0
- package/dist/index-markup-tree.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/markup-namespace-scope.d.ts +24 -0
- package/dist/markup-namespace-scope.d.ts.map +1 -0
- package/dist/markup-namespace-scope.js +63 -0
- package/dist/markup-namespace-scope.js.map +1 -0
- package/dist/markup-navigation.d.ts +38 -0
- package/dist/markup-navigation.d.ts.map +1 -0
- package/dist/markup-navigation.js +55 -0
- package/dist/markup-navigation.js.map +1 -0
- package/dist/markup-tree-shape.d.ts +186 -0
- package/dist/markup-tree-shape.d.ts.map +1 -0
- package/dist/markup-tree-shape.js +2 -0
- package/dist/markup-tree-shape.js.map +1 -0
- package/dist/markup-values.d.ts +90 -0
- package/dist/markup-values.d.ts.map +1 -0
- package/dist/markup-values.js +169 -0
- package/dist/markup-values.js.map +1 -0
- package/dist/namespaces.d.ts +16 -0
- package/dist/namespaces.d.ts.map +1 -0
- package/dist/namespaces.js +16 -0
- package/dist/namespaces.js.map +1 -0
- package/dist/parse5/index.d.ts +99 -0
- package/dist/parse5/index.d.ts.map +1 -0
- package/dist/parse5/index.js +84 -0
- package/dist/parse5/index.js.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/record-tree.d.ts +102 -0
- package/dist/testing/record-tree.d.ts.map +1 -0
- package/dist/testing/record-tree.js +212 -0
- package/dist/testing/record-tree.js.map +1 -0
- package/package.json +68 -3
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { choice, randomInteger, walkTree } from "@ac-kit/algo";
|
|
2
|
+
import { markupNamespacesFromAttributes } from "../markup-namespace-scope.js";
|
|
3
|
+
/**
|
|
4
|
+
* A node of any `kind`; every field defaults to empty (`null` for the namespace
|
|
5
|
+
* and the prefix). Sets `parent` on each of `options.children`, so a node must
|
|
6
|
+
* be given to one parent only. O(children).
|
|
7
|
+
*/
|
|
8
|
+
export function node(kind, options = {}) {
|
|
9
|
+
const created = {
|
|
10
|
+
kind,
|
|
11
|
+
local: options.local ?? "",
|
|
12
|
+
prefix: options.prefix ?? null,
|
|
13
|
+
namespace: options.namespace ?? null,
|
|
14
|
+
data: options.data ?? "",
|
|
15
|
+
target: options.target ?? "",
|
|
16
|
+
attributes: options.attributes ?? [],
|
|
17
|
+
children: options.children ?? [],
|
|
18
|
+
parent: null,
|
|
19
|
+
};
|
|
20
|
+
for (const child of created.children) {
|
|
21
|
+
child.parent = created;
|
|
22
|
+
}
|
|
23
|
+
return created;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* An element whose attributes are in no namespace and unprefixed, in
|
|
27
|
+
* `namespace` (none by default). `children` are adopted as by {@link node}.
|
|
28
|
+
*/
|
|
29
|
+
export function element(local, attributes = {}, children = [], namespace = null) {
|
|
30
|
+
return node("element", {
|
|
31
|
+
local,
|
|
32
|
+
namespace,
|
|
33
|
+
attributes: Object.entries(attributes).map(([attributeName, value]) => ({
|
|
34
|
+
local: attributeName,
|
|
35
|
+
namespace: null,
|
|
36
|
+
prefix: null,
|
|
37
|
+
value,
|
|
38
|
+
})),
|
|
39
|
+
children,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** A text node. */
|
|
43
|
+
export function text(data) {
|
|
44
|
+
return node("text", { data });
|
|
45
|
+
}
|
|
46
|
+
/** A comment node. */
|
|
47
|
+
export function comment(data) {
|
|
48
|
+
return node("comment", { data });
|
|
49
|
+
}
|
|
50
|
+
/** A processing instruction. */
|
|
51
|
+
export function processingInstruction(target, data) {
|
|
52
|
+
return node("processingInstruction", { target, data });
|
|
53
|
+
}
|
|
54
|
+
/** A document node over `children`. */
|
|
55
|
+
export function documentOf(...children) {
|
|
56
|
+
return node("document", { children });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The first element child of `parent`.
|
|
60
|
+
*
|
|
61
|
+
* @throws TypeError when `parent` has no element child.
|
|
62
|
+
*/
|
|
63
|
+
export function firstElement(parent) {
|
|
64
|
+
const found = parent.children.find((child) => child.kind === "element");
|
|
65
|
+
if (found === undefined) {
|
|
66
|
+
throw new TypeError("No element child");
|
|
67
|
+
}
|
|
68
|
+
return found;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A shape over {@link RecordNode} without `parentOf`, as a parser without parent
|
|
72
|
+
* pointers would give.
|
|
73
|
+
*/
|
|
74
|
+
export function recordDownShape(documentMode = "xml") {
|
|
75
|
+
return {
|
|
76
|
+
kindOf: (recorded) => recorded.kind,
|
|
77
|
+
childrenOf: (recorded) => recorded.children,
|
|
78
|
+
documentModeOf: () => documentMode,
|
|
79
|
+
localNameOf: (recorded) => recorded.local,
|
|
80
|
+
namespaceOf: (recorded) => recorded.namespace,
|
|
81
|
+
prefixOf: (recorded) => recorded.prefix,
|
|
82
|
+
attributesOf: (recorded) => recorded.attributes,
|
|
83
|
+
attributeLocalNameOf: (attribute) => attribute.local,
|
|
84
|
+
attributeNamespaceOf: (attribute) => attribute.namespace,
|
|
85
|
+
attributePrefixOf: (attribute) => attribute.prefix,
|
|
86
|
+
attributeValueOf: (attribute) => attribute.value,
|
|
87
|
+
dataOf: (recorded) => recorded.data,
|
|
88
|
+
targetOf: (recorded) => recorded.target,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** A full shape over {@link RecordNode}, with no other optional member. */
|
|
92
|
+
export function recordShape(documentMode = "xml") {
|
|
93
|
+
return {
|
|
94
|
+
...recordDownShape(documentMode),
|
|
95
|
+
parentOf: (recorded) => recorded.parent,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* {@link recordShape} plus `namespacesInScopeOf` and `namespacesInScopeWithin`,
|
|
100
|
+
* derived from the `xmlns` attributes by `markupNamespacesFromAttributes`.
|
|
101
|
+
*/
|
|
102
|
+
export function recordNamespaceShape(documentMode = "xml") {
|
|
103
|
+
const base = recordShape(documentMode);
|
|
104
|
+
const shape = {
|
|
105
|
+
...base,
|
|
106
|
+
namespacesInScopeOf: (recorded) => markupNamespacesFromAttributes(shape, recorded),
|
|
107
|
+
namespacesInScopeWithin: (recorded, budget) => markupNamespacesFromAttributes(shape, recorded, budget),
|
|
108
|
+
};
|
|
109
|
+
return shape;
|
|
110
|
+
}
|
|
111
|
+
const LEAF_KINDS = [
|
|
112
|
+
"text",
|
|
113
|
+
"text",
|
|
114
|
+
"comment",
|
|
115
|
+
"processingInstruction",
|
|
116
|
+
];
|
|
117
|
+
/**
|
|
118
|
+
* A random document of `size` nodes under the document node, with repeated ids
|
|
119
|
+
* and adjacent text. O(size) time and memory.
|
|
120
|
+
*/
|
|
121
|
+
export function randomDocument(random, size) {
|
|
122
|
+
const root = node("document");
|
|
123
|
+
const parents = [root];
|
|
124
|
+
for (let count = 0; count < size; count++) {
|
|
125
|
+
const parent = choice(parents, random);
|
|
126
|
+
const isElement = random() < 0.5;
|
|
127
|
+
const kind = isElement ? "element" : choice(LEAF_KINDS, random);
|
|
128
|
+
const attributes = isElement && random() < 0.4
|
|
129
|
+
? [
|
|
130
|
+
{
|
|
131
|
+
local: "id",
|
|
132
|
+
namespace: null,
|
|
133
|
+
prefix: null,
|
|
134
|
+
value: `id${randomInteger(0, 5, random)}`,
|
|
135
|
+
},
|
|
136
|
+
]
|
|
137
|
+
: [];
|
|
138
|
+
const child = node(kind, {
|
|
139
|
+
local: isElement ? "e" : "",
|
|
140
|
+
data: kind === "text" ? String(count % 3 === 0 ? "" : count) : "c",
|
|
141
|
+
attributes,
|
|
142
|
+
});
|
|
143
|
+
child.parent = parent;
|
|
144
|
+
parent.children.push(child);
|
|
145
|
+
if (isElement) {
|
|
146
|
+
parents.push(child);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return root;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Every node under `root`, `root` included, in document order, by an iterative
|
|
153
|
+
* walk (`walkTree`): the reference the indexes are checked against. O(n) time
|
|
154
|
+
* and result memory, O(depth) for the walk.
|
|
155
|
+
*/
|
|
156
|
+
export function preOrder(root) {
|
|
157
|
+
const nodes = [];
|
|
158
|
+
walkTree(root, (current) => current.children, (current) => {
|
|
159
|
+
nodes.push(current);
|
|
160
|
+
});
|
|
161
|
+
return nodes;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* A chain `depth` elements deep ending in one text node, built without
|
|
165
|
+
* recursion; returns its outermost element. O(depth) time and memory.
|
|
166
|
+
*/
|
|
167
|
+
export function deepChain(depth, data = "x") {
|
|
168
|
+
let current = text(data);
|
|
169
|
+
for (let level = 0; level < depth; level++) {
|
|
170
|
+
current = element("e", {}, [current]);
|
|
171
|
+
}
|
|
172
|
+
return current;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A document holding a chain of `depth` nested `e` elements, built without
|
|
176
|
+
* recursion; returns the document and the innermost element. O(depth) time and
|
|
177
|
+
* memory.
|
|
178
|
+
*/
|
|
179
|
+
export function deepDocument(depth) {
|
|
180
|
+
const document = node("document");
|
|
181
|
+
let parent = document;
|
|
182
|
+
for (let level = 0; level < depth; level++) {
|
|
183
|
+
const child = element("e");
|
|
184
|
+
child.parent = parent;
|
|
185
|
+
parent.children.push(child);
|
|
186
|
+
parent = child;
|
|
187
|
+
}
|
|
188
|
+
return { document, leaf: parent };
|
|
189
|
+
}
|
|
190
|
+
/** A document holding one element `p` with `count` children `c`. O(count). */
|
|
191
|
+
export function wideElement(count) {
|
|
192
|
+
return documentOf(element("p", {}, Array.from({ length: count }, () => element("c"))));
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Every element under `root`, `root` excluded, in document order, iteratively.
|
|
196
|
+
* O(n) time and result memory, plus a stack of the pending siblings.
|
|
197
|
+
*/
|
|
198
|
+
export function elementsUnder(root) {
|
|
199
|
+
const found = [];
|
|
200
|
+
const stack = [...root.children].reverse();
|
|
201
|
+
while (stack.length > 0) {
|
|
202
|
+
const current = stack.pop();
|
|
203
|
+
if (current.kind === "element") {
|
|
204
|
+
found.push(current);
|
|
205
|
+
}
|
|
206
|
+
for (let index = current.children.length - 1; index >= 0; index--) {
|
|
207
|
+
stack.push(current.children[index]);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return found;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=record-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-tree.js","sourceRoot":"","sources":["../../src/testing/record-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAiC9E;;;;GAIG;AACH,MAAM,UAAU,IAAI,CACnB,IAAoB,EACpB,OAAO,GAQH,EAAE;IAEN,MAAM,OAAO,GAAe;QAC3B,IAAI;QACJ,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC1B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;QAC9B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;QACpC,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;QAC5B,UAAU,EAAE,OAAO,CAAC,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CAAC;IAC3C,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,EAAG,CAAC;QAC7B,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;QACD,KAAK,IAAI,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;YACnE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAE,CAAC,CAAC;QACtC,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/model-markup",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Markup trees as a shape: elements, attributes, text and namespaces read through accessors, for XML and HTML trees alike.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dom",
|
|
7
|
+
"html",
|
|
8
|
+
"markup",
|
|
9
|
+
"tree",
|
|
10
|
+
"xml"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://anthochamp.pages.grenadine.io/node-essentials/api/model-markup/",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "BSD-3-Clause",
|
|
17
|
+
"author": "Anthony Champagne <dev@anthonychampagne.fr>",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://git.grenadine.io/anthochamp/node-essentials.git",
|
|
21
|
+
"directory": "packages/model-markup"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./parse5": "./dist/parse5/index.js",
|
|
32
|
+
"./testing": "./dist/testing/index.js"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"main": "./dist/index.js",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": "./dist/index.js",
|
|
38
|
+
"./parse5": "./dist/parse5/index.js",
|
|
39
|
+
"./testing": "./dist/testing/index.js"
|
|
40
|
+
},
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"compile": "tsc -p ./tsconfig.build.json -outDir dist",
|
|
45
|
+
"compile:check": "tsc -noEmit -p ./tsconfig.json",
|
|
46
|
+
"clean": "rimraf dist",
|
|
47
|
+
"build": "yarn clean && yarn compile",
|
|
48
|
+
"test": "yarn run -T vitest run",
|
|
49
|
+
"prepack": "yarn build"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@ac-kit/algo": "^0.4.0",
|
|
53
|
+
"@ac-kit/core": "^0.10.0",
|
|
54
|
+
"@types/web": "^0.0.367"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@ac-kit/math-random": "0.2.0",
|
|
58
|
+
"@ac-kit/test-util": "0.3.0",
|
|
59
|
+
"@ac-kit/tsconfig": "0.1.0",
|
|
60
|
+
"@ac-kit/typedoc-config": "0.1.0",
|
|
61
|
+
"@ac-kit/vitest-config": "0.1.1",
|
|
62
|
+
"@typescript/native": "typescript@7.0.2",
|
|
63
|
+
"parse5": "8.1.1",
|
|
64
|
+
"rimraf": "6.1.4",
|
|
65
|
+
"typedoc": "0.28.20",
|
|
66
|
+
"typescript": "@typescript/typescript6@6.0.2"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=24"
|
|
70
|
+
}
|
|
6
71
|
}
|