@alfadocs/ui-kit 0.1.9 → 0.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 (281) hide show
  1. package/README.md +30 -0
  2. package/dist/_chunks/accordion-DOmxGEWU.js +228 -0
  3. package/dist/_chunks/{agenda-card-DwLIxgi7.js → agenda-card-CalZqycc.js} +12 -3
  4. package/dist/_chunks/{agenda-tray-DUvengGQ.js → agenda-tray-3ffFDQZC.js} +54 -51
  5. package/dist/_chunks/{ai-prompt-input.agent-0NHYLTWD.js → ai-prompt-input-BBiDlEIS.js} +231 -231
  6. package/dist/_chunks/{alert-BlOUMkXj.js → alert-B1sj8Ss0.js} +24 -14
  7. package/dist/_chunks/{apexcharts-theme-BkSShpEy.js → apexcharts-theme-BJigns_V.js} +7 -2
  8. package/dist/_chunks/{app-frame-6d7Lu4ea.js → app-frame-CDJOgPXe.js} +7 -16
  9. package/dist/_chunks/{audio-recorder.agent--VKeykUp.js → audio-recorder-B4U1LuiQ.js} +161 -162
  10. package/dist/_chunks/{audio-visualiser-CeMPCZkd.js → audio-visualiser-ByDEFLNm.js} +25 -19
  11. package/dist/_chunks/autocomplete-D4oUZbsP.js +466 -0
  12. package/dist/_chunks/{badge-mrstWxve.js → badge-DKFbntoa.js} +16 -13
  13. package/dist/_chunks/{balance-cell-renderer-5CA7zpAi.js → balance-cell-renderer-B8zgIM-m.js} +63 -44
  14. package/dist/_chunks/{breadcrumb.agent-GM2hAKFX.js → breadcrumb-D1snXjPb.js} +165 -157
  15. package/dist/_chunks/{button-7mLWcMp_.js → button-DD_0Xdmr.js} +12 -2
  16. package/dist/_chunks/{calendar-nGEgelJs.js → calendar-zy0tUUVG.js} +13 -18
  17. package/dist/_chunks/{card-BEy58ZKp.js → card-CWzuTLYE.js} +40 -34
  18. package/dist/_chunks/{chart.agent-_pRYS17d.js → chart-BLvFl169.js} +147 -131
  19. package/dist/_chunks/chat-container-ClzsWXp2.js +220 -0
  20. package/dist/_chunks/chat-input-DOlsB1fm.js +333 -0
  21. package/dist/_chunks/{chat-message-ByouZpPP.js → chat-message-DoAhgUTj.js} +23 -13
  22. package/dist/_chunks/{collapsible.agent-DkS1jVyn.js → collapsible-CuxUBoHJ.js} +97 -99
  23. package/dist/_chunks/{color-picker-94qcBZqZ.js → color-picker-CTIcHlDF.js} +111 -45
  24. package/dist/_chunks/combobox-DCNXqbC7.js +460 -0
  25. package/dist/_chunks/command-palette-C_vgSgrI.js +441 -0
  26. package/dist/_chunks/{date-picker-BqPTn7bO.js → date-picker-B1PO1ZQP.js} +190 -181
  27. package/dist/_chunks/{date-range-picker-B2hGsffw.js → date-range-picker-mix2nEVC.js} +21 -8
  28. package/dist/_chunks/{date-time-picker-Bzt0S8yO.js → date-time-picker-Dnong_BY.js} +30 -15
  29. package/dist/_chunks/{description-list-DvJbp6Yg.js → description-list-BYA77Yud.js} +26 -23
  30. package/dist/_chunks/dialog-BPD7wlGE.js +211 -0
  31. package/dist/_chunks/dropdown-menu-CpiF6CPz.js +300 -0
  32. package/dist/_chunks/{empty-state-DQPtRp2b.js → empty-state-3CLJIXSj.js} +132 -101
  33. package/dist/_chunks/file-upload-C947ACDK.js +829 -0
  34. package/dist/_chunks/{floating-action-button-Cnw-f6AG.js → floating-action-button-C8OYj8mE.js} +9 -2
  35. package/dist/_chunks/{form-field-BfsPLTSc.js → form-field-Bmkeh7WY.js} +12 -11
  36. package/dist/_chunks/{form-field-context-94LwgYTQ.js → form-field-context-B3APVHKx.js} +4 -2
  37. package/dist/_chunks/{freemium-paywall.agent-_nQqLyRF.js → freemium-paywall-CnvceDav.js} +124 -117
  38. package/dist/_chunks/{header-BGn1mRp8.js → header-D0ULgQl3.js} +69 -68
  39. package/dist/_chunks/{icon-button-Wnnde5lc.js → icon-button-C4CGcYuz.js} +11 -3
  40. package/dist/_chunks/{kbd-8baVw3KU.js → kbd-Cglkd7CY.js} +6 -2
  41. package/dist/_chunks/{key-value-pair-JRFS9Xrh.js → key-value-pair-CgWvAIGb.js} +2 -2
  42. package/dist/_chunks/{leo-sidebar-BwINPdix.js → leo-sidebar-CfEY-xi2.js} +16 -20
  43. package/dist/_chunks/{link-QheANk74.js → link-8QmFjIz2.js} +2 -5
  44. package/dist/_chunks/list-qP6p0NTw.js +434 -0
  45. package/dist/_chunks/{logo-BpFoCL-s.js → logo-_Z-jLq80.js} +155 -26
  46. package/dist/_chunks/{matrix-rain-BEkvux64.js → matrix-rain-CRPMXcVx.js} +8 -2
  47. package/dist/_chunks/{message-card-qhoGv947.js → message-card-ChCX9Iv6.js} +63 -60
  48. package/dist/_chunks/{message-tray-xHUCra-Y.js → message-tray-n8q9ITXI.js} +71 -76
  49. package/dist/_chunks/{multi-select.agent-Do6CeQUT.js → multi-select-wqqrgjUQ.js} +326 -291
  50. package/dist/_chunks/{navigation-menu.agent-D69ND6Qq.js → navigation-menu-ClbHeawy.js} +136 -123
  51. package/dist/_chunks/{notification-card-CsVEYJE-.js → notification-card-hBlPN1-c.js} +3 -3
  52. package/dist/_chunks/{notification-tray-DTXMq42J.js → notification-tray-C5cnXbl9.js} +70 -66
  53. package/dist/_chunks/{number-input-fvGmnRy9.js → number-input-Q7wkHnvQ.js} +7 -3
  54. package/dist/_chunks/{otp-input-EglXOUue.js → otp-input-C9gUByF0.js} +6 -3
  55. package/dist/_chunks/{pagination.agent-BkZQl45y.js → pagination-3AC4zTsi.js} +234 -194
  56. package/dist/_chunks/{password-input-D6kuYXmr.js → password-input-C4LmjIH1.js} +6 -9
  57. package/dist/_chunks/{patient-shell-BRmrrUUW.js → patient-shell-BlsEUKWB.js} +10 -15
  58. package/dist/_chunks/{payment-form-BWaXas8z.js → payment-form-C3vT_npe.js} +195 -186
  59. package/dist/_chunks/{pdf-viewer.agent-BaGEDheA.js → pdf-viewer-CZIfY08H.js} +270 -241
  60. package/dist/_chunks/{phone-input-C8Op4sEc.js → phone-input-CSHJOJ13.js} +4 -9
  61. package/dist/_chunks/popover-DekUKNBk.js +293 -0
  62. package/dist/_chunks/{privacy-lock.agent-C1i1-T58.js → privacy-lock-BKsI6ReN.js} +117 -109
  63. package/dist/_chunks/progress-C11tqhoI.js +298 -0
  64. package/dist/_chunks/{recaptcha-widget.agent-BGHpU5zD.js → recaptcha-widget-NyfOfLII.js} +95 -86
  65. package/dist/_chunks/resizable-mpXXyIsN.js +483 -0
  66. package/dist/_chunks/{rich-text-editor.agent-DnE125Tz.js → rich-text-editor-C7TCIlQO.js} +298 -209
  67. package/dist/_chunks/{scroll-area-DLr5w9Dd.js → scroll-area-DEDU-lp-.js} +67 -54
  68. package/dist/_chunks/{search-bar.agent-DxFAxctc.js → search-bar-BTDfgYtg.js} +291 -268
  69. package/dist/_chunks/{search-input-Xw3cdWXW.js → search-input-CdJIEjFo.js} +116 -107
  70. package/dist/_chunks/{select-DY1Cb2Tg.js → select-y6bXV1f1.js} +84 -83
  71. package/dist/_chunks/{separator-B4wXDLNC.js → separator-CYU_bGFn.js} +2 -5
  72. package/dist/_chunks/{sheet-B9kH9pcI.js → sheet-4tgMFwj0.js} +135 -60
  73. package/dist/_chunks/{sidebar-CHF5xr_P.js → sidebar-Bx3wCDyy.js} +546 -457
  74. package/dist/_chunks/{sign-in-with-alfadocs-button-BN_FPGHT.js → sign-in-with-alfadocs-button-B9UrqOqH.js} +9 -5
  75. package/dist/_chunks/{signature-capture.agent-BpeDwFht.js → signature-capture-DjMlFOzS.js} +210 -212
  76. package/dist/_chunks/{skeleton-dtqyF09N.js → skeleton-CZbwyJAA.js} +9 -3
  77. package/dist/_chunks/{slider-CcsQTZTA.js → slider-BT2bZWsy.js} +138 -134
  78. package/dist/_chunks/{slot-grid-D_l5VsHG.js → slot-grid-CgpYgBkW.js} +105 -95
  79. package/dist/_chunks/{sparkline.agent-56Sj7nOP.js → sparkline-_gy8aJDG.js} +107 -100
  80. package/dist/_chunks/{spinner-GCcv67vh.js → spinner-DLaYfLPl.js} +66 -14
  81. package/dist/_chunks/{stat-DUB6g90R.js → stat-B9PHSPbN.js} +45 -27
  82. package/dist/_chunks/{stepper-calendar.agent-9iT3ClIB.js → stepper-calendar-BLOJUE0-.js} +189 -187
  83. package/dist/_chunks/stepper-progress-jFY8BSf7.js +208 -0
  84. package/dist/_chunks/{suggestion-chip-DhFrkRPj.js → suggestion-chip-C4Jz0LrM.js} +50 -52
  85. package/dist/_chunks/{switch-BYEH8I53.js → switch-C0psfIQF.js} +2 -2
  86. package/dist/_chunks/{tabs.agent-h7NvsTR1.js → tabs-DaFA3Muo.js} +183 -155
  87. package/dist/_chunks/{tag-BqidXKo3.js → tag-DuLMjRbF.js} +90 -32
  88. package/dist/_chunks/{task-card-CY5ztNkU.js → task-card-Dw_ZJDL8.js} +5 -2
  89. package/dist/_chunks/{task-tray-CCoUdorl.js → task-tray-XlIW9ueh.js} +50 -49
  90. package/dist/_chunks/{text-area-C_M8wliK.js → text-area-CO9Dz0qX.js} +2 -2
  91. package/dist/_chunks/{text-input-BX39e6T6.js → text-input-DZwt9L8H.js} +65 -62
  92. package/dist/_chunks/{theme-root-DDb0TJjd.js → theme-root-CSKD5ZRm.js} +9 -2
  93. package/dist/_chunks/{theme-toggle.agent-btmXTWdW.js → theme-toggle-B9zzCnvl.js} +179 -177
  94. package/dist/_chunks/{time-picker-B8AMIrX7.js → time-picker-DvPUmHH-.js} +95 -93
  95. package/dist/_chunks/{timeline.agent-CRPza9wc.js → timeline-BvmnQadS.js} +96 -96
  96. package/dist/_chunks/{toast.agent-BjEGuq1Z.js → toast.agent-BwKXA0km.js} +46 -8
  97. package/dist/_chunks/{tooth-scheme.agent-CWrQBjJM.js → tooth-scheme-3mITSXiZ.js} +146 -162
  98. package/dist/_chunks/{transcript-panel.agent-BXEYP6w-.js → transcript-panel-Bx5ANMsv.js} +110 -101
  99. package/dist/_chunks/{typing-indicator-CbUBf-Dx.js → typing-indicator-BZ5jXZPn.js} +27 -5
  100. package/dist/_chunks/{use-theme-BMUhembX.js → use-theme-B1cwAXJR.js} +2 -5
  101. package/dist/_chunks/{visually-hidden-Bw7vBHLm.js → visually-hidden-BHxEUGyT.js} +11 -2
  102. package/dist/_chunks/{warning-stack-8Pa3pekh.js → warning-stack-VygGHSqC.js} +11 -13
  103. package/dist/_chunks/{workflow-map-D2A7rTEG.js → workflow-map-C-nlogPC.js} +430 -452
  104. package/dist/agent-catalog.json +580 -15
  105. package/dist/components/_shared/index.d.ts +2 -2
  106. package/dist/components/accordion/index.d.ts +1 -1
  107. package/dist/components/accordion/index.js +5 -6
  108. package/dist/components/agenda-card/index.js +1 -1
  109. package/dist/components/agenda-tray/agenda-tray.d.ts +1 -1
  110. package/dist/components/agenda-tray/index.js +1 -1
  111. package/dist/components/ai-prompt-input/ai-prompt-input.d.ts +1 -1
  112. package/dist/components/ai-prompt-input/index.js +1 -1
  113. package/dist/components/alert/index.d.ts +1 -1
  114. package/dist/components/alert/index.js +1 -1
  115. package/dist/components/app-frame/index.js +1 -1
  116. package/dist/components/audio-recorder/index.js +1 -1
  117. package/dist/components/audio-visualiser/index.js +1 -1
  118. package/dist/components/autocomplete/index.js +1 -1
  119. package/dist/components/badge/index.js +1 -1
  120. package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
  121. package/dist/components/breadcrumb/index.js +1 -1
  122. package/dist/components/button/index.js +2 -2
  123. package/dist/components/calendar/index.js +1 -1
  124. package/dist/components/card/index.js +1 -1
  125. package/dist/components/chart/index.d.ts +1 -1
  126. package/dist/components/chart/index.js +1 -1
  127. package/dist/components/chat-container/chat-container.d.ts +1 -1
  128. package/dist/components/chat-container/index.js +2 -3
  129. package/dist/components/chat-input/chat-input.d.ts +1 -1
  130. package/dist/components/chat-input/index.js +3 -4
  131. package/dist/components/chat-message/index.js +1 -1
  132. package/dist/components/checkbox-group/index.d.ts +1 -1
  133. package/dist/components/collapsible/collapsible.d.ts +1 -1
  134. package/dist/components/collapsible/index.d.ts +1 -1
  135. package/dist/components/collapsible/index.js +1 -1
  136. package/dist/components/color-picker/index.js +1 -1
  137. package/dist/components/combobox/index.d.ts +1 -1
  138. package/dist/components/combobox/index.js +1 -1
  139. package/dist/components/command-palette/command-palette.d.ts +46 -13
  140. package/dist/components/command-palette/index.js +1 -1
  141. package/dist/components/data-table/data-table.d.ts +3 -1
  142. package/dist/components/data-table/index.js +1 -1
  143. package/dist/components/data-table/toolbar.d.ts +6 -5
  144. package/dist/components/date-picker/date-picker.d.ts +1 -1
  145. package/dist/components/date-picker/index.d.ts +1 -1
  146. package/dist/components/date-picker/index.js +1 -1
  147. package/dist/components/date-range-picker/index.js +1 -1
  148. package/dist/components/date-time-picker/index.d.ts +1 -1
  149. package/dist/components/date-time-picker/index.js +1 -1
  150. package/dist/components/description-list/description-list.d.ts +1 -2
  151. package/dist/components/description-list/index.js +1 -1
  152. package/dist/components/dialog/dialog.d.ts +2 -2
  153. package/dist/components/dialog/index.js +1 -1
  154. package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -16
  155. package/dist/components/dropdown-menu/index.js +3 -4
  156. package/dist/components/empty-state/index.js +1 -1
  157. package/dist/components/file-upload/index.d.ts +1 -1
  158. package/dist/components/file-upload/index.js +1 -1
  159. package/dist/components/floating-action-button/index.js +1 -1
  160. package/dist/components/form-field/index.js +2 -2
  161. package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
  162. package/dist/components/freemium-paywall/index.js +1 -1
  163. package/dist/components/header/index.js +1 -1
  164. package/dist/components/icon-button/index.js +1 -1
  165. package/dist/components/kbd/index.js +1 -1
  166. package/dist/components/key-value-pair/index.js +1 -1
  167. package/dist/components/link/index.js +1 -1
  168. package/dist/components/list/index.js +1 -1
  169. package/dist/components/logo/index.js +1 -1
  170. package/dist/components/matrix-rain/index.js +1 -1
  171. package/dist/components/message-card/index.d.ts +1 -1
  172. package/dist/components/message-card/index.js +1 -1
  173. package/dist/components/message-tray/index.js +1 -1
  174. package/dist/components/message-tray/message-tray.d.ts +1 -1
  175. package/dist/components/multi-select/index.js +1 -1
  176. package/dist/components/navigation-menu/index.js +1 -1
  177. package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
  178. package/dist/components/notification-card/index.d.ts +1 -1
  179. package/dist/components/notification-card/index.js +1 -1
  180. package/dist/components/notification-tray/index.js +1 -1
  181. package/dist/components/notification-tray/notification-tray.d.ts +1 -1
  182. package/dist/components/number-input/index.js +1 -1
  183. package/dist/components/otp-input/index.js +1 -1
  184. package/dist/components/pagination/index.js +1 -1
  185. package/dist/components/pagination/pagination.d.ts +4 -6
  186. package/dist/components/password-input/index.js +1 -1
  187. package/dist/components/payment-form/index.js +7 -8
  188. package/dist/components/payment-form/payment-form.d.ts +1 -1
  189. package/dist/components/pdf-viewer/index.js +1 -1
  190. package/dist/components/phone-input/index.d.ts +1 -1
  191. package/dist/components/phone-input/index.js +1 -1
  192. package/dist/components/popover/index.js +3 -4
  193. package/dist/components/privacy-lock/index.js +1 -1
  194. package/dist/components/privacy-lock/privacy-lock.d.ts +1 -1
  195. package/dist/components/progress/index.js +3 -4
  196. package/dist/components/recaptcha-widget/index.js +1 -1
  197. package/dist/components/resizable/index.d.ts +1 -1
  198. package/dist/components/resizable/index.js +1 -1
  199. package/dist/components/rich-text-editor/index.js +1 -1
  200. package/dist/components/scroll-area/index.js +1 -1
  201. package/dist/components/search-bar/index.js +1 -1
  202. package/dist/components/search-bar/search-bar.d.ts +1 -1
  203. package/dist/components/search-input/index.js +1 -1
  204. package/dist/components/select/index.js +1 -1
  205. package/dist/components/select/select.d.ts +1 -1
  206. package/dist/components/separator/index.js +1 -1
  207. package/dist/components/sheet/index.js +3 -4
  208. package/dist/components/sheet/sheet.d.ts +2 -2
  209. package/dist/components/sidebar/index.js +7 -8
  210. package/dist/components/sidebar/sidebar.d.ts +0 -2
  211. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  212. package/dist/components/signature-capture/index.js +1 -1
  213. package/dist/components/skeleton/index.js +1 -1
  214. package/dist/components/slider/index.js +1 -1
  215. package/dist/components/slot-grid/index.js +1 -1
  216. package/dist/components/sparkline/index.js +1 -1
  217. package/dist/components/spinner/index.js +1 -1
  218. package/dist/components/stat/index.js +1 -1
  219. package/dist/components/stepper-calendar/index.js +1 -1
  220. package/dist/components/stepper-calendar/stepper-calendar.d.ts +1 -1
  221. package/dist/components/stepper-progress/index.d.ts +1 -1
  222. package/dist/components/stepper-progress/index.js +1 -2
  223. package/dist/components/stepper-progress/stepper-progress.d.ts +1 -1
  224. package/dist/components/suggestion-chip/index.js +1 -1
  225. package/dist/components/switch/index.js +1 -1
  226. package/dist/components/tabs/index.d.ts +1 -1
  227. package/dist/components/tabs/index.js +1 -1
  228. package/dist/components/tag/index.js +1 -1
  229. package/dist/components/task-card/index.js +1 -1
  230. package/dist/components/task-tray/index.js +1 -1
  231. package/dist/components/task-tray/task-tray.d.ts +1 -1
  232. package/dist/components/text-area/index.js +1 -1
  233. package/dist/components/text-input/index.js +1 -1
  234. package/dist/components/theme-root/index.js +1 -1
  235. package/dist/components/theme-toggle/index.js +1 -1
  236. package/dist/components/theme-toggle/theme-toggle.d.ts +1 -1
  237. package/dist/components/time-picker/index.js +1 -1
  238. package/dist/components/time-picker/time-picker.d.ts +1 -1
  239. package/dist/components/timeline/index.js +1 -1
  240. package/dist/components/timeline/timeline.d.ts +1 -1
  241. package/dist/components/toast/index.js +1 -1
  242. package/dist/components/tooth-scheme/index.js +1 -1
  243. package/dist/components/tooth-scheme/tooth-scheme.d.ts +1 -1
  244. package/dist/components/transcript-panel/index.js +1 -1
  245. package/dist/components/transcript-panel/transcript-panel.d.ts +1 -1
  246. package/dist/components/typing-indicator/index.js +1 -1
  247. package/dist/components/visually-hidden/index.js +1 -1
  248. package/dist/components/warning-stack/index.js +1 -1
  249. package/dist/components/workflow/index.js +1 -1
  250. package/dist/components/workflow/workflow-editor.d.ts +1 -1
  251. package/dist/hooks/index.js +1 -1
  252. package/dist/index.js +392 -402
  253. package/dist/patterns/leo-assistant/index.js +1 -1
  254. package/dist/patterns/patient-shell/index.js +1 -1
  255. package/dist/safe-html/index.js +20 -3
  256. package/dist/tokens.css +2 -2
  257. package/package.json +12 -2
  258. package/dist/_chunks/accordion-BEnrZmAn.js +0 -120
  259. package/dist/_chunks/accordion.agent-BTjeO1Sx.js +0 -52
  260. package/dist/_chunks/autocomplete.agent-Dh7KioS6.js +0 -432
  261. package/dist/_chunks/chat-container-Dl0Kfy5a.js +0 -175
  262. package/dist/_chunks/chat-container.agent-CM4WModE.js +0 -27
  263. package/dist/_chunks/chat-input-C_tMQv92.js +0 -252
  264. package/dist/_chunks/chat-input.agent-Bsz3ckGa.js +0 -69
  265. package/dist/_chunks/combobox.agent-CAvUkkIe.js +0 -410
  266. package/dist/_chunks/command-palette.agent-HatEt_EM.js +0 -391
  267. package/dist/_chunks/dialog.agent-Daf1TTko.js +0 -179
  268. package/dist/_chunks/dropdown-menu-C7AZipNz.js +0 -219
  269. package/dist/_chunks/dropdown-menu.agent-BcxIKOjK.js +0 -43
  270. package/dist/_chunks/file-upload.agent-DJaH2dHg.js +0 -681
  271. package/dist/_chunks/list.agent-D0iWt4VI.js +0 -420
  272. package/dist/_chunks/payment-form.agent-kuIfodCj.js +0 -31
  273. package/dist/_chunks/popover-kFN8s84V.js +0 -229
  274. package/dist/_chunks/popover.agent-K_d1cfbj.js +0 -39
  275. package/dist/_chunks/progress-wNsqkw8I.js +0 -253
  276. package/dist/_chunks/progress.agent-C68rDOXL.js +0 -27
  277. package/dist/_chunks/resizable.agent-CMwZzvsi.js +0 -456
  278. package/dist/_chunks/sheet.agent-QAyTOxgk.js +0 -46
  279. package/dist/_chunks/sidebar.agent-C9TM_ZDZ.js +0 -49
  280. package/dist/_chunks/stepper-progress-Bmen-YXB.js +0 -149
  281. package/dist/_chunks/stepper-progress.agent-q9InWca4.js +0 -61
