@poadio/app-vue 0.0.0-stage → 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 +44 -0
- package/LICENSE +22 -0
- package/README.md +16 -2
- package/app-vue.css +181 -0
- package/dist/browser.d.ts +23 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +112 -0
- package/dist/browser.js.map +1 -0
- 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 +39 -0
- package/dist/front-view.d.ts.map +1 -0
- package/dist/front-view.js +174 -0
- package/dist/front-view.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- 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 +56 -0
- package/dist/lazy.d.ts.map +1 -0
- package/dist/lazy.js +68 -0
- package/dist/lazy.js.map +1 -0
- package/dist/messages.d.ts +56 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +102 -0
- package/dist/messages.js.map +1 -0
- package/dist/sections/grid.d.ts +53 -0
- package/dist/sections/grid.d.ts.map +1 -0
- package/dist/sections/grid.js +46 -0
- package/dist/sections/grid.js.map +1 -0
- package/dist/sections/under-construction.d.ts +25 -0
- package/dist/sections/under-construction.d.ts.map +1 -0
- package/dist/sections/under-construction.js +32 -0
- package/dist/sections/under-construction.js.map +1 -0
- package/package.json +72 -4
- package/runtime-dist/app.css +535 -0
- package/runtime-dist/app.js +2 -0
- 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-7cjj18ea.js +1 -0
- 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-ahcj5yr5.js +1 -0
- 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-rasvf2z2.js +2 -0
- 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/index.html +14 -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 -0
- package/src/browser.ts +126 -0
- package/src/draft-toolbar.ts +67 -0
- package/src/front-view.ts +186 -0
- package/src/index.ts +5 -0
- package/src/items.ts +436 -0
- package/src/lazy.ts +76 -0
- package/src/messages.ts +110 -0
- package/src/sections/grid.ts +56 -0
- package/src/sections/under-construction.ts +34 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Changelog — @poadio/app-vue
|
|
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
|
+
|
|
28
|
+
## 0.1.0 — 2026-11-28
|
|
29
|
+
|
|
30
|
+
Première version : le rendu Vue 3 des fronts dessinés dans poad, sur `@poadio/app-core` et `@poadio/ui-vue`.
|
|
31
|
+
|
|
32
|
+
- `PoadFrontView` : barre du front (nom, pages, utilisateur, Se déconnecter), page « En construction » (nom du
|
|
33
|
+
front et du projet), grille vide (canevas), formulaire de connexion (`PoadField`, `PoadInput`, `PoadButton`,
|
|
34
|
+
`PoadMessage`), « Pas encore publié », « Page introuvable », badge « Connexion requise » / « Sans connexion » en
|
|
35
|
+
canevas. Clair et sombre (`.theme-dark` / `.theme-light`), 390 px. Français et anglais (langue du navigateur).
|
|
36
|
+
- `bootFront` : démarrage d'un front servi par l'engine (`/_poad/front.json`, client poad, aperçu piloté par la
|
|
37
|
+
console, journaux envoyés au puits, erreurs JavaScript et de rendu comprises).
|
|
38
|
+
- Chargement à la demande (`src/lazy.ts`) : chaque composant de `@poadio/ui-vue` par son export profond, chaque
|
|
39
|
+
type de section par son module (`sections/`), chargés quand une page les emploie ; `runtime/build.mjs` découpe le
|
|
40
|
+
moteur en morceaux. La page « En construction » charge ~50 Ko gzip (moteur 24 Ko + Vue 25 Ko + sa section), contre
|
|
41
|
+
114 Ko d'un seul tenant avant ; le formulaire de connexion (champs, bouton, message) ne part que si une page
|
|
42
|
+
l'exige.
|
|
43
|
+
- `runtime-dist/` : le moteur compilé que l'engine sert à l'origine de chaque front (`bun runtime/build.mjs` :
|
|
44
|
+
un module, aucun script en ligne, aucune évaluation de code — CSP `script-src 'self'`).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CEREMA — Stéphane Zuccatti (original work: @cadriciel/ui, @cadriciel/core)
|
|
4
|
+
Copyright (c) 2026 poad contributors (@poadio/ui-core, @poadio/ui-angular)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @poadio/app-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Le rendu Vue 3 des fronts dessinés dans [poad](https://poad.io), sur `@poadio/app-core` (toute la logique) et
|
|
4
|
+
`@poadio/ui-vue` (les composants). Fonctions de rendu en TypeScript : ni JSX, ni SFC.
|
|
5
|
+
|
|
6
|
+
- `PoadFrontView` : dessine l'état d'un front (`createFrontApp`).
|
|
7
|
+
- `bootFront` : démarre un front tel que l'engine le sert.
|
|
8
|
+
- `runtime-dist/` (`@poadio/app-vue/runtime/*`) : le moteur compilé, copié dans l'image de l'engine
|
|
9
|
+
(`poadio/apps`) et servi à l'origine de chaque front (`http://localhost:<port>` en local,
|
|
10
|
+
`https://<id>.app.poad.io` sur poad.io).
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
bun run build # dist/ (bibliothèque) puis runtime-dist/ (moteur)
|
|
14
|
+
bun run test
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Licence MIT.
|
package/app-vue.css
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* Rendu des fronts (@poadio/app-vue) : mise en page du moteur, sur les jetons de @poadio/ui-core.
|
|
2
|
+
Règle poad : rien de collé — chaque panneau a son remplissage, chaque bloc sa marge. */
|
|
3
|
+
/* Thème : les variables « studio » que reprennent les jetons --poad-* de @poadio/ui-core (même palette que
|
|
4
|
+
ui/site/src/styles/theme.css et la console). Sans elles, ui-core n'a pas de surfaces sombres : un front en
|
|
5
|
+
.theme-dark restait blanc. La classe est posée sur <html> par le moteur (thème du système, ou celui de la
|
|
6
|
+
console dans un aperçu). */
|
|
7
|
+
:root, .theme-light {
|
|
8
|
+
--surface-ground: #ffffff; --surface-section: #f8fafc; --surface-card: #ffffff; --surface-overlay: #ffffff;
|
|
9
|
+
--surface-border: #e2e8f0; --surface-hover: #f1f5f9;
|
|
10
|
+
--text-primary: #1e293b; --text-secondary: #475569; --text-muted: #64748b;
|
|
11
|
+
--bg-elevated: #e2e8f0; --border-light: #cbd5e1;
|
|
12
|
+
--shadow-sm: 0 1px 2px rgba(0,0,0,.05); --shadow-md: 0 4px 6px rgba(0,0,0,.07); --shadow-lg: 0 12px 24px rgba(15,23,42,.08);
|
|
13
|
+
--input-bg: #ffffff; --input-border: #cbd5e1;
|
|
14
|
+
color-scheme: light;
|
|
15
|
+
}
|
|
16
|
+
.theme-dark {
|
|
17
|
+
--surface-ground: #0d1117; --surface-section: #161b22; --surface-card: #161b22; --surface-overlay: #21262d;
|
|
18
|
+
--surface-border: #30363d; --surface-hover: #21262d;
|
|
19
|
+
--text-primary: #f0f6fc; --text-secondary: #9ba5b0; --text-muted: #7d8590;
|
|
20
|
+
--bg-elevated: #30363d; --border-light: #484f58;
|
|
21
|
+
--shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-md: 0 4px 6px rgba(0,0,0,.4); --shadow-lg: 0 12px 24px rgba(0,0,0,.5);
|
|
22
|
+
--input-bg: #0d1117; --input-border: #30363d;
|
|
23
|
+
color-scheme: dark;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
html, body { margin: 0; min-height: 100%; background: var(--poad-bg); color: var(--poad-fg); }
|
|
27
|
+
body { font-family: var(--poad-font); font-size: 15px; line-height: 1.5; }
|
|
28
|
+
|
|
29
|
+
.poad-front { min-height: 100vh; display: flex; flex-direction: column; background: var(--poad-bg); color: var(--poad-fg); box-sizing: border-box; }
|
|
30
|
+
.poad-front *, .poad-front *::before, .poad-front *::after { box-sizing: border-box; }
|
|
31
|
+
|
|
32
|
+
.poad-front__bar {
|
|
33
|
+
display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
|
|
34
|
+
min-height: 56px; padding: 10px 24px;
|
|
35
|
+
background: var(--poad-surface); border-bottom: 1px solid var(--poad-border);
|
|
36
|
+
}
|
|
37
|
+
.poad-front__brand { font-weight: 600; font-size: 16px; color: var(--poad-fg); text-decoration: none; white-space: nowrap; }
|
|
38
|
+
.poad-front__nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; min-width: 0; }
|
|
39
|
+
.poad-front__spacer { flex: 1; }
|
|
40
|
+
.poad-front__nav-link {
|
|
41
|
+
padding: 6px 12px; border-radius: var(--poad-radius); color: var(--poad-fg-secondary); text-decoration: none; font-size: 14px;
|
|
42
|
+
}
|
|
43
|
+
.poad-front__nav-link:hover { background: var(--poad-hover); color: var(--poad-fg); }
|
|
44
|
+
.poad-front__nav-link.is-current { background: var(--poad-accent-soft); color: var(--poad-accent); font-weight: 500; }
|
|
45
|
+
.poad-front__user { display: flex; align-items: center; gap: 12px; }
|
|
46
|
+
.poad-front__user-email { color: var(--poad-fg-secondary); font-size: 13px; }
|
|
47
|
+
|
|
48
|
+
.poad-front__page { flex: 1; display: flex; flex-direction: column; gap: 24px; padding: 24px; }
|
|
49
|
+
|
|
50
|
+
.poad-front__center { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
|
|
51
|
+
.poad-front__loading { color: var(--poad-fg-muted); }
|
|
52
|
+
.poad-front__panel {
|
|
53
|
+
width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px;
|
|
54
|
+
padding: 28px 28px 32px; background: var(--poad-surface); border: 1px solid var(--poad-border);
|
|
55
|
+
border-radius: var(--poad-radius-lg); box-shadow: var(--poad-shadow-sm);
|
|
56
|
+
}
|
|
57
|
+
.poad-front__panel-title { margin: 0; font-size: 22px; font-weight: 600; }
|
|
58
|
+
.poad-front__panel-text { margin: 0; color: var(--poad-fg-secondary); }
|
|
59
|
+
.poad-front__signin .poad-button { margin-top: 8px; }
|
|
60
|
+
|
|
61
|
+
.poad-front__under {
|
|
62
|
+
flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px;
|
|
63
|
+
min-height: 60vh; padding: 48px 24px;
|
|
64
|
+
background: var(--poad-surface); border: 1px dashed var(--poad-border-strong); border-radius: var(--poad-radius-lg);
|
|
65
|
+
}
|
|
66
|
+
.poad-front__under-mark { color: var(--poad-accent); margin-bottom: 8px; }
|
|
67
|
+
.poad-front__under-title { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -0.01em; }
|
|
68
|
+
.poad-front__under-front { margin: 0; font-size: 18px; color: var(--poad-fg); }
|
|
69
|
+
.poad-front__under-text { margin: 0; max-width: 46ch; color: var(--poad-fg-secondary); }
|
|
70
|
+
.poad-front__under-project {
|
|
71
|
+
margin: 12px 0 0; padding: 8px 14px; border-radius: var(--poad-radius-pill);
|
|
72
|
+
background: var(--poad-bg-subtle); border: 1px solid var(--poad-border); color: var(--poad-fg-secondary); font-size: 14px;
|
|
73
|
+
}
|
|
74
|
+
.poad-front__under-project strong { color: var(--poad-fg); font-weight: 600; }
|
|
75
|
+
|
|
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);
|
|
86
|
+
background-size: calc(100% / 24) var(--poad-front-row, 40px);
|
|
87
|
+
}
|
|
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
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Canevas de la console : aperçu non interactif (la console choisit la page) */
|
|
134
|
+
.poad-front.is-canvas .poad-front__bar a, .poad-front.is-canvas .poad-front__page { cursor: default; }
|
|
135
|
+
|
|
136
|
+
@media (max-width: 600px) {
|
|
137
|
+
.poad-front__panel { padding: 22px 20px 24px; }
|
|
138
|
+
}
|
|
139
|
+
|
|
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;
|
|
164
|
+
}
|
|
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; }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type App } from 'vue';
|
|
2
|
+
import { type BrowserLogLine, type FrontApp, type GridLayout, type HistoryPort, type PoadAuthLike, type Theme } from '@poadio/app-core';
|
|
3
|
+
export declare const browserHistory: () => HistoryPort;
|
|
4
|
+
/** Envoi des lignes à l'origine du front (POST /_poad/log) ; à la fermeture de la page, sendBeacon */
|
|
5
|
+
export declare const logSender: (endpoint?: string) => (lines: BrowserLogLine[], { final }: {
|
|
6
|
+
final: boolean;
|
|
7
|
+
}) => void;
|
|
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[];
|
|
11
|
+
export type BootOptions = {
|
|
12
|
+
el: Element;
|
|
13
|
+
/** Fabrique du client poad (createClient de @poadio/client-js) : url et clé anon viennent de front.json */
|
|
14
|
+
createClient: (url: string, anonKey: string) => PoadAuthLike;
|
|
15
|
+
configUrl?: string;
|
|
16
|
+
fetchConfig?: () => Promise<unknown>;
|
|
17
|
+
};
|
|
18
|
+
/** Démarre un front servi par l'engine : config, client poad, journaux, aperçu de la console, rendu */
|
|
19
|
+
export declare const bootFront: (opts: BootOptions) => Promise<{
|
|
20
|
+
app: FrontApp;
|
|
21
|
+
vue: App;
|
|
22
|
+
} | null>;
|
|
23
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +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,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
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Ce qui touche au navigateur : historique, envoi des journaux, thème, démarrage complet d'un front servi par
|
|
2
|
+
// l'engine (bootFront). Rien ici ne s'exécute à l'import : les fonctions lisent `window` quand on les appelle.
|
|
3
|
+
import { createApp } from 'vue';
|
|
4
|
+
import { createFrontApp, createFrontLogger, createPreviewBridge, isFrontConfig, poadAuth, previewModeOf, } from '@poadio/app-core';
|
|
5
|
+
import { PoadFrontView } from './front-view.js';
|
|
6
|
+
import { langOf } from './messages.js';
|
|
7
|
+
import { preloadPage } from './lazy.js';
|
|
8
|
+
export const browserHistory = () => ({
|
|
9
|
+
location: () => ({ pathname: window.location.pathname, search: window.location.search }),
|
|
10
|
+
push: (p) => window.history.pushState(null, '', p),
|
|
11
|
+
// En aperçu, ?poad_preview=… reste dans l'adresse (un rechargement de l'iframe garde son mode)
|
|
12
|
+
replace: (p) => window.history.replaceState(null, '', p + (previewModeOf(window.location.search) ? window.location.search : '')),
|
|
13
|
+
listen: (cb) => {
|
|
14
|
+
window.addEventListener('popstate', cb);
|
|
15
|
+
return () => window.removeEventListener('popstate', cb);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
/** Envoi des lignes à l'origine du front (POST /_poad/log) ; à la fermeture de la page, sendBeacon */
|
|
19
|
+
export const logSender = (endpoint = '/_poad/log') => (lines, { final }) => {
|
|
20
|
+
const body = JSON.stringify({ lines });
|
|
21
|
+
try {
|
|
22
|
+
if (final && navigator.sendBeacon) {
|
|
23
|
+
navigator.sendBeacon(endpoint, new Blob([body], { type: 'application/json' }));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
void fetch(endpoint, { method: 'POST', headers: { 'content-type': 'application/json' }, body, keepalive: true, credentials: 'omit' }).catch(() => { });
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
/* jamais d'erreur à cause du journal */
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export const applyTheme = (theme) => {
|
|
33
|
+
const t = theme ?? (window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
34
|
+
const root = document.documentElement;
|
|
35
|
+
root.classList.remove('theme-dark', 'theme-light');
|
|
36
|
+
root.classList.add(`theme-${t}`);
|
|
37
|
+
root.style.colorScheme = t;
|
|
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
|
+
});
|
|
56
|
+
/** Démarre un front servi par l'engine : config, client poad, journaux, aperçu de la console, rendu */
|
|
57
|
+
export const bootFront = async (opts) => {
|
|
58
|
+
const logger = createFrontLogger(logSender());
|
|
59
|
+
window.addEventListener('pagehide', () => logger.flush(true));
|
|
60
|
+
window.addEventListener('error', (e) => logger.error(`erreur JavaScript : ${e.message}`, { event: 'app_js_error', attrs: { source: String(e.filename ?? '').split('?')[0], line: e.lineno } }));
|
|
61
|
+
window.addEventListener('unhandledrejection', (e) => logger.error(`promesse rejetée : ${String(e.reason?.message ?? e.reason)}`, { event: 'app_js_error' }));
|
|
62
|
+
setInterval(() => logger.flush(), 2000);
|
|
63
|
+
let config;
|
|
64
|
+
try {
|
|
65
|
+
const raw = opts.fetchConfig ? await opts.fetchConfig() : await (await fetch(opts.configUrl ?? '/_poad/front.json', { credentials: 'same-origin', cache: 'no-store' })).json();
|
|
66
|
+
if (!isFrontConfig(raw))
|
|
67
|
+
throw new Error('front.json illisible');
|
|
68
|
+
config = raw;
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
logger.error(`configuration du front illisible : ${e.message}`, { event: 'app_config_error' });
|
|
72
|
+
logger.flush();
|
|
73
|
+
opts.el.textContent = 'poad : configuration du front illisible.';
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const mode = previewModeOf(window.location.search) ?? 'live';
|
|
77
|
+
const auth = poadAuth(opts.createClient(config.api.url, config.api.anonKey));
|
|
78
|
+
let bridge = null;
|
|
79
|
+
const app = createFrontApp({ config, auth, history: browserHistory(), logger, mode, onNavigate: (page) => bridge?.navigate(page) });
|
|
80
|
+
applyTheme(null);
|
|
81
|
+
app.subscribe((s) => {
|
|
82
|
+
// Les modules de la page (sections, formulaire de connexion) partent avant le rendu
|
|
83
|
+
void preloadPage(s.page, s.needsLogin);
|
|
84
|
+
if (s.theme)
|
|
85
|
+
applyTheme(s.theme);
|
|
86
|
+
if (s.front)
|
|
87
|
+
document.title = s.page ? `${s.page.title} · ${s.front.name}` : s.front.name;
|
|
88
|
+
});
|
|
89
|
+
if (mode !== 'live') {
|
|
90
|
+
bridge = createPreviewBridge(window, config.console.origins, {
|
|
91
|
+
load: (front, page, m, theme, options) => app.loadPreview(front, page, m, theme, options),
|
|
92
|
+
page: (page) => app.showPage(page),
|
|
93
|
+
theme: (theme) => app.setTheme(theme),
|
|
94
|
+
});
|
|
95
|
+
// Taille rendue de la page, pour que le canevas cadre l'aperçu
|
|
96
|
+
const report = () => {
|
|
97
|
+
const s = app.state();
|
|
98
|
+
if (s.page)
|
|
99
|
+
bridge.rendered(s.page.id, document.documentElement.scrollWidth, document.documentElement.scrollHeight, gridLayouts());
|
|
100
|
+
};
|
|
101
|
+
new ResizeObserver(report).observe(document.body);
|
|
102
|
+
app.subscribe(() => requestAnimationFrame(report));
|
|
103
|
+
}
|
|
104
|
+
await app.start();
|
|
105
|
+
const vue = createApp(PoadFrontView, { app, lang: langOf(navigator.languages) });
|
|
106
|
+
vue.config.errorHandler = (err) => logger.error(`erreur de rendu : ${err?.message ?? String(err)}`, { event: 'app_render_error' });
|
|
107
|
+
vue.mount(opts.el);
|
|
108
|
+
bridge?.ready();
|
|
109
|
+
logger.info(mode === 'live' ? 'front démarré' : `aperçu démarré (${mode})`, { event: 'app_boot', attrs: { mode, version: config.published?.version ?? null } });
|
|
110
|
+
return { app, vue };
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +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,EAAE,aAAa,GAE/F,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAgB,EAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACxF,IAA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teur. 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,O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C,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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <PoadFrontView :app="app" lang="fr" />
|
|
3
|
+
*
|
|
4
|
+
* Le rendu Vue d'un front : il dessine l'état du cœur (@poadio/app-core, `createFrontApp`) et lui renvoie les
|
|
5
|
+
* gestes (navigation, connexion, déconnexion). Aucune logique ici : ce qui décide (page, connexion exigée, page
|
|
6
|
+
* introuvable, front pas encore publié) est dans le cœur, testé sans navigateur. Composants de @poadio/ui-vue,
|
|
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.
|
|
12
|
+
*/
|
|
13
|
+
import { type PropType, type VNode } from 'vue';
|
|
14
|
+
import { type FrontApp } from '@poadio/app-core';
|
|
15
|
+
import { type Lang } from './messages.js';
|
|
16
|
+
export declare const PoadFrontView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
app: {
|
|
18
|
+
type: PropType<FrontApp>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
lang: {
|
|
22
|
+
type: PropType<Lang>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
app: {
|
|
29
|
+
type: PropType<FrontApp>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
lang: {
|
|
33
|
+
type: PropType<Lang>;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
lang: Lang;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
//# sourceMappingURL=front-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|