7474 :has-connection-issue =" displayConnectionIssue "
7575 :has-indexed-db-conflict =" !! indexedDbConflictContent "
7676 @reconnect =" reconnect " />
77- <Translate
78- :show =" translateModal "
79- :content =" translateContent "
80- :file-id =" fileId "
81- @insert-content =" translateInsert "
82- @replace-content =" translateReplace "
83- @close =" hideTranslate " />
8477 </div >
8578</template >
8679
@@ -140,7 +133,6 @@ import MainContainer from './Editor/MainContainer.vue'
140133import Status from ' ./Editor/Status.vue'
141134import Wrapper from ' ./Editor/Wrapper.vue'
142135import MenuBar from ' ./Menu/MenuBar.vue'
143- import Translate from ' ./Modal/Translate.vue'
144136import SkeletonLoading from ' ./SkeletonLoading.vue'
145137import SuggestionsBar from ' ./SuggestionsBar.vue'
146138
@@ -157,7 +149,6 @@ export default defineComponent({
157149 MenuBar,
158150 Reader : () => import (' ./Reader.vue' ),
159151 Status,
160- Translate,
161152 SuggestionsBar,
162153 },
163154 mixins: [isMobile],
@@ -359,8 +350,6 @@ export default defineComponent({
359350 draggedOver: false ,
360351
361352 contentWrapper: null ,
362- translateModal: false ,
363- translateContent: ' ' ,
364353 indexedDbConflictContent: ' ' ,
365354 }
366355 },
@@ -475,7 +464,6 @@ export default defineComponent({
475464 subscribe (' text:image-node:add' , this .onAddImageNode )
476465 subscribe (' text:image-node:delete' , this .onDeleteImageNode )
477466 this .emit (' update:loaded' , true )
478- subscribe (' text:translate-modal:show' , this .showTranslateModal )
479467 exposeForDebugging (this )
480468
481469 await this .whenSynced
@@ -511,7 +499,6 @@ export default defineComponent({
511499 unsubscribe (' text:keyboard:save' , this .onKeyboardSave )
512500 unsubscribe (' text:image-node:add' , this .onAddImageNode )
513501 unsubscribe (' text:image-node:delete' , this .onDeleteImageNode )
514- unsubscribe (' text:translate-modal:show' , this .showTranslateModal )
515502 if (this .dirty && ! this .hasOutdatedDocument && ! this .hasSyncCollision ) {
516503 const timeout = new Promise ((resolve ) => setTimeout (resolve, 2000 ))
517504 await Promise .any ([timeout, this .saveService .save ()])
@@ -884,33 +871,9 @@ export default defineComponent({
884871 this .setEditable (this .editMode )
885872 },
886873
887- showTranslateModal (e ) {
888- this .translateContent = e .content
889- this .translateModal = true
890- },
891- hideTranslate () {
892- this .translateModal = false
893- },
894874 applyCommand (fn ) {
895875 this .editor .commands .command (fn)
896876 },
897- translateInsert (content ) {
898- this .applyCommand (({ tr, commands }) => {
899- return commands .insertContentAt (tr .selection .to , content)
900- })
901- this .translateModal = false
902- },
903- translateReplace (content ) {
904- this .applyCommand (({ tr, commands }) => {
905- const selection = tr .selection
906- const range = {
907- from: selection .from ,
908- to: selection .to ,
909- }
910- return commands .insertContentAt (range, content)
911- })
912- this .translateModal = false
913- },
914877
915878 saveBeforeUnload () {
916879 this .saveService .saveViaSendBeacon ()
0 commit comments