@burdenoff/microfe-comradecircle 2026.525.1 → 2026.704.2
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/ComradeCircleRoot.js +75 -95
- package/dist/comradecircle/ComradeCircleRoot.js.map +1 -1
- package/dist/comradecircle/ComradeCircleRoutes.js +58 -37
- package/dist/comradecircle/ComradeCircleRoutes.js.map +1 -1
- package/dist/comradecircle/components/Avatar.js +47 -0
- package/dist/comradecircle/components/Avatar.js.map +1 -0
- package/dist/comradecircle/components/AvatarUploadField.js +80 -0
- package/dist/comradecircle/components/AvatarUploadField.js.map +1 -0
- package/dist/comradecircle/components/CircleCard.js +118 -0
- package/dist/comradecircle/components/CircleCard.js.map +1 -0
- package/dist/comradecircle/components/CommentThread.js +105 -0
- package/dist/comradecircle/components/CommentThread.js.map +1 -0
- package/dist/comradecircle/components/CreateCircleDialog.js +159 -0
- package/dist/comradecircle/components/CreateCircleDialog.js.map +1 -0
- package/dist/comradecircle/components/CreateEventDialog.js +210 -0
- package/dist/comradecircle/components/CreateEventDialog.js.map +1 -0
- package/dist/comradecircle/components/EmptyState.js +35 -0
- package/dist/comradecircle/components/EmptyState.js.map +1 -0
- package/dist/comradecircle/components/EventCard.js +93 -0
- package/dist/comradecircle/components/EventCard.js.map +1 -0
- package/dist/comradecircle/components/FileImage.js +20 -0
- package/dist/comradecircle/components/FileImage.js.map +1 -0
- package/dist/comradecircle/components/FilterTabs.js +27 -0
- package/dist/comradecircle/components/FilterTabs.js.map +1 -0
- package/dist/comradecircle/components/ImageAttachments.js +97 -0
- package/dist/comradecircle/components/ImageAttachments.js.map +1 -0
- package/dist/comradecircle/components/MemberIdentity.js +44 -0
- package/dist/comradecircle/components/MemberIdentity.js.map +1 -0
- package/dist/comradecircle/components/MiniBar.js +22 -0
- package/dist/comradecircle/components/MiniBar.js.map +1 -0
- package/dist/comradecircle/components/PageLayout.js +38 -0
- package/dist/comradecircle/components/PageLayout.js.map +1 -0
- package/dist/comradecircle/components/Pagination.js +50 -0
- package/dist/comradecircle/components/Pagination.js.map +1 -0
- package/dist/comradecircle/components/PollCard.js +97 -0
- package/dist/comradecircle/components/PollCard.js.map +1 -0
- package/dist/comradecircle/components/PostCard.js +163 -0
- package/dist/comradecircle/components/PostCard.js.map +1 -0
- package/dist/comradecircle/components/PostComposer.js +87 -0
- package/dist/comradecircle/components/PostComposer.js.map +1 -0
- package/dist/comradecircle/components/ReactionBar.js +122 -0
- package/dist/comradecircle/components/ReactionBar.js.map +1 -0
- package/dist/comradecircle/components/StateViews.js +49 -0
- package/dist/comradecircle/components/StateViews.js.map +1 -0
- package/dist/comradecircle/components/StatusBadge.js +68 -0
- package/dist/comradecircle/components/StatusBadge.js.map +1 -0
- package/dist/comradecircle/components/Tabs.js +31 -0
- package/dist/comradecircle/components/Tabs.js.map +1 -0
- package/dist/comradecircle/components/TagInput.js +49 -0
- package/dist/comradecircle/components/TagInput.js.map +1 -0
- package/dist/comradecircle/context/ComradeCircleContext.js +85 -0
- package/dist/comradecircle/context/ComradeCircleContext.js.map +1 -0
- package/dist/comradecircle/context/index.js +1 -0
- package/dist/comradecircle/hooks/index.js +3 -0
- package/dist/comradecircle/hooks/useComradeCircleApi.js +419 -0
- package/dist/comradecircle/hooks/useComradeCircleApi.js.map +1 -0
- package/dist/comradecircle/hooks/useCursorPager.js +25 -0
- package/dist/comradecircle/hooks/useCursorPager.js.map +1 -0
- package/dist/comradecircle/hooks/useFiles.js +78 -0
- package/dist/comradecircle/hooks/useFiles.js.map +1 -0
- package/dist/comradecircle/index.js +5 -2
- package/dist/comradecircle/lib/graphql-cache.js +9 -0
- package/dist/comradecircle/lib/graphql-cache.js.map +1 -0
- package/dist/comradecircle/lib/toast.js +39 -0
- package/dist/comradecircle/lib/toast.js.map +1 -0
- package/dist/comradecircle/pages/FeedPage.js +65 -0
- package/dist/comradecircle/pages/FeedPage.js.map +1 -0
- package/dist/comradecircle/pages/circles/CircleDetailPage.js +651 -0
- package/dist/comradecircle/pages/circles/CircleDetailPage.js.map +1 -0
- package/dist/comradecircle/pages/circles/CirclesPage.js +129 -0
- package/dist/comradecircle/pages/circles/CirclesPage.js.map +1 -0
- package/dist/comradecircle/pages/events/EventDetailPage.js +276 -0
- package/dist/comradecircle/pages/events/EventDetailPage.js.map +1 -0
- package/dist/comradecircle/pages/events/EventsPage.js +102 -0
- package/dist/comradecircle/pages/events/EventsPage.js.map +1 -0
- package/dist/comradecircle/pages/members/MemberProfilePage.js +138 -0
- package/dist/comradecircle/pages/members/MemberProfilePage.js.map +1 -0
- package/dist/comradecircle/pages/members/MembersPage.js +153 -0
- package/dist/comradecircle/pages/members/MembersPage.js.map +1 -0
- package/dist/comradecircle/pages/profile/MyProfilePage.js +266 -0
- package/dist/comradecircle/pages/profile/MyProfilePage.js.map +1 -0
- package/dist/comradecircle/utils/cn.js +10 -0
- package/dist/comradecircle/utils/cn.js.map +1 -0
- package/dist/comradecircle/utils/formatters.js +51 -0
- package/dist/comradecircle/utils/formatters.js.map +1 -0
- package/dist/comradecircle/utils/navigation.js +2 -1
- package/dist/comradecircle/utils/navigation.js.map +1 -1
- package/dist/comradecircle/utils/slug.js +8 -0
- package/dist/comradecircle/utils/slug.js.map +1 -0
- package/dist/index.js +6 -4
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1716 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/package.json +3 -2
- package/dist/comradecircle/pages/CommunitiesPage.js +0 -299
- package/dist/comradecircle/pages/CommunitiesPage.js.map +0 -1
- package/dist/comradecircle/pages/CreatorPage.js +0 -399
- package/dist/comradecircle/pages/CreatorPage.js.map +0 -1
- package/dist/comradecircle/pages/DashboardPage.js +0 -265
- package/dist/comradecircle/pages/DashboardPage.js.map +0 -1
- package/dist/comradecircle/providers/ComradeCircleProvider.js +0 -27
- package/dist/comradecircle/providers/ComradeCircleProvider.js.map +0 -1
- package/dist/comradecircle/store/comradecircleStore.js +0 -345
- package/dist/comradecircle/store/comradecircleStore.js.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { X as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { Input as a } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
//#region src/comradecircle/components/TagInput.tsx
|
|
7
|
+
function o({ value: o, onChange: s, placeholder: c = "Add a tag…", max: l = 12, className: u, id: d }) {
|
|
8
|
+
let [f, p] = t(""), m = (e) => {
|
|
9
|
+
let t = e.trim().replace(/^#/, "").toLowerCase();
|
|
10
|
+
if (t) {
|
|
11
|
+
if (o.includes(t)) {
|
|
12
|
+
p("");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
o.length >= l || (s([...o, t]), p(""));
|
|
16
|
+
}
|
|
17
|
+
}, h = (e) => s(o.filter((t) => t !== e));
|
|
18
|
+
return /* @__PURE__ */ i("div", {
|
|
19
|
+
className: e("flex flex-wrap items-center gap-1.5 rounded-xl border border-border-seam bg-bg-surface px-2 py-1.5", u),
|
|
20
|
+
children: [o.map((e) => /* @__PURE__ */ i("span", {
|
|
21
|
+
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
22
|
+
children: [
|
|
23
|
+
"#",
|
|
24
|
+
e,
|
|
25
|
+
/* @__PURE__ */ r("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
onClick: () => h(e),
|
|
28
|
+
"aria-label": `Remove ${e}`,
|
|
29
|
+
className: "text-text-tertiary hover:text-text-primary",
|
|
30
|
+
children: /* @__PURE__ */ r(n, { className: "h-3 w-3" })
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
}, e)), /* @__PURE__ */ r(a, {
|
|
34
|
+
id: d,
|
|
35
|
+
value: f,
|
|
36
|
+
onChange: (e) => p(e.target.value),
|
|
37
|
+
onKeyDown: (e) => {
|
|
38
|
+
e.key === "Enter" || e.key === "," ? (e.preventDefault(), m(f)) : e.key === "Backspace" && !f && o.length > 0 && h(o[o.length - 1]);
|
|
39
|
+
},
|
|
40
|
+
onBlur: () => m(f),
|
|
41
|
+
placeholder: o.length === 0 ? c : "",
|
|
42
|
+
className: "h-7 min-w-[8rem] flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0"
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { o as TagInput };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=TagInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagInput.js","names":[],"sources":["../../../src/comradecircle/components/TagInput.tsx"],"sourcesContent":["/**\n * TagInput — a lightweight chip-based tag editor.\n * @module comradecircle/components\n *\n * Enter or comma commits a tag; Backspace on an empty field removes the last.\n * Purely controlled — the parent owns the string[] value.\n */\n\nimport { useState, type KeyboardEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { Input } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface TagInputProps {\n value: string[];\n onChange: (tags: string[]) => void;\n placeholder?: string;\n max?: number;\n className?: string;\n id?: string;\n}\n\nexport function TagInput({\n value,\n onChange,\n placeholder = 'Add a tag…',\n max = 12,\n className,\n id,\n}: TagInputProps) {\n const [draft, setDraft] = useState('');\n\n const commit = (raw: string) => {\n const tag = raw.trim().replace(/^#/, '').toLowerCase();\n if (!tag) return;\n if (value.includes(tag)) {\n setDraft('');\n return;\n }\n if (value.length >= max) return;\n onChange([...value, tag]);\n setDraft('');\n };\n\n const remove = (tag: string) => onChange(value.filter((t) => t !== tag));\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' || e.key === ',') {\n e.preventDefault();\n commit(draft);\n } else if (e.key === 'Backspace' && !draft && value.length > 0) {\n remove(value[value.length - 1]!);\n }\n };\n\n return (\n <div\n className={cn(\n 'flex flex-wrap items-center gap-1.5 rounded-xl border border-border-seam bg-bg-surface px-2 py-1.5',\n className\n )}\n >\n {value.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary\"\n >\n #{tag}\n <button\n type=\"button\"\n onClick={() => remove(tag)}\n aria-label={`Remove ${tag}`}\n className=\"text-text-tertiary hover:text-text-primary\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </span>\n ))}\n <Input\n id={id}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKeyDown}\n onBlur={() => commit(draft)}\n placeholder={value.length === 0 ? placeholder : ''}\n className=\"h-7 min-w-[8rem] flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0\"\n />\n </div>\n );\n}\n"],"mappings":";;;;;;AAsBA,SAAgB,EAAS,EACvB,UACA,aACA,iBAAc,cACd,SAAM,IACN,cACA,SACgB;CAChB,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG,EAEhC,KAAU,MAAgB;EAC9B,IAAM,IAAM,EAAI,MAAM,CAAC,QAAQ,MAAM,GAAG,CAAC,aAAa;AACjD,SACL;OAAI,EAAM,SAAS,EAAI,EAAE;AACvB,MAAS,GAAG;AACZ;;AAEE,KAAM,UAAU,MACpB,EAAS,CAAC,GAAG,GAAO,EAAI,CAAC,EACzB,EAAS,GAAG;;IAGR,KAAU,MAAgB,EAAS,EAAM,QAAQ,MAAM,MAAM,EAAI,CAAC;AAWxE,QACE,kBAAC,OAAD;EACE,WAAW,EACT,sGACA,EACD;YAJH,CAMG,EAAM,KAAK,MACV,kBAAC,QAAD;GAEE,WAAU;aAFZ;IAGC;IACG;IACF,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAO,EAAI;KAC1B,cAAY,UAAU;KACtB,WAAU;eAEV,kBAAC,GAAD,EAAG,WAAU,WAAY,CAAA;KAClB,CAAA;IACJ;KAZA,EAYA,CACP,EACF,kBAAC,GAAD;GACM;GACJ,OAAO;GACP,WAAW,MAAM,EAAS,EAAE,OAAO,MAAM;GAC9B,YApCE,MAAuC;AACxD,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,OACjC,EAAE,gBAAgB,EAClB,EAAO,EAAM,IACJ,EAAE,QAAQ,eAAe,CAAC,KAAS,EAAM,SAAS,KAC3D,EAAO,EAAM,EAAM,SAAS,GAAI;;GAgC9B,cAAc,EAAO,EAAM;GAC3B,aAAa,EAAM,WAAW,IAAI,IAAc;GAChD,WAAU;GACV,CAAA,CACE"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { joinPath as e } from "../utils/navigation.js";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useMemo as i } from "react";
|
|
3
|
+
import { MemoryRouter as a, useNavigate as o } from "react-router-dom";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
+
//#region src/comradecircle/context/ComradeCircleContext.tsx
|
|
6
|
+
var c = t(null);
|
|
7
|
+
function l() {
|
|
8
|
+
let e = r(c);
|
|
9
|
+
if (!e) throw Error("useComradeCircle must be used within a ComradeCircleProvider");
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
var u = ({ children: t, basePath: r, currentUser: a, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f }) => {
|
|
13
|
+
let p = o(), m = r || "/", h = n((t) => e(m, t), [m]), g = n((t) => {
|
|
14
|
+
p(e(m, t));
|
|
15
|
+
}, [m, p]), _ = i(() => ({
|
|
16
|
+
basePath: m,
|
|
17
|
+
navigate: void 0,
|
|
18
|
+
currentUser: a,
|
|
19
|
+
tenantId: l,
|
|
20
|
+
workspaceId: u,
|
|
21
|
+
apiGatewayUrl: d,
|
|
22
|
+
authToken: f,
|
|
23
|
+
isStandalone: !0,
|
|
24
|
+
navigateTo: g,
|
|
25
|
+
getPath: h
|
|
26
|
+
}), [
|
|
27
|
+
m,
|
|
28
|
+
a,
|
|
29
|
+
l,
|
|
30
|
+
u,
|
|
31
|
+
d,
|
|
32
|
+
f,
|
|
33
|
+
g,
|
|
34
|
+
h
|
|
35
|
+
]);
|
|
36
|
+
return /* @__PURE__ */ s(c.Provider, {
|
|
37
|
+
value: _,
|
|
38
|
+
children: t
|
|
39
|
+
});
|
|
40
|
+
}, d = ({ children: t, basePath: r, navigate: a, currentUser: o, tenantId: l, workspaceId: u, apiGatewayUrl: d, authToken: f }) => {
|
|
41
|
+
let p = r || "/", m = n((t) => e(p, t), [p]), h = n((t) => {
|
|
42
|
+
a(e(p, t));
|
|
43
|
+
}, [p, a]), g = i(() => ({
|
|
44
|
+
basePath: p,
|
|
45
|
+
navigate: a,
|
|
46
|
+
currentUser: o,
|
|
47
|
+
tenantId: l,
|
|
48
|
+
workspaceId: u,
|
|
49
|
+
apiGatewayUrl: d,
|
|
50
|
+
authToken: f,
|
|
51
|
+
isStandalone: !1,
|
|
52
|
+
navigateTo: h,
|
|
53
|
+
getPath: m
|
|
54
|
+
}), [
|
|
55
|
+
p,
|
|
56
|
+
a,
|
|
57
|
+
o,
|
|
58
|
+
l,
|
|
59
|
+
u,
|
|
60
|
+
d,
|
|
61
|
+
f,
|
|
62
|
+
h,
|
|
63
|
+
m
|
|
64
|
+
]);
|
|
65
|
+
return /* @__PURE__ */ s(c.Provider, {
|
|
66
|
+
value: g,
|
|
67
|
+
children: t
|
|
68
|
+
});
|
|
69
|
+
}, f = (e) => {
|
|
70
|
+
let { children: t, navigate: n } = e;
|
|
71
|
+
return n ? /* @__PURE__ */ s(d, {
|
|
72
|
+
...e,
|
|
73
|
+
navigate: n,
|
|
74
|
+
isStandalone: !1,
|
|
75
|
+
children: t
|
|
76
|
+
}) : /* @__PURE__ */ s(a, { children: /* @__PURE__ */ s(u, {
|
|
77
|
+
...e,
|
|
78
|
+
isStandalone: !0,
|
|
79
|
+
children: t
|
|
80
|
+
}) });
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
export { f as ComradeCircleProvider, l as useComradeCircle };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=ComradeCircleContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComradeCircleContext.js","names":[],"sources":["../../../src/comradecircle/context/ComradeCircleContext.tsx"],"sourcesContent":["/**\n * ComradeCircle Context Provider\n * @module comradecircle/context\n *\n * Splits standalone mode (wraps its own MemoryRouter + useNavigate) from\n * integrated mode (the host shell supplies `navigate`). Exposes gateway/auth\n * context + relative navigation helpers to every page.\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { ComradeCircleRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\ninterface ComradeCircleContextValue extends Omit<\n ComradeCircleRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode). */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath. */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path. */\n getPath: (relativePath: string) => string;\n}\n\nconst ComradeCircleContext = createContext<ComradeCircleContextValue | null>(null);\n\nexport function useComradeCircle(): ComradeCircleContextValue {\n const context = useContext(ComradeCircleContext);\n if (!context) {\n throw new Error('useComradeCircle must be used within a ComradeCircleProvider');\n }\n return context;\n}\n\ntype ProviderProps = Omit<ComradeCircleRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n routerNavigate(joinPath(effectiveBasePath, relativePath));\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<ComradeCircleContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <ComradeCircleContext.Provider value={contextValue}>{children}</ComradeCircleContext.Provider>\n );\n};\n\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n navigate(joinPath(effectiveBasePath, relativePath));\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<ComradeCircleContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <ComradeCircleContext.Provider value={contextValue}>{children}</ComradeCircleContext.Provider>\n );\n};\n\nexport const ComradeCircleProvider: FC<PropsWithChildren<ComradeCircleRootProps>> = (props) => {\n const { children, navigate } = props;\n const isStandalone = !navigate;\n\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAuB,EAAgD,KAAK;AAElF,SAAgB,IAA8C;CAC5D,IAAM,IAAU,EAAW,EAAqB;AAChD,KAAI,CAAC,EACH,OAAU,MAAM,+DAA+D;AAEjF,QAAO;;AAOT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AACxB,IAAe,EAAS,GAAmB,EAAa,CAAC;IAE3D,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAI5F,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AACxB,IAAS,EAAS,GAAmB,EAAa,CAAC;IAErD,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAIrF,KAAwE,MAAU;CAC7F,IAAM,EAAE,aAAU,gBAAa;AAa/B,QAZsB,IAapB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;EACuB,CAAA,GAXxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./ComradeCircleContext.js";
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { useComradeCircle as e } from "../context/ComradeCircleContext.js";
|
|
2
|
+
import "../context/index.js";
|
|
3
|
+
import { clearGraphqlResponseCache as t } from "../lib/graphql-cache.js";
|
|
4
|
+
import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
|
+
import { graphqlFetch as a } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
|
+
//#region src/comradecircle/hooks/useComradeCircleApi.ts
|
|
7
|
+
var o = (e) => /^\s*mutation\b/.test(e), s = async (e, n, r) => {
|
|
8
|
+
let i = o(e);
|
|
9
|
+
i && t();
|
|
10
|
+
let s = await a({
|
|
11
|
+
gateway: "workspace",
|
|
12
|
+
baseUrl: r,
|
|
13
|
+
query: e,
|
|
14
|
+
variables: n,
|
|
15
|
+
workspaceToken: !0
|
|
16
|
+
});
|
|
17
|
+
if (i && t(), s.errors?.length) throw Error(s.errors[0]?.message ?? "GraphQL request failed");
|
|
18
|
+
if (!s.data) throw Error("GraphQL response did not include data");
|
|
19
|
+
return s.data;
|
|
20
|
+
}, c = {
|
|
21
|
+
circles: ["comradecircle", "circles"],
|
|
22
|
+
circle: (e) => [
|
|
23
|
+
"comradecircle",
|
|
24
|
+
"circle",
|
|
25
|
+
e
|
|
26
|
+
],
|
|
27
|
+
channels: (e) => [
|
|
28
|
+
"comradecircle",
|
|
29
|
+
"channels",
|
|
30
|
+
e
|
|
31
|
+
],
|
|
32
|
+
posts: (e) => [
|
|
33
|
+
"comradecircle",
|
|
34
|
+
"posts",
|
|
35
|
+
e
|
|
36
|
+
],
|
|
37
|
+
post: (e) => [
|
|
38
|
+
"comradecircle",
|
|
39
|
+
"post",
|
|
40
|
+
e
|
|
41
|
+
],
|
|
42
|
+
comments: (e) => [
|
|
43
|
+
"comradecircle",
|
|
44
|
+
"comments",
|
|
45
|
+
e
|
|
46
|
+
],
|
|
47
|
+
feed: ["comradecircle", "feed"],
|
|
48
|
+
follows: ["comradecircle", "follows"],
|
|
49
|
+
events: ["comradecircle", "events"],
|
|
50
|
+
event: (e) => [
|
|
51
|
+
"comradecircle",
|
|
52
|
+
"event",
|
|
53
|
+
e
|
|
54
|
+
],
|
|
55
|
+
polls: (e) => [
|
|
56
|
+
"comradecircle",
|
|
57
|
+
"polls",
|
|
58
|
+
e
|
|
59
|
+
],
|
|
60
|
+
poll: (e) => [
|
|
61
|
+
"comradecircle",
|
|
62
|
+
"poll",
|
|
63
|
+
e
|
|
64
|
+
],
|
|
65
|
+
profiles: ["comradecircle", "profiles"],
|
|
66
|
+
profile: (e) => [
|
|
67
|
+
"comradecircle",
|
|
68
|
+
"profile",
|
|
69
|
+
e
|
|
70
|
+
],
|
|
71
|
+
memberships: ["comradecircle", "memberships"]
|
|
72
|
+
}, l = { limit: 50 }, u = (e) => {
|
|
73
|
+
let t = e ?? l, n = { limit: t.limit ?? l.limit };
|
|
74
|
+
return t.offset != null && (n.offset = t.offset), t.cursor != null && (n.cursor = t.cursor), n;
|
|
75
|
+
}, d = "\n id workspaceId circleId name slug description type visibility position isArchived\n createdAt updatedAt\n", f = "\n id workspaceId name slug description topic tags status visibility memberCount\n avatar { id } createdAt updatedAt\n", p = "id postId memberId type createdAt", m = "\n id workspaceId postId parentId authorId body isHidden createdAt updatedAt\n", h = `
|
|
76
|
+
id workspaceId channelId authorId body status tags attachmentFileIds isPinned
|
|
77
|
+
reactionCount commentCount reactions { ${p} } createdAt updatedAt
|
|
78
|
+
`, g = "id workspaceId pollId label position voteCount createdAt", _ = `
|
|
79
|
+
id workspaceId circleId question allowMultiple isAnonymous status closesAt
|
|
80
|
+
options { ${g} } createdAt updatedAt
|
|
81
|
+
`, v = "\n id workspaceId eventId memberId status note createdAt updatedAt\n", y = "\n id workspaceId circleId hostId title description mode status location joinUrl\n capacity startsAt endsAt tags rsvpCount createdAt updatedAt\n", b = "\n id workspaceId memberId displayName headline bio avatar { id } interests skills\n presence discoverable createdAt updatedAt\n", x = "\n id workspaceId circleId memberId role status joinedAt createdAt updatedAt\n", S = "\n id workspaceId followerId targetId targetType muted createdAt updatedAt\n", C = (t = {}) => {
|
|
82
|
+
let { apiGatewayUrl: n } = e();
|
|
83
|
+
return r({
|
|
84
|
+
queryKey: [...c.circles, t],
|
|
85
|
+
queryFn: async () => (await s(`query ComListCircles($status: ComCircleStatus, $visibility: ComCircleVisibility, $pagination: PaginationInput) {
|
|
86
|
+
comListCircles(status: $status, visibility: $visibility, pagination: $pagination) {
|
|
87
|
+
items { ${f} }
|
|
88
|
+
pageInfo { cursor hasMore }
|
|
89
|
+
}
|
|
90
|
+
}`, {
|
|
91
|
+
status: t.status,
|
|
92
|
+
visibility: t.visibility,
|
|
93
|
+
pagination: u(t.pagination)
|
|
94
|
+
}, n)).comListCircles
|
|
95
|
+
});
|
|
96
|
+
}, w = (t) => {
|
|
97
|
+
let { apiGatewayUrl: n } = e();
|
|
98
|
+
return r({
|
|
99
|
+
queryKey: c.circle(t ?? ""),
|
|
100
|
+
enabled: !!t,
|
|
101
|
+
queryFn: async () => (await s(`query ComCircle($id: ID!) {
|
|
102
|
+
comCircle(id: $id) {
|
|
103
|
+
${f}
|
|
104
|
+
channels { ${d} }
|
|
105
|
+
memberships { ${x} }
|
|
106
|
+
}
|
|
107
|
+
}`, { id: t }, n)).comCircle
|
|
108
|
+
});
|
|
109
|
+
}, T = () => {
|
|
110
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
111
|
+
return n({
|
|
112
|
+
mutationFn: async (e) => (await s(`mutation ComCreateCircle($input: ComCreateCircleInput!) {
|
|
113
|
+
comCreateCircle(input: $input) { ${f} }
|
|
114
|
+
}`, { input: e }, t)).comCreateCircle,
|
|
115
|
+
onSuccess: () => r.invalidateQueries({ queryKey: c.circles })
|
|
116
|
+
});
|
|
117
|
+
}, E = () => {
|
|
118
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
119
|
+
return n({
|
|
120
|
+
mutationFn: async (e) => (await s(`mutation ComJoinCircle($circleId: ID!) {
|
|
121
|
+
comJoinCircle(circleId: $circleId) { ${x} }
|
|
122
|
+
}`, { circleId: e }, t)).comJoinCircle,
|
|
123
|
+
onSuccess: (e) => {
|
|
124
|
+
r.invalidateQueries({ queryKey: c.circles }), r.invalidateQueries({ queryKey: c.circle(e.circleId) }), r.invalidateQueries({ queryKey: c.memberships });
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}, D = () => {
|
|
128
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
129
|
+
return n({
|
|
130
|
+
mutationFn: async (e) => (await s("mutation ComLeaveCircle($circleId: ID!) { comLeaveCircle(circleId: $circleId) }", { circleId: e }, t)).comLeaveCircle,
|
|
131
|
+
onSuccess: (e, t) => {
|
|
132
|
+
r.invalidateQueries({ queryKey: c.circles }), r.invalidateQueries({ queryKey: c.circle(t) }), r.invalidateQueries({ queryKey: c.memberships });
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}, O = () => {
|
|
136
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
137
|
+
return n({
|
|
138
|
+
mutationFn: async (e) => (await s(`mutation ComSetMemberRole($membershipId: ID!, $role: ComMemberRole!) {
|
|
139
|
+
comSetMemberRole(membershipId: $membershipId, role: $role) { ${x} }
|
|
140
|
+
}`, {
|
|
141
|
+
membershipId: e.membershipId,
|
|
142
|
+
role: e.role
|
|
143
|
+
}, t)).comSetMemberRole,
|
|
144
|
+
onSuccess: (e) => {
|
|
145
|
+
r.invalidateQueries({ queryKey: c.circle(e.circleId) }), r.invalidateQueries({ queryKey: c.memberships });
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}, k = (t = {}) => {
|
|
149
|
+
let { apiGatewayUrl: n } = e();
|
|
150
|
+
return r({
|
|
151
|
+
queryKey: [...c.memberships, t],
|
|
152
|
+
queryFn: async () => (await s(`query ComListMemberships($circleId: ID, $status: ComMembershipStatus, $pagination: PaginationInput) {
|
|
153
|
+
comListMemberships(circleId: $circleId, status: $status, pagination: $pagination) {
|
|
154
|
+
items { ${x} }
|
|
155
|
+
pageInfo { cursor hasMore }
|
|
156
|
+
}
|
|
157
|
+
}`, {
|
|
158
|
+
circleId: t.circleId,
|
|
159
|
+
status: t.status,
|
|
160
|
+
pagination: u(t.pagination)
|
|
161
|
+
}, n)).comListMemberships
|
|
162
|
+
});
|
|
163
|
+
}, A = () => {
|
|
164
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
165
|
+
return n({
|
|
166
|
+
mutationFn: async (e) => (await s(`mutation ComCreateChannel($input: ComCreateChannelInput!) {
|
|
167
|
+
comCreateChannel(input: $input) { ${d} }
|
|
168
|
+
}`, { input: e }, t)).comCreateChannel,
|
|
169
|
+
onSuccess: (e) => {
|
|
170
|
+
r.invalidateQueries({ queryKey: c.channels(e.circleId) }), r.invalidateQueries({ queryKey: c.circle(e.circleId) });
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}, j = (t = {}) => {
|
|
174
|
+
let { apiGatewayUrl: n } = e();
|
|
175
|
+
return r({
|
|
176
|
+
queryKey: [
|
|
177
|
+
...c.posts(t.channelId ?? "all"),
|
|
178
|
+
t.status,
|
|
179
|
+
t.pagination
|
|
180
|
+
],
|
|
181
|
+
enabled: !!t.channelId,
|
|
182
|
+
queryFn: async () => (await s(`query ComListPosts($channelId: ID, $status: ComPostStatus, $pagination: PaginationInput) {
|
|
183
|
+
comListPosts(channelId: $channelId, status: $status, pagination: $pagination) {
|
|
184
|
+
items { ${h} }
|
|
185
|
+
pageInfo { cursor hasMore }
|
|
186
|
+
}
|
|
187
|
+
}`, {
|
|
188
|
+
channelId: t.channelId,
|
|
189
|
+
status: t.status,
|
|
190
|
+
pagination: u(t.pagination)
|
|
191
|
+
}, n)).comListPosts
|
|
192
|
+
});
|
|
193
|
+
}, M = (t) => {
|
|
194
|
+
let { apiGatewayUrl: n } = e();
|
|
195
|
+
return r({
|
|
196
|
+
queryKey: [...c.feed, t],
|
|
197
|
+
queryFn: async () => (await s(`query ComMyFeed($pagination: PaginationInput) {
|
|
198
|
+
comMyFeed(pagination: $pagination) {
|
|
199
|
+
items { ${h} }
|
|
200
|
+
pageInfo { cursor hasMore }
|
|
201
|
+
}
|
|
202
|
+
}`, { pagination: u(t) }, n)).comMyFeed
|
|
203
|
+
});
|
|
204
|
+
}, N = () => {
|
|
205
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
206
|
+
return n({
|
|
207
|
+
mutationFn: async (e) => (await s(`mutation ComCreatePost($input: ComCreatePostInput!) {
|
|
208
|
+
comCreatePost(input: $input) { ${h} }
|
|
209
|
+
}`, { input: e }, t)).comCreatePost,
|
|
210
|
+
onSuccess: (e) => {
|
|
211
|
+
r.invalidateQueries({ queryKey: c.posts(e.channelId) }), r.invalidateQueries({ queryKey: c.feed });
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}, P = () => {
|
|
215
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
216
|
+
return n({
|
|
217
|
+
mutationFn: async (e) => (await s(`mutation ComUpdatePost($id: ID!, $input: ComUpdatePostInput!) {
|
|
218
|
+
comUpdatePost(id: $id, input: $input) { ${h} }
|
|
219
|
+
}`, e, t)).comUpdatePost,
|
|
220
|
+
onSuccess: (e) => {
|
|
221
|
+
r.invalidateQueries({ queryKey: c.posts(e.channelId) }), r.invalidateQueries({ queryKey: c.post(e.id) }), r.invalidateQueries({ queryKey: c.feed });
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}, F = () => {
|
|
225
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
226
|
+
return n({
|
|
227
|
+
mutationFn: async (e) => (await s("mutation ComRemovePost($id: ID!) { comRemovePost(id: $id) }", { id: e.id }, t)).comRemovePost,
|
|
228
|
+
onSuccess: (e, t) => {
|
|
229
|
+
t.channelId && r.invalidateQueries({ queryKey: c.posts(t.channelId) }), r.invalidateQueries({ queryKey: c.feed });
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}, I = () => {
|
|
233
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
234
|
+
return n({
|
|
235
|
+
mutationFn: async (e) => (await s(`mutation ComReactToPost($postId: ID!, $type: ComReactionType!) {
|
|
236
|
+
comReactToPost(postId: $postId, type: $type) { ${h} }
|
|
237
|
+
}`, e, t)).comReactToPost,
|
|
238
|
+
onSuccess: (e) => {
|
|
239
|
+
r.invalidateQueries({ queryKey: c.posts(e.channelId) }), r.invalidateQueries({ queryKey: c.post(e.id) }), r.invalidateQueries({ queryKey: c.feed });
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}, L = (t) => {
|
|
243
|
+
let { apiGatewayUrl: n } = e();
|
|
244
|
+
return r({
|
|
245
|
+
queryKey: c.comments(t ?? ""),
|
|
246
|
+
enabled: !!t,
|
|
247
|
+
queryFn: async () => (await s(`query ComListComments($postId: ID!) {
|
|
248
|
+
comListComments(postId: $postId) { ${m} }
|
|
249
|
+
}`, { postId: t }, n)).comListComments
|
|
250
|
+
});
|
|
251
|
+
}, R = () => {
|
|
252
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
253
|
+
return n({
|
|
254
|
+
mutationFn: async (e) => (await s(`mutation ComAddComment($input: ComCreateCommentInput!) {
|
|
255
|
+
comAddComment(input: $input) { ${m} }
|
|
256
|
+
}`, { input: e }, t)).comAddComment,
|
|
257
|
+
onSuccess: (e) => {
|
|
258
|
+
r.invalidateQueries({ queryKey: c.comments(e.postId) }), r.invalidateQueries({ queryKey: c.post(e.postId) }), r.invalidateQueries({ queryKey: c.feed });
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}, z = (t) => {
|
|
262
|
+
let { apiGatewayUrl: n } = e();
|
|
263
|
+
return r({
|
|
264
|
+
queryKey: [...c.follows, t ?? "all"],
|
|
265
|
+
queryFn: async () => (await s(`query ComMyFollows($targetType: ComFollowTargetType) {
|
|
266
|
+
comMyFollows(targetType: $targetType) { ${S} }
|
|
267
|
+
}`, { targetType: t }, n)).comMyFollows
|
|
268
|
+
});
|
|
269
|
+
}, B = () => {
|
|
270
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
271
|
+
return n({
|
|
272
|
+
mutationFn: async (e) => (await s(`mutation ComFollow($input: ComFollowInput!) {
|
|
273
|
+
comFollow(input: $input) { ${S} }
|
|
274
|
+
}`, { input: e }, t)).comFollow,
|
|
275
|
+
onSuccess: () => {
|
|
276
|
+
r.invalidateQueries({ queryKey: c.follows }), r.invalidateQueries({ queryKey: c.feed });
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}, V = () => {
|
|
280
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
281
|
+
return n({
|
|
282
|
+
mutationFn: async (e) => (await s("mutation ComUnfollow($input: ComFollowInput!) { comUnfollow(input: $input) }", { input: e }, t)).comUnfollow,
|
|
283
|
+
onSuccess: () => {
|
|
284
|
+
r.invalidateQueries({ queryKey: c.follows }), r.invalidateQueries({ queryKey: c.feed });
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}, H = (t = {}) => {
|
|
288
|
+
let { apiGatewayUrl: n } = e();
|
|
289
|
+
return r({
|
|
290
|
+
queryKey: [...c.events, t],
|
|
291
|
+
queryFn: async () => (await s(`query ComListEvents($circleId: ID, $status: ComEventStatus, $pagination: PaginationInput) {
|
|
292
|
+
comListEvents(circleId: $circleId, status: $status, pagination: $pagination) {
|
|
293
|
+
items { ${y} }
|
|
294
|
+
pageInfo { cursor hasMore }
|
|
295
|
+
}
|
|
296
|
+
}`, {
|
|
297
|
+
circleId: t.circleId,
|
|
298
|
+
status: t.status,
|
|
299
|
+
pagination: u(t.pagination)
|
|
300
|
+
}, n)).comListEvents
|
|
301
|
+
});
|
|
302
|
+
}, U = (t) => {
|
|
303
|
+
let { apiGatewayUrl: n } = e();
|
|
304
|
+
return r({
|
|
305
|
+
queryKey: c.event(t ?? ""),
|
|
306
|
+
enabled: !!t,
|
|
307
|
+
queryFn: async () => (await s(`query ComEvent($id: ID!) {
|
|
308
|
+
comEvent(id: $id) {
|
|
309
|
+
${y}
|
|
310
|
+
rsvps { ${v} }
|
|
311
|
+
}
|
|
312
|
+
}`, { id: t }, n)).comEvent
|
|
313
|
+
});
|
|
314
|
+
}, W = () => {
|
|
315
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
316
|
+
return n({
|
|
317
|
+
mutationFn: async (e) => (await s(`mutation ComCreateEvent($input: ComCreateEventInput!) {
|
|
318
|
+
comCreateEvent(input: $input) { ${y} }
|
|
319
|
+
}`, { input: e }, t)).comCreateEvent,
|
|
320
|
+
onSuccess: () => r.invalidateQueries({ queryKey: c.events })
|
|
321
|
+
});
|
|
322
|
+
}, G = () => {
|
|
323
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
324
|
+
return n({
|
|
325
|
+
mutationFn: async (e) => (await s(`mutation ComTransitionEvent($id: ID!, $status: ComEventStatus!) {
|
|
326
|
+
comTransitionEvent(id: $id, status: $status) { ${y} }
|
|
327
|
+
}`, e, t)).comTransitionEvent,
|
|
328
|
+
onSuccess: (e) => {
|
|
329
|
+
r.invalidateQueries({ queryKey: c.events }), r.invalidateQueries({ queryKey: c.event(e.id) });
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}, K = () => {
|
|
333
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
334
|
+
return n({
|
|
335
|
+
mutationFn: async (e) => (await s(`mutation ComRsvpEvent($eventId: ID!, $status: ComRsvpStatus!, $note: String) {
|
|
336
|
+
comRsvpEvent(eventId: $eventId, status: $status, note: $note) { ${v} }
|
|
337
|
+
}`, e, t)).comRsvpEvent,
|
|
338
|
+
onSuccess: (e) => {
|
|
339
|
+
r.invalidateQueries({ queryKey: c.events }), r.invalidateQueries({ queryKey: c.event(e.eventId) });
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}, q = (t, n) => {
|
|
343
|
+
let { apiGatewayUrl: i } = e();
|
|
344
|
+
return r({
|
|
345
|
+
queryKey: [...c.polls(t ?? ""), n ?? "all"],
|
|
346
|
+
enabled: !!t,
|
|
347
|
+
queryFn: async () => (await s(`query ComListPolls($circleId: ID!, $status: ComPollStatus) {
|
|
348
|
+
comListPolls(circleId: $circleId, status: $status) { ${_} }
|
|
349
|
+
}`, {
|
|
350
|
+
circleId: t,
|
|
351
|
+
status: n
|
|
352
|
+
}, i)).comListPolls
|
|
353
|
+
});
|
|
354
|
+
}, J = () => {
|
|
355
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
356
|
+
return n({
|
|
357
|
+
mutationFn: async (e) => (await s(`mutation ComCreatePoll($input: ComCreatePollInput!) {
|
|
358
|
+
comCreatePoll(input: $input) { ${_} }
|
|
359
|
+
}`, { input: e }, t)).comCreatePoll,
|
|
360
|
+
onSuccess: (e) => r.invalidateQueries({ queryKey: c.polls(e.circleId) })
|
|
361
|
+
});
|
|
362
|
+
}, Y = () => {
|
|
363
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
364
|
+
return n({
|
|
365
|
+
mutationFn: async (e) => (await s(`mutation ComClosePoll($id: ID!) { comClosePoll(id: $id) { ${_} } }`, { id: e }, t)).comClosePoll,
|
|
366
|
+
onSuccess: (e) => r.invalidateQueries({ queryKey: c.polls(e.circleId) })
|
|
367
|
+
});
|
|
368
|
+
}, X = () => {
|
|
369
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
370
|
+
return n({
|
|
371
|
+
mutationFn: async (e) => (await s(`mutation ComVotePoll($pollId: ID!, $optionId: ID!) {
|
|
372
|
+
comVotePoll(pollId: $pollId, optionId: $optionId) { ${g} }
|
|
373
|
+
}`, {
|
|
374
|
+
pollId: e.pollId,
|
|
375
|
+
optionId: e.optionId
|
|
376
|
+
}, t)).comVotePoll,
|
|
377
|
+
onSuccess: (e, t) => {
|
|
378
|
+
t.circleId && r.invalidateQueries({ queryKey: c.polls(t.circleId) }), r.invalidateQueries({ queryKey: c.poll(t.pollId) });
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}, Z = (t = {}) => {
|
|
382
|
+
let { apiGatewayUrl: n } = e();
|
|
383
|
+
return r({
|
|
384
|
+
queryKey: [...c.profiles, t],
|
|
385
|
+
queryFn: async () => (await s(`query ComListProfiles($discoverable: Boolean, $pagination: PaginationInput) {
|
|
386
|
+
comListProfiles(discoverable: $discoverable, pagination: $pagination) {
|
|
387
|
+
items { ${b} }
|
|
388
|
+
pageInfo { cursor hasMore }
|
|
389
|
+
}
|
|
390
|
+
}`, {
|
|
391
|
+
discoverable: t.discoverable,
|
|
392
|
+
pagination: u(t.pagination)
|
|
393
|
+
}, n)).comListProfiles
|
|
394
|
+
});
|
|
395
|
+
}, Q = (t) => {
|
|
396
|
+
let { apiGatewayUrl: n } = e();
|
|
397
|
+
return r({
|
|
398
|
+
queryKey: c.profile(t ?? ""),
|
|
399
|
+
enabled: !!t,
|
|
400
|
+
staleTime: 600 * 1e3,
|
|
401
|
+
queryFn: async () => (await s(`query ComProfile($memberId: ID!) {
|
|
402
|
+
comProfile(memberId: $memberId) { ${b} }
|
|
403
|
+
}`, { memberId: t }, n)).comProfile
|
|
404
|
+
});
|
|
405
|
+
}, $ = () => {
|
|
406
|
+
let { apiGatewayUrl: t } = e(), r = i();
|
|
407
|
+
return n({
|
|
408
|
+
mutationFn: async (e) => (await s(`mutation ComUpsertProfile($input: ComUpsertProfileInput!) {
|
|
409
|
+
comUpsertProfile(input: $input) { ${b} }
|
|
410
|
+
}`, { input: e }, t)).comUpsertProfile,
|
|
411
|
+
onSuccess: (e) => {
|
|
412
|
+
r.invalidateQueries({ queryKey: c.profiles }), r.invalidateQueries({ queryKey: c.profile(e.memberId) });
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
//#endregion
|
|
417
|
+
export { R as useComAddComment, w as useComCircle, C as useComCircles, Y as useComClosePoll, L as useComComments, A as useComCreateChannel, T as useComCreateCircle, W as useComCreateEvent, J as useComCreatePoll, N as useComCreatePost, U as useComEvent, H as useComEvents, B as useComFollow, E as useComJoinCircle, D as useComLeaveCircle, k as useComMemberships, M as useComMyFeed, z as useComMyFollows, q as useComPolls, j as useComPosts, Q as useComProfile, Z as useComProfiles, I as useComReactToPost, F as useComRemovePost, K as useComRsvpEvent, O as useComSetMemberRole, G as useComTransitionEvent, V as useComUnfollow, P as useComUpdatePost, $ as useComUpsertProfile, X as useComVotePoll };
|
|
418
|
+
|
|
419
|
+
//# sourceMappingURL=useComradeCircleApi.js.map
|