@arbidocs/blocks 0.4.4 → 0.4.5

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 (64) hide show
  1. package/README.md +25 -0
  2. package/dist/agents/index.cjs +163 -163
  3. package/dist/agents/index.js +6 -6
  4. package/dist/artifacts/ArtifactCompareBar.d.ts +33 -0
  5. package/dist/artifacts/ArtifactEditor.d.ts +64 -0
  6. package/dist/artifacts/ArtifactEditorBody.d.ts +34 -0
  7. package/dist/artifacts/ArtifactRedlineView.d.ts +57 -0
  8. package/dist/artifacts/ArtifactToolbar.d.ts +53 -0
  9. package/dist/artifacts/ArtifactVersionBar.d.ts +42 -0
  10. package/dist/{files → artifacts}/RedlineParts.d.ts +4 -0
  11. package/dist/artifacts/editor/ArtifactMarkdownEditor.d.ts +39 -0
  12. package/dist/artifacts/editor/index.cjs +89 -0
  13. package/dist/artifacts/editor/index.cjs.map +1 -0
  14. package/dist/artifacts/editor/index.d.ts +1 -0
  15. package/dist/artifacts/editor/index.js +86 -0
  16. package/dist/artifacts/editor/index.js.map +1 -0
  17. package/dist/artifacts/index.cjs +807 -0
  18. package/dist/artifacts/index.cjs.map +1 -0
  19. package/dist/artifacts/index.d.ts +8 -0
  20. package/dist/artifacts/index.js +787 -0
  21. package/dist/artifacts/index.js.map +1 -0
  22. package/dist/chat/index.cjs +54 -54
  23. package/dist/chat/index.js +2 -2
  24. package/dist/{chunk-XKKGGUU2.cjs → chunk-3MIQASHO.cjs} +4 -4
  25. package/dist/{chunk-XKKGGUU2.cjs.map → chunk-3MIQASHO.cjs.map} +1 -1
  26. package/dist/{chunk-B673CCW5.js → chunk-3PJCET7H.js} +3 -3
  27. package/dist/{chunk-B673CCW5.js.map → chunk-3PJCET7H.js.map} +1 -1
  28. package/dist/{chunk-DGVKBOY5.cjs → chunk-3PZPRAAR.cjs} +14 -14
  29. package/dist/{chunk-DGVKBOY5.cjs.map → chunk-3PZPRAAR.cjs.map} +1 -1
  30. package/dist/{chunk-BBEMPS6C.js → chunk-5XTZFH65.js} +6 -6
  31. package/dist/{chunk-BBEMPS6C.js.map → chunk-5XTZFH65.js.map} +1 -1
  32. package/dist/{chunk-JPO3F4J7.js → chunk-6YHWXMPQ.js} +3 -3
  33. package/dist/{chunk-JPO3F4J7.js.map → chunk-6YHWXMPQ.js.map} +1 -1
  34. package/dist/{chunk-ZVPTFTGV.cjs → chunk-MVNCQDDE.cjs} +4 -4
  35. package/dist/{chunk-ZVPTFTGV.cjs.map → chunk-MVNCQDDE.cjs.map} +1 -1
  36. package/dist/{chunk-NJL4LIXX.js → chunk-NPKGUQU5.js} +4 -4
  37. package/dist/{chunk-NJL4LIXX.js.map → chunk-NPKGUQU5.js.map} +1 -1
  38. package/dist/{chunk-ATXPAD6S.cjs → chunk-YLOKCIQJ.cjs} +3 -3
  39. package/dist/{chunk-ATXPAD6S.cjs.map → chunk-YLOKCIQJ.cjs.map} +1 -1
  40. package/dist/connect/index.cjs +18 -18
  41. package/dist/connect/index.js +4 -4
  42. package/dist/facts/index.cjs +1 -1
  43. package/dist/facts/index.js +1 -1
  44. package/dist/files/ViewerChrome.d.ts +0 -45
  45. package/dist/files/ViewerParts.d.ts +0 -19
  46. package/dist/files/index.cjs +4 -436
  47. package/dist/files/index.cjs.map +1 -1
  48. package/dist/files/index.d.ts +2 -4
  49. package/dist/files/index.js +8 -428
  50. package/dist/files/index.js.map +1 -1
  51. package/dist/home/index.cjs +19 -19
  52. package/dist/home/index.js +4 -4
  53. package/dist/index.cjs +415 -415
  54. package/dist/index.js +14 -14
  55. package/dist/settings/index.cjs +3 -3
  56. package/dist/settings/index.js +4 -4
  57. package/dist/shell/index.cjs +10 -10
  58. package/dist/shell/index.js +2 -2
  59. package/dist/site/index.cjs +5 -5
  60. package/dist/site/index.js +1 -1
  61. package/dist/studio/index.cjs +8 -8
  62. package/dist/studio/index.js +6 -6
  63. package/package.json +25 -4
  64. /package/dist/{files → artifacts}/VersionTimeline.d.ts +0 -0
