Compare commits

...
Author SHA1 Message Date
StandardNotes CI a2b6ec74b0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-08-23 10:05:48 +00:00
Karol Sójko 2bdd931f6d fix(web): archived and deleted counts on encryption panel (#1423)
* fix(web): archived and deleted counts on encryption panel

* fix(snjs): yarn build snjs before e2e test suite docker builds
2022-08-23 11:38:43 +02:00
StandardNotes CI a780fa4e87 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
2022-08-22 10:04:58 +00:00
StandardNotes CI becbe34233 chore(release): components 2022-08-22 10:04:37 +00:00
Vardan Hakobyan 2a976a0de4 fix: trigger the onChange event of qr code uploading input when clicking on the button (#1421) 2022-08-22 13:22:22 +04:00
StandardNotes CI e7acbd7de8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-08-18 07:28:47 +00:00
Aman Harwara 779596b9ae fix: hidden file input being clickable (#1414) 2022-08-18 12:30:30 +05:30
StandardNotes CI b1f23d6076 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-08-17 15:16:44 +00:00
Aman Harwara 818c3066cc fix: context menu on longpress on ios safari (#1405) 2022-08-17 20:20:18 +05:30
StandardNotes CI 13343c9a56 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-08-17 14:09:08 +00:00
Aman Harwara 3d1dc8f38a feat: move search bar back to notes column (#1408) 2022-08-17 19:12:40 +05:30
StandardNotes CI 163cc8ce8a chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2022-08-17 12:06:07 +00:00
Vardan Hakobyan a25923f084 fix: remove tablet specific responsive UI (#1411)
* fix: revert tablet responsiveness UI

* fix: don't let the "Saving..." text container hide the note title on tablets

* chore: better visibility of css classes list

* fix: fixed width of notes container column on Tablets
2022-08-17 15:39:56 +04:00
StandardNotes CI f14f105703 chore(release): publish
- @standardnotes/[email protected]
2022-08-17 11:33:50 +00:00
Karol Sójko 6d7bcd7a8d feat(docs): remove matomo in favour of plausible 2022-08-17 13:05:07 +02:00
Karol Sójko da06f293e0 chore(deps): remove reviewers assignment from dependabot to avoid noise 2022-08-17 10:08:54 +02:00
StandardNotes CI ec4dc1d477 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2022-08-16 09:42:00 +00:00
Aman Harwara 2ea9f862fe fix: note tag delete button not showing on iOS (#1403) 2022-08-16 14:40:03 +05:30
StandardNotes CI 901b1516d3 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-08-15 13:15:07 +00:00
Aman Harwara 54ae4365a3 fix: selecting from "Photo Library" on iOS doesn't upload (#1401) 2022-08-15 18:13:29 +05:30
StandardNotes CI 5b910d4ae4 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-08-11 20:06:21 +00:00
Aman Harwara 40d9392599 fix: optimize toasts for mobile (#1392) 2022-08-12 01:07:23 +05:30
StandardNotes CI a7dfeae650 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-08-10 13:30:36 +00:00
Aman Harwara 77cbb6b06e fix: tags being dimmed on safari (#1389) 2022-08-10 18:34:05 +05:30
Aman Harwara 82a8bcc440 fix: tag context menu button opening notes list veiw (#1390) 2022-08-10 18:13:29 +05:30
StandardNotes CI 83f6cc667d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-08-09 15:38:31 +00:00
Vardan Hakobyan d048800b9d fix: disable zoom on input focusing on ios (#1386)
* fix: disable zoom when focusing input field on ios

* chore: better naming
2022-08-09 19:06:03 +04:00
StandardNotes CI 1f3e741811 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-08-08 09:30:06 +00:00
Aman Harwara 887402f75f fix: viewport height on mobile Chrome & Safari (#1376) 2022-08-08 14:32:16 +05:30
StandardNotes CI d533fb78e0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-08-08 07:35:45 +00:00
Vardan Hakobyan f555fbcaaa feat: tablet responsiveness (#1369)
* feat: "Notes" column responsiveness for tablets

* feat: ability to expand/collapse the navigation column, move some styles to tailwind

* feat: ability to expand/collapse the navigation column, move some styles to tailwind

* feat: icon for collapsing/expanding navigation column, style improvements

* fix: restore vertical panels resizability on large screens

* feat: tags/folders section for collapsed state

* feat: notes subsection styling in navigation section

* feat: hide rename & delete links of smart views when in collapsed mode

* fix: show notes count in bold when in collapsed mode

* fix: better padding for folders in collapsed state

* fix: smaller left padding for collapsed case

* fix: better view of expand/collapse control

* fix: hide search bar when collapsed

* fix: adjust position of "expand" control when in collapsed state

* chore: remove comments

* refactor: use `classNames` util when applying conditional css classes

* chore: shorter class names syntax

* chore: shorter syntax for conditional classes

* fix: better way of setting background color with opacity

* fix: use variable colors according to SN themes

* chore: move "colors" from "extend" section and thus override Tailwind's colors (so only SN colors will exist)

* fix: correct hover style in collapsed mode

* fix: correct upper boundary for extra small screens
2022-08-08 11:07:15 +04:00
Karol Sójko 8332a70384 fix(web): cannonical link rel 2022-08-08 09:04:39 +02:00
StandardNotes CI 50e85cac15 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-08-06 05:20:47 +00:00
Aman Harwara f2369c7555 chore: remove HtmlWebpackPlugin from dev webpack config (#1377) 2022-08-06 06:51:39 +02:00
76 changed files with 810 additions and 274 deletions
-69
View File
@@ -9,182 +9,113 @@ updates:
directory: "/"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/api"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/components"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/desktop"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/docs"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/encryption"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/features"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/filepicker"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/files"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/icons"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/mobile"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/models"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/releases"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/responses"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/services"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/sncrypto-common"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/sncrypto-web"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/snjs"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/styles"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/toast"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/utils"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "npm"
directory: "/packages/web"
schedule:
interval: "daily"
reviewers:
- "moughxyz"
- "karolsojko"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "moughxyz"
- "karolsojko"
+2
View File
@@ -26,6 +26,8 @@ jobs:
uses: actions/checkout@v3
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn build:snjs
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
+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.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/api
## [1.4.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
**Note:** Version bump only for package @standardnotes/api
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.4.7",
"version": "1.4.8",
"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.
## [2.7.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-22)
### Bug Fixes
* trigger the `onChange` event of qr code uploading input when clicking on the button ([#1421](https://github.com/standardnotes/app/issues/1421)) ([2a976a0](https://github.com/standardnotes/app/commit/2a976a0de499ba33186a52a6bd2c10a709b86fee))
## [2.7.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-14)
### Bug Fixes
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -80,9 +80,9 @@
"binary": "7c6f499b8107f80ec5fd84e591c2c33291d1fc6db85f098df4f8308a0cda901d"
},
"org.standardnotes.token-vault": {
"version": "2.2.3",
"base64": "bf5c3a2aae3f119043ee744ab5535de4705eeed67d5ecf9e1d7b95817f92bc19",
"binary": "8ef8a1eaf19d22b0ac279ad0c4d27b29c057b0f9b0d5c5f4cd6183eb506feaa3"
"version": "2.2.4",
"base64": "fb004e8cae73b351fdb225ef910102a1b7c9b616b92de52f99d2c82d7b4dd5a1",
"binary": "9b00f950c868e20e059a5fe7dbd0dd14eac5d94b31817b8bf3c58c88ab5ce236"
},
"org.standardnotes.standard-sheets": {
"version": "1.5.1",
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/components-meta",
"version": "2.7.7",
"version": "2.7.8",
"private": true,
"author": "Standard Notes.",
"main": "dist",
@@ -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.
## [2.2.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-22)
### Bug Fixes
* trigger the `onChange` event of qr code uploading input when clicking on the button ([#1421](https://github.com/standardnotes/app/issues/1421)) ([2a976a0](https://github.com/standardnotes/app/commit/2a976a0de499ba33186a52a6bd2c10a709b86fee))
## [2.2.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-13)
**Note:** Version bump only for package @standardnotes/authenticator
@@ -28,6 +28,12 @@ const convertToGrayScale = (imageData) => {
}
export default class QRCodeReader extends React.Component {
constructor() {
super()
this.fileInputRef = React.createRef(null)
}
onImageSelected = (evt) => {
const file = evt.target.files[0]
const url = URL.createObjectURL(file)
@@ -70,9 +76,9 @@ export default class QRCodeReader extends React.Component {
render() {
return (
<div className="qr-code-reader-container">
<div className="sk-button info">
<div className="sk-button info" onClick={() => this.fileInputRef.current.click()}>
<div className="sk-label">Upload QR Code</div>
<input type="file" style={{ display: 'none' }} onChange={this.onImageSelected} />
<input type="file" style={{ display: 'none' }} ref={this.fileInputRef} onChange={this.onImageSelected} />
</div>
</div>
)
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/authenticator",
"version": "2.2.3",
"version": "2.2.4",
"main": "dist/dist.js",
"author": "Standard Notes",
"private": true,
+56
View File
@@ -3,6 +3,62 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.23.100](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.99](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-22)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.98](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-18)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.97](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.96](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.95](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.94](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.93](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.92](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.91](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.90](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.89](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.88](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.87](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-06)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.86](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
**Note:** Version bump only for package @standardnotes/desktop
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.23.86",
"version": "3.23.100",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [0.2.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
### Features
* **docs:** remove matomo in favour of plausible ([6d7bcd7](https://github.com/standardnotes/app/commit/6d7bcd7a8d2dfffb6dc69899406af57e41c071df))
# [0.1.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-11)
### Features
-1
View File
@@ -44,7 +44,6 @@ docs
│ ├── katex
│ ├── .nojekyll
│ ├── CNAME
│ └── matomo.js
├── .gitignore
├── .prettierrc
├── docusaurus.config.js
+2 -2
View File
@@ -156,8 +156,8 @@ module.exports = {
],
scripts: [
{
src: `/matomo.js`,
async: true,
src: 'https://plausible.standardnotes.com/js/plausible.js',
"data-domain": 'docs.standardnotes.com',
defer: true,
},
],
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/docs",
"version": "0.1.0",
"version": "0.2.0",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
-11
View File
@@ -1,11 +0,0 @@
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.standardnotes.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '7']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
+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.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/encryption
# [1.14.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.14.0",
"version": "1.14.1",
"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.22.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/filepicker
# [1.22.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.22.0",
"version": "1.22.1",
"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.9.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/files
# [1.9.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.9.0",
"version": "1.9.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+56
View File
@@ -3,6 +3,62 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.31.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-22)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-18)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-06)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.31.2",
"version": "3.31.16",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+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.16.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
### Bug Fixes
* **web:** archived and deleted counts on encryption panel ([#1423](https://github.com/standardnotes/app/issues/1423)) ([2bdd931](https://github.com/standardnotes/app/commit/2bdd931f6dcd876b1659c5d7d045effa26e18a20))
# [1.16.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.16.0",
"version": "1.16.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -1,4 +1,4 @@
export type StructuredItemsCount = {
export type ItemCounts = {
notes: number
tags: number
deleted: number
@@ -24,6 +24,7 @@ export * from './Mutator/TransactionalMutation'
export * from './Types/AppDataField'
export * from './Types/ConflictStrategy'
export * from './Types/DefaultAppDomain'
export * from './Types/ItemCounts'
export * from './Types/ItemStream'
export * from './Types/MutationType'
export * from './Types/SingletonStrategy'
+56
View File
@@ -3,6 +3,62 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.3.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-22)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-18)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-06)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.8",
"version": "1.3.22",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.17.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
### Bug Fixes
* **web:** archived and deleted counts on encryption panel ([#1423](https://github.com/standardnotes/app/issues/1423)) ([2bdd931](https://github.com/standardnotes/app/commit/2bdd931f6dcd876b1659c5d7d045effa26e18a20))
# [1.17.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.17.0",
"version": "1.17.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -0,0 +1,31 @@
import { ContentType } from '@standardnotes/common'
import { SNNote, SNTag } from '@standardnotes/models'
import { ItemCounter } from './ItemCounter'
describe('ItemCounter', () => {
const createCounter = () => new ItemCounter()
it('should count distinct item counts', () => {
const items = [
{
archived: true,
} as jest.Mocked<SNNote>,
{
trashed: true,
} as jest.Mocked<SNNote>,
{
content_type: ContentType.Note,
} as jest.Mocked<SNNote>,
{
content_type: ContentType.Tag,
} as jest.Mocked<SNTag>,
]
expect(createCounter().countNotesAndTags(items)).toEqual({
archived: 1,
deleted: 1,
notes: 1,
tags: 1,
})
})
})
@@ -0,0 +1,40 @@
import { ContentType } from '@standardnotes/common'
import { SNNote, SNTag, ItemCounts } from '@standardnotes/models'
import { ItemCounterInterface } from './ItemCounterInterface'
export class ItemCounter implements ItemCounterInterface {
countNotesAndTags(items: Array<SNNote | SNTag>): ItemCounts {
const counts: ItemCounts = {
notes: 0,
archived: 0,
deleted: 0,
tags: 0,
}
for (const item of items) {
if (item.archived) {
counts.archived++
continue
}
if (item.trashed) {
counts.deleted++
continue
}
if (item.content_type === ContentType.Note) {
counts.notes++
continue
}
if (item.content_type === ContentType.Tag) {
counts.tags++
continue
}
}
return counts
}
}
@@ -0,0 +1,5 @@
import { SNNote, SNTag, ItemCounts } from '@standardnotes/models'
export interface ItemCounterInterface {
countNotesAndTags(items: Array<SNNote | SNTag>): ItemCounts
}
+2
View File
@@ -50,6 +50,8 @@ export * from './Internal/InternalEventHandlerInterface'
export * from './Internal/InternalEventInterface'
export * from './Internal/InternalEventPublishStrategy'
export * from './Internal/InternalEventType'
export * from './Item/ItemCounter'
export * from './Item/ItemCounterInterface'
export * from './Item/ItemManagerInterface'
export * from './Item/ItemsClientInterface'
export * from './Item/ItemsServerInterface'
+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.125.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/snjs
# [2.125.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.125.0",
"version": "2.125.1",
"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.3.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
### Bug Fixes
* optimize toasts for mobile ([#1392](https://github.com/standardnotes/app/issues/1392)) ([40d9392](https://github.com/standardnotes/app/commit/40d9392599e871225abcabcddd51de6cc99a0fe9))
## [1.3.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-14)
**Note:** Version bump only for package @standardnotes/toast
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/toast",
"version": "1.3.4",
"version": "1.3.5",
"private": true,
"main": "./src/index.ts",
"scripts": {
+16 -16
View File
@@ -12,20 +12,20 @@ const prefersReducedMotion = () => {
const colorForToastType = (type: ToastType) => {
switch (type) {
case ToastType.Success:
return 'text-success'
return 'bg-success text-info-contrast md:text-success'
case ToastType.Error:
return 'text-danger'
return 'bg-danger text-info-contrast md:text-danger'
default:
return 'text-info'
return 'bg-info text-info-contrast md:text-info'
}
}
const iconForToastType = (type: ToastType) => {
switch (type) {
case ToastType.Success:
return <CheckCircleFilledIcon className={`h-5 w-5 ${colorForToastType(type)}`} />
return <CheckCircleFilledIcon className="text-success h-5 w-5" />
case ToastType.Error:
return <ClearCircleFilledIcon className={`h-5 w-5 ${colorForToastType(type)}`} />
return <ClearCircleFilledIcon className="text-danger h-5 w-5" />
case ToastType.Progress:
case ToastType.Loading:
return <div className="border-info h-4 w-4 animate-spin rounded-full border border-solid border-r-transparent" />
@@ -77,7 +77,7 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
<div
data-index={index}
role="status"
className={`bg-passive-5 animation-fill-forwards relative mt-3 flex min-w-max select-none flex-col rounded opacity-0 ${currentAnimation}`}
className={`bg-passive-5 animation-fill-forwards relative mt-3 flex min-w-full select-none flex-col rounded opacity-0 md:min-w-max ${currentAnimation}`}
style={{
boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.16)',
transition: shouldReduceMotion ? undefined : 'all 0.2s ease',
@@ -90,18 +90,18 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
}}
ref={ref}
>
<div className={`flex w-full items-center ${hasActions ? 'p-2 pl-3' : hasProgress ? 'px-3 py-2.5' : 'p-3'}`}>
{icon ? <div className="sn-icon mr-2 flex flex-shrink-0 items-center justify-center">{icon}</div> : null}
<div className="text-text text-sm">{toast.message}</div>
<div
className={`flex w-full flex-wrap items-center gap-2 ${
hasActions ? 'p-2 pl-3' : hasProgress ? 'px-3 py-2.5' : 'p-3'
}`}
>
{icon ? <div className="sn-icon flex flex-shrink-0 items-center justify-center">{icon}</div> : null}
<div className="text-text text-sm [word-wrap:anywhere]">{toast.message}</div>
{hasActions && (
<div className="ml-4">
<>
{toast.actions?.map((action, index) => (
<button
style={{
paddingLeft: '0.45rem',
paddingRight: '0.45rem',
}}
className={`hover:bg-passive-3 cursor-pointer rounded border-0 bg-transparent py-1 text-sm font-semibold ${colorForToastType(
className={`hover:bg-passive-3 cursor-pointer rounded border-0 py-1 px-[0.45rem] text-sm font-semibold md:bg-transparent ${colorForToastType(
toast.type,
)} ${index !== 0 ? 'ml-2' : ''}`}
onClick={() => {
@@ -112,7 +112,7 @@ export const Toast = forwardRef(({ toast, index }: Props, ref: ForwardedRef<HTML
{action.label}
</button>
))}
</div>
</>
)}
</div>
{hasProgress && (
+1 -1
View File
@@ -11,7 +11,7 @@ export const ToastContainer: FunctionComponent = () => {
}
return (
<div className="z-toast fixed bottom-6 right-6 flex flex-col items-end">
<div className="z-toast fixed bottom-6 right-6 flex w-[calc(100%-3rem)] flex-col items-end md:w-auto">
{toasts.map((toast, index) => (
<ToastTimer toast={toast} index={index} key={toast.id} />
))}
-11
View File
@@ -55,14 +55,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
resumeTimer()
}, [resumeTimer])
const handlePageVisibility = useCallback(() => {
if (document.visibilityState === 'hidden') {
pauseTimer()
} else {
resumeTimer()
}
}, [pauseTimer, resumeTimer])
const handlePageFocus = useCallback(() => {
resumeTimer()
}, [resumeTimer])
@@ -83,7 +75,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
toastElement.addEventListener('mouseenter', handleMouseEnter)
toastElement.addEventListener('mouseleave', handleMouseLeave)
}
document.addEventListener('visibilitychange', handlePageVisibility)
window.addEventListener('focus', handlePageFocus)
window.addEventListener('blur', handlePageBlur)
@@ -93,7 +84,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
toastElement.removeEventListener('mouseenter', handleMouseEnter)
toastElement.removeEventListener('mouseleave', handleMouseLeave)
}
document.removeEventListener('visibilitychange', handlePageVisibility)
window.removeEventListener('focus', handlePageFocus)
window.removeEventListener('blur', handlePageBlur)
}
@@ -105,7 +95,6 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
handleMouseLeave,
handlePageBlur,
handlePageFocus,
handlePageVisibility,
resumeTimer,
shouldAutoClose,
toast.id,
+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.1.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.1.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
**Note:** Version bump only for package @standardnotes/ui-services
# 1.1.0 (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.1.0",
"version": "1.1.2",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+85
View File
@@ -3,6 +3,91 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.45.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
### Bug Fixes
* **web:** archived and deleted counts on encryption panel ([#1423](https://github.com/standardnotes/app/issues/1423)) ([2bdd931](https://github.com/standardnotes/app/commit/2bdd931f6dcd876b1659c5d7d045effa26e18a20))
## [3.45.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-22)
**Note:** Version bump only for package @standardnotes/web
## [3.45.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-18)
### Bug Fixes
* hidden file input being clickable ([#1414](https://github.com/standardnotes/app/issues/1414)) ([779596b](https://github.com/standardnotes/app/commit/779596b9ae2df7d70dac9cdd17c85647d85e16b2))
## [3.45.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
### Bug Fixes
* context menu on longpress on ios safari ([#1405](https://github.com/standardnotes/app/issues/1405)) ([818c306](https://github.com/standardnotes/app/commit/818c3066ccd92156dfc8c797074672cfb08de7bd))
# [3.45.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
### Features
* move search bar back to notes column ([#1408](https://github.com/standardnotes/app/issues/1408)) ([3d1dc8f](https://github.com/standardnotes/app/commit/3d1dc8f38a883685b6c107bece2e75afe8119bf5))
## [3.44.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-17)
### Bug Fixes
* remove tablet specific responsive UI ([#1411](https://github.com/standardnotes/app/issues/1411)) ([a25923f](https://github.com/standardnotes/app/commit/a25923f0843bfa18e21883a040f95636f23e45ab))
## [3.44.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-16)
### Bug Fixes
* note tag delete button not showing on iOS ([#1403](https://github.com/standardnotes/app/issues/1403)) ([2ea9f86](https://github.com/standardnotes/app/commit/2ea9f862feb77a826af8b6ccf7cc2de1a1e50733))
## [3.44.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-15)
### Bug Fixes
* selecting from "Photo Library" on iOS doesn't upload ([#1401](https://github.com/standardnotes/app/issues/1401)) ([54ae436](https://github.com/standardnotes/app/commit/54ae4365a344cc3c6c796a3afb6d3020f5493a6b))
## [3.44.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-11)
### Bug Fixes
* optimize toasts for mobile ([#1392](https://github.com/standardnotes/app/issues/1392)) ([40d9392](https://github.com/standardnotes/app/commit/40d9392599e871225abcabcddd51de6cc99a0fe9))
## [3.44.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-10)
### Bug Fixes
* tag context menu button opening notes list veiw ([#1390](https://github.com/standardnotes/app/issues/1390)) ([82a8bcc](https://github.com/standardnotes/app/commit/82a8bcc4407fce2e255b06a0c31c5fd244f5973f))
* tags being dimmed on safari ([#1389](https://github.com/standardnotes/app/issues/1389)) ([77cbb6b](https://github.com/standardnotes/app/commit/77cbb6b06e901de9e0eccee98219f946b014fe21))
## [3.44.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-09)
### Bug Fixes
* disable zoom on input focusing on ios ([#1386](https://github.com/standardnotes/app/issues/1386)) ([d048800](https://github.com/standardnotes/app/commit/d048800b9d17ff6214a98fd9b49bfb205459f73e))
## [3.44.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
### Bug Fixes
* viewport height on mobile Chrome & Safari ([#1376](https://github.com/standardnotes/app/issues/1376)) ([887402f](https://github.com/standardnotes/app/commit/887402f75fe7d03a376e42446661f6b43a2c372c))
# [3.44.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-08)
### Bug Fixes
* **web:** cannonical link rel ([8332a70](https://github.com/standardnotes/app/commit/8332a7038405378faf4bdb7c5740d543758d69b1))
### Features
* tablet responsiveness ([#1369](https://github.com/standardnotes/app/issues/1369)) ([f555fbc](https://github.com/standardnotes/app/commit/f555fbcaaab1203c8460e7a69c3d7723d09f45d7))
## [3.43.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-06)
**Note:** Version bump only for package @standardnotes/web
# [3.43.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-05)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.43.0",
"version": "3.45.4",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
+1 -1
View File
@@ -5,7 +5,7 @@
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<link rel="canonical" href="https://app-static.standardnotes.com" />
<link rel="canonical" href="https://app.standardnotes.com" />
<link href="favicon/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180"></link>
<link href="favicon/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"></link>
+15
View File
@@ -1,5 +1,7 @@
'use strict'
import { disableIosTextFieldZoom } from '@/Utils'
declare global {
interface Window {
dashboardUrl?: string
@@ -19,6 +21,7 @@ declare global {
application?: WebApplication
mainApplicationGroup?: ApplicationGroup
MSStream?: Record<string, unknown>
}
}
@@ -39,6 +42,10 @@ const getKey = () => {
const RootId = 'app-group-root'
const setViewportHeight = () => {
document.documentElement.style.setProperty('--viewport-height', `${window.innerHeight}px`)
}
const startApplication: StartApplication = async function startApplication(
defaultSyncServerHost: string,
device: WebOrDesktopDevice,
@@ -54,6 +61,8 @@ const startApplication: StartApplication = async function startApplication(
const rootElement = document.getElementById(RootId) as HTMLElement
root.unmount()
rootElement.remove()
window.removeEventListener('resize', setViewportHeight)
window.removeEventListener('orientationchange', setViewportHeight)
renderApp()
}
@@ -63,6 +72,12 @@ const startApplication: StartApplication = async function startApplication(
const appendedRootNode = document.body.appendChild(rootElement)
root = createRoot(appendedRootNode)
setViewportHeight()
window.addEventListener('resize', setViewportHeight)
window.addEventListener('orientationchange', setViewportHeight)
disableIosTextFieldZoom()
root.render(
<ApplicationGroupView
key={getKey()}
@@ -194,6 +194,7 @@ const ApplicationView: FunctionComponent<Props> = ({ application, mainApplicatio
noteTagsController={viewControllerManager.noteTagsController}
notesController={viewControllerManager.notesController}
selectionController={viewControllerManager.selectionController}
searchOptionsController={viewControllerManager.searchOptionsController}
/>
<NoteGroupView application={application} />
</ResponsivePaneProvider>
@@ -10,6 +10,7 @@ import PopoverFileItem from './PopoverFileItem'
import { PopoverFileItemActionType } from './PopoverFileItemAction'
import { PopoverTabs } from './PopoverTabs'
import { FilesController } from '@/Controllers/FilesController'
import { StreamingFileReader } from '@standardnotes/filepicker'
type Props = {
application: WebApplication
@@ -32,6 +33,8 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
setCurrentTab,
attachedTabDisabled,
}) => {
const fileInputRef = useRef<HTMLInputElement>(null)
const [searchQuery, setSearchQuery] = useState('')
const searchInputRef = useRef<HTMLInputElement>(null)
@@ -42,13 +45,9 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
? filesList.filter((file) => file.name.toLowerCase().indexOf(searchQuery.toLowerCase()) !== -1)
: filesList
const handleAttachFilesClick = async () => {
const uploadedFiles = await filesController.uploadNewFile()
if (!uploadedFiles) {
return
}
const attachFilesIfRequired = (files: FileItem[]) => {
if (currentTab === PopoverTabs.AttachedFiles) {
uploadedFiles.forEach((file) => {
files.forEach((file) => {
filesController
.handleFileAction({
type: PopoverFileItemActionType.AttachFileToNote,
@@ -59,6 +58,19 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
}
}
const handleAttachFilesClick = async () => {
if (!StreamingFileReader.available()) {
fileInputRef.current?.click()
return
}
const uploadedFiles = await filesController.uploadNewFile()
if (!uploadedFiles) {
return
}
attachFilesIfRequired(uploadedFiles)
}
const previewHandler = (file: FileItem) => {
filesController
.handleFileAction({
@@ -161,6 +173,26 @@ const AttachedFilesPopover: FunctionComponent<Props> = ({
</div>
)}
</div>
<input
type="file"
className="absolute top-0 left-0 -z-50 h-px w-px opacity-0"
multiple
ref={fileInputRef}
onChange={async (event) => {
const files = event.currentTarget.files
if (!files) {
return
}
for (const file of files) {
const uploadedFiles = await filesController.uploadNewFile(file)
if (uploadedFiles) {
attachFilesIfRequired(uploadedFiles)
}
}
}}
/>
{filteredList.length > 0 && (
<button
className="flex w-full cursor-pointer items-center border-0 border-t border-solid border-border bg-transparent px-3 py-3 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none"
@@ -20,6 +20,10 @@ import ContentListHeader from './Header/ContentListHeader'
import ResponsivePaneContent from '../ResponsivePane/ResponsivePaneContent'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { StreamingFileReader } from '@standardnotes/filepicker'
import SearchBar from '../SearchBar/SearchBar'
import { SearchOptionsController } from '@/Controllers/SearchOptionsController'
import { classNames } from '@/Utils/ConcatenateClassNames'
type Props = {
accountMenuController: AccountMenuController
@@ -31,6 +35,7 @@ type Props = {
noteTagsController: NoteTagsController
notesController: NotesController
selectionController: SelectedItemsController
searchOptionsController: SearchOptionsController
}
const ContentListView: FunctionComponent<Props> = ({
@@ -43,9 +48,11 @@ const ContentListView: FunctionComponent<Props> = ({
noteTagsController,
notesController,
selectionController,
searchOptionsController,
}) => {
const { toggleAppPane } = useResponsiveAppPane()
const fileInputRef = useRef<HTMLInputElement>(null)
const itemsViewPanelRef = useRef<HTMLDivElement>(null)
const {
@@ -68,7 +75,12 @@ const ContentListView: FunctionComponent<Props> = ({
const addNewItem = useCallback(async () => {
if (isFilesSmartView) {
void filesController.uploadNewFile()
if (StreamingFileReader.available()) {
void filesController.uploadNewFile()
return
}
fileInputRef.current?.click()
} else {
await createNewNote()
toggleAppPane(AppPaneId.Editor)
@@ -172,13 +184,33 @@ const ContentListView: FunctionComponent<Props> = ({
return (
<div
id="items-column"
className="sn-component section app-column app-column-second flex flex-col border-b border-solid border-border"
className={classNames(
'sn-component section app-column flex flex-col border-b border-solid border-border ',
'xl:w-87.5 xsm-only:!w-full sm-only:!w-full md-only:!w-52 lg-only:!w-52',
)}
aria-label={'Notes & Files'}
ref={itemsViewPanelRef}
>
<ResponsivePaneContent paneId={AppPaneId.Items}>
<div id="items-title-bar" className="section-title-bar border-b border-solid border-border">
<div id="items-title-bar-container">
<input
type="file"
className="absolute top-0 left-0 -z-50 h-px w-px opacity-0"
multiple
ref={fileInputRef}
onChange={(event) => {
const files = event.currentTarget.files
if (!files) {
return
}
for (const file of files) {
void filesController.uploadNewFile(file)
}
}}
/>
<ContentListHeader
application={application}
panelTitle={panelTitle}
@@ -187,6 +219,7 @@ const ContentListView: FunctionComponent<Props> = ({
isFilesSmartView={isFilesSmartView}
optionsSubtitle={optionsSubtitle}
/>
<SearchBar itemListController={itemListController} searchOptionsController={searchOptionsController} />
<NoAccountWarning
accountMenuController={accountMenuController}
noAccountWarningController={noAccountWarningController}
@@ -1,6 +1,6 @@
import { FileItem } from '@standardnotes/snjs'
import { observer } from 'mobx-react-lite'
import { FunctionComponent, useCallback } from 'react'
import { FunctionComponent, useCallback, useRef } from 'react'
import { getFileIconComponent } from '../AttachedFilesPopover/getFileIconComponent'
import ListItemConflictIndicator from './ListItemConflictIndicator'
import ListItemFlagIcons from './ListItemFlagIcons'
@@ -9,6 +9,7 @@ import ListItemMetadata from './ListItemMetadata'
import { DisplayableListItemProps } from './Types/DisplayableListItemProps'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
import { useContextMenuEvent } from '@/Hooks/useContextMenuEvent'
const FileListItem: FunctionComponent<DisplayableListItemProps> = ({
application,
@@ -24,8 +25,11 @@ const FileListItem: FunctionComponent<DisplayableListItemProps> = ({
}) => {
const { toggleAppPane } = useResponsiveAppPane()
const listItemRef = useRef<HTMLDivElement>(null)
const openFileContextMenu = useCallback(
(posX: number, posY: number) => {
filesController.setShowFileContextMenu(false)
filesController.setFileContextMenuLocation({
x: posX,
y: posY,
@@ -66,17 +70,16 @@ const FileListItem: FunctionComponent<DisplayableListItemProps> = ({
'w-5 h-5 flex-shrink-0',
)
useContextMenuEvent(listItemRef, openContextMenu)
return (
<div
ref={listItemRef}
className={`content-list-item flex w-full cursor-pointer items-stretch text-text ${
selected && 'selected border-l-2px border-solid border-info'
}`}
id={item.uuid}
onClick={onClick}
onContextMenu={(event) => {
event.preventDefault()
void openContextMenu(event.clientX, event.clientY)
}}
>
{!hideIcon ? (
<div className="mr-0 flex flex-col items-center justify-between p-4.5 pr-3">
@@ -1,7 +1,7 @@
import { PLAIN_EDITOR_NAME } from '@/Constants/Constants'
import { sanitizeHtmlString, SNNote } from '@standardnotes/snjs'
import { observer } from 'mobx-react-lite'
import { FunctionComponent, useCallback } from 'react'
import { FunctionComponent, useCallback, useRef } from 'react'
import Icon from '@/Components/Icon/Icon'
import ListItemConflictIndicator from './ListItemConflictIndicator'
import ListItemFlagIcons from './ListItemFlagIcons'
@@ -10,6 +10,7 @@ import ListItemMetadata from './ListItemMetadata'
import { DisplayableListItemProps } from './Types/DisplayableListItemProps'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
import { useContextMenuEvent } from '@/Hooks/useContextMenuEvent'
const NoteListItem: FunctionComponent<DisplayableListItemProps> = ({
application,
@@ -26,12 +27,15 @@ const NoteListItem: FunctionComponent<DisplayableListItemProps> = ({
}) => {
const { toggleAppPane } = useResponsiveAppPane()
const listItemRef = useRef<HTMLDivElement>(null)
const editorForNote = application.componentManager.editorForNote(item as SNNote)
const editorName = editorForNote?.name ?? PLAIN_EDITOR_NAME
const [icon, tint] = application.iconsController.getIconAndTintForNoteType(editorForNote?.package_info.note_type)
const hasFiles = application.items.getFilesForNote(item as SNNote).length > 0
const openNoteContextMenu = (posX: number, posY: number) => {
notesController.setContextMenuOpen(false)
notesController.setContextMenuClickLocation({
x: posX,
y: posY,
@@ -62,17 +66,16 @@ const NoteListItem: FunctionComponent<DisplayableListItemProps> = ({
}
}, [item.uuid, selectionController, toggleAppPane])
useContextMenuEvent(listItemRef, openContextMenu)
return (
<div
ref={listItemRef}
className={`content-list-item flex w-full cursor-pointer items-stretch text-text ${
selected && 'selected border-l-2 border-solid border-info'
}`}
id={item.uuid}
onClick={onClick}
onContextMenu={(event) => {
event.preventDefault()
void openContextMenu(event.clientX, event.clientY)
}}
>
{!hideIcon ? (
<div className="mr-0 flex flex-col items-center justify-between p-4 pr-4">
@@ -6,7 +6,6 @@ import { ApplicationEvent, PrefKey } from '@standardnotes/snjs'
import { observer } from 'mobx-react-lite'
import { FunctionComponent, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import PanelResizer, { PanelSide, ResizeFinishCallback, PanelResizeType } from '@/Components/PanelResizer/PanelResizer'
import SearchBar from '@/Components/SearchBar/SearchBar'
import ResponsivePaneContent from '@/Components/ResponsivePane/ResponsivePaneContent'
import { AppPaneId } from '@/Components/ResponsivePane/AppPaneMetadata'
import { classNames } from '@/Utils/ConcatenateClassNames'
@@ -47,14 +46,13 @@ const Navigation: FunctionComponent<Props> = ({ application }) => {
}, [viewControllerManager])
return (
<div id="navigation" className="sn-component section app-column app-column-first" ref={ref}>
<div
id="navigation"
className={'sn-component section app-column w-[220px] xsm-only:!w-full sm-only:!w-full'}
ref={ref}
>
<ResponsivePaneContent paneId={AppPaneId.Navigation} contentElementId="navigation-content">
<SearchBar
itemListController={viewControllerManager.itemListController}
searchOptionsController={viewControllerManager.searchOptionsController}
selectedViewTitle={viewControllerManager.navigationController.selected?.title}
/>
<div className="section-title-bar">
<div className={'section-title-bar'}>
<div className="section-title-bar-header">
<div className="title text-sm">
<span className="font-bold">Views</span>
@@ -11,6 +11,8 @@ import {
import { ViewControllerManager } from '@/Controllers/ViewControllerManager'
import { SNTag } from '@standardnotes/snjs'
import { observer } from 'mobx-react-lite'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
type Props = {
viewControllerManager: ViewControllerManager
@@ -18,6 +20,8 @@ type Props = {
}
const NoteTag = ({ viewControllerManager, tag }: Props) => {
const { toggleAppPane } = useResponsiveAppPane()
const noteTags = viewControllerManager.noteTagsController
const { autocompleteInputFocused, focusedTagUuid, tags } = noteTags
@@ -46,15 +50,17 @@ const NoteTag = ({ viewControllerManager, tag }: Props) => {
)
const onTagClick: MouseEventHandler = useCallback(
(event) => {
async (event) => {
if (tagClicked && event.target !== deleteTagRef.current) {
setTagClicked(false)
void viewControllerManager.navigationController.setSelectedTag(tag)
await viewControllerManager.navigationController.setSelectedTag(tag)
toggleAppPane(AppPaneId.Items)
} else {
setTagClicked(true)
tagRef.current?.focus()
}
},
[viewControllerManager, tagClicked, tag],
[viewControllerManager, tagClicked, tag, toggleAppPane],
)
const onFocus = useCallback(() => {
@@ -132,7 +138,7 @@ const NoteTag = ({ viewControllerManager, tag }: Props) => {
{showDeleteButton && (
<a
ref={deleteTagRef}
type="button"
role="button"
className="ml-2 -mr-1 flex cursor-pointer border-0 bg-transparent p-0"
onBlur={onBlur}
onClick={onDeleteTagClick}
@@ -36,6 +36,7 @@ import {
import { reloadFont } from './FontFunctions'
import { NoteViewProps } from './NoteViewProps'
import IndicatorCircle from '../IndicatorCircle/IndicatorCircle'
import { classNames } from '@/Utils/ConcatenateClassNames'
const MINIMUM_STATUS_DURATION = 400
const TEXTAREA_DEBOUNCE = 100
@@ -911,7 +912,7 @@ class NoteView extends PureComponent<NoteViewProps, State> {
{this.note && (
<div id="editor-title-bar" className="content-title-bar section-title-bar z-editor-title-bar w-full">
<div className="mb-2 flex flex-wrap items-center justify-between gap-2 md:mb-0 md:flex-nowrap md:gap-0">
<div className="mb-2 flex flex-wrap items-start justify-between gap-2 md:mb-0 md:flex-nowrap md:gap-0 xl:items-center">
<div className={(this.state.noteLocked ? 'locked' : '') + ' flex-grow'}>
<div className="title overflow-auto">
<input
@@ -929,9 +930,14 @@ class NoteView extends PureComponent<NoteViewProps, State> {
/>
</div>
</div>
<div className="flex flex-col flex-wrap items-start gap-3 md:flex-row md:flex-nowrap md:items-center">
<div
className={classNames(
'flex flex-col flex-wrap items-start gap-3 md:flex-col-reverse md:items-end',
'xl:flex-row xl:flex-nowrap xl:items-center',
)}
>
{this.state.noteStatus?.message?.length && (
<div id="save-status-container">
<div id="save-status-container" className={'xl:mr-5 xl:max-w-[16ch]'}>
<div id="save-status">
<div
className={
@@ -8,12 +8,11 @@ import DecoratedInput from '../Input/DecoratedInput'
import { observer } from 'mobx-react-lite'
type Props = {
selectedViewTitle?: string
itemListController: ItemListController
searchOptionsController: SearchOptionsController
}
const SearchBar = ({ itemListController, searchOptionsController, selectedViewTitle = 'Notes' }: Props) => {
const SearchBar = ({ itemListController, searchOptionsController }: Props) => {
const searchInputRef = useRef<HTMLInputElement>(null)
const { noteFilterText, setNoteFilterText, clearFilterText, onFilterEnter } = itemListController
@@ -45,15 +44,14 @@ const SearchBar = ({ itemListController, searchOptionsController, selectedViewTi
}, [clearFilterText])
return (
<div className="px-2.5 pt-4 pb-0.5" role="search">
<div className="pt-3 pb-0.5" role="search">
<DecoratedInput
autocomplete={false}
title="Searches notes and files in the currently selected tag"
className={{
container: 'px-1',
input: 'placeholder:text-passive-0',
}}
placeholder={`Search in ${selectedViewTitle}`}
placeholder={'Search...'}
value={noteFilterText}
ref={searchInputRef}
onBlur={onSearchBlur}
@@ -70,7 +70,7 @@ const AutocompleteTagResult = ({ viewControllerManager, tagResult, closeOnBlur }
<button
ref={tagResultRef}
type="button"
className="flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-1.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:bg-info focus:text-info-contrast focus:shadow-none"
className="flex w-full cursor-pointer items-center border-0 bg-transparent px-3 py-1.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info focus:text-info-contrast focus:shadow-none"
onClick={() => onTagOptionClick(tagResult)}
onFocus={onFocus}
onBlur={onBlur}
@@ -15,6 +15,7 @@ import {
} from 'react'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { classNames } from '@/Utils/ConcatenateClassNames'
type Props = {
view: SmartView
@@ -111,7 +112,7 @@ const SmartViewsListItem: FunctionComponent<Props> = ({ view, tagsState }) => {
return (
<>
<div
className={`tag ${isSelected ? 'selected' : ''} ${isFaded ? 'opacity-50' : ''}`}
className={classNames('tag', isSelected && 'selected', isFaded && 'opacity-50')}
onClick={selectCurrentTag}
style={{
paddingLeft: `${level * PADDING_PER_LEVEL_PX + PADDING_BASE_PX}px`,
@@ -119,20 +120,25 @@ const SmartViewsListItem: FunctionComponent<Props> = ({ view, tagsState }) => {
>
<div className="tag-info">
<div className={'tag-icon mr-2'}>
<Icon type={iconType} className={`${isSelected ? 'text-info' : 'text-neutral'}`} />
<Icon type={iconType} className={isSelected ? 'text-info' : 'text-neutral'} />
</div>
<input
className={`title ${isEditing ? 'editing' : ''}`}
disabled={!isEditing}
id={`react-tag-${view.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyUp={onKeyUp}
spellCheck={false}
ref={inputRef}
/>
<div className="count">{view.uuid === SystemViewId.AllNotes && tagsState.allNotesCount}</div>
{isEditing ? (
<input
className={'title editing'}
id={`react-tag-${view.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyUp={onKeyUp}
spellCheck={false}
ref={inputRef}
/>
) : (
<div className={'title overflow-hidden text-left'} id={`react-tag-${view.uuid}`}>
{title}
</div>
)}
<div className={'count'}>{view.uuid === SystemViewId.AllNotes && tagsState.allNotesCount}</div>
</div>
{!isSystemView(view) && (
@@ -178,20 +178,26 @@ export const TagsListItem: FunctionComponent<Props> = observer(({ tag, features,
const readyToDrop = isOver && canDrop
const toggleContextMenu = useCallback(() => {
if (!menuButtonRef.current) {
return
}
const toggleContextMenu: MouseEventHandler<HTMLAnchorElement> = useCallback(
(event) => {
event.preventDefault()
event.stopPropagation()
const contextMenuOpen = tagsState.contextMenuOpen
const menuButtonRect = menuButtonRef.current?.getBoundingClientRect()
if (!menuButtonRef.current) {
return
}
if (contextMenuOpen) {
tagsState.setContextMenuOpen(false)
} else {
onContextMenu(tag, menuButtonRect.right, menuButtonRect.top)
}
}, [onContextMenu, tagsState, tag])
const contextMenuOpen = tagsState.contextMenuOpen
const menuButtonRect = menuButtonRef.current?.getBoundingClientRect()
if (contextMenuOpen) {
tagsState.setContextMenuOpen(false)
} else {
onContextMenu(tag, menuButtonRect.right, menuButtonRect.top)
}
},
[onContextMenu, tagsState, tag],
)
return (
<>
@@ -224,17 +230,25 @@ export const TagsListItem: FunctionComponent<Props> = observer(({ tag, features,
<div className={'tag-icon draggable mr-2'} ref={dragRef}>
<Icon type="hashtag" className={`${isSelected ? 'text-info' : 'text-neutral'}`} />
</div>
<input
className={`title focus:shadow-none focus:outline-none ${isEditing ? 'editing' : ''}`}
id={`react-tag-${tag.uuid}`}
disabled={!isEditing}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyDown={onKeyDown}
spellCheck={false}
ref={inputRef}
/>
{isEditing ? (
<input
className={'title editing focus:shadow-none focus:outline-none'}
id={`react-tag-${tag.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyDown={onKeyDown}
spellCheck={false}
ref={inputRef}
/>
) : (
<div
className={'title overflow-hidden text-left focus:shadow-none focus:outline-none'}
id={`react-tag-${tag.uuid}`}
>
{title}
</div>
)}
<div className="flex items-center">
<a
role="button"
@@ -53,7 +53,7 @@ const TagsSection: FunctionComponent<Props> = ({ viewControllerManager }) => {
return (
<section>
<div className="section-title-bar">
<div className={'section-title-bar'}>
<div className="section-title-bar-header">
<TagsSectionTitle
features={viewControllerManager.featuresController}
@@ -1,10 +1,17 @@
import { destroyAllObjectProperties, isDev } from '@/Utils'
import { action, computed, makeObservable, observable, runInAction } from 'mobx'
import { ApplicationEvent, ContentType, InternalEventBus, SNNote, SNTag } from '@standardnotes/snjs'
import {
ApplicationEvent,
ContentType,
InternalEventBus,
SNNote,
SNTag,
ItemCounterInterface,
ItemCounts,
} from '@standardnotes/snjs'
import { WebApplication } from '@/Application/Application'
import { AccountMenuPane } from '@/Components/AccountMenu/AccountMenuPane'
import { AbstractViewController } from '../Abstract/AbstractViewController'
import { StructuredItemsCount } from './StructuredItemsCount'
export class AccountMenuController extends AbstractViewController {
show = false
@@ -28,7 +35,7 @@ export class AccountMenuController extends AbstractViewController {
destroyAllObjectProperties(this)
}
constructor(application: WebApplication, eventBus: InternalEventBus) {
constructor(application: WebApplication, eventBus: InternalEventBus, private itemCounter: ItemCounterInterface) {
super(application, eventBus)
makeObservable(this, {
@@ -152,30 +159,7 @@ export class AccountMenuController extends AbstractViewController {
return this.notesAndTags.length
}
get structuredNotesAndTagsCount(): StructuredItemsCount {
const count: StructuredItemsCount = {
notes: 0,
archived: 0,
deleted: 0,
tags: 0,
}
for (const item of this.notesAndTags) {
if (item.archived) {
count.archived++
}
if (item.trashed) {
count.deleted++
}
if (item.content_type === ContentType.Note) {
count.notes++
}
if (item.content_type === ContentType.Tag) {
count.tags++
}
}
return count
get structuredNotesAndTagsCount(): ItemCounts {
return this.itemCounter.countNotesAndTags(this.notesAndTags)
}
}
@@ -302,7 +302,7 @@ export class FilesController extends AbstractViewController {
const selectedFiles =
fileOrHandle instanceof File
? [fileOrHandle]
: StreamingFileReader.available() && fileOrHandle instanceof FileSystemFileHandle
: shouldUseStreamingReader && fileOrHandle instanceof FileSystemFileHandle
? await StreamingFileReader.getFilesFromHandles([fileOrHandle])
: await picker.selectFiles()
@@ -2,7 +2,14 @@ import { storage, StorageKey } from '@standardnotes/ui-services'
import { WebApplication } from '@/Application/Application'
import { AccountMenuController } from '@/Controllers/AccountMenu/AccountMenuController'
import { destroyAllObjectProperties } from '@/Utils'
import { ApplicationEvent, DeinitSource, WebOrDesktopDeviceInterface, InternalEventBus } from '@standardnotes/snjs'
import {
ApplicationEvent,
DeinitSource,
WebOrDesktopDeviceInterface,
InternalEventBus,
ItemCounterInterface,
ItemCounter,
} from '@standardnotes/snjs'
import { action, makeObservable, observable } from 'mobx'
import { ActionsMenuController } from './ActionsMenuController'
import { FeaturesController } from './FeaturesController'
@@ -52,10 +59,13 @@ export class ViewControllerManager {
private appEventObserverRemovers: (() => void)[] = []
private eventBus: InternalEventBus
private itemCounter: ItemCounterInterface
constructor(public application: WebApplication, private device: WebOrDesktopDeviceInterface) {
this.eventBus = new InternalEventBus()
this.itemCounter = new ItemCounter()
this.selectionController = new SelectedItemsController(application, this.eventBus)
this.noteTagsController = new NoteTagsController(application, this.eventBus)
@@ -90,7 +100,7 @@ export class ViewControllerManager {
this.noAccountWarningController = new NoAccountWarningController(application, this.eventBus)
this.accountMenuController = new AccountMenuController(application, this.eventBus)
this.accountMenuController = new AccountMenuController(application, this.eventBus, this.itemCounter)
this.subscriptionController = new SubscriptionController(application, this.eventBus)
@@ -0,0 +1,38 @@
import { isIOS } from '@/Utils'
import { RefObject, useCallback, useEffect } from 'react'
import { useLongPressEvent } from './useLongPress'
export const useContextMenuEvent = (elementRef: RefObject<HTMLElement>, listener: (x: number, y: number) => void) => {
const { attachEvents, cleanupEvents } = useLongPressEvent(elementRef, listener)
const handleContextMenuEvent = useCallback(
(event: MouseEvent) => {
event.preventDefault()
listener(event.clientX, event.clientY)
},
[listener],
)
useEffect(() => {
const element = elementRef.current
if (!element) {
return
}
const shouldUseLongPress = isIOS()
element.addEventListener('contextmenu', handleContextMenuEvent)
if (shouldUseLongPress) {
attachEvents()
}
return () => {
element.removeEventListener('contextmenu', handleContextMenuEvent)
if (shouldUseLongPress) {
cleanupEvents()
}
}
}, [attachEvents, cleanupEvents, elementRef, handleContextMenuEvent, listener])
}
@@ -0,0 +1,59 @@
import { RefObject, useCallback, useMemo, useRef } from 'react'
// According to https://reactnative.dev/docs/touchablewithoutfeedback#onlongpress
const ReactNativeLongpressDelay = 370
export const useLongPressEvent = (
elementRef: RefObject<HTMLElement>,
listener: (x: number, y: number) => void,
delay = ReactNativeLongpressDelay,
) => {
const longPressTimeout = useRef<number>()
const clearLongPressTimeout = useCallback(() => {
if (longPressTimeout.current) {
clearTimeout(longPressTimeout.current)
}
}, [])
const createLongPressTimeout = useCallback(
(event: PointerEvent) => {
clearLongPressTimeout()
longPressTimeout.current = window.setTimeout(() => {
const x = event.clientX
const y = event.clientY
listener(x, y)
}, delay)
},
[clearLongPressTimeout, delay, listener],
)
const attachEvents = useCallback(() => {
if (!elementRef.current) {
return
}
elementRef.current.addEventListener('pointerdown', createLongPressTimeout)
elementRef.current.addEventListener('pointercancel', clearLongPressTimeout)
}, [clearLongPressTimeout, createLongPressTimeout, elementRef])
const cleanupEvents = useCallback(() => {
if (!elementRef.current) {
return
}
elementRef.current.removeEventListener('pointerdown', createLongPressTimeout)
elementRef.current.removeEventListener('pointercancel', clearLongPressTimeout)
}, [clearLongPressTimeout, createLongPressTimeout, elementRef])
const memoizedReturn = useMemo(
() => ({
attachEvents,
cleanupEvents,
}),
[attachEvents, cleanupEvents],
)
return memoizedReturn
}
@@ -1,6 +1,7 @@
import { Platform, platformFromString } from '@standardnotes/snjs'
import { IsDesktopPlatform, IsWebPlatform } from '@/Constants/Version'
import { EMAIL_REGEX } from '../Constants/Constants'
export { isMobile } from './IsMobile'
declare const process: {
@@ -170,3 +171,35 @@ export const openInNewTab = (url: string) => {
export const convertStringifiedBooleanToBoolean = (value: string) => {
return value !== 'false'
}
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios/9039885#9039885
export const isIOS = () =>
(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) ||
(navigator.userAgent.includes('Mac') && 'ontouchend' in document && navigator.maxTouchPoints > 1)
// https://stackoverflow.com/a/57527009/2504429
export const disableIosTextFieldZoom = () => {
const addMaximumScaleToMetaViewport = () => {
const viewportMetaElement = document.querySelector('meta[name=viewport]')
if (viewportMetaElement !== null) {
let content = viewportMetaElement.getAttribute('content')
if (!content) {
return
}
const maximumScaleRegex = /maximum-scale=[0-9.]+/g
if (maximumScaleRegex.test(content)) {
content = content.replace(maximumScaleRegex, 'maximum-scale=1.0')
} else {
content = [content, 'maximum-scale=1.0'].join(', ')
}
viewportMetaElement.setAttribute('content', content)
}
}
if (isIOS()) {
addMaximumScaleToMetaViewport()
}
}
@@ -9,22 +9,6 @@
}
}
.app-column-first {
width: 220px;
@media screen and (max-width: 768px) {
width: 100% !important;
}
}
.app-column-second {
width: 350px;
@media screen and (max-width: 768px) {
width: 100% !important;
}
}
.app-column {
overflow: hidden;
@@ -67,11 +67,6 @@ $heading-height: 75px;
position: relative;
min-width: 16ch;
overflow: visible;
margin-right: 20px;
@media screen and (min-width: 768px) {
max-width: 16ch;
}
}
#save-status {
+4
View File
@@ -108,8 +108,12 @@ p {
}
.main-ui-view {
// Fallbacks
min-height: 100vh;
height: 100vh;
// Mobile-corrected viewport height
min-height: var(--viewport-height);
height: var(--viewport-height);
position: relative;
overflow: auto;
background-color: var(--editor-header-bar-background-color);
+11
View File
@@ -1,4 +1,5 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/javascripts/**/*.tsx', '../toast/src/**/*.tsx'],
theme: {
@@ -9,6 +10,7 @@ module.exports = {
26: '6.5rem',
30: '7.5rem',
70: '17.5rem',
87.5: '21.875rem',
125: '31.25rem',
160: '40rem',
},
@@ -70,6 +72,15 @@ module.exports = {
fontSize: {
'menu-item': '0.813rem',
},
screens: {
'xsm-only': { min: '320px', max: '639px' },
'sm-only': { min: '640px', max: '767px' },
'md-only': { min: '768px', max: '1023px' },
'lg-only': { min: '1024px', max: '1279px' },
},
transitionProperty: {
width: 'width',
},
},
colors: {
transparent: 'transparent',
+1 -10
View File
@@ -12,16 +12,7 @@ module.exports = (env, argv) => {
optimization: {
minimize: false,
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html',
inject: true,
templateParameters: {
env: process.env,
},
}),
new ReactRefreshWebpackPlugin(),
],
plugins: [new ReactRefreshWebpackPlugin()],
devServer: {
hot: true,
static: './dist',