@editorcn/editor 0.4.1 → 0.5.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.
- package/CHANGELOG.md +24 -0
- package/README.md +12 -3
- package/dist/index.cjs +257 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +262 -150
- package/dist/index.js.map +1 -1
- package/dist/style.css +139 -1071
- package/dist/theme.css +43 -0
- package/package.json +13 -5
package/dist/index.d.cts
CHANGED
|
@@ -80,6 +80,7 @@ interface RichTextEditorLabels {
|
|
|
80
80
|
declare const DEFAULT_LABELS: RichTextEditorLabels;
|
|
81
81
|
|
|
82
82
|
type RichTextEditorVariant = "default" | "subtle" | "compact";
|
|
83
|
+
type RichTextEditorPreset = "document" | "block" | (string & Record<never, never>);
|
|
83
84
|
interface RichTextEditorProps {
|
|
84
85
|
editor: Editor | null;
|
|
85
86
|
children: React.ReactNode;
|
|
@@ -87,6 +88,7 @@ interface RichTextEditorProps {
|
|
|
87
88
|
labels?: Partial<RichTextEditorLabels>;
|
|
88
89
|
icons?: Partial<RichTextEditorIcons>;
|
|
89
90
|
variant?: RichTextEditorVariant;
|
|
91
|
+
preset?: RichTextEditorPreset;
|
|
90
92
|
editable?: boolean;
|
|
91
93
|
}
|
|
92
94
|
interface RichTextEditorToolbarProps {
|
|
@@ -126,7 +128,7 @@ interface BubbleMenuProps {
|
|
|
126
128
|
}
|
|
127
129
|
declare const BubbleMenu: ({ editor }: BubbleMenuProps) => react.JSX.Element | null;
|
|
128
130
|
|
|
129
|
-
declare const RichTextEditor: (({ editor, children, className, labels, icons, variant, editable, }: RichTextEditorProps) => react.JSX.Element) & {
|
|
131
|
+
declare const RichTextEditor: (({ editor, children, className, labels, icons, variant, preset, editable, }: RichTextEditorProps) => react.JSX.Element) & {
|
|
130
132
|
AlignCenter: {
|
|
131
133
|
({ className }: {
|
|
132
134
|
className?: string;
|
|
@@ -308,13 +310,16 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
|
|
|
308
310
|
}) => react.JSX.Element;
|
|
309
311
|
};
|
|
310
312
|
|
|
313
|
+
type TooltipHandle = Tooltip.Handle<string>;
|
|
314
|
+
|
|
311
315
|
interface RichTextEditorContextValue {
|
|
312
316
|
editor: Editor | null;
|
|
313
317
|
labels: RichTextEditorLabels;
|
|
314
318
|
icons: RichTextEditorIcons;
|
|
315
319
|
variant: RichTextEditorVariant;
|
|
320
|
+
preset: RichTextEditorPreset;
|
|
316
321
|
editable: boolean;
|
|
317
|
-
tooltip:
|
|
322
|
+
tooltip: TooltipHandle;
|
|
318
323
|
}
|
|
319
324
|
declare const useRichTextEditorContext: () => RichTextEditorContextValue;
|
|
320
325
|
|
|
@@ -351,4 +356,4 @@ declare module "@tiptap/core" {
|
|
|
351
356
|
}
|
|
352
357
|
declare const YouTubeEmbed: Node<any, any>;
|
|
353
358
|
|
|
354
|
-
export { BubbleMenu, DEFAULT_ICONS, DEFAULT_LABELS, DEFAULT_LANGUAGE_ICONS, Link, RichTextEditor, type RichTextEditorFooterProps, type RichTextEditorIcons, type RichTextEditorLabels, type RichTextEditorProps, type RichTextEditorVariant, TwitterEmbed, type WordCountInfo, YouTubeEmbed, useRichTextEditorContext };
|
|
359
|
+
export { BubbleMenu, DEFAULT_ICONS, DEFAULT_LABELS, DEFAULT_LANGUAGE_ICONS, Link, RichTextEditor, type RichTextEditorFooterProps, type RichTextEditorIcons, type RichTextEditorLabels, type RichTextEditorPreset, type RichTextEditorProps, type RichTextEditorVariant, TwitterEmbed, type WordCountInfo, YouTubeEmbed, useRichTextEditorContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ interface RichTextEditorLabels {
|
|
|
80
80
|
declare const DEFAULT_LABELS: RichTextEditorLabels;
|
|
81
81
|
|
|
82
82
|
type RichTextEditorVariant = "default" | "subtle" | "compact";
|
|
83
|
+
type RichTextEditorPreset = "document" | "block" | (string & Record<never, never>);
|
|
83
84
|
interface RichTextEditorProps {
|
|
84
85
|
editor: Editor | null;
|
|
85
86
|
children: React.ReactNode;
|
|
@@ -87,6 +88,7 @@ interface RichTextEditorProps {
|
|
|
87
88
|
labels?: Partial<RichTextEditorLabels>;
|
|
88
89
|
icons?: Partial<RichTextEditorIcons>;
|
|
89
90
|
variant?: RichTextEditorVariant;
|
|
91
|
+
preset?: RichTextEditorPreset;
|
|
90
92
|
editable?: boolean;
|
|
91
93
|
}
|
|
92
94
|
interface RichTextEditorToolbarProps {
|
|
@@ -126,7 +128,7 @@ interface BubbleMenuProps {
|
|
|
126
128
|
}
|
|
127
129
|
declare const BubbleMenu: ({ editor }: BubbleMenuProps) => react.JSX.Element | null;
|
|
128
130
|
|
|
129
|
-
declare const RichTextEditor: (({ editor, children, className, labels, icons, variant, editable, }: RichTextEditorProps) => react.JSX.Element) & {
|
|
131
|
+
declare const RichTextEditor: (({ editor, children, className, labels, icons, variant, preset, editable, }: RichTextEditorProps) => react.JSX.Element) & {
|
|
130
132
|
AlignCenter: {
|
|
131
133
|
({ className }: {
|
|
132
134
|
className?: string;
|
|
@@ -308,13 +310,16 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
|
|
|
308
310
|
}) => react.JSX.Element;
|
|
309
311
|
};
|
|
310
312
|
|
|
313
|
+
type TooltipHandle = Tooltip.Handle<string>;
|
|
314
|
+
|
|
311
315
|
interface RichTextEditorContextValue {
|
|
312
316
|
editor: Editor | null;
|
|
313
317
|
labels: RichTextEditorLabels;
|
|
314
318
|
icons: RichTextEditorIcons;
|
|
315
319
|
variant: RichTextEditorVariant;
|
|
320
|
+
preset: RichTextEditorPreset;
|
|
316
321
|
editable: boolean;
|
|
317
|
-
tooltip:
|
|
322
|
+
tooltip: TooltipHandle;
|
|
318
323
|
}
|
|
319
324
|
declare const useRichTextEditorContext: () => RichTextEditorContextValue;
|
|
320
325
|
|
|
@@ -351,4 +356,4 @@ declare module "@tiptap/core" {
|
|
|
351
356
|
}
|
|
352
357
|
declare const YouTubeEmbed: Node<any, any>;
|
|
353
358
|
|
|
354
|
-
export { BubbleMenu, DEFAULT_ICONS, DEFAULT_LABELS, DEFAULT_LANGUAGE_ICONS, Link, RichTextEditor, type RichTextEditorFooterProps, type RichTextEditorIcons, type RichTextEditorLabels, type RichTextEditorProps, type RichTextEditorVariant, TwitterEmbed, type WordCountInfo, YouTubeEmbed, useRichTextEditorContext };
|
|
359
|
+
export { BubbleMenu, DEFAULT_ICONS, DEFAULT_LABELS, DEFAULT_LANGUAGE_ICONS, Link, RichTextEditor, type RichTextEditorFooterProps, type RichTextEditorIcons, type RichTextEditorLabels, type RichTextEditorPreset, type RichTextEditorProps, type RichTextEditorVariant, TwitterEmbed, type WordCountInfo, YouTubeEmbed, useRichTextEditorContext };
|