@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.
- package/README.md +46 -6
- package/dist/agents/index.cjs +163 -162
- package/dist/agents/index.js +6 -5
- package/dist/chat/ChatMessageContent.d.ts +16 -0
- package/dist/chat/ChatPage.d.ts +11 -8
- package/dist/chat/ChatThreads.d.ts +3 -1
- package/dist/chat/CitationMark.d.ts +18 -0
- package/dist/chat/chat-page-types.d.ts +75 -1
- package/dist/chat/index.cjs +126 -117
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/index.js +5 -4
- package/dist/{chunk-3MIQASHO.cjs → chunk-23XL6SVZ.cjs} +39 -19
- package/dist/chunk-23XL6SVZ.cjs.map +1 -0
- package/dist/{chunk-ULWRNGGE.cjs → chunk-2ZTONLT5.cjs} +4 -25
- package/dist/chunk-2ZTONLT5.cjs.map +1 -0
- package/dist/{chunk-O637DUKS.cjs → chunk-56BUD74K.cjs} +28 -28
- package/dist/{chunk-O637DUKS.cjs.map → chunk-56BUD74K.cjs.map} +1 -1
- package/dist/{chunk-YLOKCIQJ.cjs → chunk-5SLLMK5K.cjs} +421 -115
- package/dist/chunk-5SLLMK5K.cjs.map +1 -0
- package/dist/{chunk-SS23F63U.cjs → chunk-5ZBP7TCD.cjs} +55 -3
- package/dist/chunk-5ZBP7TCD.cjs.map +1 -0
- package/dist/{chunk-3PZPRAAR.cjs → chunk-67HGXV4I.cjs} +14 -14
- package/dist/{chunk-3PZPRAAR.cjs.map → chunk-67HGXV4I.cjs.map} +1 -1
- package/dist/{chunk-RCP6THBS.js → chunk-7OCFHEE6.js} +3 -3
- package/dist/{chunk-RCP6THBS.js.map → chunk-7OCFHEE6.js.map} +1 -1
- package/dist/{chunk-TX2ZICS7.js → chunk-CPMNAJLF.js} +4 -24
- package/dist/chunk-CPMNAJLF.js.map +1 -0
- package/dist/{chunk-5XTZFH65.js → chunk-CVFBSUXL.js} +5 -5
- package/dist/{chunk-5XTZFH65.js.map → chunk-CVFBSUXL.js.map} +1 -1
- package/dist/chunk-DCDVWPMB.cjs +29 -0
- package/dist/chunk-DCDVWPMB.cjs.map +1 -0
- package/dist/{chunk-TI4UTYRL.js → chunk-EY2RJW27.js} +258 -10
- package/dist/chunk-EY2RJW27.js.map +1 -0
- package/dist/{chunk-7YADKWZT.js → chunk-G2E3O3HI.js} +3 -3
- package/dist/{chunk-7YADKWZT.js.map → chunk-G2E3O3HI.js.map} +1 -1
- package/dist/{chunk-6YHWXMPQ.js → chunk-G2T3KTZ3.js} +419 -115
- package/dist/chunk-G2T3KTZ3.js.map +1 -0
- package/dist/{chunk-2NNTQLBY.js → chunk-IAKUTBPX.js} +4 -4
- package/dist/{chunk-2NNTQLBY.js.map → chunk-IAKUTBPX.js.map} +1 -1
- package/dist/{chunk-IZHWP6WQ.cjs → chunk-JG4TFS3Z.cjs} +6 -6
- package/dist/{chunk-IZHWP6WQ.cjs.map → chunk-JG4TFS3Z.cjs.map} +1 -1
- package/dist/chunk-JLOYWXRB.js +1156 -0
- package/dist/chunk-JLOYWXRB.js.map +1 -0
- package/dist/{chunk-WJZBJUPX.js → chunk-KXMDOTGW.js} +56 -4
- package/dist/chunk-KXMDOTGW.js.map +1 -0
- package/dist/{chunk-2VBJ763Y.js → chunk-KZJAG7T3.js} +37 -7
- package/dist/chunk-KZJAG7T3.js.map +1 -0
- package/dist/{chunk-RIL7G7AS.cjs → chunk-MGUHR3JI.cjs} +4 -4
- package/dist/{chunk-RIL7G7AS.cjs.map → chunk-MGUHR3JI.cjs.map} +1 -1
- package/dist/{chunk-NPKGUQU5.js → chunk-NJL4LIXX.js} +4 -4
- package/dist/{chunk-NPKGUQU5.js.map → chunk-NJL4LIXX.js.map} +1 -1
- package/dist/{chunk-DN3NFNIA.cjs → chunk-QMDLPO3M.cjs} +266 -10
- package/dist/chunk-QMDLPO3M.cjs.map +1 -0
- package/dist/chunk-TJMKFY5P.js +27 -0
- package/dist/chunk-TJMKFY5P.js.map +1 -0
- package/dist/{chunk-3PJCET7H.js → chunk-UHVNYKV2.js} +38 -18
- package/dist/chunk-UHVNYKV2.js.map +1 -0
- package/dist/{chunk-6CHMNKXC.cjs → chunk-UTYQPVIW.cjs} +11 -11
- package/dist/chunk-UTYQPVIW.cjs.map +1 -0
- package/dist/{chunk-KHX2BX3S.cjs → chunk-VGOFFCMT.cjs} +37 -5
- package/dist/chunk-VGOFFCMT.cjs.map +1 -0
- package/dist/{chunk-67MKU5U7.js → chunk-YMHGF6R5.js} +8 -8
- package/dist/chunk-YMHGF6R5.js.map +1 -0
- package/dist/chunk-YVIOCITQ.cjs +1186 -0
- package/dist/chunk-YVIOCITQ.cjs.map +1 -0
- package/dist/{chunk-MVNCQDDE.cjs → chunk-ZVPTFTGV.cjs} +4 -4
- package/dist/{chunk-MVNCQDDE.cjs.map → chunk-ZVPTFTGV.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +38 -37
- package/dist/collaboration/index.js +3 -2
- package/dist/connect/index.cjs +358 -19
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +341 -9
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedSettings.d.ts +64 -0
- package/dist/facts/index.cjs +2 -2
- package/dist/facts/index.js +2 -2
- package/dist/files/index.cjs +15 -14
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +5 -4
- package/dist/files/index.js.map +1 -1
- package/dist/home/index.cjs +19 -19
- package/dist/home/index.js +4 -4
- package/dist/index.cjs +526 -477
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -16
- package/dist/index.js.map +1 -1
- package/dist/lib/bottom-inset.d.ts +16 -0
- package/dist/lib/useElementSize.d.ts +13 -0
- package/dist/lib/useFillHeight.d.ts +10 -0
- package/dist/settings/account-views.d.ts +55 -0
- package/dist/settings/index.cjs +179 -1148
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.ts +1 -0
- package/dist/settings/index.js +10 -1073
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/InstallPrompt.d.ts +28 -0
- package/dist/shell/MobileBars.d.ts +1 -1
- package/dist/shell/index.cjs +85 -45
- package/dist/shell/index.d.ts +4 -0
- package/dist/shell/index.js +3 -3
- package/dist/shell/install-instructions.d.ts +19 -0
- package/dist/shell/types.d.ts +6 -0
- package/dist/shell/use-install-prompt.d.ts +49 -0
- package/dist/site/index.cjs +62 -62
- package/dist/site/index.js +2 -2
- package/dist/studio/index.cjs +78 -77
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +8 -7
- package/dist/studio/index.js.map +1 -1
- package/dist/theme/ThemeEditor.d.ts +4 -2
- package/dist/workspaces/index.cjs +4 -3
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.js +3 -2
- package/dist/workspaces/index.js.map +1 -1
- package/package.json +8 -4
- package/src/blocks.css +30 -0
- package/dist/chunk-2VBJ763Y.js.map +0 -1
- package/dist/chunk-3MIQASHO.cjs.map +0 -1
- package/dist/chunk-3PJCET7H.js.map +0 -1
- package/dist/chunk-67MKU5U7.js.map +0 -1
- package/dist/chunk-6CHMNKXC.cjs.map +0 -1
- package/dist/chunk-6YHWXMPQ.js.map +0 -1
- package/dist/chunk-DN3NFNIA.cjs.map +0 -1
- package/dist/chunk-KHX2BX3S.cjs.map +0 -1
- package/dist/chunk-SS23F63U.cjs.map +0 -1
- package/dist/chunk-TI4UTYRL.js.map +0 -1
- package/dist/chunk-TX2ZICS7.js.map +0 -1
- package/dist/chunk-ULWRNGGE.cjs.map +0 -1
- package/dist/chunk-WJZBJUPX.js.map +0 -1
- 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:
|
|
100
|
-
|
|
101
|
-
(
|
|
102
|
-
|
|
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
|
|
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
|