@arbidocs/blocks 0.4.5 → 0.4.6

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 (131) hide show
  1. package/README.md +46 -6
  2. package/dist/agents/index.cjs +163 -162
  3. package/dist/agents/index.js +6 -5
  4. package/dist/chat/ChatMessageContent.d.ts +16 -0
  5. package/dist/chat/ChatPage.d.ts +11 -8
  6. package/dist/chat/ChatThreads.d.ts +3 -1
  7. package/dist/chat/CitationMark.d.ts +18 -0
  8. package/dist/chat/chat-page-types.d.ts +75 -1
  9. package/dist/chat/index.cjs +126 -117
  10. package/dist/chat/index.d.ts +3 -1
  11. package/dist/chat/index.js +5 -4
  12. package/dist/{chunk-3MIQASHO.cjs → chunk-23XL6SVZ.cjs} +39 -19
  13. package/dist/chunk-23XL6SVZ.cjs.map +1 -0
  14. package/dist/{chunk-ULWRNGGE.cjs → chunk-2ZTONLT5.cjs} +4 -25
  15. package/dist/chunk-2ZTONLT5.cjs.map +1 -0
  16. package/dist/{chunk-O637DUKS.cjs → chunk-56BUD74K.cjs} +28 -28
  17. package/dist/{chunk-O637DUKS.cjs.map → chunk-56BUD74K.cjs.map} +1 -1
  18. package/dist/{chunk-YLOKCIQJ.cjs → chunk-5SLLMK5K.cjs} +421 -115
  19. package/dist/chunk-5SLLMK5K.cjs.map +1 -0
  20. package/dist/{chunk-SS23F63U.cjs → chunk-5ZBP7TCD.cjs} +55 -3
  21. package/dist/chunk-5ZBP7TCD.cjs.map +1 -0
  22. package/dist/{chunk-3PZPRAAR.cjs → chunk-67HGXV4I.cjs} +14 -14
  23. package/dist/{chunk-3PZPRAAR.cjs.map → chunk-67HGXV4I.cjs.map} +1 -1
  24. package/dist/{chunk-RCP6THBS.js → chunk-7OCFHEE6.js} +3 -3
  25. package/dist/{chunk-RCP6THBS.js.map → chunk-7OCFHEE6.js.map} +1 -1
  26. package/dist/{chunk-TX2ZICS7.js → chunk-CPMNAJLF.js} +4 -24
  27. package/dist/chunk-CPMNAJLF.js.map +1 -0
  28. package/dist/{chunk-5XTZFH65.js → chunk-CVFBSUXL.js} +5 -5
  29. package/dist/{chunk-5XTZFH65.js.map → chunk-CVFBSUXL.js.map} +1 -1
  30. package/dist/chunk-DCDVWPMB.cjs +29 -0
  31. package/dist/chunk-DCDVWPMB.cjs.map +1 -0
  32. package/dist/{chunk-TI4UTYRL.js → chunk-EY2RJW27.js} +258 -10
  33. package/dist/chunk-EY2RJW27.js.map +1 -0
  34. package/dist/{chunk-7YADKWZT.js → chunk-G2E3O3HI.js} +3 -3
  35. package/dist/{chunk-7YADKWZT.js.map → chunk-G2E3O3HI.js.map} +1 -1
  36. package/dist/{chunk-6YHWXMPQ.js → chunk-G2T3KTZ3.js} +419 -115
  37. package/dist/chunk-G2T3KTZ3.js.map +1 -0
  38. package/dist/{chunk-2NNTQLBY.js → chunk-IAKUTBPX.js} +4 -4
  39. package/dist/{chunk-2NNTQLBY.js.map → chunk-IAKUTBPX.js.map} +1 -1
  40. package/dist/{chunk-IZHWP6WQ.cjs → chunk-JG4TFS3Z.cjs} +6 -6
  41. package/dist/{chunk-IZHWP6WQ.cjs.map → chunk-JG4TFS3Z.cjs.map} +1 -1
  42. package/dist/chunk-JLOYWXRB.js +1156 -0
  43. package/dist/chunk-JLOYWXRB.js.map +1 -0
  44. package/dist/{chunk-WJZBJUPX.js → chunk-KXMDOTGW.js} +56 -4
  45. package/dist/chunk-KXMDOTGW.js.map +1 -0
  46. package/dist/{chunk-2VBJ763Y.js → chunk-KZJAG7T3.js} +37 -7
  47. package/dist/chunk-KZJAG7T3.js.map +1 -0
  48. package/dist/{chunk-RIL7G7AS.cjs → chunk-MGUHR3JI.cjs} +4 -4
  49. package/dist/{chunk-RIL7G7AS.cjs.map → chunk-MGUHR3JI.cjs.map} +1 -1
  50. package/dist/{chunk-NPKGUQU5.js → chunk-NJL4LIXX.js} +4 -4
  51. package/dist/{chunk-NPKGUQU5.js.map → chunk-NJL4LIXX.js.map} +1 -1
  52. package/dist/{chunk-DN3NFNIA.cjs → chunk-QMDLPO3M.cjs} +266 -10
  53. package/dist/chunk-QMDLPO3M.cjs.map +1 -0
  54. package/dist/chunk-TJMKFY5P.js +27 -0
  55. package/dist/chunk-TJMKFY5P.js.map +1 -0
  56. package/dist/{chunk-3PJCET7H.js → chunk-UHVNYKV2.js} +38 -18
  57. package/dist/chunk-UHVNYKV2.js.map +1 -0
  58. package/dist/{chunk-6CHMNKXC.cjs → chunk-UTYQPVIW.cjs} +11 -11
  59. package/dist/chunk-UTYQPVIW.cjs.map +1 -0
  60. package/dist/{chunk-KHX2BX3S.cjs → chunk-VGOFFCMT.cjs} +37 -5
  61. package/dist/chunk-VGOFFCMT.cjs.map +1 -0
  62. package/dist/{chunk-67MKU5U7.js → chunk-YMHGF6R5.js} +8 -8
  63. package/dist/chunk-YMHGF6R5.js.map +1 -0
  64. package/dist/chunk-YVIOCITQ.cjs +1186 -0
  65. package/dist/chunk-YVIOCITQ.cjs.map +1 -0
  66. package/dist/{chunk-MVNCQDDE.cjs → chunk-ZVPTFTGV.cjs} +4 -4
  67. package/dist/{chunk-MVNCQDDE.cjs.map → chunk-ZVPTFTGV.cjs.map} +1 -1
  68. package/dist/collaboration/index.cjs +38 -37
  69. package/dist/collaboration/index.js +3 -2
  70. package/dist/connect/index.cjs +358 -19
  71. package/dist/connect/index.cjs.map +1 -1
  72. package/dist/connect/index.d.ts +1 -0
  73. package/dist/connect/index.js +341 -9
  74. package/dist/connect/index.js.map +1 -1
  75. package/dist/connection/ConnectedSettings.d.ts +64 -0
  76. package/dist/facts/index.cjs +2 -2
  77. package/dist/facts/index.js +2 -2
  78. package/dist/files/index.cjs +15 -14
  79. package/dist/files/index.cjs.map +1 -1
  80. package/dist/files/index.js +5 -4
  81. package/dist/files/index.js.map +1 -1
  82. package/dist/home/index.cjs +19 -19
  83. package/dist/home/index.js +4 -4
  84. package/dist/index.cjs +526 -477
  85. package/dist/index.cjs.map +1 -1
  86. package/dist/index.js +17 -16
  87. package/dist/index.js.map +1 -1
  88. package/dist/lib/bottom-inset.d.ts +16 -0
  89. package/dist/lib/useElementSize.d.ts +13 -0
  90. package/dist/lib/useFillHeight.d.ts +10 -0
  91. package/dist/settings/account-views.d.ts +55 -0
  92. package/dist/settings/index.cjs +179 -1148
  93. package/dist/settings/index.cjs.map +1 -1
  94. package/dist/settings/index.d.ts +1 -0
  95. package/dist/settings/index.js +10 -1073
  96. package/dist/settings/index.js.map +1 -1
  97. package/dist/shell/InstallPrompt.d.ts +28 -0
  98. package/dist/shell/MobileBars.d.ts +1 -1
  99. package/dist/shell/index.cjs +85 -45
  100. package/dist/shell/index.d.ts +4 -0
  101. package/dist/shell/index.js +3 -3
  102. package/dist/shell/install-instructions.d.ts +19 -0
  103. package/dist/shell/types.d.ts +6 -0
  104. package/dist/shell/use-install-prompt.d.ts +49 -0
  105. package/dist/site/index.cjs +62 -62
  106. package/dist/site/index.js +2 -2
  107. package/dist/studio/index.cjs +78 -77
  108. package/dist/studio/index.cjs.map +1 -1
  109. package/dist/studio/index.js +8 -7
  110. package/dist/studio/index.js.map +1 -1
  111. package/dist/theme/ThemeEditor.d.ts +4 -2
  112. package/dist/workspaces/index.cjs +4 -3
  113. package/dist/workspaces/index.cjs.map +1 -1
  114. package/dist/workspaces/index.js +3 -2
  115. package/dist/workspaces/index.js.map +1 -1
  116. package/package.json +8 -4
  117. package/src/blocks.css +30 -0
  118. package/dist/chunk-2VBJ763Y.js.map +0 -1
  119. package/dist/chunk-3MIQASHO.cjs.map +0 -1
  120. package/dist/chunk-3PJCET7H.js.map +0 -1
  121. package/dist/chunk-67MKU5U7.js.map +0 -1
  122. package/dist/chunk-6CHMNKXC.cjs.map +0 -1
  123. package/dist/chunk-6YHWXMPQ.js.map +0 -1
  124. package/dist/chunk-DN3NFNIA.cjs.map +0 -1
  125. package/dist/chunk-KHX2BX3S.cjs.map +0 -1
  126. package/dist/chunk-SS23F63U.cjs.map +0 -1
  127. package/dist/chunk-TI4UTYRL.js.map +0 -1
  128. package/dist/chunk-TX2ZICS7.js.map +0 -1
  129. package/dist/chunk-ULWRNGGE.cjs.map +0 -1
  130. package/dist/chunk-WJZBJUPX.js.map +0 -1
  131. package/dist/chunk-YLOKCIQJ.cjs.map +0 -1
