From 174656e59c420492e507ce94428d0a9649e97857 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sun, 30 Jun 2024 17:29:55 +0300 Subject: [PATCH] use application context --- .../src/components/tabs/CustomTagBlockComponent.js | 4 +--- wax-prosemirror-core/src/config/defaultConfig.js | 2 -- .../CorePluginsService/CorePluginsService.js | 11 ----------- .../src/ImageService/LongDescComponent.js | 4 ++-- 4 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 wax-prosemirror-core/src/config/defaultServices/CorePluginsService/CorePluginsService.js diff --git a/wax-prosemirror-core/src/components/tabs/CustomTagBlockComponent.js b/wax-prosemirror-core/src/components/tabs/CustomTagBlockComponent.js index c85c7aca0..d399863c5 100644 --- a/wax-prosemirror-core/src/components/tabs/CustomTagBlockComponent.js +++ b/wax-prosemirror-core/src/components/tabs/CustomTagBlockComponent.js @@ -75,15 +75,13 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => { const { t, i18n } = useTranslation(); const ref = useRef(); const [inputValue, setInputValue] = useState(''); - + const { app } = useContext(ApplicationContext); const { pmViews: { main }, activeView, activeViewId, } = useContext(WaxContext); - const { app } = useContext(ApplicationContext); - const { state } = main; const { $from } = state.selection; diff --git a/wax-prosemirror-core/src/config/defaultConfig.js b/wax-prosemirror-core/src/config/defaultConfig.js index 457cb38f0..8b5f98f72 100644 --- a/wax-prosemirror-core/src/config/defaultConfig.js +++ b/wax-prosemirror-core/src/config/defaultConfig.js @@ -5,7 +5,6 @@ import LayoutService from './defaultServices/LayoutService/LayoutService'; import PortalService from './defaultServices/PortalService/PortalService'; import MenuService from './defaultServices/MenuService/MenuService'; import OverlayService from './defaultServices/OverlayService/OverlayService'; -import CorePluginsService from './defaultServices/CorePluginsService/CorePluginsService'; export default () => ({ services: [ @@ -16,6 +15,5 @@ export default () => ({ new PortalService(), new MenuService(), new OverlayService(), - new CorePluginsService(), ], }); diff --git a/wax-prosemirror-core/src/config/defaultServices/CorePluginsService/CorePluginsService.js b/wax-prosemirror-core/src/config/defaultServices/CorePluginsService/CorePluginsService.js deleted file mode 100644 index 70935410d..000000000 --- a/wax-prosemirror-core/src/config/defaultServices/CorePluginsService/CorePluginsService.js +++ /dev/null @@ -1,11 +0,0 @@ -import Service from '../../../Service'; -import FakeCursorPlugin from '../../plugins/FakeCursorPlugin'; - -export default class CorePluginsService extends Service { - boot() { - // this.app.PmPlugins.add( - // 'fakeCursorPlugin', - // FakeCursorPlugin('fakeCursorPlugin'), - // ); - } -} diff --git a/wax-prosemirror-services/src/ImageService/LongDescComponent.js b/wax-prosemirror-services/src/ImageService/LongDescComponent.js index ca3a9b1c6..02153b1fa 100644 --- a/wax-prosemirror-services/src/ImageService/LongDescComponent.js +++ b/wax-prosemirror-services/src/ImageService/LongDescComponent.js @@ -1,7 +1,7 @@ /* eslint-disable react/prop-types */ import React, { useContext, useLayoutEffect, useRef, useState } from 'react'; import styled from 'styled-components'; -import { WaxContext } from 'wax-prosemirror-core'; +import { ApplicationContext, WaxContext } from 'wax-prosemirror-core'; const StyledInputLongDesc = styled.textarea` background: #e2ebff; @@ -26,8 +26,8 @@ export default ({ setPosition, position }) => { const longDescRef = useRef(null); const [longDescText, setLongDescText] = useState(''); const context = useContext(WaxContext); + const { app } = useContext(ApplicationContext); const { - app, activeView, pmViews: { main }, } = context; -- GitLab