zs_library 0.3.23 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +14 -14
  2. package/dist/components/editor/editor.d.ts +3 -0
  3. package/dist/components/editor/extensions/drag-handle/clipboard-serializer.d.ts +3 -0
  4. package/dist/components/editor/extensions/drag-handle/index.d.ts +26 -0
  5. package/dist/components/editor/generative/ai-completion-command.d.ts +5 -0
  6. package/dist/components/editor/generative/ai-selector-commands.d.ts +5 -0
  7. package/dist/components/editor/generative/ai-selector.d.ts +8 -0
  8. package/dist/components/editor/generative/drag-handle.d.ts +2 -0
  9. package/dist/components/editor/generative/generative-dropdown-menu.d.ts +4 -0
  10. package/dist/components/editor/generative/generative-menu-switch.d.ts +11 -0
  11. package/dist/components/editor/image-upload.d.ts +1 -0
  12. package/dist/components/editor/index.d.ts +13 -0
  13. package/dist/components/editor/lib/colors.d.ts +6 -0
  14. package/dist/components/editor/lib/content.d.ts +4 -0
  15. package/dist/components/editor/lib/nodes.d.ts +9 -0
  16. package/dist/components/editor/lib/url-utils.d.ts +2 -0
  17. package/dist/components/editor/preview.d.ts +7 -0
  18. package/dist/components/editor/selectors/color-selector.d.ts +6 -0
  19. package/dist/components/editor/selectors/link-selector.d.ts +6 -0
  20. package/dist/components/editor/selectors/math-selector.d.ts +1 -0
  21. package/dist/components/editor/selectors/node-selector.d.ts +6 -0
  22. package/dist/components/editor/selectors/text-buttons.d.ts +1 -0
  23. package/dist/components/editor/slash-command.d.ts +8 -0
  24. package/dist/components/editor/type.d.ts +90 -0
  25. package/dist/components/editor/ui/button.d.ts +13 -0
  26. package/dist/components/editor/ui/command.d.ts +81 -0
  27. package/dist/components/editor/ui/dialog.d.ts +19 -0
  28. package/dist/components/editor/ui/dropdown-menu.d.ts +17 -0
  29. package/dist/components/editor/ui/icons/crazy-spinner.d.ts +2 -0
  30. package/dist/components/editor/ui/icons/font-default.d.ts +3 -0
  31. package/dist/components/editor/ui/icons/font-mono.d.ts +3 -0
  32. package/dist/components/editor/ui/icons/font-serif.d.ts +3 -0
  33. package/dist/components/editor/ui/icons/index.d.ts +3 -0
  34. package/dist/components/editor/ui/icons/loading-circle.d.ts +3 -0
  35. package/dist/components/editor/ui/menu.d.ts +1 -0
  36. package/dist/components/editor/ui/popover.d.ts +6 -0
  37. package/dist/components/editor/ui/scroll-area.d.ts +5 -0
  38. package/dist/components/editor/ui/separator.d.ts +4 -0
  39. package/dist/components/editor/ui/tooltip.d.ts +3 -0
  40. package/dist/components/index.d.ts +1 -0
  41. package/dist/i18n/hooks.d.ts +6 -0
  42. package/dist/i18n/index.d.ts +5 -0
  43. package/dist/i18n/locales/en-US.d.ts +27 -0
  44. package/dist/i18n/locales/zh-CN.d.ts +27 -0
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.es.js +8820 -827
  47. package/dist/index.umd.js +130 -90
  48. package/dist/zs_library.css +1 -1
  49. package/package.json +148 -116
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
- # zs_library
2
-
3
- [![NPM version](https://img.shields.io/npm/v/zs_library.svg?style=flat)](https://npmjs.org/package/zs_library)
4
- [![NPM downloads](http://img.shields.io/npm/dm/zs_library.svg?style=flat)](https://npmjs.org/package/zs_library)
5
-
6
- 个人业务组件库 React
7
-
8
- ## 编码规范
9
-
10
- 参考 [Angular coding style guide](https://angular.dev/style-guide#file-structure-conventions)
11
-
12
- ## LICENSE
13
-
14
- MIT
1
+ # zs_library
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/zs_library.svg?style=flat)](https://npmjs.org/package/zs_library)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/zs_library.svg?style=flat)](https://npmjs.org/package/zs_library)
5
+
6
+ 个人业务组件库 React
7
+
8
+ ## 编码规范
9
+
10
+ 参考 [Angular coding style guide](https://angular.dev/style-guide#file-structure-conventions)
11
+
12
+ ## LICENSE
13
+
14
+ MIT
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { EditorProps } from './type';
3
+ export declare const Editor: FC<EditorProps>;
@@ -0,0 +1,3 @@
1
+ import { Slice } from '@tiptap/pm/model';
2
+ import { EditorView } from '@tiptap/pm/view';
3
+ export declare function serializeForClipboard(view: EditorView, slice: Slice): any;
@@ -0,0 +1,26 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { Plugin } from '@tiptap/pm/state';
3
+ export interface GlobalDragHandleOptions {
4
+ /**
5
+ * The width of the drag handle
6
+ */
7
+ dragHandleWidth: number;
8
+ /**
9
+ * The treshold for scrolling
10
+ */
11
+ scrollTreshold: number;
12
+ dragHandleSelector?: string;
13
+ /**
14
+ * Tags to be excluded for drag handle
15
+ */
16
+ excludedTags: string[];
17
+ /**
18
+ * Custom nodes to be included for drag handle
19
+ */
20
+ customNodes: string[];
21
+ }
22
+ export declare function DragHandlePlugin(options: GlobalDragHandleOptions & {
23
+ pluginKey: string;
24
+ }): Plugin<any>;
25
+ declare const GlobalDragHandle: Extension<any, any>;
26
+ export default GlobalDragHandle;
@@ -0,0 +1,5 @@
1
+ declare const AICompletionCommands: ({ completion, onDiscard, }: {
2
+ completion: string;
3
+ onDiscard: () => void;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default AICompletionCommands;
@@ -0,0 +1,5 @@
1
+ interface AISelectorCommandsProps {
2
+ onSelect: (value: string, option: string) => void;
3
+ }
4
+ declare const AISelectorCommands: ({ onSelect }: AISelectorCommandsProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default AISelectorCommands;
@@ -0,0 +1,8 @@
1
+ import { UseCompletionOptions } from '@ai-sdk/react';
2
+ interface AISelectorProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ options?: UseCompletionOptions;
6
+ }
7
+ export declare function AISelector({ onOpenChange, options }: AISelectorProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const DragHandle: () => import("react/jsx-runtime").JSX.Element;
2
+ export default DragHandle;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { DropdownProps } from 'rc-dropdown';
3
+ declare const GenerativeDropdownMenu: FC<DropdownProps>;
4
+ export default GenerativeDropdownMenu;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { UseCompletionOptions } from '@ai-sdk/react';
3
+ interface GenerativeMenuSwitchProps {
4
+ children: ReactNode;
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ enableAI?: boolean;
8
+ aiOptions?: UseCompletionOptions;
9
+ }
10
+ declare const GenerativeMenuSwitch: ({ children, open, onOpenChange, enableAI, aiOptions, }: GenerativeMenuSwitchProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default GenerativeMenuSwitch;
@@ -0,0 +1 @@
1
+ export declare const uploadFn: import('novel').UploadFn;
@@ -0,0 +1,13 @@
1
+ import { Editor as E } from './editor';
2
+ import { default as Preview } from './preview';
3
+ /**
4
+ * 富文本编辑器
5
+ */
6
+ export type EditorType = typeof E & {
7
+ /**
8
+ * 预览组件
9
+ */
10
+ Preview: typeof Preview;
11
+ };
12
+ declare const Editor: EditorType;
13
+ export default Editor;
@@ -0,0 +1,6 @@
1
+ export interface BubbleColorMenuItem {
2
+ name: string;
3
+ color: string;
4
+ }
5
+ export declare const TEXT_COLORS: BubbleColorMenuItem[];
6
+ export declare const HIGHLIGHT_COLORS: BubbleColorMenuItem[];
@@ -0,0 +1,4 @@
1
+ export declare const defaultEditorContent: {
2
+ type: string;
3
+ content: never[];
4
+ };
@@ -0,0 +1,9 @@
1
+ import { RemixiconComponentType } from '@remixicon/react';
2
+ import { useEditor } from 'novel';
3
+ export type SelectorItem = {
4
+ name: string;
5
+ icon: RemixiconComponentType;
6
+ command: (editor: ReturnType<typeof useEditor>["editor"]) => void;
7
+ isActive: (editor: ReturnType<typeof useEditor>["editor"]) => boolean;
8
+ };
9
+ export declare const NODE_SELECTOR_ITEMS: SelectorItem[];
@@ -0,0 +1,2 @@
1
+ export declare function isValidUrl(url: string): boolean;
2
+ export declare function getUrlFromString(str: string): string | null | undefined;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { JSONContent } from 'novel';
3
+ export interface PreviewProps {
4
+ json?: JSONContent;
5
+ }
6
+ declare const Preview: FC<PreviewProps>;
7
+ export default Preview;
@@ -0,0 +1,6 @@
1
+ interface ColorSelectorProps {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ }
5
+ export declare const ColorSelector: ({ open, onOpenChange }: ColorSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ interface LinkSelectorProps {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ }
5
+ export declare const LinkSelector: ({ open, onOpenChange }: LinkSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare const MathSelector: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ interface NodeSelectorProps {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ }
5
+ export declare const NodeSelector: ({ open, onOpenChange }: NodeSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare const TextButtons: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import { UploadFn } from 'novel';
2
+ import { EditorProps } from './type';
3
+ export interface SuggestionItemOptions {
4
+ editorProps: EditorProps;
5
+ uploadFn: UploadFn;
6
+ }
7
+ export declare const suggestionItems: ({ uploadFn }: SuggestionItemOptions) => import('novel').SuggestionItem[];
8
+ export declare const slashCommand: (options: SuggestionItemOptions) => import('@tiptap/core').Extension<any, any>;
@@ -0,0 +1,90 @@
1
+ import { UseCompletionOptions } from '@ai-sdk/react';
2
+ import { EditorInstance, JSONContent, UploadFn } from 'novel';
3
+ import { RefObject } from 'react';
4
+ export interface EditorUploadImageProps {
5
+ /**
6
+ * 上传图片的地址
7
+ */
8
+ action: string;
9
+ /**
10
+ * 上传请求头
11
+ */
12
+ headers?: Record<string, any>;
13
+ /**
14
+ * 上传图片的方法
15
+ * @default post
16
+ */
17
+ method?: string;
18
+ /**
19
+ * 发到后台的文件参数名
20
+ * @default file
21
+ */
22
+ name?: string;
23
+ /**
24
+ * 上传请求时是否携带 cookie
25
+ * @default false
26
+ */
27
+ withCredentials?: boolean;
28
+ /**
29
+ * 上传文件之前的钩子,参数为上传的文件,若返回 false 停止上传
30
+ * @param file
31
+ * @returns
32
+ */
33
+ beforeUpload?: (file: File) => boolean;
34
+ /**
35
+ * 覆盖默认的上传行为,使用 `createImageUpload` 创建
36
+ */
37
+ customUpload?: UploadFn;
38
+ /**
39
+ * 上传图片的最大大小
40
+ */
41
+ maxSize?: number;
42
+ /**
43
+ * 上传图片成功后的回调,返回图片地址
44
+ */
45
+ onSuccess?: (res: Response) => string;
46
+ /**
47
+ * 上传图片失败后的回调
48
+ */
49
+ onError?: (e: Error) => void;
50
+ }
51
+ export interface EditorProps {
52
+ className?: string;
53
+ /**
54
+ * 初始内容
55
+ */
56
+ initialContent?: JSONContent;
57
+ onChange?: (content: JSONContent) => void;
58
+ /**
59
+ * 缓存键
60
+ */
61
+ cacheKey?: string;
62
+ /**
63
+ * 是否启用缓存
64
+ */
65
+ enableCache?: boolean;
66
+ /**
67
+ * 是否显示保存状态
68
+ */
69
+ showSaveStatus?: boolean;
70
+ /**
71
+ * 是否显示字数统计
72
+ */
73
+ showWordCount?: boolean;
74
+ /**
75
+ * 上传图片
76
+ */
77
+ uploadImageProps?: EditorUploadImageProps;
78
+ /**
79
+ * 编辑器实例
80
+ */
81
+ editorRef?: RefObject<EditorInstance | null>;
82
+ /**
83
+ * 是否启用AI
84
+ */
85
+ enableAI?: boolean;
86
+ /**
87
+ * AI选项
88
+ */
89
+ aiOptions?: UseCompletionOptions;
90
+ }
@@ -0,0 +1,13 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from "react";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "outline" | "default" | "destructive" | "secondary" | "ghost" | null | undefined;
5
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ asChild?: boolean;
9
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
10
+ size?: "default" | "sm" | "lg" | "icon";
11
+ }
12
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
+ export { Button };
@@ -0,0 +1,81 @@
1
+ import { DialogProps } from '@radix-ui/react-dialog';
2
+ import * as React from "react";
3
+ declare const Command: React.ForwardRefExoticComponent<Omit<{
4
+ children?: React.ReactNode;
5
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
6
+ ref?: React.Ref<HTMLDivElement>;
7
+ } & {
8
+ asChild?: boolean;
9
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
10
+ label?: string;
11
+ shouldFilter?: boolean;
12
+ filter?: (value: string, search: string, keywords?: string[]) => number;
13
+ defaultValue?: string;
14
+ value?: string;
15
+ onValueChange?: (value: string) => void;
16
+ loop?: boolean;
17
+ disablePointerSelection?: boolean;
18
+ vimBindings?: boolean;
19
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
+ type CommandDialogProps = DialogProps;
21
+ declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => import("react/jsx-runtime").JSX.Element;
22
+ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
23
+ ref?: React.Ref<HTMLInputElement>;
24
+ } & {
25
+ asChild?: boolean;
26
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
27
+ value?: string;
28
+ onValueChange?: (search: string) => void;
29
+ } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
30
+ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
31
+ children?: React.ReactNode;
32
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
33
+ ref?: React.Ref<HTMLDivElement>;
34
+ } & {
35
+ asChild?: boolean;
36
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
37
+ label?: string;
38
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
39
+ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
40
+ children?: React.ReactNode;
41
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
42
+ ref?: React.Ref<HTMLDivElement>;
43
+ } & {
44
+ asChild?: boolean;
45
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
46
+ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
47
+ children?: React.ReactNode;
48
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
49
+ ref?: React.Ref<HTMLDivElement>;
50
+ } & {
51
+ asChild?: boolean;
52
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
53
+ heading?: React.ReactNode;
54
+ value?: string;
55
+ forceMount?: boolean;
56
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
57
+ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
58
+ ref?: React.Ref<HTMLDivElement>;
59
+ } & {
60
+ asChild?: boolean;
61
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
62
+ alwaysRender?: boolean;
63
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
64
+ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
65
+ children?: React.ReactNode;
66
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
67
+ ref?: React.Ref<HTMLDivElement>;
68
+ } & {
69
+ asChild?: boolean;
70
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "onSelect" | "disabled"> & {
71
+ disabled?: boolean;
72
+ onSelect?: (value: string) => void;
73
+ value?: string;
74
+ keywords?: string[];
75
+ forceMount?: boolean;
76
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
77
+ declare const CommandShortcut: {
78
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
79
+ displayName: string;
80
+ };
81
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
3
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DialogHeader: {
10
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ declare const DialogFooter: {
14
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { DropdownProps } from 'rc-dropdown';
3
+ import { MenuProps, MenuItemProps } from 'rc-menu';
4
+ export interface MenuItem extends Omit<MenuItemProps, "children" | "type"> {
5
+ key: string;
6
+ icon?: ReactNode;
7
+ label?: string;
8
+ className?: string;
9
+ type?: string;
10
+ children?: MenuItem[];
11
+ isActive?: boolean;
12
+ }
13
+ interface DropdownMenuProps extends DropdownProps, Omit<MenuProps, "builtinPlacements" | "children" | "type" | "items"> {
14
+ items: MenuItem[];
15
+ }
16
+ declare const DropdownMenu: import('react').ForwardRefExoticComponent<DropdownMenuProps & import('react').RefAttributes<unknown>>;
17
+ export { DropdownMenu };
@@ -0,0 +1,2 @@
1
+ declare const CrazySpinner: () => import("react/jsx-runtime").JSX.Element;
2
+ export default CrazySpinner;
@@ -0,0 +1,3 @@
1
+ export default function FontDefault({ className }: {
2
+ className?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function FontMono({ className }: {
2
+ className?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function FontSerif({ className }: {
2
+ className?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { default as FontDefault } from './font-default';
2
+ export { default as FontSerif } from './font-serif';
3
+ export { default as FontMono } from './font-mono';
@@ -0,0 +1,3 @@
1
+ export default function LoadingCircle({ dimensions }: {
2
+ dimensions?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function Menu(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
+ export { Popover, PopoverTrigger, PopoverContent };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export { Separator };
@@ -0,0 +1,3 @@
1
+ import { TooltipProps } from 'rc-tooltip/lib/Tooltip';
2
+ declare const Tooltip: (props: TooltipProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Tooltip;
@@ -2,3 +2,4 @@ export { default as Desktop } from './desktop';
2
2
  export { default as MdEditor } from './md-editor';
3
3
  export { default as Markdown } from './md-editor/preview';
4
4
  export { default as Dock } from './dock';
5
+ export { default as Editor } from './editor';
@@ -0,0 +1,6 @@
1
+ import { Language } from './index';
2
+ export declare const useI18n: () => {
3
+ t: import('i18next').TFunction<"translation", undefined>;
4
+ currentLang: Language;
5
+ changeLang: (lang: Language) => void;
6
+ };
@@ -0,0 +1,5 @@
1
+ import { default as i18n } from 'i18next';
2
+ export type Language = 'zh-CN' | 'en-US';
3
+ export declare const defaultNS = "common";
4
+ export declare const changeLang: (lang: Language) => void;
5
+ export default i18n;
@@ -0,0 +1,27 @@
1
+ declare const _default: {
2
+ common: {
3
+ ok: string;
4
+ cancel: string;
5
+ confirm: string;
6
+ loading: string;
7
+ noData: string;
8
+ edit: string;
9
+ delete: string;
10
+ save: string;
11
+ };
12
+ desktop: {
13
+ maximize: string;
14
+ minimize: string;
15
+ restore: string;
16
+ close: string;
17
+ };
18
+ editor: {
19
+ placeholder: string;
20
+ bold: string;
21
+ italic: string;
22
+ code: string;
23
+ link: string;
24
+ image: string;
25
+ };
26
+ };
27
+ export default _default;
@@ -0,0 +1,27 @@
1
+ declare const _default: {
2
+ common: {
3
+ ok: string;
4
+ cancel: string;
5
+ confirm: string;
6
+ loading: string;
7
+ noData: string;
8
+ edit: string;
9
+ delete: string;
10
+ save: string;
11
+ };
12
+ desktop: {
13
+ maximize: string;
14
+ minimize: string;
15
+ restore: string;
16
+ close: string;
17
+ };
18
+ editor: {
19
+ placeholder: string;
20
+ bold: string;
21
+ italic: string;
22
+ code: string;
23
+ link: string;
24
+ image: string;
25
+ };
26
+ };
27
+ export default _default;
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { Desktop, MdEditor, Markdown, Dock } from './components';
1
+ export { Desktop, MdEditor, Markdown, Dock, Editor } from './components';