@massimo-cassandro/minimo 1.29.3 → 1.29.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.
- package/dev-tools/starter-kit/package-tpl.json +7 -7
- package/dev-tools/starter-kit/source_files/__project__.code-workspace +50 -0
- package/dev-tools/starter-kit/source_files/favicons-readme.md +5 -0
- package/dev-tools/starter-kit/starter-install.sh +118 -221
- package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/postcss.config.mjs +2 -2
- package/dev-tools/starter-kit/webpack-template.ejs +2 -2
- package/dev-tools/starter-kit/webpack.config.mjs +36 -37
- package/package.json +2 -2
- package/src/components/modal-popup/modal-popup.js +17 -6
- package/src/components/modal-popup/modal-popup.minimo.tokens.mjs +1 -1
- package/src/custom-properties.css +1 -1
- package/src/minimo.css +3 -3
- package/dev-tools/starter-kit/templates/__project__.code-workspace +0 -94
- package/dev-tools/starter-kit/templates/favicons-readme.md +0 -5
- /package/dev-tools/starter-kit/{templates → source_files}/CLAUDE-frontend.md +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/_browserslistrc +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/_editorconfig +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/_gitignore +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/_prettierrc +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/_root_htaccess +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/_root_robots.txt +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/app_index.js +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/eslint.config.mjs +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/jsconfig.json +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/layout-critical.css +0 -0
- /package/dev-tools/starter-kit/{templates → source_files}/stylelint.config.mjs +0 -0
- /package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/css-rules.mjs +0 -0
- /package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/get-jsConfig-aliases.mjs +0 -0
- /package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/mini-svg-data-uri-loader.cjs +0 -0
- /package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/purgecss-setup.mjs +0 -0
- /package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/purgecss-variables-safelist.mjs +0 -0
- /package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/svg-rules.mjs +0 -0
- /package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/svgo.config.mjs +0 -0
|
@@ -17,21 +17,21 @@
|
|
|
17
17
|
"*.avif"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"progetto JS webpack DEV": "npm 'launchChrome' && NODE_ENV=development webpack serve --config ./webpack.config.mjs #--open-app-name 'Google Chrome'",
|
|
21
|
-
"progetto sf webpack DEV": "rm -rf ./public/_dev && NODE_ENV=development webpack --config ./
|
|
20
|
+
"progetto JS webpack DEV": "npm run 'launchChrome' && NODE_ENV=development webpack serve --config ./webpack.config.mjs #--open-app-name 'Google Chrome'",
|
|
21
|
+
"progetto sf webpack DEV": "rm -rf ./public/_dev && NODE_ENV=development webpack --config ./webpack.config.mjs",
|
|
22
22
|
"webpack PROD": "npm run 'UPD-version' && NODE_ENV=production webpack --config ./webpack.config.mjs --stats minimal",
|
|
23
|
-
"eslint-check": "npx eslint app/
|
|
23
|
+
"eslint-check": "npx eslint app/",
|
|
24
24
|
"create-favicons INIT": "npx create-favicons init",
|
|
25
|
-
"create-favicons": "npx create-favicons --dir=./
|
|
26
|
-
"UPD-version": "npx update-version --no-log-v0
|
|
25
|
+
"create-favicons": "npx create-favicons --dir=./app/favicons",
|
|
26
|
+
"UPD-version": "npx update-version --no-log-v0 --log-file=./changelog.md # --log-patch --pkg=alt/path/to/package.json",
|
|
27
27
|
"upd@m": "npx upd@m",
|
|
28
28
|
"launchChrome": "open -n -a 'Google Chrome' --args --profile-directory='Profile 3'",
|
|
29
29
|
"python server": "python3 -m http.server 8000 # --directory __dirname__ # 8000 = default port",
|
|
30
30
|
"php server": "php -S localhost:8000 # -t root_dir/",
|
|
31
31
|
"symfony server": "symfony serve --port=810X --listen-ip=0.0.0.0 # http://192.168.1.135:810X # -d (deamon): rimane aperto anche dopo la chiusura del terminale, terminare con `symfony server:stop`",
|
|
32
32
|
"node server": "node serve # richiede ‘npm i serve’",
|
|
33
|
-
"build tokens": "npx buildTokens --config ./
|
|
34
|
-
"check unresolved props": "npx checkUnresolvedProps --config ./
|
|
33
|
+
"build tokens": "npx buildTokens --config ./app/css/tokens-config.mjs",
|
|
34
|
+
"check unresolved props": "npx checkUnresolvedProps --config ./app/css/tokens-config.mjs",
|
|
35
35
|
"npm-outdated": "npm outdated",
|
|
36
36
|
"npm-upd": "npm update --save"
|
|
37
37
|
},
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"folders": [
|
|
3
|
+
{
|
|
4
|
+
"path": "."
|
|
5
|
+
}
|
|
6
|
+
],
|
|
7
|
+
"settings": {
|
|
8
|
+
|
|
9
|
+
"cssvar.files": [
|
|
10
|
+
"app/css/custom-properties.css",
|
|
11
|
+
|
|
12
|
+
// OPEN PROPS
|
|
13
|
+
// "./node_modules/open-props/open-props.min.css", // all open-props
|
|
14
|
+
|
|
15
|
+
],
|
|
16
|
+
// Do not ignore node_modules css files, which is ignored by default
|
|
17
|
+
// "cssvar.ignore": [], // decomment if you are using open props
|
|
18
|
+
|
|
19
|
+
// add support for autocomplete in JS or JS like files
|
|
20
|
+
"cssvar.extensions": [
|
|
21
|
+
"css", "postcss", "jsx", "tsx", "scss"
|
|
22
|
+
],
|
|
23
|
+
|
|
24
|
+
"favorites.resources": [
|
|
25
|
+
{
|
|
26
|
+
"filePath": "node_modules/@fontsource-variable",
|
|
27
|
+
"group": "Default"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"filePath": "node_modules/@fontsource",
|
|
31
|
+
"group": "Default"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"filePath": "node_modules/@massimo-cassandro",
|
|
35
|
+
"group": "Default"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"filePath": "node_modules/open-props",
|
|
39
|
+
"group": "Default"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
"bootstrapIntelliSense": {
|
|
44
|
+
"enable": false,
|
|
45
|
+
"bsVersion": "5.3.7",
|
|
46
|
+
"showSuggestions": false,
|
|
47
|
+
"autoComplete": false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -18,285 +18,182 @@ if [ -z "$ZSH_VERSION" ]; then
|
|
|
18
18
|
exit 1
|
|
19
19
|
fi
|
|
20
20
|
|
|
21
|
-
# --no-npm: salta le installazioni npm (utile per testare rapidamente lo script)
|
|
22
|
-
# --root / --frontend / --app: posizione della configurazione frontend (salta
|
|
23
|
-
# il prompt, utile per esecuzioni non interattive)
|
|
24
|
-
SKIP_NPM=0
|
|
25
|
-
FRONTEND_CHOICE=""
|
|
26
|
-
for ARG in "$@"; do
|
|
27
|
-
case "$ARG" in
|
|
28
|
-
--no-npm) SKIP_NPM=1 ;;
|
|
29
|
-
--root) FRONTEND_CHOICE=1 ;;
|
|
30
|
-
--frontend) FRONTEND_CHOICE=2 ;;
|
|
31
|
-
--app) FRONTEND_CHOICE=3 ;;
|
|
32
|
-
esac
|
|
33
|
-
done
|
|
34
|
-
|
|
35
|
-
# Wrapper: esegue "npm i ..." a meno che SKIP_NPM sia attivo
|
|
36
|
-
npm_i() {
|
|
37
|
-
if [ "$SKIP_NPM" = "1" ]; then
|
|
38
|
-
echo "(--no-npm) skip: npm i $*"
|
|
39
|
-
else
|
|
40
|
-
npm i "$@"
|
|
41
|
-
fi
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
# Configurazione variabili
|
|
45
|
-
# BASE_URL="https://raw.githubusercontent.com/massimo-cassandro/minimo/refs/heads/main"
|
|
46
|
-
|
|
47
|
-
# in locale: cat ....
|
|
48
|
-
# da remoto curl -s
|
|
49
|
-
|
|
50
|
-
# %:A risolve il percorso assoluto (anche con link simbolici)
|
|
51
|
-
# %:h estrae l'header (ovvero la directory, come 'dirname')
|
|
52
21
|
BASE_URL=${0:A:h}
|
|
53
22
|
|
|
54
23
|
echo "BASE_URL: ${BASE_URL}"
|
|
55
24
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
25
|
+
SOURCE_FILES_DIR="${BASE_URL}/source_files"
|
|
26
|
+
|
|
27
|
+
# webpack
|
|
28
|
+
WEBPACK_CONFIG_SOURCE_PATH="$BASE_URL"
|
|
29
|
+
WEBPACK_MODULES_SOURCE_PATH="${BASE_URL}/webpack-config-modules"
|
|
30
|
+
WEBPACK_MODULES_INSTALL_PATH="./webpack-config-modules"
|
|
59
31
|
|
|
60
32
|
# protezione contro la sovrascrittura
|
|
61
33
|
set -C
|
|
62
34
|
|
|
63
|
-
# Array per tracciare i file già esistenti
|
|
64
|
-
BLOCKED_FILES=()
|
|
65
35
|
|
|
66
|
-
# Wrapper: copia
|
|
67
|
-
# Con terzo argomento "new", se la destinazione esiste già la copia viene
|
|
68
|
-
# comunque creata con prefisso NEW- (da integrare manualmente o rimuovere).
|
|
69
|
-
# Con terzo argomento "underscore", stesso comportamento ma con prefisso _
|
|
70
|
-
# (usato per package.json e *.code-workspace: il file esistente non viene
|
|
71
|
-
# toccato, il template arriva accanto con un _ davanti al nome, da integrare
|
|
72
|
-
# o rimuovere manualmente)
|
|
36
|
+
# Wrapper: copia il file, se esiste viene copiato con prefisso NEW- (da integrare manualmente o rimuovere).
|
|
73
37
|
safe_cat() {
|
|
74
38
|
local src="$1"
|
|
75
39
|
local dest="$2"
|
|
76
|
-
local mode="$3"
|
|
77
40
|
if [ ! -f "$src" ]; then
|
|
78
41
|
echo -e "${RED}Sorgente mancante: $src${NC}"
|
|
79
42
|
return 1
|
|
80
43
|
fi
|
|
81
44
|
if [ -e "$dest" ]; then
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
local new_dest="$(dirname "$dest")/NEW-$(basename "$dest")"
|
|
85
|
-
cat "$src" >| "$new_dest"
|
|
86
|
-
BLOCKED_FILES+=("$dest → copiato come $new_dest")
|
|
87
|
-
;;
|
|
88
|
-
underscore)
|
|
89
|
-
local new_dest="$(dirname "$dest")/_$(basename "$dest")"
|
|
90
|
-
cat "$src" >| "$new_dest"
|
|
91
|
-
BLOCKED_FILES+=("$dest → copiato come $new_dest")
|
|
92
|
-
;;
|
|
93
|
-
*)
|
|
94
|
-
BLOCKED_FILES+=("$dest")
|
|
95
|
-
;;
|
|
96
|
-
esac
|
|
45
|
+
local new_dest="$(dirname "$dest")/NEW-$(basename "$dest")"
|
|
46
|
+
cat "$src" >| "$new_dest"
|
|
97
47
|
else
|
|
98
48
|
cat "$src" > "$dest"
|
|
99
49
|
fi
|
|
100
50
|
}
|
|
101
51
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if [ -n "$FRONTEND_CHOICE" ]; then
|
|
109
|
-
choice="$FRONTEND_CHOICE"
|
|
110
|
-
else
|
|
111
|
-
echo -e "\n${GREEN}Where do you want to install the frontend configuration?${NC}"
|
|
112
|
-
echo "1) Root directory"
|
|
113
|
-
echo "2) 'frontend' Directory"
|
|
114
|
-
echo "3) 'app' Directory"
|
|
115
|
-
read "?Choose (1, 2 or 3) [default: 2]: " choice < /dev/tty
|
|
116
|
-
choice=${choice:-2}
|
|
117
|
-
fi
|
|
118
|
-
|
|
119
|
-
if [ "$choice" = "1" ]; then
|
|
120
|
-
FRONTEND_INSTALL_PATH="."
|
|
121
|
-
echo -e "${GREEN}Files will be installed in: root directory${NC}"
|
|
122
|
-
elif [ "$choice" = "3" ]; then
|
|
123
|
-
FRONTEND_INSTALL_PATH="./app"
|
|
124
|
-
echo -e "${GREEN}Files will be installed in: ./app${NC}"
|
|
125
|
-
else
|
|
126
|
-
FRONTEND_INSTALL_PATH="./frontend"
|
|
127
|
-
echo -e "${GREEN}Files will be installed in: ./frontend${NC}"
|
|
128
|
-
fi
|
|
129
|
-
|
|
130
|
-
if [ "$FRONTEND_INSTALL_PATH" != "." ]; then
|
|
131
|
-
mkdir -p "$FRONTEND_INSTALL_PATH"
|
|
132
|
-
fi
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
echo -e "\n${GREEN}...config files & utilities${NC}"
|
|
136
|
-
|
|
137
|
-
safe_cat "${TEMPLATES_DIR}/_browserslistrc" .browserslistrc new
|
|
138
|
-
safe_cat "${TEMPLATES_DIR}/_editorconfig" .editorconfig new
|
|
139
|
-
safe_cat "${TEMPLATES_DIR}/_prettierrc" .prettierrc new
|
|
140
|
-
safe_cat "${TEMPLATES_DIR}/_root_htaccess" "${FRONTEND_INSTALL_PATH}/_root_htaccess"
|
|
141
|
-
safe_cat "${TEMPLATES_DIR}/_root_robots.txt" "${FRONTEND_INSTALL_PATH}/_root_robots.txt"
|
|
142
|
-
safe_cat "${TEMPLATES_DIR}/CLAUDE-frontend.md" "${FRONTEND_INSTALL_PATH}/CLAUDE.md"
|
|
143
|
-
|
|
144
|
-
# jsconfig.json: sta SEMPRE nella root del progetto (è anche il file di
|
|
145
|
-
# riferimento di vscode). I suoi path sono quindi relativi alla root: il
|
|
146
|
-
# placeholder __FRONTEND__ viene risolto in base alla posizione scelta.
|
|
147
|
-
# NB: webpack.config.mjs lo cerca in root anche quando è in una sottodirectory
|
|
148
|
-
if [ "$FRONTEND_INSTALL_PATH" = "." ]; then
|
|
149
|
-
FRONTEND_REL="./"
|
|
150
|
-
else
|
|
151
|
-
FRONTEND_REL="${FRONTEND_INSTALL_PATH}/"
|
|
152
|
-
fi
|
|
153
|
-
JSCONFIG_TPL="${TEMPLATES_DIR}/jsconfig.json"
|
|
154
|
-
if [ ! -f "$JSCONFIG_TPL" ]; then
|
|
155
|
-
echo -e "${RED}Sorgente mancante: ${JSCONFIG_TPL}${NC}"
|
|
156
|
-
else
|
|
157
|
-
JSCONFIG_TMP="$(mktemp)"
|
|
158
|
-
sed "s|__FRONTEND__|${FRONTEND_REL}|g" "$JSCONFIG_TPL" >| "$JSCONFIG_TMP"
|
|
159
|
-
safe_cat "$JSCONFIG_TMP" jsconfig.json new
|
|
160
|
-
rm -f "$JSCONFIG_TMP"
|
|
161
|
-
fi
|
|
162
|
-
|
|
163
|
-
# code-workspace: se un file .code-workspace esiste già (qualunque sia il nome),
|
|
164
|
-
# il template viene copiato accanto con un _ davanti al nome esistente
|
|
165
|
-
WORKSPACE_TPL="${TEMPLATES_DIR}/__project__.code-workspace"
|
|
166
|
-
WORKSPACE_FILES=( *.code-workspace(N) )
|
|
167
|
-
if [ ${#WORKSPACE_FILES[@]} -gt 1 ]; then
|
|
168
|
-
echo -e "${RED}Trovati più file .code-workspace (${WORKSPACE_FILES[*]}): copia saltata${NC}"
|
|
169
|
-
elif [ ${#WORKSPACE_FILES[@]} -eq 0 ]; then
|
|
170
|
-
safe_cat "$WORKSPACE_TPL" __project__.code-workspace
|
|
171
|
-
else
|
|
172
|
-
safe_cat "$WORKSPACE_TPL" "${WORKSPACE_FILES[1]}" underscore
|
|
52
|
+
FRONTEND_INSTALL_PATH="./app"
|
|
53
|
+
# se la cartella esiste già, i moduli vengono copiati in NEW-webpack-modules
|
|
54
|
+
# (da integrare manualmente o rimuovere)
|
|
55
|
+
if [ -d "$FRONTEND_INSTALL_PATH" ]; then
|
|
56
|
+
FRONTEND_INSTALL_PATH="./NEW-$(basename "$FRONTEND_INSTALL_PATH")"
|
|
173
57
|
fi
|
|
174
58
|
|
|
59
|
+
echo -e "${GREEN}Files will be installed in: '${FRONTEND_INSTALL_PATH}'${NC}"
|
|
60
|
+
mkdir -p "${FRONTEND_INSTALL_PATH}"
|
|
175
61
|
|
|
176
|
-
echo -e "\n${GREEN}...minimo${NC}"
|
|
177
|
-
npm_i -S @massimo-cassandro/minimo
|
|
178
62
|
|
|
179
|
-
echo -e "\n${GREEN}...eslint${NC}"
|
|
180
|
-
npm_i -D @massimo-cassandro/eslint-config
|
|
181
|
-
safe_cat "${TEMPLATES_DIR}/eslint.config.mjs" eslint.config.mjs new
|
|
182
63
|
|
|
183
|
-
echo -e "
|
|
184
|
-
|
|
185
|
-
safe_cat "${
|
|
64
|
+
echo -e "${GREEN}...ROOT FILES${NC}"
|
|
65
|
+
safe_cat "${BASE_URL}/package-tpl.json" package.json
|
|
66
|
+
safe_cat "${WEBPACK_CONFIG_SOURCE_PATH}/webpack.config.mjs" webpack.config.mjs
|
|
186
67
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
npm_i -D mini-css-extract-plugin style-loader css-loader css-minimizer-webpack-plugin
|
|
196
|
-
npm_i -D responsive-loader
|
|
197
|
-
npm_i -D process dotenv-webpack
|
|
198
|
-
npm_i -D svgo svg-url-loader svgo-loader svgo-add-viewbox mini-svg-data-uri
|
|
199
|
-
npm_i -D ejs-loader
|
|
200
|
-
npm_i -D purgecss-webpack-plugin glob
|
|
68
|
+
safe_cat "${SOURCE_FILES_DIR}/_gitignore" .gitignore
|
|
69
|
+
safe_cat "${SOURCE_FILES_DIR}/_browserslistrc" .browserslistrc
|
|
70
|
+
safe_cat "${SOURCE_FILES_DIR}/_editorconfig" .editorconfig
|
|
71
|
+
safe_cat "${SOURCE_FILES_DIR}/_prettierrc" .prettierrc
|
|
72
|
+
safe_cat "${SOURCE_FILES_DIR}/jsconfig.json" jsconfig.json
|
|
73
|
+
safe_cat "${SOURCE_FILES_DIR}/__project__.code-workspace" __project__.code-workspace
|
|
74
|
+
safe_cat "${SOURCE_FILES_DIR}/eslint.config.mjs" eslint.config.mjs
|
|
75
|
+
safe_cat "${SOURCE_FILES_DIR}/stylelint.config.mjs" stylelint.config.mjs
|
|
201
76
|
|
|
202
|
-
|
|
77
|
+
echo -e "${GREEN}...APP FILES${NC}"
|
|
78
|
+
safe_cat "${SOURCE_FILES_DIR}/_root_htaccess" "${FRONTEND_INSTALL_PATH}/_root_htaccess"
|
|
79
|
+
safe_cat "${SOURCE_FILES_DIR}/_root_robots.txt" "${FRONTEND_INSTALL_PATH}/_root_robots.txt"
|
|
80
|
+
safe_cat "${SOURCE_FILES_DIR}/CLAUDE-frontend.md" "${FRONTEND_INSTALL_PATH}/CLAUDE.md"
|
|
81
|
+
safe_cat "${WEBPACK_CONFIG_SOURCE_PATH}/webpack-template.ejs" "${FRONTEND_INSTALL_PATH}/tpl/index.ejs"
|
|
203
82
|
|
|
204
|
-
safe_cat "${WEBPACK_SOURCE_DIR}/webpack.config.mjs" "${FRONTEND_INSTALL_PATH}/webpack.config.mjs"
|
|
205
|
-
|
|
206
|
-
# cartella webpack
|
|
207
|
-
WEBPACK_LOCAL_DIR="${FRONTEND_INSTALL_PATH}/webpack-modules"
|
|
208
|
-
WEBPACK_MODULES_REMOTE_URL="${WEBPACK_SOURCE_DIR}/webpack-modules"
|
|
209
83
|
|
|
84
|
+
echo -e "${GREEN}..WEBPACK CONFIG MODULES${NC}"
|
|
210
85
|
# se la cartella esiste già, i moduli vengono copiati in NEW-webpack-modules
|
|
211
86
|
# (da integrare manualmente o rimuovere)
|
|
212
|
-
if [ -d "$
|
|
213
|
-
|
|
214
|
-
BLOCKED_FILES+=("$WEBPACK_LOCAL_DIR → copiata come $NEW_WEBPACK_LOCAL_DIR")
|
|
215
|
-
WEBPACK_LOCAL_DIR="$NEW_WEBPACK_LOCAL_DIR"
|
|
87
|
+
if [ -d "$WEBPACK_MODULES_INSTALL_PATH" ]; then
|
|
88
|
+
WEBPACK_MODULES_INSTALL_PATH="./NEW-$(basename "$WEBPACK_MODULES_INSTALL_PATH")"
|
|
216
89
|
fi
|
|
217
90
|
|
|
218
|
-
mkdir -p "$
|
|
91
|
+
mkdir -p "$WEBPACK_MODULES_INSTALL_PATH"
|
|
219
92
|
|
|
220
93
|
# copia tutti i file presenti in webpack-modules,
|
|
221
|
-
for FILE in "${
|
|
94
|
+
for FILE in "${WEBPACK_MODULES_SOURCE_PATH}"/*; do
|
|
222
95
|
[ -f "$FILE" ] || continue
|
|
223
|
-
safe_cat "$FILE" "${
|
|
96
|
+
safe_cat "$FILE" "${WEBPACK_MODULES_INSTALL_PATH}/$(basename "$FILE")"
|
|
97
|
+
done
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
echo -e "\n${GREEN}...NODE MODULES${NC}"
|
|
101
|
+
|
|
102
|
+
dependencies=(
|
|
103
|
+
@massimo-cassandro/minimo
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
devDependencies=(
|
|
107
|
+
@massimo-cassandro/eslint-config
|
|
108
|
+
@massimo-cassandro/stylelint-config
|
|
109
|
+
|
|
110
|
+
@babel/core
|
|
111
|
+
@babel/preset-env
|
|
112
|
+
@csstools/postcss-global-data
|
|
113
|
+
autoprefixer
|
|
114
|
+
babel-loader
|
|
115
|
+
copy-webpack-plugin
|
|
116
|
+
css-loader
|
|
117
|
+
css-minimizer-webpack-plugin
|
|
118
|
+
ejs-loader
|
|
119
|
+
glob
|
|
120
|
+
html-loader
|
|
121
|
+
html-webpack-plugin
|
|
122
|
+
mini-css-extract-plugin
|
|
123
|
+
mini-svg-data-uri
|
|
124
|
+
postcss
|
|
125
|
+
postcss-custom-media
|
|
126
|
+
postcss-loader
|
|
127
|
+
postcss-preset-env
|
|
128
|
+
process
|
|
129
|
+
purgecss-webpack-plugin
|
|
130
|
+
responsive-loader
|
|
131
|
+
style-dictionary
|
|
132
|
+
style-loader
|
|
133
|
+
svg-url-loader
|
|
134
|
+
svgo
|
|
135
|
+
svgo-add-viewbox
|
|
136
|
+
svgo-loader
|
|
137
|
+
terser-webpack-plugin
|
|
138
|
+
webpack
|
|
139
|
+
webpack-cli
|
|
140
|
+
webpack-dev-server
|
|
141
|
+
webpack-manifest-plugin
|
|
142
|
+
webpack-remove-empty-scripts
|
|
143
|
+
|
|
144
|
+
# da installare solo se necessari
|
|
145
|
+
# dotenv-webpack
|
|
146
|
+
# @principalstudio/html-webpack-inject-preload file-loader
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
for pkg in "${dependencies[@]}"; do
|
|
150
|
+
npm i -S "$pkg"
|
|
224
151
|
done
|
|
225
152
|
|
|
226
|
-
|
|
153
|
+
for pkg in "${devDependencies[@]}"; do
|
|
154
|
+
npm i -S "$pkg"
|
|
155
|
+
done
|
|
227
156
|
|
|
228
|
-
|
|
229
|
-
# i percorsi attesi da webpack.config.mjs (`./src/...`, `./favicons/output`,
|
|
230
|
-
# `./error-pages/...`), da jsconfig.json (@css, @src, @icons, @imgs) e da
|
|
231
|
-
# postcss.config.mjs (`../src/css/custom-media.css`)
|
|
157
|
+
echo -e "\n${GREEN}...creating default folders${NC}"
|
|
232
158
|
mkdir -p \
|
|
233
|
-
"${FRONTEND_INSTALL_PATH}/src
|
|
234
|
-
"${FRONTEND_INSTALL_PATH}/
|
|
159
|
+
"${FRONTEND_INSTALL_PATH}/src" \
|
|
160
|
+
"${FRONTEND_INSTALL_PATH}/css" \
|
|
161
|
+
"${FRONTEND_INSTALL_PATH}/tpl" \
|
|
235
162
|
"${FRONTEND_INSTALL_PATH}/icons" \
|
|
236
163
|
"${FRONTEND_INSTALL_PATH}/imgs" \
|
|
237
164
|
"${FRONTEND_INSTALL_PATH}/favicons" \
|
|
238
165
|
"${FRONTEND_INSTALL_PATH}/error-pages"
|
|
239
166
|
|
|
240
|
-
# template html di webpack (HtmlWebpackPlugin: `./src/tpl/index.ejs`)
|
|
241
|
-
safe_cat "${WEBPACK_SOURCE_DIR}/webpack-template.ejs" "${FRONTEND_INSTALL_PATH}/src/tpl/index.ejs"
|
|
242
167
|
|
|
168
|
+
echo -e "${GREEN}...MINIMO FILES${NC}"
|
|
243
169
|
# Sorgenti di minimo da copiare nel progetto: si usa il pacchetto appena
|
|
244
|
-
# installato in node_modules (stessa versione che userà il progetto)
|
|
245
|
-
|
|
246
|
-
MINIMO_PKG_DIR=""
|
|
247
|
-
for CANDIDATE in "./node_modules/@massimo-cassandro/minimo" "${BASE_URL}/../.."; do
|
|
248
|
-
if [ -f "${CANDIDATE}/src/custom-properties.css" ]; then
|
|
249
|
-
MINIMO_PKG_DIR="$CANDIDATE"
|
|
250
|
-
break
|
|
251
|
-
fi
|
|
252
|
-
done
|
|
170
|
+
# installato in node_modules (stessa versione che userà il progetto)
|
|
171
|
+
MINIMO_PKG_DIR=./node_modules/@massimo-cassandro/minimo
|
|
253
172
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
BLOCKED_FILES+=("css di base + index.css + tokens-config.mjs + create-favicons-cfg.mjs → saltati (--no-npm)")
|
|
258
|
-
else
|
|
259
|
-
echo -e "${RED}Sorgenti di minimo non trovati (né in ./node_modules/@massimo-cassandro/minimo né in ${BASE_URL}/../..): css di base, index.css, tokens-config e config favicons non copiati${NC}"
|
|
260
|
-
BLOCKED_FILES+=("css di base + index.css + tokens-config.mjs + create-favicons-cfg.mjs → sorgenti minimo non trovati")
|
|
261
|
-
fi
|
|
262
|
-
else
|
|
263
|
-
echo "sorgenti minimo: ${MINIMO_PKG_DIR}"
|
|
173
|
+
safe_cat "${MINIMO_PKG_DIR}/src/custom-properties.css" "${FRONTEND_INSTALL_PATH}/css/${FILE}"
|
|
174
|
+
safe_cat "${MINIMO_PKG_DIR}/src/custom-media.css" "${FRONTEND_INSTALL_PATH}/css/${FILE}"
|
|
175
|
+
safe_cat "${MINIMO_PKG_DIR}/src/fonts.css" "${FRONTEND_INSTALL_PATH}/css/${FILE}"
|
|
264
176
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
safe_cat "${MINIMO_PKG_DIR}/src/${FILE}" "${FRONTEND_INSTALL_PATH}/src/css/${FILE}"
|
|
268
|
-
done
|
|
177
|
+
# config di build-tokens: collocato accanto al css generato (custom-properties.css).
|
|
178
|
+
safe_cat "${MINIMO_PKG_DIR}/design-tokens/tokens-config-sample.mjs" "${FRONTEND_INSTALL_PATH}/css/tokens-config.mjs"
|
|
269
179
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
180
|
+
# entry css principale del progetto: copia diretta di minimo.css, rinominato
|
|
181
|
+
# index.css e collocato sulla root di installazione (non in /src)
|
|
182
|
+
safe_cat "${MINIMO_PKG_DIR}/src/minimo.css" "${FRONTEND_INSTALL_PATH}/index.css"
|
|
273
183
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
184
|
+
# favicons: config di default per `npx create-favicons`
|
|
185
|
+
safe_cat "${MINIMO_PKG_DIR}/dev-tools/create-favicons/src/default-params.mjs" "${FRONTEND_INSTALL_PATH}/favicons/create-favicons-cfg.mjs"
|
|
186
|
+
# favicons: istruzioni d'uso di `npx create-favicons`
|
|
187
|
+
safe_cat "${SOURCE_FILES_DIR}/favicons-readme.md" "${FRONTEND_INSTALL_PATH}/favicons/readme.md"
|
|
277
188
|
|
|
278
|
-
# favicons: config di default per `npx create-favicons`
|
|
279
|
-
safe_cat "${MINIMO_PKG_DIR}/dev-tools/create-favicons/src/default-params.mjs" "${FRONTEND_INSTALL_PATH}/favicons/create-favicons-cfg.mjs"
|
|
280
|
-
fi
|
|
281
189
|
|
|
282
190
|
# entry css critical (inline nei template html) e entry js, sulla root di
|
|
283
191
|
# installazione accanto a index.css
|
|
284
|
-
safe_cat "${
|
|
285
|
-
safe_cat "${TEMPLATES_DIR}/app_index.js" "${FRONTEND_INSTALL_PATH}/index.js"
|
|
192
|
+
safe_cat "${SOURCE_FILES_DIR}/app_index.js" "${FRONTEND_INSTALL_PATH}/index.js"
|
|
286
193
|
|
|
287
|
-
#
|
|
288
|
-
safe_cat "${
|
|
194
|
+
# layout critical css
|
|
195
|
+
safe_cat "${SOURCE_FILES_DIR}/layout-critical.css" "${FRONTEND_INSTALL_PATH}/css/layout-critical.css"
|
|
289
196
|
|
|
290
|
-
set +C
|
|
291
|
-
|
|
292
|
-
# Riepilogo finale dei file già esistenti
|
|
293
|
-
if [ ${#BLOCKED_FILES[@]} -gt 0 ]; then
|
|
294
|
-
echo -e "\n${YELLOW}*** File già esistenti (non copiati o copiati con prefisso NEW-/_): ***${NC}"
|
|
295
|
-
for F in "${BLOCKED_FILES[@]}"; do
|
|
296
|
-
echo -e "${YELLOW} ✗ $F${NC}"
|
|
297
|
-
done
|
|
298
|
-
else
|
|
299
|
-
echo -e "\n${GREEN}Nessun file bloccato.${NC}"
|
|
300
|
-
fi
|
|
301
197
|
|
|
198
|
+
set +C
|
|
302
199
|
echo -e "\n\n${GREEN}*** END ***${NC}"
|
|
@@ -29,13 +29,13 @@ export default (loaderContext) => {
|
|
|
29
29
|
// in ogni asset e interferirebbe con il purge, vedi sopra)
|
|
30
30
|
globalData({
|
|
31
31
|
files: [
|
|
32
|
-
path.resolve(__dirname, '../
|
|
32
|
+
path.resolve(__dirname, '../app/css/custom-media.css'),
|
|
33
33
|
]
|
|
34
34
|
}),
|
|
35
35
|
|
|
36
36
|
// jitProps({
|
|
37
37
|
// files: [
|
|
38
|
-
// path.resolve(__dirname, '../
|
|
38
|
+
// path.resolve(__dirname, '../app/css/custom-properties.css'),
|
|
39
39
|
// ]
|
|
40
40
|
// }),
|
|
41
41
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<!-- template html di webpack: installato in
|
|
2
|
+
<!-- template html di webpack: installato in app/tpl/index.ejs
|
|
3
3
|
(vedi HtmlWebpackPlugin in webpack.config.mjs).
|
|
4
4
|
I require sono relativi a QUESTO file. -->
|
|
5
5
|
<html lang="it">
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
10
10
|
|
|
11
11
|
<!-- favicons (generate da `npx create-favicons`, vedi package.json) -->
|
|
12
|
-
<%= require('
|
|
12
|
+
<%= require('../favicons/output/favicons.incl.ejs')({}) %>
|
|
13
13
|
|
|
14
14
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
15
15
|
<!-- <base href="<%= htmlWebpackPlugin.options.base %>"> -->
|
|
@@ -13,22 +13,22 @@ import TerserPlugin from 'terser-webpack-plugin';
|
|
|
13
13
|
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
14
14
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
15
15
|
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
|
16
|
-
import Dotenv from 'dotenv-webpack';
|
|
16
|
+
// import Dotenv from 'dotenv-webpack';
|
|
17
17
|
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
18
18
|
// import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
|
|
19
19
|
// import HtmlWebpackInjectAttributesPlugin from 'html-webpack-inject-attributes-plugin';
|
|
20
20
|
|
|
21
|
-
import { cssRules } from './webpack-modules/css-rules.mjs';
|
|
22
|
-
import { createPurgeCSSPlugins } from './webpack-modules/purgecss-setup.mjs';
|
|
23
|
-
import { getJsConfigAliases } from './webpack-modules/get-jsConfig-aliases.mjs';
|
|
24
|
-
import { svgRules } from './webpack-modules/svg-rules.mjs';
|
|
21
|
+
import { cssRules } from './webpack-config-modules/css-rules.mjs';
|
|
22
|
+
import { createPurgeCSSPlugins } from './webpack-config-modules/purgecss-setup.mjs';
|
|
23
|
+
import { getJsConfigAliases } from './webpack-config-modules/get-jsConfig-aliases.mjs';
|
|
24
|
+
import { svgRules } from './webpack-config-modules/svg-rules.mjs';
|
|
25
25
|
|
|
26
26
|
// --- config ---
|
|
27
27
|
const __filename = fileURLToPath(import.meta.url)
|
|
28
28
|
,__dirname = path.dirname(__filename);
|
|
29
29
|
|
|
30
30
|
// Risolve un percorso a partire dalla root del progetto, che coincide con la dir
|
|
31
|
-
// di questo file solo se il frontend NON è in una sottodirectory (es. ./
|
|
31
|
+
// di questo file solo se il frontend NON è in una sottodirectory (es. ./app):
|
|
32
32
|
// vengono provate entrambe le posizioni, in fallback la prima
|
|
33
33
|
const fromProjectRoot = (relPath) => {
|
|
34
34
|
const candidates = ['./', '../'].map(p => path.resolve(__dirname, p, relPath));
|
|
@@ -36,21 +36,23 @@ const fromProjectRoot = (relPath) => {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const isDevelopment = process.env.NODE_ENV === 'development'
|
|
39
|
+
,devServerPort = 5704
|
|
40
|
+
// ,apiPort = 8104
|
|
39
41
|
,useSass = false
|
|
40
42
|
,inlineCssInDevMode = true
|
|
41
43
|
,useSvgo = true
|
|
42
44
|
,useSvgr = false // svg per react
|
|
43
|
-
,svgoConfig = useSvgo? (await import('./webpack-modules/svgo.config.mjs')).default : null
|
|
44
|
-
,postcssConfig_path = path.resolve(__dirname, './webpack-modules/postcss.config.mjs')
|
|
45
|
+
,svgoConfig = useSvgo? (await import('./webpack-config-modules/svgo.config.mjs')).default : null
|
|
46
|
+
,postcssConfig_path = path.resolve(__dirname, './webpack-config-modules/postcss.config.mjs')
|
|
45
47
|
// dir di output: relativa a QUESTO file ('../build' se il frontend è in una
|
|
46
48
|
// sottodirectory, './build' se webpack.config.mjs è nella root del progetto)
|
|
47
|
-
,output_dir = path.resolve(__dirname, '
|
|
49
|
+
,output_dir = path.resolve(__dirname, './build')
|
|
48
50
|
// ,output_dir = isDevelopment? '_dev' : 'build' // symfony
|
|
49
51
|
// dir delle favicons generate da `npx create-favicons` (vedi package.json):
|
|
50
52
|
// il path assoluto serve a CopyWebpackPlugin/HtmlWebpackPlugin (i path
|
|
51
53
|
// relativi sarebbero risolti dal cwd, non da questo file), mentre la regexp
|
|
52
54
|
// resta relativa perché viene confrontata con i path dei moduli
|
|
53
|
-
,favicons_path = path.resolve(__dirname, './favicons/output')
|
|
55
|
+
,favicons_path = path.resolve(__dirname, './app/favicons/output')
|
|
54
56
|
,favicons_path_regexp = /favicons\/output/ // source pattern per le favicons (regexp o null)
|
|
55
57
|
// NB: jsconfig.json va tenuto in questa stessa dir (gli alias sono risolti
|
|
56
58
|
// a partire dalla sua posizione)
|
|
@@ -95,9 +97,10 @@ const shared_chunk_paths = (module) => {
|
|
|
95
97
|
const sep = '[\\\\/]'; // stringa che produce [\\/] nel pattern
|
|
96
98
|
const pathsRegexp = new RegExp([
|
|
97
99
|
'node_modules',
|
|
98
|
-
'
|
|
99
|
-
'
|
|
100
|
-
'
|
|
100
|
+
'app/js',
|
|
101
|
+
'app/src',
|
|
102
|
+
'app/src/web-components',
|
|
103
|
+
'app/src/components',
|
|
101
104
|
].map(p => `${sep}${p.replace(/\//g, sep)}${sep}`).join('|'));
|
|
102
105
|
|
|
103
106
|
return pathsRegexp.test(module.nameForCondition?.() ?? '');
|
|
@@ -136,7 +139,7 @@ const CopyWebpackPluginPatterns = [
|
|
|
136
139
|
];
|
|
137
140
|
|
|
138
141
|
// =>> PurgeCSS
|
|
139
|
-
// Istanze e opzioni sono in webpack-modules/purgecss-setup.mjs: qui restano
|
|
142
|
+
// Istanze e opzioni sono in webpack-config-modules/purgecss-setup.mjs: qui restano
|
|
140
143
|
// solo i flag e i dati di progetto (vedi createPurgeCSSPlugins nei `plugins`).
|
|
141
144
|
|
|
142
145
|
// recupero metadata immagini
|
|
@@ -176,11 +179,11 @@ const config = {
|
|
|
176
179
|
},
|
|
177
180
|
|
|
178
181
|
// https://webpack.js.org/configuration/dotenv/
|
|
179
|
-
dotenv: {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
},
|
|
182
|
+
// dotenv: {
|
|
183
|
+
// prefix: 'APP_',
|
|
184
|
+
// dir: '/',
|
|
185
|
+
// template: ['.env', '.env.development'] //, '.env.local', '.env.[mode]', '.env.[mode].local'],
|
|
186
|
+
// },
|
|
184
187
|
|
|
185
188
|
devtool: isDevelopment ? 'inline-source-map' : false,
|
|
186
189
|
|
|
@@ -252,34 +255,30 @@ const config = {
|
|
|
252
255
|
directory: path.join(__dirname, '/'),
|
|
253
256
|
serveIndex: true
|
|
254
257
|
},
|
|
258
|
+
open: { app: { name: 'Google Chrome' } },
|
|
259
|
+
compress: true,
|
|
260
|
+
hot: true,
|
|
261
|
+
port: devServerPort,
|
|
255
262
|
/*
|
|
256
263
|
proxy: [
|
|
257
264
|
{
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
// package.json e app/router.php), che webpack-dev-server non può
|
|
261
|
-
// eseguire da solo.
|
|
262
|
-
context: ['/api', '/login', '/logout'],
|
|
263
|
-
target: process.env.PHP_BASE_URL || 'http://localhost:8000'
|
|
265
|
+
context: ['/api'],
|
|
266
|
+
target: process.env.API_URL || `http://localhost:${apiPort}`
|
|
264
267
|
}
|
|
265
268
|
],
|
|
266
269
|
static: false,
|
|
267
270
|
*/
|
|
268
|
-
open: { app: { name: 'Google Chrome' } },
|
|
269
|
-
compress: true,
|
|
270
|
-
hot: true,
|
|
271
|
-
port: 5700
|
|
272
271
|
},
|
|
273
272
|
|
|
274
273
|
// =>> plugins
|
|
275
274
|
plugins: [
|
|
276
275
|
// =>> plugins: Dotenv
|
|
277
|
-
new Dotenv({
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}),
|
|
276
|
+
// new Dotenv({
|
|
277
|
+
// path: isDevelopment ? './.env.development' : './.env',
|
|
278
|
+
// expand: true,
|
|
279
|
+
// ignoreStub: true,
|
|
280
|
+
// allowEmptyValues: true
|
|
281
|
+
// }),
|
|
283
282
|
new webpack.ProvidePlugin({
|
|
284
283
|
process: 'process/browser.js'
|
|
285
284
|
}),
|
|
@@ -404,7 +403,7 @@ const config = {
|
|
|
404
403
|
// =>> plugins: PurgeCSSPlugin (per ultimo, attivo anche in dev)
|
|
405
404
|
// https://github.com/FullHuman/purgecss/tree/main/packages/purgecss-webpack-plugin
|
|
406
405
|
// https://purgecss.com/configuration.html
|
|
407
|
-
// istanze e opzioni in webpack-modules/purgecss-setup.mjs (qui solo flag/dati progetto)
|
|
406
|
+
// istanze e opzioni in webpack-config-modules/purgecss-setup.mjs (qui solo flag/dati progetto)
|
|
408
407
|
// `usePurgeCss: false` disattiva il purge per intero (utile per isolare rapidamente
|
|
409
408
|
// eventuali problemi legati ad esso); `purgeCSSOptions` (variables/keyframes/debug,
|
|
410
409
|
// vedi sopra) si applica solo quando è attivo
|
|
@@ -460,7 +459,7 @@ const config = {
|
|
|
460
459
|
|
|
461
460
|
// elenco generato: usi di var() nei blocchi `purgecss ignore` e nei css
|
|
462
461
|
// shadow-DOM/`?raw`, override cross-asset (seeds), con chiusura transitiva
|
|
463
|
-
// delle dipendenze (vedi webpack-modules/purgecss-variables-safelist.mjs)
|
|
462
|
+
// delle dipendenze (vedi webpack-config-modules/purgecss-variables-safelist.mjs)
|
|
464
463
|
variablesSafelist: {
|
|
465
464
|
declarationGlobs: [
|
|
466
465
|
path.resolve(__dirname, './index.css'), // entry css di default (vedi starter-install.sh)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@massimo-cassandro/minimo",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.5",
|
|
4
4
|
"description": "Light css framework & utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@massimo-cassandro/eslint-config": "^3.0.16",
|
|
97
97
|
"@massimo-cassandro/stylelint-config": "^2.3.15",
|
|
98
98
|
"@types/node": "^26.2.0",
|
|
99
|
-
"jsdom": "^
|
|
99
|
+
"jsdom": "^30.0.1",
|
|
100
100
|
"style-dictionary": "^5.5.1"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
@@ -40,7 +40,7 @@ function closeDialog(el) {
|
|
|
40
40
|
*
|
|
41
41
|
* @param {Object} params
|
|
42
42
|
* @param {string | null} [params.dialogExtraClassName=null] - Extra class added to the dialog element. (default: null)
|
|
43
|
-
* @param {string | DomBuilderItem[] | null} [params.content=null] - Plain text, HTML, or a domBuilder array. (default: null)
|
|
43
|
+
* @param {string | DomBuilderItem | DomBuilderItem[] | null} [params.content=null] - Plain text, HTML, a domBuilder object, or a domBuilder array. (default: null)
|
|
44
44
|
* @param {string | null} [params.contentExtraClassName=null] - Extra class added to the content wrapper. (default: null)
|
|
45
45
|
* @param {HTMLElement | null} [params.triggerElement=null] - Optional element that triggered the popup; when set, `aria-haspopup`, `aria-controls` and `aria-expanded` are managed on it. (default: null)
|
|
46
46
|
* @param {boolean} [params.addFocus=true] - if true, dialog receives focus after opening (default: true)
|
|
@@ -58,8 +58,8 @@ function closeDialog(el) {
|
|
|
58
58
|
* @param {((el: HTMLDialogElement) => void) | null} [params.closeCallback=null] - Called with the dialog element just before it is removed, receives the dialog element (`closeCallback(dialogEl)`). NB: `dialogEl` is removed immediately after closing. (default: null)
|
|
59
59
|
* @param {((data: *, el: Element) => void) | null} [params.ajaxCallback=null] - Called with the Ajax response and the content element. (default: null)
|
|
60
60
|
* @param {boolean} [params.addScrollbarPadding=false] - Adds right padding to compensate for the scrollbar. (default: false)
|
|
61
|
-
* @param {string | DomBuilderItem[] | null} [params.headerContent=null] - Header content: plain text, HTML, or a domBuilder array. (default: null)
|
|
62
|
-
* @param {string | DomBuilderItem[] | null} [params.footerContent=null] - Footer content: plain text, HTML, or a domBuilder array. (default: null)
|
|
61
|
+
* @param {string | DomBuilderItem | DomBuilderItem[] | null} [params.headerContent=null] - Header content: plain text, HTML, a domBuilder object, or a domBuilder array. (default: null)
|
|
62
|
+
* @param {string | DomBuilderItem | DomBuilderItem[] | null} [params.footerContent=null] - Footer content: plain text, HTML, a domBuilder object, or a domBuilder array. (default: null)
|
|
63
63
|
* @returns {HTMLDialogElement} The dialog element.
|
|
64
64
|
*/
|
|
65
65
|
|
|
@@ -84,7 +84,7 @@ export function modalPopup({
|
|
|
84
84
|
/** iframe url */
|
|
85
85
|
iframeUrl = null,
|
|
86
86
|
|
|
87
|
-
/** content: plain text, html or domBuilder array */
|
|
87
|
+
/** content: plain text, html, domBuilder object or domBuilder array */
|
|
88
88
|
content = null,
|
|
89
89
|
|
|
90
90
|
/** Ajax url and callback.
|
|
@@ -98,13 +98,13 @@ export function modalPopup({
|
|
|
98
98
|
closeCallback = null,
|
|
99
99
|
addScrollbarPadding = false, // adds extra right padding to compensate for the scrollbar
|
|
100
100
|
|
|
101
|
-
/** header content: plain text, HTML or domBuilder array */
|
|
101
|
+
/** header content: plain text, HTML, domBuilder object or domBuilder array */
|
|
102
102
|
headerContent = null,
|
|
103
103
|
|
|
104
104
|
/** extra classname added to header */
|
|
105
105
|
headerExtraClassName = null,
|
|
106
106
|
|
|
107
|
-
/** footer content: plain text, HTML or domBuilder array */
|
|
107
|
+
/** footer content: plain text, HTML, domBuilder object or domBuilder array */
|
|
108
108
|
footerContent = null,
|
|
109
109
|
|
|
110
110
|
/** extra classname added to footer */
|
|
@@ -120,6 +120,17 @@ export function modalPopup({
|
|
|
120
120
|
throw '[modalContent] parametri `content`, `ajaxUrl`/ `ajaxCallback` e `iframeUrl` mancanti';
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
// allow a single domBuilder object (in addition to a domBuilder array) by wrapping it in an array
|
|
124
|
+
if(content != null && typeof content === 'object' && !Array.isArray(content)) {
|
|
125
|
+
content = [content];
|
|
126
|
+
}
|
|
127
|
+
if(headerContent != null && typeof headerContent === 'object' && !Array.isArray(headerContent)) {
|
|
128
|
+
headerContent = [headerContent];
|
|
129
|
+
}
|
|
130
|
+
if(footerContent != null && typeof footerContent === 'object' && !Array.isArray(footerContent)) {
|
|
131
|
+
footerContent = [footerContent];
|
|
132
|
+
}
|
|
133
|
+
|
|
123
134
|
let mode;
|
|
124
135
|
if(content != null && Array.isArray(content)) {
|
|
125
136
|
mode = 'domBuilder';
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
|
|
279
279
|
--mpopup-backdrop-color: rgb(0 0 0 / .6);
|
|
280
280
|
--mpopup-background-color: var(--body-background-color);
|
|
281
|
-
--mpopup-border-radius: var(--
|
|
281
|
+
--mpopup-border-radius: var(--radius-base);
|
|
282
282
|
--mpopup-btn-close-size: 1.6rem;
|
|
283
283
|
--mpopup-content-padding: var(--size-base) var(--size-sm) var(--size-sm);
|
|
284
284
|
--mpopup-content-scrollbar-padding-i-end: var(--size-md);
|
package/src/minimo.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* decomment if you want to use layers. see https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@layer */
|
|
2
2
|
/* @layer reset, base, components, utilities, project, overrides; */
|
|
3
3
|
|
|
4
|
-
/* @import '@
|
|
5
|
-
/* @import '@
|
|
6
|
-
/* @import '@
|
|
4
|
+
/* @import '@css/fonts.css'; */
|
|
5
|
+
/* @import '@css/custom-media.css'; */ /* managed by postcss */
|
|
6
|
+
/* @import '@css/custom-properties.css' layer('base'); */ /* managed by postcss-jit-props */
|
|
7
7
|
|
|
8
8
|
@import '@minimo/css/reset.css';
|
|
9
9
|
@import '@minimo/css/layout-base.css';
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"folders": [
|
|
3
|
-
{
|
|
4
|
-
"path": "."
|
|
5
|
-
}
|
|
6
|
-
],
|
|
7
|
-
"settings": {
|
|
8
|
-
|
|
9
|
-
"cssvar.files": [
|
|
10
|
-
"frontend/src/css/custom-properties.css", // project props (frontend in sottodirectory)
|
|
11
|
-
// "src/css/custom-properties.css", // project props (frontend nella root)
|
|
12
|
-
|
|
13
|
-
// OPEN PROPS
|
|
14
|
-
// "./node_modules/open-props/open-props.min.css", // all open-props
|
|
15
|
-
|
|
16
|
-
// "./node_modules/open-props/animations.min.css",
|
|
17
|
-
// "./node_modules/open-props/aspects.min.css",
|
|
18
|
-
// "./node_modules/open-props/borders.min.css",
|
|
19
|
-
// "./node_modules/open-props/buttons.dark.min.css",
|
|
20
|
-
// "./node_modules/open-props/buttons.light.min.css",
|
|
21
|
-
// "./node_modules/open-props/buttons.min.css",
|
|
22
|
-
// "./node_modules/open-props/durations.min.css",
|
|
23
|
-
// "./node_modules/open-props/easings.min.css",
|
|
24
|
-
// "./node_modules/open-props/fonts.min.css",
|
|
25
|
-
// "./node_modules/open-props/gradients.min.css",
|
|
26
|
-
// "./node_modules/open-props/masks.corner-cuts.min.css",
|
|
27
|
-
// "./node_modules/open-props/masks.edges.min.css",
|
|
28
|
-
// "./node_modules/open-props/media.min.css",
|
|
29
|
-
// "./node_modules/open-props/normalize.dark.min.css",
|
|
30
|
-
// "./node_modules/open-props/normalize.light.min.css",
|
|
31
|
-
// "./node_modules/open-props/normalize.min.css",
|
|
32
|
-
// "./node_modules/open-props/sizes.min.css",
|
|
33
|
-
// "./node_modules/open-props/supports.min.css",
|
|
34
|
-
// "./node_modules/open-props/theme.dark.switch.min.css",
|
|
35
|
-
// "./node_modules/open-props/theme.light.switch.min.css",
|
|
36
|
-
// "./node_modules/open-props/zindex.min.css",
|
|
37
|
-
|
|
38
|
-
// "./node_modules/open-props/colors.min.css",
|
|
39
|
-
// "./node_modules/open-props/colors-hsl.min.css",
|
|
40
|
-
// "./node_modules/open-props/colors-hsl.shadow.min.css",
|
|
41
|
-
// "./node_modules/open-props/colors-oklch.min.css",
|
|
42
|
-
// "./node_modules/open-props/colors-oklch.shadow.min.css",
|
|
43
|
-
// "./node_modules/open-props/oklch-hues.min.css",
|
|
44
|
-
// "./node_modules/open-props/oklch-hues.shadow.min.css",
|
|
45
|
-
|
|
46
|
-
// "./node_modules/open-props/shadows.min.css",
|
|
47
|
-
// "./node_modules/open-props/animations.shadow.min.css",
|
|
48
|
-
// "./node_modules/open-props/aspects.shadow.min.css",
|
|
49
|
-
// "./node_modules/open-props/borders.shadow.min.css",
|
|
50
|
-
// "./node_modules/open-props/colors.shadow.min.css",
|
|
51
|
-
// "./node_modules/open-props/easings.shadow.min.css",
|
|
52
|
-
// "./node_modules/open-props/fonts.shadow.min.css",
|
|
53
|
-
// "./node_modules/open-props/gradients.shadow.min.css",
|
|
54
|
-
// "./node_modules/open-props/normalize.shadow.min.css",
|
|
55
|
-
// "./node_modules/open-props/shadows.shadow.min.css",
|
|
56
|
-
// "./node_modules/open-props/sizes.shadow.min.css",
|
|
57
|
-
// "./node_modules/open-props/zindex.shadow.min.css",
|
|
58
|
-
|
|
59
|
-
],
|
|
60
|
-
// Do not ignore node_modules css files, which is ignored by default
|
|
61
|
-
// "cssvar.ignore": [], // decomment if you are using open props
|
|
62
|
-
|
|
63
|
-
// add support for autocomplete in JS or JS like files
|
|
64
|
-
"cssvar.extensions": [
|
|
65
|
-
"css", "postcss", "jsx", "tsx", "scss"
|
|
66
|
-
],
|
|
67
|
-
|
|
68
|
-
"favorites.resources": [
|
|
69
|
-
{
|
|
70
|
-
"filePath": "node_modules/@fontsource-variable",
|
|
71
|
-
"group": "Default"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"filePath": "node_modules/@fontsource",
|
|
75
|
-
"group": "Default"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"filePath": "node_modules/@massimo-cassandro",
|
|
79
|
-
"group": "Default"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"filePath": "node_modules/open-props",
|
|
83
|
-
"group": "Default"
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
|
|
87
|
-
"bootstrapIntelliSense": {
|
|
88
|
-
"enable": false,
|
|
89
|
-
"bsVersion": "5.3.7",
|
|
90
|
-
"showSuggestions": false,
|
|
91
|
-
"autoComplete": false
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/get-jsConfig-aliases.mjs
RENAMED
|
File without changes
|
|
File without changes
|
/package/dev-tools/starter-kit/{webpack-modules → webpack-config-modules}/purgecss-setup.mjs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|