@arbidocs/react 0.5.153 → 0.5.155

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 (43) hide show
  1. package/dist/artifacts/index.cjs +46 -46
  2. package/dist/calls/livekit/index.cjs +51 -51
  3. package/dist/{chunk-DBWW6DXJ.cjs → chunk-6RRKO4ZK.cjs} +5 -5
  4. package/dist/{chunk-DBWW6DXJ.cjs.map → chunk-6RRKO4ZK.cjs.map} +1 -1
  5. package/dist/{chunk-NJWQPNGD.cjs → chunk-6TJL4Z2F.cjs} +14 -14
  6. package/dist/{chunk-NJWQPNGD.cjs.map → chunk-6TJL4Z2F.cjs.map} +1 -1
  7. package/dist/{chunk-BUMLF3MS.cjs → chunk-FQ2PSM75.cjs} +60 -60
  8. package/dist/{chunk-BUMLF3MS.cjs.map → chunk-FQ2PSM75.cjs.map} +1 -1
  9. package/dist/{chunk-DQODLWFX.cjs → chunk-KULS4YWP.cjs} +3 -3
  10. package/dist/{chunk-DQODLWFX.cjs.map → chunk-KULS4YWP.cjs.map} +1 -1
  11. package/dist/{chunk-HISGJISX.cjs → chunk-PI3PEXQW.cjs} +67 -67
  12. package/dist/{chunk-HISGJISX.cjs.map → chunk-PI3PEXQW.cjs.map} +1 -1
  13. package/dist/{chunk-WWGUGZZN.cjs → chunk-QV7KINWC.cjs} +39 -39
  14. package/dist/{chunk-WWGUGZZN.cjs.map → chunk-QV7KINWC.cjs.map} +1 -1
  15. package/dist/{chunk-4VHECR5O.cjs → chunk-V5WCKJEH.cjs} +44 -44
  16. package/dist/{chunk-4VHECR5O.cjs.map → chunk-V5WCKJEH.cjs.map} +1 -1
  17. package/dist/{chunk-XQLJSNAL.cjs → chunk-WJIRX5MS.cjs} +3 -3
  18. package/dist/{chunk-XQLJSNAL.cjs.map → chunk-WJIRX5MS.cjs.map} +1 -1
  19. package/dist/{chunk-5ZNO77YB.cjs → chunk-ZZBCZRA5.cjs} +4 -2
  20. package/dist/chunk-ZZBCZRA5.cjs.map +1 -0
  21. package/dist/datasets/index.js +5 -1
  22. package/dist/datasets/index.js.map +2 -2
  23. package/dist/datasets/pages.js +70 -7
  24. package/dist/datasets/pages.js.map +2 -2
  25. package/dist/document-tools/core.cjs +102 -102
  26. package/dist/document-tools/core.d.ts +2 -2
  27. package/dist/document-tools/index.cjs +104 -104
  28. package/dist/document-tools/index.d.ts +2 -2
  29. package/dist/{file-shares.d-CyTnJ2Re.d.ts → file-shares.d-Bwy9k3Db.d.ts} +2 -0
  30. package/dist/index.cjs +2455 -2355
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.ts +93 -8
  33. package/dist/query-keys.js +2 -0
  34. package/dist/query-keys.js.map +2 -2
  35. package/dist/shell/index.cjs +40 -40
  36. package/dist/ui/index.cjs +181 -181
  37. package/dist/viewers/index.cjs +9 -9
  38. package/dist/workspaces/index.js +8 -0
  39. package/dist/workspaces/index.js.map +2 -2
  40. package/dist/workspaces/transfer.js +38 -0
  41. package/dist/workspaces/transfer.js.map +2 -2
  42. package/package.json +3 -3
  43. package/dist/chunk-5ZNO77YB.cjs.map +0 -1
