@massimo-cassandro/minimo 1.41.4 → 1.41.6

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 (135) 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/starter-kit/source_files/root/webpack.config.mjs +15 -1
  39. package/dev-tools/starter-kit/webpack-config-upg.md +12 -0
  40. package/dev-tools/stylelint-config/README.md +7 -7
  41. package/dev-tools/svg-icons-tools/README.md +32 -32
  42. package/dev-tools/svg-icons-tools/src/config-manager.mjs +1 -1
  43. package/dev-tools/svg-icons-tools/src/default-config.mjs +118 -118
  44. package/dev-tools/svg-icons-tools/src/jsx-icon-file-builder.mjs +24 -24
  45. package/dev-tools/svg-icons-tools/src/parse-svg-filename.mjs +3 -3
  46. package/dev-tools/svg-icons-tools/src/parse-svg-files.mjs +1 -1
  47. package/dev-tools/svg-icons-tools/src/parse-svg-markup.mjs +4 -4
  48. package/dev-tools/svg-icons-tools/src/svg-to-jsx.mjs +2 -2
  49. package/dev-tools/svg-icons-tools/src/svg-to-optimized.mjs +2 -2
  50. package/dev-tools/svg-icons-tools/src/svg-to-symbols.mjs +2 -2
  51. package/dev-tools/upd@m/README.md +1 -1
  52. package/dev-tools/upd@m/index.mjs +1 -1
  53. package/dev-tools/update-version/README.md +9 -9
  54. package/package.json +1 -1
  55. package/snippets/unsplash-browser-app/README.md +1 -1
  56. package/snippets/unsplash-browser-app/unsplash-utilities.js +9 -9
  57. package/src/components/autocomplete/README.md +3 -3
  58. package/src/components/autocomplete/autocomplete-engine.js +75 -63
  59. package/src/components/autocomplete/check-autocomplete.js +3 -3
  60. package/src/components/dismiss-alerts.js +3 -3
  61. package/src/components/form-reset-submit.js +6 -6
  62. package/src/components/inner-nav/inner-nav.js +2 -2
  63. package/src/components/modal-alert/modal-alert.js +67 -65
  64. package/src/components/modal-alert/modal-alert.minimo.tokens.mjs +1 -1
  65. package/src/components/modal-popup/modal-popup.js +56 -56
  66. package/src/components/overlay/overlay.js +3 -3
  67. package/src/components/sf-macro/readme.md +1 -1
  68. package/src/components/sf-macro/sf-macro.js +27 -23
  69. package/src/components/slide-up-down-toggle/slide-up-down-toggle.js +83 -79
  70. package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +44 -44
  71. package/src/components/snackbar/snackbar.js +19 -19
  72. package/src/components/spinner/spinner.js +3 -3
  73. package/src/components/unsplash-page/README.md +8 -8
  74. package/src/components/unsplash-page/fetch-unsplash-data.js +3 -3
  75. package/src/components/unsplash-page/unsplash-page.js +33 -33
  76. package/src/components/unsplash-page/unsplash-page.module.css +1 -1
  77. package/src/css/alerts.css +2 -2
  78. package/src/css/forms/forms.css +4 -4
  79. package/src/css/forms/validation.css +1 -1
  80. package/src/css/margin-padding-media.css +4 -4
  81. package/src/css/margin-padding.css +4 -4
  82. package/src/css/reset.css +11 -11
  83. package/src/icons/read-me.md +1 -1
  84. package/src/minimo.css +3 -3
  85. package/src/utilities/better-text-with-places.js +22 -22
  86. package/src/utilities/better-text.js +42 -35
  87. package/src/utilities/classnames.js +8 -8
  88. package/src/utilities/cookies.js +6 -6
  89. package/src/utilities/create-id.js +3 -3
  90. package/src/utilities/disable-btns-on-submit.js +2 -2
  91. package/src/utilities/dom-builder/dom-builder.js +89 -86
  92. package/src/utilities/dom-builder/domBuilderBasicSetup.js +9 -9
  93. package/src/utilities/dom-builder/parseDomString.js +23 -23
  94. package/src/utilities/dom-builder-helpers/README.md +2 -2
  95. package/src/utilities/dom-builder-helpers/form-tags.js +100 -100
  96. package/src/utilities/dom-builder-helpers/picture-tag.js +39 -39
  97. package/src/utilities/enable-submit-btns.js +1 -1
  98. package/src/utilities/escape-html.js +2 -2
  99. package/src/utilities/generate-pwd.js +4 -4
  100. package/src/utilities/linked-dates.js +13 -13
  101. package/src/utilities/parse-file-size.js +6 -6
  102. package/src/utilities/random-id.js +3 -3
  103. package/src/utilities/relative-date.js +40 -40
  104. package/src/utilities/sentence-case.js +1 -1
  105. package/src/utilities/strip-tags.js +1 -1
  106. package/src/utilities/title-case.js +1 -1
  107. package/src/utilities/truncate-string.js +5 -5
  108. package/src/utilities/validation-error-class.js +12 -12
  109. package/src/web-components/json-table/json-table-component.js +123 -121
  110. package/src/web-components/json-table/json-table-component.module.css +6 -6
  111. package/src/web-components/json-table/json-table.minimo.tokens.mjs +6 -6
  112. package/src/web-components/json-table/jt-docs/parametri.md +124 -0
  113. package/src/web-components/json-table/jt-docs.md +622 -0
  114. package/src/web-components/json-table/readme.md +3 -763
  115. package/src/web-components/json-table/src/cell-content.js +25 -25
  116. package/src/web-components/json-table/src/content-utils.js +21 -21
  117. package/src/web-components/json-table/src/data-types.js +32 -32
  118. package/src/web-components/json-table/src/defaults.js +230 -191
  119. package/src/web-components/json-table/src/get-data.js +55 -38
  120. package/src/web-components/json-table/src/icons.js +17 -17
  121. package/src/web-components/json-table/src/info-section.js +18 -18
  122. package/src/web-components/json-table/src/main-builder.js +45 -45
  123. package/src/web-components/json-table/src/pagination.js +32 -32
  124. package/src/web-components/json-table/src/parse-cols.js +18 -18
  125. package/src/web-components/json-table/src/parse-rows.js +17 -17
  126. package/src/web-components/json-table/src/resolve-params.js +53 -41
  127. package/src/web-components/json-table/src/search.js +13 -13
  128. package/src/web-components/json-table/src/sorting.js +20 -20
  129. package/src/web-components/json-table/src/table-body.js +13 -13
  130. package/src/web-components/json-table/src/table-builder.js +34 -34
  131. package/src/web-components/json-table/src/table-tfoot.js +8 -8
  132. package/src/web-components/json-table/src/table-thead.js +21 -21
  133. package/src/web-components/json-table/src/update-info.js +11 -11
  134. package/types/classes.d.ts +2 -2
  135. package/types/global.d.ts +18 -12
