@wakastellar/ui 4.0.1 → 4.1.1

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 (622) hide show
  1. package/dist/blocks/_shared/identity/InviteUserPanel.cjs.js +1 -1
  2. package/dist/blocks/_shared/identity/RoleSelect.cjs.js +1 -1
  3. package/dist/blocks/_shared/identity/SidePushLayout.cjs.js +1 -1
  4. package/dist/blocks/activity-timeline/index.cjs.js +1 -1
  5. package/dist/blocks/activity-timeline/index.es.js +1 -1
  6. package/dist/blocks/antivirus-dashboard/index.cjs.js +1 -1
  7. package/dist/blocks/antivirus-dashboard/index.es.js +1 -1
  8. package/dist/blocks/api-keys-manager/index.cjs.js +1 -1
  9. package/dist/blocks/apm-overview/index.cjs.js +1 -1
  10. package/dist/blocks/auth-2fa/index.cjs.js +2 -2
  11. package/dist/blocks/auth-2fa/index.es.js +1 -1
  12. package/dist/blocks/avatar-upload/index.cjs.js +1 -1
  13. package/dist/blocks/avatar-upload/index.es.js +13 -13
  14. package/dist/blocks/calendar-view/index.cjs.js +1 -1
  15. package/dist/blocks/calendar-view/index.es.js +1 -1
  16. package/dist/blocks/chat/index.cjs.js +1 -1
  17. package/dist/blocks/chat/index.es.js +162 -162
  18. package/dist/blocks/chat/widget.cjs.js +1 -1
  19. package/dist/blocks/chat/widget.es.js +19 -13
  20. package/dist/blocks/chat-interface/index.cjs.js +1 -1
  21. package/dist/blocks/chat-interface/index.es.js +1 -1
  22. package/dist/blocks/checkout-flow/index.cjs.js +1 -1
  23. package/dist/blocks/checkout-flow/index.es.js +1 -1
  24. package/dist/blocks/cicd-builder/index.cjs.js +1 -1
  25. package/dist/blocks/clamav-service-status/index.cjs.js +1 -1
  26. package/dist/blocks/cloud-cost-dashboard/index.cjs.js +1 -1
  27. package/dist/blocks/container-orchestrator/index.cjs.js +1 -1
  28. package/dist/blocks/container-orchestrator/index.es.js +2 -1
  29. package/dist/blocks/dashboard/index.cjs.js +1 -1
  30. package/dist/blocks/dashboard/index.es.js +2 -2
  31. package/dist/blocks/dashboard-kpi/index.cjs.js +1 -1
  32. package/dist/blocks/dashboard-kpi/index.es.js +1 -1
  33. package/dist/blocks/database-admin/index.cjs.js +1 -1
  34. package/dist/blocks/deployment-dashboard/index.cjs.js +1 -1
  35. package/dist/blocks/deployment-dashboard/index.es.js +1 -1
  36. package/dist/blocks/empty-states/index.cjs.js +1 -1
  37. package/dist/blocks/empty-states/index.es.js +1 -1
  38. package/dist/blocks/error-pages/index.cjs.js +1 -1
  39. package/dist/blocks/error-pages/index.es.js +1 -1
  40. package/dist/blocks/faq/index.cjs.js +1 -1
  41. package/dist/blocks/faq/index.es.js +1 -1
  42. package/dist/blocks/file-manager/index.cjs.js +1 -1
  43. package/dist/blocks/file-manager/index.es.js +1 -1
  44. package/dist/blocks/file-scan-uploader/index.cjs.js +1 -1
  45. package/dist/blocks/file-scan-uploader/index.es.js +2 -2
  46. package/dist/blocks/footer/index.cjs.js +1 -1
  47. package/dist/blocks/gitops-sync-status/index.cjs.js +1 -1
  48. package/dist/blocks/header/index.cjs.js +1 -1
  49. package/dist/blocks/header/index.es.js +1 -1
  50. package/dist/blocks/headtab/index.cjs.js +1 -1
  51. package/dist/blocks/i18n-editor/index.cjs.js +1 -1
  52. package/dist/blocks/i18n-editor/index.es.js +127 -127
  53. package/dist/blocks/incident-manager/index.cjs.js +1 -1
  54. package/dist/blocks/infrastructure-map/index.cjs.js +1 -1
  55. package/dist/blocks/kanban-board/index.cjs.js +1 -1
  56. package/dist/blocks/kanban-board/index.es.js +1 -1
  57. package/dist/blocks/landing/index.cjs.js +1 -1
  58. package/dist/blocks/landing/index.es.js +1 -1
  59. package/dist/blocks/language-selector/index.cjs.js +1 -1
  60. package/dist/blocks/layout/index.cjs.js +1 -1
  61. package/dist/blocks/login/index.cjs.js +1 -1
  62. package/dist/blocks/on-call-schedule/index.cjs.js +1 -1
  63. package/dist/blocks/player-profile/index.cjs.js +1 -1
  64. package/dist/blocks/player-profile/index.es.js +1 -1
  65. package/dist/blocks/pricing/index.cjs.js +1 -1
  66. package/dist/blocks/pricing/index.es.js +1 -1
  67. package/dist/blocks/profile/index.cjs.js +1 -1
  68. package/dist/blocks/profile/index.es.js +1 -1
  69. package/dist/blocks/profile-list/index.cjs.js +1 -1
  70. package/dist/blocks/quarantine-manager/index.cjs.js +1 -1
  71. package/dist/blocks/quarantine-manager/index.es.js +1 -1
  72. package/dist/blocks/release-notes/index.cjs.js +1 -1
  73. package/dist/blocks/scan-history-log/index.cjs.js +1 -1
  74. package/dist/blocks/scan-history-log/index.es.js +1 -1
  75. package/dist/blocks/scan-policy-editor/index.cjs.js +1 -1
  76. package/dist/blocks/scan-report-generator/index.cjs.js +1 -1
  77. package/dist/blocks/settings/index.cjs.js +1 -1
  78. package/dist/blocks/settings/index.es.js +1 -1
  79. package/dist/blocks/sidebar/index.cjs.js +1 -1
  80. package/dist/blocks/sidebar/index.es.js +1 -1
  81. package/dist/blocks/signature-database-manager/index.cjs.js +1 -1
  82. package/dist/blocks/team-form/index.cjs.js +1 -1
  83. package/dist/blocks/threat-alert-banner/index.cjs.js +1 -1
  84. package/dist/blocks/user-management/index.cjs.js +1 -1
  85. package/dist/blocks/waka-doc-shell/index.cjs.js +1 -1
  86. package/dist/blocks/wizard/index.cjs.js +1 -1
  87. package/dist/blocks/wizard/index.es.js +37 -37
  88. package/dist/charts.cjs.js +1 -1
  89. package/dist/charts.es.js +8 -8
  90. package/dist/cli/index.cjs +5 -1
  91. package/dist/components/DataTable/DataTable.cjs.js +1 -1
  92. package/dist/components/DataTable/DataTable.es.js +68 -66
  93. package/dist/components/DataTable/DataTableAdvanced.cjs.js +1 -1
  94. package/dist/components/DataTable/DataTableColumnResizer.cjs.js +1 -1
  95. package/dist/components/DataTable/DataTableContextMenu.cjs.js +1 -1
  96. package/dist/components/DataTable/DataTableEditCell.cjs.js +1 -1
  97. package/dist/components/DataTable/DataTableFilters.cjs.js +1 -1
  98. package/dist/components/DataTable/DataTableGrouping.cjs.js +1 -1
  99. package/dist/components/DataTable/DataTablePagination.cjs.js +1 -1
  100. package/dist/components/DataTable/DataTablePagination.d.ts +3 -1
  101. package/dist/components/DataTable/DataTablePagination.es.js +38 -27
  102. package/dist/components/DataTable/DataTableSelection.cjs.js +1 -1
  103. package/dist/components/DataTable/DataTableToolbar.cjs.js +1 -1
  104. package/dist/components/DataTable/hooks/useDataTable.cjs.js +1 -1
  105. package/dist/components/DataTable/hooks/useDataTable.es.js +5 -1
  106. package/dist/components/DataTable/hooks/useDataTableAdvanced.cjs.js +1 -1
  107. package/dist/components/DataTable/hooks/useDataTableEdit.cjs.js +1 -1
  108. package/dist/components/DataTable/hooks/useDataTableExport.cjs.js +2 -2
  109. package/dist/components/DataTable/hooks/useDataTableImport.cjs.js +2 -2
  110. package/dist/components/DataTable/hooks/useDataTableImport.es.js +2 -1
  111. package/dist/components/DataTable/hooks/useDataTableTheme.cjs.js +1 -1
  112. package/dist/components/DataTable/hooks/useDataTableVirtualization.cjs.js +1 -1
  113. package/dist/components/DataTable/hooks/useTableLayout.cjs.js +1 -1
  114. package/dist/components/DataTable/utils.cjs.js +1 -1
  115. package/dist/components/accordion/index.cjs.js +1 -1
  116. package/dist/components/alert/index.cjs.js +1 -1
  117. package/dist/components/alert-dialog/index.cjs.js +1 -1
  118. package/dist/components/aspect-ratio/index.cjs.js +1 -1
  119. package/dist/components/avatar/index.cjs.js +1 -1
  120. package/dist/components/badge/index.cjs.js +1 -1
  121. package/dist/components/button/index.cjs.js +1 -1
  122. package/dist/components/calendar/index.cjs.js +1 -1
  123. package/dist/components/card/index.cjs.js +1 -1
  124. package/dist/components/checkbox/index.cjs.js +1 -1
  125. package/dist/components/code/index.cjs.js +2 -2
  126. package/dist/components/code/index.es.js +3 -2
  127. package/dist/components/collapsible/index.cjs.js +1 -1
  128. package/dist/components/command/index.cjs.js +1 -1
  129. package/dist/components/context-menu/index.cjs.js +1 -1
  130. package/dist/components/dialog/index.cjs.js +1 -1
  131. package/dist/components/dropdown-menu/index.cjs.js +1 -1
  132. package/dist/components/editor/blocks/index.cjs.js +1 -1
  133. package/dist/components/editor/blocks/index.es.js +12 -12
  134. package/dist/components/editor/blocks/waka-acceptance-criteria-block.cjs.js +1 -1
  135. package/dist/components/editor/blocks/waka-ai-assist-block.cjs.js +1 -1
  136. package/dist/components/editor/blocks/waka-api-endpoint-block.cjs.js +1 -1
  137. package/dist/components/editor/blocks/waka-code-playground-block.cjs.js +1 -1
  138. package/dist/components/editor/blocks/waka-comment-thread-block.cjs.js +1 -1
  139. package/dist/components/editor/blocks/waka-diagram-block.cjs.js +3 -3
  140. package/dist/components/editor/blocks/waka-diagram-block.es.js +21 -40
  141. package/dist/components/editor/blocks/waka-embed-block.cjs.js +1 -1
  142. package/dist/components/editor/blocks/waka-slash-menu-block.cjs.js +1 -1
  143. package/dist/components/editor/blocks/waka-user-story-block.cjs.js +1 -1
  144. package/dist/components/editor/blocks/waka-version-diff-block.cjs.js +1 -1
  145. package/dist/components/editor/waka-ai-writer.cjs.js +1 -1
  146. package/dist/components/editor/waka-collaborative-editor.cjs.js +1 -1
  147. package/dist/components/editor/waka-diff-viewer.cjs.js +1 -1
  148. package/dist/components/editor/waka-dnd-editor.cjs.js +1 -1
  149. package/dist/components/editor/waka-document-editor.cjs.js +1 -1
  150. package/dist/components/editor/waka-document-editor.es.js +1 -1
  151. package/dist/components/editor/waka-editor-elements.cjs.js +1 -1
  152. package/dist/components/editor/waka-editor-leaves.cjs.js +1 -1
  153. package/dist/components/editor/waka-editor-toolbar.cjs.js +1 -1
  154. package/dist/components/editor/waka-editor.cjs.js +1 -1
  155. package/dist/components/editor/waka-floating-toolbar.cjs.js +1 -1
  156. package/dist/components/editor/waka-markdown-editor.cjs.js +1 -1
  157. package/dist/components/editor/waka-mention-editor.cjs.js +1 -1
  158. package/dist/components/editor/waka-mention-editor.es.js +2 -2
  159. package/dist/components/editor/waka-slash-menu.cjs.js +1 -1
  160. package/dist/components/editor/waka-spec-editor.cjs.js +1 -1
  161. package/dist/components/form/index.cjs.js +1 -1
  162. package/dist/components/hover-card/index.cjs.js +1 -1
  163. package/dist/components/input/index.cjs.js +1 -1
  164. package/dist/components/input-otp/index.cjs.js +1 -1
  165. package/dist/components/input-otp/index.es.js +2 -1
  166. package/dist/components/label/index.cjs.js +1 -1
  167. package/dist/components/language-selector/index.cjs.js +1 -1
  168. package/dist/components/menubar/index.cjs.js +1 -1
  169. package/dist/components/navigation-menu/index.cjs.js +1 -1
  170. package/dist/components/popover/index.cjs.js +1 -1
  171. package/dist/components/progress/index.cjs.js +1 -1
  172. package/dist/components/radio-group/index.cjs.js +1 -1
  173. package/dist/components/resizable/index.cjs.js +1 -1
  174. package/dist/components/resizable/index.es.js +9 -9
  175. package/dist/components/scroll-area/index.cjs.js +1 -1
  176. package/dist/components/select/index.cjs.js +1 -1
  177. package/dist/components/separator/index.cjs.js +1 -1
  178. package/dist/components/sheet/index.cjs.js +1 -1
  179. package/dist/components/skeleton/index.cjs.js +1 -1
  180. package/dist/components/slider/index.cjs.js +1 -1
  181. package/dist/components/switch/index.cjs.js +1 -1
  182. package/dist/components/table/index.cjs.js +1 -1
  183. package/dist/components/tabs/index.cjs.js +1 -1
  184. package/dist/components/textarea/index.cjs.js +1 -1
  185. package/dist/components/theme-selector/index.cjs.js +1 -1
  186. package/dist/components/toast/index.cjs.js +1 -1
  187. package/dist/components/toaster/index.cjs.js +1 -1
  188. package/dist/components/toggle/index.cjs.js +1 -1
  189. package/dist/components/toggle-group/index.cjs.js +1 -1
  190. package/dist/components/tooltip/index.cjs.js +1 -1
  191. package/dist/components/typography/index.cjs.js +1 -1
  192. package/dist/components/waka-3d-pie-chart/index.cjs.js +1 -1
  193. package/dist/components/waka-3d-pie-chart/index.es.js +1 -1
  194. package/dist/components/waka-achievement-unlock/index.cjs.js +1 -1
  195. package/dist/components/waka-achievement-unlock/index.es.js +1 -1
  196. package/dist/components/waka-activity-feed/index.cjs.js +2 -2
  197. package/dist/components/waka-activity-feed/index.es.js +1 -1
  198. package/dist/components/waka-ad-banner/index.cjs.js +1 -1
  199. package/dist/components/waka-ad-banner/index.es.js +18 -15
  200. package/dist/components/waka-ad-fallback/index.cjs.js +1 -1
  201. package/dist/components/waka-ad-fallback/index.es.js +1 -1
  202. package/dist/components/waka-ad-inline/index.cjs.js +1 -1
  203. package/dist/components/waka-ad-inline/index.es.js +2 -2
  204. package/dist/components/waka-ad-interstitial/index.cjs.js +1 -1
  205. package/dist/components/waka-ad-interstitial/index.es.js +3 -3
  206. package/dist/components/waka-ad-placeholder/index.cjs.js +2 -2
  207. package/dist/components/waka-ad-placeholder/index.es.js +1 -1
  208. package/dist/components/waka-ad-provider/index.cjs.js +1 -1
  209. package/dist/components/waka-ad-provider/index.es.js +1 -1
  210. package/dist/components/waka-ad-sidebar/index.cjs.js +1 -1
  211. package/dist/components/waka-ad-sidebar/index.es.js +2 -2
  212. package/dist/components/waka-ad-sticky-footer/index.cjs.js +1 -1
  213. package/dist/components/waka-ad-sticky-footer/index.es.js +2 -2
  214. package/dist/components/waka-address-autocomplete/index.cjs.js +2 -2
  215. package/dist/components/waka-address-autocomplete/index.es.js +10 -6
  216. package/dist/components/waka-admincrumb/index.cjs.js +1 -1
  217. package/dist/components/waka-alert-panel/index.cjs.js +1 -1
  218. package/dist/components/waka-alert-stack/index.cjs.js +1 -1
  219. package/dist/components/waka-alert-stack/index.es.js +1 -1
  220. package/dist/components/waka-allocation-matrix/index.cjs.js +2 -2
  221. package/dist/components/waka-allocation-matrix/index.es.js +1 -1
  222. package/dist/components/waka-approval-chain/index.cjs.js +1 -1
  223. package/dist/components/waka-approval-chain/index.es.js +1 -1
  224. package/dist/components/waka-artifact-list/index.cjs.js +1 -1
  225. package/dist/components/waka-artifact-list/index.es.js +1 -1
  226. package/dist/components/waka-audit-log/index.cjs.js +2 -2
  227. package/dist/components/waka-audit-log/index.es.js +1 -1
  228. package/dist/components/waka-autocomplete/index.cjs.js +1 -1
  229. package/dist/components/waka-autocomplete/index.es.js +3 -2
  230. package/dist/components/waka-badge-showcase/index.cjs.js +1 -1
  231. package/dist/components/waka-barcode/index.cjs.js +1 -1
  232. package/dist/components/waka-barcode/index.es.js +1 -1
  233. package/dist/components/waka-biometric-prompt/index.cjs.js +2 -2
  234. package/dist/components/waka-biometric-prompt/index.es.js +1 -1
  235. package/dist/components/waka-bottom-sheet/index.cjs.js +1 -1
  236. package/dist/components/waka-bottom-sheet/index.es.js +12 -7
  237. package/dist/components/waka-breadcrumb/index.cjs.js +1 -1
  238. package/dist/components/waka-breadcrumb/index.es.js +1 -1
  239. package/dist/components/waka-breadcrumb-path/index.cjs.js +1 -1
  240. package/dist/components/waka-breadcrumb-path/index.es.js +1 -1
  241. package/dist/components/waka-budget-burn/index.cjs.js +2 -2
  242. package/dist/components/waka-budget-burn/index.es.js +3 -3
  243. package/dist/components/waka-build-matrix/index.cjs.js +1 -1
  244. package/dist/components/waka-capacity-planner/index.cjs.js +2 -2
  245. package/dist/components/waka-capacity-planner/index.es.js +1 -1
  246. package/dist/components/waka-carousel/index.cjs.js +1 -1
  247. package/dist/components/waka-carousel/index.es.js +2 -2
  248. package/dist/components/waka-cart-summary/index.cjs.js +1 -1
  249. package/dist/components/waka-cart-summary/index.es.js +2 -2
  250. package/dist/components/waka-challenge-timer/index.cjs.js +1 -1
  251. package/dist/components/waka-charts/WakaAreaChart.cjs.js +1 -1
  252. package/dist/components/waka-charts/WakaAreaChart.es.js +2 -2
  253. package/dist/components/waka-charts/WakaBarChart.cjs.js +1 -1
  254. package/dist/components/waka-charts/WakaBarChart.es.js +2 -2
  255. package/dist/components/waka-charts/WakaChart.cjs.js +1 -1
  256. package/dist/components/waka-charts/WakaChart.es.js +1 -1
  257. package/dist/components/waka-charts/WakaLineChart.cjs.js +1 -1
  258. package/dist/components/waka-charts/WakaLineChart.es.js +2 -2
  259. package/dist/components/waka-charts/WakaMiniChart.cjs.js +1 -1
  260. package/dist/components/waka-charts/WakaMiniChart.es.js +2 -2
  261. package/dist/components/waka-charts/WakaPieChart.cjs.js +1 -1
  262. package/dist/components/waka-charts/WakaPieChart.es.js +2 -2
  263. package/dist/components/waka-charts/WakaSparkline.cjs.js +1 -1
  264. package/dist/components/waka-charts/WakaSparkline.es.js +1 -1
  265. package/dist/components/waka-charts/dataTableHelpers.cjs.js +1 -1
  266. package/dist/components/waka-charts/dataTableHelpers.es.js +1 -1
  267. package/dist/components/waka-charts/hooks/useChartTheme.cjs.js +1 -1
  268. package/dist/components/waka-charts/hooks/useChartTheme.es.js +1 -1
  269. package/dist/components/waka-charts/hooks/useRechartsLoader.cjs.js +1 -1
  270. package/dist/components/waka-charts/hooks/useRechartsLoader.es.js +1 -1
  271. package/dist/components/waka-chat-bubble/index.cjs.js +1 -1
  272. package/dist/components/waka-checklist/index.cjs.js +2 -2
  273. package/dist/components/waka-checklist/index.es.js +1 -1
  274. package/dist/components/waka-checkout-stepper/index.cjs.js +1 -1
  275. package/dist/components/waka-checkout-stepper/index.es.js +1 -1
  276. package/dist/components/waka-cohort-table/index.cjs.js +2 -2
  277. package/dist/components/waka-cohort-table/index.es.js +1 -1
  278. package/dist/components/waka-color-picker/index.cjs.js +2 -2
  279. package/dist/components/waka-color-picker/index.es.js +1 -1
  280. package/dist/components/waka-combo-counter/index.cjs.js +1 -1
  281. package/dist/components/waka-combobox/index.cjs.js +1 -1
  282. package/dist/components/waka-combobox/index.es.js +3 -2
  283. package/dist/components/waka-command-bar/index.cjs.js +1 -1
  284. package/dist/components/waka-compare-period/index.cjs.js +2 -2
  285. package/dist/components/waka-compare-period/index.es.js +7 -5
  286. package/dist/components/waka-config-comparator/index.cjs.js +1 -1
  287. package/dist/components/waka-config-comparator/index.es.js +1 -1
  288. package/dist/components/waka-connection-matrix/index.cjs.js +1 -1
  289. package/dist/components/waka-connection-matrix/index.es.js +1 -1
  290. package/dist/components/waka-container-list/index.cjs.js +1 -1
  291. package/dist/components/waka-container-list/index.es.js +1 -1
  292. package/dist/components/waka-content-recommendation/index.cjs.js +1 -1
  293. package/dist/components/waka-content-recommendation/index.es.js +2 -2
  294. package/dist/components/waka-contribution-graph/index.cjs.js +1 -1
  295. package/dist/components/waka-contribution-graph/index.es.js +4 -4
  296. package/dist/components/waka-cost-breakdown/index.cjs.js +1 -1
  297. package/dist/components/waka-cost-breakdown/index.es.js +7 -7
  298. package/dist/components/waka-coupon-input/index.cjs.js +2 -2
  299. package/dist/components/waka-coupon-input/index.es.js +1 -1
  300. package/dist/components/waka-credit-activity-feed/index.cjs.js +2 -2
  301. package/dist/components/waka-credit-activity-feed/index.es.js +1 -1
  302. package/dist/components/waka-credit-alert/index.cjs.js +1 -1
  303. package/dist/components/waka-credit-alert/index.es.js +1 -1
  304. package/dist/components/waka-credit-balance/index.cjs.js +1 -1
  305. package/dist/components/waka-credit-balance/index.es.js +3 -3
  306. package/dist/components/waka-credit-breakdown/index.cjs.js +1 -1
  307. package/dist/components/waka-credit-breakdown/index.es.js +1 -1
  308. package/dist/components/waka-credit-burn-rate/index.cjs.js +1 -1
  309. package/dist/components/waka-credit-burn-rate/index.es.js +1 -1
  310. package/dist/components/waka-credit-card-input/index.cjs.js +1 -1
  311. package/dist/components/waka-credit-card-input/index.es.js +1 -1
  312. package/dist/components/waka-credit-history/index.cjs.js +1 -1
  313. package/dist/components/waka-credit-history/index.es.js +1 -1
  314. package/dist/components/waka-credit-meter/index.cjs.js +2 -2
  315. package/dist/components/waka-credit-meter/index.es.js +3 -3
  316. package/dist/components/waka-credit-pricing-pack/index.cjs.js +1 -1
  317. package/dist/components/waka-credit-pricing-pack/index.es.js +1 -1
  318. package/dist/components/waka-credit-projection/index.cjs.js +1 -1
  319. package/dist/components/waka-credit-projection/index.es.js +1 -1
  320. package/dist/components/waka-credit-quota/index.cjs.js +1 -1
  321. package/dist/components/waka-credit-quota/index.es.js +3 -3
  322. package/dist/components/waka-credit-receipt/index.cjs.js +1 -1
  323. package/dist/components/waka-credit-receipt/index.es.js +1 -1
  324. package/dist/components/waka-credit-top-up/index.cjs.js +1 -1
  325. package/dist/components/waka-credit-top-up/index.es.js +1 -1
  326. package/dist/components/waka-credit-transaction/index.cjs.js +1 -1
  327. package/dist/components/waka-credit-transaction/index.es.js +1 -1
  328. package/dist/components/waka-credit-transfer-form/index.cjs.js +1 -1
  329. package/dist/components/waka-credit-transfer-form/index.es.js +1 -1
  330. package/dist/components/waka-credit-usage-chart/index.cjs.js +1 -1
  331. package/dist/components/waka-credit-usage-chart/index.es.js +1 -1
  332. package/dist/components/waka-daily-reward/index.cjs.js +1 -1
  333. package/dist/components/waka-database-card/index.cjs.js +1 -1
  334. package/dist/components/waka-database-card/index.es.js +1 -1
  335. package/dist/components/waka-date-range-picker/index.cjs.js +1 -1
  336. package/dist/components/waka-date-range-picker/index.es.js +3 -2
  337. package/dist/components/waka-datetime-picker/index.cjs.js +1 -1
  338. package/dist/components/waka-datetime-picker/index.es.js +4 -1
  339. package/dist/components/waka-datetime-picker.form-integration/index.cjs.js +1 -1
  340. package/dist/components/waka-dependency-tree/index.cjs.js +1 -1
  341. package/dist/components/waka-dependency-tree/index.es.js +1 -1
  342. package/dist/components/waka-deployment-lane/index.cjs.js +1 -1
  343. package/dist/components/waka-deployment-lane/index.es.js +1 -1
  344. package/dist/components/waka-device-trust/index.cjs.js +2 -2
  345. package/dist/components/waka-device-trust/index.es.js +1 -1
  346. package/dist/components/waka-doc-breadcrumb/index.cjs.js +1 -1
  347. package/dist/components/waka-doc-callout/index.cjs.js +1 -1
  348. package/dist/components/waka-doc-code-block/index.cjs.js +1 -1
  349. package/dist/components/waka-doc-nav/index.cjs.js +1 -1
  350. package/dist/components/waka-doc-renderer/index.cjs.js +1 -1
  351. package/dist/components/waka-doc-search/index.cjs.js +1 -1
  352. package/dist/components/waka-doc-table/index.cjs.js +1 -1
  353. package/dist/components/waka-doc-toc/index.cjs.js +1 -1
  354. package/dist/components/waka-doc-toolbar/index.cjs.js +1 -1
  355. package/dist/components/waka-doc-version/index.cjs.js +1 -1
  356. package/dist/components/waka-dock/index.cjs.js +1 -1
  357. package/dist/components/waka-dock/index.es.js +2 -2
  358. package/dist/components/waka-drawer/index.cjs.js +1 -1
  359. package/dist/components/waka-drawer/index.es.js +1 -1
  360. package/dist/components/waka-empty-state/index.cjs.js +1 -1
  361. package/dist/components/waka-env-var-editor/index.cjs.js +1 -1
  362. package/dist/components/waka-error-shake/index.cjs.js +1 -1
  363. package/dist/components/waka-feature-announcement/index.cjs.js +2 -2
  364. package/dist/components/waka-feature-announcement/index.es.js +1 -1
  365. package/dist/components/waka-feature-flag-row/index.cjs.js +1 -1
  366. package/dist/components/waka-file-upload/index.cjs.js +1 -1
  367. package/dist/components/waka-file-upload/index.es.js +2 -2
  368. package/dist/components/waka-floating-nav/index.cjs.js +1 -1
  369. package/dist/components/waka-floating-nav/index.es.js +1 -1
  370. package/dist/components/waka-flow-diagram/index.cjs.js +1 -1
  371. package/dist/components/waka-funnel-chart/index.cjs.js +2 -2
  372. package/dist/components/waka-funnel-chart/index.es.js +1 -1
  373. package/dist/components/waka-glow-card/index.cjs.js +1 -1
  374. package/dist/components/waka-glow-card/index.es.js +3 -3
  375. package/dist/components/waka-goal-progress/index.cjs.js +3 -3
  376. package/dist/components/waka-goal-progress/index.es.js +3 -3
  377. package/dist/components/waka-haptic-button/index.cjs.js +1 -1
  378. package/dist/components/waka-health-pulse/index.cjs.js +2 -2
  379. package/dist/components/waka-health-pulse/index.es.js +1 -1
  380. package/dist/components/waka-heatmap/index.cjs.js +1 -1
  381. package/dist/components/waka-heatmap/index.es.js +3 -3
  382. package/dist/components/waka-hotspot/index.cjs.js +1 -1
  383. package/dist/components/waka-image/index.cjs.js +1 -1
  384. package/dist/components/waka-image/index.es.js +1 -1
  385. package/dist/components/waka-incident-timeline/index.cjs.js +1 -1
  386. package/dist/components/waka-incident-timeline/index.es.js +3 -2
  387. package/dist/components/waka-invoice-preview/index.cjs.js +1 -1
  388. package/dist/components/waka-invoice-preview/index.es.js +1 -1
  389. package/dist/components/waka-kanban/index.cjs.js +1 -1
  390. package/dist/components/waka-kanban/index.es.js +1 -1
  391. package/dist/components/waka-kpi-dashboard/index.cjs.js +1 -1
  392. package/dist/components/waka-kpi-dashboard/index.es.js +6 -4
  393. package/dist/components/waka-kubernetes-overview/index.cjs.js +1 -1
  394. package/dist/components/waka-kubernetes-overview/index.es.js +1 -1
  395. package/dist/components/waka-leaderboard/index.cjs.js +1 -1
  396. package/dist/components/waka-level-progress/index.cjs.js +2 -2
  397. package/dist/components/waka-level-progress/index.es.js +2 -2
  398. package/dist/components/waka-liquid-button/index.cjs.js +1 -1
  399. package/dist/components/waka-loading-orbit/index.cjs.js +1 -1
  400. package/dist/components/waka-log-viewer/index.cjs.js +1 -1
  401. package/dist/components/waka-loot-box/index.cjs.js +2 -2
  402. package/dist/components/waka-loot-box/index.es.js +1 -1
  403. package/dist/components/waka-magic-link/index.cjs.js +2 -2
  404. package/dist/components/waka-magnetic-button/index.cjs.js +1 -1
  405. package/dist/components/waka-mention-input/index.cjs.js +1 -1
  406. package/dist/components/waka-mention-input/index.es.js +52 -40
  407. package/dist/components/waka-metric-sparkline/index.cjs.js +1 -1
  408. package/dist/components/waka-metric-sparkline/index.es.js +1 -1
  409. package/dist/components/waka-migration-list/index.cjs.js +1 -1
  410. package/dist/components/waka-milestone-road/index.cjs.js +2 -2
  411. package/dist/components/waka-milestone-road/index.es.js +5 -5
  412. package/dist/components/waka-modal/index.cjs.js +1 -1
  413. package/dist/components/waka-modal/index.es.js +1 -1
  414. package/dist/components/waka-morph-button/index.cjs.js +2 -2
  415. package/dist/components/waka-morph-button/index.es.js +6 -2
  416. package/dist/components/waka-network-topology/index.cjs.js +1 -1
  417. package/dist/components/waka-network-topology/index.es.js +4 -2
  418. package/dist/components/waka-notifications/index.cjs.js +1 -1
  419. package/dist/components/waka-number-input/index.cjs.js +1 -1
  420. package/dist/components/waka-number-input/index.es.js +1 -1
  421. package/dist/components/waka-orbital-menu/index.cjs.js +1 -1
  422. package/dist/components/waka-orbital-menu/index.es.js +1 -1
  423. package/dist/components/waka-order-tracker/index.cjs.js +1 -1
  424. package/dist/components/waka-order-tracker/index.es.js +3 -2
  425. package/dist/components/waka-outstream-video/index.cjs.js +1 -1
  426. package/dist/components/waka-outstream-video/index.es.js +2 -2
  427. package/dist/components/waka-pagination/index.cjs.js +1 -1
  428. package/dist/components/waka-pagination/index.es.js +1 -1
  429. package/dist/components/waka-password-strength/index.cjs.js +2 -2
  430. package/dist/components/waka-password-strength/index.es.js +3 -3
  431. package/dist/components/waka-payment-method-picker/index.cjs.js +1 -1
  432. package/dist/components/waka-payment-method-picker/index.es.js +1 -1
  433. package/dist/components/waka-permission-matrix/index.cjs.js +2 -2
  434. package/dist/components/waka-permission-matrix/index.es.js +3 -2
  435. package/dist/components/waka-phone-input/index.cjs.js +1 -1
  436. package/dist/components/waka-phone-input/index.es.js +5 -3
  437. package/dist/components/waka-pipeline-view/index.cjs.js +2 -2
  438. package/dist/components/waka-pipeline-view/index.es.js +1 -1
  439. package/dist/components/waka-player-card/index.cjs.js +2 -2
  440. package/dist/components/waka-player-card/index.es.js +4 -4
  441. package/dist/components/waka-pod-card/index.cjs.js +1 -1
  442. package/dist/components/waka-pod-card/index.es.js +1 -1
  443. package/dist/components/waka-points-popup/index.cjs.js +1 -1
  444. package/dist/components/waka-points-popup/index.es.js +5 -1
  445. package/dist/components/waka-power-up/index.cjs.js +1 -1
  446. package/dist/components/waka-presence-indicator/index.cjs.js +2 -2
  447. package/dist/components/waka-presence-indicator/index.es.js +1 -1
  448. package/dist/components/waka-pricing-table/index.cjs.js +2 -2
  449. package/dist/components/waka-pricing-table/index.es.js +1 -1
  450. package/dist/components/waka-product-card/index.cjs.js +1 -1
  451. package/dist/components/waka-progress-onboarding/index.cjs.js +3 -3
  452. package/dist/components/waka-progress-onboarding/index.es.js +1 -1
  453. package/dist/components/waka-pull-to-refresh/index.cjs.js +1 -1
  454. package/dist/components/waka-qrcode/index.cjs.js +1 -1
  455. package/dist/components/waka-qrcode/index.es.js +1 -1
  456. package/dist/components/waka-query-explain/index.cjs.js +1 -1
  457. package/dist/components/waka-quest-card/index.cjs.js +2 -2
  458. package/dist/components/waka-quest-card/index.es.js +4 -1
  459. package/dist/components/waka-quota-bar/index.cjs.js +2 -2
  460. package/dist/components/waka-quota-bar/index.es.js +11 -4
  461. package/dist/components/waka-radar-score/index.cjs.js +1 -1
  462. package/dist/components/waka-radar-score/index.es.js +6 -6
  463. package/dist/components/waka-rank-badge/index.cjs.js +2 -2
  464. package/dist/components/waka-rank-badge/index.es.js +1 -1
  465. package/dist/components/waka-rating-input/index.cjs.js +2 -2
  466. package/dist/components/waka-rating-input/index.es.js +1 -1
  467. package/dist/components/waka-reaction-picker/index.cjs.js +1 -1
  468. package/dist/components/waka-reaction-picker/index.es.js +7 -4
  469. package/dist/components/waka-region-map/index.cjs.js +1 -1
  470. package/dist/components/waka-region-map/index.es.js +1 -1
  471. package/dist/components/waka-resource-gauge/index.cjs.js +2 -2
  472. package/dist/components/waka-resource-gauge/index.es.js +3 -3
  473. package/dist/components/waka-resource-pool/index.cjs.js +2 -2
  474. package/dist/components/waka-resource-pool/index.es.js +1 -1
  475. package/dist/components/waka-rich-text-editor/index.cjs.js +1 -1
  476. package/dist/components/waka-rich-text-editor/index.es.js +1 -1
  477. package/dist/components/waka-rollback-slider/index.cjs.js +2 -2
  478. package/dist/components/waka-rollback-slider/index.es.js +5 -3
  479. package/dist/components/waka-sankey-diagram/index.cjs.js +2 -2
  480. package/dist/components/waka-sankey-diagram/index.es.js +5 -5
  481. package/dist/components/waka-schedule-picker/index.cjs.js +1 -1
  482. package/dist/components/waka-schedule-picker/index.es.js +3 -2
  483. package/dist/components/waka-scratch-card/index.cjs.js +2 -2
  484. package/dist/components/waka-scratch-card/index.es.js +1 -1
  485. package/dist/components/waka-season-pass/index.cjs.js +1 -1
  486. package/dist/components/waka-secret-card/index.cjs.js +1 -1
  487. package/dist/components/waka-security-scan-result/index.cjs.js +1 -1
  488. package/dist/components/waka-security-score/index.cjs.js +2 -2
  489. package/dist/components/waka-security-score/index.es.js +5 -5
  490. package/dist/components/waka-segmented-control/index.cjs.js +1 -1
  491. package/dist/components/waka-segmented-control/index.es.js +1 -1
  492. package/dist/components/waka-server-rack/index.cjs.js +1 -1
  493. package/dist/components/waka-service-graph/index.cjs.js +1 -1
  494. package/dist/components/waka-session-manager/index.cjs.js +1 -1
  495. package/dist/components/waka-session-manager/index.es.js +3 -2
  496. package/dist/components/waka-signature-pad/index.cjs.js +1 -1
  497. package/dist/components/waka-signature-pad/index.es.js +1 -1
  498. package/dist/components/waka-skeleton-wave/index.cjs.js +1 -1
  499. package/dist/components/waka-skill-tree/index.cjs.js +2 -2
  500. package/dist/components/waka-skill-tree/index.es.js +32 -32
  501. package/dist/components/waka-sla-tracker/index.cjs.js +1 -1
  502. package/dist/components/waka-sla-tracker/index.es.js +1 -1
  503. package/dist/components/waka-slider-range/index.cjs.js +1 -1
  504. package/dist/components/waka-slider-range/index.es.js +3 -3
  505. package/dist/components/waka-spin-wheel/index.cjs.js +2 -2
  506. package/dist/components/waka-spin-wheel/index.es.js +6 -6
  507. package/dist/components/waka-spinner/index.cjs.js +1 -1
  508. package/dist/components/waka-sponsored-badge/index.cjs.js +1 -1
  509. package/dist/components/waka-sponsored-badge/index.es.js +1 -1
  510. package/dist/components/waka-sponsored-card/index.cjs.js +1 -1
  511. package/dist/components/waka-sponsored-card/index.es.js +2 -2
  512. package/dist/components/waka-sponsored-feed/index.cjs.js +1 -1
  513. package/dist/components/waka-sponsored-feed/index.es.js +2 -2
  514. package/dist/components/waka-spotlight/index.cjs.js +1 -1
  515. package/dist/components/waka-spotlight/index.es.js +2 -1
  516. package/dist/components/waka-stat/index.cjs.js +1 -1
  517. package/dist/components/waka-stat/index.es.js +1 -1
  518. package/dist/components/waka-stats-hexagon/index.cjs.js +1 -1
  519. package/dist/components/waka-stats-hexagon/index.es.js +9 -9
  520. package/dist/components/waka-status-matrix/index.cjs.js +1 -1
  521. package/dist/components/waka-status-matrix/index.es.js +1 -1
  522. package/dist/components/waka-stepper/index.cjs.js +1 -1
  523. package/dist/components/waka-stepper/index.es.js +1 -1
  524. package/dist/components/waka-streak-counter/index.cjs.js +1 -1
  525. package/dist/components/waka-success-explosion/index.cjs.js +1 -1
  526. package/dist/components/waka-swipe-card/index.cjs.js +1 -1
  527. package/dist/components/waka-swipe-card/index.es.js +2 -2
  528. package/dist/components/waka-tabs-morph/index.cjs.js +1 -1
  529. package/dist/components/waka-tabs-morph/index.es.js +1 -1
  530. package/dist/components/waka-tag-input/index.cjs.js +1 -1
  531. package/dist/components/waka-tag-input/index.es.js +3 -2
  532. package/dist/components/waka-team-banner/index.cjs.js +2 -2
  533. package/dist/components/waka-team-banner/index.es.js +1 -1
  534. package/dist/components/waka-terminal-output/index.cjs.js +2 -2
  535. package/dist/components/waka-terminal-output/index.es.js +5 -3
  536. package/dist/components/waka-test-report/index.cjs.js +1 -1
  537. package/dist/components/waka-theme-creator/index.cjs.js +1 -1
  538. package/dist/components/waka-theme-manager/index.cjs.js +1 -1
  539. package/dist/components/waka-theme-manager/index.es.js +5 -2
  540. package/dist/components/waka-thread-view/index.cjs.js +2 -2
  541. package/dist/components/waka-thread-view/index.es.js +1 -1
  542. package/dist/components/waka-tilt-card/index.cjs.js +1 -1
  543. package/dist/components/waka-tilt-card/index.es.js +8 -6
  544. package/dist/components/waka-time-picker/index.cjs.js +1 -1
  545. package/dist/components/waka-time-picker/index.es.js +10 -6
  546. package/dist/components/waka-timeline/index.cjs.js +1 -1
  547. package/dist/components/waka-timeline/index.es.js +1 -1
  548. package/dist/components/waka-tooltip-tour/index.cjs.js +3 -3
  549. package/dist/components/waka-tooltip-tour/index.es.js +53 -51
  550. package/dist/components/waka-tour-guide/index.cjs.js +2 -2
  551. package/dist/components/waka-tour-guide/index.es.js +1 -1
  552. package/dist/components/waka-tournament-bracket/index.cjs.js +2 -2
  553. package/dist/components/waka-tournament-bracket/index.es.js +1 -1
  554. package/dist/components/waka-trace-viewer/index.cjs.js +1 -1
  555. package/dist/components/waka-tree/index.cjs.js +1 -1
  556. package/dist/components/waka-tree/index.es.js +1 -1
  557. package/dist/components/waka-treemap-chart/index.cjs.js +1 -1
  558. package/dist/components/waka-treemap-chart/index.es.js +1 -1
  559. package/dist/components/waka-two-factor-setup/index.cjs.js +2 -2
  560. package/dist/components/waka-two-factor-setup/index.es.js +5 -4
  561. package/dist/components/waka-typewriter/index.cjs.js +1 -1
  562. package/dist/components/waka-typewriter/index.es.js +7 -2
  563. package/dist/components/waka-typing-indicator/index.cjs.js +2 -2
  564. package/dist/components/waka-typing-indicator/index.es.js +1 -1
  565. package/dist/components/waka-versus-card/index.cjs.js +3 -3
  566. package/dist/components/waka-versus-card/index.es.js +5 -4
  567. package/dist/components/waka-video/index.cjs.js +1 -1
  568. package/dist/components/waka-video/index.es.js +1 -1
  569. package/dist/components/waka-video-ad/index.cjs.js +1 -1
  570. package/dist/components/waka-video-ad/index.es.js +3 -3
  571. package/dist/components/waka-video-call/index.cjs.js +2 -2
  572. package/dist/components/waka-video-call/index.es.js +1 -1
  573. package/dist/components/waka-video-overlay/index.cjs.js +1 -1
  574. package/dist/components/waka-video-overlay/index.es.js +2 -2
  575. package/dist/components/waka-virtual-list/index.cjs.js +1 -1
  576. package/dist/components/waka-virtual-list/index.es.js +1 -1
  577. package/dist/components/waka-voice-message/index.cjs.js +1 -1
  578. package/dist/components/waka-voice-message/index.es.js +6 -5
  579. package/dist/components/waka-welcome-modal/index.cjs.js +2 -2
  580. package/dist/components/waka-welcome-modal/index.es.js +1 -1
  581. package/dist/components/waka-xp-bar/index.cjs.js +1 -1
  582. package/dist/components/waka-xp-bar/index.es.js +2 -2
  583. package/dist/context/admincrumb-context.cjs.js +1 -1
  584. package/dist/context/language-context.cjs.js +1 -1
  585. package/dist/context/language-context.es.js +2 -2
  586. package/dist/context/theme-context.cjs.js +1 -1
  587. package/dist/context/theme-provider.cjs.js +1 -1
  588. package/dist/context/theme-provider.es.js +9 -6
  589. package/dist/context/waka-provider.cjs.js +1 -1
  590. package/dist/context/waka-provider.es.js +57 -53
  591. package/dist/doc.cjs.js +1 -1
  592. package/dist/editor.cjs.js +1 -1
  593. package/dist/export.cjs.js +1 -1
  594. package/dist/hooks/use-toast.cjs.js +1 -1
  595. package/dist/hooks/use-translation.cjs.js +1 -1
  596. package/dist/index.cjs.js +1 -1
  597. package/dist/index.d.ts +2 -0
  598. package/dist/index.es.js +279 -278
  599. package/dist/lib/i18n.cjs.js +1 -1
  600. package/dist/lib/i18n.es.js +11 -9
  601. package/dist/locales/default-resources.cjs.js +1 -0
  602. package/dist/locales/default-resources.d.ts +155 -0
  603. package/dist/locales/default-resources.es.js +150 -0
  604. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.cjs.js +13 -13
  605. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.es.js +13 -13
  606. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.cjs.js +1 -1
  607. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.es.js +19 -19
  608. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.cjs.js +1 -1
  609. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.es.js +24 -25
  610. package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.cjs.js +1 -1
  611. package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.es.js +26 -23
  612. package/dist/rich-text.cjs.js +1 -1
  613. package/dist/ui.css +1 -1
  614. package/dist/utils/cn.cjs.js +1 -1
  615. package/dist/utils/datetime-helpers.cjs.js +1 -1
  616. package/dist/utils/theme-loader.cjs.js +1 -1
  617. package/dist/utils/tweak.cjs.js +1 -1
  618. package/package.json +28 -27
  619. package/src/components/DataTable/DataTable.tsx +2 -0
  620. package/src/components/DataTable/DataTablePagination.tsx +28 -8
  621. package/src/components/DataTable/hooks/useDataTable.ts +13 -0
  622. package/src/components/editor/blocks/waka-diagram-block.tsx +7 -36
