@yoopta/editor 1.9.15-rc → 1.9.16-rc

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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { YooptaEditorProps } from './components/YooptaEditor/YooptaEditor';
3
- declare const YooptaEditor: (props: YooptaEditorProps) => JSX.Element;
3
+ import { YooptaBaseElement } from './types';
4
+ declare const YooptaEditor: <V extends YooptaBaseElement<string>>(props: YooptaEditorProps<V>) => JSX.Element;
4
5
  export { YooptaEditor };
@@ -2,7 +2,6 @@
2
2
  import { ParentYooptaPlugin, YooptaPluginType } from '../../utils/plugins';
3
3
  import { YooptaMark } from '../../utils/marks';
4
4
  import { YooEditor, YooptaBaseElement } from '../../types';
5
- import { YooptaTools } from '../YooptaEditor/YooptaEditor';
6
5
  type YooptaProps = {
7
6
  editor: YooEditor;
8
7
  placeholder?: string;
@@ -11,7 +10,6 @@ type YooptaProps = {
11
10
  marks?: YooptaMark[];
12
11
  PLUGINS_MAP: Record<YooptaBaseElement<string>['type'], YooptaPluginType<any, YooptaBaseElement<string>>>;
13
12
  className?: string;
14
- tools?: YooptaTools;
15
13
  };
16
- declare const EditorYoopta: ({ editor, placeholder, marks, readOnly, plugins, className, PLUGINS_MAP, tools, }: YooptaProps) => JSX.Element;
14
+ declare const EditorYoopta: ({ editor, placeholder, marks, readOnly, plugins, className, PLUGINS_MAP, }: YooptaProps) => JSX.Element;
17
15
  export { EditorYoopta };
@@ -1,5 +1,5 @@
1
1
  import { Key, ReactNode } from 'react';
2
- import { Descendant } from 'slate';
2
+ import { YooptaBaseElement, YooptaEditorValue } from '../../types';
3
3
  import { YooptaMark } from '../../utils/marks';
4
4
  import { YooptaPlugin } from '../../utils/plugins';
5
5
  import { OFFLINE_STORAGE } from '../../utils/storage';
@@ -20,9 +20,9 @@ export type YooptaTools = {
20
20
  ChatGPT?: ReactNode;
21
21
  [x: string]: ReactNode;
22
22
  };
23
- export type YooptaEditorProps = {
24
- onChange: (_value: Descendant[]) => void;
25
- value: Descendant[];
23
+ export type YooptaEditorProps<V> = {
24
+ onChange: (_value: YooptaEditorValue<V>) => void;
25
+ value: YooptaEditorValue<V>;
26
26
  key?: Key;
27
27
  placeholder?: string;
28
28
  plugins: YooptaPlugin<any, any>[];
@@ -34,5 +34,5 @@ export type YooptaEditorProps = {
34
34
  className?: string;
35
35
  tools?: YooptaTools;
36
36
  };
37
- declare const YooptaEditor: ({ key, value, plugins, marks, readOnly, onChange, placeholder, autoFocus, offline, className, tools, }: YooptaEditorProps) => JSX.Element;
37
+ declare const YooptaEditor: <V extends YooptaBaseElement<string>>({ key, value, plugins, marks, readOnly, onChange, placeholder, autoFocus, offline, className, tools, }: YooptaEditorProps<V>) => JSX.Element;
38
38
  export { YooptaEditor };
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export { isElementActive, getElementByPath } from './utils/nodes';
17
17
  export { getElementClassname } from './utils/getElementClassname';
18
18
  export type { YooptaPluginType, YooptaPluginEventHandlers, HandlersOptions, YooptaPluginBaseOptions, YooptaRenderHTMLAttributes, } from './utils/plugins';
19
19
  export type { YooptaMarksConfig, YooptaMark } from './utils/marks';
20
- export type { YooEditor, RenderYooptaElementProps, YooptaBaseElement, Modify } from './types';
20
+ export type { YooEditor, RenderYooptaElementProps, YooptaBaseElement, Modify, YooptaEditorValue, YooptaBaseToolProps } from './types';
21
21
  declare const UI_HELPERS: {
22
22
  ElementOptions: ({ onClose, style, element, render, ...props }: {
23
23
  style: import("react").CSSProperties | undefined;