@krosoft/react 0.0.373 → 0.0.374

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 (59) hide show
  1. package/dist/{AppActions-DwzK-4t7.js → AppActions-ooZhFY4I.js} +1 -1
  2. package/dist/{AppMarkdown-ZT7xBtTk.js → AppMarkdown-DR9Xzort.js} +1 -1
  3. package/dist/{AppSubTitle-Bf9rFryk.js → AppSubTitle-RDgLo82r.js} +2 -2
  4. package/dist/{AppTitle-CQgw2Ody.js → AppTitle-HcuNVulh.js} +1 -1
  5. package/dist/{ErrorAlert-BYy61fcZ.js → ErrorAlert-Cyqycy2z.js} +1 -1
  6. package/dist/{GenericForm-C-vJXpaF.js → GenericForm-DrFyl2wt.js} +5 -5
  7. package/dist/{ImageInput-BDTQi0U9.js → ImageInput-Br8DQPTc.js} +1 -1
  8. package/dist/{MultiSelect-60rgAOBX.js → MultiSelect-Bht0L5il.js} +2 -2
  9. package/dist/SearchInput-VVu1aIU4.js +36 -0
  10. package/dist/{SearchInput-CqU6crOu.js → SingleSelect-8V30LYCi.js} +107 -134
  11. package/dist/{behavior-DRGttGb4.js → behavior-DUMKzliu.js} +1 -1
  12. package/dist/{cards-Bwm6Scwc.js → cards-s1HOBgc6.js} +1 -1
  13. package/dist/changelog-m-U0JTTM.js +139 -0
  14. package/dist/{charts-hsygNEkd.js → charts-DH_x5yPB.js} +1 -1
  15. package/dist/components/core/cards/index.js +1 -1
  16. package/dist/components/core/changelog/AppChangelog.d.ts +3 -1
  17. package/dist/components/core/changelog/AppChangelog.d.ts.map +1 -1
  18. package/dist/components/core/changelog/index.js +1 -1
  19. package/dist/components/core/charts/index.js +1 -1
  20. package/dist/components/core/dialogs/index.js +2 -2
  21. package/dist/components/core/filters/index.js +20 -19
  22. package/dist/components/core/forms/index.js +1 -1
  23. package/dist/components/core/index.js +21 -20
  24. package/dist/components/core/inputs/index.js +6 -5
  25. package/dist/components/core/language/index.js +1 -1
  26. package/dist/components/core/layouts/index.js +7 -7
  27. package/dist/components/core/markdown/index.js +1 -1
  28. package/dist/components/core/navbar/index.js +1 -1
  29. package/dist/components/core/states/index.js +2 -2
  30. package/dist/components/core/table/index.js +2 -2
  31. package/dist/components/core/tabs/index.js +4 -4
  32. package/dist/components/core/theme/index.js +1 -1
  33. package/dist/components/index.js +21 -20
  34. package/dist/components/ui/index.js +1 -1
  35. package/dist/{dialogs-0PwhK6c1.js → dialogs-BGwVb_uW.js} +4 -4
  36. package/dist/helpers/changelog.helper.d.ts +5 -0
  37. package/dist/helpers/changelog.helper.d.ts.map +1 -1
  38. package/dist/helpers/index.js +50 -15
  39. package/dist/hooks/behavior/index.js +1 -1
  40. package/dist/hooks/index.js +4 -4
  41. package/dist/hooks/ui/index.js +3 -3
  42. package/dist/i18n/index.js +1 -1
  43. package/dist/i18n/krosoftLocales.d.ts +4 -0
  44. package/dist/i18n/krosoftLocales.d.ts.map +1 -1
  45. package/dist/{i18n-CytpX2hK.js → i18n-Cpw8DZt1.js} +6 -2
  46. package/dist/{inputs-D-ZCdo5D.js → inputs-ClkjpjY4.js} +1 -1
  47. package/dist/{language-Du46nzYN.js → language-Bb_6jQEn.js} +2 -2
  48. package/dist/{navbar-j2_a1yrA.js → navbar-CBtXvlA_.js} +3 -3
  49. package/dist/pwa/index.js +1 -1
  50. package/dist/seasonal/index.js +1 -1
  51. package/dist/{sheet-AgDmjyf2.js → sheet-DOU2o0gO.js} +1 -1
  52. package/dist/{states-BVEFGM99.js → states-CuRWHlch.js} +1 -1
  53. package/dist/{theme-CVY1Dh3F.js → theme-DsMX9lZ7.js} +2 -2
  54. package/dist/{useDocumentTitle-DYRVJ5wt.js → useDocumentTitle-BX7aZKoT.js} +1 -1
  55. package/dist/{useLanguage-CJM24_Ab.js → useLanguage-BigJQQLb.js} +1 -1
  56. package/dist/{useTheme-C5PI6ifZ.js → useTheme-C_AhwSy3.js} +1 -1
  57. package/package.json +1 -1
  58. package/dist/changelog-DA5nb3BI.js +0 -126
  59. package/dist/changelog.helper-BjCKlB0M.js +0 -31
