layerpro 0.0.64 → 0.0.65

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.
Files changed (66) hide show
  1. package/{dist/LICENSE.txt → LICENSE.txt} +0 -0
  2. package/{dist/README.md → README.md} +0 -0
  3. package/{documents/SECURITY.md → SECURITY.md} +0 -0
  4. package/index.js +2 -7
  5. package/index.js.LICENSE.txt +29 -0
  6. package/package.json +3 -1
  7. package/.editorconfig +0 -13
  8. package/.env +0 -3
  9. package/.eslintignore +0 -12
  10. package/.eslintrc.json +0 -110
  11. package/.gitattributes +0 -2
  12. package/.jsbeautifyrc +0 -26
  13. package/.prettierignore +0 -2
  14. package/.prettierrc +0 -7
  15. package/.vscode/launch.json +0 -22
  16. package/.vscode/settings.json +0 -84
  17. package/.vscodeignore +0 -28
  18. package/__mocks__/fileMock.js +0 -3
  19. package/__mocks__/styleMock.js +0 -3
  20. package/babel.config.js +0 -34
  21. package/backup.bat +0 -43
  22. package/coverage/coverage-final.json +0 -1
  23. package/coverage/lcov-report/base.css +0 -224
  24. package/coverage/lcov-report/block-navigation.js +0 -87
  25. package/coverage/lcov-report/favicon.png +0 -0
  26. package/coverage/lcov-report/index.html +0 -101
  27. package/coverage/lcov-report/prettify.css +0 -1
  28. package/coverage/lcov-report/prettify.js +0 -2
  29. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  30. package/coverage/lcov-report/sorter.js +0 -196
  31. package/coverage/lcov.info +0 -0
  32. package/documents/LICENSE.txt +0 -21
  33. package/documents/README.md +0 -7
  34. package/init.js +0 -33
  35. package/jest.config.js +0 -61
  36. package/jsconfig.json +0 -10
  37. package/node/createTag.js +0 -7
  38. package/node/gitDeploy.js +0 -7
  39. package/node/goLive.js +0 -7
  40. package/scripts/genLayer.jsx +0 -234
  41. package/scripts/message.jsx +0 -280
  42. package/scripts/mouseCoords.jsx +0 -45
  43. package/scripts/popup.jsx +0 -612
  44. package/scripts/purge.jsx +0 -29
  45. package/scripts/smoothScroll.js +0 -69
  46. package/scripts/window.js +0 -28
  47. package/styles/dock.scss +0 -100
  48. package/styles/general.scss +0 -241
  49. package/styles/icons.scss +0 -33
  50. package/styles/input.scss +0 -35
  51. package/styles/messages.scss +0 -76
  52. package/styles/resize.scss +0 -99
  53. package/styles/root.scss +0 -14
  54. package/styles/scrollbar.scss +0 -24
  55. package/tests/setupJest.tsx +0 -4
  56. package/tsconfig.json +0 -69
  57. package/typings/cordova.d.ts +0 -12
  58. package/typings/dphelper.d.ts +0 -29
  59. package/typings/image.d.ts +0 -9
  60. package/typings/index.d.ts +0 -7
  61. package/typings/layerpro.d.ts +0 -23
  62. package/typings/menupro.d.ts +0 -18
  63. package/typings/namespace.d.ts +0 -7
  64. package/typings/styles.d.ts +0 -27
  65. package/typings/vscode.d.ts +0 -14724
  66. package/webpack.config.js +0 -239
