@burdenoff/microfe-workspaces 2026.1120.1 → 2026.1123.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.
Files changed (56) hide show
  1. package/dist/WorkspacesRoot.js +39 -31
  2. package/dist/WorkspacesRoutes.js +91 -59
  3. package/dist/components/ProjectCard.js +48 -47
  4. package/dist/constants/navigationV2.d.ts +5 -0
  5. package/dist/constants/navigationV2.js +2 -2
  6. package/dist/generated/global-operations.d.ts +11 -1
  7. package/dist/generated/global-types.d.ts +9866 -574
  8. package/dist/generated/wspace-operations.d.ts +631 -2
  9. package/dist/generated/wspace-operations.js +5428 -1376
  10. package/dist/generated/wspace-types.d.ts +200319 -48046
  11. package/dist/generated/wspace-types.js +19 -0
  12. package/dist/hooks/useCollaboration.d.ts +143 -0
  13. package/dist/hooks/useCollaboration.js +119 -0
  14. package/dist/hooks/useCollaborationMutations.d.ts +177 -0
  15. package/dist/hooks/useCollaborationMutations.js +126 -0
  16. package/dist/hooks/v2/useWorkspacePagesV2Data.d.ts +89 -0
  17. package/dist/hooks/v2/useWorkspacePagesV2Data.js +211 -0
  18. package/dist/index.d.ts +1 -1
  19. package/dist/node_modules/sonner/dist/index.js +167 -0
  20. package/dist/pages/CollaborationConsolePage.d.ts +1 -0
  21. package/dist/pages/CollaborationConsolePage.js +1059 -0
  22. package/dist/pages/MembersListPage.js +101 -100
  23. package/dist/pages/ProjectMembersPage.js +116 -115
  24. package/dist/pages/ProjectsListPage.js +233 -232
  25. package/dist/pages/WorkspacesListPage.js +79 -68
  26. package/dist/pages/v2/ActivityPage.d.ts +1 -0
  27. package/dist/pages/v2/ActivityPage.js +150 -0
  28. package/dist/pages/v2/InvitePeopleDialog.d.ts +11 -0
  29. package/dist/pages/v2/InvitePeopleDialog.js +208 -0
  30. package/dist/pages/v2/InvitedTab.d.ts +9 -0
  31. package/dist/pages/v2/InvitedTab.js +223 -0
  32. package/dist/pages/v2/MembersPage.d.ts +1 -0
  33. package/dist/pages/v2/MembersPage.js +120 -0
  34. package/dist/pages/v2/PeopleTab.d.ts +20 -0
  35. package/dist/pages/v2/PeopleTab.js +253 -0
  36. package/dist/pages/v2/ProjectsPage.d.ts +1 -0
  37. package/dist/pages/v2/ProjectsPage.js +242 -0
  38. package/dist/pages/v2/WorkspacesPage.d.ts +3 -0
  39. package/dist/pages/v2/WorkspacesPage.js +247 -0
  40. package/dist/pages/v2/activitySentences.d.ts +50 -0
  41. package/dist/pages/v2/activitySentences.js +288 -0
  42. package/dist/pages/v2/inviteEmails.d.ts +12 -0
  43. package/dist/pages/v2/inviteEmails.js +18 -0
  44. package/dist/pages/v2/memberRows.d.ts +54 -0
  45. package/dist/pages/v2/memberRows.js +51 -0
  46. package/dist/pages/v2/projectRows.d.ts +10 -0
  47. package/dist/pages/v2/projectRows.js +10 -0
  48. package/dist/pages/v2/relativeTime.d.ts +6 -0
  49. package/dist/pages/v2/relativeTime.js +30 -0
  50. package/dist/store/workspacesStore.d.ts +2 -1
  51. package/dist/store/workspacesStore.js +1 -1
  52. package/dist/translations/en.d.ts +436 -0
  53. package/dist/translations/en.js +436 -0
  54. package/dist/types/index.d.ts +19 -0
  55. package/dist/utils/nativeBridge.js +1 -1
  56. package/package.json +3 -3
@@ -2,14 +2,14 @@ import { useWorkspacesStore as e } from "../store/workspacesStore.js";
2
2
  import { useMyWorkspaces as t } from "../hooks/useWorkspaces.js";
3
3
  import { useMyPendingInvitations as n } from "../hooks/usePendingInvitations.js";
4
4
  import { WorkspaceCard as r } from "../components/WorkspaceCard.js";
