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