melonykit 1.1.2 → 1.1.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.
@@ -1,4 +1,4 @@
1
- import { m as e } from "./functions-CSuMpnOY.js";
1
+ import { h as e } from "./functions-CZylI2gQ.js";
2
2
  import { signal as t } from "@preact/signals";
3
3
  import { useEffect as n, useMemo as r } from "preact/hooks";
4
4
  //#region src/browser/_route-to.js
package/dist/browser.js CHANGED
@@ -1 +1 @@
1
- export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-BQLPMs0_.js";
1
+ export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-Cr0Wr7Lc.js";
@@ -201,8 +201,13 @@ function v(e) {
201
201
  return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
202
202
  }
203
203
  //#endregion
204
+ //#region src/functions/_slugify.js
205
+ function y(e) {
206
+ return typeof e == "string" ? e.trim().toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").replace(/æ/g, "ae").replace(/œ/g, "oe").replace(/ø/g, "o").normalize("NFD").replace(/\p{Diacritic}/gu, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") : "";
207
+ }
208
+ //#endregion
204
209
  //#region src/functions/_to-number.js
205
- function y(e, t = null) {
210
+ function b(e, t = null) {
206
211
  let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
207
212
  if (!Number.isFinite(n)) return null;
208
213
  if (t == null) return n;
@@ -211,32 +216,32 @@ function y(e, t = null) {
211
216
  }
212
217
  //#endregion
213
218
  //#region src/functions/checks/_is-array.js
214
- function b(e) {
219
+ function x(e) {
215
220
  return Array.isArray(e);
216
221
  }
217
222
  //#endregion
218
223
  //#region src/functions/checks/_is-empty-array.js
219
- function x(e) {
220
- return b(e) && e.length === 0;
224
+ function S(e) {
225
+ return x(e) && e.length === 0;
221
226
  }
222
227
  //#endregion
223
228
  //#region src/functions/checks/_is-function.js
224
- function S(e) {
229
+ function C(e) {
225
230
  return typeof e == "function";
226
231
  }
227
232
  //#endregion
228
233
  //#region src/functions/checks/_is-number.js
229
- function C(e) {
234
+ function w(e) {
230
235
  return typeof e == "number" && Number.isFinite(e);
231
236
  }
232
237
  //#endregion
233
238
  //#region src/functions/checks/_is-positive-number.js
234
- function w(e) {
235
- return C(e) && e > 0;
239
+ function T(e) {
240
+ return w(e) && e > 0;
236
241
  }
237
242
  //#endregion
238
243
  //#region src/functions/_create-cache.js
239
- function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
244
+ function E({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
240
245
  let i = /* @__PURE__ */ new Map();
241
246
  async function a(t, n) {
242
247
  if (i.has(t)) return !1;
@@ -245,12 +250,12 @@ function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
245
250
  ...n,
246
251
  createdAt: r,
247
252
  lastUpdate: r
248
- }), S(e) && await e(t), !0;
253
+ }), C(e) && await e(t), !0;
249
254
  }
250
255
  async function o(e, n) {
251
256
  if (!i.has(e) || typeof n != "function") return !1;
252
257
  let r = i.get(e);
253
- return await n(r), r.lastUpdate = Date.now(), S(t) && await t(e), !0;
258
+ return await n(r), r.lastUpdate = Date.now(), C(t) && await t(e), !0;
254
259
  }
255
260
  function s(e) {
256
261
  return i.get(e) ?? null;
@@ -267,10 +272,10 @@ function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
267
272
  async function d(e) {
268
273
  if (!i.has(e)) return !1;
269
274
  let t = i.get(e);
270
- return i.delete(e), S(n) && await n(e, t), !0;
275
+ return i.delete(e), C(n) && await n(e, t), !0;
271
276
  }
272
277
  function f({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
273
- w(e) && b(t) && !x(t) && t.every((e) => S(e)) && S(n) && S(r) && r(async () => {
278
+ T(e) && x(t) && !S(t) && t.every((e) => C(e)) && C(n) && C(r) && r(async () => {
274
279
  let e = n();
275
280
  for (let [n, r] of i) t.some((t) => t(r, e)) && await d(n);
276
281
  }, e)?.unref?.();
@@ -287,28 +292,28 @@ function T({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
287
292
  }
288
293
  //#endregion
289
294
  //#region src/functions/checks/_is-nil.js
290
- function E(e) {
295
+ function D(e) {
291
296
  return e == null;
292
297
  }
293
298
  //#endregion
294
299
  //#region src/functions/checks/_is-object.js
295
- function D(e) {
296
- return !E(e) && typeof e == "object" && !b(e);
300
+ function O(e) {
301
+ return !D(e) && typeof e == "object" && !x(e);
297
302
  }
298
303
  //#endregion
299
304
  //#region src/functions/checks/_is-empty-object.js
300
- function O(e) {
301
- return D(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
305
+ function k(e) {
306
+ return O(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
302
307
  }
303
308
  //#endregion
304
309
  //#region src/functions/checks/_is-empty-string.js
305
- function k(e) {
310
+ function A(e) {
306
311
  return n(e) && e.trim().length === 0;
307
312
  }
308
313
  //#endregion
309
314
  //#region src/functions/checks/_is-negative-number.js
310
- function A(e) {
311
- return C(e) && e < 0;
315
+ function j(e) {
316
+ return w(e) && e < 0;
312
317
  }
313
318
  //#endregion
314
- export { i as _, E as a, t as b, C as c, b as d, y as f, d as g, g as h, D as i, S as l, _ as m, k as n, T as o, v as p, O as r, w as s, A as t, x as u, r as v, n as y };
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 +1 @@
1
- export { v as camelCaseToTitleCase, b as convertHexToRgba, o as createCache, _ as darkenHexColor, g as formatDate, d as isArray, u as isEmptyArray, r as isEmptyObject, n as isEmptyString, l as isFunction, t as isNegativeNumber, a as isNil, c as isNumber, i as isObject, s as isPositiveNumber, y as isString, h as kebabCaseToTitleCase, m as request, p as size, f as toNumber } from "./functions-CSuMpnOY.js";
1
+ export { y as camelCaseToTitleCase, x as convertHexToRgba, o as createCache, v as darkenHexColor, _ as formatDate, d as isArray, u as isEmptyArray, r as isEmptyObject, n as isEmptyString, l as isFunction, t as isNegativeNumber, a as isNil, c as isNumber, i as isObject, s as isPositiveNumber, b as isString, g as kebabCaseToTitleCase, h as request, m as size, p as slugify, f as toNumber } from "./functions-CZylI2gQ.js";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as e, t } from "./browser-BQLPMs0_.js";
2
- import { _ as n, n as r } from "./functions-CSuMpnOY.js";
1
+ import { n as e, t } from "./browser-Cr0Wr7Lc.js";
2
+ import { n, v as r } from "./functions-CZylI2gQ.js";
3
3
  import { useSignal as i } from "@preact/signals";
4
4
  import { useEffect as a, useId as o, useRef as s } from "preact/hooks";
5
5
  import { Fragment as c, jsx as l, jsxs as u } from "preact/jsx-runtime";
@@ -1011,7 +1011,7 @@ var Dt = bt`
1011
1011
  `,
1012
1012
  secondary: O`
1013
1013
  color: ${k.colors.fore.primary};
1014
- border-color: ${n(k.colors.secondary, .2)};
1014
+ border-color: ${r(k.colors.secondary, .2)};
1015
1015
  background-color: ${k.colors.secondary};
1016
1016
  `,
1017
1017
  neutral: O`
@@ -1276,7 +1276,6 @@ var Lt = {
1276
1276
  logo: O`
1277
1277
  display: block;
1278
1278
  pointer-events: auto;
1279
- display: block;
1280
1279
  max-width: 8rem;
1281
1280
  max-height: 3rem;
1282
1281
  `,
@@ -1465,15 +1464,15 @@ var Ht = {
1465
1464
  transition: width .3s ease;
1466
1465
  `,
1467
1466
  normal: O`
1468
- border: solid 1px ${n(k.colors.primary, .3)};
1467
+ border: solid 1px ${r(k.colors.primary, .3)};
1469
1468
  background-color: ${k.colors.primary};
1470
1469
  `,
1471
1470
  warn: O`
1472
- border: solid 1px ${n(k.colors.secondary, .2)};
1471
+ border: solid 1px ${r(k.colors.secondary, .2)};
1473
1472
  background-color: ${k.colors.secondary};
1474
1473
  `,
1475
1474
  danger: O`
1476
- border: solid 1px ${n(k.colors.danger, .3)};
1475
+ border: solid 1px ${r(k.colors.danger, .3)};
1477
1476
  background-color: ${k.colors.danger};
1478
1477
  `
1479
1478
  };
@@ -1880,7 +1879,7 @@ var rn = {
1880
1879
  height: 1rem;
1881
1880
  margin-top: -.375rem;
1882
1881
  border-radius: 50%;
1883
- border: solid 1px ${n(k.colors.primary, .3)};
1882
+ border: solid 1px ${r(k.colors.primary, .3)};
1884
1883
  background-color: ${k.colors.primary};
1885
1884
  transition: transform .15s ease;
1886
1885
  }
@@ -2092,7 +2091,7 @@ var cn = bt`
2092
2091
  --checked-background-color: ${k.colors.primary};
2093
2092
  `,
2094
2093
  secondary: O`
2095
- --checked-border-color: ${n(k.colors.secondary, .2)};
2094
+ --checked-border-color: ${r(k.colors.secondary, .2)};
2096
2095
  --checked-background-color: ${k.colors.secondary};
2097
2096
  `,
2098
2097
  input: O`
@@ -2200,7 +2199,7 @@ var hn = {
2200
2199
  background-color: ${k.colors.back.secondary};
2201
2200
 
2202
2201
  &:before {
2203
- border-color: ${n(k.colors.primary, .3)};
2202
+ border-color: ${r(k.colors.primary, .3)};
2204
2203
  background-color: ${k.colors.primary};
2205
2204
  transform: translate(${pn}px, -50%);
2206
2205
  }
@@ -2239,16 +2238,16 @@ var hn = {
2239
2238
  };
2240
2239
  //#endregion
2241
2240
  //#region src/components/_tag.jsx
2242
- function gn({ className: e, variant: t = "normal", iconName: n = "", label: i }) {
2241
+ function gn({ className: e, variant: t = "normal", iconName: r = "", label: i }) {
2243
2242
  return /* @__PURE__ */ l(c, { children: /* @__PURE__ */ u("div", {
2244
2243
  className: D(_n.base, _n[t] ?? _n.normal, e),
2245
- "has-icon": !r(n),
2246
- children: [n && /* @__PURE__ */ l(c, { children: /* @__PURE__ */ l(wt, {
2244
+ "has-icon": !n(r),
2245
+ children: [r && /* @__PURE__ */ l(c, { children: /* @__PURE__ */ l(wt, {
2247
2246
  className: O`
2248
2247
  ${k.extends.verticalCenter}
2249
2248
  left: .4rem;
2250
2249
  `,
2251
- iconName: n,
2250
+ iconName: r,
2252
2251
  size: ".9rem"
2253
2252
  }) }), i]
2254
2253
  }) });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Vadim Hermann",
3
3
  "name": "melonykit",
4
- "version": "1.1.2",
4
+ "version": "1.1.3",
5
5
  "type": "module",
6
6
  "description": "Preact based ui and utility functions toolkit",
7
7
  "main": "./dist/index.js",