Compare commits

...
28 changed files with 115 additions and 26 deletions
+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.20.24](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/api
## [1.20.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/api
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.20.23",
"version": "1.20.24",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.
## [3.104.54](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.53](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**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.104.53",
"version": "3.104.54",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+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.19.29](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/encryption
## [1.19.28](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/encryption
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.19.28",
"version": "1.19.29",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.27.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.27.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/filepicker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.27.6",
"version": "1.27.7",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.14.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/files
## [1.14.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/files
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.14.5",
"version": "1.14.6",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.
## [3.49.51](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/mobile
## [3.49.50](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.49.50",
"version": "3.49.51",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+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.40.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/models
# [1.40.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.40.0",
"version": "1.40.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -7,6 +7,7 @@ export interface SortableItem {
userModifiedDate: Date
title?: string
pinned: boolean
decryptedSize?: number
}
export const CollectionSort: Record<string, keyof SortableItem> = {
+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.4.77](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.76](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.76",
"version": "1.4.77",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+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.50.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/services
## [1.50.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.50.11",
"version": "1.50.12",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.
## [2.156.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/snjs
## [2.156.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/snjs
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.156.13",
"version": "2.156.14",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.21.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.21.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/ui-services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.21.2",
"version": "1.21.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.
## [3.129.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
**Note:** Version bump only for package @standardnotes/web
# [3.129.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)
### Features
+11
View File
@@ -1,5 +1,16 @@
{
"versions": [
{
"version": "3.129.1",
"title": "[3.129.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.129.0",
"title": "[3.129.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-12-27)",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.129.0",
"version": "3.129.1",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -182,6 +182,9 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
}
}, [isFilesSmartView, filesController, createNewNote, toggleAppPane, application])
const isFilesTableViewEnabled = featureTrunkEnabled(FeatureTrunkName.FilesTableView)
const shouldShowFilesTableView = isFilesTableViewEnabled && selectedTag?.uuid === SystemViewId.Files
useEffect(() => {
const searchBarElement = document.getElementById(ElementIds.SearchBar)
/**
@@ -204,6 +207,9 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
if (searchBarElement === document.activeElement) {
searchBarElement?.blur()
}
if (shouldShowFilesTableView) {
return
}
selectNextItem()
},
},
@@ -211,6 +217,9 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
command: PREVIOUS_LIST_ITEM_KEYBOARD_COMMAND,
element: document.body,
onKeyDown: () => {
if (shouldShowFilesTableView) {
return
}
selectPreviousItem()
},
},
@@ -252,6 +261,7 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
selectNextItem,
selectPreviousItem,
selectionController,
shouldShowFilesTableView,
])
const shortcutForCreate = useMemo(
@@ -285,9 +295,6 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
}
}, [selectedUuids, innerRef, isCurrentNoteTemplate, renderedItems, panes])
const isFilesTableViewEnabled = featureTrunkEnabled(FeatureTrunkName.FilesTableView)
const shouldShowFilesTableView = isFilesTableViewEnabled && selectedTag?.uuid === SystemViewId.Files
return (
<div
id={id}
@@ -12,6 +12,7 @@ import {
ApplicationEvent,
naturalSort,
FileBackupRecord,
SystemViewId,
} from '@standardnotes/snjs'
import { useState, useEffect, useCallback, useMemo, useRef } from 'react'
import { FileItemActionType } from '../AttachedFilesPopover/PopoverFileItemAction'
@@ -166,26 +167,46 @@ const FilesTableView = ({ application, filesController, featuresController, link
.getDisplayableNotesAndFiles()
.filter((item) => item.content_type === ContentType.File) as FileItem[]
const [sortBy, setSortBy] = useState<keyof SortableItem>(
application.getPreference(PrefKey.SortNotesBy, PrefDefaults[PrefKey.SortNotesBy]),
)
const [sortReversed, setSortReversed] = useState(
application.getPreference(PrefKey.SortNotesReverse, PrefDefaults[PrefKey.SortNotesReverse]),
)
const getSortByPreference = useCallback(() => {
const globalPrefValue = application.getPreference(PrefKey.SortNotesBy, PrefDefaults[PrefKey.SortNotesBy])
const filesViewPrefValue = application.getPreference(PrefKey.SystemViewPreferences)?.[SystemViewId.Files]?.sortBy
return filesViewPrefValue ?? globalPrefValue
}, [application])
const getSortReversedPreference = useCallback(() => {
const globalPrefValue = application.getPreference(PrefKey.SortNotesReverse, PrefDefaults[PrefKey.SortNotesReverse])
const filesViewPrefValue = application.getPreference(PrefKey.SystemViewPreferences)?.[SystemViewId.Files]
?.sortReverse
return filesViewPrefValue ?? globalPrefValue
}, [application])
const [sortBy, setSortBy] = useState<keyof SortableItem>(() => getSortByPreference())
const [sortReversed, setSortReversed] = useState(() => getSortReversedPreference())
useEffect(() => {
return application.addEventObserver(async (event) => {
if (event === ApplicationEvent.PreferencesChanged) {
setSortBy(application.getPreference(PrefKey.SortNotesBy, PrefDefaults[PrefKey.SortNotesBy]))
setSortReversed(application.getPreference(PrefKey.SortNotesReverse, PrefDefaults[PrefKey.SortNotesReverse]))
setSortBy(getSortByPreference())
setSortReversed(getSortReversedPreference())
}
})
}, [application])
}, [application, getSortByPreference, getSortReversedPreference])
const onSortChange = useCallback(
async (sortBy: keyof SortableItem, sortReversed: boolean) => {
await application.setPreference(PrefKey.SortNotesBy, sortBy)
await application.setPreference(PrefKey.SortNotesReverse, sortReversed)
const systemViewPreferences = application.getPreference(PrefKey.SystemViewPreferences) || {}
const filesViewPreferences = systemViewPreferences[SystemViewId.Files] || {}
await application.setPreference(PrefKey.SystemViewPreferences, {
...systemViewPreferences,
[SystemViewId.Files]: {
...filesViewPreferences,
sortBy,
sortReverse: sortReversed,
},
})
},
[application],
)
@@ -214,6 +235,7 @@ const FilesTableView = ({ application, filesController, featuresController, link
},
{
name: 'Size',
sortBy: 'decryptedSize',
cell: (file) => {
return formatSizeToReadableString(file.decryptedSize)
},