themelia-react-ui 1.0.0 → 1.0.2

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 (507) hide show
  1. package/CHANGELOG.md +190 -1
  2. package/README.md +92 -13
  3. package/dist/{accordion-BRWh3BM1.js → accordion-BRTcsp8J.js} +8 -8
  4. package/dist/accordion-BRTcsp8J.js.map +1 -0
  5. package/dist/{action-menu-Cx3SdfbN.js → action-menu-Drxw_vJk.js} +36 -36
  6. package/dist/action-menu-Drxw_vJk.js.map +1 -0
  7. package/dist/affordance-geometry.generated-CL84ZN9A.js +63 -0
  8. package/dist/affordance-geometry.generated-CL84ZN9A.js.map +1 -0
  9. package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-DLVdK0Py.js} +151 -155
  10. package/dist/ai-artifact-DLVdK0Py.js.map +1 -0
  11. package/dist/{app-shell-BH_bGcE2.js → app-shell-C_fKpljx.js} +11 -10
  12. package/dist/app-shell-C_fKpljx.js.map +1 -0
  13. package/dist/{attachment-DsLgNHXt.js → attachment-DbjUWsP0.js} +12 -12
  14. package/dist/{attachment-DsLgNHXt.js.map → attachment-DbjUWsP0.js.map} +1 -1
  15. package/dist/auth-CAQcasMV.js +723 -0
  16. package/dist/auth-CAQcasMV.js.map +1 -0
  17. package/dist/{avatar-CsnWaYmt.js → avatar-Bu2HhitA.js} +76 -71
  18. package/dist/avatar-Bu2HhitA.js.map +1 -0
  19. package/dist/{badge-BZXZT9wd.js → badge-CzId1Wlm.js} +4 -4
  20. package/dist/{badge-BZXZT9wd.js.map → badge-CzId1Wlm.js.map} +1 -1
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/buttons.js +3 -2
  27. package/dist/base/cards.js +3 -3
  28. package/dist/base/carousel.js +25 -27
  29. package/dist/base/carousel.js.map +1 -1
  30. package/dist/base/cascader.js +150 -148
  31. package/dist/base/cascader.js.map +1 -1
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +3 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +1 -1
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +3 -3
  39. package/dist/base/display.js +7 -7
  40. package/dist/base/feedback.js +4 -3
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +233 -0
  44. package/dist/base/inline-edit.js.map +1 -0
  45. package/dist/base/item.js +1 -1
  46. package/dist/base/media-gallery.js +1 -1
  47. package/dist/base/navigation.js +6 -6
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +1 -1
  51. package/dist/base/repeaters.js +33 -33
  52. package/dist/base/repeaters.js.map +1 -1
  53. package/dist/base/sheet.js +1 -1
  54. package/dist/base/sidebar.js +1 -1
  55. package/dist/base/signature-pad.js +83 -81
  56. package/dist/base/signature-pad.js.map +1 -1
  57. package/dist/base/skeleton.js +1 -1
  58. package/dist/base/spinner.js +1 -1
  59. package/dist/base/structure.js +1 -1
  60. package/dist/base/table.js +1 -1
  61. package/dist/base/text-inputs.js +2 -2
  62. package/dist/base/toaster.js +6 -6
  63. package/dist/base/toaster.js.map +1 -1
  64. package/dist/base/tree.js +1 -1
  65. package/dist/base/upload-queue.js +1 -1
  66. package/dist/base/upload.js +3 -3
  67. package/dist/base/value-inputs.js +1 -1
  68. package/dist/blocks/admin.js +134 -134
  69. package/dist/blocks/admin.js.map +1 -1
  70. package/dist/blocks/ai.js +120 -117
  71. package/dist/blocks/ai.js.map +1 -1
  72. package/dist/blocks/analytics/usage-card.js +3 -0
  73. package/dist/blocks/analytics.js +530 -491
  74. package/dist/blocks/analytics.js.map +1 -1
  75. package/dist/blocks/collaboration.js +2 -2
  76. package/dist/blocks/commerce/receipt.js +1 -1
  77. package/dist/blocks/commerce.js +395 -383
  78. package/dist/blocks/commerce.js.map +1 -1
  79. package/dist/blocks/data-display.js +1 -1
  80. package/dist/blocks/onboarding.js +6 -6
  81. package/dist/blocks/onboarding.js.map +1 -1
  82. package/dist/blocks/planning.js +311 -0
  83. package/dist/blocks/planning.js.map +1 -0
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BuYz5SDU.js} +9 -8
  86. package/dist/breadcrumbs-BuYz5SDU.js.map +1 -0
  87. package/dist/button-BZDasD04.js +651 -0
  88. package/dist/button-BZDasD04.js.map +1 -0
  89. package/dist/{button-BS6l5JUw.js → button-BZyfTvwm.js} +3 -3
  90. package/dist/button-BZyfTvwm.js.map +1 -0
  91. package/dist/buttons-D_6KJvEE.js +99 -0
  92. package/dist/buttons-D_6KJvEE.js.map +1 -0
  93. package/dist/{cards-BMB0laLG.js → cards-qGSErLw_.js} +12 -12
  94. package/dist/{cards-BMB0laLG.js.map → cards-qGSErLw_.js.map} +1 -1
  95. package/dist/chart-Bsc5BICK.js +150 -0
  96. package/dist/chart-Bsc5BICK.js.map +1 -0
  97. package/dist/checkbox-BQNDjUCh.js +34 -0
  98. package/dist/checkbox-BQNDjUCh.js.map +1 -0
  99. package/dist/choice-inputs-Mk3iWbhr.js +725 -0
  100. package/dist/choice-inputs-Mk3iWbhr.js.map +1 -0
  101. package/dist/{code-block-DIlqzoiD.js → code-block-DzHKRybS.js} +23 -23
  102. package/dist/code-block-DzHKRybS.js.map +1 -0
  103. package/dist/{collapsible-DsnktFNv.js → collapsible-ClvC7Bj3.js} +3 -3
  104. package/dist/{collapsible-DsnktFNv.js.map → collapsible-ClvC7Bj3.js.map} +1 -1
  105. package/dist/{collection-content-C4fthJV_.js → collection-content-D6S8cv_n.js} +3 -3
  106. package/dist/{collection-content-C4fthJV_.js.map → collection-content-D6S8cv_n.js.map} +1 -1
  107. package/dist/{combobox-HDftpzxt.js → combobox-BFnbJJp3.js} +18 -18
  108. package/dist/combobox-BFnbJJp3.js.map +1 -0
  109. package/dist/{combobox-CHD750do.js → combobox-hozNwUcc.js} +313 -316
  110. package/dist/combobox-hozNwUcc.js.map +1 -0
  111. package/dist/{command-D0kWBZfd.js → command-BnmSchli.js} +9 -9
  112. package/dist/command-BnmSchli.js.map +1 -0
  113. package/dist/comments-u5L0OGip.js +1156 -0
  114. package/dist/comments-u5L0OGip.js.map +1 -0
  115. package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
  116. package/dist/components/base/buttons/button.recipes.d.ts +10 -19
  117. package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
  118. package/dist/components/base/cards/card.recipes.d.ts +13 -5
  119. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
  120. package/dist/components/base/cards/smart-card.types.d.ts +3 -1
  121. package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
  122. package/dist/components/base/date-pickers/datepicker.types.d.ts +3 -0
  123. package/dist/components/base/forms/form-field.d.ts +1 -0
  124. package/dist/components/base/forms/form-sizing.d.ts +3 -3
  125. package/dist/components/base/inline-edit/index.d.ts +2 -0
  126. package/dist/components/base/inline-edit/inline-edit.d.ts +81 -0
  127. package/dist/components/base/inline-edit/inline-edit.recipes.d.ts +6 -0
  128. package/dist/components/base/navigation/tabs.d.ts +3 -5
  129. package/dist/components/base/popover/popover.recipes.d.ts +3 -3
  130. package/dist/components/base/structure/structure.recipes.d.ts +6 -0
  131. package/dist/components/base/table/index.d.ts +1 -1
  132. package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
  133. package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
  134. package/dist/components/blocks/analytics/index.d.ts +1 -0
  135. package/dist/components/blocks/analytics/types.d.ts +1 -1
  136. package/dist/components/blocks/analytics/usage-card/index.d.ts +3 -0
  137. package/dist/components/blocks/analytics/usage-card/types.d.ts +52 -0
  138. package/dist/components/blocks/analytics/usage-card/usage-card.d.ts +6 -0
  139. package/dist/components/blocks/analytics/usage-card/usage-card.data.d.ts +19 -0
  140. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +22 -0
  141. package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
  142. package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
  143. package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
  144. package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
  145. package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
  146. package/dist/components/blocks/planning/index.d.ts +3 -0
  147. package/dist/components/blocks/planning/task-card.d.ts +3 -0
  148. package/dist/components/blocks/planning/task-card.strings.d.ts +15 -0
  149. package/dist/components/blocks/planning/task-card.types.d.ts +66 -0
  150. package/dist/components/features/combobox/components/error-message.d.ts +1 -1
  151. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
  152. package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
  153. package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
  154. package/dist/components/features/media-library/media-library.d.ts +1 -1
  155. package/dist/components/features/media-library/media-library.types.d.ts +9 -1
  156. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  157. package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
  158. package/dist/components/features/overlays/overlays.types.d.ts +5 -4
  159. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
  160. package/dist/components/features/table/data-table.d.ts +1 -1
  161. package/dist/components/features/table/table.types.d.ts +1 -1
  162. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
  163. package/dist/components/layout/auth/auth.types.d.ts +1 -0
  164. package/dist/components/layout/page/page.d.ts +0 -1
  165. package/dist/components/layout/page/page.types.d.ts +9 -3
  166. package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
  167. package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
  168. package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
  169. package/dist/components/typography/heading.d.ts +5 -2
  170. package/dist/components/typography/index.d.ts +1 -1
  171. package/dist/components/typography/text.styles.d.ts +10 -0
  172. package/dist/components/ui/popover.d.ts +1 -1
  173. package/dist/components/ui/sidebar.d.ts +1 -1
  174. package/dist/components/ui/table.d.ts +2 -1
  175. package/dist/container.recipes-D9t8MHR3.js +27 -0
  176. package/dist/container.recipes-D9t8MHR3.js.map +1 -0
  177. package/dist/{containers-CPNyNo1_.js → containers-DqB-bSYE.js} +34 -56
  178. package/dist/containers-DqB-bSYE.js.map +1 -0
  179. package/dist/control-group-recipes-DBXmfh2E.js +21 -0
  180. package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
  181. package/dist/{copyable-B7SBXJMr.js → copyable-BTSByfmq.js} +6 -6
  182. package/dist/{copyable-B7SBXJMr.js.map → copyable-BTSByfmq.js.map} +1 -1
  183. package/dist/{data-display-b3d1TfL4.js → data-display-Bihs9Ven.js} +542 -329
  184. package/dist/data-display-Bihs9Ven.js.map +1 -0
  185. package/dist/{date-BFNMnrS5.js → date-DOKhJPu7.js} +4 -4
  186. package/dist/{date-BFNMnrS5.js.map → date-DOKhJPu7.js.map} +1 -1
  187. package/dist/{date-picker-DI6kPNof.js → date-picker-DzP5HQq7.js} +492 -472
  188. package/dist/date-picker-DzP5HQq7.js.map +1 -0
  189. package/dist/date-pickers-BpgGz7S-.js +196 -0
  190. package/dist/date-pickers-BpgGz7S-.js.map +1 -0
  191. package/dist/{display-ByI5tkqy.js → display-CS6Hbk18.js} +8 -8
  192. package/dist/{display-ByI5tkqy.js.map → display-CS6Hbk18.js.map} +1 -1
  193. package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-D-boNgGO.js} +7 -7
  194. package/dist/{dropdown-menu-BlnyHr-9.js.map → dropdown-menu-D-boNgGO.js.map} +1 -1
  195. package/dist/features/activities.js +152 -141
  196. package/dist/features/activities.js.map +1 -1
  197. package/dist/features/ai-chat.js +182 -179
  198. package/dist/features/ai-chat.js.map +1 -1
  199. package/dist/features/async-preview.js +9 -9
  200. package/dist/features/async-preview.js.map +1 -1
  201. package/dist/features/combobox.js +1 -1
  202. package/dist/features/comments.js +1 -1
  203. package/dist/features/data-view.js +25 -23
  204. package/dist/features/data-view.js.map +1 -1
  205. package/dist/features/email-composer/engine.js +1 -1
  206. package/dist/features/email-composer.js +103 -104
  207. package/dist/features/email-composer.js.map +1 -1
  208. package/dist/features/event-calendar.js +375 -373
  209. package/dist/features/event-calendar.js.map +1 -1
  210. package/dist/features/filters.js +1 -1
  211. package/dist/features/global-search.js +222 -224
  212. package/dist/features/global-search.js.map +1 -1
  213. package/dist/features/kanban.js +29 -29
  214. package/dist/features/kanban.js.map +1 -1
  215. package/dist/features/map.js +59 -58
  216. package/dist/features/map.js.map +1 -1
  217. package/dist/features/media-library.js +856 -855
  218. package/dist/features/media-library.js.map +1 -1
  219. package/dist/features/mentions.js +1 -1
  220. package/dist/features/overlays.js +1 -1
  221. package/dist/features/products.js +1210 -1209
  222. package/dist/features/products.js.map +1 -1
  223. package/dist/features/questionnaire.js +133 -132
  224. package/dist/features/questionnaire.js.map +1 -1
  225. package/dist/features/resource-assignment.js +29 -31
  226. package/dist/features/resource-assignment.js.map +1 -1
  227. package/dist/features/resource.js +13 -13
  228. package/dist/features/resource.js.map +1 -1
  229. package/dist/features/rich-text-editor.js +2 -2
  230. package/dist/features/schema-form.js +82 -82
  231. package/dist/features/schema-form.js.map +1 -1
  232. package/dist/features/suggestions.js +3 -3
  233. package/dist/features/sync.js +4 -4
  234. package/dist/features/sync.js.map +1 -1
  235. package/dist/features/table.js +1 -1
  236. package/dist/features/theme-tweaker.js +456 -450
  237. package/dist/features/theme-tweaker.js.map +1 -1
  238. package/dist/feedback-CJkUAapr.js +233 -0
  239. package/dist/feedback-CJkUAapr.js.map +1 -0
  240. package/dist/field-affordance-recipes-uKY4MsZ_.js +25 -0
  241. package/dist/field-affordance-recipes-uKY4MsZ_.js.map +1 -0
  242. package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-DQQpiLWC.js} +3 -3
  243. package/dist/field-state-recipes-DQQpiLWC.js.map +1 -0
  244. package/dist/{filters-qtrcv1hf.js → filters-D6FF8L6s.js} +715 -720
  245. package/dist/filters-D6FF8L6s.js.map +1 -0
  246. package/dist/{form-field-C6W-y2hR.js → form-field-CZwrkP7m.js} +17 -9
  247. package/dist/form-field-CZwrkP7m.js.map +1 -0
  248. package/dist/{form-sizing-39NohSqn.js → form-sizing-QP8aIRaW.js} +10 -6
  249. package/dist/form-sizing-QP8aIRaW.js.map +1 -0
  250. package/dist/{forms-BF-HSbff.js → forms-B5NCbkSC.js} +35 -35
  251. package/dist/{forms-BF-HSbff.js.map → forms-B5NCbkSC.js.map} +1 -1
  252. package/dist/forms-numeric-Crrm80Lm.js +867 -0
  253. package/dist/forms-numeric-Crrm80Lm.js.map +1 -0
  254. package/dist/{header-B8ex54cY.js → header-kxruN3RM.js} +53 -49
  255. package/dist/header-kxruN3RM.js.map +1 -0
  256. package/dist/{hooks-D6UBVzf2.js → hooks-BrlnCwQd.js} +2 -2
  257. package/dist/{hooks-D6UBVzf2.js.map → hooks-BrlnCwQd.js.map} +1 -1
  258. package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
  259. package/dist/http-CdEIHyQf.js.map +1 -0
  260. package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-Btc6pQrp.js} +4 -4
  261. package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-Btc6pQrp.js.map} +1 -1
  262. package/dist/index.js +2 -2
  263. package/dist/input-SX9V0AL3.js +255 -0
  264. package/dist/input-SX9V0AL3.js.map +1 -0
  265. package/dist/input-vxcaNCYC.js +20 -0
  266. package/dist/input-vxcaNCYC.js.map +1 -0
  267. package/dist/{item-pJ0GsOiJ.js → item-DE4YnuJx.js} +18 -17
  268. package/dist/item-DE4YnuJx.js.map +1 -0
  269. package/dist/layout/app-shell.js +1 -1
  270. package/dist/layout/auth.js +1 -1
  271. package/dist/layout/containers.js +1 -1
  272. package/dist/layout/header.js +1 -1
  273. package/dist/layout/hooks.js +1 -1
  274. package/dist/layout/navigation.js +1 -1
  275. package/dist/layout/page.js +1 -1
  276. package/dist/layout/settings.js +1 -1
  277. package/dist/layout/sidebar.js +2 -2
  278. package/dist/layout/workspace.js +1 -1
  279. package/dist/layout.js +10 -10
  280. package/dist/lib/affordance-geometry.generated.d.ts +44 -4
  281. package/dist/lib/control-group-recipes.d.ts +22 -0
  282. package/dist/lib/field-affordance-recipes.d.ts +35 -2
  283. package/dist/lib/field-state-recipes.d.ts +2 -2
  284. package/dist/lib/navigation-row-recipes.d.ts +3 -2
  285. package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
  286. package/dist/lib/surface-recipes.d.ts +5 -2
  287. package/dist/lib/token-merge.generated.d.ts +144 -2
  288. package/dist/lib/ui-provider/types.d.ts +4 -2
  289. package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
  290. package/dist/lib/utils.js +1 -1
  291. package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DLp3HAz0.js} +75 -74
  292. package/dist/media-gallery-DLp3HAz0.js.map +1 -0
  293. package/dist/{mentions-CRio8mTm.js → mentions-Cl0Kt_Pd.js} +52 -50
  294. package/dist/{mentions-CRio8mTm.js.map → mentions-Cl0Kt_Pd.js.map} +1 -1
  295. package/dist/message-SZUNB1eX.js +127 -0
  296. package/dist/message-SZUNB1eX.js.map +1 -0
  297. package/dist/{navigation-BTrEb5u4.js → navigation-DnQSNMT0.js} +64 -55
  298. package/dist/navigation-DnQSNMT0.js.map +1 -0
  299. package/dist/{navigation-DqEITuD2.js → navigation-DyytsLRB.js} +37 -37
  300. package/dist/navigation-DyytsLRB.js.map +1 -0
  301. package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-DQEXQcqY.js} +3 -3
  302. package/dist/navigation-row-recipes-DQEXQcqY.js.map +1 -0
  303. package/dist/{number-BNT_BIzJ.js → number-DasMFWEG.js} +4 -4
  304. package/dist/{number-BNT_BIzJ.js.map → number-DasMFWEG.js.map} +1 -1
  305. package/dist/overlays-DUbs1KEi.js +1011 -0
  306. package/dist/overlays-DUbs1KEi.js.map +1 -0
  307. package/dist/{page-BMBGjJY8.js → page-hGmT4nWK.js} +75 -64
  308. package/dist/page-hGmT4nWK.js.map +1 -0
  309. package/dist/{page-header-BH41wCyY.js → page-header-D8nERkn5.js} +9 -9
  310. package/dist/page-header-D8nERkn5.js.map +1 -0
  311. package/dist/{pagination-C29vvt3I.js → pagination-NLGqRirf.js} +20 -20
  312. package/dist/pagination-NLGqRirf.js.map +1 -0
  313. package/dist/{popover-TInGXsjg.js → popover-CghIYdQf.js} +23 -22
  314. package/dist/popover-CghIYdQf.js.map +1 -0
  315. package/dist/{popover-menu-BzqXqE72.js → popover-menu-B4PoWhRl.js} +6 -6
  316. package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-B4PoWhRl.js.map} +1 -1
  317. package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-QlD4JenO.js} +5 -5
  318. package/dist/popover.recipes-QlD4JenO.js.map +1 -0
  319. package/dist/{primitives-DKPOGVpj.js → primitives-C7ff0QaI.js} +120 -113
  320. package/dist/primitives-C7ff0QaI.js.map +1 -0
  321. package/dist/primitives.js +3 -3
  322. package/dist/progress-BroqrAyV.js +169 -0
  323. package/dist/progress-BroqrAyV.js.map +1 -0
  324. package/dist/{receipt-DYWTQGEc.js → receipt-BuJynLgf.js} +8 -8
  325. package/dist/{receipt-DYWTQGEc.js.map → receipt-BuJynLgf.js.map} +1 -1
  326. package/dist/{rich-text-B7sBAdDG.js → rich-text-DlxDOtf4.js} +4 -4
  327. package/dist/{rich-text-B7sBAdDG.js.map → rich-text-DlxDOtf4.js.map} +1 -1
  328. package/dist/rich-text-editor-BKyG7rWz.js +574 -0
  329. package/dist/rich-text-editor-BKyG7rWz.js.map +1 -0
  330. package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-B72Nfuze.js} +35 -26
  331. package/dist/rich-text-editor.recipes-B72Nfuze.js.map +1 -0
  332. package/dist/{scroll-area-BheMQ270.js → scroll-area-D-pIhEKl.js} +3 -3
  333. package/dist/scroll-area-D-pIhEKl.js.map +1 -0
  334. package/dist/{separator-Gk_WXH-l.js → separator-BNIgG3au.js} +3 -3
  335. package/dist/{separator-Gk_WXH-l.js.map → separator-BNIgG3au.js.map} +1 -1
  336. package/dist/{separator-DO0EbCEm.js → separator-BhtFyo4x.js} +2 -2
  337. package/dist/{separator-DO0EbCEm.js.map → separator-BhtFyo4x.js.map} +1 -1
  338. package/dist/services/actions.js +1 -1
  339. package/dist/{settings-D9f_wdIC.js → settings-DOTOzeZ2.js} +10 -9
  340. package/dist/{settings-D9f_wdIC.js.map → settings-DOTOzeZ2.js.map} +1 -1
  341. package/dist/{sheet-vOUloJ4O.js → sheet-BFhrNehm.js} +11 -11
  342. package/dist/sheet-BFhrNehm.js.map +1 -0
  343. package/dist/{sidebar-CNBKFDRW.js → sidebar-CyR4XKwR.js} +219 -200
  344. package/dist/sidebar-CyR4XKwR.js.map +1 -0
  345. package/dist/{sidebar-C3UKkbC5.js → sidebar-SvGJ0Zwi.js} +63 -58
  346. package/dist/sidebar-SvGJ0Zwi.js.map +1 -0
  347. package/dist/{skeleton-BvRhK8y-.js → skeleton-3F0uhYn3.js} +4 -4
  348. package/dist/{skeleton-BvRhK8y-.js.map → skeleton-3F0uhYn3.js.map} +1 -1
  349. package/dist/{smart-card-B5FcKODh.js → smart-card-DjGVV2xr.js} +206 -199
  350. package/dist/smart-card-DjGVV2xr.js.map +1 -0
  351. package/dist/{spinner-JtlFJ7Nc.js → spinner-Cpf7oRkF.js} +5 -5
  352. package/dist/{spinner-JtlFJ7Nc.js.map → spinner-Cpf7oRkF.js.map} +1 -1
  353. package/dist/{structure-BvW4vG4H.js → structure-CRdqVawd.js} +14 -14
  354. package/dist/{structure-BvW4vG4H.js.map → structure-CRdqVawd.js.map} +1 -1
  355. package/dist/{structure.recipes-DjqnBpwz.js → structure.recipes-Bqhf9oIh.js} +2 -2
  356. package/dist/structure.recipes-Bqhf9oIh.js.map +1 -0
  357. package/dist/style.css +1 -1
  358. package/dist/{surface-recipes-CQfRr-VL.js → surface-recipes-Dd__PD-w.js} +4 -3
  359. package/dist/surface-recipes-Dd__PD-w.js.map +1 -0
  360. package/dist/{table-DnlAJ-xR.js → table-CLtJTxoR.js} +17 -16
  361. package/dist/table-CLtJTxoR.js.map +1 -0
  362. package/dist/table-CcRDZiLP.js +1444 -0
  363. package/dist/table-CcRDZiLP.js.map +1 -0
  364. package/dist/tabs-BNgu7g0u.js +188 -0
  365. package/dist/tabs-BNgu7g0u.js.map +1 -0
  366. package/dist/text-inputs-DsR56TR-.js +330 -0
  367. package/dist/text-inputs-DsR56TR-.js.map +1 -0
  368. package/dist/{text.styles-BwB7vAF2.js → text.styles-Q4sGAIgA.js} +18 -10
  369. package/dist/text.styles-Q4sGAIgA.js.map +1 -0
  370. package/dist/theme.css +77 -115
  371. package/dist/{timelines-CnZ2S_Gr.js → timelines-D1pkt3se.js} +84 -78
  372. package/dist/timelines-D1pkt3se.js.map +1 -0
  373. package/dist/{tree-COD9BGdU.js → tree-BtmYyMZV.js} +8 -8
  374. package/dist/{tree-COD9BGdU.js.map → tree-BtmYyMZV.js.map} +1 -1
  375. package/dist/typography/rich-text.js +1 -1
  376. package/dist/typography-BxQgiZyw.js +96 -0
  377. package/dist/typography-BxQgiZyw.js.map +1 -0
  378. package/dist/typography.js +1 -1
  379. package/dist/{ui-provider-CftIB6TY.js → ui-provider-DRPn3qNl.js} +3 -2
  380. package/dist/ui-provider-DRPn3qNl.js.map +1 -0
  381. package/dist/ui-provider.js +1 -1
  382. package/dist/{upload-DIzw1dx1.js → upload-CDbYw1WN.js} +326 -323
  383. package/dist/upload-CDbYw1WN.js.map +1 -0
  384. package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-CNd_hH_a.js} +25 -25
  385. package/dist/upload-queue-CNd_hH_a.js.map +1 -0
  386. package/dist/usage-card-VyJLUwRr.js +457 -0
  387. package/dist/usage-card-VyJLUwRr.js.map +1 -0
  388. package/dist/utils-BvH9PSmq.js +4275 -0
  389. package/dist/utils-BvH9PSmq.js.map +1 -0
  390. package/dist/value-inputs-D0KCrfVC.js +840 -0
  391. package/dist/value-inputs-D0KCrfVC.js.map +1 -0
  392. package/dist/{workspace-Cbqz4FzN.js → workspace-CcR8r-Nt.js} +115 -122
  393. package/dist/workspace-CcR8r-Nt.js.map +1 -0
  394. package/docs/consumer-skill/SKILL.md +112 -18
  395. package/docs/consumer-skill/examples/analytics.tsx +34 -0
  396. package/docs/consumer-skill/examples/app-layout.tsx +42 -12
  397. package/docs/consumer-skill/examples/detail.tsx +24 -9
  398. package/docs/consumer-skill/examples/manifest.json +27 -1
  399. package/docs/consumer-skill/examples/planning-usage-edit.tsx +29 -0
  400. package/docs/consumer-skill/examples/scoped-directory.tsx +77 -0
  401. package/docs/consumer-skill/examples/website.tsx +56 -0
  402. package/docs/consumer-skill/references/analytics.md +70 -0
  403. package/docs/consumer-skill/references/composition.md +219 -2
  404. package/docs/consumer-skill/references/design-contract.md +37 -10
  405. package/docs/consumer-skill/references/discovery.md +93 -5
  406. package/docs/consumer-skill/references/installation.md +20 -3
  407. package/docs/consumer-skill/references/integration.md +26 -0
  408. package/docs/consumer-skill/references/public-api.json +2416 -388
  409. package/docs/consumer-skill/references/review.md +126 -0
  410. package/docs/consumer-skill/references/theming.md +52 -7
  411. package/docs/consumer-skill/references/tokens.json +177 -9
  412. package/docs/consumer-skill/references/workflows.md +129 -1
  413. package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
  414. package/docs/consumer-skill/scripts/composition-policy.mjs +317 -0
  415. package/docs/consumer-skill/scripts/discovery.mjs +65 -8
  416. package/docs/consumer-skill/scripts/surface-policy.mjs +66 -0
  417. package/package.json +30 -6
  418. package/dist/accordion-BRWh3BM1.js.map +0 -1
  419. package/dist/action-menu-Cx3SdfbN.js.map +0 -1
  420. package/dist/affordance-geometry.generated-DXl-Zb3Z.js +0 -23
  421. package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
  422. package/dist/ai-artifact-DkOArd3-.js.map +0 -1
  423. package/dist/app-shell-BH_bGcE2.js.map +0 -1
  424. package/dist/auth-BDB1V_2q.js +0 -704
  425. package/dist/auth-BDB1V_2q.js.map +0 -1
  426. package/dist/avatar-CsnWaYmt.js.map +0 -1
  427. package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
  428. package/dist/button-BS6l5JUw.js.map +0 -1
  429. package/dist/buttons-Co6GavvM.js +0 -674
  430. package/dist/buttons-Co6GavvM.js.map +0 -1
  431. package/dist/chart-DVfcwQu6.js +0 -149
  432. package/dist/chart-DVfcwQu6.js.map +0 -1
  433. package/dist/choice-inputs-CavA-SGV.js +0 -644
  434. package/dist/choice-inputs-CavA-SGV.js.map +0 -1
  435. package/dist/code-block-DIlqzoiD.js.map +0 -1
  436. package/dist/combobox-CHD750do.js.map +0 -1
  437. package/dist/combobox-HDftpzxt.js.map +0 -1
  438. package/dist/command-D0kWBZfd.js.map +0 -1
  439. package/dist/comments-CvYeglMS.js +0 -1132
  440. package/dist/comments-CvYeglMS.js.map +0 -1
  441. package/dist/containers-CPNyNo1_.js.map +0 -1
  442. package/dist/data-display-b3d1TfL4.js.map +0 -1
  443. package/dist/date-picker-DI6kPNof.js.map +0 -1
  444. package/dist/date-pickers-ByP6Cv2z.js +0 -224
  445. package/dist/date-pickers-ByP6Cv2z.js.map +0 -1
  446. package/dist/feedback-a9j9J-9A.js +0 -391
  447. package/dist/feedback-a9j9J-9A.js.map +0 -1
  448. package/dist/field-affordance-recipes-CHdUtn2Z.js +0 -17
  449. package/dist/field-affordance-recipes-CHdUtn2Z.js.map +0 -1
  450. package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
  451. package/dist/filters-qtrcv1hf.js.map +0 -1
  452. package/dist/form-field-C6W-y2hR.js.map +0 -1
  453. package/dist/form-sizing-39NohSqn.js.map +0 -1
  454. package/dist/forms-numeric-Y15Bg5Nr.js +0 -867
  455. package/dist/forms-numeric-Y15Bg5Nr.js.map +0 -1
  456. package/dist/header-B8ex54cY.js.map +0 -1
  457. package/dist/http-CLTVJc5I.js.map +0 -1
  458. package/dist/input-DMorJiTI.js +0 -202
  459. package/dist/input-DMorJiTI.js.map +0 -1
  460. package/dist/input-ci9fIgFH.js +0 -20
  461. package/dist/input-ci9fIgFH.js.map +0 -1
  462. package/dist/item-pJ0GsOiJ.js.map +0 -1
  463. package/dist/media-gallery-Ca4YmvBi.js.map +0 -1
  464. package/dist/message-B5-6LeYl.js +0 -108
  465. package/dist/message-B5-6LeYl.js.map +0 -1
  466. package/dist/navigation-BTrEb5u4.js.map +0 -1
  467. package/dist/navigation-DqEITuD2.js.map +0 -1
  468. package/dist/navigation-row-recipes-BFpvGPGE.js.map +0 -1
  469. package/dist/overlays-DBqV0J_V.js +0 -982
  470. package/dist/overlays-DBqV0J_V.js.map +0 -1
  471. package/dist/page-BMBGjJY8.js.map +0 -1
  472. package/dist/page-header-BH41wCyY.js.map +0 -1
  473. package/dist/pagination-C29vvt3I.js.map +0 -1
  474. package/dist/popover-TInGXsjg.js.map +0 -1
  475. package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
  476. package/dist/primitives-DKPOGVpj.js.map +0 -1
  477. package/dist/rich-text-editor-BZSJchAF.js +0 -575
  478. package/dist/rich-text-editor-BZSJchAF.js.map +0 -1
  479. package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
  480. package/dist/scroll-area-BheMQ270.js.map +0 -1
  481. package/dist/select-B2mb-qN2.js +0 -108
  482. package/dist/select-B2mb-qN2.js.map +0 -1
  483. package/dist/sheet-vOUloJ4O.js.map +0 -1
  484. package/dist/sidebar-C3UKkbC5.js.map +0 -1
  485. package/dist/sidebar-CNBKFDRW.js.map +0 -1
  486. package/dist/smart-card-B5FcKODh.js.map +0 -1
  487. package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
  488. package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
  489. package/dist/table-DnlAJ-xR.js.map +0 -1
  490. package/dist/table-ghtAQ-JJ.js +0 -1424
  491. package/dist/table-ghtAQ-JJ.js.map +0 -1
  492. package/dist/tabs-DY09eoZg.js +0 -187
  493. package/dist/tabs-DY09eoZg.js.map +0 -1
  494. package/dist/text-inputs-BhOcedTo.js +0 -331
  495. package/dist/text-inputs-BhOcedTo.js.map +0 -1
  496. package/dist/text.styles-BwB7vAF2.js.map +0 -1
  497. package/dist/timelines-CnZ2S_Gr.js.map +0 -1
  498. package/dist/typography-Cv8MT-82.js +0 -96
  499. package/dist/typography-Cv8MT-82.js.map +0 -1
  500. package/dist/ui-provider-CftIB6TY.js.map +0 -1
  501. package/dist/upload-DIzw1dx1.js.map +0 -1
  502. package/dist/upload-queue-xRJ3qDmd.js.map +0 -1
  503. package/dist/utils-C2EKeIw3.js +0 -72
  504. package/dist/utils-C2EKeIw3.js.map +0 -1
  505. package/dist/value-inputs-Co1fu-xv.js +0 -824
  506. package/dist/value-inputs-Co1fu-xv.js.map +0 -1
  507. package/dist/workspace-Cbqz4FzN.js.map +0 -1
