@arbidocs/blocks 0.5.138 → 0.5.140
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/{DocumentReviewCard-EM2AJUF3.cjs → DocumentReviewCard-QPFP7BV7.cjs} +12 -12
- package/dist/{DocumentReviewCard-EM2AJUF3.cjs.map → DocumentReviewCard-QPFP7BV7.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-IFF2JR2A.cjs → FilesViewerDialog-KBDKIQGD.cjs} +8 -8
- package/dist/{FilesViewerDialog-IFF2JR2A.cjs.map → FilesViewerDialog-KBDKIQGD.cjs.map} +1 -1
- package/dist/{chunk-VPKKPHJY.cjs → chunk-33GOYI3O.cjs} +4 -4
- package/dist/{chunk-VPKKPHJY.cjs.map → chunk-33GOYI3O.cjs.map} +1 -1
- package/dist/{chunk-IEAZX7L6.cjs → chunk-5Z22EXHJ.cjs} +2 -2
- package/dist/{chunk-IEAZX7L6.cjs.map → chunk-5Z22EXHJ.cjs.map} +1 -1
- package/dist/{chunk-BN33PC5F.cjs → chunk-C4Z6LOLA.cjs} +8 -8
- package/dist/{chunk-BN33PC5F.cjs.map → chunk-C4Z6LOLA.cjs.map} +1 -1
- package/dist/{chunk-MMKMQZ2B.cjs → chunk-CESE7GLT.cjs} +7 -7
- package/dist/{chunk-MMKMQZ2B.cjs.map → chunk-CESE7GLT.cjs.map} +1 -1
- package/dist/{chunk-VIUEPJ3Y.cjs → chunk-KP7BQIZL.cjs} +35 -35
- package/dist/{chunk-VIUEPJ3Y.cjs.map → chunk-KP7BQIZL.cjs.map} +1 -1
- package/dist/{chunk-JYZ6UE5X.cjs → chunk-MBXXWTKT.cjs} +28 -28
- package/dist/{chunk-JYZ6UE5X.cjs.map → chunk-MBXXWTKT.cjs.map} +1 -1
- package/dist/{chunk-5GHGIDZP.cjs → chunk-ORQXGMCC.cjs} +4 -4
- package/dist/{chunk-5GHGIDZP.cjs.map → chunk-ORQXGMCC.cjs.map} +1 -1
- package/dist/{chunk-LLD4PNBW.cjs → chunk-UD56Y6UA.cjs} +4 -4
- package/dist/{chunk-LLD4PNBW.cjs.map → chunk-UD56Y6UA.cjs.map} +1 -1
- package/dist/{chunk-ZN2JXV65.cjs → chunk-Z5YJKM57.cjs} +52 -52
- package/dist/{chunk-ZN2JXV65.cjs.map → chunk-Z5YJKM57.cjs.map} +1 -1
- package/dist/{chunk-FYFL3CET.cjs → chunk-ZPIZINH2.cjs} +7 -7
- package/dist/chunk-ZPIZINH2.cjs.map +1 -0
- package/dist/connect/index.cjs +442 -442
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +6 -6
- package/dist/connection/notification-center/NotificationEvent.js +1 -1
- package/dist/connection/notification-center/NotificationEvent.js.map +1 -1
- package/dist/embed/index.cjs +12 -12
- package/dist/files/folders/folderPaths.js +5 -5
- package/dist/files/folders/folderPaths.js.map +2 -2
- package/dist/files/index.cjs +222 -222
- package/dist/index.cjs +58 -58
- package/dist/vite/index.cjs +11 -10
- package/dist/vite/index.cjs.map +1 -1
- package/dist/vite/index.d.ts +4 -13
- package/dist/vite/index.js +11 -10
- package/dist/vite/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +13 -13
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-FYFL3CET.cjs.map +0 -1
package/dist/connect/viewer.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkZ5YJKM57_cjs = require('../chunk-Z5YJKM57.cjs');
|
|
5
5
|
require('../chunk-JITYC4OS.cjs');
|
|
6
6
|
require('../chunk-WVZLAAIZ.cjs');
|
|
7
7
|
require('../chunk-X7ALF4MP.cjs');
|
|
@@ -9,12 +9,12 @@ require('../chunk-4CIVQWAX.cjs');
|
|
|
9
9
|
var chunk57LUHZLV_cjs = require('../chunk-57LUHZLV.cjs');
|
|
10
10
|
require('../chunk-QWVUBTW3.cjs');
|
|
11
11
|
require('../chunk-JVEDKKNO.cjs');
|
|
12
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-UD56Y6UA.cjs');
|
|
13
13
|
require('../chunk-SK6LFIU2.cjs');
|
|
14
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-KP7BQIZL.cjs');
|
|
15
15
|
require('../chunk-C5APAFUY.cjs');
|
|
16
16
|
require('../chunk-HYUKPHCT.cjs');
|
|
17
|
-
require('../chunk-
|
|
17
|
+
require('../chunk-ZPIZINH2.cjs');
|
|
18
18
|
require('../chunk-223D4727.cjs');
|
|
19
19
|
require('../chunk-SNUBQMIS.cjs');
|
|
20
20
|
require('../chunk-FABKMTAI.cjs');
|
|
@@ -40,9 +40,9 @@ require('../chunk-WQMR3O2D.cjs');
|
|
|
40
40
|
require('../chunk-NZNBJF3M.cjs');
|
|
41
41
|
require('../chunk-NWNVWO6L.cjs');
|
|
42
42
|
require('../chunk-SK6HQ46Q.cjs');
|
|
43
|
+
require('../chunk-TG2GM7WJ.cjs');
|
|
43
44
|
require('../chunk-MNIQDXM6.cjs');
|
|
44
45
|
require('../chunk-T6WA6S5T.cjs');
|
|
45
|
-
require('../chunk-TG2GM7WJ.cjs');
|
|
46
46
|
require('../chunk-L62EU3TQ.cjs');
|
|
47
47
|
require('../chunk-OEJQFPWO.cjs');
|
|
48
48
|
require('../chunk-OYXWQTHF.cjs');
|
|
@@ -94,7 +94,7 @@ require('../chunk-PLIF5CUV.cjs');
|
|
|
94
94
|
|
|
95
95
|
Object.defineProperty(exports, "ConnectedDocumentViewer", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkZ5YJKM57_cjs.ConnectedDocumentViewer; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "ConnectedDocumentToolsProvider", {
|
|
100
100
|
enumerable: true,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
signatureNotificationPhrase,
|
|
18
18
|
signatureRequestMeta
|
|
19
19
|
} from "@arbidocs/react";
|
|
20
|
-
const ACTION_CLASS = "ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10";
|
|
20
|
+
const ACTION_CLASS = "relative ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']";
|
|
21
21
|
const PHRASE_CLASS = "min-w-0 shrink-[2] truncate text-sm";
|
|
22
22
|
function ActionButton({ label, onClick }) {
|
|
23
23
|
return /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/notification-center/NotificationEvent.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The Event cell of the notification centre: what happened, as a sentence around the people and\n * documents involved, with the action that opens it. A received notification reads from the\n * recipient's side (\"[Priya] mentioned you in a conversation\"), a sent one from the sender's\n * (\"You mentioned [Sam] in a conversation\"), a session-log entry as it was toasted.\n */\nimport type { ComponentType, ReactElement, ReactNode } from 'react'\nimport {\n BOX_SEAT_REFUSED,\n BOX_SEAT_REFUSED_TITLE,\n WORK_NOTIFICATION_LABELS,\n describeServerNotification,\n describeCalendarNotification,\n notificationUserName,\n documentActivityPhrase,\n getWorkspaceActionText,\n getWorkspaceSentPhrase,\n inputRequestTitle,\n isDeploymentUserNotification,\n isSignatureNotificationType,\n isWorkspaceNotificationType,\n signatureNotificationPhrase,\n signatureRequestMeta,\n type NotificationTarget,\n type SignatureNotificationType,\n} from '@arbidocs/react'\nimport type { NotificationCenterItem, NotificationRow } from './items'\n\nexport type NotificationUser = NotificationRow['sender']\n\nexport interface NotificationDocumentChipProps {\n documentId: string\n workspaceId?: string | null\n /** Open the document. */\n onOpen: () => void\n /** What to show when the document is not known here (its name is encrypted per workspace). */\n fallback: ReactNode\n}\n\n/** How the host draws people, workspaces and documents in the list. */\nexport interface NotificationCenterRenderers {\n /** A person's pill. */\n renderUser: (user: NotificationUser) => ReactNode\n /** A workspace's badge (the Category of a workspace's notification), or null when the host\n * does not know the workspace (the type's own category shows instead). */\n renderWorkspace: (workspaceId: string) => ReactNode | null\n /** A signature notification's document: its chip when known, else `fallback`. */\n DocumentChip: ComponentType<NotificationDocumentChipProps>\n}\n\nconst ACTION_CLASS =\n 'ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10'\nconst PHRASE_CLASS = 'min-w-0 shrink-[2] truncate text-sm'\n\nfunction ActionButton({ label, onClick }: { label: string; onClick: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick()\n }}\n className={ACTION_CLASS}\n data-testid=\"notification-action-button\"\n >\n {label}\n </button>\n )\n}\n\n/** \"[person] {phrase}\" \u2014 the row line most notifications are. */\nfunction PersonLine({ person, children }: { person: ReactNode; children: ReactNode }) {\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {person}\n {children}\n </div>\n )\n}\n\nfunction SignatureEvent({\n row,\n isIncoming,\n open,\n renderers,\n action,\n}: {\n row: NotificationRow\n isIncoming: boolean\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n /** The row's action (Review and sign), on the document's line. */\n action?: ReactNode\n}): ReactElement {\n const type = row.type as SignatureNotificationType\n const { lead, showPerson, verb, tail } = signatureNotificationPhrase(type, isIncoming)\n const { documentId } = signatureRequestMeta(row.content)\n const target = describeServerNotification(row)?.target\n const openIt = () => target && open(target)\n const { DocumentChip } = renderers\n const unnamed = (\n <>\n <span className=\"min-w-0 truncate text-sm\">\n {type === 'signature_requested' ? 'a document' : 'the document'}\n </span>\n </>\n )\n // Two short lines, so a narrow panel still shows who and which document: the person and what\n // they did, then the document and the action (beside both lines, it left the first one no room). The fixed wording gives way first; the person's name\n // never yields to it.\n const wording = 'min-w-0 shrink-[100] truncate text-sm'\n return (\n <div\n className=\"flex h-full min-w-0 flex-col justify-center gap-0.5 text-muted-foreground\"\n data-testid=\"notification-signature\"\n >\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {lead && <span className={wording}>{lead}</span>}\n {showPerson && (\n <span\n className=\"flex max-w-full min-w-0 shrink-0\"\n data-testid=\"notification-signature-person\"\n >\n {renderers.renderUser(isIncoming ? row.sender : row.recipient)}\n </span>\n )}\n {verb && <span className={wording}>{verb}</span>}\n </div>\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {documentId ? (\n <DocumentChip\n documentId={documentId}\n workspaceId={row.workspace_ext_id}\n onOpen={openIt}\n fallback={unnamed}\n />\n ) : (\n unnamed\n )}\n {tail && <span className={wording}>{tail.trim()}</span>}\n {action}\n </div>\n </div>\n )\n}\n\nfunction PersistedEvent({\n item,\n row,\n open,\n renderers,\n action,\n}: {\n item: NotificationCenterItem\n row: NotificationRow\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n action?: ReactNode\n}): ReactElement {\n const { sender, recipient } = row\n const type = row.type as string\n const isIncoming = item.kind === 'incoming'\n const user = renderers.renderUser\n\n if (type === 'file_shared') {\n const entry = describeServerNotification(row)\n return (\n <div className=\"flex h-full items-center gap-2 text-sm\">\n <span>{entry?.title}</span>\n </div>\n )\n }\n\n // Workspace membership, from the recipient's or sender's perspective.\n if (isWorkspaceNotificationType(type)) {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>{getWorkspaceActionText(type)}</span>\n </PersonLine>\n )\n const { before, after } = getWorkspaceSentPhrase(type)\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>{before}</span>\n {user(recipient)}\n {after && <span className={PHRASE_CLASS}>{after}</span>}\n </div>\n )\n }\n\n if (type === 'contact_accepted') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'accepted your invitation to join the platform'}\n </span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'Accepted an invitation to join the platform'}\n </span>\n </div>\n )\n }\n\n // A workspace access request: received, \"Review\" opens the grant flow.\n if (type === 'workspace_access_request') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>requested workspace access</span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>Requested workspace access from</span>\n {user(recipient)}\n </div>\n )\n }\n\n // A Box admin's notice: someone was invited or joined. Same sentence as the bell and toast,\n // with \"Manage users\" to the portal when the link is a trusted portal URL.\n if (isDeploymentUserNotification(type)) {\n const entry = describeServerNotification(row)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n data-testid=\"notification-deployment-user\"\n >\n <span className=\"min-w-0 truncate\" title={entry?.title}>\n {entry?.title}\n </span>\n </div>\n )\n }\n\n // Self-notifications: a refused Box seat, a signup bonus, a reward.\n const selfLine =\n type === BOX_SEAT_REFUSED\n ? BOX_SEAT_REFUSED_TITLE\n : type === 'signup_reward'\n ? `Signup bonus \u2014 ${row.content || 'You earned a signup bonus'}`\n : type === 'referral_reward'\n ? `Reward earned \u2014 ${row.content || 'You earned a reward'}`\n : null\n if (selfLine)\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n <span className=\"min-w-0 truncate\">{selfLine}</span>\n </div>\n )\n\n // An @mention: name the person and offer \"Open\" to jump to the message.\n if (type === 'mention' || type === 'docx_mention') {\n const inDocument = type === 'docx_mention'\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {!isIncoming && <span className=\"text-sm\">You mentioned</span>}\n {isIncoming ? user(sender) : user(recipient)}\n <span className={PHRASE_CLASS}>\n {inDocument\n ? isIncoming\n ? 'mentioned you in a document comment'\n : 'in a document comment'\n : isIncoming\n ? 'mentioned you in a conversation'\n : 'in a conversation'}\n </span>\n </div>\n )\n }\n\n // A reply in a thread you take part in, or a new version of a document you own. Only\n // received: nobody is sent their own.\n if (type === 'thread_reply' || type === 'document_activity') {\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-muted-foreground\"\n data-testid=\"notification-relevance\"\n >\n {user(sender)}\n <span className={PHRASE_CLASS}>\n {type === 'thread_reply' ? 'replied in a thread' : documentActivityPhrase(row.content)}\n </span>\n </div>\n )\n }\n\n if (isSignatureNotificationType(type))\n return (\n <SignatureEvent\n row={row}\n isIncoming={isIncoming}\n open={open}\n renderers={renderers}\n action={action}\n />\n )\n\n // Work notifications \u2014 a task is a conversation, so the notification links straight to it.\n const workLabel =\n type === 'agent_input_requested'\n ? inputRequestTitle(row.content)\n : WORK_NOTIFICATION_LABELS[type]\n if (workLabel)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n title={workLabel}\n data-testid=\"notification-work\"\n >\n <span className={`min-w-0 truncate ${type === 'workflow_failed' ? 'text-red-text' : ''}`}>\n {workLabel}\n </span>\n </div>\n )\n\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n {(\n describeCalendarNotification(row, { senderName: notificationUserName(row.sender) }) ??\n describeServerNotification(row)\n )?.title ??\n row.content ??\n type ??\n 'Notification'}\n </div>\n )\n}\n\n/** A session-log entry: its message as toasted (+ its action while this session lasts). */\nfunction SessionEvent({\n item,\n open,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n}): ReactElement | null {\n const entry = item.entry\n if (!entry) return null\n return (\n <div\n className=\"flex h-full items-center gap-2 text-sm text-muted-foreground\"\n title={entry.title}\n >\n {entry.html ? (\n <span className=\"min-w-0 truncate\" dangerouslySetInnerHTML={{ __html: entry.html }} />\n ) : (\n <span className=\"min-w-0 truncate\">{entry.title}</span>\n )}\n {(entry.onSelect || entry.href) && (\n <ActionButton\n label={entry.actionLabel ?? 'Open'}\n onClick={() => {\n if (entry.onSelect) entry.onSelect()\n else if (entry.href) open({ kind: 'url', url: entry.href })\n }}\n />\n )}\n </div>\n )\n}\n\nexport function NotificationEvent({\n item,\n open,\n renderers,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n}): ReactElement | null {\n if (!item.persisted) return <SessionEvent item={item} open={open} />\n if (!item.row) return null\n const described =\n describeCalendarNotification(item.row, { senderName: notificationUserName(item.row.sender) }) ??\n describeServerNotification(item.row)\n const action = described?.target && (\n <ActionButton label={described.actionLabel ?? 'Open'} onClick={() => open(described.target!)} />\n )\n // A signature event is two lines: its action goes on the document's line, so the first keeps the\n // room to say who asked and what.\n const ownLine = isSignatureNotificationType(item.row.type as string)\n return (\n <div className=\"flex h-full min-w-0 items-center gap-2\">\n <div className=\"min-w-0 flex-1\">\n <PersistedEvent\n item={item}\n row={item.row}\n open={open}\n renderers={renderers}\n action={ownLine ? action : undefined}\n />\n </div>\n {!ownLine && action}\n </div>\n )\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * The Event cell of the notification centre: what happened, as a sentence around the people and\n * documents involved, with the action that opens it. A received notification reads from the\n * recipient's side (\"[Priya] mentioned you in a conversation\"), a sent one from the sender's\n * (\"You mentioned [Sam] in a conversation\"), a session-log entry as it was toasted.\n */\nimport type { ComponentType, ReactElement, ReactNode } from 'react'\nimport {\n BOX_SEAT_REFUSED,\n BOX_SEAT_REFUSED_TITLE,\n WORK_NOTIFICATION_LABELS,\n describeServerNotification,\n describeCalendarNotification,\n notificationUserName,\n documentActivityPhrase,\n getWorkspaceActionText,\n getWorkspaceSentPhrase,\n inputRequestTitle,\n isDeploymentUserNotification,\n isSignatureNotificationType,\n isWorkspaceNotificationType,\n signatureNotificationPhrase,\n signatureRequestMeta,\n type NotificationTarget,\n type SignatureNotificationType,\n} from '@arbidocs/react'\nimport type { NotificationCenterItem, NotificationRow } from './items'\n\nexport type NotificationUser = NotificationRow['sender']\n\nexport interface NotificationDocumentChipProps {\n documentId: string\n workspaceId?: string | null\n /** Open the document. */\n onOpen: () => void\n /** What to show when the document is not known here (its name is encrypted per workspace). */\n fallback: ReactNode\n}\n\n/** How the host draws people, workspaces and documents in the list. */\nexport interface NotificationCenterRenderers {\n /** A person's pill. */\n renderUser: (user: NotificationUser) => ReactNode\n /** A workspace's badge (the Category of a workspace's notification), or null when the host\n * does not know the workspace (the type's own category shows instead). */\n renderWorkspace: (workspaceId: string) => ReactNode | null\n /** A signature notification's document: its chip when known, else `fallback`. */\n DocumentChip: ComponentType<NotificationDocumentChipProps>\n}\n\nconst ACTION_CLASS =\n \"relative ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\nconst PHRASE_CLASS = 'min-w-0 shrink-[2] truncate text-sm'\n\nfunction ActionButton({ label, onClick }: { label: string; onClick: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick()\n }}\n className={ACTION_CLASS}\n data-testid=\"notification-action-button\"\n >\n {label}\n </button>\n )\n}\n\n/** \"[person] {phrase}\" \u2014 the row line most notifications are. */\nfunction PersonLine({ person, children }: { person: ReactNode; children: ReactNode }) {\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {person}\n {children}\n </div>\n )\n}\n\nfunction SignatureEvent({\n row,\n isIncoming,\n open,\n renderers,\n action,\n}: {\n row: NotificationRow\n isIncoming: boolean\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n /** The row's action (Review and sign), on the document's line. */\n action?: ReactNode\n}): ReactElement {\n const type = row.type as SignatureNotificationType\n const { lead, showPerson, verb, tail } = signatureNotificationPhrase(type, isIncoming)\n const { documentId } = signatureRequestMeta(row.content)\n const target = describeServerNotification(row)?.target\n const openIt = () => target && open(target)\n const { DocumentChip } = renderers\n const unnamed = (\n <>\n <span className=\"min-w-0 truncate text-sm\">\n {type === 'signature_requested' ? 'a document' : 'the document'}\n </span>\n </>\n )\n // Two short lines, so a narrow panel still shows who and which document: the person and what\n // they did, then the document and the action (beside both lines, it left the first one no room). The fixed wording gives way first; the person's name\n // never yields to it.\n const wording = 'min-w-0 shrink-[100] truncate text-sm'\n return (\n <div\n className=\"flex h-full min-w-0 flex-col justify-center gap-0.5 text-muted-foreground\"\n data-testid=\"notification-signature\"\n >\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {lead && <span className={wording}>{lead}</span>}\n {showPerson && (\n <span\n className=\"flex max-w-full min-w-0 shrink-0\"\n data-testid=\"notification-signature-person\"\n >\n {renderers.renderUser(isIncoming ? row.sender : row.recipient)}\n </span>\n )}\n {verb && <span className={wording}>{verb}</span>}\n </div>\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {documentId ? (\n <DocumentChip\n documentId={documentId}\n workspaceId={row.workspace_ext_id}\n onOpen={openIt}\n fallback={unnamed}\n />\n ) : (\n unnamed\n )}\n {tail && <span className={wording}>{tail.trim()}</span>}\n {action}\n </div>\n </div>\n )\n}\n\nfunction PersistedEvent({\n item,\n row,\n open,\n renderers,\n action,\n}: {\n item: NotificationCenterItem\n row: NotificationRow\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n action?: ReactNode\n}): ReactElement {\n const { sender, recipient } = row\n const type = row.type as string\n const isIncoming = item.kind === 'incoming'\n const user = renderers.renderUser\n\n if (type === 'file_shared') {\n const entry = describeServerNotification(row)\n return (\n <div className=\"flex h-full items-center gap-2 text-sm\">\n <span>{entry?.title}</span>\n </div>\n )\n }\n\n // Workspace membership, from the recipient's or sender's perspective.\n if (isWorkspaceNotificationType(type)) {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>{getWorkspaceActionText(type)}</span>\n </PersonLine>\n )\n const { before, after } = getWorkspaceSentPhrase(type)\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>{before}</span>\n {user(recipient)}\n {after && <span className={PHRASE_CLASS}>{after}</span>}\n </div>\n )\n }\n\n if (type === 'contact_accepted') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'accepted your invitation to join the platform'}\n </span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'Accepted an invitation to join the platform'}\n </span>\n </div>\n )\n }\n\n // A workspace access request: received, \"Review\" opens the grant flow.\n if (type === 'workspace_access_request') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>requested workspace access</span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>Requested workspace access from</span>\n {user(recipient)}\n </div>\n )\n }\n\n // A Box admin's notice: someone was invited or joined. Same sentence as the bell and toast,\n // with \"Manage users\" to the portal when the link is a trusted portal URL.\n if (isDeploymentUserNotification(type)) {\n const entry = describeServerNotification(row)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n data-testid=\"notification-deployment-user\"\n >\n <span className=\"min-w-0 truncate\" title={entry?.title}>\n {entry?.title}\n </span>\n </div>\n )\n }\n\n // Self-notifications: a refused Box seat, a signup bonus, a reward.\n const selfLine =\n type === BOX_SEAT_REFUSED\n ? BOX_SEAT_REFUSED_TITLE\n : type === 'signup_reward'\n ? `Signup bonus \u2014 ${row.content || 'You earned a signup bonus'}`\n : type === 'referral_reward'\n ? `Reward earned \u2014 ${row.content || 'You earned a reward'}`\n : null\n if (selfLine)\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n <span className=\"min-w-0 truncate\">{selfLine}</span>\n </div>\n )\n\n // An @mention: name the person and offer \"Open\" to jump to the message.\n if (type === 'mention' || type === 'docx_mention') {\n const inDocument = type === 'docx_mention'\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {!isIncoming && <span className=\"text-sm\">You mentioned</span>}\n {isIncoming ? user(sender) : user(recipient)}\n <span className={PHRASE_CLASS}>\n {inDocument\n ? isIncoming\n ? 'mentioned you in a document comment'\n : 'in a document comment'\n : isIncoming\n ? 'mentioned you in a conversation'\n : 'in a conversation'}\n </span>\n </div>\n )\n }\n\n // A reply in a thread you take part in, or a new version of a document you own. Only\n // received: nobody is sent their own.\n if (type === 'thread_reply' || type === 'document_activity') {\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-muted-foreground\"\n data-testid=\"notification-relevance\"\n >\n {user(sender)}\n <span className={PHRASE_CLASS}>\n {type === 'thread_reply' ? 'replied in a thread' : documentActivityPhrase(row.content)}\n </span>\n </div>\n )\n }\n\n if (isSignatureNotificationType(type))\n return (\n <SignatureEvent\n row={row}\n isIncoming={isIncoming}\n open={open}\n renderers={renderers}\n action={action}\n />\n )\n\n // Work notifications \u2014 a task is a conversation, so the notification links straight to it.\n const workLabel =\n type === 'agent_input_requested'\n ? inputRequestTitle(row.content)\n : WORK_NOTIFICATION_LABELS[type]\n if (workLabel)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n title={workLabel}\n data-testid=\"notification-work\"\n >\n <span className={`min-w-0 truncate ${type === 'workflow_failed' ? 'text-red-text' : ''}`}>\n {workLabel}\n </span>\n </div>\n )\n\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n {(\n describeCalendarNotification(row, { senderName: notificationUserName(row.sender) }) ??\n describeServerNotification(row)\n )?.title ??\n row.content ??\n type ??\n 'Notification'}\n </div>\n )\n}\n\n/** A session-log entry: its message as toasted (+ its action while this session lasts). */\nfunction SessionEvent({\n item,\n open,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n}): ReactElement | null {\n const entry = item.entry\n if (!entry) return null\n return (\n <div\n className=\"flex h-full items-center gap-2 text-sm text-muted-foreground\"\n title={entry.title}\n >\n {entry.html ? (\n <span className=\"min-w-0 truncate\" dangerouslySetInnerHTML={{ __html: entry.html }} />\n ) : (\n <span className=\"min-w-0 truncate\">{entry.title}</span>\n )}\n {(entry.onSelect || entry.href) && (\n <ActionButton\n label={entry.actionLabel ?? 'Open'}\n onClick={() => {\n if (entry.onSelect) entry.onSelect()\n else if (entry.href) open({ kind: 'url', url: entry.href })\n }}\n />\n )}\n </div>\n )\n}\n\nexport function NotificationEvent({\n item,\n open,\n renderers,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n}): ReactElement | null {\n if (!item.persisted) return <SessionEvent item={item} open={open} />\n if (!item.row) return null\n const described =\n describeCalendarNotification(item.row, { senderName: notificationUserName(item.row.sender) }) ??\n describeServerNotification(item.row)\n const action = described?.target && (\n <ActionButton label={described.actionLabel ?? 'Open'} onClick={() => open(described.target!)} />\n )\n // A signature event is two lines: its action goes on the document's line, so the first keeps the\n // room to say who asked and what.\n const ownLine = isSignatureNotificationType(item.row.type as string)\n return (\n <div className=\"flex h-full min-w-0 items-center gap-2\">\n <div className=\"min-w-0 flex-1\">\n <PersistedEvent\n item={item}\n row={item.row}\n open={open}\n renderers={renderers}\n action={ownLine ? action : undefined}\n />\n </div>\n {!ownLine && action}\n </div>\n )\n}\n"],
|
|
5
5
|
"mappings": ";AAwDI,SA6CA,UA7CA,KAiBA,YAjBA;AAjDJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAyBP,MAA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B,MAAI,CAAC,KAAK,UAAW,QAAO,oBAAC,gBAAa,MAAY,MAAY;AAClE,MAAI,CAAC,KAAK,IAAK,QAAO;AACtB,QAAM,YACJ,6BAA6B,KAAK,KAAK,EAAE,YAAY,qBAAqB,KAAK,IAAI,MAAM,EAAE,CAAC,KAC5F,2BAA2B,KAAK,GAAG;AACrC,QAAM,SAAS,WAAW,UACxB,oBAAC,gBAAa,OAAO,UAAU,eAAe,QAAQ,SAAS,MAAM,KAAK,UAAU,MAAO,GAAG;AAIhG,QAAM,UAAU,4BAA4B,KAAK,IAAI,IAAc;AACnE,SACE,qBAAC,SAAI,WAAU,0CACb;AAAA,wBAAC,SAAI,WAAU,kBACb;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,KAAK,KAAK;AAAA,QACV;AAAA,QACA;AAAA,QACA,QAAQ,UAAU,SAAS;AAAA;AAAA,IAC7B,GACF;AAAA,IACC,CAAC,WAAW;AAAA,KACf;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/embed/index.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkC4Z6LOLA_cjs = require('../chunk-C4Z6LOLA.cjs');
|
|
5
5
|
require('../chunk-MEYQLQWS.cjs');
|
|
6
6
|
require('../chunk-TOYKBRAU.cjs');
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-ORQXGMCC.cjs');
|
|
8
|
+
require('../chunk-33GOYI3O.cjs');
|
|
9
9
|
require('../chunk-6CGMSJLB.cjs');
|
|
10
10
|
require('../chunk-TJY7XPDE.cjs');
|
|
11
11
|
require('../chunk-XNW62J54.cjs');
|
|
12
12
|
require('../chunk-SK6LFIU2.cjs');
|
|
13
|
-
require('../chunk-
|
|
13
|
+
require('../chunk-KP7BQIZL.cjs');
|
|
14
14
|
require('../chunk-C5APAFUY.cjs');
|
|
15
15
|
require('../chunk-HYUKPHCT.cjs');
|
|
16
|
-
require('../chunk-
|
|
16
|
+
require('../chunk-ZPIZINH2.cjs');
|
|
17
17
|
require('../chunk-223D4727.cjs');
|
|
18
18
|
require('../chunk-SNUBQMIS.cjs');
|
|
19
19
|
require('../chunk-OA3AN6WW.cjs');
|
|
@@ -28,8 +28,8 @@ require('../chunk-WQMR3O2D.cjs');
|
|
|
28
28
|
require('../chunk-NZNBJF3M.cjs');
|
|
29
29
|
require('../chunk-NWNVWO6L.cjs');
|
|
30
30
|
require('../chunk-SK6HQ46Q.cjs');
|
|
31
|
-
require('../chunk-T6WA6S5T.cjs');
|
|
32
31
|
require('../chunk-TG2GM7WJ.cjs');
|
|
32
|
+
require('../chunk-T6WA6S5T.cjs');
|
|
33
33
|
require('../chunk-OEJQFPWO.cjs');
|
|
34
34
|
require('../chunk-QFXOTJ6G.cjs');
|
|
35
35
|
require('../chunk-I4IS6ST6.cjs');
|
|
@@ -86,27 +86,27 @@ require('../chunk-PLIF5CUV.cjs');
|
|
|
86
86
|
|
|
87
87
|
Object.defineProperty(exports, "ArbiChat", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkC4Z6LOLA_cjs.ArbiChat; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "ConnectedCompactLogin", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkC4Z6LOLA_cjs.ConnectedCompactLogin; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "ConnectedEmbeddedChat", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkC4Z6LOLA_cjs.ConnectedEmbeddedChat; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "ConnectedLoginPage", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkC4Z6LOLA_cjs.ConnectedLoginPage; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "EmbeddedChatPanel", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkC4Z6LOLA_cjs.EmbeddedChatPanel; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "defaultHost", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkC4Z6LOLA_cjs.defaultHost; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "useConnection", {
|
|
112
112
|
enumerable: true,
|
|
@@ -29,6 +29,7 @@ function collectFolderDocs(documents, path) {
|
|
|
29
29
|
(doc) => isExplorerDocument(doc) && startsWithPath(parseFolderSegments(doc.folder), path)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
+
const NAME_COLLATOR = new Intl.Collator(void 0, { numeric: true, sensitivity: "base" });
|
|
32
33
|
function compareFiles(a, b, sort) {
|
|
33
34
|
switch (sort) {
|
|
34
35
|
case "date": {
|
|
@@ -41,10 +42,9 @@ function compareFiles(a, b, sort) {
|
|
|
41
42
|
}
|
|
42
43
|
case "name":
|
|
43
44
|
default:
|
|
44
|
-
return
|
|
45
|
-
getDocumentTitle(
|
|
46
|
-
|
|
47
|
-
{ numeric: true, sensitivity: "base" }
|
|
45
|
+
return NAME_COLLATOR.compare(
|
|
46
|
+
getDocumentTitle(a, a.file_name ?? ""),
|
|
47
|
+
getDocumentTitle(b, b.file_name ?? "")
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -76,7 +76,7 @@ function buildExplorerEntries(documents, currentPath, sort = "name", pendingFold
|
|
|
76
76
|
name,
|
|
77
77
|
path: [...currentPath, name],
|
|
78
78
|
count: folderCounts.get(name) ?? 0
|
|
79
|
-
})).sort((a, b) => a.name
|
|
79
|
+
})).sort((a, b) => NAME_COLLATOR.compare(a.name, b.name));
|
|
80
80
|
files.sort((a, b) => compareFiles(a, b, sort));
|
|
81
81
|
return { folders, files };
|
|
82
82
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/files/folders/folderPaths.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Pure helpers that turn the flat document list into a navigable folder tree.\n *\n * Folders are not a backend entity \u2014 each document carries a slash-separated\n * `folder` path string (e.g. `\"Reports/Q1\"`, or `null`/`\"\"` for the root).\n * These helpers derive, for a given path, the immediate sub-folders (with\n * descendant counts) and the files that live directly in that folder. Kept\n * pure and side-effect-free so the navigation logic is unit-testable.\n */\n\nimport { extensionFromMime, getDocumentTitle, getFileExtension } from '@arbidocs/react/ui'\n\n/** The fields of a document the folder view reads. */\nexport interface FolderDocument {\n external_id: string\n file_name?: string | null\n file_type?: string | null\n file_size?: number | null\n folder?: string | null\n parent_ext_id?: string | null\n created_at?: string | null\n doc_metadata?: { title?: string | null } | null\n}\n\nexport interface ExplorerFolder {\n kind: 'folder'\n /** The folder's own name (last path segment). */\n name: string\n /** Full path segments from the root, including this folder. */\n path: string[]\n /** Number of documents anywhere beneath this folder. */\n count: number\n}\n\nexport interface ExplorerFile<D extends FolderDocument = FolderDocument> {\n kind: 'file'\n doc: D\n}\n\nexport type ExplorerEntry<D extends FolderDocument = FolderDocument> =\n ExplorerFolder | ExplorerFile<D>\n\nexport type ExplorerSort = 'name' | 'date' | 'size'\n\n/**\n * Display name for a document in the explorer, with its real file extension \u2014\n * the familiar \"Report.pdf\" form. Many documents store an AI-generated display\n * title that drops the extension, so we re-attach it from the stored\n * `file_name` or, failing that, the MIME `file_type`.\n */\nexport function getExplorerDisplayName(doc: FolderDocument): string {\n const title = getDocumentTitle(doc, doc.file_name ?? 'Untitled')\n // Already carries an extension \u2192 trust it.\n if (getFileExtension(title)) return title\n const ext = getFileExtension(doc.file_name) || extensionFromMime(doc.file_type)\n return ext ? `${title}.${ext}` : title\n}\n\n/** Split a `Doc.folder` value into trimmed, non-empty path segments. */\nexport function parseFolderSegments(folder?: string | null): string[] {\n if (!folder) return []\n return folder\n .split('/')\n .map((segment) => segment.trim())\n .filter(Boolean)\n}\n\n/** Join path segments back into a canonical `Doc.folder` string (or null at root). */\nexport function joinFolderPath(segments: string[]): string | null {\n return segments.length > 0 ? segments.join('/') : null\n}\n\n/** True when `segments` starts with every segment of `prefix`. */\nfunction startsWithPath(segments: string[], prefix: string[]): boolean {\n if (segments.length < prefix.length) return false\n for (let i = 0; i < prefix.length; i++) {\n if (segments[i] !== prefix[i]) return false\n }\n return true\n}\n\n/**\n * A document is shown in the explorer unless it belongs to an email family:\n * attachments and archived messages (`parent_ext_id` set) live \"inside\" their\n * email / archive and would otherwise clutter the folder view. Versions are not\n * children \u2014 the list holds each document's current version only.\n */\nexport function isExplorerDocument(doc: FolderDocument): boolean {\n return !doc.parent_ext_id\n}\n\n/**\n * Every explorer document that lives anywhere beneath `path` (directly in the\n * folder or in a sub-folder). Used to expand a folder into the documents a\n * folder-level action (select / move / download / delete / rename) applies to \u2014\n * \"act on a folder\" means \"act on everything in it\".\n */\nexport function collectFolderDocs<D extends FolderDocument>(documents: D[], path: string[]): D[] {\n if (path.length === 0) return documents.filter(isExplorerDocument)\n return documents.filter(\n (doc) => isExplorerDocument(doc) && startsWithPath(parseFolderSegments(doc.folder), path)\n )\n}\n\nfunction compareFiles(a: FolderDocument, b: FolderDocument, sort: ExplorerSort): number {\n switch (sort) {\n case 'date': {\n // Newest first.\n const at = a.created_at ? Date.parse(a.created_at) : 0\n const bt = b.created_at ? Date.parse(b.created_at) : 0\n return bt - at\n }\n case 'size': {\n // Largest first.\n return (b.file_size ?? 0) - (a.file_size ?? 0)\n }\n case 'name':\n default:\n return getDocumentTitle(a, a.file_name ?? '')
|
|
5
|
-
"mappings": ";AAUA,SAAS,mBAAmB,kBAAkB,wBAAwB;AAwC/D,SAAS,uBAAuB,KAA6B;AAClE,QAAM,QAAQ,iBAAiB,KAAK,IAAI,aAAa,UAAU;AAE/D,MAAI,iBAAiB,KAAK,EAAG,QAAO;AACpC,QAAM,MAAM,iBAAiB,IAAI,SAAS,KAAK,kBAAkB,IAAI,SAAS;AAC9E,SAAO,MAAM,GAAG,KAAK,IAAI,GAAG,KAAK;AACnC;AAGO,SAAS,oBAAoB,QAAkC;AACpE,MAAI,CAAC,OAAQ,QAAO,CAAC;AACrB,SAAO,OACJ,MAAM,GAAG,EACT,IAAI,CAAC,YAAY,QAAQ,KAAK,CAAC,EAC/B,OAAO,OAAO;AACnB;AAGO,SAAS,eAAe,UAAmC;AAChE,SAAO,SAAS,SAAS,IAAI,SAAS,KAAK,GAAG,IAAI;AACpD;AAGA,SAAS,eAAe,UAAoB,QAA2B;AACrE,MAAI,SAAS,SAAS,OAAO,OAAQ,QAAO;AAC5C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,QAAI,SAAS,CAAC,MAAM,OAAO,CAAC,EAAG,QAAO;AAAA,EACxC;AACA,SAAO;AACT;AAQO,SAAS,mBAAmB,KAA8B;AAC/D,SAAO,CAAC,IAAI;AACd;AAQO,SAAS,kBAA4C,WAAgB,MAAqB;AAC/F,MAAI,KAAK,WAAW,EAAG,QAAO,UAAU,OAAO,kBAAkB;AACjE,SAAO,UAAU;AAAA,IACf,CAAC,QAAQ,mBAAmB,GAAG,KAAK,eAAe,oBAAoB,IAAI,MAAM,GAAG,IAAI;AAAA,EAC1F;AACF;
|
|
4
|
+
"sourcesContent": ["/**\n * Pure helpers that turn the flat document list into a navigable folder tree.\n *\n * Folders are not a backend entity \u2014 each document carries a slash-separated\n * `folder` path string (e.g. `\"Reports/Q1\"`, or `null`/`\"\"` for the root).\n * These helpers derive, for a given path, the immediate sub-folders (with\n * descendant counts) and the files that live directly in that folder. Kept\n * pure and side-effect-free so the navigation logic is unit-testable.\n */\n\nimport { extensionFromMime, getDocumentTitle, getFileExtension } from '@arbidocs/react/ui'\n\n/** The fields of a document the folder view reads. */\nexport interface FolderDocument {\n external_id: string\n file_name?: string | null\n file_type?: string | null\n file_size?: number | null\n folder?: string | null\n parent_ext_id?: string | null\n created_at?: string | null\n doc_metadata?: { title?: string | null } | null\n}\n\nexport interface ExplorerFolder {\n kind: 'folder'\n /** The folder's own name (last path segment). */\n name: string\n /** Full path segments from the root, including this folder. */\n path: string[]\n /** Number of documents anywhere beneath this folder. */\n count: number\n}\n\nexport interface ExplorerFile<D extends FolderDocument = FolderDocument> {\n kind: 'file'\n doc: D\n}\n\nexport type ExplorerEntry<D extends FolderDocument = FolderDocument> =\n ExplorerFolder | ExplorerFile<D>\n\nexport type ExplorerSort = 'name' | 'date' | 'size'\n\n/**\n * Display name for a document in the explorer, with its real file extension \u2014\n * the familiar \"Report.pdf\" form. Many documents store an AI-generated display\n * title that drops the extension, so we re-attach it from the stored\n * `file_name` or, failing that, the MIME `file_type`.\n */\nexport function getExplorerDisplayName(doc: FolderDocument): string {\n const title = getDocumentTitle(doc, doc.file_name ?? 'Untitled')\n // Already carries an extension \u2192 trust it.\n if (getFileExtension(title)) return title\n const ext = getFileExtension(doc.file_name) || extensionFromMime(doc.file_type)\n return ext ? `${title}.${ext}` : title\n}\n\n/** Split a `Doc.folder` value into trimmed, non-empty path segments. */\nexport function parseFolderSegments(folder?: string | null): string[] {\n if (!folder) return []\n return folder\n .split('/')\n .map((segment) => segment.trim())\n .filter(Boolean)\n}\n\n/** Join path segments back into a canonical `Doc.folder` string (or null at root). */\nexport function joinFolderPath(segments: string[]): string | null {\n return segments.length > 0 ? segments.join('/') : null\n}\n\n/** True when `segments` starts with every segment of `prefix`. */\nfunction startsWithPath(segments: string[], prefix: string[]): boolean {\n if (segments.length < prefix.length) return false\n for (let i = 0; i < prefix.length; i++) {\n if (segments[i] !== prefix[i]) return false\n }\n return true\n}\n\n/**\n * A document is shown in the explorer unless it belongs to an email family:\n * attachments and archived messages (`parent_ext_id` set) live \"inside\" their\n * email / archive and would otherwise clutter the folder view. Versions are not\n * children \u2014 the list holds each document's current version only.\n */\nexport function isExplorerDocument(doc: FolderDocument): boolean {\n return !doc.parent_ext_id\n}\n\n/**\n * Every explorer document that lives anywhere beneath `path` (directly in the\n * folder or in a sub-folder). Used to expand a folder into the documents a\n * folder-level action (select / move / download / delete / rename) applies to \u2014\n * \"act on a folder\" means \"act on everything in it\".\n */\nexport function collectFolderDocs<D extends FolderDocument>(documents: D[], path: string[]): D[] {\n if (path.length === 0) return documents.filter(isExplorerDocument)\n return documents.filter(\n (doc) => isExplorerDocument(doc) && startsWithPath(parseFolderSegments(doc.folder), path)\n )\n}\n\n// One collator for every comparison: `localeCompare` with options builds one per call, which\n// dominated re-sorting a large folder.\nconst NAME_COLLATOR = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })\n\nfunction compareFiles(a: FolderDocument, b: FolderDocument, sort: ExplorerSort): number {\n switch (sort) {\n case 'date': {\n // Newest first.\n const at = a.created_at ? Date.parse(a.created_at) : 0\n const bt = b.created_at ? Date.parse(b.created_at) : 0\n return bt - at\n }\n case 'size': {\n // Largest first.\n return (b.file_size ?? 0) - (a.file_size ?? 0)\n }\n case 'name':\n default:\n return NAME_COLLATOR.compare(\n getDocumentTitle(a, a.file_name ?? ''),\n getDocumentTitle(b, b.file_name ?? '')\n )\n }\n}\n\n/**\n * Documents in the order the gallery shows them for a sort choice (and its\n * direction toggle). Review mode steps through this same order.\n */\nexport function sortExplorerFiles<D extends FolderDocument>(\n docs: D[],\n sort: ExplorerSort,\n reversed = false\n): D[] {\n const sorted = [...docs].sort((a, b) => compareFiles(a, b, sort))\n return reversed ? sorted.reverse() : sorted\n}\n\n/**\n * Build the folders and files that live directly under `currentPath`.\n *\n * - Files: documents whose folder path exactly equals `currentPath`.\n * - Folders: the distinct next path segment of any document nested deeper than\n * `currentPath`, with `count` = number of documents beneath it.\n *\n * Folders are always sorted by name; files by the requested sort.\n */\nexport function buildExplorerEntries<D extends FolderDocument>(\n documents: D[],\n currentPath: string[],\n sort: ExplorerSort = 'name',\n pendingFolders: string[] = []\n): { folders: ExplorerFolder[]; files: D[] } {\n const folderCounts = new Map<string, number>()\n const files: D[] = []\n\n for (const doc of documents) {\n const segments = parseFolderSegments(doc.folder)\n if (!startsWithPath(segments, currentPath)) continue\n\n if (segments.length === currentPath.length) {\n files.push(doc)\n } else {\n const childName = segments[currentPath.length]\n folderCounts.set(childName, (folderCounts.get(childName) ?? 0) + 1)\n }\n }\n\n // Placeholder (empty) folders the user created that live directly under the\n // current path \u2014 surfaced with count 0 so the UI can render them faded. A\n // pending folder that has since gained documents already appears above.\n const childNames = new Set(folderCounts.keys())\n for (const pending of pendingFolders) {\n const segments = parseFolderSegments(pending)\n if (!startsWithPath(segments, currentPath)) continue\n if (segments.length > currentPath.length) childNames.add(segments[currentPath.length])\n }\n\n const folders: ExplorerFolder[] = Array.from(childNames)\n .map((name) => ({\n kind: 'folder' as const,\n name,\n path: [...currentPath, name],\n count: folderCounts.get(name) ?? 0,\n }))\n .sort((a, b) => NAME_COLLATOR.compare(a.name, b.name))\n\n files.sort((a, b) => compareFiles(a, b, sort))\n\n return { folders, files }\n}\n\n/**\n * Flat, cross-folder search over every top-level document by title / file name.\n * Used when the explorer search box is non-empty (mirrors real file explorers,\n * which flatten results and ignore the current folder while searching).\n */\nexport function searchExplorerDocuments<D extends FolderDocument>(\n documents: D[],\n query: string,\n sort: ExplorerSort = 'name'\n): D[] {\n const needle = query.trim().toLowerCase()\n if (!needle) return []\n return documents\n .filter((doc) => {\n if (!isExplorerDocument(doc)) return false\n const title = getDocumentTitle(doc, doc.file_name ?? '').toLowerCase()\n const name = (doc.file_name ?? '').toLowerCase()\n return title.includes(needle) || name.includes(needle)\n })\n .sort((a, b) => compareFiles(a, b, sort))\n}\n"],
|
|
5
|
+
"mappings": ";AAUA,SAAS,mBAAmB,kBAAkB,wBAAwB;AAwC/D,SAAS,uBAAuB,KAA6B;AAClE,QAAM,QAAQ,iBAAiB,KAAK,IAAI,aAAa,UAAU;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