@@ -1,8 +1,43 @@
1
- import { n as e, t } from "../changelog.helper-BjCKlB0M.js";
2
- import { t as n } from "../tailwind.helper-CJaRYBmL.js";
3
- import { t as r } from "../markdown.helper-YJE2H5KQ.js";
1
+ import { t as e } from "../tailwind.helper-CJaRYBmL.js";
2
+ import { t } from "../markdown.helper-YJE2H5KQ.js";
3
+ //#region src/helpers/changelog.helper.ts
4
+ var n = /^## +(.+?)\s*$/, r = /^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/, i = (e) => e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu, "").replace(/\s/g, "-"), a = (e) => {
5
+ let t = r.exec(e);
6
+ if (!t) return { hasTime: !1 };
7
+ let [, n, i, a, o, s] = t, c = o !== void 0 && s !== void 0, l = new Date(Number(n), Number(i) - 1, Number(a), c ? Number(o) : 0, c ? Number(s) : 0);
8
+ return Number.isNaN(l.getTime()) ? { hasTime: !1 } : {
9
+ date: l,
10
+ hasTime: c
11
+ };
12
+ }, o = (e) => {
13
+ let t = [], r = /* @__PURE__ */ new Map(), o, s = () => {
14
+ if (!o) return;
15
+ let e = i(o.title), n = r.get(e) ?? 0;
16
+ r.set(e, n + 1), t.push({
17
+ id: n === 0 ? e : `${e}-${String(n)}`,
18
+ title: o.title,
19
+ ...a(o.title),
20
+ content: o.lines.join("\n").trim()
21
+ });
22
+ };
23
+ for (let t of e.split(/\r?\n/)) {
24
+ let e = n.exec(t)?.[1];
25
+ e === void 0 ? o?.lines.push(t) : (s(), o = {
26
+ title: e,
27
+ lines: []
28
+ });
29
+ }
30
+ return s(), t;
31
+ }, s = (e) => e.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase(), c = (e, t) => {
32
+ let n = s(t).split(/\s+/).filter(Boolean);
33
+ return n.length === 0 ? e : e.filter((e) => {
34
+ let t = s(`${e.title}\n${e.content}`);
35
+ return n.every((e) => t.includes(e));
36
+ });
37
+ };
38
+ //#endregion
4
39
  //#region src/helpers/supabase.helper.ts
