@editorcn/editor 0.4.2 → 0.5.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.
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;
@@ -189,7 +191,7 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
189
191
  displayName: string;
190
192
  };
191
193
  Content: ({ children, className, }: RichTextEditorContentProps) => react.JSX.Element;
192
- Control: ({ active, interactive: _interactive, className, children, onMouseDown, onClick, disabled, ...props }: RichTextEditorControlProps) => react.JSX.Element;
194
+ Control: react.ForwardRefExoticComponent<RichTextEditorControlProps & react.RefAttributes<HTMLButtonElement>>;
193
195
  ControlsGroup: ({ children, className, }: RichTextEditorControlsGroupProps) => react.JSX.Element;
194
196
  Footer: ({ children, className, sticky, stickyOffset, showWordCount, wordCountClassName, wordCountFormatter, }: RichTextEditorFooterProps) => react.JSX.Element | null;
195
197
  H1: {
@@ -278,8 +280,11 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
278
280
  displayName: string;
279
281
  };
280
282
  Toolbar: ({ children, className, sticky, stickyOffset, }: RichTextEditorToolbarProps) => react.JSX.Element | null;
281
- Tooltip: ({ children, label, }: {
282
- children: React.ReactElement;
283
+ Tooltip: ({ children, id, label, }: {
284
+ children: React.ReactElement<{
285
+ id?: string;
286
+ }>;
287
+ id?: string;
283
288
  label: string;
284
289
  }) => react.JSX.Element;
285
290
  TwitterEmbed: ({ className }: {
@@ -308,13 +313,16 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
308
313
  }) => react.JSX.Element;
309
314
  };
310
315
 
316
+ type TooltipHandle = Tooltip.Handle<string>;
317
+
311
318
  interface RichTextEditorContextValue {
312
319
  editor: Editor | null;
313
320
  labels: RichTextEditorLabels;
314
321
  icons: RichTextEditorIcons;
315
322
  variant: RichTextEditorVariant;
323
+ preset: RichTextEditorPreset;
316
324
  editable: boolean;
317
- tooltip: Tooltip.Handle<string>;
325
+ tooltip: TooltipHandle;
318
326
  }
319
327
  declare const useRichTextEditorContext: () => RichTextEditorContextValue;
320
328
 
@@ -351,4 +359,4 @@ declare module "@tiptap/core" {
351
359
  }
352
360
  declare const YouTubeEmbed: Node<any, any>;
353
361
 
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 };
362
+ 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;
@@ -189,7 +191,7 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
189
191
  displayName: string;
190
192
  };
191
193
  Content: ({ children, className, }: RichTextEditorContentProps) => react.JSX.Element;
192
- Control: ({ active, interactive: _interactive, className, children, onMouseDown, onClick, disabled, ...props }: RichTextEditorControlProps) => react.JSX.Element;
194
+ Control: react.ForwardRefExoticComponent<RichTextEditorControlProps & react.RefAttributes<HTMLButtonElement>>;
193
195
  ControlsGroup: ({ children, className, }: RichTextEditorControlsGroupProps) => react.JSX.Element;
194
196
  Footer: ({ children, className, sticky, stickyOffset, showWordCount, wordCountClassName, wordCountFormatter, }: RichTextEditorFooterProps) => react.JSX.Element | null;
195
197
  H1: {
@@ -278,8 +280,11 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
278
280
  displayName: string;
279
281
  };
280
282
  Toolbar: ({ children, className, sticky, stickyOffset, }: RichTextEditorToolbarProps) => react.JSX.Element | null;
281
- Tooltip: ({ children, label, }: {
282
- children: React.ReactElement;
283
+ Tooltip: ({ children, id, label, }: {
284
+ children: React.ReactElement<{
285
+ id?: string;
286
+ }>;
287
+ id?: string;
283
288
  label: string;
284
289
  }) => react.JSX.Element;
285
290
  TwitterEmbed: ({ className }: {
@@ -308,13 +313,16 @@ declare const RichTextEditor: (({ editor, children, className, labels, icons, va
308
313
  }) => react.JSX.Element;
309
314
  };
310
315
 
316
+ type TooltipHandle = Tooltip.Handle<string>;
317
+
311
318
  interface RichTextEditorContextValue {
312
319
  editor: Editor | null;
313
320
  labels: RichTextEditorLabels;
314
321
  icons: RichTextEditorIcons;
315
322
  variant: RichTextEditorVariant;
323
+ preset: RichTextEditorPreset;
316
324
  editable: boolean;
317
- tooltip: Tooltip.Handle<string>;
325
+ tooltip: TooltipHandle;
318
326
  }
319
327
  declare const useRichTextEditorContext: () => RichTextEditorContextValue;
320
328
 
@@ -351,4 +359,4 @@ declare module "@tiptap/core" {
351
359
  }
352
360
  declare const YouTubeEmbed: Node<any, any>;
353
361
 
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 };
362
+ 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 };