@burdenoff/microfe-comradecircle 2026.827.1 → 2026.830.1
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/comradecircle/components/AvatarUploadField.js +8 -8
- package/dist/comradecircle/components/CircleCard.js +4 -4
- package/dist/comradecircle/components/CommentThread.d.ts.map +1 -1
- package/dist/comradecircle/components/CommentThread.js +66 -61
- package/dist/comradecircle/components/CommentThread.js.map +1 -1
- package/dist/comradecircle/components/CreateCircleDialog.d.ts.map +1 -1
- package/dist/comradecircle/components/CreateCircleDialog.js +89 -88
- package/dist/comradecircle/components/CreateCircleDialog.js.map +1 -1
- package/dist/comradecircle/components/CreateEventDialog.d.ts.map +1 -1
- package/dist/comradecircle/components/CreateEventDialog.js +28 -27
- package/dist/comradecircle/components/CreateEventDialog.js.map +1 -1
- package/dist/comradecircle/components/DraftsPanel.js +13 -13
- package/dist/comradecircle/components/EventCard.js +5 -5
- package/dist/comradecircle/components/FileImage.js +5 -5
- package/dist/comradecircle/components/ImageAttachments.js +21 -21
- package/dist/comradecircle/components/MemberIdentity.js +4 -4
- package/dist/comradecircle/components/MobileBottomNav.d.ts.map +1 -1
- package/dist/comradecircle/components/MobileBottomNav.js +37 -30
- package/dist/comradecircle/components/MobileBottomNav.js.map +1 -1
- package/dist/comradecircle/components/Pagination.d.ts.map +1 -1
- package/dist/comradecircle/components/Pagination.js +37 -28
- package/dist/comradecircle/components/Pagination.js.map +1 -1
- package/dist/comradecircle/components/PollCard.js +13 -13
- package/dist/comradecircle/components/PostCard.d.ts.map +1 -1
- package/dist/comradecircle/components/PostCard.js +102 -89
- package/dist/comradecircle/components/PostCard.js.map +1 -1
- package/dist/comradecircle/components/PostComposer.js +4 -4
- package/dist/comradecircle/components/ReactionBar.d.ts.map +1 -1
- package/dist/comradecircle/components/ReactionBar.js +65 -55
- package/dist/comradecircle/components/ReactionBar.js.map +1 -1
- package/dist/comradecircle/components/StateViews.d.ts.map +1 -1
- package/dist/comradecircle/components/StateViews.js +38 -30
- package/dist/comradecircle/components/StateViews.js.map +1 -1
- package/dist/comradecircle/components/UpcomingEvents.js +17 -17
- package/dist/comradecircle/hooks/index.d.ts +1 -0
- package/dist/comradecircle/hooks/index.d.ts.map +1 -1
- package/dist/comradecircle/hooks/index.js +1 -0
- package/dist/comradecircle/hooks/useTr.d.ts +18 -0
- package/dist/comradecircle/hooks/useTr.d.ts.map +1 -0
- package/dist/comradecircle/hooks/useTr.js +12 -0
- package/dist/comradecircle/hooks/useTr.js.map +1 -0
- package/dist/comradecircle/pages/FeedPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/FeedPage.js +75 -62
- package/dist/comradecircle/pages/FeedPage.js.map +1 -1
- package/dist/comradecircle/pages/circles/CircleDetailPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/circles/CircleDetailPage.js +439 -401
- package/dist/comradecircle/pages/circles/CircleDetailPage.js.map +1 -1
- package/dist/comradecircle/pages/circles/CirclesPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/circles/CirclesPage.js +124 -117
- package/dist/comradecircle/pages/circles/CirclesPage.js.map +1 -1
- package/dist/comradecircle/pages/events/EventDetailPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/events/EventDetailPage.js +182 -153
- package/dist/comradecircle/pages/events/EventDetailPage.js.map +1 -1
- package/dist/comradecircle/pages/events/EventsPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/events/EventsPage.js +100 -91
- package/dist/comradecircle/pages/events/EventsPage.js.map +1 -1
- package/dist/comradecircle/pages/members/MemberProfilePage.d.ts.map +1 -1
- package/dist/comradecircle/pages/members/MemberProfilePage.js +172 -159
- package/dist/comradecircle/pages/members/MemberProfilePage.js.map +1 -1
- package/dist/comradecircle/pages/members/MembersPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/members/MembersPage.js +103 -104
- package/dist/comradecircle/pages/members/MembersPage.js.map +1 -1
- package/dist/comradecircle/pages/monetization/MonetizationPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/monetization/MonetizationPage.js +319 -297
- package/dist/comradecircle/pages/monetization/MonetizationPage.js.map +1 -1
- package/dist/comradecircle/pages/posts/PostThreadPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/posts/PostThreadPage.js +37 -32
- package/dist/comradecircle/pages/posts/PostThreadPage.js.map +1 -1
- package/dist/comradecircle/pages/profile/MyProfilePage.d.ts.map +1 -1
- package/dist/comradecircle/pages/profile/MyProfilePage.js +182 -177
- package/dist/comradecircle/pages/profile/MyProfilePage.js.map +1 -1
- package/dist/comradecircle/utils/i18n.js +15 -0
- package/dist/comradecircle/utils/i18n.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,58 +1,65 @@
|
|
|
1
1
|
import { useComradeCircle as e } from "../context/ComradeCircleContext.js";
|
|
2
2
|
import "../context/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
4
|
+
import "../hooks/index.js";
|
|
5
|
+
import { cn as n } from "../utils/cn.js";
|
|
6
|
+
import { CalendarDays as r, Contact as i, Newspaper as a, UserCircle as o, Users as s } from "lucide-react";
|
|
7
|
+
import { useLocation as c } from "react-router";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
9
|
//#region src/comradecircle/components/MobileBottomNav.tsx
|
|
8
|
-
var
|
|
10
|
+
var d = [
|
|
9
11
|
{
|
|
10
12
|
id: "feed",
|
|
11
|
-
|
|
13
|
+
labelKey: "comradecircle.nav.feed",
|
|
14
|
+
labelFallback: "Home",
|
|
12
15
|
path: "",
|
|
13
|
-
icon:
|
|
16
|
+
icon: a
|
|
14
17
|
},
|
|
15
18
|
{
|
|
16
19
|
id: "circles",
|
|
17
|
-
|
|
20
|
+
labelKey: "comradecircle.nav.circles",
|
|
21
|
+
labelFallback: "Circles",
|
|
18
22
|
path: "circles",
|
|
19
|
-
icon:
|
|
23
|
+
icon: s
|
|
20
24
|
},
|
|
21
25
|
{
|
|
22
26
|
id: "events",
|
|
23
|
-
|
|
27
|
+
labelKey: "comradecircle.nav.events",
|
|
28
|
+
labelFallback: "Events",
|
|
24
29
|
path: "events",
|
|
25
|
-
icon:
|
|
30
|
+
icon: r
|
|
26
31
|
},
|
|
27
32
|
{
|
|
28
33
|
id: "members",
|
|
29
|
-
|
|
34
|
+
labelKey: "comradecircle.nav.members",
|
|
35
|
+
labelFallback: "Members",
|
|
30
36
|
path: "members",
|
|
31
|
-
icon:
|
|
37
|
+
icon: i
|
|
32
38
|
},
|
|
33
39
|
{
|
|
34
40
|
id: "profile",
|
|
35
|
-
|
|
41
|
+
labelKey: "comradecircle.nav.profile",
|
|
42
|
+
labelFallback: "Profile",
|
|
36
43
|
path: "profile",
|
|
37
|
-
icon:
|
|
44
|
+
icon: o
|
|
38
45
|
}
|
|
39
|
-
],
|
|
40
|
-
let { getPath:
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
"aria-label": "ComradeCircle mobile navigation",
|
|
43
|
-
className:
|
|
44
|
-
children: /* @__PURE__ */
|
|
46
|
+
], f = () => {
|
|
47
|
+
let { getPath: r, navigateTo: i } = e(), a = c(), o = t();
|
|
48
|
+
return /* @__PURE__ */ l("nav", {
|
|
49
|
+
"aria-label": o("comradecircle.nav.mobileAriaLabel", "ComradeCircle mobile navigation"),
|
|
50
|
+
className: n("fixed inset-x-0 bottom-0 z-40 lg:hidden", "border-t border-border-seam bg-bg-surface/95 backdrop-blur-sm", "pb-[max(env(safe-area-inset-bottom),0px)]"),
|
|
51
|
+
children: /* @__PURE__ */ l("ul", {
|
|
45
52
|
className: "flex",
|
|
46
|
-
children:
|
|
47
|
-
let
|
|
48
|
-
return /* @__PURE__ */
|
|
53
|
+
children: d.map((e) => {
|
|
54
|
+
let t = r(e.path), s = e.path === "" ? a.pathname === t : a.pathname === t || a.pathname.startsWith(`${t}/`), c = e.icon;
|
|
55
|
+
return /* @__PURE__ */ l("li", {
|
|
49
56
|
className: "flex-1",
|
|
50
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ u("button", {
|
|
51
58
|
type: "button",
|
|
52
|
-
"aria-current":
|
|
53
|
-
onClick: () =>
|
|
54
|
-
className:
|
|
55
|
-
children: [/* @__PURE__ */ c
|
|
59
|
+
"aria-current": s ? "page" : void 0,
|
|
60
|
+
onClick: () => i(e.path),
|
|
61
|
+
className: n("flex w-full flex-col items-center gap-1 py-2.5 text-[11px] font-medium transition-colors", s ? "text-accent" : "text-text-tertiary hover:text-text-secondary"),
|
|
62
|
+
children: [/* @__PURE__ */ l(c, { className: n("h-5 w-5", s && "text-accent") }), o(e.labelKey, e.labelFallback)]
|
|
56
63
|
})
|
|
57
64
|
}, e.id);
|
|
58
65
|
})
|
|
@@ -60,6 +67,6 @@ var u = [
|
|
|
60
67
|
});
|
|
61
68
|
};
|
|
62
69
|
//#endregion
|
|
63
|
-
export {
|
|
70
|
+
export { f as MobileBottomNav };
|
|
64
71
|
|
|
65
72
|
//# sourceMappingURL=MobileBottomNav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileBottomNav.js","names":[],"sources":["../../../src/comradecircle/components/MobileBottomNav.tsx"],"sourcesContent":["/**\n * MobileBottomNav — ComradeCircle's product-specific mobile tab bar (BOFF-3957).\n * @module comradecircle/components\n *\n * The mobile mocks (`comradecircle-00-mobile-app-preview.png`,\n * `comradecircle-19/20/21-mobile-*.png`) show a fixed Home / Circles / Events /\n * Members / Profile bottom tab bar instead of the shared app-shell's\n * collapsible sidebar/hamburger menu. Mirrors the same five items registered\n * with the host shell in `ComradeCircleRoot` (id/path/icon/order) so the two\n * navs never drift.\n *\n * Fixed at the bottom of the viewport, hidden at and above the `lg` breakpoint\n * to match every other responsive split already used in this MFE (see the\n * `lg:hidden` mobile channel picker / `hidden lg:block` desktop rail in\n * `CircleDetailPage`). Uses `flex` with each tab `flex-1` rather than a CSS\n * grid: build-time MFE composition means only utility classes the host\n * shell's own Tailwind build already emits reach this MFE at runtime, and\n * `grid`/`grid-cols-*` is not reliably among them.\n */\n\nimport type { FC } from 'react';\nimport { Newspaper, Users, CalendarDays, Contact, UserCircle } from 'lucide-react';\nimport { useLocation } from 'react-router';\nimport { useComradeCircle } from '../context';\nimport { cn } from '../utils/cn';\n\ninterface TabDef {\n id: string;\n
|
|
1
|
+
{"version":3,"file":"MobileBottomNav.js","names":[],"sources":["../../../src/comradecircle/components/MobileBottomNav.tsx"],"sourcesContent":["/**\n * MobileBottomNav — ComradeCircle's product-specific mobile tab bar (BOFF-3957).\n * @module comradecircle/components\n *\n * The mobile mocks (`comradecircle-00-mobile-app-preview.png`,\n * `comradecircle-19/20/21-mobile-*.png`) show a fixed Home / Circles / Events /\n * Members / Profile bottom tab bar instead of the shared app-shell's\n * collapsible sidebar/hamburger menu. Mirrors the same five items registered\n * with the host shell in `ComradeCircleRoot` (id/path/icon/order) so the two\n * navs never drift.\n *\n * Fixed at the bottom of the viewport, hidden at and above the `lg` breakpoint\n * to match every other responsive split already used in this MFE (see the\n * `lg:hidden` mobile channel picker / `hidden lg:block` desktop rail in\n * `CircleDetailPage`). Uses `flex` with each tab `flex-1` rather than a CSS\n * grid: build-time MFE composition means only utility classes the host\n * shell's own Tailwind build already emits reach this MFE at runtime, and\n * `grid`/`grid-cols-*` is not reliably among them.\n */\n\nimport type { FC } from 'react';\nimport { Newspaper, Users, CalendarDays, Contact, UserCircle } from 'lucide-react';\nimport { useLocation } from 'react-router';\nimport { useComradeCircle } from '../context';\nimport { useTr } from '../hooks';\nimport { cn } from '../utils/cn';\n\ninterface TabDef {\n id: string;\n labelKey: string;\n labelFallback: string;\n /** Path relative to basePath, '' for the home feed. */\n path: string;\n icon: FC<{ className?: string }>;\n}\n\nconst TABS: TabDef[] = [\n {\n id: 'feed',\n labelKey: 'comradecircle.nav.feed',\n labelFallback: 'Home',\n path: '',\n icon: Newspaper,\n },\n {\n id: 'circles',\n labelKey: 'comradecircle.nav.circles',\n labelFallback: 'Circles',\n path: 'circles',\n icon: Users,\n },\n {\n id: 'events',\n labelKey: 'comradecircle.nav.events',\n labelFallback: 'Events',\n path: 'events',\n icon: CalendarDays,\n },\n {\n id: 'members',\n labelKey: 'comradecircle.nav.members',\n labelFallback: 'Members',\n path: 'members',\n icon: Contact,\n },\n {\n id: 'profile',\n labelKey: 'comradecircle.nav.profile',\n labelFallback: 'Profile',\n path: 'profile',\n icon: UserCircle,\n },\n];\n\nexport const MobileBottomNav: FC = () => {\n const { getPath, navigateTo } = useComradeCircle();\n const location = useLocation();\n const tr = useTr();\n\n return (\n <nav\n aria-label={tr('comradecircle.nav.mobileAriaLabel', 'ComradeCircle mobile navigation')}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-40 lg:hidden',\n 'border-t border-border-seam bg-bg-surface/95 backdrop-blur-sm',\n 'pb-[max(env(safe-area-inset-bottom),0px)]'\n )}\n >\n <ul className=\"flex\">\n {TABS.map((tab) => {\n const target = getPath(tab.path);\n const isActive =\n tab.path === ''\n ? location.pathname === target\n : location.pathname === target || location.pathname.startsWith(`${target}/`);\n const Icon = tab.icon;\n return (\n <li key={tab.id} className=\"flex-1\">\n <button\n type=\"button\"\n aria-current={isActive ? 'page' : undefined}\n onClick={() => navigateTo(tab.path)}\n className={cn(\n 'flex w-full flex-col items-center gap-1 py-2.5 text-[11px] font-medium transition-colors',\n isActive ? 'text-accent' : 'text-text-tertiary hover:text-text-secondary'\n )}\n >\n <Icon className={cn('h-5 w-5', isActive && 'text-accent')} />\n {tr(tab.labelKey, tab.labelFallback)}\n </button>\n </li>\n );\n })}\n </ul>\n </nav>\n );\n};\n"],"mappings":";;;;;;;;;AAoCA,IAAM,IAAiB;CACrB;EACE,IAAI;EACJ,UAAU;EACV,eAAe;EACf,MAAM;EACN,MAAM;CACR;CACA;EACE,IAAI;EACJ,UAAU;EACV,eAAe;EACf,MAAM;EACN,MAAM;CACR;CACA;EACE,IAAI;EACJ,UAAU;EACV,eAAe;EACf,MAAM;EACN,MAAM;CACR;CACA;EACE,IAAI;EACJ,UAAU;EACV,eAAe;EACf,MAAM;EACN,MAAM;CACR;CACA;EACE,IAAI;EACJ,UAAU;EACV,eAAe;EACf,MAAM;EACN,MAAM;CACR;AACF,GAEa,UAA4B;CACvC,IAAM,EAAE,YAAS,kBAAe,EAAiB,GAC3C,IAAW,EAAY,GACvB,IAAK,EAAM;CAEjB,OACE,kBAAC,OAAD;EACE,cAAY,EAAG,qCAAqC,iCAAiC;EACrF,WAAW,EACT,2CACA,iEACA,2CACF;YAEA,kBAAC,MAAD;GAAI,WAAU;aACX,EAAK,KAAK,MAAQ;IACjB,IAAM,IAAS,EAAQ,EAAI,IAAI,GACzB,IACJ,EAAI,SAAS,KACT,EAAS,aAAa,IACtB,EAAS,aAAa,KAAU,EAAS,SAAS,WAAW,GAAG,EAAO,EAAE,GACzE,IAAO,EAAI;IACjB,OACE,kBAAC,MAAD;KAAiB,WAAU;eACzB,kBAAC,UAAD;MACE,MAAK;MACL,gBAAc,IAAW,SAAS,KAAA;MAClC,eAAe,EAAW,EAAI,IAAI;MAClC,WAAW,EACT,4FACA,IAAW,gBAAgB,8CAC7B;gBAPF,CASE,kBAAC,GAAD,EAAM,WAAW,EAAG,WAAW,KAAY,aAAa,EAAI,CAAA,GAC3D,EAAG,EAAI,UAAU,EAAI,aAAa,CAC7B;;IACN,GAbK,EAAI,EAaT;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/comradecircle/components/Pagination.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/comradecircle/components/Pagination.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,YAAY,EACZ,SAAS,GACV,EAAE,eAAe,kDA2CjB"}
|
|
@@ -1,50 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import "../hooks/index.js";
|
|
3
|
+
import { cn as t } from "../utils/cn.js";
|
|
4
|
+
import { ChevronLeft as n, ChevronRight as r } from "lucide-react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Button as o } from "@burdenoff/fe-libs/ui";
|
|
5
7
|
//#region src/comradecircle/components/Pagination.tsx
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
function s({ page: s, pageSize: c, itemCount: l, hasMore: u, onPageChange: d, className: f }) {
|
|
9
|
+
let p = e();
|
|
10
|
+
if (s === 0 && !u) return null;
|
|
11
|
+
let m = l === 0 ? 0 : s * c + 1, h = s * c + l;
|
|
12
|
+
return /* @__PURE__ */ a("div", {
|
|
13
|
+
className: t("mt-4 flex flex-col items-center justify-between gap-3 sm:flex-row", f),
|
|
11
14
|
children: [/* @__PURE__ */ i("p", {
|
|
12
15
|
className: "text-sm text-text-secondary tabular-nums",
|
|
13
16
|
"aria-live": "polite",
|
|
14
|
-
children:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]
|
|
20
|
-
}), /* @__PURE__ */ i("div", {
|
|
17
|
+
children: p("comradecircle.components.pagination.showing", "Showing {{from}}–{{to}}", {
|
|
18
|
+
from: m,
|
|
19
|
+
to: h
|
|
20
|
+
})
|
|
21
|
+
}), /* @__PURE__ */ a("div", {
|
|
21
22
|
className: "flex items-center gap-2",
|
|
22
23
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ a(o, {
|
|
24
25
|
variant: "outline",
|
|
25
26
|
size: "sm",
|
|
26
|
-
onClick: () =>
|
|
27
|
-
disabled:
|
|
28
|
-
"aria-label": "Previous page",
|
|
29
|
-
children: [
|
|
27
|
+
onClick: () => d(s - 1),
|
|
28
|
+
disabled: s === 0,
|
|
29
|
+
"aria-label": p("comradecircle.components.pagination.previousAriaLabel", "Previous page"),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ i(n, { className: "mr-1 h-4 w-4" }),
|
|
32
|
+
" ",
|
|
33
|
+
p("comradecircle.components.pagination.previous", "Previous")
|
|
34
|
+
]
|
|
30
35
|
}),
|
|
31
36
|
/* @__PURE__ */ i("span", {
|
|
32
37
|
className: "min-w-[4.5rem] text-center text-sm text-text-secondary tabular-nums",
|
|
33
|
-
children:
|
|
38
|
+
children: p("comradecircle.components.pagination.page", "Page {{page}}", { page: s + 1 })
|
|
34
39
|
}),
|
|
35
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ a(o, {
|
|
36
41
|
variant: "outline",
|
|
37
42
|
size: "sm",
|
|
38
|
-
onClick: () =>
|
|
39
|
-
disabled: !
|
|
40
|
-
"aria-label": "Next page",
|
|
41
|
-
children: [
|
|
43
|
+
onClick: () => d(s + 1),
|
|
44
|
+
disabled: !u,
|
|
45
|
+
"aria-label": p("comradecircle.components.pagination.nextAriaLabel", "Next page"),
|
|
46
|
+
children: [
|
|
47
|
+
p("comradecircle.components.pagination.next", "Next"),
|
|
48
|
+
" ",
|
|
49
|
+
/* @__PURE__ */ i(r, { className: "ml-1 h-4 w-4" })
|
|
50
|
+
]
|
|
42
51
|
})
|
|
43
52
|
]
|
|
44
53
|
})]
|
|
45
54
|
});
|
|
46
55
|
}
|
|
47
56
|
//#endregion
|
|
48
|
-
export {
|
|
57
|
+
export { s as Pagination };
|
|
49
58
|
|
|
50
59
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/comradecircle/components/Pagination.tsx"],"sourcesContent":["/**\n * Pagination — cursor-aware Prev/Next control for Com* connection lists.\n * @module comradecircle/components\n *\n * The svc list connections return `pageInfo { cursor, hasMore }` and paginate by\n * cursor (offset is a no-op). Pages track a 0-indexed `page` for display and a\n * cursor stack for navigation; this control exposes Prev/Next, disabling Prev on\n * page 0 and Next when the server reports no more rows.\n */\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PaginationProps {\n page: number;\n pageSize: number;\n /** Number of rows on the current page. */\n itemCount: number;\n /** Server flag: are there more rows after this page? */\n hasMore: boolean;\n onPageChange: (page: number) => void;\n className?: string;\n}\n\nexport function Pagination({\n page,\n pageSize,\n itemCount,\n hasMore,\n onPageChange,\n className,\n}: PaginationProps) {\n // Nothing to paginate: single page that also has no more rows.\n if (page === 0 && !hasMore) return null;\n\n const from = itemCount === 0 ? 0 : page * pageSize + 1;\n const to = page * pageSize + itemCount;\n\n return (\n <div\n className={cn('mt-4 flex flex-col items-center justify-between gap-3 sm:flex-row', className)}\n >\n <p className=\"text-sm text-text-secondary tabular-nums\" aria-live=\"polite\">\n Showing {from}–{to}\n </p>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page - 1)}\n disabled={page === 0}\n aria-label
|
|
1
|
+
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/comradecircle/components/Pagination.tsx"],"sourcesContent":["/**\n * Pagination — cursor-aware Prev/Next control for Com* connection lists.\n * @module comradecircle/components\n *\n * The svc list connections return `pageInfo { cursor, hasMore }` and paginate by\n * cursor (offset is a no-op). Pages track a 0-indexed `page` for display and a\n * cursor stack for navigation; this control exposes Prev/Next, disabling Prev on\n * page 0 and Next when the server reports no more rows.\n */\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../hooks';\nimport { cn } from '../utils/cn';\n\ninterface PaginationProps {\n page: number;\n pageSize: number;\n /** Number of rows on the current page. */\n itemCount: number;\n /** Server flag: are there more rows after this page? */\n hasMore: boolean;\n onPageChange: (page: number) => void;\n className?: string;\n}\n\nexport function Pagination({\n page,\n pageSize,\n itemCount,\n hasMore,\n onPageChange,\n className,\n}: PaginationProps) {\n const tr = useTr();\n\n // Nothing to paginate: single page that also has no more rows.\n if (page === 0 && !hasMore) return null;\n\n const from = itemCount === 0 ? 0 : page * pageSize + 1;\n const to = page * pageSize + itemCount;\n\n return (\n <div\n className={cn('mt-4 flex flex-col items-center justify-between gap-3 sm:flex-row', className)}\n >\n <p className=\"text-sm text-text-secondary tabular-nums\" aria-live=\"polite\">\n {tr('comradecircle.components.pagination.showing', 'Showing {{from}}–{{to}}', { from, to })}\n </p>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page - 1)}\n disabled={page === 0}\n aria-label={tr('comradecircle.components.pagination.previousAriaLabel', 'Previous page')}\n >\n <ChevronLeft className=\"mr-1 h-4 w-4\" />{' '}\n {tr('comradecircle.components.pagination.previous', 'Previous')}\n </Button>\n <span className=\"min-w-[4.5rem] text-center text-sm text-text-secondary tabular-nums\">\n {tr('comradecircle.components.pagination.page', 'Page {{page}}', { page: page + 1 })}\n </span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasMore}\n aria-label={tr('comradecircle.components.pagination.nextAriaLabel', 'Next page')}\n >\n {tr('comradecircle.components.pagination.next', 'Next')}{' '}\n <ChevronRight className=\"ml-1 h-4 w-4\" />\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AA0BA,SAAgB,EAAW,EACzB,SACA,aACA,cACA,YACA,iBACA,gBACkB;CAClB,IAAM,IAAK,EAAM;CAGjB,IAAI,MAAS,KAAK,CAAC,GAAS,OAAO;CAEnC,IAAM,IAAO,MAAc,IAAI,IAAI,IAAO,IAAW,GAC/C,IAAK,IAAO,IAAW;CAE7B,OACE,kBAAC,OAAD;EACE,WAAW,EAAG,qEAAqE,CAAS;YAD9F,CAGE,kBAAC,KAAD;GAAG,WAAU;GAA2C,aAAU;aAC/D,EAAG,+CAA+C,2BAA2B;IAAE;IAAM;GAAG,CAAC;EACzF,CAAA,GACH,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,EAAa,IAAO,CAAC;KACpC,UAAU,MAAS;KACnB,cAAY,EAAG,yDAAyD,eAAe;eALzF;MAOE,kBAAC,GAAD,EAAa,WAAU,eAAgB,CAAA;MAAE;MACxC,EAAG,gDAAgD,UAAU;KACxD;;IACR,kBAAC,QAAD;KAAM,WAAU;eACb,EAAG,4CAA4C,iBAAiB,EAAE,MAAM,IAAO,EAAE,CAAC;IAC/E,CAAA;IACN,kBAAC,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,EAAa,IAAO,CAAC;KACpC,UAAU,CAAC;KACX,cAAY,EAAG,qDAAqD,WAAW;eALjF;MAOG,EAAG,4CAA4C,MAAM;MAAG;MACzD,kBAAC,GAAD,EAAc,WAAU,eAAgB,CAAA;KAClC;;GACL;IACF;;AAET"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useComClosePoll as t, useComVotePoll as n } from "../hooks/useComradeCircleApi.js";
|
|
1
|
+
import { useComClosePoll as e, useComVotePoll as t } from "../hooks/useComradeCircleApi.js";
|
|
3
2
|
import "../hooks/index.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
4
|
import { describeError as r, notify as i } from "../lib/toast.js";
|
|
5
5
|
import { formatNumber as a, formatRelativeTime as o } from "../utils/formatters.js";
|
|
6
6
|
import { StatusBadge as s } from "./StatusBadge.js";
|
|
@@ -11,7 +11,7 @@ import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
|
11
11
|
import { Button as g, GlassCard as _ } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
//#region src/comradecircle/components/PollCard.tsx
|
|
13
13
|
function v({ poll: v, canManage: y = !1 }) {
|
|
14
|
-
let b =
|
|
14
|
+
let b = t(), x = e(), [S, C] = u(/* @__PURE__ */ new Set()), w = v.options.reduce((e, t) => e + t.voteCount, 0), T = v.status === "CLOSED", E = l(() => v.options.reduce((e, t) => Math.max(e, t.voteCount), 0), [v.options]), D = S.size > 0, O = async (e) => {
|
|
15
15
|
if (!T) try {
|
|
16
16
|
await b.mutateAsync({
|
|
17
17
|
pollId: v.id,
|
|
@@ -41,14 +41,14 @@ function v({ poll: v, canManage: y = !1 }) {
|
|
|
41
41
|
}),
|
|
42
42
|
/* @__PURE__ */ m("div", {
|
|
43
43
|
className: "mt-4 flex flex-col gap-2.5",
|
|
44
|
-
children: [...v.options].sort((e, t) => e.position - t.position).map((
|
|
45
|
-
let
|
|
44
|
+
children: [...v.options].sort((e, t) => e.position - t.position).map((e) => {
|
|
45
|
+
let t = w > 0 ? e.voteCount / w * 100 : 0, r = w > 0 && e.voteCount === E, i = S.has(e.id);
|
|
46
46
|
return /* @__PURE__ */ h("button", {
|
|
47
47
|
type: "button",
|
|
48
|
-
onClick: () => O(
|
|
48
|
+
onClick: () => O(e.id),
|
|
49
49
|
disabled: T || b.isPending,
|
|
50
50
|
"aria-pressed": i,
|
|
51
|
-
className:
|
|
51
|
+
className: n("group w-full rounded-xl border px-3 py-2.5 text-left transition-all duration-200", i ? "border-accent bg-[var(--color-accent-soft)]/40" : "border-border-seam", !T && !i && "hover:-translate-y-px hover:border-accent hover:bg-bg-sunken/60", T && "cursor-default"),
|
|
52
52
|
children: [/* @__PURE__ */ h("div", {
|
|
53
53
|
className: "flex items-center justify-between gap-2",
|
|
54
54
|
children: [/* @__PURE__ */ h("span", {
|
|
@@ -59,8 +59,8 @@ function v({ poll: v, canManage: y = !1 }) {
|
|
|
59
59
|
"aria-hidden": "true"
|
|
60
60
|
}),
|
|
61
61
|
/* @__PURE__ */ m("span", {
|
|
62
|
-
className:
|
|
63
|
-
children:
|
|
62
|
+
className: n("truncate text-sm", r ? "font-semibold text-text-primary" : "font-medium text-text-secondary"),
|
|
63
|
+
children: e.label
|
|
64
64
|
}),
|
|
65
65
|
r && w > 1 && /* @__PURE__ */ m(f, {
|
|
66
66
|
className: "h-3.5 w-3.5 shrink-0 text-status-warning-text",
|
|
@@ -70,18 +70,18 @@ function v({ poll: v, canManage: y = !1 }) {
|
|
|
70
70
|
}), /* @__PURE__ */ h("span", {
|
|
71
71
|
className: "shrink-0 text-xs tabular-nums text-text-secondary",
|
|
72
72
|
children: [
|
|
73
|
-
a(
|
|
73
|
+
a(e.voteCount),
|
|
74
74
|
" · ",
|
|
75
|
-
Math.round(
|
|
75
|
+
Math.round(t),
|
|
76
76
|
"%"
|
|
77
77
|
]
|
|
78
78
|
})]
|
|
79
79
|
}), /* @__PURE__ */ m(c, {
|
|
80
|
-
value:
|
|
80
|
+
value: t,
|
|
81
81
|
className: "mt-2",
|
|
82
82
|
barClassName: r ? "bg-gradient-to-r from-accent to-[var(--color-accent-soft)]" : "bg-accent/40"
|
|
83
83
|
})]
|
|
84
|
-
},
|
|
84
|
+
}, e.id);
|
|
85
85
|
})
|
|
86
86
|
}),
|
|
87
87
|
/* @__PURE__ */ h("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostCard.d.ts","sourceRoot":"","sources":["../../../src/comradecircle/components/PostCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuBH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yFAAyF;IACzF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,eAAuB,EAAE,cAAsB,EAAE,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"PostCard.d.ts","sourceRoot":"","sources":["../../../src/comradecircle/components/PostCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuBH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yFAAyF;IACzF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,eAAuB,EAAE,cAAsB,EAAE,EAAE,aAAa,2CAiNhG"}
|
|
@@ -1,176 +1,189 @@
|
|
|
1
1
|
import { useComradeCircle as e } from "../context/ComradeCircleContext.js";
|
|
2
2
|
import "../context/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useComRemovePost as t, useComUpdatePost as n } from "../hooks/useComradeCircleApi.js";
|
|
4
|
+
import { useTr as r } from "../hooks/useTr.js";
|
|
5
5
|
import "../hooks/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
6
|
+
import { cn as i } from "../utils/cn.js";
|
|
7
|
+
import { MemberIdentity as a } from "./MemberIdentity.js";
|
|
8
|
+
import { describeError as o, notify as s } from "../lib/toast.js";
|
|
9
|
+
import { ReactionBar as c } from "./ReactionBar.js";
|
|
10
|
+
import { formatRelativeTime as l } from "../utils/formatters.js";
|
|
11
|
+
import { CommentThread as u } from "./CommentThread.js";
|
|
12
|
+
import { AttachmentGrid as d } from "./ImageAttachments.js";
|
|
13
|
+
import { useState as f } from "react";
|
|
14
|
+
import { ArrowUpRight as p, MessageSquare as m, MoreHorizontal as h, Pencil as g, Pin as _, Trash2 as v } from "lucide-react";
|
|
15
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
16
|
+
import { Button as x, DropdownMenu as S, DropdownMenuContent as C, DropdownMenuItem as w, DropdownMenuSeparator as T, DropdownMenuTrigger as E, GlassCard as D, Textarea as O } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/comradecircle/components/PostCard.tsx
|
|
17
|
-
function
|
|
18
|
-
let { currentUser:
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
function k({ post: k, defaultExpanded: A = !1, hideThreadLink: j = !1 }) {
|
|
19
|
+
let { currentUser: M, navigateTo: N } = e(), P = n(), F = t(), I = r(), [L, R] = f(A), [z, B] = f(!1), [V, H] = f(k.body), U = !!(M?.id && M.id === k.authorId);
|
|
20
|
+
return /* @__PURE__ */ b(D, {
|
|
20
21
|
treatment: "plain",
|
|
21
|
-
className:
|
|
22
|
+
className: i("p-4 transition-all duration-200 motion-safe:hover:-translate-y-0.5 hover:border-[var(--color-accent-soft)]", k.isPinned && "ring-1 ring-accent/40"),
|
|
22
23
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ b("div", {
|
|
24
25
|
className: "flex items-start justify-between gap-3",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
memberId:
|
|
26
|
+
children: [/* @__PURE__ */ y(a, {
|
|
27
|
+
memberId: k.authorId,
|
|
27
28
|
variant: "row",
|
|
28
29
|
size: "md",
|
|
29
|
-
suffix:
|
|
30
|
+
suffix: l(k.createdAt),
|
|
30
31
|
showPresence: !0
|
|
31
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ b("div", {
|
|
32
33
|
className: "flex items-center gap-1",
|
|
33
|
-
children: [
|
|
34
|
+
children: [k.isPinned && /* @__PURE__ */ b("span", {
|
|
34
35
|
className: "inline-flex items-center gap-1 rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium text-text-primary",
|
|
35
|
-
children: [
|
|
36
|
-
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ y(_, { className: "h-3 w-3" }),
|
|
38
|
+
" ",
|
|
39
|
+
I("comradecircle.components.postCard.pinned", "Pinned")
|
|
40
|
+
]
|
|
41
|
+
}), U && /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(E, {
|
|
37
42
|
asChild: !0,
|
|
38
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ y("button", {
|
|
39
44
|
type: "button",
|
|
40
|
-
"aria-label": "Post actions",
|
|
45
|
+
"aria-label": I("comradecircle.components.postCard.postActionsAriaLabel", "Post actions"),
|
|
41
46
|
className: "rounded-lg p-1.5 text-text-tertiary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
42
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ y(h, { className: "h-4 w-4" })
|
|
43
48
|
})
|
|
44
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ b(C, {
|
|
45
50
|
align: "end",
|
|
46
51
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
onClick: () =>
|
|
49
|
-
children: [
|
|
52
|
+
/* @__PURE__ */ b(w, {
|
|
53
|
+
onClick: () => B(!0),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ y(g, { className: "mr-2 h-4 w-4" }),
|
|
56
|
+
" ",
|
|
57
|
+
I("comradecircle.components.postCard.edit", "Edit")
|
|
58
|
+
]
|
|
50
59
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ b(w, {
|
|
52
61
|
onClick: async () => {
|
|
53
62
|
try {
|
|
54
|
-
await
|
|
55
|
-
id:
|
|
56
|
-
input: { isPinned: !
|
|
57
|
-
}),
|
|
63
|
+
await P.mutateAsync({
|
|
64
|
+
id: k.id,
|
|
65
|
+
input: { isPinned: !k.isPinned }
|
|
66
|
+
}), s.success(k.isPinned ? I("comradecircle.components.postCard.unpinnedSuccess", "Post unpinned") : I("comradecircle.components.postCard.pinnedSuccess", "Post pinned"));
|
|
58
67
|
} catch (e) {
|
|
59
|
-
|
|
68
|
+
s.error(I("comradecircle.components.postCard.pinError", "Could not update post"), o(e));
|
|
60
69
|
}
|
|
61
70
|
},
|
|
62
71
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ y(_, { className: "mr-2 h-4 w-4" }),
|
|
64
73
|
" ",
|
|
65
|
-
|
|
74
|
+
k.isPinned ? I("comradecircle.components.postCard.unpin", "Unpin") : I("comradecircle.components.postCard.pin", "Pin")
|
|
66
75
|
]
|
|
67
76
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ y(T, {}),
|
|
78
|
+
/* @__PURE__ */ b(w, {
|
|
70
79
|
onClick: async () => {
|
|
71
80
|
try {
|
|
72
|
-
await
|
|
73
|
-
id:
|
|
74
|
-
channelId:
|
|
75
|
-
}),
|
|
81
|
+
await F.mutateAsync({
|
|
82
|
+
id: k.id,
|
|
83
|
+
channelId: k.channelId
|
|
84
|
+
}), s.success(I("comradecircle.components.postCard.removedSuccess", "Post removed"));
|
|
76
85
|
} catch (e) {
|
|
77
|
-
|
|
86
|
+
s.error(I("comradecircle.components.postCard.removeError", "Could not remove post"), o(e));
|
|
78
87
|
}
|
|
79
88
|
},
|
|
80
89
|
className: "text-status-error-text focus:text-status-error-text",
|
|
81
|
-
children: [
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ y(v, { className: "mr-2 h-4 w-4" }),
|
|
92
|
+
" ",
|
|
93
|
+
I("comradecircle.components.postCard.delete", "Delete")
|
|
94
|
+
]
|
|
82
95
|
})
|
|
83
96
|
]
|
|
84
97
|
})] })]
|
|
85
98
|
})]
|
|
86
99
|
}),
|
|
87
|
-
|
|
100
|
+
z ? /* @__PURE__ */ b("div", {
|
|
88
101
|
className: "mt-3",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
-
value:
|
|
91
|
-
onChange: (e) =>
|
|
102
|
+
children: [/* @__PURE__ */ y(O, {
|
|
103
|
+
value: V,
|
|
104
|
+
onChange: (e) => H(e.target.value),
|
|
92
105
|
rows: 3,
|
|
93
106
|
className: "resize-none"
|
|
94
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ b("div", {
|
|
95
108
|
className: "mt-2 flex justify-end gap-2",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ y(x, {
|
|
97
110
|
variant: "outline",
|
|
98
111
|
size: "sm",
|
|
99
112
|
onClick: () => {
|
|
100
|
-
|
|
113
|
+
H(k.body), B(!1);
|
|
101
114
|
},
|
|
102
|
-
children: "Cancel"
|
|
103
|
-
}), /* @__PURE__ */
|
|
115
|
+
children: I("comradecircle.components.postCard.cancel", "Cancel")
|
|
116
|
+
}), /* @__PURE__ */ y(x, {
|
|
104
117
|
size: "sm",
|
|
105
118
|
onClick: async () => {
|
|
106
|
-
let e =
|
|
107
|
-
if (!e || e ===
|
|
108
|
-
|
|
119
|
+
let e = V.trim();
|
|
120
|
+
if (!e || e === k.body) {
|
|
121
|
+
B(!1);
|
|
109
122
|
return;
|
|
110
123
|
}
|
|
111
124
|
try {
|
|
112
|
-
await
|
|
113
|
-
id:
|
|
125
|
+
await P.mutateAsync({
|
|
126
|
+
id: k.id,
|
|
114
127
|
input: { body: e }
|
|
115
|
-
}),
|
|
128
|
+
}), B(!1), s.success(I("comradecircle.components.postCard.updatedSuccess", "Post updated"));
|
|
116
129
|
} catch (e) {
|
|
117
|
-
|
|
130
|
+
s.error(I("comradecircle.components.postCard.updateError", "Could not update post"), o(e));
|
|
118
131
|
}
|
|
119
132
|
},
|
|
120
|
-
disabled:
|
|
121
|
-
children: "Save"
|
|
133
|
+
disabled: P.isPending,
|
|
134
|
+
children: I("comradecircle.components.postCard.save", "Save")
|
|
122
135
|
})]
|
|
123
136
|
})]
|
|
124
|
-
}) : /* @__PURE__ */
|
|
137
|
+
}) : /* @__PURE__ */ y("p", {
|
|
125
138
|
className: "mt-3 whitespace-pre-wrap break-words text-sm text-text-primary",
|
|
126
|
-
children:
|
|
139
|
+
children: k.body
|
|
127
140
|
}),
|
|
128
|
-
|
|
141
|
+
k.tags.length > 0 && /* @__PURE__ */ y("div", {
|
|
129
142
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
130
|
-
children:
|
|
143
|
+
children: k.tags.map((e) => /* @__PURE__ */ b("span", {
|
|
131
144
|
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
132
145
|
children: ["#", e]
|
|
133
146
|
}, e))
|
|
134
147
|
}),
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */
|
|
148
|
+
k.attachmentFileIds.length > 0 && /* @__PURE__ */ y(d, { fileIds: k.attachmentFileIds }),
|
|
149
|
+
/* @__PURE__ */ b("div", {
|
|
137
150
|
className: "mt-3 flex items-center justify-between gap-3 border-t border-border-seam pt-3",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ y(c, { post: k }), /* @__PURE__ */ b("div", {
|
|
139
152
|
className: "flex items-center gap-1",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ b("button", {
|
|
141
154
|
type: "button",
|
|
142
|
-
onClick: () =>
|
|
143
|
-
"aria-expanded":
|
|
144
|
-
className:
|
|
155
|
+
onClick: () => R((e) => !e),
|
|
156
|
+
"aria-expanded": L,
|
|
157
|
+
className: i("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium transition-colors", L ? "bg-[var(--color-accent-soft)] text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
145
158
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ y(m, { className: "h-3.5 w-3.5" }),
|
|
160
|
+
/* @__PURE__ */ y("span", {
|
|
148
161
|
className: "tabular-nums",
|
|
149
|
-
children:
|
|
162
|
+
children: k.commentCount
|
|
150
163
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ y("span", {
|
|
152
165
|
className: "hidden sm:inline",
|
|
153
|
-
children:
|
|
166
|
+
children: k.commentCount === 1 ? I("comradecircle.components.postCard.comment", "comment") : I("comradecircle.components.postCard.comments", "comments")
|
|
154
167
|
})
|
|
155
168
|
]
|
|
156
|
-
}), !
|
|
169
|
+
}), !j && /* @__PURE__ */ b("button", {
|
|
157
170
|
type: "button",
|
|
158
|
-
onClick: () =>
|
|
159
|
-
"aria-label": "Open thread",
|
|
160
|
-
title: "Open thread",
|
|
171
|
+
onClick: () => N(`posts/${k.id}`),
|
|
172
|
+
"aria-label": I("comradecircle.components.postCard.openThreadAriaLabel", "Open thread"),
|
|
173
|
+
title: I("comradecircle.components.postCard.openThreadTitle", "Open thread"),
|
|
161
174
|
className: "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium text-text-tertiary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ y(p, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ y("span", {
|
|
163
176
|
className: "hidden sm:inline",
|
|
164
|
-
children: "Open thread"
|
|
177
|
+
children: I("comradecircle.components.postCard.openThread", "Open thread")
|
|
165
178
|
})]
|
|
166
179
|
})]
|
|
167
180
|
})]
|
|
168
181
|
}),
|
|
169
|
-
|
|
182
|
+
L && /* @__PURE__ */ y(u, { postId: k.id })
|
|
170
183
|
]
|
|
171
184
|
});
|
|
172
185
|
}
|
|
173
186
|
//#endregion
|
|
174
|
-
export {
|
|
187
|
+
export { k as PostCard };
|
|
175
188
|
|
|
176
189
|
//# sourceMappingURL=PostCard.js.map
|