jtsx-loader 0.1.4 → 0.1.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.
@@ -42,6 +42,7 @@ export default async ({ data }) => {
42
42
  <p>You can run it locally with <code>npm i</code> and <code>npm run start</code> or with nodemon for development <code>npm run dev</code></p>
43
43
  <p>IMPORTANT: This project is NOT a replacement for React, Vue and their derivatives. If you need reactivity and thick clients, it is better to use the appropriate tools</p>
44
44
 
45
+ <p><a href="https://www.npmjs.com/package/jtsx-loader">NPM package</a></p>
45
46
  <p><a href="https://github.com/dergachevm/jtsx-loader">Github</a></p>
46
47
  <p><a href="https://github.com/dergachevm/jtsx-loader/blob/master/jtsx.config.example.js">Config file description</a></p>
47
48
  </section>
@@ -104,6 +105,7 @@ export default async ({ title }) => <html lang="en">
104
105
  <ul>
105
106
  <li><code>__escape</code> attribute: used to output any escaped content</li>
106
107
  <li><code>__raw</code> attribute: renders a string into the tag content as is, for example useful for <code>script</code> tags and <code>style</code></li>
108
+ <li><code>{_jsxUtils.escapeHtml(`{_jsxUtils.escapeHtml('<code>examples</code>')}`)}</code> function for escaping HTML</li>
107
109
  <li>The JTSX file is passed the <code>_jsxUtils</code> object, which contains useful utilities. Instead of this object, you can pass any function you want and use it to extend the standard transformation</li>
108
110
  </ul>
109
111
  </div>
@@ -42,7 +42,8 @@ export default async ({ data }) => {
42
42
  <p>Данная документация это проект внутри модуля, который можно запустить локально для изучения его работы. Исходники расположены в папке <a href="https://github.com/dergachevm/jtsx-loader/tree/master/example">example</a></p>
43
43
  <p>Вы можете запустить ее локально с помощью <code>npm i</code> и <code>npm run start</code> или с помощью nodemon для разработки <code>npm run dev</code></p>
44
44
  <p>ВАЖНО: Данный загрузчик это НЕ замена React, Vue и их производных. Если вам нужна реактивность и толстые клиенты, то лучше использовать соответствующие инструменты</p>
45
-
45
+
46
+ <p><a href="https://www.npmjs.com/package/jtsx-loader">NPM</a></p>
46
47
  <p><a href="https://github.com/dergachevm/jtsx-loader">Github</a></p>
47
48
  <p><a href="https://github.com/dergachevm/jtsx-loader/blob/master/jtsx.config.example.js">Описание файла конфигурации</a></p>
48
49
  </section>
@@ -105,6 +106,7 @@ export default async ({ title }) => <html lang="ru">
105
106
  <ul>
106
107
  <li>Аттрибут <code>__escape</code>: используется для вывода любого экранированного контента</li>
107
108
  <li>Аттрибут <code>__raw</code>: рендерит строку в содержимое тега как есть, например полезно для тегов <code>script</code> и <code>style</code></li>
109
+ <li><code>{_jsxUtils.escapeHtml(`{_jsxUtils.escapeHtml('<code>examples</code>')}`)}</code> функция для экранирования HTML</li>
108
110
  <li>В JTSX файл передается объект <code>_jsxUtils</code>, которая содержит в себе полезные утилиты. Вместо данного объекта можно передать свою любую функцию и использовать ее для расширения стандартного преобразования</li>
109
111
  </ul>
110
112
  </div>
@@ -80,6 +80,10 @@ p {
80
80
  margin: 14px 0;
81
81
  }
82
82
 
83
+ li {
84
+ margin-bottom: 10px;
85
+ }
86
+
83
87
  section {
84
88
  }
85
89
 
@@ -68,12 +68,16 @@ const objectIntoAttrs = (object) => {
68
68
  finalValue = value;
69
69
  }
70
70
 
71
- if (!finalValue) {
71
+ if (finalValue === false) {
72
72
  return;
73
73
  }
74
74
 
75
75
  const result = spacer + `${attr}="${finalValue}"`;
76
76
 
77
+ if (finalValue === undefined) {
78
+ result = spacer + attr;
79
+ }
80
+
77
81
  return result;
78
82
  })
79
83
  .filter(a => a);
@@ -1,496 +1,386 @@
1
1
  const possibleAttributes = {
2
- // HTML
3
- 'accept': 'accept',
4
- 'acceptCharset': 'accept-charset',
5
- 'accessKey': 'accesskey',
6
- 'action': 'action',
7
- 'allowFullScreen': 'allowfullscreen',
8
- 'alt': 'alt',
9
- 'as': 'as',
10
- 'async': 'async',
11
- 'autoCapitalize': 'autocapitalize',
12
- 'autoComplete': 'autocomplete',
13
- 'autoCorrect': 'autocorrect',
14
- 'autoFocus': 'autofocus',
15
- 'autoPlay': 'autoplay',
16
- 'autoSave': 'autosave',
17
- 'capture': 'capture',
18
- 'cellPadding': 'cellpadding',
19
- 'cellSpacing': 'cellspacing',
20
- 'challenge': 'challenge',
21
- 'charSet': 'charset',
22
- 'checked': 'checked',
23
- 'children': 'children',
24
- 'cite': 'cite',
25
- 'className': 'class',
26
- 'classID': 'classid',
27
- 'className': 'classname',
28
- 'cols': 'cols',
29
- 'colSpan': 'colspan',
30
- 'content': 'content',
31
- 'contentEditable': 'contenteditable',
32
- 'contextMenu': 'contextmenu',
33
- 'controls': 'controls',
34
- 'controlsList': 'controlslist',
35
- 'coords': 'coords',
36
- 'crossOrigin': 'crossorigin',
37
- 'dangerouslySetInnerHTML': 'dangerouslysetinnerhtml',
38
- 'data': 'data',
39
- 'dateTime': 'datetime',
40
- 'default': 'default',
41
- 'defaultChecked': 'defaultchecked',
42
- 'defaultValue': 'defaultvalue',
43
- 'defer': 'defer',
44
- 'dir': 'dir',
45
- 'disabled': 'disabled',
46
- 'disablePictureInPicture': 'disablepictureinpicture',
47
- 'disableRemotePlayback': 'disableremoteplayback',
48
- 'download': 'download',
49
- 'draggable': 'draggable',
50
- 'encType': 'enctype',
51
- 'enterKeyHint': 'enterkeyhint',
52
- 'fetchPriority': 'fetchpriority',
53
- 'htmlFor': 'for',
54
- 'form': 'form',
55
- 'formMethod': 'formmethod',
56
- 'formAction': 'formaction',
57
- 'formEncType': 'formenctype',
58
- 'formNoValidate': 'formnovalidate',
59
- 'formTarget': 'formtarget',
60
- 'frameBorder': 'frameborder',
61
- 'headers': 'headers',
62
- 'height': 'height',
63
- 'hidden': 'hidden',
64
- 'high': 'high',
65
- 'href': 'href',
66
- 'hrefLang': 'hreflang',
67
- 'httpEquiv': 'http-equiv',
68
- 'icon': 'icon',
69
- 'id': 'id',
70
- 'imageSizes': 'imagesizes',
71
- 'imageSrcSet': 'imagesrcset',
72
- 'inert': 'inert',
73
- 'innerHTML': 'innerhtml',
74
- 'inputMode': 'inputmode',
75
- 'integrity': 'integrity',
76
- 'is': 'is',
77
- 'itemID': 'itemid',
78
- 'itemProp': 'itemprop',
79
- 'itemRef': 'itemref',
80
- 'itemScope': 'itemscope',
81
- 'itemType': 'itemtype',
82
- 'keyParams': 'keyparams',
83
- 'keyType': 'keytype',
84
- 'kind': 'kind',
85
- 'label': 'label',
86
- 'lang': 'lang',
87
- 'list': 'list',
88
- 'loop': 'loop',
89
- 'low': 'low',
90
- 'manifest': 'manifest',
91
- 'marginWidth': 'marginwidth',
92
- 'marginHeight': 'marginheight',
93
- 'max': 'max',
94
- 'maxLength': 'maxlength',
95
- 'media': 'media',
96
- 'mediaGroup': 'mediagroup',
97
- 'method': 'method',
98
- 'min': 'min',
99
- 'minLength': 'minlength',
100
- 'multiple': 'multiple',
101
- 'muted': 'muted',
102
- 'name': 'name',
103
- 'noModule': 'nomodule',
104
- 'nonce': 'nonce',
105
- 'noValidate': 'novalidate',
106
- 'open': 'open',
107
- 'optimum': 'optimum',
108
- 'pattern': 'pattern',
109
- 'placeholder': 'placeholder',
110
- 'playsInline': 'playsinline',
111
- 'poster': 'poster',
112
- 'preload': 'preload',
113
- 'profile': 'profile',
114
- 'radioGroup': 'radiogroup',
115
- 'readOnly': 'readonly',
116
- 'referrerPolicy': 'referrerpolicy',
117
- 'rel': 'rel',
118
- 'required': 'required',
119
- 'reversed': 'reversed',
120
- 'role': 'role',
121
- 'rows': 'rows',
122
- 'rowSpan': 'rowspan',
123
- 'sandbox': 'sandbox',
124
- 'scope': 'scope',
125
- 'scoped': 'scoped',
126
- 'scrolling': 'scrolling',
127
- 'seamless': 'seamless',
128
- 'selected': 'selected',
129
- 'shape': 'shape',
130
- 'size': 'size',
131
- 'sizes': 'sizes',
132
- 'span': 'span',
133
- 'spellCheck': 'spellcheck',
134
- 'src': 'src',
135
- 'srcDoc': 'srcdoc',
136
- 'srcLang': 'srclang',
137
- 'srcSet': 'srcset',
138
- 'start': 'start',
139
- 'step': 'step',
140
- 'style': 'style',
141
- 'summary': 'summary',
142
- 'tabIndex': 'tabindex',
143
- 'target': 'target',
144
- 'title': 'title',
145
- 'type': 'type',
146
- 'useMap': 'usemap',
147
- 'value': 'value',
148
- 'width': 'width',
149
- 'wmode': 'wmode',
150
- 'wrap': 'wrap',
2
+ // HTML
3
+ 'accept': 'accept',
4
+ 'acceptCharset': 'accept-charset',
5
+ 'accessKey': 'accesskey',
6
+ 'action': 'action',
7
+ 'allowFullScreen': 'allowfullscreen',
8
+ 'alt': 'alt',
9
+ 'as': 'as',
10
+ 'async': 'async',
11
+ 'autoCapitalize': 'autocapitalize',
12
+ 'autoComplete': 'autocomplete',
13
+ 'autoCorrect': 'autocorrect',
14
+ 'autoFocus': 'autofocus',
15
+ 'autoPlay': 'autoplay',
16
+ 'autoSave': 'autosave',
17
+ 'capture': 'capture',
18
+ 'cellPadding': 'cellpadding',
19
+ 'cellSpacing': 'cellspacing',
20
+ 'challenge': 'challenge',
21
+ 'charSet': 'charset',
22
+ 'checked': 'checked',
23
+ 'children': 'children',
24
+ 'cite': 'cite',
25
+ 'className': 'class',
26
+ 'classID': 'classid',
27
+ 'cols': 'cols',
28
+ 'colSpan': 'colspan',
29
+ 'content': 'content',
30
+ 'contentEditable': 'contenteditable',
31
+ 'contextMenu': 'contextmenu',
32
+ 'controls': 'controls',
33
+ 'controlsList': 'controlslist',
34
+ 'coords': 'coords',
35
+ 'crossOrigin': 'crossorigin',
36
+ 'dangerouslySetInnerHTML': 'dangerouslysetinnerhtml',
37
+ 'data': 'data',
38
+ 'dateTime': 'datetime',
39
+ 'default': 'default',
40
+ 'defaultChecked': 'defaultchecked',
41
+ 'defaultValue': 'defaultvalue',
42
+ 'defer': 'defer',
43
+ 'dir': 'dir',
44
+ 'disabled': 'disabled',
45
+ 'disablePictureInPicture': 'disablepictureinpicture',
46
+ 'disableRemotePlayback': 'disableremoteplayback',
47
+ 'download': 'download',
48
+ 'draggable': 'draggable',
49
+ 'encType': 'enctype',
50
+ 'enterKeyHint': 'enterkeyhint',
51
+ 'fetchPriority': 'fetchpriority',
52
+ 'htmlFor': 'for',
53
+ 'form': 'form',
54
+ 'formMethod': 'formmethod',
55
+ 'formAction': 'formaction',
56
+ 'formEncType': 'formenctype',
57
+ 'formNoValidate': 'formnovalidate',
58
+ 'formTarget': 'formtarget',
59
+ 'frameBorder': 'frameborder',
60
+ 'headers': 'headers',
61
+ 'height': 'height',
62
+ 'hidden': 'hidden',
63
+ 'high': 'high',
64
+ 'href': 'href',
65
+ 'hrefLang': 'hreflang',
66
+ 'httpEquiv': 'http-equiv',
67
+ 'icon': 'icon',
68
+ 'id': 'id',
69
+ 'imageSizes': 'imagesizes',
70
+ 'imageSrcSet': 'imagesrcset',
71
+ 'inert': 'inert',
72
+ 'innerHTML': 'innerhtml',
73
+ 'inputMode': 'inputmode',
74
+ 'integrity': 'integrity',
75
+ 'is': 'is',
76
+ 'itemID': 'itemid',
77
+ 'itemProp': 'itemprop',
78
+ 'itemRef': 'itemref',
79
+ 'itemScope': 'itemscope',
80
+ 'itemType': 'itemtype',
81
+ 'keyParams': 'keyparams',
82
+ 'keyType': 'keytype',
83
+ 'kind': 'kind',
84
+ 'label': 'label',
85
+ 'lang': 'lang',
86
+ 'list': 'list',
87
+ 'loop': 'loop',
88
+ 'low': 'low',
89
+ 'manifest': 'manifest',
90
+ 'marginWidth': 'marginwidth',
91
+ 'marginHeight': 'marginheight',
92
+ 'max': 'max',
93
+ 'maxLength': 'maxlength',
94
+ 'media': 'media',
95
+ 'mediaGroup': 'mediagroup',
96
+ 'method': 'method',
97
+ 'min': 'min',
98
+ 'minLength': 'minlength',
99
+ 'multiple': 'multiple',
100
+ 'muted': 'muted',
101
+ 'name': 'name',
102
+ 'noModule': 'nomodule',
103
+ 'nonce': 'nonce',
104
+ 'noValidate': 'novalidate',
105
+ 'open': 'open',
106
+ 'optimum': 'optimum',
107
+ 'pattern': 'pattern',
108
+ 'placeholder': 'placeholder',
109
+ 'playsInline': 'playsinline',
110
+ 'poster': 'poster',
111
+ 'preload': 'preload',
112
+ 'profile': 'profile',
113
+ 'radioGroup': 'radiogroup',
114
+ 'readOnly': 'readonly',
115
+ 'referrerPolicy': 'referrerpolicy',
116
+ 'rel': 'rel',
117
+ 'required': 'required',
118
+ 'reversed': 'reversed',
119
+ 'role': 'role',
120
+ 'rows': 'rows',
121
+ 'rowSpan': 'rowspan',
122
+ 'sandbox': 'sandbox',
123
+ 'scope': 'scope',
124
+ 'scoped': 'scoped',
125
+ 'scrolling': 'scrolling',
126
+ 'seamless': 'seamless',
127
+ 'selected': 'selected',
128
+ 'shape': 'shape',
129
+ 'size': 'size',
130
+ 'sizes': 'sizes',
131
+ 'span': 'span',
132
+ 'spellCheck': 'spellcheck',
133
+ 'src': 'src',
134
+ 'srcDoc': 'srcdoc',
135
+ 'srcLang': 'srclang',
136
+ 'srcSet': 'srcset',
137
+ 'start': 'start',
138
+ 'step': 'step',
139
+ 'style': 'style',
140
+ 'summary': 'summary',
141
+ 'tabIndex': 'tabindex',
142
+ 'target': 'target',
143
+ 'title': 'title',
144
+ 'type': 'type',
145
+ 'useMap': 'usemap',
146
+ 'value': 'value',
147
+ 'width': 'width',
148
+ 'wmode': 'wmode',
149
+ 'wrap': 'wrap',
151
150
 
152
- // SVG
153
- 'about': 'about',
154
- 'accentHeight': 'accentheight',
155
- 'accentHeight': 'accent-height',
156
- 'accumulate': 'accumulate',
157
- 'additive': 'additive',
158
- 'alignmentBaseline': 'alignmentbaseline',
159
- 'alignmentBaseline': 'alignment-baseline',
160
- 'allowReorder': 'allowreorder',
161
- 'alphabetic': 'alphabetic',
162
- 'amplitude': 'amplitude',
163
- 'arabicForm': 'arabicform',
164
- 'arabicForm': 'arabic-form',
165
- 'ascent': 'ascent',
166
- 'attributeName': 'attributename',
167
- 'attributeType': 'attributetype',
168
- 'autoReverse': 'autoreverse',
169
- 'azimuth': 'azimuth',
170
- 'baseFrequency': 'basefrequency',
171
- 'baselineShift': 'baselineshift',
172
- 'baselineShift': 'baseline-shift',
173
- 'baseProfile': 'baseprofile',
174
- 'bbox': 'bbox',
175
- 'begin': 'begin',
176
- 'bias': 'bias',
177
- 'by': 'by',
178
- 'calcMode': 'calcmode',
179
- 'capHeight': 'capheight',
180
- 'capHeight': 'cap-height',
181
- 'clip': 'clip',
182
- 'clipPath': 'clippath',
183
- 'clipPath': 'clip-path',
184
- 'clipPathUnits': 'clippathunits',
185
- 'clipRule': 'cliprule',
186
- 'clipRule': 'clip-rule',
187
- 'color': 'color',
188
- 'colorInterpolation': 'colorinterpolation',
189
- 'colorInterpolation': 'color-interpolation',
190
- 'colorInterpolationFilters': 'colorinterpolationfilters',
191
- 'colorInterpolationFilters': 'color-interpolation-filters',
192
- 'colorProfile': 'colorprofile',
193
- 'colorProfile': 'color-profile',
194
- 'colorRendering': 'colorrendering',
195
- 'colorRendering': 'color-rendering',
196
- 'contentScriptType': 'contentscripttype',
197
- 'contentStyleType': 'contentstyletype',
198
- 'cursor': 'cursor',
199
- 'cx': 'cx',
200
- 'cy': 'cy',
201
- 'd': 'd',
202
- 'datatype': 'datatype',
203
- 'decelerate': 'decelerate',
204
- 'descent': 'descent',
205
- 'diffuseConstant': 'diffuseconstant',
206
- 'direction': 'direction',
207
- 'display': 'display',
208
- 'divisor': 'divisor',
209
- 'dominantBaseline': 'dominantbaseline',
210
- 'dominantBaseline': 'dominant-baseline',
211
- 'dur': 'dur',
212
- 'dx': 'dx',
213
- 'dy': 'dy',
214
- 'edgeMode': 'edgemode',
215
- 'elevation': 'elevation',
216
- 'enableBackground': 'enablebackground',
217
- 'enableBackground': 'enable-background',
218
- 'end': 'end',
219
- 'exponent': 'exponent',
220
- 'externalResourcesRequired': 'externalresourcesrequired',
221
- 'fill': 'fill',
222
- 'fillOpacity': 'fillopacity',
223
- 'fillOpacity': 'fill-opacity',
224
- 'fillRule': 'fillrule',
225
- 'fillRule': 'fill-rule',
226
- 'filter': 'filter',
227
- 'filterRes': 'filterres',
228
- 'filterUnits': 'filterunits',
229
- 'floodOpacity': 'floodopacity',
230
- 'floodOpacity': 'flood-opacity',
231
- 'floodColor': 'floodcolor',
232
- 'floodColor': 'flood-color',
233
- 'focusable': 'focusable',
234
- 'fontFamily': 'fontfamily',
235
- 'fontFamily': 'font-family',
236
- 'fontSize': 'fontsize',
237
- 'fontSize': 'font-size',
238
- 'fontSizeAdjust': 'fontsizeadjust',
239
- 'fontSizeAdjust': 'font-size-adjust',
240
- 'fontStretch': 'fontstretch',
241
- 'fontStretch': 'font-stretch',
242
- 'fontStyle': 'fontstyle',
243
- 'fontStyle': 'font-style',
244
- 'fontVariant': 'fontvariant',
245
- 'fontVariant': 'font-variant',
246
- 'fontWeight': 'fontweight',
247
- 'fontWeight': 'font-weight',
248
- 'format': 'format',
249
- 'from': 'from',
250
- 'fx': 'fx',
251
- 'fy': 'fy',
252
- 'g1': 'g1',
253
- 'g2': 'g2',
254
- 'glyphName': 'glyphname',
255
- 'glyphName': 'glyph-name',
256
- 'glyphOrientationHorizontal': 'glyphorientationhorizontal',
257
- 'glyphOrientationHorizontal': 'glyph-orientation-horizontal',
258
- 'glyphOrientationVertical': 'glyphorientationvertical',
259
- 'glyphOrientationVertical': 'glyph-orientation-vertical',
260
- 'glyphRef': 'glyphref',
261
- 'gradientTransform': 'gradienttransform',
262
- 'gradientUnits': 'gradientunits',
263
- 'hanging': 'hanging',
264
- 'horizAdvX': 'horizadvx',
265
- 'horizAdvX': 'horiz-adv-x',
266
- 'horizOriginX': 'horizoriginx',
267
- 'horizOriginX': 'horiz-origin-x',
268
- 'ideographic': 'ideographic',
269
- 'imageRendering': 'imagerendering',
270
- 'imageRendering': 'image-rendering',
271
- 'in2': 'in2',
272
- 'in': 'in',
273
- 'inlist': 'inlist',
274
- 'intercept': 'intercept',
275
- 'k1': 'k1',
276
- 'k2': 'k2',
277
- 'k3': 'k3',
278
- 'k4': 'k4',
279
- 'k': 'k',
280
- 'kernelMatrix': 'kernelmatrix',
281
- 'kernelUnitLength': 'kernelunitlength',
282
- 'kerning': 'kerning',
283
- 'keyPoints': 'keypoints',
284
- 'keySplines': 'keysplines',
285
- 'keyTimes': 'keytimes',
286
- 'lengthAdjust': 'lengthadjust',
287
- 'letterSpacing': 'letterspacing',
288
- 'letterSpacing': 'letter-spacing',
289
- 'lightingColor': 'lightingcolor',
290
- 'lightingColor': 'lighting-color',
291
- 'limitingConeAngle': 'limitingconeangle',
292
- 'local': 'local',
293
- 'markerEnd': 'markerend',
294
- 'markerEnd': 'marker-end',
295
- 'markerHeight': 'markerheight',
296
- 'markerMid': 'markermid',
297
- 'markerMid': 'marker-mid',
298
- 'markerStart': 'markerstart',
299
- 'markerStart': 'marker-start',
300
- 'markerUnits': 'markerunits',
301
- 'markerWidth': 'markerwidth',
302
- 'mask': 'mask',
303
- 'maskContentUnits': 'maskcontentunits',
304
- 'maskUnits': 'maskunits',
305
- 'mathematical': 'mathematical',
306
- 'mode': 'mode',
307
- 'numOctaves': 'numoctaves',
308
- 'offset': 'offset',
309
- 'opacity': 'opacity',
310
- 'operator': 'operator',
311
- 'order': 'order',
312
- 'orient': 'orient',
313
- 'orientation': 'orientation',
314
- 'origin': 'origin',
315
- 'overflow': 'overflow',
316
- 'overlinePosition': 'overlineposition',
317
- 'overlinePosition': 'overline-position',
318
- 'overlineThickness': 'overlinethickness',
319
- 'overlineThickness': 'overline-thickness',
320
- 'paintOrder': 'paintorder',
321
- 'paintOrder': 'paint-order',
322
- 'panose1': 'panose1',
323
- 'panose1': 'panose-1',
324
- 'pathLength': 'pathlength',
325
- 'patternContentUnits': 'patterncontentunits',
326
- 'patternTransform': 'patterntransform',
327
- 'patternUnits': 'patternunits',
328
- 'pointerEvents': 'pointerevents',
329
- 'pointerEvents': 'pointer-events',
330
- 'points': 'points',
331
- 'pointsAtX': 'pointsatx',
332
- 'pointsAtY': 'pointsaty',
333
- 'pointsAtZ': 'pointsatz',
334
- 'popover': 'popover',
335
- 'popoverTarget': 'popovertarget',
336
- 'popoverTargetAction': 'popovertargetaction',
337
- 'prefix': 'prefix',
338
- 'preserveAlpha': 'preservealpha',
339
- 'preserveAspectRatio': 'preserveAspectRatio',
340
- 'primitiveUnits': 'primitiveunits',
341
- 'property': 'property',
342
- 'r': 'r',
343
- 'radius': 'radius',
344
- 'refX': 'refx',
345
- 'refY': 'refy',
346
- 'renderingIntent': 'renderingintent',
347
- 'renderingIntent': 'rendering-intent',
348
- 'repeatCount': 'repeatcount',
349
- 'repeatDur': 'repeatdur',
350
- 'requiredExtensions': 'requiredextensions',
351
- 'requiredFeatures': 'requiredfeatures',
352
- 'resource': 'resource',
353
- 'restart': 'restart',
354
- 'result': 'result',
355
- 'results': 'results',
356
- 'rotate': 'rotate',
357
- 'rx': 'rx',
358
- 'ry': 'ry',
359
- 'scale': 'scale',
360
- 'security': 'security',
361
- 'seed': 'seed',
362
- 'shapeRendering': 'shaperendering',
363
- 'shapeRendering': 'shape-rendering',
364
- 'slope': 'slope',
365
- 'spacing': 'spacing',
366
- 'specularConstant': 'specularconstant',
367
- 'specularExponent': 'specularexponent',
368
- 'speed': 'speed',
369
- 'spreadMethod': 'spreadmethod',
370
- 'startOffset': 'startoffset',
371
- 'stdDeviation': 'stddeviation',
372
- 'stemh': 'stemh',
373
- 'stemv': 'stemv',
374
- 'stitchTiles': 'stitchtiles',
375
- 'stopColor': 'stopcolor',
376
- 'stopColor': 'stop-color',
377
- 'stopOpacity': 'stopopacity',
378
- 'stopOpacity': 'stop-opacity',
379
- 'strikethroughPosition': 'strikethroughposition',
380
- 'strikethroughPosition': 'strikethrough-position',
381
- 'strikethroughThickness': 'strikethroughthickness',
382
- 'strikethroughThickness': 'strikethrough-thickness',
383
- 'string': 'string',
384
- 'stroke': 'stroke',
385
- 'strokeDasharray': 'strokedasharray',
386
- 'strokeDasharray': 'stroke-dasharray',
387
- 'strokeDashoffset': 'strokedashoffset',
388
- 'strokeDashoffset': 'stroke-dashoffset',
389
- 'strokeLinecap': 'strokelinecap',
390
- 'strokeLinecap': 'stroke-linecap',
391
- 'strokeLinejoin': 'strokelinejoin',
392
- 'strokeLinejoin': 'stroke-linejoin',
393
- 'strokeMiterlimit': 'strokemiterlimit',
394
- 'strokeMiterlimit': 'stroke-miterlimit',
395
- 'strokeWidth': 'strokewidth',
396
- 'strokeWidth': 'stroke-width',
397
- 'strokeOpacity': 'strokeopacity',
398
- 'strokeOpacity': 'stroke-opacity',
399
- 'suppressContentEditableWarning': 'suppresscontenteditablewarning',
400
- 'suppressHydrationWarning': 'suppresshydrationwarning',
401
- 'surfaceScale': 'surfacescale',
402
- 'systemLanguage': 'systemlanguage',
403
- 'tableValues': 'tablevalues',
404
- 'targetX': 'targetx',
405
- 'targetY': 'targety',
406
- 'textAnchor': 'textanchor',
407
- 'textAnchor': 'text-anchor',
408
- 'textDecoration': 'textdecoration',
409
- 'textDecoration': 'text-decoration',
410
- 'textLength': 'textlength',
411
- 'textRendering': 'textrendering',
412
- 'textRendering': 'text-rendering',
413
- 'to': 'to',
414
- 'transform': 'transform',
415
- 'transformOrigin': 'transformorigin',
416
- 'transformOrigin': 'transform-origin',
417
- 'typeof': 'typeof',
418
- 'u1': 'u1',
419
- 'u2': 'u2',
420
- 'underlinePosition': 'underlineposition',
421
- 'underlinePosition': 'underline-position',
422
- 'underlineThickness': 'underlinethickness',
423
- 'underlineThickness': 'underline-thickness',
424
- 'unicode': 'unicode',
425
- 'unicodeBidi': 'unicodebidi',
426
- 'unicodeBidi': 'unicode-bidi',
427
- 'unicodeRange': 'unicoderange',
428
- 'unicodeRange': 'unicode-range',
429
- 'unitsPerEm': 'unitsperem',
430
- 'unitsPerEm': 'units-per-em',
431
- 'unselectable': 'unselectable',
432
- 'vAlphabetic': 'valphabetic',
433
- 'vAlphabetic': 'v-alphabetic',
434
- 'values': 'values',
435
- 'vectorEffect': 'vectoreffect',
436
- 'vectorEffect': 'vector-effect',
437
- 'version': 'version',
438
- 'vertAdvY': 'vertadvy',
439
- 'vertAdvY': 'vert-adv-y',
440
- 'vertOriginX': 'vertoriginx',
441
- 'vertOriginX': 'vert-origin-x',
442
- 'vertOriginY': 'vertoriginy',
443
- 'vertOriginY': 'vert-origin-y',
444
- 'vHanging': 'vhanging',
445
- 'vHanging': 'v-hanging',
446
- 'vIdeographic': 'videographic',
447
- 'vIdeographic': 'v-ideographic',
448
- 'viewBox': 'viewBox',
449
- 'viewTarget': 'viewtarget',
450
- 'visibility': 'visibility',
451
- 'vMathematical': 'vmathematical',
452
- 'vMathematical': 'v-mathematical',
453
- 'vocab': 'vocab',
454
- 'widths': 'widths',
455
- 'wordSpacing': 'wordspacing',
456
- 'wordSpacing': 'word-spacing',
457
- 'writingMode': 'writingmode',
458
- 'writingMode': 'writing-mode',
459
- 'x1': 'x1',
460
- 'x2': 'x2',
461
- 'x': 'x',
462
- 'xChannelSelector': 'xchannelselector',
463
- 'xHeight': 'xheight',
464
- 'xHeight': 'x-height',
465
- 'xlinkActuate': 'xlinkactuate',
466
- 'xlinkActuate': 'xlink:actuate',
467
- 'xlinkArcrole': 'xlinkarcrole',
468
- 'xlinkArcrole': 'xlink:arcrole',
469
- 'xlinkHref': 'xlinkhref',
470
- 'xlinkHref': 'xlink:href',
471
- 'xlinkRole': 'xlinkrole',
472
- 'xlinkRole': 'xlink:role',
473
- 'xlinkShow': 'xlinkshow',
474
- 'xlinkShow': 'xlink:show',
475
- 'xlinkTitle': 'xlinktitle',
476
- 'xlinkTitle': 'xlink:title',
477
- 'xlinkType': 'xlinktype',
478
- 'xlinkType': 'xlink:type',
479
- 'xmlBase': 'xmlbase',
480
- 'xmlBase': 'xml:base',
481
- 'xmlLang': 'xmllang',
482
- 'xmlLang': 'xml:lang',
483
- 'xmlns': 'xmlns',
484
- 'xmlSpace': 'xml:space',
485
- 'xmlnsXlink': 'xmlnsxlink',
486
- 'xmlnsXlink': 'xmlns:xlink',
487
- 'xmlSpace': 'xmlspace',
488
- 'y1': 'y1',
489
- 'y2': 'y2',
490
- 'y': 'y',
491
- 'yChannelSelector': 'ychannelselector',
492
- 'z': 'z',
493
- 'zoomAndPan': 'zoomandpan',
494
- };
151
+ // SVG
152
+ 'about': 'about',
153
+ 'accentHeight': 'accent-height',
154
+ 'accumulate': 'accumulate',
155
+ 'additive': 'additive',
156
+ 'alignmentBaseline': 'alignment-baseline',
157
+ 'allowReorder': 'allowreorder',
158
+ 'alphabetic': 'alphabetic',
159
+ 'amplitude': 'amplitude',
160
+ 'arabicForm': 'arabic-form',
161
+ 'ascent': 'ascent',
162
+ 'attributeName': 'attributeName',
163
+ 'attributeType': 'attributeType',
164
+ 'autoReverse': 'autoReverse',
165
+ 'azimuth': 'azimuth',
166
+ 'baseFrequency': 'baseFrequency',
167
+ 'baselineShift': 'baseline-shift',
168
+ 'baseProfile': 'baseProfile',
169
+ 'bbox': 'bbox',
170
+ 'begin': 'begin',
171
+ 'bias': 'bias',
172
+ 'by': 'by',
173
+ 'calcMode': 'calcMode',
174
+ 'capHeight': 'cap-height',
175
+ 'clip': 'clip',
176
+ 'clipPath': 'clip-path',
177
+ 'clipPathUnits': 'clipPathUnits',
178
+ 'clipRule': 'clip-rule',
179
+ 'color': 'color',
180
+ 'colorInterpolation': 'color-interpolation',
181
+ 'colorInterpolationFilters': 'color-interpolation-filters',
182
+ 'colorProfile': 'color-profile',
183
+ 'colorRendering': 'color-rendering',
184
+ 'contentScriptType': 'contentScriptType',
185
+ 'contentStyleType': 'contentStyleType',
186
+ 'cursor': 'cursor',
187
+ 'cx': 'cx',
188
+ 'cy': 'cy',
189
+ 'd': 'd',
190
+ 'datatype': 'datatype',
191
+ 'decelerate': 'decelerate',
192
+ 'descent': 'descent',
193
+ 'diffuseConstant': 'diffuseConstant',
194
+ 'direction': 'direction',
195
+ 'display': 'display',
196
+ 'divisor': 'divisor',
197
+ 'dominantBaseline': 'dominant-baseline',
198
+ 'dur': 'dur',
199
+ 'dx': 'dx',
200
+ 'dy': 'dy',
201
+ 'edgeMode': 'edgeMode',
202
+ 'elevation': 'elevation',
203
+ 'enableBackground': 'enable-background',
204
+ 'end': 'end',
205
+ 'exponent': 'exponent',
206
+ 'externalResourcesRequired': 'externalResourcesRequired',
207
+ 'fill': 'fill',
208
+ 'fillOpacity': 'fill-opacity',
209
+ 'fillRule': 'fill-rule',
210
+ 'filter': 'filter',
211
+ 'filterRes': 'filterRes',
212
+ 'filterUnits': 'filterUnits',
213
+ 'floodOpacity': 'flood-opacity',
214
+ 'floodColor': 'flood-color',
215
+ 'focusable': 'focusable',
216
+ 'fontFamily': 'font-family',
217
+ 'fontSize': 'font-size',
218
+ 'fontSizeAdjust': 'font-size-adjust',
219
+ 'fontStretch': 'font-stretch',
220
+ 'fontStyle': 'font-style',
221
+ 'fontVariant': 'font-variant',
222
+ 'fontWeight': 'font-weight',
223
+ 'format': 'format',
224
+ 'from': 'from',
225
+ 'fx': 'fx',
226
+ 'fy': 'fy',
227
+ 'g1': 'g1',
228
+ 'g2': 'g2',
229
+ 'glyphName': 'glyph-name',
230
+ 'glyphOrientationHorizontal': 'glyph-orientation-horizontal',
231
+ 'glyphOrientationVertical': 'glyph-orientation-vertical',
232
+ 'glyphRef': 'glyphRef',
233
+ 'gradientTransform': 'gradientTransform',
234
+ 'gradientUnits': 'gradientUnits',
235
+ 'horizAdvX': 'horiz-adv-x',
236
+ 'horizOriginX': 'horiz-origin-x',
237
+ 'imageRendering': 'image-rendering',
238
+ 'kernelMatrix': 'kernelMatrix',
239
+ 'kernelUnitLength': 'kernelUnitLength',
240
+ 'keyPoints': 'keyPoints',
241
+ 'keySplines': 'keySplines',
242
+ 'keyTimes': 'keyTimes',
243
+ 'lengthAdjust': 'lengthAdjust',
244
+ 'letterSpacing': 'letter-spacing',
245
+ 'lightingColor': 'lighting-color',
246
+ 'limitingConeAngle': 'limitingConeAngle',
247
+ 'local': 'local',
248
+ 'markerEnd': 'marker-end',
249
+ 'markerMid': 'marker-mid',
250
+ 'markerStart': 'marker-start',
251
+ 'markerHeight': 'markerHeight',
252
+ 'markerUnits': 'markerUnits',
253
+ 'markerWidth': 'markerWidth',
254
+ 'mask': 'mask',
255
+ 'maskContentUnits': 'maskContentUnits',
256
+ 'maskUnits': 'maskUnits',
257
+ 'mathematical': 'mathematical',
258
+ 'mode': 'mode',
259
+ 'numOctaves': 'numOctaves',
260
+ 'offset': 'offset',
261
+ 'opacity': 'opacity',
262
+ 'operator': 'operator',
263
+ 'order': 'order',
264
+ 'orient': 'orient',
265
+ 'orientation': 'orientation',
266
+ 'origin': 'origin',
267
+ 'overflow': 'overflow',
268
+ 'overlinePosition': 'overline-position',
269
+ 'overlineThickness': 'overline-thickness',
270
+ 'paintOrder': 'paint-order',
271
+ 'panose1': 'panose-1',
272
+ 'path': 'path',
273
+ 'pathLength': 'pathLength',
274
+ 'patternContentUnits': 'patternContentUnits',
275
+ 'patternTransform': 'patternTransform',
276
+ 'patternUnits': 'patternUnits',
277
+ 'pointerEvents': 'pointer-events',
278
+ 'points': 'points',
279
+ 'pointsAtX': 'pointsAtX',
280
+ 'pointsAtY': 'pointsAtY',
281
+ 'pointsAtZ': 'pointsAtZ',
282
+ 'preserveAlpha': 'preserveAlpha',
283
+ 'preserveAspectRatio': 'preserveAspectRatio',
284
+ 'primitiveUnits': 'primitiveUnits',
285
+ 'r': 'r',
286
+ 'radius': 'radius',
287
+ 'refX': 'refX',
288
+ 'refY': 'refY',
289
+ 'renderingIntent': 'rendering-intent',
290
+ 'repeatCount': 'repeatCount',
291
+ 'repeatDur': 'repeatDur',
292
+ 'requiredExtensions': 'requiredExtensions',
293
+ 'requiredFeatures': 'requiredFeatures',
294
+ 'restart': 'restart',
295
+ 'result': 'result',
296
+ 'rotate': 'rotate',
297
+ 'rx': 'rx',
298
+ 'ry': 'ry',
299
+ 'scale': 'scale',
300
+ 'seed': 'seed',
301
+ 'shapeRendering': 'shape-rendering',
302
+ 'slope': 'slope',
303
+ 'spacing': 'spacing',
304
+ 'specularConstant': 'specularConstant',
305
+ 'specularExponent': 'specularExponent',
306
+ 'speed': 'speed',
307
+ 'spreadMethod': 'spreadMethod',
308
+ 'startOffset': 'startOffset',
309
+ 'stdDeviation': 'stdDeviation',
310
+ 'stemh': 'stemh',
311
+ 'stemv': 'stemv',
312
+ 'stitchTiles': 'stitchTiles',
313
+ 'stopColor': 'stop-color',
314
+ 'stopOpacity': 'stop-opacity',
315
+ 'strikethroughPosition': 'strikethrough-position',
316
+ 'strikethroughThickness': 'strikethrough-thickness',
317
+ 'string': 'string',
318
+ 'stroke': 'stroke',
319
+ 'strokeDasharray': 'stroke-dasharray',
320
+ 'strokeDashoffset': 'stroke-dashoffset',
321
+ 'strokeLinecap': 'stroke-linecap',
322
+ 'strokeLinejoin': 'stroke-linejoin',
323
+ 'strokeMiterlimit': 'stroke-miterlimit',
324
+ 'strokeOpacity': 'stroke-opacity',
325
+ 'strokeWidth': 'stroke-width',
326
+ 'surfaceScale': 'surfaceScale',
327
+ 'systemLanguage': 'systemLanguage',
328
+ 'tableValues': 'tableValues',
329
+ 'targetX': 'targetX',
330
+ 'targetY': 'targetY',
331
+ 'textAnchor': 'text-anchor',
332
+ 'textDecoration': 'text-decoration',
333
+ 'textLength': 'textLength',
334
+ 'textRendering': 'text-rendering',
335
+ 'to': 'to',
336
+ 'transform': 'transform',
337
+ 'u1': 'u1',
338
+ 'u2': 'u2',
339
+ 'underlinePosition': 'underline-position',
340
+ 'underlineThickness': 'underline-thickness',
341
+ 'unicode': 'unicode',
342
+ 'unicodeBidi': 'unicode-bidi',
343
+ 'unicodeRange': 'unicode-range',
344
+ 'unitsPerEm': 'units-per-em',
345
+ 'vAlphabetic': 'v-alphabetic',
346
+ 'vHanging': 'v-hanging',
347
+ 'vIdeographic': 'v-ideographic',
348
+ 'vMathematical': 'v-mathematical',
349
+ 'values': 'values',
350
+ 'vectorEffect': 'vector-effect',
351
+ 'version': 'version',
352
+ 'vertAdvY': 'vert-adv-y',
353
+ 'vertOriginX': 'vert-origin-x',
354
+ 'vertOriginY': 'vert-origin-y',
355
+ 'viewBox': 'viewBox',
356
+ 'viewTarget': 'viewTarget',
357
+ 'visibility': 'visibility',
358
+ 'widths': 'widths',
359
+ 'wordSpacing': 'word-spacing',
360
+ 'writingMode': 'writing-mode',
361
+ 'x': 'x',
362
+ 'x1': 'x1',
363
+ 'x2': 'x2',
364
+ 'xChannelSelector': 'xChannelSelector',
365
+ 'xHeight': 'x-height',
366
+ 'xlinkActuate': 'xlink:actuate',
367
+ 'xlinkArcrole': 'xlink:arcrole',
368
+ 'xlinkHref': 'xlink:href',
369
+ 'xlinkRole': 'xlink:role',
370
+ 'xlinkShow': 'xlink:show',
371
+ 'xlinkTitle': 'xlink:title',
372
+ 'xlinkType': 'xlink:type',
373
+ 'xmlBase': 'xml:base',
374
+ 'xmlLang': 'xml:lang',
375
+ 'xmlns': 'xmlns',
376
+ 'xmlnsXlink': 'xmlns:xlink',
377
+ 'xmlSpace': 'xml:space',
378
+ 'y': 'y',
379
+ 'y1': 'y1',
380
+ 'y2': 'y2',
381
+ 'yChannelSelector': 'yChannelSelector',
382
+ 'z': 'z',
383
+ 'zoomAndPan': 'zoomAndPan',
384
+ };
495
385
 
