@markuplint/ml-spec 3.5.0 → 3.6.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/dom-traverse/get-attr-specs.d.ts +1 -1
- package/lib/dom-traverse/get-computed-aria-props.d.ts +5 -5
- package/lib/dom-traverse/get-computed-aria-props.js +1 -1
- package/lib/dom-traverse/get-computed-role.js +5 -5
- package/lib/dom-traverse/get-content-model.d.ts +26 -1
- package/lib/dom-traverse/get-content-model.js +1 -1
- package/lib/dom-traverse/get-explicit-role.js +2 -1
- package/lib/dom-traverse/get-implicit-role.d.ts +5 -1
- package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +10 -4
- package/lib/dom-traverse/get-permitted-roles.d.ts +7 -3
- package/lib/dom-traverse/get-spec.d.ts +4 -1
- package/lib/dom-traverse/has-required-owned-elements.d.ts +7 -1
- package/lib/dom-traverse/is-exposed.js +3 -2
- package/lib/specs/aria-specs.d.ts +7 -4
- package/lib/specs/content-model-category-to-tag-names.d.ts +4 -1
- package/lib/specs/get-aria.d.ts +7 -1
- package/lib/specs/get-aria.js +1 -1
- package/lib/specs/get-attr-specs.d.ts +6 -2
- package/lib/specs/get-attr-specs.js +2 -14
- package/lib/specs/get-implicit-role.d.ts +7 -1
- package/lib/specs/get-permitted-roles.d.ts +9 -3
- package/lib/specs/get-permitted-roles.js +4 -4
- package/lib/specs/get-role-spec.d.ts +10 -3
- package/lib/specs/get-role-spec.js +2 -2
- package/lib/specs/get-selectors-by-content-model-category.js +1 -1
- package/lib/specs/get-spec-by-tag-name.d.ts +5 -1
- package/lib/specs/get-spec-by-tag-name.js +3 -2
- package/lib/specs/is-palpable-elements.d.ts +8 -4
- package/lib/specs/is-palpable-elements.js +3 -3
- package/lib/specs/resolve-version.d.ts +4 -1
- package/lib/specs/schema-to-spec.d.ts +3 -3
- package/lib/types/aria.d.ts +127 -113
- package/lib/types/attributes.d.ts +1490 -110
- package/lib/types/index.d.ts +172 -144
- package/lib/types/permitted-structures.d.ts +74 -35
- package/lib/utils/merge-array.d.ts +9 -4
- package/lib/utils/resolve-namespace.d.ts +4 -4
- package/lib/utils/resolve-namespace.js +1 -1
- package/package.json +3 -3
package/lib/types/index.d.ts
CHANGED
|
@@ -7,187 +7,215 @@ import type { ReadonlyDeep } from 'type-fest';
|
|
|
7
7
|
* markuplint Markup-language spec
|
|
8
8
|
*/
|
|
9
9
|
export interface MLMLSpec {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
readonly cites: Cites;
|
|
11
|
+
readonly def: SpecDefs;
|
|
12
|
+
readonly specs: readonly ElementSpec[];
|
|
13
13
|
}
|
|
14
14
|
export type ExtendedElementSpec = Partial<Omit<ElementSpec, 'name' | 'attributes'>> & {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
readonly name: ElementSpec['name'];
|
|
16
|
+
readonly attributes?: Readonly<Record<string, Partial<Attribute>>>;
|
|
17
17
|
};
|
|
18
18
|
export type ExtendedSpec = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
readonly cites?: Cites;
|
|
20
|
+
readonly def?: Partial<SpecDefs>;
|
|
21
|
+
readonly specs?: readonly ExtendedElementSpec[];
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* Reference URLs
|
|
25
25
|
*/
|
|
26
26
|
export type Cites = readonly string[];
|
|
27
27
|
export type SpecDefs = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
readonly '#globalAttrs': {
|
|
29
|
+
readonly [category: string]: Readonly<Record<string, Partial<Attribute>>>;
|
|
30
|
+
};
|
|
31
|
+
readonly '#aria': {
|
|
32
|
+
readonly '1.2': ARIASpec;
|
|
33
|
+
readonly '1.1': ARIASpec;
|
|
34
|
+
};
|
|
35
|
+
readonly '#contentModels': {
|
|
36
|
+
readonly [model in Category]?: readonly string[];
|
|
37
|
+
};
|
|
38
38
|
};
|
|
39
39
|
type ARIASpec = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
readonly roles: readonly ARIARoleInSchema[];
|
|
41
|
+
readonly graphicsRoles: readonly ARIARoleInSchema[];
|
|
42
|
+
readonly props: readonly ARIAProperty[];
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
45
|
* Element spec
|
|
46
46
|
*/
|
|
47
47
|
export type ElementSpec = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Tag name
|
|
50
|
+
*/
|
|
51
|
+
readonly name: string;
|
|
52
|
+
/**
|
|
53
|
+
* Namespaces in XML
|
|
54
|
+
* @see https://www.w3.org/TR/xml-names/
|
|
55
|
+
*/
|
|
56
|
+
readonly namespace?: NamespaceURI;
|
|
57
|
+
/**
|
|
58
|
+
* Reference URL
|
|
59
|
+
*/
|
|
60
|
+
readonly cite: string;
|
|
61
|
+
/**
|
|
62
|
+
* Description
|
|
63
|
+
*/
|
|
64
|
+
readonly description?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Experimental technology
|
|
67
|
+
*/
|
|
68
|
+
readonly experimental?: true;
|
|
69
|
+
/**
|
|
70
|
+
* Obsolete or alternative elements
|
|
71
|
+
*/
|
|
72
|
+
readonly obsolete?:
|
|
73
|
+
| true
|
|
74
|
+
| {
|
|
75
|
+
readonly alt: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Deprecated
|
|
79
|
+
*/
|
|
80
|
+
readonly deprecated?: true;
|
|
81
|
+
/**
|
|
82
|
+
* Non-standard
|
|
83
|
+
*/
|
|
84
|
+
readonly nonStandard?: true;
|
|
85
|
+
/**
|
|
86
|
+
* Element categories
|
|
87
|
+
*/
|
|
88
|
+
readonly categories: readonly Category[];
|
|
89
|
+
/**
|
|
90
|
+
* Permitted contents and permitted parents
|
|
91
|
+
*/
|
|
92
|
+
readonly contentModel: ReadonlyDeep<ContentModel>;
|
|
93
|
+
/**
|
|
94
|
+
* Tag omission
|
|
95
|
+
*/
|
|
96
|
+
readonly omission: ElementSpecOmission;
|
|
97
|
+
/**
|
|
98
|
+
* Global Attributes
|
|
99
|
+
*/
|
|
100
|
+
readonly globalAttrs: ReadonlyDeep<GlobalAttributes>;
|
|
101
|
+
/**
|
|
102
|
+
* Attributes
|
|
103
|
+
*/
|
|
104
|
+
readonly attributes: Readonly<Record<string, Attribute>>;
|
|
105
|
+
/**
|
|
106
|
+
* WAI-ARIA role and properties
|
|
107
|
+
*/
|
|
108
|
+
readonly aria: ReadonlyDeep<ARIA>;
|
|
109
|
+
/**
|
|
110
|
+
* If true, it is possible to add any properties as attributes,
|
|
111
|
+
* for example, when using a template engine or a view language.
|
|
112
|
+
*
|
|
113
|
+
* @see https://v2.vuejs.org/v2/guide/components-slots.html#Scoped-Slots
|
|
114
|
+
*
|
|
115
|
+
* **It assumes to specify it on the parser plugin.**
|
|
116
|
+
*/
|
|
117
|
+
readonly possibleToAddProperties?: true;
|
|
116
118
|
};
|
|
117
119
|
type ElementSpecOmission = false | ElementSpecOmissionTags;
|
|
118
120
|
type ElementSpecOmissionTags = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
readonly startTag: boolean | ElementCondition;
|
|
122
|
+
readonly endTag: boolean | ElementCondition;
|
|
121
123
|
};
|
|
122
124
|
type ElementCondition = {
|
|
123
|
-
|
|
125
|
+
readonly __WIP__: 'WORK_IN_PROGRESS';
|
|
124
126
|
};
|
|
125
127
|
export type Attribute = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
readonly name: string;
|
|
129
|
+
readonly type: ReadonlyDeep<AttributeType> | readonly ReadonlyDeep<AttributeType>[];
|
|
130
|
+
readonly description?: string;
|
|
131
|
+
readonly caseSensitive?: true;
|
|
132
|
+
readonly experimental?: boolean;
|
|
133
|
+
readonly obsolete?: true;
|
|
134
|
+
readonly deprecated?: boolean;
|
|
135
|
+
readonly nonStandard?: true;
|
|
134
136
|
} & ExtendableAttributeSpec;
|
|
135
137
|
type ExtendableAttributeSpec = Omit<ReadonlyDeep<AttributeJSON>, 'type'>;
|
|
136
138
|
export type ARIARole = {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
readonly name: string;
|
|
140
|
+
readonly isAbstract: boolean;
|
|
141
|
+
readonly requiredContextRole: readonly string[];
|
|
142
|
+
readonly requiredOwnedElements: readonly string[];
|
|
143
|
+
readonly accessibleNameRequired: boolean;
|
|
144
|
+
readonly accessibleNameFromAuthor: boolean;
|
|
145
|
+
readonly accessibleNameFromContent: boolean;
|
|
146
|
+
readonly accessibleNameProhibited: boolean;
|
|
147
|
+
readonly childrenPresentational: boolean;
|
|
148
|
+
readonly ownedProperties: readonly ARIARoleOwnedProperties[];
|
|
149
|
+
readonly prohibitedProperties: readonly string[];
|
|
148
150
|
};
|
|
149
|
-
export type ARIARoleInSchema = Partial<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
export type ARIARoleInSchema = Partial<
|
|
152
|
+
ARIARole & {
|
|
153
|
+
readonly description: string;
|
|
154
|
+
readonly generalization: readonly string[];
|
|
155
|
+
}
|
|
156
|
+
> & {
|
|
157
|
+
readonly name: string;
|
|
154
158
|
};
|
|
155
159
|
export type ARIARoleOwnedProperties = {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
readonly name: string;
|
|
161
|
+
readonly inherited?: true;
|
|
162
|
+
readonly required?: true;
|
|
163
|
+
readonly deprecated?: true;
|
|
160
164
|
};
|
|
161
165
|
export type ARIAProperty = {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
166
|
+
readonly name: string;
|
|
167
|
+
readonly type: 'property' | 'state';
|
|
168
|
+
readonly deprecated?: true;
|
|
169
|
+
readonly isGlobal?: true;
|
|
170
|
+
readonly value: ARIAAttributeValue;
|
|
171
|
+
readonly conditionalValue?: readonly {
|
|
172
|
+
readonly role: readonly string[];
|
|
173
|
+
readonly value: ARIAAttributeValue;
|
|
174
|
+
}[];
|
|
175
|
+
readonly enum: readonly string[];
|
|
176
|
+
readonly defaultValue?: string;
|
|
177
|
+
readonly equivalentHtmlAttrs?: readonly EquivalentHtmlAttr[];
|
|
178
|
+
readonly valueDescriptions?: Readonly<Record<string, string>>;
|
|
175
179
|
};
|
|
176
|
-
export type ARIAAttributeValue =
|
|
180
|
+
export type ARIAAttributeValue =
|
|
181
|
+
| 'true/false'
|
|
182
|
+
| 'tristate'
|
|
183
|
+
| 'true/false/undefined'
|
|
184
|
+
| 'ID reference'
|
|
185
|
+
| 'ID reference list'
|
|
186
|
+
| 'integer'
|
|
187
|
+
| 'number'
|
|
188
|
+
| 'string'
|
|
189
|
+
| 'token'
|
|
190
|
+
| 'token list'
|
|
191
|
+
| 'URI';
|
|
177
192
|
export type ARIAVersion = '1.1' | '1.2';
|
|
178
193
|
export type EquivalentHtmlAttr = {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
194
|
+
readonly htmlAttrName: string;
|
|
195
|
+
readonly isNotStrictEquivalent?: true;
|
|
196
|
+
readonly value: string | null;
|
|
182
197
|
};
|
|
183
198
|
export type Matches = (selector: string) => boolean;
|
|
184
199
|
export type ComputedRole = {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
readonly el: Element;
|
|
201
|
+
readonly role:
|
|
202
|
+
| (ARIARole & {
|
|
203
|
+
readonly superClassRoles: readonly ARIARoleInSchema[];
|
|
204
|
+
readonly isImplicit?: boolean;
|
|
205
|
+
})
|
|
206
|
+
| null;
|
|
207
|
+
readonly errorType?: RoleComputationError;
|
|
191
208
|
};
|
|
192
|
-
export type RoleComputationError =
|
|
209
|
+
export type RoleComputationError =
|
|
210
|
+
| 'ABSTRACT'
|
|
211
|
+
| 'GLOBAL_PROP_MUST_NOT_BE_PRESENTATIONAL'
|
|
212
|
+
| 'IMPLICIT_ROLE_NAMESPACE_ERROR'
|
|
213
|
+
| 'INTERACTIVE_ELEMENT_MUST_NOT_BE_PRESENTATIONAL'
|
|
214
|
+
| 'INVALID_LANDMARK'
|
|
215
|
+
| 'INVALID_REQUIRED_CONTEXT_ROLE'
|
|
216
|
+
| 'NO_EXPLICIT'
|
|
217
|
+
| 'NO_OWNER'
|
|
218
|
+
| 'NO_PERMITTED'
|
|
219
|
+
| 'REQUIRED_OWNED_ELEMENT_MUST_NOT_BE_PRESENTATIONAL'
|
|
220
|
+
| 'ROLE_NO_EXISTS';
|
|
193
221
|
export {};
|
|
@@ -3,56 +3,95 @@
|
|
|
3
3
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
4
|
* and run json-schema-to-typescript to regenerate this file.
|
|
5
5
|
*/
|
|
6
|
-
export type PermittedContentPattern =
|
|
6
|
+
export type PermittedContentPattern =
|
|
7
|
+
| PermittedContentRequire
|
|
8
|
+
| PermittedContentOptional
|
|
9
|
+
| PermittedContentOneOrMore
|
|
10
|
+
| PermittedContentZeroOrMore
|
|
11
|
+
| PermittedContentChoice
|
|
12
|
+
| PermittedContentTransparent;
|
|
7
13
|
export type Model = ContentType | ContentType[];
|
|
8
14
|
export type ContentType = string | Category;
|
|
9
|
-
export type Category =
|
|
15
|
+
export type Category =
|
|
16
|
+
| '#text'
|
|
17
|
+
| '#phrasing'
|
|
18
|
+
| '#flow'
|
|
19
|
+
| '#interactive'
|
|
20
|
+
| '#heading'
|
|
21
|
+
| '#sectioning'
|
|
22
|
+
| '#metadata'
|
|
23
|
+
| '#embedded'
|
|
24
|
+
| '#palpable'
|
|
25
|
+
| '#script-supporting'
|
|
26
|
+
| '#SVGAnimation'
|
|
27
|
+
| '#SVGBasicShapes'
|
|
28
|
+
| '#SVGContainer'
|
|
29
|
+
| '#SVGDescriptive'
|
|
30
|
+
| '#SVGFilterPrimitive'
|
|
31
|
+
| '#SVGFont'
|
|
32
|
+
| '#SVGGradient'
|
|
33
|
+
| '#SVGGraphics'
|
|
34
|
+
| '#SVGGraphicsReferencing'
|
|
35
|
+
| '#SVGLightSource'
|
|
36
|
+
| '#SVGNeverRendered'
|
|
37
|
+
| '#SVGNone'
|
|
38
|
+
| '#SVGPaintServer'
|
|
39
|
+
| '#SVGRenderable'
|
|
40
|
+
| '#SVGShape'
|
|
41
|
+
| '#SVGStructural'
|
|
42
|
+
| '#SVGStructurallyExternal'
|
|
43
|
+
| '#SVGTextContent'
|
|
44
|
+
| '#SVGTextContentChild';
|
|
10
45
|
export interface ContentModelsSchema {
|
|
11
|
-
|
|
46
|
+
__contentModel?: ContentModel;
|
|
12
47
|
}
|
|
13
48
|
export interface ContentModel {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
49
|
+
contents: PermittedContentPattern[] | boolean;
|
|
50
|
+
descendantOf?: string;
|
|
51
|
+
conditional?: {
|
|
52
|
+
condition: string;
|
|
53
|
+
contents: PermittedContentPattern[] | boolean;
|
|
54
|
+
}[];
|
|
20
55
|
}
|
|
21
56
|
export interface PermittedContentRequire {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
57
|
+
require: Model | PermittedContentPattern[];
|
|
58
|
+
max?: number;
|
|
59
|
+
min?: number;
|
|
60
|
+
_TODO_?: string;
|
|
26
61
|
}
|
|
27
62
|
export interface PermittedContentOptional {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
63
|
+
optional: Model | PermittedContentPattern[];
|
|
64
|
+
max?: number;
|
|
65
|
+
_TODO_?: string;
|
|
31
66
|
}
|
|
32
67
|
export interface PermittedContentOneOrMore {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
68
|
+
oneOrMore: Model | PermittedContentPattern[];
|
|
69
|
+
max?: number;
|
|
70
|
+
_TODO_?: string;
|
|
36
71
|
}
|
|
37
72
|
export interface PermittedContentZeroOrMore {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
73
|
+
zeroOrMore: Model | PermittedContentPattern[];
|
|
74
|
+
max?: number;
|
|
75
|
+
_TODO_?: string;
|
|
41
76
|
}
|
|
42
77
|
export interface PermittedContentChoice {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
/**
|
|
79
|
+
* @minItems 2
|
|
80
|
+
* @maxItems 5
|
|
81
|
+
*/
|
|
82
|
+
choice:
|
|
83
|
+
| [PermittedContentPattern[], PermittedContentPattern[]]
|
|
84
|
+
| [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
|
|
85
|
+
| [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
|
|
86
|
+
| [
|
|
87
|
+
PermittedContentPattern[],
|
|
88
|
+
PermittedContentPattern[],
|
|
89
|
+
PermittedContentPattern[],
|
|
90
|
+
PermittedContentPattern[],
|
|
91
|
+
PermittedContentPattern[],
|
|
92
|
+
];
|
|
93
|
+
_TODO_?: string;
|
|
55
94
|
}
|
|
56
95
|
export interface PermittedContentTransparent {
|
|
57
|
-
|
|
96
|
+
transparent: string;
|
|
58
97
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
type NamedDefinition =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type NamedDefinition =
|
|
2
|
+
| string
|
|
3
|
+
| {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function mergeArray<T extends NamedDefinition>(
|
|
7
|
+
a: readonly T[],
|
|
8
|
+
b: readonly T[] | null | undefined,
|
|
9
|
+
): readonly T[];
|
|
5
10
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { NamespaceURI, Namespace } from '@markuplint/ml-ast';
|
|
2
2
|
type NamespacedElementName = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
localNameWithNS: string;
|
|
4
|
+
localName: string;
|
|
5
|
+
namespace: Namespace;
|
|
6
|
+
namespaceURI: NamespaceURI;
|
|
7
7
|
};
|
|
8
8
|
export declare function resolveNamespace(name: string, namespaceURI?: string | null): NamespacedElementName;
|
|
9
9
|
export {};
|
|
@@ -18,7 +18,7 @@ function resolveNamespace(name, namespaceURI = 'http://www.w3.org/1999/xhtml') {
|
|
|
18
18
|
const [_explicitNS, _localName] = name.split(':');
|
|
19
19
|
const explicitNS = _localName ? _explicitNS : null;
|
|
20
20
|
const localName = (_a = _localName !== null && _localName !== void 0 ? _localName : _explicitNS) !== null && _a !== void 0 ? _a : '';
|
|
21
|
-
const namespace = ['html', 'svg', 'mml', 'xlink'].find(_ns => _ns === (explicitNS || (0, get_ns_1.getNS)(namespaceURI
|
|
21
|
+
const namespace = ['html', 'svg', 'mml', 'xlink'].find(_ns => _ns === (explicitNS || (0, get_ns_1.getNS)(namespaceURI !== null && namespaceURI !== void 0 ? namespaceURI : null))) ||
|
|
22
22
|
'html';
|
|
23
23
|
const result = {
|
|
24
24
|
localNameWithNS: `${namespace === 'html' ? '' : `${namespace}:`}${localName}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/ml-spec",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Types and schema that specs of the Markup languages for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@markuplint/test-tools": "3.1.0",
|
|
35
|
-
"@markuplint/types": "3.
|
|
35
|
+
"@markuplint/types": "3.5.1",
|
|
36
36
|
"json-schema-to-typescript": "11.0.2",
|
|
37
37
|
"type-fest": "^3.6.1"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "3cdf5a088b2da03773d5d4461d0e65ec32290a00"
|
|
40
40
|
}
|