Compare commits

...
Author SHA1 Message Date
StandardNotes CI f14f105703 chore(release): publish
- @standardnotes/[email protected]
2022-08-17 11:33:50 +00:00
Karol Sójko 6d7bcd7a8d feat(docs): remove matomo in favour of plausible 2022-08-17 13:05:07 +02:00
Karol Sójko da06f293e0 chore(deps): remove reviewers assignment from dependabot to avoid noise 2022-08-17 10:08:54 +02:00
StandardNotes CI ec4dc1d477 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2022-08-16 09:42:00 +00:00
Aman Harwara 2ea9f862fe fix: note tag delete button not showing on iOS (#1403) 2022-08-16 14:40:03 +05:30
StandardNotes CI 901b1516d3 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-08-15 13:15:07 +00:00
Aman Harwara 54ae4365a3 fix: selecting from "Photo Library" on iOS doesn't upload (#1401) 2022-08-15 18:13:29 +05:30
StandardNotes CI 5b910d4ae4 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-08-11 20:06:21 +00:00
Aman Harwara 40d9392599 fix: optimize toasts for mobile (#1392) 2022-08-12 01:07:23 +05:30
StandardNotes CI a7dfeae650 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-08-10 13:30:36 +00:00
Aman Harwara 77cbb6b06e fix: tags being dimmed on safari (#1389) 2022-08-10 18:34:05 +05:30
Aman Harwara 82a8bcc440 fix: tag context menu button opening notes list veiw (#1390) 2022-08-10 18:13:29 +05:30
29 changed files with 254 additions and 171 deletions
-69
View File
@@ -9,182 +9,113 @@ updates:
directory: "/"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/api"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/components"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/desktop"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/docs"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/encryption"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/features"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/filepicker"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/files"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/icons"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/mobile"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/models"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/releases"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/responses"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/services"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/sncrypto-common"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/sncrypto-web"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/snjs"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/styles"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/toast"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/utils"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/web"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "moughxyz"
- "karolsojko"
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.23.94](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.93](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.92](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.91](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.90](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
**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.23.90",
"version": "3.23.94",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+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.
# [0.2.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
### Features
* **docs:** remove matomo in favour of plausible ([6d7bcd7](https://github.com/standardnotes/app/commit/6d7bcd7a8d2dfffb6dc69899406af57e41c071df))
# [0.1.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-11)
### Features
-1
View File
@@ -44,7 +44,6 @@ docs
│ ├── katex
│ ├── .nojekyll
│ ├── CNAME
│ └── matomo.js
├── .gitignore
├── .prettierrc
├── docusaurus.config.js
+2 -2
View File
@@ -156,8 +156,8 @@ module.exports = {
],
scripts: [
{
src: `/matomo.js`,
async: true,
src: 'https://plausible.standardnotes.com/js/plausible.js',
"data-domain": 'docs.standardnotes.com',
defer: true,
},
],
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/docs",
"version": "0.1.0",
"version": "0.2.0",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
-11
View File
@@ -1,11 +0,0 @@
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.standardnotes.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '7']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.31.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.31.6",
"version": "3.31.10",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.3.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.12",
"version": "1.3.16",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+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.3.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
### Bug Fixes
* optimize toasts for mobile ([#1392](https://github.com/standardnotes/app/issues/1392)) ([40d9392](https://github.com/standardnotes/app/commit/40d9392599e871225abcabcddd51de6cc99a0fe9))
## [1.3.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-14)
**Note:** Version bump only for package @standardnotes/toast
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/toast",
"version": "1.3.4",
"version": "1.3.5",
"private": true,
"main": "./src/index.ts",
"scripts": {
+16 -16
View File
@@ -12,20 +12,20 @@ const prefersReducedMotion = () => {
const colorForToastType = (type: ToastType) => {
switch (type) {
case ToastType.Success:
return 'text-success'
return 'bg-success text-info-contrast md:text-success'
case ToastType.Error:
return 'text-danger'
return 'bg-danger text-info-contrast md:text-danger'
default:
return 'text-info'
return 'bg-info text-info-contrast md:text-info'
}
}
const iconForToastType = (type: ToastType) => {
switch (type) {
case ToastType.Success:
return <CheckCircleFilledIcon className={`h-5 w-5 ${colorForToastType(type)}`} />
return <CheckCircleFilledIcon className="text-success h-5 w-5" />
case ToastType.Error:
return <ClearCircleFilledIcon className={`h-5 w-5 ${colorForToastType(type)}`} />
return <ClearCircleFilledIcon className="text-danger h-5 w-5" />
case ToastType.Progress:
case ToastType.Loading:
return <div className="border-info h-4 w-4 animate-spin rounded-full border border-solid border-r-transparent" />
@@ -77,7 +77,7 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
<div
data-index={index}
role="status"
className={`bg-passive-5 animation-fill-forwards relative mt-3 flex min-w-max select-none flex-col rounded opacity-0 ${currentAnimation}`}
className={`bg-passive-5 animation-fill-forwards relative mt-3 flex min-w-full select-none flex-col rounded opacity-0 md:min-w-max ${currentAnimation}`}
style={{
boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.16)',
transition: shouldReduceMotion ? undefined : 'all 0.2s ease',
@@ -90,18 +90,18 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
}}
ref={ref}
>
<div className={`flex w-full items-center ${hasActions ? 'p-2 pl-3' : hasProgress ? 'px-3 py-2.5' : 'p-3'}`}>
{icon ? <div className="sn-icon mr-2 flex flex-shrink-0 items-center justify-center">{icon}</div> : null}
<div className="text-text text-sm">{toast.message}</div>
<div
className={`flex w-full flex-wrap items-center gap-2 ${
hasActions ? 'p-2 pl-3' : hasProgress ? 'px-3 py-2.5' : 'p-3'
}`}
>
{icon ? <div className="sn-icon flex flex-shrink-0 items-center justify-center">{icon}</div> : null}
<div className="text-text text-sm [word-wrap:anywhere]">{toast.message}</div>
{hasActions && (
<div className="ml-4">
<>
{toast.actions?.map((action, index) => (
<button
style={{
paddingLeft: '0.45rem',
paddingRight: '0.45rem',
}}
className={`hover:bg-passive-3 cursor-pointer rounded border-0 bg-transparent py-1 text-sm font-semibold ${colorForToastType(
className={`hover:bg-passive-3 cursor-pointer rounded border-0 py-1 px-[0.45rem] text-sm font-semibold md:bg-transparent ${colorForToastType(
toast.type,
)} ${index !== 0 ? 'ml-2' : ''}`}
onClick={() => {
@@ -112,7 +112,7 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
{action.label}
</button>
))}
</div>
</>
)}
</div>
{hasProgress && (
+1 -1
View File
@@ -11,7 +11,7 @@ export const ToastContainer: FunctionComponent = () => {
}
return (
<div className="z-toast fixed bottom-6 right-6 flex flex-col items-end">
<div className="z-toast fixed bottom-6 right-6 flex w-[calc(100%-3rem)] flex-col items-end md:w-auto">
{toasts.map((toast, index) => (
<ToastTimer toast={toast} index={index} key={toast.id} />
))}
-11
View File
@@ -55,14 +55,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
resumeTimer()
}, [resumeTimer])
const handlePageVisibility = useCallback(() => {
if (document.visibilityState === 'hidden') {
pauseTimer()
} else {
resumeTimer()
}
}, [pauseTimer, resumeTimer])
const handlePageFocus = useCallback(() => {
resumeTimer()
}, [resumeTimer])
@@ -83,7 +75,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
toastElement.addEventListener('mouseenter', handleMouseEnter)
toastElement.addEventListener('mouseleave', handleMouseLeave)
}
document.addEventListener('visibilitychange', handlePageVisibility)
window.addEventListener('focus', handlePageFocus)
window.addEventListener('blur', handlePageBlur)
@@ -93,7 +84,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
toastElement.removeEventListener('mouseenter', handleMouseEnter)
toastElement.removeEventListener('mouseleave', handleMouseLeave)
}
document.removeEventListener('visibilitychange', handlePageVisibility)
window.removeEventListener('focus', handlePageFocus)
window.removeEventListener('blur', handlePageBlur)
}
@@ -105,7 +95,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
handleMouseLeave,
handlePageBlur,
handlePageFocus,
handlePageVisibility,
resumeTimer,
shouldAutoClose,
toast.id,
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/ui-services
# 1.1.0 (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.1.0",
"version": "1.1.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+25
View File
@@ -3,6 +3,31 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.44.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
### Bug Fixes
* note tag delete button not showing on iOS ([#1403](https://github.com/standardnotes/app/issues/1403)) ([2ea9f86](https://github.com/standardnotes/app/commit/2ea9f862feb77a826af8b6ccf7cc2de1a1e50733))
## [3.44.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
### Bug Fixes
* selecting from "Photo Library" on iOS doesn't upload ([#1401](https://github.com/standardnotes/app/issues/1401)) ([54ae436](https://github.com/standardnotes/app/commit/54ae4365a344cc3c6c796a3afb6d3020f5493a6b))
## [3.44.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
### Bug Fixes
* optimize toasts for mobile ([#1392](https://github.com/standardnotes/app/issues/1392)) ([40d9392](https://github.com/standardnotes/app/commit/40d9392599e871225abcabcddd51de6cc99a0fe9))
## [3.44.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
### Bug Fixes
* tag context menu button opening notes list veiw ([#1390](https://github.com/standardnotes/app/issues/1390)) ([82a8bcc](https://github.com/standardnotes/app/commit/82a8bcc4407fce2e255b06a0c31c5fd244f5973f))
* tags being dimmed on safari ([#1389](https://github.com/standardnotes/app/issues/1389)) ([77cbb6b](https://github.com/standardnotes/app/commit/77cbb6b06e901de9e0eccee98219f946b014fe21))
## [3.44.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.44.2",
"version": "3.44.6",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -10,6 +10,7 @@ import PopoverFileItem from './PopoverFileItem'
import { PopoverFileItemActionType } from './PopoverFileItemAction'
import { PopoverTabs } from './PopoverTabs'
import { FilesController } from '@/Controllers/FilesController'
import { StreamingFileReader } from '@standardnotes/filepicker'
type Props = {
application: WebApplication
@@ -32,6 +33,8 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
setCurrentTab,
attachedTabDisabled,
}) => {
const fileInputRef = useRef<HTMLInputElement>(null)
const [searchQuery, setSearchQuery] = useState('')
const searchInputRef = useRef<HTMLInputElement>(null)
@@ -42,13 +45,9 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
? filesList.filter((file) => file.name.toLowerCase().indexOf(searchQuery.toLowerCase()) !== -1)
: filesList
const handleAttachFilesClick = async () => {
const uploadedFiles = await filesController.uploadNewFile()
if (!uploadedFiles) {
return
}
const attachFilesIfRequired = (files: FileItem[]) => {
if (currentTab === PopoverTabs.AttachedFiles) {
uploadedFiles.forEach((file) => {
files.forEach((file) => {
filesController
.handleFileAction({
type: PopoverFileItemActionType.AttachFileToNote,
@@ -59,6 +58,19 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
}
}
const handleAttachFilesClick = async () => {
if (!StreamingFileReader.available()) {
fileInputRef.current?.click()
return
}
const uploadedFiles = await filesController.uploadNewFile()
if (!uploadedFiles) {
return
}
attachFilesIfRequired(uploadedFiles)
}
const previewHandler = (file: FileItem) => {
filesController
.handleFileAction({
@@ -161,6 +173,26 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
</div>
)}
</div>
<input
type="file"
className="absolute top-0 left-0 opacity-0"
multiple
ref={fileInputRef}
onChange={async (event) => {
const files = event.currentTarget.files
if (!files) {
return
}
for (const file of files) {
const uploadedFiles = await filesController.uploadNewFile(file)
if (uploadedFiles) {
attachFilesIfRequired(uploadedFiles)
}
}
}}
/>
{filteredList.length > 0 && (
<button
className="flex w-full cursor-pointer items-center border-0 border-t border-solid border-border bg-transparent px-3 py-3 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none"
@@ -20,6 +20,7 @@ import ContentListHeader from './Header/ContentListHeader'
import ResponsivePaneContent from '../ResponsivePane/ResponsivePaneContent'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { StreamingFileReader } from '@standardnotes/filepicker'
type Props = {
accountMenuController: AccountMenuController
@@ -46,6 +47,7 @@ const ContentListView: FunctionComponent<Props> = ({
}) => {
const { toggleAppPane } = useResponsiveAppPane()
const fileInputRef = useRef<HTMLInputElement>(null)
const itemsViewPanelRef = useRef<HTMLDivElement>(null)
const {
@@ -68,7 +70,12 @@ const ContentListView: FunctionComponent<Props> = ({
const addNewItem = useCallback(async () => {
if (isFilesSmartView) {
void filesController.uploadNewFile()
if (StreamingFileReader.available()) {
void filesController.uploadNewFile()
return
}
fileInputRef.current?.click()
} else {
await createNewNote()
toggleAppPane(AppPaneId.Editor)
@@ -179,6 +186,23 @@ const ContentListView: FunctionComponent<Props> = ({
<ResponsivePaneContent paneId={AppPaneId.Items}>
<div id="items-title-bar" className="section-title-bar border-b border-solid border-border">
<div id="items-title-bar-container">
<input
type="file"
className="absolute top-0 left-0 opacity-0"
multiple
ref={fileInputRef}
onChange={(event) => {
const files = event.currentTarget.files
if (!files) {
return
}
for (const file of files) {
void filesController.uploadNewFile(file)
}
}}
/>
<ContentListHeader
application={application}
panelTitle={panelTitle}
@@ -11,6 +11,8 @@ import {
import { ViewControllerManager } from '@/Controllers/ViewControllerManager'
import { SNTag } from '@standardnotes/snjs'
import { observer } from 'mobx-react-lite'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
type Props = {
viewControllerManager: ViewControllerManager
@@ -18,6 +20,8 @@ type Props = {
}
const NoteTag = ({ viewControllerManager, tag }: Props) => {
const { toggleAppPane } = useResponsiveAppPane()
const noteTags = viewControllerManager.noteTagsController
const { autocompleteInputFocused, focusedTagUuid, tags } = noteTags
@@ -46,15 +50,17 @@ const NoteTag = ({ viewControllerManager, tag }: Props) => {
)
const onTagClick: MouseEventHandler = useCallback(
(event) => {
async (event) => {
if (tagClicked && event.target !== deleteTagRef.current) {
setTagClicked(false)
void viewControllerManager.navigationController.setSelectedTag(tag)
await viewControllerManager.navigationController.setSelectedTag(tag)
toggleAppPane(AppPaneId.Items)
} else {
setTagClicked(true)
tagRef.current?.focus()
}
},
[viewControllerManager, tagClicked, tag],
[viewControllerManager, tagClicked, tag, toggleAppPane],
)
const onFocus = useCallback(() => {
@@ -132,7 +138,7 @@ const NoteTag = ({ viewControllerManager, tag }: Props) => {
{showDeleteButton && (
<a
ref={deleteTagRef}
type="button"
role="button"
className="ml-2 -mr-1 flex cursor-pointer border-0 bg-transparent p-0"
onBlur={onBlur}
onClick={onDeleteTagClick}
@@ -70,7 +70,7 @@ const AutocompleteTagResult = ({ viewControllerManager, tagResult, closeOnBlur }
<button
ref={tagResultRef}
type="button"
className="flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-1.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:bg-info focus:text-info-contrast focus:shadow-none"
className="flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-1.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info focus:text-info-contrast focus:shadow-none"
onClick={() => onTagOptionClick(tagResult)}
onFocus={onFocus}
onBlur={onBlur}
@@ -135,17 +135,25 @@ const SmartViewsListItem: FunctionComponent<Props> = ({ view, tagsState, isColla
>
<Icon type={iconType} className={isSelected ? 'text-info' : 'text-neutral'} />
</div>
<input
className={classNames('title', isEditing ? 'editing' : '', isCollapsed ? 'hidden' : 'block')}
disabled={!isEditing}
id={`react-tag-${view.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyUp={onKeyUp}
spellCheck={false}
ref={inputRef}
/>
{isEditing ? (
<input
className={classNames('title editing', isCollapsed ? 'hidden' : 'block')}
id={`react-tag-${view.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyUp={onKeyUp}
spellCheck={false}
ref={inputRef}
/>
) : (
<div
className={classNames('title overflow-hidden text-left', isCollapsed ? 'hidden' : 'block')}
id={`react-tag-${view.uuid}`}
>
{title}
</div>
)}
<div className={classNames('count', isCollapsed ? 'absolute top-0 right-0' : '')}>
{view.uuid === SystemViewId.AllNotes && tagsState.allNotesCount}
</div>
@@ -183,20 +183,26 @@ export const TagsListItem: FunctionComponent<Props> = observer(
const readyToDrop = isOver && canDrop
const toggleContextMenu = useCallback(() => {
if (!menuButtonRef.current) {
return
}
const toggleContextMenu: MouseEventHandler<HTMLAnchorElement> = useCallback(
(event) => {
event.preventDefault()
event.stopPropagation()
const contextMenuOpen = tagsState.contextMenuOpen
const menuButtonRect = menuButtonRef.current?.getBoundingClientRect()
if (!menuButtonRef.current) {
return
}
if (contextMenuOpen) {
tagsState.setContextMenuOpen(false)
} else {
onContextMenu(tag, menuButtonRect.right, menuButtonRect.top)
}
}, [onContextMenu, tagsState, tag])
const contextMenuOpen = tagsState.contextMenuOpen
const menuButtonRect = menuButtonRef.current?.getBoundingClientRect()
if (contextMenuOpen) {
tagsState.setContextMenuOpen(false)
} else {
onContextMenu(tag, menuButtonRect.right, menuButtonRect.top)
}
},
[onContextMenu, tagsState, tag],
)
return (
<>
@@ -236,21 +242,31 @@ export const TagsListItem: FunctionComponent<Props> = observer(
>
<Icon type="hashtag" className={`${isSelected ? 'text-info' : 'text-neutral'}`} />
</div>
<input
className={classNames(
'title focus:shadow-none focus:outline-none',
isEditing ? 'editing' : '',
isCollapsed ? 'md-only:!w-min lg-only:!w-min' : '',
)}
id={`react-tag-${tag.uuid}`}
disabled={!isEditing}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyDown={onKeyDown}
spellCheck={false}
ref={inputRef}
/>
{isEditing ? (
<input
className={classNames(
'title editing focus:shadow-none focus:outline-none',
isCollapsed ? 'md-only:!w-min lg-only:!w-min' : '',
)}
id={`react-tag-${tag.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyDown={onKeyDown}
spellCheck={false}
ref={inputRef}
/>
) : (
<div
className={classNames(
'title overflow-hidden text-left focus:shadow-none focus:outline-none',
isCollapsed ? 'md-only:!w-min lg-only:!w-min' : '',
)}
id={`react-tag-${tag.uuid}`}
>
{title}
</div>
)}
<div className="flex items-center">
<a
role="button"
@@ -302,7 +302,7 @@ export class FilesController extends AbstractViewController {
const selectedFiles =
fileOrHandle instanceof File
? [fileOrHandle]
: StreamingFileReader.available() && fileOrHandle instanceof FileSystemFileHandle
: shouldUseStreamingReader && fileOrHandle instanceof FileSystemFileHandle
? await StreamingFileReader.getFilesFromHandles([fileOrHandle])
: await picker.selectFiles()
+2 -2
View File
@@ -134,7 +134,7 @@
.transparent-info-color-background {
&::after {
@include DimmedBackground(var(--sn-stylekit-info-color), .12);
@include DimmedBackground(var(--sn-stylekit-info-color), 0.12);
border-radius: 100px;
}
}
@@ -142,7 +142,7 @@
.transparent-info-color-background-hover {
&:hover {
&::after {
@extend .transparent-info-color-background
@extend .transparent-info-color-background;
}
}
}