package/README.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # Minimo
2
2
 
3
- My light framework + utilities
3
+ Il mio framework leggero + utilità
4
4
 
5
- ## Install
5
+ ## Installazione
6
6
 
7
7
  ```bash
8
8
  npm i @massimo-cassandro/minimo
9
9
 
10
- # optional:
10
+ # opzionale:
11
11
  npm i -D @massimo-cassandro/eslint-config
12
12
  ```
13
13
 
14
- > Note: a stylelint config is bundled with minimo itself (no separate install needed) — see [dev-tools/stylelint-config/README.md](dev-tools/stylelint-config/README.md).
14
+ > Nota: una configurazione stylelint è inclusa in minimo (non serve un'installazione separata) — vedi [dev-tools/stylelint-config/README.md](dev-tools/stylelint-config/README.md).
15
15
 
16
- > Note: **minimo** is designed to be used with WebPack using the configuration you can find in the [starter-kit folder](./dev-tools/starter-kit/) of this repository. If changes are made (for example, to how SVG files are imported), things may not work as expected.
16
+ > Nota: **minimo** è pensato per essere usato con webpack, con la configurazione disponibile nella [cartella starter-kit](./dev-tools/starter-kit/) di questo repository. Se vengono apportate modifiche (ad esempio al modo in cui vengono importati i file SVG), il funzionamento potrebbe non essere quello atteso.
17
17
  >
18
18
 
19
- For a complete install of all required webpack modules, use the install script at `./dev-tools/starter-kit/starter-install.sh` launching:
19
+ Per installare tutti i moduli webpack necessari, usare lo script `./dev-tools/starter-kit/starter-install.sh`, eseguendo:
20
20
 
21
21
  ```bash
22
22
  zsh ./node_modules/@massimo-cassandro/minimo/dev-tools/starter-kit/starter-install.sh
23
23
  ```
24
24
 
25
- To bootstrap a project **before** installing the whole package, download only the `starter-kit` folder from the npm tarball and run the script from there:
25
+ Per avviare un progetto **prima** di installare l'intero pacchetto, scaricare solo la cartella `starter-kit` dal tarball npm ed eseguire lo script da lì:
26
26
 
27
27
  ```bash
28
28
  curl -sL "$(npm view @massimo-cassandro/minimo dist.tarball)" | tar xz package/dev-tools/starter-kit
@@ -34,16 +34,16 @@ rm -rf package
34
34
 
35
35
  ## Design tokens
36
36
 
37
- Minimo comes with a set of design tokens and some utilities to manage them. See [Design Tokens readme](design-tokens/README.md).
37
+ Minimo include un insieme di design token e alcune utilità per gestirli. Vedi il [readme dei Design Tokens](design-tokens/README.md).
38
38
 
39
39
  ## Dev Tools
40
40
 
41
- The [`dev-tools`](./dev-tools/README.md) directory contains a set of standalone Node.js CLI utilities for managing a web project — updating dependencies, bumping the version and changelog, and generating/optimizing SVG icons and favicons. They are published as part of the `minimo` package and exposed via the `bin` entries in `package.json` (`update-version`, `upd@m`, `svgIconsTools`, `create-favicons`); see the [Dev Tools README](./dev-tools/README.md) for the full list and usage.
41
+ La cartella [`dev-tools`](./dev-tools/README.md) contiene un insieme di utilità CLI Node.js indipendenti per la gestione di un progetto web: aggiornamento delle dipendenze, incremento della versione e del changelog, generazione e ottimizzazione di icone SVG e favicon. Sono pubblicate insieme al pacchetto `minimo` ed esposte tramite le voci `bin` di `package.json` (`update-version`, `upd@m`, `svgIconsTools`, `create-favicons`); vedi il [README di Dev Tools](./dev-tools/README.md) per l'elenco completo e le istruzioni d'uso.
42
42
 
43
43
 
44
- ## Docs & Demo
44
+ ## Documentazione e demo
45
45
 
46
- [Docs](docs/README.md)
46
+ [Documentazione](docs/README.md)
47
47
 
48
- [Demo](https://massimo-cassandro.github.io/minimo/) (in progress)
48
+ [Demo](https://massimo-cassandro.github.io/minimo/) (in lavorazione)
49
49
 
@@ -23,11 +23,11 @@ import { SVG, registerWindow } from '@svgdotjs/svg.js';
23
23
 
24
24
  export function createSvgCanvasNode() {
25
25
 
26
- // returns a window with a document and an svg root node
26
+ // restituisce una window con un document e un nodo radice svg
27
27
  const window = createSVGWindow();
28
28
  const document = window.document;
29
29
 
30
- // register window and document
30
+ // registra window e document
31
31
  registerWindow(window, document);
32
32
 
33
33
  // create svgCanvas
@@ -1,19 +1,19 @@
1
1
  // https://stackblitz.com/edit/vitejs-vite-acphht?file=main.js
2
2
 
3
3
  /*
4
- // Example usage:
4
+ // Esempio di utilizzo:
5
5
  const fontUrl = './Rubik Moonrocks.ttf';
6
6
  const text = 'Hello, World!';
7
- const fontSize = 16; // in points
7
+ const fontSize = 16; // in punti
8
8
  textToSvgPath(fontUrl, text, fontSize)
9
9
  .then(({ svgPathData, svg }) => {
10
- //console.log(svgPathData); // SVG path data string
11
- console.log(svg); // SVG element as a string
10
+ //console.log(svgPathData); // stringa con i dati del path SVG
11
+ console.log(svg); // elemento SVG come stringa
12
12
  })
13
13
  .catch((err) => console.error(err));
14
14
  */
15
15
 
16
- // Function to load the font and convert text to SVG path
16
+ // Funzione che carica il font e converte il testo in path SVG
17
17
  // vedi ada-frontend/ada-charts/test/textToPath-test.mjs
18
18
 
19
19
  export async function textToSvgPath(fontUrl, text, fontSize) {
@@ -21,17 +21,17 @@ export async function textToSvgPath(fontUrl, text, fontSize) {
21
21
  const opentype = (await import(/* webpackIgnore: true */ 'opentype.js')).default;
22
22
  const font = await opentype.load(fontUrl);
23
23
 
24
- // Define the x and y coordinates where the text should start
24
+ // Coordinate x e y da cui inizia il testo
25
25
  const x = 0;
26
26
  const y = 50;
27
27
 
28
- // Get a path representing the text
28
+ // Ottiene il path che rappresenta il testo
29
29
  const path = font.getPath(String(text), x, y, fontSize);
30
30
 
31
- // Convert the path to an SVG path data string
31
+ // Converte il path in una stringa di dati path SVG
32
32
  const pathData = path.toPathData();
33
33
 
34
- // Alternatively, convert the path to an SVG
34
+ // In alternativa, converte il path in un elemento SVG
35
35
  const pathElementString = path.toSVG();
36
36
 
37
37
  return { pathData, pathElementString };
@@ -123,7 +123,7 @@ export async function ratingDisplay({
123
123
  displayLabelRowGap = 2,
124
124
 
125
125
  /**
126
- * @param {Object[]|null} [miniDisplay=null] - Configurazione mini display secondari (max 2). Srray di uno o due oggetti (default: null)
126
+ * @param {Object[]|null} [miniDisplay=null] - Configurazione mini display secondari (max 2). Array di uno o due oggetti (default: null)
127
127
  * @param {string} miniDisplay[].position - Posizione: 'sx' | 'dx' (alias: 'left' | 'right').
128
128
  * @param {number} miniDisplay[].value - Valore numerico da rappresentare.
129
129
  * @param {string} miniDisplay[].type - Tipo di visualizzazione: 'gauge' (tachimetro) o 'value' (testo di `value`).
@@ -21,11 +21,11 @@ export function ratindDisplayAnimation() {
21
21
  // request another frame
22
22
  const animationRequest = window.requestAnimationFrame(step);
23
23
 
24
- // if enough time has elapsed, draw the next frame
24
+ // se è trascorso abbastanza tempo, disegna il frame successivo
25
25
  if (elapsed >= fpsInterval) {
26
26
 
27
- // Get ready for next frame by setting startTimestamp=now, but...
28
- // Also, adjust for fpsInterval not being multiple of 16.67
27
+ // Prepara il frame successivo impostando startTimestamp=now, ma...
28
+ // regola anche il valore perché fpsInterval non è multiplo di 16.67
29
29
  startTimestamp = now - (elapsed % fpsInterval);
30
30
 
31
31
  svgElement.style.setProperty(
@@ -2,10 +2,10 @@
2
2
 
3
3
  <!-- TODO intro -->
4
4
 
5
- ## Using design tokens
5
+ ## Uso dei design token
6
6
 
7
7
  <!-- TODO modalità d'uso (da tokens penpots o figma, con o snza merge css ecc...) -->
8
8
 
9
9
  ## Design Tokens Builder
10
10
 
11
- The Node.js scripts that generate the CSS custom properties / JSON token files from the sources in this directory (`build-tokens.mjs`, `check-unresolved-custom-props.mjs`, exposed as the `buildTokens` / `checkUnresolvedProps` bins) live in [dev-tools/design-tokens-builder](../dev-tools/design-tokens-builder/README.md), alongside the other standalone dev-tools CLI utilities.
11
+ Gli script Node.js che generano le custom properties CSS / i file JSON dei token a partire dai sorgenti di questa directory (`build-tokens.mjs`, `check-unresolved-custom-props.mjs`, esposti come bin `buildTokens` / `checkUnresolvedProps`) si trovano in [dev-tools/design-tokens-builder](../dev-tools/design-tokens-builder/README.md), insieme alle altre utilità CLI standalone di dev-tools.
@@ -1,30 +1,30 @@
1
1
 
2
- # SD Types
2
+ # Tipi SD
3
3
 
4
- * **Color** (`$type` value: `color`)
5
- * Colors in Hex, RGB, HSL, or standard names. ("#00ff00" or "rgba(0,0,0,0.5)" )
6
- * **Size** (`dimension`)
7
- * Measurements with units (px, rem, em, %, etc.). ("16px", "1.5rem", "50%" )
8
- * **Number** (`number`)
9
- * Pure numeric values ​​without units (e.g., opacity). (0.75, 1.2, 100 )
10
- * **Duration** (`duration`)
11
- * Time intervals for animations and transitions. ("200ms", "0.5s" )
12
- * **Time Curve** (`cubicBezier`)
13
- * Array of 4 numbers for easing curves. ([0.42, 0, 0.58, 1] )
14
- * **Font Family** (`fontFamily`)
15
- * Name of the font family or list (array). ("Inter", ["Helvetica", "Arial"] )
16
- * **Font Weight** (`fontWeight`)
17
- * Font weight (number or text alias). (700, "bold", "light" )
4
+ * **Colore** (`$type` value: `color`)
5
+ * Colori in Hex, RGB, HSL o nomi standard. ("#00ff00" or "rgba(0,0,0,0.5)" )
6
+ * **Dimensione** (`dimension`)
7
+ * Misure con unità (px, rem, em, %, ecc.). ("16px", "1.5rem", "50%" )
8
+ * **Numero** (`number`)
9
+ * Valori numerici puri senza unità (es. opacità). (0.75, 1.2, 100 )
10
+ * **Durata** (`duration`)
11
+ * Intervalli di tempo per animazioni e transizioni. ("200ms", "0.5s" )
12
+ * **Curva temporale** (`cubicBezier`)
13
+ * Array di 4 numeri per le curve di easing. ([0.42, 0, 0.58, 1] )
14
+ * **Font family** (`fontFamily`)
15
+ * Nome della font family o elenco (array). ("Inter", ["Helvetica", "Arial"] )
16
+ * **Peso del font** (`fontWeight`)
17
+ * Peso del font (numero o alias testuale). (700, "bold", "light" )
18
18
 
19
- ## compounds:
19
+ ## composti:
20
20
 
21
- * **border** (`border`)
22
- * Compound: requires color, width, style. ({"color": "#000", "width": "1px", "style": "solid"} )
23
- * **Shadow** (`shadow`)
24
- * Compound: color, offsetX, offsetY, blur, spread, inset. ({"color": "#0003", "offsetX": "0px", "offsetY": "4px", "blur": "10px"} )
25
- * **Typography** (`typography`)
26
- * Compound: fontFamily, fontSize, fontWeight, lineHeight, letterSpacing. ({"fontFamily": "Inter", "fontSize": "16px", "fontWeight": 400} )
27
- * **Gradient** (`gradient`)
28
- * Compound: Array of "stops" (color and position). ([{"color": "#000", "offset": 0}, {"color": "#fff", "offset": 1}] )
29
- * **Stroke Style** (`strokeStyle`)
30
- * Compound: Defines line patterns (dashes). ({"dashArray": ["4px", "2px"], "lineCap": "round"} )
21
+ * **bordo** (`border`)
22
+ * Composto: richiede color, width, style. ({"color": "#000", "width": "1px", "style": "solid"} )
23
+ * **Ombra** (`shadow`)
24
+ * Composto: color, offsetX, offsetY, blur, spread, inset. ({"color": "#0003", "offsetX": "0px", "offsetY": "4px", "blur": "10px"} )
25
+ * **Tipografia** (`typography`)
26
+ * Composto: fontFamily, fontSize, fontWeight, lineHeight, letterSpacing. ({"fontFamily": "Inter", "fontSize": "16px", "fontWeight": 400} )
27
+ * **Gradiente** (`gradient`)
28
+ * Composto: array di "stops" (colore e posizione). ([{"color": "#000", "offset": 0}, {"color": "#fff", "offset": 1}] )
29
+ * **Stile del tratto** (`strokeStyle`)
30
+ * Composto: definisce i pattern delle linee (tratteggi). ({"dashArray": ["4px", "2px"], "lineCap": "round"} )
@@ -1,33 +1,33 @@
1
1
  # Dev tools
2
2
 
3
- A collection of standalone Node.js CLI utilities to help manage a web project's day-to-day chores (dependency updates, versioning/changelog, icon and favicon generation). Each tool lives in its own subfolder, works independently of the others and of the `minimo` package itself, and is documented in its own README — this page only gives a quick overview.
3
+ Raccolta di utilità CLI Node.js standalone che aiutano nelle attività quotidiane di gestione di un progetto web (aggiornamento delle dipendenze, versionamento/changelog, generazione di icone e favicon). Ogni strumento risiede in una propria sottocartella, funziona in modo indipendente dagli altri e dal pacchetto `minimo`, ed è documentato nel proprio README — questa pagina ne dà solo una panoramica.
4
4
 
5
- * [update-version](./update-version/README.md) — bumps the version in `package.json` and appends an entry to `changelog.md`
6
- * [Svg Icons Tools](./svg-icons-tools/README.md) — optimizes SVG icons and combines/converts them into symbols, JSX, or SCSS variables
7
- * [Create favicons](./create-favicons/README.md) — generates the full favicon set (SVG, PNG, ICO, webmanifest, HTML snippet) from a source image
8
- * [upd@m](./upd@m/README.md) — updates all `@massimo-cassandro/*` packages installed in `node_modules`
9
- * [Design Tokens Builder](./design-tokens-builder/README.md) — generates a CSS custom properties file (and optional JSON token files) from design token sources
10
- * [starter-kit](#starter-kit) — script for installing minimo environment
5
+ * [update-version](./update-version/README.md) — incrementa la versione in `package.json` e aggiunge una voce a `changelog.md`
6
+ * [Svg Icons Tools](./svg-icons-tools/README.md) — ottimizza le icone SVG e le combina/converte in symbol, JSX o variabili SCSS
7
+ * [Create favicons](./create-favicons/README.md) — genera il set completo di favicon (SVG, PNG, ICO, webmanifest, snippet HTML) a partire da un'immagine sorgente
8
+ * [upd@m](./upd@m/README.md) — aggiorna tutti i pacchetti `@massimo-cassandro/*` installati in `node_modules`
9
+ * [Design Tokens Builder](./design-tokens-builder/README.md) — genera un file di custom properties CSS (e, opzionalmente, file JSON di token) a partire dai sorgenti dei design token
10
+ * [starter-kit](#starter-kit) — script per installare l'ambiente minimo
11
11
 
12
12
  ## starter-kit
13
13
 
14
- `starter-kit/starter-install.sh` bootstraps a new frontend project: it copies the starter config files (`package.json`, `.gitignore`, `jsconfig.json`, eslint/stylelint configs, webpack config and modules, ...) into the project root and the frontend files (webpack template, `CLAUDE.md`, `_root_htaccess`/`_root_robots.txt`, ...) into a fixed `./app` folder, then installs all the required dev dependencies.
14
+ `starter-kit/starter-install.sh` avvia un nuovo progetto frontend: copia i file di configurazione starter (`package.json`, `.gitignore`, `jsconfig.json`, configurazioni eslint/stylelint, configurazione e moduli webpack, ...) nella root del progetto e i file frontend (template webpack, `CLAUDE.md`, `_root_htaccess`/`_root_robots.txt`, ...) in una cartella `./app` fissa, quindi installa tutte le dipendenze di sviluppo necessarie.
15
15
 
16
- The script **requires zsh** (it exits with an error if launched with `sh` or `bash`). Existing files are never overwritten: they are copied alongside with a `NEW-` prefix (to be integrated manually or removed). If the `./app` folder already exists, the whole frontend file set is copied into `./NEW-app` instead.
16
+ Lo script **richiede zsh** (termina con un errore se lanciato con `sh` o `bash`). I file esistenti non vengono mai sovrascritti: vengono copiati accanto con il prefisso `NEW-` (da integrare manualmente o da rimuovere). Se la cartella `./app` esiste già, l'intero set di file frontend viene copiato in `./NEW-app`.
17
17
 
18
- ### If minimo is already installed
18
+ ### Se minimo è già installato
19
19
 
20
- The script is exposed as a `bin` of the package:
20
+ Lo script è esposto come `bin` del pacchetto:
21
21
 
22
22
  ```bash
23
23
  npx starter-kit
24
24
  ```
25
25
 
26
- Since the installation is fully overwrite-safe, the script can also be **re-run at any time to update** an existing setup (e.g. to refresh the webpack modules or reinstall the dev dependencies): existing files are copied with the `NEW-` prefix, so running the script again never duplicates or overwrites anything.
26
+ Poiché l'installazione non sovrascrive mai nulla, lo script può essere anche **rieseguito in qualsiasi momento per aggiornare** una configurazione esistente (ad es. per aggiornare i moduli webpack o reinstallare le dipendenze di sviluppo): i file esistenti vengono copiati con il prefisso `NEW-`, quindi rieseguire lo script non duplica né sovrascrive mai nulla.
27
27
 
28
- ### Without installing minimo
28
+ ### Senza installare minimo
29
29
 
30
- To bootstrap a project **before** installing the whole package, download only the `starter-kit` folder from the npm tarball and run the script from there:
30
+ Per avviare un progetto **prima** di installare l'intero pacchetto, scaricare solo la cartella `starter-kit` dal tarball npm ed eseguire lo script da lì:
31
31
 
32
32
  ```bash
33
33
  curl -sL "$(npm view @massimo-cassandro/minimo dist.tarball)" | tar xz package/dev-tools/starter-kit
@@ -35,7 +35,7 @@ zsh package/dev-tools/starter-kit/starter-install.sh
35
35
  rm -rf package
36
36
  ```
37
37
 
38
- ## SVG adn favicons tools
38
+ ## Strumenti per SVG e favicon
39
39
 
40
40
  ```bash
41
41
  ## SVG Icons Tools
@@ -46,7 +46,7 @@ npx create-favicons init
46
46
  npx create-favicons [--dir=./path/to/dir]
47
47
  ```
48
48
 
49
- ## Adding frequently used tools in the script section of the `package.json` file:
49
+ ## Aggiungere gli strumenti più usati alla sezione scripts di `package.json`:
50
50
 
51
51
  ```json
52
52
  {
@@ -1,45 +1,45 @@
1
1
  # Create favicons
2
2
 
3
- Create favicon files as described in [How to Favicon in 2024](https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs).
3
+ Crea i file favicon come descritto in [How to Favicon in 2024](https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs).
4
4
 
5
- The source file can be SVG or a raster format (PNG, JPEG, WEBP, GIF, TIFF, AVIF). The generated files are PNG (apple-touch-icon and other Android files) and ICO (another favicon for compatibility with older browsers); an SVG favicon is also generated, but only when the source file itself is SVG (a vector favicon can't be derived from a raster source). The `manifest.webmanifest` files are also generated, along with an optional HTML snippet with `link` tags for inserting the generated elements (the snippet omits the SVG `link` tag when no SVG favicon was generated).
5
+ Il file sorgente può essere SVG o un formato raster (PNG, JPEG, WEBP, GIF, TIFF, AVIF). I file generati sono PNG (apple-touch-icon e altri file Android) e ICO (un'altra favicon per la compatibilità con i browser più vecchi); viene generata anche una favicon SVG, ma solo quando il file sorgente è a sua volta SVG (da una sorgente raster non si può ricavare una favicon vettoriale). Vengono generati anche i file `manifest.webmanifest`, insieme a uno snippet HTML opzionale con i tag `link` per inserire gli elementi generati (lo snippet omette il tag `link` SVG quando non è stata generata alcuna favicon SVG).
6
6
 
7
- Images are generated with [Sharp](https://sharp.pixelplumbing.com/), [SVGO](https://github.com/svg/svgo), and [sharp-ico](https://github.com/ssnangua/sharp-ico).
7
+ Le immagini vengono generate con [Sharp](https://sharp.pixelplumbing.com/), [SVGO](https://github.com/svg/svgo), and [sharp-ico](https://github.com/ssnangua/sharp-ico).
8
8
 
9
- ## Installation
9
+ ## Installazione
10
10
 
11
11
  ```bash
12
12
  npm i -D @massimo-cassandro/create-favicons
13
13
  ```
14
14
 
15
- ## Creating template config files (see below)
15
+ ## Creazione dei file di configurazione di esempio (vedi sotto)
16
16
 
17
17
  ```bash
18
18
  npx create-favicons init
19
19
  ```
20
20
 
21
- ## Usage
21
+ ## Utilizzo
22
22
 
23
23
  ```bash
24
24
  npx create-favicons [--dir=./path/to/dir]
25
25
  ```
26
26
 
27
- The script normally runs in the current directory, but using the optional `--dir` parameter,
28
- you can specify an alternative directory (path relative to the execution directory).
27
+ Lo script viene normalmente eseguito nella directory corrente, ma con il parametro opzionale `--dir`
28
+ si può indicare una directory alternativa (percorso relativo alla directory di esecuzione).
29
29
 
30
- The script first searches the working directory for the `create-favicons-cfg.mjs` file, which contains an object
31
- with all the necessary parameters (see below).
30
+ Lo script cerca prima nella directory di lavoro il file `create-favicons-cfg.mjs`, che contiene un oggetto
31
+ con tutti i parametri necessari (vedi sotto).
32
32
 
33
- If it's missing, it searches for the `favicon-src.svg` file to use as the source for all images, assuming the default values ​​(see below) for all other parameters.
33
+ Se manca, cerca il file `favicon-src.svg` da usare come sorgente per tutte le immagini, assumendo i valori di default (vedi sotto) per tutti gli altri parametri.
34
34
 
35
- Among others, you can specify the `small_src_img` parameter if you need to specify an image optimized for small dimensions (32px).
35
+ Tra gli altri, si può indicare il parametro `small_src_img` se serve un'immagine ottimizzata per le dimensioni ridotte (32px).
36
36
 
37
- The best format for source files is SVG, or alternatively PNG/JPEG/WEBP/GIF/TIFF/AVIF.
37
+ Il formato migliore per i file sorgente è SVG, oppure PNG/JPEG/WEBP/GIF/TIFF/AVIF.
38
38
 
39
- If both files are missing, an error is returned.
39
+ Se entrambi i file mancano, viene restituito un errore.
40
40
 
41
- The default parameters are listed in detail in the file `src/create-favicons/src/default-params.mjs`,
42
- and can be customized in the configuration file, which must have this form:
41
+ I parametri di default sono elencati in dettaglio nel file `src/create-favicons/src/default-params.mjs`
42
+ e possono essere personalizzati nel file di configurazione, che deve avere questa forma:
43
43
 
44
44
  ```javascript
45
45
  // file create-favicons-cfg.mjs
@@ -48,38 +48,38 @@ const params = [{ /* ... */ }];
48
48
  export default params;