package/README.md CHANGED
@@ -96,24 +96,34 @@ import { PassagePill } from '@arbidocs/blocks/citations'
96
96
 
97
97
  ## Assistant chat page
98
98
 
99
- `ChatPage` (`@arbidocs/blocks/chat`) is a whole assistant chat: conversations with auto-titles, markdown
100
- answers, composer with a document chip and upload, empty, error and retry states, plus `header` and `aside`
101
- (workflow launcher) slots. It sizes to its container, so it holds up beside an open dock. Bind it with the
102
- `@arbidocs/react` hook:
99
+ `ChatPage` (`@arbidocs/blocks/chat`) is a whole assistant chat: the workspace's stored conversations (backend
100
+ titles, history loads on open), markdown answers whose citations are quiet numbered marks with a source popover
101
+ (document, page, passage, an open action through `onOpenCitation`), composer with a document chip, upload and a stop
102
+ button, empty, error and retry states, plus `header` and `aside` (workflow launcher) slots. It lays itself out by
103
+ its own width (`asideBreakpoint`, default 60rem: column above, one floating panel below) and has `fillHeight` /
104
+ `compactHeader` for a chat card under a page header. Bind it with the `@arbidocs/react` hook:
103
105
 
104
106
  ```tsx
105
107
  import { ChatPage, useChatSurface } from '@arbidocs/blocks/chat'
106
108
  import { useConnectedChat } from '@arbidocs/blocks/connect' // or useArbiChat({ workspaceId }) from @arbidocs/react
107
109
 
108
110
  const chat = useConnectedChat()
109
- <ChatPage chat={chat} header={<h2>Assistant</h2>} aside={<WorkflowLauncher … />} />
111
+ <ChatPage
112
+ chat={chat}
113
+ fillHeight compactHeader
114
+ onOpenCitation={(t) => openDocument(t.documentId, t.page)}
115
+ aside={<WorkflowLauncher … />}
116
+ />
110
117
 
111
118
  // The dock yields to a mounted page chat:
112
119
  const { isDockAvailable } = useChatSurface()
113
120
  {isDockAvailable && <MyDock />}
114
121
  ```
