@burdenoff/microfe-workspaces 2026.1120.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 (46) 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/MembersListPage.js +101 -100
  14. package/dist/pages/ProjectMembersPage.js +116 -115
  15. package/dist/pages/ProjectsListPage.js +233 -232
  16. package/dist/pages/v2/ActivityPage.d.ts +1 -0
  17. package/dist/pages/v2/ActivityPage.js +150 -0
  18. package/dist/pages/v2/InvitePeopleDialog.d.ts +11 -0
  19. package/dist/pages/v2/InvitePeopleDialog.js +208 -0
  20. package/dist/pages/v2/InvitedTab.d.ts +9 -0
  21. package/dist/pages/v2/InvitedTab.js +223 -0
  22. package/dist/pages/v2/MembersPage.d.ts +1 -0
  23. package/dist/pages/v2/MembersPage.js +120 -0
  24. package/dist/pages/v2/PeopleTab.d.ts +20 -0
  25. package/dist/pages/v2/PeopleTab.js +253 -0
  26. package/dist/pages/v2/ProjectsPage.d.ts +1 -0
  27. package/dist/pages/v2/ProjectsPage.js +242 -0
  28. package/dist/pages/v2/WorkspacesPage.d.ts +3 -0
  29. package/dist/pages/v2/WorkspacesPage.js +247 -0
  30. package/dist/pages/v2/activitySentences.d.ts +50 -0
  31. package/dist/pages/v2/activitySentences.js +288 -0
  32. package/dist/pages/v2/inviteEmails.d.ts +12 -0
  33. package/dist/pages/v2/inviteEmails.js +18 -0
  34. package/dist/pages/v2/memberRows.d.ts +54 -0
  35. package/dist/pages/v2/memberRows.js +51 -0
  36. package/dist/pages/v2/projectRows.d.ts +10 -0
  37. package/dist/pages/v2/projectRows.js +10 -0
  38. package/dist/pages/v2/relativeTime.d.ts +6 -0
  39. package/dist/pages/v2/relativeTime.js +30 -0
  40. package/dist/store/workspacesStore.d.ts +2 -1
  41. package/dist/store/workspacesStore.js +1 -1
  42. package/dist/translations/en.d.ts +382 -0
  43. package/dist/translations/en.js +382 -0
  44. package/dist/types/index.d.ts +19 -0
  45. package/dist/utils/nativeBridge.js +1 -1
  46. package/package.json +3 -3
