@qoretechnologies/reqore 0.76.0-pr.673.g960750c → 0.76.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 (677) hide show
  1. package/.claude/CLAUDE.md +2 -32
  2. package/dist/components/Accordion/index.js +89 -53
  3. package/dist/components/Accordion/index.js.map +1 -1
  4. package/dist/components/Breadcrumbs/index.js +71 -33
  5. package/dist/components/Breadcrumbs/index.js.map +1 -1
  6. package/dist/components/Breadcrumbs/item.js +13 -8
  7. package/dist/components/Breadcrumbs/item.js.map +1 -1
  8. package/dist/components/Bubble/index.js +93 -53
  9. package/dist/components/Bubble/index.js.map +1 -1
  10. package/dist/components/Button/index.d.ts +11 -1
  11. package/dist/components/Button/index.d.ts.map +1 -1
  12. package/dist/components/Button/index.js +156 -114
  13. package/dist/components/Button/index.js.map +1 -1
  14. package/dist/components/Callout/index.js +84 -45
  15. package/dist/components/Callout/index.js.map +1 -1
  16. package/dist/components/Checkbox/index.js +106 -68
  17. package/dist/components/Checkbox/index.js.map +1 -1
  18. package/dist/components/Collapse/index.js +56 -19
  19. package/dist/components/Collapse/index.js.map +1 -1
  20. package/dist/components/CollapsibleContent/index.js +78 -39
  21. package/dist/components/CollapsibleContent/index.js.map +1 -1
  22. package/dist/components/Collection/index.d.ts +7 -8
  23. package/dist/components/Collection/index.d.ts.map +1 -1
  24. package/dist/components/Collection/index.js +117 -75
  25. package/dist/components/Collection/index.js.map +1 -1
  26. package/dist/components/Collection/item.js +73 -33
  27. package/dist/components/Collection/item.js.map +1 -1
  28. package/dist/components/Columns/column.js +39 -3
  29. package/dist/components/Columns/column.js.map +1 -1
  30. package/dist/components/Columns/index.js +47 -8
  31. package/dist/components/Columns/index.js.map +1 -1
  32. package/dist/components/Comment/index.js +29 -22
  33. package/dist/components/Comment/index.js.map +1 -1
  34. package/dist/components/CommentFeed/index.js +14 -7
  35. package/dist/components/CommentFeed/index.js.map +1 -1
  36. package/dist/components/Content/index.js +48 -10
  37. package/dist/components/Content/index.js.map +1 -1
  38. package/dist/components/Content/wrapper.js +13 -8
  39. package/dist/components/Content/wrapper.js.map +1 -1
  40. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  41. package/dist/components/ControlGroup/index.js +171 -58
  42. package/dist/components/ControlGroup/index.js.map +1 -1
  43. package/dist/components/ControlGroup/item.js +18 -12
  44. package/dist/components/ControlGroup/item.js.map +1 -1
  45. package/dist/components/DataView/helpers.js +53 -37
  46. package/dist/components/DataView/helpers.js.map +1 -1
  47. package/dist/components/DataView/index.js +234 -182
  48. package/dist/components/DataView/index.js.map +1 -1
  49. package/dist/components/DatePicker/MonthYearDropdowns.js +19 -12
  50. package/dist/components/DatePicker/MonthYearDropdowns.js.map +1 -1
  51. package/dist/components/DatePicker/index.js +65 -58
  52. package/dist/components/DatePicker/index.js.map +1 -1
  53. package/dist/components/DescriptionList/index.js +65 -26
  54. package/dist/components/DescriptionList/index.js.map +1 -1
  55. package/dist/components/Drawer/backdrop.js +23 -17
  56. package/dist/components/Drawer/backdrop.js.map +1 -1
  57. package/dist/components/Drawer/index.d.ts +89 -0
  58. package/dist/components/Drawer/index.d.ts.map +1 -1
  59. package/dist/components/Drawer/index.js +236 -69
  60. package/dist/components/Drawer/index.js.map +1 -1
  61. package/dist/components/Dropdown/index.d.ts.map +1 -1
  62. package/dist/components/Dropdown/index.js +23 -18
  63. package/dist/components/Dropdown/index.js.map +1 -1
  64. package/dist/components/Dropdown/item.d.ts +1 -1
  65. package/dist/components/Dropdown/item.d.ts.map +1 -1
  66. package/dist/components/Dropdown/item.js +34 -11
  67. package/dist/components/Dropdown/item.js.map +1 -1
  68. package/dist/components/Dropdown/list.d.ts.map +1 -1
  69. package/dist/components/Dropdown/list.js +96 -74
  70. package/dist/components/Dropdown/list.js.map +1 -1
  71. package/dist/components/Effect/index.d.ts +24 -1
  72. package/dist/components/Effect/index.d.ts.map +1 -1
  73. package/dist/components/Effect/index.js +107 -65
  74. package/dist/components/Effect/index.js.map +1 -1
  75. package/dist/components/EmptyState/index.js +26 -20
  76. package/dist/components/EmptyState/index.js.map +1 -1
  77. package/dist/components/EntityRow/index.js +98 -59
  78. package/dist/components/EntityRow/index.js.map +1 -1
  79. package/dist/components/ErrorBoundary/index.js +15 -12
  80. package/dist/components/ErrorBoundary/index.js.map +1 -1
  81. package/dist/components/ExportModal/index.js +24 -17
  82. package/dist/components/ExportModal/index.js.map +1 -1
  83. package/dist/components/FadeScroller/index.js +29 -23
  84. package/dist/components/FadeScroller/index.js.map +1 -1
  85. package/dist/components/FeatureCard/index.js +84 -45
  86. package/dist/components/FeatureCard/index.js.map +1 -1
  87. package/dist/components/GlobalModalsWrapper/index.js +16 -13
  88. package/dist/components/GlobalModalsWrapper/index.js.map +1 -1
  89. package/dist/components/Header/index.js +33 -21
  90. package/dist/components/Header/index.js.map +1 -1
  91. package/dist/components/Icon/index.js +77 -41
  92. package/dist/components/Icon/index.js.map +1 -1
  93. package/dist/components/IconPicker/index.js +80 -41
  94. package/dist/components/IconPicker/index.js.map +1 -1
  95. package/dist/components/Input/index.js +94 -55
  96. package/dist/components/Input/index.js.map +1 -1
  97. package/dist/components/InputClearButton/index.js +20 -14
  98. package/dist/components/InputClearButton/index.js.map +1 -1
  99. package/dist/components/InternalPopover/index.d.ts +1 -0
  100. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  101. package/dist/components/InternalPopover/index.js +190 -54
  102. package/dist/components/InternalPopover/index.js.map +1 -1
  103. package/dist/components/KeyValueTable/index.js +18 -11
  104. package/dist/components/KeyValueTable/index.js.map +1 -1
  105. package/dist/components/KeyboardShortcut/index.js +28 -22
  106. package/dist/components/KeyboardShortcut/index.js.map +1 -1
  107. package/dist/components/Label/index.js +11 -5
  108. package/dist/components/Label/index.js.map +1 -1
  109. package/dist/components/Layout/content.js +10 -5
  110. package/dist/components/Layout/content.js.map +1 -1
  111. package/dist/components/Layout/index.js +46 -8
  112. package/dist/components/Layout/index.js.map +1 -1
  113. package/dist/components/Link/index.js +63 -24
  114. package/dist/components/Link/index.js.map +1 -1
  115. package/dist/components/Menu/divider.js +56 -20
  116. package/dist/components/Menu/divider.js.map +1 -1
  117. package/dist/components/Menu/index.js +67 -29
  118. package/dist/components/Menu/index.js.map +1 -1
  119. package/dist/components/Menu/item.js +20 -18
  120. package/dist/components/Menu/item.js.map +1 -1
  121. package/dist/components/Menu/section.js +19 -12
  122. package/dist/components/Menu/section.js.map +1 -1
  123. package/dist/components/Message/index.js +33 -28
  124. package/dist/components/Message/index.js.map +1 -1
  125. package/dist/components/Modal/index.js +18 -15
  126. package/dist/components/Modal/index.js.map +1 -1
  127. package/dist/components/MultiSelect/index.d.ts +3 -3
  128. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  129. package/dist/components/MultiSelect/index.js +10 -4
  130. package/dist/components/MultiSelect/index.js.map +1 -1
  131. package/dist/components/NavRail/index.js +145 -106
  132. package/dist/components/NavRail/index.js.map +1 -1
  133. package/dist/components/Navbar/divider.js +14 -9
  134. package/dist/components/Navbar/divider.js.map +1 -1
  135. package/dist/components/Navbar/group.js +45 -9
  136. package/dist/components/Navbar/group.js.map +1 -1
  137. package/dist/components/Navbar/index.js +53 -17
  138. package/dist/components/Navbar/index.js.map +1 -1
  139. package/dist/components/Navbar/item.js +50 -15
  140. package/dist/components/Navbar/item.js.map +1 -1
  141. package/dist/components/Notifications/index.js +44 -9
  142. package/dist/components/Notifications/index.js.map +1 -1
  143. package/dist/components/Notifications/notification.js +125 -79
  144. package/dist/components/Notifications/notification.js.map +1 -1
  145. package/dist/components/Notifications/styles.js +69 -33
  146. package/dist/components/Notifications/styles.js.map +1 -1
  147. package/dist/components/Paging/index.js +63 -24
  148. package/dist/components/Paging/index.js.map +1 -1
  149. package/dist/components/Panel/LabelEditor.js +21 -15
  150. package/dist/components/Panel/LabelEditor.js.map +1 -1
  151. package/dist/components/Panel/NonResponsiveActions.js +15 -9
  152. package/dist/components/Panel/NonResponsiveActions.js.map +1 -1
  153. package/dist/components/Panel/index.d.ts.map +1 -1
  154. package/dist/components/Panel/index.js +228 -180
  155. package/dist/components/Panel/index.js.map +1 -1
  156. package/dist/components/Panel/responsive.d.ts +24 -0
  157. package/dist/components/Panel/responsive.d.ts.map +1 -0
  158. package/dist/components/Panel/responsive.js +30 -0
  159. package/dist/components/Panel/responsive.js.map +1 -0
  160. package/dist/components/Paragraph/index.d.ts +8 -0
  161. package/dist/components/Paragraph/index.d.ts.map +1 -1
  162. package/dist/components/Paragraph/index.js +19 -13
  163. package/dist/components/Paragraph/index.js.map +1 -1
  164. package/dist/components/Popover/index.d.ts +46 -0
  165. package/dist/components/Popover/index.d.ts.map +1 -1
  166. package/dist/components/Popover/index.js +240 -42
  167. package/dist/components/Popover/index.js.map +1 -1
  168. package/dist/components/Progress/index.js +78 -40
  169. package/dist/components/Progress/index.js.map +1 -1
  170. package/dist/components/RadioGroup/index.d.ts.map +1 -1
  171. package/dist/components/RadioGroup/index.js +23 -9
  172. package/dist/components/RadioGroup/index.js.map +1 -1
  173. package/dist/components/Rating/index.js +81 -43
  174. package/dist/components/Rating/index.js.map +1 -1
  175. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  176. package/dist/components/RichTextEditor/index.js +362 -114
  177. package/dist/components/RichTextEditor/index.js.map +1 -1
  178. package/dist/components/SegmentedControl/index.js +97 -59
  179. package/dist/components/SegmentedControl/index.js.map +1 -1
  180. package/dist/components/Select/index.d.ts +68 -29
  181. package/dist/components/Select/index.d.ts.map +1 -1
  182. package/dist/components/Select/index.js +75 -140
  183. package/dist/components/Select/index.js.map +1 -1
  184. package/dist/components/Select/valuePreview.d.ts +11 -0
  185. package/dist/components/Select/valuePreview.d.ts.map +1 -0
  186. package/dist/components/Select/valuePreview.js +64 -0
  187. package/dist/components/Select/valuePreview.js.map +1 -0
  188. package/dist/components/SeverityRow/index.js +85 -47
  189. package/dist/components/SeverityRow/index.js.map +1 -1
  190. package/dist/components/Skeleton/index.js +46 -9
  191. package/dist/components/Skeleton/index.js.map +1 -1
  192. package/dist/components/Slider/index.js +76 -37
  193. package/dist/components/Slider/index.js.map +1 -1
  194. package/dist/components/Spacer/index.js +61 -25
  195. package/dist/components/Spacer/index.js.map +1 -1
  196. package/dist/components/Span/index.js +19 -13
  197. package/dist/components/Span/index.js.map +1 -1
  198. package/dist/components/Spinner/index.js +16 -9
  199. package/dist/components/Spinner/index.js.map +1 -1
  200. package/dist/components/StackedBar/index.js +69 -34
  201. package/dist/components/StackedBar/index.js.map +1 -1
  202. package/dist/components/Statistic/index.js +73 -35
  203. package/dist/components/Statistic/index.js.map +1 -1
  204. package/dist/components/Table/body.d.ts.map +1 -1
  205. package/dist/components/Table/body.js +107 -48
  206. package/dist/components/Table/body.js.map +1 -1
  207. package/dist/components/Table/cell.d.ts.map +1 -1
  208. package/dist/components/Table/cell.js +68 -29
  209. package/dist/components/Table/cell.js.map +1 -1
  210. package/dist/components/Table/header.js +69 -33
  211. package/dist/components/Table/header.js.map +1 -1
  212. package/dist/components/Table/headerCell.js +65 -26
  213. package/dist/components/Table/headerCell.js.map +1 -1
  214. package/dist/components/Table/helpers.d.ts +62 -28
  215. package/dist/components/Table/helpers.d.ts.map +1 -1
  216. package/dist/components/Table/helpers.js +189 -111
  217. package/dist/components/Table/helpers.js.map +1 -1
  218. package/dist/components/Table/index.d.ts +30 -2
  219. package/dist/components/Table/index.d.ts.map +1 -1
  220. package/dist/components/Table/index.js +142 -95
  221. package/dist/components/Table/index.js.map +1 -1
  222. package/dist/components/Table/row.d.ts +29 -1
  223. package/dist/components/Table/row.d.ts.map +1 -1
  224. package/dist/components/Table/row.js +163 -60
  225. package/dist/components/Table/row.js.map +1 -1
  226. package/dist/components/Table/scrollbar.js +37 -31
  227. package/dist/components/Table/scrollbar.js.map +1 -1
  228. package/dist/components/Table/value.js +15 -9
  229. package/dist/components/Table/value.js.map +1 -1
  230. package/dist/components/Tabs/content.js +17 -12
  231. package/dist/components/Tabs/content.js.map +1 -1
  232. package/dist/components/Tabs/index.js +52 -14
  233. package/dist/components/Tabs/index.js.map +1 -1
  234. package/dist/components/Tabs/item.js +65 -26
  235. package/dist/components/Tabs/item.js.map +1 -1
  236. package/dist/components/Tabs/list.js +101 -60
  237. package/dist/components/Tabs/list.js.map +1 -1
  238. package/dist/components/Tag/group.js +49 -11
  239. package/dist/components/Tag/group.js.map +1 -1
  240. package/dist/components/Tag/index.d.ts +5 -2
  241. package/dist/components/Tag/index.d.ts.map +1 -1
  242. package/dist/components/Tag/index.js +147 -92
  243. package/dist/components/Tag/index.js.map +1 -1
  244. package/dist/components/Testimonial/index.js +82 -44
  245. package/dist/components/Testimonial/index.js.map +1 -1
  246. package/dist/components/Textarea/index.d.ts +10 -0
  247. package/dist/components/Textarea/index.d.ts.map +1 -1
  248. package/dist/components/Textarea/index.js +167 -63
  249. package/dist/components/Textarea/index.js.map +1 -1
  250. package/dist/components/Tier/index.js +58 -19
  251. package/dist/components/Tier/index.js.map +1 -1
  252. package/dist/components/TimeAgo/index.js +16 -9
  253. package/dist/components/TimeAgo/index.js.map +1 -1
  254. package/dist/components/Timeline/index.js +117 -78
  255. package/dist/components/Timeline/index.js.map +1 -1
  256. package/dist/components/TooltipComponent/index.js +10 -7
  257. package/dist/components/TooltipComponent/index.js.map +1 -1
  258. package/dist/components/Tree/index.d.ts +2 -1
  259. package/dist/components/Tree/index.d.ts.map +1 -1
  260. package/dist/components/Tree/index.js +99 -70
  261. package/dist/components/Tree/index.js.map +1 -1
  262. package/dist/components/Tree/modal.js +20 -13
  263. package/dist/components/Tree/modal.js.map +1 -1
  264. package/dist/constants/animations.js +5 -2
  265. package/dist/constants/animations.js.map +1 -1
  266. package/dist/constants/colors.js +5 -2
  267. package/dist/constants/colors.js.map +1 -1
  268. package/dist/constants/fonts.js +10 -6
  269. package/dist/constants/fonts.js.map +1 -1
  270. package/dist/constants/paging.js +6 -2
  271. package/dist/constants/paging.js.map +1 -1
  272. package/dist/constants/sizes.js +55 -51
  273. package/dist/constants/sizes.js.map +1 -1
  274. package/dist/constants/theme.js +22 -19
  275. package/dist/constants/theme.js.map +1 -1
  276. package/dist/containers/Paging.js +16 -13
  277. package/dist/containers/Paging.js.map +1 -1
  278. package/dist/containers/ReqoreProvider.d.ts.map +1 -1
  279. package/dist/containers/ReqoreProvider.js +62 -52
  280. package/dist/containers/ReqoreProvider.js.map +1 -1
  281. package/dist/containers/ThemeProvider.js +13 -8
  282. package/dist/containers/ThemeProvider.js.map +1 -1
  283. package/dist/containers/UIProvider.d.ts.map +1 -1
  284. package/dist/containers/UIProvider.js +63 -31
  285. package/dist/containers/UIProvider.js.map +1 -1
  286. package/dist/context/CustomThemeContext.js +5 -3
  287. package/dist/context/CustomThemeContext.js.map +1 -1
  288. package/dist/context/ReqoreContext.js +6 -4
  289. package/dist/context/ReqoreContext.js.map +1 -1
  290. package/dist/context/ThemeContext.js +5 -3
  291. package/dist/context/ThemeContext.js.map +1 -1
  292. package/dist/helpers/animations.js +5 -2
  293. package/dist/helpers/animations.js.map +1 -1
  294. package/dist/helpers/colors.js +103 -78
  295. package/dist/helpers/colors.js.map +1 -1
  296. package/dist/helpers/dates.js +17 -8
  297. package/dist/helpers/dates.js.map +1 -1
  298. package/dist/helpers/search.js +11 -5
  299. package/dist/helpers/search.js.map +1 -1
  300. package/dist/helpers/selectItem.d.ts +23 -0
  301. package/dist/helpers/selectItem.d.ts.map +1 -0
  302. package/dist/helpers/selectItem.js +147 -0
  303. package/dist/helpers/selectItem.js.map +1 -0
  304. package/dist/helpers/shortcuts.js +14 -7
  305. package/dist/helpers/shortcuts.js.map +1 -1
  306. package/dist/helpers/styled.js +5 -1
  307. package/dist/helpers/styled.js.map +1 -1
  308. package/dist/helpers/time.js +5 -1
  309. package/dist/helpers/time.js.map +1 -1
  310. package/dist/helpers/utils.js +58 -38
  311. package/dist/helpers/utils.js.map +1 -1
  312. package/dist/hooks/useAutoFocus.js +14 -10
  313. package/dist/hooks/useAutoFocus.js.map +1 -1
  314. package/dist/hooks/useCloneThroughFragments.js +45 -8
  315. package/dist/hooks/useCloneThroughFragments.js.map +1 -1
  316. package/dist/hooks/useCombinedRefs.js +11 -5
  317. package/dist/hooks/useCombinedRefs.js.map +1 -1
  318. package/dist/hooks/useComponentTooltip.js +11 -7
  319. package/dist/hooks/useComponentTooltip.js.map +1 -1
  320. package/dist/hooks/useFitTextSize.js +13 -9
  321. package/dist/hooks/useFitTextSize.js.map +1 -1
  322. package/dist/hooks/useFocusTrap.js +10 -7
  323. package/dist/hooks/useFocusTrap.js.map +1 -1
  324. package/dist/hooks/useLatestZIndex.js +8 -6
  325. package/dist/hooks/useLatestZIndex.js.map +1 -1
  326. package/dist/hooks/useMarqueeOnHover.js +34 -25
  327. package/dist/hooks/useMarqueeOnHover.js.map +1 -1
  328. package/dist/hooks/useNarrowContainer.js +12 -8
  329. package/dist/hooks/useNarrowContainer.js.map +1 -1
  330. package/dist/hooks/useOutsideClick.js +6 -4
  331. package/dist/hooks/useOutsideClick.js.map +1 -1
  332. package/dist/hooks/usePaging.js +27 -20
  333. package/dist/hooks/usePaging.js.map +1 -1
  334. package/dist/hooks/useQueryWithDelay.js +12 -8
  335. package/dist/hooks/useQueryWithDelay.js.map +1 -1
  336. package/dist/hooks/useReqore.js +11 -4
  337. package/dist/hooks/useReqore.js.map +1 -1
  338. package/dist/hooks/useReqoreContext.js +11 -4
  339. package/dist/hooks/useReqoreContext.js.map +1 -1
  340. package/dist/hooks/useReqoreEffect.js +9 -5
  341. package/dist/hooks/useReqoreEffect.js.map +1 -1
  342. package/dist/hooks/useScrollFade.js +12 -8
  343. package/dist/hooks/useScrollFade.js.map +1 -1
  344. package/dist/hooks/useTextareaAutoSize.js +5 -3
  345. package/dist/hooks/useTextareaAutoSize.js.map +1 -1
  346. package/dist/hooks/useTheme.js +22 -15
  347. package/dist/hooks/useTheme.js.map +1 -1
  348. package/dist/hooks/useWhyDidYouUpdate.js +7 -4
  349. package/dist/hooks/useWhyDidYouUpdate.js.map +1 -1
  350. package/dist/index.d.ts +2 -0
  351. package/dist/index.d.ts.map +1 -1
  352. package/dist/index.js +284 -107
  353. package/dist/index.js.map +1 -1
  354. package/dist/styles.js +58 -22
  355. package/dist/styles.js.map +1 -1
  356. package/dist/testing/index.d.ts +3 -0
  357. package/dist/testing/index.d.ts.map +1 -0
  358. package/dist/testing/index.js +23 -0
  359. package/dist/testing/index.js.map +1 -0
  360. package/dist/testing/tableGeometry.d.ts +75 -0
  361. package/dist/testing/tableGeometry.d.ts.map +1 -0
  362. package/dist/testing/tableGeometry.js +168 -0
  363. package/dist/testing/tableGeometry.js.map +1 -0
  364. package/dist/types/global.js +2 -1
  365. package/dist/types/icons.js +2 -1
  366. package/package.json +13 -9
  367. package/testing/package.json +7 -0
  368. package/tests.json +1 -0
  369. package/dist/components/Accordion/index.cjs +0 -199
  370. package/dist/components/Accordion/index.cjs.map +0 -1
  371. package/dist/components/Breadcrumbs/index.cjs +0 -239
  372. package/dist/components/Breadcrumbs/index.cjs.map +0 -1
  373. package/dist/components/Breadcrumbs/item.cjs +0 -43
  374. package/dist/components/Breadcrumbs/item.cjs.map +0 -1
  375. package/dist/components/Bubble/index.cjs +0 -281
  376. package/dist/components/Bubble/index.cjs.map +0 -1
  377. package/dist/components/Button/index.cjs +0 -401
  378. package/dist/components/Button/index.cjs.map +0 -1
  379. package/dist/components/Callout/index.cjs +0 -203
  380. package/dist/components/Callout/index.cjs.map +0 -1
  381. package/dist/components/Checkbox/index.cjs +0 -222
  382. package/dist/components/Checkbox/index.cjs.map +0 -1
  383. package/dist/components/Collapse/index.cjs +0 -127
  384. package/dist/components/Collapse/index.cjs.map +0 -1
  385. package/dist/components/CollapsibleContent/index.cjs +0 -244
  386. package/dist/components/CollapsibleContent/index.cjs.map +0 -1
  387. package/dist/components/Collection/index.cjs +0 -362
  388. package/dist/components/Collection/index.cjs.map +0 -1
  389. package/dist/components/Collection/item.cjs +0 -196
  390. package/dist/components/Collection/item.cjs.map +0 -1
  391. package/dist/components/Columns/column.cjs +0 -47
  392. package/dist/components/Columns/column.cjs.map +0 -1
  393. package/dist/components/Columns/index.cjs +0 -79
  394. package/dist/components/Columns/index.cjs.map +0 -1
  395. package/dist/components/Comment/index.cjs +0 -72
  396. package/dist/components/Comment/index.cjs.map +0 -1
  397. package/dist/components/CommentFeed/index.cjs +0 -49
  398. package/dist/components/CommentFeed/index.cjs.map +0 -1
  399. package/dist/components/Content/index.cjs +0 -80
  400. package/dist/components/Content/index.cjs.map +0 -1
  401. package/dist/components/Content/wrapper.cjs +0 -43
  402. package/dist/components/Content/wrapper.cjs.map +0 -1
  403. package/dist/components/ControlGroup/index.cjs +0 -437
  404. package/dist/components/ControlGroup/index.cjs.map +0 -1
  405. package/dist/components/ControlGroup/item.cjs +0 -86
  406. package/dist/components/ControlGroup/item.cjs.map +0 -1
  407. package/dist/components/DataView/helpers.cjs +0 -350
  408. package/dist/components/DataView/helpers.cjs.map +0 -1
  409. package/dist/components/DataView/index.cjs +0 -961
  410. package/dist/components/DataView/index.cjs.map +0 -1
  411. package/dist/components/DatePicker/MonthYearDropdowns.cjs +0 -64
  412. package/dist/components/DatePicker/MonthYearDropdowns.cjs.map +0 -1
  413. package/dist/components/DatePicker/index.cjs +0 -289
  414. package/dist/components/DatePicker/index.cjs.map +0 -1
  415. package/dist/components/DescriptionList/index.cjs +0 -183
  416. package/dist/components/DescriptionList/index.cjs.map +0 -1
  417. package/dist/components/Drawer/backdrop.cjs +0 -73
  418. package/dist/components/Drawer/backdrop.cjs.map +0 -1
  419. package/dist/components/Drawer/index.cjs +0 -302
  420. package/dist/components/Drawer/index.cjs.map +0 -1
  421. package/dist/components/Dropdown/index.cjs +0 -77
  422. package/dist/components/Dropdown/index.cjs.map +0 -1
  423. package/dist/components/Dropdown/item.cjs +0 -42
  424. package/dist/components/Dropdown/item.cjs.map +0 -1
  425. package/dist/components/Dropdown/list.cjs +0 -346
  426. package/dist/components/Dropdown/list.cjs.map +0 -1
  427. package/dist/components/Effect/index.cjs +0 -331
  428. package/dist/components/Effect/index.cjs.map +0 -1
  429. package/dist/components/EmptyState/index.cjs +0 -60
  430. package/dist/components/EmptyState/index.cjs.map +0 -1
  431. package/dist/components/EntityRow/index.cjs +0 -249
  432. package/dist/components/EntityRow/index.cjs.map +0 -1
  433. package/dist/components/ErrorBoundary/index.cjs +0 -118
  434. package/dist/components/ErrorBoundary/index.cjs.map +0 -1
  435. package/dist/components/ExportModal/index.cjs +0 -91
  436. package/dist/components/ExportModal/index.cjs.map +0 -1
  437. package/dist/components/FadeScroller/index.cjs +0 -327
  438. package/dist/components/FadeScroller/index.cjs.map +0 -1
  439. package/dist/components/FeatureCard/index.cjs +0 -168
  440. package/dist/components/FeatureCard/index.cjs.map +0 -1
  441. package/dist/components/GlobalModalsWrapper/index.cjs +0 -46
  442. package/dist/components/GlobalModalsWrapper/index.cjs.map +0 -1
  443. package/dist/components/Header/index.cjs +0 -70
  444. package/dist/components/Header/index.cjs.map +0 -1
  445. package/dist/components/Icon/index.cjs +0 -195
  446. package/dist/components/Icon/index.cjs.map +0 -1
  447. package/dist/components/IconPicker/index.cjs +0 -236
  448. package/dist/components/IconPicker/index.cjs.map +0 -1
  449. package/dist/components/Input/index.cjs +0 -203
  450. package/dist/components/Input/index.cjs.map +0 -1
  451. package/dist/components/InputClearButton/index.cjs +0 -62
  452. package/dist/components/InputClearButton/index.cjs.map +0 -1
  453. package/dist/components/InternalPopover/index.cjs +0 -315
  454. package/dist/components/InternalPopover/index.cjs.map +0 -1
  455. package/dist/components/KeyValueTable/index.cjs +0 -108
  456. package/dist/components/KeyValueTable/index.cjs.map +0 -1
  457. package/dist/components/KeyboardShortcut/index.cjs +0 -69
  458. package/dist/components/KeyboardShortcut/index.cjs.map +0 -1
  459. package/dist/components/Label/index.cjs +0 -24
  460. package/dist/components/Label/index.cjs.map +0 -1
  461. package/dist/components/Layout/content.cjs +0 -41
  462. package/dist/components/Layout/content.cjs.map +0 -1
  463. package/dist/components/Layout/index.cjs +0 -79
  464. package/dist/components/Layout/index.cjs.map +0 -1
  465. package/dist/components/Link/index.cjs +0 -168
  466. package/dist/components/Link/index.cjs.map +0 -1
  467. package/dist/components/Menu/divider.cjs +0 -98
  468. package/dist/components/Menu/divider.cjs.map +0 -1
  469. package/dist/components/Menu/index.cjs +0 -135
  470. package/dist/components/Menu/index.cjs.map +0 -1
  471. package/dist/components/Menu/item.cjs +0 -99
  472. package/dist/components/Menu/item.cjs.map +0 -1
  473. package/dist/components/Menu/section.cjs +0 -59
  474. package/dist/components/Menu/section.cjs.map +0 -1
  475. package/dist/components/Message/index.cjs +0 -78
  476. package/dist/components/Message/index.cjs.map +0 -1
  477. package/dist/components/Modal/index.cjs +0 -67
  478. package/dist/components/Modal/index.cjs.map +0 -1
  479. package/dist/components/MultiSelect/index.cjs +0 -36
  480. package/dist/components/MultiSelect/index.cjs.map +0 -1
  481. package/dist/components/NavRail/index.cjs +0 -666
  482. package/dist/components/NavRail/index.cjs.map +0 -1
  483. package/dist/components/Navbar/divider.cjs +0 -47
  484. package/dist/components/Navbar/divider.cjs.map +0 -1
  485. package/dist/components/Navbar/group.cjs +0 -85
  486. package/dist/components/Navbar/group.cjs.map +0 -1
  487. package/dist/components/Navbar/index.cjs +0 -97
  488. package/dist/components/Navbar/index.cjs.map +0 -1
  489. package/dist/components/Navbar/item.cjs +0 -98
  490. package/dist/components/Navbar/item.cjs.map +0 -1
  491. package/dist/components/Notifications/index.cjs +0 -66
  492. package/dist/components/Notifications/index.cjs.map +0 -1
  493. package/dist/components/Notifications/notification.cjs +0 -343
  494. package/dist/components/Notifications/notification.cjs.map +0 -1
  495. package/dist/components/Notifications/styles.cjs +0 -131
  496. package/dist/components/Notifications/styles.cjs.map +0 -1
  497. package/dist/components/Paging/index.cjs +0 -173
  498. package/dist/components/Paging/index.cjs.map +0 -1
  499. package/dist/components/Panel/LabelEditor.cjs +0 -62
  500. package/dist/components/Panel/LabelEditor.cjs.map +0 -1
  501. package/dist/components/Panel/NonResponsiveActions.cjs +0 -47
  502. package/dist/components/Panel/NonResponsiveActions.cjs.map +0 -1
  503. package/dist/components/Panel/index.cjs +0 -1054
  504. package/dist/components/Panel/index.cjs.map +0 -1
  505. package/dist/components/Paragraph/index.cjs +0 -55
  506. package/dist/components/Paragraph/index.cjs.map +0 -1
  507. package/dist/components/Popover/index.cjs +0 -348
  508. package/dist/components/Popover/index.cjs.map +0 -1
  509. package/dist/components/Progress/index.cjs +0 -187
  510. package/dist/components/Progress/index.cjs.map +0 -1
  511. package/dist/components/RadioGroup/index.cjs +0 -42
  512. package/dist/components/RadioGroup/index.cjs.map +0 -1
  513. package/dist/components/Rating/index.cjs +0 -207
  514. package/dist/components/Rating/index.cjs.map +0 -1
  515. package/dist/components/RichTextEditor/index.cjs +0 -424
  516. package/dist/components/RichTextEditor/index.cjs.map +0 -1
  517. package/dist/components/SegmentedControl/index.cjs +0 -364
  518. package/dist/components/SegmentedControl/index.cjs.map +0 -1
  519. package/dist/components/Select/index.cjs +0 -363
  520. package/dist/components/Select/index.cjs.map +0 -1
  521. package/dist/components/SeverityRow/index.cjs +0 -207
  522. package/dist/components/SeverityRow/index.cjs.map +0 -1
  523. package/dist/components/Skeleton/index.cjs +0 -58
  524. package/dist/components/Skeleton/index.cjs.map +0 -1
  525. package/dist/components/Slider/index.cjs +0 -154
  526. package/dist/components/Slider/index.cjs.map +0 -1
  527. package/dist/components/Spacer/index.cjs +0 -138
  528. package/dist/components/Spacer/index.cjs.map +0 -1
  529. package/dist/components/Span/index.cjs +0 -61
  530. package/dist/components/Span/index.cjs.map +0 -1
  531. package/dist/components/Spinner/index.cjs +0 -44
  532. package/dist/components/Spinner/index.cjs.map +0 -1
  533. package/dist/components/StackedBar/index.cjs +0 -209
  534. package/dist/components/StackedBar/index.cjs.map +0 -1
  535. package/dist/components/Statistic/index.cjs +0 -161
  536. package/dist/components/Statistic/index.cjs.map +0 -1
  537. package/dist/components/Table/body.cjs +0 -265
  538. package/dist/components/Table/body.cjs.map +0 -1
  539. package/dist/components/Table/cell.cjs +0 -179
  540. package/dist/components/Table/cell.cjs.map +0 -1
  541. package/dist/components/Table/header.cjs +0 -170
  542. package/dist/components/Table/header.cjs.map +0 -1
  543. package/dist/components/Table/headerCell.cjs +0 -277
  544. package/dist/components/Table/headerCell.cjs.map +0 -1
  545. package/dist/components/Table/helpers.cjs +0 -386
  546. package/dist/components/Table/helpers.cjs.map +0 -1
  547. package/dist/components/Table/index.cjs +0 -682
  548. package/dist/components/Table/index.cjs.map +0 -1
  549. package/dist/components/Table/row.cjs +0 -345
  550. package/dist/components/Table/row.cjs.map +0 -1
  551. package/dist/components/Table/scrollbar.cjs +0 -201
  552. package/dist/components/Table/scrollbar.cjs.map +0 -1
  553. package/dist/components/Table/value.cjs +0 -26
  554. package/dist/components/Table/value.cjs.map +0 -1
  555. package/dist/components/Tabs/content.cjs +0 -63
  556. package/dist/components/Tabs/content.cjs.map +0 -1
  557. package/dist/components/Tabs/index.cjs +0 -109
  558. package/dist/components/Tabs/index.cjs.map +0 -1
  559. package/dist/components/Tabs/item.cjs +0 -136
  560. package/dist/components/Tabs/item.cjs.map +0 -1
  561. package/dist/components/Tabs/list.cjs +0 -322
  562. package/dist/components/Tabs/list.cjs.map +0 -1
  563. package/dist/components/Tag/group.cjs +0 -107
  564. package/dist/components/Tag/group.cjs.map +0 -1
  565. package/dist/components/Tag/index.cjs +0 -343
  566. package/dist/components/Tag/index.cjs.map +0 -1
  567. package/dist/components/Testimonial/index.cjs +0 -166
  568. package/dist/components/Testimonial/index.cjs.map +0 -1
  569. package/dist/components/Textarea/index.cjs +0 -220
  570. package/dist/components/Textarea/index.cjs.map +0 -1
  571. package/dist/components/Tier/index.cjs +0 -107
  572. package/dist/components/Tier/index.cjs.map +0 -1
  573. package/dist/components/TimeAgo/index.cjs +0 -27
  574. package/dist/components/TimeAgo/index.cjs.map +0 -1
  575. package/dist/components/Timeline/index.cjs +0 -416
  576. package/dist/components/Timeline/index.cjs.map +0 -1
  577. package/dist/components/TooltipComponent/index.cjs +0 -37
  578. package/dist/components/TooltipComponent/index.cjs.map +0 -1
  579. package/dist/components/Tree/index.cjs +0 -321
  580. package/dist/components/Tree/index.cjs.map +0 -1
  581. package/dist/components/Tree/modal.cjs +0 -38
  582. package/dist/components/Tree/modal.cjs.map +0 -1
  583. package/dist/constants/animations.cjs +0 -12
  584. package/dist/constants/animations.cjs.map +0 -1
  585. package/dist/constants/colors.cjs +0 -16
  586. package/dist/constants/colors.cjs.map +0 -1
  587. package/dist/constants/fonts.cjs +0 -28
  588. package/dist/constants/fonts.cjs.map +0 -1
  589. package/dist/constants/paging.cjs +0 -63
  590. package/dist/constants/paging.cjs.map +0 -1
  591. package/dist/constants/sizes.cjs +0 -462
  592. package/dist/constants/sizes.cjs.map +0 -1
  593. package/dist/constants/theme.cjs +0 -43
  594. package/dist/constants/theme.cjs.map +0 -1
  595. package/dist/containers/Paging.cjs +0 -52
  596. package/dist/containers/Paging.cjs.map +0 -1
  597. package/dist/containers/ReqoreProvider.cjs +0 -275
  598. package/dist/containers/ReqoreProvider.cjs.map +0 -1
  599. package/dist/containers/ThemeProvider.cjs +0 -17
  600. package/dist/containers/ThemeProvider.cjs.map +0 -1
  601. package/dist/containers/UIProvider.cjs +0 -96
  602. package/dist/containers/UIProvider.cjs.map +0 -1
  603. package/dist/context/CustomThemeContext.cjs +0 -6
  604. package/dist/context/CustomThemeContext.cjs.map +0 -1
  605. package/dist/context/ReqoreContext.cjs +0 -25
  606. package/dist/context/ReqoreContext.cjs.map +0 -1
  607. package/dist/context/ThemeContext.cjs +0 -6
  608. package/dist/context/ThemeContext.cjs.map +0 -1
  609. package/dist/helpers/animations.cjs +0 -11
  610. package/dist/helpers/animations.cjs.map +0 -1
  611. package/dist/helpers/colors.cjs +0 -273
  612. package/dist/helpers/colors.cjs.map +0 -1
  613. package/dist/helpers/dates.cjs +0 -62
  614. package/dist/helpers/dates.cjs.map +0 -1
  615. package/dist/helpers/portal.cjs +0 -32
  616. package/dist/helpers/portal.cjs.map +0 -1
  617. package/dist/helpers/portal.d.ts +0 -18
  618. package/dist/helpers/portal.d.ts.map +0 -1
  619. package/dist/helpers/portal.js +0 -27
  620. package/dist/helpers/portal.js.map +0 -1
  621. package/dist/helpers/search.cjs +0 -63
  622. package/dist/helpers/search.cjs.map +0 -1
  623. package/dist/helpers/shortcuts.cjs +0 -152
  624. package/dist/helpers/shortcuts.cjs.map +0 -1
  625. package/dist/helpers/styled.cjs +0 -46
  626. package/dist/helpers/styled.cjs.map +0 -1
  627. package/dist/helpers/time.cjs +0 -25
  628. package/dist/helpers/time.cjs.map +0 -1
  629. package/dist/helpers/utils.cjs +0 -294
  630. package/dist/helpers/utils.cjs.map +0 -1
  631. package/dist/hooks/useAutoFocus.cjs +0 -84
  632. package/dist/hooks/useAutoFocus.cjs.map +0 -1
  633. package/dist/hooks/useCloneThroughFragments.cjs +0 -63
  634. package/dist/hooks/useCloneThroughFragments.cjs.map +0 -1
  635. package/dist/hooks/useCombinedRefs.cjs +0 -44
  636. package/dist/hooks/useCombinedRefs.cjs.map +0 -1
  637. package/dist/hooks/useComponentTooltip.cjs +0 -34
  638. package/dist/hooks/useComponentTooltip.cjs.map +0 -1
  639. package/dist/hooks/useFitTextSize.cjs +0 -75
  640. package/dist/hooks/useFitTextSize.cjs.map +0 -1
  641. package/dist/hooks/useFocusTrap.cjs +0 -119
  642. package/dist/hooks/useFocusTrap.cjs.map +0 -1
  643. package/dist/hooks/useLatestZIndex.cjs +0 -12
  644. package/dist/hooks/useLatestZIndex.cjs.map +0 -1
  645. package/dist/hooks/useMarqueeOnHover.cjs +0 -292
  646. package/dist/hooks/useMarqueeOnHover.cjs.map +0 -1
  647. package/dist/hooks/useNarrowContainer.cjs +0 -68
  648. package/dist/hooks/useNarrowContainer.cjs.map +0 -1
  649. package/dist/hooks/useOutsideClick.cjs +0 -19
  650. package/dist/hooks/useOutsideClick.cjs.map +0 -1
  651. package/dist/hooks/usePaging.cjs +0 -152
  652. package/dist/hooks/usePaging.cjs.map +0 -1
  653. package/dist/hooks/useQueryWithDelay.cjs +0 -25
  654. package/dist/hooks/useQueryWithDelay.cjs.map +0 -1
  655. package/dist/hooks/useReqore.cjs +0 -17
  656. package/dist/hooks/useReqore.cjs.map +0 -1
  657. package/dist/hooks/useReqoreContext.cjs +0 -19
  658. package/dist/hooks/useReqoreContext.cjs.map +0 -1
  659. package/dist/hooks/useReqoreEffect.cjs +0 -34
  660. package/dist/hooks/useReqoreEffect.cjs.map +0 -1
  661. package/dist/hooks/useScrollFade.cjs +0 -70
  662. package/dist/hooks/useScrollFade.cjs.map +0 -1
  663. package/dist/hooks/useTextareaAutoSize.cjs +0 -22
  664. package/dist/hooks/useTextareaAutoSize.cjs.map +0 -1
  665. package/dist/hooks/useTheme.cjs +0 -49
  666. package/dist/hooks/useTheme.cjs.map +0 -1
  667. package/dist/hooks/useWhyDidYouUpdate.cjs +0 -46
  668. package/dist/hooks/useWhyDidYouUpdate.cjs.map +0 -1
  669. package/dist/index.cjs +0 -271
  670. package/dist/index.cjs.map +0 -1
  671. package/dist/package.json +0 -3
  672. package/dist/styles.cjs +0 -88
  673. package/dist/styles.cjs.map +0 -1
  674. package/dist/types/global.cjs +0 -3
  675. package/dist/types/global.cjs.map +0 -1
  676. package/dist/types/icons.cjs +0 -3
  677. package/dist/types/icons.cjs.map +0 -1
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __assign = (this && this.__assign) || function () {
2
3
  __assign = Object.assign || function(t) {
3
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -29,29 +30,120 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
29
30
  }
30
31
  return to.concat(ar || Array.prototype.slice.call(from));
31
32
  };
