From 0e61fc040add32305e6e8e1e4c53376e2364d80f Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Tue, 21 Nov 2023 18:31:33 +0200 Subject: [PATCH] custom tags --- editors/demo/src/Editoria/config/config.js | 4 ---- editors/demo/src/Editoria/config/configMobile.js | 4 ---- editors/demo/src/OEN/config/config.js | 4 ---- wax-prosemirror-services/index.js | 2 -- .../EditorInfoToolGroupService.js | 10 ++++++++++ .../InfoToolGroupService/InfoTool.js | 16 ++++++++++++++++ .../CustomTagBlockToolGroup.js | 0 .../CustomTagBlockToolGroupService.js | 0 .../CustomTagInlineToolGroup.js | 0 .../CustomTagInlineToolGroupService.js | 0 .../src/CustomTagService/index.js | 9 ++++++++- 11 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/EditorInfoToolGroupService.js create mode 100644 wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/InfoTool.js rename wax-prosemirror-services/src/{WaxToolGroups => CustomTagService}/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroup.js (100%) rename wax-prosemirror-services/src/{WaxToolGroups => CustomTagService}/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService.js (100%) rename wax-prosemirror-services/src/{WaxToolGroups => CustomTagService}/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroup.js (100%) rename wax-prosemirror-services/src/{WaxToolGroups => CustomTagService}/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService.js (100%) diff --git a/editors/demo/src/Editoria/config/config.js b/editors/demo/src/Editoria/config/config.js index a25c7aef4..49ed46a92 100644 --- a/editors/demo/src/Editoria/config/config.js +++ b/editors/demo/src/Editoria/config/config.js @@ -26,8 +26,6 @@ import { TransformService, TrackOptionsToolGroupService, TrackCommentOptionsToolGroupService, - CustomTagInlineToolGroupService, - CustomTagBlockToolGroupService, CustomTagService, disallowPasteImagesPlugin, // YjsService, @@ -217,7 +215,5 @@ export default { new TransformService(), new TrackOptionsToolGroupService(), new TrackCommentOptionsToolGroupService(), - new CustomTagInlineToolGroupService(), - new CustomTagBlockToolGroupService(), ], }; diff --git a/editors/demo/src/Editoria/config/configMobile.js b/editors/demo/src/Editoria/config/configMobile.js index c4af44412..57bf2c400 100644 --- a/editors/demo/src/Editoria/config/configMobile.js +++ b/editors/demo/src/Editoria/config/configMobile.js @@ -18,8 +18,6 @@ import { EditorInfoToolGroupServices, BottomInfoService, TransformService, - CustomTagInlineToolGroupService, - CustomTagBlockToolGroupService, CustomTagService, } from 'wax-prosemirror-services'; @@ -101,7 +99,5 @@ export default { new BottomInfoService(), new TransformService(), new CustomTagService(), - new CustomTagInlineToolGroupService(), - new CustomTagBlockToolGroupService(), ], }; diff --git a/editors/demo/src/OEN/config/config.js b/editors/demo/src/OEN/config/config.js index 7d0aa4611..e751bfb3f 100644 --- a/editors/demo/src/OEN/config/config.js +++ b/editors/demo/src/OEN/config/config.js @@ -26,8 +26,6 @@ import { TransformService, TrackOptionsToolGroupService, TrackCommentOptionsToolGroupService, - CustomTagInlineToolGroupService, - CustomTagBlockToolGroupService, CustomTagService, OENContainersService, } from 'wax-prosemirror-services'; @@ -215,7 +213,5 @@ export default { new TransformService(), new TrackOptionsToolGroupService(), new TrackCommentOptionsToolGroupService(), - new CustomTagInlineToolGroupService(), - new CustomTagBlockToolGroupService(), ], }; diff --git a/wax-prosemirror-services/index.js b/wax-prosemirror-services/index.js index de8b69377..be0dd3bb9 100644 --- a/wax-prosemirror-services/index.js +++ b/wax-prosemirror-services/index.js @@ -41,8 +41,6 @@ export { default as TrackingAndEditingToolGroupService } from './src/WaxToolGrou export { default as EditorInfoToolGroupServices } from './src/WaxToolGroups/BottomToolGroupService/InfoToolGroupService/EditorInfoToolGroupService'; export { default as TrackOptionsToolGroupService } from './src/WaxToolGroups/TrackOptionsToolGroupService/TrackOptionsToolGroupService'; export { default as TrackCommentOptionsToolGroupService } from './src/WaxToolGroups/TrackCommentOptionsToolGroupService/TrackCommentOptionsToolGroupService'; -export { default as CustomTagInlineToolGroupService } from './src/WaxToolGroups/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService'; -export { default as CustomTagBlockToolGroupService } from './src/WaxToolGroups/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService'; /* Plugins */ export { default as disallowPasteImagesPlugin } from './src/ImageService/plugins/disallowPasteImagesPlugin'; diff --git a/wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/EditorInfoToolGroupService.js b/wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/EditorInfoToolGroupService.js new file mode 100644 index 000000000..d67eaf835 --- /dev/null +++ b/wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/EditorInfoToolGroupService.js @@ -0,0 +1,10 @@ +import { Service } from 'wax-prosemirror-core'; +import InfoToolGroup from './InfoTool'; + +class EditorInfoToolGroupService extends Service { + name = 'EditorInfoToolGroupService'; + register() { + this.container.bind('InfoToolGroup').to(InfoToolGroup); + } +} +export default EditorInfoToolGroupService; diff --git a/wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/InfoTool.js b/wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/InfoTool.js new file mode 100644 index 000000000..8d8ce2d97 --- /dev/null +++ b/wax-prosemirror-services/src/BottomInfoService/InfoToolGroupService/InfoTool.js @@ -0,0 +1,16 @@ +import { injectable, inject } from 'inversify'; +import { ToolGroup } from 'wax-prosemirror-core'; + +@injectable() +class InfoToolGroup extends ToolGroup { + tools = []; + constructor( + @inject('CounterInfoTool') counterinfotool, + @inject('ShortCutsInfoTool') shortcutsinfotool, + ) { + super(); + this.tools = [shortcutsinfotool, counterinfotool]; + } +} + +export default InfoToolGroup; diff --git a/wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroup.js b/wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroup.js similarity index 100% rename from wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroup.js rename to wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroup.js diff --git a/wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService.js b/wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService.js similarity index 100% rename from wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService.js rename to wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService.js diff --git a/wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroup.js b/wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroup.js similarity index 100% rename from wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroup.js rename to wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroup.js diff --git a/wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService.js b/wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService.js similarity index 100% rename from wax-prosemirror-services/src/WaxToolGroups/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService.js rename to wax-prosemirror-services/src/CustomTagService/CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService.js diff --git a/wax-prosemirror-services/src/CustomTagService/index.js b/wax-prosemirror-services/src/CustomTagService/index.js index 9be43edbd..adb4bd0d2 100644 --- a/wax-prosemirror-services/src/CustomTagService/index.js +++ b/wax-prosemirror-services/src/CustomTagService/index.js @@ -1,4 +1,11 @@ import CustomTagBlockService from './CustomTagBlockService/CustomTagBlockService'; import CustomTagInlineService from './CustomTagInlineService/CustomTagInlineService'; +import CustomTagBlockToolGroupService from './CustomTagToolGroupService/CustomTagBlockToolGroupService/CustomTagBlockToolGroupService'; +import CustomTagInlineToolGroupService from './CustomTagToolGroupService/CustomTagInlineToolGroupService/CustomTagInlineToolGroupService'; -export default [new CustomTagBlockService(), new CustomTagInlineService()]; +export default [ + new CustomTagBlockService(), + new CustomTagInlineService(), + new CustomTagBlockToolGroupService(), + new CustomTagInlineToolGroupService(), +]; -- GitLab