496
- export default possibleAttributes;
386
+ export default possibleAttributes;
package/loader/loader.mjs CHANGED
@@ -1,9 +1,10 @@
1
- import { transformSync } from 'esbuild';
2
1
  import path from 'node:path';
3
2
  import { readFile } from 'fs/promises';
4
- import { register, isBuiltin } from 'node:module';
5
3
  import { fileURLToPath, pathToFileURL } from 'node:url';
6
4
 
5
+ import { transformSync } from 'esbuild';
6
+ import { isBuiltin } from 'node:module';
7
+
7
8
  // TODO: убрать esm-reload
8
9
  // INSPIRED: https://github.com/pygy/esm-reload/tree/main
9
10
  let id = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jtsx-loader",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "main": "./loader/register.mjs",
5
5
  "type": "module",
6
6
  "imports": {
@@ -8,10 +8,11 @@
8
8
  },
9
9
  "scripts": {
10
10
  "start": "node --import ./loader/register.mjs ./example/server.js",
11
- "dev": "nodemon --import ./loader/register.mjs ./example/server.js"
11
+ "dev": "nodemon --import ./loader/register.mjs ./example/server.js",
12
+ "patch": "npm version patch && npm publish"
12
13
  },
13
14
  "engines": {
14
- "node": ">=20.16 <21"
15
+ "node": ">=20.16 <23"
15
16
  },
16
17
  "keywords": [
17
18
  "jsx",
@@ -28,11 +29,11 @@
28
29
  "url": "git+https://github.com/dergachevm/jtsx-loader"
29
30
  },
30
31
  "dependencies": {
31
- "esbuild": "^0.23.1"
32
+ "esbuild": "^0.24.2"
32
33
  },
33
34
  "devDependencies": {
34
- "htmlfy": "^0.2.1",
35
- "express": "^4.19.2",
36
- "nodemon": "^3.1.4"
35
+ "express": "^4.21.2",
36
+ "htmlfy": "^0.5.0",
37
+ "nodemon": "^3.1.9"
37
38
  }
38
39
  }