@nikala-ui/docs 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/README.md +22 -0
  2. package/dist/cli/commands/build.d.ts +5 -0
  3. package/dist/cli/commands/build.d.ts.map +1 -0
  4. package/dist/cli/commands/build.js +27 -0
  5. package/dist/cli/commands/build.js.map +1 -0
  6. package/dist/cli/commands/dev.d.ts +7 -0
  7. package/dist/cli/commands/dev.d.ts.map +1 -0
  8. package/dist/cli/commands/dev.js +32 -0
  9. package/dist/cli/commands/dev.js.map +1 -0
  10. package/dist/cli/commands/init.d.ts +2 -0
  11. package/dist/cli/commands/init.d.ts.map +1 -0
  12. package/dist/cli/commands/init.js +308 -0
  13. package/dist/cli/commands/init.js.map +1 -0
  14. package/dist/cli/commands/preview.d.ts +7 -0
  15. package/dist/cli/commands/preview.d.ts.map +1 -0
  16. package/dist/cli/commands/preview.js +24 -0
  17. package/dist/cli/commands/preview.js.map +1 -0
  18. package/dist/cli/commands/serve.d.ts +7 -0
  19. package/dist/cli/commands/serve.d.ts.map +1 -0
  20. package/dist/cli/commands/serve.js +33 -0
  21. package/dist/cli/commands/serve.js.map +1 -0
  22. package/dist/cli/index.d.ts +3 -0
  23. package/dist/cli/index.d.ts.map +1 -0
  24. package/dist/cli/index.js +53 -0
  25. package/dist/cli/index.js.map +1 -0
  26. package/dist/client/App.d.ts +5 -0
  27. package/dist/client/App.d.ts.map +1 -0
  28. package/dist/client/App.jsx +31 -0
  29. package/dist/client/App.jsx.map +1 -0
  30. package/dist/client/app-types.d.ts +14 -0
  31. package/dist/client/app-types.d.ts.map +1 -0
  32. package/dist/client/app-types.js +2 -0
  33. package/dist/client/app-types.js.map +1 -0
  34. package/dist/client/components/DocsLayoutShell.d.ts +21 -0
  35. package/dist/client/components/DocsLayoutShell.d.ts.map +1 -0
  36. package/dist/client/components/DocsLayoutShell.jsx +14 -0
  37. package/dist/client/components/DocsLayoutShell.jsx.map +1 -0
  38. package/dist/client/components/DocsPageContent.d.ts +9 -0
  39. package/dist/client/components/DocsPageContent.d.ts.map +1 -0
  40. package/dist/client/components/DocsPageContent.jsx +10 -0
  41. package/dist/client/components/DocsPageContent.jsx.map +1 -0
  42. package/dist/client/entry.d.ts +2 -0
  43. package/dist/client/entry.d.ts.map +1 -0
  44. package/dist/client/entry.jsx +28 -0
  45. package/dist/client/entry.jsx.map +1 -0
  46. package/dist/client/index.html +21 -0
  47. package/dist/client/navigation/page-navigation.d.ts +9 -0
  48. package/dist/client/navigation/page-navigation.d.ts.map +1 -0
  49. package/dist/client/navigation/page-navigation.js +51 -0
  50. package/dist/client/navigation/page-navigation.js.map +1 -0
  51. package/dist/client/routing/use-docs-router.d.ts +17 -0
  52. package/dist/client/routing/use-docs-router.d.ts.map +1 -0
  53. package/dist/client/routing/use-docs-router.js +71 -0
  54. package/dist/client/routing/use-docs-router.js.map +1 -0
  55. package/dist/client/ssr-entry.d.ts +3 -0
  56. package/dist/client/ssr-entry.d.ts.map +1 -0
  57. package/dist/client/ssr-entry.jsx +13 -0
  58. package/dist/client/ssr-entry.jsx.map +1 -0
  59. package/dist/client/style.css +183 -0
  60. package/dist/client/utils/sidebar.d.ts +2 -0
  61. package/dist/client/utils/sidebar.d.ts.map +1 -0
  62. package/dist/client/utils/sidebar.js +2 -0
  63. package/dist/client/utils/sidebar.js.map +1 -0
  64. package/dist/components/mdx-components.d.ts +34 -0
  65. package/dist/components/mdx-components.d.ts.map +1 -0
  66. package/dist/components/mdx-components.jsx +131 -0
  67. package/dist/components/mdx-components.jsx.map +1 -0
  68. package/dist/config.d.ts +6 -0
  69. package/dist/config.d.ts.map +1 -0
  70. package/dist/config.js +105 -0
  71. package/dist/config.js.map +1 -0
  72. package/dist/core/content-scanner.d.ts +10 -0
  73. package/dist/core/content-scanner.d.ts.map +1 -0
  74. package/dist/core/content-scanner.js +153 -0
  75. package/dist/core/content-scanner.js.map +1 -0
  76. package/dist/core/route-tree.d.ts +19 -0
  77. package/dist/core/route-tree.d.ts.map +1 -0
  78. package/dist/core/route-tree.js +176 -0
  79. package/dist/core/route-tree.js.map +1 -0
  80. package/dist/index.d.ts +13 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +14 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/lib/cn.d.ts +6 -0
  85. package/dist/lib/cn.d.ts.map +1 -0
  86. package/dist/lib/cn.js +9 -0
  87. package/dist/lib/cn.js.map +1 -0
  88. package/dist/mdx/compiler.d.ts +13 -0
  89. package/dist/mdx/compiler.d.ts.map +1 -0
  90. package/dist/mdx/compiler.js +38 -0
  91. package/dist/mdx/compiler.js.map +1 -0
  92. package/dist/mdx/highlighter.d.ts +22 -0
  93. package/dist/mdx/highlighter.d.ts.map +1 -0
  94. package/dist/mdx/highlighter.js +139 -0
  95. package/dist/mdx/highlighter.js.map +1 -0
  96. package/dist/mdx/rehype-shiki.d.ts +3 -0
  97. package/dist/mdx/rehype-shiki.d.ts.map +1 -0
  98. package/dist/mdx/rehype-shiki.js +83 -0
  99. package/dist/mdx/rehype-shiki.js.map +1 -0
  100. package/dist/navigation/index.d.ts +2 -0
  101. package/dist/navigation/index.d.ts.map +1 -0
  102. package/dist/navigation/index.js +2 -0
  103. package/dist/navigation/index.js.map +1 -0
  104. package/dist/navigation/sidebar-state.d.ts +6 -0
  105. package/dist/navigation/sidebar-state.d.ts.map +1 -0
  106. package/dist/navigation/sidebar-state.js +20 -0
  107. package/dist/navigation/sidebar-state.js.map +1 -0
  108. package/dist/navigation/sidebar-tree.d.ts +7 -0
  109. package/dist/navigation/sidebar-tree.d.ts.map +1 -0
  110. package/dist/navigation/sidebar-tree.js +11 -0
  111. package/dist/navigation/sidebar-tree.js.map +1 -0
  112. package/dist/registry/accordion.json +18 -0
  113. package/dist/registry/alert.json +18 -0
  114. package/dist/registry/api-table.json +21 -0
  115. package/dist/registry/aspect-ratio.json +17 -0
  116. package/dist/registry/avatar.json +17 -0
  117. package/dist/registry/badge.json +18 -0
  118. package/dist/registry/banner.json +19 -0
  119. package/dist/registry/breadcrumb.json +17 -0
  120. package/dist/registry/bubble.json +18 -0
  121. package/dist/registry/button-group.json +20 -0
  122. package/dist/registry/button.json +21 -0
  123. package/dist/registry/callout.json +19 -0
  124. package/dist/registry/card.json +17 -0
  125. package/dist/registry/checkbox.json +20 -0
  126. package/dist/registry/code-block.json +26 -0
  127. package/dist/registry/code-group.json +20 -0
  128. package/dist/registry/collapsible.json +18 -0
  129. package/dist/registry/combobox.json +21 -0
  130. package/dist/registry/command.json +27 -0
  131. package/dist/registry/component-viewer.json +25 -0
  132. package/dist/registry/container.json +18 -0
  133. package/dist/registry/context-menu.json +24 -0
  134. package/dist/registry/create-active-element.json +13 -0
  135. package/dist/registry/create-app-updater.json +13 -0
  136. package/dist/registry/create-audio.json +7 -0
  137. package/dist/registry/create-battery.json +13 -0
  138. package/dist/registry/create-chat-scroll.json +13 -0
  139. package/dist/registry/create-click-outside.json +13 -0
  140. package/dist/registry/create-clipboard.json +13 -0
  141. package/dist/registry/create-color-mode.json +13 -0
  142. package/dist/registry/create-controllable-signal.json +13 -0
  143. package/dist/registry/create-debounce.json +13 -0
  144. package/dist/registry/create-disclosure.json +13 -0
  145. package/dist/registry/create-document-tabs.json +13 -0
  146. package/dist/registry/create-document-title.json +13 -0
  147. package/dist/registry/create-drop-zone.json +13 -0
  148. package/dist/registry/create-event-source.json +13 -0
  149. package/dist/registry/create-favicon.json +13 -0
  150. package/dist/registry/create-fetch.json +13 -0
  151. package/dist/registry/create-focus-trap.json +13 -0
  152. package/dist/registry/create-form.json +13 -0
  153. package/dist/registry/create-fullscreen.json +13 -0
  154. package/dist/registry/create-geolocation.json +13 -0
  155. package/dist/registry/create-global-shortcut.json +13 -0
  156. package/dist/registry/create-hover.json +13 -0
  157. package/dist/registry/create-idle.json +13 -0
  158. package/dist/registry/create-infinite-scroll.json +13 -0
  159. package/dist/registry/create-input-mask.json +13 -0
  160. package/dist/registry/create-intersection-observer.json +13 -0
  161. package/dist/registry/create-keybindings.json +13 -0
  162. package/dist/registry/create-lock-scroll.json +13 -0
  163. package/dist/registry/create-long-press.json +13 -0
  164. package/dist/registry/create-media-query.json +13 -0
  165. package/dist/registry/create-mouse-position.json +13 -0
  166. package/dist/registry/create-network-status.json +13 -0
  167. package/dist/registry/create-orientation.json +13 -0
  168. package/dist/registry/create-pagination.json +13 -0
  169. package/dist/registry/create-permission.json +13 -0
  170. package/dist/registry/create-previous.json +13 -0
  171. package/dist/registry/create-resize-observer.json +13 -0
  172. package/dist/registry/create-scroll-into-view.json +13 -0
  173. package/dist/registry/create-scroll-position.json +13 -0
  174. package/dist/registry/create-storage.json +13 -0
  175. package/dist/registry/create-tauri-window.json +13 -0
  176. package/dist/registry/create-timer.json +13 -0
  177. package/dist/registry/create-tiptap-editor.json +34 -0
  178. package/dist/registry/create-undo-redo.json +13 -0
  179. package/dist/registry/create-web-notification.json +13 -0
  180. package/dist/registry/create-websocket.json +13 -0
  181. package/dist/registry/create-window-size.json +13 -0
  182. package/dist/registry/dialog.json +21 -0
  183. package/dist/registry/dropdown-menu.json +22 -0
  184. package/dist/registry/dropzone.json +21 -0
  185. package/dist/registry/empty.json +17 -0
  186. package/dist/registry/field.json +20 -0
  187. package/dist/registry/file-tree.json +21 -0
  188. package/dist/registry/footer.json +18 -0
  189. package/dist/registry/forgot-password-01.json +28 -0
  190. package/dist/registry/form-message.json +17 -0
  191. package/dist/registry/form.json +17 -0
  192. package/dist/registry/hero-01.json +22 -0
  193. package/dist/registry/hover-card.json +18 -0
  194. package/dist/registry/icon-button.json +20 -0
  195. package/dist/registry/index.json +1489 -0
  196. package/dist/registry/input-group.json +21 -0
  197. package/dist/registry/input.json +17 -0
  198. package/dist/registry/kbd.json +18 -0
  199. package/dist/registry/label.json +18 -0
  200. package/dist/registry/list.json +20 -0
  201. package/dist/registry/login-01.json +28 -0
  202. package/dist/registry/logo.json +17 -0
  203. package/dist/registry/marker.json +17 -0
  204. package/dist/registry/marquee.json +17 -0
  205. package/dist/registry/message.json +17 -0
  206. package/dist/registry/navbar.json +19 -0
  207. package/dist/registry/navigation-menu.json +22 -0
  208. package/dist/registry/number-input.json +24 -0
  209. package/dist/registry/otp-verification-01.json +26 -0
  210. package/dist/registry/package-manager-tabs.json +24 -0
  211. package/dist/registry/pager.json +21 -0
  212. package/dist/registry/pagination.json +22 -0
  213. package/dist/registry/pin-input.json +17 -0
  214. package/dist/registry/popover.json +22 -0
  215. package/dist/registry/progress.json +18 -0
  216. package/dist/registry/radio-group.json +18 -0
  217. package/dist/registry/rating.json +19 -0
  218. package/dist/registry/register-01.json +31 -0
  219. package/dist/registry/resizable.json +21 -0
  220. package/dist/registry/review-card.json +23 -0
  221. package/dist/registry/rich-text-editor.json +95 -0
  222. package/dist/registry/scroll-area.json +21 -0
  223. package/dist/registry/section-heading.json +21 -0
  224. package/dist/registry/select.json +22 -0
  225. package/dist/registry/separator.json +17 -0
  226. package/dist/registry/sheet.json +22 -0
  227. package/dist/registry/sidebar.json +24 -0
  228. package/dist/registry/skeleton.json +17 -0
  229. package/dist/registry/slider.json +18 -0
  230. package/dist/registry/spinner.json +18 -0
  231. package/dist/registry/stat.json +19 -0
  232. package/dist/registry/status.json +18 -0
  233. package/dist/registry/steps.json +20 -0
  234. package/dist/registry/switch.json +20 -0
  235. package/dist/registry/table-of-contents.json +23 -0
  236. package/dist/registry/table.json +17 -0
  237. package/dist/registry/tabs.json +20 -0
  238. package/dist/registry/textarea.json +17 -0
  239. package/dist/registry/theme-manager.json +39 -0
  240. package/dist/registry/timeline.json +18 -0
  241. package/dist/registry/titlebar-tabs.json +24 -0
  242. package/dist/registry/titlebar.json +26 -0
  243. package/dist/registry/toast.json +20 -0
  244. package/dist/registry/toggle-group.json +21 -0
  245. package/dist/registry/toggle.json +18 -0
  246. package/dist/registry/tooltip.json +18 -0
  247. package/dist/registry/updater-modal.json +26 -0
  248. package/dist/server/index.d.ts +18 -0
  249. package/dist/server/index.d.ts.map +1 -0
  250. package/dist/server/index.js +526 -0
  251. package/dist/server/index.js.map +1 -0
  252. package/dist/server/plugin.d.ts +10 -0
  253. package/dist/server/plugin.d.ts.map +1 -0
  254. package/dist/server/plugin.js +271 -0
  255. package/dist/server/plugin.js.map +1 -0
  256. package/dist/themes/default/content/breadcrumbs.d.ts +4 -0
  257. package/dist/themes/default/content/breadcrumbs.d.ts.map +1 -0
  258. package/dist/themes/default/content/breadcrumbs.jsx +31 -0
  259. package/dist/themes/default/content/breadcrumbs.jsx.map +1 -0
  260. package/dist/themes/default/content/pager.d.ts +5 -0
  261. package/dist/themes/default/content/pager.d.ts.map +1 -0
  262. package/dist/themes/default/content/pager.jsx +9 -0
  263. package/dist/themes/default/content/pager.jsx.map +1 -0
  264. package/dist/themes/default/content/table-of-contents.d.ts +4 -0
  265. package/dist/themes/default/content/table-of-contents.d.ts.map +1 -0
  266. package/dist/themes/default/content/table-of-contents.jsx +19 -0
  267. package/dist/themes/default/content/table-of-contents.jsx.map +1 -0
  268. package/dist/themes/default/index.d.ts +11 -0
  269. package/dist/themes/default/index.d.ts.map +1 -0
  270. package/dist/themes/default/index.js +30 -0
  271. package/dist/themes/default/index.js.map +1 -0
  272. package/dist/themes/default/layout.d.ts +4 -0
  273. package/dist/themes/default/layout.d.ts.map +1 -0
  274. package/dist/themes/default/layout.jsx +75 -0
  275. package/dist/themes/default/layout.jsx.map +1 -0
  276. package/dist/themes/default/navbar.d.ts +4 -0
  277. package/dist/themes/default/navbar.d.ts.map +1 -0
  278. package/dist/themes/default/navbar.jsx +74 -0
  279. package/dist/themes/default/navbar.jsx.map +1 -0
  280. package/dist/themes/default/navigation/mobile-table-of-contents.d.ts +4 -0
  281. package/dist/themes/default/navigation/mobile-table-of-contents.d.ts.map +1 -0
  282. package/dist/themes/default/navigation/mobile-table-of-contents.jsx +22 -0
  283. package/dist/themes/default/navigation/mobile-table-of-contents.jsx.map +1 -0
  284. package/dist/themes/default/navigation/sidebar-tree.d.ts +8 -0
  285. package/dist/themes/default/navigation/sidebar-tree.d.ts.map +1 -0
  286. package/dist/themes/default/navigation/sidebar-tree.jsx +100 -0
  287. package/dist/themes/default/navigation/sidebar-tree.jsx.map +1 -0
  288. package/dist/themes/default/overlays/search-dialog.d.ts +4 -0
  289. package/dist/themes/default/overlays/search-dialog.d.ts.map +1 -0
  290. package/dist/themes/default/overlays/search-dialog.jsx +34 -0
  291. package/dist/themes/default/overlays/search-dialog.jsx.map +1 -0
  292. package/dist/themes/default/sidebar.d.ts +4 -0
  293. package/dist/themes/default/sidebar.d.ts.map +1 -0
  294. package/dist/themes/default/sidebar.jsx +60 -0
  295. package/dist/themes/default/sidebar.jsx.map +1 -0
  296. package/dist/themes/index.d.ts +4 -0
  297. package/dist/themes/index.d.ts.map +1 -0
  298. package/dist/themes/index.js +5 -0
  299. package/dist/themes/index.js.map +1 -0
  300. package/dist/themes/types.d.ts +83 -0
  301. package/dist/themes/types.d.ts.map +1 -0
  302. package/dist/themes/types.js +2 -0
  303. package/dist/themes/types.js.map +1 -0
  304. package/dist/types.d.ts +97 -0
  305. package/dist/types.d.ts.map +1 -0
  306. package/dist/types.js +3 -0
  307. package/dist/types.js.map +1 -0
  308. package/dist/vendor/core-src/index.css +11 -0
  309. package/dist/vendor/core-src/index.ts +48 -0
  310. package/dist/vendor/core-src/lib/cn.ts +9 -0
  311. package/dist/vendor/core-src/registry/blocks/forgot-password-01.tsx +141 -0
  312. package/dist/vendor/core-src/registry/blocks/hero-01.tsx +28 -0
  313. package/dist/vendor/core-src/registry/blocks/login-01.tsx +231 -0
  314. package/dist/vendor/core-src/registry/blocks/otp-verification-01.tsx +170 -0
  315. package/dist/vendor/core-src/registry/blocks/register-01.tsx +318 -0
  316. package/dist/vendor/core-src/registry/components/ui/accordion.tsx +128 -0
  317. package/dist/vendor/core-src/registry/components/ui/alert.tsx +155 -0
  318. package/dist/vendor/core-src/registry/components/ui/api-table.tsx +117 -0
  319. package/dist/vendor/core-src/registry/components/ui/aspect-ratio.tsx +31 -0
  320. package/dist/vendor/core-src/registry/components/ui/avatar.tsx +114 -0
  321. package/dist/vendor/core-src/registry/components/ui/badge.tsx +56 -0
  322. package/dist/vendor/core-src/registry/components/ui/banner.tsx +187 -0
  323. package/dist/vendor/core-src/registry/components/ui/breadcrumb.tsx +136 -0
  324. package/dist/vendor/core-src/registry/components/ui/bubble.tsx +142 -0
  325. package/dist/vendor/core-src/registry/components/ui/button-group.tsx +42 -0
  326. package/dist/vendor/core-src/registry/components/ui/button.tsx +82 -0
  327. package/dist/vendor/core-src/registry/components/ui/callout.tsx +137 -0
  328. package/dist/vendor/core-src/registry/components/ui/card.tsx +113 -0
  329. package/dist/vendor/core-src/registry/components/ui/checkbox.tsx +74 -0
  330. package/dist/vendor/core-src/registry/components/ui/code-block.tsx +326 -0
  331. package/dist/vendor/core-src/registry/components/ui/code-group.tsx +105 -0
  332. package/dist/vendor/core-src/registry/components/ui/collapsible.tsx +73 -0
  333. package/dist/vendor/core-src/registry/components/ui/combobox.tsx +299 -0
  334. package/dist/vendor/core-src/registry/components/ui/command.tsx +378 -0
  335. package/dist/vendor/core-src/registry/components/ui/component-viewer.tsx +363 -0
  336. package/dist/vendor/core-src/registry/components/ui/container.tsx +45 -0
  337. package/dist/vendor/core-src/registry/components/ui/context-menu.tsx +237 -0
  338. package/dist/vendor/core-src/registry/components/ui/dialog.tsx +200 -0
  339. package/dist/vendor/core-src/registry/components/ui/dropdown-menu.tsx +298 -0
  340. package/dist/vendor/core-src/registry/components/ui/dropzone.tsx +189 -0
  341. package/dist/vendor/core-src/registry/components/ui/empty.tsx +83 -0
  342. package/dist/vendor/core-src/registry/components/ui/field.tsx +71 -0
  343. package/dist/vendor/core-src/registry/components/ui/file-tree.tsx +181 -0
  344. package/dist/vendor/core-src/registry/components/ui/footer.tsx +247 -0
  345. package/dist/vendor/core-src/registry/components/ui/form-message.tsx +36 -0
  346. package/dist/vendor/core-src/registry/components/ui/form.tsx +21 -0
  347. package/dist/vendor/core-src/registry/components/ui/hover-card.tsx +105 -0
  348. package/dist/vendor/core-src/registry/components/ui/icon-button.tsx +34 -0
  349. package/dist/vendor/core-src/registry/components/ui/input-group.tsx +80 -0
  350. package/dist/vendor/core-src/registry/components/ui/input.tsx +28 -0
  351. package/dist/vendor/core-src/registry/components/ui/kbd.tsx +73 -0
  352. package/dist/vendor/core-src/registry/components/ui/label.tsx +30 -0
  353. package/dist/vendor/core-src/registry/components/ui/list.tsx +222 -0
  354. package/dist/vendor/core-src/registry/components/ui/logo.tsx +68 -0
  355. package/dist/vendor/core-src/registry/components/ui/marker.tsx +102 -0
  356. package/dist/vendor/core-src/registry/components/ui/marquee.tsx +118 -0
  357. package/dist/vendor/core-src/registry/components/ui/message.tsx +168 -0
  358. package/dist/vendor/core-src/registry/components/ui/navbar.tsx +375 -0
  359. package/dist/vendor/core-src/registry/components/ui/navigation-menu.tsx +358 -0
  360. package/dist/vendor/core-src/registry/components/ui/number-input.tsx +150 -0
  361. package/dist/vendor/core-src/registry/components/ui/package-manager-tabs.tsx +226 -0
  362. package/dist/vendor/core-src/registry/components/ui/pager.tsx +102 -0
  363. package/dist/vendor/core-src/registry/components/ui/pagination.tsx +258 -0
  364. package/dist/vendor/core-src/registry/components/ui/pin-input.tsx +198 -0
  365. package/dist/vendor/core-src/registry/components/ui/popover.tsx +90 -0
  366. package/dist/vendor/core-src/registry/components/ui/progress.tsx +66 -0
  367. package/dist/vendor/core-src/registry/components/ui/radio-group.tsx +95 -0
  368. package/dist/vendor/core-src/registry/components/ui/rating.tsx +185 -0
  369. package/dist/vendor/core-src/registry/components/ui/resizable.tsx +195 -0
  370. package/dist/vendor/core-src/registry/components/ui/review-card.tsx +195 -0
  371. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/bubble-menu.tsx +236 -0
  372. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/editor.tsx +308 -0
  373. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/extensions.ts +116 -0
  374. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/footer.tsx +36 -0
  375. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/image-dialog.tsx +75 -0
  376. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/index.ts +11 -0
  377. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/link-dialog.tsx +48 -0
  378. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/markdown.ts +170 -0
  379. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/slash-command.tsx +301 -0
  380. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/table-controls.tsx +68 -0
  381. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/toolbar.tsx +465 -0
  382. package/dist/vendor/core-src/registry/components/ui/rich-text-editor/use-editor.ts +231 -0
  383. package/dist/vendor/core-src/registry/components/ui/scroll-area.tsx +228 -0
  384. package/dist/vendor/core-src/registry/components/ui/section-heading.tsx +108 -0
  385. package/dist/vendor/core-src/registry/components/ui/select.tsx +156 -0
  386. package/dist/vendor/core-src/registry/components/ui/separator.tsx +37 -0
  387. package/dist/vendor/core-src/registry/components/ui/sheet.tsx +220 -0
  388. package/dist/vendor/core-src/registry/components/ui/sidebar.tsx +692 -0
  389. package/dist/vendor/core-src/registry/components/ui/skeleton.tsx +24 -0
  390. package/dist/vendor/core-src/registry/components/ui/slider.tsx +153 -0
  391. package/dist/vendor/core-src/registry/components/ui/spinner.tsx +41 -0
  392. package/dist/vendor/core-src/registry/components/ui/stat.tsx +245 -0
  393. package/dist/vendor/core-src/registry/components/ui/status.tsx +121 -0
  394. package/dist/vendor/core-src/registry/components/ui/steps.tsx +198 -0
  395. package/dist/vendor/core-src/registry/components/ui/switch.tsx +68 -0
  396. package/dist/vendor/core-src/registry/components/ui/table-of-contents.tsx +131 -0
  397. package/dist/vendor/core-src/registry/components/ui/table.tsx +160 -0
  398. package/dist/vendor/core-src/registry/components/ui/tabs.tsx +204 -0
  399. package/dist/vendor/core-src/registry/components/ui/textarea.tsx +82 -0
  400. package/dist/vendor/core-src/registry/components/ui/theme-toggle.tsx +238 -0
  401. package/dist/vendor/core-src/registry/components/ui/timeline.tsx +350 -0
  402. package/dist/vendor/core-src/registry/components/ui/titlebar-tabs.tsx +773 -0
  403. package/dist/vendor/core-src/registry/components/ui/titlebar.tsx +468 -0
  404. package/dist/vendor/core-src/registry/components/ui/toast.tsx +124 -0
  405. package/dist/vendor/core-src/registry/components/ui/toggle-group.tsx +203 -0
  406. package/dist/vendor/core-src/registry/components/ui/toggle.tsx +101 -0
  407. package/dist/vendor/core-src/registry/components/ui/tooltip.tsx +41 -0
  408. package/dist/vendor/core-src/registry/components/ui/updater-modal.tsx +254 -0
  409. package/dist/vendor/core-src/registry/index.ts +50 -0
  410. package/dist/vendor/core-src/registry/metadata.ts +742 -0
  411. package/dist/vendor/core-src/registry/providers/theme-provider.tsx +216 -0
  412. package/dist/vendor/core-src/registry/providers/theme-script.tsx +78 -0
  413. package/dist/vendor/core-src/registry/providers/theme-transitions.ts +139 -0
  414. package/dist/vendor/hooks-src/create-active-element.ts +51 -0
  415. package/dist/vendor/hooks-src/create-app-updater.ts +272 -0
  416. package/dist/vendor/hooks-src/create-audio-video.ts +444 -0
  417. package/dist/vendor/hooks-src/create-battery.ts +78 -0
  418. package/dist/vendor/hooks-src/create-chat-scroll.ts +113 -0
  419. package/dist/vendor/hooks-src/create-click-outside.ts +82 -0
  420. package/dist/vendor/hooks-src/create-clipboard.ts +69 -0
  421. package/dist/vendor/hooks-src/create-color-mode.ts +115 -0
  422. package/dist/vendor/hooks-src/create-controllable-signal.ts +56 -0
  423. package/dist/vendor/hooks-src/create-debounce.ts +90 -0
  424. package/dist/vendor/hooks-src/create-disclosure.ts +82 -0
  425. package/dist/vendor/hooks-src/create-document-tabs.ts +267 -0
  426. package/dist/vendor/hooks-src/create-document-title.ts +33 -0
  427. package/dist/vendor/hooks-src/create-drop-zone.ts +317 -0
  428. package/dist/vendor/hooks-src/create-event-source.ts +126 -0
  429. package/dist/vendor/hooks-src/create-favicon.ts +52 -0
  430. package/dist/vendor/hooks-src/create-fetch.ts +93 -0
  431. package/dist/vendor/hooks-src/create-focus-trap.ts +94 -0
  432. package/dist/vendor/hooks-src/create-form.ts +200 -0
  433. package/dist/vendor/hooks-src/create-fullscreen.ts +105 -0
  434. package/dist/vendor/hooks-src/create-geolocation.ts +140 -0
  435. package/dist/vendor/hooks-src/create-global-shortcut.ts +140 -0
  436. package/dist/vendor/hooks-src/create-hover.ts +88 -0
  437. package/dist/vendor/hooks-src/create-idle.ts +109 -0
  438. package/dist/vendor/hooks-src/create-infinite-scroll.ts +90 -0
  439. package/dist/vendor/hooks-src/create-input-mask.ts +109 -0
  440. package/dist/vendor/hooks-src/create-intersection-observer.ts +82 -0
  441. package/dist/vendor/hooks-src/create-keybindings.ts +148 -0
  442. package/dist/vendor/hooks-src/create-lock-scroll.ts +97 -0
  443. package/dist/vendor/hooks-src/create-long-press.ts +85 -0
  444. package/dist/vendor/hooks-src/create-media-query.ts +94 -0
  445. package/dist/vendor/hooks-src/create-mouse-position.ts +87 -0
  446. package/dist/vendor/hooks-src/create-network-status.ts +100 -0
  447. package/dist/vendor/hooks-src/create-orientation.ts +129 -0
  448. package/dist/vendor/hooks-src/create-pagination.ts +208 -0
  449. package/dist/vendor/hooks-src/create-permission.ts +91 -0
  450. package/dist/vendor/hooks-src/create-previous.ts +21 -0
  451. package/dist/vendor/hooks-src/create-resize-observer.ts +89 -0
  452. package/dist/vendor/hooks-src/create-scroll-into-view.ts +57 -0
  453. package/dist/vendor/hooks-src/create-scroll-position.ts +129 -0
  454. package/dist/vendor/hooks-src/create-storage.ts +106 -0
  455. package/dist/vendor/hooks-src/create-tauri-window.ts +628 -0
  456. package/dist/vendor/hooks-src/create-timer.ts +150 -0
  457. package/dist/vendor/hooks-src/create-tiptap-editor.ts +326 -0
  458. package/dist/vendor/hooks-src/create-undo-redo.ts +100 -0
  459. package/dist/vendor/hooks-src/create-web-notification.ts +111 -0
  460. package/dist/vendor/hooks-src/create-websocket.ts +179 -0
  461. package/dist/vendor/hooks-src/create-window-size.ts +41 -0
  462. package/dist/vendor/hooks-src/index.ts +48 -0
  463. package/package.json +87 -0