@@ -85,6 +85,8 @@ var arbiQueryKeys = {
85
85
  workspaceTransfers: (workspaceId) => ["arbi", "workspaceTransfers", "list", workspaceId],
86
86
  /** One transfer job's progress. */
87
87
  workspaceTransfer: (transferId) => ["arbi", "workspaceTransfers", "job", transferId],
88
+ /** One job's full ledger (read once it has finished). */
89
+ workspaceTransferItems: (transferId) => ["arbi", "workspaceTransfers", "items", transferId],
88
90
  /** What a scope (serialised) would take in a workspace, for a mode. */
89
91
  workspaceTransferPlan: (workspaceId, scope, mode) => ["arbi", "workspaceTransfers", "plan", workspaceId, scope, mode],
90
92
  /**
@@ -379,5 +381,5 @@ exports.mailQueryKeys = mailQueryKeys;
379
381
  exports.useArbi = useArbi;
380
382
  exports.useArbiHost = useArbiHost;
381
383
  exports.useDeploymentDomain = useDeploymentDomain;
382
- //# sourceMappingURL=chunk-5ZNO77YB.cjs.map
383
- //# sourceMappingURL=chunk-5ZNO77YB.cjs.map
384
+ //# sourceMappingURL=chunk-ZZBCZRA5.cjs.map
385
+ //# sourceMappingURL=chunk-ZZBCZRA5.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/host/config.ts","../src/useArbi.ts","../src/query-keys.ts"],"names":["useContext","ArbiHostContext"],"mappings":";;;;;AA4HO,SAAS,WAAA,GAA8B;AAC5C,EAAA,OAAOA,iBAAWC,iCAAe,CAAA;AACnC;;;ACvHO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,WAAA,EAAY;AAC7B,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,0DAA0D,CAAA;AAAA,EAC5E;AACA,EAAA,OAAO,IAAA;AACT;AAOO,SAAS,mBAAA,GAA0C;AACxD,EAAA,OAAO,WAAA,EAAY,CAAE,IAAA,EAAM,mBAAA,EAAoB;AACjD;;;ACNO,IAAM,aAAA,GAAgB;AAAA,EAC3B,UAAA,EAAY,MAAM,CAAC,MAAA,EAAQ,YAAY,CAAA;AAAA,EACvC,WAAW,CAAC,EAAA,KAAe,CAAC,MAAA,EAAQ,aAAa,EAAE,CAAA;AAAA,EACnD,YAAA,EAAc,CAAC,EAAA,EAAY,MAAA,KAAoB,CAAC,MAAA,EAAQ,cAAA,EAAgB,IAAI,MAAM,CAAA;AAAA,EAClF,UAAA,EAAY,MAAM,CAAC,MAAA,EAAQ,YAAY,CAAA;AAAA;AAAA,EAEvC,iBAAA,EAAmB,MAAM,CAAC,MAAA,EAAQ,gBAAgB,CAAA;AAAA,EAClD,gBAAgB,CAAC,WAAA,KAAwB,CAAC,MAAA,EAAQ,kBAAkB,WAAW,CAAA;AAAA;AAAA,EAE/E,YAAA,EAAc,MAAM,CAAC,MAAA,EAAQ,WAAW,CAAA;AAAA,EACxC,WAAW,CAAC,WAAA,KAAwB,CAAC,MAAA,EAAQ,aAAa,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file":"chunk-ZZBCZRA5.cjs","sourcesContent":["/**\n * What a host hands the `@arbidocs/react` hooks, as one configuration (`<ArbiHost config>`). Every\n * field is optional: without one the hooks use their own default. `@arbidocs/blocks` extends it\n * with the blocks domains (environment, billing, viewer, …).\n *\n * A field whose value lives in the host's state is a hook (`use…`), called by the hooks and kits\n * that need it, so the configuration itself stays one stable object for the host's life.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport type { AccountClient } from '../account/client'\nimport type { CalendarSupport } from '../calendar/support'\nimport type { MeetingChatRef } from '../calls/meeting-chat'\nimport type { ActiveCall } from '../calls/session'\nimport type { ArbiChatHost } from '../chat/host'\nimport type { DocumentsSupport } from '../documents/support'\nimport type { MailClient } from '../mail/client'\nimport type { ArbiSessionStore } from '../session/store'\nimport type { DictateContextValue } from '../ui/DictateContext'\nimport type { EntityVocabulary } from '../entities/vocabulary'\nimport type { ArbiHostConnection } from './ArbiHost'\nimport type { ArbiFeatures } from './features'\nimport { ArbiHostContext } from './context'\nimport type { DashboardsHost } from '../datasets/registry'\n\n/** The mail client, and whether mail is on for the signed-in user. */\nexport interface MailHost {\n client: MailClient\n /**\n * Whether mail reads run (signed in and entitled), and the server session the mailbox is\n * unlocked for: unlocking runs again when it changes (`null`: none yet, nothing is unlocked).\n * Absent: on, for one session.\n */\n useStatus?: () => { enabled: boolean; sessionKey: string | null }\n /**\n * The mail waiting in this device's Outbox (written offline), by status, while `enabled` (Mail\n * switched on); the offline status counts it as waiting work. Absent: no Outbox.\n */\n useOutbox?: (enabled: boolean) => ReadonlyArray<{ status: string }>\n /** The Outbox's folder, opened through `openMail({ folder })`. */\n outboxFolder?: string\n}\n\n/** The account client of the settings kits, and whether account reads run (signed in). */\nexport interface AccountHost {\n client: AccountClient\n /** Absent: always. */\n useEnabled?: () => boolean\n}\n\n/** Where the call panel goes in the host's layout. */\nexport type CallSlotMode = 'docked' | 'main'\n\n/** What the calls need from the host: navigation and layout are the host's. */\nexport interface CallsHost {\n /**\n * Show a call's meeting chat: an end-to-end chat, or a workspace meeting thread. Absent: the\n * in-call \"Open meeting chat\" does nothing.\n */\n openMeetingChat?: (ref: MeetingChatRef) => void\n /**\n * Once connected, show the call's conversation (its chat and live transcript) beside the call.\n * Absent: nothing is shown.\n */\n showConversation?: (call: ActiveCall) => void | Promise<void>\n /**\n * The element whose box the shown call fills: the right-hand dock, or (a webinar's audience) the\n * main area. The host claims its slot while `shown` and calls `onLost` when another panel takes\n * it (the call then minimises). Absent: the call floats at the right edge.\n */\n useSlot?: (mode: CallSlotMode, shown: boolean, onLost: () => void) => HTMLElement | null\n}\n\nexport interface ArbiHostConfig {\n /**\n * The SDK on the signed-in session. A host with its own login passes one on its session\n * (`new Arbi({ url, session })`); a blocks-only site gets one from `defaultHost`. A new instance (a\n * new session, a newly opened workspace) re-renders every hook.\n */\n arbi?: Arbi\n /** The session state the kits share. Absent: an in-memory one per top-level host. */\n session?: ArbiSessionStore\n /** Live processing, uploads and the host's document actions. Absent: the package's own. */\n documents?: DocumentsSupport\n /** The calendar kept on this device and account OAuth. Absent: online only, the user's connectors. */\n calendar?: CalendarSupport\n /** Absent: mail on the `arbi` session. */\n mail?: MailHost\n /** Absent: the account on the `arbi` session. */\n account?: AccountHost\n /** Absent: calls open no meeting chat from the room. */\n calls?: CallsHost\n /**\n * The parts of the product the user switches on or off, and where each switch is kept (the user's\n * settings, or this device), read with `useFeature(name)`. The call UI also follows the `calls`\n * feature, on top of the server's calls config. Absent, or a feature not listed: on.\n */\n features?: ArbiFeatures\n /** Dictation for every `dictate` field. Absent: no mic button. */\n dictate?: DictateContextValue\n /** The sign-in layer of a blocks-only site (`defaultHost` in `@arbidocs/blocks/connect`). */\n connection?: ArbiHostConnection\n /** Where the chat engine's side effects go (documents shown, mail drafts, used-up quota). */\n chat?: ArbiChatHost\n /**\n * The site's words for the entities (`{ PROJECT: 'Matter' }`), read by every kit through\n * `getEntityLabel`. Absent: the registry's (\"Project\", \"Workspace\", \"Thread\", …).\n */\n vocabulary?: EntityVocabulary\n /**\n * What the site calls its assistant where people address it: the `@<name>` offered in a chat's\n * mention menu, the draft a shared thread starts with, and the name a message is routed to the\n * assistant on. Absent: \"ARBI\".\n */\n assistantName?: string\n /**\n * Charts and dashboards: more data sources (an external feed, a source relabelled in the site's\n * words). Pages themselves are the workspace's (`/v1/pages`). Absent: the built-in sources.\n */\n dashboards?: DashboardsHost\n}\n\n/** The host configuration in scope (`{}` outside an `<ArbiHost>`). */\nexport function useArbiHost(): ArbiHostConfig {\n return useContext(ArbiHostContext) as ArbiHostConfig\n}\n","/**\n * The `Arbi` of the host configuration (`<ArbiHost config={{ arbi }}>`).\n */\n\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { useArbiHost } from './host/config'\n\nexport function useArbi(): Arbi {\n const { arbi } = useArbiHost()\n if (!arbi) {\n throw new Error('useArbi() needs an <ArbiHost> whose config has an `arbi`')\n }\n return arbi\n}\n\n/**\n * The deployment domain the user's keys are derived for, as the host's `Arbi` computes it\n * (`deploymentDomain`, else the API URL's hostname). `undefined` without one. The document tools\n * default their `deploymentDomain` (needed for e-signing) to it.\n */\nexport function useDeploymentDomain(): string | undefined {\n return useArbiHost().arbi?.getDeploymentDomain()\n}\n","/**\n * The one query-key factory of the ARBI front end: every React Query key and mutation key the\n * packages and the app use is built here, under `['arbi', …]`. Literal key arrays anywhere else\n * fail the `arbi/query-keys-from-factory` lint rule and `query-keys.guard.test.ts`, so a key can't\n * drift from the queries it names (a stale literal reads or invalidates nothing, silently).\n *\n * Dependency-free on purpose (types only): e2e helpers import it and pass keys into the page.\n */\n\nimport type {\n CalendarWindow,\n ListEventsParams,\n OverlayLayerName,\n RoomQuery,\n} from '@arbidocs/sdk/browser'\n\nexport const arbiQueryKeys = {\n fileShares: () => ['arbi', 'fileShares'] as const,\n fileShare: (id: string) => ['arbi', 'fileShare', id] as const,\n fileSharePdf: (id: string, status?: string) => ['arbi', 'fileSharePdf', id, status] as const,\n workspaces: () => ['arbi', 'workspaces'] as const,\n /** Every workspace's member list: what a workspace switch drops. */\n allWorkspaceUsers: () => ['arbi', 'workspaceUsers'] as const,\n workspaceUsers: (workspaceId: string) => ['arbi', 'workspaceUsers', workspaceId] as const,\n /** Every workspace's documents list: the prefix a write patches when it does not know the workspace. */\n allDocuments: () => ['arbi', 'documents'] as const,\n documents: (workspaceId: string) => ['arbi', 'documents', workspaceId] as const,\n /** One document (a viewer's); writes keep it current next to the list. */\n document: (docId: string) => ['arbi', 'document', docId] as const,\n documentsById: (docIds: string[]) =>\n ['arbi', 'documentsById', [...docIds].sort().join(',')] as const,\n /** Every workspace's near-duplicate pairs. */\n allSimilarDocuments: () => ['arbi', 'similarDocuments'] as const,\n similarDocuments: (workspaceId: string, threshold: number) =>\n ['arbi', 'similarDocuments', workspaceId, threshold] as const,\n /** Every version list: the prefix a new version invalidates. */\n allDocumentVersions: () => ['arbi', 'documentVersions'] as const,\n documentVersions: (docId: string) => ['arbi', 'documentVersions', docId] as const,\n conversations: (workspaceId: string) => ['arbi', 'conversations', workspaceId] as const,\n /** Every workspace's conversation list (and threads): the prefix a conversation write invalidates. */\n allConversations: () => ['arbi', 'conversations'] as const,\n /** A conversation's threads, under the conversations prefix (ids are unique across workspaces). */\n conversationThreads: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'threads'] as const,\n /** One stored message with everything the server keeps on it (its trace and metadata). */\n messageDetails: (messageId: string) => ['arbi', 'messageDetails', messageId] as const,\n /** The backend's built-in slash commands. */\n assistantCommands: () => ['arbi', 'assistantCommands'] as const,\n /** Every workspace's tags (lists, tables and kinds): what a cross-workspace change refreshes. */\n allTags: () => ['arbi', 'tags'] as const,\n tags: (workspaceId: string) => ['arbi', 'tags', workspaceId] as const,\n /** Under the workspace's tags: the kinds' fields (refreshed with the tags). */\n tagKinds: (workspaceId: string) => ['arbi', 'tags', workspaceId, 'kinds'] as const,\n /** Every filtered list (a table of tags): what a tag write refreshes, the whole list aside. */\n tagLists: (workspaceId: string) => ['arbi', 'tags', workspaceId, 'list'] as const,\n /** Under the workspace's tags: a tag, doctag or fact write that invalidates `tags` refreshes it. */\n tagList: (workspaceId: string, query: string) =>\n ['arbi', 'tags', workspaceId, 'list', query] as const,\n /** A kind's fields, under the workspace's tags. */\n tagKind: (workspaceId: string, kind: string) =>\n ['arbi', 'tags', workspaceId, 'kind', kind] as const,\n /** A task's history, under the conversations prefix: every conversation write refreshes it. */\n conversationActivity: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'activity'] as const,\n thumbnails: (docIds: string[]) => ['arbi', 'thumbnails', [...docIds].sort().join(',')] as const,\n /** Every stage of a document's parsed content. */\n parsedDocument: (docId: string) => ['arbi', 'parsedDoc', docId] as const,\n parsedDoc: (docId: string, stage: string) => ['arbi', 'parsedDoc', docId, stage] as const,\n agents: () => ['arbi', 'agents'] as const,\n sessions: () => ['arbi', 'sessions'] as const,\n health: () => ['arbi', 'health'] as const,\n workflows: () => ['arbi', 'workflows'] as const,\n /** Under `workflows()`: a workflow write or run refreshes its runs too. */\n workflowRuns: (workflowId: string) => ['arbi', 'workflows', workflowId, 'runs'] as const,\n /** Under `workflows()`: one workflow with its steps. */\n workflow: (workflowId: string) => ['arbi', 'workflows', workflowId] as const,\n /** Every workspace's facts: the prefix a fact write invalidates. */\n allFacts: () => ['arbi', 'facts'] as const,\n facts: (workspaceId: string) => ['arbi', 'facts', workspaceId] as const,\n configs: () => ['arbi', 'configs'] as const,\n activity: () => ['arbi', 'activity'] as const,\n /** Every transfer query (jobs, lists, plans): what a finished job refreshes. */\n allWorkspaceTransfers: () => ['arbi', 'workspaceTransfers'] as const,\n /** The caller's recent transfer jobs out of a workspace. */\n workspaceTransfers: (workspaceId: string) =>\n ['arbi', 'workspaceTransfers', 'list', workspaceId] as const,\n /** One transfer job's progress. */\n workspaceTransfer: (transferId: string) =>\n ['arbi', 'workspaceTransfers', 'job', transferId] as const,\n /** One job's full ledger (read once it has finished). */\n workspaceTransferItems: (transferId: string) =>\n ['arbi', 'workspaceTransfers', 'items', transferId] as const,\n /** What a scope (serialised) would take in a workspace, for a mode. */\n workspaceTransferPlan: (workspaceId: string, scope: string, mode: string) =>\n ['arbi', 'workspaceTransfers', 'plan', workspaceId, scope, mode] as const,\n /**\n * A workspace's activity feed (all its pages), read `limit` entries a page (absent: the server's\n * default): each page size is its own entry, under the workspace's key.\n */\n workspaceActivity: (workspaceId: string, limit?: number) =>\n limit === undefined\n ? (['arbi', 'workspaceActivity', workspaceId] as const)\n : (['arbi', 'workspaceActivity', workspaceId, limit] as const),\n projects: () => ['arbi', 'projects'] as const,\n projectUsage: (projectExtId: string, monthsBack: number) =>\n ['arbi', 'projectUsage', projectExtId, monthsBack] as const,\n /** The usage of every project the user owns, in one read (under `projectUsage`'s prefix). */\n ownedProjectsUsage: (monthsBack: number) =>\n ['arbi', 'projectUsage', 'owned', monthsBack] as const,\n projectConversationUsage: (projectExtId: string, monthsBack: number) =>\n ['arbi', 'projectUsage', projectExtId, 'byConversation', monthsBack] as const,\n projectInvoices: (projectExtId: string) => ['arbi', 'projectInvoices', projectExtId] as const,\n /** The plans and add-ons on sale. */\n products: () => ['arbi', 'products'] as const,\n /** Prices of a purchase or a change (quotes, previews); nothing is bought. */\n billingQuotes: () => ['arbi', 'billingQuote'] as const,\n userUsageToday: () => ['arbi', 'userUsageToday'] as const,\n currentUser: () => ['arbi', 'currentUser'] as const,\n firmPool: () => ['arbi', 'firmPool'] as const,\n contacts: () => ['arbi', 'contacts'] as const,\n /** Every chat query (the list and each open thread). */\n chats: () => ['arbi', 'chats'] as const,\n /** My chats, raw (titles and last messages are ciphertext), most recently active first. */\n chatList: () => ['arbi', 'chats', 'list'] as const,\n /** One thread's loaded messages, decrypted, oldest first (`ChatThreadData`). */\n chatThread: (chatExtId: string) => ['arbi', 'chats', 'thread', chatExtId] as const,\n /** My own agent's progress on my last message to it (`agent_dm_status`), per agent. */\n agentDmStatus: (agentExtId: string) => ['arbi', 'chats', 'agentStatus', agentExtId] as const,\n /** The paid features this person may use (`/v1/user/entitlements`). */\n entitlements: () => ['arbi', 'entitlements'] as const,\n skills: () => ['arbi', 'skills'] as const,\n /** A skill's main file (SKILL.md), as text. */\n skillSource: (docExtId: string) => ['arbi', 'skills', 'source', docExtId] as const,\n /** An agent's pinned config; `undefined` = the library default config. */\n agentConfig: (agentExtId?: string) => ['arbi', 'agentConfig', agentExtId ?? 'default'] as const,\n agentWorkspaces: (agentExtId: string) => ['arbi', 'agentWorkspaces', agentExtId] as const,\n /** An agent's own login, polled while its controls are open. */\n agentSession: (agentExtId: string) => ['arbi', 'agentSession', agentExtId] as const,\n agentChats: (agentExtId: string) => ['arbi', 'agentChats', agentExtId] as const,\n authorizeLimits: () => ['arbi', 'authorizeLimits'] as const,\n mcpTools: () => ['arbi', 'mcpTools'] as const,\n models: () => ['arbi', 'models'] as const,\n availableModels: () => ['arbi', 'availableModels'] as const,\n /** The workspace Assistant's brief. */\n assistantBrief: (workspaceId: string) => ['arbi', 'assistantBrief', workspaceId] as const,\n /** Whether the workspace Assistant is waiting, working or idle. */\n assistantStatus: (workspaceId: string) => ['arbi', 'assistantStatus', workspaceId] as const,\n /** What the workspace Assistant did with each arrival. */\n assistantArrivals: (workspaceId: string) => ['arbi', 'assistantArrivals', workspaceId] as const,\n modelConnections: (userId?: string) => ['arbi', 'modelConnections', userId] as const,\n directModelUsage: (userId?: string) => ['arbi', 'directModelUsage', userId] as const,\n /** The signed-in user's own profile (name, picture, email). */\n profile: () => ['arbi', 'profile'] as const,\n identity: () => ['arbi', 'identity'] as const,\n /** The signed-in user's settings record (notification preferences, flags). */\n userSettings: () => ['arbi', 'userSettings'] as const,\n /** Every notification list: the prefix a delete, a read receipt or an arrival invalidates. */\n allSupportTickets: () => ['arbi', 'support'] as const,\n supportTickets: () => ['arbi', 'support', 'tickets'] as const,\n supportTicket: (id: number) => ['arbi', 'support', 'tickets', id] as const,\n allNotifications: () => ['arbi', 'notifications'] as const,\n /** The newest `limit` notifications, received and sent. */\n notifications: (limit: number) => ['arbi', 'notifications', limit] as const,\n /** The documents a workspace may use as its Word house template. */\n houseTemplateCandidates: (workspaceId: string) =>\n ['arbi', 'houseTemplateCandidates', workspaceId] as const,\n // ── Storage, archive ────────────────────────────────────────────────────────────────────────\n /** Every storage view (projects, items, names, Recently deleted): what a restore or delete refreshes. */\n storage: () => ['arbi', 'storage'] as const,\n /** What each project stores; no params: every such list. */\n storageProjects: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'projects'] as const)\n : (['arbi', 'storage', 'projects', params] as const),\n /** The largest items stored; no params: every such list. */\n storageItems: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'items'] as const)\n : (['arbi', 'storage', 'items', params] as const),\n /** Decrypted document names of storage items. */\n storageItemNames: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'names'] as const)\n : (['arbi', 'storage', 'names', params] as const),\n /** The deployment's storage day by day. */\n storageSnapshots: (params?: object) =>\n params === undefined\n ? (['arbi', 'storage', 'snapshots'] as const)\n : (['arbi', 'storage', 'snapshots', params] as const),\n /** A workspace's Recently deleted documents; no id: every workspace's. */\n workspaceTrash: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'storage', 'workspaceTrash'] as const)\n : (['arbi', 'storage', 'workspaceTrash', workspaceId] as const),\n /** A workspace's archive state; no id: every workspace's. */\n workspaceArchive: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'workspaceArchive'] as const)\n : (['arbi', 'workspaceArchive', workspaceId] as const),\n // ── Databases ───────────────────────────────────────────────────────────────────────────────\n // Every key below names its workspace right after its kind: a list read in one workspace is never\n // served, or overwritten, in another (the list is the session's open workspace on the server).\n /** Every database query of every workspace (what a write or a switch refreshes). */\n databases: () => ['arbi', 'databases'] as const,\n /** A workspace's databases; no id: every workspace's. */\n databaseList: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'list'] as const)\n : (['arbi', 'databases', 'list', workspaceId] as const),\n /** One database of a workspace; no workspace: every one read. */\n database: (workspaceId?: string, databaseId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'one'] as const)\n : (['arbi', 'databases', 'one', workspaceId, databaseId ?? ''] as const),\n /**\n * A database's rows (a search); no workspace: every database's, no params: every search of one.\n * `['arbi', 'databases', 'rows', workspaceId, databaseId, params]`.\n */\n databaseRows: (workspaceId?: string, databaseId?: string, params?: object) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'rows'] as const)\n : params === undefined\n ? (['arbi', 'databases', 'rows', workspaceId, databaseId ?? ''] as const)\n : (['arbi', 'databases', 'rows', workspaceId, databaseId ?? '', params] as const),\n /** A workspace's pages; no id: every workspace's. */\n pages: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'pages'] as const)\n : (['arbi', 'pages', workspaceId] as const),\n /**\n * Saved table views a workspace's session sees: of one table (a database id or `documents`);\n * no target: every table's; no workspace: every workspace's.\n */\n tableViews: (workspaceId?: string, target?: string) =>\n workspaceId === undefined\n ? (['arbi', 'table-views'] as const)\n : target === undefined\n ? (['arbi', 'table-views', workspaceId] as const)\n : (['arbi', 'table-views', workspaceId, target] as const),\n /**\n * A view's rows with its database (a page's table block), under `databaseRows`' prefix so every\n * row write refreshes it: the database is the view's, unknown until read.\n */\n tableViewRows: (workspaceId: string, viewId: string) =>\n ['arbi', 'databases', 'rows', workspaceId, '', { view: viewId }] as const,\n /** A workspace's items counted on the server (a chart); no workspace: every workspace's. */\n workspaceAggregate: (workspaceId?: string, query?: object) =>\n workspaceId === undefined\n ? (['arbi', 'workspaceAggregate'] as const)\n : (['arbi', 'workspaceAggregate', workspaceId, query ?? {}] as const),\n /** A database's rows grouped and measured (a chart); no workspace: every database's. */\n databaseAggregate: (workspaceId?: string, databaseId?: string, request?: object) =>\n workspaceId === undefined\n ? (['arbi', 'databases', 'aggregate'] as const)\n : (['arbi', 'databases', 'aggregate', workspaceId, databaseId ?? '', request ?? {}] as const),\n // ── Configs, health ─────────────────────────────────────────────────────────────────────────\n /** Under `configs()`: the saved configuration versions. */\n configVersions: () => ['arbi', 'configs', 'versions'] as const,\n /** Under `configs()`: the JSON schema of every config model. */\n configSchema: () => ['arbi', 'configs', 'schema'] as const,\n /** Under `configs()`: one configuration. */\n config: (configId: string) => ['arbi', 'configs', 'one', configId] as const,\n /** The remote model providers' health. */\n remoteModels: () => ['arbi', 'remoteModels'] as const,\n // ── Conversations ───────────────────────────────────────────────────────────────────────────\n /** Under the conversations prefix: what a parked run waits for the owner to allow. */\n conversationPendingAuth: (conversationId: string) =>\n ['arbi', 'conversations', conversationId, 'pending-auth'] as const,\n // ── Document tools ──────────────────────────────────────────────────────────────────────────\n /** Signatures on a document (a version); no id: every document's. */\n documentSignatures: (docId?: string, version?: number | null) =>\n docId === undefined\n ? (['arbi', 'documentSignatures'] as const)\n : (['arbi', 'documentSignatures', docId, version ?? null] as const),\n /** The certificate of a signature reference. */\n signatureVerification: (reference: string) =>\n ['arbi', 'signatureVerification', reference] as const,\n /** Every signature request list: what a request write refreshes. */\n signatureRequests: () => ['arbi', 'signatureRequests'] as const,\n signatureRequestsForDocument: (docId: string) =>\n ['arbi', 'signatureRequests', 'document', docId] as const,\n /** Who may sign in a workspace; no id: every workspace's. */\n signatureCandidates: (workspaceId?: string) =>\n workspaceId === undefined\n ? (['arbi', 'signatureRequests', 'candidates'] as const)\n : (['arbi', 'signatureRequests', 'candidates', workspaceId] as const),\n /** The user's saved (informal) signature. */\n savedSignature: () => ['arbi', 'savedSignature'] as const,\n /** An html/react artifact's source. */\n artifactSource: (docId: string) => ['arbi', 'artifactSource', docId] as const,\n /** An artifact's text, under its parsed content (refreshed with it). */\n artifactText: (docId: string) => ['arbi', 'parsedDoc', docId, 'marker', 'artifact-text'] as const,\n /** An image document's bytes as an object URL. */\n assetImage: (docId: string) => ['arbi', 'assetImage', docId] as const,\n // ── Misc ────────────────────────────────────────────────────────────────────────────────────\n /** An agent config's model tier (the builder's badge). */\n agentConfigModel: (configId: string) => ['arbi', 'agentConfigModel', configId] as const,\n /** Under `billingQuotes()`: the price of a plan change. */\n billingPreview: (projectExtId: string, change: unknown) =>\n ['arbi', 'billingQuote', 'preview', projectExtId, change] as const,\n billingPlanQuote: (projectExtId: string | null, body: unknown) =>\n ['arbi', 'billingQuote', 'plan', projectExtId, body] as const,\n billingAddonQuote: (projectExtId: string, kind: string) =>\n ['arbi', 'billingQuote', 'addon', projectExtId, kind] as const,\n /** Under `contacts()`: a search of the people one can reach. */\n contactSearch: (term: string) => ['arbi', 'contacts', 'search', term] as const,\n /** Under the workspace's facts: a filtered list. */\n factList: (workspaceId: string, filter: unknown) =>\n ['arbi', 'facts', workspaceId, filter] as const,\n /**\n * Under `skills()`: a workspace's list, hidden ones included or not. Without a marketplace the\n * server lists the open workspace's skills, so the list is kept per workspace.\n */\n skillList: (workspaceId: string, includeHidden: boolean) =>\n ['arbi', 'skills', 'list', workspaceId, includeHidden] as const,\n /** Under the project's events: one kind, one page size. */\n projectEventList: (projectExtId: string, kind: string, limit: number | 'default') =>\n ['arbi', 'projects', projectExtId, 'events', kind, limit] as const,\n /** The documents pinned for offline reading on this device. */\n offlineDocuments: () => ['arbi', 'offlineDocuments'] as const,\n /** Notifications of one kind for a deployment's user (polled). */\n typedNotifications: (kind: string, apiUrl: string, userId: string | undefined) =>\n ['arbi', 'typedNotifications', kind, apiUrl, userId ?? ''] as const,\n}\n\n/**\n * Keys of the mutations a host may need to follow (its own caches outside these hooks), e.g. with\n * a `MutationCache` subscription: a workflow run creates a task in the host's own task list.\n */\nexport const arbiMutationKeys = {\n /** A member's role changed. */\n setWorkspaceMemberRoles: () => ['arbi', 'workspaces', 'roles'] as const,\n runWorkflow: () => ['arbi', 'workflows', 'run'] as const,\n startWorkflow: () => ['arbi', 'workflows', 'start'] as const,\n updateTagKindSchema: () => ['arbi', 'tags', 'kinds', 'update'] as const,\n createTag: () => ['arbi', 'tags', 'create'] as const,\n updateTag: () => ['arbi', 'tags', 'update'] as const,\n deleteTag: () => ['arbi', 'tags', 'delete'] as const,\n extractEntities: () => ['arbi', 'tags', 'entities', 'extract'] as const,\n updateDocuments: () => ['arbi', 'documents', 'update'] as const,\n deleteDocuments: () => ['arbi', 'documents', 'delete'] as const,\n uploadDocuments: () => ['arbi', 'documents', 'upload'] as const,\n uploadUrls: () => ['arbi', 'documents', 'uploadUrls'] as const,\n assignDocTags: () => ['arbi', 'doctags', 'assign'] as const,\n removeDocTags: () => ['arbi', 'doctags', 'remove'] as const,\n updateDocTag: () => ['arbi', 'doctags', 'update'] as const,\n generateDocTags: () => ['arbi', 'doctags', 'generate'] as const,\n /** Members added to or removed from a workspace (leaving included). */\n workspaceMembership: () => ['arbi', 'workspaces', 'members'] as const,\n /** A chat turn being sent (the app's send pipeline). */\n sendMessage: () => ['arbi', 'conversations', 'send'] as const,\n}\n\n/**\n * Query keys of the calendar hooks, all under `['arbi', 'calendar']`. The calendar is the user's,\n * not a workspace's; only the overlays carry the open workspace.\n */\nexport const calendarQueryKeys = {\n all: () => ['arbi', 'calendar'] as const,\n settings: () => ['arbi', 'calendar', 'settings'] as const,\n calendars: () => ['arbi', 'calendar', 'calendars'] as const,\n /** Every event list: the prefix an event write invalidates. */\n events: () => ['arbi', 'calendar', 'events'] as const,\n eventList: (p: ListEventsParams) =>\n [\n 'arbi',\n 'calendar',\n 'events',\n { start: p.start, end: p.end, calendars: p.calendars?.join(',') ?? null },\n ] as const,\n /** Every single event read. */\n eventDetails: () => ['arbi', 'calendar', 'event'] as const,\n event: (id: string, recurrenceId?: string | null) =>\n ['arbi', 'calendar', 'event', id, recurrenceId ?? null] as const,\n shares: (calId: string) => ['arbi', 'calendar', 'shares', calId] as const,\n invitations: () => ['arbi', 'calendar', 'invitations'] as const,\n holidayCountries: () => ['arbi', 'calendar', 'holiday-countries'] as const,\n allRooms: () => ['arbi', 'calendar', 'rooms'] as const,\n rooms: (q: RoomQuery) => ['arbi', 'calendar', 'rooms', q] as const,\n freebusy: (attendees: string[], start: string, end: string) =>\n ['arbi', 'calendar', 'freebusy', attendees.join(','), start, end] as const,\n allLookups: () => ['arbi', 'calendar', 'lookup'] as const,\n lookup: (uid: string) => ['arbi', 'calendar', 'lookup', uid] as const,\n overlays: (workspaceId: string | null, w?: CalendarWindow, layers?: OverlayLayerName[]) =>\n [\n 'arbi',\n 'calendar',\n 'overlays',\n workspaceId,\n w ? { start: w.start, end: w.end, layers: layers?.join(',') } : null,\n ] as const,\n accounts: () => ['arbi', 'calendar', 'accounts'] as const,\n caldavProfiles: () => ['arbi', 'calendar', 'caldav-profiles'] as const,\n bookingPages: () => ['arbi', 'calendar', 'booking-pages'] as const,\n /** The offline outbox (writes made offline, not yet sent). */\n outbox: () => ['arbi', 'calendar', 'outbox'] as const,\n}\n\n/** Query keys of the call hooks, all under `['arbi', 'calls']`. Calls are the user's, not a workspace's. */\nexport const callQueryKeys = {\n all: () => ['arbi', 'calls'] as const,\n config: () => ['arbi', 'calls', 'config'] as const,\n call: (callExtId: string) => ['arbi', 'calls', 'call', callExtId] as const,\n /** Everything about a call's recordings: the prefix a recording event invalidates. */\n recordingsOf: (callExtId: string) => ['arbi', 'calls', 'recordings', callExtId] as const,\n recordings: (callExtId: string) => ['arbi', 'calls', 'recordings', callExtId, 'list'] as const,\n recording: (callExtId: string, recordingExtId: string) =>\n ['arbi', 'calls', 'recordings', callExtId, 'one', recordingExtId] as const,\n inviteLinks: (callExtId: string) => ['arbi', 'calls', 'invite-links', callExtId] as const,\n}\n\nexport const connectorQueryKeys = {\n all: () => ['arbi', 'connectors'] as const,\n catalog: () => ['arbi', 'connectors', 'catalog'] as const,\n mine: () => ['arbi', 'connectors', 'mine'] as const,\n mailboxFolders: (vendor: string) => ['arbi', 'connectors', 'folders', vendor] as const,\n mailboxSyncProgress: (vendor: string, workspaceExtId: string) =>\n ['arbi', 'connectors', 'sync-progress', vendor, workspaceExtId] as const,\n allMailboxSyncProgress: () => ['arbi', 'connectors', 'sync-progress'] as const,\n driveFolders: (vendor: string) => ['arbi', 'connectors', 'drive-folders', vendor] as const,\n driveFolderChildren: (vendor: string, itemId: string) =>\n ['arbi', 'connectors', 'drive-folder-children', vendor, itemId] as const,\n driveFolderDocCount: (vendor: string, itemId: string) =>\n ['arbi', 'connectors', 'drive-folder-doc-count', vendor, itemId] as const,\n driveSyncEstimate: (vendor: string) =>\n ['arbi', 'connectors', 'drive-sync-estimate', vendor] as const,\n driveSyncProgress: (vendor: string) =>\n ['arbi', 'connectors', 'drive-sync-progress', vendor] as const,\n allDriveSyncProgress: () => ['arbi', 'connectors', 'drive-sync-progress'] as const,\n slack: () => ['arbi', 'connectors', 'slack'] as const,\n}\n\nexport const mailQueryKeys = {\n all: () => ['arbi', 'mail'] as const,\n policy: () => ['arbi', 'mail', 'policy'] as const,\n accounts: () => ['arbi', 'mail', 'accounts'] as const,\n unlock: (accountId: string | undefined, sessionKey: string | null) =>\n ['arbi', 'mail', 'unlock', accountId, sessionKey ?? ''] as const,\n allFolders: () => ['arbi', 'mail', 'folders'] as const,\n folders: (accountId: string | undefined) => ['arbi', 'mail', 'folders', accountId] as const,\n allMessages: () => ['arbi', 'mail', 'messages'] as const,\n messages: (\n accountId: string | undefined,\n folderId: string | undefined,\n query: string,\n cursor: string | null\n ) => ['arbi', 'mail', 'messages', accountId, folderId, query, cursor] as const,\n message: (accountId: string | undefined, messageId: string | null | undefined) =>\n ['arbi', 'mail', 'message', accountId, messageId] as const,\n /** Every conversation list: the prefix a flag or move patches or refreshes. */\n allConversations: () => ['arbi', 'mail', 'conversations'] as const,\n conversations: (\n accountId: string | undefined,\n folderId: string | undefined,\n query: string,\n cursor: string | null\n ) => ['arbi', 'mail', 'conversations', accountId, folderId, query, cursor] as const,\n /** Every thread read of an account. */\n accountThreads: (accountId: string) => ['arbi', 'mail', 'thread', accountId] as const,\n thread: (\n accountId: string | undefined,\n threadId: string | null | undefined,\n folderId: string | undefined\n ) => ['arbi', 'mail', 'thread', accountId, threadId, folderId] as const,\n /** Where the ARBI mailbox files mail (folders and conversations, per workspace). */\n nativeFiling: () => ['arbi', 'mail', 'filing', 'native'] as const,\n /** Every filing lookup: refreshed after mail is added to a workspace or a rule is stopped. */\n allFiling: () => ['arbi', 'mail', 'filing'] as const,\n filing: (accountId: string | undefined, messageIds: string[], threadIds: string[]) =>\n ['arbi', 'mail', 'filing', accountId, messageIds.join(' '), threadIds.join(' ')] as const,\n /** The key the user's client keys older native mail with: outside the `['arbi', 'mail']` prefix, so\n * refreshing mail never fetches it again. */\n threadSecret: () => ['arbi', 'mail-thread-secret'] as const,\n /** The projects an email's AI work can be billed to. */\n projects: () => ['arbi', 'mail', 'projects'] as const,\n /** A saved draft prepared for editing. */\n draftCompose: (accountId: string | undefined, draftId: string | undefined) =>\n ['arbi', 'mail', 'draft-compose', accountId, draftId] as const,\n attachmentText: (accountId: string, messageId: string, attachmentId: string) =>\n ['arbi', 'mail', 'attachment-text', accountId, messageId, attachmentId] as const,\n}\n\n/** `pdf`: the document as a PDF; `original`: the stored file (an image, a recording, a sheet). */\nexport type DocumentBytesKind = 'pdf' | 'original'\n\n/** Every version and kind of a document's bytes: the prefix a new version invalidates. */\nexport const documentBytesKey = (\n documentRef: string,\n version?: number | null,\n kind?: DocumentBytesKind\n) =>\n version === undefined\n ? (['arbi', 'documentBytes', documentRef] as const)\n : (['arbi', 'documentBytes', documentRef, version, kind ?? 'pdf'] as const)\n\n/** Whether `queryKey` lies under `prefix` (a factory key): React Query's own prefix match. */\nexport function isUnderQueryKey(queryKey: readonly unknown[], prefix: readonly unknown[]): boolean {\n return prefix.every((part, i) => queryKey[i] === part)\n}\n"]}
@@ -44,7 +44,9 @@ import {
44
44
  useDeletePage,
45
45
  usePages,
46
46
  useSavePage,
47
- useSharePage
47
+ useSharePage,
48
+ LIVE_BLOCK_KINDS,
49
+ LIVE_BLOCK_LIMITS
48
50
  } from "./pages.js";
