themelia-react-ui 1.0.2 → 2.0.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 (542) hide show
  1. package/CHANGELOG.md +281 -1
  2. package/README.md +10 -5
  3. package/dist/{accordion-BRTcsp8J.js → accordion-CQXVcd7Q.js} +13 -13
  4. package/dist/accordion-CQXVcd7Q.js.map +1 -0
  5. package/dist/action-menu-BTpyPWJ2.js +264 -0
  6. package/dist/action-menu-BTpyPWJ2.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-CL84ZN9A.js → affordance-geometry.generated-CCIXb2A1.js} +7 -2
  8. package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
  9. package/dist/{ai-artifact-DLVdK0Py.js → ai-artifact-2PQ2fItc.js} +171 -176
  10. package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
  11. package/dist/{app-shell-C_fKpljx.js → app-shell-BE_j8-AT.js} +4 -4
  12. package/dist/{app-shell-C_fKpljx.js.map → app-shell-BE_j8-AT.js.map} +1 -1
  13. package/dist/{attachment-DbjUWsP0.js → attachment-q69dlt5Y.js} +9 -9
  14. package/dist/{attachment-DbjUWsP0.js.map → attachment-q69dlt5Y.js.map} +1 -1
  15. package/dist/{auth-CAQcasMV.js → auth-M3vGMgDR.js} +42 -42
  16. package/dist/{auth-CAQcasMV.js.map → auth-M3vGMgDR.js.map} +1 -1
  17. package/dist/{avatar-Bu2HhitA.js → avatar-djdaaQ_s.js} +14 -12
  18. package/dist/avatar-djdaaQ_s.js.map +1 -0
  19. package/dist/{badge-CzId1Wlm.js → badge-0tATj-tW.js} +9 -9
  20. package/dist/badge-0tATj-tW.js.map +1 -0
  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 +2 -2
  27. package/dist/base/cards.js +2 -2
  28. package/dist/base/carousel.js +11 -11
  29. package/dist/base/carousel.js.map +1 -1
  30. package/dist/base/cascader.js +244 -222
  31. package/dist/base/cascader.js.map +1 -1
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +2 -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 +2 -2
  39. package/dist/base/display.js +6 -6
  40. package/dist/base/feedback.js +3 -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 +81 -76
  44. package/dist/base/inline-edit.js.map +1 -1
  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 +7 -4
  51. package/dist/base/qr-code.js.map +1 -1
  52. package/dist/base/repeaters.js +42 -42
  53. package/dist/base/repeaters.js.map +1 -1
  54. package/dist/base/sheet.js +1 -1
  55. package/dist/base/sidebar.js +1 -1
  56. package/dist/base/signature-pad.js +9 -9
  57. package/dist/base/signature-pad.js.map +1 -1
  58. package/dist/base/skeleton.js +1 -1
  59. package/dist/base/spinner.js +1 -1
  60. package/dist/base/structure.js +1 -1
  61. package/dist/base/table.js +1 -1
  62. package/dist/base/text-inputs.js +2 -2
  63. package/dist/base/toaster.js +4 -4
  64. package/dist/base/toaster.js.map +1 -1
  65. package/dist/base/tree.js +1 -1
  66. package/dist/base/upload-queue.js +1 -1
  67. package/dist/base/upload.js +3 -3
  68. package/dist/base/value-inputs.js +1 -1
  69. package/dist/blocks/admin.js +229 -220
  70. package/dist/blocks/admin.js.map +1 -1
  71. package/dist/blocks/ai.js +147 -180
  72. package/dist/blocks/ai.js.map +1 -1
  73. package/dist/blocks/analytics/usage-card.js +1 -1
  74. package/dist/blocks/analytics.js +530 -523
  75. package/dist/blocks/analytics.js.map +1 -1
  76. package/dist/blocks/collaboration.js +1 -1
  77. package/dist/blocks/commerce/receipt.js +1 -1
  78. package/dist/blocks/commerce.js +1390 -1516
  79. package/dist/blocks/commerce.js.map +1 -1
  80. package/dist/blocks/data-display.js +1 -1
  81. package/dist/blocks/onboarding.js +5 -5
  82. package/dist/blocks/planning.js +82 -91
  83. package/dist/blocks/planning.js.map +1 -1
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-BuYz5SDU.js → breadcrumbs-BG_FfMK4.js} +5 -5
  86. package/dist/{breadcrumbs-BuYz5SDU.js.map → breadcrumbs-BG_FfMK4.js.map} +1 -1
  87. package/dist/{button-BZDasD04.js → button-BS3KDg00.js} +185 -162
  88. package/dist/button-BS3KDg00.js.map +1 -0
  89. package/dist/{button-BZyfTvwm.js → button-R9CCoH7A.js} +2 -2
  90. package/dist/{button-BZyfTvwm.js.map → button-R9CCoH7A.js.map} +1 -1
  91. package/dist/{buttons-D_6KJvEE.js → buttons-DS0ZIwJ_.js} +11 -11
  92. package/dist/buttons-DS0ZIwJ_.js.map +1 -0
  93. package/dist/{cards-qGSErLw_.js → cards-QoJ4syG9.js} +7 -7
  94. package/dist/{cards-qGSErLw_.js.map → cards-QoJ4syG9.js.map} +1 -1
  95. package/dist/{chart-Bsc5BICK.js → chart-DwYRKKc-.js} +17 -15
  96. package/dist/chart-DwYRKKc-.js.map +1 -0
  97. package/dist/checkbox-B7ygNTYp.js +35 -0
  98. package/dist/checkbox-B7ygNTYp.js.map +1 -0
  99. package/dist/choice-inputs-DrJ17tpL.js +752 -0
  100. package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
  101. package/dist/{code-block-DzHKRybS.js → code-block-CD0B7M93.js} +19 -19
  102. package/dist/{code-block-DzHKRybS.js.map → code-block-CD0B7M93.js.map} +1 -1
  103. package/dist/{collapsible-ClvC7Bj3.js → collapsible-oMUGM4tr.js} +3 -3
  104. package/dist/{collapsible-ClvC7Bj3.js.map → collapsible-oMUGM4tr.js.map} +1 -1
  105. package/dist/{collection-content-D6S8cv_n.js → collection-content-Ys-OZOkY.js} +3 -3
  106. package/dist/{collection-content-D6S8cv_n.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
  107. package/dist/{combobox-BFnbJJp3.js → combobox-6dvVny2q.js} +96 -97
  108. package/dist/combobox-6dvVny2q.js.map +1 -0
  109. package/dist/{combobox-hozNwUcc.js → combobox-CB7039j7.js} +326 -308
  110. package/dist/combobox-CB7039j7.js.map +1 -0
  111. package/dist/{command-BnmSchli.js → command-kPMPjIxJ.js} +34 -30
  112. package/dist/command-kPMPjIxJ.js.map +1 -0
  113. package/dist/{comments-u5L0OGip.js → comments-You0Bzbr.js} +349 -348
  114. package/dist/comments-You0Bzbr.js.map +1 -0
  115. package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
  116. package/dist/components/base/action-menu/action-menu.d.ts +7 -2
  117. package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
  118. package/dist/components/base/badge/badge.d.ts +1 -1
  119. package/dist/components/base/badge/badge.recipes.d.ts +4 -4
  120. package/dist/components/base/buttons/base-button.d.ts +7 -0
  121. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  122. package/dist/components/base/buttons/button.variants.d.ts +1 -0
  123. package/dist/components/base/buttons/loader-button.d.ts +3 -1
  124. package/dist/components/base/buttons/text-button.d.ts +2 -2
  125. package/dist/components/base/carousel/carousel.d.ts +3 -1
  126. package/dist/components/base/chart/chart.d.ts +7 -7
  127. package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
  128. package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
  129. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
  130. package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
  131. package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
  132. package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
  133. package/dist/components/base/date-pickers/datepicker.types.d.ts +13 -3
  134. package/dist/components/base/display/alert-dialog.d.ts +8 -2
  135. package/dist/components/base/display/content-block.d.ts +4 -2
  136. package/dist/components/base/display/date-block.d.ts +1 -1
  137. package/dist/components/base/display/dialog.d.ts +12 -5
  138. package/dist/components/base/display/surface-title.d.ts +6 -1
  139. package/dist/components/base/feedback/alert.d.ts +1 -1
  140. package/dist/components/base/feedback/state-display.d.ts +5 -4
  141. package/dist/components/base/forms/form-sizing.d.ts +32 -0
  142. package/dist/components/base/forms/workflow.d.ts +2 -0
  143. package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
  144. package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
  145. package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
  146. package/dist/components/base/navigation/language-switcher.d.ts +4 -1
  147. package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
  148. package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
  149. package/dist/components/base/qr-code/qr-code.d.ts +2 -0
  150. package/dist/components/base/sheet/index.d.ts +29 -1
  151. package/dist/components/base/sheet/sheet.d.ts +14 -5
  152. package/dist/components/base/spinner/spinner.d.ts +3 -2
  153. package/dist/components/base/structure/structure.types.d.ts +1 -1
  154. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  155. package/dist/components/base/upload/upload.recipes.d.ts +11 -0
  156. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
  157. package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
  158. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
  159. package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
  160. package/dist/components/blocks/analytics/index.d.ts +1 -1
  161. package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
  162. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  163. package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
  164. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
  165. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
  166. package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
  167. package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
  168. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
  169. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  170. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
  171. package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
  172. package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
  173. package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
  174. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
  175. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
  176. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
  177. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
  178. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  179. package/dist/components/features/overlays/drawer.d.ts +1 -1
  180. package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
  181. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
  182. package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
  183. package/dist/components/features/overlays/overlays.types.d.ts +42 -19
  184. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  185. package/dist/components/features/products/partials/index.d.ts +1 -1
  186. package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
  187. package/dist/components/features/products/partials/product-tone.d.ts +11 -1
  188. package/dist/components/features/products/products.types.d.ts +2 -1
  189. package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
  190. package/dist/components/layout/page/index.d.ts +1 -1
  191. package/dist/components/layout/page/page.types.d.ts +53 -3
  192. package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
  193. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  194. package/dist/components/primitives/date.d.ts +16 -3
  195. package/dist/components/primitives/dimensions.d.ts +6 -0
  196. package/dist/components/primitives/duration.d.ts +6 -0
  197. package/dist/components/primitives/file-size.d.ts +6 -0
  198. package/dist/components/primitives/index.d.ts +1 -1
  199. package/dist/components/primitives/initials.d.ts +11 -2
  200. package/dist/components/primitives/link.d.ts +7 -0
  201. package/dist/components/primitives/money.d.ts +29 -7
  202. package/dist/components/primitives/number.d.ts +17 -0
  203. package/dist/components/primitives/value-typography.d.ts +54 -0
  204. package/dist/components/primitives/value.d.ts +31 -6
  205. package/dist/components/typography/heading.d.ts +9 -1
  206. package/dist/components/typography/label.d.ts +3 -0
  207. package/dist/components/typography/running-text.d.ts +12 -0
  208. package/dist/components/typography/text-link.d.ts +23 -1
  209. package/dist/components/typography/text.d.ts +12 -0
  210. package/dist/components/typography/text.styles.d.ts +35 -13
  211. package/dist/components/ui/button.d.ts +1 -1
  212. package/dist/components/ui/checkbox.d.ts +5 -0
  213. package/dist/components/ui/overlay.recipes.d.ts +15 -2
  214. package/dist/components/ui/select.d.ts +3 -1
  215. package/dist/components/ui/switch.d.ts +5 -0
  216. package/dist/{containers-DqB-bSYE.js → containers-D_L4mTVb.js} +3 -3
  217. package/dist/{containers-DqB-bSYE.js.map → containers-D_L4mTVb.js.map} +1 -1
  218. package/dist/{copyable-BTSByfmq.js → copyable-DDjTeW_j.js} +4 -4
  219. package/dist/{copyable-BTSByfmq.js.map → copyable-DDjTeW_j.js.map} +1 -1
  220. package/dist/{data-display-Bihs9Ven.js → data-display-3xWQUnMA.js} +471 -478
  221. package/dist/data-display-3xWQUnMA.js.map +1 -0
  222. package/dist/date-picker-DrDFj8Lo.js +1527 -0
  223. package/dist/date-picker-DrDFj8Lo.js.map +1 -0
  224. package/dist/date-pickers-CnFCb0n2.js +174 -0
  225. package/dist/date-pickers-CnFCb0n2.js.map +1 -0
  226. package/dist/date-uf3z37Nm.js +144 -0
  227. package/dist/date-uf3z37Nm.js.map +1 -0
  228. package/dist/{display-CS6Hbk18.js → display-DrdvPwF0.js} +25 -25
  229. package/dist/display-DrdvPwF0.js.map +1 -0
  230. package/dist/{dropdown-menu-D-boNgGO.js → dropdown-menu-CURh59jb.js} +22 -15
  231. package/dist/dropdown-menu-CURh59jb.js.map +1 -0
  232. package/dist/features/activities.js +38 -35
  233. package/dist/features/activities.js.map +1 -1
  234. package/dist/features/ai-chat.js +36 -35
  235. package/dist/features/ai-chat.js.map +1 -1
  236. package/dist/features/async-preview.js +8 -8
  237. package/dist/features/combobox.js +1 -1
  238. package/dist/features/comments.js +1 -1
  239. package/dist/features/data-view.js +10 -10
  240. package/dist/features/email-composer.js +325 -326
  241. package/dist/features/email-composer.js.map +1 -1
  242. package/dist/features/event-calendar.js +190 -200
  243. package/dist/features/event-calendar.js.map +1 -1
  244. package/dist/features/filters.js +1 -1
  245. package/dist/features/global-search.js +77 -77
  246. package/dist/features/global-search.js.map +1 -1
  247. package/dist/features/kanban.js +4 -4
  248. package/dist/features/map.js +8 -8
  249. package/dist/features/media-library.js +499 -502
  250. package/dist/features/media-library.js.map +1 -1
  251. package/dist/features/mentions.js +1 -1
  252. package/dist/features/overlays.js +1 -1
  253. package/dist/features/products.js +1216 -1248
  254. package/dist/features/products.js.map +1 -1
  255. package/dist/features/questionnaire.js +46 -44
  256. package/dist/features/questionnaire.js.map +1 -1
  257. package/dist/features/resource-assignment.js +96 -88
  258. package/dist/features/resource-assignment.js.map +1 -1
  259. package/dist/features/resource.js +11 -11
  260. package/dist/features/rich-text-editor.js +2 -2
  261. package/dist/features/schema-form.js +188 -184
  262. package/dist/features/schema-form.js.map +1 -1
  263. package/dist/features/suggestions.js +3 -3
  264. package/dist/features/sync.js +7 -7
  265. package/dist/features/sync.js.map +1 -1
  266. package/dist/features/table.js +1 -1
  267. package/dist/features/theme-tweaker.js +469 -470
  268. package/dist/features/theme-tweaker.js.map +1 -1
  269. package/dist/{feedback-CJkUAapr.js → feedback-C7nR0UtT.js} +9 -10
  270. package/dist/feedback-C7nR0UtT.js.map +1 -0
  271. package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
  272. package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
  273. package/dist/{field-state-recipes-DQQpiLWC.js → field-state-recipes-C-MFBX_8.js} +3 -3
  274. package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
  275. package/dist/{filters-D6FF8L6s.js → filters-Da-gNPsE.js} +467 -467
  276. package/dist/filters-Da-gNPsE.js.map +1 -0
  277. package/dist/{form-field-CZwrkP7m.js → form-field-VZRULhUK.js} +7 -7
  278. package/dist/{form-field-CZwrkP7m.js.map → form-field-VZRULhUK.js.map} +1 -1
  279. package/dist/form-sizing-uWP4lzVh.js +126 -0
  280. package/dist/form-sizing-uWP4lzVh.js.map +1 -0
  281. package/dist/{forms-B5NCbkSC.js → forms-DDeEnXSY.js} +11 -11
  282. package/dist/forms-DDeEnXSY.js.map +1 -0
  283. package/dist/forms-numeric-D3CO60IF.js +905 -0
  284. package/dist/forms-numeric-D3CO60IF.js.map +1 -0
  285. package/dist/{header-kxruN3RM.js → header-2ycNqGOR.js} +43 -42
  286. package/dist/header-2ycNqGOR.js.map +1 -0
  287. package/dist/{hooks-BrlnCwQd.js → hooks-DQ5SPwZw.js} +2 -2
  288. package/dist/{hooks-BrlnCwQd.js.map → hooks-DQ5SPwZw.js.map} +1 -1
  289. package/dist/{icon-badge-Btc6pQrp.js → icon-badge-DKlaKXoo.js} +3 -3
  290. package/dist/{icon-badge-Btc6pQrp.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
  291. package/dist/index.js +2 -2
  292. package/dist/{input-vxcaNCYC.js → input-BoLm9Hks.js} +3 -3
  293. package/dist/{input-vxcaNCYC.js.map → input-BoLm9Hks.js.map} +1 -1
  294. package/dist/input-DhQdBnV3.js +255 -0
  295. package/dist/{input-SX9V0AL3.js.map → input-DhQdBnV3.js.map} +1 -1
  296. package/dist/item-xzh8Df65.js +264 -0
  297. package/dist/item-xzh8Df65.js.map +1 -0
  298. package/dist/layout/app-shell.js +1 -1
  299. package/dist/layout/auth.js +1 -1
  300. package/dist/layout/containers.js +1 -1
  301. package/dist/layout/header.js +1 -1
  302. package/dist/layout/hooks.js +1 -1
  303. package/dist/layout/navigation.js +1 -1
  304. package/dist/layout/page.js +1 -1
  305. package/dist/layout/settings.js +1 -1
  306. package/dist/layout/sidebar.js +2 -2
  307. package/dist/layout/workspace.js +1 -1
  308. package/dist/layout.js +10 -10
  309. package/dist/lib/affordance-geometry.generated.d.ts +6 -1
  310. package/dist/lib/field-affordance-recipes.d.ts +35 -0
  311. package/dist/lib/field-state-recipes.d.ts +4 -2
  312. package/dist/lib/format.d.ts +9 -0
  313. package/dist/lib/money-format.d.ts +30 -0
  314. package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
  315. package/dist/lib/surface-recipes.d.ts +8 -6
  316. package/dist/lib/token-merge.generated.d.ts +11 -11
  317. package/dist/lib/track-recipes.d.ts +1 -1
  318. package/dist/lib/ui-provider/provider.d.ts +7 -2
  319. package/dist/lib/ui-provider/store.d.ts +6 -2
  320. package/dist/lib/ui-provider/types.d.ts +5 -2
  321. package/dist/lib/utils.js +1 -1
  322. package/dist/{media-gallery-DLp3HAz0.js → media-gallery-DQUQ0m3O.js} +8 -8
  323. package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
  324. package/dist/{mentions-Cl0Kt_Pd.js → mentions-DwnO1hh4.js} +34 -35
  325. package/dist/{mentions-Cl0Kt_Pd.js.map → mentions-DwnO1hh4.js.map} +1 -1
  326. package/dist/{message-SZUNB1eX.js → message-YfFmbXNP.js} +5 -5
  327. package/dist/{message-SZUNB1eX.js.map → message-YfFmbXNP.js.map} +1 -1
  328. package/dist/{navigation-DyytsLRB.js → navigation-Cbp5V8gG.js} +33 -34
  329. package/dist/navigation-Cbp5V8gG.js.map +1 -0
  330. package/dist/{navigation-DnQSNMT0.js → navigation-Cs1npsPm.js} +111 -87
  331. package/dist/navigation-Cs1npsPm.js.map +1 -0
  332. package/dist/{navigation-row-recipes-DQEXQcqY.js → navigation-row-recipes-DlU-4QYO.js} +2 -2
  333. package/dist/{navigation-row-recipes-DQEXQcqY.js.map → navigation-row-recipes-DlU-4QYO.js.map} +1 -1
  334. package/dist/number-CKRBYmZK.js +352 -0
  335. package/dist/number-CKRBYmZK.js.map +1 -0
  336. package/dist/overlay.recipes-CNO2S9V6.js +34 -0
  337. package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
  338. package/dist/overlays-DhZO7N-I.js +994 -0
  339. package/dist/overlays-DhZO7N-I.js.map +1 -0
  340. package/dist/page-C6R_8jFt.js +325 -0
  341. package/dist/page-C6R_8jFt.js.map +1 -0
  342. package/dist/{page-header-D8nERkn5.js → page-header-hUTzcRZX.js} +9 -9
  343. package/dist/page-header-hUTzcRZX.js.map +1 -0
  344. package/dist/{pagination-NLGqRirf.js → pagination-Cm0jqa3I.js} +8 -8
  345. package/dist/{pagination-NLGqRirf.js.map → pagination-Cm0jqa3I.js.map} +1 -1
  346. package/dist/{popover-CghIYdQf.js → popover-Dcv_9jxr.js} +6 -6
  347. package/dist/{popover-CghIYdQf.js.map → popover-Dcv_9jxr.js.map} +1 -1
  348. package/dist/{popover-menu-B4PoWhRl.js → popover-menu-DnRFKnHP.js} +6 -6
  349. package/dist/{popover-menu-B4PoWhRl.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
  350. package/dist/{popover.recipes-QlD4JenO.js → popover.recipes-wmbvL8Ah.js} +2 -2
  351. package/dist/{popover.recipes-QlD4JenO.js.map → popover.recipes-wmbvL8Ah.js.map} +1 -1
  352. package/dist/primitives-BHrwQXFC.js +379 -0
  353. package/dist/primitives-BHrwQXFC.js.map +1 -0
  354. package/dist/primitives.js +5 -5
  355. package/dist/{progress-BroqrAyV.js → progress-Br9WTFya.js} +7 -7
  356. package/dist/progress-Br9WTFya.js.map +1 -0
  357. package/dist/{receipt-BuJynLgf.js → receipt-CV89q1fs.js} +6 -6
  358. package/dist/{receipt-BuJynLgf.js.map → receipt-CV89q1fs.js.map} +1 -1
  359. package/dist/{rich-text-editor-BKyG7rWz.js → rich-text-editor-CF8QYt5p.js} +6 -6
  360. package/dist/{rich-text-editor-BKyG7rWz.js.map → rich-text-editor-CF8QYt5p.js.map} +1 -1
  361. package/dist/{rich-text-editor.recipes-B72Nfuze.js → rich-text-editor.recipes-CnrbmTS1.js} +4 -4
  362. package/dist/{rich-text-editor.recipes-B72Nfuze.js.map → rich-text-editor.recipes-CnrbmTS1.js.map} +1 -1
  363. package/dist/{rich-text-DlxDOtf4.js → rich-text-j-FGAeZW.js} +4 -4
  364. package/dist/{rich-text-DlxDOtf4.js.map → rich-text-j-FGAeZW.js.map} +1 -1
  365. package/dist/{scroll-area-D-pIhEKl.js → scroll-area-DRdr16Pt.js} +3 -3
  366. package/dist/scroll-area-DRdr16Pt.js.map +1 -0
  367. package/dist/{separator-BhtFyo4x.js → separator-BMEvwnSX.js} +2 -2
  368. package/dist/{separator-BhtFyo4x.js.map → separator-BMEvwnSX.js.map} +1 -1
  369. package/dist/{separator-BNIgG3au.js → separator-Do5GWDYi.js} +4 -4
  370. package/dist/separator-Do5GWDYi.js.map +1 -0
  371. package/dist/services/actions/action-adapters.d.ts +4 -0
  372. package/dist/services/actions.js +8 -3
  373. package/dist/services/actions.js.map +1 -1
  374. package/dist/{settings-DOTOzeZ2.js → settings-DHk0L2MF.js} +17 -17
  375. package/dist/settings-DHk0L2MF.js.map +1 -0
  376. package/dist/sheet-DRFNY1_D.js +207 -0
  377. package/dist/sheet-DRFNY1_D.js.map +1 -0
  378. package/dist/sidebar-Cb8WzOvE.js +511 -0
  379. package/dist/sidebar-Cb8WzOvE.js.map +1 -0
  380. package/dist/{sidebar-CyR4XKwR.js → sidebar-Crc9M9JV.js} +18 -18
  381. package/dist/sidebar-Crc9M9JV.js.map +1 -0
  382. package/dist/{skeleton-3F0uhYn3.js → skeleton-DVMXr15h.js} +4 -4
  383. package/dist/{skeleton-3F0uhYn3.js.map → skeleton-DVMXr15h.js.map} +1 -1
  384. package/dist/{smart-card-DjGVV2xr.js → smart-card-Bek-TwUp.js} +222 -207
  385. package/dist/smart-card-Bek-TwUp.js.map +1 -0
  386. package/dist/{spinner-Cpf7oRkF.js → spinner-CmTAbEp0.js} +8 -6
  387. package/dist/spinner-CmTAbEp0.js.map +1 -0
  388. package/dist/{structure-CRdqVawd.js → structure-hzCW-XsV.js} +3 -3
  389. package/dist/{structure-CRdqVawd.js.map → structure-hzCW-XsV.js.map} +1 -1
  390. package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
  391. package/dist/structure.recipes-EPz60cU8.js.map +1 -0
  392. package/dist/style.css +1 -1
  393. package/dist/surface-recipes-DOdoBXGm.js +28 -0
  394. package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
  395. package/dist/table-D6zKeYQX.js +162 -0
  396. package/dist/table-D6zKeYQX.js.map +1 -0
  397. package/dist/{table-CcRDZiLP.js → table-Dn4XSrSB.js} +348 -348
  398. package/dist/table-Dn4XSrSB.js.map +1 -0
  399. package/dist/{tabs-BNgu7g0u.js → tabs-Dk8E_knt.js} +14 -13
  400. package/dist/tabs-Dk8E_knt.js.map +1 -0
  401. package/dist/{text-inputs-DsR56TR-.js → text-inputs-BFpku0Qd.js} +150 -149
  402. package/dist/text-inputs-BFpku0Qd.js.map +1 -0
  403. package/dist/{text.styles-Q4sGAIgA.js → text.styles-g4He6UIW.js} +17 -14
  404. package/dist/text.styles-g4He6UIW.js.map +1 -0
  405. package/dist/theme.css +16 -12
  406. package/dist/themes/green.css +24 -0
  407. package/dist/{timelines-D1pkt3se.js → timelines-CxuAFIc2.js} +25 -38
  408. package/dist/timelines-CxuAFIc2.js.map +1 -0
  409. package/dist/track-recipes-CDcKmndW.js +10 -0
  410. package/dist/track-recipes-CDcKmndW.js.map +1 -0
  411. package/dist/{tree-BtmYyMZV.js → tree-BotPlyiD.js} +13 -13
  412. package/dist/{tree-BtmYyMZV.js.map → tree-BotPlyiD.js.map} +1 -1
  413. package/dist/typography/rich-text.js +1 -1
  414. package/dist/typography-CAr3dQhX.js +116 -0
  415. package/dist/typography-CAr3dQhX.js.map +1 -0
  416. package/dist/typography.js +2 -2
  417. package/dist/{ui-provider-DRPn3qNl.js → ui-provider-D2_TeLqw.js} +20 -21
  418. package/dist/ui-provider-D2_TeLqw.js.map +1 -0
  419. package/dist/ui-provider.js +1 -1
  420. package/dist/{upload-CDbYw1WN.js → upload-B0WHW7ak.js} +221 -220
  421. package/dist/upload-B0WHW7ak.js.map +1 -0
  422. package/dist/{upload-queue-CNd_hH_a.js → upload-queue-BHZ_wBfd.js} +59 -62
  423. package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
  424. package/dist/{usage-card-VyJLUwRr.js → usage-card-U0YBLTNT.js} +42 -43
  425. package/dist/{usage-card-VyJLUwRr.js.map → usage-card-U0YBLTNT.js.map} +1 -1
  426. package/dist/{utils-BvH9PSmq.js → utils-Cospvlj1.js} +221 -51
  427. package/dist/utils-Cospvlj1.js.map +1 -0
  428. package/dist/value-inputs-CjfzGMsN.js +854 -0
  429. package/dist/value-inputs-CjfzGMsN.js.map +1 -0
  430. package/dist/value-typography-Deb3yQZg.js +116 -0
  431. package/dist/value-typography-Deb3yQZg.js.map +1 -0
  432. package/dist/{workspace-CcR8r-Nt.js → workspace-YoFjXi6i.js} +44 -45
  433. package/dist/workspace-YoFjXi6i.js.map +1 -0
  434. package/docs/consumer-skill/SKILL.md +51 -38
  435. package/docs/consumer-skill/examples/app-layout.tsx +2 -4
  436. package/docs/consumer-skill/examples/detail.tsx +3 -4
  437. package/docs/consumer-skill/examples/edit.tsx +1 -1
  438. package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
  439. package/docs/consumer-skill/examples/manifest.json +28 -6
  440. package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
  441. package/docs/consumer-skill/references/composition.md +89 -17
  442. package/docs/consumer-skill/references/discovery.md +4 -0
  443. package/docs/consumer-skill/references/installation.md +22 -0
  444. package/docs/consumer-skill/references/integration.md +32 -1
  445. package/docs/consumer-skill/references/public-api.json +111 -70
  446. package/docs/consumer-skill/references/review.md +20 -4
  447. package/docs/consumer-skill/references/theming.md +7 -1
  448. package/docs/consumer-skill/references/tokens.json +5 -2
  449. package/docs/consumer-skill/references/workflows.md +4 -2
  450. package/docs/consumer-skill/scripts/composition-policy.mjs +93 -2
  451. package/docs/consumer-skill/scripts/discovery.mjs +11 -3
  452. package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
  453. package/package.json +5 -3
  454. package/dist/accordion-BRTcsp8J.js.map +0 -1
  455. package/dist/action-menu-Drxw_vJk.js +0 -265
  456. package/dist/action-menu-Drxw_vJk.js.map +0 -1
  457. package/dist/affordance-geometry.generated-CL84ZN9A.js.map +0 -1
  458. package/dist/ai-artifact-DLVdK0Py.js.map +0 -1
  459. package/dist/avatar-Bu2HhitA.js.map +0 -1
  460. package/dist/badge-CzId1Wlm.js.map +0 -1
  461. package/dist/button-BZDasD04.js.map +0 -1
  462. package/dist/buttons-D_6KJvEE.js.map +0 -1
  463. package/dist/chart-Bsc5BICK.js.map +0 -1
  464. package/dist/checkbox-BQNDjUCh.js +0 -34
  465. package/dist/checkbox-BQNDjUCh.js.map +0 -1
  466. package/dist/choice-inputs-Mk3iWbhr.js +0 -725
  467. package/dist/choice-inputs-Mk3iWbhr.js.map +0 -1
  468. package/dist/combobox-BFnbJJp3.js.map +0 -1
  469. package/dist/combobox-hozNwUcc.js.map +0 -1
  470. package/dist/command-BnmSchli.js.map +0 -1
  471. package/dist/comments-u5L0OGip.js.map +0 -1
  472. package/dist/data-display-Bihs9Ven.js.map +0 -1
  473. package/dist/date-DOKhJPu7.js +0 -140
  474. package/dist/date-DOKhJPu7.js.map +0 -1
  475. package/dist/date-picker-DzP5HQq7.js +0 -1541
  476. package/dist/date-picker-DzP5HQq7.js.map +0 -1
  477. package/dist/date-pickers-BpgGz7S-.js +0 -196
  478. package/dist/date-pickers-BpgGz7S-.js.map +0 -1
  479. package/dist/display-CS6Hbk18.js.map +0 -1
  480. package/dist/dropdown-menu-D-boNgGO.js.map +0 -1
  481. package/dist/feedback-CJkUAapr.js.map +0 -1
  482. package/dist/field-affordance-recipes-uKY4MsZ_.js +0 -25
  483. package/dist/field-affordance-recipes-uKY4MsZ_.js.map +0 -1
  484. package/dist/field-state-recipes-DQQpiLWC.js.map +0 -1
  485. package/dist/filters-D6FF8L6s.js.map +0 -1
  486. package/dist/form-sizing-QP8aIRaW.js +0 -103
  487. package/dist/form-sizing-QP8aIRaW.js.map +0 -1
  488. package/dist/format-iamDSqs2.js +0 -110
  489. package/dist/format-iamDSqs2.js.map +0 -1
  490. package/dist/forms-B5NCbkSC.js.map +0 -1
  491. package/dist/forms-numeric-Crrm80Lm.js +0 -867
  492. package/dist/forms-numeric-Crrm80Lm.js.map +0 -1
  493. package/dist/header-kxruN3RM.js.map +0 -1
  494. package/dist/input-SX9V0AL3.js +0 -255
  495. package/dist/item-DE4YnuJx.js +0 -258
  496. package/dist/item-DE4YnuJx.js.map +0 -1
  497. package/dist/media-gallery-DLp3HAz0.js.map +0 -1
  498. package/dist/navigation-DnQSNMT0.js.map +0 -1
  499. package/dist/navigation-DyytsLRB.js.map +0 -1
  500. package/dist/number-DasMFWEG.js +0 -269
  501. package/dist/number-DasMFWEG.js.map +0 -1
  502. package/dist/overlay.recipes-BxW5FIfK.js +0 -6
  503. package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
  504. package/dist/overlays-DUbs1KEi.js +0 -1011
  505. package/dist/overlays-DUbs1KEi.js.map +0 -1
  506. package/dist/page-hGmT4nWK.js +0 -213
  507. package/dist/page-hGmT4nWK.js.map +0 -1
  508. package/dist/page-header-D8nERkn5.js.map +0 -1
  509. package/dist/primitives-C7ff0QaI.js +0 -337
  510. package/dist/primitives-C7ff0QaI.js.map +0 -1
  511. package/dist/progress-BroqrAyV.js.map +0 -1
  512. package/dist/scroll-area-D-pIhEKl.js.map +0 -1
  513. package/dist/separator-BNIgG3au.js.map +0 -1
  514. package/dist/settings-DOTOzeZ2.js.map +0 -1
  515. package/dist/sheet-BFhrNehm.js +0 -205
  516. package/dist/sheet-BFhrNehm.js.map +0 -1
  517. package/dist/sidebar-CyR4XKwR.js.map +0 -1
  518. package/dist/sidebar-SvGJ0Zwi.js +0 -506
  519. package/dist/sidebar-SvGJ0Zwi.js.map +0 -1
  520. package/dist/smart-card-DjGVV2xr.js.map +0 -1
  521. package/dist/spinner-Cpf7oRkF.js.map +0 -1
  522. package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
  523. package/dist/surface-recipes-Dd__PD-w.js +0 -28
  524. package/dist/surface-recipes-Dd__PD-w.js.map +0 -1
  525. package/dist/table-CLtJTxoR.js +0 -147
  526. package/dist/table-CLtJTxoR.js.map +0 -1
  527. package/dist/table-CcRDZiLP.js.map +0 -1
  528. package/dist/tabs-BNgu7g0u.js.map +0 -1
  529. package/dist/text-inputs-DsR56TR-.js.map +0 -1
  530. package/dist/text.styles-Q4sGAIgA.js.map +0 -1
  531. package/dist/timelines-D1pkt3se.js.map +0 -1
  532. package/dist/track-recipes-LLPNVwFg.js +0 -10
  533. package/dist/track-recipes-LLPNVwFg.js.map +0 -1
  534. package/dist/typography-BxQgiZyw.js +0 -96
  535. package/dist/typography-BxQgiZyw.js.map +0 -1
  536. package/dist/ui-provider-DRPn3qNl.js.map +0 -1
  537. package/dist/upload-CDbYw1WN.js.map +0 -1
  538. package/dist/upload-queue-CNd_hH_a.js.map +0 -1
  539. package/dist/utils-BvH9PSmq.js.map +0 -1
  540. package/dist/value-inputs-D0KCrfVC.js +0 -840
  541. package/dist/value-inputs-D0KCrfVC.js.map +0 -1
  542. package/dist/workspace-CcR8r-Nt.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "./lib/strings.js";
3
- import { t } from "./utils-BvH9PSmq.js";
4
- import { a as n } from "./typography-BxQgiZyw.js";
3
+ import { t } from "./utils-Cospvlj1.js";
4
+ import { s as n } from "./typography-CAr3dQhX.js";
5
5
  import { n as r } from "./content-typography-CnwgMJ37.js";
6
- import { g as i } from "./primitives-C7ff0QaI.js";
7
- import { t as a } from "./number-DasMFWEG.js";
8
- import { n as o, t as s } from "./rich-text-editor.recipes-B72Nfuze.js";
6
+ import { g as i } from "./primitives-BHrwQXFC.js";
7
+ import { t as a } from "./number-CKRBYmZK.js";
8
+ import { n as o, t as s } from "./rich-text-editor.recipes-CnrbmTS1.js";
9
9
  import { t as c } from "./rich-text-editor.strings-BpnIQgMl.js";
10
10
  import { forwardRef as l, useCallback as u, useEffect as d, useImperativeHandle as ee, useMemo as f, useRef as p, useState as m } from "react";
11
11
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
@@ -571,4 +571,4 @@ F.displayName = "RichTextEditor";
571
571
  //#endregion
572
572
  export { T as n, F as t };
573
573
 
574
- //# sourceMappingURL=rich-text-editor-BKyG7rWz.js.map
574
+ //# sourceMappingURL=rich-text-editor-CF8QYt5p.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-editor-BKyG7rWz.js","names":["NumberValue","_Fragment","EditorContent","StarterKit","Text","editableContentClassName","SecondaryValue","Number","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 { 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\trichTextEditorRecipes.source,\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 { 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\trichTextEditorRecipes.source,\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,SAAgBc,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,GAAO,OAAO;CACnB,IAAMC,IACJD,EAAkB,QAAQ,4BAA0B,KACpDA,EAAkB,QAAQ,cAAc;CAC1C,IAAI,CAACC,GAAU,OAAO;CAEtB,IAAIC,IAAO;CACX,AAAIJ,EAAU,aAAa,KAAK,cAC/B,KAAQA,EAAU,eAAe,GAAA,CAAI,MAAM,GAAGC,CAAW;CAG1D,IAAII,IAAsBL;CAC1B,OAAOK,KAAUA,MAAWF,KAAYE,MAAWH,IAAO;EACzD,IAAII,IAAoBD,EAAO;EAC/B,OAAOC,IAEN,AADA,KAAQA,EAAK,eAAe,MAAMF,GAClC,IAAOE,EAAK;EAGb,IADA,IAASD,EAAO,YACZA,KAAWA,EAAmB,UAAU,2CAA2C,GACtF;CAEF;CAEA,IAAIE,GACEC,IAAIT,EAAM,sBAAsB;CAKtC,O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AAD;EACC,WAAWK,EACVnC,EAAsB,OACtB+D,KAAY/D,EAAsB,UAClCoC,CACD;EALD,UAAA;GAOC,kBAACrC,GAAD;IACC,SAASiF;IACU;IACD;IACN;IACM;IACR;IACV,WAAA;IACiB;IACR;GACT,CAAA;GAEAzC,IACA,kBAAC,YAAD;IACC,cAAYF,EAAQ;IACpB,OAAOG;IACP,UAAUuC;IACA;IACV,YAAY;IACZ,WAAW5C,EACVnC,EAAsB,QACtB+D,KAAY,oBACb;IACA,OAAOS;GACP,CAAA,IAED,kBAAC,OAAD;IAAK,WAAU;IAAW,OAAOA;IAAjC,UAAA,CACEqB,IACD,kBAAC,OAAD;KACC,KAAKK;KACL,MAAK;KACL,cAAY7D,EAAQ;KACpB,kBAAe;KACf,iBAAiB,CAAC0B;KAClB,gCAAA;KACA,SAASoC;KACT,eAAetC,EAAiB,UAAU;KAC1C,iBAAiBA,EAAiB,UAAU;KAC5C,eAAeP,EAAa,EAAI;KAChC,cAAcA,EAAa,EAAK;KAChC,WAAWnB,EACVvC,GACA,qBACAmE,KAAY,oBACb;IACA,CAAA,CACG;;GAGL,CAAC,CAAC+B,KACF,kBAAC,OAAD;IAAK,WAAU;IAAsC,UAAAA;GAAgB,CAAA;GAGrEL;EACG;;AAEP,CAAC;AAED,EAAuB,cAAc;;;AC1PrC,IAAaY,IAAiBnD,EAAsD,SACnF,GACA,GACC;CAKD,OAJK6C,IAIE,kBAAC9C,GAAD;EAAsB,GAAIqD;EAAY;CAAM,CAAA,IAH3C,kBAACN,GAAD;EAAwB,WAAU;EAA8B,GAAIM;EAAY;CAAM,CAAA;AAI/F,CAAC;AAED,EAAe,cAAc"}
1
+ {"version":3,"file":"rich-text-editor-CF8QYt5p.js","names":["NumberValue","_Fragment","EditorContent","StarterKit","Text","editableContentClassName","SecondaryValue","Number","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 { 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\trichTextEditorRecipes.source,\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 { 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\trichTextEditorRecipes.source,\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,SAAgBc,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,GAAO,OAAO;CACnB,IAAMC,IACJD,EAAkB,QAAQ,4BAA0B,KACpDA,EAAkB,QAAQ,cAAc;CAC1C,IAAI,CAACC,GAAU,OAAO;CAEtB,IAAIC,IAAO;CACX,AAAIJ,EAAU,aAAa,KAAK,cAC/B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;EAAsB,GAAIqD;EAAY;CAAM,CAAA,IAH3C,kBAACN,GAAD;EAAwB,WAAU;EAA8B,GAAIM;EAAY;CAAM,CAAA;AAI/F,CAAC;AAED,EAAe,cAAc"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { t as e } from "./utils-BvH9PSmq.js";
3
- import { n as t } from "./text.styles-Q4sGAIgA.js";
4
- import { t as n } from "./button-BZDasD04.js";
2
+ import { t as e } from "./utils-Cospvlj1.js";
3
+ import { n as t } from "./text.styles-g4He6UIW.js";
4
+ import { t as n } from "./button-BS3KDg00.js";
5
5
  import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  import { Code2 as o } from "lucide-react";
7
7
  //#region src/components/features/rich-text-editor/partials/rich-text-editor-toolbar.tsx
@@ -78,4 +78,4 @@ var c = {
78
78
  //#endregion
79
79
  export { s as n, c as t };
80
80
 
81
- //# sourceMappingURL=rich-text-editor.recipes-B72Nfuze.js.map
81
+ //# sourceMappingURL=rich-text-editor.recipes-CnrbmTS1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-editor.recipes-B72Nfuze.js","names":["_Fragment","cn","resolveTextClassNames","Button","RichTextEditorToolbar","hasExtras","extraToolbarItems","className","buttons","Icon","button","isActive","disabled","hasEditor","sourceMode","hideSourceToggle","Fragment","toggleSourceMode","strings","Code2","item","toolbarTrailing","richTextEditorRecipes"],"sources":["../src/components/features/rich-text-editor/partials/rich-text-editor-toolbar.tsx","../src/components/features/rich-text-editor/rich-text-editor.recipes.ts"],"sourcesContent":["import { Code2 } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { Button } from '../../../base/buttons/button';\nimport { cn } from '../../../../lib/utils';\n\nimport type { RichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorToolbarItem,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\n\nexport interface RichTextEditorToolbarProps {\n\t/** Formatting controls to show, in order. */\n\tbuttons: ToolbarButtonConfig[];\n\t/** Additional controls appended to the toolbar. */\n\textraToolbarItems?: ReadonlyArray<RichTextEditorToolbarItem>;\n\t/** Hides the control that switches to HTML source. */\n\thideSourceToggle?: boolean;\n\t/** Whether the editor is currently showing HTML source. */\n\tsourceMode: boolean;\n\t/** Switches between rich text and HTML source. */\n\ttoggleSourceMode: () => void;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/**\n\t * The TipTap variant disables built-in buttons until the editor instance\n\t * is ready; the fallback variant simply marks them disabled. This flag\n\t * lets callers force the disabled state without re-deriving it per button.\n\t */\n\thasEditor?: boolean;\n\t/** Content pinned to the end of the toolbar. */\n\ttoolbarTrailing?: ReactNode;\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 RichTextEditorToolbar({\n\tbuttons,\n\textraToolbarItems,\n\thideSourceToggle = false,\n\tsourceMode,\n\ttoggleSourceMode,\n\tdisabled = false,\n\thasEditor = true,\n\ttoolbarTrailing,\n\tstrings,\n\tclassName,\n}: RichTextEditorToolbarProps) {\n\tconst hasExtras = (extraToolbarItems?.length ?? 0) > 0;\n\n\treturn (\n\t\t<div className={cn('rich-text-editor-toolbar--component border-border flex flex-wrap items-center gap-space-xs border-b p-surface-xs', className)}>\n\t\t\t{buttons.map((button) => {\n\t\t\t\tconst Icon = button.icon;\n\t\t\t\tconst isActive = button.isActive();\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={button.id}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone={isActive ? 'primary' : 'secondary'}\n\t\t\t\t\t\tbuttonStyle={isActive ? 'solid' : 'ghost'}\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\tonClick={button.run}\n\t\t\t\t\t\tdisabled={disabled || !hasEditor || sourceMode || button.disabled}\n\t\t\t\t\t\taria-label={button.label}\n\t\t\t\t\t\ttitle={button.label}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon className=\"size-icon\" />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t})}\n\n\t\t\t{!hideSourceToggle && (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"bg-border mx-space-xs size-icon w-px\" />\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone={sourceMode ? 'primary' : 'secondary'}\n\t\t\t\t\t\tbuttonStyle={sourceMode ? 'solid' : 'ghost'}\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\tonClick={toggleSourceMode}\n\t\t\t\t\t\tdisabled={disabled || !hasEditor}\n\t\t\t\t\t\taria-label={strings.toolbar.sourceCode}\n\t\t\t\t\t\ttitle={strings.toolbar.sourceCode}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Code2 className=\"size-icon\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{hasExtras && (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"bg-border mx-space-xs size-icon w-px\" />\n\t\t\t\t\t{extraToolbarItems?.map((item) => {\n\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\tconst isActive = item.isActive?.() ?? false;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone={isActive ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\t\tbuttonStyle={isActive ? 'solid' : 'ghost'}\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={item.onClick}\n\t\t\t\t\t\t\t\tdisabled={disabled || !hasEditor || sourceMode || item.disabled}\n\t\t\t\t\t\t\t\taria-label={item.label}\n\t\t\t\t\t\t\t\ttitle={item.label}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon className=\"size-icon\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{!!toolbarTrailing && (\n\t\t\t\t<div className=\"ml-auto flex items-center gap-space-xs\">{toolbarTrailing}</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nRichTextEditorToolbar.displayName = 'RichTextEditorToolbar';\n","import { resolveTextClassNames } from '../../typography/text.styles';\nimport { cn } from '../../../lib/utils';\n\n/** Shared field anatomy for rich editors, including specialized document schemas. */\nexport const richTextEditorRecipes = {\n source: cn('rich-text-editor--source box-border m-0 block min-h-0 w-full resize-y rounded-none border-0 bg-transparent px-control py-control-y-offset outline-none disabled:cursor-not-allowed disabled:opacity-50', resolveTextClassNames({type: 'main', size: 'xs', weight: 'regular', align: 'left', lineHeight: 'relaxed', numeric: true})),\n frame: 'min-w-0 overflow-hidden border-input bg-background rounded-inner border',\n disabled: 'opacity-70',\n content: 'h-full [&_.ProseMirror]:h-full [&_.ProseMirror]:min-h-full [&_.ProseMirror]:outline-none',\n} as const;\n"],"mappings":";;;;;;;AAuCA,SAAgBI,EAAsB,EACrC,YACA,sBACA,sBAAmB,IACnB,eACA,qBACA,cAAW,IACX,eAAY,IACZ,oBACA,YACA,gBAC8B;CAC9B,IAAMC,KAAaC,GAAmB,UAAU,KAAK;CAErD,OACC,kBAAC,OAAD;EAAK,WAAWL,EAAG,oHAAoHM,CAAS;EAAhJ,UAAA;GACEC,EAAQ,KAAK,MAAW;IACxB,IAAMC,IAAOC,EAAO,MACdC,IAAWD,EAAO,SAAS;IAEjC,OACC,kBAACP,GAAD;KAEC,MAAK;KACL,MAAMQ,IAAW,YAAY;KAC7B,aAAaA,IAAW,UAAU;KAClC,MAAK;KAAK,UAAA;KACV,SAASD,EAAO;KAChB,UAAUE,KAAY,CAACC,KAAaC,KAAcJ,EAAO;KACzD,cAAYA,EAAO;KACnB,OAAOA,EAAO;KAEd,UAAA,kBAAC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{"version":3,"file":"rich-text-editor.recipes-CnrbmTS1.js","names":["_Fragment","cn","resolveTextClassNames","Button","RichTextEditorToolbar","hasExtras","extraToolbarItems","className","buttons","Icon","button","isActive","disabled","hasEditor","sourceMode","hideSourceToggle","Fragment","toggleSourceMode","strings","Code2","item","toolbarTrailing","richTextEditorRecipes"],"sources":["../src/components/features/rich-text-editor/partials/rich-text-editor-toolbar.tsx","../src/components/features/rich-text-editor/rich-text-editor.recipes.ts"],"sourcesContent":["import { Code2 } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { Button } from '../../../base/buttons/button';\nimport { cn } from '../../../../lib/utils';\n\nimport type { RichTextEditorStrings } from '../rich-text-editor.strings';\nimport type {\n\tRichTextEditorToolbarItem,\n\tToolbarButtonConfig,\n} from '../rich-text-editor.types';\n\nexport interface RichTextEditorToolbarProps {\n\t/** Formatting controls to show, in order. */\n\tbuttons: ToolbarButtonConfig[];\n\t/** Additional controls appended to the toolbar. */\n\textraToolbarItems?: ReadonlyArray<RichTextEditorToolbarItem>;\n\t/** Hides the control that switches to HTML source. */\n\thideSourceToggle?: boolean;\n\t/** Whether the editor is currently showing HTML source. */\n\tsourceMode: boolean;\n\t/** Switches between rich text and HTML source. */\n\ttoggleSourceMode: () => void;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/**\n\t * The TipTap variant disables built-in buttons until the editor instance\n\t * is ready; the fallback variant simply marks them disabled. This flag\n\t * lets callers force the disabled state without re-deriving it per button.\n\t */\n\thasEditor?: boolean;\n\t/** Content pinned to the end of the toolbar. */\n\ttoolbarTrailing?: ReactNode;\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 RichTextEditorToolbar({\n\tbuttons,\n\textraToolbarItems,\n\thideSourceToggle = false,\n\tsourceMode,\n\ttoggleSourceMode,\n\tdisabled = false,\n\thasEditor = true,\n\ttoolbarTrailing,\n\tstrings,\n\tclassName,\n}: RichTextEditorToolbarProps) {\n\tconst hasExtras = (extraToolbarItems?.length ?? 0) > 0;\n\n\treturn (\n\t\t<div className={cn('rich-text-editor-toolbar--component border-border flex flex-wrap items-center gap-space-xs border-b p-surface-xs', className)}>\n\t\t\t{buttons.map((button) => {\n\t\t\t\tconst Icon = button.icon;\n\t\t\t\tconst isActive = button.isActive();\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={button.id}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone={isActive ? 'primary' : 'secondary'}\n\t\t\t\t\t\tbuttonStyle={isActive ? 'solid' : 'ghost'}\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\tonClick={button.run}\n\t\t\t\t\t\tdisabled={disabled || !hasEditor || sourceMode || button.disabled}\n\t\t\t\t\t\taria-label={button.label}\n\t\t\t\t\t\ttitle={button.label}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon className=\"size-icon\" />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t})}\n\n\t\t\t{!hideSourceToggle && (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"bg-border mx-space-xs size-icon w-px\" />\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone={sourceMode ? 'primary' : 'secondary'}\n\t\t\t\t\t\tbuttonStyle={sourceMode ? 'solid' : 'ghost'}\n\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\tonClick={toggleSourceMode}\n\t\t\t\t\t\tdisabled={disabled || !hasEditor}\n\t\t\t\t\t\taria-label={strings.toolbar.sourceCode}\n\t\t\t\t\t\ttitle={strings.toolbar.sourceCode}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Code2 className=\"size-icon\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{hasExtras && (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"bg-border mx-space-xs size-icon w-px\" />\n\t\t\t\t\t{extraToolbarItems?.map((item) => {\n\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\tconst isActive = item.isActive?.() ?? false;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone={isActive ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\t\tbuttonStyle={isActive ? 'solid' : 'ghost'}\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tonClick={item.onClick}\n\t\t\t\t\t\t\t\tdisabled={disabled || !hasEditor || sourceMode || item.disabled}\n\t\t\t\t\t\t\t\taria-label={item.label}\n\t\t\t\t\t\t\t\ttitle={item.label}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon className=\"size-icon\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{!!toolbarTrailing && (\n\t\t\t\t<div className=\"ml-auto flex items-center gap-space-xs\">{toolbarTrailing}</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nRichTextEditorToolbar.displayName = 'RichTextEditorToolbar';\n","import { resolveTextClassNames } from '../../typography/text.styles';\nimport { cn } from '../../../lib/utils';\n\n/** Shared field anatomy for rich editors, including specialized document schemas. */\nexport const richTextEditorRecipes = {\n source: cn('rich-text-editor--source box-border m-0 block min-h-0 w-full resize-y rounded-none border-0 bg-transparent px-control py-control-y-offset outline-none disabled:cursor-not-allowed disabled:opacity-50', resolveTextClassNames({type: 'main', size: 'xs', weight: 'regular', align: 'left', lineHeight: 'relaxed', numeric: true})),\n frame: 'min-w-0 overflow-hidden border-input bg-background rounded-inner border',\n disabled: 'opacity-70',\n content: 'h-full [&_.ProseMirror]:h-full [&_.ProseMirror]:min-h-full [&_.Prose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;KAC7B,aAAaA,IAAW,UAAU;KAClC,MAAK;KAAK,UAAA;KACV,SAASS,EAAK;KACd,UAAUR,KAAY,CAACC,KAAaC,KAAcM,EAAK;KACvD,cAAYA,EAAK;KACjB,OAAOA,EAAK;KAEZ,UAAA,kBAACX,GAAD,EAAM,WAAU,YAAa,CAAA;IACtB,GAXFW,EAAK,EAWH;GAEV,CAAC,CACA,EAAA,CAAA;GAGF,CAAC,CAACC,KACF,kBAAC,OAAD;IAAK,WAAU;IAA0C,UAAAA;GAAqB,CAAA;EAE3E;;AAEP;AAEA,EAAsB,cAAc;;;AC3HpC,IAAaC,IAAwB;CACpC,QAAQrB,EAAG,0MAA0MC,EAAsB;EAAC,MAAM;EAAQ,MAAM;EAAM,QAAQ;EAAW,OAAO;EAAQ,YAAY;EAAW,SAAS;CAAI,CAAC,CAAC;CAC9U,OAAO;CACP,UAAU;CACV,SAAS;AACV"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { p as e } from "./ui-provider-DRPn3qNl.js";
3
- import { t } from "./utils-BvH9PSmq.js";
4
- import { n } from "./text.styles-Q4sGAIgA.js";
2
+ import { p as e } from "./ui-provider-D2_TeLqw.js";
3
+ import { t } from "./utils-Cospvlj1.js";
4
+ import { n } from "./text.styles-g4He6UIW.js";
5
5
  import { t as r } from "./sanitize-html-BG9FGe-j.js";
6
6
  import { t as i } from "./content-typography-CnwgMJ37.js";
7
7
  import { forwardRef as a, useMemo as o } from "react";
@@ -29,4 +29,4 @@ c.displayName = "RichText";
29
29
  //#endregion
30
30
  export { c as t };
31
31
 
32
- //# sourceMappingURL=rich-text-DlxDOtf4.js.map
32
+ //# sourceMappingURL=rich-text-j-FGAeZW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-DlxDOtf4.js","names":["useTypographyConfig","sanitizeHtml","contentTypographyClassName","RichText","forwardRef","sizeProp","Tag","props","size","defaultTextSize","sanitizedHtml","useMemo","html","cn","resolveTextClassNames"],"sources":["../src/components/typography/rich-text/rich-text.tsx"],"sourcesContent":["import { forwardRef, useMemo } from 'react';\n\nimport { sanitizeHtml } from '../../../lib/sanitize-html';\nimport { useTypographyConfig } from '../../../lib/ui-provider';\nimport { cn } from '../../../lib/utils';\nimport { contentTypographyClassName } from '../content-typography';\n\nimport type { TextProps } from '../text';\nimport { resolveTextClassNames } from '../text.styles';\n\nexport interface RichTextProps\n\textends Omit<\n\t\tTextProps,\n\t\t'children' | 'content' | 'dangerouslySetInnerHTML'\n\t> {\n\t/** HTML sanitized through the package allowlist before rendering. */\n\thtml?: string | null;\n}\n\nexport const RichText = forwardRef<HTMLElement, RichTextProps>(\n\tfunction RichText(\n\t\t{\n\t\t\thtml,\n\t\t\ttype = 'main',\n\t\t\tsize: sizeProp,\n\t\t\talign = 'left',\n\t\t\tlineHeight = 'normal',\n\t\t\tweight = 'regular',\n\t\t\tclassName,\n\t\t\tnumeric = false,\n\t\t\ttag: Tag = 'p',\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst { defaultTextSize } = useTypographyConfig();\n\t\tconst size = sizeProp ?? defaultTextSize ?? 'sm';\n\t\tconst sanitizedHtml = useMemo(() => sanitizeHtml(html ?? ''), [html]);\n\n\t\tif (!sanitizedHtml) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\tref={ref as never}\n\t\t\t\tclassName={cn(contentTypographyClassName, resolveTextClassNames({\n\t\t\t\t\ttype,\n\t\t\t\t\tsize,\n\t\t\t\t\talign,\n\t\t\t\t\tlineHeight,\n\t\t\t\t\tweight,\n\t\t\t\t\tnumeric,\n\t\t\t\t\tclassName,\n\t\t\t\t}))}\n\t\t\t\tdata-typography=\"rich-text\"\n\t\t\t\tdangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nRichText.displayName = 'RichText';\n"],"mappings":";;;;;;;;;AAmBA,IAAaG,IAAWC,EACvB,SACC,EACC,SACA,UAAO,QACP,MAAMC,GACN,WAAQ,QACR,gBAAa,UACb,YAAS,WACT,cACA,aAAU,IACV,KAAKC,IAAM,KACX,GAAGC,KAEJ,GACC;CACD,IAAM,EAAE,uBAAoBP,EAAoB,GAC1CQ,IAAOH,KAAYI,KAAmB,MACtCC,IAAgBC,QAAcV,EAAaW,KAAQ,EAAE,GAAG,CAACA,CAAI,CAAC;CAMpE,OAJKF,IAKJ,kBAACJ,GAAD;EACM;EACL,WAAWO,EAAGX,GAA4BY,EAAsB;GAC/D;GACA;GACA;GACA;GACA;GACA;GACA;EACD,CAAC,CAAC;EACF,mBAAgB;EAChB,yBAAyB,EAAE,QAAQJ,EAAc;EACjD,GAAIH;CACJ,CAAA,IAlBM;AAoBT,CACD;AAEA,EAAS,cAAc"}
1
+ {"version":3,"file":"rich-text-j-FGAeZW.js","names":["useTypographyConfig","sanitizeHtml","contentTypographyClassName","RichText","forwardRef","sizeProp","Tag","props","size","defaultTextSize","sanitizedHtml","useMemo","html","cn","resolveTextClassNames"],"sources":["../src/components/typography/rich-text/rich-text.tsx"],"sourcesContent":["import { forwardRef, useMemo } from 'react';\n\nimport { sanitizeHtml } from '../../../lib/sanitize-html';\nimport { useTypographyConfig } from '../../../lib/ui-provider';\nimport { cn } from '../../../lib/utils';\nimport { contentTypographyClassName } from '../content-typography';\n\nimport type { TextProps } from '../text';\nimport { resolveTextClassNames } from '../text.styles';\n\nexport interface RichTextProps\n\textends Omit<\n\t\tTextProps,\n\t\t'children' | 'content' | 'dangerouslySetInnerHTML'\n\t> {\n\t/** HTML sanitized through the package allowlist before rendering. */\n\thtml?: string | null;\n}\n\nexport const RichText = forwardRef<HTMLElement, RichTextProps>(\n\tfunction RichText(\n\t\t{\n\t\t\thtml,\n\t\t\ttype = 'main',\n\t\t\tsize: sizeProp,\n\t\t\talign = 'left',\n\t\t\tlineHeight = 'normal',\n\t\t\tweight = 'regular',\n\t\t\tclassName,\n\t\t\tnumeric = false,\n\t\t\ttag: Tag = 'p',\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst { defaultTextSize } = useTypographyConfig();\n\t\tconst size = sizeProp ?? defaultTextSize ?? 'sm';\n\t\tconst sanitizedHtml = useMemo(() => sanitizeHtml(html ?? ''), [html]);\n\n\t\tif (!sanitizedHtml) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\tref={ref as never}\n\t\t\t\tclassName={cn(contentTypographyClassName, resolveTextClassNames({\n\t\t\t\t\ttype,\n\t\t\t\t\tsize,\n\t\t\t\t\talign,\n\t\t\t\t\tlineHeight,\n\t\t\t\t\tweight,\n\t\t\t\t\tnumeric,\n\t\t\t\t\tclassName,\n\t\t\t\t}))}\n\t\t\t\tdata-typography=\"rich-text\"\n\t\t\t\tdangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nRichText.displayName = 'RichText';\n"],"mappings":";;;;;;;;;AAmBA,IAAaG,IAAWC,EACvB,SACC,EACC,SACA,UAAO,QACP,MAAMC,GACN,WAAQ,QACR,gBAAa,UACb,YAAS,WACT,cACA,aAAU,IACV,KAAKC,IAAM,KACX,GAAGC,KAEJ,GACC;CACD,IAAM,EAAE,uBAAoBP,EAAoB,GAC1CQ,IAAOH,KAAYI,KAAmB,MACtCC,IAAgBC,QAAcV,EAAaW,KAAQ,EAAE,GAAG,CAACA,CAAI,CAAC;CAMpE,OAJKF,IAKJ,kBAACJ,GAAD;EACM;EACL,WAAWO,EAAGX,GAA4BY,EAAsB;GAC/D;GACA;GACA;GACA;GACA;GACA;GACA;EACD,CAAC,CAAC;EACF,mBAAgB;EAChB,yBAAyB,EAAE,QAAQJ,EAAc;EACjD,GAAIH;CACJ,CAAA,IAlBM;AAoBT,CACD;AAEA,EAAS,cAAc"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./utils-BvH9PSmq.js";
2
+ import { t as e } from "./utils-Cospvlj1.js";
3
3
  import "react";
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
5
  import { ScrollArea as r } from "@base-ui/react/scroll-area";
@@ -13,7 +13,7 @@ function i({ orientation: i = "vertical", className: o, viewportClassName: s, sc
13
13
  /* @__PURE__ */ t(r.Viewport, {
14
14
  ref: l,
15
15
  "data-slot": "scroll-area-viewport",
16
- className: e("size-full rounded-[inherit] outline-none transition-[color,box-shadow]", "focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring", s),
16
+ className: e("size-full rounded-[inherit] outline-none transition-[color,box-shadow]", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", s),
17
17
  children: u
18
18
  }),
19
19
  i !== "horizontal" && /* @__PURE__ */ t(a, { className: c }),
@@ -44,4 +44,4 @@ function a({ className: n, orientation: i = "vertical", ...a }) {
44
44
  //#endregion
45
45
  export { a as n, i as t };
46
46
 
47
- //# sourceMappingURL=scroll-area-D-pIhEKl.js.map
47
+ //# sourceMappingURL=scroll-area-DRdr16Pt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-area-DRdr16Pt.js","names":["ScrollArea","ScrollAreaPrimitive","cn","ScrollArea$1","props","ScrollArea","className","viewportRef","viewportClassName","orientation","ScrollBar","scrollbarClassName"],"sources":["../src/components/base/display/scroll-area.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area';\n\nimport { cn } from '../../../lib/utils';\n\nexport type ScrollAreaProps = ScrollAreaPrimitive.Root.Props & {\n\t/** Axes with custom scrollbar chrome. Defaults to vertical. */\n\torientation?: 'vertical' | 'horizontal' | 'both';\n\tviewportRef?: React.Ref<HTMLDivElement>;\n\tviewportClassName?: string;\n\tscrollbarClassName?: string;\n};\n\nfunction ScrollArea({\n\torientation = 'vertical',\n\tclassName,\n\tviewportClassName,\n\tscrollbarClassName,\n\tviewportRef,\n\tchildren,\n\t...props\n}: ScrollAreaProps) {\n\treturn (\n\t\t<ScrollAreaPrimitive.Root\n\t\t\tdata-slot=\"scroll-area\"\n\t\t\tclassName={cn('scroll-area--component group/scroll-area relative overflow-hidden', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<ScrollAreaPrimitive.Viewport\n\t\t\t\tref={viewportRef}\n\t\t\t\tdata-slot=\"scroll-area-viewport\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'size-full rounded-[inherit] outline-none transition-[color,box-shadow]',\n\t\t\t\t\t// The root clips overflow, so the shared ring is drawn inside the viewport edge.\n\t\t\t\t\t'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset',\n\t\t\t\t\tviewportClassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</ScrollAreaPrimitive.Viewport>\n\t\t\t{orientation !== 'horizontal' && <ScrollBar className={scrollbarClassName} />}\n\t\t\t{orientation !== 'vertical' && <ScrollBar orientation=\"horizontal\" className={scrollbarClassName} />}\n\t\t\t<ScrollAreaPrimitive.Corner />\n\t\t</ScrollAreaPrimitive.Root>\n\t);\n}\n\nfunction ScrollBar({\n\tclassName,\n\torientation = 'vertical',\n\t...props\n}: ScrollAreaPrimitive.Scrollbar.Props) {\n\treturn (\n\t\t<ScrollAreaPrimitive.Scrollbar\n\t\t\tdata-slot=\"scroll-area-scrollbar\"\n\t\t\tdata-orientation={orientation}\n\t\t\torientation={orientation}\n\t\t\tclassName={cn(\n\t\t\t\t{\n\t\t\t\t\t'h-2.5 flex-col border-t border-t-transparent': orientation === 'horizontal',\n\t\t\t\t\t'h-full w-2 border-l border-l-transparent': orientation === 'vertical',\n\t\t\t\t},\n\t\t\t\t// `rounded-full`, not a scale value: the track is 8-10px on its short\n\t\t\t\t// axis, so any radius past half of that already clamps to a pill.\n\t\t\t\t// Saying `rounded-full` states the intent and stops the value drifting\n\t\t\t\t// with the radius scale.\n\t\t\t\t'flex touch-none select-none rounded-full p-px opacity-0 transition-opacity',\n\t\t\t\t'data-hovering:opacity-100 data-scrolling:opacity-100 group-focus-within/scroll-area:opacity-100',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<ScrollAreaPrimitive.Thumb\n\t\t\t\tdata-slot=\"scroll-area-thumb\"\n\t\t\t\tclassName=\"relative flex-1 rounded-full bg-border\"\n\t\t\t/>\n\t\t</ScrollAreaPrimitive.Scrollbar>\n\t);\n}\n\nexport { ScrollArea, ScrollBar };\n"],"mappings":";;;;;;AAaA,SAASA,EAAW,EACnB,iBAAc,YACd,cACA,sBACA,uBACA,gBACA,aACA,GAAGI,KACgB;CACnB,OACC,kBAACH,EAAoB,MAArB;EACC,aAAU;EACV,WAAWC,EAAG,qEAAqEI,CAAS;EAC5F,GAAIF;EAHL,UAAA;GAKC,kBAACH,EAAoB,UAArB;IACC,KAAKM;IACL,aAAU;IACV,WAAWL,EACV,0EAEA,yEACAM,CACD;IAEC;GAC4B,CAAA;GAC7BC,MAAgB,gBAAgB,kBAACC,GAAD,EAAW,WAAWC,EAAqB,CAAA;GAC3EF,MAAgB,cAAc,kBAACC,GAAD;IAAW,aAAY;IAAa,WAAWC;GAAqB,CAAA;GACnG,kBAACV,EAAoB,QAArB,CAA6B,CAAA;EACJ;;AAE5B;AAEA,SAASS,EAAU,EAClB,cACA,iBAAc,YACd,GAAGN,KACoC;CACvC,OACC,kBAACH,EAAoB,WAArB;EACC,aAAU;EACV,oBAAkBQ;EACL;EACb,WAAWP,EACV;GACC,gDAAgDO,MAAgB;GAChE,4CAA4CA,MAAgB;EAC7D,GAKA,8EACA,mGACAH,CACD;EACA,GAAIF;EAEJ,UAAA,kBAACH,EAAoB,OAArB;GACC,aAAU;GACV,WAAU;EACV,CAAA;CAC6B,CAAA;AAEjC"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./utils-BvH9PSmq.js";
2
+ import { t as e } from "./utils-Cospvlj1.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  import { Separator as n } from "@base-ui/react/separator";
5
5
  //#region src/components/ui/separator.tsx
@@ -14,4 +14,4 @@ function r({ className: r, orientation: i = "horizontal", ...a }) {
14
14
  //#endregion
15
15
  export { r as t };
16
16
 
17
- //# sourceMappingURL=separator-BhtFyo4x.js.map
17
+ //# sourceMappingURL=separator-BMEvwnSX.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"separator-BhtFyo4x.js","names":["Separator","SeparatorPrimitive","cn","Separator$1","props","Separator","className"],"sources":["../src/components/ui/separator.tsx"],"sourcesContent":["\"use client\"\n\nimport { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n ...props\n}: SeparatorPrimitive.Props) {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n"],"mappings":";;;;;AAMA,SAASA,EAAU,EACjB,cACA,iBAAc,cACd,GAAGI,KACwB;CAC3B,OACE,kBAACH,GAAD;EACE,aAAU;EACG;EACb,WAAWC,EACT,wKACAI,CACF;EACA,GAAIF;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"separator-BMEvwnSX.js","names":["Separator","SeparatorPrimitive","cn","Separator$1","props","Separator","className"],"sources":["../src/components/ui/separator.tsx"],"sourcesContent":["\"use client\"\n\nimport { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n ...props\n}: SeparatorPrimitive.Props) {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n"],"mappings":";;;;;AAMA,SAASA,EAAU,EACjB,cACA,iBAAc,cACd,GAAGI,KACwB;CAC3B,OACE,kBAACH,GAAD;EACE,aAAU;EACG;EACb,WAAWC,EACT,wKACAI,CACF;EACA,GAAIF;CACL,CAAA;AAEL"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { t as e } from "./utils-BvH9PSmq.js";
3
- import { t } from "./separator-BhtFyo4x.js";
2
+ import { t as e } from "./utils-Cospvlj1.js";
3
+ import { t } from "./separator-BMEvwnSX.js";
4
4
  import "react";
5
5
  import { jsx as n } from "react/jsx-runtime";
6
6
  //#region src/components/base/display/separator.tsx
7
7
  function r({ className: r, dashed: i = !1, ...a }) {
8
8
  return /* @__PURE__ */ n(t, {
9
9
  className: e("separator--component", i && [
10
- "bg-transparent border-border border-dashed",
10
+ "bg-transparent border-0 border-border border-dashed",
11
11
  "data-[orientation=horizontal]:h-0 data-[orientation=horizontal]:border-t",
12
12
  "data-[orientation=vertical]:w-0 data-[orientation=vertical]:border-l"
13
13
  ], r),
@@ -18,4 +18,4 @@ r.displayName = "Separator";
18
18
  //#endregion
19
19
  export { r as t };
20
20
 
21
- //# sourceMappingURL=separator-BNIgG3au.js.map
21
+ //# sourceMappingURL=separator-Do5GWDYi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator-Do5GWDYi.js","names":["PrimitiveSeparator","cn","Separator","props","Separator$1","dashed","className"],"sources":["../src/components/base/display/separator.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Separator as PrimitiveSeparator } from '../../ui/separator';\nimport { cn } from '../../../lib/utils';\n\nexport interface SeparatorProps extends React.ComponentPropsWithoutRef<typeof PrimitiveSeparator> {\n\t/** Render the rule as a dashed line instead of a solid border fill. */\n\tdashed?: boolean;\n}\n\nexport function Separator({\n\tclassName,\n\tdashed = false,\n\t...props\n}: SeparatorProps) {\n\treturn (\n\t\t<PrimitiveSeparator\n\t\t\tclassName={cn(\n\t\t\t\t'separator--component',\n\t\t\t\tdashed && [\n\t\t\t\t\t// `border-0` zeroes every side first: without preflight, a dashed\n\t\t\t\t\t// style would otherwise give the unset sides a 3px medium border.\n\t\t\t\t\t'bg-transparent border-0 border-border border-dashed',\n\t\t\t\t\t'data-[orientation=horizontal]:h-0 data-[orientation=horizontal]:border-t',\n\t\t\t\t\t'data-[orientation=vertical]:w-0 data-[orientation=vertical]:border-l',\n\t\t\t\t],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nSeparator.displayName = 'Separator';\n"],"mappings":";;;;;;AAUA,SAAgBE,EAAU,EACzB,cACA,YAAS,IACT,GAAGC,KACe;CAClB,OACC,kBAACH,GAAD;EACC,WAAWC,EACV,wBACAI,KAAU;GAGT;GACA;GACA;EACD,GACAC,CACD;EACA,GAAIH;CACJ,CAAA;AAEH;AAEA,EAAU,cAAc"}
@@ -43,9 +43,12 @@ export declare function toPageAction<TPayload = unknown, TValues = unknown, TRes
43
43
  placement: import("./actions.types").ActionPlacement;
44
44
  };
45
45
  export declare function toMenuAction<TPayload = unknown, TValues = unknown, TResult = unknown>(action: ResolvedAction<TPayload, TValues, TResult>): {
46
+ id: string;
46
47
  label: string;
47
48
  onClick: () => void;
48
49
  disabled: boolean;
50
+ visible: boolean;
51
+ group: string | undefined;
49
52
  icon: import("react").ComponentType<{
50
53
  className?: string;
51
54
  }> | undefined;
@@ -57,6 +60,7 @@ export declare function toTableAction<TData = unknown>(action: ResolvedAction<TD
57
60
  label: string;
58
61
  onClick: (row: TData) => void;
59
62
  disabled: boolean;
63
+ visible: boolean;
60
64
  isDisabled: () => boolean;
61
65
  isVisible: () => boolean;
62
66
  icon: import("react").ReactElement<{
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "../lib/strings.js";
3
- import { n as t, r as n, t as r } from "../overlays-DUbs1KEi.js";
3
+ import { n as t, r as n, t as r } from "../overlays-DhZO7N-I.js";
4
4
  import { createContext as i, createElement as a, useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u, useSyncExternalStore as d } from "react";
5
5
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
6
6
  //#region src/services/actions/actions.types.ts
@@ -774,21 +774,26 @@ function pe(e) {
774
774
  }
775
775
  function me(e) {
776
776
  return {
777
+ id: e.id,
777
778
  label: $(e),
778
779
  onClick: () => e.open(),
779
780
  disabled: e.disabled || e.isRunning,
781
+ visible: e.visible,
782
+ group: e.group,
780
783
  icon: e.icon,
781
784
  tone: Z(e) ?? "secondary",
782
785
  buttonStyle: Q(e)
783
786
  };
784
787
  }
785
788
  function he(e) {
789
+ let t = e.disabled || e.isRunning;
786
790
  return {
787
791
  id: e.id,
788
792
  label: $(e),
789
793
  onClick: (t) => e.open(t),
790
- disabled: e.disabled,
791
- isDisabled: () => e.disabled || e.isRunning,
794
+ disabled: t,
795
+ visible: e.visible,
796
+ isDisabled: () => t,
792
797
  isVisible: () => e.visible,
793
798
  icon: e.icon ? a(e.icon, { className: "size-4" }) : void 0,
794
799
  tone: Z(e) ?? "secondary",