@fraza/core 0.3.8 → 0.3.12
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 +32 -0
- package/THIRD-PARTY-NOTICES.md +2 -2
- package/changelog.json +86 -0
- package/dist/docs/00-decouverte/01-qu-est-ce-que-fraza.md +1 -1
- package/dist/docs/01-demarrage/01-installation.md +9 -15
- package/dist/docs/01-demarrage/02-tour-du-proprietaire.md +1 -1
- package/dist/docs/01-demarrage/03-configuration.md +1 -1
- package/dist/docs/02-guides/accepter-des-paiements.md +1 -1
- package/dist/docs/02-guides/basculer-sur-le-registre-de-secours.md +3 -3
- package/dist/docs/02-guides/blocs-personnalises.md +1 -1
- package/dist/docs/02-guides/etendre-l-admin.md +2 -2
- package/dist/docs/02-guides/gerer-les-medias.md +1 -1
- package/dist/docs/02-guides/index.md +1 -1
- package/dist/docs/02-guides/seo-et-metadonnees.md +1 -1
- package/dist/docs/03-reference/01-cores/templates.md +3 -3
- package/dist/docs/03-reference/02-features/admin.md +13 -2
- package/dist/docs/03-reference/03-registres/media-registry.md +4 -4
- package/dist/docs/03-reference/04-partage/composants.md +2 -0
- package/dist/docs/03-reference/05-cli/fraza-key.md +1 -1
- package/dist/docs/03-reference/06-configuration/paquets-supportes.md +1 -1
- package/dist/docs/03-reference/06-configuration/variables-d-environnement.md +2 -2
- package/dist/docs/04-architecture/02-frontieres-serveur-client.md +1 -1
- package/dist/docs/04-architecture/05-securite.md +1 -1
- package/dist/docs/04-architecture/07-licence-et-propriete.md +1 -1
- package/dist/docs/05-contribution/03-redaction.md +10 -0
- package/dist/docs/05-contribution/05-publication.md +0 -1
- package/dist/docs/06-modules/booking/{installation.md → 01-installation.md} +35 -20
- package/dist/docs/06-modules/booking/{configuration.md → 02-configuration.md} +5 -5
- package/dist/docs/06-modules/booking/{admin.md → 03-admin.md} +3 -3
- package/dist/docs/06-modules/booking/{reservation-en-ligne.md → 04-reservation-en-ligne.md} +2 -2
- package/dist/docs/06-modules/booking/{courriels.md → 05-courriels.md} +2 -2
- package/dist/docs/06-modules/booking/{modele-de-donnees.md → 06-modele-de-donnees.md} +1 -1
- package/dist/docs/06-modules/booking/{api.md → 07-api.md} +2 -2
- package/dist/docs/06-modules/booking/index.md +22 -12
- package/dist/docs/06-modules/drive/01-installation.md +92 -0
- package/dist/docs/06-modules/drive/{configuration.md → 02-configuration.md} +5 -5
- package/dist/docs/06-modules/drive/{admin.md → 03-admin.md} +8 -8
- package/dist/docs/06-modules/drive/{partages.md → 04-partages.md} +5 -5
- package/dist/docs/06-modules/drive/{fichiers.md → 05-fichiers.md} +4 -4
- package/dist/docs/06-modules/drive/{modele-de-donnees.md → 06-modele-de-donnees.md} +2 -2
- package/dist/docs/06-modules/drive/{api.md → 07-api.md} +5 -5
- package/dist/docs/06-modules/drive/index.md +23 -13
- package/dist/docs/06-modules/facturation/{installation.md → 01-installation.md} +61 -39
- package/dist/docs/06-modules/facturation/{configuration.md → 02-configuration.md} +5 -5
- package/dist/docs/06-modules/facturation/{facturation.md → 03-facturation.md} +4 -4
- package/dist/docs/06-modules/facturation/{taxes.md → 04-taxes.md} +2 -2
- package/dist/docs/06-modules/facturation/{paiements.md → 05-paiements.md} +3 -3
- package/dist/docs/06-modules/facturation/{recurrences-et-rappels.md → 06-recurrences-et-rappels.md} +4 -4
- package/dist/docs/06-modules/facturation/{courriels.md → 07-courriels.md} +5 -5
- package/dist/docs/06-modules/facturation/{modele-de-donnees.md → 08-modele-de-donnees.md} +2 -2
- package/dist/docs/06-modules/facturation/{api.md → 09-api.md} +3 -3
- package/dist/docs/06-modules/facturation/index.md +26 -16
- package/dist/docs/06-modules/forms/{installation.md → 01-installation.md} +25 -30
- package/dist/docs/06-modules/forms/{configuration.md → 02-configuration.md} +6 -6
- package/dist/docs/06-modules/forms/{champs.md → 03-champs.md} +4 -4
- package/dist/docs/06-modules/forms/{admin.md → 04-admin.md} +9 -9
- package/dist/docs/06-modules/forms/{soumissions.md → 05-soumissions.md} +7 -7
- package/dist/docs/06-modules/forms/{affichage.md → 06-affichage.md} +3 -3
- package/dist/docs/06-modules/forms/{modele-de-donnees.md → 07-modele-de-donnees.md} +3 -3
- package/dist/docs/06-modules/forms/{api.md → 08-api.md} +4 -4
- package/dist/docs/06-modules/forms/index.md +26 -14
- package/dist/docs/06-modules/index.md +2 -2
- package/dist/docs/06-modules/medias/{installation.md → 01-installation.md} +33 -36
- package/dist/docs/06-modules/medias/{configuration.md → 02-configuration.md} +5 -5
- package/dist/docs/06-modules/medias/{televersement.md → 03-televersement.md} +4 -4
- package/dist/docs/06-modules/medias/{admin.md → 04-admin.md} +7 -7
- package/dist/docs/06-modules/medias/{modele-de-donnees.md → 06-modele-de-donnees.md} +4 -4
- package/dist/docs/06-modules/medias/{api.md → 07-api.md} +6 -6
- package/dist/docs/06-modules/medias/index.md +25 -13
- package/dist/docs/06-modules/pages/{installation.md → 01-installation.md} +15 -17
- package/dist/docs/06-modules/pages/{configuration.md → 02-configuration.md} +1 -1
- package/dist/docs/06-modules/pages/{admin.md → 03-admin.md} +6 -6
- package/dist/docs/06-modules/pages/{modele-de-donnees.md → 04-modele-de-donnees.md} +2 -2
- package/dist/docs/06-modules/pages/{templates.md → 05-templates.md} +1 -1
- package/dist/docs/06-modules/pages/{api.md → 06-api.md} +2 -2
- package/dist/docs/06-modules/pages/index.md +21 -9
- package/dist/docs/06-modules/posts/{installation.md → 01-installation.md} +28 -34
- package/dist/docs/06-modules/posts/{configuration.md → 02-configuration.md} +6 -6
- package/dist/docs/06-modules/posts/{types-et-champs.md → 03-types-et-champs.md} +11 -11
- package/dist/docs/06-modules/posts/{taxonomies-et-relations.md → 04-taxonomies-et-relations.md} +5 -5
- package/dist/docs/06-modules/posts/{admin.md → 05-admin.md} +13 -13
- package/dist/docs/06-modules/posts/{modele-de-donnees.md → 06-modele-de-donnees.md} +3 -3
- package/dist/docs/06-modules/posts/{templates.md → 07-templates.md} +2 -2
- package/dist/docs/06-modules/posts/{api.md → 08-api.md} +3 -3
- package/dist/docs/06-modules/posts/index.md +25 -13
- package/dist/docs/assets/decouverte/tableau-de-bord.dark.webp +0 -0
- package/dist/docs/assets/decouverte/tableau-de-bord.light.webp +0 -0
- package/dist/docs/assets/demarrage/connexion.dark.webp +0 -0
- package/dist/docs/assets/demarrage/connexion.light.webp +0 -0
- package/dist/docs/assets/demarrage/roles.dark.webp +0 -0
- package/dist/docs/assets/demarrage/roles.light.webp +0 -0
- package/dist/docs/assets/demarrage/tableau-de-bord-neuf.dark.webp +0 -0
- package/dist/docs/assets/demarrage/tableau-de-bord-neuf.light.webp +0 -0
- package/dist/docs/assets/modules/booking/agenda.dark.webp +0 -0
- package/dist/docs/assets/modules/booking/agenda.light.webp +0 -0
- package/dist/docs/assets/modules/drive/navigateur.dark.webp +0 -0
- package/dist/docs/assets/modules/drive/navigateur.light.webp +0 -0
- package/dist/docs/assets/modules/facturation/factures.dark.webp +0 -0
- package/dist/docs/assets/modules/facturation/factures.light.webp +0 -0
- package/dist/docs/assets/modules/forms/constructeur.dark.webp +0 -0
- package/dist/docs/assets/modules/forms/constructeur.light.webp +0 -0
- package/dist/docs/assets/modules/medias/mediatheque.dark.webp +0 -0
- package/dist/docs/assets/modules/medias/mediatheque.light.webp +0 -0
- package/dist/docs/assets/modules/pages/liste.dark.webp +0 -0
- package/dist/docs/assets/modules/pages/liste.light.webp +0 -0
- package/dist/docs/assets/modules/posts/liste.dark.webp +0 -0
- package/dist/docs/assets/modules/posts/liste.light.webp +0 -0
- package/dist/docs/assets/reference/liste-compacte.dark.webp +0 -0
- package/dist/docs/assets/reference/liste-compacte.light.webp +0 -0
- package/dist/features/admin/components/dashboard/DashboardGrid.client.js +34 -23
- package/dist/shared/lib/version.js +1 -1
- package/package.json +1 -1
- package/supported.json +1 -1
- package/dist/docs/06-modules/drive/installation.md +0 -69
- /package/dist/docs/06-modules/medias/{integration.md → 05-integration.md} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState
|
|
3
|
+
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import AdminErrorBoundary from "../../AdminErrorBoundary.client.js";
|
|
5
5
|
import Button from "../../../../shared/components/Button.js";
|
|
6
6
|
import { GripVerticalIcon } from "@fraza/icons/GripVerticalIcon";
|
|
@@ -8,29 +8,39 @@ import { CloseIcon } from "@fraza/icons/CloseIcon";
|
|
|
8
8
|
import { GRID_COLUMNS, clampWidth } from "../../dashboard-layout.js";
|
|
9
9
|
const ROW_HEIGHT = 4;
|
|
10
10
|
const GAP = 16;
|
|
11
|
+
const COLUMN_STEPS = [
|
|
12
|
+
{ min: 1280, columns: GRID_COLUMNS },
|
|
13
|
+
{ min: 1024, columns: 3 },
|
|
14
|
+
{ min: 672, columns: 2 }
|
|
15
|
+
];
|
|
16
|
+
const GRID_CLASS = "grid-cols-1 @2xl:grid-cols-2 @5xl:grid-cols-3 @7xl:grid-cols-4";
|
|
11
17
|
const SPAN_CLASS = {
|
|
12
18
|
1: "col-span-1",
|
|
13
|
-
2: "col-span-1
|
|
14
|
-
3: "col-span-1
|
|
15
|
-
4: "col-span-1
|
|
19
|
+
2: "col-span-1 @2xl:col-span-2",
|
|
20
|
+
3: "col-span-1 @2xl:col-span-2 @5xl:col-span-3",
|
|
21
|
+
4: "col-span-1 @2xl:col-span-2 @5xl:col-span-3 @7xl:col-span-4"
|
|
16
22
|
};
|
|
17
|
-
|
|
18
|
-
{ query: "(min-width: 80rem)", columns: GRID_COLUMNS },
|
|
19
|
-
{ query: "(min-width: 48rem)", columns: 2 }
|
|
20
|
-
];
|
|
21
|
-
function subscribeColumns(onChange) {
|
|
22
|
-
const lists = QUERIES.map(({ query }) => window.matchMedia(query));
|
|
23
|
-
for (const list of lists) list.addEventListener("change", onChange);
|
|
24
|
-
return () => {
|
|
25
|
-
for (const list of lists) list.removeEventListener("change", onChange);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function readColumns() {
|
|
23
|
+
function columnsFor(width) {
|
|
29
24
|
var _a;
|
|
30
|
-
return ((_a =
|
|
25
|
+
return ((_a = COLUMN_STEPS.find((step) => width >= step.min)) == null ? void 0 : _a.columns) ?? 1;
|
|
31
26
|
}
|
|
32
|
-
function useGridColumns() {
|
|
33
|
-
|
|
27
|
+
function useGridColumns(ref) {
|
|
28
|
+
const [columns, setColumns] = useState(GRID_COLUMNS);
|
|
29
|
+
useLayoutEffect(() => {
|
|
30
|
+
const node = ref.current;
|
|
31
|
+
if (!node) return void 0;
|
|
32
|
+
const update = (width) => setColumns(columnsFor(width));
|
|
33
|
+
update(node.getBoundingClientRect().width);
|
|
34
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
35
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
36
|
+
var _a;
|
|
37
|
+
const box = (_a = entry.contentBoxSize) == null ? void 0 : _a[0];
|
|
38
|
+
update(box ? box.inlineSize : entry.target.getBoundingClientRect().width);
|
|
39
|
+
});
|
|
40
|
+
observer.observe(node);
|
|
41
|
+
return () => observer.disconnect();
|
|
42
|
+
}, [ref]);
|
|
43
|
+
return columns;
|
|
34
44
|
}
|
|
35
45
|
function WidgetError({ reset }) {
|
|
36
46
|
return /* @__PURE__ */ jsxs("div", { role: "alert", className: "bg-surface border border-line rounded-card p-5 flex flex-col items-start gap-3", children: [
|
|
@@ -153,7 +163,8 @@ const move = (items, from, to) => {
|
|
|
153
163
|
return next;
|
|
154
164
|
};
|
|
155
165
|
function DashboardGrid({ items, widgets, stats, loading, editing, onChange }) {
|
|
156
|
-
const
|
|
166
|
+
const containerRef = useRef(null);
|
|
167
|
+
const columns = useGridColumns(containerRef);
|
|
157
168
|
const gridRef = useRef(null);
|
|
158
169
|
const instructionsId = useId();
|
|
159
170
|
const [measured, setMeasured] = useState(false);
|
|
@@ -324,11 +335,11 @@ function DashboardGrid({ items, widgets, stats, loading, editing, onChange }) {
|
|
|
324
335
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
325
336
|
editing && /* @__PURE__ */ jsx("p", { id: instructionsId, className: "sr-only", children: "Glisser la poign\xE9e pour d\xE9placer le widget. Au clavier, les fl\xE8ches le d\xE9placent et Maj avec les fl\xE8ches gauche et droite change sa largeur." }),
|
|
326
337
|
/* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "sr-only", children: editing ? announcement : "" }),
|
|
327
|
-
/* @__PURE__ */ jsx(
|
|
338
|
+
/* @__PURE__ */ jsx("div", { ref: containerRef, className: "@container", children: /* @__PURE__ */ jsx(
|
|
328
339
|
"div",
|
|
329
340
|
{
|
|
330
341
|
ref: gridRef,
|
|
331
|
-
className: `grid
|
|
342
|
+
className: `grid ${GRID_CLASS} grid-flow-row-dense gap-x-4 ${editing ? "pt-1" : ""}`,
|
|
332
343
|
style: measured ? { gridAutoRows: `${ROW_HEIGHT}px`, rowGap: 0 } : { rowGap: GAP },
|
|
333
344
|
children: items.map((item) => {
|
|
334
345
|
const widget = widgets.get(item.id);
|
|
@@ -350,7 +361,7 @@ function DashboardGrid({ items, widgets, stats, loading, editing, onChange }) {
|
|
|
350
361
|
);
|
|
351
362
|
})
|
|
352
363
|
}
|
|
353
|
-
),
|
|
364
|
+
) }),
|
|
354
365
|
ghost && dragId && /* @__PURE__ */ jsx(
|
|
355
366
|
"div",
|
|
356
367
|
{
|
package/package.json
CHANGED
package/supported.json
CHANGED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Installation
|
|
3
|
-
description: Installer @fraza-pro/module-drive, créer les tables et régler la taille des tranches d'envoi selon le proxy.
|
|
4
|
-
related:
|
|
5
|
-
title: Étapes suivantes
|
|
6
|
-
links:
|
|
7
|
-
- 06-modules/drive/configuration
|
|
8
|
-
- 06-modules/drive/partages
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
Cette page couvre l'installation de `@fraza-pro/module-drive` dans un projet déjà structuré par `@fraza/start`. Le module n'est jamais déclaré à la main : il est découvert au boot par scan des dépendances, comme décrit dans [Cycle de vie d'un module](../../02-guides/cycle-de-vie-d-un-module.md).
|
|
12
|
-
|
|
13
|
-
Ce module est distribué sous la licence Fraza Pro : son utilisation en production demande une licence par projet, renouvelée chaque année, qui comprend les mises à jour, la conformité et le support. Voir [Licence et propriété](../../04-architecture/07-licence-et-propriete.md).
|
|
14
|
-
|
|
15
|
-
## Prérequis
|
|
16
|
-
|
|
17
|
-
- Un projet généré par `npx @fraza/start`, avec `@fraza/core` en version `0.1.14` ou plus, la première qui reconnaît la portée `@fraza-pro`.
|
|
18
|
-
- La ligne `@fraza-pro:registry=https://registry.fraza.ca/` et le token du registre dans le `.npmrc` du projet, sans lesquels `npm i` échoue. `npx @fraza/start` écrit déjà la ligne de portée. Le token s'obtient avec `npm login --registry=https://registry.fraza.ca/`, puis `npx fraza-key` le reprend dans le projet. Voir [`fraza-key`](../../03-reference/05-cli/fraza-key.md).
|
|
19
|
-
- Un **stockage objet compatible S3** configuré, Backblaze B2 ou Cloudflare R2. Sans lui, le module démarre mais aucun dépôt n'aboutit. Voir [Stocker des fichiers](../../02-guides/stocker-des-fichiers.md).
|
|
20
|
-
- Un **PostgreSQL compilé avec ICU**, pour le tri naturel des noms. C'est le cas des images Docker officielles, et de la compilation par défaut depuis la version 16. Sans ICU, la migration du module s'arrête avec un message qui le dit.
|
|
21
|
-
- `sharp`, dépendance de pair facultative du core, installé si l'on veut les miniatures d'images : sans elle, le module fonctionne à l'identique, sans vignettes. Le module n'a plus aucune dépendance de production : l'archive ZIP et les miniatures passent par le core.
|
|
22
|
-
|
|
23
|
-
## Installer
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm i @fraza-pro/module-drive
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Ajouter la variable d'activation à `.env.local`, et aux variables de la plateforme en production :
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
FRAZA_MODULE_DRIVE=true
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Créez les tables :
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx fraza-db init
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Puis redémarrez. L'entrée « Fichiers » apparaît dans la barre latérale de l'admin.
|
|
42
|
-
|
|
43
|
-
## Mettre à jour
|
|
44
|
-
|
|
45
|
-
Le schéma évolue par migrations versionnées. Après chaque mise à jour du paquet :
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npx fraza-db migrate
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Lancez-la avant de servir la nouvelle version. Le code s'appuie sur le schéma migré : sans la collation de tri, par exemple, les listes de fichiers échouent.
|
|
52
|
-
|
|
53
|
-
## Aucune configuration du seau
|
|
54
|
-
|
|
55
|
-
Il n'y a **aucune étape d'infrastructure**. Pas de règle CORS, pas de policy de seau, pas d'URL signée à faire circuler : tous les fichiers transitent par l'application, dans les deux sens, et le navigateur ne parle jamais au stockage.
|
|
56
|
-
|
|
57
|
-
## Derrière un proxy
|
|
58
|
-
|
|
59
|
-
Un proxy plafonne le corps d'une requête. Cloudflare l'arrête à 100 Mo sur le forfait gratuit, et refuse la requête avant qu'elle n'atteigne l'application.
|
|
60
|
-
|
|
61
|
-
C'est pourquoi le navigateur découpe les fichiers : chaque tranche part dans sa propre requête, sous le plafond, et le serveur les réassemble dans le seau. Une tranche vaut 8 Mo par défaut, ce qui passe partout.
|
|
62
|
-
|
|
63
|
-
Si votre proxy plafonne plus bas, alignez `FRAZA_MODULE_DRIVE_UPLOAD_CHUNK_MB` sur cette limite. Le minimum est 5, imposé par le stockage, donc un proxy qui plafonne sous 5 Mo empêche tout envoi de fichier volumineux.
|
|
64
|
-
|
|
65
|
-
Le symptôme d'une valeur trop haute est net : les tranches partent puis échouent avec le code d'erreur du proxy, 413 chez la plupart.
|
|
66
|
-
|
|
67
|
-
## Rien à câbler dans le projet
|
|
68
|
-
|
|
69
|
-
Contrairement à `@fraza/module-medias`, ce module n'a **aucun fichier de route à monter**. Les binaires descendent par les routes `/za/api/drive/...`, qui existent déjà, et la page publique de partage passe par la sous-entrée `./public-page`, prise en charge par `npx fraza-modules sync`.
|
|
File without changes
|