@@ -1,21 +1,22 @@
1
1
  import { jsxs as k, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as te, useId as se, useMemo as K, useState as I, useEffect as w, useRef as H, useImperativeHandle as re, useCallback as _ } from "react";
3
- import { useEditor as ie, EditorContent as oe } from "@tiptap/react";
4
- import ne from "@tiptap/starter-kit";
5
- import ae from "@tiptap/extension-link";
6
- import de from "@tiptap/extension-image";
7
- import { Table as ce } from "@tiptap/extension-table";
8
- import le from "@tiptap/extension-table-row";
9
- import ue from "@tiptap/extension-table-cell";
10
- import me from "@tiptap/extension-table-header";
11
- import { Markdown as fe } from "tiptap-markdown";
12
- import { p as he } from "./purify.es-DpIUMBYC.js";
13
- import { c as B } from "./index-D2ZczOXr.js";
14
- import { useTranslation as Z } from "react-i18next";
2
+ import { forwardRef as se, useId as re, useMemo as j, useState as H, useEffect as w, useRef as B, useImperativeHandle as ie, useCallback as _ } from "react";
3
+ import { useEditor as oe, EditorContent as ne } from "@tiptap/react";
4
+ import ae from "@tiptap/starter-kit";
5
+ import de from "@tiptap/extension-link";
6
+ import ce from "@tiptap/extension-image";
7
+ import { Table as le } from "@tiptap/extension-table";
8
+ import ue from "@tiptap/extension-table-row";
9
+ import me from "@tiptap/extension-table-cell";
10
+ import fe from "@tiptap/extension-table-header";
11
+ import { Markdown as he } from "tiptap-markdown";
12
+ import { p as pe } from "./purify.es-DpIUMBYC.js";
13
+ import { c as S } from "./index-D2ZczOXr.js";
14
+ import { useTranslation as U } from "react-i18next";
15
15
  import * as z from "@radix-ui/react-dialog";