@@ -0,0 +1,247 @@
1
+ import { useWorkspacesContext as e } from "../../providers/WorkspacesProvider.js";
2
+ import { useMyWorkspaces as t } from "../../hooks/useWorkspaces.js";
3
+ import { useAllMyWorkspaces as n } from "../../hooks/v2/useWorkspacePagesV2Data.js";
4
+ import { commitWorkspaceSelection as r, useOpenWorkspace as i } from "../../hooks/useOpenWorkspace.js";
5
+ import { useWorkspacePermissions as a } from "../../hooks/useWorkspacePermissions.js";
6
+ import { useWorkspacesPageView as o } from "../../hooks/useWorkspacesPageView.js";
7
+ import { useScopedNavigation as s } from "../../hooks/useScopedNavigation.js";
8
+ import { useTr as c } from "../../hooks/useTr.js";
9
+ import { InvitePeopleDialog as l } from "./InvitePeopleDialog.js";
10
+ import { relativeTime as u } from "./relativeTime.js";
11
+ import { useCallback as d, useMemo as f, useState as p } from "react";
12
+ import { ArrowRightLeft as m, Building2 as h, Mail as g, Plus as _, Settings as v, SquareArrowOutUpRight as y, UserPlus as b } from "lucide-react";
13
+ import { Button as x, EmptyState as S, EntityAvatar as C, ListPager as w, ListToolbar as T, ListView as E, LockedButton as D, RichCard as O, RichCardGrid as k, StatusChip as A, WorkspacePage as j, filterList as M, pageSlice as N, useListState as P } from "@burdenoff/fe-libs/ui";
14
+ import { useActiveContext as F, usePermissions as I } from "@burdenoff/fe-libs/shared/providers/shell";
15
+ import { jsx as L, jsxs as R } from "react/jsx-runtime";
16
+ import { useI18n as z } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
17
+ import { useNavigate as B, useSearchParams as V } from "react-router";
18
+ import { useQueryClient as H } from "@tanstack/react-query";
19
+ import { PageHeader as U, Tabs as W } from "@burdenoff/fe-libs/chrome";
20
+ var G = [
21
+ "q",
22
+ "page",
23
+ "inv_q",
24
+ "inv_page",
25
+ "inv_join"
26
+ ];
27
+ function K(e, t) {
28
+ switch (e?.toUpperCase()) {
29
+ case "PERSONAL": return t("workspacePagesV2.workspaces.typePersonal", "Personal workspace");
30
+ case "ENTERPRISE": return t("workspacePagesV2.workspaces.typeEnterprise", "Enterprise workspace");
31
+ default: return t("workspacePagesV2.workspaces.typeTeam", "Team workspace");
32
+ }
33
+ }
34
+ function q({ workspace: e, current: t, yourRole: n, now: r, onOpen: i, onSwitch: a, onSettings: o }) {
35
+ let s = c(), { locale: l } = z(), d = u(e.createdAt, r, l), f = [{
36
+ id: "open",
37
+ label: s("workspacePagesV2.workspaces.openDetails", "Open details"),
38
+ icon: y,
39
+ onSelect: i
40
+ }, t ? {
41
+ id: "settings",
42
+ label: s("workspacePagesV2.workspaces.settings", "Settings"),
43
+ icon: v,
44
+ onSelect: o
45
+ } : {
46
+ id: "switch",
47
+ label: s("workspacePagesV2.workspaces.switch", "Switch to it"),
48
+ icon: m,
49
+ onSelect: a
50
+ }];
51
+ return /* @__PURE__ */ L(O, {
52
+ media: /* @__PURE__ */ L(C, {
53
+ name: e.name,
54
+ kind: "team",
55
+ size: 40
56
+ }),
57
+ title: e.name,
58
+ onOpen: i,
59
+ subtitle: t && n ? s("workspacePagesV2.workspaces.yourRole", "Your role: {{role}}", { role: n }) : K(e.type, s),
60
+ menu: f,
61
+ menuLabel: s("workspacePagesV2.workspaces.actionsFor", "Actions for {{name}}", { name: e.name }),
62
+ details: [{
63
+ label: s("workspacePagesV2.workspaces.people", "People"),
64
+ value: typeof e.memberCount == "number" ? e.memberCount : "—"
65
+ }, {
66
+ label: s("workspacePagesV2.workspaces.created", "Created"),
67
+ value: d ?? "—"
68
+ }],
69
+ footer: t ? /* @__PURE__ */ L(A, {
70
+ status: "accent",
71
+ children: s("workspacePagesV2.workspaces.youAreHere", "You’re here")
72
+ }) : e.status === "SUSPENDED" ? /* @__PURE__ */ L(A, {
73
+ status: "warn",
74
+ children: s("workspacePagesV2.workspaces.suspended", "Suspended")
75
+ }) : /* @__PURE__ */ L(A, {
76
+ status: "ok",
77
+ children: s("workspacePagesV2.workspaces.active", "Active")
78
+ }),
79
+ actions: t ? /* @__PURE__ */ R(x, {
80
+ type: "button",
81
+ size: "sm",
82
+ variant: "outline",
83
+ onClick: o,
84
+ children: [/* @__PURE__ */ L(v, { "aria-hidden": "true" }), s("workspacePagesV2.workspaces.settings", "Settings")]
85
+ }) : /* @__PURE__ */ L(x, {
86
+ type: "button",
87
+ size: "sm",
88
+ variant: "outline",
89
+ onClick: a,
90
+ children: s("workspacePagesV2.workspaces.switch", "Switch to it")
91
+ })
92
+ });
93
+ }
94
+ function J() {
95
+ let [e] = V(), r = !!e.get("q")?.trim(), i = t({
96
+ limit: 12,
97
+ offset: 0
98
+ }), a = P({
99
+ url: V(),
100
+ pageSize: 12,
101
+ total: r ? void 0 : i.data?.total
102
+ }), o = t({
103
+ limit: a.pageSize,
104
+ offset: a.offset
105
+ }), s = n(r), c = f(() => ({ text: (e) => e.name }), []);
106
+ if (r) {
107
+ let e = M(s.data ?? [], a, c);
108
+ return {
109
+ list: a,
110
+ searching: r,
111
+ source: s,
112
+ count: e.length,
113
+ items: N(e, a.page, a.pageSize)
114
+ };
115
+ }
116
+ return {
117
+ list: a,
118
+ searching: r,
119
+ source: o,
120
+ count: o.data?.total ?? i.data?.total ?? 0,
121
+ items: o.data?.items ?? []
122
+ };
123
+ }
124
+ function Y({ onCreate: e, only: t = !1 }) {
125
+ let n = c();
126
+ return /* @__PURE__ */ L(S, {
127
+ size: t ? "panel" : void 0,
128
+ illustration: "places",
129
+ title: t ? n("workspacePagesV2.workspaces.onlyOneTitle", "This is your only workspace") : n("workspacePagesV2.workspaces.emptyTitle", "No workspaces yet"),
130
+ description: t ? n("workspacePagesV2.workspaces.onlyOneDescription", "Make another one for a client, a team or a test. Each workspace has its own people, projects and saved values.") : n("workspacePagesV2.workspaces.emptyDescription", "Make a workspace for a client, a team or a test. Each one has its own people, projects and saved values."),
131
+ action: e ? /* @__PURE__ */ R(x, {
132
+ type: "button",
133
+ variant: t ? "outline" : "default",
134
+ onClick: e,
135
+ children: [/* @__PURE__ */ L(_, { "aria-hidden": "true" }), n("workspacePagesV2.workspaces.new", "New workspace")]
136
+ }) : void 0
137
+ });
138
+ }
139
+ function X({ onCreate: t, canCreate: n }) {
140
+ let a = c(), o = B(), { basePath: l = "/workspaces", workspaceId: u } = e(), { withCurrentSearch: f } = s(), m = i(), { setOrganization: h, setWorkspace: g, setProject: _, setTenant: v } = F(), { permissions: y } = I(), [b] = p(() => /* @__PURE__ */ new Date()), { list: x, searching: S, source: C, count: D, items: O } = J(), A = n ? t : void 0, j = d((e) => r({
141
+ setOrganization: h,
142
+ setWorkspace: g,
143
+ setProject: _,
144
+ setTenant: v
145
+ }, e), [
146
+ h,
147
+ _,
148
+ v,
149
+ g
150
+ ]);
151
+ return /* @__PURE__ */ R(E, {
152
+ list: x,
153
+ count: D,
154
+ loading: C.isPending && !C.data,
155
+ error: C.error,
156
+ onRetry: () => void C.refetch(),
157
+ errorTitle: a("workspacePagesV2.workspaces.loadFailed", "Couldn’t load your workspaces"),
158
+ errorDetails: C.error?.message,
159
+ summary: D === 1 ? a("workspacePagesV2.workspaces.countOne", "1 workspace") : a("workspacePagesV2.workspaces.count", "{{count}} workspaces", { count: D }),
160
+ toolbar: /* @__PURE__ */ L(T, {
161
+ list: x,
162
+ searchPlaceholder: a("workspacePagesV2.workspaces.search", "Search workspaces")
163
+ }),
164
+ pager: /* @__PURE__ */ L(w, {
165
+ list: x,
166
+ total: D
167
+ }),
168
+ empty: /* @__PURE__ */ L(Y, { onCreate: A }),
169
+ children: [/* @__PURE__ */ L(k, { children: O.map((e) => /* @__PURE__ */ L(q, {
170
+ workspace: e,
171
+ current: e.id === u,
172
+ yourRole: y?.roles?.[0] ?? null,
173
+ now: b,
174
+ onOpen: () => m(e),
175
+ onSwitch: () => j(e),
176
+ onSettings: () => o(f(`${l}/${e.id}/settings`))
177
+ }, e.id)) }), D === 1 && !S ? /* @__PURE__ */ L(Y, {
178
+ onCreate: A,
179
+ only: !0
180
+ }) : null]
181
+ });
182
+ }
183
+ function Z() {
184
+ o("workspaces.list");
185
+ let n = c(), r = B(), i = H(), { basePath: u = "/workspaces", workspaceId: f, invitesForYou: p } = e(), { withCurrentSearch: m } = s(), { canInviteMember: v, canCreateWorkspace: y, isLoading: x } = a(), [S, C] = V(), w = S.get("tab") === "invites" && p ? "invites" : "workspaces", T = S.get("dialog") === "invite", E = t({
186
+ limit: 12,
187
+ offset: 0
188
+ }).data?.total, O = d((e) => {
189
+ let t = new URLSearchParams(S);
190
+ e(t), C(t, { replace: !0 });
191
+ }, [S, C]), k = (e) => O((t) => {
192
+ for (let e of G) t.delete(e);
193
+ e === "invites" ? t.set("tab", "invites") : t.delete("tab");
194
+ }), A = () => O((e) => e.set("dialog", "invite")), M = () => O((e) => e.delete("dialog")), N = () => r(m(`${u}/new`)), P = d(() => {
195
+ i.invalidateQueries({ queryKey: ["myWorkspaces"] });
196
+ }, [i]);
197
+ return /* @__PURE__ */ R(j, { children: [
198
+ /* @__PURE__ */ L(U, {
199
+ variant: "compact",
200
+ title: n("workspacePagesV2.workspaces.title", "Workspaces & invites"),
201
+ description: n("workspacePagesV2.workspaces.purpose", "The workspaces you belong to, and invites for you to join others."),
202
+ secondary: /* @__PURE__ */ L(D, {
203
+ variant: "outline",
204
+ locked: !x && !v,
205
+ reason: n("workspacePagesV2.members.inviteLocked", "Inviting people is for workspace admins and managers. Ask an owner of this workspace."),
206
+ icon: b,
207
+ onClick: A,
208
+ disabled: !f,
209
+ children: n("workspacePagesV2.members.invite", "Invite people")
210
+ }),
211
+ primary: /* @__PURE__ */ L(D, {
212
+ locked: !x && !y,
213
+ reason: n("workspacePagesV2.workspaces.createLocked", "Making workspaces is for organization admins. Ask an owner of your organization."),
214
+ icon: _,
215
+ onClick: N,
216
+ children: n("workspacePagesV2.workspaces.new", "New workspace")
217
+ })
218
+ }),
219
+ p ? /* @__PURE__ */ L(W, {
220
+ variant: "check",
221
+ ariaLabel: n("workspacePagesV2.workspaces.tabsLabel", "Workspaces & invites"),
222
+ activeTabId: w,
223
+ onTabChange: k,
224
+ items: [{
225
+ id: "workspaces",
226
+ label: n("workspacePagesV2.workspaces.tabWorkspaces", "Workspaces"),
227
+ icon: /* @__PURE__ */ L(h, { "aria-hidden": "true" }),
228
+ badge: E
229
+ }, {
230
+ id: "invites",
231
+ label: n("workspacePagesV2.workspaces.tabInvites", "Invites for you"),
232
+ icon: /* @__PURE__ */ L(g, { "aria-hidden": "true" }),
233
+ badge: p.count
234
+ }]
235
+ }) : null,
236
+ w === "invites" && p ? p.render({ onWorkspaceJoined: P }) : /* @__PURE__ */ L(X, {
237
+ onCreate: N,
238
+ canCreate: y
239
+ }),
240
+ f ? /* @__PURE__ */ L(l, {
241
+ open: T && v,
242
+ onOpenChange: (e) => e ? A() : M(),
243
+ workspaceId: f
244
+ }) : null
245
+ ] });
246
+ }
247
+ export { Z as WorkspacesPageV2 };
@@ -0,0 +1,50 @@
1
+ import { ActivityTone } from '@burdenoff/fe-libs/ui';
2
+ /** What the page needs from one activity row. */
3
+ export interface ActivityRow {
4
+ id: string;
5
+ action: string;
6
+ category?: string | null;
7
+ resourceType?: string | null;
8
+ resourceId?: string | null;
9
+ userId: string;
10
+ description?: string | null;
11
+ details?: Record<string, unknown> | null;
12
+ timestamp: string;
13
+ }
14
+ export type Translate = (key: string, fallback: string, params?: Record<string, string | number>) => string;
15
+ /** The one "who" every service actor is grouped under. */
16
+ export declare const SYSTEM_ACTOR_KEY = "system";
17
+ /** How many of the newest events the page reads (the service's cap for this query). */
18
+ export declare const ACTIVITY_WINDOW = 200;
19
+ /** The "Show" filter's choices. */
20
+ export type ActivityShow = 'problems' | 'access' | 'people';
21
+ export interface ActivitySentence {
22
+ id: string;
23
+ at: string;
24
+ /** `SYSTEM_ACTOR_KEY` for services, else the user's id (the "Who" filter's value). */
25
+ actorKey: string;
26
+ actorKind: 'person' | 'service';
27
+ /** What the sentence reads as: "started", "tried to start". */
28
+ verb: string;
29
+ /** "a workflow"; empty when the verb says it all ("signed in"). */
30
+ object: string;
31
+ /** The "Area" filter's value and its words. */
32
+ areaKey: string;
33
+ area: string;
34
+ tone: ActivityTone;
35
+ failed: boolean;
36
+ /** The "Show" filter's values for this row. */
37
+ show: ActivityShow[];
38
+ }
39
+ /** True for a row a service wrote as itself (a schedule, a trigger), not a person. */
40
+ export declare function isServiceActor(row: Pick<ActivityRow, 'userId' | 'details'>): boolean;
41
+ /** The mutation field names a backstop row records (or the one an older plugin recorded). */
42
+ export declare function mutationFieldNames(row: ActivityRow): string[];
43
+ /** "startWorkflowRun" → ["start", "workflow", "run"]. */
44
+ export declare function splitWords(name: string): string[];
45
+ /** "a workflow", "an invitation", "files" (a plural takes no article). */
46
+ export declare function withArticle(words: readonly string[], tr: Translate): string;
47
+ /** One row as the log reads it. */
48
+ export declare function toActivitySentence(row: ActivityRow, tr: Translate): ActivitySentence;
49
+ /** The rows, newest first (the service orders them, but a merged page must not trust it). */
50
+ export declare function toActivitySentences(rows: readonly ActivityRow[], tr: Translate): ActivitySentence[];
@@ -0,0 +1,288 @@
1
+ // src/pages/v2/activitySentences.ts
2
+ var e = "system", t = /^(?:wspace|global|tool|store|resource)-[a-z0-9-]+-svc$/, n = {
3
+ accept: ["accept", "accepted"],
4
+ add: ["add", "added"],
5
+ apply: ["apply", "applied"],
6
+ approve: ["approve", "approved"],
7
+ archive: ["archive", "archived"],
8
+ assign: ["assign", "assigned"],
9
+ cancel: ["cancel", "cancelled"],
10
+ change: ["change", "changed"],
11
+ clear: ["clear", "cleared"],
12
+ complete: ["complete", "completed"],
13
+ connect: ["connect", "connected"],
14
+ copy: ["copy", "copied"],
15
+ create: ["create", "created"],
16
+ decline: ["decline", "declined"],
17
+ delete: ["delete", "deleted"],
18
+ disable: ["turn off", "turned off"],
19
+ disconnect: ["disconnect", "disconnected"],
20
+ duplicate: ["duplicate", "duplicated"],
21
+ enable: ["turn on", "turned on"],
22
+ execute: ["run", "ran"],
23
+ export: ["export", "exported"],
24
+ generate: ["generate", "generated"],
25
+ grant: ["grant", "granted"],
26
+ import: ["import", "imported"],
27
+ install: ["install", "installed"],
28
+ invite: ["invite", "invited"],
29
+ join: ["join", "joined"],
30
+ leave: ["leave", "left"],
31
+ link: ["link", "linked"],
32
+ mark: ["mark", "marked"],
33
+ move: ["move", "moved"],
34
+ pause: ["pause", "paused"],
35
+ prewarm: ["warm up", "warmed up"],
36
+ provision: ["set up", "set up"],
37
+ publish: ["publish", "published"],
38
+ record: ["record", "recorded"],
39
+ refresh: ["refresh", "refreshed"],
40
+ register: ["register", "registered"],
41
+ reject: ["reject", "rejected"],
42
+ remove: ["remove", "removed"],
43
+ rename: ["rename", "renamed"],
44
+ resend: ["send again", "sent again"],
45
+ reset: ["reset", "reset"],
46
+ restore: ["restore", "restored"],
47
+ resume: ["resume", "resumed"],
48
+ retry: ["retry", "retried"],
49
+ revoke: ["revoke", "revoked"],
50
+ rotate: ["rotate", "rotated"],
51
+ run: ["run", "ran"],
52
+ save: ["save", "saved"],
53
+ schedule: ["schedule", "scheduled"],
54
+ send: ["send", "sent"],
55
+ set: ["set", "set"],
56
+ share: ["share", "shared"],
57
+ start: ["start", "started"],
58
+ stop: ["stop", "stopped"],
59
+ submit: ["submit", "submitted"],
60
+ suspend: ["suspend", "suspended"],
61
+ sync: ["sync", "synced"],
62
+ test: ["test", "tested"],
63
+ trigger: ["run", "ran"],
64
+ unarchive: ["restore", "restored"],
65
+ uninstall: ["uninstall", "uninstalled"],
66
+ unlink: ["unlink", "unlinked"],
67
+ unshare: ["stop sharing", "stopped sharing"],
68
+ update: ["change", "changed"],
69
+ upload: ["upload", "uploaded"],
70
+ upsert: ["save", "saved"],
71
+ verify: ["verify", "verified"]
72
+ }, r = {
73
+ accepted: "accept",
74
+ added: "add",
75
+ archived: "archive",
76
+ assigned: "assign",
77
+ changed: "change",
78
+ completed: "complete",
79
+ created: "create",
80
+ deleted: "delete",
81
+ exported: "export",
82
+ imported: "import",
83
+ reactivated: "restore",
84
+ rejected: "reject",
85
+ removed: "remove",
86
+ restored: "restore",
87
+ sent: "send",
88
+ updated: "update"
89
+ }, i = {
90
+ user_login: ["signedIn", "signed in"],
91
+ user_logout: ["signedOut", "signed out"],
92
+ user_joined_workspace: ["joinedWorkspace", "joined the workspace"],
93
+ user_left_workspace: ["leftWorkspace", "left the workspace"]
94
+ }, a = /* @__PURE__ */ new Set([
95
+ "delete",
96
+ "remove",
97
+ "revoke",
98
+ "cancel",
99
+ "reject",
100
+ "decline",
101
+ "suspend"
102
+ ]), o = /* @__PURE__ */ new Set([
103
+ "pause",
104
+ "disable",
105
+ "stop"
106
+ ]), s = /* @__PURE__ */ new Set([
107
+ "approve",
108
+ "enable",
109
+ "publish",
110
+ "restore",
111
+ "unarchive",
112
+ "resume",
113
+ "complete"
114
+ ]), c = /invit|role|permission|member|access|grant|revoke|assign|visibility|share/i, l = /* @__PURE__ */ new Set([
115
+ "INVITE",
116
+ "ROLE",
117
+ "PERMISSION",
118
+ "TEAM"
119
+ ]), u = {
120
+ "wspace-workflow-svc": ["workflows", "Workflows"],
121
+ "wspace-scheduler-svc": ["schedules", "Schedules"],
122
+ "wspace-workspace-svc": ["workspace", "Workspace"],
123
+ "wspace-rbac-svc": ["access", "People & access"],
124
+ "wspace-groups-svc": ["teams", "Teams"],
125
+ "wspace-files-svc": ["files", "Files"],
126
+ "wspace-tags-svc": ["tags", "Tags"],
127
+ "wspace-security-svc": ["savedValues", "Saved values"],
128
+ "wspace-conversations-svc": ["chat", "Chat"],
129
+ "wspace-calendar-svc": ["calendar", "Calendar"],
130
+ "wspace-export-svc": ["downloads", "Download your data"],
131
+ "wspace-integrations-svc": ["connections", "Connections"],
132
+ "wspace-sandbox-svc": ["sandboxes", "Sandboxes"]
133
+ }, d = [
134
+ [
135
+ /^PROJECT_/,
136
+ "projects",
137
+ "Projects"
138
+ ],
139
+ [
140
+ /^(WORKSPACE_INVITATION|USER_)/,
141
+ "people",
142
+ "People"
143
+ ],
144
+ [
145
+ /^TEAM_/,
146
+ "teams",
147
+ "Teams"
148
+ ],
149
+ [
150
+ /^(ROLE|PERMISSION|RESOURCE_PERMISSION|RESOURCE_VISIBILITY)_/,
151
+ "access",
152
+ "People & access"
153
+ ],
154
+ [
155
+ /^WORKSPACE_/,
156
+ "workspace",
157
+ "Workspace"
158
+ ],
159
+ [
160
+ /^SETTINGS_/,
161
+ "settings",
162
+ "Settings"
163
+ ]
164
+ ];
165
+ function f(e) {
166
+ return typeof e == "object" && !!e && !Array.isArray(e);
167
+ }
168
+ function p(e) {
169
+ return typeof e == "string" && e.trim() !== "" ? e.trim() : null;
170
+ }
171
+ function m(e) {
172
+ return (f(e.details) ? p(e.details.actorType) : null)?.toLowerCase() === "service" || t.test(e.userId);
173
+ }
174
+ function h(e) {
175
+ let t = f(e.details) ? e.details : {}, n = t.fieldNames;
176
+ if (Array.isArray(n)) {
177
+ let e = n.filter((e) => typeof e == "string" && e !== "");
178
+ if (e.length > 0) return e;
179
+ }
180
+ let r = p(t.fieldName);
181
+ return r ? [r] : e.action === "graphql.mutation" && e.resourceId ? e.resourceId.split(",").map((e) => e.trim()).filter(Boolean) : [];
182
+ }
183
+ function g(e) {
184
+ return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_\-.]+/).map((e) => e.toLowerCase()).filter(Boolean);
185
+ }
186
+ function _(e, t) {
187
+ let n = e.join(" ");
188
+ if (n === "") return "";
189
+ let r = e[e.length - 1] ?? "";
190
+ return r.length > 2 && r.endsWith("s") && !r.endsWith("ss") ? n : /^[aeiou]/.test(n) ? t("workspacePagesV2.activity.anObject", "an {{object}}", { object: n }) : t("workspacePagesV2.activity.aObject", "a {{object}}", { object: n });
191
+ }
192
+ function v(e, t, r) {
193
+ let [i, a] = n[e] ?? [e, e];
194
+ return t ? r("workspacePagesV2.activity.triedTo", "tried to {{verb}}", { verb: r(`workspacePagesV2.activity.verbBase.${e}`, i) }) : r(`workspacePagesV2.activity.verb.${e}`, a);
195
+ }
196
+ function y(e, t, r) {
197
+ let i = g(e).filter((e) => e !== "bulk"), a = i.findIndex((e) => e in n);
198
+ if (a === -1 || a > 1) return {
199
+ verbKey: null,
200
+ verb: t ? r("workspacePagesV2.activity.triedAChange", "tried to make a change:") : r("workspacePagesV2.activity.madeAChange", "made a change:"),
201
+ object: i.join(" "),
202
+ failed: t
203
+ };
204
+ let o = i[a] ?? "";
205
+ return {
206
+ verbKey: o,
207
+ verb: v(o, t, r),
208
+ object: _(i.slice(a + 1), r),
209
+ failed: t
210
+ };
211
+ }
212
+ function b(e, t) {
213
+ let n = e.toLowerCase().split("_").filter(Boolean), a = i[n.join("_")];
214
+ if (a) return {
215
+ verbKey: null,
216
+ verb: t(`workspacePagesV2.activity.whole.${a[0]}`, a[1]),
217
+ object: "",
218
+ failed: !1
219
+ };
220
+ let o = r[n[n.length - 1] ?? ""];
221
+ return !o || n.length < 2 ? null : {
222
+ verbKey: o,
223
+ verb: v(o, !1, t),
224
+ object: _(n.slice(0, -1), t),
225
+ failed: !1
226
+ };
227
+ }
228
+ function x(e, t) {
229
+ let n = (f(e.details) ? e.details : {}).success === !1, [r] = h(e);
230
+ if (r) return y(r, n, t);
231
+ let i = b(e.action, t);
232
+ if (i) return i;
233
+ let a = p(e.description);
234
+ return {
235
+ verbKey: null,
236
+ verb: t("workspacePagesV2.activity.madeAChange", "made a change:"),
237
+ object: a ?? g(e.action).join(" "),
238
+ failed: n
239
+ };
240
+ }
241
+ function S(e, n) {
242
+ let r = p((f(e.details) ? e.details : {}).serviceName) ?? (t.test(e.userId) ? e.userId : null), i = r ? u[r] : void 0;
243
+ if (i) return {
244
+ areaKey: i[0],
245
+ area: n(`workspacePagesV2.activity.area.${i[0]}`, i[1])
246
+ };
247
+ for (let [t, r, i] of d) if (t.test(e.action)) return {
248
+ areaKey: r,
249
+ area: n(`workspacePagesV2.activity.area.${r}`, i)
250
+ };
251
+ if (r) {
252
+ let e = r.replace(/^(?:wspace|global|tool|store|resource)-/, "").replace(/-svc$/, ""), t = g(e).join(" ");
253
+ return {
254
+ areaKey: `service:${e}`,
255
+ area: t.charAt(0).toUpperCase() + t.slice(1)
256
+ };
257
+ }
258
+ return {
259
+ areaKey: "workspace",
260
+ area: n("workspacePagesV2.activity.area.workspace", "Workspace")
261
+ };
262
+ }
263
+ function C(e, t) {
264
+ return e.category && l.has(e.category) ? !0 : c.test(e.action) || h(e).some((e) => c.test(e)) || t.verbKey === "invite";
265
+ }
266
+ function w(e, t) {
267
+ return e.failed || e.verbKey && a.has(e.verbKey) ? "bad" : e.verbKey && o.has(e.verbKey) ? "warn" : t ? "accent" : e.verbKey && s.has(e.verbKey) ? "ok" : "neutral";
268
+ }
269
+ function T(t, n) {
270
+ let r = m(t), i = x(t, n), a = C(t, i), { areaKey: o, area: s } = S(t, n), c = [];
271
+ return i.failed && c.push("problems"), a && c.push("access"), r || c.push("people"), {
272
+ id: t.id,
273
+ at: t.timestamp,
274
+ actorKey: r ? e : t.userId,
275
+ actorKind: r ? "service" : "person",
276
+ verb: i.verb,
277
+ object: i.object,
278
+ areaKey: o,
279
+ area: s,
280
+ tone: w(i, a),
281
+ failed: i.failed,
282
+ show: c
283
+ };
284
+ }
285
+ function E(e, t) {
286
+ return e.map((e) => T(e, t)).sort((e, t) => new Date(t.at).getTime() - new Date(e.at).getTime());
287
+ }
288
+ export { e as SYSTEM_ACTOR_KEY, m as isServiceActor, h as mutationFieldNames, g as splitWords, T as toActivitySentence, E as toActivitySentences, _ as withArticle };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The Invite people dialog's address box (BOFF-15736): people paste a list, from a spreadsheet,
3
+ * an email header or a chat, and every address in it becomes one invite.
4
+ */
5
+ export interface ParsedEmails {
6
+ /** The addresses to invite, lower-cased, each once, in the order typed. */
7
+ valid: string[];
8
+ /** What was typed that is not an address, as typed, each once. */
9
+ invalid: string[];
10
+ }
11
+ /** Splits the box's text into addresses: commas, semicolons, spaces and new lines all separate. */
12
+ export declare function parseEmailList(text: string): ParsedEmails;
@@ -0,0 +1,18 @@
1
+ // src/pages/v2/inviteEmails.ts
2
+ var e = /^[^\s@,;<>"]+@[^\s@,;<>"]+\.[^\s@,;<>".]{2,}$/, t = /<([^<>]*)>/;
3
+ function n(e) {
4
+ let n = t.exec(e);
5
+ return n ? [n[1] ?? ""] : e.split(/\s+/);
6
+ }
7
+ function r(t) {
8
+ let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
9
+ for (let a of t.split(/[,;\n\r]+/)) for (let t of n(a)) {
10
+ let n = t.trim().replace(/^mailto:/i, "");
11
+ n && (e.test(n) ? r.add(n.toLowerCase()) : i.add(n));
12
+ }
13
+ return {
14
+ valid: [...r],
15
+ invalid: [...i]
16
+ };
17
+ }
18
+ export { r as parseEmailList };
@@ -0,0 +1,54 @@
1
+ import { InvitationEmailStatus, InviteStatus } from '../../generated/wspace-types';
2
+ import { Translate } from './activitySentences';
3
+ export type MemberTab = 'active' | 'invited' | 'suspended';
4
+ export declare const MEMBER_TABS: readonly MemberTab[];
5
+ /** The page's `?tab=` value as a tab (the old Members links carry none). */
6
+ export declare function memberTabOf(value: string | null): MemberTab;
7
+ /** A suspended member is on the Suspended tab; everyone else (active, pending) on Active. */
8
+ export declare function memberStatusTab(status: string | null | undefined): 'active' | 'suspended';
9
+ /** The membership role the workspace service keeps, in words ("owner" → "Owner"). */
10
+ export declare function membershipRoleWord(role: string | null | undefined, tr: Translate): string;
11
+ /** One person's roles here, as People & access names them, from their active assignments. */
12
+ export interface ActorRoleAssignmentLike {
13
+ isActive: boolean;
14
+ role: {
15
+ name: string;
16
+ };
17
+ }
18
+ export declare function activeRoleNames(assignments: readonly ActorRoleAssignmentLike[] | undefined): string[];
19
+ /**
20
+ * The role words for a member: their access roles when People & access could be read, else the
21
+ * membership role (so a member who cannot read access still sees a role, never a blank).
22
+ */
23
+ export declare function memberRoleText(rbacRoles: readonly string[] | undefined, membershipRole: string | null | undefined, tr: Translate): string;
24
+ export interface MemberIdentitySource {
25
+ userId: string;
26
+ context?: {
27
+ metadata?: Record<string, unknown> | null;
28
+ } | null;
29
+ }
30
+ export interface ResolvedProfile {
31
+ displayName: string;
32
+ email?: string;
33
+ avatarUrl?: string;
34
+ resolved: boolean;
35
+ }
36
+ /** Who a member is: their profile's name and email, else what the membership remembers. */
37
+ export declare function memberIdentity(member: MemberIdentitySource, profile: ResolvedProfile | undefined, tr: Translate): {
38
+ name: string;
39
+ email: string | null;
40
+ avatarUrl: string | null;
41
+ };
42
+ /** What an invitation in the Invited tab is: waiting, expired, or its email bounced. */
43
+ export type InvitationState = 'waiting' | 'expired' | 'bounced';
44
+ export interface InvitationLike {
45
+ status: InviteStatus | `${InviteStatus}`;
46
+ expiresAt?: string | null;
47
+ emailStatus?: InvitationEmailStatus | `${InvitationEmailStatus}` | null;
48
+ }
49
+ /**
50
+ * The state the Invited tab shows, or null for invitations it leaves out (accepted, cancelled,
51
+ * declined: they are members now, or no longer invited). An email that could not be sent wins:
52
+ * the person never got it, whatever the date says.
53
+ */
54
+ export declare function invitationState(invitation: InvitationLike, now: Date): InvitationState | null;