@massimo-cassandro/minimo 1.41.4 → 1.41.5

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 (131) hide show
  1. package/README.md +12 -12
  2. package/charts/src/node-helpers/create-svg-canvas-node.mjs +2 -2
  3. package/charts/src/node-helpers/svg-text-to-path.js +9 -9
  4. package/charts/src/rating-display/index.js +1 -1
  5. package/charts/src/rating-display/ratindDisplayAnimation.js +3 -3
  6. package/design-tokens/README.md +2 -2
  7. package/design-tokens/_src/_readme.md +26 -26
  8. package/dev-tools/README.md +16 -16
  9. package/dev-tools/create-favicons/README.md +31 -31
  10. package/dev-tools/create-favicons/src/create-ico.mjs +2 -2
  11. package/dev-tools/create-favicons/src/default-params.mjs +1 -1
  12. package/dev-tools/create-favicons/src/init.mjs +1 -1
  13. package/dev-tools/design-tokens-builder/README.md +102 -102
  14. package/dev-tools/design-tokens-builder/build-tokens-src/build-source-modes.mjs +85 -73
  15. package/dev-tools/design-tokens-builder/build-tokens-src/config.mjs +109 -85
  16. package/dev-tools/design-tokens-builder/build-tokens-src/formats/css.mjs +113 -90
  17. package/dev-tools/design-tokens-builder/build-tokens-src/formats/json.mjs +107 -95
  18. package/dev-tools/design-tokens-builder/build-tokens-src/legacy-tokens-parser.mjs +71 -64
  19. package/dev-tools/design-tokens-builder/build-tokens-src/light-dark.mjs +75 -65
  20. package/dev-tools/design-tokens-builder/build-tokens-src/merge-css.mjs +113 -102
  21. package/dev-tools/design-tokens-builder/build-tokens-src/platforms.mjs +36 -30
  22. package/dev-tools/design-tokens-builder/build-tokens-src/resolve-source-paths.mjs +15 -13
  23. package/dev-tools/design-tokens-builder/build-tokens-src/source-prefixes.mjs +44 -42
  24. package/dev-tools/design-tokens-builder/build-tokens-src/source-transforms.mjs +89 -83
  25. package/dev-tools/design-tokens-builder/build-tokens-src/token-rename-parser.mjs +99 -86
  26. package/dev-tools/design-tokens-builder/build-tokens-src/transforms.mjs +64 -48
  27. package/dev-tools/design-tokens-builder/build-tokens.mjs +80 -68
  28. package/dev-tools/design-tokens-builder/check-unresolved-custom-props.mjs +103 -77
  29. package/dev-tools/design-tokens-builder/tokens-config-sample.mjs +275 -238
  30. package/dev-tools/find-orphan-css-classes/find-orphan-css-classes.mjs +2 -2
  31. package/dev-tools/starter-kit/source_files/app/CLAUDE.md +4 -2
  32. package/dev-tools/starter-kit/source_files/app/{css/index.css → index.css} +2 -2
  33. package/dev-tools/starter-kit/source_files/app/index.js +1 -1
  34. package/dev-tools/starter-kit/source_files/root/_sf/controller/ImgViewerController.php +3 -3
  35. package/dev-tools/starter-kit/source_files/root/_sf/controller/ViewerController.php +2 -2
  36. package/dev-tools/starter-kit/source_files/root/stylelint.config.mjs +1 -1
  37. package/dev-tools/starter-kit/source_files/root/webpack-config-modules/css-rules.mjs +1 -1
  38. package/dev-tools/stylelint-config/README.md +7 -7
  39. package/dev-tools/svg-icons-tools/README.md +32 -32
  40. package/dev-tools/svg-icons-tools/src/config-manager.mjs +1 -1
  41. package/dev-tools/svg-icons-tools/src/default-config.mjs +118 -118
  42. package/dev-tools/svg-icons-tools/src/jsx-icon-file-builder.mjs +24 -24
  43. package/dev-tools/svg-icons-tools/src/parse-svg-filename.mjs +3 -3
  44. package/dev-tools/svg-icons-tools/src/parse-svg-files.mjs +1 -1
  45. package/dev-tools/svg-icons-tools/src/parse-svg-markup.mjs +4 -4
  46. package/dev-tools/svg-icons-tools/src/svg-to-jsx.mjs +2 -2
  47. package/dev-tools/svg-icons-tools/src/svg-to-optimized.mjs +2 -2
  48. package/dev-tools/svg-icons-tools/src/svg-to-symbols.mjs +2 -2
  49. package/dev-tools/upd@m/README.md +1 -1
  50. package/dev-tools/upd@m/index.mjs +1 -1
  51. package/dev-tools/update-version/README.md +9 -9
  52. package/package.json +1 -1
  53. package/snippets/unsplash-browser-app/README.md +1 -1
  54. package/snippets/unsplash-browser-app/unsplash-utilities.js +9 -9
  55. package/src/components/autocomplete/README.md +3 -3
  56. package/src/components/autocomplete/autocomplete-engine.js +75 -63
  57. package/src/components/autocomplete/check-autocomplete.js +3 -3
  58. package/src/components/dismiss-alerts.js +3 -3
  59. package/src/components/form-reset-submit.js +6 -6
  60. package/src/components/inner-nav/inner-nav.js +2 -2
  61. package/src/components/modal-alert/modal-alert.js +67 -65
  62. package/src/components/modal-alert/modal-alert.minimo.tokens.mjs +1 -1
  63. package/src/components/modal-popup/modal-popup.js +56 -56
  64. package/src/components/overlay/overlay.js +3 -3
  65. package/src/components/sf-macro/readme.md +1 -1
  66. package/src/components/sf-macro/sf-macro.js +27 -23
  67. package/src/components/slide-up-down-toggle/slide-up-down-toggle.js +83 -79
  68. package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +44 -44
  69. package/src/components/snackbar/snackbar.js +19 -19
  70. package/src/components/spinner/spinner.js +3 -3
  71. package/src/components/unsplash-page/README.md +8 -8
  72. package/src/components/unsplash-page/fetch-unsplash-data.js +3 -3
  73. package/src/components/unsplash-page/unsplash-page.js +33 -33
  74. package/src/components/unsplash-page/unsplash-page.module.css +1 -1
  75. package/src/css/alerts.css +2 -2
  76. package/src/css/forms/forms.css +4 -4
  77. package/src/css/forms/validation.css +1 -1
  78. package/src/css/margin-padding-media.css +4 -4
  79. package/src/css/margin-padding.css +4 -4
  80. package/src/css/reset.css +11 -11
  81. package/src/icons/read-me.md +1 -1
  82. package/src/minimo.css +3 -3
  83. package/src/utilities/better-text-with-places.js +22 -22
  84. package/src/utilities/better-text.js +42 -35
  85. package/src/utilities/classnames.js +8 -8
  86. package/src/utilities/cookies.js +6 -6
  87. package/src/utilities/create-id.js +3 -3
  88. package/src/utilities/disable-btns-on-submit.js +2 -2
  89. package/src/utilities/dom-builder/dom-builder.js +89 -86
  90. package/src/utilities/dom-builder/domBuilderBasicSetup.js +9 -9
  91. package/src/utilities/dom-builder/parseDomString.js +23 -23
  92. package/src/utilities/dom-builder-helpers/README.md +2 -2
  93. package/src/utilities/dom-builder-helpers/form-tags.js +100 -100
  94. package/src/utilities/dom-builder-helpers/picture-tag.js +39 -39
  95. package/src/utilities/enable-submit-btns.js +1 -1
  96. package/src/utilities/escape-html.js +2 -2
  97. package/src/utilities/generate-pwd.js +4 -4
  98. package/src/utilities/linked-dates.js +13 -13
  99. package/src/utilities/parse-file-size.js +6 -6
  100. package/src/utilities/random-id.js +3 -3
  101. package/src/utilities/relative-date.js +40 -40
  102. package/src/utilities/sentence-case.js +1 -1
  103. package/src/utilities/strip-tags.js +1 -1
  104. package/src/utilities/title-case.js +1 -1
  105. package/src/utilities/truncate-string.js +5 -5
  106. package/src/utilities/validation-error-class.js +12 -12
  107. package/src/web-components/json-table/json-table-component.js +123 -121
  108. package/src/web-components/json-table/json-table-component.module.css +6 -6
  109. package/src/web-components/json-table/json-table.minimo.tokens.mjs +6 -6
  110. package/src/web-components/json-table/readme.md +72 -108
  111. package/src/web-components/json-table/src/cell-content.js +25 -25
  112. package/src/web-components/json-table/src/content-utils.js +21 -21
  113. package/src/web-components/json-table/src/data-types.js +32 -32
  114. package/src/web-components/json-table/src/defaults.js +230 -191
  115. package/src/web-components/json-table/src/get-data.js +55 -38
  116. package/src/web-components/json-table/src/icons.js +17 -17
  117. package/src/web-components/json-table/src/info-section.js +18 -18
  118. package/src/web-components/json-table/src/main-builder.js +45 -45
  119. package/src/web-components/json-table/src/pagination.js +32 -32
  120. package/src/web-components/json-table/src/parse-cols.js +18 -18
  121. package/src/web-components/json-table/src/parse-rows.js +17 -17
  122. package/src/web-components/json-table/src/resolve-params.js +53 -41
  123. package/src/web-components/json-table/src/search.js +13 -13
  124. package/src/web-components/json-table/src/sorting.js +20 -20
  125. package/src/web-components/json-table/src/table-body.js +13 -13
  126. package/src/web-components/json-table/src/table-builder.js +34 -34
  127. package/src/web-components/json-table/src/table-tfoot.js +8 -8
  128. package/src/web-components/json-table/src/table-thead.js +21 -21
  129. package/src/web-components/json-table/src/update-info.js +11 -11
  130. package/types/classes.d.ts +2 -2
  131. package/types/global.d.ts +18 -12
