|
12 | 12 | "name": { |
13 | 13 | "type": "string", |
14 | 14 | "enum": [ |
15 | | - "#text", |
16 | 15 | "circle", |
17 | 16 | "clipPath", |
18 | 17 | "defs", |
|
71 | 70 | "view" |
72 | 71 | ] |
73 | 72 | }, |
| 73 | + "type": { |
| 74 | + "type": "string", |
| 75 | + "enum": [ |
| 76 | + "element", |
| 77 | + "text", |
| 78 | + "component", |
| 79 | + "variable" |
| 80 | + ] |
| 81 | + }, |
74 | 82 | "value": { |
75 | 83 | "type": "string" |
76 | 84 | }, |
|
86 | 94 | }, |
87 | 95 | "required": ["name"] |
88 | 96 | }, |
| 97 | + "colorAttribute": { |
| 98 | + "anyOf": [ |
| 99 | + { |
| 100 | + "type": "string", |
| 101 | + "pattern": "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$" |
| 102 | + }, |
| 103 | + { |
| 104 | + "type": "string", |
| 105 | + "pattern": "^rgba?\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$" |
| 106 | + }, |
| 107 | + { |
| 108 | + "type": "string", |
| 109 | + "pattern": "^hsla?\\(\\s*\\d+\\s*,\\s*\\d+%\\s*,\\s*\\d+%\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$" |
| 110 | + }, |
| 111 | + { |
| 112 | + "type": "string", |
| 113 | + "pattern": "^hsba?\\(\\s*\\d+\\s*,\\s*\\d+%\\s*,\\s*\\d+%\\s*(,\\s*[0-1](\\.\\d+)?\\s*)?\\)$" |
| 114 | + }, |
| 115 | + { |
| 116 | + "type": "object", |
| 117 | + "properties": { |
| 118 | + "type": { |
| 119 | + "type": "string", |
| 120 | + "enum": [ |
| 121 | + "color" |
| 122 | + ] |
| 123 | + }, |
| 124 | + "value": { |
| 125 | + "type": "string" |
| 126 | + } |
| 127 | + }, |
| 128 | + "required": ["type", "value"] |
| 129 | + } |
| 130 | + ] |
| 131 | + }, |
89 | 132 | "attributes": { |
90 | 133 | "type": "object", |
91 | 134 | "properties": { |
|
99 | 142 | "clipPathUnits": { "type": "string" }, |
100 | 143 | "clip-path": { "type": "string" }, |
101 | 144 | "clip-rule": { "type": "string" }, |
102 | | - "color": { "type": "string" }, |
| 145 | + "color": { |
| 146 | + "$ref": "#/$defs/colorAttribute" |
| 147 | + }, |
103 | 148 | "color-interpolation": { "type": "string" }, |
104 | 149 | "color-interpolation-filters": { "type": "string" }, |
105 | 150 | "crossorigin": { "type": "string" }, |
|
116 | 161 | "edgeMode": { "type": "string" }, |
117 | 162 | "elevation": { "type": "string" }, |
118 | 163 | "exponent": { "type": "string" }, |
119 | | - "fill": { "type": "string" }, |
| 164 | + "fill": { |
| 165 | + "$ref": "#/$defs/colorAttribute" |
| 166 | + }, |
120 | 167 | "fill-opacity": { "type": "string" }, |
121 | 168 | "fill-rule": { "type": "string" }, |
122 | 169 | "filter": { "type": "string" }, |
123 | 170 | "filterUnits": { "type": "string" }, |
124 | | - "flood-color": { "type": "string" }, |
| 171 | + "flood-color": { |
| 172 | + "$ref": "#/$defs/colorAttribute" |
| 173 | + }, |
125 | 174 | "flood-opacity": { "type": "string" }, |
126 | 175 | "font-family": { "type": "string" }, |
127 | 176 | "font-size": { "type": "string" }, |
|
142 | 191 | }, |
143 | 192 | { |
144 | 193 | "type": "string", |
145 | | - "pattern": "^data:img/(png|gif|jpg|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$" |
| 194 | + "pattern": "^data:image/(png|gif|jpg|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$" |
146 | 195 | } |
147 | 196 | ] |
148 | 197 | }, |
|
160 | 209 | "lang": { "type": "string" }, |
161 | 210 | "lengthAdjust": { "type": "string" }, |
162 | 211 | "letter-spacing": { "type": "string" }, |
163 | | - "lighting-color": { "type": "string" }, |
| 212 | + "lighting-color": { |
| 213 | + "$ref": "#/$defs/colorAttribute" |
| 214 | + }, |
164 | 215 | "marker-end": { "type": "string" }, |
165 | 216 | "marker-mid": { "type": "string" }, |
166 | 217 | "marker-start": { "type": "string" }, |
|
207 | 258 | "startOffset": { "type": "string" }, |
208 | 259 | "stdDeviation": { "type": "string" }, |
209 | 260 | "stitchTiles": { "type": "string" }, |
210 | | - "stop-color": { "type": "string" }, |
| 261 | + "stop-color": { |
| 262 | + "$ref": "#/$defs/colorAttribute" |
| 263 | + }, |
211 | 264 | "stop-opacity": { "type": "string" }, |
212 | | - "stroke": { "type": "string" }, |
| 265 | + "stroke": { |
| 266 | + "$ref": "#/$defs/colorAttribute" |
| 267 | + }, |
213 | 268 | "stroke-dasharray": { "type": "string" }, |
214 | 269 | "stroke-dashoffset": { "type": "string" }, |
215 | 270 | "stroke-linecap": { "type": "string" }, |
|
0 commit comments