32
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
33
- import isPropValid from '@emotion/is-prop-valid';
34
- import { map, size } from 'lodash';
35
- import { forwardRef, memo, useCallback, useImperativeHandle, useMemo, useState } from 'react';
36
- import { useUpdateEffect } from 'react-use';
37
- import { createEditor, Editor, Transforms } from 'slate';
38
- import { withHistory } from 'slate-history';
39
- import { Editable, ReactEditor, Slate, useSelected, withReact } from 'slate-react';
40
- import { ReqoreButton, ReqoreControlGroup, ReqorePanel, ReqoreTextarea } from '../../index.js';
41
- import { getOneLessSize } from '../../helpers/utils.js';
42
- import { ReqoreP } from '../Paragraph/index.js';
43
- import { ReqoreSpan } from '../Span/index.js';
44
- import ReqoreTag from '../Tag/index.js';
45
- export var TemplateElement = memo(function (props) {
46
- var _a, _b;
47
- var selected = useSelected();
48
- var handleClick = useCallback(function (e) {
33
+ var __importDefault = (this && this.__importDefault) || function (mod) {
34
+ return (mod && mod.__esModule) ? mod : { "default": mod };
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.ReqoreRichTextEditor = exports.DefaultElement = exports.withTemplates = exports.TemplateElement = void 0;
38
+ var jsx_runtime_1 = require("react/jsx-runtime");
39
+ var is_prop_valid_1 = __importDefault(require("@emotion/is-prop-valid"));
40
+ var lodash_1 = require("lodash");
41
+ var react_1 = require("react");
42
+ var react_use_1 = require("react-use");
43
+ var slate_1 = require("slate");
44
+ var slate_history_1 = require("slate-history");
45
+ var slate_react_1 = require("slate-react");
46
+ var __1 = require("../..");
47
+ var utils_1 = require("../../helpers/utils");
48
+ var Paragraph_1 = require("../Paragraph");
49
+ var Span_1 = require("../Span");
50
+ var Tag_1 = __importDefault(require("../Tag"));
51
+ /* Stable identities for the optional props' defaults.
52
+ *
53
+ * Written as literals in the destructuring (`tagsProps = {}`,
54
+ * `getTagProps = () => ({})`) they were rebuilt on EVERY render, which put a
55
+ * new identity into `renderElement`'s dependency list every time — and
56
+ * slate-react's own `ElementComponent` memo compares `renderElement` by
57
+ * identity. So an unstable default made every element in the document
58
+ * re-render on every keystroke, including chips nothing had touched. Hoisting
59
+ * them costs nothing and is the whole fix for the common case, where the
60
+ * consumer passes neither prop. */
61
+ var NO_TAG_PROPS = function () { return ({}); };
62
+ var EMPTY_TAG_PROPS = {};
63
+ var EMPTY_TAGS_LIST_PROPS = {};
64
+ exports.TemplateElement = (0, react_1.memo)(function (props) {
65
+ var _a, _b, _c;
66
+ var selected = (0, slate_react_1.useSelected)();
67
+ var editor = (0, slate_react_1.useSlateStatic)();
68
+ /* Slate's own answer, which is the editor's `readOnly` — it reaches `Editable`
69
+ as a DOM-valid prop and Slate reads it back. It is NOT the whole answer: the
70
+ editor's `disabled` never reaches Slate, so `composeTagProps` marks the chip
71
+ read-only for that case and this takes whichever of the two says so. */
72
+ var slateReadOnly = (0, slate_react_1.useReadOnly)();
73
+ var readOnly = slateReadOnly || !!((_a = props.tagProps) === null || _a === void 0 ? void 0 : _a.readOnly);
74
+ /* A chip is an inline VOID: it holds no text of its own, so a click on it has
75
+ no text position to land in and the browser places the cursor nowhere. This
76
+ handler used to `preventDefault()` + `stopPropagation()` and stop there,
77
+ which made the chip a dead spot.
78
+
79
+ That is not merely a missing convenience. A field whose entire value is one
80
+ reference renders as one chip and nothing else, so the chip IS the control:
81
+ with no way to get a cursor into the editor, nothing could be typed into it
82
+ at all. Reported against a Qorus test assertion's `Value`, where it made a
83
+ path deeper than any offered candidate — the case the rich-text control
84
+ exists for — impossible to write by hand.
85
+
86
+ The cursor goes AFTER the chip, which is where a walk is continued
87
+ (`$.order.id` -> `$.order.id.value`). Both calls above are kept and are
88
+ load-bearing: `preventDefault` stops the browser racing us to a position of
89
+ its own, and `stopPropagation` keeps the click from reaching a host row that
90
+ treats a click as "collapse me". The selection is then set explicitly rather
91
+ than left to the browser, so where the cursor lands does not depend on which
92
+ pixel of the chip was hit.
93
+
94
+ Removing a chip is unaffected: that is the tag's own `×`
95
+ (`onRemoveClick`), not a click on its body. */
96
+ var handleClick = (0, react_1.useCallback)(function (e) {
97
+ var _a, _b, _c;
49
98
  e.preventDefault();
50
99
  e.stopPropagation();
51
- }, []);
52
- return (_jsxs(_Fragment, { children: [_jsx(ReqoreTag, __assign({}, props.attributes, { compact: true, flat: false, asBadge: true, fixed: 'key', onClick: handleClick, tooltip: (_a = props.element.value) === null || _a === void 0 ? void 0 : _a.toString(), label: props.element.label }, props.tagProps, { contentEditable: false, intent: selected ? 'info' : (_b = props.tagProps) === null || _b === void 0 ? void 0 : _b.intent })), props.children] }));
100
+ // The consumer's own handler still runs: the editor composes `onTagClick`
101
+ // and any `getTagProps().onClick` into the `tagProps.onClick` below, and
102
+ // this element used to be overridden by it rather than run alongside it.
103
+ (_b = (_a = props.tagProps) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
104
+ // A read-only surface has no cursor to give.
105
+ if (readOnly) {
106
+ return;
107
+ }
108
+ try {
109
+ var path = slate_react_1.ReactEditor.findPath(editor, props.element);
110
+ // From the void's END, and skipping voids. Asking for the point after
111
+ // the void's PATH can resolve to a point INSIDE its own empty text
112
+ // child, where typing is silently ignored — the cursor reads as placed
113
+ // (the DOM selection is real and inside the editor) and the editor
114
+ // still accepts nothing, which is a worse failure than an obvious one.
115
+ // The fallback covers a void that ends the document with no text node
116
+ // after it; a well-formed document always has one.
117
+ var point = (_c = slate_1.Editor.after(editor, slate_1.Editor.end(editor, path), { voids: false })) !== null && _c !== void 0 ? _c : slate_1.Editor.end(editor, []);
118
+ // Focus BEFORE selecting. `ReactEditor.focus` restores the editor's
119
+ // previous selection as it takes focus, so focusing afterwards throws
120
+ // away the point just set — which cost the FIRST character typed after
121
+ // a chip click and nothing else, the kind of loss that reads as a
122
+ // flaky keyboard rather than a bug.
123
+ slate_react_1.ReactEditor.focus(editor);
124
+ slate_1.Transforms.select(editor, point);
125
+ }
126
+ catch (_d) {
127
+ // The element can be gone between render and click (a re-render that
128
+ // replaced the value). Losing the cursor is the right outcome then, and
129
+ // it must not take the click handler down with it.
130
+ }
131
+ }, [editor, props.element, props.tagProps, readOnly]);
132
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Tag_1.default, __assign({}, props.attributes, { compact: true, flat: false, asBadge: true, fixed: 'key', tooltip: (_b = props.element.value) === null || _b === void 0 ? void 0 : _b.toString(), label: props.element.label }, props.tagProps, {
133
+ // AFTER the spread on purpose: `tagProps` carries an `onClick` of its
134
+ // own, so declaring this before it meant this handler never ran at all.
135
+ onClick: handleClick,
136
+ /* And `readOnly` with it, because winning the spread cost the chip the
137
+ one signal that said it could not be pressed. `composeTagProps`
138
+ withholds its `onClick` on a read-only surface; overriding that put a
139
+ handler back unconditionally, and a tag with a handler paints itself
140
+ pressable — pointer cursor, hover lift, a tab stop — for a click this
141
+ element then declines. The handler stays (it still runs the
142
+ consumer's own `onClick`), and this is what says the cursor is not on
143
+ offer. */
144
+ readOnly: readOnly, contentEditable: false, intent: selected ? 'info' : (_c = props.tagProps) === null || _c === void 0 ? void 0 : _c.intent })), props.children] }));
53
145
  });
