@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.
Files changed (225) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/LICENSE +22 -0
  3. package/README.md +16 -2
  4. package/app-vue.css +181 -0
  5. package/dist/browser.d.ts +23 -0
  6. package/dist/browser.d.ts.map +1 -0
  7. package/dist/browser.js +112 -0
  8. package/dist/browser.js.map +1 -0
  9. package/dist/draft-toolbar.d.ts +65 -0
  10. package/dist/draft-toolbar.d.ts.map +1 -0
  11. package/dist/draft-toolbar.js +62 -0
  12. package/dist/draft-toolbar.js.map +1 -0
  13. package/dist/front-view.d.ts +39 -0
  14. package/dist/front-view.d.ts.map +1 -0
  15. package/dist/front-view.js +174 -0
  16. package/dist/front-view.js.map +1 -0
  17. package/dist/index.d.ts +5 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +6 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/items.d.ts +33 -0
  22. package/dist/items.d.ts.map +1 -0
  23. package/dist/items.js +369 -0
  24. package/dist/items.js.map +1 -0
  25. package/dist/lazy.d.ts +56 -0
  26. package/dist/lazy.d.ts.map +1 -0
  27. package/dist/lazy.js +68 -0
  28. package/dist/lazy.js.map +1 -0
  29. package/dist/messages.d.ts +56 -0
  30. package/dist/messages.d.ts.map +1 -0
  31. package/dist/messages.js +102 -0
  32. package/dist/messages.js.map +1 -0
  33. package/dist/sections/grid.d.ts +53 -0
  34. package/dist/sections/grid.d.ts.map +1 -0
  35. package/dist/sections/grid.js +46 -0
  36. package/dist/sections/grid.js.map +1 -0
  37. package/dist/sections/under-construction.d.ts +25 -0
  38. package/dist/sections/under-construction.d.ts.map +1 -0
  39. package/dist/sections/under-construction.js +32 -0
  40. package/dist/sections/under-construction.js.map +1 -0
  41. package/package.json +72 -4
  42. package/runtime-dist/app.css +535 -0
  43. package/runtime-dist/app.js +2 -0
  44. package/runtime-dist/c-0rxdxcn3.js +2 -0
  45. package/runtime-dist/c-0vbs937h.js +18 -0
  46. package/runtime-dist/c-0zqjsnm5.js +2 -0
  47. package/runtime-dist/c-13nx24wa.js +1 -0
  48. package/runtime-dist/c-16cdkp27.js +1 -0
  49. package/runtime-dist/c-16cm3n82.js +1 -0
  50. package/runtime-dist/c-1h49vkah.js +2 -0
  51. package/runtime-dist/c-1xpa1fqz.js +1 -0
  52. package/runtime-dist/c-29v2e09p.js +1 -0
  53. package/runtime-dist/c-2ag31260.js +2 -0
  54. package/runtime-dist/c-2s6r37jb.js +1 -0
  55. package/runtime-dist/c-2v244yc0.js +1 -0
  56. package/runtime-dist/c-3be398px.js +1 -0
  57. package/runtime-dist/c-3jm96b1p.js +2 -0
  58. package/runtime-dist/c-3pe5hprv.js +2 -0
  59. package/runtime-dist/c-3zbf5g3p.js +1 -0
  60. package/runtime-dist/c-4h51m4qq.js +1 -0
  61. package/runtime-dist/c-523qwqen.js +2 -0
  62. package/runtime-dist/c-572jz6y4.js +1 -0
  63. package/runtime-dist/c-64j9mv7a.js +1 -0
  64. package/runtime-dist/c-6f446pxt.js +1 -0
  65. package/runtime-dist/c-6pd33f4a.js +1 -0
  66. package/runtime-dist/c-6qa26wds.js +1 -0
  67. package/runtime-dist/c-6w0f1kqm.js +1 -0
  68. package/runtime-dist/c-72hj12cs.js +2 -0
  69. package/runtime-dist/c-7cjj18ea.js +1 -0
  70. package/runtime-dist/c-823yyjat.js +1 -0
  71. package/runtime-dist/c-8gpbevx2.js +1 -0
  72. package/runtime-dist/c-98tbntdq.js +2 -0
  73. package/runtime-dist/c-9sm6aybf.js +2 -0
  74. package/runtime-dist/c-a63rkaa9.js +1 -0
  75. package/runtime-dist/c-ahcj5yr5.js +1 -0
  76. package/runtime-dist/c-azvw5879.js +2 -0
  77. package/runtime-dist/c-b6g9ey7e.js +2 -0
  78. package/runtime-dist/c-bssc8kwn.js +1 -0
  79. package/runtime-dist/c-bvp9zbmr.js +1 -0
  80. package/runtime-dist/c-cc3m3rs1.js +2 -0
  81. package/runtime-dist/c-cp1ehb23.js +1 -0
  82. package/runtime-dist/c-cvsx6n6e.js +2 -0
  83. package/runtime-dist/c-d5y90g8f.js +1 -0
  84. package/runtime-dist/c-d8hfdner.js +2 -0
  85. package/runtime-dist/c-dqtdk937.js +1 -0
  86. package/runtime-dist/c-dzx0rg0g.js +2 -0
  87. package/runtime-dist/c-eczfywaq.js +1 -0
  88. package/runtime-dist/c-epemgj1a.js +2 -0
  89. package/runtime-dist/c-et83hbhc.js +1 -0
  90. package/runtime-dist/c-ffkh15py.js +1 -0
  91. package/runtime-dist/c-fn3059s1.js +2 -0
  92. package/runtime-dist/c-fnzeden9.js +1 -0
  93. package/runtime-dist/c-gen0a4bn.js +1 -0
  94. package/runtime-dist/c-gesjk5ph.js +1 -0
  95. package/runtime-dist/c-gkyekesy.js +15 -0
  96. package/runtime-dist/c-gs1k0twe.js +2 -0
  97. package/runtime-dist/c-gznx0sj4.js +2 -0
  98. package/runtime-dist/c-h5m94fwp.js +1 -0
  99. package/runtime-dist/c-hdstjg33.js +2 -0
  100. package/runtime-dist/c-hsy77frc.js +3 -0
  101. package/runtime-dist/c-j02ymtyd.js +2 -0
  102. package/runtime-dist/c-j63hz554.js +2 -0
  103. package/runtime-dist/c-jvrr9zb8.js +1 -0
  104. package/runtime-dist/c-jymrpj5m.js +1 -0
  105. package/runtime-dist/c-k624qrhh.js +2 -0
  106. package/runtime-dist/c-kbg0cafy.js +2 -0
  107. package/runtime-dist/c-kmx0mv0c.js +2 -0
  108. package/runtime-dist/c-krt6rpg1.js +1 -0
  109. package/runtime-dist/c-kyajr8zz.js +2 -0
  110. package/runtime-dist/c-m30q0jrb.js +1 -0
  111. package/runtime-dist/c-m49q9r7s.js +1 -0
  112. package/runtime-dist/c-m6yf7zaj.js +2 -0
  113. package/runtime-dist/c-m70tbfc5.js +2 -0
  114. package/runtime-dist/c-mdj990nz.js +2 -0
  115. package/runtime-dist/c-mvdn43tv.js +2 -0
  116. package/runtime-dist/c-mw3zx9yk.js +1 -0
  117. package/runtime-dist/c-n8mqnvjg.js +1 -0
  118. package/runtime-dist/c-nkrm4n9a.js +1 -0
  119. package/runtime-dist/c-nn49946s.js +1 -0
  120. package/runtime-dist/c-ny0mdx7k.js +2 -0
  121. package/runtime-dist/c-p8wyhrwm.js +2 -0
  122. package/runtime-dist/c-pbn2syef.js +1 -0
  123. package/runtime-dist/c-prt5qv2x.js +1 -0
  124. package/runtime-dist/c-qe1kevqk.js +1 -0
  125. package/runtime-dist/c-rasvf2z2.js +2 -0
  126. package/runtime-dist/c-rf1xevya.js +1 -0
  127. package/runtime-dist/c-rktc0ksd.js +2 -0
  128. package/runtime-dist/c-sd570jk7.js +2 -0
  129. package/runtime-dist/c-sdf15np5.js +1 -0
  130. package/runtime-dist/c-sjajadt4.js +2 -0
  131. package/runtime-dist/c-sv15z0aa.js +1 -0
  132. package/runtime-dist/c-tv3ksk7j.js +2 -0
  133. package/runtime-dist/c-vrmw0gka.js +1 -0
  134. package/runtime-dist/c-wjadf68q.js +1 -0
  135. package/runtime-dist/c-wnynh7zm.js +1 -0
  136. package/runtime-dist/c-xeqwqt9z.js +2 -0
  137. package/runtime-dist/c-xk9fqzsc.js +1 -0
  138. package/runtime-dist/c-xqf3j4w7.js +1 -0
  139. package/runtime-dist/c-xx4986kx.js +1 -0
  140. package/runtime-dist/c-y9120d6h.js +1 -0
  141. package/runtime-dist/c-ywzh0r63.js +1 -0
  142. package/runtime-dist/c-zyfkspym.js +2 -0
  143. package/runtime-dist/index.html +14 -0
  144. package/runtime-dist/ui-accordion.css +29 -0
  145. package/runtime-dist/ui-app-shell.css +36 -0
  146. package/runtime-dist/ui-avatar.css +28 -0
  147. package/runtime-dist/ui-badge.css +14 -0
  148. package/runtime-dist/ui-block-editor.css +85 -0
  149. package/runtime-dist/ui-block-view.css +50 -0
  150. package/runtime-dist/ui-block.css +20 -0
  151. package/runtime-dist/ui-bottom-nav.css +54 -0
  152. package/runtime-dist/ui-breadcrumb.css +25 -0
  153. package/runtime-dist/ui-button-group.css +39 -0
  154. package/runtime-dist/ui-calendar.css +168 -0
  155. package/runtime-dist/ui-card.css +26 -0
  156. package/runtime-dist/ui-carousel.css +35 -0
  157. package/runtime-dist/ui-chart.css +26 -0
  158. package/runtime-dist/ui-checkbox.css +25 -0
  159. package/runtime-dist/ui-chip.css +30 -0
  160. package/runtime-dist/ui-code-editor.css +25 -0
  161. package/runtime-dist/ui-colorpicker.css +46 -0
  162. package/runtime-dist/ui-combo.css +43 -0
  163. package/runtime-dist/ui-dataview.css +50 -0
  164. package/runtime-dist/ui-datepicker.css +80 -0
  165. package/runtime-dist/ui-dialog.css +119 -0
  166. package/runtime-dist/ui-divider.css +18 -0
  167. package/runtime-dist/ui-fieldset.css +25 -0
  168. package/runtime-dist/ui-filter-chip.css +24 -0
  169. package/runtime-dist/ui-floating.css +9 -0
  170. package/runtime-dist/ui-gantt.css +105 -0
  171. package/runtime-dist/ui-image.css +34 -0
  172. package/runtime-dist/ui-inplace.css +19 -0
  173. package/runtime-dist/ui-json-editor.css +40 -0
  174. package/runtime-dist/ui-layout.css +39 -0
  175. package/runtime-dist/ui-listbox.css +52 -0
  176. package/runtime-dist/ui-map.css +469 -0
  177. package/runtime-dist/ui-menu.css +38 -0
  178. package/runtime-dist/ui-menubar.css +55 -0
  179. package/runtime-dist/ui-meter.css +26 -0
  180. package/runtime-dist/ui-multiselect.css +62 -0
  181. package/runtime-dist/ui-nav-drawer.css +118 -0
  182. package/runtime-dist/ui-number.css +26 -0
  183. package/runtime-dist/ui-option-list.css +28 -0
  184. package/runtime-dist/ui-orderlist.css +54 -0
  185. package/runtime-dist/ui-orgchart.css +71 -0
  186. package/runtime-dist/ui-paginator.css +25 -0
  187. package/runtime-dist/ui-panel.css +28 -0
  188. package/runtime-dist/ui-password.css +26 -0
  189. package/runtime-dist/ui-picklist.css +58 -0
  190. package/runtime-dist/ui-popover.css +20 -0
  191. package/runtime-dist/ui-progress.css +31 -0
  192. package/runtime-dist/ui-radio.css +29 -0
  193. package/runtime-dist/ui-rating.css +19 -0
  194. package/runtime-dist/ui-richtext.css +48 -0
  195. package/runtime-dist/ui-scheduler.css +132 -0
  196. package/runtime-dist/ui-scroll-top.css +17 -0
  197. package/runtime-dist/ui-segmented.css +25 -0
  198. package/runtime-dist/ui-select.css +47 -0
  199. package/runtime-dist/ui-sheet.css +56 -0
  200. package/runtime-dist/ui-skeleton.css +18 -0
  201. package/runtime-dist/ui-slider.css +59 -0
  202. package/runtime-dist/ui-speed-dial.css +26 -0
  203. package/runtime-dist/ui-splitter.css +23 -0
  204. package/runtime-dist/ui-stepper.css +47 -0
  205. package/runtime-dist/ui-switch.css +31 -0
  206. package/runtime-dist/ui-table-panel.css +114 -0
  207. package/runtime-dist/ui-table.css +430 -0
  208. package/runtime-dist/ui-tabs.css +45 -0
  209. package/runtime-dist/ui-taskboard.css +104 -0
  210. package/runtime-dist/ui-timeline.css +44 -0
  211. package/runtime-dist/ui-toast.css +43 -0
  212. package/runtime-dist/ui-toggle-button.css +6 -0
  213. package/runtime-dist/ui-tooltip.css +21 -0
  214. package/runtime-dist/ui-tree.css +44 -0
  215. package/runtime-dist/ui-upload.css +46 -0
  216. package/runtime-dist/version.json +1 -0
  217. package/src/browser.ts +126 -0
  218. package/src/draft-toolbar.ts +67 -0
  219. package/src/front-view.ts +186 -0
  220. package/src/index.ts +5 -0
  221. package/src/items.ts +436 -0
  222. package/src/lazy.ts +76 -0
  223. package/src/messages.ts +110 -0
  224. package/src/sections/grid.ts +56 -0
  225. package/src/sections/under-construction.ts +34 -0