16
- import { s as be } from "./safe-image-src-DstKgCo7.js";
17
- import { X as pe } from "./x-CCcI3eJp.js";
18
- import { C as ve } from "./chevron-down-BX_NP2Yh.js";
16
+ import { u as be } from "./registry-C9nwlNyL.js";
17
+ import { s as ge } from "./safe-image-src-DstKgCo7.js";
18
+ import { X as ve } from "./x-CCcI3eJp.js";
19
+ import { C as ke } from "./chevron-down-BX_NP2Yh.js";
19
20
  import { c as m } from "./createLucideIcon-CrFbzy84.js";
20
21
  /**
21
22
  * @license lucide-react v1.8.0 - ISC
@@ -23,97 +24,97 @@ import { c as m } from "./createLucideIcon-CrFbzy84.js";
23
24
  * This source code is licensed under the ISC license.
24
25
  * See the LICENSE file in the root directory of this source tree.
25
26
  */
26
- const ge = [
27
+ const ye = [
27
28
  [
28
29
  "path",
29
30
  { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
30
31
  ]
31
- ], ke = m("bold", ge);
32
+ ], xe = m("bold", ye);
32
33
  /**
33
34
  * @license lucide-react v1.8.0 - ISC
34
35
  *
35
36
  * This source code is licensed under the ISC license.
36
37
  * See the LICENSE file in the root directory of this source tree.
37
38
  */
38
- const ye = [
39
+ const ze = [
39
40
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
40
41
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
41
- ], xe = m("code", ye);
42
+ ], we = m("code", ze);
42
43
  /**
43
44
  * @license lucide-react v1.8.0 - ISC
44
45
  *
45
46
  * This source code is licensed under the ISC license.
46
47
  * See the LICENSE file in the root directory of this source tree.
47
48
  */
48
- const ze = [
49
+ const Me = [
49
50
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
50
51
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
51
52
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
52
- ], we = m("image", ze);
53
+ ], Ne = m("image", Me);
53
54
  /**
54
55
  * @license lucide-react v1.8.0 - ISC
55
56
  *
56
57
  * This source code is licensed under the ISC license.
57
58
  * See the LICENSE file in the root directory of this source tree.
58
59
  */
59
- const Me = [
60
+ const Ae = [
60
61
  ["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
61
62
  ["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
62
63
  ["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
63
- ], Ne = m("italic", Me);
64
+ ], Ce = m("italic", Ae);
64
65
  /**
65
66
  * @license lucide-react v1.8.0 - ISC
66
67
  *
67
68
  * This source code is licensed under the ISC license.
68
69
  * See the LICENSE file in the root directory of this source tree.
69
70
  */
70
- const Ae = [
71
+ const Le = [
71
72
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
72
73
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
73
74
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
74
- ], Ce = m("link-2", Ae);
75
+ ], Te = m("link-2", Le);
75
76
  /**
76
77
  * @license lucide-react v1.8.0 - ISC
77
78
  *
78
79
  * This source code is licensed under the ISC license.
79
80
  * See the LICENSE file in the root directory of this source tree.
80
81
  */
81
- const Le = [
82
+ const _e = [
82
83
  ["path", { d: "M11 5h10", key: "1cz7ny" }],
83
84
  ["path", { d: "M11 12h10", key: "1438ji" }],
84
85
  ["path", { d: "M11 19h10", key: "11t30w" }],
85
86
  ["path", { d: "M4 4h1v5", key: "10yrso" }],
86
87
  ["path", { d: "M4 9h2", key: "r1h2o0" }],
87
88
  ["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
88
- ], Te = m("list-ordered", Le);
89
+ ], Re = m("list-ordered", _e);
89
90
  /**
90
91
  * @license lucide-react v1.8.0 - ISC
91
92
  *
92
93
  * This source code is licensed under the ISC license.
93
94
  * See the LICENSE file in the root directory of this source tree.
94
95
  */
95
- const _e = [
96
+ const je = [
96
97
  ["path", { d: "M3 5h.01", key: "18ugdj" }],
97
98
  ["path", { d: "M3 12h.01", key: "nlz23k" }],
98
99
  ["path", { d: "M3 19h.01", key: "noohij" }],
99
100
  ["path", { d: "M8 5h13", key: "1pao27" }],
100
101
  ["path", { d: "M8 12h13", key: "1za7za" }],
101
102
  ["path", { d: "M8 19h13", key: "m83p4d" }]
102
- ], Re = m("list", _e);
103
+ ], Ie = m("list", je);
103
104
  /**
104
105
  * @license lucide-react v1.8.0 - ISC
105
106
  *
106
107
  * This source code is licensed under the ISC license.
107
108
  * See the LICENSE file in the root directory of this source tree.
108
109
  */
109
- const je = [["path", { d: "M5 12h14", key: "1ays0h" }]], Ie = m("minus", je);
110
+ const He = [["path", { d: "M5 12h14", key: "1ays0h" }]], Be = m("minus", He);
110
111
  /**
111
112
  * @license lucide-react v1.8.0 - ISC
112
113
  *
113
114
  * This source code is licensed under the ISC license.
114
115
  * See the LICENSE file in the root directory of this source tree.
115
116
  */
116
- const He = [
117
+ const Se = [
117
118
  [
118
119
  "path",
119
120
  {
@@ -128,39 +129,86 @@ const He = [
128
129
  key: "1ymkrd"
129
130
  }
130
131
  ]
131
- ], Be = m("quote", He);
132
+ ], $e = m("quote", Se);
132
133
  /**
133
134
  * @license lucide-react v1.8.0 - ISC
134
135
  *
135
136
  * This source code is licensed under the ISC license.
136
137
  * See the LICENSE file in the root directory of this source tree.
137
138
  */
138
- const Se = [
139
+ const De = [
139
140
  ["path", { d: "M21 7v6h-6", key: "3ptur4" }],
140
141
  ["path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7", key: "1kgawr" }]
141
- ], $e = m("redo", Se);
142
+ ], Ee = m("redo", De);
142
143
  /**
143
144
  * @license lucide-react v1.8.0 - ISC
144
145
  *
145
146
  * This source code is licensed under the ISC license.
146
147
  * See the LICENSE file in the root directory of this source tree.
147
148
  */
148
- const De = [
149
+ const Ke = [
149
150
  ["path", { d: "M12 3v18", key: "108xh3" }],
150
151
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
151
152
  ["path", { d: "M3 9h18", key: "1pudct" }],
152
153
  ["path", { d: "M3 15h18", key: "5xshup" }]
153
- ], Ee = m("table", De);
154
+ ], qe = m("table", Ke);
154
155
  /**
155
156
  * @license lucide-react v1.8.0 - ISC
156
157
  *
157
158
  * This source code is licensed under the ISC license.
158
159
  * See the LICENSE file in the root directory of this source tree.
159
160
  */
160
- const Ke = [
161
+ const Fe = [
161
162
  ["path", { d: "M3 7v6h6", key: "1v2h90" }],
162
163
  ["path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13", key: "1r6uu6" }]
163
- ], qe = m("undo", Ke), Fe = {
164
+ ], Ve = m("undo", Fe), Pe = {
165
+ id: "rich-text-editor",
166
+ capabilities: ["edit_inline"],
167
+ state: {
168
+ html: {
169
+ type: "string",
170
+ description: "Sanitised HTML representation of the editor content.",
171
+ read: (a) => a.getHTML()
172
+ },
173
+ markdown: {
174
+ type: "string",
175
+ description: "Markdown representation of the editor content.",
176
+ read: (a) => a.getMarkdown()
177
+ }
178
+ },
179
+ actions: {
180
+ set_content: {
181
+ safety: "destructive",
182
+ argsType: "{ html: string }",
183
+ description: "Replace the editor content. Loses unsaved input.",
184
+ invoke: (a, g) => {
185
+ a.setContent(g.html);
186
+ }
187
+ },
188
+ clear: {
189
+ safety: "destructive",
190
+ description: "Empty the editor. Loses unsaved input.",
191
+ invoke: (a) => {
192
+ a.clear();
193
+ }
194
+ },
195
+ focus: {
196
+ safety: "read",
197
+ description: "Move keyboard focus to the editor surface.",
198
+ invoke: (a) => {
199
+ a.focus();
200
+ }
201
+ }
202
+ },
203
+ domHooks: {
204
+ root: { attr: "data-component", value: "rich-text-editor" },
205
+ instanceId: {
206
+ attr: "data-component-id",
207
+ sourceProp: "id",
208
+ description: "Sourced from the id prop."
209
+ }
210
+ }
211
+ }, Ze = {
164
212
  FORBID_TAGS: [
165
213
  "script",
166
214
  "style",
@@ -180,12 +228,12 @@ const Ke = [
180
228
  "onblur"
181
229
  ]
182
230
  };
183
- function j(a) {
184
- return he.sanitize(a, Fe);
231
+ function I(a) {
232
+ return pe.sanitize(a, Ze);
185
233
  }
186
- const Ve = B(
234
+ const Ue = S(
187
235
  "tiptap-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
188
- ), Pe = B(
236
+ ), Ge = S(
189
237
  [
190
238
  "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
191
239
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
@@ -200,7 +248,7 @@ const Ve = B(
200
248
  },
201
249
  defaultVariants: { direction: "ltr" }
202
250
  }
203
- ), U = B(
251
+ ), G = S(
204
252
  [
205
253
  "ds:inline-flex ds:items-center ds:justify-center",
206
254
  "ds:min-block-size-[var(--min-target-size)]",
@@ -229,12 +277,12 @@ const Ve = B(
229
277
  },
230
278
  defaultVariants: { pressed: !1, disabled: !1 }
231
279
  }
232
- ), Ze = B(
280
+ ), Qe = S(
233
281
  [
234
282
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
235
283
  "ds:bg-[var(--background)] ds:text-[var(--foreground)]"
236
284
  ].join(" ")
237
- ), Ue = {
285
+ ), Xe = {
238
286
  minimal: ["bold", "italic", "link"],
239
287
  standard: [
240
288
  "bold",
@@ -261,22 +309,22 @@ const Ve = B(
261
309
  "redo"
262
310
  ]
263
311
  };
264
- function Ge({
312
+ function Ye({
265
313
  editor: a,
266
- registerRef: v,
314
+ registerRef: g,
267
315
  tabIndex: l,
268
316
  onFocus: h,
269
317
  onKeyDown: R,
270
318
  label: M,
271
319
  disabled: i,
272
- pressed: S
320
+ pressed: $
273
321
  }) {
274
- const [y, N] = I(!1), A = H(null);
322
+ const [y, N] = H(!1), A = B(null);
275
323
  w(() => {
276
324
  if (!y) return;
277
- function c($) {
278
- const g = $.target;
279
- A.current && g && !A.current.contains(g) && N(!1);
325
+ function c(D) {
326
+ const v = D.target;
327
+ A.current && v && !A.current.contains(v) && N(!1);
280
328
  }
281
329
  return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
282
330
  }, [y]);
@@ -288,7 +336,7 @@ function Ge({
288
336
  "button",
289
337
  {
290
338
  type: "button",
291
- ref: v,
339
+ ref: g,
292
340
  tabIndex: l,
293
341
  onFocus: h,
294
342
  onKeyDown: R,
@@ -300,10 +348,23 @@ function Ge({
300
348
  "aria-disabled": i || void 0,
301
349
  "aria-label": M,
302
350
  title: M,
303
- className: U({ pressed: S, disabled: i }),
351
+ className: G({ pressed: $, disabled: i }),
304
352
  children: [
305
- /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "ds:text-[length:var(--font-size-sm)] ds:font-semibold", children: "H" }),
306
- /* @__PURE__ */ r(ve, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
353
+ /* @__PURE__ */ r(
354
+ "span",
355
+ {
356
+ "aria-hidden": "true",
357
+ className: "ds:text-[length:var(--font-size-sm)] ds:font-semibold",
358
+ children: "H"
359
+ }
360
+ ),
361
+ /* @__PURE__ */ r(
362
+ ke,
363
+ {
364
+ "aria-hidden": "true",
365
+ className: "ds:block-size-4 ds:inline-size-4"
366
+ }
367
+ )
307
368
  ]
308
369
  }
309
370
  ),
@@ -343,9 +404,12 @@ function Ge({
343
404
  ) : null
344
405
  ] });
345
406
  }
346
- function Qe({ open: a, onOpenChange: v }) {
347
- const { t: l } = Z();
348
- return /* @__PURE__ */ r(z.Root, { open: a, onOpenChange: v, children: /* @__PURE__ */ k(z.Portal, { children: [
407
+ function Je({
408
+ open: a,
409
+ onOpenChange: g
410
+ }) {
411
+ const { t: l } = U();
412
+ return /* @__PURE__ */ r(z.Root, { open: a, onOpenChange: g, children: /* @__PURE__ */ k(z.Portal, { children: [
349
413
  /* @__PURE__ */ r(
350
414
  z.Overlay,
351
415
  {
@@ -370,13 +434,7 @@ function Qe({ open: a, onOpenChange: v }) {
370
434
  ].join(" "),
371
435
  children: [
372
436
  /* @__PURE__ */ k("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-md)]", children: [
373
- /* @__PURE__ */ r(
374
- z.Title,
375
- {
376
- className: "type-title-card ds:leading-snug",
377
- children: l("editor.shortcuts.title")
378
- }
379
- ),
437
+ /* @__PURE__ */ r(z.Title, { className: "type-title-card ds:leading-snug", children: l("editor.shortcuts.title") }),
380
438
  /* @__PURE__ */ r(z.Close, { asChild: !0, children: /* @__PURE__ */ r(
381
439
  "button",
382
440
  {
@@ -393,7 +451,13 @@ function Qe({ open: a, onOpenChange: v }) {
393
451
  "ds:focus-visible:outline-[var(--ring)]",
394
452
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
395
453
  ].join(" "),
396
- children: /* @__PURE__ */ r(pe, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
454
+ children: /* @__PURE__ */ r(
455
+ ve,
456
+ {
457
+ "aria-hidden": "true",
458
+ className: "ds:block-size-4 ds:inline-size-4"
459
+ }
460
+ )
397
461
  }
398
462
  ) })
399
463
  ] }),
@@ -430,39 +494,39 @@ function Qe({ open: a, onOpenChange: v }) {
430
494
  )
431
495
  ] }) });
432
496
  }
433
- const Xe = te(
497
+ const We = se(
434
498
  ({
435
499
  id: a,
436
- defaultValue: v,
500
+ defaultValue: g,
437
501
  value: l,
438
502
  onChange: h,
439
503
  toolbar: R = "standard",
440
504
  placeholder: M,
441
505
  readOnly: i = !1,
442
- ariaLabel: S,
506
+ ariaLabel: $,
443
507
  minHeight: y,
444
508
  className: N
445
509
  }, A) => {
446
- const { t: o } = Z(), c = se(), $ = K(
510
+ const { t: o } = U(), c = re(), D = j(
447
511
  () => `rte-${c.replace(/[^a-zA-Z0-9-_]/g, "")}`,
448
512
  [c]
449
- ), [g, G] = I(!1);
513
+ ), [v, Q] = H(!1);
450
514
  w(() => {
451
- typeof document > "u" || G(document.documentElement.dir === "rtl");
515
+ typeof document > "u" || Q(document.documentElement.dir === "rtl");
452
516
  }, []);
453
- const [Q, q] = I(!1), C = H(null), L = H(h);
517
+ const [X, F] = H(!1), C = B(null), L = B(h);
454
518
  w(() => {
455
519
  L.current = h;
456
520
  }, [h]);
457
- const X = K(() => {
458
- const s = l ?? v ?? "";
459
- return s ? j(s) : "";
460
- }, [v, l]), e = ie({
521
+ const Y = j(() => {
522
+ const s = l ?? g ?? "";
523
+ return s ? I(s) : "";
524
+ }, [g, l]), e = oe({
461
525
  extensions: [
462
- ne.configure({
526
+ ae.configure({
463
527
  heading: { levels: [1, 2, 3] }
464
528
  }),
465
- ae.configure({
529
+ de.configure({
466
530
  protocols: ["http", "https", "mailto", "tel"],
467
531
  HTMLAttributes: {
468
532
  rel: "noopener noreferrer",
@@ -470,17 +534,17 @@ const Xe = te(
470
534
  },
471
535
  validate: (s) => /^(https?:|mailto:|tel:)/i.test(s)
472
536
  }),
473
- de,
474
- ce.configure({ resizable: !1 }),
475
- le,
537
+ ce,
538
+ le.configure({ resizable: !1 }),
476
539
  ue,
477
540
  me,
478
- fe.configure({
541
+ fe,
542
+ he.configure({
479
543
  html: !1,
480
544
  transformPastedText: !0
481
545
  })
482
546
  ],
483
- content: X,
547
+ content: Y,
484
548
  editable: !i,
485
549
  immediatelyRender: !1,
486
550
  shouldRerenderOnTransaction: !0,
@@ -488,21 +552,21 @@ const Xe = te(
488
552
  attributes: {
489
553
  role: "textbox",
490
554
  "aria-multiline": "true",
491
- "aria-label": S ?? o("editor.placeholder"),
555
+ "aria-label": $ ?? o("editor.placeholder"),
492
556
  "data-placeholder": M ?? o("editor.placeholder")
493
557
  },
494
558
  transformPastedHTML(s) {
495
- return j(s);
559
+ return I(s);
496
560
  },
497
561
  handleKeyDown(s, t) {
498
- return (t.metaKey || t.ctrlKey) && t.key === "/" ? (t.preventDefault(), q(!0), !0) : !1;
562
+ return (t.metaKey || t.ctrlKey) && t.key === "/" ? (t.preventDefault(), F(!0), !0) : !1;
499
563
  }
500
564
  },
501
565
  onUpdate({ editor: s }) {
502
566
  L.current && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
503
- var d, b, p;
504
- const t = s.getHTML(), f = ((b = (d = s.storage.markdown) == null ? void 0 : d.getMarkdown) == null ? void 0 : b.call(d)) ?? "";
505
- (p = L.current) == null || p.call(L, { html: t, markdown: f });
567
+ var d, p, b;
568
+ const t = s.getHTML(), f = ((p = (d = s.storage.markdown) == null ? void 0 : d.getMarkdown) == null ? void 0 : p.call(d)) ?? "";
569
+ (b = L.current) == null || b.call(L, { html: t, markdown: f });
506
570
  }, 100));
507
571
  }
508
572
  });
@@ -512,10 +576,10 @@ const Xe = te(
512
576
  e && e.setEditable(!i);
513
577
  }, [e, i]), w(() => {
514
578
  if (!e || l === void 0 || e.getHTML() === l) return;
515
- const t = j(l);
579
+ const t = I(l);
516
580
  e.commands.setContent(t, { emitUpdate: !1 });
517
- }, [e, l]), re(
518
- A,
581
+ }, [e, l]);
582
+ const E = j(
519
583
  () => ({
520
584
  getHTML() {
521
585
  return (e == null ? void 0 : e.getHTML()) ?? "";
@@ -526,7 +590,7 @@ const Xe = te(
526
590
  },
527
591
  setContent(s) {
528
592
  if (!e) return;
529
- const t = j(s);
593
+ const t = I(s);
530
594
  e.commands.setContent(t);
531
595
  },
532
596
  focus() {
@@ -538,24 +602,25 @@ const Xe = te(
538
602
  }),
539
603
  [e]
540
604
  );
541
- const F = H([]), [T, D] = I(0), E = K(() => Ue[R], [R]), Y = _(
605
+ ie(A, () => E, [E]), be(Pe, E, a);
606
+ const V = B([]), [T, K] = H(0), q = j(() => Xe[R], [R]), J = _(
542
607
  (s) => (t) => {
543
- F.current[s] = t;
608
+ V.current[s] = t;
544
609
  },
545
610
  []
546
- ), V = _((s) => {
547
- const t = F.current[s];
611
+ ), P = _((s) => {
612
+ const t = V.current[s];
548
613
  t && t.focus();
549
- }, []), P = _(
614
+ }, []), Z = _(
550
615
  (s) => {
551
- const t = E.length;
616
+ const t = q.length;
552
617
  if (t === 0) return;
553
- const u = g ? "ArrowLeft" : "ArrowRight", f = g ? "ArrowRight" : "ArrowLeft";
618
+ const u = v ? "ArrowLeft" : "ArrowRight", f = v ? "ArrowRight" : "ArrowLeft";
554
619
  let d = null;
555
- s.key === u ? d = (T + 1) % t : s.key === f ? d = (T - 1 + t) % t : s.key === "Home" ? d = 0 : s.key === "End" && (d = t - 1), d !== null && (s.preventDefault(), D(d), V(d));
620
+ s.key === u ? d = (T + 1) % t : s.key === f ? d = (T - 1 + t) % t : s.key === "Home" ? d = 0 : s.key === "End" && (d = t - 1), d !== null && (s.preventDefault(), K(d), P(d));
556
621
  },
557
- [T, V, g, E.length]
558
- ), J = _(
622
+ [T, P, v, q.length]
623
+ ), W = _(
559
624
  (s) => {
560
625
  if (s.preventDefault(), !e) return;
561
626
  const t = e.getAttributes("link").href, u = window.prompt(o("editor.link.insert"), t ?? "");
@@ -568,21 +633,21 @@ const Xe = te(
568
633
  /^(https?:|mailto:|tel:)/i.test(f) && e.chain().focus().extendMarkRange("link").setLink({ href: f }).run();
569
634
  },
570
635
  [e, o]
571
- ), W = _(() => {
636
+ ), O = _(() => {
572
637
  if (!e) return;
573
638
  const s = window.prompt(o("editor.image.insert"), "");
574
639
  if (s === null) return;
575
- const t = be(s);
640
+ const t = ge(s);
576
641
  t && e.chain().focus().setImage({ src: t }).run();
577
642
  }, [e, o]);
578
- function O(s, t) {
643
+ function ee(s, t) {
579
644
  if (!e) return null;
580
- const u = Y(t), f = {
645
+ const u = J(t), f = {
581
646
  tabIndex: t === T ? 0 : -1,
582
- onFocus: () => D(t),
583
- onKeyDown: P
584
- }, d = (n, x) => U({ pressed: n, disabled: x });
585
- function b(n) {
647
+ onFocus: () => K(t),
648
+ onKeyDown: Z
649
+ }, d = (n, x) => G({ pressed: n, disabled: x });
650
+ function p(n) {
586
651
  return /* @__PURE__ */ r(
587
652
  "button",
588
653
  {
@@ -602,7 +667,7 @@ const Xe = te(
602
667
  }
603
668
  );
604
669
  }
605
- function p(n) {
670
+ function b(n) {
606
671
  return /* @__PURE__ */ r(
607
672
  "button",
608
673
  {
@@ -627,119 +692,191 @@ const Xe = te(
627
692
  }
628
693
  switch (s) {
629
694
  case "bold":
630
- return b({
695
+ return p({
631
696
  label: o("editor.bold"),
632
697
  pressed: e.isActive("bold"),
633
698
  disabled: i,
634
699
  shortcut: "Control+B Meta+B",
635
700
  onActivate: () => e.chain().focus().toggleBold().run(),
636
- icon: /* @__PURE__ */ r(ke, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
701
+ icon: /* @__PURE__ */ r(
702
+ xe,
703
+ {
704
+ "aria-hidden": "true",
705
+ className: "ds:block-size-4 ds:inline-size-4"
706
+ }
707
+ )
637
708
  });
638
709
  case "italic":
639
- return b({
710
+ return p({
640
711
  label: o("editor.italic"),
641
712
  pressed: e.isActive("italic"),
642
713
  disabled: i,
643
714
  shortcut: "Control+I Meta+I",
644
715
  onActivate: () => e.chain().focus().toggleItalic().run(),
645
- icon: /* @__PURE__ */ r(Ne, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
716
+ icon: /* @__PURE__ */ r(
717
+ Ce,
718
+ {
719
+ "aria-hidden": "true",
720
+ className: "ds:block-size-4 ds:inline-size-4"
721
+ }
722
+ )
646
723
  });
647
724
  case "link":
648
- return p({
725
+ return b({
649
726
  label: o("editor.link.insert"),
650
727
  disabled: i,
651
728
  shortcut: "Control+K Meta+K",
652
- onActivate: J,
653
- icon: /* @__PURE__ */ r(Ce, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
729
+ onActivate: W,
730
+ icon: /* @__PURE__ */ r(
731
+ Te,
732
+ {
733
+ "aria-hidden": "true",
734
+ className: "ds:block-size-4 ds:inline-size-4"
735
+ }
736
+ )
654
737
  });
655
738
  case "heading":
656
739
  return /* @__PURE__ */ r(
657
- Ge,
740
+ Ye,
658
741
  {
659
742
  editor: e,
660
743
  registerRef: u,
661
744
  tabIndex: t === T ? 0 : -1,
662
- onFocus: () => D(t),
663
- onKeyDown: P,
745
+ onFocus: () => K(t),
746
+ onKeyDown: Z,
664
747
  label: o("editor.heading"),
665
748
  disabled: i,
666
749
  pressed: e.isActive("heading", { level: 1 }) || e.isActive("heading", { level: 2 }) || e.isActive("heading", { level: 3 })
667
750
  }
668
751
  );
669
752
  case "bulletList":
670
- return b({
753
+ return p({
671
754
  label: o("editor.list.bullet"),
672
755
  pressed: e.isActive("bulletList"),
673
756
  disabled: i,
674
757
  onActivate: () => e.chain().focus().toggleBulletList().run(),
675
- icon: /* @__PURE__ */ r(Re, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
758
+ icon: /* @__PURE__ */ r(
759
+ Ie,
760
+ {
761
+ "aria-hidden": "true",
762
+ className: "ds:block-size-4 ds:inline-size-4"
763
+ }
764
+ )
676
765
  });
677
766
  case "orderedList":
678
- return b({
767
+ return p({
679
768
  label: o("editor.list.ordered"),
680
769
  pressed: e.isActive("orderedList"),
681
770
  disabled: i,
682
771
  onActivate: () => e.chain().focus().toggleOrderedList().run(),
683
- icon: /* @__PURE__ */ r(Te, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
772
+ icon: /* @__PURE__ */ r(
773
+ Re,
774
+ {
775
+ "aria-hidden": "true",
776
+ className: "ds:block-size-4 ds:inline-size-4"
777
+ }
778
+ )
684
779
  });
685
780
  case "quote":
686
- return b({
781
+ return p({
687
782
  label: o("editor.quote"),
688
783
  pressed: e.isActive("blockquote"),
689
784
  disabled: i,
690
785
  onActivate: () => e.chain().focus().toggleBlockquote().run(),
691
- icon: /* @__PURE__ */ r(Be, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
786
+ icon: /* @__PURE__ */ r(
787
+ $e,
788
+ {
789
+ "aria-hidden": "true",
790
+ className: "ds:block-size-4 ds:inline-size-4"
791
+ }
792
+ )
692
793
  });
693
794
  case "image":
694
- return p({
795
+ return b({
695
796
  label: o("editor.image.insert"),
696
797
  disabled: i,
697
- onActivate: W,
698
- icon: /* @__PURE__ */ r(we, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
798
+ onActivate: O,
799
+ icon: /* @__PURE__ */ r(
800
+ Ne,
801
+ {
802
+ "aria-hidden": "true",
803
+ className: "ds:block-size-4 ds:inline-size-4"
804
+ }
805
+ )
699
806
  });
700
807
  case "table":
701
- return p({
808
+ return b({
702
809
  label: o("editor.table.insert"),
703
810
  disabled: i,
704
811
  onActivate: () => e.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run(),
705
- icon: /* @__PURE__ */ r(Ee, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
812
+ icon: /* @__PURE__ */ r(
813
+ qe,
814
+ {
815
+ "aria-hidden": "true",
816
+ className: "ds:block-size-4 ds:inline-size-4"
817
+ }
818
+ )
706
819
  });
707
820
  case "codeBlock":
708
- return b({
821
+ return p({
709
822
  label: o("editor.codeBlock"),
710
823
  pressed: e.isActive("codeBlock"),
711
824
  disabled: i,
712
825
  onActivate: () => e.chain().focus().toggleCodeBlock().run(),
713
- icon: /* @__PURE__ */ r(xe, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
826
+ icon: /* @__PURE__ */ r(
827
+ we,
828
+ {
829
+ "aria-hidden": "true",
830
+ className: "ds:block-size-4 ds:inline-size-4"
831
+ }
832
+ )
714
833
  });
715
834
  case "horizontalRule":
716
- return p({
835
+ return b({
717
836
  label: o("editor.horizontalRule"),
718
837
  disabled: i,
719
838
  onActivate: () => e.chain().focus().setHorizontalRule().run(),
720
- icon: /* @__PURE__ */ r(Ie, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
839
+ icon: /* @__PURE__ */ r(
840
+ Be,
841
+ {
842
+ "aria-hidden": "true",
843
+ className: "ds:block-size-4 ds:inline-size-4"
844
+ }
845
+ )
721
846
  });
722
847
  case "undo":
723
- return p({
848
+ return b({
724
849
  label: o("editor.undo"),
725
850
  disabled: i || !e.can().undo(),
726
851
  shortcut: "Control+Z Meta+Z",
727
852
  onActivate: () => e.chain().focus().undo().run(),
728
- icon: /* @__PURE__ */ r(qe, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
853
+ icon: /* @__PURE__ */ r(
854
+ Ve,
855
+ {
856
+ "aria-hidden": "true",
857
+ className: "ds:block-size-4 ds:inline-size-4"
858
+ }
859
+ )
729
860
  });
730
861
  case "redo":
731
- return p({
862
+ return b({
732
863
  label: o("editor.redo"),
733
864
  disabled: i || !e.can().redo(),
734
865
  shortcut: "Control+Shift+Z Meta+Shift+Z",
735
866
  onActivate: () => e.chain().focus().redo().run(),
736
- icon: /* @__PURE__ */ r($e, { "aria-hidden": "true", className: "ds:block-size-4 ds:inline-size-4" })
867
+ icon: /* @__PURE__ */ r(
868
+ Ee,
869
+ {
870
+ "aria-hidden": "true",
871
+ className: "ds:block-size-4 ds:inline-size-4"
872
+ }
873
+ )
737
874
  });
738
875
  default:
739
876
  return null;
740
877
  }
741
878
  }
742
- const ee = (() => {
879
+ const te = (() => {
743
880
  switch (y) {
744
881
  case "sm":
745
882
  return "min-block-size-[8rem]";
@@ -754,9 +891,9 @@ const Xe = te(
754
891
  return /* @__PURE__ */ k(
755
892
  "div",
756
893
  {
757
- id: $,
758
- className: [Ve(), N].filter(Boolean).join(" "),
759
- dir: g ? "rtl" : void 0,
894
+ id: D,
895
+ className: [Ue(), N].filter(Boolean).join(" "),
896
+ dir: v ? "rtl" : void 0,
760
897
  "data-component": "rich-text-editor",
761
898
  "data-component-id": a,
762
899
  children: [
@@ -765,78 +902,30 @@ const Xe = te(
765
902
  {
766
903
  role: "toolbar",
767
904
  "aria-label": o("editor.toolbarLabel"),
768
- className: Pe({ direction: g ? "rtl" : "ltr" }),
769
- children: E.map((s, t) => /* @__PURE__ */ r("span", { className: "ds:contents", children: O(s, t) }, s))
905
+ className: Ge({ direction: v ? "rtl" : "ltr" }),
906
+ children: q.map((s, t) => /* @__PURE__ */ r("span", { className: "ds:contents", children: ee(s, t) }, s))
770
907
  }
771
908
  ),
772
909
  /* @__PURE__ */ r(
773
910
  "div",
774
911
  {
775
- className: [Ze(), ee].filter(Boolean).join(" "),
776
- children: /* @__PURE__ */ r(oe, { editor: e })
912
+ className: [Qe(), te].filter(Boolean).join(" "),
913
+ children: /* @__PURE__ */ r(ne, { editor: e })
777
914
  }
778
915
  ),
779
- /* @__PURE__ */ r(Qe, { open: Q, onOpenChange: q })
916
+ /* @__PURE__ */ r(Je, { open: X, onOpenChange: F })
780
917
  ]
781
918
  }
782
919
  );
783
920
  }
784
921
  );
785
- Xe.displayName = "RichTextEditor";
786
- const ht = {
787
- id: "rich-text-editor",
788
- capabilities: ["edit_inline"],
789
- state: {
790
- html: {
791
- type: "string",
792
- description: "Sanitised HTML representation of the editor content.",
793
- read: (a) => a.getHTML()
794
- },
795
- markdown: {
796
- type: "string",
797
- description: "Markdown representation of the editor content.",
798
- read: (a) => a.getMarkdown()
799
- }
800
- },
801
- actions: {
802
- set_content: {
803
- safety: "destructive",
804
- argsType: "{ html: string }",
805
- description: "Replace the editor content. Loses unsaved input.",
806
- invoke: (a, v) => {
807
- a.setContent(v.html);
808
- }
809
- },
810
- clear: {
811
- safety: "destructive",
812
- description: "Empty the editor. Loses unsaved input.",
813
- invoke: (a) => {
814
- a.clear();
815
- }
816
- },
817
- focus: {
818
- safety: "read",
819
- description: "Move keyboard focus to the editor surface.",
820
- invoke: (a) => {
821
- a.focus();
822
- }
823
- }
824
- },
825
- domHooks: {
826
- root: { attr: "data-component", value: "rich-text-editor" },
827
- instanceId: {
828
- attr: "data-component-id",
829
- sourceProp: "id",
830
- description: "Sourced from the id prop."
831
- }
832
- }
833
- };
922
+ We.displayName = "RichTextEditor";
834
923
  export {
835
- Xe as R,
836
- Pe as a,
837
- Ze as e,
838
- ht as r,
839
- U as t,
840
- Ve as w
924
+ We as R,
925
+ Ge as a,
926
+ Qe as e,
927
+ Pe as r,
928
+ G as t,
929
+ Ue as w
841
930
  };
842
- //# sourceMappingURL=rich-text-editor.agent-DnE125Tz.js.map
931
+ //# sourceMappingURL=rich-text-editor-C7TCIlQO.js.map