Compare commits

...
Author SHA1 Message Date
StandardNotes CI c48e2c22b6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].3
2023-01-16 19:30:53 +00:00
Aman Harwara 92ef778b7a Merge branch 'main' of github.com:standardnotes/app 2023-01-17 00:33:29 +05:30
Aman Harwara 11dde8d03d refactor: alert close button 2023-01-17 00:33:20 +05:30
moughxyz 3b66448ece docs: improve docker guide 2023-01-16 12:44:57 -06:00
StandardNotes CI 1d39148608 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
2023-01-16 18:42:00 +00:00
Aman Harwara 029c74cc1f Merge branch 'main' of github.com:standardnotes/app 2023-01-16 23:46:00 +05:30
Aman Harwara 85f19fb9a9 refactor: super search style 2023-01-16 23:45:52 +05:30
StandardNotes CI e8986f1b76 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
2023-01-16 18:05:51 +00:00
Aman Harwara 392335899a fix: Fixed issue where opening a Super note would change its modified date (skip e2e) 2023-01-16 23:20:59 +05:30
moughxyz 2f07f7a3d1 test: refactor flakey test to use app context 2023-01-16 09:53:39 -06:00
Karol Sójko 854f1654d1 Revert "fix(snjs): missing deinit procedures in application tests"
This reverts commit 939012b2a1.
2023-01-16 15:46:46 +01:00
Aman Harwara 5c1e7104ff Merge branch 'main' of github.com:standardnotes/app 2023-01-16 19:52:20 +05:30
Aman Harwara bb6e655d2f refactor: alert styles 2023-01-16 19:52:10 +05:30
Karol Sójko 939012b2a1 fix(snjs): missing deinit procedures in application tests 2023-01-16 14:12:59 +01:00
Aman Harwara dfa0e164bb chore: fix copy 2023-01-16 14:43:56 +05:30
Aman Harwara 094eaad943 chore: make version indicators non-selectable 2023-01-16 14:42:57 +05:30
34 changed files with 361 additions and 192 deletions
+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.
## [3.104.88](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.87](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.86](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.85](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-12)
**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.85",
"version": "3.104.88",
"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.
## [0.2.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/docs
## [0.2.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-10)
**Note:** Version bump only for package @standardnotes/docs
+11 -13
View File
@@ -21,6 +21,8 @@ This guide walks you through the process of installing the self-hosted backend o
Due to mounted volumes, we recommend running the setup as a root user. If you wish to run it as a non-root user, please see Docker's [post-installation steps for Linux](https://docs.docker.com/engine/install/linux-postinstall#manage-docker-as-a-non-root-user).
If you're self-hosting on an OS other than Linux, skip to the [installation](/self-hosting/docker#install-standard-notes) instructions below.
## Prerequisities
1. Update your `apt` repositories and upgrade any out-of-date packages:
@@ -168,29 +170,25 @@ Due to mounted volumes, we recommend running the setup as a root user. If you wi
./server.sh generate-keys
```
1. (Optional) Restart the server:
2. **Customize ports and endpoints**:
- By default, the server will run on port `3000`. If you have a different service running on that port, you can customize the port on which you want to run the infrastructure by editing the `EXPOSED_PORT` variable in the `.env` file.
- Edit `FILES_SERVER_URL` to the final public-facing URL of your server. For example, if you are self-hosting on a server on your local network which you know has an IP of 10.0.1.2, set this value to http://10.0.1.2:3125. Read more about [configuring your setup for files.](/self-hosting/file-uploads)
3. Start the Standard Notes server process:
```shell
reboot
```
1. (Optional) By default, the syncing server will run on port `3000`. If you have a different service running on that port, you can customize the port on which you want to run the infrastructure by editing the `EXPOSED_PORT` variable in the `.env` file.
1. Once the server has finished rebooting, log back into the server and start the Standard Notes server process:
```shell
cd self-hosted
./server.sh start
```
Docker will start outputting lots of information about the containers it is pulling in and installing. This process took about 8 minutes on a Ubuntu 20.04 server with 2GB RAM and 1 CPU.
1. Once Docker has finished installing, the Standard Notes install script will output:
4. Once Docker has finished installing, the Standard Notes install script will output:
```plaintext
Infrastructure started. Give it a moment to warm up. If you wish, please run the './server.sh logs' command to see details.
```
1. Check the status of your server:
5. Check the status of your server:
```shell
./server.sh status
@@ -213,7 +211,7 @@ Due to mounted volumes, we recommend running the setup as a root user. If you wi
Your Standard Notes server is ready once all the services have a `STATUS` of `Up`. This process took about 11 minutes on a Ubuntu 20.04 server with 2GB RAM and 1 CPU. If you want to control when this process finishes you can run `./server.sh wait-for-startup`.
1. You should be able now to check that the syncing server is running by checking `http://localhost:3000/healthcheck`. You must do this on the server:
6. You should be able now to check that the syncing server is running by checking `http://localhost:3000/healthcheck`. You must do this on the server:
```bash
curl http://localhost:3000/healthcheck
@@ -222,7 +220,7 @@ Due to mounted volumes, we recommend running the setup as a root user. If you wi
If you changed the `EXPOSED_PORT` variable, check `http://localhost:{EXPOSED_PORT}/healthcheck`.
1. You're done!
7. You're done!
## Securing your server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/docs",
"version": "0.2.8",
"version": "0.2.9",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+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.
## [3.50.24](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-12)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.50.21",
"version": "3.50.24",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+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.4.111](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.110](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.109](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.108](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-12)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.108",
"version": "1.4.111",
"license": "AGPL-3.0-or-later",
"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.
## [2.163.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/snjs
## [2.163.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/snjs
## [2.163.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/snjs
## [2.163.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-12)
**Note:** Version bump only for package @standardnotes/snjs
+15 -21
View File
@@ -64,31 +64,25 @@ describe('application instances', () => {
})
it('changing default host should not affect already signed in accounts', async () => {
/** This test will always succeed but should be observed for console exceptions */
const app = await Factory.createAndInitializeApplication(
'app',
Environment.Web,
Platform.MacWeb,
Factory.getDefaultHost(),
)
await Factory.registerUserToApplication({
application: app,
email: UuidGenerator.GenerateUuid(),
password: 'password',
const contextA = await Factory.createAppContext({
identifier: 'app',
host: Factory.getDefaultHost(),
})
await app.prepareForDeinit()
await Factory.safeDeinit(app)
await contextA.launch()
await contextA.register()
await contextA.deinit()
/** Recreate app with different host */
const recreatedApp = await Factory.createAndInitializeApplication(
'app',
Environment.Web,
Platform.MacWeb,
'http://nonsense.host',
)
const recreatedContext = await Factory.createAppContext({
identifier: 'app',
host: 'http://nonsense.host'
})
await recreatedContext.launch()
expect(recreatedApp.getHost()).to.not.equal('http://nonsense.host')
expect(recreatedApp.getHost()).to.equal(Factory.getDefaultHost())
expect(recreatedContext.application.getHost()).to.not.equal('http://nonsense.host')
expect(recreatedContext.application.getHost()).to.equal(Factory.getDefaultHost())
await recreatedContext.deinit()
})
it('signing out application should delete snjs_version', async () => {
+8 -22
View File
@@ -1,6 +1,7 @@
import FakeWebCrypto from './fake_web_crypto.js'
import * as Applications from './Applications.js'
import * as Utils from './Utils.js'
import * as Defaults from './Defaults.js'
import { createNotePayload } from './Items.js'
UuidGenerator.SetGenerator(new FakeWebCrypto().generateUUID)
@@ -11,28 +12,13 @@ const MaximumSyncOptions = {
}
export class AppContext {
constructor({ identifier, crypto, email, password, passcode } = {}) {
if (!identifier) {
identifier = `${Math.random()}`
}
if (!email) {
email = UuidGenerator.GenerateUuid()
}
if (!password) {
password = UuidGenerator.GenerateUuid()
}
if (!passcode) {
passcode = 'mypasscode'
}
this.identifier = identifier
constructor({ identifier, crypto, email, password, passcode, host } = {}) {
this.identifier = identifier || `${Math.random()}`
this.crypto = crypto
this.email = email
this.password = password
this.passcode = passcode
this.email = email || UuidGenerator.GenerateUuid()
this.password = password || UuidGenerator.GenerateUuid()
this.passcode = passcode || 'mypasscode'
this.host = host || Defaults.getDefaultHost()
}
enableLogging() {
@@ -55,7 +41,7 @@ export class AppContext {
this.identifier,
undefined,
undefined,
undefined,
this.host,
this.crypto || new FakeWebCrypto(),
)
}
+2 -2
View File
@@ -51,8 +51,8 @@ export async function createAppContextWithRealCrypto(identifier) {
return createAppContext({ identifier, crypto: new SNWebCrypto() })
}
export async function createAppContext({ identifier, crypto, email, password } = {}) {
const context = new AppContext({ identifier, crypto, email, password })
export async function createAppContext({ identifier, crypto, email, password, host } = {}) {
const context = new AppContext({ identifier, crypto, email, password, host })
await context.initialize()
return context
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.163.2",
"version": "2.163.5",
"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.7.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/styles
## [1.7.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/styles
## [1.7.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/styles
## [1.7.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-16)
**Note:** Version bump only for package @standardnotes/styles
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/styles",
"version": "1.7.1",
"version": "1.7.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"publishConfig": {
+64 -4
View File
@@ -1,4 +1,42 @@
type AlertButtonStyle = 'small' | 'outlined' | 'contrast' | 'neutral' | 'info' | 'warning' | 'danger' | 'success'
type AlertButtonStyle = 'default' | 'contrast' | 'neutral' | 'info' | 'warning' | 'danger' | 'success'
const getColorsForNormalVariant = (style: AlertButtonStyle) => {
switch (style) {
case 'default':
return 'bg-default text-text'
case 'contrast':
return 'bg-default text-contrast'
case 'neutral':
return 'bg-default text-neutral'
case 'info':
return 'bg-default text-info'
case 'warning':
return 'bg-default text-warning'
case 'danger':
return 'bg-default text-danger'
case 'success':
return 'bg-default text-success'
}
}
const getColorsForPrimaryVariant = (style: AlertButtonStyle) => {
switch (style) {
case 'default':
return 'bg-default text-foreground'
case 'contrast':
return 'bg-contrast text-text'
case 'neutral':
return 'bg-neutral text-neutral-contrast'
case 'info':
return 'bg-info text-info-contrast'
case 'warning':
return 'bg-warning text-warning-contrast'
case 'danger':
return 'bg-danger text-danger-contrast'
case 'success':
return 'bg-success text-success-contrast'
}
}
type AlertButton = {
text: string
@@ -23,7 +61,15 @@ export class SKAlert {
buttonsString() {
const genButton = function (buttonDesc: AlertButton, index: number) {
return `
<button id='button-${index}' class='font-bold px-2.5 py-2 text-base lg:text-xs text-info-contrast bg-${buttonDesc.style}'>
<button id='button-${index}' class='font-bold px-4 py-1.5 rounded text-base lg:text-sm ${
buttonDesc.primary ? 'no-border ' : 'border-solid border-border border '
} ${
buttonDesc.primary
? 'hover:brightness-125 focus:outline-none focus:brightness-125 '
: 'focus:bg-contrast focus:outline-none hover:bg-contrast '
} ${
buttonDesc.primary ? getColorsForPrimaryVariant(buttonDesc.style) : getColorsForNormalVariant(buttonDesc.style)
}'>
<div class='sk-label'>${buttonDesc.text}</div>
</button>
`
@@ -36,7 +82,7 @@ export class SKAlert {
.join('')
const str = `
<div class='sk-button-group'>
<div class='flex items-center justify-end gap-2 w-full'>
${buttonString}
</div>
`
@@ -57,7 +103,14 @@ export class SKAlert {
buttonsTemplate = ''
panelStyle = 'style="padding-bottom: 8px"'
}
const titleTemplate = this.title ? `<div class='mb-1 font-bold text-lg lg:text-base'>${this.title}</div>` : ''
const titleTemplate = this.title
? `<div class='mb-1 font-bold text-lg flex items-center justify-between'>
${this.title}
<button id="close-button" class="rounded p-1 font-bold hover:bg-contrast" onClick={closeDialog}>
<svg class="w-5 h-5 fill-current" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.2459 5.92925C15.5704 5.60478 15.5704 5.07872 15.2459 4.75425C14.9214 4.42978 14.3954 4.42978 14.0709 4.75425L10.0001 8.82508L5.92925 4.75425C5.60478 4.42978 5.07872 4.42978 4.75425 4.75425C4.42978 5.07872 4.42978 5.60478 4.75425 5.92925L8.82508 10.0001L4.75425 14.0709C4.42978 14.3954 4.42978 14.9214 4.75425 15.2459C5.07872 15.5704 5.60478 15.5704 5.92925 15.2459L10.0001 11.1751L14.0709 15.2459C14.3954 15.5704 14.9214 15.5704 15.2459 15.2459C15.5704 14.9214 15.5704 14.3954 15.2459 14.0709L11.1751 10.0001L15.2459 5.92925Z" /></svg>
</button>
</div>`
: ''
const messageTemplate = this.text ? `<p class='sk-p text-base lg:text-sm'>${this.text}</p>` : ''
const template = `
@@ -123,5 +176,12 @@ export class SKAlert {
}
})
}
const closeButton = this.element.querySelector<HTMLButtonElement>('#close-button')
if (closeButton) {
closeButton.onclick = () => {
this.dismiss()
}
}
}
}
+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.24.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.24.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/ui-services
# [1.24.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-12)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.24.0",
"version": "1.24.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+3 -2
View File
@@ -22,7 +22,7 @@ export function confirmDialog({
buttons: [
{
text: cancelButtonText,
style: 'neutral',
style: 'default',
action() {
resolve(false)
},
@@ -30,6 +30,7 @@ export function confirmDialog({
{
text: confirmButtonText,
style: confirmButtonStyle,
primary: true,
action() {
resolve(true)
},
@@ -56,7 +57,7 @@ export function alertDialog({
buttons: [
{
text: closeButtonText,
style: 'neutral',
style: 'default',
action: resolve,
},
],
+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.
## [3.138.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/web
## [3.138.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
**Note:** Version bump only for package @standardnotes/web
## [3.138.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)
### Bug Fixes
* Fixed issue where opening a Super note would change its modified date (skip e2e) ([3923358](https://github.com/standardnotes/app/commit/392335899ad6b2466cf58ff92bea4d3a36419d94))
# [3.138.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-12)
### Bug Fixes
+36
View File
@@ -1,5 +1,41 @@
{
"versions": [
{
"version": "3.138.3",
"title": "[3.138.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.138.2",
"title": "[3.138.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.138.1",
"title": "[3.138.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-16)",
"date": null,
"body": "### Bug Fixes\n\n* Fixed issue where opening a Super note would change its modified date (skip e2e) ([3923358](https://github.com/standardnotes/app/commit/392335899ad6b2466cf58ff92bea4d3a36419d94))",
"parsed": {
"_": [
"Fixed issue where opening a Super note would change its modified date (skip e2e) (3923358)"
],
"Bug Fixes": [
"Fixed issue where opening a Super note would change its modified date (skip e2e) (3923358)"
]
}
},
{
"version": "3.138.0",
"title": "[3.138.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-01-12)",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.138.0",
"version": "3.138.3",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -1,10 +1,11 @@
import { observer } from 'mobx-react-lite'
import { ViewControllerManager } from '@Controllers/ViewControllerManager'
import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@reach/alert-dialog'
import { useRef } from 'react'
import { useCallback, useRef } from 'react'
import { STRING_DELETE_ACCOUNT_CONFIRMATION } from '@/Constants/Strings'
import Button from '@/Components/Button/Button'
import { WebApplication } from '@/Application/Application'
import Icon from '../Icon/Icon'
type Props = {
viewControllerManager: ViewControllerManager
@@ -12,12 +13,17 @@ type Props = {
}
const ConfirmDeleteAccountModal = ({ application, viewControllerManager }: Props) => {
function closeDialog() {
const closeDialog = useCallback(() => {
viewControllerManager.accountMenuController.setDeletingAccount(false)
}
}, [viewControllerManager.accountMenuController])
const cancelRef = useRef<HTMLButtonElement>(null)
const confirm = useCallback(() => {
application.user.deleteAccount().catch(console.error)
closeDialog()
}, [application.user, closeDialog])
return (
<AlertDialog onDismiss={closeDialog} leastDestructiveRef={cancelRef} className="max-w-[600px] p-0">
<div className="sk-modal-content">
@@ -25,27 +31,23 @@ const ConfirmDeleteAccountModal = ({ application, viewControllerManager }: Props
<div className="sk-panel">
<div className="sk-panel-content">
<div className="sk-panel-section">
<AlertDialogLabel className="sk-h3 sk-panel-section-title">Delete account?</AlertDialogLabel>
<AlertDialogLabel className="flex items-center justify-between text-lg font-bold">
Delete account?
<button className="rounded p-1 font-bold hover:bg-contrast" onClick={closeDialog}>
<Icon type="close" />
</button>
</AlertDialogLabel>
<AlertDialogDescription className="sk-panel-row">
<div>
<p className="text-foreground">{STRING_DELETE_ACCOUNT_CONFIRMATION}</p>
<p className="text-base text-foreground lg:text-sm">{STRING_DELETE_ACCOUNT_CONFIRMATION}</p>
</div>
</AlertDialogDescription>
<div className="my-1 mt-4 flex gap-2">
<Button primary small colorStyle="neutral" rounded={false} ref={cancelRef} onClick={closeDialog}>
<div className="my-1 mt-4 flex justify-end gap-2">
<Button ref={cancelRef} onClick={closeDialog}>
Cancel
</Button>
<Button
primary
small
colorStyle="danger"
rounded={false}
onClick={() => {
application.user.deleteAccount().catch(console.error)
closeDialog()
}}
>
<Button primary colorStyle="danger" onClick={confirm}>
Delete my account for good
</Button>
</div>
@@ -1,4 +1,4 @@
import { FunctionComponent, useEffect, useRef, useState } from 'react'
import { FunctionComponent, useCallback, useEffect, useRef, useState } from 'react'
import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@reach/alert-dialog'
import { STRING_SIGN_OUT_CONFIRMATION } from '@/Constants/Strings'
import { WebApplication } from '@/Application/Application'
@@ -7,6 +7,7 @@ import { observer } from 'mobx-react-lite'
import { ApplicationGroup } from '@/Application/ApplicationGroup'
import { isDesktopApplication } from '@/Utils'
import Button from '@/Components/Button/Button'
import Icon from '../Icon/Icon'
type Props = {
application: WebApplication
@@ -18,9 +19,9 @@ const ConfirmSignoutModal: FunctionComponent<Props> = ({ application, viewContro
const [deleteLocalBackups, setDeleteLocalBackups] = useState(false)
const cancelRef = useRef<HTMLButtonElement>(null)
function closeDialog() {
const closeDialog = useCallback(() => {
viewControllerManager.accountMenuController.setSigningOut(false)
}
}, [viewControllerManager.accountMenuController])
const [localBackupsCount, setLocalBackupsCount] = useState(0)
@@ -31,6 +32,15 @@ const ConfirmSignoutModal: FunctionComponent<Props> = ({ application, viewContro
const workspaces = applicationGroup.getDescriptors()
const showWorkspaceWarning = workspaces.length > 1 && isDesktopApplication()
const confirm = useCallback(() => {
if (deleteLocalBackups) {
application.signOutAndDeleteLocalBackups().catch(console.error)
} else {
application.user.signOut().catch(console.error)
}
closeDialog()
}, [application, closeDialog, deleteLocalBackups])
return (
<AlertDialog onDismiss={closeDialog} leastDestructiveRef={cancelRef} className="max-w-[600px] p-0">
<div className="sk-modal-content">
@@ -38,14 +48,19 @@ const ConfirmSignoutModal: FunctionComponent<Props> = ({ application, viewContro
<div className="sk-panel">
<div className="sk-panel-content">
<div className="sk-panel-section">
<AlertDialogLabel className="sk-h3 sk-panel-section-title">Sign out workspace?</AlertDialogLabel>
<AlertDialogLabel className="flex items-center justify-between text-lg font-bold">
Sign out workspace?
<button className="rounded p-1 font-bold hover:bg-contrast" onClick={closeDialog}>
<Icon type="close" />
</button>
</AlertDialogLabel>
<AlertDialogDescription className="sk-panel-row">
<div>
<p className="text-foreground">{STRING_SIGN_OUT_CONFIRMATION}</p>
<p className="text-base text-foreground lg:text-sm">{STRING_SIGN_OUT_CONFIRMATION}</p>
{showWorkspaceWarning && (
<>
<br />
<p className="text-foreground">
<p className="text-base text-foreground lg:text-sm">
<strong>Note: </strong>
Because you have other workspaces signed in, this sign out may leave logs and other metadata
of your session on this device. For a more robust sign out that performs a hard clear of all
@@ -83,24 +98,11 @@ const ConfirmSignoutModal: FunctionComponent<Props> = ({ application, viewContro
</div>
)}
<div className="my-1 mt-4 flex gap-2">
<Button primary small colorStyle="neutral" rounded={false} ref={cancelRef} onClick={closeDialog}>
<div className="my-1 mt-4 flex justify-end gap-2">
<Button ref={cancelRef} onClick={closeDialog}>
Cancel
</Button>
<Button
primary
small
colorStyle="danger"
rounded={false}
onClick={() => {
if (deleteLocalBackups) {
application.signOutAndDeleteLocalBackups().catch(console.error)
} else {
application.user.signOut().catch(console.error)
}
closeDialog()
}}
>
<Button primary colorStyle="danger" onClick={confirm}>
{application.hasAccount() ? 'Sign Out' : 'Delete Workspace'}
</Button>
</div>
@@ -459,7 +459,7 @@ const DisplayOptionsMenu: FunctionComponent<DisplayOptionsMenuProps> = ({
Labs
</Pill>
</div>
<div className="mt-1">Display the notes & files in the current tag in a table layout</div>
<div className="mt-1">Display the notes and files in the current tag in a table layout</div>
</div>
</MenuSwitchButtonItem>
</>
@@ -1,3 +1,4 @@
import { classNames } from '@standardnotes/utils'
import { forwardRef, Fragment, Ref } from 'react'
import { DecoratedInputProps } from './DecoratedInputProps'
@@ -41,12 +42,18 @@ const DecoratedInput = forwardRef(
) => {
const hasLeftDecorations = Boolean(left?.length)
const hasRightDecorations = Boolean(right?.length)
const classNames = getClassNames(hasLeftDecorations, hasRightDecorations, roundedFull)
const computedClassNames = getClassNames(hasLeftDecorations, hasRightDecorations, roundedFull)
return (
<div className={`${classNames.container} ${disabled ? classNames.disabled : ''} ${className?.container}`}>
<div
className={classNames(
computedClassNames.container,
disabled ? computedClassNames.disabled : '',
className?.container,
)}
>
{left && (
<div className="flex items-center px-2 py-1.5">
<div className={classNames('flex items-center px-2 py-1.5', className?.left)}>
{left.map((leftChild, index) => (
<Fragment key={index}>{leftChild}</Fragment>
))}
@@ -55,7 +62,7 @@ const DecoratedInput = forwardRef(
<input
autoComplete={autocomplete ? 'on' : 'off'}
className={`${classNames.input} ${disabled ? classNames.disabled : ''} ${className?.input}`}
className={`${computedClassNames.input} ${disabled ? computedClassNames.disabled : ''} ${className?.input}`}
data-lpignore={type !== 'password' ? true : false}
disabled={disabled}
id={id}
@@ -73,7 +80,7 @@ const DecoratedInput = forwardRef(
/>
{right && (
<div className="flex items-center px-2 py-1.5">
<div className={classNames('flex items-center px-2 py-1.5', className?.right)}>
{right.map((rightChild, index) => (
<div className={index > 0 ? 'ml-3' : ''} key={index}>
{rightChild}
@@ -6,6 +6,8 @@ export type DecoratedInputProps = {
className?: {
container?: string
input?: string
left?: string
right?: string
}
disabled?: boolean
id?: string
@@ -1,14 +1,9 @@
import Button from '@/Components/Button/Button'
import { useCommandService } from '@/Components/CommandProvider'
import DecoratedInput from '@/Components/Input/DecoratedInput'
import { TranslateFromTopAnimation, TranslateToTopAnimation } from '@/Constants/AnimationConfigs'
import { useLifecycleAnimation } from '@/Hooks/useLifecycleAnimation'
import {
ArrowDownIcon,
ArrowUpIcon,
CloseIcon,
ReplaceIcon,
ReplaceAllIcon,
ArrowRightIcon,
} from '@standardnotes/icons'
import { ArrowDownIcon, ArrowUpIcon, CloseIcon, ArrowRightIcon } from '@standardnotes/icons'
import {
keyboardStringForShortcut,
SUPER_SEARCH_TOGGLE_CASE_SENSITIVE,
@@ -82,14 +77,17 @@ export const SearchDialog = ({ open, closeDialog }: { open: boolean; closeDialog
}}
>
<div className="flex items-center gap-2">
<input
type="text"
<DecoratedInput
placeholder="Search"
className={{
container: classNames('flex-grow !text-[length:inherit]', !query.length && '!py-1'),
right: '!py-1',
}}
value={query}
onChange={(e) => {
onChange={(query) => {
dispatch({
type: 'set-query',
query: e.target.value,
query,
})
}}
onKeyDown={(event) => {
@@ -105,17 +103,18 @@ export const SearchDialog = ({ open, closeDialog }: { open: boolean; closeDialog
})
}
}}
className="rounded border border-border bg-default p-1 px-2"
ref={focusOnMount}
right={[
<div className="min-w-[7ch] max-w-[7ch] flex-shrink-0 whitespace-nowrap text-right">
{query.length > 0 && (
<>
{currentResultIndex > -1 ? currentResultIndex + 1 + ' / ' : null}
{results.length}
</>
)}
</div>,
]}
/>
{results.length > 0 ? (
<span className="min-w-[10ch] text-text">
{currentResultIndex > -1 ? currentResultIndex + 1 + ' of ' : null}
{results.length}
</span>
) : (
<span className="min-w-[10ch] text-text">No results</span>
)}
<label
className={classNames(
'relative flex items-center rounded border py-1 px-1.5 focus-within:ring-2 focus-within:ring-info focus-within:ring-offset-2 focus-within:ring-offset-default',
@@ -198,8 +197,8 @@ export const SearchDialog = ({ open, closeDialog }: { open: boolean; closeDialog
className="rounded border border-border bg-default p-1 px-2"
ref={focusOnMount}
/>
<button
className="flex items-center rounded border border-border p-1.5 hover:bg-contrast disabled:cursor-not-allowed"
<Button
small
onClick={() => {
dispatchReplaceEvent({
type: 'next',
@@ -209,10 +208,10 @@ export const SearchDialog = ({ open, closeDialog }: { open: boolean; closeDialog
disabled={results.length < 1 || replaceQuery.length < 1}
title="Replace (Ctrl + Enter)"
>
<ReplaceIcon className="h-4 w-4 fill-current text-text" />
</button>
<button
className="flex items-center rounded border border-border p-1.5 hover:bg-contrast disabled:cursor-not-allowed"
Replace
</Button>
<Button
small
onClick={() => {
dispatchReplaceEvent({
type: 'all',
@@ -222,8 +221,8 @@ export const SearchDialog = ({ open, closeDialog }: { open: boolean; closeDialog
disabled={results.length < 1 || replaceQuery.length < 1}
title="Replace all (Ctrl + Alt + Enter)"
>
<ReplaceAllIcon className="h-4 w-4 fill-current text-text" />
</button>
Replace all
</Button>
</div>
)}
</div>
@@ -27,12 +27,6 @@ export const SearchPlugin = () => {
const isCaseSensitiveRef = useStateRef(isCaseSensitive)
const resultsRef = useStateRef(results)
useEffect(() => {
if (!isSearchActive) {
editor.focus()
}
}, [editor, isSearchActive])
useEffect(() => {
const isFocusInEditor = () => {
if (!document.activeElement || !document.activeElement.closest('.blocks-editor')) {
@@ -51,6 +45,7 @@ export const SearchPlugin = () => {
event.preventDefault()
event.stopPropagation()
dispatch({ type: 'toggle-search' })
editor.focus()
},
},
{
@@ -4,6 +4,7 @@ import { WebApplication } from '@/Application/Application'
import { ViewControllerManager } from '@/Controllers/ViewControllerManager'
import { observer } from 'mobx-react-lite'
import Button from '@/Components/Button/Button'
import Icon from '../Icon/Icon'
type Props = {
application: WebApplication
@@ -17,6 +18,14 @@ const ConfirmOtherSessionsSignOut = observer(({ application, viewControllerManag
viewControllerManager.accountMenuController.setOtherSessionsSignOut(false)
}, [viewControllerManager])
const confirm = useCallback(() => {
application.revokeAllOtherSessions().catch(console.error)
closeDialog()
application.alertService
.alert('You have successfully revoked your sessions from other devices.', undefined, 'Finish')
.catch(console.error)
}, [application, closeDialog])
return (
<AlertDialog onDismiss={closeDialog} leastDestructiveRef={cancelRef} className="max-w-[600px] p-0">
<div className="sk-modal-content">
@@ -24,33 +33,24 @@ const ConfirmOtherSessionsSignOut = observer(({ application, viewControllerManag
<div className="sk-panel">
<div className="sk-panel-content">
<div className="sk-panel-section">
<AlertDialogLabel className="sk-h3 sk-panel-section-title capitalize">
<AlertDialogLabel className="flex items-center justify-between text-lg font-bold capitalize">
End all other sessions?
<button className="rounded p-1 font-bold hover:bg-contrast" onClick={closeDialog}>
<Icon type="close" />
</button>
</AlertDialogLabel>
<AlertDialogDescription className="sk-panel-row">
<p className="text-foreground">
<p className="text-base text-foreground lg:text-sm">
This action will sign out all other devices signed into your account, and remove your data from
those devices when they next regain connection to the internet. You may sign back in on those
devices at any time.
</p>
</AlertDialogDescription>
<div className="my-1 mt-4 flex gap-2">
<Button primary small colorStyle="neutral" rounded={false} ref={cancelRef} onClick={closeDialog}>
<div className="my-1 mt-4 flex justify-end gap-2">
<Button ref={cancelRef} onClick={closeDialog}>
Cancel
</Button>
<Button
primary
small
colorStyle="danger"
rounded={false}
onClick={() => {
application.revokeAllOtherSessions().catch(console.error)
closeDialog()
application.alertService
.alert('You have successfully revoked your sessions from other devices.', undefined, 'Finish')
.catch(console.error)
}}
>
<Button primary colorStyle="danger" onClick={confirm}>
End Sessions
</Button>
</div>
@@ -80,17 +80,17 @@ const WhatsNew = ({ application }: { application: WebApplication }) => {
<div className="flex items-start">
<Title className="mb-3 flex">{version.version}</Title>
{version.version === appVersion && (
<div className="ml-2 rounded bg-info px-2 py-1 text-[10px] font-bold text-info-contrast">
<div className="ml-2 select-none rounded bg-info px-2 py-1 text-[10px] font-bold text-info-contrast">
Your Version
</div>
)}
{isLatest && (
<div className="ml-2 rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast">
<div className="ml-2 select-none rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast">
Latest Version
</div>
)}
{isUnreadVersion && (
<div className="ml-2 rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast">
<div className="ml-2 select-none rounded bg-success px-2 py-1 text-[10px] font-bold text-success-contrast">
New
</div>
)}
@@ -10,6 +10,7 @@ import ModalDialogLabel from '../Shared/ModalDialogLabel'
import ModalDialogDescription from '../Shared/ModalDialogDescription'
import Spinner from '@/Components/Spinner/Spinner'
import Button from '@/Components/Button/Button'
import Icon from '../Icon/Icon'
type Session = RemoteSession & {
revoking?: true
@@ -102,6 +103,9 @@ const SessionsModalContent: FunctionComponent<{
[],
)
const closeRevokeConfirmationDialog = () => {
setRevokingSessionUuid('')
}
return (
<>
<ModalDialog onDismiss={close} className="sessions-modal max-h-[90vh]">
@@ -154,40 +158,31 @@ const SessionsModalContent: FunctionComponent<{
</ModalDialogDescription>
</ModalDialog>
{confirmRevokingSessionUuid && (
<AlertDialog
onDismiss={() => {
setRevokingSessionUuid('')
}}
leastDestructiveRef={cancelRevokeRef}
className="p-0"
>
<AlertDialog onDismiss={closeRevokeConfirmationDialog} leastDestructiveRef={cancelRevokeRef} className="p-0">
<div className="sk-modal-content">
<div className="sn-component">
<div className="sk-panel">
<div className="sk-panel-content">
<div className="sk-panel-section">
<AlertDialogLabel className="sk-h3 sk-panel-section-title">
<AlertDialogLabel className="flex items-center justify-between text-lg font-bold">
{SessionStrings.RevokeTitle}
<button
className="rounded p-1 font-bold hover:bg-contrast"
onClick={closeRevokeConfirmationDialog}
>
<Icon type="close" />
</button>
</AlertDialogLabel>
<AlertDialogDescription className="sk-panel-row">
<p>{SessionStrings.RevokeText}</p>
<p className="text-base text-foreground lg:text-sm">{SessionStrings.RevokeText}</p>
</AlertDialogDescription>
<div className="my-1 flex gap-2">
<Button
primary
small
colorStyle="neutral"
rounded={false}
ref={cancelRevokeRef}
onClick={closeRevokeSessionAlert}
>
<div className="my-1 mt-4 flex justify-end gap-2">
<Button ref={cancelRevokeRef} onClick={closeRevokeSessionAlert}>
<span>{SessionStrings.RevokeCancelButton}</span>
</Button>
<Button
primary
small
colorStyle="danger"
rounded={false}
onClick={() => {
closeRevokeSessionAlert()
revokeSession(confirmRevokingSessionUuid).catch(console.error)
@@ -59,6 +59,7 @@
.sn-component {
height: 100%;
.sk-panel {
border-radius: 0.25rem;
height: 100%;
}
}
@@ -105,6 +106,7 @@
padding: 0;
padding-bottom: 0;
min-width: 300px;
border-radius: 0.25rem;
-webkit-box-shadow: 0px 2px 35px 0px rgba(0, 0, 0, 0.19);
-moz-box-shadow: 0px 2px 35px 0px rgba(0, 0, 0, 0.19);