54
- export var withTemplates = function (editor) {
146
+ var withTemplates = function (editor) {
55
147
  var isInline = editor.isInline, isVoid = editor.isVoid, markableVoid = editor.markableVoid;
56
148
  editor.isInline = function (element) {
57
149
  return element.type === 'tag' ? true : isInline(element);
@@ -64,30 +156,32 @@ export var withTemplates = function (editor) {
64
156
  };
65
157
  return editor;
66
158
  };
159
+ exports.withTemplates = withTemplates;
67
160
  var Leaf = function (_a) {
68
161
  var attributes = _a.attributes, children = _a.children, leaf = _a.leaf;
69
162
  if (leaf.bold) {
70
- children = _jsx("strong", { children: children });
163
+ children = (0, jsx_runtime_1.jsx)("strong", { children: children });
71
164
  }
72
165
  if (leaf.code) {
73
- children = _jsx("code", { children: children });
166
+ children = (0, jsx_runtime_1.jsx)("code", { children: children });
74
167
  }
75
168
  if (leaf.italic) {
76
- children = _jsx("em", { children: children });
169
+ children = (0, jsx_runtime_1.jsx)("em", { children: children });
77
170
  }
78
171
  if (leaf.underline) {
79
- children = _jsx("u", { children: children });
172
+ children = (0, jsx_runtime_1.jsx)("u", { children: children });
80
173
  }
81
- return (_jsx(ReqoreSpan, __assign({ inline: true }, attributes, { effect: {
174
+ return ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({ inline: true }, attributes, { effect: {
82
175
  weight: leaf.bold ? 'bold' : 'normal',
83
176
  italic: leaf.italic,
84
177
  underline: leaf.underline,
85
178
  }, children: children })));
86
179
  };
87
- export var DefaultElement = function (props) {
180
+ var DefaultElement = function (props) {
88
181
  var _a;
89
- return (_jsxs(ReqoreP, __assign({}, props.attributes, { style: { position: 'relative' }, children: [props.placeholder && (_jsx(ReqoreSpan, __assign({ inline: true, effect: { opacity: 0.3 } }, props.placeholderProps, { contentEditable: false, style: __assign({ position: 'absolute', top: 0, left: 0, right: 0, pointerEvents: 'none', userSelect: 'none' }, (_a = props.placeholderProps) === null || _a === void 0 ? void 0 : _a.style), children: props.placeholder }))), props.children] })));
182
+ return ((0, jsx_runtime_1.jsxs)(Paragraph_1.ReqoreP, __assign({}, props.attributes, { style: { position: 'relative' }, children: [props.placeholder && ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({ inline: true, effect: { opacity: 0.3 } }, props.placeholderProps, { contentEditable: false, style: __assign({ position: 'absolute', top: 0, left: 0, right: 0, pointerEvents: 'none', userSelect: 'none' }, (_a = props.placeholderProps) === null || _a === void 0 ? void 0 : _a.style), children: props.placeholder }))), props.children] })));
90
183
  };
184
+ exports.DefaultElement = DefaultElement;
91
185
  var insertTag = function (editor, value, label, metadata) {
92
186
  var mention = {
93
187
  type: 'tag',
@@ -96,8 +190,8 @@ var insertTag = function (editor, value, label, metadata) {
96
190
  metadata: metadata,
97
191
  children: [{ text: '' }],
98
192
  };
99
- Transforms.insertNodes(editor, mention);
100
- Transforms.move(editor);
193
+ slate_1.Transforms.insertNodes(editor, mention);
194
+ slate_1.Transforms.move(editor);
101
195
  };
102
196
  /**
103
197
  * Slate props that are not DOM attributes and must survive the filter below.
@@ -145,50 +239,50 @@ var NON_EDITABLE_PROPS = new Set(['cols', 'fill', 'rows', 'value']);
145
239
  * silently. Apply the same rule styled-components applies for a tag target,
146
240
  * plus the Slate props it has no way to know about.
147
241
  */
148
- var RefSafeSlateEditable = memo(forwardRef(function (props, ref) {
242
+ var RefSafeSlateEditable = (0, react_1.memo)((0, react_1.forwardRef)(function (props, ref) {
149
243
  // Accept the polymorphic input's DOM-ref contract without passing it to
150
244
  // Slate's function component. Slate owns this element through ReactEditor.
151
245
  void ref;
152
246
  // Not memoised: `memo` above already skips the re-render when the props are
153
247
  // shallow-equal, so every render that reaches here has new props to filter.
154
248
  var editableProps = Object.keys(props).reduce(function (acc, key) {
155
- if (!NON_EDITABLE_PROPS.has(key) && (SLATE_EDITABLE_PROPS.has(key) || isPropValid(key))) {
249
+ if (!NON_EDITABLE_PROPS.has(key) && (SLATE_EDITABLE_PROPS.has(key) || (0, is_prop_valid_1.default)(key))) {
156
250
  acc[key] = props[key];
157
251
  }
158
252
  return acc;
159
253
  }, {});
160
- return _jsx(Editable, __assign({}, editableProps));
254
+ return (0, jsx_runtime_1.jsx)(slate_react_1.Editable, __assign({}, editableProps));
161
255
  }));
162
256
  RefSafeSlateEditable.displayName = 'RefSafeSlateEditable';
163
- export var ReqoreRichTextEditor = forwardRef(function (_a, ref) {
257
+ exports.ReqoreRichTextEditor = (0, react_1.forwardRef)(function (_a, ref) {
164
258
  var _b = _a.value, value = _b === void 0 ? [
165
259
  {
166
260
  type: 'paragraph',
167
261
  children: [{ text: '' }],
168
262
  },
169
- ] : _b, onChange = _a.onChange, tags = _a.tags, _c = _a.getTagProps, getTagProps = _c === void 0 ? function () { return ({}); } : _c, _d = _a.tagsProps, tagsProps = _d === void 0 ? {} : _d, onTagClick = _a.onTagClick, _e = _a.tagsListProps, tagsListProps = _e === void 0 ? {} : _e, panelProps = _a.panelProps, actions = _a.actions, customRenderLeaf = _a.customRenderLeaf, decorate = _a.decorate, placeholder = _a.placeholder, placeholderProps = _a.placeholderProps, onFocus = _a.onFocus, onFocusCapture = _a.onFocusCapture, rest = __rest(_a, ["value", "onChange", "tags", "getTagProps", "tagsProps", "onTagClick", "tagsListProps", "panelProps", "actions", "customRenderLeaf", "decorate", "placeholder", "placeholderProps", "onFocus", "onFocusCapture"]);
263
+ ] : _b, onChange = _a.onChange, tags = _a.tags, _c = _a.getTagProps, getTagProps = _c === void 0 ? NO_TAG_PROPS : _c, _d = _a.tagsProps, tagsProps = _d === void 0 ? EMPTY_TAG_PROPS : _d, onTagClick = _a.onTagClick, _e = _a.tagsListProps, tagsListProps = _e === void 0 ? EMPTY_TAGS_LIST_PROPS : _e, panelProps = _a.panelProps, actions = _a.actions, customRenderLeaf = _a.customRenderLeaf, decorate = _a.decorate, placeholder = _a.placeholder, placeholderProps = _a.placeholderProps, onFocus = _a.onFocus, onFocusCapture = _a.onFocusCapture, rest = __rest(_a, ["value", "onChange", "tags", "getTagProps", "tagsProps", "onTagClick", "tagsListProps", "panelProps", "actions", "customRenderLeaf", "decorate", "placeholder", "placeholderProps", "onFocus", "onFocusCapture"]);
170
264
  // Create a Slate editor object that won't change across renders.
171
- var editor = useState(function () { return withTemplates(withReact(withHistory(createEditor()))); })[0];
172
- useImperativeHandle(ref, function () { return editor; }, [editor]);
173
- var _f = useState(), target = _f[0], setTarget = _f[1];
174
- useUpdateEffect(function () {
265
+ var editor = (0, react_1.useState)(function () { return (0, exports.withTemplates)((0, slate_react_1.withReact)((0, slate_history_1.withHistory)((0, slate_1.createEditor)()))); })[0];
266
+ (0, react_1.useImperativeHandle)(ref, function () { return editor; }, [editor]);
267
+ var _f = (0, react_1.useState)(), target = _f[0], setTarget = _f[1];
268
+ (0, react_use_1.useUpdateEffect)(function () {
175
269
  // Only update the editor's children if the value has changed
176
270
  if (JSON.stringify(value) === JSON.stringify(editor.children)) {
177
271
  return;
178
272
  }
179
273
  // Use Slate transforms instead of direct mutation
180
274
  try {
181
- Editor.withoutNormalizing(editor, function () {
275
+ slate_1.Editor.withoutNormalizing(editor, function () {
182
276
  // Deselect before replacing content
183
- Transforms.deselect(editor);
277
+ slate_1.Transforms.deselect(editor);
184
278
  // Remove all existing top-level nodes
185
279
  while (editor.children.length) {
186
- Transforms.removeNodes(editor, { at: [0] });
280
+ slate_1.Transforms.removeNodes(editor, { at: [0] });
187
281
  }
188
282
  // Insert new content
189
- Transforms.insertNodes(editor, value, { at: [0] });
283
+ slate_1.Transforms.insertNodes(editor, value, { at: [0] });
190
284
  // Move selection to end
191
- Transforms.select(editor, Editor.end(editor, []));
285
+ slate_1.Transforms.select(editor, slate_1.Editor.end(editor, []));
192
286
  });
193
287
  }
194
288
  catch (error) {
@@ -197,51 +291,71 @@ export var ReqoreRichTextEditor = forwardRef(function (_a, ref) {
197
291
  editor.children = value;
198
292
  }
199
293
  }, [JSON.stringify(value)]);
200
- var isEmpty = useMemo(function () {
201
- return size(value) === 1 && size(value[0].children) === 1 && value[0].children[0].text === '';
294
+ var isEmpty = (0, react_1.useMemo)(function () {
295
+ return (0, lodash_1.size)(value) === 1 && (0, lodash_1.size)(value[0].children) === 1 && value[0].children[0].text === '';
202
296
  }, [value]);
203
- var renderElement = useCallback(function (props) {
204
- switch (props.element.type) {
205
- case 'tag': {
206
- var tagProps = getTagProps(props.element);
207
- var finalProps_1 = __assign(__assign({}, tagsProps), tagProps);
208
- return (_jsx(TemplateElement, __assign({}, props, { tagProps: __assign(__assign({}, finalProps_1), { size: rest.size ? getOneLessSize(rest.size) : finalProps_1.size || 'small', onClick: !rest.readOnly && !rest.disabled
209
- ? function (event) {
210
- var _a;
211
- onTagClick === null || onTagClick === void 0 ? void 0 : onTagClick(props.element);
212
- (_a = finalProps_1.onClick) === null || _a === void 0 ? void 0 : _a.call(finalProps_1, event);
213
- }
214
- : undefined, onRemoveClick: !rest.readOnly && !rest.disabled
215
- ? function () {
216
- try {
217
- var path = ReactEditor.findPath(editor, props.element);
218
- Transforms.removeNodes(editor, { at: path });
219
- }
220
- catch (error) {
221
- // Element may no longer be in the editor
222
- console.warn('Failed to remove tag:', error);
223
- }
224
- }
225
- : undefined }) })));
226
- }
227
- default:
228
- return (_jsx(DefaultElement, __assign({}, props, { placeholder: isEmpty ? placeholder : undefined, placeholderProps: isEmpty ? placeholderProps : undefined })));
297
+ /**
298
+ * The composed chip props, cached PER ELEMENT.
299
+ *
300
+ * Composing them inline in `renderElement` built a new object — and two new
301
+ * closures — every time it ran, for every chip in the document. That object
302
+ * is `TemplateElement`'s only non-trivial prop, so `memo()` on it could
303
+ * never bail out, and `handleClick`'s `useCallback` inside it, which lists
304
+ * `props.tagProps`, could never hit: every chip re-rendered and re-bound its
305
+ * handlers on every keystroke, on the hot path of a control whose whole job
306
+ * is to be typed into.
307
+ *
308
+ * A `WeakMap` keyed by the element is the right cache because Slate's
309
+ * documents are immutable: an untouched node keeps its identity across an
310
+ * edit, and an edited one becomes a new object, which misses and recomposes.
311
+ * Entries are dropped with the elements themselves.
312
+ *
313
+ * The cache is thrown away and rebuilt whenever anything the composition
314
+ * reads changes, so `getTagProps` identity is the invalidation signal — a
315
+ * `useCallback`-stable one is a promise that its answer for a given element
316
+ * is stable too. A `getTagProps` that has to react to something else (a
317
+ * hover, a selection held outside the editor) must list it, exactly as it
318
+ * already must for `renderElement` to see the change at all.
319
+ */
320
+ var tagPropsCache = (0, react_1.useMemo)(function () { return new WeakMap(); }, [editor, getTagProps, tagsProps, onTagClick, rest.size, rest.readOnly, rest.disabled]);
321
+ var composeTagProps = (0, react_1.useCallback)(function (element) {
322
+ var cached = tagPropsCache.get(element);
323
+ if (cached) {
324
+ return cached;
229
325
  }
230
- },
231
- // All values read inside the callback must be listed here.
232
- // `editor` is stable (created once via `useState` initializer)
233
- // but listed for completeness. The callback-shaped props
234
- // (`getTagProps`, `onTagClick`) and the `rest`-derived flags
235
- // (`size`, `readOnly`, `disabled`) need to be tracked so the
236
- // memo invalidates when the parent passes new ones — otherwise
237
- // tag chips render with stale click handlers / sizes.
238
- // Consumers that pass non-stable callbacks via inline arrow
239
- // functions will cause re-memoization on every render; pass
240
- // stable refs (`useCallback`) for best performance.
241
- [
242
- isEmpty,
243
- placeholder,
244
- placeholderProps,
326
+ var finalProps = __assign(__assign({}, tagsProps), getTagProps(element));
327
+ var interactive = !rest.readOnly && !rest.disabled;
328
+ var composed = __assign(__assign({}, finalProps), { size: rest.size ? (0, utils_1.getOneLessSize)(rest.size) : finalProps.size || 'small',
329
+ /* Says "not choosable" to the chip itself, which withholding the
330
+ handlers below cannot: `TemplateElement` binds a click of its own to
331
+ place the cursor, so an uninteractive editor still hands the tag a
332
+ handler and a tag with a handler paints itself pressable. This is
333
+ the flag that keeps the cursor, the hover effect and the tab stop
334
+ honest — and it is the ONLY route by which the editor's `disabled`
335
+ reaches the chip, since `disabled` never reaches Slate and
336
+ `useReadOnly()` therefore cannot see it. */
337
+ readOnly: !interactive || finalProps.readOnly, onClick: interactive
338
+ ? function (event) {
339
+ var _a;
340
+ onTagClick === null || onTagClick === void 0 ? void 0 : onTagClick(element);
341
+ (_a = finalProps.onClick) === null || _a === void 0 ? void 0 : _a.call(finalProps, event);
342
+ }
343
+ : undefined, onRemoveClick: interactive
344
+ ? function () {
345
+ try {
346
+ var path = slate_react_1.ReactEditor.findPath(editor, element);
347
+ slate_1.Transforms.removeNodes(editor, { at: path });
348
+ }
349
+ catch (error) {
350
+ // Element may no longer be in the editor
351
+ console.warn('Failed to remove tag:', error);
352
+ }
353
+ }
354
+ : undefined });
355
+ tagPropsCache.set(element, composed);
356
+ return composed;
357
+ }, [
358
+ tagPropsCache,
245
359
  editor,
246
360
  getTagProps,
247
361
  tagsProps,
@@ -250,13 +364,34 @@ export var ReqoreRichTextEditor = forwardRef(function (_a, ref) {
250
364
  rest.readOnly,
251
365
  rest.disabled,
252
366
  ]);
253
- var handleFocus = useCallback(function (event) {
367
+ var renderElement = (0, react_1.useCallback)(function (props) {
368
+ switch (props.element.type) {
369
+ case 'tag': {
370
+ return (0, jsx_runtime_1.jsx)(exports.TemplateElement, __assign({}, props, { tagProps: composeTagProps(props.element) }));
371
+ }
372
+ default:
373
+ return ((0, jsx_runtime_1.jsx)(exports.DefaultElement, __assign({}, props, { placeholder: isEmpty ? placeholder : undefined, placeholderProps: isEmpty ? placeholderProps : undefined })));
374
+ }
375
+ },
376
+ // All values read inside the callback must be listed here. Everything
377
+ // the chip composition reads now hangs off `composeTagProps`, which
378
+ // carries those dependencies itself — so this list is short on purpose,
379
+ // and that matters: slate-react's `ElementComponent` memo compares
380
+ // `renderElement` BY IDENTITY, so a dependency that churns re-renders
381
+ // every element in the document, not just the chips.
382
+ //
383
+ // Consumers that pass non-stable callbacks (`getTagProps`, `onTagClick`)
384
+ // or a fresh `placeholderProps` object as inline literals put that churn
385
+ // back; pass stable refs (`useCallback` / `useMemo`) for best
386
+ // performance.
387
+ [isEmpty, placeholder, placeholderProps, composeTagProps]);
388
+ var handleFocus = (0, react_1.useCallback)(function (event) {
254
389
  // Firefox does not always create a DOM selection when an empty Slate
255
390
  // editor contains an absolutely positioned, non-editable placeholder.
256
391
  // Establish the corresponding Slate selection before the first key
257
392
  // event so keyboard input is not discarded.
258
393
  if (isEmpty && !editor.selection && !rest.readOnly && !rest.disabled) {
259
- Transforms.select(editor, Editor.start(editor, []));
394
+ slate_1.Transforms.select(editor, slate_1.Editor.start(editor, []));
260
395
  }
261
396
  // Chain any consumer-provided focus handlers. Slate's `Editable`
262
397
  // gates its internal `onFocus` wrapper behind editable-target/selection
@@ -265,23 +400,23 @@ export var ReqoreRichTextEditor = forwardRef(function (_a, ref) {
265
400
  onFocusCapture === null || onFocusCapture === void 0 ? void 0 : onFocusCapture(event);
266
401
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
267
402
  }, [editor, isEmpty, onFocus, onFocusCapture, rest.disabled, rest.readOnly]);
268
- var renderLeaf = useCallback(function (props) {
269
- return customRenderLeaf ? customRenderLeaf(props) : _jsx(Leaf, __assign({}, props));
403
+ var renderLeaf = (0, react_1.useCallback)(function (props) {
404
+ return customRenderLeaf ? customRenderLeaf(props) : (0, jsx_runtime_1.jsx)(Leaf, __assign({}, props));
270
405
  }, [customRenderLeaf]);
271
- var isMarkActive = useCallback(function (editor, format) {
272
- var marks = Editor.marks(editor);
406
+ var isMarkActive = (0, react_1.useCallback)(function (editor, format) {
407
+ var marks = slate_1.Editor.marks(editor);
273
408
  return marks ? marks[format] === true : false;
274
409
  }, []);
275
- var toggleMark = useCallback(function (editor, format) {
410
+ var toggleMark = (0, react_1.useCallback)(function (editor, format) {
276
411
  var isActive = isMarkActive(editor, format);
277
412
  if (isActive) {
278
- Editor.removeMark(editor, format);
413
+ slate_1.Editor.removeMark(editor, format);
279
414
  }
280
415
  else {
281
- Editor.addMark(editor, format, true);
416
+ slate_1.Editor.addMark(editor, format, true);
282
417
  }
283
418
  }, [isMarkActive]);
284
- var panelActions = useMemo(function () {
419
+ var panelActions = (0, react_1.useMemo)(function () {
285
420
  var _actions = __spreadArray([], ((panelProps === null || panelProps === void 0 ? void 0 : panelProps.actions) || []), true);
286
421
  if (!actions) {
287
422
  return _actions;
@@ -346,47 +481,160 @@ export var ReqoreRichTextEditor = forwardRef(function (_a, ref) {
346
481
  _actions.push(undoRedoActions);
347
482
  }
348
483
  return _actions;
349
- }, [actions, value, target, Editor.marks(editor), editor]);
350
- var items = useMemo(function () {
351
- if (size(tags)) {
352
- return map(tags, function (_a, key) {
484
+ }, [actions, value, target, slate_1.Editor.marks(editor), editor]);
485
+ var items = (0, react_1.useMemo)(function () {
486
+ if ((0, lodash_1.size)(tags)) {
487
+ return (0, lodash_1.map)(tags, function (_a, key) {
353
488
  var items = _a.items, tag = __rest(_a, ["items"]);
354
489
  return (__assign(__assign({ label: tag.label || key }, tag), { items: items }));
355
490
  });
356
491
  }
357
492
  return undefined;
358
493
  }, [tags]);
359
- return (_jsx(ReqorePanel, __assign({ flat: true, padded: false, minimal: true, transparent: true, size: 'small' }, panelProps, { children: _jsx(Slate, { editor: editor, initialValue: value, onChange: function (data) {
494
+ /* A caret in the empty text BESIDE a chip is a dead cursor.
495
+
496
+ The position itself is legitimate — it is the point `TemplateElement`
497
+ deliberately moves to when the chip is clicked, and typing works from
498
+ there. What breaks is arriving by clicking the empty text directly: the
499
+ BROWSER owns the DOM caret then, and it resolves the first keystroke back
500
+ into the chip's own text child, where Slate silently ignores it.
501
+
502
+ Measured on the reported case: selection `[0,2]` before the key,
503
+ `[0,1,0]` after it, document unchanged, `onChange` fired twice.
504
+
505
+ Re-selecting through Slate alone does not help, because Slate's selection
506
+ is ALREADY the right point — `Transforms.select` to the same range is a
507
+ no-op and never re-syncs the DOM. So the DOM range is set explicitly,
508
+ which is the thing the next keystroke actually resolves from.
509
+
510
+ Collapsed selections only: a RANGE spanning a chip is how it gets
511
+ selected for deletion and must be left alone. */
512
+ var repairCaretBesideVoid = (0, react_1.useCallback)(function () {
513
+ var _a;
514
+ if (rest.readOnly || rest.disabled) {
515
+ return;
516
+ }
517
+ /* Adopt the caret this click placed BEFORE reading it.
518
+
519
+ slate-react takes the browser's caret into `editor.selection` from a
520
+ `selectionchange` handler throttled to 100ms, so at mouseup Slate may
521
+ still have no selection at all. This handler then used to return
522
+ without repairing anything — and the gap is worse than a missed
523
+ repair: a re-render of the editable in that window sees a browser caret
524
+ with no Slate selection, treats it as stale and REMOVES it, which is
525
+ itself a selection change and spends the throttle window. The click's
526
+ own change is deferred to the trailing edge, a key pressed before then
527
+ is dropped, and by the time the handler runs there is no caret left to
528
+ adopt — the field reads as frozen.
529
+
530
+ Measured in the Qorus test editor: Slate's selection `null` at the first
531
+ keystroke while the browser caret sat correctly beside the chip; the
532
+ same story passed only when the key happened to land more than 100ms
533
+ after the last throttled call.
534
+
535
+ Only a caret slate-react itself would accept is taken, and never while
536
+ composing — an IME owns the selection then. */
537
+ try {
538
+ var domSelection = slate_react_1.ReactEditor.getWindow(editor).getSelection();
539
+ var _b = domSelection !== null && domSelection !== void 0 ? domSelection : {}, anchorNode = _b.anchorNode, focusNode = _b.focusNode;
540
+ /* The same test slate-react's own handler applies before it adopts a
541
+ caret, so this takes exactly what that handler would take, only
542
+ sooner. */
543
+ if (domSelection &&
544
+ domSelection.rangeCount > 0 &&
545
+ anchorNode &&
546
+ focusNode &&
547
+ !slate_react_1.ReactEditor.isComposing(editor) &&
548
+ slate_react_1.ReactEditor.hasSelectableTarget(editor, anchorNode) &&
549
+ slate_react_1.ReactEditor.hasSelectableTarget(editor, focusNode)) {
550
+ var clicked = slate_react_1.ReactEditor.toSlateRange(editor, domSelection, {
551
+ exactMatch: false,
552
+ suppressThrow: true,
553
+ });
554
+ if (clicked && !(editor.selection && slate_1.Range.equals(editor.selection, clicked))) {
555
+ slate_1.Transforms.select(editor, clicked);
556
+ }
557
+ }
558
+ }
559
+ catch (_c) {
560
+ // Nothing to adopt is not an error; the throttled handler still runs.
561
+ }
562
+ var selection = editor.selection;
563
+ if (!selection || !slate_1.Range.isCollapsed(selection)) {
564
+ return;
565
+ }
566
+ try {
567
+ /* Either already inside a void (`voids: true`, or the void the point
568
+ is inside is not matched at all), or in the empty text immediately
569
+ after one. `Editor.void` / `Editor.leaf` rather than `Editor.nodes`:
570
+ the latter returns a generator, which this build target cannot
571
+ destructure (TS2802). */
572
+ var inside = slate_1.Editor.void(editor, { at: selection, voids: true });
573
+ var voidPath = inside === null || inside === void 0 ? void 0 : inside[1];
574
+ if (!voidPath) {
575
+ var textEntry = slate_1.Editor.leaf(editor, selection);
576
+ if (!textEntry) {
577
+ return;
578
+ }
579
+ var textNode = textEntry[0], textPath = textEntry[1];
580
+ if (textNode.text !== '') {
581
+ return;
582
+ }
583
+ var previous = slate_1.Editor.previous(editor, { at: textPath });
584
+ if (!previous || !slate_1.Editor.isVoid(editor, previous[0])) {
585
+ return;
586
+ }
587
+ voidPath = previous[1];
588
+ }
589
+ // The same point `TemplateElement` uses: from the void's END and
590
+ // skipping voids, so it cannot resolve back into another one.
591
+ var point = (_a = slate_1.Editor.after(editor, slate_1.Editor.end(editor, voidPath), { voids: false })) !== null && _a !== void 0 ? _a : slate_1.Editor.end(editor, []);
592
+ var range = { anchor: point, focus: point };
593
+ slate_1.Transforms.select(editor, range);
594
+ var domRange = slate_react_1.ReactEditor.toDOMRange(editor, range);
595
+ var domSelection = slate_react_1.ReactEditor.getWindow(editor).getSelection();
596
+ if (domSelection) {
597
+ domSelection.removeAllRanges();
598
+ domSelection.addRange(domRange);
599
+ }
600
+ }
601
+ catch (_d) {
602
+ // A selection can reference a path a concurrent re-render has removed,
603
+ // and `toDOMRange` throws for a point it cannot resolve. Leaving the
604
+ // cursor where it is beats throwing out of an event handler.
605
+ }
606
+ }, [editor, rest.readOnly, rest.disabled]);
607
+ return ((0, jsx_runtime_1.jsx)(__1.ReqorePanel, __assign({ flat: true, padded: false, minimal: true, transparent: true, size: 'small' }, panelProps, { children: (0, jsx_runtime_1.jsx)(slate_react_1.Slate, { editor: editor, initialValue: value, onChange: function (data) {
360
608
  var selection = editor.selection;
361
609
  setTarget(selection);
362
610
  onChange === null || onChange === void 0 ? void 0 : onChange(data);
363
- }, children: _jsx(ReqoreTextarea, __assign({}, rest, { renderElement: renderElement, renderLeaf: renderLeaf, decorate: decorate, onFocusCapture: handleFocus, as: RefSafeSlateEditable, style: {
611
+ }, children: (0, jsx_runtime_1.jsx)(__1.ReqoreTextarea, __assign({}, rest, { renderElement: renderElement, renderLeaf: renderLeaf, decorate: decorate, onFocusCapture: handleFocus, onMouseUp: repairCaretBesideVoid, as: RefSafeSlateEditable, style: {
364
612
  lineHeight: 1.5,
365
613
  outline: 'none',
366
614
  }, onClearClick: isEmpty
367
615
  ? undefined
368
616
  : function () {
369
- Transforms.delete(editor, {
617
+ slate_1.Transforms.delete(editor, {
370
618
  at: {
371
- anchor: Editor.start(editor, []),
372
- focus: Editor.end(editor, []),
619
+ anchor: slate_1.Editor.start(editor, []),
620
+ focus: slate_1.Editor.end(editor, []),
373
621
  },
374
622
  });
375
623
  // Focus the editor
376
624
  try {
377
- ReactEditor.focus(editor);
625
+ slate_react_1.ReactEditor.focus(editor);
378
626
  }
379
627
  catch (error) {
380
628
  // Editor may not be mounted
381
629
  }
382
- }, value: JSON.stringify(value || []), onChange: useCallback(function () { }, []), templates: __assign(__assign({ customElements: size(panelActions)
630
+ }, value: JSON.stringify(value || []), onChange: (0, react_1.useCallback)(function () { }, []), templates: __assign(__assign({ customElements: (0, lodash_1.size)(panelActions)
383
631
  ? [
384
- _jsx(ReqoreControlGroup, { spaceBetween: true, size: 'small', fixed: true, children: panelActions.map(function (action, index) {
632
+ (0, jsx_runtime_1.jsx)(__1.ReqoreControlGroup, { spaceBetween: true, size: 'small', fixed: true, children: panelActions.map(function (action, index) {
385
633
  var _a;
386
634
  if (action.group) {
387
- return (_jsx(ReqoreControlGroup, { stack: true, children: (_a = action.group) === null || _a === void 0 ? void 0 : _a.map(function (action, index) { return (_jsx(ReqoreButton, __assign({ customTheme: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listCustomTheme, intent: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listIntent }, action), index)); }) }, index));
635
+ return ((0, jsx_runtime_1.jsx)(__1.ReqoreControlGroup, { stack: true, children: (_a = action.group) === null || _a === void 0 ? void 0 : _a.map(function (action, index) { return ((0, jsx_runtime_1.jsx)(__1.ReqoreButton, __assign({ customTheme: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listCustomTheme, intent: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listIntent }, action), index)); }) }, index));
388
636
  }
389
- return (_jsx(ReqoreButton, __assign({ customTheme: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listCustomTheme, intent: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listIntent }, action), index));
637
+ return ((0, jsx_runtime_1.jsx)(__1.ReqoreButton, __assign({ customTheme: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listCustomTheme, intent: tagsListProps === null || tagsListProps === void 0 ? void 0 : tagsListProps.listIntent }, action), index));
390
638
  }) }, 0),
391
639
  ]
392
640
  : undefined }, tagsListProps), { items: items, closeOnInsideClick: false, onItemSelect: function (item) {
@@ -394,12 +642,12 @@ export var ReqoreRichTextEditor = forwardRef(function (_a, ref) {
394
642
  try {
395
643
  // Use current selection or fallback to end of document
396
644
  var selection = editor.selection || {
397
- anchor: Editor.end(editor, []),
398
- focus: Editor.end(editor, []),
645
+ anchor: slate_1.Editor.end(editor, []),
646
+ focus: slate_1.Editor.end(editor, []),
399
647
  };
400
- Transforms.select(editor, selection);
648
+ slate_1.Transforms.select(editor, selection);
401
649
  insertTag(editor, item.value, item.label, item.metadata);
402
- ReactEditor.focus(editor);
650
+ slate_react_1.ReactEditor.focus(editor);
403
651
  }
404
652
  catch (error) {
405
653
  // Fallback: just insert at current position