@asanchez-sa/abby 0.0.0-stage → 0.1.0

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 (391) hide show
  1. package/README.md +217 -2
  2. package/dist/_virtual/_rolldown/runtime.js +26 -0
  3. package/dist/agents/approvals.d.ts +46 -0
  4. package/dist/agents/approvals.js +58 -0
  5. package/dist/agents/changes.d.ts +21 -0
  6. package/dist/agents/changes.js +21 -0
  7. package/dist/agents/hooks.d.ts +20 -0
  8. package/dist/agents/hooks.js +58 -0
  9. package/dist/agents/index.d.ts +11 -0
  10. package/dist/agents/index.js +9 -0
  11. package/dist/agents/run-tool.d.ts +44 -0
  12. package/dist/agents/run-tool.js +79 -0
  13. package/dist/agents/ui-sdk.d.ts +5 -0
  14. package/dist/agents/ui-sdk.js +3 -0
  15. package/dist/behaviors/canvas/index.d.ts +2 -0
  16. package/dist/behaviors/canvas/index.js +1 -0
  17. package/dist/behaviors/canvas/ui-sdk.d.ts +2 -0
  18. package/dist/behaviors/canvas/ui-sdk.js +1 -0
  19. package/dist/behaviors/drag-and-drop/index.d.ts +2 -0
  20. package/dist/behaviors/drag-and-drop/index.js +1 -0
  21. package/dist/behaviors/drag-and-drop/ui-sdk.d.ts +2 -0
  22. package/dist/behaviors/drag-and-drop/ui-sdk.js +1 -0
  23. package/dist/behaviors/dragging/index.d.ts +2 -0
  24. package/dist/behaviors/dragging/index.js +1 -0
  25. package/dist/behaviors/dragging/ui-sdk.d.ts +2 -0
  26. package/dist/behaviors/dragging/ui-sdk.js +1 -0
  27. package/dist/behaviors/focus/index.d.ts +2 -0
  28. package/dist/behaviors/focus/index.js +1 -0
  29. package/dist/behaviors/focus/ui-sdk.d.ts +2 -0
  30. package/dist/behaviors/focus/ui-sdk.js +1 -0
  31. package/dist/behaviors/lists/index.d.ts +3 -0
  32. package/dist/behaviors/lists/index.js +3 -0
  33. package/dist/behaviors/lists/ui-sdk.d.ts +3 -0
  34. package/dist/behaviors/lists/ui-sdk.js +3 -0
  35. package/dist/behaviors/popups/index.d.ts +3 -0
  36. package/dist/behaviors/popups/index.js +3 -0
  37. package/dist/behaviors/popups/ui-sdk.d.ts +3 -0
  38. package/dist/behaviors/popups/ui-sdk.js +3 -0
  39. package/dist/behaviors/preferences/index.d.ts +3 -0
  40. package/dist/behaviors/preferences/index.js +3 -0
  41. package/dist/behaviors/preferences/ui-sdk.d.ts +3 -0
  42. package/dist/behaviors/preferences/ui-sdk.js +3 -0
  43. package/dist/behaviors/selection/index.d.ts +3 -0
  44. package/dist/behaviors/selection/index.js +3 -0
  45. package/dist/behaviors/selection/indicator.d.ts +13 -0
  46. package/dist/behaviors/selection/indicator.js +20 -0
  47. package/dist/behaviors/selection/ui-sdk.d.ts +2 -0
  48. package/dist/behaviors/selection/ui-sdk.js +1 -0
  49. package/dist/behaviors/transitions/index.d.ts +3 -0
  50. package/dist/behaviors/transitions/index.js +3 -0
  51. package/dist/behaviors/transitions/ui-sdk.d.ts +3 -0
  52. package/dist/behaviors/transitions/ui-sdk.js +3 -0
  53. package/dist/behaviors/trees/index.d.ts +2 -0
  54. package/dist/behaviors/trees/index.js +1 -0
  55. package/dist/behaviors/trees/ui-sdk.d.ts +2 -0
  56. package/dist/behaviors/trees/ui-sdk.js +1 -0
  57. package/dist/components/accordion/accordion.d.ts +13 -0
  58. package/dist/components/accordion/accordion.js +165 -0
  59. package/dist/components/alert/alert.d.ts +13 -0
  60. package/dist/components/alert/alert.js +131 -0
  61. package/dist/components/alert-dialog/alert-dialog.d.ts +15 -0
  62. package/dist/components/alert-dialog/alert-dialog.js +257 -0
  63. package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
  64. package/dist/components/aspect-ratio/aspect-ratio.js +57 -0
  65. package/dist/components/attachment/attachment.d.ts +48 -0
  66. package/dist/components/attachment/attachment.js +372 -0
  67. package/dist/components/autocomplete/autocomplete.d.ts +32 -0
  68. package/dist/components/autocomplete/autocomplete.js +466 -0
  69. package/dist/components/avatar/avatar.d.ts +6 -0
  70. package/dist/components/avatar/avatar.js +100 -0
  71. package/dist/components/avatar-group/avatar-group.d.ts +9 -0
  72. package/dist/components/avatar-group/avatar-group.js +75 -0
  73. package/dist/components/badge/badge.d.ts +15 -0
  74. package/dist/components/badge/badge.js +31 -0
  75. package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
  76. package/dist/components/breadcrumb/breadcrumb.js +279 -0
  77. package/dist/components/bubble/bubble.d.ts +26 -0
  78. package/dist/components/bubble/bubble.js +173 -0
  79. package/dist/components/button/button.d.ts +18 -0
  80. package/dist/components/button/button.js +91 -0
  81. package/dist/components/button-group/button-group.d.ts +15 -0
  82. package/dist/components/button-group/button-group.js +71 -0
  83. package/dist/components/calendar/calendar.d.ts +29 -0
  84. package/dist/components/calendar/calendar.js +453 -0
  85. package/dist/components/card/card.d.ts +14 -0
  86. package/dist/components/card/card.js +213 -0
  87. package/dist/components/carousel/carousel.d.ts +16 -0
  88. package/dist/components/carousel/carousel.js +364 -0
  89. package/dist/components/chain-of-thought/chain-of-thought.d.ts +72 -0
  90. package/dist/components/chain-of-thought/chain-of-thought.js +491 -0
  91. package/dist/components/chat/chat.d.ts +48 -0
  92. package/dist/components/chat/chat.js +207 -0
  93. package/dist/components/checkbox/checkbox.d.ts +10 -0
  94. package/dist/components/checkbox/checkbox.js +118 -0
  95. package/dist/components/checkpoint/checkpoint.d.ts +24 -0
  96. package/dist/components/checkpoint/checkpoint.js +178 -0
  97. package/dist/components/choice-cards/choice-cards.d.ts +38 -0
  98. package/dist/components/choice-cards/choice-cards.js +255 -0
  99. package/dist/components/code-block/code-block.d.ts +58 -0
  100. package/dist/components/code-block/code-block.js +506 -0
  101. package/dist/components/code-block/highlighter.js +96 -0
  102. package/dist/components/code-block/use-highlighted-code.d.ts +11 -0
  103. package/dist/components/code-block/use-highlighted-code.js +54 -0
  104. package/dist/components/collapsible/collapsible.d.ts +10 -0
  105. package/dist/components/collapsible/collapsible.js +92 -0
  106. package/dist/components/color-picker/color-picker.d.ts +17 -0
  107. package/dist/components/color-picker/color-picker.js +395 -0
  108. package/dist/components/combobox/combobox.d.ts +54 -0
  109. package/dist/components/combobox/combobox.js +683 -0
  110. package/dist/components/command/command.d.ts +23 -0
  111. package/dist/components/command/command.js +373 -0
  112. package/dist/components/command-dock/command-dock.d.ts +118 -0
  113. package/dist/components/command-dock/command-dock.js +944 -0
  114. package/dist/components/confirmation/confirmation.d.ts +58 -0
  115. package/dist/components/confirmation/confirmation.js +181 -0
  116. package/dist/components/context/context.d.ts +82 -0
  117. package/dist/components/context/context.js +490 -0
  118. package/dist/components/date-input/date-input.d.ts +16 -0
  119. package/dist/components/date-input/date-input.js +89 -0
  120. package/dist/components/date-picker/date-picker.d.ts +28 -0
  121. package/dist/components/date-picker/date-picker.js +361 -0
  122. package/dist/components/dialog/dialog.d.ts +14 -0
  123. package/dist/components/dialog/dialog.js +261 -0
  124. package/dist/components/drawer/drawer.d.ts +16 -0
  125. package/dist/components/drawer/drawer.js +309 -0
  126. package/dist/components/empty/empty.d.ts +18 -0
  127. package/dist/components/empty/empty.js +192 -0
  128. package/dist/components/field/field.d.ts +15 -0
  129. package/dist/components/field/field.js +261 -0
  130. package/dist/components/file-input/file-input.d.ts +12 -0
  131. package/dist/components/file-input/file-input.js +216 -0
  132. package/dist/components/file-tree/file-tree.d.ts +45 -0
  133. package/dist/components/file-tree/file-tree.js +283 -0
  134. package/dist/components/hover-card/hover-card.d.ts +10 -0
  135. package/dist/components/hover-card/hover-card.js +118 -0
  136. package/dist/components/icon/icon.d.ts +14 -0
  137. package/dist/components/icon/icon.js +60 -0
  138. package/dist/components/image-cropper/image-cropper.d.ts +15 -0
  139. package/dist/components/image-cropper/image-cropper.js +334 -0
  140. package/dist/components/inline-citation/inline-citation.d.ts +46 -0
  141. package/dist/components/inline-citation/inline-citation.js +269 -0
  142. package/dist/components/input/input.d.ts +9 -0
  143. package/dist/components/input/input.js +43 -0
  144. package/dist/components/input-group/input-group.d.ts +42 -0
  145. package/dist/components/input-group/input-group.js +192 -0
  146. package/dist/components/item/item.d.ts +32 -0
  147. package/dist/components/item/item.js +394 -0
  148. package/dist/components/kbd/kbd.d.ts +9 -0
  149. package/dist/components/kbd/kbd.js +75 -0
  150. package/dist/components/label/label.d.ts +6 -0
  151. package/dist/components/label/label.js +40 -0
  152. package/dist/components/link/link.d.ts +21 -0
  153. package/dist/components/link/link.js +126 -0
  154. package/dist/components/listbox/listbox.d.ts +20 -0
  155. package/dist/components/listbox/listbox.js +199 -0
  156. package/dist/components/marker/marker.d.ts +11 -0
  157. package/dist/components/marker/marker.js +88 -0
  158. package/dist/components/menu/menu.d.ts +38 -0
  159. package/dist/components/menu/menu.js +553 -0
  160. package/dist/components/menubar/menubar.d.ts +9 -0
  161. package/dist/components/menubar/menubar.js +47 -0
  162. package/dist/components/message/message.d.ts +44 -0
  163. package/dist/components/message/message.js +328 -0
  164. package/dist/components/message-scroller/message-scroller.d.ts +111 -0
  165. package/dist/components/message-scroller/message-scroller.js +957 -0
  166. package/dist/components/meter/meter.d.ts +8 -0
  167. package/dist/components/meter/meter.js +162 -0
  168. package/dist/components/model-selector/model-selector.d.ts +155 -0
  169. package/dist/components/model-selector/model-selector.js +905 -0
  170. package/dist/components/native-select/native-select.d.ts +27 -0
  171. package/dist/components/native-select/native-select.js +226 -0
  172. package/dist/components/navigation-menu/navigation-menu.d.ts +29 -0
  173. package/dist/components/navigation-menu/navigation-menu.js +318 -0
  174. package/dist/components/not-label.js +9 -0
  175. package/dist/components/note-editor/blocks.d.ts +22 -0
  176. package/dist/components/note-editor/blocks.js +245 -0
  177. package/dist/components/note-editor/diff.d.ts +19 -0
  178. package/dist/components/note-editor/diff.js +64 -0
  179. package/dist/components/note-editor/editor.js +249 -0
  180. package/dist/components/note-editor/note-editor.d.ts +109 -0
  181. package/dist/components/note-editor/note-editor.js +954 -0
  182. package/dist/components/note-editor/parts/comments.d.ts +24 -0
  183. package/dist/components/note-editor/parts/comments.js +336 -0
  184. package/dist/components/note-editor/parts/header.d.ts +25 -0
  185. package/dist/components/note-editor/parts/header.js +263 -0
  186. package/dist/components/note-editor/parts/history.d.ts +56 -0
  187. package/dist/components/note-editor/parts/history.js +409 -0
  188. package/dist/components/note-editor/parts/presence.d.ts +31 -0
  189. package/dist/components/note-editor/parts/presence.js +140 -0
  190. package/dist/components/note-editor/parts/suggestions.d.ts +45 -0
  191. package/dist/components/note-editor/parts/suggestions.js +316 -0
  192. package/dist/components/note-editor/parts/toolbar.d.ts +38 -0
  193. package/dist/components/note-editor/parts/toolbar.js +683 -0
  194. package/dist/components/note-editor/people.d.ts +84 -0
  195. package/dist/components/note-editor/people.js +276 -0
  196. package/dist/components/note-editor/person.d.ts +11 -0
  197. package/dist/components/note-editor/person.js +15 -0
  198. package/dist/components/note-place/note-place.d.ts +42 -0
  199. package/dist/components/note-place/note-place.js +256 -0
  200. package/dist/components/note-status/note-status.d.ts +59 -0
  201. package/dist/components/note-status/note-status.js +380 -0
  202. package/dist/components/number-input/number-input.d.ts +12 -0
  203. package/dist/components/number-input/number-input.js +252 -0
  204. package/dist/components/otp-input/otp-input.d.ts +12 -0
  205. package/dist/components/otp-input/otp-input.js +136 -0
  206. package/dist/components/pagination/pagination.d.ts +23 -0
  207. package/dist/components/pagination/pagination.js +218 -0
  208. package/dist/components/password-input/password-input.d.ts +11 -0
  209. package/dist/components/password-input/password-input.js +117 -0
  210. package/dist/components/plan/plan.d.ts +51 -0
  211. package/dist/components/plan/plan.js +320 -0
  212. package/dist/components/popover/popover.d.ts +16 -0
  213. package/dist/components/popover/popover.js +268 -0
  214. package/dist/components/preferences/preferences.d.ts +5 -0
  215. package/dist/components/preferences/preferences.js +18 -0
  216. package/dist/components/progress/progress.d.ts +8 -0
  217. package/dist/components/progress/progress.js +162 -0
  218. package/dist/components/prompt-input/prompt-input.d.ts +247 -0
  219. package/dist/components/prompt-input/prompt-input.js +1367 -0
  220. package/dist/components/questionnaire/questionnaire.d.ts +174 -0
  221. package/dist/components/questionnaire/questionnaire.js +1628 -0
  222. package/dist/components/queue/queue.d.ts +82 -0
  223. package/dist/components/queue/queue.js +471 -0
  224. package/dist/components/radio/radio.d.ts +7 -0
  225. package/dist/components/radio/radio.js +101 -0
  226. package/dist/components/rating/rating.d.ts +10 -0
  227. package/dist/components/rating/rating.js +95 -0
  228. package/dist/components/reasoning/reasoning.d.ts +50 -0
  229. package/dist/components/reasoning/reasoning.js +233 -0
  230. package/dist/components/resizable/resizable.d.ts +6 -0
  231. package/dist/components/resizable/resizable.js +100 -0
  232. package/dist/components/scroll-area/scroll-area.d.ts +17 -0
  233. package/dist/components/scroll-area/scroll-area.js +211 -0
  234. package/dist/components/segmented-control/segmented-control.d.ts +16 -0
  235. package/dist/components/segmented-control/segmented-control.js +142 -0
  236. package/dist/components/select/select.d.ts +43 -0
  237. package/dist/components/select/select.js +577 -0
  238. package/dist/components/separator/separator.d.ts +4 -0
  239. package/dist/components/separator/separator.js +38 -0
  240. package/dist/components/sheet/sheet.d.ts +24 -0
  241. package/dist/components/sheet/sheet.js +330 -0
  242. package/dist/components/sidebar/sidebar.d.ts +138 -0
  243. package/dist/components/sidebar/sidebar.js +1374 -0
  244. package/dist/components/skeleton/skeleton.d.ts +4 -0
  245. package/dist/components/skeleton/skeleton.js +40 -0
  246. package/dist/components/slider/slider.d.ts +9 -0
  247. package/dist/components/slider/slider.js +193 -0
  248. package/dist/components/sources/sources.d.ts +35 -0
  249. package/dist/components/sources/sources.js +209 -0
  250. package/dist/components/spinner/spinner.d.ts +11 -0
  251. package/dist/components/spinner/spinner.js +59 -0
  252. package/dist/components/stack-trace/parse-stack-trace.d.ts +21 -0
  253. package/dist/components/stack-trace/parse-stack-trace.js +61 -0
  254. package/dist/components/stack-trace/stack-trace.d.ts +79 -0
  255. package/dist/components/stack-trace/stack-trace.js +434 -0
  256. package/dist/components/subagent/subagent.d.ts +71 -0
  257. package/dist/components/subagent/subagent.js +450 -0
  258. package/dist/components/suggestion/suggestion.d.ts +21 -0
  259. package/dist/components/suggestion/suggestion.js +130 -0
  260. package/dist/components/switch/switch.d.ts +6 -0
  261. package/dist/components/switch/switch.js +70 -0
  262. package/dist/components/table/table.d.ts +19 -0
  263. package/dist/components/table/table.js +284 -0
  264. package/dist/components/table-of-contents/spy.js +84 -0
  265. package/dist/components/table-of-contents/table-of-contents.d.ts +92 -0
  266. package/dist/components/table-of-contents/table-of-contents.js +787 -0
  267. package/dist/components/tabs/tabs.d.ts +25 -0
  268. package/dist/components/tabs/tabs.js +273 -0
  269. package/dist/components/task/task.d.ts +40 -0
  270. package/dist/components/task/task.js +262 -0
  271. package/dist/components/terminal/terminal.d.ts +82 -0
  272. package/dist/components/terminal/terminal.js +457 -0
  273. package/dist/components/test-results/test-results.d.ts +127 -0
  274. package/dist/components/test-results/test-results.js +687 -0
  275. package/dist/components/textarea/textarea.d.ts +8 -0
  276. package/dist/components/textarea/textarea.js +43 -0
  277. package/dist/components/time-input/time-input.d.ts +7 -0
  278. package/dist/components/time-input/time-input.js +82 -0
  279. package/dist/components/timeline/timeline.d.ts +19 -0
  280. package/dist/components/timeline/timeline.js +247 -0
  281. package/dist/components/toast/toast.d.ts +12 -0
  282. package/dist/components/toast/toast.js +285 -0
  283. package/dist/components/toggle/toggle.d.ts +15 -0
  284. package/dist/components/toggle/toggle.js +137 -0
  285. package/dist/components/token-input/token-input.d.ts +7 -0
  286. package/dist/components/token-input/token-input.js +117 -0
  287. package/dist/components/tool/tool.d.ts +66 -0
  288. package/dist/components/tool/tool.js +413 -0
  289. package/dist/components/toolbar/toolbar.d.ts +91 -0
  290. package/dist/components/toolbar/toolbar.js +655 -0
  291. package/dist/components/tooltip/tooltip.d.ts +8 -0
  292. package/dist/components/tooltip/tooltip.js +97 -0
  293. package/dist/components/trace/trace.d.ts +31 -0
  294. package/dist/components/trace/trace.js +309 -0
  295. package/dist/components/tree/tree.d.ts +13 -0
  296. package/dist/components/tree/tree.js +258 -0
  297. package/dist/components/trigger-menu/trigger-menu.d.ts +30 -0
  298. package/dist/components/trigger-menu/trigger-menu.js +352 -0
  299. package/dist/components/usage/usage.d.ts +132 -0
  300. package/dist/components/usage/usage.js +1368 -0
  301. package/dist/components/waterfall/waterfall.d.ts +20 -0
  302. package/dist/components/waterfall/waterfall.js +360 -0
  303. package/dist/components/week-strip/week-strip.d.ts +177 -0
  304. package/dist/components/week-strip/week-strip.js +1081 -0
  305. package/dist/core/index.d.ts +7 -0
  306. package/dist/core/index.js +27 -0
  307. package/dist/core/ui-sdk.d.ts +3 -0
  308. package/dist/core/ui-sdk.js +3 -0
  309. package/dist/core/use-primitive-state.d.ts +14 -0
  310. package/dist/core/use-primitive-state.js +25 -0
  311. package/dist/styles/LICENSE-shadcn.md +21 -0
  312. package/dist/styles/color-scheme.css +32 -0
  313. package/dist/styles/components.css +303 -0
  314. package/dist/styles/index.css +41 -0
  315. package/dist/styles/tokens.css +474 -0
  316. package/dist/styles/typeset/shadcn.css +506 -0
  317. package/dist/styles/typeset.css +70 -0
  318. package/dist/styles/utilities.css +555 -0
  319. package/dist/tools/observe/index.d.ts +2 -0
  320. package/dist/tools/observe/index.js +3 -0
  321. package/dist/tools/observe/ui-sdk.d.ts +1 -0
  322. package/dist/tools/observe/ui-sdk.js +2 -0
  323. package/dist/tools/testing/check-agent.d.ts +28 -0
  324. package/dist/tools/testing/check-agent.js +42 -0
  325. package/dist/tools/testing/index.d.ts +4 -0
  326. package/dist/tools/testing/index.js +4 -0
  327. package/dist/tools/testing/ui-sdk.d.ts +1 -0
  328. package/dist/tools/testing/ui-sdk.js +2 -0
  329. package/dist/utilities/cn/index.d.ts +12 -0
  330. package/dist/utilities/cn/index.js +47 -0
  331. package/dist/utilities/color/index.d.ts +2 -0
  332. package/dist/utilities/color/index.js +3 -0
  333. package/dist/utilities/color/ui-sdk.d.ts +1 -0
  334. package/dist/utilities/color/ui-sdk.js +2 -0
  335. package/dist/utilities/date/index.d.ts +2 -0
  336. package/dist/utilities/date/index.js +6 -0
  337. package/dist/utilities/date/ui-sdk.d.ts +1 -0
  338. package/dist/utilities/date/ui-sdk.js +2 -0
  339. package/dist/utilities/image/index.d.ts +2 -0
  340. package/dist/utilities/image/index.js +3 -0
  341. package/dist/utilities/image/ui-sdk.d.ts +1 -0
  342. package/dist/utilities/image/ui-sdk.js +2 -0
  343. package/dist/utilities/mobile/index.d.ts +2 -0
  344. package/dist/utilities/mobile/index.js +1 -0
  345. package/dist/utilities/mobile/ui-sdk.d.ts +2 -0
  346. package/dist/utilities/mobile/ui-sdk.js +1 -0
  347. package/dist/utilities/number/index.d.ts +2 -0
  348. package/dist/utilities/number/index.js +3 -0
  349. package/dist/utilities/number/ui-sdk.d.ts +1 -0
  350. package/dist/utilities/number/ui-sdk.js +2 -0
  351. package/dist/utilities/platform/index.d.ts +3 -0
  352. package/dist/utilities/platform/index.js +14 -0
  353. package/dist/utilities/platform/ui-sdk.d.ts +3 -0
  354. package/dist/utilities/platform/ui-sdk.js +3 -0
  355. package/dist/utilities/storage/index.d.ts +2 -0
  356. package/dist/utilities/storage/index.js +1 -0
  357. package/dist/utilities/storage/ui-sdk.d.ts +2 -0
  358. package/dist/utilities/storage/ui-sdk.js +1 -0
  359. package/dist/utilities/text/index.d.ts +3 -0
  360. package/dist/utilities/text/index.js +3 -0
  361. package/dist/utilities/text/ui-sdk.d.ts +3 -0
  362. package/dist/utilities/text/ui-sdk.js +3 -0
  363. package/package.json +192 -4
  364. package/skills/agent-ready-ui/SKILL.md +229 -0
  365. package/skills/blocks/SKILL.md +262 -0
  366. package/skills/compose-screens/SKILL.md +354 -0
  367. package/skills/note-editor/SKILL.md +493 -0
  368. package/skills/note-status/SKILL.md +295 -0
  369. package/skills/setup/SKILL.md +136 -0
  370. package/skills/theming/SKILL.md +216 -0
  371. package/src/blocks/notes/adapters.ts +77 -0
  372. package/src/blocks/notes/data.ts +508 -0
  373. package/src/blocks/notes/notes-block.tsx +244 -0
  374. package/src/blocks/notes/parts/home.tsx +219 -0
  375. package/src/blocks/notes/parts/no-access.tsx +84 -0
  376. package/src/blocks/notes/parts/note-screen.tsx +412 -0
  377. package/src/blocks/notes/parts/notes-sidebar.tsx +277 -0
  378. package/src/blocks/notes/parts/panels.tsx +393 -0
  379. package/src/blocks/notes/parts/place.ts +15 -0
  380. package/src/blocks/notes/parts/review-dialog.tsx +159 -0
  381. package/src/blocks/notes/parts/share.tsx +172 -0
  382. package/src/blocks/notes/texts.ts +135 -0
  383. package/src/blocks/shell/adapters.ts +69 -0
  384. package/src/blocks/shell/data.ts +281 -0
  385. package/src/blocks/shell/parts/compose.tsx +292 -0
  386. package/src/blocks/shell/parts/home.tsx +203 -0
  387. package/src/blocks/shell/parts/marks.tsx +144 -0
  388. package/src/blocks/shell/parts/rail.tsx +166 -0
  389. package/src/blocks/shell/parts/rooms-column.tsx +326 -0
  390. package/src/blocks/shell/shell-block.tsx +210 -0
  391. package/src/blocks/shell/texts.ts +80 -0
@@ -0,0 +1,244 @@
1
+ "use client";
2
+
3
+ import type { NoteBlock } from "abby/note-editor";
4
+ import { SidebarInset, SidebarProvider, SidebarTrigger } from "abby/sidebar";
5
+ import { useShortcut } from "abby/utilities/platform";
6
+ import { useRef, useState } from "react";
7
+ import type { NotesAdapter } from "./adapters.ts";
8
+ import { templates as defaultTemplates, type NotesNote, type NotesWorkspace } from "./data.ts";
9
+ import { Home } from "./parts/home.tsx";
10
+ import { NoAccess } from "./parts/no-access.tsx";
11
+ import { NoteScreen, type NotesPanel } from "./parts/note-screen.tsx";
12
+ import { NotesSidebar } from "./parts/notes-sidebar.tsx";
13
+ import { notesTexts, type NotesTexts } from "./texts.ts";
14
+
15
+ // The Notes block: a whole notes screen, from abby's public entries only, so
16
+ // this folder can be copied into an app as it is. The sidebar lists the notes
17
+ // by area; the page is home, a note, or a note the person can't open. The
18
+ // block keeps what's on screen and calls the adapter for everything that
19
+ // leaves it: saving, a review, a restored version, the assistant.
20
+
21
+ type NotesStart = {
22
+ /** The note on screen. Home without one. */
23
+ note?: string;
24
+ panel?: NotesPanel;
25
+ focus?: boolean;
26
+ /** A past version of the note, read-only, with the history beside it. */
27
+ version?: string;
28
+ /** Opens the share popover or the review dialog. */
29
+ open?: "share" | "review";
30
+ /** Starts as if the last save had failed. */
31
+ saveFailed?: boolean;
32
+ };
33
+
34
+ /** The person's changes to one note, each with the app's value it replaced. */
35
+ type Changes = { [Key in keyof NotesNote]?: { base: unknown; value: unknown } };
36
+
37
+ /** The app's note with the person's changes over it, for the fields the app hasn't changed since. */
38
+ function mine(note: NotesNote, changes: Changes | undefined): NotesNote {
39
+ if (!changes) return note;
40
+ const kept = Object.entries(changes).filter(([key, change]) =>
41
+ Object.is(note[key as keyof NotesNote], change.base),
42
+ );
43
+ return kept.length
44
+ ? { ...note, ...Object.fromEntries(kept.map(([key, change]) => [key, change.value])) }
45
+ : note;
46
+ }
47
+
48
+ export type NotesBlockProps = {
49
+ workspace: NotesWorkspace;
50
+ adapter: NotesAdapter;
51
+ /** Replaces any of the block's texts, to translate it. */
52
+ texts?: Partial<NotesTexts>;
53
+ /** The templates a note can start with. */
54
+ templates?: typeof defaultTemplates;
55
+ /** Where each note lives, for its link. `#<id>` by default. */
56
+ href?: (id: string) => string;
57
+ /** What the block shows first. */
58
+ initial?: NotesStart;
59
+ /** The tree is still loading: the sidebar shows its shape. */
60
+ loading?: boolean;
61
+ /** The app lost its connection: the note says so and keeps working. */
62
+ offline?: boolean;
63
+ };
64
+
65
+ export function NotesBlock({
66
+ workspace,
67
+ adapter,
68
+ texts: own,
69
+ templates = defaultTemplates,
70
+ href = (id) => `#${id}`,
71
+ initial = {},
72
+ loading,
73
+ offline,
74
+ }: NotesBlockProps) {
75
+ const texts = { ...notesTexts, ...own };
76
+ // The notes are the app's: new data (the tree loaded, someone else's cursor)
77
+ // shows as it arrives. The block keeps what the person changed here, each
78
+ // field against the app's value it replaced: once the app sends a new value
79
+ // for that field (its save echoed, someone else's edit), the app's wins.
80
+ const [changed, setChanged] = useState<Record<string, Changes>>({});
81
+ const [created, setCreated] = useState<NotesNote[]>([]);
82
+ const theirs = [
83
+ ...workspace.notes,
84
+ ...created.filter((fresh) => !workspace.notes.some((each) => each.id === fresh.id)),
85
+ ];
86
+ const notes = theirs.map((each) => mine(each, changed[each.id]));
87
+ const [current, setCurrent] = useState<string | null>(initial.note ?? null);
88
+ const [panel, setPanel] = useState<NotesPanel>(initial.panel ?? null);
89
+ const [focus, setFocus] = useState(initial.focus ?? false);
90
+ const [sidebar, setSidebar] = useState(!initial.focus);
91
+ const [version, setVersion] = useState(initial.version);
92
+ const [saveFailed, setSaveFailed] = useState(initial.saveFailed ?? false);
93
+ const [opening, setOpening] = useState(initial.open);
94
+ const title = useRef<HTMLInputElement>(null);
95
+ const note = notes.find((each) => each.id === current);
96
+
97
+ const update = (id: string, change: Partial<NotesNote>) =>
98
+ setChanged((all) => {
99
+ const base = theirs.find((each) => each.id === id);
100
+ const next: Changes = { ...all[id] };
101
+ for (const key of Object.keys(change) as (keyof NotesNote)[]) {
102
+ next[key] = { base: base?.[key], value: change[key] };
103
+ }
104
+ return { ...all, [id]: next };
105
+ });
106
+
107
+ /** Runs a save; a failure shows the bar with Retry, and the edit stays on screen. */
108
+ const save = (run: () => Promise<void>) => {
109
+ run().then(
110
+ () => setSaveFailed(false),
111
+ () => setSaveFailed(true),
112
+ );
113
+ };
114
+
115
+ const open = (id: string | null) => {
116
+ setCurrent(id);
117
+ setVersion(undefined);
118
+ setOpening(undefined);
119
+ };
120
+
121
+ const startNote = () => {
122
+ open(null);
123
+ setFocus(false);
124
+ setSidebar(true);
125
+ // Home's title field is where a note starts.
126
+ requestAnimationFrame(() => title.current?.focus());
127
+ };
128
+
129
+ const toggleFocus = () => {
130
+ setFocus(!focus);
131
+ setSidebar(focus);
132
+ };
133
+
134
+ useShortcut("mod+shift+n", startNote, { description: texts.newNote });
135
+ useShortcut("mod+\\", toggleFocus, { description: texts.outline, when: () => Boolean(note) });
136
+
137
+ let page;
138
+ if (note?.locked) {
139
+ page = (
140
+ <>
141
+ <header className="flex h-12 shrink-0 items-center border-b border-border px-3">
142
+ <SidebarTrigger aria-label={texts.sidebar} />
143
+ </header>
144
+ <NoAccess
145
+ key={note.id}
146
+ note={note}
147
+ texts={texts}
148
+ onRequest={(message) => adapter.requestAccess(note.id, message)}
149
+ onBack={() => open(null)}
150
+ />
151
+ </>
152
+ );
153
+ } else if (note) {
154
+ page = (
155
+ <NoteScreen
156
+ note={note}
157
+ workspace={workspace}
158
+ texts={texts}
159
+ templates={templates}
160
+ panel={panel}
161
+ focus={focus}
162
+ version={version}
163
+ offline={offline}
164
+ saveFailed={saveFailed}
165
+ open={opening}
166
+ onPanel={(next) => {
167
+ setPanel(next);
168
+ if (next !== "history") setVersion(undefined);
169
+ }}
170
+ onVersion={setVersion}
171
+ onBlocks={(blocks: NoteBlock[]) => {
172
+ update(note.id, { blocks });
173
+ save(() => adapter.saveBlocks(note.id, blocks));
174
+ }}
175
+ onTitle={(next) => {
176
+ update(note.id, { title: next });
177
+ save(() => adapter.saveTitle(note.id, next));
178
+ }}
179
+ onStatus={(status) => {
180
+ update(note.id, { status });
181
+ save(() => adapter.setStatus(note.id, status));
182
+ }}
183
+ onAccess={(access) => update(note.id, { access })}
184
+ onComments={(comments) => update(note.id, { comments })}
185
+ onSuggestions={(suggestions) => update(note.id, { suggestions })}
186
+ onReview={async (input) => {
187
+ await adapter.requestReview(note.id, input);
188
+ update(note.id, { status: "review" });
189
+ }}
190
+ onRestore={async (id) => {
191
+ const blocks = await adapter.restoreVersion(note.id, id);
192
+ update(note.id, { blocks });
193
+ setVersion(undefined);
194
+ }}
195
+ onRetry={() => save(() => adapter.saveBlocks(note.id, note.blocks as NoteBlock[]))}
196
+ onAsk={(question) => adapter.ask(note.id, question)}
197
+ />
198
+ );
199
+ } else {
200
+ page = (
201
+ <>
202
+ <header className="flex h-12 shrink-0 items-center gap-2 border-b border-border px-3">
203
+ <SidebarTrigger aria-label={texts.sidebar} />
204
+ <h1 className="text-label">{texts.home}</h1>
205
+ </header>
206
+ <div className="min-h-0 flex-1 overflow-y-auto">
207
+ <Home
208
+ workspace={workspace}
209
+ notes={loading ? [] : notes}
210
+ loading={loading}
211
+ texts={texts}
212
+ templates={templates.map((each) => each.name)}
213
+ href={href}
214
+ titleRef={title}
215
+ onOpen={open}
216
+ onCreate={async (input) => {
217
+ const created = await adapter.createNote(input);
218
+ const template = templates.find((each) => each.name === input.template);
219
+ const fresh = template ? { ...created, blocks: template.blocks } : created;
220
+ setCreated((all) => [...all, fresh]);
221
+ open(fresh.id);
222
+ }}
223
+ />
224
+ </div>
225
+ </>
226
+ );
227
+ }
228
+
229
+ return (
230
+ <SidebarProvider open={sidebar} onOpenChange={setSidebar} className="h-dvh min-h-0">
231
+ <NotesSidebar
232
+ workspace={workspace}
233
+ notes={notes}
234
+ current={current}
235
+ loading={loading}
236
+ texts={texts}
237
+ href={href}
238
+ onOpen={open}
239
+ onNew={startNote}
240
+ />
241
+ <SidebarInset className="min-h-0 overflow-hidden">{page}</SidebarInset>
242
+ </SidebarProvider>
243
+ );
244
+ }
@@ -0,0 +1,219 @@
1
+ "use client";
2
+
3
+ import { SquareLock02Icon } from "@hugeicons/core-free-icons";
4
+ import { Button } from "abby/button";
5
+ import { Icon } from "abby/icon";
6
+ import { Input } from "abby/input";
7
+ import { Kbd } from "abby/kbd";
8
+ import { Link } from "abby/link";
9
+ import { NotePlaceSelect } from "abby/note-place";
10
+ import { NoteLiveDots, NoteStatusIcon } from "abby/note-status";
11
+ import { Toggle } from "abby/toggle";
12
+ import { useState, type Ref } from "react";
13
+ import type { NoteAccess, NotesNote, NotesWorkspace } from "../data.ts";
14
+ import type { NotesTexts } from "../texts.ts";
15
+ import { placeOf } from "./place.ts";
16
+
17
+ // Home: start a note by writing its title, then what waits for your review
18
+ // and what changed lately. No big button: writing the title is starting.
19
+
20
+ type HomeProps = {
21
+ workspace: NotesWorkspace;
22
+ notes: NotesNote[];
23
+ texts: NotesTexts;
24
+ templates: readonly string[];
25
+ href: (id: string) => string;
26
+ titleRef?: Ref<HTMLInputElement>;
27
+ /** The notes are still loading: no lists yet, and no first-day line either. */
28
+ loading?: boolean;
29
+ onCreate: (input: {
30
+ title: string;
31
+ place: string;
32
+ access: NoteAccess;
33
+ template?: string;
34
+ }) => void;
35
+ onOpen: (id: string) => void;
36
+ };
37
+
38
+ export function Home({
39
+ workspace,
40
+ notes,
41
+ texts,
42
+ templates,
43
+ href,
44
+ titleRef,
45
+ loading,
46
+ onCreate,
47
+ onOpen,
48
+ }: HomeProps) {
49
+ const [title, setTitle] = useState("");
50
+ const [place, setPlace] = useState(workspace.areas[0]?.value ?? "");
51
+ const [onlyMe, setOnlyMe] = useState(true);
52
+ const [template, setTemplate] = useState<string | undefined>();
53
+ const create = () => {
54
+ if (!title.trim()) return;
55
+ onCreate({ title: title.trim(), place, access: onlyMe ? "private" : "area", template });
56
+ };
57
+ const review = notes.filter((note) => note.reviewBy && note.status === "review");
58
+ const recent = notes.filter((note) => !note.reviewBy && !note.locked).slice(0, 5);
59
+
60
+ return (
61
+ <div className="mx-auto flex w-full max-w-[40rem] flex-col gap-14 px-6 py-16">
62
+ <form
63
+ className="flex flex-col gap-4"
64
+ onSubmit={(event) => {
65
+ event.preventDefault();
66
+ create();
67
+ }}
68
+ >
69
+ <p className="text-sm text-subtle">{workspace.today}</p>
70
+ <Input
71
+ ref={titleRef}
72
+ aria-label={texts.newTitle}
73
+ placeholder={texts.newTitlePlaceholder}
74
+ value={title}
75
+ onValueChange={setTitle}
76
+ // The form has other controls and no submit button, so Enter wouldn't submit it.
77
+ onKeyDown={(event) => {
78
+ if (event.key !== "Enter" || event.nativeEvent.isComposing) return;
79
+ event.preventDefault();
80
+ create();
81
+ }}
82
+ // The title is the field: no edge, the size of a title.
83
+ className="h-auto rounded-none border-0 bg-transparent px-0 py-0 text-display-3 shadow-none focus-visible:shadow-none md:text-display-3 dark:bg-transparent"
84
+ />
85
+ <div className="flex flex-wrap items-center gap-2">
86
+ <NotePlaceSelect
87
+ areas={workspace.areas}
88
+ value={place}
89
+ onValueChange={(value) => value && setPlace(value)}
90
+ />
91
+ <Toggle variant="outline" size="sm" pressed={onlyMe} onPressedChange={setOnlyMe}>
92
+ <Icon icon={SquareLock02Icon} />
93
+ {texts.onlyMe}
94
+ </Toggle>
95
+ <span aria-hidden="true" className="mx-1 h-4 w-px bg-border" />
96
+ <div role="group" aria-label={texts.startWith} className="flex items-center gap-1">
97
+ <span aria-hidden="true" className="me-1 text-sm text-subtle">
98
+ {texts.startWith}
99
+ </span>
100
+ {templates.map((name) => (
101
+ <Toggle
102
+ key={name}
103
+ size="sm"
104
+ pressed={template === name}
105
+ onPressedChange={(pressed) => setTemplate(pressed ? name : undefined)}
106
+ >
107
+ {name}
108
+ </Toggle>
109
+ ))}
110
+ </div>
111
+ <span
112
+ aria-hidden="true"
113
+ className="ms-auto flex items-center gap-1.5 text-sm text-subtle"
114
+ >
115
+ <Kbd>↵</Kbd>
116
+ {texts.create}
117
+ </span>
118
+ </div>
119
+ </form>
120
+
121
+ {!loading && notes.length === 0 && (
122
+ <p className="text-sm text-muted-foreground">{texts.firstDay}</p>
123
+ )}
124
+
125
+ {review.length > 0 && (
126
+ <section aria-labelledby="notes-home-review" className="flex flex-col gap-3">
127
+ <h2 id="notes-home-review" className="flex items-center gap-2 text-label">
128
+ {texts.toReviewHeading}
129
+ <span className="font-normal text-subtle">{review.length}</span>
130
+ </h2>
131
+ <ul className="flex flex-col">
132
+ {review.map((note) => {
133
+ const { area } = placeOf(workspace, note.place);
134
+ return (
135
+ <li key={note.id} className="flex items-center gap-3 py-2">
136
+ <div className="min-w-0 flex-1">
137
+ <p className="truncate text-label">{note.title}</p>
138
+ <p className="flex items-center gap-1.5 text-sm text-muted-foreground">
139
+ <span
140
+ aria-hidden="true"
141
+ className={`size-2 rounded-2xs ${area?.mark ?? ""}`}
142
+ />
143
+ {area?.label} · {note.summary} · {note.updated}
144
+ </p>
145
+ </div>
146
+ <Button
147
+ variant="outline"
148
+ size="sm"
149
+ aria-label={texts.review(note.title)}
150
+ onClick={() => onOpen(note.id)}
151
+ >
152
+ {texts.reviewShort}
153
+ </Button>
154
+ </li>
155
+ );
156
+ })}
157
+ </ul>
158
+ </section>
159
+ )}
160
+
161
+ {recent.length > 0 && (
162
+ <section aria-labelledby="notes-home-recent" className="flex flex-col gap-3">
163
+ <div className="flex items-center">
164
+ <h2 id="notes-home-recent" className="flex-1 text-label">
165
+ {texts.recent}
166
+ </h2>
167
+ <Link href={href("all")} className="text-sm">
168
+ {texts.seeAll}
169
+ </Link>
170
+ </div>
171
+ <ul className="flex flex-col">
172
+ {recent.map((note) => {
173
+ const { area } = placeOf(workspace, note.place);
174
+ return (
175
+ <li key={note.id} className="flex items-center gap-3 py-2">
176
+ <div className="min-w-0 flex-1">
177
+ <Link
178
+ href={href(note.id)}
179
+ onClick={(event) => {
180
+ event.preventDefault();
181
+ onOpen(note.id);
182
+ }}
183
+ className="block truncate text-label text-foreground no-underline hover:underline"
184
+ >
185
+ {note.title}
186
+ </Link>
187
+ <p className="flex items-center gap-1.5 text-sm text-muted-foreground">
188
+ <span
189
+ aria-hidden="true"
190
+ className={`size-2 rounded-2xs ${area?.mark ?? ""}`}
191
+ />
192
+ {area?.label}
193
+ {note.summary && (
194
+ <>
195
+ <span aria-hidden="true" className="text-subtle">
196
+ ·
197
+ </span>
198
+ {note.writing && <NoteLiveDots people={note.writing} />}
199
+ {note.summary}
200
+ </>
201
+ )}
202
+ </p>
203
+ </div>
204
+ <NoteStatusIcon
205
+ status={note.status}
206
+ label={texts[note.status === "review" ? "inReview" : note.status]}
207
+ />
208
+ <span className="w-20 shrink-0 text-end font-mono text-xs whitespace-nowrap text-subtle">
209
+ {note.updated}
210
+ </span>
211
+ </li>
212
+ );
213
+ })}
214
+ </ul>
215
+ </section>
216
+ )}
217
+ </div>
218
+ );
219
+ }
@@ -0,0 +1,84 @@
1
+ "use client";
2
+
3
+ import { CheckmarkCircle02Icon, SquareLock02Icon } from "@hugeicons/core-free-icons";
4
+ import { Button } from "abby/button";
5
+ import {
6
+ Empty,
7
+ EmptyContent,
8
+ EmptyDescription,
9
+ EmptyHeader,
10
+ EmptyMedia,
11
+ EmptyTitle,
12
+ } from "abby/empty";
13
+ import { Icon } from "abby/icon";
14
+ import { Textarea } from "abby/textarea";
15
+ import { useState } from "react";
16
+ import type { NotesNote } from "../data.ts";
17
+ import type { NotesTexts } from "../texts.ts";
18
+
19
+ // A link to a note the person can't open. It shows neither its title nor its
20
+ // text: only its area, who decides, and a way to ask.
21
+
22
+ type NoAccessProps = {
23
+ note: NotesNote;
24
+ texts: NotesTexts;
25
+ onRequest: (message: string) => Promise<void>;
26
+ onBack: () => void;
27
+ };
28
+
29
+ export function NoAccess({ note, texts, onRequest, onBack }: NoAccessProps) {
30
+ const [message, setMessage] = useState("");
31
+ const [requested, setRequested] = useState(false);
32
+ const locked = note.locked ?? { owner: "", area: "" };
33
+ const owner = locked.owner.split(" ")[0] ?? locked.owner;
34
+
35
+ return (
36
+ <Empty className="m-auto max-w-md">
37
+ <EmptyHeader>
38
+ <EmptyMedia variant="icon">
39
+ <Icon icon={SquareLock02Icon} />
40
+ </EmptyMedia>
41
+ <EmptyTitle>{texts.noAccess}</EmptyTitle>
42
+ <EmptyDescription>{texts.noAccessDetail(locked.area, locked.owner)}</EmptyDescription>
43
+ </EmptyHeader>
44
+ <EmptyContent className="w-full items-stretch">
45
+ {requested ? (
46
+ <p
47
+ role="status"
48
+ className="flex items-center justify-center gap-2 text-sm text-muted-foreground"
49
+ >
50
+ <Icon icon={CheckmarkCircle02Icon} className="size-4 text-success" />
51
+ {texts.requested(owner)}
52
+ </p>
53
+ ) : (
54
+ <>
55
+ <div className="flex flex-col gap-1.5 text-start">
56
+ <Textarea
57
+ aria-label={texts.accessMessage(owner)}
58
+ placeholder={texts.accessMessage(owner)}
59
+ value={message}
60
+ onValueChange={setMessage}
61
+ rows={2}
62
+ />
63
+ <p className="text-xs text-subtle">{texts.accessHint(owner)}</p>
64
+ </div>
65
+ <div className="flex gap-2">
66
+ <Button
67
+ size="sm"
68
+ onClick={async () => {
69
+ await onRequest(message);
70
+ setRequested(true);
71
+ }}
72
+ >
73
+ {texts.requestAccess}
74
+ </Button>
75
+ <Button variant="outline" size="sm" onClick={onBack}>
76
+ {texts.backToNotes}
77
+ </Button>
78
+ </div>
79
+ </>
80
+ )}
81
+ </EmptyContent>
82
+ </Empty>
83
+ );
84
+ }