@@ -0,0 +1,195 @@
1
+ import {
2
+ createSignal,
3
+ createContext,
4
+ useContext,
5
+ splitProps,
6
+ type Component,
7
+ type JSX,
8
+ type Accessor,
9
+ } from "solid-js";
10
+ import { createElementSize } from "@/hooks/create-resize-observer";
11
+ import { GripVertical, GripHorizontal } from "lucide-solid";
12
+ import { cn } from "@/lib/cn";
13
+
14
+ export interface ResizableContextValue {
15
+ orientation: Accessor<"horizontal" | "vertical">;
16
+ registerPanel: (id: string, initialSizes: number) => void;
17
+ sizes: Accessor<Record<string, number>>;
18
+ startDragging: (handleIndex: number, event: PointerEvent) => void;
19
+ containerRef: () => HTMLDivElement | undefined;
20
+ }
21
+
22
+ const ResizableContext = createContext<ResizableContextValue>();
23
+
24
+ export interface ResizableGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
25
+ orientation?: "horizontal" | "vertical";
26
+ class?: string;
27
+ children?: JSX.Element;
28
+ }
29
+
30
+ export const ResizableGroup: Component<ResizableGroupProps> = (props) => {
31
+ const [local, rest] = splitProps(props, ["orientation", "class", "children"]);
32
+ const orientation = () => local.orientation || "horizontal";
33
+ let containerEl: HTMLDivElement | undefined;
34
+
35
+ const [panelOrder, setPanelOrder] = createSignal<string[]>([]);
36
+ const [sizes, setSizes] = createSignal<Record<string, number>>({});
37
+
38
+ const registerPanel = (id: string, initialSize: number) => {
39
+ setPanelOrder((prev) => (prev.includes(id) ? prev : [...prev, id]));
40
+ setSizes((prev) => (prev[id] !== undefined ? prev : { ...prev, [id]: initialSize }));
41
+ };
42
+
43
+ const startDragging = (handleIndex: number, event: PointerEvent) => {
44
+ if (!containerEl) return;
45
+ event.preventDefault();
46
+
47
+ const order = panelOrder();
48
+ if (handleIndex < 0 || handleIndex >= order.length - 1) return;
49
+
50
+ const leftId = order[handleIndex];
51
+ const rightId = order[handleIndex + 1];
52
+
53
+ const isHoriz = orientation() === "horizontal";
54
+ const startPos = isHoriz ? event.clientX : event.clientY;
55
+ const rect = containerEl.getBoundingClientRect();
56
+ const totalPx = isHoriz ? rect.width : rect.height;
57
+
58
+ const startLeftPct = sizes()[leftId] ?? 50;
59
+ const startRightPct = sizes()[rightId] ?? 50;
60
+
61
+ const onPointerMove = (e: PointerEvent) => {
62
+ const currentPos = isHoriz ? e.clientX : e.clientY;
63
+ const deltaPx = currentPos - startPos;
64
+ const deltaPct = (deltaPx / totalPx) * 100;
65
+
66
+ let newLeft = startLeftPct + deltaPct;
67
+ let newRight = startRightPct - deltaPct;
68
+
69
+ // Min size limits (10% minimum)
70
+ if (newLeft < 10) {
71
+ newLeft = 10;
72
+ newRight = startLeftPct + startRightPct - 10;
73
+ } else if (newRight < 10) {
74
+ newRight = 10;
75
+ newLeft = startLeftPct + startRightPct - 10;
76
+ }
77
+
78
+ setSizes((prev) => ({
79
+ ...prev,
80
+ [leftId]: newLeft,
81
+ [rightId]: newRight,
82
+ }));
83
+ };
84
+
85
+ const onPointerUp = () => {
86
+ window.removeEventListener("pointermove", onPointerMove);
87
+ window.removeEventListener("pointerup", onPointerUp);
88
+ };
89
+
90
+ window.addEventListener("pointermove", onPointerMove);
91
+ window.addEventListener("pointerup", onPointerUp);
92
+ };
93
+
94
+ return (
95
+ <ResizableContext.Provider
96
+ value={{
97
+ orientation,
98
+ registerPanel,
99
+ sizes,
100
+ startDragging,
101
+ containerRef: () => containerEl,
102
+ }}
103
+ >
104
+ <div
105
+ ref={containerEl}
106
+ class={cn(
107
+ "flex h-full w-full overflow-hidden rounded-lg border border-border bg-background",
108
+ orientation() === "vertical" ? "flex-col" : "flex-row",
109
+ local.class
110
+ )}
111
+ {...rest}
112
+ >
113
+ {local.children}
114
+ </div>
115
+ </ResizableContext.Provider>
116
+ );
117
+ };
118
+
119
+ export interface ResizablePanelProps extends JSX.HTMLAttributes<HTMLDivElement> {
120
+ id: string;
121
+ initialSize?: number;
122
+ class?: string;
123
+ children?: JSX.Element;
124
+ }
125
+
126
+ export const ResizablePanel: Component<ResizablePanelProps> = (props) => {
127
+ const [local, rest] = splitProps(props, ["id", "initialSize", "class", "children"]);
128
+ const ctx = useContext(ResizableContext);
129
+
130
+ if (!ctx) {
131
+ throw new Error("ResizablePanel must be used within a ResizableGroup");
132
+ }
133
+
134
+ ctx.registerPanel(local.id, local.initialSize ?? 50);
135
+
136
+ const currentPct = () => ctx.sizes()[local.id] ?? local.initialSize ?? 50;
137
+
138
+ // Utilize Nikala UI createElementSize hook for reactive size inspection
139
+ const containerSize = createElementSize(() => ctx.containerRef());
140
+
141
+ return (
142
+ <div
143
+ class={cn("overflow-auto transition-[flex-basis] duration-75", local.class)}
144
+ style={{
145
+ "flex-basis": `${currentPct()}%`,
146
+ "flex-grow": 0,
147
+ "flex-shrink": 0,
148
+ }}
149
+ {...rest}
150
+ >
151
+ {local.children}
152
+ </div>
153
+ );
154
+ };
155
+
156
+ export interface ResizableHandleProps extends JSX.HTMLAttributes<HTMLDivElement> {
157
+ handleIndex: number;
158
+ withHandle?: boolean;
159
+ class?: string;
160
+ }
161
+
162
+ export const ResizableHandle: Component<ResizableHandleProps> = (props) => {
163
+ const [local, rest] = splitProps(props, ["handleIndex", "withHandle", "class"]);
164
+ const ctx = useContext(ResizableContext);
165
+
166
+ if (!ctx) {
167
+ throw new Error("ResizableHandle must be used within a ResizableGroup");
168
+ }
169
+
170
+ const isHoriz = () => ctx.orientation() === "horizontal";
171
+
172
+ return (
173
+ <div
174
+ role="separator"
175
+ tabIndex={0}
176
+ class={cn(
177
+ "relative flex select-none items-center justify-center bg-border transition-colors hover:bg-primary/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring cursor-col-resize",
178
+ isHoriz() ? "h-full w-1.5 cursor-col-resize" : "h-1.5 w-full cursor-row-resize",
179
+ local.class
180
+ )}
181
+ onPointerDown={(e) => ctx.startDragging(local.handleIndex, e)}
182
+ {...rest}
183
+ >
184
+ {local.withHandle && (
185
+ <div class="z-10 flex h-4 w-3 items-center justify-center rounded-xs border border-border bg-muted shadow-2xs">
186
+ {isHoriz() ? (
187
+ <GripVertical class="h-2.5 w-2.5 text-muted-foreground" />
188
+ ) : (
189
+ <GripHorizontal class="h-2.5 w-2.5 text-muted-foreground" />
190
+ )}
191
+ </div>
192
+ )}
193
+ </div>
194
+ );
195
+ };
@@ -0,0 +1,195 @@
1
+ import {
2
+ splitProps,
3
+ Show,
4
+ type JSX,
5
+ type ParentComponent,
6
+ type Component,
7
+ } from "solid-js";
8
+ import { cva, type VariantProps } from "class-variance-authority";
9
+ import { CheckCircle2 } from "lucide-solid";
10
+ import { cn } from "@/lib/cn";
11
+ import { Avatar, AvatarImage, AvatarFallback } from "./avatar";
12
+ import { Rating, type RatingProps } from "./rating";
13
+
14
+ /* --- 1. ReviewCard Root --- */
15
+ export const reviewCardVariants = cva(
16
+ "relative flex flex-col justify-between rounded-lg transition-all duration-200 overflow-hidden",
17
+ {
18
+ variants: {
19
+ variant: {
20
+ default: "border border-border bg-card text-card-foreground p-4 sm:p-5 shadow-2xs hover:shadow-xs",
21
+ bordered: "border-2 border-border bg-background text-foreground p-4 sm:p-5",
22
+ flat: "bg-muted/40 text-foreground p-4 sm:p-5",
23
+ glass: "backdrop-blur-md bg-card/70 border border-border/80 text-card-foreground p-4 sm:p-5 shadow-2xs",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ },
29
+ }
30
+ );
31
+
32
+ export interface ReviewCardProps
33
+ extends JSX.HTMLAttributes<HTMLDivElement>,
34
+ VariantProps<typeof reviewCardVariants> {
35
+ class?: string;
36
+ }
37
+
38
+ export const ReviewCard: ParentComponent<ReviewCardProps> = (props) => {
39
+ const [local, rest] = splitProps(props, ["class", "variant", "children"]);
40
+
41
+ return (
42
+ <div
43
+ class={cn(reviewCardVariants({ variant: local.variant }), local.class)}
44
+ {...rest}
45
+ >
46
+ {local.children}
47
+ </div>
48
+ );
49
+ };
50
+
51
+ /* --- 2. ReviewHeader --- */
52
+ export interface ReviewHeaderProps extends JSX.HTMLAttributes<HTMLDivElement> {
53
+ class?: string;
54
+ }
55
+
56
+ export const ReviewHeader: ParentComponent<ReviewHeaderProps> = (props) => {
57
+ const [local, rest] = splitProps(props, ["class", "children"]);
58
+
59
+ return (
60
+ <div
61
+ class={cn("flex items-start justify-between gap-3 mb-3 min-w-0 w-full", local.class)}
62
+ {...rest}
63
+ >
64
+ {local.children}
65
+ </div>
66
+ );
67
+ };
68
+
69
+ /* --- 3. ReviewProfile (Avatar + Names container) --- */
70
+ export interface ReviewProfileProps extends JSX.HTMLAttributes<HTMLDivElement> {
71
+ class?: string;
72
+ }
73
+
74
+ export const ReviewProfile: ParentComponent<ReviewProfileProps> = (props) => {
75
+ const [local, rest] = splitProps(props, ["class", "children"]);
76
+
77
+ return (
78
+ <div class={cn("flex items-start gap-2.5 min-w-0 flex-1 overflow-hidden", local.class)} {...rest}>
79
+ {local.children}
80
+ </div>
81
+ );
82
+ };
83
+
84
+ /* --- 4. ReviewAvatar --- */
85
+ export interface ReviewAvatarProps {
86
+ src?: string;
87
+ alt?: string;
88
+ fallback?: string;
89
+ class?: string;
90
+ }
91
+
92
+ export const ReviewAvatar: Component<ReviewAvatarProps> = (props) => {
93
+ const [local] = splitProps(props, ["src", "alt", "fallback", "class"]);
94
+
95
+ return (
96
+ <Avatar class={cn("size-9 shrink-0 mt-0.5", local.class)}>
97
+ <Show when={local.src}>
98
+ <AvatarImage src={local.src!} alt={local.alt || "Reviewer Avatar"} />
99
+ </Show>
100
+ <AvatarFallback>
101
+ {local.fallback || (local.alt ? local.alt.slice(0, 2).toUpperCase() : "U")}
102
+ </AvatarFallback>
103
+ </Avatar>
104
+ );
105
+ };
106
+
107
+ /* --- 5. ReviewAuthor (Name & Subtitle/Role/Handle) --- */
108
+ export interface ReviewAuthorProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "role"> {
109
+ name: string;
110
+ username?: string;
111
+ role?: string;
112
+ verified?: boolean;
113
+ class?: string;
114
+ }
115
+
116
+ export const ReviewAuthor: Component<ReviewAuthorProps> = (props) => {
117
+ const [local, rest] = splitProps(props, [
118
+ "name",
119
+ "username",
120
+ "role",
121
+ "verified",
122
+ "class",
123
+ ]);
124
+
125
+ return (
126
+ <div class={cn("flex flex-col min-w-0 flex-1 overflow-hidden", local.class)} {...rest}>
127
+ <div class="flex items-center gap-1 font-semibold text-sm leading-tight text-foreground truncate">
128
+ <span class="truncate">{local.name}</span>
129
+ <Show when={local.verified}>
130
+ <CheckCircle2 class="size-3.5 text-primary shrink-0" />
131
+ </Show>
132
+ </div>
133
+ <Show when={local.username || local.role}>
134
+ <p class="text-xs text-muted-foreground truncate mt-0.5">
135
+ {local.username || local.role}
136
+ </p>
137
+ </Show>
138
+ </div>
139
+ );
140
+ };
141
+
142
+ /* --- 6. ReviewRating (Composing standalone Rating) --- */
143
+ export interface ReviewRatingProps extends RatingProps {}
144
+
145
+ export const ReviewRating: Component<ReviewRatingProps> = (props) => {
146
+ const [local, rest] = splitProps(props, ["class", "size", "readOnly"]);
147
+
148
+ return (
149
+ <Rating
150
+ size={local.size || "sm"}
151
+ readOnly={local.readOnly !== undefined ? local.readOnly : true}
152
+ class={cn("shrink-0 select-none ml-auto pt-0.5", local.class)}
153
+ {...rest}
154
+ />
155
+ );
156
+ };
157
+
158
+ /* --- 7. ReviewBody (Quote / Content) --- */
159
+ export interface ReviewBodyProps extends JSX.HTMLAttributes<HTMLParagraphElement> {
160
+ class?: string;
161
+ }
162
+
163
+ export const ReviewBody: ParentComponent<ReviewBodyProps> = (props) => {
164
+ const [local, rest] = splitProps(props, ["class", "children"]);
165
+
166
+ return (
167
+ <p
168
+ class={cn("text-xs sm:text-sm text-muted-foreground leading-relaxed", local.class)}
169
+ {...rest}
170
+ >
171
+ {local.children}
172
+ </p>
173
+ );
174
+ };
175
+
176
+ /* --- 8. ReviewFooter --- */
177
+ export interface ReviewFooterProps extends JSX.HTMLAttributes<HTMLDivElement> {
178
+ class?: string;
179
+ }
180
+
181
+ export const ReviewFooter: ParentComponent<ReviewFooterProps> = (props) => {
182
+ const [local, rest] = splitProps(props, ["class", "children"]);
183
+
184
+ return (
185
+ <div
186
+ class={cn(
187
+ "mt-3 pt-3 border-t border-border/40 flex items-center justify-between text-xs text-muted-foreground",
188
+ local.class
189
+ )}
190
+ {...rest}
191
+ >
192
+ {local.children}
193
+ </div>
194
+ );
195
+ };
@@ -0,0 +1,236 @@
1
+ import {
2
+ createSignal,
3
+ createEffect,
4
+ onCleanup,
5
+ Show,
6
+ For,
7
+ type Component,
8
+ } from "solid-js";
9
+ import { Portal } from "solid-js/web";
10
+ import { useRichTextEditor } from "./editor.js";
11
+ import { ToolbarButton, HIGHLIGHT_PALETTE } from "./toolbar.js";
12
+ import {
13
+ Bold,
14
+ Italic,
15
+ Underline as UnderlineIcon,
16
+ Strikethrough,
17
+ Code,
18
+ Link as LinkIcon,
19
+ Highlighter,
20
+ Heading1,
21
+ Heading2,
22
+ List,
23
+ ListTodo,
24
+ } from "lucide-solid";
25
+
26
+ export const EditorBubbleMenu: Component = () => {
27
+ const { actions, container, isFullscreen, setShowLinkDialog } = useRichTextEditor();
28
+ const [isVisible, setIsVisible] = createSignal(false);
29
+ const [position, setPosition] = createSignal({ top: 0, left: 0 });
30
+ const [showHighlightPalette, setShowHighlightPalette] = createSignal(false);
31
+
32
+ createEffect(() => {
33
+ if (typeof window === "undefined") return;
34
+
35
+ const handleSelectionChange = () => {
36
+ const ed = actions.editor();
37
+ const containerEl = container();
38
+ if (!ed || !ed.isFocused || !ed.isEditable) {
39
+ setIsVisible(false);
40
+ setShowHighlightPalette(false);
41
+ return;
42
+ }
43
+
44
+ const { from, to } = ed.state.selection;
45
+ if (from === to || ed.state.selection.empty) {
46
+ setIsVisible(false);
47
+ setShowHighlightPalette(false);
48
+ return;
49
+ }
50
+
51
+ const selection = window.getSelection();
52
+ if (!selection || selection.rangeCount === 0) {
53
+ setIsVisible(false);
54
+ setShowHighlightPalette(false);
55
+ return;
56
+ }
57
+
58
+ const range = selection.getRangeAt(0);
59
+ const rect = range.getBoundingClientRect();
60
+ if (rect.width === 0 || rect.height === 0) {
61
+ setIsVisible(false);
62
+ setShowHighlightPalette(false);
63
+ return;
64
+ }
65
+
66
+ // Check that selection is inside the editor view element
67
+ const editorDom = ed.view.dom;
68
+ if (!editorDom.contains(range.commonAncestorContainer)) {
69
+ setIsVisible(false);
70
+ setShowHighlightPalette(false);
71
+ return;
72
+ }
73
+
74
+ if (isFullscreen() && containerEl) {
75
+ const containerRect = containerEl.getBoundingClientRect();
76
+ const top = rect.top - containerRect.top - 46;
77
+ const left = rect.left - containerRect.left + rect.width / 2;
78
+
79
+ setPosition({
80
+ top: Math.max(8, top),
81
+ left: Math.max(140, Math.min(containerRect.width - 140, left)),
82
+ });
83
+ } else {
84
+ // Normal mode: viewport coordinates
85
+ setPosition({
86
+ top: Math.max(12, rect.top - 46),
87
+ left: Math.max(140, Math.min(window.innerWidth - 140, rect.left + rect.width / 2)),
88
+ });
89
+ }
90
+
91
+ setIsVisible(true);
92
+ };
93
+
94
+ const handleMouseDown = (e: MouseEvent) => {
95
+ const target = e.target as HTMLElement;
96
+ // If clicking toolbar or any open popovers, hide bubble menu
97
+ if (
98
+ target.closest(".editor-popover-trigger") ||
99
+ target.closest(".editor-popover-content") ||
100
+ target.closest(".editor-toolbar")
101
+ ) {
102
+ setIsVisible(false);
103
+ setShowHighlightPalette(false);
104
+ }
105
+ };
106
+
107
+ document.addEventListener("selectionchange", handleSelectionChange);
108
+ document.addEventListener("mousedown", handleMouseDown);
109
+
110
+ onCleanup(() => {
111
+ document.removeEventListener("selectionchange", handleSelectionChange);
112
+ document.removeEventListener("mousedown", handleMouseDown);
113
+ });
114
+ });
115
+
116
+ const portalTarget = () => {
117
+ if (typeof document === "undefined") return undefined;
118
+ return isFullscreen() ? container() || document.body : document.body;
119
+ };
120
+
121
+ return (
122
+ <Show when={isVisible()}>
123
+ <Portal mount={portalTarget()}>
124
+ <div
125
+ class={`${
126
+ isFullscreen() ? "absolute" : "fixed"
127
+ } z-[999999] flex items-center gap-0.5 p-1 rounded-md border border-border bg-popover text-popover-foreground shadow-xl backdrop-blur-md -translate-x-1/2 transition-all duration-75 animate-in fade-in zoom-in-95 pointer-events-auto select-none`}
128
+ style={{
129
+ top: `${position().top}px`,
130
+ left: `${position().left}px`,
131
+ }}
132
+ >
133
+ <ToolbarButton onClick={actions.toggleBold} isActive={actions.isActive("bold")} tooltip="Bold">
134
+ <Bold class="h-3.5 w-3.5" />
135
+ </ToolbarButton>
136
+ <ToolbarButton onClick={actions.toggleItalic} isActive={actions.isActive("italic")} tooltip="Italic">
137
+ <Italic class="h-3.5 w-3.5" />
138
+ </ToolbarButton>
139
+ <ToolbarButton onClick={actions.toggleUnderline} isActive={actions.isActive("underline")} tooltip="Underline">
140
+ <UnderlineIcon class="h-3.5 w-3.5" />
141
+ </ToolbarButton>
142
+ <ToolbarButton onClick={actions.toggleStrike} isActive={actions.isActive("strike")} tooltip="Strikethrough">
143
+ <Strikethrough class="h-3.5 w-3.5" />
144
+ </ToolbarButton>
145
+ <ToolbarButton onClick={actions.toggleCode} isActive={actions.isActive("code")} tooltip="Code">
146
+ <Code class="h-3.5 w-3.5" />
147
+ </ToolbarButton>
148
+
149
+ {/* Marker Highlight with Tailwind Palette */}
150
+ <div class="relative">
151
+ <ToolbarButton
152
+ onClick={() => setShowHighlightPalette((p) => !p)}
153
+ isActive={actions.isActive("highlight")}
154
+ tooltip="Highlight Color"
155
+ >
156
+ <Highlighter class="h-3.5 w-3.5" />
157
+ </ToolbarButton>
158
+
159
+ <Show when={showHighlightPalette()}>
160
+ <div class="absolute top-full left-1/2 -translate-x-1/2 mt-1.5 z-30 flex flex-col gap-1.5 p-2 bg-popover text-popover-foreground border border-border rounded-lg shadow-2xl min-w-[200px]">
161
+ <div class="text-[10px] font-semibold text-muted-foreground uppercase tracking-wider">
162
+ Marker Palette
163
+ </div>
164
+ <div class="grid grid-cols-5 gap-1.5">
165
+ <For each={HIGHLIGHT_PALETTE}>
166
+ {(color) => (
167
+ <button
168
+ type="button"
169
+ title={color.name}
170
+ class="h-6 w-6 rounded-md border border-border/60 hover:scale-110 transition-transform cursor-pointer shadow-2xs"
171
+ style={{ "background-color": color.value }}
172
+ onClick={() => {
173
+ actions.toggleHighlight(color.value);
174
+ setShowHighlightPalette(false);
175
+ }}
176
+ />
177
+ )}
178
+ </For>
179
+ </div>
180
+ <button
181
+ type="button"
182
+ class="w-full text-center py-1 mt-1 text-xs rounded-md bg-muted hover:bg-muted/80 text-foreground transition-colors cursor-pointer font-medium"
183
+ onClick={() => {
184
+ actions.toggleHighlight();
185
+ setShowHighlightPalette(false);
186
+ }}
187
+ >
188
+ Clear Highlight
189
+ </button>
190
+ </div>
191
+ </Show>
192
+ </div>
193
+
194
+ <ToolbarButton
195
+ onClick={() => setShowLinkDialog(true)}
196
+ isActive={actions.isActive("link")}
197
+ tooltip="Insert Link"
198
+ >
199
+ <LinkIcon class="h-3.5 w-3.5" />
200
+ </ToolbarButton>
201
+
202
+ <div class="h-4 w-px bg-border mx-0.5" />
203
+
204
+ <ToolbarButton
205
+ onClick={() => actions.setHeading(1)}
206
+ isActive={actions.isActive("heading", { level: 1 })}
207
+ tooltip="H1"
208
+ >
209
+ <Heading1 class="h-3.5 w-3.5" />
210
+ </ToolbarButton>
211
+ <ToolbarButton
212
+ onClick={() => actions.setHeading(2)}
213
+ isActive={actions.isActive("heading", { level: 2 })}
214
+ tooltip="H2"
215
+ >
216
+ <Heading2 class="h-3.5 w-3.5" />
217
+ </ToolbarButton>
218
+ <ToolbarButton
219
+ onClick={actions.toggleBulletList}
220
+ isActive={actions.isActive("bulletList")}
221
+ tooltip="List"
222
+ >
223
+ <List class="h-3.5 w-3.5" />
224
+ </ToolbarButton>
225
+ <ToolbarButton
226
+ onClick={actions.toggleTaskList}
227
+ isActive={actions.isActive("taskList")}
228
+ tooltip="Tasks"
229
+ >
230
+ <ListTodo class="h-3.5 w-3.5" />
231
+ </ToolbarButton>
232
+ </div>
233
+ </Portal>
234
+ </Show>
235
+ );
236
+ };