@everymatrix/cashier-modal 1.44.0 → 1.45.2

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/index.html DELETED
@@ -1,37 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset='utf-8'>
5
- <meta name='viewport' content='width=device-width,initial-scale=1'>
6
-
7
- <title>
8
- cashier-modal
9
- </title>
10
- <link rel="stylesheet" href="public/reset.css">
11
- <script src='dist/cashier-modal.js'></script>
12
- </head>
13
-
14
- <body>
15
- <style>
16
- html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
17
- .header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
18
- .header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
19
- .header__name { color: #fff; }
20
- .header__name span { margin-right: 10px; font-weight: bold; }
21
- .webcomponent { padding: 10px 20px; }
22
- </style>
23
- <header class="header">
24
- <div class="header__logo">
25
- <svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
26
- </div>
27
- <h1 class="header__name">
28
- <span>WEBCOMPONENT:</span> cashier-modal
29
- </h1>
30
- </header>
31
-
32
- <div class="webcomponent">
33
- <cashier-modal></cashier-modal>
34
- </div>
35
-
36
- </body>
37
- </html>
package/index.js DELETED
@@ -1 +0,0 @@
1
- import './dist/cashier-modal.js';
Binary file
package/public/reset.css DELETED
@@ -1,48 +0,0 @@
1
- /* http://meyerweb.com/eric/tools/css/reset/
2
- v2.0 | 20110126
3
- License: none (public domain)
4
- */
5
-
6
- html, body, div, span, applet, object, iframe,
7
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
- a, abbr, acronym, address, big, cite, code,
9
- del, dfn, em, img, ins, kbd, q, s, samp,
10
- small, strike, strong, sub, sup, tt, var,
11
- b, u, i, center,
12
- dl, dt, dd, ol, ul, li,
13
- fieldset, form, label, legend,
14
- table, caption, tbody, tfoot, thead, tr, th, td,
15
- article, aside, canvas, details, embed,
16
- figure, figcaption, footer, header, hgroup,
17
- menu, nav, output, ruby, section, summary,
18
- time, mark, audio, video {
19
- margin: 0;
20
- padding: 0;
21
- border: 0;
22
- font-size: 100%;
23
- font: inherit;
24
- vertical-align: baseline;
25
- }
26
- /* HTML5 display-role reset for older browsers */
27
- article, aside, details, figcaption, figure,
28
- footer, header, hgroup, menu, nav, section {
29
- display: block;
30
- }
31
- body {
32
- line-height: 1;
33
- }
34
- ol, ul {
35
- list-style: none;
36
- }
37
- blockquote, q {
38
- quotes: none;
39
- }
40
- blockquote:before, blockquote:after,
41
- q:before, q:after {
42
- content: '';
43
- content: none;
44
- }
45
- table {
46
- border-collapse: collapse;
47
- border-spacing: 0;
48
- }
package/rollup.config.js DELETED
@@ -1,59 +0,0 @@
1
- import svelte from 'rollup-plugin-svelte';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import resolve from '@rollup/plugin-node-resolve';
4
- import serve from 'rollup-plugin-dev-server';
5
- import livereload from 'rollup-plugin-livereload';
6
- import { terser } from 'rollup-plugin-terser';
7
- import sveltePreprocess from 'svelte-preprocess';
8
- import typescript from '@rollup/plugin-typescript';
9
- const production = process.env.NODE_ENV === 'production';
10
- const dev = process.env.NODE_ENV === 'development';
11
-
12
- export default {
13
- input: 'src/index.ts',
14
- output: {
15
- sourcemap: true,
16
- format: 'umd',
17
- name: 'app',
18
- file: 'dist/cashier-modal.js'
19
- },
20
- plugins: [
21
- svelte({
22
- preprocess: sveltePreprocess(),
23
- compilerOptions: {
24
- // enable run-time checks when not in production
25
- customElement: true,
26
- dev: !production
27
- }
28
- }),
29
- commonjs(),
30
- resolve({
31
- browser: true,
32
- dedupe: ['svelte']
33
- }),
34
- dev && serve({
35
- open: true,
36
- verbose: true,
37
- allowCrossOrigin: true,
38
- historyApiFallback: false,
39
- host: 'localhost',
40
- port: 5050,
41
- }),
42
- dev && livereload({ watch: ['', 'dist'] }),
43
- typescript({
44
- sourceMap: !production,
45
- inlineSources: !production,
46
- }),
47
- // If we're building for production (npm run build
48
- // instead of npm run dev), minify
49
- production &&
50
- terser({
51
- output: {
52
- comments: "all"
53
- },
54
- })
55
- ],
56
- watch: {
57
- clearScreen: false
58
- }
59
- };
@@ -1,144 +0,0 @@
1
- <svelte:options tag={null} />
2
-
3
- <script lang="ts">
4
- import { onMount } from 'svelte';
5
- import { fade } from 'svelte/transition';
6
-
7
- export let clientstyling:string = '';
8
- export let clientstylingurl:string = '';
9
- export let duration:string = '5ms';
10
- export let width:string;
11
- export let height:string;
12
- let modalElement:HTMLElement;
13
- let customStylingContainer:HTMLElement;
14
- let show:boolean = false;
15
-
16
- const close = () => {
17
- show = false;
18
- window.postMessage({ type: 'ClosedCashierModal' }, window.location.href);
19
- window.postMessage({ type: 'EnableScroll' }, window.location.href);
20
- };
21
-
22
- const messageHandler = (e:any) => {
23
- if (e.data.type == 'ShowCashierModal') {
24
- show = true;
25
- window.postMessage({ type: 'DisableScroll' }, window.location.href);
26
- }
27
- if (e.data.type == 'HideCashierModal') {
28
- close()
29
- }
30
- }
31
-
32
- const setClientStyling = () => {
33
- let sheet = document.createElement('style');
34
- sheet.innerHTML = clientstyling;
35
- customStylingContainer.appendChild(sheet);
36
- }
37
-
38
- const setClientStylingURL = () => {
39
- let url:URL = new URL(clientstylingurl);
40
- let cssFile:HTMLElement = document.createElement('style');
41
-
42
- fetch(url.href)
43
- .then((res:any) => res.text())
44
- .then((data:any) => {
45
- cssFile.innerHTML = data
46
-
47
- setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
48
- });
49
- }
50
-
51
- onMount(() => {
52
- window.addEventListener('message', messageHandler, false);
53
-
54
- return () => {
55
- window.removeEventListener('message', messageHandler);
56
- }
57
- });
58
-
59
- $: clientstyling && customStylingContainer && setClientStyling();
60
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
61
- </script>
62
-
63
-
64
- {#if show}
65
- <div bind:this={customStylingContainer} part="CustomStylingContainer">
66
- <div
67
- class="ModalWindow"
68
- part="ModalWindow"
69
- id="Modal"
70
- transition:fade="{{ transitionDuration: duration }}"
71
- bind:this={modalElement}
72
- bind:clientWidth={width}
73
- bind:clientHeight={height}>
74
-
75
- <div class="ModalContainer" part="ModalContainer">
76
- <slot />
77
- </div>
78
- </div>
79
- </div>
80
- {/if}
81
-
82
-
83
- <style lang="scss">
84
-
85
- *, *::before, *::after {
86
- margin: 0;
87
- padding: 0;
88
- box-sizing: border-box;
89
- }
90
-
91
- .ModalWindow {
92
- display: flex;
93
- position: absolute;
94
- align-items: center;
95
- justify-content: center;
96
- width: 100%;
97
- height: 100%;
98
- z-index: 4;
99
- top: 0;
100
- left: 0;
101
- background-color: var(--mmw--color-black-transparency-10, rgba(0, 0, 0, .1));
102
- container-type: inline-size;
103
- container-name: modal-window;
104
- border-radius: 6px;
105
- }
106
-
107
- .ModalContainer {
108
- background: var(--emw--color-white, #fff);
109
- border-radius: var(--emw--border-radius-medium, 4px);
110
- padding: var(--emw--spacing-large, 20px);
111
- width: 400px;
112
- }
113
-
114
- .ModalCloseBtn {
115
- position: absolute;
116
- display: flex;
117
- align-items: center;
118
- justify-content: center;
119
- top: 10px;
120
- right: 10px;
121
- padding: var(--emw--spacing-small-minus, 10px);
122
- border-radius: 50%;
123
- color: var(--emw--color-white, #fff);
124
- background: var(--mmw--color-gray-transparency-85, rgba(255, 255, 255, .85));
125
- cursor: pointer;
126
- transition: all 150ms ease-in-out;
127
-
128
- svg {
129
- width: 32px;
130
- height: 32px;
131
- }
132
-
133
- &:hover {
134
- background: var(--emw--color-gray-transparency-20, rgba(255, 255, 255, .2));
135
- }
136
- }
137
-
138
- @container modal-window (max-width:750px) {
139
- .ModalWindow .ModalContainer {
140
- width: 90%;
141
- max-width: 400px;
142
- }
143
- }
144
- </style>
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- import CashierModal from './CashierModal.svelte';
2
-
3
- !customElements.get('cashier-modal') && customElements.define('cashier-modal', CashierModal);
4
- export default CashierModal;
@@ -1,13 +0,0 @@
1
- import { html } from 'lit-element';
2
-
3
- import CashierModal from '../src/CashierModal';
4
-
5
- // This default export determines where your story goes in the story list
6
- export default {
7
- title: 'CashierModal',
8
- };
9
-
10
- // 👇 We create a “template” of how args map to rendering
11
- const CashierModal = ({ aProperty }) => html`<cashier-modal></cashier-modal>`;
12
-
13
- export const FirstStory = CashierModal.bind({});
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
-
4
- "include": ["src/**/*"],
5
- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]
6
- }