@maggioli-design-system/mds-push-notification 1.1.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.
- package/dist/cjs/index-04ec0413.js +1642 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/mds-push-notification.cjs.entry.js +34 -0
- package/dist/cjs/mds-push-notification.cjs.js +23 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/common/aria.js +29 -0
- package/dist/collection/common/file.js +48 -0
- package/dist/collection/common/icon.js +15 -0
- package/dist/collection/common/keyboard-manager.js +40 -0
- package/dist/collection/common/unit.js +22 -0
- package/dist/collection/common/yugop/core.js +16 -0
- package/dist/collection/common/yugop/index.js +3 -0
- package/dist/collection/common/yugop/random-text.js +59 -0
- package/dist/collection/common/yugop/utils/math.js +11 -0
- package/dist/collection/common/yugop/utils/noop.js +1 -0
- package/dist/collection/common/yugop/utils/prng.js +21 -0
- package/dist/collection/common/yugop/utils/string.js +2 -0
- package/dist/collection/components/mds-push-notification/mds-push-notification.css +668 -0
- package/dist/collection/components/mds-push-notification/mds-push-notification.js +202 -0
- package/dist/collection/components/mds-push-notification/meta/dictionary.js +5 -0
- package/dist/collection/components/mds-push-notification/meta/types.js +1 -0
- package/dist/collection/components/mds-push-notification/test/mds-push-notification.e2e.js +9 -0
- package/dist/collection/components/mds-push-notification/test/mds-push-notification.spec.js +23 -0
- package/dist/collection/components/mds-push-notification/test/mds-push-notification.stories.js +105 -0
- package/dist/collection/dictionary/autocomplete.js +59 -0
- package/dist/collection/dictionary/button.js +30 -0
- package/dist/collection/dictionary/color.js +19 -0
- package/dist/collection/dictionary/file-extensions.js +64 -0
- package/dist/collection/dictionary/floating-ui.js +19 -0
- package/dist/collection/dictionary/icon.js +10 -0
- package/dist/collection/dictionary/input.js +37 -0
- package/dist/collection/dictionary/loading.js +5 -0
- package/dist/collection/dictionary/text.js +6 -0
- package/dist/collection/dictionary/typography.js +67 -0
- package/dist/collection/dictionary/variant.js +90 -0
- package/dist/collection/fixtures/cities.js +110 -0
- package/dist/collection/fixtures/filenames.js +57 -0
- package/dist/collection/interface/input-value.js +1 -0
- package/dist/collection/type/autocomplete.js +1 -0
- package/dist/collection/type/button.js +1 -0
- package/dist/collection/type/file-types.js +1 -0
- package/dist/collection/type/floating-ui.js +1 -0
- package/dist/collection/type/form-rel.js +1 -0
- package/dist/collection/type/input.js +1 -0
- package/dist/collection/type/loading.js +1 -0
- package/dist/collection/type/text.js +1 -0
- package/dist/collection/type/typography.js +1 -0
- package/dist/collection/type/variant-file-format.js +111 -0
- package/dist/collection/type/variant.js +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +1 -0
- package/dist/components/mds-push-notification.d.ts +11 -0
- package/dist/components/mds-push-notification.js +57 -0
- package/dist/documentation.d.ts +401 -0
- package/dist/documentation.json +370 -0
- package/dist/esm/index-55392a50.js +1614 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +9 -0
- package/dist/esm/mds-push-notification.entry.js +30 -0
- package/dist/esm/mds-push-notification.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm-es5/index-55392a50.js +1 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/mds-push-notification.entry.js +1 -0
- package/dist/esm-es5/mds-push-notification.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mds-push-notification/index.esm.js +0 -0
- package/dist/mds-push-notification/mds-push-notification.esm.js +1 -0
- package/dist/mds-push-notification/mds-push-notification.js +127 -0
- package/dist/mds-push-notification/p-34044354.entry.js +1 -0
- package/dist/mds-push-notification/p-50ea2036.system.js +1 -0
- package/dist/mds-push-notification/p-8a9749fc.system.entry.js +1 -0
- package/dist/mds-push-notification/p-8cb59c6e.system.js +1 -0
- package/dist/mds-push-notification/p-a4428770.js +2 -0
- package/dist/mds-push-notification/p-b107cf73.system.js +2 -0
- package/dist/stats.json +835 -0
- package/dist/types/common/aria.d.ts +5 -0
- package/dist/types/common/file.d.ts +12 -0
- package/dist/types/common/icon.d.ts +5 -0
- package/dist/types/common/keyboard-manager.d.ts +11 -0
- package/dist/types/common/unit.d.ts +3 -0
- package/dist/types/common/yugop/core.d.ts +10 -0
- package/dist/types/common/yugop/index.d.ts +1 -0
- package/dist/types/common/yugop/random-text.d.ts +31 -0
- package/dist/types/common/yugop/utils/math.d.ts +3 -0
- package/dist/types/common/yugop/utils/noop.d.ts +1 -0
- package/dist/types/common/yugop/utils/prng.d.ts +8 -0
- package/dist/types/common/yugop/utils/string.d.ts +1 -0
- package/dist/types/components/mds-push-notification/meta/dictionary.d.ts +2 -0
- package/dist/types/components/mds-push-notification/meta/types.d.ts +1 -0
- package/dist/types/components/mds-push-notification/test/mds-push-notification.stories.d.ts +77 -0
- package/dist/types/components.d.ts +105 -0
- package/dist/types/dictionary/autocomplete.d.ts +2 -0
- package/dist/types/dictionary/button.d.ts +6 -0
- package/dist/types/dictionary/color.d.ts +3 -0
- package/dist/types/dictionary/file-extensions.d.ts +11 -0
- package/dist/types/dictionary/floating-ui.d.ts +3 -0
- package/dist/types/dictionary/icon.d.ts +4 -0
- package/dist/types/dictionary/input.d.ts +5 -0
- package/dist/types/dictionary/loading.d.ts +2 -0
- package/dist/types/dictionary/text.d.ts +2 -0
- package/dist/types/dictionary/typography.d.ts +11 -0
- package/dist/types/dictionary/variant.d.ts +11 -0
- package/dist/types/fixtures/cities.d.ts +2 -0
- package/dist/types/fixtures/filenames.d.ts +2 -0
- package/dist/types/interface/input-value.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1681 -0
- package/dist/types/type/autocomplete.d.ts +2 -0
- package/dist/types/type/button.d.ts +5 -0
- package/dist/types/type/file-types.d.ts +1 -0
- package/dist/types/type/floating-ui.d.ts +2 -0
- package/dist/types/type/form-rel.d.ts +1 -0
- package/dist/types/type/input.d.ts +4 -0
- package/dist/types/type/loading.d.ts +1 -0
- package/dist/types/type/text.d.ts +1 -0
- package/dist/types/type/typography.d.ts +10 -0
- package/dist/types/type/variant-file-format.d.ts +11 -0
- package/dist/types/type/variant.d.ts +12 -0
- package/documentation.json +788 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +51 -0
- package/readme.md +67 -0
- package/src/common/aria.ts +39 -0
- package/src/common/file.ts +63 -0
- package/src/common/icon.ts +25 -0
- package/src/common/keyboard-manager.ts +46 -0
- package/src/common/unit.ts +33 -0
- package/src/common/yugop/core.ts +47 -0
- package/src/common/yugop/index.ts +4 -0
- package/src/common/yugop/random-text.ts +95 -0
- package/src/common/yugop/utils/math.ts +21 -0
- package/src/common/yugop/utils/noop.ts +1 -0
- package/src/common/yugop/utils/prng.ts +35 -0
- package/src/common/yugop/utils/string.ts +4 -0
- package/src/components/mds-push-notification/.gitlab-ci.yml +25 -0
- package/src/components/mds-push-notification/css/mds-push-notification-variant-label.css +191 -0
- package/src/components/mds-push-notification/css/mds-push-notification-variant-primary.css +20 -0
- package/src/components/mds-push-notification/css/mds-push-notification-variant-state.css +77 -0
- package/src/components/mds-push-notification/mds-push-notification.css +130 -0
- package/src/components/mds-push-notification/mds-push-notification.tsx +84 -0
- package/src/components/mds-push-notification/meta/dictionary.ts +8 -0
- package/src/components/mds-push-notification/meta/types.ts +3 -0
- package/src/components/mds-push-notification/readme.md +42 -0
- package/src/components/mds-push-notification/test/mds-push-notification.e2e.ts +11 -0
- package/src/components/mds-push-notification/test/mds-push-notification.spec.tsx +24 -0
- package/src/components/mds-push-notification/test/mds-push-notification.stories.tsx +137 -0
- package/src/components.d.ts +105 -0
- package/src/dictionary/autocomplete.ts +62 -0
- package/src/dictionary/button.ts +41 -0
- package/src/dictionary/color.ts +24 -0
- package/src/dictionary/file-extensions.ts +81 -0
- package/src/dictionary/floating-ui.ts +25 -0
- package/src/dictionary/icon.ts +15 -0
- package/src/dictionary/input.ts +48 -0
- package/src/dictionary/loading.ts +9 -0
- package/src/dictionary/text.ts +9 -0
- package/src/dictionary/typography.ts +88 -0
- package/src/dictionary/variant.ts +111 -0
- package/src/fixtures/cities.ts +116 -0
- package/src/fixtures/filenames.ts +60 -0
- package/src/fixtures/icons.json +314 -0
- package/src/fixtures/iconsauce.json +235 -0
- package/src/interface/input-value.ts +5 -0
- package/src/tailwind/components.css +15 -0
- package/src/type/autocomplete.ts +69 -0
- package/src/type/button.ts +28 -0
- package/src/type/file-types.ts +55 -0
- package/src/type/floating-ui.ts +17 -0
- package/src/type/form-rel.ts +11 -0
- package/src/type/input.ts +25 -0
- package/src/type/loading.ts +3 -0
- package/src/type/text.ts +4 -0
- package/src/type/typography.ts +65 -0
- package/src/type/variant-file-format.ts +128 -0
- package/src/type/variant.ts +99 -0
- package/www/build/index.esm.js +0 -0
- package/www/build/mds-push-notification.esm.js +1 -0
- package/www/build/mds-push-notification.js +127 -0
- package/www/build/p-34044354.entry.js +1 -0
- package/www/build/p-50ea2036.system.js +1 -0
- package/www/build/p-8a9749fc.system.entry.js +1 -0
- package/www/build/p-8cb59c6e.system.js +1 -0
- package/www/build/p-a4428770.js +2 -0
- package/www/build/p-b107cf73.system.js +2 -0
- package/www/host.config.json +15 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-04ec0413.js');
|
|
6
|
+
|
|
7
|
+
const defineCustomElements = (win, options) => {
|
|
8
|
+
if (typeof window === 'undefined') return undefined;
|
|
9
|
+
return index.bootstrapLazy([["mds-push-notification.cjs",[[1,"mds-push-notification",{"icon":[513],"initials":[1537],"message":[513],"preview":[513],"src":[513],"subject":[513],"tone":[513],"variant":[513]}]]]], options);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.setNonce = index.setNonce;
|
|
13
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-04ec0413.js');
|
|
6
|
+
|
|
7
|
+
const miBaselineCancel = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10s10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17L12 13.41L8.41 17L7 15.59L10.59 12L7 8.41L8.41 7L12 10.59L15.59 7L17 8.41L13.41 12L17 15.59z"/></svg>`;
|
|
8
|
+
|
|
9
|
+
const mdsPushNotificationCss = "@tailwind components; @tailwind utilities; .svg{display:-ms-flexbox;display:flex}.svg svg{aspect-ratio:1/1;height:100%;width:100%}:host{--mds-push-notification-duration:200ms;--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--tone-neutral-04));--mds-push-notification-message-line-clamp:2;--mds-push-notification-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--mds-push-notification-subject-line-clamp:1;--mds-push-notification-timing-function:cubic-bezier(1, 0, 0, 1);min-width:18rem;max-width:20rem;gap:1rem;border-radius:0.5rem;padding:1rem;padding-right:2rem;-ms-flex-align:start;align-items:flex-start;background-color:rgb(var(--tone-neutral));-webkit-box-shadow:var(--mds-push-notification-shadow);box-shadow:var(--mds-push-notification-shadow);color:rgb(var(--tone-neutral-02));display:-ms-flexbox;display:flex;position:relative;-webkit-transition-duration:var(--mds-push-notification-duration);transition-duration:var(--mds-push-notification-duration);-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-timing-function:var(--mds-push-notification-timing-function);transition-timing-function:var(--mds-push-notification-timing-function)}.content{display:grid;-ms-flex-positive:1;flex-grow:1}.actions{gap:0.5rem;padding-top:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;min-width:1px}.avatar,.picture{-ms-flex-negative:0;flex-shrink:0}.picture{max-width:3rem;border-radius:0.25rem;-webkit-box-shadow:0 0 1px 1px rgb(0 0 0 / 0.06), 0 1px 2px 0 rgb(0 0 0 / 0.05);box-shadow:0 0 1px 1px rgb(0 0 0 / 0.06), 0 1px 2px 0 rgb(0 0 0 / 0.05);width:100%}.close-button{padding:0.375rem;-webkit-transition-property:opacity;transition-property:opacity;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms;--mds-button-icon-color:inherit;background-color:transparent;fill:rgb(var(--tone-neutral-06));opacity:0;position:absolute;right:0;top:0}:host(:hover) .close-button{opacity:1}.close-button:focus-visible,.close-button:hover{fill:rgb(var(--tone-neutral-03));opacity:1}.subject{--mds-text-line-clamp:var(--mds-push-notification-subject-line-clamp);line-height:1.25rem;text-overflow:ellipsis}.message{--mds-text-line-clamp:var(--mds-push-notification-message-line-clamp);line-height:1.25rem;text-overflow:ellipsis}.avatar{height:2.25rem;width:2.25rem;-webkit-transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms;background-color:var(--mds-push-notification-icon-background-color);border-radius:1000px;fill:var(--mds-push-notification-icon-color)}.avatar::part(svg){width:1.5rem}:host([src]) .avatar{background-color:transparent}:host([icon]) .avatar::part(wrapper){padding:0.375rem}@tailwind utilities; :host([variant=\"primary\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--brand-maggioli-05));--mds-push-notification-icon-color:rgb(var(--brand-maggioli-10))}:host([variant=\"primary\"]),:host([variant=\"primary\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--brand-maggioli-09));--mds-push-notification-icon-color:rgb(var(--brand-maggioli-05))}:host([variant=\"primary\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--brand-maggioli-05))}@tailwind utilities; :host([variant=\"orange\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-orange-05));--mds-push-notification-icon-color:rgb(var(--label-orange-10))}:host([variant=\"orange\"]),:host([variant=\"orange\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-orange-09));--mds-push-notification-icon-color:rgb(var(--label-orange-05))}:host([variant=\"orange\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-orange-05))}:host([variant=\"amaranth\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-amaranth-05));--mds-push-notification-icon-color:rgb(var(--label-amaranth-10))}:host([variant=\"amaranth\"]),:host([variant=\"amaranth\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-amaranth-09));--mds-push-notification-icon-color:rgb(var(--label-amaranth-05))}:host([variant=\"amaranth\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-amaranth-05))}:host([variant=\"orchid\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-orchid-05));--mds-push-notification-icon-color:rgb(var(--label-orchid-10))}:host([variant=\"orchid\"]),:host([variant=\"orchid\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-orchid-09));--mds-push-notification-icon-color:rgb(var(--label-orchid-05))}:host([variant=\"orchid\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-orchid-05))}:host([variant=\"violet\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-violet-05));--mds-push-notification-icon-color:rgb(var(--label-violet-10))}:host([variant=\"violet\"]),:host([variant=\"violet\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-violet-09));--mds-push-notification-icon-color:rgb(var(--label-violet-05))}:host([variant=\"violet\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-violet-05))}:host([variant=\"blue\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-blue-05));--mds-push-notification-icon-color:rgb(var(--label-blue-10))}:host([variant=\"blue\"]),:host([variant=\"blue\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-blue-09));--mds-push-notification-icon-color:rgb(var(--label-blue-05))}:host([variant=\"blue\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-blue-05))}:host([variant=\"sky\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-sky-05));--mds-push-notification-icon-color:rgb(var(--label-sky-10))}:host([variant=\"sky\"]),:host([variant=\"sky\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-sky-09));--mds-push-notification-icon-color:rgb(var(--label-sky-05))}:host([variant=\"sky\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-sky-05))}:host([variant=\"aqua\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-aqua-05));--mds-push-notification-icon-color:rgb(var(--label-aqua-10))}:host([variant=\"aqua\"]),:host([variant=\"aqua\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-aqua-09));--mds-push-notification-icon-color:rgb(var(--label-aqua-05))}:host([variant=\"aqua\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-aqua-05))}:host([variant=\"green\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-green-05));--mds-push-notification-icon-color:rgb(var(--label-green-10))}:host([variant=\"green\"]),:host([variant=\"green\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-green-09));--mds-push-notification-icon-color:rgb(var(--label-green-05))}:host([variant=\"green\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-green-05))}:host([variant=\"lime\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-lime-05));--mds-push-notification-icon-color:rgb(var(--label-lime-10))}:host([variant=\"lime\"]),:host([variant=\"lime\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-lime-09));--mds-push-notification-icon-color:rgb(var(--label-lime-05))}:host([variant=\"lime\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-lime-05))}:host([variant=\"yellow\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--label-yellow-05));--mds-push-notification-icon-color:rgb(var(--label-yellow-10))}:host([variant=\"yellow\"]),:host([variant=\"yellow\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--label-yellow-09));--mds-push-notification-icon-color:rgb(var(--label-yellow-05))}:host([variant=\"yellow\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--label-yellow-05))}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.border{border-width:1px}.bg-label-amaranth-10{--tw-bg-opacity:1;background-color:rgb(var(--label-amaranth-10) / var(--tw-bg-opacity))}.bg-label-aqua-10{--tw-bg-opacity:1;background-color:rgb(var(--label-aqua-10) / var(--tw-bg-opacity))}.bg-label-blue-10{--tw-bg-opacity:1;background-color:rgb(var(--label-blue-10) / var(--tw-bg-opacity))}.bg-label-green-10{--tw-bg-opacity:1;background-color:rgb(var(--label-green-10) / var(--tw-bg-opacity))}.bg-label-lime-10{--tw-bg-opacity:1;background-color:rgb(var(--label-lime-10) / var(--tw-bg-opacity))}.bg-label-orange-10{--tw-bg-opacity:1;background-color:rgb(var(--label-orange-10) / var(--tw-bg-opacity))}.bg-label-orchid-10{--tw-bg-opacity:1;background-color:rgb(var(--label-orchid-10) / var(--tw-bg-opacity))}.bg-label-violet-10{--tw-bg-opacity:1;background-color:rgb(var(--label-violet-10) / var(--tw-bg-opacity))}.bg-label-yellow-10{--tw-bg-opacity:1;background-color:rgb(var(--label-yellow-10) / var(--tw-bg-opacity))}.bg-tone-neutral-10{--tw-bg-opacity:1;background-color:rgb(var(--tone-neutral-10) / var(--tw-bg-opacity))}.fill-label-amaranth-04{fill:rgb(var(--label-amaranth-04))}.fill-label-aqua-04{fill:rgb(var(--label-aqua-04))}.fill-label-blue-04{fill:rgb(var(--label-blue-04))}.fill-label-green-04{fill:rgb(var(--label-green-04))}.fill-label-lime-04{fill:rgb(var(--label-lime-04))}.fill-label-orange-04{fill:rgb(var(--label-orange-04))}.fill-label-orchid-04{fill:rgb(var(--label-orchid-04))}.fill-label-violet-04{fill:rgb(var(--label-violet-04))}.fill-label-yellow-04{fill:rgb(var(--label-yellow-04))}.fill-tone-neutral-04{fill:rgb(var(--tone-neutral-04))}.text-label-amaranth-04{--tw-text-opacity:1;color:rgb(var(--label-amaranth-04) / var(--tw-text-opacity))}.text-label-aqua-04{--tw-text-opacity:1;color:rgb(var(--label-aqua-04) / var(--tw-text-opacity))}.text-label-blue-04{--tw-text-opacity:1;color:rgb(var(--label-blue-04) / var(--tw-text-opacity))}.text-label-green-04{--tw-text-opacity:1;color:rgb(var(--label-green-04) / var(--tw-text-opacity))}.text-label-lime-04{--tw-text-opacity:1;color:rgb(var(--label-lime-04) / var(--tw-text-opacity))}.text-label-orange-04{--tw-text-opacity:1;color:rgb(var(--label-orange-04) / var(--tw-text-opacity))}.text-label-orchid-04{--tw-text-opacity:1;color:rgb(var(--label-orchid-04) / var(--tw-text-opacity))}.text-label-violet-04{--tw-text-opacity:1;color:rgb(var(--label-violet-04) / var(--tw-text-opacity))}.text-label-yellow-04{--tw-text-opacity:1;color:rgb(var(--label-yellow-04) / var(--tw-text-opacity))}.text-tone-neutral-04{--tw-text-opacity:1;color:rgb(var(--tone-neutral-04) / var(--tw-text-opacity))}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([variant=\"error\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--status-error-05));--mds-push-notification-icon-color:rgb(var(--status-error-10))}:host([variant=\"error\"]),:host([variant=\"error\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--status-error-09));--mds-push-notification-icon-color:rgb(var(--status-error-05))}:host([variant=\"error\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--status-error-05))}:host([variant=\"warning\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--status-warning-05));--mds-push-notification-icon-color:rgb(var(--status-warning-10))}:host([variant=\"warning\"]),:host([variant=\"warning\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--status-warning-09));--mds-push-notification-icon-color:rgb(var(--status-warning-05))}:host([variant=\"warning\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--status-warning-05))}:host([variant=\"success\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--status-success-05));--mds-push-notification-icon-color:rgb(var(--status-success-10))}:host([variant=\"success\"]),:host([variant=\"success\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--status-success-09));--mds-push-notification-icon-color:rgb(var(--status-success-05))}:host([variant=\"success\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--status-success-05))}:host([variant=\"info\"][tone=\"strong\"]){--mds-push-notification-icon-background-color:rgb(var(--status-info-05));--mds-push-notification-icon-color:rgb(var(--status-info-10))}:host([variant=\"info\"]),:host([variant=\"info\"][tone=\"weak\"]){--mds-push-notification-icon-background-color:rgb(var(--status-info-09));--mds-push-notification-icon-color:rgb(var(--status-info-05))}:host([variant=\"info\"][tone=\"quiet\"]){--mds-push-notification-icon-background-color:transparent;--mds-push-notification-icon-color:rgb(var(--status-info-05))}";
|
|
10
|
+
|
|
11
|
+
const MdsPushNotification = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.icon = undefined;
|
|
15
|
+
this.initials = undefined;
|
|
16
|
+
this.message = 'Nessun messaggio disponibile';
|
|
17
|
+
this.preview = 'image';
|
|
18
|
+
this.src = undefined;
|
|
19
|
+
this.subject = undefined;
|
|
20
|
+
this.tone = 'weak';
|
|
21
|
+
this.variant = undefined;
|
|
22
|
+
}
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.hasActions = this.host.querySelector('[slot="actions"]') !== null;
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
var _a;
|
|
28
|
+
return (index.h(index.Host, null, ((_a = this.icon) !== null && _a !== void 0 ? _a : this.preview === 'avatar') && index.h("mds-avatar", { class: "avatar", icon: this.icon, initials: this.initials, part: "avatar", src: this.src, tone: this.tone, variant: this.variant }), this.src && this.preview !== 'avatar' && index.h("mds-img", { class: "picture", part: "picture", src: this.src }), index.h("div", { class: "content", part: "content" }, this.subject && index.h("mds-text", { class: "subject", typography: "h6", variant: "title" }, this.subject), index.h("mds-text", { class: "message", truncate: "all", typography: "caption", variant: "info" }, this.message), this.hasActions && index.h("div", { class: "actions", part: "actions" }, index.h("slot", { name: "actions" }))), index.h("mds-button", { class: "close-button", icon: miBaselineCancel })));
|
|
29
|
+
}
|
|
30
|
+
get host() { return index.getElement(this); }
|
|
31
|
+
};
|
|
32
|
+
MdsPushNotification.style = mdsPushNotificationCss;
|
|
33
|
+
|
|
34
|
+
exports.mds_push_notification = MdsPushNotification;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-04ec0413.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchBrowser = () => {
|
|
11
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-push-notification.cjs.js', document.baseURI).href));
|
|
12
|
+
const opts = {};
|
|
13
|
+
if (importMeta !== '') {
|
|
14
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
15
|
+
}
|
|
16
|
+
return index.promiseResolve(opts);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
patchBrowser().then(options => {
|
|
20
|
+
return index.bootstrapLazy([["mds-push-notification.cjs",[[1,"mds-push-notification",{"icon":[513],"initials":[1537],"message":[513],"preview":[513],"src":[513],"subject":[513],"tone":[513],"variant":[513]}]]]], options);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const hash = (s) => {
|
|
2
|
+
let i, h;
|
|
3
|
+
for (i = 0, h = 0; i < s.length; i++) {
|
|
4
|
+
h = Math.imul(31, h) + s.charCodeAt(i) | 0;
|
|
5
|
+
}
|
|
6
|
+
return h.toString();
|
|
7
|
+
};
|
|
8
|
+
const randomInt = (max) => Math.floor(Math.random() * max);
|
|
9
|
+
const unslugName = (name) => {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
|
|
12
|
+
};
|
|
13
|
+
const setAttributeIfEmpty = (element, attribute, value) => {
|
|
14
|
+
var _a;
|
|
15
|
+
if (element.hasAttribute(attribute)) {
|
|
16
|
+
return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
|
|
17
|
+
}
|
|
18
|
+
element.setAttribute(attribute, value);
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
const hashValue = (value) => `${value}-${hash(value)}`;
|
|
22
|
+
const hashRandomValue = (value) => {
|
|
23
|
+
const randomValue = randomInt(1000000);
|
|
24
|
+
if (value) {
|
|
25
|
+
return `${value}-${hash(randomValue.toString())}`;
|
|
26
|
+
}
|
|
27
|
+
return hash(randomValue.toString());
|
|
28
|
+
};
|
|
29
|
+
export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { fileExtensionsDictionary } from "../dictionary/file-extensions";
|
|
2
|
+
import { fileFormatsVariant } from "../type/variant-file-format";
|
|
3
|
+
const sanitizeFilename = (filename, error = 'Attribute "filename" is undefined.') => {
|
|
4
|
+
var _a;
|
|
5
|
+
if (filename === undefined) {
|
|
6
|
+
throw console.error(error);
|
|
7
|
+
}
|
|
8
|
+
if (filename.includes('/')) {
|
|
9
|
+
return (_a = filename.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
10
|
+
}
|
|
11
|
+
return filename;
|
|
12
|
+
};
|
|
13
|
+
const sanitizeSuffix = (rawFilename) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const filename = sanitizeFilename(rawFilename);
|
|
16
|
+
if (filename.includes('.')) {
|
|
17
|
+
return (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : '';
|
|
18
|
+
}
|
|
19
|
+
return filename;
|
|
20
|
+
};
|
|
21
|
+
const getName = (rawFilename) => {
|
|
22
|
+
var _a;
|
|
23
|
+
const filename = sanitizeFilename(rawFilename);
|
|
24
|
+
if (filename.includes('.')) {
|
|
25
|
+
return (_a = filename.split('.')[0]) !== null && _a !== void 0 ? _a : '';
|
|
26
|
+
}
|
|
27
|
+
return filename;
|
|
28
|
+
};
|
|
29
|
+
const getSuffix = (rawFilename, suffixOverride) => {
|
|
30
|
+
const suffix = sanitizeSuffix(rawFilename);
|
|
31
|
+
const filename = sanitizeFilename(rawFilename);
|
|
32
|
+
if (suffixOverride !== null && suffixOverride !== undefined) {
|
|
33
|
+
return suffixOverride.toLowerCase();
|
|
34
|
+
}
|
|
35
|
+
if (suffix !== filename) {
|
|
36
|
+
return suffix;
|
|
37
|
+
}
|
|
38
|
+
return 'default';
|
|
39
|
+
};
|
|
40
|
+
const getExtensionInfos = (rawFilename, suffixOverride) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const suffix = getSuffix(rawFilename, suffixOverride).toLocaleLowerCase();
|
|
43
|
+
return (_a = fileExtensionsDictionary[suffix]) !== null && _a !== void 0 ? _a : fileExtensionsDictionary.default;
|
|
44
|
+
};
|
|
45
|
+
const getFormatsVariant = (rawFilename, suffixOverride) => {
|
|
46
|
+
return fileFormatsVariant[getExtensionInfos(rawFilename, suffixOverride).format];
|
|
47
|
+
};
|
|
48
|
+
export { getExtensionInfos, getFormatsVariant, getSuffix, getName, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const BASE64_SVG_ICON = 'data:image/svg+xml;base64,';
|
|
2
|
+
const MARKUP_SVG_ICON = '<svg ';
|
|
3
|
+
const isIconFormatIsBase64 = (icon) => {
|
|
4
|
+
if (!icon) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
return icon.startsWith(BASE64_SVG_ICON);
|
|
8
|
+
};
|
|
9
|
+
const isIconFormatIsSVG = (icon) => {
|
|
10
|
+
if (!icon) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return icon.startsWith(MARKUP_SVG_ICON);
|
|
14
|
+
};
|
|
15
|
+
export { isIconFormatIsBase64, isIconFormatIsSVG, BASE64_SVG_ICON, MARKUP_SVG_ICON, };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export class KeyboardManager {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.elements = [];
|
|
4
|
+
this.handleClickBehaviorDispatchEvent = (event) => {
|
|
5
|
+
if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
|
|
6
|
+
event.target.click();
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
this.handleEscapeBehaviorDispatchEvent = (event) => {
|
|
10
|
+
if (event.code === 'Escape' && this.escapeCallback) {
|
|
11
|
+
this.escapeCallback();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.addElement = (el, name = 'element') => {
|
|
15
|
+
this.elements[name] = el;
|
|
16
|
+
};
|
|
17
|
+
this.attachClickBehavior = (name = 'element') => {
|
|
18
|
+
if (this.elements[name]) {
|
|
19
|
+
this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.detachClickBehavior = (name = 'element') => {
|
|
23
|
+
if (this.elements[name]) {
|
|
24
|
+
this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.attachEscapeBehavior = (callBack) => {
|
|
28
|
+
this.escapeCallback = callBack;
|
|
29
|
+
if (window !== undefined) {
|
|
30
|
+
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.detachEscapeBehavior = () => {
|
|
34
|
+
this.escapeCallback = () => { return; };
|
|
35
|
+
if (window !== undefined) {
|
|
36
|
+
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
|
|
2
|
+
if (duration.includes('ms')) {
|
|
3
|
+
return Number(duration.replace('ms', ''));
|
|
4
|
+
}
|
|
5
|
+
if (duration.includes('s')) {
|
|
6
|
+
return Number(duration.replace('s', '')) * 1000;
|
|
7
|
+
}
|
|
8
|
+
return defaultValue;
|
|
9
|
+
};
|
|
10
|
+
const cssSizeToNumber = (size, defaultValue = 0) => {
|
|
11
|
+
if (size.includes('px')) {
|
|
12
|
+
return Number(size.replace('px', ''));
|
|
13
|
+
}
|
|
14
|
+
if (size.includes('rem')) {
|
|
15
|
+
return Number(size.replace('rem', '')) * 16;
|
|
16
|
+
}
|
|
17
|
+
if (size.includes('em')) {
|
|
18
|
+
return Number(size.replace('em', '')) * 16;
|
|
19
|
+
}
|
|
20
|
+
return defaultValue;
|
|
21
|
+
};
|
|
22
|
+
export { cssDurationToMilliseconds, cssSizeToNumber, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { generator } from "./utils/prng";
|
|
2
|
+
import { strToCharCodeArray } from "./utils/string";
|
|
3
|
+
import { randomSign, minMaxLooped } from "./utils/math";
|
|
4
|
+
const rand = generator();
|
|
5
|
+
const random = (base, offset) => () => (base + rand.range(0, offset)) * randomSign();
|
|
6
|
+
export const generateRandomCharCodeArray = (base, offset) => str => strToCharCodeArray(str).map(random(base, offset));
|
|
7
|
+
export const charCodeArrayToString = ({ str, minCharCode, maxCharCode, placeholderChar, charStep, }) => charCodes => charCodes.reduce((acc, item, index) => {
|
|
8
|
+
if (item !== 0) {
|
|
9
|
+
if (Math.abs(item) > charStep) {
|
|
10
|
+
return acc + placeholderChar;
|
|
11
|
+
}
|
|
12
|
+
return (acc +
|
|
13
|
+
String.fromCharCode(minMaxLooped(minCharCode, maxCharCode)(str.charCodeAt(index) + item)));
|
|
14
|
+
}
|
|
15
|
+
return acc + str.charAt(index);
|
|
16
|
+
}, '');
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { generateRandomCharCodeArray, charCodeArrayToString } from "./core";
|
|
2
|
+
import { noop } from "./utils/noop";
|
|
3
|
+
class RandomText {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
this.start = () => {
|
|
6
|
+
const { frameOffset, charOffset, str, speed } = this;
|
|
7
|
+
const randoms = generateRandomCharCodeArray(frameOffset, charOffset)(str);
|
|
8
|
+
this.stop();
|
|
9
|
+
this.rafId = requestAnimationFrame(() => {
|
|
10
|
+
this.step(randoms, speed, speed);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
Object.assign(this, Object.assign(Object.assign({}, RandomText.defaults), options));
|
|
14
|
+
}
|
|
15
|
+
stop() {
|
|
16
|
+
cancelAnimationFrame(this.rafId);
|
|
17
|
+
}
|
|
18
|
+
step(randoms, stepCount, speed) {
|
|
19
|
+
const { str, charStep, minCharCode, maxCharCode, placeholderChar, onProgress, onComplete, } = this;
|
|
20
|
+
const stepArray = randoms.slice(0, stepCount);
|
|
21
|
+
const steppedArray = stepArray.map(item => {
|
|
22
|
+
if (item > 0)
|
|
23
|
+
return item - 1;
|
|
24
|
+
if (item < 0)
|
|
25
|
+
return item + 1;
|
|
26
|
+
return 0;
|
|
27
|
+
});
|
|
28
|
+
const output = charCodeArrayToString({
|
|
29
|
+
str,
|
|
30
|
+
minCharCode,
|
|
31
|
+
maxCharCode,
|
|
32
|
+
placeholderChar,
|
|
33
|
+
charStep,
|
|
34
|
+
})(steppedArray);
|
|
35
|
+
const updatedRandoms = [...steppedArray, ...randoms.slice(stepCount)];
|
|
36
|
+
onProgress(output);
|
|
37
|
+
if (output !== str) {
|
|
38
|
+
this.rafId = requestAnimationFrame(() => {
|
|
39
|
+
this.step(updatedRandoms, stepCount + speed, speed);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
onComplete(output);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
RandomText.defaults = {
|
|
48
|
+
str: '',
|
|
49
|
+
speed: 2,
|
|
50
|
+
placeholderChar: '_',
|
|
51
|
+
frameOffset: 30,
|
|
52
|
+
charOffset: 20,
|
|
53
|
+
charStep: 10,
|
|
54
|
+
minCharCode: 32,
|
|
55
|
+
maxCharCode: 122,
|
|
56
|
+
onProgress: noop,
|
|
57
|
+
onComplete: noop,
|
|
58
|
+
};
|
|
59
|
+
export default RandomText;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { generator } from "./prng";
|
|
2
|
+
const rand = generator();
|
|
3
|
+
export const randomSign = () => (Math.round(Math.random()) - 0.5) * 2;
|
|
4
|
+
export const generateRandomNumbers = base => charOffset => length => [...Array(length)].map(() => (base + rand.range(0, charOffset)) * randomSign());
|
|
5
|
+
export const minMaxLooped = (min, max) => value => {
|
|
6
|
+
if (value > max)
|
|
7
|
+
return min + (value - max);
|
|
8
|
+
if (value < min)
|
|
9
|
+
return max + (value - min);
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const noop = () => { };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const int32 = 2147483647;
|
|
2
|
+
const gen = v => (v * 16807) % int32;
|
|
3
|
+
const randomFloat = v => gen(v) / int32;
|
|
4
|
+
const randomInt = v => gen(v);
|
|
5
|
+
export const generator = (seed = 1) => {
|
|
6
|
+
let value = seed < 1 ? 1 : seed;
|
|
7
|
+
const next = () => {
|
|
8
|
+
value = randomInt(value);
|
|
9
|
+
return value;
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
random: () => next(),
|
|
13
|
+
randomFloat: () => randomFloat(next()),
|
|
14
|
+
range: (min, max) => {
|
|
15
|
+
const minimum = min - 0.4999;
|
|
16
|
+
const maximum = max + 0.4999;
|
|
17
|
+
return Math.round(minimum + (maximum - minimum) * randomFloat(next()));
|
|
18
|
+
},
|
|
19
|
+
rangeFloat: (min, max) => min + (max - min) * randomFloat(next()),
|
|
20
|
+
};
|
|
21
|
+
};
|