@krosoft/react 0.0.375 → 0.0.376
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/{AppActions-DeTaseV8.js → AppActions-8HjAaTQK.js} +1 -1
- package/dist/{AppMarkdown-C0ehlRtp.js → AppMarkdown-CAxm82x0.js} +1 -1
- package/dist/{AppSubTitle-OueYEE4L.js → AppSubTitle-DI62BaaB.js} +2 -2
- package/dist/{AppTitle-J-S0HNmz.js → AppTitle-BXoTrXQc.js} +1 -1
- package/dist/{ErrorAlert-CjapT2rI.js → ErrorAlert-cJnfBL8H.js} +1 -1
- package/dist/{GenericForm-Ze6ukTAA.js → GenericForm-Dxd6k7l-.js} +5 -5
- package/dist/{ImageInput-BnPaGgnU.js → ImageInput-BeIOm3GY.js} +1 -1
- package/dist/{MultiSelect-BnidY_Ma.js → MultiSelect-DPN046kI.js} +2 -2
- package/dist/{SearchInput-BIA1rBub.js → SearchInput-IT_Rvthr.js} +2 -2
- package/dist/{SingleSelect-CbIP1XXV.js → SingleSelect-DLY5WylQ.js} +3 -3
- package/dist/{behavior-BUdJHPMQ.js → behavior-B0BYivtN.js} +1 -1
- package/dist/{cards-olakli0j.js → cards-DPzVebUM.js} +1 -1
- package/dist/changelog-D0SbAISW.js +231 -0
- package/dist/{charts-674ZKA0q.js → charts-C7rKxkli.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/changelog/AppChangelog.d.ts +5 -4
- package/dist/components/core/changelog/AppChangelog.d.ts.map +1 -1
- package/dist/components/core/changelog/AppChangelogEntry.d.ts +2 -5
- package/dist/components/core/changelog/AppChangelogEntry.d.ts.map +1 -1
- package/dist/components/core/changelog/AppChangelogNav.d.ts +1 -1
- package/dist/components/core/changelog/AppChangelogNav.d.ts.map +1 -1
- package/dist/components/core/changelog/index.js +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +5 -5
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +20 -20
- package/dist/components/core/inputs/index.js +5 -5
- package/dist/components/core/language/index.js +1 -1
- package/dist/components/core/layouts/index.js +7 -7
- package/dist/components/core/markdown/index.js +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/index.js +2 -2
- package/dist/components/core/tabs/index.js +4 -4
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +20 -20
- package/dist/components/ui/command.d.ts +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/{dialogs-CZs-1NsV.js → dialogs-CG9Q7pqY.js} +4 -4
- package/dist/helpers/changelog.helper.d.ts +2 -2
- package/dist/helpers/changelog.helper.d.ts.map +1 -1
- package/dist/helpers/index.js +49 -35
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/ui/index.js +3 -3
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/krosoftLocales.d.ts +2 -2
- package/dist/{i18n-w2FziHQf.js → i18n-BhLphJa3.js} +4 -4
- package/dist/{inputs-DidSjfrq.js → inputs-CBojnClc.js} +1 -1
- package/dist/{language-BdqnKech.js → language-DY0EYabh.js} +2 -2
- package/dist/{navbar-BvxHHN-8.js → navbar-DD0V0pNE.js} +3 -3
- package/dist/pwa/index.js +1 -1
- package/dist/seasonal/index.js +1 -1
- package/dist/{sheet-CGz2TZ_Z.js → sheet-cWJO_wkT.js} +1 -1
- package/dist/{states-Bz4MEmfX.js → states-CJ8xE_Nm.js} +1 -1
- package/dist/{theme-DRs7tId5.js → theme-DSumNHLX.js} +2 -2
- package/dist/types/ChangelogEntry.d.ts +11 -4
- package/dist/types/ChangelogEntry.d.ts.map +1 -1
- package/dist/{useDocumentTitle-BJ5nJtLS.js → useDocumentTitle-VoQkict_.js} +1 -1
- package/dist/{useLanguage-BvcHTj-R.js → useLanguage-DRnSb5H1.js} +1 -1
- package/dist/{useTheme-D90lnVPl.js → useTheme-DIZjiF5F.js} +1 -1
- package/package.json +1 -1
- package/dist/changelog-1_YeDWEy.js +0 -208
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./tailwind.helper-CJaRYBmL.js";
|
|
2
|
-
import { filterChangelog as t, getChangelogTags as n, parseChangelog as r, splitChangelogItems as i } from "./helpers/index.js";
|
|
3
|
-
import { r as a, t as o } from "./i18n-w2FziHQf.js";
|
|
4
|
-
import { Nn as s } from "./ui-Fxy95kSJ.js";
|
|
5
|
-
import { t as c } from "./SearchInput-BIA1rBub.js";
|
|
6
|
-
import { t as l } from "./useNotifications-CyhTruIG.js";
|
|
7
|
-
import { t as u } from "./AppMarkdown-C0ehlRtp.js";
|
|
8
|
-
import { useEffect as d, useMemo as f, useState as p } from "react";
|
|
9
|
-
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
|
-
import { LinkIcon as _ } from "lucide-react";
|
|
11
|
-
import { useLocation as v, useNavigate as y } from "react-router-dom";
|
|
12
|
-
import { format as b } from "date-fns";
|
|
13
|
-
//#region src/components/core/changelog/AppChangelogEntry.tsx
|
|
14
|
-
var x = ({ entry: t, isLatest: n, isLast: r, isActive: c, onSelect: l, onCopyLink: d, selectedTags: p }) => {
|
|
15
|
-
let { t: v } = o(), y = a(), x = f(() => i(t.content), [t.content]);
|
|
16
|
-
return /* @__PURE__ */ g("section", {
|
|
17
|
-
id: t.id,
|
|
18
|
-
className: "group flex scroll-mt-4 gap-4",
|
|
19
|
-
children: [/* @__PURE__ */ g("div", {
|
|
20
|
-
className: "flex w-24 shrink-0 flex-col items-center",
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ h("a", {
|
|
23
|
-
href: `#${t.id}`,
|
|
24
|
-
onClick: (e) => {
|
|
25
|
-
e.preventDefault(), l(t.id);
|
|
26
|
-
},
|
|
27
|
-
className: e("mb-2 text-center text-xs font-medium leading-tight text-muted-foreground hover:text-primary", c && "text-primary"),
|
|
28
|
-
children: t.date ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
29
|
-
className: "block",
|
|
30
|
-
children: b(t.date, "d MMM yyyy", { locale: y })
|
|
31
|
-
}), t.hasTime ? /* @__PURE__ */ h("span", {
|
|
32
|
-
className: "block opacity-70",
|
|
33
|
-
children: b(t.date, "HH:mm", { locale: y })
|
|
34
|
-
}) : null] }) : t.title
|
|
35
|
-
}),
|
|
36
|
-
/* @__PURE__ */ h("div", { className: e("relative z-10 size-3 shrink-0 rounded-full", n ? "bg-primary" : "bg-muted-foreground/40", c && "ring-4 ring-primary/20") }),
|
|
37
|
-
r ? null : /* @__PURE__ */ h("div", { className: "w-0.5 grow bg-border" })
|
|
38
|
-
]
|
|
39
|
-
}), /* @__PURE__ */ g("div", {
|
|
40
|
-
className: e("relative mb-6 min-w-0 grow rounded-lg border bg-card px-5 py-4 pr-12 shadow-sm transition-colors", c && "border-primary/50"),
|
|
41
|
-
children: [/* @__PURE__ */ h("button", {
|
|
42
|
-
type: "button",
|
|
43
|
-
onClick: () => {
|
|
44
|
-
d(t.id);
|
|
45
|
-
},
|
|
46
|
-
title: v("markdown.copyLink"),
|
|
47
|
-
"aria-label": v("markdown.copyLink"),
|
|
48
|
-
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",
|
|
49
|
-
children: /* @__PURE__ */ h(_, { className: "size-4" })
|
|
50
|
-
}), /* @__PURE__ */ h("div", {
|
|
51
|
-
className: "space-y-3",
|
|
52
|
-
children: x.map((t, n) => /* @__PURE__ */ g("div", {
|
|
53
|
-
className: "flex flex-col items-start gap-1.5 sm:flex-row sm:gap-3",
|
|
54
|
-
children: [t.tag === void 0 ? null : /* @__PURE__ */ h("span", {
|
|
55
|
-
className: e(s({ variant: p.includes(t.tag) ? "default" : "secondary" }), p.includes(t.tag) ? "hover:bg-primary" : "hover:bg-secondary", "mt-0.5 shrink-0"),
|
|
56
|
-
children: t.tag
|
|
57
|
-
}), /* @__PURE__ */ h("div", {
|
|
58
|
-
className: "min-w-0 [&>*:last-child]:mb-0",
|
|
59
|
-
children: /* @__PURE__ */ h(u, {
|
|
60
|
-
content: t.content,
|
|
61
|
-
headingAnchors: !1
|
|
62
|
-
})
|
|
63
|
-
})]
|
|
64
|
-
}, `${t.tag ?? ""}-${String(n)}`))
|
|
65
|
-
})]
|
|
66
|
-
})]
|
|
67
|
-
});
|
|
68
|
-
}, S = ({ entries: t, activeId: n, onSelect: r, className: i }) => {
|
|
69
|
-
let { t: s } = o(), c = a();
|
|
70
|
-
return /* @__PURE__ */ g("nav", {
|
|
71
|
-
"aria-label": s("changelog.nav"),
|
|
72
|
-
className: i,
|
|
73
|
-
children: [/* @__PURE__ */ h("p", {
|
|
74
|
-
className: "mb-2 px-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
75
|
-
children: s("changelog.nav")
|
|
76
|
-
}), /* @__PURE__ */ h("ul", {
|
|
77
|
-
className: "space-y-0.5 border-l",
|
|
78
|
-
children: t.map((t) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h("a", {
|
|
79
|
-
href: `#${t.id}`,
|
|
80
|
-
onClick: (e) => {
|
|
81
|
-
e.preventDefault(), r(t.id);
|
|
82
|
-
},
|
|
83
|
-
className: e("-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", t.id === n && "border-primary font-medium text-primary hover:border-primary hover:text-primary"),
|
|
84
|
-
children: t.date ? b(t.date, t.hasTime ? "d MMM yyyy · HH:mm" : "d MMM yyyy", { locale: c }) : t.title
|
|
85
|
-
}) }, t.id))
|
|
86
|
-
})]
|
|
87
|
-
});
|
|
88
|
-
}, C = ({ tags: t, selected: n, onToggle: r, onClear: i, className: a }) => {
|
|
89
|
-
let { t: c } = o();
|
|
90
|
-
return /* @__PURE__ */ g("div", {
|
|
91
|
-
className: a,
|
|
92
|
-
children: [/* @__PURE__ */ g("div", {
|
|
93
|
-
className: "mb-2 flex items-center justify-between gap-2",
|
|
94
|
-
children: [/* @__PURE__ */ h("p", {
|
|
95
|
-
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
96
|
-
children: c("changelog.tagsPlaceholder")
|
|
97
|
-
}), n.length > 0 ? /* @__PURE__ */ h("button", {
|
|
98
|
-
type: "button",
|
|
99
|
-
onClick: i,
|
|
100
|
-
className: "text-xs text-muted-foreground hover:text-foreground",
|
|
101
|
-
children: c("actions.clear")
|
|
102
|
-
}) : null]
|
|
103
|
-
}), /* @__PURE__ */ h("div", {
|
|
104
|
-
className: "flex flex-wrap gap-1.5",
|
|
105
|
-
children: t.map((t) => {
|
|
106
|
-
let i = n.includes(t);
|
|
107
|
-
return /* @__PURE__ */ h("button", {
|
|
108
|
-
type: "button",
|
|
109
|
-
"aria-pressed": i,
|
|
110
|
-
onClick: () => {
|
|
111
|
-
r(t);
|
|
112
|
-
},
|
|
113
|
-
className: e(s({ variant: i ? "default" : "outline" }), "cursor-pointer font-medium focus:ring-0 focus-visible:ring-2", !i && "hover:bg-muted"),
|
|
114
|
-
children: t
|
|
115
|
-
}, t);
|
|
116
|
-
})
|
|
117
|
-
})]
|
|
118
|
-
});
|
|
119
|
-
}, w = ({ content: i, showNav: a = !0, showSearch: s = !0 }) => {
|
|
120
|
-
let { t: u } = o(), { showSuccess: m, showError: _ } = l(), b = v(), w = y(), [T, E] = p(""), [D, O] = p([]), k = f(() => r(i), [i]), A = f(() => n(k), [k]), j = f(() => t(k, T, D), [
|
|
121
|
-
k,
|
|
122
|
-
T,
|
|
123
|
-
D
|
|
124
|
-
]), M = (e) => {
|
|
125
|
-
O((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
126
|
-
}, N = k[0]?.id, P = decodeURIComponent(b.hash.slice(1)), F = j.some((e) => e.id === P) ? P : void 0;
|
|
127
|
-
d(() => {
|
|
128
|
-
if (!F) return;
|
|
129
|
-
let e = requestAnimationFrame(() => {
|
|
130
|
-
document.getElementById(F)?.scrollIntoView({
|
|
131
|
-
behavior: "smooth",
|
|
132
|
-
block: "start"
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
return () => {
|
|
136
|
-
cancelAnimationFrame(e);
|
|
137
|
-
};
|
|
138
|
-
}, [F]);
|
|
139
|
-
let I = (e) => {
|
|
140
|
-
w({
|
|
141
|
-
search: b.search,
|
|
142
|
-
hash: `#${e}`
|
|
143
|
-
}, { replace: !0 });
|
|
144
|
-
}, L = async (e) => {
|
|
145
|
-
I(e);
|
|
146
|
-
let t = `${window.location.origin}${b.pathname}${b.search}#${e}`;
|
|
147
|
-
try {
|
|
148
|
-
await navigator.clipboard.writeText(t), m(u("markdown.linkCopied"));
|
|
149
|
-
} catch {
|
|
150
|
-
_(u("markdown.linkCopyError"));
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
if (k.length === 0) return /* @__PURE__ */ h("p", {
|
|
154
|
-
className: "text-sm text-muted-foreground",
|
|
155
|
-
children: u("changelog.empty")
|
|
156
|
-
});
|
|
157
|
-
let R = (e) => /* @__PURE__ */ g("div", {
|
|
158
|
-
className: "flex flex-col gap-4",
|
|
159
|
-
children: [/* @__PURE__ */ h(c, {
|
|
160
|
-
search: T,
|
|
161
|
-
onSearch: E,
|
|
162
|
-
placeholder: u("changelog.searchPlaceholder"),
|
|
163
|
-
className: e ? "md:w-full" : "md:w-96"
|
|
164
|
-
}), A.length > 0 ? /* @__PURE__ */ h(C, {
|
|
165
|
-
tags: A,
|
|
166
|
-
selected: D,
|
|
167
|
-
onToggle: M,
|
|
168
|
-
onClear: () => {
|
|
169
|
-
O([]);
|
|
170
|
-
}
|
|
171
|
-
}) : null]
|
|
172
|
-
}), z = a, B = s;
|
|
173
|
-
return /* @__PURE__ */ g("div", {
|
|
174
|
-
className: "flex gap-8",
|
|
175
|
-
children: [/* @__PURE__ */ g("div", {
|
|
176
|
-
className: "min-w-0 flex-1",
|
|
177
|
-
children: [
|
|
178
|
-
B ? /* @__PURE__ */ h("div", {
|
|
179
|
-
className: e("mb-6", z && "xl:hidden"),
|
|
180
|
-
children: R(!1)
|
|
181
|
-
}) : null,
|
|
182
|
-
j.length === 0 ? /* @__PURE__ */ h("p", {
|
|
183
|
-
className: "text-sm text-muted-foreground",
|
|
184
|
-
children: u("changelog.noResult")
|
|
185
|
-
}) : null,
|
|
186
|
-
j.map((e, t) => /* @__PURE__ */ h(x, {
|
|
187
|
-
entry: e,
|
|
188
|
-
isLatest: e.id === N,
|
|
189
|
-
isLast: t === j.length - 1,
|
|
190
|
-
isActive: e.id === F,
|
|
191
|
-
onSelect: I,
|
|
192
|
-
onCopyLink: (e) => void L(e),
|
|
193
|
-
selectedTags: D
|
|
194
|
-
}, e.id))
|
|
195
|
-
]
|
|
196
|
-
}), z ? /* @__PURE__ */ g("aside", {
|
|
197
|
-
className: "sticky top-4 hidden max-h-[calc(100vh-2rem)] w-64 shrink-0 flex-col gap-6 self-start xl:flex",
|
|
198
|
-
children: [B ? R(!0) : null, j.length > 0 ? /* @__PURE__ */ h(S, {
|
|
199
|
-
entries: j,
|
|
200
|
-
activeId: F,
|
|
201
|
-
onSelect: I,
|
|
202
|
-
className: "min-h-0 flex-1 overflow-y-auto"
|
|
203
|
-
}) : null]
|
|
204
|
-
}) : null]
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
//#endregion
|
|
208
|
-
export { w as t };
|