zs_library 0.7.0 → 0.7.3
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/dist/components/index.d.ts +2 -1
- package/dist/components/tiptap-editor/simple/components/tiptap-node/image-node/image-node-extension.d.ts +1 -1
- package/dist/components/tiptap-editor/simple/index.d.ts +7 -1
- package/dist/components/tiptap-editor/simple/lib/format-utils.d.ts +22 -0
- package/dist/components/tiptap-editor/simple/simple-editor-render.d.ts +7 -0
- package/dist/components/tiptap-editor/simple/simple-editor.d.ts +9 -3
- package/dist/components/tiptap-editor/simple/use-simple-editor.d.ts +10 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5194 -5113
- package/package.json +5 -2
|
@@ -31,4 +31,5 @@ export type { DesktopIconContainerProps as DockDesktopItemProps } from './dock/d
|
|
|
31
31
|
export type { MobileIconContainerProps as DockMobileItemProps } from './dock/dock-mobile';
|
|
32
32
|
export { default as GeoMap } from './map-view';
|
|
33
33
|
export type { GeoMapProps } from './map-view';
|
|
34
|
-
export { default as SimpleEditor } from './tiptap-editor/simple';
|
|
34
|
+
export { default as SimpleEditor, SimpleEditorRender, useSimpleEditor, jsonToHtml, htmlToJson, EditorFormatConverter, } from './tiptap-editor/simple';
|
|
35
|
+
export type { SimpleEditorProps, SimpleEditorRenderProps, SimpleEditorFeatures, EditorOutputFormat, UseSimpleEditorProps, } from './tiptap-editor/simple';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SimpleEditor } from './simple-editor';
|
|
1
2
|
/**
|
|
2
3
|
* Simple Tiptap Editor
|
|
3
4
|
*
|
|
@@ -25,4 +26,9 @@
|
|
|
25
26
|
* }
|
|
26
27
|
* ```
|
|
27
28
|
*/
|
|
28
|
-
export
|
|
29
|
+
export * from './simple-editor';
|
|
30
|
+
export * from './use-simple-editor';
|
|
31
|
+
export * from './simple-editor-render';
|
|
32
|
+
export * from './lib/feature-utils';
|
|
33
|
+
export * from './lib/format-utils';
|
|
34
|
+
export default SimpleEditor;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSONContent, Editor } from '@tiptap/react';
|
|
2
|
+
export type EditorOutputFormat = "html" | "json" | "markdown";
|
|
3
|
+
/**
|
|
4
|
+
* Converts JSON content to HTML string
|
|
5
|
+
*/
|
|
6
|
+
export declare function jsonToHtml(json: JSONContent): string;
|
|
7
|
+
/**
|
|
8
|
+
* Converts HTML string to JSON content
|
|
9
|
+
*/
|
|
10
|
+
export declare function htmlToJson(html: string): JSONContent;
|
|
11
|
+
/**
|
|
12
|
+
* Utility class for content format conversion
|
|
13
|
+
*/
|
|
14
|
+
export declare class EditorFormatConverter {
|
|
15
|
+
/**
|
|
16
|
+
* Transforms content based on the desired output format
|
|
17
|
+
* @param content - The content from the editor (HTML or JSON)
|
|
18
|
+
* @param format - The desired output format
|
|
19
|
+
* @returns The transformed content
|
|
20
|
+
*/
|
|
21
|
+
static transform(content: string | JSONContent, format: EditorOutputFormat, editor?: Editor): string | JSONContent;
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
2
|
+
export interface SimpleEditorRenderProps {
|
|
3
|
+
value: string | JSONContent;
|
|
4
|
+
className?: string;
|
|
5
|
+
sanitize?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function SimpleEditorRender({ value, className, sanitize }: SimpleEditorRenderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { JSONContent } from '@tiptap/react';
|
|
1
|
+
import { JSONContent, Editor } from '@tiptap/react';
|
|
2
2
|
import { SimpleEditorFeatures } from './lib/feature-utils';
|
|
3
|
+
import { EditorOutputFormat } from './lib/format-utils';
|
|
3
4
|
export interface SimpleEditorProps {
|
|
4
5
|
value?: string | JSONContent;
|
|
5
|
-
onChange?: (value: string) => void;
|
|
6
|
+
onChange?: (value: string | JSONContent) => void;
|
|
6
7
|
className?: string;
|
|
7
8
|
style?: React.CSSProperties;
|
|
8
9
|
features?: SimpleEditorFeatures;
|
|
10
|
+
output?: EditorOutputFormat;
|
|
11
|
+
editor?: Editor | null;
|
|
9
12
|
}
|
|
10
|
-
export
|
|
13
|
+
export interface SimpleEditorRef {
|
|
14
|
+
editor: Editor | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const SimpleEditor: import('react').ForwardRefExoticComponent<SimpleEditorProps & import('react').RefAttributes<SimpleEditorRef>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/react';
|
|
2
|
+
import { SimpleEditorFeatures } from './lib/feature-utils';
|
|
3
|
+
import { EditorOutputFormat } from './lib/format-utils';
|
|
4
|
+
export interface UseSimpleEditorProps {
|
|
5
|
+
value?: string | JSONContent;
|
|
6
|
+
onChange?: (value: string | JSONContent) => void;
|
|
7
|
+
features?: SimpleEditorFeatures;
|
|
8
|
+
output?: EditorOutputFormat;
|
|
9
|
+
}
|
|
10
|
+
export declare function useSimpleEditor({ value, onChange, features, output }: UseSimpleEditorProps): import('@tiptap/core').Editor | null;
|