@@ -5,36 +5,15 @@ import * as t from "react";
5
5
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
6
  import i from "dompurify";
7
7
  //#region src/components/editor/blocks/waka-diagram-block.tsx
8
- var a = "diagram", o = new Set([
9
- "script",
10
- "iframe",
11
- "object",
12
- "embed",
13
- "link",
14
- "meta",
15
- "base",
16
- "form"
17
- ]), s = new Set(["href", "xlink:href"]), c = !1;
18
- function l() {
19
- c || (c = !0, i.addHook("uponSanitizeElement", (e, t) => {
20
- if (!t?.tagName) return;
21
- let n = t.tagName.toLowerCase();
22
- if (!o.has(n)) return;
23
- let r = e.parentNode;
24
- for (; r;) {
25
- if (r.nodeName?.toLowerCase?.() === "foreignobject") {
26
- e.remove?.();
27
- return;
28
- }
29
- r = r.parentNode;
30
- }
31
- }), i.addHook("uponSanitizeAttribute", (e, t) => {
8
+ var a = "diagram", o = /* @__PURE__ */ new Set(["href", "xlink:href"]), s = !1;
9
+ function c() {
10
+ s || (s = !0, i.addHook("uponSanitizeAttribute", (e, t) => {
32
11
  if (!t?.attrName) return;
33
12
  let n = t.attrName.toLowerCase();
34
- s.has(n) && ((t.attrValue || "").trim().startsWith("#") || (t.keepAttr = !1));
13
+ o.has(n) && ((t.attrValue || "").trim().startsWith("#") || (t.keepAttr = !1));
35
14
  }));
36
15
  }
37
- var u = {
16
+ var l = {
38
17
  USE_PROFILES: {
39
18
  svg: !0,
40
19
  svgFilters: !0,
@@ -61,14 +40,16 @@ var u = {
61
40
  "object",
62
41
  "embed",
63
42
  "link",
64
- "meta"
43
+ "meta",
44
+ "base",
45
+ "form"
65
46
  ],
66
47
  FORBID_ATTR: [/^on/i]
67
48
  };
68
- function d(e) {
69
- return l(), i.sanitize(e, u);
49
+ function u(e) {
50
+ return c(), i.sanitize(e, l);
70
51
  }
71
- var f = {
52
+ var d = {
72
53
  mermaid: {
73
54
  label: "Mermaid",
74
55
  color: "text-pink-600 dark:text-pink-400 bg-pink-50 dark:bg-pink-500/10",
@@ -85,16 +66,16 @@ var f = {
85
66
  icon: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"
86
67
  }
87
68
  };
88
- function p({ attributes: i, children: a, element: o, className: s, onRender: c }) {
89
- let l = o, u = l?.syntax || "mermaid", p = l?.source || "", m = f[u], [h, g] = t.useState(!1), [_, v] = t.useState(null), [y, b] = t.useState(!c), x = t.useRef(null);
69
+ function f({ attributes: i, children: a, element: o, className: s, onRender: c }) {
70
+ let l = o, f = l?.syntax || "mermaid", p = l?.source || "", m = d[f], [h, g] = t.useState(!1), [_, v] = t.useState(null), [y, b] = t.useState(!c), x = t.useRef(null);
90
71
  return t.useEffect(() => {
91
72
  if (!p || !c || y) return;
92
73
  let e = !1, t = setTimeout(async () => {
93
74
  g(!0), v(null);
94
75
  try {
95
- let t = await c(p, u);
76
+ let t = await c(p, f);
96
77
  if (!e && x.current) {
97
- let e = d(t);
78
+ let e = u(t);
98
79
  x.current.textContent = "";
99
80
  let n = new DOMParser().parseFromString(e, "text/html"), r = document.createDocumentFragment();
100
81
  Array.from(n.body.childNodes).forEach((e) => {
@@ -112,7 +93,7 @@ function p({ attributes: i, children: a, element: o, className: s, onRender: c }
112
93
  };
113
94
  }, [
114
95
  p,
115
- u,
96
+ f,
116
97
  c,
117
98
  y
118
99
  ]), /* @__PURE__ */ r("div", {
@@ -248,8 +229,8 @@ function p({ attributes: i, children: a, element: o, className: s, onRender: c }
248
229
  ]
249
230
  });
250
231
  }
251
- p.displayName = "WakaDiagramBlock";
252
- function m(e) {
232
+ f.displayName = "WakaDiagramBlock";
233
+ function p(e) {
253
234
  return [{
254
235
  type: a,
255
236
  syntax: e?.syntax || "mermaid",
@@ -258,7 +239,7 @@ function m(e) {
258
239
  children: [{ text: "" }]
259
240
  }];
260
241
  }
261
- async function h(e) {
242
+ async function m(e) {
262
243
  try {
263
244
  let { createPlatePlugin: t } = await import("platejs/react");
264
245
  return t({
@@ -267,7 +248,7 @@ async function h(e) {
267
248
  isElement: !0,
268
249
  isVoid: !0,
269
250
  type: a,
270
- component: (t) => /* @__PURE__ */ n(p, {
251
+ component: (t) => /* @__PURE__ */ n(f, {
271
252
  ...t,
272
253
  onRender: e
273
254
  })
@@ -278,4 +259,4 @@ async function h(e) {
278
259
  }
279
260
  }
280
261
  //#endregion
281
- export { a as DIAGRAM_BLOCK_TYPE, p as WakaDiagramBlock, m as createDiagramNodes, h as createDiagramPlugin };
262
+ export { a as DIAGRAM_BLOCK_TYPE, f as WakaDiagramBlock, p as createDiagramNodes, m as createDiagramPlugin, u as sanitizeDiagramMarkup };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../../utils/cn.cjs.js`),n=require(`../../../utils/security.cjs.js`);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);var a=`embed`,o={figma:{label:`Figma`,icon:`M12 2a4 4 0 00-4 4v4a4 4 0 004-4V2zm0 12a4 4 0 01-4 4v2h4v-6zm8-4a4 4 0 01-4 4H12v-8h4a4 4 0 014 4z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>e.includes(`figma.com`)?`https://www.figma.com/embed?embed_host=wakastart&url=${encodeURIComponent(e)}`:null,defaultAspect:`16/9`,domain:`figma.com`},youtube:{label:`YouTube`,icon:`M19.615 3.184c-3.604-.246-11.631-.245-15.23 0C.488 3.45.029 5.804 0 12c.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0C23.512 20.55 23.971 18.196 24 12c-.029-6.185-.484-8.549-4.385-8.816zM9 16V8l8 4-8 4z`,color:`text-red-600 dark:text-red-400`,bgColor:`bg-red-50 dark:bg-red-500/10`,transform:e=>{let t=e.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`youtube.com`},vimeo:{label:`Vimeo`,icon:`M22.875 10.063c-.098 2.141-1.592 5.075-4.483 8.8-2.988 3.891-5.517 5.836-7.588 5.836-1.282 0-2.367-1.184-3.258-3.553L6.14 15.15c-.589-2.369-1.221-3.553-1.896-3.553-.147 0-.663.31-1.546.928l-.925-1.19c.973-.855 1.932-1.71 2.877-2.565 1.297-1.12 2.27-1.71 2.921-1.77 1.534-.147 2.479.903 2.834 3.148.384 2.422.65 3.928.801 4.519.445 2.022.934 3.033 1.468 3.033.414 0 1.037-.656 1.868-1.967.831-1.311 1.276-2.31 1.336-2.998.119-1.14-.328-1.71-1.342-1.71-.478 0-.97.109-1.477.327.981-3.212 2.855-4.773 5.625-4.684 2.054.059 3.024 1.394 2.908 4.003z`,color:`text-sky-600 dark:text-sky-400`,bgColor:`bg-sky-50 dark:bg-sky-500/10`,transform:e=>{let t=e.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null},defaultAspect:`16/9`,domain:`vimeo.com`},codesandbox:{label:`CodeSandbox`,icon:`M2 6l10-4 10 4v12l-10 4L2 18V6zm10 2L4 4v8l8 4V8zm8-4l-8 4v8l8-4V4z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codesandbox\.io\/(?:s|p)\/([a-zA-Z0-9-]+)/);return t?`https://codesandbox.io/embed/${t[1]}?fontsize=14&hidenavigation=1&theme=dark`:null},defaultAspect:`16/9`,domain:`codesandbox.io`},codepen:{label:`CodePen`,icon:`M12 2L2 8.5v7L12 22l10-6.5v-7L12 2zm0 3.311L18.26 9 12 12.689 5.74 9 12 5.311zM4 10.289l6 3.9v5.522l-6-3.9v-5.522zm8 9.422v-5.522l6-3.9v5.522l-6 3.9z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codepen\.io\/([^/]+)\/pen\/([a-zA-Z0-9]+)/);return t?`https://codepen.io/${t[1]}/embed/${t[2]}?default-tab=result&theme-id=dark`:null},defaultAspect:`16/9`,domain:`codepen.io`},stackblitz:{label:`StackBlitz`,icon:`M13 10V3L4 14h7v7l9-11h-7z`,color:`text-blue-600 dark:text-blue-400`,bgColor:`bg-blue-50 dark:bg-blue-500/10`,transform:e=>e.includes(`stackblitz.com`)?e.replace(`stackblitz.com/edit`,`stackblitz.com/embed`):null,defaultAspect:`16/9`,domain:`stackblitz.com`},loom:{label:`Loom`,icon:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>{let t=e.match(/loom\.com\/share\/([a-zA-Z0-9]+)/);return t?`https://www.loom.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`loom.com`},miro:{label:`Miro`,icon:`M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1z`,color:`text-yellow-600 dark:text-yellow-400`,bgColor:`bg-yellow-50 dark:bg-yellow-500/10`,transform:e=>{let t=e.match(/miro\.com\/app\/board\/([^/?]+)/);return t?`https://miro.com/app/live-embed/${t[1]}/`:null},defaultAspect:`16/9`,domain:`miro.com`},notion:{label:`Notion`,icon:`M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm4 2v4h8V6H8zm0 6v2h8v-2H8zm0 4v2h5v-2H8z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`16/9`,domain:`notion.so`},"github-gist":{label:`GitHub Gist`,icon:`M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`4/3`,domain:`gist.github.com`},generic:{label:`Embed`,icon:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`,color:`text-muted-foreground`,bgColor:`bg-muted`,transform:()=>null,defaultAspect:`16/9`,domain:``}};function s(e){let t=e.toLowerCase();return t.includes(`figma.com`)?`figma`:t.includes(`youtube.com`)||t.includes(`youtu.be`)?`youtube`:t.includes(`vimeo.com`)?`vimeo`:t.includes(`codesandbox.io`)?`codesandbox`:t.includes(`codepen.io`)?`codepen`:t.includes(`stackblitz.com`)?`stackblitz`:t.includes(`loom.com`)?`loom`:t.includes(`miro.com`)?`miro`:t.includes(`notion.so`)?`notion`:t.includes(`gist.github.com`)?`github-gist`:`generic`}function c(e,t){return o[t].transform(e)||e}function l({attributes:e,children:a,element:s,className:c}){let l=s,u=o[l?.provider||`generic`],d=l?.embedUrl||``,f=l?.aspectRatio||u.defaultAspect,p=r.useMemo(()=>d?n.sanitizeUrl(d):``,[d]),[m,h]=r.useState(!1),[g,_]=r.useState(!1);return(0,i.jsxs)(`div`,{...e,contentEditable:!1,className:t.cn(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,c),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-muted/30 border-b border-border`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`svg`,{className:t.cn(`h-4 w-4`,u.color),viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,i.jsx)(`path`,{d:u.icon})}),(0,i.jsx)(`span`,{className:t.cn(`text-[10px] font-bold uppercase tracking-wider`,u.color),children:u.label}),l?.title&&(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground ml-1 truncate max-w-[300px]`,children:l.title})]}),l?.url&&(0,i.jsxs)(`a`,{href:n.sanitizeUrl(l.url),target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-primary hover:underline flex items-center gap-1`,children:[`Open`,(0,i.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})})]})]}),(0,i.jsxs)(`div`,{className:`relative bg-muted/10`,style:{aspectRatio:f,maxHeight:l?.maxHeight?`${l.maxHeight}px`:void 0},children:[!m&&!g&&p&&(0,i.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-muted/20`,children:(0,i.jsxs)(`svg`,{className:`h-8 w-8 animate-spin text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,i.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,i.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]})}),g&&(0,i.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center bg-muted/10 text-muted-foreground`,children:[(0,i.jsx)(`svg`,{className:`h-8 w-8 mb-2`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z`})}),(0,i.jsx)(`span`,{className:`text-xs`,children:`Failed to load embed`})]}),!p&&(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,i.jsx)(`svg`,{className:`h-10 w-10 mb-3 text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1`})}),(0,i.jsx)(`span`,{className:`text-sm`,children:`Paste a URL to embed content`}),(0,i.jsx)(`span`,{className:`text-[10px] mt-1 text-muted-foreground/60`,children:`Supports Figma, YouTube, CodeSandbox, Loom, and more`})]}),p&&(0,i.jsx)(`iframe`,{src:p,title:l?.title||`${u.label} embed`,className:t.cn(`w-full h-full border-0`,!m&&`opacity-0`),loading:`lazy`,allowFullScreen:!0,sandbox:`allow-scripts allow-same-origin allow-popups allow-forms`,onLoad:()=>h(!0),onError:()=>_(!0)})]}),(0,i.jsx)(`div`,{className:`hidden`,children:a})]})}l.displayName=`WakaEmbedBlock`;function u(e,t){let n=s(e);return[{type:a,url:e,provider:n,embedUrl:c(e,n),title:t?.title,aspectRatio:t?.aspectRatio,maxHeight:t?.maxHeight,children:[{text:``}]}]}async function d(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:a,node:{isElement:!0,isVoid:!0,type:a,component:l}})}catch{return console.warn(`[WakaEmbedBlock] platejs not installed`),null}}exports.EMBED_BLOCK_TYPE=a,exports.WakaEmbedBlock=l,exports.createEmbedNodes=u,exports.createEmbedPlugin=d,exports.detectEmbedProvider=s,exports.resolveEmbedUrl=c;
1
+ "use client";"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../../utils/cn.cjs.js"),n=require("../../../utils/security.cjs.js");let r=require("react");r=e.__toESM(r);let i=require("react/jsx-runtime");var a=`embed`,o={figma:{label:`Figma`,icon:`M12 2a4 4 0 00-4 4v4a4 4 0 004-4V2zm0 12a4 4 0 01-4 4v2h4v-6zm8-4a4 4 0 01-4 4H12v-8h4a4 4 0 014 4z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>e.includes(`figma.com`)?`https://www.figma.com/embed?embed_host=wakastart&url=${encodeURIComponent(e)}`:null,defaultAspect:`16/9`,domain:`figma.com`},youtube:{label:`YouTube`,icon:`M19.615 3.184c-3.604-.246-11.631-.245-15.23 0C.488 3.45.029 5.804 0 12c.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0C23.512 20.55 23.971 18.196 24 12c-.029-6.185-.484-8.549-4.385-8.816zM9 16V8l8 4-8 4z`,color:`text-red-600 dark:text-red-400`,bgColor:`bg-red-50 dark:bg-red-500/10`,transform:e=>{let t=e.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`youtube.com`},vimeo:{label:`Vimeo`,icon:`M22.875 10.063c-.098 2.141-1.592 5.075-4.483 8.8-2.988 3.891-5.517 5.836-7.588 5.836-1.282 0-2.367-1.184-3.258-3.553L6.14 15.15c-.589-2.369-1.221-3.553-1.896-3.553-.147 0-.663.31-1.546.928l-.925-1.19c.973-.855 1.932-1.71 2.877-2.565 1.297-1.12 2.27-1.71 2.921-1.77 1.534-.147 2.479.903 2.834 3.148.384 2.422.65 3.928.801 4.519.445 2.022.934 3.033 1.468 3.033.414 0 1.037-.656 1.868-1.967.831-1.311 1.276-2.31 1.336-2.998.119-1.14-.328-1.71-1.342-1.71-.478 0-.97.109-1.477.327.981-3.212 2.855-4.773 5.625-4.684 2.054.059 3.024 1.394 2.908 4.003z`,color:`text-sky-600 dark:text-sky-400`,bgColor:`bg-sky-50 dark:bg-sky-500/10`,transform:e=>{let t=e.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null},defaultAspect:`16/9`,domain:`vimeo.com`},codesandbox:{label:`CodeSandbox`,icon:`M2 6l10-4 10 4v12l-10 4L2 18V6zm10 2L4 4v8l8 4V8zm8-4l-8 4v8l8-4V4z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codesandbox\.io\/(?:s|p)\/([a-zA-Z0-9-]+)/);return t?`https://codesandbox.io/embed/${t[1]}?fontsize=14&hidenavigation=1&theme=dark`:null},defaultAspect:`16/9`,domain:`codesandbox.io`},codepen:{label:`CodePen`,icon:`M12 2L2 8.5v7L12 22l10-6.5v-7L12 2zm0 3.311L18.26 9 12 12.689 5.74 9 12 5.311zM4 10.289l6 3.9v5.522l-6-3.9v-5.522zm8 9.422v-5.522l6-3.9v5.522l-6 3.9z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codepen\.io\/([^/]+)\/pen\/([a-zA-Z0-9]+)/);return t?`https://codepen.io/${t[1]}/embed/${t[2]}?default-tab=result&theme-id=dark`:null},defaultAspect:`16/9`,domain:`codepen.io`},stackblitz:{label:`StackBlitz`,icon:`M13 10V3L4 14h7v7l9-11h-7z`,color:`text-blue-600 dark:text-blue-400`,bgColor:`bg-blue-50 dark:bg-blue-500/10`,transform:e=>e.includes(`stackblitz.com`)?e.replace(`stackblitz.com/edit`,`stackblitz.com/embed`):null,defaultAspect:`16/9`,domain:`stackblitz.com`},loom:{label:`Loom`,icon:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>{let t=e.match(/loom\.com\/share\/([a-zA-Z0-9]+)/);return t?`https://www.loom.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`loom.com`},miro:{label:`Miro`,icon:`M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1z`,color:`text-yellow-600 dark:text-yellow-400`,bgColor:`bg-yellow-50 dark:bg-yellow-500/10`,transform:e=>{let t=e.match(/miro\.com\/app\/board\/([^/?]+)/);return t?`https://miro.com/app/live-embed/${t[1]}/`:null},defaultAspect:`16/9`,domain:`miro.com`},notion:{label:`Notion`,icon:`M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm4 2v4h8V6H8zm0 6v2h8v-2H8zm0 4v2h5v-2H8z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`16/9`,domain:`notion.so`},"github-gist":{label:`GitHub Gist`,icon:`M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`4/3`,domain:`gist.github.com`},generic:{label:`Embed`,icon:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`,color:`text-muted-foreground`,bgColor:`bg-muted`,transform:()=>null,defaultAspect:`16/9`,domain:``}};function s(e){let t=e.toLowerCase();return t.includes(`figma.com`)?`figma`:t.includes(`youtube.com`)||t.includes(`youtu.be`)?`youtube`:t.includes(`vimeo.com`)?`vimeo`:t.includes(`codesandbox.io`)?`codesandbox`:t.includes(`codepen.io`)?`codepen`:t.includes(`stackblitz.com`)?`stackblitz`:t.includes(`loom.com`)?`loom`:t.includes(`miro.com`)?`miro`:t.includes(`notion.so`)?`notion`:t.includes(`gist.github.com`)?`github-gist`:`generic`}function c(e,t){return o[t].transform(e)||e}function l({attributes:e,children:a,element:s,className:c}){let l=s,u=o[l?.provider||`generic`],d=l?.embedUrl||``,f=l?.aspectRatio||u.defaultAspect,p=r.useMemo(()=>d?n.sanitizeUrl(d):``,[d]),[m,h]=r.useState(!1),[g,_]=r.useState(!1);return(0,i.jsxs)(`div`,{...e,contentEditable:!1,className:t.cn(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,c),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-muted/30 border-b border-border`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`svg`,{className:t.cn(`h-4 w-4`,u.color),viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,i.jsx)(`path`,{d:u.icon})}),(0,i.jsx)(`span`,{className:t.cn(`text-[10px] font-bold uppercase tracking-wider`,u.color),children:u.label}),l?.title&&(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground ml-1 truncate max-w-[300px]`,children:l.title})]}),l?.url&&(0,i.jsxs)(`a`,{href:n.sanitizeUrl(l.url),target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-primary hover:underline flex items-center gap-1`,children:[`Open`,(0,i.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})})]})]}),(0,i.jsxs)(`div`,{className:`relative bg-muted/10`,style:{aspectRatio:f,maxHeight:l?.maxHeight?`${l.maxHeight}px`:void 0},children:[!m&&!g&&p&&(0,i.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-muted/20`,children:(0,i.jsxs)(`svg`,{className:`h-8 w-8 animate-spin text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,i.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,i.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]})}),g&&(0,i.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center bg-muted/10 text-muted-foreground`,children:[(0,i.jsx)(`svg`,{className:`h-8 w-8 mb-2`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z`})}),(0,i.jsx)(`span`,{className:`text-xs`,children:`Failed to load embed`})]}),!p&&(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,i.jsx)(`svg`,{className:`h-10 w-10 mb-3 text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1`})}),(0,i.jsx)(`span`,{className:`text-sm`,children:`Paste a URL to embed content`}),(0,i.jsx)(`span`,{className:`text-[10px] mt-1 text-muted-foreground/60`,children:`Supports Figma, YouTube, CodeSandbox, Loom, and more`})]}),p&&(0,i.jsx)(`iframe`,{src:p,title:l?.title||`${u.label} embed`,className:t.cn(`w-full h-full border-0`,!m&&`opacity-0`),loading:`lazy`,allowFullScreen:!0,sandbox:`allow-scripts allow-same-origin allow-popups allow-forms`,onLoad:()=>h(!0),onError:()=>_(!0)})]}),(0,i.jsx)(`div`,{className:`hidden`,children:a})]})}l.displayName=`WakaEmbedBlock`;function u(e,t){let n=s(e);return[{type:a,url:e,provider:n,embedUrl:c(e,n),title:t?.title,aspectRatio:t?.aspectRatio,maxHeight:t?.maxHeight,children:[{text:``}]}]}async function d(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:a,node:{isElement:!0,isVoid:!0,type:a,component:l}})}catch{return console.warn(`[WakaEmbedBlock] platejs not installed`),null}}exports.EMBED_BLOCK_TYPE=a,exports.WakaEmbedBlock=l,exports.createEmbedNodes=u,exports.createEmbedPlugin=d,exports.detectEmbedProvider=s,exports.resolveEmbedUrl=c;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../../utils/cn.cjs.js`),n=require(`../waka-slash-menu.cjs.js`),r=require(`./waka-user-story-block.cjs.js`),i=require(`./waka-acceptance-criteria-block.cjs.js`),a=require(`./waka-api-endpoint-block.cjs.js`),o=require(`./waka-diagram-block.cjs.js`),s=require(`./waka-ai-assist-block.cjs.js`),c=require(`./waka-version-diff-block.cjs.js`),l=require(`./waka-embed-block.cjs.js`),u=require(`./waka-code-playground-block.cjs.js`),d=require(`./waka-comment-thread-block.cjs.js`);let f=require(`react`);f=e.__toESM(f);let p=require(`lucide-react`),m=require(`react/jsx-runtime`);var h=[{key:`user-story`,label:`User Story`,description:`Structured user story (As a / I want / So that)`,icon:p.Users,group:`WakaStart Blocks`,keywords:[`user`,`story`,`agile`,`requirement`,`persona`],isCustom:!0,action:e=>{e.insertNodes(r.createUserStoryNodes())}},{key:`acceptance-criteria`,label:`Acceptance Criteria`,description:`Gherkin-format criteria (Given / When / Then)`,icon:p.CheckCircle2,group:`WakaStart Blocks`,keywords:[`acceptance`,`criteria`,`gherkin`,`given`,`when`,`then`,`test`],isCustom:!0,action:e=>{e.insertNodes(i.createAcceptanceCriteriaNodes())}},{key:`api-endpoint`,label:`API Endpoint`,description:`REST API documentation (method, route, body, response)`,icon:p.Zap,group:`WakaStart Blocks`,keywords:[`api`,`endpoint`,`rest`,`route`,`get`,`post`,`put`,`delete`],isCustom:!0,action:e=>{e.insertNodes(a.createApiEndpointNodes())}},{key:`diagram`,label:`Diagram`,description:`Mermaid / PlantUML diagram with live preview`,icon:p.GitBranch,group:`WakaStart Blocks`,keywords:[`diagram`,`mermaid`,`plantuml`,`flowchart`,`sequence`,`graph`],isCustom:!0,action:e=>{e.insertNodes(o.createDiagramNodes())}},{key:`ai-assist`,label:`AI Assistant`,description:`Ask the AI to generate content for your document`,icon:p.Sparkles,group:`WakaStart Blocks`,keywords:[`ai`,`ia`,`assistant`,`generate`,`write`,`help`,`claude`],isCustom:!0,action:e=>{e.insertNodes(s.createAiAssistNodes())}},{key:`version-diff`,label:`Version Diff`,description:`Compare two versions of text with visual diff`,icon:p.GitCompare,group:`WakaStart Blocks`,keywords:[`diff`,`version`,`compare`,`change`,`history`,`git`],isCustom:!0,action:e=>{e.insertNodes(c.createVersionDiffNodes())}},{key:`embed`,label:`Embed`,description:`Embed external content (Figma, YouTube, CodeSandbox...)`,icon:p.ExternalLink,group:`WakaStart Blocks`,keywords:[`embed`,`figma`,`youtube`,`codesandbox`,`loom`,`iframe`,`video`],isCustom:!0,action:e=>{e.insertNodes(l.createEmbedNodes(``))}},{key:`code-playground`,label:`Code Playground`,description:`Executable code block with console output`,icon:p.Terminal,group:`WakaStart Blocks`,keywords:[`code`,`playground`,`run`,`execute`,`terminal`,`console`,`sandbox`],isCustom:!0,action:e=>{e.insertNodes(u.createCodePlaygroundNodes())}},{key:`comment-thread`,label:`Comment Thread`,description:`Inline discussion thread (like Google Docs)`,icon:p.MessageSquare,group:`WakaStart Blocks`,keywords:[`comment`,`thread`,`discussion`,`review`,`feedback`,`note`],isCustom:!0,action:e=>{e.insertNodes(d.createCommentThreadNodes())}}];function g(e){return[...n.DEFAULT_SLASH_COMMANDS.map(e=>({...e,isCustom:!1})),...h,...e||[]]}function _({commands:e,query:n=``,onSelect:r,activeIndex:i,onActiveIndexChange:a,className:o}){let s=f.useMemo(()=>e||g(),[e]),[c,l]=f.useState(0),u=i??c,d=a||l,p=f.useMemo(()=>{if(!n)return s;let e=n.toLowerCase();return s.filter(t=>t.label.toLowerCase().includes(e)||t.key.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[s,n]),h=f.useMemo(()=>{let e=new Map;for(let t of p){let n=t.group||`Other`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[p]);f.useEffect(()=>d(0),[n]);let _=f.useCallback(e=>{e.key===`ArrowDown`?(e.preventDefault(),d(Math.min(u+1,p.length-1))):e.key===`ArrowUp`?(e.preventDefault(),d(Math.max(u-1,0))):e.key===`Enter`&&p[u]&&(e.preventDefault(),r?.(p[u]))},[p,u,r,d]);return(0,m.jsxs)(`div`,{className:t.cn(`w-80 max-h-96 overflow-y-auto`,`rounded-lg border bg-popover shadow-xl`,`p-1`,o),role:`listbox`,onKeyDown:_,"aria-label":`Slash commands`,children:[p.length===0&&(0,m.jsxs)(`div`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:[`No blocks found for "`,n,`"`]}),Array.from(h.entries()).map(([e,n])=>(0,m.jsxs)(`div`,{className:`mb-1`,children:[(0,m.jsxs)(`div`,{className:`px-2 py-1.5 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/70 flex items-center gap-2`,children:[e,e===`WakaStart Blocks`&&(0,m.jsx)(`span`,{className:`px-1 py-0.5 rounded bg-primary/10 text-primary text-[8px] font-bold normal-case tracking-normal`,children:`Custom`})]}),n.map(e=>{let n=p.indexOf(e),i=e.icon;return(0,m.jsxs)(`button`,{role:`option`,"aria-selected":n===u,className:t.cn(`flex w-full items-center gap-3 rounded-md px-2 py-2 text-left`,`text-sm transition-colors cursor-pointer`,n===u?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),onMouseEnter:()=>d(n),onClick:()=>r?.(e),children:[(0,m.jsx)(`div`,{className:t.cn(`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border`,e.isCustom?`border-primary/20 bg-primary/5`:`border-border bg-background`),children:(0,m.jsx)(i,{className:`h-4 w-4`})}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-medium text-sm`,children:e.label}),e.isCustom&&(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary flex-shrink-0`})]}),e.description&&(0,m.jsx)(`div`,{className:`text-[11px] text-muted-foreground truncate mt-0.5`,children:e.description})]})]},e.key)})]},e))]})}_.displayName=`WakaSlashMenuBlock`;async function v(e){try{let{SlashPlugin:t,SlashInputPlugin:n}=await import(`@platejs/combobox/react`),r=g(e);return[t.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/,rules:r.map(e=>({key:e.key,text:e.label,keywords:e.keywords,onSelect:e.action}))}}),n]}catch{return console.warn(`[WakaSlashMenuBlock] @platejs/combobox not installed, slash commands disabled`),[]}}exports.WAKA_BLOCK_COMMANDS=h,exports.WakaSlashMenuBlock=_,exports.createWakaSlashPlugins=v,exports.getAllWakaSlashCommands=g;
1
+ "use client";"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../../utils/cn.cjs.js"),n=require("../waka-slash-menu.cjs.js"),r=require("./waka-user-story-block.cjs.js"),i=require("./waka-acceptance-criteria-block.cjs.js"),a=require("./waka-api-endpoint-block.cjs.js"),o=require("./waka-diagram-block.cjs.js"),s=require("./waka-ai-assist-block.cjs.js"),c=require("./waka-version-diff-block.cjs.js"),l=require("./waka-embed-block.cjs.js"),u=require("./waka-code-playground-block.cjs.js"),d=require("./waka-comment-thread-block.cjs.js");let f=require("react");f=e.__toESM(f);let p=require("lucide-react"),m=require("react/jsx-runtime");var h=[{key:`user-story`,label:`User Story`,description:`Structured user story (As a / I want / So that)`,icon:p.Users,group:`WakaStart Blocks`,keywords:[`user`,`story`,`agile`,`requirement`,`persona`],isCustom:!0,action:e=>{e.insertNodes(r.createUserStoryNodes())}},{key:`acceptance-criteria`,label:`Acceptance Criteria`,description:`Gherkin-format criteria (Given / When / Then)`,icon:p.CheckCircle2,group:`WakaStart Blocks`,keywords:[`acceptance`,`criteria`,`gherkin`,`given`,`when`,`then`,`test`],isCustom:!0,action:e=>{e.insertNodes(i.createAcceptanceCriteriaNodes())}},{key:`api-endpoint`,label:`API Endpoint`,description:`REST API documentation (method, route, body, response)`,icon:p.Zap,group:`WakaStart Blocks`,keywords:[`api`,`endpoint`,`rest`,`route`,`get`,`post`,`put`,`delete`],isCustom:!0,action:e=>{e.insertNodes(a.createApiEndpointNodes())}},{key:`diagram`,label:`Diagram`,description:`Mermaid / PlantUML diagram with live preview`,icon:p.GitBranch,group:`WakaStart Blocks`,keywords:[`diagram`,`mermaid`,`plantuml`,`flowchart`,`sequence`,`graph`],isCustom:!0,action:e=>{e.insertNodes(o.createDiagramNodes())}},{key:`ai-assist`,label:`AI Assistant`,description:`Ask the AI to generate content for your document`,icon:p.Sparkles,group:`WakaStart Blocks`,keywords:[`ai`,`ia`,`assistant`,`generate`,`write`,`help`,`claude`],isCustom:!0,action:e=>{e.insertNodes(s.createAiAssistNodes())}},{key:`version-diff`,label:`Version Diff`,description:`Compare two versions of text with visual diff`,icon:p.GitCompare,group:`WakaStart Blocks`,keywords:[`diff`,`version`,`compare`,`change`,`history`,`git`],isCustom:!0,action:e=>{e.insertNodes(c.createVersionDiffNodes())}},{key:`embed`,label:`Embed`,description:`Embed external content (Figma, YouTube, CodeSandbox...)`,icon:p.ExternalLink,group:`WakaStart Blocks`,keywords:[`embed`,`figma`,`youtube`,`codesandbox`,`loom`,`iframe`,`video`],isCustom:!0,action:e=>{e.insertNodes(l.createEmbedNodes(``))}},{key:`code-playground`,label:`Code Playground`,description:`Executable code block with console output`,icon:p.Terminal,group:`WakaStart Blocks`,keywords:[`code`,`playground`,`run`,`execute`,`terminal`,`console`,`sandbox`],isCustom:!0,action:e=>{e.insertNodes(u.createCodePlaygroundNodes())}},{key:`comment-thread`,label:`Comment Thread`,description:`Inline discussion thread (like Google Docs)`,icon:p.MessageSquare,group:`WakaStart Blocks`,keywords:[`comment`,`thread`,`discussion`,`review`,`feedback`,`note`],isCustom:!0,action:e=>{e.insertNodes(d.createCommentThreadNodes())}}];function g(e){return[...n.DEFAULT_SLASH_COMMANDS.map(e=>({...e,isCustom:!1})),...h,...e||[]]}function _({commands:e,query:n=``,onSelect:r,activeIndex:i,onActiveIndexChange:a,className:o}){let s=f.useMemo(()=>e||g(),[e]),[c,l]=f.useState(0),u=i??c,d=a||l,p=f.useMemo(()=>{if(!n)return s;let e=n.toLowerCase();return s.filter(t=>t.label.toLowerCase().includes(e)||t.key.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[s,n]),h=f.useMemo(()=>{let e=new Map;for(let t of p){let n=t.group||`Other`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[p]);f.useEffect(()=>d(0),[n]);let _=f.useCallback(e=>{e.key===`ArrowDown`?(e.preventDefault(),d(Math.min(u+1,p.length-1))):e.key===`ArrowUp`?(e.preventDefault(),d(Math.max(u-1,0))):e.key===`Enter`&&p[u]&&(e.preventDefault(),r?.(p[u]))},[p,u,r,d]);return(0,m.jsxs)(`div`,{className:t.cn(`w-80 max-h-96 overflow-y-auto`,`rounded-lg border bg-popover shadow-xl`,`p-1`,o),role:`listbox`,onKeyDown:_,"aria-label":`Slash commands`,children:[p.length===0&&(0,m.jsxs)(`div`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:[`No blocks found for "`,n,`"`]}),Array.from(h.entries()).map(([e,n])=>(0,m.jsxs)(`div`,{className:`mb-1`,children:[(0,m.jsxs)(`div`,{className:`px-2 py-1.5 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/70 flex items-center gap-2`,children:[e,e===`WakaStart Blocks`&&(0,m.jsx)(`span`,{className:`px-1 py-0.5 rounded bg-primary/10 text-primary text-[8px] font-bold normal-case tracking-normal`,children:`Custom`})]}),n.map(e=>{let n=p.indexOf(e),i=e.icon;return(0,m.jsxs)(`button`,{role:`option`,"aria-selected":n===u,className:t.cn(`flex w-full items-center gap-3 rounded-md px-2 py-2 text-left`,`text-sm transition-colors cursor-pointer`,n===u?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),onMouseEnter:()=>d(n),onClick:()=>r?.(e),children:[(0,m.jsx)(`div`,{className:t.cn(`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border`,e.isCustom?`border-primary/20 bg-primary/5`:`border-border bg-background`),children:(0,m.jsx)(i,{className:`h-4 w-4`})}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-medium text-sm`,children:e.label}),e.isCustom&&(0,m.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary flex-shrink-0`})]}),e.description&&(0,m.jsx)(`div`,{className:`text-[11px] text-muted-foreground truncate mt-0.5`,children:e.description})]})]},e.key)})]},e))]})}_.displayName=`WakaSlashMenuBlock`;async function v(e){try{let{SlashPlugin:t,SlashInputPlugin:n}=await import(`@platejs/combobox/react`),r=g(e);return[t.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/,rules:r.map(e=>({key:e.key,text:e.label,keywords:e.keywords,onSelect:e.action}))}}),n]}catch{return console.warn(`[WakaSlashMenuBlock] @platejs/combobox not installed, slash commands disabled`),[]}}exports.WAKA_BLOCK_COMMANDS=h,exports.WakaSlashMenuBlock=_,exports.createWakaSlashPlugins=v,exports.getAllWakaSlashCommands=g;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);var i=`user_story`,a={must:{label:`Must Have`,color:`text-red-700 dark:text-red-400`,bg:`bg-red-50 dark:bg-red-500/10`},should:{label:`Should Have`,color:`text-amber-700 dark:text-amber-400`,bg:`bg-amber-50 dark:bg-amber-500/10`},could:{label:`Could Have`,color:`text-blue-700 dark:text-blue-400`,bg:`bg-blue-50 dark:bg-blue-500/10`},wont:{label:`Won't Have`,color:`text-gray-500 dark:text-gray-400`,bg:`bg-gray-50 dark:bg-gray-500/10`}};function o({label:e,icon:n,value:i,placeholder:a,readOnly:o,onChange:s}){return(0,r.jsxs)(`div`,{className:`flex items-start gap-3 group`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 shrink-0 w-[90px]`,children:[(0,r.jsx)(`span`,{className:`text-blue-500 dark:text-blue-400`,children:n}),(0,r.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-blue-600 dark:text-blue-400`,children:e})]}),(0,r.jsx)(`div`,{className:`flex-1 min-w-0`,children:o?(0,r.jsx)(`p`,{className:`text-sm text-foreground py-1`,children:i||(0,r.jsx)(`span`,{className:`text-muted-foreground italic`,children:a})}):(0,r.jsx)(`input`,{type:`text`,value:i,onChange:e=>s?.(e.target.value),placeholder:a,className:t.cn(`w-full bg-transparent text-sm text-foreground py-1 px-0`,`border-0 border-b border-transparent`,`focus:border-blue-300 dark:focus:border-blue-600`,`focus:outline-none transition-colors`,`placeholder:text-muted-foreground/50 placeholder:italic`)})})]})}function s({attributes:e,children:n,element:i,className:s}){let c=i,l=c?.priority,u=c?.storyId,d=c?.points;return(0,r.jsxs)(`div`,{...e,contentEditable:!1,className:t.cn(`relative my-4 rounded-lg overflow-hidden`,`border-l-4 border-blue-500 dark:border-blue-400`,`bg-blue-50/50 dark:bg-blue-950/20`,`border border-blue-200/60 dark:border-blue-800/40`,`shadow-sm hover:shadow-md transition-shadow duration-200`,s),children:[(0,r.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-blue-100/50 dark:bg-blue-900/20 border-b border-blue-200/40 dark:border-blue-800/30`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,r.jsx)(`svg`,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,r.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-blue-700 dark:text-blue-300`,children:`User Story`}),u&&(0,r.jsx)(`span`,{className:`text-[10px] font-mono font-semibold text-blue-500 dark:text-blue-400 bg-blue-100 dark:bg-blue-800/40 px-1.5 py-0.5 rounded`,children:u})]}),(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d!==void 0&&(0,r.jsx)(`span`,{className:`inline-flex items-center justify-center h-5 min-w-[20px] px-1 rounded-full bg-blue-200 dark:bg-blue-700/50 text-[10px] font-bold text-blue-800 dark:text-blue-200`,children:d}),l&&a[l]&&(0,r.jsx)(`span`,{className:t.cn(`text-[10px] font-semibold px-2 py-0.5 rounded-full`,a[l].bg,a[l].color),children:a[l].label})]})]}),(0,r.jsxs)(`div`,{className:`px-4 py-3 space-y-2`,children:[(0,r.jsx)(o,{label:`As a`,icon:(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),value:c?.role||``,placeholder:`role (e.g. platform administrator)`,readOnly:!0}),(0,r.jsx)(o,{label:`I want`,icon:(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 10V3L4 14h7v7l9-11h-7z`})}),value:c?.action||``,placeholder:`action (e.g. to deploy services with one click)`,readOnly:!0}),(0,r.jsx)(o,{label:`So that`,icon:(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})}),value:c?.benefit||``,placeholder:`benefit (e.g. I can reduce time-to-market)`,readOnly:!0})]}),(0,r.jsx)(`div`,{className:`hidden`,children:n})]})}s.displayName=`WakaUserStoryBlock`;function c(e){return[{type:i,role:e?.role||``,action:e?.action||``,benefit:e?.benefit||``,storyId:e?.storyId,priority:e?.priority,points:e?.points,children:[{text:``}]}]}async function l(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:i,node:{isElement:!0,isVoid:!0,type:i,component:s}})}catch{return console.warn(`[WakaUserStoryBlock] platejs not installed`),null}}exports.USER_STORY_BLOCK_TYPE=i,exports.WakaUserStoryBlock=s,exports.createUserStoryNodes=c,exports.createUserStoryPlugin=l;
1
+ "use client";"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");var i=`user_story`,a={must:{label:`Must Have`,color:`text-red-700 dark:text-red-400`,bg:`bg-red-50 dark:bg-red-500/10`},should:{label:`Should Have`,color:`text-amber-700 dark:text-amber-400`,bg:`bg-amber-50 dark:bg-amber-500/10`},could:{label:`Could Have`,color:`text-blue-700 dark:text-blue-400`,bg:`bg-blue-50 dark:bg-blue-500/10`},wont:{label:`Won't Have`,color:`text-gray-500 dark:text-gray-400`,bg:`bg-gray-50 dark:bg-gray-500/10`}};function o({label:e,icon:n,value:i,placeholder:a,readOnly:o,onChange:s}){return(0,r.jsxs)(`div`,{className:`flex items-start gap-3 group`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 shrink-0 w-[90px]`,children:[(0,r.jsx)(`span`,{className:`text-blue-500 dark:text-blue-400`,children:n}),(0,r.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-blue-600 dark:text-blue-400`,children:e})]}),(0,r.jsx)(`div`,{className:`flex-1 min-w-0`,children:o?(0,r.jsx)(`p`,{className:`text-sm text-foreground py-1`,children:i||(0,r.jsx)(`span`,{className:`text-muted-foreground italic`,children:a})}):(0,r.jsx)(`input`,{type:`text`,value:i,onChange:e=>s?.(e.target.value),placeholder:a,className:t.cn(`w-full bg-transparent text-sm text-foreground py-1 px-0`,`border-0 border-b border-transparent`,`focus:border-blue-300 dark:focus:border-blue-600`,`focus:outline-none transition-colors`,`placeholder:text-muted-foreground/50 placeholder:italic`)})})]})}function s({attributes:e,children:n,element:i,className:s}){let c=i,l=c?.priority,u=c?.storyId,d=c?.points;return(0,r.jsxs)(`div`,{...e,contentEditable:!1,className:t.cn(`relative my-4 rounded-lg overflow-hidden`,`border-l-4 border-blue-500 dark:border-blue-400`,`bg-blue-50/50 dark:bg-blue-950/20`,`border border-blue-200/60 dark:border-blue-800/40`,`shadow-sm hover:shadow-md transition-shadow duration-200`,s),children:[(0,r.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-blue-100/50 dark:bg-blue-900/20 border-b border-blue-200/40 dark:border-blue-800/30`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,r.jsx)(`svg`,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,r.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-blue-700 dark:text-blue-300`,children:`User Story`}),u&&(0,r.jsx)(`span`,{className:`text-[10px] font-mono font-semibold text-blue-500 dark:text-blue-400 bg-blue-100 dark:bg-blue-800/40 px-1.5 py-0.5 rounded`,children:u})]}),(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d!==void 0&&(0,r.jsx)(`span`,{className:`inline-flex items-center justify-center h-5 min-w-[20px] px-1 rounded-full bg-blue-200 dark:bg-blue-700/50 text-[10px] font-bold text-blue-800 dark:text-blue-200`,children:d}),l&&a[l]&&(0,r.jsx)(`span`,{className:t.cn(`text-[10px] font-semibold px-2 py-0.5 rounded-full`,a[l].bg,a[l].color),children:a[l].label})]})]}),(0,r.jsxs)(`div`,{className:`px-4 py-3 space-y-2`,children:[(0,r.jsx)(o,{label:`As a`,icon:(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),value:c?.role||``,placeholder:`role (e.g. platform administrator)`,readOnly:!0}),(0,r.jsx)(o,{label:`I want`,icon:(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 10V3L4 14h7v7l9-11h-7z`})}),value:c?.action||``,placeholder:`action (e.g. to deploy services with one click)`,readOnly:!0}),(0,r.jsx)(o,{label:`So that`,icon:(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})}),value:c?.benefit||``,placeholder:`benefit (e.g. I can reduce time-to-market)`,readOnly:!0})]}),(0,r.jsx)(`div`,{className:`hidden`,children:n})]})}s.displayName=`WakaUserStoryBlock`;function c(e){return[{type:i,role:e?.role||``,action:e?.action||``,benefit:e?.benefit||``,storyId:e?.storyId,priority:e?.priority,points:e?.points,children:[{text:``}]}]}async function l(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:i,node:{isElement:!0,isVoid:!0,type:i,component:s}})}catch{return console.warn(`[WakaUserStoryBlock] platejs not installed`),null}}exports.USER_STORY_BLOCK_TYPE=i,exports.WakaUserStoryBlock=s,exports.createUserStoryNodes=c,exports.createUserStoryPlugin=l;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);var i=`version_diff`;function a({attributes:e,children:i,element:a,className:o}){let s=a,[c,l]=n.useState(`unified`),[u,d]=n.useState(!0),f=s?.hunks||[],p=s?.stats||{additions:0,deletions:0,modifications:0},m=s?.oldVersionLabel||`Previous`,h=s?.newVersionLabel||`Current`;return(0,r.jsxs)(`div`,{...e,contentEditable:!1,className:t.cn(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,o),children:[(0,r.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 bg-muted/30 border-b border-border`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,r.jsx)(`svg`,{className:`h-4 w-4 text-orange-600 dark:text-orange-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 3v6m0 0l-3 3m3-3l3 3M6 21h12a2 2 0 002-2V7l-5-5H6a2 2 0 00-2 2v15a2 2 0 002 2z`})}),(0,r.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-foreground`,children:`Version Diff`}),(0,r.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,children:[(0,r.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-500/10 text-red-700 dark:text-red-400 font-mono font-medium`,children:m}),(0,r.jsx)(`svg`,{className:`h-3 w-3 text-muted-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14 5l7 7m0 0l-7 7m7-7H3`})}),(0,r.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-emerald-100 dark:bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 font-mono font-medium`,children:h})]})]}),(0,r.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-mono`,children:[p.additions>0&&(0,r.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400 font-semibold`,children:[`+`,p.additions]}),p.deletions>0&&(0,r.jsxs)(`span`,{className:`text-red-600 dark:text-red-400 font-semibold`,children:[`-`,p.deletions]}),p.modifications>0&&(0,r.jsxs)(`span`,{className:`text-amber-600 dark:text-amber-400 font-semibold`,children:[`~`,p.modifications]})]}),(0,r.jsx)(`div`,{className:`flex items-center border border-border rounded overflow-hidden`,children:[`unified`,`split`,`summary`].map(e=>(0,r.jsx)(`button`,{type:`button`,onClick:()=>l(e),className:t.cn(`px-2 py-1 text-[10px] font-medium transition-colors`,c===e?`bg-foreground/10 text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,r.jsx)(`svg`,{className:t.cn(`h-4 w-4 transition-transform`,!u&&`-rotate-90`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})})]})]}),(s?.author||s?.timestamp)&&(0,r.jsxs)(`div`,{className:`px-4 py-1.5 border-b border-border/50 bg-muted/10 flex items-center gap-3 text-[10px] text-muted-foreground`,children:[s.author&&(0,r.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,r.jsx)(`span`,{className:`font-medium`,children:s.author})]}),s.timestamp&&(0,r.jsx)(`span`,{children:new Date(s.timestamp).toLocaleString(`fr-FR`)})]}),u&&(0,r.jsx)(`div`,{className:`overflow-x-auto`,children:c===`summary`?(0,r.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,r.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,r.jsxs)(`div`,{className:`rounded-lg bg-emerald-50 dark:bg-emerald-500/5 border border-emerald-200 dark:border-emerald-500/20 p-3 text-center`,children:[(0,r.jsx)(`div`,{className:`text-2xl font-bold text-emerald-600 dark:text-emerald-400`,children:p.additions}),(0,r.jsx)(`div`,{className:`text-[10px] font-medium text-emerald-700/70 dark:text-emerald-400/70 uppercase tracking-wider`,children:`Additions`})]}),(0,r.jsxs)(`div`,{className:`rounded-lg bg-red-50 dark:bg-red-500/5 border border-red-200 dark:border-red-500/20 p-3 text-center`,children:[(0,r.jsx)(`div`,{className:`text-2xl font-bold text-red-600 dark:text-red-400`,children:p.deletions}),(0,r.jsx)(`div`,{className:`text-[10px] font-medium text-red-700/70 dark:text-red-400/70 uppercase tracking-wider`,children:`Deletions`})]}),(0,r.jsxs)(`div`,{className:`rounded-lg bg-amber-50 dark:bg-amber-500/5 border border-amber-200 dark:border-amber-500/20 p-3 text-center`,children:[(0,r.jsx)(`div`,{className:`text-2xl font-bold text-amber-600 dark:text-amber-400`,children:p.modifications}),(0,r.jsx)(`div`,{className:`text-[10px] font-medium text-amber-700/70 dark:text-amber-400/70 uppercase tracking-wider`,children:`Modified`})]})]}),(0,r.jsxs)(`div`,{className:`h-2 rounded-full bg-muted overflow-hidden flex`,children:[p.additions>0&&(0,r.jsx)(`div`,{className:`bg-emerald-500 h-full`,style:{width:`${p.additions/(p.additions+p.deletions+p.modifications)*100}%`}}),p.modifications>0&&(0,r.jsx)(`div`,{className:`bg-amber-500 h-full`,style:{width:`${p.modifications/(p.additions+p.deletions+p.modifications)*100}%`}}),p.deletions>0&&(0,r.jsx)(`div`,{className:`bg-red-500 h-full`,style:{width:`${p.deletions/(p.additions+p.deletions+p.modifications)*100}%`}})]})]}):c===`split`?(0,r.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-border`,children:[(0,r.jsxs)(`div`,{className:`p-0`,children:[(0,r.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-red-50/50 dark:bg-red-950/10`,children:(0,r.jsx)(`span`,{className:`text-[10px] font-semibold text-red-700 dark:text-red-400 uppercase tracking-wider`,children:m})}),(0,r.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,i)=>(0,r.jsx)(n.Fragment,{children:e.lines.filter(e=>e.type!==`added`).map((e,n)=>(0,r.jsxs)(`div`,{className:t.cn(`px-3 py-0.5 flex`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber}),(0,r.jsxs)(`span`,{className:t.cn(e.type===`removed`&&`text-red-800 dark:text-red-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`removed`&&(0,r.jsx)(`span`,{className:`text-red-500 mr-1`,children:`-`}),e.content]})]},`${i}-${n}`))},i))})]}),(0,r.jsxs)(`div`,{className:`p-0`,children:[(0,r.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-emerald-50/50 dark:bg-emerald-950/10`,children:(0,r.jsx)(`span`,{className:`text-[10px] font-semibold text-emerald-700 dark:text-emerald-400 uppercase tracking-wider`,children:h})}),(0,r.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,i)=>(0,r.jsx)(n.Fragment,{children:e.lines.filter(e=>e.type!==`removed`).map((e,n)=>(0,r.jsxs)(`div`,{className:t.cn(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber}),(0,r.jsxs)(`span`,{className:t.cn(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`added`&&(0,r.jsx)(`span`,{className:`text-emerald-500 mr-1`,children:`+`}),e.content]})]},`${i}-${n}`))},i))})]})]}):(0,r.jsxs)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:[f.map((e,i)=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(`div`,{className:`px-3 py-1 bg-blue-50/50 dark:bg-blue-950/10 text-blue-600 dark:text-blue-400 text-[10px]`,children:[`@@ -`,e.oldStart,` +`,e.newStart,` @@`]}),e.lines.map((e,n)=>(0,r.jsxs)(`div`,{className:t.cn(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber||``}),(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber||``}),(0,r.jsx)(`span`,{className:`w-4 shrink-0 text-center select-none`,children:e.type===`added`?(0,r.jsx)(`span`,{className:`text-emerald-500`,children:`+`}):e.type===`removed`?(0,r.jsx)(`span`,{className:`text-red-500`,children:`-`}):e.type===`modified`?(0,r.jsx)(`span`,{className:`text-amber-500`,children:`~`}):(0,r.jsx)(`span`,{className:`text-muted-foreground/30`,children:` `})}),(0,r.jsx)(`span`,{className:t.cn(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`removed`&&`text-red-800 dark:text-red-300 line-through`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:e.content})]},`${i}-${n}`))]},i)),f.length===0&&(0,r.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground italic`,children:`No differences found.`})]})}),(0,r.jsx)(`div`,{className:`hidden`,children:i})]})}a.displayName=`WakaVersionDiffBlock`;function o(e){return[{type:i,oldVersionLabel:e?.oldVersionLabel||`v1.0`,newVersionLabel:e?.newVersionLabel||`v1.1`,oldText:e?.oldText||``,newText:e?.newText||``,hunks:e?.hunks||[{oldStart:1,newStart:1,lines:[{content:`The system SHALL authenticate users via OAuth2.`,type:`unchanged`,oldLineNumber:1,newLineNumber:1},{content:`Rate limiting: 50 req/min per user.`,type:`removed`,oldLineNumber:2},{content:`Rate limiting: 100 req/min per user.`,type:`added`,newLineNumber:2},{content:`All API responses use JSON format.`,type:`unchanged`,oldLineNumber:3,newLineNumber:3},{content:`Added: Support for WebSocket real-time events.`,type:`added`,newLineNumber:4}]}],stats:e?.stats||{additions:2,deletions:1,modifications:0},author:e?.author,timestamp:e?.timestamp,children:[{text:``}]}]}async function s(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:i,node:{isElement:!0,isVoid:!0,type:i,component:a}})}catch{return console.warn(`[WakaVersionDiffBlock] platejs not installed`),null}}exports.VERSION_DIFF_BLOCK_TYPE=i,exports.WakaVersionDiffBlock=a,exports.createVersionDiffNodes=o,exports.createVersionDiffPlugin=s;
1
+ "use client";"use client";const e=require("../../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");var i=`version_diff`;function a({attributes:e,children:i,element:a,className:o}){let s=a,[c,l]=n.useState(`unified`),[u,d]=n.useState(!0),f=s?.hunks||[],p=s?.stats||{additions:0,deletions:0,modifications:0},m=s?.oldVersionLabel||`Previous`,h=s?.newVersionLabel||`Current`;return(0,r.jsxs)(`div`,{...e,contentEditable:!1,className:t.cn(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,o),children:[(0,r.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 bg-muted/30 border-b border-border`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,r.jsx)(`svg`,{className:`h-4 w-4 text-orange-600 dark:text-orange-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 3v6m0 0l-3 3m3-3l3 3M6 21h12a2 2 0 002-2V7l-5-5H6a2 2 0 00-2 2v15a2 2 0 002 2z`})}),(0,r.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-foreground`,children:`Version Diff`}),(0,r.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,children:[(0,r.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-500/10 text-red-700 dark:text-red-400 font-mono font-medium`,children:m}),(0,r.jsx)(`svg`,{className:`h-3 w-3 text-muted-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14 5l7 7m0 0l-7 7m7-7H3`})}),(0,r.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-emerald-100 dark:bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 font-mono font-medium`,children:h})]})]}),(0,r.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,r.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-mono`,children:[p.additions>0&&(0,r.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400 font-semibold`,children:[`+`,p.additions]}),p.deletions>0&&(0,r.jsxs)(`span`,{className:`text-red-600 dark:text-red-400 font-semibold`,children:[`-`,p.deletions]}),p.modifications>0&&(0,r.jsxs)(`span`,{className:`text-amber-600 dark:text-amber-400 font-semibold`,children:[`~`,p.modifications]})]}),(0,r.jsx)(`div`,{className:`flex items-center border border-border rounded overflow-hidden`,children:[`unified`,`split`,`summary`].map(e=>(0,r.jsx)(`button`,{type:`button`,onClick:()=>l(e),className:t.cn(`px-2 py-1 text-[10px] font-medium transition-colors`,c===e?`bg-foreground/10 text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,r.jsx)(`svg`,{className:t.cn(`h-4 w-4 transition-transform`,!u&&`-rotate-90`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})})]})]}),(s?.author||s?.timestamp)&&(0,r.jsxs)(`div`,{className:`px-4 py-1.5 border-b border-border/50 bg-muted/10 flex items-center gap-3 text-[10px] text-muted-foreground`,children:[s.author&&(0,r.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,r.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,r.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,r.jsx)(`span`,{className:`font-medium`,children:s.author})]}),s.timestamp&&(0,r.jsx)(`span`,{children:new Date(s.timestamp).toLocaleString(`fr-FR`)})]}),u&&(0,r.jsx)(`div`,{className:`overflow-x-auto`,children:c===`summary`?(0,r.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,r.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,r.jsxs)(`div`,{className:`rounded-lg bg-emerald-50 dark:bg-emerald-500/5 border border-emerald-200 dark:border-emerald-500/20 p-3 text-center`,children:[(0,r.jsx)(`div`,{className:`text-2xl font-bold text-emerald-600 dark:text-emerald-400`,children:p.additions}),(0,r.jsx)(`div`,{className:`text-[10px] font-medium text-emerald-700/70 dark:text-emerald-400/70 uppercase tracking-wider`,children:`Additions`})]}),(0,r.jsxs)(`div`,{className:`rounded-lg bg-red-50 dark:bg-red-500/5 border border-red-200 dark:border-red-500/20 p-3 text-center`,children:[(0,r.jsx)(`div`,{className:`text-2xl font-bold text-red-600 dark:text-red-400`,children:p.deletions}),(0,r.jsx)(`div`,{className:`text-[10px] font-medium text-red-700/70 dark:text-red-400/70 uppercase tracking-wider`,children:`Deletions`})]}),(0,r.jsxs)(`div`,{className:`rounded-lg bg-amber-50 dark:bg-amber-500/5 border border-amber-200 dark:border-amber-500/20 p-3 text-center`,children:[(0,r.jsx)(`div`,{className:`text-2xl font-bold text-amber-600 dark:text-amber-400`,children:p.modifications}),(0,r.jsx)(`div`,{className:`text-[10px] font-medium text-amber-700/70 dark:text-amber-400/70 uppercase tracking-wider`,children:`Modified`})]})]}),(0,r.jsxs)(`div`,{className:`h-2 rounded-full bg-muted overflow-hidden flex`,children:[p.additions>0&&(0,r.jsx)(`div`,{className:`bg-emerald-500 h-full`,style:{width:`${p.additions/(p.additions+p.deletions+p.modifications)*100}%`}}),p.modifications>0&&(0,r.jsx)(`div`,{className:`bg-amber-500 h-full`,style:{width:`${p.modifications/(p.additions+p.deletions+p.modifications)*100}%`}}),p.deletions>0&&(0,r.jsx)(`div`,{className:`bg-red-500 h-full`,style:{width:`${p.deletions/(p.additions+p.deletions+p.modifications)*100}%`}})]})]}):c===`split`?(0,r.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-border`,children:[(0,r.jsxs)(`div`,{className:`p-0`,children:[(0,r.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-red-50/50 dark:bg-red-950/10`,children:(0,r.jsx)(`span`,{className:`text-[10px] font-semibold text-red-700 dark:text-red-400 uppercase tracking-wider`,children:m})}),(0,r.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,i)=>(0,r.jsx)(n.Fragment,{children:e.lines.filter(e=>e.type!==`added`).map((e,n)=>(0,r.jsxs)(`div`,{className:t.cn(`px-3 py-0.5 flex`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber}),(0,r.jsxs)(`span`,{className:t.cn(e.type===`removed`&&`text-red-800 dark:text-red-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`removed`&&(0,r.jsx)(`span`,{className:`text-red-500 mr-1`,children:`-`}),e.content]})]},`${i}-${n}`))},i))})]}),(0,r.jsxs)(`div`,{className:`p-0`,children:[(0,r.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-emerald-50/50 dark:bg-emerald-950/10`,children:(0,r.jsx)(`span`,{className:`text-[10px] font-semibold text-emerald-700 dark:text-emerald-400 uppercase tracking-wider`,children:h})}),(0,r.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,i)=>(0,r.jsx)(n.Fragment,{children:e.lines.filter(e=>e.type!==`removed`).map((e,n)=>(0,r.jsxs)(`div`,{className:t.cn(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber}),(0,r.jsxs)(`span`,{className:t.cn(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`added`&&(0,r.jsx)(`span`,{className:`text-emerald-500 mr-1`,children:`+`}),e.content]})]},`${i}-${n}`))},i))})]})]}):(0,r.jsxs)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:[f.map((e,i)=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(`div`,{className:`px-3 py-1 bg-blue-50/50 dark:bg-blue-950/10 text-blue-600 dark:text-blue-400 text-[10px]`,children:[`@@ -`,e.oldStart,` +`,e.newStart,` @@`]}),e.lines.map((e,n)=>(0,r.jsxs)(`div`,{className:t.cn(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber||``}),(0,r.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber||``}),(0,r.jsx)(`span`,{className:`w-4 shrink-0 text-center select-none`,children:e.type===`added`?(0,r.jsx)(`span`,{className:`text-emerald-500`,children:`+`}):e.type===`removed`?(0,r.jsx)(`span`,{className:`text-red-500`,children:`-`}):e.type===`modified`?(0,r.jsx)(`span`,{className:`text-amber-500`,children:`~`}):(0,r.jsx)(`span`,{className:`text-muted-foreground/30`,children:` `})}),(0,r.jsx)(`span`,{className:t.cn(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`removed`&&`text-red-800 dark:text-red-300 line-through`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:e.content})]},`${i}-${n}`))]},i)),f.length===0&&(0,r.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground italic`,children:`No differences found.`})]})}),(0,r.jsx)(`div`,{className:`hidden`,children:i})]})}a.displayName=`WakaVersionDiffBlock`;function o(e){return[{type:i,oldVersionLabel:e?.oldVersionLabel||`v1.0`,newVersionLabel:e?.newVersionLabel||`v1.1`,oldText:e?.oldText||``,newText:e?.newText||``,hunks:e?.hunks||[{oldStart:1,newStart:1,lines:[{content:`The system SHALL authenticate users via OAuth2.`,type:`unchanged`,oldLineNumber:1,newLineNumber:1},{content:`Rate limiting: 50 req/min per user.`,type:`removed`,oldLineNumber:2},{content:`Rate limiting: 100 req/min per user.`,type:`added`,newLineNumber:2},{content:`All API responses use JSON format.`,type:`unchanged`,oldLineNumber:3,newLineNumber:3},{content:`Added: Support for WebSocket real-time events.`,type:`added`,newLineNumber:4}]}],stats:e?.stats||{additions:2,deletions:1,modifications:0},author:e?.author,timestamp:e?.timestamp,children:[{text:``}]}]}async function s(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:i,node:{isElement:!0,isVoid:!0,type:i,component:a}})}catch{return console.warn(`[WakaVersionDiffBlock] platejs not installed`),null}}exports.VERSION_DIFF_BLOCK_TYPE=i,exports.WakaVersionDiffBlock=a,exports.createVersionDiffNodes=o,exports.createVersionDiffPlugin=s;
@@ -1,4 +1,4 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../label/index.cjs.js`),r=require(`../textarea/index.cjs.js`);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);var o=[{type:`p`,children:[{text:``}]}],s=[{key:`continue`,label:`Continuer la redaction`,prompt:`Continue writing the following text naturally:
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../label/index.cjs.js"),r=require("../textarea/index.cjs.js");let i=require("react");i=e.__toESM(i);let a=require("react/jsx-runtime");var o=[{type:`p`,children:[{text:``}]}],s=[{key:`continue`,label:`Continuer la redaction`,prompt:`Continue writing the following text naturally:
2
2
 
