ether-code 0.1.6 → 0.1.7

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.
Files changed (44) hide show
  1. package/cli/ether.js +1 -1
  2. package/generators/css-generator.js +42 -55
  3. package/generators/graphql-generator.js +19 -22
  4. package/generators/html-generator.js +51 -220
  5. package/generators/js-generator.js +76 -157
  6. package/generators/node-generator.js +49 -93
  7. package/generators/php-generator.js +46 -68
  8. package/generators/python-generator.js +35 -54
  9. package/generators/react-generator.js +37 -47
  10. package/generators/ruby-generator.js +59 -119
  11. package/generators/sql-generator.js +42 -63
  12. package/generators/ts-generator.js +59 -133
  13. package/i18n/i18n-css.json +147 -147
  14. package/i18n/i18n-graphql.json +6 -6
  15. package/i18n/i18n-html.json +135 -135
  16. package/i18n/i18n-js.json +107 -107
  17. package/i18n/i18n-node.json +14 -14
  18. package/i18n/i18n-php.json +177 -177
  19. package/i18n/i18n-python.json +16 -16
  20. package/i18n/i18n-react.json +97 -97
  21. package/i18n/i18n-ruby.json +22 -22
  22. package/i18n/i18n-sql.json +153 -153
  23. package/i18n/i18n-ts.json +10 -10
  24. package/lexer/ether-lexer.js +175 -34
  25. package/lexer/tokens.js +6 -6
  26. package/package.json +1 -1
  27. package/parsers/ast-css.js +0 -545
  28. package/parsers/ast-graphql.js +0 -424
  29. package/parsers/ast-html.js +0 -886
  30. package/parsers/ast-js.js +0 -750
  31. package/parsers/ast-node.js +0 -2440
  32. package/parsers/ast-php.js +0 -957
  33. package/parsers/ast-react.js +0 -580
  34. package/parsers/ast-ruby.js +0 -895
  35. package/parsers/ast-ts.js +0 -1352
  36. package/parsers/css-parser.js +0 -1981
  37. package/parsers/graphql-parser.js +0 -2011
  38. package/parsers/html-parser.js +0 -1182
  39. package/parsers/js-parser.js +0 -2564
  40. package/parsers/node-parser.js +0 -2644
  41. package/parsers/php-parser.js +0 -3037
  42. package/parsers/react-parser.js +0 -1035
  43. package/parsers/ruby-parser.js +0 -2680
  44. package/parsers/ts-parser.js +0 -3881
