layerpro 2.1.3 → 2.1.4
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/index.cjs +46 -43
- package/index.js +45 -42
- package/package.json +1 -9
package/index.cjs
CHANGED
|
@@ -30,7 +30,7 @@ h({}, {
|
|
|
30
30
|
mouseCoord: () => i
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
var b, _, f, v, g, w, y, z,
|
|
33
|
+
var b, _, f, v, g, w, y, z, k, x, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D, X, Y, U, q, K, B, F, J, Q, G, V = l({
|
|
34
34
|
"core/mouseCoords.ts"() {
|
|
35
35
|
i = e => [ e.clientX, e.clientY, e.screenX, e.screenY, e.pageX, e.pageY ], n = 0,
|
|
36
36
|
p = "", s = 0, r = 0, c = e => (n = s < e.pageX ? 1 : 0, p = r < e.pageY ? "down" : "up",
|
|
@@ -161,17 +161,14 @@ var b, _, f, v, g, w, y, z, x, k, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D
|
|
|
161
161
|
Z(), w = new Map, y = new Map, z = e => {
|
|
162
162
|
const o = document.createElement("div");
|
|
163
163
|
return o.textContent = e, o.innerHTML;
|
|
164
|
-
},
|
|
164
|
+
}, k = o => {
|
|
165
165
|
if ("function" == typeof o.body) return;
|
|
166
|
-
const t =
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}, i = !0 === o.raised ? ".popup_raised_" + o.id : "#popup";
|
|
170
|
-
$('[class^="popup_window_"]', i).removeClass("zHigh"), $('[class^="popup_bar_"]', i).removeClass("popup_bar_selected"),
|
|
171
|
-
$('[class^="icon_"]', i).removeClass("popup_bar_selected"), !0 === o.raised && $('<div class="popup_raised_' + o.id + '">', i).appendTo("#popup").css({
|
|
166
|
+
const t = !0 === o.raised ? ".popup_raised_" + o.id : "#popup";
|
|
167
|
+
$('[class^="popup_window_"]', t).removeClass("zHigh"), $('[class^="popup_bar_"]', t).removeClass("popup_bar_selected"),
|
|
168
|
+
$('[class^="icon_"]', t).removeClass("popup_bar_selected"), !0 === o.raised && $('<div class="popup_raised_' + o.id + '">', t).appendTo("#popup").css({
|
|
172
169
|
"pointer-events": "auto",
|
|
173
|
-
"z-index": Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]',
|
|
174
|
-
}), $('<div class="popup_overflow_' + o.id + '">',
|
|
170
|
+
"z-index": Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]', t))) + 1e3
|
|
171
|
+
}), $('<div class="popup_overflow_' + o.id + '">', t).appendTo(t).css({
|
|
175
172
|
top: o.top,
|
|
176
173
|
left: o.left,
|
|
177
174
|
right: o.right,
|
|
@@ -183,11 +180,11 @@ var b, _, f, v, g, w, y, z, x, k, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D
|
|
|
183
180
|
maxWidth: o.maxWidth,
|
|
184
181
|
maxHeight: o.maxHeight,
|
|
185
182
|
pointerEvents: "auto",
|
|
186
|
-
zIndex: Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]',
|
|
183
|
+
zIndex: Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]', t))) + 1
|
|
187
184
|
}).on("mousedown", e => {
|
|
188
185
|
layerpro.popup.index(o);
|
|
189
186
|
}).hide().fadeIn(o.fadeIn);
|
|
190
|
-
const
|
|
187
|
+
const i = $('<div class="popup_window_' + o.id + '">', t).appendTo(".popup_overflow_" + o.id).css({
|
|
191
188
|
"pointer-events": "auto"
|
|
192
189
|
}).addClass("zHigh").addClass(o.class);
|
|
193
190
|
0 === [ o.top, o.left, o.bottom, o.right ].reduce((e, o) => "number" == typeof o && isFinite(o) ? Number(e) + o : e, 0) && layerpro.popup.center(o),
|
|
@@ -200,11 +197,11 @@ var b, _, f, v, g, w, y, z, x, k, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D
|
|
|
200
197
|
o.buttonIconize && $(".button_iconize_" + e).off("click"), o.buttonMaximize && $(".button_maximize_" + e).off("click"),
|
|
201
198
|
o.buttonClose && $(".button_close_" + e).off("click"), o.escKey && $(document).off("keydown"),
|
|
202
199
|
y.delete(e));
|
|
203
|
-
}, layerpro.popup.getReactRoot = e => w.get(e), $('<div class="popup_bar_' + o.id + '">',
|
|
204
|
-
o.icon && $('<div class="popup_icon_' + o.id + '">' + o.icon + "</div>",
|
|
205
|
-
const
|
|
206
|
-
if ($('<div class="popup_drag_' + o.id + '">' +
|
|
207
|
-
$('<div class="popup_option_' + o.id + '">',
|
|
200
|
+
}, layerpro.popup.getReactRoot = e => w.get(e), $('<div class="popup_bar_' + o.id + '">', t).appendTo(i).addClass("popup_bar_selected"),
|
|
201
|
+
o.icon && $('<div class="popup_icon_' + o.id + '">' + o.icon + "</div>", t).appendTo(".popup_bar_" + o.id);
|
|
202
|
+
const n = z(String(o.name));
|
|
203
|
+
if ($('<div class="popup_drag_' + o.id + '">' + n + "</div>", t).appendTo(".popup_bar_" + o.id),
|
|
204
|
+
$('<div class="popup_option_' + o.id + '">', t).appendTo(".popup_bar_" + o.id),
|
|
208
205
|
!0 === o.iconize && 0 === $("#popup_dock").length) {
|
|
209
206
|
$("#root").css("margin", "0 0 var( --dock-height ) 0");
|
|
210
207
|
$('\n <div id="popup_dock">\n <div id="popup_dock_icon"></div>\n <div id="popup_dock_list"></div>\n <div id="popup_dock_options"></div>\n </div>\n ').appendTo("#popup").css({
|
|
@@ -213,17 +210,17 @@ var b, _, f, v, g, w, y, z, x, k, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D
|
|
|
213
210
|
});
|
|
214
211
|
}
|
|
215
212
|
if ($("#popup_dock").length > 0 && !0 === o.dockable) {
|
|
216
|
-
const e = String(o.id), t = `\n <div class="icon_${o.id}">\n <span>${o.icon ? o.icon : ""}</span>\n <span>${
|
|
213
|
+
const e = String(o.id), t = `\n <div class="icon_${o.id}">\n <span>${o.icon ? o.icon : ""}</span>\n <span>${n}</span>\n `, i = function(e) {
|
|
217
214
|
$(".popup_overflow_" + o.id + ":hidden") ? (layerpro.popup.iconize(o), layerpro.popup.index(o)) : layerpro.popup.iconize(o),
|
|
218
215
|
layerpro.popup.index(o);
|
|
219
|
-
},
|
|
216
|
+
}, p = function(e) {
|
|
220
217
|
o?.buttons?.cancel?.cb && o?.buttons?.cancel?.cb(), layerpro.popup.close(o);
|
|
221
218
|
};
|
|
222
219
|
y.set(e, {
|
|
223
220
|
iconClick: !0,
|
|
224
221
|
iconClose: !0
|
|
225
222
|
}), $(t, "#popup_dock").appendTo("#popup_dock_list").addClass("popup_bar_selected").find("span").on("click", i),
|
|
226
|
-
$(`<button class="icon_close_${o.id}">X</button>`, "#popup_dock").appendTo(`.icon_${o.id}`).on("click",
|
|
223
|
+
$(`<button class="icon_close_${o.id}">X</button>`, "#popup_dock").appendTo(`.icon_${o.id}`).on("click", p);
|
|
227
224
|
}
|
|
228
225
|
if (!0 === o.iconize) {
|
|
229
226
|
const e = String(o.id), t = function(e) {
|
|
@@ -243,8 +240,8 @@ var b, _, f, v, g, w, y, z, x, k, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D
|
|
|
243
240
|
}, i = y.get(e) || {};
|
|
244
241
|
i.buttonClose = !0, y.set(e, i), $('<button class="button_close_' + o.id + ' close">', "#popup").appendTo(".popup_option_" + o.id).on("click", t);
|
|
245
242
|
}
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
243
|
+
const p = String(o.id), s = y.get(p) || {};
|
|
244
|
+
if (s.escKey = !0, y.set(p, s), $(document).on("keydown", function(e) {
|
|
248
245
|
"Escape" !== e.key && 27 !== e.keyCode || (o?.buttons?.cancel?.cb && o?.buttons?.cancel?.cb(),
|
|
249
246
|
layerpro.popup.close(o));
|
|
250
247
|
}), o.timer > 0) {
|
|
@@ -273,23 +270,29 @@ var b, _, f, v, g, w, y, z, x, k, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D
|
|
|
273
270
|
}
|
|
274
271
|
o.movable && layerpro.popup.movable(o), o.resizable && layerpro.popup.resizable(o),
|
|
275
272
|
o.isMaximize && layerpro.popup.maximize(o);
|
|
276
|
-
const
|
|
277
|
-
$('<div class="popup_internal_' + o.id + '">',
|
|
273
|
+
const r = $('<div class="popup_overflow_' + o.id + '">', "#popup");
|
|
274
|
+
$('<div class="popup_internal_' + o.id + '">', r).appendTo(i), $('<div class="popup_body_' + o.id + '">', r).appendTo(".popup_internal_" + o.id).hide().fadeIn(o.fadeIn, function() {
|
|
278
275
|
(() => {
|
|
279
|
-
if (o.body && !o.source)
|
|
280
|
-
const i =
|
|
281
|
-
if (
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
276
|
+
if (o.body && !o.source) {
|
|
277
|
+
const t = o.body, i = "object" == typeof t && null !== t && void 0 !== t.type && "object" == typeof t.props && null !== t.props;
|
|
278
|
+
if (i) ; else if ("function" == typeof o.body) return;
|
|
279
|
+
if (i) {
|
|
280
|
+
const t = document.querySelector(".popup_body_" + o.id);
|
|
281
|
+
if (!t) return;
|
|
282
|
+
try {
|
|
283
|
+
const i = e.createRoot(t);
|
|
284
|
+
i.render(o.body), w.set(String(o.id), i);
|
|
285
|
+
} catch (e) {
|
|
286
|
+
const o = e?.message || String(e);
|
|
287
|
+
o.includes("Invalid hook call") || o.includes("hooks");
|
|
288
|
+
}
|
|
289
|
+
} else if ("string" == typeof o.body && o.body.trim().startsWith("<")) {
|
|
290
|
+
const e = z(o.body);
|
|
291
|
+
$(".popup_body_" + o.id).html(e).fadeIn(o.fadeIn);
|
|
292
|
+
} else {
|
|
293
|
+
const e = z(String(o.body));
|
|
294
|
+
$(".popup_body_" + o.id).text(e).fadeIn(o.fadeIn);
|
|
295
|
+
}
|
|
293
296
|
}
|
|
294
297
|
})(), (() => {
|
|
295
298
|
if (o.buttons) {
|
|
@@ -309,18 +312,18 @@ var b, _, f, v, g, w, y, z, x, k, C, M, N, T, E, I, O, S, L, A, P, j, H, R, W, D
|
|
|
309
312
|
}
|
|
310
313
|
}), oe = l({
|
|
311
314
|
"core/mobile.ts"() {
|
|
312
|
-
if (
|
|
315
|
+
if (x = () => "undefined" != typeof window && window.matchMedia("(max-width: 1024px)").matches,
|
|
313
316
|
C = () => {
|
|
314
317
|
if ("undefined" == typeof navigator) return !1;
|
|
315
318
|
const e = navigator.userAgent;
|
|
316
319
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);
|
|
317
320
|
}, M = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, (N = () => {
|
|
318
321
|
if (!0 === window.__FORCE_TOUCH_MODE__) return "touch";
|
|
319
|
-
const e = C() ||
|
|
322
|
+
const e = C() || x();
|
|
320
323
|
return M() && e ? "touch" : "mouse";
|
|
321
|
-
})(), T = !
|
|
324
|
+
})(), T = !x(), "undefined" != typeof window) {
|
|
322
325
|
const e = window.matchMedia("(max-width: 1024px)"), o = () => {
|
|
323
|
-
const e = N(), o = !
|
|
326
|
+
const e = N(), o = !x();
|
|
324
327
|
T !== o && (T = o);
|
|
325
328
|
};
|
|
326
329
|
let t;
|
|
@@ -355,7 +358,7 @@ var te, ie = l({
|
|
|
355
358
|
"auto" === e.height && (e.height = "100%"), 0 === $("#popup").length && $('<div id="popup">', "#popup").appendTo("body").css({
|
|
356
359
|
"pointer-events": "none",
|
|
357
360
|
"z-index": G.zIndex($("*")) + 1
|
|
358
|
-
}), 0 === $(".popup_window_" + e.id, "#popup").length &&
|
|
361
|
+
}), 0 === $(".popup_window_" + e.id, "#popup").length && k(e), layerpro.purge(document),
|
|
359
362
|
e;
|
|
360
363
|
},
|
|
361
364
|
dispatch: e => {
|
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ l({}, {
|
|
|
24
24
|
mouseCoord: () => i
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
var m, b, _, f, v, g, w, y, z,
|
|
27
|
+
var m, b, _, f, v, g, w, y, z, k, x, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W, D, X, Y, U, K, B, F, q, J, Q, G = u({
|
|
28
28
|
"core/mouseCoords.ts"() {
|
|
29
29
|
i = e => [ e.clientX, e.clientY, e.screenX, e.screenY, e.pageX, e.pageY ], n = 0,
|
|
30
30
|
p = "", s = 0, r = 0, c = e => (n = s < e.pageX ? 1 : 0, p = r < e.pageY ? "down" : "up",
|
|
@@ -157,15 +157,12 @@ var m, b, _, f, v, g, w, y, z, x, k, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W
|
|
|
157
157
|
return o.textContent = e, o.innerHTML;
|
|
158
158
|
}, z = o => {
|
|
159
159
|
if ("function" == typeof o.body) return;
|
|
160
|
-
const t =
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}, i = !0 === o.raised ? ".popup_raised_" + o.id : "#popup";
|
|
164
|
-
$('[class^="popup_window_"]', i).removeClass("zHigh"), $('[class^="popup_bar_"]', i).removeClass("popup_bar_selected"),
|
|
165
|
-
$('[class^="icon_"]', i).removeClass("popup_bar_selected"), !0 === o.raised && $('<div class="popup_raised_' + o.id + '">', i).appendTo("#popup").css({
|
|
160
|
+
const t = !0 === o.raised ? ".popup_raised_" + o.id : "#popup";
|
|
161
|
+
$('[class^="popup_window_"]', t).removeClass("zHigh"), $('[class^="popup_bar_"]', t).removeClass("popup_bar_selected"),
|
|
162
|
+
$('[class^="icon_"]', t).removeClass("popup_bar_selected"), !0 === o.raised && $('<div class="popup_raised_' + o.id + '">', t).appendTo("#popup").css({
|
|
166
163
|
"pointer-events": "auto",
|
|
167
|
-
"z-index": Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]',
|
|
168
|
-
}), $('<div class="popup_overflow_' + o.id + '">',
|
|
164
|
+
"z-index": Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]', t))) + 1e3
|
|
165
|
+
}), $('<div class="popup_overflow_' + o.id + '">', t).appendTo(t).css({
|
|
169
166
|
top: o.top,
|
|
170
167
|
left: o.left,
|
|
171
168
|
right: o.right,
|
|
@@ -177,11 +174,11 @@ var m, b, _, f, v, g, w, y, z, x, k, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W
|
|
|
177
174
|
maxWidth: o.maxWidth,
|
|
178
175
|
maxHeight: o.maxHeight,
|
|
179
176
|
pointerEvents: "auto",
|
|
180
|
-
zIndex: Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]',
|
|
177
|
+
zIndex: Number(layerpro.popup.zIndex($('[class^="popup_overflow_"]', t))) + 1
|
|
181
178
|
}).on("mousedown", e => {
|
|
182
179
|
layerpro.popup.index(o);
|
|
183
180
|
}).hide().fadeIn(o.fadeIn);
|
|
184
|
-
const
|
|
181
|
+
const i = $('<div class="popup_window_' + o.id + '">', t).appendTo(".popup_overflow_" + o.id).css({
|
|
185
182
|
"pointer-events": "auto"
|
|
186
183
|
}).addClass("zHigh").addClass(o.class);
|
|
187
184
|
0 === [ o.top, o.left, o.bottom, o.right ].reduce((e, o) => "number" == typeof o && isFinite(o) ? Number(e) + o : e, 0) && layerpro.popup.center(o),
|
|
@@ -194,11 +191,11 @@ var m, b, _, f, v, g, w, y, z, x, k, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W
|
|
|
194
191
|
o.buttonIconize && $(".button_iconize_" + e).off("click"), o.buttonMaximize && $(".button_maximize_" + e).off("click"),
|
|
195
192
|
o.buttonClose && $(".button_close_" + e).off("click"), o.escKey && $(document).off("keydown"),
|
|
196
193
|
w.delete(e));
|
|
197
|
-
}, layerpro.popup.getReactRoot = e => g.get(e), $('<div class="popup_bar_' + o.id + '">',
|
|
198
|
-
o.icon && $('<div class="popup_icon_' + o.id + '">' + o.icon + "</div>",
|
|
199
|
-
const
|
|
200
|
-
if ($('<div class="popup_drag_' + o.id + '">' +
|
|
201
|
-
$('<div class="popup_option_' + o.id + '">',
|
|
194
|
+
}, layerpro.popup.getReactRoot = e => g.get(e), $('<div class="popup_bar_' + o.id + '">', t).appendTo(i).addClass("popup_bar_selected"),
|
|
195
|
+
o.icon && $('<div class="popup_icon_' + o.id + '">' + o.icon + "</div>", t).appendTo(".popup_bar_" + o.id);
|
|
196
|
+
const n = y(String(o.name));
|
|
197
|
+
if ($('<div class="popup_drag_' + o.id + '">' + n + "</div>", t).appendTo(".popup_bar_" + o.id),
|
|
198
|
+
$('<div class="popup_option_' + o.id + '">', t).appendTo(".popup_bar_" + o.id),
|
|
202
199
|
!0 === o.iconize && 0 === $("#popup_dock").length) {
|
|
203
200
|
$("#root").css("margin", "0 0 var( --dock-height ) 0");
|
|
204
201
|
$('\n <div id="popup_dock">\n <div id="popup_dock_icon"></div>\n <div id="popup_dock_list"></div>\n <div id="popup_dock_options"></div>\n </div>\n ').appendTo("#popup").css({
|
|
@@ -207,17 +204,17 @@ var m, b, _, f, v, g, w, y, z, x, k, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W
|
|
|
207
204
|
});
|
|
208
205
|
}
|
|
209
206
|
if ($("#popup_dock").length > 0 && !0 === o.dockable) {
|
|
210
|
-
const e = String(o.id), t = `\n <div class="icon_${o.id}">\n <span>${o.icon ? o.icon : ""}</span>\n <span>${
|
|
207
|
+
const e = String(o.id), t = `\n <div class="icon_${o.id}">\n <span>${o.icon ? o.icon : ""}</span>\n <span>${n}</span>\n `, i = function(e) {
|
|
211
208
|
$(".popup_overflow_" + o.id + ":hidden") ? (layerpro.popup.iconize(o), layerpro.popup.index(o)) : layerpro.popup.iconize(o),
|
|
212
209
|
layerpro.popup.index(o);
|
|
213
|
-
},
|
|
210
|
+
}, p = function(e) {
|
|
214
211
|
o?.buttons?.cancel?.cb && o?.buttons?.cancel?.cb(), layerpro.popup.close(o);
|
|
215
212
|
};
|
|
216
213
|
w.set(e, {
|
|
217
214
|
iconClick: !0,
|
|
218
215
|
iconClose: !0
|
|
219
216
|
}), $(t, "#popup_dock").appendTo("#popup_dock_list").addClass("popup_bar_selected").find("span").on("click", i),
|
|
220
|
-
$(`<button class="icon_close_${o.id}">X</button>`, "#popup_dock").appendTo(`.icon_${o.id}`).on("click",
|
|
217
|
+
$(`<button class="icon_close_${o.id}">X</button>`, "#popup_dock").appendTo(`.icon_${o.id}`).on("click", p);
|
|
221
218
|
}
|
|
222
219
|
if (!0 === o.iconize) {
|
|
223
220
|
const e = String(o.id), t = function(e) {
|
|
@@ -237,8 +234,8 @@ var m, b, _, f, v, g, w, y, z, x, k, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W
|
|
|
237
234
|
}, i = w.get(e) || {};
|
|
238
235
|
i.buttonClose = !0, w.set(e, i), $('<button class="button_close_' + o.id + ' close">', "#popup").appendTo(".popup_option_" + o.id).on("click", t);
|
|
239
236
|
}
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
237
|
+
const p = String(o.id), s = w.get(p) || {};
|
|
238
|
+
if (s.escKey = !0, w.set(p, s), $(document).on("keydown", function(e) {
|
|
242
239
|
"Escape" !== e.key && 27 !== e.keyCode || (o?.buttons?.cancel?.cb && o?.buttons?.cancel?.cb(),
|
|
243
240
|
layerpro.popup.close(o));
|
|
244
241
|
}), o.timer > 0) {
|
|
@@ -267,23 +264,29 @@ var m, b, _, f, v, g, w, y, z, x, k, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W
|
|
|
267
264
|
}
|
|
268
265
|
o.movable && layerpro.popup.movable(o), o.resizable && layerpro.popup.resizable(o),
|
|
269
266
|
o.isMaximize && layerpro.popup.maximize(o);
|
|
270
|
-
const
|
|
271
|
-
$('<div class="popup_internal_' + o.id + '">',
|
|
267
|
+
const r = $('<div class="popup_overflow_' + o.id + '">', "#popup");
|
|
268
|
+
$('<div class="popup_internal_' + o.id + '">', r).appendTo(i), $('<div class="popup_body_' + o.id + '">', r).appendTo(".popup_internal_" + o.id).hide().fadeIn(o.fadeIn, function() {
|
|
272
269
|
(() => {
|
|
273
|
-
if (o.body && !o.source)
|
|
274
|
-
const i =
|
|
275
|
-
if (
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
270
|
+
if (o.body && !o.source) {
|
|
271
|
+
const t = o.body, i = "object" == typeof t && null !== t && void 0 !== t.type && "object" == typeof t.props && null !== t.props;
|
|
272
|
+
if (i) ; else if ("function" == typeof o.body) return;
|
|
273
|
+
if (i) {
|
|
274
|
+
const t = document.querySelector(".popup_body_" + o.id);
|
|
275
|
+
if (!t) return;
|
|
276
|
+
try {
|
|
277
|
+
const i = e(t);
|
|
278
|
+
i.render(o.body), g.set(String(o.id), i);
|
|
279
|
+
} catch (e) {
|
|
280
|
+
const o = e?.message || String(e);
|
|
281
|
+
o.includes("Invalid hook call") || o.includes("hooks");
|
|
282
|
+
}
|
|
283
|
+
} else if ("string" == typeof o.body && o.body.trim().startsWith("<")) {
|
|
284
|
+
const e = y(o.body);
|
|
285
|
+
$(".popup_body_" + o.id).html(e).fadeIn(o.fadeIn);
|
|
286
|
+
} else {
|
|
287
|
+
const e = y(String(o.body));
|
|
288
|
+
$(".popup_body_" + o.id).text(e).fadeIn(o.fadeIn);
|
|
289
|
+
}
|
|
287
290
|
}
|
|
288
291
|
})(), (() => {
|
|
289
292
|
if (o.buttons) {
|
|
@@ -303,18 +306,18 @@ var m, b, _, f, v, g, w, y, z, x, k, C, N, M, T, E, I, O, S, L, A, P, j, H, R, W
|
|
|
303
306
|
}
|
|
304
307
|
}), ee = u({
|
|
305
308
|
"core/mobile.ts"() {
|
|
306
|
-
if (
|
|
307
|
-
|
|
309
|
+
if (k = () => "undefined" != typeof window && window.matchMedia("(max-width: 1024px)").matches,
|
|
310
|
+
x = () => {
|
|
308
311
|
if ("undefined" == typeof navigator) return !1;
|
|
309
312
|
const e = navigator.userAgent;
|
|
310
313
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);
|
|
311
314
|
}, C = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, (N = () => {
|
|
312
315
|
if (!0 === window.__FORCE_TOUCH_MODE__) return "touch";
|
|
313
|
-
const e =
|
|
316
|
+
const e = x() || k();
|
|
314
317
|
return C() && e ? "touch" : "mouse";
|
|
315
|
-
})(), M = !
|
|
318
|
+
})(), M = !k(), "undefined" != typeof window) {
|
|
316
319
|
const e = window.matchMedia("(max-width: 1024px)"), o = () => {
|
|
317
|
-
const e = N(), o = !
|
|
320
|
+
const e = N(), o = !k();
|
|
318
321
|
M !== o && (M = o);
|
|
319
322
|
};
|
|
320
323
|
let t;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "layerpro",
|
|
3
3
|
"code": "layerpro",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.4",
|
|
5
5
|
"description": "The real custom modals, alert, confirm, prompt... for your browser",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"browser": "./index.cjs",
|
|
@@ -56,14 +56,6 @@
|
|
|
56
56
|
"url": "https://dario.passariello.ca/",
|
|
57
57
|
"email": "dariopassariello@gmail.com"
|
|
58
58
|
},
|
|
59
|
-
"peerDependenciesMeta": {
|
|
60
|
-
"react": {
|
|
61
|
-
"optional": false
|
|
62
|
-
},
|
|
63
|
-
"react-dom": {
|
|
64
|
-
"optional": false
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
59
|
"module": "./index.js",
|
|
68
60
|
"exports": {
|
|
69
61
|
".": {
|