@50arms/ui 0.0.0-stage → 35.2.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 (1256) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +193 -2
  3. package/dist/components/Accordion.js +68 -0
  4. package/dist/components/Accordion.js.map +1 -0
  5. package/dist/components/AgentWorkingSpinner.js +46 -0
  6. package/dist/components/AgentWorkingSpinner.js.map +1 -0
  7. package/dist/components/AppShell.js +228 -0
  8. package/dist/components/AppShell.js.map +1 -0
  9. package/dist/components/Attention.js +130 -0
  10. package/dist/components/Attention.js.map +1 -0
  11. package/dist/components/Avatar.js +99 -0
  12. package/dist/components/Avatar.js.map +1 -0
  13. package/dist/components/Badge.js +143 -0
  14. package/dist/components/Badge.js.map +1 -0
  15. package/dist/components/Board.js +292 -0
  16. package/dist/components/Board.js.map +1 -0
  17. package/dist/components/Button.js +327 -0
  18. package/dist/components/Button.js.map +1 -0
  19. package/dist/components/Callout.js +106 -0
  20. package/dist/components/Callout.js.map +1 -0
  21. package/dist/components/Card.js +140 -0
  22. package/dist/components/Card.js.map +1 -0
  23. package/dist/components/Choice.js +361 -0
  24. package/dist/components/Choice.js.map +1 -0
  25. package/dist/components/CodeEditor.js +384 -0
  26. package/dist/components/CodeEditor.js.map +1 -0
  27. package/dist/components/ColorPicker.js +174 -0
  28. package/dist/components/ColorPicker.js.map +1 -0
  29. package/dist/components/Combobox.js +212 -0
  30. package/dist/components/Combobox.js.map +1 -0
  31. package/dist/components/CommandPalette.js +163 -0
  32. package/dist/components/CommandPalette.js.map +1 -0
  33. package/dist/components/ConcentricRing.js +60 -0
  34. package/dist/components/ConcentricRing.js.map +1 -0
  35. package/dist/components/ConnectionCard.js +98 -0
  36. package/dist/components/ConnectionCard.js.map +1 -0
  37. package/dist/components/ContextItemRow.js +49 -0
  38. package/dist/components/ContextItemRow.js.map +1 -0
  39. package/dist/components/CopyValue.js +57 -0
  40. package/dist/components/CopyValue.js.map +1 -0
  41. package/dist/components/CountBadge.js +26 -0
  42. package/dist/components/CountBadge.js.map +1 -0
  43. package/dist/components/DateCalendar.js +156 -0
  44. package/dist/components/DateCalendar.js.map +1 -0
  45. package/dist/components/DateField.js +166 -0
  46. package/dist/components/DateField.js.map +1 -0
  47. package/dist/components/DatePicker.js +56 -0
  48. package/dist/components/DatePicker.js.map +1 -0
  49. package/dist/components/DateTimeText.js +19 -0
  50. package/dist/components/DateTimeText.js.map +1 -0
  51. package/dist/components/DescriptionList.js +25 -0
  52. package/dist/components/DescriptionList.js.map +1 -0
  53. package/dist/components/Dialog.js +332 -0
  54. package/dist/components/Dialog.js.map +1 -0
  55. package/dist/components/DragDrop.js +395 -0
  56. package/dist/components/DragDrop.js.map +1 -0
  57. package/dist/components/Drawer.js +100 -0
  58. package/dist/components/Drawer.js.map +1 -0
  59. package/dist/components/EditGutter.js +110 -0
  60. package/dist/components/EditGutter.js.map +1 -0
  61. package/dist/components/EmojiPicker.js +174 -0
  62. package/dist/components/EmojiPicker.js.map +1 -0
  63. package/dist/components/ErrorBoundary.js +47 -0
  64. package/dist/components/ErrorBoundary.js.map +1 -0
  65. package/dist/components/Field.js +115 -0
  66. package/dist/components/Field.js.map +1 -0
  67. package/dist/components/FileUpload.js +128 -0
  68. package/dist/components/FileUpload.js.map +1 -0
  69. package/dist/components/FilterMenu.js +256 -0
  70. package/dist/components/FilterMenu.js.map +1 -0
  71. package/dist/components/GatesSection.js +79 -0
  72. package/dist/components/GatesSection.js.map +1 -0
  73. package/dist/components/Icon.js +50 -0
  74. package/dist/components/Icon.js.map +1 -0
  75. package/dist/components/IconButton.js +59 -0
  76. package/dist/components/IconButton.js.map +1 -0
  77. package/dist/components/IconStack.js +69 -0
  78. package/dist/components/IconStack.js.map +1 -0
  79. package/dist/components/ImageUploadField.js +146 -0
  80. package/dist/components/ImageUploadField.js.map +1 -0
  81. package/dist/components/InlineEdit.js +432 -0
  82. package/dist/components/InlineEdit.js.map +1 -0
  83. package/dist/components/InlineMarkdownEdit.js +184 -0
  84. package/dist/components/InlineMarkdownEdit.js.map +1 -0
  85. package/dist/components/Input.js +156 -0
  86. package/dist/components/Input.js.map +1 -0
  87. package/dist/components/LegalDocument.js +155 -0
  88. package/dist/components/LegalDocument.js.map +1 -0
  89. package/dist/components/LineDiff.js +95 -0
  90. package/dist/components/LineDiff.js.map +1 -0
  91. package/dist/components/ListHeader.js +72 -0
  92. package/dist/components/ListHeader.js.map +1 -0
  93. package/dist/components/Loading.js +111 -0
  94. package/dist/components/Loading.js.map +1 -0
  95. package/dist/components/Markdown.js +28 -0
  96. package/dist/components/Markdown.js.map +1 -0
  97. package/dist/components/MarkdownEditor.js +467 -0
  98. package/dist/components/MarkdownEditor.js.map +1 -0
  99. package/dist/components/Menu.js +185 -0
  100. package/dist/components/Menu.js.map +1 -0
  101. package/dist/components/Navigation.js +87 -0
  102. package/dist/components/Navigation.js.map +1 -0
  103. package/dist/components/NumberInput.js +119 -0
  104. package/dist/components/NumberInput.js.map +1 -0
  105. package/dist/components/OTPInput.js +71 -0
  106. package/dist/components/OTPInput.js.map +1 -0
  107. package/dist/components/OrderedEntityManager.js +170 -0
  108. package/dist/components/OrderedEntityManager.js.map +1 -0
  109. package/dist/components/PagedWindowList.js +74 -0
  110. package/dist/components/PagedWindowList.js.map +1 -0
  111. package/dist/components/PaginationBar.js +95 -0
  112. package/dist/components/PaginationBar.js.map +1 -0
  113. package/dist/components/Panel.js +396 -0
  114. package/dist/components/Panel.js.map +1 -0
  115. package/dist/components/PasswordInput.js +32 -0
  116. package/dist/components/PasswordInput.js.map +1 -0
  117. package/dist/components/PasswordRequirements.js +25 -0
  118. package/dist/components/PasswordRequirements.js.map +1 -0
  119. package/dist/components/PatchDiff.js +96 -0
  120. package/dist/components/PatchDiff.js.map +1 -0
  121. package/dist/components/PendingVeil.js +18 -0
  122. package/dist/components/PendingVeil.js.map +1 -0
  123. package/dist/components/Popover.js +214 -0
  124. package/dist/components/Popover.js.map +1 -0
  125. package/dist/components/Progress.js +419 -0
  126. package/dist/components/Progress.js.map +1 -0
  127. package/dist/components/RatingScale.js +89 -0
  128. package/dist/components/RatingScale.js.map +1 -0
  129. package/dist/components/ReadMore.js +232 -0
  130. package/dist/components/ReadMore.js.map +1 -0
  131. package/dist/components/RecordCard.js +202 -0
  132. package/dist/components/RecordCard.js.map +1 -0
  133. package/dist/components/RelativeTime.js +29 -0
  134. package/dist/components/RelativeTime.js.map +1 -0
  135. package/dist/components/SandboxedFrame.js +135 -0
  136. package/dist/components/SandboxedFrame.js.map +1 -0
  137. package/dist/components/SearchInput.js +38 -0
  138. package/dist/components/SearchInput.js.map +1 -0
  139. package/dist/components/SecretField.js +228 -0
  140. package/dist/components/SecretField.js.map +1 -0
  141. package/dist/components/SectionNav.js +42 -0
  142. package/dist/components/SectionNav.js.map +1 -0
  143. package/dist/components/Select.js +172 -0
  144. package/dist/components/Select.js.map +1 -0
  145. package/dist/components/SequenceDiagram.js +109 -0
  146. package/dist/components/SequenceDiagram.js.map +1 -0
  147. package/dist/components/SettingRow.js +124 -0
  148. package/dist/components/SettingRow.js.map +1 -0
  149. package/dist/components/SignOffRings.js +36 -0
  150. package/dist/components/SignOffRings.js.map +1 -0
  151. package/dist/components/Slider.js +353 -0
  152. package/dist/components/Slider.js.map +1 -0
  153. package/dist/components/SolutionChoice.js +89 -0
  154. package/dist/components/SolutionChoice.js.map +1 -0
  155. package/dist/components/SortMenu.js +75 -0
  156. package/dist/components/SortMenu.js.map +1 -0
  157. package/dist/components/Spinner.js +42 -0
  158. package/dist/components/Spinner.js.map +1 -0
  159. package/dist/components/Stat.js +148 -0
  160. package/dist/components/Stat.js.map +1 -0
  161. package/dist/components/StatusSelect.js +119 -0
  162. package/dist/components/StatusSelect.js.map +1 -0
  163. package/dist/components/Surface.js +210 -0
  164. package/dist/components/Surface.js.map +1 -0
  165. package/dist/components/Table.js +300 -0
  166. package/dist/components/Table.js.map +1 -0
  167. package/dist/components/Tabs.js +288 -0
  168. package/dist/components/Tabs.js.map +1 -0
  169. package/dist/components/ThemeMenu.js +198 -0
  170. package/dist/components/ThemeMenu.js.map +1 -0
  171. package/dist/components/Toast.js +217 -0
  172. package/dist/components/Toast.js.map +1 -0
  173. package/dist/components/Toggle.js +147 -0
  174. package/dist/components/Toggle.js.map +1 -0
  175. package/dist/components/ToggleMatrix.js +157 -0
  176. package/dist/components/ToggleMatrix.js.map +1 -0
  177. package/dist/components/Tree.js +125 -0
  178. package/dist/components/Tree.js.map +1 -0
  179. package/dist/components/TriStateSwitch.js +111 -0
  180. package/dist/components/TriStateSwitch.js.map +1 -0
  181. package/dist/components/VideoPlayer.js +64 -0
  182. package/dist/components/VideoPlayer.js.map +1 -0
  183. package/dist/components/auth/AcceptInvitationCard.js +110 -0
  184. package/dist/components/auth/AcceptInvitationCard.js.map +1 -0
  185. package/dist/components/auth/AuthLayout.js +18 -0
  186. package/dist/components/auth/AuthLayout.js.map +1 -0
  187. package/dist/components/auth/ForgotPasswordForm.js +44 -0
  188. package/dist/components/auth/ForgotPasswordForm.js.map +1 -0
  189. package/dist/components/auth/LoginForm.js +76 -0
  190. package/dist/components/auth/LoginForm.js.map +1 -0
  191. package/dist/components/auth/ResetPasswordForm.js +69 -0
  192. package/dist/components/auth/ResetPasswordForm.js.map +1 -0
  193. package/dist/components/auth/SignInProviders.js +45 -0
  194. package/dist/components/auth/SignInProviders.js.map +1 -0
  195. package/dist/components/auth/SignupCard.js +204 -0
  196. package/dist/components/auth/SignupCard.js.map +1 -0
  197. package/dist/components/auth/TermsAcceptance.js +43 -0
  198. package/dist/components/auth/TermsAcceptance.js.map +1 -0
  199. package/dist/components/board/context.js +32 -0
  200. package/dist/components/board/context.js.map +1 -0
  201. package/dist/components/board/recipe.js +94 -0
  202. package/dist/components/board/recipe.js.map +1 -0
  203. package/dist/components/calendar/CalendarMonth.js +299 -0
  204. package/dist/components/calendar/CalendarMonth.js.map +1 -0
  205. package/dist/components/calendar/CalendarTimeGrid.js +430 -0
  206. package/dist/components/calendar/CalendarTimeGrid.js.map +1 -0
  207. package/dist/components/calendar/EventActions.js +101 -0
  208. package/dist/components/calendar/EventActions.js.map +1 -0
  209. package/dist/components/calendar/format.js +73 -0
  210. package/dist/components/calendar/format.js.map +1 -0
  211. package/dist/components/calendar/palette.js +31 -0
  212. package/dist/components/calendar/palette.js.map +1 -0
  213. package/dist/components/calendar/use-calendar-drag.js +149 -0
  214. package/dist/components/calendar/use-calendar-drag.js.map +1 -0
  215. package/dist/components/calendar/use-event-keyboard.js +87 -0
  216. package/dist/components/calendar/use-event-keyboard.js.map +1 -0
  217. package/dist/components/calendar/use-grid-navigation.js +79 -0
  218. package/dist/components/calendar/use-grid-navigation.js.map +1 -0
  219. package/dist/components/calendar/use-now.js +27 -0
  220. package/dist/components/calendar/use-now.js.map +1 -0
  221. package/dist/components/card-face/AcRingGlyph.js +39 -0
  222. package/dist/components/card-face/AcRingGlyph.js.map +1 -0
  223. package/dist/components/card-face/BoardCardAgentSlot.js +17 -0
  224. package/dist/components/card-face/BoardCardAgentSlot.js.map +1 -0
  225. package/dist/components/card-face/CardFace.js +109 -0
  226. package/dist/components/card-face/CardFace.js.map +1 -0
  227. package/dist/components/card-face/CardTypeBadge.js +17 -0
  228. package/dist/components/card-face/CardTypeBadge.js.map +1 -0
  229. package/dist/components/card-face/EffortBadge.js +11 -0
  230. package/dist/components/card-face/EffortBadge.js.map +1 -0
  231. package/dist/components/card-face/GateRingGlyph.js +31 -0
  232. package/dist/components/card-face/GateRingGlyph.js.map +1 -0
  233. package/dist/components/card-face/OverflowRow.js +70 -0
  234. package/dist/components/card-face/OverflowRow.js.map +1 -0
  235. package/dist/components/card-face/TapTip.js +32 -0
  236. package/dist/components/card-face/TapTip.js.map +1 -0
  237. package/dist/components/card-face/hit-area.js +6 -0
  238. package/dist/components/card-face/hit-area.js.map +1 -0
  239. package/dist/components/card-face/vocabulary.js +102 -0
  240. package/dist/components/card-face/vocabulary.js.map +1 -0
  241. package/dist/components/chart/BarList.js +78 -0
  242. package/dist/components/chart/BarList.js.map +1 -0
  243. package/dist/components/chart/LineChart.js +310 -0
  244. package/dist/components/chart/LineChart.js.map +1 -0
  245. package/dist/components/chart/ShareBar.js +141 -0
  246. package/dist/components/chart/ShareBar.js.map +1 -0
  247. package/dist/components/chart/TimeSeriesChart.js +305 -0
  248. package/dist/components/chart/TimeSeriesChart.js.map +1 -0
  249. package/dist/components/chart/label-metrics.js +17 -0
  250. package/dist/components/chart/label-metrics.js.map +1 -0
  251. package/dist/components/chart/line-chart-axis.js +38 -0
  252. package/dist/components/chart/line-chart-axis.js.map +1 -0
  253. package/dist/components/chart/line-chart-scale.js +132 -0
  254. package/dist/components/chart/line-chart-scale.js.map +1 -0
  255. package/dist/components/chart/line-series-style.js +22 -0
  256. package/dist/components/chart/line-series-style.js.map +1 -0
  257. package/dist/components/chart/share-bar-labels.js +14 -0
  258. package/dist/components/chart/share-bar-labels.js.map +1 -0
  259. package/dist/components/chart/shared.js +157 -0
  260. package/dist/components/chart/shared.js.map +1 -0
  261. package/dist/components/chart/time-series-scale.js +51 -0
  262. package/dist/components/chart/time-series-scale.js.map +1 -0
  263. package/dist/components/chat/Attachment.js +316 -0
  264. package/dist/components/chat/Attachment.js.map +1 -0
  265. package/dist/components/chat/Chat.js +171 -0
  266. package/dist/components/chat/Chat.js.map +1 -0
  267. package/dist/components/chat/Composer.js +274 -0
  268. package/dist/components/chat/Composer.js.map +1 -0
  269. package/dist/components/chat/ContextMeter.js +202 -0
  270. package/dist/components/chat/ContextMeter.js.map +1 -0
  271. package/dist/components/chat/EffortControl.js +116 -0
  272. package/dist/components/chat/EffortControl.js.map +1 -0
  273. package/dist/components/chat/FileCover.js +78 -0
  274. package/dist/components/chat/FileCover.js.map +1 -0
  275. package/dist/components/chat/Message.js +356 -0
  276. package/dist/components/chat/Message.js.map +1 -0
  277. package/dist/components/chat/MessageScroller.js +104 -0
  278. package/dist/components/chat/MessageScroller.js.map +1 -0
  279. package/dist/components/chat/ModelSelector.js +156 -0
  280. package/dist/components/chat/ModelSelector.js.map +1 -0
  281. package/dist/components/chat/StreamingMarkdown.js +42 -0
  282. package/dist/components/chat/StreamingMarkdown.js.map +1 -0
  283. package/dist/components/chat/download-file.js +9 -0
  284. package/dist/components/chat/download-file.js.map +1 -0
  285. package/dist/components/chat/file-icon.js +39 -0
  286. package/dist/components/chat/file-icon.js.map +1 -0
  287. package/dist/components/checklist/StatusChecklist.js +103 -0
  288. package/dist/components/checklist/StatusChecklist.js.map +1 -0
  289. package/dist/components/checklist/tally.js +29 -0
  290. package/dist/components/checklist/tally.js.map +1 -0
  291. package/dist/components/code-editor/context.js +13 -0
  292. package/dist/components/code-editor/context.js.map +1 -0
  293. package/dist/components/code-editor/editing.js +93 -0
  294. package/dist/components/code-editor/editing.js.map +1 -0
  295. package/dist/components/code-editor/highlight.js +27 -0
  296. package/dist/components/code-editor/highlight.js.map +1 -0
  297. package/dist/components/code-editor/recipe.js +75 -0
  298. package/dist/components/code-editor/recipe.js.map +1 -0
  299. package/dist/components/date-timeline/DateTimeline.js +358 -0
  300. package/dist/components/date-timeline/DateTimeline.js.map +1 -0
  301. package/dist/components/date-timeline/TimelineRow.js +100 -0
  302. package/dist/components/date-timeline/TimelineRow.js.map +1 -0
  303. package/dist/components/date-timeline/useBarDrag.js +44 -0
  304. package/dist/components/date-timeline/useBarDrag.js.map +1 -0
  305. package/dist/components/date-timeline/useMarkerDrag.js +40 -0
  306. package/dist/components/date-timeline/useMarkerDrag.js.map +1 -0
  307. package/dist/components/date-timeline/useTimelineZoom.js +44 -0
  308. package/dist/components/date-timeline/useTimelineZoom.js.map +1 -0
  309. package/dist/components/drag-drop/context.js +37 -0
  310. package/dist/components/drag-drop/context.js.map +1 -0
  311. package/dist/components/drag-drop/recipe.js +270 -0
  312. package/dist/components/drag-drop/recipe.js.map +1 -0
  313. package/dist/components/drag-drop/shift.js +157 -0
  314. package/dist/components/drag-drop/shift.js.map +1 -0
  315. package/dist/components/edit/activation.js +10 -0
  316. package/dist/components/edit/activation.js.map +1 -0
  317. package/dist/components/edit/outcome.js +47 -0
  318. package/dist/components/edit/outcome.js.map +1 -0
  319. package/dist/components/edit/use-edit-session.js +146 -0
  320. package/dist/components/edit/use-edit-session.js.map +1 -0
  321. package/dist/components/file-viewer/FileViewer.js +97 -0
  322. package/dist/components/file-viewer/FileViewer.js.map +1 -0
  323. package/dist/components/file-viewer/PageNumberJumpField.js +47 -0
  324. package/dist/components/file-viewer/PageNumberJumpField.js.map +1 -0
  325. package/dist/components/file-viewer/ViewerControls.js +122 -0
  326. package/dist/components/file-viewer/ViewerControls.js.map +1 -0
  327. package/dist/components/file-viewer/ViewerRail.js +57 -0
  328. package/dist/components/file-viewer/ViewerRail.js.map +1 -0
  329. package/dist/components/file-viewer/ViewerStage.js +112 -0
  330. package/dist/components/file-viewer/ViewerStage.js.map +1 -0
  331. package/dist/components/file-viewer/frames.js +37 -0
  332. package/dist/components/file-viewer/frames.js.map +1 -0
  333. package/dist/components/file-viewer/use-frame-cursor.js +32 -0
  334. package/dist/components/file-viewer/use-frame-cursor.js.map +1 -0
  335. package/dist/components/file-viewer/use-viewer-keys.js +50 -0
  336. package/dist/components/file-viewer/use-viewer-keys.js.map +1 -0
  337. package/dist/components/file-viewer/use-viewer-zoom.js +68 -0
  338. package/dist/components/file-viewer/use-viewer-zoom.js.map +1 -0
  339. package/dist/components/focus-web/FocusWeb.js +322 -0
  340. package/dist/components/focus-web/FocusWeb.js.map +1 -0
  341. package/dist/components/focus-web/layout.js +34 -0
  342. package/dist/components/focus-web/layout.js.map +1 -0
  343. package/dist/components/graph-explorer/GraphExplorer.js +441 -0
  344. package/dist/components/graph-explorer/GraphExplorer.js.map +1 -0
  345. package/dist/components/graph-explorer/camera-math.js +102 -0
  346. package/dist/components/graph-explorer/camera-math.js.map +1 -0
  347. package/dist/components/graph-explorer/tree-layout.js +103 -0
  348. package/dist/components/graph-explorer/tree-layout.js.map +1 -0
  349. package/dist/components/graph-explorer/use-camera.js +82 -0
  350. package/dist/components/graph-explorer/use-camera.js.map +1 -0
  351. package/dist/components/graph-explorer/viewport-gesture.js +107 -0
  352. package/dist/components/graph-explorer/viewport-gesture.js.map +1 -0
  353. package/dist/components/kanban/KanbanBoard.js +219 -0
  354. package/dist/components/kanban/KanbanBoard.js.map +1 -0
  355. package/dist/components/kanban/recipe.js +144 -0
  356. package/dist/components/kanban/recipe.js.map +1 -0
  357. package/dist/components/markdown/Affordances.js +398 -0
  358. package/dist/components/markdown/Affordances.js.map +1 -0
  359. package/dist/components/markdown/AttachmentStrip.js +128 -0
  360. package/dist/components/markdown/AttachmentStrip.js.map +1 -0
  361. package/dist/components/markdown/ImageUpload.js +45 -0
  362. package/dist/components/markdown/ImageUpload.js.map +1 -0
  363. package/dist/components/media-error.js +7 -0
  364. package/dist/components/media-error.js.map +1 -0
  365. package/dist/components/nav-sections.js +61 -0
  366. package/dist/components/nav-sections.js.map +1 -0
  367. package/dist/components/node-canvas/NodeCanvas.js +384 -0
  368. package/dist/components/node-canvas/NodeCanvas.js.map +1 -0
  369. package/dist/components/node-canvas/layout.js +237 -0
  370. package/dist/components/node-canvas/layout.js.map +1 -0
  371. package/dist/components/node-canvas/use-canvas-gestures.js +143 -0
  372. package/dist/components/node-canvas/use-canvas-gestures.js.map +1 -0
  373. package/dist/components/openapi/OpenApiViewer.js +137 -0
  374. package/dist/components/openapi/OpenApiViewer.js.map +1 -0
  375. package/dist/components/openapi/OperationCard.js +145 -0
  376. package/dist/components/openapi/OperationCard.js.map +1 -0
  377. package/dist/components/openapi/SchemaView.js +68 -0
  378. package/dist/components/openapi/SchemaView.js.map +1 -0
  379. package/dist/components/openapi/resolve.js +102 -0
  380. package/dist/components/openapi/resolve.js.map +1 -0
  381. package/dist/components/openapi/types.js +5 -0
  382. package/dist/components/openapi/types.js.map +1 -0
  383. package/dist/components/overlay-shell.js +29 -0
  384. package/dist/components/overlay-shell.js.map +1 -0
  385. package/dist/components/overlay-stack.js +27 -0
  386. package/dist/components/overlay-stack.js.map +1 -0
  387. package/dist/components/paged-window/PageBlock.js +50 -0
  388. package/dist/components/paged-window/PageBlock.js.map +1 -0
  389. package/dist/components/provenance/ConfidenceBar.js +60 -0
  390. package/dist/components/provenance/ConfidenceBar.js.map +1 -0
  391. package/dist/components/provenance/ConfidenceMeter.js +36 -0
  392. package/dist/components/provenance/ConfidenceMeter.js.map +1 -0
  393. package/dist/components/provenance/ConfidenceReadout.js +31 -0
  394. package/dist/components/provenance/ConfidenceReadout.js.map +1 -0
  395. package/dist/components/provenance/ProvenanceBadge.js +44 -0
  396. package/dist/components/provenance/ProvenanceBadge.js.map +1 -0
  397. package/dist/components/provenance/ProvenanceDetail.js +114 -0
  398. package/dist/components/provenance/ProvenanceDetail.js.map +1 -0
  399. package/dist/components/provenance/ProvenanceDisclosure.js +111 -0
  400. package/dist/components/provenance/ProvenanceDisclosure.js.map +1 -0
  401. package/dist/components/provenance/absence.js +31 -0
  402. package/dist/components/provenance/absence.js.map +1 -0
  403. package/dist/components/provenance/types.js +30 -0
  404. package/dist/components/provenance/types.js.map +1 -0
  405. package/dist/components/rbac/AccessRequestPanel.js +153 -0
  406. package/dist/components/rbac/AccessRequestPanel.js.map +1 -0
  407. package/dist/components/rbac/AccountMenu.js +118 -0
  408. package/dist/components/rbac/AccountMenu.js.map +1 -0
  409. package/dist/components/rbac/AgentKeysList.js +20 -0
  410. package/dist/components/rbac/AgentKeysList.js.map +1 -0
  411. package/dist/components/rbac/ApiKeysPanel.js +172 -0
  412. package/dist/components/rbac/ApiKeysPanel.js.map +1 -0
  413. package/dist/components/rbac/ApiKeysTable.js +169 -0
  414. package/dist/components/rbac/ApiKeysTable.js.map +1 -0
  415. package/dist/components/rbac/Brand.js +13 -0
  416. package/dist/components/rbac/Brand.js.map +1 -0
  417. package/dist/components/rbac/Can.js +18 -0
  418. package/dist/components/rbac/Can.js.map +1 -0
  419. package/dist/components/rbac/ChangePasswordForm.js +73 -0
  420. package/dist/components/rbac/ChangePasswordForm.js.map +1 -0
  421. package/dist/components/rbac/DangerZone.js +27 -0
  422. package/dist/components/rbac/DangerZone.js.map +1 -0
  423. package/dist/components/rbac/DevToolsPopover.js +140 -0
  424. package/dist/components/rbac/DevToolsPopover.js.map +1 -0
  425. package/dist/components/rbac/EndedLine.js +24 -0
  426. package/dist/components/rbac/EndedLine.js.map +1 -0
  427. package/dist/components/rbac/InvitationsList.js +148 -0
  428. package/dist/components/rbac/InvitationsList.js.map +1 -0
  429. package/dist/components/rbac/InviteMembersDialog.js +97 -0
  430. package/dist/components/rbac/InviteMembersDialog.js.map +1 -0
  431. package/dist/components/rbac/MembersPanel.js +138 -0
  432. package/dist/components/rbac/MembersPanel.js.map +1 -0
  433. package/dist/components/rbac/PermissionRequestPanel.js +141 -0
  434. package/dist/components/rbac/PermissionRequestPanel.js.map +1 -0
  435. package/dist/components/rbac/ProfileForm.js +86 -0
  436. package/dist/components/rbac/ProfileForm.js.map +1 -0
  437. package/dist/components/rbac/ProfilePage.js +58 -0
  438. package/dist/components/rbac/ProfilePage.js.map +1 -0
  439. package/dist/components/rbac/RBACProvider.js +82 -0
  440. package/dist/components/rbac/RBACProvider.js.map +1 -0
  441. package/dist/components/rbac/RoleEditorDialog.js +90 -0
  442. package/dist/components/rbac/RoleEditorDialog.js.map +1 -0
  443. package/dist/components/rbac/RoleKeyPicker.js +77 -0
  444. package/dist/components/rbac/RoleKeyPicker.js.map +1 -0
  445. package/dist/components/rbac/RolePermissionMatrix.js +37 -0
  446. package/dist/components/rbac/RolePermissionMatrix.js.map +1 -0
  447. package/dist/components/rbac/RolesPermissionsPage.js +142 -0
  448. package/dist/components/rbac/RolesPermissionsPage.js.map +1 -0
  449. package/dist/components/rbac/SessionsList.js +146 -0
  450. package/dist/components/rbac/SessionsList.js.map +1 -0
  451. package/dist/components/rbac/TeamSettingsForm.js +69 -0
  452. package/dist/components/rbac/TeamSettingsForm.js.map +1 -0
  453. package/dist/components/rbac/TeamSwitcher.js +66 -0
  454. package/dist/components/rbac/TeamSwitcher.js.map +1 -0
  455. package/dist/components/rbac/approvalPanelParts.js +130 -0
  456. package/dist/components/rbac/approvalPanelParts.js.map +1 -0
  457. package/dist/components/rbac/permissionSections.js +8 -0
  458. package/dist/components/rbac/permissionSections.js.map +1 -0
  459. package/dist/components/rbac/stagedForm.js +42 -0
  460. package/dist/components/rbac/stagedForm.js.map +1 -0
  461. package/dist/components/rbac/useStagedImage.js +21 -0
  462. package/dist/components/rbac/useStagedImage.js.map +1 -0
  463. package/dist/components/roadmap/PhaseManager.js +48 -0
  464. package/dist/components/roadmap/PhaseManager.js.map +1 -0
  465. package/dist/components/roadmap/RoadmapItemCard.js +96 -0
  466. package/dist/components/roadmap/RoadmapItemCard.js.map +1 -0
  467. package/dist/components/roadmap/RoadmapPage.js +34 -0
  468. package/dist/components/roadmap/RoadmapPage.js.map +1 -0
  469. package/dist/components/roadmap/RoadmapSwimlaneBoard.js +91 -0
  470. package/dist/components/roadmap/RoadmapSwimlaneBoard.js.map +1 -0
  471. package/dist/components/roadmap/TrackManager.js +58 -0
  472. package/dist/components/roadmap/TrackManager.js.map +1 -0
  473. package/dist/components/roadmap/UseCaseCard.js +93 -0
  474. package/dist/components/roadmap/UseCaseCard.js.map +1 -0
  475. package/dist/components/roadmap/UseCaseLedgerPage.js +98 -0
  476. package/dist/components/roadmap/UseCaseLedgerPage.js.map +1 -0
  477. package/dist/components/roadmap/chip-tones.js +9 -0
  478. package/dist/components/roadmap/chip-tones.js.map +1 -0
  479. package/dist/components/roadmap/derive.js +28 -0
  480. package/dist/components/roadmap/derive.js.map +1 -0
  481. package/dist/components/stepper/Stepper.js +276 -0
  482. package/dist/components/stepper/Stepper.js.map +1 -0
  483. package/dist/components/stepper/derive.js +53 -0
  484. package/dist/components/stepper/derive.js.map +1 -0
  485. package/dist/confidence.css +222 -0
  486. package/dist/fonts/bricolage-grotesque-0.woff2 +0 -0
  487. package/dist/fonts/bricolage-grotesque-1.woff2 +0 -0
  488. package/dist/fonts/bricolage-grotesque-2.woff2 +0 -0
  489. package/dist/fonts/figtree-0.woff2 +0 -0
  490. package/dist/fonts/figtree-1.woff2 +0 -0
  491. package/dist/fonts/figtree-2.woff2 +0 -0
  492. package/dist/fonts/figtree-3.woff2 +0 -0
  493. package/dist/fonts/jetbrains-mono-0.woff2 +0 -0
  494. package/dist/fonts/jetbrains-mono-1.woff2 +0 -0
  495. package/dist/fonts/jetbrains-mono-10.woff2 +0 -0
  496. package/dist/fonts/jetbrains-mono-11.woff2 +0 -0
  497. package/dist/fonts/jetbrains-mono-2.woff2 +0 -0
  498. package/dist/fonts/jetbrains-mono-3.woff2 +0 -0
  499. package/dist/fonts/jetbrains-mono-4.woff2 +0 -0
  500. package/dist/fonts/jetbrains-mono-5.woff2 +0 -0
  501. package/dist/fonts/jetbrains-mono-6.woff2 +0 -0
  502. package/dist/fonts/jetbrains-mono-7.woff2 +0 -0
  503. package/dist/fonts/jetbrains-mono-8.woff2 +0 -0
  504. package/dist/fonts/jetbrains-mono-9.woff2 +0 -0
  505. package/dist/fonts.css +187 -0
  506. package/dist/icons/data.js +233 -0
  507. package/dist/icons/data.js.map +1 -0
  508. package/dist/index.js +942 -0
  509. package/dist/index.js.map +1 -0
  510. package/dist/lib/attention.js +75 -0
  511. package/dist/lib/attention.js.map +1 -0
  512. package/dist/lib/board/anchor.js +14 -0
  513. package/dist/lib/board/anchor.js.map +1 -0
  514. package/dist/lib/board/model.js +41 -0
  515. package/dist/lib/board/model.js.map +1 -0
  516. package/dist/lib/board/move.js +161 -0
  517. package/dist/lib/board/move.js.map +1 -0
  518. package/dist/lib/board/position.js +11 -0
  519. package/dist/lib/board/position.js.map +1 -0
  520. package/dist/lib/board/rejection.js +22 -0
  521. package/dist/lib/board/rejection.js.map +1 -0
  522. package/dist/lib/board/use-board.js +43 -0
  523. package/dist/lib/board/use-board.js.map +1 -0
  524. package/dist/lib/calendar/band-packer.js +44 -0
  525. package/dist/lib/calendar/band-packer.js.map +1 -0
  526. package/dist/lib/calendar/drag.js +74 -0
  527. package/dist/lib/calendar/drag.js.map +1 -0
  528. package/dist/lib/calendar/lane-packer.js +67 -0
  529. package/dist/lib/calendar/lane-packer.js.map +1 -0
  530. package/dist/lib/calendar/segments.js +82 -0
  531. package/dist/lib/calendar/segments.js.map +1 -0
  532. package/dist/lib/calendar/types.js +7 -0
  533. package/dist/lib/calendar/types.js.map +1 -0
  534. package/dist/lib/chart-palette.js +27 -0
  535. package/dist/lib/chart-palette.js.map +1 -0
  536. package/dist/lib/clipboard.js +30 -0
  537. package/dist/lib/clipboard.js.map +1 -0
  538. package/dist/lib/cn.js +9 -0
  539. package/dist/lib/cn.js.map +1 -0
  540. package/dist/lib/color.js +24 -0
  541. package/dist/lib/color.js.map +1 -0
  542. package/dist/lib/component-guidance.js +297 -0
  543. package/dist/lib/component-guidance.js.map +1 -0
  544. package/dist/lib/confidence.js +22 -0
  545. package/dist/lib/confidence.js.map +1 -0
  546. package/dist/lib/date-timeline/scale.js +197 -0
  547. package/dist/lib/date-timeline/scale.js.map +1 -0
  548. package/dist/lib/design-frame/document.js +44 -0
  549. package/dist/lib/design-frame/document.js.map +1 -0
  550. package/dist/lib/design-frame/mini-app-script.js +107 -0
  551. package/dist/lib/design-frame/mini-app-script.js.map +1 -0
  552. package/dist/lib/design-frame/mini-app.js +12 -0
  553. package/dist/lib/design-frame/mini-app.js.map +1 -0
  554. package/dist/lib/design-frame/protocol.js +46 -0
  555. package/dist/lib/design-frame/protocol.js.map +1 -0
  556. package/dist/lib/dev-warn.js +17 -0
  557. package/dist/lib/dev-warn.js.map +1 -0
  558. package/dist/lib/dnd/announce.js +120 -0
  559. package/dist/lib/dnd/announce.js.map +1 -0
  560. package/dist/lib/dnd/autoscroll.js +123 -0
  561. package/dist/lib/dnd/autoscroll.js.map +1 -0
  562. package/dist/lib/dnd/cross-drop.js +11 -0
  563. package/dist/lib/dnd/cross-drop.js.map +1 -0
  564. package/dist/lib/dnd/geometry.js +99 -0
  565. package/dist/lib/dnd/geometry.js.map +1 -0
  566. package/dist/lib/dnd/sensors/gesture.js +86 -0
  567. package/dist/lib/dnd/sensors/gesture.js.map +1 -0
  568. package/dist/lib/dnd/sensors/keyboard.js +47 -0
  569. package/dist/lib/dnd/sensors/keyboard.js.map +1 -0
  570. package/dist/lib/dnd/sensors/pointer.js +32 -0
  571. package/dist/lib/dnd/sensors/pointer.js.map +1 -0
  572. package/dist/lib/dnd/session.js +256 -0
  573. package/dist/lib/dnd/session.js.map +1 -0
  574. package/dist/lib/dnd/use-drag.js +90 -0
  575. package/dist/lib/dnd/use-drag.js.map +1 -0
  576. package/dist/lib/dom/scroll-ancestor.js +18 -0
  577. package/dist/lib/dom/scroll-ancestor.js.map +1 -0
  578. package/dist/lib/format.js +23 -0
  579. package/dist/lib/format.js.map +1 -0
  580. package/dist/lib/group-in-order.js +13 -0
  581. package/dist/lib/group-in-order.js.map +1 -0
  582. package/dist/lib/header-fold.js +11 -0
  583. package/dist/lib/header-fold.js.map +1 -0
  584. package/dist/lib/i18n/areas/auth-provenance-flows.js +156 -0
  585. package/dist/lib/i18n/areas/auth-provenance-flows.js.map +1 -0
  586. package/dist/lib/i18n/areas/board.js +35 -0
  587. package/dist/lib/i18n/areas/board.js.map +1 -0
  588. package/dist/lib/i18n/areas/card-face.js +10 -0
  589. package/dist/lib/i18n/areas/card-face.js.map +1 -0
  590. package/dist/lib/i18n/areas/chat-chart.js +118 -0
  591. package/dist/lib/i18n/areas/chat-chart.js.map +1 -0
  592. package/dist/lib/i18n/areas/code-editor.js +24 -0
  593. package/dist/lib/i18n/areas/code-editor.js.map +1 -0
  594. package/dist/lib/i18n/areas/date-timeline.js +21 -0
  595. package/dist/lib/i18n/areas/date-timeline.js.map +1 -0
  596. package/dist/lib/i18n/areas/dates.js +71 -0
  597. package/dist/lib/i18n/areas/dates.js.map +1 -0
  598. package/dist/lib/i18n/areas/docs-views.js +183 -0
  599. package/dist/lib/i18n/areas/docs-views.js.map +1 -0
  600. package/dist/lib/i18n/areas/feedback.js +75 -0
  601. package/dist/lib/i18n/areas/feedback.js.map +1 -0
  602. package/dist/lib/i18n/areas/formats.js +24 -0
  603. package/dist/lib/i18n/areas/formats.js.map +1 -0
  604. package/dist/lib/i18n/areas/forms.js +110 -0
  605. package/dist/lib/i18n/areas/forms.js.map +1 -0
  606. package/dist/lib/i18n/areas/keys.js +25 -0
  607. package/dist/lib/i18n/areas/keys.js.map +1 -0
  608. package/dist/lib/i18n/areas/markdown.js +136 -0
  609. package/dist/lib/i18n/areas/markdown.js.map +1 -0
  610. package/dist/lib/i18n/areas/move-rejected.js +14 -0
  611. package/dist/lib/i18n/areas/move-rejected.js.map +1 -0
  612. package/dist/lib/i18n/areas/navigation.js +104 -0
  613. package/dist/lib/i18n/areas/navigation.js.map +1 -0
  614. package/dist/lib/i18n/areas/rbac.js +332 -0
  615. package/dist/lib/i18n/areas/rbac.js.map +1 -0
  616. package/dist/lib/i18n/emphasis.js +6 -0
  617. package/dist/lib/i18n/emphasis.js.map +1 -0
  618. package/dist/lib/i18n/number-format.js +9 -0
  619. package/dist/lib/i18n/number-format.js.map +1 -0
  620. package/dist/lib/i18n/plural.js +9 -0
  621. package/dist/lib/i18n/plural.js.map +1 -0
  622. package/dist/lib/i18n/provider.js +27 -0
  623. package/dist/lib/i18n/provider.js.map +1 -0
  624. package/dist/lib/i18n/strings.js +38 -0
  625. package/dist/lib/i18n/strings.js.map +1 -0
  626. package/dist/lib/icons.js +17 -0
  627. package/dist/lib/icons.js.map +1 -0
  628. package/dist/lib/interactive-target.js +9 -0
  629. package/dist/lib/interactive-target.js.map +1 -0
  630. package/dist/lib/intl-cache.js +69 -0
  631. package/dist/lib/intl-cache.js.map +1 -0
  632. package/dist/lib/legal-document.js +37 -0
  633. package/dist/lib/legal-document.js.map +1 -0
  634. package/dist/lib/line-diff-model.js +51 -0
  635. package/dist/lib/line-diff-model.js.map +1 -0
  636. package/dist/lib/markdown/attachments.js +71 -0
  637. package/dist/lib/markdown/attachments.js.map +1 -0
  638. package/dist/lib/markdown/caret-map.js +153 -0
  639. package/dist/lib/markdown/caret-map.js.map +1 -0
  640. package/dist/lib/markdown/caret.js +35 -0
  641. package/dist/lib/markdown/caret.js.map +1 -0
  642. package/dist/lib/markdown/commands.js +443 -0
  643. package/dist/lib/markdown/commands.js.map +1 -0
  644. package/dist/lib/markdown/convert.js +153 -0
  645. package/dist/lib/markdown/convert.js.map +1 -0
  646. package/dist/lib/markdown/dom.js +89 -0
  647. package/dist/lib/markdown/dom.js.map +1 -0
  648. package/dist/lib/markdown/edit.js +92 -0
  649. package/dist/lib/markdown/edit.js.map +1 -0
  650. package/dist/lib/markdown/history.js +79 -0
  651. package/dist/lib/markdown/history.js.map +1 -0
  652. package/dist/lib/markdown/hotkeys.js +63 -0
  653. package/dist/lib/markdown/hotkeys.js.map +1 -0
  654. package/dist/lib/markdown/image-pipeline.js +236 -0
  655. package/dist/lib/markdown/image-pipeline.js.map +1 -0
  656. package/dist/lib/markdown/images.js +85 -0
  657. package/dist/lib/markdown/images.js.map +1 -0
  658. package/dist/lib/markdown/input.js +210 -0
  659. package/dist/lib/markdown/input.js.map +1 -0
  660. package/dist/lib/markdown/keys.js +37 -0
  661. package/dist/lib/markdown/keys.js.map +1 -0
  662. package/dist/lib/markdown/paste.js +180 -0
  663. package/dist/lib/markdown/paste.js.map +1 -0
  664. package/dist/lib/markdown/position.js +111 -0
  665. package/dist/lib/markdown/position.js.map +1 -0
  666. package/dist/lib/markdown/project.js +108 -0
  667. package/dist/lib/markdown/project.js.map +1 -0
  668. package/dist/lib/markdown/reconcile.js +127 -0
  669. package/dist/lib/markdown/reconcile.js.map +1 -0
  670. package/dist/lib/markdown/surface.js +373 -0
  671. package/dist/lib/markdown/surface.js.map +1 -0
  672. package/dist/lib/motion.js +22 -0
  673. package/dist/lib/motion.js.map +1 -0
  674. package/dist/lib/pad.js +7 -0
  675. package/dist/lib/pad.js.map +1 -0
  676. package/dist/lib/paged-window/layout.js +15 -0
  677. package/dist/lib/paged-window/layout.js.map +1 -0
  678. package/dist/lib/paged-window/list-owner.js +21 -0
  679. package/dist/lib/paged-window/list-owner.js.map +1 -0
  680. package/dist/lib/paged-window/records-binding.js +239 -0
  681. package/dist/lib/paged-window/records-binding.js.map +1 -0
  682. package/dist/lib/paged-window/store.js +562 -0
  683. package/dist/lib/paged-window/store.js.map +1 -0
  684. package/dist/lib/paged-window/use-measured-pitch.js +38 -0
  685. package/dist/lib/paged-window/use-measured-pitch.js.map +1 -0
  686. package/dist/lib/paged-window/use-page-visibility.js +36 -0
  687. package/dist/lib/paged-window/use-page-visibility.js.map +1 -0
  688. package/dist/lib/paged-window/use-paged-window.js +43 -0
  689. package/dist/lib/paged-window/use-paged-window.js.map +1 -0
  690. package/dist/lib/paged-window/use-scroll-root.js +12 -0
  691. package/dist/lib/paged-window/use-scroll-root.js.map +1 -0
  692. package/dist/lib/persist.js +84 -0
  693. package/dist/lib/persist.js.map +1 -0
  694. package/dist/lib/preference-values.js +13 -0
  695. package/dist/lib/preference-values.js.map +1 -0
  696. package/dist/lib/preferences.js +86 -0
  697. package/dist/lib/preferences.js.map +1 -0
  698. package/dist/lib/reads/hooks.js +156 -0
  699. package/dist/lib/reads/hooks.js.map +1 -0
  700. package/dist/lib/reads/optimistic.js +169 -0
  701. package/dist/lib/reads/optimistic.js.map +1 -0
  702. package/dist/lib/reads/refetch.js +108 -0
  703. package/dist/lib/reads/refetch.js.map +1 -0
  704. package/dist/lib/reads/slots.js +215 -0
  705. package/dist/lib/reads/slots.js.map +1 -0
  706. package/dist/lib/realtime/hooks.js +40 -0
  707. package/dist/lib/realtime/hooks.js.map +1 -0
  708. package/dist/lib/realtime/provider.js +25 -0
  709. package/dist/lib/realtime/provider.js.map +1 -0
  710. package/dist/lib/realtime/registry.js +472 -0
  711. package/dist/lib/realtime/registry.js.map +1 -0
  712. package/dist/lib/records/define-record-type.js +33 -0
  713. package/dist/lib/records/define-record-type.js.map +1 -0
  714. package/dist/lib/records/hooks.js +39 -0
  715. package/dist/lib/records/hooks.js.map +1 -0
  716. package/dist/lib/records/store.js +572 -0
  717. package/dist/lib/records/store.js.map +1 -0
  718. package/dist/lib/records/wire.js +58 -0
  719. package/dist/lib/records/wire.js.map +1 -0
  720. package/dist/lib/reduced-motion-help.js +19 -0
  721. package/dist/lib/reduced-motion-help.js.map +1 -0
  722. package/dist/lib/scroll-caret.js +18 -0
  723. package/dist/lib/scroll-caret.js.map +1 -0
  724. package/dist/lib/sim/createSimStore.js +54 -0
  725. package/dist/lib/sim/createSimStore.js.map +1 -0
  726. package/dist/lib/sim/latency.js +28 -0
  727. package/dist/lib/sim/latency.js.map +1 -0
  728. package/dist/lib/sim/registry.js +13 -0
  729. package/dist/lib/sim/registry.js.map +1 -0
  730. package/dist/lib/sim/settings.js +41 -0
  731. package/dist/lib/sim/settings.js.map +1 -0
  732. package/dist/lib/submit-shortcut.js +25 -0
  733. package/dist/lib/submit-shortcut.js.map +1 -0
  734. package/dist/lib/syntax/index.js +33 -0
  735. package/dist/lib/syntax/index.js.map +1 -0
  736. package/dist/lib/syntax/languages/bash.js +77 -0
  737. package/dist/lib/syntax/languages/bash.js.map +1 -0
  738. package/dist/lib/syntax/languages/css.js +81 -0
  739. package/dist/lib/syntax/languages/css.js.map +1 -0
  740. package/dist/lib/syntax/languages/html.js +91 -0
  741. package/dist/lib/syntax/languages/html.js.map +1 -0
  742. package/dist/lib/syntax/languages/index.js +49 -0
  743. package/dist/lib/syntax/languages/index.js.map +1 -0
  744. package/dist/lib/syntax/languages/javascript.js +133 -0
  745. package/dist/lib/syntax/languages/javascript.js.map +1 -0
  746. package/dist/lib/syntax/languages/json.js +45 -0
  747. package/dist/lib/syntax/languages/json.js.map +1 -0
  748. package/dist/lib/syntax/languages/mongodb.js +24 -0
  749. package/dist/lib/syntax/languages/mongodb.js.map +1 -0
  750. package/dist/lib/syntax/languages/plain.js +10 -0
  751. package/dist/lib/syntax/languages/plain.js.map +1 -0
  752. package/dist/lib/syntax/languages/sql.js +113 -0
  753. package/dist/lib/syntax/languages/sql.js.map +1 -0
  754. package/dist/lib/syntax/languages/vue.js +31 -0
  755. package/dist/lib/syntax/languages/vue.js.map +1 -0
  756. package/dist/lib/syntax/languages/yaml.js +55 -0
  757. package/dist/lib/syntax/languages/yaml.js.map +1 -0
  758. package/dist/lib/syntax/markdown/grammar.js +52 -0
  759. package/dist/lib/syntax/markdown/grammar.js.map +1 -0
  760. package/dist/lib/syntax/markdown/inline.js +477 -0
  761. package/dist/lib/syntax/markdown/inline.js.map +1 -0
  762. package/dist/lib/syntax/markdown/parse.js +464 -0
  763. package/dist/lib/syntax/markdown/parse.js.map +1 -0
  764. package/dist/lib/syntax/markdown/refs.js +94 -0
  765. package/dist/lib/syntax/markdown/refs.js.map +1 -0
  766. package/dist/lib/syntax/markdown/render.js +230 -0
  767. package/dist/lib/syntax/markdown/render.js.map +1 -0
  768. package/dist/lib/syntax/markdown/spans.js +40 -0
  769. package/dist/lib/syntax/markdown/spans.js.map +1 -0
  770. package/dist/lib/syntax/registry.js +55 -0
  771. package/dist/lib/syntax/registry.js.map +1 -0
  772. package/dist/lib/syntax/tokenize.js +96 -0
  773. package/dist/lib/syntax/tokenize.js.map +1 -0
  774. package/dist/lib/time/instant.js +7 -0
  775. package/dist/lib/time/instant.js.map +1 -0
  776. package/dist/lib/time/plain.js +83 -0
  777. package/dist/lib/time/plain.js.map +1 -0
  778. package/dist/lib/time/relativeAge.js +20 -0
  779. package/dist/lib/time/relativeAge.js.map +1 -0
  780. package/dist/lib/time/relativeClock.js +59 -0
  781. package/dist/lib/time/relativeClock.js.map +1 -0
  782. package/dist/lib/time/types.js +23 -0
  783. package/dist/lib/time/types.js.map +1 -0
  784. package/dist/lib/time/zone.js +148 -0
  785. package/dist/lib/time/zone.js.map +1 -0
  786. package/dist/lib/use-controllable.js +16 -0
  787. package/dist/lib/use-controllable.js.map +1 -0
  788. package/dist/lib/use-fill-height.js +49 -0
  789. package/dist/lib/use-fill-height.js.map +1 -0
  790. package/dist/lib/use-hydrated.js +14 -0
  791. package/dist/lib/use-hydrated.js.map +1 -0
  792. package/dist/lib/use-media-query.js +30 -0
  793. package/dist/lib/use-media-query.js.map +1 -0
  794. package/dist/lib/use-relabel-base-ui-dismiss.js +26 -0
  795. package/dist/lib/use-relabel-base-ui-dismiss.js.map +1 -0
  796. package/dist/lib/use-release-snap-drag.js +29 -0
  797. package/dist/lib/use-release-snap-drag.js.map +1 -0
  798. package/dist/lib/use-roving-options.js +18 -0
  799. package/dist/lib/use-roving-options.js.map +1 -0
  800. package/dist/lib/values/absent.js +5 -0
  801. package/dist/lib/values/absent.js.map +1 -0
  802. package/dist/lib/values/boolean.js +13 -0
  803. package/dist/lib/values/boolean.js.map +1 -0
  804. package/dist/lib/values/currency.js +23 -0
  805. package/dist/lib/values/currency.js.map +1 -0
  806. package/dist/lib/values/date.js +35 -0
  807. package/dist/lib/values/date.js.map +1 -0
  808. package/dist/lib/values/datetime.js +54 -0
  809. package/dist/lib/values/datetime.js.map +1 -0
  810. package/dist/lib/values/locale-date.js +60 -0
  811. package/dist/lib/values/locale-date.js.map +1 -0
  812. package/dist/lib/values/number.js +16 -0
  813. package/dist/lib/values/number.js.map +1 -0
  814. package/dist/pure.js +379 -0
  815. package/dist/pure.js.map +1 -0
  816. package/dist/styles.css +190 -0
  817. package/dist/theme.css +360 -0
  818. package/dist/types/components/Accordion.d.ts +15 -0
  819. package/dist/types/components/AgentWorkingSpinner.d.ts +23 -0
  820. package/dist/types/components/AppShell.d.ts +164 -0
  821. package/dist/types/components/Attention.d.ts +87 -0
  822. package/dist/types/components/Avatar.d.ts +154 -0
  823. package/dist/types/components/Badge.d.ts +131 -0
  824. package/dist/types/components/Board.d.ts +239 -0
  825. package/dist/types/components/Button.d.ts +208 -0
  826. package/dist/types/components/Callout.d.ts +163 -0
  827. package/dist/types/components/Card.d.ts +219 -0
  828. package/dist/types/components/Choice.d.ts +127 -0
  829. package/dist/types/components/CodeEditor.d.ts +86 -0
  830. package/dist/types/components/ColorPicker.d.ts +14 -0
  831. package/dist/types/components/Combobox.d.ts +43 -0
  832. package/dist/types/components/CommandPalette.d.ts +35 -0
  833. package/dist/types/components/ConcentricRing.d.ts +61 -0
  834. package/dist/types/components/ConnectionCard.d.ts +64 -0
  835. package/dist/types/components/ContextItemRow.d.ts +35 -0
  836. package/dist/types/components/CopyValue.d.ts +14 -0
  837. package/dist/types/components/CountBadge.d.ts +14 -0
  838. package/dist/types/components/DateCalendar.d.ts +30 -0
  839. package/dist/types/components/DateField.d.ts +29 -0
  840. package/dist/types/components/DatePicker.d.ts +20 -0
  841. package/dist/types/components/DateTimeText.d.ts +9 -0
  842. package/dist/types/components/DescriptionList.d.ts +40 -0
  843. package/dist/types/components/Dialog.d.ts +269 -0
  844. package/dist/types/components/DragDrop.d.ts +196 -0
  845. package/dist/types/components/Drawer.d.ts +163 -0
  846. package/dist/types/components/EditGutter.d.ts +44 -0
  847. package/dist/types/components/EmojiPicker.d.ts +30 -0
  848. package/dist/types/components/ErrorBoundary.d.ts +43 -0
  849. package/dist/types/components/Field.d.ts +37 -0
  850. package/dist/types/components/FileUpload.d.ts +22 -0
  851. package/dist/types/components/FilterMenu.d.ts +120 -0
  852. package/dist/types/components/GatesSection.d.ts +79 -0
  853. package/dist/types/components/Icon.d.ts +40 -0
  854. package/dist/types/components/IconButton.d.ts +69 -0
  855. package/dist/types/components/IconStack.d.ts +28 -0
  856. package/dist/types/components/ImageUploadField.d.ts +38 -0
  857. package/dist/types/components/InlineEdit.d.ts +183 -0
  858. package/dist/types/components/InlineMarkdownEdit.d.ts +100 -0
  859. package/dist/types/components/Input.d.ts +128 -0
  860. package/dist/types/components/LegalDocument.d.ts +23 -0
  861. package/dist/types/components/LineDiff.d.ts +53 -0
  862. package/dist/types/components/ListHeader.d.ts +45 -0
  863. package/dist/types/components/Loading.d.ts +131 -0
  864. package/dist/types/components/Markdown.d.ts +35 -0
  865. package/dist/types/components/MarkdownEditor.d.ts +129 -0
  866. package/dist/types/components/Menu.d.ts +157 -0
  867. package/dist/types/components/Navigation.d.ts +67 -0
  868. package/dist/types/components/NumberInput.d.ts +177 -0
  869. package/dist/types/components/OTPInput.d.ts +13 -0
  870. package/dist/types/components/OrderedEntityManager.d.ts +64 -0
  871. package/dist/types/components/PagedWindowList.d.ts +23 -0
  872. package/dist/types/components/PaginationBar.d.ts +31 -0
  873. package/dist/types/components/Panel.d.ts +94 -0
  874. package/dist/types/components/PasswordInput.d.ts +7 -0
  875. package/dist/types/components/PasswordRequirements.d.ts +11 -0
  876. package/dist/types/components/PatchDiff.d.ts +38 -0
  877. package/dist/types/components/PendingVeil.d.ts +8 -0
  878. package/dist/types/components/Popover.d.ts +231 -0
  879. package/dist/types/components/Progress.d.ts +580 -0
  880. package/dist/types/components/RatingScale.d.ts +30 -0
  881. package/dist/types/components/ReadMore.d.ts +26 -0
  882. package/dist/types/components/RecordCard.d.ts +413 -0
  883. package/dist/types/components/RelativeTime.d.ts +17 -0
  884. package/dist/types/components/SandboxedFrame.d.ts +37 -0
  885. package/dist/types/components/SearchInput.d.ts +6 -0
  886. package/dist/types/components/SecretField.d.ts +90 -0
  887. package/dist/types/components/SectionNav.d.ts +15 -0
  888. package/dist/types/components/Select.d.ts +53 -0
  889. package/dist/types/components/SequenceDiagram.d.ts +15 -0
  890. package/dist/types/components/SettingRow.d.ts +144 -0
  891. package/dist/types/components/SignOffRings.d.ts +29 -0
  892. package/dist/types/components/Slider.d.ts +255 -0
  893. package/dist/types/components/SolutionChoice.d.ts +49 -0
  894. package/dist/types/components/SortMenu.d.ts +45 -0
  895. package/dist/types/components/Spinner.d.ts +29 -0
  896. package/dist/types/components/Stat.d.ts +136 -0
  897. package/dist/types/components/StatusSelect.d.ts +93 -0
  898. package/dist/types/components/Surface.d.ts +145 -0
  899. package/dist/types/components/Table.d.ts +164 -0
  900. package/dist/types/components/Tabs.d.ts +142 -0
  901. package/dist/types/components/ThemeMenu.d.ts +56 -0
  902. package/dist/types/components/Toast.d.ts +63 -0
  903. package/dist/types/components/Toggle.d.ts +168 -0
  904. package/dist/types/components/ToggleMatrix.d.ts +51 -0
  905. package/dist/types/components/Tree.d.ts +20 -0
  906. package/dist/types/components/TriStateSwitch.d.ts +63 -0
  907. package/dist/types/components/VideoPlayer.d.ts +26 -0
  908. package/dist/types/components/auth/AcceptInvitationCard.d.ts +54 -0
  909. package/dist/types/components/auth/AuthLayout.d.ts +12 -0
  910. package/dist/types/components/auth/ForgotPasswordForm.d.ts +6 -0
  911. package/dist/types/components/auth/LoginForm.d.ts +13 -0
  912. package/dist/types/components/auth/ResetPasswordForm.d.ts +9 -0
  913. package/dist/types/components/auth/SignInProviders.d.ts +56 -0
  914. package/dist/types/components/auth/SignupCard.d.ts +62 -0
  915. package/dist/types/components/auth/TermsAcceptance.d.ts +14 -0
  916. package/dist/types/components/auth/index.d.ts +8 -0
  917. package/dist/types/components/board/context.d.ts +65 -0
  918. package/dist/types/components/board/recipe.d.ts +97 -0
  919. package/dist/types/components/calendar/CalendarMonth.d.ts +32 -0
  920. package/dist/types/components/calendar/CalendarTimeGrid.d.ts +74 -0
  921. package/dist/types/components/calendar/EventActions.d.ts +16 -0
  922. package/dist/types/components/calendar/format.d.ts +42 -0
  923. package/dist/types/components/calendar/palette.d.ts +17 -0
  924. package/dist/types/components/calendar/use-calendar-drag.d.ts +53 -0
  925. package/dist/types/components/calendar/use-event-keyboard.d.ts +23 -0
  926. package/dist/types/components/calendar/use-grid-navigation.d.ts +47 -0
  927. package/dist/types/components/calendar/use-now.d.ts +20 -0
  928. package/dist/types/components/card-face/AcRingGlyph.d.ts +20 -0
  929. package/dist/types/components/card-face/BoardCardAgentSlot.d.ts +19 -0
  930. package/dist/types/components/card-face/CardFace.d.ts +106 -0
  931. package/dist/types/components/card-face/CardTypeBadge.d.ts +21 -0
  932. package/dist/types/components/card-face/EffortBadge.d.ts +9 -0
  933. package/dist/types/components/card-face/GateRingGlyph.d.ts +22 -0
  934. package/dist/types/components/card-face/OverflowRow.d.ts +40 -0
  935. package/dist/types/components/card-face/TapTip.d.ts +15 -0
  936. package/dist/types/components/card-face/hit-area.d.ts +20 -0
  937. package/dist/types/components/card-face/vocabulary.d.ts +83 -0
  938. package/dist/types/components/chart/BarList.d.ts +27 -0
  939. package/dist/types/components/chart/LineChart.d.ts +64 -0
  940. package/dist/types/components/chart/ShareBar.d.ts +26 -0
  941. package/dist/types/components/chart/TimeSeriesChart.d.ts +60 -0
  942. package/dist/types/components/chart/label-metrics.d.ts +9 -0
  943. package/dist/types/components/chart/line-chart-axis.d.ts +14 -0
  944. package/dist/types/components/chart/line-chart-scale.d.ts +55 -0
  945. package/dist/types/components/chart/line-series-style.d.ts +14 -0
  946. package/dist/types/components/chart/share-bar-labels.d.ts +17 -0
  947. package/dist/types/components/chart/shared.d.ts +122 -0
  948. package/dist/types/components/chart/time-series-scale.d.ts +29 -0
  949. package/dist/types/components/chat/Attachment.d.ts +125 -0
  950. package/dist/types/components/chat/Chat.d.ts +60 -0
  951. package/dist/types/components/chat/Composer.d.ts +62 -0
  952. package/dist/types/components/chat/ContextMeter.d.ts +45 -0
  953. package/dist/types/components/chat/EffortControl.d.ts +23 -0
  954. package/dist/types/components/chat/FileCover.d.ts +14 -0
  955. package/dist/types/components/chat/Message.d.ts +66 -0
  956. package/dist/types/components/chat/MessageScroller.d.ts +18 -0
  957. package/dist/types/components/chat/ModelSelector.d.ts +44 -0
  958. package/dist/types/components/chat/StreamingMarkdown.d.ts +11 -0
  959. package/dist/types/components/chat/download-file.d.ts +7 -0
  960. package/dist/types/components/chat/file-icon.d.ts +29 -0
  961. package/dist/types/components/chat/types.d.ts +165 -0
  962. package/dist/types/components/checklist/StatusChecklist.d.ts +37 -0
  963. package/dist/types/components/checklist/index.d.ts +3 -0
  964. package/dist/types/components/checklist/tally.d.ts +19 -0
  965. package/dist/types/components/checklist/types.d.ts +28 -0
  966. package/dist/types/components/code-editor/context.d.ts +32 -0
  967. package/dist/types/components/code-editor/editing.d.ts +39 -0
  968. package/dist/types/components/code-editor/highlight.d.ts +20 -0
  969. package/dist/types/components/code-editor/recipe.d.ts +109 -0
  970. package/dist/types/components/date-timeline/DateTimeline.d.ts +99 -0
  971. package/dist/types/components/date-timeline/TimelineRow.d.ts +22 -0
  972. package/dist/types/components/date-timeline/useBarDrag.d.ts +15 -0
  973. package/dist/types/components/date-timeline/useMarkerDrag.d.ts +14 -0
  974. package/dist/types/components/date-timeline/useTimelineZoom.d.ts +23 -0
  975. package/dist/types/components/drag-drop/context.d.ts +85 -0
  976. package/dist/types/components/drag-drop/recipe.d.ts +163 -0
  977. package/dist/types/components/drag-drop/shift.d.ts +153 -0
  978. package/dist/types/components/edit/activation.d.ts +21 -0
  979. package/dist/types/components/edit/outcome.d.ts +29 -0
  980. package/dist/types/components/edit/use-edit-session.d.ts +77 -0
  981. package/dist/types/components/file-viewer/FileViewer.d.ts +2 -0
  982. package/dist/types/components/file-viewer/PageNumberJumpField.d.ts +9 -0
  983. package/dist/types/components/file-viewer/ViewerControls.d.ts +20 -0
  984. package/dist/types/components/file-viewer/ViewerRail.d.ts +10 -0
  985. package/dist/types/components/file-viewer/ViewerStage.d.ts +22 -0
  986. package/dist/types/components/file-viewer/frames.d.ts +28 -0
  987. package/dist/types/components/file-viewer/index.d.ts +3 -0
  988. package/dist/types/components/file-viewer/types.d.ts +70 -0
  989. package/dist/types/components/file-viewer/use-frame-cursor.d.ts +13 -0
  990. package/dist/types/components/file-viewer/use-viewer-keys.d.ts +24 -0
  991. package/dist/types/components/file-viewer/use-viewer-zoom.d.ts +29 -0
  992. package/dist/types/components/focus-web/FocusWeb.d.ts +3 -0
  993. package/dist/types/components/focus-web/index.d.ts +4 -0
  994. package/dist/types/components/focus-web/layout.d.ts +55 -0
  995. package/dist/types/components/focus-web/types.d.ts +131 -0
  996. package/dist/types/components/graph-explorer/GraphExplorer.d.ts +42 -0
  997. package/dist/types/components/graph-explorer/camera-math.d.ts +119 -0
  998. package/dist/types/components/graph-explorer/index.d.ts +5 -0
  999. package/dist/types/components/graph-explorer/tree-layout.d.ts +67 -0
  1000. package/dist/types/components/graph-explorer/types.d.ts +62 -0
  1001. package/dist/types/components/graph-explorer/use-camera.d.ts +81 -0
  1002. package/dist/types/components/graph-explorer/viewport-gesture.d.ts +32 -0
  1003. package/dist/types/components/kanban/KanbanBoard.d.ts +72 -0
  1004. package/dist/types/components/kanban/recipe.d.ts +73 -0
  1005. package/dist/types/components/kanban/types.d.ts +55 -0
  1006. package/dist/types/components/markdown/Affordances.d.ts +105 -0
  1007. package/dist/types/components/markdown/AttachmentStrip.d.ts +25 -0
  1008. package/dist/types/components/markdown/ImageUpload.d.ts +56 -0
  1009. package/dist/types/components/media-error.d.ts +11 -0
  1010. package/dist/types/components/nav-sections.d.ts +10 -0
  1011. package/dist/types/components/node-canvas/NodeCanvas.d.ts +66 -0
  1012. package/dist/types/components/node-canvas/index.d.ts +3 -0
  1013. package/dist/types/components/node-canvas/layout.d.ts +29 -0
  1014. package/dist/types/components/node-canvas/types.d.ts +207 -0
  1015. package/dist/types/components/node-canvas/use-canvas-gestures.d.ts +39 -0
  1016. package/dist/types/components/openapi/OpenApiViewer.d.ts +14 -0
  1017. package/dist/types/components/openapi/OperationCard.d.ts +33 -0
  1018. package/dist/types/components/openapi/SchemaView.d.ts +14 -0
  1019. package/dist/types/components/openapi/index.d.ts +6 -0
  1020. package/dist/types/components/openapi/resolve.d.ts +72 -0
  1021. package/dist/types/components/openapi/types.d.ts +128 -0
  1022. package/dist/types/components/overlay-shell.d.ts +48 -0
  1023. package/dist/types/components/overlay-stack.d.ts +18 -0
  1024. package/dist/types/components/paged-window/PageBlock.d.ts +31 -0
  1025. package/dist/types/components/provenance/ConfidenceBar.d.ts +118 -0
  1026. package/dist/types/components/provenance/ConfidenceMeter.d.ts +21 -0
  1027. package/dist/types/components/provenance/ConfidenceReadout.d.ts +17 -0
  1028. package/dist/types/components/provenance/ProvenanceBadge.d.ts +23 -0
  1029. package/dist/types/components/provenance/ProvenanceDetail.d.ts +109 -0
  1030. package/dist/types/components/provenance/ProvenanceDisclosure.d.ts +107 -0
  1031. package/dist/types/components/provenance/absence.d.ts +37 -0
  1032. package/dist/types/components/provenance/index.d.ts +7 -0
  1033. package/dist/types/components/provenance/types.d.ts +137 -0
  1034. package/dist/types/components/rbac/AccessRequestPanel.d.ts +92 -0
  1035. package/dist/types/components/rbac/AccountMenu.d.ts +46 -0
  1036. package/dist/types/components/rbac/AgentKeysList.d.ts +22 -0
  1037. package/dist/types/components/rbac/ApiKeysPanel.d.ts +26 -0
  1038. package/dist/types/components/rbac/ApiKeysTable.d.ts +65 -0
  1039. package/dist/types/components/rbac/Brand.d.ts +8 -0
  1040. package/dist/types/components/rbac/Can.d.ts +19 -0
  1041. package/dist/types/components/rbac/ChangePasswordForm.d.ts +18 -0
  1042. package/dist/types/components/rbac/DangerZone.d.ts +8 -0
  1043. package/dist/types/components/rbac/DevToolsPopover.d.ts +36 -0
  1044. package/dist/types/components/rbac/EndedLine.d.ts +21 -0
  1045. package/dist/types/components/rbac/InvitationsList.d.ts +39 -0
  1046. package/dist/types/components/rbac/InviteMembersDialog.d.ts +21 -0
  1047. package/dist/types/components/rbac/MembersPanel.d.ts +31 -0
  1048. package/dist/types/components/rbac/PermissionRequestPanel.d.ts +36 -0
  1049. package/dist/types/components/rbac/ProfileForm.d.ts +27 -0
  1050. package/dist/types/components/rbac/ProfilePage.d.ts +16 -0
  1051. package/dist/types/components/rbac/RBACProvider.d.ts +69 -0
  1052. package/dist/types/components/rbac/RoleEditorDialog.d.ts +28 -0
  1053. package/dist/types/components/rbac/RoleKeyPicker.d.ts +24 -0
  1054. package/dist/types/components/rbac/RolePermissionMatrix.d.ts +21 -0
  1055. package/dist/types/components/rbac/RolesPermissionsPage.d.ts +24 -0
  1056. package/dist/types/components/rbac/SessionsList.d.ts +35 -0
  1057. package/dist/types/components/rbac/TeamSettingsForm.d.ts +22 -0
  1058. package/dist/types/components/rbac/TeamSwitcher.d.ts +5 -0
  1059. package/dist/types/components/rbac/approvalPanelParts.d.ts +69 -0
  1060. package/dist/types/components/rbac/index.d.ts +25 -0
  1061. package/dist/types/components/rbac/permissionSections.d.ts +8 -0
  1062. package/dist/types/components/rbac/stagedForm.d.ts +25 -0
  1063. package/dist/types/components/rbac/types.d.ts +65 -0
  1064. package/dist/types/components/rbac/useStagedImage.d.ts +15 -0
  1065. package/dist/types/components/roadmap/PhaseManager.d.ts +19 -0
  1066. package/dist/types/components/roadmap/RoadmapItemCard.d.ts +51 -0
  1067. package/dist/types/components/roadmap/RoadmapPage.d.ts +12 -0
  1068. package/dist/types/components/roadmap/RoadmapSwimlaneBoard.d.ts +15 -0
  1069. package/dist/types/components/roadmap/TrackManager.d.ts +19 -0
  1070. package/dist/types/components/roadmap/UseCaseCard.d.ts +30 -0
  1071. package/dist/types/components/roadmap/UseCaseLedgerPage.d.ts +29 -0
  1072. package/dist/types/components/roadmap/chip-tones.d.ts +2 -0
  1073. package/dist/types/components/roadmap/derive.d.ts +39 -0
  1074. package/dist/types/components/roadmap/index.d.ts +10 -0
  1075. package/dist/types/components/roadmap/types.d.ts +86 -0
  1076. package/dist/types/components/stepper/Stepper.d.ts +79 -0
  1077. package/dist/types/components/stepper/derive.d.ts +49 -0
  1078. package/dist/types/components/stepper/index.d.ts +3 -0
  1079. package/dist/types/components/stepper/types.d.ts +118 -0
  1080. package/dist/types/icons/data.d.ts +2054 -0
  1081. package/dist/types/index.d.ts +209 -0
  1082. package/dist/types/lib/attention.d.ts +62 -0
  1083. package/dist/types/lib/board/anchor.d.ts +69 -0
  1084. package/dist/types/lib/board/index.d.ts +17 -0
  1085. package/dist/types/lib/board/model.d.ts +43 -0
  1086. package/dist/types/lib/board/move.d.ts +181 -0
  1087. package/dist/types/lib/board/position.d.ts +22 -0
  1088. package/dist/types/lib/board/rejection.d.ts +8 -0
  1089. package/dist/types/lib/board/types.d.ts +294 -0
  1090. package/dist/types/lib/board/use-board.d.ts +47 -0
  1091. package/dist/types/lib/calendar/band-packer.d.ts +53 -0
  1092. package/dist/types/lib/calendar/drag.d.ts +125 -0
  1093. package/dist/types/lib/calendar/index.d.ts +4 -0
  1094. package/dist/types/lib/calendar/lane-packer.d.ts +88 -0
  1095. package/dist/types/lib/calendar/segments.d.ts +91 -0
  1096. package/dist/types/lib/calendar/types.d.ts +166 -0
  1097. package/dist/types/lib/chart-palette.d.ts +14 -0
  1098. package/dist/types/lib/clipboard.d.ts +12 -0
  1099. package/dist/types/lib/cn.d.ts +7 -0
  1100. package/dist/types/lib/color.d.ts +14 -0
  1101. package/dist/types/lib/component-guidance.d.ts +15 -0
  1102. package/dist/types/lib/confidence.d.ts +28 -0
  1103. package/dist/types/lib/date-timeline/scale.d.ts +143 -0
  1104. package/dist/types/lib/design-frame/document.d.ts +39 -0
  1105. package/dist/types/lib/design-frame/mini-app-script.d.ts +29 -0
  1106. package/dist/types/lib/design-frame/mini-app.d.ts +17 -0
  1107. package/dist/types/lib/design-frame/protocol.d.ts +78 -0
  1108. package/dist/types/lib/dev-warn.d.ts +10 -0
  1109. package/dist/types/lib/dnd/announce.d.ts +124 -0
  1110. package/dist/types/lib/dnd/autoscroll.d.ts +88 -0
  1111. package/dist/types/lib/dnd/cross-drop.d.ts +18 -0
  1112. package/dist/types/lib/dnd/geometry.d.ts +126 -0
  1113. package/dist/types/lib/dnd/index.d.ts +17 -0
  1114. package/dist/types/lib/dnd/sensors/gesture.d.ts +37 -0
  1115. package/dist/types/lib/dnd/sensors/keyboard.d.ts +54 -0
  1116. package/dist/types/lib/dnd/sensors/pointer.d.ts +59 -0
  1117. package/dist/types/lib/dnd/session.d.ts +124 -0
  1118. package/dist/types/lib/dnd/types.d.ts +226 -0
  1119. package/dist/types/lib/dnd/use-drag.d.ts +82 -0
  1120. package/dist/types/lib/dom/scroll-ancestor.d.ts +15 -0
  1121. package/dist/types/lib/format.d.ts +33 -0
  1122. package/dist/types/lib/group-in-order.d.ts +13 -0
  1123. package/dist/types/lib/header-fold.d.ts +10 -0
  1124. package/dist/types/lib/i18n/areas/auth-provenance-flows.d.ts +287 -0
  1125. package/dist/types/lib/i18n/areas/board.d.ts +51 -0
  1126. package/dist/types/lib/i18n/areas/card-face.d.ts +8 -0
  1127. package/dist/types/lib/i18n/areas/chat-chart.d.ts +202 -0
  1128. package/dist/types/lib/i18n/areas/code-editor.d.ts +40 -0
  1129. package/dist/types/lib/i18n/areas/date-timeline.d.ts +36 -0
  1130. package/dist/types/lib/i18n/areas/dates.d.ts +103 -0
  1131. package/dist/types/lib/i18n/areas/docs-views.d.ts +297 -0
  1132. package/dist/types/lib/i18n/areas/feedback.d.ts +132 -0
  1133. package/dist/types/lib/i18n/areas/formats.d.ts +30 -0
  1134. package/dist/types/lib/i18n/areas/forms.d.ts +182 -0
  1135. package/dist/types/lib/i18n/areas/keys.d.ts +15 -0
  1136. package/dist/types/lib/i18n/areas/markdown.d.ts +150 -0
  1137. package/dist/types/lib/i18n/areas/move-rejected.d.ts +16 -0
  1138. package/dist/types/lib/i18n/areas/navigation.d.ts +185 -0
  1139. package/dist/types/lib/i18n/areas/rbac.d.ts +635 -0
  1140. package/dist/types/lib/i18n/emphasis.d.ts +3 -0
  1141. package/dist/types/lib/i18n/index.d.ts +10 -0
  1142. package/dist/types/lib/i18n/number-format.d.ts +5 -0
  1143. package/dist/types/lib/i18n/plural.d.ts +7 -0
  1144. package/dist/types/lib/i18n/provider.d.ts +16 -0
  1145. package/dist/types/lib/i18n/strings.d.ts +18 -0
  1146. package/dist/types/lib/icons.d.ts +22 -0
  1147. package/dist/types/lib/interactive-target.d.ts +3 -0
  1148. package/dist/types/lib/intl-cache.d.ts +31 -0
  1149. package/dist/types/lib/legal-document.d.ts +82 -0
  1150. package/dist/types/lib/line-diff-model.d.ts +39 -0
  1151. package/dist/types/lib/markdown/attachments.d.ts +50 -0
  1152. package/dist/types/lib/markdown/caret-map.d.ts +69 -0
  1153. package/dist/types/lib/markdown/caret.d.ts +6 -0
  1154. package/dist/types/lib/markdown/commands.d.ts +186 -0
  1155. package/dist/types/lib/markdown/convert.d.ts +99 -0
  1156. package/dist/types/lib/markdown/dom.d.ts +30 -0
  1157. package/dist/types/lib/markdown/edit.d.ts +16 -0
  1158. package/dist/types/lib/markdown/history.d.ts +59 -0
  1159. package/dist/types/lib/markdown/hotkeys.d.ts +63 -0
  1160. package/dist/types/lib/markdown/image-pipeline.d.ts +173 -0
  1161. package/dist/types/lib/markdown/images.d.ts +138 -0
  1162. package/dist/types/lib/markdown/input.d.ts +38 -0
  1163. package/dist/types/lib/markdown/keys.d.ts +34 -0
  1164. package/dist/types/lib/markdown/paste.d.ts +9 -0
  1165. package/dist/types/lib/markdown/position.d.ts +43 -0
  1166. package/dist/types/lib/markdown/project.d.ts +88 -0
  1167. package/dist/types/lib/markdown/reconcile.d.ts +63 -0
  1168. package/dist/types/lib/markdown/surface.d.ts +236 -0
  1169. package/dist/types/lib/motion.d.ts +30 -0
  1170. package/dist/types/lib/pad.d.ts +6 -0
  1171. package/dist/types/lib/paged-window/index.d.ts +2 -0
  1172. package/dist/types/lib/paged-window/layout.d.ts +21 -0
  1173. package/dist/types/lib/paged-window/list-owner.d.ts +12 -0
  1174. package/dist/types/lib/paged-window/records-binding.d.ts +102 -0
  1175. package/dist/types/lib/paged-window/store.d.ts +307 -0
  1176. package/dist/types/lib/paged-window/use-measured-pitch.d.ts +34 -0
  1177. package/dist/types/lib/paged-window/use-page-visibility.d.ts +20 -0
  1178. package/dist/types/lib/paged-window/use-paged-window.d.ts +61 -0
  1179. package/dist/types/lib/paged-window/use-scroll-root.d.ts +18 -0
  1180. package/dist/types/lib/persist.d.ts +57 -0
  1181. package/dist/types/lib/preference-values.d.ts +72 -0
  1182. package/dist/types/lib/preferences.d.ts +26 -0
  1183. package/dist/types/lib/reads/hooks.d.ts +49 -0
  1184. package/dist/types/lib/reads/index.d.ts +5 -0
  1185. package/dist/types/lib/reads/optimistic.d.ts +119 -0
  1186. package/dist/types/lib/reads/refetch.d.ts +83 -0
  1187. package/dist/types/lib/reads/slots.d.ts +137 -0
  1188. package/dist/types/lib/reads/types.d.ts +155 -0
  1189. package/dist/types/lib/realtime/hooks.d.ts +38 -0
  1190. package/dist/types/lib/realtime/index.d.ts +4 -0
  1191. package/dist/types/lib/realtime/provider.d.ts +38 -0
  1192. package/dist/types/lib/realtime/registry.d.ts +225 -0
  1193. package/dist/types/lib/realtime/types.d.ts +242 -0
  1194. package/dist/types/lib/records/define-record-type.d.ts +29 -0
  1195. package/dist/types/lib/records/hooks.d.ts +46 -0
  1196. package/dist/types/lib/records/index.d.ts +5 -0
  1197. package/dist/types/lib/records/store.d.ts +289 -0
  1198. package/dist/types/lib/records/types.d.ts +195 -0
  1199. package/dist/types/lib/records/wire.d.ts +96 -0
  1200. package/dist/types/lib/reduced-motion-help.d.ts +23 -0
  1201. package/dist/types/lib/scroll-caret.d.ts +6 -0
  1202. package/dist/types/lib/sim/createSimStore.d.ts +18 -0
  1203. package/dist/types/lib/sim/index.d.ts +5 -0
  1204. package/dist/types/lib/sim/latency.d.ts +10 -0
  1205. package/dist/types/lib/sim/registry.d.ts +14 -0
  1206. package/dist/types/lib/sim/settings.d.ts +11 -0
  1207. package/dist/types/lib/sim/types.d.ts +3 -0
  1208. package/dist/types/lib/submit-shortcut.d.ts +24 -0
  1209. package/dist/types/lib/syntax/index.d.ts +16 -0
  1210. package/dist/types/lib/syntax/languages/bash.d.ts +1 -0
  1211. package/dist/types/lib/syntax/languages/css.d.ts +1 -0
  1212. package/dist/types/lib/syntax/languages/html.d.ts +17 -0
  1213. package/dist/types/lib/syntax/languages/index.d.ts +33 -0
  1214. package/dist/types/lib/syntax/languages/javascript.d.ts +22 -0
  1215. package/dist/types/lib/syntax/languages/json.d.ts +1 -0
  1216. package/dist/types/lib/syntax/languages/mongodb.d.ts +1 -0
  1217. package/dist/types/lib/syntax/languages/plain.d.ts +9 -0
  1218. package/dist/types/lib/syntax/languages/sql.d.ts +4 -0
  1219. package/dist/types/lib/syntax/languages/vue.d.ts +1 -0
  1220. package/dist/types/lib/syntax/languages/yaml.d.ts +1 -0
  1221. package/dist/types/lib/syntax/markdown/frames.d.ts +145 -0
  1222. package/dist/types/lib/syntax/markdown/grammar.d.ts +1 -0
  1223. package/dist/types/lib/syntax/markdown/index.d.ts +5 -0
  1224. package/dist/types/lib/syntax/markdown/inline.d.ts +21 -0
  1225. package/dist/types/lib/syntax/markdown/parse.d.ts +15 -0
  1226. package/dist/types/lib/syntax/markdown/refs.d.ts +47 -0
  1227. package/dist/types/lib/syntax/markdown/render.d.ts +25 -0
  1228. package/dist/types/lib/syntax/markdown/spans.d.ts +84 -0
  1229. package/dist/types/lib/syntax/markdown/types.d.ts +108 -0
  1230. package/dist/types/lib/syntax/registry.d.ts +37 -0
  1231. package/dist/types/lib/syntax/tokenize.d.ts +17 -0
  1232. package/dist/types/lib/syntax/types.d.ts +119 -0
  1233. package/dist/types/lib/time/index.d.ts +4 -0
  1234. package/dist/types/lib/time/instant.d.ts +2 -0
  1235. package/dist/types/lib/time/plain.d.ts +61 -0
  1236. package/dist/types/lib/time/relativeAge.d.ts +18 -0
  1237. package/dist/types/lib/time/relativeClock.d.ts +8 -0
  1238. package/dist/types/lib/time/types.d.ts +87 -0
  1239. package/dist/types/lib/time/zone.d.ts +106 -0
  1240. package/dist/types/lib/use-controllable.d.ts +14 -0
  1241. package/dist/types/lib/use-fill-height.d.ts +26 -0
  1242. package/dist/types/lib/use-hydrated.d.ts +8 -0
  1243. package/dist/types/lib/use-media-query.d.ts +29 -0
  1244. package/dist/types/lib/use-relabel-base-ui-dismiss.d.ts +6 -0
  1245. package/dist/types/lib/use-release-snap-drag.d.ts +25 -0
  1246. package/dist/types/lib/use-roving-options.d.ts +10 -0
  1247. package/dist/types/lib/values/absent.d.ts +7 -0
  1248. package/dist/types/lib/values/boolean.d.ts +29 -0
  1249. package/dist/types/lib/values/currency.d.ts +22 -0
  1250. package/dist/types/lib/values/date.d.ts +30 -0
  1251. package/dist/types/lib/values/datetime.d.ts +48 -0
  1252. package/dist/types/lib/values/index.d.ts +5 -0
  1253. package/dist/types/lib/values/locale-date.d.ts +34 -0
  1254. package/dist/types/lib/values/number.d.ts +27 -0
  1255. package/dist/types/pure.d.ts +48 -0
  1256. package/package.json +136 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-target.js","sources":["../../src/lib/interactive-target.ts"],"sourcesContent":["/* ============================================================================\n INTERACTIVE TARGET (DX-4398)\n\n A press that lands on a real control belongs to that control. A pointer\n gesture that captures the pointer anyway takes the click away from it: the\n browser retargets the matching pointerup, and the click it synthesises, at the\n CAPTOR, so the control's own `onClick` never fires and nothing throws — it just\n looks broken. Every gesture layer that owns pointer capture (the camera's\n `viewport-gesture`, the node canvas's `use-canvas-gestures`, the file viewer's\n double-click) asks this one question instead of keeping its own selector.\n ========================================================================= */\n\nexport const INTERACTIVE_SELECTOR = \"button, a, input, textarea, select, [role='button']\";\n\n/** True when `target` is, or is inside, a control. */\nexport function isInteractiveTarget(target: EventTarget | null): boolean {\n return target instanceof Element && target.closest(INTERACTIVE_SELECTOR) !== null;\n}\n"],"names":["INTERACTIVE_SELECTOR","isInteractiveTarget","target"],"mappings":"AAYO,MAAMA,IAAuB;AAG7B,SAASC,EAAoBC,GAAqC;AACvE,SAAOA,aAAkB,WAAWA,EAAO,QAAQF,CAAoB,MAAM;AAC/E;"}
