diff --git a/README.md b/README.md index 58444ce..b4b3778 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,6 @@ Explore features, limitations and bugs *SwiftUI, Combine and Catalyst*. ![](files/Release_2.0.0_1.png) ## Coming features -- [Voicing selected words and phrases by Longman speakers](https://github.com/filimo/ReaderTranslator/issues/62) - [New features for ReaderTranslatorPlayer](https://github.com/filimo/ReaderTranslator/issues/58) - [Sync bookmarks between macOS and mobile apps](https://github.com/filimo/ReaderTranslator/issues/63) - [Bookmarks for mobile version](https://github.com/filimo/ReaderTranslator/issues/66) @@ -100,6 +99,14 @@ Explore features, limitations and bugs *SwiftUI, Combine and Catalyst*. ## Releases ### Download .dmg from [here](https://github.com/filimo/ReaderTranslator/releases) +**1.10.0** +- [ReaderTranslatorMobile #76](https://github.com/filimo/ReaderTranslator/issues/76) + +![](files/Release_1.10_0_1.gif) + +**1.9.2** +- [Voicing selected words and phrases by Longman speakers](https://github.com/filimo/ReaderTranslator/issues/62) + **1.9.1** - [Merriam-Webster support #75](https://github.com/filimo/ReaderTranslator/issues/75) diff --git a/ReaderTranslator.xcodeproj/project.pbxproj b/ReaderTranslator.xcodeproj/project.pbxproj index 65348c8..a87383c 100644 --- a/ReaderTranslator.xcodeproj/project.pbxproj +++ b/ReaderTranslator.xcodeproj/project.pbxproj @@ -205,6 +205,97 @@ F08EBB0D23956A20009025D3 /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08EBB0C23956A20009025D3 /* NetworkManager.swift */; }; F08EBB1023956D80009025D3 /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08EBB0F23956D80009025D3 /* NetworkManager.swift */; }; F08EBB1123956D80009025D3 /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08EBB0F23956D80009025D3 /* NetworkManager.swift */; }; + F094596E24092C6D001EC43D /* TranslateAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AD8B1D236414070017C22F /* TranslateAction.swift */; }; + F094596F24092C75001EC43D /* LongmanStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0553727239BE3C700BA24BA /* LongmanStore.swift */; }; + F094597124092C92001EC43D /* SwiftSoup in Frameworks */ = {isa = PBXBuildFile; productRef = F094597024092C92001EC43D /* SwiftSoup */; }; + F094597224092C9E001EC43D /* AVAudioNetPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F074D42C23D5B80D00492922 /* AVAudioNetPlayer.swift */; }; + F094597324092CA6001EC43D /* ViewsStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F065095D23AE0353003D2410 /* ViewsStore.swift */; }; + F094597424092CB9001EC43D /* AvailableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AD8B1A236413F60017C22F /* AvailableView.swift */; }; + F094597624092CCD001EC43D /* WebStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F065096623AE0D39003D2410 /* WebStore.swift */; }; + F094597724092CD8001EC43D /* UserDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = F040D5772336A77D004567B8 /* UserDefault.swift */; }; + F094597924092D0D001EC43D /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06DB10C23450B6000C2DE90 /* View.swift */; }; + F094597A24092D11001EC43D /* Stack.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0EDE34C23641B1300E0B81C /* Stack.swift */; }; + F094597B24092D14001EC43D /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C36A9C2359C78A001E396C /* Array.swift */; }; + F094597C24092D1B001EC43D /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = F049244E2341F54800F3C728 /* Image.swift */; }; + F094597D24092D1B001EC43D /* StackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06DB1032344975E00C2DE90 /* StackView.swift */; }; + F094597E24092D1B001EC43D /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C6657B2351A70B0087B6F2 /* Collection.swift */; }; + F094597F24092D1B001EC43D /* NSObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = F04C830E23617BE6003A25B4 /* NSObject.swift */; }; + F094598024092D1B001EC43D /* NWParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = F02B04AE23A2844700F93B84 /* NWParameters.swift */; }; + F094598124092D1B001EC43D /* URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0B4843B23A8C6860031A811 /* URL.swift */; }; + F094598224092D1B001EC43D /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C02D3523B26A3800B393A5 /* OSLog.swift */; }; + F094598324092D1B001EC43D /* CGFloat.swift in Sources */ = {isa = PBXBuildFile; fileRef = F064B4A323CC569400F28314 /* CGFloat.swift */; }; + F094598424092D1B001EC43D /* NumberFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F064B4A923CC598400F28314 /* NumberFormatter.swift */; }; + F094598524092D26001EC43D /* ButtonModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AF8D0A23D37E7200E8E4E2 /* ButtonModifier.swift */; }; + F094598624092D26001EC43D /* RoundedEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AF8D0F23D37E9000E8E4E2 /* RoundedEdge.swift */; }; + F094598724092D30001EC43D /* FavoriteVoiceName.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F256C1233E6C4C00C9D719 /* FavoriteVoiceName.swift */; }; + F094598824092D3C001EC43D /* PdfStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F065096123AE0C11003D2410 /* PdfStore.swift */; }; + F094598924092D3C001EC43D /* BookmarksStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0418B97239A32FD00B59C66 /* BookmarksStore.swift */; }; + F094598A24092D3C001EC43D /* SharedContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0039EC223447E24002F3F95 /* SharedContainer.swift */; }; + F094598B24092D3C001EC43D /* ExtensionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06DB115234611BB00C2DE90 /* ExtensionManager.swift */; }; + F094598C24092D7E001EC43D /* Server.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06EE7C023AFE98000CF989E /* Server.swift */; }; + F094598D24092D7E001EC43D /* PeerBrowser.swift in Sources */ = {isa = PBXBuildFile; fileRef = F02B04B623A2894700F93B84 /* PeerBrowser.swift */; }; + F094598E24092D7E001EC43D /* PeerListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = F02B04BA23A2896900F93B84 /* PeerListener.swift */; }; + F094598F24092D7E001EC43D /* PeerConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = F02B04BE23A2898300F93B84 /* PeerConnection.swift */; }; + F094599024092D7E001EC43D /* ReaderTranslatorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = F02B04B223A2847700F93B84 /* ReaderTranslatorProtocol.swift */; }; + F094599124092D7E001EC43D /* ConnectionServerStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = F04D5D3E23A3677800424479 /* ConnectionServerStatus.swift */; }; + F094599224092D7E001EC43D /* ConnectionClientStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = F046182D23A3A4AF0041E726 /* ConnectionClientStatus.swift */; }; + F094599324092D7E001EC43D /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08EBB0C23956A20009025D3 /* NetworkManager.swift */; }; + F094599424092D7E001EC43D /* NetBrowser.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06EE7C623AFF27500CF989E /* NetBrowser.swift */; }; + F094599D24092DFA001EC43D /* WikipediaRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06D1C0D2361FFBC008A0C38 /* WikipediaRepresenter.swift */; }; + F094599E24092DFA001EC43D /* MacmillanRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F04C8312236187D6003A25B4 /* MacmillanRepresenter.swift */; }; + F094599F24092DFA001EC43D /* MerriamWebsterRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0E5BC6223D62D63004DACE5 /* MerriamWebsterRepresenter.swift */; }; + F09459A024092DFA001EC43D /* CollinsRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0FCDD442361A7650016F23F /* CollinsRepresenter.swift */; }; + F09459A124092DFA001EC43D /* LongmanRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0505C522360D37C004F2D50 /* LongmanRepresenter.swift */; }; + F09459A224092DFA001EC43D /* ReversoRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A9F35A2349228A00970C97 /* ReversoRepresenter.swift */; }; + F09459A324092DFA001EC43D /* YTranslatorRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F062029423812264002EEAEE /* YTranslatorRepresenter.swift */; }; + F09459A424092DFA001EC43D /* StackExchangeRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F025D61C23B73C8B004A1D6B /* StackExchangeRepresenter.swift */; }; + F09459A624092DFF001EC43D /* WKRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AA69DC232E97B0007CC07B /* WKRepresenter.swift */; }; + F09459A924092E0E001EC43D /* reverso-reverso-speaker.js in Resources */ = {isa = PBXBuildFile; fileRef = F058C7ED2396ACC0002C84F0 /* reverso-reverso-speaker.js */; }; + F09459AA24092E0E001EC43D /* reader-translator.js in Resources */ = {isa = PBXBuildFile; fileRef = F075445923447A2800E1D88E /* reader-translator.js */; }; + F09459AB24092E0E001EC43D /* longman.json in Resources */ = {isa = PBXBuildFile; fileRef = F058C7F12397A180002C84F0 /* longman.json */; }; + F09459AC24092E0E001EC43D /* merriam-webster.json in Resources */ = {isa = PBXBuildFile; fileRef = F0E5BC6623D630DF004DACE5 /* merriam-webster.json */; }; + F09459AD24092E0E001EC43D /* gtranslator-reverso-speaker.js in Resources */ = {isa = PBXBuildFile; fileRef = F00C7C86235783FF003F6D28 /* gtranslator-reverso-speaker.js */; }; + F09459BD24093031001EC43D /* ReaderView_Pdf.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459BC24093031001EC43D /* ReaderView_Pdf.swift */; }; + F09459C024093073001EC43D /* BookmarksView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459BF24093073001EC43D /* BookmarksView.swift */; }; + F09459C1240930A4001EC43D /* Clipboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C36AA02359D50A001E396C /* Clipboard.swift */; }; + F09459C2240930BD001EC43D /* AudioPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0EDFB24239E49480048CFD1 /* AudioPlayer.swift */; }; + F09459C4240930D8001EC43D /* GTranslatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459C3240930D8001EC43D /* GTranslatorView.swift */; }; + F09459C52409310B001EC43D /* PDFKitViewRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0EE0A1C2348A651004A5EAD /* PDFKitViewRepresentable.swift */; }; + F09459CA240931AC001EC43D /* WikipediaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459C9240931AC001EC43D /* WikipediaView.swift */; }; + F09459CC240931B7001EC43D /* MerriamWebsterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459CB240931B7001EC43D /* MerriamWebsterView.swift */; }; + F09459CE240931D7001EC43D /* StackExchangeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459CD240931D7001EC43D /* StackExchangeView.swift */; }; + F09459D0240931E2001EC43D /* ReversoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459CF240931E2001EC43D /* ReversoView.swift */; }; + F09459D2240931F2001EC43D /* YTranslatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459D1240931F2001EC43D /* YTranslatorView.swift */; }; + F09459D4240931FF001EC43D /* LongmanView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459D3240931FF001EC43D /* LongmanView.swift */; }; + F09459D62409320E001EC43D /* MacmillanView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459D52409320E001EC43D /* MacmillanView.swift */; }; + F09459D82409321B001EC43D /* CollinsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459D72409321B001EC43D /* CollinsView.swift */; }; + F09459DA24093225001EC43D /* ReaderView_Web.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459D924093225001EC43D /* ReaderView_Web.swift */; }; + F09459DC24093230001EC43D /* SafariView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459DB24093230001EC43D /* SafariView.swift */; }; + F09459DE24093E57001EC43D /* WebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09459DD24093E57001EC43D /* WebView.swift */; }; + F09760BD240925680030F928 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09760BC240925680030F928 /* AppDelegate.swift */; }; + F09760BF240925680030F928 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09760BE240925680030F928 /* SceneDelegate.swift */; }; + F09760C1240925680030F928 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09760C0240925680030F928 /* ContentView.swift */; }; + F09760C32409256C0030F928 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F09760C22409256C0030F928 /* Assets.xcassets */; }; + F09760C62409256C0030F928 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F09760C52409256C0030F928 /* Preview Assets.xcassets */; }; + F09760C92409256C0030F928 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F09760C72409256C0030F928 /* LaunchScreen.storyboard */; }; + F09760CF2409261E0030F928 /* WebViewContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08EBAEF23952AD6009025D3 /* WebViewContainer.swift */; }; + F09760D32409263D0030F928 /* WKPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0EE0A152347BF09004A5EAD /* WKPageView.swift */; }; + F09760D4240926450030F928 /* WKCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C53177234B3EE1003174B5 /* WKCoordinator.swift */; }; + F09760D82409272A0030F928 /* ViewRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C4EDA82349271C00CCD97A /* ViewRepresentable.swift */; }; + F09760D9240927410030F928 /* WKScriptsSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C53173234B06D3003174B5 /* WKScriptsSetup.swift */; }; + F09760DD240927B60030F928 /* Safari.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0D2E333234BA49000D95994 /* Safari.swift */; }; + F09760DE240927BF0030F928 /* WKCoordinatorNavigationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F022B6E2234E6663005CA0BB /* WKCoordinatorNavigationDelegate.swift */; }; + F09760DF240927C60030F928 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C02D4323B27CA100B393A5 /* Logger.swift */; }; + F09760E22409280E0030F928 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0F256BC233D309F00C9D719 /* String.swift */; }; + F09760E32409281B0030F928 /* Set.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0814BA123562AF300212F52 /* Set.swift */; }; + F09760E4240928300030F928 /* DOMEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0EE0A0F23478C86004A5EAD /* DOMEvent.swift */; }; + F09760E7240928F20030F928 /* SpeechSynthesizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AA69DA232E97AF007CC07B /* SpeechSynthesizer.swift */; }; + F09760E9240929040030F928 /* DirectoryObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = F033F41123A6D3A800605325 /* DirectoryObserver.swift */; }; + F09760EA2409291D0030F928 /* Published.swift in Sources */ = {isa = PBXBuildFile; fileRef = F002C629232FF40C00D3FC04 /* Published.swift */; }; + F09760EB240929270030F928 /* FileStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F03176B223BB2C51004388A7 /* FileStore.swift */; }; + F09760ED2409298C0030F928 /* GTranslatorRepresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AA69DB232E97AF007CC07B /* GTranslatorRepresenter.swift */; }; + F09760EF24092C070030F928 /* Store.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AA69D7232E978E007CC07B /* Store.swift */; }; + F09760F024092C1C0030F928 /* AudioStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F065095623ADF6A3003D2410 /* AudioStore.swift */; }; F099420C23AD4279003CF1EB /* BookmarksStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0418B97239A32FD00B59C66 /* BookmarksStore.swift */; }; F099420D23AD4283003CF1EB /* LongmanStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0553727239BE3C700BA24BA /* LongmanStore.swift */; }; F099420E23AD428C003CF1EB /* Store.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0AA69D7232E978E007CC07B /* Store.swift */; }; @@ -575,6 +666,28 @@ F08EBB0A239565CC009025D3 /* PlayerContolsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerContolsView.swift; sourceTree = ""; }; F08EBB0C23956A20009025D3 /* NetworkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = ""; }; F08EBB0F23956D80009025D3 /* NetworkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = ""; }; + F09459BC24093031001EC43D /* ReaderView_Pdf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderView_Pdf.swift; sourceTree = ""; }; + F09459BF24093073001EC43D /* BookmarksView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksView.swift; sourceTree = ""; }; + F09459C3240930D8001EC43D /* GTranslatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GTranslatorView.swift; sourceTree = ""; }; + F09459C9240931AC001EC43D /* WikipediaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WikipediaView.swift; sourceTree = ""; }; + F09459CB240931B7001EC43D /* MerriamWebsterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerriamWebsterView.swift; sourceTree = ""; }; + F09459CD240931D7001EC43D /* StackExchangeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackExchangeView.swift; sourceTree = ""; }; + F09459CF240931E2001EC43D /* ReversoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReversoView.swift; sourceTree = ""; }; + F09459D1240931F2001EC43D /* YTranslatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YTranslatorView.swift; sourceTree = ""; }; + F09459D3240931FF001EC43D /* LongmanView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LongmanView.swift; sourceTree = ""; }; + F09459D52409320E001EC43D /* MacmillanView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacmillanView.swift; sourceTree = ""; }; + F09459D72409321B001EC43D /* CollinsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollinsView.swift; sourceTree = ""; }; + F09459D924093225001EC43D /* ReaderView_Web.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderView_Web.swift; sourceTree = ""; }; + F09459DB24093230001EC43D /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = ""; }; + F09459DD24093E57001EC43D /* WebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebView.swift; sourceTree = ""; }; + F09760BA240925680030F928 /* ReaderTranslatorMobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReaderTranslatorMobile.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F09760BC240925680030F928 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + F09760BE240925680030F928 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + F09760C0240925680030F928 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + F09760C22409256C0030F928 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F09760C52409256C0030F928 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + F09760C82409256C0030F928 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + F09760CA2409256C0030F928 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F09AD47D23702DF100FFBF6A /* jquery.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jquery.js; sourceTree = ""; }; F0A2179823A9355E00968133 /* ReaderTranslatorMacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReaderTranslatorMacTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; F0A2179A23A9355E00968133 /* ReaderTranslatorMacTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderTranslatorMacTests.swift; sourceTree = ""; }; @@ -673,6 +786,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F09760B7240925680030F928 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F094597124092C92001EC43D /* SwiftSoup in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F0A2179523A9355E00968133 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -936,6 +1057,58 @@ path = Views; sourceTree = ""; }; + F09459BB24093020001EC43D /* Views */ = { + isa = PBXGroup; + children = ( + F09459C3240930D8001EC43D /* GTranslatorView.swift */, + F09459BC24093031001EC43D /* ReaderView_Pdf.swift */, + F09459D52409320E001EC43D /* MacmillanView.swift */, + F09459DB24093230001EC43D /* SafariView.swift */, + F09459D72409321B001EC43D /* CollinsView.swift */, + F09459D924093225001EC43D /* ReaderView_Web.swift */, + F09459D3240931FF001EC43D /* LongmanView.swift */, + F09459BF24093073001EC43D /* BookmarksView.swift */, + F09459C9240931AC001EC43D /* WikipediaView.swift */, + F09459CB240931B7001EC43D /* MerriamWebsterView.swift */, + F09459CD240931D7001EC43D /* StackExchangeView.swift */, + F09459CF240931E2001EC43D /* ReversoView.swift */, + F09459D1240931F2001EC43D /* YTranslatorView.swift */, + F09459DD24093E57001EC43D /* WebView.swift */, + ); + path = Views; + sourceTree = ""; + }; + F09760BB240925680030F928 /* ReaderTranslatorMobile */ = { + isa = PBXGroup; + children = ( + F09760D5240926C40030F928 /* Delegates */, + F09459BB24093020001EC43D /* Views */, + F09760C0240925680030F928 /* ContentView.swift */, + F09760C22409256C0030F928 /* Assets.xcassets */, + F09760C72409256C0030F928 /* LaunchScreen.storyboard */, + F09760CA2409256C0030F928 /* Info.plist */, + F09760C42409256C0030F928 /* Preview Content */, + ); + path = ReaderTranslatorMobile; + sourceTree = ""; + }; + F09760C42409256C0030F928 /* Preview Content */ = { + isa = PBXGroup; + children = ( + F09760C52409256C0030F928 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + F09760D5240926C40030F928 /* Delegates */ = { + isa = PBXGroup; + children = ( + F09760BC240925680030F928 /* AppDelegate.swift */, + F09760BE240925680030F928 /* SceneDelegate.swift */, + ); + path = Delegates; + sourceTree = ""; + }; F0A2179923A9355E00968133 /* ReaderTranslatorMacTests */ = { isa = PBXGroup; children = ( @@ -953,6 +1126,7 @@ F0AA699F232E9710007CC07B /* ReaderTranslator */, F0754438234479DA00E1D88E /* ReaderTranslatorMac */, F0120374239182DA008D0B47 /* ReaderTranslatorPlayer */, + F09760BB240925680030F928 /* ReaderTranslatorMobile */, F075445023447A2800E1D88E /* ReaderTranslatorSafari */, F0A2179923A9355E00968133 /* ReaderTranslatorMacTests */, F0AF8D1923D3907600E8E4E2 /* ReaderTranslatorShare */, @@ -971,6 +1145,7 @@ F0120373239182DA008D0B47 /* ReaderTranslatorPlayer.app */, F0A2179823A9355E00968133 /* ReaderTranslatorMacTests.xctest */, F0AF8D1823D3907600E8E4E2 /* ReaderTranslatorShare.appex */, + F09760BA240925680030F928 /* ReaderTranslatorMobile.app */, ); name = Products; sourceTree = ""; @@ -1319,6 +1494,26 @@ productReference = F075444E23447A2700E1D88E /* ReaderTranslatorSafari.appex */; productType = "com.apple.product-type.app-extension"; }; + F09760B9240925680030F928 /* ReaderTranslatorMobile */ = { + isa = PBXNativeTarget; + buildConfigurationList = F09760CD2409256C0030F928 /* Build configuration list for PBXNativeTarget "ReaderTranslatorMobile" */; + buildPhases = ( + F09760B6240925680030F928 /* Sources */, + F09760B7240925680030F928 /* Frameworks */, + F09760B8240925680030F928 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ReaderTranslatorMobile; + packageProductDependencies = ( + F094597024092C92001EC43D /* SwiftSoup */, + ); + productName = ReaderTranslatorMobile; + productReference = F09760BA240925680030F928 /* ReaderTranslatorMobile.app */; + productType = "com.apple.product-type.application"; + }; F0A2179723A9355E00968133 /* ReaderTranslatorMacTests */ = { isa = PBXNativeTarget; buildConfigurationList = F0A217A123A9355E00968133 /* Build configuration list for PBXNativeTarget "ReaderTranslatorMacTests" */; @@ -1393,6 +1588,9 @@ F075444D23447A2700E1D88E = { CreatedOnToolsVersion = 11.1; }; + F09760B9240925680030F928 = { + CreatedOnToolsVersion = 11.3.1; + }; F0A2179723A9355E00968133 = { CreatedOnToolsVersion = 11.3; TestTargetID = F0754436234479DA00E1D88E; @@ -1423,6 +1621,7 @@ targets = ( F0754436234479DA00E1D88E /* ReaderTranslatorMac */, F0120372239182DA008D0B47 /* ReaderTranslatorPlayer */, + F09760B9240925680030F928 /* ReaderTranslatorMobile */, F0AA699C232E9710007CC07B /* ReaderTranslator */, F075444D23447A2700E1D88E /* ReaderTranslatorSafari */, F0A2179723A9355E00968133 /* ReaderTranslatorMacTests */, @@ -1471,6 +1670,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F09760B8240925680030F928 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F09760C92409256C0030F928 /* LaunchScreen.storyboard in Resources */, + F09760C62409256C0030F928 /* Preview Assets.xcassets in Resources */, + F09459A924092E0E001EC43D /* reverso-reverso-speaker.js in Resources */, + F09459AC24092E0E001EC43D /* merriam-webster.json in Resources */, + F09459AA24092E0E001EC43D /* reader-translator.js in Resources */, + F09459AD24092E0E001EC43D /* gtranslator-reverso-speaker.js in Resources */, + F09459AB24092E0E001EC43D /* longman.json in Resources */, + F09760C32409256C0030F928 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F0A2179623A9355E00968133 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1796,6 +2010,95 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F09760B6240925680030F928 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F094599324092D7E001EC43D /* NetworkManager.swift in Sources */, + F094598C24092D7E001EC43D /* Server.swift in Sources */, + F094598D24092D7E001EC43D /* PeerBrowser.swift in Sources */, + F09459A224092DFA001EC43D /* ReversoRepresenter.swift in Sources */, + F09760F024092C1C0030F928 /* AudioStore.swift in Sources */, + F094597F24092D1B001EC43D /* NSObject.swift in Sources */, + F094598924092D3C001EC43D /* BookmarksStore.swift in Sources */, + F094597724092CD8001EC43D /* UserDefault.swift in Sources */, + F094598E24092D7E001EC43D /* PeerListener.swift in Sources */, + F09760EA2409291D0030F928 /* Published.swift in Sources */, + F094598124092D1B001EC43D /* URL.swift in Sources */, + F09459C52409310B001EC43D /* PDFKitViewRepresentable.swift in Sources */, + F09760ED2409298C0030F928 /* GTranslatorRepresenter.swift in Sources */, + F09760E32409281B0030F928 /* Set.swift in Sources */, + F09459D2240931F2001EC43D /* YTranslatorView.swift in Sources */, + F094598324092D1B001EC43D /* CGFloat.swift in Sources */, + F094597B24092D14001EC43D /* Array.swift in Sources */, + F09459C024093073001EC43D /* BookmarksView.swift in Sources */, + F09760CF2409261E0030F928 /* WebViewContainer.swift in Sources */, + F09760DE240927BF0030F928 /* WKCoordinatorNavigationDelegate.swift in Sources */, + F094596E24092C6D001EC43D /* TranslateAction.swift in Sources */, + F094597424092CB9001EC43D /* AvailableView.swift in Sources */, + F09459C4240930D8001EC43D /* GTranslatorView.swift in Sources */, + F094597C24092D1B001EC43D /* Image.swift in Sources */, + F09760D82409272A0030F928 /* ViewRepresentable.swift in Sources */, + F09459CC240931B7001EC43D /* MerriamWebsterView.swift in Sources */, + F094598B24092D3C001EC43D /* ExtensionManager.swift in Sources */, + F09459CE240931D7001EC43D /* StackExchangeView.swift in Sources */, + F09459DC24093230001EC43D /* SafariView.swift in Sources */, + F094598F24092D7E001EC43D /* PeerConnection.swift in Sources */, + F094597324092CA6001EC43D /* ViewsStore.swift in Sources */, + F09760EB240929270030F928 /* FileStore.swift in Sources */, + F09459A424092DFA001EC43D /* StackExchangeRepresenter.swift in Sources */, + F094599F24092DFA001EC43D /* MerriamWebsterRepresenter.swift in Sources */, + F09760D4240926450030F928 /* WKCoordinator.swift in Sources */, + F09459DE24093E57001EC43D /* WebView.swift in Sources */, + F094598424092D1B001EC43D /* NumberFormatter.swift in Sources */, + F094599224092D7E001EC43D /* ConnectionClientStatus.swift in Sources */, + F09760DD240927B60030F928 /* Safari.swift in Sources */, + F094597624092CCD001EC43D /* WebStore.swift in Sources */, + F09760BD240925680030F928 /* AppDelegate.swift in Sources */, + F094599024092D7E001EC43D /* ReaderTranslatorProtocol.swift in Sources */, + F094598524092D26001EC43D /* ButtonModifier.swift in Sources */, + F09459D82409321B001EC43D /* CollinsView.swift in Sources */, + F09459BD24093031001EC43D /* ReaderView_Pdf.swift in Sources */, + F09459A324092DFA001EC43D /* YTranslatorRepresenter.swift in Sources */, + F094598A24092D3C001EC43D /* SharedContainer.swift in Sources */, + F09760D9240927410030F928 /* WKScriptsSetup.swift in Sources */, + F09459D4240931FF001EC43D /* LongmanView.swift in Sources */, + F094597224092C9E001EC43D /* AVAudioNetPlayer.swift in Sources */, + F09760E4240928300030F928 /* DOMEvent.swift in Sources */, + F094599124092D7E001EC43D /* ConnectionServerStatus.swift in Sources */, + F09760D32409263D0030F928 /* WKPageView.swift in Sources */, + F09760DF240927C60030F928 /* Logger.swift in Sources */, + F094599E24092DFA001EC43D /* MacmillanRepresenter.swift in Sources */, + F094598824092D3C001EC43D /* PdfStore.swift in Sources */, + F09760BF240925680030F928 /* SceneDelegate.swift in Sources */, + F09760EF24092C070030F928 /* Store.swift in Sources */, + F094597E24092D1B001EC43D /* Collection.swift in Sources */, + F09459A124092DFA001EC43D /* LongmanRepresenter.swift in Sources */, + F09459DA24093225001EC43D /* ReaderView_Web.swift in Sources */, + F09760C1240925680030F928 /* ContentView.swift in Sources */, + F09760E22409280E0030F928 /* String.swift in Sources */, + F094597D24092D1B001EC43D /* StackView.swift in Sources */, + F09459CA240931AC001EC43D /* WikipediaView.swift in Sources */, + F09459D0240931E2001EC43D /* ReversoView.swift in Sources */, + F094599424092D7E001EC43D /* NetBrowser.swift in Sources */, + F09459A024092DFA001EC43D /* CollinsRepresenter.swift in Sources */, + F094597924092D0D001EC43D /* View.swift in Sources */, + F09459C2240930BD001EC43D /* AudioPlayer.swift in Sources */, + F094598224092D1B001EC43D /* OSLog.swift in Sources */, + F094598624092D26001EC43D /* RoundedEdge.swift in Sources */, + F094597A24092D11001EC43D /* Stack.swift in Sources */, + F09459D62409320E001EC43D /* MacmillanView.swift in Sources */, + F09459C1240930A4001EC43D /* Clipboard.swift in Sources */, + F094598724092D30001EC43D /* FavoriteVoiceName.swift in Sources */, + F09760E9240929040030F928 /* DirectoryObserver.swift in Sources */, + F094596F24092C75001EC43D /* LongmanStore.swift in Sources */, + F094599D24092DFA001EC43D /* WikipediaRepresenter.swift in Sources */, + F094598024092D1B001EC43D /* NWParameters.swift in Sources */, + F09459A624092DFF001EC43D /* WKRepresenter.swift in Sources */, + F09760E7240928F20030F928 /* SpeechSynthesizer.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F0A2179423A9355E00968133 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2059,6 +2362,14 @@ name = SafariExtensionViewController.xib; sourceTree = ""; }; + F09760C72409256C0030F928 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F09760C82409256C0030F928 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; F0AA69AB232E9712007CC07B /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -2226,6 +2537,48 @@ }; name = Release; }; + F09760CB2409256C0030F928 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"ReaderTranslatorMobile/Preview Content\""; + DEVELOPMENT_TEAM = B6QRXW5YF2; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = ReaderTranslatorMobile/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = by.filimo.ReaderTranslatorMobile; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F09760CC2409256C0030F928 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"ReaderTranslatorMobile/Preview Content\""; + DEVELOPMENT_TEAM = B6QRXW5YF2; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = ReaderTranslatorMobile/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = by.filimo.ReaderTranslatorMobile; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; F0A2179F23A9355E00968133 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2506,6 +2859,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + F09760CD2409256C0030F928 /* Build configuration list for PBXNativeTarget "ReaderTranslatorMobile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F09760CB2409256C0030F928 /* Debug */, + F09760CC2409256C0030F928 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; F0A217A123A9355E00968133 /* Build configuration list for PBXNativeTarget "ReaderTranslatorMacTests" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -2566,6 +2928,11 @@ package = F0DADAE3239BE8C200CFE2B1 /* XCRemoteSwiftPackageReference "SwiftSoup" */; productName = SwiftSoup; }; + F094597024092C92001EC43D /* SwiftSoup */ = { + isa = XCSwiftPackageProductDependency; + package = F0DADAE3239BE8C200CFE2B1 /* XCRemoteSwiftPackageReference "SwiftSoup" */; + productName = SwiftSoup; + }; F0DADAE4239BE8C200CFE2B1 /* SwiftSoup */ = { isa = XCSwiftPackageProductDependency; package = F0DADAE3239BE8C200CFE2B1 /* XCRemoteSwiftPackageReference "SwiftSoup" */; diff --git a/ReaderTranslator.xcodeproj/xcshareddata/xcschemes/ReaderTranslatorMobile.xcscheme b/ReaderTranslator.xcodeproj/xcshareddata/xcschemes/ReaderTranslatorMobile.xcscheme new file mode 100644 index 0000000..468b647 --- /dev/null +++ b/ReaderTranslator.xcodeproj/xcshareddata/xcschemes/ReaderTranslatorMobile.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReaderTranslator.xcodeproj/xcuserdata/filimo.xcuserdatad/xcschemes/xcschememanagement.plist b/ReaderTranslator.xcodeproj/xcuserdata/filimo.xcuserdatad/xcschemes/xcschememanagement.plist index f289e9e..e6c6fcb 100644 --- a/ReaderTranslator.xcodeproj/xcuserdata/filimo.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/ReaderTranslator.xcodeproj/xcuserdata/filimo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -12,7 +12,7 @@ ReaderTranslator.xcscheme_^#shared#^_ orderHint - 2 + 3 ReaderTranslatorMac.xcscheme_^#shared#^_ @@ -22,7 +22,12 @@ ReaderTranslatorMac_Player_Test.xcscheme_^#shared#^_ orderHint - 4 + 5 + + ReaderTranslatorMobile.xcscheme_^#shared#^_ + + orderHint + 2 ReaderTranslatorPlayer.xcscheme_^#shared#^_ @@ -32,17 +37,17 @@ ReaderTranslatorPlayer_Mac_Test.xcscheme_^#shared#^_ orderHint - 5 + 6 ReaderTranslatorSafari.xcscheme_^#shared#^_ orderHint - 3 + 4 ReaderTranslatorShare.xcscheme_^#shared#^_ orderHint - 6 + 7 SuppressBuildableAutocreation @@ -62,6 +67,11 @@ primary + F09760B9240925680030F928 + + primary + + F0A2179723A9355E00968133 primary diff --git a/ReaderTranslator/Components/ViewRepresentable/GTranslatorRepresenter.swift b/ReaderTranslator/Components/ViewRepresentable/GTranslatorRepresenter.swift index e6aba90..bee6ca2 100644 --- a/ReaderTranslator/Components/ViewRepresentable/GTranslatorRepresenter.swift +++ b/ReaderTranslator/Components/ViewRepresentable/GTranslatorRepresenter.swift @@ -73,7 +73,7 @@ struct GTranslatorRepresenter: ViewRepresentable, WKScriptsSetup { ] if let url = urlComponent.url { - print("\(theClassName)_updateView_reload", url) + print("\(Self.self)_updateView_reload", url) DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { view.load(URLRequest(url: url)) } diff --git a/ReaderTranslator/Components/ViewRepresentable/PDFKitView/PDFKitViewRepresentable.swift b/ReaderTranslator/Components/ViewRepresentable/PDFKitView/PDFKitViewRepresentable.swift index a3b4376..914bada 100644 --- a/ReaderTranslator/Components/ViewRepresentable/PDFKitView/PDFKitViewRepresentable.swift +++ b/ReaderTranslator/Components/ViewRepresentable/PDFKitView/PDFKitViewRepresentable.swift @@ -75,7 +75,7 @@ import SwiftUI Self.pdfView.autoresizingMask = [.flexibleWidth] Self.pdfView.autoScales = true Self.pdfView.document = PDFDocument(url: url) - Self.pdfView.delegate = context.server + Self.pdfView.delegate = context.coordinator } } diff --git a/ReaderTranslator/Components/ViewRepresentable/Scripts/reader-translator.js b/ReaderTranslator/Components/ViewRepresentable/Scripts/reader-translator.js index ac1bc72..f1cfe46 100644 --- a/ReaderTranslator/Components/ViewRepresentable/Scripts/reader-translator.js +++ b/ReaderTranslator/Components/ViewRepresentable/Scripts/reader-translator.js @@ -89,6 +89,16 @@ document.addEventListener("mouseup", (event) => { keysStatus = {} }) + + document.addEventListener("selectionchange", (event) => { + let selection = document.getSelection() + + if(selection) {} else return + + if(selection.toString().trim()) { + sendIn1000('selectionchange', 'document', event) + } + }) // Use click event instead of selectionchange to avoid firing the event when using text search on a page document.addEventListener('click', (event) => { diff --git a/ReaderTranslator/Components/ViewRepresentable/WebKit/WKCoordinator.swift b/ReaderTranslator/Components/ViewRepresentable/WebKit/WKCoordinator.swift index 10642ce..6b87236 100644 --- a/ReaderTranslator/Components/ViewRepresentable/WebKit/WKCoordinator.swift +++ b/ReaderTranslator/Components/ViewRepresentable/WebKit/WKCoordinator.swift @@ -20,7 +20,7 @@ class WKCoordinator: NSObject { init(_ parent: WKScriptsSetup) { self.parent = parent super.init() - print("\(theClassName)_makeCoordinator") + print("\(Self.self)_makeCoordinator") } deinit { diff --git a/ReaderTranslator/Components/ViewRepresentable/WebKit/WKRepresenter.swift b/ReaderTranslator/Components/ViewRepresentable/WebKit/WKRepresenter.swift index f3bea11..2352017 100644 --- a/ReaderTranslator/Components/ViewRepresentable/WebKit/WKRepresenter.swift +++ b/ReaderTranslator/Components/ViewRepresentable/WebKit/WKRepresenter.swift @@ -59,7 +59,7 @@ struct WKRepresenter: ViewRepresentable, WKScriptsSetup { // TODO: view.scrollView.zoomScale = store.zoom // view.setNeedsDisplay(view.bounds) #else - view.setZoom(zoomLevel: store.zoom) +// view.setZoom(zoomLevel: store.zoom) #endif if view.newUrl != lastWebPage { view.newUrl = lastWebPage } } diff --git a/ReaderTranslator/Extentions/Image.swift b/ReaderTranslator/Extentions/Image.swift index 867ff12..8f907f5 100644 --- a/ReaderTranslator/Extentions/Image.swift +++ b/ReaderTranslator/Extentions/Image.swift @@ -17,6 +17,16 @@ import SwiftUI .frame(height: 20) } } +#else +extension Image { + static func sfSymbol(_ systemName: String) -> some View { + Image(systemName: systemName) + .resizable() + .aspectRatio(contentMode: .fit) + .colorInvert() + .frame(height: 20) + } +} #endif struct ImageView_Previews: PreviewProvider { diff --git a/ReaderTranslator/Stores/PdfStore.swift b/ReaderTranslator/Stores/PdfStore.swift index 7f4e07a..fce81e8 100644 --- a/ReaderTranslator/Stores/PdfStore.swift +++ b/ReaderTranslator/Stores/PdfStore.swift @@ -7,6 +7,7 @@ // import Foundation +import CoreGraphics final class PdfStore: ObservableObject { private init() {} diff --git a/ReaderTranslator/Stores/ViewsStore.swift b/ReaderTranslator/Stores/ViewsStore.swift index 48502cd..17fda2b 100644 --- a/ReaderTranslator/Stores/ViewsStore.swift +++ b/ReaderTranslator/Stores/ViewsStore.swift @@ -7,6 +7,7 @@ // import Foundation +import CoreGraphics final class ViewsStore: ObservableObject { private init() {} diff --git a/ReaderTranslatorMobile/Assets.xcassets/AppIcon.appiconset/Contents.json b/ReaderTranslatorMobile/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/ReaderTranslatorMobile/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ReaderTranslatorMobile/Assets.xcassets/Contents.json b/ReaderTranslatorMobile/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/ReaderTranslatorMobile/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ReaderTranslatorMobile/Base.lproj/LaunchScreen.storyboard b/ReaderTranslatorMobile/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/ReaderTranslatorMobile/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReaderTranslatorMobile/ContentView.swift b/ReaderTranslatorMobile/ContentView.swift new file mode 100644 index 0000000..b525156 --- /dev/null +++ b/ReaderTranslatorMobile/ContentView.swift @@ -0,0 +1,34 @@ +// +// ContentView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct ContentView: View { + @State var isShow = false + + init() { + ViewsStore.shared.enabledViews = [.gTranslator, .web] + } + + var body: some View { + NavigationView { + VStack { + NavigationLink(destination: GTranslatorView(), isActive: $isShow) { EmptyView() } + WebView() + } + .navigationBarTitle("ReaderTranslator", displayMode: .inline) + .navigationBarItems(trailing: Button("Translate") { self.isShow = true }) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/ReaderTranslatorMobile/Delegates/AppDelegate.swift b/ReaderTranslatorMobile/Delegates/AppDelegate.swift new file mode 100644 index 0000000..6b0bd38 --- /dev/null +++ b/ReaderTranslatorMobile/Delegates/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/ReaderTranslatorMobile/Delegates/SceneDelegate.swift b/ReaderTranslatorMobile/Delegates/SceneDelegate.swift new file mode 100644 index 0000000..b3e4b3a --- /dev/null +++ b/ReaderTranslatorMobile/Delegates/SceneDelegate.swift @@ -0,0 +1,64 @@ +// +// SceneDelegate.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import UIKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + // Create the SwiftUI view that provides the window contents. + let contentView = ContentView() + + // Use a UIHostingController as window root view controller. + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: contentView) + self.window = window + window.makeKeyAndVisible() + } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/ReaderTranslatorMobile/Info.plist b/ReaderTranslatorMobile/Info.plist new file mode 100644 index 0000000..9742bf0 --- /dev/null +++ b/ReaderTranslatorMobile/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ReaderTranslatorMobile/Preview Content/Preview Assets.xcassets/Contents.json b/ReaderTranslatorMobile/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/ReaderTranslatorMobile/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ReaderTranslatorMobile/Views/BookmarksView.swift b/ReaderTranslatorMobile/Views/BookmarksView.swift new file mode 100644 index 0000000..4d47ded --- /dev/null +++ b/ReaderTranslatorMobile/Views/BookmarksView.swift @@ -0,0 +1,21 @@ +// +// BookmarksView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct BookmarksView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct BookmarksView_Previews: PreviewProvider { + static var previews: some View { + BookmarksView() + } +} diff --git a/ReaderTranslatorMobile/Views/CollinsView.swift b/ReaderTranslatorMobile/Views/CollinsView.swift new file mode 100644 index 0000000..8a547e4 --- /dev/null +++ b/ReaderTranslatorMobile/Views/CollinsView.swift @@ -0,0 +1,21 @@ +// +// CollinsView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct CollinsView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct CollinsView_Previews: PreviewProvider { + static var previews: some View { + CollinsView() + } +} diff --git a/ReaderTranslatorMobile/Views/GTranslatorView.swift b/ReaderTranslatorMobile/Views/GTranslatorView.swift new file mode 100644 index 0000000..fd1193b --- /dev/null +++ b/ReaderTranslatorMobile/Views/GTranslatorView.swift @@ -0,0 +1,23 @@ +// +// GTranslatorView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct GTranslatorView: View { + @ObservedObject private var store = Store.shared + + var body: some View { + GTranslatorRepresenter(selectedText: self.$store.translateAction) + } +} + +struct GTranslatorView_Previews: PreviewProvider { + static var previews: some View { + GTranslatorView() + } +} diff --git a/ReaderTranslatorMobile/Views/LongmanView.swift b/ReaderTranslatorMobile/Views/LongmanView.swift new file mode 100644 index 0000000..25e1e98 --- /dev/null +++ b/ReaderTranslatorMobile/Views/LongmanView.swift @@ -0,0 +1,21 @@ +// +// LongmanView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct LongmanView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct LongmanView_Previews: PreviewProvider { + static var previews: some View { + LongmanView() + } +} diff --git a/ReaderTranslatorMobile/Views/MacmillanView.swift b/ReaderTranslatorMobile/Views/MacmillanView.swift new file mode 100644 index 0000000..6d81462 --- /dev/null +++ b/ReaderTranslatorMobile/Views/MacmillanView.swift @@ -0,0 +1,21 @@ +// +// MacmillanView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct MacmillanView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct MacmillanView_Previews: PreviewProvider { + static var previews: some View { + MacmillanView() + } +} diff --git a/ReaderTranslatorMobile/Views/MerriamWebsterView.swift b/ReaderTranslatorMobile/Views/MerriamWebsterView.swift new file mode 100644 index 0000000..4294b9a --- /dev/null +++ b/ReaderTranslatorMobile/Views/MerriamWebsterView.swift @@ -0,0 +1,21 @@ +// +// MerriamWebsterView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct MerriamWebsterView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct MerriamWebsterView_Previews: PreviewProvider { + static var previews: some View { + MerriamWebsterView() + } +} diff --git a/ReaderTranslatorMobile/Views/ReaderView_Pdf.swift b/ReaderTranslatorMobile/Views/ReaderView_Pdf.swift new file mode 100644 index 0000000..1a7becf --- /dev/null +++ b/ReaderTranslatorMobile/Views/ReaderView_Pdf.swift @@ -0,0 +1,21 @@ +// +// ReaderView_Pdf.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct ReaderView_Pdf: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct ReaderView_Pdf_Previews: PreviewProvider { + static var previews: some View { + ReaderView_Pdf() + } +} diff --git a/ReaderTranslatorMobile/Views/ReaderView_Web.swift b/ReaderTranslatorMobile/Views/ReaderView_Web.swift new file mode 100644 index 0000000..7c3c81b --- /dev/null +++ b/ReaderTranslatorMobile/Views/ReaderView_Web.swift @@ -0,0 +1,21 @@ +// +// ReaderView_Web.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct ReaderView_Web: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct ReaderView_Web_Previews: PreviewProvider { + static var previews: some View { + ReaderView_Web() + } +} diff --git a/ReaderTranslatorMobile/Views/ReversoView.swift b/ReaderTranslatorMobile/Views/ReversoView.swift new file mode 100644 index 0000000..2320faa --- /dev/null +++ b/ReaderTranslatorMobile/Views/ReversoView.swift @@ -0,0 +1,21 @@ +// +// ReversoView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct ReversoView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct ReversoView_Previews: PreviewProvider { + static var previews: some View { + ReversoView() + } +} diff --git a/ReaderTranslatorMobile/Views/SafariView.swift b/ReaderTranslatorMobile/Views/SafariView.swift new file mode 100644 index 0000000..f17b682 --- /dev/null +++ b/ReaderTranslatorMobile/Views/SafariView.swift @@ -0,0 +1,21 @@ +// +// SafariView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct SafariView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct SafariView_Previews: PreviewProvider { + static var previews: some View { + SafariView() + } +} diff --git a/ReaderTranslatorMobile/Views/StackExchangeView.swift b/ReaderTranslatorMobile/Views/StackExchangeView.swift new file mode 100644 index 0000000..7b38749 --- /dev/null +++ b/ReaderTranslatorMobile/Views/StackExchangeView.swift @@ -0,0 +1,21 @@ +// +// StackExchangeView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct StackExchangeView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct StackExchangeView_Previews: PreviewProvider { + static var previews: some View { + StackExchangeView() + } +} diff --git a/ReaderTranslatorMobile/Views/WebView.swift b/ReaderTranslatorMobile/Views/WebView.swift new file mode 100644 index 0000000..f3060de --- /dev/null +++ b/ReaderTranslatorMobile/Views/WebView.swift @@ -0,0 +1,38 @@ +// +// WebView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct WebView: View { + @ObservedObject var webStore = WebStore.shared + @State var url: String = "" + + var body: some View { + VStack { + HStack { + TextField( + "URL", + text: $url, + onCommit: { self.webStore.lastWebPage = self.url }) + Button(action: { + self.url = Clipboard.string + self.webStore.lastWebPage = self.url + }, label: { Image(systemName: "doc.on.clipboard") }) + } + .padding([.leading, .trailing], 5) + WKRepresenter(lastWebPage: $webStore.lastWebPage) + } + .onAppear { self.url = self.webStore.lastWebPage } + } +} + +struct WebView_Previews: PreviewProvider { + static var previews: some View { + WebView() + } +} diff --git a/ReaderTranslatorMobile/Views/WikipediaView.swift b/ReaderTranslatorMobile/Views/WikipediaView.swift new file mode 100644 index 0000000..be3e0f9 --- /dev/null +++ b/ReaderTranslatorMobile/Views/WikipediaView.swift @@ -0,0 +1,21 @@ +// +// WikipediaView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct WikipediaView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct WikipediaView_Previews: PreviewProvider { + static var previews: some View { + WikipediaView() + } +} diff --git a/ReaderTranslatorMobile/Views/YTranslatorView.swift b/ReaderTranslatorMobile/Views/YTranslatorView.swift new file mode 100644 index 0000000..826adfe --- /dev/null +++ b/ReaderTranslatorMobile/Views/YTranslatorView.swift @@ -0,0 +1,21 @@ +// +// YTranslatorView.swift +// ReaderTranslatorMobile +// +// Created by Viktor Kushnerov on 28/2/20. +// Copyright © 2020 Viktor Kushnerov. All rights reserved. +// + +import SwiftUI + +struct YTranslatorView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +struct YTranslatorView_Previews: PreviewProvider { + static var previews: some View { + YTranslatorView() + } +} diff --git a/files/Release_1.10.0_1.gif b/files/Release_1.10.0_1.gif new file mode 100644 index 0000000..19138ae Binary files /dev/null and b/files/Release_1.10.0_1.gif differ