@@ -1,575 +0,0 @@
1
- "use client";
2
- import { useStrings as e } from "./lib/strings.js";
3
- import { t } from "./utils-C2EKeIw3.js";
4
- import { a as n } from "./typography-Cv8MT-82.js";
5
- import { n as r } from "./content-typography-CnwgMJ37.js";
6
- import { g as i } from "./primitives-DKPOGVpj.js";
7
- import { t as a } from "./number-BNT_BIzJ.js";
8
- import { d as o } from "./text-inputs-BhOcedTo.js";
9
- import { n as s, t as c } from "./rich-text-editor.recipes-DxvOE0Lp.js";
10
- import { t as l } from "./rich-text-editor.strings-BpnIQgMl.js";
11
- import { forwardRef as u, useCallback as d, useEffect as f, useImperativeHandle as ee, useMemo as p, useRef as m, useState as h } from "react";
12
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
13
- import { Bold as te, Italic as ne, List as re, ListOrdered as ie, Quote as y, Redo2 as ae, Strikethrough as oe, Undo2 as se } from "lucide-react";
14
- import * as b from "@tiptap/react";
15
- import * as x from "@tiptap/starter-kit";
16
- //#region src/components/features/rich-text-editor/partials/caret-helpers.ts
17
- function ce() {
18
- if (typeof window > "u") return null;
19
- let e = window.getSelection();
20
- if (!e || e.rangeCount === 0) return null;
21
- let t = e.getRangeAt(0);
22
- if (!t.collapsed) return null;
23
- let n = t.startContainer, r = t.startOffset, i = n;
24
- for (; i && i.nodeType !== Node.ELEMENT_NODE;) i = i.parentNode;
25
- if (!i) return null;
26
- let a = i.closest("[contenteditable=\"true\"]") ?? i.closest(".ProseMirror");
27
- if (!a) return null;
28
- let o = "";
29
- n.nodeType === Node.TEXT_NODE && (o = (n.textContent ?? "").slice(0, r));
30
- let s = n;
31
- for (; s && s !== a && s !== i;) {
32
- let e = s.previousSibling;
33
- for (; e;) o = (e.textContent ?? "") + o, e = e.previousSibling;
34
- if (s = s.parentNode, s && s.matches?.("p, li, h1, h2, h3, h4, h5, h6, blockquote")) break;
35
- }
36
- let c, l = t.getBoundingClientRect();
37
- return l && (l.top || l.left || l.right || l.bottom) && (c = {
38
- top: l.top,
39
- left: l.left,
40
- bottom: l.bottom,
41
- right: l.right
42
- }), {
43
- textBefore: o,
44
- rect: c
45
- };
46
- }
47
- function le(e, t, n, r) {
48
- if (typeof window > "u") return;
49
- let i = window.getSelection();
50
- if (!i || i.rangeCount === 0) return;
51
- let a = i.getRangeAt(0);
52
- if (!a.collapsed) return;
53
- let o = t, s = a.startContainer, c = a.startOffset;
54
- for (; o > 0;) {
55
- if (s.nodeType === Node.TEXT_NODE) {
56
- let e = Math.min(c, o);
57
- if (c -= e, o -= e, o === 0) break;
58
- }
59
- let e = C(s);
60
- if (!e) break;
61
- s = e, c = e.textContent?.length ?? 0;
62
- }
63
- let l = document.createRange();
64
- if (l.setStart(s, c), l.setEnd(a.endContainer, a.endOffset), i.removeAllRanges(), i.addRange(l), e) {
65
- e.chain().focus().insertContent(n).run(), r(e.getHTML());
66
- return;
67
- }
68
- l.deleteContents();
69
- let u = document.createRange().createContextualFragment(n);
70
- l.insertNode(u), i.collapseToEnd();
71
- let d = s?.parentElement?.closest?.("[contenteditable=\"true\"]") ?? null;
72
- d && r(d.innerHTML);
73
- }
74
- function S(e, t) {
75
- if (typeof window > "u" || !e) return;
76
- e.focus();
77
- let n = window.getSelection();
78
- if (!n || n.rangeCount === 0) {
79
- e.insertAdjacentHTML("beforeend", t);
80
- return;
81
- }
82
- let r = n.getRangeAt(0);
83
- if (!e.contains(r.commonAncestorContainer)) {
84
- e.insertAdjacentHTML("beforeend", t);
85
- return;
86
- }
87
- r.deleteContents();
88
- let i = document.createRange().createContextualFragment(t);
89
- r.insertNode(i), r.collapse(!1), n.removeAllRanges(), n.addRange(r);
90
- }
91
- function C(e) {
92
- let t = e;
93
- for (; t;) {
94
- if (t.previousSibling) {
95
- for (t = t.previousSibling; t && t.lastChild;) t = t.lastChild;
96
- if (t && t.nodeType === Node.TEXT_NODE) return t;
97
- continue;
98
- }
99
- if (t = t.parentNode, !t || t.matches?.("p, li, h1, h2, h3, h4, h5, h6, blockquote, [contenteditable=\"true\"]")) return null;
100
- }
101
- return null;
102
- }
103
- //#endregion
104
- //#region src/components/features/rich-text-editor/partials/counts-footer.tsx
105
- function w({ text: e, maxLength: r, strings: o, className: s }) {
106
- let c = e.length, l = e.trim().length > 0 ? e.trim().split(/\s+/).length : 0, u = typeof r == "number" && c > r;
107
- return /* @__PURE__ */ v("div", {
108
- className: t("counts-footer-text--component border-border flex items-center justify-end gap-space-lg border-t px-control py-space-sm", s),
109
- children: [/* @__PURE__ */ v(n, {
110
- tag: "span",
111
- size: "xs",
112
- type: u ? "error" : "secondary",
113
- weight: u ? "medium" : "regular",
114
- className: t("tabular-nums"),
115
- children: [
116
- /* @__PURE__ */ _(a, {
117
- value: c,
118
- size: "xs",
119
- type: u ? "error" : "secondary",
120
- align: "left"
121
- }),
122
- typeof r == "number" && /* @__PURE__ */ v(g, { children: [" / ", /* @__PURE__ */ _(a, {
123
- value: r,
124
- size: "xs",
125
- type: u ? "error" : "secondary",
126
- align: "left"
127
- })] }),
128
- " ",
129
- o.counts.characters
130
- ]
131
- }), /* @__PURE__ */ v(i, {
132
- size: "xs",
133
- className: "tabular-nums",
134
- children: [
135
- /* @__PURE__ */ _(a, {
136
- value: l,
137
- size: "xs",
138
- type: "secondary",
139
- align: "left"
140
- }),
141
- " ",
142
- o.counts.words
143
- ]
144
- })]
145
- });
146
- }
147
- w.displayName = "CountsFooterText";
148
- function T({ editor: e, sourceMode: t, sourceValue: n, maxLength: r, strings: i }) {
149
- let a = t ? n.replace(/<[^>]*>/g, "") : e?.getText() ?? "";
150
- return /* @__PURE__ */ _(w, {
151
- text: a,
152
- maxLength: r,
153
- strings: i
154
- });
155
- }
156
- T.displayName = "CountsFooter";
157
- //#endregion
158
- //#region src/components/features/rich-text-editor/partials/html-helpers.ts
159
- function E(e) {
160
- let t = e.trim();
161
- return t === "" || t === "<p></p>" || t === "<p><br></p>" ? "" : t;
162
- }
163
- function D(e) {
164
- let t = E(e);
165
- return t === "" ? "<p></p>" : t;
166
- }
167
- //#endregion
168
- //#region src/components/features/rich-text-editor/partials/rich-text-editor-tiptap.tsx
169
- var O = b.EditorContent, k = b.useEditor, A = "default" in x ? x.default : x, j = u(function({ value: i, onValueChange: a, placeholder: u, compact: g = !1, minHeight: b, maxHeight: x, disabled: S = !1, showCounts: C = !1, maxLength: w, extraToolbarItems: j, toolbarTrailing: M, footerSlot: N, hideSourceToggle: P = !1, autoFocus: F = !1, className: ue, onCaretChange: I, strings: L }, R) {
170
- let z = e(l, L), [B, V] = h(!1), [H, U] = h(!1), [W, G] = h(""), K = m(!1), q = m(E(i)), J = m(I);
171
- J.current = I;
172
- let Y = k({
173
- extensions: [A],
174
- content: D(i),
175
- editable: !S,
176
- immediatelyRender: !1,
177
- autofocus: F ? "end" : !1,
178
- onFocus: () => {
179
- K.current = !0, V(!0);
180
- },
181
- onBlur: () => {
182
- K.current = !1, V(!1);
183
- },
184
- onUpdate: ({ editor: e }) => {
185
- let t = E(e.getHTML());
186
- K.current && (t !== q.current && (q.current = t, a(t)), J.current?.());
187
- },
188
- editorProps: { attributes: {
189
- role: "textbox",
190
- "aria-label": z.editorLabel,
191
- "aria-multiline": "true",
192
- class: r
193
- } }
194
- });
195
- f(() => {
196
- if (!Y) return;
197
- let e = E(Y.getHTML()), t = E(i);
198
- q.current = t, e !== t && Y.commands.setContent(D(t), { emitUpdate: !1 });
199
- }, [Y, i]), f(() => {
200
- Y && Y.setEditable(!S);
201
- }, [S, Y]), f(() => {
202
- if (typeof document > "u") return;
203
- let e = () => {
204
- K.current && J.current?.();
205
- };
206
- return document.addEventListener("selectionchange", e), () => document.removeEventListener("selectionchange", e);
207
- }, []), ee(R, () => ({
208
- focus: () => {
209
- Y?.chain().focus().run();
210
- },
211
- getHTML: () => E(Y?.getHTML() ?? ""),
212
- setHTML: (e) => {
213
- let t = E(e);
214
- q.current = t, Y?.commands.setContent(D(t), { emitUpdate: !1 }), a(t);
215
- },
216
- insertHTML: (e) => {
217
- Y && Y.chain().focus().insertContent(e).run();
218
- },
219
- isEmpty: () => E(Y?.getHTML() ?? "") === "",
220
- clear: () => {
221
- q.current = "", Y?.commands.setContent("<p></p>", { emitUpdate: !1 }), a("");
222
- },
223
- getCaretContext: () => ce(),
224
- replaceBeforeCaret: (e, t) => {
225
- le(Y, e, t, (e) => {
226
- q.current = E(e), a(q.current);
227
- });
228
- }
229
- }), [Y, a]);
230
- let X = p(() => ({
231
- minHeight: b ?? (g ? "2rem" : "12rem"),
232
- ...x ? {
233
- maxHeight: x,
234
- overflowY: "auto"
235
- } : {}
236
- }), [
237
- g,
238
- x,
239
- b
240
- ]), de = d(() => {
241
- if (Y) {
242
- if (H) {
243
- let e = D(W);
244
- Y.commands.setContent(e, { emitUpdate: !1 });
245
- let t = E(W);
246
- q.current = t, a(t), U(!1);
247
- } else G(Y.getHTML()), U(!0);
248
- }
249
- }, [
250
- Y,
251
- a,
252
- H,
253
- W
254
- ]), Z = d((e) => {
255
- let t = e.target.value;
256
- G(t);
257
- let n = E(t);
258
- q.current = n, a(n);
259
- }, [a]), Q = p(() => [
260
- {
261
- id: "bold",
262
- icon: te,
263
- label: z.toolbar.bold,
264
- isActive: () => !!Y?.isActive("bold"),
265
- run: () => Y?.chain().focus().toggleBold().run()
266
- },
267
- {
268
- id: "italic",
269
- icon: ne,
270
- label: z.toolbar.italic,
271
- isActive: () => !!Y?.isActive("italic"),
272
- run: () => Y?.chain().focus().toggleItalic().run()
273
- },
274
- {
275
- id: "strike",
276
- icon: oe,
277
- label: z.toolbar.strike,
278
- isActive: () => !!Y?.isActive("strike"),
279
- run: () => Y?.chain().focus().toggleStrike().run()
280
- },
281
- {
282
- id: "bullet-list",
283
- icon: re,
284
- label: z.toolbar.bulletList,
285
- isActive: () => !!Y?.isActive("bulletList"),
286
- run: () => Y?.chain().focus().toggleBulletList().run()
287
- },
288
- {
289
- id: "ordered-list",
290
- icon: ie,
291
- label: z.toolbar.orderedList,
292
- isActive: () => !!Y?.isActive("orderedList"),
293
- run: () => Y?.chain().focus().toggleOrderedList().run()
294
- },
295
- {
296
- id: "blockquote",
297
- icon: y,
298
- label: z.toolbar.blockquote,
299
- isActive: () => !!Y?.isActive("blockquote"),
300
- run: () => Y?.chain().focus().toggleBlockquote().run()
301
- },
302
- {
303
- id: "undo",
304
- icon: se,
305
- label: z.toolbar.undo,
306
- isActive: () => !1,
307
- run: () => Y?.chain().focus().undo().run(),
308
- disabled: !Y?.can().chain().focus().undo().run()
309
- },
310
- {
311
- id: "redo",
312
- icon: ae,
313
- label: z.toolbar.redo,
314
- isActive: () => !1,
315
- run: () => Y?.chain().focus().redo().run(),
316
- disabled: !Y?.can().chain().focus().redo().run()
317
- }
318
- ], [Y, z]), fe = C && Y ? /* @__PURE__ */ _(T, {
319
- editor: Y,
320
- sourceMode: H,
321
- sourceValue: W,
322
- maxLength: w,
323
- strings: z
324
- }) : null, $ = typeof u == "string" ? u : "", pe = $.length > 0 && !B && Y?.isEmpty ? /* @__PURE__ */ _(n, {
325
- tag: "span",
326
- size: "sm",
327
- type: "secondary",
328
- className: "pointer-events-none absolute inset-0 px-control py-control-y-offset",
329
- children: $
330
- }) : null;
331
- return /* @__PURE__ */ v("div", {
332
- className: t(c.frame, S && c.disabled, ue),
333
- children: [
334
- /* @__PURE__ */ _(s, {
335
- buttons: Q,
336
- extraToolbarItems: j,
337
- hideSourceToggle: P,
338
- sourceMode: H,
339
- toggleSourceMode: de,
340
- disabled: S,
341
- hasEditor: !!Y,
342
- toolbarTrailing: M,
343
- strings: z
344
- }),
345
- H ? /* @__PURE__ */ _(o, {
346
- "aria-label": z.sourceLabel,
347
- value: W,
348
- onChange: Z,
349
- disabled: S,
350
- spellCheck: !1,
351
- className: t("min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0", S && "cursor-not-allowed"),
352
- style: X
353
- }) : /* @__PURE__ */ v("div", {
354
- className: "relative",
355
- style: X,
356
- children: [pe, /* @__PURE__ */ _(O, {
357
- editor: Y,
358
- className: c.content
359
- })]
360
- }),
361
- !!N && /* @__PURE__ */ _("div", {
362
- className: "px-control pb-space-md pt-space-xs",
363
- children: N
364
- }),
365
- fe
366
- ]
367
- });
368
- });
369
- j.displayName = "TiptapRichTextEditor";
370
- var M = typeof O == "function" && typeof k == "function" && typeof A == "object" && !!A, N = u(function({ value: i, onValueChange: a, placeholder: u, compact: g = !1, minHeight: b, maxHeight: x, disabled: C = !1, showCounts: T = !1, maxLength: O, extraToolbarItems: k, toolbarTrailing: A, footerSlot: j, hideSourceToggle: M = !1, autoFocus: N = !1, className: P, onCaretChange: F, strings: ue }, I) {
371
- let L = e(l, ue), R = m(null), [z, B] = h(!1), [V, H] = h(!1), [U, W] = h(""), G = m(E(i)), K = m(F);
372
- K.current = F;
373
- let q = d((e) => {
374
- R.current = e, e && e.innerHTML === "" && (e.innerHTML = D(G.current));
375
- }, []);
376
- f(() => {
377
- let e = R.current;
378
- if (!e || z) return;
379
- let t = D(i);
380
- E(e.innerHTML) !== E(t) && (e.innerHTML = t), G.current = E(i);
381
- }, [z, i]), f(() => {
382
- N && R.current?.focus();
383
- }, [N]);
384
- let J = d(() => {
385
- let e = R.current, t = E(e?.innerHTML ?? "");
386
- G.current = t, a(t), K.current?.();
387
- }, [a]);
388
- ee(I, () => ({
389
- focus: () => R.current?.focus(),
390
- getHTML: () => E(R.current?.innerHTML ?? ""),
391
- setHTML: (e) => {
392
- let t = E(e);
393
- G.current = t, R.current && (R.current.innerHTML = D(t)), a(t);
394
- },
395
- insertHTML: (e) => {
396
- S(R.current, e), J();
397
- },
398
- isEmpty: () => E(R.current?.innerHTML ?? "") === "",
399
- clear: () => {
400
- G.current = "", R.current && (R.current.innerHTML = "<p></p>"), a("");
401
- },
402
- getCaretContext: () => ce(),
403
- replaceBeforeCaret: (e, t) => {
404
- le(null, e, t, () => J());
405
- }
406
- }), [J, a]);
407
- let Y = p(() => ({
408
- minHeight: b ?? (g ? "2rem" : "12rem"),
409
- ...x ? {
410
- maxHeight: x,
411
- overflowY: "auto"
412
- } : {}
413
- }), [
414
- g,
415
- x,
416
- b
417
- ]), X = d(() => {
418
- if (V) {
419
- let e = E(U);
420
- G.current = e, R.current && (R.current.innerHTML = D(e)), a(e), H(!1);
421
- return;
422
- }
423
- W(R.current?.innerHTML ?? D(i)), H(!0);
424
- }, [
425
- a,
426
- V,
427
- U,
428
- i
429
- ]), de = d((e) => {
430
- let t = e.target.value;
431
- W(t);
432
- let n = E(t);
433
- G.current = n, a(n);
434
- }, [a]), Z = typeof u == "string" ? u : "", Q = E(G.current) === "", fe = Z.length > 0 && !z && Q ? /* @__PURE__ */ _(n, {
435
- tag: "span",
436
- size: "sm",
437
- type: "secondary",
438
- className: "pointer-events-none absolute inset-0 px-control py-control-y-offset",
439
- children: Z
440
- }) : null, $ = p(() => [
441
- {
442
- id: "bold",
443
- icon: te,
444
- label: L.toolbar.bold,
445
- isActive: () => !1,
446
- run: () => void 0,
447
- disabled: !0
448
- },
449
- {
450
- id: "italic",
451
- icon: ne,
452
- label: L.toolbar.italic,
453
- isActive: () => !1,
454
- run: () => void 0,
455
- disabled: !0
456
- },
457
- {
458
- id: "strike",
459
- icon: oe,
460
- label: L.toolbar.strike,
461
- isActive: () => !1,
462
- run: () => void 0,
463
- disabled: !0
464
- },
465
- {
466
- id: "bullet-list",
467
- icon: re,
468
- label: L.toolbar.bulletList,
469
- isActive: () => !1,
470
- run: () => void 0,
471
- disabled: !0
472
- },
473
- {
474
- id: "ordered-list",
475
- icon: ie,
476
- label: L.toolbar.orderedList,
477
- isActive: () => !1,
478
- run: () => void 0,
479
- disabled: !0
480
- },
481
- {
482
- id: "blockquote",
483
- icon: y,
484
- label: L.toolbar.blockquote,
485
- isActive: () => !1,
486
- run: () => void 0,
487
- disabled: !0
488
- },
489
- {
490
- id: "undo",
491
- icon: se,
492
- label: L.toolbar.undo,
493
- isActive: () => !1,
494
- run: () => void 0,
495
- disabled: !0
496
- },
497
- {
498
- id: "redo",
499
- icon: ae,
500
- label: L.toolbar.redo,
501
- isActive: () => !1,
502
- run: () => void 0,
503
- disabled: !0
504
- }
505
- ], [L]), pe = V ? U.replace(/<[^>]*>/g, "") : R.current?.innerText ?? E(i).replace(/<[^>]*>/g, ""), me = T ? /* @__PURE__ */ _(w, {
506
- text: pe,
507
- maxLength: O,
508
- strings: L
509
- }) : null;
510
- return /* @__PURE__ */ v("div", {
511
- className: t(c.frame, C && c.disabled, P),
512
- children: [
513
- /* @__PURE__ */ _(s, {
514
- buttons: $,
515
- extraToolbarItems: k,
516
- hideSourceToggle: M,
517
- sourceMode: V,
518
- toggleSourceMode: X,
519
- disabled: C,
520
- hasEditor: !0,
521
- toolbarTrailing: A,
522
- strings: L
523
- }),
524
- V ? /* @__PURE__ */ _(o, {
525
- "aria-label": L.sourceLabel,
526
- value: U,
527
- onChange: de,
528
- disabled: C,
529
- spellCheck: !1,
530
- className: t("min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0", C && "cursor-not-allowed"),
531
- style: Y
532
- }) : /* @__PURE__ */ v("div", {
533
- className: "relative",
534
- style: Y,
535
- children: [fe, /* @__PURE__ */ _("div", {
536
- ref: q,
537
- role: "textbox",
538
- "aria-label": L.editorLabel,
539
- "aria-multiline": "true",
540
- contentEditable: !C,
541
- suppressContentEditableWarning: !0,
542
- onInput: J,
543
- onKeyUp: () => K.current?.(),
544
- onMouseUp: () => K.current?.(),
545
- onFocus: () => B(!0),
546
- onBlur: () => B(!1),
547
- className: t(r, "h-full min-h-full", C && "cursor-not-allowed")
548
- })]
549
- }),
550
- !!j && /* @__PURE__ */ _("div", {
551
- className: "px-control pb-space-md pt-space-xs",
552
- children: j
553
- }),
554
- me
555
- ]
556
- });
557
- });
558
- N.displayName = "FallbackRichTextEditor";
559
- //#endregion
560
- //#region src/components/features/rich-text-editor/rich-text-editor.tsx
561
- var P = u(function(e, t) {
562
- return M ? /* @__PURE__ */ _(j, {
563
- ...e,
564
- ref: t
565
- }) : /* @__PURE__ */ _(N, {
566
- className: "rich-text-editor--component",
567
- ...e,
568
- ref: t
569
- });
570
- });
571
- P.displayName = "RichTextEditor";
572
- //#endregion
573
- export { w as n, P as t };
574
-
575
- //# sourceMappingURL=rich-text-editor-BZSJchAF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rich-text-editor-BZSJchAF.js","names":["NumberValue","_Fragment","EditorContent","StarterKit","Text","editableContentClassName","SecondaryValue","Number","Textarea","RichTextEditorToolbar","richTextEditorRecipes","defaultRichTextEditorStrings","Fragment$1","TiptapReact","StarterKitModule","readCaretContext","sel","range","startNode","startOffset","block","editable","text","cursor","prev","rect","r","replaceBeforeCaret","caret","remaining","length","take","previousTextNode","editor","html","notifyChange","fragment","insertHtmlIntoEditable","current","node","CountsFooterText","chars","words","overLimit","maxLength","cn","className","strings","CountsFooter","sourceMode","sourceValue","normalizeHtml","trimmed","value","toEditorContent","normalized","EditorContent$1","useTiptapEditor","StarterKit$1","TiptapRichTextEditor","forwardRef","stringsProp","useStrings","isFocused","setIsFocused","useState","setSourceMode","setSourceValue","isFocusedRef","useRef","externalValueRef","onCaretChangeRef","onCaretChange","disabled","autoFocus","currentEditor","onValueChange","useEffect","next","handler","useImperativeHandle","ref","contentStyle","useMemo","minHeight","compact","maxHeight","toggleSourceMode","useCallback","handleSourceChange","toolbarButtons","Bold","Italic","Strikethrough","List","ListOrdered","Quote","Undo2","Redo2","countsFooter","showCounts","placeholderText","placeholder","placeholderNode","footerSlot","hasTiptapRuntime","FallbackRichTextEditor","editableRef","setEditableRef","emitEditableChange","isEmpty","RichTextEditor","props"],"sources":["../src/components/features/rich-text-editor/partials/caret-helpers.ts","../src/components/features/rich-text-editor/partials/counts-footer.tsx","../src/components/features/rich-text-editor/partials/html-helpers.ts","../src/components/features/rich-text-editor/partials/rich-text-editor-tiptap.tsx","../src/components/features/rich-text-editor/partials/rich-text-editor-fallback.tsx","../src/components/features/rich-text-editor/rich-text-editor.tsx"],"sourcesContent":["/**\n * Caret-introspection helpers used by `<RichTextEditor>` to expose the\n * text before the caret and replace a leading run of characters with\n * inline HTML — the building blocks for `@`-mention chips and similar\n * inline triggers.\n */\nimport type { RichTextCaretContext, TiptapEditor } from '../rich-text-editor.types';\n\n/**\n * Read the current selection's caret context.\n *\n * Walks back from the caret through the current text node and any\n * preceding sibling text nodes inside the same block-level container\n * (paragraph / list-item / heading) collecting plain text. Returns the\n * accumulated text plus the caret's bounding rect when available.\n *\n * Returns `null` when there is no live selection or the selection isn't\n * a text caret inside a contenteditable.\n */\nexport function readCaretContext(): RichTextCaretContext | null {\n\tif (typeof window === 'undefined') return null;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return null;\n\tconst range = sel.getRangeAt(0);\n\tif (!range.collapsed) return null;\n\n\tconst startNode = range.startContainer;\n\tconst startOffset = range.startOffset;\n\n\tlet block: Node | null = startNode;\n\twhile (block && block.nodeType !== Node.ELEMENT_NODE) {\n\t\tblock = block.parentNode;\n\t}\n\tif (!block) return null;\n\tconst editable =\n\t\t(block as Element).closest('[contenteditable=\"true\"]') ??\n\t\t(block as Element).closest('.ProseMirror');\n\tif (!editable) return null;\n\n\tlet text = '';\n\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\ttext = (startNode.textContent ?? '').slice(0, startOffset);\n\t}\n\n\tlet cursor: Node | null = startNode;\n\twhile (cursor && cursor !== editable && cursor !== block) {\n\t\tlet prev: Node | null = cursor.previousSibling;\n\t\twhile (prev) {\n\t\t\ttext = (prev.textContent ?? '') + text;\n\t\t\tprev = prev.previousSibling;\n\t\t}\n\t\tcursor = cursor.parentNode;\n\t\tif (cursor && (cursor as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote')) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet rect: RichTextCaretContext['rect'];\n\tconst r = range.getBoundingClientRect();\n\tif (r && (r.top || r.left || r.right || r.bottom)) {\n\t\trect = { top: r.top, left: r.left, bottom: r.bottom, right: r.right };\n\t}\n\n\treturn { textBefore: text, rect };\n}\n\n/**\n * Extend the selection backwards by `length` characters, then insert\n * `html`. The selection extension means `editor.insertContent` (or the\n * fallback's `range.deleteContents()` + insert) replaces the trigger\n * range with the chip atomically — no manual text-content mutation, no\n * timing races between \"delete\" and \"insert\".\n */\nexport function replaceBeforeCaret(\n\teditor: TiptapEditor | null,\n\tlength: number,\n\thtml: string,\n\tnotifyChange: (next: string) => void,\n): void {\n\tif (typeof window === 'undefined') return;\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) return;\n\tconst caret = sel.getRangeAt(0);\n\tif (!caret.collapsed) return;\n\n\tlet remaining = length;\n\tlet startNode: Node = caret.startContainer;\n\tlet startOffset = caret.startOffset;\n\n\twhile (remaining > 0) {\n\t\tif (startNode.nodeType === Node.TEXT_NODE) {\n\t\t\tconst take = Math.min(startOffset, remaining);\n\t\t\tstartOffset -= take;\n\t\t\tremaining -= take;\n\t\t\tif (remaining === 0) break;\n\t\t}\n\t\tconst prev = previousTextNode(startNode);\n\t\tif (!prev) break;\n\t\tstartNode = prev;\n\t\tstartOffset = prev.textContent?.length ?? 0;\n\t}\n\n\tconst range = document.createRange();\n\trange.setStart(startNode, startOffset);\n\trange.setEnd(caret.endContainer, caret.endOffset);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n\n\tif (editor) {\n\t\teditor.chain().focus().insertContent(html).run();\n\t\tnotifyChange(editor.getHTML());\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\tsel.collapseToEnd();\n\tconst editable =\n\t\t(startNode as Element | null)?.parentElement?.closest?.('[contenteditable=\"true\"]') ?? null;\n\tif (editable) notifyChange((editable as HTMLElement).innerHTML);\n}\n\nexport function insertHtmlIntoEditable(editable: HTMLElement | null, html: string): void {\n\tif (typeof window === 'undefined' || !editable) return;\n\teditable.focus();\n\n\tconst sel = window.getSelection();\n\tif (!sel || sel.rangeCount === 0) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\tconst range = sel.getRangeAt(0);\n\tif (!editable.contains(range.commonAncestorContainer)) {\n\t\teditable.insertAdjacentHTML('beforeend', html);\n\t\treturn;\n\t}\n\n\trange.deleteContents();\n\tconst fragment = document.createRange().createContextualFragment(html);\n\trange.insertNode(fragment);\n\trange.collapse(false);\n\tsel.removeAllRanges();\n\tsel.addRange(range);\n}\n\nfunction previousTextNode(node: Node): Node | null {\n\tlet current: Node | null = node;\n\twhile (current) {\n\t\tif (current.previousSibling) {\n\t\t\tcurrent = current.previousSibling;\n\t\t\twhile (current && current.lastChild) {\n\t\t\t\tcurrent = current.lastChild;\n\t\t\t}\n\t\t\tif (current && current.nodeType === Node.TEXT_NODE) return current;\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent = current.parentNode;\n\t\tif (!current || (current as Element).matches?.('p, li, h1, h2, h3, h4, h5, h6, blockquote, [contenteditable=\"true\"]')) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn null;\n}\n","import { Number as NumberValue, SecondaryValue } from '../../../primitives';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type { RichTextEditorStrings } from '../rich-text-editor.strings';\nimport type { TiptapEditor } from '../rich-text-editor.types';\n\nexport interface CountsFooterTextProps {\n\t/** Plain-text projection of the document, used for the character count. */\n\ttext: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function CountsFooterText({ text, maxLength, strings, className }: CountsFooterTextProps) {\n\tconst chars = text.length;\n\tconst words = text.trim().length > 0 ? text.trim().split(/\\s+/).length : 0;\n\tconst overLimit = typeof maxLength === 'number' && chars > maxLength;\n\n\treturn (\n\t\t<div className={cn('counts-footer-text--component border-border flex items-center justify-end gap-space-lg border-t px-control py-space-sm', className)}>\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"xs\"\n\t\t\t\ttype={overLimit ? 'error' : 'secondary'}\n\t\t\t\tweight={overLimit ? 'medium' : 'regular'}\n\t\t\t\tclassName={cn('tabular-nums')}\n\t\t\t>\n\t\t\t\t<NumberValue value={chars} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" />\n\t\t\t\t{typeof maxLength === 'number' && (\n\t\t\t\t\t<> / <NumberValue value={maxLength} size=\"xs\" type={overLimit ? 'error' : 'secondary'} align=\"left\" /></>\n\t\t\t\t)} {strings.counts.characters}\n\t\t\t</Text>\n\t\t\t<SecondaryValue size=\"xs\" className=\"tabular-nums\">\n\t\t\t\t<NumberValue value={words} size=\"xs\" type=\"secondary\" align=\"left\" /> {strings.counts.words}\n\t\t\t</SecondaryValue>\n\t\t</div>\n\t);\n}\n\nCountsFooterText.displayName = 'CountsFooterText';\n\nexport interface CountsFooterProps {\n\t/** The editor instance, for reading counts directly. */\n\teditor: TiptapEditor;\n\t/** Whether the editor is showing HTML source. */\n\tsourceMode: boolean;\n\t/** Raw HTML while in source mode. */\n\tsourceValue: string;\n\t/** Character cap the count is measured against. */\n\tmaxLength?: number;\n\t/** Overrides this surface's own copy. */\n\tstrings: RichTextEditorStrings;\n}\n\nexport function CountsFooter({\n\teditor,\n\tsourceMode,\n\tsourceValue,\n\tmaxLength,\n\tstrings,\n}: CountsFooterProps) {\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editor?.getText() ?? '');\n\n\treturn <CountsFooterText text={text} maxLength={maxLength} strings={strings} />;\n}\n\nCountsFooter.displayName = 'CountsFooter';\n","/**\n * Plain HTML normalization shared by the TipTap and contenteditable\n * fallback editors. Keeping these out of the React tree means the\n * editor partials stay focused on rendering.\n */\n\nexport function normalizeHtml(value: string): string {\n\tconst trimmed = value.trim();\n\n\tif (trimmed === '' || trimmed === '<p></p>' || trimmed === '<p><br></p>') {\n\t\treturn '';\n\t}\n\n\treturn trimmed;\n}\n\nexport function toEditorContent(value: string): string {\n\tconst normalized = normalizeHtml(value);\n\treturn normalized === '' ? '<p></p>' : normalized;\n}\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\nimport * as TiptapReact from '@tiptap/react';\nimport * as StarterKitModule from '@tiptap/starter-kit';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport { readCaretContext, replaceBeforeCaret } from './caret-helpers';\nimport { CountsFooter } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\nconst EditorContent = TiptapReact.EditorContent;\nconst useTiptapEditor = TiptapReact.useEditor;\nconst StarterKit =\n\t'default' in StarterKitModule ? StarterKitModule.default : StarterKitModule;\n\nexport const TiptapRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function TiptapRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst isFocusedRef = useRef(false);\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst editor = useTiptapEditor({\n\t\textensions: [StarterKit],\n\t\tcontent: toEditorContent(value),\n\t\teditable: !disabled,\n\t\timmediatelyRender: false,\n\t\tautofocus: autoFocus ? 'end' : false,\n\t\tonFocus: () => {\n\t\t\tisFocusedRef.current = true;\n\t\t\tsetIsFocused(true);\n\t\t},\n\t\tonBlur: () => {\n\t\t\tisFocusedRef.current = false;\n\t\t\tsetIsFocused(false);\n\t\t},\n\t\tonUpdate: ({ editor: currentEditor }: { editor: { getHTML: () => string } }) => {\n\t\t\tconst html = normalizeHtml(currentEditor.getHTML());\n\t\t\tif (!isFocusedRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (html !== externalValueRef.current) {\n\t\t\t\texternalValueRef.current = html;\n\t\t\t\tonValueChange(html);\n\t\t\t}\n\n\t\t\tonCaretChangeRef.current?.();\n\t\t},\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\trole: 'textbox',\n\t\t\t\t'aria-label': strings.editorLabel,\n\t\t\t\t'aria-multiline': 'true',\n\t\t\t\tclass: editableContentClassName,\n\t\t\t},\n\t\t},\n\t});\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst current = normalizeHtml(editor.getHTML());\n\t\tconst next = normalizeHtml(value);\n\t\texternalValueRef.current = next;\n\n\t\tif (current !== next) {\n\t\t\teditor.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t}\n\t}, [editor, value]);\n\n\tuseEffect(() => {\n\t\tif (!editor) {\n\t\t\treturn;\n\t\t}\n\n\t\teditor.setEditable(!disabled);\n\t}, [disabled, editor]);\n\n\tuseEffect(() => {\n\t\tif (typeof document === 'undefined') return;\n\t\tconst handler = () => {\n\t\t\tif (!isFocusedRef.current) return;\n\t\t\tonCaretChangeRef.current?.();\n\t\t};\n\t\tdocument.addEventListener('selectionchange', handler);\n\t\treturn () => document.removeEventListener('selectionchange', handler);\n\t}, []);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => {\n\t\t\t\teditor?.chain().focus().run();\n\t\t\t},\n\t\t\tgetHTML: () => normalizeHtml(editor?.getHTML() ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\teditor?.commands.setContent(toEditorContent(next), { emitUpdate: false });\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tif (!editor) return;\n\t\t\t\teditor.chain().focus().insertContent(html).run();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editor?.getHTML() ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\teditor?.commands.setContent('<p></p>', { emitUpdate: false });\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(editor, length, html, (next) => {\n\t\t\t\t\texternalValueRef.current = normalizeHtml(next);\n\t\t\t\t\tonValueChange(externalValueRef.current);\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t\t[editor, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (sourceMode) {\n\t\t\tconst html = toEditorContent(sourceValue);\n\t\t\teditor.commands.setContent(html, { emitUpdate: false });\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t} else {\n\t\t\tsetSourceValue(editor.getHTML());\n\t\t\tsetSourceMode(true);\n\t\t}\n\t}, [editor, onValueChange, sourceMode, sourceValue]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: 'bold',\n\t\t\t\ticon: Bold,\n\t\t\t\tlabel: strings.toolbar.bold,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bold')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'italic',\n\t\t\t\ticon: Italic,\n\t\t\t\tlabel: strings.toolbar.italic,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('italic')),\n\t\t\t\trun: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'strike',\n\t\t\t\ticon: Strikethrough,\n\t\t\t\tlabel: strings.toolbar.strike,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('strike')),\n\t\t\t\trun: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bullet-list',\n\t\t\t\ticon: List,\n\t\t\t\tlabel: strings.toolbar.bulletList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('bulletList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBulletList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'ordered-list',\n\t\t\t\ticon: ListOrdered,\n\t\t\t\tlabel: strings.toolbar.orderedList,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('orderedList')),\n\t\t\t\trun: () => editor?.chain().focus().toggleOrderedList().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'blockquote',\n\t\t\t\ticon: Quote,\n\t\t\t\tlabel: strings.toolbar.blockquote,\n\t\t\t\tisActive: () => Boolean(editor?.isActive('blockquote')),\n\t\t\t\trun: () => editor?.chain().focus().toggleBlockquote().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'undo',\n\t\t\t\ticon: Undo2,\n\t\t\t\tlabel: strings.toolbar.undo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().undo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().undo().run(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'redo',\n\t\t\t\ticon: Redo2,\n\t\t\t\tlabel: strings.toolbar.redo,\n\t\t\t\tisActive: () => false,\n\t\t\t\trun: () => editor?.chain().focus().redo().run(),\n\t\t\t\tdisabled: !editor?.can().chain().focus().redo().run(),\n\t\t\t},\n\t\t],\n\t\t[editor, strings],\n\t);\n\n\tconst countsFooter =\n\t\tshowCounts && editor ? (\n\t\t\t<CountsFooter\n\t\t\t\teditor={editor}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\tsourceValue={sourceValue}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t) : null;\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst showPlaceholder =\n\t\tplaceholderText.length > 0 && !isFocused && Boolean(editor?.isEmpty);\n\tconst placeholderNode = showPlaceholder ? (\n\t\t<Text\n\t\t\ttag=\"span\"\n\t\t\tsize=\"sm\"\n\t\t\ttype=\"secondary\"\n\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t>\n\t\t\t{placeholderText}\n\t\t</Text>\n\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor={Boolean(editor)}\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<Textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0',\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\n\t\t\t\t\t<EditorContent\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\tclassName={richTextEditorRecipes.content}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nTiptapRichTextEditor.displayName = 'TiptapRichTextEditor';\n\nexport const hasTiptapRuntime =\n\ttypeof EditorContent === 'function' &&\n\ttypeof useTiptapEditor === 'function' &&\n\ttypeof StarterKit === 'object' &&\n\tStarterKit !== null;\n","import {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tBold,\n\tItalic,\n\tList,\n\tListOrdered,\n\tQuote,\n\tRedo2,\n\tStrikethrough,\n\tUndo2,\n} from 'lucide-react';\n\nimport { richTextEditorRecipes } from '../rich-text-editor.recipes';\nimport { editableContentClassName } from '../../../typography/content-typography';\n\nimport { Textarea } from '../../../base/text-inputs';\nimport { Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport { defaultRichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\nimport {\n\tinsertHtmlIntoEditable,\n\treadCaretContext,\n\treplaceBeforeCaret,\n} from './caret-helpers';\nimport { CountsFooterText } from './counts-footer';\nimport { normalizeHtml, toEditorContent } from './html-helpers';\nimport { RichTextEditorToolbar } from './rich-text-editor-toolbar';\n\n/**\n * Fallback editor used when the TipTap runtime is unavailable (e.g. in\n * environments where the package failed to load). Renders a\n * `contenteditable` surface with the same imperative handle so callers\n * never need to care which variant they got.\n */\nexport const FallbackRichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function FallbackRichTextEditor(\n\t{\n\t\tvalue,\n\t\tonValueChange,\n\t\tplaceholder,\n\t\tcompact = false,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tdisabled = false,\n\t\tshowCounts = false,\n\t\tmaxLength,\n\t\textraToolbarItems,\n\t\ttoolbarTrailing,\n\t\tfooterSlot,\n\t\thideSourceToggle = false,\n\t\tautoFocus = false,\n\t\tclassName,\n\t\tonCaretChange,\n\t\tstrings: stringsProp,\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultRichTextEditorStrings, stringsProp);\n\tconst editableRef = useRef<HTMLDivElement>(null);\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [sourceMode, setSourceMode] = useState(false);\n\tconst [sourceValue, setSourceValue] = useState('');\n\tconst externalValueRef = useRef<string>(normalizeHtml(value));\n\tconst onCaretChangeRef = useRef(onCaretChange);\n\tonCaretChangeRef.current = onCaretChange;\n\n\tconst setEditableRef = useCallback((node: HTMLDivElement | null) => {\n\t\teditableRef.current = node;\n\t\tif (node && node.innerHTML === '') {\n\t\t\tnode.innerHTML = toEditorContent(externalValueRef.current);\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst editable = editableRef.current;\n\t\tif (!editable || isFocused) return;\n\t\tconst next = toEditorContent(value);\n\t\tif (normalizeHtml(editable.innerHTML) !== normalizeHtml(next)) {\n\t\t\teditable.innerHTML = next;\n\t\t}\n\t\texternalValueRef.current = normalizeHtml(value);\n\t}, [isFocused, value]);\n\n\tuseEffect(() => {\n\t\tif (!autoFocus) return;\n\t\teditableRef.current?.focus();\n\t}, [autoFocus]);\n\n\tconst emitEditableChange = useCallback(() => {\n\t\tconst editable = editableRef.current;\n\t\tconst html = normalizeHtml(editable?.innerHTML ?? '');\n\t\texternalValueRef.current = html;\n\t\tonValueChange(html);\n\t\tonCaretChangeRef.current?.();\n\t}, [onValueChange]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => editableRef.current?.focus(),\n\t\t\tgetHTML: () => normalizeHtml(editableRef.current?.innerHTML ?? ''),\n\t\t\tsetHTML: (html: string) => {\n\t\t\t\tconst next = normalizeHtml(html);\n\t\t\t\texternalValueRef.current = next;\n\t\t\t\tif (editableRef.current) {\n\t\t\t\t\teditableRef.current.innerHTML = toEditorContent(next);\n\t\t\t\t}\n\t\t\t\tonValueChange(next);\n\t\t\t},\n\t\t\tinsertHTML: (html: string) => {\n\t\t\t\tinsertHtmlIntoEditable(editableRef.current, html);\n\t\t\t\temitEditableChange();\n\t\t\t},\n\t\t\tisEmpty: () => normalizeHtml(editableRef.current?.innerHTML ?? '') === '',\n\t\t\tclear: () => {\n\t\t\t\texternalValueRef.current = '';\n\t\t\t\tif (editableRef.current) editableRef.current.innerHTML = '<p></p>';\n\t\t\t\tonValueChange('');\n\t\t\t},\n\t\t\tgetCaretContext: () => readCaretContext(),\n\t\t\treplaceBeforeCaret: (length: number, html: string) => {\n\t\t\t\treplaceBeforeCaret(null, length, html, () => emitEditableChange());\n\t\t\t},\n\t\t}),\n\t\t[emitEditableChange, onValueChange],\n\t);\n\n\tconst contentStyle = useMemo(\n\t\t() => ({\n\t\t\tminHeight: minHeight ?? (compact ? '2rem' : '12rem'),\n\t\t\t...(maxHeight ? { maxHeight, overflowY: 'auto' as const } : {}),\n\t\t}),\n\t\t[compact, maxHeight, minHeight],\n\t);\n\n\tconst toggleSourceMode = useCallback(() => {\n\t\tif (sourceMode) {\n\t\t\tconst normalized = normalizeHtml(sourceValue);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tif (editableRef.current) {\n\t\t\t\teditableRef.current.innerHTML = toEditorContent(normalized);\n\t\t\t}\n\t\t\tonValueChange(normalized);\n\t\t\tsetSourceMode(false);\n\t\t\treturn;\n\t\t}\n\t\tsetSourceValue(editableRef.current?.innerHTML ?? toEditorContent(value));\n\t\tsetSourceMode(true);\n\t}, [onValueChange, sourceMode, sourceValue, value]);\n\n\tconst handleSourceChange = useCallback(\n\t\t(e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\t\tconst next = e.target.value;\n\t\t\tsetSourceValue(next);\n\t\t\tconst normalized = normalizeHtml(next);\n\t\t\texternalValueRef.current = normalized;\n\t\t\tonValueChange(normalized);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst placeholderText = typeof placeholder === 'string' ? placeholder : '';\n\tconst isEmpty = normalizeHtml(externalValueRef.current) === '';\n\tconst placeholderNode =\n\t\tplaceholderText.length > 0 && !isFocused && isEmpty ? (\n\t\t\t<Text\n\t\t\t\ttag=\"span\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"secondary\"\n\t\t\t\tclassName=\"pointer-events-none absolute inset-0 px-control py-control-y-offset\"\n\t\t\t>\n\t\t\t\t{placeholderText}\n\t\t\t</Text>\n\t\t) : null;\n\n\tconst toolbarButtons = useMemo<ToolbarButtonConfig[]>(\n\t\t() => [\n\t\t\t{ id: 'bold', icon: Bold, label: strings.toolbar.bold, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'italic', icon: Italic, label: strings.toolbar.italic, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'strike', icon: Strikethrough, label: strings.toolbar.strike, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'bullet-list', icon: List, label: strings.toolbar.bulletList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'ordered-list', icon: ListOrdered, label: strings.toolbar.orderedList, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'blockquote', icon: Quote, label: strings.toolbar.blockquote, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'undo', icon: Undo2, label: strings.toolbar.undo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t\t{ id: 'redo', icon: Redo2, label: strings.toolbar.redo, isActive: () => false, run: () => undefined, disabled: true },\n\t\t],\n\t\t[strings],\n\t);\n\n\tconst text = sourceMode\n\t\t? sourceValue.replace(/<[^>]*>/g, '')\n\t\t: (editableRef.current?.innerText ?? normalizeHtml(value).replace(/<[^>]*>/g, ''));\n\tconst countsFooter =\n\t\tshowCounts ? (\n\t\t\t<CountsFooterText text={text} maxLength={maxLength} strings={strings} />\n\t\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\trichTextEditorRecipes.frame,\n\t\t\t\tdisabled && richTextEditorRecipes.disabled,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<RichTextEditorToolbar\n\t\t\t\tbuttons={toolbarButtons}\n\t\t\t\textraToolbarItems={extraToolbarItems}\n\t\t\t\thideSourceToggle={hideSourceToggle}\n\t\t\t\tsourceMode={sourceMode}\n\t\t\t\ttoggleSourceMode={toggleSourceMode}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thasEditor\n\t\t\t\ttoolbarTrailing={toolbarTrailing}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\n\t\t\t{sourceMode ? (\n\t\t\t\t<Textarea\n\t\t\t\t\taria-label={strings.sourceLabel}\n\t\t\t\t\tvalue={sourceValue}\n\t\t\t\t\tonChange={handleSourceChange}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tspellCheck={false}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'min-h-0 w-full resize-y rounded-none border-0 bg-muted/50 px-control py-control-y-offset font-mono text-xs leading-relaxed focus-visible:ring-0',\n\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={contentStyle}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"relative\" style={contentStyle}>\n\t\t\t\t\t{placeholderNode}\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={setEditableRef}\n\t\t\t\t\t\trole=\"textbox\"\n\t\t\t\t\t\taria-label={strings.editorLabel}\n\t\t\t\t\t\taria-multiline=\"true\"\n\t\t\t\t\t\tcontentEditable={!disabled}\n\t\t\t\t\t\tsuppressContentEditableWarning\n\t\t\t\t\t\tonInput={emitEditableChange}\n\t\t\t\t\t\tonKeyUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonMouseUp={() => onCaretChangeRef.current?.()}\n\t\t\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsFocused(false)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\teditableContentClassName,\n\t\t\t\t\t\t\t'h-full min-h-full',\n\t\t\t\t\t\t\tdisabled && 'cursor-not-allowed',\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!!footerSlot && (\n\t\t\t\t<div className=\"px-control pb-space-md pt-space-xs\">{footerSlot}</div>\n\t\t\t)}\n\n\t\t\t{countsFooter}\n\t\t</div>\n\t);\n});\n\nFallbackRichTextEditor.displayName = 'FallbackRichTextEditor';\n","/**\n * Public `<RichTextEditor>` shell — picks the TipTap-backed editor when\n * the runtime is loaded and falls back to a plain `contenteditable`\n * surface otherwise. Both variants implement the same imperative\n * `RichTextEditorHandle`, so callers don't have to branch.\n *\n * Heavy lifting lives in `partials/`:\n * - `partials/rich-text-editor-tiptap.tsx` — TipTap variant\n * - `partials/rich-text-editor-fallback.tsx` — contenteditable variant\n * - `partials/rich-text-editor-toolbar.tsx` — shared toolbar\n * - `partials/counts-footer.tsx` — char/word counts\n * - `partials/caret-helpers.ts` — caret introspection\n * - `partials/html-helpers.ts` — HTML normalization\n */\nimport { forwardRef } from 'react';\n\nimport {\n\tFallbackRichTextEditor,\n\tTiptapRichTextEditor,\n\thasTiptapRuntime,\n} from './partials';\nimport type {\n\tRichTextEditorHandle,\n\tRichTextEditorProps,\n} from './rich-text-editor.types';\n\nexport const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(function RichTextEditor(\n\tprops,\n\tref,\n) {\n\tif (!hasTiptapRuntime) {\n\t\treturn <FallbackRichTextEditor className=\"rich-text-editor--component\" {...props} ref={ref} />;\n\t}\n\n\treturn <TiptapRichTextEditor {...props} ref={ref} />;\n});\n\nRichTextEditor.displayName = 'RichTextEditor';\n\nexport type {\n\tRichTextEditorProps,\n\tRichTextEditorHandle,\n\tRichTextEditorToolbarItem,\n\tRichTextCaretContext,\n} from './rich-text-editor.types';\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgBe,KAAgD;CAC/D,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAMC,IAAM,OAAO,aAAa;CAChC,IAAI,CAACA,KAAOA,EAAI,eAAe,GAAG,OAAO;CACzC,IAAMC,IAAQD,EAAI,WAAW,CAAC;CAC9B,IAAI,CAACC,EAAM,WAAW,OAAO;CAE7B,IAAMC,IAAYD,EAAM,gBAClBE,IAAcF,EAAM,aAEtBG,IAAqBF;CACzB,OAAOE,KAASA,EAAM,aAAa,KAAK,eACvC,IAAQA,EAAM;CAEf,IAAI,CAACA,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