@markuplint/ml-spec 2.0.0-dev.26 → 2.0.0-rc.5
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/attributes.d.ts +77 -11
- package/lib/get-attr-specs.d.ts +7 -0
- package/lib/get-attr-specs.js +95 -0
- package/lib/get-spec-by-tag-name.js +11 -3
- package/lib/get-spec.js +22 -5
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/permitted-structres.d.ts +12 -0
- package/lib/types.d.ts +25 -13
- package/package.json +6 -4
- package/schemas/attributes.schema.json +168 -181
- package/schemas/global-attributes.schema.json +749 -6
- package/schemas/permitted-structures.schema.json +19 -7
- package/src/attributes.ts +1393 -108
- package/src/get-attr-specs.spec.ts +44 -0
- package/src/get-attr-specs.ts +111 -0
- package/src/get-spec-by-tag-name.ts +14 -6
- package/src/get-spec.spec.ts +10 -17
- package/src/get-spec.ts +27 -6
- package/src/index.ts +1 -0
- package/src/permitted-structres.ts +12 -0
- package/src/types.ts +30 -13
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,235 +1,222 @@
|
|
|
1
1
|
{
|
|
2
2
|
"definitions": {
|
|
3
|
+
"AttributeName": { "type": "string", "pattern": "^(?:(xml|xlink):)?[a-z][a-zA-Z0-9-]*$" },
|
|
3
4
|
"AttributeCondition": {
|
|
4
5
|
"oneOf": [
|
|
5
6
|
{
|
|
6
7
|
"type": "object",
|
|
7
8
|
"additionalProperties": false,
|
|
8
9
|
"required": ["ancestor"],
|
|
9
|
-
"properties": {
|
|
10
|
-
"ancestor": {
|
|
11
|
-
"type": "string"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
10
|
+
"properties": { "ancestor": { "$ref": "#/definitions/Selectors" } }
|
|
14
11
|
},
|
|
15
12
|
{
|
|
16
13
|
"type": "object",
|
|
17
14
|
"additionalProperties": false,
|
|
18
15
|
"required": ["self"],
|
|
19
|
-
"properties": {
|
|
20
|
-
"self": {
|
|
21
|
-
"type": ["string", "array"],
|
|
22
|
-
"items": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"minItems": 2
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
16
|
+
"properties": { "self": { "$ref": "#/definitions/Selectors" } }
|
|
28
17
|
}
|
|
29
18
|
]
|
|
30
19
|
},
|
|
31
|
-
"
|
|
32
|
-
"oneOf": [
|
|
33
|
-
{
|
|
34
|
-
"type": "string",
|
|
35
|
-
"enum": [
|
|
36
|
-
"String",
|
|
37
|
-
"NonEmptyString",
|
|
38
|
-
"Boolean",
|
|
39
|
-
"Function",
|
|
40
|
-
"Date",
|
|
41
|
-
"Int",
|
|
42
|
-
"Uint",
|
|
43
|
-
"Float",
|
|
44
|
-
"NonZeroUint",
|
|
45
|
-
"ZeroToOne",
|
|
46
|
-
"AcceptList",
|
|
47
|
-
"AutoComplete",
|
|
48
|
-
"BCP47",
|
|
49
|
-
"Color",
|
|
50
|
-
"ColSpan",
|
|
51
|
-
"Coords",
|
|
52
|
-
"Crossorigin",
|
|
53
|
-
"DateTime",
|
|
54
|
-
"Destination",
|
|
55
|
-
"DOMID",
|
|
56
|
-
"DOMIDList",
|
|
57
|
-
"IRI",
|
|
58
|
-
"ItemType",
|
|
59
|
-
"LinkSizes",
|
|
60
|
-
"LinkType",
|
|
61
|
-
"LinkTypeList",
|
|
62
|
-
"MediaQuery",
|
|
63
|
-
"MediaQueryList",
|
|
64
|
-
"MIMEType",
|
|
65
|
-
"ReferrerPolicy",
|
|
66
|
-
"RowSpan",
|
|
67
|
-
"SourceSizeList",
|
|
68
|
-
"SrcSet",
|
|
69
|
-
"TabIndex",
|
|
70
|
-
"Target",
|
|
71
|
-
"URL",
|
|
72
|
-
"URLHash",
|
|
73
|
-
"URLList",
|
|
74
|
-
"CSSAngle",
|
|
75
|
-
"CSSBlendMode",
|
|
76
|
-
"CSSClipPath",
|
|
77
|
-
"CSSCustomIdent",
|
|
78
|
-
"CSSDisplay",
|
|
79
|
-
"CSSFilter",
|
|
80
|
-
"CSSFontFamily",
|
|
81
|
-
"CSSFontSize",
|
|
82
|
-
"CSSFontVariant",
|
|
83
|
-
"CSSFontWeight",
|
|
84
|
-
"CSSMask",
|
|
85
|
-
"CSSOpacity",
|
|
86
|
-
"CSSTextDecoration",
|
|
87
|
-
"CSSTransformList",
|
|
88
|
-
"CSSTransformOrigin",
|
|
89
|
-
"CSSURL",
|
|
90
|
-
"SVGAnimatableValue",
|
|
91
|
-
"SVGBeginValueList",
|
|
92
|
-
"SVGClockValue",
|
|
93
|
-
"SVGColorMatrix",
|
|
94
|
-
"SVGDashArray",
|
|
95
|
-
"SVGEndValueList",
|
|
96
|
-
"SVGFilterPrimitiveReference",
|
|
97
|
-
"SVGKernelMatrix",
|
|
98
|
-
"SVGKeyPoints",
|
|
99
|
-
"SVGKeySplines",
|
|
100
|
-
"SVGKeyTimes",
|
|
101
|
-
"SVGLanguageTags",
|
|
102
|
-
"SVGLength",
|
|
103
|
-
"SVGLengthList",
|
|
104
|
-
"SVGNumberList",
|
|
105
|
-
"SVGNumberOptionalNumber",
|
|
106
|
-
"SVGOrigin",
|
|
107
|
-
"SVGPaint",
|
|
108
|
-
"SVGPathCommands",
|
|
109
|
-
"SVGPercentage",
|
|
110
|
-
"SVGPercentageList",
|
|
111
|
-
"SVGPoints",
|
|
112
|
-
"SVGPreserveAspectRatio",
|
|
113
|
-
"SVGViewBox"
|
|
114
|
-
]
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"type": "object",
|
|
118
|
-
"additionalProperties": false,
|
|
119
|
-
"required": ["enum"],
|
|
120
|
-
"properties": {
|
|
121
|
-
"enum": {
|
|
122
|
-
"type": "array",
|
|
123
|
-
"minLength": 1,
|
|
124
|
-
"uniqueItems": true,
|
|
125
|
-
"items": {
|
|
126
|
-
"type": "string"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
]
|
|
20
|
+
"Selectors": {
|
|
21
|
+
"oneOf": [{ "type": "string" }, { "type": "array", "minItems": 2, "items": { "type": "string" } }]
|
|
132
22
|
},
|
|
23
|
+
"AttributeType": { "$ref": "../../types/types.schema.json#/definitions/type" },
|
|
133
24
|
"AttributeJSON": {
|
|
134
25
|
"type": "object",
|
|
135
26
|
"additionalProperties": false,
|
|
136
|
-
"required": ["
|
|
27
|
+
"required": ["ref"],
|
|
28
|
+
"minProperties": 2,
|
|
137
29
|
"properties": {
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
},
|
|
30
|
+
"_TODO_": { "type": "string" },
|
|
31
|
+
"ref": { "type": "string", "format": "uri" },
|
|
141
32
|
"type": {
|
|
142
33
|
"oneOf": [
|
|
143
|
-
{
|
|
144
|
-
"$ref": "#/definitions/AttributeType"
|
|
145
|
-
},
|
|
34
|
+
{ "$ref": "#/definitions/AttributeType" },
|
|
146
35
|
{
|
|
147
36
|
"type": "array",
|
|
148
37
|
"minItems": 1,
|
|
149
38
|
"uniqueItems": true,
|
|
150
|
-
"items": {
|
|
151
|
-
"$ref": "#/definitions/AttributeType"
|
|
152
|
-
}
|
|
39
|
+
"items": { "$ref": "#/definitions/AttributeType" }
|
|
153
40
|
}
|
|
154
41
|
]
|
|
155
42
|
},
|
|
156
43
|
"defaultValue": { "type": "string" },
|
|
157
44
|
"deprecated": { "type": "boolean" },
|
|
158
|
-
"required": {
|
|
45
|
+
"required": { "oneOf": [{ "type": "boolean" }, { "$ref": "#/definitions/AttributeCondition" }] },
|
|
46
|
+
"requiredEither": { "type": "array", "items": { "type": "string" } },
|
|
47
|
+
"noUse": { "type": "boolean" },
|
|
48
|
+
"condition": { "$ref": "#/definitions/AttributeCondition" },
|
|
49
|
+
"ineffective": { "$ref": "#/definitions/Selectors" },
|
|
50
|
+
"animatable": { "type": "boolean" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"GlobalAttributes": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"propertyNames": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": [
|
|
59
|
+
"#HTMLGlobalAttrs",
|
|
60
|
+
"#GlobalEventAttrs",
|
|
61
|
+
"#DocumentElementEventAttrs",
|
|
62
|
+
"#HTMLLinkAndFetchingAttrs",
|
|
63
|
+
"#HTMLEmbededAndMediaContentAttrs",
|
|
64
|
+
"#HTMLFormControlElementAttrs",
|
|
65
|
+
"#HTMLTableCellElementAttrs",
|
|
66
|
+
"#ARIAAttrs",
|
|
67
|
+
"#SVGAnimationAdditionAttrs",
|
|
68
|
+
"#SVGAnimationAttributeTargetAttrs",
|
|
69
|
+
"#SVGAnimationEventAttrs",
|
|
70
|
+
"#SVGAnimationTargetElementAttrs",
|
|
71
|
+
"#SVGAnimationTimingAttrs",
|
|
72
|
+
"#SVGAnimationValueAttrs",
|
|
73
|
+
"#SVGConditionalProcessingAttrs",
|
|
74
|
+
"#SVGCoreAttrs",
|
|
75
|
+
"#SVGFilterPrimitiveAttrs",
|
|
76
|
+
"#SVGPresentationAttrs",
|
|
77
|
+
"#SVGTransferFunctionAttrs",
|
|
78
|
+
"#XLinkAttrs"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"properties": {
|
|
82
|
+
"#HTMLGlobalAttrs": { "type": "boolean" },
|
|
83
|
+
"#GlobalEventAttrs": {
|
|
159
84
|
"oneOf": [
|
|
85
|
+
{ "type": "boolean" },
|
|
160
86
|
{
|
|
161
|
-
"type": "
|
|
162
|
-
|
|
87
|
+
"type": "array",
|
|
88
|
+
"minItems": 0,
|
|
89
|
+
"uniqueItems": true,
|
|
90
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/GlobalEventAttrs" }
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"#DocumentElementEventAttrs": {
|
|
95
|
+
"oneOf": [
|
|
96
|
+
{ "type": "boolean" },
|
|
163
97
|
{
|
|
164
|
-
"
|
|
98
|
+
"type": "array",
|
|
99
|
+
"minItems": 0,
|
|
100
|
+
"uniqueItems": true,
|
|
101
|
+
"items": {
|
|
102
|
+
"$ref": "./global-attributes.schema.json#/definitions/DocumentElementEventAttrs"
|
|
103
|
+
}
|
|
165
104
|
}
|
|
166
105
|
]
|
|
167
106
|
},
|
|
168
|
-
"
|
|
107
|
+
"#HTMLLinkAndFetchingAttrs": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"minItems": 0,
|
|
110
|
+
"uniqueItems": true,
|
|
111
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/HTMLLinkAndFetchingAttrs" }
|
|
112
|
+
},
|
|
113
|
+
"#HTMLEmbededAndMediaContentAttrs": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"minItems": 0,
|
|
116
|
+
"uniqueItems": true,
|
|
117
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/HTMLEmbededAndMediaContentAttrs" }
|
|
118
|
+
},
|
|
119
|
+
"#HTMLFormControlElementAttrs": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"minItems": 0,
|
|
122
|
+
"uniqueItems": true,
|
|
123
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/HTMLFormControlElementAttrs" }
|
|
124
|
+
},
|
|
125
|
+
"#HTMLTableCellElementAttrs": {
|
|
126
|
+
"type": "array",
|
|
127
|
+
"minItems": 0,
|
|
128
|
+
"uniqueItems": true,
|
|
129
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/HTMLTableCellElementAttrs" }
|
|
130
|
+
},
|
|
131
|
+
"#ARIAAttrs": { "type": "boolean" },
|
|
132
|
+
"#SVGAnimationAdditionAttrs": {
|
|
169
133
|
"type": "array",
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
}
|
|
134
|
+
"minItems": 0,
|
|
135
|
+
"uniqueItems": true,
|
|
136
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGAnimationAdditionAttrs" }
|
|
173
137
|
},
|
|
174
|
-
"
|
|
175
|
-
"type": "
|
|
138
|
+
"#SVGAnimationAttributeTargetAttrs": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"minItems": 0,
|
|
141
|
+
"uniqueItems": true,
|
|
142
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGAnimationAttributeTargetAttrs" }
|
|
176
143
|
},
|
|
177
|
-
"
|
|
178
|
-
"
|
|
144
|
+
"#SVGAnimationEventAttrs": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"minItems": 0,
|
|
147
|
+
"uniqueItems": true,
|
|
148
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGAnimationEventAttrs" }
|
|
149
|
+
},
|
|
150
|
+
"#SVGAnimationTargetElementAttrs": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"minItems": 0,
|
|
153
|
+
"uniqueItems": true,
|
|
154
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGAnimationTargetElementAttrs" }
|
|
155
|
+
},
|
|
156
|
+
"#SVGAnimationTimingAttrs": {
|
|
157
|
+
"type": "array",
|
|
158
|
+
"minItems": 0,
|
|
159
|
+
"uniqueItems": true,
|
|
160
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGAnimationTimingAttrs" }
|
|
161
|
+
},
|
|
162
|
+
"#SVGAnimationValueAttrs": {
|
|
163
|
+
"type": "array",
|
|
164
|
+
"minItems": 0,
|
|
165
|
+
"uniqueItems": true,
|
|
166
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGAnimationValueAttrs" }
|
|
167
|
+
},
|
|
168
|
+
"#SVGConditionalProcessingAttrs": {
|
|
169
|
+
"type": "array",
|
|
170
|
+
"minItems": 0,
|
|
171
|
+
"uniqueItems": true,
|
|
172
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGConditionalProcessingAttrs" }
|
|
173
|
+
},
|
|
174
|
+
"#SVGCoreAttrs": {
|
|
175
|
+
"type": "array",
|
|
176
|
+
"minItems": 0,
|
|
177
|
+
"uniqueItems": true,
|
|
178
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGCoreAttrs" }
|
|
179
|
+
},
|
|
180
|
+
"#SVGFilterPrimitiveAttrs": {
|
|
181
|
+
"type": "array",
|
|
182
|
+
"minItems": 0,
|
|
183
|
+
"uniqueItems": true,
|
|
184
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGFilterPrimitiveAttrs" }
|
|
185
|
+
},
|
|
186
|
+
"#SVGPresentationAttrs": {
|
|
187
|
+
"type": "array",
|
|
188
|
+
"minItems": 0,
|
|
189
|
+
"uniqueItems": true,
|
|
190
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGPresentationAttrs" }
|
|
191
|
+
},
|
|
192
|
+
"#SVGTransferFunctionAttrs": {
|
|
193
|
+
"type": "array",
|
|
194
|
+
"minItems": 0,
|
|
195
|
+
"uniqueItems": true,
|
|
196
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/SVGTransferFunctionAttrs" }
|
|
197
|
+
},
|
|
198
|
+
"#XLinkAttrs": {
|
|
199
|
+
"type": "array",
|
|
200
|
+
"minItems": 0,
|
|
201
|
+
"uniqueItems": true,
|
|
202
|
+
"items": { "$ref": "./global-attributes.schema.json#/definitions/XLinkAttrs" }
|
|
179
203
|
}
|
|
180
204
|
}
|
|
181
205
|
},
|
|
182
|
-
"
|
|
206
|
+
"Attributes": {
|
|
183
207
|
"type": "object",
|
|
184
208
|
"additionalProperties": false,
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"name": { "type": "string" },
|
|
188
|
-
"defaultValue": { "type": "string" }
|
|
189
|
-
}
|
|
209
|
+
"propertyNames": { "$ref": "#/definitions/AttributeName" },
|
|
210
|
+
"patternProperties": { ".*": { "$ref": "#/definitions/AttributeJSON" } }
|
|
190
211
|
}
|
|
191
212
|
},
|
|
192
213
|
"type": "object",
|
|
193
214
|
"additionalProperties": false,
|
|
194
|
-
"required": ["tag", "attributes"],
|
|
215
|
+
"required": ["tag", "ref", "attributes"],
|
|
195
216
|
"properties": {
|
|
196
217
|
"tag": { "type": "string" },
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"items": {
|
|
201
|
-
"anyOf": [
|
|
202
|
-
{
|
|
203
|
-
"type": "string",
|
|
204
|
-
"enum": [
|
|
205
|
-
"#globalAttrs",
|
|
206
|
-
"#ariaAttrs",
|
|
207
|
-
"#SVGAnimationAdditionAttrs",
|
|
208
|
-
"#SVGAnimationAttributeTargetAttrs",
|
|
209
|
-
"#SVGAnimationEventAttrs",
|
|
210
|
-
"#SVGAnimationTargetElementAttrs",
|
|
211
|
-
"#SVGAnimationTimingAttrs",
|
|
212
|
-
"#SVGAnimationValueAttrs",
|
|
213
|
-
"#SVGConditionalProcessingAttrs",
|
|
214
|
-
"#SVGCoreAttrs",
|
|
215
|
-
"#SVGDocumentElementEventAttrs",
|
|
216
|
-
"#SVGDocumentEventAttrs",
|
|
217
|
-
"#SVGFilterPrimitiveAttrs",
|
|
218
|
-
"#SVGGlobalEventAttrs",
|
|
219
|
-
"#SVGGraphicalEventAttrs",
|
|
220
|
-
"#SVGPresentationAttrs",
|
|
221
|
-
"#SVGTransferFunctionAttrs",
|
|
222
|
-
"#XLinkAttrs"
|
|
223
|
-
]
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
"$ref": "#/definitions/AttributeJSON"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"$ref": "#/definitions/DefineDefaultAttributeType"
|
|
230
|
-
}
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
}
|
|
218
|
+
"ref": { "type": "string", "format": "uri" },
|
|
219
|
+
"global": { "$ref": "#/definitions/GlobalAttributes" },
|
|
220
|
+
"attributes": { "$ref": "#/definitions/Attributes" }
|
|
234
221
|
}
|
|
235
222
|
}
|