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.
- package/example/pages/index.jsx +2 -0
- package/example/pages/ru.jsx +3 -1
- package/example/styles/default.css +4 -0
- package/factory/jsxFactory.js +5 -1
- package/factory/possibleAttributes.js +383 -493
- package/loader/loader.mjs +3 -2
- package/package.json +8 -7
package/example/pages/index.jsx
CHANGED
|
@@ -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>
|
package/example/pages/ru.jsx
CHANGED
|
@@ -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>
|
package/factory/jsxFactory.js
CHANGED
|
@@ -68,12 +68,16 @@ const objectIntoAttrs = (object) => {
|
|
|
68
68
|
finalValue = value;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
if (
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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
|
-
|
|
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.
|
|
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 <
|
|
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.
|
|
32
|
+
"esbuild": "^0.24.2"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"nodemon": "^3.1.
|
|
35
|
+
"express": "^4.21.2",
|
|
36
|
+
"htmlfy": "^0.5.0",
|
|
37
|
+
"nodemon": "^3.1.9"
|
|
37
38
|
}
|
|
38
39
|
}
|