49
51
  import {
50
52
  DEFAULT_ACTIVITY_SOURCE_LABELS,
@@ -104,6 +106,8 @@ export {
104
106
  DEFAULT_WORKFLOWS_SOURCE_LABELS,
105
107
  DEFAULT_WORKSPACES_SOURCE_LABELS,
106
108
  EMPTY_GROUP_LABEL,
109
+ LIVE_BLOCK_KINDS,
110
+ LIVE_BLOCK_LIMITS,
107
111
  MAX_SERIES,
108
112
  MODEL_GROUP_LABELS,
109
113
  PAGE_GRID_COLUMNS,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/datasets/index.ts"],
4
- "sourcesContent": ["/**\n * Datasets and dashboards: data source adapters returning one normalized `Dataset`, the\n * serialisable `ChartSpec` / `PanelSpec` / `DashboardSpec`, and pages (`/v1/pages`). The\n * drawing is `@arbidocs/blocks/dashboards`'.\n */\nexport * from './types'\nexport {\n EMPTY_GROUP_LABEL,\n MAX_SERIES,\n aggregateDataset,\n aggregateMeasured,\n measuresOf,\n type Measures,\n type MeasuredRow,\n bucketOf,\n bucketRange,\n fillTimeGaps,\n filterRows,\n recordsOf,\n} from './aggregate'\nexport { defineRowsSource, type RowsSourceDefinition, type RowsState } from './rows-source'\nexport {\n aggregatePlan,\n cellText,\n defineAggregateSource,\n measuredRowsOf,\n useOpenWorkspace,\n type AggregateField,\n type AggregateLabels,\n type AggregatePlan,\n type AggregateSourceDefinition,\n} from './aggregate-source'\nexport {\n AGGREGATE_BATCH_SIZE,\n AGGREGATE_BATCH_WINDOW_MS,\n loadWorkspaceAggregate,\n useWorkspaceAggregate,\n type WorkspaceAggregateQuery,\n type WorkspaceAggregateResult,\n} from './workspace-aggregate'\nexport { queryOfChart, usePanelDataset, type PanelDatasetState } from './panel'\nexport {\n BUILTIN_DATA_SOURCES,\n createDataSourceRegistry,\n useDataSources,\n type DashboardsHost,\n type DataSourceRegistry,\n} from './registry'\nexport {\n ANALYTICS_CHART_VIEW,\n DEFAULT_BLOCK_HEIGHT,\n PAGE_GRID_COLUMNS,\n blockOfPanel,\n packBlocks,\n pageFromDashboard,\n panelOfBlock,\n parsePageSpec,\n savedPageOf,\n useDeletePage,\n usePages,\n useSavePage,\n useSharePage,\n type AnalyticsChartRequest,\n type BlockLayout,\n type PageBlock,\n type PageBlockKind,\n type PageSpec,\n type PanelBlockConfig,\n type SavedPage,\n} from './pages'\nexport {\n DEFAULT_ACTIVITY_SOURCE_LABELS,\n createActivitySource,\n type ActivitySourceLabels,\n} from './sources/activity'\nexport {\n DEFAULT_CONVERSATIONS_SOURCE_LABELS,\n createConversationsSource,\n type ConversationsSourceLabels,\n} from './sources/conversations'\nexport {\n DEFAULT_DATABASE_SOURCE_LABELS,\n createDatabaseSource,\n type DatabaseSourceLabels,\n} from './sources/database'\nexport {\n DEFAULT_DOCUMENTS_SOURCE_LABELS,\n createDocumentsSource,\n type DocumentsSourceLabels,\n} from './sources/documents'\nexport {\n DEFAULT_FACTS_SOURCE_LABELS,\n createFactsSource,\n type FactsSourceLabels,\n} from './sources/facts'\nexport {\n DEFAULT_PROJECTS_SOURCE_LABELS,\n createProjectsSource,\n type ProjectsSourceLabels,\n type ProjectsSourceOptions,\n} from './sources/projects'\nexport { DEFAULT_TAGS_SOURCE_LABELS, createTagsSource, type TagsSourceLabels } from './sources/tags'\nexport {\n DEFAULT_WORKFLOWS_SOURCE_LABELS,\n createWorkflowsSource,\n type WorkflowsSourceLabels,\n} from './sources/workflows'\nexport {\n DEFAULT_WORKSPACES_SOURCE_LABELS,\n createWorkspacesSource,\n type WorkspacesSourceLabels,\n} from './sources/workspaces'\nexport {\n DEFAULT_USAGE_BREAKDOWN_SOURCE_LABELS,\n DEFAULT_USAGE_SOURCE_LABELS,\n MODEL_GROUP_LABELS,\n createUsageBreakdownSource,\n createUsageSource,\n type UsageBreakdownBy,\n type UsageBreakdownKey,\n type UsageBreakdownSourceLabels,\n type UsageSourceLabels,\n} from './sources/usage'\n"],
5
- "mappings": "AAKA,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAmE;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,cAAc,uBAA+C;AACtE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;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,OAQK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B,wBAA+C;AACpF;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;",
4
+ "sourcesContent": ["/**\n * Datasets and dashboards: data source adapters returning one normalized `Dataset`, the\n * serialisable `ChartSpec` / `PanelSpec` / `DashboardSpec`, and pages (`/v1/pages`). The\n * drawing is `@arbidocs/blocks/dashboards`'.\n */\nexport * from './types'\nexport {\n EMPTY_GROUP_LABEL,\n MAX_SERIES,\n aggregateDataset,\n aggregateMeasured,\n measuresOf,\n type Measures,\n type MeasuredRow,\n bucketOf,\n bucketRange,\n fillTimeGaps,\n filterRows,\n recordsOf,\n} from './aggregate'\nexport { defineRowsSource, type RowsSourceDefinition, type RowsState } from './rows-source'\nexport {\n aggregatePlan,\n cellText,\n defineAggregateSource,\n measuredRowsOf,\n useOpenWorkspace,\n type AggregateField,\n type AggregateLabels,\n type AggregatePlan,\n type AggregateSourceDefinition,\n} from './aggregate-source'\nexport {\n AGGREGATE_BATCH_SIZE,\n AGGREGATE_BATCH_WINDOW_MS,\n loadWorkspaceAggregate,\n useWorkspaceAggregate,\n type WorkspaceAggregateQuery,\n type WorkspaceAggregateResult,\n} from './workspace-aggregate'\nexport { queryOfChart, usePanelDataset, type PanelDatasetState } from './panel'\nexport {\n BUILTIN_DATA_SOURCES,\n createDataSourceRegistry,\n useDataSources,\n type DashboardsHost,\n type DataSourceRegistry,\n} from './registry'\nexport {\n ANALYTICS_CHART_VIEW,\n DEFAULT_BLOCK_HEIGHT,\n PAGE_GRID_COLUMNS,\n blockOfPanel,\n packBlocks,\n pageFromDashboard,\n panelOfBlock,\n parsePageSpec,\n savedPageOf,\n useDeletePage,\n usePages,\n useSavePage,\n useSharePage,\n LIVE_BLOCK_KINDS,\n LIVE_BLOCK_LIMITS,\n type AgendaBlockConfig,\n type AnalyticsChartRequest,\n type BlockLayout,\n type CarouselBlockConfig,\n type ListBlockConfig,\n type LiveBlock,\n type StartBlockConfig,\n type PageBlock,\n type PageBlockKind,\n type PageSpec,\n type PanelBlockConfig,\n type SavedPage,\n} from './pages'\nexport {\n DEFAULT_ACTIVITY_SOURCE_LABELS,\n createActivitySource,\n type ActivitySourceLabels,\n} from './sources/activity'\nexport {\n DEFAULT_CONVERSATIONS_SOURCE_LABELS,\n createConversationsSource,\n type ConversationsSourceLabels,\n} from './sources/conversations'\nexport {\n DEFAULT_DATABASE_SOURCE_LABELS,\n createDatabaseSource,\n type DatabaseSourceLabels,\n} from './sources/database'\nexport {\n DEFAULT_DOCUMENTS_SOURCE_LABELS,\n createDocumentsSource,\n type DocumentsSourceLabels,\n} from './sources/documents'\nexport {\n DEFAULT_FACTS_SOURCE_LABELS,\n createFactsSource,\n type FactsSourceLabels,\n} from './sources/facts'\nexport {\n DEFAULT_PROJECTS_SOURCE_LABELS,\n createProjectsSource,\n type ProjectsSourceLabels,\n type ProjectsSourceOptions,\n} from './sources/projects'\nexport { DEFAULT_TAGS_SOURCE_LABELS, createTagsSource, type TagsSourceLabels } from './sources/tags'\nexport {\n DEFAULT_WORKFLOWS_SOURCE_LABELS,\n createWorkflowsSource,\n type WorkflowsSourceLabels,\n} from './sources/workflows'\nexport {\n DEFAULT_WORKSPACES_SOURCE_LABELS,\n createWorkspacesSource,\n type WorkspacesSourceLabels,\n} from './sources/workspaces'\nexport {\n DEFAULT_USAGE_BREAKDOWN_SOURCE_LABELS,\n DEFAULT_USAGE_SOURCE_LABELS,\n MODEL_GROUP_LABELS,\n createUsageBreakdownSource,\n createUsageSource,\n type UsageBreakdownBy,\n type UsageBreakdownKey,\n type UsageBreakdownSourceLabels,\n type UsageSourceLabels,\n} from './sources/usage'\n"],
5
+ "mappings": "AAKA,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAmE;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,cAAc,uBAA+C;AACtE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP;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,OAaK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B,wBAA+C;AACpF;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;",
6
6
  "names": []
7
7
  }
@@ -3,14 +3,38 @@ import { useArbi } from "../useArbi.js";
3
3
  import { arbiQueryKeys } from "../query-keys.js";
4
4
  const ANALYTICS_CHART_VIEW = "analytics.chartDatabase";
5
5
  const PAGE_GRID_COLUMNS = 12;
6
+ const LIVE_BLOCK_KINDS = ["list", "carousel", "agenda", "start"];
6
7
  const DEFAULT_BLOCK_HEIGHT = {
7
- metric: 2,
8
- text: 2,
9
- chart: 4,
8
+ metric: 3,
9
+ text: 3,
10
+ chart: 6,
10
11
  table: 6,
11
- document: 8,
12
- gallery: 8
12
+ document: 6,
13
+ gallery: 6,
14
+ list: 6,
15
+ carousel: 3,
16
+ agenda: 6,
17
+ start: 3
13
18
  };
19
+ const LIVE_BLOCK_LIMITS = {
20
+ listRows: { min: 1, max: 25, default: 5 },
21
+ carouselItems: { min: 1, max: 50, default: 12 },
22
+ agendaDays: { min: 1, max: 31, default: 7 },
23
+ agendaEvents: { min: 1, max: 50, default: 8 }
24
+ };
25
+ const LIST_SOURCES = [
26
+ "documents",
27
+ "conversations",
28
+ "facts"
29
+ ];
30
+ const FACTS_GROUPS = [
31
+ "upcoming_and_newest",
32
+ "upcoming",
33
+ "newest"
34
+ ];
35
+ const CAROUSEL_SOURCES = ["skills", "workflows"];
36
+ const oneOf = (options, v) => options.find((o) => o === v);
37
+ const bounded = (v, b) => clamp(v, b.min, b.max, b.default);
14
38
  const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
15
39
  const clamp = (n, lo, hi, fallback) => typeof n === "number" && Number.isFinite(n) ? Math.min(hi, Math.max(lo, Math.round(n))) : fallback;
16
40
  function packBlocks(blocks) {
@@ -66,7 +90,8 @@ function isPanelConfig(v) {
66
90
  return isObject(v) && typeof v.title === "string" && isObject(v.source) && typeof v.source.id === "string" && isObject(v.chart) && typeof v.chart.type === "string";
67
91
  }
68
92
  function blockOf(v) {
69
- if (!isObject(v) || typeof v.id !== "string" || !isObject(v.config)) return null;
93
+ if (!isObject(v) || typeof v.id !== "string") return null;
94
+ if (!isObject(v.config) && v.kind !== "agenda" && v.kind !== "start") return null;
70
95
  const l = isObject(v.layout) ? v.layout : {};
71
96
  const layout = {
72
97
  x: clamp(l.x, 0, PAGE_GRID_COLUMNS - 1, 0),
@@ -74,7 +99,7 @@ function blockOf(v) {
74
99
  w: clamp(l.w, 1, PAGE_GRID_COLUMNS, PAGE_GRID_COLUMNS),
75
100
  h: clamp(l.h, 1, 100, 4)
76
101
  };
77
- const config = v.config;
102
+ const config = isObject(v.config) ? v.config : {};
78
103
  switch (v.kind) {
79
104
  case "chart":
80
105
  case "metric":
@@ -89,6 +114,42 @@ function blockOf(v) {
89
114
  const documents = Array.isArray(config.documents) ? config.documents.filter((d) => typeof d === "string") : [];
90
115
  return documents.length ? { id: v.id, kind: "gallery", layout, config: { documents } } : null;
91
116
  }
117
+ case "list": {
118
+ const source = oneOf(LIST_SOURCES, config.source);
119
+ if (!source) return null;
120
+ const facts = source === "facts" ? oneOf(FACTS_GROUPS, config.facts) : void 0;
121
+ return {
122
+ id: v.id,
123
+ kind: "list",
124
+ layout,
125
+ config: {
126
+ source,
127
+ limit: bounded(config.limit, LIVE_BLOCK_LIMITS.listRows),
128
+ ...facts ? { facts } : {}
129
+ }
130
+ };
131
+ }
132
+ case "carousel": {
133
+ const source = oneOf(CAROUSEL_SOURCES, config.source);
134
+ return source ? {
135
+ id: v.id,
136
+ kind: "carousel",
137
+ layout,
138
+ config: { source, limit: bounded(config.limit, LIVE_BLOCK_LIMITS.carouselItems) }
139
+ } : null;
140
+ }
141
+ case "agenda":
142
+ return {
143
+ id: v.id,
144
+ kind: "agenda",
145
+ layout,
146
+ config: {
147
+ days: bounded(config.days, LIVE_BLOCK_LIMITS.agendaDays),
148
+ limit: bounded(config.limit, LIVE_BLOCK_LIMITS.agendaEvents)
149
+ }
150
+ };
151
+ case "start":
152
+ return { id: v.id, kind: "start", layout, config: {} };
92
153
  default:
93
154
  return null;
94
155
  }
@@ -193,6 +254,8 @@ function useDeletePage() {
193
254
  export {
194
255
  ANALYTICS_CHART_VIEW,
195
256
  DEFAULT_BLOCK_HEIGHT,
257
+ LIVE_BLOCK_KINDS,
258
+ LIVE_BLOCK_LIMITS,
196
259
  PAGE_GRID_COLUMNS,
197
260
  blockOfPanel,
198
261
  packBlocks,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/datasets/pages.ts"],
4
- "sourcesContent": ["/**\n * Pages: the open workspace's layouts of live blocks (charts, metrics, text and table views), kept\n * on the server (`arbi.pages`, `/v1/pages`) under the workspace key. A page is its creator's until\n * shared. Sharing is one-way: a shared page is every member's to read and every editor's to edit,\n * and only a workspace owner deletes it. A shared page never shows a private view (the server\n * refuses: `PagePrivateContentError`).\n *\n * A page is a 12-column grid: each block has a place and a size (`layout`). Chart and metric blocks\n * carry an Analytics panel's config (source, chart); a table block carries only the view it shows.\n * Dashboards saved before pages come back as private pages (`legacy`), opened with the user's key;\n * saving one places it in the open workspace.\n */\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'\nimport type { Page, PageSpecWire } from '@arbidocs/sdk/browser'\nimport { useArbi } from '../useArbi'\nimport { arbiQueryKeys } from '../query-keys'\nimport type { ChartSpec, DashboardSpec, DataSourceRef, PanelSpec } from './types'\n\n/**\n * The transient view through which a host asks for a chart of a database (\"Chart this\"): set it to\n * `{ id, name, workspaceId }` and open the pages, which start a new page on that database and clear it.\n */\nexport const ANALYTICS_CHART_VIEW = 'analytics.chartDatabase'\n\n/** A database to chart. */\nexport interface AnalyticsChartRequest {\n id: string\n name: string\n /** The database's workspace, so the new blocks read it from anywhere. */\n workspaceId?: string\n}\n\n/** The columns of a page's grid. */\nexport const PAGE_GRID_COLUMNS = 12\n\nexport type PageBlockKind = 'chart' | 'metric' | 'text' | 'table' | 'document' | 'gallery'\n\n/** Where a block sits: column `x` (0\u201311) and row `y`, `w` columns wide and `h` rows high. */\nexport interface BlockLayout {\n x: number\n y: number\n w: number\n h: number\n}\n\n/** A chart or metric block: what an Analytics panel shows. */\nexport interface PanelBlockConfig {\n title: string\n description?: string\n source: DataSourceRef\n chart: ChartSpec\n}\n\ninterface BlockBase {\n id: string\n layout: BlockLayout\n}\n\nexport type PageBlock =\n | (BlockBase & { kind: 'chart'; config: PanelBlockConfig })\n | (BlockBase & { kind: 'metric'; config: PanelBlockConfig })\n | (BlockBase & { kind: 'text'; config: { text: string } })\n /** A saved table view, nothing else: its columns, filters and sort are the view's. */\n | (BlockBase & { kind: 'table'; config: { view: string } })\n /** One document (a PDF, a Word file, an image, a generated report), read-only. */\n | (BlockBase & { kind: 'document'; config: { document: string } })\n /** Documents shown one at a time, in this order, with previous / next and thumbnails. */\n | (BlockBase & { kind: 'gallery'; config: { documents: string[] } })\n\n/** A page: a titled grid of blocks. Plain JSON (`version` for later migrations). */\nexport interface PageSpec {\n version: 1\n title: string\n description?: string\n blocks: PageBlock[]\n}\n\n/** A page as read. */\nexport interface SavedPage {\n id: string\n /** `null`: a dashboard from before pages, not yet saved into a workspace. */\n workspaceId: string | null\n shared: boolean\n spec: PageSpec\n /** The views its table blocks show (the server's record). */\n viewIds: string[]\n /** The documents its document and gallery blocks show (the server's record). */\n documentIds: string[]\n createdBy: string | null\n updatedAt: string\n /** A dashboard from before pages (sealed to the user): saving it places it in this workspace. */\n legacy: boolean\n /** It could not be opened (sealed under another key, or damaged): it can only be deleted. */\n unreadable: boolean\n}\n\n/** A new block's height in rows, by kind. */\nexport const DEFAULT_BLOCK_HEIGHT: Record<PageBlockKind, number> = {\n metric: 2,\n text: 2,\n chart: 4,\n table: 6,\n document: 8,\n gallery: 8,\n}\n\nconst isObject = (v: unknown): v is Record<string, unknown> =>\n typeof v === 'object' && v !== null && !Array.isArray(v)\n\nconst clamp = (n: unknown, lo: number, hi: number, fallback: number) =>\n typeof n === 'number' && Number.isFinite(n) ? Math.min(hi, Math.max(lo, Math.round(n))) : fallback\n\n/**\n * Place blocks in order, left to right in rows: a block goes beside the last one when it fits in\n * the 12 columns, else below everything placed so far. Each keeps its size.\n */\nexport function packBlocks<B extends { layout: BlockLayout }>(blocks: readonly B[]): B[] {\n let x = 0\n let rowTop = 0\n let bottom = 0\n return blocks.map((b) => {\n const w = clamp(b.layout.w, 1, PAGE_GRID_COLUMNS, PAGE_GRID_COLUMNS)\n const h = clamp(b.layout.h, 1, 100, 4)\n if (x + w > PAGE_GRID_COLUMNS) {\n x = 0\n rowTop = bottom\n }\n const layout = { x, y: rowTop, w, h }\n x += w\n bottom = Math.max(bottom, rowTop + h)\n return { ...b, layout }\n })\n}\n\n/** A chart or metric block of an Analytics panel. */\nexport function blockOfPanel(panel: PanelSpec, h?: number): PageBlock {\n const kind = panel.chart.type === 'metric' ? 'metric' : 'chart'\n return {\n id: panel.id,\n kind,\n layout: { x: 0, y: 0, w: panel.width ?? PAGE_GRID_COLUMNS, h: h ?? DEFAULT_BLOCK_HEIGHT[kind] },\n config: {\n title: panel.title,\n ...(panel.description ? { description: panel.description } : {}),\n source: panel.source,\n chart: panel.chart,\n },\n }\n}\n\n/** The Analytics panel a chart or metric block draws. */\nexport function panelOfBlock(block: Extract<PageBlock, { kind: 'chart' | 'metric' }>): PanelSpec {\n return {\n id: block.id,\n title: block.config.title,\n ...(block.config.description ? { description: block.config.description } : {}),\n source: block.config.source,\n chart: block.config.chart,\n width: block.layout.w,\n }\n}\n\n/** A dashboard (a template, or one saved before pages) as a page: its panels as blocks, in order. */\nexport function pageFromDashboard(dashboard: DashboardSpec): PageSpec {\n return {\n version: 1,\n title: dashboard.title,\n ...(dashboard.description ? { description: dashboard.description } : {}),\n blocks: packBlocks(dashboard.panels.map((p) => blockOfPanel(p))),\n }\n}\n\nfunction isPanelConfig(v: unknown): v is PanelBlockConfig {\n return (\n isObject(v) &&\n typeof v.title === 'string' &&\n isObject(v.source) &&\n typeof v.source.id === 'string' &&\n isObject(v.chart) &&\n typeof v.chart.type === 'string'\n )\n}\n\nfunction blockOf(v: unknown): PageBlock | null {\n if (!isObject(v) || typeof v.id !== 'string' || !isObject(v.config)) return null\n const l = isObject(v.layout) ? v.layout : {}\n const layout = {\n x: clamp(l.x, 0, PAGE_GRID_COLUMNS - 1, 0),\n y: clamp(l.y, 0, 10_000, 0),\n w: clamp(l.w, 1, PAGE_GRID_COLUMNS, PAGE_GRID_COLUMNS),\n h: clamp(l.h, 1, 100, 4),\n }\n const config = v.config\n switch (v.kind) {\n case 'chart':\n case 'metric':\n return isPanelConfig(config) ? { id: v.id, kind: v.kind, layout, config } : null\n case 'text':\n return { id: v.id, kind: 'text', layout, config: { text: String(config.text ?? '') } }\n case 'table':\n return typeof config.view === 'string'\n ? { id: v.id, kind: 'table', layout, config: { view: config.view } }\n : null\n case 'document':\n return typeof config.document === 'string'\n ? { id: v.id, kind: 'document', layout, config: { document: config.document } }\n : null\n case 'gallery': {\n const documents = Array.isArray(config.documents)\n ? config.documents.filter((d): d is string => typeof d === 'string')\n : []\n return documents.length ? { id: v.id, kind: 'gallery', layout, config: { documents } } : null\n }\n default:\n return null\n }\n}\n\n/** A stored spec, checked: `null` when it is not a page (malformed blocks are dropped). */\nexport function parsePageSpec(value: unknown): PageSpec | null {\n if (!isObject(value) || value.version !== 1 || typeof value.title !== 'string') return null\n return {\n version: 1,\n title: value.title,\n ...(typeof value.description === 'string' && value.description\n ? { description: value.description }\n : {}),\n blocks: (Array.isArray(value.blocks) ? value.blocks : [])\n .map(blockOf)\n .filter((b): b is PageBlock => b !== null),\n }\n}\n\n/** A dashboard spec saved before pages (its JSON), checked. */\nfunction parseDashboardJson(json: string | null): DashboardSpec | null {\n if (json === null) return null\n let parsed: unknown\n try {\n parsed = JSON.parse(json)\n } catch {\n return null\n }\n if (!isObject(parsed) || typeof parsed.title !== 'string') return null\n const panels = (Array.isArray(parsed.panels) ? parsed.panels : []).filter(\n (p): p is PanelSpec =>\n isObject(p) &&\n typeof p.id === 'string' &&\n typeof p.title === 'string' &&\n isPanelConfig({ ...p, title: p.title })\n )\n return {\n version: 1,\n title: parsed.title,\n ...(typeof parsed.description === 'string' ? { description: parsed.description } : {}),\n panels,\n }\n}\n\nconst EMPTY: PageSpec = { version: 1, title: '', blocks: [] }\n\n/** A page as the hooks give it. */\nexport function savedPageOf(page: Page): SavedPage {\n const legacy = page.workspaceId === null\n const dashboard = legacy ? parseDashboardJson(page.legacyJson) : null\n const spec = legacy\n ? dashboard && pageFromDashboard(dashboard)\n : parsePageSpec(page.spec as unknown)\n return {\n id: page.id,\n workspaceId: page.workspaceId,\n shared: page.shared,\n spec: spec ?? EMPTY,\n viewIds: page.viewIds,\n documentIds: page.documentIds,\n createdBy: page.createdBy,\n updatedAt: page.updatedAt,\n legacy,\n unreadable: page.unreadable || spec === null,\n }\n}\n\n/** The open workspace's id, or '' with none open. */\nfunction openWorkspaceId(arbi: ReturnType<typeof useArbi>): string {\n return arbi.hasWorkspace ? arbi.getWorkspaceId() : ''\n}\n\n/** The open workspace's pages the user can see (shared ones and their own), oldest first. */\nexport function usePages() {\n const arbi = useArbi()\n const workspaceId = openWorkspaceId(arbi)\n return useQuery({\n queryKey: arbiQueryKeys.pages(workspaceId),\n queryFn: () =>\n arbi.readInWorkspace(workspaceId, async () => (await arbi.pages.list()).map(savedPageOf)),\n enabled: !!workspaceId && arbi.isLoggedIn,\n staleTime: 1000 * 30,\n })\n}\n\nfunction usePageCache() {\n const arbi = useArbi()\n const queryClient = useQueryClient()\n const key = arbiQueryKeys.pages(openWorkspaceId(arbi))\n return {\n put: (page: SavedPage) =>\n queryClient.setQueryData<SavedPage[]>(key, (old = []) =>\n old.some((p) => p.id === page.id)\n ? old.map((p) => (p.id === page.id ? page : p))\n : [...old, page]\n ),\n drop: (id: string) =>\n queryClient.setQueryData<SavedPage[]>(key, (old = []) => old.filter((p) => p.id !== id)),\n }\n}\n\n/** Save a page: new without `id` (private unless `shared`), else its spec replaced. */\nexport function useSavePage() {\n const arbi = useArbi()\n const cache = usePageCache()\n return useMutation({\n mutationFn: async ({ id, spec, shared }: { id?: string; spec: PageSpec; shared?: boolean }) =>\n savedPageOf(\n id\n ? await arbi.pages.update(id, spec as unknown as PageSpecWire)\n : await arbi.pages.create({ spec: spec as unknown as PageSpecWire, shared })\n ),\n onSuccess: cache.put,\n })\n}\n\n/** Share a page with the workspace. One-way: a shared page stays shared (only an owner deletes it). */\nexport function useSharePage() {\n const arbi = useArbi()\n const cache = usePageCache()\n return useMutation({\n mutationFn: async (id: string) => savedPageOf(await arbi.pages.share(id)),\n onSuccess: cache.put,\n })\n}\n\nexport function useDeletePage() {\n const arbi = useArbi()\n const cache = usePageCache()\n return useMutation({\n mutationFn: (id: string) => arbi.pages.remove(id),\n onSuccess: (_void, id) => cache.drop(id),\n })\n}\n"],
5
- "mappings": "AAYA,SAAS,aAAa,UAAU,sBAAsB;AAEtD,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAOvB,MAAM,uBAAuB;AAW7B,MAAM,oBAAoB;AAgE1B,MAAM,uBAAsD;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AACX;AAEA,MAAM,WAAW,CAAC,MAChB,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;AAEzD,MAAM,QAAQ,CAAC,GAAY,IAAY,IAAY,aACjD,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI;AAMrF,SAAS,WAA8C,QAA2B;AACvF,MAAI,IAAI;AACR,MAAI,SAAS;A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AA,MAAK,CAAC,MAAM,CAAC,MACjD,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,EAAE,IAC5B,IAAI,IAAI,CAAC,MAAO,EAAE,OAAO,KAAK,KAAK,OAAO,CAAE,IAC5C,CAAC,GAAG,KAAK,IAAI;AAAA,IACnB;AAAA,IACF,MAAM,CAAC,OACL,YAAY,aAA0B,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;AAAA,EAC3F;AACF;AAGO,SAAS,cAAc;AAC5B,QAAM,OAAO,QAAQ;AACrB,QAAM,QAAQ,aAAa;AAC3B,SAAO,YAAY;AAAA,IACjB,YAAY,OAAO,EAAE,IAAI,MAAM,OAAO,MACpC;AAAA,MACE,KACI,MAAM,KAAK,MAAM,OAAO,IAAI,IAA+B,IAC3D,MAAM,KAAK,MAAM,OAAO,EAAE,MAAuC,OAAO,CAAC;AAAA,IAC/E;AAAA,IACF,WAAW,MAAM;AAAA,EACnB,CAAC;AACH;AAGO,SAAS,eAAe;AAC7B,QAAM,OAAO,QAAQ;AACrB,QAAM,QAAQ,aAAa;AAC3B,SAAO,YAAY;AAAA,IACjB,YAAY,OAAO,OAAe,YAAY,MAAM,KAAK,MAAM,MAAM,EAAE,CAAC;AAAA,IACxE,WAAW,MAAM;AAAA,EACnB,CAAC;AACH;AAEO,SAAS,gBAAgB;AAC9B,QAAM,OAAO,QAAQ;AACrB,QAAM,QAAQ,aAAa;AAC3B,SAAO,YAAY;AAAA,IACjB,YAAY,CAAC,OAAe,KAAK,MAAM,OAAO,EAAE;AAAA,IAChD,WAAW,CAAC,OAAO,OAAO,MAAM,KAAK,EAAE;AAAA,EACzC,CAAC;AACH;",
4
+ "sourcesContent": ["/**\n * Pages: the open workspace's layouts of live blocks (charts, metrics, text and table views), kept\n * on the server (`arbi.pages`, `/v1/pages`) under the workspace key. A page is its creator's until\n * shared. Sharing is one-way: a shared page is every member's to read and every editor's to edit,\n * and only a workspace owner deletes it. A shared page never shows a private view (the server\n * refuses: `PagePrivateContentError`).\n *\n * A page is a 12-column grid: each block has a place and a size (`layout`). Chart and metric blocks\n * carry an Analytics panel's config (source, chart); a table block carries only the view it shows.\n * Dashboards saved before pages come back as private pages (`legacy`), opened with the user's key;\n * saving one places it in the open workspace.\n */\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'\nimport type {\n AgendaBlockConfig,\n CarouselBlockConfig,\n ListBlockConfig,\n Page,\n PageSpecWire,\n StartBlockConfig,\n} from '@arbidocs/sdk/browser'\nimport { useArbi } from '../useArbi'\nimport { arbiQueryKeys } from '../query-keys'\nimport type { ChartSpec, DashboardSpec, DataSourceRef, PanelSpec } from './types'\n\n/**\n * The transient view through which a host asks for a chart of a database (\"Chart this\"): set it to\n * `{ id, name, workspaceId }` and open the pages, which start a new page on that database and clear it.\n */\nexport const ANALYTICS_CHART_VIEW = 'analytics.chartDatabase'\n\n/** A database to chart. */\nexport interface AnalyticsChartRequest {\n id: string\n name: string\n /** The database's workspace, so the new blocks read it from anywhere. */\n workspaceId?: string\n}\n\n/** The columns of a page's grid. */\nexport const PAGE_GRID_COLUMNS = 12\n\nexport type PageBlockKind =\n | 'chart'\n | 'metric'\n | 'text'\n | 'table'\n | 'document'\n | 'gallery'\n | 'list'\n | 'carousel'\n | 'agenda'\n | 'start'\n\n/**\n * The live kinds: the workspace home's sections as blocks. They name no item: each viewer sees\n * their own visible items of the block's source, so a shared page of them shows nobody anything new.\n */\nexport const LIVE_BLOCK_KINDS = ['list', 'carousel', 'agenda', 'start'] as const\n\nexport type { AgendaBlockConfig, CarouselBlockConfig, ListBlockConfig, StartBlockConfig }\n\n/** Where a block sits: column `x` (0\u201311) and row `y`, `w` columns wide and `h` rows high. */\nexport interface BlockLayout {\n x: number\n y: number\n w: number\n h: number\n}\n\n/** A chart or metric block: what an Analytics panel shows. */\nexport interface PanelBlockConfig {\n title: string\n description?: string\n source: DataSourceRef\n chart: ChartSpec\n}\n\ninterface BlockBase {\n id: string\n layout: BlockLayout\n}\n\nexport type PageBlock =\n | (BlockBase & { kind: 'chart'; config: PanelBlockConfig })\n | (BlockBase & { kind: 'metric'; config: PanelBlockConfig })\n | (BlockBase & { kind: 'text'; config: { text: string } })\n /** A saved table view, nothing else: its columns, filters and sort are the view's. */\n | (BlockBase & { kind: 'table'; config: { view: string } })\n /** One document (a PDF, a Word file, an image, a generated report), read-only. */\n | (BlockBase & { kind: 'document'; config: { document: string } })\n /** Documents shown one at a time, in this order, with previous / next and thumbnails. */\n | (BlockBase & { kind: 'gallery'; config: { documents: string[] } })\n /** The viewer's latest files, threads or facts, each row opening its item. */\n | (BlockBase & { kind: 'list'; config: ListBlockConfig })\n /** The viewer's skills (each opens its launcher) or workflows (each opens it), as cards. */\n | (BlockBase & { kind: 'carousel'; config: CarouselBlockConfig })\n /** The viewer's next calendar events. */\n | (BlockBase & { kind: 'agenda'; config: AgendaBlockConfig })\n /** The workspace home's Start band: what the viewer can start, and adding files. */\n | (BlockBase & { kind: 'start'; config: StartBlockConfig })\n\n/** One of the live blocks. */\nexport type LiveBlock = Extract<PageBlock, { kind: (typeof LIVE_BLOCK_KINDS)[number] }>\n\n/** A page: a titled grid of blocks. Plain JSON (`version` for later migrations). */\nexport interface PageSpec {\n version: 1\n title: string\n description?: string\n blocks: PageBlock[]\n}\n\n/** A page as read. */\nexport interface SavedPage {\n id: string\n /** `null`: a dashboard from before pages, not yet saved into a workspace. */\n workspaceId: string | null\n shared: boolean\n spec: PageSpec\n /** The views its table blocks show (the server's record). */\n viewIds: string[]\n /** The documents its document and gallery blocks show (the server's record). */\n documentIds: string[]\n createdBy: string | null\n updatedAt: string\n /** A dashboard from before pages (sealed to the user): saving it places it in this workspace. */\n legacy: boolean\n /** It could not be opened (sealed under another key, or damaged): it can only be deleted. */\n unreadable: boolean\n}\n\n/**\n * A new block's height in rows, by kind: whole slots of the page's grid (a slot is 3 rows tall\n * and 3 columns wide): a metric or a text one slot, the rest two.\n */\nexport const DEFAULT_BLOCK_HEIGHT: Record<PageBlockKind, number> = {\n metric: 3,\n text: 3,\n chart: 6,\n table: 6,\n document: 6,\n gallery: 6,\n list: 6,\n carousel: 3,\n agenda: 6,\n start: 3,\n}\n\n/** The bounds of the live blocks' configs (the server's, `src/models/page.py`). */\nexport const LIVE_BLOCK_LIMITS = {\n listRows: { min: 1, max: 25, default: 5 },\n carouselItems: { min: 1, max: 50, default: 12 },\n agendaDays: { min: 1, max: 31, default: 7 },\n agendaEvents: { min: 1, max: 50, default: 8 },\n} as const\n\nconst LIST_SOURCES: ReadonlyArray<ListBlockConfig['source']> = [\n 'documents',\n 'conversations',\n 'facts',\n]\nconst FACTS_GROUPS: ReadonlyArray<NonNullable<ListBlockConfig['facts']>> = [\n 'upcoming_and_newest',\n 'upcoming',\n 'newest',\n]\nconst CAROUSEL_SOURCES: ReadonlyArray<CarouselBlockConfig['source']> = ['skills', 'workflows']\n\nconst oneOf = <T extends string>(options: ReadonlyArray<T>, v: unknown): T | undefined =>\n options.find((o) => o === v)\n\nconst bounded = (v: unknown, b: { min: number; max: number; default: number }) =>\n clamp(v, b.min, b.max, b.default)\n\nconst isObject = (v: unknown): v is Record<string, unknown> =>\n typeof v === 'object' && v !== null && !Array.isArray(v)\n\nconst clamp = (n: unknown, lo: number, hi: number, fallback: number) =>\n typeof n === 'number' && Number.isFinite(n) ? Math.min(hi, Math.max(lo, Math.round(n))) : fallback\n\n/**\n * Place blocks in order, left to right in rows: a block goes beside the last one when it fits in\n * the 12 columns, else below everything placed so far. Each keeps its size.\n */\nexport function packBlocks<B extends { layout: BlockLayout }>(blocks: readonly B[]): B[] {\n let x = 0\n let rowTop = 0\n let bottom = 0\n return blocks.map((b) => {\n const w = clamp(b.layout.w, 1, PAGE_GRID_COLUMNS, PAGE_GRID_COLUMNS)\n const h = clamp(b.layout.h, 1, 100, 4)\n if (x + w > PAGE_GRID_COLUMNS) {\n x = 0\n rowTop = bottom\n }\n const layout = { x, y: rowTop, w, h }\n x += w\n bottom = Math.max(bottom, rowTop + h)\n return { ...b, layout }\n })\n}\n\n/** A chart or metric block of an Analytics panel. */\nexport function blockOfPanel(panel: PanelSpec, h?: number): PageBlock {\n const kind = panel.chart.type === 'metric' ? 'metric' : 'chart'\n return {\n id: panel.id,\n kind,\n layout: { x: 0, y: 0, w: panel.width ?? PAGE_GRID_COLUMNS, h: h ?? DEFAULT_BLOCK_HEIGHT[kind] },\n config: {\n title: panel.title,\n ...(panel.description ? { description: panel.description } : {}),\n source: panel.source,\n chart: panel.chart,\n },\n }\n}\n\n/** The Analytics panel a chart or metric block draws. */\nexport function panelOfBlock(block: Extract<PageBlock, { kind: 'chart' | 'metric' }>): PanelSpec {\n return {\n id: block.id,\n title: block.config.title,\n ...(block.config.description ? { description: block.config.description } : {}),\n source: block.config.source,\n chart: block.config.chart,\n width: block.layout.w,\n }\n}\n\n/** A dashboard (a template, or one saved before pages) as a page: its panels as blocks, in order. */\nexport function pageFromDashboard(dashboard: DashboardSpec): PageSpec {\n return {\n version: 1,\n title: dashboard.title,\n ...(dashboard.description ? { description: dashboard.description } : {}),\n blocks: packBlocks(dashboard.panels.map((p) => blockOfPanel(p))),\n }\n}\n\nfunction isPanelConfig(v: unknown): v is PanelBlockConfig {\n return (\n isObject(v) &&\n typeof v.title === 'string' &&\n isObject(v.source) &&\n typeof v.source.id === 'string' &&\n isObject(v.chart) &&\n typeof v.chart.type === 'string'\n )\n}\n\nfunction blockOf(v: unknown): PageBlock | null {\n if (!isObject(v) || typeof v.id !== 'string') return null\n // An agenda or a Start block may carry no config (the server's defaults); every other kind has one.\n if (!isObject(v.config) && v.kind !== 'agenda' && v.kind !== 'start') return null\n const l = isObject(v.layout) ? v.layout : {}\n const layout = {\n x: clamp(l.x, 0, PAGE_GRID_COLUMNS - 1, 0),\n y: clamp(l.y, 0, 10_000, 0),\n w: clamp(l.w, 1, PAGE_GRID_COLUMNS, PAGE_GRID_COLUMNS),\n h: clamp(l.h, 1, 100, 4),\n }\n const config = isObject(v.config) ? v.config : {}\n switch (v.kind) {\n case 'chart':\n case 'metric':\n return isPanelConfig(config) ? { id: v.id, kind: v.kind, layout, config } : null\n case 'text':\n return { id: v.id, kind: 'text', layout, config: { text: String(config.text ?? '') } }\n case 'table':\n return typeof config.view === 'string'\n ? { id: v.id, kind: 'table', layout, config: { view: config.view } }\n : null\n case 'document':\n return typeof config.document === 'string'\n ? { id: v.id, kind: 'document', layout, config: { document: config.document } }\n : null\n case 'gallery': {\n const documents = Array.isArray(config.documents)\n ? config.documents.filter((d): d is string => typeof d === 'string')\n : []\n return documents.length ? { id: v.id, kind: 'gallery', layout, config: { documents } } : null\n }\n case 'list': {\n const source = oneOf(LIST_SOURCES, config.source)\n if (!source) return null\n const facts = source === 'facts' ? oneOf(FACTS_GROUPS, config.facts) : undefined\n return {\n id: v.id,\n kind: 'list',\n layout,\n config: {\n source,\n limit: bounded(config.limit, LIVE_BLOCK_LIMITS.listRows),\n ...(facts ? { facts } : {}),\n },\n }\n }\n case 'carousel': {\n const source = oneOf(CAROUSEL_SOURCES, config.source)\n return source\n ? {\n id: v.id,\n kind: 'carousel',\n layout,\n config: { source, limit: bounded(config.limit, LIVE_BLOCK_LIMITS.carouselItems) },\n }\n : null\n }\n case 'agenda':\n return {\n id: v.id,\n kind: 'agenda',\n layout,\n config: {\n days: bounded(config.days, LIVE_BLOCK_LIMITS.agendaDays),\n limit: bounded(config.limit, LIVE_BLOCK_LIMITS.agendaEvents),\n },\n }\n case 'start':\n return { id: v.id, kind: 'start', layout, config: {} }\n default:\n return null\n }\n}\n\n/** A stored spec, checked: `null` when it is not a page (malformed blocks are dropped). */\nexport function parsePageSpec(value: unknown): PageSpec | null {\n if (!isObject(value) || value.version !== 1 || typeof value.title !== 'string') return null\n return {\n version: 1,\n title: value.title,\n ...(typeof value.description === 'string' && value.description\n ? { description: value.description }\n : {}),\n blocks: (Array.isArray(value.blocks) ? value.blocks : [])\n .map(blockOf)\n .filter((b): b is PageBlock => b !== null),\n }\n}\n\n/** A dashboard spec saved before pages (its JSON), checked. */\nfunction parseDashboardJson(json: string | null): DashboardSpec | null {\n if (json === null) return null\n let parsed: unknown\n try {\n parsed = JSON.parse(json)\n } catch {\n return null\n }\n if (!isObject(parsed) || typeof parsed.title !== 'string') return null\n const panels = (Array.isArray(parsed.panels) ? parsed.panels : []).filter(\n (p): p is PanelSpec =>\n isObject(p) &&\n typeof p.id === 'string' &&\n typeof p.title === 'string' &&\n isPanelConfig({ ...p, title: p.title })\n )\n return {\n version: 1,\n title: parsed.title,\n ...(typeof parsed.description === 'string' ? { description: parsed.description } : {}),\n panels,\n }\n}\n\nconst EMPTY: PageSpec = { version: 1, title: '', blocks: [] }\n\n/** A page as the hooks give it. */\nexport function savedPageOf(page: Page): SavedPage {\n const legacy = page.workspaceId === null\n const dashboard = legacy ? parseDashboardJson(page.legacyJson) : null\n const spec = legacy\n ? dashboard && pageFromDashboard(dashboard)\n : parsePageSpec(page.spec as unknown)\n return {\n id: page.id,\n workspaceId: page.workspaceId,\n shared: page.shared,\n spec: spec ?? EMPTY,\n viewIds: page.viewIds,\n documentIds: page.documentIds,\n createdBy: page.createdBy,\n updatedAt: page.updatedAt,\n legacy,\n unreadable: page.unreadable || spec === null,\n }\n}\n\n/** The open workspace's id, or '' with none open. */\nfunction openWorkspaceId(arbi: ReturnType<typeof useArbi>): string {\n return arbi.hasWorkspace ? arbi.getWorkspaceId() : ''\n}\n\n/** The open workspace's pages the user can see (shared ones and their own), oldest first. */\nexport function usePages() {\n const arbi = useArbi()\n const workspaceId = openWorkspaceId(arbi)\n return useQuery({\n queryKey: arbiQueryKeys.pages(workspaceId),\n queryFn: () =>\n arbi.readInWorkspace(workspaceId, async () => (await arbi.pages.list()).map(savedPageOf)),\n enabled: !!workspaceId && arbi.isLoggedIn,\n staleTime: 1000 * 30,\n })\n}\n\nfunction usePageCache() {\n const arbi = useArbi()\n const queryClient = useQueryClient()\n const key = arbiQueryKeys.pages(openWorkspaceId(arbi))\n return {\n put: (page: SavedPage) =>\n queryClient.setQueryData<SavedPage[]>(key, (old = []) =>\n old.some((p) => p.id === page.id)\n ? old.map((p) => (p.id === page.id ? page : p))\n : [...old, page]\n ),\n drop: (id: string) =>\n queryClient.setQueryData<SavedPage[]>(key, (old = []) => old.filter((p) => p.id !== id)),\n }\n}\n\n/** Save a page: new without `id` (private unless `shared`), else its spec replaced. */\nexport function useSavePage() {\n const arbi = useArbi()\n const cache = usePageCache()\n return useMutation({\n mutationFn: async ({ id, spec, shared }: { id?: string; spec: PageSpec; shared?: boolean }) =>\n savedPageOf(\n id\n ? await arbi.pages.update(id, spec as unknown as PageSpecWire)\n : await arbi.pages.create({ spec: spec as unknown as PageSpecWire, shared })\n ),\n onSuccess: cache.put,\n })\n}\n\n/** Share a page with the workspace. One-way: a shared page stays shared (only an owner deletes it). */\nexport function useSharePage() {\n const arbi = useArbi()\n const cache = usePageCache()\n return useMutation({\n mutationFn: async (id: string) => savedPageOf(await arbi.pages.share(id)),\n onSuccess: cache.put,\n })\n}\n\nexport function useDeletePage() {\n const arbi = useArbi()\n const cache = usePageCache()\n return useMutation({\n mutationFn: (id: string) => arbi.pages.remove(id),\n onSuccess: (_void, id) => cache.drop(id),\n })\n}\n"],
5
+ "mappings": "AAYA,SAAS,aAAa,UAAU,sBAAsB;AAStD,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAOvB,MAAM,uBAAuB;AAW7B,MAAM,oBAAoB;AAkB1B,MAAM,mBAAmB,CAAC,QAAQ,YAAY,UAAU,OAAO;AA8E/D,MAAM,uBAAsD;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AACT;AAGO,MAAM,oBAAoB;AAAA,EAC/B,UAAU,EAAE,KAAK,GAAG,KAAK,IAAI,SAAS,EAAE;AAAA,EACxC,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