@@ -1,234 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- import { createRoot } from 'react-dom/client'
7
-
8
- export const genLayer = (p) => {
9
-
10
- var root // FUCKYOU FACEBOOK!
11
-
12
- let pContainer = p.raised === true ? '.popup_raised_' + p.id : '#popup'
13
-
14
- $('[class^="popup_window_"]', pContainer).removeClass('zHigh')
15
- $('[class^="popup_bar_"]', pContainer).removeClass('pupup_bar_selected')
16
- $('[class^="icon_"]', pContainer).removeClass('pupup_bar_selected')
17
-
18
- if (p.raised === true) {
19
- $('<div class="popup_raised_' + p.id + '">', pContainer)
20
- .appendTo('#popup')
21
- .css({
22
- 'pointer-events': 'auto',
23
- 'z-index': layerpro.popup.zIndex($('[class^="popup_overflow_"]', pContainer)) + 1000
24
- })
25
- }
26
-
27
- $('<div class="popup_overflow_' + p.id + '">', pContainer)
28
- .appendTo(pContainer)
29
- .css({
30
- 'top': p.top,
31
- 'left': p.left,
32
- 'right': p.right,
33
- 'bottom': p.bottom,
34
- 'width': p.width,
35
- 'height': p.height,
36
- 'min-width': p.minWidth,
37
- 'min-height': p.minHeight,
38
- 'pointer-events': 'auto',
39
- 'z-index': layerpro.popup.zIndex($('[class^="popup_overflow_"]', pContainer)) + 1
40
- })
41
- .on("mousedown", function (e) { layerpro.popup.index(p) })
42
- .hide()
43
- .fadeIn(p.fadeIn)
44
-
45
- let item = $('<div class="popup_window_' + p.id + '">', pContainer)
46
- //.on("mouseup", function( e ){ layerpro.popup.index( p ); })
47
- .appendTo('.popup_overflow_' + p.id)
48
- .css({ 'pointer-events': 'auto' })
49
- .addClass('zHigh')
50
-
51
- /*******************************************************************/
52
- // CHECK IF NEED CENTERED
53
-
54
- const pos = [p.top, p.left, p.bottom, p.right]
55
- const sum = pos.reduce((sumSoFar, nextValue) => {
56
- if (typeof nextValue === "number" && isFinite(nextValue)) { return sumSoFar + nextValue }
57
- return sumSoFar
58
- }, 0)
59
-
60
- if (sum === 0) layerpro.popup.center(p)
61
-
62
- /*******************************************************************/
63
- // BAR
64
-
65
- $('<div class="popup_bar_' + p.id + '">', pContainer)
66
- .appendTo(item)
67
- .addClass('pupup_bar_selected')
68
-
69
- $('<div class="popup_icon_' + p.id + '">' + p.icon + '</div>', pContainer)
70
- .appendTo(".popup_bar_" + p.id)
71
-
72
- $('<div class="popup_drag_' + p.id + '">' + p.name + '</div>', pContainer)
73
- .appendTo(".popup_bar_" + p.id)
74
-
75
- $('<div class="popup_option_' + p.id + '">', pContainer)
76
- .appendTo(".popup_bar_" + p.id)
77
-
78
- /*******************************************************************/
79
- // DOCK GENERATION
80
-
81
- if (p.iconize === true && $('#popup_dock').length === 0) {
82
-
83
- $('#root').css('margin', '0 0 var( --dock-height ) 0')
84
-
85
- let dock = `<div id="popup_dock">
86
- <div id="popup_dock_icon"></div>
87
- <div id="popup_dock_list"></div>
88
- <div id="popup_dock_options"></div>
89
- </div>`
90
-
91
- $(dock)
92
- .appendTo('#popup')
93
- .css({
94
- 'pointer-events': 'auto',
95
- 'z-index': layerpro.popup.zIndex($('#popup')) + 1000
96
- })
97
-
98
- }
99
-
100
- /*******************************************************************/
101
- // DOCK BEHAVIOR
102
-
103
- if ($('#popup_dock').length > 0 && p.dockable === true) {
104
- let dock_icon = `
105
- <div class="icon_${p.id}">
106
- <span>${p.icon}</span>
107
- <span>${p.name}</span>
108
- `
109
-
110
- $(dock_icon, '#popup_dock')
111
- .appendTo('#popup_dock_list')
112
- .addClass('pupup_bar_selected')
113
- .find("span")
114
- .on('click', function () {
115
-
116
- if ($(".popup_overflow_" + p.id + ':hidden')) {
117
- layerpro.popup.iconize(p)
118
- layerpro.popup.index(p)
119
- } else {
120
- layerpro.popup.iconize(p)
121
- }
122
-
123
- layerpro.popup.index(p)
124
-
125
- })
126
-
127
- $(`<button class="icon_close_${p.id}">X</button>`, '#popup_dock')
128
- .appendTo(`.icon_${p.id}`)
129
- .on('click', function () { layerpro.popup.close(p) })
130
- }
131
-
132
- /*******************************************************************/
133
- // ICONIFICATION
134
-
135
- if (p.iconize === true) {
136
- $('<button class="button_iconize_' + p.id + ' iconize">', '#popup')
137
- .appendTo(".popup_option_" + p.id)
138
- .on('click', function () { layerpro.popup.iconize(p) })
139
- }
140
-
141
- /*******************************************************************/
142
- // MAXIMIZATION
143
-
144
- if (p.maximize === true) {
145
- $('<button class="button_maximize_' + p.id + ' maximize">', '#popup')
146
- .appendTo(".popup_option_" + p.id)
147
- .on('click', function () { layerpro.popup.maximize(p) })
148
- }
149
-
150
- /*******************************************************************/
151
- // CLOSE
152
-
153
- if (p.close === true) {
154
- $('<button class="button_close_' + p.id + ' close">', '#popup')
155
- .appendTo(".popup_option_" + p.id)
156
- .on('click', function () { layerpro.popup.close(p) })
157
- }
158
-
159
- /*******************************************************************/
160
- // BODY
161
-
162
- let _overflow = $('<div class="popup_overflow_' + p.id + '">', '#popup')
163
-
164
- $('<div class="popup_internal_' + p.id + '">', _overflow)
165
- .appendTo(item)
166
-
167
- $('<div class="popup_body_' + p.id + '">', _overflow)
168
- .appendTo(".popup_internal_" + p.id)
169
- .hide()
170
- .fadeIn(p.fadeIn, function () { showBody() })
171
-
172
- const showBody = () => {
173
- if (p.body && !p.source) {
174
- if (p.body.props) {
175
-
176
- if (!p?.body?.props?.children) return (console.debug('You need to pass a component to LayerPro'))
177
-
178
- if (!root) root = createRoot($('.popup_body_' + p.id)[0])
179
- root.render(p.body.props.children)
180
- $('.popup_body_' + p.id).delay(900).fadeIn(100)
181
-
182
- //createRoot( $('.popup_body_' + p.id )[0] ).render( p.body.props.children );
183
-
184
- } else {
185
-
186
- $('.popup_body_' + p.id).html(p.body)
187
-
188
- }
189
- }
190
- return false
191
- }
192
-
193
- /*******************************************************************/
194
- // SOURCE
195
-
196
- if (p.source) {
197
-
198
- $('.popup_body_' + p.id).load(p.source, function (responseTxt, statusTxt, jqXHR) {
199
-
200
- if (statusTxt === "success") {
201
- $(this)
202
- .hide()
203
- .html(responseTxt)
204
- .fadeIn(p.fadeIn)
205
- /*.animate({ scrollTop:0 }, 500, 'swing'); */
206
- //console.log( responseTxt );
207
- }
208
-
209
- if (statusTxt === "error") {
210
- console.log("Error: " + jqXHR.status + " " + jqXHR.statusText)
211
- }
212
-
213
- })
214
-
215
- }
216
-
217
- /*******************************************************************/
218
- // MOVABLE
219
-
220
- if (p.movable) layerpro.popup.movable(p)
221
-
222
- /*******************************************************************/
223
- // RESIZE
224
-
225
- if (p.resizable) layerpro.popup.resizable(p)
226
-
227
- /*******************************************************************/
228
- // START MAXIMIZED
229
-
230
- if (p.isMaximize) layerpro.popup.maximize(p)
231
-
232
- return false
233
-
234
- }
@@ -1,280 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- /*****************************************************************************************/
7
- // ALERT
8
-
9
- layerpro.alert = (txt) => {
10
-
11
- const pUp = layerpro.popup.open({
12
- id: "__alert",
13
- body: "",
14
- source: "",
15
- width: 380,
16
- height: 220,
17
- name: "Warning",
18
- icon: "&#9888;",
19
- iconize: false,
20
- maximize: false,
21
- close: true,
22
- isMaximize: false,
23
- dockable: false,
24
- raised: true,
25
- movable: true,
26
- resizable: false,
27
- store: false,
28
- top: "",
29
- left: "",
30
- right: "",
31
- bottom: "",
32
- fadeIn: "",
33
- fadeOut: "",
34
- minWidth: "",
35
- minHeight: "",
36
- })
37
-
38
- let view = ""
39
- view += "<div class='popup_prompt'>"
40
- view += '<div class="popup_message_body">'
41
- view += '<center>'
42
- view += txt
43
- view += "</center>"
44
- view += '</div>'
45
- view += '<button id="a_' + pUp.id + '" type="button">CLOSE</button>'
46
-
47
- $('.popup_body_' + pUp.id)
48
- .html(view)
49
-
50
- $('#a_' + pUp.id)
51
- .css('width', '100%')
52
- .on('click', function (e) { layerpro.popup.close(pUp) })
53
-
54
- return false
55
- }
56
-
57
- /*****************************************************************************************/
58
- // MESSAGE
59
-
60
- layerpro.message = (txt) => {
61
-
62
- let pUp = layerpro.popup.open({
63
- id: "__message",
64
- body: "",
65
- width: 380,
66
- height: 220,
67
- name: 'Message',
68
- source: "",
69
- icon: "&#9965;",
70
- iconize: false,
71
- maximize: false,
72
- close: true,
73
- isMaximize: false,
74
- dockable: false,
75
- raised: true,
76
- movable: true,
77
- resizable: false,
78
- store: false,
79
- top: "",
80
- left: "",
81
- right: "",
82
- bottom: "",
83
- fadeIn: "",
84
- fadeOut: "",
85
- minWidth: "",
86
- minHeight: "",
87
- })
88
-
89
- let view = ""
90
- view += "<div class='popup_prompt'>"
91
- view += '<div class="popup_message_body">'
92
- view += '<center>'
93
- view += txt
94
- view += "</center>"
95
- view += '</div>'
96
- view += '<button id="a_' + pUp.id + '" type="button">CLOSE</button>'
97
-
98
- $('.popup_body_' + pUp.id)
99
- .html(view)
100
-
101
- $('#a_' + pUp.id)
102
- .css('width', '100%')
103
- .on('click', function () { layerpro.popup.close(pUp) })
104
-
105
- return false
106
- }
107
-
108
- /*****************************************************************************************/
109
- // CONFIRM
110
-
111
- layerpro.confirm = (txt, function_, noFunction) => {
112
-
113
- if ($('.confirm').length === 0) {
114
-
115
- let pUp = layerpro.popup.open({
116
- id: "__confirm",
117
- body: "",
118
- source: "",
119
- width: 380,
120
- height: 220,
121
- name: 'Confirm',
122
- icon: "&#9745;",
123
- iconize: false,
124
- maximize: false,
125
- close: true,
126
- isMaximize: false,
127
- dockable: false,
128
- raised: true,
129
- movable: true,
130
- resizable: false,
131
- store: false,
132
- top: "",
133
- left: "",
134
- right: "",
135
- bottom: "",
136
- fadeIn: "",
137
- fadeOut: "",
138
- minWidth: "",
139
- minHeight: "",
140
- })
141
-
142
- let view = ""
143
- view += "<div class='popup_prompt'>"
144
- view += '<div class="popup_message_body">'
145
- view += '<center>'
146
- view += txt
147
- view += "</center>"
148
- view += '</div>'
149
- view += '<button id="a_' + pUp.id + '" type="button">CONFIRM</button>'
150
- view += '<button id="b_' + pUp.id + '" type="button">CANCEL</button>'
151
-
152
- $('.popup_body_' + pUp.id)
153
- .html(view)
154
-
155
- $('#a_' + pUp.id).on('click', function () {
156
- if (function_) { function_() }
157
- layerpro.popup.close(pUp)
158
- })
159
-
160
- $('#b_' + pUp.id).on('click', function () {
161
- if (noFunction) { noFunction() }
162
- layerpro.popup.close(pUp)
163
- })
164
-
165
- }
166
-
167
- return false
168
- }
169
-
170
- /*****************************************************************************************/
171
- // PROMPT
172
-
173
- layerpro.prompt = (txt, value) => {
174
-
175
- // txt = JSON.stringify( txt );
176
- // value = JSON.stringify( value ) || "_prompt";
177
- value = value || "_prompt"
178
-
179
- let pUp = layerpro.popup.open({
180
- id: "__prompt",
181
- body: "",
182
- source: "",
183
- width: 380,
184
- height: 220,
185
- name: 'Prompt',
186
- icon: "&#9998;",
187
- iconize: false,
188
- maximize: false,
189
- close: true,
190
- isMaximize: false,
191
- dockable: false,
192
- raised: true,
193
- movable: true,
194
- resizable: false,
195
- store: false,
196
- top: "",
197
- left: "",
198
- right: "",
199
- bottom: "",
200
- fadeIn: "",
201
- fadeOut: "",
202
- minWidth: "",
203
- minHeight: "",
204
- })
205
-
206
- let view = ""
207
- view += "<div class='popup_prompt'>"
208
- view += '<div class="popup_message_body">'
209
- view += '<center>'
210
- view += txt
211
- view += "</center>"
212
- view += '</div>'
213
- view += '<input id="input_' + pUp.id + '" type="text" placeholder="write here" /><br/>'
214
- view += '<button id="a_' + pUp.id + '" type="button">OK</button>'
215
- view += '<button id="b_' + pUp.id + '" type="button">CANCEL</button>'
216
- view += "</div>"
217
-
218
- $('.popup_body_' + pUp.id)
219
- .html(view)
220
-
221
- $('#input_' + pUp.id)
222
- .on('focus', function () { $(this).attr('placeholder', "") })
223
- .on('blur', function () { $(this).attr('placeholder', "write here") })
224
-
225
- $('#a_' + pUp.id).on('click', function (e) {
226
-
227
- if ($('#input_' + pUp.id).val() > '') {
228
-
229
- // localStorage.setItem( value , JSON.stringify( $('#input_' + pUp.id).val() ) );
230
- // layerpro.popup.close( pUp );
231
-
232
- layerpro.popup.close(pUp)
233
- return JSON.stringify($('#input_' + pUp.id).val())
234
-
235
- } else {
236
- alert(`input can't be empty!`)
237
- }
238
-
239
- })
240
-
241
- $('#b_' + pUp.id).on('click', function (e) {
242
- layerpro.popup.close(pUp)
243
- })
244
-
245
- return false
246
- }
247
-
248
-
249
- /********************************************************** */
250
-
251
- export const CustomMessage = () => {
252
-
253
- // MESSAGE
254
- // ***********************************************************************
255
- window.message = (txt) => {
256
- layerpro.message(txt)
257
- }
258
-
259
- // ALERT
260
- // ***********************************************************************
261
- window.alert = (txt) => {
262
- layerpro.alert(txt)
263
- }
264
-
265
- // CONFIRM
266
- // ***********************************************************************
267
- window.confirm = (txt, function_, noFunction) => {
268
- layerpro.confirm(txt, function_, noFunction)
269
- }
270
-
271
- // PROMPT
272
- // ***********************************************************************
273
- window.prompt = (txt, function_, event) => {
274
- layerpro.prompt(txt, function_, event)
275
- }
276
-
277
- }
278
-
279
- CustomMessage()
280
-
@@ -1,45 +0,0 @@
1
- /*
2
- Copyright: © 2022 Dario Passariello <dariopassariello@gmail.com>
3
- License: MIT
4
- */
5
-
6
- export const mouseCoord = function (e) {
7
-
8
- let mClientX = e.clientX
9
- let mClientY = e.clientY
10
- let mScreenX = e.screenX
11
- let mScreenY = e.screenY
12
-
13
- return [mClientX, mClientY, mScreenX, mScreenY]
14
-
15
- }
16
-
17
- /*****************************************************************************************/
18
-
19
- let xDirection = ""
20
- let yDirection = ""
21
- let oldX = 0
22
- let oldY = 0
23
-
24
- export const getMouseDirection = function (e) {
25
-
26
- xDirection = oldX < e.pageX ? 1 : 0
27
-
28
- yDirection = oldY < e.pageY ? "down" : "up"
29
-
30
- oldX = e.pageX
31
- oldY = e.pageY
32
-
33
- //console.log(xDirection)
34
-
35
- return xDirection
36
-
37
- }
38
-
39
- //document.querySelector( "body" ).addEventListener( "mousemove" , getMouseDirection, false );
40
-
41
-
42
-
43
-
44
-
45
-