layerpro 0.9.74 → 0.9.80

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/README.md CHANGED
@@ -281,4 +281,4 @@ Here are some of the main advantages of using LayerPro:
281
281
 
282
282
  ---
283
283
 
284
- copyright (c) 2019 - 2024 by Dario Passariello
284
+ copyright (c) 2019 - 2025 by Dario Passariello
package/docs/index.md ADDED
@@ -0,0 +1,284 @@
1
+ # I am LayerPro
2
+
3
+ ![layerpro](https://raw.githubusercontent.com/passariello/container/be0611e9bead336dcec32d522d103e7e3661f502/layerpro/assets/logos/logo.svg)
4
+
5
+ ```
6
+ LayerPro by Dario Passariello
7
+ ```
8
+
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-006b98?logo=TypeScript&logoColor=white)](#)
10
+
11
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/layerpro/latest)](https://socket.dev/npm/package/layerpro/overview/latest)
12
+ [![layerpro](https://snyk.io/advisor/npm-package/layerpro/badge.svg)](https://snyk.io/advisor/npm-package/layerpro)
13
+
14
+ [![version](https://img.shields.io/npm/v/layerpro.svg)](https://npmjs.org/package/layerpro)
15
+ [![downloads](https://img.shields.io/npm/dm/layerpro.svg)](https://npmjs.org/package/layerpro)
16
+
17
+ ## About
18
+
19
+ LayerPro offers a completely new way to customize web popups in your application. With LayerPro, you can create custom alerts, prompts, confirmations, and messages, effectively replacing the default browser popups.
20
+
21
+ Please make sure to read the [LICENSE](/LICENSE.md) agreement before implementing it in your application.
22
+
23
+ ## Live demo
24
+
25
+ [https://a51.dev/tests/](https://a51.dev/tests/)
26
+
27
+ 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.
28
+
29
+ ---
30
+
31
+ ## Install for react + webpack projects
32
+
33
+ ```
34
+ npm i layerpro --save-dev
35
+ ```
36
+
37
+ or update:
38
+
39
+ ```
40
+ npm i layerpro@latest --save-dev
41
+ ```
42
+
43
+ in the index (and only there):
44
+
45
+ ```javascript
46
+ import "layerpro";
47
+ ```
48
+
49
+ or
50
+
51
+ ```javascript
52
+ require("layerpro");
53
+ ```
54
+
55
+ ## Install for ejs or other type of projects (like html)
56
+
57
+ ```html
58
+ <script src="https://unpkg.com/layerpro@latest/index.js"></script>
59
+ ```
60
+
61
+ ## How to use it
62
+
63
+ 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).
64
+
65
+ For example, if you type **alert("hello, world!")**, you can see the result.
66
+
67
+ You can also use these tools as messages directly from the console.
68
+
69
+ ```javascript
70
+ alert("Hello world"); // Normal alert
71
+
72
+ prompt("Your Name"); // Ask for input
73
+
74
+ confirm(
75
+ "Hello world",
76
+ ()=>console.log("hello"), // callback for YES / OK
77
+ ()=>console.log("bye") // callback for NO / CANCEL (you can use null if you don't want CB)
78
+ );
79
+
80
+ message(
81
+ "Hello world",
82
+ ()=>console.log("This happen after OK") // callback for YES / OK)
83
+ );
84
+ ```
85
+
86
+ ---
87
+
88
+ Popup:
89
+
90
+ ```javascript
91
+ import 'layerpro';
92
+
93
+ layerpro.popup.open(
94
+ {
95
+ id: String,
96
+ body: String | React Component | Module, // text or component
97
+ name: String,
98
+ icon: "&#9888;", // or from html symbols table
99
+
100
+ buttons: {
101
+ confirm: {
102
+ text: "accept", // customizable
103
+ cb: yourFunctionCallBack() // call your script
104
+ },
105
+ cancel: {
106
+ text: "cancel", // customizable
107
+ cb: yourFunctionCallBack() // optional
108
+ }, // optional
109
+
110
+ top: Number | String,
111
+ left: Number | String,
112
+ right: Number | String,
113
+ bottom: Number | String,
114
+
115
+ width: Number | String,
116
+ height: Number | String,
117
+ minWidth: Number | String,
118
+ minHeight: Number | String,
119
+ maxWidth: Number | String,
120
+ maxHeight: Number | String,
121
+
122
+ fadeIn: Number, // Milliseconds
123
+ fadeOut: Number, // Milliseconds
124
+ timer: Number // Milliseconds
125
+
126
+ iconize: Boolean,
127
+ maximize: Boolean,
128
+ close: Boolean,
129
+ isMaximize: Boolean,
130
+ dockable: Boolean,
131
+ raised: Boolean,
132
+ movable: Boolean,
133
+ resizable: Boolean,
134
+ store: Boolean,
135
+ }
136
+ );
137
+ ```
138
+
139
+ Example:
140
+
141
+ ```javascript
142
+ import 'layerpro'
143
+
144
+ // EXAMPLE WITH ALL OPTIONS
145
+ function App() {
146
+
147
+ layerpro.popup.open(
148
+ {
149
+ id: 'examplePopup',
150
+ body: 'Example',
151
+ name: 'example',
152
+ icon: '&#9888;',
153
+
154
+ buttons: {
155
+ confirm: {
156
+ text: "accept",
157
+ cb: (e) => message("confirmed")
158
+ },
159
+ cancel: {
160
+ text: "cancel"
161
+ }
162
+ },
163
+
164
+ width: 400,
165
+ height: 300,
166
+ maxWidth: 500,
167
+ maxHeight: 350,
168
+ minWidth: 200,
169
+ minHeight: 150,
170
+ top: '10%',
171
+ left: '10%',
172
+ right: 'auto',
173
+ bottom: 'auto',
174
+
175
+ fadeIn: 500,
176
+ fadeOut: 500,
177
+ timer: 0
178
+
179
+ iconize: true,
180
+ maximize: true,
181
+ close: true,
182
+ isMaximize: false,
183
+ dockable: false,
184
+ raised: true,
185
+ movable: true,
186
+ resizable: false,
187
+ store: false,
188
+ }
189
+ )
190
+ }
191
+
192
+ export default App
193
+
194
+ ```
195
+
196
+ Example with a React component:
197
+
198
+ ```javascript
199
+
200
+ // Example using React Component
201
+
202
+ import React from "react"
203
+ import 'layerpro'
204
+
205
+ export default () => {
206
+
207
+ // Custom Component6
208
+ const TestApp = () => {
209
+ return (
210
+ <div>
211
+ Hello
212
+ <label>
213
+ Alert: <input type="button" value="Alert" onClick={() => alert("Hello")} />
214
+ </label>
215
+ </div>
216
+ )
217
+ }
218
+
219
+ // Run into layerpro
220
+ layerpro.popup.open(
221
+ {
222
+ id: 'examplePopup',
223
+ body: TestApp(),
224
+ buttons: {
225
+ confirm: {
226
+ text: "accept",
227
+ cb: () => {
228
+ message("confirmed")
229
+ }
230
+ },
231
+ cancel: {
232
+ text: "cancel",
233
+ cb: () => {
234
+ alert("cancelled")
235
+ }
236
+ }
237
+ },
238
+ width: 350,
239
+ height: 300,
240
+ name: 'example',
241
+ icon: '&#9888;',
242
+ iconize: true,
243
+ maximize: true,
244
+ close: true,
245
+ isMaximize: false,
246
+ dockable: false,
247
+ raised: true,
248
+ movable: true,
249
+ resizable: false,
250
+ store: false,
251
+ top: '10%',
252
+ left: '10%',
253
+ right: 'auto',
254
+ bottom: 'auto',
255
+ minWidth: 200,
256
+ minHeight: 150,
257
+ fadeIn: 500,
258
+ fadeOut: 500,
259
+ timer: 0
260
+ }
261
+ )
262
+
263
+ }
264
+ ```
265
+
266
+ Here are some of the main advantages of using LayerPro:
267
+
268
+ **Complete Customization**: LayerPro allows you to create highly customized web pop-ups, surpassing the limitations of standard browser pop-ups. You can configure every aspect of the pop-up, including size, position, icons, and much more.
269
+
270
+ **Improved User Interface**: With LayerPro, you can create alerts, prompts, confirmations, and personalized messages that seamlessly integrate with your application's design, enhancing the user experience.
271
+
272
+ **Compatibility with Various Frameworks**: LayerPro is compatible with HTML, React, Vue, and other frontend frameworks and libraries, making it extremely versatile and easy to integrate into any project.
273
+
274
+ **Ease of Use**: Once LayerPro is imported into your project, you can access all its features globally without needing additional imports. This simplifies the development process and reduces boilerplate code.
275
+
276
+ **Advanced Features**: LayerPro offers advanced options such as the ability to maximize, resize, move, and dock pop-ups. You can also configure fade-in and fade-out effects for a smoother experience.
277
+
278
+ **Override Browser Pop-ups**: LayerPro allows you to replace browser pop-ups with customized versions, eliminating the unattractive look of default pop-ups and providing complete control over the appearance and behavior of your messages.
279
+
280
+ **Component Support**: You can use components or modules as the body of your pop-ups, allowing you to create complex and interactive user interfaces within the pop-ups themselves.
281
+
282
+ ---
283
+
284
+ copyright (c) 2019 - 2025 by Dario Passariello
package/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- /*
2
- Copyright: © 2019 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
1
+ /*!
2
+ layerpro
3
+ Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>
4
+ Licensed under MIT License, see
5
+ https://dario.passariello.ca
4
6
  */
5
7
 
8
+
6
9
  /// <reference path="./types/jquery.d.ts" />
7
10
  /// <reference path="./types/layerpro.d.ts" />