@arbidocs/react 0.5.83 → 0.5.85

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 (44) hide show
  1. package/README.md +56 -0
  2. package/dist/artifacts/index.cjs +9 -9
  3. package/dist/artifacts/index.js +3 -3
  4. package/dist/calls/livekit/index.cjs +48 -48
  5. package/dist/calls/livekit/index.js +3 -3
  6. package/dist/{chunk-FEPBB7VJ.cjs → chunk-2Y2WOIHH.cjs} +31 -31
  7. package/dist/{chunk-FEPBB7VJ.cjs.map → chunk-2Y2WOIHH.cjs.map} +1 -1
  8. package/dist/{chunk-RZWWSAQG.js → chunk-47YVW3J4.js} +3 -3
  9. package/dist/{chunk-RZWWSAQG.js.map → chunk-47YVW3J4.js.map} +1 -1
  10. package/dist/{chunk-VH234EOF.cjs → chunk-E7VD5WNY.cjs} +25 -25
  11. package/dist/{chunk-VH234EOF.cjs.map → chunk-E7VD5WNY.cjs.map} +1 -1
  12. package/dist/{chunk-B3C25GWG.js → chunk-JT7PN7JH.js} +4 -4
  13. package/dist/{chunk-B3C25GWG.js.map → chunk-JT7PN7JH.js.map} +1 -1
  14. package/dist/{chunk-JLJLPC5X.cjs → chunk-LUDIYWT7.cjs} +22 -22
  15. package/dist/{chunk-JLJLPC5X.cjs.map → chunk-LUDIYWT7.cjs.map} +1 -1
  16. package/dist/{chunk-FOB5QVGI.cjs → chunk-Q6U7ALNV.cjs} +16 -16
  17. package/dist/{chunk-FOB5QVGI.cjs.map → chunk-Q6U7ALNV.cjs.map} +1 -1
  18. package/dist/{chunk-UKLLE4FC.cjs → chunk-TAVS54EN.cjs} +4 -4
  19. package/dist/{chunk-UKLLE4FC.cjs.map → chunk-TAVS54EN.cjs.map} +1 -1
  20. package/dist/{chunk-26WAJNXN.js → chunk-VGAA7AFS.js} +3 -3
  21. package/dist/{chunk-26WAJNXN.js.map → chunk-VGAA7AFS.js.map} +1 -1
  22. package/dist/{chunk-AEG5ZMKH.cjs → chunk-VGMMK5OM.cjs} +2 -2
  23. package/dist/chunk-VGMMK5OM.cjs.map +1 -0
  24. package/dist/{chunk-EJIO2KAF.js → chunk-VGO77X5U.js} +2 -2
  25. package/dist/chunk-VGO77X5U.js.map +1 -0
  26. package/dist/{chunk-BB32GHDD.js → chunk-WQY3RQ6G.js} +4 -4
  27. package/dist/{chunk-BB32GHDD.js.map → chunk-WQY3RQ6G.js.map} +1 -1
  28. package/dist/{chunk-7R4SVVQE.js → chunk-XPLD4LFC.js} +3 -3
  29. package/dist/{chunk-7R4SVVQE.js.map → chunk-XPLD4LFC.js.map} +1 -1
  30. package/dist/document-tools/core.cjs +99 -99
  31. package/dist/document-tools/core.js +3 -3
  32. package/dist/document-tools/index.cjs +101 -101
  33. package/dist/document-tools/index.js +4 -4
  34. package/dist/index.cjs +2666 -1078
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +327 -28
  37. package/dist/index.d.ts +327 -28
  38. package/dist/index.js +1804 -242
  39. package/dist/index.js.map +1 -1
  40. package/dist/viewers/index.cjs +2 -2
  41. package/dist/viewers/index.js +1 -1
  42. package/package.json +3 -3
  43. package/dist/chunk-AEG5ZMKH.cjs.map +0 -1
  44. package/dist/chunk-EJIO2KAF.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkIU2CJNTB_cjs = require('../chunk-IU2CJNTB.cjs');
4
4
  var chunkTMPDW7J5_cjs = require('../chunk-TMPDW7J5.cjs');
5
- var chunkAEG5ZMKH_cjs = require('../chunk-AEG5ZMKH.cjs');
5
+ var chunkVGMMK5OM_cjs = require('../chunk-VGMMK5OM.cjs');
6
6
  require('../chunk-RCKA7BEF.cjs');
