@massimo-cassandro/minimo 1.41.10 → 1.42.0

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.
@@ -0,0 +1,6 @@
1
+ import * as styles from './layout-tools.module.css';
2
+
3
+ const div = document.createElement('div');
4
+ div.className = styles.mediaMonitor;
5
+
6
+ document.body.insertAdjacentElement('beforeend', div);
@@ -0,0 +1,35 @@
1
+ /* TODO custome props per variare colore, poszione ecc.., */
2
+
3
+ .mediaMonitor {
4
+ --content: 'phone';
5
+ position: fixed;
6
+ bottom: 0;
7
+ left: 0;
8
+
9
+ padding: 2px 4px;
10
+ font-size: 14px;
11
+ color: #fff;
12
+ background-color: #000;
13
+ border-top-right-radius: 2px;
14
+ &::before {
15
+ text-transform: uppercase;
16
+ content: var(--content);
17
+
18
+ @media (--media-small-viewport-up) {
19
+ --content: 'small';
20
+ }
21
+ @media (--media-medium-viewport-up) {
22
+ --content: 'medium';
23
+ }
24
+ @media (--media-large-viewport-up) {
25
+ --content: 'large';
26
+ }
27
+ @media (--media-xlarge-viewport-up) {
28
+ --content: 'x-large';
29
+ }
30
+ @media (--media-xxlarge-viewport-up) {
31
+ --content: 'xx-large';
32
+ }
33
+ }
34
+ }
35
+
@@ -1,7 +1,14 @@
1
- import './index.css';
2
-
1
+ /* global process */
3
2
 
3
+ import './index.css';
4
4
  import { innerNav, dismissAlerts } from '@massimo-cassandro/minimo';
5
5
 
6
+
6
7
  innerNav();
7
8
  dismissAlerts();
