Merge branch 'main' of github.com:standardnotes/app

This commit is contained in:
Aman Harwara
2023-02-02 19:07:33 +05:30
32 changed files with 141 additions and 17 deletions

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.144.5](https://github.com/standardnotes/app/compare/@standardnotes/web@3.144.4...@standardnotes/web@3.144.5) (2023-02-02)
### Bug Fixes
* Fixed issue where Super toolbar would close on clicking on iOS ([7a3f376](https://github.com/standardnotes/app/commit/7a3f3761fc44896ba316975bcb62a27b2d54283a))
## [3.144.4](https://github.com/standardnotes/app/compare/@standardnotes/web@3.144.3...@standardnotes/web@3.144.4) (2023-02-01)
**Note:** Version bump only for package @standardnotes/web
## [3.144.3](https://github.com/standardnotes/app/compare/@standardnotes/web@3.144.2...@standardnotes/web@3.144.3) (2023-02-01)
### Bug Fixes

View File

@@ -1,5 +1,30 @@
{
"versions": [
{
"version": "3.144.5",
"title": "[3.144.5](https://github.com/standardnotes/app/compare/@standardnotes/web@3.144.4...@standardnotes/web@3.144.5) (2023-02-02)",
"date": null,
"body": "### Bug Fixes\n\n* Fixed issue where Super toolbar would close on clicking on iOS ([7a3f376](https://github.com/standardnotes/app/commit/7a3f3761fc44896ba316975bcb62a27b2d54283a))",
"parsed": {
"_": [
"Fixed issue where Super toolbar would close on clicking on iOS (7a3f376)"
],
"Bug Fixes": [
"Fixed issue where Super toolbar would close on clicking on iOS (7a3f376)"
]
}
},
{
"version": "3.144.4",
"title": "[3.144.4](https://github.com/standardnotes/app/compare/@standardnotes/web@3.144.3...@standardnotes/web@3.144.4) (2023-02-01)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.144.3",
"title": "[3.144.3](https://github.com/standardnotes/app/compare/@standardnotes/web@3.144.2...@standardnotes/web@3.144.3) (2023-02-01)",

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.144.3",
"version": "3.144.5",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",

View File

@@ -30,6 +30,7 @@ const MobileToolbarPlugin = () => {
const [modal, showModal] = useModal()
const [isInEditor, setIsInEditor] = useState(false)
const [isInToolbar, setIsInToolbar] = useState(false)
const isMobile = useMediaQuery(MutuallyExclusiveMediaQueryBreakpoints.sm)
const toolbarRef = useRef<HTMLDivElement>(null)
@@ -151,14 +152,34 @@ const MobileToolbarPlugin = () => {
}
}, [editor])
if (!isMobile || !isInEditor) {
useEffect(() => {
if (!toolbarRef.current) {
return
}
const toolbar = toolbarRef.current
const handleFocus = () => setIsInToolbar(true)
const handleBlur = () => setIsInToolbar(false)
toolbar.addEventListener('focus', handleFocus)
toolbar.addEventListener('blur', handleBlur)
return () => {
toolbar?.removeEventListener('focus', handleFocus)
toolbar?.removeEventListener('blur', handleBlur)
}
}, [])
const isFocusInEditorOrToolbar = isInEditor || isInToolbar
if (!isMobile || !isFocusInEditorOrToolbar) {
return null
}
return (
<>
{modal}
<div className="flex w-full flex-shrink-0 border-t border-border bg-contrast" ref={toolbarRef}>
<div tabIndex={-1} className="flex w-full flex-shrink-0 border-t border-border bg-contrast" ref={toolbarRef}>
<div className={classNames('flex items-center gap-1 overflow-x-auto', '[&::-webkit-scrollbar]:h-0')}>
{items.map((item) => {
return (