7
7
  var react = require('react');
8
8
  var reactPdf = require('react-pdf');
@@ -863,7 +863,7 @@ function DocumentViewer({
863
863
  errorRender,
864
864
  className
865
865
  }) {
866
- const arbi = chunkAEG5ZMKH_cjs.useArbi();
866
+ const arbi = chunkVGMMK5OM_cjs.useArbi();
867
867
  const [blob, setBlob] = react.useState(null);
868
868
  const [error, setError] = react.useState(null);
869
869
  const kind = react.useMemo(() => nativeViewerKind(doc), [doc]);
@@ -2,7 +2,7 @@ import { installPdfjsPolyfills } from '../chunk-PTOP7OHG.js';
2
2
  export { installPdfjsPolyfills } from '../chunk-PTOP7OHG.js';
3
3
  import { VideoViewer, AudioViewer, ImageViewer } from '../chunk-HDCRPPBW.js';
4
4
  export { AudioViewer, ImageViewer, VideoViewer } from '../chunk-HDCRPPBW.js';
5
- import { useArbi } from '../chunk-EJIO2KAF.js';
5
+ import { useArbi } from '../chunk-VGO77X5U.js';
6
6
  import '../chunk-CPZ36AQS.js';
7
7
  import { useEffect, useRef, useCallback, useLayoutEffect, useState, useMemo } from 'react';
8
8
  import { Document, Page, pdfjs } from 'react-pdf';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbidocs/react",
3
- "version": "0.5.83",
3
+ "version": "0.5.85",
4
4
  "description": "React hooks and provider for the ARBI SDK",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -109,8 +109,8 @@
109
109
  "build-storybook": "storybook build"
110
110
  },
111
111
  "dependencies": {
112
- "@arbidocs/client": "0.5.83",
113
- "@arbidocs/sdk": "0.5.83",
112
+ "@arbidocs/client": "0.5.85",
113
+ "@arbidocs/sdk": "0.5.85",
114
114
  "@didit-protocol/sdk-web": "0.4.0",
115
115
  "@livekit/components-react": "2.9.24",
116
116
  "@radix-ui/react-avatar": "^1.2.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/host/config.ts","../src/useArbi.ts"],"names":["useContext","ArbiHostContext"],"mappings":";;;;;AAsIO,SAAS,WAAA,GAA8B;AAC5C,EAAA,OAAOA,iBAAWC,iCAAe,CAAA;AACnC;;;ACjIO,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","file":"chunk-AEG5ZMKH.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 { ComponentType } from 'react'\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 { EntitySize } from '../entities/EntityPill'\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\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/** A person in the call UI (a participant, a speaker, a host). */\nexport interface CallUserPillProps {\n /** Their LiveKit identity: the user ext id. */\n identity: string\n /** The call's name for them, for someone the host does not know. */\n name?: string | null\n size?: EntitySize\n variant?: 'pill' | 'icon'\n /** Click opens a chat with them (off by default inside the call). */\n interactive?: boolean\n className?: string\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 /** How a person shows in the call UI. Absent: the plain user pill with the call's name. */\n UserPill?: ComponentType<CallUserPillProps>\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) and where saved dashboards are kept. Absent: the built-in sources, saved in a database.\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"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/host/config.ts","../src/useArbi.ts"],"names":[],"mappings":";;;AAsIO,SAAS,WAAA,GAA8B;AAC5C,EAAA,OAAO,WAAW,eAAe,CAAA;AACnC;;;ACjIO,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","file":"chunk-EJIO2KAF.js","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 { ComponentType } from 'react'\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 { EntitySize } from '../entities/EntityPill'\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\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/** A person in the call UI (a participant, a speaker, a host). */\nexport interface CallUserPillProps {\n /** Their LiveKit identity: the user ext id. */\n identity: string\n /** The call's name for them, for someone the host does not know. */\n name?: string | null\n size?: EntitySize\n variant?: 'pill' | 'icon'\n /** Click opens a chat with them (off by default inside the call). */\n interactive?: boolean\n className?: string\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 /** How a person shows in the call UI. Absent: the plain user pill with the call's name. */\n UserPill?: ComponentType<CallUserPillProps>\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) and where saved dashboards are kept. Absent: the built-in sources, saved in a database.\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"]}