@burdenoff/microfe-workspaces 2026.1119.1 → 2026.1121.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 (64) hide show
  1. package/dist/WorkspacesRoutes.js +83 -59
  2. package/dist/components/ProjectCard.js +48 -47
  3. package/dist/constants/navigationV2.d.ts +5 -0
  4. package/dist/constants/navigationV2.js +2 -2
  5. package/dist/generated/global-operations.d.ts +11 -1
  6. package/dist/generated/global-types.d.ts +9866 -574
  7. package/dist/generated/wspace-operations.d.ts +171 -2
  8. package/dist/generated/wspace-operations.js +1088 -52
  9. package/dist/generated/wspace-types.d.ts +193797 -41883
  10. package/dist/hooks/v2/useWorkspacePagesV2Data.d.ts +89 -0
  11. package/dist/hooks/v2/useWorkspacePagesV2Data.js +211 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/pages/ActivityListPage.js +2 -1
  14. package/dist/pages/MembersListPage.js +103 -100
  15. package/dist/pages/PendingInvitesPage.js +2 -1
  16. package/dist/pages/ProjectDetailPage.js +2 -1
  17. package/dist/pages/ProjectMembersPage.js +117 -115
  18. package/dist/pages/ProjectsListPage.js +235 -232
  19. package/dist/pages/WorkspaceDetailPage.js +2 -1
  20. package/dist/pages/WorkspaceInvitePage.js +3 -1
  21. package/dist/pages/WorkspacesListPage.js +2 -1
  22. package/dist/pages/dashboard/widgets/AgentsWidget.js +2 -1
  23. package/dist/pages/dashboard/widgets/GroupsWidget.js +2 -1
  24. package/dist/pages/dashboard/widgets/ProjectsWidget.js +3 -1
  25. package/dist/pages/dashboard/widgets/RecentActivityWidget.js +3 -1
  26. package/dist/pages/dashboard/widgets/SessionsWidget.js +2 -1
  27. package/dist/pages/dashboard/widgets/TagCloudWidget.js +2 -1
  28. package/dist/pages/dashboard/widgets/UpcomingEventsWidget.js +3 -1
  29. package/dist/pages/dashboard/widgets/VibesWidget.js +2 -1
  30. package/dist/pages/dashboard/widgets/WorkflowRunsWidget.js +3 -1
  31. package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js +3 -1
  32. package/dist/pages/dashboard/widgets/WorkflowsOverviewWidget.js +3 -1
  33. package/dist/pages/dashboard/widgets/WorkspacesWidget.js +3 -1
  34. package/dist/pages/v2/ActivityPage.d.ts +1 -0
  35. package/dist/pages/v2/ActivityPage.js +150 -0
  36. package/dist/pages/v2/InvitePeopleDialog.d.ts +11 -0
  37. package/dist/pages/v2/InvitePeopleDialog.js +208 -0
  38. package/dist/pages/v2/InvitedTab.d.ts +9 -0
  39. package/dist/pages/v2/InvitedTab.js +223 -0
  40. package/dist/pages/v2/MembersPage.d.ts +1 -0
  41. package/dist/pages/v2/MembersPage.js +120 -0
  42. package/dist/pages/v2/PeopleTab.d.ts +20 -0
  43. package/dist/pages/v2/PeopleTab.js +253 -0
  44. package/dist/pages/v2/ProjectsPage.d.ts +1 -0
  45. package/dist/pages/v2/ProjectsPage.js +242 -0
  46. package/dist/pages/v2/WorkspacesPage.d.ts +3 -0
  47. package/dist/pages/v2/WorkspacesPage.js +247 -0
  48. package/dist/pages/v2/activitySentences.d.ts +50 -0
  49. package/dist/pages/v2/activitySentences.js +288 -0
  50. package/dist/pages/v2/inviteEmails.d.ts +12 -0
  51. package/dist/pages/v2/inviteEmails.js +18 -0
  52. package/dist/pages/v2/memberRows.d.ts +54 -0
  53. package/dist/pages/v2/memberRows.js +51 -0
  54. package/dist/pages/v2/projectRows.d.ts +10 -0
  55. package/dist/pages/v2/projectRows.js +10 -0
  56. package/dist/pages/v2/relativeTime.d.ts +6 -0
  57. package/dist/pages/v2/relativeTime.js +30 -0
  58. package/dist/store/workspacesStore.d.ts +2 -1
  59. package/dist/store/workspacesStore.js +1 -1
  60. package/dist/translations/en.d.ts +382 -0
  61. package/dist/translations/en.js +382 -0
  62. package/dist/types/index.d.ts +19 -0
  63. package/dist/utils/nativeBridge.js +1 -1
  64. package/package.json +3 -3
@@ -68,7 +68,8 @@ function L() {
68
68
  }), /* @__PURE__ */ M(E, {
69
69
  illustration: "empty-search",
70
70
  title: e(R, "workspaceDetail.notFound", "Workspace not found"),
71
- description: e(R, "workspaceDetail.notFoundDescription", "This workspace doesn't exist or you don't have permission to view it.")
71
+ description: e(R, "workspaceDetail.notFoundDescription", "This workspace doesn't exist or you don't have permission to view it."),
72
+ kind: "not-found"
72
73
  })]
73
74
  });
74
75
  let $ = (e, t) => {
@@ -566,7 +566,9 @@ function A() {
566
566
  }) : Y.length === 0 ? /* @__PURE__ */ E(Ae, {
567
567
  illustration: "empty-notifications",
568
568
  title: e(x, "workspaceInvite.pendingEmptyTitle", "No pending invitations"),
569
- description: e(x, "workspaceInvite.pendingEmpty", "Invitations you send for this workspace will show up here until they are accepted, so you can resend or cancel them.")
569
+ description: e(x, "workspaceInvite.pendingEmpty", "Invitations you send for this workspace will show up here until they are accepted, so you can resend or cancel them."),
570
+ kind: "all-done",
571
+ size: "panel"
570
572
  }) : /* @__PURE__ */ D("div", {
571
573
  className: "space-y-3",
572
574
  children: [st ? /* @__PURE__ */ D("div", {
@@ -192,7 +192,8 @@ function F() {
192
192
  className: "gap-2",
193
193
  children: [/* @__PURE__ */ k(h, { size: 20 }), o(F, "workspacesList.createFirstButton", "Create Your First Workspace")]
194
194
  })
195
- })
195
+ }),
196
+ kind: U.search ? "no-results" : "first-use"
196
197
  }) : /* @__PURE__ */ A(O, { children: [V === "list" ? /* @__PURE__ */ k("div", {
197
198
  className: "space-y-3",
198
199
  children: $?.items.map((e) => /* @__PURE__ */ k(r, { workspace: e }, e.id))
@@ -33,7 +33,8 @@ function f({ workspaceData: f, isLoading: p, navigate: m }) {
33
33
  size: "sm",
34
34
  onClick: () => m("/vibecontrols/agents/new"),
35
35
  children: t(h, "dashboard.agents.connectAgent", "Connect agent")
36
- })
36
+ }),
37
+ size: "panel"
37
38
  }) : /* @__PURE__ */ u("div", {
38
39
  className: "space-y-3",
39
40
  children: [
@@ -28,7 +28,8 @@ function l({ workspaceData: l, isLoading: u, navigate: d }) {
28
28
  illustration: "empty-people",
29
29
  title: t(f, "dashboard.groups.emptyTitle", "No groups yet"),
30
30
  description: t(f, "dashboard.groups.emptyDescription", "Groups bundle members together so you can manage and mention them as one."),
31
- className: "py-4"
31
+ className: "py-4",
32
+ size: "panel"
32
33
  }) : /* @__PURE__ */ s("div", {
33
34
  className: "space-y-1.5",
34
35
  children: [p.slice(0, 4).map((e) => /* @__PURE__ */ s("button", {
@@ -42,7 +42,9 @@ function p({ workspaceData: p, isLoading: m, navigate: h }) {
42
42
  size: "sm",
43
43
  onClick: () => h("/workspaces/projects"),
44
44
  children: t(g, "dashboard.projects.createProject", "Create a project")
45
- })
45
+ }),
46
+ glassIllustration: "files",
47
+ size: "panel"
46
48
  }) : /* @__PURE__ */ l("div", {
47
49
  className: "space-y-3",
48
50
  children: [v > 0 && /* @__PURE__ */ l("div", {
@@ -56,7 +56,9 @@ function f({ workspaceData: f, isLoading: p, navigate: m }) {
56
56
  illustration: "empty-data",
57
57
  title: t(h, "dashboard.recentActivity.emptyTitle", "No recent activity"),
58
58
  description: t(h, "dashboard.recentActivity.emptyDescription", "Activity will appear here as you use the platform"),
59
- className: "py-6"
59
+ className: "py-6",
60
+ glassIllustration: "history",
61
+ size: "panel"
60
62
  }) : /* @__PURE__ */ o("div", {
61
63
  className: "space-y-1",
62
64
  children: g.map((e, t) => {
@@ -55,7 +55,8 @@ function m({ workspaceData: m, isLoading: h, navigate: g }) {
55
55
  children: v.length === 0 ? /* @__PURE__ */ s(o, {
56
56
  illustration: "empty-sessions",
57
57
  title: t(_, "dashboard.sessions.emptyTitle", "No active sessions"),
58
- className: "py-6"
58
+ className: "py-6",
59
+ size: "panel"
59
60
  }) : /* @__PURE__ */ s("ul", {
60
61
  className: "space-y-1.5",
61
62
  children: v.slice(0, 5).map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c("button", {
@@ -38,7 +38,8 @@ function d({ workspaceData: d, isLoading: f, navigate: p }) {
38
38
  illustration: "empty-generic",
39
39
  title: t(m, "dashboard.tagCloud.emptyTitle", "No tags created yet"),
40
40
  description: t(m, "dashboard.tagCloud.emptyDescription", "Tags help you label and filter projects and content across the workspace."),
41
- className: "py-4"
41
+ className: "py-4",
42
+ size: "panel"
42
43
  }) : /* @__PURE__ */ c("div", {
43
44
  className: "space-y-2",
44
45
  children: [/* @__PURE__ */ s("div", {
@@ -50,7 +50,9 @@ function f({ workspaceData: f, isLoading: p, navigate: m }) {
50
50
  size: "sm",
51
51
  onClick: () => m("/calendar"),
52
52
  children: t(h, "dashboard.upcomingEvents.emptyAction", "Schedule an event")
53
- })
53
+ }),
54
+ glassIllustration: "calendar",
55
+ size: "panel"
54
56
  }) : /* @__PURE__ */ c("div", {
55
57
  className: "space-y-2",
56
58
  children: g.map((e) => /* @__PURE__ */ l("button", {
@@ -49,7 +49,8 @@ function d({ workspaceData: d, isLoading: f, navigate: p }) {
49
49
  " ",
50
50
  t(m, "dashboard.vibes.emptyAction", "Create your first vibe")
51
51
  ]
52
- })
52
+ }),
53
+ size: "panel"
53
54
  }) : /* @__PURE__ */ s("ul", {
54
55
  className: "space-y-1.5",
55
56
  children: h.slice(0, 5).map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c("button", {
@@ -135,7 +135,9 @@ function g({ workspaceData: i, isLoading: a, navigate: o }) {
135
135
  illustration: "empty-data",
136
136
  title: t(s, "dashboard.workflowRuns.emptyTitle", "No runs yet"),
137
137
  description: t(s, "dashboard.workflowRuns.emptyDescription", "Trigger a workflow to see its execution history here."),
138
- className: "py-4"
138
+ className: "py-4",
139
+ glassIllustration: "servers",
140
+ size: "panel"
139
141
  })
140
142
  });
141
143
  }
@@ -92,7 +92,9 @@ function h({ workspaceData: r, isLoading: a, navigate: o }) {
92
92
  illustration: "empty-data",
93
93
  title: t(s, "dashboard.workflowStats.emptyTitle", "No workflow data available"),
94
94
  description: t(s, "dashboard.workflowStats.emptyDescription", "Once you run automations, their status and counts will appear here."),
95
- className: "py-4"
95
+ className: "py-4",
96
+ glassIllustration: "workflows",
97
+ size: "panel"
96
98
  })
97
99
  });
98
100
  }
@@ -91,7 +91,9 @@ function d({ workspaceData: d, isLoading: f, navigate: p }) {
91
91
  " ",
92
92
  t(m, "dashboard.workflowsOverview.emptyAction", "New Workflow")
93
93
  ]
94
- })
94
+ }),
95
+ glassIllustration: "workflows",
96
+ size: "panel"
95
97
  })
96
98
  });
97
99
  }
@@ -47,7 +47,9 @@ function m({ workspaceData: m, isLoading: h, navigate: g }) {
47
47
  size: "sm",
48
48
  onClick: () => g("/workspaces/list"),
49
49
  children: t(_, "dashboard.workspaces.emptyAction", "Create your first workspace")
50
- })
50
+ }),
51
+ glassIllustration: "places",
52
+ size: "panel"
51
53
  }) : /* @__PURE__ */ d("div", {
52
54
  className: "space-y-2",
53
55
  children: [v.slice(0, 5).map((e) => /* @__PURE__ */ d("button", {
@@ -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;