humalis 1.0.3 → 1.1.0

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 (47) hide show
  1. package/LICENSE +85 -201
  2. package/LICENSE.en.md +86 -0
  3. package/NOTICE +6 -3
  4. package/README.en.md +1 -1
  5. package/README.md +1 -1
  6. package/dist/analyse/accessibilite.js +13 -5
  7. package/dist/analyse/analyse.js +43 -3
  8. package/dist/analyse/ecran.js +1 -1
  9. package/dist/analyse/langues.js +30 -10
  10. package/dist/analyse/medias.js +4 -1
  11. package/dist/analyse/navigation.js +35 -0
  12. package/dist/analyse/niveaux.js +33 -0
  13. package/dist/analyse/noms.js +1 -1
  14. package/dist/analyse/site.js +30 -8
  15. package/dist/cibles/commun/colorerCode.js +59 -0
  16. package/dist/cibles/commun/mouvement.js +110 -4
  17. package/dist/cibles/mobile/projet.js +7 -2
  18. package/dist/cibles/mobile/rendu.js +6 -3
  19. package/dist/cibles/statique/elements-js.js +1 -1
  20. package/dist/cibles/statique/page.js +99 -6
  21. package/dist/cibles/statique/projet.js +31 -0
  22. package/dist/cibles/statique/valeurs.js +5 -1
  23. package/dist/cibles/statique/widgets.js +1 -1
  24. package/dist/cibles/web/css-ecran.js +22 -1
  25. package/dist/cibles/web/ecran.js +161 -16
  26. package/dist/cibles/web/interactions.js +50 -3
  27. package/dist/cibles/web/projet.js +29 -2
  28. package/dist/cibles/web/theme.js +11 -2
  29. package/dist/cibles/web/valeurs.js +17 -0
  30. package/dist/cibles/web/widgets.js +1 -1
  31. package/dist/i18n/messages.js +2 -0
  32. package/dist/lexer/lexer.js +106 -3
  33. package/dist/navigateur.js +5274 -0
  34. package/dist/parser/interactions.js +6 -2
  35. package/dist/parser/langues.js +1 -1
  36. package/dist/parser/medias.js +6 -1
  37. package/dist/parser/miseEnPage.js +1 -1
  38. package/dist/parser/parser.js +85 -3
  39. package/dist/parser/theme.js +10 -1
  40. package/dist/ri/construire.js +24 -1
  41. package/dist/vocabulaire/table-ecran.js +3 -3
  42. package/dist/vocabulaire/table-interactions.js +16 -1
  43. package/dist/vocabulaire/table.js +4 -4
  44. package/docs/guide.en.md +170 -2
  45. package/docs/guide.md +171 -1
  46. package/llms.txt +14 -1
  47. package/package.json +7 -4
package/LICENSE CHANGED
@@ -1,202 +1,86 @@
1
+ Licence Humalis — version 1.0
1
2
 
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
3
+ Copyright © 2026 Les auteurs de Humalis. Humalis a été créé par emch04.
4
+ Le texte français de cette licence fait foi ; toute traduction n'est donnée qu'à titre d'information.
5
+
6
+ 1. Définitions
7
+
8
+ - Le Logiciel : le compilateur Humalis, ses outils en ligne de commande, son extension d'éditeur,
9
+ son code source, sa documentation et les fichiers distribués sous cette licence, à l'exclusion des
10
+ composants de tiers régis par leur propre licence.
11
+ - Une Application : un logiciel créé avec le Logiciel, c'est-à-dire les fichiers écrits en Humalis et
12
+ tout ce que le compilateur génère à partir d'eux, y compris les fichiers d'aide que le compilateur
13
+ copie dans les projets qu'il produit.
14
+ - La Commercialisation du Logiciel : vendre, louer ou concéder contre paiement le Logiciel lui-même
15
+ (une copie, une version modifiée ou renommée), ou le présenter comme son propre produit.
16
+ Ne sont pas une Commercialisation du Logiciel :
17
+ - vendre une Application faite avec Humalis ;
18
+ - vendre ses services pour créer des Applications avec Humalis ;
19
+ - proposer, gratuitement ou contre paiement, une plateforme ou un service qui utilise le Logiciel
20
+ pour créer, héberger ou faire fonctionner des Applications pour ses utilisateurs, y compris quand
21
+ ces utilisateurs écrivent eux-mêmes en Humalis ;
22
+ - enseigner Humalis, écrire ou vendre des livres, des cours ou des formations sur Humalis.
23
+ - Une Modification : tout changement apporté au Logiciel, y compris une copie dérivée (« fork »).
24
+
25
+ 2. Ce que tu as le droit de faire
26
+
27
+ Gratuitement, partout dans le monde, à condition de respecter cette licence, tu peux :
28
+ (a) télécharger, lire, exécuter et utiliser le Logiciel, à titre personnel, éducatif, de recherche,
29
+ ou dans une entreprise, y compris pour créer des applications commerciales ;
30
+ (b) modifier le Logiciel ;
31
+ (c) créer, déployer, distribuer et vendre des Applications, sans rien devoir aux auteurs de Humalis ;
32
+ (d) partager gratuitement le Logiciel, tel quel ou modifié, aux conditions suivantes :
33
+ - joindre cette licence et les mentions de droits d'auteur ;
34
+ - pour une version modifiée : indiquer clairement qu'elle est modifiée, ne pas l'appeler
35
+ « Humalis » ni laisser croire qu'elle est la version officielle, et la partager sous cette
36
+ même licence (elle ne peut donc pas non plus être vendue).
37
+
38
+ 3. Ce qui est interdit
39
+
40
+ Sans l'accord écrit préalable des auteurs de Humalis, tu ne peux pas :
41
+ (a) commercialiser le Logiciel, y compris une version modifiée ou renommée ;
42
+ (b) partager une Modification du Logiciel sans respecter les conditions de l'article 2 (d), ou la
43
+ partager sous une autre licence ;
44
+ (c) retirer, falsifier ou masquer les mentions de droits d'auteur, d'attribution ou de licence ;
45
+ (d) utiliser le nom « Humalis », son logo ou ses marques d'une façon qui laisse croire à un soutien ou
46
+ à un statut officiel ;
47
+ (e) accorder des droits sur le Logiciel à d'autres conditions que celles de cette licence.
48
+
49
+ 4. Ce que tu crées t'appartient
50
+
51
+ Les auteurs de Humalis ne revendiquent aucun droit sur les Applications. Tu peux les modifier, les
52
+ distribuer et les vendre librement. Les fichiers d'aide que le compilateur copie dans une Application
53
+ en font partie : tu peux les utiliser, les modifier, les distribuer et les vendre avec elle, sans
54
+ autre condition. Les interdictions de l'article 3 ne s'appliquent jamais à une Application.
55
+
56
+ 5. Contributions
57
+
58
+ Proposer une modification ne transfère aucun droit de propriété. Les contributions ne sont acceptées
59
+ que selon des conditions écrites séparées.
60
+
61
+ 6. Propriété et marques
62
+
63
+ Tous les droits non accordés expressément sont réservés. Cette licence ne transfère aucun droit de
64
+ propriété, de brevet ou de marque.
65
+
66
+ 7. Fin des droits
67
+
68
+ Tes droits prennent fin si tu enfreins gravement cette licence et ne corriges pas l'infraction dans
69
+ les 30 jours suivant un avertissement écrit, lorsque la correction est possible. Les Applications que
70
+ tu as déjà créées restent à toi.
71
+
72
+ 8. Aucune garantie
73
+
74
+ Dans les limites permises par la loi, le Logiciel est fourni « tel quel », sans garantie d'aucune
75
+ sorte, et les auteurs de Humalis ne sont responsables d'aucun dommage indirect lié à son utilisation.
76
+ Rien dans cette licence n'exclut une responsabilité que la loi interdit d'exclure.
77
+
78
+ 9. Droit applicable
79
+
80
+ Cette licence est régie par le droit français.
81
+
82
+ 10. Versions précédentes et composants de tiers
83
+
84
+ Cette licence ne s'applique qu'aux versions publiées sous elle. Les versions publiées sous la licence
85
+ Apache 2.0 (1.0.0 à 1.0.3) restent sous cette licence. Les composants de tiers gardent leur propre
86
+ licence.
package/LICENSE.en.md ADDED
@@ -0,0 +1,86 @@
1
+ Humalis License — version 1.0 (English translation)
2
+
3
+ This is a translation for information only. The French text in the LICENSE file is the only
4
+ authoritative version.
5
+
6
+ Copyright © 2026 The Humalis authors ("Les auteurs de Humalis"). Humalis was created by
7
+ emch04.
8
+
9
+ 1. Definitions
10
+
11
+ - The Software: the Humalis compiler, its command-line tools, its editor extension, its source code,
12
+ its documentation and the files distributed under this license, excluding third-party components
13
+ governed by their own licenses.
14
+ - An Application: software created with the Software, that is, the files written in Humalis and
15
+ everything the compiler generates from them, including the helper files the compiler copies into
16
+ the projects it produces.
17
+ - Commercialisation of the Software: selling, renting or licensing for a fee the Software itself (a
18
+ copy, a modified or renamed version), or presenting it as one's own product.
19
+ The following are not Commercialisation of the Software:
20
+ - selling an Application made with Humalis;
21
+ - selling one's services to create Applications with Humalis;
22
+ - offering, free of charge or for a fee, a platform or service that uses the Software to create,
23
+ host or run Applications for its users, including when those users write Humalis themselves;
24
+ - teaching Humalis, writing or selling books, courses or training about Humalis.
25
+ - A Modification: any change made to the Software, including a derived copy ("fork").
26
+
27
+ 2. What you may do
28
+
29
+ Free of charge, worldwide, provided you comply with this license, you may:
30
+ (a) download, read, run and use the Software, for personal, educational or research purposes, or in
31
+ a company, including to create commercial applications;
32
+ (b) modify the Software;
33
+ (c) create, deploy, distribute and sell Applications, owing nothing to the Humalis authors;
34
+ (d) share the Software free of charge, unmodified or modified, under the following conditions:
35
+ - include this license and the copyright notices;
36
+ - for a modified version: state clearly that it is modified, do not call it "Humalis" or imply
37
+ that it is the official version, and share it under this same license (so it cannot be sold
38
+ either).
39
+
40
+ 3. What is prohibited
41
+
42
+ Without the prior written permission of the Humalis authors, you may not:
43
+ (a) commercialise the Software, including a modified or renamed version;
44
+ (b) share a Modification of the Software without meeting the conditions of article 2 (d), or share
45
+ it under another license;
46
+ (c) remove, falsify or obscure copyright, attribution or license notices;
47
+ (d) use the "Humalis" name, logo or trademarks in a way that suggests sponsorship or official status;
48
+ (e) grant rights in the Software on terms other than those of this license.
49
+
50
+ 4. What you create belongs to you
51
+
52
+ The Humalis authors claim no rights in Applications. You may modify, distribute and sell them freely.
53
+ The helper files the compiler copies into an Application are part of it: you may use, modify,
54
+ distribute and sell them with it, without any other condition. The prohibitions of article 3 never
55
+ apply to an Application.
56
+
57
+ 5. Contributions
58
+
59
+ Proposing a change does not transfer any ownership. Contributions are accepted only under separate
60
+ written terms.
61
+
62
+ 6. Ownership and trademarks
63
+
64
+ All rights not expressly granted are reserved. This license transfers no ownership, patent or
65
+ trademark rights.
66
+
67
+ 7. Termination
68
+
69
+ Your rights end if you seriously breach this license and do not cure the breach within 30 days of a
70
+ written notice, where a cure is possible. The Applications you have already created remain yours.
71
+
72
+ 8. No warranty
73
+
74
+ To the extent permitted by law, the Software is provided "as is", without warranty of any kind, and
75
+ the Humalis authors are not liable for any indirect damage arising from its use. Nothing in this
76
+ license excludes liability that the law does not allow to be excluded.
77
+
78
+ 9. Governing law
79
+
80
+ This license is governed by French law.
81
+
82
+ 10. Previous versions and third-party components
83
+
84
+ This license applies only to the versions released under it. The versions released under the Apache
85
+ License 2.0 (1.0.0 to 1.0.3) remain under that license. Third-party components keep their own
86
+ licenses.
package/NOTICE CHANGED
@@ -1,10 +1,13 @@
1
1
  Humalis
2
2
  Copyright 2026 Les auteurs de Humalis
3
3
 
4
- Humalis a été créé par kongo bola emmanouch.
4
+ Humalis a été créé par emch04.
5
5
 
6
- Ce logiciel est distribué sous la licence Apache, version 2.0 : voir le
7
- fichier LICENSE, ou https://www.apache.org/licenses/LICENSE-2.0.
6
+ Ce logiciel est distribué sous la Licence Humalis, version 1.0 : voir le
7
+ fichier LICENSE (texte français, qui fait foi) et LICENSE.en.md (traduction
8
+ anglaise). Tout le monde peut l'utiliser, le modifier et le partager
9
+ gratuitement ; personne ne peut vendre Humalis lui-même. Les versions 1.0.0 à
10
+ 1.0.3 restent sous la licence Apache 2.0.
8
11
 
9
12
  Le nom « Humalis » et son logo ne sont pas couverts par cette licence
10
13
  (article 6) : ils ne peuvent pas servir à présenter un autre produit
package/README.en.md CHANGED
@@ -140,6 +140,6 @@ The [`llms.txt`](llms.txt) file, shipped with the package, sums up the grammar,
140
140
 
141
141
  ## Licence
142
142
 
143
- [Apache 2.0](LICENSE). Copyright 2026 The Humalis authors ("Les auteurs de Humalis"); Humalis was created by kongo bola emmanouch (see [`NOTICE`](NOTICE)).
143
+ [Humalis License](LICENSE.en.md) (the French text in [`LICENSE`](LICENSE) is authoritative): you may use, modify and share Humalis free of charge, but not sell it. Copyright 2026 The Humalis authors ("Les auteurs de Humalis"); Humalis was created by emch04 (see [`NOTICE`](NOTICE)).
144
144
 
145
145
  The code Humalis produces (sites, apps, servers) belongs to you, with no obligations. The "Humalis" name and logo are not covered by the licence.
package/README.md CHANGED
@@ -138,6 +138,6 @@ Le fichier [`llms.txt`](llms.txt), livré avec le paquet, résume la grammaire,
138
138
 
139
139
  ## Licence
140
140
 
141
- [Apache 2.0](LICENSE). Copyright 2026 Les auteurs de Humalis ; Humalis a été créé par kongo bola emmanouch (voir [`NOTICE`](NOTICE)).
141
+ [Licence Humalis](LICENSE) : tu peux utiliser, modifier et partager Humalis gratuitement, mais pas le vendre. Copyright 2026 Les auteurs de Humalis ; Humalis a été créé par emch04 (voir [`NOTICE`](NOTICE)).
142
142
 
143
143
  Le code que Humalis produit (sites, applications, serveurs) t'appartient, sans aucune obligation. Le nom « Humalis » et son logo ne sont pas couverts par la licence.
@@ -5,7 +5,7 @@ const SEUIL_NORMAL = 4.5;
5
5
  const SEUIL_GRAND = 3;
6
6
  const motsVides = new Set(['image', 'photo']);
7
7
  /** Vérifications qui demandent une intention explicite de l'auteur. */
8
- export function verifierAccessibilite(page, theme) {
8
+ export function verifierAccessibilite(page, theme, modes = ['clair', 'sombre']) {
9
9
  const diagnostics = [];
10
10
  const signaler = (gravite, message, ligne) => diagnostics.push({ gravite, categorie: 'accessibilite', message, ligne });
11
11
  let titres = 0;
@@ -69,7 +69,7 @@ export function verifierAccessibilite(page, theme) {
69
69
  niveauPrecedent = niveau;
70
70
  }
71
71
  if (['texte', 'titre', 'bouton', 'lien', 'champ'].includes(element.element))
72
- verifierContraste(element, theme, signaler);
72
+ verifierContraste(element, theme, modes, signaler);
73
73
  }
74
74
  else if (instruction.type === 'Formulaire')
75
75
  parcours(instruction.corps, new Map());
@@ -83,8 +83,14 @@ export function verifierAccessibilite(page, theme) {
83
83
  else if (instruction.type === 'Bloc' || instruction.type === 'Boucle')
84
84
  parcours(instruction.corps, champs);
85
85
  else if (instruction.type === 'Condition') {
86
+ // Les deux branches s'excluent (« si langue est anglais » / « sinon ») : un titre dans
87
+ // chacune ne fait qu'un titre affiché. On garde le plus grand des deux comptes.
88
+ const avant = titres;
86
89
  parcours(instruction.alors, champs);
90
+ const apresAlors = titres;
91
+ titres = avant;
87
92
  parcours(instruction.sinon, champs);
93
+ titres = Math.max(titres, apresAlors);
88
94
  }
89
95
  }
90
96
  };
@@ -93,18 +99,20 @@ export function verifierAccessibilite(page, theme) {
93
99
  if (!clics.has(survol.cible))
94
100
  signaler('avertissement', 'ce survol n’a pas d’action au clic : le clavier et les écrans tactiles ne peuvent pas le déclencher.', survol.ligne);
95
101
  }
96
- if (titres === 0)
102
+ // Une page qui montre ses sous-pages (« sous page ») laisse le titre principal à chacune d'elles.
103
+ const montreSesSousPages = JSON.stringify(page.corps).includes('"type":"SousPage"');
104
+ if (titres === 0 && !montreSesSousPages)
97
105
  signaler('avertissement', `la page « ${page.nom} » n'a pas de titre principal. Ajoutez « titre "…" ».`, page.ligne);
98
106
  return diagnostics;
99
107
  }
