humalis 1.1.0 → 1.2.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.
- package/dist/analyse/niveaux.js +34 -0
- package/dist/cibles/mobile/projet.js +3 -0
- package/dist/cibles/statique/page.js +2 -2
- package/dist/cibles/statique/projet.js +15 -0
- package/dist/cibles/web/css-ecran.js +9 -0
- package/dist/cibles/web/ecran.js +1 -1
- package/dist/cibles/web/interactions.js +14 -0
- package/dist/cibles/web/projet.js +2 -0
- package/dist/navigateur.js +80 -65
- package/dist/parser/parser.js +11 -5
- package/dist/ri/construire.js +3 -0
- package/docs/guide.en.md +20 -7
- package/docs/guide.md +20 -8
- package/package.json +1 -1
package/dist/parser/parser.js
CHANGED
|
@@ -776,7 +776,7 @@ function estBlocMiseEnPage(flux) {
|
|
|
776
776
|
const suivant = flux.regarder(1);
|
|
777
777
|
return ((suivant.type === 'PONCTUATION' && suivant.valeur === ':') ||
|
|
778
778
|
(suivant.type === 'MOT_CLE' && suivant.valeur === 'avec') ||
|
|
779
|
-
(genre === 'menu' && estLeMot(suivant, 'repliable')) ||
|
|
779
|
+
(genre === 'menu' && (estLeMot(suivant, 'repliable') || estLeMot(suivant, 'vertical'))) ||
|
|
780
780
|
((genre === 'section' || GENRES_AVEC_TITRE.includes(genre)) && suivant.type === 'CHAINE'));
|
|
781
781
|
}
|
|
782
782
|
function analyserBlocMiseEnPage(flux) {
|
|
@@ -786,9 +786,15 @@ function analyserBlocMiseEnPage(flux) {
|
|
|
786
786
|
flux.avancer();
|
|
787
787
|
const genre = filAriane ? 'filAriane' : GENRES_BLOC.find((g) => estLeMot(debut, g));
|
|
788
788
|
// « menu repliable : » : sur un petit écran, un bouton « Menu » ouvre et ferme les liens.
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
789
|
+
// « menu vertical : » : les liens en colonne. Les deux se combinent, dans n'importe quel ordre.
|
|
790
|
+
let repliable = false;
|
|
791
|
+
let vertical = false;
|
|
792
|
+
while (genre === 'menu' && (estLeMot(flux.actuel(), 'repliable') || estLeMot(flux.actuel(), 'vertical'))) {
|
|
793
|
+
if (estLeMot(flux.avancer(), 'repliable'))
|
|
794
|
+
repliable = true;
|
|
795
|
+
else
|
|
796
|
+
vertical = true;
|
|
797
|
+
}
|
|
792
798
|
// Le titre d'une section devient son premier élément : un « titre » comme les autres.
|
|
793
799
|
const titre = [];
|
|
794
800
|
let titreBloc;
|
|
@@ -824,7 +830,7 @@ function analyserBlocMiseEnPage(flux) {
|
|
|
824
830
|
} while (flux.accepter('MOT_CLE', 'et'));
|
|
825
831
|
}
|
|
826
832
|
flux.attendre('PONCTUATION', ':', `deux-points à la fin de la ligne « ${genre} », puis son contenu en dessous, décalé`);
|
|
827
|
-
return { type: 'Bloc', genre, styles, classes, ...(titreBloc ? { titre: titreBloc } : {}), ...(ancre !== undefined ? { ancre } : {}), ...(nom !== undefined ? { nom } : {}), ...(repliable ? { repliable } : {}), corps: [...titre, ...analyserBloc(flux)], ligne: debut.ligne };
|
|
833
|
+
return { type: 'Bloc', genre, styles, classes, ...(titreBloc ? { titre: titreBloc } : {}), ...(ancre !== undefined ? { ancre } : {}), ...(nom !== undefined ? { nom } : {}), ...(repliable ? { repliable } : {}), ...(vertical ? { vertical } : {}), corps: [...titre, ...analyserBloc(flux)], ligne: debut.ligne };
|
|
828
834
|
}
|
|
829
835
|
function lireNombre(flux, description) {
|
|
830
836
|
const negatif = flux.accepter('PONCTUATION', '-');
|
package/dist/ri/construire.js
CHANGED
|
@@ -691,6 +691,9 @@ class Construction {
|
|
|
691
691
|
// « menu repliable » : la marque que lisent le CSS et le bouton « Menu ».
|
|
692
692
|
if (instruction.repliable)
|
|
693
693
|
options.push({ nom: 'menu', valeur: 'repliable' });
|
|
694
|
+
// « menu vertical » : la colonne que lit le CSS.
|
|
695
|
+
if (instruction.vertical)
|
|
696
|
+
options.push({ nom: 'menu', valeur: 'vertical' });
|
|
694
697
|
const noeud = {
|
|
695
698
|
type: 'bloc',
|
|
696
699
|
genre: instruction.genre,
|
package/docs/guide.en.md
CHANGED
|
@@ -187,8 +187,10 @@ Keep the levels in order, without skipping: screen readers use them to move
|
|
|
187
187
|
through the page.
|
|
188
188
|
|
|
189
189
|
Inside a block placed under a subtitle, a `soustitre` goes down one level on its
|
|
190
|
-
own: a card in a section becomes level 3.
|
|
191
|
-
|
|
190
|
+
own: a card in a section becomes level 3. In a `section`, the first subtitle is
|
|
191
|
+
the section's title, even when it sits in its own block; every other subtitle of
|
|
192
|
+
the section goes down one level. `avec niveau` (with level) still lets you
|
|
193
|
+
choose.
|
|
192
194
|
|
|
193
195
|
```humalis
|
|
194
196
|
page "home" :
|
|
@@ -608,12 +610,23 @@ page "menu" :
|
|
|
608
610
|
```
|
|
609
611
|
|
|
610
612
|
`fil d'Ariane` is a breadcrumb. In a `menu`, the link to the current page is
|
|
611
|
-
marked as active. The links of a menu wrap when space runs out. A menu
|
|
612
|
-
|
|
613
|
-
|
|
613
|
+
marked as active. The links of a menu wrap when space runs out. A `menu
|
|
614
|
+
vertical :` stacks its links in a column and never starts a second column: a
|
|
615
|
+
table of contents with a limited height scrolls. It combines with `repliable`
|
|
616
|
+
(`menu vertical repliable :`).
|
|
614
617
|
|
|
615
|
-
|
|
616
|
-
|
|
618
|
+
```humalis
|
|
619
|
+
page "guide" :
|
|
620
|
+
titre "The guide"
|
|
621
|
+
menu vertical :
|
|
622
|
+
lien "Install" vers "guide"
|
|
623
|
+
lien "Pages" vers "guide"
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
A `menu repliable :` (collapsible menu) folds behind a burger button (named
|
|
627
|
+
"Menu" for screen readers) on a small screen (phone); the icon turns into a cross
|
|
628
|
+
while the menu is open. Choosing a link, tapping outside or pressing Escape
|
|
629
|
+
closes it. On a large screen it stays open:
|
|
617
630
|
|
|
618
631
|
```humalis
|
|
619
632
|
page "home" :
|
package/docs/guide.md
CHANGED
|
@@ -176,8 +176,10 @@ l'ordre des niveaux, sans en sauter : les lecteurs d'écran s'en servent pour
|
|
|
176
176
|
parcourir la page.
|
|
177
177
|
|
|
178
178
|
Dans un bloc placé sous un sous-titre, un `soustitre` descend d'un niveau tout
|
|
179
|
-
seul : la carte d'une section devient un niveau 3.
|
|
180
|
-
|
|
179
|
+
seul : la carte d'une section devient un niveau 3. Dans une `section`, le premier
|
|
180
|
+
sous-titre est le titre de la section, même rangé dans son propre bloc ; tous les
|
|
181
|
+
autres sous-titres de la section descendent d'un niveau. `avec niveau` reste
|
|
182
|
+
possible pour choisir soi-même.
|
|
181
183
|
|
|
182
184
|
```humalis
|
|
183
185
|
page "accueil" :
|
|
@@ -573,13 +575,23 @@ page "carte" :
|
|
|
573
575
|
```
|
|
574
576
|
|
|
575
577
|
Dans un `menu`, le lien de la page où l'on est est marqué comme actif.
|
|
576
|
-
Les liens d'un menu passent à la ligne quand la place manque. Un menu
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
578
|
+
Les liens d'un menu passent à la ligne quand la place manque. Un `menu
|
|
579
|
+
vertical :` range ses liens en colonne, sans jamais ouvrir une deuxième colonne :
|
|
580
|
+
un sommaire de hauteur limitée défile. Il se combine avec `repliable`
|
|
581
|
+
(`menu vertical repliable :`).
|
|
580
582
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
+
```humalis
|
|
584
|
+
page "guide" :
|
|
585
|
+
titre "Le guide"
|
|
586
|
+
menu vertical :
|
|
587
|
+
lien "Installer" vers "guide"
|
|
588
|
+
lien "Les pages" vers "guide"
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
Un `menu repliable :` se range derrière un bouton burger (nommé « Menu » pour les
|
|
592
|
+
lecteurs d'écran) sur un petit écran (téléphone) ; l'icône devient une croix
|
|
593
|
+
quand le menu est ouvert. Un lien choisi, un toucher à côté ou la touche Échap
|
|
594
|
+
referment le menu. Sur grand écran, il reste ouvert :
|
|
583
595
|
|
|
584
596
|
```humalis
|
|
585
597
|
page "accueil" :
|