@@ -0,0 +1,69 @@
1
+ const u = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
2
+ function s(r, n) {
3
+ const e = `${r}|${JSON.stringify(n)}`;
4
+ let t = u.get(e);
5
+ return t || (t = new Intl.NumberFormat(r, n), u.set(e, t)), t;
6
+ }
7
+ function y(r, n) {
8
+ const e = `${r}|${JSON.stringify(n)}`;
9
+ let t = a.get(e);
10
+ return t || (t = new Intl.DateTimeFormat(r, n), a.set(e, t)), t;
11
+ }
12
+ function d(r, n = {}) {
13
+ const e = `${r}|${JSON.stringify(n)}`;
14
+ let t = l.get(e);
15
+ return t || (t = new Intl.ListFormat(r, n), l.set(e, t)), t;
16
+ }
17
+ function F(r, n = {}) {
18
+ const e = `${r}|${JSON.stringify(n)}`;
19
+ let t = c.get(e);
20
+ return t || (t = new Intl.Collator(r, n), c.set(e, t)), t;
21
+ }
22
+ function $(r, n = {}) {
23
+ const e = `${r}|${JSON.stringify(n)}`;
24
+ let t = f.get(e);
25
+ return t || (t = new Intl.PluralRules(r, n), f.set(e, t)), t;
26
+ }
27
+ function p(r) {
28
+ const n = s(r, { useGrouping: !0, minimumFractionDigits: 1 }).formatToParts(-12345675e-1);
29
+ return {
30
+ group: n.find((e) => e.type === "group").value,
31
+ decimal: n.find((e) => e.type === "decimal").value
32
+ };
33
+ }
34
+ function w(r, n, e = []) {
35
+ const { group: t, decimal: m } = p(n);
36
+ let i = r;
37
+ for (const g of e) i = i.split(g).join("");
38
+ if (/^\s$/.test(t) ? i = i.replace(/\s/g, "") : i = i.split(t).join(""), i = i.split(m).join("."), !/^-?\d+(\.\d+)?$/.test(i)) return null;
39
+ const o = Number(i);
40
+ return Number.isFinite(o) ? o : null;
41
+ }
42
+ function N(r, n, e) {
43
+ const t = /* @__PURE__ */ new Date(0);
44
+ return t.setUTCFullYear(r, n - 1, e), t;
45
+ }
46
+ function b(r) {
47
+ const n = [];
48
+ for (let e = 0; e < 10; e++) {
49
+ const t = s(r, {}).format(e);
50
+ n.push(t);
51
+ }
52
+ return n;
53
+ }
54
+ function D(r, n, e = 0) {
55
+ return s(n, { style: "percent", maximumFractionDigits: e }).format(r / 100);
56
+ }
57
+ export {
58
+ N as asUtcDate,
59
+ F as collator,
60
+ y as dateFormat,
61
+ D as formatPercent,
62
+ d as listFormat,
63
+ b as localeDigits,
64
+ s as numberFormat,
65
+ p as numberSeparators,
66
+ w as parseLocalizedNumber,
67
+ $ as pluralRules
68
+ };
69
+ //# sourceMappingURL=intl-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intl-cache.js","sources":["../../src/lib/intl-cache.ts"],"sourcesContent":["/* ----------------------------------------------------------------------------\n DX-4740 — ONE Intl FORMATTER PER (LOCALE, OPTIONS), AND THE LOCALE FACTS THE\n PARSERS NEED.\n\n Constructing an `Intl.*Format` costs tens of microseconds and a data grid\n formats thousands of cells, so formatters are cached. The cache key carries the\n locale: a formatter built for one language is never handed to another.\n\n NOTHING HERE MAY IMPORT REACT — `@50arms/ui/pure` reaches this file.\n -------------------------------------------------------------------------- */\n\nconst numberFormats = new Map<string, Intl.NumberFormat>();\nconst dateFormats = new Map<string, Intl.DateTimeFormat>();\nconst listFormats = new Map<string, Intl.ListFormat>();\nconst collators = new Map<string, Intl.Collator>();\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\n\nexport function numberFormat(locale: string, options: Intl.NumberFormatOptions): Intl.NumberFormat {\n const key = `${locale}|${JSON.stringify(options)}`;\n let f = numberFormats.get(key);\n if (!f) {\n f = new Intl.NumberFormat(locale, options);\n numberFormats.set(key, f);\n }\n return f;\n}\n\nexport function dateFormat(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const key = `${locale}|${JSON.stringify(options)}`;\n let f = dateFormats.get(key);\n if (!f) {\n f = new Intl.DateTimeFormat(locale, options);\n dateFormats.set(key, f);\n }\n return f;\n}\n\nexport function listFormat(locale: string, options: Intl.ListFormatOptions = {}): Intl.ListFormat {\n const key = `${locale}|${JSON.stringify(options)}`;\n let f = listFormats.get(key);\n if (!f) {\n f = new Intl.ListFormat(locale, options);\n listFormats.set(key, f);\n }\n return f;\n}\n\n/** A cached `Intl.Collator`: sort names the way `locale` orders them (DX-4740), never by code point. */\nexport function collator(locale: string, options: Intl.CollatorOptions = {}): Intl.Collator {\n const key = `${locale}|${JSON.stringify(options)}`;\n let c = collators.get(key);\n if (!c) {\n c = new Intl.Collator(locale, options);\n collators.set(key, c);\n }\n return c;\n}\n\n/** A cached `Intl.PluralRules` (DX-4740): which plural category (`one`, `other`, ...) a count takes in `locale`. */\nexport function pluralRules(locale: string, options: Intl.PluralRulesOptions = {}): Intl.PluralRules {\n const key = `${locale}|${JSON.stringify(options)}`;\n let r = pluralRulesCache.get(key);\n if (!r) {\n r = new Intl.PluralRules(locale, options);\n pluralRulesCache.set(key, r);\n }\n return r;\n}\n\n/** The locale's digit-group and decimal separators (\",\" and \".\" in en-US, \".\" and \",\" in es-AR). */\nexport function numberSeparators(locale: string): { group: string; decimal: string } {\n const parts = numberFormat(locale, { useGrouping: true, minimumFractionDigits: 1 }).formatToParts(-1234567.5);\n return {\n group: parts.find((p) => p.type === \"group\")!.value,\n decimal: parts.find((p) => p.type === \"decimal\")!.value,\n };\n}\n\n/**\n * Text a person typed in `locale`'s number convention → a finite `number`, or `null`.\n * `strip` removes locale-specific decoration first (a currency symbol). Group\n * separators are dropped and the decimal separator becomes \".\", then the result\n * must be a plain signed decimal — `\"12abc\"` is a typo, not twelve.\n */\nexport function parseLocalizedNumber(text: string, locale: string, strip: readonly string[] = []): number | null {\n const { group, decimal } = numberSeparators(locale);\n let body = text;\n for (const s of strip) body = body.split(s).join(\"\");\n /* A whitespace group (fr, ru: U+202F / U+00A0) is typed as a plain space just as often. */\n if (/^\\s$/.test(group)) body = body.replace(/\\s/g, \"\");\n else body = body.split(group).join(\"\");\n body = body.split(decimal).join(\".\");\n if (!/^-?\\d+(\\.\\d+)?$/.test(body)) return null;\n const value = Number(body);\n return Number.isFinite(value) ? value : null;\n}\n\n/**\n * Create a Date from year/month/day values, treating them as UTC (not local time).\n * Used by date formatting and parsing to work in UTC consistently.\n */\nexport function asUtcDate(year: number, month: number, day: number): Date {\n const d = new Date(0);\n d.setUTCFullYear(year, month - 1, day);\n return d;\n}\n\n/**\n * The locale's digit set as an array [0, 1, 2, ..., 9], for normalizing user input\n * or parsing output of locale-specific formatters.\n */\nexport function localeDigits(locale: string): string[] {\n const digits: string[] = [];\n for (let i = 0; i < 10; i++) {\n const s = numberFormat(locale, {}).format(i);\n digits.push(s);\n }\n return digits;\n}\n\n/** A percentage as the locale writes it. `percent` is on the 0-100 scale; it is rounded to `digits` decimals. */\nexport function formatPercent(percent: number, locale: string, digits = 0): string {\n return numberFormat(locale, { style: \"percent\", maximumFractionDigits: digits }).format(percent / 100);\n}\n"],"names":["numberFormats","dateFormats","listFormats","collators","pluralRulesCache","numberFormat","locale","options","key","f","dateFormat","listFormat","collator","c","pluralRules","r","numberSeparators","parts","p","parseLocalizedNumber","text","strip","group","decimal","body","s","value","asUtcDate","year","month","day","d","localeDigits","digits","i","formatPercent","percent"],"mappings":"AAWA,MAAMA,wBAAoB,IAAA,GACpBC,wBAAkB,IAAA,GAClBC,wBAAkB,IAAA,GAClBC,wBAAgB,IAAA,GAChBC,wBAAuB,IAAA;AAEtB,SAASC,EAAaC,GAAgBC,GAAsD;AACjG,QAAMC,IAAM,GAAGF,CAAM,IAAI,KAAK,UAAUC,CAAO,CAAC;AAChD,MAAIE,IAAIT,EAAc,IAAIQ,CAAG;AAC7B,SAAKC,MACHA,IAAI,IAAI,KAAK,aAAaH,GAAQC,CAAO,GACzCP,EAAc,IAAIQ,GAAKC,CAAC,IAEnBA;AACT;AAEO,SAASC,EAAWJ,GAAgBC,GAA0D;AACnG,QAAMC,IAAM,GAAGF,CAAM,IAAI,KAAK,UAAUC,CAAO,CAAC;AAChD,MAAIE,IAAIR,EAAY,IAAIO,CAAG;AAC3B,SAAKC,MACHA,IAAI,IAAI,KAAK,eAAeH,GAAQC,CAAO,GAC3CN,EAAY,IAAIO,GAAKC,CAAC,IAEjBA;AACT;AAEO,SAASE,EAAWL,GAAgBC,IAAkC,IAAqB;AAChG,QAAMC,IAAM,GAAGF,CAAM,IAAI,KAAK,UAAUC,CAAO,CAAC;AAChD,MAAIE,IAAIP,EAAY,IAAIM,CAAG;AAC3B,SAAKC,MACHA,IAAI,IAAI,KAAK,WAAWH,GAAQC,CAAO,GACvCL,EAAY,IAAIM,GAAKC,CAAC,IAEjBA;AACT;AAGO,SAASG,EAASN,GAAgBC,IAAgC,IAAmB;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,CAAK,IAAIA,IAAQ;AAC1C;AAMO,SAASC,EAAUC,GAAcC,GAAeC,GAAmB;AACxE,QAAMC,IAAI,oBAAI,KAAK,CAAC;AACpB,SAAAA,EAAE,eAAeH,GAAMC,IAAQ,GAAGC,CAAG,GAC9BC;AACT;AAMO,SAASC,EAAa1B,GAA0B;AACrD,QAAM2B,IAAmB,CAAA;AACzB,WAASC,IAAI,GAAGA,IAAI,IAAIA,KAAK;AAC3B,UAAMT,IAAIpB,EAAaC,GAAQ,CAAA,CAAE,EAAE,OAAO4B,CAAC;AAC3C,IAAAD,EAAO,KAAKR,CAAC;AAAA,EACf;AACA,SAAOQ;AACT;AAGO,SAASE,EAAcC,GAAiB9B,GAAgB2B,IAAS,GAAW;AACjF,SAAO5B,EAAaC,GAAQ,EAAE,OAAO,WAAW,uBAAuB2B,GAAQ,EAAE,OAAOG,IAAU,GAAG;AACvG;"}
@@ -0,0 +1,37 @@
1
+ function l(e) {
2
+ return `section-${e.replace(/\./g, "-")}`;
3
+ }
4
+ function i(e) {
5
+ const n = [];
6
+ let t = 0;
7
+ for (const r of e.matchAll(/\[[^\]]+\]/g))
8
+ r.index > t && n.push({ text: e.slice(t, r.index), unconfirmed: !1 }), n.push({ text: r[0], unconfirmed: !0 }), t = r.index + r[0].length;
9
+ return t < e.length && n.push({ text: e.slice(t), unconfirmed: !1 }), n;
10
+ }
11
+ function c(e) {
12
+ return [
13
+ e.effectiveDate,
14
+ e.version,
15
+ ...e.sections.flatMap(
16
+ (n) => n.blocks.flatMap((t) => t.kind === "list" ? t.items : [t.text])
17
+ )
18
+ ];
19
+ }
20
+ function o(e) {
21
+ return c(e).reduce(
22
+ (n, t) => n + i(t).filter((r) => r.unconfirmed).length,
23
+ 0
24
+ );
25
+ }
26
+ const s = 40;
27
+ function f(e) {
28
+ const n = e.replace(/[^A-Za-z]/g, "");
29
+ return n.length >= s && n === n.toUpperCase();
30
+ }
31
+ export {
32
+ o as countUnconfirmed,
33
+ f as isAllCaps,
34
+ l as legalSectionAnchor,
35
+ i as splitUnconfirmed
36
+ };
37
+ //# sourceMappingURL=legal-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-document.js","sources":["../../src/lib/legal-document.ts"],"sourcesContent":["/**\n * A legal document as DATA, plus the four pure decisions the `LegalDocument`\n * component makes about it. DX-4022.\n *\n * No React in this file on purpose: the `LegalDocumentValue` shape is what a\n * server holds and serves, so the `./pure` entry re-exports the types and a\n * back end can type its content module without importing the design system's\n * component graph.\n *\n * The shape mirrors a legal text and adds nothing to it: a title block,\n * numbered sections, and in each section the paragraphs and bullet lists in\n * document order. A paragraph that opens a numbered clause (\"4.2 Beta\n * confidentiality. ...\") carries that opening as `clause`, split off only so\n * a renderer can set it as a run-in heading and give it an anchor;\n * `${number} ${heading} ${text}` is the paragraph as written. Nothing in the\n * component writes a word of the document, which is what lets a verbatim check\n * compare the page against its source and expect an exact match.\n */\n\nexport interface LegalDocumentValue {\n /** The document's own title line, e.g. \"TERMS OF USE\". */\n title: string;\n /** The company line under the title. */\n issuer: string;\n /** As written in the document, so it may still be an unfilled `[DATE]`. */\n effectiveDate: string;\n /** Which version of the text this is, as an acceptance would record it. */\n version: string;\n sections: readonly LegalSection[];\n}\n\nexport interface LegalSection {\n /** \"1\", \"2\", ... the number the document gives the section, and what \"Section N\" cites. */\n number: string;\n title: string;\n blocks: readonly LegalBlock[];\n}\n\nexport type LegalBlock =\n | {\n kind: \"paragraph\";\n /** A numbered clause's opening words, when the paragraph starts one. */\n clause?: { number: string; heading: string };\n text: string;\n }\n | { kind: \"list\"; items: readonly string[] };\n\n/**\n * The fragment a section or clause is linked by: \"7\" is `section-7`, \"7.2\" is\n * `section-7-2`.\n *\n * Keyed on the NUMBER, never the title: \"Section 7\" is how a document cites\n * itself (and how a lawyer cites it in an email), so a link survives a heading\n * being reworded in a later version.\n */\nexport function legalSectionAnchor(number: string): string {\n return `section-${number.replace(/\\./g, \"-\")}`;\n}\n\n/** One run of a paragraph: plain text, or a value the document left unfilled. */\nexport interface LegalTextRun {\n text: string;\n unconfirmed: boolean;\n}\n\n/**\n * Split text into plain runs and square-bracketed placeholder runs.\n *\n * A draft marks every value it has not settled (a date, a notice period, a\n * dollar cap) by writing it in square brackets. Those spans are kept verbatim,\n * brackets included; this only finds them so they can be SHOWN as unconfirmed\n * rather than read as agreed terms. Concatenating the runs' text always gives\n * back the input unchanged.\n */\nexport function splitUnconfirmed(text: string): LegalTextRun[] {\n const runs: LegalTextRun[] = [];\n let cursor = 0;\n for (const match of text.matchAll(/\\[[^\\]]+\\]/g)) {\n if (match.index > cursor) runs.push({ text: text.slice(cursor, match.index), unconfirmed: false });\n runs.push({ text: match[0], unconfirmed: true });\n cursor = match.index + match[0].length;\n }\n if (cursor < text.length) runs.push({ text: text.slice(cursor), unconfirmed: false });\n return runs;\n}\n\n/** Every string the renderer sets through its placeholder-flagging text (the header values and the body), in reading order. */\nfunction allText(document: LegalDocumentValue): string[] {\n return [\n document.effectiveDate,\n document.version,\n ...document.sections.flatMap((section) =>\n section.blocks.flatMap((block) => (block.kind === \"list\" ? block.items : [block.text])),\n ),\n ];\n}\n\n/** How many placeholder values a document still carries. */\nexport function countUnconfirmed(document: LegalDocumentValue): number {\n return allText(document).reduce(\n (total, text) => total + splitUnconfirmed(text).filter((run) => run.unconfirmed).length,\n 0,\n );\n}\n\n/** Fewer letters than this is a heading or a name, not a paragraph set in capitals. */\nconst MIN_CAPS_LETTERS = 40;\n\n/**\n * Whether a run of text is written in capitals throughout.\n *\n * Disclaimers and liability limits are set in capitals on purpose (that is what\n * makes them conspicuous in the legal sense), so the renderer keeps every\n * letter as written and makes the block easier to read instead: a rule beside\n * it, looser tracking. A short all-caps fragment is not a paragraph of it.\n */\nexport function isAllCaps(text: string): boolean {\n const letters = text.replace(/[^A-Za-z]/g, \"\");\n return letters.length >= MIN_CAPS_LETTERS && letters === letters.toUpperCase();\n}\n"],"names":["legalSectionAnchor","number","splitUnconfirmed","text","runs","cursor","match","allText","document","section","block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 0 ? [] : t.split(`
2
+ `);
3
+ function w(t, n) {
4
+ const a = t.length, u = n.length, d = Array.from({ length: a + 1 }, () => new Array(u + 1).fill(0));
5
+ for (let i = a - 1; i >= 0; i--)
6
+ for (let p = u - 1; p >= 0; p--)
7
+ d[i][p] = t[i] === n[p] ? d[i + 1][p + 1] + 1 : Math.max(d[i + 1][p], d[i][p + 1]);
8
+ const o = [];
9
+ let e = 0, s = 0;
10
+ for (; e < a && s < u; )
11
+ t[e] === n[s] ? (o.push({ kind: "unchanged", text: t[e] }), e++, s++) : d[e + 1][s] >= d[e][s + 1] ? (o.push({ kind: "removed", text: t[e] }), e++) : (o.push({ kind: "added", text: n[s] }), s++);
12
+ for (; e < a; e++) o.push({ kind: "removed", text: t[e] });
13
+ for (; s < u; s++) o.push({ kind: "added", text: n[s] });
14
+ return o;
15
+ }
16
+ function E(t, n) {
17
+ const a = t.map(() => !1);
18
+ t.forEach((o, e) => {
19
+ if (o.kind !== "unchanged")
20
+ for (let s = Math.max(0, e - n); s <= Math.min(t.length - 1, e + n); s++) a[s] = !0;
21
+ });
22
+ const u = [];
23
+ let d = -1;
24
+ for (let o = 0; o <= t.length; o++) {
25
+ const e = o < t.length && !a[o];
26
+ e && d < 0 && (d = o), !e && d >= 0 && (u.push({ start: d, end: o, atStart: d === 0, atEnd: o === t.length }), d = -1);
27
+ }
28
+ return u;
29
+ }
30
+ const h = { down: 0, up: 0 }, c = (t) => t.end - t.start;
31
+ function l(t, n = h) {
32
+ const a = c(t), u = t.atStart && !t.atEnd ? 0 : Math.min(n.down, a), d = t.atEnd ? 0 : Math.min(n.up, a - u);
33
+ return { top: u, bottom: d, hidden: a - u - d };
34
+ }
35
+ function g(t, n, a, u = 8) {
36
+ const { hidden: d } = l(t, n);
37
+ if (a === "all") return t.atStart && !t.atEnd ? { down: n.down, up: n.up + d } : { down: n.down + d, up: n.up };
38
+ const o = Math.min(u, d);
39
+ return a === "down" ? { down: n.down + o, up: n.up } : { down: n.down, up: n.up + o };
40
+ }
41
+ export {
42
+ r as DEFAULT_CONTEXT,
43
+ f as EXPAND_STEP,
44
+ h as NOTHING,
45
+ w as diffLines,
46
+ g as expand,
47
+ E as foldGaps,
48
+ l as gapState,
49
+ m as splitLines
50
+ };
51
+ //# sourceMappingURL=line-diff-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-diff-model.js","sources":["../../src/lib/line-diff-model.ts"],"sourcesContent":["// DXUI-38: the pure logic of LineDiff's expandable mode, ported from the approved DX-6188 review design. A diff of two texts' lines keeps its line\n// numbers, folds each unchanged run further than `context` lines from every change into a gap, and tracks how much of a gap a person has opened\n// (downward from the change above, upward from the change below, or whole). No React: LineDiff draws what this decides.\n\nexport type DiffKind = \"unchanged\" | \"added\" | \"removed\";\n\nexport interface DiffLine {\n kind: DiffKind;\n text: string;\n}\n\n/** Unchanged lines shown either side of a change when the caller names none. */\nexport const DEFAULT_CONTEXT = 2;\n/** Lines one press of an expand-up / expand-down control reveals. */\nexport const EXPAND_STEP = 8;\n\n/** `\"\".split(\"\\n\")` is `[\"\"]`: an empty string has no lines at all. */\nexport const splitLines = (text: string): string[] => (text.length === 0 ? [] : text.split(\"\\n\"));\n\n/** The line diff of `after` against `before` (LCS): a line in both once, one only in `before` removed, one only in `after` added; an edited line is its removal then its addition. */\nexport function diffLines(before: string[], after: string[]): DiffLine[] {\n const n = before.length;\n const m = after.length;\n const dp: number[][] = Array.from({ length: n + 1 }, () => new Array<number>(m + 1).fill(0));\n for (let i = n - 1; i >= 0; i--) {\n for (let j = m - 1; j >= 0; j--) {\n dp[i]![j] = before[i] === after[j] ? dp[i + 1]![j + 1]! + 1 : Math.max(dp[i + 1]![j]!, dp[i]![j + 1]!);\n }\n }\n const result: DiffLine[] = [];\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (before[i] === after[j]) {\n result.push({ kind: \"unchanged\", text: before[i]! });\n i++;\n j++;\n } else if (dp[i + 1]![j]! >= dp[i]![j + 1]!) {\n result.push({ kind: \"removed\", text: before[i]! });\n i++;\n } else {\n result.push({ kind: \"added\", text: after[j]! });\n j++;\n }\n }\n for (; i < n; i++) result.push({ kind: \"removed\", text: before[i]! });\n for (; j < m; j++) result.push({ kind: \"added\", text: after[j]! });\n return result;\n}\n\n/** A folded run of unchanged lines: rows `[start, end)` of the diff. */\nexport interface Gap {\n start: number;\n end: number;\n /** No change above it: only the lines just above the change below can be revealed. */\n atStart: boolean;\n /** No change below it: only the lines just below the change above can be revealed. */\n atEnd: boolean;\n}\n\n/** The unchanged runs further than `context` lines from every change. A diff with no change at all is one gap. */\nexport function foldGaps(lines: readonly DiffLine[], context: number): Gap[] {\n const near = lines.map(() => false);\n lines.forEach((line, i) => {\n if (line.kind === \"unchanged\") return;\n for (let k = Math.max(0, i - context); k <= Math.min(lines.length - 1, i + context); k++) near[k] = true;\n });\n const gaps: Gap[] = [];\n let start = -1;\n for (let i = 0; i <= lines.length; i++) {\n const hidden = i < lines.length && !near[i];\n if (hidden && start < 0) start = i;\n if (!hidden && start >= 0) {\n gaps.push({ start, end: i, atStart: start === 0, atEnd: i === lines.length });\n start = -1;\n }\n }\n return gaps;\n}\n\n/** What a person has opened of one gap: lines revealed just below the change above (`down`) and just above the change below (`up`). */\nexport interface Reveal {\n down: number;\n up: number;\n}\nexport const NOTHING: Reveal = { down: 0, up: 0 };\n\nconst gapSize = (g: Gap): number => g.end - g.start;\n\n/** How the gap reads now: rows revealed under the change above, rows revealed over the change below, and how many stay folded between them. */\nexport function gapState(g: Gap, r: Reveal = NOTHING): { top: number; bottom: number; hidden: number } {\n const size = gapSize(g);\n // A gap touching both edges (no change at all) opens from the top.\n const top = g.atStart && !g.atEnd ? 0 : Math.min(r.down, size);\n const bottom = g.atEnd ? 0 : Math.min(r.up, size - top);\n return { top, bottom, hidden: size - top - bottom };\n}\n\nexport type Expand = \"down\" | \"up\" | \"all\";\n\n/** The reveal after one press. \"down\" and \"up\" open `step` more lines (never past the gap); \"all\" opens the rest. */\nexport function expand(g: Gap, r: Reveal, how: Expand, step: number = EXPAND_STEP): Reveal {\n const { hidden } = gapState(g, r);\n // The rest opens toward the change the gap sits next to; a gap above the first change has nothing above it to open from (gapState ignores `down` there), so it opens upward.\n if (how === \"all\") return g.atStart && !g.atEnd ? { down: r.down, up: r.up + hidden } : { down: r.down + hidden, up: r.up };\n const by = Math.min(step, hidden);\n return how === \"down\" ? { down: r.down + by, up: r.up } : { down: r.down, up: r.up + by };\n}\n"],"names":["DEFAULT_CONTEXT","EXPAND_STEP","splitLines","text","diffLines","before","after","n","m","dp","i","j","result","foldGaps","lines","context","near","line","k","gaps","start","hidden","NOTHING","gapSize","g","gapState","r","size","top","bottom","expand","how","step","by"],"mappings":"AAYO,MAAMA,IAAkB,GAElBC,IAAc,GAGdC,IAAa,CAACC,MAA4BA,EAAK,WAAW,IAAI,CAAA,IAAKA,EAAK,MAAM;AAAA,CAAI;AAGxF,SAASC,EAAUC,GAAkBC,GAA6B;AACvE,QAAMC,IAAIF,EAAO,QACXG,IAAIF,EAAM,QACVG,IAAiB,MAAM,KAAK,EAAE,QAAQF,IAAI,EAAA,GAAK,MAAM,IAAI,MAAcC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AAC3F,WAASE,IAAIH,IAAI,GAAGG,KAAK,GAAGA;AAC1B,aAASC,IAAIH,IAAI,GAAGG,KAAK,GAAGA;AAC1B,MAAAF,EAAGC,CAAC,EAAGC,CAAC,IAAIN,EAAOK,CAAC,MAAMJ,EAAMK,CAAC,IAAIF,EAAGC,IAAI,CAAC,EAAGC,IAAI,CAAC,IAAK,IAAI,KAAK,IAAIF,EAAGC,IAAI,CAAC,EAAGC,CAAC,GAAIF,EAAGC,CAAC,EAAGC,IAAI,CAAC,CAAE;AAGzG,QAAMC,IAAqB,CAAA;AAC3B,MAAIF,IAAI,GACJC,IAAI;AACR,SAAOD,IAAIH,KAAKI,IAAIH;AAClB,IAAIH,EAAOK,CAAC,MAAMJ,EAAMK,CAAC,KACvBC,EAAO,KAAK,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AAG,IAAI,EAAA,GAExCC,IAAU,CAACC,MAAmBA,EAAE,MAAMA,EAAE;AAGvC,SAASC,EAASD,GAAQE,IAAYJ,GAA0D;AACrG,QAAMK,IAAOJ,EAAQC,CAAC,GAEhBI,IAAMJ,EAAE,WAAW,CAACA,EAAE,QAAQ,IAAI,KAAK,IAAIE,EAAE,MAAMC,CAAI,GACvDE,IAASL,EAAE,QAAQ,IAAI,KAAK,IAAIE,EAAE,IAAIC,IAAOC,CAAG;AACtD,SAAO,EAAE,KAAAA,GAAK,QAAAC,GAAQ,QAAQF,IAAOC,IAAMC,EAAA;AAC7C;AAKO,SAASC,EAAON,GAAQE,GAAWK,GAAaC,IAAe,GAAqB;AACzF,QAAM,EAAE,QAAAX,EAAA,IAAWI,EAASD,GAAGE,CAAC;AAEhC,MAAIK,MAAQ,MAAO,QAAOP,EAAE,WAAW,CAACA,EAAE,QAAQ,EAAE,MAAME,EAAE,MAAM,IAAIA,EAAE,KAAKL,EAAA,IAAW,EAAE,MAAMK,EAAE,OAAOL,GAAQ,IAAIK,EAAE,GAAA;AACvH,QAAMO,IAAK,KAAK,IAAID,GAAMX,CAAM;AAChC,SAAOU,MAAQ,SAAS,EAAE,MAAML,EAAE,OAAOO,GAAI,IAAIP,EAAE,OAAO,EAAE,MAAMA,EAAE,MAAM,IAAIA,EAAE,KAAKO,EAAA;AACvF;"}
@@ -0,0 +1,71 @@
1
+ import { escapeReferenceName as g, referenceLabel as u } from "./images.js";
2
+ import { project as l } from "./project.js";
3
+ function o(e) {
4
+ const n = [];
5
+ for (const t of e.frames) {
6
+ const r = t.frame;
7
+ r.kind === "image" ? n.push({ record: t, url: r.src, image: !0 }) : r.kind === "link" && n.push({ record: t, url: r.href, image: !1 });
8
+ }
9
+ return n.sort((t, r) => t.record.start - r.record.start);
10
+ }
11
+ function p(e, n, t) {
12
+ return e === "image" ? n.trim() !== "" : t.isFileUrl(n);
13
+ }
14
+ function f(e, n) {
15
+ return e.source.includes("[") ? o(e).filter((t) => p(t.image ? "image" : "link", t.url, n)) : [];
16
+ }
17
+ function w(e, n) {
18
+ const t = /* @__PURE__ */ new Map();
19
+ for (const r of f(e, n))
20
+ t.has(r.url) || t.set(r.url, { url: r.url, name: u(e.source, r.record.content), image: r.image });
21
+ return [...t.values()];
22
+ }
23
+ const x = /(?:^|\s)(\d+)$/;
24
+ function N(e, n) {
25
+ let t = 0;
26
+ for (const r of f(l(e), n)) {
27
+ const s = x.exec(u(e, r.record.content));
28
+ s && (t = Math.max(t, Number(s[1])));
29
+ }
30
+ return t + 1;
31
+ }
32
+ function m(e, n) {
33
+ return e.includes("[") ? o(l(e)).filter((t) => t.url === n) : [];
34
+ }
35
+ function d(e) {
36
+ return e.filter((n) => !e.some((t) => t !== n && t.start <= n.start && n.end <= t.end && (t.start < n.start || n.end < t.end)));
37
+ }
38
+ function h(e, n) {
39
+ let t = e;
40
+ for (const r of [...n].sort((s, c) => c.start - s.start)) t = t.slice(0, r.start) + r.text + t.slice(r.end);
41
+ return t;
42
+ }
43
+ function A(e, n, t) {
44
+ const r = g(t), s = m(e, n).map(({ record: c }) => {
45
+ const i = c.content[0] ?? { start: c.start + (c.frame.kind === "image" ? 2 : 1), end: c.start + (c.frame.kind === "image" ? 2 : 1) };
46
+ return { start: i.start, end: i.end, text: r };
47
+ });
48
+ return h(e, d(s));
49
+ }
50
+ function M(e, n) {
51
+ const t = d(m(e, n).map(({ record: i }) => ({ start: i.start, end: i.end }))), r = /* @__PURE__ */ new Set(), s = (i) => e[i] === " " && !r.has(i) && !t.some((a) => i >= a.start && i < a.end), c = t.map(({ start: i, end: a }) => (s(i - 1) ? (r.add(i - 1), i--) : s(a) && (r.add(a), a++), { start: i, end: a, text: "" }));
52
+ return h(e, c);
53
+ }
54
+ function v(e, n) {
55
+ if (e === n) return null;
56
+ let t = 0;
57
+ const r = Math.min(e.length, n.length);
58
+ for (; t < r && e[t] === n[t]; ) t++;
59
+ let s = 0;
60
+ for (; s < r - t && e[e.length - 1 - s] === n[n.length - 1 - s]; ) s++;
61
+ return { start: t, end: e.length - s, text: n.slice(t, n.length - s) };
62
+ }
63
+ export {
64
+ w as attachmentsOf,
65
+ v as coveringSplice,
66
+ p as isAttachmentReference,
67
+ N as nextReferenceNumber,
68
+ M as removeAttachment,
69
+ A as renameAttachment
70
+ };
71
+ //# sourceMappingURL=attachments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.js","sources":["../../../src/lib/markdown/attachments.ts"],"sourcesContent":["/* ============================================================================\n ATTACHMENTS - the pure half of \"a file in a markdown document is a named\n reference in the text and a tile under it\".\n\n DXUI-74. The text is the only record. A file the editor stores is written as\n `![Image 1](url)` (a picture) or `[PDF 2](url)` (anything else), the\n bracket text is the reference name, and the URL is the file's identity: no\n attachment table, no id. The strip under the editor is computed from the\n text on every change (`attachmentsOf`), so deleting a reference removes its\n tile and an undo brings it back with nothing to keep in step.\n\n Everything here is a function of strings, like ./images.ts: no DOM, no React.\n ========================================================================= */\n\nimport { escapeReferenceName, referenceLabel } from \"./images\";\nimport { project, type Projection } from \"./project\";\nimport type { FrameRecord } from \"../syntax/markdown/frames\";\n\n/** One file the document references: a tile in the strip. */\nexport interface AttachmentRow {\n /** The file's identity: the destination exactly as the parser reads it. */\n url: string;\n /** The reference name of its first reference in the text. */\n name: string;\n /** Whether the first reference is an image construct. */\n image: boolean;\n}\n\nexport interface AttachmentOptions {\n /** Whether a LINK's destination is a file the app stores. An image construct always counts; a typed link only through this. */\n isFileUrl: (url: string) => boolean;\n}\n\n/** A link or image construct and where it points. */\ninterface Reference {\n record: FrameRecord;\n url: string;\n image: boolean;\n}\n\nfunction referencesOf(projection: Projection): Reference[] {\n const found: Reference[] = [];\n for (const record of projection.frames) {\n const frame = record.frame;\n if (frame.kind === \"image\") found.push({ record, url: frame.src, image: true });\n else if (frame.kind === \"link\") found.push({ record, url: frame.href, image: false });\n }\n return found.sort((a, b) => a.record.start - b.record.start);\n}\n\n/**\n * Whether a construct is an attachment reference: an image with a destination, or a link `isFileUrl` accepts. The ONE\n * definition: the strip, the numbering and the construct bar (which never opens over a reference) all use it.\n */\nexport function isAttachmentReference(kind: \"image\" | \"link\", url: string, options: AttachmentOptions): boolean {\n /* An image construct always counts, except one with no destination at all: `![]()` names no file. */\n return kind === \"image\" ? url.trim() !== \"\" : options.isFileUrl(url);\n}\n\n/** The attachment references of a parsed document: every image, and every link `isFileUrl` accepts. */\nfunction attachmentReferences(projection: Projection, options: AttachmentOptions): Reference[] {\n /* The overwhelmingly common document holds no bracket at all, and this runs on every edit. */\n if (!projection.source.includes(\"[\")) return [];\n return referencesOf(projection).filter((ref) => isAttachmentReference(ref.image ? \"image\" : \"link\", ref.url, options));\n}\n\n/**\n * One row per distinct URL the text references as a file, in the order it first appears. It reads the parse the\n * editor's surface already holds, so a keystroke never parses the text a second time.\n */\nexport function attachmentsOf(projection: Projection, options: AttachmentOptions): AttachmentRow[] {\n const rows = new Map<string, AttachmentRow>();\n for (const ref of attachmentReferences(projection, options)) {\n if (rows.has(ref.url)) continue;\n rows.set(ref.url, { url: ref.url, name: referenceLabel(projection.source, ref.record.content), image: ref.image });\n }\n return [...rows.values()];\n}\n\n/** A trailing number in a reference name: the \"2\" of \"PDF 2\". */\nconst TRAILING_NUMBER = /(?:^|\\s)(\\d+)$/;\n\n/**\n * The number the next file referenced takes: one more than the highest number any ATTACHMENT in the text already\n * ends in, whatever its kind. Numbers are never renumbered when a file is removed, because the person may have\n * written \"see Image 2\" in the text; a renamed reference that no longer ends in a number takes no part, and a typed\n * ordinary link (\"[RFC 2119](...)\") never does.\n */\nexport function nextReferenceNumber(source: string, options: AttachmentOptions): number {\n let highest = 0;\n for (const ref of attachmentReferences(project(source), options)) {\n const match = TRAILING_NUMBER.exec(referenceLabel(source, ref.record.content));\n if (match) highest = Math.max(highest, Number(match[1]));\n }\n return highest + 1;\n}\n\n/** The name for the next file referenced: `kindWord` and `nextReferenceNumber`. */\nexport function nextReferenceName(source: string, kindWord: string, options: AttachmentOptions): string {\n return `${kindWord} ${nextReferenceNumber(source, options)}`;\n}\n\n/** Every construct that points at `url`, in source order. */\nfunction constructsOf(source: string, url: string): Reference[] {\n if (!source.includes(\"[\")) return [];\n return referencesOf(project(source)).filter((ref) => ref.url === url);\n}\n\n/** The ranges no other range of the list contains: a construct nested in another that is edited too goes with it. */\nfunction outermost<T extends { start: number; end: number }>(ranges: T[]): T[] {\n return ranges.filter((r) => !ranges.some((o) => o !== r && o.start <= r.start && r.end <= o.end && (o.start < r.start || r.end < o.end)));\n}\n\n/** Replaces the given source ranges (non-overlapping), last first so offsets hold. */\nfunction splice(source: string, edits: Array<{ start: number; end: number; text: string }>): string {\n let out = source;\n for (const edit of [...edits].sort((a, b) => b.start - a.start)) out = out.slice(0, edit.start) + edit.text + out.slice(edit.end);\n return out;\n}\n\n/** Rewrites the bracket text of EVERY construct that points at `url`; the destination and everything else stay byte for byte. */\nexport function renameAttachment(source: string, url: string, name: string): string {\n const text = escapeReferenceName(name);\n /* A construct inside another one's label (`![a [b](u) c](u)`) is rewritten with it: two edits over one range would corrupt the text. */\n const edits = constructsOf(source, url).map(({ record }) => {\n /* An EMPTY label (`![](url)`) declares no range: the name goes right after the opening bracket. */\n const label = record.content[0] ?? { start: record.start + (record.frame.kind === \"image\" ? 2 : 1), end: record.start + (record.frame.kind === \"image\" ? 2 : 1) };\n return { start: label.start, end: label.end, text };\n });\n return splice(source, outermost(edits));\n}\n\n/**\n * Deletes EVERY construct that points at `url`, and one separating space beside each (the one before it, else\n * the one after), so `a ![x](u) b` becomes `a b`. A space two constructs share is taken once, so two references\n * side by side never reach into the text after them.\n */\nexport function removeAttachment(source: string, url: string): string {\n /* A construct inside another that is also deleted goes with it. */\n const ranges = outermost(constructsOf(source, url).map(({ record }) => ({ start: record.start, end: record.end })));\n const taken = new Set<number>();\n const free = (at: number) => source[at] === \" \" && !taken.has(at) && !ranges.some((r) => at >= r.start && at < r.end);\n const edits = ranges.map(({ start, end }) => {\n if (free(start - 1)) {\n taken.add(start - 1);\n start--;\n } else if (free(end)) {\n taken.add(end);\n end++;\n }\n return { start, end, text: \"\" };\n });\n return splice(source, edits);\n}\n\n/**\n * The one splice that turns `before` into `after`: the span between their common prefix and common suffix.\n * Several constructs changing at once (a rename, a remove) is still ONE edit, and so one undo step.\n */\nexport function coveringSplice(before: string, after: string): { start: number; end: number; text: string } | null {\n if (before === after) return null;\n let start = 0;\n const shortest = Math.min(before.length, after.length);\n while (start < shortest && before[start] === after[start]) start++;\n let tail = 0;\n while (tail < shortest - start && before[before.length - 1 - tail] === after[after.length - 1 - tail]) tail++;\n return { start, end: before.length - tail, text: after.slice(start, after.length - tail) };\n}\n"],"names":["referencesOf","projection","found","record","frame","a","b","isAttachmentReference","kind","url","options","attachmentReferences","ref","attachmentsOf","rows","referenceLabel","TRAILING_NUMBER","nextReferenceNumber","source","highest","project","match","constructsOf","outermost","ranges","r","o","splice","edits","out","edit","renameAttachment","name","text","escapeReferenceName","label","removeAttachment","taken","free","at","start","end","coveringSplice","before","after","shortest","tail"],"mappings":";;AAwCA,SAASA,EAAaC,GAAqC;AACzD,QAAMC,IAAqB,CAAA;AAC3B,aAAWC,KAAUF,EAAW,QAAQ;AACtC,UAAMG,IAAQD,EAAO;AACrB,IAAIC,EAAM,SAAS,UAASF,EAAM,KAAK,EAAE,QAAAC,GAAQ,KAAKC,EAAM,KAAK,OAAO,GAAA,CAAM,IACrEA,EAAM,SAAS,UAAQF,EAAM,KAAK,EAAE,QAAAC,GAAQ,KAAKC,EAAM,MAAM,OAAO,GAAA,CAAO;AAAA,EACtF;AACA,SAAOF,EAAM,KAAK,CAACG,GAAGC,MAAMD,EAAE,OAAO,QAAQC,EAAE,OAAO,KAAK;AAC7D;AAMO,SAASC,EAAsBC,GAAwBC,GAAaC,GAAqC;AAE9G,SAAOF,MAAS,UAAUC,EAAI,KAAA,MAAW,KAAKC,EAAQ,UAAUD,CAAG;AACrE;AAGA,SAASE,EAAqBV,GAAwBS,GAAyC;AAE7F,SAAKT,EAA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AD,GAAO,KAAAC,GAAK,MAAM,GAAA,EAC5B;AACD,SAAOd,EAAOT,GAAQU,CAAK;AAC7B;AAMO,SAASc,EAAeC,GAAgBC,GAAoE;AACjH,MAAID,MAAWC,EAAO,QAAO;AAC7B,MAAIJ,IAAQ;AACZ,QAAMK,IAAW,KAAK,IAAIF,EAAO,QAAQC,EAAM,MAAM;AACrD,SAAOJ,IAAQK,KAAYF,EAAOH,CAAK,MAAMI,EAAMJ,CAAK,IAAG,CAAAA;AAC3D,MAAIM,IAAO;AACX,SAAOA,IAAOD,IAAWL,KAASG,EAAOA,EAAO,SAAS,IAAIG,CAAI,MAAMF,EAAMA,EAAM,SAAS,IAAIE,CAAI,IAAG,CAAAA;AACvG,SAAO,EAAE,OAAAN,GAAO,KAAKG,EAAO,SAASG,GAAM,MAAMF,EAAM,MAAMJ,GAAOI,EAAM,SAASE,CAAI,EAAA;AACzF;"}
@@ -0,0 +1,153 @@
1
+ const y = /* @__PURE__ */ new Set([
2
+ "inline",
3
+ "emphasis",
4
+ "strong",
5
+ "strike",
6
+ "codeSpan",
7
+ "link",
8
+ "image",
9
+ "autolink",
10
+ "footnoteRef",
11
+ "hardBreak"
12
+ ]), C = new Intl.Segmenter(void 0, { granularity: "grapheme" });
13
+ function M(o, s = []) {
14
+ for (const r of o)
15
+ r.type === "text" ? s.push(r) : M(r.children, s);
16
+ return s;
17
+ }
18
+ function L(o) {
19
+ const { source: s } = o, r = M(o.children), l = new Uint8Array(s.length);
20
+ for (const t of r)
21
+ if (t.syntax)
22
+ for (let e = t.start; e < t.end; e++) l[e] = 1;
23
+ const c = [], f = /* @__PURE__ */ new Set([0, s.length]);
24
+ for (const t of r) {
25
+ if (t.syntax) {
26
+ f.add(t.start), f.add(t.end);
27
+ continue;
28
+ }
29
+ f.add(t.start);
30
+ for (const e of C.segment(t.text)) {
31
+ const n = t.start + e.index, a = n + e.segment.length;
32
+ c.push({ start: n, end: a }), f.add(a);
33
+ }
34
+ }
35
+ c.sort((t, e) => t.start - e.start);
36
+ const b = o.frames.map((t) => ({
37
+ start: t.start,
38
+ end: t.end,
39
+ inline: y.has(t.frame.kind)
40
+ })), k = (t) => {
41
+ let e = 0;
42
+ for (const n of b) n.inline && n.start < t && t < n.end && e++;
43
+ return e;
44
+ }, v = (t, e) => {
45
+ let n = null;
46
+ for (const a of b)
47
+ a.start > t || e > a.end || (!n || a.end - a.start <= n.end - n.start) && (n = a);
48
+ return n;
49
+ }, A = (t) => t === 0 || s[t - 1] === `
50
+ `, D = o.frames.filter((t) => t.frame.kind === "tableCell" || t.frame.kind === "tableGutter" || t.frame.kind === "tableDelimiter").map((t) => ({ start: t.start, end: t.end, cell: t.frame.kind === "tableCell" })), I = o.frames.filter((t) => y.has(t.frame.kind) && t.content.length === 0 && t.end > t.start).map((t) => ({ start: t.start, end: t.end })), N = (t, e) => I.some((n) => t <= n.start && n.end <= e && e > t), p = (t) => {
51
+ let e = null;
52
+ for (const n of D)
53
+ t < n.start || t > n.end || (!e || n.cell && !e.cell || n.cell === e.cell && n.end - n.start < e.end - e.start) && (e = n);
54
+ return e;
55
+ }, B = [...f].sort((t, e) => t - e), u = [], d = new Array(s.length + 1).fill(-1);
56
+ let i = [];
57
+ const S = () => {
58
+ if (!i.length) return;
59
+ const t = i[0], e = i[i.length - 1], n = e, a = v(t, e);
60
+ let h;
61
+ if (a && a.inline) {
62
+ h = t;
63
+ let g = k(t);
64
+ for (const m of i) {
65
+ const x = k(m);
66
+ (x < g || x === g && m > h) && (h = m, g = x);
67
+ }
68
+ } else A(t) ? h = n : h = t;
69
+ const w = p(h);
70
+ if (w && !w.cell) {
71
+ i = [];
72
+ return;
73
+ }
74
+ u.push(h);
75
+ for (let g = t; g <= e; g++) d[g] = h;
76
+ i = [];
77
+ };
78
+ for (const t of B) {
79
+ if (i.length) {
80
+ const e = i[i.length - 1];
81
+ let n = !0;
82
+ for (let a = e; a < t; a++)
83
+ if (!l[a]) {
84
+ n = !1;
85
+ break;
86
+ }
87
+ (!n || p(e) !== p(t) || N(e, t)) && S();
88
+ }
89
+ i.push(t);
90
+ }
91
+ if (S(), u.length)
92
+ for (let t = 0; t <= s.length; t++) {
93
+ if (d[t] !== -1) continue;
94
+ let e = u[0];
95
+ for (const n of u) {
96
+ if (n > t) break;
97
+ e = n;
98
+ }
99
+ d[t] = e;
100
+ }
101
+ else
102
+ d.fill(0), u.push(0);
103
+ return d[s.length] !== s.length && (u.push(s.length), d[s.length] = s.length), { source: s, stops: u, graphemes: c, representative: d };
104
+ }
105
+ function E(o, s) {
106
+ const r = Math.max(0, Math.min(s, o.source.length));
107
+ return o.representative[r] ?? 0;
108
+ }
109
+ function O(o, s, r) {
110
+ const l = E(o, s), f = o.stops.indexOf(l) + r;
111
+ return f < 0 || f >= o.stops.length ? l : o.stops[f];
112
+ }
113
+ function G(o, s) {
114
+ let r = null;
115
+ for (const l of o.graphemes)
116
+ if (l.end <= s) r = l;
117
+ else break;
118
+ return r;
119
+ }
120
+ function K(o, s) {
121
+ for (const r of o.graphemes) if (r.start >= s) return r;
122
+ return null;
123
+ }
124
+ function R(o, s) {
125
+ const { source: r } = o;
126
+ let l = Math.max(0, Math.min(s, r.length));
127
+ for (; l > 0 && r[l - 1] !== `
128
+ `; ) l--;
129
+ for (const c of o.stops) if (c >= l) return c;
130
+ return l;
131
+ }
132
+ function U(o, s) {
133
+ const { source: r } = o;
134
+ let l = Math.max(0, Math.min(s, r.length));
135
+ for (; l < r.length && r[l] !== `
136
+ `; ) l++;
137
+ let c = 0;
138
+ for (const f of o.stops) {
139
+ if (f > l) break;
140
+ c = f;
141
+ }
142
+ return c;
143
+ }
144
+ export {
145
+ L as caretMap,
146
+ K as graphemeAfter,
147
+ G as graphemeBefore,
148
+ U as lineEndStop,
149
+ R as lineStartStop,
150
+ E as nearestStop,
151
+ O as stepStop
152
+ };
153
+ //# sourceMappingURL=caret-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caret-map.js","sources":["../../../src/lib/markdown/caret-map.ts"],"sourcesContent":["/* ============================================================================\n THE CARET MAP — which source offsets are places the caret can be, now that\n markup is never shown.\n\n WHY THIS MODULE EXISTS, AND WHAT IT REPLACES. The first caret contract said\n \"EVERY SOURCE OFFSET IS A CARET POSITION\", and reveal-on-active-line existed\n to make that true: a caret cannot be placed inside a zero-size box, so a\n marker had to become visible for its offsets to have geometry. The operator's\n requirement is the opposite one — the markdown is NEVER shown — so the\n markers keep no geometry at any time, and offsets inside them stop being\n places at all.\n\n That is the trade the old contract deliberately refused, and it named the bug\n class it was refusing: caret trapped in a widget, cannot delete across a\n hidden run, hidden start/end not covered. CodeMirror needed a dedicated\n `atomicRanges` facet for exactly this. So this module owes those cases an\n answer rather than an argument:\n\n trapped Impossible by construction — `stops` never contains an\n offset strictly inside a syntax run, so the caret is never\n put in one and never has to escape.\n delete across Deletion does not work between stops, it works on the\n adjacent VISIBLE grapheme (`graphemeBefore`/`graphemeAfter`),\n so a marker between the caret and the character being\n deleted is simply not involved.\n hidden edges A syntax run's own start and end are both candidate stops,\n so a construct at the very start or very end of a document\n still has a caret position outside it.\n\n ── THE BOUNDARY RULE, which is the only interesting decision here ──────────\n\n Where a marker sits between two pieces of text, the offset before it and the\n offset after it are the SAME PLACE on screen. One of them has to be chosen,\n and the choice decides what typing there does.\n\n `- item` Before the marker (0) and after it (2) are both column zero.\n Choosing 2 means typing at the start of the line appends to\n the ITEM. Choosing 0 would insert before the `- ` and silently\n destroy the list.\n `**bold**` Before the opening `**` (0) and after it (2) are the same\n place. Choosing 0 means typing there is NOT bold, which is\n what every editor does at the left edge of a formatted run.\n The closing edge is the mirror: 8, not 6.\n\n So the two cases want OPPOSITE answers, and what separates them is the kind\n of frame the marker belongs to. A block frame's markup is a PREFIX declaring\n what the line is — the caret belongs inside it. An inline frame's markup\n DELIMITS a span — the caret belongs outside it.\n\n The rule, therefore: prefer the candidate inside FEWER INLINE frames, and\n break the tie by preferring the one inside more BLOCK frames.\n\n THE ORDER OF THOSE TWO TESTS IS NOT ARBITRARY, and getting it backwards is\n the first thing that happened. Asking about block frames first makes\n `**bold**` choose the inner offset, because the PARAGRAPH containing the\n whole line is itself a block frame and offset 2 is inside it while offset 0\n merely touches its edge. The paragraph has nothing to do with this boundary.\n Inline containment is the sharper question — it is only ever true of a\n construct whose delimiter is the very markup being stepped over — so it\n decides, and block depth is left to break the ties it cannot.\n ========================================================================= */\n\nimport type { Frame } from \"../syntax/markdown/frames\";\nimport type { PNode, PText, Projection } from \"./project\";\n\n/** A half-open source range. */\nexport interface Span {\n start: number;\n end: number;\n}\n\nexport interface CaretMap {\n source: string;\n /** Every offset the caret may occupy, ascending and unique. */\n stops: readonly number[];\n /** The source range of every VISIBLE grapheme, in document order. */\n graphemes: readonly Span[];\n /**\n * The stop that stands for each source offset, indexed by offset.\n *\n * NEEDED BECAUSE \"NEAREST\" IS THE WRONG QUESTION. Deleting the \"d\" from\n * `**bold**` leaves the caret at offset 5, which is the same PLACE as offset\n * 7 but two characters closer to 4 — so a nearest-by-distance snap puts the\n * caret before the \"l\" instead of after the construct, and the next keystroke\n * lands in the wrong word. An offset belongs to the coincident group it falls\n * in, and only this table knows which that is.\n */\n representative: readonly number[];\n}\n\n/**\n * Frame kinds whose markup delimits a span inside a line, rather than declaring\n * what the line is.\n *\n * `inline` is on this list even though it is a container rather than a marker,\n * and that is not an oversight: its hull covers the whole run of prose\n * INCLUDING the markers inside it, so counting it as a block frame would make\n * every inline boundary prefer the inner offset and put the caret inside the\n * emphasis it was trying to stand outside of.\n */\nconst INLINE_KINDS = new Set<Frame[\"kind\"]>([\n \"inline\",\n \"emphasis\",\n \"strong\",\n \"strike\",\n \"codeSpan\",\n \"link\",\n \"image\",\n \"autolink\",\n \"footnoteRef\",\n \"hardBreak\",\n]);\n\nconst segmenter = new Intl.Segmenter(undefined, { granularity: \"grapheme\" });\n\nfunction flatten(nodes: readonly PNode[], out: PText[] = []): PText[] {\n for (const node of nodes) {\n if (node.type === \"text\") out.push(node);\n else flatten(node.children, out);\n }\n return out;\n}\n\n/**\n * Builds the map for a projection.\n *\n * Pure, and rebuilt with every projection rather than maintained across edits —\n * the same reasoning the projection itself gives. Nothing is kept in step, so\n * nothing can drift.\n */\nexport function caretMap(projection: Projection): CaretMap {\n const { source } = projection;\n const runs = flatten(projection.children);\n\n /* Which characters are markup. Every source character belongs to exactly one\n run (the projection invariant), so this is total. */\n const syntax = new Uint8Array(source.length);\n for (const run of runs) {\n if (!run.syntax) continue;\n for (let at = run.start; at < run.end; at++) syntax[at] = 1;\n }\n\n /* Every visible grapheme, and every offset that bounds one. */\n const graphemes: Span[] = [];\n const candidates = new Set<number>([0, source.length]);\n for (const run of runs) {\n if (run.syntax) {\n /* A marker's own edges are candidates so a construct at the very start or\n end of the document still has a caret position outside it. */\n candidates.add(run.start);\n candidates.add(run.end);\n continue;\n }\n candidates.add(run.start);\n for (const piece of segmenter.segment(run.text)) {\n const start = run.start + piece.index;\n const end = start + piece.segment.length;\n graphemes.push({ start, end });\n candidates.add(end);\n }\n }\n graphemes.sort((a, b) => a.start - b.start);\n\n /* Frames, with the two questions the boundary rule asks of them. */\n const frames = projection.frames.map((record) => ({\n start: record.start,\n end: record.end,\n inline: INLINE_KINDS.has(record.frame.kind),\n }));\n\n /** How many inline constructs an offset is strictly inside. */\n const inlineDepth = (at: number): number => {\n let n = 0;\n for (const frame of frames) if (frame.inline && frame.start < at && at < frame.end) n++;\n return n;\n };\n\n /** The innermost frame wholly containing a span — the one that OWNS it. */\n const owner = (lo: number, hi: number): { start: number; end: number; inline: boolean } | null => {\n let best: { start: number; end: number; inline: boolean } | null = null;\n for (const frame of frames) {\n if (frame.start > lo || hi > frame.end) continue;\n /* `<=`, not `<`, and that is the whole difference between this working\n and not. A paragraph, its inline run and a `**strong**` filling it all\n span exactly the same offsets, so \"smallest wins\" is a three-way tie\n that keeps whichever the parser happened to emit first — the paragraph\n — and the boundary is then judged as a block's. Frames arrive in\n emission order and a child is always opened after its parent, so on a\n tie the LAST one is the innermost. */\n if (!best || frame.end - frame.start <= best.end - best.start) best = frame;\n }\n return best;\n };\n\n const atLineStart = (at: number): boolean => at === 0 || source[at - 1] === \"\\n\";\n\n /* THE TABLE IS THE ONE PLACE WITH REAL BOXES, and that changes what\n \"the same place on screen\" means.\n\n Everywhere else every block frame is `display: inline`, so two offsets with\n only zero-width markup between them are genuinely the same pixel. A table's\n cells are laid-out boxes with borders and padding, so the end of cell A and\n the start of cell B are separated by a border and two paddings — different\n places, however wide the pipe between them renders. Merging them made the\n start of every cell but the first unreachable, and Tab-to-next-cell\n selected the pipe along with the text.\n\n So a caret position belongs to exactly one box, groups never span two, and\n a position whose only box is a gutter or the alignment row is dropped\n outright: those cells are `width: 0`, and a caret in one has no geometry —\n the very thing this whole model exists to avoid. */\n const boxes = projection.frames\n .filter((r) => r.frame.kind === \"tableCell\" || r.frame.kind === \"tableGutter\" || r.frame.kind === \"tableDelimiter\")\n .map((r) => ({ start: r.start, end: r.end, cell: r.frame.kind === \"tableCell\" }));\n\n /* AN ATOMIC CONSTRUCT HAS WIDTH, so its two sides are two places.\n A footnote reference or a hard break declares no content of its own.\n Every offset in it is therefore markup, and the merging rule collapsed the\n whole thing to a single stop: there was nowhere to stand BEFORE one, so a\n document beginning with one could never gain text in front of it. A group\n may not swallow one. */\n const atomics = projection.frames\n .filter((r) => INLINE_KINDS.has(r.frame.kind) && r.content.length === 0 && r.end > r.start)\n .map((r) => ({ start: r.start, end: r.end }));\n\n const spansAtomic = (lo: number, hi: number): boolean =>\n atomics.some((a) => lo <= a.start && a.end <= hi && hi > lo);\n\n const boxOf = (at: number): { start: number; end: number; cell: boolean } | null => {\n let best: { start: number; end: number; cell: boolean } | null = null;\n for (const box of boxes) {\n if (at < box.start || at > box.end) continue;\n /* A cell wins over the gutter it touches: their edges coincide, and the\n caret belongs with the text rather than with the pipe. */\n if (!best || (box.cell && !best.cell) || (box.cell === best.cell && box.end - box.start < best.end - best.start)) {\n best = box;\n }\n }\n return best;\n };\n\n /* Candidates separated only by markup are one place on screen. Group them,\n and keep the one the boundary rule picks. */\n const sorted = [...candidates].sort((a, b) => a - b);\n const stops: number[] = [];\n const representative = new Array<number>(source.length + 1).fill(-1);\n let group: number[] = [];\n\n const flush = (): void => {\n if (!group.length) return;\n const lo = group[0];\n const hi = group[group.length - 1];\n const last = hi;\n const holder = owner(lo, hi);\n\n let best: number;\n if (holder && holder.inline) {\n /* INLINE: stand outside the construct. Measured by containment rather\n than by picking an end, because a group can sit BETWEEN two constructs\n — the `**__` in `**a**__b__` — where the right answer is neither end\n but the offset between them, and that is the one inside fewest of\n them. */\n best = lo;\n let bestDepth = inlineDepth(lo);\n for (const at of group) {\n const d = inlineDepth(at);\n if (d < bestDepth || (d === bestDepth && at > best)) {\n best = at;\n bestDepth = d;\n }\n }\n } else if (atLineStart(lo)) {\n /* A BLOCK'S PREFIX: the markup declares what the line is, and the text it\n introduces comes after it, so the caret belongs past it. This is what\n makes typing at the start of `- item` append to the item instead of\n destroying the list — and it holds for an EMPTY item too, where no\n candidate is inside anything and counting containers cannot decide. */\n best = last;\n } else {\n /* A BLOCK'S TRAILING MARKUP — a closing fence, say. Its content is on the\n near side, so the caret stays with the content rather than stepping out\n of the block it is in. This is also correct at the very end of the\n document — SEE THE FORCED BREAK BELOW for why `hi` never actually\n equals `source.length` here unless `lo` does too. */\n best = lo;\n }\n /* A group whose only home is a zero-width gutter offers no place to stand. */\n const box = boxOf(best);\n if (box && !box.cell) {\n group = [];\n return;\n }\n stops.push(best);\n for (let at = lo; at <= hi; at++) representative[at] = best;\n group = [];\n };\n\n for (const at of sorted) {\n if (group.length) {\n const previous = group[group.length - 1];\n let onlyMarkup = true;\n for (let i = previous; i < at; i++) {\n if (!syntax[i]) {\n onlyMarkup = false;\n break;\n }\n }\n if (!onlyMarkup || boxOf(previous) !== boxOf(at) || spansAtomic(previous, at)) flush();\n }\n group.push(at);\n }\n flush();\n\n /* Offsets no group covered are inside a run of content — either a stop\n already, or partway through a multi-unit grapheme, where the enclosing\n grapheme's own start is the honest answer. */\n if (stops.length) {\n for (let at = 0; at <= source.length; at++) {\n if (representative[at] !== -1) continue;\n let chosen = stops[0];\n for (const stop of stops) {\n if (stop > at) break;\n chosen = stop;\n }\n representative[at] = chosen;\n }\n } else {\n representative.fill(0);\n stops.push(0);\n }\n\n /* SG-800 — THE DOCUMENT'S OWN END IS ALWAYS A STOP IN ITS OWN RIGHT, even\n when the flush above put its group's caret on the NEAR side of a\n trailing block marker instead.\n\n \"A BLOCK'S TRAILING MARKUP\" above is right to stand there ON PURPOSE —\n Tab indenting the last line of a fence body has to stay inside the\n fence, not jump past its own closing fence, and an earlier version of\n this fix that changed the branch's OWN choice (or forced the merge apart\n at the loop above) broke exactly that case, and separately broke every\n INLINE closing marker at a document's end too (`**bold**‸` stepping\n Backspace across the `**` no longer landed outside it) — inline markers\n already merge the near side and the far side into ONE reachable stop on\n purpose, and forcing them apart made the near side reachable again,\n which \"no marker ever has geometry\" exists to forbid.\n\n So nothing about the merge or the branch changes. This only asks: after\n all of that, is `source.length` — the actual end of the document — its\n OWN place, the way \"hidden edges\" above already promises for the very\n START of one (`candidates` seeds `0` unconditionally for the same\n reason)? For a document that ends in visible content, or in an INLINE\n marker's own close, it already is (the group covering the tail resolves\n to itself). It stops being true only for a BLOCK's own trailing\n markup — a closed ```fence```, a closing `## heading ##` — with nothing\n after it: there the near-side choice above is correct for what already\n existed, but it leaves the document's true end mapped to somewhere\n inside the block, and an edit computed to land at that true end — Enter\n on the last line, most plainly — silently lands inside the block\n instead, one keystroke short of where the document could actually still\n grow. A real Chromium probe confirmed the shape: pressing Enter after a\n closed fence that ended the document spliced the new line INSIDE the\n fence body, and the character typed next landed after the fence with no\n separator — Enter looked like it did nothing.\n\n Adding it here, once, after every other stop is already decided, is what\n keeps this a genuine ADDITION rather than a second vote that could\n re-open either regression above: every existing representative entry\n (offset 13 in a fence, offset 6 before a closing `**`) is left exactly as\n the rules above chose it, and only the one slot that was never anybody's\n first choice — the offset equal to `source.length` itself — is filled in\n if nothing already claimed it. */\n if (representative[source.length] !== source.length) {\n stops.push(source.length);\n representative[source.length] = source.length;\n }\n\n return { source, stops, graphemes, representative };\n}\n\n/**\n * The legal offset standing for `offset` — the caret's real place.\n *\n * Not \"the closest number in `stops`\": see `representative`. Out-of-range\n * offsets clamp, because a caret that cannot be placed is worse than one placed\n * at the edge.\n */\nexport function nearestStop(map: CaretMap, offset: number): number {\n const at = Math.max(0, Math.min(offset, map.source.length));\n return map.representative[at] ?? 0;\n}\n\n/** The next legal offset in `direction`, or the same one at a document edge. */\nexport function stepStop(map: CaretMap, offset: number, direction: 1 | -1): number {\n const at = nearestStop(map, offset);\n const index = map.stops.indexOf(at);\n const next = index + direction;\n if (next < 0 || next >= map.stops.length) return at;\n return map.stops[next];\n}\n\n/** The visible grapheme immediately before `offset`, if there is one. */\nexport function graphemeBefore(map: CaretMap, offset: number): Span | null {\n let found: Span | null = null;\n for (const span of map.graphemes) {\n if (span.end <= offset) found = span;\n else break;\n }\n return found;\n}\n\n/** The visible grapheme immediately after `offset`, if there is one. */\nexport function graphemeAfter(map: CaretMap, offset: number): Span | null {\n for (const span of map.graphemes) if (span.start >= offset) return span;\n return null;\n}\n\n/** The first legal offset on the line holding `offset` — where Home goes. */\nexport function lineStartStop(map: CaretMap, offset: number): number {\n const { source } = map;\n let start = Math.max(0, Math.min(offset, source.length));\n while (start > 0 && source[start - 1] !== \"\\n\") start--;\n for (const stop of map.stops) if (stop >= start) return stop;\n return start;\n}\n\n/**\n * The last legal offset on the line holding `offset` — where End goes.\n *\n * SG-799 — NOT SAFE TO LEAVE TO THE BROWSER, the way `input.ts` leaves\n * vertical movement and word-wise movement to it. A block's own leading\n * markup (`# `, `- `, `> `) renders as `display: inline-block; width: 0`\n * (`styles/markdown.css`'s \"markup is collapsed at all times\" rule) so it can\n * be reached at all without ever having visible geometry — but a zero-size\n * `inline-block` is an ATOMIC box for Chromium's own line-navigation, and a\n * real Chromium probe caught it landing End's selection INSIDE that leading\n * box (`(\"# \", offset 2)`, the same on-screen point as where the caret\n * already stood) instead of at the true end of the visible text — every time,\n * on every block with a leading marker, regardless of heading level and\n * regardless of whether the line was the document's last one. Home already\n * had the model-side half of this fix (`lineStartStop`, above) sitting\n * unused — nothing in `input.ts` ever called it, so Home had the identical\n * exposure and simply hadn't been caught yet. Both are now computed here and\n * written directly, the same way `moveCaret` already computes ArrowLeft/Right\n * instead of trusting the browser.\n */\nexport function lineEndStop(map: CaretMap, offset: number): number {\n const { source } = map;\n let end = Math.max(0, Math.min(offset, source.length));\n while (end < source.length && source[end] !== \"\\n\") end++;\n let chosen = 0;\n for (const stop of map.stops) {\n if (stop > end) break;\n chosen = stop;\n }\n return chosen;\n}\n"],"names":["INLINE_KINDS","segmenter","flatten","nodes","out","node","caretMap","projection","source","runs","syntax","run","at","graphemes","candidates","piece","start","end","a","b","frames","record","inlineDepth","n","frame","owner","lo","hi","best","atLineStart","boxes","r","atomics","spansAtomic","boxOf","box","sorted","stops","representative","group","flush","last","holder","bestDepth","d","previous","onlyMarkup","i","chosen","stop","nearestStop","map","offset","stepStop","direction","next","graphemeBefore","found","span","graphemeAfter","lineStartStop","lineEndStop"],"mappings":"AAoGA,MAAMA,wBAAmB,IAAmB;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEKC,IAAY,IAAI,KAAK,UAAU,QAAW,EAAE,aAAa,YAAY;AAE3E,SAASC,EAAQC,GAAyBC,IAAe,IAAa;AACpE,aAAWC,KAAQF;AACjB,IAAIE,EAAK,SAAS,SAAQD,EAAI,KAAKC,CAAI,IAClCH,EAAQG,EAAK,UAAUD,CAAG;AAEjC,SAAOA;AACT;AASO,SAASE,EAASC,GAAkC;AACzD,QAAM,EAAE,QAAAC,MAAWD,GACbE,IAAOP,EAAQK,EAAW,QAAQ,GAIlCG,IAAS,IAAI,WAAWF,EAAO,MAAM;AAC3C,aAAWG,K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AAOQ,IAAQ,CAAC,MAAM;AAAA,IAAM,CAAAA;AAChD,aAAWiC,KAAQE,EAAI,MAAO,KAAIF,KAAQjC,EAAO,QAAOiC;AACxD,SAAOjC;AACT;AAsBO,SAAS6C,EAAYV,GAAeC,GAAwB;AACjE,QAAM,EAAE,QAAA5C,MAAW2C;AACnB,MAAIlC,IAAM,KAAK,IAAI,GAAG,KAAK,IAAImC,GAAQ5C,EAAO,MAAM,CAAC;AACrD,SAAOS,IAAMT,EAAO,UAAUA,EAAOS,CAAG,MAAM;AAAA,IAAM,CAAAA;AACpD,MAAI+B,IAAS;AACb,aAAWC,KAAQE,EAAI,OAAO;AAC5B,QAAIF,IAAOhC,EAAK;AAChB,IAAA+B,IAASC;AAAA,EACX;AACA,SAAOD;AACT;"}
@@ -0,0 +1,35 @@
1
+ const i = new Intl.Segmenter(void 0, { granularity: "grapheme" });
2
+ function p(n, f, e) {
3
+ const t = Math.max(0, Math.min(f, n.length));
4
+ if (e === 1 && t >= n.length) return n.length;
5
+ if (e === -1 && t <= 0) return 0;
6
+ const r = m(n, t), a = r.start, o = n.slice(a, r.end), s = t - a;
7
+ if (e === -1 && s <= 0) return t - 1;
8
+ const g = [0];
9
+ for (const l of i.segment(o)) g.push(l.index + l.segment.length);
10
+ if (e === 1) {
11
+ for (const l of g) if (l > s) return a + l;
12
+ return t + 1;
13
+ }
14
+ let h = 0;
15
+ for (const l of g) {
16
+ if (l >= s) break;
17
+ h = l;
18
+ }
19
+ return a + h;
20
+ }
21
+ function m(n, f) {
22
+ const e = Math.max(0, Math.min(f, n.length));
23
+ let t = e;
24
+ for (; t > 0 && n[t - 1] !== `
25
+ `; ) t--;
26
+ let r = e;
27
+ for (; r < n.length && n[r] !== `
28
+ `; ) r++;
29
+ return { start: t, end: r };
30
+ }
31
+ export {
32
+ m as lineAt,
33
+ p as stepOffset
34
+ };
35
+ //# sourceMappingURL=caret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caret.js","sources":["../../../src/lib/markdown/caret.ts"],"sourcesContent":["/* ============================================================================\n LINE AND GRAPHEME UTILITIES — and the record of a contract that was replaced.\n\n ── WHAT THIS FILE USED TO BE ───────────────────────────────────────────────\n\n This was THE CARET CONTRACT, and its first rule was:\n\n \"EVERY SOURCE OFFSET IS A CARET POSITION. There are no atomic ranges, no\n positions that cannot be reached, and no node type that is skipped over.\n Pressing Left once moves back exactly one character, always, everywhere.\"\n\n That rule was chosen against the decoration-based editors on purpose.\n CodeMirror needed a dedicated `atomicRanges` facet because hiding syntax\n with REPLACE decorations breaks the caret by default, and it was still being\n patched in September 2025. Keeping markers as real, reachable text made the\n whole bug class — caret trapped in a widget, cannot delete the next line,\n atomic range not covering a hidden start or end — structurally impossible.\n\n Its second rule was what paid for the first: markup was REVEALED on the\n caret's own line, because a caret cannot be placed inside a zero-size box, so\n an unrevealed marker is an offset with no geometry.\n\n ── WHY IT IS NOT THAT ANY MORE ─────────────────────────────────────────────\n\n The operator's requirement is that the markdown is NEVER shown — not even on\n the line being edited. Rules 1 and 2 stand or fall together, so the reveal\n going means markers have no geometry at any time, and offsets inside them\n stop being positions.\n\n That is the trade this file's original text refused, and refusing it was\n defensible: the alternative it warned about is real. So the replacement owes\n those failures an answer rather than an argument, and ./caret-map.ts gives\n them one apiece — the caret is never PUT in a marker, deletion never works\n BETWEEN caret stops but on the adjacent visible grapheme, and a marker's own\n edges are candidate stops so a construct at either end of the document still\n has a position outside it.\n\n ── WHAT SURVIVED, AND WHY IT IS STILL HERE ─────────────────────────────────\n\n Rule 4 survived untouched and is worth restating, because the new model does\n not weaken it: NOTHING IS EVER REWRITTEN BEHIND THE USER. No input rule turns\n `# ` into a heading node, because the `# ` IS the heading. Typing `* ` shows\n a bullet the instant the space lands, and the bytes on disk are still `* `.\n There is no auto-transform, so there is no \"undo the transform\" hatch to\n design, and the Slack 2019 failure class — a rollout reversed over closing\n backticks not being respected and `self._private_member` italicising itself —\n is structurally absent rather than avoided.\n\n Vertical, word-wise and Home/End movement remain the BROWSER's, deliberately:\n they depend on layout, bidi and platform convention, and ProseMirror's author\n concluded after a decade that reimplementing them is a decade of work. What\n changed is that horizontal movement is now model-driven for a second reason\n as well as the first — not only can one offset be two DOM points, but many\n offsets are no longer points at all.\n\n The two functions below are what is left: plain string utilities with no\n opinion about markup. `lineAt` is used by every block command; `stepOffset`\n steps one grapheme through a string and is the property harness's way of\n applying an arbitrary SOURCE edit, which is deliberately not the same thing\n as a user keystroke.\n ========================================================================= */\n\n/* --- Horizontal movement, which is ours ----------------------------------- */\n\n/**\n * The next grapheme boundary before or after `offset`.\n *\n * WHY THIS IS NOT THE BROWSER'S JOB HERE, when vertical movement still is. One\n * source offset can be TWO DOM points — the end of one node and the start of\n * the next — and the browser rightly treats them as different places. Inside a\n * single inline flow it normalises them to one; across a table-cell boundary it\n * does not, because they genuinely are different cells. The arrow-key torture\n * test caught it there: pressing Right moved the caret from the end of `| ` to\n * the start of `a`, both of which are source offset 2, so the caret appeared to\n * stall. Every construct is exposed to it; the table is only where it shows.\n *\n * Rule 1 of the contract says Left moves back exactly one character, ALWAYS.\n * The only way to mean that is to move in the model and write the result, which\n * is also the only definition that is stable across engines.\n *\n * Graphemes, not code units: a thumbs-up is two UTF-16 units and a family emoji\n * is eleven, and stepping into the middle of either puts the caret somewhere no\n * character begins. `Intl.Segmenter` is the only correct answer and it has been\n * in every target engine since 2024.\n */\nconst segmenter = new Intl.Segmenter(undefined, { granularity: \"grapheme\" });\n\nexport function stepOffset(source: string, offset: number, direction: 1 | -1): number {\n const at = Math.max(0, Math.min(offset, source.length));\n if (direction === 1 && at >= source.length) return source.length;\n if (direction === -1 && at <= 0) return 0;\n\n /* Segmenting the whole document per keypress would be wasteful on a long\n one, so only the caret's own line is segmented — a grapheme cluster never\n spans a line break, so the answer is identical and the work is bounded. */\n const line = lineAt(source, at);\n const from = direction === 1 ? line.start : line.start;\n const text = source.slice(from, line.end);\n const local = at - from;\n\n /* Leftward off the start of a line crosses into the previous line's\n terminator, which is inside no cluster — a plain one-character move. There\n is deliberately NO matching guard for the rightward case: the boundary scan\n below already falls through to `at + 1` when nothing is further right, and\n the mutation harness proved it by staying green with such a guard deleted.\n A branch that can never change an answer is not insurance, it is noise. */\n if (direction === -1 && local <= 0) return at - 1;\n\n const boundaries = [0];\n for (const piece of segmenter.segment(text)) boundaries.push(piece.index + piece.segment.length);\n\n if (direction === 1) {\n for (const edge of boundaries) if (edge > local) return from + edge;\n return at + 1;\n }\n let previous = 0;\n for (const edge of boundaries) {\n if (edge >= local) break;\n previous = edge;\n }\n return from + previous;\n}\n\n/** The source range of the line containing `offset`, terminator excluded. */\nexport function lineAt(source: string, offset: number): { start: number; end: number } {\n const at = Math.max(0, Math.min(offset, source.length));\n let start = at;\n while (start > 0 && source[start - 1] !== \"\\n\") start--;\n let end = at;\n while (end < source.length && source[end] !== \"\\n\") end++;\n return { start, end };\n}\n"],"names":["segmenter","stepOffset","source","offset","direction","at","line","lineAt","from","text","local","boundaries","piece","edge","previous","start","end"],"mappings":"AAqFA,MAAMA,IAAY,IAAI,KAAK,UAAU,QAAW,EAAE,aAAa,YAAY;AAEpE,SAASC,EAAWC,GAAgBC,GAAgBC,GAA2B;AACpF,QAAMC,IAAK,KAAK,IAAI,GAAG,KAAK,IAAIF,GAAQD,EAAO,MAAM,CAAC;AACtD,MAAIE,MAAc,KAAKC,KAAMH,EAAO,eAAeA,EAAO;AAC1D,MAAIE,MAAc,MAAMC,KAAM,EAAG,QAAO;AAKxC,QAAMC,IAAOC,EAAOL,GAAQG,CAAE,GACxBG,IAAyBF,EAAK,OAC9BG,IAAOP,EAAO,MAAMM,GAAMF,EAAK,GAAG,GAClCI,IAAQL,IAAKG;AAQnB,MAAIJ,MAAc,MAAMM,KAAS,UAAUL,IAAK;AAEhD,QAAMM,IAAa,CAAC,CAAC;AACrB,aAAWC,KAASZ,EAAU,QAAQS,CAAI,EAAG,CAAAE,EAAW,KAAKC,EAAM,QAAQA,EAAM,QAAQ,MAAM;AAE/F,MAAIR,M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