Skip to content
Snippets Groups Projects
Commit 0f0c9ff7 authored by chris's avatar chris
Browse files

editing/suggesting

parent 6a52853d
No related branches found
No related tags found
1 merge request!429Move components
...@@ -12,7 +12,6 @@ export { default as BlockLevelTools } from './src/ui/tabs/BlockLevelTools'; ...@@ -12,7 +12,6 @@ export { default as BlockLevelTools } from './src/ui/tabs/BlockLevelTools';
export { default as EditorInfoTool } from './src/components/EditorInfo/CounterInfo/EditorInfoTool'; export { default as EditorInfoTool } from './src/components/EditorInfo/CounterInfo/EditorInfoTool';
export { default as EditorShortCutsTool } from './src/components/EditorInfo/EditorShortCutsTool'; export { default as EditorShortCutsTool } from './src/components/EditorInfo/EditorShortCutsTool';
export { default as EditingSuggestingDropDown } from './src/components/editingSuggesting/EditingSuggestingDropDown';
export { default as CustomTagInlineComponent } from './src/components/customtag/CustomTagInlineComponent'; export { default as CustomTagInlineComponent } from './src/components/customtag/CustomTagInlineComponent';
export { default as CustomTagInlineOverlayComponent } from './src/components/customtag/CustomTagInlineOverlayCompoment'; export { default as CustomTagInlineOverlayComponent } from './src/components/customtag/CustomTagInlineOverlayCompoment';
export { default as CustomTagBlockComponent } from './src/components/customtag/CustomTagBlockComponent'; export { default as CustomTagBlockComponent } from './src/components/customtag/CustomTagBlockComponent';
/* eslint-disable no-unused-vars */
import React from 'react'; import React from 'react';
import { injectable } from 'inversify'; import { injectable } from 'inversify';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { EditingSuggestingDropDown } from 'wax-prosemirror-components';
import { Tools } from 'wax-prosemirror-core'; import { Tools } from 'wax-prosemirror-core';
import EditingSuggestingDropDown from './components/EditingSuggestingDropDown';
@injectable() @injectable()
export default class EditingSuggesting extends Tools { export default class EditingSuggesting extends Tools {
...@@ -25,12 +26,13 @@ export default class EditingSuggesting extends Tools { ...@@ -25,12 +26,13 @@ export default class EditingSuggesting extends Tools {
renderTool(view) { renderTool(view) {
if (isEmpty(view)) return null; if (isEmpty(view)) return null;
// eslint-disable-next-line no-underscore-dangle
return this._isDisplayed ? ( return this._isDisplayed ? (
<EditingSuggestingDropDown <EditingSuggestingDropDown
enabled={this.config.enabled}
item={this.toJSON()}
key={uuidv4()} key={uuidv4()}
view={view} view={view}
item={this.toJSON()}
enabled={this.config.enabled}
/> />
) : null; ) : null;
} }
......
...@@ -3,7 +3,7 @@ import React, { useMemo, useContext } from 'react'; ...@@ -3,7 +3,7 @@ import React, { useMemo, useContext } from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { WaxContext, ReactDropDownStyles } from 'wax-prosemirror-core'; import { WaxContext, ReactDropDownStyles } from 'wax-prosemirror-core';
import Dropdown from 'react-dropdown'; import Dropdown from 'react-dropdown';
import Icon from '../../helpers/Icon'; import { Icon } from 'wax-prosemirror-components';
const Wrapper = styled.span` const Wrapper = styled.span`
${ReactDropDownStyles}; ${ReactDropDownStyles};
...@@ -78,6 +78,7 @@ const dropDownOptions = [ ...@@ -78,6 +78,7 @@ const dropDownOptions = [
{ label: <Suggesting />, value: 'suggesting' }, { label: <Suggesting />, value: 'suggesting' },
]; ];
// eslint-disable-next-line no-unused-vars
const EditingSuggesting = ({ view: { dispatch, state }, item }) => { const EditingSuggesting = ({ view: { dispatch, state }, item }) => {
const { app, activeView, pmViews } = useContext(WaxContext); const { app, activeView, pmViews } = useContext(WaxContext);
const enableService = app.config.get('config.EnableTrackChangeService') const enableService = app.config.get('config.EnableTrackChangeService')
...@@ -110,6 +111,7 @@ const EditingSuggesting = ({ view: { dispatch, state }, item }) => { ...@@ -110,6 +111,7 @@ const EditingSuggesting = ({ view: { dispatch, state }, item }) => {
() => ( () => (
<Wrapper> <Wrapper>
<DropdownStyled <DropdownStyled
// eslint-disable-next-line no-unused-vars
onChange={option => { onChange={option => {
return enableDisableTrackChanges(); return enableDisableTrackChanges();
}} }}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment