@asanchez-sa/abby 0.0.0-stage → 0.1.1

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 +245 -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 +337 -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 +687 -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,84 @@
1
+ import "./diff.js";
2
+ import { NotePerson } from "./person.js";
3
+ import { Editor } from "@tiptap/core";
4
+ import { Plugin } from "@tiptap/pm/state";
5
+ import { DecorationSet } from "@tiptap/pm/view";
6
+ import "@tiptap/pm/model";
7
+ /**
8
+ * A place in the note: a block and a character in its own text. `offset`
9
+ * counts the characters a person sees, with a line break as one, not the
10
+ * Markdown in the block's `text`.
11
+ */
12
+ type NoteCursor = {
13
+ blockId: string;
14
+ offset: number;
15
+ };
16
+ /** Someone else with the note open, and where they are. */
17
+ type NotePresence = NotePerson & {
18
+ /** Their caret. Their block's bar shows where it is. */
19
+ cursor?: NoteCursor | null;
20
+ /** The block they are in, when there is no caret to show. */
21
+ blockId?: string | null;
22
+ };
23
+ type NoteCommentMessage = {
24
+ id: string;
25
+ author: NotePerson;
26
+ /** When it was written, as the app shows it: "10:02". */
27
+ time?: string;
28
+ text: string;
29
+ };
30
+ /** A thread on some text in a block. */
31
+ type NoteComment = {
32
+ id: string;
33
+ blockId: string;
34
+ /**
35
+ * The text it's about, as a person sees it. The underline goes under its
36
+ * first match in the block, so the thread follows the text as people write
37
+ * around it, and loses its mark when that text is gone.
38
+ */
39
+ quote: string;
40
+ /** A resolved thread keeps no mark in the text. */
41
+ resolved?: boolean;
42
+ messages: NoteCommentMessage[];
43
+ };
44
+ /**
45
+ * Text the assistant or an agent proposes for a block. It shows under that
46
+ * block and never writes into the note: the app applies it on Accept.
47
+ */
48
+ type NoteSuggestion = {
49
+ id: string;
50
+ /** The block it's about. It shows under it, inside a list item or a quote. */
51
+ blockId: string;
52
+ author: NotePerson;
53
+ /** `assistant`, the note's own assistant, takes its violet; `agent`, any other, a plain card. */
54
+ kind?: "assistant" | "agent";
55
+ /** What it does, after its author's name: "proposes adding to bet 1". */
56
+ summary?: string;
57
+ /** The proposed text, as the suggestion shows it. */
58
+ text: string;
59
+ /** What it read to write it: "With «Roadmap 2026» and 1 Product memory". */
60
+ source?: string;
61
+ /**
62
+ * `writing` while it's being written, with no buttons; `proposed`, the
63
+ * default, to accept or discard; `stale` once someone changed the block
64
+ * after, so it can't be accepted as is.
65
+ */
66
+ state?: "writing" | "proposed" | "stale";
67
+ /** Why it's stale: "Diego edited «Three bets» after". */
68
+ staleReason?: string;
69
+ /** Something it clashes with, said before anyone accepts it. */
70
+ conflict?: string;
71
+ };
72
+ /** Where a thread starts: some text in a block, and an agent's first message. */
73
+ type NoteCommentAnchor = {
74
+ blockId: string;
75
+ /** The text it's about, as a person sees it. */
76
+ quote: string;
77
+ /** The first message. A person's thread starts empty, with its field focused; an agent's starts with this. */
78
+ text?: string;
79
+ };
80
+ /** Who did it: a person, or an agent through the editor's actions or a button. */
81
+ type NoteActionDetails = {
82
+ source: "person" | "agent";
83
+ };
84
+ export type { NoteActionDetails, NoteComment, NoteCommentAnchor, NoteCommentMessage, NoteCursor, NotePerson, NotePresence, NoteSuggestion };
@@ -0,0 +1,276 @@
1
+ import { initials, personColor } from "./person.js";
2
+ import { Plugin, PluginKey } from "@tiptap/pm/state";
3
+ import { Decoration, DecorationSet } from "@tiptap/pm/view";
4
+ // src/components/note-editor/people.ts
5
+ function findBlock(doc, blockId) {
6
+ let found = null;
7
+ doc.descendants((node, pos) => {
8
+ if (found) return false;
9
+ if (node.attrs.id !== blockId) return true;
10
+ let inner = node;
11
+ let start = pos;
12
+ while (!inner.isTextblock && inner.firstChild && !inner.isLeaf) {
13
+ start += 1;
14
+ inner = inner.firstChild;
15
+ }
16
+ found = {
17
+ pos,
18
+ text: inner.isTextblock ? {
19
+ start: start + 1,
20
+ node: inner
21
+ } : null
22
+ };
23
+ return false;
24
+ });
25
+ return found;
26
+ }
27
+ /** The ProseMirror position of a place in a block's text, or null when the block is gone. */
28
+ function positionOf(doc, cursor) {
29
+ const block = findBlock(doc, cursor.blockId);
30
+ if (!block?.text) return null;
31
+ const size = block.text.node.content.size;
32
+ return block.text.start + Math.min(Math.max(Math.round(cursor.offset) || 0, 0), size);
33
+ }
34
+ /** The block the selection is in, by its id. */
35
+ function blockIdAt(state, pos = state.selection.from) {
36
+ const $pos = state.doc.resolve(pos);
37
+ for (let depth = $pos.depth; depth > 0; depth--) {
38
+ const node = $pos.node(depth);
39
+ if (node.type.name === "paragraph" && $pos.node(depth - 1).type.name !== "doc") continue;
40
+ const id = node.attrs.id;
41
+ if (typeof id === "string") return id;
42
+ }
43
+ }
44
+ /** Where the caret is, as a block and an offset in its text. */
45
+ function cursorAt(state) {
46
+ const { head } = state.selection;
47
+ const blockId = blockIdAt(state, head);
48
+ if (!blockId) return null;
49
+ const block = findBlock(state.doc, blockId);
50
+ if (!block?.text) return {
51
+ blockId,
52
+ offset: 0
53
+ };
54
+ return {
55
+ blockId,
56
+ offset: Math.max(0, head - block.text.start)
57
+ };
58
+ }
59
+ const leafText = (node) => node.type.name === "hardBreak" ? "\n" : "";
60
+ /** A block's text as a person reads it, a line break as one character. */
61
+ function blockText(doc, blockId) {
62
+ const node = findBlock(doc, blockId)?.text?.node;
63
+ return node ? node.textBetween(0, node.content.size, "\n", leafText) : "";
64
+ }
65
+ /** The range a comment underlines, or null when its text isn't in its block. */
66
+ function commentRange(doc, comment) {
67
+ if (!comment.quote) return null;
68
+ const block = findBlock(doc, comment.blockId);
69
+ if (!block?.text) return null;
70
+ const { start, node } = block.text;
71
+ const index = node.textBetween(0, node.content.size, "\n", leafText).indexOf(comment.quote);
72
+ return index === -1 ? null : {
73
+ from: start + index,
74
+ to: start + index + comment.quote.length
75
+ };
76
+ }
77
+ const peopleKey = new PluginKey("abbyNotePeople");
78
+ const LABEL_MS = 3e3;
79
+ function presenceBars(colors) {
80
+ const mark = document.createElement("span");
81
+ mark.className = "select-none";
82
+ mark.setAttribute("contenteditable", "false");
83
+ mark.setAttribute("aria-hidden", "true");
84
+ mark.dataset.slot = "note-editor-presence-bar";
85
+ const bars = document.createElement("span");
86
+ bars.className = "pointer-events-none absolute -start-5 mt-0.5 inline-flex h-4 gap-0.5";
87
+ for (const color of colors) {
88
+ const bar = document.createElement("span");
89
+ bar.className = "h-full w-0.5 rounded-full bg-(--presence)";
90
+ bar.style.setProperty("--presence", color);
91
+ bars.append(bar);
92
+ }
93
+ mark.append(document.createTextNode("⁠"), bars);
94
+ return mark;
95
+ }
96
+ function liveCursor(person) {
97
+ const cursor = document.createElement("span");
98
+ cursor.className = "group/cursor relative -mx-px border-x border-(--presence) wrap-normal select-none";
99
+ cursor.setAttribute("contenteditable", "false");
100
+ cursor.setAttribute("aria-hidden", "true");
101
+ cursor.dataset.slot = "note-editor-cursor";
102
+ cursor.style.setProperty("--presence", personColor(person));
103
+ const label = document.createElement("span");
104
+ label.className = "pointer-events-none absolute -start-px bottom-full rounded-xs rounded-es-none bg-(--presence) px-1 text-xs font-medium whitespace-nowrap text-presence-foreground transition-opacity duration-popup data-idle:opacity-0 group-hover/cursor:data-idle:opacity-100 motion-reduce:transition-none";
105
+ label.textContent = person.name;
106
+ cursor.append(document.createTextNode("⁠"), label, document.createTextNode("⁠"));
107
+ setTimeout(() => {
108
+ if (cursor.isConnected) label.dataset.idle = "";
109
+ }, LABEL_MS);
110
+ return cursor;
111
+ }
112
+ const suggestionHosts = /* @__PURE__ */ new WeakMap();
113
+ /** The element a suggestion is drawn into, under its block. */
114
+ function suggestionHost(view, id) {
115
+ let hosts = suggestionHosts.get(view);
116
+ if (!hosts) suggestionHosts.set(view, hosts = /* @__PURE__ */ new Map());
117
+ let host = hosts.get(id);
118
+ if (!host) {
119
+ host = document.createElement("div");
120
+ host.className = "mt-2 whitespace-normal";
121
+ host.setAttribute("contenteditable", "false");
122
+ host.dataset.slot = "note-editor-suggestion-slot";
123
+ hosts.set(id, host);
124
+ }
125
+ return host;
126
+ }
127
+ /** Where a suggestion sits: after a block's own text, inside it when it holds others. */
128
+ function suggestionPlace(doc, blockId) {
129
+ const block = findBlock(doc, blockId);
130
+ const node = block && doc.nodeAt(block.pos);
131
+ if (!block || !node) return null;
132
+ return node.isTextblock || node.isLeaf ? block.pos + node.nodeSize : block.pos + node.nodeSize - 1;
133
+ }
134
+ const listIndent = {
135
+ bulletList: 1.75,
136
+ orderedList: 1.75,
137
+ taskList: .125
138
+ };
139
+ function changeMark(kind, label) {
140
+ const mark = document.createElement("span");
141
+ mark.className = "sr-only";
142
+ mark.dataset.slot = "note-editor-change-label";
143
+ mark.dataset.change = kind;
144
+ mark.textContent = `${label}: `;
145
+ return mark;
146
+ }
147
+ function decorate(doc, data) {
148
+ const decorations = [];
149
+ const labels = data.changeLabels ?? {
150
+ added: "Added",
151
+ removed: "Removed"
152
+ };
153
+ for (const [blockId, kind] of Object.entries(data.changes ?? {})) {
154
+ const block = findBlock(doc, blockId);
155
+ const node = block && doc.nodeAt(block.pos);
156
+ if (!block || !node) continue;
157
+ const $pos = doc.resolve(block.pos);
158
+ let reach = 1.5;
159
+ for (let depth = $pos.depth; depth > 0; depth--) reach += listIndent[$pos.node(depth).type.name] ?? 0;
160
+ decorations.push(Decoration.node(block.pos, block.pos + node.nodeSize, {
161
+ "data-diff": kind,
162
+ style: `--diff-start: -${reach}rem`
163
+ }));
164
+ if (block.text) {
165
+ const label = kind === "removed" ? labels.removed : labels.added;
166
+ decorations.push(Decoration.widget(block.text.start, () => changeMark(kind, label), {
167
+ key: `change:${blockId}:${kind}:${label}`,
168
+ side: -2,
169
+ ignoreSelection: true
170
+ }));
171
+ }
172
+ }
173
+ (data.suggestions ?? []).forEach((suggestion, index) => {
174
+ const pos = suggestionPlace(doc, suggestion.blockId);
175
+ if (pos == null) return;
176
+ decorations.push(Decoration.widget(pos, (view) => suggestionHost(view, suggestion.id), {
177
+ key: `suggestion:${suggestion.id}`,
178
+ side: 20 + index,
179
+ stopEvent: () => true,
180
+ ignoreSelection: true
181
+ }));
182
+ });
183
+ const byBlock = /* @__PURE__ */ new Map();
184
+ for (const person of data.presence) {
185
+ const blockId = person.blockId ?? person.cursor?.blockId;
186
+ if (!blockId) continue;
187
+ byBlock.set(blockId, [...byBlock.get(blockId) ?? [], personColor(person)]);
188
+ }
189
+ for (const [blockId, colors] of byBlock) {
190
+ const block = findBlock(doc, blockId);
191
+ if (!block) continue;
192
+ decorations.push(Decoration.widget(block.text?.start ?? block.pos, () => presenceBars(colors), {
193
+ key: `bars:${blockId}:${colors.join(",")}`,
194
+ side: -1,
195
+ ignoreSelection: true
196
+ }));
197
+ }
198
+ for (const person of data.presence) {
199
+ if (!person.cursor) continue;
200
+ const pos = positionOf(doc, person.cursor);
201
+ if (pos == null) continue;
202
+ decorations.push(Decoration.widget(pos, () => liveCursor(person), {
203
+ key: `cursor:${person.id}:${person.cursor.blockId}:${person.cursor.offset}:${person.name}:${personColor(person)}`,
204
+ side: 10,
205
+ ignoreSelection: true
206
+ }));
207
+ }
208
+ for (const comment of data.comments) {
209
+ if (comment.resolved) continue;
210
+ const range = commentRange(doc, comment);
211
+ if (!range) continue;
212
+ const mark = "underline decoration-comment decoration-2 underline-offset-2 [text-decoration-skip-ink:none]";
213
+ decorations.push(Decoration.inline(range.from, range.to, data.readOnly ? {
214
+ class: `${mark} cursor-pointer rounded-xs focus-ring`,
215
+ "data-comment": comment.id,
216
+ tabindex: "0",
217
+ role: "button",
218
+ "aria-haspopup": "dialog"
219
+ } : {
220
+ class: `${mark} cursor-text`,
221
+ "data-comment": comment.id
222
+ }));
223
+ }
224
+ return DecorationSet.create(doc, decorations);
225
+ }
226
+ const keyOf = (data) => JSON.stringify([
227
+ data.presence,
228
+ data.comments,
229
+ Boolean(data.readOnly),
230
+ data.changes ?? {},
231
+ data.changeLabels ?? null,
232
+ (data.suggestions ?? []).map((suggestion) => [suggestion.id, suggestion.blockId])
233
+ ]);
234
+ /** Draws the other people and the comments; `setPeople` hands it what to draw. */
235
+ function peoplePlugin() {
236
+ return new Plugin({
237
+ key: peopleKey,
238
+ state: {
239
+ init: () => ({
240
+ presence: [],
241
+ comments: [],
242
+ key: keyOf({
243
+ presence: [],
244
+ comments: []
245
+ }),
246
+ decorations: DecorationSet.empty
247
+ }),
248
+ apply: (tr, value, _old, state) => {
249
+ const data = tr.getMeta(peopleKey);
250
+ if (data) {
251
+ const key = keyOf(data);
252
+ if (key === value.key && !tr.docChanged) return value;
253
+ return {
254
+ ...data,
255
+ key,
256
+ decorations: decorate(state.doc, data)
257
+ };
258
+ }
259
+ if (tr.docChanged) return {
260
+ ...value,
261
+ decorations: decorate(state.doc, value)
262
+ };
263
+ return value;
264
+ }
265
+ },
266
+ props: { decorations: (state) => peopleKey.getState(state)?.decorations }
267
+ });
268
+ }
269
+ /** Hands the plugin the people and the comments to draw, when they changed. */
270
+ function setPeople(editor, data) {
271
+ if (editor.isDestroyed) return;
272
+ const current = peopleKey.getState(editor.state);
273
+ if (current && current.key === keyOf(data)) return;
274
+ editor.view.dispatch(editor.state.tr.setMeta(peopleKey, data).setMeta("addToHistory", false));
275
+ }
276
+ export { blockIdAt, blockText, commentRange, cursorAt, initials, peoplePlugin, personColor, positionOf, setPeople, suggestionHost };
@@ -0,0 +1,11 @@
1
+ /** Someone in the note. */
2
+ type NotePerson = {
3
+ /** Stable across sessions: it picks the person's color. */
4
+ id: string;
5
+ name: string;
6
+ /** Any CSS color. One of the four `presence-*` tokens by default, picked by `id`. */
7
+ color?: string;
8
+ /** A photo, for the avatars. */
9
+ image?: string;
10
+ };
11
+ export type { NotePerson };
@@ -0,0 +1,15 @@
1
+ // src/components/note-editor/person.ts
2
+ const presenceColors = 4;
3
+ /** A person's color: theirs, or one of the four `presence-*` tokens by their id. */
4
+ function personColor(person) {
5
+ if (person.color) return person.color;
6
+ let hash = 0;
7
+ for (const char of person.id) hash = hash * 31 + char.charCodeAt(0) | 0;
8
+ return `var(--presence-${Math.abs(hash) % presenceColors + 1})`;
9
+ }
10
+ /** Initials for an avatar with no photo: "Marta Soler" reads "MS". */
11
+ function initials(name) {
12
+ const words = name.trim().split(/\s+/).filter(Boolean);
13
+ return (words.length > 1 ? [words[0], words.at(-1)] : words).map((word) => String.fromCodePoint(word.codePointAt(0)).toUpperCase()).join("");
14
+ }
15
+ export { initials, personColor };
@@ -0,0 +1,42 @@
1
+ import { SelectProps, createSelectController } from "@ui-sdk/react/select";
2
+ type NotePlaceFolder = {
3
+ /** What `value` and `onValueChange` carry when this folder is chosen. */
4
+ value: string;
5
+ label: string;
6
+ };
7
+ type NotePlaceArea = {
8
+ /** What `value` and `onValueChange` carry when the area itself is chosen. */
9
+ value: string;
10
+ label: string;
11
+ /** The area's color, as a `bg-*` class for its small square: `bg-chart-1`. */
12
+ mark?: string;
13
+ folders?: readonly NotePlaceFolder[];
14
+ };
15
+ type NotePlaceLabels = {
16
+ /** Names the chip, for a screen reader and an agent. It reads its place after it. */
17
+ place: string;
18
+ /** Names the search field. Share no word with `place`, or an agent can't tell the two apart. */
19
+ search: string;
20
+ /** What shows when nothing matches the search. */
21
+ empty: string;
22
+ /** What shows while no place is chosen. */
23
+ none: string;
24
+ };
25
+ type NotePlaceSelectProps = Omit<Extract<SelectProps<string>, {
26
+ multiple?: false;
27
+ }>, "items" | "children" | "multiple"> & {
28
+ /** The areas the person can write in, each with its folders. */
29
+ areas: readonly NotePlaceArea[];
30
+ /** Replaces any of the default texts, to translate them. */
31
+ labels?: Partial<NotePlaceLabels>;
32
+ /** Classes for the chip. */
33
+ className?: string;
34
+ };
35
+ /**
36
+ * The place chip: the area's color, "Area › Folder" and a chevron. Its list
37
+ * has a search field and one group per area, the area first and its folders
38
+ * under it. An agent chooses a place by its name, "Product › Portugal", and
39
+ * reads them all with the list closed.
40
+ */
41
+ declare function NotePlaceSelect({ areas, labels: own, className, ...props }: NotePlaceSelectProps): import("react").JSX.Element;
42
+ export { type NotePlaceArea, type NotePlaceFolder, type NotePlaceLabels, NotePlaceSelect, type NotePlaceSelectProps, createSelectController as createNotePlaceController };
@@ -0,0 +1,256 @@
1
+ "use client";
2
+ import { cn, cnState } from "../../utilities/cn/index.js";
3
+ import { buttonLook } from "../button/button.js";
4
+ import { Icon } from "../icon/icon.js";
5
+ import { SelectContent as SelectContent$1, SelectEmpty as SelectEmpty$1, SelectGroup as SelectGroup$1, SelectInput as SelectInput$1, SelectItem as SelectItem$1, SelectItemIcon as SelectItemIcon$1, SelectItemIndicator as SelectItemIndicator$1, SelectItemText as SelectItemText$1, SelectList as SelectList$1 } from "../select/select.js";
6
+ import { c } from "react/compiler-runtime";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { ArrowDown01Icon, Folder01Icon } from "@hugeicons/core-free-icons";
9
+ import { Select, SelectTrigger, SelectValue, createSelectController } from "@ui-sdk/react/select";
10
+ // src/components/note-place/note-place.tsx
11
+ const defaultLabels = {
12
+ place: "Place",
13
+ search: "Find an area or folder",
14
+ empty: "Nothing matches",
15
+ none: "Choose where it lives"
16
+ };
17
+ /** The separator between an area and its folder, quieter than both. */
18
+ const separator = " › ";
19
+ function find(areas, value) {
20
+ for (const area of areas) {
21
+ if (area.value === value) return { area };
22
+ const folder = area.folders?.find((entry) => entry.value === value);
23
+ if (folder) return {
24
+ area,
25
+ folder
26
+ };
27
+ }
28
+ }
29
+ /** What a folder's name starts with: its area and the separator. */
30
+ const prefix = (area) => `${area.label}${separator}`.length;
31
+ /** A match's pieces with the first `skip` characters left out, the matches in `<mark>`. */
32
+ function highlight(segments, skip) {
33
+ let left = skip;
34
+ return segments.map((segment, index) => {
35
+ const text = segment.text.slice(left);
36
+ left = Math.max(0, left - segment.text.length);
37
+ if (!text) return null;
38
+ return segment.match ? /* @__PURE__ */ jsx("mark", { children: text }, index) : text;
39
+ });
40
+ }
41
+ function AreaMark(t0) {
42
+ const $ = c(5);
43
+ const { mark, className } = t0;
44
+ let t1;
45
+ if ($[0] !== className || $[1] !== mark) {
46
+ t1 = cn("size-2 shrink-0 rounded-2xs bg-subtle", mark, className);
47
+ $[0] = className;
48
+ $[1] = mark;
49
+ $[2] = t1;
50
+ } else t1 = $[2];
51
+ let t2;
52
+ if ($[3] !== t1) {
53
+ t2 = /* @__PURE__ */ jsx("span", {
54
+ "aria-hidden": "true",
55
+ "data-slot": "note-place-mark",
56
+ className: t1
57
+ });
58
+ $[3] = t1;
59
+ $[4] = t2;
60
+ } else t2 = $[4];
61
+ return t2;
62
+ }
63
+ /**
64
+ * The place chip: the area's color, "Area › Folder" and a chevron. Its list
65
+ * has a search field and one group per area, the area first and its folders
66
+ * under it. An agent chooses a place by its name, "Product › Portugal", and
67
+ * reads them all with the list closed.
68
+ */
69
+ function NotePlaceSelect(t0) {
70
+ const $ = c(36);
71
+ let areas;
72
+ let className;
73
+ let own;
74
+ let props;
75
+ if ($[0] !== t0) {
76
+ ({areas, labels: own, className, ...props} = t0);
77
+ $[0] = t0;
78
+ $[1] = areas;
79
+ $[2] = className;
80
+ $[3] = own;
81
+ $[4] = props;
82
+ } else {
83
+ areas = $[1];
84
+ className = $[2];
85
+ own = $[3];
86
+ props = $[4];
87
+ }
88
+ let t1;
89
+ if ($[5] !== own) {
90
+ t1 = {
91
+ ...defaultLabels,
92
+ ...own
93
+ };
94
+ $[5] = own;
95
+ $[6] = t1;
96
+ } else t1 = $[6];
97
+ const labels = t1;
98
+ let t2;
99
+ if ($[7] !== areas) {
100
+ t2 = areas.map(_temp);
101
+ $[7] = areas;
102
+ $[8] = t2;
103
+ } else t2 = $[8];
104
+ const items = t2;
105
+ const t3 = labels.none;
106
+ const t4 = labels.place;
107
+ let t5;
108
+ if ($[9] !== className) {
109
+ t5 = cnState([buttonLook({
110
+ variant: "ghost",
111
+ size: "sm"
112
+ }), "w-fit max-w-full min-w-0 shrink-0 border border-border font-normal text-foreground data-open:bg-accent"], className);
113
+ $[9] = className;
114
+ $[10] = t5;
115
+ } else t5 = $[10];
116
+ let t6;
117
+ if ($[11] !== areas || $[12] !== labels.none) {
118
+ t6 = /* @__PURE__ */ jsx(SelectValue, {
119
+ className: "flex min-w-0 items-center gap-1.5 data-placeholder:text-subtle",
120
+ children: (state) => {
121
+ const found = find(areas, state.value);
122
+ if (!found) return /* @__PURE__ */ jsx("span", {
123
+ className: "truncate",
124
+ children: state.label || labels.none
125
+ });
126
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AreaMark, { mark: found.area.mark }), /* @__PURE__ */ jsxs("span", {
127
+ className: "truncate",
128
+ children: [found.area.label, found.folder && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
129
+ className: "text-subtle",
130
+ children: separator
131
+ }), found.folder.label] })]
132
+ })] });
133
+ }
134
+ });
135
+ $[11] = areas;
136
+ $[12] = labels.none;
137
+ $[13] = t6;
138
+ } else t6 = $[13];
139
+ let t7;
140
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
141
+ t7 = /* @__PURE__ */ jsx(Icon, {
142
+ icon: ArrowDown01Icon,
143
+ className: "size-3 text-subtle"
144
+ });
145
+ $[14] = t7;
146
+ } else t7 = $[14];
147
+ let t8;
148
+ if ($[15] !== labels.place || $[16] !== t5 || $[17] !== t6) {
149
+ t8 = /* @__PURE__ */ jsxs(SelectTrigger, {
150
+ "data-slot": "note-place",
151
+ "aria-label": t4,
152
+ className: t5,
153
+ children: [t6, t7]
154
+ });
155
+ $[15] = labels.place;
156
+ $[16] = t5;
157
+ $[17] = t6;
158
+ $[18] = t8;
159
+ } else t8 = $[18];
160
+ const t9 = `${labels.search}…`;
161
+ let t10;
162
+ if ($[19] !== labels.search || $[20] !== t9) {
163
+ t10 = /* @__PURE__ */ jsx(SelectInput$1, {
164
+ "aria-label": labels.search,
165
+ placeholder: t9
166
+ });
167
+ $[19] = labels.search;
168
+ $[20] = t9;
169
+ $[21] = t10;
170
+ } else t10 = $[21];
171
+ let t11;
172
+ if ($[22] !== labels.empty) {
173
+ t11 = /* @__PURE__ */ jsx(SelectEmpty$1, { children: labels.empty });
174
+ $[22] = labels.empty;
175
+ $[23] = t11;
176
+ } else t11 = $[23];
177
+ let t12;
178
+ if ($[24] !== areas) {
179
+ t12 = /* @__PURE__ */ jsx(SelectList$1, { children: (state_0) => state_0.items.map((entry) => typeof entry === "object" && "type" in entry && entry.type === "group" ? /* @__PURE__ */ jsx(SelectGroup$1, {
180
+ className: "not-first:mt-1",
181
+ children: entry.items.map((item) => {
182
+ if (typeof item !== "object" || !("value" in item)) return null;
183
+ const found_0 = find(areas, item.value);
184
+ if (!found_0) return null;
185
+ return found_0.folder ? /* @__PURE__ */ jsxs(SelectItem$1, {
186
+ value: found_0.folder.value,
187
+ label: item.label,
188
+ className: "ps-8",
189
+ children: [
190
+ /* @__PURE__ */ jsx(SelectItemIcon$1, { children: /* @__PURE__ */ jsx(Icon, {
191
+ icon: Folder01Icon,
192
+ className: "size-3.5"
193
+ }) }),
194
+ /* @__PURE__ */ jsx(SelectItemText$1, { children: (text) => highlight(text.segments, prefix(found_0.area)) }),
195
+ /* @__PURE__ */ jsx(SelectItemIndicator$1, {})
196
+ ]
197
+ }, found_0.folder.value) : /* @__PURE__ */ jsxs(SelectItem$1, {
198
+ value: found_0.area.value,
199
+ label: item.label,
200
+ children: [
201
+ /* @__PURE__ */ jsx(SelectItemIcon$1, { children: /* @__PURE__ */ jsx(AreaMark, { mark: found_0.area.mark }) }),
202
+ /* @__PURE__ */ jsx(SelectItemText$1, {}),
203
+ /* @__PURE__ */ jsx(SelectItemIndicator$1, {})
204
+ ]
205
+ }, found_0.area.value);
206
+ })
207
+ }, entry.label) : null) });
208
+ $[24] = areas;
209
+ $[25] = t12;
210
+ } else t12 = $[25];
211
+ let t13;
212
+ if ($[26] !== t10 || $[27] !== t11 || $[28] !== t12) {
213
+ t13 = /* @__PURE__ */ jsxs(SelectContent$1, {
214
+ className: "w-72",
215
+ children: [
216
+ t10,
217
+ t11,
218
+ t12
219
+ ]
220
+ });
221
+ $[26] = t10;
222
+ $[27] = t11;
223
+ $[28] = t12;
224
+ $[29] = t13;
225
+ } else t13 = $[29];
226
+ let t14;
227
+ if ($[30] !== items || $[31] !== labels.none || $[32] !== props || $[33] !== t13 || $[34] !== t8) {
228
+ t14 = /* @__PURE__ */ jsxs(Select, {
229
+ items,
230
+ placeholder: t3,
231
+ ...props,
232
+ children: [t8, t13]
233
+ });
234
+ $[30] = items;
235
+ $[31] = labels.none;
236
+ $[32] = props;
237
+ $[33] = t13;
238
+ $[34] = t8;
239
+ $[35] = t14;
240
+ } else t14 = $[35];
241
+ return t14;
242
+ }
243
+ function _temp(area) {
244
+ return {
245
+ type: "group",
246
+ label: area.label,
247
+ items: [{
248
+ value: area.value,
249
+ label: area.label
250
+ }, ...(area.folders ?? []).map((folder) => ({
251
+ value: folder.value,
252
+ label: `${area.label}${separator}${folder.label}`
253
+ }))]
254
+ };
255
+ }
256
+ export { NotePlaceSelect, createSelectController as createNotePlaceController };