package/src/lazy.ts ADDED
@@ -0,0 +1,76 @@
1
+ // Chargement à la demande : le moteur ne télécharge que ce que la page affichée emploie.
2
+ // - composants de @poadio/ui-vue : un module par composant (exports profonds @poadio/ui-vue/<composant>,
3
+ // ui-vue 0.10.0), chargé au premier rendu qui en a besoin (formulaire de connexion, badge du canevas…) ;
4
+ // - sections d'une page : un module par type de section présent dans la définition (SECTIONS) ;
5
+ // - composants posés sur une grille : un module par type présent sur la page (items.ts, ITEM_LOADERS), avec ses
6
+ // feuilles de style.
7
+ // Le bundle du moteur (runtime/build.mjs, découpage en morceaux) en fait des fichiers à part : la page
8
+ // « En construction » ne charge ni le formulaire de connexion, ni les champs, ni les composants qu'elle n'a pas.
9
+ import { defineAsyncComponent, type Component } from 'vue';
10
+ import type { Page } from '@poadio/app-core';
11
+ import { ITEM_LOADERS, loadItemStyles } from './items.js';
12
+
13
+ const lazy = (load: () => Promise<Component>) => defineAsyncComponent({ loader: load, delay: 0 });
14
+
15
+ export const PoadButton = lazy(() => import('@poadio/ui-vue/button').then((m) => m.PoadButton));
16
+ export const PoadField = lazy(() => import('@poadio/ui-vue/field').then((m) => m.PoadField));
17
+ export const PoadInput = lazy(() => import('@poadio/ui-vue/field').then((m) => m.PoadInput));
18
+ export const PoadMessage = lazy(() => import('@poadio/ui-vue/message').then((m) => m.PoadMessage));
19
+ export const PoadTag = lazy(() => import('@poadio/ui-vue/tag').then((m) => m.PoadTag));
20
+ // Barre du brouillon (Lecture du brouillon seulement)
21
+ export const PoadIcon = lazy(() => import('@poadio/ui-vue/icon').then((m) => m.PoadIcon));
22
+ export const PoadMenu = lazy(() => import('@poadio/ui-vue/menu').then((m) => m.PoadMenu));
23
+
24
+ /** Un module par type de section : ajouter un type, c'est ajouter une ligne ici et son module dans sections/ */
25
+ export const SECTION_LOADERS: Record<string, () => Promise<Component>> = {
26
+ 'under-construction': () => import('./sections/under-construction.js').then((m) => m.UnderConstructionSection),
27
+ grid: () => import('./sections/grid.js').then((m) => m.GridSection),
28
+ };
29
+ const sectionComponents = new Map<string, Component>();
30
+ export const sectionComponent = (type: string): Component | null => {
31
+ const load = SECTION_LOADERS[type];
32
+ if (!load) return null;
33
+ if (!sectionComponents.has(type)) sectionComponents.set(type, lazy(load));
34
+ return sectionComponents.get(type)!;
35
+ };
36
+
37
+ /** Types de section d'une page (sans doublon) : ce qu'il faut charger pour l'afficher */
38
+ export const sectionTypes = (page: Page | null | undefined): string[] => [...new Set((page?.sections ?? []).map((s) => s.type))];
39
+
40
+ /** Types de composants posés sur les grilles d'une page (sans doublon) */
41
+ export const itemTypes = (page: Page | null | undefined): string[] => [
42
+ ...new Set((page?.sections ?? []).flatMap((s) => (s.type === 'grid' ? s.items.map((i) => i.type) : []))),
43
+ ];
44
+
45
+ const itemComponents = new Map<string, Component>();
46
+ /** Le composant d'un type posé sur une grille, chargé à la demande (null : type sans rendu dans ce moteur) */
47
+ export const itemComponent = (type: string, onError?: (type: string, err: unknown) => void): Component | null => {
48
+ const load = ITEM_LOADERS[type];
49
+ if (!load) return null;
50
+ if (!itemComponents.has(type))
51
+ itemComponents.set(
52
+ type,
53
+ defineAsyncComponent({
54
+ loader: () => {
55
+ loadItemStyles(type);
56
+ return load();
57
+ },
58
+ delay: 0,
59
+ onError: (err, _retry, fail) => {
60
+ onError?.(type, err);
61
+ // Le rendu suivant pourra réessayer
62
+ itemComponents.delete(type);
63
+ fail();
64
+ },
65
+ }),
66
+ );
67
+ return itemComponents.get(type)!;
68
+ };
69
+
70
+ /** Charge d'avance les modules d'une page (navigation, connexion demandée) ; les erreurs restent au rendu */
71
+ export const preloadPage = (page: Page | null | undefined, needsLogin = false): Promise<unknown> =>
72
+ Promise.allSettled([
73
+ ...sectionTypes(page).map((t) => SECTION_LOADERS[t]?.()),
74
+ ...itemTypes(page).map((t) => (loadItemStyles(t), ITEM_LOADERS[t]?.())),
75
+ ...(needsLogin ? [import('@poadio/ui-vue/field'), import('@poadio/ui-vue/button'), import('@poadio/ui-vue/message')] : []),
76
+ ]);
@@ -0,0 +1,110 @@
1
+ // Textes du moteur (français et anglais). La langue suit celle du navigateur ; le français par défaut.
2
+ export type Lang = 'fr' | 'en';
3
+
4
+ const FR = {
5
+ 'loading': 'Chargement…',
6
+ 'under.title': 'En construction',
7
+ 'under.text': 'Ce front se prépare. Revenez bientôt.',
8
+ 'under.project': 'Projet',
9
+ 'unpublished.title': 'Pas encore publié',
10
+ 'unpublished.text': 'Ce front existe mais n’a pas encore été publié depuis la console du projet.',
11
+ 'notfound.title': 'Page introuvable',
12
+ 'notfound.text': 'Cette adresse ne correspond à aucune page de ce front.',
13
+ 'notfound.home': 'Revenir à l’accueil',
14
+ 'error.title': 'Ce front ne peut pas s’afficher',
15
+ 'error.text': 'Sa configuration est illisible. L’erreur a été enregistrée dans les journaux du projet.',
16
+ 'signin.title': 'Connexion',
17
+ 'signin.text': 'Cette page est réservée aux utilisateurs du projet.',
18
+ 'signin.email': 'Adresse e-mail',
19
+ 'signin.password': 'Mot de passe',
20
+ 'signin.submit': 'Se connecter',
21
+ 'signin.invalid_credentials': 'Adresse e-mail ou mot de passe incorrect.',
22
+ 'signin.error': 'La connexion a échoué. Réessayez.',
23
+ 'signout': 'Se déconnecter',
24
+ 'signin.link': 'Se connecter',
25
+ 'badge.auth': 'Membres',
26
+ 'badge.public': 'Public',
27
+ 'badge.visitor': 'Vu comme visiteur',
28
+ 'grid.empty': 'Grille vide : glissez un composant de la boîte à outils, ou cliquez dessus.',
29
+ 'grid.empty.live': 'Cette page est encore vide.',
30
+ 'nav': 'Pages du front',
31
+ 'draft.badge': 'Brouillon',
32
+ 'draft.text': 'Vous voyez le brouillon, pas la version en ligne.',
33
+ 'draft.close': 'Fermer la barre du brouillon (pour cet onglet)',
34
+ 'draft.toolbar': 'Barre du brouillon',
35
+ 'draft.device': 'Taille d’écran',
36
+ 'draft.device.desktop': 'Ordinateur',
37
+ 'draft.device.tablet': 'Tablette',
38
+ 'draft.device.phone': 'Téléphone',
39
+ 'draft.theme.dark': 'Passer en thème sombre',
40
+ 'draft.theme.light': 'Passer en thème clair',
41
+ 'draft.pages': 'Aller à une page',
42
+ 'draft.reload': 'Recharger le brouillon',
43
+ 'draft.collapse': 'Replier la barre',
44
+ 'draft.expand': 'Déplier la barre',
45
+ 'draft.move': 'Déplacer la barre',
46
+ 'item.content': 'Contenu de « {name} ».',
47
+ 'item.image.empty': 'Image : donnez son adresse dans les propriétés.',
48
+ 'item.menu': 'Menu',
49
+ 'item.actions': 'Actions',
50
+ 'item.unknown': 'Composant indisponible dans ce moteur.',
51
+ 'item.failed': 'Ce composant n’a pas pu se charger.',
52
+ } as const;
53
+
54
+ export type MessageKey = keyof typeof FR;
55
+
56
+ const EN: Record<MessageKey, string> = {
57
+ 'loading': 'Loading…',
58
+ 'under.title': 'Under construction',
59
+ 'under.text': 'This front is being prepared. Come back soon.',
60
+ 'under.project': 'Project',
61
+ 'unpublished.title': 'Not published yet',
62
+ 'unpublished.text': 'This front exists but has not been published from the project console yet.',
63
+ 'notfound.title': 'Page not found',
64
+ 'notfound.text': 'This address matches no page of this front.',
65
+ 'notfound.home': 'Back to the home page',
66
+ 'error.title': 'This front cannot be shown',
67
+ 'error.text': 'Its configuration cannot be read. The error was recorded in the project logs.',
68
+ 'signin.title': 'Sign in',
69
+ 'signin.text': 'This page is reserved for the project users.',
70
+ 'signin.email': 'Email address',
71
+ 'signin.password': 'Password',
72
+ 'signin.submit': 'Sign in',
73
+ 'signin.invalid_credentials': 'Wrong email address or password.',
74
+ 'signin.error': 'Sign-in failed. Try again.',
75
+ 'signout': 'Sign out',
76
+ 'signin.link': 'Sign in',
77
+ 'badge.auth': 'Members',
78
+ 'badge.public': 'Public',
79
+ 'badge.visitor': 'Seen as a visitor',
80
+ 'grid.empty': 'Empty grid: drag a component from the toolbox, or click it.',
81
+ 'grid.empty.live': 'This page is still empty.',
82
+ 'nav': 'Front pages',
83
+ 'draft.badge': 'Draft',
84
+ 'draft.text': 'You are seeing the draft, not the online version.',
85
+ 'draft.close': 'Close the draft toolbar (for this tab)',
86
+ 'draft.toolbar': 'Draft toolbar',
87
+ 'draft.device': 'Screen size',
88
+ 'draft.device.desktop': 'Desktop',
89
+ 'draft.device.tablet': 'Tablet',
90
+ 'draft.device.phone': 'Phone',
91
+ 'draft.theme.dark': 'Switch to dark theme',
92
+ 'draft.theme.light': 'Switch to light theme',
93
+ 'draft.pages': 'Go to a page',
94
+ 'draft.reload': 'Reload the draft',
95
+ 'draft.collapse': 'Fold the toolbar',
96
+ 'draft.expand': 'Unfold the toolbar',
97
+ 'draft.move': 'Move the toolbar',
98
+ 'item.content': 'Content of “{name}”.',
99
+ 'item.image.empty': 'Image: set its address in the properties.',
100
+ 'item.menu': 'Menu',
101
+ 'item.actions': 'Actions',
102
+ 'item.unknown': 'Component not available in this runtime.',
103
+ 'item.failed': 'This component could not be loaded.',
104
+ };
105
+
106
+ export const MESSAGES: Record<Lang, Record<MessageKey, string>> = { fr: FR, en: EN };
107
+
108
+ export const langOf = (languages: readonly string[] | undefined): Lang => (languages?.[0]?.toLowerCase().startsWith('en') ? 'en' : 'fr');
109
+
110
+ export const translator = (lang: Lang) => (key: MessageKey) => MESSAGES[lang][key];
@@ -0,0 +1,56 @@
1
+ // Section grille (24 colonnes) : les composants posés, chacun dans sa case (x, y, w, h), rendus par leur module chargé
2
+ // à la demande (lazy.ts, items.ts). Sur un écran étroit (< 640 px), ils s'empilent dans l'ordre de lecture, chacun à
3
+ // sa hauteur. Sur le canevas de la console, la grille montre ses lignes et garde de la place libre en dessous pour
4
+ // poser la suite ; la console dessine par-dessus la sélection et les poignées (elle reçoit la place de la grille
5
+ // par le message `rendered`, voir browser.ts).
6
+ import { defineComponent, h, type PropType } from 'vue';
7
+ import { readingOrder, resolveProps, type FrontLogger, type GridItem, type GridSection as Section } from '@poadio/app-core';
8
+ import type { MessageKey } from '../messages.js';
9
+ import { itemComponent } from '../lazy.js';
10
+ import type { FrontNav } from '../items.js';
11
+
12
+ /** Lignes libres gardées sous le dernier composant, sur le canevas */
13
+ export const CANVAS_SPARE_ROWS = 6;
14
+ export const CANVAS_MIN_ROWS = 12;
15
+
16
+ export const GridSection = defineComponent({
17
+ name: 'PoadFrontGrid',
18
+ props: {
19
+ section: { type: Object as PropType<Section>, required: true },
20
+ t: { type: Function as PropType<(k: MessageKey) => string>, required: true },
21
+ canvas: Boolean,
22
+ log: { type: Object as PropType<FrontLogger | null>, default: null },
23
+ /** Pages et routeur du front, pour les composants de navigation posés */
24
+ nav: { type: Object as PropType<FrontNav | null>, default: null },
25
+ },
26
+ setup(props) {
27
+ const failed = (type: string, err: unknown) =>
28
+ props.log?.error(`composant ${type} : chargement impossible (${(err as Error)?.message ?? String(err)})`, { event: 'app_component_load_error', attrs: { component: type, section: props.section.id } });
29
+
30
+ const cell = (it: GridItem, order: number) => {
31
+ const c = itemComponent(it.type, failed);
32
+ const ctx = { t: props.t, canvas: props.canvas, nav: props.nav };
33
+ return h(
34
+ 'div',
35
+ {
36
+ key: it.id,
37
+ class: ['poad-front__item', `is-${it.type}`],
38
+ 'data-item': it.id,
39
+ style: { gridColumn: `${it.x + 1} / span ${it.w}`, gridRow: `${it.y + 1} / span ${it.h}`, '--poad-item-order': order, '--poad-item-h': it.h },
40
+ },
41
+ [c ? h(c, { p: resolveProps(it.type, it.props), ctx }) : h('div', { class: 'poad-front__placeholder' }, props.t('item.unknown'))],
42
+ );
43
+ };
44
+
45
+ return () => {
46
+ const s = props.section;
47
+ const items = readingOrder(s.items);
48
+ const used = items.reduce((m, i) => Math.max(m, i.y + i.h), 0);
49
+ const rows = props.canvas ? Math.max(CANVAS_MIN_ROWS, used + CANVAS_SPARE_ROWS) : used;
50
+ return h('section', { class: ['poad-front__grid', props.canvas && 'is-canvas', items.length > 0 && 'has-items'], 'data-section': s.id, style: { '--poad-front-row': `${s.rowHeight}px` } }, [
51
+ h('div', { class: 'poad-front__cells', 'data-grid': s.id, 'data-rows': rows, style: { '--poad-front-rows': rows } }, items.map(cell)),
52
+ s.items.length === 0 ? h('p', { class: 'poad-front__grid-empty' }, props.t(props.canvas ? 'grid.empty' : 'grid.empty.live')) : null,
53
+ ]);
54
+ };
55
+ },
56
+ });
@@ -0,0 +1,34 @@
1
+ // Section « En construction » : nom du front, message, nom du projet. Aucun composant de @poadio/ui-vue.
2
+ import { defineComponent, h, type PropType } from 'vue';
3
+ import type { UnderConstructionSection as Section } from '@poadio/app-core';
4
+ import type { MessageKey } from '../messages.js';
5
+
6
+ export const UnderConstructionSection = defineComponent({
7
+ name: 'PoadFrontUnderConstruction',
8
+ props: {
9
+ section: { type: Object as PropType<Section>, required: true },
10
+ t: { type: Function as PropType<(k: MessageKey) => string>, required: true },
11
+ },
12
+ setup(props) {
13
+ return () => {
14
+ const s = props.section;
15
+ const t = props.t;
16
+ return h('section', { class: 'poad-front__under', 'data-section': s.id }, [
17
+ h('div', { class: 'poad-front__under-mark', 'aria-hidden': 'true' }, [
18
+ // Une grue stylisée : trait seul, couleur du thème
19
+ h('svg', { viewBox: '0 0 64 64', width: 64, height: 64, fill: 'none', stroke: 'currentColor', 'stroke-width': 2.5, 'stroke-linecap': 'round', 'stroke-linejoin': 'round' }, [
20
+ h('path', { d: 'M14 58V10l-6 8h44' }),
21
+ h('path', { d: 'M14 10l38 8' }),
22
+ h('path', { d: 'M44 18v14' }),
23
+ h('rect', { x: 38, y: 32, width: 12, height: 9, rx: 1.5 }),
24
+ h('path', { d: 'M6 58h20' }),
25
+ ]),
26
+ ]),
27
+ h('h1', { class: 'poad-front__under-title' }, t('under.title')),
28
+ s.props.front ? h('p', { class: 'poad-front__under-front' }, s.props.front) : null,
29
+ h('p', { class: 'poad-front__under-text' }, s.props.message || t('under.text')),
30
+ s.props.project ? h('p', { class: 'poad-front__under-project' }, [h('span', { class: 'poad-front__under-label' }, `${t('under.project')} `), h('strong', null, s.props.project)]) : null,
31
+ ]);
32
+ };
33
+ },
34
+ });