Skip to content
Snippets Groups Projects
Commit f318ec85 authored by Christos's avatar Christos
Browse files

Merge branch 'inline-node-view' into 'master'

Inline node view

See merge request !328
parents ea89f982 1eb026bf
No related branches found
No related tags found
1 merge request!328Inline node view
Showing
with 41 additions and 11 deletions
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
"@pubsweet/ui-toolkit": "^2.3.1", "@pubsweet/ui-toolkit": "^2.3.1",
"antd": "^4.15.4", "antd": "^4.15.4",
"fontsource-merriweather": "^3.0.9", "fontsource-merriweather": "^3.0.9",
"prosemirror-schema-basic": "^1.1.2",
"prosemirror-tables": "^1.1.1", "prosemirror-tables": "^1.1.1",
"react": "^16.13.1", "react": "^16.13.1",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",
......
...@@ -70,7 +70,7 @@ const Editors = () => { ...@@ -70,7 +70,7 @@ const Editors = () => {
case 'ncbi': case 'ncbi':
return <NCBI />; return <NCBI />;
default: default:
return <Editoria />; return <HHMI />;
} }
}; };
......
const fillTheGapContainerNode = {
attrs: {
id: { default: '' },
class: { default: 'fill-the-gap' },
},
group: 'block',
selectable: true,
draggable: true,
content: 'block+',
parseDOM: [
{
tag: 'div.fill-the-gap',
getAttrs(dom) {
return {
id: dom.dataset.id,
class: dom.getAttribute('class'),
};
},
},
],
toDOM(node) {
return ['div', node.attrs, 0];
},
};
export default fillTheGapContainerNode;
const fillTheGapNode = {};
export default fillTheGapNode;
...@@ -24,7 +24,7 @@ const Hhmi = () => { ...@@ -24,7 +24,7 @@ const Hhmi = () => {
config={config} config={config}
autoFocus autoFocus
fileUpload={file => renderImage(file)} fileUpload={file => renderImage(file)}
value={t} value=""
// readonly // readonly
layout={HhmiLayout} layout={HhmiLayout}
// onChange={source => console.log(source)} // onChange={source => console.log(source)}
......
...@@ -20,6 +20,8 @@ import { ...@@ -20,6 +20,8 @@ import {
SpecialCharactersToolGroupService, SpecialCharactersToolGroupService,
EditorInfoToolGroupServices, EditorInfoToolGroupServices,
BottomInfoService, BottomInfoService,
MultipleChoiceQuestionService,
QuestionsToolGroupService,
} from 'wax-prosemirror-services'; } from 'wax-prosemirror-services';
import { DefaultSchema } from 'wax-prosemirror-utilities'; import { DefaultSchema } from 'wax-prosemirror-utilities';
...@@ -27,8 +29,8 @@ import { WaxSelectionPlugin } from 'wax-prosemirror-plugins'; ...@@ -27,8 +29,8 @@ import { WaxSelectionPlugin } from 'wax-prosemirror-plugins';
import invisibles, { hardBreak } from '@guardian/prosemirror-invisibles'; import invisibles, { hardBreak } from '@guardian/prosemirror-invisibles';
/* Questions Services */ /* Questions Services */
import MultipleChoiceQuestionService from '../MultipleChoiceQuestionService/MultipleChoiceQuestionService'; // import MultipleChoiceQuestionService from '../MultipleChoiceQuestionService/MultipleChoiceQuestionService';
import QuestionsToolGroupService from '../QuestionsToolGroupService/QuestionsToolGroupService'; // import QuestionsToolGroupService from '../QuestionsToolGroupService/QuestionsToolGroupService';
export default { export default {
MenuService: [ MenuService: [
......
...@@ -44,7 +44,6 @@ export default props => { ...@@ -44,7 +44,6 @@ export default props => {
if (!mounted) { if (!mounted) {
context.app.bootServices(); context.app.bootServices();
console.log(context);
} }
const setEditorRef = useCallback( const setEditorRef = useCallback(
......
...@@ -44,6 +44,7 @@ export { default as TrackOptionsService } from './src/TrackOptionsService/TrackO ...@@ -44,6 +44,7 @@ export { default as TrackOptionsService } from './src/TrackOptionsService/TrackO
export { default as CustomTagInlineService } from './src/CustomTagService/CustomTagInlineService/CustomTagInlineService'; export { default as CustomTagInlineService } from './src/CustomTagService/CustomTagInlineService/CustomTagInlineService';
export { default as CustomTagBlockService } from './src/CustomTagService/CustomTagBlockService/CustomTagBlockService'; export { default as CustomTagBlockService } from './src/CustomTagService/CustomTagBlockService/CustomTagBlockService';
export { default as CustomTagService } from './src/CustomTagService/CustomTagService'; export { default as CustomTagService } from './src/CustomTagService/CustomTagService';
export { default as MultipleChoiceQuestionService } from './src/MultipleChoiceQuestionService/MultipleChoiceQuestionService';
/* /*
ToolGroups ToolGroups
...@@ -69,3 +70,4 @@ export { default as TrackOptionsToolGroupService } from './src/WaxToolGroups/Tra ...@@ -69,3 +70,4 @@ export { default as TrackOptionsToolGroupService } from './src/WaxToolGroups/Tra
export { default as TrackCommentOptionsToolGroupService } from './src/WaxToolGroups/TrackCommentOptionsToolGroupService/TrackCommentOptionsToolGroupService'; export { default as TrackCommentOptionsToolGroupService } from './src/WaxToolGroups/TrackCommentOptionsToolGroupService/TrackCommentOptionsToolGroupService';
export { default as CustomTagInlineToolGroupService } from './src/WaxToolGroups/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService'; export { default as CustomTagInlineToolGroupService } from './src/WaxToolGroups/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService';
export { default as CustomTagBlockToolGroupService } from './src/WaxToolGroups/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService'; export { default as CustomTagBlockToolGroupService } from './src/WaxToolGroups/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService';
export { default as QuestionsToolGroupService } from './src/WaxToolGroups/QuestionsToolGroupService/QuestionsToolGroupService';
import { nodes } from 'prosemirror-schema-basic'; import AbstractNodeView from '../PortalService/AbstractNodeView';
import { AbstractNodeView } from 'wax-prosemirror-services';
export default class MultipleChoiceNodeView extends AbstractNodeView { export default class MultipleChoiceNodeView extends AbstractNodeView {
constructor( constructor(
...@@ -18,6 +17,7 @@ export default class MultipleChoiceNodeView extends AbstractNodeView { ...@@ -18,6 +17,7 @@ export default class MultipleChoiceNodeView extends AbstractNodeView {
this.getPos = getPos; this.getPos = getPos;
this.context = context; this.context = context;
} }
static name() { static name() {
return 'multiple_choice'; return 'multiple_choice';
} }
......
import React from 'react'; import React from 'react';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { injectable } from 'inversify'; import { injectable } from 'inversify';
import { Tools } from 'wax-prosemirror-services';
import { Commands } from 'wax-prosemirror-utilities'; import { Commands } from 'wax-prosemirror-utilities';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import Tools from '../lib/Tools';
import ToolBarBtn from './components/ToolBarBtn'; import ToolBarBtn from './components/ToolBarBtn';
const checkifEmpty = view => { const checkifEmpty = view => {
......
import { Service } from 'wax-prosemirror-services'; import Service from '../Service';
import MultipleChoiceQuestion from './MultipleChoiceQuestion'; import MultipleChoiceQuestion from './MultipleChoiceQuestion';
import multipleChoiceNode from './schema/multipleChoiceNode'; import multipleChoiceNode from './schema/multipleChoiceNode';
import multipleChoiceContainerNode from './schema/multipleChoiceContainerNode'; import multipleChoiceContainerNode from './schema/multipleChoiceContainerNode';
......
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