5
- import { useWorkspacesContext as i } from "../providers/WorkspacesProvider.js";
6
- import { WORKSPACE_PERMISSIONS as a } from "../constants/permissions.js";
7
- import { tWithFallback as o } from "../utils/i18n.js";
8
- import { useScopedNavigation as s } from "../hooks/useScopedNavigation.js";
9
- import { useWorkspacesPageView as c } from "../hooks/useWorkspacesPageView.js";
10
- import { useEffect as l, useState as u } from "react";
11
- import { Grid3X3 as d, List as f, Mail as p, MoreHorizontal as m, Plus as h, Search as g, UserPlus as _ } from "lucide-react";
12
- import { AuroraBackground as v, Badge as y, Button as b, DropdownMenu as x, DropdownMenuContent as S, DropdownMenuItem as C, DropdownMenuTrigger as w, GradientText as T, IllustratedEmptyState as E, Input as ee, PagePurpose as te, Skeleton as D } from "@burdenoff/fe-libs/ui";
5
+ import { useWorkspacesContext as ee } from "../providers/WorkspacesProvider.js";
6
+ import { WORKSPACE_PERMISSIONS as i } from "../constants/permissions.js";
7
+ import { tWithFallback as a } from "../utils/i18n.js";
8
+ import { useScopedNavigation as o } from "../hooks/useScopedNavigation.js";
9
+ import { useWorkspacesPageView as s } from "../hooks/useWorkspacesPageView.js";
10
+ import { useEffect as c, useState as l } from "react";
11
+ import { Globe as u, Grid3X3 as d, List as f, Mail as p, MoreHorizontal as m, Plus as h, Search as g, UserPlus as _ } from "lucide-react";
12
+ import { AuroraBackground as v, Badge as te, Button as y, DropdownMenu as ne, DropdownMenuContent as b, DropdownMenuItem as x, DropdownMenuTrigger as S, GradientText as C, IllustratedEmptyState as w, Input as T, PagePurpose as E, Skeleton as D } from "@burdenoff/fe-libs/ui";
13
13
  import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
14
14
  import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
15
  import { useNavigate as M } from "react-router";
@@ -17,20 +17,20 @@ import { useDebounce as N } from "@burdenoff/fe-libs/shared/hooks";
17
17
  import { PermissionButton as P } from "@burdenoff/fe-libs/shared/components";
18
18
  // src/pages/WorkspacesListPage.tsx
19
19
  function F() {
20
- c("workspaces.list");
21
- let { t: F } = j(), I = M(), { basePath: L = "/", currentUser: R, workspaceId: z } = i(), { withCurrentSearch: B } = s(), { viewMode: V, setViewMode: H, workspaceFilters: U, setWorkspaceFilters: W } = e(), G = () => {
20
+ s("workspaces.list");
21
+ let { t: F } = j(), I = M(), { basePath: L = "/", currentUser: R, workspaceId: z } = ee(), { withCurrentSearch: B } = o(), { viewMode: V, setViewMode: H, workspaceFilters: U, setWorkspaceFilters: W } = e(), G = () => {
22
22
  I(B(`${L}/new`));
23
- }, [K, q] = u(U.search || ""), J = N(K, 500);
24
- l(() => {
23
+ }, [K, q] = l(U.search || ""), J = N(K, 500);
24
+ c(() => {
25
25
  J !== U.search && W({ search: J });
26
26
  }, [
27
27
  J,
28
28
  U.search,
29
29
  W
30
30
  ]);
31
- let { data: Y, isLoading: X, error: Z } = t(), { data: ne = [] } = n(R?.email), Q = ne.length, re = () => {
31
+ let { data: Y, isLoading: X, error: Z } = t(), { data: re = [] } = n(R?.email), Q = re.length, ie = () => {
32
32
  I(B(`${L}/invites`));
33
- }, ie = () => {
33
+ }, ae = () => {
34
34
  z && I(B(`${L}/${z}/invite`));
35
35
  }, $ = Y ? {
36
36
  ...Y,
@@ -43,10 +43,10 @@ function F() {
43
43
  className: "flex flex-col items-center justify-center py-12",
44
44
  children: [/* @__PURE__ */ k("p", {
45
45
  className: "text-status-error-text text-lg font-semibold",
46
- children: o(F, "workspacesList.loadError", "Error loading workspaces")
46
+ children: a(F, "workspacesList.loadError", "Error loading workspaces")
47
47
  }), /* @__PURE__ */ k("p", {
48
48
  className: "text-text-secondary text-sm mt-2",
49
- children: Z instanceof Error ? Z.message : o(F, "workspacesList.unknownError", "Unknown error")
49
+ children: Z instanceof Error ? Z.message : a(F, "workspacesList.unknownError", "Unknown error")
50
50
  })]
51
51
  })
52
52
  }) : /* @__PURE__ */ A("div", {
@@ -59,75 +59,86 @@ function F() {
59
59
  /* @__PURE__ */ k(v, { intensity: "subtle" }),
60
60
  /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h1", {
61
61
  className: "text-2xl sm:text-3xl font-bold",
62
- children: /* @__PURE__ */ k(T, { children: o(F, "workspacesList.title", "Workspaces") })
62
+ children: /* @__PURE__ */ k(C, { children: a(F, "workspacesList.title", "Workspaces") })
63
63
  }), /* @__PURE__ */ k("p", {
64
64
  className: "text-sm sm:text-base text-text-secondary",
65
- children: o(F, "workspacesList.description", "Manage and organize your workspaces")
65
+ children: a(F, "workspacesList.description", "Manage and organize your workspaces")
66
66
  })] }),
