diff --git a/.githooks/commit-msg b/.githooks/commit-msg
new file mode 100755
index 0000000000..48a347456b
--- /dev/null
+++ b/.githooks/commit-msg
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by "git commit" with one argument, the name of the file
+# that has the commit message. The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit. The hook is allowed to edit the commit message file.
+
+YELLOW="\e[93m"
+GREEN="\e[32m"
+RED="\e[31m"
+ENDCOLOR="\e[0m"
+
+printMessage() {
+ printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printSuccess() {
+ printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printError() {
+ printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printMessage "Running the AppFlowy commit-msg hook."
+
+# This example catches duplicate Signed-off-by lines.
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
+ echo >&2 Duplicate Signed-off-by lines.
+ exit 1
+}
+
+.githooks/gitlint \
+ --msg-file=$1 \
+ --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*" \
+ --subject-maxlen=100 \
+ --subject-minlen=10 \
+ --body-regex=".*" \
+ --body-maxlen=200 \
+ --max-parents=1
+
+if [ $? -ne 0 ]
+then
+ printError "Please fix your commit message to match AppFlowy coding standards"
+ printError "https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides"
+ exit 1
+fi
+
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
old mode 100644
new mode 100755
index d7617246c9..be42c93834
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -1,5 +1,24 @@
#!/usr/bin/env bash
+YELLOW="\e[93m"
+GREEN="\e[32m"
+RED="\e[31m"
+ENDCOLOR="\e[0m"
+
+printMessage() {
+ printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printSuccess() {
+ printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printError() {
+ printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printMessage "Running local AppFlowy pre-commit hook."
+
#flutter format .
##https://gist.github.com/benmccallum/28e4f216d9d72f5965133e6c43aaff6e
limit=$(( 1 * 2**20 )) # 1MB
@@ -31,4 +50,4 @@ for file in $( git diff-index --cached --name-only $against ); do
file_too_large $filename $file_size
exit 1;
fi
-done
\ No newline at end of file
+done
diff --git a/.githooks/pre-push b/.githooks/pre-push
old mode 100644
new mode 100755
index 1636fb8661..ee7c8cb79c
--- a/.githooks/pre-push
+++ b/.githooks/pre-push
@@ -1,21 +1,36 @@
#!/usr/bin/env bash
-if [[ `git status --porcelain` ]]; then
- printf "\e[31;1m%s\e[0m\n" 'This script needs to run against committed code only. Please commit or stash you changes.'
- exit 1
-fi
-printf "\e[33;1m%s\e[0m\n" 'Running the Flutter analyzer'
-flutter analyze
-if [ $? -ne 0 ]; then
- printf "\e[31;1m%s\e[0m\n" 'Flutter analyzer error'
- exit 1
-fi
-printf "\e[33;1m%s\e[0m\n" 'Finished running the Flutter analyzer'
-printf "\e[33;1m%s\e[0m\n" 'Running unit tests'
+YELLOW="\e[93m"
+GREEN="\e[32m"
+RED="\e[31m"
+ENDCOLOR="\e[0m"
-#flutter test
+printMessage() {
+ printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printSuccess() {
+ printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printError() {
+ printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
+}
+
+printMessage "Running local AppFlowy pre-push hook."
+
+if [[ `git status --porcelain` ]]; then
+ printError "This script needs to run against committed code only. Please commit or stash you changes."
+ exit 1
+fi
+
+#
+#printMessage "Running the Flutter analyzer"
+#flutter analyze
+#
#if [ $? -ne 0 ]; then
-# printf "\e[31;1m%s\e[0m\n" 'Unit tests error'
+# printError "Flutter analyzer error"
# exit 1
#fi
-#printf "\e[33;1m%s\e[0m\n" 'Finished running unit tests'
+#
+#printMessage "Finished running the Flutter analyzer"
diff --git a/.github/workflows/rust_lint.yml b/.github/workflows/rust_lint.yml
index 4f364a616a..83ecd62280 100644
--- a/.github/workflows/rust_lint.yml
+++ b/.github/workflows/rust_lint.yml
@@ -17,9 +17,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- with:
- toolchain: 'stable-2022-01-20'
- override: true
+ with:
+ toolchain: 'stable-2022-01-20'
+ override: true
+ - uses: subosito/flutter-action@v1
+ with:
+ flutter-version: '3.0.0'
+ channel: "stable"
- name: Rust Deps
working-directory: frontend
@@ -40,7 +44,7 @@ jobs:
- run: rustup component add clippy
- working-directory: frontend/rust-lib
+ working-directory: frontend/rust-lib
- name: clippy
run: cargo clippy --no-default-features
working-directory: frontend/rust-lib
diff --git a/.github/workflows/translation_notify.yml b/.github/workflows/translation_notify.yml
index 8c12ccb0b8..00f1576b6f 100644
--- a/.github/workflows/translation_notify.yml
+++ b/.github/workflows/translation_notify.yml
@@ -4,15 +4,12 @@ on:
branches: [ main ]
paths:
- "frontend/app_flowy/assets/translations/en.json"
- pull_request:
- branches: [ main ]
- paths:
- - "frontend/app_flowy/assets/translations/en.json"
+
jobs:
Discord-Notify:
runs-on: ubuntu-latest
steps:
- - uses: Ilshidur/action-discord@0.3.2
+ - uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
diff --git a/.gitignore b/.gitignore
index ab5f64486f..3d544c712e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,4 +27,12 @@ frontend/.vscode/*
!frontend/.vscode/tasks.json
!frontend/.vscode/launch.json
!frontend/.vscode/extensions.json
-!frontend/.vscode/*.code-snippets
\ No newline at end of file
+!frontend/.vscode/*.code-snippets
+
+# Commit the highest level pubspec.lock, but ignore the others
+pubspec.lock
+!frontend/app_flowy/pubspec.lock
+
+# ignore tool used for commit linting
+.githooks/gitlint
+.githooks/gitlint.exe
diff --git a/.husky/commit-msg b/.husky/commit-msg
deleted file mode 100755
index 7fed48507b..0000000000
--- a/.husky/commit-msg
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-. "$(dirname "$0")/_/husky.sh"
-
-npx --no -- commitlint --edit
diff --git a/Makefile.toml b/Makefile.toml
deleted file mode 100644
index 2e75c10277..0000000000
--- a/Makefile.toml
+++ /dev/null
@@ -1,35 +0,0 @@
-[tasks.install-commitlint.mac]
-script = [
- """
- brew install npm
- yarn install
- yarn husky install
- """,
-]
-script_runner = "@shell"
-
-[tasks.install-commitlint.windows]
-script = [
- """
- echo "WIP"
- """,
-]
-script_runner = "@duckscript"
-
-[tasks.install-commitlint.linux]
-script = [
- """
- if command -v apt &> /dev/null
- then
- echo "Installing node.js and yarn (sudo apt install nodejs yarn)"
- sudo apt install nodejs yarn
- else
- echo "Installing node.js and yarn (sudo pacman -S nodejs yarn)"
- sudo pacman -S nodejs yarn
- fi
-
- yarn install
- yarn husky install
- """,
-]
-script_runner = "@shell"
diff --git a/README.md b/README.md
index 9aa15e40ae..e441496c96 100644
--- a/README.md
+++ b/README.md
@@ -38,14 +38,15 @@ Please view the [documentation](https://appflowy.gitbook.io/docs/essential-docum
## Stay Up-to-Date
-
+
## Getting Started with development
Please view the [documentation](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy) for OS specific development instructions
## Roadmap
-[AppFlowy Roadmap](https://trello.com/b/NCyXCXXh/appflowy-roadmap)
+- [AppFlowy Roadmap ReadMe](https://appflowy.gitbook.io/docs/essential-documentation/roadmap)
+- [AppFlowy Public Roadmap](https://github.com/orgs/AppFlowy-IO/projects/5/views/12)
If you'd like to propose a feature, submit an issue [here](https://github.com/AppFlowy-IO/appflowy/issues).
diff --git a/ROADMAP.md b/ROADMAP.md
new file mode 100644
index 0000000000..53ac484771
--- /dev/null
+++ b/ROADMAP.md
@@ -0,0 +1,3 @@
+## Our [roadmap](https://github.com/orgs/AppFlowy-IO/projects/5/views/12) is where you can learn about the features we’re working on, their status, when we expect to release them, and how you can help us.
+
+## Find more information about how to use our official AppFlowy public roadmap on [Gitbook](https://appflowy.gitbook.io/docs/essential-documentation/roadmap).
diff --git a/commitlint.config.js b/commitlint.config.js
index c59a378e48..1e1af55752 100644
--- a/commitlint.config.js
+++ b/commitlint.config.js
@@ -22,3 +22,4 @@ module.exports = {
'footer-max-line-length': [2, 'always', 100]
},
};
+
diff --git a/doc/roadmap.md b/doc/roadmap.md
index b5d7e368c9..54bef7f99b 100644
--- a/doc/roadmap.md
+++ b/doc/roadmap.md
@@ -1 +1,3 @@
-https://trello.com/b/NCyXCXXh/appflowy-roadmap
+[AppFlowy Roadmap ReadMe](https://appflowy.gitbook.io/docs/essential-documentation/roadmap)
+
+[AppFlowy Public Roadmap](https://github.com/orgs/AppFlowy-IO/projects/5/views/12)
diff --git a/frontend/Brewfile b/frontend/Brewfile
deleted file mode 100644
index 470312025d..0000000000
--- a/frontend/Brewfile
+++ /dev/null
@@ -1,2 +0,0 @@
-brew 'sqlite3'
-brew 'rustup-init'
diff --git a/frontend/Makefile b/frontend/Makefile
deleted file mode 100644
index c393bec0e0..0000000000
--- a/frontend/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-.PHONY: flowy_dev_install flowy_clean
-
-flowy_dev_install:
- brew bundle
- rustup-init -y --default-toolchain=stable
- cargo install --force cargo-make
- cargo install --force duckscript_cli
- cargo make flowy_dev
-
-
-flowy_clean:
- sh ./scripts/clean.sh
-
-
diff --git a/frontend/app_flowy/.gitignore b/frontend/app_flowy/.gitignore
index 505fd9136b..e43862d70e 100644
--- a/frontend/app_flowy/.gitignore
+++ b/frontend/app_flowy/.gitignore
@@ -64,4 +64,5 @@ windows/flutter/dart_ffi/
**/**/*.dll
**/**/*.so
**/**/Brewfile.lock.json
-**/.sandbox
\ No newline at end of file
+**/.sandbox
+**/.vscode/
\ No newline at end of file
diff --git a/frontend/app_flowy/assets/translations/en.json b/frontend/app_flowy/assets/translations/en.json
index a6f9b4d3ae..2dbb970611 100644
--- a/frontend/app_flowy/assets/translations/en.json
+++ b/frontend/app_flowy/assets/translations/en.json
@@ -141,6 +141,7 @@
"menu": {
"appearance": "Appearance",
"language": "Language",
+ "user": "User",
"open": "Open Settings"
},
"appearance": {
@@ -172,8 +173,8 @@
"includeTime": " Include time",
"dateFormatFriendly": "Month Day,Year",
"dateFormatISO": "Year-Month-Day",
- "dateFormatLocal": "Month/Month/Day",
- "dateFormatUS": "Month/Month/Day",
+ "dateFormatLocal": "Year/Month/Day",
+ "dateFormatUS": "Year/Month/Day",
"timeFormat": " Time format",
"invalidTimeFormat": "Invalid format",
"timeFormatTwelveHour": "12 hour",
@@ -214,4 +215,4 @@
"timeHintTextInTwentyFourHour": "12:00"
}
}
-}
+}
\ No newline at end of file
diff --git a/frontend/app_flowy/assets/translations/es-VE.json b/frontend/app_flowy/assets/translations/es-VE.json
index 4aabe23674..d3740db8ec 100644
--- a/frontend/app_flowy/assets/translations/es-VE.json
+++ b/frontend/app_flowy/assets/translations/es-VE.json
@@ -96,6 +96,12 @@
"lightMode": "Cambiar a modo Claro",
"darkMode": "Cambiar a modo Oscuro"
},
+ "notifications": {
+ "export": {
+ "markdown": "Nota exportada a Markdown",
+ "path": "Documentos/flowy"
+ }
+ },
"contactsPage": {
"title": "Contactos",
"whatsHappening": "¿Qué está pasando esta semana?",
@@ -120,13 +126,13 @@
"oAuth": {
"err": {
"failedTitle": "Imposible conectarse con sus credenciales.",
- "failedMsg": "Por favor asegurese haber completado el proceso de ingreso en su buscador."
+ "failedMsg": "Por favor asegurese haber completado el proceso de ingreso en su navegador."
},
"google": {
"title": "Ingresar con Google",
- "instruction1": "Para importar sus contactos de Google, debe autorizar esta aplicación usando su buscador web.",
+ "instruction1": "Para importar sus contactos de Google, debe autorizar esta aplicación usando su navegador web.",
"instruction2": "Copie este código al presionar el icono o al seleccionar el texto:",
- "instruction3": "Navege al siguiente enlace en su buscador web, e ingrese el código anterior:",
+ "instruction3": "Navege al siguiente enlace en su navegador web, e ingrese el código anterior:",
"instruction4": "Presione el botón de abajo cuando haya completado su registro:"
}
},
@@ -141,5 +147,71 @@
"lightLabel": "Modo Claro",
"darkLabel": "Modo Oscuro"
}
+ },
+ "grid": {
+ "settings": {
+ "filter": "Filtrar",
+ "sortBy": "Ordenar por",
+ "Properties": "Propiedades"
+ },
+ "field": {
+ "hide": "Ocultar",
+ "insertLeft": "Insertar a la Izquierda",
+ "insertRight": "Insertar a la Derecha",
+ "duplicate": "Duplicar",
+ "delete": "Eliminar",
+ "textFieldName": "Texto",
+ "checkboxFieldName": "Casilla de verificación",
+ "dateFieldName": "Fecha",
+ "numberFieldName": "Números",
+ "singleSelectFieldName": "Seleccionar",
+ "multiSelectFieldName": "Selección múltiple",
+ "urlFieldName": "URL",
+ "numberFormat": " Formato numérico",
+ "dateFormat": " Formato de fecha",
+ "includeTime": " Incluir tiempo",
+ "dateFormatFriendly": "Mes Día, Año",
+ "dateFormatISO": "Año-Mes-Día",
+ "dateFormatLocal": "Año/Mes/Día",
+ "dateFormatUS": "Año/Mes/Día",
+ "timeFormat": " Time format",
+ "invalidTimeFormat": "Formato de tiempo",
+ "timeFormatTwelveHour": "12 horas",
+ "timeFormatTwentyFourHour": "24 horas",
+ "addSelectOption": "Añadir una opción",
+ "optionTitle": "Opciones",
+ "addOption": "Añadir opción",
+ "editProperty": "Editar propiedad"
+ },
+ "row": {
+ "duplicate": "Duplicar",
+ "delete": "Eliminar",
+ "textPlaceholder": "Vacío",
+ "copyProperty": "Propiedad copiada al portapapeles"
+ },
+ "selectOption": {
+ "create": "Crear",
+ "purpleColor": "Morado",
+ "pinkColor": "Rosa",
+ "lightPinkColor": "Rosa Claro",
+ "orangeColor": "Naranja",
+ "yellowColor": "Amarillo",
+ "limeColor": "Lima",
+ "greenColor": "Verde",
+ "aquaColor": "Agua",
+ "blueColor": "Azul",
+ "deleteTag": "Borrar etiqueta",
+ "colorPannelTitle": "Colores",
+ "pannelTitle": "Selecciona una opción o crea una",
+ "searchOption": "Buscar una opción"
+ },
+ "menuName": "Grid"
+ },
+ "document": {
+ "menuName": "Doc",
+ "date": {
+ "timeHintTextInTwelveHour": "12:00 AM",
+ "timeHintTextInTwentyFourHour": "12:00"
+ }
}
}
diff --git a/frontend/app_flowy/assets/translations/fr-FR.json b/frontend/app_flowy/assets/translations/fr-FR.json
index c05c9aba27..ed1d56bce8 100644
--- a/frontend/app_flowy/assets/translations/fr-FR.json
+++ b/frontend/app_flowy/assets/translations/fr-FR.json
@@ -68,7 +68,7 @@
"help": "Aide et Support",
"debug": {
"name": "Informations de Débogage",
- "success": "Informations de Débogage copiées dans le presse-papiers!",
+ "success": "Informations de Débogage copiées dans le presse-papiers !",
"fail": "Impossible de copier les informations de Débogage dans le presse-papiers"
}
},
diff --git a/frontend/app_flowy/assets/translations/id-ID.json b/frontend/app_flowy/assets/translations/id-ID.json
new file mode 100644
index 0000000000..cbe721c2b8
--- /dev/null
+++ b/frontend/app_flowy/assets/translations/id-ID.json
@@ -0,0 +1,218 @@
+{
+ "appName": "AppFlowy",
+ "defaultUsername": "Saya",
+ "welcomeText": "Selamat datang di @:appName",
+ "githubStarText": "Bintangi GitHub",
+ "subscribeNewsletterText": "Berlangganan buletin",
+ "letsGoButtonText": "Ayo",
+ "title": "Judul",
+ "signUp": {
+ "buttonText": "Daftar",
+ "title": "Daftar ke @:appName",
+ "getStartedText": "Mulai",
+ "emptyPasswordError": "Sandi tidak boleh kosong",
+ "repeatPasswordEmptyError": "Sandi ulang tidak boleh kosong",
+ "unmatchedPasswordError": "Sandi ulang tidak sama dengan sandi",
+ "alreadyHaveAnAccount": "Sudah punya akun?",
+ "emailHint": "Email",
+ "passwordHint": "Sandi",
+ "repeatPasswordHint": "Sandi ulang"
+ },
+ "signIn": {
+ "loginTitle": "Masuk ke @:appName",
+ "loginButtonText": "Masuk",
+ "buttonText": "Masuk",
+ "forgotPassword": "Lupa Sandi?",
+ "emailHint": "Email",
+ "passwordHint": "Sandi",
+ "dontHaveAnAccount": "Belum punya akun?",
+ "repeatPasswordEmptyError": "Sandi ulang tidak boleh kosong",
+ "unmatchedPasswordError": "Sandi ulang tidak sama dengan sandi"
+ },
+ "workspace": {
+ "create": "Buat workspace",
+ "hint": "workspace",
+ "notFoundError": "Workspace tidak ditemukan"
+ },
+ "shareAction": {
+ "buttonText": "Bagikan",
+ "workInProgress": "Segera",
+ "markdown": "Markdown",
+ "copyLink": "Salin tautan"
+ },
+ "disclosureAction": {
+ "rename": "Ganti nama",
+ "delete": "Hapus",
+ "duplicate": "Duplikat"
+ },
+ "blankPageTitle": "Halaman kosong",
+ "newPageText": "Halaman baru",
+ "trash": {
+ "text": "Sampah",
+ "restoreAll": "Pulihkan Semua",
+ "deleteAll": "Hapus semua",
+ "pageHeader": {
+ "fileName": "Nama file",
+ "lastModified": "Terakhir diubah",
+ "created": "Dibuat"
+ }
+ },
+ "deletePagePrompt": {
+ "text": "Halaman ini di tempat sampah",
+ "restore": "Pulihkan halaman",
+ "deletePermanent": "Hapus secara permanen"
+ },
+ "dialogCreatePageNameHint": "Nama halaman",
+ "questionBubble": {
+ "whatsNew": "Apa yang baru?",
+ "help": "Bantuan & Dukungan",
+ "debug": {
+ "name": "Info debug",
+ "success": "Info debug disalin ke papan klip!",
+ "fail": "Tidak dapat menyalin info debug ke papan klip"
+ }
+ },
+ "menuAppHeader": {
+ "addPageTooltip": "Menambahkan halaman di dalam dengan cepat",
+ "defaultNewPageName": "Tanpa Judul",
+ "renameDialog": "Ganti nama"
+ },
+ "toolbar": {
+ "undo": "Undo",
+ "redo": "Redo",
+ "bold": "Tebal",
+ "italic": "Miring",
+ "underline": "Garis bawah",
+ "strike": "Dicoret",
+ "numList": "Daftar bernomor",
+ "bulletList": "Daftar berpoin",
+ "checkList": "Daftar periksa",
+ "inlineCode": "Kode sebaris",
+ "quote": "Blok kutipan",
+ "header": "Tajuk",
+ "highlight": "Sorotan"
+ },
+ "tooltip": {
+ "lightMode": "Ganti mode terang",
+ "darkMode": "Ganti mode gelap"
+ },
+ "notifications": {
+ "export": {
+ "markdown": "Mengekspor Catatan ke Markdown",
+ "path": "Documents/flowy"
+ }
+ },
+ "contactsPage": {
+ "title": "Kontak",
+ "whatsHappening": "Apa yang terjadi minggu ini?",
+ "addContact": "Tambahkan Kontak",
+ "editContact": "Ubah Kontak"
+ },
+ "button": {
+ "OK": "Ya",
+ "Cancel": "Batal",
+ "signIn": "Masuk",
+ "signOut": "Keluar",
+ "complete": "Selesai",
+ "save": "Simpan"
+ },
+ "label": {
+ "welcome": "Selamat datang!",
+ "firstName": "Nama Depan",
+ "middleName": "Nama Tengah",
+ "lastName": "Nama Akhir",
+ "stepX": "Langkah {X}"
+ },
+ "oAuth": {
+ "err": {
+ "failedTitle": "Tidak dapat terhubung ke akun anda",
+ "failedMsg": "Mohon pastikan anda menyelesaikan proses pendaftaran pada browser anda."
+ },
+ "google": {
+ "title": "MASUK GOOGLE",
+ "instruction1": "Untuk mengimpor kontak Google Contacts anda, anda harus mengizinkan aplikasi ini menggunakan browser web anda.",
+ "instruction2": "Salin kode ini ke papan klip anda dengan cara mengklik ikon atau memilih teks:",
+ "instruction3": "Arahkan ke tautan berikut di browser web Anda, dan masukkan kode di atas:",
+ "instruction4": "Tekan tombol di bawah ini setelah Anda menyelesaikan pendaftaran:"
+ }
+ },
+ "settings": {
+ "title": "Pengaturan",
+ "menu": {
+ "appearance": "Tampilan",
+ "language": "Bahasa",
+ "user": "Pengguna",
+ "open": "Buka Pengaturan"
+ },
+ "appearance": {
+ "lightLabel": "Mode Terang",
+ "darkLabel": "Mode Gelap"
+ }
+ },
+ "grid": {
+ "settings": {
+ "filter": "Filter",
+ "sortBy": "Sortir dengan",
+ "Properties": "Properti"
+ },
+ "field": {
+ "hide": "Sembunyikan",
+ "insertLeft": "Sisipkan Kiri",
+ "insertRight": "Sisipkan Kanan",
+ "duplicate": "Duplikasi",
+ "delete": "Hapus",
+ "textFieldName": "Teks",
+ "checkboxFieldName": "Kotak Centang",
+ "dateFieldName": "Tanggal",
+ "numberFieldName": "Angka",
+ "singleSelectFieldName": "seleksi",
+ "multiSelectFieldName": "Multi seleksi",
+ "urlFieldName": "URL",
+ "numberFormat": " Format angka",
+ "dateFormat": " Format tanggal",
+ "includeTime": " Sertakan waktu",
+ "dateFormatFriendly": "Bulan Hari,Tahun",
+ "dateFormatISO": "Tahun-Bulan-Hari",
+ "dateFormatLocal": "Tahun/Bulan/Hari",
+ "dateFormatUS": "Tahun/Bulan/Hari",
+ "timeFormat": " Format waktu",
+ "invalidTimeFormat": "Format yang tidak valid",
+ "timeFormatTwelveHour": "12 jam",
+ "timeFormatTwentyFourHour": "24 jam",
+ "addSelectOption": "Tambahkan opsi",
+ "optionTitle": "Opsi",
+ "addOption": "Tambahkan opsi",
+ "editProperty": "Ubah properti"
+ },
+ "row": {
+ "duplicate": "Duplikasi",
+ "delete": "Hapus",
+ "textPlaceholder": "Kosong",
+ "copyProperty": "Salin properti ke papan klip"
+ },
+ "selectOption": {
+ "create": "Buat",
+ "purpleColor": "Ungu",
+ "pinkColor": "Merah Jambu",
+ "lightPinkColor": "Merah Jambu Muda",
+ "orangeColor": "Oranye",
+ "yellowColor": "Kuning",
+ "limeColor": "Limau",
+ "greenColor": "Hijau",
+ "aquaColor": "Air",
+ "blueColor": "Biru",
+ "deleteTag": "Hapus tag",
+ "colorPannelTitle": "Warna",
+ "pannelTitle": "Pilih opsi atau buat baru",
+ "searchOption": "Cari opsi"
+ },
+ "menuName": "Grid"
+ },
+ "document": {
+ "menuName": "Doc",
+ "date": {
+ "timeHintTextInTwelveHour": "12:00 AM",
+ "timeHintTextInTwentyFourHour": "12:00"
+ }
+ }
+}
\ No newline at end of file
diff --git a/frontend/app_flowy/assets/translations/pl-PL.json b/frontend/app_flowy/assets/translations/pl-PL.json
new file mode 100644
index 0000000000..0105e7aec7
--- /dev/null
+++ b/frontend/app_flowy/assets/translations/pl-PL.json
@@ -0,0 +1,145 @@
+{
+ "appName": "AppFlowy",
+ "defaultUsername": "Ja",
+ "welcomeText": "Witaj w @:appName",
+ "githubStarText": "Gwiazdka na GitHub-ie",
+ "subscribeNewsletterText": "Zapisz się do naszego Newslettera",
+ "letsGoButtonText": "Start!",
+ "title": "Tytuł",
+ "signUp": {
+ "buttonText": "Zarejestruj",
+ "title": "Zarejestruj się w @:appName",
+ "getStartedText": "Zaczynamy",
+ "emptyPasswordError": "Hasło nie moze być puste",
+ "repeatPasswordEmptyError": "Powtórzone hasło nie moze być puste",
+ "unmatchedPasswordError": "Hasła nie są takie same",
+ "alreadyHaveAnAccount": "Masz juz konto?",
+ "emailHint": "Email",
+ "passwordHint": "Hasło",
+ "repeatPasswordHint": "Powtórz hasło"
+ },
+ "signIn": {
+ "loginTitle": "Zaloguj do @:appName",
+ "loginButtonText": "Logowanie",
+ "buttonText": "Zaloguj",
+ "forgotPassword": "Zapomniałem hasła?",
+ "emailHint": "Email",
+ "passwordHint": "Password",
+ "dontHaveAnAccount": "Nie masz konta?",
+ "repeatPasswordEmptyError": "Powtórzone hasło nie moze być puste",
+ "unmatchedPasswordError": "Hasła nie są takie same"
+ },
+ "workspace": {
+ "create": "Utwórz przestrzeń",
+ "hint": "przestrzeń robocza",
+ "notFoundError": "Przestrzeni nie znaleziono"
+ },
+ "shareAction": {
+ "buttonText": "Udostępnij",
+ "workInProgress": "Wkrótce",
+ "markdown": "Markdown",
+ "copyLink": "Skopiuj link"
+ },
+ "disclosureAction": {
+ "rename": "Zmień nazwę",
+ "delete": "Usuń",
+ "duplicate": "Duplikuj"
+ },
+ "blankPageTitle": "Pusta strona",
+ "newPageText": "Nowa strona",
+ "trash": {
+ "text": "Kosz",
+ "restoreAll": "Przywróć Wszystko",
+ "deleteAll": "Usuń Wszystko",
+ "pageHeader": {
+ "fileName": "Nazwa Pliku",
+ "lastModified": "Ostatnio Zmodyfikowano",
+ "created": "Utworzono"
+ }
+ },
+ "deletePagePrompt": {
+ "text": "Ta strona jest w Koszu",
+ "restore": "Przywróć strone",
+ "deletePermanent": "Usuń bezpowrotnie"
+ },
+ "dialogCreatePageNameHint": "Nazwa Strony",
+ "questionBubble": {
+ "whatsNew": "What's new?",
+ "help": "Pomoc & Wsparcie",
+ "debug": {
+ "name": "Informacje Debugowania",
+ "success": "Skopiowano informacje debugowania do schowka!",
+ "fail": "Nie mozna skopiować informacji debugowania do schowka"
+ }
+ },
+ "menuAppHeader": {
+ "addPageTooltip": "Szybko dodaj stronę do środka",
+ "defaultNewPageName": "Brak tytułu",
+ "renameDialog": "Zmień nazwę"
+ },
+ "toolbar": {
+ "undo": "Cofnij",
+ "redo": "Powtórz",
+ "bold": "Pogrubiony",
+ "italic": "Kursywa",
+ "underline": "Podkreśl",
+ "strike": "Przekreśl",
+ "numList": "Lista Numerowana",
+ "bulletList": "Lista Punktowana",
+ "checkList": "Lista Kontrolna",
+ "inlineCode": "Kod Wbudowany",
+ "quote": "Blok cytat",
+ "header": "Nagłówek",
+ "highlight": "Podświetl"
+ },
+ "tooltip": {
+ "lightMode": "Przełącz w Tryb Jasny",
+ "darkMode": "Przełącz w Tryb Ciemny"
+ },
+ "contactsPage": {
+ "title": "Kontakty",
+ "whatsHappening": "Co się dzieje w tym tygodniu?",
+ "addContact": "Dodaj Kontakt",
+ "editContact": "Edytuj Kontakt"
+ },
+ "button": {
+ "OK": "OK",
+ "Cancel": "Anuluj",
+ "signIn": "Zaloguj",
+ "signOut": "Wyloguj",
+ "complete": "Zakończono",
+ "save": "Zapisz"
+ },
+ "label": {
+ "welcome": "Witaj!",
+ "firstName": "Imię Pierwsze",
+ "middleName": "Imię Drugie",
+ "lastName": "Nazwisko",
+ "stepX": "Krok {X}"
+ },
+ "oAuth": {
+ "err": {
+ "failedTitle": "Nie można połączyć się z Twoim kontem.",
+ "failedMsg": "Upewnij się, że zakończyłeś proces logowania w przeglądarce."
+ },
+ "google": {
+ "title": "LOGOWANIE GOOGLE",
+ "instruction1": "Aby zaimportować Kontakty Google, musisz autoryzować tę aplikację za pomocą przeglądarki internetowej.",
+ "instruction2": "Skopiuj ten kod do schowka, klikając ikonę lub zaznaczając tekst:",
+ "instruction3": "Przejdź do następującego linku w przeglądarce internetowej i wprowadź powyższy kod:",
+ "instruction4": "Naciśnij poniższy przycisk po zakończeniu rejestracji:"
+ }
+ },
+ "settings": {
+ "title": "Ustawienia",
+ "menu": {
+ "appearance": "Wygląd",
+ "language": "Język",
+ "open": "Otwórz Ustawienia"
+ },
+ "appearance": {
+ "lightLabel": "Tryb Jasny",
+ "darkLabel": "Tryb Ciemny"
+ }
+ }
+}
diff --git a/frontend/app_flowy/assets/translations/zh-TW.json b/frontend/app_flowy/assets/translations/zh-TW.json
new file mode 100644
index 0000000000..9f72b90512
--- /dev/null
+++ b/frontend/app_flowy/assets/translations/zh-TW.json
@@ -0,0 +1,218 @@
+{
+ "appName": "AppFlowy",
+ "defaultUsername": "我",
+ "welcomeText": "歡迎使用 @:appName",
+ "githubStarText": "在 GitHub 點星",
+ "subscribeNewsletterText": "訂閱電子報",
+ "letsGoButtonText": "出發吧",
+ "title": "標題",
+ "signUp": {
+ "buttonText": "註冊",
+ "title": "註冊 @:appName",
+ "getStartedText": "開始使用",
+ "emptyPasswordError": "密碼不能為空",
+ "repeatPasswordEmptyError": "確認密碼不能為空",
+ "unmatchedPasswordError": "確認密碼與密碼不符",
+ "alreadyHaveAnAccount": "已經有帳號了嗎?",
+ "emailHint": "電子郵件地址",
+ "passwordHint": "密碼",
+ "repeatPasswordHint": "確認密碼"
+ },
+ "signIn": {
+ "loginTitle": "登入 @:appName",
+ "loginButtonText": "登入",
+ "buttonText": "登入",
+ "forgotPassword": "忘記密碼?",
+ "emailHint": "電子郵件地址",
+ "passwordHint": "密碼",
+ "dontHaveAnAccount": "沒有帳號?",
+ "repeatPasswordEmptyError": "確認密碼不能為空",
+ "unmatchedPasswordError": "確認密碼與密碼不符"
+ },
+ "workspace": {
+ "create": "建立工作區",
+ "hint": "工作區",
+ "notFoundError": "找不到工作區"
+ },
+ "shareAction": {
+ "buttonText": "分享",
+ "workInProgress": "即將推出",
+ "markdown": "Markdown",
+ "copyLink": "複製連結"
+ },
+ "disclosureAction": {
+ "rename": "重新命名",
+ "delete": "刪除",
+ "duplicate": "複製"
+ },
+ "blankPageTitle": "空白頁面",
+ "newPageText": "新頁面",
+ "trash": {
+ "text": "垃圾筒",
+ "restoreAll": "全部復原",
+ "deleteAll": "全部刪除",
+ "pageHeader": {
+ "fileName": "檔案名稱",
+ "lastModified": "最後修改時間",
+ "created": "建立時間"
+ }
+ },
+ "deletePagePrompt": {
+ "text": "此頁面在垃圾筒中",
+ "restore": "復原頁面",
+ "deletePermanent": "永久刪除"
+ },
+ "dialogCreatePageNameHint": "頁面名稱",
+ "questionBubble": {
+ "whatsNew": "新功能",
+ "help": "幫助 & 支援",
+ "debug": {
+ "name": "除錯資訊",
+ "success": "已將除錯資訊複製至剪貼簿!",
+ "fail": "無法將除錯資訊複製至剪貼簿"
+ }
+ },
+ "menuAppHeader": {
+ "addPageTooltip": "快速新增頁面",
+ "defaultNewPageName": "未命名",
+ "renameDialog": "重新命名"
+ },
+ "toolbar": {
+ "undo": "復原",
+ "redo": "取消復原",
+ "bold": "粗體",
+ "italic": "斜體",
+ "underline": "底線",
+ "strike": "刪除線",
+ "numList": "有序清單",
+ "bulletList": "無序清單",
+ "checkList": "核取清單",
+ "inlineCode": "程式碼",
+ "quote": "區塊引言",
+ "header": "標題",
+ "highlight": "反白"
+ },
+ "tooltip": {
+ "lightMode": "切換至亮色模式",
+ "darkMode": "切換至暗色模式"
+ },
+ "notifications": {
+ "export": {
+ "markdown": "已將筆記匯出成 Markdown",
+ "path": "Documents/flowy"
+ }
+ },
+ "contactsPage": {
+ "title": "聯絡人",
+ "whatsHappening": "這周有甚麼新鮮事?",
+ "addContact": "新增聯絡人",
+ "editContact": "編輯聯絡人"
+ },
+ "button": {
+ "OK": "OK",
+ "Cancel": "取消",
+ "signIn": "登入",
+ "signOut": "登出",
+ "complete": "完成",
+ "save": "儲存"
+ },
+ "label": {
+ "welcome": "歡迎!",
+ "firstName": "名",
+ "middleName": "中間名",
+ "lastName": "姓",
+ "stepX": "步驟 {X}"
+ },
+ "oAuth": {
+ "err": {
+ "failedTitle": "無法連接至您的帳號。",
+ "failedMsg": "請確認您已在瀏覽器中完成登入程序:"
+ },
+ "google": {
+ "title": "GOOGLE 登入",
+ "instruction1": "若要匯入您的 Google 聯絡人,您必須透過瀏覽器授權此應用程式:",
+ "instruction2": "點擊圖示或選取文字以複製代碼:",
+ "instruction3": "前往下列網址,並輸入上述代碼:",
+ "instruction4": "完成註冊後,請點擊下方按鈕:"
+ }
+ },
+ "settings": {
+ "title": "設定",
+ "menu": {
+ "appearance": "外觀",
+ "language": "語言",
+ "user": "使用者",
+ "open": "開啟設定"
+ },
+ "appearance": {
+ "lightLabel": "亮色模式",
+ "darkLabel": "暗色模式"
+ }
+ },
+ "grid": {
+ "settings": {
+ "filter": "篩選",
+ "sortBy": "排序方式",
+ "Properties": "內容"
+ },
+ "field": {
+ "hide": "隱藏",
+ "insertLeft": "插入左方欄",
+ "insertRight": "插入右方欄",
+ "duplicate": "複製",
+ "delete": "刪除",
+ "textFieldName": "文字",
+ "checkboxFieldName": "核取方塊",
+ "dateFieldName": "日期",
+ "numberFieldName": "數字",
+ "singleSelectFieldName": "單選",
+ "multiSelectFieldName": "多選",
+ "urlFieldName": "網址",
+ "numberFormat": " 數字格式",
+ "dateFormat": " 日期格式",
+ "includeTime": " 包含時間",
+ "dateFormatFriendly": "月 日,年",
+ "dateFormatISO": "年-月-日",
+ "dateFormatLocal": "年/月/日",
+ "dateFormatUS": "年/月/日",
+ "timeFormat": " 時間格式",
+ "invalidTimeFormat": "格式無效",
+ "timeFormatTwelveHour": "12 小時",
+ "timeFormatTwentyFourHour": "24 小時",
+ "addSelectOption": "新增選項",
+ "optionTitle": "選項",
+ "addOption": "新增選項",
+ "editProperty": "編輯內容"
+ },
+ "row": {
+ "duplicate": "複製",
+ "delete": "刪除",
+ "textPlaceholder": "空",
+ "copyProperty": "已將內容複製至剪貼簿"
+ },
+ "selectOption": {
+ "create": "建立",
+ "purpleColor": "紫色",
+ "pinkColor": "粉色",
+ "lightPinkColor": "淡粉色",
+ "orangeColor": "橘色",
+ "yellowColor": "黃色",
+ "limeColor": "萊姆色",
+ "greenColor": "綠色",
+ "aquaColor": "水藍色",
+ "blueColor": "藍色",
+ "deleteTag": "刪除標籤",
+ "colorPannelTitle": "顏色",
+ "pannelTitle": "搜尋或建立選項",
+ "searchOption": "搜尋選項"
+ },
+ "menuName": "網格"
+ },
+ "document": {
+ "menuName": "檔案",
+ "date": {
+ "timeHintTextInTwelveHour": "12:00 AM",
+ "timeHintTextInTwentyFourHour": "12:00"
+ }
+ }
+}
\ No newline at end of file
diff --git a/frontend/app_flowy/lib/core/grid_notification.dart b/frontend/app_flowy/lib/core/grid_notification.dart
index e45bf5efe2..9a2429a417 100644
--- a/frontend/app_flowy/lib/core/grid_notification.dart
+++ b/frontend/app_flowy/lib/core/grid_notification.dart
@@ -8,7 +8,7 @@ import 'package:flowy_sdk/rust_stream.dart';
import 'notification_helper.dart';
-// Grid
+// GridPB
typedef GridNotificationCallback = void Function(GridNotification, Either);
class GridNotificationParser extends NotificationParser {
diff --git a/frontend/app_flowy/lib/startup/deps_resolver.dart b/frontend/app_flowy/lib/startup/deps_resolver.dart
index 0cf248e7e4..e0ab40eea7 100644
--- a/frontend/app_flowy/lib/startup/deps_resolver.dart
+++ b/frontend/app_flowy/lib/startup/deps_resolver.dart
@@ -5,10 +5,12 @@ import 'package:app_flowy/workspace/application/app/prelude.dart';
import 'package:app_flowy/workspace/application/doc/prelude.dart';
import 'package:app_flowy/workspace/application/grid/prelude.dart';
import 'package:app_flowy/workspace/application/trash/prelude.dart';
+import 'package:app_flowy/workspace/application/user/prelude.dart';
import 'package:app_flowy/workspace/application/workspace/prelude.dart';
import 'package:app_flowy/workspace/application/edit_pannel/edit_pannel_bloc.dart';
import 'package:app_flowy/workspace/application/view/prelude.dart';
import 'package:app_flowy/workspace/application/menu/prelude.dart';
+import 'package:app_flowy/workspace/application/settings/prelude.dart';
import 'package:app_flowy/user/application/prelude.dart';
import 'package:app_flowy/user/presentation/router.dart';
import 'package:app_flowy/workspace/presentation/home/home_stack.dart';
@@ -51,14 +53,14 @@ void _resolveHomeDeps(GetIt getIt) {
getIt.registerSingleton(MenuSharedState());
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(user, _) => UserListener(userProfile: user),
);
//
getIt.registerLazySingleton(() => HomeStackManager());
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(user, _) => WelcomeBloc(
userService: UserService(userId: user.id),
userWorkspaceListener: UserWorkspaceListener(userProfile: user),
@@ -67,21 +69,21 @@ void _resolveHomeDeps(GetIt getIt) {
// share
getIt.registerLazySingleton(() => ShareService());
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(view, _) => DocShareBloc(view: view, service: getIt()));
}
void _resolveFolderDeps(GetIt getIt) {
//workspace
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(user, workspaceId) => WorkspaceListener(user: user, workspaceId: workspaceId));
- // View
- getIt.registerFactoryParam(
+ // ViewPB
+ getIt.registerFactoryParam(
(view, _) => ViewListener(view: view),
);
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(view, _) => ViewBloc(
view: view,
service: ViewService(),
@@ -90,19 +92,29 @@ void _resolveFolderDeps(GetIt getIt) {
);
//Menu
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(user, workspaceId) => MenuBloc(
workspaceId: workspaceId,
listener: getIt(param1: user, param2: workspaceId),
),
);
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(user, _) => MenuUserBloc(user),
);
- // App
- getIt.registerFactoryParam(
+ //Settings
+ getIt.registerFactoryParam(
+ (user, _) => SettingsDialogBloc(user),
+ );
+
+ //User
+ getIt.registerFactoryParam(
+ (user, _) => SettingsUserViewBloc(user),
+ );
+
+ // AppPB
+ getIt.registerFactoryParam(
(app, _) => AppBloc(
app: app,
appService: AppService(appId: app.id),
@@ -123,7 +135,7 @@ void _resolveFolderDeps(GetIt getIt) {
void _resolveDocDeps(GetIt getIt) {
// Doc
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(view, _) => DocumentBloc(
view: view,
service: DocumentService(),
@@ -134,8 +146,8 @@ void _resolveDocDeps(GetIt getIt) {
}
void _resolveGridDeps(GetIt getIt) {
- // Grid
- getIt.registerFactoryParam(
+ // GridPB
+ getIt.registerFactoryParam(
(view, _) => GridBloc(view: view),
);
@@ -153,31 +165,31 @@ void _resolveGridDeps(GetIt getIt) {
),
);
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(context, _) => TextCellBloc(
cellContext: context,
),
);
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(context, _) => SelectOptionCellBloc(
cellContext: context,
),
);
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(context, _) => NumberCellBloc(
cellContext: context,
),
);
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(context, _) => DateCellBloc(
cellContext: context,
),
);
- getIt.registerFactoryParam(
+ getIt.registerFactoryParam(
(cellData, _) => CheckboxCellBloc(
service: CellService(),
cellContext: cellData,
diff --git a/frontend/app_flowy/lib/startup/tasks/app_widget.dart b/frontend/app_flowy/lib/startup/tasks/app_widget.dart
index c8addc9d6f..6dae04a1c0 100644
--- a/frontend/app_flowy/lib/startup/tasks/app_widget.dart
+++ b/frontend/app_flowy/lib/startup/tasks/app_widget.dart
@@ -36,8 +36,10 @@ class InitAppWidgetTask extends LaunchTask {
Locale('fr', 'FR'),
Locale('fr', 'CA'),
Locale('hu', 'HU'),
+ Locale('id', 'ID'),
Locale('it', 'IT'),
Locale('ja', 'JP'),
+ Locale('pl', 'PL'),
Locale('pt', 'BR'),
Locale('ru', 'RU'),
Locale('tr', 'TR'),
diff --git a/frontend/app_flowy/lib/user/application/auth_service.dart b/frontend/app_flowy/lib/user/application/auth_service.dart
index 28f7dc5d0e..c2ce625ccf 100644
--- a/frontend/app_flowy/lib/user/application/auth_service.dart
+++ b/frontend/app_flowy/lib/user/application/auth_service.dart
@@ -1,21 +1,21 @@
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
-import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show SignInPayload, SignUpPayload, UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show SignInPayloadPB, SignUpPayloadPB, UserProfilePB;
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
class AuthService {
- Future> signIn({required String? email, required String? password}) {
+ Future> signIn({required String? email, required String? password}) {
//
- final request = SignInPayload.create()
+ final request = SignInPayloadPB.create()
..email = email ?? ''
..password = password ?? '';
return UserEventSignIn(request).send();
}
- Future> signUp(
+ Future> signUp(
{required String? name, required String? password, required String? email}) {
- final request = SignUpPayload.create()
+ final request = SignUpPayloadPB.create()
..email = email ?? ''
..name = name ?? ''
..password = password ?? '';
diff --git a/frontend/app_flowy/lib/user/application/sign_in_bloc.dart b/frontend/app_flowy/lib/user/application/sign_in_bloc.dart
index 45b6ee1eb5..1b5838d9c4 100644
--- a/frontend/app_flowy/lib/user/application/sign_in_bloc.dart
+++ b/frontend/app_flowy/lib/user/application/sign_in_bloc.dart
@@ -2,7 +2,7 @@ import 'package:app_flowy/user/application/auth_service.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-error-code/code.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
-import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfilePB;
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -69,7 +69,7 @@ class SignInState with _$SignInState {
required bool isSubmitting,
required Option passwordError,
required Option emailError,
- required Option> successOrFail,
+ required Option> successOrFail,
}) = _SignInState;
factory SignInState.initial() => SignInState(
diff --git a/frontend/app_flowy/lib/user/application/sign_up_bloc.dart b/frontend/app_flowy/lib/user/application/sign_up_bloc.dart
index b94a02bf09..0c103fd4d7 100644
--- a/frontend/app_flowy/lib/user/application/sign_up_bloc.dart
+++ b/frontend/app_flowy/lib/user/application/sign_up_bloc.dart
@@ -2,7 +2,7 @@ import 'package:app_flowy/user/application/auth_service.dart';
import 'package:dartz/dartz.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_sdk/protobuf/flowy-error-code/code.pb.dart';
-import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfilePB;
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -120,7 +120,7 @@ class SignUpState with _$SignUpState {
required Option passwordError,
required Option repeatPasswordError,
required Option emailError,
- required Option> successOrFail,
+ required Option> successOrFail,
}) = _SignUpState;
factory SignUpState.initial() => SignUpState(
diff --git a/frontend/app_flowy/lib/user/application/user_listener.dart b/frontend/app_flowy/lib/user/application/user_listener.dart
index 89fc393e2d..5483926e71 100644
--- a/frontend/app_flowy/lib/user/application/user_listener.dart
+++ b/frontend/app_flowy/lib/user/application/user_listener.dart
@@ -13,7 +13,7 @@ import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/dart_notification.pb.dart' as user;
import 'package:flowy_sdk/rust_stream.dart';
-typedef UserProfileNotifyValue = Either;
+typedef UserProfileNotifyValue = Either;
typedef AuthNotifyValue = Either;
class UserListener {
@@ -22,9 +22,9 @@ class UserListener {
PublishNotifier? _profileNotifier = PublishNotifier();
UserNotificationParser? _userParser;
- final UserProfile _userProfile;
+ final UserProfilePB _userProfile;
UserListener({
- required UserProfile userProfile,
+ required UserProfilePB userProfile,
}) : _userProfile = userProfile;
void start({
@@ -65,7 +65,7 @@ class UserListener {
break;
case user.UserNotification.UserProfileUpdated:
result.fold(
- (payload) => _profileNotifier?.value = left(UserProfile.fromBuffer(payload)),
+ (payload) => _profileNotifier?.value = left(UserProfilePB.fromBuffer(payload)),
(error) => _profileNotifier?.value = right(error),
);
break;
@@ -75,8 +75,8 @@ class UserListener {
}
}
-typedef WorkspaceListNotifyValue = Either, FlowyError>;
-typedef WorkspaceSettingNotifyValue = Either;
+typedef WorkspaceListNotifyValue = Either, FlowyError>;
+typedef WorkspaceSettingNotifyValue = Either;
class UserWorkspaceListener {
PublishNotifier? _authNotifier = PublishNotifier();
@@ -84,10 +84,10 @@ class UserWorkspaceListener {
PublishNotifier? _settingChangedNotifier = PublishNotifier();
FolderNotificationListener? _listener;
- final UserProfile _userProfile;
+ final UserProfilePB _userProfile;
UserWorkspaceListener({
- required UserProfile userProfile,
+ required UserProfilePB userProfile,
}) : _userProfile = userProfile;
void start({
@@ -119,13 +119,13 @@ class UserWorkspaceListener {
case FolderNotification.UserDeleteWorkspace:
case FolderNotification.WorkspaceListUpdated:
result.fold(
- (payload) => _workspacesChangedNotifier?.value = left(RepeatedWorkspace.fromBuffer(payload).items),
+ (payload) => _workspacesChangedNotifier?.value = left(RepeatedWorkspacePB.fromBuffer(payload).items),
(error) => _workspacesChangedNotifier?.value = right(error),
);
break;
case FolderNotification.WorkspaceSetting:
result.fold(
- (payload) => _settingChangedNotifier?.value = left(CurrentWorkspaceSetting.fromBuffer(payload)),
+ (payload) => _settingChangedNotifier?.value = left(CurrentWorkspaceSettingPB.fromBuffer(payload)),
(error) => _settingChangedNotifier?.value = right(error),
);
break;
diff --git a/frontend/app_flowy/lib/user/application/user_service.dart b/frontend/app_flowy/lib/user/application/user_service.dart
index 8417a069f9..48bea6aa41 100644
--- a/frontend/app_flowy/lib/user/application/user_service.dart
+++ b/frontend/app_flowy/lib/user/application/user_service.dart
@@ -11,7 +11,7 @@ class UserService {
UserService({
required this.userId,
});
- Future> getUserProfile({required String userId}) {
+ Future> getUserProfile({required String userId}) {
return UserEventGetUserProfile().send();
}
@@ -20,7 +20,7 @@ class UserService {
String? password,
String? email,
}) {
- var payload = UpdateUserProfilePayload.create()..id = userId;
+ var payload = UpdateUserProfilePayloadPB.create()..id = userId;
if (name != null) {
payload.name = name;
@@ -49,8 +49,8 @@ class UserService {
return UserEventInitUser().send();
}
- Future, FlowyError>> getWorkspaces() {
- final request = WorkspaceId.create();
+ Future, FlowyError>> getWorkspaces() {
+ final request = WorkspaceIdPB.create();
return FolderEventReadWorkspaces(request).send().then((result) {
return result.fold(
@@ -60,8 +60,8 @@ class UserService {
});
}
- Future> openWorkspace(String workspaceId) {
- final request = WorkspaceId.create()..value = workspaceId;
+ Future> openWorkspace(String workspaceId) {
+ final request = WorkspaceIdPB.create()..value = workspaceId;
return FolderEventOpenWorkspace(request).send().then((result) {
return result.fold(
(workspace) => left(workspace),
@@ -70,8 +70,8 @@ class UserService {
});
}
- Future> createWorkspace(String name, String desc) {
- final request = CreateWorkspacePayload.create()
+ Future> createWorkspace(String name, String desc) {
+ final request = CreateWorkspacePayloadPB.create()
..name = name
..desc = desc;
return FolderEventCreateWorkspace(request).send().then((result) {
diff --git a/frontend/app_flowy/lib/user/application/user_settings_service.dart b/frontend/app_flowy/lib/user/application/user_settings_service.dart
index eb93ab150d..28309d202c 100644
--- a/frontend/app_flowy/lib/user/application/user_settings_service.dart
+++ b/frontend/app_flowy/lib/user/application/user_settings_service.dart
@@ -5,11 +5,11 @@ import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_setting.pb.dart';
class UserSettingsService {
- Future getAppearanceSettings() async {
+ Future getAppearanceSettings() async {
final result = await UserEventGetAppearanceSetting().send();
return result.fold(
- (AppearanceSettings setting) {
+ (AppearanceSettingsPB setting) {
return setting;
},
(error) {
@@ -18,7 +18,7 @@ class UserSettingsService {
);
}
- Future> setAppearanceSettings(AppearanceSettings settings) {
+ Future> setAppearanceSettings(AppearanceSettingsPB settings) {
return UserEventSetAppearanceSetting(settings).send();
}
}
diff --git a/frontend/app_flowy/lib/user/domain/auth_state.dart b/frontend/app_flowy/lib/user/domain/auth_state.dart
index e2d3a33b09..ae0c259573 100644
--- a/frontend/app_flowy/lib/user/domain/auth_state.dart
+++ b/frontend/app_flowy/lib/user/domain/auth_state.dart
@@ -1,11 +1,11 @@
-import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfilePB;
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'auth_state.freezed.dart';
@freezed
class AuthState with _$AuthState {
- const factory AuthState.authenticated(UserProfile userProfile) = Authenticated;
+ const factory AuthState.authenticated(UserProfilePB userProfile) = Authenticated;
const factory AuthState.unauthenticated(FlowyError error) = Unauthenticated;
const factory AuthState.initial() = _Initial;
}
diff --git a/frontend/app_flowy/lib/user/presentation/router.dart b/frontend/app_flowy/lib/user/presentation/router.dart
index 3bcfa11502..2928154ebe 100644
--- a/frontend/app_flowy/lib/user/presentation/router.dart
+++ b/frontend/app_flowy/lib/user/presentation/router.dart
@@ -7,7 +7,7 @@ import 'package:app_flowy/user/presentation/welcome_screen.dart';
import 'package:app_flowy/workspace/presentation/home/home_screen.dart';
import 'package:flowy_infra/time/duration.dart';
import 'package:flowy_infra_ui/widget/route/animation.dart';
-import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfilePB;
import 'package:flowy_sdk/protobuf/flowy-folder/protobuf.dart';
import 'package:flutter/material.dart';
@@ -16,7 +16,7 @@ class AuthRouter {
// TODO: implement showForgetPasswordScreen
}
- void pushWelcomeScreen(BuildContext context, UserProfile userProfile) {
+ void pushWelcomeScreen(BuildContext context, UserProfilePB userProfile) {
getIt().pushWelcomeScreen(context, userProfile);
}
@@ -28,7 +28,7 @@ class AuthRouter {
);
}
- void pushHomeScreen(BuildContext context, UserProfile profile, CurrentWorkspaceSetting workspaceSetting) {
+ void pushHomeScreen(BuildContext context, UserProfilePB profile, CurrentWorkspaceSettingPB workspaceSetting) {
Navigator.push(
context,
PageRoutes.fade(() => HomeScreen(profile, workspaceSetting), RouteDurations.slow.inMilliseconds * .001),
@@ -37,7 +37,7 @@ class AuthRouter {
}
class SplashRoute {
- Future pushWelcomeScreen(BuildContext context, UserProfile userProfile) async {
+ Future pushWelcomeScreen(BuildContext context, UserProfilePB userProfile) async {
final screen = WelcomeScreen(userProfile: userProfile);
final workspaceId = await Navigator.of(context).push(
PageRoutes.fade(
@@ -49,7 +49,7 @@ class SplashRoute {
pushHomeScreen(context, userProfile, workspaceId);
}
- void pushHomeScreen(BuildContext context, UserProfile userProfile, CurrentWorkspaceSetting workspaceSetting) {
+ void pushHomeScreen(BuildContext context, UserProfilePB userProfile, CurrentWorkspaceSettingPB workspaceSetting) {
Navigator.push(
context,
PageRoutes.fade(() => HomeScreen(userProfile, workspaceSetting), RouteDurations.slow.inMilliseconds * .001),
diff --git a/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart b/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart
index baa8ef0ccb..ee3600e782 100644
--- a/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart
+++ b/frontend/app_flowy/lib/user/presentation/sign_in_screen.dart
@@ -10,7 +10,7 @@ import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_infra_ui/style_widget/snap_bar.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
-import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfilePB;
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dartz/dartz.dart';
@@ -39,7 +39,7 @@ class SignInScreen extends StatelessWidget {
);
}
- void _handleSuccessOrFail(Either result, BuildContext context) {
+ void _handleSuccessOrFail(Either result, BuildContext context) {
result.fold(
(user) => router.pushWelcomeScreen(context, user),
(error) => showSnapBar(context, error.msg),
diff --git a/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart b/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart
index 6a0b8f1d85..d0cb7f8b90 100644
--- a/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart
+++ b/frontend/app_flowy/lib/user/presentation/sign_up_screen.dart
@@ -8,7 +8,7 @@ import 'package:flowy_infra_ui/widget/rounded_button.dart';
import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
-import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfilePB;
import 'package:flowy_infra_ui/style_widget/snap_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -36,7 +36,7 @@ class SignUpScreen extends StatelessWidget {
);
}
- void _handleSuccessOrFail(BuildContext context, Either result) {
+ void _handleSuccessOrFail(BuildContext context, Either result) {
result.fold(
(user) => router.pushWelcomeScreen(context, user),
(error) => showSnapBar(context, error.msg),
diff --git a/frontend/app_flowy/lib/user/presentation/skip_log_in_screen.dart b/frontend/app_flowy/lib/user/presentation/skip_log_in_screen.dart
index c8fb9ba06b..6e3ae5ea52 100644
--- a/frontend/app_flowy/lib/user/presentation/skip_log_in_screen.dart
+++ b/frontend/app_flowy/lib/user/presentation/skip_log_in_screen.dart
@@ -116,8 +116,8 @@ class _SkipLogInScreenState extends State {
void _openCurrentWorkspace(
BuildContext context,
- UserProfile user,
- dartz.Either workspacesOrError,
+ UserProfilePB user,
+ dartz.Either workspacesOrError,
) {
workspacesOrError.fold(
(workspaceSetting) {
diff --git a/frontend/app_flowy/lib/user/presentation/welcome_screen.dart b/frontend/app_flowy/lib/user/presentation/welcome_screen.dart
index 60ec3bf8a2..31b06d8bd1 100644
--- a/frontend/app_flowy/lib/user/presentation/welcome_screen.dart
+++ b/frontend/app_flowy/lib/user/presentation/welcome_screen.dart
@@ -12,7 +12,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:app_flowy/generated/locale_keys.g.dart';
class WelcomeScreen extends StatelessWidget {
- final UserProfile userProfile;
+ final UserProfilePB userProfile;
const WelcomeScreen({
Key? key,
required this.userProfile,
@@ -65,7 +65,7 @@ class WelcomeScreen extends StatelessWidget {
);
}
- Widget _renderList(List workspaces) {
+ Widget _renderList(List workspaces) {
return Expanded(
child: StyledListView(
itemBuilder: (BuildContext context, int index) {
@@ -80,7 +80,7 @@ class WelcomeScreen extends StatelessWidget {
);
}
- void _handleOnPress(BuildContext context, Workspace workspace) {
+ void _handleOnPress(BuildContext context, WorkspacePB workspace) {
context.read().add(WelcomeEvent.openWorkspace(workspace));
Navigator.of(context).pop(workspace.id);
@@ -88,8 +88,8 @@ class WelcomeScreen extends StatelessWidget {
}
class WorkspaceItem extends StatelessWidget {
- final Workspace workspace;
- final void Function(Workspace workspace) onPressed;
+ final WorkspacePB workspace;
+ final void Function(WorkspacePB workspace) onPressed;
const WorkspaceItem({Key? key, required this.workspace, required this.onPressed}) : super(key: key);
@override
diff --git a/frontend/app_flowy/lib/workspace/application/app/app_bloc.dart b/frontend/app_flowy/lib/workspace/application/app/app_bloc.dart
index 18f93abd6f..e8d2335168 100644
--- a/frontend/app_flowy/lib/workspace/application/app/app_bloc.dart
+++ b/frontend/app_flowy/lib/workspace/application/app/app_bloc.dart
@@ -18,7 +18,7 @@ import 'package:dartz/dartz.dart';
part 'app_bloc.freezed.dart';
class AppBloc extends Bloc {
- final App app;
+ final AppPB app;
final AppService appService;
final AppListener appListener;
@@ -103,7 +103,7 @@ class AppBloc extends Bloc {
return super.close();
}
- Future _didReceiveViewUpdated(List views, Emitter emit) async {
+ Future _didReceiveViewUpdated(List views, Emitter emit) async {
final latestCreatedView = state.latestCreatedView;
AppState newState = state.copyWith(views: views);
if (latestCreatedView != null) {
@@ -139,20 +139,20 @@ class AppEvent with _$AppEvent {
) = CreateView;
const factory AppEvent.delete() = Delete;
const factory AppEvent.rename(String newName) = Rename;
- const factory AppEvent.didReceiveViewUpdated(List views) = ReceiveViews;
- const factory AppEvent.appDidUpdate(App app) = AppDidUpdate;
+ const factory AppEvent.didReceiveViewUpdated(List views) = ReceiveViews;
+ const factory AppEvent.appDidUpdate(AppPB app) = AppDidUpdate;
}
@freezed
class AppState with _$AppState {
const factory AppState({
- required App app,
- required List views,
- View? latestCreatedView,
+ required AppPB app,
+ required List views,
+ ViewPB? latestCreatedView,
required Either successOrFailure,
}) = _AppState;
- factory AppState.initial(App app) => AppState(
+ factory AppState.initial(AppPB app) => AppState(
app: app,
views: [],
successOrFailure: left(unit),
@@ -161,8 +161,8 @@ class AppState with _$AppState {
class AppViewDataContext extends ChangeNotifier {
final String appId;
- final ValueNotifier> _viewsNotifier = ValueNotifier([]);
- final ValueNotifier _selectedViewNotifier = ValueNotifier(null);
+ final ValueNotifier> _viewsNotifier = ValueNotifier([]);
+ final ValueNotifier _selectedViewNotifier = ValueNotifier(null);
VoidCallback? _menuSharedStateListener;
ExpandableController expandController = ExpandableController(initialExpanded: false);
@@ -173,7 +173,7 @@ class AppViewDataContext extends ChangeNotifier {
});
}
- VoidCallback addSelectedViewChangeListener(void Function(View?) callback) {
+ VoidCallback addSelectedViewChangeListener(void Function(ViewPB?) callback) {
listener() {
callback(_selectedViewNotifier.value);
}
@@ -186,7 +186,7 @@ class AppViewDataContext extends ChangeNotifier {
_selectedViewNotifier.removeListener(listener);
}
- void _setLatestView(View? view) {
+ void _setLatestView(ViewPB? view) {
view?.freeze();
if (_selectedViewNotifier.value != view) {
@@ -196,9 +196,9 @@ class AppViewDataContext extends ChangeNotifier {
}
}
- View? get selectedView => _selectedViewNotifier.value;
+ ViewPB? get selectedView => _selectedViewNotifier.value;
- set views(List views) {
+ set views(List views) {
if (_viewsNotifier.value != views) {
_viewsNotifier.value = views;
_expandIfNeed();
@@ -206,9 +206,9 @@ class AppViewDataContext extends ChangeNotifier {
}
}
- UnmodifiableListView get views => UnmodifiableListView(_viewsNotifier.value);
+ UnmodifiableListView get views => UnmodifiableListView(_viewsNotifier.value);
- VoidCallback addViewsChangeListener(void Function(UnmodifiableListView) callback) {
+ VoidCallback addViewsChangeListener(void Function(UnmodifiableListView) callback) {
listener() {
callback(views);
}
diff --git a/frontend/app_flowy/lib/workspace/application/app/app_listener.dart b/frontend/app_flowy/lib/workspace/application/app/app_listener.dart
index 6a30b270af..6edf1a4df2 100644
--- a/frontend/app_flowy/lib/workspace/application/app/app_listener.dart
+++ b/frontend/app_flowy/lib/workspace/application/app/app_listener.dart
@@ -10,8 +10,8 @@ import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/dart_notification.pb.dart';
import 'package:flowy_sdk/rust_stream.dart';
-typedef AppDidUpdateCallback = void Function(App app);
-typedef ViewsDidChangeCallback = void Function(Either, FlowyError> viewsOrFailed);
+typedef AppDidUpdateCallback = void Function(AppPB app);
+typedef ViewsDidChangeCallback = void Function(Either, FlowyError> viewsOrFailed);
class AppListener {
StreamSubscription? _subscription;
@@ -37,7 +37,7 @@ class AppListener {
if (_viewsChanged != null) {
result.fold(
(payload) {
- final repeatedView = RepeatedView.fromBuffer(payload);
+ final repeatedView = RepeatedViewPB.fromBuffer(payload);
_viewsChanged!(left(repeatedView.items));
},
(error) => _viewsChanged!(right(error)),
@@ -48,7 +48,7 @@ class AppListener {
if (_updated != null) {
result.fold(
(payload) {
- final app = App.fromBuffer(payload);
+ final app = AppPB.fromBuffer(payload);
_updated!(app);
},
(error) => Log.error(error),
diff --git a/frontend/app_flowy/lib/workspace/application/app/app_service.dart b/frontend/app_flowy/lib/workspace/application/app/app_service.dart
index 51513a4032..cc75751e49 100644
--- a/frontend/app_flowy/lib/workspace/application/app/app_service.dart
+++ b/frontend/app_flowy/lib/workspace/application/app/app_service.dart
@@ -14,20 +14,20 @@ class AppService {
required this.appId,
});
- Future> getAppDesc({required String appId}) {
- final payload = AppId.create()..value = appId;
+ Future> getAppDesc({required String appId}) {
+ final payload = AppIdPB.create()..value = appId;
return FolderEventReadApp(payload).send();
}
- Future> createView({
+ Future> createView({
required String appId,
required String name,
required String desc,
required PluginDataType dataType,
required PluginType pluginType,
}) {
- final payload = CreateViewPayload.create()
+ final payload = CreateViewPayloadPB.create()
..belongToId = appId
..name = name
..desc = desc
@@ -37,8 +37,8 @@ class AppService {
return FolderEventCreateView(payload).send();
}
- Future, FlowyError>> getViews({required String appId}) {
- final payload = AppId.create()..value = appId;
+ Future, FlowyError>> getViews({required String appId}) {
+ final payload = AppIdPB.create()..value = appId;
return FolderEventReadApp(payload).send().then((result) {
return result.fold(
@@ -49,12 +49,12 @@ class AppService {
}
Future> delete({required String appId}) {
- final request = AppId.create()..value = appId;
+ final request = AppIdPB.create()..value = appId;
return FolderEventDeleteApp(request).send();
}
Future> updateApp({required String appId, String? name}) {
- UpdateAppPayload payload = UpdateAppPayload.create()..appId = appId;
+ UpdateAppPayloadPB payload = UpdateAppPayloadPB.create()..appId = appId;
if (name != null) {
payload.name = name;
@@ -67,7 +67,7 @@ class AppService {
required int fromIndex,
required int toIndex,
}) {
- final payload = MoveFolderItemPayload.create()
+ final payload = MoveFolderItemPayloadPB.create()
..itemId = viewId
..from = fromIndex
..to = toIndex
diff --git a/frontend/app_flowy/lib/workspace/application/appearance.dart b/frontend/app_flowy/lib/workspace/application/appearance.dart
index f3ff7801ce..0e47fa2be6 100644
--- a/frontend/app_flowy/lib/workspace/application/appearance.dart
+++ b/frontend/app_flowy/lib/workspace/application/appearance.dart
@@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
class AppearanceSettingModel extends ChangeNotifier with EquatableMixin {
- AppearanceSettings setting;
+ AppearanceSettingsPB setting;
AppTheme _theme;
Locale _locale;
Timer? _saveOperation;
diff --git a/frontend/app_flowy/lib/workspace/application/doc/doc_bloc.dart b/frontend/app_flowy/lib/workspace/application/doc/doc_bloc.dart
index 1c77fa1cbd..8be4c40d85 100644
--- a/frontend/app_flowy/lib/workspace/application/doc/doc_bloc.dart
+++ b/frontend/app_flowy/lib/workspace/application/doc/doc_bloc.dart
@@ -17,7 +17,7 @@ part 'doc_bloc.freezed.dart';
typedef FlutterQuillDocument = Document;
class DocumentBloc extends Bloc {
- final View view;
+ final ViewPB view;
final DocumentService service;
final ViewListener listener;
diff --git a/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart b/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart
index 992dfdeb63..659a99e371 100644
--- a/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart
+++ b/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart
@@ -6,24 +6,24 @@ import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-sync/text_block.pb.dart';
class DocumentService {
- Future> openDocument({
+ Future> openDocument({
required String docId,
}) async {
- await FolderEventSetLatestView(ViewId(value: docId)).send();
+ await FolderEventSetLatestView(ViewIdPB(value: docId)).send();
- final payload = TextBlockId(value: docId);
+ final payload = TextBlockIdPB(value: docId);
return TextBlockEventGetBlockData(payload).send();
}
- Future> composeDelta({required String docId, required String data}) {
- final payload = TextBlockDelta.create()
+ Future> composeDelta({required String docId, required String data}) {
+ final payload = TextBlockDeltaPB.create()
..blockId = docId
..deltaStr = data;
return TextBlockEventApplyDelta(payload).send();
}
Future> closeDocument({required String docId}) {
- final request = ViewId(value: docId);
+ final request = ViewIdPB(value: docId);
return FolderEventCloseView(request).send();
}
}
diff --git a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
index 90c041eb75..ba3c7676c6 100644
--- a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
+++ b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
@@ -13,7 +13,7 @@ part 'share_bloc.freezed.dart';
class DocShareBloc extends Bloc {
ShareService service;
- View view;
+ ViewPB view;
DocShareBloc({required this.view, required this.service}) : super(const DocShareState.initial()) {
on((event, emit) async {
await event.map(
@@ -33,7 +33,7 @@ class DocShareBloc extends Bloc {
});
}
- ExportData _convertDeltaToMarkdown(ExportData value) {
+ ExportDataPB _convertDeltaToMarkdown(ExportDataPB value) {
final result = deltaToMarkdown(value.data);
value.data = result;
writeFile(result);
@@ -73,5 +73,5 @@ class DocShareEvent with _$DocShareEvent {
class DocShareState with _$DocShareState {
const factory DocShareState.initial() = _Initial;
const factory DocShareState.loading() = _Loading;
- const factory DocShareState.finish(Either successOrFail) = _Finish;
+ const factory DocShareState.finish(Either successOrFail) = _Finish;
}
diff --git a/frontend/app_flowy/lib/workspace/application/doc/share_service.dart b/frontend/app_flowy/lib/workspace/application/doc/share_service.dart
index 7e5545f109..db6ad406b7 100644
--- a/frontend/app_flowy/lib/workspace/application/doc/share_service.dart
+++ b/frontend/app_flowy/lib/workspace/application/doc/share_service.dart
@@ -5,23 +5,23 @@ import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-text-block/protobuf.dart';
class ShareService {
- Future> export(String docId, ExportType type) {
- final request = ExportPayload.create()
+ Future> export(String docId, ExportType type) {
+ final request = ExportPayloadPB.create()
..viewId = docId
..exportType = type;
return TextBlockEventExportDocument(request).send();
}
- Future> exportText(String docId) {
+ Future> exportText(String docId) {
return export(docId, ExportType.Text);
}
- Future> exportMarkdown(String docId) {
+ Future> exportMarkdown(String docId) {
return export(docId, ExportType.Markdown);
}
- Future> exportURL(String docId) {
+ Future> exportURL(String docId) {
return export(docId, ExportType.Link);
}
}
diff --git a/frontend/app_flowy/lib/workspace/application/grid/block/block_service.dart b/frontend/app_flowy/lib/workspace/application/grid/block/block_cache.dart
similarity index 73%
rename from frontend/app_flowy/lib/workspace/application/grid/block/block_service.dart
rename to frontend/app_flowy/lib/workspace/application/grid/block/block_cache.dart
index 3fb734db70..3c99c0e0e1 100644
--- a/frontend/app_flowy/lib/workspace/application/grid/block/block_service.dart
+++ b/frontend/app_flowy/lib/workspace/application/grid/block/block_cache.dart
@@ -6,24 +6,25 @@ import 'package:flowy_sdk/protobuf/flowy-grid/block_entities.pb.dart';
import 'block_listener.dart';
-class GridBlockCacheService {
+/// Read https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/architecture/frontend/grid for more information
+class GridBlockCache {
final String gridId;
- final GridBlock block;
- late GridRowCacheService _rowCache;
+ final GridBlockPB block;
+ late GridRowCache _rowCache;
late GridBlockListener _listener;
- List get rows => _rowCache.rows;
- GridRowCacheService get rowCache => _rowCache;
+ List get rows => _rowCache.rows;
+ GridRowCache get rowCache => _rowCache;
- GridBlockCacheService({
+ GridBlockCache({
required this.gridId,
required this.block,
required GridFieldCache fieldCache,
}) {
- _rowCache = GridRowCacheService(
+ _rowCache = GridRowCache(
gridId: gridId,
block: block,
- delegate: GridRowCacheDelegateImpl(fieldCache),
+ notifier: GridRowCacheFieldNotifierImpl(fieldCache),
);
_listener = GridBlockListener(blockId: block.id);
diff --git a/frontend/app_flowy/lib/workspace/application/grid/block/block_listener.dart b/frontend/app_flowy/lib/workspace/application/grid/block/block_listener.dart
index 7a2bbe0cb3..91f93c61fe 100644
--- a/frontend/app_flowy/lib/workspace/application/grid/block/block_listener.dart
+++ b/frontend/app_flowy/lib/workspace/application/grid/block/block_listener.dart
@@ -7,7 +7,7 @@ import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid/block_entities.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid/dart_notification.pb.dart';
-typedef GridBlockUpdateNotifierValue = Either, FlowyError>;
+typedef GridBlockUpdateNotifierValue = Either, FlowyError>;
class GridBlockListener {
final String blockId;
@@ -33,7 +33,7 @@ class GridBlockListener {
switch (ty) {
case GridNotification.DidUpdateGridBlock:
result.fold(
- (payload) => _rowsUpdateNotifier?.value = left([GridBlockChangeset.fromBuffer(payload)]),
+ (payload) => _rowsUpdateNotifier?.value = left([GridBlockChangesetPB.fromBuffer(payload)]),
(error) => _rowsUpdateNotifier?.value = right(error),
);
break;
diff --git a/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cache.dart b/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cache.dart
deleted file mode 100644
index ccf47fddb3..0000000000
--- a/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cache.dart
+++ /dev/null
@@ -1,109 +0,0 @@
-part of 'cell_service.dart';
-
-typedef GridCellMap = LinkedHashMap;
-
-class _GridCellCacheObject {
- _GridCellCacheKey key;
- dynamic object;
- _GridCellCacheObject({
- required this.key,
- required this.object,
- });
-}
-
-class _GridCellCacheKey {
- final String fieldId;
- final String rowId;
- _GridCellCacheKey({
- required this.fieldId,
- required this.rowId,
- });
-}
-
-abstract class GridCellCacheDelegate {
- void onFieldUpdated(void Function(Field) callback);
-}
-
-class GridCellCacheService {
- final String gridId;
- final GridCellCacheDelegate delegate;
-
- /// fieldId: {objectId: callback}
- final Map>> _fieldListenerByFieldId = {};
-
- /// fieldId: {cacheKey: cacheData}
- final Map> _cellDataByFieldId = {};
- GridCellCacheService({
- required this.gridId,
- required this.delegate,
- }) {
- delegate.onFieldUpdated((field) {
- _cellDataByFieldId.remove(field.id);
- final map = _fieldListenerByFieldId[field.id];
- if (map != null) {
- for (final callbacks in map.values) {
- for (final callback in callbacks) {
- callback();
- }
- }
- }
- });
- }
-
- void addFieldListener(_GridCellCacheKey cacheKey, VoidCallback onFieldChanged) {
- var map = _fieldListenerByFieldId[cacheKey.fieldId];
- if (map == null) {
- _fieldListenerByFieldId[cacheKey.fieldId] = {};
- map = _fieldListenerByFieldId[cacheKey.fieldId];
- map![cacheKey.rowId] = [onFieldChanged];
- } else {
- var objects = map[cacheKey.rowId];
- if (objects == null) {
- map[cacheKey.rowId] = [onFieldChanged];
- } else {
- objects.add(onFieldChanged);
- }
- }
- }
-
- void removeFieldListener(_GridCellCacheKey cacheKey, VoidCallback fn) {
- var callbacks = _fieldListenerByFieldId[cacheKey.fieldId]?[cacheKey.rowId];
- final index = callbacks?.indexWhere((callback) => callback == fn);
- if (index != null && index != -1) {
- callbacks?.removeAt(index);
- }
- }
-
- void insert(T item) {
- var map = _cellDataByFieldId[item.key.fieldId];
- if (map == null) {
- _cellDataByFieldId[item.key.fieldId] = {};
- map = _cellDataByFieldId[item.key.fieldId];
- }
-
- map![item.key.rowId] = item.object;
- }
-
- T? get(_GridCellCacheKey key) {
- final map = _cellDataByFieldId[key.fieldId];
- if (map == null) {
- return null;
- } else {
- final object = map[key.rowId];
- if (object is T) {
- return object;
- } else {
- if (object != null) {
- Log.error("Cache data type does not match the cache data type");
- }
-
- return null;
- }
- }
- }
-
- Future dispose() async {
- _fieldListenerByFieldId.clear();
- _cellDataByFieldId.clear();
- }
-}
diff --git a/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_cache.dart b/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_cache.dart
new file mode 100644
index 0000000000..1f14c7c54a
--- /dev/null
+++ b/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_cache.dart
@@ -0,0 +1,70 @@
+part of 'cell_service.dart';
+
+typedef GridCellMap = LinkedHashMap;
+
+class GridCell {
+ dynamic object;
+ GridCell({
+ required this.object,
+ });
+}
+
+/// Use to index the cell in the grid.
+/// We use [fieldId + rowId] to identify the cell.
+class GridCellCacheKey {
+ final String fieldId;
+ final String rowId;
+ GridCellCacheKey({
+ required this.fieldId,
+ required this.rowId,
+ });
+}
+
+/// GridCellCache is used to cache cell data of each block.
+/// We use GridCellCacheKey to index the cell in the cache.
+/// Read https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/architecture/frontend/grid
+/// for more information
+class GridCellCache {
+ final String gridId;
+
+ /// fieldId: {cacheKey: GridCell}
+ final Map> _cellDataByFieldId = {};
+ GridCellCache({
+ required this.gridId,
+ });
+
+ void remove(String fieldId) {
+ _cellDataByFieldId.remove(fieldId);
+ }
+
+ void insert(GridCellCacheKey key, T value) {
+ var map = _cellDataByFieldId[key.fieldId];
+ if (map == null) {
+ _cellDataByFieldId[key.fieldId] = {};
+ map = _cellDataByFieldId[key.fieldId];
+ }
+
+ map![key.rowId] = value.object;
+ }
+
+ T? get(GridCellCacheKey key) {
+ final map = _cellDataByFieldId[key.fieldId];
+ if (map == null) {
+ return null;
+ } else {
+ final value = map[key.rowId];
+ if (value is T) {
+ return value;
+ } else {
+ if (value != null) {
+ Log.error("Expected value type: $T, but receive $value");
+ }
+ return null;
+ }
+ }
+ }
+
+ Future dispose() async {
+ _cellDataByFieldId.clear();
+ }
+}
diff --git a/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_loader.dart b/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_loader.dart
index 676e3f66d0..c4b3430199 100644
--- a/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_loader.dart
+++ b/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_loader.dart
@@ -3,60 +3,28 @@ part of 'cell_service.dart';
abstract class IGridCellDataConfig {
// The cell data will reload if it receives the field's change notification.
bool get reloadOnFieldChanged;
-
- // When the reloadOnCellChanged is true, it will load the cell data after user input.
- // For example: The number cell reload the cell data that carries the format
- // user input: 12
- // cell display: $12
- bool get reloadOnCellChanged;
}
-class GridCellDataConfig implements IGridCellDataConfig {
- @override
- final bool reloadOnCellChanged;
-
- @override
- final bool reloadOnFieldChanged;
-
- const GridCellDataConfig({
- this.reloadOnCellChanged = false,
- this.reloadOnFieldChanged = false,
- });
-}
-
-abstract class IGridCellDataLoader {
- Future loadData();
-
- IGridCellDataConfig get config;
-}
-
-abstract class ICellDataParser {
+abstract class IGridCellDataParser {
T? parserData(List data);
}
-class GridCellDataLoader extends IGridCellDataLoader {
+class GridCellDataLoader {
final CellService service = CellService();
- final GridCell gridCell;
- final ICellDataParser parser;
-
- @override
- final IGridCellDataConfig config;
+ final GridCellIdentifier cellId;
+ final IGridCellDataParser parser;
+ final bool reloadOnFieldChanged;
GridCellDataLoader({
- required this.gridCell,
+ required this.cellId,
required this.parser,
- this.config = const GridCellDataConfig(),
+ this.reloadOnFieldChanged = false,
});
- @override
Future loadData() {
- final fut = service.getCell(
- gridId: gridCell.gridId,
- fieldId: gridCell.field.id,
- rowId: gridCell.rowId,
- );
+ final fut = service.getCell(cellId: cellId);
return fut.then(
- (result) => result.fold((Cell cell) {
+ (result) => result.fold((GridCellPB cell) {
try {
return parser.parserData(cell.data);
} catch (e, s) {
@@ -72,30 +40,7 @@ class GridCellDataLoader extends IGridCellDataLoader {
}
}
-class SelectOptionCellDataLoader extends IGridCellDataLoader {
- final SelectOptionService service;
- final GridCell gridCell;
- SelectOptionCellDataLoader({
- required this.gridCell,
- }) : service = SelectOptionService(gridCell: gridCell);
- @override
- Future loadData() async {
- return service.getOpitonContext().then((result) {
- return result.fold(
- (data) => data,
- (err) {
- Log.error(err);
- return null;
- },
- );
- });
- }
-
- @override
- IGridCellDataConfig get config => const GridCellDataConfig(reloadOnFieldChanged: true);
-}
-
-class StringCellDataParser implements ICellDataParser {
+class StringCellDataParser implements IGridCellDataParser {
@override
String? parserData(List data) {
final s = utf8.decode(data);
@@ -103,32 +48,32 @@ class StringCellDataParser implements ICellDataParser {
}
}
-class DateCellDataParser implements ICellDataParser {
+class DateCellDataParser implements IGridCellDataParser {
@override
- DateCellData? parserData(List data) {
+ DateCellDataPB? parserData(List data) {
if (data.isEmpty) {
return null;
}
- return DateCellData.fromBuffer(data);
+ return DateCellDataPB.fromBuffer(data);
}
}
-class SelectOptionCellDataParser implements ICellDataParser {
+class SelectOptionCellDataParser implements IGridCellDataParser {
@override
- SelectOptionCellData? parserData(List data) {
+ SelectOptionCellDataPB? parserData(List data) {
if (data.isEmpty) {
return null;
}
- return SelectOptionCellData.fromBuffer(data);
+ return SelectOptionCellDataPB.fromBuffer(data);
}
}
-class URLCellDataParser implements ICellDataParser {
+class URLCellDataParser implements IGridCellDataParser {
@override
- URLCellData? parserData(List data) {
+ URLCellDataPB? parserData(List data) {
if (data.isEmpty) {
return null;
}
- return URLCellData.fromBuffer(data);
+ return URLCellDataPB.fromBuffer(data);
}
}
diff --git a/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_persistence.dart b/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_persistence.dart
index 2ad217e062..71927bae14 100644
--- a/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_persistence.dart
+++ b/frontend/app_flowy/lib/workspace/application/grid/cell/cell_service/cell_data_persistence.dart
@@ -1,25 +1,22 @@
part of 'cell_service.dart';
-abstract class _GridCellDataPersistence {
+/// Save the cell data to disk
+/// You can extend this class to do custom operations. For example, the DateCellDataPersistence.
+abstract class IGridCellDataPersistence {
Future