@@ -1,545 +0,0 @@
1
- class ASTNode {
2
- constructor(type, loc = null) {
3
- this.type = type
4
- this.loc = loc
5
- }
6
- }
7
-
8
- class StyleSheet extends ASTNode {
9
- constructor(rules = [], loc = null) {
10
- super('StyleSheet', loc)
11
- this.rules = rules
12
- }
13
- }
14
-
15
- class Rule extends ASTNode {
16
- constructor(selectors, declarations, loc = null) {
17
- super('Rule', loc)
18
- this.selectors = selectors
19
- this.declarations = declarations
20
- }
21
- }
22
-
23
- class Selector extends ASTNode {
24
- constructor(value, specificity = null, loc = null) {
25
- super('Selector', loc)
26
- this.value = value
27
- this.specificity = specificity
28
- }
29
- }
30
-
31
- class SelectorList extends ASTNode {
32
- constructor(selectors = [], loc = null) {
33
- super('SelectorList', loc)
34
- this.selectors = selectors
35
- }
36
- }
37
-
38
- class SimpleSelector extends ASTNode {
39
- constructor(selectorType, value, loc = null) {
40
- super('SimpleSelector', loc)
41
- this.selectorType = selectorType
42
- this.value = value
43
- }
44
- }
45
-
46
- class CompoundSelector extends ASTNode {
47
- constructor(selectors = [], loc = null) {
48
- super('CompoundSelector', loc)
49
- this.selectors = selectors
50
- }
51
- }
52
-
53
- class ComplexSelector extends ASTNode {
54
- constructor(left, combinator, right, loc = null) {
55
- super('ComplexSelector', loc)
56
- this.left = left
57
- this.combinator = combinator
58
- this.right = right
59
- }
60
- }
61
-
62
- class PseudoClassSelector extends ASTNode {
63
- constructor(name, argument = null, loc = null) {
64
- super('PseudoClassSelector', loc)
65
- this.name = name
66
- this.argument = argument
67
- }
68
- }
69
-
70
- class PseudoElementSelector extends ASTNode {
71
- constructor(name, loc = null) {
72
- super('PseudoElementSelector', loc)
73
- this.name = name
74
- }
75
- }
76
-
77
- class AttributeSelector extends ASTNode {
78
- constructor(attribute, operator = null, value = null, flags = null, loc = null) {
79
- super('AttributeSelector', loc)
80
- this.attribute = attribute
81
- this.operator = operator
82
- this.value = value
83
- this.flags = flags
84
- }
85
- }
86
-
87
- class Declaration extends ASTNode {
88
- constructor(property, value, important = false, loc = null) {
89
- super('Declaration', loc)
90
- this.property = property
91
- this.value = value
92
- this.important = important
93
- }
94
- }
95
-
96
- class Property extends ASTNode {
97
- constructor(name, cssName, loc = null) {
98
- super('Property', loc)
99
- this.name = name
100
- this.cssName = cssName
101
- }
102
- }
103
-
104
- class Value extends ASTNode {
105
- constructor(value, cssValue = null, loc = null) {
106
- super('Value', loc)
107
- this.value = value
108
- this.cssValue = cssValue
109
- }
110
- }
111
-
112
- class ValueList extends ASTNode {
113
- constructor(values = [], separator = ' ', loc = null) {
114
- super('ValueList', loc)
115
- this.values = values
116
- this.separator = separator
117
- }
118
- }
119
-
120
- class NumberValue extends ASTNode {
121
- constructor(value, unit = null, loc = null) {
122
- super('NumberValue', loc)
123
- this.value = value
124
- this.unit = unit
125
- }
126
- }
127
-
128
- class PercentageValue extends ASTNode {
129
- constructor(value, loc = null) {
130
- super('PercentageValue', loc)
131
- this.value = value
132
- }
133
- }
134
-
135
- class ColorValue extends ASTNode {
136
- constructor(colorType, value, cssValue = null, loc = null) {
137
- super('ColorValue', loc)
138
- this.colorType = colorType
139
- this.value = value
140
- this.cssValue = cssValue
141
- }
142
- }
143
-
144
- class FunctionCall extends ASTNode {
145
- constructor(name, cssName, args = [], loc = null) {
146
- super('FunctionCall', loc)
147
- this.name = name
148
- this.cssName = cssName
149
- this.args = args
150
- }
151
- }
152
-
153
- class Identifier extends ASTNode {
154
- constructor(name, cssName = null, loc = null) {
155
- super('Identifier', loc)
156
- this.name = name
157
- this.cssName = cssName
158
- }
159
- }
160
-
161
- class StringValue extends ASTNode {
162
- constructor(value, quote = '"', loc = null) {
163
- super('StringValue', loc)
164
- this.value = value
165
- this.quote = quote
166
- }
167
- }
168
-
169
- class UrlValue extends ASTNode {
170
- constructor(url, loc = null) {
171
- super('UrlValue', loc)
172
- this.url = url
173
- }
174
- }
175
-
176
- class Variable extends ASTNode {
177
- constructor(name, loc = null) {
178
- super('Variable', loc)
179
- this.name = name
180
- }
181
- }
182
-
183
- class CustomProperty extends ASTNode {
184
- constructor(name, value, loc = null) {
185
- super('CustomProperty', loc)
186
- this.name = name
187
- this.value = value
188
- }
189
- }
190
-
191
- class MediaQuery extends ASTNode {
192
- constructor(mediaType, conditions, rules, loc = null) {
193
- super('MediaQuery', loc)
194
- this.mediaType = mediaType
195
- this.conditions = conditions
196
- this.rules = rules
197
- }
198
- }
199
-
200
- class MediaCondition extends ASTNode {
201
- constructor(feature, value, operator = null, loc = null) {
202
- super('MediaCondition', loc)
203
- this.feature = feature
204
- this.value = value
205
- this.operator = operator
206
- }
207
- }
208
-
209
- class ContainerQuery extends ASTNode {
210
- constructor(name, conditions, rules, loc = null) {
211
- super('ContainerQuery', loc)
212
- this.name = name
213
- this.conditions = conditions
214
- this.rules = rules
215
- }
216
- }
217
-
218
- class SupportsRule extends ASTNode {
219
- constructor(condition, rules, loc = null) {
220
- super('SupportsRule', loc)
221
- this.condition = condition
222
- this.rules = rules
223
- }
224
- }
225
-
226
- class LayerRule extends ASTNode {
227
- constructor(name, rules = null, loc = null) {
228
- super('LayerRule', loc)
229
- this.name = name
230
- this.rules = rules
231
- }
232
- }
233
-
234
- class KeyframesRule extends ASTNode {
235
- constructor(name, keyframes = [], loc = null) {
236
- super('KeyframesRule', loc)
237
- this.name = name
238
- this.keyframes = keyframes
239
- }
240
- }
241
-
242
- class Keyframe extends ASTNode {
243
- constructor(selector, declarations, loc = null) {
244
- super('Keyframe', loc)
245
- this.selector = selector
246
- this.declarations = declarations
247
- }
248
- }
249
-
250
- class FontFaceRule extends ASTNode {
251
- constructor(declarations, loc = null) {
252
- super('FontFaceRule', loc)
253
- this.declarations = declarations
254
- }
255
- }
256
-
257
- class ImportRule extends ASTNode {
258
- constructor(url, mediaQueries = null, layer = null, supports = null, loc = null) {
259
- super('ImportRule', loc)
260
- this.url = url
261
- this.mediaQueries = mediaQueries
262
- this.layer = layer
263
- this.supports = supports
264
- }
265
- }
266
-
267
- class PageRule extends ASTNode {
268
- constructor(selector, declarations, loc = null) {
269
- super('PageRule', loc)
270
- this.selector = selector
271
- this.declarations = declarations
272
- }
273
- }
274
-
275
- class PropertyRule extends ASTNode {
276
- constructor(name, syntax, inherits, initialValue, loc = null) {
277
- super('PropertyRule', loc)
278
- this.name = name
279
- this.syntax = syntax
280
- this.inherits = inherits
281
- this.initialValue = initialValue
282
- }
283
- }
284
-
285
- class CounterStyleRule extends ASTNode {
286
- constructor(name, declarations, loc = null) {
287
- super('CounterStyleRule', loc)
288
- this.name = name
289
- this.declarations = declarations
290
- }
291
- }
292
-
293
- class ScopeRule extends ASTNode {
294
- constructor(start, end, rules, loc = null) {
295
- super('ScopeRule', loc)
296
- this.start = start
297
- this.end = end
298
- this.rules = rules
299
- }
300
- }
301
-
302
- class StartingStyleRule extends ASTNode {
303
- constructor(rules, loc = null) {
304
- super('StartingStyleRule', loc)
305
- this.rules = rules
306
- }
307
- }
308
-
309
- class NestingRule extends ASTNode {
310
- constructor(selector, declarations, nestedRules = [], loc = null) {
311
- super('NestingRule', loc)
312
- this.selector = selector
313
- this.declarations = declarations
314
- this.nestedRules = nestedRules
315
- }
316
- }
317
-
318
- class GradientValue extends ASTNode {
319
- constructor(gradientType, direction, stops, loc = null) {
320
- super('GradientValue', loc)
321
- this.gradientType = gradientType
322
- this.direction = direction
323
- this.stops = stops
324
- }
325
- }
326
-
327
- class ColorStop extends ASTNode {
328
- constructor(color, position = null, loc = null) {
329
- super('ColorStop', loc)
330
- this.color = color
331
- this.position = position
332
- }
333
- }
334
-
335
- class TransformValue extends ASTNode {
336
- constructor(functions = [], loc = null) {
337
- super('TransformValue', loc)
338
- this.functions = functions
339
- }
340
- }
341
-
342
- class FilterValue extends ASTNode {
343
- constructor(functions = [], loc = null) {
344
- super('FilterValue', loc)
345
- this.functions = functions
346
- }
347
- }
348
-
349
- class TimingFunction extends ASTNode {
350
- constructor(name, values = null, loc = null) {
351
- super('TimingFunction', loc)
352
- this.name = name
353
- this.values = values
354
- }
355
- }
356
-
357
- class CalcExpression extends ASTNode {
358
- constructor(expression, loc = null) {
359
- super('CalcExpression', loc)
360
- this.expression = expression
361
- }
362
- }
363
-
364
- class BinaryExpression extends ASTNode {
365
- constructor(left, operator, right, loc = null) {
366
- super('BinaryExpression', loc)
367
- this.left = left
368
- this.operator = operator
369
- this.right = right
370
- }
371
- }
372
-
373
- class UnaryExpression extends ASTNode {
374
- constructor(operator, argument, loc = null) {
375
- super('UnaryExpression', loc)
376
- this.operator = operator
377
- this.argument = argument
378
- }
379
- }
380
-
381
- class GridTemplate extends ASTNode {
382
- constructor(rows, columns, areas = null, loc = null) {
383
- super('GridTemplate', loc)
384
- this.rows = rows
385
- this.columns = columns
386
- this.areas = areas
387
- }
388
- }
389
-
390
- class GridTrack extends ASTNode {
391
- constructor(size, lineNames = [], loc = null) {
392
- super('GridTrack', loc)
393
- this.size = size
394
- this.lineNames = lineNames
395
- }
396
- }
397
-
398
- class GridArea extends ASTNode {
399
- constructor(name, loc = null) {
400
- super('GridArea', loc)
401
- this.name = name
402
- }
403
- }
404
-
405
- class RepeatFunction extends ASTNode {
406
- constructor(count, tracks, loc = null) {
407
- super('RepeatFunction', loc)
408
- this.count = count
409
- this.tracks = tracks
410
- }
411
- }
412
-
413
- class MinMaxFunction extends ASTNode {
414
- constructor(min, max, loc = null) {
415
- super('MinMaxFunction', loc)
416
- this.min = min
417
- this.max = max
418
- }
419
- }
420
-
421
- class FitContentFunction extends ASTNode {
422
- constructor(value, loc = null) {
423
- super('FitContentFunction', loc)
424
- this.value = value
425
- }
426
- }
427
-
428
- class ShapeValue extends ASTNode {
429
- constructor(shapeType, args, loc = null) {
430
- super('ShapeValue', loc)
431
- this.shapeType = shapeType
432
- this.args = args
433
- }
434
- }
435
-
436
- class ImageValue extends ASTNode {
437
- constructor(imageType, value, loc = null) {
438
- super('ImageValue', loc)
439
- this.imageType = imageType
440
- this.value = value
441
- }
442
- }
443
-
444
- class Ratio extends ASTNode {
445
- constructor(width, height, loc = null) {
446
- super('Ratio', loc)
447
- this.width = width
448
- this.height = height
449
- }
450
- }
451
-
452
- class Comment extends ASTNode {
453
- constructor(value, loc = null) {
454
- super('Comment', loc)
455
- this.value = value
456
- }
457
- }
458
-
459
- class EtherAlias extends ASTNode {
460
- constructor(alias, expandedDeclarations, loc = null) {
461
- super('EtherAlias', loc)
462
- this.alias = alias
463
- this.expandedDeclarations = expandedDeclarations
464
- }
465
- }
466
-
467
- class EtherCondition extends ASTNode {
468
- constructor(condition, rules, elseRules = null, loc = null) {
469
- super('EtherCondition', loc)
470
- this.condition = condition
471
- this.rules = rules
472
- this.elseRules = elseRules
473
- }
474
- }
475
-
476
- class EtherState extends ASTNode {
477
- constructor(state, declarations, loc = null) {
478
- super('EtherState', loc)
479
- this.state = state
480
- this.declarations = declarations
481
- }
482
- }
483
-
484
- module.exports = {
485
- ASTNode,
486
- StyleSheet,
487
- Rule,
488
- Selector,
489
- SelectorList,
490
- SimpleSelector,
491
- CompoundSelector,
492
- ComplexSelector,
493
- PseudoClassSelector,
494
- PseudoElementSelector,
495
- AttributeSelector,
496
- Declaration,
497
- Property,
498
- Value,
499
- ValueList,
500
- NumberValue,
501
- PercentageValue,
502
- ColorValue,
503
- FunctionCall,
504
- Identifier,
505
- StringValue,
506
- UrlValue,
507
- Variable,
508
- CustomProperty,
509
- MediaQuery,
510
- MediaCondition,
511
- ContainerQuery,
512
- SupportsRule,
513
- LayerRule,
514
- KeyframesRule,
515
- Keyframe,
516
- FontFaceRule,
517
- ImportRule,
518
- PageRule,
519
- PropertyRule,
520
- CounterStyleRule,
521
- ScopeRule,
522
- StartingStyleRule,
523
- NestingRule,
524
- GradientValue,
525
- ColorStop,
526
- TransformValue,
527
- FilterValue,
528
- TimingFunction,
529
- CalcExpression,
530
- BinaryExpression,
531
- UnaryExpression,
532
- GridTemplate,
533
- GridTrack,
534
- GridArea,
535
- RepeatFunction,
536
- MinMaxFunction,
537
- FitContentFunction,
538
- ShapeValue,
539
- ImageValue,
540
- Ratio,
541
- Comment,
542
- EtherAlias,
543
- EtherCondition,
544
- EtherState
545
- }