layerpro 0.8.5 → 0.9.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/docs/index.md ADDED
@@ -0,0 +1,206 @@
1
+ # I am LayerPro
2
+
3
+ ```
4
+ LayerPro by Dario Passariello
5
+ ```
6
+
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-006b98?logo=TypeScript&logoColor=white)](#)
8
+
9
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/layerpro/0.8.5)](https://socket.dev/npm/package/layerpro/overview/0.8.5)
10
+ [![layerpro](https://snyk.io/advisor/npm-package/layerpro/badge.svg)](https://snyk.io/advisor/npm-package/layerpro)
11
+
12
+ [![version](https://img.shields.io/npm/v/layerpro.svg)](https://npmjs.org/package/layerpro)
13
+ [![downloads](https://img.shields.io/npm/dm/layerpro.svg)](https://npmjs.org/package/layerpro)
14
+
15
+ ## About
16
+
17
+ 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.
18
+
19
+ Please make sure to read the [LICENSE](/LICENSE.md) agreement before implementing it in your application.
20
+
21
+ ## Live demo
22
+
23
+ [https://a51.dev/tests/](https://a51.dev/tests/)
24
+
25
+ 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.
26
+
27
+ ---
28
+
29
+ ## Install for react + webpack projects
30
+
31
+ ```
32
+ npm i layerpro --save-dev
33
+ ```
34
+
35
+ or update:
36
+
37
+ ```
38
+ npm i layerpro@latest --save-dev
39
+ ```
40
+
41
+ in the index (and only there):
42
+
43
+ ```javascript
44
+ import "layerpro";
45
+ ```
46
+
47
+ or
48
+
49
+ ```javascript
50
+ require("layerpro");
51
+ ```
52
+
53
+ ## Install for ejs or other type of projects (like html)
54
+
55
+ ```html
56
+ <script src="https://unpkg.com/layerpro@latest/index.js"></script>
57
+ ```
58
+
59
+ ## How to use it
60
+
61
+ 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).
62
+
63
+ For example, if you type **alert("hello, world!")**, you can see the result.
64
+
65
+ You can also use these tools as messages directly from the console.
66
+
67
+ ```javascript
68
+ alert("Hello world"); // Normal alert
69
+
70
+ prompt("Your Name"); // Ask for input
71
+
72
+ confirm(
73
+ "Hello world",
74
+ ()=>console.log("ciao"), // callback for YES / OK
75
+ ()=>console.log("bye") // callback for NO / CANCEL (you can use null if you don't want CB)
76
+ );
77
+
78
+ message(
79
+ "Hello world",
80
+ ()=>console.log("This happen after OK") // callback for YES / OK)
81
+ );
82
+ ```
83
+
84
+ ---
85
+
86
+ Popup:
87
+
88
+ ```javascript
89
+ import 'layerpro';
90
+
91
+ layerpro.popup.open(
92
+ {
93
+ id: String,
94
+ body: String | Component / Module, // text or component
95
+
96
+ buttons: {
97
+ confirm: {
98
+ text: "accept", // customizable
99
+ cb: yourFunctionCallBack() // call your script
100
+ },
101
+ cancel: {
102
+ text: "cancel", // customizable
103
+ cb: yourFunctionCallBack() // optional
104
+ }, // optional
105
+
106
+ width: Number,
107
+ height: Number,
108
+ maxWidth: Number | Percentance,
109
+ maxHeight: Number | Percentance,
110
+ minWidth: Number | Percentance,
111
+ minHeight: Number | Percentance,
112
+ name: String,
113
+ icon: "&#9888;", // or from html symbols table
114
+ iconize: true | false,
115
+ maximize: true | false,
116
+ close: true | false,
117
+ isMaximize: true | false,
118
+ dockable: true | false,
119
+ raised: true | false,
120
+ movable: true | false,
121
+ resizable: true | false,
122
+ store: true | false,
123
+ top: Number | Percentance,
124
+ left: Number | Percentance,
125
+ right: Number | Percentance,
126
+ bottom: Number | Percentance,
127
+ fadeIn: 0, // Milliseconds
128
+ fadeOut: 0, // Milliseconds
129
+ timer: 0 // Milliseconds
130
+ }
131
+ );
132
+ ```
133
+
134
+ Example:
135
+
136
+ ```javascript
137
+ import 'layerpro'
138
+
139
+ // EXAMPLE WITH ALL OPTIONS
140
+ function App() {
141
+
142
+ layerpro.popup.open(
143
+ {
144
+ id: 'examplePopup',
145
+ body: 'Example',
146
+ buttons: {
147
+ confirm: {
148
+ text: "accept",
149
+ cb: (e) => message("confirmed")
150
+ },
151
+ cancel: {
152
+ text: "cancel"
153
+ }
154
+ },
155
+ width: 400,
156
+ height: 300,
157
+ name: 'example',
158
+ icon: '&#9888;',
159
+ iconize: true,
160
+ maximize: true,
161
+ close: true,
162
+ isMaximize: false,
163
+ dockable: false,
164
+ raised: true,
165
+ movable: true,
166
+ resizable: false,
167
+ store: false,
168
+ top: '10%',
169
+ left: '10%',
170
+ right: 'auto',
171
+ bottom: 'auto',
172
+ // maxWidth: 500,
173
+ // maxHeight: 350,
174
+ // minWidth: 200,
175
+ // minHeight: 150,
176
+ fadeIn: 500,
177
+ fadeOut: 500,
178
+ timer: 0
179
+ }
180
+ )
181
+
182
+ }
183
+
184
+ export default App
185
+
186
+ ```
187
+
188
+ Here are some of the main advantages of using LayerPro:
189
+
190
+ **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.
191
+
192
+ **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.
193
+
194
+ **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.
195
+
196
+ **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.
197
+
198
+ **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.
199
+
200
+ **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.
201
+
202
+ **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.
203
+
204
+ ---
205
+
206
+ copyright (c) 2019 - 2024 by Dario Passariello