@markuplint/ml-core 3.11.0 → 4.0.0-alpha.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/lib/configs.browser.js +1 -5
- package/lib/configs.js +33 -30
- package/lib/convert-ruleset.d.ts +1 -1
- package/lib/convert-ruleset.js +3 -8
- package/lib/debug.js +9 -14
- package/lib/index.d.ts +12 -12
- package/lib/index.js +13 -29
- package/lib/ml-core.d.ts +2 -2
- package/lib/ml-core.js +60 -66
- package/lib/ml-dom/helper/accname.d.ts +1 -1
- package/lib/ml-dom/helper/accname.js +9 -16
- package/lib/ml-dom/helper/create-node.d.ts +2 -2
- package/lib/ml-dom/helper/create-node.js +11 -15
- package/lib/ml-dom/helper/debug.d.ts +1 -1
- package/lib/ml-dom/helper/debug.js +2 -7
- package/lib/ml-dom/helper/getIndent.d.ts +2 -2
- package/lib/ml-dom/helper/getIndent.js +15 -19
- package/lib/ml-dom/helper/walkers.d.ts +1 -1
- package/lib/ml-dom/helper/walkers.js +2 -7
- package/lib/ml-dom/index.d.ts +9 -9
- package/lib/ml-dom/index.js +1 -5
- package/lib/ml-dom/manipulations/child-node-methods.d.ts +2 -2
- package/lib/ml-dom/manipulations/child-node-methods.js +13 -25
- package/lib/ml-dom/manipulations/get-children.d.ts +2 -2
- package/lib/ml-dom/manipulations/get-children.js +3 -7
- package/lib/ml-dom/node/attr.d.ts +5 -5
- package/lib/ml-dom/node/attr.js +28 -33
- package/lib/ml-dom/node/block.d.ts +4 -4
- package/lib/ml-dom/node/block.js +7 -11
- package/lib/ml-dom/node/character-data.d.ts +2 -2
- package/lib/ml-dom/node/character-data.js +11 -16
- package/lib/ml-dom/node/child-node.d.ts +6 -6
- package/lib/ml-dom/node/child-node.js +1 -5
- package/lib/ml-dom/node/comment.d.ts +2 -2
- package/lib/ml-dom/node/comment.js +2 -6
- package/lib/ml-dom/node/document-fragment.d.ts +2 -2
- package/lib/ml-dom/node/document-fragment.js +4 -9
- package/lib/ml-dom/node/document-type.d.ts +4 -4
- package/lib/ml-dom/node/document-type.js +7 -11
- package/lib/ml-dom/node/document.d.ts +13 -13
- package/lib/ml-dom/node/document.js +233 -241
- package/lib/ml-dom/node/dom-token-list.d.ts +1 -1
- package/lib/ml-dom/node/dom-token-list.js +25 -31
- package/lib/ml-dom/node/element.d.ts +8 -8
- package/lib/ml-dom/node/element.js +278 -296
- package/lib/ml-dom/node/named-node-map.d.ts +1 -1
- package/lib/ml-dom/node/named-node-map.js +10 -18
- package/lib/ml-dom/node/node-list.d.ts +2 -2
- package/lib/ml-dom/node/node-list.js +6 -14
- package/lib/ml-dom/node/node-store.d.ts +2 -2
- package/lib/ml-dom/node/node-store.js +9 -12
- package/lib/ml-dom/node/node.d.ts +8 -8
- package/lib/ml-dom/node/node.js +58 -66
- package/lib/ml-dom/node/parent-node.d.ts +2 -2
- package/lib/ml-dom/node/parent-node.js +22 -29
- package/lib/ml-dom/node/rule-mapper.d.ts +2 -2
- package/lib/ml-dom/node/rule-mapper.js +11 -16
- package/lib/ml-dom/node/text.d.ts +2 -2
- package/lib/ml-dom/node/text.js +6 -11
- package/lib/ml-dom/node/types.d.ts +10 -10
- package/lib/ml-dom/node/types.js +1 -2
- package/lib/ml-dom/node/unexpected-call-error.js +1 -4
- package/lib/ml-dom/token/token.js +19 -23
- package/lib/ml-rule/create-rule.d.ts +1 -1
- package/lib/ml-rule/create-rule.js +1 -5
- package/lib/ml-rule/create-test-rule.d.ts +2 -2
- package/lib/ml-rule/create-test-rule.js +3 -7
- package/lib/ml-rule/index.d.ts +3 -3
- package/lib/ml-rule/index.js +3 -6
- package/lib/ml-rule/ml-rule-context.d.ts +2 -2
- package/lib/ml-rule/ml-rule-context.js +7 -11
- package/lib/ml-rule/ml-rule.d.ts +3 -3
- package/lib/ml-rule/ml-rule.js +23 -30
- package/lib/ml-rule/types.d.ts +2 -2
- package/lib/ml-rule/types.js +1 -2
- package/lib/plugin/index.d.ts +2 -2
- package/lib/plugin/index.js +2 -5
- package/lib/plugin/plugin.d.ts +1 -1
- package/lib/plugin/plugin.js +1 -5
- package/lib/plugin/types.d.ts +1 -1
- package/lib/plugin/types.js +1 -2
- package/lib/ruleset/index.js +4 -8
- package/lib/test/index.d.ts +4 -4
- package/lib/test/index.js +13 -23
- package/lib/types.d.ts +2 -2
- package/lib/types.js +1 -2
- package/lib/utils/get-location-from-chars.js +1 -5
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -5
- package/lib/utils/string-splice.js +1 -5
- package/package.json +20 -15
- package/test/ml-dom/helper/accname.spec.js +0 -85
- package/test/ml-dom/helper/create-node.spec.js +0 -18
- package/test/ml-dom/index.spec.js +0 -680
- package/test/ml-dom/ml-rule/create-rule.spec.js +0 -108
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DocumentFragmentNodeType } from './types';
|
|
1
|
+
import type { DocumentFragmentNodeType } from './types.js';
|
|
2
2
|
import type { MLASTAbstractNode } from '@markuplint/ml-ast';
|
|
3
3
|
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
4
|
-
import { MLParentNode } from './parent-node';
|
|
4
|
+
import { MLParentNode } from './parent-node.js';
|
|
5
5
|
export declare class MLDocumentFragment<T extends RuleConfigValue, O extends PlainData = undefined> extends MLParentNode<T, O, MLASTAbstractNode> implements DocumentFragment {
|
|
6
6
|
/**
|
|
7
7
|
* Returns a string appropriate for the type of node as `DocumentFragment`
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const parent_node_1 = require("./parent-node");
|
|
6
|
-
const unexpected_call_error_1 = tslib_1.__importDefault(require("./unexpected-call-error"));
|
|
7
|
-
class MLDocumentFragment extends parent_node_1.MLParentNode {
|
|
1
|
+
import { MLParentNode } from './parent-node.js';
|
|
2
|
+
import UnexpectedCallError from './unexpected-call-error.js';
|
|
3
|
+
export class MLDocumentFragment extends MLParentNode {
|
|
8
4
|
/**
|
|
9
5
|
* Returns a string appropriate for the type of node as `DocumentFragment`
|
|
10
6
|
*
|
|
@@ -27,7 +23,6 @@ class MLDocumentFragment extends parent_node_1.MLParentNode {
|
|
|
27
23
|
* @implements DOM API: `DocumentFragment`
|
|
28
24
|
*/
|
|
29
25
|
getElementById(elementId) {
|
|
30
|
-
throw new
|
|
26
|
+
throw new UnexpectedCallError('Not supported "getElementById" method');
|
|
31
27
|
}
|
|
32
28
|
}
|
|
33
|
-
exports.MLDocumentFragment = MLDocumentFragment;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { MLDocument } from './document';
|
|
2
|
-
import type { MLElement } from './element';
|
|
3
|
-
import type { DocumentTypeNodeType } from './types';
|
|
1
|
+
import type { MLDocument } from './document.js';
|
|
2
|
+
import type { MLElement } from './element.js';
|
|
3
|
+
import type { DocumentTypeNodeType } from './types.js';
|
|
4
4
|
import type { MLASTDoctype } from '@markuplint/ml-ast';
|
|
5
5
|
import type { PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
6
|
-
import { MLNode } from './node';
|
|
6
|
+
import { MLNode } from './node.js';
|
|
7
7
|
export declare class MLDocumentType<T extends RuleConfigValue, O extends PlainData = undefined> extends MLNode<T, O, MLASTDoctype> implements DocumentType {
|
|
8
8
|
readonly name: string;
|
|
9
9
|
readonly publicId: string;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const child_node_methods_1 = require("../manipulations/child-node-methods");
|
|
5
|
-
const node_1 = require("./node");
|
|
6
|
-
class MLDocumentType extends node_1.MLNode {
|
|
1
|
+
import { after, before, remove, replaceWith } from '../manipulations/child-node-methods.js';
|
|
2
|
+
import { MLNode } from './node.js';
|
|
3
|
+
export class MLDocumentType extends MLNode {
|
|
7
4
|
constructor(
|
|
8
5
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
9
6
|
astNode,
|
|
@@ -34,7 +31,7 @@ class MLDocumentType extends node_1.MLNode {
|
|
|
34
31
|
after(
|
|
35
32
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
36
33
|
...nodes) {
|
|
37
|
-
|
|
34
|
+
after(this, ...nodes);
|
|
38
35
|
}
|
|
39
36
|
/**
|
|
40
37
|
* @implements DOM API: `CharacterData`
|
|
@@ -42,13 +39,13 @@ class MLDocumentType extends node_1.MLNode {
|
|
|
42
39
|
before(
|
|
43
40
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
44
41
|
...nodes) {
|
|
45
|
-
|
|
42
|
+
before(this, ...nodes);
|
|
46
43
|
}
|
|
47
44
|
/**
|
|
48
45
|
* @implements DOM API: `CharacterData`
|
|
49
46
|
*/
|
|
50
47
|
remove() {
|
|
51
|
-
|
|
48
|
+
remove(this);
|
|
52
49
|
}
|
|
53
50
|
/**
|
|
54
51
|
* @implements DOM API: `CharacterData`
|
|
@@ -56,7 +53,6 @@ class MLDocumentType extends node_1.MLNode {
|
|
|
56
53
|
replaceWith(
|
|
57
54
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
58
55
|
...nodes) {
|
|
59
|
-
|
|
56
|
+
replaceWith(this, ...nodes);
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
|
-
exports.MLDocumentType = MLDocumentType;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { MLAttr } from './attr';
|
|
2
|
-
import type { MLComment } from './comment';
|
|
3
|
-
import type { MLDocumentType } from './document-type';
|
|
4
|
-
import type { MLElement } from './element';
|
|
5
|
-
import type { MLNode } from './node';
|
|
6
|
-
import type { MLText } from './text';
|
|
7
|
-
import type { DocumentNodeType } from './types';
|
|
8
|
-
import type { MLRule } from '../../ml-rule';
|
|
9
|
-
import type Ruleset from '../../ruleset';
|
|
10
|
-
import type { MLSchema } from '../../types';
|
|
11
|
-
import type { Walker } from '../helper/walkers';
|
|
12
|
-
import type { MLToken } from '../token/token';
|
|
1
|
+
import type { MLAttr } from './attr.js';
|
|
2
|
+
import type { MLComment } from './comment.js';
|
|
3
|
+
import type { MLDocumentType } from './document-type.js';
|
|
4
|
+
import type { MLElement } from './element.js';
|
|
5
|
+
import type { MLNode } from './node.js';
|
|
6
|
+
import type { MLText } from './text.js';
|
|
7
|
+
import type { DocumentNodeType } from './types.js';
|
|
8
|
+
import type { MLRule } from '../../ml-rule/index.js';
|
|
9
|
+
import type Ruleset from '../../ruleset/index.js';
|
|
10
|
+
import type { MLSchema } from '../../types.js';
|
|
11
|
+
import type { Walker } from '../helper/walkers.js';
|
|
12
|
+
import type { MLToken } from '../token/token.js';
|
|
13
13
|
import type { EndTagType, MLASTDocument } from '@markuplint/ml-ast';
|
|
14
14
|
import type { PlainData, Pretender, RuleConfigValue } from '@markuplint/ml-config';
|
|
15
15
|
import type { MLMLSpec } from '@markuplint/ml-spec';
|
|
16
|
-
import { MLParentNode } from './parent-node';
|
|
16
|
+
import { MLParentNode } from './parent-node.js';
|
|
17
17
|
export declare class MLDocument<T extends RuleConfigValue, O extends PlainData = undefined> extends MLParentNode<T, O> implements Document {
|
|
18
18
|
#private;
|
|
19
19
|
/**
|