67
67
  /* @__PURE__ */ A("div", {
68
68
  className: "flex items-center gap-2",
69
69
  "data-tour": "workspaces-list-actions",
70
70
  children: [
71
- /* @__PURE__ */ k(b, {
71
+ /* @__PURE__ */ k(y, {
72
72
  variant: V === "grid" ? "default" : "outline",
73
73
  size: "icon",
74
74
  onClick: () => H("grid"),
75
75
  className: "hidden sm:flex",
76
- "aria-label": o(F, "workspacesList.gridViewAriaLabel", "Show workspaces in grid view"),
77
- title: o(F, "workspacesList.gridViewTitle", "Grid view"),
76
+ "aria-label": a(F, "workspacesList.gridViewAriaLabel", "Show workspaces in grid view"),
77
+ title: a(F, "workspacesList.gridViewTitle", "Grid view"),
78
78
  children: /* @__PURE__ */ k(d, { size: 20 })
79
79
  }),
80
- /* @__PURE__ */ k(b, {
80
+ /* @__PURE__ */ k(y, {
81
81
  variant: V === "list" ? "default" : "outline",
82
82
  size: "icon",
83
83
  onClick: () => H("list"),
84
84
  className: "hidden sm:flex",
85
- "aria-label": o(F, "workspacesList.listViewAriaLabel", "Show workspaces in list view"),
86
- title: o(F, "workspacesList.listViewTitle", "List view"),
85
+ "aria-label": a(F, "workspacesList.listViewAriaLabel", "Show workspaces in list view"),
86
+ title: a(F, "workspacesList.listViewTitle", "List view"),
87
87
  children: /* @__PURE__ */ k(f, { size: 20 })
88
88
  }),
89
- /* @__PURE__ */ A(x, { children: [/* @__PURE__ */ k(w, {
89
+ /* @__PURE__ */ A(ne, { children: [/* @__PURE__ */ k(S, {
90
90
  asChild: !0,
91
- children: /* @__PURE__ */ A(b, {
91
+ children: /* @__PURE__ */ A(y, {
92
92
  variant: "outline",
93
93
  size: "icon",
94
94
  "aria-label": "More actions",
95
95
  className: "relative",
96
96
  children: [/* @__PURE__ */ k(m, { size: 18 }), Q > 0 ? /* @__PURE__ */ k("span", { className: "absolute -top-1 -right-1 flex size-2 rounded-full bg-action-primary-bg" }) : null]
97
97
  })
98
- }), /* @__PURE__ */ A(S, {
98
+ }), /* @__PURE__ */ A(b, {
99
99
  align: "end",
100
- children: [/* @__PURE__ */ k(P, {
101
- permission: a.MEMBER_CREATE,
102
- deniedBehavior: "disable",
103
- deniedTooltip: o(F, "workspacesList.inviteDeniedTooltip", "You don't have permission to invite members into the current workspace"),
104
- children: /* @__PURE__ */ A(C, {
100
+ children: [
101
+ /* @__PURE__ */ k(P, {
102
+ permission: i.MEMBER_CREATE,
103
+ deniedBehavior: "disable",
104
+ deniedTooltip: a(F, "workspacesList.inviteDeniedTooltip", "You don't have permission to invite members into the current workspace"),
105
+ children: /* @__PURE__ */ A(x, {
106
+ onSelect: ae,
107
+ disabled: !z,
108
+ className: "gap-2",
109
+ children: [/* @__PURE__ */ k(_, { size: 16 }), a(F, "workspacesList.inviteMemberButton", "Invite Member")]
110
+ })
111
+ }),
112
+ /* @__PURE__ */ A(x, {
105
113
  onSelect: ie,
106
- disabled: !z,
107
114
  className: "gap-2",
108
- children: [/* @__PURE__ */ k(_, { size: 16 }), o(F, "workspacesList.inviteMemberButton", "Invite Member")]
109
- })
110
- }), /* @__PURE__ */ A(C, {
111
- onSelect: re,
112
- className: "gap-2",
113
- children: [
114
- /* @__PURE__ */ k(p, { size: 16 }),
115
- /* @__PURE__ */ k("span", {
115
+ children: [
116
+ /* @__PURE__ */ k(p, { size: 16 }),
117
+ /* @__PURE__ */ k("span", {
118
+ className: "flex-1",
119
+ children: a(F, "workspacesList.pendingInvitesButton", "Pending Invites")
120
+ }),
121
+ Q > 0 ? /* @__PURE__ */ k(te, {
122
+ variant: "secondary",
123
+ children: Q
124
+ }) : null
125
+ ]
126
+ }),
127
+ /* @__PURE__ */ A(x, {
128
+ onSelect: () => I(B(`${L}/collaboration`)),
129
+ className: "gap-2",
130
+ children: [/* @__PURE__ */ k(u, { size: 16 }), /* @__PURE__ */ k("span", {
116
131
  className: "flex-1",
117
- children: o(F, "workspacesList.pendingInvitesButton", "Pending Invites")
118
- }),
119
- Q > 0 ? /* @__PURE__ */ k(y, {
120
- variant: "secondary",
121
- children: Q
122
- }) : null
123
- ]
124
- })]
132
+ children: a(F, "workspacesList.collaborationConsoleButton", "Multi-Org & Sharing")
133
+ })]
134
+ })
135
+ ]
125
136
  })] }),
126
137
  /* @__PURE__ */ k(P, {
127
- permission: a.WORKSPACE_CREATE,
138
+ permission: i.WORKSPACE_CREATE,
128
139
  deniedBehavior: "disable",
129
- deniedTooltip: o(F, "workspacesList.createDeniedTooltip", "You don't have permission to create workspaces"),
130
- children: /* @__PURE__ */ A(b, {
140
+ deniedTooltip: a(F, "workspacesList.createDeniedTooltip", "You don't have permission to create workspaces"),
141
+ children: /* @__PURE__ */ A(y, {
131
142
  onClick: G,
132
143
  className: "gap-2",
133
144
  "data-tour": "workspaces-create-button",
@@ -135,11 +146,11 @@ function F() {
135
146
  /* @__PURE__ */ k(h, { size: 20 }),
136
147
  /* @__PURE__ */ k("span", {
137
148
  className: "hidden sm:inline",
138
- children: o(F, "workspacesList.createButton", "Create Workspace")
149
+ children: a(F, "workspacesList.createButton", "Create Workspace")
139
150
  }),
140
151
  /* @__PURE__ */ k("span", {
141
152
  className: "sm:hidden",
142
- children: o(F, "workspacesList.createButtonShort", "Create")
153
+ children: a(F, "workspacesList.createButtonShort", "Create")
143
154
  })
144
155
  ]
145
156
  })
@@ -148,15 +159,15 @@ function F() {
148
159
  })
149
160
  ]
150
161
  }),
151
- /* @__PURE__ */ k(te, { children: o(F, "workspacesList.purpose", "Workspaces are shared homes for a team or initiative — each one groups its own projects, members, agents and activity. Create one per team, client or product line to keep work isolated, then switch between them from the sidebar.") }),
162
+ /* @__PURE__ */ k(E, { children: a(F, "workspacesList.purpose", "Workspaces are shared homes for a team or initiative — each one groups its own projects, members, agents and activity. Create one per team, client or product line to keep work isolated, then switch between them from the sidebar.") }),
152
163
  /* @__PURE__ */ A("div", {
153
164
  className: "relative",
154
165
  "data-tour": "workspaces-search-input",
155
166
  children: [/* @__PURE__ */ k(g, {
156
167
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary",
157
168
  size: 20
158
- }), /* @__PURE__ */ k(ee, {
159
- placeholder: o(F, "workspacesList.searchPlaceholder", "Search workspaces..."),
169
+ }), /* @__PURE__ */ k(T, {
170
+ placeholder: a(F, "workspacesList.searchPlaceholder", "Search workspaces..."),
160
171
  value: K,
161
172
  onChange: (e) => {
162
173
  q(e.target.value);
@@ -179,18 +190,18 @@ function F() {
179
190
  })]
180
191
  }), /* @__PURE__ */ k(D, { className: "h-3 w-1/3" })]
181
192
  }, t))
182
- }) : $?.items.length === 0 ? /* @__PURE__ */ k(E, {
193
+ }) : $?.items.length === 0 ? /* @__PURE__ */ k(w, {
183
194
  illustration: U.search ? "empty-search" : "onboarding",
184
- title: o(F, "workspacesList.emptyTitle", "No workspaces found"),
185
- description: U.search ? o(F, "workspacesList.emptySearchHint", "Try adjusting your search criteria") : o(F, "workspacesList.emptyCreateHint", "Get started by creating your first workspace"),
195
+ title: a(F, "workspacesList.emptyTitle", "No workspaces found"),
196
+ description: U.search ? a(F, "workspacesList.emptySearchHint", "Try adjusting your search criteria") : a(F, "workspacesList.emptyCreateHint", "Get started by creating your first workspace"),
186
197
  action: U.search ? void 0 : /* @__PURE__ */ k(P, {
187
- permission: a.WORKSPACE_CREATE,
198
+ permission: i.WORKSPACE_CREATE,
188
199
  deniedBehavior: "disable",
189
- deniedTooltip: o(F, "workspacesList.createDeniedTooltip", "You don't have permission to create workspaces"),
190
- children: /* @__PURE__ */ A(b, {
200
+ deniedTooltip: a(F, "workspacesList.createDeniedTooltip", "You don't have permission to create workspaces"),
201
+ children: /* @__PURE__ */ A(y, {
191
202
  onClick: G,
192
203
  className: "gap-2",
193
- children: [/* @__PURE__ */ k(h, { size: 20 }), o(F, "workspacesList.createFirstButton", "Create Your First Workspace")]
204
+ children: [/* @__PURE__ */ k(h, { size: 20 }), a(F, "workspacesList.createFirstButton", "Create Your First Workspace")]
194
205
  })
195
206
  }),
196
207
  kind: U.search ? "no-results" : "first-use"
@@ -203,18 +214,18 @@ function F() {
203
214
  }), $ && $.total > 0 && /* @__PURE__ */ A("div", {
204
215
  className: "flex items-center justify-between text-sm text-text-secondary",
205
216
  children: [/* @__PURE__ */ A("p", { children: [
206
- o(F, "workspacesList.showing", "Showing"),
217
+ a(F, "workspacesList.showing", "Showing"),
207
218
  " ",
208
219
  $.items.length,
209
220
  " ",
210
- o(F, "workspacesList.of", "of"),
221
+ a(F, "workspacesList.of", "of"),
211
222
  " ",
212
223
  $.total,
213
224
  " ",
214
- $.total === 1 ? o(F, "workspacesList.workspace", "workspace") : o(F, "workspacesList.workspaces", "workspaces")
225
+ $.total === 1 ? a(F, "workspacesList.workspace", "workspace") : a(F, "workspacesList.workspaces", "workspaces")
215
226
  ] }), $.hasMore && /* @__PURE__ */ k("p", {
216
227
  className: "text-xs",
217
- children: o(F, "workspacesList.moreAvailable", "More workspaces available - pagination coming soon")
228
+ children: a(F, "workspacesList.moreAvailable", "More workspaces available - pagination coming soon")
218
229
  })]
219
230
  })] })
220
231
  })
@@ -0,0 +1 @@
1
+ export declare function ActivityPageV2(): import('react').JSX.Element;
@@ -0,0 +1,150 @@
1
+ import { useWorkspacesContext as e } from "../../providers/WorkspacesProvider.js";
2
+ import { useWorkspacePermissions as t } from "../../hooks/useWorkspacePermissions.js";
3
+ import { useWorkspacesPageView as n } from "../../hooks/useWorkspacesPageView.js";
4
+ import { useScopedNavigation as r } from "../../hooks/useScopedNavigation.js";
5
+ import { useTr as i } from "../../hooks/useTr.js";
6
+ import { useWorkspaceActivityLog as a } from "../../hooks/v2/useWorkspacePagesV2Data.js";
7
+ import { toActivitySentences as o } from "./activitySentences.js";
8
+ import { useMemo as s } from "react";
9
+ import { ActivityLog as c, EmptyState as l, EntityAvatar as u, ListPager as d, ListToolbar as f, ListView as p, LockedState as m, WorkspacePage as h, countFilterOptions as g, filterList as _, pageSlice as v, useListState as y } from "@burdenoff/fe-libs/ui";
10
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
11
+ import { useParams as S, useSearchParams as C } from "react-router";
12
+ import { PageHeader as w } from "@burdenoff/fe-libs/chrome";
13
+ import { useActorProfiles as T } from "@burdenoff/fe-libs/shared";
14
+ // src/pages/v2/ActivityPage.tsx
15
+ function E() {
16
+ let E = i(), { basePath: D = "/workspaces", workspaceId: O, authToken: k, organizationId: A } = e(), { withCurrentSearch: j } = r(), { workspaceId: M } = S(), N = M || O;
17
+ n("workspaces.activity", {
18
+ workspaceId: N,
19
+ requireParams: !0
20
+ });
21
+ let { canViewActivity: P, isLoading: F } = t(), I = a(P ? N : void 0), L = y({
22
+ filters: [
23
+ "who",
24
+ "area",
25
+ "show"
26
+ ],
27
+ url: C()
28
+ }), R = s(() => o(I.data ?? [], E), [I.data, E]), z = s(() => [...new Set(R.filter((e) => e.actorKind === "person").map((e) => e.actorKey))].map((e) => ({
29
+ actorId: e,
30
+ actorType: "user"
31
+ })), [R]), B = T(z, {
32
+ authToken: k || void 0,
33
+ orgId: A,
34
+ workspaceId: N
35
+ }), V = s(() => R.map((e) => ({
36
+ ...e,
37
+ actorName: e.actorKind === "service" ? E("workspacePagesV2.activity.system", "System") : B[e.actorKey]?.displayName ?? E("workspacePagesV2.activity.someone", "Someone")
38
+ })), [
39
+ B,
40
+ R,
41
+ E
42
+ ]), H = s(() => {
43
+ let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
44
+ for (let n of V) e.set(n.actorKey, n.actorName), t.set(n.areaKey, n.area);
45
+ let n = (e, t) => e.label.localeCompare(t.label), r = {
46
+ problems: E("workspacePagesV2.activity.showProblems", "Problems"),
47
+ access: E("workspacePagesV2.activity.showAccess", "Access changes"),
48
+ people: E("workspacePagesV2.activity.showPeople", "What people did")
49
+ };
50
+ return [
51
+ {
52
+ id: "who",
53
+ label: E("workspacePagesV2.activity.whoFilter", "Who"),
54
+ allLabel: E("workspacePagesV2.activity.anyone", "Anyone"),
55
+ options: [...e].map(([e, t]) => ({
56
+ value: e,
57
+ label: t
58
+ })).sort((e, t) => e.value === "system" ? 1 : t.value === "system" ? -1 : n(e, t)),
59
+ getValue: (e) => e.actorKey
60
+ },
61
+ {
62
+ id: "area",
63
+ label: E("workspacePagesV2.activity.areaFilter", "Area"),
64
+ allLabel: E("workspacePagesV2.activity.everywhere", "Everywhere"),
65
+ options: [...t].map(([e, t]) => ({
66
+ value: e,
67
+ label: t
68
+ })).sort(n),
69
+ getValue: (e) => e.areaKey
70
+ },
71
+ {
72
+ id: "show",
73
+ label: E("workspacePagesV2.activity.showFilter", "Show"),
74
+ allLabel: E("workspacePagesV2.activity.everything", "Everything"),
75
+ options: [
76
+ "problems",
77
+ "access",
78
+ "people"
79
+ ].map((e) => ({
80
+ value: e,
81
+ label: r[e]
82
+ })),
83
+ getValue: (e) => e.show
84
+ }
85
+ ];
86
+ }, [V, E]), U = s(() => ({
87
+ text: (e) => `${e.actorName} ${e.verb} ${e.object} ${e.area}`,
88
+ filters: H
89
+ }), [H]), W = _(V, L, U), G = v(W, L.page, L.pageSize).map((e) => ({
90
+ id: e.id,
91
+ at: e.at,
92
+ tone: e.tone,
93
+ actor: e.actorName,
94
+ verb: e.verb,
95
+ object: e.object || void 0,
96
+ area: e.area,
97
+ avatar: /* @__PURE__ */ b(u, {
98
+ name: e.actorName,
99
+ kind: e.actorKind === "service" ? "service" : "person",
100
+ src: e.actorKind === "person" ? B[e.actorKey]?.avatarUrl : void 0,
101
+ size: 24
102
+ })
103
+ })), K = (I.data?.length ?? 0) >= 200, q = /* @__PURE__ */ b(w, {
104
+ variant: "compact",
105
+ title: E("workspacePagesV2.activity.title", "Activity"),
106
+ description: E("workspacePagesV2.activity.purpose", "Who did what in this workspace, newest first."),
107
+ back: {
108
+ label: E("workspacePagesV2.workspaces.title", "Workspaces & invites"),
109
+ to: j(`${D}/list`),
110
+ phoneOnly: !0
111
+ }
112
+ });
113
+ return !F && !P ? /* @__PURE__ */ x(h, { children: [q, /* @__PURE__ */ b(m, {
114
+ title: E("workspacePagesV2.activity.lockedTitle", "Activity is for people with access"),
115
+ description: E("workspacePagesV2.activity.lockedDescription", "It shows who did what in this workspace. Ask an owner of this workspace for access.")
116
+ })] }) : /* @__PURE__ */ x(h, { children: [q, /* @__PURE__ */ b(p, {
117
+ list: L,
118
+ count: W.length,
119
+ loading: (F || I.isPending) && !!N,
120
+ error: I.error,
121
+ onRetry: () => void I.refetch(),
122
+ errorTitle: E("workspacePagesV2.activity.loadFailed", "Couldn’t load the activity"),
123
+ errorDetails: I.error instanceof Error ? I.error.message : void 0,
124
+ summary: K && !L.narrowed ? E("workspacePagesV2.activity.latest", "The latest {{count}} events", { count: W.length }) : W.length === 1 ? E("workspacePagesV2.activity.countOne", "1 event") : E("workspacePagesV2.activity.count", "{{count}} events", { count: W.length }),
125
+ summaryEnd: K && L.narrowed ? E("workspacePagesV2.activity.window", "in the latest {{count}}", { count: 200 }) : void 0,
126
+ toolbar: /* @__PURE__ */ b(f, {
127
+ list: L,
128
+ searchPlaceholder: E("workspacePagesV2.activity.search", "Search activity"),
129
+ filters: H.map((e) => ({
130
+ ...e,
131
+ options: g(V, e, L, U)
132
+ }))
133
+ }),
134
+ pager: /* @__PURE__ */ b(d, {
135
+ list: L,
136
+ total: W.length
137
+ }),
138
+ empty: /* @__PURE__ */ b(l, {
139
+ illustration: "history",
140
+ title: E("workspacePagesV2.activity.emptyTitle", "No activity yet"),
141
+ description: E("workspacePagesV2.activity.emptyDescription", "When people invite, share, run or change things, it’s listed here with who and when.")
142
+ }),
143
+ children: /* @__PURE__ */ b(c, {
144
+ entries: G,
145
+ label: E("workspacePagesV2.activity.logLabel", "Activity"),
146
+ headingLevel: 2
147
+ })
148
+ })] });
149
+ }
150
+ export { E as ActivityPageV2 };
@@ -0,0 +1,11 @@
1
+ type InviteTab = 'email' | 'link';
2
+ export interface InvitePeopleDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ /** The workspace the people are invited to. */
6
+ workspaceId: string;
7
+ /** The tab that opens first. Default "By email". */
8
+ initialTab?: InviteTab;
9
+ }
10
+ export declare function InvitePeopleDialog({ open, onOpenChange, workspaceId, initialTab, }: InvitePeopleDialogProps): import('react').JSX.Element;
11
+ export {};
@@ -0,0 +1,208 @@
1
+ import { useBulkCreateInvitations as e, useCreateInvitation as t } from "../../hooks/useMemberMutations.js";
2
+ import { useWorkspaceRoles as n } from "../../hooks/useWorkspaceRoles.js";
3
+ import { useProjects as r } from "../../hooks/useProjects.js";
4
+ import { useTr as i } from "../../hooks/useTr.js";
5
+ import { buildInvitationPayload as a } from "../../utils/invitationPayload.js";
6
+ import { parseEmailList as o } from "./inviteEmails.js";
7
+ import { useId as s, useMemo as c, useState as l } from "react";
8
+ import { Link2 as u, Mail as d, Send as f, UserPlus as p } from "lucide-react";
9
+ import { Button as m, FilterMenu as h, IconTile as g, Label as _, Notice as v, TabbedDialog as y, TabbedDialogContent as b, TabbedDialogFooter as x, TabbedDialogHeader as S, TabbedDialogTabs as C, Textarea as w } from "@burdenoff/fe-libs/ui";
10
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
11
+ // src/pages/v2/InvitePeopleDialog.tsx
12
+ function O({ workspaceId: e, text: t, onText: a, roleId: c, onRole: l, projectIds: u, onProjects: d, result: f }) {
13
+ let p = i(), m = s(), g = s(), { data: y = [], isLoading: b } = n(e), { data: x } = r({ archived: !1 }, { limit: 100 }, e), S = o(t), C = y.find((e) => e.id === c), T = (x?.items ?? []).filter((e) => !e.archived);
14
+ return /* @__PURE__ */ D("div", {
15
+ className: "flex flex-col gap-5",
16
+ children: [
17
+ /* @__PURE__ */ D("div", {
18
+ className: "flex flex-col gap-1.5",
19
+ children: [
20
+ /* @__PURE__ */ E(_, {
21
+ htmlFor: m,
22
+ children: p("workspacePagesV2.invite.emails", "Email addresses")
23
+ }),
24
+ /* @__PURE__ */ E(w, {
25
+ id: m,
26
+ rows: 4,
27
+ value: t,
28
+ onChange: (e) => a(e.target.value),
29
+ placeholder: p("workspacePagesV2.invite.emailsPlaceholder", "name@company.com, another@company.com"),
30
+ "aria-describedby": g,
31
+ "aria-invalid": S.invalid.length > 0 || void 0,
32
+ autoComplete: "off",
33
+ spellCheck: !1
34
+ }),
35
+ /* @__PURE__ */ E("p", {
36
+ id: g,
37
+ className: S.invalid.length > 0 ? "text-xs text-status-error-text" : "text-xs text-text-secondary",
38
+ children: S.invalid.length === 0 ? p("workspacePagesV2.invite.emailsHint", "Paste a list; commas, spaces and new lines all separate addresses.") : S.invalid.length === 1 ? p("workspacePagesV2.invite.oneInvalid", "One address isn’t valid: “{{address}}”. Check it; the others can still be sent.", { address: S.invalid[0] ?? "" }) : p("workspacePagesV2.invite.someInvalid", "{{count}} addresses aren’t valid: {{addresses}}. Check them; the others can still be sent.", {
39
+ count: S.invalid.length,
40
+ addresses: S.invalid.map((e) => `“${e}”`).join(", ")
41
+ })
42
+ })
43
+ ]
44
+ }),
45
+ /* @__PURE__ */ D("div", {
46
+ className: "flex flex-col gap-1.5",
47
+ children: [/* @__PURE__ */ E(h, {
48
+ label: p("workspacePagesV2.invite.role", "Role"),
49
+ allLabel: p("workspacePagesV2.invite.defaultRole", "Default role"),
50
+ multiple: !1,
51
+ disabled: b,
52
+ options: y.map((e) => ({
53
+ value: e.id,
54
+ label: e.name
55
+ })),
56
+ value: c ? [c] : [],
57
+ onChange: (e) => l(e[0] ?? null),
58
+ className: "self-start"
59
+ }), /* @__PURE__ */ E("p", {
60
+ className: "text-xs text-text-secondary",
61
+ children: C?.description || (C ? p("workspacePagesV2.invite.roleChosen", "They get the {{role}} role when they accept.", { role: C.name }) : p("workspacePagesV2.invite.defaultRoleHint", "They get the workspace’s default role when they accept. An admin can change it later."))
62
+ })]
63
+ }),
64
+ T.length > 0 ? /* @__PURE__ */ D("div", {
65
+ className: "flex flex-col gap-1.5",
66
+ children: [/* @__PURE__ */ D("span", {
67
+ className: "text-sm font-medium text-text-primary",
68
+ children: [
69
+ p("workspacePagesV2.invite.projects", "Add them to projects"),
70
+ " ",
71
+ /* @__PURE__ */ E("span", {
72
+ className: "font-normal text-text-muted",
73
+ children: p("workspacePagesV2.invite.optional", "(optional)")
74
+ })
75
+ ]
76
+ }), /* @__PURE__ */ E(h, {
77
+ label: p("workspacePagesV2.invite.projectsShort", "Projects"),
78
+ allLabel: p("workspacePagesV2.invite.noProjects", "None"),
79
+ options: T.map((e) => ({
80
+ value: e.id,
81
+ label: e.name
82
+ })),
83
+ value: u,
84
+ onChange: d,
85
+ className: "self-start"
86
+ })]
87
+ }) : null,
88
+ f ? /* @__PURE__ */ E(v, {
89
+ tone: f.tone,
90
+ role: f.tone === "bad" ? "alert" : "status",
91
+ children: f.text
92
+ }) : null
93
+ ]
94
+ });
95
+ }
96
+ function k({ onUseEmail: e }) {
97
+ let t = i();
98
+ return /* @__PURE__ */ E("div", {
99
+ className: "flex flex-col gap-4",
100
+ children: /* @__PURE__ */ E(v, {
101
+ tone: "info",
102
+ action: /* @__PURE__ */ D(m, {
103
+ type: "button",
104
+ size: "sm",
105
+ variant: "outline",
106
+ onClick: e,
107
+ children: [/* @__PURE__ */ E(d, { "aria-hidden": "true" }), t("workspacePagesV2.invite.useEmail", "Invite by email")]
108
+ }),
109
+ children: t("workspacePagesV2.invite.linkUnavailable", "Invite links aren’t available for workspaces yet. Invite people by email: they get the role you pick when they accept.")
110
+ })
111
+ });
112
+ }
113
+ function A({ open: r, onOpenChange: s, workspaceId: h, initialTab: _ = "email" }) {
114
+ let v = i(), [w, A] = l(_), [j, M] = l(""), [N, P] = l(null), [F, I] = l([]), [L, R] = l(null), { data: z = [] } = n(h), { mutateAsync: B, isPending: V } = t(h), { mutateAsync: H, isPending: U } = e(), W = V || U, G = c(() => o(j), [j]), K = z.find((e) => e.id === N)?.name ?? v("workspacePagesV2.invite.defaultRoleShort", "the default role"), q = c(() => [{
115
+ value: "email",
116
+ label: v("workspacePagesV2.invite.byEmail", "By email"),
117
+ icon: d
118
+ }, {
119
+ value: "link",
120
+ label: v("workspacePagesV2.invite.byLink", "Invite link"),
121
+ icon: u
122
+ }], [v]), J = (e) => {
123
+ e || (R(null), A(_)), s(e);
124
+ }, Y = async () => {
125
+ let e = G.valid;
126
+ if (e.length === 0) return;
127
+ R(null);
128
+ let t = N ? [N] : [], n = e.map((e) => a(h, e, t, F));
129
+ try {
130
+ n.length === 1 && n[0] ? await B(n[0]) : await H(n), M(G.invalid.join("\n")), R({
131
+ tone: "info",
132
+ text: e.length === 1 ? v("workspacePagesV2.invite.sentOne", "Invite sent to {{email}}. It shows in Members › Invited until they accept.", { email: e[0] ?? "" }) : v("workspacePagesV2.invite.sentMany", "{{count}} invites sent. They show in Members › Invited until people accept.", { count: e.length })
133
+ });
134
+ } catch (e) {
135
+ R({
136
+ tone: "bad",
137
+ text: e instanceof Error && e.message ? e.message : v("workspacePagesV2.invite.sendFailed", "Couldn’t send the invites. Try again.")
138
+ });
139
+ }
140
+ };
141
+ return /* @__PURE__ */ E(y, {
142
+ open: r,
143
+ onOpenChange: J,
144
+ children: /* @__PURE__ */ D(b, {
145
+ size: "form",
146
+ width: "medium",
147
+ children: [
148
+ /* @__PURE__ */ E(S, {
149
+ icon: /* @__PURE__ */ E(g, {
150
+ size: "md",
151
+ children: /* @__PURE__ */ E(p, { "aria-hidden": "true" })
152
+ }),
153
+ title: v("workspacePagesV2.invite.title", "Invite people"),
154
+ description: v("workspacePagesV2.invite.description", "They join this workspace with the role you pick when they accept."),
155
+ closeLabel: v("workspacePagesV2.common.close", "Close")
156
+ }),
157
+ /* @__PURE__ */ E(C, {
158
+ tabs: q,
159
+ value: w,
160
+ onValueChange: A,
161
+ layout: "strip",
162
+ "aria-label": v("workspacePagesV2.invite.how", "How to invite"),
163
+ renderPanel: (e) => e === "email" ? /* @__PURE__ */ E(O, {
164
+ workspaceId: h,
165
+ text: j,
166
+ onText: (e) => {
167
+ M(e), R(null);
168
+ },
169
+ roleId: N,
170
+ onRole: P,
171
+ projectIds: F,
172
+ onProjects: I,
173
+ result: L
174
+ }) : /* @__PURE__ */ E(k, { onUseEmail: () => A("email") })
175
+ }),
176
+ /* @__PURE__ */ E(x, { children: w === "email" ? /* @__PURE__ */ D(T, { children: [
177
+ /* @__PURE__ */ E("span", {
178
+ className: "me-auto text-sm text-text-secondary",
179
+ "aria-live": "polite",
180
+ children: G.valid.length === 0 ? v("workspacePagesV2.invite.noneYet", "No addresses yet") : G.valid.length === 1 ? v("workspacePagesV2.invite.oneAs", "1 invite as {{role}}", { role: K }) : v("workspacePagesV2.invite.manyAs", "{{count}} invites as {{role}}", {
181
+ count: G.valid.length,
182
+ role: K
183
+ })
184
+ }),
185
+ /* @__PURE__ */ E(m, {
186
+ type: "button",
187
+ variant: "outline",
188
+ onClick: () => J(!1),
189
+ children: v("workspacePagesV2.common.cancel", "Cancel")
190
+ }),
191
+ /* @__PURE__ */ D(m, {
192
+ type: "button",
193
+ onClick: () => void Y(),
194
+ disabled: W || G.valid.length === 0,
195
+ "aria-busy": W ? !0 : void 0,
196
+ children: [/* @__PURE__ */ E(f, { "aria-hidden": "true" }), v("workspacePagesV2.invite.send", "Send invites")]
197
+ })
198
+ ] }) : /* @__PURE__ */ E(m, {
199
+ type: "button",
200
+ className: "ms-auto",
201
+ onClick: () => J(!1),
202
+ children: v("workspacePagesV2.common.done", "Done")
203
+ }) })
204
+ ]
205
+ })
206
+ });
207
+ }
208
+ export { A as InvitePeopleDialog };
@@ -0,0 +1,9 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { InvitationWithEmailStatus } from '../../hooks/v2/useWorkspacePagesV2Data';
3
+ export interface InvitedTabProps {
4
+ workspaceId: string | undefined;
5
+ query: UseQueryResult<InvitationWithEmailStatus[]>;
6
+ canInvite: boolean;
7
+ onInvite: () => void;
8
+ }
9
+ export declare function InvitedTab({ workspaceId, query, canInvite, onInvite }: InvitedTabProps): import('react').JSX.Element;