Compare commits

...
21 changed files with 157 additions and 41 deletions
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.105](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.104](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-20)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.103](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-19)
**Note:** Version bump only for package @standardnotes/clipper
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/clipper",
"description": "Web clipper browser extension for Standard Notes",
"version": "1.1.103",
"version": "1.1.105",
"private": true,
"scripts": {
"build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.108.36](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.35](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.34](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-19)
**Note:** Version bump only for package @standardnotes/desktop
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.108.34",
"version": "3.108.36",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.56.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)
### Bug Fixes
* Shared image links are now correctly handled on iOS ([ab2e88a](https://github.com/standardnotes/app/commit/ab2e88a710c65771312bd9d02cec0b400d352a0e))
## [3.56.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-19)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.56.13",
"version": "3.56.15",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
@@ -109,42 +109,16 @@ export class ReceivedSharedItemsHandler {
return
}
if (isReceivedAndroidFile(item)) {
const data = await readFile(item.contentUri, 'base64')
const file = {
name: item.fileName || item.contentUri,
data,
mimeType: item.mimeType,
}
this.webViewRef.current?.postMessage(
JSON.stringify({
reactNativeEvent: ReactNativeToWebEvent.ReceivedFile,
messageType: 'event',
messageData: file,
}),
)
} else if (isReceivedIosFile(item)) {
const data = await readFile(item.path, 'base64')
const file = {
name: item.fileName || item.path,
data,
mimeType: item.mimeType,
}
this.webViewRef.current?.postMessage(
JSON.stringify({
reactNativeEvent: ReactNativeToWebEvent.ReceivedFile,
messageType: 'event',
messageData: file,
}),
)
if (isReceivedAndroidFile(item) || isReceivedIosFile(item)) {
this.sendFileToWebView(item).catch(console.error)
} else if (isReceivedWeblink(item)) {
this.webViewRef.current?.postMessage(
JSON.stringify({
reactNativeEvent: ReactNativeToWebEvent.ReceivedText,
reactNativeEvent: ReactNativeToWebEvent.ReceivedLink,
messageType: 'event',
messageData: {
title: item.subject || item.weblink,
text: item.weblink,
link: item.weblink,
},
}),
)
@@ -163,6 +137,23 @@ export class ReceivedSharedItemsHandler {
this.handleItemsQueue().catch(console.error)
}
sendFileToWebView = async (item: ReceivedAndroidFile | ReceivedIosFile) => {
const path = isReceivedAndroidFile(item) ? item.contentUri : item.path
const data = await readFile(path, 'base64')
const file = {
name: item.fileName || item.path,
data,
mimeType: item.mimeType,
}
this.webViewRef.current?.postMessage(
JSON.stringify({
reactNativeEvent: ReactNativeToWebEvent.ReceivedFile,
messageType: 'event',
messageData: file,
}),
)
}
private addSharedItemsToQueue = async (url?: string) => {
const received =
Platform.OS === 'ios' ? await ReceiveSharingIntent.getFileNames(url) : await ReceiveSharingIntent.getFileNames()
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.387](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.386](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.385](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-19)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.385",
"version": "1.4.387",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.202.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)
### Bug Fixes
* Shared image links are now correctly handled on iOS ([ab2e88a](https://github.com/standardnotes/app/commit/ab2e88a710c65771312bd9d02cec0b400d352a0e))
## [2.202.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-20)
**Note:** Version bump only for package @standardnotes/snjs
## [2.202.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-17)
### Bug Fixes
+1 -1
View File
@@ -8,7 +8,7 @@ export function platformFromString(string: string) {
'linux-desktop': Platform.LinuxDesktop,
'windows-web': Platform.WindowsWeb,
'windows-desktop': Platform.WindowsDesktop,
ios: Platform.Ios,
'ios-web': Platform.Ios,
android: Platform.Android,
}
return map[string]
@@ -10,5 +10,6 @@ export enum ReactNativeToWebEvent {
KeyboardWillShow = 'KeyboardWillShow',
KeyboardWillHide = 'KeyboardWillHide',
ReceivedFile = 'ReceivedFile',
ReceivedLink = 'ReceivedLink',
ReceivedText = 'ReceivedText',
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.202.7",
"version": "2.202.9",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.28.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)
### Bug Fixes
* Shared image links are now correctly handled on iOS ([ab2e88a](https://github.com/standardnotes/app/commit/ab2e88a710c65771312bd9d02cec0b400d352a0e))
## [1.28.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-17)
**Note:** Version bump only for package @standardnotes/ui-services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.28.6",
"version": "1.28.7",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -18,6 +18,7 @@ export interface WebApplicationInterface extends ApplicationInterface {
handleMobileKeyboardDidChangeFrameEvent(frame: { height: number; contentHeight: number }): void
handleReceivedFileEvent(file: { name: string; mimeType: string; data: string }): void
handleReceivedTextEvent(item: { text: string; title?: string }): Promise<void>
handleReceivedLinkEvent(item: { link: string; title: string }): Promise<void>
isNativeMobileWeb(): boolean
mobileDevice(): MobileDeviceInterface
handleAndroidBackButtonPressed(): void
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.167.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)
### Bug Fixes
* Shared image links are now correctly handled on iOS ([ab2e88a](https://github.com/standardnotes/app/commit/ab2e88a710c65771312bd9d02cec0b400d352a0e))
## [3.167.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-20)
**Note:** Version bump only for package @standardnotes/web
## [3.167.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-19)
### Bug Fixes
+25
View File
@@ -1,5 +1,30 @@
{
"versions": [
{
"version": "3.167.3",
"title": "[3.167.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-21)",
"date": null,
"body": "### Bug Fixes\n\n* Shared image links are now correctly handled on iOS ([ab2e88a](https://github.com/standardnotes/app/commit/ab2e88a710c65771312bd9d02cec0b400d352a0e))",
"parsed": {
"_": [
"Shared image links are now correctly handled on iOS (ab2e88a)"
],
"Bug Fixes": [
"Shared image links are now correctly handled on iOS (ab2e88a)"
]
}
},
{
"version": "3.167.2",
"title": "[3.167.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-20)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.167.1",
"title": "[3.167.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-19)",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.167.1",
"version": "3.167.3",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -54,7 +54,7 @@ import { ItemGroupController } from '@/Components/NoteView/Controller/ItemGroupC
import { VisibilityObserver } from './VisibilityObserver'
import { MomentsService } from '@/Controllers/Moments/MomentsService'
import { DevMode } from './DevMode'
import { ToastType, addToast } from '@standardnotes/toast'
import { ToastType, addToast, dismissToast } from '@standardnotes/toast'
export type WebEventObserver = (event: WebAppEvent, data?: unknown) => void
@@ -395,7 +395,7 @@ export class WebApplication extends SNApplication implements WebApplicationInter
const filesController = this.controllers.filesController
const blob = getBlobFromBase64(file.data, file.mimeType)
const mappedFile = new File([blob], file.name, { type: file.mimeType })
void filesController.uploadNewFile(mappedFile, true)
filesController.uploadNewFile(mappedFile, true).catch(console.error)
}
async handleReceivedTextEvent({ text, title }: { text: string; title?: string | undefined }) {
@@ -417,6 +417,41 @@ export class WebApplication extends SNApplication implements WebApplicationInter
})
}
async handleReceivedLinkEvent({ link, title }: { link: string; title: string | undefined }) {
const url = new URL(link)
const paths = url.pathname.split('/')
const finalPath = paths[paths.length - 1]
const isImagePath = !!finalPath && /\.(png|svg|webp|jpe?g)/.test(finalPath)
if (isImagePath) {
const fetchToastUuid = addToast({
type: ToastType.Loading,
message: 'Fetching image from link...',
})
try {
const imgResponse = await fetch(link)
if (!imgResponse.ok) {
throw new Error(`${imgResponse.status}: Could not fetch image`)
}
const imgBlob = await imgResponse.blob()
const file = new File([imgBlob], finalPath, {
type: imgBlob.type,
})
this.controllers.filesController.uploadNewFile(file, true).catch(console.error)
} catch (error) {
console.error(error)
} finally {
dismissToast(fetchToastUuid)
}
return
}
this.handleReceivedTextEvent({
title: title,
text: link,
}).catch(console.error)
}
private async lockApplicationAfterMobileEventIfApplicable(): Promise<void> {
const isLocked = await this.isLocked()
if (isLocked) {
@@ -93,7 +93,10 @@ export class MobileWebReceiver {
)
break
case ReactNativeToWebEvent.ReceivedText:
void this.application.handleReceivedTextEvent(messageData as { text: string; title?: string })
void this.application.handleReceivedTextEvent(messageData as { text: string })
break
case ReactNativeToWebEvent.ReceivedLink:
void this.application.handleReceivedLinkEvent(messageData as { link: string; title: string })
break
default: