@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.
- package/README.md +22 -0
- package/dist/cli/commands/build.d.ts +5 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +27 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/dev.d.ts +7 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/dev.js +32 -0
- package/dist/cli/commands/dev.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +308 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/preview.d.ts +7 -0
- package/dist/cli/commands/preview.d.ts.map +1 -0
- package/dist/cli/commands/preview.js +24 -0
- package/dist/cli/commands/preview.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +7 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +33 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +53 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client/App.d.ts +5 -0
- package/dist/client/App.d.ts.map +1 -0
- package/dist/client/App.jsx +31 -0
- package/dist/client/App.jsx.map +1 -0
- package/dist/client/app-types.d.ts +14 -0
- package/dist/client/app-types.d.ts.map +1 -0
- package/dist/client/app-types.js +2 -0
- package/dist/client/app-types.js.map +1 -0
- package/dist/client/components/DocsLayoutShell.d.ts +21 -0
- package/dist/client/components/DocsLayoutShell.d.ts.map +1 -0
- package/dist/client/components/DocsLayoutShell.jsx +14 -0
- package/dist/client/components/DocsLayoutShell.jsx.map +1 -0
- package/dist/client/components/DocsPageContent.d.ts +9 -0
- package/dist/client/components/DocsPageContent.d.ts.map +1 -0
- package/dist/client/components/DocsPageContent.jsx +10 -0
- package/dist/client/components/DocsPageContent.jsx.map +1 -0
- package/dist/client/entry.d.ts +2 -0
- package/dist/client/entry.d.ts.map +1 -0
- package/dist/client/entry.jsx +28 -0
- package/dist/client/entry.jsx.map +1 -0
- package/dist/client/index.html +21 -0
- package/dist/client/navigation/page-navigation.d.ts +9 -0
- package/dist/client/navigation/page-navigation.d.ts.map +1 -0
- package/dist/client/navigation/page-navigation.js +51 -0
- package/dist/client/navigation/page-navigation.js.map +1 -0
- package/dist/client/routing/use-docs-router.d.ts +17 -0
- package/dist/client/routing/use-docs-router.d.ts.map +1 -0
- package/dist/client/routing/use-docs-router.js +71 -0
- package/dist/client/routing/use-docs-router.js.map +1 -0
- package/dist/client/ssr-entry.d.ts +3 -0
- package/dist/client/ssr-entry.d.ts.map +1 -0
- package/dist/client/ssr-entry.jsx +13 -0
- package/dist/client/ssr-entry.jsx.map +1 -0
- package/dist/client/style.css +183 -0
- package/dist/client/utils/sidebar.d.ts +2 -0
- package/dist/client/utils/sidebar.d.ts.map +1 -0
- package/dist/client/utils/sidebar.js +2 -0
- package/dist/client/utils/sidebar.js.map +1 -0
- package/dist/components/mdx-components.d.ts +34 -0
- package/dist/components/mdx-components.d.ts.map +1 -0
- package/dist/components/mdx-components.jsx +131 -0
- package/dist/components/mdx-components.jsx.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +105 -0
- package/dist/config.js.map +1 -0
- package/dist/core/content-scanner.d.ts +10 -0
- package/dist/core/content-scanner.d.ts.map +1 -0
- package/dist/core/content-scanner.js +153 -0
- package/dist/core/content-scanner.js.map +1 -0
- package/dist/core/route-tree.d.ts +19 -0
- package/dist/core/route-tree.d.ts.map +1 -0
- package/dist/core/route-tree.js +176 -0
- package/dist/core/route-tree.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +9 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/mdx/compiler.d.ts +13 -0
- package/dist/mdx/compiler.d.ts.map +1 -0
- package/dist/mdx/compiler.js +38 -0
- package/dist/mdx/compiler.js.map +1 -0
- package/dist/mdx/highlighter.d.ts +22 -0
- package/dist/mdx/highlighter.d.ts.map +1 -0
- package/dist/mdx/highlighter.js +139 -0
- package/dist/mdx/highlighter.js.map +1 -0
- package/dist/mdx/rehype-shiki.d.ts +3 -0
- package/dist/mdx/rehype-shiki.d.ts.map +1 -0
- package/dist/mdx/rehype-shiki.js +83 -0
- package/dist/mdx/rehype-shiki.js.map +1 -0
- package/dist/navigation/index.d.ts +2 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/sidebar-state.d.ts +6 -0
- package/dist/navigation/sidebar-state.d.ts.map +1 -0
- package/dist/navigation/sidebar-state.js +20 -0
- package/dist/navigation/sidebar-state.js.map +1 -0
- package/dist/navigation/sidebar-tree.d.ts +7 -0
- package/dist/navigation/sidebar-tree.d.ts.map +1 -0
- package/dist/navigation/sidebar-tree.js +11 -0
- package/dist/navigation/sidebar-tree.js.map +1 -0
- package/dist/registry/accordion.json +18 -0
- package/dist/registry/alert.json +18 -0
- package/dist/registry/api-table.json +21 -0
- package/dist/registry/aspect-ratio.json +17 -0
- package/dist/registry/avatar.json +17 -0
- package/dist/registry/badge.json +18 -0
- package/dist/registry/banner.json +19 -0
- package/dist/registry/breadcrumb.json +17 -0
- package/dist/registry/bubble.json +18 -0
- package/dist/registry/button-group.json +20 -0
- package/dist/registry/button.json +21 -0
- package/dist/registry/callout.json +19 -0
- package/dist/registry/card.json +17 -0
- package/dist/registry/checkbox.json +20 -0
- package/dist/registry/code-block.json +26 -0
- package/dist/registry/code-group.json +20 -0
- package/dist/registry/collapsible.json +18 -0
- package/dist/registry/combobox.json +21 -0
- package/dist/registry/command.json +27 -0
- package/dist/registry/component-viewer.json +25 -0
- package/dist/registry/container.json +18 -0
- package/dist/registry/context-menu.json +24 -0
- package/dist/registry/create-active-element.json +13 -0
- package/dist/registry/create-app-updater.json +13 -0
- package/dist/registry/create-audio.json +7 -0
- package/dist/registry/create-battery.json +13 -0
- package/dist/registry/create-chat-scroll.json +13 -0
- package/dist/registry/create-click-outside.json +13 -0
- package/dist/registry/create-clipboard.json +13 -0
- package/dist/registry/create-color-mode.json +13 -0
- package/dist/registry/create-controllable-signal.json +13 -0
- package/dist/registry/create-debounce.json +13 -0
- package/dist/registry/create-disclosure.json +13 -0
- package/dist/registry/create-document-tabs.json +13 -0
- package/dist/registry/create-document-title.json +13 -0
- package/dist/registry/create-drop-zone.json +13 -0
- package/dist/registry/create-event-source.json +13 -0
- package/dist/registry/create-favicon.json +13 -0
- package/dist/registry/create-fetch.json +13 -0
- package/dist/registry/create-focus-trap.json +13 -0
- package/dist/registry/create-form.json +13 -0
- package/dist/registry/create-fullscreen.json +13 -0
- package/dist/registry/create-geolocation.json +13 -0
- package/dist/registry/create-global-shortcut.json +13 -0
- package/dist/registry/create-hover.json +13 -0
- package/dist/registry/create-idle.json +13 -0
- package/dist/registry/create-infinite-scroll.json +13 -0
- package/dist/registry/create-input-mask.json +13 -0
- package/dist/registry/create-intersection-observer.json +13 -0
- package/dist/registry/create-keybindings.json +13 -0
- package/dist/registry/create-lock-scroll.json +13 -0
- package/dist/registry/create-long-press.json +13 -0
- package/dist/registry/create-media-query.json +13 -0
- package/dist/registry/create-mouse-position.json +13 -0
- package/dist/registry/create-network-status.json +13 -0
- package/dist/registry/create-orientation.json +13 -0
- package/dist/registry/create-pagination.json +13 -0
- package/dist/registry/create-permission.json +13 -0
- package/dist/registry/create-previous.json +13 -0
- package/dist/registry/create-resize-observer.json +13 -0
- package/dist/registry/create-scroll-into-view.json +13 -0
- package/dist/registry/create-scroll-position.json +13 -0
- package/dist/registry/create-storage.json +13 -0
- package/dist/registry/create-tauri-window.json +13 -0
- package/dist/registry/create-timer.json +13 -0
- package/dist/registry/create-tiptap-editor.json +34 -0
- package/dist/registry/create-undo-redo.json +13 -0
- package/dist/registry/create-web-notification.json +13 -0
- package/dist/registry/create-websocket.json +13 -0
- package/dist/registry/create-window-size.json +13 -0
- package/dist/registry/dialog.json +21 -0
- package/dist/registry/dropdown-menu.json +22 -0
- package/dist/registry/dropzone.json +21 -0
- package/dist/registry/empty.json +17 -0
- package/dist/registry/field.json +20 -0
- package/dist/registry/file-tree.json +21 -0
- package/dist/registry/footer.json +18 -0
- package/dist/registry/forgot-password-01.json +28 -0
- package/dist/registry/form-message.json +17 -0
- package/dist/registry/form.json +17 -0
- package/dist/registry/hero-01.json +22 -0
- package/dist/registry/hover-card.json +18 -0
- package/dist/registry/icon-button.json +20 -0
- package/dist/registry/index.json +1489 -0
- package/dist/registry/input-group.json +21 -0
- package/dist/registry/input.json +17 -0
- package/dist/registry/kbd.json +18 -0
- package/dist/registry/label.json +18 -0
- package/dist/registry/list.json +20 -0
- package/dist/registry/login-01.json +28 -0
- package/dist/registry/logo.json +17 -0
- package/dist/registry/marker.json +17 -0
- package/dist/registry/marquee.json +17 -0
- package/dist/registry/message.json +17 -0
- package/dist/registry/navbar.json +19 -0
- package/dist/registry/navigation-menu.json +22 -0
- package/dist/registry/number-input.json +24 -0
- package/dist/registry/otp-verification-01.json +26 -0
- package/dist/registry/package-manager-tabs.json +24 -0
- package/dist/registry/pager.json +21 -0
- package/dist/registry/pagination.json +22 -0
- package/dist/registry/pin-input.json +17 -0
- package/dist/registry/popover.json +22 -0
- package/dist/registry/progress.json +18 -0
- package/dist/registry/radio-group.json +18 -0
- package/dist/registry/rating.json +19 -0
- package/dist/registry/register-01.json +31 -0
- package/dist/registry/resizable.json +21 -0
- package/dist/registry/review-card.json +23 -0
- package/dist/registry/rich-text-editor.json +95 -0
- package/dist/registry/scroll-area.json +21 -0
- package/dist/registry/section-heading.json +21 -0
- package/dist/registry/select.json +22 -0
- package/dist/registry/separator.json +17 -0
- package/dist/registry/sheet.json +22 -0
- package/dist/registry/sidebar.json +24 -0
- package/dist/registry/skeleton.json +17 -0
- package/dist/registry/slider.json +18 -0
- package/dist/registry/spinner.json +18 -0
- package/dist/registry/stat.json +19 -0
- package/dist/registry/status.json +18 -0
- package/dist/registry/steps.json +20 -0
- package/dist/registry/switch.json +20 -0
- package/dist/registry/table-of-contents.json +23 -0
- package/dist/registry/table.json +17 -0
- package/dist/registry/tabs.json +20 -0
- package/dist/registry/textarea.json +17 -0
- package/dist/registry/theme-manager.json +39 -0
- package/dist/registry/timeline.json +18 -0
- package/dist/registry/titlebar-tabs.json +24 -0
- package/dist/registry/titlebar.json +26 -0
- package/dist/registry/toast.json +20 -0
- package/dist/registry/toggle-group.json +21 -0
- package/dist/registry/toggle.json +18 -0
- package/dist/registry/tooltip.json +18 -0
- package/dist/registry/updater-modal.json +26 -0
- package/dist/server/index.d.ts +18 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +526 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/plugin.d.ts +10 -0
- package/dist/server/plugin.d.ts.map +1 -0
- package/dist/server/plugin.js +271 -0
- package/dist/server/plugin.js.map +1 -0
- package/dist/themes/default/content/breadcrumbs.d.ts +4 -0
- package/dist/themes/default/content/breadcrumbs.d.ts.map +1 -0
- package/dist/themes/default/content/breadcrumbs.jsx +31 -0
- package/dist/themes/default/content/breadcrumbs.jsx.map +1 -0
- package/dist/themes/default/content/pager.d.ts +5 -0
- package/dist/themes/default/content/pager.d.ts.map +1 -0
- package/dist/themes/default/content/pager.jsx +9 -0
- package/dist/themes/default/content/pager.jsx.map +1 -0
- package/dist/themes/default/content/table-of-contents.d.ts +4 -0
- package/dist/themes/default/content/table-of-contents.d.ts.map +1 -0
- package/dist/themes/default/content/table-of-contents.jsx +19 -0
- package/dist/themes/default/content/table-of-contents.jsx.map +1 -0
- package/dist/themes/default/index.d.ts +11 -0
- package/dist/themes/default/index.d.ts.map +1 -0
- package/dist/themes/default/index.js +30 -0
- package/dist/themes/default/index.js.map +1 -0
- package/dist/themes/default/layout.d.ts +4 -0
- package/dist/themes/default/layout.d.ts.map +1 -0
- package/dist/themes/default/layout.jsx +75 -0
- package/dist/themes/default/layout.jsx.map +1 -0
- package/dist/themes/default/navbar.d.ts +4 -0
- package/dist/themes/default/navbar.d.ts.map +1 -0
- package/dist/themes/default/navbar.jsx +74 -0
- package/dist/themes/default/navbar.jsx.map +1 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.d.ts +4 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.d.ts.map +1 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.jsx +22 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.jsx.map +1 -0
- package/dist/themes/default/navigation/sidebar-tree.d.ts +8 -0
- package/dist/themes/default/navigation/sidebar-tree.d.ts.map +1 -0
- package/dist/themes/default/navigation/sidebar-tree.jsx +100 -0
- package/dist/themes/default/navigation/sidebar-tree.jsx.map +1 -0
- package/dist/themes/default/overlays/search-dialog.d.ts +4 -0
- package/dist/themes/default/overlays/search-dialog.d.ts.map +1 -0
- package/dist/themes/default/overlays/search-dialog.jsx +34 -0
- package/dist/themes/default/overlays/search-dialog.jsx.map +1 -0
- package/dist/themes/default/sidebar.d.ts +4 -0
- package/dist/themes/default/sidebar.d.ts.map +1 -0
- package/dist/themes/default/sidebar.jsx +60 -0
- package/dist/themes/default/sidebar.jsx.map +1 -0
- package/dist/themes/index.d.ts +4 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +5 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/types.d.ts +83 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.js +2 -0
- package/dist/themes/types.js.map +1 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/vendor/core-src/index.css +11 -0
- package/dist/vendor/core-src/index.ts +48 -0
- package/dist/vendor/core-src/lib/cn.ts +9 -0
- package/dist/vendor/core-src/registry/blocks/forgot-password-01.tsx +141 -0
- package/dist/vendor/core-src/registry/blocks/hero-01.tsx +28 -0
- package/dist/vendor/core-src/registry/blocks/login-01.tsx +231 -0
- package/dist/vendor/core-src/registry/blocks/otp-verification-01.tsx +170 -0
- package/dist/vendor/core-src/registry/blocks/register-01.tsx +318 -0
- package/dist/vendor/core-src/registry/components/ui/accordion.tsx +128 -0
- package/dist/vendor/core-src/registry/components/ui/alert.tsx +155 -0
- package/dist/vendor/core-src/registry/components/ui/api-table.tsx +117 -0
- package/dist/vendor/core-src/registry/components/ui/aspect-ratio.tsx +31 -0
- package/dist/vendor/core-src/registry/components/ui/avatar.tsx +114 -0
- package/dist/vendor/core-src/registry/components/ui/badge.tsx +56 -0
- package/dist/vendor/core-src/registry/components/ui/banner.tsx +187 -0
- package/dist/vendor/core-src/registry/components/ui/breadcrumb.tsx +136 -0
- package/dist/vendor/core-src/registry/components/ui/bubble.tsx +142 -0
- package/dist/vendor/core-src/registry/components/ui/button-group.tsx +42 -0
- package/dist/vendor/core-src/registry/components/ui/button.tsx +82 -0
- package/dist/vendor/core-src/registry/components/ui/callout.tsx +137 -0
- package/dist/vendor/core-src/registry/components/ui/card.tsx +113 -0
- package/dist/vendor/core-src/registry/components/ui/checkbox.tsx +74 -0
- package/dist/vendor/core-src/registry/components/ui/code-block.tsx +326 -0
- package/dist/vendor/core-src/registry/components/ui/code-group.tsx +105 -0
- package/dist/vendor/core-src/registry/components/ui/collapsible.tsx +73 -0
- package/dist/vendor/core-src/registry/components/ui/combobox.tsx +299 -0
- package/dist/vendor/core-src/registry/components/ui/command.tsx +378 -0
- package/dist/vendor/core-src/registry/components/ui/component-viewer.tsx +363 -0
- package/dist/vendor/core-src/registry/components/ui/container.tsx +45 -0
- package/dist/vendor/core-src/registry/components/ui/context-menu.tsx +237 -0
- package/dist/vendor/core-src/registry/components/ui/dialog.tsx +200 -0
- package/dist/vendor/core-src/registry/components/ui/dropdown-menu.tsx +298 -0
- package/dist/vendor/core-src/registry/components/ui/dropzone.tsx +189 -0
- package/dist/vendor/core-src/registry/components/ui/empty.tsx +83 -0
- package/dist/vendor/core-src/registry/components/ui/field.tsx +71 -0
- package/dist/vendor/core-src/registry/components/ui/file-tree.tsx +181 -0
- package/dist/vendor/core-src/registry/components/ui/footer.tsx +247 -0
- package/dist/vendor/core-src/registry/components/ui/form-message.tsx +36 -0
- package/dist/vendor/core-src/registry/components/ui/form.tsx +21 -0
- package/dist/vendor/core-src/registry/components/ui/hover-card.tsx +105 -0
- package/dist/vendor/core-src/registry/components/ui/icon-button.tsx +34 -0
- package/dist/vendor/core-src/registry/components/ui/input-group.tsx +80 -0
- package/dist/vendor/core-src/registry/components/ui/input.tsx +28 -0
- package/dist/vendor/core-src/registry/components/ui/kbd.tsx +73 -0
- package/dist/vendor/core-src/registry/components/ui/label.tsx +30 -0
- package/dist/vendor/core-src/registry/components/ui/list.tsx +222 -0
- package/dist/vendor/core-src/registry/components/ui/logo.tsx +68 -0
- package/dist/vendor/core-src/registry/components/ui/marker.tsx +102 -0
- package/dist/vendor/core-src/registry/components/ui/marquee.tsx +118 -0
- package/dist/vendor/core-src/registry/components/ui/message.tsx +168 -0
- package/dist/vendor/core-src/registry/components/ui/navbar.tsx +375 -0
- package/dist/vendor/core-src/registry/components/ui/navigation-menu.tsx +358 -0
- package/dist/vendor/core-src/registry/components/ui/number-input.tsx +150 -0
- package/dist/vendor/core-src/registry/components/ui/package-manager-tabs.tsx +226 -0
- package/dist/vendor/core-src/registry/components/ui/pager.tsx +102 -0
- package/dist/vendor/core-src/registry/components/ui/pagination.tsx +258 -0
- package/dist/vendor/core-src/registry/components/ui/pin-input.tsx +198 -0
- package/dist/vendor/core-src/registry/components/ui/popover.tsx +90 -0
- package/dist/vendor/core-src/registry/components/ui/progress.tsx +66 -0
- package/dist/vendor/core-src/registry/components/ui/radio-group.tsx +95 -0
- package/dist/vendor/core-src/registry/components/ui/rating.tsx +185 -0
- package/dist/vendor/core-src/registry/components/ui/resizable.tsx +195 -0
- package/dist/vendor/core-src/registry/components/ui/review-card.tsx +195 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/bubble-menu.tsx +236 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/editor.tsx +308 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/extensions.ts +116 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/footer.tsx +36 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/image-dialog.tsx +75 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/index.ts +11 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/link-dialog.tsx +48 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/markdown.ts +170 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/slash-command.tsx +301 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/table-controls.tsx +68 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/toolbar.tsx +465 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/use-editor.ts +231 -0
- package/dist/vendor/core-src/registry/components/ui/scroll-area.tsx +228 -0
- package/dist/vendor/core-src/registry/components/ui/section-heading.tsx +108 -0
- package/dist/vendor/core-src/registry/components/ui/select.tsx +156 -0
- package/dist/vendor/core-src/registry/components/ui/separator.tsx +37 -0
- package/dist/vendor/core-src/registry/components/ui/sheet.tsx +220 -0
- package/dist/vendor/core-src/registry/components/ui/sidebar.tsx +692 -0
- package/dist/vendor/core-src/registry/components/ui/skeleton.tsx +24 -0
- package/dist/vendor/core-src/registry/components/ui/slider.tsx +153 -0
- package/dist/vendor/core-src/registry/components/ui/spinner.tsx +41 -0
- package/dist/vendor/core-src/registry/components/ui/stat.tsx +245 -0
- package/dist/vendor/core-src/registry/components/ui/status.tsx +121 -0
- package/dist/vendor/core-src/registry/components/ui/steps.tsx +198 -0
- package/dist/vendor/core-src/registry/components/ui/switch.tsx +68 -0
- package/dist/vendor/core-src/registry/components/ui/table-of-contents.tsx +131 -0
- package/dist/vendor/core-src/registry/components/ui/table.tsx +160 -0
- package/dist/vendor/core-src/registry/components/ui/tabs.tsx +204 -0
- package/dist/vendor/core-src/registry/components/ui/textarea.tsx +82 -0
- package/dist/vendor/core-src/registry/components/ui/theme-toggle.tsx +238 -0
- package/dist/vendor/core-src/registry/components/ui/timeline.tsx +350 -0
- package/dist/vendor/core-src/registry/components/ui/titlebar-tabs.tsx +773 -0
- package/dist/vendor/core-src/registry/components/ui/titlebar.tsx +468 -0
- package/dist/vendor/core-src/registry/components/ui/toast.tsx +124 -0
- package/dist/vendor/core-src/registry/components/ui/toggle-group.tsx +203 -0
- package/dist/vendor/core-src/registry/components/ui/toggle.tsx +101 -0
- package/dist/vendor/core-src/registry/components/ui/tooltip.tsx +41 -0
- package/dist/vendor/core-src/registry/components/ui/updater-modal.tsx +254 -0
- package/dist/vendor/core-src/registry/index.ts +50 -0
- package/dist/vendor/core-src/registry/metadata.ts +742 -0
- package/dist/vendor/core-src/registry/providers/theme-provider.tsx +216 -0
- package/dist/vendor/core-src/registry/providers/theme-script.tsx +78 -0
- package/dist/vendor/core-src/registry/providers/theme-transitions.ts +139 -0
- package/dist/vendor/hooks-src/create-active-element.ts +51 -0
- package/dist/vendor/hooks-src/create-app-updater.ts +272 -0
- package/dist/vendor/hooks-src/create-audio-video.ts +444 -0
- package/dist/vendor/hooks-src/create-battery.ts +78 -0
- package/dist/vendor/hooks-src/create-chat-scroll.ts +113 -0
- package/dist/vendor/hooks-src/create-click-outside.ts +82 -0
- package/dist/vendor/hooks-src/create-clipboard.ts +69 -0
- package/dist/vendor/hooks-src/create-color-mode.ts +115 -0
- package/dist/vendor/hooks-src/create-controllable-signal.ts +56 -0
- package/dist/vendor/hooks-src/create-debounce.ts +90 -0
- package/dist/vendor/hooks-src/create-disclosure.ts +82 -0
- package/dist/vendor/hooks-src/create-document-tabs.ts +267 -0
- package/dist/vendor/hooks-src/create-document-title.ts +33 -0
- package/dist/vendor/hooks-src/create-drop-zone.ts +317 -0
- package/dist/vendor/hooks-src/create-event-source.ts +126 -0
- package/dist/vendor/hooks-src/create-favicon.ts +52 -0
- package/dist/vendor/hooks-src/create-fetch.ts +93 -0
- package/dist/vendor/hooks-src/create-focus-trap.ts +94 -0
- package/dist/vendor/hooks-src/create-form.ts +200 -0
- package/dist/vendor/hooks-src/create-fullscreen.ts +105 -0
- package/dist/vendor/hooks-src/create-geolocation.ts +140 -0
- package/dist/vendor/hooks-src/create-global-shortcut.ts +140 -0
- package/dist/vendor/hooks-src/create-hover.ts +88 -0
- package/dist/vendor/hooks-src/create-idle.ts +109 -0
- package/dist/vendor/hooks-src/create-infinite-scroll.ts +90 -0
- package/dist/vendor/hooks-src/create-input-mask.ts +109 -0
- package/dist/vendor/hooks-src/create-intersection-observer.ts +82 -0
- package/dist/vendor/hooks-src/create-keybindings.ts +148 -0
- package/dist/vendor/hooks-src/create-lock-scroll.ts +97 -0
- package/dist/vendor/hooks-src/create-long-press.ts +85 -0
- package/dist/vendor/hooks-src/create-media-query.ts +94 -0
- package/dist/vendor/hooks-src/create-mouse-position.ts +87 -0
- package/dist/vendor/hooks-src/create-network-status.ts +100 -0
- package/dist/vendor/hooks-src/create-orientation.ts +129 -0
- package/dist/vendor/hooks-src/create-pagination.ts +208 -0
- package/dist/vendor/hooks-src/create-permission.ts +91 -0
- package/dist/vendor/hooks-src/create-previous.ts +21 -0
- package/dist/vendor/hooks-src/create-resize-observer.ts +89 -0
- package/dist/vendor/hooks-src/create-scroll-into-view.ts +57 -0
- package/dist/vendor/hooks-src/create-scroll-position.ts +129 -0
- package/dist/vendor/hooks-src/create-storage.ts +106 -0
- package/dist/vendor/hooks-src/create-tauri-window.ts +628 -0
- package/dist/vendor/hooks-src/create-timer.ts +150 -0
- package/dist/vendor/hooks-src/create-tiptap-editor.ts +326 -0
- package/dist/vendor/hooks-src/create-undo-redo.ts +100 -0
- package/dist/vendor/hooks-src/create-web-notification.ts +111 -0
- package/dist/vendor/hooks-src/create-websocket.ts +179 -0
- package/dist/vendor/hooks-src/create-window-size.ts +41 -0
- package/dist/vendor/hooks-src/index.ts +48 -0
- package/package.json +87 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { createEffect, createSignal, onCleanup, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateTimerOptions {
|
|
4
|
+
/** Whether the timer starts running automatically on mount. Defaults to false. */
|
|
5
|
+
autostart?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface CreateTimerReturn {
|
|
9
|
+
/** Accessor indicating if timer is actively running */
|
|
10
|
+
isRunning: Accessor<boolean>;
|
|
11
|
+
/** Function to start or resume the timer */
|
|
12
|
+
start: () => void;
|
|
13
|
+
/** Function to pause/stop the timer */
|
|
14
|
+
stop: () => void;
|
|
15
|
+
/** Function to reset and restart the timer */
|
|
16
|
+
reset: () => void;
|
|
17
|
+
/** Function to toggle running state */
|
|
18
|
+
toggle: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* SolidJS reactive primitive for recurring interval timers.
|
|
23
|
+
*
|
|
24
|
+
* @param intervalMs Interval duration in milliseconds.
|
|
25
|
+
* @param callback Function to execute on each interval tick.
|
|
26
|
+
* @param options Configuration options including autostart.
|
|
27
|
+
*/
|
|
28
|
+
export function createTimer(
|
|
29
|
+
intervalMs: number | Accessor<number>,
|
|
30
|
+
callback: () => void,
|
|
31
|
+
options: CreateTimerOptions = {}
|
|
32
|
+
): CreateTimerReturn {
|
|
33
|
+
const [isRunning, setIsRunning] = createSignal<boolean>(options.autostart ?? false);
|
|
34
|
+
let timerId: ReturnType<typeof setInterval> | undefined;
|
|
35
|
+
|
|
36
|
+
const getInterval = () => (typeof intervalMs === "function" ? intervalMs() : intervalMs);
|
|
37
|
+
|
|
38
|
+
const stop = () => {
|
|
39
|
+
if (timerId) {
|
|
40
|
+
clearInterval(timerId);
|
|
41
|
+
timerId = undefined;
|
|
42
|
+
}
|
|
43
|
+
setIsRunning(false);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const start = () => {
|
|
47
|
+
stop();
|
|
48
|
+
const delay = getInterval();
|
|
49
|
+
if (delay <= 0) return;
|
|
50
|
+
|
|
51
|
+
setIsRunning(true);
|
|
52
|
+
timerId = setInterval(() => {
|
|
53
|
+
callback();
|
|
54
|
+
}, delay);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const reset = () => {
|
|
58
|
+
start();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const toggle = () => {
|
|
62
|
+
if (isRunning()) {
|
|
63
|
+
stop();
|
|
64
|
+
} else {
|
|
65
|
+
start();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
createEffect(() => {
|
|
70
|
+
if (isRunning()) {
|
|
71
|
+
start();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
onCleanup(() => {
|
|
76
|
+
stop();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
isRunning,
|
|
81
|
+
start,
|
|
82
|
+
stop,
|
|
83
|
+
reset,
|
|
84
|
+
toggle,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface CreateCountdownOptions extends CreateTimerOptions {
|
|
89
|
+
/** Callback fired when countdown reaches zero */
|
|
90
|
+
onComplete?: () => void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface CreateCountdownReturn extends CreateTimerReturn {
|
|
94
|
+
/** Accessor for remaining seconds */
|
|
95
|
+
remainingSeconds: Accessor<number>;
|
|
96
|
+
/** Accessor for formatted time string (MM:SS) */
|
|
97
|
+
formatted: Accessor<string>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* SolidJS reactive primitive for countdown timers.
|
|
102
|
+
*
|
|
103
|
+
* @param durationSeconds Total countdown duration in seconds.
|
|
104
|
+
* @param options Configuration options including autostart and onComplete callback.
|
|
105
|
+
*/
|
|
106
|
+
export function createCountdown(
|
|
107
|
+
durationSeconds: number | Accessor<number>,
|
|
108
|
+
options: CreateCountdownOptions = {}
|
|
109
|
+
): CreateCountdownReturn {
|
|
110
|
+
const getInitialDuration = () =>
|
|
111
|
+
typeof durationSeconds === "function" ? durationSeconds() : durationSeconds;
|
|
112
|
+
|
|
113
|
+
const [remaining, setRemaining] = createSignal<number>(getInitialDuration());
|
|
114
|
+
|
|
115
|
+
const timer = createTimer(
|
|
116
|
+
1000,
|
|
117
|
+
() => {
|
|
118
|
+
setRemaining((prev) => {
|
|
119
|
+
if (prev <= 1) {
|
|
120
|
+
timer.stop();
|
|
121
|
+
options.onComplete?.();
|
|
122
|
+
return 0;
|
|
123
|
+
}
|
|
124
|
+
return prev - 1;
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
{ autostart: options.autostart }
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const reset = () => {
|
|
131
|
+
setRemaining(getInitialDuration());
|
|
132
|
+
timer.start();
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const formatted = (): string => {
|
|
136
|
+
const total = remaining();
|
|
137
|
+
const minutes = Math.floor(total / 60);
|
|
138
|
+
const seconds = total % 60;
|
|
139
|
+
const mm = String(minutes).padStart(2, "0");
|
|
140
|
+
const ss = String(seconds).padStart(2, "0");
|
|
141
|
+
return `${mm}:${ss}`;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
return {
|
|
145
|
+
...timer,
|
|
146
|
+
remainingSeconds: remaining,
|
|
147
|
+
formatted,
|
|
148
|
+
reset,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSignal,
|
|
3
|
+
onMount,
|
|
4
|
+
onCleanup,
|
|
5
|
+
type Accessor,
|
|
6
|
+
} from "solid-js";
|
|
7
|
+
import { Editor, type EditorOptions, type Extension } from "@tiptap/core";
|
|
8
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
9
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
10
|
+
import Link from "@tiptap/extension-link";
|
|
11
|
+
import Image from "@tiptap/extension-image";
|
|
12
|
+
import TaskList from "@tiptap/extension-task-list";
|
|
13
|
+
import TaskItem from "@tiptap/extension-task-item";
|
|
14
|
+
import { Table, TableRow, TableCell, TableHeader } from "@tiptap/extension-table";
|
|
15
|
+
import Underline from "@tiptap/extension-underline";
|
|
16
|
+
import TextAlign from "@tiptap/extension-text-align";
|
|
17
|
+
import Highlight from "@tiptap/extension-highlight";
|
|
18
|
+
import CharacterCount from "@tiptap/extension-character-count";
|
|
19
|
+
import Subscript from "@tiptap/extension-subscript";
|
|
20
|
+
import Superscript from "@tiptap/extension-superscript";
|
|
21
|
+
import Typography from "@tiptap/extension-typography";
|
|
22
|
+
import { Markdown } from "tiptap-markdown";
|
|
23
|
+
|
|
24
|
+
export interface CreateTiptapEditorOptions
|
|
25
|
+
extends Partial<Omit<EditorOptions, "element">> {
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
characterLimit?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CreateTiptapEditorReturn {
|
|
31
|
+
editor: Accessor<Editor | null>;
|
|
32
|
+
html: Accessor<string>;
|
|
33
|
+
text: Accessor<string>;
|
|
34
|
+
markdown: Accessor<string>;
|
|
35
|
+
isEmpty: Accessor<boolean>;
|
|
36
|
+
characterCount: Accessor<number>;
|
|
37
|
+
wordCount: Accessor<number>;
|
|
38
|
+
canUndo: Accessor<boolean>;
|
|
39
|
+
canRedo: Accessor<boolean>;
|
|
40
|
+
mount: (element: HTMLElement) => void;
|
|
41
|
+
destroy: () => void;
|
|
42
|
+
isActive: (name: string | Record<string, any>, attributes?: Record<string, any>) => boolean;
|
|
43
|
+
toggleBold: () => void;
|
|
44
|
+
toggleItalic: () => void;
|
|
45
|
+
toggleUnderline: () => void;
|
|
46
|
+
toggleStrike: () => void;
|
|
47
|
+
toggleCode: () => void;
|
|
48
|
+
toggleHighlight: (color?: string) => void;
|
|
49
|
+
setHeading: (level: 1 | 2 | 3 | 4 | 5 | 6) => void;
|
|
50
|
+
setParagraph: () => void;
|
|
51
|
+
toggleBulletList: () => void;
|
|
52
|
+
toggleOrderedList: () => void;
|
|
53
|
+
toggleTaskList: () => void;
|
|
54
|
+
toggleBlockquote: () => void;
|
|
55
|
+
toggleCodeBlock: () => void;
|
|
56
|
+
setTextAlign: (alignment: "left" | "center" | "right" | "justify") => void;
|
|
57
|
+
setLink: (options: string | { href: string; target?: string }) => void;
|
|
58
|
+
unsetLink: () => void;
|
|
59
|
+
setImage: (options: string | { src: string; alt?: string; title?: string }) => void;
|
|
60
|
+
insertTable: (options?: { rows?: number; cols?: number; withHeaderRow?: boolean }) => void;
|
|
61
|
+
insertHorizontalRule: () => void;
|
|
62
|
+
clearContent: () => void;
|
|
63
|
+
setContent: (content: string) => void;
|
|
64
|
+
setEditable: (editable: boolean) => void;
|
|
65
|
+
undo: () => void;
|
|
66
|
+
redo: () => void;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function createTiptapEditor(
|
|
70
|
+
options: CreateTiptapEditorOptions = {}
|
|
71
|
+
): CreateTiptapEditorReturn {
|
|
72
|
+
const [editorInstance, setEditorInstance] = createSignal<Editor | null>(null);
|
|
73
|
+
const [html, setHtml] = createSignal<string>("");
|
|
74
|
+
const [text, setText] = createSignal<string>("");
|
|
75
|
+
const [markdown, setMarkdown] = createSignal<string>("");
|
|
76
|
+
const [isEmpty, setIsEmpty] = createSignal<boolean>(true);
|
|
77
|
+
const [characterCount, setCharacterCount] = createSignal<number>(0);
|
|
78
|
+
const [wordCount, setWordCount] = createSignal<number>(0);
|
|
79
|
+
const [canUndo, setCanUndo] = createSignal<boolean>(false);
|
|
80
|
+
const [canRedo, setCanRedo] = createSignal<boolean>(false);
|
|
81
|
+
const [transactionVersion, setTransactionVersion] = createSignal<number>(0);
|
|
82
|
+
|
|
83
|
+
let targetElement: HTMLElement | null = null;
|
|
84
|
+
|
|
85
|
+
const updateStats = (ed: Editor) => {
|
|
86
|
+
const currentHtml = ed.getHTML();
|
|
87
|
+
const currentText = ed.getText();
|
|
88
|
+
const currentMd = (ed.storage as any).markdown?.getMarkdown?.() || "";
|
|
89
|
+
setHtml(currentHtml);
|
|
90
|
+
setText(currentText);
|
|
91
|
+
setMarkdown(currentMd);
|
|
92
|
+
setIsEmpty(ed.isEmpty);
|
|
93
|
+
setCharacterCount(ed.storage.characterCount?.characters?.() ?? currentText.length);
|
|
94
|
+
setWordCount(ed.storage.characterCount?.words?.() ?? currentText.split(/\s+/).filter(Boolean).length);
|
|
95
|
+
setCanUndo(ed.can().undo());
|
|
96
|
+
setCanRedo(ed.can().redo());
|
|
97
|
+
setTransactionVersion((v) => v + 1);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const defaultExtensions: Extension[] = [
|
|
101
|
+
StarterKit.configure({
|
|
102
|
+
heading: {
|
|
103
|
+
levels: [1, 2, 3, 4, 5, 6],
|
|
104
|
+
HTMLAttributes: { class: "font-heading tracking-tight" },
|
|
105
|
+
},
|
|
106
|
+
bulletList: {
|
|
107
|
+
HTMLAttributes: { class: "list-disc pl-6 my-3 space-y-1" },
|
|
108
|
+
},
|
|
109
|
+
orderedList: {
|
|
110
|
+
HTMLAttributes: { class: "list-decimal pl-6 my-3 space-y-1" },
|
|
111
|
+
},
|
|
112
|
+
codeBlock: {
|
|
113
|
+
HTMLAttributes: {
|
|
114
|
+
class: "rounded-lg bg-muted p-4 font-mono text-xs border border-border my-3 overflow-x-auto text-foreground",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
code: {
|
|
118
|
+
HTMLAttributes: {
|
|
119
|
+
class: "rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground font-semibold border border-border/50",
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
blockquote: {
|
|
123
|
+
HTMLAttributes: {
|
|
124
|
+
class: "border-l-4 border-primary pl-4 italic text-muted-foreground my-3",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
}) as Extension,
|
|
128
|
+
Placeholder.configure({
|
|
129
|
+
placeholder: options.placeholder || "Write something rich or type '/' for commands...",
|
|
130
|
+
emptyEditorClass: "is-editor-empty",
|
|
131
|
+
}) as Extension,
|
|
132
|
+
Underline as Extension,
|
|
133
|
+
Subscript as Extension,
|
|
134
|
+
Superscript as Extension,
|
|
135
|
+
Typography as Extension,
|
|
136
|
+
Highlight.configure({
|
|
137
|
+
multicolor: true,
|
|
138
|
+
HTMLAttributes: { class: "rounded px-1 py-0.5" },
|
|
139
|
+
}) as Extension,
|
|
140
|
+
TextAlign.configure({ types: ["heading", "paragraph"] }) as Extension,
|
|
141
|
+
Link.configure({
|
|
142
|
+
openOnClick: false,
|
|
143
|
+
HTMLAttributes: {
|
|
144
|
+
class: "text-primary font-medium underline underline-offset-4 hover:opacity-80 transition-opacity cursor-pointer",
|
|
145
|
+
},
|
|
146
|
+
}) as Extension,
|
|
147
|
+
Image.configure({
|
|
148
|
+
HTMLAttributes: {
|
|
149
|
+
class: "rounded-lg max-w-full h-auto my-4 border border-border shadow-xs",
|
|
150
|
+
},
|
|
151
|
+
}) as Extension,
|
|
152
|
+
TaskList.configure({
|
|
153
|
+
HTMLAttributes: { class: "list-none pl-0 my-3 space-y-2" },
|
|
154
|
+
}) as Extension,
|
|
155
|
+
TaskItem.configure({
|
|
156
|
+
nested: true,
|
|
157
|
+
HTMLAttributes: { class: "flex items-start gap-2.5 my-1" },
|
|
158
|
+
}) as Extension,
|
|
159
|
+
Table.configure({
|
|
160
|
+
resizable: true,
|
|
161
|
+
HTMLAttributes: {
|
|
162
|
+
class: "border-collapse table-auto w-full my-4 border border-border rounded-lg overflow-hidden text-sm",
|
|
163
|
+
},
|
|
164
|
+
}) as Extension,
|
|
165
|
+
TableRow as Extension,
|
|
166
|
+
TableHeader.configure({
|
|
167
|
+
HTMLAttributes: { class: "border border-border bg-muted/70 px-3 py-2 font-semibold text-left text-xs" },
|
|
168
|
+
}) as Extension,
|
|
169
|
+
TableCell.configure({
|
|
170
|
+
HTMLAttributes: { class: "border border-border px-3 py-2 text-xs" },
|
|
171
|
+
}) as Extension,
|
|
172
|
+
CharacterCount.configure({ limit: options.characterLimit }) as Extension,
|
|
173
|
+
Markdown.configure({
|
|
174
|
+
html: true,
|
|
175
|
+
tightLists: true,
|
|
176
|
+
bulletListMarker: "-",
|
|
177
|
+
linkify: true,
|
|
178
|
+
breaks: false,
|
|
179
|
+
transformPastedText: true,
|
|
180
|
+
transformCopiedText: true,
|
|
181
|
+
}) as Extension,
|
|
182
|
+
];
|
|
183
|
+
|
|
184
|
+
const initEditor = (el: HTMLElement) => {
|
|
185
|
+
if (typeof window === "undefined") return;
|
|
186
|
+
|
|
187
|
+
const extensions = [...defaultExtensions, ...(options.extensions || [])];
|
|
188
|
+
|
|
189
|
+
const editor = new Editor({
|
|
190
|
+
element: el,
|
|
191
|
+
content: options.content,
|
|
192
|
+
editable: options.editable ?? true,
|
|
193
|
+
autofocus: options.autofocus ?? false,
|
|
194
|
+
extensions,
|
|
195
|
+
editorProps: {
|
|
196
|
+
attributes: {
|
|
197
|
+
class:
|
|
198
|
+
"focus:outline-hidden min-h-[220px] w-full max-w-none text-foreground leading-relaxed text-sm " +
|
|
199
|
+
"[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:tracking-tight [&_h1]:mt-6 [&_h1]:mb-3 " +
|
|
200
|
+
"[&_h2]:text-2xl [&_h2]:font-semibold [&_h2]:tracking-tight [&_h2]:mt-5 [&_h2]:mb-2.5 " +
|
|
201
|
+
"[&_h3]:text-xl [&_h3]:font-semibold [&_h3]:mt-4 [&_h3]:mb-2 " +
|
|
202
|
+
"[&_h4]:text-lg [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mb-1.5 " +
|
|
203
|
+
"[&_p]:my-2 [&_p]:leading-7 " +
|
|
204
|
+
"[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:my-3 [&_ul]:space-y-1 " +
|
|
205
|
+
"[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:my-3 [&_ol]:space-y-1 " +
|
|
206
|
+
"[&_li]:my-0.5 " +
|
|
207
|
+
"[&_ul[data-type=taskList]]:list-none [&_ul[data-type=taskList]]:pl-0 [&_ul[data-type=taskList]]:my-3 [&_ul[data-type=taskList]]:space-y-2 " +
|
|
208
|
+
"[&_ul[data-type=taskList]_li]:flex [&_ul[data-type=taskList]_li]:items-start [&_ul[data-type=taskList]_li]:gap-2.5 " +
|
|
209
|
+
"[&_ul[data-type=taskList]_input[type=checkbox]]:mt-1 [&_ul[data-type=taskList]_input[type=checkbox]]:h-4 [&_ul[data-type=taskList]_input[type=checkbox]]:w-4 [&_ul[data-type=taskList]_input[type=checkbox]]:rounded [&_ul[data-type=taskList]_input[type=checkbox]]:border-border [&_ul[data-type=taskList]_input[type=checkbox]]:accent-primary [&_ul[data-type=taskList]_input[type=checkbox]]:cursor-pointer " +
|
|
210
|
+
"[&_mark]:text-foreground [&_mark]:dark:text-background [&_mark]:font-medium [&_mark]:rounded-xs [&_mark]:px-1 [&_mark]:py-0.5 " +
|
|
211
|
+
"[&_.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.is-editor-empty:first-child::before]:text-muted-foreground [&_.is-editor-empty:first-child::before]:float-left [&_.is-editor-empty:first-child::before]:pointer-events-none [&_.is-editor-empty:first-child::before]:h-0",
|
|
212
|
+
},
|
|
213
|
+
...options.editorProps,
|
|
214
|
+
},
|
|
215
|
+
onUpdate: (props) => {
|
|
216
|
+
updateStats(props.editor);
|
|
217
|
+
options.onUpdate?.(props);
|
|
218
|
+
},
|
|
219
|
+
onSelectionUpdate: (props) => {
|
|
220
|
+
updateStats(props.editor);
|
|
221
|
+
options.onSelectionUpdate?.(props);
|
|
222
|
+
},
|
|
223
|
+
onTransaction: (props) => {
|
|
224
|
+
updateStats(props.editor);
|
|
225
|
+
options.onTransaction?.(props);
|
|
226
|
+
},
|
|
227
|
+
onFocus: (args) => options.onFocus?.(args),
|
|
228
|
+
onBlur: (args) => options.onBlur?.(args),
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
setEditorInstance(editor);
|
|
232
|
+
updateStats(editor);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const mount = (element: HTMLElement) => {
|
|
236
|
+
targetElement = element;
|
|
237
|
+
initEditor(element);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const destroy = () => {
|
|
241
|
+
editorInstance()?.destroy();
|
|
242
|
+
setEditorInstance(null);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
onCleanup(() => {
|
|
246
|
+
destroy();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
const isActive = (name: string | Record<string, any>, attributes?: Record<string, any>) => {
|
|
250
|
+
transactionVersion();
|
|
251
|
+
const ed = editorInstance();
|
|
252
|
+
if (!ed) return false;
|
|
253
|
+
if (typeof name === "string") {
|
|
254
|
+
return ed.isActive(name, attributes);
|
|
255
|
+
}
|
|
256
|
+
return ed.isActive(name);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
return {
|
|
260
|
+
editor: editorInstance,
|
|
261
|
+
html,
|
|
262
|
+
text,
|
|
263
|
+
markdown,
|
|
264
|
+
isEmpty,
|
|
265
|
+
characterCount,
|
|
266
|
+
wordCount,
|
|
267
|
+
canUndo,
|
|
268
|
+
canRedo,
|
|
269
|
+
mount,
|
|
270
|
+
destroy,
|
|
271
|
+
isActive,
|
|
272
|
+
toggleBold: () => editorInstance()?.chain().focus().toggleBold().run(),
|
|
273
|
+
toggleItalic: () => editorInstance()?.chain().focus().toggleItalic().run(),
|
|
274
|
+
toggleUnderline: () => editorInstance()?.chain().focus().toggleUnderline().run(),
|
|
275
|
+
toggleStrike: () => editorInstance()?.chain().focus().toggleStrike().run(),
|
|
276
|
+
toggleCode: () => editorInstance()?.chain().focus().toggleCode().run(),
|
|
277
|
+
toggleHighlight: (color) => {
|
|
278
|
+
const ed = editorInstance();
|
|
279
|
+
if (!ed) return;
|
|
280
|
+
if (color) {
|
|
281
|
+
ed.chain().focus().toggleHighlight({ color }).run();
|
|
282
|
+
} else {
|
|
283
|
+
ed.chain().focus().toggleHighlight().run();
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
setHeading: (level) => editorInstance()?.chain().focus().toggleHeading({ level }).run(),
|
|
287
|
+
setParagraph: () => editorInstance()?.chain().focus().setParagraph().run(),
|
|
288
|
+
toggleBulletList: () => editorInstance()?.chain().focus().toggleBulletList().run(),
|
|
289
|
+
toggleOrderedList: () => editorInstance()?.chain().focus().toggleOrderedList().run(),
|
|
290
|
+
toggleTaskList: () => editorInstance()?.chain().focus().toggleTaskList().run(),
|
|
291
|
+
toggleBlockquote: () => editorInstance()?.chain().focus().toggleBlockquote().run(),
|
|
292
|
+
toggleCodeBlock: () => editorInstance()?.chain().focus().toggleCodeBlock().run(),
|
|
293
|
+
setTextAlign: (alignment) => editorInstance()?.chain().focus().setTextAlign(alignment).run(),
|
|
294
|
+
setLink: (opts) => {
|
|
295
|
+
const ed = editorInstance();
|
|
296
|
+
if (!ed) return;
|
|
297
|
+
if (typeof opts === "string") {
|
|
298
|
+
ed.chain().focus().setLink({ href: opts, target: "_blank" }).run();
|
|
299
|
+
} else {
|
|
300
|
+
ed.chain().focus().setLink({ href: opts.href, target: opts.target ?? "_blank" }).run();
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
unsetLink: () => editorInstance()?.chain().focus().unsetLink().run(),
|
|
304
|
+
setImage: (opts) => {
|
|
305
|
+
const ed = editorInstance();
|
|
306
|
+
if (!ed) return;
|
|
307
|
+
if (typeof opts === "string") {
|
|
308
|
+
ed.chain().focus().setImage({ src: opts }).run();
|
|
309
|
+
} else {
|
|
310
|
+
ed.chain().focus().setImage(opts).run();
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
insertTable: (opts) =>
|
|
314
|
+
editorInstance()?.chain().focus().insertTable({
|
|
315
|
+
rows: opts?.rows ?? 3,
|
|
316
|
+
cols: opts?.cols ?? 3,
|
|
317
|
+
withHeaderRow: opts?.withHeaderRow ?? true,
|
|
318
|
+
}).run(),
|
|
319
|
+
insertHorizontalRule: () => editorInstance()?.chain().focus().setHorizontalRule().run(),
|
|
320
|
+
clearContent: () => editorInstance()?.chain().focus().clearContent().run(),
|
|
321
|
+
setContent: (c) => editorInstance()?.commands.setContent(c),
|
|
322
|
+
setEditable: (editable: boolean) => editorInstance()?.setEditable(editable),
|
|
323
|
+
undo: () => editorInstance()?.chain().focus().undo().run(),
|
|
324
|
+
redo: () => editorInstance()?.chain().focus().redo().run(),
|
|
325
|
+
};
|
|
326
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { createSignal, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateUndoRedoOptions<T> {
|
|
4
|
+
/** Maximum number of history states to retain. Defaults to 50. */
|
|
5
|
+
maxHistory?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface CreateUndoRedoReturn<T> {
|
|
9
|
+
/** Signal containing the current state value. */
|
|
10
|
+
state: Accessor<T>;
|
|
11
|
+
/** Update state value and append to history. */
|
|
12
|
+
set: (nextState: T | ((prev: T) => T)) => void;
|
|
13
|
+
/** Revert to previous state history entry. */
|
|
14
|
+
undo: () => void;
|
|
15
|
+
/** Advance to next state history entry. */
|
|
16
|
+
redo: () => void;
|
|
17
|
+
/** Signal indicating whether undo is available. */
|
|
18
|
+
canUndo: Accessor<boolean>;
|
|
19
|
+
/** Signal indicating whether redo is available. */
|
|
20
|
+
canRedo: Accessor<boolean>;
|
|
21
|
+
/** History stack of past states. */
|
|
22
|
+
history: Accessor<T[]>;
|
|
23
|
+
/** Reset history to initial state value. */
|
|
24
|
+
reset: (initialState?: T) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* SolidJS reactive primitive for undo/redo state history management.
|
|
29
|
+
*/
|
|
30
|
+
export function createUndoRedo<T>(
|
|
31
|
+
initialValue: T | Accessor<T>,
|
|
32
|
+
options: CreateUndoRedoOptions<T> = {}
|
|
33
|
+
): CreateUndoRedoReturn<T> {
|
|
34
|
+
const getInitial = (): T => {
|
|
35
|
+
return typeof initialValue === "function"
|
|
36
|
+
? (initialValue as Accessor<T>)()
|
|
37
|
+
: initialValue;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const maxHistory = options.maxHistory ?? 50;
|
|
41
|
+
|
|
42
|
+
const [history, setHistory] = createSignal<T[]>([getInitial()]);
|
|
43
|
+
const [pointer, setPointer] = createSignal<number>(0);
|
|
44
|
+
|
|
45
|
+
const state = (): T => history()[pointer()] ?? getInitial();
|
|
46
|
+
|
|
47
|
+
const canUndo = (): boolean => pointer() > 0;
|
|
48
|
+
const canRedo = (): boolean => pointer() < history().length - 1;
|
|
49
|
+
|
|
50
|
+
const set = (nextState: T | ((prev: T) => T)): void => {
|
|
51
|
+
const current = state();
|
|
52
|
+
const resolved =
|
|
53
|
+
typeof nextState === "function"
|
|
54
|
+
? (nextState as (prev: T) => T)(current)
|
|
55
|
+
: nextState;
|
|
56
|
+
|
|
57
|
+
if (Object.is(resolved, current)) return;
|
|
58
|
+
|
|
59
|
+
/* Slice history up to current pointer and push new state */
|
|
60
|
+
const sliced = history().slice(0, pointer() + 1);
|
|
61
|
+
const updated = [...sliced, resolved];
|
|
62
|
+
|
|
63
|
+
/* Trim to maxHistory limit */
|
|
64
|
+
if (updated.length > maxHistory) {
|
|
65
|
+
updated.shift();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
setHistory(updated);
|
|
69
|
+
setPointer(updated.length - 1);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const undo = (): void => {
|
|
73
|
+
if (canUndo()) {
|
|
74
|
+
setPointer((p) => p - 1);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const redo = (): void => {
|
|
79
|
+
if (canRedo()) {
|
|
80
|
+
setPointer((p) => p + 1);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const reset = (newInitial?: T): void => {
|
|
85
|
+
const init = newInitial !== undefined ? newInitial : getInitial();
|
|
86
|
+
setHistory([init]);
|
|
87
|
+
setPointer(0);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
state,
|
|
92
|
+
set,
|
|
93
|
+
undo,
|
|
94
|
+
redo,
|
|
95
|
+
canUndo,
|
|
96
|
+
canRedo,
|
|
97
|
+
history,
|
|
98
|
+
reset,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createSignal, createEffect, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateWebNotificationOptions extends NotificationOptions {
|
|
4
|
+
/** Title of the notification. */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** Callback fired when notification is clicked. */
|
|
7
|
+
onClick?: (event: Event) => void;
|
|
8
|
+
/** Callback fired when notification is closed. */
|
|
9
|
+
onClose?: (event: Event) => void;
|
|
10
|
+
/** Callback fired when notification error occurs. */
|
|
11
|
+
onError?: (event: Event) => void;
|
|
12
|
+
/** Callback fired when notification is shown. */
|
|
13
|
+
onShow?: (event: Event) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CreateWebNotificationReturn {
|
|
17
|
+
/** Signal accessor containing current Notification permission state. */
|
|
18
|
+
permission: Accessor<NotificationPermission>;
|
|
19
|
+
/** Signal accessor indicating whether Web Notifications API is supported in browser environment. */
|
|
20
|
+
isSupported: Accessor<boolean>;
|
|
21
|
+
/** Function to show a web notification. */
|
|
22
|
+
show: (overrideTitle?: string, overrideOptions?: NotificationOptions) => Notification | null;
|
|
23
|
+
/** Request notification permission from browser. */
|
|
24
|
+
requestPermission: () => Promise<NotificationPermission>;
|
|
25
|
+
/** Close active notification. */
|
|
26
|
+
close: () => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* SolidJS reactive primitive for sending browser desktop notifications and managing notification permissions.
|
|
31
|
+
*/
|
|
32
|
+
export function createWebNotification(
|
|
33
|
+
defaultOptions: CreateWebNotificationOptions = {}
|
|
34
|
+
): CreateWebNotificationReturn {
|
|
35
|
+
const [permission, setPermission] = createSignal<NotificationPermission>("default");
|
|
36
|
+
|
|
37
|
+
const isSupported = (): boolean =>
|
|
38
|
+
typeof window !== "undefined" &&
|
|
39
|
+
"Notification" in window;
|
|
40
|
+
|
|
41
|
+
let activeNotification: Notification | null = null;
|
|
42
|
+
|
|
43
|
+
const updatePermission = (): void => {
|
|
44
|
+
if (isSupported()) {
|
|
45
|
+
setPermission(Notification.permission);
|
|
46
|
+
} else {
|
|
47
|
+
setPermission("denied");
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const requestPermission = async (): Promise<NotificationPermission> => {
|
|
52
|
+
if (!isSupported()) return "denied";
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const result = await Notification.requestPermission();
|
|
56
|
+
setPermission(result);
|
|
57
|
+
return result;
|
|
58
|
+
} catch {
|
|
59
|
+
updatePermission();
|
|
60
|
+
return permission();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const close = (): void => {
|
|
65
|
+
if (activeNotification) {
|
|
66
|
+
activeNotification.close();
|
|
67
|
+
activeNotification = null;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const show = (
|
|
72
|
+
overrideTitle?: string,
|
|
73
|
+
overrideOptions?: NotificationOptions
|
|
74
|
+
): Notification | null => {
|
|
75
|
+
if (!isSupported() || permission() !== "granted") return null;
|
|
76
|
+
|
|
77
|
+
const title = overrideTitle ?? defaultOptions.title ?? "Notification";
|
|
78
|
+
const options: NotificationOptions = {
|
|
79
|
+
...defaultOptions,
|
|
80
|
+
...overrideOptions,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
close();
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
const notification = new Notification(title, options);
|
|
87
|
+
activeNotification = notification;
|
|
88
|
+
|
|
89
|
+
if (defaultOptions.onClick) notification.onclick = (e) => defaultOptions.onClick?.(e);
|
|
90
|
+
if (defaultOptions.onClose) notification.onclose = (e) => defaultOptions.onClose?.(e);
|
|
91
|
+
if (defaultOptions.onError) notification.onerror = (e) => defaultOptions.onError?.(e);
|
|
92
|
+
if (defaultOptions.onShow) notification.onshow = (e) => defaultOptions.onShow?.(e);
|
|
93
|
+
|
|
94
|
+
return notification;
|
|
95
|
+
} catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
createEffect(() => {
|
|
101
|
+
updatePermission();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
permission,
|
|
106
|
+
isSupported,
|
|
107
|
+
show,
|
|
108
|
+
requestPermission,
|
|
109
|
+
close,
|
|
110
|
+
};
|
|
111
|
+
}
|