zs_library 0.7.8 → 0.7.10

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 (36) hide show
  1. package/dist/components/desktop/modal/base-modal.d.ts +1 -0
  2. package/dist/components/md-editor/editor.d.ts +1 -0
  3. package/dist/components/md-editor/index.d.ts +1 -0
  4. package/dist/components/tiptap-editor/simple/components/tiptap-node/code-block-node/code-block-node-view.d.ts +2 -0
  5. package/dist/components/tiptap-editor/simple/components/tiptap-node/table-node/table-menu.d.ts +6 -0
  6. package/dist/components/tiptap-editor/simple/components/tiptap-node/table-node/table-node-extension.d.ts +2 -0
  7. package/dist/components/tiptap-editor/simple/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +1 -1
  8. package/dist/components/tiptap-editor/simple/components/tiptap-ui/code-block-button/use-code-block.d.ts +1 -1
  9. package/dist/components/tiptap-editor/simple/components/tiptap-ui/image-upload-button/image-upload-button.d.ts +1 -1
  10. package/dist/components/tiptap-editor/simple/components/tiptap-ui/table-trigger-button/index.d.ts +2 -0
  11. package/dist/components/tiptap-editor/simple/components/tiptap-ui/table-trigger-button/table-trigger-button.d.ts +8 -0
  12. package/dist/components/tiptap-editor/simple/components/tiptap-ui/table-trigger-button/use-table-trigger-button.d.ts +16 -0
  13. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-color-button/index.d.ts +2 -0
  14. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-color-button/text-color-button.d.ts +6 -0
  15. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-color-button/use-text-color.d.ts +103 -0
  16. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-color-popover/index.d.ts +1 -0
  17. package/dist/components/tiptap-editor/simple/components/tiptap-ui/text-color-popover/text-color-popover.d.ts +14 -0
  18. package/dist/components/tiptap-editor/simple/i18n/en-US.json.d.ts +134 -104
  19. package/dist/components/tiptap-editor/simple/i18n/zh-CN.json.d.ts +134 -104
  20. package/dist/components/tiptap-editor/simple/lib/feature-utils.d.ts +5 -0
  21. package/dist/components/tiptap-editor/simple/lib/image-upload-handler.d.ts +2 -1
  22. package/dist/components/tiptap-editor/simple/simple-editor.d.ts +1 -0
  23. package/dist/components/tiptap-editor/simple/use-simple-editor.d.ts +2 -1
  24. package/dist/i18n/locales/en-US.d.ts +0 -8
  25. package/dist/i18n/locales/zh-CN.d.ts +0 -8
  26. package/dist/index.css +10 -1
  27. package/dist/index.js +5612 -3740
  28. package/package.json +8 -1
  29. package/dist/components/tiptap-editor/simple/components/tiptap-icons/arrow-left-icon.d.ts +0 -3
  30. package/dist/components/tiptap-editor/simple/components/tiptap-icons/blockquote-icon.d.ts +0 -3
  31. package/dist/components/tiptap-editor/simple/components/tiptap-icons/chevron-down-icon.d.ts +0 -3
  32. package/dist/components/tiptap-editor/simple/components/tiptap-icons/close-icon.d.ts +0 -3
  33. package/dist/components/tiptap-editor/simple/components/tiptap-icons/code-block-icon.d.ts +0 -3
  34. package/dist/components/tiptap-editor/simple/components/tiptap-icons/corner-down-left-icon.d.ts +0 -3
  35. package/dist/components/tiptap-editor/simple/components/tiptap-icons/external-link-icon.d.ts +0 -3
  36. package/dist/components/tiptap-editor/simple/components/tiptap-icons/trash-icon.d.ts +0 -3
@@ -14,6 +14,7 @@ export interface BaseModalProps {
14
14
  footer?: ReactNode;
15
15
  className?: string;
16
16
  contentClassName?: string;
17
+ disableMaxHeight?: boolean;
17
18
  }