9
+
10
+
11
+
12
+ if (process.env.NODE_ENV === 'development') {
13
+ import('@massimo-cassandro/minimo/layout-tools');
14
+ }
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.41.10",
3
+ "version": "1.42.0",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
- "main": "./index.js",
6
+ "main": "./src/index.js",
7
7
  "exports": {
8
- ".": "./index.js",
8
+ ".": "./src/index.js",
9
+ "./index.js": "./src/index.js",
9
10
  "./charts": "./charts/index.js",
10
11
  "./json-table": "./src/web-components/json-table/json-table-component.js",
12
+ "./layout-tools": "./dev-tools/layout-tools/layout-tools.js",
11
13
  "./stylelint-config": "./dev-tools/stylelint-config/index.js",
12
14
  "./css/*": "./src/css/*.css",
13
15
  "./tokens/*": "./design-tokens/tokens/*",
@@ -55,6 +57,7 @@
55
57
  "sideEffects": [
56
58
  "**/s-datatable-component/**/*",
57
59
  "**/json-table/**/*",
60
+ "**/layout-tools/**/*",
58
61
  "**/*.css"
59
62
  ],
60
63
  "engines": {
@@ -62,7 +65,6 @@
62
65
  "npm": ">= 9.0.0"
63
66
  },
64
67
  "files": [
65
- "./index.js",
66
68
  "src/**/*.{js,mjs,css,svg,md}",
67
69
  "types/**/*.d.ts",
68
70
  "design-tokens/README.md",
@@ -1,7 +1,7 @@
1
1
 
2
2
  h1, h2, h3, .h3, h4, .h4 {
3
3
  font-family: var(--headings-font-family);
4
- line-height: var(--headings-font-weight);
4
+ line-height: var(--headings-line-height);
5
5
  color: var(--headings-color);
6
6
  text-align: var(--headings-text-align);
7
7
  }
package/src/index.js ADDED
@@ -0,0 +1,40 @@
1
+
2
+ // utilities
3
+ export { betterText } from './utilities/better-text.js';
4
+ export { betterTextWithPlaces } from './utilities/better-text-with-places.js';
5
+ export { classnames, classnamesNull } from './utilities/classnames.js';
6
+ export { createId } from './utilities/create-id.js';
7
+ export { disableBtnsOnSubmit } from './utilities/disable-btns-on-submit.js';
8
+ export { domBuilder } from './utilities/dom-builder/dom-builder.js';
9
+ export { enableSubmitBtns } from './utilities/enable-submit-btns.js';
10
+ export { escapeHTML, unescapeHTML } from './utilities/escape-html.js';
11
+ export { generatePwd } from './utilities/generate-pwd.js';
12
+ export { getCookie, setCookie } from './utilities/cookies.js';
13
+ export { linkedDates } from './utilities/linked-dates.js';
14
+ export { parseFileSize } from './utilities/parse-file-size.js';
15
+ export { randomId } from './utilities/random-id.js';
16
+ export { relativeDate } from './utilities/relative-date.js';
17
+ export { sentenceCase } from './utilities/sentence-case.js';
18
+ export { stripTags } from './utilities/strip-tags.js';
19
+ export { titleCase } from './utilities/title-case.js';
20
+ export { truncateString } from './utilities/truncate-string.js';
21
+ export { ValidationError } from './utilities/validation-error-class.js';
22
+
23
+ // domBuilder helpers
24
+ export { buildPictureTag } from './utilities/dom-builder-helpers/picture-tag.js';
25
+ export { buildInput, buildCheckbox, buildTextarea, buildFakeField, buildSelect, buildButton } from './utilities/dom-builder-helpers/form-tags.js';
26
+
27
+ // components
28
+ export { dismissAlerts } from './components/dismiss-alerts.js';
29
+ export { formResetSubmit } from './components/form-reset-submit.js';
30
+ export { innerNav } from './components/inner-nav/inner-nav.js';
31
+ export { modalAlert } from './components/modal-alert/modal-alert.js';
32
+ export { modalPopup } from './components/modal-popup/modal-popup.js';
33
+ export { overlay, removeOverlay } from './components/overlay/overlay.js';
34
+ export { sf_macro } from './components/sf-macro/sf-macro.js';
35
+ export { slideToggle, slideUp, slideDown } from './components/slide-up-down-toggle/slide-up-down-toggle.js';
36
+ export { snackbar } from './components/snackbar/snackbar.js';
37
+ export { unsplashPage } from './components/unsplash-page/unsplash-page.js';
38
+
39
+ // web components
40
+ export { JsonTable } from './web-components/json-table/json-table-component.js';
@@ -11,18 +11,7 @@
11
11
 
12
12
  È sufficiente importare il file del componente (registra il custom element):
13
13
 
14
- ```javascriptcacheGroup `shared` (solo con `useSharedChunk: true`): escludere `unsplash-page` e `blurhash` dal chunk condiviso, in modo che js e css restino nella entry che li importa. In `webpack.config.mjs`, nella funzione `shared_chunk_paths`, prima del `return` aggiungere:
15
- ```js
16
- const excluded_paths = [
17
- 'minimo/src/components/unsplash-page',
18
- 'node_modules/blurhash', // peer dep usata solo da unsplash-page
19
- ];
20
- const excludedRegexp = new RegExp(
21
- excluded_paths.map(p => `${sep}${p.replace(/\//g, sep)}${sep}`).join('|')
22
- );
23
- const modulePath = module.nameForCondition?.() ?? '';
24
- ```
25
- e sostituire il `return` con `return !excludedRegexp.test(modulePath) && pathsRegexp.test(modulePath);`. Aggiungere anche al commento sopra il cacheGroup la nota sull'esclusione.
14
+ ```javascript
26
15
  // solo registrazione del tag
27
16
  import '@massimo-cassandro/minimo/json-table';
28
17
 
@@ -3,7 +3,7 @@
3
3
  // pre-elaborazione tipi dati predefiniti
4
4
  // le chiavi che cominciano con '_' sono di questa applicazione, le altre sono di simple-datatable
5
5
 
6
- import { classnames } from '../../../../index.js';
6
+ import { classnames } from '../../../utilities/classnames.js';
7
7
 
8
8
  import * as styles from '../s-datatable-component.module.css';
9
9
 
package/index.js DELETED
@@ -1,40 +0,0 @@
1
-
2
- // utilities
3
- export { betterText } from './src/utilities/better-text.js';
4
- export { betterTextWithPlaces } from './src/utilities/better-text-with-places.js';
5
- export { classnames, classnamesNull } from './src/utilities/classnames.js';
6
- export { createId } from './src/utilities/create-id.js';
7
- export { disableBtnsOnSubmit } from './src/utilities/disable-btns-on-submit.js';
8
- export { domBuilder } from './src/utilities/dom-builder/dom-builder.js';
9
- export { enableSubmitBtns } from './src/utilities/enable-submit-btns.js';
10
- export { escapeHTML, unescapeHTML } from './src/utilities/escape-html.js';
11
- export { generatePwd } from './src/utilities/generate-pwd.js';
12
- export { getCookie, setCookie } from './src/utilities/cookies.js';
13
- export { linkedDates } from './src/utilities/linked-dates.js';
14
- export { parseFileSize } from './src/utilities/parse-file-size.js';
15
- export { randomId } from './src/utilities/random-id.js';
16
- export { relativeDate } from './src/utilities/relative-date.js';
17
- export { sentenceCase } from './src/utilities/sentence-case.js';
18
- export { stripTags } from './src/utilities/strip-tags.js';
19
- export { titleCase } from './src/utilities/title-case.js';
20
- export { truncateString } from './src/utilities/truncate-string.js';
21
- export { ValidationError } from './src/utilities/validation-error-class.js';
22
-
23
- // domBuilder helpers
24
- export { buildPictureTag } from './src/utilities/dom-builder-helpers/picture-tag.js';
25
- export { buildInput, buildCheckbox, buildTextarea, buildFakeField, buildSelect, buildButton } from './src/utilities/dom-builder-helpers/form-tags.js';
26
-
27
- // components
28
- export { dismissAlerts } from './src/components/dismiss-alerts.js';
29
- export { formResetSubmit } from './src/components/form-reset-submit.js';
30
- export { innerNav } from './src/components/inner-nav/inner-nav.js';
31
- export { modalAlert } from './src/components/modal-alert/modal-alert.js';
32
- export { modalPopup } from './src/components/modal-popup/modal-popup.js';
33
- export { overlay, removeOverlay } from './src/components/overlay/overlay.js';
34
- export { sf_macro } from './src/components/sf-macro/sf-macro.js';
35
- export { slideToggle, slideUp, slideDown } from './src/components/slide-up-down-toggle/slide-up-down-toggle.js';
36
- export { snackbar } from './src/components/snackbar/snackbar.js';
37
- export { unsplashPage } from './src/components/unsplash-page/unsplash-page.js';
38
-
39
- // web components
40
- export { JsonTable } from './src/web-components/json-table/json-table-component.js';