49
49
  ```
50
50
 
51
- `params` can be an object or an array. In the latter case, each element of the array corresponds to a different set of favicons.
51
+ `params` può essere un oggetto o un array. Nel secondo caso, ogni elemento dell'array corrisponde a un set di favicon diverso.
52
52
 
53
- To create a sample cfg file **in the current directory** (with all default values ​​and their descriptions),
54
- use the command:
53
+ Per creare un file cfg di esempio **nella directory corrente** (con tutti i valori di default e le relative descrizioni),
54
+ usare il comando:
55
55
 
56
56
  ```bash
57
57
  npx create-favicons init
58
58
  ```
59
59
 
60
- ## Remote Use
60
+ ## Uso remoto
61
61
 
62
- The commands can also be run without first installing the package:
62
+ I comandi possono essere eseguiti anche senza installare prima il pacchetto:
63
63
 
64
64
  ```
65
65
  npx --package=@massimo-cassandro/dev-utilities create-favicons init
66
66
  npx --package=@massimo-cassandro/dev-utilities create-favicons [--dir=...]
67
67
  ```
68
68
 
69
- ## Execution
69
+ ## Esecuzione
70
70
 
71
- The script produces the various png and svg images, the `manifest.webmanifest` file, and an HTML snippet (or in the language specified in the `snippet_language` parameter).
72
- All images are optimized with [SVGO](https://github.com/svg/svgo) and [imagemin](https://github.com/imagemin/imagemin).
71
+ Lo script produce le varie immagini png e svg, il file `manifest.webmanifest` e uno snippet HTML (o nel linguaggio indicato nel parametro `snippet_language`).
72
+ Tutte le immagini vengono ottimizzate con [SVGO](https://github.com/svg/svgo) e [imagemin](https://github.com/imagemin/imagemin).
73
73
 
74
- All files are saved in the directory specified in `output_dir` (default: current directory).
74
+ Tutti i file vengono salvati nella directory indicata in `output_dir` (default: directory corrente).
75
75
 
76
- Optionally, the snippet file can be saved in a different directory (`snippet_path`) or you can choose not to create it,
77
- by setting the `snippet_name` value to `null`.
76
+ Facoltativamente, il file dello snippet può essere salvato in una directory diversa (`snippet_path`) oppure si può scegliere di non crearlo,
77
+ impostando il valore `snippet_name` a `null`.
78
78
 
79
- In the configuration file, you can also set the `webmanifest_extra` parameter, which allows you to add additional entries to the *manifest* file.
80
- For more info: <https://developer.mozilla.org/en-US/docs/Web/Manifest>
79
+ Nel file di configurazione si può impostare anche il parametro `webmanifest_extra`, che permette di aggiungere ulteriori voci al file *manifest*.
80
+ Per maggiori informazioni: <https://developer.mozilla.org/en-US/docs/Web/Manifest>
81
81
 
82
- Files generated:
82
+ File generati:
83
83
 
84
84
  ```html