package/README.md CHANGED
@@ -65,6 +65,8 @@ Every capability is its own entry, so a bundler only loads what you use:
65
65
  | `@arbidocs/blocks` | Light root: theme, primitives, chat, shell, auth, retrieval, agents, citations, collaboration, site blocks | none (zustand, dompurify) |
66
66
  | `/chat`, `/shell`, `/auth`, `/retrieval`, `/citations`, `/collaboration`, `/agents`, `/timeline`, `/site` | one capability each | none |
67
67
  | `/files`, `/facts` | document grid, facts table | `ag-grid-*` |
68
+ | `/artifacts` | artifact editor, version bar, track changes | none |
69
+ | `/artifacts/editor` | rich-text (markdown) editing surface | `@mdxeditor/editor` (optional peer) |
68
70
  | `/home`, `/workspaces` | dashboard, workspace cards and forms | `@dnd-kit/*` |
69
71
  | `/settings` | settings, billing, modals | `cmdk` |
70
72
  | `/connect` | demo/live connection layer | `@tanstack/react-query` |
@@ -112,6 +114,29 @@ const { isDockAvailable } = useChatSurface()
112
114
  ```
113
115
 
114
116
  Theme the user bubble with `--chat-user-bubble` and `--chat-user-bubble-foreground` (HSL triplets).
117
+ ## Edit an artifact, save versions, compare
118
+
119
+ `/artifacts` is the surface for an AI-drafted document the user may edit: a toolbar (Edit, Cancel,
120
+ Compare, Save as a new version), a version bar ("Version 2 of 3", a list, Compare with previous),
121
+ and Word-style track changes between two versions with a per-change undo. It is presentational:
122
+ state comes from `useArtifactSession` in `@arbidocs/react/artifacts`, and the editor and redline are
123
+ slots.
124
+
125
+ ```tsx
126
+ import { ArtifactEditor, ArtifactRedlineView } from '@arbidocs/blocks/artifacts'
127
+ import { ArtifactMarkdownEditor } from '@arbidocs/blocks/artifacts/editor'
128
+ import { renderArtifactMarkdown, useArtifactSession } from '@arbidocs/react/artifacts'
129
+ import '@mdxeditor/editor/style.css'
130
+
131
+ const s = useArtifactSession({ workspaceId, docId, onSaved: ({ docId: next }) => next && open(next) })
132
+ <ArtifactEditor {...s.view} onOpenVersion={open} renderMarkdown={renderArtifactMarkdown}
133
+ editor={<ArtifactMarkdownEditor {...s.editorProps} />}
134
+ redline={<ArtifactRedlineView {...s.redlineProps} renderMarkdown={renderArtifactMarkdown} />} />
135
+ ```
136
+
137
+ Every part takes `labels` and `testIds`; Mod+S saves while editing; touch targets are 44px. The
138
+ editor needs `@mdxeditor/editor` (optional peer) and is heavy (mount it behind `lazy`) and needs the global `Prism` defined before it loads (`@lexical/code` reads it while it evaluates): in the module that lazily imports the editor, import first a side-effect module with `import Prism from 'prismjs'; globalThis.Prism = Prism`. A library cannot order that reliably across bundlers.
139
+ See `examples/custom-ui/ArtifactPage.tsx` for a custom editing surface on in-memory data.
115
140
 
116
141
  ## Editorial site parts
117
142