zs_library 0.6.21 → 0.7.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 (145) hide show
  1. package/dist/components/desktop/config.d.ts +1 -1
  2. package/dist/components/desktop/context/config/hooks.d.ts +2 -0
  3. package/dist/components/desktop/context-menu/content.d.ts +1 -2
  4. package/dist/components/desktop/context-menu/sub-menu-item.d.ts +1 -1
  5. package/dist/components/desktop/items/item-content.d.ts +9 -0
  6. package/dist/components/desktop/sortable.d.ts +4 -0
  7. package/dist/components/desktop/types.d.ts +7 -7
  8. package/dist/components/index.d.ts +1 -1
  9. package/dist/components/tiptap-editor/simple/components/tiptap-extension/node-background-extension.d.ts +23 -0
  10. package/dist/components/tiptap-editor/simple/components/tiptap-icons/arrow-left-icon.d.ts +3 -0
  11. package/dist/components/tiptap-editor/simple/components/tiptap-icons/blockquote-icon.d.ts +3 -0
  12. package/dist/components/tiptap-editor/simple/components/tiptap-icons/chevron-down-icon.d.ts +3 -0
  13. package/dist/components/tiptap-editor/simple/components/tiptap-icons/close-icon.d.ts +3 -0
  14. package/dist/components/tiptap-editor/simple/components/tiptap-icons/code-block-icon.d.ts +3 -0
  15. package/dist/components/tiptap-editor/simple/components/tiptap-icons/corner-down-left-icon.d.ts +3 -0
  16. package/dist/components/tiptap-editor/simple/components/tiptap-icons/external-link-icon.d.ts +3 -0
  17. package/dist/components/tiptap-editor/simple/components/tiptap-icons/trash-icon.d.ts +3 -0
  18. package/dist/components/tiptap-editor/simple/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +2 -0
  19. package/dist/components/tiptap-editor/simple/components/tiptap-node/image-node/image-node-extension.d.ts +21 -0
  20. package/dist/components/tiptap-editor/simple/components/tiptap-node/image-node/image-node.d.ts +3 -0
  21. package/dist/components/tiptap-editor/simple/components/tiptap-node/image-upload-node/image-upload-node-extension.d.ts +64 -0
  22. package/dist/components/tiptap-editor/simple/components/tiptap-node/image-upload-node/image-upload-node.d.ts +68 -0
  23. package/dist/components/tiptap-editor/simple/components/tiptap-node/image-upload-node/index.d.ts +1 -0
  24. package/dist/components/tiptap-editor/simple/components/tiptap-ui/ai-button/ai-button.d.ts +9 -0
  25. package/dist/components/tiptap-editor/simple/components/tiptap-ui/ai-button/index.d.ts +2 -0
  26. package/dist/components/tiptap-editor/simple/components/tiptap-ui/ai-button/use-ai.d.ts +38 -0
  27. package/dist/components/tiptap-editor/simple/components/tiptap-ui/blockquote-button/blockquote-button.d.ts +22 -0
  28. package/dist/components/tiptap-editor/simple/components/tiptap-ui/blockquote-button/index.d.ts +2 -0
  29. package/dist/components/tiptap-editor/simple/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +80 -0
  30. package/dist/components/tiptap-editor/simple/components/tiptap-ui/code-block-button/code-block-button.d.ts +22 -0
  31. package/dist/components/tiptap-editor/simple/components/tiptap-ui/code-block-button/index.d.ts +2 -0
  32. package/dist/components/tiptap-editor/simple/components/tiptap-ui/code-block-button/use-code-block.d.ts +87 -0
  33. package/dist/components/tiptap-editor/simple/components/tiptap-ui/color-highlight-button/color-highlight-button.d.ts +45 -0
  34. package/dist/components/tiptap-editor/simple/components/tiptap-ui/color-highlight-button/index.d.ts +2 -0
  35. package/dist/components/tiptap-editor/simple/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts +82 -0
  36. package/dist/components/tiptap-editor/simple/components/tiptap-ui/color-highlight-popover/color-highlight-popover.d.ts +25 -0
  37. package/dist/components/tiptap-editor/simple/components/tiptap-ui/color-highlight-popover/index.d.ts +1 -0
  38. package/dist/components/tiptap-editor/simple/components/tiptap-ui/heading-button/heading-button.d.ts +23 -0
  39. package/dist/components/tiptap-editor/simple/components/tiptap-ui/heading-button/index.d.ts +2 -0
  40. package/dist/components/tiptap-editor/simple/components/tiptap-ui/heading-button/use-heading.d.ts +108 -0
  41. package/dist/components/tiptap-editor/simple/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.d.ts +20 -0
  42. package/dist/components/tiptap-editor/simple/components/tiptap-ui/heading-dropdown-menu/index.d.ts +2 -0
  43. package/dist/components/tiptap-editor/simple/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +73 -0
  44. package/dist/components/tiptap-editor/simple/components/tiptap-ui/image-upload-button/image-upload-button.d.ts +29 -0
  45. package/dist/components/tiptap-editor/simple/components/tiptap-ui/image-upload-button/index.d.ts +2 -0
  46. package/dist/components/tiptap-editor/simple/components/tiptap-ui/image-upload-button/use-image-upload.d.ts +84 -0
  47. package/dist/components/tiptap-editor/simple/components/tiptap-ui/link-popover/index.d.ts +2 -0
  48. package/dist/components/tiptap-editor/simple/components/tiptap-ui/link-popover/link-popover.d.ts +57 -0
  49. package/dist/components/tiptap-editor/simple/components/tiptap-ui/link-popover/use-link-popover.d.ts +117 -0
  50. package/dist/components/tiptap-editor/simple/components/tiptap-ui/list-button/index.d.ts +2 -0
  51. package/dist/components/tiptap-editor/simple/components/tiptap-ui/list-button/list-button.d.ts +23 -0
  52. package/dist/components/tiptap-editor/simple/components/tiptap-ui/list-button/use-list.d.ts +97 -0
  53. package/dist/components/tiptap-editor/simple/components/tiptap-ui/list-dropdown-menu/index.d.ts +1 -0
  54. package/dist/components/tiptap-editor/simple/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.d.ts +29 -0
  55. package/dist/components/tiptap-editor/simple/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts +94 -0
  56. package/dist/components/tiptap-editor/simple/components/tiptap-ui/mark-button/index.d.ts +2 -0
  57. package/dist/components/tiptap-editor/simple/components/tiptap-ui/mark-button/mark-button.d.ts +23 -0
  58. package/dist/components/tiptap-editor/simple/components/tiptap-ui/mark-button/use-mark.d.ts +104 -0
  59. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-align-button/index.d.ts +2 -0
  60. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-align-button/text-align-button.d.ts +30 -0
  61. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-align-button/use-text-align.d.ts +101 -0
  62. package/dist/components/tiptap-editor/simple/components/tiptap-ui/undo-redo-button/index.d.ts +2 -0
  63. package/dist/components/tiptap-editor/simple/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts +23 -0
  64. package/dist/components/tiptap-editor/simple/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +90 -0
  65. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/badge/badge.d.ts +8 -0
  66. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/badge/index.d.ts +1 -0
  67. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/button/button.d.ts +14 -0
  68. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/button/index.d.ts +1 -0
  69. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/card/card.d.ts +9 -0
  70. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/card/index.d.ts +1 -0
  71. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts +16 -0
  72. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/dropdown-menu/index.d.ts +1 -0
  73. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/input/index.d.ts +1 -0
  74. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/input/input.d.ts +3 -0
  75. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/popover/index.d.ts +1 -0
  76. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/popover/popover.d.ts +6 -0
  77. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/separator/index.d.ts +1 -0
  78. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/separator/separator.d.ts +6 -0
  79. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/spacer/index.d.ts +1 -0
  80. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/spacer/spacer.d.ts +6 -0
  81. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/toolbar/index.d.ts +1 -0
  82. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/toolbar/toolbar.d.ts +8 -0
  83. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/tooltip/index.d.ts +1 -0
  84. package/dist/components/tiptap-editor/simple/components/tiptap-ui-primitive/tooltip/tooltip.d.ts +28 -0
  85. package/dist/components/tiptap-editor/simple/hooks/use-composed-ref.d.ts +3 -0
  86. package/dist/components/tiptap-editor/simple/hooks/use-cursor-visibility.d.ts +20 -0
  87. package/dist/components/tiptap-editor/simple/hooks/use-element-rect.d.ts +35 -0
  88. package/dist/components/tiptap-editor/simple/hooks/use-is-breakpoint.d.ts +9 -0
  89. package/dist/components/tiptap-editor/simple/hooks/use-menu-navigation.d.ts +52 -0
  90. package/dist/components/tiptap-editor/simple/hooks/use-scrolling.d.ts +8 -0
  91. package/dist/components/tiptap-editor/simple/hooks/use-throttled-callback.d.ts +18 -0
  92. package/dist/components/tiptap-editor/simple/hooks/use-tiptap-editor.d.ts +17 -0
  93. package/dist/components/tiptap-editor/simple/hooks/use-unmount.d.ts +7 -0
  94. package/dist/components/tiptap-editor/simple/hooks/use-window-size.d.ts +35 -0
  95. package/dist/components/tiptap-editor/simple/i18n/en-US.json.d.ts +107 -0
  96. package/dist/components/tiptap-editor/simple/i18n/zh-CN.json.d.ts +107 -0
  97. package/dist/components/tiptap-editor/simple/index.d.ts +28 -0
  98. package/dist/components/tiptap-editor/simple/lib/ai-service.d.ts +15 -0
  99. package/dist/components/tiptap-editor/simple/lib/feature-utils.d.ts +124 -0
  100. package/dist/components/tiptap-editor/simple/lib/image-upload-handler.d.ts +44 -0
  101. package/dist/components/tiptap-editor/simple/lib/tiptap-utils.d.ts +167 -0
  102. package/dist/components/tiptap-editor/simple/simple-editor.d.ts +10 -0
  103. package/dist/components/tiptap-editor/simple/theme-toggle.d.ts +1 -0
  104. package/dist/index.css +1 -1
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.js +7688 -4797
  107. package/package.json +20 -6
  108. package/dist/components/editor/editor.d.ts +0 -3
  109. package/dist/components/editor/extensions/drag-handle/clipboard-serializer.d.ts +0 -3
  110. package/dist/components/editor/extensions/drag-handle/index.d.ts +0 -26
  111. package/dist/components/editor/generative/ai-completion-command.d.ts +0 -5
  112. package/dist/components/editor/generative/ai-selector-commands.d.ts +0 -5
  113. package/dist/components/editor/generative/ai-selector.d.ts +0 -8
  114. package/dist/components/editor/generative/drag-handle.d.ts +0 -2
  115. package/dist/components/editor/generative/generative-dropdown-menu.d.ts +0 -4
  116. package/dist/components/editor/generative/generative-menu-switch.d.ts +0 -11
  117. package/dist/components/editor/image-upload.d.ts +0 -1
  118. package/dist/components/editor/index.d.ts +0 -13
  119. package/dist/components/editor/lib/colors.d.ts +0 -6
  120. package/dist/components/editor/lib/content.d.ts +0 -4
  121. package/dist/components/editor/lib/nodes.d.ts +0 -9
  122. package/dist/components/editor/lib/url-utils.d.ts +0 -2
  123. package/dist/components/editor/preview.d.ts +0 -7
  124. package/dist/components/editor/selectors/color-selector.d.ts +0 -6
  125. package/dist/components/editor/selectors/link-selector.d.ts +0 -6
  126. package/dist/components/editor/selectors/math-selector.d.ts +0 -1
  127. package/dist/components/editor/selectors/node-selector.d.ts +0 -6
  128. package/dist/components/editor/selectors/text-buttons.d.ts +0 -1
  129. package/dist/components/editor/slash-command.d.ts +0 -8
  130. package/dist/components/editor/type.d.ts +0 -90
  131. package/dist/components/editor/ui/button.d.ts +0 -13
  132. package/dist/components/editor/ui/command.d.ts +0 -81
  133. package/dist/components/editor/ui/dialog.d.ts +0 -19
  134. package/dist/components/editor/ui/dropdown-menu.d.ts +0 -17
  135. package/dist/components/editor/ui/icons/crazy-spinner.d.ts +0 -2
  136. package/dist/components/editor/ui/icons/font-default.d.ts +0 -3
  137. package/dist/components/editor/ui/icons/font-mono.d.ts +0 -3
  138. package/dist/components/editor/ui/icons/font-serif.d.ts +0 -3
  139. package/dist/components/editor/ui/icons/index.d.ts +0 -3
  140. package/dist/components/editor/ui/icons/loading-circle.d.ts +0 -3
  141. package/dist/components/editor/ui/menu.d.ts +0 -1
  142. package/dist/components/editor/ui/popover.d.ts +0 -6
  143. package/dist/components/editor/ui/scroll-area.d.ts +0 -5
  144. package/dist/components/editor/ui/separator.d.ts +0 -4
  145. package/dist/components/editor/ui/tooltip.d.ts +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zs_library",