3
3
  {{selection}}`,group:`Generer`},{key:`summarize`,label:`Resumer`,prompt:`Summarize the following text concisely:
4
4
 
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../avatar/index.cjs.js`),r=require(`../badge/index.cjs.js`),i=require(`../label/index.cjs.js`),a=require(`../textarea/index.cjs.js`);let o=require(`react`);o=e.__toESM(o);let s=require(`react/jsx-runtime`);var c=[{type:`p`,children:[{text:``}]}],l=o.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:c=`Editez ensemble en temps reel...`,className:l,editorClassName:d,minHeight:f=400,label:p,description:m,error:h,documentId:g,currentUser:_,providers:v,maxParticipants:y=10,onUsersChange:b,showUsersBar:x=!0,extraPlugins:S,editorRef:C},w)=>{let[T,E]=o.useState(null),[D,O]=o.useState(!1),[k,A]=o.useState([_]),j=o.useRef({documentId:g,currentUser:_,providers:v,maxParticipants:y});return j.current={documentId:g,currentUser:_,providers:v,maxParticipants:y},o.useEffect(()=>{let e=!1;return(async()=>{try{let t=j.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/yjs/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}})],u=t.providers.map(e=>e.type===`hocuspocus`?{type:`hocuspocus`,options:{name:e.roomName,url:e.url,...e.options}}:{type:`webrtc`,options:{roomName:e.roomName,maxConns:t.maxParticipants-1,signaling:[e.url],...e.options}});l.push(c.YjsPlugin.configure({options:{cursors:{data:{name:t.currentUser.name,color:t.currentUser.color}},providers:u}})),e||E({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,YjsPlugin:c.YjsPlugin,plugins:l})}catch(t){console.error(`[WakaCollaborativeEditor] Failed to load:`,t),e||O(!0)}})(),()=>{e=!0}},[]),o.useEffect(()=>{b?.(k)},[k,b]),T?(0,s.jsx)(u,{ref:w,bundle:T,value:e,onChange:n,readOnly:r,placeholder:c,className:l,editorClassName:d,minHeight:f,label:p,description:m,error:h,documentId:g,currentUser:_,showUsersBar:x,connectedUsers:k,setConnectedUsers:A,extraPlugins:S,editorRef:C}):(0,s.jsxs)(`div`,{ref:w,className:t.cn(`space-y-1.5`,l),children:[p&&(0,s.jsx)(i.Label,{children:p}),m&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m}),(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsx)(a.Textarea,{placeholder:c,disabled:!0,style:{minHeight:f}}),(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,s.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:D?`Erreur de chargement (@platejs/yjs requis)`:`Connexion a la session collaborative...`})})]}),h&&(0,s.jsx)(`p`,{className:`text-sm text-destructive`,children:h})]})});l.displayName=`WakaCollaborativeEditor`;var u=o.forwardRef(({bundle:{Plate:e,PlateContent:a,usePlateEditor:l,YjsPlugin:u,plugins:d},value:f,onChange:p,readOnly:m,placeholder:h,className:g,editorClassName:_,minHeight:v,label:y,description:b,error:x,documentId:S,showUsersBar:C,connectedUsers:w,extraPlugins:T,editorRef:E},D)=>{let O=l({plugins:o.useMemo(()=>[...d,...T??[]],[d,T]),skipInitialization:!0},[S]);return o.useEffect(()=>{try{O.getApi(u).yjs.init({id:S,autoSelect:`end`,value:f??c})}catch{}return()=>{try{O.getApi(u).yjs.destroy()}catch{}}},[O,S,u,f]),o.useEffect(()=>{E&&(E.current=O)},[O,E]),(0,s.jsxs)(`div`,{ref:D,className:t.cn(`space-y-1.5`,g),children:[y&&(0,s.jsx)(i.Label,{children:y}),b&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b}),(0,s.jsx)(e,{editor:O,onChange:p?({value:e})=>p(e):void 0,readOnly:m,children:(0,s.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,x&&`border-destructive`),children:[C&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30`,children:[(0,s.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`En ligne :`}),(0,s.jsx)(`div`,{className:`flex items-center -space-x-1.5`,children:w.map(e=>(0,s.jsx)(n.Avatar,{className:`h-6 w-6 border-2 border-background`,children:(0,s.jsx)(n.AvatarFallback,{className:`text-[10px] text-white font-bold`,style:{backgroundColor:e.color},children:e.name.slice(0,2).toUpperCase()})},e.id))}),(0,s.jsxs)(r.Badge,{variant:`secondary`,className:`text-[10px] h-5`,children:[w.length,` connecte`,w.length>1?`s`:``]})]}),(0,s.jsx)(`div`,{style:{minHeight:v},children:(0,s.jsx)(a,{placeholder:h,readOnly:m,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,_)})})]})}),x&&(0,s.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]})});u.displayName=`CollabEditorInner`,exports.WakaCollaborativeEditor=l;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../avatar/index.cjs.js"),r=require("../badge/index.cjs.js"),i=require("../label/index.cjs.js"),a=require("../textarea/index.cjs.js");let o=require("react");o=e.__toESM(o);let s=require("react/jsx-runtime");var c=[{type:`p`,children:[{text:``}]}],l=o.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:c=`Editez ensemble en temps reel...`,className:l,editorClassName:d,minHeight:f=400,label:p,description:m,error:h,documentId:g,currentUser:_,providers:v,maxParticipants:y=10,onUsersChange:b,showUsersBar:x=!0,extraPlugins:S,editorRef:C},w)=>{let[T,E]=o.useState(null),[D,O]=o.useState(!1),[k,A]=o.useState([_]),j=o.useRef({documentId:g,currentUser:_,providers:v,maxParticipants:y});return j.current={documentId:g,currentUser:_,providers:v,maxParticipants:y},o.useEffect(()=>{let e=!1;return(async()=>{try{let t=j.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/yjs/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}})],u=t.providers.map(e=>e.type===`hocuspocus`?{type:`hocuspocus`,options:{name:e.roomName,url:e.url,...e.options}}:{type:`webrtc`,options:{roomName:e.roomName,maxConns:t.maxParticipants-1,signaling:[e.url],...e.options}});l.push(c.YjsPlugin.configure({options:{cursors:{data:{name:t.currentUser.name,color:t.currentUser.color}},providers:u}})),e||E({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,YjsPlugin:c.YjsPlugin,plugins:l})}catch(t){console.error(`[WakaCollaborativeEditor] Failed to load:`,t),e||O(!0)}})(),()=>{e=!0}},[]),o.useEffect(()=>{b?.(k)},[k,b]),T?(0,s.jsx)(u,{ref:w,bundle:T,value:e,onChange:n,readOnly:r,placeholder:c,className:l,editorClassName:d,minHeight:f,label:p,description:m,error:h,documentId:g,currentUser:_,showUsersBar:x,connectedUsers:k,setConnectedUsers:A,extraPlugins:S,editorRef:C}):(0,s.jsxs)(`div`,{ref:w,className:t.cn(`space-y-1.5`,l),children:[p&&(0,s.jsx)(i.Label,{children:p}),m&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m}),(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsx)(a.Textarea,{placeholder:c,disabled:!0,style:{minHeight:f}}),(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,s.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:D?`Erreur de chargement (@platejs/yjs requis)`:`Connexion a la session collaborative...`})})]}),h&&(0,s.jsx)(`p`,{className:`text-sm text-destructive`,children:h})]})});l.displayName=`WakaCollaborativeEditor`;var u=o.forwardRef(({bundle:{Plate:e,PlateContent:a,usePlateEditor:l,YjsPlugin:u,plugins:d},value:f,onChange:p,readOnly:m,placeholder:h,className:g,editorClassName:_,minHeight:v,label:y,description:b,error:x,documentId:S,showUsersBar:C,connectedUsers:w,extraPlugins:T,editorRef:E},D)=>{let O=l({plugins:o.useMemo(()=>[...d,...T??[]],[d,T]),skipInitialization:!0},[S]);return o.useEffect(()=>{try{O.getApi(u).yjs.init({id:S,autoSelect:`end`,value:f??c})}catch{}return()=>{try{O.getApi(u).yjs.destroy()}catch{}}},[O,S,u,f]),o.useEffect(()=>{E&&(E.current=O)},[O,E]),(0,s.jsxs)(`div`,{ref:D,className:t.cn(`space-y-1.5`,g),children:[y&&(0,s.jsx)(i.Label,{children:y}),b&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b}),(0,s.jsx)(e,{editor:O,onChange:p?({value:e})=>p(e):void 0,readOnly:m,children:(0,s.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,x&&`border-destructive`),children:[C&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30`,children:[(0,s.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`En ligne :`}),(0,s.jsx)(`div`,{className:`flex items-center -space-x-1.5`,children:w.map(e=>(0,s.jsx)(n.Avatar,{className:`h-6 w-6 border-2 border-background`,children:(0,s.jsx)(n.AvatarFallback,{className:`text-[10px] text-white font-bold`,style:{backgroundColor:e.color},children:e.name.slice(0,2).toUpperCase()})},e.id))}),(0,s.jsxs)(r.Badge,{variant:`secondary`,className:`text-[10px] h-5`,children:[w.length,` connecte`,w.length>1?`s`:``]})]}),(0,s.jsx)(`div`,{style:{minHeight:v},children:(0,s.jsx)(a,{placeholder:h,readOnly:m,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,_)})})]})}),x&&(0,s.jsx)(`p`,{className:`text-sm text-destructive`,children:x})]})});u.displayName=`CollabEditorInner`,exports.WakaCollaborativeEditor=l;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../badge/index.cjs.js`),r=require(`../label/index.cjs.js`);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);var o=i.forwardRef(({original:e,modified:o,mode:l=`inline`,label:d,description:f,className:p,editorClassName:m,minHeight:h=200,showStats:g=!0,originalLabel:_=`Original`,modifiedLabel:v=`Modifie`,onDiffComputed:y},b)=>{let[x,S]=i.useState(null),[C,w]=i.useState({added:0,removed:0,modified:0,unchanged:0}),[T,E]=i.useState(!1);return i.useEffect(()=>{let t=!1;return(async()=>{try{let n=await import(`@platejs/diff`);if(n.computeDiff){let r=n.computeDiff(e,o);if(!t){S(r);let e={added:0,removed:0,modified:0,unchanged:0};if(Array.isArray(r))for(let t of r)t.diff===`insert`||t.diffOperation?.type===`insert`?e.added++:t.diff===`delete`||t.diffOperation?.type===`delete`?e.removed++:t.diff===`update`||t.diffOperation?.type===`update`?e.modified++:e.unchanged++;w(e),y?.(e)}}}catch(e){console.error(`[WakaDiffViewer] Failed to compute diff:`,e),t||E(!0)}})(),()=>{t=!0}},[e,o,y]),T||!x?(0,a.jsxs)(`div`,{ref:b,className:t.cn(`space-y-1.5`,p),children:[d&&(0,a.jsx)(r.Label,{children:d}),f&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),T?(0,a.jsx)(u,{original:e,modified:o,mode:l,originalLabel:_,modifiedLabel:v,minHeight:h,editorClassName:m}):(0,a.jsx)(`div`,{className:`flex items-center justify-center border rounded-lg bg-muted/30`,style:{minHeight:h},children:(0,a.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Calcul des differences...`})})]}):(0,a.jsxs)(`div`,{ref:b,className:t.cn(`space-y-1.5`,p),children:[d&&(0,a.jsx)(r.Label,{children:d}),f&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,a.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`),children:[g&&(0,a.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 border-b bg-muted/30`,children:[(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:`Differences :`}),C.added>0&&(0,a.jsxs)(n.Badge,{variant:`secondary`,className:`bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 text-[10px] h-5`,children:[`+`,C.added,` ajout`,C.added>1?`s`:``]}),C.removed>0&&(0,a.jsxs)(n.Badge,{variant:`secondary`,className:`bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300 text-[10px] h-5`,children:[`-`,C.removed,` suppression`,C.removed>1?`s`:``]}),C.modified>0&&(0,a.jsxs)(n.Badge,{variant:`secondary`,className:`bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300 text-[10px] h-5`,children:[`~`,C.modified,` modification`,C.modified>1?`s`:``]}),C.added===0&&C.removed===0&&C.modified===0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Aucune difference`})]}),l===`side-by-side`?(0,a.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:h},children:[(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:_}),(0,a.jsx)(s,{nodes:e,diffType:`original`,className:m})]}),(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:v}),(0,a.jsx)(s,{nodes:o,diffType:`modified`,className:m})]})]}):(0,a.jsx)(`div`,{style:{minHeight:h},children:(0,a.jsx)(c,{diffNodes:x,className:m})})]})]})});o.displayName=`WakaDiffViewer`;function s({nodes:e,diffType:n,className:r}){return(0,a.jsx)(`div`,{className:t.cn(`prose prose-sm max-w-none p-4 text-sm`,r),children:e.map((e,t)=>(0,a.jsx)(l,{node:e,diffType:n},t))})}function c({diffNodes:e,className:n}){return(0,a.jsx)(`div`,{className:t.cn(`prose prose-sm max-w-none p-4 text-sm`,n),children:e.map((e,n)=>{let r=e.diff||e.diffOperation?.type,i=``;return r===`insert`?i=`bg-green-100/60 dark:bg-green-900/20`:r===`delete`?i=`bg-red-100/60 dark:bg-red-900/20 line-through opacity-60`:r===`update`&&(i=`bg-amber-100/60 dark:bg-amber-900/20`),(0,a.jsx)(`div`,{className:t.cn(`rounded px-1 -mx-1`,i),children:(0,a.jsx)(l,{node:e,diffType:`modified`})},n)})})}function l({node:e,diffType:t}){if(!e)return null;let n=d(e);switch(e.type||`p`){case`h1`:return(0,a.jsx)(`h1`,{className:`text-xl font-bold mt-4 mb-1`,children:n});case`h2`:return(0,a.jsx)(`h2`,{className:`text-lg font-semibold mt-3 mb-1`,children:n});case`h3`:return(0,a.jsx)(`h3`,{className:`text-base font-semibold mt-2 mb-1`,children:n});case`blockquote`:return(0,a.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/30 pl-3 italic text-muted-foreground`,children:n});default:return(0,a.jsx)(`p`,{className:`my-0.5 leading-relaxed`,children:n||`\xA0`})}}function u({original:e,modified:t,mode:n,originalLabel:r,modifiedLabel:i,minHeight:o,editorClassName:c}){return n===`side-by-side`?(0,a.jsxs)(`div`,{className:`flex divide-x border rounded-lg overflow-hidden`,style:{minHeight:o},children:[(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:r}),(0,a.jsx)(s,{nodes:e,diffType:`original`,className:c})]}),(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:i}),(0,a.jsx)(s,{nodes:t,diffType:`modified`,className:c})]})]}):(0,a.jsx)(`div`,{className:`border rounded-lg overflow-hidden`,style:{minHeight:o},children:(0,a.jsxs)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:[`Installez `,(0,a.jsx)(`code`,{className:`bg-muted px-1 rounded`,children:`@platejs/diff`}),` pour la visualisation unifiee des differences.`]})})}function d(e){return typeof e?.text==`string`?e.text:Array.isArray(e?.children)?e.children.map(e=>d(e)).join(``):``}exports.WakaDiffViewer=o;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../badge/index.cjs.js"),r=require("../label/index.cjs.js");let i=require("react");i=e.__toESM(i);let a=require("react/jsx-runtime");var o=i.forwardRef(({original:e,modified:o,mode:l=`inline`,label:d,description:f,className:p,editorClassName:m,minHeight:h=200,showStats:g=!0,originalLabel:_=`Original`,modifiedLabel:v=`Modifie`,onDiffComputed:y},b)=>{let[x,S]=i.useState(null),[C,w]=i.useState({added:0,removed:0,modified:0,unchanged:0}),[T,E]=i.useState(!1);return i.useEffect(()=>{let t=!1;return(async()=>{try{let n=await import(`@platejs/diff`);if(n.computeDiff){let r=n.computeDiff(e,o);if(!t){S(r);let e={added:0,removed:0,modified:0,unchanged:0};if(Array.isArray(r))for(let t of r)t.diff===`insert`||t.diffOperation?.type===`insert`?e.added++:t.diff===`delete`||t.diffOperation?.type===`delete`?e.removed++:t.diff===`update`||t.diffOperation?.type===`update`?e.modified++:e.unchanged++;w(e),y?.(e)}}}catch(e){console.error(`[WakaDiffViewer] Failed to compute diff:`,e),t||E(!0)}})(),()=>{t=!0}},[e,o,y]),T||!x?(0,a.jsxs)(`div`,{ref:b,className:t.cn(`space-y-1.5`,p),children:[d&&(0,a.jsx)(r.Label,{children:d}),f&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),T?(0,a.jsx)(u,{original:e,modified:o,mode:l,originalLabel:_,modifiedLabel:v,minHeight:h,editorClassName:m}):(0,a.jsx)(`div`,{className:`flex items-center justify-center border rounded-lg bg-muted/30`,style:{minHeight:h},children:(0,a.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Calcul des differences...`})})]}):(0,a.jsxs)(`div`,{ref:b,className:t.cn(`space-y-1.5`,p),children:[d&&(0,a.jsx)(r.Label,{children:d}),f&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,a.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`),children:[g&&(0,a.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 border-b bg-muted/30`,children:[(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:`Differences :`}),C.added>0&&(0,a.jsxs)(n.Badge,{variant:`secondary`,className:`bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 text-[10px] h-5`,children:[`+`,C.added,` ajout`,C.added>1?`s`:``]}),C.removed>0&&(0,a.jsxs)(n.Badge,{variant:`secondary`,className:`bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300 text-[10px] h-5`,children:[`-`,C.removed,` suppression`,C.removed>1?`s`:``]}),C.modified>0&&(0,a.jsxs)(n.Badge,{variant:`secondary`,className:`bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300 text-[10px] h-5`,children:[`~`,C.modified,` modification`,C.modified>1?`s`:``]}),C.added===0&&C.removed===0&&C.modified===0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Aucune difference`})]}),l===`side-by-side`?(0,a.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:h},children:[(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:_}),(0,a.jsx)(s,{nodes:e,diffType:`original`,className:m})]}),(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:v}),(0,a.jsx)(s,{nodes:o,diffType:`modified`,className:m})]})]}):(0,a.jsx)(`div`,{style:{minHeight:h},children:(0,a.jsx)(c,{diffNodes:x,className:m})})]})]})});o.displayName=`WakaDiffViewer`;function s({nodes:e,diffType:n,className:r}){return(0,a.jsx)(`div`,{className:t.cn(`prose prose-sm max-w-none p-4 text-sm`,r),children:e.map((e,t)=>(0,a.jsx)(l,{node:e,diffType:n},t))})}function c({diffNodes:e,className:n}){return(0,a.jsx)(`div`,{className:t.cn(`prose prose-sm max-w-none p-4 text-sm`,n),children:e.map((e,n)=>{let r=e.diff||e.diffOperation?.type,i=``;return r===`insert`?i=`bg-green-100/60 dark:bg-green-900/20`:r===`delete`?i=`bg-red-100/60 dark:bg-red-900/20 line-through opacity-60`:r===`update`&&(i=`bg-amber-100/60 dark:bg-amber-900/20`),(0,a.jsx)(`div`,{className:t.cn(`rounded px-1 -mx-1`,i),children:(0,a.jsx)(l,{node:e,diffType:`modified`})},n)})})}function l({node:e,diffType:t}){if(!e)return null;let n=d(e);switch(e.type||`p`){case`h1`:return(0,a.jsx)(`h1`,{className:`text-xl font-bold mt-4 mb-1`,children:n});case`h2`:return(0,a.jsx)(`h2`,{className:`text-lg font-semibold mt-3 mb-1`,children:n});case`h3`:return(0,a.jsx)(`h3`,{className:`text-base font-semibold mt-2 mb-1`,children:n});case`blockquote`:return(0,a.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/30 pl-3 italic text-muted-foreground`,children:n});default:return(0,a.jsx)(`p`,{className:`my-0.5 leading-relaxed`,children:n||`\xA0`})}}function u({original:e,modified:t,mode:n,originalLabel:r,modifiedLabel:i,minHeight:o,editorClassName:c}){return n===`side-by-side`?(0,a.jsxs)(`div`,{className:`flex divide-x border rounded-lg overflow-hidden`,style:{minHeight:o},children:[(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:r}),(0,a.jsx)(s,{nodes:e,diffType:`original`,className:c})]}),(0,a.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,a.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:i}),(0,a.jsx)(s,{nodes:t,diffType:`modified`,className:c})]})]}):(0,a.jsx)(`div`,{className:`border rounded-lg overflow-hidden`,style:{minHeight:o},children:(0,a.jsxs)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:[`Installez `,(0,a.jsx)(`code`,{className:`bg-muted px-1 rounded`,children:`@platejs/diff`}),` pour la visualisation unifiee des differences.`]})})}function d(e){return typeof e?.text==`string`?e.text:Array.isArray(e?.children)?e.children.map(e=>d(e)).join(``):``}exports.WakaDiffViewer=o;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../label/index.cjs.js`),r=require(`../textarea/index.cjs.js`);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);var o=i.forwardRef(({value:e,onChange:o,readOnly:c=!1,placeholder:l=`Glissez-deposez les blocs pour les reorganiser...`,className:u,editorClassName:d,minHeight:f=300,label:p,description:m,error:h,showDragHandles:g=!0,extraPlugins:_,editorRef:v},y)=>{let[b,x]=i.useState(null),[S,C]=i.useState(!1);return i.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/dnd`),import(`@platejs/selection/react`)]),l=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.BlockSelectionPlugin,s.DndPlugin.configure({options:{enableScroller:!0}})];e||x({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDnDEditor] Failed to load:`,t),e||C(!0)}})(),()=>{e=!0}},[]),b?(0,a.jsx)(s,{ref:y,bundle:b,value:e,onChange:o,readOnly:c,placeholder:l,className:u,editorClassName:d,minHeight:f,label:p,description:m,error:h,showDragHandles:g,extraPlugins:_,editorRef:v}):(0,a.jsxs)(`div`,{ref:y,className:t.cn(`space-y-1.5`,u),children:[p&&(0,a.jsx)(n.Label,{children:p}),m&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m}),(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(r.Textarea,{placeholder:l,disabled:!0,style:{minHeight:f}}),(0,a.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,a.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:S?`Erreur de chargement`:`Chargement...`})})]}),h&&(0,a.jsx)(`p`,{className:`text-sm text-destructive`,children:h})]})});o.displayName=`WakaDnDEditor`;var s=i.forwardRef(({bundle:{Plate:e,PlateContent:r,usePlateEditor:o,plugins:s},value:c,onChange:l,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,showDragHandles:v,extraPlugins:y,editorRef:b},x)=>{let S=o({plugins:i.useMemo(()=>[...s,...y??[]],[s,y]),value:c??[{type:`p`,children:[{text:``}]}]});return i.useEffect(()=>{b&&(b.current=S)},[S,b]),(0,a.jsxs)(`div`,{ref:x,className:t.cn(`space-y-1.5`,f),children:[h&&(0,a.jsx)(n.Label,{children:h}),g&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,a.jsx)(e,{editor:S,onChange:l?({value:e})=>l(e):void 0,readOnly:u,children:(0,a.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,_&&`border-destructive`),children:[!u&&v&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30 text-xs text-muted-foreground`,children:[(0,a.jsx)(`span`,{className:`inline-block w-4 text-center`,children:`☰`}),(0,a.jsx)(`span`,{children:`Survolez un bloc pour voir la poignee de glissement`})]}),(0,a.jsx)(`div`,{style:{minHeight:m},children:(0,a.jsx)(r,{placeholder:d,readOnly:u,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,v&&`[&_[data-slate-node='element']]:relative [&_[data-slate-node='element']]:pl-6`,p)})})]})}),_&&(0,a.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});s.displayName=`DnDEditorInner`,exports.WakaDnDEditor=o;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../label/index.cjs.js"),r=require("../textarea/index.cjs.js");let i=require("react");i=e.__toESM(i);let a=require("react/jsx-runtime");var o=i.forwardRef(({value:e,onChange:o,readOnly:c=!1,placeholder:l=`Glissez-deposez les blocs pour les reorganiser...`,className:u,editorClassName:d,minHeight:f=300,label:p,description:m,error:h,showDragHandles:g=!0,extraPlugins:_,editorRef:v},y)=>{let[b,x]=i.useState(null),[S,C]=i.useState(!1);return i.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/dnd`),import(`@platejs/selection/react`)]),l=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.BlockSelectionPlugin,s.DndPlugin.configure({options:{enableScroller:!0}})];e||x({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDnDEditor] Failed to load:`,t),e||C(!0)}})(),()=>{e=!0}},[]),b?(0,a.jsx)(s,{ref:y,bundle:b,value:e,onChange:o,readOnly:c,placeholder:l,className:u,editorClassName:d,minHeight:f,label:p,description:m,error:h,showDragHandles:g,extraPlugins:_,editorRef:v}):(0,a.jsxs)(`div`,{ref:y,className:t.cn(`space-y-1.5`,u),children:[p&&(0,a.jsx)(n.Label,{children:p}),m&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m}),(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(r.Textarea,{placeholder:l,disabled:!0,style:{minHeight:f}}),(0,a.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,a.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:S?`Erreur de chargement`:`Chargement...`})})]}),h&&(0,a.jsx)(`p`,{className:`text-sm text-destructive`,children:h})]})});o.displayName=`WakaDnDEditor`;var s=i.forwardRef(({bundle:{Plate:e,PlateContent:r,usePlateEditor:o,plugins:s},value:c,onChange:l,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,showDragHandles:v,extraPlugins:y,editorRef:b},x)=>{let S=o({plugins:i.useMemo(()=>[...s,...y??[]],[s,y]),value:c??[{type:`p`,children:[{text:``}]}]});return i.useEffect(()=>{b&&(b.current=S)},[S,b]),(0,a.jsxs)(`div`,{ref:x,className:t.cn(`space-y-1.5`,f),children:[h&&(0,a.jsx)(n.Label,{children:h}),g&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,a.jsx)(e,{editor:S,onChange:l?({value:e})=>l(e):void 0,readOnly:u,children:(0,a.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,_&&`border-destructive`),children:[!u&&v&&(0,a.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30 text-xs text-muted-foreground`,children:[(0,a.jsx)(`span`,{className:`inline-block w-4 text-center`,children:`☰`}),(0,a.jsx)(`span`,{children:`Survolez un bloc pour voir la poignee de glissement`})]}),(0,a.jsx)(`div`,{style:{minHeight:m},children:(0,a.jsx)(r,{placeholder:d,readOnly:u,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,v&&`[&_[data-slate-node='element']]:relative [&_[data-slate-node='element']]:pl-6`,p)})})]})}),_&&(0,a.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});s.displayName=`DnDEditorInner`,exports.WakaDnDEditor=o;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../label/index.cjs.js`),r=require(`../scroll-area/index.cjs.js`),i=require(`../textarea/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);var s=[{type:`p`,children:[{text:``}]}],c=a.forwardRef(({value:e,onChange:r,readOnly:s=!1,placeholder:c=`Commencez a rediger votre document...`,className:f,editorClassName:p,minHeight:m=500,label:h,description:g,error:_,title:v,onTitleChange:y,showTOC:b=!0,enableMentions:x=!1,enableSlashCommands:S=!1,enableAI:C=!1,aiEndpoint:w,aiSystemPrompt:T,enableDnD:E=!1,enableMarkdown:D=!0,extraPlugins:O,editorRef:k},A)=>{let[j,M]=a.useState(null),[N,P]=a.useState(!1),[F,I]=a.useState([]),L=a.useRef({enableMentions:x,enableSlashCommands:S,enableAI:C,enableDnD:E,enableMarkdown:D,aiEndpoint:w,aiSystemPrompt:T});return L.current={enableMentions:x,enableSlashCommands:S,enableAI:C,enableDnD:E,enableMarkdown:D,aiEndpoint:w,aiSystemPrompt:T},a.useEffect(()=>{let e=!1;return(async()=>{try{let t=L.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.SuperscriptPlugin,r.SubscriptPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.H5Plugin,r.H6Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.IndentPlugin];try{let{TocPlugin:e}=await import(`@platejs/toc/react`);l.push(e)}catch{}try{let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);l.push(e)}catch{}if(t.enableMentions)try{let{MentionPlugin:e,MentionInputPlugin:t}=await import(`@platejs/mention/react`);l.push(e.configure({options:{trigger:`@`,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),t)}catch{}if(t.enableDnD)try{let{DndPlugin:e}=await import(`@platejs/dnd`);l.push(e)}catch{}if(t.enableMarkdown)try{let{MarkdownPlugin:e}=await import(`@platejs/markdown`);l.push(e)}catch{}if(t.enableAI&&t.aiEndpoint)try{let{AIPlugin:e,AIChatPlugin:n}=await import(`@platejs/ai/react`);l.push(e,n.configure({options:{chat:{api:t.aiEndpoint,body:{system:t.aiSystemPrompt??`You are a helpful writing assistant.`}}}}))}catch{}e||M({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDocumentEditor] Failed to load:`,t),e||P(!0)}})(),()=>{e=!0}},[]),a.useEffect(()=>{if(!b||!e){I([]);return}let t=[],n=0,r=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]);for(let i of e){let e=u(i)?i.type:void 0;if(typeof e==`string`&&r.has(e)){let r=d(i);if(r.trim()){let i=parseInt(e.replace(`h`,``),10);t.push({id:`toc-${n++}`,text:r.trim(),level:i,depth:i-1})}}}I(t)},[e,b]),j?(0,o.jsx)(l,{ref:A,bundle:j,value:e,onChange:r,readOnly:s,placeholder:c,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,title:v,onTitleChange:y,showTOC:b,toc:F,extraPlugins:O,editorRef:k}):(0,o.jsxs)(`div`,{ref:A,className:t.cn(`space-y-1.5`,f),children:[h&&(0,o.jsx)(n.Label,{children:h}),g&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(i.Textarea,{placeholder:c,disabled:!0,style:{minHeight:m}}),(0,o.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:N?`Erreur de chargement de l'editeur`:`Chargement de l'editeur...`})})]}),_&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});c.displayName=`WakaDocumentEditor`;var l=a.forwardRef(({bundle:{Plate:e,PlateContent:i,usePlateEditor:c,plugins:l},value:u,onChange:d,readOnly:f,placeholder:p,className:m,editorClassName:h,minHeight:g,label:_,description:v,error:y,title:b,onTitleChange:x,showTOC:S,toc:C,extraPlugins:w,editorRef:T},E)=>{let D=c({plugins:a.useMemo(()=>[...l,...w??[]],[l,w]),value:u??s});return a.useEffect(()=>{T&&(T.current=D)},[D,T]),(0,o.jsxs)(`div`,{ref:E,className:t.cn(`space-y-1.5`,m),children:[_&&(0,o.jsx)(n.Label,{children:_}),v&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v}),(0,o.jsx)(e,{editor:D,onChange:d?({value:e})=>d(e):void 0,readOnly:f,children:(0,o.jsxs)(`div`,{className:t.cn(`flex border rounded-lg overflow-hidden`,y&&`border-destructive`),children:[S&&C.length>0&&(0,o.jsxs)(`aside`,{className:`w-56 shrink-0 border-r bg-muted/20 hidden lg:block`,children:[(0,o.jsx)(`div`,{className:`p-3 border-b`,children:(0,o.jsx)(`h4`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Table des matieres`})}),(0,o.jsx)(r.ScrollArea,{className:`h-full max-h-[600px]`,children:(0,o.jsx)(`nav`,{className:`p-2 space-y-0.5`,children:C.map(e=>(0,o.jsx)(`button`,{className:t.cn(`block w-full text-left px-2 py-1 rounded-md text-sm`,`hover:bg-accent/50 transition-colors truncate`,`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${e.depth*12+8}px`},title:e.text,children:e.text},e.id))})})]}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(b!==void 0||x)&&(0,o.jsx)(`div`,{className:`border-b px-6 py-4`,children:(0,o.jsx)(`input`,{type:`text`,value:b??``,onChange:e=>x?.(e.target.value),placeholder:`Titre du document`,readOnly:f,className:t.cn(`w-full bg-transparent text-2xl font-bold text-foreground`,`placeholder:text-muted-foreground/50`,`focus:outline-none`)})}),(0,o.jsx)(`div`,{style:{minHeight:g},children:(0,o.jsx)(i,{placeholder:p,readOnly:f,className:t.cn(`prose prose-sm max-w-none px-6 py-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,h)})})]})]})}),y&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:y})]})});l.displayName=`DocumentEditorInner`;function u(e){return`children`in e&&Array.isArray(e.children)}function d(e){return`text`in e&&typeof e.text==`string`?e.text:u(e)?e.children.map(e=>d(e)).join(``):``}exports.WakaDocumentEditor=c;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../label/index.cjs.js"),r=require("../scroll-area/index.cjs.js"),i=require("../textarea/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("react/jsx-runtime");var s=[{type:`p`,children:[{text:``}]}],c=a.forwardRef(({value:e,onChange:r,readOnly:s=!1,placeholder:c=`Commencez a rediger votre document...`,className:f,editorClassName:p,minHeight:m=500,label:h,description:g,error:_,title:v,onTitleChange:y,showTOC:b=!0,enableMentions:x=!1,enableSlashCommands:S=!1,enableAI:C=!1,aiEndpoint:w,aiSystemPrompt:T,enableDnD:E=!1,enableMarkdown:D=!0,extraPlugins:O,editorRef:k},A)=>{let[j,M]=a.useState(null),[N,P]=a.useState(!1),[F,I]=a.useState([]),L=a.useRef({enableMentions:x,enableSlashCommands:S,enableAI:C,enableDnD:E,enableMarkdown:D,aiEndpoint:w,aiSystemPrompt:T});return L.current={enableMentions:x,enableSlashCommands:S,enableAI:C,enableDnD:E,enableMarkdown:D,aiEndpoint:w,aiSystemPrompt:T},a.useEffect(()=>{let e=!1;return(async()=>{try{let t=L.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.SuperscriptPlugin,r.SubscriptPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.H5Plugin,r.H6Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.IndentPlugin];try{let{TocPlugin:e}=await import(`@platejs/toc/react`);l.push(e)}catch{}try{let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);l.push(e)}catch{}if(t.enableMentions)try{let{MentionPlugin:e,MentionInputPlugin:t}=await import(`@platejs/mention/react`);l.push(e.configure({options:{trigger:`@`,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),t)}catch{}if(t.enableDnD)try{let{DndPlugin:e}=await import(`@platejs/dnd`);l.push(e)}catch{}if(t.enableMarkdown)try{let{MarkdownPlugin:e}=await import(`@platejs/markdown`);l.push(e)}catch{}if(t.enableAI&&t.aiEndpoint)try{let{AIPlugin:e,AIChatPlugin:n}=await import(`@platejs/ai/react`);l.push(e,n.configure({options:{chat:{api:t.aiEndpoint,body:{system:t.aiSystemPrompt??`You are a helpful writing assistant.`}}}}))}catch{}e||M({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDocumentEditor] Failed to load:`,t),e||P(!0)}})(),()=>{e=!0}},[]),a.useEffect(()=>{if(!b||!e){I([]);return}let t=[],n=0,r=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]);for(let i of e){let e=u(i)?i.type:void 0;if(typeof e==`string`&&r.has(e)){let r=d(i);if(r.trim()){let i=parseInt(e.replace(`h`,``),10);t.push({id:`toc-${n++}`,text:r.trim(),level:i,depth:i-1})}}}I(t)},[e,b]),j?(0,o.jsx)(l,{ref:A,bundle:j,value:e,onChange:r,readOnly:s,placeholder:c,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,title:v,onTitleChange:y,showTOC:b,toc:F,extraPlugins:O,editorRef:k}):(0,o.jsxs)(`div`,{ref:A,className:t.cn(`space-y-1.5`,f),children:[h&&(0,o.jsx)(n.Label,{children:h}),g&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(i.Textarea,{placeholder:c,disabled:!0,style:{minHeight:m}}),(0,o.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:N?`Erreur de chargement de l'editeur`:`Chargement de l'editeur...`})})]}),_&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});c.displayName=`WakaDocumentEditor`;var l=a.forwardRef(({bundle:{Plate:e,PlateContent:i,usePlateEditor:c,plugins:l},value:u,onChange:d,readOnly:f,placeholder:p,className:m,editorClassName:h,minHeight:g,label:_,description:v,error:y,title:b,onTitleChange:x,showTOC:S,toc:C,extraPlugins:w,editorRef:T},E)=>{let D=c({plugins:a.useMemo(()=>[...l,...w??[]],[l,w]),value:u??s});return a.useEffect(()=>{T&&(T.current=D)},[D,T]),(0,o.jsxs)(`div`,{ref:E,className:t.cn(`space-y-1.5`,m),children:[_&&(0,o.jsx)(n.Label,{children:_}),v&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v}),(0,o.jsx)(e,{editor:D,onChange:d?({value:e})=>d(e):void 0,readOnly:f,children:(0,o.jsxs)(`div`,{className:t.cn(`flex border rounded-lg overflow-hidden`,y&&`border-destructive`),children:[S&&C.length>0&&(0,o.jsxs)(`aside`,{className:`w-56 shrink-0 border-r bg-muted/20 hidden lg:block`,children:[(0,o.jsx)(`div`,{className:`p-3 border-b`,children:(0,o.jsx)(`h4`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Table des matieres`})}),(0,o.jsx)(r.ScrollArea,{className:`h-full max-h-[600px]`,children:(0,o.jsx)(`nav`,{className:`p-2 space-y-0.5`,children:C.map(e=>(0,o.jsx)(`button`,{className:t.cn(`block w-full text-left px-2 py-1 rounded-md text-sm`,`hover:bg-accent/50 transition-colors truncate`,`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${e.depth*12+8}px`},title:e.text,children:e.text},e.id))})})]}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(b!==void 0||x)&&(0,o.jsx)(`div`,{className:`border-b px-6 py-4`,children:(0,o.jsx)(`input`,{type:`text`,value:b??``,onChange:e=>x?.(e.target.value),placeholder:`Titre du document`,readOnly:f,className:t.cn(`w-full bg-transparent text-2xl font-bold text-foreground`,`placeholder:text-muted-foreground/50`,`focus:outline-none`)})}),(0,o.jsx)(`div`,{style:{minHeight:g},children:(0,o.jsx)(i,{placeholder:p,readOnly:f,className:t.cn(`prose prose-sm max-w-none px-6 py-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,h)})})]})]})}),y&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:y})]})});l.displayName=`DocumentEditorInner`;function u(e){return`children`in e&&Array.isArray(e.children)}function d(e){return`text`in e&&typeof e.text==`string`?e.text:u(e)?e.children.map(e=>d(e)).join(``):``}exports.WakaDocumentEditor=c;
@@ -119,7 +119,7 @@ var s = [{
119
119
  L([]);
120
120
  return;
121
121
  }
122
- let e = [], t = 0, r = new Set([
122
+ let e = [], t = 0, r = /* @__PURE__ */ new Set([
123
123
  "h1",
124
124
  "h2",
125
125
  "h3",
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);function i({children:e,attributes:n,className:i}){return(0,r.jsx)(`table`,{...n,className:t.cn(`w-full border-collapse text-sm my-4`,`border border-border rounded-lg overflow-hidden`,i),children:(0,r.jsx)(`tbody`,{children:e})})}i.displayName=`TableElement`;function a({children:e,attributes:n,className:i}){return(0,r.jsx)(`tr`,{...n,className:t.cn(`border-b border-border last:border-b-0`,i),children:e})}a.displayName=`TableRowElement`;function o({children:e,attributes:n,className:i}){return(0,r.jsx)(`td`,{...n,className:t.cn(`px-3 py-2 text-sm text-foreground`,`border-r border-border last:border-r-0`,i),children:e})}o.displayName=`TableCellElement`;function s({children:e,attributes:n,className:i}){return(0,r.jsx)(`th`,{...n,className:t.cn(`px-3 py-2 text-xs font-bold uppercase tracking-wider`,`text-muted-foreground text-left bg-muted/50`,`border-r border-border last:border-r-0`,i),children:e})}s.displayName=`TableCellHeaderElement`;function c({children:e,attributes:n,className:i}){return(0,r.jsx)(`div`,{...n,className:t.cn(`flex gap-6 my-4`,i),children:e})}c.displayName=`ColumnGroupElement`;function l({children:e,attributes:n,className:i}){return(0,r.jsx)(`div`,{...n,className:t.cn(`flex-1 min-w-0`,i),children:e})}l.displayName=`ColumnElement`;var u={info:`bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-950/30 dark:border-blue-800 dark:text-blue-200`,warning:`bg-amber-50 border-amber-200 text-amber-900 dark:bg-amber-950/30 dark:border-amber-800 dark:text-amber-200`,success:`bg-green-50 border-green-200 text-green-900 dark:bg-green-950/30 dark:border-green-800 dark:text-green-200`,error:`bg-red-50 border-red-200 text-red-900 dark:bg-red-950/30 dark:border-red-800 dark:text-red-200`,dark:`bg-card border-border text-card-foreground`};function d({children:e,attributes:n,element:i,className:a}){let o=u[i?.variant||`info`]??u.info;return(0,r.jsx)(`div`,{...n,className:t.cn(`border rounded-xl p-4 my-3`,o,a),children:e})}d.displayName=`CalloutElement`;function f({children:e,attributes:n,className:i}){return(0,r.jsx)(`h1`,{...n,className:t.cn(`text-2xl font-extrabold text-foreground mt-8 mb-2 first:mt-0`,i),children:e})}f.displayName=`H1Element`;function p({children:e,attributes:n,className:i}){return(0,r.jsx)(`h2`,{...n,className:t.cn(`text-sm font-bold text-foreground uppercase tracking-wider`,`mt-6 mb-3 border-b-2 border-border pb-1.5`,i),children:e})}p.displayName=`H2Element`;function m({children:e,attributes:n,className:i}){return(0,r.jsx)(`h3`,{...n,className:t.cn(`text-sm font-semibold text-primary italic mt-1 mb-4`,i),children:e})}m.displayName=`H3Element`;function h({children:e,attributes:n,className:i}){return(0,r.jsx)(`h4`,{...n,className:t.cn(`text-xs font-bold text-primary uppercase tracking-wide mt-2 mb-0.5`,i),children:e})}h.displayName=`H4Element`;function g({children:e,attributes:n,className:i}){return(0,r.jsx)(`h5`,{...n,className:t.cn(`text-xs font-semibold text-muted-foreground mt-2 mb-0.5`,i),children:e})}g.displayName=`H5Element`;function _({children:e,attributes:n,className:i}){return(0,r.jsx)(`h6`,{...n,className:t.cn(`text-xs font-medium text-muted-foreground mt-2 mb-0.5`,i),children:e})}_.displayName=`H6Element`;function v({children:e,attributes:n,className:i}){return(0,r.jsx)(`blockquote`,{...n,className:t.cn(`border-l-3 border-primary/50 pl-4 py-2`,`bg-muted/30 rounded-r-lg`,`italic text-muted-foreground`,`my-3`,i),children:e})}v.displayName=`BlockquoteElement`;function y({children:e,attributes:n,className:i}){return(0,r.jsx)(`p`,{...n,className:t.cn(`text-sm leading-relaxed text-foreground my-0.5`,i),children:e})}y.displayName=`ParagraphElement`;function b({children:e,attributes:n,element:i,className:a}){return(0,r.jsx)(`a`,{...n,href:i?.url,target:`_blank`,rel:`noopener noreferrer`,className:t.cn(`text-primary underline decoration-primary/30 hover:decoration-primary`,`transition-colors cursor-pointer`,a),children:e})}b.displayName=`LinkElement`;function x({children:e,attributes:n,element:i,className:a}){return(0,r.jsxs)(`span`,{...n,contentEditable:!1,className:t.cn(`inline-flex items-center rounded-md px-1.5 py-0.5`,`bg-primary/10 text-primary text-sm font-medium`,`border border-primary/20`,a),children:[`@`,i?.value||`unknown`,e]})}x.displayName=`MentionElement`;function S({attributes:e,className:n}){return(0,r.jsx)(`div`,{...e,className:t.cn(`my-6`,n),children:(0,r.jsx)(`hr`,{className:`border-border`})})}S.displayName=`SeparatorElement`,exports.BlockquoteElement=v,exports.CalloutElement=d,exports.ColumnElement=l,exports.ColumnGroupElement=c,exports.H1Element=f,exports.H2Element=p,exports.H3Element=m,exports.H4Element=h,exports.H5Element=g,exports.H6Element=_,exports.LinkElement=b,exports.MentionElement=x,exports.ParagraphElement=y,exports.SeparatorElement=S,exports.TableCellElement=o,exports.TableCellHeaderElement=s,exports.TableElement=i,exports.TableRowElement=a;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");function i({children:e,attributes:n,className:i}){return(0,r.jsx)(`table`,{...n,className:t.cn(`w-full border-collapse text-sm my-4`,`border border-border rounded-lg overflow-hidden`,i),children:(0,r.jsx)(`tbody`,{children:e})})}i.displayName=`TableElement`;function a({children:e,attributes:n,className:i}){return(0,r.jsx)(`tr`,{...n,className:t.cn(`border-b border-border last:border-b-0`,i),children:e})}a.displayName=`TableRowElement`;function o({children:e,attributes:n,className:i}){return(0,r.jsx)(`td`,{...n,className:t.cn(`px-3 py-2 text-sm text-foreground`,`border-r border-border last:border-r-0`,i),children:e})}o.displayName=`TableCellElement`;function s({children:e,attributes:n,className:i}){return(0,r.jsx)(`th`,{...n,className:t.cn(`px-3 py-2 text-xs font-bold uppercase tracking-wider`,`text-muted-foreground text-left bg-muted/50`,`border-r border-border last:border-r-0`,i),children:e})}s.displayName=`TableCellHeaderElement`;function c({children:e,attributes:n,className:i}){return(0,r.jsx)(`div`,{...n,className:t.cn(`flex gap-6 my-4`,i),children:e})}c.displayName=`ColumnGroupElement`;function l({children:e,attributes:n,className:i}){return(0,r.jsx)(`div`,{...n,className:t.cn(`flex-1 min-w-0`,i),children:e})}l.displayName=`ColumnElement`;var u={info:`bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-950/30 dark:border-blue-800 dark:text-blue-200`,warning:`bg-amber-50 border-amber-200 text-amber-900 dark:bg-amber-950/30 dark:border-amber-800 dark:text-amber-200`,success:`bg-green-50 border-green-200 text-green-900 dark:bg-green-950/30 dark:border-green-800 dark:text-green-200`,error:`bg-red-50 border-red-200 text-red-900 dark:bg-red-950/30 dark:border-red-800 dark:text-red-200`,dark:`bg-card border-border text-card-foreground`};function d({children:e,attributes:n,element:i,className:a}){let o=u[i?.variant||`info`]??u.info;return(0,r.jsx)(`div`,{...n,className:t.cn(`border rounded-xl p-4 my-3`,o,a),children:e})}d.displayName=`CalloutElement`;function f({children:e,attributes:n,className:i}){return(0,r.jsx)(`h1`,{...n,className:t.cn(`text-2xl font-extrabold text-foreground mt-8 mb-2 first:mt-0`,i),children:e})}f.displayName=`H1Element`;function p({children:e,attributes:n,className:i}){return(0,r.jsx)(`h2`,{...n,className:t.cn(`text-sm font-bold text-foreground uppercase tracking-wider`,`mt-6 mb-3 border-b-2 border-border pb-1.5`,i),children:e})}p.displayName=`H2Element`;function m({children:e,attributes:n,className:i}){return(0,r.jsx)(`h3`,{...n,className:t.cn(`text-sm font-semibold text-primary italic mt-1 mb-4`,i),children:e})}m.displayName=`H3Element`;function h({children:e,attributes:n,className:i}){return(0,r.jsx)(`h4`,{...n,className:t.cn(`text-xs font-bold text-primary uppercase tracking-wide mt-2 mb-0.5`,i),children:e})}h.displayName=`H4Element`;function g({children:e,attributes:n,className:i}){return(0,r.jsx)(`h5`,{...n,className:t.cn(`text-xs font-semibold text-muted-foreground mt-2 mb-0.5`,i),children:e})}g.displayName=`H5Element`;function _({children:e,attributes:n,className:i}){return(0,r.jsx)(`h6`,{...n,className:t.cn(`text-xs font-medium text-muted-foreground mt-2 mb-0.5`,i),children:e})}_.displayName=`H6Element`;function v({children:e,attributes:n,className:i}){return(0,r.jsx)(`blockquote`,{...n,className:t.cn(`border-l-3 border-primary/50 pl-4 py-2`,`bg-muted/30 rounded-r-lg`,`italic text-muted-foreground`,`my-3`,i),children:e})}v.displayName=`BlockquoteElement`;function y({children:e,attributes:n,className:i}){return(0,r.jsx)(`p`,{...n,className:t.cn(`text-sm leading-relaxed text-foreground my-0.5`,i),children:e})}y.displayName=`ParagraphElement`;function b({children:e,attributes:n,element:i,className:a}){return(0,r.jsx)(`a`,{...n,href:i?.url,target:`_blank`,rel:`noopener noreferrer`,className:t.cn(`text-primary underline decoration-primary/30 hover:decoration-primary`,`transition-colors cursor-pointer`,a),children:e})}b.displayName=`LinkElement`;function x({children:e,attributes:n,element:i,className:a}){return(0,r.jsxs)(`span`,{...n,contentEditable:!1,className:t.cn(`inline-flex items-center rounded-md px-1.5 py-0.5`,`bg-primary/10 text-primary text-sm font-medium`,`border border-primary/20`,a),children:[`@`,i?.value||`unknown`,e]})}x.displayName=`MentionElement`;function S({attributes:e,className:n}){return(0,r.jsx)(`div`,{...e,className:t.cn(`my-6`,n),children:(0,r.jsx)(`hr`,{className:`border-border`})})}S.displayName=`SeparatorElement`,exports.BlockquoteElement=v,exports.CalloutElement=d,exports.ColumnElement=l,exports.ColumnGroupElement=c,exports.H1Element=f,exports.H2Element=p,exports.H3Element=m,exports.H4Element=h,exports.H5Element=g,exports.H6Element=_,exports.LinkElement=b,exports.MentionElement=x,exports.ParagraphElement=y,exports.SeparatorElement=S,exports.TableCellElement=o,exports.TableCellHeaderElement=s,exports.TableElement=i,exports.TableRowElement=a;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);function i({children:e,attributes:n,className:i}){return(0,r.jsx)(`strong`,{...n,className:t.cn(`font-bold`,i),children:e})}i.displayName=`BoldLeaf`;function a({children:e,attributes:n,className:i}){return(0,r.jsx)(`em`,{...n,className:t.cn(`italic`,i),children:e})}a.displayName=`ItalicLeaf`;function o({children:e,attributes:n,className:i}){return(0,r.jsx)(`span`,{...n,className:t.cn(`underline decoration-foreground/50`,i),children:e})}o.displayName=`UnderlineLeaf`;function s({children:e,attributes:n,className:i}){return(0,r.jsx)(`s`,{...n,className:t.cn(`line-through text-muted-foreground`,i),children:e})}s.displayName=`StrikethroughLeaf`;function c({children:e,attributes:n,className:i}){return(0,r.jsx)(`code`,{...n,className:t.cn(`rounded-md bg-muted px-1.5 py-0.5`,`font-mono text-[0.85em] text-foreground`,i),children:e})}c.displayName=`CodeLeaf`;function l({children:e,attributes:n,className:i}){return(0,r.jsx)(`mark`,{...n,className:t.cn(`bg-yellow-200/60 dark:bg-yellow-500/30`,`rounded-sm px-0.5`,i),children:e})}l.displayName=`HighlightLeaf`;function u({children:e,attributes:n,className:i}){return(0,r.jsx)(`sup`,{...n,className:t.cn(`text-[0.75em]`,i),children:e})}u.displayName=`SuperscriptLeaf`;function d({children:e,attributes:n,className:i}){return(0,r.jsx)(`sub`,{...n,className:t.cn(`text-[0.75em]`,i),children:e})}d.displayName=`SubscriptLeaf`,exports.BoldLeaf=i,exports.CodeLeaf=c,exports.HighlightLeaf=l,exports.ItalicLeaf=a,exports.StrikethroughLeaf=s,exports.SubscriptLeaf=d,exports.SuperscriptLeaf=u,exports.UnderlineLeaf=o;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");function i({children:e,attributes:n,className:i}){return(0,r.jsx)(`strong`,{...n,className:t.cn(`font-bold`,i),children:e})}i.displayName=`BoldLeaf`;function a({children:e,attributes:n,className:i}){return(0,r.jsx)(`em`,{...n,className:t.cn(`italic`,i),children:e})}a.displayName=`ItalicLeaf`;function o({children:e,attributes:n,className:i}){return(0,r.jsx)(`span`,{...n,className:t.cn(`underline decoration-foreground/50`,i),children:e})}o.displayName=`UnderlineLeaf`;function s({children:e,attributes:n,className:i}){return(0,r.jsx)(`s`,{...n,className:t.cn(`line-through text-muted-foreground`,i),children:e})}s.displayName=`StrikethroughLeaf`;function c({children:e,attributes:n,className:i}){return(0,r.jsx)(`code`,{...n,className:t.cn(`rounded-md bg-muted px-1.5 py-0.5`,`font-mono text-[0.85em] text-foreground`,i),children:e})}c.displayName=`CodeLeaf`;function l({children:e,attributes:n,className:i}){return(0,r.jsx)(`mark`,{...n,className:t.cn(`bg-yellow-200/60 dark:bg-yellow-500/30`,`rounded-sm px-0.5`,i),children:e})}l.displayName=`HighlightLeaf`;function u({children:e,attributes:n,className:i}){return(0,r.jsx)(`sup`,{...n,className:t.cn(`text-[0.75em]`,i),children:e})}u.displayName=`SuperscriptLeaf`;function d({children:e,attributes:n,className:i}){return(0,r.jsx)(`sub`,{...n,className:t.cn(`text-[0.75em]`,i),children:e})}d.displayName=`SubscriptLeaf`,exports.BoldLeaf=i,exports.CodeLeaf=c,exports.HighlightLeaf=l,exports.ItalicLeaf=a,exports.StrikethroughLeaf=s,exports.SubscriptLeaf=d,exports.SuperscriptLeaf=u,exports.UnderlineLeaf=o;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../button/index.cjs.js`),r=require(`../separator/index.cjs.js`),i=require(`../tooltip/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`lucide-react`),s=require(`react/jsx-runtime`);function c(e,t){try{t(e.chain().focus())}catch{}}function l(e,t,n){try{return e.isActive(t,n)}catch{return!1}}var u={bold:{icon:o.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>c(e,e=>e.toggleBold().run()),isActive:e=>l(e,`bold`)},italic:{icon:o.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>c(e,e=>e.toggleItalic().run()),isActive:e=>l(e,`italic`)},underline:{icon:o.Underline,label:`Souligné`,shortcut:`Ctrl+U`,action:e=>c(e,e=>e.toggleUnderline().run()),isActive:e=>l(e,`underline`)},strikethrough:{icon:o.Strikethrough,label:`Barré`,shortcut:`Ctrl+Shift+S`,action:e=>c(e,e=>e.toggleStrike().run()),isActive:e=>l(e,`strikethrough`)},code:{icon:o.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>c(e,e=>e.toggleCode().run()),isActive:e=>l(e,`code`)},highlight:{icon:o.Highlighter,label:`Surligné`,action:e=>c(e,e=>e.toggleHighlight().run()),isActive:e=>l(e,`highlight`)},h1:{icon:o.Heading1,label:`Titre 1`,action:e=>{try{e.tf.h1.toggle()}catch{c(e,e=>e.toggleHeading({level:1}).run())}},isActive:e=>l(e,`heading`,{level:1})},h2:{icon:o.Heading2,label:`Titre 2`,action:e=>{try{e.tf.h2.toggle()}catch{c(e,e=>e.toggleHeading({level:2}).run())}},isActive:e=>l(e,`heading`,{level:2})},h3:{icon:o.Heading3,label:`Titre 3`,action:e=>{try{e.tf.h3.toggle()}catch{c(e,e=>e.toggleHeading({level:3}).run())}},isActive:e=>l(e,`heading`,{level:3})},blockquote:{icon:o.Quote,label:`Citation`,action:e=>{try{e.tf.blockquote.toggle()}catch{c(e,e=>e.toggleBlockquote().run())}},isActive:e=>l(e,`blockquote`)},callout:{icon:o.MessageSquarePlus,label:`Callout`,action:e=>{try{e.tf.callout.insert()}catch{}},isActive:e=>l(e,`callout`)},table:{icon:o.Table,label:`Tableau`,action:e=>{try{e.tf.table.insert({rows:3,cols:3})}catch{}},isActive:e=>l(e,`table`)},columns:{icon:o.Columns2,label:`Colonnes`,action:e=>{try{e.tf.column.insert()}catch{}},isActive:e=>l(e,`column_group`)},link:{icon:o.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>l(e,`a`)},image:{icon:o.Image,label:`Image`,action:e=>{try{e.tf.image.insert({url:``})}catch{}},isActive:()=>!1},separator:{icon:o.Minus,label:`Séparateur`,action:e=>{try{c(e,e=>e.insertBreak().run())}catch{}},isActive:()=>!1},ai:{icon:o.Sparkles,label:`Assistant IA`,action:()=>{},isActive:()=>!1}},d=[[`bold`,`italic`,`underline`,`strikethrough`,`code`,`highlight`],[`h1`,`h2`,`h3`],[`blockquote`,`callout`,`table`,`columns`],[`link`,`image`,`separator`]];function f({groups:e=d,editor:o,className:c,enableAI:l=!1,onAIClick:f}){let p=a.useMemo(()=>l?[...e,[`ai`]]:e,[e,l]);return(0,s.jsx)(i.TooltipProvider,{delayDuration:300,children:(0,s.jsx)(`div`,{role:`toolbar`,"aria-label":`Barre d'outils de formatage`,className:t.cn(`flex flex-wrap items-center gap-0.5 p-1`,`border-b bg-muted/30`,c),children:p.map((e,t)=>(0,s.jsxs)(a.Fragment,{children:[t>0&&(0,s.jsx)(r.Separator,{orientation:`vertical`,className:`mx-1 h-6`}),e.map(e=>{let t=u[e];if(!t)return null;let r=t.isActive?.(o)??!1,a=t.shortcut?`${t.label} (${t.shortcut})`:t.label,c=t.icon;return(0,s.jsxs)(i.Tooltip,{children:[(0,s.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(n.Button,{type:`button`,variant:r?`secondary`:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>{if(e===`ai`&&f){f();return}t.action(o)},"aria-label":t.label,"aria-pressed":r,children:(0,s.jsx)(c,{className:`h-4 w-4`})})}),(0,s.jsx)(i.TooltipContent,{side:`bottom`,className:`text-xs`,children:a})]},e)})]},t))})})}f.displayName=`WakaEditorToolbar`,exports.DEFAULT_TOOLBAR_GROUPS=d,exports.WakaEditorToolbar=f;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../button/index.cjs.js"),r=require("../separator/index.cjs.js"),i=require("../tooltip/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("lucide-react"),s=require("react/jsx-runtime");function c(e,t){try{t(e.chain().focus())}catch{}}function l(e,t,n){try{return e.isActive(t,n)}catch{return!1}}var u={bold:{icon:o.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>c(e,e=>e.toggleBold().run()),isActive:e=>l(e,`bold`)},italic:{icon:o.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>c(e,e=>e.toggleItalic().run()),isActive:e=>l(e,`italic`)},underline:{icon:o.Underline,label:`Souligné`,shortcut:`Ctrl+U`,action:e=>c(e,e=>e.toggleUnderline().run()),isActive:e=>l(e,`underline`)},strikethrough:{icon:o.Strikethrough,label:`Barré`,shortcut:`Ctrl+Shift+S`,action:e=>c(e,e=>e.toggleStrike().run()),isActive:e=>l(e,`strikethrough`)},code:{icon:o.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>c(e,e=>e.toggleCode().run()),isActive:e=>l(e,`code`)},highlight:{icon:o.Highlighter,label:`Surligné`,action:e=>c(e,e=>e.toggleHighlight().run()),isActive:e=>l(e,`highlight`)},h1:{icon:o.Heading1,label:`Titre 1`,action:e=>{try{e.tf.h1.toggle()}catch{c(e,e=>e.toggleHeading({level:1}).run())}},isActive:e=>l(e,`heading`,{level:1})},h2:{icon:o.Heading2,label:`Titre 2`,action:e=>{try{e.tf.h2.toggle()}catch{c(e,e=>e.toggleHeading({level:2}).run())}},isActive:e=>l(e,`heading`,{level:2})},h3:{icon:o.Heading3,label:`Titre 3`,action:e=>{try{e.tf.h3.toggle()}catch{c(e,e=>e.toggleHeading({level:3}).run())}},isActive:e=>l(e,`heading`,{level:3})},blockquote:{icon:o.Quote,label:`Citation`,action:e=>{try{e.tf.blockquote.toggle()}catch{c(e,e=>e.toggleBlockquote().run())}},isActive:e=>l(e,`blockquote`)},callout:{icon:o.MessageSquarePlus,label:`Callout`,action:e=>{try{e.tf.callout.insert()}catch{}},isActive:e=>l(e,`callout`)},table:{icon:o.Table,label:`Tableau`,action:e=>{try{e.tf.table.insert({rows:3,cols:3})}catch{}},isActive:e=>l(e,`table`)},columns:{icon:o.Columns2,label:`Colonnes`,action:e=>{try{e.tf.column.insert()}catch{}},isActive:e=>l(e,`column_group`)},link:{icon:o.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>l(e,`a`)},image:{icon:o.Image,label:`Image`,action:e=>{try{e.tf.image.insert({url:``})}catch{}},isActive:()=>!1},separator:{icon:o.Minus,label:`Séparateur`,action:e=>{try{c(e,e=>e.insertBreak().run())}catch{}},isActive:()=>!1},ai:{icon:o.Sparkles,label:`Assistant IA`,action:()=>{},isActive:()=>!1}},d=[[`bold`,`italic`,`underline`,`strikethrough`,`code`,`highlight`],[`h1`,`h2`,`h3`],[`blockquote`,`callout`,`table`,`columns`],[`link`,`image`,`separator`]];function f({groups:e=d,editor:o,className:c,enableAI:l=!1,onAIClick:f}){let p=a.useMemo(()=>l?[...e,[`ai`]]:e,[e,l]);return(0,s.jsx)(i.TooltipProvider,{delayDuration:300,children:(0,s.jsx)(`div`,{role:`toolbar`,"aria-label":`Barre d'outils de formatage`,className:t.cn(`flex flex-wrap items-center gap-0.5 p-1`,`border-b bg-muted/30`,c),children:p.map((e,t)=>(0,s.jsxs)(a.Fragment,{children:[t>0&&(0,s.jsx)(r.Separator,{orientation:`vertical`,className:`mx-1 h-6`}),e.map(e=>{let t=u[e];if(!t)return null;let r=t.isActive?.(o)??!1,a=t.shortcut?`${t.label} (${t.shortcut})`:t.label,c=t.icon;return(0,s.jsxs)(i.Tooltip,{children:[(0,s.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(n.Button,{type:`button`,variant:r?`secondary`:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>{if(e===`ai`&&f){f();return}t.action(o)},"aria-label":t.label,"aria-pressed":r,children:(0,s.jsx)(c,{className:`h-4 w-4`})})}),(0,s.jsx)(i.TooltipContent,{side:`bottom`,className:`text-xs`,children:a})]},e)})]},t))})})}f.displayName=`WakaEditorToolbar`,exports.DEFAULT_TOOLBAR_GROUPS=d,exports.WakaEditorToolbar=f;
@@ -1,2 +1,2 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../label/index.cjs.js`),r=require(`../textarea/index.cjs.js`),i=require(`./waka-editor-toolbar.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);var s=a.forwardRef(({value:e,onChange:t,readOnly:n=!1,placeholder:r=`Commencez a ecrire...`,className:s,editorClassName:u,minHeight:d=200,label:f,description:p,error:m,preset:h=`standard`,enableAI:g=!1,enableMarkdown:_=!1,enableMedia:v=!1,enableMentions:y=!1,enableDnD:b=!1,enableTOC:x=!1,toolbarGroups:S=i.DEFAULT_TOOLBAR_GROUPS,hideToolbar:C=!1,onAIClick:w,extraPlugins:T,editorRef:E},D)=>{let[O,k]=a.useState(null),[A,j]=a.useState(!1);return a.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n]=await Promise.all([import(`platejs/react`),Promise.resolve().then(()=>require(`./waka-editor-plugins.cjs.js`))]),r=await n.loadCorePlugins(),i=n.getPresetLoaders(h),a=await Promise.all(i.map(e=>e())),o=[];_&&o.push(n.loadMarkdownPlugin()),v&&o.push(n.loadMediaPlugins()),y&&o.push(n.loadMentionPlugins()),b&&o.push(n.loadDndPlugin()),x&&o.push(n.loadTocPlugin());let s=await Promise.all(o),c=[...r,...a.flat(),...s.flat(),...T??[]];e||k({components:{Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor},plugins:c})}catch{e||j(!0)}})(),()=>{e=!0}},[h,_,v,y,b,x,T]),O?(0,o.jsx)(c,{ref:D,components:O.components,plugins:O.plugins,value:e,onChange:t,readOnly:n,placeholder:r,className:s,editorClassName:u,minHeight:d,label:f,description:p,error:m,enableAI:g,toolbarGroups:S,hideToolbar:C,onAIClick:w,editorRef:E}):(0,o.jsx)(l,{ref:D,value:e,onChange:t,placeholder:r,className:s,minHeight:d,label:f,description:p,error:m,loading:!A,readOnly:n})});s.displayName=`WakaEditor`;var c=a.forwardRef(({components:{Plate:e,PlateContent:r,usePlateEditor:s},plugins:c,value:l,onChange:u,readOnly:d=!1,placeholder:f,className:p,editorClassName:m,minHeight:h,label:g,description:_,error:v,enableAI:y,toolbarGroups:b,hideToolbar:x,onAIClick:S,editorRef:C},w)=>{let T=s({plugins:c,value:l??[{type:`p`,children:[{text:``}]}]});return a.useEffect(()=>{C&&(C.current=T)},[T,C]),(0,o.jsxs)(`div`,{ref:w,className:t.cn(`space-y-1.5`,p),children:[g&&(0,o.jsx)(n.Label,{children:g}),_&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,o.jsx)(e,{editor:T,onChange:u?({value:e})=>u(e):void 0,readOnly:d,children:(0,o.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,v&&`border-destructive`,d&&`opacity-80`),children:[!x&&!d&&(0,o.jsx)(i.WakaEditorToolbar,{editor:T,groups:b,enableAI:y,onAIClick:S}),(0,o.jsx)(`div`,{style:{minHeight:h},children:(0,o.jsx)(r,{placeholder:f,readOnly:d,className:t.cn(`prose prose-sm max-w-none p-3`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,m)})})]})}),v&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});c.displayName=`PlateEditorInner`;var l=a.forwardRef(({value:e,onChange:i,placeholder:s,className:c,minHeight:l,label:u,description:d,error:f,loading:p,readOnly:m},h)=>{let g=a.useMemo(()=>{if(!e)return``;let t=e=>e.map(e=>typeof e.text==`string`?e.text:e.children?t(e.children):``).join(`
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../label/index.cjs.js"),r=require("../textarea/index.cjs.js"),i=require("./waka-editor-toolbar.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("react/jsx-runtime");var s=a.forwardRef(({value:e,onChange:t,readOnly:n=!1,placeholder:r=`Commencez a ecrire...`,className:s,editorClassName:u,minHeight:d=200,label:f,description:p,error:m,preset:h=`standard`,enableAI:g=!1,enableMarkdown:_=!1,enableMedia:v=!1,enableMentions:y=!1,enableDnD:b=!1,enableTOC:x=!1,toolbarGroups:S=i.DEFAULT_TOOLBAR_GROUPS,hideToolbar:C=!1,onAIClick:w,extraPlugins:T,editorRef:E},D)=>{let[O,k]=a.useState(null),[A,j]=a.useState(!1);return a.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n]=await Promise.all([import(`platejs/react`),Promise.resolve().then(()=>require("./waka-editor-plugins.cjs.js"))]),r=await n.loadCorePlugins(),i=n.getPresetLoaders(h),a=await Promise.all(i.map(e=>e())),o=[];_&&o.push(n.loadMarkdownPlugin()),v&&o.push(n.loadMediaPlugins()),y&&o.push(n.loadMentionPlugins()),b&&o.push(n.loadDndPlugin()),x&&o.push(n.loadTocPlugin());let s=await Promise.all(o),c=[...r,...a.flat(),...s.flat(),...T??[]];e||k({components:{Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor},plugins:c})}catch{e||j(!0)}})(),()=>{e=!0}},[h,_,v,y,b,x,T]),O?(0,o.jsx)(c,{ref:D,components:O.components,plugins:O.plugins,value:e,onChange:t,readOnly:n,placeholder:r,className:s,editorClassName:u,minHeight:d,label:f,description:p,error:m,enableAI:g,toolbarGroups:S,hideToolbar:C,onAIClick:w,editorRef:E}):(0,o.jsx)(l,{ref:D,value:e,onChange:t,placeholder:r,className:s,minHeight:d,label:f,description:p,error:m,loading:!A,readOnly:n})});s.displayName=`WakaEditor`;var c=a.forwardRef(({components:{Plate:e,PlateContent:r,usePlateEditor:s},plugins:c,value:l,onChange:u,readOnly:d=!1,placeholder:f,className:p,editorClassName:m,minHeight:h,label:g,description:_,error:v,enableAI:y,toolbarGroups:b,hideToolbar:x,onAIClick:S,editorRef:C},w)=>{let T=s({plugins:c,value:l??[{type:`p`,children:[{text:``}]}]});return a.useEffect(()=>{C&&(C.current=T)},[T,C]),(0,o.jsxs)(`div`,{ref:w,className:t.cn(`space-y-1.5`,p),children:[g&&(0,o.jsx)(n.Label,{children:g}),_&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,o.jsx)(e,{editor:T,onChange:u?({value:e})=>u(e):void 0,readOnly:d,children:(0,o.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,v&&`border-destructive`,d&&`opacity-80`),children:[!x&&!d&&(0,o.jsx)(i.WakaEditorToolbar,{editor:T,groups:b,enableAI:y,onAIClick:S}),(0,o.jsx)(`div`,{style:{minHeight:h},children:(0,o.jsx)(r,{placeholder:f,readOnly:d,className:t.cn(`prose prose-sm max-w-none p-3`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,m)})})]})}),v&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});c.displayName=`PlateEditorInner`;var l=a.forwardRef(({value:e,onChange:i,placeholder:s,className:c,minHeight:l,label:u,description:d,error:f,loading:p,readOnly:m},h)=>{let g=a.useMemo(()=>{if(!e)return``;let t=e=>e.map(e=>typeof e.text==`string`?e.text:e.children?t(e.children):``).join(`
2
2
  `);return t(e)},[e]);return(0,o.jsxs)(`div`,{ref:h,className:t.cn(`space-y-1.5`,c),children:[u&&(0,o.jsx)(n.Label,{children:u}),d&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(r.Textarea,{value:g,onChange:e=>{i?.([{type:`p`,children:[{text:e.target.value}]}])},placeholder:s,disabled:p||m,style:{minHeight:l},className:t.cn(f&&`border-destructive`)}),p&&(0,o.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Chargement de l'editeur...`})})]}),f&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:f})]})});l.displayName=`FallbackEditor`,exports.WakaEditor=s;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);function a(e,t){try{t(e)}catch{}}function o(e,t){try{return e.isActive(t)}catch{return!1}}var s=[{key:`bold`,icon:r.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>a(e,e=>e.chain().focus().toggleBold().run()),isActive:e=>o(e,`bold`)},{key:`italic`,icon:r.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>a(e,e=>e.chain().focus().toggleItalic().run()),isActive:e=>o(e,`italic`)},{key:`underline`,icon:r.Underline,label:`Souligne`,shortcut:`Ctrl+U`,action:e=>a(e,e=>e.chain().focus().toggleUnderline().run()),isActive:e=>o(e,`underline`)},{key:`strikethrough`,icon:r.Strikethrough,label:`Barre`,action:e=>a(e,e=>e.chain().focus().toggleStrike().run()),isActive:e=>o(e,`strikethrough`)},{key:`code`,icon:r.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>a(e,e=>e.chain().focus().toggleCode().run()),isActive:e=>o(e,`code`)},{key:`highlight`,icon:r.Highlighter,label:`Surligner`,action:e=>a(e,e=>e.chain().focus().toggleHighlight().run()),isActive:e=>o(e,`highlight`)},{key:`link`,icon:r.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>o(e,`a`)}],c=n.forwardRef(({editor:e,buttons:t=s,enableAI:a=!1,onAIClick:o,className:c,disableFloating:l=!1},f)=>{let[p,m]=n.useState(null);n.useEffect(()=>{l||import(`@platejs/floating`).then(e=>{if(e.useFloatingToolbar){let t=e.useFloatingToolbar;m(()=>t)}}).catch(()=>{})},[l]);let h=n.useMemo(()=>a?[...t,{key:`ai`,icon:r.Sparkles,label:`Demander a l'IA`,action:()=>o?.(),isActive:()=>!1}]:t,[t,a,o]);return p?(0,i.jsx)(d,{ref:f,editor:e,buttons:h,className:c,floatingHook:p}):(0,i.jsx)(u,{ref:f,editor:e,buttons:h,className:c})});c.displayName=`WakaFloatingToolbar`;function l({toolbarRef:e,toolbarProps:n,hidden:r,buttons:a,editor:o,className:s}){return r?null:(0,i.jsx)(`div`,{ref:e,...n??{},className:t.cn(`flex items-center gap-0.5 p-1`,`rounded-lg border bg-popover shadow-lg`,`animate-in fade-in-0 zoom-in-95`,s),role:`toolbar`,"aria-label":`Barre d'outils flottante`,children:a.map(e=>{let n=e.isActive?.(o)??!1,r=e.icon;return(0,i.jsx)(`button`,{type:`button`,title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":n,className:t.cn(`inline-flex h-7 w-7 items-center justify-center rounded-md`,`text-sm transition-colors`,n?`bg-accent text-accent-foreground`:`hover:bg-accent/50 text-foreground/70 hover:text-foreground`),onMouseDown:t=>{t.preventDefault(),e.action(o)},children:(0,i.jsx)(r,{className:`h-3.5 w-3.5`})},e.key)})})}var u=n.forwardRef(({editor:e,buttons:t,className:n},r)=>(0,i.jsx)(l,{toolbarRef:r,buttons:t,editor:e,className:n}));u.displayName=`FloatingToolbarStatic`;var d=n.forwardRef(({editor:e,buttons:t,className:r,floatingHook:a},o)=>{let s=a({editor:e});return(0,i.jsx)(l,{toolbarRef:n.useCallback(e=>{typeof o==`function`?o(e):o&&(o.current=e),s.ref&&(typeof s.ref==`function`?s.ref(e):s.ref.current=e)},[o,s.ref]),toolbarProps:s.props,hidden:s.hidden,buttons:t,editor:e,className:r})});d.displayName=`FloatingToolbarPositioned`,exports.DEFAULT_FLOATING_BUTTONS=s,exports.WakaFloatingToolbar=c;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");function a(e,t){try{t(e)}catch{}}function o(e,t){try{return e.isActive(t)}catch{return!1}}var s=[{key:`bold`,icon:r.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>a(e,e=>e.chain().focus().toggleBold().run()),isActive:e=>o(e,`bold`)},{key:`italic`,icon:r.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>a(e,e=>e.chain().focus().toggleItalic().run()),isActive:e=>o(e,`italic`)},{key:`underline`,icon:r.Underline,label:`Souligne`,shortcut:`Ctrl+U`,action:e=>a(e,e=>e.chain().focus().toggleUnderline().run()),isActive:e=>o(e,`underline`)},{key:`strikethrough`,icon:r.Strikethrough,label:`Barre`,action:e=>a(e,e=>e.chain().focus().toggleStrike().run()),isActive:e=>o(e,`strikethrough`)},{key:`code`,icon:r.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>a(e,e=>e.chain().focus().toggleCode().run()),isActive:e=>o(e,`code`)},{key:`highlight`,icon:r.Highlighter,label:`Surligner`,action:e=>a(e,e=>e.chain().focus().toggleHighlight().run()),isActive:e=>o(e,`highlight`)},{key:`link`,icon:r.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>o(e,`a`)}],c=n.forwardRef(({editor:e,buttons:t=s,enableAI:a=!1,onAIClick:o,className:c,disableFloating:l=!1},f)=>{let[p,m]=n.useState(null);n.useEffect(()=>{l||import(`@platejs/floating`).then(e=>{if(e.useFloatingToolbar){let t=e.useFloatingToolbar;m(()=>t)}}).catch(()=>{})},[l]);let h=n.useMemo(()=>a?[...t,{key:`ai`,icon:r.Sparkles,label:`Demander a l'IA`,action:()=>o?.(),isActive:()=>!1}]:t,[t,a,o]);return p?(0,i.jsx)(d,{ref:f,editor:e,buttons:h,className:c,floatingHook:p}):(0,i.jsx)(u,{ref:f,editor:e,buttons:h,className:c})});c.displayName=`WakaFloatingToolbar`;function l({toolbarRef:e,toolbarProps:n,hidden:r,buttons:a,editor:o,className:s}){return r?null:(0,i.jsx)(`div`,{ref:e,...n??{},className:t.cn(`flex items-center gap-0.5 p-1`,`rounded-lg border bg-popover shadow-lg`,`animate-in fade-in-0 zoom-in-95`,s),role:`toolbar`,"aria-label":`Barre d'outils flottante`,children:a.map(e=>{let n=e.isActive?.(o)??!1,r=e.icon;return(0,i.jsx)(`button`,{type:`button`,title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":n,className:t.cn(`inline-flex h-7 w-7 items-center justify-center rounded-md`,`text-sm transition-colors`,n?`bg-accent text-accent-foreground`:`hover:bg-accent/50 text-foreground/70 hover:text-foreground`),onMouseDown:t=>{t.preventDefault(),e.action(o)},children:(0,i.jsx)(r,{className:`h-3.5 w-3.5`})},e.key)})})}var u=n.forwardRef(({editor:e,buttons:t,className:n},r)=>(0,i.jsx)(l,{toolbarRef:r,buttons:t,editor:e,className:n}));u.displayName=`FloatingToolbarStatic`;var d=n.forwardRef(({editor:e,buttons:t,className:r,floatingHook:a},o)=>{let s=a({editor:e});return(0,i.jsx)(l,{toolbarRef:n.useCallback(e=>{typeof o==`function`?o(e):o&&(o.current=e),s.ref&&(typeof s.ref==`function`?s.ref(e):s.ref.current=e)},[o,s.ref]),toolbarProps:s.props,hidden:s.hidden,buttons:t,editor:e,className:r})});d.displayName=`FloatingToolbarPositioned`,exports.DEFAULT_FLOATING_BUTTONS=s,exports.WakaFloatingToolbar=c;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../button/index.cjs.js`),r=require(`../label/index.cjs.js`),i=require(`../textarea/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);var s=a.forwardRef(({markdownValue:e=``,onMarkdownChange:i,slateValue:s,onSlateChange:u,defaultMode:d=`rich`,readOnly:f=!1,placeholder:p=`Commencez a ecrire...`,className:m,editorClassName:h,minHeight:g=300,label:_,description:v,error:y,extraPlugins:b,editorRef:x},S)=>{let[C,w]=a.useState(d),[T,E]=a.useState(null),[D,O]=a.useState(!1),[k,A]=a.useState(e);a.useEffect(()=>{A(e)},[e]),a.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/markdown`)]),c=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`]}}),s.MarkdownPlugin];e||E({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:c,serializeMd:s.serializeMd,deserializeMd:s.deserializeMd})}catch(t){console.error(`[WakaMarkdownEditor] Failed to load:`,t),e||O(!0)}})(),()=>{e=!0}},[]);let j=(0,o.jsx)(`div`,{className:`flex items-center gap-1 p-1 border-b bg-muted/30`,children:[`rich`,`markdown`,`split`].map(e=>(0,o.jsx)(n.Button,{type:`button`,variant:C===e?`secondary`:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>w(e),children:e===`rich`?`Editeur`:e===`markdown`?`Markdown`:`Split`},e))}),M=a.useCallback(e=>{A(e),i?.(e)},[i]);return(0,o.jsxs)(`div`,{ref:S,className:t.cn(`space-y-1.5`,m),children:[_&&(0,o.jsx)(r.Label,{children:_}),v&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v}),(0,o.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,y&&`border-destructive`),children:[!f&&j,C===`markdown`&&(0,o.jsx)(c,{value:k,onChange:M,readOnly:f,placeholder:p,minHeight:g,className:h}),C===`rich`&&T&&(0,o.jsx)(l,{bundle:T,markdownValue:k,slateValue:s,onSlateChange:u,onMarkdownChange:i,readOnly:f,placeholder:p,minHeight:g,className:h,extraPlugins:b,editorRef:x}),C===`split`&&T&&(0,o.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:g},children:[(0,o.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,o.jsx)(l,{bundle:T,markdownValue:k,slateValue:s,onSlateChange:u,onMarkdownChange:i,readOnly:f,placeholder:p,minHeight:g,className:h,extraPlugins:b,editorRef:x})}),(0,o.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,o.jsx)(c,{value:k,onChange:M,readOnly:f,placeholder:`Markdown...`,minHeight:g})})]}),!T&&C!==`markdown`&&(0,o.jsx)(`div`,{className:`relative`,style:{minHeight:g},children:(0,o.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50`,children:(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:D?`Erreur de chargement`:`Chargement...`})})})]}),y&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:y})]})});s.displayName=`WakaMarkdownEditor`;function c({value:e,onChange:n,readOnly:r,placeholder:a,minHeight:s,className:c}){return(0,o.jsx)(i.Textarea,{value:e,onChange:e=>n(e.target.value),readOnly:r,placeholder:a,style:{minHeight:s},className:t.cn(`rounded-none border-0 resize-none font-mono text-sm`,`focus-visible:ring-0 focus-visible:ring-offset-0`,c)})}function l({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i,serializeMd:s},markdownValue:c,slateValue:l,onSlateChange:u,onMarkdownChange:d,readOnly:f,placeholder:p,minHeight:m,className:h,extraPlugins:g,editorRef:_}){let v=r({plugins:a.useMemo(()=>[...i,...g??[]],[i,g]),value:l??[{type:`p`,children:[{text:c||``}]}]});return a.useEffect(()=>{_&&(_.current=v)},[v,_]),(0,o.jsx)(e,{editor:v,onChange:a.useCallback(({value:e})=>{if(u?.(e),d&&s)try{d(s(v,{value:e}))}catch{}},[v,u,d,s]),readOnly:f,children:(0,o.jsx)(`div`,{style:{minHeight:m},children:(0,o.jsx)(n,{placeholder:p,readOnly:f,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,h)})})})}exports.WakaMarkdownEditor=s;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../button/index.cjs.js"),r=require("../label/index.cjs.js"),i=require("../textarea/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("react/jsx-runtime");var s=a.forwardRef(({markdownValue:e=``,onMarkdownChange:i,slateValue:s,onSlateChange:u,defaultMode:d=`rich`,readOnly:f=!1,placeholder:p=`Commencez a ecrire...`,className:m,editorClassName:h,minHeight:g=300,label:_,description:v,error:y,extraPlugins:b,editorRef:x},S)=>{let[C,w]=a.useState(d),[T,E]=a.useState(null),[D,O]=a.useState(!1),[k,A]=a.useState(e);a.useEffect(()=>{A(e)},[e]),a.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/markdown`)]),c=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`]}}),s.MarkdownPlugin];e||E({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:c,serializeMd:s.serializeMd,deserializeMd:s.deserializeMd})}catch(t){console.error(`[WakaMarkdownEditor] Failed to load:`,t),e||O(!0)}})(),()=>{e=!0}},[]);let j=(0,o.jsx)(`div`,{className:`flex items-center gap-1 p-1 border-b bg-muted/30`,children:[`rich`,`markdown`,`split`].map(e=>(0,o.jsx)(n.Button,{type:`button`,variant:C===e?`secondary`:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>w(e),children:e===`rich`?`Editeur`:e===`markdown`?`Markdown`:`Split`},e))}),M=a.useCallback(e=>{A(e),i?.(e)},[i]);return(0,o.jsxs)(`div`,{ref:S,className:t.cn(`space-y-1.5`,m),children:[_&&(0,o.jsx)(r.Label,{children:_}),v&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v}),(0,o.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,y&&`border-destructive`),children:[!f&&j,C===`markdown`&&(0,o.jsx)(c,{value:k,onChange:M,readOnly:f,placeholder:p,minHeight:g,className:h}),C===`rich`&&T&&(0,o.jsx)(l,{bundle:T,markdownValue:k,slateValue:s,onSlateChange:u,onMarkdownChange:i,readOnly:f,placeholder:p,minHeight:g,className:h,extraPlugins:b,editorRef:x}),C===`split`&&T&&(0,o.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:g},children:[(0,o.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,o.jsx)(l,{bundle:T,markdownValue:k,slateValue:s,onSlateChange:u,onMarkdownChange:i,readOnly:f,placeholder:p,minHeight:g,className:h,extraPlugins:b,editorRef:x})}),(0,o.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,o.jsx)(c,{value:k,onChange:M,readOnly:f,placeholder:`Markdown...`,minHeight:g})})]}),!T&&C!==`markdown`&&(0,o.jsx)(`div`,{className:`relative`,style:{minHeight:g},children:(0,o.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50`,children:(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:D?`Erreur de chargement`:`Chargement...`})})})]}),y&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:y})]})});s.displayName=`WakaMarkdownEditor`;function c({value:e,onChange:n,readOnly:r,placeholder:a,minHeight:s,className:c}){return(0,o.jsx)(i.Textarea,{value:e,onChange:e=>n(e.target.value),readOnly:r,placeholder:a,style:{minHeight:s},className:t.cn(`rounded-none border-0 resize-none font-mono text-sm`,`focus-visible:ring-0 focus-visible:ring-offset-0`,c)})}function l({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i,serializeMd:s},markdownValue:c,slateValue:l,onSlateChange:u,onMarkdownChange:d,readOnly:f,placeholder:p,minHeight:m,className:h,extraPlugins:g,editorRef:_}){let v=r({plugins:a.useMemo(()=>[...i,...g??[]],[i,g]),value:l??[{type:`p`,children:[{text:c||``}]}]});return a.useEffect(()=>{_&&(_.current=v)},[v,_]),(0,o.jsx)(e,{editor:v,onChange:a.useCallback(({value:e})=>{if(u?.(e),d&&s)try{d(s(v,{value:e}))}catch{}},[v,u,d,s]),readOnly:f,children:(0,o.jsx)(`div`,{style:{minHeight:m},children:(0,o.jsx)(n,{placeholder:p,readOnly:f,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,h)})})})}exports.WakaMarkdownEditor=s;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../avatar/index.cjs.js`),r=require(`../label/index.cjs.js`),i=require(`../textarea/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);var s=a.forwardRef(({value:e,onChange:n,readOnly:s=!1,placeholder:l=`Tapez @ pour mentionner un utilisateur...`,className:u,editorClassName:d,minHeight:f=200,label:p,description:m,error:h,onSearch:g,onMentionInserted:_,trigger:v=`@`,searchDebounceMs:y=300,maxResults:b=8,extraPlugins:x,editorRef:S},C)=>{let[w,T]=a.useState(null),[E,D]=a.useState(!1),[O,k]=a.useState([]),[A,j]=a.useState(!1),M=a.useRef(),N=a.useRef({onSearch:g,trigger:v,searchDebounceMs:y,maxResults:b,onMentionInserted:_});N.current={onSearch:g,trigger:v,searchDebounceMs:y,maxResults:b,onMentionInserted:_},a.useEffect(()=>{let e=!1;return(async()=>{try{let t=N.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/mention/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.MentionPlugin.configure({options:{trigger:t.trigger,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),c.MentionInputPlugin];e||T({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaMentionEditor] Failed to load:`,t),e||D(!0)}})(),()=>{e=!0}},[]);let P=a.useCallback(e=>{if(M.current&&clearTimeout(M.current),!e.trim()){k([]),j(!1);return}j(!0),M.current=setTimeout(async()=>{try{let t=N.current;k((await t.onSearch(e)).slice(0,t.maxResults))}catch{k([])}finally{j(!1)}},N.current.searchDebounceMs)},[]);return w?(0,o.jsx)(c,{ref:C,bundle:w,value:e,onChange:n,readOnly:s,placeholder:l,className:u,editorClassName:d,minHeight:f,label:p,description:m,error:h,suggestions:O,searching:A,onSearch:P,onMentionInserted:_,extraPlugins:x,editorRef:S}):(0,o.jsxs)(`div`,{ref:C,className:t.cn(`space-y-1.5`,u),children:[p&&(0,o.jsx)(r.Label,{children:p}),m&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(i.Textarea,{placeholder:l,disabled:!0,style:{minHeight:f}}),(0,o.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:E?`Erreur (@platejs/mention requis)`:`Chargement...`})})]}),h&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:h})]})});s.displayName=`WakaMentionEditor`;var c=a.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:i,plugins:s},value:c,onChange:u,readOnly:d,placeholder:f,className:p,editorClassName:m,minHeight:h,label:g,description:_,error:v,suggestions:y,searching:b,extraPlugins:x,editorRef:S},C)=>{let w=i({plugins:a.useMemo(()=>[...s,...x??[]],[s,x]),value:c??[{type:`p`,children:[{text:``}]}]});return a.useEffect(()=>{S&&(S.current=w)},[w,S]),(0,o.jsxs)(`div`,{ref:C,className:t.cn(`space-y-1.5`,p),children:[g&&(0,o.jsx)(r.Label,{children:g}),_&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,o.jsx)(e,{editor:w,onChange:u?({value:e})=>u(e):void 0,readOnly:d,children:(0,o.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden relative`,v&&`border-destructive`),children:[(0,o.jsx)(`div`,{style:{minHeight:h},children:(0,o.jsx)(n,{placeholder:f,readOnly:d,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,m)})}),y.length>0&&(0,o.jsx)(l,{suggestions:y,searching:b})]})}),v&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});c.displayName=`MentionEditorInner`;function l({suggestions:e,searching:r,className:i,onSelect:a}){return(0,o.jsxs)(`div`,{className:t.cn(`absolute z-50 w-64 max-h-60 overflow-y-auto`,`rounded-lg border bg-popover shadow-lg`,`p-1 mt-1`,i),children:[r&&(0,o.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground animate-pulse`,children:`Recherche...`}),e.map(e=>(0,o.jsxs)(`button`,{type:`button`,className:t.cn(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left`,`text-sm transition-colors cursor-pointer`,`hover:bg-accent/50`),onClick:()=>a?.(e),children:[(0,o.jsxs)(n.Avatar,{className:`h-6 w-6`,children:[e.avatar&&(0,o.jsx)(n.AvatarImage,{src:e.avatar,alt:e.name}),(0,o.jsx)(n.AvatarFallback,{className:`text-[10px] bg-primary/10 text-primary`,children:e.name.slice(0,2).toUpperCase()})]}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.email&&(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.email})]}),e.role&&(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:e.role})]},e.id))]})}l.displayName=`MentionSuggestions`,exports.MentionSuggestions=l,exports.WakaMentionEditor=s;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../avatar/index.cjs.js"),r=require("../label/index.cjs.js"),i=require("../textarea/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("react/jsx-runtime");var s=a.forwardRef(({value:e,onChange:n,readOnly:s=!1,placeholder:l=`Tapez @ pour mentionner un utilisateur...`,className:u,editorClassName:d,minHeight:f=200,label:p,description:m,error:h,onSearch:g,onMentionInserted:_,trigger:v=`@`,searchDebounceMs:y=300,maxResults:b=8,extraPlugins:x,editorRef:S},C)=>{let[w,T]=a.useState(null),[E,D]=a.useState(!1),[O,k]=a.useState([]),[A,j]=a.useState(!1),M=a.useRef(),N=a.useRef({onSearch:g,trigger:v,searchDebounceMs:y,maxResults:b,onMentionInserted:_});N.current={onSearch:g,trigger:v,searchDebounceMs:y,maxResults:b,onMentionInserted:_},a.useEffect(()=>{let e=!1;return(async()=>{try{let t=N.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/mention/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.MentionPlugin.configure({options:{trigger:t.trigger,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),c.MentionInputPlugin];e||T({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaMentionEditor] Failed to load:`,t),e||D(!0)}})(),()=>{e=!0}},[]);let P=a.useCallback(e=>{if(M.current&&clearTimeout(M.current),!e.trim()){k([]),j(!1);return}j(!0),M.current=setTimeout(async()=>{try{let t=N.current,n=await t.onSearch(e);k(n.slice(0,t.maxResults))}catch{k([])}finally{j(!1)}},N.current.searchDebounceMs)},[]);return w?(0,o.jsx)(c,{ref:C,bundle:w,value:e,onChange:n,readOnly:s,placeholder:l,className:u,editorClassName:d,minHeight:f,label:p,description:m,error:h,suggestions:O,searching:A,onSearch:P,onMentionInserted:_,extraPlugins:x,editorRef:S}):(0,o.jsxs)(`div`,{ref:C,className:t.cn(`space-y-1.5`,u),children:[p&&(0,o.jsx)(r.Label,{children:p}),m&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(i.Textarea,{placeholder:l,disabled:!0,style:{minHeight:f}}),(0,o.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:E?`Erreur (@platejs/mention requis)`:`Chargement...`})})]}),h&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:h})]})});s.displayName=`WakaMentionEditor`;var c=a.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:i,plugins:s},value:c,onChange:u,readOnly:d,placeholder:f,className:p,editorClassName:m,minHeight:h,label:g,description:_,error:v,suggestions:y,searching:b,extraPlugins:x,editorRef:S},C)=>{let w=i({plugins:a.useMemo(()=>[...s,...x??[]],[s,x]),value:c??[{type:`p`,children:[{text:``}]}]});return a.useEffect(()=>{S&&(S.current=w)},[w,S]),(0,o.jsxs)(`div`,{ref:C,className:t.cn(`space-y-1.5`,p),children:[g&&(0,o.jsx)(r.Label,{children:g}),_&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,o.jsx)(e,{editor:w,onChange:u?({value:e})=>u(e):void 0,readOnly:d,children:(0,o.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden relative`,v&&`border-destructive`),children:[(0,o.jsx)(`div`,{style:{minHeight:h},children:(0,o.jsx)(n,{placeholder:f,readOnly:d,className:t.cn(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,m)})}),y.length>0&&(0,o.jsx)(l,{suggestions:y,searching:b})]})}),v&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});c.displayName=`MentionEditorInner`;function l({suggestions:e,searching:r,className:i,onSelect:a}){return(0,o.jsxs)(`div`,{className:t.cn(`absolute z-50 w-64 max-h-60 overflow-y-auto`,`rounded-lg border bg-popover shadow-lg`,`p-1 mt-1`,i),children:[r&&(0,o.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground animate-pulse`,children:`Recherche...`}),e.map(e=>(0,o.jsxs)(`button`,{type:`button`,className:t.cn(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left`,`text-sm transition-colors cursor-pointer`,`hover:bg-accent/50`),onClick:()=>a?.(e),children:[(0,o.jsxs)(n.Avatar,{className:`h-6 w-6`,children:[e.avatar&&(0,o.jsx)(n.AvatarImage,{src:e.avatar,alt:e.name}),(0,o.jsx)(n.AvatarFallback,{className:`text-[10px] bg-primary/10 text-primary`,children:e.name.slice(0,2).toUpperCase()})]}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.email&&(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.email})]}),e.role&&(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:e.role})]},e.id))]})}l.displayName=`MentionSuggestions`,exports.MentionSuggestions=l,exports.WakaMentionEditor=s;