diff --git a/.github/workflows/desktop.release.reuse.yml b/.github/workflows/desktop.release.reuse.yml index 6a4560504..73ed77806 100644 --- a/.github/workflows/desktop.release.reuse.yml +++ b/.github/workflows/desktop.release.reuse.yml @@ -20,7 +20,7 @@ jobs: working-directory: packages/desktop steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: registry-url: 'https://registry.npmjs.org' - run: yarn install @@ -54,7 +54,7 @@ jobs: working-directory: packages/desktop steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: registry-url: 'https://registry.npmjs.org' - name: Set up Ruby @@ -127,7 +127,7 @@ jobs: working-directory: packages/desktop steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: registry-url: 'https://registry.npmjs.org' - run: yarn install @@ -155,7 +155,7 @@ jobs: working-directory: packages/desktop steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: registry-url: 'https://registry.npmjs.org' @@ -178,12 +178,13 @@ jobs: token: ${{ secrets.CI_PAT_TOKEN }} tag_name: "@standardnotes/desktop@${{ steps.package-version.outputs.current-version}}" prerelease: true - draft: true + draft: ${{ inputs.channel == 'beta' && true || false }} name: "Desktop ${{ inputs.channel == 'beta' && 'Beta' || '' }} ${{ steps.package-version.outputs.current-version }}" files: packages/desktop/dist/* - name: Publish Snap continue-on-error: true run: | + 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 diff --git a/.github/workflows/desktop.windows.sign.yml b/.github/workflows/desktop.windows.sign.yml index 73b1c72f3..17d77ac2f 100644 --- a/.github/workflows/desktop.windows.sign.yml +++ b/.github/workflows/desktop.windows.sign.yml @@ -15,7 +15,7 @@ jobs: working-directory: packages/desktop steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: registry-url: 'https://registry.npmjs.org' - run: yarn install @@ -42,7 +42,7 @@ jobs: working-directory: packages/desktop steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: registry-url: 'https://registry.npmjs.org' - uses: actions/download-artifact@v3 diff --git a/.github/workflows/mobile.release.dev.yml b/.github/workflows/mobile.release.dev.yml index 75dd99ee7..350dcbbca 100644 --- a/.github/workflows/mobile.release.dev.yml +++ b/.github/workflows/mobile.release.dev.yml @@ -43,11 +43,22 @@ jobs: with: lane: 'android dev' subdirectory: 'packages/mobile' - - name: Upload universal apk to artifacts - uses: actions/upload-artifact@v2 + + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@main with: - name: dev.apk - path: android/app/build/outputs/apk/dev/release/app-dev-release.apk + path: packages/mobile + - name: Release + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.CI_PAT_TOKEN }} + tag_name: "@standardnotes/mobile@${{ steps.package-version.outputs.current-version}}" + prerelease: true + draft: false + name: "Mobile Beta ${{ steps.package-version.outputs.current-version }}" + files: | + packages/mobile/android/app/build/outputs/apk/dev/release/app-dev-release.apk ios: defaults: run: diff --git a/.github/workflows/mobile.release.prod.yml b/.github/workflows/mobile.release.prod.yml index 45cf5722a..2f35b5e26 100644 --- a/.github/workflows/mobile.release.prod.yml +++ b/.github/workflows/mobile.release.prod.yml @@ -44,16 +44,24 @@ jobs: with: lane: 'android prod' subdirectory: 'packages/mobile' - - name: Upload universal apk to artifacts - uses: actions/upload-artifact@v2 + + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@main with: - name: prod.apk - path: android/app/build/outputs/apk/prod/release/app-prod-release.apk - - name: Upload Android App Bundle to artifacts - uses: actions/upload-artifact@v2 + path: packages/mobile + - name: Release + uses: softprops/action-gh-release@v1 with: - name: release.aab - path: android/app/build/outputs/bundle/prodRelease/app-prod-release.aab + token: ${{ secrets.CI_PAT_TOKEN }} + tag_name: "@standardnotes/mobile@${{ steps.package-version.outputs.current-version}}" + prerelease: false + draft: false + name: "Mobile ${{ steps.package-version.outputs.current-version }}" + files: | + packages/mobile/android/app/build/outputs/bundle/prodRelease/app-prod-release.aab + packages/mobile/android/app/build/outputs/apk/prod/release/app-prod-release.apk + ios: defaults: run: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 93c8d7138..e8bc3ae8c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,7 +6,8 @@ on: - develop - main paths: - - packages/!(components)/** + - '**/**' + - '!packages/components/**' jobs: test: diff --git a/.github/workflows/promote.develop.yml b/.github/workflows/promote.develop.yml new file mode 100644 index 000000000..4ef5fd892 --- /dev/null +++ b/.github/workflows/promote.develop.yml @@ -0,0 +1,37 @@ +name: Promote Develop To Main + +on: + workflow_dispatch: + +jobs: + Run: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: develop + token: ${{ secrets.CI_PAT_TOKEN }} + fetch-depth: 0 + + - name: Setup git config + run: | + git config --global user.name "standardci" + git config --global user.email "ci@standardnotes.com" + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + + - name: Merge Develop into Main + run: | + git config pull.rebase false + git checkout main + git pull origin develop + git push origin main + + diff --git a/.github/workflows/version-bump.yml b/.github/workflows/publish.yml similarity index 71% rename from .github/workflows/version-bump.yml rename to .github/workflows/publish.yml index 60e98030c..a55442b22 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,8 @@ jobs: Build: if: contains(github.event.head_commit.message, 'chore(release)') == false runs-on: ubuntu-latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} steps: - name: Checkout code uses: actions/checkout@v2 @@ -15,6 +17,10 @@ jobs: token: ${{ secrets.CI_PAT_TOKEN }} fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + registry-url: 'https://registry.npmjs.org' + - name: Setup git config run: | git config --global user.name "standardci" @@ -36,7 +42,9 @@ jobs: continue-on-error: true id: graduateRelease if: ${{ github.ref == 'refs/heads/main' }} - run: yarn release:prod:graduate + run: | + yarn release:prod:graduate + yarn publish:prod - name: Bump Prod Version Fallback if: ${{ always() && github.ref == 'refs/heads/main' && steps.graduateRelease.outcome == 'failure' }} @@ -44,7 +52,18 @@ jobs: echo Falling back to non-graduate release due to https://github.com/lerna/lerna/issues/2532 git stash yarn release:prod + yarn publish:prod - name: Bump Beta Version if: ${{ github.ref == 'refs/heads/develop' }} - run: yarn release:beta + run: | + yarn release:beta + yarn publish:beta + + - name: Merge release into develop + if: ${{ github.ref == 'refs/heads/main' }} + run: | + git config pull.rebase false + git checkout develop + git pull origin main + git push origin develop diff --git a/.yarn/cache/@octokit-openapi-types-npm-12.1.0-fd370f495b-449f21166d.zip b/.yarn/cache/@octokit-openapi-types-npm-12.1.0-fd370f495b-449f21166d.zip deleted file mode 100644 index f1bff746e..000000000 Binary files a/.yarn/cache/@octokit-openapi-types-npm-12.1.0-fd370f495b-449f21166d.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-openapi-types-npm-12.3.0-9978c43c2e-2f568d2e1d.zip b/.yarn/cache/@octokit-openapi-types-npm-12.3.0-9978c43c2e-2f568d2e1d.zip new file mode 100644 index 000000000..cf03df2cb Binary files /dev/null and b/.yarn/cache/@octokit-openapi-types-npm-12.3.0-9978c43c2e-2f568d2e1d.zip differ diff --git a/.yarn/cache/@octokit-plugin-paginate-rest-npm-2.18.0-ceaf951a4d-e804e44f92.zip b/.yarn/cache/@octokit-plugin-paginate-rest-npm-2.19.0-b54ef4dcdd-f91a4374ad.zip similarity index 61% rename from .yarn/cache/@octokit-plugin-paginate-rest-npm-2.18.0-ceaf951a4d-e804e44f92.zip rename to .yarn/cache/@octokit-plugin-paginate-rest-npm-2.19.0-b54ef4dcdd-f91a4374ad.zip index fb7c8a2d8..09cf1cc47 100644 Binary files a/.yarn/cache/@octokit-plugin-paginate-rest-npm-2.18.0-ceaf951a4d-e804e44f92.zip and b/.yarn/cache/@octokit-plugin-paginate-rest-npm-2.19.0-b54ef4dcdd-f91a4374ad.zip differ diff --git a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.14.0-04c62d7533-3fbd33aadc.zip b/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.14.1-ee45fbbbb5-7a3dd0b458.zip similarity index 66% rename from .yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.14.0-04c62d7533-3fbd33aadc.zip rename to .yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.14.1-ee45fbbbb5-7a3dd0b458.zip index cc7a9d584..934296328 100644 Binary files a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.14.0-04c62d7533-3fbd33aadc.zip and b/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.14.1-ee45fbbbb5-7a3dd0b458.zip differ diff --git a/.yarn/cache/@octokit-types-npm-6.35.0-5b8bde2cca-0f1949aece.zip b/.yarn/cache/@octokit-types-npm-6.36.0-fbcd4e4172-b2802c2ab1.zip similarity index 77% rename from .yarn/cache/@octokit-types-npm-6.35.0-5b8bde2cca-0f1949aece.zip rename to .yarn/cache/@octokit-types-npm-6.36.0-fbcd4e4172-b2802c2ab1.zip index 717991c91..8f898f0f6 100644 Binary files a/.yarn/cache/@octokit-types-npm-6.35.0-5b8bde2cca-0f1949aece.zip and b/.yarn/cache/@octokit-types-npm-6.36.0-fbcd4e4172-b2802c2ab1.zip differ diff --git a/.yarn/cache/@standardnotes-api-npm-1.1.11-f46352caff-a6efc5d126.zip b/.yarn/cache/@standardnotes-api-npm-1.1.12-1e3aed421c-7262155501.zip similarity index 88% rename from .yarn/cache/@standardnotes-api-npm-1.1.11-f46352caff-a6efc5d126.zip rename to .yarn/cache/@standardnotes-api-npm-1.1.12-1e3aed421c-7262155501.zip index d0c63f497..4f986005a 100644 Binary files a/.yarn/cache/@standardnotes-api-npm-1.1.11-f46352caff-a6efc5d126.zip and b/.yarn/cache/@standardnotes-api-npm-1.1.12-1e3aed421c-7262155501.zip differ diff --git a/.yarn/cache/@standardnotes-encryption-npm-1.8.18-a782eb0fe6-ad6e42f7f8.zip b/.yarn/cache/@standardnotes-encryption-npm-1.8.19-b0a1c08193-f663a6b9a2.zip similarity index 93% rename from .yarn/cache/@standardnotes-encryption-npm-1.8.18-a782eb0fe6-ad6e42f7f8.zip rename to .yarn/cache/@standardnotes-encryption-npm-1.8.19-b0a1c08193-f663a6b9a2.zip index 332468878..4e0cc7901 100644 Binary files a/.yarn/cache/@standardnotes-encryption-npm-1.8.18-a782eb0fe6-ad6e42f7f8.zip and b/.yarn/cache/@standardnotes-encryption-npm-1.8.19-b0a1c08193-f663a6b9a2.zip differ diff --git a/.yarn/cache/@standardnotes-filepicker-npm-1.16.19-4eec2584b5-3fb03b5978.zip b/.yarn/cache/@standardnotes-filepicker-npm-1.16.19-4eec2584b5-3fb03b5978.zip new file mode 100644 index 000000000..6b582e12f Binary files /dev/null and b/.yarn/cache/@standardnotes-filepicker-npm-1.16.19-4eec2584b5-3fb03b5978.zip differ diff --git a/.yarn/cache/@standardnotes-files-npm-1.3.18-13789fa70b-faa26c92bb.zip b/.yarn/cache/@standardnotes-files-npm-1.3.19-e1e1f61034-24f60579a1.zip similarity index 88% rename from .yarn/cache/@standardnotes-files-npm-1.3.18-13789fa70b-faa26c92bb.zip rename to .yarn/cache/@standardnotes-files-npm-1.3.19-e1e1f61034-24f60579a1.zip index 02882da31..d8fcea4b6 100644 Binary files a/.yarn/cache/@standardnotes-files-npm-1.3.18-13789fa70b-faa26c92bb.zip and b/.yarn/cache/@standardnotes-files-npm-1.3.19-e1e1f61034-24f60579a1.zip differ diff --git a/.yarn/cache/@standardnotes-services-npm-1.13.18-fb02dbef3a-bf620905ef.zip b/.yarn/cache/@standardnotes-services-npm-1.13.19-5574bb675a-c4c239c5e8.zip similarity index 87% rename from .yarn/cache/@standardnotes-services-npm-1.13.18-fb02dbef3a-bf620905ef.zip rename to .yarn/cache/@standardnotes-services-npm-1.13.19-5574bb675a-c4c239c5e8.zip index 8f200a1b8..c95a7fcd1 100644 Binary files a/.yarn/cache/@standardnotes-services-npm-1.13.18-fb02dbef3a-bf620905ef.zip and b/.yarn/cache/@standardnotes-services-npm-1.13.19-5574bb675a-c4c239c5e8.zip differ diff --git a/.yarn/cache/@standardnotes-snjs-npm-2.117.4-f662c3f9c6-5895619da1.zip b/.yarn/cache/@standardnotes-snjs-npm-2.117.5-ade89ac686-167e3e5c06.zip similarity index 85% rename from .yarn/cache/@standardnotes-snjs-npm-2.117.4-f662c3f9c6-5895619da1.zip rename to .yarn/cache/@standardnotes-snjs-npm-2.117.5-ade89ac686-167e3e5c06.zip index 5607dbc96..e354ca489 100644 Binary files a/.yarn/cache/@standardnotes-snjs-npm-2.117.4-f662c3f9c6-5895619da1.zip and b/.yarn/cache/@standardnotes-snjs-npm-2.117.5-ade89ac686-167e3e5c06.zip differ diff --git a/.yarn/cache/@testing-library-dom-npm-8.13.0-de21374654-880f1872b9.zip b/.yarn/cache/@testing-library-dom-npm-8.13.0-de21374654-880f1872b9.zip deleted file mode 100644 index d6bf3bd80..000000000 Binary files a/.yarn/cache/@testing-library-dom-npm-8.13.0-de21374654-880f1872b9.zip and /dev/null differ diff --git a/.yarn/cache/@testing-library-dom-npm-8.14.0-c0d87cffdc-a916ea5167.zip b/.yarn/cache/@testing-library-dom-npm-8.14.0-c0d87cffdc-a916ea5167.zip new file mode 100644 index 000000000..baa9284e2 Binary files /dev/null and b/.yarn/cache/@testing-library-dom-npm-8.14.0-c0d87cffdc-a916ea5167.zip differ diff --git a/.yarn/cache/@types-react-native-npm-0.67.8-c4b2e493be-f031ecde87.zip b/.yarn/cache/@types-react-native-npm-0.67.8-c4b2e493be-f031ecde87.zip deleted file mode 100644 index 36a71a3d4..000000000 Binary files a/.yarn/cache/@types-react-native-npm-0.67.8-c4b2e493be-f031ecde87.zip and /dev/null differ diff --git a/.yarn/cache/@types-react-native-npm-0.67.9-ec54565b3f-eb33862284.zip b/.yarn/cache/@types-react-native-npm-0.67.9-ec54565b3f-eb33862284.zip new file mode 100644 index 000000000..51a68b915 Binary files /dev/null and b/.yarn/cache/@types-react-native-npm-0.67.9-ec54565b3f-eb33862284.zip differ diff --git a/.yarn/cache/@zip.js-zip.js-npm-2.4.15-34d0d5513e-fb17f190ff.zip b/.yarn/cache/@zip.js-zip.js-npm-2.4.19-d7ccb2094a-d7f1d67637.zip similarity index 99% rename from .yarn/cache/@zip.js-zip.js-npm-2.4.15-34d0d5513e-fb17f190ff.zip rename to .yarn/cache/@zip.js-zip.js-npm-2.4.19-d7ccb2094a-d7f1d67637.zip index efde1ed8c..42e054372 100644 Binary files a/.yarn/cache/@zip.js-zip.js-npm-2.4.15-34d0d5513e-fb17f190ff.zip and b/.yarn/cache/@zip.js-zip.js-npm-2.4.19-d7ccb2094a-d7f1d67637.zip differ diff --git a/.yarn/cache/caniuse-lite-npm-1.0.30001355-407dbdf72d-4154cabab0.zip b/.yarn/cache/caniuse-lite-npm-1.0.30001357-4e415cba2e-aae79796f9.zip similarity index 91% rename from .yarn/cache/caniuse-lite-npm-1.0.30001355-407dbdf72d-4154cabab0.zip rename to .yarn/cache/caniuse-lite-npm-1.0.30001357-4e415cba2e-aae79796f9.zip index d1eb184e3..1fafffdf6 100644 Binary files a/.yarn/cache/caniuse-lite-npm-1.0.30001355-407dbdf72d-4154cabab0.zip and b/.yarn/cache/caniuse-lite-npm-1.0.30001357-4e415cba2e-aae79796f9.zip differ diff --git a/.yarn/cache/codemirror-npm-5.65.5-869a3f61ca-7d9e50b0e9.zip b/.yarn/cache/codemirror-npm-5.65.5-869a3f61ca-7d9e50b0e9.zip deleted file mode 100644 index ce3d25e65..000000000 Binary files a/.yarn/cache/codemirror-npm-5.65.5-869a3f61ca-7d9e50b0e9.zip and /dev/null differ diff --git a/.yarn/cache/codemirror-npm-5.65.6-2d74e8af09-d65aa28af0.zip b/.yarn/cache/codemirror-npm-5.65.6-2d74e8af09-d65aa28af0.zip new file mode 100644 index 000000000..86085d646 Binary files /dev/null and b/.yarn/cache/codemirror-npm-5.65.6-2d74e8af09-d65aa28af0.zip differ diff --git a/.yarn/cache/cssnano-npm-5.1.11-eca3fe85a3-0fa4dec39c.zip b/.yarn/cache/cssnano-npm-5.1.12-053744178f-5bc6a6195e.zip similarity index 93% rename from .yarn/cache/cssnano-npm-5.1.11-eca3fe85a3-0fa4dec39c.zip rename to .yarn/cache/cssnano-npm-5.1.12-053744178f-5bc6a6195e.zip index e25546487..f001a7614 100644 Binary files a/.yarn/cache/cssnano-npm-5.1.11-eca3fe85a3-0fa4dec39c.zip and b/.yarn/cache/cssnano-npm-5.1.12-053744178f-5bc6a6195e.zip differ diff --git a/.yarn/cache/cssnano-preset-default-npm-5.2.11-6e8157defd-827a823d12.zip b/.yarn/cache/cssnano-preset-default-npm-5.2.12-c625a52141-3d6c05e771.zip similarity index 84% rename from .yarn/cache/cssnano-preset-default-npm-5.2.11-6e8157defd-827a823d12.zip rename to .yarn/cache/cssnano-preset-default-npm-5.2.12-c625a52141-3d6c05e771.zip index b10c382ee..bd0a98f94 100644 Binary files a/.yarn/cache/cssnano-preset-default-npm-5.2.11-6e8157defd-827a823d12.zip and b/.yarn/cache/cssnano-preset-default-npm-5.2.12-c625a52141-3d6c05e771.zip differ diff --git a/.yarn/cache/electron-to-chromium-npm-1.4.160-ec09f648b2-cd1058ddf8.zip b/.yarn/cache/electron-to-chromium-npm-1.4.161-30baaf5e01-a14137543f.zip similarity index 82% rename from .yarn/cache/electron-to-chromium-npm-1.4.160-ec09f648b2-cd1058ddf8.zip rename to .yarn/cache/electron-to-chromium-npm-1.4.161-30baaf5e01-a14137543f.zip index 06ba7a1b4..a88ab4fde 100644 Binary files a/.yarn/cache/electron-to-chromium-npm-1.4.160-ec09f648b2-cd1058ddf8.zip and b/.yarn/cache/electron-to-chromium-npm-1.4.161-30baaf5e01-a14137543f.zip differ diff --git a/.yarn/cache/electron-updater-npm-5.0.5-69415d6b04-bc288c4bf1.zip b/.yarn/cache/electron-updater-npm-5.0.6-fe2399a6fb-92322ddf32.zip similarity index 93% rename from .yarn/cache/electron-updater-npm-5.0.5-69415d6b04-bc288c4bf1.zip rename to .yarn/cache/electron-updater-npm-5.0.6-fe2399a6fb-92322ddf32.zip index 1ecaf1848..483741a6c 100644 Binary files a/.yarn/cache/electron-updater-npm-5.0.5-69415d6b04-bc288c4bf1.zip and b/.yarn/cache/electron-updater-npm-5.0.6-fe2399a6fb-92322ddf32.zip differ diff --git a/.yarn/cache/eslint-npm-8.17.0-2709464af0-b484c96681.zip b/.yarn/cache/eslint-npm-8.18.0-3b3bfb190f-d9b4b7488a.zip similarity index 93% rename from .yarn/cache/eslint-npm-8.17.0-2709464af0-b484c96681.zip rename to .yarn/cache/eslint-npm-8.18.0-3b3bfb190f-d9b4b7488a.zip index 37d6263c3..63f7bd8c2 100644 Binary files a/.yarn/cache/eslint-npm-8.17.0-2709464af0-b484c96681.zip and b/.yarn/cache/eslint-npm-8.18.0-3b3bfb190f-d9b4b7488a.zip differ diff --git a/.yarn/cache/make-fetch-happen-npm-10.1.7-a248104317-2b7301256e.zip b/.yarn/cache/make-fetch-happen-npm-10.1.8-1571a0a77a-5fe9fd9da5.zip similarity index 84% rename from .yarn/cache/make-fetch-happen-npm-10.1.7-a248104317-2b7301256e.zip rename to .yarn/cache/make-fetch-happen-npm-10.1.8-1571a0a77a-5fe9fd9da5.zip index bd783470a..cc312953d 100644 Binary files a/.yarn/cache/make-fetch-happen-npm-10.1.7-a248104317-2b7301256e.zip and b/.yarn/cache/make-fetch-happen-npm-10.1.8-1571a0a77a-5fe9fd9da5.zip differ diff --git a/.yarn/cache/memfs-npm-3.4.4-95f3932b53-c91d5a3f7e.zip b/.yarn/cache/memfs-npm-3.4.4-95f3932b53-c91d5a3f7e.zip deleted file mode 100644 index 645016542..000000000 Binary files a/.yarn/cache/memfs-npm-3.4.4-95f3932b53-c91d5a3f7e.zip and /dev/null differ diff --git a/.yarn/cache/memfs-npm-3.4.6-26513761db-0164d79c5d.zip b/.yarn/cache/memfs-npm-3.4.6-26513761db-0164d79c5d.zip new file mode 100644 index 000000000..66d9c944f Binary files /dev/null and b/.yarn/cache/memfs-npm-3.4.6-26513761db-0164d79c5d.zip differ diff --git a/.yarn/cache/minipass-npm-3.2.1-ad5ea8bd00-3a33b74784.zip b/.yarn/cache/minipass-npm-3.2.1-ad5ea8bd00-3a33b74784.zip deleted file mode 100644 index 3cebe0ad4..000000000 Binary files a/.yarn/cache/minipass-npm-3.2.1-ad5ea8bd00-3a33b74784.zip and /dev/null differ diff --git a/.yarn/cache/minipass-npm-3.3.3-d77c879d53-523a338f42.zip b/.yarn/cache/minipass-npm-3.3.3-d77c879d53-523a338f42.zip new file mode 100644 index 000000000..eee50e700 Binary files /dev/null and b/.yarn/cache/minipass-npm-3.3.3-d77c879d53-523a338f42.zip differ diff --git a/.yarn/cache/postcss-merge-longhand-npm-5.1.5-14d2257664-1d51e3d6a1.zip b/.yarn/cache/postcss-merge-longhand-npm-5.1.6-1ea474a013-327b5474d9.zip similarity index 86% rename from .yarn/cache/postcss-merge-longhand-npm-5.1.5-14d2257664-1d51e3d6a1.zip rename to .yarn/cache/postcss-merge-longhand-npm-5.1.6-1ea474a013-327b5474d9.zip index fcea3606b..715e3a350 100644 Binary files a/.yarn/cache/postcss-merge-longhand-npm-5.1.5-14d2257664-1d51e3d6a1.zip and b/.yarn/cache/postcss-merge-longhand-npm-5.1.6-1ea474a013-327b5474d9.zip differ diff --git a/.yarn/cache/postcss-normalize-positions-npm-5.1.0-d566de9fd1-08a1f12cc8.zip b/.yarn/cache/postcss-normalize-positions-npm-5.1.0-d566de9fd1-08a1f12cc8.zip deleted file mode 100644 index f9e7be271..000000000 Binary files a/.yarn/cache/postcss-normalize-positions-npm-5.1.0-d566de9fd1-08a1f12cc8.zip and /dev/null differ diff --git a/.yarn/cache/postcss-normalize-positions-npm-5.1.1-82275c9405-d9afc23372.zip b/.yarn/cache/postcss-normalize-positions-npm-5.1.1-82275c9405-d9afc23372.zip new file mode 100644 index 000000000..b9ea7fc47 Binary files /dev/null and b/.yarn/cache/postcss-normalize-positions-npm-5.1.1-82275c9405-d9afc23372.zip differ diff --git a/.yarn/cache/postcss-normalize-repeat-style-npm-5.1.0-f755e7e0fa-65176c3774.zip b/.yarn/cache/postcss-normalize-repeat-style-npm-5.1.0-f755e7e0fa-65176c3774.zip deleted file mode 100644 index 3781073ac..000000000 Binary files a/.yarn/cache/postcss-normalize-repeat-style-npm-5.1.0-f755e7e0fa-65176c3774.zip and /dev/null differ diff --git a/.yarn/cache/postcss-normalize-repeat-style-npm-5.1.1-dd2adac3b3-2c6ad2b0ae.zip b/.yarn/cache/postcss-normalize-repeat-style-npm-5.1.1-dd2adac3b3-2c6ad2b0ae.zip new file mode 100644 index 000000000..46338f507 Binary files /dev/null and b/.yarn/cache/postcss-normalize-repeat-style-npm-5.1.1-dd2adac3b3-2c6ad2b0ae.zip differ diff --git a/.yarn/cache/postcss-ordered-values-npm-5.1.2-c99a2b4959-0a795b14c4.zip b/.yarn/cache/postcss-ordered-values-npm-5.1.3-c12ebfb39c-6f3ca85b6c.zip similarity index 79% rename from .yarn/cache/postcss-ordered-values-npm-5.1.2-c99a2b4959-0a795b14c4.zip rename to .yarn/cache/postcss-ordered-values-npm-5.1.3-c12ebfb39c-6f3ca85b6c.zip index 7b9440a44..bbbe26d90 100644 Binary files a/.yarn/cache/postcss-ordered-values-npm-5.1.2-c99a2b4959-0a795b14c4.zip and b/.yarn/cache/postcss-ordered-values-npm-5.1.3-c12ebfb39c-6f3ca85b6c.zip differ diff --git a/.yarn/cache/resolve-npm-1.22.0-f641ddcc95-a2d14cc437.zip b/.yarn/cache/resolve-npm-1.22.1-3980488690-07af5fc1e8.zip similarity index 60% rename from .yarn/cache/resolve-npm-1.22.0-f641ddcc95-a2d14cc437.zip rename to .yarn/cache/resolve-npm-1.22.1-3980488690-07af5fc1e8.zip index 1804da23d..d41402c87 100644 Binary files a/.yarn/cache/resolve-npm-1.22.0-f641ddcc95-a2d14cc437.zip and b/.yarn/cache/resolve-npm-1.22.1-3980488690-07af5fc1e8.zip differ diff --git a/.yarn/cache/resolve-npm-2.0.0-next.3-6be30bb506-f34b3b93ad.zip b/.yarn/cache/resolve-npm-2.0.0-next.3-6be30bb506-f34b3b93ad.zip deleted file mode 100644 index 4464fdaf7..000000000 Binary files a/.yarn/cache/resolve-npm-2.0.0-next.3-6be30bb506-f34b3b93ad.zip and /dev/null differ diff --git a/.yarn/cache/resolve-npm-2.0.0-next.4-3d0bd8621e-c438ac9a65.zip b/.yarn/cache/resolve-npm-2.0.0-next.4-3d0bd8621e-c438ac9a65.zip new file mode 100644 index 000000000..fa2c3c65f Binary files /dev/null and b/.yarn/cache/resolve-npm-2.0.0-next.4-3d0bd8621e-c438ac9a65.zip differ diff --git a/.yarn/cache/resolve-patch-00f699a708-21684b4d99.zip b/.yarn/cache/resolve-patch-00f699a708-21684b4d99.zip deleted file mode 100644 index af7a06371..000000000 Binary files a/.yarn/cache/resolve-patch-00f699a708-21684b4d99.zip and /dev/null differ diff --git a/.yarn/cache/resolve-patch-bad885c6ea-c79ecaea36.zip b/.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip similarity index 58% rename from .yarn/cache/resolve-patch-bad885c6ea-c79ecaea36.zip rename to .yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip index b7e8b9abf..c3066c360 100644 Binary files a/.yarn/cache/resolve-patch-bad885c6ea-c79ecaea36.zip and b/.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip differ diff --git a/.yarn/cache/resolve-patch-bdbf6a2444-4bf9f4f8a4.zip b/.yarn/cache/resolve-patch-bdbf6a2444-4bf9f4f8a4.zip new file mode 100644 index 000000000..685f69a5d Binary files /dev/null and b/.yarn/cache/resolve-patch-bdbf6a2444-4bf9f4f8a4.zip differ diff --git a/.yarn/cache/rollup-npm-2.75.6-e4ac39d8cc-df83c6d43a.zip b/.yarn/cache/rollup-npm-2.75.6-e4ac39d8cc-df83c6d43a.zip deleted file mode 100644 index 0b69ede59..000000000 Binary files a/.yarn/cache/rollup-npm-2.75.6-e4ac39d8cc-df83c6d43a.zip and /dev/null differ diff --git a/.yarn/cache/rollup-npm-2.75.7-3918160ee7-a6331d46b0.zip b/.yarn/cache/rollup-npm-2.75.7-3918160ee7-a6331d46b0.zip new file mode 100644 index 000000000..35ac2865b Binary files /dev/null and b/.yarn/cache/rollup-npm-2.75.7-3918160ee7-a6331d46b0.zip differ diff --git a/.yarn/cache/typescript-npm-4.7.3-edc6629fdf-fd13a1ce53.zip b/.yarn/cache/typescript-npm-4.7.4-65aa6ffb42-5750181b1c.zip similarity index 63% rename from .yarn/cache/typescript-npm-4.7.3-edc6629fdf-fd13a1ce53.zip rename to .yarn/cache/typescript-npm-4.7.4-65aa6ffb42-5750181b1c.zip index e050ea1c6..9dd083303 100644 Binary files a/.yarn/cache/typescript-npm-4.7.3-edc6629fdf-fd13a1ce53.zip and b/.yarn/cache/typescript-npm-4.7.4-65aa6ffb42-5750181b1c.zip differ diff --git a/.yarn/cache/typescript-patch-e8f1acd78e-137d18a77f.zip b/.yarn/cache/typescript-patch-e8b9857d0c-9096d8f6c1.zip similarity index 57% rename from .yarn/cache/typescript-patch-e8f1acd78e-137d18a77f.zip rename to .yarn/cache/typescript-patch-e8b9857d0c-9096d8f6c1.zip index 7bbf88f2a..3b8bfa9b9 100644 Binary files a/.yarn/cache/typescript-patch-e8f1acd78e-137d18a77f.zip and b/.yarn/cache/typescript-patch-e8b9857d0c-9096d8f6c1.zip differ diff --git a/package.json b/package.json index 69fcfb7a8..829a88e2a 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"", "release:prod:graduate": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish\"", "release:beta": "lerna version --conventional-prerelease --conventional-commits --yes -m \"chore(release): publish\"", + "publish:prod": "lerna publish from-git --yes", + "publish:beta": "lerna publish from-git --yes --dist-tag alpha", "version": "yarn install --no-immutable && git add yarn.lock", "postversion": "./scripts/push-tags-one-by-one.sh", "lerna:list": " yarn lerna list -all", diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md index 185360a74..cad97e02e 100644 --- a/packages/desktop/CHANGELOG.md +++ b/packages/desktop/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.22.12-alpha.3](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.22.12-alpha.2...@standardnotes/desktop@3.22.12-alpha.3) (2022-06-20) + +### Bug Fixes + +* **desktop:** linux executableName ([296873d](https://github.com/standardnotes/app/commit/296873d671d6cc7cb8744747c09bf755e3a6f1e0)) + +## [3.22.12-alpha.2](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.22.12-alpha.1...@standardnotes/desktop@3.22.12-alpha.2) (2022-06-20) + +**Note:** Version bump only for package @standardnotes/desktop + +## [3.22.12-alpha.1](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.22.12-alpha.0...@standardnotes/desktop@3.22.12-alpha.1) (2022-06-19) + +**Note:** Version bump only for package @standardnotes/desktop + +## [3.22.12-alpha.0](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.22.11...@standardnotes/desktop@3.22.12-alpha.0) (2022-06-18) + +**Note:** Version bump only for package @standardnotes/desktop + ## [3.22.11](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.22.11-alpha.0...@standardnotes/desktop@3.22.11) (2022-06-18) **Note:** Version bump only for package @standardnotes/desktop diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 7fc29c603..021a1c7fc 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@standardnotes/desktop", "main": "./app/dist/index.js", - "version": "3.22.11", + "version": "3.22.12-alpha.3", "license": "AGPL-3.0-or-later", "author": "Standard Notes.", "private": true, @@ -123,7 +123,7 @@ "linux": { "category": "Office", "icon": "build/icon/", - "executableName": "Standard Notes", + "executableName": "standard-notes", "desktop": { "StartupWMClass": "standard notes" }, diff --git a/packages/releases/.gitignore b/packages/releases/.gitignore new file mode 100644 index 000000000..53c37a166 --- /dev/null +++ b/packages/releases/.gitignore @@ -0,0 +1 @@ +dist \ No newline at end of file diff --git a/packages/releases/CHANGELOG.md b/packages/releases/CHANGELOG.md new file mode 100644 index 000000000..fb50328d7 --- /dev/null +++ b/packages/releases/CHANGELOG.md @@ -0,0 +1,14 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [1.1.0-alpha.1](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.1.0-alpha.0...@standardnotes/releases@1.1.0-alpha.1) (2022-06-20) + +**Note:** Version bump only for package @standardnotes/releases + +# 1.1.0-alpha.0 (2022-06-20) + +### Features + +* public releases package ([4fea3e9](https://github.com/standardnotes/app/commit/4fea3e9a6b5fdeea772ca903fccff7034b6e2928)) diff --git a/packages/releases/index.mjs b/packages/releases/index.mjs new file mode 100644 index 000000000..4e8923b26 --- /dev/null +++ b/packages/releases/index.mjs @@ -0,0 +1,15 @@ +import Components from '../components/package.json' assert { type: 'json' } +import Desktop from '../desktop/package.json' assert { type: 'json' } +import Mobile from '../mobile/package.json' assert { type: 'json' } +import Web from '../web/package.json' assert { type: 'json' } +import { writeJson, ensureDirExists } from '../../scripts/ScriptUtils.mjs' + +const Releases = { + [Components.name]: Components.version, + [Desktop.name]: Desktop.version, + [Mobile.name]: Mobile.version, + [Web.name]: Web.version, +} + +ensureDirExists('dist') +writeJson(Releases, 'dist/releases.json') diff --git a/packages/releases/package.json b/packages/releases/package.json new file mode 100644 index 000000000..48819f184 --- /dev/null +++ b/packages/releases/package.json @@ -0,0 +1,22 @@ +{ + "name": "@standardnotes/releases", + "version": "1.1.0-alpha.1", + "license": "AGPL-3.0-or-later", + "main": "dist/releases.json", + "publishConfig": { + "access": "public" + }, + "author": "Standard Notes.", + "description": "Standard Notes client release versions", + "engines": { + "node": ">=12.19.0 <17.0.0" + }, + "scripts": { + "build": "node index.mjs", + "version": "yarn build" + }, + "devDependencies": { + "@types/node": "*", + "typescript": "*" + } +} diff --git a/packages/web-server/CHANGELOG.md b/packages/web-server/CHANGELOG.md index dbce32a5e..da37ea4dd 100644 --- a/packages/web-server/CHANGELOG.md +++ b/packages/web-server/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.14-alpha.2](https://github.com/standardnotes/app/compare/@standardnotes/web-server@1.2.14-alpha.1...@standardnotes/web-server@1.2.14-alpha.2) (2022-06-20) + +**Note:** Version bump only for package @standardnotes/web-server + +## [1.2.14-alpha.1](https://github.com/standardnotes/app/compare/@standardnotes/web-server@1.2.14-alpha.0...@standardnotes/web-server@1.2.14-alpha.1) (2022-06-19) + +**Note:** Version bump only for package @standardnotes/web-server + +## [1.2.14-alpha.0](https://github.com/standardnotes/app/compare/@standardnotes/web-server@1.2.13...@standardnotes/web-server@1.2.14-alpha.0) (2022-06-18) + +**Note:** Version bump only for package @standardnotes/web-server + ## [1.2.13](https://github.com/standardnotes/app/compare/@standardnotes/web-server@1.2.13-alpha.0...@standardnotes/web-server@1.2.13) (2022-06-18) **Note:** Version bump only for package @standardnotes/web-server diff --git a/packages/web-server/package.json b/packages/web-server/package.json index f9b4979c2..150e7610d 100644 --- a/packages/web-server/package.json +++ b/packages/web-server/package.json @@ -1,6 +1,6 @@ { "name": "@standardnotes/web-server", - "version": "1.2.13", + "version": "1.2.14-alpha.2", "license": "AGPL-3.0-or-later", "private": true, "author": "Standard Notes.", diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index bc217f885..307a85c55 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.23.0-alpha.1](https://github.com/standardnotes/app/compare/@standardnotes/web@3.23.0-alpha.0...@standardnotes/web@3.23.0-alpha.1) (2022-06-20) + +**Note:** Version bump only for package @standardnotes/web + +# [3.23.0-alpha.0](https://github.com/standardnotes/app/compare/@standardnotes/web@3.22.7-alpha.0...@standardnotes/web@3.23.0-alpha.0) (2022-06-19) + +### Features + +* ctrl+a to select all items ([#1123](https://github.com/standardnotes/app/issues/1123)) ([dcf3724](https://github.com/standardnotes/app/commit/dcf3724e2c951d7bbad276d37b3302c34d7ee78f)) + +## [3.22.7-alpha.0](https://github.com/standardnotes/app/compare/@standardnotes/web@3.22.6...@standardnotes/web@3.22.7-alpha.0) (2022-06-18) + +### Bug Fixes + +* exporting multiple notes with same title ([#1119](https://github.com/standardnotes/app/issues/1119)) ([dfbd72b](https://github.com/standardnotes/app/commit/dfbd72b1dfd4a4681c452c9113248045e69880cd)) + ## [3.22.6](https://github.com/standardnotes/app/compare/@standardnotes/web@3.22.6-alpha.0...@standardnotes/web@3.22.6) (2022-06-18) **Note:** Version bump only for package @standardnotes/web diff --git a/packages/web/package.json b/packages/web/package.json index 96c07e51e..76f5cafbe 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,9 +1,9 @@ { "name": "@standardnotes/web", - "version": "3.22.6", + "version": "3.23.0-alpha.1", "license": "AGPL-3.0-or-later", "main": "dist/app.js", - "author": "Standard Notes", + "author": "Standard Notes.", "private": true, "files": [ "dist" diff --git a/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx b/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx index 92fc97980..93238f496 100644 --- a/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx +++ b/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx @@ -14,7 +14,7 @@ import ChallengeModal from '@/Components/ChallengeModal/ChallengeModal' import NotesContextMenu from '@/Components/NotesContextMenu/NotesContextMenu' import PurchaseFlowWrapper from '@/Components/PurchaseFlow/PurchaseFlowWrapper' import { FunctionComponent, useCallback, useEffect, useMemo, useState } from 'react' -import RevisionHistoryModalWrapper from '@/Components/RevisionHistoryModal/RevisionHistoryModalWrapper' +import RevisionHistoryModal from '@/Components/RevisionHistoryModal/RevisionHistoryModal' import PremiumModalProvider from '@/Hooks/usePremiumModal' import ConfirmSignoutContainer from '@/Components/ConfirmSignoutModal/ConfirmSignoutModal' import TagsContextMenuWrapper from '@/Components/Tags/TagContextMenu' @@ -177,7 +177,18 @@ const ApplicationView: FunctionComponent = ({ application, mainApplicatio
- +
@@ -185,7 +196,13 @@ const ApplicationView: FunctionComponent = ({ application, mainApplicatio
- + {renderChallenges()} @@ -196,6 +213,7 @@ const ApplicationView: FunctionComponent = ({ application, mainApplicatio navigationController={viewControllerManager.navigationController} notesController={viewControllerManager.notesController} noteTagsController={viewControllerManager.noteTagsController} + historyModalController={viewControllerManager.historyModalController} /> void onLoad?: (component: SNComponent) => void diff --git a/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx b/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx index 45d20aa20..af032ea03 100644 --- a/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx @@ -1,32 +1,44 @@ import { WebApplication } from '@/Application/Application' import { KeyboardKey } from '@/Services/IOService' -import { ViewControllerManager } from '@/Services/ViewControllerManager' import { UuidString } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' import { FunctionComponent, KeyboardEventHandler, UIEventHandler, useCallback } from 'react' import { FOCUSABLE_BUT_NOT_TABBABLE, NOTES_LIST_SCROLL_THRESHOLD } from '@/Constants/Constants' import { ListableContentItem } from './Types/ListableContentItem' import ContentListItem from './ContentListItem' +import { ItemListController } from '@/Controllers/ItemList/ItemListController' +import { FilesController } from '@/Controllers/FilesController' +import { SelectedItemsController } from '@/Controllers/SelectedItemsController' +import { NavigationController } from '@/Controllers/Navigation/NavigationController' +import { NotesController } from '@/Controllers/NotesController' +import { ElementIds } from '@/Constants/ElementIDs' type Props = { application: WebApplication - viewControllerManager: ViewControllerManager + filesController: FilesController + itemListController: ItemListController items: ListableContentItem[] + navigationController: NavigationController + notesController: NotesController + selectionController: SelectedItemsController selectedItems: Record paginate: () => void } const ContentList: FunctionComponent = ({ application, - viewControllerManager, + filesController, + itemListController, items, + navigationController, + notesController, + selectionController, selectedItems, paginate, }) => { - const { selectPreviousItem, selectNextItem } = viewControllerManager.itemListController - const { hideTags, hideDate, hideNotePreview, hideEditorIcon } = - viewControllerManager.itemListController.webDisplayOptions - const { sortBy } = viewControllerManager.itemListController.displayOptions + const { selectPreviousItem, selectNextItem } = itemListController + const { hideTags, hideDate, hideNotePreview, hideEditorIcon } = itemListController.webDisplayOptions + const { sortBy } = itemListController.displayOptions const onScroll: UIEventHandler = useCallback( (e) => { @@ -55,7 +67,7 @@ const ContentList: FunctionComponent = ({ return (
= ({ hideTags={hideTags} hideIcon={hideEditorIcon} sortBy={sortBy} - filesController={viewControllerManager.filesController} - selectionController={viewControllerManager.selectionController} - navigationController={viewControllerManager.navigationController} - notesController={viewControllerManager.notesController} + filesController={filesController} + selectionController={selectionController} + navigationController={navigationController} + notesController={notesController} /> ))}
diff --git a/packages/web/src/javascripts/Components/ContentListView/ContentListOptionsMenu.tsx b/packages/web/src/javascripts/Components/ContentListView/ContentListOptionsMenu.tsx index ce6243c9b..b6d3311f2 100644 --- a/packages/web/src/javascripts/Components/ContentListView/ContentListOptionsMenu.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/ContentListOptionsMenu.tsx @@ -7,22 +7,22 @@ import Menu from '@/Components/Menu/Menu' import MenuItem from '@/Components/Menu/MenuItem' import MenuItemSeparator from '@/Components/Menu/MenuItemSeparator' import { MenuItemType } from '@/Components/Menu/MenuItemType' -import { ViewControllerManager } from '@/Services/ViewControllerManager' +import { NavigationController } from '@/Controllers/Navigation/NavigationController' type Props = { application: WebApplication - viewControllerManager: ViewControllerManager closeOnBlur: (event: { relatedTarget: EventTarget | null }) => void closeDisplayOptionsMenu: () => void isOpen: boolean + navigationController: NavigationController } const ContentListOptionsMenu: FunctionComponent = ({ closeDisplayOptionsMenu, closeOnBlur, application, - viewControllerManager, isOpen, + navigationController, }) => { const [sortBy, setSortBy] = useState(() => application.getPreference(PrefKey.SortNotesBy, CollectionSort.CreatedAt)) const [sortReverse, setSortReverse] = useState(() => application.getPreference(PrefKey.SortNotesReverse, false)) @@ -174,7 +174,7 @@ const ContentListOptionsMenu: FunctionComponent = ({
View
- {viewControllerManager.navigationController.selectedUuid !== SystemViewId.Files && ( + {navigationController.selectedUuid !== SystemViewId.Files && ( = ({ application, viewControllerManager }) => { +const ContentListView: FunctionComponent = ({ + accountMenuController, + application, + filesController, + itemListController, + navigationController, + noAccountWarningController, + noteTagsController, + notesController, + searchOptionsController, + selectionController, +}) => { const itemsViewPanelRef = useRef(null) const displayOptionsMenuRef = useRef(null) @@ -47,9 +75,9 @@ const ContentListView: FunctionComponent = ({ application, viewController paginate, panelWidth, createNewNote, - } = viewControllerManager.itemListController + } = itemListController - const { selectedItems } = viewControllerManager.selectionController + const { selectedItems } = selectionController const [showDisplayOptionsMenu, setShowDisplayOptionsMenu] = useState(false) const [focusedSearch, setFocusedSearch] = useState(false) @@ -57,17 +85,17 @@ const ContentListView: FunctionComponent = ({ application, viewController const [closeDisplayOptMenuOnBlur] = useCloseOnBlur(displayOptionsMenuRef, setShowDisplayOptionsMenu) const isFilesSmartView = useMemo( - () => viewControllerManager.navigationController.selected?.uuid === SystemViewId.Files, - [viewControllerManager.navigationController.selected?.uuid], + () => navigationController.selected?.uuid === SystemViewId.Files, + [navigationController.selected?.uuid], ) const addNewItem = useCallback(() => { if (isFilesSmartView) { - void viewControllerManager.filesController.uploadNewFile() + void filesController.uploadNewFile() } else { void createNewNote() } - }, [viewControllerManager.filesController, createNewNote, isFilesSmartView]) + }, [filesController, createNewNote, isFilesSmartView]) useEffect(() => { /** @@ -75,7 +103,7 @@ const ContentListView: FunctionComponent = ({ application, viewController * use Control modifier as well. These rules don't apply to desktop, but * probably better to be consistent. */ - const newNoteKeyObserver = application.io.addKeyObserver({ + const disposeNewNoteKeyObserver = application.io.addKeyObserver({ key: 'n', modifiers: [KeyboardModifier.Meta, KeyboardModifier.Ctrl], onKeyDown: (event) => { @@ -84,7 +112,7 @@ const ContentListView: FunctionComponent = ({ application, viewController }, }) - const nextNoteKeyObserver = application.io.addKeyObserver({ + const disposeNextNoteKeyObserver = application.io.addKeyObserver({ key: KeyboardKey.Down, elements: [document.body, ...(searchBarElement ? [searchBarElement] : [])], onKeyDown: () => { @@ -95,7 +123,7 @@ const ContentListView: FunctionComponent = ({ application, viewController }, }) - const previousNoteKeyObserver = application.io.addKeyObserver({ + const disposePreviousNoteKeyObserver = application.io.addKeyObserver({ key: KeyboardKey.Up, element: document.body, onKeyDown: () => { @@ -103,7 +131,7 @@ const ContentListView: FunctionComponent = ({ application, viewController }, }) - const searchKeyObserver = application.io.addKeyObserver({ + const disposeSearchKeyObserver = application.io.addKeyObserver({ key: 'f', modifiers: [KeyboardModifier.Meta, KeyboardModifier.Shift], onKeyDown: () => { @@ -113,13 +141,37 @@ const ContentListView: FunctionComponent = ({ application, viewController }, }) + const disposeSelectAllKeyObserver = application.io.addKeyObserver({ + key: 'a', + modifiers: [KeyboardModifier.Ctrl], + onKeyDown: (event) => { + const isTargetInsideContentList = (event.target as HTMLElement).closest(`#${ElementIds.ContentList}`) + + if (!isTargetInsideContentList) { + return + } + + event.preventDefault() + selectionController.selectAll() + }, + }) + return () => { - newNoteKeyObserver() - nextNoteKeyObserver() - previousNoteKeyObserver() - searchKeyObserver() + disposeNewNoteKeyObserver() + disposeNextNoteKeyObserver() + disposePreviousNoteKeyObserver() + disposeSearchKeyObserver() + disposeSelectAllKeyObserver() } - }, [addNewItem, application.io, createNewNote, searchBarElement, selectNextItem, selectPreviousItem]) + }, [ + addNewItem, + application.io, + createNewNote, + searchBarElement, + selectNextItem, + selectPreviousItem, + selectionController, + ]) const onNoteFilterTextChange: ChangeEventHandler = useCallback( (e) => { @@ -143,15 +195,15 @@ const ContentListView: FunctionComponent = ({ application, viewController const panelResizeFinishCallback: ResizeFinishCallback = useCallback( (width, _lastLeft, _isMaxWidth, isCollapsed) => { application.setPreference(PrefKey.NotesPanelWidth, width).catch(console.error) - viewControllerManager.noteTagsController.reloadTagsContainerMaxWidth() + noteTagsController.reloadTagsContainerMaxWidth() application.publishPanelDidResizeEvent(PANEL_NAME_NOTES, isCollapsed) }, - [viewControllerManager, application], + [application, noteTagsController], ) const panelWidthEventCallback = useCallback(() => { - viewControllerManager.noteTagsController.reloadTagsContainerMaxWidth() - }, [viewControllerManager]) + noteTagsController.reloadTagsContainerMaxWidth() + }, [noteTagsController]) const toggleDisplayOptionsMenu = useCallback(() => { setShowDisplayOptionsMenu(!showDisplayOptionsMenu) @@ -207,11 +259,14 @@ const ContentListView: FunctionComponent = ({ application, viewController {(focusedSearch || noteFilterText) && (
- +
)}
- +
@@ -234,10 +289,10 @@ const ContentListView: FunctionComponent = ({ application, viewController {showDisplayOptionsMenu && ( )} @@ -253,8 +308,12 @@ const ContentListView: FunctionComponent = ({ application, viewController items={renderedItems} selectedItems={selectedItems} application={application} - viewControllerManager={viewControllerManager} paginate={paginate} + filesController={filesController} + itemListController={itemListController} + navigationController={navigationController} + notesController={notesController} + selectionController={selectionController} /> ) : null}
diff --git a/packages/web/src/javascripts/Components/MultipleSelectedNotes/MultipleSelectedNotes.tsx b/packages/web/src/javascripts/Components/MultipleSelectedNotes/MultipleSelectedNotes.tsx index 7d3949034..9e1cc9bf3 100644 --- a/packages/web/src/javascripts/Components/MultipleSelectedNotes/MultipleSelectedNotes.tsx +++ b/packages/web/src/javascripts/Components/MultipleSelectedNotes/MultipleSelectedNotes.tsx @@ -13,6 +13,7 @@ import { NavigationController } from '@/Controllers/Navigation/NavigationControl import { NotesController } from '@/Controllers/NotesController' import { SelectedItemsController } from '@/Controllers/SelectedItemsController' import { NoteTagsController } from '@/Controllers/NoteTagsController' +import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalController' type Props = { application: WebApplication @@ -23,6 +24,7 @@ type Props = { notesController: NotesController noteTagsController: NoteTagsController selectionController: SelectedItemsController + historyModalController: HistoryModalController } const MultipleSelectedNotes = ({ @@ -34,6 +36,7 @@ const MultipleSelectedNotes = ({ notesController, noteTagsController, selectionController, + historyModalController, }: Props) => { const count = notesController.selectedNotesCount @@ -65,6 +68,7 @@ const MultipleSelectedNotes = ({ navigationController={navigationController} notesController={notesController} noteTagsController={noteTagsController} + historyModalController={historyModalController} />
diff --git a/packages/web/src/javascripts/Components/NoAccountWarning/NoAccountWarning.tsx b/packages/web/src/javascripts/Components/NoAccountWarning/NoAccountWarning.tsx index 1dbf56cfb..4d3788b92 100644 --- a/packages/web/src/javascripts/Components/NoAccountWarning/NoAccountWarning.tsx +++ b/packages/web/src/javascripts/Components/NoAccountWarning/NoAccountWarning.tsx @@ -1,49 +1,22 @@ -import Icon from '@/Components/Icon/Icon' -import { ViewControllerManager } from '@/Services/ViewControllerManager' +import { AccountMenuController } from '@/Controllers/AccountMenu/AccountMenuController' +import { NoAccountWarningController } from '@/Controllers/NoAccountWarningController' import { observer } from 'mobx-react-lite' -import { MouseEventHandler, useCallback } from 'react' +import NoAccountWarningContent from './NoAccountWarningContent' -type Props = { viewControllerManager: ViewControllerManager } - -const NoAccountWarning = observer(({ viewControllerManager }: Props) => { - const showAccountMenu: MouseEventHandler = useCallback( - (event) => { - event.stopPropagation() - viewControllerManager.accountMenuController.setShow(true) - }, - [viewControllerManager], - ) - - const hideWarning = useCallback(() => { - viewControllerManager.noAccountWarningController.hide() - }, [viewControllerManager]) - - return ( -
-

Data not backed up

-

Sign in or register to back up your notes.

- - -
- ) -}) - -NoAccountWarning.displayName = 'NoAccountWarning' - -const NoAccountWarningWrapper = ({ viewControllerManager }: Props) => { - const canShow = viewControllerManager.noAccountWarningController.show - - return canShow ? : null +type Props = { + accountMenuController: AccountMenuController + noAccountWarningController: NoAccountWarningController } -export default observer(NoAccountWarningWrapper) +const NoAccountWarning = ({ accountMenuController, noAccountWarningController }: Props) => { + const canShow = noAccountWarningController.show + + return canShow ? ( + + ) : null +} + +export default observer(NoAccountWarning) diff --git a/packages/web/src/javascripts/Components/NoAccountWarning/NoAccountWarningContent.tsx b/packages/web/src/javascripts/Components/NoAccountWarning/NoAccountWarningContent.tsx new file mode 100644 index 000000000..d8bbaef76 --- /dev/null +++ b/packages/web/src/javascripts/Components/NoAccountWarning/NoAccountWarningContent.tsx @@ -0,0 +1,45 @@ +import Icon from '@/Components/Icon/Icon' +import { AccountMenuController } from '@/Controllers/AccountMenu/AccountMenuController' +import { NoAccountWarningController } from '@/Controllers/NoAccountWarningController' +import { observer } from 'mobx-react-lite' +import { MouseEventHandler, useCallback } from 'react' + +type Props = { + accountMenuController: AccountMenuController + noAccountWarningController: NoAccountWarningController +} + +const NoAccountWarningContent = ({ accountMenuController, noAccountWarningController }: Props) => { + const showAccountMenu: MouseEventHandler = useCallback( + (event) => { + event.stopPropagation() + accountMenuController.setShow(true) + }, + [accountMenuController], + ) + + const hideWarning = useCallback(() => { + noAccountWarningController.hide() + }, [noAccountWarningController]) + + return ( +
+

Data not backed up

+

Sign in or register to back up your notes.

+ + +
+ ) +} + +export default observer(NoAccountWarningContent) diff --git a/packages/web/src/javascripts/Components/NoteGroupView/NoteGroupView.tsx b/packages/web/src/javascripts/Components/NoteGroupView/NoteGroupView.tsx index 3dae5a672..f8a1c7a3f 100644 --- a/packages/web/src/javascripts/Components/NoteGroupView/NoteGroupView.tsx +++ b/packages/web/src/javascripts/Components/NoteGroupView/NoteGroupView.tsx @@ -92,6 +92,7 @@ class NoteGroupView extends PureComponent { navigationController={this.viewControllerManager.navigationController} notesController={this.viewControllerManager.notesController} noteTagsController={this.viewControllerManager.noteTagsController} + historyModalController={this.viewControllerManager.historyModalController} /> )} diff --git a/packages/web/src/javascripts/Components/NoteView/NoteView.tsx b/packages/web/src/javascripts/Components/NoteView/NoteView.tsx index 746c7290d..50396185f 100644 --- a/packages/web/src/javascripts/Components/NoteView/NoteView.tsx +++ b/packages/web/src/javascripts/Components/NoteView/NoteView.tsx @@ -971,6 +971,7 @@ class NoteView extends PureComponent { navigationController={this.viewControllerManager.navigationController} notesController={this.viewControllerManager.notesController} noteTagsController={this.viewControllerManager.noteTagsController} + historyModalController={this.viewControllerManager.historyModalController} onClickPreprocessing={this.ensureNoteIsInsertedBeforeUIAction} /> @@ -1002,7 +1003,6 @@ class NoteView extends PureComponent { onLoad={this.onEditorComponentLoad} requestReload={this.editorComponentViewerRequestsReload} application={this.application} - viewControllerManager={this.viewControllerManager} /> )} @@ -1073,12 +1073,7 @@ class NoteView extends PureComponent { {this.state.stackComponentViewers.map((viewer) => { return (
- +
) })} diff --git a/packages/web/src/javascripts/Components/NotesContextMenu/NotesContextMenu.tsx b/packages/web/src/javascripts/Components/NotesContextMenu/NotesContextMenu.tsx index 6c63c08bc..1a0a70bb5 100644 --- a/packages/web/src/javascripts/Components/NotesContextMenu/NotesContextMenu.tsx +++ b/packages/web/src/javascripts/Components/NotesContextMenu/NotesContextMenu.tsx @@ -7,15 +7,23 @@ import { WebApplication } from '@/Application/Application' import { NotesController } from '@/Controllers/NotesController' import { NavigationController } from '@/Controllers/Navigation/NavigationController' import { NoteTagsController } from '@/Controllers/NoteTagsController' +import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalController' type Props = { application: WebApplication navigationController: NavigationController notesController: NotesController noteTagsController: NoteTagsController + historyModalController: HistoryModalController } -const NotesContextMenu = ({ application, navigationController, notesController, noteTagsController }: Props) => { +const NotesContextMenu = ({ + application, + navigationController, + notesController, + noteTagsController, + historyModalController, +}: Props) => { const { contextMenuOpen, contextMenuPosition, contextMenuMaxHeight } = notesController const contextMenuRef = useRef(null) @@ -49,6 +57,7 @@ const NotesContextMenu = ({ application, navigationController, notesController, navigationController={navigationController} notesController={notesController} noteTagsController={noteTagsController} + historyModalController={historyModalController} /> ) : null diff --git a/packages/web/src/javascripts/Components/NotesOptions/NotesOptions.tsx b/packages/web/src/javascripts/Components/NotesOptions/NotesOptions.tsx index dcebefe12..03b7eabb0 100644 --- a/packages/web/src/javascripts/Components/NotesOptions/NotesOptions.tsx +++ b/packages/web/src/javascripts/Components/NotesOptions/NotesOptions.tsx @@ -174,6 +174,7 @@ const NotesOptions = ({ navigationController, notesController, noteTagsController, + historyModalController, closeOnBlur, }: NotesOptionsProps) => { const [altKeyDown, setAltKeyDown] = useState(false) @@ -222,7 +223,7 @@ const NotesOptions = ({ const format = editor?.package_info?.file_type || 'txt' return `${note.title}.${format}` }, - [application], + [application.componentManager], ) const downloadSelectedItems = useCallback(async () => { @@ -239,7 +240,7 @@ const NotesOptions = ({ await application.getArchiveService().downloadDataAsZip( notes.map((note) => { return { - filename: getNoteFileName(note), + name: getNoteFileName(note), content: new Blob([note.text]), } }), @@ -259,8 +260,8 @@ const NotesOptions = ({ }, [application, notes]) const openRevisionHistoryModal = useCallback(() => { - notesController.setShowRevisionHistoryModal(true) - }, [notesController]) + historyModalController.openModal(notesController.firstSelectedNote) + }, [historyModalController, notesController.firstSelectedNote]) return ( <> diff --git a/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx b/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx index d90f2fadd..444664034 100644 --- a/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx +++ b/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsPanel.tsx @@ -10,12 +10,14 @@ import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { NotesController } from '@/Controllers/NotesController' import { NavigationController } from '@/Controllers/Navigation/NavigationController' import { NoteTagsController } from '@/Controllers/NoteTagsController' +import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalController' type Props = { application: WebApplication navigationController: NavigationController notesController: NotesController noteTagsController: NoteTagsController + historyModalController: HistoryModalController onClickPreprocessing?: () => Promise } @@ -24,6 +26,7 @@ const NotesOptionsPanel = ({ navigationController, notesController, noteTagsController, + historyModalController, onClickPreprocessing, }: Props) => { const [open, setOpen] = useState(false) @@ -95,6 +98,7 @@ const NotesOptionsPanel = ({ navigationController={navigationController} notesController={notesController} noteTagsController={noteTagsController} + historyModalController={historyModalController} closeOnBlur={closeOnBlur} /> )} diff --git a/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsProps.ts b/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsProps.ts index 665eaaf41..9c59d1509 100644 --- a/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsProps.ts +++ b/packages/web/src/javascripts/Components/NotesOptions/NotesOptionsProps.ts @@ -1,4 +1,5 @@ import { WebApplication } from '@/Application/Application' +import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalController' import { NavigationController } from '@/Controllers/Navigation/NavigationController' import { NotesController } from '@/Controllers/NotesController' import { NoteTagsController } from '@/Controllers/NoteTagsController' @@ -8,5 +9,6 @@ export type NotesOptionsProps = { navigationController: NavigationController notesController: NotesController noteTagsController: NoteTagsController + historyModalController: HistoryModalController closeOnBlur: (event: { relatedTarget: EventTarget | null }) => void } diff --git a/packages/web/src/javascripts/Components/RevisionHistoryModal/HistoryListContainer.tsx b/packages/web/src/javascripts/Components/RevisionHistoryModal/HistoryListContainer.tsx index 8076b362b..5e1dffb17 100644 --- a/packages/web/src/javascripts/Components/RevisionHistoryModal/HistoryListContainer.tsx +++ b/packages/web/src/javascripts/Components/RevisionHistoryModal/HistoryListContainer.tsx @@ -1,75 +1,24 @@ -import { WebApplication } from '@/Application/Application' -import { Action, ActionVerb, HistoryEntry, NoteHistoryEntry, RevisionListEntry, SNNote } from '@standardnotes/snjs' +import { NoteHistoryController } from '@/Controllers/NoteHistory/NoteHistoryController' +import { FeaturesClientInterface } from '@standardnotes/snjs' import { observer } from 'mobx-react-lite' -import { FunctionComponent, useCallback, useState, useEffect, SetStateAction, Dispatch } from 'react' +import { FunctionComponent } from 'react' import LegacyHistoryList from './LegacyHistoryList' import RemoteHistoryList from './RemoteHistoryList' +import { RevisionType } from './RevisionType' import SessionHistoryList from './SessionHistoryList' -import { LegacyHistoryEntry, RemoteRevisionListGroup, sortRevisionListIntoGroups } from './utils' - -export enum RevisionListTabType { - Session = 'Session', - Remote = 'Remote', - Legacy = 'Legacy', -} type Props = { - application: WebApplication - isFetchingRemoteHistory: boolean - note: SNNote - remoteHistory: RemoteRevisionListGroup[] | undefined - setIsFetchingSelectedRevision: Dispatch> - setSelectedRemoteEntry: Dispatch> - setSelectedRevision: Dispatch> - setShowContentLockedScreen: Dispatch> + features: FeaturesClientInterface + noteHistoryController: NoteHistoryController } -const HistoryListContainer: FunctionComponent = ({ - application, - isFetchingRemoteHistory, - note, - remoteHistory, - setIsFetchingSelectedRevision, - setSelectedRemoteEntry, - setSelectedRevision, - setShowContentLockedScreen, -}) => { - const sessionHistory = sortRevisionListIntoGroups( - application.historyManager.sessionHistoryForItem(note) as NoteHistoryEntry[], - ) - const [legacyHistory, setLegacyHistory] = useState() - - const [selectedTab, setSelectedTab] = useState(RevisionListTabType.Remote) - - useEffect(() => { - const fetchLegacyHistory = async () => { - const actionExtensions = application.actionsManager.getExtensions() - actionExtensions.forEach(async (ext) => { - const actionExtension = await application.actionsManager.loadExtensionInContextOfItem(ext, note) - - if (!actionExtension) { - return - } - - const isLegacyNoteHistoryExt = actionExtension?.actions.some((action) => action.verb === ActionVerb.Nested) - - if (!isLegacyNoteHistoryExt) { - return - } - - const legacyHistoryEntries = actionExtension.actions.filter((action) => action.subactions?.[0]) - - setLegacyHistory(legacyHistoryEntries) - }) - } - - fetchLegacyHistory().catch(console.error) - }, [application, note]) +const HistoryListContainer: FunctionComponent = ({ features, noteHistoryController }) => { + const { legacyHistory, currentTab, selectTab } = noteHistoryController const TabButton: FunctionComponent<{ - type: RevisionListTabType + type: RevisionType }> = ({ type }) => { - const isSelected = selectedTab === type + const isSelected = currentTab === type return ( + )} + - )} -