@markuplint/ml-core 2.2.2 → 2.3.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.
Files changed (60) hide show
  1. package/lib/ml-core.d.ts +1 -1
  2. package/lib/ml-dom/helper/accname.js +1 -0
  3. package/lib/ml-dom/helper/selector.d.ts +1 -1
  4. package/lib/ml-dom/manipulations/child-node-methods.d.ts +33 -0
  5. package/lib/ml-dom/manipulations/child-node-methods.js +73 -0
  6. package/lib/ml-dom/manipulations/get-children.d.ts +4 -0
  7. package/lib/ml-dom/manipulations/get-children.js +10 -0
  8. package/lib/ml-dom/node/attr.d.ts +93 -0
  9. package/lib/ml-dom/node/attr.js +144 -0
  10. package/lib/ml-dom/node/block.d.ts +38 -0
  11. package/lib/ml-dom/node/block.js +53 -0
  12. package/lib/ml-dom/node/character-data.d.ts +57 -0
  13. package/lib/ml-dom/node/character-data.js +87 -0
  14. package/lib/ml-dom/node/child-node.d.ts +9 -0
  15. package/lib/ml-dom/node/child-node.js +10 -0
  16. package/lib/ml-dom/node/comment.d.ts +17 -0
  17. package/lib/ml-dom/node/comment.js +24 -0
  18. package/lib/ml-dom/node/document-fragment.d.ts +24 -0
  19. package/lib/ml-dom/node/document-fragment.js +33 -0
  20. package/lib/ml-dom/node/document-type.d.ts +38 -0
  21. package/lib/ml-dom/node/document-type.js +52 -0
  22. package/lib/ml-dom/node/document.d.ts +1554 -0
  23. package/lib/ml-dom/node/document.js +2117 -0
  24. package/lib/ml-dom/node/dom-token-list.d.ts +15 -0
  25. package/lib/ml-dom/node/dom-token-list.js +61 -0
  26. package/lib/ml-dom/node/element.d.ts +1832 -0
  27. package/lib/ml-dom/node/element.js +2483 -0
  28. package/lib/ml-dom/node/named-node-map.d.ts +42 -0
  29. package/lib/ml-dom/node/named-node-map.js +64 -0
  30. package/lib/ml-dom/node/node-list.d.ts +6 -0
  31. package/lib/ml-dom/node/node-list.js +39 -0
  32. package/lib/ml-dom/node/node-store.d.ts +14 -0
  33. package/lib/ml-dom/node/node-store.js +32 -0
  34. package/lib/ml-dom/node/node.d.ts +475 -0
  35. package/lib/ml-dom/node/node.js +672 -0
  36. package/lib/ml-dom/node/parent-node.d.ts +66 -0
  37. package/lib/ml-dom/node/parent-node.js +131 -0
  38. package/lib/ml-dom/node/rule-mapper.d.ts +17 -0
  39. package/lib/ml-dom/node/rule-mapper.js +49 -0
  40. package/lib/ml-dom/node/text.d.ts +51 -0
  41. package/lib/ml-dom/node/text.js +76 -0
  42. package/lib/ml-dom/node/types.d.ts +25 -0
  43. package/lib/ml-dom/node/types.js +2 -0
  44. package/lib/ml-dom/node/unexpected-call-error.d.ts +1 -0
  45. package/lib/ml-dom/node/unexpected-call-error.js +5 -0
  46. package/lib/ml-dom/token/token.d.ts +47 -0
  47. package/lib/ml-dom/token/token.js +89 -0
  48. package/lib/ml-dom/tokens/abstract-element.d.ts +1 -2
  49. package/lib/ml-dom/tokens/abstract-element.js +0 -4
  50. package/lib/ml-dom/tokens/node.d.ts +1 -0
  51. package/lib/ml-dom/tokens/node.js +8 -0
  52. package/lib/selector/is-pure-html-element.d.ts +1 -0
  53. package/lib/selector/is-pure-html-element.js +7 -0
  54. package/lib/selector/match-selector.d.ts +14 -0
  55. package/lib/selector/match-selector.js +230 -0
  56. package/lib/selector/selector.d.ts +9 -0
  57. package/lib/selector/selector.js +561 -0
  58. package/lib/utils/get-location-from-chars.d.ts +9 -4
  59. package/package.json +6 -6
  60. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MLComment = void 0;
