@team-monolith/cds 0.29.7 → 0.29.8

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
+ import { EditorCore } from "@react-editor-js/core";
2
3
  export interface ReactEditorJSProps {
3
4
  className?: string;
4
5
  /** 읽기모드 여부(preview 여부) */
@@ -9,5 +10,7 @@ export interface ReactEditorJSProps {
9
10
  onChange?: (blocks: any) => void;
10
11
  /** 에러 발생시 처리콜백 */
11
12
  onError?: (error: any) => void;
13
+ /** 초기화시 콜백 */
14
+ onInitialize?: (instance: EditorCore) => void;
12
15
  }
13
16
  export declare function ReactEditorJS(props: ReactEditorJSProps): JSX.Element;
@@ -14,13 +14,14 @@ import Layout from "./Layout";
14
14
  import TOOLS from "./tools";
15
15
  import I18n from "./i18n";
16
16
  export function ReactEditorJS(props) {
17
- const { className, readOnly = false, blocks, onChange, onError } = props;
17
+ const { className, readOnly = false, blocks, onChange, onError, onInitialize } = props;
18
18
  const ReactEditorJS = createReactEditorJS();
19
19
  const editorCore = useRef(null);
20
20
  const handleInitialize = useCallback((instance) => __awaiter(this, void 0, void 0, function* () {
21
21
  try {
22
22
  yield instance.dangerouslyLowLevelInstance.isReady;
23
23
  editorCore.current = instance;
24
+ onInitialize === null || onInitialize === void 0 ? void 0 : onInitialize(instance);
24
25
  }
25
26
  catch (e) {
26
27
  onError === null || onError === void 0 ? void 0 : onError(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "0.29.7",
3
+ "version": "0.29.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,