100
- function verifierContraste(element, theme, signaler) {
108
+ function verifierContraste(element, theme, modes, signaler) {
101
109
  const valeur = (nom) => element.styles.find((s) => s.propriete === nom)?.valeur;
102
110
  const couleur = valeur('couleur') ?? valeur('texte');
103
111
  const fond = valeur('fond');
104
112
  if (!couleur && !fond)
105
113
  return;
106
114
  const seuil = valeur('taille') === 'grande' ? SEUIL_GRAND : SEUIL_NORMAL;
107
- for (const mode of ['clair', 'sombre']) {
115
+ for (const mode of modes) {
108
116
  const hex = (nom) => theme.get(nom)?.[mode] ?? COULEURS_CSS[nom]?.[mode];
109
117
  const fondHex = fond ? hex(fond) : FOND_PAGE[mode];
110
118
  const encreHex = couleur ? hex(couleur) : fondHex ? encreSur(fondHex) : undefined;
@@ -7,6 +7,7 @@ import { ElementsPage } from './elements.js';
7
7
  import { optionCanonique, erreurSurElement, OPTIONS } from './styles.js';
8
8
  import { contraste, FOND_PAGE } from './couleurs.js';
9
9
  import { verifierAccessibilite } from './accessibilite.js';
10
+ import { niveauxDesSousTitres } from './niveaux.js';
10
11
  import { verifierElementEcran, verifierBlocEcran } from './ecran.js';
11
12
  import { verifierChoixFichier, verifierEnvoiFichier, typeFichierChoisi, aUnApercu, recenserFichiers } from './fichiers.js';
12
13
  import { verifierCarte, verifierMarqueur } from './carte.js';
@@ -44,6 +45,16 @@ const gardeDe = (test) => {
44
45
  * modifie pas l'arbre et collecte toutes les erreurs au lieu de
45
46
  * s'arrêter à la première.
46
47
  */
48
+ /**
49
+ * Les modes que l'application peut montrer. « mode clair » ou « mode sombre » n'en laisse qu'un,
50
+ * sauf si un bouton change le thème (« changer theme par … », « basculer theme »).
51
+ */
52
+ function modesVus(programme) {
53
+ const mode = programme.theme?.mode?.valeur;
54
+ if (mode !== 'clair' && mode !== 'sombre')
55
+ return ['clair', 'sombre'];
56
+ return JSON.stringify(programme).includes('"action":"changerTheme"') ? ['clair', 'sombre'] : [mode];
57
+ }
47
58
  export function analyserSens(programme) {
48
59
  const resultat = {
49
60
  diagnostics: [],
@@ -72,11 +83,17 @@ export function analyserSens(programme) {
72
83
  fenetres: new Map(),
73
84
  blocsNommes: new Map(),
74
85
  valeursTheme: new Map((programme.theme?.couleurs ?? []).map((c) => [c.nom, { clair: c.clair, sombre: c.sombre ?? c.clair }])),
86
+ modesVus: modesVus(programme),
75
87
  langues: { langues: [], traductions: new Map() },
76
88
  referencesLangue: new Map(),
77
89
  changementsLangue: new Map(),
78
90
  };
79
91
  // Les langues d'abord : avec elles, « langue » et « anglais » sont des valeurs intégrées.
92
+ // Le niveau automatique des sous-titres, avant tout ce qui lit ces niveaux.
93
+ for (const corps of [...programme.pages.map((p) => p.corps), programme.entete?.corps, programme.pied?.corps, ...programme.composants.map((c) => c.corps)]) {
94
+ if (corps)
95
+ niveauxDesSousTitres(corps);
96
+ }
80
97
  resultat.langues = analyserLangues(programme, resultat.diagnostics);
81
98
  languesActives.clear();
82
99
  for (const langue of resultat.langues.langues)
@@ -160,7 +177,7 @@ export function analyserSens(programme) {
160
177
  }
161
178
  for (const page of programme.pages) {
162
179
  new AnalysePage(page, nomsPages, resultat, classes, partages, composants, [], liens, fonctions).analyser();
163
- resultat.diagnostics.push(...verifierAccessibilite(page, resultat.valeursTheme));
180
+ resultat.diagnostics.push(...verifierAccessibilite(page, resultat.valeursTheme, resultat.modesVus));
164
181
  for (const [sans, genre] of [[page.sansEntete, 'entete'], [page.sansPied, 'pied']]) {
165
182
  if (sans && !programme[genre]) {
166
183
  resultat.diagnostics.push({
@@ -614,6 +631,24 @@ class AnalysePage {
614
631
  case 'Bloc':
615
632
  this.blocMiseEnPage(instruction, contexte, place);
616
633
  return;
634
+ case 'CodeDocumentation':
635
+ if (contexte === 'evenement')
636
+ this.erreur('un bloc de code se place dans une page.', instruction.ligne);
637
+ return;
638
+ case 'TableauDocumentation':
639
+ if (!instruction.legende)
640
+ this.erreur('un tableau attend une légende entre guillemets : tableau "Commandes" :', instruction.ligne);
641
+ if (instruction.colonnes.length === 0)
642
+ this.erreur('un tableau attend une ligne « colonnes ».', instruction.ligne);
643
+ for (const rangee of instruction.rangees) {
644
+ if (instruction.colonnes.length > 0 && rangee.length !== instruction.colonnes.length)
645
+ this.erreur(`la rangée a ${rangee.length} cellules, mais le tableau a ${instruction.colonnes.length} colonnes.`, rangee[0]?.ligne ?? instruction.ligne);
646
+ }
647
+ if (instruction.legende)
648
+ this.typeDe(instruction.legende);
649
+ instruction.colonnes.forEach((cellule) => this.typeDe(cellule));
650
+ instruction.rangees.flat().forEach((cellule) => this.typeDe(cellule));
651
+ return;
617
652
  case 'Action':
618
653
  this.action(instruction, contexte);
619
654
  if (instruction.message) {
@@ -1039,6 +1074,7 @@ class AnalysePage {
1039
1074
  const valeur = this.resultat.valeursTheme.get(option.valeur) ?? COULEURS_CSS[option.valeur];
1040
1075
  return { nom: option.valeur, clair: valeur.clair, sombre: valeur.sombre };
1041
1076
  },
1077
+ modes: this.resultat.modesVus,
1042
1078
  });
1043
1079
  }
1044
1080
  /** Un texte dans une couleur du thème qui se verrait mal sur le fond de la page (contraste inférieur à 3:1). */
@@ -1048,7 +1084,7 @@ class AnalysePage {
1048
1084
  const couleur = this.resultat.valeursTheme.get(valeur);
1049
1085
  if (!couleur)
1050
1086
  return;
1051
- for (const mode of ['clair', 'sombre']) {
1087
+ for (const mode of this.resultat.modesVus) {
1052
1088
  const rapport = contraste(couleur[mode], FOND_PAGE[mode]);
1053
1089
  if (rapport < 3) {
1054
1090
  this.avertissement(`la couleur « ${valeur} » (mode ${mode}) se voit mal sur le fond de la page (contraste ${rapport.toFixed(1).replace('.', ',')} pour 1, il en faut au moins 3). Choisissez une couleur plus ${mode === 'clair' ? 'foncée' : 'claire'} pour ce mode.`, ligne);
@@ -1100,7 +1136,7 @@ class AnalysePage {
1100
1136
  return;
1101
1137
  case 'changerTheme': {
1102
1138
  const valeur = texteLitteral(action.arguments[0]);
1103
- if (valeur === undefined || !['clair', 'sombre', 'automatique'].includes(valeur)) {
1139
+ if (valeur === undefined || !['clair', 'sombre', 'automatique', 'bascule'].includes(valeur)) {
1104
1140
  this.erreur(`« changer theme par … » prend clair, sombre ou automatique (ici : « ${valeur ?? '?'} »).`, action.ligne);
1105
1141
  }
1106
1142
  return;
@@ -1364,6 +1400,9 @@ class AnalysePage {
1364
1400
  typeDe(expression) {
1365
1401
  switch (expression.type) {
1366
1402
  case 'Chaine':
1403
+ if ([expression.parties, ...(expression.versions?.map((v) => v.parties) ?? [])].some((parties) => parties.some((p) => p.type === 'accent')) && !['titre', 'soustitre', 'texte'].includes(this.elementEnCours ?? '')) {
1404
+ this.erreur('accent s’emploie seulement dans un titre, un soustitre ou un texte.', expression.ligne);
1405
+ }
1367
1406
  this.interpolations(expression);
1368
1407
  this.versionsLues(expression);
1369
1408
  return TEXTE;
@@ -1464,6 +1503,7 @@ class AnalysePage {
1464
1503
  this.usagesEtat.push({ nom: expression.variable, ligne: expression.ligne, mot: 'erreur de' });
1465
1504
  return TEXTE;
1466
1505
  case 'MouvementReduit':
1506
+ case 'ThemeSombre':
1467
1507
  return BOOLEEN;
1468
1508
  case 'EtatUtilisateur':
1469
1509
  this.litLaSession = true;
@@ -38,7 +38,7 @@ export function verifierElementEcran(element, s) {
38
38
  break;
39
39
  case 'avatar':
40
40
  if (texte !== undefined && texte.trim() === '')
41
- s.erreur('un avatar prend le nom de la personne : avatar "Emch Kongo".', ligne);
41
+ s.erreur('un avatar prend le nom de la personne : avatar "Camille Martin".', ligne);
42
42
  break;
43
43
  case 'progression': {
44
44
  const type = s.typeDe(contenu);