4
+ const character_data_1 = require("./character-data");
5
+ class MLComment extends character_data_1.MLCharacterData {
6
+ /**
7
+ * Returns a string appropriate for the type of node as `Attr`
8
+ *
9
+ * @see https://dom.spec.whatwg.org/#ref-for-exclusive-text-node%E2%91%A0
10
+ */
11
+ get nodeName() {
12
+ return '#comment';
13
+ }
14
+ /**
15
+ * Returns a number appropriate for the type of `Comment`
16
+ */
17
+ get nodeType() {
18
+ return this.COMMENT_NODE;
19
+ }
20
+ get textContent() {
21
+ return this.nodeValue;
22
+ }
23
+ }
24
+ exports.MLComment = MLComment;
@@ -0,0 +1,24 @@
1
+ import type { DocumentFragmentNodeType } from './types';
2
+ import type { MLASTAbstructNode } from '@markuplint/ml-ast';
3
+ import type { RuleConfigValue } from '@markuplint/ml-config';
4
+ import { MLParentNode } from './parent-node';
5
+ export declare class MLDocumentFragment<T extends RuleConfigValue, O = null> extends MLParentNode<T, O, MLASTAbstructNode> implements DocumentFragment {
6
+ /**
7
+ * Returns a string appropriate for the type of node as `DocumentFragment`
8
+ *
9
+ * @see https://dom.spec.whatwg.org/#ref-for-documentfragment%E2%91%A0%E2%91%A6
10
+ */
11
+ get nodeName(): "#document-fragment";
12
+ /**
13
+ * Returns a number appropriate for the type of `DocumentFragment`
14
+ */
15
+ get nodeType(): DocumentFragmentNodeType;
16
+ /**
17
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
18
+ *
19
+ * @deprecated
20
+ * @unsupported
21
+ * @implements DOM API: `DocumentFragment`
22
+ */
23
+ getElementById(elementId: string): HTMLElement | null;
24
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MLDocumentFragment = void 0;
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 {
8
+ /**
9
+ * Returns a string appropriate for the type of node as `DocumentFragment`
10
+ *
11
+ * @see https://dom.spec.whatwg.org/#ref-for-documentfragment%E2%91%A0%E2%91%A6
12
+ */
13
+ get nodeName() {
14
+ return '#document-fragment';
15
+ }
16
+ /**
17
+ * Returns a number appropriate for the type of `DocumentFragment`
18
+ */
19
+ get nodeType() {
20
+ return this.DOCUMENT_FRAGMENT_NODE;
21
+ }
22
+ /**
23
+ * **IT THROWS AN ERROR WHEN CALLING THIS.**
24
+ *
25
+ * @deprecated
26
+ * @unsupported
27
+ * @implements DOM API: `DocumentFragment`
28
+ */
29
+ getElementById(elementId) {
30
+ throw new unexpected_call_error_1.default('Not supported "getElementById" method');
31
+ }
32
+ }
33
+ exports.MLDocumentFragment = MLDocumentFragment;
@@ -0,0 +1,38 @@
1
+ import type { MLDocument } from './document';
2
+ import type { MLElement } from './element';
3
+ import type { DocumentTypeNodeType } from './types';
4
+ import type { MLASTDoctype } from '@markuplint/ml-ast';
5
+ import type { RuleConfigValue } from '@markuplint/ml-config';
6
+ import { MLNode } from './node';
7
+ export declare class MLDocumentType<T extends RuleConfigValue, O = null> extends MLNode<T, O, MLASTDoctype> implements DocumentType {
8
+ readonly name: string;
9
+ readonly publicId: string;
10
+ readonly systemId: string;
11
+ /**
12
+ * Returns a string appropriate for the type of node as `DocumentType`
13
+ *
14
+ * @see https://dom.spec.whatwg.org/#ref-for-documenttype%E2%91%A0%E2%93%AA
15
+ */
16
+ get nodeName(): string;
17
+ /**
18
+ * Returns a number appropriate for the type of `DocumentType`
19
+ */
20
+ get nodeType(): DocumentTypeNodeType;
21
+ constructor(astNode: MLASTDoctype, document: MLDocument<T, O>);
22
+ /**
23
+ * @implements DOM API: `CharacterData`
24
+ */
25
+ after(...nodes: (string | MLElement<any, any>)[]): void;
26
+ /**
27
+ * @implements DOM API: `CharacterData`
28
+ */
29
+ before(...nodes: (string | MLElement<any, any>)[]): void;
30
+ /**
31
+ * @implements DOM API: `CharacterData`
32
+ */
33
+ remove(): void;
34
+ /**
35
+ * @implements DOM API: `CharacterData`
36
+ */
37
+ replaceWith(...nodes: (string | MLElement<any, any>)[]): void;
38
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MLDocumentType = void 0;
4
+ const child_node_methods_1 = require("../manipulations/child-node-methods");
5
+ const node_1 = require("./node");
6
+ class MLDocumentType extends node_1.MLNode {
7
+ constructor(astNode, document) {
8
+ super(astNode, document);
9
+ this.name = astNode.name;
10
+ this.publicId = astNode.publicId;
11
+ this.systemId = astNode.systemId;
12
+ }
13
+ /**
14
+ * Returns a string appropriate for the type of node as `DocumentType`
15
+ *
16
+ * @see https://dom.spec.whatwg.org/#ref-for-documenttype%E2%91%A0%E2%93%AA
17
+ */
18
+ get nodeName() {
19
+ return this.name;
20
+ }
21
+ /**
22
+ * Returns a number appropriate for the type of `DocumentType`
23
+ */
24
+ get nodeType() {
25
+ return this.DOCUMENT_TYPE_NODE;
26
+ }
27
+ /**
28
+ * @implements DOM API: `CharacterData`
29
+ */
30
+ after(...nodes) {
31
+ (0, child_node_methods_1.after)(this, ...nodes);
32
+ }
33
+ /**
34
+ * @implements DOM API: `CharacterData`
35
+ */
36
+ before(...nodes) {
37
+ (0, child_node_methods_1.before)(this, ...nodes);
38
+ }
39
+ /**
40
+ * @implements DOM API: `CharacterData`
41
+ */
42
+ remove() {
43
+ (0, child_node_methods_1.remove)(this);
44
+ }
45
+ /**
46
+ * @implements DOM API: `CharacterData`
47
+ */
48
+ replaceWith(...nodes) {
49
+ (0, child_node_methods_1.replaceWith)(this, ...nodes);
50
+ }
51
+ }
52
+ exports.MLDocumentType = MLDocumentType;