5
- function i(e, t, n = {}) {
40
+ function l(e, t, n = {}) {
6
41
  let r = e, i = t.debouncedSearchText ?? t.searchText;
7
42
  if (i?.trim() && n.searchColumns?.length) {
8
43
  let e = `%${i.trim()}%`, t = n.searchColumns.map((t) => `${t}.ilike.${e}`).join(",");
@@ -24,13 +59,13 @@ function i(e, t, n = {}) {
24
59
  let a = (t.currentPage - 1) * t.pageSize, o = a + t.pageSize - 1;
25
60
  return r = r.range(a, o), r;
26
61
  }
27
- function a(e, t) {
62
+ function u(e, t) {
28
63
  return e ? e.map((e) => {
29
64
  let n = e[t];
30
65
  return Array.isArray(n) ? n[0] : n;
31
66
  }).filter((e) => !!e) : [];
32
67
  }
33
- function o(e, t) {
68
+ function d(e, t) {
34
69
  if (!e) return null;
35
70
  let n = Array.isArray(e) ? e[0] : e;
36
71
  if (!n) return null;
@@ -42,24 +77,24 @@ function o(e, t) {
42
77
  }
43
78
  //#endregion
44
79
  //#region src/helpers/table.helper.ts
45
- var s = {
80
+ var f = {
46
81
  left: "text-left",
47
82
  center: "text-center",
48
83
  right: "text-right"
49
84
  };
50
- function c(e) {
85
+ function p(e) {
51
86
  if (e.align !== void 0) return e.align;
52
87
  let t = (e.className ?? "").split(/\s+/);
53
88
  return t.includes("text-right") ? "right" : t.includes("text-center") ? "center" : "left";
54
89
  }
55
- function l(e) {
56
- return s[e];
90
+ function m(e) {
91
+ return f[e];
57
92
  }
58
- var u = "__selection__", d = "__actions__", f = {
93
+ var h = "__selection__", g = "__actions__", _ = {
59
94
  left: "border-r border-border",
60
95
  right: "border-l border-border"
61
96
  };
62
- function p(e, t) {
97
+ function v(e, t) {
63
98
  if (e === void 0) return {
64
99
  className: "relative",
65
100
  style: {}
@@ -71,12 +106,12 @@ function p(e, t) {
71
106
  n ? "z-20" : "z-10",
72
107
  "before:absolute before:inset-0 before:-z-10 before:pointer-events-none",
73
108
  n ? "before:bg-muted/50" : "group-hover:before:bg-muted/50",
74
- e.isEdge ? f[e.side] : ""
109
+ e.isEdge ? _[e.side] : ""
75
110
  ].filter(Boolean).join(" "),
76
111
  style: e.side === "left" ? { left: e.offset } : { right: e.offset }
77
112
  };
78
113
  }
79
- function m(e) {
114
+ function y(e) {
80
115
  return {
81
116
  read: () => {
82
117
  if (typeof window < "u") try {
@@ -96,4 +131,4 @@ function m(e) {
96
131
  };
97
132
  }
98
133
  //#endregion
99
- export { d as ACTIONS_COLUMN_KEY, u as SELECTION_COLUMN_KEY, i as applyTableStateToQuery, n as cn, l as getAlignmentClass, c as getColumnAlignment, p as getFixedCellProps, m as localStorageColumnVisibility, a as mapNestedRelationMany, o as mapNestedRelationOne, t as parseChangelog, r as rehypeVersionSlug, e as slugifyChangelogTitle };
134
+ export { g as ACTIONS_COLUMN_KEY, h as SELECTION_COLUMN_KEY, l as applyTableStateToQuery, e as cn, c as filterChangelog, m as getAlignmentClass, p as getColumnAlignment, v as getFixedCellProps, y as localStorageColumnVisibility, u as mapNestedRelationMany, d as mapNestedRelationOne, o as parseChangelog, t as rehypeVersionSlug, i as slugifyChangelogTitle };
@@ -1 +1 @@
1
- export { t as URL_DATE_FORMAT, n as parseDateRange, r as serializeDateRange, p as useConfirmDeleteDialog, m as useConfirmationDialog, f as useDebounce, d as useDebouncedValue, h as useDialog, u as usePage, l as useSidebar, c as useTable, i as useUrlArrayState, a as useUrlDateRangeState, o as useUrlNumberState, s as useUrlState } from "../../behavior-DRGttGb4.js";
1
+ export { t as URL_DATE_FORMAT, n as parseDateRange, r as serializeDateRange, p as useConfirmDeleteDialog, m as useConfirmationDialog, f as useDebounce, d as useDebouncedValue, h as useDialog, u as usePage, l as useSidebar, c as useTable, i as useUrlArrayState, a as useUrlDateRangeState, o as useUrlNumberState, s as useUrlState } from "../../behavior-DUMKzliu.js";
@@ -3,9 +3,9 @@ import { n as t, t as n } from "../useToast-UeDRLovh.js";
3
3
  import { t as r } from "../useNotifications-CyhTruIG.js";
4
4
  import { t as i } from "../useMobile-pTQ8lWvt.js";
5
5
  import { n as a, t as o } from "../useFixedColumns-Bo-Az3Hp.js";
6
- import { t as s } from "../useDocumentTitle-DYRVJ5wt.js";
7
- import { t as c } from "../useLanguage-CJM24_Ab.js";
6
+ import { t as s } from "../useDocumentTitle-BX7aZKoT.js";
7
+ import { t as c } from "../useLanguage-BigJQQLb.js";
8
8
  import { t as l } from "../ui-nQGnCss1.js";
9
- import { t as u } from "../useTheme-C5PI6ifZ.js";
10
- import { a as d, c as f, d as p, f as m, h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T } from "../behavior-DRGttGb4.js";
9
+ import { t as u } from "../useTheme-C_AhwSy3.js";
10
+ import { a as d, c as f, d as p, f as m, h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T } from "../behavior-DUMKzliu.js";
11
11
  export { w as URL_DATE_FORMAT, y as parseDateRange, S as serializeDateRange, n as toast, x as useConfirmDeleteDialog, v as useConfirmationDialog, a as useDataTable, m as useDebounce, p as useDebouncedValue, h as useDialog, s as useDocumentTitle, o as useFixedColumns, c as useLanguage, i as useMobile, r as useNotifications, T as usePage, e as useScrollFade, l as useServerTable, _ as useSidebar, f as useTable, u as useTheme, t as useToast, g as useUrlArrayState, d as useUrlDateRangeState, b as useUrlNumberState, C as useUrlState };
@@ -3,8 +3,8 @@ import { n as t, t as n } from "../../useToast-UeDRLovh.js";
3
3
  import { t as r } from "../../useNotifications-CyhTruIG.js";
4
4
  import { t as i } from "../../useMobile-pTQ8lWvt.js";
5
5
  import { n as a, t as o } from "../../useFixedColumns-Bo-Az3Hp.js";
6
- import { t as s } from "../../useDocumentTitle-DYRVJ5wt.js";
7
- import { t as c } from "../../useLanguage-CJM24_Ab.js";
6
+ import { t as s } from "../../useDocumentTitle-BX7aZKoT.js";
7
+ import { t as c } from "../../useLanguage-BigJQQLb.js";
8
8
  import { t as l } from "../../ui-nQGnCss1.js";
9
- import { t as u } from "../../useTheme-C5PI6ifZ.js";
9
+ import { t as u } from "../../useTheme-C_AhwSy3.js";
10
10
  export { n as toast, a as useDataTable, s as useDocumentTitle, o as useFixedColumns, c as useLanguage, i as useMobile, r as useNotifications, e as useScrollFade, l as useServerTable, u as useTheme, t as useToast };
@@ -1 +1 @@
1
- export { i as KROSOFT_NAMESPACE, n as dateFnsLocale, a as krosoftLocales, o as registerKrosoftLocales, r as useDateFnsLocale, t as useKrosoftTranslation } from "../i18n-CytpX2hK.js";
1
+ export { i as KROSOFT_NAMESPACE, n as dateFnsLocale, a as krosoftLocales, o as registerKrosoftLocales, r as useDateFnsLocale, t as useKrosoftTranslation } from "../i18n-Cpw8DZt1.js";
@@ -172,6 +172,8 @@ export declare const krosoftLocales: {
172
172
  changelog: {
173
173
  nav: string;
174
174
  empty: string;
175
+ searchPlaceholder: string;
176
+ noResult: string;
175
177
  };
176
178
  };
177
179
  en: {
@@ -340,6 +342,8 @@ export declare const krosoftLocales: {
340
342
  changelog: {
341
343
  nav: string;
342
344
  empty: string;
345
+ searchPlaceholder: string;
346
+ noResult: string;
343
347
  };
344
348
  };
345
349
  };
@@ -1 +1 @@
1
- {"version":3,"file":"krosoftLocales.d.ts","sourceRoot":"","sources":["../../src/i18n/krosoftLocales.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,8FAA8F;AAC9F,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAEzC,gGAAgG;AAChG,UAAU,QAAQ;IAChB,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IACjH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,QAAQ,EAAE,gBAAuB;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,KAAG,IAM5G,CAAC"}
1
+ {"version":3,"file":"krosoftLocales.d.ts","sourceRoot":"","sources":["../../src/i18n/krosoftLocales.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,8FAA8F;AAC9F,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAEzC,gGAAgG;AAChG,UAAU,QAAQ;IAChB,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IACjH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,QAAQ,EAAE,gBAAuB;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,KAAG,IAM5G,CAAC"}
@@ -165,7 +165,9 @@ var r = {
165
165
  },
166
166
  changelog: {
167
167
  nav: "Dates",
168
- empty: "No release notes."
168
+ empty: "No release notes.",
169
+ searchPlaceholder: "Search release notes...",
170
+ noResult: "No release note matches \"{{query}}\"."
169
171
  }
170
172
  }, i = {
171
173
  actions: {
@@ -332,7 +334,9 @@ var r = {
332
334
  },
333
335
  changelog: {
334
336
  nav: "Dates",
335
- empty: "Aucune note de version."
337
+ empty: "Aucune note de version.",
338
+ searchPlaceholder: "Rechercher dans les nouveautés...",
339
+ noResult: "Aucune note ne correspond à « {{query}} »."
336
340
  }
337
341
  }, a = "krosoft", o = {
338
342
  fr: i,
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-CytpX2hK.js";
2
+ import { t } from "./i18n-Cpw8DZt1.js";
3
3
  import { useRef as n, useState as r } from "react";
4
4
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
5
  import { Heart as s, Loader2 as c, Star as l, UploadIcon as u } from "lucide-react";
@@ -1,7 +1,7 @@
1
- import { t as e } from "./i18n-CytpX2hK.js";
1
+ import { t as e } from "./i18n-Cpw8DZt1.js";
2
2
  import { c as t, i as n, n as r, r as i, t as a } from "./tooltip-_geGvbS7.js";
3
3
  import { i as o, l as s, n as c, t as l, u } from "./select-KWMg2_7Z.js";
4
- import { t as d } from "./useLanguage-CJM24_Ab.js";
4
+ import { t as d } from "./useLanguage-BigJQQLb.js";
5
5
  import "react";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
7
  import { LanguagesIcon as m } from "lucide-react";
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-CytpX2hK.js";
2
+ import { t } from "./i18n-Cpw8DZt1.js";
3
3
  import { c as n, i as r, n as i, r as a, t as o } from "./tooltip-_geGvbS7.js";
4
- import { C as s, S as c, b as l, d as u, g as d, h as f, i as p, l as m, m as h, p as g, r as _, t as v, v as y, x as b, y as x } from "./sheet-AgDmjyf2.js";
4
+ import { C as s, S as c, b as l, d as u, g as d, h as f, i as p, l as m, m as h, p as g, r as _, t as v, v as y, x as b, y as x } from "./sheet-DOU2o0gO.js";
5
5
  import { t as S } from "./skeleton-D6Ga4BLw.js";
6
- import { l as C } from "./behavior-DRGttGb4.js";
6
+ import { l as C } from "./behavior-DUMKzliu.js";
7
7
  import * as w from "react";
8
8
  import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
9
9
  import { BellIcon as O, ChevronDownIcon as k, ClockIcon as A, LoaderCircleIcon as j, MenuIcon as M, SearchIcon as N, Trash2Icon as P, XIcon as F } from "lucide-react";
package/dist/pwa/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "../i18n-CytpX2hK.js";
1
+ import { t as e } from "../i18n-Cpw8DZt1.js";
2
2
  import { useEffect as t } from "react";
3
3
  import { toast as n } from "sonner";
4
4
  import { useRegisterSW as r } from "virtual:pwa-register/react";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../i18n-CytpX2hK.js";
1
+ import { t as e } from "../i18n-Cpw8DZt1.js";
2
2
  import { n as t, t as n } from "../switch-DspImmo_.js";
3
3
  import { t as r } from "../useNotifications-CyhTruIG.js";
4
4
  import { useCallback as i, useMemo as a, useSyncExternalStore as o } from "react";
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-CytpX2hK.js";
2
+ import { t } from "./i18n-Cpw8DZt1.js";
3
3
  import { a as n } from "./tooltip-_geGvbS7.js";
4
4
  import * as r from "react";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as e } from "./i18n-CytpX2hK.js";
1
+ import { t as e } from "./i18n-Cpw8DZt1.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  import { Loader2Icon as r } from "lucide-react";
4
4
  //#region src/components/core/states/ErrorState.tsx
@@ -1,7 +1,7 @@
1
- import { t as e } from "./i18n-CytpX2hK.js";
1
+ import { t as e } from "./i18n-Cpw8DZt1.js";
2
2
  import { c as t, i as n, n as r, r as i, t as a } from "./tooltip-_geGvbS7.js";
3
3
  import { i as o, l as s, n as c, t as l, u } from "./select-KWMg2_7Z.js";
4
- import { t as d } from "./useTheme-C5PI6ifZ.js";
4
+ import { t as d } from "./useTheme-C_AhwSy3.js";
5
5
  import "react";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
7
  //#region src/components/core/theme/ThemeSelector.tsx
@@ -1,4 +1,4 @@
1
- import { t as e } from "./i18n-CytpX2hK.js";
1
+ import { t as e } from "./i18n-Cpw8DZt1.js";
2
2
  import { useEffect as t } from "react";
3
3
  //#region src/hooks/ui/useDocumentTitle.ts
4
4
  var n = (n, r, i) => {
@@ -1,4 +1,4 @@
1
- import { t as e } from "./i18n-CytpX2hK.js";
1
+ import { t as e } from "./i18n-Cpw8DZt1.js";
2
2
  import { t } from "./useNotifications-CyhTruIG.js";
3
3
  import { useTranslation as n } from "react-i18next";
4
4
  //#region src/hooks/ui/useLanguage.ts
@@ -1,4 +1,4 @@
1
- import { t as e } from "./i18n-CytpX2hK.js";
1
+ import { t as e } from "./i18n-Cpw8DZt1.js";
2
2
  import { t } from "./useNotifications-CyhTruIG.js";
3
3
  import { useTheme as n } from "next-themes";
4
4
  //#region src/hooks/ui/useTheme.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.373",
3
+ "version": "0.0.374",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -1,126 +0,0 @@
1
- import { t as e } from "./changelog.helper-BjCKlB0M.js";
2
- import { t } from "./tailwind.helper-CJaRYBmL.js";
3
- import { r as n, t as r } from "./i18n-CytpX2hK.js";
4
- import { t as i } from "./useNotifications-CyhTruIG.js";
5
- import { t as a } from "./AppMarkdown-ZT7xBtTk.js";
6
- import { useEffect as o, useMemo as s } from "react";
7
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
- import { LinkIcon as d } from "lucide-react";
9
- import { useLocation as f, useNavigate as p } from "react-router-dom";
10
- import { format as m } from "date-fns";
11
- //#region src/components/core/changelog/AppChangelogEntry.tsx
12
- var h = ({ entry: e, isLatest: i, isLast: o, isActive: s, onSelect: f, onCopyLink: p }) => {
13
- let { t: h } = r(), g = n();
14
- return /* @__PURE__ */ u("section", {
15
- id: e.id,
16
- className: "group flex scroll-mt-4 gap-4",
17
- children: [/* @__PURE__ */ u("div", {
18
- className: "flex w-24 shrink-0 flex-col items-center",
19
- children: [
20
- /* @__PURE__ */ l("a", {
21
- href: `#${e.id}`,
22
- onClick: (t) => {
23
- t.preventDefault(), f(e.id);
24
- },
25
- className: t("mb-2 text-center text-xs font-medium leading-tight text-muted-foreground hover:text-primary", s && "text-primary"),
26
- children: e.date ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", {
27
- className: "block",
28
- children: m(e.date, "d MMM yyyy", { locale: g })
29
- }), e.hasTime ? /* @__PURE__ */ l("span", {
30
- className: "block opacity-70",
31
- children: m(e.date, "HH:mm", { locale: g })
32
- }) : null] }) : e.title
33
- }),
34
- /* @__PURE__ */ l("div", { className: t("relative z-10 size-3 shrink-0 rounded-full", i ? "bg-primary" : "bg-muted-foreground/40", s && "ring-4 ring-primary/20") }),
35
- o ? null : /* @__PURE__ */ l("div", { className: "w-0.5 grow bg-border" })
36
- ]
37
- }), /* @__PURE__ */ u("div", {
38
- className: t("relative mb-6 min-w-0 grow rounded-lg border bg-card px-5 py-4 pr-12 shadow-sm transition-colors [&>p:last-child]:mb-0", s && "border-primary/50"),
39
- children: [/* @__PURE__ */ l("button", {
40
- type: "button",
41
- onClick: () => {
42
- p(e.id);
43
- },
44
- title: h("markdown.copyLink"),
45
- "aria-label": h("markdown.copyLink"),
46
- className: "absolute right-4 top-4 inline-flex text-muted-foreground transition-opacity hover:text-primary md:opacity-0 md:focus-visible:opacity-100 md:group-hover:opacity-100",
47
- children: /* @__PURE__ */ l(d, { className: "size-4" })
48
- }), /* @__PURE__ */ l(a, {
49
- content: e.content,
50
- headingAnchors: !1
51
- })]
52
- })]
53
- });
54
- }, g = ({ entries: e, activeId: i, onSelect: a, className: o }) => {
55
- let { t: s } = r(), c = n();
56
- return /* @__PURE__ */ u("nav", {
57
- "aria-label": s("changelog.nav"),
58
- className: o,
59
- children: [/* @__PURE__ */ l("p", {
60
- className: "mb-2 px-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
61
- children: s("changelog.nav")
62
- }), /* @__PURE__ */ l("ul", {
63
- className: "space-y-0.5 border-l",
64
- children: e.map((e) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l("a", {
65
- href: `#${e.id}`,
66
- onClick: (t) => {
67
- t.preventDefault(), a(e.id);
68
- },
69
- className: t("-ml-px block border-l-2 border-transparent px-3 py-1 text-sm text-muted-foreground hover:border-muted-foreground/40 hover:text-foreground", e.id === i && "border-primary font-medium text-primary hover:border-primary hover:text-primary"),
70
- children: e.date ? m(e.date, e.hasTime ? "d MMM yyyy · HH:mm" : "d MMM yyyy", { locale: c }) : e.title
71
- }) }, e.id))
72
- })]
73
- });
74
- }, _ = ({ content: t, showNav: n = !0 }) => {
75
- let { t: a } = r(), { showSuccess: c, showError: d } = i(), m = f(), _ = p(), v = s(() => e(t), [t]), y = decodeURIComponent(m.hash.slice(1)), b = v.some((e) => e.id === y) ? y : void 0;
76
- o(() => {
77
- if (!b) return;
78
- let e = requestAnimationFrame(() => {
79
- document.getElementById(b)?.scrollIntoView({
80
- behavior: "smooth",
81
- block: "start"
82
- });
83
- });
84
- return () => {
85
- cancelAnimationFrame(e);
86
- };
87
- }, [b]);
88
- let x = (e) => {
89
- _({
90
- search: m.search,
91
- hash: `#${e}`
92
- }, { replace: !0 });
93
- }, S = async (e) => {
94
- x(e);
95
- let t = `${window.location.origin}${m.pathname}${m.search}#${e}`;
96
- try {
97
- await navigator.clipboard.writeText(t), c(a("markdown.linkCopied"));
98
- } catch {
99
- d(a("markdown.linkCopyError"));
100
- }
101
- };
102
- return v.length === 0 ? /* @__PURE__ */ l("p", {
103
- className: "text-sm text-muted-foreground",
104
- children: a("changelog.empty")
105
- }) : /* @__PURE__ */ u("div", {
106
- className: "flex gap-8",
107
- children: [/* @__PURE__ */ l("div", {
108
- className: "min-w-0 flex-1",
109
- children: v.map((e, t) => /* @__PURE__ */ l(h, {
110
- entry: e,
111
- isLatest: t === 0,
112
- isLast: t === v.length - 1,
113
- isActive: e.id === b,
114
- onSelect: x,
115
- onCopyLink: (e) => void S(e)
116
- }, e.id))
117
- }), n ? /* @__PURE__ */ l(g, {
118
- entries: v,
119
- activeId: b,
120
- onSelect: x,
121
- className: "sticky top-4 hidden max-h-[calc(100vh-2rem)] w-52 shrink-0 self-start overflow-y-auto xl:block"
122
- }) : null]
123
- });
124
- };
125
- //#endregion
126
- export { _ as t };
@@ -1,31 +0,0 @@
1
- //#region src/helpers/changelog.helper.ts
2
- var e = /^## +(.+?)\s*$/, t = /^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/, n = (e) => e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu, "").replace(/\s/g, "-"), r = (e) => {
3
- let n = t.exec(e);
4
- if (!n) return { hasTime: !1 };
5
- let [, r, i, a, o, s] = n, c = o !== void 0 && s !== void 0, l = new Date(Number(r), Number(i) - 1, Number(a), c ? Number(o) : 0, c ? Number(s) : 0);
6
- return Number.isNaN(l.getTime()) ? { hasTime: !1 } : {
7
- date: l,
8
- hasTime: c
9
- };
10
- }, i = (t) => {
11
- let i = [], a = /* @__PURE__ */ new Map(), o, s = () => {
12
- if (!o) return;
13
- let e = n(o.title), t = a.get(e) ?? 0;
14
- a.set(e, t + 1), i.push({
15
- id: t === 0 ? e : `${e}-${String(t)}`,
16
- title: o.title,
17
- ...r(o.title),
18
- content: o.lines.join("\n").trim()
19
- });
20
- };
21
- for (let n of t.split(/\r?\n/)) {
22
- let t = e.exec(n)?.[1];
23
- t === void 0 ? o?.lines.push(n) : (s(), o = {
24
- title: t,
25
- lines: []
26
- });
27
- }
28
- return s(), i;
29
- };
30
- //#endregion
31
- export { n, i as t };