melonykit 0.16.2 → 0.16.3
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/dist/browser.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./browser-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./browser-CFswWLIi.js";
|
|
2
2
|
export { t as getClientSetting, e as routeTo, r as setClientSetting, n as useQuery };
|
|
@@ -17,8 +17,18 @@ function t(t, n) {
|
|
|
17
17
|
return `rgba(${r}, ${i}, ${a}, ${n})`;
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
|
+
//#region src/functions/checks/_is-string.js
|
|
21
|
+
function n(e) {
|
|
22
|
+
return typeof e == "string";
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/functions/_camel-case-to-title-case.js
|
|
26
|
+
function r(e) {
|
|
27
|
+
return n(e) ? e.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(" ").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "";
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
20
30
|
//#region src/functions/_darken-hex-color.js
|
|
21
|
-
function
|
|
31
|
+
function i(t, n) {
|
|
22
32
|
let r = e(t);
|
|
23
33
|
if (!Number.isFinite(n)) throw TypeError("amount must be a finite number");
|
|
24
34
|
if (n < 0 || n > 1) throw RangeError("amount must be between 0 and 1");
|
|
@@ -26,16 +36,11 @@ function n(t, n) {
|
|
|
26
36
|
return `#${r.map((e) => Math.round(e * i)).map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
27
37
|
}
|
|
28
38
|
//#endregion
|
|
29
|
-
//#region src/functions/checks/_is-string.js
|
|
30
|
-
function r(e) {
|
|
31
|
-
return typeof e == "string";
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
39
|
//#region src/functions/_format-date.js
|
|
35
|
-
function
|
|
40
|
+
function a(e) {
|
|
36
41
|
return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e);
|
|
37
42
|
}
|
|
38
|
-
var
|
|
43
|
+
var o = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g, s = /\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g, c = /[^-+\dA-Z]/g, l = (e, t = 2) => String(e).padStart(t, "0"), u = {
|
|
39
44
|
dayNames: [
|
|
40
45
|
"So",
|
|
41
46
|
"Mo",
|
|
@@ -89,64 +94,64 @@ var a = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'
|
|
|
89
94
|
"PM"
|
|
90
95
|
]
|
|
91
96
|
};
|
|
92
|
-
function
|
|
93
|
-
if (!
|
|
94
|
-
let s = () =>
|
|
95
|
-
d: () =>
|
|
96
|
-
dd: () => c(
|
|
97
|
-
ddd: () =>
|
|
98
|
-
DDD: () =>
|
|
97
|
+
function d(e, t = "dd.mm.yyyy", r, i) {
|
|
98
|
+
if (!a(e) || !n(t)) return "";
|
|
99
|
+
let s = () => r ? "getUTC" : "get", c = () => e[s() + "Date"](), d = () => e[s() + "Day"](), g = () => e[s() + "Month"](), _ = () => e[s() + "FullYear"](), v = () => e[s() + "Hours"](), y = () => e[s() + "Minutes"](), b = () => e[s() + "Seconds"](), x = () => e[s() + "Milliseconds"](), S = () => r ? 0 : e.getTimezoneOffset(), C = () => f(e), w = () => p(e), T = {
|
|
100
|
+
d: () => c(),
|
|
101
|
+
dd: () => l(c()),
|
|
102
|
+
ddd: () => u.dayNames[d()],
|
|
103
|
+
DDD: () => h({
|
|
99
104
|
y: _(),
|
|
100
105
|
m: g(),
|
|
101
|
-
d:
|
|
106
|
+
d: c(),
|
|
102
107
|
_: s(),
|
|
103
|
-
dayName:
|
|
108
|
+
dayName: u.dayNames[d()],
|
|
104
109
|
short: !0
|
|
105
110
|
}),
|
|
106
|
-
dddd: () =>
|
|
107
|
-
DDDD: () =>
|
|
111
|
+
dddd: () => u.dayNames[d() + 7],
|
|
112
|
+
DDDD: () => h({
|
|
108
113
|
y: _(),
|
|
109
114
|
m: g(),
|
|
110
|
-
d:
|
|
115
|
+
d: c(),
|
|
111
116
|
_: s(),
|
|
112
|
-
dayName:
|
|
117
|
+
dayName: u.dayNames[d() + 7]
|
|
113
118
|
}),
|
|
114
119
|
m: () => g() + 1,
|
|
115
|
-
mm: () =>
|
|
116
|
-
mmm: () =>
|
|
117
|
-
mmmm: () =>
|
|
120
|
+
mm: () => l(g() + 1),
|
|
121
|
+
mmm: () => u.monthNames[g()],
|
|
122
|
+
mmmm: () => u.monthNames[g() + 12],
|
|
118
123
|
yy: () => String(_()).slice(2),
|
|
119
|
-
yyyy: () =>
|
|
124
|
+
yyyy: () => l(_(), 4),
|
|
120
125
|
h: () => v() % 12 || 12,
|
|
121
|
-
hh: () =>
|
|
126
|
+
hh: () => l(v() % 12 || 12),
|
|
122
127
|
H: () => v(),
|
|
123
|
-
HH: () =>
|
|
128
|
+
HH: () => l(v()),
|
|
124
129
|
M: () => y(),
|
|
125
|
-
MM: () =>
|
|
130
|
+
MM: () => l(y()),
|
|
126
131
|
s: () => b(),
|
|
127
|
-
ss: () =>
|
|
128
|
-
l: () =>
|
|
129
|
-
L: () =>
|
|
130
|
-
t: () => v() < 12 ?
|
|
131
|
-
tt: () => v() < 12 ?
|
|
132
|
-
T: () => v() < 12 ?
|
|
133
|
-
TT: () => v() < 12 ?
|
|
134
|
-
Z: () =>
|
|
135
|
-
o: () => (S() > 0 ? "-" : "+") +
|
|
136
|
-
p: () => (S() > 0 ? "-" : "+") +
|
|
132
|
+
ss: () => l(b()),
|
|
133
|
+
l: () => l(x(), 3),
|
|
134
|
+
L: () => l(Math.floor(x() / 10)),
|
|
135
|
+
t: () => v() < 12 ? u.timeNames[0] : u.timeNames[1],
|
|
136
|
+
tt: () => v() < 12 ? u.timeNames[2] : u.timeNames[3],
|
|
137
|
+
T: () => v() < 12 ? u.timeNames[4] : u.timeNames[5],
|
|
138
|
+
TT: () => v() < 12 ? u.timeNames[6] : u.timeNames[7],
|
|
139
|
+
Z: () => i ? "GMT" : r ? "UTC" : m(e),
|
|
140
|
+
o: () => (S() > 0 ? "-" : "+") + l(Math.floor(Math.abs(S()) / 60) * 100 + Math.abs(S()) % 60, 4),
|
|
141
|
+
p: () => (S() > 0 ? "-" : "+") + l(Math.floor(Math.abs(S()) / 60), 2) + ":" + l(Math.floor(Math.abs(S()) % 60), 2),
|
|
137
142
|
S: () => [
|
|
138
143
|
"th",
|
|
139
144
|
"st",
|
|
140
145
|
"nd",
|
|
141
146
|
"rd"
|
|
142
|
-
][
|
|
147
|
+
][c() % 10 > 3 ? 0 : (c() % 100 - c() % 10 != 10) * c() % 10],
|
|
143
148
|
W: () => C(),
|
|
144
|
-
WW: () =>
|
|
149
|
+
WW: () => l(C()),
|
|
145
150
|
N: () => w()
|
|
146
151
|
};
|
|
147
|
-
return t.replace(
|
|
152
|
+
return t.replace(o, (e) => e in T ? T[e]() : e.slice(1, e.length - 1));
|
|
148
153
|
}
|
|
149
|
-
var
|
|
154
|
+
var f = (e) => {
|
|
150
155
|
let t = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
151
156
|
t.setDate(t.getDate() - (t.getDay() + 6) % 7 + 3);
|
|
152
157
|
let n = new Date(t.getFullYear(), 0, 4);
|
|
@@ -155,10 +160,10 @@ var d = (e) => {
|
|
|
155
160
|
t.setHours(t.getHours() - r);
|
|
156
161
|
let i = (t - n) / 6048e5;
|
|
157
162
|
return 1 + Math.floor(i);
|
|
158
|
-
},
|
|
163
|
+
}, p = (e) => {
|
|
159
164
|
let t = e.getDay();
|
|
160
165
|
return t === 0 && (t = 7), t;
|
|
161
|
-
},
|
|
166
|
+
}, m = (e) => (String(e).match(s) || [""]).pop().replace(c, "").replace(/GMT\+0000/g, "UTC"), h = ({ y: e, m: t, d: n, _: r, dayName: i, short: a = !1 }) => {
|
|
162
167
|
let o = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
163
168
|
s.setDate(s[r + "Date"]() - 1);
|
|
164
169
|
let c = /* @__PURE__ */ new Date();
|
|
@@ -166,12 +171,12 @@ var d = (e) => {
|
|
|
166
171
|
};
|
|
167
172
|
//#endregion
|
|
168
173
|
//#region src/functions/_kebab-case-to-title-case.js
|
|
169
|
-
function
|
|
170
|
-
return
|
|
174
|
+
function g(e) {
|
|
175
|
+
return n(e) ? e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "";
|
|
171
176
|
}
|
|
172
177
|
//#endregion
|
|
173
178
|
//#region src/functions/_request.js
|
|
174
|
-
async function
|
|
179
|
+
async function _({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
|
|
175
180
|
let i = n !== "GET" && t !== void 0 ? JSON.stringify(t) : void 0, a = await fetch(e, {
|
|
176
181
|
method: n,
|
|
177
182
|
headers: {
|
|
@@ -192,12 +197,12 @@ async function g({ url: e, body: t, method: n = "POST", headers: r = {} } = {})
|
|
|
192
197
|
}
|
|
193
198
|
//#endregion
|
|
194
199
|
//#region src/functions/_size.js
|
|
195
|
-
function
|
|
200
|
+
function v(e) {
|
|
196
201
|
return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
|
|
197
202
|
}
|
|
198
203
|
//#endregion
|
|
199
204
|
//#region src/functions/_to-number.js
|
|
200
|
-
function
|
|
205
|
+
function y(e, t = null) {
|
|
201
206
|
let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
|
|
202
207
|
if (!Number.isFinite(n)) return null;
|
|
203
208
|
if (t == null) return n;
|
|
@@ -206,32 +211,32 @@ function v(e, t = null) {
|
|
|
206
211
|
}
|
|
207
212
|
//#endregion
|
|
208
213
|
//#region src/functions/checks/_is-array.js
|
|
209
|
-
function
|
|
214
|
+
function b(e) {
|
|
210
215
|
return Array.isArray(e);
|
|
211
216
|
}
|
|
212
217
|
//#endregion
|
|
213
218
|
//#region src/functions/checks/_is-empty-array.js
|
|
214
|
-
function
|
|
215
|
-
return
|
|
219
|
+
function x(e) {
|
|
220
|
+
return b(e) && e.length === 0;
|
|
216
221
|
}
|
|
217
222
|
//#endregion
|
|
218
223
|
//#region src/functions/checks/_is-function.js
|
|
219
|
-
function
|
|
224
|
+
function S(e) {
|
|
220
225
|
return typeof e == "function";
|
|
221
226
|
}
|
|
222
227
|
//#endregion
|
|
223
228
|
//#region src/functions/checks/_is-number.js
|
|
224
|
-
function
|
|
229
|
+
function C(e) {
|
|
225
230
|
return typeof e == "number" && Number.isFinite(e);
|
|
226
231
|
}
|
|
227
232
|
//#endregion
|
|
228
233
|
//#region src/functions/checks/_is-positive-number.js
|
|
229
|
-
function
|
|
230
|
-
return
|
|
234
|
+
function w(e) {
|
|
235
|
+
return C(e) && e > 0;
|
|
231
236
|
}
|
|
232
237
|
//#endregion
|
|
233
238
|
//#region src/functions/_create-cache.js
|
|
234
|
-
function
|
|
239
|
+
function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
235
240
|
let i = /* @__PURE__ */ new Map();
|
|
236
241
|
async function a(t, n) {
|
|
237
242
|
if (i.has(t)) return !1;
|
|
@@ -240,12 +245,12 @@ function w({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
240
245
|
...n,
|
|
241
246
|
createdAt: r,
|
|
242
247
|
lastUpdate: r
|
|
243
|
-
}),
|
|
248
|
+
}), S(e) && await e(t), !0;
|
|
244
249
|
}
|
|
245
250
|
async function o(e, n) {
|
|
246
251
|
if (!i.has(e) || typeof n != "function") return !1;
|
|
247
252
|
let r = i.get(e);
|
|
248
|
-
return await n(r), r.lastUpdate = Date.now(),
|
|
253
|
+
return await n(r), r.lastUpdate = Date.now(), S(t) && await t(e), !0;
|
|
249
254
|
}
|
|
250
255
|
function s(e) {
|
|
251
256
|
return i.get(e) ?? null;
|
|
@@ -262,10 +267,10 @@ function w({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
262
267
|
async function d(e) {
|
|
263
268
|
if (!i.has(e)) return !1;
|
|
264
269
|
let t = i.get(e);
|
|
265
|
-
return i.delete(e),
|
|
270
|
+
return i.delete(e), S(n) && await n(e, t), !0;
|
|
266
271
|
}
|
|
267
272
|
function f({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
|
|
268
|
-
|
|
273
|
+
w(e) && b(t) && !x(t) && t.every((e) => S(e)) && S(n) && S(r) && r(async () => {
|
|
269
274
|
let e = n();
|
|
270
275
|
for (let [n, r] of i) t.some((t) => t(r, e)) && await d(n);
|
|
271
276
|
}, e)?.unref?.();
|
|
@@ -282,33 +287,33 @@ function w({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
|
282
287
|
}
|
|
283
288
|
//#endregion
|
|
284
289
|
//#region src/functions/checks/_is-nil.js
|
|
285
|
-
function
|
|
290
|
+
function E(e) {
|
|
286
291
|
return e == null;
|
|
287
292
|
}
|
|
288
293
|
//#endregion
|
|
289
294
|
//#region src/functions/checks/_is-object.js
|
|
290
|
-
function
|
|
291
|
-
return !
|
|
295
|
+
function D(e) {
|
|
296
|
+
return !E(e) && typeof e == "object" && !b(e);
|
|
292
297
|
}
|
|
293
298
|
//#endregion
|
|
294
299
|
//#region src/functions/checks/_is-empty-object.js
|
|
295
|
-
function
|
|
296
|
-
return
|
|
300
|
+
function O(e) {
|
|
301
|
+
return D(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
|
|
297
302
|
}
|
|
298
303
|
//#endregion
|
|
299
304
|
//#region src/functions/checks/_is-empty-string.js
|
|
300
|
-
function
|
|
301
|
-
return
|
|
305
|
+
function k(e) {
|
|
306
|
+
return n(e) && e.trim().length === 0;
|
|
302
307
|
}
|
|
303
308
|
//#endregion
|
|
304
309
|
//#region src/functions/checks/_is-empty.js
|
|
305
|
-
function
|
|
310
|
+
function A(e) {
|
|
306
311
|
return e == null ? !0 : typeof e == "function" ? !1 : typeof e == "number" ? !Number.isFinite(e) : typeof e == "string" ? e.trim().length === 0 : Array.isArray(e) ? e.length === 0 : typeof e != "object" || Object.keys(e).length === 0 && Object.getOwnPropertySymbols(e).length === 0;
|
|
307
312
|
}
|
|
308
313
|
//#endregion
|
|
309
314
|
//#region src/functions/checks/_is-negative-number.js
|
|
310
|
-
function
|
|
311
|
-
return
|
|
315
|
+
function j(e) {
|
|
316
|
+
return C(e) && e < 0;
|
|
312
317
|
}
|
|
313
318
|
//#endregion
|
|
314
|
-
export {
|
|
319
|
+
export { d as _, D as a, n as b, w as c, x as d, b as f, g, _ as h, O as i, C as l, v as m, A as n, E as o, y as p, k as r, T as s, j as t, S as u, i as v, t as x, r as y };
|
package/dist/functions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "./functions-
|
|
2
|
-
export {
|
|
1
|
+
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, x as y, y as b } from "./functions-CGixFbFT.js";
|
|
2
|
+
export { b as camelCaseToTitleCase, y as convertHexToRgba, h as createCache, v as darkenHexColor, e as formatDate, a as isArray, d as isEmpty, i as isEmptyArray, c as isEmptyObject, m as isEmptyString, _ as isFunction, g as isNegativeNumber, f as isNil, l as isNumber, t as isObject, r as isPositiveNumber, n as isString, o as kebabCaseToTitleCase, s as request, u as size, p as toNumber };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, t } from "./browser-
|
|
2
|
-
import { r as n,
|
|
1
|
+
import { n as e, t } from "./browser-CFswWLIi.js";
|
|
2
|
+
import { r as n, v as r } from "./functions-CGixFbFT.js";
|
|
3
3
|
import { useSignal as i } from "@preact/signals";
|
|
4
4
|
import { useEffect as a, useId as o, useRef as s, useState as c } from "preact/hooks";
|
|
5
5
|
import { Fragment as l, jsx as u, jsxs as d } from "preact/jsx-runtime";
|