85
85
  <link rel="icon" href="/favicon.ico" sizes="any"> <!-- 32×32 + 16x16 -->
@@ -98,4 +98,4 @@ Files generated:
98
98
  }
99
99
  ```
100
100
 
101
- See also demo files
101
+ Vedi anche i file della demo
@@ -10,8 +10,8 @@ export async function createIco(params) {
10
10
  `${params.output_dir}/favicon.ico`,
11
11
  {
12
12
  sizes: [16, 32],
13
- // sizes: "default", // equal to [256, 128, 64, 48, 32, 24, 16]
14
- resizeOptions: {}, // sharp resize optinos
13
+ // sizes: "default", // equivale a [256, 128, 64, 48, 32, 24, 16]
14
+ resizeOptions: {}, // opzioni di resize di sharp
15
15
  }
16
16
  );
17
17
 
@@ -32,7 +32,7 @@ export const default_params = {
32
32
  // }
33
33
  webmanifest_extra: null,
34
34
 
35
- // if true, all files linked in manifest will end with
35
+ // se true, tutti i file collegati nel manifest terminano con
36
36
  // '?_=[hash]'
37
37
  webmanifest_add_hash_to_files: true,
38
38
 
@@ -9,7 +9,7 @@ import { remove_homedir_string } from './remove-homedir-string.mjs';
9
9
 
10
10
  export function init() {
11
11
  // const __filename = new URL('', import.meta.url).pathname;
12
- // Will contain trailing slash
12
+ // conterrà lo slash finale
13
13
  const src_dir = new URL('.', import.meta.url).pathname,
14
14
  cfg_sample_file = process.cwd() + '/create-favicons-cfg.mjs';
15
15