layerpro 1.0.21 → 1.1.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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2019 Dario Passariello - <dariopassariello@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/docs/index.md ADDED
@@ -0,0 +1,208 @@
1
+ # [LayerPro](https://npmjs.com/package/layerpro)
2
+
3
+ ![layerpro](https://raw.githubusercontent.com/passariello/container/be0611e9bead336dcec32d522d103e7e3661f502/layerpro/assets/logos/logo.svg)
4
+
5
+ [![version](https://img.shields.io/npm/v/layerpro.svg)](https://npmjs.org/package/layerpro)
6
+ [![downloads](https://img.shields.io/npm/dm/layerpro.svg)](https://npmjs.org/package/layerpro)
7
+
8
+ [![GitBook](https://img.shields.io/static/v1?message=Documented%20on%20GitBook&logo=gitbook&logoColor=ffffff&label=%20&labelColor=5c5c5c&color=3F89A1)](https://a51.gitbook.io/layerpro)
9
+
10
+ [![NPM](https://nodei.co/npm/layerpro.png?stars=true&downloads=true)](https://npmjs.com/package/layerpro)
11
+
12
+ ## About
13
+
14
+ LayerPro offers a completely new way to customize web modals in your application. With LayerPro, you can create custom alerts, prompts, confirmations, and messages, effectively replacing the default browser modals.
15
+
16
+ Please make sure to read the [LICENSE](/LICENSE.md) agreement before implementing it in your application.
17
+
18
+ ## Live demo
19
+
20
+ [https://tests.a51.dev/](https://tests.a51.dev/)
21
+
22
+ You can view an HTML version demonstrating how dpHelper and LayerPro work together. These tools can be used with HTML, React, Vue, or any other frontend framework/library.
23
+
24
+ ---
25
+
26
+ ## Install for react + webpack projects
27
+
28
+ ```js
29
+ npm i layerpro --save-dev
30
+ ```
31
+
32
+ or update:
33
+
34
+ ```js
35
+ npm i layerpro@latest --save-dev
36
+ ```
37
+
38
+ in the index (and only there):
39
+
40
+ ```js
41
+ import "layerpro";
42
+ ```
43
+
44
+ or
45
+
46
+ ```js
47
+ require("layerpro");
48
+ ```
49
+
50
+ ## Install for ejs or other type of projects (like html)
51
+
52
+ ```html
53
+ <script src="https://cdn.jsdelivr.net/npm/layerpro"></script>
54
+ ```
55
+
56
+ ## How to use it
57
+
58
+ ype layerpro in your console to explore all the available tools you can use globally! You can call these tools from anywhere without needing to import them (just include the import once in your index file).
59
+
60
+ For example, if you type **alert("hello, world!")**, you can see the result.
61
+
62
+ You can also use these tools as messages directly from the console.
63
+
64
+ ```js
65
+ alert("Hello world"); // Normal alert
66
+
67
+ prompt("Your Name"); // Ask for input
68
+
69
+ confirm(
70
+ "Hello world",
71
+ ()=>console.log("hello"), // callback for YES / OK
72
+ ()=>console.log("bye") // callback for NO / CANCEL (you can use null if you don't want CB)
73
+ );
74
+
75
+ message(
76
+ "Hello world",
77
+ ()=>console.log("This happen after OK") // callback for YES / OK)
78
+ );
79
+ ```
80
+
81
+ Example:
82
+
83
+ ```js
84
+ import 'layerpro'
85
+
86
+ // EXAMPLE WITH ALL OPTIONS
87
+ function App() {
88
+
89
+ layerpro.popup.open(
90
+ {
91
+ id: 'exampleModal',
92
+ body: 'Example',
93
+ name: 'example',
94
+ icon: '&#9888;',
95
+
96
+ buttons: {
97
+ confirm: {
98
+ text: "accept",
99
+ cb: (e) => message("confirmed")
100
+ },
101
+ cancel: {
102
+ text: "cancel"
103
+ }
104
+ },
105
+
106
+ width: 400,
107
+ height: 300,
108
+ maxWidth: 500,
109
+ maxHeight: 350,
110
+ minWidth: 200,
111
+ minHeight: 150,
112
+ top: '10%',
113
+ left: '10%',
114
+ right: 'auto',
115
+ bottom: 'auto',
116
+
117
+ fadeIn: 500,
118
+ fadeOut: 500,
119
+ timer: 0,
120
+
121
+ iconize: true,
122
+ maximize: true,
123
+ close: true,
124
+ isMaximize: false,
125
+ dockable: false,
126
+ raised: true,
127
+ movable: true,
128
+ resizable: false,
129
+ store: false
130
+ }
131
+ )
132
+ }
133
+
134
+ export default App
135
+
136
+ ```
137
+
138
+ Example with a React component:
139
+
140
+ ```js
141
+
142
+ // Example using React Component
143
+
144
+ import React from "react"
145
+ import 'layerpro'
146
+
147
+ export default () => {
148
+
149
+ // Custom Component6
150
+ const TestApp = () => {
151
+ return (
152
+ <div>
153
+ Hello
154
+ <label>
155
+ Alert: <input type="button" value="Alert" onClick={() => alert("Hello")} />
156
+ </label>
157
+ </div>
158
+ )
159
+ }
160
+
161
+ // Run into layerpro
162
+ layerpro.popup.open(
163
+ {
164
+ id: 'exampleModal',
165
+ body: TestApp(),
166
+ buttons: {
167
+ confirm: {
168
+ text: "accept",
169
+ cb: () => {
170
+ message("confirmed")
171
+ }
172
+ },
173
+ cancel: {
174
+ text: "cancel",
175
+ cb: () => {
176
+ alert("cancelled")
177
+ }
178
+ }
179
+ },
180
+ width: 350,
181
+ height: 300,
182
+ name: 'example',
183
+ icon: '&#9888;',
184
+ iconize: true,
185
+ maximize: true,
186
+ close: true,
187
+ isMaximize: false,
188
+ dockable: false,
189
+ raised: true,
190
+ movable: true,
191
+ resizable: false,
192
+ store: false,
193
+ top: '10%',
194
+ left: '10%',
195
+ right: 'auto',
196
+ bottom: 'auto',
197
+ minWidth: 200,
198
+ minHeight: 150,
199
+ fadeIn: 500,
200
+ fadeOut: 500,
201
+ timer: 0
202
+ }
203
+ )
204
+
205
+ }
206
+ ```
207
+
208
+ copyright (c) 2019 - 2025 by Dario Passariello
File without changes