melonykit 0.15.5 → 0.15.7
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 +1 -1
- package/dist/{functions-lglYN2Ig.js → functions-CexzzAfY.js} +71 -20
- package/dist/functions.js +2 -2
- package/dist/index.js +15 -15
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -210,49 +210,100 @@ function y(e) {
|
|
|
210
210
|
return v(e) && e.length === 0;
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
213
|
-
//#region src/functions/checks/_is-
|
|
213
|
+
//#region src/functions/checks/_is-function.js
|
|
214
214
|
function b(e) {
|
|
215
|
-
return e ==
|
|
215
|
+
return typeof e == "function";
|
|
216
216
|
}
|
|
217
217
|
//#endregion
|
|
218
|
-
//#region src/functions/checks/_is-
|
|
218
|
+
//#region src/functions/checks/_is-number.js
|
|
219
219
|
function x(e) {
|
|
220
|
-
return
|
|
220
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
221
221
|
}
|
|
222
222
|
//#endregion
|
|
223
|
-
//#region src/functions/checks/_is-
|
|
223
|
+
//#region src/functions/checks/_is-positive-number.js
|
|
224
224
|
function S(e) {
|
|
225
|
-
return x(e) &&
|
|
225
|
+
return x(e) && e > 0;
|
|
226
226
|
}
|
|
227
227
|
//#endregion
|
|
228
|
-
//#region src/functions/
|
|
229
|
-
function C(e) {
|
|
230
|
-
|
|
228
|
+
//#region src/functions/_create-cache.js
|
|
229
|
+
function C({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
230
|
+
let i = /* @__PURE__ */ new Map();
|
|
231
|
+
async function a(t, n) {
|
|
232
|
+
if (i.has(t)) return !1;
|
|
233
|
+
let r = Date.now();
|
|
234
|
+
return i.set(t, {
|
|
235
|
+
...n,
|
|
236
|
+
createdAt: r,
|
|
237
|
+
lastUpdate: r
|
|
238
|
+
}), b(e) && await e(t), !0;
|
|
239
|
+
}
|
|
240
|
+
async function o(e, n) {
|
|
241
|
+
if (!i.has(e) || typeof n != "function") return !1;
|
|
242
|
+
let r = i.get(e);
|
|
243
|
+
return await n(r), r.lastUpdate = Date.now(), b(t) && await t(e), !0;
|
|
244
|
+
}
|
|
245
|
+
function s(e) {
|
|
246
|
+
return i.get(e) ?? null;
|
|
247
|
+
}
|
|
248
|
+
function c() {
|
|
249
|
+
return i.size;
|
|
250
|
+
}
|
|
251
|
+
function l() {
|
|
252
|
+
return i.entries();
|
|
253
|
+
}
|
|
254
|
+
function u(e) {
|
|
255
|
+
return i.has(e);
|
|
256
|
+
}
|
|
257
|
+
async function d(e) {
|
|
258
|
+
if (!i.has(e)) return !1;
|
|
259
|
+
let t = i.get(e);
|
|
260
|
+
return i.delete(e), b(n) && await n(e, t), !0;
|
|
261
|
+
}
|
|
262
|
+
function f({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
|
|
263
|
+
S(e) && v(t) && !y(t) && t.every((e) => b(e)) && b(n) && b(r) && r(async () => {
|
|
264
|
+
let e = n();
|
|
265
|
+
for (let [n, r] of i) t.some((t) => t(r, e)) && await d(n);
|
|
266
|
+
}, e)?.unref?.();
|
|
267
|
+
}
|
|
268
|
+
return f(r), {
|
|
269
|
+
add: a,
|
|
270
|
+
get: s,
|
|
271
|
+
size: c,
|
|
272
|
+
entries: l,
|
|
273
|
+
update: o,
|
|
274
|
+
has: u,
|
|
275
|
+
remove: d
|
|
276
|
+
};
|
|
231
277
|
}
|
|
232
278
|
//#endregion
|
|
233
|
-
//#region src/functions/checks/_is-
|
|
279
|
+
//#region src/functions/checks/_is-nil.js
|
|
234
280
|
function w(e) {
|
|
235
|
-
return e == null
|
|
281
|
+
return e == null;
|
|
236
282
|
}
|
|
237
283
|
//#endregion
|
|
238
|
-
//#region src/functions/checks/_is-
|
|
284
|
+
//#region src/functions/checks/_is-object.js
|
|
239
285
|
function T(e) {
|
|
240
|
-
return typeof e == "
|
|
286
|
+
return !w(e) && typeof e == "object" && !v(e);
|
|
241
287
|
}
|
|
242
288
|
//#endregion
|
|
243
|
-
//#region src/functions/checks/_is-
|
|
289
|
+
//#region src/functions/checks/_is-empty-object.js
|
|
244
290
|
function E(e) {
|
|
245
|
-
return
|
|
291
|
+
return T(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
|
|
246
292
|
}
|
|
247
293
|
//#endregion
|
|
248
|
-
//#region src/functions/checks/_is-
|
|
294
|
+
//#region src/functions/checks/_is-empty-string.js
|
|
249
295
|
function D(e) {
|
|
250
|
-
return
|
|
296
|
+
return r(e) && e.trim().length === 0;
|
|
251
297
|
}
|
|
252
298
|
//#endregion
|
|
253
|
-
//#region src/functions/checks/_is-
|
|
299
|
+
//#region src/functions/checks/_is-empty.js
|
|
254
300
|
function O(e) {
|
|
255
|
-
return
|
|
301
|
+
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;
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/functions/checks/_is-negative-number.js
|
|
305
|
+
function k(e) {
|
|
306
|
+
return x(e) && e < 0;
|
|
256
307
|
}
|
|
257
308
|
//#endregion
|
|
258
|
-
export {
|
|
309
|
+
export { r as _, T as a, S as c, y as d, v as f, u as g, h, E as i, x as l, g as m, O as n, w as o, _ as p, D as r, C as s, k as t, b as u, n as v, t as y };
|
package/dist/functions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _ } from "./functions-
|
|
2
|
-
export {
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, y as v } from "./functions-CexzzAfY.js";
|
|
2
|
+
export { v as convertHexToRgba, m as createCache, _ as darkenHexColor, a as formatDate, i as isArray, u as isEmpty, r as isEmptyArray, s as isEmptyObject, p as isEmptyString, g as isFunction, h as isNegativeNumber, d as isNil, c as isNumber, t as isObject, n as isPositiveNumber, e as isString, o as request, l as size, f as toNumber };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as e, v as t } from "./functions-CexzzAfY.js";
|
|
2
2
|
import { useSignal as n } from "@preact/signals";
|
|
3
3
|
import { useEffect as r, useId as i, useRef as a } from "preact/hooks";
|
|
4
4
|
import { Fragment as o, jsx as s, jsxs as c } from "preact/jsx-runtime";
|
|
@@ -1268,15 +1268,15 @@ var J = {
|
|
|
1268
1268
|
transition: width .3s ease;
|
|
1269
1269
|
`,
|
|
1270
1270
|
normal: U`
|
|
1271
|
-
border: solid 1px ${
|
|
1271
|
+
border: solid 1px ${t(W.colors.primary, .3)};
|
|
1272
1272
|
background-color: ${W.colors.primary};
|
|
1273
1273
|
`,
|
|
1274
1274
|
warn: U`
|
|
1275
|
-
border: solid 1px ${
|
|
1275
|
+
border: solid 1px ${t(W.colors.secondary, .2)};
|
|
1276
1276
|
background-color: ${W.colors.secondary};
|
|
1277
1277
|
`,
|
|
1278
1278
|
danger: U`
|
|
1279
|
-
border: solid 1px ${
|
|
1279
|
+
border: solid 1px ${t(W.colors.danger, .3)};
|
|
1280
1280
|
background-color: ${W.colors.danger};
|
|
1281
1281
|
`
|
|
1282
1282
|
};
|
|
@@ -1389,13 +1389,13 @@ var St = rt`
|
|
|
1389
1389
|
&[has-icon] { padding-left: 2rem; }
|
|
1390
1390
|
`,
|
|
1391
1391
|
primary: U`
|
|
1392
|
-
color: ${
|
|
1393
|
-
border-bottom: solid 3px ${
|
|
1392
|
+
color: ${t(W.colors.primary, .5)};
|
|
1393
|
+
border-bottom: solid 3px ${t(W.colors.primary, .25)};
|
|
1394
1394
|
background-color: ${W.colors.primary};
|
|
1395
1395
|
`,
|
|
1396
1396
|
secondary: U`
|
|
1397
|
-
color: ${
|
|
1398
|
-
border-bottom: solid 3px ${
|
|
1397
|
+
color: ${t(W.colors.secondary, .5)};
|
|
1398
|
+
border-bottom: solid 3px ${t(W.colors.secondary, .25)};
|
|
1399
1399
|
background-color: ${W.colors.secondary};
|
|
1400
1400
|
`,
|
|
1401
1401
|
ripple: U`
|
|
@@ -1749,7 +1749,7 @@ var Nt = {
|
|
|
1749
1749
|
margin-top: -.375rem;
|
|
1750
1750
|
border: solid 2px ${W.colors.back.primary};
|
|
1751
1751
|
border-radius: 50%;
|
|
1752
|
-
border: solid 1px ${
|
|
1752
|
+
border: solid 1px ${t(W.colors.primary, .3)};
|
|
1753
1753
|
background-color: ${W.colors.primary};
|
|
1754
1754
|
}
|
|
1755
1755
|
|
|
@@ -1964,10 +1964,10 @@ var zt = {
|
|
|
1964
1964
|
};
|
|
1965
1965
|
//#endregion
|
|
1966
1966
|
//#region src/components/_tag.jsx
|
|
1967
|
-
function Bt({ className:
|
|
1967
|
+
function Bt({ className: t, variant: n = "normal", iconName: r = "", label: i }) {
|
|
1968
1968
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c("div", {
|
|
1969
|
-
className: H(Vt.base, Vt[n] ?? Vt.normal,
|
|
1970
|
-
"has-icon": !
|
|
1969
|
+
className: H(Vt.base, Vt[n] ?? Vt.normal, t),
|
|
1970
|
+
"has-icon": !e(r),
|
|
1971
1971
|
children: [r && /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s(G, {
|
|
1972
1972
|
className: U`
|
|
1973
1973
|
${W.extends.verticalCenter}
|
|
@@ -2347,14 +2347,14 @@ var $ = {
|
|
|
2347
2347
|
number: U`
|
|
2348
2348
|
width: 3rem;
|
|
2349
2349
|
color: ${W.colors.fore.secondary};
|
|
2350
|
-
text-align: right
|
|
2350
|
+
text-align: right;
|
|
2351
2351
|
`,
|
|
2352
2352
|
empty: U`
|
|
2353
2353
|
position: relative;
|
|
2354
2354
|
height: 8.25rem;
|
|
2355
|
-
padding: 0
|
|
2355
|
+
padding: 0;
|
|
2356
2356
|
color: ${W.colors.fore.secondary};
|
|
2357
|
-
text-align: center
|
|
2357
|
+
text-align: center;
|
|
2358
2358
|
`,
|
|
2359
2359
|
emptyContent: U`
|
|
2360
2360
|
display: grid;
|