@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,111 @@
1
+ import { rangeOf as u } from "./reconcile.js";
2
+ import { SYNTAX_ATTR as b } from "./dom.js";
3
+ function m(r) {
4
+ const n = [], e = (t) => {
5
+ if (t.nodeType === 3) {
6
+ u(t) && n.push(t);
7
+ return;
8
+ }
9
+ for (let i = t.firstChild; i; i = i.nextSibling) e(i);
10
+ };
11
+ return e(r), n;
12
+ }
13
+ function h(r) {
14
+ for (let n = r.parentNode; n; n = n.parentNode)
15
+ if (n.nodeType === 1 && n.hasAttribute(b)) return !0;
16
+ return !1;
17
+ }
18
+ function d(r, n) {
19
+ if (!h(n.node)) return n;
20
+ let e = n.node.parentNode;
21
+ for (; e?.parentElement?.hasAttribute(b); ) e = e.parentElement;
22
+ const t = e?.parentNode;
23
+ if (!e || !t) return n;
24
+ const i = Array.prototype.indexOf.call(t.childNodes, e);
25
+ if (i < 0) return n;
26
+ const l = c(e), o = l !== null && r >= u(l).end;
27
+ return { node: t, offset: o ? i + 1 : i };
28
+ }
29
+ function g(r, n, e = "after") {
30
+ const t = m(r);
31
+ if (!t.length) return null;
32
+ let i = null;
33
+ for (let s = 0; s < t.length; s++) {
34
+ const f = t[s], a = u(f);
35
+ if (n < a.start) break;
36
+ if (n < a.end)
37
+ return h(f) && i ? i : d(n, { node: f, offset: n - a.start });
38
+ if (n === a.end && !h(f) && (i = { node: f, offset: f.data.length }, e === "before"))
39
+ return i;
40
+ }
41
+ if (i) return i;
42
+ const l = t.length - 1, o = u(t[l]);
43
+ return n >= o.end ? d(n, { node: t[l], offset: t[l].data.length }) : d(n, { node: t[0], offset: 0 });
44
+ }
45
+ function N(r, n, e) {
46
+ if (n.nodeType === 3) {
47
+ const l = u(n);
48
+ return l ? l.start + Math.min(e, n.data.length) : null;
49
+ }
50
+ const t = n.childNodes[e] ?? null;
51
+ if (t) {
52
+ const l = p(t);
53
+ if (l) return u(l).start;
54
+ }
55
+ const i = n.childNodes[e - 1] ?? null;
56
+ if (i) {
57
+ const l = c(i);
58
+ if (l) return u(l).end;
59
+ }
60
+ return S(r, n);
61
+ }
62
+ function p(r) {
63
+ if (r.nodeType === 3) return u(r) ? r : null;
64
+ for (let n = r.firstChild; n; n = n.nextSibling) {
65
+ const e = p(n);
66
+ if (e) return e;
67
+ }
68
+ return null;
69
+ }
70
+ function c(r) {
71
+ if (r.nodeType === 3) return u(r) ? r : null;
72
+ for (let n = r.lastChild; n; n = n.previousSibling) {
73
+ const e = c(n);
74
+ if (e) return e;
75
+ }
76
+ return null;
77
+ }
78
+ function S(r, n) {
79
+ for (let e = n; e && e !== r.parentNode; e = e.parentNode) {
80
+ for (let t = e.previousSibling; t; t = t.previousSibling) {
81
+ const i = c(t);
82
+ if (i) return u(i).end;
83
+ }
84
+ for (let t = e.nextSibling; t; t = t.nextSibling) {
85
+ const i = p(t);
86
+ if (i) return u(i).start;
87
+ }
88
+ }
89
+ return null;
90
+ }
91
+ function x(r) {
92
+ const n = r.ownerDocument.getSelection();
93
+ if (!n || n.rangeCount === 0 || !n.anchorNode || !r.contains(n.anchorNode)) return null;
94
+ const e = N(r, n.anchorNode, n.anchorOffset), t = n.focusNode && r.contains(n.focusNode) ? N(r, n.focusNode, n.focusOffset) : e;
95
+ return e === null || t === null ? null : { anchor: e, head: t };
96
+ }
97
+ function y(r, n, e = "after") {
98
+ const t = x(r);
99
+ if (t && t.anchor === n.anchor && t.head === n.head) return !1;
100
+ const i = g(r, n.anchor, e), l = n.head === n.anchor ? i : g(r, n.head, e);
101
+ if (!i || !l) return !1;
102
+ const o = r.ownerDocument.getSelection();
103
+ return o ? (o.setBaseAndExtent(i.node, i.offset, l.node, l.offset), !0) : !1;
104
+ }
105
+ export {
106
+ g as domPointAt,
107
+ x as readSelection,
108
+ N as sourceOffsetAt,
109
+ y as writeSelection
110
+ };
111
+ //# sourceMappingURL=position.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.js","sources":["../../../src/lib/markdown/position.ts"],"sourcesContent":["/* ============================================================================\n POSITIONS — a source offset and a place in the DOM, in both directions.\n\n THIS IS THE COST CENTRE, and the research is unambiguous about it. The\n author of both CodeMirror and ProseMirror published on exactly this in\n September 2025: flat offsets are the right choice — moving to them in\n CodeMirror 6 was \"a huge relief\" — but every position you hold must be\n mapped through every change, which \"demands quite a lot of discipline\" and\n \"can get expensive when you're tracking a lot of positions.\"\n\n THE PROJECTION MAKES THIS CHEAP, AND THAT IS ITS WHOLE POINT. Because every\n source character appears in the DOM exactly once and every text node carries\n the range it came from, the mapping is a lookup rather than a model. Nothing\n is maintained between edits, so nothing can drift: after a re-projection the\n stamps are simply correct again. The expensive discipline the article warns\n about is the discipline of keeping a SEPARATE structure in step, and there\n is no separate structure here.\n\n ASSOCIATION. One offset can be two places — the end of one run and the start\n of the next — and which one the caret takes changes what typing does. That is\n a per-node-type product decision (the caret contract), and it is phase 3.\n What this module guarantees is that the choice is EXPLICIT and total: every\n offset resolves, deterministically, to exactly one point.\n ========================================================================= */\n\nimport { rangeOf } from \"./reconcile\";\nimport { SYNTAX_ATTR } from \"./dom\";\n\nexport interface DomPoint {\n /**\n * Usually a text node. It is an ELEMENT when the position has no text of its\n * own to sit in — beside a picture, say, where every character of the\n * construct is markup and every markup node is zero-width. An element point\n * names a place BETWEEN children, which is a position the browser renders a\n * caret for and `sourceOffsetAt` already knows how to read back.\n */\n node: Node;\n offset: number;\n}\n\n/** Which side of a boundary an offset belongs to when two runs meet there. */\nexport type Association = \"before\" | \"after\";\n\n/** Every stamped text node under `root`, in document order. */\nfunction stampedTextNodes(root: Node): Text[] {\n const out: Text[] = [];\n const walk = (node: Node) => {\n if (node.nodeType === 3) {\n if (rangeOf(node)) out.push(node as Text);\n return;\n }\n for (let child = node.firstChild; child; child = child.nextSibling) walk(child);\n };\n walk(root);\n return out;\n}\n\n/**\n * The DOM point for a source offset.\n *\n * Returns null only when the tree holds no stamped text at all — an empty\n * document. Every other offset resolves, including one past the last character,\n * because a caret at the end of a document is the most ordinary thing there is.\n *\n * `association` decides a boundary. \"after\" (the default) puts the caret at the\n * START of the following run, which is where an insertion should land; \"before\"\n * keeps it at the END of the preceding one, which is what a leftward arrow key\n * wants so the caret appears to move rather than to stand still.\n */\n/** True when a text node sits inside a collapsed run of markup. */\nfunction inMarkup(node: Node): boolean {\n for (let at: Node | null = node.parentNode; at; at = at.parentNode) {\n if (at.nodeType === 1 && (at as Element).hasAttribute(SYNTAX_ATTR)) return true;\n }\n return false;\n}\n\n/**\n * The DOM point for a source offset, resolved onto text the caret can occupy.\n *\n * A LEGAL OFFSET CAN STILL LAND IN A ZERO-WIDTH NODE, and the browser will not\n * leave the caret there — it silently moves it to the nearest position with\n * geometry, which is a different offset than the one that was asked for. That\n * is the same failure the old contract's reveal existed to prevent, arriving by\n * a different route: a caret STOP at the very start of `![alt](src)` is the\n * right place to stand, and the node at that offset is the collapsed `![`.\n * Found by the browser probe pressing Delete there and watching it eat the last\n * newline of the document instead of the first letter of the alt text.\n *\n * Every offset in a collapsed run is the same PLACE as the offsets either side\n * of it, so any of them may be used — this walks to the nearest text the caret\n * can actually sit in, forwards first, since a marker is nearly always a prefix\n * of the text it introduces.\n */\nfunction visible(offset: number, point: DomPoint): DomPoint {\n if (!inMarkup(point.node)) return point;\n\n /* BESIDE THE MARKUP, NOT PAST IT. The first version walked to the nearest\n text node instead, which is right whenever the markup is a delimiter — the\n start of `**bold**` and the start of \"bold\" are the same pixel. It is wrong\n the moment the markup is a WIDGET: walking forward out of a footnote\n reference `[^1]` lands past it, so the one caret position in front of it\n resolved to the one behind it, and the arrow keys could not stop there.\n An element point sits between two children and belongs to neither, which is\n exactly what \"beside\" means and what the browser will hold a caret at. */\n let element = point.node.parentNode as Element | null;\n while (element?.parentElement?.hasAttribute(SYNTAX_ATTR)) element = element.parentElement;\n const parent = element?.parentNode;\n if (!element || !parent) return point;\n\n const index = Array.prototype.indexOf.call(parent.childNodes, element);\n if (index < 0) return point;\n\n /* WHICH SIDE IS DECIDED BY THE OFFSET, not by the association. The\n association answers \"which run does a boundary belong to\"; here the\n question is \"is this offset at the front of this widget or the back of\n it\", and only the widget's own range can say. Using the association put\n the caret behind a widget when the LEFT arrow arrived at the position in\n front of it, so Left could not stop there at all. */\n const last = lastStamped(element);\n const after = last !== null && offset >= rangeOf(last)!.end;\n return { node: parent, offset: after ? index + 1 : index };\n}\n\nexport function domPointAt(root: Node, offset: number, association: Association = \"after\"): DomPoint | null {\n const nodes = stampedTextNodes(root);\n if (!nodes.length) return null;\n\n /* A MARKUP NODE IS NEVER A CANDIDATE, at either end of the search. It has no\n geometry, so the browser will not leave a caret in one — it moves it to the\n nearest position that does have geometry, silently, and the model then\n believes the caret is somewhere it is not.\n\n The two directions fail differently and both were caught by the probe.\n Settling on markup for \"after\" at the end of a table cell redirected\n FORWARD into the next cell, so Right skipped the position between them.\n Settling on it for \"before\" at the start of a cell redirected BACKWARD into\n the previous one, so Left skipped it going the other way. Refusing markup\n outright, and letting the loop find the real text on the correct side, is\n one rule instead of two special cases. */\n let last: DomPoint | null = null;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const range = rangeOf(node)!;\n if (offset < range.start) break;\n if (offset < range.end) {\n /* Strictly inside. Content is unambiguous and is the common case; markup\n yields to whatever content is adjacent, on the association's side —\n unless content already ended exactly here, which is a place to stand. */\n if (inMarkup(node) && last) return last;\n return visible(offset, { node, offset: offset - range.start });\n }\n if (offset === range.end && !inMarkup(node)) {\n /* On the boundary. \"before\" settles here; \"after\" keeps looking, and\n falls back to here if nothing usable follows. */\n last = { node, offset: node.data.length };\n if (association === \"before\") return last;\n }\n }\n if (last) return last;\n\n /* Offset past everything stamped, or inside a gap the reconciler did not\n stamp — clamp to the nearest end rather than returning nothing, because a\n caret that cannot be placed is worse than one placed a character away. */\n const tail = nodes.length - 1;\n const range = rangeOf(nodes[tail])!;\n return offset >= range.end\n ? visible(offset, { node: nodes[tail], offset: nodes[tail].data.length })\n : visible(offset, { node: nodes[0], offset: 0 });\n}\n\n/**\n * The source offset for a DOM point.\n *\n * Accepts an ELEMENT container as well as a text node, because that is what a\n * browser hands back: a selection at the start of an empty paragraph, or one\n * that landed between two children, is reported as `(element, childIndex)`.\n * Resolving it here rather than at each call site is the difference between one\n * correct conversion and six approximate ones.\n *\n * Returns null for a point in a subtree this module did not build, which is a\n * REAL event — the browser creates nodes during composition and on paste — and\n * the caller must handle it as one rather than substitute a plausible number.\n */\nexport function sourceOffsetAt(root: Node, node: Node, offset: number): number | null {\n if (node.nodeType === 3) {\n const range = rangeOf(node);\n if (!range) return null;\n return range.start + Math.min(offset, (node as Text).data.length);\n }\n\n /* An element point names a position BETWEEN children. Everything before it in\n document order has been passed; the offset is the end of the last stamped\n text node in that region, or the start of the first one after it. */\n const child = node.childNodes[offset] ?? null;\n if (child) {\n const first = firstStamped(child);\n if (first) return rangeOf(first)!.start;\n }\n const before = node.childNodes[offset - 1] ?? null;\n if (before) {\n const last = lastStamped(before);\n if (last) return rangeOf(last)!.end;\n }\n /* An empty element: fall back to the nearest stamped node in the whole tree\n by walking outward, which is what a caret in an empty paragraph needs. */\n return nearestOutward(root, node);\n}\n\nfunction firstStamped(node: Node): Text | null {\n if (node.nodeType === 3) return rangeOf(node) ? (node as Text) : null;\n for (let child = node.firstChild; child; child = child.nextSibling) {\n const found = firstStamped(child);\n if (found) return found;\n }\n return null;\n}\n\nfunction lastStamped(node: Node): Text | null {\n if (node.nodeType === 3) return rangeOf(node) ? (node as Text) : null;\n for (let child = node.lastChild; child; child = child.previousSibling) {\n const found = lastStamped(child);\n if (found) return found;\n }\n return null;\n}\n\nfunction nearestOutward(root: Node, node: Node): number | null {\n for (let at: Node | null = node; at && at !== root.parentNode; at = at.parentNode) {\n for (let sibling = at.previousSibling; sibling; sibling = sibling.previousSibling) {\n const found = lastStamped(sibling);\n if (found) return rangeOf(found)!.end;\n }\n for (let sibling = at.nextSibling; sibling; sibling = sibling.nextSibling) {\n const found = firstStamped(sibling);\n if (found) return rangeOf(found)!.start;\n }\n }\n return null;\n}\n\n/* --- Selection ------------------------------------------------------------ */\n\nexport interface SourceSelection {\n anchor: number;\n head: number;\n}\n\n/** The current selection as source offsets, or null if it is not in `root`. */\nexport function readSelection(root: HTMLElement): SourceSelection | null {\n const selection = root.ownerDocument.getSelection();\n if (!selection || selection.rangeCount === 0) return null;\n if (!selection.anchorNode || !root.contains(selection.anchorNode)) return null;\n const anchor = sourceOffsetAt(root, selection.anchorNode, selection.anchorOffset);\n const head =\n selection.focusNode && root.contains(selection.focusNode)\n ? sourceOffsetAt(root, selection.focusNode, selection.focusOffset)\n : anchor;\n if (anchor === null || head === null) return null;\n return { anchor, head };\n}\n\n/**\n * Puts the selection at the given source offsets.\n *\n * DOES NOTHING IF IT ALREADY MATCHES. That is the first of the three rules both\n * ProseMirror and CodeMirror carry verbatim: writing a selection that is already\n * correct is itself a source of caret jumps, because some engines scroll,\n * collapse or re-anchor on assignment even when nothing moved.\n */\nexport function writeSelection(root: HTMLElement, selection: SourceSelection, association: Association = \"after\"): boolean {\n const current = readSelection(root);\n if (current && current.anchor === selection.anchor && current.head === selection.head) return false;\n\n const anchor = domPointAt(root, selection.anchor, association);\n const head = selection.head === selection.anchor ? anchor : domPointAt(root, selection.head, association);\n if (!anchor || !head) return false;\n\n const domSelection = root.ownerDocument.getSelection();\n if (!domSelection) return false;\n domSelection.setBaseAndExtent(anchor.node, anchor.offset, head.node, head.offset);\n return true;\n}\n"],"names":["stampedTextNodes","root","out","walk","node","rangeOf","child","inMarkup","at","SYNTAX_ATTR","visible","offset","point","element","parent","index","last","lastStamped","after","domPointAt","association","nodes","i","range","tail","sourceOffsetAt","first","firstStamped","before","nearestOutward","found","sibling","readSelection","selection","anchor","head","writeSelection","current","domSelection"],"mappings":";;AA4CA,SAASA,EAAiBC,GAAoB;AAC5C,QAAMC,IAAc,CAAA,GACdC,IAAO,CAAC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GAAQ,MAAAC,EAAA;AACnB;AAUO,SAASC,EAAenC,GAAmBgC,GAA4Bb,IAA2B,SAAkB;AACzH,QAAMiB,IAAUL,EAAc/B,CAAI;AAClC,MAAIoC,KAAWA,EAAQ,WAAWJ,EAAU,UAAUI,EAAQ,SAASJ,EAAU,KAAM,QAAO;AAE9F,QAAMC,IAASf,EAAWlB,GAAMgC,EAAU,QAAQb,CAAW,GACvDe,IAAOF,EAAU,SAASA,EAAU,SAASC,IAASf,EAAWlB,GAAMgC,EAAU,MAAMb,CAAW;AACxG,MAAI,CAACc,KAAU,CAACC,EAAM,QAAO;AAE7B,QAAMG,IAAerC,EAAK,cAAc,aAAA;AACxC,SAAKqC,KACLA,EAAa,iBAAiBJ,EAAO,MAAMA,EAAO,QAAQC,EAAK,MAAMA,EAAK,MAAM,GACzE,MAFmB;AAG5B;"}
@@ -0,0 +1,108 @@
1
+ import { parseDocument as E } from "../syntax/markdown/parse.js";
2
+ class j extends Error {
3
+ constructor(n) {
4
+ super(n), this.name = "ProjectionError";
5
+ }
6
+ }
7
+ function b(s) {
8
+ const n = [], e = [];
9
+ let f = 0;
10
+ if (E(s, {
11
+ /* Spans are the HIGHLIGHTER's answer, and the projector deliberately does
12
+ not consult them: it classifies from frames, which is the parser saying
13
+ what it MEANT rather than what colour it chose. Two sources of truth for
14
+ the same question is how they drift. */
15
+ span() {
16
+ },
17
+ /* A fenced block's inner grammar is resolved by the VIEW, from the frame's
18
+ own `language` field and content range. Tokenizing here would make a pure
19
+ function depend on grammar-registration order. */
20
+ embed() {
21
+ },
22
+ open(l, o, i) {
23
+ const g = { frame: l, start: o, end: o, content: i ?? [], seq: f++ };
24
+ e.push(g), n.push(g);
25
+ },
26
+ close(l, o) {
27
+ const i = e.pop();
28
+ if (!i) throw new j(`close() with no open frame at ${l}`);
29
+ if (l < i.start)
30
+ throw new j(`frame ${i.frame.kind} closes at ${l}, before its start ${i.start}`);
31
+ i.end = l, o?.length && (i.content = [...i.content, ...o]);
32
+ }
33
+ }), e.length)
34
+ throw new j(`${e.length} frame(s) left open: ${e.map((l) => l.frame.kind).join(", ")}`);
35
+ return n;
36
+ }
37
+ function v(s, n) {
38
+ for (const e of s) if (n >= e.start && n < e.end) return !0;
39
+ return !1;
40
+ }
41
+ function P(s, n, e) {
42
+ let f = e;
43
+ for (const d of s)
44
+ d.start > n && d.start < f && (f = d.start), d.end > n && d.end < f && (f = d.end);
45
+ return f;
46
+ }
47
+ function D(s, n = {}) {
48
+ const e = b(s), f = /* @__PURE__ */ new Map();
49
+ if (n.highlight)
50
+ for (const r of e) {
51
+ if (r.frame.kind !== "codeBody" || !r.content.length) continue;
52
+ const c = r.content[0].start, h = r.content[r.content.length - 1].end;
53
+ f.set(r, n.highlight(s.slice(c, h), r.frame.language, c));
54
+ }
55
+ const d = [...e].sort((r, c) => r.start - c.start || r.seq - c.seq);
56
+ let l = 0, o = 0;
57
+ function i(r, c, h, t) {
58
+ let a = c;
59
+ for (; a < h; ) {
60
+ const u = t ? t.content : null, M = t !== null && t.frame.kind === "image" && u !== null && u.every((p) => p.end === p.start), w = u !== null && !M && !v(u, a);
61
+ let m = u === null ? h : Math.min(P(u, a, h), h);
62
+ const k = t ? f.get(t) : void 0;
63
+ let $;
64
+ if (k && !w) {
65
+ const p = k.find((x) => a >= x.start && a < x.end);
66
+ if (p)
67
+ $ = p.type, m = Math.min(m, p.end);
68
+ else {
69
+ const x = k.find((q) => q.start > a);
70
+ x && (m = Math.min(m, x.start));
71
+ }
72
+ }
73
+ r.push({
74
+ type: "text",
75
+ start: a,
76
+ end: m,
77
+ text: s.slice(a, m),
78
+ syntax: w,
79
+ ...$ ? { token: $ } : {}
80
+ }), a = m;
81
+ }
82
+ }
83
+ function g(r, c, h) {
84
+ for (; o < c; ) {
85
+ const t = d[l];
86
+ if (!t || t.start >= c) {
87
+ i(r, o, c, h), o = c;
88
+ return;
89
+ }
90
+ t.start > o && (i(r, o, t.start, h), o = t.start), l++;
91
+ const a = { type: "element", frame: t.frame, start: t.start, end: t.end, children: [] };
92
+ r.push(a), t.end > t.start && g(a.children, t.end, t), a.children.length || a.children.push({ type: "text", start: t.start, end: t.start, text: "", syntax: !1 }), o = Math.max(o, t.end);
93
+ }
94
+ }
95
+ const y = [];
96
+ return g(y, s.length, null), y.length || y.push({ type: "text", start: 0, end: 0, text: "", syntax: !1 }), { source: s, children: y, frames: e };
97
+ }
98
+ function T(s) {
99
+ let n = "";
100
+ for (const e of s) n += e.type === "text" ? e.text : T(e.children);
101
+ return n;
102
+ }
103
+ export {
104
+ j as ProjectionError,
105
+ D as project,
106
+ T as projectedText
107
+ };
108
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sources":["../../../src/lib/markdown/project.ts"],"sourcesContent":["/* ============================================================================\n THE PROJECTION — one markdown string becomes one tree of elements and text\n runs, and reading its text back reproduces the string BYTE FOR BYTE.\n\n THIS IS THE SPINE OF THE EDITOR, and the invariant is the whole reason it is\n built this way. A WYSIWYG markdown editor has exactly one hard problem:\n knowing, at every moment, which source characters the thing under the caret\n came from. Every published approach to that problem is a mapping maintained\n alongside the document — and the documented failure of all of them is the\n mapping drifting out of step with what is on screen.\n\n So there is no mapping. Every character of the source appears in the\n projection exactly once, in order, including the `**`, the `#`, the `> ` and\n the fence lines. Syntax is not deleted and not replaced; it is MARKED, and\n the view collapses it to zero width until the caret enters it. That is\n Obsidian's mechanism, and it buys four things at once:\n\n - Round-trip is byte-identical BY CONSTRUCTION. Open a document, touch\n nothing, and the bytes cannot move, because nothing serialises anything.\n - Caret to offset is exact and TOTAL. Every source offset is a distinct\n place in the projection, so position 2 of `**bold**` is somewhere the\n caret can genuinely be — and the (offset, association) ambiguity that\n every tree-model editor carries never arises for markers.\n - The \"it reformatted my document\" bug class is structurally impossible.\n - The gate is one assertion over any corpus, and it needs no browser.\n\n WHAT DECIDES SYNTAX FROM CONTENT. Not a token type, and not a table of node\n kinds — the parser says so directly, through the frames it opens. See\n ../syntax/markdown/frames.ts for the rule; this module only applies it.\n\n WHAT THIS MODULE IS NOT. It builds no DOM, imports no React, and reads no\n clock. It is a pure function of a string, in the same shape as the calendar's\n layout core, and for the same reason: an interaction layer sitting on top of\n a testable pure core is the only arrangement in which either can be trusted.\n ========================================================================= */\n\nimport type { Frame, FrameRecord, Range } from \"../syntax/markdown/frames\";\nimport { parseDocument } from \"../syntax/markdown/parse\";\nimport type { Sink } from \"../syntax/markdown/spans\";\n\n/* --- The projected tree --------------------------------------------------- */\n\n/**\n * A run of literal source characters.\n *\n * `syntax` is what the view collapses. It is not a rendering hint — it is the\n * parser's own answer to \"did any frame claim this as its text\", so a run that\n * says `syntax: false` is genuinely editable prose and one that says true is\n * genuinely markup.\n */\nexport interface PText {\n type: \"text\";\n start: number;\n end: number;\n text: string;\n syntax: boolean;\n /**\n * The highlight class this run carries, inside a fenced block.\n *\n * Only ever set for code, and only when a tokenizer was supplied. Prose stays\n * untyped so it stays a BARE text node — see ../markdown/dom.ts, constraint 3:\n * every wrapper around prose is another reason to replace a node, and a\n * replaced node is a cancelled composition.\n */\n token?: string;\n}\n\n/** How a fenced block's body is highlighted, if the caller wants it. */\nexport interface ProjectOptions {\n /**\n * Returns tokens with ABSOLUTE offsets into `source`, exactly as\n * `lib/syntax`'s `tokenize` does.\n *\n * Injected rather than imported, and the reason is the same one the module\n * header gives for not tokenizing at all before: reaching for the grammar\n * REGISTRY from here would make a pure function's output depend on which\n * languages happened to be registered when it ran. Passing it in keeps the\n * projection reproducible and keeps this module's tests grammar-free.\n */\n highlight?: (code: string, language: string | null, at: number) => Array<{ start: number; end: number; type: string }>;\n}\n\n/** A frame with its projected children, in source order. */\nexport interface PElement {\n type: \"element\";\n frame: Frame;\n start: number;\n end: number;\n children: PNode[];\n}\n\nexport type PNode = PText | PElement;\n\n/** The document root. `source` is kept so consumers never re-derive it. */\nexport interface Projection {\n source: string;\n children: PNode[];\n /** Every frame, in the order the parser opened them. */\n frames: readonly FrameRecord[];\n}\n\n/* --- Collecting the parser's report --------------------------------------- */\n\n/**\n * Thrown when the parser's frames do not nest, which would make the projection\n * ambiguous.\n *\n * This is a FAIL-LOUD, not a repair. A projector that silently reordered\n * overlapping frames would produce a tree that reads correctly and maps the\n * caret to the wrong character — the exact defect this whole design exists to\n * make impossible, reintroduced by the code meant to prevent it.\n */\nexport class ProjectionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ProjectionError\";\n }\n}\n\nfunction collect(source: string): FrameRecord[] {\n const frames: FrameRecord[] = [];\n /* Open frames, innermost last. `close` pops, so nesting comes from the\n parser's own call order rather than from comparing intervals — which is\n what makes two frames sharing a start unambiguous. */\n const stack: FrameRecord[] = [];\n let seq = 0;\n\n const sink: Sink = {\n /* Spans are the HIGHLIGHTER's answer, and the projector deliberately does\n not consult them: it classifies from frames, which is the parser saying\n what it MEANT rather than what colour it chose. Two sources of truth for\n the same question is how they drift. */\n span() {},\n /* A fenced block's inner grammar is resolved by the VIEW, from the frame's\n own `language` field and content range. Tokenizing here would make a pure\n function depend on grammar-registration order. */\n embed() {},\n open(frame, start, content) {\n const record: FrameRecord = { frame, start, end: start, content: content ?? [], seq: seq++ };\n stack.push(record);\n frames.push(record);\n },\n close(end, content) {\n const record = stack.pop();\n if (!record) throw new ProjectionError(`close() with no open frame at ${end}`);\n if (end < record.start) {\n throw new ProjectionError(`frame ${record.frame.kind} closes at ${end}, before its start ${record.start}`);\n }\n record.end = end;\n if (content?.length) record.content = [...record.content, ...content];\n },\n };\n\n parseDocument(source, sink);\n if (stack.length) {\n throw new ProjectionError(`${stack.length} frame(s) left open: ${stack.map((f) => f.frame.kind).join(\", \")}`);\n }\n return frames;\n}\n\n/* --- Classification ------------------------------------------------------- */\n\nfunction inRanges(ranges: readonly Range[], at: number): boolean {\n for (const range of ranges) if (at >= range.start && at < range.end) return true;\n return false;\n}\n\n/**\n * The next offset at or after `at` where classification could change, bounded\n * by `limit`.\n *\n * Walking character by character would be correct and is what the first version\n * did; this exists because the projection is rebuilt on every keystroke and a\n * long document has hundreds of thousands of characters that cannot possibly\n * change class. Only a range EDGE can change the answer.\n */\nfunction nextEdge(ranges: readonly Range[], at: number, limit: number): number {\n let edge = limit;\n for (const range of ranges) {\n if (range.start > at && range.start < edge) edge = range.start;\n if (range.end > at && range.end < edge) edge = range.end;\n }\n return edge;\n}\n\n/* --- The walk ------------------------------------------------------------- */\n\n/**\n * Projects a markdown string.\n *\n * The walk is linear over the SOURCE, descending into a frame when it starts\n * and leaving when it ends. Every character is emitted exactly once, by\n * exactly one of the two paths — inside a frame or at the document level —\n * which is the invariant stated as an algorithm rather than as a test.\n */\nexport function project(source: string, options: ProjectOptions = {}): Projection {\n const frames = collect(source);\n\n /**\n * Highlight tokens for every fenced block, keyed by the frame that owns them.\n *\n * Computed once per projection rather than per run: a fence's body is one\n * tokenizer call, and calling it again for each line would re-parse the block\n * as many times as it has lines.\n */\n const highlights = new Map<FrameRecord, Array<{ start: number; end: number; type: string }>>();\n if (options.highlight) {\n for (const record of frames) {\n /* Keyed on the BODY frame, never on the block. The block's own content\n is the newline it claims as its terminator (see `endBlock`), so keying\n it there hands the tokenizer a lone \"\n\" and types nothing that is\n actually code — which is exactly what the first version did. */\n if (record.frame.kind !== \"codeBody\" || !record.content.length) continue;\n const from = record.content[0].start;\n const to = record.content[record.content.length - 1].end;\n highlights.set(record, options.highlight(source.slice(from, to), record.frame.language, from));\n }\n }\n\n /* Sorted by start, then by EMISSION ORDER (`seq`) — never by width.\n `collect()`'s own comment already states the reason: the parser's stack\n opens a frame before any frame nested inside it, so when two frames share\n a start, the one opened FIRST is always the outer one — by construction,\n not by comparing intervals.\n\n A width-based tie-break (\"the wider frame is the parent\") looks\n equivalent and is not: it also fires for two SIBLINGS that merely touch\n at a point, which happens whenever a piece trims down to zero\n characters — an empty table cell, notably, since `toCell()` opens and\n closes it at the same offset when its trimmed text is \"\". The very next\n call in `readRow()` opens that cell's trailing `tableGutter` at that same\n offset, wider by construction (it spans to the next cell). Sorting the\n wider gutter first made `walk()` descend into it BEFORE the zero-width\n cell was consumed, so the cell was appended as the gutter's CHILD instead\n of the row's next sibling — an invalid `<td>` nested inside a `<td>` once\n `dom.ts` tags it, which the browser's own table column algorithm then\n cannot count as a real column. `overflow-wrap: anywhere` (authored.css)\n was left to wrap the header text of whichever column shared that index\n one character per line, since the column had nothing left to size it by.\n\n `seq` alone resolves both cases correctly: a genuine parent is always\n opened (pushed) before anything nested inside it, so it already has the\n lower `seq`; a zero-width cell is opened and closed before its own\n trailing gutter is ever opened, so it also has the lower `seq` — meaning\n `walk()` consumes the empty cell first, adds it as a normal (empty) leaf\n since a zero-width frame never recurses into a child walk, and only then\n reaches the gutter as what it actually is: the next sibling in the same\n row. */\n const ordered = [...frames].sort((a, b) => a.start - b.start || a.seq - b.seq);\n\n let index = 0;\n let cursor = 0;\n\n /** Emits source `[from, to)` as text runs, split at classification edges. */\n function emitText(out: PNode[], from: number, to: number, owner: FrameRecord | null): void {\n let at = from;\n while (at < to) {\n /* MARKUP IS A PROPERTY OF BEING INSIDE A CONSTRUCT AND NOT BEING ITS\n TEXT. Outside every frame there is no construct, so there is nothing\n for a character to be the markup OF — the blank line between two blocks\n is the document's own vertical space, not a marker like `#` or `**`.\n\n An earlier version \"unified\" this to markup for tidiness and the\n browser probe found what that costs: collapse the newline that ends a\n line and the line stops existing, so the caret cannot be put after it\n and Enter appears to do nothing. Every source line is a line on screen;\n that is what makes every offset addressable, and it is the same\n one-to-one model Obsidian's Live Preview uses.\n\n Note what this does NOT loosen: a newline between two table rows is\n inside the table frame, unclaimed, and therefore still markup — which\n is correct, because the `<tr>` provides that break itself. The rule\n gets both cases right without knowing about either. */\n const ranges = owner ? owner.content : null;\n /* An IMAGE with an EMPTY label (`![]()`) would collapse to nothing at all, and its author could neither see nor\n fix it (DX-3134). Its source stays visible instead. A link with no label is unchanged. */\n const unlabelled = owner !== null && owner.frame.kind === \"image\" && ranges !== null && ranges.every((range) => range.end === range.start);\n const syntax = ranges !== null && !unlabelled && !inRanges(ranges, at);\n let edge = ranges === null ? to : Math.min(nextEdge(ranges, at, to), to);\n\n /* A fenced block's BODY splits further, at token boundaries, so each run\n can carry a highlight class. Only the body — the fence lines are markup\n and are already their own runs. The extra boundaries change no\n characters, so the invariant does not notice them. */\n const tokens = owner ? highlights.get(owner) : undefined;\n let token: string | undefined;\n if (tokens && !syntax) {\n const inside = tokens.find((t) => at >= t.start && at < t.end);\n if (inside) {\n token = inside.type;\n edge = Math.min(edge, inside.end);\n } else {\n const after = tokens.find((t) => t.start > at);\n if (after) edge = Math.min(edge, after.start);\n }\n }\n\n out.push({\n type: \"text\",\n start: at,\n end: edge,\n text: source.slice(at, edge),\n syntax,\n ...(token ? { token } : {}),\n });\n at = edge;\n }\n }\n\n function walk(out: PNode[], until: number, owner: FrameRecord | null): void {\n while (cursor < until) {\n const next = ordered[index];\n if (!next || next.start >= until) {\n emitText(out, cursor, until, owner);\n cursor = until;\n return;\n }\n if (next.start > cursor) {\n emitText(out, cursor, next.start, owner);\n cursor = next.start;\n }\n /* A zero-width frame consumes nothing and would spin the loop forever if\n it were not stepped over explicitly. They are legal — an empty table\n cell is one — and they still carry structure. */\n index++;\n const element: PElement = { type: \"element\", frame: next.frame, start: next.start, end: next.end, children: [] };\n out.push(element);\n if (next.end > next.start) walk(element.children, next.end, next);\n /* An element holding no characters still needs a place the caret can BE —\n an empty table cell, a list item with no text yet. A zero-length run is\n that place: it contributes nothing to the projected text, so the\n invariant is untouched, and it gives position mapping something to\n resolve to. Without it the caret cannot enter the element at all, which\n reads as \"the editor ignores my click\". */\n if (!element.children.length) {\n element.children.push({ type: \"text\", start: next.start, end: next.start, text: \"\", syntax: false });\n }\n cursor = Math.max(cursor, next.end);\n }\n }\n\n const children: PNode[] = [];\n walk(children, source.length, null);\n /* THE EMPTY DOCUMENT, which is where every editor starts and which the first\n browser probe found immediately: with no nodes at all there is no position,\n so the caret cannot be placed and the surface reads as inert. Same fix as\n an empty element above, at the document level. */\n if (!children.length) children.push({ type: \"text\", start: 0, end: 0, text: \"\", syntax: false });\n /* No document-tail branch below this line. `walk` does not return until its\n `until` is reached, so a top-level call with `source.length` has by\n definition emitted every character — and the guard harness proved it: a\n deliberate break that deleted the tail handling stayed GREEN across the\n whole corpus, because the branch was unreachable. An unreachable repair\n path is worse than none; it reads as insurance nobody has to think about. */\n\n return { source, children, frames };\n}\n\n/* --- The invariant, as a function ----------------------------------------- */\n\n/**\n * Reads a projection's text back, in document order.\n *\n * Deliberately dumb — no knowledge of frames, no special cases. The moment this\n * function needs to know what a table is, the invariant has stopped being an\n * invariant.\n */\nexport function projectedText(nodes: readonly PNode[]): string {\n let out = \"\";\n for (const node of nodes) out += node.type === \"text\" ? node.text : projectedText(node.children);\n return out;\n}\n"],"names":["ProjectionError","message","collect","source","frames","stack","seq","parseDocument","frame","start","content","record","end","f","inRanges","ranges","at","range","nextEdge","limit","edge","project","options","highlights","from","to","ordered","a","b","index","cursor","emitText","out","owner","unlabelled","syntax","tokens","token","inside","t","after","walk","until","next","element","children","projectedText","nodes","node"],"mappings":";AAgHO,MAAMA,UAAwB,MAAM;AAAA,EACzC,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;AAEA,SAASC,EAAQC,GAA+B;AAC9C,QAAMC,IAAwB,CAAA,GAIxBC,IAAuB,CAAA;AAC7B,MAAIC,IAAM;AA6BV,MADAC,EAAcJ,GA1BK;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjB,OAAO;AAAA,IAAC;AAAA;AAAA;AAAA;AAAA,IAIR,QAAQ;AAAA,IAAC;AAAA,IACT,KAAKK,GAAOC,GAAOC,GAAS;AAC1B,YAAMC,IAAsB,EAAE,OAAAH,GAAO,OAAAC,GAAO,KAAKA,GAAO,SAASC,KAAW,CAAA,GAAI,KAAKJ,IAAA;AACrF,MAAAD,EAAM,KAAKM,CAAM,GACjBP,EAAO,KAAKO,CAAM;AAAA,IACpB;AAAA,IACA,MAAMC,GAAKF,GAAS;AA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
@@ -0,0 +1,127 @@
1
+ import { SYNTAX_ATTR as x, sameElement as E, tagFor as N, FRAME_ATTR as w } from "./dom.js";
2
+ const a = "__mdFrame", d = "__mdRange";
3
+ class p extends Error {
4
+ constructor(e) {
5
+ super(e), this.name = "CompositionConflictError";
6
+ }
7
+ }
8
+ function b(t, e) {
9
+ const r = t.createTextNode(e.text);
10
+ if (r[d] = { start: e.start, end: e.end }, !e.syntax && !e.token) return r;
11
+ const n = t.createElement("span");
12
+ return e.syntax && n.setAttribute(x, ""), e.token && n.setAttribute(g, e.token), n.appendChild(r), n;
13
+ }
14
+ const g = "data-t";
15
+ function R(t, e) {
16
+ const r = N(e.frame), n = t.createElement(r.tag);
17
+ n.setAttribute(w, e.frame.kind);
18
+ for (const [i, l] of Object.entries(r.attrs ?? {})) n.setAttribute(i, l);
19
+ return n[a] = e.frame, n;
20
+ }
21
+ function f(t, e) {
22
+ if (e.type === "text") return b(t, e);
23
+ const r = R(t, e);
24
+ for (const n of e.children) r.appendChild(f(t, n));
25
+ return r;
26
+ }
27
+ function _(t, e) {
28
+ if (!t) return null;
29
+ if (!(e.syntax || !!e.token)) return t.nodeType === 3 ? t : null;
30
+ if (t.nodeType !== 1) return null;
31
+ const n = t;
32
+ if (n.hasAttribute(x) !== e.syntax || n.getAttribute(g) !== (e.token ?? null)) return null;
33
+ const i = n.firstChild;
34
+ return n.childNodes.length === 1 && i && i.nodeType === 3 ? i : null;
35
+ }
36
+ function F(t, e) {
37
+ if (!t || t.nodeType !== 1) return null;
38
+ const r = t, n = r[a];
39
+ return n && E(n, e.frame) ? r : null;
40
+ }
41
+ function K(t, e, r) {
42
+ const n = { textUpdated: 0, textUntouched: 0, elementsReused: 0, created: 0, removed: 0 }, i = t.lastChild && O(t.lastChild) ? t.lastChild : null;
43
+ if (i && t.removeChild(i), C(t, e, { protect: r.protect ?? null, stats: n }), v(e)) {
44
+ const l = i ?? k(t.ownerDocument);
45
+ i || n.created++, t.appendChild(l);
46
+ }
47
+ return n;
48
+ }
49
+ const A = "data-md-filler";
50
+ function k(t) {
51
+ const e = t.createElement("br");
52
+ return e.setAttribute(A, ""), e;
53
+ }
54
+ function O(t) {
55
+ return t.nodeType === 1 && t.hasAttribute(A);
56
+ }
57
+ function T(t) {
58
+ for (let e = t.length - 1; e >= 0; e--) {
59
+ const r = t[e];
60
+ if (r.type === "text") {
61
+ if (r.text.length) return r.text[r.text.length - 1];
62
+ continue;
63
+ }
64
+ const n = T(r.children);
65
+ if (n !== null) return n;
66
+ }
67
+ return null;
68
+ }
69
+ function v(t) {
70
+ return T(t) === `
71
+ `;
72
+ }
73
+ function C(t, e, r) {
74
+ const n = t.ownerDocument, { protect: i, stats: l } = r;
75
+ for (let c = 0; c < e.length; c++) {
76
+ const o = e[c], h = t.childNodes[c] ?? null;
77
+ if (o.type === "text") {
78
+ const s = _(h, o);
79
+ if (s) {
80
+ if (s.data === o.text)
81
+ l.textUntouched++;
82
+ else {
83
+ if (s === i)
84
+ throw new p(
85
+ `a patch would rewrite the composing text node (${JSON.stringify(s.data)} to ${JSON.stringify(o.text)})`
86
+ );
87
+ s.data = o.text, l.textUpdated++;
88
+ }
89
+ s[d] = { start: o.start, end: o.end };
90
+ continue;
91
+ }
92
+ m(t, c, f(n, o), i, l);
93
+ continue;
94
+ }
95
+ const u = F(h, o);
96
+ if (u) {
97
+ u[a] = o.frame, l.elementsReused++, C(u, o.children, r);
98
+ continue;
99
+ }
100
+ m(t, c, f(n, o), i, l);
101
+ }
102
+ for (; t.childNodes.length > e.length; ) {
103
+ const c = t.childNodes[t.childNodes.length - 1];
104
+ y(c, i, "removed"), t.removeChild(c), l.removed++;
105
+ }
106
+ }
107
+ function m(t, e, r, n, i) {
108
+ const l = t.childNodes[e] ?? null;
109
+ if (i.created++, !l) {
110
+ t.appendChild(r);
111
+ return;
112
+ }
113
+ y(l, n, "replaced"), t.replaceChild(r, l);
114
+ }
115
+ function y(t, e, r) {
116
+ if (e && (t === e || t.contains(e)))
117
+ throw new p(`a patch would have ${r} the composing text node`);
118
+ }
119
+ function S(t) {
120
+ return t[d] ?? null;
121
+ }
122
+ export {
123
+ p as CompositionConflictError,
124
+ K as patch,
125
+ S as rangeOf
126
+ };
127
+ //# sourceMappingURL=reconcile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.js","sources":["../../../src/lib/markdown/reconcile.ts"],"sourcesContent":["/* ============================================================================\n THE RECONCILER — patches the editable DOM in place, preserving node identity.\n\n THIS IS THE PART THAT KILLS EDITORS, so it is built first and on purpose.\n Slate shipped a from-scratch re-render of a contenteditable and closed the\n resulting bug as unfixable, in their own words: \"There are composition bugs\n that cannot be fixed… IME has a reference of a specific text node during\n composition. However, when react re-renders the editor, the text node no\n longer exists.\"\n\n All three mature editors carry dedicated machinery for exactly one thing —\n keeping ONE Text node's OBJECT IDENTITY alive across an update. ProseMirror\n orphans it out of the reconciler and destroys its siblings; CodeMirror marks\n its tile reused and bails out entirely if the node is multi-line or not\n byte-identical to the document slice; Lexical never assigns `nodeValue` while\n composing and diffs with `deleteData`/`insertData` on the same object.\n\n So this module has three rules, and they are the whole design:\n\n 1. NEVER REPLACE WHAT CAN BE UPDATED. A text node whose data changed keeps\n its object and takes a new `data`. An element whose frame still\n describes the same element keeps its object and is patched in place.\n 2. NEVER WRITE WHAT DID NOT CHANGE. Assigning identical `data` to a Text\n node still resets the selection in some engines, so an unchanged node is\n not touched at all. This is CodeMirror's rule, verbatim.\n 3. NEVER TOUCH THE PROTECTED NODE. During composition the browser owns one\n text node. It is passed in, and this module will not write it, will not\n move it, and will not remove it — it refuses the patch instead, loudly.\n\n WHY THIS IS NOT REACT. React owns the DOM it renders and reconciles on its\n own schedule; a contenteditable is owned by the browser, which mutates it\n mid-keystroke. The two cannot both be in charge. React renders the chrome —\n toolbar, popovers, footer — and the editable surface is plain DOM, patched\n here. That also disposes of the `dangerouslySetInnerHTML` question rather\n than answering it: no HTML string is ever produced.\n ========================================================================= */\n\nimport type { PElement, PNode, PText } from \"./project\";\nimport { FRAME_ATTR, SYNTAX_ATTR, sameElement, tagFor } from \"./dom\";\n\n/** Where the reconciler stashes the frame it built an element from. */\nconst FRAME_KEY = \"__mdFrame\";\n/** Where it stashes the source range of a text node's owning run. */\nconst RANGE_KEY = \"__mdRange\";\n\ninterface Tagged {\n [FRAME_KEY]?: PElement[\"frame\"];\n [RANGE_KEY]?: { start: number; end: number };\n}\n\n/**\n * Thrown when a patch would have had to disturb the node the browser is\n * composing into.\n *\n * Loud rather than silent because the caller's contract is to DEFER the patch\n * until `compositionend`, and a reconciler that quietly skipped the change\n * would leave the DOM disagreeing with the model — which is the same corruption\n * one step later, with nothing pointing at the cause.\n */\nexport class CompositionConflictError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"CompositionConflictError\";\n }\n}\n\nexport interface PatchOptions {\n /**\n * The text node the browser is composing into. Never written, moved or\n * removed; a patch that would need to do any of those throws.\n */\n protect?: Text | null;\n}\n\nexport interface PatchStats {\n /** Text nodes whose `data` was assigned. */\n textUpdated: number;\n /** Text nodes left alone because their data already matched. */\n textUntouched: number;\n /** Elements reused in place. */\n elementsReused: number;\n /** Nodes created, which is the number the caret can be disturbed by. */\n created: number;\n removed: number;\n}\n\n/* --- Node construction ---------------------------------------------------- */\n\nfunction createText(doc: Document, node: PText): Node {\n const text = doc.createTextNode(node.text);\n (text as Text & Tagged)[RANGE_KEY] = { start: node.start, end: node.end };\n\n /* PROSE STAYS A BARE TEXT NODE — see ./dom.ts, constraint 3. Two things get a\n wrapper and both earn it: markup, because collapsing it needs a styling\n hook, and a highlighted run inside a fenced block, because a colour needs\n an element to sit on. Nothing else. */\n if (!node.syntax && !node.token) return text;\n\n const span = doc.createElement(\"span\");\n if (node.syntax) span.setAttribute(SYNTAX_ATTR, \"\");\n if (node.token) span.setAttribute(TOKEN_ATTR, node.token);\n span.appendChild(text);\n return span;\n}\n\n/** Carries a fenced block's highlight class; matches the CodeEditor's own. */\nconst TOKEN_ATTR = \"data-t\";\n\nfunction createElement(doc: Document, node: PElement): HTMLElement {\n const spec = tagFor(node.frame);\n const element = doc.createElement(spec.tag);\n element.setAttribute(FRAME_ATTR, node.frame.kind);\n for (const [key, value] of Object.entries(spec.attrs ?? {})) element.setAttribute(key, value);\n (element as HTMLElement & Tagged)[FRAME_KEY] = node.frame;\n return element;\n}\n\n/** What one patch needs to carry down the tree, beyond the nodes themselves. */\ninterface PatchContext {\n protect: Text | null;\n stats: PatchStats;\n}\n\nfunction build(doc: Document, node: PNode): Node {\n if (node.type === \"text\") return createText(doc, node);\n const element = createElement(doc, node);\n for (const child of node.children) element.appendChild(build(doc, child));\n return element;\n}\n\n/* --- Matching ------------------------------------------------------------- */\n\n/** The Text node a projected run would occupy, if `have` can serve it. */\nfunction textNodeFor(have: Node | null, node: PText): Text | null {\n if (!have) return null;\n const wrapped = node.syntax || !!node.token;\n if (!wrapped) return have.nodeType === 3 ? (have as Text) : null;\n if (have.nodeType !== 1) return null;\n const element = have as HTMLElement;\n /* The wrapper has to be the RIGHT wrapper. A run whose highlight class\n changed — code edited until a keyword became an identifier — needs a new\n span, and reusing the old one would leave the colour stale forever. */\n if (element.hasAttribute(SYNTAX_ATTR) !== node.syntax) return null;\n if (element.getAttribute(TOKEN_ATTR) !== (node.token ?? null)) return null;\n const first = element.firstChild;\n return element.childNodes.length === 1 && first && first.nodeType === 3 ? (first as Text) : null;\n}\n\nfunction elementFor(have: Node | null, node: PElement): HTMLElement | null {\n if (!have || have.nodeType !== 1) return null;\n const element = have as HTMLElement & Tagged;\n const previous = element[FRAME_KEY];\n if (!previous) return null;\n return sameElement(previous, node.frame) ? element : null;\n}\n\n/* --- The patch ------------------------------------------------------------ */\n\n/**\n * Brings `parent`'s children into agreement with `nodes`.\n *\n * Positional rather than keyed, deliberately. A keyed diff by source offset\n * looks more sophisticated and is worse here: every offset after an edit shifts\n * by the length of that edit, so keys change for the whole rest of the document\n * on every keystroke and the diff replaces everything the user has not touched.\n * Position is stable under exactly the edits that matter — a change in the\n * middle of a paragraph leaves the paragraph at the same index.\n */\nexport function patch(parent: HTMLElement, nodes: readonly PNode[], options: PatchOptions): PatchStats {\n const stats: PatchStats = { textUpdated: 0, textUntouched: 0, elementsReused: 0, created: 0, removed: 0 };\n /* Detached before the patch and re-attached after, rather than left for the\n surplus-child loop to delete and rebuild: the SAME element comes back, so\n a document that ends with a newline does not churn one node per keystroke. */\n const existing = parent.lastChild && isFiller(parent.lastChild) ? (parent.lastChild as HTMLElement) : null;\n if (existing) parent.removeChild(existing);\n\n patchInto(parent, nodes, { protect: options.protect ?? null, stats });\n\n if (endsWithNewline(nodes)) {\n const filler = existing ?? makeFiller(parent.ownerDocument);\n if (!existing) stats.created++;\n parent.appendChild(filler);\n }\n return stats;\n}\n\n/** Marks the trailing line affordance, so it is recognised and never mapped. */\nconst FILLER_ATTR = \"data-md-filler\";\n\n/**\n * A `<br>` after a document that ends with a newline.\n *\n * NOT COSMETIC. CSS does not render a line box for a trailing line break — the\n * last one is dropped, by specification — so the empty final line of a document\n * does not exist as a place, and a caret written there is relocated by the\n * browser to the end of the previous line. The browser probe found this as\n * Enter putting its newline in the right place and then the NEXT keystroke\n * landing before it: the model said offset 4 and `getTargetRanges` said 3.\n *\n * Every editor carries this affordance, and `<textarea>` gets it from the\n * engine for free. It holds no text, so the projection invariant does not see\n * it, and it carries no source range, so position mapping skips it.\n */\nfunction makeFiller(doc: Document): HTMLElement {\n const br = doc.createElement(\"br\");\n br.setAttribute(FILLER_ATTR, \"\");\n return br;\n}\n\nfunction isFiller(node: Node): boolean {\n return node.nodeType === 1 && (node as HTMLElement).hasAttribute(FILLER_ATTR);\n}\n\n/**\n * Whether the projected text ends with a newline, without rebuilding it.\n *\n * `null` means \"this subtree holds no characters at all\", which is distinct\n * from \"it ends with something other than a newline\" — an empty element must\n * not stop the search, or a zero-length anchor before the real last run would\n * answer for it.\n */\nfunction lastCharacter(nodes: readonly PNode[]): string | null {\n for (let i = nodes.length - 1; i >= 0; i--) {\n const node = nodes[i];\n if (node.type === \"text\") {\n if (node.text.length) return node.text[node.text.length - 1];\n continue;\n }\n const inner = lastCharacter(node.children);\n if (inner !== null) return inner;\n }\n return null;\n}\n\nfunction endsWithNewline(nodes: readonly PNode[]): boolean {\n return lastCharacter(nodes) === \"\\n\";\n}\n\nfunction patchInto(parent: HTMLElement, nodes: readonly PNode[], context: PatchContext): void {\n const doc = parent.ownerDocument;\n const { protect, stats } = context;\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const have = parent.childNodes[i] ?? null;\n\n if (node.type === \"text\") {\n const text = textNodeFor(have, node);\n if (text) {\n if (text.data === node.text) {\n stats.textUntouched++;\n } else if (text === protect) {\n throw new CompositionConflictError(\n `a patch would rewrite the composing text node (${JSON.stringify(text.data)} to ${JSON.stringify(node.text)})`,\n );\n } else {\n text.data = node.text;\n stats.textUpdated++;\n }\n (text as Text & Tagged)[RANGE_KEY] = { start: node.start, end: node.end };\n continue;\n }\n replaceAt(parent, i, build(doc, node), protect, stats);\n continue;\n }\n\n const element = elementFor(have, node);\n if (element) {\n (element as HTMLElement & Tagged)[FRAME_KEY] = node.frame;\n stats.elementsReused++;\n patchInto(element, node.children, context);\n continue;\n }\n replaceAt(parent, i, build(doc, node), protect, stats);\n }\n\n while (parent.childNodes.length > nodes.length) {\n const last = parent.childNodes[parent.childNodes.length - 1];\n guard(last, protect, \"removed\");\n parent.removeChild(last);\n stats.removed++;\n }\n}\n\nfunction replaceAt(parent: HTMLElement, index: number, fresh: Node, protect: Text | null, stats: PatchStats): void {\n const have = parent.childNodes[index] ?? null;\n stats.created++;\n if (!have) {\n parent.appendChild(fresh);\n return;\n }\n guard(have, protect, \"replaced\");\n parent.replaceChild(fresh, have);\n}\n\n/** Refuses any structural change that would take the composing node with it. */\nfunction guard(node: Node, protect: Text | null, what: string): void {\n if (!protect) return;\n if (node === protect || node.contains(protect)) {\n throw new CompositionConflictError(`a patch would have ${what} the composing text node`);\n }\n}\n\n/* --- Reading the DOM back ------------------------------------------------- */\n\n/**\n * The source range a text node carries, or null if it was not built here.\n *\n * The range is stamped on the node rather than looked up in a side table on\n * purpose: a WeakMap keyed by node is the same information one indirection\n * away, and the indirection is where a stale entry hides. A node that has no\n * stamp is a node the browser created — which is a real event during\n * composition, and the caller must treat it as one rather than guess.\n */\nexport function rangeOf(node: Node): { start: number; end: number } | null {\n return (node as Node & Tagged)[RANGE_KEY] ?? null;\n}\n\n/**\n * Reads every text node under `root` in document order and joins it.\n *\n * This is the projection invariant, asserted against the REAL DOM rather than\n * against the projection tree — which is a different claim and the one that\n * actually matters. The tree can be right while the reconciler drops a node.\n */\nexport function domText(root: Node): string {\n let out = \"\";\n const walk = (node: Node) => {\n if (node.nodeType === 3) {\n out += (node as Text).data;\n return;\n }\n for (let child = node.firstChild; child; child = child.nextSibling) walk(child);\n };\n walk(root);\n return out;\n}\n"],"names":["FRAME_KEY","RANGE_KEY","CompositionConflictError","message","createText","doc","node","text","span","SYNTAX_ATTR","TOKEN_ATTR","createElement","spec","tagFor","element","FRAME_ATTR","key","value","build","child","textNodeFor","have","first","elementFor","previous","sameElement","patch","parent","nodes","options","stats","existing","isFiller","patchInto","endsWithNewline","filler","makeFiller","FILLER_ATTR","br","lastCharacter","i","inner","context","protect","replaceAt","last","guard","index","fresh","what","rangeOf"],"mappings":";AAyCA,MAAMA,IAAY,aAEZC,IAAY;AAgBX,MAAMC,UAAiC,MAAM;AAAA,EAClD,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;AAwBA,SAASC,EAAWC,GAAeC,GAAmB;AACpD,QAAMC,IAAOF,EAAI,eAAeC,EAAK,IAAI;AAOzC,MANCC,EAAuBN,CAAS,IAAI,EAAE,OAAOK,EAAK,OAAO,KAAKA,EAAK,IAAA,GAMhE,CAACA,EAAK,UAAU,CAACA,EAAK,MAAO,QAAOC;AAExC,QAAMC,IAAOH,EAAI,cAAc,MAAM;AACrC,SAAIC,EAAK,UAAQE,EAAK,aAAaC,GA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