ether-code 0.5.4 → 0.5.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/cli/ether.js CHANGED
@@ -6,7 +6,7 @@ const http = require('http')
6
6
  const { EtherCompiler } = require('./compiler')
7
7
  const { Watcher } = require('./watcher')
8
8
 
9
- const VERSION = '0.5.4'
9
+ const VERSION = '0.5.5'
10
10
 
11
11
  const COLORS = {
12
12
  reset: '\x1b[0m',
@@ -108,6 +108,377 @@ class CSSGenerator {
108
108
 
109
109
  translateProperty(prop) {
110
110
  const lower = prop.toLowerCase()
111
+
112
+ const priorityMap = {
113
+ 'contenu': 'content',
114
+ 'contenus': 'content',
115
+ 'famille-police': 'font-family',
116
+ 'famille police': 'font-family',
117
+ 'police-famille': 'font-family',
118
+ 'taille-police': 'font-size',
119
+ 'taille police': 'font-size',
120
+ 'police-taille': 'font-size',
121
+ 'poids-police': 'font-weight',
122
+ 'poids police': 'font-weight',
123
+ 'police-poids': 'font-weight',
124
+ 'style-police': 'font-style',
125
+ 'style police': 'font-style',
126
+ 'police-style': 'font-style',
127
+ 'hauteur-ligne': 'line-height',
128
+ 'hauteur ligne': 'line-height',
129
+ 'ligne-hauteur': 'line-height',
130
+ 'espacement-lettres': 'letter-spacing',
131
+ 'espacement lettres': 'letter-spacing',
132
+ 'espacement-mots': 'word-spacing',
133
+ 'espacement mots': 'word-spacing',
134
+ 'rayon-bordure': 'border-radius',
135
+ 'rayon bordure': 'border-radius',
136
+ 'bordure-rayon': 'border-radius',
137
+ 'arrondi-bordure': 'border-radius',
138
+ 'coins-arrondis': 'border-radius',
139
+ 'flou-fond': 'backdrop-filter',
140
+ 'flou fond': 'backdrop-filter',
141
+ 'fond-flou': 'backdrop-filter',
142
+ 'filtre-fond': 'backdrop-filter',
143
+ 'filtre fond': 'backdrop-filter',
144
+ 'fond-filtre': 'backdrop-filter',
145
+ 'arriere-plan-flou': 'backdrop-filter',
146
+ 'max-largeur': 'max-width',
147
+ 'largeur-max': 'max-width',
148
+ 'largeur-maximum': 'max-width',
149
+ 'largeur maximum': 'max-width',
150
+ 'min-largeur': 'min-width',
151
+ 'largeur-min': 'min-width',
152
+ 'largeur-minimum': 'min-width',
153
+ 'largeur minimum': 'min-width',
154
+ 'max-hauteur': 'max-height',
155
+ 'hauteur-max': 'max-height',
156
+ 'hauteur-maximum': 'max-height',
157
+ 'hauteur maximum': 'max-height',
158
+ 'min-hauteur': 'min-height',
159
+ 'hauteur-min': 'min-height',
160
+ 'hauteur-minimum': 'min-height',
161
+ 'hauteur minimum': 'min-height',
162
+ 'couleur-fond': 'background-color',
163
+ 'couleur fond': 'background-color',
164
+ 'fond-couleur': 'background-color',
165
+ 'image-fond': 'background-image',
166
+ 'image fond': 'background-image',
167
+ 'fond-image': 'background-image',
168
+ 'position-fond': 'background-position',
169
+ 'position fond': 'background-position',
170
+ 'fond-position': 'background-position',
171
+ 'taille-fond': 'background-size',
172
+ 'taille fond': 'background-size',
173
+ 'fond-taille': 'background-size',
174
+ 'repetition-fond': 'background-repeat',
175
+ 'repetition fond': 'background-repeat',
176
+ 'fond-repetition': 'background-repeat',
177
+ 'attachement-fond': 'background-attachment',
178
+ 'attachement fond': 'background-attachment',
179
+ 'fond-attachement': 'background-attachment',
180
+ 'origine-fond': 'background-origin',
181
+ 'origine fond': 'background-origin',
182
+ 'decoupe-fond': 'background-clip',
183
+ 'decoupe fond': 'background-clip',
184
+ 'fond-decoupe': 'background-clip',
185
+ 'mode-melange': 'mix-blend-mode',
186
+ 'mode melange': 'mix-blend-mode',
187
+ 'melange-mode': 'mix-blend-mode',
188
+ 'mode-fusion': 'mix-blend-mode',
189
+ 'mode fusion': 'mix-blend-mode',
190
+ 'couleur-bordure': 'border-color',
191
+ 'couleur bordure': 'border-color',
192
+ 'bordure-couleur': 'border-color',
193
+ 'style-bordure': 'border-style',
194
+ 'style bordure': 'border-style',
195
+ 'bordure-style': 'border-style',
196
+ 'largeur-bordure': 'border-width',
197
+ 'largeur bordure': 'border-width',
198
+ 'bordure-largeur': 'border-width',
199
+ 'bordure-haut': 'border-top',
200
+ 'bordure haut': 'border-top',
201
+ 'bordure-bas': 'border-bottom',
202
+ 'bordure bas': 'border-bottom',
203
+ 'bordure-gauche': 'border-left',
204
+ 'bordure gauche': 'border-left',
205
+ 'bordure-droite': 'border-right',
206
+ 'bordure droite': 'border-right',
207
+ 'ombre-boite': 'box-shadow',
208
+ 'ombre boite': 'box-shadow',
209
+ 'boite-ombre': 'box-shadow',
210
+ 'ombre-texte': 'text-shadow',
211
+ 'ombre texte': 'text-shadow',
212
+ 'texte-ombre': 'text-shadow',
213
+ 'alignement-texte': 'text-align',
214
+ 'alignement texte': 'text-align',
215
+ 'texte-alignement': 'text-align',
216
+ 'decoration-texte': 'text-decoration',
217
+ 'decoration texte': 'text-decoration',
218
+ 'texte-decoration': 'text-decoration',
219
+ 'transformation-texte': 'text-transform',
220
+ 'transformation texte': 'text-transform',
221
+ 'texte-transformation': 'text-transform',
222
+ 'retrait-texte': 'text-indent',
223
+ 'retrait texte': 'text-indent',
224
+ 'texte-retrait': 'text-indent',
225
+ 'debordement-texte': 'text-overflow',
226
+ 'debordement texte': 'text-overflow',
227
+ 'texte-debordement': 'text-overflow',
228
+ 'renvoi-mots': 'word-wrap',
229
+ 'renvoi mots': 'word-wrap',
230
+ 'cesure-mots': 'word-break',
231
+ 'cesure mots': 'word-break',
232
+ 'espace-blanc': 'white-space',
233
+ 'espace blanc': 'white-space',
234
+ 'blanc-espace': 'white-space',
235
+ 'direction-flex': 'flex-direction',
236
+ 'direction flex': 'flex-direction',
237
+ 'flex-direction': 'flex-direction',
238
+ 'enveloppe-flex': 'flex-wrap',
239
+ 'enveloppe flex': 'flex-wrap',
240
+ 'flex-enveloppe': 'flex-wrap',
241
+ 'flux-flex': 'flex-flow',
242
+ 'flux flex': 'flex-flow',
243
+ 'flex-flux': 'flex-flow',
244
+ 'croissance-flex': 'flex-grow',
245
+ 'croissance flex': 'flex-grow',
246
+ 'flex-croissance': 'flex-grow',
247
+ 'retrecissement-flex': 'flex-shrink',
248
+ 'retrecissement flex': 'flex-shrink',
249
+ 'flex-retrecissement': 'flex-shrink',
250
+ 'base-flex': 'flex-basis',
251
+ 'base flex': 'flex-basis',
252
+ 'flex-base': 'flex-basis',
253
+ 'justifier-contenu': 'justify-content',
254
+ 'justifier contenu': 'justify-content',
255
+ 'contenu-justifier': 'justify-content',
256
+ 'aligner-elements': 'align-items',
257
+ 'aligner elements': 'align-items',
258
+ 'elements-aligner': 'align-items',
259
+ 'aligner-soi': 'align-self',
260
+ 'aligner soi': 'align-self',
261
+ 'soi-aligner': 'align-self',
262
+ 'aligner-contenu': 'align-content',
263
+ 'aligner contenu': 'align-content',
264
+ 'contenu-aligner': 'align-content',
265
+ 'colonnes-grille': 'grid-template-columns',
266
+ 'colonnes grille': 'grid-template-columns',
267
+ 'grille-colonnes': 'grid-template-columns',
268
+ 'lignes-grille': 'grid-template-rows',
269
+ 'lignes grille': 'grid-template-rows',
270
+ 'grille-lignes': 'grid-template-rows',
271
+ 'zones-grille': 'grid-template-areas',
272
+ 'zones grille': 'grid-template-areas',
273
+ 'grille-zones': 'grid-template-areas',
274
+ 'colonne-grille': 'grid-column',
275
+ 'colonne grille': 'grid-column',
276
+ 'grille-colonne': 'grid-column',
277
+ 'ligne-grille': 'grid-row',
278
+ 'ligne grille': 'grid-row',
279
+ 'grille-ligne': 'grid-row',
280
+ 'zone-grille': 'grid-area',
281
+ 'zone grille': 'grid-area',
282
+ 'grille-zone': 'grid-area',
283
+ 'ecart-grille': 'grid-gap',
284
+ 'ecart grille': 'grid-gap',
285
+ 'grille-ecart': 'grid-gap',
286
+ 'flux-automatique-grille': 'grid-auto-flow',
287
+ 'flux automatique grille': 'grid-auto-flow',
288
+ 'colonnes-automatiques-grille': 'grid-auto-columns',
289
+ 'colonnes automatiques grille': 'grid-auto-columns',
290
+ 'lignes-automatiques-grille': 'grid-auto-rows',
291
+ 'lignes automatiques grille': 'grid-auto-rows',
292
+ 'style-liste': 'list-style',
293
+ 'style liste': 'list-style',
294
+ 'liste-style': 'list-style',
295
+ 'liste style': 'list-style',
296
+ 'type-liste': 'list-style-type',
297
+ 'type liste': 'list-style-type',
298
+ 'liste-type': 'list-style-type',
299
+ 'position-liste': 'list-style-position',
300
+ 'position liste': 'list-style-position',
301
+ 'liste-position': 'list-style-position',
302
+ 'image-liste': 'list-style-image',
303
+ 'image liste': 'list-style-image',
304
+ 'liste-image': 'list-style-image',
305
+ 'disposition-tableau': 'table-layout',
306
+ 'disposition tableau': 'table-layout',
307
+ 'tableau-disposition': 'table-layout',
308
+ 'effondrement-bordure': 'border-collapse',
309
+ 'effondrement bordure': 'border-collapse',
310
+ 'bordure-effondrement': 'border-collapse',
311
+ 'espacement-bordure': 'border-spacing',
312
+ 'espacement bordure': 'border-spacing',
313
+ 'bordure-espacement': 'border-spacing',
314
+ 'cote-legendes': 'caption-side',
315
+ 'cote legendes': 'caption-side',
316
+ 'legendes-cote': 'caption-side',
317
+ 'cellules-vides': 'empty-cells',
318
+ 'cellules vides': 'empty-cells',
319
+ 'vides-cellules': 'empty-cells',
320
+ 'index-z': 'z-index',
321
+ 'z-index': 'z-index',
322
+ 'indice-z': 'z-index',
323
+ 'debordement': 'overflow',
324
+ 'debordement-x': 'overflow-x',
325
+ 'debordement x': 'overflow-x',
326
+ 'debordement-y': 'overflow-y',
327
+ 'debordement y': 'overflow-y',
328
+ 'defilement-x': 'overflow-x',
329
+ 'defilement x': 'overflow-x',
330
+ 'defilement-y': 'overflow-y',
331
+ 'defilement y': 'overflow-y',
332
+ 'comportement-defilement': 'scroll-behavior',
333
+ 'comportement defilement': 'scroll-behavior',
334
+ 'defilement-comportement': 'scroll-behavior',
335
+ 'accrochage-defilement': 'scroll-snap-type',
336
+ 'accrochage defilement': 'scroll-snap-type',
337
+ 'defilement-accrochage': 'scroll-snap-type',
338
+ 'origine-transformation': 'transform-origin',
339
+ 'origine transformation': 'transform-origin',
340
+ 'transformation-origine': 'transform-origin',
341
+ 'style-transformation': 'transform-style',
342
+ 'style transformation': 'transform-style',
343
+ 'transformation-style': 'transform-style',
344
+ 'face-arriere-visible': 'backface-visibility',
345
+ 'face arriere visible': 'backface-visibility',
346
+ 'visibilite-face-arriere': 'backface-visibility',
347
+ 'origine-perspective': 'perspective-origin',
348
+ 'origine perspective': 'perspective-origin',
349
+ 'perspective-origine': 'perspective-origin',
350
+ 'delai-transition': 'transition-delay',
351
+ 'delai transition': 'transition-delay',
352
+ 'transition-delai': 'transition-delay',
353
+ 'duree-transition': 'transition-duration',
354
+ 'duree transition': 'transition-duration',
355
+ 'transition-duree': 'transition-duration',
356
+ 'propriete-transition': 'transition-property',
357
+ 'propriete transition': 'transition-property',
358
+ 'transition-propriete': 'transition-property',
359
+ 'fonction-transition': 'transition-timing-function',
360
+ 'fonction transition': 'transition-timing-function',
361
+ 'transition-fonction': 'transition-timing-function',
362
+ 'nom-animation': 'animation-name',
363
+ 'nom animation': 'animation-name',
364
+ 'animation-nom': 'animation-name',
365
+ 'duree-animation': 'animation-duration',
366
+ 'duree animation': 'animation-duration',
367
+ 'animation-duree': 'animation-duration',
368
+ 'fonction-animation': 'animation-timing-function',
369
+ 'fonction animation': 'animation-timing-function',
370
+ 'animation-fonction': 'animation-timing-function',
371
+ 'delai-animation': 'animation-delay',
372
+ 'delai animation': 'animation-delay',
373
+ 'animation-delai': 'animation-delay',
374
+ 'iterations-animation': 'animation-iteration-count',
375
+ 'iterations animation': 'animation-iteration-count',
376
+ 'animation-iterations': 'animation-iteration-count',
377
+ 'direction-animation': 'animation-direction',
378
+ 'direction animation': 'animation-direction',
379
+ 'animation-direction': 'animation-direction',
380
+ 'mode-remplissage-animation': 'animation-fill-mode',
381
+ 'mode remplissage animation': 'animation-fill-mode',
382
+ 'animation-mode-remplissage': 'animation-fill-mode',
383
+ 'etat-lecture-animation': 'animation-play-state',
384
+ 'etat lecture animation': 'animation-play-state',
385
+ 'animation-etat-lecture': 'animation-play-state',
386
+ 'ajustement-objet': 'object-fit',
387
+ 'ajustement objet': 'object-fit',
388
+ 'objet-ajustement': 'object-fit',
389
+ 'position-objet': 'object-position',
390
+ 'position objet': 'object-position',
391
+ 'objet-position': 'object-position',
392
+ 'selection-utilisateur': 'user-select',
393
+ 'selection utilisateur': 'user-select',
394
+ 'utilisateur-selection': 'user-select',
395
+ 'evenements-pointeur': 'pointer-events',
396
+ 'evenements pointeur': 'pointer-events',
397
+ 'pointeur-evenements': 'pointer-events',
398
+ 'comportement-tactile': 'touch-action',
399
+ 'comportement tactile': 'touch-action',
400
+ 'tactile-comportement': 'touch-action',
401
+ 'sens-ecriture': 'writing-mode',
402
+ 'sens ecriture': 'writing-mode',
403
+ 'ecriture-sens': 'writing-mode',
404
+ 'direction-texte': 'direction',
405
+ 'direction texte': 'direction',
406
+ 'texte-direction': 'direction',
407
+ 'orientation-texte': 'text-orientation',
408
+ 'orientation texte': 'text-orientation',
409
+ 'texte-orientation': 'text-orientation',
410
+ 'colonnes': 'columns',
411
+ 'nombre-colonnes': 'column-count',
412
+ 'nombre colonnes': 'column-count',
413
+ 'colonnes-nombre': 'column-count',
414
+ 'largeur-colonnes': 'column-width',
415
+ 'largeur colonnes': 'column-width',
416
+ 'colonnes-largeur': 'column-width',
417
+ 'ecart-colonnes': 'column-gap',
418
+ 'ecart colonnes': 'column-gap',
419
+ 'colonnes-ecart': 'column-gap',
420
+ 'regle-colonnes': 'column-rule',
421
+ 'regle colonnes': 'column-rule',
422
+ 'colonnes-regle': 'column-rule',
423
+ 'etendue-colonnes': 'column-span',
424
+ 'etendue colonnes': 'column-span',
425
+ 'colonnes-etendue': 'column-span',
426
+ 'remplissage-colonnes': 'column-fill',
427
+ 'remplissage colonnes': 'column-fill',
428
+ 'colonnes-remplissage': 'column-fill',
429
+ 'modele-boite': 'box-sizing',
430
+ 'modele boite': 'box-sizing',
431
+ 'boite-modele': 'box-sizing',
432
+ 'dimensionnement-boite': 'box-sizing',
433
+ 'dimensionnement boite': 'box-sizing',
434
+ 'couleur-caret': 'caret-color',
435
+ 'couleur caret': 'caret-color',
436
+ 'caret-couleur': 'caret-color',
437
+ 'couleur-curseur': 'caret-color',
438
+ 'couleur curseur texte': 'caret-color',
439
+ 'couleur-accent': 'accent-color',
440
+ 'couleur accent': 'accent-color',
441
+ 'accent-couleur': 'accent-color',
442
+ 'schema-couleurs': 'color-scheme',
443
+ 'schema couleurs': 'color-scheme',
444
+ 'couleurs-schema': 'color-scheme',
445
+ 'ratio-aspect': 'aspect-ratio',
446
+ 'ratio aspect': 'aspect-ratio',
447
+ 'aspect-ratio': 'aspect-ratio',
448
+ 'rapport-aspect': 'aspect-ratio',
449
+ 'rapport aspect': 'aspect-ratio',
450
+ 'rapport-proportions': 'aspect-ratio',
451
+ 'rapport proportions': 'aspect-ratio',
452
+ 'contenir': 'contain',
453
+ 'confinement': 'contain',
454
+ 'isolation': 'isolation',
455
+ 'volonte-changement': 'will-change',
456
+ 'volonte changement': 'will-change',
457
+ 'changement-volonte': 'will-change',
458
+ 'optimisation-changement': 'will-change',
459
+ 'optimisation changement': 'will-change',
460
+ 'masque': 'mask',
461
+ 'image-masque': 'mask-image',
462
+ 'image masque': 'mask-image',
463
+ 'masque-image': 'mask-image',
464
+ 'clip-masque': 'mask-clip',
465
+ 'clip masque': 'mask-clip',
466
+ 'masque-clip': 'mask-clip',
467
+ 'chemin-decoupe': 'clip-path',
468
+ 'chemin decoupe': 'clip-path',
469
+ 'decoupe-chemin': 'clip-path',
470
+ 'forme-exterieure': 'shape-outside',
471
+ 'forme exterieure': 'shape-outside',
472
+ 'exterieure-forme': 'shape-outside',
473
+ 'marge-forme': 'shape-margin',
474
+ 'marge forme': 'shape-margin',
475
+ 'forme-marge': 'shape-margin'
476
+ }
477
+
478
+ if (priorityMap[lower]) {
479
+ return priorityMap[lower]
480
+ }
481
+
111
482
  if (this.propertyMap && this.propertyMap[lower]) {
112
483
  return this.propertyMap[lower]
113
484
  }
@@ -460,6 +831,8 @@ class CSSGenerator {
460
831
  'couleur': 'color',
461
832
  'fond': 'background',
462
833
  'police': 'font-family',
834
+ 'famille-police': 'font-family',
835
+ 'famille police': 'font-family',
463
836
  'taille police': 'font-size',
464
837
  'taille-police': 'font-size',
465
838
  'poids police': 'font-weight',
@@ -532,16 +905,24 @@ class CSSGenerator {
532
905
  'bordure couleur': 'border-color',
533
906
  'bordure-couleur': 'border-color',
534
907
  'arrondi': 'border-radius',
908
+ 'rayon-bordure': 'border-radius',
909
+ 'rayon bordure': 'border-radius',
910
+ 'bordure-arrondie': 'border-radius',
911
+ 'bordure arrondie': 'border-radius',
535
912
  'largeur': 'width',
536
913
  'hauteur': 'height',
537
914
  'largeur minimum': 'min-width',
538
915
  'largeur-minimum': 'min-width',
916
+ 'min-largeur': 'min-width',
539
917
  'largeur maximum': 'max-width',
540
918
  'largeur-maximum': 'max-width',
919
+ 'max-largeur': 'max-width',
541
920
  'hauteur minimum': 'min-height',
542
921
  'hauteur-minimum': 'min-height',
922
+ 'min-hauteur': 'min-height',
543
923
  'hauteur maximum': 'max-height',
544
924
  'hauteur-maximum': 'max-height',
925
+ 'max-hauteur': 'max-height',
545
926
  'affichage': 'display',
546
927
  'position': 'position',
547
928
  'haut': 'top',
@@ -572,7 +953,9 @@ class CSSGenerator {
572
953
  'filtre': 'filter',
573
954
  'filtre-fond': 'backdrop-filter',
574
955
  'filtre fond': 'backdrop-filter',
575
- 'ombre-boîte': 'box-shadow',
956
+ 'flou-fond': 'backdrop-filter',
957
+ 'flou fond': 'backdrop-filter',
958
+ 'ombre-boîte': 'box-shadow',
576
959
  'ombre-boite': 'box-shadow',
577
960
  'ombre boîte': 'box-shadow',
578
961
  'ombre boite': 'box-shadow',
@@ -605,6 +988,8 @@ class CSSGenerator {
605
988
  'lignes grille': 'grid-template-rows',
606
989
  'style-liste': 'list-style',
607
990
  'style liste': 'list-style',
991
+ 'liste-style': 'list-style',
992
+ 'liste style': 'list-style',
608
993
  'contenu': 'content',
609
994
  'évènements-pointeur': 'pointer-events',
610
995
  'evenements-pointeur': 'pointer-events',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ether-code",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Ether - Le langage intentionnel",
5
5
  "main": "cli/compiler.js",
6
6
  "bin": {
@@ -24,11 +24,11 @@
24
24
  "license": "MIT",
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "https://github.com/ether-lang/ether"
27
+ "url": "https://github.com/ether-code/ether"
28
28
  },
29
29
  "homepage": "https://ether-code.com",
30
30
  "bugs": {
31
- "url": "https://github.com/ether-lang/ether/issues"
31
+ "url": "https://github.com/ether-code/ether/issues"
32
32
  },
33
33
  "engines": {
34
34
  "node": ">=14.0.0"