@poadio/app-vue 0.1.0 → 0.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/CHANGELOG.md +25 -0
- package/app-vue.css +95 -21
- package/dist/browser.d.ts +3 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +18 -1
- package/dist/browser.js.map +1 -1
- package/dist/draft-toolbar.d.ts +65 -0
- package/dist/draft-toolbar.d.ts.map +1 -0
- package/dist/draft-toolbar.js +62 -0
- package/dist/draft-toolbar.js.map +1 -0
- package/dist/front-view.d.ts +5 -1
- package/dist/front-view.d.ts.map +1 -1
- package/dist/front-view.js +103 -44
- package/dist/front-view.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/items.d.ts +33 -0
- package/dist/items.d.ts.map +1 -0
- package/dist/items.js +369 -0
- package/dist/items.js.map +1 -0
- package/dist/lazy.d.ts +16 -0
- package/dist/lazy.d.ts.map +1 -1
- package/dist/lazy.js +34 -1
- package/dist/lazy.js.map +1 -1
- package/dist/messages.d.ts +20 -2
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +40 -4
- package/dist/messages.js.map +1 -1
- package/dist/sections/grid.d.ts +25 -1
- package/dist/sections/grid.d.ts.map +1 -1
- package/dist/sections/grid.js +29 -2
- package/dist/sections/grid.js.map +1 -1
- package/package.json +4 -3
- package/runtime-dist/app.css +95 -21
- package/runtime-dist/app.js +2 -2
- package/runtime-dist/c-0rxdxcn3.js +2 -0
- package/runtime-dist/c-0vbs937h.js +18 -0
- package/runtime-dist/c-0zqjsnm5.js +2 -0
- package/runtime-dist/c-13nx24wa.js +1 -0
- package/runtime-dist/c-16cdkp27.js +1 -0
- package/runtime-dist/c-16cm3n82.js +1 -0
- package/runtime-dist/c-1h49vkah.js +2 -0
- package/runtime-dist/c-1xpa1fqz.js +1 -0
- package/runtime-dist/c-29v2e09p.js +1 -0
- package/runtime-dist/c-2ag31260.js +2 -0
- package/runtime-dist/c-2s6r37jb.js +1 -0
- package/runtime-dist/c-2v244yc0.js +1 -0
- package/runtime-dist/c-3be398px.js +1 -0
- package/runtime-dist/c-3jm96b1p.js +2 -0
- package/runtime-dist/c-3pe5hprv.js +2 -0
- package/runtime-dist/c-3zbf5g3p.js +1 -0
- package/runtime-dist/c-4h51m4qq.js +1 -0
- package/runtime-dist/c-523qwqen.js +2 -0
- package/runtime-dist/c-572jz6y4.js +1 -0
- package/runtime-dist/c-64j9mv7a.js +1 -0
- package/runtime-dist/c-6f446pxt.js +1 -0
- package/runtime-dist/c-6pd33f4a.js +1 -0
- package/runtime-dist/c-6qa26wds.js +1 -0
- package/runtime-dist/c-6w0f1kqm.js +1 -0
- package/runtime-dist/c-72hj12cs.js +2 -0
- package/runtime-dist/{c-fg782zf4.js → c-7cjj18ea.js} +1 -1
- package/runtime-dist/c-823yyjat.js +1 -0
- package/runtime-dist/c-8gpbevx2.js +1 -0
- package/runtime-dist/c-98tbntdq.js +2 -0
- package/runtime-dist/c-9sm6aybf.js +2 -0
- package/runtime-dist/c-a63rkaa9.js +1 -0
- package/runtime-dist/{c-pgxy0etb.js → c-ahcj5yr5.js} +1 -1
- package/runtime-dist/c-azvw5879.js +2 -0
- package/runtime-dist/c-b6g9ey7e.js +2 -0
- package/runtime-dist/c-bssc8kwn.js +1 -0
- package/runtime-dist/c-bvp9zbmr.js +1 -0
- package/runtime-dist/c-cc3m3rs1.js +2 -0
- package/runtime-dist/c-cp1ehb23.js +1 -0
- package/runtime-dist/c-cvsx6n6e.js +2 -0
- package/runtime-dist/c-d5y90g8f.js +1 -0
- package/runtime-dist/c-d8hfdner.js +2 -0
- package/runtime-dist/c-dqtdk937.js +1 -0
- package/runtime-dist/c-dzx0rg0g.js +2 -0
- package/runtime-dist/c-eczfywaq.js +1 -0
- package/runtime-dist/c-epemgj1a.js +2 -0
- package/runtime-dist/c-et83hbhc.js +1 -0
- package/runtime-dist/c-ffkh15py.js +1 -0
- package/runtime-dist/c-fn3059s1.js +2 -0
- package/runtime-dist/c-fnzeden9.js +1 -0
- package/runtime-dist/c-gen0a4bn.js +1 -0
- package/runtime-dist/c-gesjk5ph.js +1 -0
- package/runtime-dist/c-gkyekesy.js +15 -0
- package/runtime-dist/c-gs1k0twe.js +2 -0
- package/runtime-dist/c-gznx0sj4.js +2 -0
- package/runtime-dist/c-h5m94fwp.js +1 -0
- package/runtime-dist/c-hdstjg33.js +2 -0
- package/runtime-dist/c-hsy77frc.js +3 -0
- package/runtime-dist/c-j02ymtyd.js +2 -0
- package/runtime-dist/c-j63hz554.js +2 -0
- package/runtime-dist/c-jvrr9zb8.js +1 -0
- package/runtime-dist/c-jymrpj5m.js +1 -0
- package/runtime-dist/c-k624qrhh.js +2 -0
- package/runtime-dist/c-kbg0cafy.js +2 -0
- package/runtime-dist/c-kmx0mv0c.js +2 -0
- package/runtime-dist/c-krt6rpg1.js +1 -0
- package/runtime-dist/c-kyajr8zz.js +2 -0
- package/runtime-dist/c-m30q0jrb.js +1 -0
- package/runtime-dist/c-m49q9r7s.js +1 -0
- package/runtime-dist/c-m6yf7zaj.js +2 -0
- package/runtime-dist/c-m70tbfc5.js +2 -0
- package/runtime-dist/c-mdj990nz.js +2 -0
- package/runtime-dist/c-mvdn43tv.js +2 -0
- package/runtime-dist/c-mw3zx9yk.js +1 -0
- package/runtime-dist/c-n8mqnvjg.js +1 -0
- package/runtime-dist/c-nkrm4n9a.js +1 -0
- package/runtime-dist/c-nn49946s.js +1 -0
- package/runtime-dist/c-ny0mdx7k.js +2 -0
- package/runtime-dist/c-p8wyhrwm.js +2 -0
- package/runtime-dist/c-pbn2syef.js +1 -0
- package/runtime-dist/c-prt5qv2x.js +1 -0
- package/runtime-dist/c-qe1kevqk.js +1 -0
- package/runtime-dist/{c-ns42txax.js → c-rasvf2z2.js} +2 -2
- package/runtime-dist/c-rf1xevya.js +1 -0
- package/runtime-dist/c-rktc0ksd.js +2 -0
- package/runtime-dist/c-sd570jk7.js +2 -0
- package/runtime-dist/c-sdf15np5.js +1 -0
- package/runtime-dist/c-sjajadt4.js +2 -0
- package/runtime-dist/c-sv15z0aa.js +1 -0
- package/runtime-dist/c-tv3ksk7j.js +2 -0
- package/runtime-dist/c-vrmw0gka.js +1 -0
- package/runtime-dist/c-wjadf68q.js +1 -0
- package/runtime-dist/c-wnynh7zm.js +1 -0
- package/runtime-dist/c-xeqwqt9z.js +2 -0
- package/runtime-dist/c-xk9fqzsc.js +1 -0
- package/runtime-dist/c-xqf3j4w7.js +1 -0
- package/runtime-dist/c-xx4986kx.js +1 -0
- package/runtime-dist/c-y9120d6h.js +1 -0
- package/runtime-dist/c-ywzh0r63.js +1 -0
- package/runtime-dist/c-zyfkspym.js +2 -0
- package/runtime-dist/ui-accordion.css +29 -0
- package/runtime-dist/ui-app-shell.css +36 -0
- package/runtime-dist/ui-avatar.css +28 -0
- package/runtime-dist/ui-badge.css +14 -0
- package/runtime-dist/ui-block-editor.css +85 -0
- package/runtime-dist/ui-block-view.css +50 -0
- package/runtime-dist/ui-block.css +20 -0
- package/runtime-dist/ui-bottom-nav.css +54 -0
- package/runtime-dist/ui-breadcrumb.css +25 -0
- package/runtime-dist/ui-button-group.css +39 -0
- package/runtime-dist/ui-calendar.css +168 -0
- package/runtime-dist/ui-card.css +26 -0
- package/runtime-dist/ui-carousel.css +35 -0
- package/runtime-dist/ui-chart.css +26 -0
- package/runtime-dist/ui-checkbox.css +25 -0
- package/runtime-dist/ui-chip.css +30 -0
- package/runtime-dist/ui-code-editor.css +25 -0
- package/runtime-dist/ui-colorpicker.css +46 -0
- package/runtime-dist/ui-combo.css +43 -0
- package/runtime-dist/ui-dataview.css +50 -0
- package/runtime-dist/ui-datepicker.css +80 -0
- package/runtime-dist/ui-dialog.css +119 -0
- package/runtime-dist/ui-divider.css +18 -0
- package/runtime-dist/ui-fieldset.css +25 -0
- package/runtime-dist/ui-filter-chip.css +24 -0
- package/runtime-dist/ui-floating.css +9 -0
- package/runtime-dist/ui-gantt.css +105 -0
- package/runtime-dist/ui-image.css +34 -0
- package/runtime-dist/ui-inplace.css +19 -0
- package/runtime-dist/ui-json-editor.css +40 -0
- package/runtime-dist/ui-layout.css +39 -0
- package/runtime-dist/ui-listbox.css +52 -0
- package/runtime-dist/ui-map.css +469 -0
- package/runtime-dist/ui-menu.css +38 -0
- package/runtime-dist/ui-menubar.css +55 -0
- package/runtime-dist/ui-meter.css +26 -0
- package/runtime-dist/ui-multiselect.css +62 -0
- package/runtime-dist/ui-nav-drawer.css +118 -0
- package/runtime-dist/ui-number.css +26 -0
- package/runtime-dist/ui-option-list.css +28 -0
- package/runtime-dist/ui-orderlist.css +54 -0
- package/runtime-dist/ui-orgchart.css +71 -0
- package/runtime-dist/ui-paginator.css +25 -0
- package/runtime-dist/ui-panel.css +28 -0
- package/runtime-dist/ui-password.css +26 -0
- package/runtime-dist/ui-picklist.css +58 -0
- package/runtime-dist/ui-popover.css +20 -0
- package/runtime-dist/ui-progress.css +31 -0
- package/runtime-dist/ui-radio.css +29 -0
- package/runtime-dist/ui-rating.css +19 -0
- package/runtime-dist/ui-richtext.css +48 -0
- package/runtime-dist/ui-scheduler.css +132 -0
- package/runtime-dist/ui-scroll-top.css +17 -0
- package/runtime-dist/ui-segmented.css +25 -0
- package/runtime-dist/ui-select.css +47 -0
- package/runtime-dist/ui-sheet.css +56 -0
- package/runtime-dist/ui-skeleton.css +18 -0
- package/runtime-dist/ui-slider.css +59 -0
- package/runtime-dist/ui-speed-dial.css +26 -0
- package/runtime-dist/ui-splitter.css +23 -0
- package/runtime-dist/ui-stepper.css +47 -0
- package/runtime-dist/ui-switch.css +31 -0
- package/runtime-dist/ui-table-panel.css +114 -0
- package/runtime-dist/ui-table.css +430 -0
- package/runtime-dist/ui-tabs.css +45 -0
- package/runtime-dist/ui-taskboard.css +104 -0
- package/runtime-dist/ui-timeline.css +44 -0
- package/runtime-dist/ui-toast.css +43 -0
- package/runtime-dist/ui-toggle-button.css +6 -0
- package/runtime-dist/ui-tooltip.css +21 -0
- package/runtime-dist/ui-tree.css +44 -0
- package/runtime-dist/ui-upload.css +46 -0
- package/runtime-dist/version.json +1 -1
- package/src/browser.ts +21 -2
- package/src/draft-toolbar.ts +67 -0
- package/src/front-view.ts +105 -51
- package/src/index.ts +2 -1
- package/src/items.ts +436 -0
- package/src/lazy.ts +38 -1
- package/src/messages.ts +40 -4
- package/src/sections/grid.ts +38 -3
- package/runtime-dist/c-7dddcgt2.js +0 -2
- package/runtime-dist/c-9a0nzf53.js +0 -2
- package/runtime-dist/c-c1e1x3y1.js +0 -1
- package/runtime-dist/c-fnkq09db.js +0 -1
- package/runtime-dist/c-j29w8z15.js +0 -1
- package/runtime-dist/c-mmxqs2mz.js +0 -1
- package/runtime-dist/c-xsq12y6b.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog — @poadio/app-vue
|
|
2
2
|
|
|
3
|
+
## 0.2.0 — 2026-11-29
|
|
4
|
+
|
|
5
|
+
- Composants posés sur la grille : chaque type du catalogue d'`@poadio/app-core` rendu par le vrai composant de
|
|
6
|
+
`@poadio/ui-vue` (`src/items.ts`), avec ses props résolues ; les contrôles gardent une valeur locale (la liaison
|
|
7
|
+
aux données viendra avec le store). Titre et texte simples rendus par le moteur lui-même.
|
|
8
|
+
- Chargement à la demande : un chargeur par type, qui n'importe que son module de `@poadio/ui-vue` ; seuls les
|
|
9
|
+
types de la page sont chargés (`itemTypes`, `preloadPage`). Leurs feuilles de `@poadio/ui-core` aussi :
|
|
10
|
+
`runtime-dist/ui-<nom>.css`, chargées par `setStyleLoader`. Chart.js est désormais embarqué dans son propre
|
|
11
|
+
morceau (chargé seulement quand une page pose un graphique) ; maplibre et monaco restent hors du moteur.
|
|
12
|
+
- Grille : 24 colonnes, cases de `rowHeight` px, 6 px de marge par case ; sur le canevas, lignes visibles et six
|
|
13
|
+
lignes libres sous le dernier composant ; sous 640 px, composants empilés dans l'ordre de lecture.
|
|
14
|
+
- Aperçu : `poad:front:rendered` annonce la place des grilles (`gridLayouts`) au designer de la console.
|
|
15
|
+
- Plus de barre automatique (nom du front, onglets des pages, utilisateur) : une page ne montre que ce qui a été
|
|
16
|
+
dessiné dessus, en Lecture, dans l'Aperçu et sur le canevas de la console. Naviguer, c'est poser un composant :
|
|
17
|
+
barre de menu et barre de navigation mobile listent par défaut les pages du front (`source: 'pages'`, liens
|
|
18
|
+
`<a href>` suivis par le routeur du moteur, page courante marquée) ou une liste libre. Une page réservée sans
|
|
19
|
+
session montre l'écran de connexion seul ; « Se déconnecter » reviendra comme action ou composant.
|
|
20
|
+
- Lecture du brouillon : la barre flottante « Brouillon » remplace le bandeau. Taille d'écran (Ordinateur : toute la
|
|
21
|
+
fenêtre ; Tablette 820, Téléphone 390 : la page contenue et centrée ; empilement par requête de conteneur, donc réel en
|
|
22
|
+
Téléphone), thème du front, aller à une page (menu de la bibliothèque, feuille basse sur petit écran), recharger le
|
|
23
|
+
brouillon, replier / déplier par un chevron à côté du badge (il montre où va la barre, se retourne quand elle est à droite ; la pastille repliée est entièrement cliquable), déplacer à droite, fermer pour l'onglet ; Ordinateur sans cadre : la page occupe toute la fenêtre, comme pour un visiteur ; gardée pour l'onglet (sessionStorage) ;
|
|
24
|
+
chaque geste écrit `app_draft_toolbar` (l'action) dans le puits. Aucun lien vers la console.
|
|
25
|
+
- Journal : un composant qui ne se charge pas écrit `app_component_load_error` (avec `component` et `section`)
|
|
26
|
+
dans le puits de logs du projet.
|
|
27
|
+
|
|
3
28
|
## 0.1.0 — 2026-11-28
|
|
4
29
|
|
|
5
30
|
Première version : le rendu Vue 3 des fronts dessinés dans poad, sur `@poadio/app-core` et `@poadio/ui-vue`.
|
package/app-vue.css
CHANGED
|
@@ -73,35 +73,109 @@ body { font-family: var(--poad-font); font-size: 15px; line-height: 1.5; }
|
|
|
73
73
|
}
|
|
74
74
|
.poad-front__under-project strong { color: var(--poad-fg); font-weight: 600; }
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
.poad-front__grid
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
/* Grille de 24 colonnes : chaque composant dans sa case ; la case garde 6 px de marge (rien de collé à son voisin) */
|
|
77
|
+
.poad-front__grid { position: relative; border-radius: var(--poad-radius-lg); }
|
|
78
|
+
.poad-front__cells {
|
|
79
|
+
position: relative; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); grid-auto-rows: var(--poad-front-row, 40px);
|
|
80
|
+
min-height: calc(var(--poad-front-row, 40px) * var(--poad-front-rows, 0));
|
|
81
|
+
}
|
|
82
|
+
.poad-front__grid.is-canvas { border: 1px dashed var(--poad-border-strong); }
|
|
83
|
+
.poad-front__grid.is-canvas .poad-front__cells {
|
|
84
|
+
min-height: calc(var(--poad-front-row, 40px) * var(--poad-front-rows, 12));
|
|
85
|
+
background-image: linear-gradient(to right, color-mix(in srgb, var(--poad-border) 70%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--poad-border) 70%, transparent) 1px, transparent 1px);
|
|
80
86
|
background-size: calc(100% / 24) var(--poad-front-row, 40px);
|
|
81
87
|
}
|
|
82
|
-
.poad-front__grid:not(.is-canvas) { display: grid; place-items: center; padding: 24px; border: 1px dashed var(--poad-border); }
|
|
83
|
-
.poad-front__grid-empty {
|
|
88
|
+
.poad-front__grid:not(.is-canvas):not(.has-items) { display: grid; place-items: center; padding: 24px; border: 1px dashed var(--poad-border); }
|
|
89
|
+
.poad-front__grid.is-canvas:not(.has-items) .poad-front__grid-empty { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); }
|
|
90
|
+
.poad-front__grid-empty { margin: 0; padding: 10px 14px; display: inline-block; background: var(--poad-surface); border: 1px solid var(--poad-border); border-radius: var(--poad-radius); color: var(--poad-fg-muted); font-size: 13px; text-align: center; max-width: calc(100% - 32px); }
|
|
91
|
+
.poad-front__item { min-width: 0; min-height: 0; padding: 6px; display: flex; flex-direction: column; overflow: hidden; }
|
|
92
|
+
.poad-front__item > * { flex: 1 1 auto; min-height: 0; min-width: 0; }
|
|
93
|
+
.poad-front__item > .poad-button, .poad-front__item > .poad-message, .poad-front__item > .poad-toggle-button { flex: 0 0 auto; align-self: flex-start; }
|
|
94
|
+
.poad-front__item > .poad-button.is-block { align-self: stretch; }
|
|
95
|
+
/* Une case qui affiche un composant : son cadre plein, son contenu qui défile s'il dépasse */
|
|
96
|
+
.poad-front__fill { height: 100%; min-height: 0; overflow: auto; }
|
|
97
|
+
.poad-front__fill-field { height: 100%; display: flex; flex-direction: column; }
|
|
98
|
+
.poad-front__fill-field textarea { flex: 1; resize: none; }
|
|
99
|
+
.poad-front__center-v { display: flex; align-items: center; min-width: 0; }
|
|
100
|
+
.poad-front__center-v > * { flex: 1 1 auto; min-width: 0; }
|
|
101
|
+
.poad-front__center-v.is-fit > * { flex: 0 1 auto; }
|
|
102
|
+
.poad-front__center { display: grid; place-items: center; }
|
|
103
|
+
.poad-front__group { display: flex; flex-direction: column; gap: 8px; }
|
|
104
|
+
.poad-front__label { font-size: 13px; font-weight: 500; color: var(--poad-fg-secondary); }
|
|
105
|
+
.poad-front__body { margin: 0; color: var(--poad-fg-secondary); white-space: pre-line; overflow-wrap: anywhere; }
|
|
106
|
+
.poad-front__heading { margin: 0; color: var(--poad-fg); line-height: 1.25; overflow-wrap: anywhere; align-self: center; width: 100%; }
|
|
107
|
+
.poad-front__heading.is-h1 { font-size: 28px; font-weight: 700; }
|
|
108
|
+
.poad-front__heading.is-h2 { font-size: 22px; font-weight: 650; }
|
|
109
|
+
.poad-front__heading.is-h3 { font-size: 18px; font-weight: 600; }
|
|
110
|
+
.poad-front__item.is-heading { justify-content: center; }
|
|
111
|
+
.poad-front__item.is-heading > * { flex: 0 0 auto; }
|
|
112
|
+
.poad-front__text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--poad-fg); }
|
|
113
|
+
.poad-front__split { height: 100%; display: grid; place-items: center; padding: 12px; color: var(--poad-fg-muted); font-size: 13px; }
|
|
114
|
+
.poad-front__slide { height: 100%; min-height: 120px; display: grid; place-items: center; padding: 16px; border-radius: var(--poad-radius); background: var(--poad-accent-soft); color: var(--poad-accent); font-weight: 600; }
|
|
115
|
+
.poad-front__placeholder {
|
|
116
|
+
height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center;
|
|
117
|
+
border: 1px dashed var(--poad-border-strong); border-radius: var(--poad-radius); color: var(--poad-fg-muted); font-size: 13px; background: var(--poad-bg-subtle, var(--poad-surface));
|
|
118
|
+
}
|
|
119
|
+
/* Barre de navigation mobile posée dans une case : à sa place, pas collée au bas de l'écran */
|
|
120
|
+
.poad-front__item .poad-front__inline-nav { position: static; inset: auto; width: 100%; border-radius: var(--poad-radius); border: 1px solid var(--poad-border); }
|
|
121
|
+
|
|
122
|
+
/* Écran étroit : les composants s'empilent, dans l'ordre de lecture, chacun à sa hauteur. Requête de conteneur (la
|
|
123
|
+
largeur de l'écran du front, pas de la fenêtre) : la taille Téléphone de la barre du brouillon empile vraiment. */
|
|
124
|
+
@container poad-screen (max-width: 639px) {
|
|
125
|
+
.poad-front__cells { display: flex; flex-direction: column; min-height: 0; }
|
|
126
|
+
.poad-front__grid.is-canvas .poad-front__cells { min-height: calc(var(--poad-front-row, 40px) * 6); background-image: none; }
|
|
127
|
+
.poad-front__item { order: var(--poad-item-order, 0); min-height: calc(var(--poad-front-row, 40px) * var(--poad-item-h, 1)); }
|
|
128
|
+
.poad-front__page { padding: 16px; }
|
|
129
|
+
.poad-front__under { padding: 40px 20px; min-height: 50vh; }
|
|
130
|
+
.poad-front__under-title { font-size: 26px; }
|
|
131
|
+
}
|
|
84
132
|
|
|
85
133
|
/* Canevas de la console : aperçu non interactif (la console choisit la page) */
|
|
86
134
|
.poad-front.is-canvas .poad-front__bar a, .poad-front.is-canvas .poad-front__page { cursor: default; }
|
|
87
135
|
|
|
88
136
|
@media (max-width: 600px) {
|
|
89
|
-
.poad-front__bar { padding: 10px 16px; gap: 10px; }
|
|
90
|
-
.poad-front__page { padding: 16px; }
|
|
91
137
|
.poad-front__panel { padding: 22px 20px 24px; }
|
|
92
|
-
.poad-front__under { padding: 40px 20px; min-height: 50vh; }
|
|
93
|
-
.poad-front__under-title { font-size: 26px; }
|
|
94
|
-
.poad-front__user-email { display: none; }
|
|
95
138
|
}
|
|
96
139
|
|
|
97
|
-
/*
|
|
98
|
-
.poad-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
140
|
+
/* L'écran du front : ce que la page occupe ; conteneur des requêtes de largeur */
|
|
141
|
+
.poad-front__screen { flex: 1; min-width: 0; display: flex; flex-direction: column; container: poad-screen / inline-size; background: var(--poad-bg); }
|
|
142
|
+
/* Taille d'écran choisie dans la barre du brouillon : la page contenue à cette largeur, centrée, le fond autour */
|
|
143
|
+
.poad-front.is-framed { background: color-mix(in srgb, var(--poad-fg) 7%, var(--poad-bg)); }
|
|
144
|
+
.poad-front.is-framed .poad-front__screen {
|
|
145
|
+
width: 100%; max-width: var(--poad-front-frame); margin: 0 auto;
|
|
146
|
+
border-inline: 1px solid var(--poad-border); box-shadow: var(--poad-shadow-md);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Barre du brouillon (Lecture du brouillon seulement) : petite, translucide, opaque au survol, jamais collée au bord */
|
|
150
|
+
.poad-draftbar {
|
|
151
|
+
position: fixed; z-index: 50;
|
|
152
|
+
left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
|
|
153
|
+
max-width: calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
|
|
154
|
+
display: flex; align-items: center; gap: 2px; padding: 4px;
|
|
155
|
+
background: color-mix(in srgb, var(--poad-surface) 90%, transparent);
|
|
156
|
+
color: var(--poad-fg-secondary); font-size: 12.5px;
|
|
157
|
+
border: 1px solid var(--poad-border); border-radius: 12px; box-shadow: var(--poad-shadow-md);
|
|
158
|
+
opacity: .8; transition: opacity .15s;
|
|
159
|
+
}
|
|
160
|
+
.poad-draftbar:hover, .poad-draftbar:focus-within { opacity: 1; }
|
|
161
|
+
.poad-draftbar.is-right { left: auto; right: calc(16px + env(safe-area-inset-right, 0px)); }
|
|
162
|
+
.poad-draftbar__badge {
|
|
163
|
+
padding: 3px 9px; border-radius: 999px; background: var(--poad-warning-soft); color: var(--poad-warning); font-weight: 600; font-size: 12px; white-space: nowrap;
|
|
103
164
|
}
|
|
104
|
-
.poad-
|
|
105
|
-
.poad-
|
|
106
|
-
.poad-
|
|
107
|
-
.poad-
|
|
165
|
+
.poad-draftbar__badge { margin: 0 2px 0 2px; }
|
|
166
|
+
.poad-draftbar.is-collapsed { padding: 4px; }
|
|
167
|
+
.poad-draftbar__pill { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 2px; border-radius: 10px; }
|
|
168
|
+
.poad-draftbar__pill .poad-draftbar__badge { margin: 0; }
|
|
169
|
+
.poad-draftbar__fold { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--poad-fg-secondary); }
|
|
170
|
+
.poad-draftbar__pill:hover .poad-draftbar__fold { background: var(--poad-hover); color: var(--poad-fg); }
|
|
171
|
+
.poad-draftbar__fold-btn { margin-inline-end: 4px; }
|
|
172
|
+
.poad-draftbar__group { display: inline-flex; gap: 2px; padding: 0 2px; }
|
|
173
|
+
.poad-draftbar__sep { width: 1px; align-self: stretch; margin: 4px 4px; background: var(--poad-border); }
|
|
174
|
+
.poad-draftbar__btn { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--poad-fg-secondary); }
|
|
175
|
+
.poad-draftbar__btn:hover { background: var(--poad-hover); color: var(--poad-fg); }
|
|
176
|
+
.poad-draftbar__btn.is-on { background: var(--poad-accent-soft); color: var(--poad-accent); }
|
|
177
|
+
.poad-draftbar__btn:focus-visible, .poad-draftbar__pill:focus-visible { outline: 2px solid var(--poad-ring); outline-offset: 1px; }
|
|
178
|
+
/* Petit écran : sans les tailles d'écran (la fenêtre est déjà un téléphone) */
|
|
179
|
+
@media (max-width: 600px) { .poad-draftbar__devices { display: none; } }
|
|
180
|
+
/* Barre de menu posée : son menu déroulé (petit écran) passe au-dessus des composants voisins */
|
|
181
|
+
.poad-front__item.is-menubar { overflow: visible; z-index: 5; }
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type App } from 'vue';
|
|
2
|
-
import { type BrowserLogLine, type FrontApp, type HistoryPort, type PoadAuthLike, type Theme } from '@poadio/app-core';
|
|
2
|
+
import { type BrowserLogLine, type FrontApp, type GridLayout, type HistoryPort, type PoadAuthLike, type Theme } from '@poadio/app-core';
|
|
3
3
|
export declare const browserHistory: () => HistoryPort;
|
|
4
4
|
/** Envoi des lignes à l'origine du front (POST /_poad/log) ; à la fermeture de la page, sendBeacon */
|
|
5
5
|
export declare const logSender: (endpoint?: string) => (lines: BrowserLogLine[], { final }: {
|
|
6
6
|
final: boolean;
|
|
7
7
|
}) => void;
|
|
8
8
|
export declare const applyTheme: (theme: Theme | null) => void;
|
|
9
|
+
/** Place des grilles de la page (le canevas de la console y pose ses poignées) */
|
|
10
|
+
export declare const gridLayouts: (doc?: Document) => GridLayout[];
|
|
9
11
|
export type BootOptions = {
|
|
10
12
|
el: Element;
|
|
11
13
|
/** Fabrique du client poad (createClient de @poadio/client-js) : url et clé anon viennent de front.json */
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAEU,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAoB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAEU,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAoB,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EACtI,MAAM,kBAAkB,CAAC;AAK1B,eAAO,MAAM,cAAc,QAAO,WAShC,CAAC;AAEH,sGAAsG;AACtG,eAAO,MAAM,SAAS,GAAI,iBAAuB,MAAM,OAAO,cAAc,EAAE,EAAE,WAAW;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,SAW5G,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,GAAG,IAAI,SAM7C,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,WAAW,GAAI,MAAK,QAAmB,KAAG,UAAU,EAgB7D,CAAC;AAEL,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,OAAO,CAAC;IACZ,2GAA2G;IAC3G,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,YAAY,CAAC;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,uGAAuG;AACvG,eAAO,MAAM,SAAS,GAAU,MAAM,WAAW,KAAG,OAAO,CAAC;IAAE,GAAG,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,GAAG,IAAI,CAqD7F,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -36,6 +36,23 @@ export const applyTheme = (theme) => {
|
|
|
36
36
|
root.classList.add(`theme-${t}`);
|
|
37
37
|
root.style.colorScheme = t;
|
|
38
38
|
};
|
|
39
|
+
/** Place des grilles de la page (le canevas de la console y pose ses poignées) */
|
|
40
|
+
export const gridLayouts = (doc = document) => [...doc.querySelectorAll('.poad-front__cells[data-grid]')].map((el) => {
|
|
41
|
+
const r = el.getBoundingClientRect();
|
|
42
|
+
const view = doc.defaultView;
|
|
43
|
+
const rows = Number(el.dataset['rows'] ?? 0);
|
|
44
|
+
const rowHeight = parseFloat(getComputedStyle(el).getPropertyValue('--poad-front-row')) || 40;
|
|
45
|
+
return {
|
|
46
|
+
section: el.dataset['grid'] ?? '',
|
|
47
|
+
x: r.left + (view?.scrollX ?? 0),
|
|
48
|
+
y: r.top + (view?.scrollY ?? 0),
|
|
49
|
+
width: r.width,
|
|
50
|
+
height: r.height,
|
|
51
|
+
rowHeight,
|
|
52
|
+
rows,
|
|
53
|
+
stacked: getComputedStyle(el).display !== 'grid',
|
|
54
|
+
};
|
|
55
|
+
});
|
|
39
56
|
/** Démarre un front servi par l'engine : config, client poad, journaux, aperçu de la console, rendu */
|
|
40
57
|
export const bootFront = async (opts) => {
|
|
41
58
|
const logger = createFrontLogger(logSender());
|
|
@@ -79,7 +96,7 @@ export const bootFront = async (opts) => {
|
|
|
79
96
|
const report = () => {
|
|
80
97
|
const s = app.state();
|
|
81
98
|
if (s.page)
|
|
82
|
-
bridge.rendered(s.page.id, document.documentElement.scrollWidth, document.documentElement.scrollHeight);
|
|
99
|
+
bridge.rendered(s.page.id, document.documentElement.scrollWidth, document.documentElement.scrollHeight, gridLayouts());
|
|
83
100
|
};
|
|
84
101
|
new ResizeObserver(report).observe(document.body);
|
|
85
102
|
app.subscribe(() => requestAnimationFrame(report));
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,+GAA+G;AAC/G,OAAO,EAAE,SAAS,EAAY,MAAM,KAAK,CAAC;AAC1C,OAAO,EACL,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,QAAQ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nB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IAChK,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barre du brouillon : petite barre flottante de la Lecture du brouillon, jamais montrée à un visiteur. Taille d'écran
|
|
3
|
+
* (la page contenue à la largeur du designer, vraiment : les composants s'empilent en Téléphone), thème du front, aller
|
|
4
|
+
* à une page (menu de la bibliothèque), recharger le brouillon, réduire en pastille, déplacer, fermer pour l'onglet.
|
|
5
|
+
* Aucune décision ici : l'état et ses règles sont dans @poadio/app-core (draft-toolbar.ts), le rendu les dessine.
|
|
6
|
+
* Jamais de lien vers la console ni de copie du lien du brouillon.
|
|
7
|
+
*/
|
|
8
|
+
import { type PropType } from 'vue';
|
|
9
|
+
import { type DraftToolbarAction, type DraftToolbarState } from '@poadio/app-core';
|
|
10
|
+
import type { MessageKey } from './messages.js';
|
|
11
|
+
export declare const DraftToolbar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
12
|
+
state: {
|
|
13
|
+
type: PropType<DraftToolbarState>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
t: {
|
|
17
|
+
type: PropType<(k: MessageKey) => string>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
/** Le thème affiché (choisi, ou celui du système) */
|
|
21
|
+
dark: BooleanConstructor;
|
|
22
|
+
pages: {
|
|
23
|
+
type: PropType<{
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
}[]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
current: {
|
|
30
|
+
type: PropType<string | null>;
|
|
31
|
+
default: null;
|
|
32
|
+
};
|
|
33
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
act: (_: DraftToolbarAction) => true;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
state: {
|
|
39
|
+
type: PropType<DraftToolbarState>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
t: {
|
|
43
|
+
type: PropType<(k: MessageKey) => string>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
/** Le thème affiché (choisi, ou celui du système) */
|
|
47
|
+
dark: BooleanConstructor;
|
|
48
|
+
pages: {
|
|
49
|
+
type: PropType<{
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
}[]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
current: {
|
|
56
|
+
type: PropType<string | null>;
|
|
57
|
+
default: null;
|
|
58
|
+
};
|
|
59
|
+
}>> & Readonly<{
|
|
60
|
+
onAct?: ((_: DraftToolbarAction) => any) | undefined;
|
|
61
|
+
}>, {
|
|
62
|
+
current: string | null;
|
|
63
|
+
dark: boolean;
|
|
64
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
//# sourceMappingURL=draft-toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-toolbar.d.ts","sourceRoot":"","sources":["../src/draft-toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACxD,OAAO,EAAkD,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEnI,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAMhD,eAAO,MAAM,YAAY;;cAGI,QAAQ,CAAC,iBAAiB,CAAC;;;;cAC7B,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,CAAC;;;IAC1D,qDAAqD;;;cAE7B,QAAQ,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;;aAElC,kBAAkB;;;cAPT,QAAQ,CAAC,iBAAiB,CAAC;;;;cAC7B,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,CAAC;;;IAC1D,qDAAqD;;;cAE7B,QAAQ,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;;;;4EA0CpD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barre du brouillon : petite barre flottante de la Lecture du brouillon, jamais montrée à un visiteur. Taille d'écran
|
|
3
|
+
* (la page contenue à la largeur du designer, vraiment : les composants s'empilent en Téléphone), thème du front, aller
|
|
4
|
+
* à une page (menu de la bibliothèque), recharger le brouillon, réduire en pastille, déplacer, fermer pour l'onglet.
|
|
5
|
+
* Aucune décision ici : l'état et ses règles sont dans @poadio/app-core (draft-toolbar.ts), le rendu les dessine.
|
|
6
|
+
* Jamais de lien vers la console ni de copie du lien du brouillon.
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent, h } from 'vue';
|
|
9
|
+
import { DRAFT_DEVICES, draftFoldIcon } from '@poadio/app-core';
|
|
10
|
+
import { PoadIcon, PoadMenu } from './lazy.js';
|
|
11
|
+
import { loadStyles } from './items.js';
|
|
12
|
+
const DEVICE_ICON = { desktop: 'layout-template', tablet: 'tablet', phone: 'smartphone' };
|
|
13
|
+
const DEVICE_LABEL = { desktop: 'draft.device.desktop', tablet: 'draft.device.tablet', phone: 'draft.device.phone' };
|
|
14
|
+
export const DraftToolbar = defineComponent({
|
|
15
|
+
name: 'PoadFrontDraftToolbar',
|
|
16
|
+
props: {
|
|
17
|
+
state: { type: Object, required: true },
|
|
18
|
+
t: { type: Function, required: true },
|
|
19
|
+
/** Le thème affiché (choisi, ou celui du système) */
|
|
20
|
+
dark: Boolean,
|
|
21
|
+
pages: { type: Array, required: true },
|
|
22
|
+
current: { type: String, default: null },
|
|
23
|
+
},
|
|
24
|
+
emits: { act: (_) => true },
|
|
25
|
+
setup(props, { emit }) {
|
|
26
|
+
// Le menu des pages : ses feuilles de @poadio/ui-core (flottant, feuille basse sur petit écran)
|
|
27
|
+
loadStyles(['menu', 'floating', 'sheet', 'popover']);
|
|
28
|
+
const act = (a) => emit('act', a);
|
|
29
|
+
const btn = (label, icon, onClick, extra = {}) => h('button', { type: 'button', class: 'poad-draftbar__btn', title: label, 'aria-label': label, onClick, ...extra }, [h(PoadIcon, { name: icon, size: 15 })]);
|
|
30
|
+
return () => {
|
|
31
|
+
const s = props.state;
|
|
32
|
+
const t = props.t;
|
|
33
|
+
if (s.closed)
|
|
34
|
+
return null;
|
|
35
|
+
const side = s.side === 'right' ? 'is-right' : null;
|
|
36
|
+
const fold = draftFoldIcon(s);
|
|
37
|
+
// Repliée : une pastille entièrement cliquable, le badge et le chevron qui montre où elle se déplie
|
|
38
|
+
if (s.collapsed)
|
|
39
|
+
return h('div', { class: ['poad-draftbar', 'is-collapsed', side], role: 'region', 'aria-label': t('draft.toolbar') }, [
|
|
40
|
+
h('button', { type: 'button', class: 'poad-draftbar__pill', title: t('draft.expand'), 'aria-label': t('draft.expand'), 'aria-expanded': 'false', onClick: () => act({ type: 'expand' }) }, [
|
|
41
|
+
h('span', { class: 'poad-draftbar__badge' }, t('draft.badge')),
|
|
42
|
+
h('span', { class: 'poad-draftbar__fold', 'aria-hidden': 'true' }, [h(PoadIcon, { name: fold, size: 15 })]),
|
|
43
|
+
]),
|
|
44
|
+
]);
|
|
45
|
+
const pages = props.pages.map((p) => ({ id: p.id, label: p.title, icon: p.id === props.current ? 'check' : 'file-text', command: () => act({ type: 'page', page: p.id }) }));
|
|
46
|
+
return h('div', { class: ['poad-draftbar', side], role: 'toolbar', 'aria-label': t('draft.toolbar') }, [
|
|
47
|
+
h('span', { class: 'poad-draftbar__badge', title: t('draft.text') }, t('draft.badge')),
|
|
48
|
+
btn(t('draft.collapse'), fold, () => act({ type: 'collapse' }), { 'aria-expanded': 'true', class: 'poad-draftbar__btn poad-draftbar__fold-btn' }),
|
|
49
|
+
h('span', { class: 'poad-draftbar__group poad-draftbar__devices', role: 'group', 'aria-label': t('draft.device') }, DRAFT_DEVICES.map((d) => btn(t(DEVICE_LABEL[d]), DEVICE_ICON[d], () => act({ type: 'device', device: d }), { key: d, 'aria-pressed': s.device === d ? 'true' : 'false', class: ['poad-draftbar__btn', s.device === d && 'is-on'] }))),
|
|
50
|
+
btn(t(props.dark ? 'draft.theme.light' : 'draft.theme.dark'), props.dark ? 'sun' : 'moon', () => act({ type: 'theme', theme: props.dark ? 'light' : 'dark' })),
|
|
51
|
+
h(PoadMenu, { items: pages, ariaLabel: t('draft.pages') }, {
|
|
52
|
+
trigger: () => h('button', { type: 'button', class: 'poad-draftbar__btn', title: t('draft.pages'), 'aria-label': t('draft.pages') }, [h(PoadIcon, { name: 'files', size: 15 })]),
|
|
53
|
+
}),
|
|
54
|
+
btn(t('draft.reload'), 'rotate-cw', () => act({ type: 'reload' })),
|
|
55
|
+
h('span', { class: 'poad-draftbar__sep', 'aria-hidden': 'true' }),
|
|
56
|
+
btn(t('draft.move'), s.side === 'right' ? 'chevrons-left' : 'chevrons-right', () => act({ type: 'move' })),
|
|
57
|
+
btn(t('draft.close'), 'x', () => act({ type: 'close' })),
|
|
58
|
+
]);
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=draft-toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-toolbar.js","sourceRoot":"","sources":["../src/draft-toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,CAAC,EAAiB,MAAM,KAAK,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAqE,MAAM,kBAAkB,CAAC;AACnI,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,GAAgC,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACvH,MAAM,YAAY,GAAoC,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,qBAAqB,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;AAEtJ,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC;IAC1C,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,MAAqC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtE,CAAC,EAAE,EAAE,IAAI,EAAE,QAA+C,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5E,qDAAqD;QACrD,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,EAAE,IAAI,EAAE,KAAkD,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnF,OAAO,EAAE,EAAE,IAAI,EAAE,MAAiC,EAAE,OAAO,EAAE,IAAI,EAAE;KACpE;IACD,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,CAAqB,EAAE,EAAE,CAAC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AC9J,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,EAAE;oBACzD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;iBACjL,CAAC;gBACF,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAClE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;gBACjE,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC1G,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;aACzD,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/dist/front-view.d.ts
CHANGED
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
* gestes (navigation, connexion, déconnexion). Aucune logique ici : ce qui décide (page, connexion exigée, page
|
|
6
6
|
* introuvable, front pas encore publié) est dans le cœur, testé sans navigateur. Composants de @poadio/ui-vue,
|
|
7
7
|
* styles de @poadio/ui-core (+ `app-vue.css`), clair et sombre par `.theme-dark` / `.theme-light` sur la racine.
|
|
8
|
+
*
|
|
9
|
+
* Aucune barre automatique : une page ne montre que ce qui a été dessiné dessus. Naviguer entre les pages, c'est
|
|
10
|
+
* poser un composant de navigation (barre de menu, barre mobile : les pages du front par défaut) ; le nom du front
|
|
11
|
+
* et de la page restent dans le titre de l'onglet. Une page réservée sans session montre l'écran de connexion seul.
|
|
8
12
|
*/
|
|
9
13
|
import { type PropType, type VNode } from 'vue';
|
|
10
|
-
import type
|
|
14
|
+
import { type FrontApp } from '@poadio/app-core';
|
|
11
15
|
import { type Lang } from './messages.js';
|
|
12
16
|
export declare const PoadFrontView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
17
|
app: {
|
package/dist/front-view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-view.d.ts","sourceRoot":"","sources":["../src/front-view.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"front-view.d.ts","sourceRoot":"","sources":["../src/front-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAyE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AACvH,OAAO,EAE2D,KAAK,QAAQ,EAC9E,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAc,KAAK,IAAI,EAAmB,MAAM,eAAe,CAAC;AAevE,eAAO,MAAM,aAAa;;cAGC,QAAQ,CAAC,QAAQ,CAAC;;;;cACjB,QAAQ,CAAC,IAAI,CAAC;;;;;;;cADf,QAAQ,CAAC,QAAQ,CAAC;;;;cACjB,QAAQ,CAAC,IAAI,CAAC;;;;;4EAkJxC,CAAC"}
|
package/dist/front-view.js
CHANGED
|
@@ -5,17 +5,23 @@
|
|
|
5
5
|
* gestes (navigation, connexion, déconnexion). Aucune logique ici : ce qui décide (page, connexion exigée, page
|
|
6
6
|
* introuvable, front pas encore publié) est dans le cœur, testé sans navigateur. Composants de @poadio/ui-vue,
|
|
7
7
|
* styles de @poadio/ui-core (+ `app-vue.css`), clair et sombre par `.theme-dark` / `.theme-light` sur la racine.
|
|
8
|
+
*
|
|
9
|
+
* Aucune barre automatique : une page ne montre que ce qui a été dessiné dessus. Naviguer entre les pages, c'est
|
|
10
|
+
* poser un composant de navigation (barre de menu, barre mobile : les pages du front par défaut) ; le nom du front
|
|
11
|
+
* et de la page restent dans le titre de l'onglet. Une page réservée sans session montre l'écran de connexion seul.
|
|
8
12
|
*/
|
|
9
|
-
import { computed, defineComponent, h, onBeforeUnmount, ref, shallowRef } from 'vue';
|
|
10
|
-
import {
|
|
13
|
+
import { computed, defineComponent, h, onBeforeUnmount, ref, shallowRef, watch } from 'vue';
|
|
14
|
+
import { DRAFT_TOOLBAR_DEFAULT, draftFrameWidth, draftToolbarKey, draftToolbarLog, draftToolbarReduce, readDraftToolbar, writeDraftToolbar, } from '@poadio/app-core';
|
|
15
|
+
import { DraftToolbar } from './draft-toolbar.js';
|
|
16
|
+
import { PoadButton, PoadField, PoadInput, PoadMessage, sectionComponent } from './lazy.js';
|
|
11
17
|
import { translator } from './messages.js';
|
|
12
18
|
const panel = (t, title, text, extra = []) => h('div', { class: 'poad-front__center' }, [
|
|
13
19
|
h('div', { class: 'poad-front__panel' }, [h('h1', { class: 'poad-front__panel-title' }, t(title)), h('p', { class: 'poad-front__panel-text' }, t(text)), ...extra]),
|
|
14
20
|
]);
|
|
15
21
|
/** Une section : son module, chargé à la demande (lazy.ts) ; un type inconnu n'affiche rien */
|
|
16
|
-
const section = (t, s, canvas) => {
|
|
22
|
+
const section = (t, s, canvas, log, nav) => {
|
|
17
23
|
const c = sectionComponent(s.type);
|
|
18
|
-
return c ? h(c, { key: s.id, section: s, t, canvas }) : null;
|
|
24
|
+
return c ? h(c, { key: s.id, section: s, t, canvas, ...(s.type === 'grid' ? { log, nav } : {}) }) : null;
|
|
19
25
|
};
|
|
20
26
|
export const PoadFrontView = defineComponent({
|
|
21
27
|
name: 'PoadFrontView',
|
|
@@ -29,14 +35,79 @@ export const PoadFrontView = defineComponent({
|
|
|
29
35
|
onBeforeUnmount(off);
|
|
30
36
|
const t = computed(() => translator(props.lang));
|
|
31
37
|
const email = ref('');
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
// ---- Lecture du brouillon : la barre du brouillon (état et règles dans app-core, draft-toolbar.ts)
|
|
39
|
+
const storage = () => {
|
|
40
|
+
try {
|
|
41
|
+
return typeof window !== 'undefined' ? window.sessionStorage : null;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const draftUi = ref(DRAFT_TOOLBAR_DEFAULT);
|
|
48
|
+
let draftLoaded = '';
|
|
49
|
+
const width = ref(typeof window !== 'undefined' ? window.innerWidth : 1280);
|
|
50
|
+
const onResize = () => (width.value = window.innerWidth);
|
|
51
|
+
if (typeof window !== 'undefined')
|
|
52
|
+
window.addEventListener('resize', onResize);
|
|
53
|
+
onBeforeUnmount(() => typeof window !== 'undefined' && window.removeEventListener('resize', onResize));
|
|
54
|
+
/** Thème affiché : celui du front (barre, aperçu), sinon celui du système */
|
|
55
|
+
const isDark = () => {
|
|
56
|
+
const th = state.value.theme;
|
|
57
|
+
if (th)
|
|
58
|
+
return th === 'dark';
|
|
59
|
+
return typeof window !== 'undefined' && !!window.matchMedia?.('(prefers-color-scheme: dark)').matches;
|
|
60
|
+
};
|
|
61
|
+
// L'état de l'onglet se relit quand le brouillon s'affiche ; son thème s'applique
|
|
62
|
+
watch(() => (state.value.draft && state.value.front ? state.value.front.id : ''), (id) => {
|
|
63
|
+
if (!id || draftLoaded === id)
|
|
64
|
+
return;
|
|
65
|
+
draftLoaded = id;
|
|
66
|
+
let raw = null;
|
|
67
|
+
try {
|
|
68
|
+
raw = storage()?.getItem(draftToolbarKey(id)) ?? null;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
/* rien de gardé */
|
|
72
|
+
}
|
|
73
|
+
draftUi.value = readDraftToolbar(raw);
|
|
74
|
+
if (draftUi.value.theme)
|
|
75
|
+
props.app.setTheme(draftUi.value.theme);
|
|
76
|
+
}, { immediate: true });
|
|
77
|
+
const draftAct = (a) => {
|
|
78
|
+
const front = state.value.front;
|
|
79
|
+
if (!front)
|
|
80
|
+
return;
|
|
81
|
+
draftUi.value = draftToolbarReduce(draftUi.value, a);
|
|
82
|
+
try {
|
|
83
|
+
storage()?.setItem(draftToolbarKey(front.id), writeDraftToolbar(draftUi.value));
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
/* gardé pour cet affichage seulement */
|
|
87
|
+
}
|
|
88
|
+
const line = draftToolbarLog(a);
|
|
89
|
+
props.app.log.info(line.msg, { event: 'app_draft_toolbar', attrs: line.attrs });
|
|
90
|
+
if (a.type === 'theme')
|
|
91
|
+
props.app.setTheme(a.theme);
|
|
92
|
+
else if (a.type === 'page')
|
|
93
|
+
props.app.navigate(a.page);
|
|
94
|
+
else if (a.type === 'reload') {
|
|
95
|
+
// Le cookie de lecture reste : le rechargement montre le dernier brouillon enregistré
|
|
96
|
+
props.app.log.flush(true);
|
|
97
|
+
window.location.reload();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
/** Largeur où contenir la page (taille d'écran choisie dans la barre) ; null : toute la fenêtre */
|
|
101
|
+
const frame = computed(() => (state.value.draft && !draftUi.value.closed ? draftFrameWidth(draftUi.value.device, width.value) : null));
|
|
102
|
+
const draftBar = () => state.value.draft && state.value.front
|
|
103
|
+
? h(DraftToolbar, {
|
|
104
|
+
state: draftUi.value,
|
|
105
|
+
t: t.value,
|
|
106
|
+
dark: isDark(),
|
|
107
|
+
pages: state.value.front.pages.map((p) => ({ id: p.id, title: p.title })),
|
|
108
|
+
current: state.value.page?.id ?? null,
|
|
109
|
+
onAct: draftAct,
|
|
110
|
+
})
|
|
40
111
|
: null;
|
|
41
112
|
const password = ref('');
|
|
42
113
|
const signInForm = () => {
|
|
@@ -63,34 +134,19 @@ export const PoadFrontView = defineComponent({
|
|
|
63
134
|
]),
|
|
64
135
|
]);
|
|
65
136
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const front = s.front;
|
|
80
|
-
return h('header', { class: 'poad-front__bar' }, [
|
|
81
|
-
h('a', { class: 'poad-front__brand', href: props.app.pathOf(front.home), onClick: (e) => (e.preventDefault(), props.app.navigate(front.home)) }, front.name),
|
|
82
|
-
front.pages.length > 1 && !s.single ? h('nav', { class: 'poad-front__nav', 'aria-label': t.value('nav') }, front.pages.map((p) => link(p, s.page))) : h('span', { class: 'poad-front__spacer' }),
|
|
83
|
-
s.mode !== 'live'
|
|
84
|
-
// Aperçu de la console : un rappel discret de la règle d'accès de la page
|
|
85
|
-
? h(PoadTag, { size: 'sm', severity: s.authRequired ? 'warning' : 'success', value: t.value(s.authRequired ? (s.needsLogin ? 'badge.visitor' : 'badge.auth') : 'badge.public') })
|
|
86
|
-
: s.user
|
|
87
|
-
? h('div', { class: 'poad-front__user' }, [
|
|
88
|
-
s.user.email ? h('span', { class: 'poad-front__user-email' }, s.user.email) : null,
|
|
89
|
-
h(PoadButton, { size: 'sm', variant: 'outline', onClick: () => void props.app.signOut() }, () => t.value('signout')),
|
|
90
|
-
])
|
|
91
|
-
: null,
|
|
92
|
-
]);
|
|
93
|
-
};
|
|
137
|
+
/** Navigation entre pages : ce que posent les composants de navigation (barre de menu…) ; aucune barre automatique */
|
|
138
|
+
const nav = computed(() => {
|
|
139
|
+
const st = state.value;
|
|
140
|
+
if (!st.front)
|
|
141
|
+
return null;
|
|
142
|
+
const front = st.front;
|
|
143
|
+
return {
|
|
144
|
+
pages: front.pages.map((p) => ({ id: p.id, title: p.title, path: p.path })),
|
|
145
|
+
current: st.page?.id ?? null,
|
|
146
|
+
href: (id) => props.app.pathOf(id),
|
|
147
|
+
go: (id) => props.app.navigate(id),
|
|
148
|
+
};
|
|
149
|
+
});
|
|
94
150
|
return () => {
|
|
95
151
|
const s = state.value;
|
|
96
152
|
const tt = t.value;
|
|
@@ -103,12 +159,15 @@ export const PoadFrontView = defineComponent({
|
|
|
103
159
|
else if (s.status === 'error')
|
|
104
160
|
body = panel(tt, 'error.title', 'error.text');
|
|
105
161
|
else if (s.status === 'not-found')
|
|
106
|
-
body =
|
|
162
|
+
body = panel(tt, 'notfound.title', 'notfound.text', [h(PoadButton, { variant: 'outline', onClick: () => props.app.navigate(s.front.home) }, () => tt('notfound.home'))]);
|
|
163
|
+
// Connexion demandée : l'écran de connexion seul (la page n'a pas de barre ; se déconnecter viendra comme action)
|
|
107
164
|
else if (s.needsLogin)
|
|
108
|
-
body =
|
|
165
|
+
body = signInForm();
|
|
166
|
+
// La page : seulement ce qui a été dessiné dessus
|
|
109
167
|
else
|
|
110
|
-
body =
|
|
111
|
-
|
|
168
|
+
body = h('main', { class: 'poad-front__page', 'data-page': s.page.id }, s.page.sections.map((sec) => section(tt, sec, s.mode === 'canvas', props.app.log, nav.value)));
|
|
169
|
+
const fw = frame.value;
|
|
170
|
+
return h('div', { class: ['poad-front', themeClass, `is-${s.mode}`, fw && 'is-framed'], 'data-status': s.status, style: fw ? { '--poad-front-frame': `${fw}px` } : undefined }, [h('div', { class: 'poad-front__screen' }, Array.isArray(body) ? body : [body]), draftBar()]);
|
|
112
171
|
};
|
|
113
172
|
},
|
|
114
173
|
});
|