@@ -1,33 +1,33 @@
1
1
  /**
2
- * svg-icons-tools configuration file
2
+ * File di configurazione di svg-icons-tools
3
3
  * ----------------------------
4
- * all paths relative to the work directory
4
+ * tutti i percorsi sono relativi alla directory di lavoro
5
5
  *
6
- * More info at https://github.com/massimo-cassandro/svg-icons-tools
6
+ * Maggiori informazioni su https://github.com/massimo-cassandro/svg-icons-tools
7
7
  *
8
- * run with (from the svg-icons-tools work dir): `npx iconsTools`
9
- * or specifing a path for the config file: `npx iconsTools --config path/to/config.mjs`
8
+ * esecuzione (dalla directory di lavoro di svg-icons-tools): `npx iconsTools`
9
+ * oppure indicando il percorso del file di configurazione: `npx iconsTools --config path/to/config.mjs`
10
10
  *
11
- * All paths in this config object are relative to the folder containing the config file
11
+ * Tutti i percorsi di questo oggetto di configurazione sono relativi alla cartella che contiene il file di configurazione
12
12
  *
13
13
  */
14
14
 
15
15
  const config = {
16
16
 
17
17
  /**
18
- * SVG to JSX components
18
+ * SVG in componenti JSX
19
19
  */
20
20
  jsx: {
21
21
  /**
22
- * Source folders
22
+ * Cartelle sorgente
23
23
  *
24
- * Every file with svg extension in these folders will be processed
25
- * Sub dirs are ignored.
26
- * the `fill` array must contains the icons that use the `fill` attribute
27
- * similarly, the `stroke` one must contains the icons that use the `stroke` attribute
28
- * It is possible to manage both types of icons at the same time, otherwise leave
29
- * them empty or remove the ones you don't need.
30
- * If you don't need this feature, just remove the whole `jsx` object
24
+ * Ogni file con estensione svg presente in queste cartelle viene elaborato.
25
+ * Le sottocartelle vengono ignorate.
26
+ * L'array `fill` deve contenere le icone che usano l'attributo `fill`;
27
+ * analogamente, l'array `stroke` deve contenere le icone che usano l'attributo `stroke`.
28
+ * È possibile gestire entrambi i tipi di icone contemporaneamente; altrimenti lasciare
29
+ * vuoti gli array o rimuovere quelli non necessari.
30
+ * Se non serve questa funzionalità, rimuovere l'intero oggetto `jsx`
31
31
  */
32
32
  source_folders: {
33
33
  fill: [],
@@ -35,105 +35,105 @@ const config = {
35
35
  },
36
36
 
37
37
  /**
38
- * Custom function to create each JSX icon file
38
+ * Funzione personalizzata per creare ogni file JSX di icona
39
39
  *
40
- * If not defined, the default function will be used.
41
- * See `src/jsx-icon-file-builder.mjs` for more details about function argument and values to be returned
40
+ * Se non definita, viene usata la funzione predefinita.
41
+ * Vedi `src/jsx-icon-file-builder.mjs` per maggiori dettagli sull'argomento della funzione e sui valori da restituire
42
42
  *
43
43
  * @example
44
- * custom_icon_builder: (parsed_svg) => { ... your code ... }
44
+ * custom_icon_builder: (parsed_svg) => { ... il tuo codice ... }
45
45
  */
46
46
  custom_icon_builder: null,
47
47
 
48
- /* path to the folder where the jsx components will be saved */
48
+ /* percorso della cartella in cui vengono salvati i componenti jsx */
49
49
  dest_folder: '',
50
50
 
51
51
  /**
52
- * Clear dest_folder folder before save new files
52
+ * Svuota la cartella dest_folder prima di salvare i nuovi file
53
53
  */
54
54
  clearDestFolder: false,
55
55
 
56
56
 
57
57
  /**
58
- * path to jsx icons index file
58
+ * percorso del file indice delle icone jsx
59
59
  *
60
- * Optional file that contains all generated icons as named exports.
61
- * Leave empty o remove if you don't need it
60
+ * File opzionale che contiene tutte le icone generate come named export.
61
+ * Lasciare vuoto o rimuovere se non serve
62
62
  */
63
63
  index_file: '',
64
64
 
65
- /** if not null, overrides the global `svgo_config` */
65
+ /** se non null, sovrascrive `svgo_config` globale */
66
66
  svgo_config: null
67
67
  },
68
68
 
69
69
  /**
70
- * svg file to be optimized
70
+ * file svg da ottimizzare
71
71
  */
72
72
  optimize: {
73
73
  /**
74
- * Source folders
74
+ * Cartelle sorgente
75
75
  *
76
- * See comment at `jsx` for more details
77
- * Leave empty or remove the whole `optimize` obj if you don't need this feature
76
+ * Vedi il commento di `jsx` per maggiori dettagli
77
+ * Lasciare vuoto o rimuovere l'intero oggetto `optimize` se non serve questa funzionalità
78
78
  */
79
79
  source_folders: {
80
80
  fill: [],
81
81
  stroke: []
82
82
  },
83
83
 
84
- /* path to the folder where the optimized files will be saved */
84
+ /* percorso della cartella in cui vengono salvati i file ottimizzati */
85
85
  dest_folder: '',
86
86
 
87
87
  /**
88
- * Clear dest_folder folder before save new files
88
+ * Svuota la cartella dest_folder prima di salvare i nuovi file
89
89
  */
90
90
  clearDestFolder: false,
91
91
 
92
- /** if not null, overrides the global `svgo_config` */
92
+ /** se non null, sovrascrive `svgo_config` globale */
93
93
  svgo_config: null
94
94
  },
95
95
 
96
96
  /**
97
- * SVG as symbols
97
+ * SVG come symbol
98
98
  *
99
- * Parameters to combine many svg files into a single svg file with symbols
100
- * If you don't need this feature, just remove the `symbols` object or leave paths empty
99
+ * Parametri per combinare più file svg in un unico file svg con symbol
100
+ * Se non serve questa funzionalità, rimuovere l'oggetto `symbols` o lasciare vuoti i percorsi
101
101
  */
102
102
  symbols: {
103
103
  /**
104
- * Source folders
104
+ * Cartelle sorgente
105
105
  *
106
- * Every file with svg extension in these folders will be processed
107
- * Sub dirs are ignored.
108
- * Leave empty or remove the whole `symbols` obj if you don't need this feature
106
+ * Ogni file con estensione svg presente in queste cartelle viene elaborato.
107
+ * Le sottocartelle vengono ignorate.
108
+ * Lasciare vuoto o rimuovere l'intero oggetto `symbols` se non serve questa funzionalità
109
109
  *
110
- * NB: stroke and fill icons are handled by adding some classes to the `symbol` tag.
111
- * The same goes for non-square icons.
112
- * Adding classes to the `symbol` tag is useful for styling icons with css,
113
- * but it is not a well documented feature and may not work as expected in all browsers.
114
- * Be aware of this if you plan to use this feature.
110
+ * NB: le icone stroke e fill vengono gestite aggiungendo alcune classi al tag `symbol`.
111
+ * Lo stesso vale per le icone non quadrate.
112
+ * Aggiungere classi al tag `symbol` è utile per stilizzare le icone con css,
113
+ * ma è una funzionalità poco documentata e potrebbe non funzionare come previsto in tutti i browser.
114
+ * Tenerne conto se si intende usarla.
115
115
  */
116
116
  source_folders: {
117
117
  fill: [],
118
118
  stroke: []
119
119
  },
120
120
 
121
- /* path of the processed svg file */
121
+ /* percorso del file svg elaborato */
122
122
  dest_file: '',
123
123
 
124
- /* if true, the xml declaration (`<?xml version...`) is added to the resulting file */
124
+ /* se true, la dichiarazione xml (`<?xml version...`) viene aggiunta al file risultante */
125
125
  add_xml_declaration: true,
126
126
 
127
- /* if true, the svg doctype (`<!DOCTYPE svg PUBLIC...`) is added to the resulting file */
127
+ /* se true, il doctype svg (`<!DOCTYPE svg PUBLIC...`) viene aggiunto al file risultante */
128
128
  add_svg_doctype: false,
129
129
 
130
- /* if true, the `hidden` attribute is added to the svg tag of the resulting file */
130
+ /* se true, l'attributo `hidden` viene aggiunto al tag svg del file risultante */
131
131
  add_hidden_attribute: true,
132
132
 
133
133
  /**
134
- * optional path to the js file that will contain the list of icons converted as symbols.
134
+ * percorso opzionale del file js che conterrà l'elenco delle icone convertite in symbol.
135
135
  *
136
- * Leave empty if you don't need it
136
+ * Lasciare vuoto se non serve
137
137
  *
138
138
  * @example
139
139
  * icons_list_file: './path/to/icons-list.js',
@@ -141,12 +141,12 @@ const config = {
141
141
  icons_list_file: '',
142
142
 
143
143
  /**
144
- * optional template for building the icons demo file
144
+ * template opzionale per creare il file demo delle icone
145
145
  *
146
- * A basic tpl file is provided when the script is launched with `init` option:
147
- * you can customize it as you like.
148
- * If you don't need this feature, remove the tpl file and leave empty or remove
149
- * the `demo_tpl_path` parameter
146
+ * Un file tpl di base viene fornito quando lo script viene lanciato con l'opzione `init`:
147
+ * può essere personalizzato a piacere.
148
+ * Se non serve questa funzionalità, rimuovere il file tpl e lasciare vuoto o rimuovere
149
+ * il parametro `demo_tpl_path`
150
150
  *
151
151
  * @example
152
152
  * demo_tpl_path: './path/to/symbols-demo-tpl.html',
@@ -154,39 +154,39 @@ const config = {
154
154
  demo_tpl_path: '',
155
155
 
156
156
  /**
157
- * optional path for generated demo file
157
+ * percorso opzionale del file demo generato
158
158
  *
159
- * It includes the list of icons converted as symbols and the symbols file itself,
160
- * so it can be viewed in a browser using the `file:///` protocol.
161
- * Requires the `demo_tpl_path` parameter to be set.
162
- * Leave this parameter empty if you don't need it
159
+ * Include l'elenco delle icone convertite in symbol e il file dei symbol stesso,
160
+ * quindi può essere visualizzato in un browser tramite il protocollo `file:///`.
161
+ * Richiede che il parametro `demo_tpl_path` sia impostato.
162
+ * Lasciare vuoto questo parametro se non serve
163
163
  *
164
164
  * @example
165
165
  * demo_file_path: './symbols-demo.html',
166
166
  */
167
167
  demo_file_path: '',
168
168
 
169
- /** if not null, overrides the global `svgo_config` */
169
+ /** se non null, sovrascrive `svgo_config` globale */
170
170
  svgo_config: null
171
171
  },
172
172
 
173
173
 
174
174
  /**
175
- * GLOBAL PARAMETERS
175
+ * PARAMETRI GLOBALI
176
176
  *
177
- * These parameters are used in all the features
177
+ * Questi parametri sono usati da tutte le funzionalità
178
178
  */
179
179
 
180
180
  /*
181
- * prefixes of the svg files names to be removed in `symbols` ids and in jsx and
182
- * optimized files names
181
+ * prefissi dei nomi dei file svg da rimuovere negli id dei `symbols` e nei nomi
182
+ * dei file jsx e dei file ottimizzati
183
183
  */
184
184
  remove_prefix: [],
185
185
 
186
186
  /**
187
- * SVGO configuration
187
+ * Configurazione di SVGO
188
188
  *
189
- * see https://svgo.dev/docs/plugins/
189
+ * vedi https://svgo.dev/docs/plugins/
190
190
  */
191
191
  svgo_config: {
192
192
  multipass: true,
@@ -211,32 +211,32 @@ const config = {
211
211
  },
212
212
 
213
213
  /**
214
- * “pallet” markups to be removed from the svg files
214
+ * markup “pallet” da rimuovere dai file svg
215
215
  *
216
- * As clearly explained on the [remixicon site](https://remixicon.com/),
217
- * the "pallet" is a transparent rectangle that ensures that the SVGs maintain
218
- * their dimensions in your design software. They are not necessary in the final SVGs,
219
- * and can even produce unwanted effects, so they are removed.
220
- * Each item is a regular expression.
216
+ * Come spiegato chiaramente sul [sito di remixicon](https://remixicon.com/),
217
+ * il "pallet" è un rettangolo trasparente che garantisce che gli SVG mantengano
218
+ * le proprie dimensioni nel software di design. Non è necessario negli SVG finali
219
+ * e può persino produrre effetti indesiderati, quindi viene rimosso.
220
+ * Ogni elemento è un'espressione regolare.
221
221
  */
222
222
  pallets: [
223
223
  /<rect width="256" height="256" fill="none" ?\/?>(<\/rect>)?/gmi, // phosphoricons raw
224
- /<path fill="none" d="(M0 0h24v24H0z|M0 0h256v256H0z)" ?\/?>(<\/path>)?/gmi, // remixicons with 'pallets' option (and others)
224
+ /<path fill="none" d="(M0 0h24v24H0z|M0 0h256v256H0z)" ?\/?>(<\/path>)?/gmi, // remixicons con l'opzione 'pallets' (e altri)
225
225
  ],
226
226
 
227
227
  /**
228
- * Opacity classes for duotone icons
228
+ * Classi di opacità per le icone duotone
229
229
  *
230
- * Convert opacity values to predefined classes
231
- * the key is the decimal part of the opacity value (e.g.: 2 == 0.2), the value
232
- * is the class to be added in place of the opacity value.
233
- * The purpose of this feature is to convert the opacity values of duotone icons
234
- * to predefined classes, merging similar values to an unique class:
235
- * the script will assign the class whose key is the closest to the opacity value.
236
- * For example, both 0.2 and 0.26 opacity values are converted
237
- * to the class `duotone-light` (whose key is 2). You then only need to set the classes in your css.
238
- * NB: only opacity attributes applied to elements inside the svg tag will be considered.
239
- * If you don't want to use this feature, remove the `opacity_classes` object or leave it empty
230
+ * Converte i valori di opacità in classi predefinite.
231
+ * La chiave è la parte decimale del valore di opacità (es.: 2 == 0.2), il valore
232
+ * è la classe da aggiungere al posto del valore di opacità.
233
+ * Lo scopo è convertire i valori di opacità delle icone duotone in classi
234
+ * predefinite, unendo valori simili in un'unica classe:
235
+ * lo script assegna la classe la cui chiave è la più vicina al valore di opacità.
236
+ * Ad esempio, sia 0.2 sia 0.26 vengono convertiti nella classe `duotone-light`
237
+ * (la cui chiave è 2). Poi basta definire le classi nel proprio css.
238
+ * NB: vengono considerati solo gli attributi opacity applicati agli elementi all'interno del tag svg.
239
+ * Se non si vuole usare questa funzionalità, rimuovere l'oggetto `opacity_classes` o lasciarlo vuoto
240
240
  *
241
241
  * @example
242
242
  * opacity_classes: {
@@ -248,10 +248,10 @@ const config = {
248
248
  opacity_classes: {},
249
249
 
250
250
  /**
251
- * Icon type classes
251
+ * Classi per tipo di icona
252
252
  *
253
- * Optional classes to be added to fill and or stroke icons
254
- * leave empty or remove if you don't need them
253
+ * Classi opzionali da aggiungere alle icone fill e/o stroke
254
+ * lasciare vuoto o rimuovere se non servono
255
255
  *
256
256
  * @example
257
257
  * icon_type_class: {
@@ -265,23 +265,23 @@ const config = {
265
265
  },
266
266
 
267
267
  /**
268
- * Non-square icons classes
268
+ * Classi per le icone non quadrate
269
269
  *
270
- * Assign specific classes to non-square icons.
271
- * Assuming that all icons have the viewBox attribute, and that all viewboxes
272
- * origin is at 0 0, the script analizes all icons widths and heights
273
- * and detect those with non-square aspect ratio.
274
- * Then, the values are compared (after being rounded to two decimal places)
275
- * to find the closest aspect ratio among
276
- * those listed in the `non_square_icons_classes` array. The class corresponding
277
- * to the found value is then assigned to the icon.
278
- * The first value of each subarray of `non_square_icons_classes` is the aspect ratio
279
- * (width / height), the second is the class to be assigned.
280
- * If you don't want to use this feature, remove the `non_square_icons_classes`
281
- * array or leave it empty
270
+ * Assegna classi specifiche alle icone non quadrate.
271
+ * Presupponendo che tutte le icone abbiano l'attributo viewBox e che l'origine di
272
+ * tutti i viewBox sia in 0 0, lo script analizza larghezza e altezza di tutte le icone
273
+ * e individua quelle con aspect ratio non quadrato.
274
+ * Poi i valori vengono confrontati (dopo l'arrotondamento a due decimali)
275
+ * per trovare l'aspect ratio più vicino tra quelli elencati nell'array
276
+ * `non_square_icons_classes`. La classe corrispondente al valore trovato
277
+ * viene quindi assegnata all'icona.
278
+ * Il primo valore di ogni sotto-array di `non_square_icons_classes` è l'aspect ratio
279
+ * (larghezza / altezza), il secondo è la classe da assegnare.
280
+ * Se non si vuole usare questa funzionalità, rimuovere l'array
281
+ * `non_square_icons_classes` o lasciarlo vuoto
282
282
  *
283
- * NB: Although aspect-ratio classes are added to `symbol` tags, this functionality
284
- * is not supported in SVGs with that element type.
283
+ * NB: anche se le classi di aspect ratio vengono aggiunte ai tag `symbol`, questa funzionalità
284
+ * non è supportata negli SVG con quel tipo di elemento.
285
285
  *
286
286
  * @example
287
287
  * non_square_icons_classes: [
@@ -294,11 +294,11 @@ const config = {
294
294
 
295
295
 
296
296
  /**
297
- * Console colors
297
+ * Colori della console
298
298
  *
299
- * Colors for console output as defined in <https://nodejs.org/api/util.html#customizing-utilinspect-colors>
300
- * The default colors work well on dark background terminals, if you have a light background terminal, you may
301
- * need to change the colors.
299
+ * Colori per l'output in console, come definiti in <https://nodejs.org/api/util.html#customizing-utilinspect-colors>
300
+ * I colori di default funzionano bene su terminali con sfondo scuro; con un terminale
301
+ * con sfondo chiaro potrebbe essere necessario cambiarli.
302
302
  */
303
303
  console_colors: {
304
304
  error : 'bgRed',
@@ -311,29 +311,29 @@ const config = {
311
311
 
312
312
  /**
313
313
  * LEGACY
314
- * Features mantained for compatibility reasons
314
+ * Funzionalità mantenute per ragioni di compatibilità
315
315
  */
316
316
 
317
317
  /**
318
- * Svg to scss variables
319
- * Generate scss variables from specified svg icons
318
+ * Svg in variabili scss
319
+ * Genera variabili scss dalle icone svg indicate
320
320
  */
321
321
  svg_to_scss: {
322
- /* icons to be converted to scss variables.
323
- * Paths of the svg files to be processed (relative to config file).
324
- * Icons will be parsed and optimized then converted to scss variables.
325
- * The variable names will be the same as the file names, without extensions
326
- * and parts removed as per the `remove_prefix` parameter.
322
+ /* icone da convertire in variabili scss.
323
+ * Percorsi dei file svg da elaborare (relativi al file di configurazione).
324
+ * Le icone vengono analizzate e ottimizzate, quindi convertite in variabili scss.
325
+ * I nomi delle variabili coincidono con i nomi dei file, senza estensione
326
+ * e senza le parti rimosse in base al parametro `remove_prefix`.
327
327
  */
328
328
  files: [],
329
329
 
330
- /* string to be prefixed to the variable names */
330
+ /* stringa da anteporre ai nomi delle variabili */
331
331
  varname_prefix: 'icon-',
332
332
 
333
- /* if true, the svg files are converted to data urls */
333
+ /* se true, i file svg vengono convertiti in data url */
334
334
  convert_to_css_url: true,
335
335
 
336
- /* path of the generated scss file */
336
+ /* percorso del file scss generato */
337
337
  scss_icons_file: '_icons-svg.scss',
338
338
  }
339
339
 
@@ -1,34 +1,34 @@
1
1
  /**
2
2
  * jsx_icon_file_builder
3
3
  *
4
- * Function to create JSX icon files
4
+ * Funzione per creare i file JSX delle icone
5
5
  *
6
- * The `parsed_svg` argument is the object returned by the parse function
7
- * and contains:
8
- * - svg: the whole optimized svg markup (including the svg tag),
9
- * - viewbox: the viewbox attribute content,
10
- * - svg_content: the optimized svg markup without the svg tag)
11
- * - classes: the aspect ratio class as per the `non_square_icons_classes` parameter and or
12
- * the 'fill` or `stroke` class as per the `icon_type_class` parameter
13
- * - icon_type: icon type string: `fill` or `stroke`
14
- * - filename: the name of the svg file without extension and with the `remove_prefix` strings removed
15
- * - filename_camel_case: the filename in camel case (nb: dashes follewed ny numbers are converted to underscores)
16
- * - filename_pascal_case: similar to `filename_camel_case` but with the first letter capitalized
6
+ * L'argomento `parsed_svg` è l'oggetto restituito dalla funzione di parsing
7
+ * e contiene:
8
+ * - svg: l'intero markup svg ottimizzato (incluso il tag svg),
9
+ * - viewbox: il contenuto dell'attributo viewbox,
10
+ * - svg_content: il markup svg ottimizzato senza il tag svg)
11
+ * - classes: la classe di aspect ratio in base al parametro `non_square_icons_classes` e/o
12
+ * la classe `fill` o `stroke` in base al parametro `icon_type_class`
13
+ * - icon_type: stringa con il tipo di icona: `fill` o `stroke`
14
+ * - filename: il nome del file svg senza estensione e senza le stringhe `remove_prefix`
15
+ * - filename_camel_case: il nome del file in camel case (nb: i trattini seguiti da numeri vengono convertiti in underscore)
16
+ * - filename_pascal_case: come `filename_camel_case` ma con la prima lettera maiuscola
17
17
  *
18
- * The function must return an object with the following properties:
19
- * - component_name: the name of the component
20
- * - jsx_content: the jsx content of the component
21
- * - filename: the name of the jsx file (including extension) to be saved (default: `component_name` + '.jsx')
18
+ * La funzione deve restituire un oggetto con le seguenti proprietà:
19
+ * - component_name: il nome del componente
20
+ * - jsx_content: il contenuto jsx del componente
21
+ * - filename: il nome del file jsx (estensione inclusa) da salvare (default: `component_name` + '.jsx')
22
22
  *
23
23
  *
24
- * NB: Since it is assumed that most attributes in the svg content have been removed
25
- * during optimization, no further cleanup is performed IN THIS VERSION and therefore it is not guaranteed
26
- * that `parsed_svg.content` is valid JSX markup.
27
- * If you decide to keep some attributes in the SVGO options, you should check the svg content and, if possible,
28
- * modify the function accordingly. In the function below, the `replace` method,
29
- * applied to `parsed_svg.svg_content`, is an example of how to temporarily solve this problem.
24
+ * NB: poiché si presume che la maggior parte degli attributi del contenuto svg sia stata rimossa
25
+ * durante l'ottimizzazione, IN QUESTA VERSIONE non viene eseguita alcuna ulteriore pulizia e quindi non è garantito
26
+ * che `parsed_svg.content` sia markup JSX valido.
27
+ * Se si decide di mantenere alcuni attributi nelle opzioni di SVGO, bisogna verificare il contenuto svg e, se possibile,
28
+ * modificare di conseguenza la funzione. Nella funzione qui sotto, il metodo `replace`,
29
+ * applicato a `parsed_svg.svg_content`, è un esempio di come risolvere temporaneamente il problema.
30
30
  *
31
- * NB: this release doesn't include any prettify feature.
31
+ * NB: questa release non include alcuna funzionalità di prettify.
32
32
  *
33
33
  * @param {*} parsed_svg
34
34
  * @returns
@@ -39,7 +39,7 @@
39
39
 
40
40
  export function jsx_icon_file_builder(parsed_svg) {
41
41
 
42
- // adding `Icon` suffix to the component name
42
+ // aggiunge il suffisso `Icon` al nome del componente
43
43
  const component_name = `${parsed_svg.filename_pascal_case}Icon`;
44
44
 
45
45
  return {
@@ -1,12 +1,12 @@
1
1
  import { configManager } from './config-manager.mjs';
2
2
 
3
- // remove extension and normalize filename
3
+ // rimuove l'estensione e normalizza il nome del file
4
4
  export function parseSvgFilename(filename) {
5
5
 
6
6
  const cfg = configManager.getCfg();
7
7
 
8
- let parsed_filename = filename.split('.').slice(0, -1).join('.') // remove extension
9
- .replaceAll(' ', '-'); // replace spaces with hyphens
8
+ let parsed_filename = filename.split('.').slice(0, -1).join('.') // rimuove l'estensione
9
+ .replaceAll(' ', '-'); // sostituisce gli spazi con trattini
10
10
 
11
11
  // removing filename prefixes
12
12
  cfg.remove_prefix.forEach(prefix => {
@@ -51,7 +51,7 @@ export function parseSvgFiles(parseModeKey, callback) {
51
51
  throw new Error( `“${parseModeKey}” type is not mapped. It must be one of 'symbols', 'jsx' or 'optimize'` );
52
52
  }
53
53
 
54
- // source_folders is an array and not an object? (not used in the current version)
54
+ // source_folders è un array e non un oggetto? (non usato nella versione attuale)
55
55
  if(Array.isArray(cfg[parseModeKey].source_folders) ) {
56
56
 
57
57
  cfg[parseModeKey].source_folders.forEach(folder => {
@@ -14,7 +14,7 @@ export function parseSvgMarkup(filepath, svg_type, custom_svgo_config = null) {
14
14
  svgString = svgString.replace(pallet, '');
15
15
  });
16
16
 
17
- // if present, custom_svgo_config ovverrides cfg.svgo_config
17
+ // se presente, custom_svgo_config sovrascrive cfg.svgo_config
18
18
  const optimized = optimize(svgString, custom_svgo_config? custom_svgo_config : cfg.svgo_config),
19
19
  icon_type_class = svg_type? cfg.icon_type_class?.[svg_type]?? null : null,
20
20
  classes = icon_type_class? [icon_type_class] : [];
@@ -57,12 +57,12 @@ export function parseSvgMarkup(filepath, svg_type, custom_svgo_config = null) {
57
57
  }
58
58
 
59
59
 
60
- // extra classes are immediately assigned to the optimized svg markup
60
+ // le classi extra vengono assegnate subito al markup svg ottimizzato
61
61
  if(classes.length) {
62
62
  optimized.data = optimized.data.replace(/<svg/, `<svg class="${classes.join(' ')}"`);
63
63
  }
64
64
 
65
- // get svg content
65
+ // ricava il contenuto svg
66
66
  const svg_content = optimized.data.match(/<svg(?:.*?)>(.*?)<\/svg>/mi)[1];
67
67
 
68
68
  return {
@@ -70,6 +70,6 @@ export function parseSvgMarkup(filepath, svg_type, custom_svgo_config = null) {
70
70
  viewbox: viewbox,
71
71
  svg_content: svg_content,
72
72
  classes: classes,
73
- icon_type: svg_type // fill or stroke
73
+ icon_type: svg_type // fill o stroke
74
74
  };
75
75
  }
@@ -23,11 +23,11 @@ export async function svg_to_jsx() {
23
23
 
24
24
  dest_folder = path.resolve(cfg.work_dir, cfg_obj.dest_folder);
25
25
 
26
- // checking output dir for optimized svg files
26
+ // verifica la directory di output dei file jsx
27
27
  await create_dest_folder(dest_folder, cfg_obj.clearDestFolder);
28
28
 
29
29
 
30
- // parsing and saving JSX files
30
+ // parsing e salvataggio dei file JSX
31
31
  fileCount = parseSvgFiles('jsx',
32
32
  (parsedSvg) => {
33
33
  const result = icon_builder(parsedSvg),
@@ -19,10 +19,10 @@ export async function svg_to_optimized() {
19
19
 
20
20
  dest_folder = path.resolve(cfg.work_dir, cfg_obj.dest_folder);
21
21
 
22
- // checking output dir for optimized svg files
22
+ // verifica la directory di output dei file svg ottimizzati
23
23
  await create_dest_folder(dest_folder, cfg_obj.clearDestFolder);
24
24
 
25
- // parsing and saving optimized svg files
25
+ // parsing e salvataggio dei file svg ottimizzati
26
26
  fileCount = parseSvgFiles('optimize',
27
27
  (parsedSvg) => {
28
28
  fs.writeFileSync(path.resolve(dest_folder, `${parsedSvg.filename}.svg`), parsedSvg.svg);
@@ -44,8 +44,8 @@ export function svg_to_symbols() {
44
44
  const icon_list_var_string = 'const icons_list = ' + JSON.stringify(icons_list.sort(), null, ' ').replace(/"/g, '\'') + ';\n';
45
45
  if(fileCount && cfg.symbols.icons_list_file) {
46
46
  fs.writeFileSync(path.resolve(cfg.work_dir, cfg.symbols.icons_list_file),
47
- '// List of icon symbols\n' +
48
- '// NB: this is a generated file, any changes will be overwritten\n\n' +
47
+ '// Elenco dei symbol delle icone\n' +
48
+ '// NB: file generato, le eventuali modifiche verranno sovrascritte\n\n' +
49
49
  'export ' + icon_list_var_string
50
50
  );
51
51
 
@@ -1,6 +1,6 @@
1
1
  # Update packages
2
2
 
3
- Runs `npm update` for all packages installed within `node_modules/@massimo-cassandro`.
3
+ Esegue `npm update` per tutti i pacchetti installati in `node_modules/@massimo-cassandro`.
4
4
 
5
5
  Usage:
6
6