Compare commits

...
Author SHA1 Message Date
StandardNotes CI 8145cdb8ac chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].2
2022-11-27 11:55:50 +00:00
Aman Harwara d50c5fefcb chore: fix types 2022-11-27 16:59:58 +05:30
Aman Harwara 745e850a5c chore: fix types 2022-11-27 16:48:30 +05:30
Aman Harwara cadf03f0ef refactor: correct type autocomplete for <Icon/> type 2022-11-27 16:33:52 +05:30
StandardNotes CI 931b674e4e chore(release): publish
- @standardnotes/[email protected].4
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-11-25 13:07:41 +00:00
Mo a6efc5336b fix: issue where plaintext editor autofocus would interfere with sign in form 2022-11-25 06:41:40 -06:00
StandardNotes CI 21611d9b45 chore(release): publish
- @standardnotes/[email protected].3
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-11-25 08:57:51 +00:00
Karol Sójko 9b91875d3d Revert "chore: e2e tests opt in"
This reverts commit 4661c6cb77.
2022-11-25 09:32:28 +01:00
Aman Harwara dcc8cfbe45 feat: Markdown, HTML & JSON export options for super notes (#2054) 2022-11-25 13:58:44 +05:30
StandardNotes CI ff1d71c2f8 chore(release): publish
- @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].1
2022-11-24 18:44:27 +00:00
Karol Sójko 81b5123294 fix(snjs): initial value of subscription ids on files test - run e2e 2022-11-24 19:14:07 +01:00
Karol Sójko 7a89a3cd9c fix(snjs): subscription id increments - run e2e 2022-11-24 19:06:04 +01:00
StandardNotes CI 08fd234e60 chore(release): publish
- @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].0
2022-11-24 16:35:47 +00:00
Karol Sójko 0fac2dd939 fix(snjs): decrease factory sleep in order to have a continuing session - run e2e 2022-11-24 17:03:37 +01:00
Karol Sójko 212e7843ec fix(snjs): remove extra sign in - run e2e 2022-11-24 16:56:08 +01:00
Karol Sójko 6bbf0c02bd fix(snjs): add additional sign in missing - run e2e 2022-11-24 16:40:24 +01:00
Aman Harwara 2485bed350 feat: resize images in super editor (#2052) 2022-11-24 21:06:09 +05:30
Mo 2e517c985d fix: include more search results in linking autocomplete menu 2022-11-24 09:30:13 -06:00
Karol Sójko 75303b5eb8 fix(snjs): run e2e 2022-11-24 16:17:03 +01:00
StandardNotes CI b5997aa70e chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
2022-11-24 15:15:06 +00:00
Karol Sójko 07e26915b0 fix: subscription expiring event 2022-11-24 15:59:57 +01:00
Mo 4661c6cb77 chore: e2e tests opt in 2022-11-24 08:43:54 -06:00
Mo 0d1e0d730d chore: re-add version numbers to mobile and desktop, though unused, but required for some lerna scripts 2022-11-24 06:20:28 -06:00
Mo 7ef0db545c chore(ci): trigger desktop and mobile builds on web tag 2022-11-24 06:17:27 -06:00
StandardNotes CI 9f6316976c chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-11-24 12:06:34 +00:00
Mo 0a01ddb430 feat: New 'What's New' section in Preferences (#2049) (skip e2e) 2022-11-24 05:46:44 -06:00
Karol Sójko c40b17bd4c fix(snjs): factory timeout to propagate subscription purchase 2022-11-24 11:40:23 +01:00
Mo 858fa6835c chore: add json changelog file 2022-11-23 14:49:57 -06:00
StandardNotes CI 96babc454d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-11-23 17:35:33 +00:00
Mo 8579ff39b1 feat: option to show markdown preview for super notes (skip e2e) (#2048) 2022-11-23 11:22:01 -06:00
Karol Sójko 99163d90d2 fix(snjs): wait timeout after subscription purchase 2022-11-23 18:00:29 +01:00
Aman Harwara 8a709158d6 feat: dim checked list items in super editor (#2046) 2022-11-23 20:53:04 +05:30
Karol Sójko 25cf4cfd22 fix(snjs): file subscriptions tests subscription assignment 2022-11-23 16:02:14 +01:00
Aman Harwara 9f8e937766 Merge branch 'main' of github.com:standardnotes/app 2022-11-23 20:16:51 +05:30
Aman Harwara 9d5a57521e fix: change editor button icon & selection 2022-11-23 20:16:43 +05:30
Karol Sójko e36a1ffea0 fix(snjs): adjust file bytes used expected 2022-11-23 15:28:33 +01:00
Karol Sójko b05c793fe9 fix(snjs): remove unnecessary file uploaded event in tests 2022-11-23 15:04:04 +01:00
Karol Sójko c45417623c fix(snjs): subscription events in tests 2022-11-23 13:59:52 +01:00
StandardNotes CI 6704c6dd4e chore(release): publish
- @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].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
2022-11-23 12:55:12 +00:00
Aman Harwara 87cd31ae5d feat: use line height preference in super editor (skip e2e) (#2045) 2022-11-23 18:05:15 +05:30
171 changed files with 16385 additions and 514 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ name: Desktop Release
on:
push:
tags:
- '*standardnotes/*desktop*'
- '*standardnotes/*web*'
- '!*standardnotes/*inner-desktop*'
workflow_dispatch:
+9 -7
View File
@@ -27,14 +27,14 @@ jobs:
cache: 'yarn'
- run: yarn install --immutable
- run: yarn build:desktop
- run: echo APP_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: Compile Mac
run: yarn run webpack --config desktop.webpack.prod.js
- name: MacX64
run: |
yarn run electron-builder --mac --x64 --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
node scripts/fixMacZip.js
node scripts/fixMacZip.js ${{ env.APP_VERSION }}
- name: MacArm64
run: yarn run electron-builder --mac --arm64 --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
@@ -69,7 +69,7 @@ jobs:
- run: yarn install --immutable
- run: yarn build:desktop
- run: echo APP_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: Compile for AppImage
run: yarn run webpack --config desktop.webpack.prod.js
@@ -139,7 +139,7 @@ jobs:
- run: yarn install --immutable
- run: yarn build:desktop
- run: yarn run webpack --config desktop.webpack.prod.js
- run: echo APP_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- run: yarn run electron-builder --windows --x64 --ia32 --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Upload
@@ -160,6 +160,8 @@ jobs:
run:
working-directory: packages/desktop
steps:
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
@@ -194,8 +196,8 @@ jobs:
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.CI_PAT_TOKEN }}
tag_name: "@standardnotes/desktop@${{ steps.package-version.outputs.current-version}}"
name: "Desktop ${{ steps.package-version.outputs.current-version }}"
tag_name: "@standardnotes/desktop@${{ env.APP_VERSION }}"
name: "Desktop ${{ env.APP_VERSION }}"
body: ${{ steps.release-notes.outputs.result }}
prerelease: true
draft: false
@@ -214,4 +216,4 @@ jobs:
sudo snap install snapcraft --classic
echo "${{ secrets.SNAPCRAFT_LOGIN_FILE }}" >> snapauth.txt
snapcraft login --with=snapauth.txt
snapcraft upload dist/standard-notes-${{ steps.package-version.outputs.current-version}}-linux-amd64.snap --release stable,candidate,beta,edge
snapcraft upload dist/standard-notes-${{ env.APP_VERSION }}-linux-amd64.snap --release stable,candidate,beta,edge
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
- run: yarn install --immutable
- run: yarn build:desktop
- run: yarn run webpack --config desktop.webpack.prod.js
- run: echo APP_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- run: yarn run electron-builder --windows --x64 --ia32 --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Upload
+3 -3
View File
@@ -3,7 +3,7 @@ name: Mobile Release Production
on:
push:
tags:
- '*standardnotes/mobile*'
- '*standardnotes/web*'
workflow_dispatch:
jobs:
@@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v3
- name: Export version from package.json
run:
echo "PACKAGE_VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
- name: Setup react-native kernel and increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Decode Production Android keystore
@@ -82,7 +82,7 @@ jobs:
uses: actions/checkout@v3
- name: Export version from package.json
run:
echo "PACKAGE_VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
- name: Install dependencies
run: yarn install --immutable && yarn install:pods
- run: yarn build:mobile
+3 -3
View File
@@ -3,7 +3,7 @@ name: Mobile TestFlight
on:
push:
tags:
- '*standardnotes/mobile*'
- '*standardnotes/web*'
workflow_dispatch:
jobs:
@@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v3
- name: Export version from package.json
run: |
echo "PACKAGE_VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
- name: Setup react-native kernel and increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Decode Dev Android keystore
@@ -61,7 +61,7 @@ jobs:
uses: actions/checkout@v3
- name: Export version from package.json
run: |
echo "PACKAGE_VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
- name: Ruby Setup for Fastlane
uses: ruby/setup-ruby@v1
- name: Install dependencies
+2 -1
View File
@@ -31,7 +31,8 @@
"reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install",
"release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"",
"publish:prod": "lerna publish from-git --yes --no-verify-access --loglevel verbose",
"version": "yarn install --no-immutable && git add yarn.lock",
"version": "yarn install --no-immutable && git add yarn.lock && yarn changelog:json",
"changelog:json": "node scripts/ChangelogToJson.js && git add .",
"postversion": "./scripts/push-tags-one-by-one.sh",
"workspace:list": " yarn lerna list -all",
"upgrade:snjs": "ncu -u '@standardnotes/*' && yarn workspaces foreach --verbose run upgrade:snjs"
+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.20.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/api
## [1.20.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/api
## [1.20.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/api
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.20.9",
"version": "1.20.11",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+13
View File
@@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.9.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
* dim checked list items in super editor ([#2046](https://github.com/standardnotes/app/issues/2046)) ([8a70915](https://github.com/standardnotes/app/commit/8a709158d6839b9eb1092923a14b0dcadb0da25b))
* option to show markdown preview for super notes (skip e2e) ([#2048](https://github.com/standardnotes/app/issues/2048)) ([8579ff3](https://github.com/standardnotes/app/commit/8579ff39b1f81dbbcf22b4031ede183ab4287262))
# [1.8.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
* use line height preference in super editor (skip e2e) ([#2045](https://github.com/standardnotes/app/issues/2045)) ([87cd31a](https://github.com/standardnotes/app/commit/87cd31ae5d630a528ce6d4895b2c144bf51808f0))
# [1.7.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-19)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/blocks-editor",
"version": "1.7.0",
"version": "1.9.0",
"private": true,
"main": "./src/index.ts",
"scripts": {
@@ -7,12 +7,6 @@ import {CheckListPlugin} from '@lexical/react/LexicalCheckListPlugin';
import {ClearEditorPlugin} from '@lexical/react/LexicalClearEditorPlugin';
import {MarkdownShortcutPlugin} from '@lexical/react/LexicalMarkdownShortcutPlugin';
import {TablePlugin} from '@lexical/react/LexicalTablePlugin';
import {
CHECK_LIST,
ELEMENT_TRANSFORMERS,
TEXT_FORMAT_TRANSFORMERS,
TEXT_MATCH_TRANSFORMERS,
} from '@lexical/markdown';
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary';
import {HashtagPlugin} from '@lexical/react/LexicalHashtagPlugin';
import {HistoryPlugin} from '@lexical/react/LexicalHistoryPlugin';
@@ -30,14 +24,19 @@ import FloatingTextFormatToolbarPlugin from '../Lexical/Plugins/FloatingTextForm
import FloatingLinkEditorPlugin from '../Lexical/Plugins/FloatingLinkEditorPlugin';
import {truncateString} from './Utils';
import {SuperEditorContentId} from './Constants';
import {classNames} from '@standardnotes/utils';
import {EditorLineHeight} from '@standardnotes/snjs';
import {MarkdownTransformers} from './MarkdownTransformers';
type BlocksEditorProps = {
onChange: (value: string, preview: string) => void;
onChange?: (value: string, preview: string) => void;
className?: string;
children?: React.ReactNode;
previewLength: number;
previewLength?: number;
spellcheck?: boolean;
ignoreFirstChange?: boolean;
lineHeight?: EditorLineHeight;
readonly?: boolean;
};
export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
@@ -47,6 +46,8 @@ export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
previewLength,
spellcheck,
ignoreFirstChange = false,
lineHeight,
readonly,
}) => {
const [didIgnoreFirstChange, setDidIgnoreFirstChange] = useState(false);
const handleChange = useCallback(
@@ -65,11 +66,14 @@ export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
previewText += '\n';
}
});
previewText = truncateString(previewText, previewLength);
if (previewLength) {
previewText = truncateString(previewText, previewLength);
}
try {
const stringifiedEditorState = JSON.stringify(editorState.toJSON());
onChange(stringifiedEditorState, previewText);
onChange?.(stringifiedEditorState, previewText);
} catch (error) {
window.alert(
`An invalid change was made inside the Super editor. Your change was not saved. Please report this error to the team: ${error}`,
@@ -98,7 +102,11 @@ export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
<div className="editor" ref={onRef}>
<ContentEditable
id={SuperEditorContentId}
className={`ContentEditable__root overflow-y-auto ${className}`}
className={classNames(
'ContentEditable__root overflow-y-auto',
lineHeight && `leading-${lineHeight.toLowerCase()}`,
className,
)}
spellCheck={spellcheck}
/>
</div>
@@ -108,14 +116,7 @@ export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
ErrorBoundary={LexicalErrorBoundary}
/>
<ListPlugin />
<MarkdownShortcutPlugin
transformers={[
CHECK_LIST,
...ELEMENT_TRANSFORMERS,
...TEXT_FORMAT_TRANSFORMERS,
...TEXT_MATCH_TRANSFORMERS,
]}
/>
<MarkdownShortcutPlugin transformers={MarkdownTransformers} />
<TablePlugin />
<OnChangePlugin onChange={handleChange} ignoreSelectionChange={true} />
<HistoryPlugin />
@@ -130,7 +131,7 @@ export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
<TwitterPlugin />
<YouTubePlugin />
<CollapsiblePlugin />
{floatingAnchorElem && (
{!readonly && floatingAnchorElem && (
<>
<FloatingTextFormatToolbarPlugin anchorElem={floatingAnchorElem} />
<FloatingLinkEditorPlugin />
@@ -0,0 +1,13 @@
import {
CHECK_LIST,
ELEMENT_TRANSFORMERS,
TEXT_FORMAT_TRANSFORMERS,
TEXT_MATCH_TRANSFORMERS,
} from '@lexical/markdown';
export const MarkdownTransformers = [
CHECK_LIST,
...ELEMENT_TRANSFORMERS,
...TEXT_FORMAT_TRANSFORMERS,
...TEXT_MATCH_TRANSFORMERS,
];
@@ -325,6 +325,7 @@
}
.Lexical__listItemChecked {
text-decoration: line-through;
opacity: 0.4;
}
.Lexical__listItemUnchecked:before,
.Lexical__listItemChecked:before {
+1
View File
@@ -1,3 +1,4 @@
export * from './Editor/BlocksEditor';
export * from './Editor/BlocksEditorComposer';
export * from './Editor/Constants';
export * from './Editor/MarkdownTransformers';
+34
View File
@@ -3,6 +3,40 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.102.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/desktop
## [3.102.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
**Note:** Version bump only for package @standardnotes/desktop
## [3.102.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
**Note:** Version bump only for package @standardnotes/desktop
## [3.102.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/desktop
## [3.102.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/desktop
# [3.102.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Features
* New 'What's New' section in Preferences ([#2049](https://github.com/standardnotes/app/issues/2049)) (skip e2e) ([0a01ddb](https://github.com/standardnotes/app/commit/0a01ddb430154fa4518985458c15c644855c80ea))
## [3.101.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/desktop
## [3.101.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/desktop
# [3.101.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.101.0",
"version": "3.102.5",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+1 -1
View File
@@ -31,7 +31,7 @@ async function getBlockMapInfo(fileName) {
;(async () => {
try {
const { version } = JSON.parse(await fs.promises.readFile('package.json'))
const version = process.argv.slice(2)[0]
const zipName = `standard-notes-${version}-mac-x64.zip`
const zipPath = `dist/${zipName}`
console.log(`Removing ${zipPath}`)
+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.19.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/encryption
## [1.19.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/encryption
## [1.19.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/encryption
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.19.17",
"version": "1.19.19",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.26.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.26.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/filepicker
# [1.26.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.26.0",
"version": "1.26.2",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.13.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/files
## [1.13.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/files
# [1.13.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.13.0",
"version": "1.13.2",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+34
View File
@@ -3,6 +3,40 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.47.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/mobile
## [3.47.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
**Note:** Version bump only for package @standardnotes/mobile
## [3.47.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
**Note:** Version bump only for package @standardnotes/mobile
## [3.47.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/mobile
## [3.47.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/mobile
# [3.47.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Features
* New 'What's New' section in Preferences ([#2049](https://github.com/standardnotes/app/issues/2049)) (skip e2e) ([0a01ddb](https://github.com/standardnotes/app/commit/0a01ddb430154fa4518985458c15c644855c80ea))
## [3.46.31](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/mobile
## [3.46.30](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/mobile
## [3.46.29](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/mobile
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.46.29",
"version": "3.47.5",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
@@ -4,7 +4,6 @@ import { Keyboard, Platform } from 'react-native'
import VersionInfo from 'react-native-version-info'
import { WebView, WebViewMessageEvent } from 'react-native-webview'
import { OnShouldStartLoadWithRequest } from 'react-native-webview/lib/WebViewTypes'
import pjson from '../package.json'
import { AndroidBackHandlerService } from './AndroidBackHandlerService'
import { AppStateObserverService } from './AppStateObserverService'
import { ColorSchemeObserverService } from './ColorSchemeObserverService'
@@ -129,7 +128,7 @@ const MobileWebAppContents = ({ destroyAndReload }: { destroyAndReload: () => vo
const WebProcessDeviceInterface = `
class WebProcessDeviceInterface {
constructor(messageSender) {
this.appVersion = '${pjson.version} (${VersionInfo.buildVersion})'
this.appVersion = '${VersionInfo.appVersion} (${VersionInfo.buildVersion})'
this.environment = 3
this.platform = ${device.platform}
this.databases = []
+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.37.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/models
## [1.37.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/models
## [1.37.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/models
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.37.6",
"version": "1.37.8",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -1,6 +1,6 @@
export type VectorIconNameOrEmoji = EmojiString | IconType
export type EmojiString = string
export type EmojiString = Omit<string, IconType>
export type IconType =
| 'accessibility'
+38
View File
@@ -3,6 +3,44 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/releases
# [1.4.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Features
* New 'What's New' section in Preferences ([#2049](https://github.com/standardnotes/app/issues/2049)) (skip e2e) ([0a01ddb](https://github.com/standardnotes/app/commit/0a01ddb430154fa4518985458c15c644855c80ea))
## [1.3.257](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.256](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.255](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.255",
"version": "1.4.6",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+3 -3
View File
@@ -5,13 +5,13 @@ import { writeJson, ensureDirExists } from '../../../scripts/ScriptUtils.mjs'
const CdnUrl = 'https://github.com/standardnotes/app/releases/download/'
const DesktopPackageName = '@standardnotes/desktop'
const DesktopVersion = Desktop.version
const DesktopVersion = Web.version
const BaseFileName = `standard-notes-${DesktopVersion}`
const ReleaseUrl = `${CdnUrl}${DesktopPackageName}@${DesktopVersion}/${BaseFileName}`.replaceAll('@', '%40')
const Versions = {
[Desktop.name]: Desktop.version,
[Mobile.name]: Mobile.version,
[Desktop.name]: Web.version,
[Mobile.name]: Web.version,
[Web.name]: Web.version,
}
+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.
## [1.47.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/services
# [1.47.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Features
* New 'What's New' section in Preferences ([#2049](https://github.com/standardnotes/app/issues/2049)) (skip e2e) ([0a01ddb](https://github.com/standardnotes/app/commit/0a01ddb430154fa4518985458c15c644855c80ea))
## [1.46.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/services
# [1.46.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.46.0",
"version": "1.47.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -39,6 +39,7 @@ export enum StorageKey {
DeinitMode = 'deinit_mode',
CodeVerifier = 'code_verifier',
LaunchPriorityUuids = 'launch_priority_uuids',
LastReadChangelogVersion = 'last_read_changelog_version',
}
export enum NonwrappedStorageKey {
+50
View File
@@ -3,6 +3,56 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.152.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/snjs
## [2.152.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Bug Fixes
* **snjs:** initial value of subscription ids on files test - run e2e ([81b5123](https://github.com/standardnotes/app/commit/81b51232940b5fade61ad6e72237f739607bed2b))
* **snjs:** subscription id increments - run e2e ([7a89a3c](https://github.com/standardnotes/app/commit/7a89a3cd9cb2c364d3b22da96c894040bcf7167b))
## [2.152.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Bug Fixes
* **snjs:** add additional sign in missing - run e2e ([6bbf0c0](https://github.com/standardnotes/app/commit/6bbf0c02bda0350772638ee19424420b6430dec3))
* **snjs:** decrease factory sleep in order to have a continuing session - run e2e ([0fac2dd](https://github.com/standardnotes/app/commit/0fac2dd93974f7072e5e3a73ef705836e163dcac))
* **snjs:** remove extra sign in - run e2e ([212e784](https://github.com/standardnotes/app/commit/212e7843ec2ec565c46e06a3acd52a7bbfc16f0b))
* **snjs:** run e2e ([75303b5](https://github.com/standardnotes/app/commit/75303b5eb8c1e403541bca57b20ae293cb67f979))
## [2.152.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Bug Fixes
* subscription expiring event ([07e2691](https://github.com/standardnotes/app/commit/07e26915b07656e813d439a24f8d4682ba6773af))
# [2.152.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Bug Fixes
* **snjs:** factory timeout to propagate subscription purchase ([c40b17b](https://github.com/standardnotes/app/commit/c40b17bd4cdb943b299e3cb17f0cbb5ce8e736e2))
### Features
* New 'What's New' section in Preferences ([#2049](https://github.com/standardnotes/app/issues/2049)) (skip e2e) ([0a01ddb](https://github.com/standardnotes/app/commit/0a01ddb430154fa4518985458c15c644855c80ea))
## [2.151.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Bug Fixes
* **snjs:** adjust file bytes used expected ([e36a1ff](https://github.com/standardnotes/app/commit/e36a1ffea0aba9e860c511fa64e0b0ad87890b30))
* **snjs:** file subscriptions tests subscription assignment ([25cf4cf](https://github.com/standardnotes/app/commit/25cf4cfd2210b4032f362b4ec86ff6c6aa485891))
* **snjs:** remove unnecessary file uploaded event in tests ([b05c793](https://github.com/standardnotes/app/commit/b05c793fe9c0016ce744eace14871291511399a6))
* **snjs:** subscription events in tests ([c454176](https://github.com/standardnotes/app/commit/c45417623cc65f4369183069b9df0ba97e9f9965))
* **snjs:** wait timeout after subscription purchase ([99163d9](https://github.com/standardnotes/app/commit/99163d90d2084d118433afe311362a1f943087b7))
## [2.151.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/snjs
## [2.151.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/snjs
@@ -291,6 +291,10 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
return this.alertService
}
public get storage(): ExternalServices.StorageServiceInterface {
return this.diskStorageService
}
public computePrivateUsername(username: string): Promise<string | undefined> {
return ComputePrivateUsername(this.options.crypto, username)
}
@@ -38,19 +38,21 @@ export class SNWebSocketsService extends AbstractService<WebSocketsServiceEvent,
}
async startWebSocketConnection(): Promise<void> {
if (!this.webSocketUrl) {
return
}
const webSocketConectionToken = await this.createWebSocketConnectionToken()
if (webSocketConectionToken === undefined) {
return
}
if (this.webSocketUrl) {
try {
this.webSocket = new WebSocket(`${this.webSocketUrl}?authToken=${webSocketConectionToken}`)
this.webSocket.onmessage = this.onWebSocketMessage.bind(this)
this.webSocket.onclose = this.onWebSocketClose.bind(this)
} catch (e) {
console.error('Error starting WebSocket connection', e)
}
try {
this.webSocket = new WebSocket(`${this.webSocketUrl}?authToken=${webSocketConectionToken}`)
this.webSocket.onmessage = this.onWebSocketMessage.bind(this)
this.webSocket.onclose = this.onWebSocketClose.bind(this)
} catch (e) {
console.error('Error starting WebSocket connection', e)
}
}
+21 -11
View File
@@ -12,6 +12,7 @@ describe('files', function () {
let context
let fileService
let itemManager
let subscriptionId = 1001
beforeEach(function () {
localStorage.clear()
@@ -39,13 +40,20 @@ describe('files', function () {
if (subscription) {
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
userEmail: context.email,
subscriptionId: 1,
subscriptionName: 'PLUS_PLAN',
subscriptionId: subscriptionId++,
subscriptionName: 'PRO_PLAN',
subscriptionExpiresAt: (new Date().getTime() + 3_600_000) * 1_000,
timestamp: Date.now(),
offline: false,
discountCode: null,
limitedDiscountPurchased: false,
newSubscriber: true,
totalActiveSubscriptionsCount: 1,
userRegisteredAt: 1,
billingFrequency: 12,
payAmount: 59.00
})
await Factory.sleep(0.25)
await Factory.sleep(2)
}
}
@@ -56,6 +64,7 @@ describe('files', function () {
it('should create valet token from server', async function () {
await setup({ fakeCrypto: true, subscription: true })
const remoteIdentifier = Utils.generateUuid()
const token = await application.apiService.createFileValetToken(remoteIdentifier, 'write')
@@ -76,14 +85,21 @@ describe('files', function () {
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
userEmail: context.email,
subscriptionId: 1,
subscriptionId: subscriptionId++,
subscriptionName: 'PLUS_PLAN',
subscriptionExpiresAt: (new Date().getTime() - 3_600_000) * 1_000,
timestamp: Date.now(),
offline: false,
discountCode: null,
limitedDiscountPurchased: false,
newSubscriber: true,
totalActiveSubscriptionsCount: 1,
userRegisteredAt: 1,
billingFrequency: 12,
payAmount: 59.00
})
await Factory.sleep(0.25)
await Factory.sleep(2)
const remoteIdentifier = Utils.generateUuid()
const tokenOrError = await application.apiService.createFileValetToken(remoteIdentifier, 'write')
@@ -149,10 +165,4 @@ describe('files', function () {
expect(downloadError).to.be.ok
})
it.skip('should cancel file download', async function () {
await setup({ fakeCrypto: false, subscription: true })
// ...
})
})
+37 -19
View File
@@ -5,7 +5,7 @@ chai.use(chaiAsPromised)
const expect = chai.expect
describe('settings service', function () {
this.timeout(Factory.TwentySecondTimeout)
this.timeout(Factory.ThirtySecondTimeout)
const validSetting = SettingName.GoogleDriveBackupFrequency
const fakePayload = 'Im so meta even this acronym'
@@ -13,21 +13,21 @@ describe('settings service', function () {
let application
let context
let user
let subscriptionId = 2001
beforeEach(async function () {
localStorage.clear()
context = await Factory.createAppContextWithFakeCrypto()
await context.launch()
application = context.application
const registerResponse = await Factory.registerUserToApplication({
await Factory.registerUserToApplication({
application: context.application,
email: context.email,
password: context.password,
})
user = registerResponse.user
})
const reInitializeApplicationWithRealCrypto = async () => {
@@ -39,16 +39,16 @@ describe('settings service', function () {
application = context.application
const registerResponse = await Factory.registerUserToApplication({
await Factory.registerUserToApplication({
application: context.application,
email: context.email,
password: context.password,
})
user = registerResponse.user
}
afterEach(async function () {
await Factory.safeDeinit(application)
localStorage.clear()
})
it('creates and reads a setting', async function () {
@@ -119,14 +119,21 @@ describe('settings service', function () {
it('reads a subscription setting', async () => {
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
userEmail: context.email,
subscriptionId: 1,
subscriptionId: subscriptionId++,
subscriptionName: 'PRO_PLAN',
subscriptionExpiresAt: (new Date().getTime() + 3_600_000) * 1_000,
timestamp: Date.now(),
offline: false,
discountCode: null,
limitedDiscountPurchased: false,
newSubscriber: true,
totalActiveSubscriptionsCount: 1,
userRegisteredAt: 1,
billingFrequency: 12,
payAmount: 59.00
})
await Factory.sleep(1)
await Factory.sleep(2)
const setting = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_LIMIT')
expect(setting).to.be.a('string')
@@ -137,11 +144,18 @@ describe('settings service', function () {
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
userEmail: context.email,
subscriptionId: 1,
subscriptionId: subscriptionId,
subscriptionName: 'PRO_PLAN',
subscriptionExpiresAt: (new Date().getTime() + 3_600_000) * 1_000,
timestamp: Date.now(),
offline: false,
discountCode: null,
limitedDiscountPurchased: false,
newSubscriber: true,
totalActiveSubscriptionsCount: 1,
userRegisteredAt: 1,
billingFrequency: 12,
payAmount: 59.00
})
await Factory.sleep(1)
@@ -150,37 +164,41 @@ describe('settings service', function () {
await Files.uploadFile(application.fileService, buffer, 'my-file', 'md', 1000)
await Factory.publishMockedEvent('FILE_UPLOADED', {
userUuid: user.uuid,
fileByteSize: 123,
filePath: 'foobar',
fileName: 'barbuzz',
})
await Factory.sleep(1)
const limitSettingBefore = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_LIMIT')
expect(limitSettingBefore).to.equal('107374182400')
const usedSettingBefore = await application.settings.getSubscriptionSetting('FILE_UPLOAD_BYTES_USED')
expect(usedSettingBefore).to.equal('123')
expect(usedSettingBefore).to.equal('196')
await Factory.publishMockedEvent('SUBSCRIPTION_EXPIRED', {
userEmail: context.email,
subscriptionId: 1,
subscriptionId: subscriptionId++,
subscriptionName: 'PRO_PLAN',
timestamp: Date.now(),
offline: false,
totalActiveSubscriptionsCount: 1,
userExistingSubscriptionsCount: 1,
billingFrequency: 12,
payAmount: 59.00
})
await Factory.sleep(1)
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
userEmail: context.email,
subscriptionId: 2,
subscriptionId: subscriptionId++,
subscriptionName: 'PRO_PLAN',
subscriptionExpiresAt: (new Date().getTime() + 3_600_000) * 1_000,
timestamp: Date.now(),
offline: false,
discountCode: null,
limitedDiscountPurchased: false,
newSubscriber: false,
totalActiveSubscriptionsCount: 2,
userRegisteredAt: 1,
billingFrequency: 12,
payAmount: 59.00
})
await Factory.sleep(1)
+10 -2
View File
@@ -8,6 +8,7 @@ describe('subscriptions', function () {
let application
let context
let subscriptionManager
let subscriptionId = 3001
afterEach(async function () {
await Factory.safeDeinit(application)
@@ -32,13 +33,20 @@ describe('subscriptions', function () {
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
userEmail: context.email,
subscriptionId: 1,
subscriptionId: subscriptionId++,
subscriptionName: 'PRO_PLAN',
subscriptionExpiresAt: (new Date().getTime() + 3_600_000) * 1_000,
timestamp: Date.now(),
offline: false,
discountCode: null,
limitedDiscountPurchased: false,
newSubscriber: true,
totalActiveSubscriptionsCount: 1,
userRegisteredAt: 1,
billingFrequency: 12,
payAmount: 59.00
})
await Factory.sleep(0.25)
await Factory.sleep(2)
})
it('should invite a user by email to a shared subscription', async () => {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.151.9",
"version": "2.152.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+26
View File
@@ -3,6 +3,32 @@
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-11-27)
**Note:** Version bump only for package @standardnotes/ui-services
# [1.17.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
### Features
* Markdown, HTML & JSON export options for super notes ([#2054](https://github.com/standardnotes/app/issues/2054)) ([dcc8cfb](https://github.com/standardnotes/app/commit/dcc8cfbe45644dbb77e0ade0073017e6ac66164c))
# [1.16.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Features
* New 'What's New' section in Preferences ([#2049](https://github.com/standardnotes/app/issues/2049)) (skip e2e) ([0a01ddb](https://github.com/standardnotes/app/commit/0a01ddb430154fa4518985458c15c644855c80ea))
# [1.15.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
* option to show markdown preview for super notes (skip e2e) ([#2048](https://github.com/standardnotes/app/issues/2048)) ([8579ff3](https://github.com/standardnotes/app/commit/8579ff39b1f81dbbcf22b4031ede183ab4287262))
## [1.14.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.14.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
**Note:** Version bump only for package @standardnotes/ui-services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.14.3",
"version": "1.17.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -0,0 +1,13 @@
export type ChangelogVersion = {
version: string | null
title: string
date: string | null
body: string
parsed: Record<string, string[]>
}
export interface Changelog {
title: string
description: string
versions: Array<ChangelogVersion>
}
@@ -0,0 +1,78 @@
import { Environment } from '@standardnotes/models'
import { StorageServiceInterface, StorageKey } from '@standardnotes/services'
import { Changelog, ChangelogVersion } from './Changelog'
import { ChangelogServiceInterface } from './ChangelogServiceInterface'
import { LegacyWebToDesktopVersionMapping } from './LegacyDesktopMapping'
import { LegacyWebToMobileVersionMapping } from './LegacyMobileMapping'
const WebChangelogUrl = 'https://raw.githubusercontent.com/standardnotes/app/main/packages/web/CHANGELOG.md.json'
const DesktopDownloadsUrlBase = 'https://github.com/standardnotes/app/releases/tag/%40standardnotes%2Fdesktop%40'
export class ChangelogService implements ChangelogServiceInterface {
private changeLog?: Changelog
constructor(private environment: Environment, private diskService: StorageServiceInterface) {}
private async performDownloadChangelog(): Promise<Changelog> {
const response = await fetch(WebChangelogUrl)
const changelog = await response.text()
const parsedData = JSON.parse(changelog)
return parsedData
}
public async getChangelog(): Promise<Changelog> {
if (this.changeLog) {
return this.changeLog
}
this.changeLog = await this.performDownloadChangelog()
if (this.environment !== Environment.Web) {
const legacyMapping = this.getLegacyMapping()
this.changeLog.versions = this.changeLog.versions.map((versionRecord) => {
const versionString = versionRecord.version || ''
return {
...versionRecord,
version: legacyMapping[versionString] || versionRecord.version,
}
})
}
return this.changeLog
}
public markAsRead(): void {
if (!this.changeLog) {
return
}
this.diskService.setValue(StorageKey.LastReadChangelogVersion, this.changeLog.versions[0].version)
}
public getLastReadVersion(): string | undefined {
return this.diskService.getValue(StorageKey.LastReadChangelogVersion)
}
public async getVersions(): Promise<ChangelogVersion[]> {
const changelog = await this.getChangelog()
return changelog.versions
}
private getLegacyMapping(): Record<string, string> {
return this.environment === Environment.Desktop
? LegacyWebToDesktopVersionMapping
: this.environment === Environment.Mobile
? LegacyWebToMobileVersionMapping
: {}
}
public getDesktopDownloadsUrl(version: string): string {
return DesktopDownloadsUrlBase + version
}
public getDesktopVersionForWebVersion(webVersion: string): string {
return LegacyWebToDesktopVersionMapping[webVersion] ?? webVersion
}
}
@@ -0,0 +1,10 @@
import { Changelog, ChangelogVersion } from './Changelog'
export interface ChangelogServiceInterface {
getChangelog(): Promise<Changelog>
getVersions(): Promise<ChangelogVersion[]>
getDesktopDownloadsUrl(version: string): string
getDesktopVersionForWebVersion(webVersion: string): string
markAsRead(): void
getLastReadVersion(): string | undefined
}
@@ -0,0 +1,351 @@
/**
* Before 11/23/2022, web and desktop used independent semantic versioning. After this point, desktop automatically
* uses web's versioning. The mapping below allows us to see what particular web version a legacy desktop version maps to
*/
export const LegacyWebToDesktopVersionMapping: Record<string, string> = {
'3.107.0': '3.101.2',
'3.106.0': '3.101.1',
'3.105.0': '3.101.0',
'3.104.1': '3.100.18',
'3.104.0': '3.100.17',
'3.103.2': '3.100.16',
'3.103.1': '3.100.15',
'3.103.0': '3.100.14',
'3.102.0': '3.100.13',
'3.101.2': '3.100.12',
'3.101.1': '3.100.11',
'3.101.0': '3.100.10',
'3.100.8': '3.100.9',
'3.100.7': '3.100.8',
'3.100.6': '3.100.7',
'3.100.5': '3.100.6',
'3.100.4': '3.100.5',
'3.100.3': '3.100.4',
'3.100.2': '3.100.3',
'3.100.1': '3.100.2',
'3.100.0': '3.100.1',
'3.99.0': '3.100.0',
'3.98.2': '3.23.301',
'3.98.1': '3.23.300',
'3.98.0': '3.23.299',
'3.97.0': '3.23.298',
'3.96.1': '3.23.297',
'3.96.0': '3.23.296',
'3.95.1': '3.23.295',
'3.95.0': '3.23.294',
'3.94.2': '3.23.293',
'3.94.1': '3.23.292',
'3.94.0': '3.23.291',
'3.93.19': '3.23.290',
'3.93.18': '3.23.289',
'3.93.17': '3.23.288',
'3.93.16': '3.23.287',
'3.93.15': '3.23.286',
'3.93.14': '3.23.285',
'3.93.13': '3.23.284',
'3.93.12': '3.23.283',
'3.93.11': '3.23.282',
'3.93.10': '3.23.281',
'3.93.9': '3.23.280',
'3.93.8': '3.23.279',
'3.93.7': '3.23.278',
'3.93.6': '3.23.277',
'3.93.5': '3.23.276',
'3.93.4': '3.23.275',
'3.93.3': '3.23.274',
'3.93.2': '3.23.273',
'3.93.1': '3.23.272',
'3.93.0': '3.23.271',
'3.92.0': '3.23.270',
'3.91.1': '3.23.269',
'3.91.0': '3.23.268',
'3.90.11': '3.23.267',
'3.90.10': '3.23.266',
'3.90.9': '3.23.265',
'3.90.8': '3.23.264',
'3.90.7': '3.23.263',
'3.90.6': '3.23.262',
'3.90.5': '3.23.261',
'3.90.4': '3.23.260',
'3.90.3': '3.23.259',
'3.90.2': '3.23.258',
'3.90.1': '3.23.257',
'3.90.0': '3.23.256',
'3.89.0': '3.23.255',
'3.88.1': '3.23.254',
'3.88.0': '3.23.253',
'3.87.2': '3.23.252',
'3.87.1': '3.23.251',
'3.87.0': '3.23.250',
'3.86.0': '3.23.249',
'3.85.2': '3.23.248',
'3.85.1': '3.23.247',
'3.85.0': '3.23.246',
'3.84.7': '3.23.245',
'3.84.6': '3.23.244',
'3.84.5': '3.23.243',
'3.84.4': '3.23.242',
'3.84.3': '3.23.241',
'3.84.2': '3.23.240',
'3.84.1': '3.23.239',
'3.84.0': '3.23.238',
'3.83.0': '3.23.237',
'3.82.6': '3.23.236',
'3.82.5': '3.23.235',
'3.82.4': '3.23.234',
'3.82.3': '3.23.233',
'3.82.2': '3.23.232',
'3.82.1': '3.23.231',
'3.82.0': '3.23.230',
'3.81.0': '3.23.229',
'3.80.1': '3.23.228',
'3.80.0': '3.23.227',
'3.79.0': '3.23.226',
'3.78.1': '3.23.225',
'3.78.0': '3.23.224',
'3.77.1': '3.23.223',
'3.77.0': '3.23.222',
'3.76.2': '3.23.221',
'3.76.1': '3.23.220',
'3.76.0': '3.23.219',
'3.75.1': '3.23.218',
'3.75.0': '3.23.217',
'3.74.0': '3.23.216',
'3.73.0': '3.23.215',
'3.72.4': '3.23.214',
'3.72.3': '3.23.213',
'3.72.2': '3.23.212',
'3.72.1': '3.23.211',
'3.72.0': '3.23.210',
'3.71.8': '3.23.209',
'3.71.7': '3.23.208',
'3.71.6': '3.23.207',
'3.71.5': '3.23.206',
'3.71.4': '3.23.205',
'3.71.3': '3.23.204',
'3.71.2': '3.23.203',
'3.71.1': '3.23.202',
'3.71.0': '3.23.201',
'3.70.5': '3.23.200',
'3.70.4': '3.23.199',
'3.70.3': '3.23.198',
'3.70.2': '3.23.197',
'3.70.1': '3.23.196',
'3.70.0': '3.23.195',
'3.69.1': '3.23.194',
'3.69.0': '3.23.193',
'3.68.6': '3.23.192',
'3.68.5': '3.23.191',
'3.68.4': '3.23.190',
'3.68.3': '3.23.189',
'3.68.2': '3.23.188',
'3.68.1': '3.23.187',
'3.68.0': '3.23.186',
'3.67.4': '3.23.185',
'3.67.3': '3.23.184',
'3.67.2': '3.23.183',
'3.67.1': '3.23.182',
'3.67.0': '3.23.181',
'3.66.0': '3.23.180',
'3.65.0': '3.23.179',
'3.64.0': '3.23.178',
'3.63.3': '3.23.177',
'3.63.2': '3.23.176',
'3.63.1': '3.23.175',
'3.63.0': '3.23.174',
'3.62.4': '3.23.173',
'3.62.3': '3.23.172',
'3.62.2': '3.23.171',
'3.62.1': '3.23.170',
'3.62.0': '3.23.169',
'3.61.0': '3.23.168',
'3.60.0': '3.23.167',
'3.59.3': '3.23.166',
'3.59.2': '3.23.165',
'3.59.1': '3.23.164',
'3.59.0': '3.23.163',
'3.58.1': '3.23.162',
'3.58.0': '3.23.161',
'3.57.3': '3.23.160',
'3.57.2': '3.23.159',
'3.57.1': '3.23.158',
'3.57.0': '3.23.157',
'3.56.0': '3.23.156',
'3.55.2': '3.23.155',
'3.55.1': '3.23.154',
'3.55.0': '3.23.153',
'3.54.6': '3.23.152',
'3.54.5': '3.23.151',
'3.54.4': '3.23.150',
'3.54.3': '3.23.149',
'3.54.2': '3.23.148',
'3.54.1': '3.23.147',
'3.54.0': '3.23.146',
'3.53.0': '3.23.145',
'3.52.1': '3.23.144',
'3.52.0': '3.23.143',
'3.51.0': '3.23.142',
'3.50.6': '3.23.141',
'3.50.5': '3.23.140',
'3.50.4': '3.23.139',
'3.50.3': '3.23.138',
'3.50.2': '3.23.137',
'3.50.1': '3.23.136',
'3.50.0': '3.23.135',
'3.49.3': '3.23.134',
'3.49.2': '3.23.133',
'3.49.1': '3.23.132',
'3.49.0': '3.23.131',
'3.48.3': '3.23.130',
'3.48.2': '3.23.129',
'3.48.1': '3.23.128',
'3.48.0': '3.23.127',
'3.47.3': '3.23.126',
'3.47.2': '3.23.125',
'3.47.1': '3.23.124',
'3.47.0': '3.23.123',
'3.46.3': '3.23.122',
'3.46.2': '3.23.121',
'3.46.1': '3.23.120',
'3.46.0': '3.23.119',
'3.45.18': '3.23.118',
'3.45.17': '3.23.117',
'3.45.16': '3.23.116',
'3.45.15': '3.23.115',
'3.45.14': '3.23.114',
'3.45.13': '3.23.113',
'3.45.12': '3.23.112',
'3.45.11': '3.23.111',
'3.45.10': '3.23.110',
'3.45.9': '3.23.109',
'3.45.8': '3.23.108',
'3.45.7': '3.23.107',
'3.45.6': '3.23.106',
'3.45.5': '3.23.105',
'3.45.4': '3.23.104',
'3.45.3': '3.23.103',
'3.45.2': '3.23.102',
'3.45.1': '3.23.101',
'3.45.0': '3.23.100',
'3.44.7': '3.23.99',
'3.44.6': '3.23.98',
'3.44.5': '3.23.97',
'3.44.4': '3.23.96',
'3.44.3': '3.23.95',
'3.44.2': '3.23.94',
'3.44.1': '3.23.93',
'3.44.0': '3.23.92',
'3.43.1': '3.23.91',
'3.43.0': '3.23.90',
'3.42.1': '3.23.89',
'3.42.0': '3.23.88',
'3.41.3': '3.23.87',
'3.41.2': '3.23.86',
'3.41.1': '3.23.85',
'3.41.0': '3.23.84',
'3.40.7': '3.23.83',
'3.40.6': '3.23.82',
'3.40.5': '3.23.81',
'3.40.4': '3.23.80',
'3.40.3': '3.23.79',
'3.40.2': '3.23.78',
'3.40.1': '3.23.77',
'3.40.0': '3.23.76',
'3.39.1': '3.23.75',
'3.39.0': '3.23.74',
'3.38.6': '3.23.73',
'3.38.5': '3.23.72',
'3.38.4': '3.23.71',
'3.38.3': '3.23.70',
'3.38.2': '3.23.69',
'3.38.1': '3.23.68',
'3.38.0': '3.23.67',
'3.37.7': '3.23.66',
'3.37.6': '3.23.65',
'3.37.5': '3.23.64',
'3.37.4': '3.23.63',
'3.37.3': '3.23.62',
'3.37.2': '3.23.61',
'3.37.1': '3.23.60',
'3.37.0': '3.23.59',
'3.36.0': '3.23.58',
'3.35.2': '3.23.57',
'3.35.1': '3.23.56',
'3.35.0': '3.23.55',
'3.34.0': '3.23.54',
'3.33.8': '3.23.53',
'3.33.7': '3.23.52',
'3.33.6': '3.23.51',
'3.33.5': '3.23.50',
'3.33.4': '3.23.49',
'3.33.3': '3.23.48',
'3.33.2': '3.23.47',
'3.33.1': '3.23.46',
'3.33.0': '3.23.45',
'3.32.0': '3.23.44',
'3.31.1': '3.23.43',
'3.31.0': '3.23.42',
'3.30.0': '3.23.41',
'3.29.2': '3.23.40',
'3.29.1': '3.23.39',
'3.29.0': '3.23.38',
'3.28.1': '3.23.37',
'3.28.0': '3.23.36',
'3.27.7': '3.23.35',
'3.27.6': '3.23.34',
'3.27.5': '3.23.33',
'3.27.4': '3.23.32',
'3.27.3': '3.23.31',
'3.27.2': '3.23.30',
'3.27.1': '3.23.29',
'3.27.0': '3.23.28',
'3.26.4': '3.23.27',
'3.26.3': '3.23.26',
'3.26.2': '3.23.25',
'3.26.1': '3.23.24',
'3.26.0': '3.23.23',
'3.25.0': '3.23.22',
'3.24.6': '3.23.21',
'3.24.5': '3.23.20',
'3.24.4': '3.23.19',
'3.24.3': '3.23.18',
'3.24.3-alpha.1': '3.23.17',
'3.24.3-alpha.0': '3.23.16',
'3.24.2': '3.23.15',
'3.24.2-alpha.1': '3.23.14',
'3.24.2-alpha.0': '3.23.13',
'3.24.1': '3.23.12',
'3.24.1-alpha.0': '3.23.11',
'3.24.0': '3.23.10',
'3.24.0-alpha.7': '3.23.9',
'3.24.0-alpha.6': '3.23.8',
'3.24.0-alpha.5': '3.23.7',
'3.24.0-alpha.4': '3.23.6',
'3.24.0-alpha.3': '3.23.5',
'3.24.0-alpha.2': '3.23.4',
'3.24.0-alpha.1': '3.23.3',
'3.24.0-alpha.0': '3.23.2',
'3.23.0': '3.23.1',
'3.23.0-alpha.1': '3.23.0',
'3.23.0-alpha.0': '3.22.21',
'3.22.7-alpha.0': '3.22.20',
'3.22.6': '3.22.19',
'3.22.6-alpha.0': '3.22.18',
'3.22.5': '3.22.17',
'3.22.4': '3.22.13-alpha.9',
'3.22.3': '3.22.13-alpha.8',
'3.22.3-alpha.9': '3.22.16-alpha.1',
'3.22.3-alpha.8': '3.22.16-alpha.0',
'3.22.3-alpha.7': '3.22.15',
'3.22.3-alpha.6': '3.22.15-alpha.3',
'3.22.3-alpha.5': '3.22.15-alpha.2',
'3.22.3-alpha.4': '3.22.15-alpha.1',
'3.22.3-alpha.3': '3.22.15-alpha.0',
'3.22.3-alpha.2': '3.22.14',
'3.22.3-alpha.1': '3.22.14-alpha.0',
'3.22.3-alpha.0': '3.22.13',
'3.22.2': '3.22.13-alpha.10',
'3.22.1': '3.22.13-alpha.7',
'3.22.0': '3.22.13-alpha.6',
'3.21.0': '3.22.13-alpha.5',
}
@@ -0,0 +1,351 @@
/**
* Before 11/23/2022, web and mobile used independent semantic versioning. After this point, mobile automatically
* uses web's versioning. The mapping below allows us to see what particular web version a legacy mobile version maps to
*/
export const LegacyWebToMobileVersionMapping: Record<string, string> = {
'3.107.0': '3.46.31',
'3.106.0': '3.46.30',
'3.105.0': '3.46.29',
'3.104.1': '3.46.28',
'3.104.0': '3.46.27',
'3.103.2': '3.46.26',
'3.103.1': '3.46.25',
'3.103.0': '3.46.24',
'3.102.0': '3.46.23',
'3.101.2': '3.46.22',
'3.101.1': '3.46.21',
'3.101.0': '3.46.20',
'3.100.8': '3.46.19',
'3.100.7': '3.46.18',
'3.100.6': '3.46.17',
'3.100.5': '3.46.16',
'3.100.4': '3.46.15',
'3.100.3': '3.46.14',
'3.100.2': '3.46.13',
'3.100.1': '3.46.12',
'3.100.0': '3.46.11',
'3.99.0': '3.46.10',
'3.98.2': '3.46.9',
'3.98.1': '3.46.8',
'3.98.0': '3.46.7',
'3.97.0': '3.46.6',
'3.96.1': '3.46.5',
'3.96.0': '3.46.4',
'3.95.1': '3.46.3',
'3.95.0': '3.46.2',
'3.94.2': '3.46.1',
'3.94.1': '3.46.0',
'3.94.0': '3.45.42',
'3.93.19': '3.45.41',
'3.93.18': '3.45.40',
'3.93.17': '3.45.39',
'3.93.16': '3.45.38',
'3.93.15': '3.45.37',
'3.93.14': '3.45.36',
'3.93.13': '3.45.35',
'3.93.12': '3.45.34',
'3.93.11': '3.45.33',
'3.93.10': '3.45.32',
'3.93.9': '3.45.31',
'3.93.8': '3.45.30',
'3.93.7': '3.45.29',
'3.93.6': '3.45.28',
'3.93.5': '3.45.27',
'3.93.4': '3.45.26',
'3.93.3': '3.45.25',
'3.93.2': '3.45.24',
'3.93.1': '3.45.23',
'3.93.0': '3.45.22',
'3.92.0': '3.45.21',
'3.91.1': '3.45.20',
'3.91.0': '3.45.19',
'3.90.11': '3.45.18',
'3.90.10': '3.45.17',
'3.90.9': '3.45.16',
'3.90.8': '3.45.15',
'3.90.7': '3.45.14',
'3.90.6': '3.45.13',
'3.90.5': '3.45.12',
'3.90.4': '3.45.11',
'3.90.3': '3.45.10',
'3.90.2': '3.45.9',
'3.90.1': '3.45.8',
'3.90.0': '3.45.7',
'3.89.0': '3.45.6',
'3.88.1': '3.45.5',
'3.88.0': '3.45.4',
'3.87.2': '3.45.3',
'3.87.1': '3.45.2',
'3.87.0': '3.45.1',
'3.86.0': '3.45.0',
'3.85.2': '3.44.5',
'3.85.1': '3.44.4',
'3.85.0': '3.44.3',
'3.84.7': '3.44.2',
'3.84.6': '3.44.1',
'3.84.5': '3.44.0',
'3.84.4': '3.43.33',
'3.84.3': '3.43.32',
'3.84.2': '3.43.31',
'3.84.1': '3.43.30',
'3.84.0': '3.43.29',
'3.83.0': '3.43.28',
'3.82.6': '3.43.27',
'3.82.5': '3.43.26',
'3.82.4': '3.43.25',
'3.82.3': '3.43.24',
'3.82.2': '3.43.23',
'3.82.1': '3.43.22',
'3.82.0': '3.43.21',
'3.81.0': '3.43.20',
'3.80.1': '3.43.19',
'3.80.0': '3.43.18',
'3.79.0': '3.43.17',
'3.78.1': '3.43.16',
'3.78.0': '3.43.15',
'3.77.1': '3.43.14',
'3.77.0': '3.43.13',
'3.76.2': '3.43.12',
'3.76.1': '3.43.11',
'3.76.0': '3.43.10',
'3.75.1': '3.43.9',
'3.75.0': '3.43.8',
'3.74.0': '3.43.7',
'3.73.0': '3.43.6',
'3.72.4': '3.43.5',
'3.72.3': '3.43.4',
'3.72.2': '3.43.3',
'3.72.1': '3.43.2',
'3.72.0': '3.43.1',
'3.71.8': '3.43.0',
'3.71.7': '3.42.5',
'3.71.6': '3.42.4',
'3.71.5': '3.42.3',
'3.71.4': '3.42.2',
'3.71.3': '3.42.1',
'3.71.2': '3.42.0',
'3.71.1': '3.41.10',
'3.71.0': '3.41.9',
'3.70.5': '3.41.8',
'3.70.4': '3.41.7',
'3.70.3': '3.41.6',
'3.70.2': '3.41.5',
'3.70.1': '3.41.4',
'3.70.0': '3.41.3',
'3.69.1': '3.41.2',
'3.69.0': '3.41.1',
'3.68.6': '3.41.0',
'3.68.5': '3.40.2',
'3.68.4': '3.40.1',
'3.68.3': '3.40.0',
'3.68.2': '3.39.12',
'3.68.1': '3.39.11',
'3.68.0': '3.39.10',
'3.67.4': '3.39.9',
'3.67.3': '3.39.8',
'3.67.2': '3.39.7',
'3.67.1': '3.39.6',
'3.67.0': '3.39.5',
'3.66.0': '3.39.4',
'3.65.0': '3.39.3',
'3.64.0': '3.39.2',
'3.63.3': '3.39.1',
'3.63.2': '3.39.0',
'3.63.1': '3.38.1',
'3.63.0': '3.38.0',
'3.62.4': '3.37.14',
'3.62.3': '3.37.13',
'3.62.2': '3.37.12',
'3.62.1': '3.37.11',
'3.62.0': '3.37.10',
'3.61.0': '3.37.9',
'3.60.0': '3.37.8',
'3.59.3': '3.37.7',
'3.59.2': '3.37.6',
'3.59.1': '3.37.5',
'3.59.0': '3.37.4',
'3.58.1': '3.37.3',
'3.58.0': '3.37.2',
'3.57.3': '3.37.1',
'3.57.2': '3.37.0',
'3.57.1': '3.36.18',
'3.57.0': '3.36.17',
'3.56.0': '3.36.16',
'3.55.2': '3.36.15',
'3.55.1': '3.36.14',
'3.55.0': '3.36.13',
'3.54.6': '3.36.12',
'3.54.5': '3.36.11',
'3.54.4': '3.36.10',
'3.54.3': '3.36.9',
'3.54.2': '3.36.8',
'3.54.1': '3.36.7',
'3.54.0': '3.36.6',
'3.53.0': '3.36.5',
'3.52.1': '3.36.4',
'3.52.0': '3.36.3',
'3.51.0': '3.36.2',
'3.50.6': '3.36.1',
'3.50.5': '3.36.0',
'3.50.4': '3.35.16',
'3.50.3': '3.35.15',
'3.50.2': '3.35.14',
'3.50.1': '3.35.13',
'3.50.0': '3.35.12',
'3.49.3': '3.35.11',
'3.49.2': '3.35.10',
'3.49.1': '3.35.9',
'3.49.0': '3.35.8',
'3.48.3': '3.35.7',
'3.48.2': '3.35.6',
'3.48.1': '3.35.5',
'3.48.0': '3.35.4',
'3.47.3': '3.35.3',
'3.47.2': '3.35.2',
'3.47.1': '3.35.1',
'3.47.0': '3.35.0',
'3.46.3': '3.34.3',
'3.46.2': '3.34.2',
'3.46.1': '3.34.1',
'3.46.0': '3.34.0',
'3.45.18': '3.33.7',
'3.45.17': '3.33.6',
'3.45.16': '3.33.5',
'3.45.15': '3.33.4',
'3.45.14': '3.33.3',
'3.45.13': '3.33.2',
'3.45.12': '3.33.1',
'3.45.11': '3.33.0',
'3.45.10': '3.32.5',
'3.45.9': '3.32.4',
'3.45.8': '3.32.3',
'3.45.7': '3.32.2',
'3.45.6': '3.32.1',
'3.45.5': '3.32.0',
'3.45.4': '3.31.29',
'3.45.3': '3.31.28',
'3.45.2': '3.31.27',
'3.45.1': '3.31.26',
'3.45.0': '3.31.25',
'3.44.7': '3.31.24',
'3.44.6': '3.31.23',
'3.44.5': '3.31.22',
'3.44.4': '3.31.21',
'3.44.3': '3.31.20',
'3.44.2': '3.31.19',
'3.44.1': '3.31.18',
'3.44.0': '3.31.17',
'3.43.1': '3.31.16',
'3.43.0': '3.31.15',
'3.42.1': '3.31.14',
'3.42.0': '3.31.13',
'3.41.3': '3.31.12',
'3.41.2': '3.31.11',
'3.41.1': '3.31.10',
'3.41.0': '3.31.9',
'3.40.7': '3.31.8',
'3.40.6': '3.31.7',
'3.40.5': '3.31.6',
'3.40.4': '3.31.5',
'3.40.3': '3.31.4',
'3.40.2': '3.31.3',
'3.40.1': '3.31.2',
'3.40.0': '3.31.1',
'3.39.1': '3.31.0',
'3.39.0': '3.30.38',
'3.38.6': '3.30.37',
'3.38.5': '3.30.36',
'3.38.4': '3.30.35',
'3.38.3': '3.30.34',
'3.38.2': '3.30.33',
'3.38.1': '3.30.32',
'3.38.0': '3.30.31',
'3.37.7': '3.30.30',
'3.37.6': '3.30.29',
'3.37.5': '3.30.28',
'3.37.4': '3.30.27',
'3.37.3': '3.30.26',
'3.37.2': '3.30.25',
'3.37.1': '3.30.24',
'3.37.0': '3.30.23',
'3.36.0': '3.30.22',
'3.35.2': '3.30.21',
'3.35.1': '3.30.20',
'3.35.0': '3.30.19',
'3.34.0': '3.30.18',
'3.33.8': '3.30.17',
'3.33.7': '3.30.16',
'3.33.6': '3.30.15',
'3.33.5': '3.30.14',
'3.33.4': '3.30.13',
'3.33.3': '3.30.12',
'3.33.2': '3.30.11',
'3.33.1': '3.30.10',
'3.33.0': '3.30.9',
'3.32.0': '3.30.8',
'3.31.1': '3.30.7',
'3.31.0': '3.30.6',
'3.30.0': '3.30.5',
'3.29.2': '3.30.4',
'3.29.1': '3.30.3',
'3.29.0': '3.30.2',
'3.28.1': '3.30.1',
'3.28.0': '3.30.0',
'3.27.7': '3.29.0',
'3.27.6': '3.28.3',
'3.27.5': '3.28.2',
'3.27.4': '3.28.1',
'3.27.3': '3.28.0',
'3.27.2': '3.27.13',
'3.27.1': '3.27.12',
'3.27.0': '3.27.11',
'3.26.4': '3.27.10',
'3.26.3': '3.27.9',
'3.26.2': '3.27.8',
'3.26.1': '3.27.7',
'3.26.0': '3.27.6',
'3.25.0': '3.27.5',
'3.24.6': '3.27.4',
'3.24.5': '3.27.3',
'3.24.4': '3.27.2',
'3.24.3': '3.27.1',
'3.24.3-alpha.1': '3.27.0',
'3.24.3-alpha.0': '3.26.14',
'3.24.2': '3.26.13',
'3.24.2-alpha.1': '3.26.12',
'3.24.2-alpha.0': '3.26.11',
'3.24.1': '3.26.10',
'3.24.1-alpha.0': '3.26.9',
'3.24.0': '3.26.8',
'3.24.0-alpha.7': '3.26.7',
'3.24.0-alpha.6': '3.26.6',
'3.24.0-alpha.5': '3.26.5',
'3.24.0-alpha.4': '3.26.4',
'3.24.0-alpha.3': '3.26.3',
'3.24.0-alpha.2': '3.26.2',
'3.24.0-alpha.1': '3.26.1',
'3.24.0-alpha.0': '3.26.0',
'3.23.0': '3.25.15',
'3.23.0-alpha.1': '3.25.14',
'3.23.0-alpha.0': '3.25.13',
'3.22.7-alpha.0': '3.25.12',
'3.22.6': '3.25.11',
'3.22.6-alpha.0': '3.25.10',
'3.22.5': '3.25.9',
'3.22.4': '3.24.4',
'3.22.3': '3.24.3',
'3.22.3-alpha.9': '3.25.6',
'3.22.3-alpha.8': '3.25.5',
'3.22.3-alpha.7': '3.25.4',
'3.22.3-alpha.6': '3.25.3',
'3.22.3-alpha.5': '3.25.2',
'3.22.3-alpha.4': '3.25.1',
'3.22.3-alpha.3': '3.25.0',
'3.22.3-alpha.2': '3.24.8',
'3.22.3-alpha.1': '3.24.7',
'3.22.3-alpha.0': '3.24.6',
'3.22.2': '3.24.5',
'3.22.1': '3.24.2',
'3.22.0': '3.24.2-alpha.2',
'3.21.0': '3.24.2-alpha.1',
}
@@ -2,8 +2,8 @@ import { KeyboardCommand } from './KeyboardCommands'
export type KeyboardCommandHandler = {
command: KeyboardCommand
onKeyDown?: (event: KeyboardEvent) => boolean | void
onKeyUp?: (event: KeyboardEvent) => boolean | void
onKeyDown?: (event: KeyboardEvent, data?: unknown) => boolean | void
onKeyUp?: (event: KeyboardEvent, data?: unknown) => boolean | void
element?: HTMLElement
elements?: HTMLElement[]
notElement?: HTMLElement
@@ -24,3 +24,7 @@ export const OPEN_NOTE_HISTORY_COMMAND = createKeyboardCommand('OPEN_NOTE_HISTOR
export const CAPTURE_SAVE_COMMAND = createKeyboardCommand('CAPTURE_SAVE_COMMAND')
export const STAR_NOTE_COMMAND = createKeyboardCommand('STAR_NOTE_COMMAND')
export const PIN_NOTE_COMMAND = createKeyboardCommand('PIN_NOTE_COMMAND')
export const SUPER_SHOW_MARKDOWN_PREVIEW = createKeyboardCommand('SUPER_SHOW_MARKDOWN_PREVIEW')
export const SUPER_EXPORT_JSON = createKeyboardCommand('SUPER_EXPORT_JSON')
export const SUPER_EXPORT_MARKDOWN = createKeyboardCommand('SUPER_EXPORT_MARKDOWN')
export const SUPER_EXPORT_HTML = createKeyboardCommand('SUPER_EXPORT_HTML')
@@ -165,6 +165,22 @@ export class KeyboardService {
}
}
public triggerCommand(command: KeyboardCommand, data?: unknown): void {
for (const observer of this.commandHandlers) {
if (observer.command !== command) {
continue
}
const callback = observer.onKeyDown || observer.onKeyUp
if (callback) {
const exclusive = callback(new KeyboardEvent('command-trigger'), data)
if (exclusive) {
return
}
}
}
}
registerShortcut(shortcut: KeyboardShortcut): void {
this.commandMap.set(shortcut.command, shortcut)
}
@@ -21,6 +21,7 @@ import {
CAPTURE_SAVE_COMMAND,
STAR_NOTE_COMMAND,
PIN_NOTE_COMMAND,
SUPER_SHOW_MARKDOWN_PREVIEW,
} from './KeyboardCommands'
import { KeyboardKey } from './KeyboardKey'
import { KeyboardModifier } from './KeyboardModifier'
@@ -132,5 +133,11 @@ export function getKeyboardShortcuts(platform: Platform, _environment: Environme
modifiers: [primaryModifier, KeyboardModifier.Shift],
preventDefault: true,
},
{
command: SUPER_SHOW_MARKDOWN_PREVIEW,
key: 'm',
modifiers: [primaryModifier, KeyboardModifier.Shift],
preventDefault: true,
},
]
}
@@ -9,6 +9,7 @@ const PREFERENCE_IDS = [
'accessibility',
'get-free-month',
'help-feedback',
'whats-new',
] as const
export type PreferenceId = typeof PREFERENCE_IDS[number]
+3
View File
@@ -1,6 +1,9 @@
export * from './Alert/Functions'
export * from './Alert/WebAlertService'
export * from './Archive/ArchiveManager'
export * from './Changelog/Changelog'
export * from './Changelog/ChangelogService'
export * from './Changelog/ChangelogServiceInterface'
export * from './Keyboard/KeyboardService'
export * from './Keyboard/KeyboardShortcut'
export * from './Keyboard/KeyboardCommands'
+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.13.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
* use line height preference in super editor (skip e2e) ([#2045](https://github.com/standardnotes/app/issues/2045)) ([87cd31a](https://github.com/standardnotes/app/commit/87cd31ae5d630a528ce6d4895b2c144bf51808f0))
# [1.12.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/utils",
"version": "1.12.0",
"version": "1.13.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+1
View File
@@ -1,4 +1,5 @@
export * from './Utils/Utils'
export * from './Utils/ClassNames'
export * from './Uuid/UuidGenerator'
export * from './Uuid/UuidMap'
export * from './Uuid/Utils'
+60
View File
@@ -3,6 +3,66 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.110.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-27)
**Note:** Version bump only for package @standardnotes/web
## [3.110.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
### Bug Fixes
* issue where plaintext editor autofocus would interfere with sign in form ([a6efc53](https://github.com/standardnotes/app/commit/a6efc5336b5e5b4814e7e833ccdc2cd4b0096ce8))
# [3.110.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-25)
### Features
* Markdown, HTML & JSON export options for super notes ([#2054](https://github.com/standardnotes/app/issues/2054)) ([dcc8cfb](https://github.com/standardnotes/app/commit/dcc8cfbe45644dbb77e0ade0073017e6ac66164c))
### Reverts
* Revert "chore: e2e tests opt in" ([9b91875](https://github.com/standardnotes/app/commit/9b91875d3d31609449e22a386d7305fd7ca5a68f))
## [3.109.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/web
# [3.109.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Bug Fixes
* include more search results in linking autocomplete menu ([2e517c9](https://github.com/standardnotes/app/commit/2e517c985dfff5e1980f505f1b38cbdea292211a))
### Features
* resize images in super editor ([#2052](https://github.com/standardnotes/app/issues/2052)) ([2485bed](https://github.com/standardnotes/app/commit/2485bed3508b194137f058064cb36d1ba1d2c41c))
## [3.108.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
**Note:** Version bump only for package @standardnotes/web
# [3.108.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-24)
### Features
* New 'What's New' section in Preferences ([#2049](https://github.com/standardnotes/app/issues/2049)) (skip e2e) ([0a01ddb](https://github.com/standardnotes/app/commit/0a01ddb430154fa4518985458c15c644855c80ea))
# [3.107.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Bug Fixes
* change editor button icon & selection ([9d5a575](https://github.com/standardnotes/app/commit/9d5a57521e58823f7d8e17c7a9d7776c5e0bc672))
### Features
* option to show markdown preview for super notes (skip e2e) ([#2048](https://github.com/standardnotes/app/issues/2048)) ([8579ff3](https://github.com/standardnotes/app/commit/8579ff39b1f81dbbcf22b4031ede183ab4287262))
# [3.106.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Features
* use line height preference in super editor (skip e2e) ([#2045](https://github.com/standardnotes/app/issues/2045)) ([87cd31a](https://github.com/standardnotes/app/commit/87cd31ae5d630a528ce6d4895b2c144bf51808f0))
# [3.105.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-23)
### Bug Fixes
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,9 +1,9 @@
{
"name": "@standardnotes/web",
"version": "3.105.0",
"version": "3.110.2",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
"author": "Standard Notes",
"private": true,
"files": [
"dist"
@@ -29,6 +29,7 @@ import { DesktopManager } from './Device/DesktopManager'
import {
ArchiveManager,
AutolockService,
ChangelogService,
KeyboardService,
PreferenceId,
RouteService,
@@ -97,6 +98,7 @@ export class WebApplication extends SNApplication implements WebApplicationInter
? new DesktopManager(this, deviceInterface)
: undefined
this.webServices.viewControllerManager = new ViewControllerManager(this, deviceInterface)
this.webServices.changelogService = new ChangelogService(this.environment, this.storage)
if (this.isNativeMobileWeb()) {
this.mobileWebReceiver = new MobileWebReceiver(this)
@@ -193,6 +195,10 @@ export class WebApplication extends SNApplication implements WebApplicationInter
return this.webServices.viewControllerManager.paneController
}
public get changelogService() {
return this.webServices.changelogService
}
public get desktopDevice(): DesktopDeviceInterface | undefined {
if (isDesktopDevice(this.deviceInterface)) {
return this.deviceInterface
@@ -1,6 +1,12 @@
import { ViewControllerManager } from '@/Controllers/ViewControllerManager'
import { DesktopManager } from './Device/DesktopManager'
import { ArchiveManager, AutolockService, KeyboardService, ThemeManager } from '@standardnotes/ui-services'
import {
ArchiveManager,
AutolockService,
ChangelogServiceInterface,
KeyboardService,
ThemeManager,
} from '@standardnotes/ui-services'
export type WebServices = {
viewControllerManager: ViewControllerManager
@@ -9,4 +15,5 @@ export type WebServices = {
archiveService: ArchiveManager
themeService: ThemeManager
keyboardService: KeyboardService
changelogService: ChangelogServiceInterface
}
@@ -1,7 +1,7 @@
import { ForwardedRef, forwardRef, MouseEventHandler } from 'react'
import Icon from '@/Components/Icon/Icon'
import { IconType } from '@standardnotes/snjs'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
type Props = {
onClick: () => void
@@ -20,7 +20,7 @@ import { ViewControllerManager } from '@/Controllers/ViewControllerManager'
import { ChallengeModalValues } from './ChallengeModalValues'
import { InputValue } from './InputValue'
import { isMobileScreen } from '@/Utils'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
type Props = {
application: WebApplication
@@ -26,7 +26,9 @@ const ChangeEditorButton: FunctionComponent<Props> = ({
const [selectedEditor, setSelectedEditor] = useState(() => {
return note ? application.componentManager.editorForNote(note) : undefined
})
const [selectedEditorIcon, selectedEditorIconTint] = getIconAndTintForNoteType(selectedEditor?.package_info.note_type)
const [selectedEditorIcon, selectedEditorIconTint] = getIconAndTintForNoteType(
note?.noteType || selectedEditor?.package_info.note_type,
)
const [isClickOutsideDisabled, setIsClickOutsideDisabled] = useState(false)
const toggleMenu = useCallback(async () => {
@@ -59,7 +59,11 @@ const ChangeEditorMenu: FunctionComponent<ChangeEditorMenuProps> = ({
return item.component?.identifier === currentComponent.identifier
}
return item.noteType === note?.noteType || (!note?.noteType && item.noteType === NoteType.Plain)
const itemNoteTypeIsSameAsCurrentNoteType = item.noteType === note?.noteType
const noteDoesntHaveTypeAndItemIsPlain = !note?.noteType && item.noteType === NoteType.Plain
const unknownNoteTypeAndItemIsPlain = note?.noteType === NoteType.Unknown && item.noteType === NoteType.Plain
return itemNoteTypeIsSameAsCurrentNoteType || noteDoesntHaveTypeAndItemIsPlain || unknownNoteTypeAndItemIsPlain
},
[currentComponent, note],
)
@@ -1,4 +1,4 @@
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { ComponentPropsWithoutRef } from 'react'
import Icon from '../Icon/Icon'
@@ -6,7 +6,7 @@ import { CalendarMonth } from './CalendarMonth'
import { CalendarMonths } from './Constants'
import { insertMonths, insertMonthsWithTarget } from './CalendarUtilts'
import { InfiniteScrollerInterface, InfinteScroller } from '../InfiniteScroller/InfiniteScroller'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { LoggingDomain, log } from '@/Logging'
import { usePrevious } from './usePrevious'
import { isMobileScreen } from '@/Utils'
@@ -11,7 +11,7 @@ import { SelectedItemsController } from '@/Controllers/SelectedItemsController'
import { NavigationController } from '@/Controllers/Navigation/NavigationController'
import { NotesController } from '@/Controllers/NotesController/NotesController'
import { ElementIds } from '@/Constants/ElementIDs'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { ContentType, SNTag } from '@standardnotes/snjs'
type Props = {
@@ -30,7 +30,7 @@ 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'
import { classNames } from '@standardnotes/utils'
import { MediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery'
import { useFileDragNDrop } from '../FileDragNDropProvider/FileDragNDropProvider'
import { LinkingController } from '@/Controllers/LinkingController'
@@ -9,7 +9,6 @@ import { ListableContentItem } from '../Types/ListableContentItem'
import { DailyItemsDay } from './DailyItemsDaySection'
import { ListItemTitle } from '../ListItemTitle'
import { EmptyPlaceholderBars } from './EmptyPlaceholderBars'
import { isMobileScreen } from '@/Utils'
type DaySquareProps = {
day: number
@@ -73,7 +72,7 @@ export const DailyItemCell = forwardRef(
{!item && (
<div className="w-full">
<div className="break-word mr-2 font-semibold">{formatDateAndTimeForNote(section.date, false)}</div>
<EmptyPlaceholderBars rows={isMobileScreen() ? 2 : 4} />
<EmptyPlaceholderBars rows={1} />
</div>
)}
</div>
@@ -9,7 +9,7 @@ import { DisplayableListItemProps } from './Types/DisplayableListItemProps'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
import { useContextMenuEvent } from '@/Hooks/useContextMenuEvent'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { formatSizeToReadableString } from '@standardnotes/filepicker'
import { getIconForFileType } from '@/Utils/Items/Icons/getIconForFileType'
import { useApplication } from '../ApplicationView/ApplicationProvider'
@@ -1,11 +1,11 @@
import { WebApplication } from '@/Application/Application'
import { memo, useCallback, useMemo, useRef, useState } from 'react'
import Icon from '../../Icon/Icon'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import Popover from '@/Components/Popover/Popover'
import DisplayOptionsMenu from './DisplayOptionsMenu'
import { NavigationMenuButton } from '@/Components/NavigationMenu/NavigationMenu'
import { IconType, isTag } from '@standardnotes/snjs'
import { isTag, VectorIconNameOrEmoji } from '@standardnotes/snjs'
import RoundIconButton from '@/Components/Button/RoundIconButton'
import { AnyTag } from '@/Controllers/Navigation/AnyTagType'
import { MediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery'
@@ -13,7 +13,7 @@ import { MediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery'
type Props = {
application: WebApplication
panelTitle: string
icon?: IconType | string
icon?: VectorIconNameOrEmoji
addButtonLabel: string
addNewItem: () => void
isFilesSmartView: boolean
@@ -108,7 +108,7 @@ const ContentListHeader = ({
<div className={`flex min-w-0 flex-grow flex-row ${!optionsSubtitle ? 'items-center' : ''}`}>
{icon && (
<Icon
type={icon as IconType}
type={icon}
size={'custom'}
className={` ml-0.5 mr-1.5 h-7 w-7 text-2xl text-neutral lg:h-6 lg:w-6 lg:text-lg ${
optionsSubtitle ? 'mt-1' : ''
@@ -20,7 +20,7 @@ import { DisplayOptionsMenuProps } from './DisplayOptionsMenuProps'
import { PrefDefaults } from '@/Constants/PrefDefaults'
import NewNotePreferences from './NewNotePreferences'
import { PreferenceMode } from './PreferenceMode'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import NoSubscriptionBanner from '@/Components/NoSubscriptionBanner/NoSubscriptionBanner'
const DailyEntryModeEnabled = true
@@ -9,7 +9,7 @@ import { AnyTag } from '@/Controllers/Navigation/AnyTagType'
import { PreferenceMode } from './PreferenceMode'
import dayjs from 'dayjs'
import { EditorOption, getDropdownItemsForAllEditors } from '@/Utils/DropdownItemsForEditors'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { NoteTitleFormatOptions } from './NoteTitleFormatOptions'
const PrefChangeDebounceTimeInMs = 25
@@ -13,7 +13,7 @@ import { useContextMenuEvent } from '@/Hooks/useContextMenuEvent'
import ListItemNotePreviewText from './ListItemNotePreviewText'
import { ListItemTitle } from './ListItemTitle'
import { log, LoggingDomain } from '@/Logging'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { getIconAndTintForNoteType } from '@/Utils/Items/Icons/getIconAndTintForNoteType'
const NoteListItem: FunctionComponent<DisplayableListItemProps<SNNote>> = ({
@@ -2,7 +2,7 @@ import { WebApplication } from '@/Application/Application'
import { FeaturesController } from '@/Controllers/FeaturesController'
import { FilesController } from '@/Controllers/FilesController'
import { usePremiumModal } from '@/Hooks/usePremiumModal'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { isHandlingFileDrag } from '@/Utils/DragTypeCheck'
import { StreamingFileReader } from '@standardnotes/filepicker'
import { FileItem } from '@standardnotes/snjs'
@@ -8,13 +8,15 @@ import { isFileTypePreviewable } from './isFilePreviewable'
import PreviewComponent from './PreviewComponent'
import Button from '../Button/Button'
import { ProtectedIllustration } from '@standardnotes/icons'
import { ImageZoomLevelProps } from './ImageZoomLevelProps'
type Props = {
application: WebApplication
file: FileItem
}
isEmbeddedInSuper?: boolean
} & ImageZoomLevelProps
const FilePreview = ({ file, application }: Props) => {
const FilePreview = ({ file, application, isEmbeddedInSuper = false, imageZoomLevel, setImageZoomLevel }: Props) => {
const [isAuthorized, setIsAuthorized] = useState(application.isAuthorizedToRenderItem(file))
const isFilePreviewable = useMemo(() => {
@@ -112,7 +114,14 @@ const FilePreview = ({ file, application }: Props) => {
<span className="mt-3">Loading file...</span>
</div>
) : downloadedBytes ? (
<PreviewComponent application={application} file={file} bytes={downloadedBytes} />
<PreviewComponent
application={application}
file={file}
bytes={downloadedBytes}
isEmbeddedInSuper={isEmbeddedInSuper}
imageZoomLevel={imageZoomLevel}
setImageZoomLevel={setImageZoomLevel}
/>
) : (
<FilePreviewError
file={file}
@@ -1,24 +1,66 @@
import { IconType } from '@standardnotes/snjs'
import { FunctionComponent, useRef, useState } from 'react'
import { classNames, IconType } from '@standardnotes/snjs'
import { FunctionComponent, useCallback, useEffect, useState } from 'react'
import IconButton from '../Button/IconButton'
import { ImageZoomLevelProps } from './ImageZoomLevelProps'
type Props = {
objectUrl: string
}
isEmbeddedInSuper: boolean
} & ImageZoomLevelProps
const ImagePreview: FunctionComponent<Props> = ({ objectUrl }) => {
const initialImgHeightRef = useRef<number>()
const MinimumZoomPercent = 10
const DefaultZoomPercent = 100
const MaximumZoomPercent = 1000
const ZoomPercentModifier = 10
const PercentageDivisor = 100
const [imageZoomPercent, setImageZoomPercent] = useState(100)
const ImagePreview: FunctionComponent<Props> = ({
objectUrl,
isEmbeddedInSuper,
imageZoomLevel,
setImageZoomLevel,
}) => {
const [imageHeight, setImageHeight] = useState<number>(0)
const [imageZoomPercent, setImageZoomPercent] = useState(imageZoomLevel ? imageZoomLevel : DefaultZoomPercent)
const [isZoomInputVisible, setIsZoomInputVisible] = useState(false)
useEffect(() => {
setImageZoomPercent(imageZoomLevel ? imageZoomLevel : DefaultZoomPercent)
}, [imageZoomLevel])
const setImageZoom = useCallback(
(zoomLevel: number) => {
setImageZoomPercent(zoomLevel)
setImageZoomLevel?.(zoomLevel)
},
[setImageZoomLevel],
)
useEffect(() => {
const image = new Image()
image.src = objectUrl
image.onload = () => {
setImageHeight(image.height)
}
}, [objectUrl])
const heightIfEmbedded = imageHeight * (imageZoomPercent / PercentageDivisor)
return (
<div className="flex h-full min-h-0 w-full items-center justify-center">
<div className="relative flex h-full w-full items-center justify-center overflow-auto">
<div className="group flex h-full min-h-0 w-full items-center justify-center">
<div
className="relative flex h-full w-full items-center justify-center overflow-auto"
style={{
height: isEmbeddedInSuper ? `${heightIfEmbedded}px` : '',
}}
>
<img
src={objectUrl}
style={{
height: `${imageZoomPercent}%`,
...(imageZoomPercent <= 100
height: isEmbeddedInSuper ? `${heightIfEmbedded}px` : `${imageZoomPercent}%`,
...(isEmbeddedInSuper
? {}
: imageZoomPercent <= DefaultZoomPercent
? {
minWidth: '100%',
objectFit: 'contain',
@@ -31,39 +73,70 @@ const ImagePreview: FunctionComponent<Props> = ({ objectUrl }) => {
maxWidth: 'none',
}),
}}
ref={(imgElement) => {
if (!initialImgHeightRef.current) {
initialImgHeightRef.current = imgElement?.height
}
}}
/>
</div>
<div className="absolute left-1/2 bottom-6 flex -translate-x-1/2 items-center rounded border border-solid border-border bg-default py-1 px-3">
<span className="mr-1.5">Zoom:</span>
<div
className={classNames(
isEmbeddedInSuper ? 'hidden focus-within:flex group-hover:flex' : '',
'absolute left-1/2 bottom-6 flex -translate-x-1/2 items-center rounded border border-solid border-border bg-default py-1 px-3',
)}
>
<span className="mr-1.5">{isEmbeddedInSuper ? 'Size' : 'Zoom'}:</span>
<IconButton
className="rounded p-1 hover:bg-contrast"
icon={'subtract' as IconType}
title="Zoom Out"
title={isEmbeddedInSuper ? 'Decrease size' : 'Zoom Out'}
focusable={true}
onClick={() => {
setImageZoomPercent((percent) => {
const newPercent = percent - 10
if (newPercent >= 10) {
return newPercent
} else {
return percent
}
})
const newPercent = imageZoomPercent - ZoomPercentModifier
if (newPercent >= ZoomPercentModifier) {
setImageZoom(newPercent)
} else {
setImageZoom(imageZoomPercent)
}
}}
/>
<span className="mx-2">{imageZoomPercent}%</span>
{isZoomInputVisible ? (
<div className="mx-2">
<input
type="number"
className="w-10 text-center"
defaultValue={imageZoomPercent}
onKeyDown={(event) => {
event.stopPropagation()
if (event.key === 'Enter') {
const value = parseInt(event.currentTarget.value)
if (value >= MinimumZoomPercent && value <= MaximumZoomPercent) {
setImageZoom(value)
}
setIsZoomInputVisible(false)
}
}}
onBlur={(event) => {
setIsZoomInputVisible(false)
const value = parseInt(event.currentTarget.value)
if (value >= MinimumZoomPercent && value <= MaximumZoomPercent) {
setImageZoom(value)
}
}}
/>
%
</div>
) : (
<button
className="mx-1 rounded py-1 px-1.5 hover:bg-contrast"
onClick={() => setIsZoomInputVisible((visible) => !visible)}
>
{imageZoomPercent}%
</button>
)}
<IconButton
className="rounded p-1 hover:bg-contrast"
icon="add"
title="Zoom In"
title={isEmbeddedInSuper ? 'Increase size' : 'Zoom In'}
focusable={true}
onClick={() => {
setImageZoomPercent((percent) => percent + 10)
setImageZoom(imageZoomPercent + ZoomPercentModifier)
}}
/>
</div>
@@ -0,0 +1,4 @@
export type ImageZoomLevelProps = {
imageZoomLevel?: number
setImageZoomLevel?: (zoomLevel: number) => void
}
@@ -7,6 +7,7 @@ import { AppPaneId } from '../ResponsivePane/AppPaneMetadata'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { createObjectURLWithRef } from './CreateObjectURLWithRef'
import ImagePreview from './ImagePreview'
import { ImageZoomLevelProps } from './ImageZoomLevelProps'
import { PreviewableTextFileTypes, RequiresNativeFilePreview } from './isFilePreviewable'
import TextPreview from './TextPreview'
@@ -14,9 +15,17 @@ type Props = {
application: WebApplication
file: FileItem
bytes: Uint8Array
}
isEmbeddedInSuper: boolean
} & ImageZoomLevelProps
const PreviewComponent: FunctionComponent<Props> = ({ application, file, bytes }) => {
const PreviewComponent: FunctionComponent<Props> = ({
application,
file,
bytes,
isEmbeddedInSuper,
imageZoomLevel,
setImageZoomLevel,
}) => {
const { selectedPane } = useResponsiveAppPane()
const objectUrlRef = useRef<string>()
@@ -73,7 +82,14 @@ const PreviewComponent: FunctionComponent<Props> = ({ application, file, bytes }
}
if (file.mimeType.startsWith('image/')) {
return <ImagePreview objectUrl={objectUrl} />
return (
<ImagePreview
objectUrl={objectUrl}
isEmbeddedInSuper={isEmbeddedInSuper}
imageZoomLevel={imageZoomLevel}
setImageZoomLevel={setImageZoomLevel}
/>
)
}
if (file.mimeType.startsWith('video/')) {
@@ -1,4 +1,4 @@
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { useRef } from 'react'
import AccountMenu, { AccountMenuProps } from '../AccountMenu/AccountMenu'
import Icon from '../Icon/Icon'
@@ -1,6 +1,6 @@
import { WebApplication } from '@/Application/Application'
import { QuickSettingsController } from '@/Controllers/QuickSettingsController'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { useRef } from 'react'
import Icon from '../Icon/Icon'
import Popover from '../Popover/Popover'
@@ -1,7 +1,7 @@
import { FunctionComponent } from 'react'
import { VectorIconNameOrEmoji } from '@standardnotes/snjs'
import { IconNameToSvgMapping } from './IconNameToSvgMapping'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { LexicalIconName, LexicalIconNameToSvgMapping } from './LexicalIcons'
type Props = {
@@ -1,4 +1,4 @@
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { EmojiString, Platform, VectorIconNameOrEmoji } from '@standardnotes/snjs'
import { FunctionComponent, useMemo, useRef, useState } from 'react'
import Dropdown from '../Dropdown/Dropdown'
@@ -10,7 +10,7 @@ import { IconPickerType } from './IconPickerType'
type Props = {
selectedValue: VectorIconNameOrEmoji
onIconChange: (value?: string) => void
onIconChange: (value?: VectorIconNameOrEmoji) => void
platform: Platform
useIconGrid?: boolean
iconGridClassName?: string
@@ -87,7 +87,7 @@ const IconPicker = ({
const handleEmojiChange = (value: EmojiString) => {
setEmojiInputValue(value)
const emojiLength = getEmojiLength(value)
const emojiLength = getEmojiLength(value as string)
if (emojiLength === 1) {
onIconChange(value)
emojiInputRef.current?.blur()
@@ -130,7 +130,7 @@ const IconPicker = ({
id="change-tag-icon-dropdown"
label="Change the icon for a tag"
items={iconOptions}
value={selectedValue}
value={selectedValue as string}
onChange={handleIconChange}
portal={portalDropdown}
/>
@@ -144,7 +144,7 @@ const IconPicker = ({
autoFocus={emojiInputFocused}
className="w-full flex-grow rounded border border-solid border-passive-3 bg-default px-2 py-1 text-base font-bold text-text focus:shadow-none focus:outline-none"
type="text"
value={emojiInputValue}
value={emojiInputValue as string}
onChange={({ target: input }) => handleEmojiChange((input as HTMLInputElement)?.value)}
/>
</div>
@@ -11,7 +11,7 @@ import {
import { Disclosure, DisclosurePanel } from '@reach/disclosure'
import { useCloseOnBlur } from '@/Hooks/useCloseOnBlur'
import { observer } from 'mobx-react-lite'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants'
import LinkedItemSearchResults from './LinkedItemSearchResults'
import { LinkingController } from '@/Controllers/LinkingController'
@@ -1,5 +1,5 @@
import { LinkingController } from '@/Controllers/LinkingController'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { KeyboardKey } from '@standardnotes/ui-services'
import { observer } from 'mobx-react-lite'
import { KeyboardEventHandler, MouseEventHandler, useEffect, useRef, useState } from 'react'
@@ -5,7 +5,7 @@ import LinkedItemBubble from './LinkedItemBubble'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider'
import { ElementIds } from '@/Constants/ElementIDs'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { ContentType } from '@standardnotes/snjs'
import { LinkableItem } from '@/Utils/Items/Search/LinkableItem'
import { ItemLink } from '@/Utils/Items/Search/ItemLink'
@@ -1,5 +1,5 @@
import { splitQueryInString } from '@/Utils'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { getTitleForLinkedTag } from '@/Utils/Items/Display/getTitleForLinkedTag'
import { getIconForItem } from '@/Utils/Items/Icons/getIconForItem'
import { LinkableItem } from '@/Utils/Items/Search/LinkableItem'
@@ -1,4 +1,4 @@
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import Icon from '../Icon/Icon'
type Props = {
@@ -2,7 +2,7 @@ import { FeatureName } from '@/Controllers/FeatureName'
import { FeaturesController } from '@/Controllers/FeaturesController'
import { FilesController } from '@/Controllers/FilesController'
import { LinkingController } from '@/Controllers/LinkingController'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { getLinkingSearchResults } from '@/Utils/Items/Search/getSearchResults'
import { observer } from 'mobx-react-lite'
import { ChangeEventHandler, useEffect, useRef, useState } from 'react'
@@ -1,6 +1,6 @@
import { FilesController } from '@/Controllers/FilesController'
import { LinkingController } from '@/Controllers/LinkingController'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { formatDateForContextMenu } from '@/Utils/DateUtils'
import { getIconForItem } from '@/Utils/Items/Icons/getIconForItem'
import { LinkableItem } from '@/Utils/Items/Search/LinkableItem'
@@ -6,7 +6,7 @@ import { IconType } from '@standardnotes/snjs'
import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants'
import { MenuItemType } from './MenuItemType'
import RadioIndicator from '../Radio/RadioIndicator'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { PlatformedKeyboardShortcut } from '@standardnotes/ui-services'
import { KeyboardShortcutIndicator } from '../KeyboardShortcutIndicator/KeyboardShortcutIndicator'
@@ -1,5 +1,5 @@
import { WebApplication } from '@/Application/Application'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import Button from '../Button/Button'
import Icon from '../Icon/Icon'
import { PremiumFeatureIconClass, PremiumFeatureIconName } from '../Icon/PremiumFeatureIcon'
@@ -1,6 +1,6 @@
import { ElementIds } from '@/Constants/ElementIDs'
import { PrefDefaults } from '@/Constants/PrefDefaults'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import { ReactNode, useCallback, useState } from 'react'
import { IconType, PrefKey } from '@standardnotes/snjs'
import Icon from '../Icon/Icon'
@@ -10,7 +10,7 @@ import { PrefDefaults } from '@/Constants/PrefDefaults'
import { StringDeleteNote, STRING_DELETE_LOCKED_ATTEMPT, STRING_DELETE_PLACEHOLDER_ATTEMPT } from '@/Constants/Strings'
import { log, LoggingDomain } from '@/Logging'
import { debounce, isDesktopApplication, isMobileScreen } from '@/Utils'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { classNames } from '@standardnotes/utils'
import {
ApplicationEvent,
ComponentArea,
@@ -95,7 +95,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
private protectionTimeoutId: ReturnType<typeof setTimeout> | null = null
private noteViewElementRef: RefObject<HTMLDivElement>
private editorContentRef: RefObject<HTMLDivElement>
private plainEditorRef?: RefObject<PlainEditorInterface>
private plainEditorRef?: PlainEditorInterface
constructor(props: NoteViewProps) {
super(props, props.application)
@@ -231,6 +231,10 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
}
}
setPlainEditorRef = (ref: PlainEditorInterface | null) => {
this.plainEditorRef = ref || undefined
}
override componentDidUpdate(_prevProps: NoteViewProps, prevState: State): void {
if (
this.state.showProtectedWarning != undefined &&
@@ -569,7 +573,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
}
currentTarget.blur()
this.plainEditorRef?.current?.focus()
this.plainEditorRef?.focus()
}
onTitleChange: ChangeEventHandler<HTMLInputElement> = ({ currentTarget }) => {
@@ -944,7 +948,7 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
<PlainEditor
application={this.application}
spellcheck={this.state.spellcheck}
ref={this.plainEditorRef}
ref={this.setPlainEditorRef}
controller={this.controller}
locked={this.state.noteLocked}
onFocus={this.onPlainFocus}

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