@magic/tags 0.0.11 → 0.0.13

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/README.md CHANGED
@@ -23,6 +23,7 @@ exports arrays of html and svg elements.
23
23
  [snyk-url]: https://snyk.io/test/github/magic/tags
24
24
 
25
25
  #### installation:
26
+
26
27
  ```javascript
27
28
  npm install @magic/tags
28
29
  ```
@@ -30,51 +31,74 @@ exports arrays of html and svg elements.
30
31
  #### usage:
31
32
 
32
33
  ##### import
34
+
33
35
  ```javascript
34
36
  import { bodyTags, headTags, svgTags, tags } from '@magic/tags'
35
37
 
36
38
  console.log(bodyTags) // prints all html body tags
37
39
  console.log(headTags) // prints all html elements that can only appear outside of the body
38
- console.log(svgTags) // prints all svg elements
39
- console.log(tags) // prints all of the above
40
+ console.log(svgTags) // prints all svg elements
41
+ console.log(tags) // prints all of the above
40
42
  ```
41
43
 
42
44
  #### changelog
43
45
 
44
46
  ##### 0.0.1
47
+
45
48
  first commit
46
49
 
47
50
  ##### 0.0.2
51
+
48
52
  remove color-profile and switch tags from svg
49
53
 
50
54
  ##### 0.0.3
55
+
51
56
  required node version is >= 13.5.0
52
57
 
53
58
  ##### 0.0.4
59
+
54
60
  bump required node version to 14.2.0
55
61
 
56
62
  ##### 0.0.5
63
+
57
64
  bump required node version to 14.15.4
58
65
 
59
66
  ##### 0.0.6
67
+
60
68
  add <picture> element
61
69
 
62
70
  ##### 0.0.7
63
- * update @magic/test
64
- * add type: module to package.json
71
+
72
+ - update @magic/test
73
+ - add type: module to package.json
65
74
 
66
75
  ##### 0.0.8
76
+
67
77
  update dependencies
68
78
 
69
79
  ##### 0.0.9
80
+
70
81
  update dependencies
71
82
 
72
83
  ##### 0.0.10
73
- * update dependencies
74
- * add self-closing tag array
84
+
85
+ - update dependencies
86
+ - add self-closing tag array
75
87
 
76
88
  ##### 0.0.11
89
+
77
90
  update dependencies
78
91
 
79
- ##### 0.0.12 - unreleased
92
+ ##### 0.0.12
93
+
94
+ update dependencies
95
+
96
+ ##### 0.0.13
97
+
98
+ - add types
99
+ - fix test/spec
100
+ - update dependencies
101
+
102
+ ##### 0.0.14 - unreleased
103
+
80
104
  ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic/tags",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "author": "Wizards & Witches",
5
5
  "description": "exports arrays of all html and svg tags.",
6
6
  "license": "AGPL-3.0",
@@ -8,7 +8,9 @@
8
8
  "type": "module",
9
9
  "scripts": {
10
10
  "start": "t -p",
11
- "build": "NODE_ENV=production magic build",
11
+ "build": "npm run build:docs && npm run test && tsc && npm run format",
12
+ "build:docs": "NODE_ENV=production magic build",
13
+ "prepublishOnly": "npm run build",
12
14
  "prod": "NODE_ENV=production magic build serve --watch src",
13
15
  "clean": "magic clean",
14
16
  "serve": "magic serve",
@@ -18,7 +20,8 @@
18
20
  "calls": "calls"
19
21
  },
20
22
  "files": [
21
- "src"
23
+ "src",
24
+ "types"
22
25
  ],
