Compare commits

...
11 changed files with 81 additions and 20 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.
## [3.23.200](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-09)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.199](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.198](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-07)
### Bug Fixes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.23.198",
"version": "3.23.200",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+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.41.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-09)
**Note:** Version bump only for package @standardnotes/mobile
## [3.41.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.41.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-07)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.41.1",
"version": "3.41.3",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+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.3.127](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-09)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.126](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.125](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-07)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.125",
"version": "1.3.127",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+13
View File
@@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.71.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-09)
### Bug Fixes
* move viewport early return above ([6a4b5c5](https://github.com/standardnotes/app/commit/6a4b5c5cdc808c2947e4fe04c5a7e1c3ce7821d0))
* potential fix for viewport height issue ([#1772](https://github.com/standardnotes/app/issues/1772)) ([cd1669f](https://github.com/standardnotes/app/commit/cd1669f56f510fe44c39f6c6d76ca6c93ee6e5ac))
## [3.71.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-08)
### Bug Fixes
* open upgrade page in new tab if user has account ([e7ca12b](https://github.com/standardnotes/app/commit/e7ca12babefc4b8867c9dc2c535a9da0d4f62a76))
# [3.71.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-07)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.71.0",
"version": "3.71.2",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
+37 -15
View File
@@ -35,26 +35,28 @@ import { WebOrDesktopDevice } from './Application/Device/WebOrDesktopDevice'
import { WebApplication } from './Application/Application'
import { createRoot, Root } from 'react-dom/client'
import { ElementIds } from './Constants/ElementIDs'
import { MediaQueryBreakpoints } from './Hooks/useMediaQuery'
let keyCount = 0
const getKey = () => {
return keyCount++
}
export const setViewportHeightWithFallback = () => {
const currentValue = parseInt(document.documentElement.style.getPropertyValue('--viewport-height'))
let initialCorrectViewportHeight: number | null = null
export const setViewportHeightWithFallback = (isOrientationChange = false) => {
const newValue = visualViewport && visualViewport.height > 0 ? visualViewport.height : window.innerHeight
const supportsSVHUnit = CSS.supports('height', '1svh')
if (currentValue && !newValue) {
if (initialCorrectViewportHeight && newValue < initialCorrectViewportHeight && !isOrientationChange) {
return
}
if (!currentValue && !newValue) {
document.documentElement.style.setProperty('--viewport-height', supportsSVHUnit ? '100svh' : '100vh')
if (!newValue) {
document.documentElement.style.setProperty('--viewport-height', '100vh')
return
}
initialCorrectViewportHeight = newValue
document.documentElement.style.setProperty('--viewport-height', `${newValue}px`)
}
@@ -78,11 +80,35 @@ const startApplication: StartApplication = async function startApplication(
SNLog.onError = console.error
let root: Root
const onDestroy = () => {
if (device.environment === Environment.Desktop) {
window.removeEventListener('resize', setViewportHeightWithFallback)
const isDesktop =
device.environment === Environment.Desktop ||
(matchMedia(MediaQueryBreakpoints.md).matches && matchMedia(MediaQueryBreakpoints.pointerFine))
const orientationChangeHandler = () => {
setViewportHeightWithFallback(true)
}
const resizeHandler = () => {
setViewportHeightWithFallback(false)
}
const setupViewportHeightListeners = () => {
if (!isDesktop) {
setViewportHeightWithFallback()
window.addEventListener('orientationchange', orientationChangeHandler)
window.addEventListener('resize', resizeHandler)
}
window.removeEventListener('orientationchange', setViewportHeightWithFallback)
}
const removeViewportHeightListeners = () => {
if (!isDesktop) {
window.removeEventListener('orientationchange', orientationChangeHandler)
window.removeEventListener('resize', resizeHandler)
}
}
const onDestroy = () => {
removeViewportHeightListeners()
const rootElement = document.getElementById(ElementIds.RootId) as HTMLElement
root.unmount()
rootElement.remove()
@@ -97,11 +123,7 @@ const startApplication: StartApplication = async function startApplication(
disableIosTextFieldZoom()
setViewportHeightWithFallback()
window.addEventListener('orientationchange', setViewportHeightWithFallback)
if (device.environment === Environment.Desktop) {
window.addEventListener('resize', setViewportHeightWithFallback)
}
setupViewportHeightListeners()
setDefaultMonospaceFont(device.platform)
@@ -25,7 +25,8 @@ export const loadPurchaseFlowUrl = async (application: WebApplication): Promise<
if (application.isNativeMobileWeb()) {
application.mobileDevice().openUrl(finalUrl)
} else {
window.location.assign(finalUrl)
const windowProxy = window.open('', '_blank')
;(windowProxy as WindowProxy).location = finalUrl
}
return true
@@ -7,6 +7,7 @@ export const MediaQueryBreakpoints = {
lg: '(min-width: 1024px)',
xl: '(min-width: 1280px)',
'2xl': '(min-width: 1536px)',
pointerFine: '(pointer: fine)',
} as const
export const useMediaQuery = (mediaQuery: string) => {