115
122
 
116
- Theme the user bubble with `--chat-user-bubble` and `--chat-user-bubble-foreground` (HSL triplets).
123
+ Theme the user bubble with `--chat-user-bubble` and `--chat-user-bubble-foreground` (HSL triplets). The
124
+ live example (`examples/react-chat`, sign in, pick a workspace, chat) and the mock-data
125
+ `packages/arbi-blocks/examples/custom-ui` (`npm run example:dev`) both mount it.
126
+
117
127
  ## Edit an artifact, save versions, compare
118
128
 
119
129
  `/artifacts` is the surface for an AI-drafted document the user may edit: a toolbar (Edit, Cancel,
@@ -160,6 +170,36 @@ import { EditorialHero, EditorialSection, PanelGrid, CtaBand } from '@arbidocs/b
160
170
  See `examples/custom-ui/MarketingPage.tsx` for a full page and `docs/design/blocks-package.md` for
161
171
  the part table.
162
172
 
173
+ ## Phone shell: tab bar, install prompt, bottom inset
174
+
175
+ ```tsx
176
+ import { InstallPrompt, MobileTabBar, Shell } from '@arbidocs/blocks/shell'
177
+
178
+ const items: NavItem[] = [
179
+ { id: 'chat', label: 'AI Assistant', shortLabel: 'Assistant', icon: <Chat />, onSelect },
180
+ // ...
181
+ ]
182
+ <Shell.Root tabBar={<MobileTabBar items={items} />} overlays={<InstallPrompt appName="Clarum" />}>
183
+ ```
184
+
185
+ - `MobileTabBar` labels wrap at word boundaries and are never ellipsised. Give an item a `shortLabel`
186
+ and a tab narrower than 5.5rem shows it (the full label stays the accessible name).
187
+ - `InstallPrompt` is a floating "Install app" pill: shown only when the browser fired
188
+ `beforeinstallprompt` (or on iOS, where it expands the Add to Home Screen steps), not when already
189
+ installed, dismissible with the dismissal remembered (`dismissDays`, default 30). Both targets are
190
+ 44px on a phone. `useInstallPrompt()` / `initInstallPrompt()` / `getInstallInstructions()` are the
191
+ headless parts (call `initInstallPrompt()` at app start so the one-shot event is not missed).
192
+ `autoPromptParam="install"` makes `/?install=true` open the native dialog.
193
+ - `--shell-bottom-inset` (on `<html>`) is how far the bottom bars reach up from the screen edge:
194
+ `MobileTabBar` and `Composer.Root` publish it (`useShellBottomInset(ref)` for your own bar). The
195
+ install prompt, and anything else floating at the bottom, positions itself with
196
+ `calc(var(--shell-bottom-inset, 0px) + 0.75rem)` so it never covers a tab label or the composer.
197
+ - Scroll containers use the `scrollbar-themed` utility class from `blocks.css` (thin, token-coloured;
198
+ override with `--scrollbar-thumb` / `--scrollbar-track`). Sidebar, dialogs and the chat list have it.
199
+ - Browser check: `npm run example:dev` (add `-- --port 5331`), or `npm run example:build` then
200
+ `npm run example:preview`; `npm run example:test:e2e` measures the example at 360 and 390px
201
+ against the production build.
202
+
163
203
  ## Workspaces: gallery and switcher in a few lines
164
204
 
165
205
  ```tsx