Compare commits

...
Author SHA1 Message Date
StandardNotes CI dc22101a7c chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2024-01-27 11:16:18 +00:00
Aman Harwara 70ec1f1b54 refactor: super export modal 2024-01-27 16:17:01 +05:30
Mae B. Morella c858e516bb fix: Fixed issue with Simplenote importer not titling multi-line documents (#2798) 2024-01-27 16:08:35 +05:30
Aman Harwara 853fab53ab feat: Added "Page size" option when exporting Super notes as PDF 2024-01-27 16:04:20 +05:30
Aman Harwara ff3c45ba35 feat: Added "Keyboard shortcuts" help dialog. Can be opened by pressing Shift + ? 2024-01-27 15:25:49 +05:30
StandardNotes CI 289849724a chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2024-01-24 18:42:55 +00:00
Mae B. Morella cf0a7a6bf1 fix: Fixed issue with Simplenote importer where empty notes would not be imported (#2793) 2024-01-24 23:40:52 +05:30
StandardNotes CI cfa2e75adc chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2024-01-24 08:34:33 +00:00
Aman Harwara 418d1a7371 feat: Super notes can now be exported as PDF (#2776) 2024-01-24 13:23:38 +05:30
StandardNotes CI 813304c959 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2024-01-23 08:33:41 +00:00
Karol Sójko ba236a2f2b chore: add sync backoff mechanism checks (#2786) 2024-01-23 09:04:55 +01:00
StandardNotes CI 2757884d10 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2024-01-21 07:50:00 +00:00
Aman Harwara f2bcab6131 chore: fix issue with link editor position on iOS 2024-01-21 12:50:33 +05:30
Aman Harwara 327f732adc chore: fix changelog [skip e2e] 2024-01-21 12:35:59 +05:30
123 changed files with 1996 additions and 255 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+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.26.78](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
**Note:** Version bump only for package @standardnotes/api
## [1.26.77](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/api
## [1.26.76](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/api
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.26.76",
"version": "1.26.78",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.399](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.398](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.397](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.396](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.395](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-21)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.394](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**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.394",
"version": "1.1.399",
"private": true,
"scripts": {
"build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js",
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [3.110.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
### Features
* Added "Page size" option when exporting Super notes as PDF ([853fab5](https://github.com/standardnotes/app/commit/853fab53ab37567acc23d2f1c5bf8c8d0c4a573b))
## [3.109.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/desktop
# [3.109.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
### Features
* Super notes can now be exported as PDF ([#2776](https://github.com/standardnotes/app/issues/2776)) ([418d1a7](https://github.com/standardnotes/app/commit/418d1a7371d8fb981de80737a9d1ec4d7772476c))
## [3.108.334](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.333](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-21)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.332](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/desktop
+1 -1
View File
@@ -11,7 +11,7 @@
content="
default-src 'self' blob:;
script-src 'self' 'unsafe-eval';
worker-src blob:;
worker-src 'self' blob:;
connect-src * data: blob:;
style-src 'unsafe-inline' 'self' http://localhost:* http://127.0.0.1:45653;
frame-src * blob:;
@@ -128,7 +128,7 @@ async function configureWindow(remoteBridge: CrossProcessBridge) {
/* Use custom title bar. Take the sn-titlebar-height off of
the app content height so its not overflowing */
sheet.insertRule(
'[role="dialog"]:not(.challenge-modal) { height: calc(100vh - var(--sn-desktop-titlebar-height)) !important; margin-top: var(--sn-desktop-titlebar-height); }',
'[role="dialog"]:not(.challenge-modal) { max-height: calc(100vh - var(--sn-desktop-titlebar-height)) !important; margin-top: var(--sn-desktop-titlebar-height); }',
sheet.cssRules.length,
)
sheet.insertRule(
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.108.332",
"version": "3.110.0",
"license": "AGPL-3.0",
"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.
## [1.21.100](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.99](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.98](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/encryption
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.21.98",
"version": "1.21.100",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+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.28.115](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.114](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.113](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/filepicker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.28.113",
"version": "1.28.115",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.20.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
### Features
* Added "Page size" option when exporting Super notes as PDF ([853fab5](https://github.com/standardnotes/app/commit/853fab53ab37567acc23d2f1c5bf8c8d0c4a573b))
# [1.19.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
### Features
* Super notes can now be exported as PDF ([#2776](https://github.com/standardnotes/app/issues/2776)) ([418d1a7](https://github.com/standardnotes/app/commit/418d1a7371d8fb981de80737a9d1ec4d7772476c))
## [1.18.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/files
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.18.10",
"version": "1.20.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -1,6 +1,19 @@
import { FileItem, PrefKey, PrefValue } from '@standardnotes/models'
export interface SuperConverterServiceInterface {
isValidSuperString(superString: string): boolean
convertSuperStringToOtherFormat: (superString: string, toFormat: 'txt' | 'md' | 'html' | 'json') => Promise<string>
convertSuperStringToOtherFormat: (
superString: string,
toFormat: 'txt' | 'md' | 'html' | 'json' | 'pdf',
config?: {
embedBehavior?: PrefValue[PrefKey.SuperNoteExportEmbedBehavior]
getFileItem?: (id: string) => FileItem | undefined
getFileBase64?: (id: string) => Promise<string | undefined>
pdf?: {
pageSize?: PrefValue[PrefKey.SuperNoteExportPDFPageSize]
}
},
) => Promise<string>
convertOtherFormatToSuperString: (
otherFormatString: string,
fromFormat: 'txt' | 'md' | 'html' | 'json',
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.58.58](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.57](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.56](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.55](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.54](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-21)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.53](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.58.53",
"version": "3.58.58",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0",
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.53.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
### Features
* Added "Page size" option when exporting Super notes as PDF ([853fab5](https://github.com/standardnotes/app/commit/853fab53ab37567acc23d2f1c5bf8c8d0c4a573b))
# [1.52.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
### Features
* Super notes can now be exported as PDF ([#2776](https://github.com/standardnotes/app/issues/2776)) ([418d1a7](https://github.com/standardnotes/app/commit/418d1a7371d8fb981de80737a9d1ec4d7772476c))
# [1.51.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.51.0",
"version": "1.53.0",
"publishConfig": {
"access": "public"
},
@@ -42,6 +42,7 @@ export const PrefDefaults = {
[PrefKey.SuperNoteExportFormat]: 'json',
[PrefKey.SuperNoteExportEmbedBehavior]: 'reference',
[PrefKey.SuperNoteExportUseMDFrontmatter]: true,
[PrefKey.SuperNoteExportPDFPageSize]: 'A4',
[PrefKey.SystemViewPreferences]: {},
[PrefKey.AuthenticatorNames]: '',
[PrefKey.ComponentPreferences]: {},
@@ -43,6 +43,7 @@ export enum PrefKey {
SuperNoteExportFormat = 'superNoteExportFormat',
SuperNoteExportEmbedBehavior = 'superNoteExportEmbedBehavior',
SuperNoteExportUseMDFrontmatter = 'superNoteExportUseMDFrontmatter',
SuperNoteExportPDFPageSize = 'superNoteExportPDFPageSize',
AuthenticatorNames = 'authenticatorNames',
PaneGesturesEnabled = 'paneGesturesEnabled',
ComponentPreferences = 'componentPreferences',
@@ -87,9 +88,10 @@ export type PrefValue = {
[PrefKey.MomentsDefaultTagUuid]: string | undefined
[PrefKey.ClipperDefaultTagUuid]: string | undefined
[PrefKey.SystemViewPreferences]: Partial<Record<SystemViewId, TagPreferences>>
[PrefKey.SuperNoteExportFormat]: 'json' | 'md' | 'html'
[PrefKey.SuperNoteExportFormat]: 'json' | 'md' | 'html' | 'pdf'
[PrefKey.SuperNoteExportEmbedBehavior]: 'reference' | 'inline' | 'separate'
[PrefKey.SuperNoteExportUseMDFrontmatter]: boolean
[PrefKey.SuperNoteExportPDFPageSize]: 'A3' | 'A4' | 'LETTER' | 'LEGAL' | 'TABLOID'
[PrefKey.AuthenticatorNames]: string
[PrefKey.PaneGesturesEnabled]: boolean
[PrefKey.ComponentPreferences]: AllComponentPreferences
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.693](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.692](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.691](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.690](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.689](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-21)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.688](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.688",
"version": "1.4.693",
"license": "AGPL-3.0",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.68.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
**Note:** Version bump only for package @standardnotes/services
## [1.68.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/services
## [1.68.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/services
# [1.68.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.68.0",
"version": "1.68.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -0,0 +1,55 @@
import { AnyItemInterface } from '@standardnotes/models'
import { SyncBackoffService } from './SyncBackoffService'
describe('SyncBackoffService', () => {
const createService = () => new SyncBackoffService()
it('should not be in backoff if no backoff was set', () => {
const service = createService()
expect(service.isItemInBackoff({ uuid: '123' } as jest.Mocked<AnyItemInterface>)).toBe(false)
})
it('should be in backoff if backoff was set', () => {
const service = createService()
service.backoffItem({ uuid: '123' } as jest.Mocked<AnyItemInterface>)
expect(service.isItemInBackoff({ uuid: '123' } as jest.Mocked<AnyItemInterface>)).toBe(true)
})
it('should not be in backoff if backoff expired', () => {
const service = createService()
jest.spyOn(Date, 'now').mockReturnValueOnce(1_000_000)
service.backoffItem({ uuid: '123' } as jest.Mocked<AnyItemInterface>)
jest.spyOn(Date, 'now').mockReturnValueOnce(2_000_000)
expect(service.isItemInBackoff({ uuid: '123' } as jest.Mocked<AnyItemInterface>)).toBe(false)
})
it('should double backoff penalty on each backoff', () => {
const service = createService()
jest.spyOn(Date, 'now').mockReturnValueOnce(1_000_000)
service.backoffItem({ uuid: '123' } as jest.Mocked<AnyItemInterface>)
jest.spyOn(Date, 'now').mockReturnValueOnce(1_000_000)
expect(service.isItemInBackoff({ uuid: '123' } as jest.Mocked<AnyItemInterface>)).toBe(true)
jest.spyOn(Date, 'now').mockReturnValueOnce(1_000_000)
service.backoffItem({ uuid: '123' } as jest.Mocked<AnyItemInterface>)
jest.spyOn(Date, 'now').mockReturnValueOnce(1_001_000)
expect(service.isItemInBackoff({ uuid: '123' } as jest.Mocked<AnyItemInterface>)).toBe(true)
jest.spyOn(Date, 'now').mockReturnValueOnce(1_000_000)
service.backoffItem({ uuid: '123' } as jest.Mocked<AnyItemInterface>)
jest.spyOn(Date, 'now').mockReturnValueOnce(1_003_000)
expect(service.isItemInBackoff({ uuid: '123' } as jest.Mocked<AnyItemInterface>)).toBe(true)
})
})
@@ -0,0 +1,37 @@
import { AnyItemInterface } from '@standardnotes/models'
import { SyncBackoffServiceInterface } from './SyncBackoffServiceInterface'
export class SyncBackoffService implements SyncBackoffServiceInterface {
private backoffPenalties: Map<string, number>
private backoffStartTimestamps: Map<string, number>
constructor() {
this.backoffPenalties = new Map<string, number>()
this.backoffStartTimestamps = new Map<string, number>()
}
isItemInBackoff(item: AnyItemInterface): boolean {
const backoffStartingTimestamp = this.backoffStartTimestamps.get(item.uuid)
if (!backoffStartingTimestamp) {
return false
}
const backoffPenalty = this.backoffPenalties.get(item.uuid)
if (!backoffPenalty) {
return false
}
const backoffEndTimestamp = backoffStartingTimestamp + backoffPenalty
return backoffEndTimestamp > Date.now()
}
backoffItem(item: AnyItemInterface): void {
const backoffPenalty = this.backoffPenalties.get(item.uuid) || 0
const newBackoffPenalty = backoffPenalty === 0 ? 1_000 : backoffPenalty * 2
this.backoffPenalties.set(item.uuid, newBackoffPenalty)
this.backoffStartTimestamps.set(item.uuid, Date.now())
}
}
@@ -0,0 +1,6 @@
import { AnyItemInterface } from '@standardnotes/models'
export interface SyncBackoffServiceInterface {
isItemInBackoff(item: AnyItemInterface): boolean
backoffItem(item: AnyItemInterface): void
}
+2
View File
@@ -181,6 +181,8 @@ export * from './Subscription/AppleIAPReceipt'
export * from './Subscription/SubscriptionManager'
export * from './Subscription/SubscriptionManagerEvent'
export * from './Subscription/SubscriptionManagerInterface'
export * from './Sync/SyncBackoffService'
export * from './Sync/SyncBackoffServiceInterface'
export * from './Sync/SyncMode'
export * from './Sync/SyncOpStatus'
export * from './Sync/SyncOptions'
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [2.206.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
### Features
* Added "Keyboard shortcuts" help dialog. Can be opened by pressing Shift + ? ([ff3c45b](https://github.com/standardnotes/app/commit/ff3c45ba359fb53520310c2c44bd368255e31023))
## [2.205.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/snjs
## [2.205.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/snjs
# [2.205.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
### Features
@@ -145,6 +145,8 @@ import {
IsVaultAdmin,
IsReadonlyVaultMember,
DesignateSurvivor,
SyncBackoffService,
SyncBackoffServiceInterface,
} from '@standardnotes/services'
import { ItemManager } from '../../Services/Items/ItemManager'
import { PayloadManager } from '../../Services/Payloads/PayloadManager'
@@ -1351,6 +1353,10 @@ export class Dependencies {
)
})
this.factory.set(TYPES.SyncBackoffService, () => {
return new SyncBackoffService()
})
this.factory.set(TYPES.SyncService, () => {
return new SyncService(
this.get<ItemManager>(TYPES.ItemManager),
@@ -1369,6 +1375,7 @@ export class Dependencies {
this.get<Logger>(TYPES.Logger),
this.get<WebSocketsService>(TYPES.WebSocketsService),
this.get<SyncFrequencyGuardInterface>(TYPES.SyncFrequencyGuard),
this.get<SyncBackoffServiceInterface>(TYPES.SyncBackoffService),
this.get<InternalEventBus>(TYPES.InternalEventBus),
)
})
@@ -30,6 +30,7 @@ export const TYPES = {
SubscriptionManager: Symbol.for('SubscriptionManager'),
HistoryManager: Symbol.for('HistoryManager'),
SyncFrequencyGuard: Symbol.for('SyncFrequencyGuard'),
SyncBackoffService: Symbol.for('SyncBackoffService'),
SyncService: Symbol.for('SyncService'),
ProtectionService: Symbol.for('ProtectionService'),
UserService: Symbol.for('UserService'),
+1 -1
View File
@@ -9,7 +9,7 @@ export function platformFromString(string: string) {
'windows-web': Platform.WindowsWeb,
'windows-desktop': Platform.WindowsDesktop,
'ios-web': Platform.Ios,
android: Platform.Android,
'android-web': Platform.Android,
}
return map[string]
}
@@ -86,6 +86,7 @@ import {
ApplicationSyncOptions,
WebSocketsServiceEvent,
WebSocketsService,
SyncBackoffServiceInterface,
} from '@standardnotes/services'
import { OfflineSyncResponse } from './Offline/Response'
import {
@@ -171,6 +172,7 @@ export class SyncService
private logger: LoggerInterface,
private sockets: WebSocketsService,
private syncFrequencyGuard: SyncFrequencyGuardInterface,
private syncBackoffService: SyncBackoffServiceInterface,
protected override internalEventBus: InternalEventBusInterface,
) {
super(internalEventBus)
@@ -452,7 +454,11 @@ export class SyncService
}
private itemsNeedingSync() {
return this.itemManager.getDirtyItems()
const dirtyItems = this.itemManager.getDirtyItems()
const itemsWithoutBackoffPenalty = dirtyItems.filter((item) => !this.syncBackoffService.isItemInBackoff(item))
return itemsWithoutBackoffPenalty
}
public async markAllItemsAsNeedingSyncAndPersist(): Promise<void> {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.205.0",
"version": "2.206.0",
"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.5.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
### Features
* Super notes can now be exported as PDF ([#2776](https://github.com/standardnotes/app/issues/2776)) ([418d1a7](https://github.com/standardnotes/app/commit/418d1a7371d8fb981de80737a9d1ec4d7772476c))
## [1.4.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/toast
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/toast",
"version": "1.4.2",
"version": "1.5.0",
"private": true,
"main": "./src/index.ts",
"scripts": {
+2 -2
View File
@@ -90,8 +90,8 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
}}
ref={ref}
>
<div className="grid gap-x-2.5 gap-y-1 overflow-hidden grid-cols-[1fr,auto] pl-3 pr-3.5 py-2.5">
{icon ? <div className="sn-icon flex flex-shrink-0 items-center justify-center">{icon}</div> : null}
<div className="grid gap-x-2.5 gap-y-1 overflow-hidden grid-cols-[min-content,auto] pl-3 pr-3.5 py-2.5">
{icon ? <div className="sn-icon flex items-center justify-center">{icon}</div> : null}
{toast.title && <div className="text-text text-sm font-semibold col-start-2">{toast.title}</div>}
<div className="text-text text-sm [word-wrap:anywhere] col-start-2">{toast.message}</div>
{hasActions && (
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.36.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
### Bug Fixes
* Fixed issue with Simplenote importer not titling multi-line documents ([#2798](https://github.com/standardnotes/app/issues/2798)) ([c858e51](https://github.com/standardnotes/app/commit/c858e516bb20096d15ef1bcd4fa9c5c60ae8301d))
### Features
* Added "Keyboard shortcuts" help dialog. Can be opened by pressing Shift + ? ([ff3c45b](https://github.com/standardnotes/app/commit/ff3c45ba359fb53520310c2c44bd368255e31023))
## [1.35.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
### Bug Fixes
* Fixed issue with Simplenote importer where empty notes would not be imported ([#2793](https://github.com/standardnotes/app/issues/2793)) ([cf0a7a6](https://github.com/standardnotes/app/commit/cf0a7a6bf1dec2ad33334310185e99200b31f5b1))
## [1.35.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.35.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.35.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/ui-services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.35.20",
"version": "1.36.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -40,7 +40,7 @@ describe('SimplenoteConverter', () => {
expect(result?.[1].uuid).not.toBeNull()
expect(result?.[1].content_type).toBe('Note')
expect(result?.[1].content.title).toBe('Testing 2')
expect(result?.[1].content.text).toBe("This is the 2nd note's content.")
expect(result?.[1].content.text).toBe("This is...\r\nthe 2nd note's content.")
expect(result?.[1].content.trashed).toBe(false)
expect(result?.[2].created_at).toBeInstanceOf(Date)
@@ -12,7 +12,19 @@ type SimplenoteData = {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const isSimplenoteEntry = (entry: any): boolean => entry.id && entry.content && entry.creationDate && entry.lastModified
const isSimplenoteEntry = (entry: any): boolean =>
entry.id && entry.content != undefined && entry.creationDate && entry.lastModified
const splitAtFirst = (str: string, delim: string): [string, string] | [] => {
const indexOfDelimiter = str.indexOf(delim)
const hasDelimiter = indexOfDelimiter > -1
if (!hasDelimiter) {
return []
}
const before = str.slice(0, indexOfDelimiter)
const after = str.slice(indexOfDelimiter + delim.length)
return [before, after]
}
export class SimplenoteConverter implements Converter {
constructor() {}
@@ -57,17 +69,15 @@ export class SimplenoteConverter implements Converter {
const createdAtDate = new Date(item.creationDate)
const updatedAtDate = new Date(item.lastModified)
const splitItemContent = item.content.split('\r\n')
const hasTitleAndContent = splitItemContent.length === 2
const title =
hasTitleAndContent && splitItemContent[0].length ? splitItemContent[0] : createdAtDate.toLocaleString()
const content = hasTitleAndContent && splitItemContent[1].length ? splitItemContent[1] : item.content
const splitContent = splitAtFirst(item.content, '\r\n')
const title = splitContent[0] ?? createdAtDate.toLocaleString()
const text = splitContent[1] ?? item.content
return createNote({
createdAt: createdAtDate,
updatedAt: updatedAtDate,
title,
text: content,
text,
trashed,
useSuperIfPossible: true,
})
@@ -2,7 +2,7 @@ const data = {
activeNotes: [
{
id: '43349052-4efa-48c2-bdd6-8323124451b1',
content: "Testing 2\r\nThis is the 2nd note's content.",
content: "Testing 2\r\nThis is...\r\nthe 2nd note's content.",
creationDate: '2020-06-08T21:28:43.856Z',
lastModified: '2021-04-16T06:21:53.124Z',
},
@@ -1,7 +1,10 @@
import { KeyboardCommand } from './KeyboardCommands'
import { KeyboardShortcutCategory } from './KeyboardShortcut'
export type KeyboardCommandHandler = {
command: KeyboardCommand
category?: KeyboardShortcutCategory
description?: string
onKeyDown?: (event: KeyboardEvent, data?: unknown) => boolean | void
onKeyUp?: (event: KeyboardEvent, data?: unknown) => boolean | void
element?: HTMLElement
@@ -39,3 +39,5 @@ export const SUPER_EXPORT_MARKDOWN = createKeyboardCommand('SUPER_EXPORT_MARKDOW
export const OPEN_PREFERENCES_COMMAND = createKeyboardCommand('OPEN_PREFERENCES_COMMAND')
export const CHANGE_EDITOR_WIDTH_COMMAND = createKeyboardCommand('CHANGE_EDITOR_WIDTH_COMMAND')
export const TOGGLE_KEYBOARD_SHORTCUTS_MODAL = createKeyboardCommand('TOGGLE_KEYBOARD_SHORTCUTS_MODAL')
@@ -1,3 +1,6 @@
import { Platform } from '@standardnotes/models'
import { isMacPlatform } from './platformCheck'
export enum KeyboardModifier {
Shift = 'Shift',
Ctrl = 'Control',
@@ -5,3 +8,7 @@ export enum KeyboardModifier {
Meta = 'Meta',
Alt = 'Alt',
}
export function getPrimaryModifier(platform: Platform): KeyboardModifier {
return isMacPlatform(platform) ? KeyboardModifier.Meta : KeyboardModifier.Ctrl
}
@@ -4,7 +4,7 @@ import { KeyboardCommand } from './KeyboardCommands'
import { KeyboardKeyEvent } from './KeyboardKeyEvent'
import { KeyboardModifier } from './KeyboardModifier'
import { KeyboardCommandHandler } from './KeyboardCommandHandler'
import { KeyboardShortcut, PlatformedKeyboardShortcut } from './KeyboardShortcut'
import { KeyboardShortcut, KeyboardShortcutHelpItem, PlatformedKeyboardShortcut } from './KeyboardShortcut'
import { getKeyboardShortcuts } from './getKeyboardShortcuts'
export class KeyboardService {
@@ -12,6 +12,8 @@ export class KeyboardService {
private commandHandlers = new Set<KeyboardCommandHandler>()
private commandMap = new Map<KeyboardCommand, KeyboardShortcut>()
private keyboardShortcutHelpItems = new Set<KeyboardShortcutHelpItem>()
constructor(
private platform: Platform,
environment: Environment,
@@ -190,10 +192,18 @@ export class KeyboardService {
addCommandHandler(observer: KeyboardCommandHandler): () => void {
this.commandHandlers.add(observer)
const helpItem = this.getKeyboardShortcutHelpItemForHandler(observer)
if (helpItem) {
this.keyboardShortcutHelpItems.add(helpItem)
}
return () => {
observer.onKeyDown = undefined
observer.onKeyDown = undefined
this.commandHandlers.delete(observer)
if (helpItem) {
this.keyboardShortcutHelpItems.delete(helpItem)
}
}
}
@@ -217,4 +227,48 @@ export class KeyboardService {
...shortcut,
}
}
getKeyboardShortcutHelpItemForHandler(handler: KeyboardCommandHandler): KeyboardShortcutHelpItem | undefined {
const shortcut = this.keyboardShortcutForCommand(handler.command)
if (!shortcut || !handler.category || !handler.description) {
return undefined
}
return {
...shortcut,
category: handler.category,
description: handler.description,
}
}
/**
* Register help item for a keyboard shortcut that is handled outside of the KeyboardService,
* for example by a library like Lexical.
*/
registerExternalKeyboardShortcutHelpItem(item: KeyboardShortcutHelpItem): () => void {
this.keyboardShortcutHelpItems.add(item)
return () => {
this.keyboardShortcutHelpItems.delete(item)
}
}
/**
* Register help item for a keyboard shortcut that is handled outside of the KeyboardService,
* for example by a library like Lexical.
*/
registerExternalKeyboardShortcutHelpItems(items: KeyboardShortcutHelpItem[]): () => void {
const disposers = items.map((item) => this.registerExternalKeyboardShortcutHelpItem(item))
return () => {
for (const disposer of disposers) {
disposer()
}
}
}
getRegisteredKeyboardShorcutHelpItems(): KeyboardShortcutHelpItem[] {
return Array.from(this.keyboardShortcutHelpItems)
}
}
@@ -18,3 +18,10 @@ export type KeyboardShortcut = {
export type PlatformedKeyboardShortcut = KeyboardShortcut & {
platform: Platform
}
export type KeyboardShortcutCategory = 'General' | 'Notes list' | 'Current note' | 'Super notes' | 'Formatting'
export type KeyboardShortcutHelpItem = Omit<PlatformedKeyboardShortcut, 'command'> & {
category: KeyboardShortcutCategory
description: string
}
@@ -1,5 +1,4 @@
import { Environment, Platform } from '@standardnotes/models'
import { isMacPlatform } from './platformCheck'
import {
CREATE_NEW_NOTE_KEYBOARD_COMMAND,
TOGGLE_LIST_PANE_KEYBOARD_COMMAND,
@@ -31,15 +30,14 @@ import {
SUPER_SEARCH_TOGGLE_REPLACE_MODE,
CHANGE_EDITOR_WIDTH_COMMAND,
SUPER_TOGGLE_TOOLBAR,
TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
} from './KeyboardCommands'
import { KeyboardKey } from './KeyboardKey'
import { KeyboardModifier } from './KeyboardModifier'
import { KeyboardModifier, getPrimaryModifier } from './KeyboardModifier'
import { KeyboardShortcut } from './KeyboardShortcut'
export function getKeyboardShortcuts(platform: Platform, _environment: Environment): KeyboardShortcut[] {
const isMac = isMacPlatform(platform)
const primaryModifier = isMac ? KeyboardModifier.Meta : KeyboardModifier.Ctrl
const primaryModifier = getPrimaryModifier(platform)
return [
{
@@ -195,5 +193,11 @@ export function getKeyboardShortcuts(platform: Platform, _environment: Environme
modifiers: [primaryModifier, KeyboardModifier.Shift],
preventDefault: true,
},
{
command: TOGGLE_KEYBOARD_SHORTCUTS_MODAL,
key: '?',
preventDefault: true,
modifiers: [KeyboardModifier.Shift],
},
]
}
@@ -0,0 +1,20 @@
export function keyboardCharacterForKeyOrCode(keyOrCode: string) {
if (keyOrCode.startsWith('Digit')) {
return keyOrCode.replace('Digit', '')
}
if (keyOrCode.startsWith('Key')) {
return keyOrCode.replace('Key', '')
}
switch (keyOrCode) {
case 'ArrowDown':
return '↓'
case 'ArrowUp':
return '↑'
case 'ArrowLeft':
return '←'
case 'ArrowRight':
return '→'
default:
return keyOrCode
}
}
+1
View File
@@ -10,6 +10,7 @@ export * from './Keyboard/KeyboardCommands'
export * from './Keyboard/platformCheck'
export * from './Keyboard/KeyboardKey'
export * from './Keyboard/KeyboardModifier'
export * from './Keyboard/keyboardCharacterForKey'
export * from './Keyboard/keyboardCharacterForModifier'
export * from './Keyboard/keyboardStringForShortcut'
export * from './Route/Params/DemoParams'
+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.187.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)
### Features
* Added "Keyboard shortcuts" help dialog. Can be opened by pressing Shift + ? ([ff3c45b](https://github.com/standardnotes/app/commit/ff3c45ba359fb53520310c2c44bd368255e31023))
* Added "Page size" option when exporting Super notes as PDF ([853fab5](https://github.com/standardnotes/app/commit/853fab53ab37567acc23d2f1c5bf8c8d0c4a573b))
## [3.186.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
**Note:** Version bump only for package @standardnotes/web
# [3.186.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)
### Features
* Super notes can now be exported as PDF ([#2776](https://github.com/standardnotes/app/issues/2776)) ([418d1a7](https://github.com/standardnotes/app/commit/418d1a7371d8fb981de80737a9d1ec4d7772476c))
## [3.185.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)
**Note:** Version bump only for package @standardnotes/web
## [3.185.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-21)
**Note:** Version bump only for package @standardnotes/web
## [3.185.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)
**Note:** Version bump only for package @standardnotes/web
+63
View File
@@ -1,5 +1,68 @@
{
"versions": [
{
"version": "3.187.0",
"title": "[3.187.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-27)",
"date": null,
"body": "### Features\n\n* Added \"Keyboard shortcuts\" help dialog. Can be opened by pressing Shift + ? ([ff3c45b](https://github.com/standardnotes/app/commit/ff3c45ba359fb53520310c2c44bd368255e31023))\n* Added \"Page size\" option when exporting Super notes as PDF ([853fab5](https://github.com/standardnotes/app/commit/853fab53ab37567acc23d2f1c5bf8c8d0c4a573b))",
"parsed": {
"_": [
"Added \"Keyboard shortcuts\" help dialog. Can be opened by pressing Shift + ? (ff3c45b)",
"Added \"Page size\" option when exporting Super notes as PDF (853fab5)"
],
"Features": [
"Added \"Keyboard shortcuts\" help dialog. Can be opened by pressing Shift + ? (ff3c45b)",
"Added \"Page size\" option when exporting Super notes as PDF (853fab5)"
]
}
},
{
"version": "3.186.1",
"title": "[3.186.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.186.0",
"title": "[3.186.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-24)",
"date": null,
"body": "### Features\n\n* Super notes can now be exported as PDF ([#2776](https://github.com/standardnotes/app/issues/2776)) ([418d1a7](https://github.com/standardnotes/app/commit/418d1a7371d8fb981de80737a9d1ec4d7772476c))",
"parsed": {
"_": [
"Super notes can now be exported as PDF (#2776) (418d1a7)"
],
"Features": [
"Super notes can now be exported as PDF (#2776) (418d1a7)"
]
}
},
{
"version": "3.185.4",
"title": "[3.185.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-23)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.185.3",
"title": "[3.185.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-21)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.185.2",
"title": "[3.185.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-20)",
+3 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.185.2",
"version": "3.187.0",
"license": "AGPL-3.0",
"main": "dist/app.js",
"author": "Standard Notes",
@@ -111,6 +111,8 @@
"@ariakit/react": "^0.3.9",
"@lexical/headless": "0.12.6",
"@radix-ui/react-slot": "^1.0.1",
"@react-pdf/renderer": "^3.3.2",
"comlink": "^4.4.1",
"fast-diff": "^1.3.0"
}
}
@@ -13,6 +13,8 @@ import Spinner from '@/Components/Spinner/Spinner'
import { MenuItemIconSize } from '@/Constants/TailwindClassNames'
import { useApplication } from '../ApplicationProvider'
import MenuSection from '../Menu/MenuSection'
import { TOGGLE_KEYBOARD_SHORTCUTS_MODAL, isMobilePlatform } from '@standardnotes/ui-services'
import { KeyboardShortcutIndicator } from '../KeyboardShortcutIndicator/KeyboardShortcutIndicator'
type Props = {
mainApplicationGroup: WebApplicationGroup
@@ -90,6 +92,10 @@ const GeneralAccountMenu: FunctionComponent<Props> = ({ setMenuPane, closeMenu,
const CREATE_ACCOUNT_INDEX = 1
const SWITCHER_INDEX = 0
const keyboardShortcutsHelpShortcut = useMemo(() => {
return application.keyboardService.keyboardShortcutForCommand(TOGGLE_KEYBOARD_SHORTCUTS_MODAL)
}, [application.keyboardService])
return (
<>
<div className="mb-1 mt-1 hidden items-center justify-between px-4 md:flex md:px-3">
@@ -187,6 +193,19 @@ const GeneralAccountMenu: FunctionComponent<Props> = ({ setMenuPane, closeMenu,
</div>
<span className="text-neutral">v{application.version}</span>
</MenuItem>
{!isMobilePlatform(application.platform) && (
<MenuItem
onClick={() => {
application.keyboardService.triggerCommand(TOGGLE_KEYBOARD_SHORTCUTS_MODAL)
}}
>
<Icon type="keyboard" className={iconClassName} />
Keyboard shortcuts
{keyboardShortcutsHelpShortcut && (
<KeyboardShortcutIndicator shortcut={keyboardShortcutsHelpShortcut} className="ml-auto" />
)}
</MenuItem>
)}
</MenuSection>
{user ? (
<MenuSection>
@@ -31,6 +31,7 @@ import ImportModal from '../ImportModal/ImportModal'
import IosKeyboardClose from '../IosKeyboardClose/IosKeyboardClose'
import EditorWidthSelectionModalWrapper from '../EditorWidthSelectionModal/EditorWidthSelectionModal'
import { ProtectionEvent } from '@standardnotes/services'
import KeyboardShortcutsModal from '../KeyboardShortcutsHelpModal/KeyboardShortcutsHelpModal'
type Props = {
application: WebApplication
@@ -267,6 +268,7 @@ const ApplicationView: FunctionComponent<Props> = ({ application, mainApplicatio
<EditorWidthSelectionModalWrapper />
<ConfirmDeleteAccountContainer application={application} />
<ImportModal importModalController={application.importModalController} />
<KeyboardShortcutsModal keyboardService={application.keyboardService} />
</>
{application.routeService.isDotOrg && <DotOrgNotice />}
{isIOS() && <IosKeyboardClose />}
@@ -57,6 +57,8 @@ const ChangeEditorButton: FunctionComponent<Props> = ({ noteViewController, onCl
useEffect(() => {
return application.keyboardService.addCommandHandler({
command: CHANGE_EDITOR_COMMAND,
category: 'Current note',
description: 'Change note type',
onKeyDown: () => {
void toggleMenu()
},
@@ -178,6 +178,8 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
return application.keyboardService.addCommandHandlers([
{
command: CREATE_NEW_NOTE_KEYBOARD_COMMAND,
category: 'General',
description: 'Create new note',
onKeyDown: (event) => {
event.preventDefault()
void addNewItem()
@@ -185,6 +187,8 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
},
{
command: NEXT_LIST_ITEM_KEYBOARD_COMMAND,
category: 'Notes list',
description: 'Go to next item',
elements: [document.body, ...(searchBarElement ? [searchBarElement] : [])],
onKeyDown: () => {
if (searchBarElement === document.activeElement) {
@@ -198,6 +202,8 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
},
{
command: PREVIOUS_LIST_ITEM_KEYBOARD_COMMAND,
category: 'Notes list',
description: 'Go to previous item',
element: document.body,
onKeyDown: () => {
if (shouldUseTableView) {
@@ -208,6 +214,8 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
},
{
command: SEARCH_KEYBOARD_COMMAND,
category: 'General',
description: 'Toggle global search',
onKeyDown: (event) => {
if (searchBarElement) {
event.preventDefault()
@@ -225,6 +233,8 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
},
{
command: SELECT_ALL_ITEMS_KEYBOARD_COMMAND,
category: 'General',
description: 'Select all items',
onKeyDown: (event) => {
const isTargetInsideContentList = (event.target as HTMLElement).closest(`#${ElementIds.ContentList}`)

Some files were not shown because too many files have changed in this diff Show More