@arbidocs/blocks 0.5.11 → 0.5.13
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/connect/index.cjs +103 -1
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +102 -4
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/projects/index.d.ts +1 -0
- package/dist/connection/projects/useProjectSummaries.d.ts +155 -0
- package/dist/databases/index.cjs +1 -1
- package/dist/databases/index.cjs.map +1 -1
- package/dist/databases/index.js +1 -1
- package/dist/databases/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
package/dist/connect/index.cjs
CHANGED
|
@@ -13330,7 +13330,7 @@ function WorkspaceCardsView({
|
|
|
13330
13330
|
ariaLabel: `Create ${workspaceLabel}`,
|
|
13331
13331
|
onSelect: () => onCreateWorkspace(),
|
|
13332
13332
|
disabledReason: createDisabledReason,
|
|
13333
|
-
help: `A ${workspaceLabel.toLowerCase()} holds the documents and conversations for one
|
|
13333
|
+
help: `A ${workspaceLabel.toLowerCase()} holds the documents and conversations for one piece of work.`,
|
|
13334
13334
|
testId: "create-workspace-card"
|
|
13335
13335
|
}
|
|
13336
13336
|
) });
|
|
@@ -13821,6 +13821,104 @@ function ConnectedProjectsPanel({
|
|
|
13821
13821
|
] });
|
|
13822
13822
|
return hostTabs ? panel : /* @__PURE__ */ jsxRuntime.jsx(chunkMB3S2ETI_cjs.ArbiHost, { config: localHost, children: panel });
|
|
13823
13823
|
}
|
|
13824
|
+
function workspaceSummary(w) {
|
|
13825
|
+
return {
|
|
13826
|
+
id: w.external_id,
|
|
13827
|
+
name: w.name,
|
|
13828
|
+
description: w.description ?? void 0,
|
|
13829
|
+
isPublic: !!w.is_public,
|
|
13830
|
+
documentCount: chunkJUUOJP7I_cjs.workspaceDocumentCount(w),
|
|
13831
|
+
conversationCount: chunkJUUOJP7I_cjs.workspaceConversationCount(w),
|
|
13832
|
+
memberCount: w.users?.length ?? 0,
|
|
13833
|
+
filesMb: w.user_files_mb ?? 0,
|
|
13834
|
+
updatedAt: w.updated_at
|
|
13835
|
+
};
|
|
13836
|
+
}
|
|
13837
|
+
function distinctMembers(workspaces) {
|
|
13838
|
+
const byId = /* @__PURE__ */ new Map();
|
|
13839
|
+
for (const w of workspaces) {
|
|
13840
|
+
for (const member of w.users ?? []) {
|
|
13841
|
+
const user = member.user;
|
|
13842
|
+
const id = user?.external_id;
|
|
13843
|
+
if (!id || byId.has(id)) continue;
|
|
13844
|
+
const name = [user.given_name, user.family_name].filter(Boolean).join(" ").trim();
|
|
13845
|
+
byId.set(id, {
|
|
13846
|
+
id,
|
|
13847
|
+
name: name || user.email || "Unknown",
|
|
13848
|
+
email: user.email ?? "",
|
|
13849
|
+
role: member.role ?? "member",
|
|
13850
|
+
isAgent: Boolean(member.agent_ext_id) || chunkJUUOJP7I_cjs.isAgentAccount(user)
|
|
13851
|
+
});
|
|
13852
|
+
}
|
|
13853
|
+
}
|
|
13854
|
+
return [...byId.values()];
|
|
13855
|
+
}
|
|
13856
|
+
function buildProjectSummaries(projects, workspaces) {
|
|
13857
|
+
const byProject = /* @__PURE__ */ new Map();
|
|
13858
|
+
for (const w of workspaces ?? []) {
|
|
13859
|
+
const id = w.project_ext_id;
|
|
13860
|
+
if (!id) continue;
|
|
13861
|
+
byProject.set(id, [...byProject.get(id) ?? [], w]);
|
|
13862
|
+
}
|
|
13863
|
+
const summaries = (projects ?? []).map((p) => {
|
|
13864
|
+
const own = byProject.get(p.external_id) ?? [];
|
|
13865
|
+
const storage = p.quotas?.storage_gb;
|
|
13866
|
+
const aiUsage = p.quotas?.ai_usage;
|
|
13867
|
+
const stats = chunkJUUOJP7I_cjs.workspaceGroupStats(own);
|
|
13868
|
+
return {
|
|
13869
|
+
id: p.external_id,
|
|
13870
|
+
name: p.name,
|
|
13871
|
+
createdAt: p.created_at,
|
|
13872
|
+
subscription: p.subscription ?? "none",
|
|
13873
|
+
workspaces: own.map(workspaceSummary),
|
|
13874
|
+
workspaceCount: own.length,
|
|
13875
|
+
documentCount: stats.documents,
|
|
13876
|
+
conversationCount: stats.conversations,
|
|
13877
|
+
members: distinctMembers(own),
|
|
13878
|
+
memberCount: stats.members,
|
|
13879
|
+
filesMb: own.reduce((sum, w) => sum + (w.user_files_mb ?? 0), 0),
|
|
13880
|
+
storageUsedGb: storage?.used ?? 0,
|
|
13881
|
+
storageLimitGb: storage?.limit ?? 0,
|
|
13882
|
+
aiUsageUsed: aiUsage?.used ?? 0,
|
|
13883
|
+
aiUsageLimit: aiUsage?.limit ?? 0,
|
|
13884
|
+
client: p.client ?? null,
|
|
13885
|
+
clientRef: p.client_ref ?? null,
|
|
13886
|
+
stage: p.stage ?? null,
|
|
13887
|
+
leadUser: p.lead_user ?? null,
|
|
13888
|
+
budget: p.budget ?? null,
|
|
13889
|
+
fields: p.fields ?? {}
|
|
13890
|
+
};
|
|
13891
|
+
});
|
|
13892
|
+
const work = (s) => s.documentCount + s.conversationCount;
|
|
13893
|
+
return summaries.sort((a, b) => work(b) - work(a));
|
|
13894
|
+
}
|
|
13895
|
+
function useProjectSummaries() {
|
|
13896
|
+
const projects = react.useProjects();
|
|
13897
|
+
const workspaces = react.useWorkspaces();
|
|
13898
|
+
const summaries = React7.useMemo(
|
|
13899
|
+
() => buildProjectSummaries(
|
|
13900
|
+
projects.data,
|
|
13901
|
+
workspaces.data
|
|
13902
|
+
),
|
|
13903
|
+
[projects.data, workspaces.data]
|
|
13904
|
+
);
|
|
13905
|
+
return {
|
|
13906
|
+
projects: summaries,
|
|
13907
|
+
isLoading: projects.isLoading || workspaces.isLoading,
|
|
13908
|
+
isError: projects.isError || workspaces.isError,
|
|
13909
|
+
error: projects.error ?? workspaces.error
|
|
13910
|
+
};
|
|
13911
|
+
}
|
|
13912
|
+
function useProjectSummary(projectId) {
|
|
13913
|
+
const { projects, isLoading, isError } = useProjectSummaries();
|
|
13914
|
+
const project = React7.useMemo(() => projects.find((p) => p.id === projectId), [projects, projectId]);
|
|
13915
|
+
const usage = react.useProjectUsage(projectId, 0, { enabled: !!projectId });
|
|
13916
|
+
return { project, usage: usage.data, usageLoading: usage.isLoading, isLoading, isError };
|
|
13917
|
+
}
|
|
13918
|
+
function primaryProjectWorkspace(project) {
|
|
13919
|
+
const work = (w) => w.documentCount + w.conversationCount;
|
|
13920
|
+
return [...project.workspaces].sort((a, b) => work(b) - work(a))[0];
|
|
13921
|
+
}
|
|
13824
13922
|
function RowsEditor({
|
|
13825
13923
|
label,
|
|
13826
13924
|
rows,
|
|
@@ -37208,6 +37306,7 @@ exports.accountSettingsSection = accountSettingsSection;
|
|
|
37208
37306
|
exports.backUpOnSignup = backUpOnSignup;
|
|
37209
37307
|
exports.bookingCancelLink = bookingCancelLink;
|
|
37210
37308
|
exports.buildNotificationCenterItems = buildNotificationCenterItems;
|
|
37309
|
+
exports.buildProjectSummaries = buildProjectSummaries;
|
|
37211
37310
|
exports.chatSettingsSection = chatSettingsSection;
|
|
37212
37311
|
exports.connectedAppsSettingsSection = connectedAppsSettingsSection;
|
|
37213
37312
|
exports.countNotificationTypes = countNotificationTypes;
|
|
@@ -37234,6 +37333,7 @@ exports.parseArbiCallUrl = parseArbiCallUrl;
|
|
|
37234
37333
|
exports.parseOAuthConsentRequest = parseOAuthConsentRequest;
|
|
37235
37334
|
exports.parseQuotaError = parseQuotaError;
|
|
37236
37335
|
exports.parseTypedSkill = parseTypedSkill;
|
|
37336
|
+
exports.primaryProjectWorkspace = primaryProjectWorkspace;
|
|
37237
37337
|
exports.privacySettingsSection = privacySettingsSection;
|
|
37238
37338
|
exports.renderSessionStatusIcon = renderSessionStatusIcon;
|
|
37239
37339
|
exports.requestProjectBillingFocus = requestProjectBillingFocus;
|
|
@@ -37285,6 +37385,8 @@ exports.useOpenWorkspaceIcon = useOpenWorkspaceIcon;
|
|
|
37285
37385
|
exports.usePendingFolders = usePendingFolders;
|
|
37286
37386
|
exports.usePendingTaskThread = usePendingTaskThread;
|
|
37287
37387
|
exports.useProjectBillingFocus = useProjectBillingFocus;
|
|
37388
|
+
exports.useProjectSummaries = useProjectSummaries;
|
|
37389
|
+
exports.useProjectSummary = useProjectSummary;
|
|
37288
37390
|
exports.useReferralReward = useReferralReward;
|
|
37289
37391
|
exports.useRenderTaskPerson = useRenderTaskPerson;
|
|
37290
37392
|
exports.useResolvedDocStatus = useResolvedDocStatus;
|