@jiaozhiye/qm-design-react 1.3.0-beta.21 → 1.3.0-beta.22

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.
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- export declare type EventHandler<T> = (a: unknown, editor: any) => unknown;
8
+ export declare type EventHandler<A> = (a: unknown, editor: any) => unknown;
9
9
  declare type EEventHandler<K> = EventHandler<K>;
10
10
  export interface INativeEvents {
11
11
  onBeforePaste: EEventHandler<'beforepaste'>;
@@ -47,6 +47,7 @@ export interface ITinyEvents {
47
47
  onBeforeSetContent: EEventHandler<'BeforeSetContent'>;
48
48
  onChange: EventHandler<unknown>;
49
49
  onClearUndos: EEventHandler<'ClearUndos'>;
50
+ onCommentChange: EventHandler<unknown>;
50
51
  onDeactivate: EEventHandler<'deactivate'>;
51
52
  onDirty: EventHandler<unknown>;
52
53
  onExecCommand: EEventHandler<'ExecCommand'>;
@@ -72,6 +73,12 @@ export interface ITinyEvents {
72
73
  onSubmit: EventHandler<unknown>;
73
74
  onUndo: EEventHandler<'Undo'>;
74
75
  onVisualAid: EventHandler<unknown>;
76
+ onSkinLoadError: EEventHandler<'SkinLoadError'>;
77
+ onThemeLoadError: EEventHandler<'ThemeLoadError'>;
78
+ onModelLoadError: EEventHandler<'ModelLoadError'>;
79
+ onPluginLoadError: EEventHandler<'PluginLoadError'>;
80
+ onIconsLoadError: EEventHandler<'IconsLoadError'>;
81
+ onLanguageLoadError: EEventHandler<'LanguageLoadError'>;
75
82
  }
76
83
  export interface IEvents extends INativeEvents, ITinyEvents {
77
84
  }
@@ -1,2 +1,9 @@
1
- declare const getTinymce: () => any | null;
1
+ /**
2
+ * Copyright (c) 2017-present, Ephox, Inc.
3
+ *
4
+ * This source code is licensed under the Apache 2 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ declare const getTinymce: (view: Window) => any | null;
2
9
  export { getTinymce };
@@ -16,4 +16,5 @@ export declare const isTextareaOrInput: (element: Element | null) => element is
16
16
  export declare const mergePlugins: (initPlugins: string | string[] | undefined, inputPlugins: string | string[] | undefined) => string[];
17
17
  export declare const isBeforeInputEventAvailable: () => boolean;
18
18
  export declare const isInDoc: (elem: Node) => boolean;
19
+ export declare const setMode: (editor: any | undefined, mode: 'readonly' | 'design') => void;
19
20
  export {};
@@ -8,6 +8,7 @@
8
8
  import * as React from 'react';
9
9
  import { IEvents } from '../Events';
10
10
  import { IEditorPropTypes } from './EditorPropTypes';
11
+ declare type EditorOptions = Record<string, any>;
11
12
  export interface IProps {
12
13
  apiKey: string;
13
14
  id: string;
@@ -15,16 +16,18 @@ export interface IProps {
15
16
  initialValue: string;
16
17
  onEditorChange: (a: string, editor: any) => void;
17
18
  value: string;
18
- init: any;
19
- /** @deprecated use `editor.getContent({format: 'text' })` in `onEditorChange` prop instead */
20
- outputFormat: 'html' | 'text';
19
+ init: EditorOptions & {
20
+ selector?: undefined;
21
+ target?: undefined;
22
+ };
21
23
  tagName: string;
22
24
  cloudChannel: string;
23
- plugins: string[] | string;
24
- toolbar: string[] | string;
25
+ plugins: NonNullable<EditorOptions['plugins']>;
26
+ toolbar: NonNullable<EditorOptions['toolbar']>;
25
27
  disabled: boolean;
26
28
  textareaName: string;
27
29
  tinymceScriptSrc: string;
30
+ rollback: number | false;
28
31
  scriptLoading: {
29
32
  async?: boolean;
30
33
  defer?: boolean;
@@ -45,6 +48,7 @@ export declare class Editor extends React.Component<IAllProps> {
45
48
  private rollbackTimer;
46
49
  private valueCursor;
47
50
  constructor(props: Partial<IAllProps>);
51
+ private get view();
48
52
  componentDidUpdate(prevProps: Partial<IAllProps>): void;
49
53
  componentDidMount(): void;
50
54
  componentWillUnmount(): void;
@@ -52,6 +56,8 @@ export declare class Editor extends React.Component<IAllProps> {
52
56
  ref: React.RefObject<HTMLElement>;
53
57
  id: string;
54
58
  }, string | React.JSXElementConstructor<any>>;
59
+ private changeEvents;
60
+ private beforeInputEvent;
55
61
  private renderInline;
56
62
  private renderIframe;
57
63
  private getScriptSrc;
@@ -64,3 +70,4 @@ export declare class Editor extends React.Component<IAllProps> {
64
70
  private handleEditorChangeSpecial;
65
71
  private initialise;
66
72
  }
73
+ export {};
@@ -22,6 +22,7 @@ declare class QmTinymce extends Component<IProps> {
22
22
  static defaultProps: {
23
23
  height: number;
24
24
  plugins: string;
25
+ menubar: string;
25
26
  toolbar: string;
26
27
  };
27
28
  render(): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiaozhiye/qm-design-react",
3
- "version": "1.3.0-beta.21",
3
+ "version": "1.3.0-beta.22",
4
4
  "description": "A Component Library for React",
5
5
  "keywords": [
6
6
  "React",