themelia-react-ui 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (488) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/README.md +59 -13
  3. package/dist/{accordion-B-5Focs8.js → accordion-BRTcsp8J.js} +8 -8
  4. package/dist/accordion-BRTcsp8J.js.map +1 -0
  5. package/dist/{action-menu-Cx3SdfbN.js → action-menu-Drxw_vJk.js} +36 -36
  6. package/dist/action-menu-Drxw_vJk.js.map +1 -0
  7. package/dist/affordance-geometry.generated-CL84ZN9A.js +63 -0
  8. package/dist/affordance-geometry.generated-CL84ZN9A.js.map +1 -0
  9. package/dist/{ai-artifact-B5tPpXnS.js → ai-artifact-DLVdK0Py.js} +151 -155
  10. package/dist/ai-artifact-DLVdK0Py.js.map +1 -0
  11. package/dist/{app-shell-at8Kt4l_.js → app-shell-C_fKpljx.js} +11 -10
  12. package/dist/app-shell-C_fKpljx.js.map +1 -0
  13. package/dist/{attachment-BO2R47wn.js → attachment-DbjUWsP0.js} +12 -12
  14. package/dist/{attachment-BO2R47wn.js.map → attachment-DbjUWsP0.js.map} +1 -1
  15. package/dist/auth-CAQcasMV.js +723 -0
  16. package/dist/auth-CAQcasMV.js.map +1 -0
  17. package/dist/{avatar-Bpzty83c.js → avatar-Bu2HhitA.js} +6 -6
  18. package/dist/{avatar-Bpzty83c.js.map → avatar-Bu2HhitA.js.map} +1 -1
  19. package/dist/{badge-BZXZT9wd.js → badge-CzId1Wlm.js} +4 -4
  20. package/dist/{badge-BZXZT9wd.js.map → badge-CzId1Wlm.js.map} +1 -1
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/buttons.js +3 -2
  27. package/dist/base/cards.js +3 -3
  28. package/dist/base/carousel.js +25 -27
  29. package/dist/base/carousel.js.map +1 -1
  30. package/dist/base/cascader.js +150 -148
  31. package/dist/base/cascader.js.map +1 -1
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +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 +3 -3
  39. package/dist/base/display.js +7 -7
  40. package/dist/base/feedback.js +4 -4
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +40 -43
  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 +1 -1
  51. package/dist/base/repeaters.js +33 -33
  52. package/dist/base/repeaters.js.map +1 -1
  53. package/dist/base/sheet.js +1 -1
  54. package/dist/base/sidebar.js +1 -1
  55. package/dist/base/signature-pad.js +83 -81
  56. package/dist/base/signature-pad.js.map +1 -1
  57. package/dist/base/skeleton.js +1 -1
  58. package/dist/base/spinner.js +1 -1
  59. package/dist/base/structure.js +1 -1
  60. package/dist/base/table.js +1 -1
  61. package/dist/base/text-inputs.js +2 -2
  62. package/dist/base/toaster.js +6 -6
  63. package/dist/base/toaster.js.map +1 -1
  64. package/dist/base/tree.js +1 -1
  65. package/dist/base/upload-queue.js +1 -1
  66. package/dist/base/upload.js +3 -3
  67. package/dist/base/value-inputs.js +1 -1
  68. package/dist/blocks/admin.js +134 -134
  69. package/dist/blocks/admin.js.map +1 -1
  70. package/dist/blocks/ai.js +120 -117
  71. package/dist/blocks/ai.js.map +1 -1
  72. package/dist/blocks/analytics/usage-card.js +1 -1
  73. package/dist/blocks/analytics.js +510 -472
  74. package/dist/blocks/analytics.js.map +1 -1
  75. package/dist/blocks/collaboration.js +2 -2
  76. package/dist/blocks/commerce/receipt.js +1 -1
  77. package/dist/blocks/commerce.js +395 -383
  78. package/dist/blocks/commerce.js.map +1 -1
  79. package/dist/blocks/data-display.js +1 -1
  80. package/dist/blocks/onboarding.js +6 -6
  81. package/dist/blocks/onboarding.js.map +1 -1
  82. package/dist/blocks/planning.js +36 -36
  83. package/dist/blocks/planning.js.map +1 -1
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BuYz5SDU.js} +9 -8
  86. package/dist/breadcrumbs-BuYz5SDU.js.map +1 -0
  87. package/dist/button-BZDasD04.js +651 -0
  88. package/dist/button-BZDasD04.js.map +1 -0
  89. package/dist/{button-BS6l5JUw.js → button-BZyfTvwm.js} +3 -3
  90. package/dist/button-BZyfTvwm.js.map +1 -0
  91. package/dist/buttons-D_6KJvEE.js +99 -0
  92. package/dist/buttons-D_6KJvEE.js.map +1 -0
  93. package/dist/{cards-Cum56XOF.js → cards-qGSErLw_.js} +12 -12
  94. package/dist/{cards-Cum56XOF.js.map → cards-qGSErLw_.js.map} +1 -1
  95. package/dist/chart-Bsc5BICK.js +150 -0
  96. package/dist/chart-Bsc5BICK.js.map +1 -0
  97. package/dist/{checkbox-BavDRjF7.js → checkbox-BQNDjUCh.js} +3 -3
  98. package/dist/checkbox-BQNDjUCh.js.map +1 -0
  99. package/dist/choice-inputs-Mk3iWbhr.js +725 -0
  100. package/dist/choice-inputs-Mk3iWbhr.js.map +1 -0
  101. package/dist/{code-block-xHKbAJDj.js → code-block-DzHKRybS.js} +23 -23
  102. package/dist/code-block-DzHKRybS.js.map +1 -0
  103. package/dist/{collapsible-DsnktFNv.js → collapsible-ClvC7Bj3.js} +3 -3
  104. package/dist/{collapsible-DsnktFNv.js.map → collapsible-ClvC7Bj3.js.map} +1 -1
  105. package/dist/{collection-content-C4fthJV_.js → collection-content-D6S8cv_n.js} +3 -3
  106. package/dist/{collection-content-C4fthJV_.js.map → collection-content-D6S8cv_n.js.map} +1 -1
  107. package/dist/{combobox-DEbdr-3u.js → combobox-BFnbJJp3.js} +18 -18
  108. package/dist/combobox-BFnbJJp3.js.map +1 -0
  109. package/dist/{combobox-xv3yJbzl.js → combobox-hozNwUcc.js} +313 -316
  110. package/dist/combobox-hozNwUcc.js.map +1 -0
  111. package/dist/{command-C0xe7u9B.js → command-BnmSchli.js} +9 -9
  112. package/dist/command-BnmSchli.js.map +1 -0
  113. package/dist/comments-u5L0OGip.js +1156 -0
  114. package/dist/comments-u5L0OGip.js.map +1 -0
  115. package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
  116. package/dist/components/base/buttons/button.recipes.d.ts +10 -19
  117. package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
  118. package/dist/components/base/cards/card.recipes.d.ts +13 -5
  119. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
  120. package/dist/components/base/cards/smart-card.types.d.ts +1 -1
  121. package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
  122. package/dist/components/base/date-pickers/datepicker.types.d.ts +3 -0
  123. package/dist/components/base/forms/form-field.d.ts +1 -0
  124. package/dist/components/base/forms/form-sizing.d.ts +3 -3
  125. package/dist/components/base/navigation/tabs.d.ts +3 -5
  126. package/dist/components/base/popover/popover.recipes.d.ts +3 -3
  127. package/dist/components/base/table/index.d.ts +1 -1
  128. package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
  129. package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
  130. package/dist/components/blocks/analytics/types.d.ts +1 -1
  131. package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
  132. package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
  133. package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
  134. package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
  135. package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
  136. package/dist/components/features/combobox/components/error-message.d.ts +1 -1
  137. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
  138. package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
  139. package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
  140. package/dist/components/features/media-library/media-library.d.ts +1 -1
  141. package/dist/components/features/media-library/media-library.types.d.ts +9 -1
  142. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  143. package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
  144. package/dist/components/features/overlays/overlays.types.d.ts +5 -4
  145. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
  146. package/dist/components/features/table/data-table.d.ts +1 -1
  147. package/dist/components/features/table/table.types.d.ts +1 -1
  148. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
  149. package/dist/components/layout/auth/auth.types.d.ts +1 -0
  150. package/dist/components/layout/page/page.d.ts +0 -1
  151. package/dist/components/layout/page/page.types.d.ts +9 -3
  152. package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
  153. package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
  154. package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
  155. package/dist/components/typography/heading.d.ts +5 -2
  156. package/dist/components/typography/index.d.ts +1 -1
  157. package/dist/components/typography/text.styles.d.ts +10 -0
  158. package/dist/components/ui/popover.d.ts +1 -1
  159. package/dist/components/ui/sidebar.d.ts +1 -1
  160. package/dist/components/ui/table.d.ts +2 -1
  161. package/dist/container.recipes-D9t8MHR3.js +27 -0
  162. package/dist/container.recipes-D9t8MHR3.js.map +1 -0
  163. package/dist/{containers-6s-ucRQQ.js → containers-DqB-bSYE.js} +33 -56
  164. package/dist/containers-DqB-bSYE.js.map +1 -0
  165. package/dist/control-group-recipes-DBXmfh2E.js +21 -0
  166. package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
  167. package/dist/{copyable-B7SBXJMr.js → copyable-BTSByfmq.js} +6 -6
  168. package/dist/{copyable-B7SBXJMr.js.map → copyable-BTSByfmq.js.map} +1 -1
  169. package/dist/{data-display-cWIRdeaf.js → data-display-Bihs9Ven.js} +545 -332
  170. package/dist/data-display-Bihs9Ven.js.map +1 -0
  171. package/dist/{date-BFNMnrS5.js → date-DOKhJPu7.js} +4 -4
  172. package/dist/{date-BFNMnrS5.js.map → date-DOKhJPu7.js.map} +1 -1
  173. package/dist/{date-picker-CA6ogMQB.js → date-picker-DzP5HQq7.js} +492 -472
  174. package/dist/date-picker-DzP5HQq7.js.map +1 -0
  175. package/dist/date-pickers-BpgGz7S-.js +196 -0
  176. package/dist/date-pickers-BpgGz7S-.js.map +1 -0
  177. package/dist/{display-CFM5myut.js → display-CS6Hbk18.js} +8 -8
  178. package/dist/{display-CFM5myut.js.map → display-CS6Hbk18.js.map} +1 -1
  179. package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-D-boNgGO.js} +7 -7
  180. package/dist/{dropdown-menu-BlnyHr-9.js.map → dropdown-menu-D-boNgGO.js.map} +1 -1
  181. package/dist/features/activities.js +152 -141
  182. package/dist/features/activities.js.map +1 -1
  183. package/dist/features/ai-chat.js +182 -179
  184. package/dist/features/ai-chat.js.map +1 -1
  185. package/dist/features/async-preview.js +9 -9
  186. package/dist/features/async-preview.js.map +1 -1
  187. package/dist/features/combobox.js +1 -1
  188. package/dist/features/comments.js +1 -1
  189. package/dist/features/data-view.js +25 -23
  190. package/dist/features/data-view.js.map +1 -1
  191. package/dist/features/email-composer/engine.js +1 -1
  192. package/dist/features/email-composer.js +103 -104
  193. package/dist/features/email-composer.js.map +1 -1
  194. package/dist/features/event-calendar.js +375 -373
  195. package/dist/features/event-calendar.js.map +1 -1
  196. package/dist/features/filters.js +1 -1
  197. package/dist/features/global-search.js +222 -224
  198. package/dist/features/global-search.js.map +1 -1
  199. package/dist/features/kanban.js +29 -29
  200. package/dist/features/kanban.js.map +1 -1
  201. package/dist/features/map.js +59 -58
  202. package/dist/features/map.js.map +1 -1
  203. package/dist/features/media-library.js +856 -855
  204. package/dist/features/media-library.js.map +1 -1
  205. package/dist/features/mentions.js +1 -1
  206. package/dist/features/overlays.js +1 -1
  207. package/dist/features/products.js +1209 -1209
  208. package/dist/features/products.js.map +1 -1
  209. package/dist/features/questionnaire.js +52 -52
  210. package/dist/features/questionnaire.js.map +1 -1
  211. package/dist/features/resource-assignment.js +29 -31
  212. package/dist/features/resource-assignment.js.map +1 -1
  213. package/dist/features/resource.js +13 -13
  214. package/dist/features/resource.js.map +1 -1
  215. package/dist/features/rich-text-editor.js +2 -2
  216. package/dist/features/schema-form.js +82 -82
  217. package/dist/features/schema-form.js.map +1 -1
  218. package/dist/features/suggestions.js +3 -3
  219. package/dist/features/sync.js +4 -4
  220. package/dist/features/sync.js.map +1 -1
  221. package/dist/features/table.js +1 -1
  222. package/dist/features/theme-tweaker.js +456 -450
  223. package/dist/features/theme-tweaker.js.map +1 -1
  224. package/dist/{feedback-DWUkgEjR.js → feedback-CJkUAapr.js} +29 -29
  225. package/dist/feedback-CJkUAapr.js.map +1 -0
  226. package/dist/field-affordance-recipes-uKY4MsZ_.js +25 -0
  227. package/dist/field-affordance-recipes-uKY4MsZ_.js.map +1 -0
  228. package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-DQQpiLWC.js} +3 -3
  229. package/dist/field-state-recipes-DQQpiLWC.js.map +1 -0
  230. package/dist/{filters-BhsUtsxW.js → filters-D6FF8L6s.js} +715 -720
  231. package/dist/filters-D6FF8L6s.js.map +1 -0
  232. package/dist/{form-field-Bn7ZH1rA.js → form-field-CZwrkP7m.js} +17 -9
  233. package/dist/form-field-CZwrkP7m.js.map +1 -0
  234. package/dist/{form-sizing-BWs70_a2.js → form-sizing-QP8aIRaW.js} +8 -5
  235. package/dist/form-sizing-QP8aIRaW.js.map +1 -0
  236. package/dist/{forms-B7pzS25o.js → forms-B5NCbkSC.js} +35 -35
  237. package/dist/{forms-B7pzS25o.js.map → forms-B5NCbkSC.js.map} +1 -1
  238. package/dist/forms-numeric-Crrm80Lm.js +867 -0
  239. package/dist/forms-numeric-Crrm80Lm.js.map +1 -0
  240. package/dist/{header-C59QZyxV.js → header-kxruN3RM.js} +53 -49
  241. package/dist/header-kxruN3RM.js.map +1 -0
  242. package/dist/{hooks-CM1Vp9Pe.js → hooks-BrlnCwQd.js} +2 -2
  243. package/dist/{hooks-CM1Vp9Pe.js.map → hooks-BrlnCwQd.js.map} +1 -1
  244. package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
  245. package/dist/http-CdEIHyQf.js.map +1 -0
  246. package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-Btc6pQrp.js} +4 -4
  247. package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-Btc6pQrp.js.map} +1 -1
  248. package/dist/index.js +2 -2
  249. package/dist/input-SX9V0AL3.js +255 -0
  250. package/dist/input-SX9V0AL3.js.map +1 -0
  251. package/dist/input-vxcaNCYC.js +20 -0
  252. package/dist/input-vxcaNCYC.js.map +1 -0
  253. package/dist/{item-pJ0GsOiJ.js → item-DE4YnuJx.js} +18 -17
  254. package/dist/item-DE4YnuJx.js.map +1 -0
  255. package/dist/layout/app-shell.js +1 -1
  256. package/dist/layout/auth.js +1 -1
  257. package/dist/layout/containers.js +1 -1
  258. package/dist/layout/header.js +1 -1
  259. package/dist/layout/hooks.js +1 -1
  260. package/dist/layout/navigation.js +1 -1
  261. package/dist/layout/page.js +1 -1
  262. package/dist/layout/settings.js +1 -1
  263. package/dist/layout/sidebar.js +2 -2
  264. package/dist/layout/workspace.js +1 -1
  265. package/dist/layout.js +10 -10
  266. package/dist/lib/affordance-geometry.generated.d.ts +40 -9
  267. package/dist/lib/control-group-recipes.d.ts +22 -0
  268. package/dist/lib/field-affordance-recipes.d.ts +35 -2
  269. package/dist/lib/field-state-recipes.d.ts +2 -2
  270. package/dist/lib/navigation-row-recipes.d.ts +3 -2
  271. package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
  272. package/dist/lib/surface-recipes.d.ts +5 -2
  273. package/dist/lib/token-merge.generated.d.ts +144 -2
  274. package/dist/lib/ui-provider/types.d.ts +4 -2
  275. package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
  276. package/dist/lib/utils.js +1 -1
  277. package/dist/{media-gallery-DhDRgnVZ.js → media-gallery-DLp3HAz0.js} +75 -74
  278. package/dist/media-gallery-DLp3HAz0.js.map +1 -0
  279. package/dist/{mentions-B8Ko-fhS.js → mentions-Cl0Kt_Pd.js} +52 -50
  280. package/dist/{mentions-B8Ko-fhS.js.map → mentions-Cl0Kt_Pd.js.map} +1 -1
  281. package/dist/message-SZUNB1eX.js +127 -0
  282. package/dist/message-SZUNB1eX.js.map +1 -0
  283. package/dist/{navigation-DBEu4POU.js → navigation-DnQSNMT0.js} +64 -55
  284. package/dist/navigation-DnQSNMT0.js.map +1 -0
  285. package/dist/{navigation-BUIn2Qxx.js → navigation-DyytsLRB.js} +37 -37
  286. package/dist/navigation-DyytsLRB.js.map +1 -0
  287. package/dist/{navigation-row-recipes-GVh11KiT.js → navigation-row-recipes-DQEXQcqY.js} +3 -3
  288. package/dist/navigation-row-recipes-DQEXQcqY.js.map +1 -0
  289. package/dist/{number-BNT_BIzJ.js → number-DasMFWEG.js} +4 -4
  290. package/dist/{number-BNT_BIzJ.js.map → number-DasMFWEG.js.map} +1 -1
  291. package/dist/overlays-DUbs1KEi.js +1011 -0
  292. package/dist/overlays-DUbs1KEi.js.map +1 -0
  293. package/dist/{page-BV6ioQg3.js → page-hGmT4nWK.js} +75 -64
  294. package/dist/page-hGmT4nWK.js.map +1 -0
  295. package/dist/{page-header-DQRa0jug.js → page-header-D8nERkn5.js} +9 -9
  296. package/dist/page-header-D8nERkn5.js.map +1 -0
  297. package/dist/{pagination-C29vvt3I.js → pagination-NLGqRirf.js} +20 -20
  298. package/dist/pagination-NLGqRirf.js.map +1 -0
  299. package/dist/{popover-CoLDEg19.js → popover-CghIYdQf.js} +23 -22
  300. package/dist/popover-CghIYdQf.js.map +1 -0
  301. package/dist/{popover-menu-GLIQTJTx.js → popover-menu-B4PoWhRl.js} +6 -6
  302. package/dist/{popover-menu-GLIQTJTx.js.map → popover-menu-B4PoWhRl.js.map} +1 -1
  303. package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-QlD4JenO.js} +5 -5
  304. package/dist/popover.recipes-QlD4JenO.js.map +1 -0
  305. package/dist/{primitives-DKPOGVpj.js → primitives-C7ff0QaI.js} +120 -113
  306. package/dist/primitives-C7ff0QaI.js.map +1 -0
  307. package/dist/primitives.js +3 -3
  308. package/dist/{progress-BOe8l_FZ.js → progress-BroqrAyV.js} +10 -9
  309. package/dist/progress-BroqrAyV.js.map +1 -0
  310. package/dist/{receipt-BM8xsGFy.js → receipt-BuJynLgf.js} +8 -8
  311. package/dist/{receipt-BM8xsGFy.js.map → receipt-BuJynLgf.js.map} +1 -1
  312. package/dist/{rich-text-B7sBAdDG.js → rich-text-DlxDOtf4.js} +4 -4
  313. package/dist/{rich-text-B7sBAdDG.js.map → rich-text-DlxDOtf4.js.map} +1 -1
  314. package/dist/rich-text-editor-BKyG7rWz.js +574 -0
  315. package/dist/rich-text-editor-BKyG7rWz.js.map +1 -0
  316. package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-B72Nfuze.js} +35 -26
  317. package/dist/rich-text-editor.recipes-B72Nfuze.js.map +1 -0
  318. package/dist/{scroll-area-BheMQ270.js → scroll-area-D-pIhEKl.js} +3 -3
  319. package/dist/scroll-area-D-pIhEKl.js.map +1 -0
  320. package/dist/{separator-Gk_WXH-l.js → separator-BNIgG3au.js} +3 -3
  321. package/dist/{separator-Gk_WXH-l.js.map → separator-BNIgG3au.js.map} +1 -1
  322. package/dist/{separator-DO0EbCEm.js → separator-BhtFyo4x.js} +2 -2
  323. package/dist/{separator-DO0EbCEm.js.map → separator-BhtFyo4x.js.map} +1 -1
  324. package/dist/services/actions.js +1 -1
  325. package/dist/{settings-BnCyyPOJ.js → settings-DOTOzeZ2.js} +10 -9
  326. package/dist/{settings-BnCyyPOJ.js.map → settings-DOTOzeZ2.js.map} +1 -1
  327. package/dist/{sheet-B-q914Ad.js → sheet-BFhrNehm.js} +11 -11
  328. package/dist/sheet-BFhrNehm.js.map +1 -0
  329. package/dist/{sidebar-DPR7fmqN.js → sidebar-CyR4XKwR.js} +219 -200
  330. package/dist/sidebar-CyR4XKwR.js.map +1 -0
  331. package/dist/{sidebar-C_2p3Tfj.js → sidebar-SvGJ0Zwi.js} +63 -58
  332. package/dist/sidebar-SvGJ0Zwi.js.map +1 -0
  333. package/dist/{skeleton-CmT1ppqb.js → skeleton-3F0uhYn3.js} +4 -4
  334. package/dist/{skeleton-CmT1ppqb.js.map → skeleton-3F0uhYn3.js.map} +1 -1
  335. package/dist/{smart-card-CYLn46e6.js → smart-card-DjGVV2xr.js} +171 -165
  336. package/dist/smart-card-DjGVV2xr.js.map +1 -0
  337. package/dist/{spinner-BY9HbUEh.js → spinner-Cpf7oRkF.js} +5 -5
  338. package/dist/{spinner-BY9HbUEh.js.map → spinner-Cpf7oRkF.js.map} +1 -1
  339. package/dist/{structure-MvKVq-oL.js → structure-CRdqVawd.js} +2 -2
  340. package/dist/{structure-MvKVq-oL.js.map → structure-CRdqVawd.js.map} +1 -1
  341. package/dist/style.css +1 -1
  342. package/dist/{surface-recipes-CQfRr-VL.js → surface-recipes-Dd__PD-w.js} +4 -3
  343. package/dist/surface-recipes-Dd__PD-w.js.map +1 -0
  344. package/dist/{table-DnlAJ-xR.js → table-CLtJTxoR.js} +17 -16
  345. package/dist/table-CLtJTxoR.js.map +1 -0
  346. package/dist/table-CcRDZiLP.js +1444 -0
  347. package/dist/table-CcRDZiLP.js.map +1 -0
  348. package/dist/tabs-BNgu7g0u.js +188 -0
  349. package/dist/tabs-BNgu7g0u.js.map +1 -0
  350. package/dist/text-inputs-DsR56TR-.js +330 -0
  351. package/dist/text-inputs-DsR56TR-.js.map +1 -0
  352. package/dist/{text.styles-BwB7vAF2.js → text.styles-Q4sGAIgA.js} +18 -10
  353. package/dist/text.styles-Q4sGAIgA.js.map +1 -0
  354. package/dist/theme.css +77 -115
  355. package/dist/{timelines-B9ICkQcV.js → timelines-D1pkt3se.js} +84 -78
  356. package/dist/timelines-D1pkt3se.js.map +1 -0
  357. package/dist/{tree-BdWSaoFT.js → tree-BtmYyMZV.js} +8 -8
  358. package/dist/{tree-BdWSaoFT.js.map → tree-BtmYyMZV.js.map} +1 -1
  359. package/dist/typography/rich-text.js +1 -1
  360. package/dist/typography-BxQgiZyw.js +96 -0
  361. package/dist/typography-BxQgiZyw.js.map +1 -0
  362. package/dist/typography.js +1 -1
  363. package/dist/{ui-provider-CftIB6TY.js → ui-provider-DRPn3qNl.js} +3 -2
  364. package/dist/ui-provider-DRPn3qNl.js.map +1 -0
  365. package/dist/ui-provider.js +1 -1
  366. package/dist/{upload-D8Za5x_c.js → upload-CDbYw1WN.js} +326 -323
  367. package/dist/upload-CDbYw1WN.js.map +1 -0
  368. package/dist/{upload-queue-hIIYBLS7.js → upload-queue-CNd_hH_a.js} +25 -25
  369. package/dist/upload-queue-CNd_hH_a.js.map +1 -0
  370. package/dist/{usage-card-DnmnJ58D.js → usage-card-VyJLUwRr.js} +53 -54
  371. package/dist/usage-card-VyJLUwRr.js.map +1 -0
  372. package/dist/utils-BvH9PSmq.js +4275 -0
  373. package/dist/utils-BvH9PSmq.js.map +1 -0
  374. package/dist/value-inputs-D0KCrfVC.js +840 -0
  375. package/dist/value-inputs-D0KCrfVC.js.map +1 -0
  376. package/dist/{workspace-C1PZmk8L.js → workspace-CcR8r-Nt.js} +115 -122
  377. package/dist/workspace-CcR8r-Nt.js.map +1 -0
  378. package/docs/consumer-skill/SKILL.md +110 -119
  379. package/docs/consumer-skill/examples/analytics.tsx +34 -0
  380. package/docs/consumer-skill/examples/app-layout.tsx +42 -12
  381. package/docs/consumer-skill/examples/detail.tsx +20 -4
  382. package/docs/consumer-skill/examples/manifest.json +13 -1
  383. package/docs/consumer-skill/examples/website.tsx +56 -0
  384. package/docs/consumer-skill/references/analytics.md +70 -0
  385. package/docs/consumer-skill/references/composition.md +116 -2
  386. package/docs/consumer-skill/references/design-contract.md +33 -7
  387. package/docs/consumer-skill/references/discovery.md +76 -5
  388. package/docs/consumer-skill/references/integration.md +14 -0
  389. package/docs/consumer-skill/references/public-api.json +2023 -218
  390. package/docs/consumer-skill/references/review.md +55 -3
  391. package/docs/consumer-skill/references/theming.md +52 -7
  392. package/docs/consumer-skill/references/tokens.json +177 -9
  393. package/docs/consumer-skill/references/workflows.md +32 -0
  394. package/docs/consumer-skill/scripts/check-composition.mjs +1 -1
  395. package/docs/consumer-skill/scripts/composition-policy.mjs +179 -17
  396. package/docs/consumer-skill/scripts/discovery.mjs +61 -9
  397. package/docs/consumer-skill/scripts/surface-policy.mjs +44 -0
  398. package/package.json +7 -4
  399. package/dist/accordion-B-5Focs8.js.map +0 -1
  400. package/dist/action-menu-Cx3SdfbN.js.map +0 -1
  401. package/dist/affordance-geometry.generated-D8Jcfb0G.js +0 -32
  402. package/dist/affordance-geometry.generated-D8Jcfb0G.js.map +0 -1
  403. package/dist/ai-artifact-B5tPpXnS.js.map +0 -1
  404. package/dist/app-shell-at8Kt4l_.js.map +0 -1
  405. package/dist/auth-OFwWSAap.js +0 -704
  406. package/dist/auth-OFwWSAap.js.map +0 -1
  407. package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
  408. package/dist/button-BS6l5JUw.js.map +0 -1
  409. package/dist/buttons-Co6GavvM.js +0 -674
  410. package/dist/buttons-Co6GavvM.js.map +0 -1
  411. package/dist/chart-DVfcwQu6.js +0 -149
  412. package/dist/chart-DVfcwQu6.js.map +0 -1
  413. package/dist/checkbox-BavDRjF7.js.map +0 -1
  414. package/dist/choice-inputs-CC7XqPQO.js +0 -619
  415. package/dist/choice-inputs-CC7XqPQO.js.map +0 -1
  416. package/dist/code-block-xHKbAJDj.js.map +0 -1
  417. package/dist/combobox-DEbdr-3u.js.map +0 -1
  418. package/dist/combobox-xv3yJbzl.js.map +0 -1
  419. package/dist/command-C0xe7u9B.js.map +0 -1
  420. package/dist/comments-DviPLnwy.js +0 -1132
  421. package/dist/comments-DviPLnwy.js.map +0 -1
  422. package/dist/containers-6s-ucRQQ.js.map +0 -1
  423. package/dist/data-display-cWIRdeaf.js.map +0 -1
  424. package/dist/date-picker-CA6ogMQB.js.map +0 -1
  425. package/dist/date-pickers-BPIKLdsD.js +0 -224
  426. package/dist/date-pickers-BPIKLdsD.js.map +0 -1
  427. package/dist/feedback-DWUkgEjR.js.map +0 -1
  428. package/dist/field-affordance-recipes-IjzPrCTw.js +0 -17
  429. package/dist/field-affordance-recipes-IjzPrCTw.js.map +0 -1
  430. package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
  431. package/dist/filters-BhsUtsxW.js.map +0 -1
  432. package/dist/form-field-Bn7ZH1rA.js.map +0 -1
  433. package/dist/form-sizing-BWs70_a2.js.map +0 -1
  434. package/dist/forms-numeric-BUBxELBv.js +0 -867
  435. package/dist/forms-numeric-BUBxELBv.js.map +0 -1
  436. package/dist/header-C59QZyxV.js.map +0 -1
  437. package/dist/http-CLTVJc5I.js.map +0 -1
  438. package/dist/input-WwYQZJzG.js +0 -202
  439. package/dist/input-WwYQZJzG.js.map +0 -1
  440. package/dist/input-ci9fIgFH.js +0 -20
  441. package/dist/input-ci9fIgFH.js.map +0 -1
  442. package/dist/item-pJ0GsOiJ.js.map +0 -1
  443. package/dist/media-gallery-DhDRgnVZ.js.map +0 -1
  444. package/dist/message-COsdEvXT.js +0 -108
  445. package/dist/message-COsdEvXT.js.map +0 -1
  446. package/dist/navigation-BUIn2Qxx.js.map +0 -1
  447. package/dist/navigation-DBEu4POU.js.map +0 -1
  448. package/dist/navigation-row-recipes-GVh11KiT.js.map +0 -1
  449. package/dist/overlays-B11wZka6.js +0 -982
  450. package/dist/overlays-B11wZka6.js.map +0 -1
  451. package/dist/page-BV6ioQg3.js.map +0 -1
  452. package/dist/page-header-DQRa0jug.js.map +0 -1
  453. package/dist/pagination-C29vvt3I.js.map +0 -1
  454. package/dist/popover-CoLDEg19.js.map +0 -1
  455. package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
  456. package/dist/primitives-DKPOGVpj.js.map +0 -1
  457. package/dist/progress-BOe8l_FZ.js.map +0 -1
  458. package/dist/rich-text-editor-CoVrTiSv.js +0 -575
  459. package/dist/rich-text-editor-CoVrTiSv.js.map +0 -1
  460. package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
  461. package/dist/scroll-area-BheMQ270.js.map +0 -1
  462. package/dist/select-B2mb-qN2.js +0 -108
  463. package/dist/select-B2mb-qN2.js.map +0 -1
  464. package/dist/sheet-B-q914Ad.js.map +0 -1
  465. package/dist/sidebar-C_2p3Tfj.js.map +0 -1
  466. package/dist/sidebar-DPR7fmqN.js.map +0 -1
  467. package/dist/smart-card-CYLn46e6.js.map +0 -1
  468. package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
  469. package/dist/table-BS39xnlq.js +0 -1424
  470. package/dist/table-BS39xnlq.js.map +0 -1
  471. package/dist/table-DnlAJ-xR.js.map +0 -1
  472. package/dist/tabs-B5cNMWiP.js +0 -187
  473. package/dist/tabs-B5cNMWiP.js.map +0 -1
  474. package/dist/text-inputs-Dh9XGyiS.js +0 -331
  475. package/dist/text-inputs-Dh9XGyiS.js.map +0 -1
  476. package/dist/text.styles-BwB7vAF2.js.map +0 -1
  477. package/dist/timelines-B9ICkQcV.js.map +0 -1
  478. package/dist/typography-Cv8MT-82.js +0 -96
  479. package/dist/typography-Cv8MT-82.js.map +0 -1
  480. package/dist/ui-provider-CftIB6TY.js.map +0 -1
  481. package/dist/upload-D8Za5x_c.js.map +0 -1
  482. package/dist/upload-queue-hIIYBLS7.js.map +0 -1
  483. package/dist/usage-card-DnmnJ58D.js.map +0 -1
  484. package/dist/utils-C2EKeIw3.js +0 -72
  485. package/dist/utils-C2EKeIw3.js.map +0 -1
  486. package/dist/value-inputs-DX2dbxjj.js +0 -824
  487. package/dist/value-inputs-DX2dbxjj.js.map +0 -1
  488. package/dist/workspace-C1PZmk8L.js.map +0 -1
@@ -1,1132 +0,0 @@
1
- "use client";
2
- import { a as e, o as t } from "./ui-provider-CftIB6TY.js";
3
- import { interpolateString as n, useStrings as r } from "./lib/strings.js";
4
- import { t as i } from "./utils-C2EKeIw3.js";
5
- import { c as a, l as o, n as s, o as c, s as l } from "./buttons-Co6GavvM.js";
6
- import { a as u, r as d, t as f } from "./typography-Cv8MT-82.js";
7
- import { t as p } from "./structure-MvKVq-oL.js";
8
- import { i as m, t as h } from "./overlays-B11wZka6.js";
9
- import { t as g } from "./sanitize-html-BG9FGe-j.js";
10
- import { t as _ } from "./content-typography-CnwgMJ37.js";
11
- import { t as v } from "./rich-text-B7sBAdDG.js";
12
- import { g as y, i as b } from "./primitives-DKPOGVpj.js";
13
- import { n as x, t as S } from "./number-BNT_BIzJ.js";
14
- import { i as C } from "./date-BFNMnrS5.js";
15
- import { i as w, n as T, s as E } from "./avatar-Bpzty83c.js";
16
- import { t as D } from "./badge-BZXZT9wd.js";
17
- import { c as O, o as ee } from "./popover-CoLDEg19.js";
18
- import { l as k } from "./data-display-cWIRdeaf.js";
19
- import { t as te } from "./rich-text-editor-CoVrTiSv.js";
20
- import { l as A, n as ne, o as j, r as re, t as M } from "./mentions-B8Ko-fhS.js";
21
- import { Fragment as N, createElement as ie, forwardRef as P, memo as F, useCallback as I, useEffect as L, useImperativeHandle as ae, useMemo as R, useRef as z, useState as B } from "react";
22
- import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
23
- import { AtSign as oe, CornerDownRight as se, File as ce, FileText as le, Image as ue, Loader2 as de, MessageCircle as W, Paperclip as fe, Pencil as G, Pin as K, Send as pe, Smile as me, Trash2 as he, X as q } from "lucide-react";
24
- //#region src/components/features/comments/comments.strings.ts
25
- var J = {
26
- title: "Comments",
27
- subtitle: "",
28
- empty: "No comments yet.",
29
- emptyHint: "Start the conversation — your team will see it instantly.",
30
- composerPlaceholder: "Write a comment…",
31
- composerSubmit: "Post comment",
32
- composerSubmitting: "Posting…",
33
- composerSave: "Save changes",
34
- invalidContent: "Comment cannot be empty.",
35
- composerCancel: "Cancel",
36
- composerEditingEyebrow: "Editing comment",
37
- composerReplyingEyebrow: "Replying to {{name}}",
38
- composerAttachmentLabel: "Attach file",
39
- composerReferenceLabel: "Mention or link",
40
- composerReferenceMenuTitle: "Insert reference",
41
- composerReferenceSearchPlaceholder: "Search…",
42
- composerReferenceEmpty: "No matches.",
43
- composerReferenceLoading: "Searching…",
44
- fallbackAuthor: "Anonymous",
45
- pinned: "Pinned",
46
- edited: "edited",
47
- deleteLabel: "Delete",
48
- editLabel: "Edit",
49
- replyLabel: "Reply",
50
- pinLabel: "Pin",
51
- unpinLabel: "Unpin",
52
- moreActionsLabel: "More actions",
53
- confirmDeleteLabel: "Delete comment",
54
- confirmDeleteTitle: "Delete this comment?",
55
- confirmRemoveAttachmentTitle: "Remove this attachment?",
56
- confirmRemoveAttachmentDescription: "The file is detached from the comment for everyone. This cannot be undone.",
57
- confirmDeleteDescription: "The comment and its replies are removed for everyone. This cannot be undone.",
58
- attachmentFallback: "Attachment",
59
- attachmentRemoveLabel: "Remove attachment",
60
- attachmentUploadingLabel: "Uploading…",
61
- attachmentFailedLabel: "Upload failed",
62
- attachmentTooLargeError: "File is too large.",
63
- attachmentTooManyError: "Too many attachments.",
64
- attachmentRetryLabel: "Retry",
65
- attachmentDownloadLabel: "Download",
66
- addReactionLabel: "Add reaction",
67
- reactionLabel: "Reaction {{emoji}}: {{count}}",
68
- showRepliesLabel: "Show replies",
69
- hideRepliesLabel: "Hide replies"
70
- };
71
- //#endregion
72
- //#region src/components/features/comments/comments-provider.tsx
73
- function Y(e) {
74
- return r(J, e);
75
- }
76
- function ge(e) {
77
- let n = t();
78
- return R(() => ({
79
- getMediaUrl: e?.getMediaUrl,
80
- getMediaName: e?.getMediaName,
81
- getStatusLabel: e?.getStatusLabel,
82
- formatRelativeTime: e?.formatRelativeTime ?? n.formatRelativeTime
83
- }), [e, n.formatRelativeTime]);
84
- }
85
- //#endregion
86
- //#region src/components/features/comments/hooks/use-comments.ts
87
- function X(e = {}) {
88
- let { onSubmit: t, onUpdate: n, onDelete: r, onAfterMutate: i, onError: a } = e, [o, s] = B({ kind: "idle" }), [c, l] = B(!1), u = z(!1), [d, f] = B({}), [p, m] = B(0), h = I((e) => {
89
- u.current = e, l(e);
90
- }, []), g = I(() => {
91
- m((e) => e + 1), s({ kind: "idle" }), f({}), h(!1);
92
- }, [h]), _ = R(() => ({
93
- setErrors: f,
94
- reset: g,
95
- setSubmitting: h
96
- }), [g, h]), v = I((e) => {
97
- try {
98
- a?.(e);
99
- } catch {}
100
- }, [a]);
101
- return {
102
- composerMode: o,
103
- isSubmitting: c,
104
- formErrors: d,
105
- resetKey: p,
106
- startReply: I((e) => {
107
- e.id && (f({}), s({
108
- kind: "replying",
109
- commentId: e.id,
110
- authorName: e.user?.name
111
- }));
112
- }, []),
113
- startEdit: I((e) => {
114
- e.id && (f({}), s({
115
- kind: "editing",
116
- comment: e
117
- }));
118
- }, []),
119
- cancelComposerMode: I(() => {
120
- g();
121
- }, [g]),
122
- submit: I(async (e) => {
123
- if (o.kind === "editing" && o.comment.id) {
124
- if (!n || u.current) return;
125
- let t = {
126
- ...e,
127
- editingId: o.comment.id
128
- };
129
- h(!0), f({});
130
- try {
131
- await n(o.comment.id, t, _), i?.("update", t);
132
- } catch (e) {
133
- v(e);
134
- } finally {
135
- h(!1);
136
- }
137
- return;
138
- }
139
- if (!t || u.current) return;
140
- let r = o.kind === "replying" ? {
141
- ...e,
142
- replyToId: o.commentId
143
- } : e;
144
- h(!0), f({});
145
- try {
146
- await t(r, _), i?.("create", r);
147
- } catch (e) {
148
- v(e);
149
- } finally {
150
- h(!1);
151
- }
152
- }, [
153
- o,
154
- _,
155
- i,
156
- t,
157
- n,
158
- v,
159
- h
160
- ]),
161
- deleteComment: I(async (e) => {
162
- if (r && e) try {
163
- await r(e), i?.("delete", { commentId: e });
164
- } catch (e) {
165
- v(e);
166
- }
167
- }, [
168
- i,
169
- r,
170
- v
171
- ]),
172
- resetComposer: g,
173
- helpers: _
174
- };
175
- }
176
- //#endregion
177
- //#region src/components/features/comments/partials/comment-attachment-chip.tsx
178
- function _e(e) {
179
- return e.mimeType?.startsWith("image/") ? ue : e.mimeType === "application/pdf" || e.mimeType?.startsWith("text/") ? le : e.mimeType ? ce : fe;
180
- }
181
- var ve = ({ attachment: e, editable: t = !1, onRemove: n, onRetry: a, accessors: o, strings: c, compact: l = !1, className: d }) => {
182
- let p = r(J, c), m = o?.getMediaUrl?.(e) ?? e.url, h = o?.getMediaName?.(e) ?? e.name ?? p.attachmentFallback, g = _e(e), _ = e.status === "uploading", v = e.status === "failed", S = _ ? /* @__PURE__ */ U(y, {
183
- size: "xs",
184
- className: "shrink-0",
185
- children: [p.attachmentUploadingLabel, typeof e.progress == "number" ? /* @__PURE__ */ U(V, { children: [" ", /* @__PURE__ */ H(x, {
186
- value: Math.round(e.progress),
187
- scaled: !0,
188
- size: "xs",
189
- align: "left",
190
- type: "secondary"
191
- })] }) : null]
192
- }) : v ? /* @__PURE__ */ H(y, {
193
- size: "xs",
194
- className: "shrink-0",
195
- children: e.error ?? p.attachmentFailedLabel
196
- }) : typeof e.size == "number" ? /* @__PURE__ */ H(b, {
197
- value: e.size,
198
- size: "xs",
199
- className: "shrink-0"
200
- }) : null, C = i("comment-attachment-chip--component", "relative inline-flex min-w-0 max-w-[20rem] items-center gap-space-sm rounded-radius-md", "ring-1 ring-inset transition-colors", l ? "px-2 py-1 text-xs" : "px-2.5 py-1 text-xs", v ? "bg-destructive/[0.04] ring-destructive/30 hover:bg-destructive/[0.08]" : "bg-foreground/[0.03] ring-border/60 hover:bg-foreground/[0.06]", d), w = _ ? /* @__PURE__ */ H(de, {
201
- className: i("shrink-0 animate-spin text-muted-foreground", "size-icon-md"),
202
- "aria-hidden": !0
203
- }) : /* @__PURE__ */ H(g, {
204
- className: i("shrink-0", "size-icon-md", v ? "text-destructive" : "text-muted-foreground"),
205
- "aria-hidden": !0
206
- }), T = /* @__PURE__ */ U("span", {
207
- className: "inline-flex min-w-0 items-baseline gap-space-sm",
208
- children: [/* @__PURE__ */ H(u, {
209
- tag: "span",
210
- size: "xs",
211
- weight: "medium",
212
- className: i("truncate", v && "text-destructive"),
213
- children: h
214
- }), S]
215
- });
216
- return /* @__PURE__ */ U("div", {
217
- className: C,
218
- children: [
219
- w,
220
- m && !_ && !v ? /* @__PURE__ */ H(f, {
221
- href: m,
222
- size: "inherit",
223
- underline: !1,
224
- target: "_blank",
225
- rel: "noreferrer noopener",
226
- className: "inline-flex min-w-0 flex-1 items-baseline gap-space-sm hover:underline",
227
- "aria-label": p.attachmentDownloadLabel,
228
- children: T
229
- }) : T,
230
- _ && typeof e.progress == "number" && /* @__PURE__ */ H("div", {
231
- className: "bg-primary/15 absolute bottom-0 left-2 right-2 h-px overflow-hidden rounded-full",
232
- children: /* @__PURE__ */ H("div", {
233
- className: "bg-primary h-full transition-[width]",
234
- style: { width: `${Math.min(100, Math.max(0, e.progress))}%` }
235
- })
236
- }),
237
- v && a && /* @__PURE__ */ H(s, {
238
- type: "button",
239
- tone: "destructive",
240
- buttonStyle: "ghost",
241
- size: "sm",
242
- onClick: () => a(e.id),
243
- className: "h-auto shrink-0 rounded px-1.5 py-px ring-1 ring-inset ring-destructive/30 hover:ring-destructive/60",
244
- children: /* @__PURE__ */ H(u, {
245
- tag: "span",
246
- size: "xs",
247
- weight: "medium",
248
- className: "text-inherit",
249
- children: p.attachmentRetryLabel
250
- })
251
- }),
252
- t && n && /* @__PURE__ */ H(s, {
253
- type: "button",
254
- tone: "secondary",
255
- buttonStyle: "ghost",
256
- size: "sm",
257
- iconOnly: !0,
258
- onClick: () => n(e.id),
259
- className: "-mr-0.5 size-icon shrink-0 rounded p-0 text-muted-foreground hover:bg-foreground/10 hover:text-foreground",
260
- "aria-label": p.attachmentRemoveLabel,
261
- title: p.attachmentRemoveLabel,
262
- children: /* @__PURE__ */ H(q, { className: "size-icon-sm" })
263
- })
264
- ]
265
- });
266
- };
267
- //#endregion
268
- //#region src/components/features/comments/hooks/use-attachment-upload.ts
269
- function ye(e = {}) {
270
- let { onUpload: t, maxSize: n, maxFiles: r, disabled: i, initialAttachments: a, onValueChange: o, onError: s } = e, [c, l] = B(() => a ? [...a] : []), u = z(/* @__PURE__ */ new Map()), d = z(/* @__PURE__ */ new Map()), f = z(o);
271
- f.current = o;
272
- let p = I((e, t) => {
273
- l((n) => n.map((n) => n.id === e ? {
274
- ...n,
275
- ...t
276
- } : n));
277
- }, []), m = I((e) => {
278
- l([...e]);
279
- }, []), h = I((e, n) => {
280
- if (!t) return;
281
- let r = new AbortController();
282
- u.current.set(e, { controller: r }), p(e, {
283
- status: "uploading",
284
- progress: 0,
285
- error: void 0
286
- }), t({
287
- file: n,
288
- onProgress: (t) => {
289
- p(e, { progress: t });
290
- },
291
- signal: r.signal
292
- }).then((t) => {
293
- u.current.delete(e), p(e, {
294
- ...t,
295
- id: e,
296
- status: "uploaded",
297
- progress: 100,
298
- error: void 0
299
- });
300
- }).catch((t) => {
301
- if (u.current.delete(e), r.signal.aborted) return;
302
- let n = t instanceof Error ? t.message : "Upload failed";
303
- p(e, {
304
- status: "failed",
305
- error: n
306
- }), s?.(n);
307
- });
308
- }, [
309
- s,
310
- t,
311
- p
312
- ]), g = I((e) => {
313
- if (i || !t) return;
314
- let a = Array.from(e);
315
- a.length !== 0 && l((e) => {
316
- let t = [...e];
317
- for (let e of a) {
318
- if (typeof r == "number" && t.length >= r) {
319
- s?.("Too many attachments.");
320
- break;
321
- }
322
- if (typeof n == "number" && e.size > n) {
323
- s?.("File is too large.");
324
- continue;
325
- }
326
- let i = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `att-${Date.now()}-${Math.random().toString(36).slice(2)}`;
327
- d.current.set(i, e), t.push({
328
- id: i,
329
- name: e.name,
330
- size: e.size,
331
- mimeType: e.type,
332
- status: "uploading",
333
- progress: 0
334
- }), queueMicrotask(() => h(i, e));
335
- }
336
- return t;
337
- });
338
- }, [
339
- h,
340
- i,
341
- r,
342
- n,
343
- s,
344
- t
345
- ]), _ = I((e) => {
346
- let t = u.current.get(e);
347
- t && (t.controller.abort(), u.current.delete(e)), d.current.delete(e), l((t) => t.filter((t) => t.id !== e));
348
- }, []), v = I((e) => {
349
- let t = d.current.get(e);
350
- t && h(e, t);
351
- }, [h]), y = I(() => {
352
- for (let e of u.current.values()) e.controller.abort();
353
- u.current.clear(), d.current.clear(), l([]);
354
- }, []);
355
- return L(() => {
356
- f.current?.(c);
357
- }, [c]), L(() => {
358
- let e = u.current;
359
- return () => {
360
- for (let t of e.values()) t.controller.abort();
361
- };
362
- }, []), {
363
- attachments: c,
364
- uploadedAttachments: R(() => c.filter((e) => e.status === "uploaded" || !e.status), [c]),
365
- isUploading: R(() => c.some((e) => e.status === "uploading"), [c]),
366
- addFiles: g,
367
- removeAttachment: _,
368
- retryAttachment: v,
369
- setAttachments: m,
370
- reset: y
371
- };
372
- }
373
- //#endregion
374
- //#region src/components/features/comments/partials/comment-composer.tsx
375
- function be(e) {
376
- return !e || typeof e != "string" ? !1 : e.replace(/<[^>]*>/g, "").trim().length > 0;
377
- }
378
- var Z = P(function({ context: e, canComment: t = !0, submitting: n = !1, errors: r, resetKey: i = 0, onSubmit: a, onCancel: o, editingComment: c, replyingTo: l, strings: d, resources: f, onResourceSearch: m, attachments: h, maxAttachments: g, allowAttachments: _, initialValues: v, autoFocus: y = !1, inlineSubmit: b = !0, placeholder: x }, S) {
379
- let C = Y(d), w = f, T = m, E = _ ?? !0, D = h?.maxFiles ?? g ?? 5, k = R(() => ({
380
- ...h,
381
- maxFiles: D,
382
- disabled: h?.disabled === !0 || !E
383
- }), [
384
- E,
385
- h,
386
- D
387
- ]), j = z(null), [N, ie] = B(() => v?.content ?? c?.content ?? ""), [P, F] = B(null), I = A({
388
- resources: w,
389
- onResourceSearch: T,
390
- editorRef: j,
391
- initialMentions: v?.references ?? c?.references
392
- }), V = ye({
393
- ...k,
394
- initialAttachments: v?.attachments ?? void 0
395
- });
396
- ae(S, () => ({
397
- focus: () => j.current?.focus(),
398
- clear: () => {
399
- j.current?.clear(), I.reset(), V.reset(), F(null);
400
- },
401
- setBody: (e) => {
402
- j.current?.setHTML(e);
403
- }
404
- }), [V, I]), L(() => {
405
- j.current?.setHTML(v?.content ?? ""), I.setMentions(v?.references ?? []), V.setAttachments(v?.attachments ?? []), F(null);
406
- }, [
407
- e.id,
408
- e.type,
409
- i
410
- ]), L(() => {
411
- if (!c) return;
412
- j.current?.setHTML(c.content ?? ""), I.setMentions(c.references ?? []);
413
- let e = (c.attachments ?? []).filter((e) => !!e);
414
- V.setAttachments(e);
415
- }, [c?.id]), L(() => {
416
- r?.content && F(r.content);
417
- }, [r]);
418
- let se = (t) => {
419
- if (t?.preventDefault(), n || V.isUploading) return;
420
- let r = j.current?.getHTML() ?? N;
421
- if (!be(r)) {
422
- F(C.invalidContent);
423
- return;
424
- }
425
- F(null), a({
426
- content: r,
427
- commentableId: e.id,
428
- commentableType: e.type,
429
- moduleKey: e.moduleKey,
430
- contentType: "html",
431
- references: I.mentions,
432
- attachments: V.uploadedAttachments,
433
- replyToId: l?.commentId ?? v?.replyToId,
434
- editingId: c?.id
435
- });
436
- }, ce = z(null), le = () => ce.current?.click(), ue = (e) => {
437
- e && V.addFiles(e);
438
- }, W = V.attachments.length > 0, G = !!c, K = !G && !!l, me = n ? C.composerSubmitting : G ? C.composerSave : C.composerSubmit, he = G ? /* @__PURE__ */ H(xe, {
439
- label: C.composerEditingEyebrow,
440
- closeLabel: C.composerCancel,
441
- onClose: o
442
- }) : K ? /* @__PURE__ */ H(xe, {
443
- label: Se(C.composerReplyingEyebrow, l.authorName),
444
- closeLabel: C.composerCancel,
445
- onClose: o
446
- }) : null, q = R(() => {
447
- let e = [];
448
- return w && Object.keys(w).length > 0 && e.push({
449
- id: "reference",
450
- icon: oe,
451
- label: C.composerReferenceLabel,
452
- onClick: () => I.setPickerOpen(!0)
453
- }), k?.onUpload && !k.disabled && e.push({
454
- id: "attachment",
455
- icon: fe,
456
- label: C.composerAttachmentLabel,
457
- onClick: le
458
- }), e;
459
- }, [
460
- w,
461
- k?.onUpload,
462
- k?.disabled,
463
- C.composerReferenceLabel,
464
- C.composerAttachmentLabel
465
- ]);
466
- if (!t) return null;
467
- let J = /* @__PURE__ */ H(s, {
468
- type: "button",
469
- onClick: () => se(),
470
- disabled: n || V.isUploading,
471
- icon: n ? de : pe,
472
- children: me
473
- }), ge = G || K || o ? /* @__PURE__ */ H(s, {
474
- type: "button",
475
- tone: "secondary",
476
- buttonStyle: "ghost",
477
- onClick: o,
478
- disabled: n,
479
- children: C.composerCancel
480
- }) : null, X = W ? /* @__PURE__ */ H(p, {
481
- direction: "horizontal",
482
- wrap: !0,
483
- align: "center",
484
- gap: "sm",
485
- children: V.attachments.map((e) => /* @__PURE__ */ H(ve, {
486
- attachment: e,
487
- editable: !0,
488
- onRemove: V.removeAttachment,
489
- onRetry: V.retryAttachment,
490
- strings: d
491
- }, e.id))
492
- }) : null, _e = W ? X : null, Z = b !== !1 && !G && !K ? J : null, Q = b === !1 || G || K;
493
- return /* @__PURE__ */ U(p, {
494
- render: /* @__PURE__ */ H("form", {}),
495
- gap: "md",
496
- onSubmit: se,
497
- className: "comment-composer--component",
498
- children: [
499
- he,
500
- /* @__PURE__ */ H("input", {
501
- ref: ce,
502
- type: "file",
503
- multiple: !0,
504
- hidden: !0,
505
- accept: k?.accept,
506
- onChange: (e) => {
507
- ue(e.target.files), e.target.value = "";
508
- }
509
- }),
510
- !I.triggerActive && /* @__PURE__ */ U(ee, {
511
- open: I.pickerOpen,
512
- onOpenChange: I.setPickerOpen,
513
- children: [/* @__PURE__ */ H(O, { render: /* @__PURE__ */ H(s, {
514
- type: "button",
515
- tone: "secondary",
516
- buttonStyle: "ghost",
517
- className: "sr-only",
518
- tabIndex: -1,
519
- children: C.composerReferenceLabel
520
- }) }), /* @__PURE__ */ H(re, {
521
- open: I.pickerOpen,
522
- activeKind: I.activeKind,
523
- setActiveKind: (e) => {
524
- I.setActiveKind(e), I.setManualKindOverride(!0);
525
- },
526
- kinds: I.kinds,
527
- resources: w,
528
- query: I.query,
529
- setQuery: I.setQuery,
530
- suggestions: I.suggestions,
531
- loading: I.isLoading,
532
- onSelect: I.pickSuggestion,
533
- strings: {
534
- title: C.composerReferenceMenuTitle,
535
- searchPlaceholder: C.composerReferenceSearchPlaceholder,
536
- empty: C.composerReferenceEmpty,
537
- loading: C.composerReferenceLoading
538
- }
539
- })]
540
- }),
541
- /* @__PURE__ */ U("div", {
542
- className: "comment-composer--editor relative",
543
- children: [/* @__PURE__ */ H(te, {
544
- ref: j,
545
- value: N,
546
- onValueChange: (e) => {
547
- ie(e);
548
- let t = M(e), n = I.mentions;
549
- if (n.map((e) => e.id).join("|") !== t.map((e) => e.id).join("|")) {
550
- let e = new Map(n.map((e) => [e.id, e])), r = t.map((t) => e.get(t.id) ?? t);
551
- I.setMentions(r);
552
- }
553
- },
554
- placeholder: x ?? C.composerPlaceholder,
555
- strings: { editorLabel: x ?? C.composerPlaceholder },
556
- minHeight: "3rem",
557
- autoFocus: y || G || K,
558
- extraToolbarItems: q,
559
- toolbarTrailing: Z,
560
- footerSlot: _e,
561
- onCaretChange: I.handleCaretChange
562
- }), /* @__PURE__ */ H(ne, {
563
- open: I.triggerActive && I.pickerOpen,
564
- activeKind: I.activeKind,
565
- setActiveKind: (e) => {
566
- I.setActiveKind(e), I.setManualKindOverride(!0);
567
- },
568
- kinds: I.kinds,
569
- resources: w,
570
- query: I.query,
571
- suggestions: I.suggestions,
572
- suggestionsByKind: I.suggestionsByKind,
573
- loading: I.isLoading,
574
- onSelect: I.pickSuggestion,
575
- strings: {
576
- title: C.composerReferenceMenuTitle,
577
- empty: C.composerReferenceEmpty,
578
- loading: C.composerReferenceLoading
579
- }
580
- })]
581
- }),
582
- P && /* @__PURE__ */ H(u, {
583
- size: "xs",
584
- type: "error",
585
- children: P
586
- }),
587
- Q && /* @__PURE__ */ U(p, {
588
- direction: "horizontal",
589
- align: "center",
590
- justify: "end",
591
- gap: "md",
592
- className: "comment-composer--footer-actions",
593
- children: [ge, J]
594
- })
595
- ]
596
- });
597
- });
598
- function xe({ label: e, closeLabel: t, onClose: n }) {
599
- return /* @__PURE__ */ U("div", {
600
- className: "bg-muted/40 ring-border/60 flex items-center justify-between rounded px-2.5 py-1.5 ring-1 ring-inset",
601
- children: [/* @__PURE__ */ H(d, { children: e }), n ? /* @__PURE__ */ H(s, {
602
- type: "button",
603
- tone: "secondary",
604
- buttonStyle: "ghost",
605
- size: "sm",
606
- iconOnly: !0,
607
- onClick: n,
608
- className: "size-icon rounded p-0 text-muted-foreground hover:text-foreground",
609
- "aria-label": t,
610
- children: /* @__PURE__ */ H(q, { className: "size-icon-sm" })
611
- }) : null]
612
- });
613
- }
614
- function Se(e, t) {
615
- return n(e, { name: t }, { missing: "empty" });
616
- }
617
- //#endregion
618
- //#region src/components/features/comments/partials/comment-empty.tsx
619
- var Q = ({ strings: e, icon: t, className: n }) => {
620
- let r = Y(e);
621
- return /* @__PURE__ */ H(k, {
622
- title: r.empty,
623
- description: r.emptyHint || !1,
624
- media: t ?? /* @__PURE__ */ H(W, {
625
- className: "size-icon",
626
- "aria-hidden": "true"
627
- }),
628
- mediaVariant: "icon-soft",
629
- padding: "md",
630
- className: i("comment-empty--component", n)
631
- });
632
- };
633
- //#endregion
634
- //#region src/components/features/comments/partials/comment-content.tsx
635
- function Ce(e) {
636
- let { comment: t, resources: n, renderReference: r, sanitizer: i } = e, a = t.contentType ?? t.content_type ?? "text";
637
- if (a === "rich") {
638
- let e = we(t.content);
639
- return e ? /* @__PURE__ */ H("div", {
640
- className: "comment-content--component",
641
- children: e
642
- }) : null;
643
- }
644
- if (a === "html") return /* @__PURE__ */ H("div", {
645
- className: "comment-content--component",
646
- children: /* @__PURE__ */ H(j, {
647
- html: t.content ?? "",
648
- mentions: t.references,
649
- resources: n,
650
- renderMention: r,
651
- sanitizer: i
652
- })
653
- });
654
- let o = Ee(t.content ?? "");
655
- return /* @__PURE__ */ H(u, {
656
- className: "comment-content--component whitespace-pre-line",
657
- children: o
658
- });
659
- }
660
- function we(e) {
661
- if (!e) return null;
662
- try {
663
- let t = JSON.parse(e);
664
- return !t || !Array.isArray(t.blocks) || t.blocks.length === 0 ? null : /* @__PURE__ */ H(u, {
665
- tag: "div",
666
- className: _,
667
- children: t.blocks.map((e, t) => /* @__PURE__ */ H(N, { children: Te(e) }, e.id ?? `${e.type}-${t}`))
668
- });
669
- } catch {
670
- let t = Ee(e);
671
- return /* @__PURE__ */ H(u, {
672
- className: "whitespace-pre-line",
673
- children: t
674
- });
675
- }
676
- }
677
- function Te(e) {
678
- let t = e.data ?? {};
679
- switch (e.type) {
680
- case "paragraph": {
681
- let e = String(t.text ?? "").trim();
682
- if (!e) return null;
683
- let n = g(e);
684
- return n ? /* @__PURE__ */ H("p", { dangerouslySetInnerHTML: { __html: n } }) : null;
685
- }
686
- case "header": {
687
- let e = $(String(t.text ?? "")), n = Number(t.level ?? 3);
688
- return e ? ie(`h${Math.min(Math.max(n, 1), 6)}`, null, e) : null;
689
- }
690
- case "list": {
691
- let e = (Array.isArray(t.items) ? t.items : []).map((e) => $(String(e ?? ""))).filter((e) => e.length > 0);
692
- return e.length === 0 ? null : t.style === "ordered" ? /* @__PURE__ */ H("ol", { children: e.map((e, t) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(u, {
693
- tag: "span",
694
- children: e
695
- }) }, `${e}-${t}`)) }) : /* @__PURE__ */ H("ul", { children: e.map((e) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(u, {
696
- tag: "span",
697
- children: e
698
- }) }, e)) });
699
- }
700
- case "quote": {
701
- let e = String(t.text ?? "").trim();
702
- if (!e) return null;
703
- let n = $(String(t.caption ?? ""));
704
- return /* @__PURE__ */ U("blockquote", {
705
- className: "italic",
706
- children: [/* @__PURE__ */ H(v, {
707
- tag: "div",
708
- html: e,
709
- type: "secondary"
710
- }), n.length > 0 && /* @__PURE__ */ H("cite", {
711
- className: "mt-1 block not-italic",
712
- children: /* @__PURE__ */ U(u, {
713
- tag: "span",
714
- size: "xs",
715
- type: "secondary",
716
- className: "opacity-80",
717
- children: ["— ", n]
718
- })
719
- })]
720
- });
721
- }
722
- case "delimiter": return /* @__PURE__ */ H("hr", {
723
- className: "border-dashed",
724
- "aria-hidden": "true"
725
- });
726
- default: {
727
- let e = $(String(t.text ?? ""));
728
- return e ? /* @__PURE__ */ H("p", {
729
- className: "whitespace-pre-line",
730
- children: e
731
- }) : null;
732
- }
733
- }
734
- }
735
- function $(e) {
736
- return e.replace(/<[^>]*>/g, "").trim();
737
- }
738
- function Ee(e) {
739
- if (typeof e != "string") return "";
740
- let t = e.trim();
741
- if (t === "") return "";
742
- if (t.startsWith("{") || t.startsWith("[")) return t;
743
- try {
744
- let e = JSON.parse(t);
745
- if (typeof e == "string") return e;
746
- } catch {}
747
- return t.startsWith("\"") && t.endsWith("\"") ? t.slice(1, -1) : t;
748
- }
749
- //#endregion
750
- //#region src/components/features/comments/partials/comment-item.tsx
751
- var De = "?", Oe = (e) => e?.url, ke = (e) => e?.name, Ae = (e) => e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "), je = F(function({ comment: e, canModerate: t, onDelete: r, onAttachmentRemove: d, onEdit: f, onPinToggle: g, onReact: _, onReply: v, allowReactions: y, allowReplies: b, sanitizer: x, strings: O, getMediaUrl: ee, getMediaName: k, getStatusLabel: te, formatRelativeTime: A, resources: ne, renderAttachment: j, renderReference: re }) {
752
- let M = Y(O), N = y ?? !0, ie = b ?? !0, P = ge({
753
- getMediaUrl: ee,
754
- getMediaName: k,
755
- getStatusLabel: te,
756
- formatRelativeTime: A
757
- }), F = P.getMediaUrl ?? Oe, L = P.getMediaName ?? ke, ae = P.getStatusLabel ?? Ae, z = P.formatRelativeTime, V = e.user?.name ?? M.fallbackAuthor, oe = e.user?.avatar ?? void 0, ce = R(() => {
758
- if (!V) return De;
759
- let e = V.trim();
760
- return e === "" ? De : e.charAt(0).toUpperCase();
761
- }, [V]), le = R(() => Array.isArray(e.tagsArray) ? e.tagsArray.filter((e) => typeof e == "string") : e.tagsArray && typeof e.tagsArray == "object" ? Object.values(e.tagsArray).filter((e) => typeof e == "string") : [], [e.tagsArray]), ue = R(() => (e.attachments ?? []).filter((e) => !!e && typeof e == "object"), [e.attachments]), de = N ? e.reactions ?? [] : [], W = e.isPinned === !0, fe = e.isEdited === !0, pe = e.status && e.status !== "active", q = pe && e.status ? ae(e.status) : null, X = e.canDelete === !0 || t === !0, _e = e.canEdit === !0 || t === !0, ye = !!ie && !!v && !!e.id, be = !!N && !!_ && !!e.id, Z = !!g && !!t, xe = !!_e && !!f && !!e.id, Se = !!X && !!r && !!e.id, Q = ye || be || Z || xe || Se, we = m(), [Te, $] = B(null), Ee = I((e) => {
762
- $(e), we.show();
763
- }, [we]), je = ue.length > 0;
764
- return /* @__PURE__ */ U("article", {
765
- className: i("comment-item--component group relative overflow-hidden rounded-radius border transition-colors", "border-border/60 bg-card hover:bg-muted/30 px-3 py-2.5"),
766
- "data-comment-id": e.id,
767
- children: [/* @__PURE__ */ U(p, {
768
- direction: "horizontal",
769
- align: "start",
770
- gap: "lg",
771
- className: "min-w-0",
772
- children: [/* @__PURE__ */ U(T, {
773
- className: "mt-0.5 size-avatar shrink-0",
774
- children: [!!oe && /* @__PURE__ */ H(E, {
775
- src: oe,
776
- alt: V
777
- }), /* @__PURE__ */ H(w, {
778
- className: "bg-muted text-muted-foreground text-xs font-medium",
779
- children: ce
780
- })]
781
- }), /* @__PURE__ */ U("div", {
782
- className: "comment-item--body min-w-0 flex-1",
783
- children: [
784
- /* @__PURE__ */ U(p, {
785
- direction: "horizontal",
786
- align: "baseline",
787
- gap: "md",
788
- className: "min-w-0",
789
- children: [
790
- /* @__PURE__ */ H(u, {
791
- tag: "span",
792
- weight: "semibold",
793
- className: "truncate",
794
- children: V
795
- }),
796
- !!W && /* @__PURE__ */ H(a, {
797
- delayDuration: 0,
798
- children: /* @__PURE__ */ U(c, { children: [/* @__PURE__ */ H(o, {
799
- render: /* @__PURE__ */ H("span", { className: "inline-flex shrink-0 self-center" }),
800
- children: /* @__PURE__ */ H(K, {
801
- className: "text-warning size-icon-sm",
802
- "aria-hidden": !0
803
- })
804
- }), /* @__PURE__ */ H(l, {
805
- side: "top",
806
- className: "text-xs",
807
- children: M.pinned
808
- })] })
809
- }),
810
- /* @__PURE__ */ H(C, {
811
- value: e.createdAt,
812
- formatRelativeTime: z,
813
- size: "xs",
814
- className: "shrink-0 tabular-nums"
815
- }),
816
- !!fe && /* @__PURE__ */ H(u, {
817
- tag: "span",
818
- size: "xs",
819
- type: "secondary",
820
- className: "shrink-0",
821
- children: M.edited
822
- }),
823
- !!pe && !!q && /* @__PURE__ */ H(D, {
824
- size: "sm",
825
- tone: "secondary",
826
- className: "self-center",
827
- children: q
828
- })
829
- ]
830
- }),
831
- /* @__PURE__ */ H("div", {
832
- className: "mt-1 leading-relaxed",
833
- children: /* @__PURE__ */ H(Ce, {
834
- comment: e,
835
- resources: ne,
836
- renderReference: re,
837
- sanitizer: x
838
- })
839
- }),
840
- le.length > 0 && /* @__PURE__ */ H("div", {
841
- className: "mt-space-md flex flex-wrap gap-space-sm",
842
- children: le.map((e) => /* @__PURE__ */ H(D, {
843
- size: "sm",
844
- tone: "secondary",
845
- children: e
846
- }, e))
847
- }),
848
- je && /* @__PURE__ */ H("div", {
849
- className: "mt-space-md flex flex-wrap gap-space-sm",
850
- children: ue.map((e) => {
851
- if (j) return /* @__PURE__ */ H("div", { children: j(e) }, e.id ?? e.name);
852
- let t = !!d && !!e.id && X;
853
- return /* @__PURE__ */ H(ve, {
854
- attachment: e,
855
- editable: t,
856
- onRemove: t ? () => Ee(e.id) : void 0,
857
- accessors: {
858
- getMediaUrl: F,
859
- getMediaName: L
860
- },
861
- strings: O
862
- }, e.id ?? e.name);
863
- })
864
- }),
865
- de.length > 0 && /* @__PURE__ */ H(p, {
866
- direction: "horizontal",
867
- wrap: !0,
868
- align: "center",
869
- gap: "xs",
870
- className: "mt-space-md",
871
- children: de.map((t) => /* @__PURE__ */ H(s, {
872
- type: "button",
873
- "aria-label": n(M.reactionLabel ?? J.reactionLabel, {
874
- emoji: t.emoji,
875
- count: t.count
876
- }),
877
- "aria-pressed": t.mine ?? !1,
878
- tone: "secondary",
879
- buttonStyle: "ghost",
880
- size: "sm",
881
- onClick: () => _ && e.id ? _(e.id, t.emoji) : void 0,
882
- title: t.users?.join(", "),
883
- className: "h-auto rounded-full p-0",
884
- children: /* @__PURE__ */ U(D, {
885
- size: "sm",
886
- tone: t.mine ? "primary" : "secondary",
887
- className: "cursor-pointer transition-colors hover:opacity-90",
888
- children: [/* @__PURE__ */ H(u, {
889
- tag: "span",
890
- size: "inherit",
891
- lineHeight: "none",
892
- className: "text-inherit",
893
- "aria-hidden": !0,
894
- children: t.emoji
895
- }), /* @__PURE__ */ H(S, {
896
- value: t.count,
897
- size: "inherit",
898
- align: "left",
899
- className: "tabular-nums text-current"
900
- })]
901
- })
902
- }, t.emoji))
903
- }),
904
- Q && /* @__PURE__ */ U("div", {
905
- className: i("comment-item--actions relative mt-space-md ms-auto w-fit max-w-full flex-wrap opacity-100 transition-opacity", "group-hover:opacity-100 focus-within:opacity-100", "inline-flex items-center gap-space-2xs rounded-radius-md bg-card/95 shadow-sm ring-1 ring-border/70"),
906
- children: [
907
- ye && /* @__PURE__ */ H(s, {
908
- type: "button",
909
- size: "sm",
910
- iconOnly: !0,
911
- tone: "secondary",
912
- buttonStyle: "ghost",
913
- onClick: () => e.id && v(e.id),
914
- title: M.replyLabel,
915
- "aria-label": M.replyLabel,
916
- children: /* @__PURE__ */ H(se, { className: "size-icon-md" })
917
- }),
918
- be && /* @__PURE__ */ H(s, {
919
- type: "button",
920
- size: "sm",
921
- iconOnly: !0,
922
- tone: "secondary",
923
- buttonStyle: "ghost",
924
- onClick: () => e.id && _(e.id, "👍"),
925
- title: M.addReactionLabel,
926
- "aria-label": M.addReactionLabel,
927
- children: /* @__PURE__ */ H(me, { className: "size-icon-md" })
928
- }),
929
- Z && /* @__PURE__ */ H(s, {
930
- type: "button",
931
- size: "sm",
932
- iconOnly: !0,
933
- tone: "secondary",
934
- buttonStyle: "ghost",
935
- onClick: () => g(e),
936
- title: W ? M.unpinLabel : M.pinLabel,
937
- "aria-label": W ? M.unpinLabel : M.pinLabel,
938
- children: /* @__PURE__ */ H(K, { className: i("size-icon-md", W && "text-warning") })
939
- }),
940
- xe && /* @__PURE__ */ H(s, {
941
- type: "button",
942
- size: "sm",
943
- iconOnly: !0,
944
- tone: "secondary",
945
- buttonStyle: "ghost",
946
- title: M.editLabel,
947
- "aria-label": M.editLabel,
948
- onClick: () => f(e),
949
- children: /* @__PURE__ */ H(G, { className: "size-icon-md" })
950
- }),
951
- Se && /* @__PURE__ */ H(s, {
952
- type: "button",
953
- size: "sm",
954
- iconOnly: !0,
955
- tone: "secondary",
956
- buttonStyle: "ghost",
957
- className: "hover:bg-destructive/10 hover:text-destructive",
958
- onClick: () => r(e.id),
959
- title: M.deleteLabel,
960
- "aria-label": M.deleteLabel,
961
- children: /* @__PURE__ */ H(he, { className: "size-icon-md" })
962
- })
963
- ]
964
- })
965
- ]
966
- })]
967
- }), !!d && /* @__PURE__ */ H(h, {
968
- ...we.overlayProps,
969
- destructive: !0,
970
- title: M.confirmRemoveAttachmentTitle,
971
- description: M.confirmRemoveAttachmentDescription,
972
- strings: { confirm: M.attachmentRemoveLabel },
973
- onConfirm: () => {
974
- Te && e.id && d(e.id, Te);
975
- }
976
- })]
977
- });
978
- }), Me = function({ comments: e, canModerate: t, onDelete: n, onAttachmentRemove: r, onEdit: i, onPinToggle: a, onReact: o, onReply: s, allowReactions: c, allowReplies: l, sanitizer: u, strings: d, getMediaUrl: f, getMediaName: m, getStatusLabel: h, formatRelativeTime: g, resources: _, renderItem: v, renderAttachment: y, renderReference: b, emptySlot: x }) {
979
- return e.length ? /* @__PURE__ */ H(p, {
980
- gap: "sm",
981
- className: "comment-timeline--component",
982
- children: e.map((e, p) => {
983
- let x = /* @__PURE__ */ H(je, {
984
- comment: e,
985
- canModerate: t,
986
- onDelete: n,
987
- onAttachmentRemove: r,
988
- onEdit: i,
989
- onPinToggle: a,
990
- onReact: o,
991
- onReply: s,
992
- allowReactions: c,
993
- allowReplies: l,
994
- sanitizer: u,
995
- strings: d,
996
- getMediaUrl: f,
997
- getMediaName: m,
998
- getStatusLabel: h,
999
- formatRelativeTime: g,
1000
- resources: _,
1001
- renderAttachment: y,
1002
- renderReference: b
1003
- });
1004
- return v ? /* @__PURE__ */ H("div", { children: v({
1005
- comment: e,
1006
- canModerate: t ?? !1,
1007
- onDelete: n,
1008
- onAttachmentRemove: r,
1009
- onEdit: i,
1010
- defaultItem: x
1011
- }) }, e.id ?? `comment-${p}`) : /* @__PURE__ */ H("div", { children: x }, e.id ?? `comment-${p}`);
1012
- })
1013
- }) : /* @__PURE__ */ H(V, { children: x ?? /* @__PURE__ */ H(Q, { strings: d }) });
1014
- };
1015
- //#endregion
1016
- //#region src/components/features/comments/comments.tsx
1017
- function Ne(t) {
1018
- let n = e(), r = t.composerPosition ?? n.composerPosition ?? "top", a = t.maxAttachments ?? 5, o = t.allowAttachments ?? !0, s = t.allowReactions ?? !0, c = t.allowReplies ?? !0, l = t.canComment ?? !1, d = t.canModerate ?? !1, f = t.onPinToggle, g = t.resources, _ = t.attachments, v = Y(t.strings), y = t.title === void 0 ? v.title : t.title, b = t.confirmDelete ?? !0, x = m(), [S, C] = B(null), w = X({
1019
- onSubmit: t.onSubmit,
1020
- onUpdate: t.onUpdate,
1021
- onDelete: t.onDelete,
1022
- onAfterMutate: t.onAfterMutate,
1023
- onError: t.onError
1024
- }), T = I((e) => {
1025
- if (!b) {
1026
- w.deleteComment(e);
1027
- return;
1028
- }
1029
- C(e), x.show();
1030
- }, [
1031
- b,
1032
- w,
1033
- x
1034
- ]), E = w.startReply, D = t.comments, O = t.onReply, ee = I((e) => {
1035
- let t = D.find((t) => t.id === e);
1036
- t && E(t), O?.(e);
1037
- }, [
1038
- D,
1039
- O,
1040
- E
1041
- ]), k = w.composerMode.kind === "editing" ? w.composerMode.comment : void 0, te = w.composerMode.kind === "replying" ? {
1042
- commentId: w.composerMode.commentId,
1043
- authorName: w.composerMode.authorName
1044
- } : void 0, A = t.composerSlot ?? (l ? /* @__PURE__ */ H(Z, {
1045
- context: t.context,
1046
- canComment: l,
1047
- submitting: w.isSubmitting,
1048
- errors: w.formErrors,
1049
- resetKey: w.resetKey,
1050
- editingComment: k,
1051
- replyingTo: te,
1052
- onCancel: w.composerMode.kind === "idle" ? void 0 : w.cancelComposerMode,
1053
- onSubmit: w.submit,
1054
- strings: t.strings,
1055
- resources: g,
1056
- onResourceSearch: t.onResourceSearch,
1057
- attachments: _,
1058
- maxAttachments: a,
1059
- allowAttachments: o
1060
- }) : null), ne = /* @__PURE__ */ H(Me, {
1061
- comments: t.comments,
1062
- canModerate: d,
1063
- onDelete: t.onDelete ? T : void 0,
1064
- onAttachmentRemove: t.onAttachmentRemove,
1065
- onEdit: l && t.onUpdate ? w.startEdit : void 0,
1066
- onPinToggle: f,
1067
- onReact: t.onReact,
1068
- onReply: l && c ? ee : void 0,
1069
- allowReactions: s,
1070
- allowReplies: c,
1071
- sanitizer: t.sanitizer,
1072
- strings: t.strings,
1073
- getMediaUrl: t.getMediaUrl,
1074
- getMediaName: t.getMediaName,
1075
- getStatusLabel: t.getStatusLabel,
1076
- formatRelativeTime: t.formatRelativeTime,
1077
- resources: g,
1078
- renderItem: t.renderItem,
1079
- renderAttachment: t.renderAttachment,
1080
- renderReference: t.renderReference,
1081
- emptySlot: t.emptySlot ?? /* @__PURE__ */ H(Q, { strings: t.strings })
1082
- }), j = A ? /* @__PURE__ */ H("div", { children: A }) : null, re = /* @__PURE__ */ U(p, {
1083
- gap: "xl",
1084
- className: "comments--body",
1085
- children: [
1086
- t.headerSlot,
1087
- r === "top" && j,
1088
- ne,
1089
- r === "bottom" && j,
1090
- t.footerSlot
1091
- ]
1092
- });
1093
- if (t.bare) return re;
1094
- let M = typeof y == "string" ? y : void 0;
1095
- return /* @__PURE__ */ U(p, {
1096
- render: /* @__PURE__ */ H("section", {}),
1097
- gap: "lg",
1098
- "data-component": "comments",
1099
- "data-slot": "comments",
1100
- className: i("comments--component", t.className),
1101
- "aria-label": M,
1102
- children: [
1103
- !(y === !1 || !y && !v.subtitle) && /* @__PURE__ */ U(p, {
1104
- gap: "normal",
1105
- className: "comments--header",
1106
- children: [!!y && /* @__PURE__ */ H(u, {
1107
- weight: "semibold",
1108
- children: y
1109
- }), !!v.subtitle && /* @__PURE__ */ H(u, {
1110
- type: "secondary",
1111
- children: v.subtitle
1112
- })]
1113
- }),
1114
- re,
1115
- !!(b && t.onDelete) && /* @__PURE__ */ H(h, {
1116
- ...x.overlayProps,
1117
- destructive: !0,
1118
- title: v.confirmDeleteTitle,
1119
- description: v.confirmDeleteDescription,
1120
- strings: { confirm: v.confirmDeleteLabel },
1121
- onAsyncConfirm: async () => {
1122
- S && await w.deleteComment(S);
1123
- },
1124
- onError: t.onError
1125
- })
1126
- ]
1127
- });
1128
- }
1129
- //#endregion
1130
- export { Q as a, ye as c, ge as d, Y as f, Ce as i, ve as l, Me as n, Z as o, J as p, je as r, Se as s, Ne as t, X as u };
1131
-
1132
- //# sourceMappingURL=comments-DviPLnwy.js.map