diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 18d7588..35086a0 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,17 +7,22 @@ on:
jobs:
release:
+ permissions:
+ contents: write
strategy:
fail-fast: false
matrix:
- platform: [macos-latest, ubuntu-latest, windows-latest]
+ platform: [macos-latest, windows-latest]
+ # platform: [macos-latest, ubuntu-latest, windows-latest]
include:
- - os: ubuntu-latest
- rust_target: x86_64-unknown-linux-gnu
+ # - os: ubuntu-latest
+ # rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
rust_target: x86_64-apple-darwin
+ args: --target x86_64-apple-darwin
- os: macos-latest
rust_target: aarch64-apple-darwin
+ args: --target aarch64-apple-darwin
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
@@ -28,13 +33,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- # for projects that use labels and PRs,
- # try https://github.com/mikepenz/release-changelog-builder-action instead
- # TODO: use API to collect commit messages
- - name: Build Changelog
- id: build_changelog
- run: echo "changelog=- ADD CHANGELOG" >> $GITHUB_OUTPUT
-
- name: Node.js setup
uses: actions/setup-node@v4
# NOTE: enterprise developers may hard code a version
@@ -42,9 +40,11 @@ jobs:
node-version: 18.20.4
# node-version-file: '.nvmrc'
- - name: Install Rust (Stable)
- run:
- curl https://sh.rustup.rs -sSf | sh -s -- -y
+ - name: install Rust stable
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
+ targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
@@ -56,6 +56,20 @@ jobs:
# NOTE: include yarn build if frontend has build script
run: npm install ci
+ - name: Setup certificate
+ if: matrix.platform == 'macos-latest'
+ run: |
+ echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12
+ security create-keychain -p "" build.keychain
+ security default-keychain -s build.keychain
+ security unlock-keychain -p "" build.keychain
+ security import certificate.p12 -k build.keychain -P "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign -A
+ security find-identity
+ security set-key-partition-list -S 'apple-tool:,apple:,codesign:' -s -k "" build.keychain
+ env:
+ MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
+ MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
+
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
@@ -67,7 +81,7 @@ jobs:
tagName: app-v__VERSION__
releaseName: Scribe v__VERSION__
releaseBody: |
- ${{steps.build_changelog.outputs.changelog}}
See the assets to download this version and install.
releaseDraft: true
- prerelease: false
\ No newline at end of file
+ prerelease: false
+ updaterJsonPreferNsis: true
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
index 87c2505..45f7054 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -20,4 +20,5 @@ Thumbs.db
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
-settings.toml
\ No newline at end of file
+settings.toml
+docs/
\ No newline at end of file
diff --git a/app/docs/readme.md b/app/docs/readme.md
new file mode 100644
index 0000000..89fc1ef
--- /dev/null
+++ b/app/docs/readme.md
@@ -0,0 +1 @@
+
Scribe v0.1.0 A Simple opensource note taking app perfect for quick notes or detailed plans, stay on top of your day and never lose track of your ideas again.
This markdown was created using scribe.
Quick notes Press Ctrl+Enter
, Cmd+Enter
on mac from anywhere to jot down notes without having to worry about where to save them. The app will automatically save the contents in a shortnotes.md
in the selected directory.
Settings All notes by default are saved in the installation path under a docs
folder.
You can modify the save path by clicking on File > Settings
.
Note: You must move the files manually to the new save directory.
Key features Built for speed with rust.
Close the app and take notes from anywhere.
Markdown shortcuts make it easy to format the text while typing.
To test that, start a new line and type #
followed by a space to get a heading. Try #
, ##
, ###
, ####
, #####
, ######
for different levels.
You can also try >
for blockquotes, *
, -
or +
for bullet lists, or `foobar`
to highlight code, ~~tildes~~
to strike text, or ==equal signs==
to highlight text, (c)
to see how it’s converted to a proper © character. You can also try ->
, >>
, 1/2
, !=
, or --
, **
for bold and _Italic_
for italic.
An inline toolbar is also available when you select text.
Roadmap
diff --git a/app/package-lock.json b/app/package-lock.json
index ad6c089..c94a3ca 100644
--- a/app/package-lock.json
+++ b/app/package-lock.json
@@ -18,9 +18,14 @@
"@tiptap/extension-placeholder": "^2.6.6",
"@tiptap/extension-subscript": "^2.6.6",
"@tiptap/extension-superscript": "^2.6.6",
+ "@tiptap/extension-table": "^2.7.2",
+ "@tiptap/extension-table-cell": "^2.7.2",
+ "@tiptap/extension-table-header": "^2.7.2",
+ "@tiptap/extension-table-row": "^2.7.2",
"@tiptap/extension-task-item": "^2.6.6",
"@tiptap/extension-task-list": "^2.6.6",
"@tiptap/extension-text-style": "^2.6.6",
+ "@tiptap/extension-typography": "^2.6.6",
"@tiptap/extension-underline": "^2.6.6",
"@tiptap/pm": "^2.6.6",
"@tiptap/starter-kit": "^2.6.6",
@@ -58,7 +63,7 @@
"tailwindcss": "^3.4.10",
"typescript": "^5.0.0",
"typescript-eslint": "^8.5.0",
- "vite": "^5.0.3"
+ "vite": "^5.4.6"
}
},
"node_modules/@alloc/quick-lru": {
@@ -713,14 +718,14 @@
}
},
"node_modules/@remirror/core-constants": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-2.0.2.tgz",
- "integrity": "sha512-dyHY+sMF0ihPus3O27ODd4+agdHMEmuRdyiZJ2CCWjPV5UFmn17ZbElvk6WOGVE4rdCJKZQCrPV2BcikOMLUGQ=="
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-3.0.0.tgz",
+ "integrity": "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg=="
},
"node_modules/@rollup/rollup-android-arm-eabi": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz",
- "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.22.4.tgz",
+ "integrity": "sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==",
"cpu": [
"arm"
],
@@ -731,9 +736,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz",
- "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.22.4.tgz",
+ "integrity": "sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==",
"cpu": [
"arm64"
],
@@ -744,9 +749,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz",
- "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.4.tgz",
+ "integrity": "sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==",
"cpu": [
"arm64"
],
@@ -757,9 +762,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz",
- "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.4.tgz",
+ "integrity": "sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==",
"cpu": [
"x64"
],
@@ -770,9 +775,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz",
- "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.22.4.tgz",
+ "integrity": "sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==",
"cpu": [
"arm"
],
@@ -783,9 +788,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz",
- "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.22.4.tgz",
+ "integrity": "sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==",
"cpu": [
"arm"
],
@@ -796,9 +801,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.2.tgz",
- "integrity": "sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.22.4.tgz",
+ "integrity": "sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==",
"cpu": [
"arm64"
],
@@ -809,9 +814,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.2.tgz",
- "integrity": "sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.22.4.tgz",
+ "integrity": "sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==",
"cpu": [
"arm64"
],
@@ -822,9 +827,9 @@
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.2.tgz",
- "integrity": "sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.22.4.tgz",
+ "integrity": "sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==",
"cpu": [
"ppc64"
],
@@ -835,9 +840,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.2.tgz",
- "integrity": "sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.22.4.tgz",
+ "integrity": "sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==",
"cpu": [
"riscv64"
],
@@ -848,9 +853,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.2.tgz",
- "integrity": "sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.22.4.tgz",
+ "integrity": "sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==",
"cpu": [
"s390x"
],
@@ -861,9 +866,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.2.tgz",
- "integrity": "sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.4.tgz",
+ "integrity": "sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==",
"cpu": [
"x64"
],
@@ -874,9 +879,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.2.tgz",
- "integrity": "sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.4.tgz",
+ "integrity": "sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==",
"cpu": [
"x64"
],
@@ -887,9 +892,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.2.tgz",
- "integrity": "sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.22.4.tgz",
+ "integrity": "sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==",
"cpu": [
"arm64"
],
@@ -900,9 +905,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.2.tgz",
- "integrity": "sha512-5rA4vjlqgrpbFVVHX3qkrCo/fZTj1q0Xxpg+Z7yIo3J2AilW7t2+n6Q8Jrx+4MrYpAnjttTYF8rr7bP46BPzRw==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.22.4.tgz",
+ "integrity": "sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==",
"cpu": [
"ia32"
],
@@ -913,9 +918,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.2.tgz",
- "integrity": "sha512-6UUxd0+SKomjdzuAcp+HAmxw1FlGBnl1v2yEPSabtx4lBfdXHDVsW7+lQkgz9cNFJGY3AWR7+V8P5BqkD9L9nA==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.22.4.tgz",
+ "integrity": "sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==",
"cpu": [
"x64"
],
@@ -1209,15 +1214,15 @@
}
},
"node_modules/@tiptap/core": {
- "version": "2.6.6",
- "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.6.6.tgz",
- "integrity": "sha512-VO5qTsjt6rwworkuo0s5AqYMfDA0ZwiTiH6FHKFSu2G/6sS7HKcc/LjPq+5Legzps4QYdBDl3W28wGsGuS1GdQ==",
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.7.2.tgz",
+ "integrity": "sha512-rGAH90LPMR5OIG7vuTDRw8WxDYxPXSxuGtu++mxPF+Bv7V2ijPOy3P1oyV1G3KGoS0pPiNugLh+tVLsElcx/9Q==",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
- "@tiptap/pm": "^2.6.6"
+ "@tiptap/pm": "^2.7.0"
}
},
"node_modules/@tiptap/extension-blockquote": {
@@ -1526,6 +1531,55 @@
"@tiptap/core": "^2.6.6"
}
},
+ "node_modules/@tiptap/extension-table": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/@tiptap/extension-table/-/extension-table-2.7.2.tgz",
+ "integrity": "sha512-FHNSh6k319p1OW+KZbn5yXp6YwlgfkpPz5eI4YbyXOKRYQw+mh/uDeBhlzaPUpoc0FRXdBGQWmGHj7KPpGJpAw==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/ueberdosis"
+ },
+ "peerDependencies": {
+ "@tiptap/core": "^2.7.0",
+ "@tiptap/pm": "^2.7.0"
+ }
+ },
+ "node_modules/@tiptap/extension-table-cell": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/@tiptap/extension-table-cell/-/extension-table-cell-2.7.2.tgz",
+ "integrity": "sha512-I2H9FtqGxYvym6eUX+x94sDXpczDhhhjertdH64cf6HDbUGm0FQloE0XdA0f6VaL4I8qaSpnybd04R8nztTe5g==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/ueberdosis"
+ },
+ "peerDependencies": {
+ "@tiptap/core": "^2.7.0"
+ }
+ },
+ "node_modules/@tiptap/extension-table-header": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/@tiptap/extension-table-header/-/extension-table-header-2.7.2.tgz",
+ "integrity": "sha512-e076DPR1mZelfkyl0bWrgHsOvA0QQ7VJpgVld7vVBN8KzK1NNCyg7gp+5uKh84UEfsCyQIZ6IM8X8RljbM1bCg==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/ueberdosis"
+ },
+ "peerDependencies": {
+ "@tiptap/core": "^2.7.0"
+ }
+ },
+ "node_modules/@tiptap/extension-table-row": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/@tiptap/extension-table-row/-/extension-table-row-2.7.2.tgz",
+ "integrity": "sha512-O2RA0R8TA9ejoxCpOIWqIvklGzjv8f5VhBBbfYMgAM9tgD4jsNCHsKBwZuy0V5eEu3gnwyKXHEpWLyG08tJuFA==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/ueberdosis"
+ },
+ "peerDependencies": {
+ "@tiptap/core": "^2.7.0"
+ }
+ },
"node_modules/@tiptap/extension-task-item": {
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.6.6.tgz",
@@ -1575,6 +1629,19 @@
"@tiptap/core": "^2.6.6"
}
},
+ "node_modules/@tiptap/extension-typography": {
+ "version": "2.6.6",
+ "resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.6.6.tgz",
+ "integrity": "sha512-0niSddtPOY7CjKGmxOBQ34VqLGxTeOfN+zICL5CLmS8B815qb1G1csXhUyHJ1wT7q8xMCAhXnGCt8b8ilmj/sg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/ueberdosis"
+ },
+ "peerDependencies": {
+ "@tiptap/core": "^2.6.6"
+ }
+ },
"node_modules/@tiptap/extension-underline": {
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.6.6.tgz",
@@ -1588,13 +1655,13 @@
}
},
"node_modules/@tiptap/pm": {
- "version": "2.6.6",
- "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-2.6.6.tgz",
- "integrity": "sha512-56FGLPn3fwwUlIbLs+BO21bYfyqP9fKyZQbQyY0zWwA/AG2kOwoXaRn7FOVbjP6CylyWpFJnpRRmgn694QKHEg==",
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-2.7.2.tgz",
+ "integrity": "sha512-RiRPlwpuE6IHDJytE0tglbFlWELOaqeyGRGv25wBTjzV1plnqC5B3U65XY/8kKuuLjdd3NpRfR68DXBafusSBg==",
"dependencies": {
"prosemirror-changeset": "^2.2.1",
"prosemirror-collab": "^1.3.1",
- "prosemirror-commands": "^1.5.2",
+ "prosemirror-commands": "^1.6.0",
"prosemirror-dropcursor": "^1.8.1",
"prosemirror-gapcursor": "^1.3.2",
"prosemirror-history": "^1.4.1",
@@ -1602,14 +1669,14 @@
"prosemirror-keymap": "^1.2.2",
"prosemirror-markdown": "^1.13.0",
"prosemirror-menu": "^1.2.4",
- "prosemirror-model": "^1.22.2",
+ "prosemirror-model": "^1.22.3",
"prosemirror-schema-basic": "^1.2.3",
"prosemirror-schema-list": "^1.4.1",
"prosemirror-state": "^1.4.3",
"prosemirror-tables": "^1.4.0",
- "prosemirror-trailing-node": "^2.0.9",
- "prosemirror-transform": "^1.9.0",
- "prosemirror-view": "^1.33.9"
+ "prosemirror-trailing-node": "^3.0.0",
+ "prosemirror-transform": "^1.10.0",
+ "prosemirror-view": "^1.33.10"
},
"funding": {
"type": "github",
@@ -4222,11 +4289,11 @@
}
},
"node_modules/prosemirror-trailing-node": {
- "version": "2.0.9",
- "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-2.0.9.tgz",
- "integrity": "sha512-YvyIn3/UaLFlFKrlJB6cObvUhmwFNZVhy1Q8OpW/avoTbD/Y7H5EcjK4AZFKhmuS6/N6WkGgt7gWtBWDnmFvHg==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-3.0.0.tgz",
+ "integrity": "sha512-xiun5/3q0w5eRnGYfNlW1uU9W6x5MoFKWwq/0TIRgt09lv7Hcser2QYV8t4muXbEr+Fwo0geYn79Xs4GKywrRQ==",
"dependencies": {
- "@remirror/core-constants": "^2.0.2",
+ "@remirror/core-constants": "3.0.0",
"escape-string-regexp": "^4.0.0"
},
"peerDependencies": {
@@ -4397,9 +4464,9 @@
}
},
"node_modules/rollup": {
- "version": "4.21.2",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz",
- "integrity": "sha512-e3TapAgYf9xjdLvKQCkQTnbTKd4a6jwlpQSJJFokHGaX2IVjoEqkIIhiQfqsi0cdwlOD+tQGuOd5AJkc5RngBw==",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.22.4.tgz",
+ "integrity": "sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==",
"dev": true,
"dependencies": {
"@types/estree": "1.0.5"
@@ -4412,22 +4479,22 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.21.2",
- "@rollup/rollup-android-arm64": "4.21.2",
- "@rollup/rollup-darwin-arm64": "4.21.2",
- "@rollup/rollup-darwin-x64": "4.21.2",
- "@rollup/rollup-linux-arm-gnueabihf": "4.21.2",
- "@rollup/rollup-linux-arm-musleabihf": "4.21.2",
- "@rollup/rollup-linux-arm64-gnu": "4.21.2",
- "@rollup/rollup-linux-arm64-musl": "4.21.2",
- "@rollup/rollup-linux-powerpc64le-gnu": "4.21.2",
- "@rollup/rollup-linux-riscv64-gnu": "4.21.2",
- "@rollup/rollup-linux-s390x-gnu": "4.21.2",
- "@rollup/rollup-linux-x64-gnu": "4.21.2",
- "@rollup/rollup-linux-x64-musl": "4.21.2",
- "@rollup/rollup-win32-arm64-msvc": "4.21.2",
- "@rollup/rollup-win32-ia32-msvc": "4.21.2",
- "@rollup/rollup-win32-x64-msvc": "4.21.2",
+ "@rollup/rollup-android-arm-eabi": "4.22.4",
+ "@rollup/rollup-android-arm64": "4.22.4",
+ "@rollup/rollup-darwin-arm64": "4.22.4",
+ "@rollup/rollup-darwin-x64": "4.22.4",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.22.4",
+ "@rollup/rollup-linux-arm-musleabihf": "4.22.4",
+ "@rollup/rollup-linux-arm64-gnu": "4.22.4",
+ "@rollup/rollup-linux-arm64-musl": "4.22.4",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.22.4",
+ "@rollup/rollup-linux-riscv64-gnu": "4.22.4",
+ "@rollup/rollup-linux-s390x-gnu": "4.22.4",
+ "@rollup/rollup-linux-x64-gnu": "4.22.4",
+ "@rollup/rollup-linux-x64-musl": "4.22.4",
+ "@rollup/rollup-win32-arm64-msvc": "4.22.4",
+ "@rollup/rollup-win32-ia32-msvc": "4.22.4",
+ "@rollup/rollup-win32-x64-msvc": "4.22.4",
"fsevents": "~2.3.2"
}
},
@@ -5114,10 +5181,11 @@
"dev": true
},
"node_modules/vite": {
- "version": "5.4.3",
- "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.3.tgz",
- "integrity": "sha512-IH+nl64eq9lJjFqU+/yrRnrHPVTlgy42/+IzbOdaFDVlyLgI/wDlf+FCobXLX1cT0X5+7LMyH1mIy2xJdLfo8Q==",
+ "version": "5.4.6",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.6.tgz",
+ "integrity": "sha512-IeL5f8OO5nylsgzd9tq4qD2QqI0k2CQLGrWD0rCN0EQJZpBK5vJAx0I+GDkMOXxQX/OfFHMuLIx6ddAxGX/k+Q==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"esbuild": "^0.21.3",
"postcss": "^8.4.43",
diff --git a/app/package.json b/app/package.json
index 0de44b5..2840884 100644
--- a/app/package.json
+++ b/app/package.json
@@ -1,7 +1,10 @@
{
"name": "noteapp",
- "version": "0.0.1",
+ "version": "0.4.2",
"type": "module",
+ "engines": {
+ "node": ">=18"
+ },
"scripts": {
"dev": "vite dev",
"build": "vite build",
@@ -39,7 +42,7 @@
"tailwindcss": "^3.4.10",
"typescript": "^5.0.0",
"typescript-eslint": "^8.5.0",
- "vite": "^5.0.3"
+ "vite": "^5.4.6"
},
"dependencies": {
"@tauri-apps/api": "^1.6.0",
@@ -52,9 +55,14 @@
"@tiptap/extension-placeholder": "^2.6.6",
"@tiptap/extension-subscript": "^2.6.6",
"@tiptap/extension-superscript": "^2.6.6",
+ "@tiptap/extension-table": "^2.7.2",
+ "@tiptap/extension-table-cell": "^2.7.2",
+ "@tiptap/extension-table-header": "^2.7.2",
+ "@tiptap/extension-table-row": "^2.7.2",
"@tiptap/extension-task-item": "^2.6.6",
"@tiptap/extension-task-list": "^2.6.6",
"@tiptap/extension-text-style": "^2.6.6",
+ "@tiptap/extension-typography": "^2.6.6",
"@tiptap/extension-underline": "^2.6.6",
"@tiptap/pm": "^2.6.6",
"@tiptap/starter-kit": "^2.6.6",
diff --git a/app/src-tauri/Cargo.lock b/app/src-tauri/Cargo.lock
index 820da6e..1f2666f 100644
--- a/app/src-tauri/Cargo.lock
+++ b/app/src-tauri/Cargo.lock
@@ -212,6 +212,9 @@ name = "bytes"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"
+dependencies = [
+ "serde",
+]
[[package]]
name = "cairo-rs"
@@ -319,8 +322,8 @@ checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a"
dependencies = [
"bitflags 1.3.2",
"block",
- "cocoa-foundation",
- "core-foundation",
+ "cocoa-foundation 0.1.2",
+ "core-foundation 0.9.4",
"core-graphics 0.22.3",
"foreign-types 0.3.2",
"libc",
@@ -335,14 +338,30 @@ checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c"
dependencies = [
"bitflags 1.3.2",
"block",
- "cocoa-foundation",
- "core-foundation",
+ "cocoa-foundation 0.1.2",
+ "core-foundation 0.9.4",
"core-graphics 0.23.2",
"foreign-types 0.5.0",
"libc",
"objc",
]
+[[package]]
+name = "cocoa"
+version = "0.26.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f79398230a6e2c08f5c9760610eb6924b52aa9e7950a619602baba59dcbbdbb2"
+dependencies = [
+ "bitflags 2.6.0",
+ "block",
+ "cocoa-foundation 0.2.0",
+ "core-foundation 0.10.0",
+ "core-graphics 0.24.0",
+ "foreign-types 0.5.0",
+ "libc",
+ "objc",
+]
+
[[package]]
name = "cocoa-foundation"
version = "0.1.2"
@@ -351,8 +370,22 @@ checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7"
dependencies = [
"bitflags 1.3.2",
"block",
- "core-foundation",
- "core-graphics-types",
+ "core-foundation 0.9.4",
+ "core-graphics-types 0.1.3",
+ "libc",
+ "objc",
+]
+
+[[package]]
+name = "cocoa-foundation"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e14045fb83be07b5acf1c0884b2180461635b433455fa35d1cd6f17f1450679d"
+dependencies = [
+ "bitflags 2.6.0",
+ "block",
+ "core-foundation 0.10.0",
+ "core-graphics-types 0.2.0",
"libc",
"objc",
]
@@ -389,6 +422,16 @@ dependencies = [
"libc",
]
+[[package]]
+name = "core-foundation"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
@@ -402,8 +445,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"
dependencies = [
"bitflags 1.3.2",
- "core-foundation",
- "core-graphics-types",
+ "core-foundation 0.9.4",
+ "core-graphics-types 0.1.3",
"foreign-types 0.3.2",
"libc",
]
@@ -415,8 +458,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"
dependencies = [
"bitflags 1.3.2",
- "core-foundation",
- "core-graphics-types",
+ "core-foundation 0.9.4",
+ "core-graphics-types 0.1.3",
+ "foreign-types 0.5.0",
+ "libc",
+]
+
+[[package]]
+name = "core-graphics"
+version = "0.24.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"
+dependencies = [
+ "bitflags 2.6.0",
+ "core-foundation 0.10.0",
+ "core-graphics-types 0.2.0",
"foreign-types 0.5.0",
"libc",
]
@@ -428,7 +484,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"
dependencies = [
"bitflags 1.3.2",
- "core-foundation",
+ "core-foundation 0.9.4",
+ "libc",
+]
+
+[[package]]
+name = "core-graphics-types"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
+dependencies = [
+ "bitflags 2.6.0",
+ "core-foundation 0.10.0",
"libc",
]
@@ -599,6 +666,15 @@ dependencies = [
"crypto-common",
]
+[[package]]
+name = "dirs"
+version = "5.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225"
+dependencies = [
+ "dirs-sys",
+]
+
[[package]]
name = "dirs-next"
version = "2.0.0"
@@ -609,6 +685,18 @@ dependencies = [
"dirs-sys-next",
]
+[[package]]
+name = "dirs-sys"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"
+dependencies = [
+ "libc",
+ "option-ext",
+ "redox_users",
+ "windows-sys 0.48.0",
+]
+
[[package]]
name = "dirs-sys-next"
version = "0.1.2"
@@ -658,7 +746,7 @@ dependencies = [
"rustc_version",
"toml 0.8.19",
"vswhom",
- "winreg",
+ "winreg 0.52.0",
]
[[package]]
@@ -858,6 +946,12 @@ dependencies = [
"syn 2.0.77",
]
+[[package]]
+name = "futures-sink"
+version = "0.3.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
+
[[package]]
name = "futures-task"
version = "0.3.30"
@@ -871,8 +965,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-core",
+ "futures-io",
"futures-macro",
+ "futures-sink",
"futures-task",
+ "memchr",
"pin-project-lite",
"pin-utils",
"slab",
@@ -1184,6 +1281,25 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "h2"
+version = "0.3.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
+dependencies = [
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "futures-util",
+ "http",
+ "indexmap 2.5.0",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
[[package]]
name = "hashbrown"
version = "0.12.3"
@@ -1254,12 +1370,72 @@ dependencies = [
"itoa 1.0.11",
]
+[[package]]
+name = "http-body"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
+dependencies = [
+ "bytes",
+ "http",
+ "pin-project-lite",
+]
+
[[package]]
name = "http-range"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573"
+[[package]]
+name = "httparse"
+version = "1.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9"
+
+[[package]]
+name = "httpdate"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
+
+[[package]]
+name = "hyper"
+version = "0.14.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9"
+dependencies = [
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "httparse",
+ "httpdate",
+ "itoa 1.0.11",
+ "pin-project-lite",
+ "socket2",
+ "tokio",
+ "tower-service",
+ "tracing",
+ "want",
+]
+
+[[package]]
+name = "hyper-tls"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
+dependencies = [
+ "bytes",
+ "hyper",
+ "native-tls",
+ "tokio",
+ "tokio-native-tls",
+]
+
[[package]]
name = "iana-time-zone"
version = "0.1.60"
@@ -1377,6 +1553,12 @@ dependencies = [
"cfg-if",
]
+[[package]]
+name = "ipnet"
+version = "2.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4"
+
[[package]]
name = "itoa"
version = "0.4.8"
@@ -1630,6 +1812,18 @@ dependencies = [
"autocfg",
]
+[[package]]
+name = "mime"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+
+[[package]]
+name = "minisign-verify"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20"
+
[[package]]
name = "miniz_oxide"
version = "0.7.4"
@@ -1661,6 +1855,23 @@ dependencies = [
"windows-sys 0.52.0",
]
+[[package]]
+name = "native-tls"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466"
+dependencies = [
+ "libc",
+ "log",
+ "openssl",
+ "openssl-probe",
+ "openssl-sys",
+ "schannel",
+ "security-framework",
+ "security-framework-sys",
+ "tempfile",
+]
+
[[package]]
name = "ndk"
version = "0.6.0"
@@ -1705,6 +1916,8 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
name = "noteapp_lib"
version = "0.1.0"
dependencies = [
+ "dirs",
+ "ignore",
"serde",
"thiserror",
"tokio",
@@ -1811,6 +2024,56 @@ version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
+[[package]]
+name = "openssl"
+version = "0.10.66"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1"
+dependencies = [
+ "bitflags 2.6.0",
+ "cfg-if",
+ "foreign-types 0.3.2",
+ "libc",
+ "once_cell",
+ "openssl-macros",
+ "openssl-sys",
+]
+
+[[package]]
+name = "openssl-macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.77",
+]
+
+[[package]]
+name = "openssl-probe"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
+
+[[package]]
+name = "openssl-sys"
+version = "0.9.103"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
+dependencies = [
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "option-ext"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
+
[[package]]
name = "os_info"
version = "3.8.2"
@@ -2299,6 +2562,48 @@ version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
+[[package]]
+name = "reqwest"
+version = "0.11.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
+dependencies = [
+ "base64 0.21.7",
+ "bytes",
+ "encoding_rs",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "hyper",
+ "hyper-tls",
+ "ipnet",
+ "js-sys",
+ "log",
+ "mime",
+ "native-tls",
+ "once_cell",
+ "percent-encoding",
+ "pin-project-lite",
+ "rustls-pemfile",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "sync_wrapper",
+ "system-configuration",
+ "tokio",
+ "tokio-native-tls",
+ "tokio-util",
+ "tower-service",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wasm-streams",
+ "web-sys",
+ "winreg 0.50.0",
+]
+
[[package]]
name = "rfd"
version = "0.10.0"
@@ -2351,6 +2656,15 @@ dependencies = [
"windows-sys 0.52.0",
]
+[[package]]
+name = "rustls-pemfile"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
+dependencies = [
+ "base64 0.21.7",
+]
+
[[package]]
name = "rustversion"
version = "1.0.17"
@@ -2372,6 +2686,15 @@ dependencies = [
"winapi-util",
]
+[[package]]
+name = "schannel"
+version = "0.1.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b"
+dependencies = [
+ "windows-sys 0.59.0",
+]
+
[[package]]
name = "scoped-tls"
version = "1.0.1"
@@ -2386,16 +2709,42 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "scribe"
-version = "0.1.0"
+version = "0.4.2"
dependencies = [
+ "cocoa 0.26.0",
+ "core-graphics 0.24.0",
"noteapp_lib",
"serde",
"serde_json",
"tauri",
"tauri-build",
+ "winapi",
"window-shadows",
]
+[[package]]
+name = "security-framework"
+version = "2.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
+dependencies = [
+ "bitflags 2.6.0",
+ "core-foundation 0.9.4",
+ "core-foundation-sys",
+ "libc",
+ "security-framework-sys",
+]
+
+[[package]]
+name = "security-framework-sys"
+version = "2.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
[[package]]
name = "selectors"
version = "0.22.0"
@@ -2478,6 +2827,18 @@ dependencies = [
"serde",
]
+[[package]]
+name = "serde_urlencoded"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
+dependencies = [
+ "form_urlencoded",
+ "itoa 1.0.11",
+ "ryu",
+ "serde",
+]
+
[[package]]
name = "serde_with"
version = "3.9.0"
@@ -2709,6 +3070,12 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "sync_wrapper"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
+
[[package]]
name = "sys-locale"
version = "0.3.1"
@@ -2718,6 +3085,27 @@ dependencies = [
"libc",
]
+[[package]]
+name = "system-configuration"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
+dependencies = [
+ "bitflags 1.3.2",
+ "core-foundation 0.9.4",
+ "system-configuration-sys",
+]
+
+[[package]]
+name = "system-configuration-sys"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
[[package]]
name = "system-deps"
version = "5.0.0"
@@ -2754,7 +3142,7 @@ dependencies = [
"cairo-rs",
"cc",
"cocoa 0.24.1",
- "core-foundation",
+ "core-foundation 0.9.4",
"core-graphics 0.22.3",
"crossbeam-channel",
"dirs-next",
@@ -2828,6 +3216,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e33e3ba00a3b05eb6c57ef135781717d33728b48acf914bb05629e74d897d29"
dependencies = [
"anyhow",
+ "base64 0.22.1",
+ "bytes",
"cocoa 0.24.1",
"dirs-next",
"dunce",
@@ -2842,12 +3232,15 @@ dependencies = [
"heck 0.5.0",
"http",
"ignore",
+ "indexmap 1.9.3",
+ "minisign-verify",
"objc",
"once_cell",
"os_info",
"percent-encoding",
"rand 0.8.5",
"raw-window-handle",
+ "reqwest",
"rfd",
"semver",
"serde",
@@ -2863,12 +3256,14 @@ dependencies = [
"tauri-utils",
"tempfile",
"thiserror",
+ "time",
"tokio",
"url",
"uuid",
"webkit2gtk",
"webview2-com",
"windows 0.39.0",
+ "zip",
]
[[package]]
@@ -3145,6 +3540,29 @@ dependencies = [
"syn 2.0.77",
]
+[[package]]
+name = "tokio-native-tls"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
+dependencies = [
+ "native-tls",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-util"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "futures-sink",
+ "pin-project-lite",
+ "tokio",
+]
+
[[package]]
name = "toml"
version = "0.5.11"
@@ -3213,6 +3631,12 @@ dependencies = [
"winnow 0.6.18",
]
+[[package]]
+name = "tower-service"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
+
[[package]]
name = "tracing"
version = "0.1.40"
@@ -3274,6 +3698,12 @@ dependencies = [
"tracing-log",
]
+[[package]]
+name = "try-lock"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+
[[package]]
name = "typenum"
version = "1.17.0"
@@ -3340,6 +3770,12 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
[[package]]
name = "version-compare"
version = "0.0.11"
@@ -3388,6 +3824,15 @@ dependencies = [
"winapi-util",
]
+[[package]]
+name = "want"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
+dependencies = [
+ "try-lock",
+]
+
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
@@ -3467,6 +3912,19 @@ version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
+[[package]]
+name = "wasm-streams"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129"
+dependencies = [
+ "futures-util",
+ "js-sys",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+]
+
[[package]]
name = "web-sys"
version = "0.3.70"
@@ -3917,6 +4375,16 @@ dependencies = [
"memchr",
]
+[[package]]
+name = "winreg"
+version = "0.50.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
+dependencies = [
+ "cfg-if",
+ "windows-sys 0.48.0",
+]
+
[[package]]
name = "winreg"
version = "0.52.0"
@@ -4017,3 +4485,14 @@ dependencies = [
"quote",
"syn 2.0.77",
]
+
+[[package]]
+name = "zip"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
+dependencies = [
+ "byteorder",
+ "crc32fast",
+ "crossbeam-utils",
+]
diff --git a/app/src-tauri/Cargo.toml b/app/src-tauri/Cargo.toml
index 290591a..91edc92 100644
--- a/app/src-tauri/Cargo.toml
+++ b/app/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "scribe"
-version = "0.1.0"
+version = "0.4.2"
description = "A note taking app with seamless user experience"
authors = ["HoaX7"]
license = ""
@@ -17,10 +17,17 @@ tauri-build = { version = "1.5.4", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
-tauri = { version = "1.7.2", features = [ "dialog-open", "path-all", "window-close", "global-shortcut", "global-shortcut-all", "os-all", "window-unmaximize", "system-tray", "window-maximize", "window-minimize", "window-start-dragging", "window-hide"] }
+tauri = { version = "1.7.2", features = [ "dialog-confirm", "updater", "dialog-open", "path-all", "window-close", "global-shortcut", "global-shortcut-all", "os-all", "window-unmaximize", "system-tray", "window-maximize", "window-minimize", "window-start-dragging", "window-hide"] }
window-shadows = "0.2.2"
noteapp_lib = { path = "../../backend/noteapp_lib" }
+[target.'cfg(macos)'.dependencies]
+cocoa = "0.26.0"
+core-graphics = "0.24.0"
+
+[target.'cfg(windows)'.dependencies]
+winapi = { version = "0.3.9", features = ["winuser", "dwmapi"] }
+
[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
diff --git a/app/src-tauri/docs/readme.md b/app/src-tauri/docs/readme.md
new file mode 100644
index 0000000..86f55b9
--- /dev/null
+++ b/app/src-tauri/docs/readme.md
@@ -0,0 +1 @@
+Scribe A Simple opensource note taking app perfect for quick notes or detailed plans, stay on top of your day and never lose track of your ideas again.
This markdown was created using scribe.
Quick notes Press Ctrl+Enter
, Cmd+Enter
on MacOs from anywhere to jot down notes without having to worry about where to save them. The app will automatically save the contents in a quicknotes.md
in the selected directory.
The Quick Note window will not open if the foreground window is on full screen mode on windows.
Settings Note: You must move the files manually to the new save directory.
All your settings are saved in a settings.toml
file.
Windows All notes by default are saved in the installation path under a docs
folder.
You can modify the save path by clicking on File > Settings
.
Macos All notes by default are saved under $HOME_DIR/scribe/docs
. To modify the save path click on the icon in the menu bar > Settings
.
Key features Built for speed with rust.
Close the app and take notes from anywhere.
Markdown shortcuts make it easy to format the text while typing.
To test that, start a new line and type #
followed by a space to get a heading. Try #
, ##
, ###
, ####
, #####
, ######
for different levels.
You can also try >
for blockquotes, *
, -
or +
for bullet lists, or `foobar`
to highlight code, ~~tildes~~
to strike text, or ==equal signs==
to highlight text, (c)
to see how it’s converted to a proper © character. You can also try ->
, >>
, 1/2
, !=
, or --
, **
for bold and _Italic_
for italic.
An inline toolbar is also available when you select text.
To refresh the app press F5
.
Roadmap
diff --git a/app/src-tauri/src/commands.rs b/app/src-tauri/src/commands.rs
index 84cb49c..993f3b3 100644
--- a/app/src-tauri/src/commands.rs
+++ b/app/src-tauri/src/commands.rs
@@ -1,3 +1,5 @@
+use std::path::PathBuf;
+
use noteapp_lib::{app_settings, storage::StorageType};
use crate::{controller::*, shortcuts};
@@ -35,7 +37,7 @@ pub async fn rename_file(cur_name: &str, new_name: &str) -> Result<(), Controlle
#[tauri::command]
pub async fn open_shortnote_window(app: tauri::AppHandle) {
- shortcuts::make_shortnotes_window(&app);
+ shortcuts::make_quicknote_window(&app);
}
#[tauri::command]
@@ -56,3 +58,8 @@ pub async fn save_settings(new_settings: app_settings::AppSettings) -> Result<()
}
Ok(())
}
+
+#[tauri::command]
+pub fn search_contents(query: &str) -> Result, ()> {
+ StorageType::Disk.search_strategy(query)
+}
diff --git a/app/src-tauri/src/controller.rs b/app/src-tauri/src/controller.rs
index f9ff615..421c256 100644
--- a/app/src-tauri/src/controller.rs
+++ b/app/src-tauri/src/controller.rs
@@ -1,3 +1,5 @@
+use std::io::ErrorKind;
+
use noteapp_lib::{app_settings::load_config, errors::AppError, storage::StorageType};
use serde::{Deserialize, Serialize};
@@ -29,6 +31,7 @@ impl ControllerError {
impl ControllerError {
const INVALID_SETTINGS: &str = "IV_S";
const IO: &str = "IO_E";
+ const IO_NOTFOUND: &str = "IO_NF";
}
impl From for ControllerError {
@@ -41,6 +44,10 @@ impl From for ControllerError {
}
impl From for ControllerError {
fn from(value: std::io::Error) -> Self {
- ControllerError::new(value.to_string(), ControllerError::IO, 500)
+ if value.kind() == ErrorKind::NotFound {
+ ControllerError::new(value.to_string(), ControllerError::IO_NOTFOUND, 404)
+ } else {
+ ControllerError::new(value.to_string(), ControllerError::IO, 500)
+ }
}
}
diff --git a/app/src-tauri/src/main.rs b/app/src-tauri/src/main.rs
index 81daa8d..1e74229 100644
--- a/app/src-tauri/src/main.rs
+++ b/app/src-tauri/src/main.rs
@@ -14,7 +14,22 @@ fn main() {
tauri::Builder::default()
.system_tray(make_tray())
.setup(|app| {
+ #[cfg(target_os = "macos")]
+ app.set_activation_policy(tauri::ActivationPolicy::Accessory);
+
let window = app.get_window("main").unwrap();
+ #[cfg(target_os = "macos")]
+ {
+ let cloned_window = window.clone();
+ window.on_window_event(move |event| match event {
+ tauri::WindowEvent::CloseRequested { api, .. } => {
+ cloned_window.hide().unwrap();
+ api.prevent_close();
+ }
+ _ => {}
+ });
+ }
+
set_shadow(&window, true).expect("window shadow unsupported for this platform");
shortcuts::register_shortcuts(app);
Ok(())
@@ -28,7 +43,8 @@ fn main() {
delete_file,
open_shortnote_window,
get_settings,
- save_settings
+ save_settings,
+ search_contents
])
.run(tauri::generate_context!())
.expect("error running application");
diff --git a/app/src-tauri/src/shortcuts/disable_quicknote/macos.rs b/app/src-tauri/src/shortcuts/disable_quicknote/macos.rs
new file mode 100644
index 0000000..844edb0
--- /dev/null
+++ b/app/src-tauri/src/shortcuts/disable_quicknote/macos.rs
@@ -0,0 +1,18 @@
+// use cocoa::appkit::{NSApp, NSWindow};
+// use cocoa::base::{id, nil};
+
+// TODO
+pub fn deny_quicknote() -> bool {
+ false
+}
+
+// fn get_foreground_window() {
+ // unsafe {
+ // let app: id = NSApp();
+ // let key_window = app.();
+ // if key_window == nil {
+ // return None;
+ // }
+ // Some(key_window)
+ // }
+// }
diff --git a/app/src-tauri/src/shortcuts/disable_quicknote/mod.rs b/app/src-tauri/src/shortcuts/disable_quicknote/mod.rs
new file mode 100644
index 0000000..cbc7f49
--- /dev/null
+++ b/app/src-tauri/src/shortcuts/disable_quicknote/mod.rs
@@ -0,0 +1,16 @@
+#[cfg(target_os = "windows")]
+mod windows;
+#[cfg(target_os = "macos")]
+mod macos;
+
+pub fn deny_quicknote() -> bool {
+ #[cfg(target_os = "windows")]
+ {
+ windows::deny_quicknote()
+ }
+
+ #[cfg(target_os = "macos")]
+ {
+ macos::deny_quicknote()
+ }
+}
diff --git a/app/src-tauri/src/shortcuts/disable_quicknote/windows.rs b/app/src-tauri/src/shortcuts/disable_quicknote/windows.rs
new file mode 100644
index 0000000..4470028
--- /dev/null
+++ b/app/src-tauri/src/shortcuts/disable_quicknote/windows.rs
@@ -0,0 +1,49 @@
+use winapi::um::winuser::{GetForegroundWindow, GetWindowRect, GetSystemMetrics, SM_CXSCREEN, SM_CYSCREEN};
+use winapi::shared::windef::{RECT, HWND__};
+use winapi::um::dwmapi::DwmGetWindowAttribute;
+use winapi::um::dwmapi::DWMWA_EXTENDED_FRAME_BOUNDS;
+
+pub fn deny_quicknote() -> bool {
+ unsafe {
+ let hwnd = GetForegroundWindow();
+ if hwnd.is_null() {
+ return false;
+ }
+ is_fullscreen(hwnd)
+ // TODO - allow users to add a list of window names to disable quicknote
+ }
+}
+
+fn is_fullscreen(hwnd: *mut HWND__) -> bool {
+ unsafe {
+ // Get the screen resolution
+ let screen_width = GetSystemMetrics(SM_CXSCREEN);
+ let screen_height = GetSystemMetrics(SM_CYSCREEN);
+
+ // Get the window rectangle
+ let mut rect: RECT = std::mem::zeroed();
+ if GetWindowRect(hwnd, &mut rect) == 0 {
+ return false;
+ }
+
+ // Compare window dimensions to screen size
+ let window_width = rect.right - rect.left;
+ let window_height = rect.bottom - rect.top;
+
+ if window_width == screen_width && window_height == screen_height {
+ // Further check if the window has no decorations (i.e., it's borderless)
+ let mut frame_rect: RECT = std::mem::zeroed();
+ if DwmGetWindowAttribute(
+ hwnd,
+ DWMWA_EXTENDED_FRAME_BOUNDS,
+ &mut frame_rect as *mut RECT as *mut _,
+ std::mem::size_of::() as u32
+ ) == 0 {
+ return frame_rect.left == rect.left && frame_rect.right == rect.right &&
+ frame_rect.top == rect.top && frame_rect.bottom == rect.bottom;
+ }
+ }
+ false
+ }
+}
+
diff --git a/app/src-tauri/src/shortcuts/mod.rs b/app/src-tauri/src/shortcuts/mod.rs
index 1b62dff..caa0c57 100644
--- a/app/src-tauri/src/shortcuts/mod.rs
+++ b/app/src-tauri/src/shortcuts/mod.rs
@@ -1,31 +1,35 @@
use tauri::{App, AppHandle, GlobalShortcutManager, Manager, WindowBuilder, WindowUrl};
use window_shadows::set_shadow;
+mod disable_quicknote;
-struct ShortNotesWindow;
-impl ShortNotesWindow {
- const LABEL: &str = "short_notes_window";
- const SHORTCUT: &str = "CommandOrControl+Space";
+struct QuickNoteWindow;
+impl QuickNoteWindow {
+ const LABEL: &str = "quicknotes_window";
+ const SHORTCUT: &str = "CommandOrControl+Enter";
const W: f64 = 400.0;
const H: f64 = 200.0;
- const URL: &str = "shortNotes";
+ const URL: &str = "quickNotes";
}
pub fn register_shortcuts(app: &mut App) {
let handle = app.handle();
// Enables the user to take quick notes anytime.
- app.global_shortcut_manager().register(ShortNotesWindow::SHORTCUT, move || {
- make_shortnotes_window(&handle);
+ app.global_shortcut_manager().register(QuickNoteWindow::SHORTCUT, move || {
+ make_quicknote_window(&handle);
}).unwrap();
}
-pub fn make_shortnotes_window(handle: &AppHandle) {
- if let Some(window) = handle.get_window(ShortNotesWindow::LABEL) {
+pub fn make_quicknote_window(handle: &AppHandle) {
+ if disable_quicknote::deny_quicknote() {
+ return;
+ }
+ if let Some(window) = handle.get_window(QuickNoteWindow::LABEL) {
window.show().unwrap();
window.set_focus().unwrap();
} else {
- let window = WindowBuilder::new(handle, ShortNotesWindow::LABEL, WindowUrl::App(ShortNotesWindow::URL.into()))
+ let window = WindowBuilder::new(handle, QuickNoteWindow::LABEL, WindowUrl::App(QuickNoteWindow::URL.into()))
.resizable(false)
- .inner_size(ShortNotesWindow::W, ShortNotesWindow::H)
+ .inner_size(QuickNoteWindow::W, QuickNoteWindow::H)
.minimizable(false)
.decorations(false)
.always_on_top(true)
diff --git a/app/src-tauri/src/tray.rs b/app/src-tauri/src/tray.rs
index 8589bba..f99db17 100644
--- a/app/src-tauri/src/tray.rs
+++ b/app/src-tauri/src/tray.rs
@@ -1,18 +1,27 @@
-use tauri::{AppHandle, CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, SystemTrayMenuItem};
+use tauri::{AppHandle, CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, SystemTrayMenuItem, Window};
use crate::shortcuts;
struct MenuItems{}
impl MenuItems {
- const SHORTNOTES: (&str, &str) = ("shortnotes", "Shortnotes Ctrl+Space");
+ #[cfg(target_os = "windows")]
+ const QUICKNOTES: (&str, &str) = ("quicknotes", "Quicknotes Ctrl+Enter");
+ #[cfg(target_os = "macos")]
+ const QUICKNOTES: (&str, &str) = ("quicknotes", "Quicknotes Cmd+Enter");
const SETTINGS: (&str, &str) = ("settings", "Settings");
+ const SHOW: (&str, &str) = ("show", "Show");
const QUIT: (&str, &str) = ("quit", "Quit");
}
const MAIN_WINDOW_LABEL: &str = "main";
+struct TauriEvents{}
+impl TauriEvents {
+ const SHOW_SETTINGS: &str = "show_settings";
+}
+
pub fn make_tray() -> SystemTray {
let mut tray_menu = SystemTrayMenu::new();
- let menu_items = vec![MenuItems::SHORTNOTES, MenuItems::SETTINGS];
+ let menu_items = vec![MenuItems::QUICKNOTES, MenuItems::SETTINGS, MenuItems::SHOW];
for item in menu_items {
let custom_menu = CustomMenuItem::new(item.0, item.1);
tray_menu = tray_menu.add_item(custom_menu);
@@ -25,24 +34,31 @@ pub fn make_tray() -> SystemTray {
tray.with_menu(tray_menu)
}
+fn show_main_window(app: &AppHandle) -> Window {
+ let window = app.get_window(MAIN_WINDOW_LABEL).unwrap();
+ window.show().unwrap();
+ window
+}
+
pub fn system_tray_events(app: &AppHandle, event: SystemTrayEvent) {
match event {
SystemTrayEvent::DoubleClick { .. } => {
- let window = app.get_window(MAIN_WINDOW_LABEL).unwrap();
- window.show().unwrap();
+ show_main_window(app);
}
SystemTrayEvent::MenuItemClick { id, .. } => {
match id.as_str() {
str if str == MenuItems::QUIT.0 => {
app.exit(0);
}
- str if str == MenuItems::SHORTNOTES.0 => {
- shortcuts::make_shortnotes_window(&app.app_handle());
+ str if str == MenuItems::QUICKNOTES.0 => {
+ shortcuts::make_quicknote_window(&app.app_handle());
}
str if str == MenuItems::SETTINGS.0 => {
- let window = app.get_window(MAIN_WINDOW_LABEL).unwrap();
- window.show().unwrap();
- window.emit("show_settings", {}).unwrap();
+ let window = show_main_window(app);
+ window.emit(TauriEvents::SHOW_SETTINGS, {}).unwrap();
+ }
+ str if str == MenuItems::SHOW.0 => {
+ show_main_window(app);
}
&_ => {}
}
diff --git a/app/src-tauri/tauri.conf.json b/app/src-tauri/tauri.conf.json
index 5d18c63..9041572 100644
--- a/app/src-tauri/tauri.conf.json
+++ b/app/src-tauri/tauri.conf.json
@@ -7,7 +7,7 @@
},
"package": {
"productName": "scribe",
- "version": "0.1.0"
+ "version": "0.4.2"
},
"tauri": {
"allowlist": {
@@ -32,7 +32,8 @@
},
"dialog": {
"all": false,
- "open": true
+ "open": true,
+ "confirm": true
}
},
"bundle": {
@@ -57,9 +58,10 @@
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
- "signingIdentity": null
+ "signingIdentity": "noteapp",
+ "minimumSystemVersion": "10.13"
},
- "resources": [],
+ "resources": ["./docs/readme.md"],
"shortDescription": "Perfect for quick notes or detailed plans, stay on top of your day and never lose track of your ideas again!",
"targets": "all",
"windows": {
@@ -74,7 +76,7 @@
"updater": {
"active": true,
"dialog": true,
- "endpoints": ["https://scribe.izzi-xenex.xyz/tauri/{{target}}/{{arch}}/{{current_version}}"],
+ "endpoints": ["https://scribe.izzi-xenex.xyz/tauri/{{target}}/{{arch}}/{{current_version}}", "https://gist.githubusercontent.com/HoaX7/26a914ff0cdfe097c949db0ac825a94f/raw/"],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEJDQzY3MjU3MDQ3MDQ1OEYKUldTUFJYQUVWM0xHdktsNDY4RHREYzZnV3BDV3pxS1NVRHNQZGZhSHZqOTlvbXZ1YWdtdkU3b2kK",
"windows": {
"installMode": "passive"
diff --git a/app/src-tauri/tauri.macos.conf.json b/app/src-tauri/tauri.macos.conf.json
index 7d186c9..5fc2406 100644
--- a/app/src-tauri/tauri.macos.conf.json
+++ b/app/src-tauri/tauri.macos.conf.json
@@ -11,7 +11,12 @@
"focus": true,
"center": true
}
- ]
+ ],
+ "bundle": {
+ "windows": {
+ "signCommand": "codesign -s - -f %1"
+ }
+ }
}
}
\ No newline at end of file
diff --git a/app/src/api/index.ts b/app/src/api/index.ts
index a8f1a2a..4835404 100644
--- a/app/src/api/index.ts
+++ b/app/src/api/index.ts
@@ -49,4 +49,9 @@ export const getSettings = async (): Promise => {
export const saveSettings = async (newSettings: Partial) => {
if (isEmptyObject(newSettings)) return;
return invoke("save_settings", { newSettings });
+};
+
+export const searchContent = async (query: string): Promise => {
+ if (!query) return [];
+ return invoke("search_contents", { query });
};
\ No newline at end of file
diff --git a/app/src/api/update.ts b/app/src/api/update.ts
new file mode 100644
index 0000000..ddb96e2
--- /dev/null
+++ b/app/src/api/update.ts
@@ -0,0 +1,38 @@
+// import {
+// checkUpdate,
+// installUpdate,
+// onUpdaterEvent,
+// } from "@tauri-apps/api/updater";
+// import { relaunch } from "@tauri-apps/api/process";
+
+// const unlisten = await onUpdaterEvent(({ error, status }) => {
+// // This will log all updater events, including status updates and errors.
+// console.log("Updater event", error, status);
+// });
+
+// try {
+// const { shouldUpdate, manifest } = await checkUpdate();
+// console.log({
+// shouldUpdate,
+// manifest
+// });
+// if (shouldUpdate) {
+// const ask = window.confirm("A new update is available");
+// // You could show a dialog asking the user if they want to install the update here.
+// console.log(
+// `Installing update ${manifest?.version}, ${manifest?.date}, ${manifest?.body}`
+// );
+
+// // Install the update. This will also restart the app on Windows!
+// // await installUpdate();
+
+// // // On macOS and Linux you will need to restart the app manually.
+// // // You could use this step to display another confirmation dialog.
+// // await relaunch();
+// }
+// } catch (error) {
+// console.error(error);
+// }
+
+// // you need to call unlisten if your handler goes out of scope, for example if the component is unmounted.
+// unlisten();
diff --git a/app/src/app.css b/app/src/app.css
index 26559e7..c03e970 100644
--- a/app/src/app.css
+++ b/app/src/app.css
@@ -144,3 +144,62 @@ ol li {
.tiptap pre .hljs-strong {
font-weight: 700;
}
+.tiptap table {
+ border-collapse: collapse;
+ margin: 0;
+ overflow: hidden;
+ table-layout: fixed;
+ width: 100%;
+ }
+
+ .tiptap table td,
+ .tiptap table th {
+ @apply border;
+ @apply relative;
+ box-sizing: border-box;
+ min-width: 1em;
+ padding: 6px 8px;
+ vertical-align: top;
+ }
+
+ .tiptap table td > *,
+ .tiptap table th > * {
+ margin-bottom: 0;
+ }
+
+ .tiptap table th {
+ @apply bg-gray-100;
+ font-weight: bold;
+ text-align: left;
+ }
+
+ .tiptap table .selectedCell:after {
+ background: rgba(61, 37, 20, .08);
+ content: "";
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ pointer-events: none;
+ position: absolute;
+ }
+
+ .tiptap table .column-resize-handle {
+ @apply bg-gray-300;
+ bottom: -2px;
+ pointer-events: none;
+ position: absolute;
+ right: -2px;
+ top: 0;
+ width: 4px;
+ }
+
+ .tiptap .tableWrapper {
+ margin: 1.5rem 0;
+ overflow-x: auto;
+ }
+
+ .tiptap.resize-cursor {
+ cursor: ew-resize;
+ cursor: col-resize;
+ }
\ No newline at end of file
diff --git a/app/src/lib/components/common/DropDown.svelte b/app/src/lib/components/common/DropDown.svelte
new file mode 100644
index 0000000..0593e13
--- /dev/null
+++ b/app/src/lib/components/common/DropDown.svelte
@@ -0,0 +1,18 @@
+
+
+
+
+ {selectedItem}
+
+
diff --git a/app/src/lib/components/common/Modal.svelte b/app/src/lib/components/common/Modal.svelte
index 4c7210d..960cbb5 100644
--- a/app/src/lib/components/common/Modal.svelte
+++ b/app/src/lib/components/common/Modal.svelte
@@ -4,14 +4,19 @@
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
+ export let empty = false;
+ export let containerClass = "";
+ class={clsx("fixed inset-0 z-[999] grid h-screen w-screen bg-black bg-opacity-60 backdrop-blur-sm", containerClass ? containerClass : "place-items-center")}>
+ {#if empty}
+
+
+
+ {:else}
+ class="relative bg-white w-3/4 h-3/4 rounded">
@@ -23,4 +28,5 @@
+ {/if}
diff --git a/app/src/lib/components/common/Toggle.svelte b/app/src/lib/components/common/Toggle.svelte
new file mode 100644
index 0000000..1a2bf29
--- /dev/null
+++ b/app/src/lib/components/common/Toggle.svelte
@@ -0,0 +1,17 @@
+
+
+
+ dispatch("change")}>
+
+
diff --git a/app/src/lib/components/customWindow/MacOs.svelte b/app/src/lib/components/customWindow/MacOs.svelte
index 8c346f9..dcb07df 100644
--- a/app/src/lib/components/customWindow/MacOs.svelte
+++ b/app/src/lib/components/customWindow/MacOs.svelte
@@ -4,5 +4,5 @@
diff --git a/app/src/lib/components/editor/BubbleMenu.svelte b/app/src/lib/components/editor/BubbleMenu.svelte
index fc369f0..6466394 100644
--- a/app/src/lib/components/editor/BubbleMenu.svelte
+++ b/app/src/lib/components/editor/BubbleMenu.svelte
@@ -66,7 +66,7 @@
name: "Sub",
key: "subscript",
icon: "assets/images/subscript.svg",
- click: () => editor.chain().focus().toggleSubscript().run(),
+ click: () => editor.chain().focus().toggleSubscript().run,
classname: "!mr-[2px]"
},
];
@@ -84,19 +84,25 @@
.extendMarkRange("link")
.setLink({
href: link,
- target: "_blank",
- rel: "noopener noreferrer nofollow"
+ target: "_blank",
+ rel: "noopener noreferrer nofollow"
})
.run();
+ link = "";
showLinkInput = false;
} else if ((e.code === "Backspace" || e.code === "Enter") && link === "") {
unlink();
+ link = "";
showLinkInput = false;
}
};
+
+ $: if (editor?.isActive?.("link")) {
+ link = editor.getAttributes("link").href || "";
+ }
-
+
{#if showLinkInput}
Promise
| boolean;
export let editorOptions: Partial = {
- onUpdate: debounce((props: EditorEvents["update"]) => saveContent(props.editor.getHTML()), 1000),
- };
+ onUpdate: debounce(
+ (props: EditorEvents["update"]) => saveContent(props.editor.getHTML()),
+ 1000
+ ),
+ };
const saveContent = async (text: string) => {
if (previousContent === text) return;
let res = await onData?.(text);
previousContent = text;
return res;
- }
+ };
const handleManualSave = async (ev: KeyboardEvent) => {
if ((ev.metaKey || ev.ctrlKey) && ev.key === "s") {
@@ -33,7 +37,12 @@
const clearContent = await saveContent(editor.getHTML());
if (clearContent) editor.commands.clearContent(false);
}
- }
+ };
+
+ export const appendContent = (text: string) => {
+ const { size } = editor.view.state.doc.content;
+ editor.commands.insertContentAt(size, text);
+ };
onMount(() => {
editor = new Editor({
element: editorContainer,
@@ -47,6 +56,7 @@
StarterKit.configure(StarterKitOptions),
BubbleMenu.configure({ element: bubbleMenuEl }),
SlashCommands,
+ Typography,
],
onTransaction() {
editor = editor;
@@ -66,7 +76,6 @@
onDestroy(() => {
editor?.destroy();
});
-
diff --git a/app/src/lib/components/editor/MenuButton.svelte b/app/src/lib/components/editor/MenuButton.svelte
index 45aa0e2..66d28aa 100644
--- a/app/src/lib/components/editor/MenuButton.svelte
+++ b/app/src/lib/components/editor/MenuButton.svelte
@@ -6,7 +6,7 @@
diff --git a/app/src/lib/components/editor/SlashCommandMenu.svelte b/app/src/lib/components/editor/SlashCommandMenu.svelte
index 34d337c..06cbf51 100644
--- a/app/src/lib/components/editor/SlashCommandMenu.svelte
+++ b/app/src/lib/components/editor/SlashCommandMenu.svelte
@@ -10,6 +10,7 @@
export let items = getList(editor);
+ export let range: any;
let activeIdx = 0;
/**
* This API is used to filter data
@@ -20,8 +21,7 @@
name.toLowerCase().startsWith(query.toLowerCase())
);
- export const onKeyDown = (ev: KeyboardEvent) => {
- if (ev.repeat) return;
+ export const onKeyDown = (ev: KeyboardEvent, range: any) => {
switch (ev.key) {
case "ArrowUp":
activeIdx = (activeIdx + items.length - 1) % items.length;
@@ -30,7 +30,8 @@
activeIdx = (activeIdx + 1) % items.length;
return true;
case "Enter":
- triggerCommand(items[activeIdx]);
+ if (ev.repeat) return false;
+ triggerCommand(items[activeIdx], range);
return true;
}
return false;
@@ -38,34 +39,34 @@
const dispatch = createEventDispatcher();
- const clearBlock = () => {
+ const clearBlock = (range?: any) => {
const selection = editor.state.selection;
+ if (!range) {
+ range = {
+ from: selection.to - 1,
+ to: selection.to
+ }
+ }
editor
.chain()
.focus()
- .insertContentAt(
- {
- from: selection.from - 1,
- to: selection.to,
- },
- ""
- )
+ .deleteRange(range)
.run();
};
- const triggerCommand = (item: { name: string; click: () => void }) => {
+ const triggerCommand = (item: { name: string; click: () => void }, range?: any) => {
+ clearBlock(range);
item?.click?.();
/**
* When an item is selected, hide the element.
*/
dispatch("click");
- clearBlock();
};
{#each items as item, idx}
triggerCommand(item)}
+ on:click={() => triggerCommand(item, range)}
classname={idx === activeIdx ? "bg-gray-200" : ""}
>
diff --git a/app/src/lib/components/editor/TableOptions.svelte b/app/src/lib/components/editor/TableOptions.svelte
new file mode 100644
index 0000000..f1e2507
--- /dev/null
+++ b/app/src/lib/components/editor/TableOptions.svelte
@@ -0,0 +1,64 @@
+
+
+ showOpts = false} />
+
+
+
+
+
+ (showOpts = !showOpts)}
+ >
+
+ Options
+
+
+
+ {#if showOpts}
+
+ {#each options as { name, key, icon, command }}
+
{
+ command();
+ }}
+ >
+
+
+
+ {name}
+
+
+
+ {/each}
+
+ {/if}
+
diff --git a/app/src/lib/components/editor/extensions/index.ts b/app/src/lib/components/editor/extensions/index.ts
index 839229a..915f1e2 100644
--- a/app/src/lib/components/editor/extensions/index.ts
+++ b/app/src/lib/components/editor/extensions/index.ts
@@ -3,12 +3,17 @@ import CodeBlockLowLight from "@tiptap/extension-code-block-lowlight";
import lowlight from "./registerCodeExt";
import TaskList from "@tiptap/extension-task-list";
import TaskItem from "@tiptap/extension-task-item";
-import codeblockNodeView from "../nodeView/codeblockNodeView";
+import codeblockNodeView from "../nodeView/codeblock";
import Link from "@tiptap/extension-link";
import Subscript from "@tiptap/extension-subscript";
import Superscript from "@tiptap/extension-superscript";
import Underline from "@tiptap/extension-underline";
import Highlight from "@tiptap/extension-highlight";
+import Table from "@tiptap/extension-table";
+import TableCell from "@tiptap/extension-table-cell";
+import TableHeader from "@tiptap/extension-table-header";
+import TableRow from "@tiptap/extension-table-row";
+import tableNodeView from "../nodeView/table";
export const StarterKitOptions = {
blockquote: { HTMLAttributes: { class: "pl-2 my-2 border-l-2 border-gray-300" } },
@@ -22,7 +27,12 @@ export const StarterKitOptions = {
};
export default [
- Placeholder.configure({ placeholder: "Write something, or press '/' for commands..." }),
+ Placeholder.configure({
+ placeholder: ({ node }) => {
+ if ([ "table", "codeBlock", "taskList" ].includes(node.type.name)) return "";
+ return "Write something, or press '/' for commands...";
+ },
+ }),
CodeBlockLowLight.extend({
addNodeView() {
return codeblockNodeView;
@@ -40,4 +50,12 @@ export default [
Superscript,
Underline,
Highlight,
+ Table.extend({
+ addNodeView() {
+ return tableNodeView;
+ },
+ }).configure({ resizable: true, }),
+ TableRow,
+ TableHeader,
+ TableCell,
];
diff --git a/app/src/lib/components/editor/extensions/registerCodeExt.ts b/app/src/lib/components/editor/extensions/registerCodeExt.ts
index 1dbe286..cb57fae 100644
--- a/app/src/lib/components/editor/extensions/registerCodeExt.ts
+++ b/app/src/lib/components/editor/extensions/registerCodeExt.ts
@@ -1,23 +1,23 @@
import { all, createLowlight } from "lowlight";
-import rust from "highlight.js/lib/languages/rust";
-import css from "highlight.js/lib/languages/css";
-import scss from "highlight.js/lib/languages/scss";
-import xml from "highlight.js/lib/languages/xml";
-import dart from "highlight.js/lib/languages/dart";
-import java from "highlight.js/lib/languages/java";
-import javascript from "highlight.js/lib/languages/javascript";
-import typescript from "highlight.js/lib/languages/typescript";
-import sql from "highlight.js/lib/languages/sql";
-import go from "highlight.js/lib/languages/go";
-import elixir from "highlight.js/lib/languages/elixir";
-import dockerfile from "highlight.js/lib/languages/dockerfile";
-import python from "highlight.js/lib/languages/python";
-import json from "highlight.js/lib/languages/json";
-import yaml from "highlight.js/lib/languages/yaml";
-import c from "highlight.js/lib/languages/c";
-import cpp from "highlight.js/lib/languages/cpp";
-import csharp from "highlight.js/lib/languages/csharp";
-import bash from "highlight.js/lib/languages/bash";
+// import rust from "highlight.js/lib/languages/rust";
+// import css from "highlight.js/lib/languages/css";
+// import scss from "highlight.js/lib/languages/scss";
+// import xml from "highlight.js/lib/languages/xml";
+// import dart from "highlight.js/lib/languages/dart";
+// import java from "highlight.js/lib/languages/java";
+// import javascript from "highlight.js/lib/languages/javascript";
+// import typescript from "highlight.js/lib/languages/typescript";
+// import sql from "highlight.js/lib/languages/sql";
+// import go from "highlight.js/lib/languages/go";
+// import elixir from "highlight.js/lib/languages/elixir";
+// import dockerfile from "highlight.js/lib/languages/dockerfile";
+// import python from "highlight.js/lib/languages/python";
+// import json from "highlight.js/lib/languages/json";
+// import yaml from "highlight.js/lib/languages/yaml";
+// import c from "highlight.js/lib/languages/c";
+// import cpp from "highlight.js/lib/languages/cpp";
+// import csharp from "highlight.js/lib/languages/csharp";
+// import bash from "highlight.js/lib/languages/bash";
export const registeredLangs = [
"css",
@@ -42,24 +42,32 @@ export const registeredLangs = [
];
const lowlight = createLowlight(all);
-lowlight.register("css", css);
-lowlight.register("rust", rust);
-lowlight.register("java", java);
-lowlight.register("typescript", typescript);
-lowlight.register("javascript", javascript);
-lowlight.register("yaml", yaml);
-lowlight.register("dockerfile", dockerfile);
-lowlight.register("bash", bash);
-lowlight.register("c", c);
-lowlight.register("cpp", cpp);
-lowlight.register("csharp", csharp);
-lowlight.register("json", json);
-lowlight.register("python", python);
-lowlight.register("go", go);
-lowlight.register("sql", sql);
-lowlight.register("elixir", elixir);
-lowlight.register("dart", dart);
-lowlight.register("xml", xml);
-lowlight.register("scss", scss);
+registeredLangs.map(async (lang) => {
+ try {
+ const func = await import(`highlight.js/lib/languages/${lang}`);
+ lowlight.register(lang, func);
+ } catch (err) {
+ //
+ }
+});
+// lowlight.register("css", css);
+// lowlight.register("rust", rust);
+// lowlight.register("java", java);
+// lowlight.register("typescript", typescript);
+// lowlight.register("javascript", javascript);
+// lowlight.register("yaml", yaml);
+// lowlight.register("dockerfile", dockerfile);
+// lowlight.register("bash", bash);
+// lowlight.register("c", c);
+// lowlight.register("cpp", cpp);
+// lowlight.register("csharp", csharp);
+// lowlight.register("json", json);
+// lowlight.register("python", python);
+// lowlight.register("go", go);
+// lowlight.register("sql", sql);
+// lowlight.register("elixir", elixir);
+// lowlight.register("dart", dart);
+// lowlight.register("xml", xml);
+// lowlight.register("scss", scss);
export default lowlight;
diff --git a/app/src/lib/components/editor/extensions/slashCommands.ts b/app/src/lib/components/editor/extensions/slashCommands.ts
index 231d0c7..a2efa98 100644
--- a/app/src/lib/components/editor/extensions/slashCommands.ts
+++ b/app/src/lib/components/editor/extensions/slashCommands.ts
@@ -46,11 +46,14 @@ export const SlashCommands = Node.create({
let renderer: SvelteRenderer;
let wrapper: HTMLDivElement;
return {
- onStart: () => {
+ onStart: (props) => {
wrapper = document.createElement("div");
this.options.component = new SlashCommandMenu({
target: wrapper,
- props: { editor: this.editor, } as any
+ props: {
+ editor: this.editor,
+ range: props.range
+ } as any
});
renderer = new SvelteRenderer(this.options.component, { element: wrapper });
this.options.tippy = tippy(editorElement, {
@@ -58,7 +61,7 @@ export const SlashCommands = Node.create({
content: renderer.dom,
trigger: "manual",
placement: "bottom-start",
- getReferenceClientRect: null,
+ getReferenceClientRect: props.clientRect as any,
showOnCreate: true,
});
},
@@ -67,7 +70,7 @@ export const SlashCommands = Node.create({
this.options.tippy?.hide();
return true;
}
- return this.options.component?.onKeyDown?.(props.event);;
+ return this.options.component?.onKeyDown?.(props.event, props.range);
},
onUpdate: (props) => {
renderer.updateProps(props);
diff --git a/app/src/lib/components/editor/nodeView/codeblockNodeView.ts b/app/src/lib/components/editor/nodeView/codeblock.ts
similarity index 90%
rename from app/src/lib/components/editor/nodeView/codeblockNodeView.ts
rename to app/src/lib/components/editor/nodeView/codeblock.ts
index b8b4a58..e4682be 100644
--- a/app/src/lib/components/editor/nodeView/codeblockNodeView.ts
+++ b/app/src/lib/components/editor/nodeView/codeblock.ts
@@ -12,10 +12,11 @@ export default ({
const select = document.createElement("select");
select.classList.add("bg-gray-100", "px-2", "rounded", "py-1");
select.contentEditable = "false";
- select.onchange = (e: any) => {
+ select.onchange = async (e: any) => {
if (typeof getPos !== "function") return;
+ const lang = e.target.value;
editor.view.dispatch(
- editor.view.state.tr.setNodeMarkup(getPos(), undefined, { language: e.target.value })
+ editor.view.state.tr.setNodeMarkup(getPos(), undefined, { language: lang })
);
};
const optionAuto = document.createElement("option");
@@ -35,6 +36,7 @@ export default ({
const pre = document.createElement("pre");
const content = document.createElement("code");
+ pre.setAttribute("spellcheck", "false");
pre.appendChild(content);
dom.append(select, pre);
diff --git a/app/src/lib/components/editor/nodeView/table.ts b/app/src/lib/components/editor/nodeView/table.ts
new file mode 100644
index 0000000..c15b9bc
--- /dev/null
+++ b/app/src/lib/components/editor/nodeView/table.ts
@@ -0,0 +1,45 @@
+import type { NodeViewRendererProps } from "@tiptap/core";
+import type { NodeView } from "@tiptap/pm/view";
+import TableOptions from "../TableOptions.svelte";
+import SvelteRenderer from "./renderer";
+import tippy, { type Instance, type Props } from "tippy.js";
+
+export default ({ editor, node }: NodeViewRendererProps): NodeView => {
+ const dom = document.createElement("div");
+ dom.classList.add("tableWrapper");
+ const table = document.createElement("table");
+ table.setAttribute("tabindex", "-1");
+ let renderer: SvelteRenderer | null = null;
+ let tippyEl: Instance;
+ let wrapper = document.createElement("div");
+ const component = new TableOptions({
+ target: wrapper,
+ props: { editor }
+ });
+ renderer = new SvelteRenderer(component, { element: wrapper });
+ tippyEl = tippy(editor.options.element, {
+ interactive: true,
+ content: renderer.dom,
+ getReferenceClientRect: () => {
+ const rect = table.getBoundingClientRect();
+ return rect;
+ },
+ trigger: "manual",
+ showOnCreate: false,
+ placement: "top-start"
+ });
+ dom.appendChild(table);
+ table.addEventListener("focus", () => {
+ tippyEl?.show();
+ });
+ return {
+ dom,
+ contentDOM: table,
+ destroy() {
+ tippyEl?.destroy();
+ renderer?.destroy();
+ dom.remove();
+ wrapper?.remove();
+ },
+ };
+};
\ No newline at end of file
diff --git a/app/src/lib/components/editor/slashCommandList.ts b/app/src/lib/components/editor/slashCommandList.ts
index ce45702..96e9a2e 100644
--- a/app/src/lib/components/editor/slashCommandList.ts
+++ b/app/src/lib/components/editor/slashCommandList.ts
@@ -23,18 +23,22 @@ export const getList = (editor: Editor) => [
{
name: "Divider",
click: () =>
- editor.chain().focus().setHorizontalRule().run(),
+ editor.chain().focus().setHorizontalRule().run()
},
{
name: "Code Block",
- click: () => editor.chain().focus().toggleCodeBlock().run(),
+ click: () => editor.chain().focus().toggleCodeBlock().run()
},
{
name: "Ordered List",
- click: () => editor.chain().focus().toggleOrderedList().run(),
+ click: () => editor.chain().focus().toggleOrderedList().run()
},
{
name: "Block Quotes",
- click: () => editor.chain().focus().toggleBlockquote().run(),
+ click: () => editor.chain().focus().toggleBlockquote().run()
},
+ {
+ name: "Table",
+ click: () => editor.chain().focus().insertTable().run()
+ }
];
\ No newline at end of file
diff --git a/app/src/lib/components/editor/tableOptions.ts b/app/src/lib/components/editor/tableOptions.ts
new file mode 100644
index 0000000..547a5ab
--- /dev/null
+++ b/app/src/lib/components/editor/tableOptions.ts
@@ -0,0 +1,64 @@
+import { Editor } from "@tiptap/core";
+
+export default (editor: Editor) => [
+ {
+ key: "header_row",
+ name: "Header row",
+ icon: "assets/images/table-header-row.svg",
+ command: () => editor.chain().focus().toggleHeaderRow().run(),
+ },
+ {
+ key: "header_column",
+ name: "Header column",
+ icon: "assets/images/table-header-column.svg",
+ command: () => editor.chain().focus().toggleHeaderColumn().run(),
+ },
+ // {
+ // key: "merge_cells",
+ // name: "Merge cells",
+ // icon: "assets/images/table-merge-cells.svg",
+ // command: () => editor.chain().focus().mergeCells().run(),
+ // },
+ // {
+ // key: "split_cells",
+ // name: "Split cells",
+ // icon: "assets/images/table-split-cells.svg",
+ // command: () => editor.chain().focus().splitCell().run(),
+ // },
+ {
+ key: "insert_row_before",
+ name: "Add row before",
+ icon: "assets/images/table-insert-row.svg",
+ command: () => editor.chain().focus().addRowBefore().run()
+ },
+ {
+ key: "insert_row_after",
+ name: "Add row after",
+ icon: "assets/images/table-insert-row.svg",
+ command: () => editor.chain().focus().addRowAfter().run()
+ },
+ {
+ key: "delete_row",
+ name: "Delete row",
+ icon: "assets/images/table-delete-row.svg",
+ command: () => editor.chain().focus().deleteRow().run()
+ },
+ {
+ key: "insert_column_before",
+ name: "Add column before",
+ icon: "assets/images/table-insert-col.svg",
+ command: () => editor.chain().focus().addColumnBefore().run()
+ },
+ {
+ key: "insert_column_after",
+ name: "Add column after",
+ icon: "assets/images/table-insert-col.svg",
+ command: () => editor.chain().focus().addColumnAfter().run()
+ },
+ {
+ key: "delete_column",
+ name: "Delete column",
+ icon: "assets/images/table-delete-col.svg",
+ command: () => editor.chain().focus().deleteColumn().run()
+ }
+];
\ No newline at end of file
diff --git a/app/src/lib/components/menu/Main.svelte b/app/src/lib/components/menu/Main.svelte
index 0716e5b..2cb313d 100644
--- a/app/src/lib/components/menu/Main.svelte
+++ b/app/src/lib/components/menu/Main.svelte
@@ -5,40 +5,43 @@
import Typography from "../common/Typography.svelte";
import MenuItems from "./MenuItems.svelte";
import { getMenuBar } from "./items";
- import Settings from "../settings/Index.svelte";
- import { listen } from "@tauri-apps/api/event";
+ import { TAURI_EVENTS } from "../../../utils/constants";
+ import SettingStore from "../../../store/settings";
+ import { emit } from "@tauri-apps/api/event";
const ctx = ContextStore.getContext();
+ const settingCtx = SettingStore.getContext();
let menubar = [];
let activeMenu = "";
- let showSettings = false;
const closeMenu = () => {
activeMenu = "";
- }
- $: menubar = getMenuBar($ctx.page, () => showSettings = true);
-
- listen("show_settings", () => {
- showSettings = true;
- })
+ };
+ $: menubar = getMenuBar($ctx.page, $settingCtx.os, () => {
+ emit(TAURI_EVENTS.SHOW_SETTINGS);
+ });
-{#if showSettings}
- showSettings = false} />
-{/if}
{#each menubar as menu}
-
- {
- activeMenu = menu.name;
- }}>
-
- {menu.name}
-
-
-
-
+
+ {
+ activeMenu = menu.name;
+ }}
+ >
+
+ {menu.name}
+
+
+
+
{/each}
diff --git a/app/src/lib/components/menu/items.ts b/app/src/lib/components/menu/items.ts
index 0815e17..977e8ce 100644
--- a/app/src/lib/components/menu/items.ts
+++ b/app/src/lib/components/menu/items.ts
@@ -1,5 +1,6 @@
-import { appWindow } from "@tauri-apps/api/window";
+import { appWindow, WebviewWindow } from "@tauri-apps/api/window";
import { openShortNoteWindow } from "../../../api";
+import { QUICKNOTE_WINDOW_LABEL, Shortcuts } from "../../../utils/constants";
export type MenuItemProps = {
name: string;
@@ -17,30 +18,43 @@ const emitSave = () => {
});
window.dispatchEvent(event);
};
-export const getMenuBar = (page?: string, cb?: () => void) => [
- {
- name: "File",
- items: [
- {
- name: "Save",
- command: emitSave,
- shortcut: "Ctrl+S",
- disabled: !page,
- },
- {
- name: "Shortnotes",
- command: openShortNoteWindow,
- shortcut: "Ctrl+Space",
- },
- {
- name: "Settings",
- command: () => cb?.(),
- },
- {
- name: "Quit",
- command: appWindow.close,
- classname: "border-t",
- },
- ],
- },
-];
+const quitApp = () => {
+ const quicknotesWindow = WebviewWindow.getByLabel(QUICKNOTE_WINDOW_LABEL);
+ quicknotesWindow?.close?.();
+ appWindow.close();
+};
+export const getMenuBar = (page?: string, os?: string, cb?: () => void) => {
+ const shortcutObj = Shortcuts(os);
+ return [
+ {
+ name: "File",
+ items: [
+ {
+ name: "Save",
+ command: emitSave,
+ shortcut: shortcutObj.SAVE,
+ disabled: !page,
+ },
+ {
+ name: "quicknotes",
+ command: openShortNoteWindow,
+ shortcut: shortcutObj.QUICKNOTE,
+ },
+ {
+ name: "Refresh",
+ command: () => window.location.reload(),
+ shortcut: "F5"
+ },
+ {
+ name: "Settings",
+ command: () => cb?.(),
+ },
+ {
+ name: "Quit",
+ command: quitApp,
+ classname: "border-t",
+ },
+ ],
+ },
+ ];
+};
diff --git a/app/src/lib/components/search/Index.svelte b/app/src/lib/components/search/Index.svelte
new file mode 100644
index 0000000..7f1ba4b
--- /dev/null
+++ b/app/src/lib/components/search/Index.svelte
@@ -0,0 +1,37 @@
+
+
+
+ showModal = true}>
+
+ Search
+
+
+{#if showModal}
+
+
+
+
+
+{/if}
diff --git a/app/src/lib/components/settings/Index.svelte b/app/src/lib/components/settings/Index.svelte
index 4ec217f..7a3f548 100644
--- a/app/src/lib/components/settings/Index.svelte
+++ b/app/src/lib/components/settings/Index.svelte
@@ -1,6 +1,6 @@
+ loadData(true, true)} />
+
{#if error}
{/if}