diff --git a/.pnp.cjs b/.pnp.cjs index 7853c19..5290e58 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -1428,15 +1428,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/editorjs__editorjs", null], ["@types/editorjs__paragraph", null], ["@types/react", "npm:17.0.33"], - ["@types/react-editor-js__core", null], ["react", "npm:17.0.2"], ["tslib", "npm:2.3.1"], ["typescript", "patch:typescript@npm%3A4.3.5#~builtin::version=4.3.5&hash=ddd1e8"] ], "packagePeers": [ "@types/editorjs__editorjs", - "@types/editorjs__paragraph", - "@types/react-editor-js__core" + "@types/editorjs__paragraph" ], "linkType": "SOFT", }], @@ -7137,6 +7135,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageDependencies": [ ["react-editor-js", "workspace:packages/react-editor-js"], ["@react-editor-js/client", "virtual:4a6625c4b2e390f05712a53905d07a9bb31b321796835eac85dafc36cc372e8609559744fc2166d75ef6a59670220f76b4fc0dcb1521667fcb6f6758e80f8494#workspace:packages/@react-editor-js/client"], + ["@react-editor-js/core", "virtual:eeb0d27880fc71d7dbdd75f46f96f2cd8c3469844f42ed8de1a5901da8507ca8a61db6d3a214e4f8ab09bd225e7e7aafc68ad2322d87d5811b50bdc2842d9768#workspace:packages/@react-editor-js/core"], ["@react-editor-js/server", "virtual:4a6625c4b2e390f05712a53905d07a9bb31b321796835eac85dafc36cc372e8609559744fc2166d75ef6a59670220f76b4fc0dcb1521667fcb6f6758e80f8494#workspace:packages/@react-editor-js/server"], ["@types/node", "npm:16.11.6"], ["tslib", "npm:2.3.1"], diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 38a6ce6..21daee2 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/packages/@react-editor-js/client/src/ReactEditorJSClient.tsx b/packages/@react-editor-js/client/src/ReactEditorJSClient.tsx index 70da3c3..dbfe0a4 100644 --- a/packages/@react-editor-js/client/src/ReactEditorJSClient.tsx +++ b/packages/@react-editor-js/client/src/ReactEditorJSClient.tsx @@ -1,14 +1,9 @@ import React from 'react' -import { - Props as ReactEditorJSProps, - ReactEditorJS, -} from '@react-editor-js/core' +import { WrapperProps as Props, ReactEditorJS } from '@react-editor-js/core' import { ClientEditorCore } from './client-editor-core' import { EditorConfig } from '@editorjs/editorjs' -export type Props = Omit - function ReactEditorJSClient(props: Props) { const factory = React.useCallback( (config: EditorConfig) => new ClientEditorCore(config), diff --git a/packages/@react-editor-js/core/src/component-types.ts b/packages/@react-editor-js/core/src/component-types.ts index 495352d..a326c8c 100644 --- a/packages/@react-editor-js/core/src/component-types.ts +++ b/packages/@react-editor-js/core/src/component-types.ts @@ -14,3 +14,5 @@ export interface Props extends Omit { onInitialize?: (core: EditorCore) => void } + +export type WrapperProps = Omit diff --git a/packages/@react-editor-js/server/package.json b/packages/@react-editor-js/server/package.json index 94ed8db..399c69d 100644 --- a/packages/@react-editor-js/server/package.json +++ b/packages/@react-editor-js/server/package.json @@ -15,7 +15,6 @@ "peerDependencies": { "@editorjs/editorjs": "*", "@editorjs/paragraph": "*", - "@react-editor-js/core": "2.0.6", "react": "*" }, "dependencies": { diff --git a/packages/@react-editor-js/server/src/ReactEditorJSServer.tsx b/packages/@react-editor-js/server/src/ReactEditorJSServer.tsx index 3078f51..b52b645 100644 --- a/packages/@react-editor-js/server/src/ReactEditorJSServer.tsx +++ b/packages/@react-editor-js/server/src/ReactEditorJSServer.tsx @@ -1,14 +1,9 @@ import React from 'react' -import { - Props as ReactEditorJSProps, - ReactEditorJS, -} from '@react-editor-js/core' +import { WrapperProps as Props, ReactEditorJS } from '@react-editor-js/core' import { EditorConfig } from '@editorjs/editorjs' import { ServerEditorCore } from './server-editor-core' -export type Props = Omit - function ReactEditorJSServer(props: Props) { const factory = React.useCallback( (config: EditorConfig) => new ServerEditorCore(config), diff --git a/packages/react-editor-js/package.json b/packages/react-editor-js/package.json index 955ec65..00173f5 100644 --- a/packages/react-editor-js/package.json +++ b/packages/react-editor-js/package.json @@ -4,7 +4,7 @@ "description": "The unofficial editor-js component for React", "main": "./dist/react-editor-js.cjs.js", "module": "./dist/react-editor-js.js", - "types": "./dist/index.d.ts", + "types": "./dist/react-editor-js/src/index.d.ts", "repository": { "type": "git", "url": "https://github.com/Jungwoo-An/react-editor-js.git" @@ -12,12 +12,9 @@ "bugs": { "url": "https://github.com/Jungwoo-An/react-editor-js/issues" }, - "peerDependencies": { - "@react-editor-js/client": "2.0.6", - "@react-editor-js/server": "2.0.6" - }, "dependencies": { "@react-editor-js/client": "2.0.6", + "@react-editor-js/core": "2.0.6", "@react-editor-js/server": "2.0.6" }, "devDependencies": { diff --git a/packages/react-editor-js/src/factory.ts b/packages/react-editor-js/src/factory.ts index b764239..c288de7 100644 --- a/packages/react-editor-js/src/factory.ts +++ b/packages/react-editor-js/src/factory.ts @@ -1,4 +1,6 @@ -export function createReactEditorJS() { +import { WrapperProps } from '@react-editor-js/core' + +export function createReactEditorJS(): (props: WrapperProps) => JSX.Element { if (typeof window !== 'undefined') { const Component = require('@react-editor-js/client') return Component.default || Component diff --git a/yarn.lock b/yarn.lock index 2923143..21b326e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -821,13 +821,13 @@ __metadata: languageName: node linkType: hard -"@react-editor-js/client@2.0.5, @react-editor-js/client@workspace:packages/@react-editor-js/client": +"@react-editor-js/client@2.0.6, @react-editor-js/client@workspace:packages/@react-editor-js/client": version: 0.0.0-use.local resolution: "@react-editor-js/client@workspace:packages/@react-editor-js/client" dependencies: "@editorjs/editorjs": "*" "@editorjs/paragraph": "*" - "@react-editor-js/core": 2.0.5 + "@react-editor-js/core": 2.0.6 "@types/react": "*" react: "*" tslib: ^2.3.1 @@ -839,7 +839,7 @@ __metadata: languageName: unknown linkType: soft -"@react-editor-js/core@2.0.5, @react-editor-js/core@workspace:packages/@react-editor-js/core": +"@react-editor-js/core@2.0.6, @react-editor-js/core@workspace:packages/@react-editor-js/core": version: 0.0.0-use.local resolution: "@react-editor-js/core@workspace:packages/@react-editor-js/core" dependencies: @@ -857,13 +857,13 @@ __metadata: languageName: unknown linkType: soft -"@react-editor-js/server@2.0.5, @react-editor-js/server@workspace:packages/@react-editor-js/server": +"@react-editor-js/server@2.0.6, @react-editor-js/server@workspace:packages/@react-editor-js/server": version: 0.0.0-use.local resolution: "@react-editor-js/server@workspace:packages/@react-editor-js/server" dependencies: "@editorjs/editorjs": "*" "@editorjs/paragraph": "*" - "@react-editor-js/core": 2.0.5 + "@react-editor-js/core": 2.0.6 "@types/react": "*" react: "*" tslib: ^2.3.1 @@ -871,7 +871,6 @@ __metadata: peerDependencies: "@editorjs/editorjs": "*" "@editorjs/paragraph": "*" - "@react-editor-js/core": 2.0.5 react: "*" languageName: unknown linkType: soft @@ -5803,14 +5802,12 @@ __metadata: version: 0.0.0-use.local resolution: "react-editor-js@workspace:packages/react-editor-js" dependencies: - "@react-editor-js/client": 2.0.5 - "@react-editor-js/server": 2.0.5 + "@react-editor-js/client": 2.0.6 + "@react-editor-js/core": 2.0.6 + "@react-editor-js/server": 2.0.6 "@types/node": ^16.11.6 tslib: ^2.3.1 typescript: ^4.3.5 - peerDependencies: - "@react-editor-js/client": 2.0.5 - "@react-editor-js/server": 2.0.5 languageName: unknown linkType: soft