18
19
  declare const BaseModal: (props: BaseModalProps) => import("react/jsx-runtime").JSX.Element;
19
20
  export default BaseModal;
@@ -47,6 +47,7 @@ export interface MdEditorPluginConfig {
47
47
  }
48
48
  /**
49
49
  * Markdown 编辑器
50
+ * @deprecated 请使用 SimpleEditor 组件代替
50
51
  */
51
52
  export interface MdEditorProps extends Omit<MDXEditorProps, "markdown" | "onChange"> {
52
53
  /**
@@ -2,6 +2,7 @@ import { PrivMdEditor } from './editor';
2
2
  import { default as MDXEditorPreview } from './preview';
3
3
  /**
4
4
  * Markdown 编辑器
5
+ * @deprecated 请使用 SimpleEditor 组件代替
5
6
  */
6
7
  export type MdEditorType = typeof PrivMdEditor & {
7
8
  /**
@@ -0,0 +1,2 @@
1
+ import { NodeViewProps } from '@tiptap/react';
2
+ export declare const CodeBlockNodeView: ({ node, updateAttributes }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { Editor } from '@tiptap/react';
2
+ interface TableMenuProps {
3
+ editor: Editor | null;
4
+ }
5
+ export declare function TableMenu({ editor }: TableMenuProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export declare const TableExtensions: (Extension<any, any> | import('@tiptap/core').Node<import('@tiptap/extension-table').TableOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-table').TableRowOptions, any>)[];
@@ -76,5 +76,5 @@ export declare function useBlockquote(config?: UseBlockquoteConfig): {
76
76
  canToggle: boolean;
77
77
  label: string;
78
78
  shortcutKeys: string;
79
- Icon: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
79
+ Icon: import('@remixicon/react').RemixiconComponentType;
80
80
  };
@@ -83,5 +83,5 @@ export declare function useCodeBlock(config?: UseCodeBlockConfig): {
83
83
  canToggle: boolean;
84
84
  label: string;
85
85
  shortcutKeys: string;
86
- Icon: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
86
+ Icon: import('@remixicon/react').RemixiconComponentType;
87
87
  };
@@ -2,7 +2,7 @@ import { UseImageUploadConfig } from './use-image-upload';
2
2
  import { ButtonProps } from '../../tiptap-ui-primitive/button';
3
3
  type IconProps = React.SVGProps<SVGSVGElement>;
4
4
  type IconComponent = ({ className, ...props }: IconProps) => React.ReactElement;
5
- export interface ImageUploadButtonProps extends Omit<ButtonProps, "type">, UseImageUploadConfig {
5
+ export interface ImageUploadButtonProps extends Omit<ButtonProps, "type" | "onError">, UseImageUploadConfig {
6
6
  /**
7
7
  * Optional text to display alongside the icon.
8
8
  */
@@ -0,0 +1,2 @@
1
+ export * from './table-trigger-button';
2
+ export * from './use-table-trigger-button';
@@ -0,0 +1,8 @@
1
+ import { Button } from '../../tiptap-ui-primitive/button';
2
+ import { UseTableTriggerButtonConfig } from './use-table-trigger-button';
3
+ export interface TableTriggerButtonProps extends Omit<React.ComponentProps<typeof Button>, "type">, UseTableTriggerButtonConfig {
4
+ maxRows?: number;
5
+ maxCols?: number;
6
+ onInserted?: (rows: number, cols: number) => void;
7
+ }
8
+ export declare const TableTriggerButton: import('react').ForwardRefExoticComponent<Omit<TableTriggerButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,16 @@
1
+ import { Editor } from '@tiptap/react';
2
+ export interface UseTableTriggerButtonConfig {
3
+ editor?: Editor | null;
4
+ hideWhenUnavailable?: boolean;
5
+ }
6
+ export declare function canInsertTable(editor: Editor | null): boolean;
7
+ export declare function shouldShowButton(props: {
8
+ editor: Editor | null;
9
+ hideWhenUnavailable: boolean;
10
+ }): boolean;
11
+ export declare function useTableTriggerButton(config?: UseTableTriggerButtonConfig): {
12
+ editor: Editor | null;
13
+ isVisible: boolean;
14
+ canInsert: boolean;
15
+ label: string;
16
+ };
@@ -0,0 +1,2 @@
1
+ export * from './text-color-button';
2
+ export * from './use-text-color';
@@ -0,0 +1,6 @@
1
+ import { ButtonProps } from '../../tiptap-ui-primitive/button';
2
+ import { UseTextColorConfig } from './use-text-color';
3
+ export interface TextColorButtonProps extends Omit<ButtonProps, "type">, UseTextColorConfig {
4
+ text?: string;
5
+ }
6
+ export declare const TextColorButton: import('react').ForwardRefExoticComponent<TextColorButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,103 @@
1
+ import { Editor } from '@tiptap/react';
2
+ export declare const TEXT_COLORS: readonly [{
3
+ readonly label: "gray";
4
+ readonly value: "var(--tt-color-text-gray)";
5
+ readonly contrast: "var(--tt-color-text-gray-contrast)";
6
+ }, {
7
+ readonly label: "brown";
8
+ readonly value: "var(--tt-color-text-brown)";
9
+ readonly contrast: "var(--tt-color-text-brown-contrast)";
10
+ }, {
11
+ readonly label: "orange";
12
+ readonly value: "var(--tt-color-text-orange)";
13
+ readonly contrast: "var(--tt-color-text-orange-contrast)";
14
+ }, {
15
+ readonly label: "yellow";
16
+ readonly value: "var(--tt-color-text-yellow)";
17
+ readonly contrast: "var(--tt-color-text-yellow-contrast)";
18
+ }, {
19
+ readonly label: "green";
20
+ readonly value: "var(--tt-color-text-green)";
21
+ readonly contrast: "var(--tt-color-text-green-contrast)";
22
+ }, {
23
+ readonly label: "blue";
24
+ readonly value: "var(--tt-color-text-blue)";
25
+ readonly contrast: "var(--tt-color-text-blue-contrast)";
26
+ }, {
27
+ readonly label: "purple";
28
+ readonly value: "var(--tt-color-text-purple)";
29
+ readonly contrast: "var(--tt-color-text-purple-contrast)";
30
+ }, {
31
+ readonly label: "pink";
32
+ readonly value: "var(--tt-color-text-pink)";
33
+ readonly contrast: "var(--tt-color-text-pink-contrast)";
34
+ }, {
35
+ readonly label: "red";
36
+ readonly value: "var(--tt-color-text-red)";
37
+ readonly contrast: "var(--tt-color-text-red-contrast)";
38
+ }];
39
+ export type TextColor = (typeof TEXT_COLORS)[number];
40
+ export interface UseTextColorConfig {
41
+ editor?: Editor | null;
42
+ color?: string;
43
+ label?: string;
44
+ hideWhenUnavailable?: boolean;
45
+ onApplied?: ({ color, label }: {
46
+ color: string;
47
+ label: string;
48
+ }) => void;
49
+ }
50
+ export declare function pickTextColorsByValue(values: string[]): ({
51
+ readonly label: "gray";
52
+ readonly value: "var(--tt-color-text-gray)";
53
+ readonly contrast: "var(--tt-color-text-gray-contrast)";
54
+ } | {
55
+ readonly label: "brown";
56
+ readonly value: "var(--tt-color-text-brown)";
57
+ readonly contrast: "var(--tt-color-text-brown-contrast)";
58
+ } | {
59
+ readonly label: "orange";
60
+ readonly value: "var(--tt-color-text-orange)";
61
+ readonly contrast: "var(--tt-color-text-orange-contrast)";
62
+ } | {
63
+ readonly label: "yellow";
64
+ readonly value: "var(--tt-color-text-yellow)";
65
+ readonly contrast: "var(--tt-color-text-yellow-contrast)";
66
+ } | {
67
+ readonly label: "green";
68
+ readonly value: "var(--tt-color-text-green)";
69
+ readonly contrast: "var(--tt-color-text-green-contrast)";
70
+ } | {
71
+ readonly label: "blue";
72
+ readonly value: "var(--tt-color-text-blue)";
73
+ readonly contrast: "var(--tt-color-text-blue-contrast)";
74
+ } | {
75
+ readonly label: "purple";
76
+ readonly value: "var(--tt-color-text-purple)";
77
+ readonly contrast: "var(--tt-color-text-purple-contrast)";
78
+ } | {
79
+ readonly label: "pink";
80
+ readonly value: "var(--tt-color-text-pink)";
81
+ readonly contrast: "var(--tt-color-text-pink-contrast)";
82
+ } | {
83
+ readonly label: "red";
84
+ readonly value: "var(--tt-color-text-red)";
85
+ readonly contrast: "var(--tt-color-text-red-contrast)";
86
+ })[];
87
+ export declare function canSetTextColor(editor: Editor | null): boolean;
88
+ export declare function isTextColorActive(editor: Editor | null, color?: string): boolean;
89
+ export declare function removeTextColor(editor: Editor | null): boolean;
90
+ export declare function shouldShowTextColorButton(props: {
91
+ editor: Editor | null;
92
+ hideWhenUnavailable: boolean;
93
+ }): boolean;
94
+ export declare function useTextColor(config: UseTextColorConfig): {
95
+ isVisible: boolean;
96
+ isActive: boolean;
97
+ canSetTextColor: boolean;
98
+ handleSetTextColor: () => boolean;
99
+ handleRemoveTextColor: () => boolean;
100
+ label: string;
101
+ Icon: import('@remixicon/react').RemixiconComponentType;
102
+ currentColor: string | undefined;
103
+ };
@@ -0,0 +1 @@
1
+ export * from './text-color-popover';
@@ -0,0 +1,14 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { ButtonProps } from '../../tiptap-ui-primitive/button';
3
+ import { TextColor, UseTextColorConfig } from '../text-color-button';
4
+ export interface TextColorPopoverContentProps {
5
+ editor?: Editor | null;
6
+ colors?: TextColor[];
7
+ }
8
+ export interface TextColorPopoverProps extends Omit<ButtonProps, "type">, Pick<UseTextColorConfig, "editor" | "hideWhenUnavailable" | "onApplied"> {
9
+ colors?: TextColor[];
10
+ }
11
+ export declare const TextColorPopoverButton: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
12
+ export declare function TextColorPopoverContent({ editor, colors, }: TextColorPopoverContentProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function TextColorPopover({ editor: providedEditor, colors, hideWhenUnavailable, onApplied, ...props }: TextColorPopoverProps): import("react/jsx-runtime").JSX.Element | null;
14
+ export default TextColorPopover;
@@ -1,107 +1,137 @@
1
- declare const _default: {
2
- "editor": {
3
- "contentAriaLabel": "Main content area, start typing to enter text."
4
- },
5
- "toolbar": {
6
- "add": "Add",
7
- "undo": "Undo",
8
- "redo": "Redo",
9
- "heading": {
10
- "label": "Heading",
11
- "level": "Heading {{level}}"
12
- },
13
- "list": {
14
- "label": "List",
15
- "bullet": "Bullet List",
16
- "ordered": "Ordered List",
17
- "task": "Task List"
18
- },
19
- "blockquote": "Blockquote",
20
- "codeBlock": "Code Block",
21
- "marks": {
22
- "bold": "Bold",
23
- "italic": "Italic",
24
- "strike": "Strike",
25
- "code": "Code",
26
- "underline": "Underline",
27
- "superscript": "Superscript",
28
- "subscript": "Subscript"
29
- },
30
- "highlight": {
31
- "label": "Highlight",
32
- "toggle": "Toggle highlight ({{color}})",
33
- "remove": "Remove highlight",
34
- "colors": {
35
- "default": "Default background",
36
- "gray": "Gray background",
37
- "brown": "Brown background",
38
- "orange": "Orange background",
39
- "yellow": "Yellow background",
40
- "green": "Green background",
41
- "blue": "Blue background",
42
- "purple": "Purple background",
43
- "pink": "Pink background",
44
- "red": "Red background"
45
- }
46
- },
47
- "link": {
48
- "label": "Link",
49
- "placeholder": "Paste a link...",
50
- "apply": "Apply link",
51
- "open": "Open in new window",
52
- "remove": "Remove link"
53
- },
54
- "align": {
55
- "left": "Align left",
56
- "center": "Align center",
57
- "right": "Align right",
58
- "justify": "Align justify"
59
- },
60
- "image": {
61
- "label": "Add image"
62
- },
63
- "ai": {
64
- "label": "AI Assistant",
65
- "placeholder": "Ask AI to write something...",
66
- "apiKeyPlaceholder": "sk-...",
67
- "generate": "Generate",
68
- "generating": "Generating...",
69
- "insert": "Insert",
70
- "replace": "Replace Selection",
71
- "apiKeyLabel": "API Key (DeepSeek)",
72
- "promptLabel": "Prompt",
73
- "error": "Failed to generate content",
74
- "optimizeSelection": "Selection Context: {{text}}",
75
- "isWriting": "AI is writing",
76
- "refinePlaceholder": "Tell AI what else needs to be changed...",
77
- "tryAgain": "Try again",
78
- "discard": "Discard",
79
- "apply": "Apply",
80
- "presets": {
81
- "edit": "Edit",
82
- "improve": "Improve writing",
83
- "fix": "Fix spelling & grammar",
84
- "shorter": "Make shorter",
85
- "longer": "Make longer"
86
- }
87
- }
88
- },
89
- "imageUpload": {
90
- "clickToUpload": "Click to upload",
91
- "dragAndDrop": "or drag and drop",
92
- "limitInfo": "Maximum {{limit}} file(s), {{size}}MB each.",
93
- "uploading": "Uploading {{count}} files",
94
- "clearAll": "Clear All",
95
- "errors": {
96
- "tooLarge": "File size exceeds maximum allowed ({{size}}MB)",
97
- "limitExceeded": "Maximum {{limit}} files allowed",
98
- "noFile": "No file selected",
99
- "noFiles": "No files to upload",
100
- "uploadFailed": "Upload failed",
101
- "noUrl": "Upload failed: No URL returned"
102
- }
103
- }
104
- }
1
+ declare const _default: {
2
+ "editor": {
3
+ "contentAriaLabel": "Main content area, start typing to enter text.",
4
+ "placeholder": "Write something..."
5
+ },
6
+ "toolbar": {
7
+ "add": "Add",
8
+ "undo": "Undo",
9
+ "redo": "Redo",
10
+ "heading": {
11
+ "label": "Heading",
12
+ "level": "Heading {{level}}"
13
+ },
14
+ "list": {
15
+ "label": "List",
16
+ "bullet": "Bullet List",
17
+ "ordered": "Ordered List",
18
+ "task": "Task List"
19
+ },
20
+ "blockquote": "Blockquote",
21
+ "codeBlock": "Code Block",
22
+ "marks": {
23
+ "bold": "Bold",
24
+ "italic": "Italic",
25
+ "strike": "Strike",
26
+ "code": "Code",
27
+ "underline": "Underline",
28
+ "superscript": "Superscript",
29
+ "subscript": "Subscript"
30
+ },
31
+ "textColor": {
32
+ "label": "Text color",
33
+ "toggle": "Set text color ({{color}})",
34
+ "remove": "Clear text color",
35
+ "colors": {
36
+ "gray": "Gray text",
37
+ "brown": "Brown text",
38
+ "orange": "Orange text",
39
+ "yellow": "Yellow text",
40
+ "green": "Green text",
41
+ "blue": "Blue text",
42
+ "purple": "Purple text",
43
+ "pink": "Pink text",
44
+ "red": "Red text"
45
+ }
46
+ },
47
+ "highlight": {
48
+ "label": "Highlight",
49
+ "toggle": "Toggle highlight ({{color}})",
50
+ "remove": "Remove highlight",
51
+ "colors": {
52
+ "default": "Default background",
53
+ "gray": "Gray background",
54
+ "brown": "Brown background",
55
+ "orange": "Orange background",
56
+ "yellow": "Yellow background",
57
+ "green": "Green background",
58
+ "blue": "Blue background",
59
+ "purple": "Purple background",
60
+ "pink": "Pink background",
61
+ "red": "Red background"
62
+ }
63
+ },
64
+ "link": {
65
+ "label": "Link",
66
+ "placeholder": "Paste a link...",
67
+ "apply": "Apply link",
68
+ "open": "Open in new window",
69
+ "remove": "Remove link"
70
+ },
71
+ "align": {
72
+ "left": "Align left",
73
+ "center": "Align center",
74
+ "right": "Align right",
75
+ "justify": "Align justify"
76
+ },
77
+ "image": {
78
+ "label": "Add image"
79
+ },
80
+ "table": {
81
+ "insertTable": "Insert table",
82
+ "size": "{{cols}} x {{rows}}",
83
+ "addColumnBefore": "Add column before",
84
+ "addColumnAfter": "Add column after",
85
+ "deleteColumn": "Delete column",
86
+ "addRowBefore": "Add row before",
87
+ "addRowAfter": "Add row after",
88
+ "deleteRow": "Delete row",
89
+ "mergeCells": "Merge cells",
90
+ "splitCell": "Split cell",
91
+ "deleteTable": "Delete table"
92
+ },
93
+ "ai": {
94
+ "label": "AI Assistant",
95
+ "placeholder": "Ask AI to write something...",
96
+ "apiKeyPlaceholder": "sk-...",
97
+ "generate": "Generate",
98
+ "generating": "Generating...",
99
+ "insert": "Insert",
100
+ "replace": "Replace Selection",
101
+ "apiKeyLabel": "API Key (DeepSeek)",
102
+ "promptLabel": "Prompt",
103
+ "error": "Failed to generate content",
104
+ "optimizeSelection": "Selection Context: {{text}}",
105
+ "isWriting": "AI is writing",
106
+ "refinePlaceholder": "Tell AI what else needs to be changed...",
107
+ "tryAgain": "Try again",
108
+ "discard": "Discard",
109
+ "apply": "Apply",
110
+ "presets": {
111
+ "edit": "Edit",
112
+ "improve": "Improve writing",
113
+ "fix": "Fix spelling & grammar",
114
+ "shorter": "Make shorter",
115
+ "longer": "Make longer"
116
+ }
117
+ }
118
+ },
119
+ "imageUpload": {
120
+ "clickToUpload": "Click to upload",
121
+ "dragAndDrop": "or drag and drop",
122
+ "limitInfo": "Maximum {{limit}} file(s), {{size}}MB each.",
123
+ "uploading": "Uploading {{count}} files",
124
+ "clearAll": "Clear All",
125
+ "errors": {
126
+ "tooLarge": "File size exceeds maximum allowed ({{size}}MB)",
127
+ "limitExceeded": "Maximum {{limit}} files allowed",
128
+ "noFile": "No file selected",
129
+ "noFiles": "No files to upload",
130
+ "uploadFailed": "Upload failed",
131
+ "noUrl": "Upload failed: No URL returned"
132
+ }
133
+ }
134
+ }
105
135
  ;
106
136
 
107
137
  export default _default;