23
26
  "engines": {
24
27
  "node": ">=14.15.4"
@@ -31,15 +34,17 @@
31
34
  "bugs": {
32
35
  "url": "https://github.com/magic/tags/issues"
33
36
  },
34
- "main": "src/index.mjs",
37
+ "main": "src/index.js",
38
+ "types": "types/index.d.ts",
35
39
  "devDependencies": {
36
- "@magic-modules/light-switch": "0.0.11",
37
- "@magic-modules/no-spy": "0.0.7",
38
- "@magic-modules/pre": "0.0.11",
39
- "@magic-themes/docs": "0.0.14",
40
- "@magic/core": "0.0.140",
41
- "@magic/format": "0.0.40",
42
- "@magic/test": "0.2.11"
40
+ "@magic-modules/light-switch": "0.0.12",
41
+ "@magic-modules/no-spy": "0.0.9",
42
+ "@magic-modules/pre": "0.0.12",
43
+ "@magic-themes/docs": "0.0.15",
44
+ "@magic/core": "0.0.156",
45
+ "@magic/format": "0.0.68",
46
+ "@magic/test": "0.2.20",
47
+ "typescript": "5.9.3"
43
48
  },
44
49
  "keywords": [
45
50
  "html",
@@ -4,7 +4,7 @@
4
4
  // svg element list and docs extracted from
5
5
  // https://developer.mozilla.org/en-US/docs/Web/SVG/Element
6
6
 
7
- export const selfClosing = [
7
+ export const selfClosing = /** @type {const} */ ([
8
8
  'area', // - HTML area tag defines an area in an image based on coordinates which then accepts an URL and become a clickable area behaving like a hyperlink
9
9
  'base', // - It defines the base URL for all the relative URLs in the document
10
10
  'br', // - br is used to create a line break
@@ -12,15 +12,16 @@ export const selfClosing = [
12
12
  'embed', // - It is used to embed external content on the webpage
13
13
  'hr', // - It creates a horizontal line
14
14
  'img', // - It is used to define an image
15
+ 'input', // - It is used to create input fields in forms
15
16
  'link', // - It is mostly used to add external stylesheets to the HTML document
16
17
  'meta', // - It is used to give metadata to the webpage
17
18
  'param', // - It defines parameter to the object
18
19
  'source', // - It is used to give multiple media of resources for audio, video, and pictures
19
20
  'track', // - It is used in media files to provide times text tracks
20
21
  'wbr', // - It provides a word break position in a paragraph for the browsers
21
- ]
22
+ ])
22
23
 
23
- export const bodyTags = [
24
+ export const bodyTags = /** @type {const} */ ([
24
25
  // Represents a hyperlink (the link that a user clicks on to go to another web page or document).
25
26
  'a',
26
27
  // Represents an abbreviation
@@ -85,6 +86,8 @@ export const bodyTags = [
85
86
  'em',
86
87
  // Represents external application or interactive content. The embed tag was introduced in HTML5 (although browsers have supported it since long before HTML5).
87
88
  'embed',
89
+ // Represents a fenced frame for embedded content with enhanced privacy. This is a newer HTML element.
90
+ 'fencedframe',
88
91
  // Represents a fieldset
89
92
  'fieldset',
90
93
  // Represents caption for the 'code',figure'/code', element. The figcaption tag is new in HTML5.
@@ -138,6 +141,10 @@ export const bodyTags = [
138
141
  'map',
139
142
  // Represents marked text. This tag was introduced in HTML5.
140
143
  'mark',
144
+ // Represents a MathML mathematical expression
145
+ 'math',
146
+ // Represents a menu of commands
147
+ 'menu',
141
148
  // Represents measurement within a predefined range. This element is new in HTML5.
142
149
  'meter',
143
150
  // Represents navigation links. This tag was introduced in HTML5.
@@ -158,6 +165,8 @@ export const bodyTags = [
158
165
  'p',
159
166
  // Represents a parameter for an object
160
167
  'param',
168
+ // Represents a picture element for responsive images
169
+ 'picture',
161
170
  // Represents preformatted text
162
171
  'pre',
163
172
  // Represents progress of a task of any kind. This element was introduced in HTML5.
@@ -180,10 +189,16 @@ export const bodyTags = [
180
189
  'samp',
181
190
  // Represents a script
182
191
  'script',
192
+ // Represents a search functionality container. This is a newer HTML element.
193
+ 'search',
183
194
  // Represents a section. This tag is new in HTML5.
184
195
  'section',
185
196
  // Represents a selectable list
186
197
  'select',
198
+ // Represents the selected content inside a select element. This is a newer element.
199
+ 'selectedcontent',
200
+ // Represents a slot in web components for shadow DOM
201
+ 'slot',
187
202
  // Represents small text
188
203
  'small',
189
204
  // Represents media resources. This HTML element is new in HTML5.
@@ -227,15 +242,14 @@ export const bodyTags = [
227
242
  // Represents an unordered list
228
243
  'ul',
229
244
  // Represents a variable
230
- // Breaks the build (of course)
231
- //~ 'var',
245
+ 'var',
232
246
  // Represents a video. The video element is new in HTML5.
233
247
  'video',
234
248
  // Represents a line break 'i',opportunity'/i', for very long words and strings of text with no spaces. This tag is new in HTML5.
235
249
  'wbr',
236
- ]
250
+ ])
237
251
 
238
- export const headTags = [
252
+ export const headTags = /** @type {const} */ ([
239
253
  // Represents a base URL for all the links in a page
240
254
  'base',
241
255
  // Represents information about the document
@@ -248,9 +262,9 @@ export const headTags = [
248
262
  'meta',
249
263
  // Represents the document title
250
264
  'title',
251
- ]
265
+ ])
252
266
 
253
- export const svgTags = [
267
+ export const svgTags = /** @type {const} */ ([
254
268
  // The <a> SVG element creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL.
255
269
  'a',
256
270
  // This element implements the SVGAnimateElement interface.
@@ -264,8 +278,7 @@ export const svgTags = [
264
278
  // The <clipPath> SVG element defines a clipping path. A clipping path is used/referenced using the clip-path property.
265
279
  'clipPath',
266
280
  // The <color-profile> element allows describing the color profile used for the image.
267
- // DOES NOT CONFORM TO HTML ELEMENT NAMES. DISABLED
268
- // 'color-profile',
281
+ 'color-profile',
269
282
  // The <defs> element is used to store graphical objects that will be used at a later time. Objects created inside a <defs> element are not rendered directly. To display them you have to reference them (with a <use> element for example).
270
283
  'defs',
271
284
  // Each container element or graphics element in an SVG drawing can supply a description string using the <desc> element where the description is text-only.
@@ -381,8 +394,7 @@ export const svgTags = [
381
394
  // The svg element is a container that defines a new coordinate system and viewport. It is used as the outermost element of any SVG document but it can also be used to embed a SVG fragment inside any SVG or HTML document.
382
395
  'svg',
383
396
  // The <switch> SVG element evaluates the requiredFeatures, requiredExtensions and systemLanguage attributes on its direct child elements in order, and then processes and renders the first child for which these attributes evaluate to true. All others will be bypassed and therefore not rendered. If the child element is a container element such as a <g>, then the entire subtree is either processed/rendered or bypassed/not rendered.
384
- // Object.switch breaks javascript
385
- // 'switch',
397
+ 'switch',
386
398
  // The <symbol> element is used to define graphical template objects which can be instantiated by a <use> element.
387
399
  'symbol',
388
400
  // The SVG <text> element defines a graphics element consisting of text. It's possible to apply a gradient, pattern, clipping path, mask, or filter to <text>, just like any other SVG graphics element.
@@ -398,7 +410,7 @@ export const svgTags = [
398
410
  'use',
399
411
  // A view is a defined way to view the image, like a zoom level or a detail view.
400
412
  'view',
401
- ]
413
+ ])
402
414
 
403
415
  export const tags = [...headTags, ...bodyTags, ...svgTags]
404
416
 
@@ -0,0 +1,397 @@
1
+ export const selfClosing: readonly [
2
+ 'area',
3
+ 'base',
4
+ 'br',
5
+ 'col',
6
+ 'embed',
7
+ 'hr',
8
+ 'img',
9
+ 'input',
10
+ 'link',
11
+ 'meta',
12
+ 'param',
13
+ 'source',
14
+ 'track',
15
+ 'wbr',
16
+ ]
17
+ export const bodyTags: readonly [
18
+ 'a',
19
+ 'abbr',
20
+ 'address',
21
+ 'area',
22
+ 'article',
23
+ 'aside',
24
+ 'audio',
25
+ 'b',
26
+ 'bdi',
27
+ 'bdo',
28
+ 'blockquote',
29
+ 'body',
30
+ 'br',
31
+ 'button',
32
+ 'canvas',
33
+ 'caption',
34
+ 'cite',
35
+ 'code',
36
+ 'col',
37
+ 'colgroup',
38
+ 'data',
39
+ 'datalist',
40
+ 'dd',
41
+ 'del',
42
+ 'details',
43
+ 'dfn',
44
+ 'dialog',
45
+ 'div',
46
+ 'dl',
47
+ 'dt',
48
+ 'em',
49
+ 'embed',
50
+ 'fencedframe',
51
+ 'fieldset',
52
+ 'figcaption',
53
+ 'figure',
54
+ 'footer',
55
+ 'form',
56
+ 'h1',
57
+ 'h2',
58
+ 'h3',
59
+ 'h4',
60
+ 'h5',
61
+ 'h6',
62
+ 'header',
63
+ 'hgroup',
64
+ 'hr',
65
+ 'i',
66
+ 'iframe',
67
+ 'img',
68
+ 'input',
69
+ 'ins',
70
+ 'kbd',
71
+ 'label',
72
+ 'legend',
73
+ 'li',
74
+ 'main',
75
+ 'map',
76
+ 'mark',
77
+ 'math',
78
+ 'menu',
79
+ 'meter',
80
+ 'nav',
81
+ 'noscript',
82
+ 'object',
83
+ 'ol',
84
+ 'optgroup',
85
+ 'option',
86
+ 'output',
87
+ 'p',
88
+ 'param',
89
+ 'picture',
90
+ 'pre',
91
+ 'progress',
92
+ 'q',
93
+ 'rb',
94
+ 'rp',
95
+ 'rt',
96
+ 'rtc',
97
+ 'ruby',
98
+ 's',
99
+ 'samp',
100
+ 'script',
101
+ 'search',
102
+ 'section',
103
+ 'select',
104
+ 'selectedcontent',
105
+ 'slot',
106
+ 'small',
107
+ 'source',
108
+ 'span',
109
+ 'strong',
110
+ 'style',
111
+ 'sub',
112
+ 'summary',
113
+ 'sup',
114
+ 'table',
115
+ 'tbody',
116
+ 'td',
117
+ 'template',
118
+ 'textarea',
119
+ 'tfoot',
120
+ 'th',
121
+ 'thead',
122
+ 'time',
123
+ 'tr',
124
+ 'track',
125
+ 'u',
126
+ 'ul',
127
+ 'var',
128
+ 'video',
129
+ 'wbr',
130
+ ]
131
+ export const headTags: readonly ['base', 'head', 'html', 'link', 'meta', 'title']
132
+ export const svgTags: readonly [
133
+ 'a',
134
+ 'animate',
135
+ 'animateMotion',
136
+ 'animateTransform',
137
+ 'circle',
138
+ 'clipPath',
139
+ 'color-profile',
140
+ 'defs',
141
+ 'desc',
142
+ 'discard',
143
+ 'ellipse',
144
+ 'feBlend',
145
+ 'feColorMatrix',
146
+ 'feComponentTransfer',
147
+ 'feComposite',
148
+ 'feConvolveMatrix',
149
+ 'feDiffuseLighting',
150
+ 'feDisplacementMap',
151
+ 'feDistantLight',
152
+ 'feDropShadow',
153
+ 'feFlood',
154
+ 'feFuncA',
155
+ 'feFuncB',
156
+ 'feFuncG',
157
+ 'feFuncR',
158
+ 'feGaussianBlur',
159
+ 'feImage',
160
+ 'feMerge',
161
+ 'feMergeNode',
162
+ 'feMorphology',
163
+ 'feOffset',
164
+ 'fePointLight',
165
+ 'feSpecularLighting',
166
+ 'feSpotLight',
167
+ 'feTile',
168
+ 'feTurbulence',
169
+ 'filter',
170
+ 'foreignObject',
171
+ 'g',
172
+ 'hatch',
173
+ 'hatchpath',
174
+ 'image',
175
+ 'line',
176
+ 'linearGradient',
177
+ 'marker',
178
+ 'mask',
179
+ 'mesh',
180
+ 'meshgradient',
181
+ 'meshpatch',
182
+ 'meshrow',
183
+ 'metadata',
184
+ 'mpath',
185
+ 'path',
186
+ 'pattern',
187
+ 'picture',
188
+ 'polygon',
189
+ 'polyline',
190
+ 'radialGradient',
191
+ 'rect',
192
+ 'script',
193
+ 'set',
194
+ 'solidcolor',
195
+ 'stop',
196
+ 'style',
197
+ 'svg',
198
+ 'switch',
199
+ 'symbol',
200
+ 'text',
201
+ 'textPath',
202
+ 'title',
203
+ 'tspan',
204
+ 'unknown',
205
+ 'use',
206
+ 'view',
207
+ ]
208
+ export const tags: (
209
+ | 'symbol'
210
+ | 'object'
211
+ | 'search'
212
+ | 'link'
213
+ | 'small'
214
+ | 'sub'
215
+ | 'sup'
216
+ | 'map'
217
+ | 'filter'
218
+ | 'input'
219
+ | 'set'
220
+ | 'base'
221
+ | 'code'
222
+ | 'data'
223
+ | 'time'
224
+ | 'progress'
225
+ | 'stop'
226
+ | 'track'
227
+ | 'source'
228
+ | 'button'
229
+ | 'address'
230
+ | 'unknown'
231
+ | 'view'
232
+ | 'discard'
233
+ | 'clipPath'
234
+ | 'marker'
235
+ | 'mask'
236
+ | 'a'
237
+ | 'abbr'
238
+ | 'area'
239
+ | 'article'
240
+ | 'aside'
241
+ | 'audio'
242
+ | 'b'
243
+ | 'bdi'
244
+ | 'bdo'
245
+ | 'blockquote'
246
+ | 'body'
247
+ | 'br'
248
+ | 'canvas'
249
+ | 'caption'
250
+ | 'cite'
251
+ | 'col'
252
+ | 'colgroup'
253
+ | 'datalist'
254
+ | 'dd'
255
+ | 'del'
256
+ | 'details'
257
+ | 'dfn'
258
+ | 'dialog'
259
+ | 'div'
260
+ | 'dl'
261
+ | 'dt'
262
+ | 'em'
263
+ | 'embed'
264
+ | 'fieldset'
265
+ | 'figcaption'
266
+ | 'figure'
267
+ | 'footer'
268
+ | 'form'
269
+ | 'h1'
270
+ | 'h2'
271
+ | 'h3'
272
+ | 'h4'
273
+ | 'h5'
274
+ | 'h6'
275
+ | 'head'
276
+ | 'header'
277
+ | 'hgroup'
278
+ | 'hr'
279
+ | 'html'
280
+ | 'i'
281
+ | 'iframe'
282
+ | 'img'
283
+ | 'ins'
284
+ | 'kbd'
285
+ | 'label'
286
+ | 'legend'
287
+ | 'li'
288
+ | 'main'
289
+ | 'mark'
290
+ | 'menu'
291
+ | 'meta'
292
+ | 'meter'
293
+ | 'nav'
294
+ | 'noscript'
295
+ | 'ol'
296
+ | 'optgroup'
297
+ | 'option'
298
+ | 'output'
299
+ | 'p'
300
+ | 'picture'
301
+ | 'pre'
302
+ | 'q'
303
+ | 'rp'
304
+ | 'rt'
305
+ | 'ruby'
306
+ | 's'
307
+ | 'samp'
308
+ | 'script'
309
+ | 'section'
310
+ | 'select'
311
+ | 'slot'
312
+ | 'span'
313
+ | 'strong'
314
+ | 'style'
315
+ | 'summary'
316
+ | 'table'
317
+ | 'tbody'
318
+ | 'td'
319
+ | 'template'
320
+ | 'textarea'
321
+ | 'tfoot'
322
+ | 'th'
323
+ | 'thead'
324
+ | 'title'
325
+ | 'tr'
326
+ | 'u'
327
+ | 'ul'
328
+ | 'var'
329
+ | 'video'
330
+ | 'wbr'
331
+ | 'param'
332
+ | 'rb'
333
+ | 'rtc'
334
+ | 'animate'
335
+ | 'animateMotion'
336
+ | 'animateTransform'
337
+ | 'circle'
338
+ | 'defs'
339
+ | 'desc'
340
+ | 'ellipse'
341
+ | 'feBlend'
342
+ | 'feColorMatrix'
343
+ | 'feComponentTransfer'
344
+ | 'feComposite'
345
+ | 'feConvolveMatrix'
346
+ | 'feDiffuseLighting'
347
+ | 'feDisplacementMap'
348
+ | 'feDistantLight'
349
+ | 'feDropShadow'
350
+ | 'feFlood'
351
+ | 'feFuncA'
352
+ | 'feFuncB'
353
+ | 'feFuncG'
354
+ | 'feFuncR'
355
+ | 'feGaussianBlur'
356
+ | 'feImage'
357
+ | 'feMerge'
358
+ | 'feMergeNode'
359
+ | 'feMorphology'
360
+ | 'feOffset'
361
+ | 'fePointLight'
362
+ | 'feSpecularLighting'
363
+ | 'feSpotLight'
364
+ | 'feTile'
365
+ | 'feTurbulence'
366
+ | 'foreignObject'
367
+ | 'g'
368
+ | 'image'
369
+ | 'line'
370
+ | 'linearGradient'
371
+ | 'metadata'
372
+ | 'mpath'
373
+ | 'path'
374
+ | 'pattern'
375
+ | 'polygon'
376
+ | 'polyline'
377
+ | 'radialGradient'
378
+ | 'rect'
379
+ | 'svg'
380
+ | 'switch'
381
+ | 'text'
382
+ | 'textPath'
383
+ | 'tspan'
384
+ | 'use'
385
+ | 'math'
386
+ | 'fencedframe'
387
+ | 'selectedcontent'
388
+ | 'color-profile'
389
+ | 'hatch'
390
+ | 'hatchpath'
391
+ | 'mesh'
392
+ | 'meshgradient'
393
+ | 'meshpatch'
394
+ | 'meshrow'
395
+ | 'solidcolor'
396
+ )[]
397
+ export default tags