3
- "version": "0.6.21",
3
+ "version": "0.7.0",
4
4
  "homepage": "https://zs-library.virs.xyz/",
5
5
  "bugs": {
6
6
  "url": "https://github.com/virzs/zs_library/issues"
@@ -41,11 +41,21 @@
41
41
  "@radix-ui/react-separator": "^1.1.2",
42
42
  "@radix-ui/react-slot": "^1.1.2",
43
43
  "@radix-ui/react-tooltip": "^1.1.8",
44
- "@remixicon/react": "^4.5.0",
44
+ "@remixicon/react": "^4.7.0",
45
45
  "@tailwindcss/typography": "^0.5.16",
46
- "@tiptap/core": "^2.11.5",
47
- "@tiptap/html": "^2.11.5",
48
- "@tiptap/pm": "^2.11.5",
46
+ "@tiptap/core": "^3.12.1",
47
+ "@tiptap/extension-highlight": "^3.12.1",
48
+ "@tiptap/extension-horizontal-rule": "^3.12.1",
49
+ "@tiptap/extension-image": "^3.12.1",
50
+ "@tiptap/extension-list": "^3.12.1",
51
+ "@tiptap/extension-subscript": "^3.12.1",
52
+ "@tiptap/extension-superscript": "^3.12.1",
53
+ "@tiptap/extension-text-align": "^3.12.1",
54
+ "@tiptap/extension-typography": "^3.12.1",
55
+ "@tiptap/extensions": "^3.12.1",
56
+ "@tiptap/pm": "^3.12.1",
57
+ "@tiptap/react": "^3.12.1",
58
+ "@tiptap/starter-kit": "^3.12.1",
49
59
  "@types/polylabel": "^1.1.3",
50
60
  "ahooks": "^3.8.4",
51
61
  "bumpp": "^10.1.1",
@@ -57,18 +67,20 @@
57
67
  "highlight.js": "^11.11.1",
58
68
  "i18next": "^24.2.2",
59
69
  "lint-staged": "^15.2.10",
70
+ "lodash.throttle": "^4.1.1",
60
71
  "lowlight": "^3.3.0",
61
72
  "lucide-react": "^0.475.0",
62
73
  "maplibre-gl": "^5.5.0",
74
+ "marked": "^17.0.1",
63
75
  "motion": "^12.23.6",
64
76
  "next-themes": "^0.4.4",
65
- "novel": "^1.0.2",
66
77
  "rc-dialog": "^10.0.0",
67
78
  "rc-drawer": "^7.3.0",
68
79
  "rc-dropdown": "^4.2.1",
69
80
  "rc-image": "^7.11.0",
70
81
  "rc-menu": "^9.16.1",
71
82
  "rc-tooltip": "^6.4.0",
83
+ "react-hotkeys-hook": "^5.2.1",
72
84
  "react-i18next": "^15.4.0",
73
85
  "react-json-view": "^1.21.3",
74
86
  "react-map-gl": "^8.0.4",
@@ -100,6 +112,7 @@
100
112
  "@rspress/plugin-preview": "^1.42.0",
101
113
  "@rspress/plugin-typedoc": "^1.42.0",
102
114
  "@types/geojson": "^7946.0.16",
115
+ "@types/lodash.throttle": "^4.1.9",
103
116
  "@types/node": "^22.10.1",
104
117
  "@types/react": "^19.0.1",
105
118
  "@types/react-dom": "^19.0.1",
@@ -120,6 +133,7 @@
120
133
  "rollup-plugin-auto-external": "^2.0.0",
121
134
  "rollup-plugin-visualizer": "^5.12.0",
122
135
  "rspress": "^1.42.0",
136
+ "sass-embedded": "^1.93.3",
123
137
  "tailwindcss": "^3.4.16",
124
138
  "ts-node": "^10.9.2",
125
139
  "typescript": "^5.7.2",
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- import { EditorProps } from './type';
3
- export declare const Editor: FC<EditorProps>;
@@ -1,3 +0,0 @@
1
- import { Slice } from '@tiptap/pm/model';
2
- import { EditorView } from '@tiptap/pm/view';
3
- export declare function serializeForClipboard(view: EditorView, slice: Slice): any;
@@ -1,26 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- declare const AICompletionCommands: ({ completion, onDiscard, }: {
2
- completion: string;
3
- onDiscard: () => void;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export default AICompletionCommands;
@@ -1,5 +0,0 @@
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;
@@ -1,8 +0,0 @@
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 {};
@@ -1,2 +0,0 @@
1
- declare const DragHandle: () => import("react/jsx-runtime").JSX.Element;
2
- export default DragHandle;
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { DropdownProps } from 'rc-dropdown';
3
- declare const GenerativeDropdownMenu: FC<DropdownProps>;
4
- export default GenerativeDropdownMenu;
@@ -1,11 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export declare const uploadFn: import('novel').UploadFn;
@@ -1,13 +0,0 @@
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;
@@ -1,6 +0,0 @@
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[];
@@ -1,4 +0,0 @@
1
- export declare const defaultEditorContent: {
2
- type: string;
3
- content: never[];
4
- };
@@ -1,9 +0,0 @@
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[];
@@ -1,2 +0,0 @@
1
- export declare function isValidUrl(url: string): boolean;
2
- export declare function getUrlFromString(str: string): string | null | undefined;
@@ -1,7 +0,0 @@
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;
@@ -1,6 +0,0 @@
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 {};
@@ -1,6 +0,0 @@
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 {};
@@ -1 +0,0 @@
1
- export declare const MathSelector: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +0,0 @@
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 {};
@@ -1 +0,0 @@
1
- export declare const TextButtons: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +0,0 @@
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>;
@@ -1,90 +0,0 @@
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
- * 上传文件之前的钩子,参数为上传的文件,若返回 false 停止上传
25
- * @param file
26
- * @returns
27
- */
28
- beforeUpload?: (file: File) => boolean;
29
- /**
30
- * 覆盖默认的上传行为,使用 `createImageUpload` 创建
31
- */
32
- customUpload?: UploadFn;
33
- /**
34
- * 上传图片的最大大小
35
- */
36
- maxSize?: number;
37
- /**
38
- * 上传图片成功后的回调,返回图片地址
39
- */
40
- onSuccess?: (res: Response) => string;
41
- /**
42
- * 上传图片失败后的回调
43
- */
44
- onError?: (e: Error) => void; /**
45
- * 完全自定义的上传函数,相当于 fetch 的 Promise
46
- * @param file 要上传的文件
47
- * @returns Promise,resolve时返回响应数据(可以是Response对象、URL字符串或包含url字段的对象)
48
- */
49
- customUploadFn?: (file: File) => Promise<any>;
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
- }
@@ -1,13 +0,0 @@
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?: "icon" | "default" | "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 };
@@ -1,81 +0,0 @@
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, };
@@ -1,19 +0,0 @@
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, };
@@ -1,17 +0,0 @@
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 };
@@ -1,2 +0,0 @@
1
- declare const CrazySpinner: () => import("react/jsx-runtime").JSX.Element;
2
- export default CrazySpinner;
@@ -1,3 +0,0 @@
1
- export default function FontDefault({ className }: {
2
- className?: string;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export default function FontMono({ className }: {
2
- className?: string;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export default function FontSerif({ className }: {
2
- className?: string;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export { default as FontDefault } from './font-default';
2
- export { default as FontSerif } from './font-serif';
3
- export { default as FontMono } from './font-mono';
@@ -1,3 +0,0 @@
1
- export default function LoadingCircle({ dimensions }: {
2
- dimensions?: string;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export default function Menu(): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
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 };
@@ -1,5 +0,0 @@
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 };
@@ -1,4 +0,0 @@
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 };
@@ -1,3 +0,0 @@
1
- import { TooltipProps } from 'rc-tooltip/lib/Tooltip';
2
- declare const Tooltip: (props: TooltipProps) => import("react/jsx-runtime").JSX.Element;
3
- export default Tooltip;