@solidpepper/solidpepper-soliddesigner 0.1.8

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/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # SolidDesigner
2
+
3
+ Bienvenue dans le projet **SolidDesigner**, un éditeur SVG basé sur Angular et exposé sous forme de Web Component.
4
+
5
+ ## Démarrer l'application
6
+
7
+ Pour lancer l'application en mode développement (sur votre machine locale), vous pouvez utiliser la commande suivante :
8
+
9
+ ```shell
10
+ npm run start
11
+ ```
12
+
13
+ _(Cette commande exécute en arrière-plan `ng serve`)_
14
+
15
+ Une fois le serveur démarré, ouvrez votre navigateur et accédez à l'adresse suivante : [http://localhost:4200/](http://localhost:4200/)
16
+ Le projet se rechargera automatiquement à chaque modification d'un fichier source.
17
+
18
+ ## Publier l'application sur npm
19
+
20
+ Le projet a pour vocation d'être packagé et réutilisable. Pour préparer une version et la publier, suivez ces étapes :
21
+
22
+ 1. **Mettre à jour la version** :
23
+ Dans le fichier `package.json`, mettez à jour le numéro de `"version": "x.y.z"`.
24
+
25
+ 2. **Builder le projet** :
26
+ Compilez l'application Angular pour la production.
27
+
28
+ ```shell
29
+ npm run build
30
+ ng build --configuration production
31
+ ```
32
+
33
+ _Les fichiers compilés se placeront dans le dossier `dist/soliddesigner/browser/` (qui est ciblé par le champ "files" et "main" du `package.json`)._
34
+
35
+ 3. **Générer un paquet local (Test)** :
36
+ Si vous souhaitez tester l'installation localement (cela génère un fichier `.tgz` comme on le voit dans le projet) :
37
+
38
+ ```shell
39
+ npm pack
40
+ ```
41
+
42
+ 4. **Publier sur npm** :
43
+ Pour créer un token de bypass dans https://www.npmjs.com/settings/solidpepper/tokens, créer un nouveau token avec le bypass A2F activé et les autorisations necessaires sur le projet soliddesigner
44
+ Dans le fichier `.npmrc` (à la racine du projet), ajoutez le token npm : `//registry.npmjs.org/:_authToken=LE_TOKEN_ICI` pour bypass l'A2F
45
+
46
+ ```shell
47
+ npm publish
48
+ ```
49
+
50
+ ## Architecture et utilité des dossiers/fichiers
51
+
52
+ Voici un guide pour vous repérer facilement dans le projet et comprendre la structure des dossiers et fichiers principaux :
53
+
54
+ ### Code source : `/src`
55
+
56
+ Contient tout le code de l'application.
57
+
58
+ - **`/src/index.html`** : Point d'entrée HTML principal qui charge l'application.
59
+ - **`/src/main.ts`** : Fichier principal qui initialise l'application Angular.
60
+ - **`/src/styles/`** (`styles.scss`) : Fichiers de styles CSS/SCSS globaux et variables CSS mutualisées.
61
+
62
+ ### Cœur de l'application : `/src/app/`
63
+
64
+ - **`/app/components/`** : L'interface utilisateur de ce composant de création graphique.
65
+ - **`widgets/`** : Les éléments principaux d'interaction : `canvas-area` (zone de dessin SVG), `properties-panel` (le panneau d'inspection à droite), `global-panel` (la barre d'outils), `menus`, `rulers` (les règles de guidage) ou encore `overlays`.
66
+ - **`modals/`** : Fenêtres d'édition nécessitant une interuption majeure du flux utilisateur (ex: `edit-table-modal` pour configurer le tableau, `dynamic-attributes-modal`).
67
+ - **`popups/`** : Menus contextuels, flottants, et sélecteurs : `color-picker`, `attributes-list-popup` (liste de variables/composants), `table-size-popup`.
68
+ - **`shared/`** : Composants réutilisables d'UI.
69
+
70
+ - **`/app/engine/`** : La logique métier complexe ("Le Moteur"). Il s'occupe de gérer le SVG de façon isolée de l'interface visuelle.
71
+ - **`core/`** : Les fondations de l'outil et de la persistance : `canvas.service.ts` (initialisation de la grille de création), `history.service.ts` (pile de Undo/Redo), `save.service.ts` & `open.service.ts` (logique d'export/d'import).
72
+ - **`features/`** : Différentes "briques" modulaires manipulant le rendu SVG : gestion des transformations (`transform/`), édition de styles complexes (`style/`), gestion des calques/éléments (`layers/`, `elements/`), et identification des variables (`variables/`).
73
+ - **`state/`** : Les données vivantes en mémoire de l'utilisateur. Par exemple `selection.store.ts` (quoi cibler actuellement pour modification) et `clipboard.service.ts`.
74
+ - **`tools/`** : Le code de chaque "outil" de création. Guidés par le `tool-manager.service.ts`, chaque outil hérite de `abstract-tool.ts` et encapsule sa logique d'évènements (tracé de rectangles, sélection, outil texte, etc.).
75
+ - **`api/`** : Point d'accès aux services distants.
76
+
77
+ - **`/app/services/`** : Services non liés directement à l'édition d'image (ouverture d'une modale via `modal.service.ts`, gestion des thèmes ou langages via `translation.service.ts`).
78
+
79
+ - **`/app/utils/`** : Des algorithmes purs ou librairies de fonctions sans injections :
80
+ - `svg-dom.ts` : Fonctions pour interagir avec le shadow-root et cibler le SVG.
81
+ - `math-geometry.ts` : Calculs de collision, d'angles.
82
+ - `svg-migration.ts` : Maintien de versions pour assurer la rétrocompatibilité des SVG générés précédemment.
83
+
84
+ - **`app.component.*`** : Composant de base. Représente l'enveloppe extérieure de l'application (en tant que Web Component). Il insère la logique générale et injecte les contextes majeurs au moment du rendu.
85
+
86
+ ## Autres choses à retenir
87
+
88
+ - **L'encapsulation Shadow DOM** : Le projet a été adapté pour utiliser le Shadow DOM et isoler ses composants visuels. Prenez garde à utiliser les utilitaires adaptés qui parcourent ce Shadow DOM lorsque vous essayez de cibler des éléments (attention aux erreurs de ciblage avec `document.querySelector` par exemple). De plus, les styles présents dans style.scss s'appliquent aussi à l'application qui utilisera le composant web
@@ -0,0 +1,166 @@
1
+ import { S as SolidLog } from './solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-7V9C3Otl.mjs';
2
+
3
+ class ImageUtils {
4
+ /**
5
+ * Compresses an image file and returns a Base64 string (DataURL)
6
+ * Resizes the image to a maximum dimension while maintaining aspect ratio
7
+ * @param file The image file to compress
8
+ * @param maxWidth Maximum width of the compressed image
9
+ * @param maxHeight Maximum height of the compressed image
10
+ * @param quality Compression quality (0 to 1)
11
+ */
12
+ static async compressImage(source, maxWidth = 800, maxHeight = 800, quality = 0.7) {
13
+ SolidLog.info('[ImageUtils] Starting compression for:', typeof source === 'string'
14
+ ? source.substring(0, 100)
15
+ : source.name || 'Blob');
16
+ try {
17
+ let imageBlob = source;
18
+ // 1. Fetch if it's a URL
19
+ if (typeof source === 'string' && !source.startsWith('data:')) {
20
+ SolidLog.info('[ImageUtils] Fetching remote image...');
21
+ const response = await fetch(source);
22
+ if (!response.ok) {
23
+ throw new Error(`HTTP error! status: ${response.status}`);
24
+ }
25
+ imageBlob = await response.blob();
26
+ SolidLog.info('[ImageUtils] Fetch successful, got blob of size:', imageBlob.size);
27
+ }
28
+ // 2. Load into Image
29
+ return new Promise((resolve, reject) => {
30
+ SolidLog.info('[ImageUtils] Loading into Image object...');
31
+ const img = new Image();
32
+ let objectUrl = null;
33
+ img.onload = () => {
34
+ SolidLog.info('[ImageUtils] Image loaded. Natural size:', img.naturalWidth, 'x', img.naturalHeight);
35
+ try {
36
+ const canvas = document.createElement('canvas');
37
+ let width = img.width;
38
+ let height = img.height;
39
+ if (width > height) {
40
+ if (width > maxWidth) {
41
+ height = Math.round((height * maxWidth) / width);
42
+ width = maxWidth;
43
+ }
44
+ }
45
+ else {
46
+ if (height > maxHeight) {
47
+ width = Math.round((width * maxHeight) / height);
48
+ height = maxHeight;
49
+ }
50
+ }
51
+ canvas.width = width;
52
+ canvas.height = height;
53
+ SolidLog.info('[ImageUtils] Target canvas size:', width, 'x', height);
54
+ const ctx = canvas.getContext('2d');
55
+ if (!ctx) {
56
+ throw new Error('Could not get canvas context');
57
+ }
58
+ ctx.drawImage(img, 0, 0, width, height);
59
+ SolidLog.info('[ImageUtils] Exporting to DataURL (Webp)...');
60
+ const compressedDataUrl = canvas.toDataURL('image/webp', quality);
61
+ SolidLog.info('[ImageUtils] Compression complete. Final Base64 length:', compressedDataUrl.length);
62
+ if (objectUrl)
63
+ URL.revokeObjectURL(objectUrl);
64
+ resolve(compressedDataUrl);
65
+ }
66
+ catch (e) {
67
+ SolidLog.error('[ImageUtils] Error during canvas processing:', e);
68
+ if (objectUrl)
69
+ URL.revokeObjectURL(objectUrl);
70
+ reject(new Error(`Compression failed: ${e instanceof Error ? e.message : 'Unknown'}`));
71
+ }
72
+ };
73
+ img.onerror = (err) => {
74
+ SolidLog.error('[ImageUtils] Image load error:', err);
75
+ if (objectUrl)
76
+ URL.revokeObjectURL(objectUrl);
77
+ const name = typeof source === 'string'
78
+ ? source.length > 50
79
+ ? source.substring(0, 50) + '...'
80
+ : source
81
+ : 'File';
82
+ reject(new Error(`Failed to load image: ${name}`));
83
+ };
84
+ if (typeof imageBlob === 'string') {
85
+ img.src = imageBlob;
86
+ }
87
+ else {
88
+ objectUrl = URL.createObjectURL(imageBlob);
89
+ img.src = objectUrl;
90
+ }
91
+ });
92
+ }
93
+ catch (error) {
94
+ SolidLog.error('[ImageUtils] Critical error in compressImage:', error);
95
+ throw new Error(`Failed to import image: ${error instanceof Error ? error.message : 'Network error'}`);
96
+ }
97
+ }
98
+ /**
99
+ * Iteratively compresses an image until it's under the target size (if possible)
100
+ * @param source The source image (File, Blob or URL)
101
+ * @param maxKb Target size in Kilobytes
102
+ */
103
+ static async compressUntilSize(source, maxKb = 100) {
104
+ const targetBytes = maxKb * 1024;
105
+ const resolutions = [1000, 800, 600, 400];
106
+ const qualities = [0.8, 0.6, 0.4, 0.2];
107
+ let lastResult = '';
108
+ for (const res of resolutions) {
109
+ for (const qual of qualities) {
110
+ SolidLog.info(`[ImageUtils] Attempting compression: ${res}px, quality ${qual}`);
111
+ const result = await this.compressImage(source, res, res, qual);
112
+ // Estimate size from Base64 string (roughly 3/4 of string length)
113
+ const estimatedBytes = (result.length - (result.indexOf(',') + 1)) * 0.75;
114
+ SolidLog.info(`[ImageUtils] Result size: ${Math.round(estimatedBytes / 1024)}kb`);
115
+ lastResult = result;
116
+ if (estimatedBytes <= targetBytes) {
117
+ SolidLog.info(`[ImageUtils] Target reached: ${Math.round(estimatedBytes / 1024)}kb`);
118
+ return result;
119
+ }
120
+ }
121
+ }
122
+ SolidLog.warn(`[ImageUtils] Could not reach target ${maxKb}kb. Returning smallest result found.`);
123
+ return lastResult;
124
+ }
125
+ /**
126
+ * Converts a source (URL, Blob, or File) to a Base64 string without any compression.
127
+ * @param source The image source to convert
128
+ */
129
+ static async toBase64(source) {
130
+ SolidLog.info('[ImageUtils] Converting to Base64 (no compression) for:', typeof source === 'string'
131
+ ? source.substring(0, 100)
132
+ : source.name || 'Blob');
133
+ try {
134
+ let blob;
135
+ if (typeof source === 'string') {
136
+ if (source.startsWith('data:')) {
137
+ return source;
138
+ }
139
+ const response = await fetch(source);
140
+ if (!response.ok) {
141
+ throw new Error(`HTTP error! status: ${response.status}`);
142
+ }
143
+ blob = await response.blob();
144
+ }
145
+ else {
146
+ blob = source;
147
+ }
148
+ return new Promise((resolve, reject) => {
149
+ const reader = new FileReader();
150
+ reader.onloadend = () => resolve(reader.result);
151
+ reader.onerror = (err) => {
152
+ SolidLog.error('[ImageUtils] FileReader error:', err);
153
+ reject(new Error('Failed to read image as DataURL'));
154
+ };
155
+ reader.readAsDataURL(blob);
156
+ });
157
+ }
158
+ catch (error) {
159
+ SolidLog.error('[ImageUtils] Critical error in toBase64:', error);
160
+ throw error;
161
+ }
162
+ }
163
+ }
164
+
165
+ export { ImageUtils };
166
+ //# sourceMappingURL=solidpepper-solidpepper-soliddesigner-image-utils-ClRmExmV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solidpepper-solidpepper-soliddesigner-image-utils-ClRmExmV.mjs","sources":["../../../projects/solidpepper-soliddesigner/src/app/utils/image-utils.ts"],"sourcesContent":["import { SolidLog } from './solid-log';\r\n\r\nexport class ImageUtils {\r\n /**\r\n * Compresses an image file and returns a Base64 string (DataURL)\r\n * Resizes the image to a maximum dimension while maintaining aspect ratio\r\n * @param file The image file to compress\r\n * @param maxWidth Maximum width of the compressed image\r\n * @param maxHeight Maximum height of the compressed image\r\n * @param quality Compression quality (0 to 1)\r\n */\r\n static async compressImage(\r\n source: File | Blob | string,\r\n maxWidth: number = 800,\r\n maxHeight: number = 800,\r\n quality: number = 0.7,\r\n ): Promise<string> {\r\n SolidLog.info(\r\n '[ImageUtils] Starting compression for:',\r\n typeof source === 'string'\r\n ? source.substring(0, 100)\r\n : (source as any).name || 'Blob',\r\n );\r\n try {\r\n let imageBlob: Blob | File | string = source;\r\n\r\n // 1. Fetch if it's a URL\r\n if (typeof source === 'string' && !source.startsWith('data:')) {\r\n SolidLog.info('[ImageUtils] Fetching remote image...');\r\n const response = await fetch(source);\r\n if (!response.ok) {\r\n throw new Error(`HTTP error! status: ${response.status}`);\r\n }\r\n imageBlob = await response.blob();\r\n SolidLog.info(\r\n '[ImageUtils] Fetch successful, got blob of size:',\r\n imageBlob.size,\r\n );\r\n }\r\n\r\n // 2. Load into Image\r\n return new Promise((resolve, reject) => {\r\n SolidLog.info('[ImageUtils] Loading into Image object...');\r\n const img = new Image();\r\n let objectUrl: string | null = null;\r\n\r\n img.onload = () => {\r\n SolidLog.info(\r\n '[ImageUtils] Image loaded. Natural size:',\r\n img.naturalWidth,\r\n 'x',\r\n img.naturalHeight,\r\n );\r\n try {\r\n const canvas = document.createElement('canvas');\r\n let width = img.width;\r\n let height = img.height;\r\n\r\n if (width > height) {\r\n if (width > maxWidth) {\r\n height = Math.round((height * maxWidth) / width);\r\n width = maxWidth;\r\n }\r\n } else {\r\n if (height > maxHeight) {\r\n width = Math.round((width * maxHeight) / height);\r\n height = maxHeight;\r\n }\r\n }\r\n\r\n canvas.width = width;\r\n canvas.height = height;\r\n SolidLog.info(\r\n '[ImageUtils] Target canvas size:',\r\n width,\r\n 'x',\r\n height,\r\n );\r\n\r\n const ctx = canvas.getContext('2d');\r\n if (!ctx) {\r\n throw new Error('Could not get canvas context');\r\n }\r\n\r\n ctx.drawImage(img, 0, 0, width, height);\r\n\r\n SolidLog.info('[ImageUtils] Exporting to DataURL (Webp)...');\r\n const compressedDataUrl = canvas.toDataURL('image/webp', quality);\r\n SolidLog.info(\r\n '[ImageUtils] Compression complete. Final Base64 length:',\r\n compressedDataUrl.length,\r\n );\r\n\r\n if (objectUrl) URL.revokeObjectURL(objectUrl);\r\n resolve(compressedDataUrl);\r\n } catch (e) {\r\n SolidLog.error('[ImageUtils] Error during canvas processing:', e);\r\n if (objectUrl) URL.revokeObjectURL(objectUrl);\r\n reject(\r\n new Error(\r\n `Compression failed: ${e instanceof Error ? e.message : 'Unknown'}`,\r\n ),\r\n );\r\n }\r\n };\r\n\r\n img.onerror = (err) => {\r\n SolidLog.error('[ImageUtils] Image load error:', err);\r\n if (objectUrl) URL.revokeObjectURL(objectUrl);\r\n const name =\r\n typeof source === 'string'\r\n ? source.length > 50\r\n ? source.substring(0, 50) + '...'\r\n : source\r\n : 'File';\r\n reject(new Error(`Failed to load image: ${name}`));\r\n };\r\n\r\n if (typeof imageBlob === 'string') {\r\n img.src = imageBlob;\r\n } else {\r\n objectUrl = URL.createObjectURL(imageBlob);\r\n img.src = objectUrl;\r\n }\r\n });\r\n } catch (error) {\r\n SolidLog.error('[ImageUtils] Critical error in compressImage:', error);\r\n throw new Error(\r\n `Failed to import image: ${error instanceof Error ? error.message : 'Network error'}`,\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Iteratively compresses an image until it's under the target size (if possible)\r\n * @param source The source image (File, Blob or URL)\r\n * @param maxKb Target size in Kilobytes\r\n */\r\n static async compressUntilSize(\r\n source: File | Blob | string,\r\n maxKb: number = 100,\r\n ): Promise<string> {\r\n const targetBytes = maxKb * 1024;\r\n const resolutions = [1000, 800, 600, 400];\r\n const qualities = [0.8, 0.6, 0.4, 0.2];\r\n\r\n let lastResult = '';\r\n\r\n for (const res of resolutions) {\r\n for (const qual of qualities) {\r\n SolidLog.info(\r\n `[ImageUtils] Attempting compression: ${res}px, quality ${qual}`,\r\n );\r\n const result = await this.compressImage(source, res, res, qual);\r\n\r\n // Estimate size from Base64 string (roughly 3/4 of string length)\r\n const estimatedBytes =\r\n (result.length - (result.indexOf(',') + 1)) * 0.75;\r\n SolidLog.info(\r\n `[ImageUtils] Result size: ${Math.round(estimatedBytes / 1024)}kb`,\r\n );\r\n\r\n lastResult = result;\r\n\r\n if (estimatedBytes <= targetBytes) {\r\n SolidLog.info(\r\n `[ImageUtils] Target reached: ${Math.round(estimatedBytes / 1024)}kb`,\r\n );\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n SolidLog.warn(\r\n `[ImageUtils] Could not reach target ${maxKb}kb. Returning smallest result found.`,\r\n );\r\n return lastResult;\r\n }\r\n\r\n /**\r\n * Converts a source (URL, Blob, or File) to a Base64 string without any compression.\r\n * @param source The image source to convert\r\n */\r\n static async toBase64(source: File | Blob | string): Promise<string> {\r\n SolidLog.info(\r\n '[ImageUtils] Converting to Base64 (no compression) for:',\r\n typeof source === 'string'\r\n ? source.substring(0, 100)\r\n : (source as any).name || 'Blob',\r\n );\r\n\r\n try {\r\n let blob: Blob | File;\r\n\r\n if (typeof source === 'string') {\r\n if (source.startsWith('data:')) {\r\n return source;\r\n }\r\n const response = await fetch(source);\r\n if (!response.ok) {\r\n throw new Error(`HTTP error! status: ${response.status}`);\r\n }\r\n blob = await response.blob();\r\n } else {\r\n blob = source;\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.onloadend = () => resolve(reader.result as string);\r\n reader.onerror = (err) => {\r\n SolidLog.error('[ImageUtils] FileReader error:', err);\r\n reject(new Error('Failed to read image as DataURL'));\r\n };\r\n reader.readAsDataURL(blob);\r\n });\r\n } catch (error) {\r\n SolidLog.error('[ImageUtils] Critical error in toBase64:', error);\r\n throw error;\r\n }\r\n }\r\n}\r\n"],"names":[],"mappings":";;MAEa,UAAU,CAAA;AACrB;;;;;;;AAOG;AACH,IAAA,aAAa,aAAa,CACxB,MAA4B,EAC5B,QAAA,GAAmB,GAAG,EACtB,SAAA,GAAoB,GAAG,EACvB,UAAkB,GAAG,EAAA;QAErB,QAAQ,CAAC,IAAI,CACX,wCAAwC,EACxC,OAAO,MAAM,KAAK;cACd,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG;AACzB,cAAG,MAAc,CAAC,IAAI,IAAI,MAAM,CACnC;AACD,QAAA,IAAI;YACF,IAAI,SAAS,GAAyB,MAAM;;AAG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