@ctzhian/tiptap 1.9.0 → 1.9.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.
@@ -7,6 +7,6 @@ export interface UploadProgressAttributes {
7
7
  tempId: string;
8
8
  }
9
9
  export declare const getFileIcon: (fileType: string) => React.JSX.Element;
10
- export declare const getFileTypeText: (fileType: string) => "图片" | "视频" | "音频" | "文件";
10
+ export declare const getFileTypeText: (fileType: string) => "音频" | "图片" | "视频" | "文件";
11
11
  declare const UploadProgressView: React.FC<NodeViewProps>;
12
12
  export default UploadProgressView;
@@ -1,4 +1,4 @@
1
1
  import { UploadFunction } from "../../type";
2
2
  export declare const FileHandlerExtension: (props: {
3
3
  onUpload?: UploadFunction;
4
- }) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "key" | "editor">, any>;
4
+ }) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "editor" | "key">, any>;
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/core';
2
2
  export declare const TableExtension: ({ editable }: {
3
3
  editable: boolean;
4
- }) => (import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any> | Extension<any, any>)[];
4
+ }) => (Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>)[];
5
5
  export default TableExtension;
@@ -102,10 +102,10 @@ var useTiptap = function useTiptap(_ref) {
102
102
  }));
103
103
  return {
104
104
  editor: editor,
105
- setContent: function setContent(value) {
105
+ setContent: function setContent(value, type) {
106
106
  var _editor$chain;
107
107
  editor === null || editor === void 0 || (_editor$chain = editor.chain()) === null || _editor$chain === void 0 || (_editor$chain = _editor$chain.focus()) === null || _editor$chain === void 0 || (_editor$chain = _editor$chain.setContent(value, {
108
- contentType: contentType === 'markdown' ? 'markdown' : 'html'
108
+ contentType: type || (contentType === 'markdown' ? 'markdown' : 'html')
109
109
  })) === null || _editor$chain === void 0 || _editor$chain.run();
110
110
  },
111
111
  getContent: function getContent() {
@@ -101,7 +101,7 @@ export type UseTiptapProps = {
101
101
  export type GetExtensionsProps = ExtensionRelativeProps;
102
102
  export type UseTiptapReturn = {
103
103
  editor: Editor;
104
- setContent: (value: string) => void;
104
+ setContent: (value: string, type: UseEditorOptions['contentType']) => void;
105
105
  getContent: () => string;
106
106
  getMarkdown: () => string;
107
107
  getText: () => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzhian/tiptap",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",